authhero 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +126 -7
- package/dist/authhero.cjs +376 -0
- package/dist/authhero.css +1 -0
- package/dist/authhero.d.ts +49161 -0
- package/dist/authhero.mjs +46785 -0
- package/dist/stats.html +4949 -0
- package/package.json +99 -23
- package/.changeset/README.md +0 -8
- package/.changeset/config.json +0 -11
- package/.github/workflows/release.yml +0 -34
- package/.prettierignore +0 -3
- package/.prettierrc.json +0 -1
- package/apps/react-admin/.eslintrc.js +0 -21
- package/apps/react-admin/README.md +0 -50
- package/apps/react-admin/index.html +0 -125
- package/apps/react-admin/package.json +0 -45
- package/apps/react-admin/prettier.config.js +0 -1
- package/apps/react-admin/public/favicon.ico +0 -0
- package/apps/react-admin/public/manifest.json +0 -15
- package/apps/react-admin/src/App.spec.tsx +0 -39
- package/apps/react-admin/src/App.tsx +0 -75
- package/apps/react-admin/src/Layout.tsx +0 -12
- package/apps/react-admin/src/TenantsApp.tsx +0 -21
- package/apps/react-admin/src/auth0DataProvider.ts +0 -220
- package/apps/react-admin/src/authProvider.ts +0 -42
- package/apps/react-admin/src/components/TenantAppBar.tsx +0 -46
- package/apps/react-admin/src/components/TenantLayout.tsx +0 -17
- package/apps/react-admin/src/components/applications/create.tsx +0 -29
- package/apps/react-admin/src/components/applications/edit.tsx +0 -40
- package/apps/react-admin/src/components/applications/index.ts +0 -3
- package/apps/react-admin/src/components/applications/list.tsx +0 -37
- package/apps/react-admin/src/components/common/DateAgo.tsx +0 -6
- package/apps/react-admin/src/components/common/JsonOutput.tsx +0 -3
- package/apps/react-admin/src/components/common/index.ts +0 -1
- package/apps/react-admin/src/components/connections/create.tsx +0 -11
- package/apps/react-admin/src/components/connections/edit.tsx +0 -66
- package/apps/react-admin/src/components/connections/index.ts +0 -3
- package/apps/react-admin/src/components/connections/list.tsx +0 -15
- package/apps/react-admin/src/components/domains/create.tsx +0 -11
- package/apps/react-admin/src/components/domains/edit.tsx +0 -49
- package/apps/react-admin/src/components/domains/index.ts +0 -3
- package/apps/react-admin/src/components/domains/list.tsx +0 -15
- package/apps/react-admin/src/components/listActions/PostListActions.tsx +0 -10
- package/apps/react-admin/src/components/tenants/create.tsx +0 -15
- package/apps/react-admin/src/components/tenants/edit.tsx +0 -51
- package/apps/react-admin/src/components/tenants/index.ts +0 -2
- package/apps/react-admin/src/components/tenants/list.tsx +0 -48
- package/apps/react-admin/src/components/users/create.tsx +0 -15
- package/apps/react-admin/src/components/users/edit.tsx +0 -108
- package/apps/react-admin/src/components/users/index.ts +0 -3
- package/apps/react-admin/src/components/users/list.tsx +0 -30
- package/apps/react-admin/src/data.json +0 -121
- package/apps/react-admin/src/dataProvider.ts +0 -48
- package/apps/react-admin/src/index.tsx +0 -30
- package/apps/react-admin/src/lib/logs.ts +0 -19
- package/apps/react-admin/src/vite-env.d.ts +0 -1
- package/apps/react-admin/tsconfig.json +0 -9
- package/apps/react-admin/tsconfig.node.json +0 -4
- package/apps/react-admin/vercel.json +0 -20
- package/apps/react-admin/vite.config.ts +0 -19
- package/eslint.config.mjs +0 -25
- package/packages/authhero/CHANGELOG.md +0 -7
- package/packages/authhero/README.md +0 -9
- package/packages/authhero/package.json +0 -25
- package/packages/authhero/src/bun.ts +0 -16
- package/packages/authhero/src/index.ts +0 -34
- package/packages/authhero/src/routes/oauth2/index.ts +0 -1
- package/packages/authhero/src/routes/oauth2/well-known.ts +0 -179
- package/packages/authhero/src/types/Bindings.ts +0 -7
- package/packages/authhero/src/types/JWKS.ts +0 -37
- package/packages/authhero/src/types/Variables.ts +0 -1
- package/packages/authhero/src/types/index.ts +0 -3
- package/packages/authhero/src/vite-env.d.ts +0 -1
- package/packages/authhero/tsconfig.json +0 -11
- package/packages/authhero/tsconfig.node.json +0 -4
- package/packages/authhero/vite.config.ts +0 -11
- package/packages/create-authhero/package.json +0 -22
- package/packages/create-authhero/src/index.ts +0 -72
- package/packages/create-authhero/src/vite-env.d.ts +0 -1
- package/packages/create-authhero/templates/sqlite/package.json +0 -17
- package/packages/create-authhero/templates/sqlite/src/index.ts +0 -19
- package/packages/create-authhero/templates/sqlite/yarn.lock +0 -48
- package/packages/create-authhero/tsconfig.json +0 -9
- package/packages/create-authhero/tsconfig.node.json +0 -4
- package/packages/create-authhero/vite.config.ts +0 -14
- package/pnpm-workspace.yaml +0 -3
- package/tsconfig.json +0 -31
- package/tsconfig.node.json +0 -9
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@hono/zod-openapi");var I=class extends Error{res;status;constructor(t=500,e){super(e?.message,{cause:e?.cause}),this.res=e?.res,this.status=t}getResponse(){return this.res?new Response(this.res.body,{status:this.status,headers:this.res.headers}):new Response(this.message,{status:this.status})}};const de=t=>typeof t=="string",fo=()=>{let t,e;const n=new Promise((r,i)=>{t=r,e=i});return n.resolve=t,n.reject=e,n},oh=t=>t==null?"":""+t,r3=(t,e,n)=>{t.forEach(r=>{e[r]&&(n[r]=e[r])})},i3=/###/g,sh=t=>t&&t.indexOf("###")>-1?t.replace(i3,"."):t,ah=t=>!t||de(t),Uo=(t,e,n)=>{const r=de(e)?e.split("."):e;let i=0;for(;i<r.length-1;){if(ah(t))return{};const s=sh(r[i]);!t[s]&&n&&(t[s]=new n),Object.prototype.hasOwnProperty.call(t,s)?t=t[s]:t={},++i}return ah(t)?{}:{obj:t,k:sh(r[i])}},ch=(t,e,n)=>{const{obj:r,k:i}=Uo(t,e,Object);if(r!==void 0||e.length===1){r[i]=n;return}let s=e[e.length-1],a=e.slice(0,e.length-1),c=Uo(t,a,Object);for(;c.obj===void 0&&a.length;)s=`${a[a.length-1]}.${s}`,a=a.slice(0,a.length-1),c=Uo(t,a,Object),c?.obj&&typeof c.obj[`${c.k}.${s}`]<"u"&&(c.obj=void 0);c.obj[`${c.k}.${s}`]=n},o3=(t,e,n,r)=>{const{obj:i,k:s}=Uo(t,e,Object);i[s]=i[s]||[],i[s].push(n)},Ba=(t,e)=>{const{obj:n,k:r}=Uo(t,e);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},s3=(t,e,n)=>{const r=Ba(t,n);return r!==void 0?r:Ba(e,n)},q1=(t,e,n)=>{for(const r in e)r!=="__proto__"&&r!=="constructor"&&(r in t?de(t[r])||t[r]instanceof String||de(e[r])||e[r]instanceof String?n&&(t[r]=e[r]):q1(t[r],e[r],n):t[r]=e[r]);return t},di=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var a3={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const c3=t=>de(t)?t.replace(/[&<>"'\/]/g,e=>a3[e]):t;class l3{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const n=this.regExpMap.get(e);if(n!==void 0)return n;const r=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,r),this.regExpQueue.push(e),r}}const u3=[" ",",","?","!",";"],d3=new l3(20),p3=(t,e,n)=>{e=e||"",n=n||"";const r=u3.filter(a=>e.indexOf(a)<0&&n.indexOf(a)<0);if(r.length===0)return!0;const i=d3.getRegExp(`(${r.map(a=>a==="?"?"\\?":a).join("|")})`);let s=!i.test(t);if(!s){const a=t.indexOf(n);a>0&&!i.test(t.substring(0,a))&&(s=!0)}return s},kd=(t,e,n=".")=>{if(!t)return;if(t[e])return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;const r=e.split(n);let i=t;for(let s=0;s<r.length;){if(!i||typeof i!="object")return;let a,c="";for(let l=s;l<r.length;++l)if(l!==s&&(c+=n),c+=r[l],a=i[c],a!==void 0){if(["string","number","boolean"].indexOf(typeof a)>-1&&l<r.length-1)continue;s+=l-s+1;break}i=a}return i},Zo=t=>t?.replace("_","-"),f3={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){console?.[t]?.apply?.(console,e)}};class Da{constructor(e,n={}){this.init(e,n)}init(e,n={}){this.prefix=n.prefix||"i18next:",this.logger=e||f3,this.options=n,this.debug=n.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,n,r,i){return i&&!this.debug?null:(de(e[0])&&(e[0]=`${r}${this.prefix} ${e[0]}`),this.logger[n](e))}create(e){return new Da(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new Da(this.logger,e)}}var mn=new Da;class Vc{constructor(){this.observers={}}on(e,n){return e.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const i=this.observers[r].get(n)||0;this.observers[r].set(n,i+1)}),this}off(e,n){if(this.observers[e]){if(!n){delete this.observers[e];return}this.observers[e].delete(n)}}emit(e,...n){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([i,s])=>{for(let a=0;a<s;a++)i(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([i,s])=>{for(let a=0;a<s;a++)i.apply(i,[e,...n])})}}class lh extends Vc{constructor(e,n={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const n=this.options.ns.indexOf(e);n>-1&&this.options.ns.splice(n,1)}getResource(e,n,r,i={}){const s=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,a=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let c;e.indexOf(".")>-1?c=e.split("."):(c=[e,n],r&&(Array.isArray(r)?c.push(...r):de(r)&&s?c.push(...r.split(s)):c.push(r)));const l=Ba(this.data,c);return!l&&!n&&!r&&e.indexOf(".")>-1&&(e=c[0],n=c[1],r=c.slice(2).join(".")),l||!a||!de(r)?l:kd(this.data?.[e]?.[n],r,s)}addResource(e,n,r,i,s={silent:!1}){const a=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let c=[e,n];r&&(c=c.concat(a?r.split(a):r)),e.indexOf(".")>-1&&(c=e.split("."),i=n,n=c[1]),this.addNamespaces(n),ch(this.data,c,i),s.silent||this.emit("added",e,n,r,i)}addResources(e,n,r,i={silent:!1}){for(const s in r)(de(r[s])||Array.isArray(r[s]))&&this.addResource(e,n,s,r[s],{silent:!0});i.silent||this.emit("added",e,n,r)}addResourceBundle(e,n,r,i,s,a={silent:!1,skipCopy:!1}){let c=[e,n];e.indexOf(".")>-1&&(c=e.split("."),i=r,r=n,n=c[1]),this.addNamespaces(n);let l=Ba(this.data,c)||{};a.skipCopy||(r=JSON.parse(JSON.stringify(r))),i?q1(l,r,s):l={...l,...r},ch(this.data,c,l),a.silent||this.emit("added",e,n,r)}removeResourceBundle(e,n){this.hasResourceBundle(e,n)&&delete this.data[e][n],this.removeNamespaces(n),this.emit("removed",e,n)}hasResourceBundle(e,n){return this.getResource(e,n)!==void 0}getResourceBundle(e,n){return n||(n=this.options.defaultNS),this.getResource(e,n)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const n=this.getDataByLanguage(e);return!!(n&&Object.keys(n)||[]).find(i=>n[i]&&Object.keys(n[i]).length>0)}toJSON(){return this.data}}var F1={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,n,r,i){return t.forEach(s=>{e=this.processors[s]?.process(e,n,r,i)??e}),e}};const H1=Symbol("i18next/PATH_KEY");function h3(){const t=[],e=Object.create(null);let n;return e.get=(r,i)=>(n?.revoke?.(),i===H1?t:(t.push(i),n=Proxy.revocable(r,e),n.proxy)),Proxy.revocable(Object.create(null),e).proxy}function $d(t,e){const{[H1]:n}=t(h3());return n.join(e?.keySeparator??".")}const uh={},pu=t=>!de(t)&&typeof t!="boolean"&&typeof t!="number";class Ua extends Vc{constructor(e,n={}){super(),r3(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=mn.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,n={interpolation:{}}){const r={...n};if(e==null)return!1;const i=this.resolve(e,r);if(i?.res===void 0)return!1;const s=pu(i.res);return!(r.returnObjects===!1&&s)}extractFromKey(e,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let s=n.ns||this.options.defaultNS||[];const a=r&&e.indexOf(r)>-1,c=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!p3(e,r,i);if(a&&!c){const l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:de(s)?[s]:s};const u=e.split(r);(r!==i||r===i&&this.options.ns.indexOf(u[0])>-1)&&(s=u.shift()),e=u.join(i)}return{key:e,namespaces:de(s)?[s]:s}}translate(e,n,r){let i=typeof n=="object"?{...n}:n;if(typeof i!="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i=="object"&&(i={...i}),i||(i={}),e==null)return"";typeof e=="function"&&(e=$d(e,{...this.options,...i})),Array.isArray(e)||(e=[String(e)]);const s=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,a=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,{key:c,namespaces:l}=this.extractFromKey(e[e.length-1],i),u=l[l.length-1];let d=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;d===void 0&&(d=":");const f=i.lng||this.language,p=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(f?.toLowerCase()==="cimode")return p?s?{res:`${u}${d}${c}`,usedKey:c,exactUsedKey:c,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(i)}:`${u}${d}${c}`:s?{res:c,usedKey:c,exactUsedKey:c,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(i)}:c;const h=this.resolve(e,i);let m=h?.res;const y=h?.usedKey||c,w=h?.exactUsedKey||c,_=["[object Number]","[object Function]","[object RegExp]"],k=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject,$=i.count!==void 0&&!de(i.count),b=Ua.hasDefaultValue(i),z=$?this.pluralResolver.getSuffix(f,i.count,i):"",A=i.ordinal&&$?this.pluralResolver.getSuffix(f,i.count,{ordinal:!1}):"",N=$&&!i.ordinal&&i.count===0,O=N&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${z}`]||i[`defaultValue${A}`]||i.defaultValue;let L=m;v&&!m&&b&&(L=O);const C=pu(L),P=Object.prototype.toString.apply(L);if(v&&L&&C&&_.indexOf(P)<0&&!(de(k)&&Array.isArray(L))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const M=this.options.returnedObjectHandler?this.options.returnedObjectHandler(y,L,{...i,ns:l}):`key '${c} (${this.language})' returned an object instead of string.`;return s?(h.res=M,h.usedParams=this.getUsedParamsDetails(i),h):M}if(a){const M=Array.isArray(L),K=M?[]:{},B=M?w:y;for(const oe in L)if(Object.prototype.hasOwnProperty.call(L,oe)){const ae=`${B}${a}${oe}`;b&&!m?K[oe]=this.translate(ae,{...i,defaultValue:pu(O)?O[oe]:void 0,joinArrays:!1,ns:l}):K[oe]=this.translate(ae,{...i,joinArrays:!1,ns:l}),K[oe]===ae&&(K[oe]=L[oe])}m=K}}else if(v&&de(k)&&Array.isArray(m))m=m.join(k),m&&(m=this.extendTranslation(m,e,i,r));else{let M=!1,K=!1;!this.isValidLookup(m)&&b&&(M=!0,m=O),this.isValidLookup(m)||(K=!0,m=c);const oe=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&K?void 0:m,ae=b&&O!==m&&this.options.updateMissing;if(K||M||ae){if(this.logger.log(ae?"updateKey":"missingKey",f,u,c,ae?O:m),a){const Ne=this.resolve(c,{...i,keySeparator:!1});Ne&&Ne.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let se=[];const ve=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ve&&ve[0])for(let Ne=0;Ne<ve.length;Ne++)se.push(ve[Ne]);else this.options.saveMissingTo==="all"?se=this.languageUtils.toResolveHierarchy(i.lng||this.language):se.push(i.lng||this.language);const Ce=(Ne,We,F)=>{const Be=b&&F!==m?F:oe;this.options.missingKeyHandler?this.options.missingKeyHandler(Ne,u,We,Be,ae,i):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(Ne,u,We,Be,ae,i),this.emit("missingKey",Ne,u,We,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&$?se.forEach(Ne=>{const We=this.pluralResolver.getSuffixes(Ne,i);N&&i[`defaultValue${this.options.pluralSeparator}zero`]&&We.indexOf(`${this.options.pluralSeparator}zero`)<0&&We.push(`${this.options.pluralSeparator}zero`),We.forEach(F=>{Ce([Ne],c+F,i[`defaultValue${F}`]||O)})}):Ce(se,c,O))}m=this.extendTranslation(m,e,i,h,r),K&&m===c&&this.options.appendNamespaceToMissingKey&&(m=`${u}${d}${c}`),(K||M)&&this.options.parseMissingKeyHandler&&(m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${d}${c}`:c,M?m:void 0,i))}return s?(h.res=m,h.usedParams=this.getUsedParamsDetails(i),h):m}extendTranslation(e,n,r,i,s){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const l=de(e)&&(r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let u;if(l){const f=e.match(this.interpolator.nestingRegexp);u=f&&f.length}let d=r.replace&&!de(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(d={...this.options.interpolation.defaultVariables,...d}),e=this.interpolator.interpolate(e,d,r.lng||this.language||i.usedLng,r),l){const f=e.match(this.interpolator.nestingRegexp),p=f&&f.length;u<p&&(r.nest=!1)}!r.lng&&i&&i.res&&(r.lng=this.language||i.usedLng),r.nest!==!1&&(e=this.interpolator.nest(e,(...f)=>s?.[0]===f[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${f[0]} in key: ${n[0]}`),null):this.translate(...f,n),r)),r.interpolation&&this.interpolator.reset()}const a=r.postProcess||this.options.postProcess,c=de(a)?[a]:a;return e!=null&&c?.length&&r.applyPostProcessor!==!1&&(e=F1.handle(c,e,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),e}resolve(e,n={}){let r,i,s,a,c;return de(e)&&(e=[e]),e.forEach(l=>{if(this.isValidLookup(r))return;const u=this.extractFromKey(l,n),d=u.key;i=d;let f=u.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const p=n.count!==void 0&&!de(n.count),h=p&&!n.ordinal&&n.count===0,m=n.context!==void 0&&(de(n.context)||typeof n.context=="number")&&n.context!=="",y=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);f.forEach(w=>{this.isValidLookup(r)||(c=w,!uh[`${y[0]}-${w}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(c)&&(uh[`${y[0]}-${w}`]=!0,this.logger.warn(`key "${i}" for languages "${y.join(", ")}" won't get resolved as namespace "${c}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),y.forEach(_=>{if(this.isValidLookup(r))return;a=_;const k=[d];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(k,d,_,w,n);else{let $;p&&($=this.pluralResolver.getSuffix(_,n.count,n));const b=`${this.options.pluralSeparator}zero`,z=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(p&&(n.ordinal&&$.indexOf(z)===0&&k.push(d+$.replace(z,this.options.pluralSeparator)),k.push(d+$),h&&k.push(d+b)),m){const A=`${d}${this.options.contextSeparator||"_"}${n.context}`;k.push(A),p&&(n.ordinal&&$.indexOf(z)===0&&k.push(A+$.replace(z,this.options.pluralSeparator)),k.push(A+$),h&&k.push(A+b))}}let v;for(;v=k.pop();)this.isValidLookup(r)||(s=v,r=this.getResource(_,w,v,n))}))})}),{res:r,usedKey:i,exactUsedKey:s,usedLng:a,usedNS:c}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,n,r,i={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,n,r,i):this.resourceStore.getResource(e,n,r,i)}getUsedParamsDetails(e={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=e.replace&&!de(e.replace);let i=r?e.replace:e;if(r&&typeof e.count<"u"&&(i.count=e.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!r){i={...i};for(const s of n)delete i[s]}return i}static hasDefaultValue(e){const n="defaultValue";for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&n===r.substring(0,n.length)&&e[r]!==void 0)return!0;return!1}}class dh{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=mn.create("languageUtils")}getScriptPartFromCode(e){if(e=Zo(e),!e||e.indexOf("-")<0)return null;const n=e.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(e){if(e=Zo(e),!e||e.indexOf("-")<0)return e;const n=e.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(e){if(de(e)&&e.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(e)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let n;return e.forEach(r=>{if(n)return;const i=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(i))&&(n=i)}),!n&&this.options.supportedLngs&&e.forEach(r=>{if(n)return;const i=this.getScriptPartFromCode(r);if(this.isSupportedCode(i))return n=i;const s=this.getLanguagePartFromCode(r);if(this.isSupportedCode(s))return n=s;n=this.options.supportedLngs.find(a=>{if(a===s)return a;if(!(a.indexOf("-")<0&&s.indexOf("-")<0)&&(a.indexOf("-")>0&&s.indexOf("-")<0&&a.substring(0,a.indexOf("-"))===s||a.indexOf(s)===0&&s.length>1))return a})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(e,n){if(!e)return[];if(typeof e=="function"&&(e=e(n)),de(e)&&(e=[e]),Array.isArray(e))return e;if(!n)return e.default||[];let r=e[n];return r||(r=e[this.getScriptPartFromCode(n)]),r||(r=e[this.formatLanguageCode(n)]),r||(r=e[this.getLanguagePartFromCode(n)]),r||(r=e.default),r||[]}toResolveHierarchy(e,n){const r=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],e),i=[],s=a=>{a&&(this.isSupportedCode(a)?i.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return de(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(e))):de(e)&&s(this.formatLanguageCode(e)),r.forEach(a=>{i.indexOf(a)<0&&s(this.formatLanguageCode(a))}),i}}const ph={zero:0,one:1,two:2,few:3,many:4,other:5},fh={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class g3{constructor(e,n={}){this.languageUtils=e,this.options=n,this.logger=mn.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,n){this.rules[e]=n}clearCache(){this.pluralRulesCache={}}getRule(e,n={}){const r=Zo(e==="dev"?"en":e),i=n.ordinal?"ordinal":"cardinal",s=JSON.stringify({cleanedCode:r,type:i});if(s in this.pluralRulesCache)return this.pluralRulesCache[s];let a;try{a=new Intl.PluralRules(r,{type:i})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),fh;if(!e.match(/-|_/))return fh;const l=this.languageUtils.getLanguagePartFromCode(e);a=this.getRule(l,n)}return this.pluralRulesCache[s]=a,a}needsPlural(e,n={}){let r=this.getRule(e,n);return r||(r=this.getRule("dev",n)),r?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,n,r={}){return this.getSuffixes(e,r).map(i=>`${n}${i}`)}getSuffixes(e,n={}){let r=this.getRule(e,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((i,s)=>ph[i]-ph[s]).map(i=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(e,n,r={}){const i=this.getRule(e,r);return i?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${i.select(n)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",n,r))}}const hh=(t,e,n,r=".",i=!0)=>{let s=s3(t,e,n);return!s&&i&&de(n)&&(s=kd(t,n,r),s===void 0&&(s=kd(e,n,r))),s},fu=t=>t.replace(/\$/g,"$$$$");class gh{constructor(e={}){this.logger=mn.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(n=>n),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:i,prefix:s,prefixEscaped:a,suffix:c,suffixEscaped:l,formatSeparator:u,unescapeSuffix:d,unescapePrefix:f,nestingPrefix:p,nestingPrefixEscaped:h,nestingSuffix:m,nestingSuffixEscaped:y,nestingOptionsSeparator:w,maxReplaces:_,alwaysFormat:k}=e.interpolation;this.escape=n!==void 0?n:c3,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=s?di(s):a||"{{",this.suffix=c?di(c):l||"}}",this.formatSeparator=u||",",this.unescapePrefix=d?"":f||"-",this.unescapeSuffix=this.unescapePrefix?"":d||"",this.nestingPrefix=p?di(p):h||di("$t("),this.nestingSuffix=m?di(m):y||di(")"),this.nestingOptionsSeparator=w||",",this.maxReplaces=_||1e3,this.alwaysFormat=k!==void 0?k:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(n,r)=>n?.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,n,r,i){let s,a,c;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=h=>{if(h.indexOf(this.formatSeparator)<0){const _=hh(n,l,h,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(_,void 0,r,{...i,...n,interpolationkey:h}):_}const m=h.split(this.formatSeparator),y=m.shift().trim(),w=m.join(this.formatSeparator).trim();return this.format(hh(n,l,y,this.options.keySeparator,this.options.ignoreJSONStructure),w,r,{...i,...n,interpolationkey:y})};this.resetRegExp();const d=i?.missingInterpolationHandler||this.options.missingInterpolationHandler,f=i?.interpolation?.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:h=>fu(h)},{regex:this.regexp,safeValue:h=>this.escapeValue?fu(this.escape(h)):fu(h)}].forEach(h=>{for(c=0;s=h.regex.exec(e);){const m=s[1].trim();if(a=u(m),a===void 0)if(typeof d=="function"){const w=d(e,s,i);a=de(w)?w:""}else if(i&&Object.prototype.hasOwnProperty.call(i,m))a="";else if(f){a=s[0];continue}else this.logger.warn(`missed to pass in variable ${m} for interpolating ${e}`),a="";else!de(a)&&!this.useRawValueToEscape&&(a=oh(a));const y=h.safeValue(a);if(e=e.replace(s[0],y),f?(h.regex.lastIndex+=a.length,h.regex.lastIndex-=s[0].length):h.regex.lastIndex=0,c++,c>=this.maxReplaces)break}}),e}nest(e,n,r={}){let i,s,a;const c=(l,u)=>{const d=this.nestingOptionsSeparator;if(l.indexOf(d)<0)return l;const f=l.split(new RegExp(`${d}[ ]*{`));let p=`{${f[1]}`;l=f[0],p=this.interpolate(p,a);const h=p.match(/'/g),m=p.match(/"/g);((h?.length??0)%2===0&&!m||m.length%2!==0)&&(p=p.replace(/'/g,'"'));try{a=JSON.parse(p),u&&(a={...u,...a})}catch(y){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,y),`${l}${d}${p}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,l};for(;i=this.nestingRegexp.exec(e);){let l=[];a={...r},a=a.replace&&!de(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;const u=/{.*}/.test(i[1])?i[1].lastIndexOf("}")+1:i[1].indexOf(this.formatSeparator);if(u!==-1&&(l=i[1].slice(u).split(this.formatSeparator).map(d=>d.trim()).filter(Boolean),i[1]=i[1].slice(0,u)),s=n(c.call(this,i[1].trim(),a),a),s&&i[0]===e&&!de(s))return s;de(s)||(s=oh(s)),s||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`),s=""),l.length&&(s=l.reduce((d,f)=>this.format(d,f,r.lng,{...r,interpolationkey:i[1].trim()}),s.trim())),e=e.replace(i[0],s),this.regexp.lastIndex=0}return e}}const m3=t=>{let e=t.toLowerCase().trim();const n={};if(t.indexOf("(")>-1){const r=t.split("(");e=r[0].toLowerCase().trim();const i=r[1].substring(0,r[1].length-1);e==="currency"&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):e==="relativetime"&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach(a=>{if(a){const[c,...l]=a.split(":"),u=l.join(":").trim().replace(/^'+|'+$/g,""),d=c.trim();n[d]||(n[d]=u),u==="false"&&(n[d]=!1),u==="true"&&(n[d]=!0),isNaN(u)||(n[d]=parseInt(u,10))}})}return{formatName:e,formatOptions:n}},mh=t=>{const e={};return(n,r,i)=>{let s=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(s={...s,[i.interpolationkey]:void 0});const a=r+JSON.stringify(s);let c=e[a];return c||(c=t(Zo(r),i),e[a]=c),c(n)}},_3=t=>(e,n,r)=>t(Zo(n),r)(e);class y3{constructor(e={}){this.logger=mn.create("formatter"),this.options=e,this.init(e)}init(e,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const r=n.cacheInBuiltFormats?mh:_3;this.formats={number:r((i,s)=>{const a=new Intl.NumberFormat(i,{...s});return c=>a.format(c)}),currency:r((i,s)=>{const a=new Intl.NumberFormat(i,{...s,style:"currency"});return c=>a.format(c)}),datetime:r((i,s)=>{const a=new Intl.DateTimeFormat(i,{...s});return c=>a.format(c)}),relativetime:r((i,s)=>{const a=new Intl.RelativeTimeFormat(i,{...s});return c=>a.format(c,s.range||"day")}),list:r((i,s)=>{const a=new Intl.ListFormat(i,{...s});return c=>a.format(c)})}}add(e,n){this.formats[e.toLowerCase().trim()]=n}addCached(e,n){this.formats[e.toLowerCase().trim()]=mh(n)}format(e,n,r,i={}){const s=n.split(this.formatSeparator);if(s.length>1&&s[0].indexOf("(")>1&&s[0].indexOf(")")<0&&s.find(c=>c.indexOf(")")>-1)){const c=s.findIndex(l=>l.indexOf(")")>-1);s[0]=[s[0],...s.splice(1,c)].join(this.formatSeparator)}return s.reduce((c,l)=>{const{formatName:u,formatOptions:d}=m3(l);if(this.formats[u]){let f=c;try{const p=i?.formatParams?.[i.interpolationkey]||{},h=p.locale||p.lng||i.locale||i.lng||r;f=this.formats[u](c,h,{...d,...i,...p})}catch(p){this.logger.warn(p)}return f}else this.logger.warn(`there was no format function for ${u}`);return c},e)}}const b3=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class w3 extends Vc{constructor(e,n,r,i={}){super(),this.backend=e,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=i,this.logger=mn.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(r,i.backend,i)}queueLoad(e,n,r,i){const s={},a={},c={},l={};return e.forEach(u=>{let d=!0;n.forEach(f=>{const p=`${u}|${f}`;!r.reload&&this.store.hasResourceBundle(u,f)?this.state[p]=2:this.state[p]<0||(this.state[p]===1?a[p]===void 0&&(a[p]=!0):(this.state[p]=1,d=!1,a[p]===void 0&&(a[p]=!0),s[p]===void 0&&(s[p]=!0),l[f]===void 0&&(l[f]=!0)))}),d||(c[u]=!0)}),(Object.keys(s).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(s),pending:Object.keys(a),toLoadLanguages:Object.keys(c),toLoadNamespaces:Object.keys(l)}}loaded(e,n,r){const i=e.split("|"),s=i[0],a=i[1];n&&this.emit("failedLoading",s,a,n),!n&&r&&this.store.addResourceBundle(s,a,r,void 0,void 0,{skipCopy:!0}),this.state[e]=n?-1:2,n&&r&&(this.state[e]=0);const c={};this.queue.forEach(l=>{o3(l.loaded,[s],a),b3(l,e),n&&l.errors.push(n),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(u=>{c[u]||(c[u]={});const d=l.loaded[u];d.length&&d.forEach(f=>{c[u][f]===void 0&&(c[u][f]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",c),this.queue=this.queue.filter(l=>!l.done)}read(e,n,r,i=0,s=this.retryTimeout,a){if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:n,fcName:r,tried:i,wait:s,callback:a});return}this.readingCalls++;const c=(u,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(u&&d&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,e,n,r,i+1,s*2,a)},s);return}a(u,d)},l=this.backend[r].bind(this.backend);if(l.length===2){try{const u=l(e,n);u&&typeof u.then=="function"?u.then(d=>c(null,d)).catch(c):c(null,u)}catch(u){c(u)}return}return l(e,n,c)}prepareLoading(e,n,r={},i){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();de(e)&&(e=this.languageUtils.toResolveHierarchy(e)),de(n)&&(n=[n]);const s=this.queueLoad(e,n,r,i);if(!s.toLoad.length)return s.pending.length||i(),null;s.toLoad.forEach(a=>{this.loadOne(a)})}load(e,n,r){this.prepareLoading(e,n,{},r)}reload(e,n,r){this.prepareLoading(e,n,{reload:!0},r)}loadOne(e,n=""){const r=e.split("|"),i=r[0],s=r[1];this.read(i,s,"read",void 0,void 0,(a,c)=>{a&&this.logger.warn(`${n}loading namespace ${s} for language ${i} failed`,a),!a&&c&&this.logger.log(`${n}loaded namespace ${s} for language ${i}`,c),this.loaded(e,a,c)})}saveMissing(e,n,r,i,s,a={},c=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend?.create){const l={...a,isUpdate:s},u=this.backend.create.bind(this.backend);if(u.length<6)try{let d;u.length===5?d=u(e,n,r,i,l):d=u(e,n,r,i),d&&typeof d.then=="function"?d.then(f=>c(null,f)).catch(c):c(null,d)}catch(d){c(d)}else u(e,n,r,i,c,l)}!e||!e[0]||this.store.addResource(e[0],n,r,i)}}}const _h=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),de(t[1])&&(e.defaultValue=t[1]),de(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const n=t[3]||t[2];Object.keys(n).forEach(r=>{e[r]=n[r]})}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),yh=t=>(de(t.ns)&&(t.ns=[t.ns]),de(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),de(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs?.indexOf?.("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),typeof t.initImmediate=="boolean"&&(t.initAsync=t.initImmediate),t),na=()=>{},v3=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})};class Mo extends Vc{constructor(e={},n){if(super(),this.options=yh(e),this.services={},this.logger=mn,this.modules={external:[]},v3(this),n&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,n),this;setTimeout(()=>{this.init(e,n)},0)}}init(e={},n){this.isInitializing=!0,typeof e=="function"&&(n=e,e={}),e.defaultNS==null&&e.ns&&(de(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const r=_h();this.options={...r,...this.options,...yh(e)},this.options.interpolation={...r.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=r.overloadTranslationOptionHandler);const i=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?mn.init(i(this.modules.logger),this.options):mn.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=y3;const d=new dh(this.options);this.store=new lh(this.options.resources,this.options);const f=this.services;f.logger=mn,f.resourceStore=this.store,f.languageUtils=d,f.pluralResolver=new g3(d,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),u&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(f.formatter=i(u),f.formatter.init&&f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new gh(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new w3(i(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",(h,...m)=>{this.emit(h,...m)}),this.modules.languageDetector&&(f.languageDetector=i(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=i(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new Ua(this.services,this.options),this.translator.on("*",(h,...m)=>{this.emit(h,...m)}),this.modules.external.forEach(h=>{h.init&&h.init(this)})}if(this.format=this.options.interpolation.format,n||(n=na),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=(...d)=>this.store[u](...d)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=(...d)=>(this.store[u](...d),this)});const c=fo(),l=()=>{const u=(d,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),c.resolve(f),n(d,f)};if(this.languages&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?l():setTimeout(l,0),c}loadResources(e,n=na){let r=n;const i=de(e)?e:this.language;if(typeof e=="function"&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if(i?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const s=[],a=c=>{if(!c||c==="cimode")return;this.services.languageUtils.toResolveHierarchy(c).forEach(u=>{u!=="cimode"&&s.indexOf(u)<0&&s.push(u)})};i?a(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(l=>a(l)),this.options.preload?.forEach?.(c=>a(c)),this.services.backendConnector.load(s,this.options.ns,c=>{!c&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(c)})}else r(null)}reloadResources(e,n,r){const i=fo();return typeof e=="function"&&(r=e,e=void 0),typeof n=="function"&&(r=n,n=void 0),e||(e=this.languages),n||(n=this.options.ns),r||(r=na),this.services.backendConnector.reload(e,n,s=>{i.resolve(),r(s)}),i}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&F1.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1)){for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,n){this.isLanguageChangingTo=e;const r=fo();this.emit("languageChanging",e);const i=c=>{this.language=c,this.languages=this.services.languageUtils.toResolveHierarchy(c),this.resolvedLanguage=void 0,this.setResolvedLanguage(c)},s=(c,l)=>{l?this.isLanguageChangingTo===e&&(i(l),this.translator.changeLanguage(l),this.isLanguageChangingTo=void 0,this.emit("languageChanged",l),this.logger.log("languageChanged",l)):this.isLanguageChangingTo=void 0,r.resolve((...u)=>this.t(...u)),n&&n(c,(...u)=>this.t(...u))},a=c=>{!e&&!c&&this.services.languageDetector&&(c=[]);const l=de(c)?c:c&&c[0],u=this.store.hasLanguageSomeTranslations(l)?l:this.services.languageUtils.getBestMatchFromCodes(de(c)?[c]:c);u&&(this.language||i(u),this.translator.language||this.translator.changeLanguage(u),this.services.languageDetector?.cacheUserLanguage?.(u)),this.loadResources(u,d=>{s(d,u)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(e),r}getFixedT(e,n,r){const i=(s,a,...c)=>{let l;typeof a!="object"?l=this.options.overloadTranslationOptionHandler([s,a].concat(c)):l={...a},l.lng=l.lng||i.lng,l.lngs=l.lngs||i.lngs,l.ns=l.ns||i.ns,l.keyPrefix!==""&&(l.keyPrefix=l.keyPrefix||r||i.keyPrefix);const u=this.options.keySeparator||".";let d;return l.keyPrefix&&Array.isArray(s)?d=s.map(f=>(typeof f=="function"&&(f=$d(f,{...this.options,...a})),`${l.keyPrefix}${u}${f}`)):(typeof s=="function"&&(s=$d(s,{...this.options,...a})),d=l.keyPrefix?`${l.keyPrefix}${u}${s}`:s),this.t(d,l)};return de(e)?i.lng=e:i.lngs=e,i.ns=n,i.keyPrefix=r,i}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,s=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const a=(c,l)=>{const u=this.services.backendConnector.state[`${c}|${l}`];return u===-1||u===0||u===2};if(n.precheck){const c=n.precheck(this,a);if(c!==void 0)return c}return!!(this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(r,e)&&(!i||a(s,e)))}loadNamespaces(e,n){const r=fo();return this.options.ns?(de(e)&&(e=[e]),e.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{r.resolve(),n&&n(i)}),r):(n&&n(),Promise.resolve())}loadLanguages(e,n){const r=fo();de(e)&&(e=[e]);const i=this.options.preload||[],s=e.filter(a=>i.indexOf(a)<0&&this.services.languageUtils.isSupportedCode(a));return s.length?(this.options.preload=i.concat(s),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";try{const i=new Intl.Locale(e);if(i&&i.getTextInfo){const s=i.getTextInfo();if(s&&s.direction)return s.direction}}catch{}const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services?.languageUtils||new dh(_h());return e.toLowerCase().indexOf("-latn")>1?"ltr":n.indexOf(r.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},n){const r=new Mo(e,n);return r.createInstance=Mo.createInstance,r}cloneInstance(e={},n=na){const r=e.forkResourceStore;r&&delete e.forkResourceStore;const i={...this.options,...e,isClone:!0},s=new Mo(i);if((e.debug!==void 0||e.prefix!==void 0)&&(s.logger=s.logger.clone(e)),["store","services","language"].forEach(c=>{s[c]=this[c]}),s.services={...this.services},s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},r){const c=Object.keys(this.store.data).reduce((l,u)=>(l[u]={...this.store.data[u]},l[u]=Object.keys(l[u]).reduce((d,f)=>(d[f]={...l[u][f]},d),l[u]),l),{});s.store=new lh(c,i),s.services.resourceStore=s.store}return e.interpolation&&(s.services.interpolator=new gh(i)),s.translator=new Ua(s.services,i),s.translator.on("*",(c,...l)=>{s.emit(c,...l)}),s.init(i,n),s.translator.options=i,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const E=Mo.createInstance();E.createInstance;E.dir;E.init;E.loadResources;E.reloadResources;E.use;E.changeLanguage;E.getFixedT;const ue=E.t;E.exists;E.setDefaultNamespace;E.hasLoadedNamespace;E.loadNamespaces;E.loadLanguages;var V1=t=>{const n={...{origin:"*",allowMethods:["GET","HEAD","PUT","POST","DELETE","PATCH"],allowHeaders:[],exposeHeaders:[]},...t},r=(s=>typeof s=="string"?s==="*"?()=>s:a=>s===a?a:null:typeof s=="function"?s:a=>s.includes(a)?a:null)(n.origin),i=(s=>typeof s=="function"?s:Array.isArray(s)?()=>s:()=>[])(n.allowMethods);return async function(a,c){function l(d,f){a.res.headers.set(d,f)}const u=await r(a.req.header("origin")||"",a);if(u&&l("Access-Control-Allow-Origin",u),n.credentials&&l("Access-Control-Allow-Credentials","true"),n.exposeHeaders?.length&&l("Access-Control-Expose-Headers",n.exposeHeaders.join(",")),a.req.method==="OPTIONS"){n.origin!=="*"&&l("Vary","Origin"),n.maxAge!=null&&l("Access-Control-Max-Age",n.maxAge.toString());const d=await i(a.req.header("origin")||"",a);d.length&&l("Access-Control-Allow-Methods",d.join(","));let f=n.allowHeaders;if(!f?.length){const p=a.req.header("Access-Control-Request-Headers");p&&(f=p.split(/\s*,\s*/))}return f?.length&&(l("Access-Control-Allow-Headers",f.join(",")),a.res.headers.append("Vary","Access-Control-Request-Headers")),a.res.headers.delete("Content-Length"),a.res.headers.delete("Content-Type"),new Response(null,{headers:a.res.headers,status:204,statusText:"No Content"})}await c(),n.origin!=="*"&&a.header("Vary","Origin",{append:!0})}};const ti=o.z.object({created_at:o.z.string(),updated_at:o.z.string()}),x3=o.z.enum(["AUTH0","EMAIL","REDIRECT"]),k3=o.z.enum(["CREATE_USER","GET_USER","UPDATE_USER","SEND_REQUEST","SEND_EMAIL"]),$3=o.z.enum(["VERIFY_EMAIL"]),K1=o.z.object({require_mx_record:o.z.boolean().optional(),block_aliases:o.z.boolean().optional(),block_free_emails:o.z.boolean().optional(),block_disposable_emails:o.z.boolean().optional(),blocklist:o.z.array(o.z.string()).optional(),allowlist:o.z.array(o.z.string()).optional()}),G1=o.z.object({id:o.z.string(),alias:o.z.string().max(100).optional(),type:o.z.literal("AUTH0"),action:o.z.literal("UPDATE_USER"),allow_failure:o.z.boolean().optional(),mask_output:o.z.boolean().optional(),params:o.z.object({connection_id:o.z.string().optional(),user_id:o.z.string(),changes:o.z.record(o.z.string(),o.z.any())})}),W1=o.z.object({id:o.z.string(),alias:o.z.string().max(100).optional(),type:o.z.literal("EMAIL"),action:o.z.literal("VERIFY_EMAIL"),allow_failure:o.z.boolean().optional(),mask_output:o.z.boolean().optional(),params:o.z.object({email:o.z.string(),rules:K1.optional()})}),J1=o.z.enum(["change-email","account","custom"]),X1=o.z.object({id:o.z.string(),alias:o.z.string().max(100).optional(),type:o.z.literal("REDIRECT"),action:o.z.literal("REDIRECT_USER"),allow_failure:o.z.boolean().optional(),mask_output:o.z.boolean().optional(),params:o.z.object({target:J1.openapi({description:"The predefined target to redirect to, or 'custom' for a custom URL"}),custom_url:o.z.string().optional().openapi({description:"Custom URL to redirect to when target is 'custom'"})})}),Z1=o.z.union([G1,W1,X1]),Ma=o.z.object({name:o.z.string().min(1).max(150).openapi({description:"The name of the flow"}),actions:o.z.array(Z1).optional().default([]).openapi({description:"The list of actions to execute in sequence"})}),vi=Ma.extend({...ti.shape,id:o.z.string().openapi({description:"Unique identifier for the flow",example:"af_12tMpdJ3iek7svMyZkSh5M"})}),S3=o.z.object({page:o.z.string().min(0).optional().default("0").transform(t=>parseInt(t,10)).openapi({description:"The page number where 0 is the first page"}),per_page:o.z.string().min(1).optional().default("10").transform(t=>parseInt(t,10)).openapi({description:"The number of items per page"}),include_totals:o.z.string().optional().default("false").transform(t=>t==="true").openapi({description:"If the total number of items should be included in the response"}),sort:o.z.string().regex(/^.+:(-1|1)$/).optional().openapi({description:"A property that should have the format 'string:-1' or 'string:1'"}),q:o.z.string().optional().openapi({description:"A lucene query string used to filter the results"})}),xt=o.z.object({start:o.z.number(),limit:o.z.number(),length:o.z.number()}),Y1=o.z.object({email:o.z.string().optional(),email_verified:o.z.boolean().optional(),name:o.z.string().optional(),username:o.z.string().optional(),given_name:o.z.string().optional(),phone_number:o.z.string().optional(),phone_verified:o.z.boolean().optional(),family_name:o.z.string().optional()}).catchall(o.z.any()),Q1=o.z.object({connection:o.z.string(),user_id:o.z.string(),provider:o.z.string(),isSocial:o.z.boolean(),access_token:o.z.string().optional(),access_token_secret:o.z.string().optional(),refresh_token:o.z.string().optional(),profileData:Y1.optional()}),Kc=o.z.object({email:o.z.string().optional().transform(t=>t&&t.toLowerCase()),username:o.z.string().optional(),phone_number:o.z.string().optional(),given_name:o.z.string().optional(),family_name:o.z.string().optional(),nickname:o.z.string().optional(),name:o.z.string().optional(),picture:o.z.string().optional(),locale:o.z.string().optional(),linked_to:o.z.string().optional(),profileData:o.z.string().optional(),user_id:o.z.string().optional(),app_metadata:o.z.any().default({}).optional(),user_metadata:o.z.any().default({}).optional()}),qa=Kc.extend({email_verified:o.z.boolean().default(!1),verify_email:o.z.boolean().optional(),last_ip:o.z.string().optional(),last_login:o.z.string().optional(),user_id:o.z.string().optional(),provider:o.z.string().optional(),connection:o.z.string(),is_social:o.z.boolean().optional()}),m0=o.z.object({...qa.shape,...ti.shape,user_id:o.z.string(),provider:o.z.string(),is_social:o.z.boolean(),email:o.z.string().optional(),login_count:o.z.number().default(0),identities:o.z.array(Q1).optional()}),hn=m0,z3=Kc.extend({login_count:o.z.number(),multifactor:o.z.array(o.z.string()).optional(),last_ip:o.z.string().optional(),last_login:o.z.string().optional(),user_id:o.z.string()}).catchall(o.z.any()),A3="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let E3=(t=21)=>{let e="",n=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=A3[n[t]&63];return e};const Fa=o.z.object({client_id:o.z.string().openapi({description:"ID of this client."}),name:o.z.string().min(1).openapi({description:"Name of this client (min length: 1 character, does not allow < or >)."}),description:o.z.string().max(140).optional().openapi({description:"Free text description of this client (max length: 140 characters)."}),global:o.z.boolean().default(!1).openapi({description:"Whether this is your global 'All Applications' client representing legacy tenant settings (true) or a regular client (false)."}),client_secret:o.z.string().default(()=>E3()).optional().openapi({description:"Client secret (which you must not make public)."}),app_type:o.z.enum(["native","spa","regular_web","non_interactive","resource_server","express_configuration","rms","box","cloudbees","concur","dropbox","mscrm","echosign","egnyte","newrelic","office365","salesforce","sentry","sharepoint","slack","springcm","zendesk","zoom","sso_integration","oag"]).default("regular_web").optional().openapi({description:"The type of application this client represents"}),logo_uri:o.z.string().url().optional().openapi({description:"URL of the logo to display for this client. Recommended size is 150x150 pixels."}),is_first_party:o.z.boolean().default(!1).openapi({description:"Whether this client a first party client (true) or not (false)."}),oidc_conformant:o.z.boolean().default(!0).openapi({description:"Whether this client conforms to strict OIDC specifications (true) or uses legacy features (false)."}),callbacks:o.z.array(o.z.string()).default([]).optional().openapi({description:"Comma-separated list of URLs whitelisted for Auth0 to use as a callback to the client after authentication."}),allowed_origins:o.z.array(o.z.string()).default([]).optional().openapi({description:"Comma-separated list of URLs allowed to make requests from JavaScript to Auth0 API (typically used with CORS). By default, all your callback URLs will be allowed. This field allows you to enter other origins if necessary. You can also use wildcards at the subdomain level (e.g., https://*.contoso.com). Query strings and hash information are not taken into account when validating these URLs."}),web_origins:o.z.array(o.z.string()).default([]).optional().openapi({description:"Comma-separated list of allowed origins for use with Cross-Origin Authentication, Device Flow, and web message response mode."}),client_aliases:o.z.array(o.z.string()).default([]).optional().openapi({description:"List of audiences/realms for SAML protocol. Used by the wsfed addon."}),allowed_clients:o.z.array(o.z.string()).default([]).optional().openapi({description:"List of allow clients and API ids that are allowed to make delegation requests. Empty means all all your clients are allowed."}),connections:o.z.array(o.z.string()).default([]).optional().openapi({description:"List of connection IDs enabled for this client. The order determines the display order on the login page."}),allowed_logout_urls:o.z.array(o.z.string()).default([]).optional().openapi({description:"Comma-separated list of URLs that are valid to redirect to after logout from Auth0. Wildcards are allowed for subdomains."}),session_transfer:o.z.record(o.z.any()).default({}).optional().openapi({description:"Native to Web SSO Configuration"}),oidc_logout:o.z.record(o.z.any()).default({}).optional().openapi({description:"Configuration for OIDC backchannel logout"}),grant_types:o.z.array(o.z.string()).default([]).optional().openapi({description:"List of grant types supported for this application. Can include authorization_code, implicit, refresh_token, client_credentials, password, http://auth0.com/oauth/grant-type/password-realm, http://auth0.com/oauth/grant-type/mfa-oob, http://auth0.com/oauth/grant-type/mfa-otp, http://auth0.com/oauth/grant-type/mfa-recovery-code, urn:openid:params:grant-type:ciba, and urn:ietf:params:oauth:grant-type:device_code."}),jwt_configuration:o.z.record(o.z.any()).default({}).optional().openapi({description:"Configuration related to JWTs for the client."}),signing_keys:o.z.array(o.z.record(o.z.any())).default([]).optional().openapi({description:"Signing certificates associated with this client."}),encryption_key:o.z.record(o.z.any()).default({}).optional().openapi({description:"Encryption used for WsFed responses with this client."}),sso:o.z.boolean().default(!1).openapi({description:"Applies only to SSO clients and determines whether Auth0 will handle Single Sign On (true) or whether the Identity Provider will (false)."}),sso_disabled:o.z.boolean().default(!0).openapi({description:"Whether Single Sign On is disabled (true) or enabled (true). Defaults to true."}),cross_origin_authentication:o.z.boolean().default(!1).openapi({description:"Whether this client can be used to make cross-origin authentication requests (true) or it is not allowed to make such requests (false)."}),cross_origin_loc:o.z.string().url().optional().openapi({description:"URL of the location in your site where the cross origin verification takes place for the cross-origin auth flow when performing Auth in your own domain instead of Auth0 hosted login page."}),custom_login_page_on:o.z.boolean().default(!1).openapi({description:"Whether a custom login page is to be used (true) or the default provided login page (false)."}),custom_login_page:o.z.string().optional().openapi({description:"The content (HTML, CSS, JS) of the custom login page."}),custom_login_page_preview:o.z.string().optional().openapi({description:"The content (HTML, CSS, JS) of the custom login page. (Used on Previews)"}),form_template:o.z.string().optional().openapi({description:"HTML form template to be used for WS-Federation."}),addons:o.z.record(o.z.any()).default({}).optional().openapi({description:"Addons enabled for this client and their associated configurations."}),token_endpoint_auth_method:o.z.enum(["none","client_secret_post","client_secret_basic"]).default("client_secret_basic").optional().openapi({description:"Defines the requested authentication method for the token endpoint. Can be none (public client without a client secret), client_secret_post (client uses HTTP POST parameters), or client_secret_basic (client uses HTTP Basic)."}),client_metadata:o.z.record(o.z.string().max(255)).default({}).optional().openapi({description:'Metadata associated with the client, in the form of an object with string values (max 255 chars). Maximum of 10 metadata properties allowed. Field names (max 255 chars) are alphanumeric and may only include the following special characters: :,-+=_*?"/()<>@ [Tab][Space]'}),mobile:o.z.record(o.z.any()).default({}).optional().openapi({description:"Additional configuration for native mobile apps."}),initiate_login_uri:o.z.string().url().optional().openapi({description:"Initiate login uri, must be https"}),native_social_login:o.z.record(o.z.any()).default({}).optional(),refresh_token:o.z.record(o.z.any()).default({}).optional().openapi({description:"Refresh token configuration"}),default_organization:o.z.record(o.z.any()).default({}).optional().openapi({description:"Defines the default Organization ID and flows"}),organization_usage:o.z.enum(["deny","allow","require"]).default("deny").optional().openapi({description:"Defines how to proceed during an authentication transaction with regards an organization. Can be deny (default), allow or require."}),organization_require_behavior:o.z.enum(["no_prompt","pre_login_prompt","post_login_prompt"]).default("no_prompt").optional().openapi({description:"Defines how to proceed during an authentication transaction when client.organization_usage: 'require'. Can be no_prompt (default), pre_login_prompt or post_login_prompt. post_login_prompt requires oidc_conformant: true."}),client_authentication_methods:o.z.record(o.z.any()).default({}).optional().openapi({description:"Defines client authentication methods."}),require_pushed_authorization_requests:o.z.boolean().default(!1).openapi({description:"Makes the use of Pushed Authorization Requests mandatory for this client"}),require_proof_of_possession:o.z.boolean().default(!1).openapi({description:"Makes the use of Proof-of-Possession mandatory for this client"}),signed_request_object:o.z.record(o.z.any()).default({}).optional().openapi({description:"JWT-secured Authorization Requests (JAR) settings."}),compliance_level:o.z.enum(["none","fapi1_adv_pkj_par","fapi1_adv_mtls_par","fapi2_sp_pkj_mtls","fapi2_sp_mtls_mtls"]).optional().openapi({description:"Defines the compliance level for this client, which may restrict it's capabilities"}),par_request_expiry:o.z.number().optional().openapi({description:"Specifies how long, in seconds, a Pushed Authorization Request URI remains valid"}),token_quota:o.z.record(o.z.any()).default({}).optional()}),Ar=o.z.object({created_at:o.z.string(),updated_at:o.z.string(),...Fa.shape}),Ha=o.z.object({client_id:o.z.string().min(1).openapi({description:"ID of the client."}),audience:o.z.string().min(1).openapi({description:"The audience (API identifier) of this client grant."}),scope:o.z.array(o.z.string()).optional().openapi({description:"Scopes allowed for this client grant."}),organization_usage:o.z.enum(["deny","allow","require"]).optional().openapi({description:"Defines whether organizations can be used with client credentials exchanges for this grant."}),allow_any_organization:o.z.boolean().optional().openapi({description:"If enabled, any organization can be used with this grant. If disabled (default), the grant must be explicitly assigned to the desired organizations."}),is_system:o.z.boolean().optional().openapi({description:"If enabled, this grant is a special grant created by Auth0. It cannot be modified or deleted directly."}),subject_type:o.z.enum(["client","user"]).optional().openapi({description:"The type of application access the client grant allows. Use of this field is subject to the applicable Free Trial terms in Okta's Master Subscription Agreement."}),authorization_details_types:o.z.array(o.z.string()).optional().openapi({description:"Types of authorization_details allowed for this client grant. Use of this field is subject to the applicable Free Trial terms in Okta's Master Subscription Agreement."})}),Er=o.z.object({id:o.z.string().openapi({description:"ID of the client grant."}),...Ha.shape,created_at:o.z.string().optional(),updated_at:o.z.string().optional()}),C3=o.z.array(Er),ni=o.z.object({x:o.z.number(),y:o.z.number()});var _0=(t=>(t.RICH_TEXT="RICH_TEXT",t.NEXT_BUTTON="NEXT_BUTTON",t.BACK_BUTTON="BACK_BUTTON",t.SUBMIT_BUTTON="SUBMIT_BUTTON",t.DIVIDER="DIVIDER",t.TEXT="TEXT",t.EMAIL="EMAIL",t.PASSWORD="PASSWORD",t.NUMBER="NUMBER",t.PHONE="PHONE",t.DATE="DATE",t.CHECKBOX="CHECKBOX",t.RADIO="RADIO",t.SELECT="SELECT",t.HIDDEN="HIDDEN",t.LEGAL="LEGAL",t))(_0||{}),y0=(t=>(t.BLOCK="BLOCK",t.FIELD="FIELD",t))(y0||{});const Gc=o.z.object({id:o.z.string(),category:o.z.nativeEnum(y0),type:o.z.nativeEnum(_0)}),ey=Gc.extend({category:o.z.literal("BLOCK"),type:o.z.literal("RICH_TEXT"),config:o.z.object({content:o.z.string()}).passthrough()}),ty=Gc.extend({category:o.z.literal("BLOCK"),type:o.z.union([o.z.literal("NEXT_BUTTON"),o.z.literal("BACK_BUTTON"),o.z.literal("SUBMIT_BUTTON")]),config:o.z.object({text:o.z.string()}).passthrough()}),ny=Gc.extend({category:o.z.literal("FIELD"),type:o.z.literal("LEGAL"),required:o.z.boolean().optional(),sensitive:o.z.boolean().optional(),config:o.z.object({text:o.z.string()}).passthrough()}),ry=Gc.extend({category:o.z.literal("FIELD"),type:o.z.union([o.z.literal("TEXT"),o.z.literal("EMAIL"),o.z.literal("PASSWORD"),o.z.literal("NUMBER"),o.z.literal("PHONE"),o.z.literal("DATE"),o.z.literal("CHECKBOX"),o.z.literal("RADIO"),o.z.literal("SELECT"),o.z.literal("HIDDEN")]),required:o.z.boolean().optional(),sensitive:o.z.boolean().optional(),config:o.z.object({label:o.z.string().optional(),placeholder:o.z.string().optional()}).passthrough()}),iy=o.z.object({id:o.z.string(),category:o.z.string(),type:o.z.string()}).passthrough(),oy=o.z.union([ey,ty,ny,ry,iy]);var sy=(t=>(t.STEP="STEP",t.FLOW="FLOW",t.CONDITION="CONDITION",t.ACTION="ACTION",t))(sy||{});const ay=o.z.object({id:o.z.string(),type:o.z.literal("STEP"),coordinates:ni,alias:o.z.string().optional(),config:o.z.object({components:o.z.array(oy),next_node:o.z.string()}).passthrough()}),cy=o.z.object({id:o.z.string(),type:o.z.literal("FLOW"),coordinates:ni,alias:o.z.string().optional(),config:o.z.object({flow_id:o.z.string(),next_node:o.z.string()})}),ly=o.z.object({id:o.z.string(),type:o.z.literal("ACTION"),coordinates:ni,alias:o.z.string().optional(),config:o.z.object({action_type:o.z.enum(["REDIRECT"]).openapi({description:"The type of action to perform"}),target:o.z.enum(["change-email","account","custom"]).openapi({description:"The predefined target to redirect to"}),custom_url:o.z.string().optional().openapi({description:"Custom URL when target is 'custom'"}),next_node:o.z.string().openapi({description:"The next node to navigate to after action (for non-redirect actions)"})}).passthrough()}),uy=o.z.object({id:o.z.string(),type:o.z.string(),coordinates:ni}).passthrough(),dy=o.z.union([ay,cy,ly,uy]),py=o.z.object({next_node:o.z.string(),coordinates:ni}).passthrough(),fy=o.z.object({resume_flow:o.z.boolean().optional(),coordinates:ni}).passthrough(),hy=o.z.object({id:o.z.string(),name:o.z.string(),languages:o.z.object({primary:o.z.string()}).passthrough(),nodes:o.z.array(dy),start:py,ending:fy,created_at:o.z.string(),updated_at:o.z.string(),links:o.z.object({sdkSrc:o.z.string().optional(),sdk_src:o.z.string().optional()}).passthrough()}).passthrough(),N3=hy.omit({id:!0,created_at:!0,updated_at:!0});var Rt=(t=>(t.TOKEN="token",t.TOKEN_ID_TOKEN="token id_token",t.CODE="code",t))(Rt||{}),_n=(t=>(t.QUERY="query",t.FRAGMENT="fragment",t.FORM_POST="form_post",t.WEB_MESSAGE="web_message",t.SAML_POST="saml_post",t))(_n||{}),Wc=(t=>(t.S256="S256",t.Plain="plain",t))(Wc||{});const Yo=o.z.object({client_id:o.z.string(),act_as:o.z.string().optional(),response_type:o.z.nativeEnum(Rt).optional(),response_mode:o.z.nativeEnum(_n).optional(),redirect_uri:o.z.string().optional(),audience:o.z.string().optional(),organization:o.z.string().optional(),state:o.z.string().optional(),nonce:o.z.string().optional(),scope:o.z.string().optional(),prompt:o.z.string().optional(),code_challenge_method:o.z.nativeEnum(Wc).optional(),code_challenge:o.z.string().optional(),username:o.z.string().optional(),ui_locales:o.z.string().optional(),vendor_id:o.z.string().optional()}),Sd=o.z.object({colors:o.z.object({primary:o.z.string(),page_background:o.z.object({type:o.z.string().optional(),start:o.z.string().optional(),end:o.z.string().optional(),angle_deg:o.z.number().optional()}).optional()}).optional(),logo_url:o.z.string().optional(),favicon_url:o.z.string().optional(),powered_by_logo_url:o.z.string().optional(),font:o.z.object({url:o.z.string()}).optional()}),Si=o.z.object({kid:o.z.string().optional(),team_id:o.z.string().optional(),realms:o.z.string().optional(),authentication_method:o.z.string().optional(),client_id:o.z.string().optional(),client_secret:o.z.string().optional(),app_secret:o.z.string().optional(),scope:o.z.string().optional(),authorization_endpoint:o.z.string().optional(),token_endpoint:o.z.string().optional(),userinfo_endpoint:o.z.string().optional(),jwks_uri:o.z.string().optional(),discovery_url:o.z.string().optional(),issuer:o.z.string().optional(),provider:o.z.string().optional(),from:o.z.string().optional(),twilio_sid:o.z.string().optional(),twilio_token:o.z.string().optional(),icon_url:o.z.string().optional()}),Va=o.z.object({id:o.z.string().optional(),name:o.z.string(),display_name:o.z.string().optional(),strategy:o.z.string(),options:Si.default({}),enabled_clients:o.z.array(o.z.string()).default([]).optional(),response_type:o.z.custom().optional(),response_mode:o.z.custom().optional(),is_domain_connection:o.z.boolean().optional(),show_as_button:o.z.boolean().optional(),metadata:o.z.record(o.z.any()).optional(),is_system:o.z.boolean().optional()}),Ot=o.z.object({id:o.z.string(),created_at:o.z.string().transform(t=>t===null?"":t),updated_at:o.z.string().transform(t=>t===null?"":t)}).extend(Va.shape),b0=o.z.object({id:o.z.string().optional(),audience:o.z.string(),friendly_name:o.z.string(),picture_url:o.z.string().optional(),support_email:o.z.string().optional(),support_url:o.z.string().optional(),sender_email:o.z.string().email(),sender_name:o.z.string(),session_lifetime:o.z.number().optional(),idle_session_lifetime:o.z.number().optional(),ephemeral_session_lifetime:o.z.number().optional(),idle_ephemeral_session_lifetime:o.z.number().optional(),session_cookie:o.z.object({mode:o.z.enum(["persistent","non-persistent"]).optional()}).optional(),allowed_logout_urls:o.z.array(o.z.string()).optional(),default_redirection_uri:o.z.string().optional(),enabled_locales:o.z.array(o.z.string()).optional(),default_directory:o.z.string().optional(),error_page:o.z.object({html:o.z.string().optional(),show_log_link:o.z.boolean().optional(),url:o.z.string().optional()}).optional(),flags:o.z.object({allow_changing_enable_sso:o.z.boolean().optional(),allow_legacy_delegation_grant_types:o.z.boolean().optional(),allow_legacy_ro_grant_types:o.z.boolean().optional(),allow_legacy_tokeninfo_endpoint:o.z.boolean().optional(),change_pwd_flow_v1:o.z.boolean().optional(),custom_domains_provisioning:o.z.boolean().optional(),dashboard_insights_view:o.z.boolean().optional(),dashboard_log_streams_next:o.z.boolean().optional(),disable_clickjack_protection_headers:o.z.boolean().optional(),disable_fields_map_fix:o.z.boolean().optional(),disable_impersonation:o.z.boolean().optional(),disable_management_api_sms_obfuscation:o.z.boolean().optional(),enable_adfs_waad_email_verification:o.z.boolean().optional(),enable_apis_section:o.z.boolean().optional(),enable_client_connections:o.z.boolean().optional(),enable_custom_domain_in_emails:o.z.boolean().optional(),enable_dynamic_client_registration:o.z.boolean().optional(),enable_idtoken_api2:o.z.boolean().optional(),enable_legacy_logs_search_v2:o.z.boolean().optional(),enable_legacy_profile:o.z.boolean().optional(),enable_pipeline2:o.z.boolean().optional(),enable_public_signup_user_exists_error:o.z.boolean().optional(),enable_sso:o.z.boolean().optional(),enforce_client_authentication_on_passwordless_start:o.z.boolean().optional(),genai_trial:o.z.boolean().optional(),improved_signup_bot_detection_in_classic:o.z.boolean().optional(),mfa_show_factor_list_on_enrollment:o.z.boolean().optional(),no_disclose_enterprise_connections:o.z.boolean().optional(),remove_alg_from_jwks:o.z.boolean().optional(),revoke_refresh_token_grant:o.z.boolean().optional(),trust_azure_adfs_email_verified_connection_property:o.z.boolean().optional(),use_scope_descriptions_for_consent:o.z.boolean().optional(),inherit_global_permissions_in_organizations:o.z.boolean().optional()}).optional(),sandbox_version:o.z.string().optional(),legacy_sandbox_version:o.z.string().optional(),sandbox_versions_available:o.z.array(o.z.string()).optional(),change_password:o.z.object({enabled:o.z.boolean().optional(),html:o.z.string().optional()}).optional(),guardian_mfa_page:o.z.object({enabled:o.z.boolean().optional(),html:o.z.string().optional()}).optional(),device_flow:o.z.object({charset:o.z.enum(["base20","digits"]).optional(),mask:o.z.string().max(20).optional()}).optional(),default_token_quota:o.z.object({clients:o.z.object({client_credentials:o.z.record(o.z.any()).optional()}).optional(),organizations:o.z.object({client_credentials:o.z.record(o.z.any()).optional()}).optional()}).optional(),default_audience:o.z.string().optional(),default_organization:o.z.string().optional(),sessions:o.z.object({oidc_logout_prompt_enabled:o.z.boolean().optional()}).optional(),oidc_logout:o.z.object({rp_logout_end_session_endpoint_discovery:o.z.boolean().optional()}).optional(),allow_organization_name_in_authentication_api:o.z.boolean().optional(),customize_mfa_in_postlogin_action:o.z.boolean().optional(),acr_values_supported:o.z.array(o.z.string()).optional(),mtls:o.z.object({enable_endpoint_aliases:o.z.boolean().optional()}).optional(),pushed_authorization_requests_supported:o.z.boolean().optional(),authorization_response_iss_parameter_supported:o.z.boolean().optional()}),Ka=o.z.object({created_at:o.z.string().nullable().transform(t=>t??""),updated_at:o.z.string().nullable().transform(t=>t??""),...b0.shape,id:o.z.string()}),I3=o.z.object({...Ar.shape,tenant:Ka,connections:o.z.array(Ot)}),gy=o.z.enum(["password_reset","email_verification","otp","authorization_code","oauth2_state","ticket"]),my=o.z.object({code_id:o.z.string().openapi({description:"The code that will be used in for instance an email verification flow"}),login_id:o.z.string().openapi({description:"The id of the login session that the code is connected to"}),connection_id:o.z.string().optional().openapi({description:"The connection that the code is connected to"}),code_type:gy,code_verifier:o.z.string().optional().openapi({description:"The code verifier used in PKCE in outbound flows"}),code_challenge:o.z.string().optional().openapi({description:"The code challenge used in PKCE in outbound flows"}),code_challenge_method:o.z.enum(["plain","S256"]).optional().openapi({description:"The code challenge method used in PKCE in outbound flows"}),redirect_uri:o.z.string().optional().openapi({description:"The redirect URI associated with the code"}),nonce:o.z.string().optional().openapi({description:"The nonce value used for security in OIDC flows"}),state:o.z.string().optional().openapi({description:"The state parameter used for CSRF protection in OAuth flows"}),expires_at:o.z.string(),used_at:o.z.string().optional(),user_id:o.z.string().optional()}),j3=o.z.object({...my.shape,created_at:o.z.string()}),w0=o.z.object({domain:o.z.string(),custom_domain_id:o.z.string().optional(),type:o.z.enum(["auth0_managed_certs","self_managed_certs"]),verification_method:o.z.enum(["txt"]).optional(),tls_policy:o.z.enum(["recommended"]).optional(),custom_client_ip_header:o.z.enum(["true-client-ip","cf-connecting-ip","x-forwarded-for","x-azure-clientip","null"]).optional(),domain_metadata:o.z.record(o.z.string().max(255)).optional()}),_y=o.z.object({name:o.z.literal("txt"),record:o.z.string(),domain:o.z.string()}),Qn=o.z.object({...w0.shape,custom_domain_id:o.z.string(),primary:o.z.boolean(),status:o.z.enum(["disabled","pending","pending_verification","ready"]),origin_domain_name:o.z.string().optional(),verification:o.z.object({methods:o.z.array(_y)}).optional(),tls_policy:o.z.string().optional()}),T3=Qn.extend({tenant_id:o.z.string()}),v0=o.z.object({id:o.z.string(),order:o.z.number().optional(),visible:o.z.boolean().optional().default(!0)}),gr=v0.extend({category:o.z.literal("BLOCK").optional()}),O3=gr.extend({type:o.z.literal("DIVIDER"),config:o.z.object({}).optional()}),P3=gr.extend({type:o.z.literal("HTML"),config:o.z.object({content:o.z.string().optional()}).optional()}),R3=gr.extend({type:o.z.literal("IMAGE"),config:o.z.object({src:o.z.string().optional(),alt:o.z.string().optional(),width:o.z.number().optional(),height:o.z.number().optional()}).optional()}),L3=gr.extend({type:o.z.literal("JUMP_BUTTON"),config:o.z.object({text:o.z.string().optional(),target_step:o.z.string().optional()})}),B3=gr.extend({type:o.z.literal("RESEND_BUTTON"),config:o.z.object({text:o.z.string().optional(),resend_action:o.z.string().optional()})}),D3=gr.extend({type:o.z.literal("NEXT_BUTTON"),config:o.z.object({text:o.z.string().optional()})}),U3=gr.extend({type:o.z.literal("PREVIOUS_BUTTON"),config:o.z.object({text:o.z.string().optional()})}),M3=gr.extend({type:o.z.literal("RICH_TEXT"),config:o.z.object({content:o.z.string().optional()}).optional()}),x0=v0.extend({category:o.z.literal("WIDGET").optional(),label:o.z.string().min(1).optional(),hint:o.z.string().min(1).max(500).optional(),required:o.z.boolean().optional(),sensitive:o.z.boolean().optional()}),q3=x0.extend({type:o.z.literal("AUTH0_VERIFIABLE_CREDENTIALS"),config:o.z.object({credential_type:o.z.string().optional()})}),F3=x0.extend({type:o.z.literal("GMAPS_ADDRESS"),config:o.z.object({api_key:o.z.string().optional()})}),H3=x0.extend({type:o.z.literal("RECAPTCHA"),config:o.z.object({site_key:o.z.string().optional()})}),ft=v0.extend({category:o.z.literal("FIELD").optional(),label:o.z.string().min(1).optional(),hint:o.z.string().min(1).max(500).optional(),required:o.z.boolean().optional(),sensitive:o.z.boolean().optional()}),V3=ft.extend({type:o.z.literal("BOOLEAN"),config:o.z.object({default_value:o.z.boolean().optional()}).optional()}),K3=ft.extend({type:o.z.literal("CARDS"),config:o.z.object({options:o.z.array(o.z.object({value:o.z.string(),label:o.z.string(),description:o.z.string().optional(),image:o.z.string().optional()})).optional(),multi_select:o.z.boolean().optional()}).optional()}),G3=ft.extend({type:o.z.literal("CHOICE"),config:o.z.object({options:o.z.array(o.z.object({value:o.z.string(),label:o.z.string()})).optional(),display:o.z.enum(["radio","checkbox"]).optional()}).optional()}),W3=ft.extend({type:o.z.literal("CUSTOM"),config:o.z.object({component:o.z.string().optional(),props:o.z.record(o.z.any()).optional()})}),J3=ft.extend({type:o.z.literal("DATE"),config:o.z.object({format:o.z.string().optional(),min:o.z.string().optional(),max:o.z.string().optional()}).optional()}),X3=ft.extend({type:o.z.literal("DROPDOWN"),config:o.z.object({options:o.z.array(o.z.object({value:o.z.string(),label:o.z.string()})).optional(),placeholder:o.z.string().optional(),searchable:o.z.boolean().optional()}).optional()}),Z3=ft.extend({type:o.z.literal("EMAIL"),config:o.z.object({placeholder:o.z.string().optional()}).optional()}),Y3=ft.extend({type:o.z.literal("FILE"),config:o.z.object({accept:o.z.string().optional(),max_size:o.z.number().optional(),multiple:o.z.boolean().optional()}).optional()}),Q3=ft.extend({type:o.z.literal("LEGAL"),config:o.z.object({text:o.z.string(),html:o.z.boolean().optional()}).optional()}),e4=ft.extend({type:o.z.literal("NUMBER"),config:o.z.object({placeholder:o.z.string().optional(),min:o.z.number().optional(),max:o.z.number().optional(),step:o.z.number().optional()}).optional()}),t4=ft.extend({type:o.z.literal("PASSWORD"),config:o.z.object({placeholder:o.z.string().optional(),min_length:o.z.number().optional(),show_toggle:o.z.boolean().optional()}).optional()}),n4=ft.extend({type:o.z.literal("PAYMENT"),config:o.z.object({provider:o.z.string().optional(),currency:o.z.string().optional()}).optional()}),r4=ft.extend({type:o.z.literal("SOCIAL"),config:o.z.object({providers:o.z.array(o.z.string()).optional()}).optional()}),i4=ft.extend({type:o.z.literal("TEL"),config:o.z.object({placeholder:o.z.string().optional(),default_country:o.z.string().optional()}).optional()}),o4=ft.extend({type:o.z.literal("TEXT"),config:o.z.object({placeholder:o.z.string().optional(),multiline:o.z.boolean().optional(),max_length:o.z.number().optional()}).optional()}),s4=ft.extend({type:o.z.literal("URL"),config:o.z.object({placeholder:o.z.string().optional()}).optional()}),yy=o.z.discriminatedUnion("type",[O3,P3,R3,L3,B3,D3,U3,M3]),by=o.z.discriminatedUnion("type",[q3,F3,H3]),wy=o.z.discriminatedUnion("type",[V3,K3,G3,W3,J3,X3,Z3,Y3,Q3,e4,t4,n4,r4,i4,o4,s4]),k0=o.z.union([yy,by,wy]),a4=o.z.object({id:o.z.string(),type:o.z.literal("submit"),label:o.z.string(),className:o.z.string().optional(),disabled:o.z.boolean().optional().default(!1),order:o.z.number().optional(),visible:o.z.boolean().optional().default(!0),customizations:o.z.record(o.z.string(),o.z.any()).optional()}),Qo=o.z.object({x:o.z.number(),y:o.z.number()}),c4=o.z.object({id:o.z.string(),type:o.z.literal("FLOW"),coordinates:Qo,alias:o.z.string().min(1).max(150).optional(),config:o.z.object({flow_id:o.z.string().max(30),next_node:o.z.string().optional()})}),l4=o.z.object({id:o.z.string(),type:o.z.literal("ROUTER"),coordinates:Qo,alias:o.z.string().min(1).max(150),config:o.z.object({rules:o.z.array(o.z.object({id:o.z.string(),alias:o.z.string().min(1).max(150).optional(),condition:o.z.any(),next_node:o.z.string()})),fallback:o.z.string()})}),u4=o.z.object({id:o.z.string(),type:o.z.literal("STEP"),coordinates:Qo,alias:o.z.string().min(1).max(150).optional(),config:o.z.object({components:o.z.array(k0),next_node:o.z.string().optional()})}),vy=o.z.discriminatedUnion("type",[c4,l4,u4]),Ga=o.z.object({name:o.z.string().openapi({description:"The name of the form"}),messages:o.z.object({errors:o.z.record(o.z.string(),o.z.any()).optional(),custom:o.z.record(o.z.string(),o.z.any()).optional()}).optional(),languages:o.z.object({primary:o.z.string().optional(),default:o.z.string().optional()}).optional(),translations:o.z.record(o.z.string(),o.z.any()).optional(),nodes:o.z.array(vy).optional(),start:o.z.object({hidden_fields:o.z.array(o.z.object({key:o.z.string(),value:o.z.string()})).optional(),next_node:o.z.string().optional(),coordinates:Qo.optional()}).optional(),ending:o.z.object({redirection:o.z.object({delay:o.z.number().optional(),target:o.z.string().optional()}).optional(),after_submit:o.z.object({flow_id:o.z.string().optional()}).optional(),coordinates:Qo.optional(),resume_flow:o.z.boolean().optional()}).optional(),style:o.z.object({css:o.z.string().optional()}).optional()}).openapi({description:"Schema for flow-based forms (matches Auth0 Forms structure)"}),xi=o.z.object({...ti.shape,...Ga.shape,id:o.z.string()}),xy=o.z.object({id:o.z.number().optional(),text:o.z.string(),type:o.z.enum(["info","error","success","warning"])}),ky=o.z.object({id:o.z.string().optional(),text:o.z.string(),href:o.z.string(),linkText:o.z.string().optional()}),d4=o.z.object({action:o.z.string(),method:o.z.enum(["POST","GET"]),title:o.z.string().optional(),description:o.z.string().optional(),components:o.z.array(k0),messages:o.z.array(xy).optional(),links:o.z.array(ky).optional()});function p4(t){return t.category==="BLOCK"}function f4(t){return t.category==="WIDGET"}function h4(t){return t.category==="FIELD"}const $y=o.z.enum(["pre-user-registration","post-user-registration","post-user-login","validate-registration-username","pre-user-deletion","post-user-deletion"]),Sy=o.z.enum(["pre-user-registration","post-user-registration","post-user-login","validate-registration-username","pre-user-deletion","post-user-deletion"]),Jc={enabled:o.z.boolean().default(!1),synchronous:o.z.boolean().default(!1),priority:o.z.number().optional(),hook_id:o.z.string().optional()},g4=o.z.object({...Jc,trigger_id:$y,url:o.z.string()}),m4=o.z.object({...Jc,trigger_id:Sy,form_id:o.z.string()}),ba=o.z.union([g4,m4]),_4=o.z.object({...Jc,trigger_id:$y,...ti.shape,hook_id:o.z.string(),url:o.z.string()}),y4=o.z.object({...Jc,trigger_id:Sy,...ti.shape,hook_id:o.z.string(),form_id:o.z.string()}),ki=o.z.union([_4,y4]),zy=o.z.object({name:o.z.string().optional()}),Ay=o.z.object({email:o.z.string().optional()}),$0=o.z.object({organization_id:o.z.string().max(50),inviter:zy,invitee:Ay,invitation_url:o.z.string().url(),client_id:o.z.string(),connection_id:o.z.string().optional(),app_metadata:o.z.record(o.z.any()).default({}).optional(),user_metadata:o.z.record(o.z.any()).default({}).optional(),ttl_sec:o.z.number().int().max(2592e3).default(604800).optional(),roles:o.z.array(o.z.string()).default([]).optional(),send_invitation_email:o.z.boolean().default(!0).optional()}),qo=o.z.object({id:o.z.string(),organization_id:o.z.string().max(50),created_at:o.z.string().datetime(),expires_at:o.z.string().datetime(),ticket_id:o.z.string().optional()}).extend($0.shape),S0=o.z.object({alg:o.z.enum(["RS256","RS384","RS512","ES256","ES384","ES512","HS256","HS384","HS512"]),e:o.z.string(),kid:o.z.string(),kty:o.z.enum(["RSA","EC","oct"]),n:o.z.string(),x5t:o.z.string().optional(),x5c:o.z.array(o.z.string()).optional(),use:o.z.enum(["sig","enc"]).optional()}),Ey=o.z.object({keys:o.z.array(S0)}),zd=o.z.object({issuer:o.z.string(),authorization_endpoint:o.z.string(),token_endpoint:o.z.string(),device_authorization_endpoint:o.z.string(),userinfo_endpoint:o.z.string(),mfa_challenge_endpoint:o.z.string(),jwks_uri:o.z.string(),registration_endpoint:o.z.string(),revocation_endpoint:o.z.string(),scopes_supported:o.z.array(o.z.string()),response_types_supported:o.z.array(o.z.string()),code_challenge_methods_supported:o.z.array(o.z.string()),response_modes_supported:o.z.array(o.z.string()),subject_types_supported:o.z.array(o.z.string()),id_token_signing_alg_values_supported:o.z.array(o.z.string()),token_endpoint_auth_methods_supported:o.z.array(o.z.string()),claims_supported:o.z.array(o.z.string()),request_uri_parameter_supported:o.z.boolean(),request_parameter_supported:o.z.boolean(),token_endpoint_auth_signing_alg_values_supported:o.z.array(o.z.string())}),Cy=o.z.object({csrf_token:o.z.string(),auth0Client:o.z.string().optional(),authParams:Yo,expires_at:o.z.string(),deleted_at:o.z.string().optional(),ip:o.z.string().optional(),useragent:o.z.string().optional(),session_id:o.z.string().optional(),authorization_url:o.z.string().optional(),login_completed:o.z.boolean().optional().default(!1)}).openapi({description:"This represents a login sesion"}),b4=o.z.object({...Cy.shape,id:o.z.string().openapi({description:"This is is used as the state in the universal login"}),created_at:o.z.string(),updated_at:o.z.string()}),ge={ACLS_SUMMARY:"acls_summary",ACTIONS_EXECUTION_FAILED:"actions_execution_failed",API_LIMIT:"api_limit",API_LIMIT_WARNING:"api_limit_warning",APPI:"appi",CIBA_EXCHANGE_FAILED:"ciba_exchange_failed",CIBA_EXCHANGE_SUCCEEDED:"ciba_exchange_succeeded",CIBA_START_FAILED:"ciba_start_failed",CIBA_START_SUCCEEDED:"ciba_start_succeeded",CODE_LINK_SENT:"cls",CODE_SENT:"cs",DEPRECATION_NOTICE:"depnote",FAILED_LOGIN:"f",FAILED_BY_CONNECTOR:"fc",FAILED_CHANGE_EMAIL:"fce",FAILED_BY_CORS:"fco",FAILED_CROSS_ORIGIN_AUTHENTICATION:"fcoa",FAILED_CHANGE_PASSWORD:"fcp",FAILED_POST_CHANGE_PASSWORD_HOOK:"fcph",FAILED_CHANGE_PHONE_NUMBER:"fcpn",FAILED_CHANGE_PASSWORD_REQUEST:"fcpr",FAILED_CONNECTOR_PROVISIONING:"fcpro",FAILED_CHANGE_USERNAME:"fcu",FAILED_DELEGATION:"fd",FAILED_DEVICE_ACTIVATION:"fdeac",FAILED_DEVICE_AUTHORIZATION_REQUEST:"fdeaz",USER_CANCELED_DEVICE_CONFIRMATION:"fdecc",FAILED_USER_DELETION:"fdu",FAILED_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN:"feacft",FAILED_EXCHANGE_ACCESS_TOKEN_FOR_CLIENT_CREDENTIALS:"feccft",FAILED_EXCHANGE_CUSTOM_TOKEN:"fecte",FAILED_EXCHANGE_DEVICE_CODE_FOR_ACCESS_TOKEN:"fede",FAILED_FEDERATED_LOGOUT:"federated_logout_failed",FAILED_EXCHANGE_NATIVE_SOCIAL_LOGIN:"fens",FAILED_EXCHANGE_PASSWORD_OOB_FOR_ACCESS_TOKEN:"feoobft",FAILED_EXCHANGE_PASSWORD_OTP_FOR_ACCESS_TOKEN:"feotpft",FAILED_EXCHANGE_PASSWORD_FOR_ACCESS_TOKEN:"fepft",FAILED_EXCHANGE_PASSWORDLESS_OTP_FOR_ACCESS_TOKEN:"fepotpft",FAILED_EXCHANGE_PASSWORD_MFA_RECOVERY_FOR_ACCESS_TOKEN:"fercft",FAILED_EXCHANGE_ROTATING_REFRESH_TOKEN:"ferrt",FAILED_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN:"fertft",FAILED_HOOK:"fh",FAILED_INVITE_ACCEPT:"fi",FAILED_LOGOUT:"flo",FLOWS_EXECUTION_COMPLETED:"flows_execution_completed",FLOWS_EXECUTION_FAILED:"flows_execution_failed",FAILED_SENDING_NOTIFICATION:"fn",FORMS_SUBMISSION_FAILED:"forms_submission_failed",FORMS_SUBMISSION_SUCCEEDED:"forms_submission_succeeded",FAILED_LOGIN_INCORRECT_PASSWORD:"fp",FAILED_PUSHED_AUTHORIZATION_REQUEST:"fpar",FAILED_POST_USER_REGISTRATION_HOOK:"fpurh",FAILED_SIGNUP:"fs",FAILED_SILENT_AUTH:"fsa",FAILED_LOGIN_INVALID_EMAIL_USERNAME:"fu",FAILED_USERS_IMPORT:"fui",FAILED_VERIFICATION_EMAIL:"fv",FAILED_VERIFICATION_EMAIL_REQUEST:"fvr",EMAIL_VERIFICATION_CONFIRMED:"gd_auth_email_verification",EMAIL_VERIFICATION_FAILED:"gd_auth_fail_email_verification",MFA_AUTH_FAILED:"gd_auth_failed",MFA_AUTH_REJECTED:"gd_auth_rejected",MFA_AUTH_SUCCESS:"gd_auth_succeed",MFA_ENROLLMENT_COMPLETE:"gd_enrollment_complete",TOO_MANY_MFA_FAILURES:"gd_otp_rate_limit_exceed",MFA_RECOVERY_FAILED:"gd_recovery_failed",MFA_RECOVERY_RATE_LIMIT_EXCEED:"gd_recovery_rate_limit_exceed",MFA_RECOVERY_SUCCESS:"gd_recovery_succeed",MFA_EMAIL_SENT:"gd_send_email",EMAIL_VERIFICATION_SENT:"gd_send_email_verification",EMAIL_VERIFICATION_SEND_FAILURE:"gd_send_email_verification_failure",PUSH_NOTIFICATION_SENT:"gd_send_pn",ERROR_SENDING_MFA_PUSH_NOTIFICATION:"gd_send_pn_failure",MFA_SMS_SENT:"gd_send_sms",ERROR_SENDING_MFA_SMS:"gd_send_sms_failure",MFA_VOICE_CALL_SUCCESS:"gd_send_voice",MFA_VOICE_CALL_FAILED:"gd_send_voice_failure",SECOND_FACTOR_STARTED:"gd_start_auth",MFA_ENROLL_STARTED:"gd_start_enroll",MFA_ENROLLMENT_FAILED:"gd_start_enroll_failed",GUARDIAN_TENANT_UPDATE:"gd_tenant_update",UNENROLL_DEVICE_ACCOUNT:"gd_unenroll",UPDATE_DEVICE_ACCOUNT:"gd_update_device_account",WEBAUTHN_CHALLENGE_FAILED:"gd_webauthn_challenge_failed",WEBAUTHN_ENROLLMENT_FAILED:"gd_webauthn_enrollment_failed",FAILED_KMS_API_OPERATION:"kms_key_management_failure",SUCCESS_KMS_API_OPERATION:"kms_key_management_success",KMS_KEY_STATE_CHANGED:"kms_key_state_changed",TOO_MANY_CALLS_TO_DELEGATION:"limit_delegation",BLOCKED_IP_ADDRESS:"limit_mu",BLOCKED_ACCOUNT_IP:"limit_sul",BLOCKED_ACCOUNT_EMAIL:"limit_wc",MFA_REQUIRED:"mfar",MANAGEMENT_API_READ_OPERATION:"mgmt_api_read",FAILED_AUTHENTICATION_METHOD_OPERATION_MY_ACCOUNT:"my_account_authentication_method_failed",SUCCESSFUL_AUTHENTICATION_METHOD_OPERATION_MY_ACCOUNT:"my_account_authentication_method_succeeded",FAILED_OIDC_BACKCHANNEL_LOGOUT:"oidc_backchannel_logout_failed",SUCCESSFUL_OIDC_BACKCHANNEL_LOGOUT:"oidc_backchannel_logout_succeeded",ORGANIZATION_MEMBER_ADDED:"organization_member_added",PASSKEY_CHALLENGE_FAILED:"passkey_challenge_failed",PASSKEY_CHALLENGE_STARTED:"passkey_challenge_started",PRE_LOGIN_ASSESSMENT:"pla",BREACHED_PASSWORD:"pwd_leak",BREACHED_PASSWORD_ON_RESET:"reset_pwd_leak",SUCCESS_RESOURCE_CLEANUP:"resource_cleanup",RICH_CONSENTS_ACCESS_ERROR:"rich_consents_access_error",SUCCESS_LOGIN:"s",SUCCESS_API_OPERATION:"sapi",SUCCESS_CHANGE_EMAIL:"sce",SUCCESS_CROSS_ORIGIN_AUTHENTICATION:"scoa",SUCCESS_CHANGE_PASSWORD:"scp",SUCCESS_CHANGE_PHONE_NUMBER:"scpn",SUCCESS_CHANGE_PASSWORD_REQUEST:"scpr",SUCCESS_CHANGE_USERNAME:"scu",SUCCESS_CREDENTIAL_VALIDATION:"scv",SUCCESS_DELEGATION:"sd",SUCCESS_USER_DELETION:"sdu",SUCCESS_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN:"seacft",SUCCESS_EXCHANGE_ACCESS_TOKEN_FOR_CLIENT_CREDENTIALS:"seccft",SUCCESS_EXCHANGE_CUSTOM_TOKEN:"secte",SUCCESS_EXCHANGE_DEVICE_CODE_FOR_ACCESS_TOKEN:"sede",SUCCESS_EXCHANGE_NATIVE_SOCIAL_LOGIN:"sens",SUCCESS_EXCHANGE_PASSWORD_OOB_FOR_ACCESS_TOKEN:"seoobft",SUCCESS_EXCHANGE_PASSWORD_OTP_FOR_ACCESS_TOKEN:"seotpft",SUCCESS_EXCHANGE_PASSWORD_FOR_ACCESS_TOKEN:"sepft",SUCCESS_EXCHANGE_PASSKEY_OOB_FOR_ACCESS_TOKEN:"sepkoobft",SUCCESS_EXCHANGE_PASSKEY_OTP_FOR_ACCESS_TOKEN:"sepkotpft",SUCCESS_EXCHANGE_PASSKEY_MFA_RECOVERY_FOR_ACCESS_TOKEN:"sepkrcft",SUCCESS_EXCHANGE_PASSWORD_MFA_RECOVERY_FOR_ACCESS_TOKEN:"sercft",SUCCESS_EXCHANGE_REFRESH_TOKEN_FOR_ACCESS_TOKEN:"sertft",SUCCESSFULLY_ACCEPTED_USER_INVITE:"si",BREACHED_PASSWORD_ON_SIGNUP:"signup_pwd_leak",SUCCESS_LOGOUT:"slo",SUCCESS_REVOCATION:"srrt",SUCCESS_SIGNUP:"ss",FAILED_SS_SSO_OPERATION:"ss_sso_failure",INFORMATION_FROM_SS_SSO_OPERATION:"ss_sso_info",SUCCESS_SS_SSO_OPERATION:"ss_sso_success",SUCCESS_SILENT_AUTH:"ssa",SUCCESSFUL_SCIM_OPERATION:"sscim",SUCCESSFULLY_IMPORTED_USERS:"sui",SUCCESS_VERIFICATION_EMAIL:"sv",SUCCESS_VERIFICATION_EMAIL_REQUEST:"svr",MAX_AMOUNT_OF_AUTHENTICATORS:"too_many_records",USER_LOGIN_BLOCK_RELEASED:"ublkdu",FAILED_UNIVERSAL_LOGOUT:"universal_logout_failed",SUCCESSFUL_UNIVERSAL_LOGOUT:"universal_logout_succeeded",WARNING_DURING_LOGIN:"w",WARNING_SENDING_NOTIFICATION:"wn",WARNING_USER_MANAGEMENT:"wum"},w4=o.z.string().refine(t=>Object.values(ge).includes(t),{message:"Invalid log type"}),Ny=o.z.object({name:o.z.string(),version:o.z.string(),env:o.z.object({node:o.z.string().optional()}).optional()}),Iy=o.z.object({country_code:o.z.string().length(2),city_name:o.z.string(),latitude:o.z.string(),longitude:o.z.string(),time_zone:o.z.string(),continent_code:o.z.string()}),jy=o.z.object({type:w4,date:o.z.string(),description:o.z.string().optional(),ip:o.z.string().optional(),user_agent:o.z.string().optional(),details:o.z.any().optional(),isMobile:o.z.boolean(),user_id:o.z.string().optional(),user_name:o.z.string().optional(),connection:o.z.string().optional(),connection_id:o.z.string().optional(),client_id:o.z.string().optional(),client_name:o.z.string().optional(),audience:o.z.string().optional(),scope:o.z.string().optional(),strategy:o.z.string().optional(),strategy_type:o.z.string().optional(),hostname:o.z.string().optional(),auth0_client:Ny.optional(),log_id:o.z.string().optional(),location_info:Iy.optional()}),Wa=o.z.object({...jy.shape,log_id:o.z.string()}),Ty=o.z.object({id:o.z.string().optional(),user_id:o.z.string(),password:o.z.string(),algorithm:o.z.enum(["bcrypt","argon2id"]).default("argon2id"),is_current:o.z.boolean().default(!0)}),v4=Ty.extend({id:o.z.string(),created_at:o.z.string(),updated_at:o.z.string()}),Oy=o.z.object({initial_user_agent:o.z.string().describe("First user agent of the device from which this user logged in"),initial_ip:o.z.string().describe("First IP address associated with this session"),initial_asn:o.z.string().describe("First autonomous system number associated with this session"),last_user_agent:o.z.string().describe("Last user agent of the device from which this user logged in"),last_ip:o.z.string().describe("Last IP address from which this user logged in"),last_asn:o.z.string().describe("Last autonomous system number from which this user logged in")}),Py=o.z.object({id:o.z.string(),revoked_at:o.z.string().optional(),used_at:o.z.string().optional(),user_id:o.z.string().describe("The user ID associated with the session"),expires_at:o.z.string().optional(),login_session_id:o.z.string(),idle_expires_at:o.z.string().optional(),device:Oy.describe("Metadata related to the device used in the session"),clients:o.z.array(o.z.string()).describe("List of client details for the session")}),Xc=o.z.object({created_at:o.z.string(),updated_at:o.z.string(),authenticated_at:o.z.string(),last_interaction_at:o.z.string(),...Py.shape}),Ad=o.z.object({kid:o.z.string().openapi({description:"The key id of the signing key"}),cert:o.z.string().openapi({description:"The public certificate of the signing key"}),fingerprint:o.z.string().openapi({description:"The cert fingerprint"}),thumbprint:o.z.string().openapi({description:"The cert thumbprint"}),pkcs7:o.z.string().optional().openapi({description:"The private key in pkcs7 format"}),current:o.z.boolean().optional().openapi({description:"True if the key is the current key"}),next:o.z.boolean().optional().openapi({description:"True if the key is the next key"}),previous:o.z.boolean().optional().openapi({description:"True if the key is the previous key"}),current_since:o.z.string().optional().openapi({description:"The date and time when the key became the current key"}),current_until:o.z.string().optional().openapi({description:"The date and time when the current key was rotated"}),revoked:o.z.boolean().optional().openapi({description:"True if the key is revoked"}),revoked_at:o.z.string().optional().openapi({description:"The date and time when the key was revoked"}),connection:o.z.string().optional().openapi({description:"The connection identifier associated with the key"}),type:o.z.enum(["jwt_signing","saml_encryption"]).openapi({description:"The type of the signing key"})});var Xt=(t=>(t.RefreshToken="refresh_token",t.AuthorizationCode="authorization_code",t.ClientCredential="client_credentials",t.Passwordless="passwordless",t.Password="password",t.OTP="http://auth0.com/oauth/grant-type/passwordless/otp",t))(Xt||{});const z0=o.z.object({access_token:o.z.string(),id_token:o.z.string().optional(),scope:o.z.string().optional(),state:o.z.string().optional(),refresh_token:o.z.string().optional(),token_type:o.z.string(),expires_in:o.z.number()});o.z.object({code:o.z.string(),state:o.z.string().optional()});const Ry=o.z.object({button_border_radius:o.z.number(),button_border_weight:o.z.number(),buttons_style:o.z.enum(["pill","rounded","sharp"]),input_border_radius:o.z.number(),input_border_weight:o.z.number(),inputs_style:o.z.enum(["pill","rounded","sharp"]),show_widget_shadow:o.z.boolean(),widget_border_weight:o.z.number(),widget_corner_radius:o.z.number()}),Ly=o.z.object({base_focus_color:o.z.string(),base_hover_color:o.z.string(),body_text:o.z.string(),captcha_widget_theme:o.z.enum(["auto","dark","light"]),error:o.z.string(),header:o.z.string(),icons:o.z.string(),input_background:o.z.string(),input_border:o.z.string(),input_filled_text:o.z.string(),input_labels_placeholders:o.z.string(),links_focused_components:o.z.string(),primary_button:o.z.string(),primary_button_label:o.z.string(),secondary_button_border:o.z.string(),secondary_button_label:o.z.string(),success:o.z.string(),widget_background:o.z.string(),widget_border:o.z.string()}),$r=o.z.object({bold:o.z.boolean(),size:o.z.number()}),By=o.z.object({body_text:$r,buttons_text:$r,font_url:o.z.string(),input_labels:$r,links:$r,links_style:o.z.enum(["normal","underlined"]),reference_text_size:o.z.number(),subtitle:$r,title:$r}),Dy=o.z.object({background_color:o.z.string(),background_image_url:o.z.string(),page_layout:o.z.enum(["center","left","right"])}),Uy=o.z.object({header_text_alignment:o.z.enum(["center","left","right"]),logo_height:o.z.number(),logo_position:o.z.enum(["center","left","none","right"]),logo_url:o.z.string(),social_buttons_layout:o.z.enum(["bottom","top"])}),My=o.z.object({borders:Ry,colors:Ly,displayName:o.z.string(),fonts:By,page_background:Dy,widget:Uy}),wa=My.extend({themeId:o.z.string()}),va=o.z.object({universal_login_experience:o.z.enum(["new","classic"]).default("new"),identifier_first:o.z.boolean().default(!0),password_first:o.z.boolean().default(!1),webauthn_platform_first_factor:o.z.boolean()}),xa=o.z.object({name:o.z.string(),enabled:o.z.boolean().optional().default(!0),default_from_address:o.z.string().optional(),credentials:o.z.union([o.z.object({accessKeyId:o.z.string(),secretAccessKey:o.z.string(),region:o.z.string()}),o.z.object({smtp_host:o.z.array(o.z.string()),smtp_port:o.z.number(),smtp_user:o.z.string(),smtp_pass:o.z.string()}),o.z.object({api_key:o.z.string(),domain:o.z.string().optional()}),o.z.object({connectionString:o.z.string()}),o.z.object({tenantId:o.z.string(),clientId:o.z.string(),clientSecret:o.z.string()})]),settings:o.z.object({}).optional()}),A0=o.z.object({id:o.z.string(),session_id:o.z.string(),user_id:o.z.string(),client_id:o.z.string(),expires_at:o.z.string().optional(),idle_expires_at:o.z.string().optional(),last_exchanged_at:o.z.string().optional(),device:Oy,resource_servers:o.z.array(o.z.object({audience:o.z.string(),scopes:o.z.string()})),rotating:o.z.boolean()}),x4=o.z.object({created_at:o.z.string(),...A0.shape}),k4=o.z.object({to:o.z.string(),message:o.z.string()}),$4=o.z.object({name:o.z.string(),options:o.z.object({})}),qy=o.z.object({value:o.z.string(),description:o.z.string().optional()}),Fy=o.z.object({token_dialect:o.z.enum(["access_token","access_token_authz"]).optional(),enforce_policies:o.z.boolean().optional(),allow_skipping_userinfo:o.z.boolean().optional(),skip_userinfo:o.z.boolean().optional(),persist_client_authorization:o.z.boolean().optional(),enable_introspection_endpoint:o.z.boolean().optional(),mtls:o.z.object({bound_access_tokens:o.z.boolean().optional()}).optional()}),Ja=o.z.object({name:o.z.string(),identifier:o.z.string(),scopes:o.z.array(qy).optional(),signing_alg:o.z.string().optional(),signing_secret:o.z.string().optional(),token_lifetime:o.z.number().optional(),token_lifetime_for_web:o.z.number().optional(),skip_consent_for_verifiable_first_party_clients:o.z.boolean().optional(),allow_offline_access:o.z.boolean().optional(),verificationKey:o.z.string().optional(),options:Fy.optional(),is_system:o.z.boolean().optional()}),Cr=o.z.object({id:o.z.string().optional(),...Ja.shape,created_at:o.z.string().optional(),updated_at:o.z.string().optional()}),S4=o.z.array(Cr),Hy=o.z.object({role_id:o.z.string(),resource_server_identifier:o.z.string(),permission_name:o.z.string()}),Vy=o.z.object({...Hy.shape,created_at:o.z.string()}),Ky=o.z.array(Vy),Gy=o.z.object({user_id:o.z.string(),resource_server_identifier:o.z.string(),permission_name:o.z.string(),organization_id:o.z.string().optional()}),Wy=o.z.object({...Gy.shape,tenant_id:o.z.string(),created_at:o.z.string().optional()}),z4=o.z.array(Wy),Jy=o.z.object({user_id:o.z.string(),resource_server_identifier:o.z.string(),resource_server_name:o.z.string(),permission_name:o.z.string(),description:o.z.string().nullable().optional(),created_at:o.z.string().optional(),organization_id:o.z.string().optional()}),Xy=o.z.array(Jy),Zy=o.z.object({user_id:o.z.string(),role_id:o.z.string(),organization_id:o.z.string().optional()}),Yy=o.z.object({...Zy.shape,tenant_id:o.z.string(),created_at:o.z.string().optional()}),A4=o.z.array(Yy),Xa=o.z.object({name:o.z.string().min(1).max(50).openapi({description:"The name of the role. Cannot include '<' or '>'"}),description:o.z.string().max(255).optional().openapi({description:"The description of the role"}),is_system:o.z.boolean().optional()}),Nr=o.z.object({id:o.z.string().openapi({description:"The unique identifier of the role"}),...Xa.shape,created_at:o.z.string().optional(),updated_at:o.z.string().optional()}),Za=o.z.array(Nr),Qy=o.z.object({logo_url:o.z.string().optional().openapi({description:"URL of the organization's logo"}),colors:o.z.object({primary:o.z.string().optional().openapi({description:"Primary color in hex format (e.g., #FF0000)"}),page_background:o.z.string().optional().openapi({description:"Page background color in hex format (e.g., #FFFFFF)"})}).optional()}).optional(),eb=o.z.object({connection_id:o.z.string().openapi({description:"ID of the connection"}),assign_membership_on_login:o.z.boolean().default(!1).openapi({description:"Whether to assign membership to the organization on login"}),show_as_button:o.z.boolean().default(!0).openapi({description:"Whether to show this connection as a button in the login screen"}),is_signup_enabled:o.z.boolean().default(!0).openapi({description:"Whether signup is enabled for this connection"})}),tb=o.z.object({client_credentials:o.z.object({enforce:o.z.boolean().default(!1).openapi({description:"Whether to enforce token quota limits"}),per_day:o.z.number().min(0).default(0).openapi({description:"Maximum tokens per day (0 = unlimited)"}),per_hour:o.z.number().min(0).default(0).openapi({description:"Maximum tokens per hour (0 = unlimited)"})}).optional()}).optional(),Ya=o.z.object({id:o.z.string().optional(),name:o.z.string().min(1).openapi({description:"The name of the organization"}),display_name:o.z.string().optional().openapi({description:"The display name of the organization"}),branding:Qy,metadata:o.z.record(o.z.any()).default({}).optional().openapi({description:"Custom metadata for the organization"}),enabled_connections:o.z.array(eb).default([]).optional().openapi({description:"List of enabled connections for the organization"}),token_quota:tb}),er=o.z.object({...Ya.shape,...ti.shape,id:o.z.string()}),nb=o.z.object({user_id:o.z.string().openapi({description:"ID of the user"}),organization_id:o.z.string().openapi({description:"ID of the organization"})}),E4=o.z.object({...nb.shape,...ti.shape,id:o.z.string()}),C4=o.z.object({idle_session_lifetime:o.z.number().optional(),session_lifetime:o.z.number().optional(),session_cookie:o.z.object({mode:o.z.enum(["persistent","non-persistent"]).optional()}).optional(),enable_client_connections:o.z.boolean().optional(),default_redirection_uri:o.z.string().optional(),enabled_locales:o.z.array(o.z.string()).optional(),default_directory:o.z.string().optional(),error_page:o.z.object({html:o.z.string().optional(),show_log_link:o.z.boolean().optional(),url:o.z.string().optional()}).optional(),flags:o.z.object({allow_legacy_delegation_grant_types:o.z.boolean().optional(),allow_legacy_ro_grant_types:o.z.boolean().optional(),allow_legacy_tokeninfo_endpoint:o.z.boolean().optional(),disable_clickjack_protection_headers:o.z.boolean().optional(),enable_apis_section:o.z.boolean().optional(),enable_client_connections:o.z.boolean().optional(),enable_custom_domain_in_emails:o.z.boolean().optional(),enable_dynamic_client_registration:o.z.boolean().optional(),enable_idtoken_api2:o.z.boolean().optional(),enable_legacy_logs_search_v2:o.z.boolean().optional(),enable_legacy_profile:o.z.boolean().optional(),enable_pipeline2:o.z.boolean().optional(),enable_public_signup_user_exists_error:o.z.boolean().optional(),use_scope_descriptions_for_consent:o.z.boolean().optional(),disable_management_api_sms_obfuscation:o.z.boolean().optional(),enable_adfs_waad_email_verification:o.z.boolean().optional(),revoke_refresh_token_grant:o.z.boolean().optional(),dashboard_log_streams_next:o.z.boolean().optional(),dashboard_insights_view:o.z.boolean().optional(),disable_fields_map_fix:o.z.boolean().optional(),mfa_show_factor_list_on_enrollment:o.z.boolean().optional()}).optional(),friendly_name:o.z.string().optional(),picture_url:o.z.string().optional(),support_email:o.z.string().optional(),support_url:o.z.string().optional(),sandbox_version:o.z.string().optional(),sandbox_versions_available:o.z.array(o.z.string()).optional(),change_password:o.z.object({enabled:o.z.boolean(),html:o.z.string()}).optional(),guardian_mfa_page:o.z.object({enabled:o.z.boolean(),html:o.z.string()}).optional(),default_audience:o.z.string().optional(),default_organization:o.z.string().optional(),sessions:o.z.object({oidc_logout_prompt_enabled:o.z.boolean().optional()}).optional()}),rb=o.z.object({date:o.z.string().openapi({description:"Date these events occurred in ISO 8601 format",example:"2025-12-19"}),logins:o.z.number().openapi({description:"Number of logins on this date",example:150}),signups:o.z.number().openapi({description:"Number of signups on this date",example:25}),leaked_passwords:o.z.number().openapi({description:"Number of breached-password detections on this date (subscription required)",example:0}),updated_at:o.z.string().openapi({description:"Date and time this stats entry was last updated in ISO 8601 format",example:"2025-12-19T10:30:00.000Z"}),created_at:o.z.string().openapi({description:"Approximate date and time the first event occurred in ISO 8601 format",example:"2025-12-19T00:00:00.000Z"})}),N4=o.z.number().openapi({description:"Number of active users in the last 30 days",example:1234});function I4(t){const[e,n]=t.split("|");if(!e||!n)throw new Error(`Invalid user_id: ${t}`);return{connection:e,id:n}}function j4(t){const{primary:e,secondaries:n,syncMethods:r=["create","update","remove","delete","set"]}=t,i={get(s,a){if(typeof a=="symbol")return s[a];const c=s[a];return typeof c!="function"?c:r.includes(a)?async(...l)=>{const u=await c.apply(s,l),d=[];for(const f of n){const p=f.adapter[a];if(typeof p!="function")continue;const h=(async()=>{try{await p.apply(f.adapter,l)}catch(m){try{f.onError?f.onError(m,a,l):console.error(`Passthrough adapter: secondary write failed for ${a}:`,m)}catch(y){console.error(`Passthrough adapter: onError handler threw for ${a}:`,y)}}})();f.blocking&&d.push(h)}return d.length>0&&await Promise.all(d),u}:c.bind(s)}};return new Proxy(e,i)}function T4(t){return t}const bh={themeId:"default",borders:{button_border_radius:8,button_border_weight:1,buttons_style:"pill",input_border_radius:8,input_border_weight:1,inputs_style:"pill",show_widget_shadow:!0,widget_border_weight:1,widget_corner_radius:16},colors:{base_focus_color:"#7D68F4",base_hover_color:"#A091F2",body_text:"#000000",captcha_widget_theme:"auto",error:"#FC5A5A",header:"#000000",icons:"#666666",input_background:"#FFFFFF",input_border:"#BFBCD7",input_filled_text:"#000000",input_labels_placeholders:"#88869F",links_focused_components:"#7D68F4",primary_button:"#7D68F4",primary_button_label:"#FFFFFF",secondary_button_border:"#BFBCD7",secondary_button_label:"#000000",success:"#36BF76",widget_background:"#FFFFFF",widget_border:"#BFBCD7"},displayName:"Default Theme",fonts:{body_text:{bold:!1,size:16},buttons_text:{bold:!1,size:16},font_url:"https://assets.sesamy.com/fonts/khteka/WOFF2/KHTeka-Regular.woff2",input_labels:{bold:!1,size:14},links:{bold:!1,size:16},links_style:"normal",reference_text_size:16,subtitle:{bold:!1,size:18},title:{bold:!0,size:24}},page_background:{background_color:"#F8F9FB",background_image_url:"https://assets.sesamy.com/images/login-bg.jpg",page_layout:"center"},widget:{header_text_alignment:"center",logo_height:36,logo_position:"center",logo_url:"https://assets.sesamy.com/static/images/sesamy/logos/sesamy_logo_black.svg",social_buttons_layout:"bottom"}};function Ed(t,e){const n=structuredClone(t);function r(i,s){for(const a in s)s[a]!==void 0&&typeof s[a]=="object"&&!Array.isArray(s[a])&&typeof i[a]=="object"&&i[a]!==null?r(i[a],s[a]):i[a]=s[a];return i}return r(n,e)}const O4=new o.OpenAPIHono().openapi(o.createRoute({tags:["branding"],method:"get",path:"/default",request:{headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["read:themes","auth:read"]}],responses:{200:{content:{"application/json":{schema:wa}},description:"Default theme settings"}}}),async t=>{const e=await t.env.data.themes.get(t.var.tenant_id,"default");return e?t.json(e):t.json(bh)}).openapi(o.createRoute({tags:["branding"],method:"patch",path:"/default",request:{body:{content:{"application/json":{schema:wa.deepPartial()}}},headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["update:themes","auth:write"]}],responses:{200:{content:{"application/json":{schema:wa}},description:"Updated theme settings"}}}),async t=>{const e=t.req.valid("json"),n=await t.env.data.themes.get(t.var.tenant_id,"default");if(n){const r=Ed(n,e);await t.env.data.themes.update(t.var.tenant_id,"default",r);const i=await t.env.data.themes.get(t.var.tenant_id,"default");return t.json(i)}else{const r=Ed(bh,e),i=await t.env.data.themes.create(t.var.tenant_id,r);return t.json(i)}}),P4={colors:{primary:"#7D68F4",page_background:{type:"solid",start:"#F8F9FB",end:"#F8F9FB",angle_deg:0}},logo_url:"https://assets.sesamy.com/static/images/sesamy/logos/sesamy_logo_black.svg",favicon_url:"https://assets.sesamy.com/images/favicon.ico",font:{url:"https://assets.sesamy.com/fonts/khteka/WOFF2/KHTeka-Regular.woff2"}},R4=new o.OpenAPIHono().openapi(o.createRoute({tags:["branding"],method:"get",path:"/",request:{headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["read:branding","auth:read"]}],responses:{200:{content:{"application/json":{schema:Sd}},description:"Branding settings"}}}),async t=>{const e=await t.env.data.branding.get(t.var.tenant_id);return e?t.json(e):t.json(P4)}).openapi(o.createRoute({tags:["branding"],method:"patch",path:"/",request:{headers:o.z.object({"tenant-id":o.z.string().optional()}),body:{content:{"application/json":{schema:o.z.object(Sd.shape).partial()}}}},security:[{Bearer:["update:branding","auth:write"]}],responses:{200:{description:"Branding settings"}}}),async t=>{const e=t.req.valid("json");return await t.env.data.branding.set(t.var.tenant_id,e),t.text("OK")}).route("/themes",O4),ib={},L4=Object.freeze(Object.defineProperty({__proto__:null,default:ib},Symbol.toStringTag,{value:"Module"}));var Cd=null;function B4(t){try{return crypto.getRandomValues(new Uint8Array(t))}catch{}try{return ib.randomBytes(t)}catch{}if(!Cd)throw Error("Neither WebCryptoAPI nor a crypto module is available. Use bcrypt.setRandomFallback to set an alternative");return Cd(t)}function D4(t){Cd=t}function E0(t,e){if(t=t||C0,typeof t!="number")throw Error("Illegal arguments: "+typeof t+", "+typeof e);t<4?t=4:t>31&&(t=31);var n=[];return n.push("$2b$"),t<10&&n.push("0"),n.push(t.toString()),n.push("$"),n.push(Qa(B4(es),es)),n.join("")}function ob(t,e,n){if(typeof e=="function"&&(n=e,e=void 0),typeof t=="function"&&(n=t,t=void 0),typeof t>"u")t=C0;else if(typeof t!="number")throw Error("illegal arguments: "+typeof t);function r(i){Zt(function(){try{i(null,E0(t))}catch(s){i(s)}})}if(n){if(typeof n!="function")throw Error("Illegal callback: "+typeof n);r(n)}else return new Promise(function(i,s){r(function(a,c){if(a){s(a);return}i(c)})})}function sb(t,e){if(typeof e>"u"&&(e=C0),typeof e=="number"&&(e=E0(e)),typeof t!="string"||typeof e!="string")throw Error("Illegal arguments: "+typeof t+", "+typeof e);return Nd(t,e)}function ab(t,e,n,r){function i(s){typeof t=="string"&&typeof e=="number"?ob(e,function(a,c){Nd(t,c,s,r)}):typeof t=="string"&&typeof e=="string"?Nd(t,e,s,r):Zt(s.bind(this,Error("Illegal arguments: "+typeof t+", "+typeof e)))}if(n){if(typeof n!="function")throw Error("Illegal callback: "+typeof n);i(n)}else return new Promise(function(s,a){i(function(c,l){if(c){a(c);return}s(l)})})}function cb(t,e){for(var n=t.length^e.length,r=0;r<t.length;++r)n|=t.charCodeAt(r)^e.charCodeAt(r);return n===0}function U4(t,e){if(typeof t!="string"||typeof e!="string")throw Error("Illegal arguments: "+typeof t+", "+typeof e);return e.length!==60?!1:cb(sb(t,e.substring(0,e.length-31)),e)}function M4(t,e,n,r){function i(s){if(typeof t!="string"||typeof e!="string"){Zt(s.bind(this,Error("Illegal arguments: "+typeof t+", "+typeof e)));return}if(e.length!==60){Zt(s.bind(this,null,!1));return}ab(t,e.substring(0,29),function(a,c){a?s(a):s(null,cb(c,e))},r)}if(n){if(typeof n!="function")throw Error("Illegal callback: "+typeof n);i(n)}else return new Promise(function(s,a){i(function(c,l){if(c){a(c);return}s(l)})})}function q4(t){if(typeof t!="string")throw Error("Illegal arguments: "+typeof t);return parseInt(t.split("$")[2],10)}function F4(t){if(typeof t!="string")throw Error("Illegal arguments: "+typeof t);if(t.length!==60)throw Error("Illegal hash length: "+t.length+" != 60");return t.substring(0,29)}function H4(t){if(typeof t!="string")throw Error("Illegal arguments: "+typeof t);return lb(t)>72}var Zt=typeof setImmediate=="function"?setImmediate:typeof scheduler=="object"&&typeof scheduler.postTask=="function"?scheduler.postTask.bind(scheduler):setTimeout;function lb(t){for(var e=0,n=0,r=0;r<t.length;++r)n=t.charCodeAt(r),n<128?e+=1:n<2048?e+=2:(n&64512)===55296&&(t.charCodeAt(r+1)&64512)===56320?(++r,e+=4):e+=3;return e}function V4(t){for(var e=0,n,r,i=new Array(lb(t)),s=0,a=t.length;s<a;++s)n=t.charCodeAt(s),n<128?i[e++]=n:n<2048?(i[e++]=n>>6|192,i[e++]=n&63|128):(n&64512)===55296&&((r=t.charCodeAt(s+1))&64512)===56320?(n=65536+((n&1023)<<10)+(r&1023),++s,i[e++]=n>>18|240,i[e++]=n>>12&63|128,i[e++]=n>>6&63|128,i[e++]=n&63|128):(i[e++]=n>>12|224,i[e++]=n>>6&63|128,i[e++]=n&63|128);return i}var pi="./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),Xn=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,54,55,56,57,58,59,60,61,62,63,-1,-1,-1,-1,-1,-1,-1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,-1,-1,-1,-1,-1,-1,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,-1,-1,-1,-1,-1];function Qa(t,e){var n=0,r=[],i,s;if(e<=0||e>t.length)throw Error("Illegal len: "+e);for(;n<e;){if(i=t[n++]&255,r.push(pi[i>>2&63]),i=(i&3)<<4,n>=e){r.push(pi[i&63]);break}if(s=t[n++]&255,i|=s>>4&15,r.push(pi[i&63]),i=(s&15)<<2,n>=e){r.push(pi[i&63]);break}s=t[n++]&255,i|=s>>6&3,r.push(pi[i&63]),r.push(pi[s&63])}return r.join("")}function ub(t,e){var n=0,r=t.length,i=0,s=[],a,c,l,u,d,f;if(e<=0)throw Error("Illegal len: "+e);for(;n<r-1&&i<e&&(f=t.charCodeAt(n++),a=f<Xn.length?Xn[f]:-1,f=t.charCodeAt(n++),c=f<Xn.length?Xn[f]:-1,!(a==-1||c==-1||(d=a<<2>>>0,d|=(c&48)>>4,s.push(String.fromCharCode(d)),++i>=e||n>=r)||(f=t.charCodeAt(n++),l=f<Xn.length?Xn[f]:-1,l==-1)||(d=(c&15)<<4>>>0,d|=(l&60)>>2,s.push(String.fromCharCode(d)),++i>=e||n>=r)));)f=t.charCodeAt(n++),u=f<Xn.length?Xn[f]:-1,d=(l&3)<<6>>>0,d|=u,s.push(String.fromCharCode(d)),++i;var p=[];for(n=0;n<i;n++)p.push(s[n].charCodeAt(0));return p}var es=16,C0=10,K4=16,G4=100,wh=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],vh=[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946,1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055,3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504,976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462],db=[1332899944,1700884034,1701343084,1684370003,1668446532,1869963892];function ts(t,e,n,r){var i,s=t[e],a=t[e+1];return s^=n[0],i=r[s>>>24],i+=r[256|s>>16&255],i^=r[512|s>>8&255],i+=r[768|s&255],a^=i^n[1],i=r[a>>>24],i+=r[256|a>>16&255],i^=r[512|a>>8&255],i+=r[768|a&255],s^=i^n[2],i=r[s>>>24],i+=r[256|s>>16&255],i^=r[512|s>>8&255],i+=r[768|s&255],a^=i^n[3],i=r[a>>>24],i+=r[256|a>>16&255],i^=r[512|a>>8&255],i+=r[768|a&255],s^=i^n[4],i=r[s>>>24],i+=r[256|s>>16&255],i^=r[512|s>>8&255],i+=r[768|s&255],a^=i^n[5],i=r[a>>>24],i+=r[256|a>>16&255],i^=r[512|a>>8&255],i+=r[768|a&255],s^=i^n[6],i=r[s>>>24],i+=r[256|s>>16&255],i^=r[512|s>>8&255],i+=r[768|s&255],a^=i^n[7],i=r[a>>>24],i+=r[256|a>>16&255],i^=r[512|a>>8&255],i+=r[768|a&255],s^=i^n[8],i=r[s>>>24],i+=r[256|s>>16&255],i^=r[512|s>>8&255],i+=r[768|s&255],a^=i^n[9],i=r[a>>>24],i+=r[256|a>>16&255],i^=r[512|a>>8&255],i+=r[768|a&255],s^=i^n[10],i=r[s>>>24],i+=r[256|s>>16&255],i^=r[512|s>>8&255],i+=r[768|s&255],a^=i^n[11],i=r[a>>>24],i+=r[256|a>>16&255],i^=r[512|a>>8&255],i+=r[768|a&255],s^=i^n[12],i=r[s>>>24],i+=r[256|s>>16&255],i^=r[512|s>>8&255],i+=r[768|s&255],a^=i^n[13],i=r[a>>>24],i+=r[256|a>>16&255],i^=r[512|a>>8&255],i+=r[768|a&255],s^=i^n[14],i=r[s>>>24],i+=r[256|s>>16&255],i^=r[512|s>>8&255],i+=r[768|s&255],a^=i^n[15],i=r[a>>>24],i+=r[256|a>>16&255],i^=r[512|a>>8&255],i+=r[768|a&255],s^=i^n[16],t[e]=a^n[K4+1],t[e+1]=s,t}function gi(t,e){for(var n=0,r=0;n<4;++n)r=r<<8|t[e]&255,e=(e+1)%t.length;return{key:r,offp:e}}function xh(t,e,n){for(var r=0,i=[0,0],s=e.length,a=n.length,c,l=0;l<s;l++)c=gi(t,r),r=c.offp,e[l]=e[l]^c.key;for(l=0;l<s;l+=2)i=ts(i,0,e,n),e[l]=i[0],e[l+1]=i[1];for(l=0;l<a;l+=2)i=ts(i,0,e,n),n[l]=i[0],n[l+1]=i[1]}function W4(t,e,n,r){for(var i=0,s=[0,0],a=n.length,c=r.length,l,u=0;u<a;u++)l=gi(e,i),i=l.offp,n[u]=n[u]^l.key;for(i=0,u=0;u<a;u+=2)l=gi(t,i),i=l.offp,s[0]^=l.key,l=gi(t,i),i=l.offp,s[1]^=l.key,s=ts(s,0,n,r),n[u]=s[0],n[u+1]=s[1];for(u=0;u<c;u+=2)l=gi(t,i),i=l.offp,s[0]^=l.key,l=gi(t,i),i=l.offp,s[1]^=l.key,s=ts(s,0,n,r),r[u]=s[0],r[u+1]=s[1]}function kh(t,e,n,r,i){var s=db.slice(),a=s.length,c;if(n<4||n>31)if(c=Error("Illegal number of rounds (4-31): "+n),r){Zt(r.bind(this,c));return}else throw c;if(e.length!==es)if(c=Error("Illegal salt length: "+e.length+" != "+es),r){Zt(r.bind(this,c));return}else throw c;n=1<<n>>>0;var l,u,d=0,f;typeof Int32Array=="function"?(l=new Int32Array(wh),u=new Int32Array(vh)):(l=wh.slice(),u=vh.slice()),W4(e,t,l,u);function p(){if(i&&i(d/n),d<n)for(var m=Date.now();d<n&&(d=d+1,xh(t,l,u),xh(e,l,u),!(Date.now()-m>G4)););else{for(d=0;d<64;d++)for(f=0;f<a>>1;f++)ts(s,f<<1,l,u);var y=[];for(d=0;d<a;d++)y.push((s[d]>>24&255)>>>0),y.push((s[d]>>16&255)>>>0),y.push((s[d]>>8&255)>>>0),y.push((s[d]&255)>>>0);if(r){r(null,y);return}else return y}r&&Zt(p)}if(typeof r<"u")p();else for(var h;;)if(typeof(h=p())<"u")return h||[]}function Nd(t,e,n,r){var i;if(typeof t!="string"||typeof e!="string")if(i=Error("Invalid string / salt: Not a string"),n){Zt(n.bind(this,i));return}else throw i;var s,a;if(e.charAt(0)!=="$"||e.charAt(1)!=="2")if(i=Error("Invalid salt version: "+e.substring(0,2)),n){Zt(n.bind(this,i));return}else throw i;if(e.charAt(2)==="$")s="\0",a=3;else{if(s=e.charAt(2),s!=="a"&&s!=="b"&&s!=="y"||e.charAt(3)!=="$")if(i=Error("Invalid salt revision: "+e.substring(2,4)),n){Zt(n.bind(this,i));return}else throw i;a=4}if(e.charAt(a+2)>"$")if(i=Error("Missing salt rounds"),n){Zt(n.bind(this,i));return}else throw i;var c=parseInt(e.substring(a,a+1),10)*10,l=parseInt(e.substring(a+1,a+2),10),u=c+l,d=e.substring(a+3,a+25);t+=s>="a"?"\0":"";var f=V4(t),p=ub(d,es);function h(m){var y=[];return y.push("$2"),s>="a"&&y.push(s),y.push("$"),u<10&&y.push("0"),y.push(u.toString()),y.push("$"),y.push(Qa(p,p.length)),y.push(Qa(m,db.length*4-1)),y.join("")}if(typeof n>"u")return h(kh(f,p,u));kh(f,p,u,function(m,y){m?n(m,null):n(null,h(y))},r)}function J4(t,e){return Qa(t,e)}function X4(t,e){return ub(t,e)}const ar={setRandomFallback:D4,genSaltSync:E0,genSalt:ob,hashSync:sb,hash:ab,compareSync:U4,compare:M4,getRounds:q4,getSalt:F4,truncates:H4,encodeBase64:J4,decodeBase64:X4},Z4="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Y4=t=>crypto.getRandomValues(new Uint8Array(t)),Q4=(t,e,n)=>{let r=(2<<Math.log2(t.length-1))-1,i=-~(1.6*r*e/t.length);return(s=e)=>{let a="";for(;;){let c=n(i),l=i|0;for(;l--;)if(a+=t[c[l]&r]||"",a.length>=s)return a}}},pb=(t,e=21)=>Q4(t,e|0,Y4),je=(t=21)=>{let e="",n=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=Z4[n[t]&63];return e};const e6=24;function $s(){return pb("0123456789abcdef",e6)()}function ra(t){if(!t.includes("|"))return console.error("Invalid user_id format"),t;const[,e]=t.split("|");return e}function t6(t){return async(e,n)=>{if(!n.email||!n.email_verified)return t.users.create(e,n);const r=await tl({userAdapter:t.users,tenant_id:e,email:n.email});if(!r)return t.users.create(e,n);await t.users.create(e,{...n,linked_to:r.user_id});const i=await t.users.get(e,r.user_id);if(!i)throw new Error("Failed to fetch primary user after linking");return i}}var n6={deno:"Deno",bun:"Bun",workerd:"Cloudflare-Workers",node:"Node.js"},fb=()=>{const t=globalThis;if(typeof navigator<"u"&&typeof navigator.userAgent=="string"){for(const[n,r]of Object.entries(n6))if(r6(r))return n}return typeof t?.EdgeRuntime=="string"?"edge-light":t?.fastly!==void 0?"fastly":t?.process?.release?.name==="node"?"node":"other"},r6=t=>navigator.userAgent.startsWith(t);function hb(t,e){if(fb()==="workerd")try{t.executionCtx.waitUntil(e)}catch{e.catch(n=>console.error("waitUntil promise error:",n))}}function i6(t){return[...t].reduce((e,[n,r])=>({...e,[n]:r}),{})}async function ye(t,e,n){const r={};if(t.req.raw?.headers){const s=i6(t.req.raw.headers);for(const[a,c]of Object.entries(s))r[a.toLowerCase()]=c}const i=async()=>{let s;if(t.env.data.geo)try{s=await t.env.data.geo.getGeoInfo(r)||void 0}catch(c){console.warn("Failed to get geo information:",c)}const a={type:n.type,description:n.description||"",ip:t.var.ip,user_agent:t.var.useragent||"",auth0_client:t.var.auth0_client,date:new Date().toISOString(),details:{request:{method:t.req.method,path:t.req.path,qs:t.req.queries(),body:n.body||t.var.body||""},...n.response&&{response:n.response}},isMobile:!1,client_id:t.var.client_id,client_name:"",user_id:n.userId||t.var.user_id||"",hostname:t.req.header("host")||"",user_name:t.var.username||"",connection_id:"",connection:n.connection||t.var.connection||"",strategy:n.strategy||"",strategy_type:n.strategy_type||"",audience:n.audience||"",scope:n.scope||"",location_info:s};await t.env.data.logs.create(e,a)};n.waitForCompletion?await i():hb(t,i())}class ec{constructor(e,n){this.value=e,this.unit=n}value;unit;milliseconds(){return this.unit==="ms"?this.value:this.unit==="s"?this.value*1e3:this.unit==="m"?this.value*1e3*60:this.unit==="h"?this.value*1e3*60*60:this.unit==="d"?this.value*1e3*60*60*24:this.value*1e3*60*60*24*7}seconds(){return this.milliseconds()/1e3}transform(e){return new ec(Math.round(this.milliseconds()*e),"ms")}}class o6{hash;constructor(e){this.hash=e}async verify(e,n,r){const i=await crypto.subtle.importKey("spki",e,{name:"RSASSA-PKCS1-v1_5",hash:this.hash},!1,["verify"]);return await crypto.subtle.verify("RSASSA-PKCS1-v1_5",i,n,r)}async sign(e,n){const r=await crypto.subtle.importKey("pkcs8",e,{name:"RSASSA-PKCS1-v1_5",hash:this.hash},!1,["sign"]);return await crypto.subtle.sign("RSASSA-PKCS1-v1_5",r,n)}async generateKeyPair(e){const n=await crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",hash:this.hash,modulusLength:e??2048,publicExponent:new Uint8Array([1,0,1])},!0,["sign"]),r=await crypto.subtle.exportKey("pkcs8",n.privateKey),i=await crypto.subtle.exportKey("spki",n.publicKey);return{privateKey:r,publicKey:i}}}async function gb(t){return await crypto.subtle.digest("SHA-256",t)}const $h="0123456789abcdef";function Id(t){const e=new Uint8Array(t);let n="";for(let r=0;r<e.length;r++){const i=e[r]>>4;n+=$h[i];const s=e[r]&15;n+=$h[s]}return n}class mb{alphabet;padding;decodeMap=new Map;constructor(e,n){if(e.length!==32)throw new Error("Invalid alphabet");if(this.alphabet=e,this.padding=n?.padding??"=",this.alphabet.includes(this.padding)||this.padding.length!==1)throw new Error("Invalid padding");for(let r=0;r<e.length;r++)this.decodeMap.set(e[r],r)}encode(e,n){let r="",i=0,s=0;for(let c=0;c<e.length;c++)for(i=i<<8|e[c],s+=8;s>=5;)s-=5,r+=this.alphabet[i>>s&31];if(s>0&&(r+=this.alphabet[i<<5-s&31]),n?.includePadding??!0){const c=(8-r.length%8)%8;for(let l=0;l<c;l++)r+="="}return r}decode(e,n){const r=n?.strict??!0,i=Math.ceil(e.length/8),s=[];for(let a=0;a<i;a++){let c=0;const l=[];for(let d=0;d<8;d++){const f=e[a*8+d];if(f==="="){if(a+1!==i)throw new Error(`Invalid character: ${f}`);c+=1;continue}if(f===void 0){if(r)throw new Error("Invalid data");c+=1;continue}const p=this.decodeMap.get(f)??null;if(p===null)throw new Error(`Invalid character: ${f}`);l.push(p)}if(c===8||c===7||c===5||c===2)throw new Error("Invalid padding");const u=(l[0]<<3)+(l[1]>>2);if(s.push(u),c<6){const d=((l[1]&3)<<6)+(l[2]<<1)+(l[3]>>4);s.push(d)}if(c<4){const d=((l[3]&255)<<4)+(l[4]>>1);s.push(d)}if(c<3){const d=((l[4]&1)<<7)+(l[5]<<2)+(l[6]>>3);s.push(d)}if(c<1){const d=((l[6]&7)<<5)+l[7];s.push(d)}}return Uint8Array.from(s)}}new mb("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567");new mb("0123456789ABCDEFGHIJKLMNOPQRSTUV");class _b{alphabet;padding;decodeMap=new Map;constructor(e,n){if(e.length!==64)throw new Error("Invalid alphabet");if(this.alphabet=e,this.padding=n?.padding??"=",this.alphabet.includes(this.padding)||this.padding.length!==1)throw new Error("Invalid padding");for(let r=0;r<e.length;r++)this.decodeMap.set(e[r],r)}encode(e,n){let r="",i=0,s=0;for(let c=0;c<e.length;c++)for(i=i<<8|e[c],s+=8;s>=6;)s+=-6,r+=this.alphabet[i>>s&63];if(s>0&&(r+=this.alphabet[i<<6-s&63]),n?.includePadding??!0){const c=(4-r.length%4)%4;for(let l=0;l<c;l++)r+="="}return r}decode(e,n){const r=n?.strict??!0,i=Math.ceil(e.length/4),s=[];for(let a=0;a<i;a++){let c=0,l=0;for(let u=0;u<4;u++){const d=e[a*4+u];if(d==="="){if(a+1!==i)throw new Error(`Invalid character: ${d}`);c+=1;continue}if(d===void 0){if(r)throw new Error("Invalid data");c+=1;continue}const f=this.decodeMap.get(d)??null;if(f===null)throw new Error(`Invalid character: ${d}`);l+=f<<6*(3-u)}s.push(l>>16&255),c<2&&s.push(l>>8&255),c<1&&s.push(l&255)}return Uint8Array.from(s)}}const s6=new _b("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),Tr=new _b("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_");async function Sh(t,e,n,r){const i={alg:t,typ:"JWT",...r?.headers},s={...n};r?.audiences!==void 0&&(s.aud=r.audiences),r?.subject!==void 0&&(s.sub=r.subject),r?.issuer!==void 0&&(s.iss=r.issuer),r?.jwtId!==void 0&&(s.jti=r.jwtId),r?.expiresIn!==void 0&&(s.exp=Math.floor(Date.now()/1e3)+r.expiresIn.seconds()),r?.notBefore!==void 0&&(s.nbf=Math.floor(r.notBefore.getTime()/1e3)),s.iat=Math.floor(Date.now()/1e3);const a=new TextEncoder,c=Tr.encode(a.encode(JSON.stringify(i)),{includePadding:!1}),l=Tr.encode(a.encode(JSON.stringify(s)),{includePadding:!1}),u=a.encode([c,l].join(".")),d=await c6(t).sign(e,u),f=Tr.encode(new Uint8Array(d),{includePadding:!1});return[c,l,f].join(".")}function a6(t){const e=t.split(".");return e.length!==3?null:e}function Ss(t){const e=a6(t);if(!e)return null;const n=new TextDecoder,r=Tr.decode(e[0],{strict:!1}),i=Tr.decode(e[1],{strict:!1}),s=JSON.parse(n.decode(r));if(typeof s!="object"||s===null||!("alg"in s)||!l6(s.alg)||"typ"in s&&s.typ!=="JWT")return null;const a=JSON.parse(n.decode(i));if(typeof a!="object"||a===null)return null;const c={algorithm:s.alg,expiresAt:null,subject:null,issuedAt:null,issuer:null,jwtId:null,audiences:null,notBefore:null};if("exp"in a){if(typeof a.exp!="number")return null;c.expiresAt=new Date(a.exp*1e3)}if("iss"in a){if(typeof a.iss!="string")return null;c.issuer=a.iss}if("sub"in a){if(typeof a.sub!="string")return null;c.subject=a.sub}if("aud"in a)if(Array.isArray(a.aud)){for(const l of a.aud)if(typeof l!="string")return null;c.audiences=a.aud}else{if(typeof a.aud!="string")return null;c.audiences=[a.aud]}if("nbf"in a){if(typeof a.nbf!="number")return null;c.notBefore=new Date(a.nbf*1e3)}if("iat"in a){if(typeof a.iat!="number")return null;c.issuedAt=new Date(a.iat*1e3)}if("jti"in a){if(typeof a.jti!="string")return null;c.jwtId=a.jti}return{value:t,header:{...s,typ:"JWT",alg:s.alg},payload:{...a},parts:e,...c}}function c6(t){return new o6(u6[t])}function l6(t){return typeof t!="string"?!1:["HS256","HS384","HS512","RS256","RS384","RS512","ES256","ES384","ES512","PS256","PS384","PS512"].includes(t)}const u6={RS256:"SHA-256",RS384:"SHA-384",RS512:"SHA-512"};function d6(){const t=new Uint8Array(32);return crypto.getRandomValues(t),Tr.encode(t,{includePadding:!1})}function p6(t){try{const n=/-----BEGIN (?:RSA )?(?:PRIVATE|PUBLIC) KEY-----([^-]*)-----END (?:RSA )?(?:PRIVATE|PUBLIC) KEY-----/.exec(t);if(!n||!n[1])throw new Error("Invalid PEM format");return Uint8Array.from(atob(n[1].replace(/\s/g,"")),r=>r.charCodeAt(0)).buffer}finally{t=t.replace(/./g,"\0")}}async function f6(t,e){if(e==="plain")return t;const n=new TextEncoder().encode(t),r=await gb(n);return Tr.encode(new Uint8Array(r),{includePadding:!1})}const ia=300,Zc=720*60*60,Lr=1440*60,h6="auth-token",ka=1800*1e3,jd=10080*60*1e3,g6=300,m6=300,_6=1800*1e3,y6=1800*1e3,b6=1440*60*1e3;function yb(t,e,n){const r=[];return r.push([encodeURIComponent(t),encodeURIComponent(e)]),n?.domain!==void 0&&r.push(["Domain",n.domain]),n?.expires!==void 0&&r.push(["Expires",n.expires.toUTCString()]),n?.httpOnly&&r.push(["HttpOnly"]),n?.maxAge!==void 0&&r.push(["Max-Age",n.maxAge.toString()]),n?.path!==void 0&&r.push(["Path",n.path]),n?.sameSite==="lax"&&r.push(["SameSite","Lax"]),n?.sameSite==="none"&&r.push(["SameSite","None"]),n?.sameSite==="strict"&&r.push(["SameSite","Strict"]),n?.secure&&r.push(["Secure"]),r.map(i=>i.join("=")).join("; ")}function w6(t){const e=new Map,n=t.split("; ");for(const r of n){const i=r.split("="),s=i[0],a=i[1]??"";s&&e.set(decodeURIComponent(s),decodeURIComponent(a))}return e}function N0(t){return`${t}-${h6}`}function bb(t){if(!t)return;const[e]=t.split(":");if(!e||e==="localhost"||/^(\d{1,3}\.){3}\d{1,3}$/.test(e))return;const n=e.split(".");return n.length>2?`.${n.slice(-2).join(".")}`:`.${e}`}function Ti(t,e){return e?w6(e).get(N0(t)):void 0}function wb(t,e){return yb(N0(t),"",{path:"/",httpOnly:!0,secure:!0,maxAge:0,sameSite:"none",domain:e?bb(e):void 0})}function tc(t,e,n){return yb(N0(t),e,{path:"/",httpOnly:!0,secure:!0,maxAge:Zc,sameSite:"none",domain:n?bb(n):void 0})}class X extends I{constructor(e,n){super(e,{message:JSON.stringify(n),res:new Response(JSON.stringify(n),{status:e,headers:{"Content-Type":"application/json"}})})}}var v6=Object.defineProperty,x6=(t,e,n)=>e in t?v6(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,zi=(t,e,n)=>x6(t,typeof e!="symbol"?e+"":e,n);const ct=o.z.object({"#text":o.z.string()}),k6=o.z.object({"#text":o.z.string(),"@_xmlns:saml":o.z.string().optional()});o.z.object({"samlp:AuthnRequest":o.z.object({"saml:Issuer":k6,"@_xmlns:samlp":o.z.string(),"@_xmlns:saml":o.z.string().optional(),"@_ForceAuthn":o.z.string().transform(t=>t.toLowerCase()==="true").optional(),"@_ID":o.z.string(),"@_IssueInstant":o.z.string().datetime(),"@_Destination":o.z.string().url(),"@_AssertionConsumerServiceURL":o.z.string().url().optional(),"@_ProtocolBinding":o.z.string().optional(),"@_Version":o.z.string()})});o.z.array(o.z.object({":@":o.z.object({"@_xmlns":o.z.string(),"@_entityID":o.z.string()}),EntityDescriptor:o.z.array(o.z.object({":@":o.z.object({"@_protocolSupportEnumeration":o.z.string()}),IDPSSODescriptor:o.z.array(o.z.union([o.z.object({KeyDescriptor:o.z.array(o.z.object({KeyInfo:o.z.array(o.z.object({X509Data:o.z.array(o.z.object({X509Certificate:o.z.array(ct)}))})),":@":o.z.object({"@_xmlns":o.z.string()})})),":@":o.z.object({"@_use":o.z.string()})}),o.z.object({SingleLogoutService:o.z.array(o.z.object({})),":@":o.z.object({"@_Binding":o.z.string(),"@_Location":o.z.string()})}),o.z.object({NameIDFormat:o.z.array(ct)}),o.z.object({SingleSignOnService:o.z.array(o.z.object({})),":@":o.z.object({"@_Binding":o.z.string(),"@_Location":o.z.string()})}),o.z.object({Attribute:o.z.array(o.z.object({})),":@":o.z.object({"@_Name":o.z.string(),"@_NameFormat":o.z.string(),"@_FriendlyName":o.z.string(),"@_xmlns":o.z.string()})})]))}))}));const $6=o.z.object({"saml:Attribute":o.z.array(o.z.object({"saml:AttributeValue":o.z.array(o.z.object({"#text":o.z.string()})),":@":o.z.object({"@_xmlns:xs":o.z.string().optional(),"@_xmlns:xsi":o.z.string(),"@_xsi:type":o.z.string()}).optional()})),":@":o.z.object({"@_Name":o.z.string(),"@_NameFormat":o.z.string(),"@_FriendlyName":o.z.string().optional()})}),S6=o.z.object({"ds:Transform":o.z.array(o.z.any()),":@":o.z.object({"@_Algorithm":o.z.string()})}),zh=o.z.object({"ds:Signature":o.z.array(o.z.union([o.z.object({"ds:SignedInfo":o.z.array(o.z.union([o.z.object({"ds:CanonicalizationMethod":o.z.array(o.z.object({":@":o.z.object({"@_Algorithm":o.z.string()})}))}),o.z.object({"ds:SignatureMethod":o.z.array(o.z.object({":@":o.z.object({"@_Algorithm":o.z.string()})}))}),o.z.object({"ds:Reference":o.z.array(o.z.union([o.z.object({"ds:Transforms":o.z.array(S6)}),o.z.object({"ds:DigestMethod":o.z.array(o.z.object({":@":o.z.object({"@_Algorithm":o.z.string()})}))}),o.z.object({"ds:DigestValue":o.z.array(ct)})])),":@":o.z.object({"@_URI":o.z.string().optional()}).optional()})]))}),o.z.object({"ds:SignatureValue":o.z.array(ct)}),o.z.object({"ds:KeyInfo":o.z.array(o.z.union([o.z.object({"ds:KeyValue":o.z.array(o.z.object({"ds:RSAKeyValue":o.z.array(o.z.union([o.z.object({"ds:Modulus":o.z.array(ct)}),o.z.object({"ds:Exponent":o.z.array(ct)})]))}))}),o.z.object({"ds:X509Data":o.z.array(o.z.object({"ds:X509Certificate":o.z.array(ct)}))}),o.z.object({"ds:KeyValue":o.z.array(o.z.object({"ds:RSAKeyValue":o.z.array(o.z.union([o.z.object({"ds:Modulus":o.z.array(ct)}),o.z.object({"ds:Exponent":o.z.array(ct)})]))})),"ds:X509Data":o.z.array(o.z.object({"ds:X509Certificate":o.z.array(ct)}))})]))})])),":@":o.z.object({"@_xmlns:ds":o.z.string().optional()}).optional()});o.z.array(o.z.object({"samlp:Response":o.z.array(o.z.union([o.z.object({"saml:Issuer":o.z.array(ct)}),zh,o.z.object({"samlp:Status":o.z.array(o.z.object({"samlp:StatusCode":o.z.array(ct),":@":o.z.object({"@_Value":o.z.string()})}))}),o.z.object({"saml:Assertion":o.z.array(o.z.union([o.z.object({"saml:Issuer":o.z.array(ct)}),zh,o.z.object({"saml:Subject":o.z.array(o.z.union([o.z.object({"saml:NameID":o.z.array(ct),":@":o.z.object({"@_Format":o.z.string()})}),o.z.object({"saml:SubjectConfirmation":o.z.array(o.z.object({"saml:SubjectConfirmationData":o.z.array(o.z.any()),":@":o.z.object({"@_InResponseTo":o.z.string(),"@_NotOnOrAfter":o.z.string(),"@_Recipient":o.z.string()})})),":@":o.z.object({"@_Method":o.z.string()})})]))}),o.z.object({"saml:Conditions":o.z.array(o.z.object({"saml:AudienceRestriction":o.z.array(o.z.object({"saml:Audience":o.z.array(ct)}))})),":@":o.z.object({"@_NotBefore":o.z.string(),"@_NotOnOrAfter":o.z.string()})}),o.z.object({"saml:AuthnStatement":o.z.array(o.z.object({"saml:AuthnContext":o.z.array(o.z.object({"saml:AuthnContextClassRef":o.z.array(ct)}))})),":@":o.z.object({"@_AuthnInstant":o.z.string(),"@_SessionIndex":o.z.string(),"@_SessionNotOnOrAfter":o.z.string()})}),o.z.object({"saml:AttributeStatement":o.z.array($6)})])),":@":o.z.object({"@_xmlns":o.z.string(),"@_ID":o.z.string(),"@_IssueInstant":o.z.string(),"@_Version":o.z.string()})})])),":@":o.z.object({"@_xmlns:samlp":o.z.string(),"@_xmlns:saml":o.z.string(),"@_Destination":o.z.string(),"@_ID":o.z.string(),"@_InResponseTo":o.z.string(),"@_IssueInstant":o.z.string(),"@_Version":o.z.string()})}));var z6={};(function(t){const e=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",n=e+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",r="["+e+"]["+n+"]*",i=new RegExp("^"+r+"$"),s=function(c,l){const u=[];let d=l.exec(c);for(;d;){const f=[];f.startIndex=l.lastIndex-d[0].length;const p=d.length;for(let h=0;h<p;h++)f.push(d[h]);u.push(f),d=l.exec(c)}return u},a=function(c){const l=i.exec(c);return!(l===null||typeof l>"u")};t.isExist=function(c){return typeof c<"u"},t.isEmptyObject=function(c){return Object.keys(c).length===0},t.merge=function(c,l,u){if(l){const d=Object.keys(l),f=d.length;for(let p=0;p<f;p++)u==="strict"?c[d[p]]=[l[d[p]]]:c[d[p]]=l[d[p]]}},t.getValue=function(c){return t.isExist(c)?c:""},t.isName=a,t.getAllMatches=s,t.nameRegexp=r})(z6);function A6(t){return typeof t=="function"?t:Array.isArray(t)?e=>{for(const n of t)if(typeof n=="string"&&e===n||n instanceof RegExp&&n.test(e))return!0}:()=>!1}var E6=A6;const C6=`
|
|
2
|
+
`;function N6(t,e){let n="";return e.format&&e.indentBy.length>0&&(n=C6),vb(t,e,"",n)}function vb(t,e,n,r){let i="",s=!1;for(let a=0;a<t.length;a++){const c=t[a],l=I6(c);if(l===void 0)continue;let u="";if(n.length===0?u=l:u=`${n}.${l}`,l===e.textNodeName){let m=c[l];j6(u,e)||(m=e.tagValueProcessor(l,m),m=xb(m,e)),s&&(i+=r),i+=m,s=!1;continue}else if(l===e.cdataPropName){s&&(i+=r),i+=`<![CDATA[${c[l][0][e.textNodeName]}]]>`,s=!1;continue}else if(l===e.commentPropName){i+=r+`<!--${c[l][0][e.textNodeName]}-->`,s=!0;continue}else if(l[0]==="?"){const m=Ah(c[":@"],e),y=l==="?xml"?"":r;let w=c[l][0][e.textNodeName];w=w.length!==0?" "+w:"",i+=y+`<${l}${w}${m}?>`,s=!0;continue}let d=r;d!==""&&(d+=e.indentBy);const f=Ah(c[":@"],e),p=r+`<${l}${f}`,h=vb(c[l],e,u,d);e.unpairedTags.indexOf(l)!==-1?e.suppressUnpairedNode?i+=p+">":i+=p+"/>":(!h||h.length===0)&&e.suppressEmptyNode?i+=p+"/>":h&&h.endsWith(">")?i+=p+`>${h}${r}</${l}>`:(i+=p+">",h&&r!==""&&(h.includes("/>")||h.includes("</"))?i+=r+e.indentBy+h+r:i+=h,i+=`</${l}>`),s=!0}return i}function I6(t){const e=Object.keys(t);for(let n=0;n<e.length;n++){const r=e[n];if(t.hasOwnProperty(r)&&r!==":@")return r}}function Ah(t,e){let n="";if(t&&!e.ignoreAttributes)for(let r in t){if(!t.hasOwnProperty(r))continue;let i=e.attributeValueProcessor(r,t[r]);i=xb(i,e),i===!0&&e.suppressBooleanAttributes?n+=` ${r.substr(e.attributeNamePrefix.length)}`:n+=` ${r.substr(e.attributeNamePrefix.length)}="${i}"`}return n}function j6(t,e){t=t.substr(0,t.length-e.textNodeName.length-1);let n=t.substr(t.lastIndexOf(".")+1);for(let r in e.stopNodes)if(e.stopNodes[r]===t||e.stopNodes[r]==="*."+n)return!0;return!1}function xb(t,e){if(t&&t.length>0&&e.processEntities)for(let n=0;n<e.entities.length;n++){const r=e.entities[n];t=t.replace(r.regex,r.val)}return t}var T6=N6;const O6=T6,P6=E6,R6={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&"},{regex:new RegExp(">","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function mr(t){this.options=Object.assign({},R6,t),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=P6(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=D6),this.processTextOrObjNode=L6,this.options.format?(this.indentate=B6,this.tagEndChar=`>
|
|
3
|
+
`,this.newLine=`
|
|
4
|
+
`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}mr.prototype.build=function(t){return this.options.preserveOrder?O6(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t={[this.options.arrayNodeName]:t}),this.j2x(t,0,[]).val)};mr.prototype.j2x=function(t,e,n){let r="",i="";const s=n.join(".");for(let a in t)if(Object.prototype.hasOwnProperty.call(t,a))if(typeof t[a]>"u")this.isAttribute(a)&&(i+="");else if(t[a]===null)this.isAttribute(a)||a===this.options.cdataPropName?i+="":a[0]==="?"?i+=this.indentate(e)+"<"+a+"?"+this.tagEndChar:i+=this.indentate(e)+"<"+a+"/"+this.tagEndChar;else if(t[a]instanceof Date)i+=this.buildTextValNode(t[a],a,"",e);else if(typeof t[a]!="object"){const c=this.isAttribute(a);if(c&&!this.ignoreAttributesFn(c,s))r+=this.buildAttrPairStr(c,""+t[a]);else if(!c)if(a===this.options.textNodeName){let l=this.options.tagValueProcessor(a,""+t[a]);i+=this.replaceEntitiesValue(l)}else i+=this.buildTextValNode(t[a],a,"",e)}else if(Array.isArray(t[a])){const c=t[a].length;let l="",u="";for(let d=0;d<c;d++){const f=t[a][d];if(!(typeof f>"u"))if(f===null)a[0]==="?"?i+=this.indentate(e)+"<"+a+"?"+this.tagEndChar:i+=this.indentate(e)+"<"+a+"/"+this.tagEndChar;else if(typeof f=="object")if(this.options.oneListGroup){const p=this.j2x(f,e+1,n.concat(a));l+=p.val,this.options.attributesGroupName&&f.hasOwnProperty(this.options.attributesGroupName)&&(u+=p.attrStr)}else l+=this.processTextOrObjNode(f,a,e,n);else if(this.options.oneListGroup){let p=this.options.tagValueProcessor(a,f);p=this.replaceEntitiesValue(p),l+=p}else l+=this.buildTextValNode(f,a,"",e)}this.options.oneListGroup&&(l=this.buildObjectNode(l,a,u,e)),i+=l}else if(this.options.attributesGroupName&&a===this.options.attributesGroupName){const c=Object.keys(t[a]),l=c.length;for(let u=0;u<l;u++)r+=this.buildAttrPairStr(c[u],""+t[a][c[u]])}else i+=this.processTextOrObjNode(t[a],a,e,n);return{attrStr:r,val:i}};mr.prototype.buildAttrPairStr=function(t,e){return e=this.options.attributeValueProcessor(t,""+e),e=this.replaceEntitiesValue(e),this.options.suppressBooleanAttributes&&e==="true"?" "+t:" "+t+'="'+e+'"'};function L6(t,e,n,r){const i=this.j2x(t,n+1,r.concat(e));return t[this.options.textNodeName]!==void 0&&Object.keys(t).length===1?this.buildTextValNode(t[this.options.textNodeName],e,i.attrStr,n):this.buildObjectNode(i.val,e,i.attrStr,n)}mr.prototype.buildObjectNode=function(t,e,n,r){if(t==="")return e[0]==="?"?this.indentate(r)+"<"+e+n+"?"+this.tagEndChar:this.indentate(r)+"<"+e+n+this.closeTag(e)+this.tagEndChar;{let i="</"+e+this.tagEndChar,s="";return e[0]==="?"&&(s="?",i=""),(n||n==="")&&t.indexOf("<")===-1?this.indentate(r)+"<"+e+n+s+">"+t+i:this.options.commentPropName!==!1&&e===this.options.commentPropName&&s.length===0?this.indentate(r)+`<!--${t}-->`+this.newLine:this.indentate(r)+"<"+e+n+s+this.tagEndChar+t+this.indentate(r)+i}};mr.prototype.closeTag=function(t){let e="";return this.options.unpairedTags.indexOf(t)!==-1?this.options.suppressUnpairedNode||(e="/"):this.options.suppressEmptyNode?e="/":e=`></${t}`,e};mr.prototype.buildTextValNode=function(t,e,n,r){if(this.options.cdataPropName!==!1&&e===this.options.cdataPropName)return this.indentate(r)+`<![CDATA[${t}]]>`+this.newLine;if(this.options.commentPropName!==!1&&e===this.options.commentPropName)return this.indentate(r)+`<!--${t}-->`+this.newLine;if(e[0]==="?")return this.indentate(r)+"<"+e+n+"?"+this.tagEndChar;{let i=this.options.tagValueProcessor(e,t);return i=this.replaceEntitiesValue(i),i===""?this.indentate(r)+"<"+e+n+this.closeTag(e)+this.tagEndChar:this.indentate(r)+"<"+e+n+">"+i+"</"+e+this.tagEndChar}};mr.prototype.replaceEntitiesValue=function(t){if(t&&t.length>0&&this.options.processEntities)for(let e=0;e<this.options.entities.length;e++){const n=this.options.entities[e];t=t.replace(n.regex,n.val)}return t};function B6(t){return this.options.indentBy.repeat(t)}function D6(t){return t.startsWith(this.options.attributeNamePrefix)&&t!==this.options.textNodeName?t.substr(this.attrPrefixLen):!1}var U6=mr;const M6=U6;var q6={XMLBuilder:M6};let kb=class{constructor(e,n){if(zi(this,"alphabet"),zi(this,"padding"),zi(this,"decodeMap",new Map),e.length!==32)throw new Error("Invalid alphabet");if(this.alphabet=e,this.padding=n?.padding??"=",this.alphabet.includes(this.padding)||this.padding.length!==1)throw new Error("Invalid padding");for(let r=0;r<e.length;r++)this.decodeMap.set(e[r],r)}encode(e,n){let r="",i=0,s=0;for(let a=0;a<e.length;a++)for(i=i<<8|e[a],s+=8;s>=5;)s-=5,r+=this.alphabet[i>>s&31];if(s>0&&(r+=this.alphabet[i<<5-s&31]),n?.includePadding??!0){const a=(8-r.length%8)%8;for(let c=0;c<a;c++)r+="="}return r}decode(e,n){const r=n?.strict??!0,i=Math.ceil(e.length/8),s=[];for(let a=0;a<i;a++){let c=0;const l=[];for(let d=0;d<8;d++){const f=e[a*8+d];if(f==="="){if(a+1!==i)throw new Error(`Invalid character: ${f}`);c+=1;continue}if(f===void 0){if(r)throw new Error("Invalid data");c+=1;continue}const p=this.decodeMap.get(f)??null;if(p===null)throw new Error(`Invalid character: ${f}`);l.push(p)}if(c===8||c===7||c===5||c===2)throw new Error("Invalid padding");const u=(l[0]<<3)+(l[1]>>2);if(s.push(u),c<6){const d=((l[1]&3)<<6)+(l[2]<<1)+(l[3]>>4);s.push(d)}if(c<4){const d=((l[3]&255)<<4)+(l[4]>>1);s.push(d)}if(c<3){const d=((l[4]&1)<<7)+(l[5]<<2)+(l[6]>>3);s.push(d)}if(c<1){const d=((l[6]&7)<<5)+l[7];s.push(d)}}return Uint8Array.from(s)}};new kb("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567");new kb("0123456789ABCDEFGHIJKLMNOPQRSTUV");let $b=class{constructor(e,n){if(zi(this,"alphabet"),zi(this,"padding"),zi(this,"decodeMap",new Map),e.length!==64)throw new Error("Invalid alphabet");if(this.alphabet=e,this.padding=n?.padding??"=",this.alphabet.includes(this.padding)||this.padding.length!==1)throw new Error("Invalid padding");for(let r=0;r<e.length;r++)this.decodeMap.set(e[r],r)}encode(e,n){let r="",i=0,s=0;for(let a=0;a<e.length;a++)for(i=i<<8|e[a],s+=8;s>=6;)s+=-6,r+=this.alphabet[i>>s&63];if(s>0&&(r+=this.alphabet[i<<6-s&63]),n?.includePadding??!0){const a=(4-r.length%4)%4;for(let c=0;c<a;c++)r+="="}return r}decode(e,n){const r=n?.strict??!0,i=Math.ceil(e.length/4),s=[];for(let a=0;a<i;a++){let c=0,l=0;for(let u=0;u<4;u++){const d=e[a*4+u];if(d==="="){if(a+1!==i)throw new Error(`Invalid character: ${d}`);c+=1;continue}if(d===void 0){if(r)throw new Error("Invalid data");c+=1;continue}const f=this.decodeMap.get(d)??null;if(f===null)throw new Error(`Invalid character: ${d}`);l+=f<<6*(3-u)}s.push(l>>16&255),c<2&&s.push(l>>8&255),c<1&&s.push(l&255)}return Uint8Array.from(s)}};new $b("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/");new $b("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_");const F6="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let Eh=(t=21)=>{let e="",n=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+=F6[n[t]&63];return e};async function H6(t,e){const n=t.notBefore||new Date().toISOString(),r=t.notAfter||new Date(new Date(n).getTime()+600*1e3).toISOString(),i=t.issueInstant||n,s=t.sessionNotOnOrAfter||r,a=t.responseId||`_${Eh()}`,c=t.assertionId||`_${Eh()}`,l=[{"samlp:Response":[{"saml:Issuer":[{"#text":t.issuer}]},{"samlp:Status":[{"samlp:StatusCode":[],":@":{"@_Value":"urn:oasis:names:tc:SAML:2.0:status:Success"}}]},{"saml:Assertion":[{"saml:Issuer":[{"#text":t.issuer}]},{"saml:Subject":[{"saml:NameID":[{"#text":t.email}],":@":{"@_Format":"urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress"}},{"saml:SubjectConfirmation":[{"saml:SubjectConfirmationData":[],":@":{"@_InResponseTo":t.inResponseTo,"@_NotOnOrAfter":r,"@_Recipient":t.destination}}],":@":{"@_Method":"urn:oasis:names:tc:SAML:2.0:cm:bearer"}}]},{"saml:Conditions":[{"saml:AudienceRestriction":[{"saml:Audience":[{"#text":t.audience}]}]}],":@":{"@_NotBefore":n,"@_NotOnOrAfter":r}},{"saml:AuthnStatement":[{"saml:AuthnContext":[{"saml:AuthnContextClassRef":[{"#text":"urn:oasis:names:tc:SAML:2.0:ac:classes:unspecified"}]}]}],":@":{"@_AuthnInstant":i,"@_SessionIndex":t.sessionIndex,"@_SessionNotOnOrAfter":s}},{"saml:AttributeStatement":[{"saml:Attribute":[{"saml:AttributeValue":[{"#text":t.userId}],":@":{"@_xmlns:xs":"http://www.w3.org/2001/XMLSchema","@_xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","@_xsi:type":"xs:string"}}],":@":{"@_FriendlyName":"persistent","@_Name":"id","@_NameFormat":"urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified"}},{"saml:Attribute":[{"saml:AttributeValue":[{"#text":t.email}],":@":{"@_xmlns:xs":"http://www.w3.org/2001/XMLSchema","@_xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","@_xsi:type":"xs:string"}}],":@":{"@_Name":"email","@_NameFormat":"urn:oasis:names:tc:SAML:2.0:attrname-format:basic"}},{"saml:Attribute":[{"saml:AttributeValue":[{"#text":"manage-account"}],":@":{"@_xmlns:xs":"http://www.w3.org/2001/XMLSchema","@_xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","@_xsi:type":"xs:string"}}],":@":{"@_Name":"Role","@_NameFormat":"urn:oasis:names:tc:SAML:2.0:attrname-format:basic"}},{"saml:Attribute":[{"saml:AttributeValue":[{"#text":"default-roles-master"}],":@":{"@_xmlns:xs":"http://www.w3.org/2001/XMLSchema","@_xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","@_xsi:type":"xs:string"}}],":@":{"@_Name":"Role","@_NameFormat":"urn:oasis:names:tc:SAML:2.0:attrname-format:basic"}},{"saml:Attribute":[{"saml:AttributeValue":[{"#text":"offline_access"}],":@":{"@_xmlns:xs":"http://www.w3.org/2001/XMLSchema","@_xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","@_xsi:type":"xs:string"}}],":@":{"@_Name":"Role","@_NameFormat":"urn:oasis:names:tc:SAML:2.0:attrname-format:basic"}},{"saml:Attribute":[{"saml:AttributeValue":[{"#text":"view-profile"}],":@":{"@_xmlns:xs":"http://www.w3.org/2001/XMLSchema","@_xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","@_xsi:type":"xs:string"}}],":@":{"@_Name":"Role","@_NameFormat":"urn:oasis:names:tc:SAML:2.0:attrname-format:basic"}},{"saml:Attribute":[{"saml:AttributeValue":[{"#text":"uma_authorization"}],":@":{"@_xmlns:xs":"http://www.w3.org/2001/XMLSchema","@_xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","@_xsi:type":"xs:string"}}],":@":{"@_Name":"Role","@_NameFormat":"urn:oasis:names:tc:SAML:2.0:attrname-format:basic"}},{"saml:Attribute":[{"saml:AttributeValue":[{"#text":"manage-account-links"}],":@":{"@_xmlns:xs":"http://www.w3.org/2001/XMLSchema","@_xmlns:xsi":"http://www.w3.org/2001/XMLSchema-instance","@_xsi:type":"xs:string"}}],":@":{"@_Name":"Role","@_NameFormat":"urn:oasis:names:tc:SAML:2.0:attrname-format:basic"}}]}],":@":{"@_xmlns":"urn:oasis:names:tc:SAML:2.0:assertion","@_ID":c,"@_IssueInstant":i,"@_Version":"2.0"}}],":@":{"@_xmlns:samlp":"urn:oasis:names:tc:SAML:2.0:protocol","@_xmlns:saml":"urn:oasis:names:tc:SAML:2.0:assertion","@_Destination":t.destination,"@_ID":a,"@_InResponseTo":t.inResponseTo,"@_IssueInstant":i,"@_Version":"2.0"}}];let u=new q6.XMLBuilder({ignoreAttributes:!1,suppressEmptyNode:!0,preserveOrder:!0}).build(l);return t.signature&&e&&(u=await e.signSAML(u,t.signature.privateKeyPem,t.signature.cert)),t.encode===!1?u:btoa(u)}let Sb=class{constructor(e){this.signUrl=e}async signSAML(e,n,r){const i=await fetch(this.signUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({xmlContent:e,privateKey:n,publicCert:r})});if(!i.ok)throw new Error(`Failed to sign SAML via HTTP: ${i.status} ${i.statusText}`);return await i.text()}};function V6(t,e,n){const r=n?`<input type="hidden" name="RelayState" value="${n}" />`:"",i=`
|
|
5
|
+
<!DOCTYPE html>
|
|
6
|
+
<html>
|
|
7
|
+
<body onload="document.forms[0].submit()">
|
|
8
|
+
<noscript>
|
|
9
|
+
<p>Your browser has JavaScript disabled. Please click the button below to continue:</p>
|
|
10
|
+
<input type="submit" value="Continue">
|
|
11
|
+
</noscript>
|
|
12
|
+
<form method="post" action="${t}">
|
|
13
|
+
<input type="hidden" name="SAMLResponse" value="${e}" />
|
|
14
|
+
${r}
|
|
15
|
+
</form>
|
|
16
|
+
<script>
|
|
17
|
+
window.onload = function() {{
|
|
18
|
+
document.forms[0].submit();
|
|
19
|
+
}};
|
|
20
|
+
<\/script>
|
|
21
|
+
</body>
|
|
22
|
+
</html>`;return new Response(i,{headers:{"Content-Type":"text/html"}})}async function K6(t,e,n,r,i){if(!n.redirect_uri)throw new X(400,{message:"Missing redirect_uri in authParams"});if(!r.email)throw new X(400,{message:"Missing email in user"});const{signingKeys:s}=await t.env.data.keys.list({q:"type:saml_encryption"}),[a]=s;if(!a)throw new X(500,{message:"No signing key found"});if(!e.addons?.samlp)throw new X(400,{message:`SAML Addon is not enabled for client ${e.client_id}`});const{recipient:c,audience:l}=e.addons.samlp,u=n.state||"";if(!c||!u||!r||!n.state)throw new X(400,{message:"Missing recipient or inResponseTo"});const d=JSON.parse(n.state),f=new URL(n.redirect_uri),p=t.env.samlSigner||(t.env.SAML_SIGN_URL?new Sb(t.env.SAML_SIGN_URL):void 0),h=await H6({issuer:t.env.ISSUER,audience:l||n.client_id,destination:f.toString(),inResponseTo:d.requestId,userId:r.app_metadata?.vimeo?.user_id||r.user_id,email:r.email,sessionIndex:i,signature:{privateKeyPem:a.pkcs7,cert:a.cert,kid:a.kid}},p);return V6(f.toString(),h,d.relayState)}function Td(t,e,n,r){const i=new Headers(r);i.set("Server-Timing","cf-nel=0; no-cloudflare-insights=1");const s=`<!DOCTYPE html>
|
|
23
|
+
<html>
|
|
24
|
+
|
|
25
|
+
<head>
|
|
26
|
+
<title>Authorization Response</title>
|
|
27
|
+
</head>
|
|
28
|
+
|
|
29
|
+
<body>
|
|
30
|
+
<script type="text/javascript">
|
|
31
|
+
(function (window, document) {
|
|
32
|
+
var targetOrigin = "${e}";
|
|
33
|
+
var webMessageRequest = {};
|
|
34
|
+
var authorizationResponse = {
|
|
35
|
+
type: "authorization_response",
|
|
36
|
+
response: ${n}
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
var mainWin = (window.opener) ? window.opener : window.parent;
|
|
40
|
+
if (webMessageRequest["web_message_uri"] && webMessageRequest["web_message_target"]) {
|
|
41
|
+
window.addEventListener("message", function (evt) {
|
|
42
|
+
if (evt.origin != targetOrigin)
|
|
43
|
+
return;
|
|
44
|
+
switch (evt.data.type) {
|
|
45
|
+
case "relay_response":
|
|
46
|
+
var messageTargetWindow = evt.source.frames[webMessageRequest["web_message_target"]];
|
|
47
|
+
if (messageTargetWindow) {
|
|
48
|
+
messageTargetWindow.postMessage(authorizationResponse, webMessageRequest["web_message_uri"]);
|
|
49
|
+
window.close();
|
|
50
|
+
}
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
mainWin.postMessage({
|
|
55
|
+
type: "relay_request"
|
|
56
|
+
}, targetOrigin);
|
|
57
|
+
} else {
|
|
58
|
+
mainWin.postMessage(authorizationResponse, targetOrigin);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
) (this, this.document);
|
|
62
|
+
<\/script>
|
|
63
|
+
</body>
|
|
64
|
+
|
|
65
|
+
</html>`;return t.html(s,{headers:i})}const Od=["openid","profile","email","address","phone"];async function G6(t,e,n,r){const i=[];if(!(await t.env.data.tenants.get(e))?.flags?.inherit_global_permissions_in_organizations)return[];const a=await t.env.data.userRoles.list(e,n,void 0,"");for(const c of a)(await t.env.data.rolePermissions.list(e,c.id,{per_page:1e3})).forEach(u=>{u.resource_server_identifier===r&&i.push(u.permission_name)});return[...new Set(i)]}async function W6(t,e){const{tenantId:n,clientId:r,audience:i,requestedScopes:s}=e,a=s.filter(v=>Od.includes(v)),l=(await t.env.data.resourceServers.list(n)).resource_servers.filter(v=>v.identifier===i);if(l.length===0)return{scopes:a,permissions:[]};const u=l[0];if(!u)return{scopes:a,permissions:[]};const d=u.options?.enforce_policies===!0,f=u.options?.token_dialect||"access_token",h=(await t.env.data.clientGrants.list(n,{q:`client_id:"${r}"`})).client_grants.find(v=>v.audience===i);if(!h)return{scopes:a,permissions:[]};const m=h.scope||[],y=(u.scopes||[]).map(v=>v.value);if(!d){let v;return s.length===0?v=m.filter(b=>y.includes(b)):v=s.filter(b=>y.includes(b)&&m.includes(b)),{scopes:[...new Set([...a,...v])],permissions:[]}}const w=m.filter(v=>y.includes(v));if(f==="access_token_authz")return{scopes:a,permissions:w};let _;return s.length===0?_=m.filter(v=>y.includes(v)):_=s.filter(v=>y.includes(v)&&m.includes(v)),{scopes:[...new Set([...a,..._])],permissions:w}}async function nc(t,e){if(e.grantType===Xt.ClientCredential)return await W6(t,{tenantId:e.tenantId,clientId:e.clientId,audience:e.audience,requestedScopes:e.requestedScopes});const{tenantId:n,userId:r,audience:i,requestedScopes:s,organizationId:a}=e;let c=!1;if(a){if((await t.env.data.tenants.get(n))?.flags?.inherit_global_permissions_in_organizations){const P=await t.env.data.userRoles.list(n,r,void 0,"");for(const M of P)if((await t.env.data.rolePermissions.list(n,M.id,{per_page:1e3})).some(oe=>oe.permission_name==="admin:organizations"&&oe.resource_server_identifier===i)){c=!0;break}}if(!c&&!(await t.env.data.userOrganizations.list(n,{q:`user_id:${r}`,per_page:1e3})).userOrganizations.some(K=>K.organization_id===a))throw new X(403,{error:"access_denied",error_description:"User is not a member of the specified organization"})}const l=s.filter(C=>Od.includes(C)),d=(await t.env.data.resourceServers.list(n)).resource_servers.filter(C=>C.identifier===i);if(d.length===0)return{scopes:s,permissions:[]};const f=d[0];if(!f)return{scopes:s,permissions:[]};const p=(f.scopes||[]).map(C=>C.value),h=f.options?.enforce_policies===!0,m=f.options?.token_dialect||"access_token";if(!h)return{scopes:s,permissions:[]};const y=await t.env.data.userPermissions.list(n,r,void 0,a),w=await t.env.data.userRoles.list(n,r,void 0,""),_=a?await t.env.data.userRoles.list(n,r,void 0,a):[],k=[...w,..._],v=a?await G6(t,n,r,i):[],$=[];for(const C of k)(await t.env.data.rolePermissions.list(n,C.id,{per_page:1e3})).forEach(M=>{M.resource_server_identifier===i&&$.push(M.permission_name)});const b=new Set;y.forEach(C=>{C.resource_server_identifier===i&&b.add(C.permission_name)}),$.forEach(C=>{b.add(C)}),v.forEach(C=>{b.add(C)});const z=Array.from(b),A=z.filter(C=>p.includes(C)),N=s.filter(C=>!p.includes(C)&&!Od.includes(C));if(m==="access_token_authz")return{scopes:[...new Set([...l,...N])],permissions:A};const O=s.filter(C=>p.includes(C)&&z.includes(C));return{scopes:[...new Set([...l,...O,...N])],permissions:A}}const Ch=["sub","iss","aud","exp","nbf","iat","jti"];async function Yc(t,e){const{authParams:n,user:r,client:i,session_id:s,organization:a,permissions:c,impersonatingUser:l}=e,{signingKeys:u}=await t.env.data.keys.list({q:"type:jwt_signing"}),d=u.filter($=>!$.revoked_at||new Date($.revoked_at)>new Date),f=d[d.length-1];if(!f?.pkcs7)throw new X(500,{message:"No signing key available"});const p=p6(f.pkcs7),h=t.var.custom_domain?`https://${t.var.custom_domain}/`:t.env.ISSUER,m=n.audience||i.tenant.audience;if(!m)throw new X(400,{error:"invalid_request",error_description:"An audience must be specified in the request or configured as the tenant default_audience"});const y={aud:m,scope:n.scope||"",sub:r?.user_id||n.client_id,iss:h,tenant_id:t.var.tenant_id,sid:s,act:l?{sub:l.user_id}:void 0,org_id:a?a.id:void 0,org_name:a&&i.tenant.allow_organization_name_in_authentication_api?a.name:void 0,permissions:c},w=r&&n.scope?.split(" ").includes("openid")?{aud:n.client_id,sub:r.user_id,iss:h,sid:s,nonce:n.nonce,given_name:r.given_name,family_name:r.family_name,nickname:r.nickname,picture:r.picture,locale:r.locale,name:r.name,email:r.email,email_verified:r.email_verified,act:l?{sub:l.user_id}:void 0,org_id:a?.id,org_name:a?.name}:void 0;t.env.hooks?.onExecuteCredentialsExchange&&await t.env.hooks.onExecuteCredentialsExchange({ctx:t,client:i,user:r,request:{ip:t.var.ip||"",user_agent:t.var.useragent||"",method:t.req.method,url:t.req.url},scope:n.scope||"",grant_type:""},{accessToken:{setCustomClaim:($,b)=>{if(Ch.includes($))throw new Error(`Cannot overwrite reserved claim '${$}'`);y[$]=b}},idToken:{setCustomClaim:($,b)=>{if(Ch.includes($))throw new Error(`Cannot overwrite reserved claim '${$}'`);w&&(w[$]=b)}},access:{deny:$=>{throw new X(400,{message:`Access denied: ${$}`})}},token:{createServiceToken:async $=>{const{createServiceToken:b}=await Promise.resolve().then(()=>X6);return(await b(t,t.var.tenant_id,$.scope,$.expiresInSeconds)).access_token}}});const _={expiresIn:l?new ec(1,"h"):new ec(1,"d"),headers:{kid:f.kid}},k=await Sh("RS256",p,y,_),v=w?await Sh("RS256",p,w,_):void 0;return{access_token:k,refresh_token:e.refresh_token,id_token:v,token_type:"Bearer",expires_in:l?3600:86400}}async function zb(t,e){return{code:(await t.env.data.codes.create(e.client.tenant.id,{code_id:je(),user_id:e.user.user_id,code_type:"authorization_code",login_id:e.login_id,expires_at:new Date(Date.now()+g6*1e3).toISOString(),code_challenge:e.authParams.code_challenge,code_challenge_method:e.authParams.code_challenge_method,redirect_uri:e.authParams.redirect_uri,state:e.authParams.state,nonce:e.authParams.nonce})).code_id,state:e.authParams.state}}async function Ab(t,e){const{client:n,scope:r,audience:i=n.tenant.audience,session_id:s}=e;return await t.env.data.refreshTokens.create(n.tenant.id,{id:je(),session_id:s,client_id:n.client_id,idle_expires_at:new Date(Date.now()+Zc*1e3).toISOString(),user_id:e.user.user_id,device:{last_ip:t.var.ip,initial_ip:t.var.ip,last_user_agent:t.var.useragent||"",initial_user_agent:t.var.useragent||"",initial_asn:"",last_asn:""},resource_servers:[{audience:i,scopes:r}],rotating:!1})}async function Eb(t,{user:e,client:n,loginSession:r}){const i=await t.env.data.sessions.create(n.tenant.id,{id:je(),user_id:e.user_id,login_session_id:r.id,idle_expires_at:new Date(Date.now()+Zc*1e3).toISOString(),device:{last_ip:t.var.ip||"",initial_ip:t.var.ip||"",last_user_agent:t.var.useragent||"",initial_user_agent:t.var.useragent||"",initial_asn:"",last_asn:""},clients:[n.client_id]});return await t.env.data.loginSessions.update(n.tenant.id,r.id,{session_id:i.id}),i}async function sn(t,e){const{authParams:n,client:r,ticketAuth:i}=e;let{user:s}=e;const a=n.response_type||Rt.CODE,c=n.response_mode||_n.QUERY;if(i){if(!e.loginSession)throw new X(500,{message:"Login session not found for ticket auth."});s&&!e.skipHooks&&(e.authStrategy&&s.app_metadata?.strategy!==e.authStrategy.strategy&&(s.app_metadata={...s.app_metadata,strategy:e.authStrategy.strategy},await t.env.data.users.update(r.tenant.id,s.user_id,{app_metadata:{...s.app_metadata||{},strategy:e.authStrategy.strategy}})),await Nb(t,t.env.data,r.tenant.id,s,e.loginSession,{client:r,authParams:n,authStrategy:e.authStrategy}));const h=d6(),m=je(12),y=await t.env.data.codes.create(r.tenant.id,{code_id:je(),code_type:"ticket",login_id:e.loginSession.id,expires_at:new Date(Date.now()+_6).toISOString(),code_verifier:[m,h].join("|"),redirect_uri:n.redirect_uri,state:n.state,nonce:n.nonce});return t.json({login_ticket:y.code_id,co_verifier:h,co_id:m})}let l=e.refreshToken,u=e.sessionId;if(!u&&e.loginSession?.session_id){u=e.loginSession.session_id;const h=await t.env.data.sessions.get(r.tenant.id,u);h&&!h.clients.includes(r.client_id)&&await t.env.data.sessions.update(r.tenant.id,u,{clients:[...h.clients,r.client_id]})}else if(!u){if(!e.loginSession)throw new X(500,{message:"Login session not found for creating a new session."});u=(await Eb(t,{user:s,client:r,loginSession:e.loginSession})).id}if(!l&&n.scope?.split(" ").includes("offline_access")&&![Rt.TOKEN,Rt.CODE].includes(a)&&!e.impersonatingUser&&(l=(await Ab(t,{user:s,client:r,session_id:u,scope:n.scope,audience:n.audience})).id),c===_n.SAML_POST){if(!u)throw new I(500,{message:"Session ID not available for SAML response"});return K6(t,e.client,e.authParams,s,u)}const d=await J6(t,{authParams:n,user:s,client:r,session_id:u,refresh_token:l,authStrategy:e.authStrategy,loginSession:e.loginSession,responseType:a,skipHooks:e.skipHooks,organization:e.organization,impersonatingUser:e.impersonatingUser});if(d instanceof Response)return d;if(c===_n.WEB_MESSAGE){if(!n.redirect_uri)throw new X(400,{message:"Redirect URI not allowed for WEB_MESSAGE response mode."});const h=new Headers;if(u){const w=tc(r.tenant.id,u,t.var.host||"");w&&h.set("set-cookie",w)}else console.warn("Session ID not available for WEB_MESSAGE, cookie will not be set.");const m=new URL(n.redirect_uri),y=`${m.protocol}//${m.host}`;return Td(t,y,JSON.stringify({...d,state:n.state}),h)}if(!n.redirect_uri)throw new X(400,{message:"Redirect uri not found for this response mode."});const f=new Headers;if(u){const h=tc(r.tenant.id,u,t.var.custom_domain||t.req.header("host")||"");h&&f.set("set-cookie",h)}const p=new URL(n.redirect_uri);if("code"in d)p.searchParams.set("code",d.code),d.state&&p.searchParams.set("state",d.state);else if("access_token"in d)p.hash=new URLSearchParams({access_token:d.access_token,...d.id_token&&{id_token:d.id_token},token_type:d.token_type,expires_in:d.expires_in.toString(),...n.state&&{state:n.state},...n.scope&&{scope:n.scope}}).toString();else throw new X(500,{message:"Invalid token response for implicit flow."});return f.set("location",p.toString()),new Response("Redirecting",{status:302,headers:f})}async function J6(t,e){let{user:n}=e;const r=e.responseType||Rt.TOKEN;if(n&&e.organization&&!(await t.env.data.userOrganizations.list(e.client.tenant.id,{q:`user_id:${n.user_id}`,per_page:1e3})).userOrganizations.some(u=>u.organization_id===e.organization.id))throw new X(403,{error:"access_denied",error_description:"User is not a member of the specified organization"});let i=e.authParams.scope||"",s=[];if(e.authParams.audience)try{let c;if(e.grantType===Xt.ClientCredential||!n&&!e.user)c=await nc(t,{grantType:Xt.ClientCredential,tenantId:e.client.tenant.id,clientId:e.client.client_id,audience:e.authParams.audience,requestedScopes:e.authParams.scope?.split(" ")||[],organizationId:e.organization?.id});else{const l=n?.user_id||e.user?.user_id;if(!l)throw new X(400,{error:"invalid_request",error_description:"User ID is required for user-based grants"});c=await nc(t,{grantType:e.grantType,tenantId:e.client.tenant.id,userId:l,clientId:e.client.client_id,audience:e.authParams.audience,requestedScopes:e.authParams.scope?.split(" ")||[],organizationId:e.organization?.id})}i=c.scopes.join(" "),s=c.permissions}catch(c){if(c instanceof I)throw c}const a={...e.authParams,scope:i};if(e.loginSession&&n&&!e.skipHooks){e.authStrategy&&n.app_metadata?.strategy!==e.authStrategy.strategy&&(n.app_metadata={...n.app_metadata,strategy:e.authStrategy.strategy},await t.env.data.users.update(e.client.tenant.id,n.user_id,{app_metadata:{...n.app_metadata||{},strategy:e.authStrategy.strategy}}));const c=await Nb(t,t.env.data,e.client.tenant.id,n,e.loginSession,{client:e.client,authParams:a,authStrategy:e.authStrategy});if(c instanceof Response)return c;n=c}if(r===Rt.CODE){if(!n||!e.loginSession)throw new X(500,{message:"User and loginSession is required for code flow"});return await zb(t,{user:n,client:e.client,authParams:a,login_id:e.loginSession.id})}else return Yc(t,{...e,user:n,authParams:a,permissions:s})}const Nh="auth-service";async function Qc(t,e,n,r){const i=await t.env.data.tenants.get(e);if(!i)throw new Error(`Tenant not found: ${e}`);const s={client_id:Nh,tenant:i,created_at:new Date().toISOString(),updated_at:new Date().toISOString(),name:"Auth Service",global:!1,is_first_party:!0,oidc_conformant:!1,sso:!1,sso_disabled:!1,cross_origin_authentication:!1,custom_login_page_on:!1,require_pushed_authorization_requests:!1,require_proof_of_possession:!1,client_metadata:{disable_sign_ups:"false",email_validation:"disabled"},disable_sign_ups:!1,email_validation:"disabled",connections:[]},a=await Yc(t,{client:s,authParams:{client_id:Nh,response_type:Rt.TOKEN,scope:n}});return{access_token:a.access_token,token_type:a.token_type,expires_in:r||3600}}const X6=Object.freeze(Object.defineProperty({__proto__:null,createServiceToken:Qc},Symbol.toStringTag,{value:"Module"}));async function el(t,e,n){const r=await Qc(t,n.tenant_id,"webhook");for await(const i of e.filter(s=>"url"in s))(await fetch(i.url,{method:"POST",headers:{Authorization:`Bearer ${r.access_token}`,"Content-Type":"application/json"},body:JSON.stringify(n)})).ok||ye(t,n.tenant_id,{type:ge.FAILED_HOOK,description:`Failed to invoke hook ${i.hook_id}`})}function Z6(t){return async(e,n)=>{const{hooks:r}=await t.env.data.hooks.list(e);return await el(t,r,{tenant_id:e,user:n,trigger_id:"post-user-registration"}),n}}function Y6(t){return async(e,n)=>{const{hooks:r}=await t.env.data.hooks.list(e,{q:"trigger_id:pre-user-registration",page:0,per_page:100,include_totals:!1});await el(t,r,{tenant_id:e,email:n,trigger_id:"pre-user-registration"})}}async function Q6(t,e){const{hooks:n}=await t.env.data.hooks.list(e,{q:"trigger_id:validate-registration-username",page:0,per_page:1,include_totals:!1});return n.find(r=>"url"in r&&r.enabled)||null}function e5(t){return async(e,n)=>{const{hooks:r}=await t.env.data.hooks.list(e,{q:"trigger_id:pre-user-deletion",page:0,per_page:100,include_totals:!1});return await el(t,r,{tenant_id:e,user:n,trigger_id:"pre-user-deletion"}),n}}function t5(t){return async(e,n)=>{const{hooks:r}=await t.env.data.hooks.list(e,{q:"trigger_id:post-user-deletion",page:0,per_page:100,include_totals:!1});return await el(t,r,{tenant_id:e,user:n,trigger_id:"post-user-deletion"}),n}}function Ih(t){return typeof t.form_id=="string"}function jh(t,e){const n=t.match(/^\{\{context\.user\.(\w+)\}\}$/);if(n){const r=n[1],i=e.user[r];return typeof i=="string"?i:""}return t}function n5(t,e){const n=t.operator?.toLowerCase(),r=t.field?jh(t.field,e):"",i=t.value||"";switch(n){case"ends_with":return r.endsWith(i);case"starts_with":return r.startsWith(i);case"contains":return r.includes(i);case"equals":case"eq":return r===i;case"not_equals":case"neq":return r!==i;default:if(t.operands&&Array.isArray(t.operands)){for(const s of t.operands)if(s.operator==="ENDS_WITH"&&Array.isArray(s.operands)&&s.operands.length>=2){const a=s.operands[0],c=s.operands[1];if(a&&c&&jh(`{{context.user.${a}}}`,e).endsWith(c))return!0}}return!1}}function I0(t,e,n){switch(t){case"change-email":return`/u/account/change-email?state=${encodeURIComponent(n)}`;case"account":return`/u/account?state=${encodeURIComponent(n)}`;case"custom":if(!e)throw new I(400,{message:"Custom URL is required for custom redirect target"});const r=new URL(e,"http://placeholder");return r.searchParams.set("state",n),r.pathname+r.search;default:throw new I(400,{message:`Unknown redirect target: ${t}`})}}async function j0(t,e,n,r,i=10){let s=e,a=0;for(;a<i;){if(s==="$ending")return{type:"end"};const c=t.find(l=>l.id===s);if(!c)return null;if(c.type==="STEP")return{type:"step",nodeId:c.id};if(c.type==="ACTION"){const l=c;if(l.config.action_type==="REDIRECT")return{type:"redirect",target:l.config.target,customUrl:l.config.custom_url};s=l.config.next_node,a++;continue}if(c.type==="ROUTER"){const l=c;let u=null;for(const d of l.config.rules)if(n5(d.condition,n)){u=d.next_node;break}if(u||(u=l.config.fallback),!u)return null;s=u,a++;continue}if(c.type==="FLOW"){const l=c;if(r&&l.config.flow_id){const u=await r(l.config.flow_id);if(u&&u.actions&&u.actions.length>0){for(const d of u.actions)if(d.type==="REDIRECT"&&d.action==="REDIRECT_USER"){const f=d.params?.target;if(f)return{type:"redirect",target:f,customUrl:d.params?.custom_url}}}}if(l.config.next_node){s=l.config.next_node,a++;continue}return{type:"end"}}return null}return null}async function r5(t,e,n,r){const i=t.env.data,s=t.var.tenant_id||t.req.header("tenant-id");if(!s)throw new I(400,{message:"Missing tenant_id in context"});const a=await i.forms.get(s,e);if(!a)throw new I(404,{message:"Form not found for post-user-login hook"});let c=a.start?.next_node;if(!c&&a.nodes&&a.nodes.length>0&&(c=a.nodes.find(d=>d.type==="STEP")?.id),!c)throw new I(400,{message:"No start node found in form"});if(r&&a.nodes){const u=async f=>{const p=await i.flows.get(s,f);return p?{actions:p.actions?.map(h=>({type:h.type,action:h.action,params:"params"in h&&h.params&&typeof h.params=="object"&&"target"in h.params?{target:h.params.target,custom_url:"custom_url"in h.params?h.params.custom_url:void 0}:void 0}))}:null},d=await j0(a.nodes,c,{user:r},u);if(!d||d.type==="end")return new Response(null,{status:302,headers:{location:`/u/login/identifier?state=${encodeURIComponent(n.id)}`}});if(d.type==="redirect"){const f=I0(d.target,d.customUrl,n.id);return new Response(null,{status:302,headers:{location:f}})}c=d.nodeId}let l=`/u/forms/${a.id}/nodes/${c}?state=${encodeURIComponent(n.id)}`;return new Response(null,{status:302,headers:{location:l}})}function Th(t){return typeof t.page_id=="string"&&typeof t.enabled=="boolean"}async function i5(t,e,n,r,i){const s=t.env.data,a=t.var.tenant_id||t.req.header("tenant-id");if(!a)throw new I(400,{message:"Missing tenant_id in context"});if(i&&!(await s.userPermissions.list(a,r.user_id)).some(d=>d.permission_name===i))return r;let c=`/u/${e}?state=${encodeURIComponent(n.id)}`;return new Response(null,{status:302,headers:{location:c}})}function Br(t,e){return{createServiceToken:async n=>(await Qc(t,e,n.scope,n.expiresInSeconds)).access_token}}function Oh(t){return typeof t.url=="string"}function o5(t,e){return async(n,r)=>{if(t.var.client_id){const a=await e.legacyClients.get(t.var.client_id);if(!a)throw new X(400,{message:"Client not found"});r.email&&await a5(t,a,e,r.email)}const i={method:t.req.method,ip:t.req.query("x-real-ip")||"",user_agent:t.req.query("user-agent"),url:t.var.loginSession?.authorization_url||t.req.url};if(t.env.hooks?.onExecutePreUserRegistration)try{await t.env.hooks.onExecutePreUserRegistration({ctx:t,user:r,request:i},{user:{setUserMetadata:async(a,c)=>{r[a]=c}},token:Br(t,n)})}catch{ye(t,n,{type:ge.FAILED_SIGNUP,description:"Pre user registration hook failed"})}let s=await t6(e)(n,r);if(t.env.hooks?.onExecutePostUserRegistration)try{await t.env.hooks.onExecutePostUserRegistration({ctx:t,user:r,request:i},{user:{},token:Br(t,n)})}catch{ye(t,n,{type:ge.FAILED_SIGNUP,description:"Post user registration hook failed"})}return await Z6(t)(n,s),s}}function s5(t,e){return async(n,r,i)=>{if(Object.keys(i).length===1&&"linked_to"in i)return e.users.update(n,r,i);const s=await e.users.get(n,r);if(!s)throw new X(404,{message:"User not found"});const a={method:t.req.method,ip:t.var.ip||t.get("ip")||"",user_agent:t.var.useragent||t.get("useragent")||"",url:t.req.url};if(t.env.hooks?.onExecutePreUserUpdate)try{await t.env.hooks.onExecutePreUserUpdate({ctx:t,tenant:{id:n},user_id:r,user:s,updates:i,request:a},{user:{setUserMetadata:async(c,l)=>{i[c]=l}},cancel:()=>{throw new X(400,{message:"User update cancelled by pre-update hook"})},token:Br(t,n)})}catch{throw new X(400,{message:"Pre user update hook failed"})}if(await e.users.update(n,r,i),i.email||i.email_verified){const c=await e.users.get(n,r);if(c&&c.email&&c.email_verified){const{users:l}=await e.users.list(n,{page:0,per_page:10,include_totals:!1,q:`email:${c.email}`}),u=l.filter(d=>d.email_verified&&d.user_id!==r&&!d.linked_to);u.length>0&&await e.users.update(n,r,{linked_to:u[0].user_id})}}return i.email&&ye(t,n,{type:ge.SUCCESS_CHANGE_EMAIL,description:`Email updated to ${i.email}`,userId:r}),!0}}async function Cb(t,e,n,r,i="email"){if(e.client_metadata?.disable_sign_ups==="true"){const a=t.var.loginSession?.authorization_url;if(a&&new URL(a).searchParams.get("screen_hint")==="signup")return{allowed:!0};if(!await tl({userAdapter:n.users,tenant_id:e.tenant.id,email:r}))return{allowed:!1,reason:"Public signup is disabled for this client"}}if(t.env.hooks?.onExecuteValidateSignupEmail){const a={method:t.req.method,ip:t.var.ip||t.get("ip")||"",user_agent:t.var.useragent||t.get("useragent")||"",url:t.req.url};let c=!1,l;try{if(await t.env.hooks.onExecuteValidateSignupEmail({ctx:t,client:e,request:a,tenant:{id:e.tenant.id},user:{email:r,connection:i}},{deny:u=>{c=!0,l=u},token:Br(t,e.tenant.id)}),c)return{allowed:!1,reason:l}}catch{return{allowed:!1,reason:"Signup validation hook failed"}}}const s=await Q6(t,e.tenant.id);if(s&&"url"in s)try{const a=await Qc(t,e.tenant.id,"webhook"),c=await fetch(s.url,{method:"POST",headers:{Authorization:`Bearer ${a.access_token}`,"Content-Type":"application/json"},body:JSON.stringify({tenant_id:e.tenant.id,email:r,connection:i,client_id:e.client_id,trigger_id:"validate-registration-username"})});if(!c.ok)return{allowed:!1,reason:await c.text()||"Signup not allowed by webhook"};const l=await c.json();if(l.allowed===!1)return{allowed:!1,reason:l.reason||"Signup not allowed by webhook"}}catch{ye(t,e.tenant.id,{type:ge.FAILED_HOOK,description:"Validate signup email webhook failed"})}return{allowed:!0}}async function a5(t,e,n,r){const i=await Cb(t,e,n,r);if(!i.allowed)throw ye(t,e.tenant.id,{type:ge.FAILED_SIGNUP,description:i.reason||"Signup not allowed"}),new X(400,{message:i.reason||"Signups are disabled for this client"});await Y6(t)(e.tenant.id,r)}function c5(t,e){return async(n,r)=>{const i=await e.users.get(n,r);if(!i)return!1;const s={method:t.req.method,ip:t.var.ip||t.get("ip")||"",user_agent:t.var.useragent||t.get("useragent")||"",url:t.req.url};if(t.env.hooks?.onExecutePreUserDeletion)try{await t.env.hooks.onExecutePreUserDeletion({ctx:t,user:i,user_id:r,request:s,tenant:{id:n}},{cancel:()=>{throw new X(400,{message:"User deletion cancelled by pre-deletion hook"})},token:Br(t,n)})}catch(c){throw c instanceof I?c:(ye(t,n,{type:ge.FAILED_HOOK,description:`Pre user deletion hook failed: ${c instanceof Error?c.message:String(c)}`}),new X(400,{message:"Pre user deletion hook failed"}))}try{await e5(t)(n,i)}catch(c){throw ye(t,n,{type:ge.FAILED_HOOK,description:`Pre user deletion webhook failed: ${c instanceof Error?c.message:String(c)}`}),new X(400,{message:"Pre user deletion webhook failed"})}const a=await e.users.remove(n,r);if(a){ye(t,n,{type:ge.SUCCESS_USER_DELETION,description:`user_id: ${r}`,strategy:i.provider||"auth0",strategy_type:i.is_social?"social":"database",connection:i.connection||"",body:{tenant:n,connection:i.connection||""}});try{await t5(t)(n,i)}catch(c){ye(t,n,{type:ge.FAILED_HOOK,description:`Post user deletion webhook failed: ${c instanceof Error?c.message:String(c)}`})}}if(a&&t.env.hooks?.onExecutePostUserDeletion)try{await t.env.hooks.onExecutePostUserDeletion({ctx:t,user:i,user_id:r,request:s,tenant:{id:n}},{token:Br(t,n)})}catch(c){ye(t,n,{type:ge.FAILED_HOOK,description:`Post user deletion hook failed: ${c instanceof Error?c.message:String(c)}`})}return a}}function zs(t,e){const n=e;return{...e,users:{...e.users,create:o5(t,n),update:s5(t,n),remove:c5(t,n)}}}async function l5(t,e,n,r,i,s){let a=[];try{a=(await e.userRoles.list(n,r.user_id,void 0,"")).map(p=>p.name||p.id)}catch(d){console.error("Error fetching user roles:",d)}let c={};if(r.connection)try{const f=(await e.connections.list(n,{page:0,per_page:100,include_totals:!1})).connections.find(p=>p.name===r.connection);f&&(c={id:f.id,name:f.name,strategy:f.strategy||r.provider,metadata:f.options||{}})}catch(d){console.error("Error fetching connection info:",d)}let l;try{if(i.authParams?.organization){const d=await e.organizations.get(n,i.authParams.organization);d&&(l={id:d.id,name:d.name,display_name:d.display_name||d.name,metadata:d.metadata||{}})}}catch(d){console.error("Error fetching organization info:",d)}const u=t.get("countryCode");return{ctx:t,client:s.client,user:r,request:{asn:void 0,ip:t.get("ip")||"",user_agent:t.get("useragent"),method:t.req.method,url:t.req.url,geoip:{cityName:void 0,continentCode:void 0,countryCode:u||void 0,countryName:void 0,latitude:void 0,longitude:void 0,timeZone:void 0}},transaction:{id:i.id,locale:i.authParams?.ui_locales||"en",login_hint:void 0,prompt:i.authParams?.prompt,redirect_uri:i.authParams?.redirect_uri,requested_scopes:i.authParams?.scope?.split(" ")||[],response_mode:i.authParams?.response_mode,response_type:i.authParams?.response_type,state:i.authParams?.state,ui_locales:i.authParams?.ui_locales},scope:s.authParams?.scope||"",grant_type:s.authParams?.grant_type||"",audience:s.authParams?.audience,authentication:{methods:[{name:r.is_social?"federated":"pwd",timestamp:new Date().toISOString()}]},authorization:{roles:a},connection:Object.keys(c).length>0?c:{id:r.connection||"Username-Password-Authentication",name:r.connection||"Username-Password-Authentication",strategy:r.provider||"auth0"},organization:l,resource_server:s.authParams?.audience?{identifier:s.authParams.audience}:void 0,stats:{logins_count:r.login_count||0},tenant:{id:n},session:{id:i.id,created_at:i.created_at,authenticated_at:new Date().toISOString(),clients:[{client_id:s.client.client_id}],device:{initial_ip:t.get("ip"),initial_user_agent:t.get("useragent"),last_ip:r.last_ip||t.get("ip"),last_user_agent:t.get("useragent")}}}}async function Nb(t,e,n,r,i,s){const a=s?.authStrategy?.strategy_type?s.authStrategy.strategy_type:r.is_social?"social":"database",c=s?.authStrategy?.strategy||r.connection||"";if(ye(t,n,{type:ge.SUCCESS_LOGIN,description:`Successful login for ${r.user_id}`,userId:r.user_id,strategy_type:a,strategy:c,connection:c,audience:s?.authParams?.audience,scope:s?.authParams?.scope}),await e.users.update(n,r.user_id,{last_login:new Date().toISOString(),last_ip:t.var.ip||"",login_count:r.login_count+1}),t.env.hooks?.onExecutePostLogin&&s?.client&&s?.authParams&&i){let d=null;const f=await l5(t,e,n,r,i,{client:s.client,authParams:s.authParams});if(await t.env.hooks.onExecutePostLogin(f,{prompt:{render:p=>{}},redirect:{sendUserTo:(p,h)=>{const m=new URL(p,t.req.url);m.searchParams.set("state",i.id),h?.query&&Object.entries(h.query).forEach(([y,w])=>{m.searchParams.set(y,w)}),d=m.toString()},encodeToken:p=>JSON.stringify({payload:p.payload,exp:Date.now()+(p.expiresInSeconds||900)*1e3}),validateToken:p=>null},token:Br(t,n)}),d)return new Response(null,{status:302,headers:{location:d}})}const{hooks:l}=await e.hooks.list(n,{q:"trigger_id:post-user-login",page:0,per_page:100,include_totals:!1});if(i){const d=l.find(p=>p.enabled&&Ih(p));if(d&&Ih(d))return r5(t,d.form_id,i,r);const f=l.find(p=>p.enabled&&Th(p));if(f&&Th(f))return i5(t,f.page_id,i,r,f.permission_required)}const u=l.filter(d=>d.enabled&&Oh(d));for(const d of u)if(Oh(d))try{await fetch(d.url,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tenant_id:n,user:r,trigger_id:"post-user-login"})})}catch{ye(t,n,{type:ge.FAILED_HOOK,description:`Failed to invoke post-user-login webhook: ${d.url}`})}return r}function u5(t){return zs(t,t.env.data)}async function T0(t,e,n){return(await t.list(e,{page:0,per_page:10,include_totals:!1,q:`email:${n}`})).users}async function Xi({userAdapter:t,tenant_id:e,username:n,provider:r}){const i=r==="sms"?`phone_number:${n}`:`email:${n}`,{users:s}=await t.list(e,{page:0,per_page:10,include_totals:!1,q:`${i} provider:${r}`});return s.length>1&&console.error("More than one user found for same email and provider"),s[0]||null}async function tl({userAdapter:t,tenant_id:e,email:n}){const{users:r}=await t.list(e,{page:0,per_page:10,include_totals:!1,q:`email:${n}`});if(r.length===0)return;const i=r.filter(a=>!a.linked_to);if(i.length>0)return i.length>1&&console.error("More than one primary user found for same email"),i[0];const s=await t.get(e,r[0]?.linked_to);if(!s)throw new Error("Primary account not found");return s}async function Oi({userAdapter:t,tenant_id:e,username:n,provider:r}){const i=await Xi({userAdapter:t,tenant_id:e,username:n,provider:r});return i?i.linked_to?t.get(e,i.linked_to):i:null}async function nl(t,e){const{username:n,provider:r,connection:i,client:s,userId:a,isSocial:c,profileData:l={},ip:u=""}=e;let d=await Oi({userAdapter:t.env.data.users,tenant_id:e.client.tenant.id,username:n,provider:r});if(!d){const f={user_id:`${r}|${a||$s()}`,email:i!=="sms"?n:void 0,phone_number:i==="sms"?n:void 0,name:n,provider:r,connection:i,email_verified:!0,last_ip:u,is_social:c,last_login:new Date().toISOString(),profileData:JSON.stringify(l)};d=await u5(t).users.create(s.tenant.id,f),t.set("user_id",d.user_id)}return d}const et=o.z.object({page:o.z.string().min(0).optional().default("0").transform(t=>parseInt(t,10)).openapi({description:"The page number where 0 is the first page"}),per_page:o.z.string().min(1).optional().default("10").transform(t=>parseInt(t,10)).openapi({description:"The number of items per page"}),include_totals:o.z.string().optional().default("false").transform(t=>t==="true").openapi({description:"If the total number of items should be included in the response"}),sort:o.z.string().regex(/^.+:(-1|1)$/).optional().openapi({description:"A property that should have the format 'string:-1' or 'string:1'"}),q:o.z.string().optional().openapi({description:"A lucene query string used to filter the results"})});function ut(t){if(!t)return;const[e,n]=t.split(":"),r=n==="1"?"asc":"desc";if(!(!e||!r))return{sort_by:e,sort_order:r}}var d5={Stringify:1},cr=(t,e)=>{const n=new String(t);return n.isEscaped=!0,n.callbacks=e,n},p5=/[&<>'"]/,f5=async(t,e)=>{let n="";e||=[];const r=await Promise.all(t);for(let i=r.length-1;n+=r[i],i--,!(i<0);i--){let s=r[i];typeof s=="object"&&e.push(...s.callbacks||[]);const a=s.isEscaped;if(s=await(typeof s=="object"?s.toString():s),typeof s=="object"&&e.push(...s.callbacks||[]),s.isEscaped??a)n+=s;else{const c=[n];Ai(s,c),n=c[0]}}return cr(n,e)},Ai=(t,e)=>{const n=t.search(p5);if(n===-1){e[0]+=t;return}let r,i,s=0;for(i=n;i<t.length;i++){switch(t.charCodeAt(i)){case 34:r=""";break;case 39:r="'";break;case 38:r="&";break;case 60:r="<";break;case 62:r=">";break;default:continue}e[0]+=t.substring(s,i)+r,s=i+1}e[0]+=t.substring(s,i)},h5=t=>{const e=t.callbacks;if(!e?.length)return t;const n=[t],r={};return e.forEach(i=>i({phase:d5.Stringify,buffer:n,context:r})),n[0]},O0=Symbol("RENDERER"),Pd=Symbol("ERROR_HANDLER"),Ue=Symbol("STASH"),Ib=Symbol("INTERNAL"),g5=Symbol("MEMO"),rc=Symbol("PERMALINK"),Ph=t=>(t[Ib]=!0,t),jb=t=>({value:e,children:n})=>{if(!n)return;const r={children:[{tag:Ph(()=>{t.push(e)}),props:{}}]};Array.isArray(n)?r.children.push(...n.flat()):r.children.push(n),r.children.push({tag:Ph(()=>{t.pop()}),props:{}});const i={tag:"",props:r,type:""};return i[Pd]=s=>{throw t.pop(),s},i},Tb=t=>{const e=[t],n=jb(e);return n.values=e,n.Provider=n,Pi.push(n),n},Pi=[],Ob=t=>{const e=[t],n=(r=>{e.push(r.value);let i;try{i=r.children?(Array.isArray(r.children)?new Bb("",{},r.children):r.children).toString():""}finally{e.pop()}return i instanceof Promise?i.then(s=>cr(s,s.callbacks)):cr(i)});return n.values=e,n.Provider=n,n[O0]=jb(e),Pi.push(n),n},Zi=t=>t.values.at(-1),$a={title:[],script:["src"],style:["data-href"],link:["href"],meta:["name","httpEquiv","charset","itemProp"]},Rd={},Sa="data-precedence",As=t=>Array.isArray(t)?t:[t],Rh=new WeakMap,Lh=(t,e,n,r)=>({buffer:i,context:s})=>{if(!i)return;const a=Rh.get(s)||{};Rh.set(s,a);const c=a[t]||=[];let l=!1;const u=$a[t];if(u.length>0){e:for(const[,d]of c)for(const f of u)if((d?.[f]??null)===n?.[f]){l=!0;break e}}if(l?i[0]=i[0].replaceAll(e,""):u.length>0?c.push([e,n,r]):c.unshift([e,n,r]),i[0].indexOf("</head>")!==-1){let d;if(r===void 0)d=c.map(([f])=>f);else{const f=[];d=c.map(([p,,h])=>{let m=f.indexOf(h);return m===-1&&(f.push(h),m=f.length-1),[p,m]}).sort((p,h)=>p[1]-h[1]).map(([p])=>p)}d.forEach(f=>{i[0]=i[0].replaceAll(f,"")}),i[0]=i[0].replace(/(?=<\/head>)/,d.join(""))}},Es=(t,e,n)=>cr(new tn(t,n,As(e??[])).toString()),Cs=(t,e,n,r)=>{if("itemProp"in n)return Es(t,e,n);let{precedence:i,blocking:s,...a}=n;i=r?i??"":void 0,r&&(a[Sa]=i);const c=new tn(t,a,As(e||[])).toString();return c instanceof Promise?c.then(l=>cr(c,[...l.callbacks||[],Lh(t,l,a,i)])):cr(c,[Lh(t,c,a,i)])},m5=({children:t,...e})=>{const n=P0();if(n){const r=Zi(n);if(r==="svg"||r==="head")return new tn("title",e,As(t??[]))}return Cs("title",t,e,!1)},_5=({children:t,...e})=>{const n=P0();return["src","async"].some(r=>!e[r])||n&&Zi(n)==="head"?Es("script",t,e):Cs("script",t,e,!1)},y5=({children:t,...e})=>["href","precedence"].every(n=>n in e)?(e["data-href"]=e.href,delete e.href,Cs("style",t,e,!0)):Es("style",t,e),b5=({children:t,...e})=>["onLoad","onError"].some(n=>n in e)||e.rel==="stylesheet"&&(!("precedence"in e)||"disabled"in e)?Es("link",t,e):Cs("link",t,e,"precedence"in e),w5=({children:t,...e})=>{const n=P0();return n&&Zi(n)==="head"?Es("meta",t,e):Cs("meta",t,e,!1)},Pb=(t,{children:e,...n})=>new tn(t,n,As(e??[])),v5=t=>(typeof t.action=="function"&&(t.action=rc in t.action?t.action[rc]:void 0),Pb("form",t)),Rb=(t,e)=>(typeof e.formAction=="function"&&(e.formAction=rc in e.formAction?e.formAction[rc]:void 0),Pb(t,e)),x5=t=>Rb("input",t),k5=t=>Rb("button",t);const hu=Object.freeze(Object.defineProperty({__proto__:null,button:k5,form:v5,input:x5,link:b5,meta:w5,script:_5,style:y5,title:m5},Symbol.toStringTag,{value:"Module"}));var $5=new Map([["className","class"],["htmlFor","for"],["crossOrigin","crossorigin"],["httpEquiv","http-equiv"],["itemProp","itemprop"],["fetchPriority","fetchpriority"],["noModule","nomodule"],["formAction","formaction"]]),ic=t=>$5.get(t)||t,Lb=(t,e)=>{for(const[n,r]of Object.entries(t)){const i=n[0]==="-"||!/[A-Z]/.test(n)?n:n.replace(/[A-Z]/g,s=>`-${s.toLowerCase()}`);e(i,r==null?null:typeof r=="number"?i.match(/^(?:a|border-im|column(?:-c|s)|flex(?:$|-[^b])|grid-(?:ar|[^a])|font-w|li|or|sca|st|ta|wido|z)|ty$/)?`${r}`:`${r}px`:r)}},ns=void 0,P0=()=>ns,S5=t=>/[A-Z]/.test(t)&&t.match(/^(?:al|basel|clip(?:Path|Rule)$|co|do|fill|fl|fo|gl|let|lig|i|marker[EMS]|o|pai|pointe|sh|st[or]|text[^L]|tr|u|ve|w)/)?t.replace(/([A-Z])/g,"-$1").toLowerCase():t,z5=["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],A5=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","defer","disabled","download","formnovalidate","hidden","inert","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"],R0=(t,e)=>{for(let n=0,r=t.length;n<r;n++){const i=t[n];if(typeof i=="string")Ai(i,e);else{if(typeof i=="boolean"||i===null||i===void 0)continue;i instanceof tn?i.toStringToBuffer(e):typeof i=="number"||i.isEscaped?e[0]+=i:i instanceof Promise?e.unshift("",i):R0(i,e)}}},tn=class{tag;props;key;children;isEscaped=!0;localContexts;constructor(t,e,n){this.tag=t,this.props=e,this.children=n}get type(){return this.tag}get ref(){return this.props.ref||null}toString(){const t=[""];this.localContexts?.forEach(([e,n])=>{e.values.push(n)});try{this.toStringToBuffer(t)}finally{this.localContexts?.forEach(([e])=>{e.values.pop()})}return t.length===1?"callbacks"in t?h5(cr(t[0],t.callbacks)).toString():t[0]:f5(t,t.callbacks)}toStringToBuffer(t){const e=this.tag,n=this.props;let{children:r}=this;t[0]+=`<${e}`;const i=ns&&Zi(ns)==="svg"?s=>S5(ic(s)):s=>ic(s);for(let[s,a]of Object.entries(n))if(s=i(s),s!=="children"){if(s==="style"&&typeof a=="object"){let c="";Lb(a,(l,u)=>{u!=null&&(c+=`${c?";":""}${l}:${u}`)}),t[0]+=' style="',Ai(c,t),t[0]+='"'}else if(typeof a=="string")t[0]+=` ${s}="`,Ai(a,t),t[0]+='"';else if(a!=null)if(typeof a=="number"||a.isEscaped)t[0]+=` ${s}="${a}"`;else if(typeof a=="boolean"&&A5.includes(s))a&&(t[0]+=` ${s}=""`);else if(s==="dangerouslySetInnerHTML"){if(r.length>0)throw new Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");r=[cr(a.__html)]}else if(a instanceof Promise)t[0]+=` ${s}="`,t.unshift('"',a);else if(typeof a=="function"){if(!s.startsWith("on")&&s!=="ref")throw new Error(`Invalid prop '${s}' of type 'function' supplied to '${e}'.`)}else t[0]+=` ${s}="`,Ai(a.toString(),t),t[0]+='"'}if(z5.includes(e)&&r.length===0){t[0]+="/>";return}t[0]+=">",R0(r,t),t[0]+=`</${e}>`}},gu=class extends tn{toStringToBuffer(t){const{children:e}=this,n={...this.props};e.length&&(n.children=e.length===1?e[0]:e);const r=this.tag.call(null,n);if(!(typeof r=="boolean"||r==null))if(r instanceof Promise)if(Pi.length===0)t.unshift("",r);else{const i=Pi.map(s=>[s,s.values.at(-1)]);t.unshift("",r.then(s=>(s instanceof tn&&(s.localContexts=i),s)))}else r instanceof tn?r.toStringToBuffer(t):typeof r=="number"||r.isEscaped?(t[0]+=r,r.callbacks&&(t.callbacks||=[],t.callbacks.push(...r.callbacks))):Ai(r,t)}},Bb=class extends tn{toStringToBuffer(t){R0(this.children,t)}},E5=(t,e,...n)=>{e??={},n.length&&(e.children=n.length===1?n[0]:n);const r=e.key;delete e.key;const i=za(t,e,n);return i.key=r,i},Bh=!1,za=(t,e,n)=>{if(!Bh){for(const r in Rd)hu[r][O0]=Rd[r];Bh=!0}return typeof t=="function"?new gu(t,e,n):hu[t]?new gu(hu[t],e,n):t==="svg"||t==="head"?(ns||=Ob(""),new tn(t,e,[new gu(ns,{value:t},n)])):new tn(t,e,n)},rs=({children:t})=>new Bb("",{children:t},Array.isArray(t)?t:t?[t]:[]),C5=(t,e,...n)=>{let r;if(n.length>0)r=n;else{const i=t.props.children;r=Array.isArray(i)?i:[i]}return E5(t.tag,{...t.props,...e},...r)};function g(t,e,n){let r;if(!e||!("children"in e))r=za(t,e,[]);else{const i=e.children;r=Array.isArray(i)?za(t,e,i):za(t,e,[i])}return r.key=n,r}var Dh;(function(t){t[t.Include=0]="Include",t[t.None=1]="None"})(Dh||(Dh={}));var Uh;(function(t){t[t.Required=0]="Required",t[t.Ignore=1]="Ignore"})(Uh||(Uh={}));function N5(t){return Db(t,I5,is.Include)}function L0(t){return Db(t,j5,is.None)}function Db(t,e,n){let r="";for(let i=0;i<t.byteLength;i+=3){let s=0,a=0;for(let c=0;c<3&&i+c<t.byteLength;c++)s=s<<8|t[i+c],a+=8;for(let c=0;c<4;c++)a>=6?(r+=e[s>>a-6&63],a-=6):a>0?(r+=e[s<<6-a&63],a=0):n===is.Include&&(r+="=")}return r}const I5="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",j5="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";var is;(function(t){t[t.Include=0]="Include",t[t.None=1]="None"})(is||(is={}));var Mh;(function(t){t[t.Required=0]="Required",t[t.Ignore=1]="Ignore"})(Mh||(Mh={}));class T5{uint8(e,n){if(e.byteLength<n+1)throw new TypeError("Insufficient bytes");return e[n]}uint16(e,n){if(e.byteLength<n+2)throw new TypeError("Insufficient bytes");return e[n]<<8|e[n+1]}uint32(e,n){if(e.byteLength<n+4)throw new TypeError("Insufficient bytes");let r=0;for(let i=0;i<4;i++)r|=e[n+i]<<24-i*8;return r}uint64(e,n){if(e.byteLength<n+8)throw new TypeError("Insufficient bytes");let r=0n;for(let i=0;i<8;i++)r|=BigInt(e[n+i])<<BigInt(56-i*8);return r}putUint8(e,n,r){if(e.length<r+1)throw new TypeError("Not enough space");if(n<0||n>255)throw new TypeError("Invalid uint8 value");e[r]=n}putUint16(e,n,r){if(e.length<r+2)throw new TypeError("Not enough space");if(n<0||n>65535)throw new TypeError("Invalid uint16 value");e[r]=n>>8,e[r+1]=n&255}putUint32(e,n,r){if(e.length<r+4)throw new TypeError("Not enough space");if(n<0||n>4294967295)throw new TypeError("Invalid uint32 value");for(let i=0;i<4;i++)e[r+i]=n>>(3-i)*8&255}putUint64(e,n,r){if(e.length<r+8)throw new TypeError("Not enough space");if(n<0||n>18446744073709551615n)throw new TypeError("Invalid uint64 value");for(let i=0;i<8;i++)e[r+i]=Number(n>>BigInt((7-i)*8)&0xffn)}}const qh=new T5;function dn(t,e){return(t<<32-e|t>>>e)>>>0}function O5(t){const e=new P5;return e.update(t),e.digest()}class P5{blockSize=64;size=32;blocks=new Uint8Array(64);currentBlockSize=0;H=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);l=0n;w=new Uint32Array(64);update(e){if(this.l+=BigInt(e.byteLength)*8n,this.currentBlockSize+e.byteLength<64){this.blocks.set(e,this.currentBlockSize),this.currentBlockSize+=e.byteLength;return}let n=0;if(this.currentBlockSize>0){const r=e.slice(0,64-this.currentBlockSize);this.blocks.set(r,this.currentBlockSize),this.process(),n+=r.byteLength,this.currentBlockSize=0}for(;n+64<=e.byteLength;){const r=e.slice(n,n+64);this.blocks.set(r),this.process(),n+=64}if(e.byteLength-n>0){const r=e.slice(n);this.blocks.set(r),this.currentBlockSize=r.byteLength}}digest(){this.blocks[this.currentBlockSize]=128,this.currentBlockSize+=1,64-this.currentBlockSize<8&&(this.blocks.fill(0,this.currentBlockSize),this.process(),this.currentBlockSize=0),this.blocks.fill(0,this.currentBlockSize),qh.putUint64(this.blocks,this.l,this.blockSize-8),this.process();const e=new Uint8Array(32);for(let n=0;n<8;n++)qh.putUint32(e,this.H[n],n*4);return e}process(){for(let u=0;u<16;u++)this.w[u]=(this.blocks[u*4]<<24|this.blocks[u*4+1]<<16|this.blocks[u*4+2]<<8|this.blocks[u*4+3])>>>0;for(let u=16;u<64;u++){const d=(dn(this.w[u-2],17)^dn(this.w[u-2],19)^this.w[u-2]>>>10)>>>0,f=(dn(this.w[u-15],7)^dn(this.w[u-15],18)^this.w[u-15]>>>3)>>>0;this.w[u]=d+this.w[u-7]+f+this.w[u-16]|0}let e=this.H[0],n=this.H[1],r=this.H[2],i=this.H[3],s=this.H[4],a=this.H[5],c=this.H[6],l=this.H[7];for(let u=0;u<64;u++){const d=(dn(s,6)^dn(s,11)^dn(s,25))>>>0,f=(s&a^~s&c)>>>0,p=l+d+f+R5[u]+this.w[u]|0,h=(dn(e,2)^dn(e,13)^dn(e,22))>>>0,m=(e&n^e&r^n&r)>>>0,y=h+m|0;l=c,c=a,a=s,s=i+p|0,i=r,r=n,n=e,e=p+y|0}this.H[0]=e+this.H[0]|0,this.H[1]=n+this.H[1]|0,this.H[2]=r+this.H[2]|0,this.H[3]=i+this.H[3]|0,this.H[4]=s+this.H[4]|0,this.H[5]=a+this.H[5]|0,this.H[6]=c+this.H[6]|0,this.H[7]=l+this.H[7]|0}}const R5=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);new BigUint64Array([0x428a2f98d728ae22n,0x7137449123ef65cdn,0xb5c0fbcfec4d3b2fn,0xe9b5dba58189dbbcn,0x3956c25bf348b538n,0x59f111f1b605d019n,0x923f82a4af194f9bn,0xab1c5ed5da6d8118n,0xd807aa98a3030242n,0x12835b0145706fben,0x243185be4ee4b28cn,0x550c7dc3d5ffb4e2n,0x72be5d74f27b896fn,0x80deb1fe3b1696b1n,0x9bdc06a725c71235n,0xc19bf174cf692694n,0xe49b69c19ef14ad2n,0xefbe4786384f25e3n,0x0fc19dc68b8cd5b5n,0x240ca1cc77ac9c65n,0x2de92c6f592b0275n,0x4a7484aa6ea6e483n,0x5cb0a9dcbd41fbd4n,0x76f988da831153b5n,0x983e5152ee66dfabn,0xa831c66d2db43210n,0xb00327c898fb213fn,0xbf597fc7beef0ee4n,0xc6e00bf33da88fc2n,0xd5a79147930aa725n,0x06ca6351e003826fn,0x142929670a0e6e70n,0x27b70a8546d22ffcn,0x2e1b21385c26c926n,0x4d2c6dfc5ac42aedn,0x53380d139d95b3dfn,0x650a73548baf63den,0x766a0abb3c77b2a8n,0x81c2c92e47edaee6n,0x92722c851482353bn,0xa2bfe8a14cf10364n,0xa81a664bbc423001n,0xc24b8b70d0f89791n,0xc76c51a30654be30n,0xd192e819d6ef5218n,0xd69906245565a910n,0xf40e35855771202an,0x106aa07032bbd1b8n,0x19a4c116b8d2d0c8n,0x1e376c085141ab53n,0x2748774cdf8eeb99n,0x34b0bcb5e19b48a8n,0x391c0cb3c5c95a63n,0x4ed8aa4ae3418acbn,0x5b9cca4f7763e373n,0x682e6ff3d6b2b8a3n,0x748f82ee5defb2fcn,0x78a5636f43172f60n,0x84c87814a1f0ab72n,0x8cc702081a6439ecn,0x90befffa23631e28n,0xa4506cebde82bde9n,0xbef9a3f7b2c67915n,0xc67178f2e372532bn,0xca273eceea26619cn,0xd186b8c721c0c207n,0xeada7dd6cde0eb1en,0xf57d4f7fee6ed178n,0x06f067aa72176fban,0x0a637dc5a2c898a6n,0x113f9804bef90daen,0x1b710b35131c471bn,0x28db77f523047d84n,0x32caab7b40c72493n,0x3c9ebe0a15c9bebcn,0x431d67c49c100d4cn,0x4cc5d4becb3e42b6n,0x597f299cfc657e2an,0x5fcb6fab3ad6faecn,0x6c44198c4a475817n]);class Ub{data;constructor(e){this.data=e}tokenType(){if("token_type"in this.data&&typeof this.data.token_type=="string")return this.data.token_type;throw new Error("Missing or invalid 'token_type' field")}accessToken(){if("access_token"in this.data&&typeof this.data.access_token=="string")return this.data.access_token;throw new Error("Missing or invalid 'access_token' field")}accessTokenExpiresInSeconds(){if("expires_in"in this.data&&typeof this.data.expires_in=="number")return this.data.expires_in;throw new Error("Missing or invalid 'expires_in' field")}accessTokenExpiresAt(){return new Date(Date.now()+this.accessTokenExpiresInSeconds()*1e3)}hasRefreshToken(){return"refresh_token"in this.data&&typeof this.data.refresh_token=="string"}refreshToken(){if("refresh_token"in this.data&&typeof this.data.refresh_token=="string")return this.data.refresh_token;throw new Error("Missing or invalid 'refresh_token' field")}hasScopes(){return"scope"in this.data&&typeof this.data.scope=="string"}scopes(){if("scope"in this.data&&typeof this.data.scope=="string")return this.data.scope.split(" ");throw new Error("Missing or invalid 'scope' field")}idToken(){if("id_token"in this.data&&typeof this.data.id_token=="string")return this.data.id_token;throw new Error("Missing or invalid field 'id_token'")}}function Mb(t){const e=O5(new TextEncoder().encode(t));return L0(e)}function rl(){const t=new Uint8Array(32);return crypto.getRandomValues(t),L0(t)}function qb(){const t=new Uint8Array(32);return crypto.getRandomValues(t),L0(t)}function L5(t,e){if(e.length!==1)throw new TypeError("Invalid character string");let n=0;for(;n<t.length&&t[n]===e;)n++;return t.slice(n)}function Fh(t,e){if(e.length!==1)throw new TypeError("Invalid character string");let n=t.length;for(;n>0&&t[n-1]===e;)n--;return t.slice(0,n)}function Hh(t,...e){let n=Fh(t,"/");for(const r of e)n=Fh(n,"/")+"/"+L5(r,"/");return n}function Bn(t,e){const n=new TextEncoder().encode(e.toString()),r=new Request(t,{method:"POST",body:n});return r.headers.set("Content-Type","application/x-www-form-urlencoded"),r.headers.set("Accept","application/json"),r.headers.set("User-Agent","arctic"),r.headers.set("Content-Length",n.byteLength.toString()),r}function Or(t,e){const n=new TextEncoder().encode(`${t}:${e}`);return N5(n)}async function Ri(t){let e;try{e=await fetch(t)}catch(n){throw new D0(n)}if(e.status===400||e.status===401){let n;try{n=await e.json()}catch{throw new Ei(e.status)}if(typeof n!="object"||n===null)throw new ir(e.status,n);let r;try{r=B0(n)}catch{throw new ir(e.status,n)}throw r}if(e.status===200){let n;try{n=await e.json()}catch{throw new Ei(e.status)}if(typeof n!="object"||n===null)throw new ir(e.status,n);return new Ub(n)}throw e.body!==null&&await e.body.cancel(),new Ei(e.status)}async function B5(t){let e;try{e=await fetch(t)}catch(n){throw new D0(n)}if(e.status===400||e.status===401){let n;try{n=await e.json()}catch{throw new ir(e.status,null)}if(typeof n!="object"||n===null)throw new ir(e.status,n);let r;try{r=B0(n)}catch{throw new ir(e.status,n)}throw r}if(e.status===200){e.body!==null&&await e.body.cancel();return}throw e.body!==null&&await e.body.cancel(),new Ei(e.status)}function B0(t){let e;if("error"in t&&typeof t.error=="string")e=t.error;else throw new Error("Invalid error response");let n=null,r=null,i=null;if("error_description"in t){if(typeof t.error_description!="string")throw new Error("Invalid data");n=t.error_description}if("error_uri"in t){if(typeof t.error_uri!="string")throw new Error("Invalid data");r=t.error_uri}if("state"in t){if(typeof t.state!="string")throw new Error("Invalid data");i=t.state}return new D5(e,n,r,i)}class D0 extends Error{constructor(e){super("Failed to send request",{cause:e})}}class D5 extends Error{code;description;uri;state;constructor(e,n,r,i){super(`OAuth request error: ${e}`),this.code=e,this.description=n,this.uri=r,this.state=i}}class Ei extends Error{status;constructor(e){super("Unexpected error response"),this.status=e}}class ir extends Error{status;data;constructor(e,n){super("Unexpected error response body"),this.status=e,this.data=n}}class ri{clientId;clientPassword;redirectURI;constructor(e,n,r){this.clientId=e,this.clientPassword=n,this.redirectURI=r}createAuthorizationURL(e,n,r){const i=new URL(e);return i.searchParams.set("response_type","code"),i.searchParams.set("client_id",this.clientId),this.redirectURI!==null&&i.searchParams.set("redirect_uri",this.redirectURI),i.searchParams.set("state",n),r.length>0&&i.searchParams.set("scope",r.join(" ")),i}createAuthorizationURLWithPKCE(e,n,r,i,s){const a=new URL(e);if(a.searchParams.set("response_type","code"),a.searchParams.set("client_id",this.clientId),this.redirectURI!==null&&a.searchParams.set("redirect_uri",this.redirectURI),a.searchParams.set("state",n),r===Dr.S256){const c=Mb(i);a.searchParams.set("code_challenge_method","S256"),a.searchParams.set("code_challenge",c)}else r===Dr.Plain&&(a.searchParams.set("code_challenge_method","plain"),a.searchParams.set("code_challenge",i));return s.length>0&&a.searchParams.set("scope",s.join(" ")),a}async validateAuthorizationCode(e,n,r){const i=new URLSearchParams;i.set("grant_type","authorization_code"),i.set("code",n),this.redirectURI!==null&&i.set("redirect_uri",this.redirectURI),r!==null&&i.set("code_verifier",r),this.clientPassword===null&&i.set("client_id",this.clientId);const s=Bn(e,i);if(this.clientPassword!==null){const c=Or(this.clientId,this.clientPassword);s.headers.set("Authorization",`Basic ${c}`)}return await Ri(s)}async refreshAccessToken(e,n,r){const i=new URLSearchParams;i.set("grant_type","refresh_token"),i.set("refresh_token",n),this.clientPassword===null&&i.set("client_id",this.clientId),r.length>0&&i.set("scope",r.join(" "));const s=Bn(e,i);if(this.clientPassword!==null){const c=Or(this.clientId,this.clientPassword);s.headers.set("Authorization",`Basic ${c}`)}return await Ri(s)}async revokeToken(e,n){const r=new URLSearchParams;r.set("token",n),this.clientPassword===null&&r.set("client_id",this.clientId);const i=Bn(e,r);if(this.clientPassword!==null){const s=Or(this.clientId,this.clientPassword);i.headers.set("Authorization",`Basic ${s}`)}await B5(i)}}var Dr;(function(t){t[t.S256=0]="S256",t[t.Plain=1]="Plain"})(Dr||(Dr={}));var Vh;(function(t){t[t.Include=0]="Include",t[t.None=1]="None"})(Vh||(Vh={}));var Kh;(function(t){t[t.Required=0]="Required",t[t.Ignore=1]="Ignore"})(Kh||(Kh={}));function Fo(t){return U5(t,M5,oc.None)}function U5(t,e,n){let r="";for(let i=0;i<t.byteLength;i+=3){let s=0,a=0;for(let c=0;c<3&&i+c<t.byteLength;c++)s=s<<8|t[i+c],a+=8;for(let c=0;c<4;c++)a>=6?(r+=e[s>>a-6&63],a-=6):a>0?(r+=e[s<<6-a&63],a=0):n===oc.Include&&(r+="=")}return r}const M5="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";var oc;(function(t){t[t.Include=0]="Include",t[t.None=1]="None"})(oc||(oc={}));var Gh;(function(t){t[t.Required=0]="Required",t[t.Ignore=1]="Ignore"})(Gh||(Gh={}));function q5(t,e,n){const r=Fo(new TextEncoder().encode(t)),i=Fo(new TextEncoder().encode(e)),s=Fo(n);return r+"."+i+"."+s}function F5(t,e){const n=Fo(new TextEncoder().encode(t)),r=Fo(new TextEncoder().encode(e)),i=n+"."+r;return new TextEncoder().encode(i)}const H5="https://appleid.apple.com/auth/authorize",V5="https://appleid.apple.com/auth/token";class Fb{clientId;teamId;keyId;pkcs8PrivateKey;redirectURI;constructor(e,n,r,i,s){this.clientId=e,this.teamId=n,this.keyId=r,this.pkcs8PrivateKey=i,this.redirectURI=s}createAuthorizationURL(e,n){const r=new URL(H5);return r.searchParams.set("response_type","code"),r.searchParams.set("client_id",this.clientId),r.searchParams.set("state",e),n.length>0&&r.searchParams.set("scope",n.join(" ")),r.searchParams.set("redirect_uri",this.redirectURI),r}async validateAuthorizationCode(e){const n=new URLSearchParams;n.set("grant_type","authorization_code"),n.set("code",e),n.set("redirect_uri",this.redirectURI),n.set("client_id",this.clientId);const r=await this.createClientSecret();n.set("client_secret",r);const i=Bn(V5,n);return await Ri(i)}async createClientSecret(){const e=await crypto.subtle.importKey("pkcs8",this.pkcs8PrivateKey,{name:"ECDSA",namedCurve:"P-256"},!1,["sign"]),n=Math.floor(Date.now()/1e3),r=JSON.stringify({typ:"JWT",alg:"ES256",kid:this.keyId}),i=JSON.stringify({iss:this.teamId,exp:n+300,aud:["https://appleid.apple.com"],sub:this.clientId,iat:n}),s=new Uint8Array(await crypto.subtle.sign({name:"ECDSA",hash:"SHA-256"},e,F5(r,i)));return q5(r,i,s)}}const K5="https://www.facebook.com/v16.0/dialog/oauth",G5="https://graph.facebook.com/v16.0/oauth/access_token";class Hb{clientId;clientSecret;redirectURI;constructor(e,n,r){this.clientId=e,this.clientSecret=n,this.redirectURI=r}createAuthorizationURL(e,n){const r=new URL(K5);return r.searchParams.set("response_type","code"),r.searchParams.set("client_id",this.clientId),r.searchParams.set("state",e),n.length>0&&r.searchParams.set("scope",n.join(" ")),r.searchParams.set("redirect_uri",this.redirectURI),r}async validateAuthorizationCode(e){const n=new URLSearchParams;n.set("grant_type","authorization_code"),n.set("code",e),n.set("redirect_uri",this.redirectURI),n.set("client_id",this.clientId),n.set("client_secret",this.clientSecret);const r=Bn(G5,n);return await Ri(r)}}const W5="https://github.com/login/oauth/authorize",Wh="https://github.com/login/oauth/access_token";class Vb{clientId;clientSecret;redirectURI;constructor(e,n,r){this.clientId=e,this.clientSecret=n,this.redirectURI=r}createAuthorizationURL(e,n){const r=new URL(W5);return r.searchParams.set("response_type","code"),r.searchParams.set("client_id",this.clientId),r.searchParams.set("state",e),n.length>0&&r.searchParams.set("scope",n.join(" ")),this.redirectURI!==null&&r.searchParams.set("redirect_uri",this.redirectURI),r}async validateAuthorizationCode(e){const n=new URLSearchParams;n.set("grant_type","authorization_code"),n.set("code",e),this.redirectURI!==null&&n.set("redirect_uri",this.redirectURI);const r=Bn(Wh,n),i=Or(this.clientId,this.clientSecret);return r.headers.set("Authorization",`Basic ${i}`),await Jh(r)}async refreshAccessToken(e){const n=new URLSearchParams;n.set("grant_type","refresh_token"),n.set("refresh_token",e);const r=Bn(Wh,n),i=Or(this.clientId,this.clientSecret);return r.headers.set("Authorization",`Basic ${i}`),await Jh(r)}}async function Jh(t){let e;try{e=await fetch(t)}catch(i){throw new D0(i)}if(e.status!==200)throw e.body!==null&&await e.body.cancel(),new Ei(e.status);let n;try{n=await e.json()}catch{throw new Ei(e.status)}if(typeof n!="object"||n===null)throw new ir(e.status,n);if("error"in n&&typeof n.error=="string"){let i;try{i=B0(n)}catch{throw new ir(e.status,n)}throw i}return new Ub(n)}const J5="https://accounts.google.com/o/oauth2/v2/auth",Xh="https://oauth2.googleapis.com/token",X5="https://oauth2.googleapis.com/revoke";let Kb=class{client;constructor(e,n,r){this.client=new ri(e,n,r)}createAuthorizationURL(e,n,r){return this.client.createAuthorizationURLWithPKCE(J5,e,Dr.S256,n,r)}async validateAuthorizationCode(e,n){return await this.client.validateAuthorizationCode(Xh,e,n)}async refreshAccessToken(e){return await this.client.refreshAccessToken(Xh,e,[])}async revokeToken(e){await this.client.revokeToken(X5,e)}};class Gb{authorizationEndpoint;tokenEndpoint;clientId;clientSecret;redirectURI;constructor(e,n,r,i){this.authorizationEndpoint=Hh("https://login.microsoftonline.com",e,"/oauth2/v2.0/authorize"),this.tokenEndpoint=Hh("https://login.microsoftonline.com",e,"/oauth2/v2.0/token"),this.clientId=n,this.clientSecret=r,this.redirectURI=i}createAuthorizationURL(e,n,r){const i=new URL(this.authorizationEndpoint);i.searchParams.set("response_type","code"),i.searchParams.set("client_id",this.clientId),i.searchParams.set("redirect_uri",this.redirectURI),i.searchParams.set("state",e);const s=Mb(n);return i.searchParams.set("code_challenge_method","S256"),i.searchParams.set("code_challenge",s),r.length>0&&i.searchParams.set("scope",r.join(" ")),i}async validateAuthorizationCode(e,n){const r=new URLSearchParams;r.set("grant_type","authorization_code"),r.set("code",e),r.set("redirect_uri",this.redirectURI),r.set("code_verifier",n),this.clientSecret===null&&r.set("client_id",this.clientId);const i=Bn(this.tokenEndpoint,r);if(this.clientSecret!==null){const a=Or(this.clientId,this.clientSecret);i.headers.set("Authorization",`Basic ${a}`)}else i.headers.set("Origin","arctic");return await Ri(i)}async refreshAccessToken(e,n){const r=new URLSearchParams;r.set("grant_type","refresh_token"),r.set("refresh_token",e),this.clientSecret===null&&r.set("client_id",this.clientId),n.length>0&&r.set("scope",n.join(" "));const i=Bn(this.tokenEndpoint,r);if(this.clientSecret!==null){const a=Or(this.clientId,this.clientSecret);i.headers.set("Authorization",`Basic ${a}`)}else i.headers.set("Origin","arctic");return await Ri(i)}}const Yi=o.z.object({iss:o.z.string().url(),sub:o.z.string(),aud:o.z.string(),exp:o.z.number(),email:o.z.string().optional(),given_name:o.z.string().optional(),family_name:o.z.string().optional(),name:o.z.string().optional(),iat:o.z.number(),auth_time:o.z.number().optional(),nonce:o.z.string().optional(),acr:o.z.string().optional(),amr:o.z.array(o.z.string()).optional(),azp:o.z.string().optional(),at_hash:o.z.string().optional(),c_hash:o.z.string().optional()}).passthrough();Yi.omit({iat:!0,auth_time:!0,nonce:!0,acr:!0,amr:!0,azp:!0,at_hash:!0,c_hash:!0});function il(t){return t.ISSUER}function it(t){return t.UNIVERSAL_LOGIN_URL||`${t.ISSUER}u/`}function Oe(t){return t.OAUTH_API_URL||t.ISSUER}const Z5="Apple",Y5=({className:t=""})=>g("svg",{width:"45",height:"45",viewBox:"0 0 45 45",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,children:[g("path",{d:"M45 0H0V45H45V0Z",fill:"white"}),g("path",{d:"M23.5344 10.3846C25.5313 10.3846 28.0344 9.01144 29.525 7.18055C30.875 5.5213 31.8594 3.20407 31.8594 0.886839C31.8594 0.572154 31.8313 0.25747 31.775 0C29.5531 0.0858233 26.8813 1.51621 25.2781 3.43293C24.0125 4.89193 22.8594 7.18055 22.8594 9.52638C22.8594 9.86968 22.9156 10.213 22.9438 10.3274C23.0844 10.356 23.3094 10.3846 23.5344 10.3846ZM16.5031 45C19.2313 45 20.4406 43.1405 23.8438 43.1405C27.3031 43.1405 28.0625 44.9428 31.1 44.9428C34.0813 44.9428 36.0781 42.1392 37.9625 39.3929C40.0719 36.246 40.9438 33.1564 41 33.0134C40.8031 32.9561 35.0938 30.5817 35.0938 23.9161C35.0938 18.1373 39.5938 15.534 39.8469 15.3338C36.8656 10.9854 32.3375 10.8709 31.1 10.8709C27.7531 10.8709 25.025 12.9307 23.3094 12.9307C21.4531 12.9307 19.0063 10.9854 16.1094 10.9854C10.5969 10.9854 5 15.6198 5 24.3738C5 29.8093 7.08125 35.5594 9.64063 39.2784C11.8344 42.4253 13.7469 45 16.5031 45Z",fill:"black"})]});function Wb(t){const{options:e}=t;if(!e||!e.client_id||!e.team_id||!e.kid||!e.app_secret)throw new Error("Missing required Apple authentication parameters");const n=Buffer.from(e.app_secret,"utf-8"),r=n.toString().replace(/-----BEGIN PRIVATE KEY-----|-----END PRIVATE KEY-----|\s/g,""),i=Uint8Array.from(Buffer.from(r,"base64"));return n.fill(0),{options:e,keyArray:i}}async function Q5(t,e){const{options:n,keyArray:r}=Wb(e),i=`${Oe(t.env)}callback`,s=new Fb(n.client_id,n.team_id,n.kid,r,i),a=je(),c=await s.createAuthorizationURL(a,n.scope?.split(" ")||["name","email"]);return(n.scope?.split(" ")||["name","email"]).some(u=>["email","name"].includes(u))&&c.searchParams.set("response_mode","form_post"),{redirectUrl:c.href,code:a}}async function e8(t,e,n){const{options:r,keyArray:i}=Wb(e),a=await new Fb(r.client_id,r.team_id,r.kid,i,`${Oe(t.env)}callback`).validateAuthorizationCode(n),c=Ss(a.idToken());if(!c)throw new Error("Invalid ID token");const l=Yi.parse(c.payload);return{sub:l.sub,email:l.email,given_name:l.given_name,family_name:l.family_name,name:l.name,picture:l.picture,locale:l.locale}}const t8=Object.freeze(Object.defineProperty({__proto__:null,displayName:Z5,getRedirect:Q5,logo:Y5,validateAuthorizationCodeAndGetUser:e8},Symbol.toStringTag,{value:"Module"})),n8="Facebook",r8=({className:t=""})=>g("svg",{width:"45",height:"45",viewBox:"0 0 45 45",xmlns:"http://www.w3.org/2000/svg",className:t,children:[g("path",{d:"M45 22.5C45 10.0736 34.9264 0 22.5 0C10.0736 0 0 10.0736 0 22.5C0 33.7031 8.23242 42.9785 19.0039 44.6953V28.9746H13.2861V22.5H19.0039V17.5391C19.0039 11.8945 22.3828 8.75977 27.5391 8.75977C29.9658 8.75977 32.5049 9.19922 32.5049 9.19922V14.7656H29.7012C26.9414 14.7656 26.0156 16.4824 26.0156 18.2432V22.5H32.2412L31.2012 28.9746H26.0156V44.6953C36.7871 42.9785 45 33.7031 45 22.5Z",fill:"#1877F2"}),g("path",{d:"M31.2012 28.9746L32.2412 22.5H26.0156V18.2432C26.0156 16.4824 26.9414 14.7656 29.7012 14.7656H32.5049V9.19922C32.5049 9.19922 29.9658 8.75977 27.5391 8.75977C22.3828 8.75977 19.0039 11.8945 19.0039 17.5391V22.5H13.2861V28.9746H19.0039V44.6953C20.1562 44.8984 21.3203 45 22.5 45C23.6797 45 24.8438 44.8984 26.0156 44.6953V28.9746H31.2012Z",fill:"white"})]});async function i8(t,e){const{options:n}=e;if(!n?.client_id||!n.client_secret)throw new Error("Missing required authentication parameters");const r=`${Oe(t.env)}callback`,i=new Hb(n.client_id,n.client_secret,r),s=je();return{redirectUrl:i.createAuthorizationURL(s,n.scope?.split(" ")||["email"]).href,code:s}}async function o8(t,e,n){const{options:r}=e;if(!r?.client_id||!r.client_secret)throw new Error("Missing required authentication parameters");const s=await new Hb(r.client_id,r.client_secret,`${Oe(t.env)}callback`).validateAuthorizationCode(n),a=await fetch("https://graph.facebook.com/v22.0/me?fields=id,email,name",{headers:{Authorization:`Bearer ${s.accessToken()}`}});if(!a.ok)throw new Error("Failed to fetch user info");const c=await a.json();return t.set("log",`Userinfo: ${JSON.stringify(c)}`),{sub:c.id,email:c.email,name:c.name}}const s8=Object.freeze(Object.defineProperty({__proto__:null,displayName:n8,getRedirect:i8,logo:r8,validateAuthorizationCodeAndGetUser:o8},Symbol.toStringTag,{value:"Module"})),a8="Google",c8=!0,l8=({className:t=""})=>g("svg",{width:"45",height:"45",viewBox:"0 0 45 45",xmlns:"http://www.w3.org/2000/svg",className:t,children:[g("path",{d:"M44.1035 23.0123C44.1054 21.4791 43.9758 19.9486 43.716 18.4375H22.498V27.1028H34.6507C34.4021 28.4868 33.8757 29.8061 33.1034 30.9812C32.3311 32.1562 31.3289 33.1628 30.1571 33.9401V39.5649H37.41C41.6567 35.6494 44.1035 29.859 44.1035 23.0123Z",fill:"#4285F4"}),g("path",{d:"M22.4982 44.9997C28.5698 44.9997 33.6821 43.0061 37.4101 39.5687L30.1573 33.9439C28.1386 35.3126 25.5387 36.0938 22.4982 36.0938C16.6296 36.0938 11.6485 32.1377 9.86736 26.8066H2.39575V32.6033C4.26839 36.3297 7.13989 39.4622 10.6896 41.6512C14.2394 43.8402 18.3277 44.9995 22.4982 44.9997Z",fill:"#34A853"}),g("path",{d:"M9.86737 26.8073C8.92572 24.0138 8.92572 20.9886 9.86737 18.1951V12.3984H2.39576C0.820432 15.5332 0 18.9929 0 22.5012C0 26.0095 0.820432 29.4692 2.39576 32.604L9.86737 26.8073Z",fill:"#FBBC04"}),g("path",{d:"M22.4982 8.90741C25.7068 8.85499 28.8071 10.0673 31.1291 12.2823L37.5507 5.86064C33.4788 2.03602 28.0843 -0.0637686 22.4982 0.00147616C18.3277 0.00166623 14.2394 1.16098 10.6896 3.34999C7.13989 5.539 4.26839 8.67155 2.39575 12.3979L9.86736 18.1946C11.6485 12.8635 16.6296 8.90741 22.4982 8.90741Z",fill:"#EA4335"})]});async function u8(t,e){const{options:n}=e;if(!n?.client_id||!n.client_secret)throw new Error("Missing required Google authentication parameters");const r=`${Oe(t.env)}callback`,i=new Kb(n.client_id,n.client_secret,r),s=je(),a=rl();return{redirectUrl:i.createAuthorizationURL(s,a,n.scope?.split(" ")??["email","profile"]).href,code:s,codeVerifier:a}}async function d8(t,e,n,r){const{options:i}=e;if(!i?.client_id||!i.client_secret||!r)throw new Error("Missing required authentication parameters");const a=await new Kb(i.client_id,i.client_secret,`${Oe(t.env)}callback`).validateAuthorizationCode(n,r),c=Ss(a.idToken());if(!c)throw new Error("Invalid ID token");const l=Yi.parse(c.payload);return{sub:l.sub,email:l.email,given_name:l.given_name,family_name:l.family_name,name:l.name,picture:l.picture,locale:l.locale}}const p8=Object.freeze(Object.defineProperty({__proto__:null,disableEmbeddedBrowsers:c8,displayName:a8,getRedirect:u8,logo:l8,validateAuthorizationCodeAndGetUser:d8},Symbol.toStringTag,{value:"Module"})),f8="Vipps",h8=({className:t=""})=>g("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 48 48",width:"45",height:"45",className:t,children:[g("path",{fill:"#FF5B24",d:"M3.5,8h41c1.9,0,3.5,1.6,3.5,3.5v25c0,1.9-1.6,3.5-3.5,3.5h-41C1.6,40,0,38.4,0,36.5v-25C0,9.6,1.6,8,3.5,8z"}),g("path",{fillRule:"evenodd",clipRule:"evenodd",fill:"#FFFFFF",d:`M27.9,20.3c1.4,0,2.6-1,2.6-2.5h0c0-1.5-1.2-2.5-2.6-2.5c-1.4,0-2.6,1-2.6,2.5C25.3,19.2,26.5,20.3,27.9,20.3z
|
|
66
|
+
M31.2,24.4c-1.7,2.2-3.5,3.8-6.7,3.8h0c-3.2,0-5.8-2-7.7-4.8c-0.8-1.2-2-1.4-2.9-0.8c-0.8,0.6-1,1.8-0.3,2.9
|
|
67
|
+
c2.7,4.1,6.5,6.6,10.9,6.6c4,0,7.2-2,9.6-5.2c0.9-1.2,0.9-2.5,0-3.1C33.3,22.9,32.1,23.2,31.2,24.4z`})]});async function g8(t,e){const{options:n}=e;if(!n?.client_id||!n.client_secret)throw new Error("Missing required authentication parameters");const r=new ri(n.client_id,n.client_secret,`${Oe(t.env)}callback`),i=je(),s=r.createAuthorizationURL("https://api.vipps.no/access-management-1.0/access/oauth2/auth",i,n.scope?.split(" ")||["openid","email","phoneNumber","name","address","birthDate"]);return s.searchParams.set("response_type","code"),s.searchParams.set("response_mode","query"),{redirectUrl:s.href,code:i}}async function m8(t,e,n){const{options:r}=e;if(!r?.client_id||!r.client_secret)throw new Error("Missing required authentication parameters");const s=await new ri(r.client_id,r.client_secret,`${Oe(t.env)}callback`).validateAuthorizationCode("https://api.vipps.no/access-management-1.0/access/oauth2/token",n,null),a=Ss(s.idToken());if(!a)throw new Error("Invalid ID token");const c=Yi.parse(a.payload);if(typeof c.msn!="string")throw new Error("msn not available in id token");const l=await fetch("https://api.vipps.no/vipps-userinfo-api/userinfo",{headers:{Authorization:`Bearer ${s.accessToken()}`,"Merchant-Serial-Number":c.msn}});if(!l.ok)throw new X(400,{message:"Failed to get user from vipps"});return await l.json()}const _8=Object.freeze(Object.defineProperty({__proto__:null,displayName:f8,getRedirect:g8,logo:h8,validateAuthorizationCodeAndGetUser:m8},Symbol.toStringTag,{value:"Module"})),y8="GitHub",b8=({className:t=""})=>g("svg",{width:"45",height:"45",viewBox:"0 0 45 45",xmlns:"http://www.w3.org/2000/svg",className:t,children:g("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M22.5 0C10.074 0 0 10.335 0 23.077C0 33.266 6.444 41.895 15.39 44.955C16.515 45.165 16.935 44.46 16.935 43.857C16.935 43.32 16.92 41.865 16.905 39.99C10.65 41.355 9.33 36.99 9.33 36.99C8.31 34.32 6.825 33.615 6.825 33.615C4.77 32.205 6.975 32.235 6.975 32.235C9.24 32.385 10.425 34.59 10.425 34.59C12.45 38.13 15.75 37.125 17.01 36.555C17.22 35.07 17.82 34.065 18.48 33.51C13.455 32.94 8.19 30.93 8.19 22.035C8.19 19.5 9.075 17.43 10.47 15.81C10.23 15.24 9.435 12.87 10.695 9.66C10.695 9.66 12.585 9.045 16.875 12.06C18.675 11.565 20.595 11.31 22.5 11.31C24.405 11.31 26.325 11.565 28.125 12.06C32.415 9.045 34.305 9.66 34.305 9.66C35.565 12.87 34.77 15.24 34.53 15.81C35.925 17.43 36.81 19.5 36.81 22.035C36.81 30.96 31.53 32.925 26.49 33.48C27.33 34.2 28.095 35.625 28.095 37.815C28.095 40.95 28.065 43.47 28.065 43.857C28.065 44.46 28.485 45.18 29.625 44.955C38.571 41.88 45 33.252 45 23.077C45 10.335 34.926 0 22.5 0Z",fill:"currentColor"})});async function w8(t,e){const{options:n}=e;if(!n?.client_id||!n.client_secret)throw new Error("Missing required GitHub authentication parameters");const r=`${Oe(t.env)}callback`,i=new Vb(n.client_id,n.client_secret,r),s=je();return{redirectUrl:i.createAuthorizationURL(s,n.scope?.split(" ")||["user:email"]).href,code:s}}async function v8(t,e,n){const{options:r}=e;if(!r?.client_id||!r.client_secret)throw new Error("Missing required authentication parameters");const s=await new Vb(r.client_id,r.client_secret,`${Oe(t.env)}callback`).validateAuthorizationCode(n),a=await fetch("https://api.github.com/user",{headers:{Authorization:`Bearer ${s.accessToken()}`,"User-Agent":"AuthHero"}});if(!a.ok)throw new Error("Failed to fetch user info");const c=await a.json(),l=await fetch("https://api.github.com/user/emails",{headers:{Authorization:`Bearer ${s.accessToken()}`,"User-Agent":"AuthHero"}});let u=c.email;if(l.ok){const d=await l.json(),f=d.find(p=>p.primary&&p.verified)||d.find(p=>p.verified);f&&(u=f.email)}return t.set("log",`GitHub user: ${JSON.stringify(c)}`),{sub:c.id.toString(),email:u,name:c.name,given_name:c.name?.split(" ")[0],family_name:c.name?.split(" ").slice(1).join(" "),picture:c.avatar_url}}const x8=Object.freeze(Object.defineProperty({__proto__:null,displayName:y8,getRedirect:w8,logo:b8,validateAuthorizationCodeAndGetUser:v8},Symbol.toStringTag,{value:"Module"})),k8="Microsoft",$8=({className:t=""})=>g("svg",{width:"45",height:"45",viewBox:"0 0 45 45",xmlns:"http://www.w3.org/2000/svg",className:t,children:[g("path",{fill:"#F25022",d:"M0 0H21.43V21.43H0V0Z"}),g("path",{fill:"#7FBA00",d:"M23.57 0H45V21.43H23.57V0Z"}),g("path",{fill:"#00A4EF",d:"M0 23.57H21.43V45H0V23.57Z"}),g("path",{fill:"#FFB900",d:"M23.57 23.57H45V45H23.57V23.57Z"})]});async function S8(t,e){const{options:n}=e;if(!n?.client_id||!n.client_secret)throw new Error("Missing required Microsoft authentication parameters");const r=`${Oe(t.env)}callback`,i=n.realms||"common",s=new Gb(i,n.client_id,n.client_secret,r),a=je(),c=rl();return{redirectUrl:s.createAuthorizationURL(a,c,n.scope?.split(" ")||["openid","profile","email"]).href,code:a,codeVerifier:c}}async function z8(t,e,n,r){const{options:i}=e;if(!i?.client_id||!i.client_secret||!r)throw new Error("Missing required authentication parameters");const s=i.realms||"common",c=await new Gb(s,i.client_id,i.client_secret,`${Oe(t.env)}callback`).validateAuthorizationCode(n,r),l=Ss(c.idToken());if(!l)throw new Error("Invalid ID token");const u=Yi.parse(l.payload);return t.set("log",`Microsoft user: ${JSON.stringify(u)}`),{sub:u.sub,email:u.email,given_name:u.given_name,family_name:u.family_name,name:u.name,picture:u.picture}}const A8=Object.freeze(Object.defineProperty({__proto__:null,displayName:k8,getRedirect:S8,logo:$8,validateAuthorizationCodeAndGetUser:z8},Symbol.toStringTag,{value:"Module"})),E8="OpenID Connect",C8=({className:t="",iconUrl:e})=>e?g("img",{src:e,alt:"OIDC Provider",className:t}):g("svg",{width:"45",height:"45",viewBox:"0 0 45 45",xmlns:"http://www.w3.org/2000/svg",className:t,children:[g("path",{d:"M22.5 0C10.074 0 0 10.074 0 22.5S10.074 45 22.5 45 45 34.926 45 22.5 34.926 0 22.5 0zm0 40.5c-9.941 0-18-8.059-18-18s8.059-18 18-18 18 8.059 18 18-8.059 18-18 18z",fill:"currentColor"}),g("path",{d:"M22.5 9c-7.456 0-13.5 6.044-13.5 13.5S15.044 36 22.5 36 36 29.956 36 22.5 29.956 9 22.5 9zm0 22.5c-4.971 0-9-4.029-9-9s4.029-9 9-9 9 4.029 9 9-4.029 9-9 9z",fill:"currentColor"})]});async function N8(t,e){const{options:n}=e;if(!n?.client_id||!n.authorization_endpoint)throw new Error("Missing required OIDC authentication parameters");const r=`${Oe(t.env)}callback`,i=new ri(n.client_id,n.client_secret||null,r),s=qb(),a=rl(),c=n.scope?.split(" ")??["openid","profile","email"];return{redirectUrl:i.createAuthorizationURLWithPKCE(n.authorization_endpoint,s,Dr.S256,a,c).href,code:s,codeVerifier:a}}async function I8(t,e,n,r){const{options:i}=e;if(!i?.client_id||!i.token_endpoint)throw new Error("Missing required authentication parameters");const s=`${Oe(t.env)}callback`,c=await new ri(i.client_id,i.client_secret||null,s).validateAuthorizationCode(i.token_endpoint,n,r||null);if(c.data.id_token){const u=Ss(c.idToken());if(u?.payload){const d=Yi.passthrough().parse(u.payload);return{sub:d.sub,email:d.email,given_name:d.given_name,family_name:d.family_name,name:d.name}}}if(i.userinfo_endpoint){const u=await fetch(i.userinfo_endpoint,{headers:{Authorization:`Bearer ${c.accessToken()}`}});if(!u.ok)throw new Error("Failed to fetch user info");const d=await u.json();if(!d.sub)throw new Error("Unable to get user identifier: userinfo response missing sub");return{sub:d.sub,email:d.email,given_name:d.given_name,family_name:d.family_name,name:d.name}}throw new Error("Unable to get user information: no ID token or userinfo endpoint")}const j8=Object.freeze(Object.defineProperty({__proto__:null,displayName:E8,getRedirect:N8,logo:C8,validateAuthorizationCodeAndGetUser:I8},Symbol.toStringTag,{value:"Module"})),T8="OAuth 2.0",O8=({className:t="",iconUrl:e})=>e?g("img",{src:e,alt:"OAuth Provider",className:t}):g("svg",{width:"45",height:"45",viewBox:"0 0 45 45",xmlns:"http://www.w3.org/2000/svg",className:t,children:g("path",{d:"M31.5 18h-1.5v-4.5c0-4.136-3.364-7.5-7.5-7.5s-7.5 3.364-7.5 7.5v4.5h-1.5c-1.657 0-3 1.343-3 3v15c0 1.657 1.343 3 3 3h18c1.657 0 3-1.343 3-3v-15c0-1.657-1.343-3-3-3zm-12-4.5c0-2.481 2.019-4.5 4.5-4.5s4.5 2.019 4.5 4.5v4.5h-9v-4.5zm12 22.5h-18v-15h18v15zm-9-6c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3z",fill:"currentColor"})});async function P8(t,e){const{options:n}=e;if(!n?.client_id||!n.authorization_endpoint)throw new Error("Missing required OAuth2 authentication parameters");const r=`${Oe(t.env)}callback`,i=new ri(n.client_id,n.client_secret||null,r),s=qb(),a=rl(),c=n.scope?.split(" ")??[];return{redirectUrl:i.createAuthorizationURLWithPKCE(n.authorization_endpoint,s,Dr.S256,a,c).href,code:s,codeVerifier:a}}async function R8(t,e,n,r){const{options:i}=e;if(!i?.client_id||!i.token_endpoint)throw new Error("Missing required authentication parameters");const s=`${Oe(t.env)}callback`,c=await new ri(i.client_id,i.client_secret||null,s).validateAuthorizationCode(i.token_endpoint,n,r||null);if(!i.userinfo_endpoint)throw new Error("Missing userinfo_endpoint for OAuth2 provider");const l=await fetch(i.userinfo_endpoint,{headers:{Authorization:`Bearer ${c.accessToken()}`}});if(!l.ok)throw new Error("Failed to fetch user info");const u=await l.json(),d=u.sub||u.id||u.user_id;if(!d)throw new Error("Unable to get user identifier: response missing sub, id, or user_id");return{sub:d,email:u.email,given_name:u.given_name||u.first_name,family_name:u.family_name||u.last_name,name:u.name||`${u.given_name||u.first_name||""} ${u.family_name||u.last_name||""}`.trim()}}const L8=Object.freeze(Object.defineProperty({__proto__:null,displayName:T8,getRedirect:P8,logo:O8,validateAuthorizationCodeAndGetUser:R8},Symbol.toStringTag,{value:"Module"})),U0={apple:t8,facebook:s8,"google-oauth2":p8,vipps:_8,github:x8,microsoft:A8,oidc:j8,oauth2:L8};function Jb(t,e){const n=t.env.STRATEGIES||{},i={...U0,...n}[e];if(!i)throw new Error(`Strategy ${e} not found`);return i}const B8=new Set(["oidc","samlp","waad","adfs","oauth2"]);function D8(t){return B8.has(t.strategy)?t.name:t.strategy}const Zh=xt.extend({users:o.z.array(hn)}),U8=xt.extend({sessions:o.z.array(Xc)}),M8=xt.extend({organizations:o.z.array(er)}),q8=new o.OpenAPIHono().openapi(o.createRoute({tags:["users"],method:"get",path:"/",request:{query:et,headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["read:users","auth:read"]}],responses:{200:{content:{"application/json":{schema:o.z.union([o.z.array(hn),Zh])}},description:"List of users"}}}),async t=>{const{page:e,per_page:n,include_totals:r,sort:i,q:s}=t.req.valid("query");if(s?.includes("identities.profileData.email")){const u=s.split("=")[1],f=(await t.env.data.users.list(t.var.tenant_id,{page:e,per_page:n,include_totals:r,q:`email:${u}`})).users.filter(m=>m.linked_to),[p]=f;if(!p)return t.json([]);const h=await t.env.data.users.get(t.var.tenant_id,p.linked_to);if(!h)throw new I(500,{message:"Primary account not found"});return t.json([hn.parse(h)])}const a=["-_exists_:linked_to"];s&&a.push(s);const c=await t.env.data.users.list(t.var.tenant_id,{page:e,per_page:n,include_totals:r,sort:ut(i),q:a.join(" ")}),l=c.users.filter(u=>!u.linked_to);return r?t.json(Zh.parse({users:l,length:c.length,start:c.start,limit:c.limit})):t.json(o.z.array(hn).parse(l))}).openapi(o.createRoute({tags:["users"],method:"get",path:"/{user_id}",request:{headers:o.z.object({"tenant-id":o.z.string().optional()}),params:o.z.object({user_id:o.z.string()})},security:[{Bearer:["read:users","auth:read"]}],responses:{200:{content:{"application/json":{schema:hn}},description:"List of users"}}}),async t=>{const{user_id:e}=t.req.valid("param"),n=await t.env.data.users.get(t.var.tenant_id,e);if(!n)throw new I(404);if(n.linked_to)throw new I(404,{message:"User is linked to another user"});return t.json(n)}).openapi(o.createRoute({tags:["users"],method:"delete",path:"/{user_id}",request:{headers:o.z.object({"tenant-id":o.z.string().optional()}),params:o.z.object({user_id:o.z.string()})},security:[{Bearer:["delete:users","auth:write"]}],responses:{200:{description:"Status"}}}),async t=>{const{user_id:e}=t.req.valid("param");if(!await t.env.data.users.remove(t.var.tenant_id,e))throw new I(404);return await ye(t,t.var.tenant_id,{type:ge.SUCCESS_API_OPERATION,description:"Delete a User",response:{statusCode:204,body:{}}}),t.text("OK")}).openapi(o.createRoute({tags:["users"],method:"post",path:"/",request:{headers:o.z.object({"tenant-id":o.z.string().optional()}),body:{content:{"application/json":{schema:o.z.object({...qa.shape,password:o.z.string().optional()})}}}},security:[{Bearer:["create:users","auth:write"]}],responses:{201:{content:{"application/json":{schema:hn}},description:"Status"}}}),async t=>{const e=t.req.valid("json");t.set("body",e);const{email:n,phone_number:r,name:i,linked_to:s,email_verified:a,provider:c,connection:l,password:u}=e,d=await t.env.data.connections.get(t.var.tenant_id,l),f=d?D8(d):c||l,p=e.user_id,h=p?ra(p):$s(),m=`${f}|${h}`;try{const y={email:n,user_id:m,name:i||n||r,phone_number:r,provider:f,connection:l,linked_to:s??void 0,email_verified:a||!1,last_ip:"",is_social:!1,last_login:new Date().toISOString()},w=await t.env.data.users.create(t.var.tenant_id,y);if(u){const k={user_id:m,password:await ar.hash(u,10),algorithm:"bcrypt",is_current:!0};await t.env.data.passwords.create(t.var.tenant_id,k)}t.set("user_id",w.user_id),await ye(t,t.var.tenant_id,{type:ge.SUCCESS_API_OPERATION,description:"User created"});const _=w.identities?w:{...w,identities:[{connection:w.connection,provider:w.provider,user_id:ra(w.user_id),isSocial:w.is_social}]};return t.json(hn.parse(_),{status:201})}catch(y){throw y.message==="User already exists"?new I(409,{message:"User already exists"}):y}}).openapi(o.createRoute({tags:["users"],method:"patch",path:"/{user_id}",request:{headers:o.z.object({"tenant-id":o.z.string().optional()}),body:{content:{"application/json":{schema:o.z.object({...qa.shape,verify_email:o.z.boolean(),password:o.z.string()}).partial()}}},params:o.z.object({user_id:o.z.string()})},security:[{Bearer:["update:users","auth:write"]}],responses:{200:{description:"Status"}}}),async t=>{const{data:e}=t.env,n=t.req.valid("json"),{user_id:r}=t.req.valid("param"),{verify_email:i,password:s,connection:a,...c}=n,l=await e.users.get(t.var.tenant_id,r);if(!l)throw new I(404);if(l.linked_to)throw new I(404,{message:"User is linked to another user"});let u=r,d=l;if(a)if(l.connection===a)u=r,d=l;else{const h=(await e.users.list(t.var.tenant_id,{page:0,per_page:100,include_totals:!1,q:`linked_to:${r}`})).users.find(m=>m.connection===a);if(!h)throw new I(404,{message:`No identity found with connection: ${a}`});u=h.user_id,d=h}if(c.email&&c.email!==d.email){const p=await T0(t.env.data.users,t.var.tenant_id,c.email);if(p.length&&p.some(h=>h.user_id!==u))throw new I(409,{message:"Another user with the same email address already exists."})}if(await t.env.data.users.update(t.var.tenant_id,u,c),s){let p;if(a)if(a==="Username-Password-Authentication")p={provider:d.provider,user_id:ra(u)};else throw new I(400,{message:`Cannot set password for connection: ${a}`});else if(p=l.identities?.find(y=>y.connection==="Username-Password-Authentication"),!p)throw new I(400,{message:"User does not have a password identity"});const h=`${p.provider}|${p.user_id}`,m=await e.passwords.get(t.var.tenant_id,h);m&&await e.passwords.update(t.var.tenant_id,{id:m.id,user_id:h,password:m.password,algorithm:m.algorithm,is_current:!1}),await e.passwords.create(t.var.tenant_id,{user_id:h,password:await ar.hash(s,10),algorithm:"bcrypt",is_current:!0})}const f=await t.env.data.users.get(t.var.tenant_id,r);if(!f)throw new I(500);return await ye(t,t.var.tenant_id,{type:ge.SUCCESS_API_OPERATION,description:"Update a User",body:n,response:{statusCode:200,body:f}}),t.json(f)}).openapi(o.createRoute({tags:["users"],method:"post",path:"/{user_id}/identities",request:{headers:o.z.object({"tenant-id":o.z.string().optional()}),body:{content:{"application/json":{schema:o.z.union([o.z.object({link_with:o.z.string()}),o.z.object({user_id:o.z.string(),provider:o.z.string(),connection:o.z.string().optional()})])}}},params:o.z.object({user_id:o.z.string()})},security:[{Bearer:["auth:write"]}],responses:{201:{content:{"application/json":{schema:o.z.array(o.z.object({connection:o.z.string(),provider:o.z.string(),user_id:o.z.string(),isSocial:o.z.boolean()}))}},description:"Status"}}}),async t=>{const e=t.req.valid("json"),{user_id:n}=t.req.valid("param"),r="link_with"in e?e.link_with:e.user_id,i=await t.env.data.users.get(t.var.tenant_id,n);if(!i)throw new I(400,{message:"Linking an inexistent identity is not allowed."});await t.env.data.users.update(t.var.tenant_id,r,{linked_to:n});const s=await t.env.data.users.list(t.var.tenant_id,{page:0,per_page:10,include_totals:!1,q:`linked_to:${n}`}),a=[i,...s.users].map(c=>({connection:c.connection,provider:c.provider,user_id:ra(c.user_id),isSocial:c.is_social}));return t.json(a,{status:201})}).openapi(o.createRoute({tags:["users"],method:"delete",path:"/{user_id}/identities/{provider}/{linked_user_id}",request:{headers:o.z.object({"tenant-id":o.z.string().optional()}),params:o.z.object({user_id:o.z.string(),provider:o.z.string(),linked_user_id:o.z.string()})},security:[{Bearer:["auth:write"]}],responses:{200:{content:{"application/json":{schema:o.z.array(hn)}},description:"Status"}}}),async t=>{const{user_id:e,provider:n,linked_user_id:r}=t.req.valid("param");await t.env.data.users.unlink(t.var.tenant_id,e,n,r);const i=await t.env.data.users.get(t.var.tenant_id,e);if(!i)throw new I(404);return t.json([hn.parse(i)])}).openapi(o.createRoute({tags:["users"],method:"get",path:"/{user_id}/sessions",request:{query:et,headers:o.z.object({"tenant-id":o.z.string().optional()}),params:o.z.object({user_id:o.z.string()})},security:[{Bearer:["read:users","auth:read"]}],responses:{200:{content:{"application/json":{schema:o.z.union([o.z.array(Xc),U8])}},description:"List of sessions"}}}),async t=>{const{user_id:e}=t.req.valid("param"),{include_totals:n,page:r,per_page:i}=t.req.valid("query"),s=await t.env.data.sessions.list(t.var.tenant_id,{page:r,per_page:i,include_totals:n,q:`user_id:${e}`});return n?t.json(s):t.json(s.sessions)}).openapi(o.createRoute({tags:["users"],method:"get",path:"/{user_id}/permissions",request:{params:o.z.object({user_id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()}),query:et},security:[{Bearer:["read:users","auth:read"]}],responses:{200:{content:{"application/json":{schema:Xy}},description:"User permissions"}}}),async t=>{const{user_id:e}=t.req.valid("param"),{page:n,per_page:r,sort:i,q:s}=t.req.valid("query");if(!await t.env.data.users.get(t.var.tenant_id,e))throw new I(404,{message:"User not found"});const c=await t.env.data.userPermissions.list(t.var.tenant_id,e,{page:n,per_page:r,include_totals:!1,sort:ut(i),q:s});return t.json(c)}).openapi(o.createRoute({tags:["users"],method:"post",path:"/{user_id}/permissions",request:{params:o.z.object({user_id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()}),body:{content:{"application/json":{schema:o.z.object({permissions:o.z.array(o.z.object({permission_name:o.z.string(),resource_server_identifier:o.z.string()}))})}}}},security:[{Bearer:["update:users","auth:write"]}],responses:{201:{description:"Permissions assigned to user"}}}),async t=>{const{user_id:e}=t.req.valid("param"),{permissions:n}=t.req.valid("json");if(!await t.env.data.users.get(t.var.tenant_id,e))throw new I(404,{message:"User not found"});for(const i of n)if(!await t.env.data.userPermissions.create(t.var.tenant_id,e,{user_id:e,resource_server_identifier:i.resource_server_identifier,permission_name:i.permission_name}))throw new I(500,{message:"Failed to assign permissions to user"});return t.json({message:"Permissions assigned successfully"},{status:201})}).openapi(o.createRoute({tags:["users"],method:"delete",path:"/{user_id}/permissions",request:{params:o.z.object({user_id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()}),body:{content:{"application/json":{schema:o.z.object({permissions:o.z.array(o.z.object({permission_name:o.z.string(),resource_server_identifier:o.z.string()}))})}}}},security:[{Bearer:["update:users","auth:write"]}],responses:{200:{description:"Permissions removed from user"}}}),async t=>{const{user_id:e}=t.req.valid("param"),{permissions:n}=t.req.valid("json");if(!await t.env.data.users.get(t.var.tenant_id,e))throw new I(404,{message:"User not found"});for(const i of n)if(!await t.env.data.userPermissions.remove(t.var.tenant_id,e,i))throw new I(500,{message:"Failed to remove permissions from user"});return t.json({message:"Permissions removed successfully"})}).openapi(o.createRoute({tags:["users"],method:"get",path:"/{user_id}/roles",request:{params:o.z.object({user_id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string()})},security:[{Bearer:["read:users","auth:read"]}],responses:{200:{content:{"application/json":{schema:Za}},description:"User roles"}}}),async t=>{const{user_id:e}=t.req.valid("param");if(!await t.env.data.users.get(t.var.tenant_id,e))throw new I(404,{message:"User not found"});const r=await t.env.data.userRoles.list(t.var.tenant_id,e,void 0,"");return t.json(r)}).openapi(o.createRoute({tags:["users"],method:"post",path:"/{user_id}/roles",request:{params:o.z.object({user_id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string()}),body:{content:{"application/json":{schema:o.z.object({roles:o.z.array(o.z.string())})}}}},security:[{Bearer:["update:users","auth:write"]}],responses:{201:{description:"Roles assigned to user"}}}),async t=>{const{user_id:e}=t.req.valid("param"),{roles:n}=t.req.valid("json");if(!await t.env.data.users.get(t.var.tenant_id,e))throw new I(404,{message:"User not found"});for(const i of n)if(!await t.env.data.userRoles.create(t.var.tenant_id,e,i,""))throw new I(500,{message:"Failed to assign roles to user"});return t.json({message:"Roles assigned successfully"},{status:201})}).openapi(o.createRoute({tags:["users"],method:"delete",path:"/{user_id}/roles",request:{params:o.z.object({user_id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string()}),body:{content:{"application/json":{schema:o.z.object({roles:o.z.array(o.z.string())})}}}},security:[{Bearer:["update:users","auth:write"]}],responses:{200:{description:"Roles removed from user"}}}),async t=>{const{user_id:e}=t.req.valid("param"),{roles:n}=t.req.valid("json");if(!await t.env.data.users.get(t.var.tenant_id,e))throw new I(404,{message:"User not found"});for(const i of n)if(!await t.env.data.userRoles.remove(t.var.tenant_id,e,i,""))throw new I(500,{message:"Failed to remove roles from user"});return t.json({message:"Roles removed successfully"})}).openapi(o.createRoute({tags:["users"],method:"get",path:"/{user_id}/organizations",request:{params:o.z.object({user_id:o.z.string()}),query:et,headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["read:users","auth:read"]}],responses:{200:{content:{"application/json":{schema:o.z.union([M8,o.z.array(er)])}},description:"List of user organizations"}}}),async t=>{const{user_id:e}=t.req.valid("param"),{page:n,per_page:r,include_totals:i,sort:s}=t.req.valid("query");if(!await t.env.data.users.get(t.var.tenant_id,e))throw new I(404,{message:"User not found"});const c=await t.env.data.userOrganizations.listUserOrganizations(t.var.tenant_id,e,{page:n,per_page:r,sort:ut(s)});return i?t.json({organizations:c.organizations,start:c.start,limit:c.limit,length:c.length}):t.json(c.organizations)}).openapi(o.createRoute({tags:["users"],method:"delete",path:"/{user_id}/organizations/{organization_id}",request:{params:o.z.object({user_id:o.z.string(),organization_id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["update:users","auth:write"]}],responses:{200:{description:"User removed from organization successfully"}}}),async t=>{const{user_id:e,organization_id:n}=t.req.valid("param");if(!await t.env.data.users.get(t.var.tenant_id,e))throw new I(404,{message:"User not found"});const s=(await t.env.data.userOrganizations.list(t.var.tenant_id,{q:`user_id:${e}`,per_page:100})).userOrganizations.find(a=>a.organization_id===n);if(!s)throw new I(404,{message:"User is not a member of this organization"});return await t.env.data.userOrganizations.remove(t.var.tenant_id,s.id),t.json({message:"User removed from organization successfully"})});var Yh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Xb(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function F8(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var n=function r(){var i=!1;try{i=this instanceof r}catch{}return i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var Qh={};var eg;function H8(){if(eg)return Qh;eg=1;var t;return(function(e){(function(n){var r=typeof globalThis=="object"?globalThis:typeof Yh=="object"?Yh:typeof self=="object"?self:typeof this=="object"?this:l(),i=s(e);typeof r.Reflect<"u"&&(i=s(r.Reflect,i)),n(i,r),typeof r.Reflect>"u"&&(r.Reflect=e);function s(u,d){return function(f,p){Object.defineProperty(u,f,{configurable:!0,writable:!0,value:p}),d&&d(f,p)}}function a(){try{return Function("return this;")()}catch{}}function c(){try{return(0,eval)("(function() { return this; })()")}catch{}}function l(){return a()||c()}})(function(n,r){var i=Object.prototype.hasOwnProperty,s=typeof Symbol=="function",a=s&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",c=s&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",l=typeof Object.create=="function",u={__proto__:[]}instanceof Array,d=!l&&!u,f={create:l?function(){return du(Object.create(null))}:u?function(){return du({__proto__:null})}:function(){return du({})},has:d?function(T,R){return i.call(T,R)}:function(T,R){return R in T},get:d?function(T,R){return i.call(T,R)?T[R]:void 0}:function(T,R){return T[R]}},p=Object.getPrototypeOf(Function),h=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:ta(),m=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:uu(),y=typeof WeakMap=="function"?WeakMap:e3(),w=s?Symbol.for("@reflect-metadata:registry"):void 0,_=Nn(),k=qt(_);function v(T,R,U,J){if(F(U)){if(!Z(T))throw new TypeError;if(!pe(R))throw new TypeError;return M(T,R)}else{if(!Z(T))throw new TypeError;if(!le(R))throw new TypeError;if(!le(J)&&!F(J)&&!Be(J))throw new TypeError;return Be(J)&&(J=void 0),U=D(U),K(T,R,U,J)}}n("decorate",v);function $(T,R){function U(J,ce){if(!le(J))throw new TypeError;if(!F(ce)&&!Je(ce))throw new TypeError;ve(T,R,J,ce)}return U}n("metadata",$);function b(T,R,U,J){if(!le(U))throw new TypeError;return F(J)||(J=D(J)),ve(T,R,U,J)}n("defineMetadata",b);function z(T,R,U){if(!le(R))throw new TypeError;return F(U)||(U=D(U)),B(T,R,U)}n("hasMetadata",z);function A(T,R,U){if(!le(R))throw new TypeError;return F(U)||(U=D(U)),oe(T,R,U)}n("hasOwnMetadata",A);function N(T,R,U){if(!le(R))throw new TypeError;return F(U)||(U=D(U)),ae(T,R,U)}n("getMetadata",N);function O(T,R,U){if(!le(R))throw new TypeError;return F(U)||(U=D(U)),se(T,R,U)}n("getOwnMetadata",O);function L(T,R){if(!le(T))throw new TypeError;return F(R)||(R=D(R)),Ce(T,R)}n("getMetadataKeys",L);function C(T,R){if(!le(T))throw new TypeError;return F(R)||(R=D(R)),Ne(T,R)}n("getOwnMetadataKeys",C);function P(T,R,U){if(!le(R))throw new TypeError;if(F(U)||(U=D(U)),!le(R))throw new TypeError;F(U)||(U=D(U));var J=wr(R,U,!1);return F(J)?!1:J.OrdinaryDeleteMetadata(T,R,U)}n("deleteMetadata",P);function M(T,R){for(var U=T.length-1;U>=0;--U){var J=T[U],ce=J(R);if(!F(ce)&&!Be(ce)){if(!pe(ce))throw new TypeError;R=ce}}return R}function K(T,R,U,J){for(var ce=T.length-1;ce>=0;--ce){var Fe=T[ce],Ze=Fe(R,U,J);if(!F(Ze)&&!Be(Ze)){if(!le(Ze))throw new TypeError;J=Ze}}return J}function B(T,R,U){var J=oe(T,R,U);if(J)return!0;var ce=$e(R);return Be(ce)?!1:B(T,ce,U)}function oe(T,R,U){var J=wr(R,U,!1);return F(J)?!1:ci(J.OrdinaryHasOwnMetadata(T,R,U))}function ae(T,R,U){var J=oe(T,R,U);if(J)return se(T,R,U);var ce=$e(R);if(!Be(ce))return ae(T,ce,U)}function se(T,R,U){var J=wr(R,U,!1);if(!F(J))return J.OrdinaryGetOwnMetadata(T,R,U)}function ve(T,R,U,J){var ce=wr(U,J,!0);ce.OrdinaryDefineOwnMetadata(T,R,U,J)}function Ce(T,R){var U=Ne(T,R),J=$e(T);if(J===null)return U;var ce=Ce(J,R);if(ce.length<=0)return U;if(U.length<=0)return ce;for(var Fe=new m,Ze=[],be=0,Y=U;be<Y.length;be++){var te=Y[be],re=Fe.has(te);re||(Fe.add(te),Ze.push(te))}for(var ie=0,we=ce;ie<we.length;ie++){var te=we[ie],re=Fe.has(te);re||(Fe.add(te),Ze.push(te))}return Ze}function Ne(T,R){var U=wr(T,R,!1);return U?U.OrdinaryOwnMetadataKeys(T,R):[]}function We(T){if(T===null)return 1;switch(typeof T){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return T===null?1:6;default:return 6}}function F(T){return T===void 0}function Be(T){return T===null}function Mt(T){return typeof T=="symbol"}function le(T){return typeof T=="object"?T!==null:typeof T=="function"}function St(T,R){switch(We(T)){case 0:return T;case 1:return T;case 2:return T;case 3:return T;case 4:return T;case 5:return T}var U="string",J=cu(T,a);if(J!==void 0){var ce=J.call(T,U);if(le(ce))throw new TypeError;return ce}return po(T)}function po(T,R){var U,J,ce;{var Fe=T.toString;if(V(Fe)){var J=Fe.call(T);if(!le(J))return J}var U=T.valueOf;if(V(U)){var J=U.call(T);if(!le(J))return J}}throw new TypeError}function ci(T){return!!T}function li(T){return""+T}function D(T){var R=St(T);return Mt(R)?R:li(R)}function Z(T){return Array.isArray?Array.isArray(T):T instanceof Object?T instanceof Array:Object.prototype.toString.call(T)==="[object Array]"}function V(T){return typeof T=="function"}function pe(T){return typeof T=="function"}function Je(T){switch(We(T)){case 3:return!0;case 4:return!0;default:return!1}}function Xe(T,R){return T===R||T!==T&&R!==R}function cu(T,R){var U=T[R];if(U!=null){if(!V(U))throw new TypeError;return U}}function lu(T){var R=cu(T,c);if(!V(R))throw new TypeError;var U=R.call(T);if(!le(U))throw new TypeError;return U}function ze(T){return T.value}function ke(T){var R=T.next();return R.done?!1:R}function ui(T){var R=T.return;R&&R.call(T)}function $e(T){var R=Object.getPrototypeOf(T);if(typeof T!="function"||T===p||R!==p)return R;var U=T.prototype,J=U&&Object.getPrototypeOf(U);if(J==null||J===Object.prototype)return R;var ce=J.constructor;return typeof ce!="function"||ce===T?R:ce}function Ae(){var T;!F(w)&&typeof r.Reflect<"u"&&!(w in r.Reflect)&&typeof r.Reflect.defineMetadata=="function"&&(T=zt(r.Reflect));var R,U,J,ce=new y,Fe={registerProvider:Ze,getProvider:Y,setProvider:re};return Fe;function Ze(ie){if(!Object.isExtensible(Fe))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case T===ie:break;case F(R):R=ie;break;case R===ie:break;case F(U):U=ie;break;case U===ie:break;default:J===void 0&&(J=new m),J.add(ie);break}}function be(ie,we){if(!F(R)){if(R.isProviderFor(ie,we))return R;if(!F(U)){if(U.isProviderFor(ie,we))return R;if(!F(J))for(var Te=lu(J);;){var He=ke(Te);if(!He)return;var Ft=ze(He);if(Ft.isProviderFor(ie,we))return ui(Te),Ft}}}if(!F(T)&&T.isProviderFor(ie,we))return T}function Y(ie,we){var Te=ce.get(ie),He;return F(Te)||(He=Te.get(we)),F(He)&&(He=be(ie,we),F(He)||(F(Te)&&(Te=new h,ce.set(ie,Te)),Te.set(we,He))),He}function te(ie){if(F(ie))throw new TypeError;return R===ie||U===ie||!F(J)&&J.has(ie)}function re(ie,we,Te){if(!te(Te))throw new Error("Metadata provider not registered.");var He=Y(ie,we);if(He!==Te){if(!F(He))return!1;var Ft=ce.get(ie);F(Ft)&&(Ft=new h,ce.set(ie,Ft)),Ft.set(we,Te)}return!0}}function Nn(){var T;return!F(w)&&le(r.Reflect)&&Object.isExtensible(r.Reflect)&&(T=r.Reflect[w]),F(T)&&(T=Ae()),!F(w)&&le(r.Reflect)&&Object.isExtensible(r.Reflect)&&Object.defineProperty(r.Reflect,w,{enumerable:!1,configurable:!1,writable:!1,value:T}),T}function qt(T){var R=new y,U={isProviderFor:function(te,re){var ie=R.get(te);return F(ie)?!1:ie.has(re)},OrdinaryDefineOwnMetadata:Ze,OrdinaryHasOwnMetadata:ce,OrdinaryGetOwnMetadata:Fe,OrdinaryOwnMetadataKeys:be,OrdinaryDeleteMetadata:Y};return _.registerProvider(U),U;function J(te,re,ie){var we=R.get(te),Te=!1;if(F(we)){if(!ie)return;we=new h,R.set(te,we),Te=!0}var He=we.get(re);if(F(He)){if(!ie)return;if(He=new h,we.set(re,He),!T.setProvider(te,re,U))throw we.delete(re),Te&&R.delete(te),new Error("Wrong provider for target.")}return He}function ce(te,re,ie){var we=J(re,ie,!1);return F(we)?!1:ci(we.has(te))}function Fe(te,re,ie){var we=J(re,ie,!1);if(!F(we))return we.get(te)}function Ze(te,re,ie,we){var Te=J(ie,we,!0);Te.set(te,re)}function be(te,re){var ie=[],we=J(te,re,!1);if(F(we))return ie;for(var Te=we.keys(),He=lu(Te),Ft=0;;){var ih=ke(He);if(!ih)return ie.length=Ft,ie;var t3=ze(ih);try{ie[Ft]=t3}catch(n3){try{ui(He)}finally{throw n3}}Ft++}}function Y(te,re,ie){var we=J(re,ie,!1);if(F(we)||!we.delete(te))return!1;if(we.size===0){var Te=R.get(re);F(Te)||(Te.delete(ie),Te.size===0&&R.delete(Te))}return!0}}function zt(T){var R=T.defineMetadata,U=T.hasOwnMetadata,J=T.getOwnMetadata,ce=T.getOwnMetadataKeys,Fe=T.deleteMetadata,Ze=new y,be={isProviderFor:function(Y,te){var re=Ze.get(Y);return!F(re)&&re.has(te)?!0:ce(Y,te).length?(F(re)&&(re=new m,Ze.set(Y,re)),re.add(te),!0):!1},OrdinaryDefineOwnMetadata:R,OrdinaryHasOwnMetadata:U,OrdinaryGetOwnMetadata:J,OrdinaryOwnMetadataKeys:ce,OrdinaryDeleteMetadata:Fe};return be}function wr(T,R,U){var J=_.getProvider(T,R);if(!F(J))return J;if(U){if(_.setProvider(T,R,k))return k;throw new Error("Illegal state.")}}function ta(){var T={},R=[],U=(function(){function be(Y,te,re){this._index=0,this._keys=Y,this._values=te,this._selector=re}return be.prototype["@@iterator"]=function(){return this},be.prototype[c]=function(){return this},be.prototype.next=function(){var Y=this._index;if(Y>=0&&Y<this._keys.length){var te=this._selector(this._keys[Y],this._values[Y]);return Y+1>=this._keys.length?(this._index=-1,this._keys=R,this._values=R):this._index++,{value:te,done:!1}}return{value:void 0,done:!0}},be.prototype.throw=function(Y){throw this._index>=0&&(this._index=-1,this._keys=R,this._values=R),Y},be.prototype.return=function(Y){return this._index>=0&&(this._index=-1,this._keys=R,this._values=R),{value:Y,done:!0}},be})(),J=(function(){function be(){this._keys=[],this._values=[],this._cacheKey=T,this._cacheIndex=-2}return Object.defineProperty(be.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),be.prototype.has=function(Y){return this._find(Y,!1)>=0},be.prototype.get=function(Y){var te=this._find(Y,!1);return te>=0?this._values[te]:void 0},be.prototype.set=function(Y,te){var re=this._find(Y,!0);return this._values[re]=te,this},be.prototype.delete=function(Y){var te=this._find(Y,!1);if(te>=0){for(var re=this._keys.length,ie=te+1;ie<re;ie++)this._keys[ie-1]=this._keys[ie],this._values[ie-1]=this._values[ie];return this._keys.length--,this._values.length--,Xe(Y,this._cacheKey)&&(this._cacheKey=T,this._cacheIndex=-2),!0}return!1},be.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=T,this._cacheIndex=-2},be.prototype.keys=function(){return new U(this._keys,this._values,ce)},be.prototype.values=function(){return new U(this._keys,this._values,Fe)},be.prototype.entries=function(){return new U(this._keys,this._values,Ze)},be.prototype["@@iterator"]=function(){return this.entries()},be.prototype[c]=function(){return this.entries()},be.prototype._find=function(Y,te){if(!Xe(this._cacheKey,Y)){this._cacheIndex=-1;for(var re=0;re<this._keys.length;re++)if(Xe(this._keys[re],Y)){this._cacheIndex=re;break}}return this._cacheIndex<0&&te&&(this._cacheIndex=this._keys.length,this._keys.push(Y),this._values.push(void 0)),this._cacheIndex},be})();return J;function ce(be,Y){return be}function Fe(be,Y){return Y}function Ze(be,Y){return[be,Y]}}function uu(){var T=(function(){function R(){this._map=new h}return Object.defineProperty(R.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),R.prototype.has=function(U){return this._map.has(U)},R.prototype.add=function(U){return this._map.set(U,U),this},R.prototype.delete=function(U){return this._map.delete(U)},R.prototype.clear=function(){this._map.clear()},R.prototype.keys=function(){return this._map.keys()},R.prototype.values=function(){return this._map.keys()},R.prototype.entries=function(){return this._map.entries()},R.prototype["@@iterator"]=function(){return this.keys()},R.prototype[c]=function(){return this.keys()},R})();return T}function e3(){var T=16,R=f.create(),U=J();return(function(){function Y(){this._key=J()}return Y.prototype.has=function(te){var re=ce(te,!1);return re!==void 0?f.has(re,this._key):!1},Y.prototype.get=function(te){var re=ce(te,!1);return re!==void 0?f.get(re,this._key):void 0},Y.prototype.set=function(te,re){var ie=ce(te,!0);return ie[this._key]=re,this},Y.prototype.delete=function(te){var re=ce(te,!1);return re!==void 0?delete re[this._key]:!1},Y.prototype.clear=function(){this._key=J()},Y})();function J(){var Y;do Y="@@WeakMap@@"+be();while(f.has(R,Y));return R[Y]=!0,Y}function ce(Y,te){if(!i.call(Y,U)){if(!te)return;Object.defineProperty(Y,U,{value:f.create()})}return Y[U]}function Fe(Y,te){for(var re=0;re<te;++re)Y[re]=Math.random()*255|0;return Y}function Ze(Y){if(typeof Uint8Array=="function"){var te=new Uint8Array(Y);return typeof crypto<"u"?crypto.getRandomValues(te):typeof msCrypto<"u"?msCrypto.getRandomValues(te):Fe(te,Y),te}return Fe(new Array(Y),Y)}function be(){var Y=Ze(T);Y[6]=Y[6]&79|64,Y[8]=Y[8]&191|128;for(var te="",re=0;re<T;++re){var ie=Y[re];(re===4||re===6||re===8)&&(te+="-"),ie<16&&(te+="0"),te+=ie.toString(16).toLowerCase()}return te}}function du(T){return T.__=void 0,delete T.__,T}})})(t||(t={})),Qh}H8();const V8="[object ArrayBuffer]";class W{static isArrayBuffer(e){return Object.prototype.toString.call(e)===V8}static toArrayBuffer(e){return this.isArrayBuffer(e)?e:e.byteLength===e.buffer.byteLength||e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:this.toUint8Array(e.buffer).slice(e.byteOffset,e.byteOffset+e.byteLength).buffer}static toUint8Array(e){return this.toView(e,Uint8Array)}static toView(e,n){if(e.constructor===n)return e;if(this.isArrayBuffer(e))return new n(e);if(this.isArrayBufferView(e))return new n(e.buffer,e.byteOffset,e.byteLength);throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")}static isBufferSource(e){return this.isArrayBufferView(e)||this.isArrayBuffer(e)}static isArrayBufferView(e){return ArrayBuffer.isView(e)||e&&this.isArrayBuffer(e.buffer)}static isEqual(e,n){const r=W.toUint8Array(e),i=W.toUint8Array(n);if(r.length!==i.byteLength)return!1;for(let s=0;s<r.length;s++)if(r[s]!==i[s])return!1;return!0}static concat(...e){let n;Array.isArray(e[0])&&!(e[1]instanceof Function)||Array.isArray(e[0])&&e[1]instanceof Function?n=e[0]:e[e.length-1]instanceof Function?n=e.slice(0,e.length-1):n=e;let r=0;for(const a of n)r+=a.byteLength;const i=new Uint8Array(r);let s=0;for(const a of n){const c=this.toUint8Array(a);i.set(c,s),s+=c.length}return e[e.length-1]instanceof Function?this.toView(i,e[e.length-1]):i.buffer}}const mu="string",K8=/^[0-9a-f\s]+$/i,G8=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,W8=/^[a-zA-Z0-9-_]+$/;class tg{static fromString(e){const n=unescape(encodeURIComponent(e)),r=new Uint8Array(n.length);for(let i=0;i<n.length;i++)r[i]=n.charCodeAt(i);return r.buffer}static toString(e){const n=W.toUint8Array(e);let r="";for(let s=0;s<n.length;s++)r+=String.fromCharCode(n[s]);return decodeURIComponent(escape(r))}}class pn{static toString(e,n=!1){const r=W.toArrayBuffer(e),i=new DataView(r);let s="";for(let a=0;a<r.byteLength;a+=2){const c=i.getUint16(a,n);s+=String.fromCharCode(c)}return s}static fromString(e,n=!1){const r=new ArrayBuffer(e.length*2),i=new DataView(r);for(let s=0;s<e.length;s++)i.setUint16(s*2,e.charCodeAt(s),n);return r}}class ne{static isHex(e){return typeof e===mu&&K8.test(e)}static isBase64(e){return typeof e===mu&&G8.test(e)}static isBase64Url(e){return typeof e===mu&&W8.test(e)}static ToString(e,n="utf8"){const r=W.toUint8Array(e);switch(n.toLowerCase()){case"utf8":return this.ToUtf8String(r);case"binary":return this.ToBinary(r);case"hex":return this.ToHex(r);case"base64":return this.ToBase64(r);case"base64url":return this.ToBase64Url(r);case"utf16le":return pn.toString(r,!0);case"utf16":case"utf16be":return pn.toString(r);default:throw new Error(`Unknown type of encoding '${n}'`)}}static FromString(e,n="utf8"){if(!e)return new ArrayBuffer(0);switch(n.toLowerCase()){case"utf8":return this.FromUtf8String(e);case"binary":return this.FromBinary(e);case"hex":return this.FromHex(e);case"base64":return this.FromBase64(e);case"base64url":return this.FromBase64Url(e);case"utf16le":return pn.fromString(e,!0);case"utf16":case"utf16be":return pn.fromString(e);default:throw new Error(`Unknown type of encoding '${n}'`)}}static ToBase64(e){const n=W.toUint8Array(e);if(typeof btoa<"u"){const r=this.ToString(n,"binary");return btoa(r)}else return Buffer.from(n).toString("base64")}static FromBase64(e){const n=this.formatString(e);if(!n)return new ArrayBuffer(0);if(!ne.isBase64(n))throw new TypeError("Argument 'base64Text' is not Base64 encoded");return typeof atob<"u"?this.FromBinary(atob(n)):new Uint8Array(Buffer.from(n,"base64")).buffer}static FromBase64Url(e){const n=this.formatString(e);if(!n)return new ArrayBuffer(0);if(!ne.isBase64Url(n))throw new TypeError("Argument 'base64url' is not Base64Url encoded");return this.FromBase64(this.Base64Padding(n.replace(/\-/g,"+").replace(/\_/g,"/")))}static ToBase64Url(e){return this.ToBase64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}static FromUtf8String(e,n=ne.DEFAULT_UTF8_ENCODING){switch(n){case"ascii":return this.FromBinary(e);case"utf8":return tg.fromString(e);case"utf16":case"utf16be":return pn.fromString(e);case"utf16le":case"usc2":return pn.fromString(e,!0);default:throw new Error(`Unknown type of encoding '${n}'`)}}static ToUtf8String(e,n=ne.DEFAULT_UTF8_ENCODING){switch(n){case"ascii":return this.ToBinary(e);case"utf8":return tg.toString(e);case"utf16":case"utf16be":return pn.toString(e);case"utf16le":case"usc2":return pn.toString(e,!0);default:throw new Error(`Unknown type of encoding '${n}'`)}}static FromBinary(e){const n=e.length,r=new Uint8Array(n);for(let i=0;i<n;i++)r[i]=e.charCodeAt(i);return r.buffer}static ToBinary(e){const n=W.toUint8Array(e);let r="";for(let i=0;i<n.length;i++)r+=String.fromCharCode(n[i]);return r}static ToHex(e){const n=W.toUint8Array(e);let r="";const i=n.length;for(let s=0;s<i;s++){const a=n[s];a<16&&(r+="0"),r+=a.toString(16)}return r}static FromHex(e){let n=this.formatString(e);if(!n)return new ArrayBuffer(0);if(!ne.isHex(n))throw new TypeError("Argument 'hexString' is not HEX encoded");n.length%2&&(n=`0${n}`);const r=new Uint8Array(n.length/2);for(let i=0;i<n.length;i=i+2){const s=n.slice(i,i+2);r[i/2]=parseInt(s,16)}return r.buffer}static ToUtf16String(e,n=!1){return pn.toString(e,n)}static FromUtf16String(e,n=!1){return pn.fromString(e,n)}static Base64Padding(e){const n=4-e.length%4;if(n<4)for(let r=0;r<n;r++)e+="=";return e}static formatString(e){return e?.replace(/[\n\r\t ]/g,"")||""}}ne.DEFAULT_UTF8_ENCODING="utf8";function J8(...t){const e=t.map(i=>i.byteLength).reduce((i,s)=>i+s),n=new Uint8Array(e);let r=0;return t.map(i=>new Uint8Array(i)).forEach(i=>{for(const s of i)n[r++]=s}),n.buffer}function Zb(t,e){if(!(t&&e)||t.byteLength!==e.byteLength)return!1;const n=new Uint8Array(t),r=new Uint8Array(e);for(let i=0;i<t.byteLength;i++)if(n[i]!==r[i])return!1;return!0}function Li(t,e){let n=0;if(t.length===1)return t[0];for(let r=t.length-1;r>=0;r--)n+=t[t.length-1-r]*Math.pow(2,e*r);return n}function Ur(t,e,n=-1){const r=n;let i=t,s=0,a=Math.pow(2,e);for(let c=1;c<8;c++){if(t<a){let l;if(r<0)l=new ArrayBuffer(c),s=c;else{if(r<c)return new ArrayBuffer(0);l=new ArrayBuffer(r),s=r}const u=new Uint8Array(l);for(let d=c-1;d>=0;d--){const f=Math.pow(2,d*e);u[s-d-1]=Math.floor(i/f),i-=u[s-d-1]*f}return l}a*=Math.pow(2,e)}return new ArrayBuffer(0)}function Ld(...t){let e=0,n=0;for(const s of t)e+=s.length;const r=new ArrayBuffer(e),i=new Uint8Array(r);for(const s of t)i.set(s,n),n+=s.length;return i}function Yb(){const t=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){const c=t[0]===255&&t[1]&128,l=t[0]===0&&(t[1]&128)===0;(c||l)&&this.warnings.push("Needlessly long format")}const e=new ArrayBuffer(this.valueHex.byteLength),n=new Uint8Array(e);for(let c=0;c<this.valueHex.byteLength;c++)n[c]=0;n[0]=t[0]&128;const r=Li(n,8),i=new ArrayBuffer(this.valueHex.byteLength),s=new Uint8Array(i);for(let c=0;c<this.valueHex.byteLength;c++)s[c]=t[c];return s[0]&=127,Li(s,8)-r}function X8(t){const e=t<0?t*-1:t;let n=128;for(let r=1;r<8;r++){if(e<=n){if(t<0){const a=n-e,c=Ur(a,8,r),l=new Uint8Array(c);return l[0]|=128,c}let i=Ur(e,8,r),s=new Uint8Array(i);if(s[0]&128){const a=i.slice(0),c=new Uint8Array(a);i=new ArrayBuffer(i.byteLength+1),s=new Uint8Array(i);for(let l=0;l<a.byteLength;l++)s[l+1]=c[l];s[0]=0}return i}n*=Math.pow(2,8)}return new ArrayBuffer(0)}function Z8(t,e){if(t.byteLength!==e.byteLength)return!1;const n=new Uint8Array(t),r=new Uint8Array(e);for(let i=0;i<n.length;i++)if(n[i]!==r[i])return!1;return!0}function At(t,e){const n=t.toString(10);if(e<n.length)return"";const r=e-n.length,i=new Array(r);for(let a=0;a<r;a++)i[a]="0";return i.join("").concat(n)}function sc(){if(typeof BigInt>"u")throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function M0(t){let e=0,n=0;for(let i=0;i<t.length;i++){const s=t[i];e+=s.byteLength}const r=new Uint8Array(e);for(let i=0;i<t.length;i++){const s=t[i];r.set(new Uint8Array(s),n),n+=s.byteLength}return r.buffer}function Kn(t,e,n,r){return e instanceof Uint8Array?e.byteLength?n<0?(t.error="Wrong parameter: inputOffset less than zero",!1):r<0?(t.error="Wrong parameter: inputLength less than zero",!1):e.byteLength-n-r<0?(t.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):!0:(t.error="Wrong parameter: inputBuffer has zero length",!1):(t.error="Wrong parameter: inputBuffer must be 'Uint8Array'",!1)}class ol{constructor(){this.items=[]}write(e){this.items.push(e)}final(){return M0(this.items)}}const ho=[new Uint8Array([1])],ng="0123456789",_u="name",rg="valueHexView",Y8="isHexOnly",Q8="idBlock",ex="tagClass",tx="tagNumber",nx="isConstructed",rx="fromBER",ix="toBER",ox="local",wt="",vn=new ArrayBuffer(0),sl=new Uint8Array(0),os="EndOfContent",Qb="OCTET STRING",e2="BIT STRING";function xn(t){var e;return e=class extends t{get valueHex(){return this.valueHexView.slice().buffer}set valueHex(r){this.valueHexView=new Uint8Array(r)}constructor(...r){var i;super(...r);const s=r[0]||{};this.isHexOnly=(i=s.isHexOnly)!==null&&i!==void 0?i:!1,this.valueHexView=s.valueHex?W.toUint8Array(s.valueHex):sl}fromBER(r,i,s){const a=r instanceof ArrayBuffer?new Uint8Array(r):r;if(!Kn(this,a,i,s))return-1;const c=i+s;return this.valueHexView=a.subarray(i,c),this.valueHexView.length?(this.blockLength=s,c):(this.warnings.push("Zero buffer length"),i)}toBER(r=!1){return this.isHexOnly?r?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.byteLength===this.valueHexView.buffer.byteLength?this.valueHexView.buffer:this.valueHexView.slice().buffer:(this.error="Flag 'isHexOnly' is not set, abort",vn)}toJSON(){return{...super.toJSON(),isHexOnly:this.isHexOnly,valueHex:ne.ToHex(this.valueHexView)}}},e.NAME="hexBlock",e}class ii{static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(e){this.valueBeforeDecodeView=new Uint8Array(e)}constructor({blockLength:e=0,error:n=wt,warnings:r=[],valueBeforeDecode:i=sl}={}){this.blockLength=e,this.error=n,this.warnings=r,this.valueBeforeDecodeView=W.toUint8Array(i)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:ne.ToHex(this.valueBeforeDecodeView)}}}ii.NAME="baseBlock";class _t extends ii{fromBER(e,n,r){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}toBER(e,n){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}}_t.NAME="valueBlock";class t2 extends xn(ii){constructor({idBlock:e={}}={}){var n,r,i,s;super(),e?(this.isHexOnly=(n=e.isHexOnly)!==null&&n!==void 0?n:!1,this.valueHexView=e.valueHex?W.toUint8Array(e.valueHex):sl,this.tagClass=(r=e.tagClass)!==null&&r!==void 0?r:-1,this.tagNumber=(i=e.tagNumber)!==null&&i!==void 0?i:-1,this.isConstructed=(s=e.isConstructed)!==null&&s!==void 0?s:!1):(this.tagClass=-1,this.tagNumber=-1,this.isConstructed=!1)}toBER(e=!1){let n=0;switch(this.tagClass){case 1:n|=0;break;case 2:n|=64;break;case 3:n|=128;break;case 4:n|=192;break;default:return this.error="Unknown tag class",vn}if(this.isConstructed&&(n|=32),this.tagNumber<31&&!this.isHexOnly){const i=new Uint8Array(1);if(!e){let s=this.tagNumber;s&=31,n|=s,i[0]=n}return i.buffer}if(!this.isHexOnly){const i=Ur(this.tagNumber,7),s=new Uint8Array(i),a=i.byteLength,c=new Uint8Array(a+1);if(c[0]=n|31,!e){for(let l=0;l<a-1;l++)c[l+1]=s[l]|128;c[a]=s[a-1]}return c.buffer}const r=new Uint8Array(this.valueHexView.byteLength+1);if(r[0]=n|31,!e){const i=this.valueHexView;for(let s=0;s<i.length-1;s++)r[s+1]=i[s]|128;r[this.valueHexView.byteLength]=i[i.length-1]}return r.buffer}fromBER(e,n,r){const i=W.toUint8Array(e);if(!Kn(this,i,n,r))return-1;const s=i.subarray(n,n+r);if(s.length===0)return this.error="Zero buffer length",-1;switch(s[0]&192){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:return this.error="Unknown tag class",-1}this.isConstructed=(s[0]&32)===32,this.isHexOnly=!1;const c=s[0]&31;if(c!==31)this.tagNumber=c,this.blockLength=1;else{let l=1,u=this.valueHexView=new Uint8Array(255),d=255;for(;s[l]&128;){if(u[l-1]=s[l]&127,l++,l>=s.length)return this.error="End of input reached before message was fully decoded",-1;if(l===d){d+=255;const p=new Uint8Array(d);for(let h=0;h<u.length;h++)p[h]=u[h];u=this.valueHexView=new Uint8Array(d)}}this.blockLength=l+1,u[l-1]=s[l]&127;const f=new Uint8Array(l);for(let p=0;p<l;p++)f[p]=u[p];u=this.valueHexView=new Uint8Array(l),u.set(f),this.blockLength<=9?this.tagNumber=Li(u,7):(this.isHexOnly=!0,this.warnings.push("Tag too long, represented as hex-coded"))}if(this.tagClass===1&&this.isConstructed)switch(this.tagNumber){case 1:case 2:case 5:case 6:case 9:case 13:case 14:case 23:case 24:case 31:case 32:case 33:case 34:return this.error="Constructed encoding used for primitive type",-1}return n+this.blockLength}toJSON(){return{...super.toJSON(),tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed}}}t2.NAME="identificationBlock";class n2 extends ii{constructor({lenBlock:e={}}={}){var n,r,i;super(),this.isIndefiniteForm=(n=e.isIndefiniteForm)!==null&&n!==void 0?n:!1,this.longFormUsed=(r=e.longFormUsed)!==null&&r!==void 0?r:!1,this.length=(i=e.length)!==null&&i!==void 0?i:0}fromBER(e,n,r){const i=W.toUint8Array(e);if(!Kn(this,i,n,r))return-1;const s=i.subarray(n,n+r);if(s.length===0)return this.error="Zero buffer length",-1;if(s[0]===255)return this.error="Length block 0xFF is reserved by standard",-1;if(this.isIndefiniteForm=s[0]===128,this.isIndefiniteForm)return this.blockLength=1,n+this.blockLength;if(this.longFormUsed=!!(s[0]&128),this.longFormUsed===!1)return this.length=s[0],this.blockLength=1,n+this.blockLength;const a=s[0]&127;if(a>8)return this.error="Too big integer",-1;if(a+1>s.length)return this.error="End of input reached before message was fully decoded",-1;const c=n+1,l=i.subarray(c,c+a);return l[a-1]===0&&this.warnings.push("Needlessly long encoded length"),this.length=Li(l,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=a+1,n+this.blockLength}toBER(e=!1){let n,r;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return n=new ArrayBuffer(1),e===!1&&(r=new Uint8Array(n),r[0]=128),n;if(this.longFormUsed){const i=Ur(this.length,8);if(i.byteLength>127)return this.error="Too big length",vn;if(n=new ArrayBuffer(i.byteLength+1),e)return n;const s=new Uint8Array(i);r=new Uint8Array(n),r[0]=i.byteLength|128;for(let a=0;a<i.byteLength;a++)r[a+1]=s[a];return n}return n=new ArrayBuffer(1),e===!1&&(r=new Uint8Array(n),r[0]=this.length),n}toJSON(){return{...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length}}}n2.NAME="lengthBlock";const ee={};class ot extends ii{constructor({name:e=wt,optional:n=!1,primitiveSchema:r,...i}={},s){super(i),this.name=e,this.optional=n,r&&(this.primitiveSchema=r),this.idBlock=new t2(i),this.lenBlock=new n2(i),this.valueBlock=s?new s(i):new _t(i)}fromBER(e,n,r){const i=this.valueBlock.fromBER(e,n,this.lenBlock.isIndefiniteForm?r:this.lenBlock.length);return i===-1?(this.error=this.valueBlock.error,i):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),i)}toBER(e,n){const r=n||new ol;n||r2(this);const i=this.idBlock.toBER(e);if(r.write(i),this.lenBlock.isIndefiniteForm)r.write(new Uint8Array([128]).buffer),this.valueBlock.toBER(e,r),r.write(new ArrayBuffer(2));else{const s=this.valueBlock.toBER(e);this.lenBlock.length=s.byteLength;const a=this.lenBlock.toBER(e);r.write(a),r.write(s)}return n?vn:r.final()}toJSON(){const e={...super.toJSON(),idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional};return this.primitiveSchema&&(e.primitiveSchema=this.primitiveSchema.toJSON()),e}toString(e="ascii"){return e==="ascii"?this.onAsciiEncoding():ne.ToHex(this.toBER())}onAsciiEncoding(){const e=this.constructor.NAME,n=ne.ToHex(this.valueBlock.valueBeforeDecodeView);return`${e} : ${n}`}isEqual(e){if(this===e)return!0;if(!(e instanceof this.constructor))return!1;const n=this.toBER(),r=e.toBER();return Z8(n,r)}}ot.NAME="BaseBlock";function r2(t){var e;if(t instanceof ee.Constructed)for(const n of t.valueBlock.value)r2(n)&&(t.lenBlock.isIndefiniteForm=!0);return!!(!((e=t.lenBlock)===null||e===void 0)&&e.isIndefiniteForm)}class q0 extends ot{getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor({value:e=wt,...n}={},r){super(n,r),e&&this.fromString(e)}fromBER(e,n,r){const i=this.valueBlock.fromBER(e,n,this.lenBlock.isIndefiniteForm?r:this.lenBlock.length);return i===-1?(this.error=this.valueBlock.error,i):(this.fromBuffer(this.valueBlock.valueHexView),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),i)}onAsciiEncoding(){return`${this.constructor.NAME} : '${this.valueBlock.value}'`}}q0.NAME="BaseStringBlock";class i2 extends xn(_t){constructor({isHexOnly:e=!0,...n}={}){super(n),this.isHexOnly=e}}i2.NAME="PrimitiveValueBlock";var o2;class Ns extends ot{constructor(e={}){super(e,i2),this.idBlock.isConstructed=!1}}o2=Ns;ee.Primitive=o2;Ns.NAME="PRIMITIVE";function sx(t,e){if(t instanceof e)return t;const n=new e;return n.idBlock=t.idBlock,n.lenBlock=t.lenBlock,n.warnings=t.warnings,n.valueBeforeDecodeView=t.valueBeforeDecodeView,n}function Qi(t,e=0,n=t.length){const r=e;let i=new ot({},_t);const s=new ii;if(!Kn(s,t,e,n))return i.error=s.error,{offset:-1,result:i};if(!t.subarray(e,e+n).length)return i.error="Zero buffer length",{offset:-1,result:i};let c=i.idBlock.fromBER(t,e,n);if(i.idBlock.warnings.length&&i.warnings.concat(i.idBlock.warnings),c===-1)return i.error=i.idBlock.error,{offset:-1,result:i};if(e=c,n-=i.idBlock.blockLength,c=i.lenBlock.fromBER(t,e,n),i.lenBlock.warnings.length&&i.warnings.concat(i.lenBlock.warnings),c===-1)return i.error=i.lenBlock.error,{offset:-1,result:i};if(e=c,n-=i.lenBlock.blockLength,!i.idBlock.isConstructed&&i.lenBlock.isIndefiniteForm)return i.error="Indefinite length form used for primitive encoding form",{offset:-1,result:i};let l=ot;switch(i.idBlock.tagClass){case 1:if(i.idBlock.tagNumber>=37&&i.idBlock.isHexOnly===!1)return i.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard",{offset:-1,result:i};switch(i.idBlock.tagNumber){case 0:if(i.idBlock.isConstructed&&i.lenBlock.length>0)return i.error="Type [UNIVERSAL 0] is reserved",{offset:-1,result:i};l=ee.EndOfContent;break;case 1:l=ee.Boolean;break;case 2:l=ee.Integer;break;case 3:l=ee.BitString;break;case 4:l=ee.OctetString;break;case 5:l=ee.Null;break;case 6:l=ee.ObjectIdentifier;break;case 10:l=ee.Enumerated;break;case 12:l=ee.Utf8String;break;case 13:l=ee.RelativeObjectIdentifier;break;case 14:l=ee.TIME;break;case 15:return i.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:i};case 16:l=ee.Sequence;break;case 17:l=ee.Set;break;case 18:l=ee.NumericString;break;case 19:l=ee.PrintableString;break;case 20:l=ee.TeletexString;break;case 21:l=ee.VideotexString;break;case 22:l=ee.IA5String;break;case 23:l=ee.UTCTime;break;case 24:l=ee.GeneralizedTime;break;case 25:l=ee.GraphicString;break;case 26:l=ee.VisibleString;break;case 27:l=ee.GeneralString;break;case 28:l=ee.UniversalString;break;case 29:l=ee.CharacterString;break;case 30:l=ee.BmpString;break;case 31:l=ee.DATE;break;case 32:l=ee.TimeOfDay;break;case 33:l=ee.DateTime;break;case 34:l=ee.Duration;break;default:{const u=i.idBlock.isConstructed?new ee.Constructed:new ee.Primitive;u.idBlock=i.idBlock,u.lenBlock=i.lenBlock,u.warnings=i.warnings,i=u}}break;default:l=i.idBlock.isConstructed?ee.Constructed:ee.Primitive}return i=sx(i,l),c=i.fromBER(t,e,i.lenBlock.isIndefiniteForm?n:i.lenBlock.length),i.valueBeforeDecodeView=t.subarray(r,r+i.blockLength),{offset:c,result:i}}function Ci(t){if(!t.byteLength){const e=new ot({},_t);return e.error="Input buffer has zero length",{offset:-1,result:e}}return Qi(W.toUint8Array(t).slice(),0,t.byteLength)}function ax(t,e){return t?1:e}class or extends _t{constructor({value:e=[],isIndefiniteForm:n=!1,...r}={}){super(r),this.value=e,this.isIndefiniteForm=n}fromBER(e,n,r){const i=W.toUint8Array(e);if(!Kn(this,i,n,r))return-1;if(this.valueBeforeDecodeView=i.subarray(n,n+r),this.valueBeforeDecodeView.length===0)return this.warnings.push("Zero buffer length"),n;let s=n;for(;ax(this.isIndefiniteForm,r)>0;){const a=Qi(i,s,r);if(a.offset===-1)return this.error=a.result.error,this.warnings.concat(a.result.warnings),-1;if(s=a.offset,this.blockLength+=a.result.blockLength,r-=a.result.blockLength,this.value.push(a.result),this.isIndefiniteForm&&a.result.constructor.NAME===os)break}return this.isIndefiniteForm&&(this.value[this.value.length-1].constructor.NAME===os?this.value.pop():this.warnings.push("No EndOfContent block encoded")),s}toBER(e,n){const r=n||new ol;for(let i=0;i<this.value.length;i++)this.value[i].toBER(e,r);return n?vn:r.final()}toJSON(){const e={...super.toJSON(),isIndefiniteForm:this.isIndefiniteForm,value:[]};for(const n of this.value)e.value.push(n.toJSON());return e}}or.NAME="ConstructedValueBlock";var s2;class mt extends ot{constructor(e={}){super(e,or),this.idBlock.isConstructed=!0}fromBER(e,n,r){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;const i=this.valueBlock.fromBER(e,n,this.lenBlock.isIndefiniteForm?r:this.lenBlock.length);return i===-1?(this.error=this.valueBlock.error,i):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),i)}onAsciiEncoding(){const e=[];for(const r of this.valueBlock.value)e.push(r.toString("ascii").split(`
|
|
68
|
+
`).map(i=>` ${i}`).join(`
|
|
69
|
+
`));const n=this.idBlock.tagClass===3?`[${this.idBlock.tagNumber}]`:this.constructor.NAME;return e.length?`${n} :
|
|
70
|
+
${e.join(`
|
|
71
|
+
`)}`:`${n} :`}}s2=mt;ee.Constructed=s2;mt.NAME="CONSTRUCTED";class a2 extends _t{fromBER(e,n,r){return n}toBER(e){return vn}}a2.override="EndOfContentValueBlock";var c2;class F0 extends ot{constructor(e={}){super(e,a2),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}}c2=F0;ee.EndOfContent=c2;F0.NAME=os;var l2;class Mr extends ot{constructor(e={}){super(e,_t),this.idBlock.tagClass=1,this.idBlock.tagNumber=5}fromBER(e,n,r){return this.lenBlock.length>0&&this.warnings.push("Non-zero length of value block for Null type"),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.blockLength+=r,n+r>e.byteLength?(this.error="End of input reached before message was fully decoded (inconsistent offset and length values)",-1):n+r}toBER(e,n){const r=new ArrayBuffer(2);if(!e){const i=new Uint8Array(r);i[0]=5,i[1]=0}return n&&n.write(r),r}onAsciiEncoding(){return`${this.constructor.NAME}`}}l2=Mr;ee.Null=l2;Mr.NAME="NULL";class u2 extends xn(_t){get value(){for(const e of this.valueHexView)if(e>0)return!0;return!1}set value(e){this.valueHexView[0]=e?255:0}constructor({value:e,...n}={}){super(n),n.valueHex?this.valueHexView=W.toUint8Array(n.valueHex):this.valueHexView=new Uint8Array(1),e&&(this.value=e)}fromBER(e,n,r){const i=W.toUint8Array(e);return Kn(this,i,n,r)?(this.valueHexView=i.subarray(n,n+r),r>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=!0,Yb.call(this),this.blockLength=r,n+r):-1}toBER(){return this.valueHexView.slice()}toJSON(){return{...super.toJSON(),value:this.value}}}u2.NAME="BooleanValueBlock";var d2;let al=class extends ot{getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}constructor(e={}){super(e,u2),this.idBlock.tagClass=1,this.idBlock.tagNumber=1}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}};d2=al;ee.Boolean=d2;al.NAME="BOOLEAN";class p2 extends xn(or){constructor({isConstructed:e=!1,...n}={}){super(n),this.isConstructed=e}fromBER(e,n,r){let i=0;if(this.isConstructed){if(this.isHexOnly=!1,i=or.prototype.fromBER.call(this,e,n,r),i===-1)return i;for(let s=0;s<this.value.length;s++){const a=this.value[s].constructor.NAME;if(a===os){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if(a!==Qb)return this.error="OCTET STRING may consists of OCTET STRINGs only",-1}}else this.isHexOnly=!0,i=super.fromBER(e,n,r),this.blockLength=r;return i}toBER(e,n){return this.isConstructed?or.prototype.toBER.call(this,e,n):e?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),isConstructed:this.isConstructed}}}p2.NAME="OctetStringValueBlock";var H0;let Pr=class extends ot{constructor({idBlock:e={},lenBlock:n={},...r}={}){var i,s;(i=r.isConstructed)!==null&&i!==void 0||(r.isConstructed=!!(!((s=r.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:r.isConstructed,...e},lenBlock:{...n,isIndefiniteForm:!!r.isIndefiniteForm},...r},p2),this.idBlock.tagClass=1,this.idBlock.tagNumber=4}fromBER(e,n,r){if(this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,r===0)return this.idBlock.error.length===0&&(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length===0&&(this.blockLength+=this.lenBlock.blockLength),n;if(!this.valueBlock.isConstructed){const s=(e instanceof ArrayBuffer?new Uint8Array(e):e).subarray(n,n+r);try{if(s.byteLength){const a=Qi(s,0,s.byteLength);a.offset!==-1&&a.offset===r&&(this.valueBlock.value=[a.result])}}catch{}}return super.fromBER(e,n,r)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return mt.prototype.onAsciiEncoding.call(this);const e=this.constructor.NAME,n=ne.ToHex(this.valueBlock.valueHexView);return`${e} : ${n}`}getValue(){if(!this.idBlock.isConstructed)return this.valueBlock.valueHexView.slice().buffer;const e=[];for(const n of this.valueBlock.value)n instanceof H0&&e.push(n.valueBlock.valueHexView);return W.concat(e)}};H0=Pr;ee.OctetString=H0;Pr.NAME=Qb;class f2 extends xn(or){constructor({unusedBits:e=0,isConstructed:n=!1,...r}={}){super(r),this.unusedBits=e,this.isConstructed=n,this.blockLength=this.valueHexView.byteLength}fromBER(e,n,r){if(!r)return n;let i=-1;if(this.isConstructed){if(i=or.prototype.fromBER.call(this,e,n,r),i===-1)return i;for(const c of this.value){const l=c.constructor.NAME;if(l===os){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if(l!==e2)return this.error="BIT STRING may consists of BIT STRINGs only",-1;const u=c.valueBlock;if(this.unusedBits>0&&u.unusedBits>0)return this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only',-1;this.unusedBits=u.unusedBits}return i}const s=W.toUint8Array(e);if(!Kn(this,s,n,r))return-1;const a=s.subarray(n,n+r);if(this.unusedBits=a[0],this.unusedBits>7)return this.error="Unused bits for BitString must be in range 0-7",-1;if(!this.unusedBits){const c=a.subarray(1);try{if(c.byteLength){const l=Qi(c,0,c.byteLength);l.offset!==-1&&l.offset===r-1&&(this.value=[l.result])}}catch{}}return this.valueHexView=a.subarray(1),this.blockLength=a.length,n+r}toBER(e,n){if(this.isConstructed)return or.prototype.toBER.call(this,e,n);if(e)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength){const i=new Uint8Array(1);return i[0]=0,i.buffer}const r=new Uint8Array(this.valueHexView.length+1);return r[0]=this.unusedBits,r.set(this.valueHexView,1),r.buffer}toJSON(){return{...super.toJSON(),unusedBits:this.unusedBits,isConstructed:this.isConstructed}}}f2.NAME="BitStringValueBlock";var h2;let Rr=class extends ot{constructor({idBlock:e={},lenBlock:n={},...r}={}){var i,s;(i=r.isConstructed)!==null&&i!==void 0||(r.isConstructed=!!(!((s=r.value)===null||s===void 0)&&s.length)),super({idBlock:{isConstructed:r.isConstructed,...e},lenBlock:{...n,isIndefiniteForm:!!r.isIndefiniteForm},...r},f2),this.idBlock.tagClass=1,this.idBlock.tagNumber=3}fromBER(e,n,r){return this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,super.fromBER(e,n,r)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return mt.prototype.onAsciiEncoding.call(this);{const e=[],n=this.valueBlock.valueHexView;for(const a of n)e.push(a.toString(2).padStart(8,"0"));const r=e.join(""),i=this.constructor.NAME,s=r.substring(0,r.length-this.valueBlock.unusedBits);return`${i} : ${s}`}}};h2=Rr;ee.BitString=h2;Rr.NAME=e2;var g2;function cx(t,e){const n=new Uint8Array([0]),r=new Uint8Array(t),i=new Uint8Array(e);let s=r.slice(0);const a=s.length-1,c=i.slice(0),l=c.length-1;let u=0;const d=l<a?a:l;let f=0;for(let p=d;p>=0;p--,f++)!0===f<c.length?u=s[a-f]+c[l-f]+n[0]:u=s[a-f]+n[0],n[0]=u/10,!0===f>=s.length?s=Ld(new Uint8Array([u%10]),s):s[a-f]=u%10;return n[0]>0&&(s=Ld(n,s)),s}function ig(t){if(t>=ho.length)for(let e=ho.length;e<=t;e++){const n=new Uint8Array([0]);let r=ho[e-1].slice(0);for(let i=r.length-1;i>=0;i--){const s=new Uint8Array([(r[i]<<1)+n[0]]);n[0]=s[0]/10,r[i]=s[0]%10}n[0]>0&&(r=Ld(n,r)),ho.push(r)}return ho[t]}function lx(t,e){let n=0;const r=new Uint8Array(t),i=new Uint8Array(e),s=r.slice(0),a=s.length-1,c=i.slice(0),l=c.length-1;let u,d=0;for(let f=l;f>=0;f--,d++)u=s[a-d]-c[l-d]-n,!0===u<0?(n=1,s[a-d]=u+10):(n=0,s[a-d]=u);if(n>0)for(let f=a-l+1;f>=0;f--,d++)if(u=s[a-d]-n,u<0)n=1,s[a-d]=u+10;else{n=0,s[a-d]=u;break}return s.slice()}class V0 extends xn(_t){setValueHex(){this.valueHexView.length>=4?(this.warnings.push("Too big Integer for decoding, hex only"),this.isHexOnly=!0,this._valueDec=0):(this.isHexOnly=!1,this.valueHexView.length>0&&(this._valueDec=Yb.call(this)))}constructor({value:e,...n}={}){super(n),this._valueDec=0,n.valueHex&&this.setValueHex(),e!==void 0&&(this.valueDec=e)}set valueDec(e){this._valueDec=e,this.isHexOnly=!1,this.valueHexView=new Uint8Array(X8(e))}get valueDec(){return this._valueDec}fromDER(e,n,r,i=0){const s=this.fromBER(e,n,r);if(s===-1)return s;const a=this.valueHexView;return a[0]===0&&(a[1]&128)!==0?this.valueHexView=a.subarray(1):i!==0&&a.length<i&&(i-a.length>1&&(i=a.length+1),this.valueHexView=a.subarray(i-a.length)),s}toDER(e=!1){const n=this.valueHexView;switch(!0){case(n[0]&128)!==0:{const r=new Uint8Array(this.valueHexView.length+1);r[0]=0,r.set(n,1),this.valueHexView=r}break;case(n[0]===0&&(n[1]&128)===0):this.valueHexView=this.valueHexView.subarray(1);break}return this.toBER(e)}fromBER(e,n,r){const i=super.fromBER(e,n,r);return i===-1||this.setValueHex(),i}toBER(e){return e?new ArrayBuffer(this.valueHexView.length):this.valueHexView.slice().buffer}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}toString(){const e=this.valueHexView.length*8-1;let n=new Uint8Array(this.valueHexView.length*8/3),r=0,i;const s=this.valueHexView;let a="",c=!1;for(let l=s.byteLength-1;l>=0;l--){i=s[l];for(let u=0;u<8;u++)(i&1)===1&&(r===e?(n=lx(ig(r),n),a="-"):n=cx(n,ig(r))),r++,i>>=1}for(let l=0;l<n.length;l++)n[l]&&(c=!0),c&&(a+=ng.charAt(n[l]));return c===!1&&(a+=ng.charAt(0)),a}}g2=V0;V0.NAME="IntegerValueBlock";Object.defineProperty(g2.prototype,"valueHex",{set:function(t){this.valueHexView=new Uint8Array(t),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var Ho;class eo extends ot{constructor(e={}){super(e,V0),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return sc(),BigInt(this.valueBlock.toString())}static fromBigInt(e){sc();const n=BigInt(e),r=new ol,i=n.toString(16).replace(/^-/,""),s=new Uint8Array(ne.FromHex(i));if(n<0){const c=new Uint8Array(s.length+(s[0]&128?1:0));c[0]|=128;const u=BigInt(`0x${ne.ToHex(c)}`)+n,d=W.toUint8Array(ne.FromHex(u.toString(16)));d[0]|=128,r.write(d)}else s[0]&128&&r.write(new Uint8Array([0])),r.write(s);return new Ho({valueHex:r.final()})}convertToDER(){const e=new Ho({valueHex:this.valueBlock.valueHexView});return e.valueBlock.toDER(),e}convertFromDER(){return new Ho({valueHex:this.valueBlock.valueHexView[0]===0?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}}Ho=eo;ee.Integer=Ho;eo.NAME="INTEGER";var m2;class cl extends eo{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}}m2=cl;ee.Enumerated=m2;cl.NAME="ENUMERATED";class Bd extends xn(_t){constructor({valueDec:e=-1,isFirstSid:n=!1,...r}={}){super(r),this.valueDec=e,this.isFirstSid=n}fromBER(e,n,r){if(!r)return n;const i=W.toUint8Array(e);if(!Kn(this,i,n,r))return-1;const s=i.subarray(n,n+r);this.valueHexView=new Uint8Array(r);for(let c=0;c<r&&(this.valueHexView[c]=s[c]&127,this.blockLength++,(s[c]&128)!==0);c++);const a=new Uint8Array(this.blockLength);for(let c=0;c<this.blockLength;c++)a[c]=this.valueHexView[c];return this.valueHexView=a,(s[this.blockLength-1]&128)!==0?(this.error="End of input reached before message was fully decoded",-1):(this.valueHexView[0]===0&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=Li(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),n+this.blockLength)}set valueBigInt(e){sc();let n=BigInt(e).toString(2);for(;n.length%7;)n="0"+n;const r=new Uint8Array(n.length/7);for(let i=0;i<r.length;i++)r[i]=parseInt(n.slice(i*7,i*7+7),2)+(i+1<r.length?128:0);this.fromBER(r.buffer,0,r.length)}toBER(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);const i=this.valueHexView,s=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength-1;a++)s[a]=i[a]|128;return s[this.blockLength-1]=i[this.blockLength-1],s.buffer}const n=Ur(this.valueDec,7);if(n.byteLength===0)return this.error="Error during encoding SID value",vn;const r=new Uint8Array(n.byteLength);if(!e){const i=new Uint8Array(n),s=n.byteLength-1;for(let a=0;a<s;a++)r[a]=i[a]|128;r[s]=i[s]}return r}toString(){let e="";if(this.isHexOnly)e=ne.ToHex(this.valueHexView);else if(this.isFirstSid){let n=this.valueDec;this.valueDec<=39?e="0.":this.valueDec<=79?(e="1.",n-=40):(e="2.",n-=80),e+=n.toString()}else e=this.valueDec.toString();return e}toJSON(){return{...super.toJSON(),valueDec:this.valueDec,isFirstSid:this.isFirstSid}}}Bd.NAME="sidBlock";class _2 extends _t{constructor({value:e=wt,...n}={}){super(n),this.value=[],e&&this.fromString(e)}fromBER(e,n,r){let i=n;for(;r>0;){const s=new Bd;if(i=s.fromBER(e,i,r),i===-1)return this.blockLength=0,this.error=s.error,i;this.value.length===0&&(s.isFirstSid=!0),this.blockLength+=s.blockLength,r-=s.blockLength,this.value.push(s)}return i}toBER(e){const n=[];for(let r=0;r<this.value.length;r++){const i=this.value[r].toBER(e);if(i.byteLength===0)return this.error=this.value[r].error,vn;n.push(i)}return M0(n)}fromString(e){this.value=[];let n=0,r=0,i="",s=!1;do if(r=e.indexOf(".",n),r===-1?i=e.substring(n):i=e.substring(n,r),n=r+1,s){const a=this.value[0];let c=0;switch(a.valueDec){case 0:break;case 1:c=40;break;case 2:c=80;break;default:this.value=[];return}const l=parseInt(i,10);if(isNaN(l))return;a.valueDec=l+c,s=!1}else{const a=new Bd;if(i>Number.MAX_SAFE_INTEGER){sc();const c=BigInt(i);a.valueBigInt=c}else if(a.valueDec=parseInt(i,10),isNaN(a.valueDec))return;this.value.length||(a.isFirstSid=!0,s=!0),this.value.push(a)}while(r!==-1)}toString(){let e="",n=!1;for(let r=0;r<this.value.length;r++){n=this.value[r].isHexOnly;let i=this.value[r].toString();r!==0&&(e=`${e}.`),n?(i=`{${i}}`,this.value[r].isFirstSid?e=`2.{${i} - 80}`:e+=i):e+=i}return e}toJSON(){const e={...super.toJSON(),value:this.toString(),sidArray:[]};for(let n=0;n<this.value.length;n++)e.sidArray.push(this.value[n].toJSON());return e}}_2.NAME="ObjectIdentifierValueBlock";var y2;class ll extends ot{getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}constructor(e={}){super(e,_2),this.idBlock.tagClass=1,this.idBlock.tagNumber=6}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}y2=ll;ee.ObjectIdentifier=y2;ll.NAME="OBJECT IDENTIFIER";class Dd extends xn(ii){constructor({valueDec:e=0,...n}={}){super(n),this.valueDec=e}fromBER(e,n,r){if(r===0)return n;const i=W.toUint8Array(e);if(!Kn(this,i,n,r))return-1;const s=i.subarray(n,n+r);this.valueHexView=new Uint8Array(r);for(let c=0;c<r&&(this.valueHexView[c]=s[c]&127,this.blockLength++,(s[c]&128)!==0);c++);const a=new Uint8Array(this.blockLength);for(let c=0;c<this.blockLength;c++)a[c]=this.valueHexView[c];return this.valueHexView=a,(s[this.blockLength-1]&128)!==0?(this.error="End of input reached before message was fully decoded",-1):(this.valueHexView[0]===0&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=Li(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),n+this.blockLength)}toBER(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);const i=this.valueHexView,s=new Uint8Array(this.blockLength);for(let a=0;a<this.blockLength-1;a++)s[a]=i[a]|128;return s[this.blockLength-1]=i[this.blockLength-1],s.buffer}const n=Ur(this.valueDec,7);if(n.byteLength===0)return this.error="Error during encoding SID value",vn;const r=new Uint8Array(n.byteLength);if(!e){const i=new Uint8Array(n),s=n.byteLength-1;for(let a=0;a<s;a++)r[a]=i[a]|128;r[s]=i[s]}return r.buffer}toString(){let e="";return this.isHexOnly?e=ne.ToHex(this.valueHexView):e=this.valueDec.toString(),e}toJSON(){return{...super.toJSON(),valueDec:this.valueDec}}}Dd.NAME="relativeSidBlock";class b2 extends _t{constructor({value:e=wt,...n}={}){super(n),this.value=[],e&&this.fromString(e)}fromBER(e,n,r){let i=n;for(;r>0;){const s=new Dd;if(i=s.fromBER(e,i,r),i===-1)return this.blockLength=0,this.error=s.error,i;this.blockLength+=s.blockLength,r-=s.blockLength,this.value.push(s)}return i}toBER(e,n){const r=[];for(let i=0;i<this.value.length;i++){const s=this.value[i].toBER(e);if(s.byteLength===0)return this.error=this.value[i].error,vn;r.push(s)}return M0(r)}fromString(e){this.value=[];let n=0,r=0,i="";do{r=e.indexOf(".",n),r===-1?i=e.substring(n):i=e.substring(n,r),n=r+1;const s=new Dd;if(s.valueDec=parseInt(i,10),isNaN(s.valueDec))return!0;this.value.push(s)}while(r!==-1);return!0}toString(){let e="",n=!1;for(let r=0;r<this.value.length;r++){n=this.value[r].isHexOnly;let i=this.value[r].toString();r!==0&&(e=`${e}.`),n&&(i=`{${i}}`),e+=i}return e}toJSON(){const e={...super.toJSON(),value:this.toString(),sidArray:[]};for(let n=0;n<this.value.length;n++)e.sidArray.push(this.value[n].toJSON());return e}}b2.NAME="RelativeObjectIdentifierValueBlock";var w2;class K0 extends ot{getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}constructor(e={}){super(e,b2),this.idBlock.tagClass=1,this.idBlock.tagNumber=13}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return{...super.toJSON(),value:this.getValue()}}}w2=K0;ee.RelativeObjectIdentifier=w2;K0.NAME="RelativeObjectIdentifier";var v2;class nn extends mt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}}v2=nn;ee.Sequence=v2;nn.NAME="SEQUENCE";var x2;let yn=class extends mt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};x2=yn;ee.Set=x2;yn.NAME="SET";class k2 extends xn(_t){constructor({...e}={}){super(e),this.isHexOnly=!0,this.value=wt}toJSON(){return{...super.toJSON(),value:this.value}}}k2.NAME="StringValueBlock";class $2 extends k2{}$2.NAME="SimpleStringValueBlock";class Nt extends q0{constructor({...e}={}){super(e,$2)}fromBuffer(e){this.valueBlock.value=String.fromCharCode.apply(null,W.toUint8Array(e))}fromString(e){const n=e.length,r=this.valueBlock.valueHexView=new Uint8Array(n);for(let i=0;i<n;i++)r[i]=e.charCodeAt(i);this.valueBlock.value=e}}Nt.NAME="SIMPLE STRING";class S2 extends Nt{fromBuffer(e){this.valueBlock.valueHexView=W.toUint8Array(e);try{this.valueBlock.value=ne.ToUtf8String(e)}catch(n){this.warnings.push(`Error during "decodeURIComponent": ${n}, using raw string`),this.valueBlock.value=ne.ToBinary(e)}}fromString(e){this.valueBlock.valueHexView=new Uint8Array(ne.FromUtf8String(e)),this.valueBlock.value=e}}S2.NAME="Utf8StringValueBlock";var z2;class Gn extends S2{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}}z2=Gn;ee.Utf8String=z2;Gn.NAME="UTF8String";class A2 extends Nt{fromBuffer(e){this.valueBlock.value=ne.ToUtf16String(e),this.valueBlock.valueHexView=W.toUint8Array(e)}fromString(e){this.valueBlock.value=e,this.valueBlock.valueHexView=new Uint8Array(ne.FromUtf16String(e))}}A2.NAME="BmpStringValueBlock";var E2;class ul extends A2{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}}E2=ul;ee.BmpString=E2;ul.NAME="BMPString";class C2 extends Nt{fromBuffer(e){const n=ArrayBuffer.isView(e)?e.slice().buffer:e.slice(0),r=new Uint8Array(n);for(let i=0;i<r.length;i+=4)r[i]=r[i+3],r[i+1]=r[i+2],r[i+2]=0,r[i+3]=0;this.valueBlock.value=String.fromCharCode.apply(null,new Uint32Array(n))}fromString(e){const n=e.length,r=this.valueBlock.valueHexView=new Uint8Array(n*4);for(let i=0;i<n;i++){const s=Ur(e.charCodeAt(i),8),a=new Uint8Array(s);if(a.length>4)continue;const c=4-a.length;for(let l=a.length-1;l>=0;l--)r[i*4+l+c]=a[l]}this.valueBlock.value=e}}C2.NAME="UniversalStringValueBlock";var N2;class dl extends C2{constructor({...e}={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}}N2=dl;ee.UniversalString=N2;dl.NAME="UniversalString";var I2;class pl extends Nt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}}I2=pl;ee.NumericString=I2;pl.NAME="NumericString";var j2;class fl extends Nt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}}j2=fl;ee.PrintableString=j2;fl.NAME="PrintableString";var T2;class hl extends Nt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}}T2=hl;ee.TeletexString=T2;hl.NAME="TeletexString";var O2;class gl extends Nt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}}O2=gl;ee.VideotexString=O2;gl.NAME="VideotexString";var P2;class ml extends Nt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}}P2=ml;ee.IA5String=P2;ml.NAME="IA5String";var R2;class _l extends Nt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}}R2=_l;ee.GraphicString=R2;_l.NAME="GraphicString";var L2;class Is extends Nt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}}L2=Is;ee.VisibleString=L2;Is.NAME="VisibleString";var B2;class yl extends Nt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}}B2=yl;ee.GeneralString=B2;yl.NAME="GeneralString";var D2;class bl extends Nt{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}}D2=bl;ee.CharacterString=D2;bl.NAME="CharacterString";var U2;class js extends Is{constructor({value:e,valueDate:n,...r}={}){if(super(r),this.year=0,this.month=0,this.day=0,this.hour=0,this.minute=0,this.second=0,e){this.fromString(e),this.valueBlock.valueHexView=new Uint8Array(e.length);for(let i=0;i<e.length;i++)this.valueBlock.valueHexView[i]=e.charCodeAt(i)}n&&(this.fromDate(n),this.valueBlock.valueHexView=new Uint8Array(this.toBuffer())),this.idBlock.tagClass=1,this.idBlock.tagNumber=23}fromBuffer(e){this.fromString(String.fromCharCode.apply(null,W.toUint8Array(e)))}toBuffer(){const e=this.toString(),n=new ArrayBuffer(e.length),r=new Uint8Array(n);for(let i=0;i<e.length;i++)r[i]=e.charCodeAt(i);return n}fromDate(e){this.year=e.getUTCFullYear(),this.month=e.getUTCMonth()+1,this.day=e.getUTCDate(),this.hour=e.getUTCHours(),this.minute=e.getUTCMinutes(),this.second=e.getUTCSeconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second))}fromString(e){const r=/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/ig.exec(e);if(r===null){this.error="Wrong input string for conversion";return}const i=parseInt(r[1],10);i>=50?this.year=1900+i:this.year=2e3+i,this.month=parseInt(r[2],10),this.day=parseInt(r[3],10),this.hour=parseInt(r[4],10),this.minute=parseInt(r[5],10),this.second=parseInt(r[6],10)}toString(e="iso"){if(e==="iso"){const n=new Array(7);return n[0]=At(this.year<2e3?this.year-1900:this.year-2e3,2),n[1]=At(this.month,2),n[2]=At(this.day,2),n[3]=At(this.hour,2),n[4]=At(this.minute,2),n[5]=At(this.second,2),n[6]="Z",n.join("")}return super.toString(e)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.toDate().toISOString()}`}toJSON(){return{...super.toJSON(),year:this.year,month:this.month,day:this.day,hour:this.hour,minute:this.minute,second:this.second}}}U2=js;ee.UTCTime=U2;js.NAME="UTCTime";var M2;class wl extends js{constructor(e={}){var n;super(e),(n=this.millisecond)!==null&&n!==void 0||(this.millisecond=0),this.idBlock.tagClass=1,this.idBlock.tagNumber=24}fromDate(e){super.fromDate(e),this.millisecond=e.getUTCMilliseconds()}toDate(){const e=Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond);return new Date(e)}fromString(e){let n=!1,r="",i="",s=0,a,c=0,l=0;if(e[e.length-1]==="Z")r=e.substring(0,e.length-1),n=!0;else{const f=new Number(e[e.length-1]);if(isNaN(f.valueOf()))throw new Error("Wrong input string for conversion");r=e}if(n){if(r.indexOf("+")!==-1)throw new Error("Wrong input string for conversion");if(r.indexOf("-")!==-1)throw new Error("Wrong input string for conversion")}else{let f=1,p=r.indexOf("+"),h="";if(p===-1&&(p=r.indexOf("-"),f=-1),p!==-1){if(h=r.substring(p+1),r=r.substring(0,p),h.length!==2&&h.length!==4)throw new Error("Wrong input string for conversion");let m=parseInt(h.substring(0,2),10);if(isNaN(m.valueOf()))throw new Error("Wrong input string for conversion");if(c=f*m,h.length===4){if(m=parseInt(h.substring(2,4),10),isNaN(m.valueOf()))throw new Error("Wrong input string for conversion");l=f*m}}}let u=r.indexOf(".");if(u===-1&&(u=r.indexOf(",")),u!==-1){const f=new Number(`0${r.substring(u)}`);if(isNaN(f.valueOf()))throw new Error("Wrong input string for conversion");s=f.valueOf(),i=r.substring(0,u)}else i=r;switch(!0){case i.length===8:if(a=/(\d{4})(\d{2})(\d{2})/ig,u!==-1)throw new Error("Wrong input string for conversion");break;case i.length===10:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})/ig,u!==-1){let f=60*s;this.minute=Math.floor(f),f=60*(f-this.minute),this.second=Math.floor(f),f=1e3*(f-this.second),this.millisecond=Math.floor(f)}break;case i.length===12:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/ig,u!==-1){let f=60*s;this.second=Math.floor(f),f=1e3*(f-this.second),this.millisecond=Math.floor(f)}break;case i.length===14:if(a=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/ig,u!==-1){const f=1e3*s;this.millisecond=Math.floor(f)}break;default:throw new Error("Wrong input string for conversion")}const d=a.exec(i);if(d===null)throw new Error("Wrong input string for conversion");for(let f=1;f<d.length;f++)switch(f){case 1:this.year=parseInt(d[f],10);break;case 2:this.month=parseInt(d[f],10);break;case 3:this.day=parseInt(d[f],10);break;case 4:this.hour=parseInt(d[f],10)+c;break;case 5:this.minute=parseInt(d[f],10)+l;break;case 6:this.second=parseInt(d[f],10);break;default:throw new Error("Wrong input string for conversion")}if(n===!1){const f=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=f.getUTCFullYear(),this.month=f.getUTCMonth(),this.day=f.getUTCDay(),this.hour=f.getUTCHours(),this.minute=f.getUTCMinutes(),this.second=f.getUTCSeconds(),this.millisecond=f.getUTCMilliseconds()}}toString(e="iso"){if(e==="iso"){const n=[];return n.push(At(this.year,4)),n.push(At(this.month,2)),n.push(At(this.day,2)),n.push(At(this.hour,2)),n.push(At(this.minute,2)),n.push(At(this.second,2)),this.millisecond!==0&&(n.push("."),n.push(At(this.millisecond,3))),n.push("Z"),n.join("")}return super.toString(e)}toJSON(){return{...super.toJSON(),millisecond:this.millisecond}}}M2=wl;ee.GeneralizedTime=M2;wl.NAME="GeneralizedTime";var q2;class G0 extends Gn{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}}q2=G0;ee.DATE=q2;G0.NAME="DATE";var F2;class W0 extends Gn{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}}F2=W0;ee.TimeOfDay=F2;W0.NAME="TimeOfDay";var H2;class J0 extends Gn{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}}H2=J0;ee.DateTime=H2;J0.NAME="DateTime";var V2;class X0 extends Gn{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}}V2=X0;ee.Duration=V2;X0.NAME="Duration";var K2;class Z0 extends Gn{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}}K2=Z0;ee.TIME=K2;Z0.NAME="TIME";class qr{constructor({name:e=wt,optional:n=!1}={}){this.name=e,this.optional=n}}class Y0 extends qr{constructor({value:e=[],...n}={}){super(n),this.value=e}}class ac extends qr{constructor({value:e=new qr,local:n=!1,...r}={}){super(r),this.value=e,this.local=n}}class ux{get data(){return this.dataView.slice().buffer}set data(e){this.dataView=W.toUint8Array(e)}constructor({data:e=sl}={}){this.dataView=W.toUint8Array(e)}fromBER(e,n,r){const i=n+r;return this.dataView=W.toUint8Array(e).subarray(n,i),i}toBER(e){return this.dataView.slice().buffer}}function tr(t,e,n){if(n instanceof Y0){for(const s of n.value)if(tr(t,e,s).verified)return{verified:!0,result:t};{const s={verified:!1,result:{error:"Wrong values for Choice type"}};return n.hasOwnProperty(_u)&&(s.name=n.name),s}}if(n instanceof qr)return n.hasOwnProperty(_u)&&(t[n.name]=e),{verified:!0,result:t};if(!(t instanceof Object))return{verified:!1,result:{error:"Wrong root object"}};if(!(e instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 data"}};if(!(n instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(Q8 in n))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(rx in n.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(!(ix in n.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const r=n.idBlock.toBER(!1);if(r.byteLength===0)return{verified:!1,result:{error:"Error encoding idBlock for ASN.1 schema"}};if(n.idBlock.fromBER(r,0,r.byteLength)===-1)return{verified:!1,result:{error:"Error decoding idBlock for ASN.1 schema"}};if(n.idBlock.hasOwnProperty(ex)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(n.idBlock.tagClass!==e.idBlock.tagClass)return{verified:!1,result:t};if(n.idBlock.hasOwnProperty(tx)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(n.idBlock.tagNumber!==e.idBlock.tagNumber)return{verified:!1,result:t};if(n.idBlock.hasOwnProperty(nx)===!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(n.idBlock.isConstructed!==e.idBlock.isConstructed)return{verified:!1,result:t};if(!(Y8 in n.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(n.idBlock.isHexOnly!==e.idBlock.isHexOnly)return{verified:!1,result:t};if(n.idBlock.isHexOnly){if(!(rg in n.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const s=n.idBlock.valueHexView,a=e.idBlock.valueHexView;if(s.length!==a.length)return{verified:!1,result:t};for(let c=0;c<s.length;c++)if(s[c]!==a[1])return{verified:!1,result:t}}if(n.name&&(n.name=n.name.replace(/^\s+|\s+$/g,wt),n.name&&(t[n.name]=e)),n instanceof ee.Constructed){let s=0,a={verified:!1,result:{error:"Unknown error"}},c=n.valueBlock.value.length;if(c>0&&n.valueBlock.value[0]instanceof ac&&(c=e.valueBlock.value.length),c===0)return{verified:!0,result:t};if(e.valueBlock.value.length===0&&n.valueBlock.value.length!==0){let l=!0;for(let u=0;u<n.valueBlock.value.length;u++)l=l&&(n.valueBlock.value[u].optional||!1);return l?{verified:!0,result:t}:(n.name&&(n.name=n.name.replace(/^\s+|\s+$/g,wt),n.name&&delete t[n.name]),t.error="Inconsistent object length",{verified:!1,result:t})}for(let l=0;l<c;l++)if(l-s>=e.valueBlock.value.length){if(n.valueBlock.value[l].optional===!1){const u={verified:!1,result:t};return t.error="Inconsistent length between ASN.1 data and schema",n.name&&(n.name=n.name.replace(/^\s+|\s+$/g,wt),n.name&&(delete t[n.name],u.name=n.name)),u}}else if(n.valueBlock.value[0]instanceof ac){if(a=tr(t,e.valueBlock.value[l],n.valueBlock.value[0].value),a.verified===!1)if(n.valueBlock.value[0].optional)s++;else return n.name&&(n.name=n.name.replace(/^\s+|\s+$/g,wt),n.name&&delete t[n.name]),a;if(_u in n.valueBlock.value[0]&&n.valueBlock.value[0].name.length>0){let u={};ox in n.valueBlock.value[0]&&n.valueBlock.value[0].local?u=e:u=t,typeof u[n.valueBlock.value[0].name]>"u"&&(u[n.valueBlock.value[0].name]=[]),u[n.valueBlock.value[0].name].push(e.valueBlock.value[l])}}else if(a=tr(t,e.valueBlock.value[l-s],n.valueBlock.value[l]),a.verified===!1)if(n.valueBlock.value[l].optional)s++;else return n.name&&(n.name=n.name.replace(/^\s+|\s+$/g,wt),n.name&&delete t[n.name]),a;if(a.verified===!1){const l={verified:!1,result:t};return n.name&&(n.name=n.name.replace(/^\s+|\s+$/g,wt),n.name&&(delete t[n.name],l.name=n.name)),l}return{verified:!0,result:t}}if(n.primitiveSchema&&rg in e.valueBlock){const s=Qi(e.valueBlock.valueHexView);if(s.offset===-1){const a={verified:!1,result:s.result};return n.name&&(n.name=n.name.replace(/^\s+|\s+$/g,wt),n.name&&(delete t[n.name],a.name=n.name)),a}return tr(t,s.result,n.primitiveSchema)}return{verified:!0,result:t}}function dx(t,e){if(!(e instanceof Object))return{verified:!1,result:{error:"Wrong ASN.1 schema type"}};const n=Qi(W.toUint8Array(t));return n.offset===-1?{verified:!1,result:n.result}:tr(n.result,n.result,e)}const G2=Object.freeze(Object.defineProperty({__proto__:null,Any:qr,BaseBlock:ot,BaseStringBlock:q0,BitString:Rr,BmpString:ul,Boolean:al,CharacterString:bl,Choice:Y0,Constructed:mt,DATE:G0,DateTime:J0,Duration:X0,EndOfContent:F0,Enumerated:cl,GeneralString:yl,GeneralizedTime:wl,GraphicString:_l,HexBlock:xn,IA5String:ml,Integer:eo,Null:Mr,NumericString:pl,ObjectIdentifier:ll,OctetString:Pr,Primitive:Ns,PrintableString:fl,RawData:ux,RelativeObjectIdentifier:K0,Repeated:ac,Sequence:nn,Set:yn,TIME:Z0,TeletexString:hl,TimeOfDay:W0,UTCTime:js,UniversalString:dl,Utf8String:Gn,ValueBlock:_t,VideotexString:gl,ViewWriter:ol,VisibleString:Is,compareSchema:tr,fromBER:Ci,verifySchema:dx},Symbol.toStringTag,{value:"Module"}));var q;(function(t){t[t.Sequence=0]="Sequence",t[t.Set=1]="Set",t[t.Choice=2]="Choice"})(q||(q={}));var j;(function(t){t[t.Any=1]="Any",t[t.Boolean=2]="Boolean",t[t.OctetString=3]="OctetString",t[t.BitString=4]="BitString",t[t.Integer=5]="Integer",t[t.Enumerated=6]="Enumerated",t[t.ObjectIdentifier=7]="ObjectIdentifier",t[t.Utf8String=8]="Utf8String",t[t.BmpString=9]="BmpString",t[t.UniversalString=10]="UniversalString",t[t.NumericString=11]="NumericString",t[t.PrintableString=12]="PrintableString",t[t.TeletexString=13]="TeletexString",t[t.VideotexString=14]="VideotexString",t[t.IA5String=15]="IA5String",t[t.GraphicString=16]="GraphicString",t[t.VisibleString=17]="VisibleString",t[t.GeneralString=18]="GeneralString",t[t.CharacterString=19]="CharacterString",t[t.UTCTime=20]="UTCTime",t[t.GeneralizedTime=21]="GeneralizedTime",t[t.DATE=22]="DATE",t[t.TimeOfDay=23]="TimeOfDay",t[t.DateTime=24]="DateTime",t[t.Duration=25]="Duration",t[t.TIME=26]="TIME",t[t.Null=27]="Null"})(j||(j={}));class vl{constructor(e,n=0){if(this.unusedBits=0,this.value=new ArrayBuffer(0),e)if(typeof e=="number")this.fromNumber(e);else if(W.isBufferSource(e))this.unusedBits=n,this.value=W.toArrayBuffer(e);else throw TypeError("Unsupported type of 'params' argument for BitString")}fromASN(e){if(!(e instanceof Rr))throw new TypeError("Argument 'asn' is not instance of ASN.1 BitString");return this.unusedBits=e.valueBlock.unusedBits,this.value=e.valueBlock.valueHex,this}toASN(){return new Rr({unusedBits:this.unusedBits,valueHex:this.value})}toSchema(e){return new Rr({name:e})}toNumber(){let e="";const n=new Uint8Array(this.value);for(const r of n)e+=r.toString(2).padStart(8,"0");return e=e.split("").reverse().join(""),this.unusedBits&&(e=e.slice(this.unusedBits).padStart(this.unusedBits,"0")),parseInt(e,2)}fromNumber(e){let n=e.toString(2);const r=n.length+7>>3;this.unusedBits=(r<<3)-n.length;const i=new Uint8Array(r);n=n.padStart(r<<3,"0").split("").reverse().join("");let s=0;for(;s<r;)i[s]=parseInt(n.slice(s<<3,(s<<3)+8),2),s++;this.value=i.buffer}}class xe{get byteLength(){return this.buffer.byteLength}get byteOffset(){return 0}constructor(e){typeof e=="number"?this.buffer=new ArrayBuffer(e):W.isBufferSource(e)?this.buffer=W.toArrayBuffer(e):Array.isArray(e)?this.buffer=new Uint8Array(e):this.buffer=new ArrayBuffer(0)}fromASN(e){if(!(e instanceof Pr))throw new TypeError("Argument 'asn' is not instance of ASN.1 OctetString");return this.buffer=e.valueBlock.valueHex,this}toASN(){return new Pr({valueHex:this.buffer})}toSchema(e){return new Pr({name:e})}}const px={fromASN:t=>t instanceof Mr?null:t.valueBeforeDecodeView,toASN:t=>{if(t===null)return new Mr;const e=Ci(t);if(e.result.error)throw new Error(e.result.error);return e.result}},fx={fromASN:t=>t.valueBlock.valueHexView.byteLength>=4?t.valueBlock.toString():t.valueBlock.valueDec,toASN:t=>new eo({value:+t})},hx={fromASN:t=>t.valueBlock.valueDec,toASN:t=>new cl({value:t})},Pe={fromASN:t=>t.valueBlock.valueHexView,toASN:t=>new eo({valueHex:t})},gx={fromASN:t=>t.valueBlock.valueHexView,toASN:t=>new Rr({valueHex:t})},mx={fromASN:t=>t.valueBlock.toString(),toASN:t=>new ll({value:t})},_x={fromASN:t=>t.valueBlock.value,toASN:t=>new al({value:t})},cc={fromASN:t=>t.valueBlock.valueHexView,toASN:t=>new Pr({valueHex:t})},yx={fromASN:t=>new xe(t.getValue()),toASN:t=>t.toASN()};function Ut(t){return{fromASN:e=>e.valueBlock.value,toASN:e=>new t({value:e})}}const W2=Ut(Gn),bx=Ut(ul),wx=Ut(dl),vx=Ut(pl),xx=Ut(fl),kx=Ut(hl),$x=Ut(gl),Sx=Ut(ml),zx=Ut(_l),Ax=Ut(Is),Ex=Ut(yl),Cx=Ut(bl),Nx={fromASN:t=>t.toDate(),toASN:t=>new js({valueDate:t})},Ix={fromASN:t=>t.toDate(),toASN:t=>new wl({valueDate:t})},jx={fromASN:()=>null,toASN:()=>new Mr};function Vo(t){switch(t){case j.Any:return px;case j.BitString:return gx;case j.BmpString:return bx;case j.Boolean:return _x;case j.CharacterString:return Cx;case j.Enumerated:return hx;case j.GeneralString:return Ex;case j.GeneralizedTime:return Ix;case j.GraphicString:return zx;case j.IA5String:return Sx;case j.Integer:return fx;case j.Null:return jx;case j.NumericString:return vx;case j.ObjectIdentifier:return mx;case j.OctetString:return cc;case j.PrintableString:return xx;case j.TeletexString:return kx;case j.UTCTime:return Nx;case j.UniversalString:return wx;case j.Utf8String:return W2;case j.VideotexString:return $x;case j.VisibleString:return Ax;default:return null}}function Ln(t){return typeof t=="function"&&t.prototype?t.prototype.toASN&&t.prototype.fromASN?!0:Ln(t.prototype):!!(t&&typeof t=="object"&&"toASN"in t&&"fromASN"in t)}function J2(t){var e;if(t){const n=Object.getPrototypeOf(t);return((e=n?.prototype)===null||e===void 0?void 0:e.constructor)===Array?!0:J2(n)}return!1}function Tx(t,e){if(!(t&&e)||t.byteLength!==e.byteLength)return!1;const n=new Uint8Array(t),r=new Uint8Array(e);for(let i=0;i<t.byteLength;i++)if(n[i]!==r[i])return!1;return!0}class Ox{constructor(){this.items=new WeakMap}has(e){return this.items.has(e)}get(e,n=!1){const r=this.items.get(e);if(!r)throw new Error(`Cannot get schema for '${e.prototype.constructor.name}' target`);if(n&&!r.schema)throw new Error(`Schema '${e.prototype.constructor.name}' doesn't contain ASN.1 schema. Call 'AsnSchemaStorage.cache'.`);return r}cache(e){const n=this.get(e);n.schema||(n.schema=this.create(e,!0))}createDefault(e){const n={type:q.Sequence,items:{}},r=this.findParentSchema(e);return r&&(Object.assign(n,r),n.items=Object.assign({},n.items,r.items)),n}create(e,n){const r=this.items.get(e)||this.createDefault(e),i=[];for(const s in r.items){const a=r.items[s],c=n?s:"";let l;if(typeof a.type=="number"){const d=j[a.type],f=G2[d];if(!f)throw new Error(`Cannot get ASN1 class by name '${d}'`);l=new f({name:c})}else Ln(a.type)?l=new a.type().toSchema(c):a.optional?this.get(a.type).type===q.Choice?l=new qr({name:c}):(l=this.create(a.type,!1),l.name=c):l=new qr({name:c});const u=!!a.optional||a.defaultValue!==void 0;if(a.repeated){l.name="";const d=a.repeated==="set"?yn:nn;l=new d({name:"",value:[new ac({name:c,value:l})]})}if(a.context!==null&&a.context!==void 0)if(a.implicit)if(typeof a.type=="number"||Ln(a.type)){const d=a.repeated?mt:Ns;i.push(new d({name:c,optional:u,idBlock:{tagClass:3,tagNumber:a.context}}))}else{this.cache(a.type);const d=!!a.repeated;let f=d?l:this.get(a.type,!0).schema;f="valueBlock"in f?f.valueBlock.value:f.value,i.push(new mt({name:d?"":c,optional:u,idBlock:{tagClass:3,tagNumber:a.context},value:f}))}else i.push(new mt({optional:u,idBlock:{tagClass:3,tagNumber:a.context},value:[l]}));else l.optional=u,i.push(l)}switch(r.type){case q.Sequence:return new nn({value:i,name:""});case q.Set:return new yn({value:i,name:""});case q.Choice:return new Y0({value:i,name:""});default:throw new Error("Unsupported ASN1 type in use")}}set(e,n){return this.items.set(e,n),this}findParentSchema(e){const n=Object.getPrototypeOf(e);return n?this.items.get(n)||this.findParentSchema(n):null}}const nt=new Ox,H=t=>e=>{let n;nt.has(e)?n=nt.get(e):(n=nt.createDefault(e),nt.set(e,n)),Object.assign(n,t)},S=t=>(e,n)=>{let r;nt.has(e.constructor)?r=nt.get(e.constructor):(r=nt.createDefault(e.constructor),nt.set(e.constructor,r));const i=Object.assign({},t);if(typeof i.type=="number"&&!i.converter){const s=Vo(t.type);if(!s)throw new Error(`Cannot get default converter for property '${n}' of ${e.constructor.name}`);i.converter=s}i.raw=t.raw,r.items[n]=i};class go extends Error{constructor(){super(...arguments),this.schemas=[]}}class Px{static parse(e,n){const r=Ci(e);if(r.result.error)throw new Error(r.result.error);return this.fromASN(r.result,n)}static fromASN(e,n){try{if(Ln(n))return new n().fromASN(e);const r=nt.get(n);nt.cache(n);let i=r.schema;const s=this.handleChoiceTypes(e,r,n,i);if(s?.result)return s.result;s?.targetSchema&&(i=s.targetSchema);const a=this.handleSequenceTypes(e,r,n,i),c=new n;return J2(n)?this.handleArrayTypes(e,r,n):(this.processSchemaItems(r,a,c),c)}catch(r){throw r instanceof go&&r.schemas.push(n.name),r}}static handleChoiceTypes(e,n,r,i){if(e.constructor===mt&&n.type===q.Choice&&e.idBlock.tagClass===3)for(const s in n.items){const a=n.items[s];if(a.context===e.idBlock.tagNumber&&a.implicit&&typeof a.type=="function"&&nt.has(a.type)){const c=nt.get(a.type);if(c&&c.type===q.Sequence){const l=new nn;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in l.valueBlock){l.valueBlock.value=e.valueBlock.value;const u=this.fromASN(l,a.type),d=new r;return d[s]=u,{result:d}}}}}else if(e.constructor===mt&&n.type!==q.Choice){const s=new mt({idBlock:{tagClass:3,tagNumber:e.idBlock.tagNumber},value:n.schema.valueBlock.value});for(const a in n.items)delete e[a];return{targetSchema:s}}return null}static handleSequenceTypes(e,n,r,i){if(n.type===q.Sequence){const s=tr({},e,i);if(!s.verified)throw new go(`Data does not match to ${r.name} ASN1 schema.${s.result.error?` ${s.result.error}`:""}`);return s}else{const s=tr({},e,i);if(!s.verified)throw new go(`Data does not match to ${r.name} ASN1 schema.${s.result.error?` ${s.result.error}`:""}`);return s}}static processRepeatedField(e,n,r){let i=e.slice(n);if(i.length===1&&i[0].constructor.name==="Sequence"){const s=i[0];s.valueBlock&&s.valueBlock.value&&Array.isArray(s.valueBlock.value)&&(i=s.valueBlock.value)}if(typeof r.type=="number"){const s=Vo(r.type);if(!s)throw new Error(`No converter for ASN.1 type ${r.type}`);return i.filter(a=>a&&a.valueBlock).map(a=>{try{return s.fromASN(a)}catch{return}}).filter(a=>a!==void 0)}else return i.filter(s=>s&&s.valueBlock).map(s=>{try{return this.fromASN(s,r.type)}catch{return}}).filter(s=>s!==void 0)}static processPrimitiveField(e,n){const r=Vo(n.type);if(!r)throw new Error(`No converter for ASN.1 type ${n.type}`);return r.fromASN(e)}static isOptionalChoiceField(e){return e.optional&&typeof e.type=="function"&&nt.has(e.type)&&nt.get(e.type).type===q.Choice}static processOptionalChoiceField(e,n){try{return{processed:!0,value:this.fromASN(e,n.type)}}catch(r){if(r instanceof go&&/Wrong values for Choice type/.test(r.message))return{processed:!1};throw r}}static handleArrayTypes(e,n,r){if(!("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");const i=n.itemType;if(typeof i=="number"){const s=Vo(i);if(!s)throw new Error(`Cannot get default converter for array item of ${r.name} ASN1 schema`);return r.from(e.valueBlock.value,a=>s.fromASN(a))}else return r.from(e.valueBlock.value,s=>this.fromASN(s,i))}static processSchemaItems(e,n,r){for(const i in e.items){const s=n.result[i];if(!s)continue;const a=e.items[i],c=a.type;let l;typeof c=="number"||Ln(c)?l=this.processPrimitiveSchemaItem(s,a,c):l=this.processComplexSchemaItem(s,a,c),l&&typeof l=="object"&&"value"in l&&"raw"in l?(r[i]=l.value,r[`${i}Raw`]=l.raw):r[i]=l}}static processPrimitiveSchemaItem(e,n,r){var i;const s=(i=n.converter)!==null&&i!==void 0?i:Ln(r)?new r:null;if(!s)throw new Error("Converter is empty");return n.repeated?this.processRepeatedPrimitiveItem(e,n,s):this.processSinglePrimitiveItem(e,n,r,s)}static processRepeatedPrimitiveItem(e,n,r){if(n.implicit){const i=n.repeated==="sequence"?nn:yn,s=new i;s.valueBlock=e.valueBlock;const a=Ci(s.toBER(!1));if(a.offset===-1)throw new Error(`Cannot parse the child item. ${a.result.error}`);if(!("value"in a.result.valueBlock&&Array.isArray(a.result.valueBlock.value)))throw new Error("Cannot get items from the ASN.1 parsed value. ASN.1 object is not constructed.");const c=a.result.valueBlock.value;return Array.from(c,l=>r.fromASN(l))}else return Array.from(e,i=>r.fromASN(i))}static processSinglePrimitiveItem(e,n,r,i){let s=e;if(n.implicit){let a;if(Ln(r))a=new r().toSchema("");else{const c=j[r],l=G2[c];if(!l)throw new Error(`Cannot get '${c}' class from asn1js module`);a=new l}a.valueBlock=s.valueBlock,s=Ci(a.toBER(!1)).result}return i.fromASN(s)}static processComplexSchemaItem(e,n,r){if(n.repeated){if(!Array.isArray(e))throw new Error("Cannot get list of items from the ASN.1 parsed value. ASN.1 value should be iterable.");return Array.from(e,i=>this.fromASN(i,r))}else{const i=this.handleImplicitTagging(e,n,r);if(this.isOptionalChoiceField(n))try{return this.fromASN(i,r)}catch(s){if(s instanceof go&&/Wrong values for Choice type/.test(s.message))return;throw s}else{const s=this.fromASN(i,r);return n.raw?{value:s,raw:e.valueBeforeDecodeView}:s}}}static handleImplicitTagging(e,n,r){if(n.implicit&&typeof n.context=="number"){const i=nt.get(r);if(i.type===q.Sequence){const s=new nn;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in s.valueBlock)return s.valueBlock.value=e.valueBlock.value,s}else if(i.type===q.Set){const s=new yn;if("value"in e.valueBlock&&Array.isArray(e.valueBlock.value)&&"value"in s.valueBlock)return s.valueBlock.value=e.valueBlock.value,s}}return e}}class Q0{static serialize(e){return e instanceof ot?e.toBER(!1):this.toASN(e).toBER(!1)}static toASN(e){if(e&&typeof e=="object"&&Ln(e))return e.toASN();if(!(e&&typeof e=="object"))throw new TypeError("Parameter 1 should be type of Object.");const n=e.constructor,r=nt.get(n);nt.cache(n);let i=[];if(r.itemType){if(!Array.isArray(e))throw new TypeError("Parameter 1 should be type of Array.");if(typeof r.itemType=="number"){const a=Vo(r.itemType);if(!a)throw new Error(`Cannot get default converter for array item of ${n.name} ASN1 schema`);i=e.map(c=>a.toASN(c))}else i=e.map(a=>this.toAsnItem({type:r.itemType},"[]",n,a))}else for(const a in r.items){const c=r.items[a],l=e[a];if(l===void 0||c.defaultValue===l||typeof c.defaultValue=="object"&&typeof l=="object"&&Tx(this.serialize(c.defaultValue),this.serialize(l)))continue;const u=Q0.toAsnItem(c,a,n,l);if(typeof c.context=="number")if(c.implicit)if(!c.repeated&&(typeof c.type=="number"||Ln(c.type))){const d={};d.valueHex=u instanceof Mr?u.valueBeforeDecodeView:u.valueBlock.toBER(),i.push(new Ns({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},...d}))}else i.push(new mt({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},value:u.valueBlock.value}));else i.push(new mt({optional:c.optional,idBlock:{tagClass:3,tagNumber:c.context},value:[u]}));else c.repeated?i=i.concat(u):i.push(u)}let s;switch(r.type){case q.Sequence:s=new nn({value:i});break;case q.Set:s=new yn({value:i});break;case q.Choice:if(!i[0])throw new Error(`Schema '${n.name}' has wrong data. Choice cannot be empty.`);s=i[0];break}return s}static toAsnItem(e,n,r,i){let s;if(typeof e.type=="number"){const a=e.converter;if(!a)throw new Error(`Property '${n}' doesn't have converter for type ${j[e.type]} in schema '${r.name}'`);if(e.repeated){if(!Array.isArray(i))throw new TypeError("Parameter 'objProp' should be type of Array.");const c=Array.from(i,u=>a.toASN(u)),l=e.repeated==="sequence"?nn:yn;s=new l({value:c})}else s=a.toASN(i)}else if(e.repeated){if(!Array.isArray(i))throw new TypeError("Parameter 'objProp' should be type of Array.");const a=Array.from(i,l=>this.toASN(l)),c=e.repeated==="sequence"?nn:yn;s=new c({value:a})}else s=this.toASN(i);return s}}class Ee extends Array{constructor(e=[]){if(typeof e=="number")super(e);else{super();for(const n of e)this.push(n)}}}class G{static serialize(e){return Q0.serialize(e)}static parse(e,n){return Px.parse(e,n)}static toString(e){const n=W.isBufferSource(e)?W.toArrayBuffer(e):G.serialize(e),r=Ci(n);if(r.offset===-1)throw new Error(`Cannot decode ASN.1 data. ${r.result.error}`);return r.result.toString()}}function x(t,e,n,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,n,r);else for(var c=t.length-1;c>=0;c--)(a=t[c])&&(s=(i<3?a(s):i>3?a(e,n,s):a(e,n))||s);return i>3&&s&&Object.defineProperty(e,n,s),s}function me(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)}function Re(t,e,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(t,n):i?i.value=n:e.set(t,n),n}class og{static isIPv4(e){return/^(\d{1,3}\.){3}\d{1,3}$/.test(e)}static parseIPv4(e){const n=e.split(".");if(n.length!==4)throw new Error("Invalid IPv4 address");return n.map(r=>{const i=parseInt(r,10);if(isNaN(i)||i<0||i>255)throw new Error("Invalid IPv4 address part");return i})}static parseIPv6(e){const r=this.expandIPv6(e).split(":");if(r.length!==8)throw new Error("Invalid IPv6 address");return r.reduce((i,s)=>{const a=parseInt(s,16);if(isNaN(a)||a<0||a>65535)throw new Error("Invalid IPv6 address part");return i.push(a>>8&255),i.push(a&255),i},[])}static expandIPv6(e){if(!e.includes("::"))return e;const n=e.split("::");if(n.length>2)throw new Error("Invalid IPv6 address");const r=n[0]?n[0].split(":"):[],i=n[1]?n[1].split(":"):[],s=8-(r.length+i.length);if(s<0)throw new Error("Invalid IPv6 address");return[...r,...Array(s).fill("0"),...i].join(":")}static formatIPv6(e){const n=[];for(let r=0;r<16;r+=2)n.push((e[r]<<8|e[r+1]).toString(16));return this.compressIPv6(n.join(":"))}static compressIPv6(e){const n=e.split(":");let r=-1,i=0,s=-1,a=0;for(let c=0;c<n.length;c++)n[c]==="0"?(s===-1&&(s=c),a++):(a>i&&(r=s,i=a),s=-1,a=0);if(a>i&&(r=s,i=a),i>1){const c=n.slice(0,r).join(":"),l=n.slice(r+i).join(":");return`${c}::${l}`}return e}static parseCIDR(e){const[n,r]=e.split("/"),i=parseInt(r,10);if(this.isIPv4(n)){if(i<0||i>32)throw new Error("Invalid IPv4 prefix length");return[this.parseIPv4(n),i]}else{if(i<0||i>128)throw new Error("Invalid IPv6 prefix length");return[this.parseIPv6(n),i]}}static decodeIP(e){if(e.length===64&&parseInt(e,16)===0)return"::/0";if(e.length!==16)return e;const n=parseInt(e.slice(8),16).toString(2).split("").reduce((i,s)=>i+ +s,0);let r=e.slice(0,8).replace(/(.{2})/g,i=>`${parseInt(i,16)}.`);return r=r.slice(0,-1),`${r}/${n}`}static toString(e){const n=new Uint8Array(e);if(n.length===4)return Array.from(n).join(".");if(n.length===16)return this.formatIPv6(n);if(n.length===8||n.length===32){const r=n.length/2,i=n.slice(0,r),s=n.slice(r);if(n.every(l=>l===0))return n.length===8?"0.0.0.0/0":"::/0";const c=s.reduce((l,u)=>l+(u.toString(2).match(/1/g)||[]).length,0);return n.length===8?`${Array.from(i).join(".")}/${c}`:`${this.formatIPv6(i)}/${c}`}return this.decodeIP(ne.ToHex(e))}static fromString(e){if(e.includes("/")){const[r,i]=this.parseCIDR(e),s=new Uint8Array(r.length);let a=i;for(let l=0;l<s.length;l++)a>=8?(s[l]=255,a-=8):a>0&&(s[l]=255<<8-a,a=0);const c=new Uint8Array(r.length*2);return c.set(r,0),c.set(s,r.length),c.buffer}const n=this.isIPv4(e)?this.parseIPv4(e):this.parseIPv6(e);return new Uint8Array(n).buffer}}var Ud,Md,qd;let st=class{constructor(e={}){Object.assign(this,e)}toString(){return this.bmpString||this.printableString||this.teletexString||this.universalString||this.utf8String||""}};x([S({type:j.TeletexString})],st.prototype,"teletexString",void 0);x([S({type:j.PrintableString})],st.prototype,"printableString",void 0);x([S({type:j.UniversalString})],st.prototype,"universalString",void 0);x([S({type:j.Utf8String})],st.prototype,"utf8String",void 0);x([S({type:j.BmpString})],st.prototype,"bmpString",void 0);st=x([H({type:q.Choice})],st);let Bi=class extends st{constructor(e={}){super(e),Object.assign(this,e)}toString(){return this.ia5String||(this.anyValue?ne.ToHex(this.anyValue):super.toString())}};x([S({type:j.IA5String})],Bi.prototype,"ia5String",void 0);x([S({type:j.Any})],Bi.prototype,"anyValue",void 0);Bi=x([H({type:q.Choice})],Bi);class xl{constructor(e={}){this.type="",this.value=new Bi,Object.assign(this,e)}}x([S({type:j.ObjectIdentifier})],xl.prototype,"type",void 0);x([S({type:Bi})],xl.prototype,"value",void 0);let Di=Ud=class extends Ee{constructor(e){super(e),Object.setPrototypeOf(this,Ud.prototype)}};Di=Ud=x([H({type:q.Set,itemType:xl})],Di);let Fd=Md=class extends Ee{constructor(e){super(e),Object.setPrototypeOf(this,Md.prototype)}};Fd=Md=x([H({type:q.Sequence,itemType:Di})],Fd);let Ke=qd=class extends Fd{constructor(e){super(e),Object.setPrototypeOf(this,qd.prototype)}};Ke=qd=x([H({type:q.Sequence})],Ke);const Rx={fromASN:t=>og.toString(cc.fromASN(t)),toASN:t=>cc.toASN(og.fromString(t))};class ss{constructor(e={}){this.typeId="",this.value=new ArrayBuffer(0),Object.assign(this,e)}}x([S({type:j.ObjectIdentifier})],ss.prototype,"typeId",void 0);x([S({type:j.Any,context:0})],ss.prototype,"value",void 0);class ef{constructor(e={}){this.partyName=new st,Object.assign(this,e)}}x([S({type:st,optional:!0,context:0,implicit:!0})],ef.prototype,"nameAssigner",void 0);x([S({type:st,context:1,implicit:!0})],ef.prototype,"partyName",void 0);let he=class{constructor(e={}){Object.assign(this,e)}};x([S({type:ss,context:0,implicit:!0})],he.prototype,"otherName",void 0);x([S({type:j.IA5String,context:1,implicit:!0})],he.prototype,"rfc822Name",void 0);x([S({type:j.IA5String,context:2,implicit:!0})],he.prototype,"dNSName",void 0);x([S({type:j.Any,context:3,implicit:!0})],he.prototype,"x400Address",void 0);x([S({type:Ke,context:4,implicit:!1})],he.prototype,"directoryName",void 0);x([S({type:ef,context:5})],he.prototype,"ediPartyName",void 0);x([S({type:j.IA5String,context:6,implicit:!0})],he.prototype,"uniformResourceIdentifier",void 0);x([S({type:j.OctetString,context:7,implicit:!0,converter:Rx})],he.prototype,"iPAddress",void 0);x([S({type:j.ObjectIdentifier,context:8,implicit:!0})],he.prototype,"registeredID",void 0);he=x([H({type:q.Choice})],he);const tf="1.3.6.1.5.5.7",Lx=`${tf}.1`,to=`${tf}.3`,kl=`${tf}.48`,sg=`${kl}.1`,ag=`${kl}.2`,cg=`${kl}.3`,lg=`${kl}.5`,Wn="2.5.29";var Hd;const Vd=`${Lx}.1`;class Ts{constructor(e={}){this.accessMethod="",this.accessLocation=new he,Object.assign(this,e)}}x([S({type:j.ObjectIdentifier})],Ts.prototype,"accessMethod",void 0);x([S({type:he})],Ts.prototype,"accessLocation",void 0);let $i=Hd=class extends Ee{constructor(e){super(e),Object.setPrototypeOf(this,Hd.prototype)}};$i=Hd=x([H({type:q.Sequence,itemType:Ts})],$i);const Kd=`${Wn}.35`;class nf extends xe{}class Ir{constructor(e={}){e&&Object.assign(this,e)}}x([S({type:nf,context:0,optional:!0,implicit:!0})],Ir.prototype,"keyIdentifier",void 0);x([S({type:he,context:1,optional:!0,implicit:!0,repeated:"sequence"})],Ir.prototype,"authorityCertIssuer",void 0);x([S({type:j.Integer,context:2,optional:!0,implicit:!0,converter:Pe})],Ir.prototype,"authorityCertSerialNumber",void 0);const X2=`${Wn}.19`;class lc{constructor(e={}){this.cA=!1,Object.assign(this,e)}}x([S({type:j.Boolean,defaultValue:!1})],lc.prototype,"cA",void 0);x([S({type:j.Integer,optional:!0})],lc.prototype,"pathLenConstraint",void 0);var Gd;let pt=Gd=class extends Ee{constructor(e){super(e),Object.setPrototypeOf(this,Gd.prototype)}};pt=Gd=x([H({type:q.Sequence,itemType:he})],pt);var Wd;let ug=Wd=class extends pt{constructor(e){super(e),Object.setPrototypeOf(this,Wd.prototype)}};ug=Wd=x([H({type:q.Sequence})],ug);var Jd;const Z2=`${Wn}.32`;let Dn=class{constructor(e={}){Object.assign(this,e)}toString(){return this.ia5String||this.visibleString||this.bmpString||this.utf8String||""}};x([S({type:j.IA5String})],Dn.prototype,"ia5String",void 0);x([S({type:j.VisibleString})],Dn.prototype,"visibleString",void 0);x([S({type:j.BmpString})],Dn.prototype,"bmpString",void 0);x([S({type:j.Utf8String})],Dn.prototype,"utf8String",void 0);Dn=x([H({type:q.Choice})],Dn);class rf{constructor(e={}){this.organization=new Dn,this.noticeNumbers=[],Object.assign(this,e)}}x([S({type:Dn})],rf.prototype,"organization",void 0);x([S({type:j.Integer,repeated:"sequence"})],rf.prototype,"noticeNumbers",void 0);class of{constructor(e={}){Object.assign(this,e)}}x([S({type:rf,optional:!0})],of.prototype,"noticeRef",void 0);x([S({type:Dn,optional:!0})],of.prototype,"explicitText",void 0);let uc=class{constructor(e={}){Object.assign(this,e)}};x([S({type:j.IA5String})],uc.prototype,"cPSuri",void 0);x([S({type:of})],uc.prototype,"userNotice",void 0);uc=x([H({type:q.Choice})],uc);class sf{constructor(e={}){this.policyQualifierId="",this.qualifier=new ArrayBuffer(0),Object.assign(this,e)}}x([S({type:j.ObjectIdentifier})],sf.prototype,"policyQualifierId",void 0);x([S({type:j.Any})],sf.prototype,"qualifier",void 0);class $l{constructor(e={}){this.policyIdentifier="",Object.assign(this,e)}}x([S({type:j.ObjectIdentifier})],$l.prototype,"policyIdentifier",void 0);x([S({type:sf,repeated:"sequence",optional:!0})],$l.prototype,"policyQualifiers",void 0);let dc=Jd=class extends Ee{constructor(e){super(e),Object.setPrototypeOf(this,Jd.prototype)}};dc=Jd=x([H({type:q.Sequence,itemType:$l})],dc);let pc=class{constructor(e=0){this.value=e}};x([S({type:j.Integer})],pc.prototype,"value",void 0);pc=x([H({type:q.Choice})],pc);let dg=class extends pc{};dg=x([H({type:q.Choice})],dg);var Xd;const Zd=`${Wn}.31`;var Wt;(function(t){t[t.unused=1]="unused",t[t.keyCompromise=2]="keyCompromise",t[t.cACompromise=4]="cACompromise",t[t.affiliationChanged=8]="affiliationChanged",t[t.superseded=16]="superseded",t[t.cessationOfOperation=32]="cessationOfOperation",t[t.certificateHold=64]="certificateHold",t[t.privilegeWithdrawn=128]="privilegeWithdrawn",t[t.aACompromise=256]="aACompromise"})(Wt||(Wt={}));class Y2 extends vl{toJSON(){const e=[],n=this.toNumber();return n&Wt.aACompromise&&e.push("aACompromise"),n&Wt.affiliationChanged&&e.push("affiliationChanged"),n&Wt.cACompromise&&e.push("cACompromise"),n&Wt.certificateHold&&e.push("certificateHold"),n&Wt.cessationOfOperation&&e.push("cessationOfOperation"),n&Wt.keyCompromise&&e.push("keyCompromise"),n&Wt.privilegeWithdrawn&&e.push("privilegeWithdrawn"),n&Wt.superseded&&e.push("superseded"),n&Wt.unused&&e.push("unused"),e}toString(){return`[${this.toJSON().join(", ")}]`}}let Fr=class{constructor(e={}){Object.assign(this,e)}};x([S({type:he,context:0,repeated:"sequence",implicit:!0})],Fr.prototype,"fullName",void 0);x([S({type:Di,context:1,implicit:!0})],Fr.prototype,"nameRelativeToCRLIssuer",void 0);Fr=x([H({type:q.Choice})],Fr);class no{constructor(e={}){Object.assign(this,e)}}x([S({type:Fr,context:0,optional:!0})],no.prototype,"distributionPoint",void 0);x([S({type:Y2,context:1,optional:!0,implicit:!0})],no.prototype,"reasons",void 0);x([S({type:he,context:2,optional:!0,repeated:"sequence",implicit:!0})],no.prototype,"cRLIssuer",void 0);let Ni=Xd=class extends Ee{constructor(e){super(e),Object.setPrototypeOf(this,Xd.prototype)}};Ni=Xd=x([H({type:q.Sequence,itemType:no})],Ni);var Yd;let pg=Yd=class extends Ni{constructor(e){super(e),Object.setPrototypeOf(this,Yd.prototype)}};pg=Yd=x([H({type:q.Sequence,itemType:no})],pg);class dt{constructor(e={}){this.onlyContainsUserCerts=dt.ONLY,this.onlyContainsCACerts=dt.ONLY,this.indirectCRL=dt.ONLY,this.onlyContainsAttributeCerts=dt.ONLY,Object.assign(this,e)}}dt.ONLY=!1;x([S({type:Fr,context:0,optional:!0})],dt.prototype,"distributionPoint",void 0);x([S({type:j.Boolean,context:1,defaultValue:dt.ONLY,implicit:!0})],dt.prototype,"onlyContainsUserCerts",void 0);x([S({type:j.Boolean,context:2,defaultValue:dt.ONLY,implicit:!0})],dt.prototype,"onlyContainsCACerts",void 0);x([S({type:Y2,context:3,optional:!0,implicit:!0})],dt.prototype,"onlySomeReasons",void 0);x([S({type:j.Boolean,context:4,defaultValue:dt.ONLY,implicit:!0})],dt.prototype,"indirectCRL",void 0);x([S({type:j.Boolean,context:5,defaultValue:dt.ONLY,implicit:!0})],dt.prototype,"onlyContainsAttributeCerts",void 0);var Ko;(function(t){t[t.unspecified=0]="unspecified",t[t.keyCompromise=1]="keyCompromise",t[t.cACompromise=2]="cACompromise",t[t.affiliationChanged=3]="affiliationChanged",t[t.superseded=4]="superseded",t[t.cessationOfOperation=5]="cessationOfOperation",t[t.certificateHold=6]="certificateHold",t[t.removeFromCRL=8]="removeFromCRL",t[t.privilegeWithdrawn=9]="privilegeWithdrawn",t[t.aACompromise=10]="aACompromise"})(Ko||(Ko={}));let Qd=class{constructor(e=Ko.unspecified){this.reason=Ko.unspecified,this.reason=e}toJSON(){return Ko[this.reason]}toString(){return this.toJSON()}};x([S({type:j.Enumerated})],Qd.prototype,"reason",void 0);Qd=x([H({type:q.Choice})],Qd);var ep;const Q2=`${Wn}.37`;let fc=ep=class extends Ee{constructor(e){super(e),Object.setPrototypeOf(this,ep.prototype)}};fc=ep=x([H({type:q.Sequence,itemType:j.ObjectIdentifier})],fc);const Bx=`${to}.1`,Dx=`${to}.2`,Ux=`${to}.3`,Mx=`${to}.4`,qx=`${to}.8`,Fx=`${to}.9`;let tp=class{constructor(e=new ArrayBuffer(0)){this.value=e}};x([S({type:j.Integer,converter:Pe})],tp.prototype,"value",void 0);tp=x([H({type:q.Choice})],tp);let np=class{constructor(e){this.value=new Date,e&&(this.value=e)}};x([S({type:j.GeneralizedTime})],np.prototype,"value",void 0);np=x([H({type:q.Choice})],np);var rp;const ew=`${Wn}.18`;let fg=rp=class extends pt{constructor(e){super(e),Object.setPrototypeOf(this,rp.prototype)}};fg=rp=x([H({type:q.Sequence})],fg);const tw=`${Wn}.15`;var Jt;(function(t){t[t.digitalSignature=1]="digitalSignature",t[t.nonRepudiation=2]="nonRepudiation",t[t.keyEncipherment=4]="keyEncipherment",t[t.dataEncipherment=8]="dataEncipherment",t[t.keyAgreement=16]="keyAgreement",t[t.keyCertSign=32]="keyCertSign",t[t.cRLSign=64]="cRLSign",t[t.encipherOnly=128]="encipherOnly",t[t.decipherOnly=256]="decipherOnly"})(Jt||(Jt={}));class yu extends vl{toJSON(){const e=this.toNumber(),n=[];return e&Jt.cRLSign&&n.push("crlSign"),e&Jt.dataEncipherment&&n.push("dataEncipherment"),e&Jt.decipherOnly&&n.push("decipherOnly"),e&Jt.digitalSignature&&n.push("digitalSignature"),e&Jt.encipherOnly&&n.push("encipherOnly"),e&Jt.keyAgreement&&n.push("keyAgreement"),e&Jt.keyCertSign&&n.push("keyCertSign"),e&Jt.keyEncipherment&&n.push("keyEncipherment"),e&Jt.nonRepudiation&&n.push("nonRepudiation"),n}toString(){return`[${this.toJSON().join(", ")}]`}}var ip;class Sl{constructor(e={}){this.base=new he,this.minimum=0,Object.assign(this,e)}}x([S({type:he})],Sl.prototype,"base",void 0);x([S({type:j.Integer,context:0,defaultValue:0,implicit:!0})],Sl.prototype,"minimum",void 0);x([S({type:j.Integer,context:1,optional:!0,implicit:!0})],Sl.prototype,"maximum",void 0);let hc=ip=class extends Ee{constructor(e){super(e),Object.setPrototypeOf(this,ip.prototype)}};hc=ip=x([H({type:q.Sequence,itemType:Sl})],hc);class nw{constructor(e={}){Object.assign(this,e)}}x([S({type:hc,context:0,optional:!0,implicit:!0})],nw.prototype,"permittedSubtrees",void 0);x([S({type:hc,context:1,optional:!0,implicit:!0})],nw.prototype,"excludedSubtrees",void 0);class rw{constructor(e={}){Object.assign(this,e)}}x([S({type:j.Integer,context:0,implicit:!0,optional:!0,converter:Pe})],rw.prototype,"requireExplicitPolicy",void 0);x([S({type:j.Integer,context:1,implicit:!0,optional:!0,converter:Pe})],rw.prototype,"inhibitPolicyMapping",void 0);var op;class af{constructor(e={}){this.issuerDomainPolicy="",this.subjectDomainPolicy="",Object.assign(this,e)}}x([S({type:j.ObjectIdentifier})],af.prototype,"issuerDomainPolicy",void 0);x([S({type:j.ObjectIdentifier})],af.prototype,"subjectDomainPolicy",void 0);let hg=op=class extends Ee{constructor(e){super(e),Object.setPrototypeOf(this,op.prototype)}};hg=op=x([H({type:q.Sequence,itemType:af})],hg);var sp;const iw=`${Wn}.17`;let ap=sp=class extends pt{constructor(e){super(e),Object.setPrototypeOf(this,sp.prototype)}};ap=sp=x([H({type:q.Sequence})],ap);let Un=class{constructor(e={}){this.type="",this.values=[],Object.assign(this,e)}};x([S({type:j.ObjectIdentifier})],Un.prototype,"type",void 0);x([S({type:j.Any,repeated:"set"})],Un.prototype,"values",void 0);var cp;let gg=cp=class extends Ee{constructor(e){super(e),Object.setPrototypeOf(this,cp.prototype)}};gg=cp=x([H({type:q.Sequence,itemType:Un})],gg);const ow=`${Wn}.14`;class sr extends nf{}class sw{constructor(e={}){Object.assign(this,e)}}x([S({type:j.GeneralizedTime,context:0,implicit:!0,optional:!0})],sw.prototype,"notBefore",void 0);x([S({type:j.GeneralizedTime,context:1,implicit:!0,optional:!0})],sw.prototype,"notAfter",void 0);var Go;(function(t){t[t.keyUpdateAllowed=1]="keyUpdateAllowed",t[t.newExtensions=2]="newExtensions",t[t.pKIXCertificate=4]="pKIXCertificate"})(Go||(Go={}));class aw extends vl{toJSON(){const e=[],n=this.toNumber();return n&Go.pKIXCertificate&&e.push("pKIXCertificate"),n&Go.newExtensions&&e.push("newExtensions"),n&Go.keyUpdateAllowed&&e.push("keyUpdateAllowed"),e}toString(){return`[${this.toJSON().join(", ")}]`}}class cw{constructor(e={}){this.entrustVers="",this.entrustInfoFlags=new aw,Object.assign(this,e)}}x([S({type:j.GeneralString})],cw.prototype,"entrustVers",void 0);x([S({type:aw})],cw.prototype,"entrustInfoFlags",void 0);var lp;let mg=lp=class extends Ee{constructor(e){super(e),Object.setPrototypeOf(this,lp.prototype)}};mg=lp=x([H({type:q.Sequence,itemType:Ts})],mg);class Q{constructor(e={}){this.algorithm="",Object.assign(this,e)}isEqual(e){return e instanceof Q&&e.algorithm==this.algorithm&&(e.parameters&&this.parameters&&Zb(e.parameters,this.parameters)||e.parameters===this.parameters)}}x([S({type:j.ObjectIdentifier})],Q.prototype,"algorithm",void 0);x([S({type:j.Any,optional:!0})],Q.prototype,"parameters",void 0);class Yt{constructor(e={}){this.algorithm=new Q,this.subjectPublicKey=new ArrayBuffer(0),Object.assign(this,e)}}x([S({type:Q})],Yt.prototype,"algorithm",void 0);x([S({type:j.BitString})],Yt.prototype,"subjectPublicKey",void 0);let rt=class{constructor(e){if(e)if(typeof e=="string"||typeof e=="number"||e instanceof Date){const n=new Date(e);n.getUTCFullYear()>2049?this.generalTime=n:this.utcTime=n}else Object.assign(this,e)}getTime(){const e=this.utcTime||this.generalTime;if(!e)throw new Error("Cannot get time from CHOICE object");return e}};x([S({type:j.UTCTime})],rt.prototype,"utcTime",void 0);x([S({type:j.GeneralizedTime})],rt.prototype,"generalTime",void 0);rt=x([H({type:q.Choice})],rt);class Os{constructor(e){this.notBefore=new rt(new Date),this.notAfter=new rt(new Date),e&&(this.notBefore=new rt(e.notBefore),this.notAfter=new rt(e.notAfter))}}x([S({type:rt})],Os.prototype,"notBefore",void 0);x([S({type:rt})],Os.prototype,"notAfter",void 0);var up;let Bt=class lw{constructor(e={}){this.extnID="",this.critical=lw.CRITICAL,this.extnValue=new xe,Object.assign(this,e)}};Bt.CRITICAL=!1;x([S({type:j.ObjectIdentifier})],Bt.prototype,"extnID",void 0);x([S({type:j.Boolean,defaultValue:Bt.CRITICAL})],Bt.prototype,"critical",void 0);x([S({type:xe})],Bt.prototype,"extnValue",void 0);let lr=up=class extends Ee{constructor(e){super(e),Object.setPrototypeOf(this,up.prototype)}};lr=up=x([H({type:q.Sequence,itemType:Bt})],lr);var Hr;(function(t){t[t.v1=0]="v1",t[t.v2=1]="v2",t[t.v3=2]="v3"})(Hr||(Hr={}));class It{constructor(e={}){this.version=Hr.v1,this.serialNumber=new ArrayBuffer(0),this.signature=new Q,this.issuer=new Ke,this.validity=new Os,this.subject=new Ke,this.subjectPublicKeyInfo=new Yt,Object.assign(this,e)}}x([S({type:j.Integer,context:0,defaultValue:Hr.v1})],It.prototype,"version",void 0);x([S({type:j.Integer,converter:Pe})],It.prototype,"serialNumber",void 0);x([S({type:Q})],It.prototype,"signature",void 0);x([S({type:Ke})],It.prototype,"issuer",void 0);x([S({type:Os})],It.prototype,"validity",void 0);x([S({type:Ke})],It.prototype,"subject",void 0);x([S({type:Yt})],It.prototype,"subjectPublicKeyInfo",void 0);x([S({type:j.BitString,context:1,implicit:!0,optional:!0})],It.prototype,"issuerUniqueID",void 0);x([S({type:j.BitString,context:2,implicit:!0,optional:!0})],It.prototype,"subjectUniqueID",void 0);x([S({type:lr,context:3,optional:!0})],It.prototype,"extensions",void 0);class Vr{constructor(e={}){this.tbsCertificate=new It,this.signatureAlgorithm=new Q,this.signatureValue=new ArrayBuffer(0),Object.assign(this,e)}}x([S({type:It,raw:!0})],Vr.prototype,"tbsCertificate",void 0);x([S({type:Q})],Vr.prototype,"signatureAlgorithm",void 0);x([S({type:j.BitString})],Vr.prototype,"signatureValue",void 0);class zl{constructor(e={}){this.userCertificate=new ArrayBuffer(0),this.revocationDate=new rt,Object.assign(this,e)}}x([S({type:j.Integer,converter:Pe})],zl.prototype,"userCertificate",void 0);x([S({type:rt})],zl.prototype,"revocationDate",void 0);x([S({type:Bt,optional:!0,repeated:"sequence"})],zl.prototype,"crlEntryExtensions",void 0);class Jn{constructor(e={}){this.signature=new Q,this.issuer=new Ke,this.thisUpdate=new rt,Object.assign(this,e)}}x([S({type:j.Integer,optional:!0})],Jn.prototype,"version",void 0);x([S({type:Q})],Jn.prototype,"signature",void 0);x([S({type:Ke})],Jn.prototype,"issuer",void 0);x([S({type:rt})],Jn.prototype,"thisUpdate",void 0);x([S({type:rt,optional:!0})],Jn.prototype,"nextUpdate",void 0);x([S({type:zl,repeated:"sequence",optional:!0})],Jn.prototype,"revokedCertificates",void 0);x([S({type:Bt,optional:!0,context:0,repeated:"sequence"})],Jn.prototype,"crlExtensions",void 0);class cf{constructor(e={}){this.tbsCertList=new Jn,this.signatureAlgorithm=new Q,this.signature=new ArrayBuffer(0),Object.assign(this,e)}}x([S({type:Jn,raw:!0})],cf.prototype,"tbsCertList",void 0);x([S({type:Q})],cf.prototype,"signatureAlgorithm",void 0);x([S({type:j.BitString})],cf.prototype,"signature",void 0);class ro{constructor(e={}){this.issuer=new Ke,this.serialNumber=new ArrayBuffer(0),Object.assign(this,e)}}x([S({type:Ke})],ro.prototype,"issuer",void 0);x([S({type:j.Integer,converter:Pe})],ro.prototype,"serialNumber",void 0);let Ui=class{constructor(e={}){Object.assign(this,e)}};x([S({type:sr,context:0,implicit:!0})],Ui.prototype,"subjectKeyIdentifier",void 0);x([S({type:ro})],Ui.prototype,"issuerAndSerialNumber",void 0);Ui=x([H({type:q.Choice})],Ui);var Mn;(function(t){t[t.v0=0]="v0",t[t.v1=1]="v1",t[t.v2=2]="v2",t[t.v3=3]="v3",t[t.v4=4]="v4",t[t.v5=5]="v5"})(Mn||(Mn={}));let as=class extends Q{};as=x([H({type:q.Sequence})],as);let gc=class extends Q{};gc=x([H({type:q.Sequence})],gc);let bn=class extends Q{};bn=x([H({type:q.Sequence})],bn);let mc=class extends Q{};mc=x([H({type:q.Sequence})],mc);let _g=class extends Q{};_g=x([H({type:q.Sequence})],_g);let dp=class extends Q{};dp=x([H({type:q.Sequence})],dp);let io=class{constructor(e={}){this.attrType="",this.attrValues=[],Object.assign(this,e)}};x([S({type:j.ObjectIdentifier})],io.prototype,"attrType",void 0);x([S({type:j.Any,repeated:"set"})],io.prototype,"attrValues",void 0);var pp;class kn{constructor(e={}){this.version=Mn.v0,this.sid=new Ui,this.digestAlgorithm=new as,this.signatureAlgorithm=new gc,this.signature=new xe,Object.assign(this,e)}}x([S({type:j.Integer})],kn.prototype,"version",void 0);x([S({type:Ui})],kn.prototype,"sid",void 0);x([S({type:as})],kn.prototype,"digestAlgorithm",void 0);x([S({type:io,repeated:"set",context:0,implicit:!0,optional:!0,raw:!0})],kn.prototype,"signedAttrs",void 0);x([S({type:gc})],kn.prototype,"signatureAlgorithm",void 0);x([S({type:xe})],kn.prototype,"signature",void 0);x([S({type:io,repeated:"set",context:1,implicit:!0,optional:!0})],kn.prototype,"unsignedAttrs",void 0);let _c=pp=class extends Ee{constructor(e){super(e),Object.setPrototypeOf(this,pp.prototype)}};_c=pp=x([H({type:q.Set,itemType:kn})],_c);let yg=class extends kn{};yg=x([H({type:q.Sequence})],yg);let bg=class extends rt{};bg=x([H({type:q.Choice})],bg);class lf{constructor(e={}){this.acIssuer=new he,this.acSerial=0,this.attrs=[],Object.assign(this,e)}}x([S({type:he})],lf.prototype,"acIssuer",void 0);x([S({type:j.Integer})],lf.prototype,"acSerial",void 0);x([S({type:Un,repeated:"sequence"})],lf.prototype,"attrs",void 0);var fp;let yc=fp=class extends Ee{constructor(e){super(e),Object.setPrototypeOf(this,fp.prototype)}};yc=fp=x([H({type:q.Sequence,itemType:j.ObjectIdentifier})],yc);class Al{constructor(e={}){this.permitUnSpecified=!0,Object.assign(this,e)}}x([S({type:j.Integer,optional:!0})],Al.prototype,"pathLenConstraint",void 0);x([S({type:yc,implicit:!0,context:0,optional:!0})],Al.prototype,"permittedAttrs",void 0);x([S({type:yc,implicit:!0,context:1,optional:!0})],Al.prototype,"excludedAttrs",void 0);x([S({type:j.Boolean,defaultValue:!0})],Al.prototype,"permitUnSpecified",void 0);class oi{constructor(e={}){this.issuer=new pt,this.serial=new ArrayBuffer(0),this.issuerUID=new ArrayBuffer(0),Object.assign(this,e)}}x([S({type:pt})],oi.prototype,"issuer",void 0);x([S({type:j.Integer,converter:Pe})],oi.prototype,"serial",void 0);x([S({type:j.BitString,optional:!0})],oi.prototype,"issuerUID",void 0);var hp;(function(t){t[t.publicKey=0]="publicKey",t[t.publicKeyCert=1]="publicKeyCert",t[t.otherObjectTypes=2]="otherObjectTypes"})(hp||(hp={}));class si{constructor(e={}){this.digestedObjectType=hp.publicKey,this.digestAlgorithm=new Q,this.objectDigest=new ArrayBuffer(0),Object.assign(this,e)}}x([S({type:j.Enumerated})],si.prototype,"digestedObjectType",void 0);x([S({type:j.ObjectIdentifier,optional:!0})],si.prototype,"otherObjectTypeID",void 0);x([S({type:Q})],si.prototype,"digestAlgorithm",void 0);x([S({type:j.BitString})],si.prototype,"objectDigest",void 0);class El{constructor(e={}){Object.assign(this,e)}}x([S({type:pt,optional:!0})],El.prototype,"issuerName",void 0);x([S({type:oi,context:0,implicit:!0,optional:!0})],El.prototype,"baseCertificateID",void 0);x([S({type:si,context:1,implicit:!0,optional:!0})],El.prototype,"objectDigestInfo",void 0);let Mi=class{constructor(e={}){Object.assign(this,e)}};x([S({type:he,repeated:"sequence"})],Mi.prototype,"v1Form",void 0);x([S({type:El,context:0,implicit:!0})],Mi.prototype,"v2Form",void 0);Mi=x([H({type:q.Choice})],Mi);class Cl{constructor(e={}){this.notBeforeTime=new Date,this.notAfterTime=new Date,Object.assign(this,e)}}x([S({type:j.GeneralizedTime})],Cl.prototype,"notBeforeTime",void 0);x([S({type:j.GeneralizedTime})],Cl.prototype,"notAfterTime",void 0);class Ps{constructor(e={}){Object.assign(this,e)}}x([S({type:oi,implicit:!0,context:0,optional:!0})],Ps.prototype,"baseCertificateID",void 0);x([S({type:pt,implicit:!0,context:1,optional:!0})],Ps.prototype,"entityName",void 0);x([S({type:si,implicit:!0,context:2,optional:!0})],Ps.prototype,"objectDigestInfo",void 0);var gp;(function(t){t[t.v2=1]="v2"})(gp||(gp={}));class cn{constructor(e={}){this.version=gp.v2,this.holder=new Ps,this.issuer=new Mi,this.signature=new Q,this.serialNumber=new ArrayBuffer(0),this.attrCertValidityPeriod=new Cl,this.attributes=[],Object.assign(this,e)}}x([S({type:j.Integer})],cn.prototype,"version",void 0);x([S({type:Ps})],cn.prototype,"holder",void 0);x([S({type:Mi})],cn.prototype,"issuer",void 0);x([S({type:Q})],cn.prototype,"signature",void 0);x([S({type:j.Integer,converter:Pe})],cn.prototype,"serialNumber",void 0);x([S({type:Cl})],cn.prototype,"attrCertValidityPeriod",void 0);x([S({type:Un,repeated:"sequence"})],cn.prototype,"attributes",void 0);x([S({type:j.BitString,optional:!0})],cn.prototype,"issuerUniqueID",void 0);x([S({type:lr,optional:!0})],cn.prototype,"extensions",void 0);class Nl{constructor(e={}){this.acinfo=new cn,this.signatureAlgorithm=new Q,this.signatureValue=new ArrayBuffer(0),Object.assign(this,e)}}x([S({type:cn})],Nl.prototype,"acinfo",void 0);x([S({type:Q})],Nl.prototype,"signatureAlgorithm",void 0);x([S({type:j.BitString})],Nl.prototype,"signatureValue",void 0);var bc;(function(t){t[t.unmarked=1]="unmarked",t[t.unclassified=2]="unclassified",t[t.restricted=4]="restricted",t[t.confidential=8]="confidential",t[t.secret=16]="secret",t[t.topSecret=32]="topSecret"})(bc||(bc={}));class mp extends vl{}class uf{constructor(e={}){this.type="",this.value=new ArrayBuffer(0),Object.assign(this,e)}}x([S({type:j.ObjectIdentifier,implicit:!0,context:0})],uf.prototype,"type",void 0);x([S({type:j.Any,implicit:!0,context:1})],uf.prototype,"value",void 0);class df{constructor(e={}){this.policyId="",this.classList=new mp(bc.unclassified),Object.assign(this,e)}}x([S({type:j.ObjectIdentifier})],df.prototype,"policyId",void 0);x([S({type:mp,defaultValue:new mp(bc.unclassified)})],df.prototype,"classList",void 0);x([S({type:uf,repeated:"set"})],df.prototype,"securityCategories",void 0);class Il{constructor(e={}){Object.assign(this,e)}}x([S({type:xe})],Il.prototype,"cotets",void 0);x([S({type:j.ObjectIdentifier})],Il.prototype,"oid",void 0);x([S({type:j.Utf8String})],Il.prototype,"string",void 0);class uw{constructor(e={}){this.values=[],Object.assign(this,e)}}x([S({type:pt,implicit:!0,context:0,optional:!0})],uw.prototype,"policyAuthority",void 0);x([S({type:Il,repeated:"sequence"})],uw.prototype,"values",void 0);var _p;class jl{constructor(e={}){this.targetCertificate=new oi,Object.assign(this,e)}}x([S({type:oi})],jl.prototype,"targetCertificate",void 0);x([S({type:he,optional:!0})],jl.prototype,"targetName",void 0);x([S({type:si,optional:!0})],jl.prototype,"certDigestInfo",void 0);let qi=class{constructor(e={}){Object.assign(this,e)}};x([S({type:he,context:0,implicit:!0})],qi.prototype,"targetName",void 0);x([S({type:he,context:1,implicit:!0})],qi.prototype,"targetGroup",void 0);x([S({type:jl,context:2,implicit:!0})],qi.prototype,"targetCert",void 0);qi=x([H({type:q.Choice})],qi);let yp=_p=class extends Ee{constructor(e){super(e),Object.setPrototypeOf(this,_p.prototype)}};yp=_p=x([H({type:q.Sequence,itemType:qi})],yp);var bp;let wg=bp=class extends Ee{constructor(e){super(e),Object.setPrototypeOf(this,bp.prototype)}};wg=bp=x([H({type:q.Sequence,itemType:yp})],wg);class dw{constructor(e={}){Object.assign(this,e)}}x([S({type:pt,implicit:!0,context:0,optional:!0})],dw.prototype,"roleAuthority",void 0);x([S({type:he,implicit:!0,context:1})],dw.prototype,"roleName",void 0);class pf{constructor(e={}){this.service=new he,this.ident=new he,Object.assign(this,e)}}x([S({type:he})],pf.prototype,"service",void 0);x([S({type:he})],pf.prototype,"ident",void 0);x([S({type:xe,optional:!0})],pf.prototype,"authInfo",void 0);var wp;class ff{constructor(e={}){this.otherCertFormat="",this.otherCert=new ArrayBuffer(0),Object.assign(this,e)}}x([S({type:j.ObjectIdentifier})],ff.prototype,"otherCertFormat",void 0);x([S({type:j.Any})],ff.prototype,"otherCert",void 0);let Fi=class{constructor(e={}){Object.assign(this,e)}};x([S({type:Vr})],Fi.prototype,"certificate",void 0);x([S({type:Nl,context:2,implicit:!0})],Fi.prototype,"v2AttrCert",void 0);x([S({type:ff,context:3,implicit:!0})],Fi.prototype,"other",void 0);Fi=x([H({type:q.Choice})],Fi);let wc=wp=class extends Ee{constructor(e){super(e),Object.setPrototypeOf(this,wp.prototype)}};wc=wp=x([H({type:q.Set,itemType:Fi})],wc);class oo{constructor(e={}){this.contentType="",this.content=new ArrayBuffer(0),Object.assign(this,e)}}x([S({type:j.ObjectIdentifier})],oo.prototype,"contentType",void 0);x([S({type:j.Any,context:0})],oo.prototype,"content",void 0);let cs=class{constructor(e={}){Object.assign(this,e)}};x([S({type:xe})],cs.prototype,"single",void 0);x([S({type:j.Any})],cs.prototype,"any",void 0);cs=x([H({type:q.Choice})],cs);class Tl{constructor(e={}){this.eContentType="",Object.assign(this,e)}}x([S({type:j.ObjectIdentifier})],Tl.prototype,"eContentType",void 0);x([S({type:cs,context:0,optional:!0})],Tl.prototype,"eContent",void 0);let ls=class{constructor(e={}){Object.assign(this,e)}};x([S({type:xe,context:0,implicit:!0,optional:!0})],ls.prototype,"value",void 0);x([S({type:xe,converter:yx,context:0,implicit:!0,optional:!0,repeated:"sequence"})],ls.prototype,"constructedValue",void 0);ls=x([H({type:q.Choice})],ls);class Rs{constructor(e={}){this.contentType="",this.contentEncryptionAlgorithm=new mc,Object.assign(this,e)}}x([S({type:j.ObjectIdentifier})],Rs.prototype,"contentType",void 0);x([S({type:mc})],Rs.prototype,"contentEncryptionAlgorithm",void 0);x([S({type:ls,optional:!0})],Rs.prototype,"encryptedContent",void 0);class Ol{constructor(e={}){this.keyAttrId="",Object.assign(this,e)}}x([S({type:j.ObjectIdentifier})],Ol.prototype,"keyAttrId",void 0);x([S({type:j.Any,optional:!0})],Ol.prototype,"keyAttr",void 0);var vp;class Pl{constructor(e={}){this.subjectKeyIdentifier=new sr,Object.assign(this,e)}}x([S({type:sr})],Pl.prototype,"subjectKeyIdentifier",void 0);x([S({type:j.GeneralizedTime,optional:!0})],Pl.prototype,"date",void 0);x([S({type:Ol,optional:!0})],Pl.prototype,"other",void 0);let Hi=class{constructor(e={}){Object.assign(this,e)}};x([S({type:Pl,context:0,implicit:!0,optional:!0})],Hi.prototype,"rKeyId",void 0);x([S({type:ro,optional:!0})],Hi.prototype,"issuerAndSerialNumber",void 0);Hi=x([H({type:q.Choice})],Hi);class hf{constructor(e={}){this.rid=new Hi,this.encryptedKey=new xe,Object.assign(this,e)}}x([S({type:Hi})],hf.prototype,"rid",void 0);x([S({type:xe})],hf.prototype,"encryptedKey",void 0);let vc=vp=class extends Ee{constructor(e){super(e),Object.setPrototypeOf(this,vp.prototype)}};vc=vp=x([H({type:q.Sequence,itemType:hf})],vc);class gf{constructor(e={}){this.algorithm=new Q,this.publicKey=new ArrayBuffer(0),Object.assign(this,e)}}x([S({type:Q})],gf.prototype,"algorithm",void 0);x([S({type:j.BitString})],gf.prototype,"publicKey",void 0);let Kr=class{constructor(e={}){Object.assign(this,e)}};x([S({type:sr,context:0,implicit:!0,optional:!0})],Kr.prototype,"subjectKeyIdentifier",void 0);x([S({type:gf,context:1,implicit:!0,optional:!0})],Kr.prototype,"originatorKey",void 0);x([S({type:ro,optional:!0})],Kr.prototype,"issuerAndSerialNumber",void 0);Kr=x([H({type:q.Choice})],Kr);class so{constructor(e={}){this.version=Mn.v3,this.originator=new Kr,this.keyEncryptionAlgorithm=new bn,this.recipientEncryptedKeys=new vc,Object.assign(this,e)}}x([S({type:j.Integer})],so.prototype,"version",void 0);x([S({type:Kr,context:0})],so.prototype,"originator",void 0);x([S({type:xe,context:1,optional:!0})],so.prototype,"ukm",void 0);x([S({type:bn})],so.prototype,"keyEncryptionAlgorithm",void 0);x([S({type:vc})],so.prototype,"recipientEncryptedKeys",void 0);let Vi=class{constructor(e={}){Object.assign(this,e)}};x([S({type:sr,context:0,implicit:!0})],Vi.prototype,"subjectKeyIdentifier",void 0);x([S({type:ro})],Vi.prototype,"issuerAndSerialNumber",void 0);Vi=x([H({type:q.Choice})],Vi);class Ls{constructor(e={}){this.version=Mn.v0,this.rid=new Vi,this.keyEncryptionAlgorithm=new bn,this.encryptedKey=new xe,Object.assign(this,e)}}x([S({type:j.Integer})],Ls.prototype,"version",void 0);x([S({type:Vi})],Ls.prototype,"rid",void 0);x([S({type:bn})],Ls.prototype,"keyEncryptionAlgorithm",void 0);x([S({type:xe})],Ls.prototype,"encryptedKey",void 0);class Bs{constructor(e={}){this.keyIdentifier=new xe,Object.assign(this,e)}}x([S({type:xe})],Bs.prototype,"keyIdentifier",void 0);x([S({type:j.GeneralizedTime,optional:!0})],Bs.prototype,"date",void 0);x([S({type:Ol,optional:!0})],Bs.prototype,"other",void 0);class Ds{constructor(e={}){this.version=Mn.v4,this.kekid=new Bs,this.keyEncryptionAlgorithm=new bn,this.encryptedKey=new xe,Object.assign(this,e)}}x([S({type:j.Integer})],Ds.prototype,"version",void 0);x([S({type:Bs})],Ds.prototype,"kekid",void 0);x([S({type:bn})],Ds.prototype,"keyEncryptionAlgorithm",void 0);x([S({type:xe})],Ds.prototype,"encryptedKey",void 0);class Us{constructor(e={}){this.version=Mn.v0,this.keyEncryptionAlgorithm=new bn,this.encryptedKey=new xe,Object.assign(this,e)}}x([S({type:j.Integer})],Us.prototype,"version",void 0);x([S({type:dp,context:0,optional:!0})],Us.prototype,"keyDerivationAlgorithm",void 0);x([S({type:bn})],Us.prototype,"keyEncryptionAlgorithm",void 0);x([S({type:xe})],Us.prototype,"encryptedKey",void 0);class mf{constructor(e={}){this.oriType="",this.oriValue=new ArrayBuffer(0),Object.assign(this,e)}}x([S({type:j.ObjectIdentifier})],mf.prototype,"oriType",void 0);x([S({type:j.Any})],mf.prototype,"oriValue",void 0);let ur=class{constructor(e={}){Object.assign(this,e)}};x([S({type:Ls,optional:!0})],ur.prototype,"ktri",void 0);x([S({type:so,context:1,implicit:!0,optional:!0})],ur.prototype,"kari",void 0);x([S({type:Ds,context:2,implicit:!0,optional:!0})],ur.prototype,"kekri",void 0);x([S({type:Us,context:3,implicit:!0,optional:!0})],ur.prototype,"pwri",void 0);x([S({type:mf,context:4,implicit:!0,optional:!0})],ur.prototype,"ori",void 0);ur=x([H({type:q.Choice})],ur);var xp;let xc=xp=class extends Ee{constructor(e){super(e),Object.setPrototypeOf(this,xp.prototype)}};xc=xp=x([H({type:q.Set,itemType:ur})],xc);var kp;class Rl{constructor(e={}){this.otherRevInfoFormat="",this.otherRevInfo=new ArrayBuffer(0),Object.assign(this,e)}}x([S({type:j.ObjectIdentifier})],Rl.prototype,"otherRevInfoFormat",void 0);x([S({type:j.Any})],Rl.prototype,"otherRevInfo",void 0);let kc=class{constructor(e={}){this.other=new Rl,Object.assign(this,e)}};x([S({type:Rl,context:1,implicit:!0})],kc.prototype,"other",void 0);kc=x([H({type:q.Choice})],kc);let $c=kp=class extends Ee{constructor(e){super(e),Object.setPrototypeOf(this,kp.prototype)}};$c=kp=x([H({type:q.Set,itemType:kc})],$c);class _f{constructor(e={}){Object.assign(this,e)}}x([S({type:wc,context:0,implicit:!0,optional:!0})],_f.prototype,"certs",void 0);x([S({type:$c,context:1,implicit:!0,optional:!0})],_f.prototype,"crls",void 0);var $p;let Sp=$p=class extends Ee{constructor(e){super(e),Object.setPrototypeOf(this,$p.prototype)}};Sp=$p=x([H({type:q.Set,itemType:io})],Sp);class Ms{constructor(e={}){this.version=Mn.v0,this.recipientInfos=new xc,this.encryptedContentInfo=new Rs,Object.assign(this,e)}}x([S({type:j.Integer})],Ms.prototype,"version",void 0);x([S({type:_f,context:0,implicit:!0,optional:!0})],Ms.prototype,"originatorInfo",void 0);x([S({type:xc})],Ms.prototype,"recipientInfos",void 0);x([S({type:Rs})],Ms.prototype,"encryptedContentInfo",void 0);x([S({type:Sp,context:1,implicit:!0,optional:!0})],Ms.prototype,"unprotectedAttrs",void 0);const Hx="1.2.840.113549.1.7.2";var zp;let Sc=zp=class extends Ee{constructor(e){super(e),Object.setPrototypeOf(this,zp.prototype)}};Sc=zp=x([H({type:q.Set,itemType:as})],Sc);class ao{constructor(e={}){this.version=Mn.v0,this.digestAlgorithms=new Sc,this.encapContentInfo=new Tl,this.signerInfos=new _c,Object.assign(this,e)}}x([S({type:j.Integer})],ao.prototype,"version",void 0);x([S({type:Sc})],ao.prototype,"digestAlgorithms",void 0);x([S({type:Tl})],ao.prototype,"encapContentInfo",void 0);x([S({type:wc,context:0,implicit:!0,optional:!0})],ao.prototype,"certificates",void 0);x([S({type:$c,context:1,implicit:!0,optional:!0})],ao.prototype,"crls",void 0);x([S({type:_c})],ao.prototype,"signerInfos",void 0);const us="1.2.840.10045.2.1",yf="1.2.840.10045.4.1",pw="1.2.840.10045.4.3.1",bf="1.2.840.10045.4.3.2",wf="1.2.840.10045.4.3.3",vf="1.2.840.10045.4.3.4",vg="1.2.840.10045.3.1.7",xg="1.3.132.0.34",kg="1.3.132.0.35";function qs(t){return new Q({algorithm:t})}const Vx=qs(yf);qs(pw);const Kx=qs(bf),Gx=qs(wf),Wx=qs(vf);let ds=class{constructor(e={}){Object.assign(this,e)}};x([S({type:j.ObjectIdentifier})],ds.prototype,"fieldType",void 0);x([S({type:j.Any})],ds.prototype,"parameters",void 0);ds=x([H({type:q.Sequence})],ds);class Jx extends xe{}let Ki=class{constructor(e={}){Object.assign(this,e)}};x([S({type:j.OctetString})],Ki.prototype,"a",void 0);x([S({type:j.OctetString})],Ki.prototype,"b",void 0);x([S({type:j.BitString,optional:!0})],Ki.prototype,"seed",void 0);Ki=x([H({type:q.Sequence})],Ki);var Ap;(function(t){t[t.ecpVer1=1]="ecpVer1"})(Ap||(Ap={}));let qn=class{constructor(e={}){this.version=Ap.ecpVer1,Object.assign(this,e)}};x([S({type:j.Integer})],qn.prototype,"version",void 0);x([S({type:ds})],qn.prototype,"fieldID",void 0);x([S({type:Ki})],qn.prototype,"curve",void 0);x([S({type:Jx})],qn.prototype,"base",void 0);x([S({type:j.Integer,converter:Pe})],qn.prototype,"order",void 0);x([S({type:j.Integer,optional:!0})],qn.prototype,"cofactor",void 0);qn=x([H({type:q.Sequence})],qn);let dr=class{constructor(e={}){Object.assign(this,e)}};x([S({type:j.ObjectIdentifier})],dr.prototype,"namedCurve",void 0);x([S({type:j.Null})],dr.prototype,"implicitCurve",void 0);x([S({type:qn})],dr.prototype,"specifiedCurve",void 0);dr=x([H({type:q.Choice})],dr);class Ll{constructor(e={}){this.version=1,this.privateKey=new xe,Object.assign(this,e)}}x([S({type:j.Integer})],Ll.prototype,"version",void 0);x([S({type:xe})],Ll.prototype,"privateKey",void 0);x([S({type:dr,context:0,optional:!0})],Ll.prototype,"parameters",void 0);x([S({type:j.BitString,context:1,optional:!0})],Ll.prototype,"publicKey",void 0);class zc{constructor(e={}){this.r=new ArrayBuffer(0),this.s=new ArrayBuffer(0),Object.assign(this,e)}}x([S({type:j.Integer,converter:Pe})],zc.prototype,"r",void 0);x([S({type:j.Integer,converter:Pe})],zc.prototype,"s",void 0);const kt="1.2.840.113549.1.1",Gr=`${kt}.1`,Xx=`${kt}.7`,Zx=`${kt}.9`,Wo=`${kt}.10`,Yx=`${kt}.2`,Qx=`${kt}.4`,Ac=`${kt}.5`,ek=`${kt}.14`,Ep=`${kt}.11`,Ec=`${kt}.12`,Cc=`${kt}.13`,fw=`${kt}.15`,hw=`${kt}.16`,Nc="1.3.14.3.2.26",gw="2.16.840.1.101.3.4.2.4",Ic="2.16.840.1.101.3.4.2.1",jc="2.16.840.1.101.3.4.2.2",Tc="2.16.840.1.101.3.4.2.3",tk="2.16.840.1.101.3.4.2.5",nk="2.16.840.1.101.3.4.2.6",rk="1.2.840.113549.2.2",ik="1.2.840.113549.2.5",Bl=`${kt}.8`;function Ye(t){return new Q({algorithm:t,parameters:null})}Ye(rk);Ye(ik);const Wr=Ye(Nc);Ye(gw);Ye(Ic);Ye(jc);Ye(Tc);Ye(tk);Ye(nk);const mw=new Q({algorithm:Bl,parameters:G.serialize(Wr)}),_w=new Q({algorithm:Zx,parameters:G.serialize(cc.toASN(new Uint8Array([218,57,163,238,94,107,75,13,50,85,191,239,149,96,24,144,175,216,7,9]).buffer))});Ye(Gr);Ye(Yx);Ye(Qx);Ye(Ac);Ye(fw);Ye(hw);Ye(Ec);Ye(Cc);Ye(fw);Ye(hw);class Dl{constructor(e={}){this.hashAlgorithm=new Q(Wr),this.maskGenAlgorithm=new Q({algorithm:Bl,parameters:G.serialize(Wr)}),this.pSourceAlgorithm=new Q(_w),Object.assign(this,e)}}x([S({type:Q,context:0,defaultValue:Wr})],Dl.prototype,"hashAlgorithm",void 0);x([S({type:Q,context:1,defaultValue:mw})],Dl.prototype,"maskGenAlgorithm",void 0);x([S({type:Q,context:2,defaultValue:_w})],Dl.prototype,"pSourceAlgorithm",void 0);new Q({algorithm:Xx,parameters:G.serialize(new Dl)});class Jr{constructor(e={}){this.hashAlgorithm=new Q(Wr),this.maskGenAlgorithm=new Q({algorithm:Bl,parameters:G.serialize(Wr)}),this.saltLength=20,this.trailerField=1,Object.assign(this,e)}}x([S({type:Q,context:0,defaultValue:Wr})],Jr.prototype,"hashAlgorithm",void 0);x([S({type:Q,context:1,defaultValue:mw})],Jr.prototype,"maskGenAlgorithm",void 0);x([S({type:j.Integer,context:2,defaultValue:20})],Jr.prototype,"saltLength",void 0);x([S({type:j.Integer,context:3,defaultValue:1})],Jr.prototype,"trailerField",void 0);new Q({algorithm:Wo,parameters:G.serialize(new Jr)});class Ul{constructor(e={}){this.digestAlgorithm=new Q,this.digest=new xe,Object.assign(this,e)}}x([S({type:Q})],Ul.prototype,"digestAlgorithm",void 0);x([S({type:xe})],Ul.prototype,"digest",void 0);var Cp;class Ml{constructor(e={}){this.prime=new ArrayBuffer(0),this.exponent=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,e)}}x([S({type:j.Integer,converter:Pe})],Ml.prototype,"prime",void 0);x([S({type:j.Integer,converter:Pe})],Ml.prototype,"exponent",void 0);x([S({type:j.Integer,converter:Pe})],Ml.prototype,"coefficient",void 0);let Np=Cp=class extends Ee{constructor(e){super(e),Object.setPrototypeOf(this,Cp.prototype)}};Np=Cp=x([H({type:q.Sequence,itemType:Ml})],Np);class $n{constructor(e={}){this.version=0,this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),this.privateExponent=new ArrayBuffer(0),this.prime1=new ArrayBuffer(0),this.prime2=new ArrayBuffer(0),this.exponent1=new ArrayBuffer(0),this.exponent2=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0),Object.assign(this,e)}}x([S({type:j.Integer})],$n.prototype,"version",void 0);x([S({type:j.Integer,converter:Pe})],$n.prototype,"modulus",void 0);x([S({type:j.Integer,converter:Pe})],$n.prototype,"publicExponent",void 0);x([S({type:j.Integer,converter:Pe})],$n.prototype,"privateExponent",void 0);x([S({type:j.Integer,converter:Pe})],$n.prototype,"prime1",void 0);x([S({type:j.Integer,converter:Pe})],$n.prototype,"prime2",void 0);x([S({type:j.Integer,converter:Pe})],$n.prototype,"exponent1",void 0);x([S({type:j.Integer,converter:Pe})],$n.prototype,"exponent2",void 0);x([S({type:j.Integer,converter:Pe})],$n.prototype,"coefficient",void 0);x([S({type:Np,optional:!0})],$n.prototype,"otherPrimeInfos",void 0);class xf{constructor(e={}){this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),Object.assign(this,e)}}x([S({type:j.Integer,converter:Pe})],xf.prototype,"modulus",void 0);x([S({type:j.Integer,converter:Pe})],xf.prototype,"publicExponent",void 0);var Ip;(function(t){t[t.Transient=0]="Transient",t[t.Singleton=1]="Singleton",t[t.ResolutionScoped=2]="ResolutionScoped",t[t.ContainerScoped=3]="ContainerScoped"})(Ip||(Ip={}));const yt=Ip;var jp=function(t,e){return jp=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)r.hasOwnProperty(i)&&(n[i]=r[i])},jp(t,e)};function kf(t,e){jp(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}function ok(t,e,n,r){function i(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=Promise))(function(s,a){function c(d){try{u(r.next(d))}catch(f){a(f)}}function l(d){try{u(r.throw(d))}catch(f){a(f)}}function u(d){d.done?s(d.value):i(d.value).then(c,l)}u((r=r.apply(t,[])).next())})}function sk(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,a;return a={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(u){return function(d){return l([u,d])}}function l(u){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){n.label=u[1];break}if(u[0]===6&&n.label<s[1]){n.label=s[1],s=u;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(u);break}s[2]&&n.ops.pop(),n.trys.pop();continue}u=e.call(t,n)}catch(d){u=[6,d],i=0}finally{r=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function oa(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Oc(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],a;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(c){a={error:c}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return s}function zr(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Oc(arguments[e]));return t}var ak="injectionTokens";function ck(t){var e=Reflect.getMetadata("design:paramtypes",t)||[],n=Reflect.getOwnMetadata(ak,t)||{};return Object.keys(n).forEach(function(r){e[+r]=n[r]}),e}function yw(t){return!!t.useClass}function Tp(t){return!!t.useFactory}var bw=(function(){function t(e){this.wrap=e,this.reflectMethods=["get","getPrototypeOf","setPrototypeOf","getOwnPropertyDescriptor","defineProperty","has","set","deleteProperty","apply","construct","ownKeys"]}return t.prototype.createProxy=function(e){var n=this,r={},i=!1,s,a=function(){return i||(s=e(n.wrap()),i=!0),s};return new Proxy(r,this.createHandler(a))},t.prototype.createHandler=function(e){var n={},r=function(i){n[i]=function(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];s[0]=e();var c=Reflect[i];return c.apply(void 0,zr(s))}};return this.reflectMethods.forEach(r),n},t})();function fi(t){return typeof t=="string"||typeof t=="symbol"}function lk(t){return typeof t=="object"&&"token"in t&&"multiple"in t}function $g(t){return typeof t=="object"&&"token"in t&&"transform"in t}function uk(t){return typeof t=="function"||t instanceof bw}function Aa(t){return!!t.useToken}function Ea(t){return t.useValue!=null}function dk(t){return yw(t)||Ea(t)||Aa(t)||Tp(t)}var $f=(function(){function t(){this._registryMap=new Map}return t.prototype.entries=function(){return this._registryMap.entries()},t.prototype.getAll=function(e){return this.ensure(e),this._registryMap.get(e)},t.prototype.get=function(e){this.ensure(e);var n=this._registryMap.get(e);return n[n.length-1]||null},t.prototype.set=function(e,n){this.ensure(e),this._registryMap.get(e).push(n)},t.prototype.setAll=function(e,n){this._registryMap.set(e,n)},t.prototype.has=function(e){return this.ensure(e),this._registryMap.get(e).length>0},t.prototype.clear=function(){this._registryMap.clear()},t.prototype.ensure=function(e){this._registryMap.has(e)||this._registryMap.set(e,[])},t})(),pk=(function(t){kf(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})($f),sa=(function(){function t(){this.scopedResolutions=new Map}return t})();function fk(t,e){if(t===null)return"at position #"+e;var n=t.split(",")[e].trim();return'"'+n+'" at position #'+e}function hk(t,e,n){return n===void 0&&(n=" "),zr([t],e.message.split(`
|
|
72
|
+
`).map(function(r){return n+r})).join(`
|
|
73
|
+
`)}function gk(t,e,n){var r=Oc(t.toString().match(/constructor\(([\w, ]+)\)/)||[],2),i=r[1],s=i===void 0?null:i,a=fk(s,e);return hk("Cannot inject the dependency "+a+' of "'+t.name+'" constructor. Reason:',n)}function mk(t){if(typeof t.dispose!="function")return!1;var e=t.dispose;return!(e.length>0)}var _k=(function(t){kf(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})($f),yk=(function(t){kf(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})($f),bk=(function(){function t(){this.preResolution=new _k,this.postResolution=new yk}return t})(),ww=new Map,wk=(function(){function t(e){this.parent=e,this._registry=new pk,this.interceptors=new bk,this.disposed=!1,this.disposables=new Set}return t.prototype.register=function(e,n,r){r===void 0&&(r={lifecycle:yt.Transient}),this.ensureNotDisposed();var i;if(dk(n)?i=n:i={useClass:n},Aa(i))for(var s=[e],a=i;a!=null;){var c=a.useToken;if(s.includes(c))throw new Error("Token registration cycle detected! "+zr(s,[c]).join(" -> "));s.push(c);var l=this._registry.get(c);l&&Aa(l.provider)?a=l.provider:a=null}if((r.lifecycle===yt.Singleton||r.lifecycle==yt.ContainerScoped||r.lifecycle==yt.ResolutionScoped)&&(Ea(i)||Tp(i)))throw new Error('Cannot use lifecycle "'+yt[r.lifecycle]+'" with ValueProviders or FactoryProviders');return this._registry.set(e,{provider:i,options:r}),this},t.prototype.registerType=function(e,n){return this.ensureNotDisposed(),fi(n)?this.register(e,{useToken:n}):this.register(e,{useClass:n})},t.prototype.registerInstance=function(e,n){return this.ensureNotDisposed(),this.register(e,{useValue:n})},t.prototype.registerSingleton=function(e,n){if(this.ensureNotDisposed(),fi(e)){if(fi(n))return this.register(e,{useToken:n},{lifecycle:yt.Singleton});if(n)return this.register(e,{useClass:n},{lifecycle:yt.Singleton});throw new Error('Cannot register a type name as a singleton without a "to" token')}var r=e;return n&&!fi(n)&&(r=n),this.register(e,{useClass:r},{lifecycle:yt.Singleton})},t.prototype.resolve=function(e,n,r){n===void 0&&(n=new sa),r===void 0&&(r=!1),this.ensureNotDisposed();var i=this.getRegistration(e);if(!i&&fi(e)){if(r)return;throw new Error('Attempted to resolve unregistered dependency token: "'+e.toString()+'"')}if(this.executePreResolutionInterceptor(e,"Single"),i){var s=this.resolveRegistration(i,n);return this.executePostResolutionInterceptor(e,s,"Single"),s}if(uk(e)){var s=this.construct(e,n);return this.executePostResolutionInterceptor(e,s,"Single"),s}throw new Error("Attempted to construct an undefined constructor. Could mean a circular dependency problem. Try using `delay` function.")},t.prototype.executePreResolutionInterceptor=function(e,n){var r,i;if(this.interceptors.preResolution.has(e)){var s=[];try{for(var a=oa(this.interceptors.preResolution.getAll(e)),c=a.next();!c.done;c=a.next()){var l=c.value;l.options.frequency!="Once"&&s.push(l),l.callback(e,n)}}catch(u){r={error:u}}finally{try{c&&!c.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}this.interceptors.preResolution.setAll(e,s)}},t.prototype.executePostResolutionInterceptor=function(e,n,r){var i,s;if(this.interceptors.postResolution.has(e)){var a=[];try{for(var c=oa(this.interceptors.postResolution.getAll(e)),l=c.next();!l.done;l=c.next()){var u=l.value;u.options.frequency!="Once"&&a.push(u),u.callback(e,n,r)}}catch(d){i={error:d}}finally{try{l&&!l.done&&(s=c.return)&&s.call(c)}finally{if(i)throw i.error}}this.interceptors.postResolution.setAll(e,a)}},t.prototype.resolveRegistration=function(e,n){if(this.ensureNotDisposed(),e.options.lifecycle===yt.ResolutionScoped&&n.scopedResolutions.has(e))return n.scopedResolutions.get(e);var r=e.options.lifecycle===yt.Singleton,i=e.options.lifecycle===yt.ContainerScoped,s=r||i,a;return Ea(e.provider)?a=e.provider.useValue:Aa(e.provider)?a=s?e.instance||(e.instance=this.resolve(e.provider.useToken,n)):this.resolve(e.provider.useToken,n):yw(e.provider)?a=s?e.instance||(e.instance=this.construct(e.provider.useClass,n)):this.construct(e.provider.useClass,n):Tp(e.provider)?a=e.provider.useFactory(this):a=this.construct(e.provider,n),e.options.lifecycle===yt.ResolutionScoped&&n.scopedResolutions.set(e,a),a},t.prototype.resolveAll=function(e,n,r){var i=this;n===void 0&&(n=new sa),r===void 0&&(r=!1),this.ensureNotDisposed();var s=this.getAllRegistrations(e);if(!s&&fi(e)){if(r)return[];throw new Error('Attempted to resolve unregistered dependency token: "'+e.toString()+'"')}if(this.executePreResolutionInterceptor(e,"All"),s){var a=s.map(function(l){return i.resolveRegistration(l,n)});return this.executePostResolutionInterceptor(e,a,"All"),a}var c=[this.construct(e,n)];return this.executePostResolutionInterceptor(e,c,"All"),c},t.prototype.isRegistered=function(e,n){return n===void 0&&(n=!1),this.ensureNotDisposed(),this._registry.has(e)||n&&(this.parent||!1)&&this.parent.isRegistered(e,!0)},t.prototype.reset=function(){this.ensureNotDisposed(),this._registry.clear(),this.interceptors.preResolution.clear(),this.interceptors.postResolution.clear()},t.prototype.clearInstances=function(){var e,n;this.ensureNotDisposed();try{for(var r=oa(this._registry.entries()),i=r.next();!i.done;i=r.next()){var s=Oc(i.value,2),a=s[0],c=s[1];this._registry.setAll(a,c.filter(function(l){return!Ea(l.provider)}).map(function(l){return l.instance=void 0,l}))}}catch(l){e={error:l}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}},t.prototype.createChildContainer=function(){var e,n;this.ensureNotDisposed();var r=new t(this);try{for(var i=oa(this._registry.entries()),s=i.next();!s.done;s=i.next()){var a=Oc(s.value,2),c=a[0],l=a[1];l.some(function(u){var d=u.options;return d.lifecycle===yt.ContainerScoped})&&r._registry.setAll(c,l.map(function(u){return u.options.lifecycle===yt.ContainerScoped?{provider:u.provider,options:u.options}:u}))}}catch(u){e={error:u}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r},t.prototype.beforeResolution=function(e,n,r){r===void 0&&(r={frequency:"Always"}),this.interceptors.preResolution.set(e,{callback:n,options:r})},t.prototype.afterResolution=function(e,n,r){r===void 0&&(r={frequency:"Always"}),this.interceptors.postResolution.set(e,{callback:n,options:r})},t.prototype.dispose=function(){return ok(this,void 0,void 0,function(){var e;return sk(this,function(n){switch(n.label){case 0:return this.disposed=!0,e=[],this.disposables.forEach(function(r){var i=r.dispose();i&&e.push(i)}),[4,Promise.all(e)];case 1:return n.sent(),[2]}})})},t.prototype.getRegistration=function(e){return this.isRegistered(e)?this._registry.get(e):this.parent?this.parent.getRegistration(e):null},t.prototype.getAllRegistrations=function(e){return this.isRegistered(e)?this._registry.getAll(e):this.parent?this.parent.getAllRegistrations(e):null},t.prototype.construct=function(e,n){var r=this;if(e instanceof bw)return e.createProxy(function(s){return r.resolve(s,n)});var i=(function(){var s=ww.get(e);if(!s||s.length===0){if(e.length===0)return new e;throw new Error('TypeInfo not known for "'+e.name+'"')}var a=s.map(r.resolveParams(n,e));return new(e.bind.apply(e,zr([void 0],a)))})();return mk(i)&&this.disposables.add(i),i},t.prototype.resolveParams=function(e,n){var r=this;return function(i,s){var a,c,l;try{return lk(i)?$g(i)?i.multiple?(a=r.resolve(i.transform)).transform.apply(a,zr([r.resolveAll(i.token,new sa,i.isOptional)],i.transformArgs)):(c=r.resolve(i.transform)).transform.apply(c,zr([r.resolve(i.token,e,i.isOptional)],i.transformArgs)):i.multiple?r.resolveAll(i.token,new sa,i.isOptional):r.resolve(i.token,e,i.isOptional):$g(i)?(l=r.resolve(i.transform,e)).transform.apply(l,zr([r.resolve(i.token,e)],i.transformArgs)):r.resolve(i,e)}catch(u){throw new Error(gk(n,s,u))}}},t.prototype.ensureNotDisposed=function(){if(this.disposed)throw new Error("This container has been disposed, you cannot interact with a disposed container")},t})(),at=new wk;function ql(t){return function(e){ww.set(e,ck(e))}}if(typeof Reflect>"u"||!Reflect.getMetadata)throw new Error(`tsyringe requires a reflect polyfill. Please add 'import "reflect-metadata"' to the top of your entry point.`);var Op;class Fl{constructor(e={}){this.attrId="",this.attrValues=[],Object.assign(e)}}x([S({type:j.ObjectIdentifier})],Fl.prototype,"attrId",void 0);x([S({type:j.Any,repeated:"set"})],Fl.prototype,"attrValues",void 0);let Sg=Op=class extends Ee{constructor(e){super(e),Object.setPrototypeOf(this,Op.prototype)}};Sg=Op=x([H({type:q.Sequence,itemType:Fl})],Sg);var Pp;let zg=Pp=class extends Ee{constructor(e){super(e),Object.setPrototypeOf(this,Pp.prototype)}};zg=Pp=x([H({type:q.Sequence,itemType:oo})],zg);class vw{constructor(e={}){this.certId="",this.certValue=new ArrayBuffer(0),Object.assign(this,e)}}x([S({type:j.ObjectIdentifier})],vw.prototype,"certId",void 0);x([S({type:j.Any,context:0})],vw.prototype,"certValue",void 0);class xw{constructor(e={}){this.crlId="",this.crltValue=new ArrayBuffer(0),Object.assign(this,e)}}x([S({type:j.ObjectIdentifier})],xw.prototype,"crlId",void 0);x([S({type:j.Any,context:0})],xw.prototype,"crltValue",void 0);class kw extends xe{}let Hl=class{constructor(e={}){this.encryptionAlgorithm=new Q,this.encryptedData=new kw,Object.assign(this,e)}};x([S({type:Q})],Hl.prototype,"encryptionAlgorithm",void 0);x([S({type:kw})],Hl.prototype,"encryptedData",void 0);var Rp,Lp;(function(t){t[t.v1=0]="v1"})(Lp||(Lp={}));class $w extends xe{}let Bp=Rp=class extends Ee{constructor(e){super(e),Object.setPrototypeOf(this,Rp.prototype)}};Bp=Rp=x([H({type:q.Sequence,itemType:Un})],Bp);class Fs{constructor(e={}){this.version=Lp.v1,this.privateKeyAlgorithm=new Q,this.privateKey=new $w,Object.assign(this,e)}}x([S({type:j.Integer})],Fs.prototype,"version",void 0);x([S({type:Q})],Fs.prototype,"privateKeyAlgorithm",void 0);x([S({type:$w})],Fs.prototype,"privateKey",void 0);x([S({type:Bp,implicit:!0,context:0,optional:!0})],Fs.prototype,"attributes",void 0);let Ag=class extends Fs{};Ag=x([H({type:q.Sequence})],Ag);let Eg=class extends Hl{};Eg=x([H({type:q.Sequence})],Eg);class Sw{constructor(e={}){this.secretTypeId="",this.secretValue=new ArrayBuffer(0),Object.assign(this,e)}}x([S({type:j.ObjectIdentifier})],Sw.prototype,"secretTypeId",void 0);x([S({type:j.Any,context:0})],Sw.prototype,"secretValue",void 0);class Hs{constructor(e={}){this.mac=new Ul,this.macSalt=new xe,this.iterations=1,Object.assign(this,e)}}x([S({type:Ul})],Hs.prototype,"mac",void 0);x([S({type:xe})],Hs.prototype,"macSalt",void 0);x([S({type:j.Integer,defaultValue:1})],Hs.prototype,"iterations",void 0);class Vl{constructor(e={}){this.version=3,this.authSafe=new oo,this.macData=new Hs,Object.assign(this,e)}}x([S({type:j.Integer})],Vl.prototype,"version",void 0);x([S({type:oo})],Vl.prototype,"authSafe",void 0);x([S({type:Hs,optional:!0})],Vl.prototype,"macData",void 0);var Dp;class Kl{constructor(e={}){this.bagId="",this.bagValue=new ArrayBuffer(0),Object.assign(this,e)}}x([S({type:j.ObjectIdentifier})],Kl.prototype,"bagId",void 0);x([S({type:j.Any,context:0})],Kl.prototype,"bagValue",void 0);x([S({type:Fl,repeated:"set",optional:!0})],Kl.prototype,"bagAttributes",void 0);let Cg=Dp=class extends Ee{constructor(e){super(e),Object.setPrototypeOf(this,Dp.prototype)}};Cg=Dp=x([H({type:q.Sequence,itemType:Kl})],Cg);var Up,Mp,qp;const zw="1.2.840.113549.1.9",Aw=`${zw}.7`,Sf=`${zw}.14`;let Pc=class extends st{constructor(e={}){super(e)}toString(){return this.ia5String||super.toString()}};x([S({type:j.IA5String})],Pc.prototype,"ia5String",void 0);Pc=x([H({type:q.Choice})],Pc);let Ng=class extends oo{};Ng=x([H({type:q.Sequence})],Ng);let Ig=class extends Vl{};Ig=x([H({type:q.Sequence})],Ig);let jg=class extends Hl{};jg=x([H({type:q.Sequence})],jg);let Fp=class{constructor(e=""){this.value=e}toString(){return this.value}};x([S({type:j.IA5String})],Fp.prototype,"value",void 0);Fp=x([H({type:q.Choice})],Fp);let Tg=class extends Pc{};Tg=x([H({type:q.Choice})],Tg);let Og=class extends st{};Og=x([H({type:q.Choice})],Og);let Hp=class{constructor(e=new Date){this.value=e}};x([S({type:j.GeneralizedTime})],Hp.prototype,"value",void 0);Hp=x([H({type:q.Choice})],Hp);let Pg=class extends st{};Pg=x([H({type:q.Choice})],Pg);let Vp=class{constructor(e="M"){this.value=e}toString(){return this.value}};x([S({type:j.PrintableString})],Vp.prototype,"value",void 0);Vp=x([H({type:q.Choice})],Vp);let Rc=class{constructor(e=""){this.value=e}toString(){return this.value}};x([S({type:j.PrintableString})],Rc.prototype,"value",void 0);Rc=x([H({type:q.Choice})],Rc);let Rg=class extends Rc{};Rg=x([H({type:q.Choice})],Rg);let Lg=class extends st{};Lg=x([H({type:q.Choice})],Lg);let Kp=class{constructor(e=""){this.value=e}toString(){return this.value}};x([S({type:j.ObjectIdentifier})],Kp.prototype,"value",void 0);Kp=x([H({type:q.Choice})],Kp);let Bg=class extends rt{};Bg=x([H({type:q.Choice})],Bg);let Gp=class{constructor(e=0){this.value=e}toString(){return this.value.toString()}};x([S({type:j.Integer})],Gp.prototype,"value",void 0);Gp=x([H({type:q.Choice})],Gp);let Dg=class extends kn{};Dg=x([H({type:q.Sequence})],Dg);let Lc=class extends st{};Lc=x([H({type:q.Choice})],Lc);let Ug=Up=class extends lr{constructor(e){super(e),Object.setPrototypeOf(this,Up.prototype)}};Ug=Up=x([H({type:q.Sequence})],Ug);let Mg=Mp=class extends Ee{constructor(e){super(e),Object.setPrototypeOf(this,Mp.prototype)}};Mg=Mp=x([H({type:q.Set,itemType:io})],Mg);let Wp=class{constructor(e=""){this.value=e}toString(){return this.value}};x([S({type:j.BmpString})],Wp.prototype,"value",void 0);Wp=x([H({type:q.Choice})],Wp);let Jp=class extends Q{};Jp=x([H({type:q.Sequence})],Jp);let qg=qp=class extends Ee{constructor(e){super(e),Object.setPrototypeOf(this,qp.prototype)}};qg=qp=x([H({type:q.Sequence,itemType:Jp})],qg);var Xp;let Bc=Xp=class extends Ee{constructor(e){super(e),Object.setPrototypeOf(this,Xp.prototype)}};Bc=Xp=x([H({type:q.Sequence,itemType:Un})],Bc);class co{constructor(e={}){this.version=0,this.subject=new Ke,this.subjectPKInfo=new Yt,this.attributes=new Bc,Object.assign(this,e)}}x([S({type:j.Integer})],co.prototype,"version",void 0);x([S({type:Ke})],co.prototype,"subject",void 0);x([S({type:Yt})],co.prototype,"subjectPKInfo",void 0);x([S({type:Bc,implicit:!0,context:0,optional:!0})],co.prototype,"attributes",void 0);class ps{constructor(e={}){this.certificationRequestInfo=new co,this.signatureAlgorithm=new Q,this.signature=new ArrayBuffer(0),Object.assign(this,e)}}x([S({type:co,raw:!0})],ps.prototype,"certificationRequestInfo",void 0);x([S({type:Q})],ps.prototype,"signatureAlgorithm",void 0);x([S({type:j.BitString})],ps.prototype,"signature",void 0);const Vs="crypto.algorithm";class vk{getAlgorithms(){return at.resolveAll(Vs)}toAsnAlgorithm(e){({...e});for(const n of this.getAlgorithms()){const r=n.toAsnAlgorithm(e);if(r)return r}if(/^[0-9.]+$/.test(e.name)){const n=new Q({algorithm:e.name});if("parameters"in e){const r=e;n.parameters=r.parameters}return n}throw new Error("Cannot convert WebCrypto algorithm to ASN.1 algorithm")}toWebAlgorithm(e){for(const r of this.getAlgorithms()){const i=r.toWebAlgorithm(e);if(i)return i}return{name:e.algorithm,parameters:e.parameters}}}const Xr="crypto.algorithmProvider";at.registerSingleton(Xr,vk);var Ca;const $t="1.3.36.3.3.2.8.1.1",Fg=`${$t}.1`,Hg=`${$t}.2`,Vg=`${$t}.3`,Kg=`${$t}.4`,Gg=`${$t}.5`,Wg=`${$t}.6`,Jg=`${$t}.7`,Xg=`${$t}.8`,Zg=`${$t}.9`,Yg=`${$t}.10`,Qg=`${$t}.11`,em=`${$t}.12`,tm=`${$t}.13`,nm=`${$t}.14`,rm="brainpoolP160r1",im="brainpoolP160t1",om="brainpoolP192r1",sm="brainpoolP192t1",am="brainpoolP224r1",cm="brainpoolP224t1",lm="brainpoolP256r1",um="brainpoolP256t1",dm="brainpoolP320r1",pm="brainpoolP320t1",fm="brainpoolP384r1",hm="brainpoolP384t1",gm="brainpoolP512r1",mm="brainpoolP512t1",De="ECDSA";let fs=Ca=class{toAsnAlgorithm(e){switch(e.name.toLowerCase()){case De.toLowerCase():if("hash"in e)switch((typeof e.hash=="string"?e.hash:e.hash.name).toLowerCase()){case"sha-1":return Vx;case"sha-256":return Kx;case"sha-384":return Gx;case"sha-512":return Wx}else if("namedCurve"in e){let n="";switch(e.namedCurve){case"P-256":n=vg;break;case"K-256":n=Ca.SECP256K1;break;case"P-384":n=xg;break;case"P-521":n=kg;break;case rm:n=Fg;break;case im:n=Hg;break;case om:n=Vg;break;case sm:n=Kg;break;case am:n=Gg;break;case cm:n=Wg;break;case lm:n=Jg;break;case um:n=Xg;break;case dm:n=Zg;break;case pm:n=Yg;break;case fm:n=Qg;break;case hm:n=em;break;case gm:n=tm;break;case mm:n=nm;break}if(n)return new Q({algorithm:us,parameters:G.serialize(new dr({namedCurve:n}))})}}return null}toWebAlgorithm(e){switch(e.algorithm){case yf:return{name:De,hash:{name:"SHA-1"}};case bf:return{name:De,hash:{name:"SHA-256"}};case wf:return{name:De,hash:{name:"SHA-384"}};case vf:return{name:De,hash:{name:"SHA-512"}};case us:{if(!e.parameters)throw new TypeError("Cannot get required parameters from EC algorithm");switch(G.parse(e.parameters,dr).namedCurve){case vg:return{name:De,namedCurve:"P-256"};case Ca.SECP256K1:return{name:De,namedCurve:"K-256"};case xg:return{name:De,namedCurve:"P-384"};case kg:return{name:De,namedCurve:"P-521"};case Fg:return{name:De,namedCurve:rm};case Hg:return{name:De,namedCurve:im};case Vg:return{name:De,namedCurve:om};case Kg:return{name:De,namedCurve:sm};case Gg:return{name:De,namedCurve:am};case Wg:return{name:De,namedCurve:cm};case Jg:return{name:De,namedCurve:lm};case Xg:return{name:De,namedCurve:um};case Zg:return{name:De,namedCurve:dm};case Yg:return{name:De,namedCurve:pm};case Qg:return{name:De,namedCurve:fm};case em:return{name:De,namedCurve:hm};case tm:return{name:De,namedCurve:gm};case nm:return{name:De,namedCurve:mm}}}}return null}};fs.SECP256K1="1.3.132.0.10";fs=Ca=x([ql()],fs);at.registerSingleton(Vs,fs);const Ew=Symbol("name"),Cw=Symbol("value");class Se{constructor(e,n={},r=""){this[Ew]=e,this[Cw]=r;for(const i in n)this[i]=n[i]}}Se.NAME=Ew;Se.VALUE=Cw;class xk{static toTextObject(e){const n=new Se("Algorithm Identifier",{},_r.toString(e.algorithm));if(e.parameters)if(e.algorithm===us){const r=new fs().toWebAlgorithm(e);r&&"namedCurve"in r?n["Named Curve"]=r.namedCurve:n.Parameters=e.parameters}else n.Parameters=e.parameters;return n}}class _r{static toString(e){const n=this.items[e];return n||e}}_r.items={[Nc]:"sha1",[gw]:"sha224",[Ic]:"sha256",[jc]:"sha384",[Tc]:"sha512",[Gr]:"rsaEncryption",[Ac]:"sha1WithRSAEncryption",[ek]:"sha224WithRSAEncryption",[Ep]:"sha256WithRSAEncryption",[Ec]:"sha384WithRSAEncryption",[Cc]:"sha512WithRSAEncryption",[us]:"ecPublicKey",[yf]:"ecdsaWithSHA1",[pw]:"ecdsaWithSHA224",[bf]:"ecdsaWithSHA256",[wf]:"ecdsaWithSHA384",[vf]:"ecdsaWithSHA512",[Bx]:"TLS WWW server authentication",[Dx]:"TLS WWW client authentication",[Ux]:"Code Signing",[Mx]:"E-mail Protection",[qx]:"Time Stamping",[Fx]:"OCSP Signing",[Hx]:"Signed Data"};class Zr{static serialize(e){return this.serializeObj(e).join(`
|
|
74
|
+
`)}static pad(e=0){return"".padStart(2*e," ")}static serializeObj(e,n=0){const r=[];let i=this.pad(n++),s="";const a=e[Se.VALUE];a&&(s=` ${a}`),r.push(`${i}${e[Se.NAME]}:${s}`),i=this.pad(n);for(const c in e){if(typeof c=="symbol")continue;const l=e[c],u=c?`${c}: `:"";if(typeof l=="string"||typeof l=="number"||typeof l=="boolean")r.push(`${i}${u}${l}`);else if(l instanceof Date)r.push(`${i}${u}${l.toUTCString()}`);else if(Array.isArray(l))for(const d of l)d[Se.NAME]=c,r.push(...this.serializeObj(d,n));else if(l instanceof Se)l[Se.NAME]=c,r.push(...this.serializeObj(l,n));else if(W.isBufferSource(l))c?(r.push(`${i}${u}`),r.push(...this.serializeBufferSource(l,n+1))):r.push(...this.serializeBufferSource(l,n));else if("toTextObject"in l){const d=l.toTextObject();d[Se.NAME]=c,r.push(...this.serializeObj(d,n))}else throw new TypeError("Cannot serialize data in text format. Unsupported type.")}return r}static serializeBufferSource(e,n=0){const r=this.pad(n),i=W.toUint8Array(e),s=[];for(let a=0;a<i.length;){const c=[];for(let l=0;l<16&&a<i.length;l++){l===8&&c.push("");const u=i[a++].toString(16).padStart(2,"0");c.push(u)}s.push(`${r}${c.join(" ")}`)}return s}static serializeAlgorithm(e){return this.algorithmSerializer.toTextObject(e)}}Zr.oidSerializer=_r;Zr.algorithmSerializer=xk;var mi;class yr{get rawData(){return me(this,mi,"f")||Re(this,mi,G.serialize(this.asn),"f"),me(this,mi,"f")}constructor(...e){mi.set(this,void 0),W.isBufferSource(e[0])?(this.asn=G.parse(e[0],e[1]),Re(this,mi,W.toArrayBuffer(e[0]),"f"),this.onInit(this.asn)):(this.asn=e[0],this.onInit(this.asn))}equal(e){return e instanceof yr?Zb(e.rawData,this.rawData):!1}toString(e="text"){switch(e){case"asn":return G.toString(this.rawData);case"text":return Zr.serialize(this.toTextObject());case"hex":return ne.ToHex(this.rawData);case"base64":return ne.ToBase64(this.rawData);case"base64url":return ne.ToBase64Url(this.rawData);default:throw TypeError("Argument 'format' is unsupported value")}}getTextName(){return this.constructor.NAME}toTextObject(){const e=this.toTextObjectEmpty();return e[""]=this.rawData,e}toTextObjectEmpty(e){return new Se(this.getTextName(),{},e)}}mi=new WeakMap;yr.NAME="ASN";class jt extends yr{constructor(...e){let n;W.isBufferSource(e[0])?n=W.toArrayBuffer(e[0]):n=G.serialize(new Bt({extnID:e[0],critical:e[1],extnValue:new xe(W.toArrayBuffer(e[2]))})),super(n,Bt)}onInit(e){this.type=e.extnID,this.critical=e.critical,this.value=e.extnValue.buffer}toTextObject(){const e=this.toTextObjectWithoutValue();return e[""]=this.value,e}toTextObjectWithoutValue(){const e=this.toTextObjectEmpty(this.critical?"critical":void 0);return e[Se.NAME]===jt.NAME&&(e[Se.NAME]=_r.toString(this.type)),e}}var Nw;class nr{static isCryptoKeyPair(e){return e&&e.privateKey&&e.publicKey}static isCryptoKey(e){return e&&e.usages&&e.type&&e.algorithm&&e.extractable!==void 0}constructor(){this.items=new Map,this[Nw]="CryptoProvider",typeof self<"u"&&typeof crypto<"u"?this.set(nr.DEFAULT,crypto):typeof global<"u"&&global.crypto&&global.crypto.subtle&&this.set(nr.DEFAULT,global.crypto)}clear(){this.items.clear()}delete(e){return this.items.delete(e)}forEach(e,n){return this.items.forEach(e,n)}has(e){return this.items.has(e)}get size(){return this.items.size}entries(){return this.items.entries()}keys(){return this.items.keys()}values(){return this.items.values()}[Symbol.iterator](){return this.items[Symbol.iterator]()}get(e=nr.DEFAULT){const n=this.items.get(e.toLowerCase());if(!n)throw new Error(`Cannot get Crypto by name '${e}'`);return n}set(e,n){if(typeof e=="string"){if(!n)throw new TypeError("Argument 'value' is required");this.items.set(e.toLowerCase(),n)}else this.items.set(nr.DEFAULT,e);return this}}Nw=Symbol.toStringTag;nr.DEFAULT="default";const Qe=new nr,kk=/^[0-2](?:\.[1-9][0-9]*)+$/;function $k(t){return new RegExp(kk).test(t)}class Iw{constructor(e={}){this.items={};for(const n in e)this.register(n,e[n])}get(e){return this.items[e]||null}findId(e){return $k(e)?e:this.get(e)}register(e,n){this.items[e]=n,this.items[n]=e}}const vt=new Iw;vt.register("CN","2.5.4.3");vt.register("L","2.5.4.7");vt.register("ST","2.5.4.8");vt.register("O","2.5.4.10");vt.register("OU","2.5.4.11");vt.register("C","2.5.4.6");vt.register("DC","0.9.2342.19200300.100.1.25");vt.register("E","1.2.840.113549.1.9.1");vt.register("G","2.5.4.42");vt.register("I","2.5.4.43");vt.register("SN","2.5.4.4");vt.register("T","2.5.4.12");function Sk(t,e){return`\\${ne.ToHex(ne.FromUtf8String(e)).toUpperCase()}`}function zk(t){return t.replace(/([,+"\\<>;])/g,"\\$1").replace(/^([ #])/,"\\$1").replace(/([ ]$)/,"\\$1").replace(/([\r\n\t])/,Sk)}class Qt{static isASCII(e){for(let n=0;n<e.length;n++)if(e.charCodeAt(n)>255)return!1;return!0}static isPrintableString(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/g.test(e)}constructor(e,n={}){this.extraNames=new Iw,this.asn=new Ke;for(const r in n)if(Object.prototype.hasOwnProperty.call(n,r)){const i=n[r];this.extraNames.register(r,i)}typeof e=="string"?this.asn=this.fromString(e):e instanceof Ke?this.asn=e:W.isBufferSource(e)?this.asn=G.parse(e,Ke):this.asn=this.fromJSON(e)}getField(e){const n=this.extraNames.findId(e)||vt.findId(e),r=[];for(const i of this.asn)for(const s of i)s.type===n&&r.push(s.value.toString());return r}getName(e){return this.extraNames.get(e)||vt.get(e)}toString(){return this.asn.map(e=>e.map(n=>{const r=this.getName(n.type)||n.type,i=n.value.anyValue?`#${ne.ToHex(n.value.anyValue)}`:zk(n.value.toString());return`${r}=${i}`}).join("+")).join(", ")}toJSON(){var e;const n=[];for(const r of this.asn){const i={};for(const s of r){const a=this.getName(s.type)||s.type;(e=i[a])!==null&&e!==void 0||(i[a]=[]),i[a].push(s.value.anyValue?`#${ne.ToHex(s.value.anyValue)}`:s.value.toString())}n.push(i)}return n}fromString(e){const n=new Ke,r=/(\d\.[\d.]*\d|[A-Za-z]+)=((?:"")|(?:".*?[^\\]")|(?:[^,+"\\](?=[,+]|$))|(?:[^,+].*?(?:[^\\][,+]))|(?:))([,+])?/g;let i=null,s=",";for(;i=r.exec(`${e},`);){let[,a,c]=i;const l=c[c.length-1];(l===","||l==="+")&&(c=c.slice(0,c.length-1),i[3]=l);const u=i[3];a=this.getTypeOid(a);const d=this.createAttribute(a,c);s==="+"?n[n.length-1].push(d):n.push(new Di([d])),s=u}return n}fromJSON(e){const n=new Ke;for(const r of e){const i=new Di;for(const s in r){const a=this.getTypeOid(s),c=r[s];for(const l of c){const u=this.createAttribute(a,l);i.push(u)}}n.push(i)}return n}getTypeOid(e){if(/[\d.]+/.test(e)||(e=this.getName(e)||""),!e)throw new Error(`Cannot get OID for name type '${e}'`);return e}createAttribute(e,n){const r=new xl({type:e});if(typeof n=="object")for(const i in n)switch(i){case"ia5String":r.value.ia5String=n[i];break;case"utf8String":r.value.utf8String=n[i];break;case"universalString":r.value.universalString=n[i];break;case"bmpString":r.value.bmpString=n[i];break;case"printableString":r.value.printableString=n[i];break}else if(n[0]==="#")r.value.anyValue=ne.FromHex(n.slice(1));else{const i=this.processStringValue(n);e===this.getName("E")||e===this.getName("DC")?r.value.ia5String=i:Qt.isPrintableString(i)?r.value.printableString=i:r.value.utf8String=i}return r}processStringValue(e){const n=/"(.*?[^\\])?"/.exec(e);return n&&(e=n[1]),e.replace(/\\0a/ig,`
|
|
75
|
+
`).replace(/\\0d/ig,"\r").replace(/\\0g/ig," ").replace(/\\(.)/g,"$1")}toArrayBuffer(){return G.serialize(this.asn)}async getThumbprint(...e){var n;let r,i="SHA-1";return e.length>=1&&!(!((n=e[0])===null||n===void 0)&&n.subtle)?(i=e[0]||i,r=e[1]||Qe.get()):r=e[0]||Qe.get(),await r.subtle.digest(i,this.toArrayBuffer())}}const jw="Cannot initialize GeneralName from ASN.1 data.",_m=`${jw} Unsupported string format in use.`,Ak=`${jw} Value doesn't match to GUID regular expression.`,ym=/^([0-9a-f]{8})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{4})-?([0-9a-f]{12})$/i,bm="1.3.6.1.4.1.311.25.1",wm="1.3.6.1.4.1.311.20.2.3",bu="dns",wu="dn",vu="email",xu="ip",ku="url",$u="guid",Su="upn",aa="id";class rr extends yr{constructor(...e){let n;if(e.length===2)switch(e[0]){case wu:{const r=new Qt(e[1]).toArrayBuffer(),i=G.parse(r,Ke);n=new he({directoryName:i});break}case bu:n=new he({dNSName:e[1]});break;case vu:n=new he({rfc822Name:e[1]});break;case $u:{const r=new RegExp(ym,"i").exec(e[1]);if(!r)throw new Error("Cannot parse GUID value. Value doesn't match to regular expression");const i=r.slice(1).map((s,a)=>a<3?ne.ToHex(new Uint8Array(ne.FromHex(s)).reverse()):s).join("");n=new he({otherName:new ss({typeId:bm,value:G.serialize(new xe(ne.FromHex(i)))})});break}case xu:n=new he({iPAddress:e[1]});break;case aa:n=new he({registeredID:e[1]});break;case Su:{n=new he({otherName:new ss({typeId:wm,value:G.serialize(W2.toASN(e[1]))})});break}case ku:n=new he({uniformResourceIdentifier:e[1]});break;default:throw new Error("Cannot create GeneralName. Unsupported type of the name")}else W.isBufferSource(e[0])?n=G.parse(e[0],he):n=e[0];super(n)}onInit(e){if(e.dNSName!=null)this.type=bu,this.value=e.dNSName;else if(e.rfc822Name!=null)this.type=vu,this.value=e.rfc822Name;else if(e.iPAddress!=null)this.type=xu,this.value=e.iPAddress;else if(e.uniformResourceIdentifier!=null)this.type=ku,this.value=e.uniformResourceIdentifier;else if(e.registeredID!=null)this.type=aa,this.value=e.registeredID;else if(e.directoryName!=null)this.type=wu,this.value=new Qt(e.directoryName).toString();else if(e.otherName!=null)if(e.otherName.typeId===bm){this.type=$u;const n=G.parse(e.otherName.value,xe),r=new RegExp(ym,"i").exec(ne.ToHex(n));if(!r)throw new Error(Ak);this.value=r.slice(1).map((i,s)=>s<3?ne.ToHex(new Uint8Array(ne.FromHex(i)).reverse()):i).join("-")}else if(e.otherName.typeId===wm)this.type=Su,this.value=G.parse(e.otherName.value,st).toString();else throw new Error(_m);else throw new Error(_m)}toJSON(){return{type:this.type,value:this.value}}toTextObject(){let e;switch(this.type){case wu:case bu:case $u:case xu:case aa:case Su:case ku:e=this.type.toUpperCase();break;case vu:e="Email";break;default:throw new Error("Unsupported GeneralName type")}let n=this.value;return this.type===aa&&(n=_r.toString(n)),new Se(e,void 0,n)}}class Yr extends yr{constructor(e){let n;if(e instanceof pt)n=e;else if(Array.isArray(e)){const r=[];for(const i of e)if(i instanceof he)r.push(i);else{const s=G.parse(new rr(i.type,i.value).rawData,he);r.push(s)}n=new pt(r)}else if(W.isBufferSource(e))n=G.parse(e,pt);else throw new Error("Cannot initialize GeneralNames. Incorrect incoming arguments");super(n)}onInit(e){const n=[];for(const r of e){let i=null;try{i=new rr(r)}catch{continue}n.push(i)}this.items=n}toJSON(){return this.items.map(e=>e.toJSON())}toTextObject(){const e=super.toTextObjectEmpty();for(const n of this.items){const r=n.toTextObject();let i=e[r[Se.NAME]];Array.isArray(i)||(i=[],e[r[Se.NAME]]=i),i.push(r)}return e}}Yr.NAME="GeneralNames";const Jo="-{5}",hs="\\n",Ek=`[^${hs}]+`,Ck=`${Jo}BEGIN (${Ek}(?=${Jo}))${Jo}`,Nk=`${Jo}END \\1${Jo}`,Gi="\\n",Ik=`[^:${hs}]+`,jk=`(?:[^${hs}]+${Gi}(?: +[^${hs}]+${Gi})*)`,Tk="[a-zA-Z0-9=+/]+",Ok=`(?:${Tk}${Gi})+`,vm=`${Ck}${Gi}(?:((?:${Ik}: ${jk})+))?${Gi}?(${Ok})${Nk}`;class Et{static isPem(e){return typeof e=="string"&&new RegExp(vm,"g").test(e.replace(/\r/g,""))}static decodeWithHeaders(e){e=e.replace(/\r/g,"");const n=new RegExp(vm,"g"),r=[];let i=null;for(;i=n.exec(e);){const s=i[3].replace(new RegExp(`[${hs}]+`,"g"),""),a={type:i[1],headers:[],rawData:ne.FromBase64(s)},c=i[2];if(c){const l=c.split(new RegExp(Gi,"g"));let u=null;for(const d of l){const[f,p]=d.split(/:(.*)/);if(p===void 0){if(!u)throw new Error("Cannot parse PEM string. Incorrect header value");u.value+=f.trim()}else u&&a.headers.push(u),u={key:f,value:p.trim()}}u&&a.headers.push(u)}r.push(a)}return r}static decode(e){return this.decodeWithHeaders(e).map(r=>r.rawData)}static decodeFirst(e){const n=this.decode(e);if(!n.length)throw new RangeError("PEM string doesn't contain any objects");return n[0]}static encode(e,n){if(Array.isArray(e)){const r=new Array;return n?e.forEach(i=>{if(!W.isBufferSource(i))throw new TypeError("Cannot encode array of BufferSource in PEM format. Not all items of the array are BufferSource");r.push(this.encodeStruct({type:n,rawData:W.toArrayBuffer(i)}))}):e.forEach(i=>{if(!("type"in i))throw new TypeError("Cannot encode array of PemStruct in PEM format. Not all items of the array are PemStrut");r.push(this.encodeStruct(i))}),r.join(`
|
|
76
|
+
`)}else{if(!n)throw new Error("Required argument 'tag' is missed");return this.encodeStruct({type:n,rawData:W.toArrayBuffer(e)})}}static encodeStruct(e){var n;const r=e.type.toLocaleUpperCase(),i=[];if(i.push(`-----BEGIN ${r}-----`),!((n=e.headers)===null||n===void 0)&&n.length){for(const u of e.headers)i.push(`${u.key}: ${u.value}`);i.push("")}const s=ne.ToBase64(e.rawData);let a,c=0;const l=Array();for(;c<s.length&&(s.length-c<64?a=s.substring(c):(a=s.substring(c,c+64),c+=64),a.length!==0);)if(l.push(a),a.length<64)break;return i.push(...l),i.push(`-----END ${r}-----`),i.join(`
|
|
77
|
+
`)}}Et.CertificateTag="CERTIFICATE";Et.CrlTag="CRL";Et.CertificateRequestTag="CERTIFICATE REQUEST";Et.PublicKeyTag="PUBLIC KEY";Et.PrivateKeyTag="PRIVATE KEY";class Fn extends yr{static isAsnEncoded(e){return W.isBufferSource(e)||typeof e=="string"}static toArrayBuffer(e){if(typeof e=="string"){if(Et.isPem(e))return Et.decode(e)[0];if(ne.isHex(e))return ne.FromHex(e);if(ne.isBase64(e))return ne.FromBase64(e);if(ne.isBase64Url(e))return ne.FromBase64Url(e);throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}else{const n=W.toUint8Array(e);if(n.length>0&&n[0]===48)return W.toArrayBuffer(e);const r=ne.ToBinary(e);if(Et.isPem(r))return Et.decode(r)[0];if(ne.isHex(r))return ne.FromHex(r);if(ne.isBase64(r))return ne.FromBase64(r);if(ne.isBase64Url(r))return ne.FromBase64Url(r);throw new TypeError("Unsupported format of 'raw' argument. Must be one of DER, PEM, HEX, Base64, or Base4Url")}}constructor(...e){Fn.isAsnEncoded(e[0])?super(Fn.toArrayBuffer(e[0]),e[1]):super(e[0])}toString(e="pem"){return e==="pem"?Et.encode(this.rawData,this.tag):super.toString(e)}}class rn extends Fn{static async create(e,n=Qe.get()){if(e instanceof rn)return e;if(nr.isCryptoKey(e)){if(e.type!=="public")throw new TypeError("Public key is required");const r=await n.subtle.exportKey("spki",e);return new rn(r)}else{if(e.publicKey)return e.publicKey;if(W.isBufferSource(e))return new rn(e);throw new TypeError("Unsupported PublicKeyType")}}constructor(e){Fn.isAsnEncoded(e)?super(e,Yt):super(e),this.tag=Et.PublicKeyTag}async export(...e){let n,r=["verify"],i={hash:"SHA-256",...this.algorithm};e.length>1?(i=e[0]||i,r=e[1]||r,n=e[2]||Qe.get()):n=e[0]||Qe.get();let s=this.rawData;const a=G.parse(this.rawData,Yt);return a.algorithm.algorithm===Wo&&(s=Pk(a,s)),n.subtle.importKey("spki",s,i,!0,r)}onInit(e){const n=at.resolve(Xr),r=this.algorithm=n.toWebAlgorithm(e.algorithm);if(e.algorithm.algorithm===Gr){const i=G.parse(e.subjectPublicKey,xf),s=W.toUint8Array(i.modulus);r.publicExponent=W.toUint8Array(i.publicExponent),r.modulusLength=(s[0]?s:s.slice(1)).byteLength<<3}}async getThumbprint(...e){var n;let r,i="SHA-1";return e.length>=1&&!(!((n=e[0])===null||n===void 0)&&n.subtle)?(i=e[0]||i,r=e[1]||Qe.get()):r=e[0]||Qe.get(),await r.subtle.digest(i,this.rawData)}async getKeyIdentifier(...e){let n,r="SHA-1";e.length===1?typeof e[0]=="string"?(r=e[0],n=Qe.get()):n=e[0]:e.length===2?(r=e[0],n=e[1]):n=Qe.get();const i=G.parse(this.rawData,Yt);return await n.subtle.digest(r,i.subjectPublicKey)}toTextObject(){const e=this.toTextObjectEmpty(),n=G.parse(this.rawData,Yt);switch(e.Algorithm=Zr.serializeAlgorithm(n.algorithm),n.algorithm.algorithm){case us:e["EC Point"]=n.subjectPublicKey;break;case Gr:default:e["Raw Data"]=n.subjectPublicKey}return e}}function Pk(t,e){return t.algorithm=new Q({algorithm:Gr,parameters:null}),e=G.serialize(t),e}class gs extends jt{static async create(e,n=!1,r=Qe.get()){if("name"in e&&"serialNumber"in e)return new gs(e,n);const s=await(await rn.create(e,r)).getKeyIdentifier(r);return new gs(ne.ToHex(s),n)}constructor(...e){if(W.isBufferSource(e[0]))super(e[0]);else if(typeof e[0]=="string"){const n=new Ir({keyIdentifier:new nf(ne.FromHex(e[0]))});super(Kd,e[1],G.serialize(n))}else{const n=e[0],r=n.name instanceof Yr?G.parse(n.name.rawData,pt):n.name,i=new Ir({authorityCertIssuer:r,authorityCertSerialNumber:ne.FromHex(n.serialNumber)});super(Kd,e[1],G.serialize(i))}}onInit(e){super.onInit(e);const n=G.parse(e.extnValue,Ir);n.keyIdentifier&&(this.keyId=ne.ToHex(n.keyIdentifier)),(n.authorityCertIssuer||n.authorityCertSerialNumber)&&(this.certId={name:n.authorityCertIssuer||[],serialNumber:n.authorityCertSerialNumber?ne.ToHex(n.authorityCertSerialNumber):""})}toTextObject(){const e=this.toTextObjectWithoutValue(),n=G.parse(this.value,Ir);return n.authorityCertIssuer&&(e["Authority Issuer"]=new Yr(n.authorityCertIssuer).toTextObject()),n.authorityCertSerialNumber&&(e["Authority Serial Number"]=n.authorityCertSerialNumber),n.keyIdentifier&&(e[""]=n.keyIdentifier),e}}gs.NAME="Authority Key Identifier";class zf extends jt{constructor(...e){if(W.isBufferSource(e[0])){super(e[0]);const n=G.parse(this.value,lc);this.ca=n.cA,this.pathLength=n.pathLenConstraint}else{const n=new lc({cA:e[0],pathLenConstraint:e[1]});super(X2,e[2],G.serialize(n)),this.ca=e[0],this.pathLength=e[1]}}toTextObject(){const e=this.toTextObjectWithoutValue();return this.ca&&(e.CA=this.ca),this.pathLength!==void 0&&(e["Path Length"]=this.pathLength),e}}zf.NAME="Basic Constraints";var xm;(function(t){t.serverAuth="1.3.6.1.5.5.7.3.1",t.clientAuth="1.3.6.1.5.5.7.3.2",t.codeSigning="1.3.6.1.5.5.7.3.3",t.emailProtection="1.3.6.1.5.5.7.3.4",t.timeStamping="1.3.6.1.5.5.7.3.8",t.ocspSigning="1.3.6.1.5.5.7.3.9"})(xm||(xm={}));class Af extends jt{constructor(...e){if(W.isBufferSource(e[0])){super(e[0]);const n=G.parse(this.value,fc);this.usages=n.map(r=>r)}else{const n=new fc(e[0]);super(Q2,e[1],G.serialize(n)),this.usages=e[0]}}toTextObject(){const e=this.toTextObjectWithoutValue();return e[""]=this.usages.map(n=>_r.toString(n)).join(", "),e}}Af.NAME="Extended Key Usages";var Dc;(function(t){t[t.digitalSignature=1]="digitalSignature",t[t.nonRepudiation=2]="nonRepudiation",t[t.keyEncipherment=4]="keyEncipherment",t[t.dataEncipherment=8]="dataEncipherment",t[t.keyAgreement=16]="keyAgreement",t[t.keyCertSign=32]="keyCertSign",t[t.cRLSign=64]="cRLSign",t[t.encipherOnly=128]="encipherOnly",t[t.decipherOnly=256]="decipherOnly"})(Dc||(Dc={}));class Ef extends jt{constructor(...e){if(W.isBufferSource(e[0])){super(e[0]);const n=G.parse(this.value,yu);this.usages=n.toNumber()}else{const n=new yu(e[0]);super(tw,e[1],G.serialize(n)),this.usages=e[0]}}toTextObject(){const e=this.toTextObjectWithoutValue(),n=G.parse(this.value,yu);return e[""]=n.toJSON().join(", "),e}}Ef.NAME="Key Usages";class Ks extends jt{static async create(e,n=!1,r=Qe.get()){const s=await(await rn.create(e,r)).getKeyIdentifier(r);return new Ks(ne.ToHex(s),n)}constructor(...e){if(W.isBufferSource(e[0])){super(e[0]);const n=G.parse(this.value,sr);this.keyId=ne.ToHex(n)}else{const n=typeof e[0]=="string"?ne.FromHex(e[0]):e[0],r=new sr(n);super(ow,e[1],G.serialize(r)),this.keyId=ne.ToHex(n)}}toTextObject(){const e=this.toTextObjectWithoutValue(),n=G.parse(this.value,sr);return e[""]=n,e}}Ks.NAME="Subject Key Identifier";class Tw extends jt{constructor(...e){W.isBufferSource(e[0])?super(e[0]):super(iw,e[1],new Yr(e[0]||[]).rawData)}onInit(e){super.onInit(e);const n=G.parse(e.extnValue,ap);this.names=new Yr(n)}toTextObject(){const e=this.toTextObjectWithoutValue(),n=this.names.toTextObject();for(const r in n)e[r]=n[r];return e}}Tw.NAME="Subject Alternative Name";class Tt{static register(e,n){this.items.set(e,n)}static create(e){const n=new jt(e),r=this.items.get(n.type);return r?new r(e):n}}Tt.items=new Map;class Ow extends jt{constructor(...e){var n;if(W.isBufferSource(e[0])){super(e[0]);const r=G.parse(this.value,dc);this.policies=r.map(i=>i.policyIdentifier)}else{const r=e[0],i=(n=e[1])!==null&&n!==void 0?n:!1,s=new dc(r.map(a=>new $l({policyIdentifier:a})));super(Z2,i,G.serialize(s)),this.policies=r}}toTextObject(){const e=this.toTextObjectWithoutValue();return e.Policy=this.policies.map(n=>new Se("",{},_r.toString(n))),e}}Ow.NAME="Certificate Policies";Tt.register(Z2,Ow);class Pw extends jt{constructor(...e){var n;if(W.isBufferSource(e[0]))super(e[0]);else if(Array.isArray(e[0])&&typeof e[0][0]=="string"){const i=e[0].map(a=>new no({distributionPoint:new Fr({fullName:[new he({uniformResourceIdentifier:a})]})})),s=new Ni(i);super(Zd,e[1],G.serialize(s))}else{const r=new Ni(e[0]);super(Zd,e[1],G.serialize(r))}(n=this.distributionPoints)!==null&&n!==void 0||(this.distributionPoints=[])}onInit(e){super.onInit(e);const n=G.parse(e.extnValue,Ni);this.distributionPoints=n}toTextObject(){const e=this.toTextObjectWithoutValue();return e["Distribution Point"]=this.distributionPoints.map(n=>{var r;const i={};return n.distributionPoint&&(i[""]=(r=n.distributionPoint.fullName)===null||r===void 0?void 0:r.map(s=>new rr(s).toString()).join(", ")),n.reasons&&(i.Reasons=n.reasons.toString()),n.cRLIssuer&&(i["CRL Issuer"]=n.cRLIssuer.map(s=>s.toString()).join(", ")),i}),e}}Pw.NAME="CRL Distribution Points";class Rw extends jt{constructor(...e){var n,r,i,s;if(W.isBufferSource(e[0]))super(e[0]);else if(e[0]instanceof $i){const a=new $i(e[0]);super(Vd,e[1],G.serialize(a))}else{const a=e[0],c=new $i;la(c,a,sg,"ocsp"),la(c,a,ag,"caIssuers"),la(c,a,cg,"timeStamping"),la(c,a,lg,"caRepository"),super(Vd,e[1],G.serialize(c))}(n=this.ocsp)!==null&&n!==void 0||(this.ocsp=[]),(r=this.caIssuers)!==null&&r!==void 0||(this.caIssuers=[]),(i=this.timeStamping)!==null&&i!==void 0||(this.timeStamping=[]),(s=this.caRepository)!==null&&s!==void 0||(this.caRepository=[])}onInit(e){super.onInit(e),this.ocsp=[],this.caIssuers=[],this.timeStamping=[],this.caRepository=[],G.parse(e.extnValue,$i).forEach(r=>{switch(r.accessMethod){case sg:this.ocsp.push(new rr(r.accessLocation));break;case ag:this.caIssuers.push(new rr(r.accessLocation));break;case cg:this.timeStamping.push(new rr(r.accessLocation));break;case lg:this.caRepository.push(new rr(r.accessLocation));break}})}toTextObject(){const e=this.toTextObjectWithoutValue();return this.ocsp.length&&ca(e,"OCSP",this.ocsp),this.caIssuers.length&&ca(e,"CA Issuers",this.caIssuers),this.timeStamping.length&&ca(e,"Time Stamping",this.timeStamping),this.caRepository.length&&ca(e,"CA Repository",this.caRepository),e}}Rw.NAME="Authority Info Access";function ca(t,e,n){if(n.length===1)t[e]=n[0].toTextObject();else{const r=new Se("");n.forEach((i,s)=>{const a=i.toTextObject(),c=`${a[Se.NAME]} ${s+1}`;let l=r[c];Array.isArray(l)||(l=[],r[c]=l),l.push(a)}),t[e]=r}}function la(t,e,n,r){const i=e[r];i&&(Array.isArray(i)?i:[i]).forEach(a=>{typeof a=="string"&&(a=new rr("url",a)),t.push(new Ts({accessMethod:n,accessLocation:G.parse(a.rawData,he)}))})}class Lw extends jt{constructor(...e){W.isBufferSource(e[0])?super(e[0]):super(ew,e[1],new Yr(e[0]||[]).rawData)}onInit(e){super.onInit(e);const n=G.parse(e.extnValue,pt);this.names=new Yr(n)}toTextObject(){const e=this.toTextObjectWithoutValue(),n=this.names.toTextObject();for(const r in n)e[r]=n[r];return e}}Lw.NAME="Issuer Alternative Name";class lo extends yr{constructor(...e){let n;if(W.isBufferSource(e[0]))n=W.toArrayBuffer(e[0]);else{const r=e[0],i=Array.isArray(e[1])?e[1].map(s=>W.toArrayBuffer(s)):[];n=G.serialize(new Un({type:r,values:i}))}super(n,Un)}onInit(e){this.type=e.type,this.values=e.values}toTextObject(){const e=this.toTextObjectWithoutValue();return e.Value=this.values.map(n=>new Se("",{"":n})),e}toTextObjectWithoutValue(){const e=this.toTextObjectEmpty();return e[Se.NAME]===lo.NAME&&(e[Se.NAME]=_r.toString(this.type)),e}}lo.NAME="Attribute";class Bw extends lo{constructor(...e){var n;if(W.isBufferSource(e[0]))super(e[0]);else{const r=new Lc({printableString:e[0]});super(Aw,[G.serialize(r)])}(n=this.password)!==null&&n!==void 0||(this.password="")}onInit(e){if(super.onInit(e),this.values[0]){const n=G.parse(this.values[0],Lc);this.password=n.toString()}}toTextObject(){const e=this.toTextObjectWithoutValue();return e[Se.VALUE]=this.password,e}}Bw.NAME="Challenge Password";class Cf extends lo{constructor(...e){var n;if(W.isBufferSource(e[0]))super(e[0]);else{const r=e[0],i=new lr;for(const s of r)i.push(G.parse(s.rawData,Bt));super(Sf,[G.serialize(i)])}(n=this.items)!==null&&n!==void 0||(this.items=[])}onInit(e){if(super.onInit(e),this.values[0]){const n=G.parse(this.values[0],lr);this.items=n.map(r=>Tt.create(G.serialize(r)))}}toTextObject(){const e=this.toTextObjectWithoutValue(),n=this.items.map(r=>r.toTextObject());for(const r of n)e[r[Se.NAME]]=r;return e}}Cf.NAME="Extensions";class Gl{static register(e,n){this.items.set(e,n)}static create(e){const n=new lo(e),r=this.items.get(n.type);return r?new r(e):n}}Gl.items=new Map;const Gs="crypto.signatureFormatter";class Rk{toAsnSignature(e,n){return W.toArrayBuffer(n)}toWebSignature(e,n){return W.toArrayBuffer(n)}}var Na;let Zp=Na=class{static createPssParams(e,n){const r=Na.getHashAlgorithm(e);return r?new Jr({hashAlgorithm:r,maskGenAlgorithm:new Q({algorithm:Bl,parameters:G.serialize(r)}),saltLength:n}):null}static getHashAlgorithm(e){const n=at.resolve(Xr);return typeof e=="string"?n.toAsnAlgorithm({name:e}):typeof e=="object"&&e&&"name"in e?n.toAsnAlgorithm(e):null}toAsnAlgorithm(e){switch(e.name.toLowerCase()){case"rsassa-pkcs1-v1_5":if("hash"in e){let n;if(typeof e.hash=="string")n=e.hash;else if(e.hash&&typeof e.hash=="object"&&"name"in e.hash&&typeof e.hash.name=="string")n=e.hash.name.toUpperCase();else throw new Error("Cannot get hash algorithm name");switch(n.toLowerCase()){case"sha-1":return new Q({algorithm:Ac,parameters:null});case"sha-256":return new Q({algorithm:Ep,parameters:null});case"sha-384":return new Q({algorithm:Ec,parameters:null});case"sha-512":return new Q({algorithm:Cc,parameters:null})}}else return new Q({algorithm:Gr,parameters:null});break;case"rsa-pss":if("hash"in e){if(!("saltLength"in e&&typeof e.saltLength=="number"))throw new Error("Cannot get 'saltLength' from 'alg' argument");const n=Na.createPssParams(e.hash,e.saltLength);if(!n)throw new Error("Cannot create PSS parameters");return new Q({algorithm:Wo,parameters:G.serialize(n)})}else return new Q({algorithm:Wo,parameters:null})}return null}toWebAlgorithm(e){switch(e.algorithm){case Gr:return{name:"RSASSA-PKCS1-v1_5"};case Ac:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}};case Ep:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case Ec:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case Cc:return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}};case Wo:if(e.parameters){const n=G.parse(e.parameters,Jr);return{name:"RSA-PSS",hash:at.resolve(Xr).toWebAlgorithm(n.hashAlgorithm),saltLength:n.saltLength}}else return{name:"RSA-PSS"}}return null}};Zp=Na=x([ql()],Zp);at.registerSingleton(Vs,Zp);let Yp=class{toAsnAlgorithm(e){switch(e.name.toLowerCase()){case"sha-1":return new Q({algorithm:Nc});case"sha-256":return new Q({algorithm:Ic});case"sha-384":return new Q({algorithm:jc});case"sha-512":return new Q({algorithm:Tc})}return null}toWebAlgorithm(e){switch(e.algorithm){case Nc:return{name:"SHA-1"};case Ic:return{name:"SHA-256"};case jc:return{name:"SHA-384"};case Tc:return{name:"SHA-512"}}return null}};Yp=x([ql()],Yp);at.registerSingleton(Vs,Yp);class Pt{addPadding(e,n){const r=W.toUint8Array(n),i=new Uint8Array(e);return i.set(r,e-r.length),i.buffer}removePadding(e,n=!1){let r=W.toUint8Array(e);for(let i=0;i<r.length;i++)if(r[i]){r=r.slice(i);break}if(n&&r[0]>127){const i=new Uint8Array(r.length+1);return i.set(r,1),i.buffer}return r.buffer}toAsnSignature(e,n){if(e.name==="ECDSA"){const r=e.namedCurve,i=Pt.namedCurveSize.get(r)||Pt.defaultNamedCurveSize,s=new zc,a=W.toUint8Array(n);return s.r=this.removePadding(a.slice(0,i),!0),s.s=this.removePadding(a.slice(i,i+i),!0),G.serialize(s)}return null}toWebSignature(e,n){if(e.name==="ECDSA"){const r=G.parse(n,zc),i=e.namedCurve,s=Pt.namedCurveSize.get(i)||Pt.defaultNamedCurveSize,a=this.addPadding(s,this.removePadding(r.r)),c=this.addPadding(s,this.removePadding(r.s));return J8(a,c)}return null}}Pt.namedCurveSize=new Map;Pt.defaultNamedCurveSize=32;const zu="1.3.101.110",km="1.3.101.111",Au="1.3.101.112",$m="1.3.101.113";let Qp=class{toAsnAlgorithm(e){let n=null;switch(e.name.toLowerCase()){case"ed25519":n=Au;break;case"x25519":n=zu;break;case"eddsa":switch(e.namedCurve.toLowerCase()){case"ed25519":n=Au;break;case"ed448":n=$m;break}break;case"ecdh-es":switch(e.namedCurve.toLowerCase()){case"x25519":n=zu;break;case"x448":n=km;break}}return n?new Q({algorithm:n}):null}toWebAlgorithm(e){switch(e.algorithm){case Au:return{name:"Ed25519"};case $m:return{name:"EdDSA",namedCurve:"Ed448"};case zu:return{name:"X25519"};case km:return{name:"ECDH-ES",namedCurve:"X448"}}return null}};Qp=x([ql()],Qp);at.registerSingleton(Vs,Qp);var wo,vo,xo,ko,$o,So,zo,_i;class Lk extends Fn{get subjectName(){return me(this,vo,"f")||Re(this,vo,new Qt(this.asn.certificationRequestInfo.subject),"f"),me(this,vo,"f")}get subject(){return me(this,xo,"f")||Re(this,xo,this.subjectName.toString(),"f"),me(this,xo,"f")}get signatureAlgorithm(){if(!me(this,ko,"f")){const e=at.resolve(Xr);Re(this,ko,e.toWebAlgorithm(this.asn.signatureAlgorithm),"f")}return me(this,ko,"f")}get signature(){return me(this,$o,"f")||Re(this,$o,this.asn.signature,"f"),me(this,$o,"f")}get publicKey(){return me(this,So,"f")||Re(this,So,new rn(this.asn.certificationRequestInfo.subjectPKInfo),"f"),me(this,So,"f")}get attributes(){return me(this,zo,"f")||Re(this,zo,this.asn.certificationRequestInfo.attributes.map(e=>Gl.create(G.serialize(e))),"f"),me(this,zo,"f")}get extensions(){if(!me(this,_i,"f")){Re(this,_i,[],"f");const e=this.getAttribute(Sf);e instanceof Cf&&Re(this,_i,e.items,"f")}return me(this,_i,"f")}get tbs(){return me(this,wo,"f")||Re(this,wo,this.asn.certificationRequestInfoRaw||G.serialize(this.asn.certificationRequestInfo),"f"),me(this,wo,"f")}constructor(e){const n=Fn.isAsnEncoded(e)?[e,ps]:[e];super(n[0],n[1]),wo.set(this,void 0),vo.set(this,void 0),xo.set(this,void 0),ko.set(this,void 0),$o.set(this,void 0),So.set(this,void 0),zo.set(this,void 0),_i.set(this,void 0),this.tag=Et.CertificateRequestTag}onInit(e){}getAttribute(e){for(const n of this.attributes)if(n.type===e)return n;return null}getAttributes(e){return this.attributes.filter(n=>n.type===e)}getExtension(e){for(const n of this.extensions)if(n.type===e)return n;return null}getExtensions(e){return this.extensions.filter(n=>n.type===e)}async verify(e=Qe.get()){const n={...this.publicKey.algorithm,...this.signatureAlgorithm},r=await this.publicKey.export(n,["verify"],e),i=at.resolveAll(Gs).reverse();let s=null;for(const c of i)if(s=c.toWebSignature(n,this.signature),s)break;if(!s)throw Error("Cannot convert WebCrypto signature value to ASN.1 format");return await e.subtle.verify(this.signatureAlgorithm,r,s,this.tbs)}toTextObject(){const e=this.toTextObjectEmpty(),n=G.parse(this.rawData,ps),r=n.certificationRequestInfo,i=new Se("",{Version:`${Hr[r.version]} (${r.version})`,Subject:this.subject,"Subject Public Key Info":this.publicKey});if(this.attributes.length){const s=new Se("");for(const a of this.attributes){const c=a.toTextObject();s[c[Se.NAME]]=c}i.Attributes=s}return e.Data=i,e.Signature=new Se("",{Algorithm:Zr.serializeAlgorithm(n.signatureAlgorithm),"":n.signature}),e}}wo=new WeakMap,vo=new WeakMap,xo=new WeakMap,ko=new WeakMap,$o=new WeakMap,So=new WeakMap,zo=new WeakMap,_i=new WeakMap;Lk.NAME="PKCS#10 Certificate Request";var Ao,Eo,Co,No,Io,jo,To,Oo,Po,Ro,yi,Lo;class Wl extends Fn{get publicKey(){return me(this,Lo,"f")||Re(this,Lo,new rn(this.asn.tbsCertificate.subjectPublicKeyInfo),"f"),me(this,Lo,"f")}get serialNumber(){if(!me(this,Eo,"f")){const e=this.asn.tbsCertificate;let n=new Uint8Array(e.serialNumber);n.length>1&&n[0]===0&&n[1]>127&&(n=n.slice(1)),Re(this,Eo,ne.ToHex(n),"f")}return me(this,Eo,"f")}get subjectName(){return me(this,Co,"f")||Re(this,Co,new Qt(this.asn.tbsCertificate.subject),"f"),me(this,Co,"f")}get subject(){return me(this,No,"f")||Re(this,No,this.subjectName.toString(),"f"),me(this,No,"f")}get issuerName(){return me(this,Io,"f")||Re(this,Io,new Qt(this.asn.tbsCertificate.issuer),"f"),me(this,Io,"f")}get issuer(){return me(this,jo,"f")||Re(this,jo,this.issuerName.toString(),"f"),me(this,jo,"f")}get notBefore(){if(!me(this,To,"f")){const e=this.asn.tbsCertificate.validity.notBefore.utcTime||this.asn.tbsCertificate.validity.notBefore.generalTime;if(!e)throw new Error("Cannot get 'notBefore' value");Re(this,To,e,"f")}return me(this,To,"f")}get notAfter(){if(!me(this,Oo,"f")){const e=this.asn.tbsCertificate.validity.notAfter.utcTime||this.asn.tbsCertificate.validity.notAfter.generalTime;if(!e)throw new Error("Cannot get 'notAfter' value");Re(this,Oo,e,"f")}return me(this,Oo,"f")}get signatureAlgorithm(){if(!me(this,Po,"f")){const e=at.resolve(Xr);Re(this,Po,e.toWebAlgorithm(this.asn.signatureAlgorithm),"f")}return me(this,Po,"f")}get signature(){return me(this,Ro,"f")||Re(this,Ro,this.asn.signatureValue,"f"),me(this,Ro,"f")}get extensions(){return me(this,yi,"f")||(Re(this,yi,[],"f"),this.asn.tbsCertificate.extensions&&Re(this,yi,this.asn.tbsCertificate.extensions.map(e=>Tt.create(G.serialize(e))),"f")),me(this,yi,"f")}get tbs(){return me(this,Ao,"f")||Re(this,Ao,this.asn.tbsCertificateRaw||G.serialize(this.asn.tbsCertificate),"f"),me(this,Ao,"f")}constructor(e){const n=Fn.isAsnEncoded(e)?[e,Vr]:[e];super(n[0],n[1]),Ao.set(this,void 0),Eo.set(this,void 0),Co.set(this,void 0),No.set(this,void 0),Io.set(this,void 0),jo.set(this,void 0),To.set(this,void 0),Oo.set(this,void 0),Po.set(this,void 0),Ro.set(this,void 0),yi.set(this,void 0),Lo.set(this,void 0),this.tag=Et.CertificateTag}onInit(e){}getExtension(e){for(const n of this.extensions)if(typeof e=="string"){if(n.type===e)return n}else if(n instanceof e)return n;return null}getExtensions(e){return this.extensions.filter(n=>typeof e=="string"?n.type===e:n instanceof e)}async verify(e={},n=Qe.get()){let r,i;const s=e.publicKey;try{if(!s)r={...this.publicKey.algorithm,...this.signatureAlgorithm},i=await this.publicKey.export(r,["verify"],n);else if("publicKey"in s)r={...s.publicKey.algorithm,...this.signatureAlgorithm},i=await s.publicKey.export(r,["verify"],n);else if(s instanceof rn)r={...s.algorithm,...this.signatureAlgorithm},i=await s.export(r,["verify"],n);else if(W.isBufferSource(s)){const u=new rn(s);r={...u.algorithm,...this.signatureAlgorithm},i=await u.export(r,["verify"],n)}else r={...s.algorithm,...this.signatureAlgorithm},i=s}catch{return!1}const a=at.resolveAll(Gs).reverse();let c=null;for(const u of a)if(c=u.toWebSignature(r,this.signature),c)break;if(!c)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");const l=await n.subtle.verify(this.signatureAlgorithm,i,c,this.tbs);if(e.signatureOnly)return l;{const d=(e.date||new Date).getTime();return l&&this.notBefore.getTime()<d&&d<this.notAfter.getTime()}}async getThumbprint(...e){let n,r="SHA-1";return e[0]&&(e[0].subtle?n=e[0]:(r=e[0]||r,n=e[1])),n??(n=Qe.get()),await n.subtle.digest(r,this.rawData)}async isSelfSigned(e=Qe.get()){return this.subject===this.issuer&&await this.verify({signatureOnly:!0},e)}toTextObject(){const e=this.toTextObjectEmpty(),n=G.parse(this.rawData,Vr),r=n.tbsCertificate,i=new Se("",{Version:`${Hr[r.version]} (${r.version})`,"Serial Number":r.serialNumber,"Signature Algorithm":Zr.serializeAlgorithm(r.signature),Issuer:this.issuer,Validity:new Se("",{"Not Before":r.validity.notBefore.getTime(),"Not After":r.validity.notAfter.getTime()}),Subject:this.subject,"Subject Public Key Info":this.publicKey});if(r.issuerUniqueID&&(i["Issuer Unique ID"]=r.issuerUniqueID),r.subjectUniqueID&&(i["Subject Unique ID"]=r.subjectUniqueID),this.extensions.length){const s=new Se("");for(const a of this.extensions){const c=a.toTextObject();s[c[Se.NAME]]=c}i.Extensions=s}return e.Data=i,e.Signature=new Se("",{Algorithm:Zr.serializeAlgorithm(n.signatureAlgorithm),"":n.signatureValue}),e}}Ao=new WeakMap,Eo=new WeakMap,Co=new WeakMap,No=new WeakMap,Io=new WeakMap,jo=new WeakMap,To=new WeakMap,Oo=new WeakMap,Po=new WeakMap,Ro=new WeakMap,yi=new WeakMap,Lo=new WeakMap;Wl.NAME="Certificate";function Bk(t,e=Qe.get()){const n=W.toUint8Array(ne.FromHex(t||""));let r=n&&n.length&&n.some(s=>s>0)?new Uint8Array(n):void 0;r||(r=e.getRandomValues(new Uint8Array(16)));let i=0;for(;i<r.length-1&&r[i]===0;)i++;if(r=r.slice(i),r[0]>127){const s=new Uint8Array(r.length+1);s[0]=0,s.set(r,1),r=s}return r.buffer}class Dk{static async createSelfSigned(e,n=Qe.get()){if(!e.keys.privateKey)throw new Error("Bad field 'keys' in 'params' argument. 'privateKey' is empty");if(!e.keys.publicKey)throw new Error("Bad field 'keys' in 'params' argument. 'publicKey' is empty");return this.create({serialNumber:e.serialNumber,subject:e.name,issuer:e.name,notBefore:e.notBefore,notAfter:e.notAfter,publicKey:e.keys.publicKey,signingKey:e.keys.privateKey,signingAlgorithm:e.signingAlgorithm,extensions:e.extensions},n)}static async create(e,n=Qe.get()){var r;let i;e.publicKey instanceof rn?i=e.publicKey.rawData:"publicKey"in e.publicKey?i=e.publicKey.publicKey.rawData:W.isBufferSource(e.publicKey)?i=e.publicKey:i=await n.subtle.exportKey("spki",e.publicKey);const s=Bk(e.serialNumber,n),a=e.notBefore||new Date,c=e.notAfter||new Date(a.getTime()+31536e6),l=new Vr({tbsCertificate:new It({version:Hr.v3,serialNumber:s,validity:new Os({notBefore:a,notAfter:c}),extensions:new lr(((r=e.extensions)===null||r===void 0?void 0:r.map(w=>G.parse(w.rawData,Bt)))||[]),subjectPublicKeyInfo:G.parse(i,Yt)})});if(e.subject){const w=e.subject instanceof Qt?e.subject:new Qt(e.subject);l.tbsCertificate.subject=G.parse(w.toArrayBuffer(),Ke)}if(e.issuer){const w=e.issuer instanceof Qt?e.issuer:new Qt(e.issuer);l.tbsCertificate.issuer=G.parse(w.toArrayBuffer(),Ke)}const u={hash:"SHA-256"},d="signingKey"in e?{...u,...e.signingAlgorithm,...e.signingKey.algorithm}:{...u,...e.signingAlgorithm},f=at.resolve(Xr);l.tbsCertificate.signature=l.signatureAlgorithm=f.toAsnAlgorithm(d);const p=G.serialize(l.tbsCertificate),h="signingKey"in e?await n.subtle.sign(d,e.signingKey,p):e.signature,m=at.resolveAll(Gs).reverse();let y=null;for(const w of m)if(y=w.toAsnSignature(d,h),y)break;if(!y)throw Error("Cannot convert ASN.1 signature value to WebCrypto format");return l.signatureValue=y,new Wl(G.serialize(l))}}var Sm;(function(t){t[t.unspecified=0]="unspecified",t[t.keyCompromise=1]="keyCompromise",t[t.cACompromise=2]="cACompromise",t[t.affiliationChanged=3]="affiliationChanged",t[t.superseded=4]="superseded",t[t.cessationOfOperation=5]="cessationOfOperation",t[t.certificateHold=6]="certificateHold",t[t.removeFromCRL=8]="removeFromCRL",t[t.privilegeWithdrawn=9]="privilegeWithdrawn",t[t.aACompromise=10]="aACompromise"})(Sm||(Sm={}));Tt.register(X2,zf);Tt.register(Q2,Af);Tt.register(tw,Ef);Tt.register(ow,Ks);Tt.register(Kd,gs);Tt.register(iw,Tw);Tt.register(Zd,Pw);Tt.register(Vd,Rw);Tt.register(ew,Lw);Gl.register(Aw,Bw);Gl.register(Sf,Cf);at.registerSingleton(Gs,Rk);at.registerSingleton(Gs,Pt);Pt.namedCurveSize.set("P-256",32);Pt.namedCurveSize.set("K-256",32);Pt.namedCurveSize.set("P-384",48);Pt.namedCurveSize.set("P-521",66);async function Uc(t){const e={name:"RSASSA-PKCS1-v1_5",hash:"SHA-256",publicExponent:new Uint8Array([1,0,1]),modulusLength:2048},n=await crypto.subtle.generateKey(e,!0,["sign","verify"]),r=je(),i=Id(new TextEncoder().encode(r)),s=await Dk.createSelfSigned({serialNumber:i,name:t.name,notBefore:new Date,notAfter:new Date(Date.now()+365*24*60*60*1e3),signingAlgorithm:e,keys:n,extensions:[new zf(!0,2,!0),new Af(["1.3.6.1.5.5.7.3.1"],!0),new Ef(Dc.keyCertSign|Dc.cRLSign,!0),await Ks.create(n.publicKey)]}),a=await crypto.subtle.exportKey("pkcs8",n.privateKey),c=s.toString("pem"),l=await Mk(s),u=Id(await s.getThumbprint()),d=Uk("PRIVATE",a);return{kid:s.serialNumber,cert:c,thumbprint:u,fingerprint:l,pkcs7:d,type:"jwt_signing"}}function Uk(t,e){const n=s6.encode(new Uint8Array(e));let r=`-----BEGIN ${t} KEY-----\r
|
|
78
|
+
`,i=0;for(;i<n.length;)i+64<=n.length?r+=n.substr(i,64)+`\r
|
|
79
|
+
`:r+=n.substr(i)+`\r
|
|
80
|
+
`,i+=64;return r+=`-----END ${t} KEY-----\r
|
|
81
|
+
`,r}async function Mk(t){const e=await t.publicKey.export(),n=await crypto.subtle.exportKey("jwk",e),r=JSON.stringify(n,Object.keys(n).sort()),s=new TextEncoder().encode(r);return Id(await gb(s))}const qk=1e3*60*60*24,Fk=new o.OpenAPIHono().openapi(o.createRoute({tags:["keys"],method:"get",path:"/signing",request:{headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["read:keys","auth:read"]}],responses:{200:{content:{"application/json":{schema:o.z.array(Ad)}},description:"List of keys"}}}),async t=>{const{signingKeys:e}=await t.env.data.keys.list({q:"type:jwt_signing"}),n=e.filter(r=>"cert"in r).map(r=>r);return t.json(n)}).openapi(o.createRoute({tags:["keys"],method:"get",path:"/signing/{kid}",request:{headers:o.z.object({"tenant-id":o.z.string().optional()}),params:o.z.object({kid:o.z.string()})},security:[{Bearer:["read:keys","auth:read"]}],responses:{200:{content:{"application/json":{schema:Ad}},description:"The requested key"}}}),async t=>{const{kid:e}=t.req.valid("param"),{signingKeys:n}=await t.env.data.keys.list({q:"type:jwt_signing"}),r=n.find(i=>i.kid===e);if(!r)throw new I(404,{message:"Key not found"});return t.json(r)}).openapi(o.createRoute({tags:["keys"],method:"post",path:"/signing/rotate",request:{headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["create:keys","auth:write"]}],responses:{201:{description:"Status"}}}),async t=>{const{signingKeys:e}=await t.env.data.keys.list({q:"type:jwt_signing"});for await(const r of e)await t.env.data.keys.update(r.kid,{revoked_at:new Date(Date.now()+qk).toISOString()});const n=await Uc({name:`CN=${t.env.ORGANIZATION_NAME}`});return await t.env.data.keys.create({...n,type:"jwt_signing"}),t.text("OK",{status:201})}).openapi(o.createRoute({tags:["keys"],method:"put",path:"/signing/{kid}/revoke",request:{headers:o.z.object({"tenant-id":o.z.string().optional()}),params:o.z.object({kid:o.z.string()})},security:[{Bearer:["update:keys","auth:write"]}],responses:{201:{description:"Status"}}}),async t=>{const{kid:e}=t.req.valid("param");if(!await t.env.data.keys.update(e,{revoked_at:new Date().toISOString()}))throw new I(404,{message:"Key not found"});const r=await Uc({name:`CN=${t.env.ORGANIZATION_NAME}`});return await t.env.data.keys.create({...r,type:"jwt_signing"}),t.text("OK")}),Hk=new o.OpenAPIHono().openapi(o.createRoute({tags:["users"],method:"get",path:"/",request:{query:o.z.object({email:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["read:users","auth:read"]}],responses:{200:{content:{"tenant/json":{schema:o.z.array(m0)}},description:"List of users"}}}),async t=>{const{email:e}=t.req.valid("query"),r=(await T0(t.env.data.users,t.var.tenant_id,e)).filter(i=>!i.linked_to);return t.json(r)}),Vk=xt.extend({clients:o.z.array(Ar)}),zm=o.z.object({enabled_connections:o.z.array(o.z.object({connection_id:o.z.string(),connection:Ot.optional()}))}),Kk=o.z.array(o.z.string()),Gk=new o.OpenAPIHono().openapi(o.createRoute({tags:["clients"],method:"get",path:"/",request:{query:et,headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["read:clients","auth:read"]}],responses:{200:{content:{"application/json":{schema:o.z.union([Vk,o.z.array(Ar)])}},description:"List of clients"}}}),async t=>{const e=t.var.tenant_id,{page:n,per_page:r,include_totals:i,sort:s,q:a}=t.req.valid("query"),l=(await t.env.data.clients.list(e,{page:n,per_page:r,include_totals:i,sort:ut(s),q:a})).clients;return i?t.json({clients:l,start:0,limit:10,length:l.length}):t.json(l)}).openapi(o.createRoute({tags:["clients"],method:"get",path:"/{id}",request:{params:o.z.object({id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["read:clients","auth:read"]}],responses:{200:{content:{"application/json":{schema:Ar}},description:"A client"}}}),async t=>{const e=t.var.tenant_id,{id:n}=t.req.valid("param"),r=await t.env.data.clients.get(e,n);if(!r)throw new I(404);return t.json(r)}).openapi(o.createRoute({tags:["clients"],method:"delete",path:"/{id}",request:{params:o.z.object({id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["delete:clients","auth:write"]}],responses:{200:{description:"Status"}}}),async t=>{const e=t.var.tenant_id,{id:n}=t.req.valid("param");if(!await t.env.data.clients.remove(e,n))throw new I(404,{message:"Client not found"});return t.text("OK")}).openapi(o.createRoute({tags:["clients"],method:"patch",path:"/{id}",request:{body:{content:{"application/json":{schema:o.z.object(Fa.shape).partial()}}},params:o.z.object({id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["update:clients","auth:write"]}],responses:{200:{content:{"application/json":{schema:Ar}},description:"The updated client"}}}),async t=>{const e=t.var.tenant_id,{id:n}=t.req.valid("param"),i=t.req.valid("json");await t.env.data.clients.update(e,n,i);const s=await t.env.data.clients.get(e,n);if(!s)throw new I(404,{message:"Client not found"});return t.json(s)}).openapi(o.createRoute({tags:["clients"],method:"post",path:"/",request:{body:{content:{"application/json":{schema:o.z.object(Fa.shape)}}},headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["create:clients","auth:write"]}],responses:{201:{content:{"application/json":{schema:o.z.object(Ar.shape)}},description:"A client"}}}),async t=>{const e=t.var.tenant_id,n=t.req.valid("json"),r={...n,client_secret:n.client_secret||je()},i=await t.env.data.clients.create(e,r);return t.json(i,{status:201})}).openapi(o.createRoute({tags:["clients"],method:"get",path:"/{id}/connections",request:{params:o.z.object({id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["read:clients","auth:read"]}],responses:{200:{content:{"application/json":{schema:zm}},description:"List of connections enabled for this client"}}}),async t=>{const e=t.var.tenant_id,{id:n}=t.req.valid("param"),r=await t.env.data.clients.get(e,n);if(!r)throw new I(404,{message:"Client not found"});const i=r.connections&&r.connections.length>0;let s;if(i)s=await Promise.all(r.connections.map(async a=>{const c=await t.env.data.connections.get(e,a);return{connection_id:a,connection:c||void 0}}));else{const{connections:a}=await t.env.data.connections.list(e,{});s=a.filter(c=>c.id).map(c=>({connection_id:c.id,connection:c}))}return t.json({enabled_connections:s})}).openapi(o.createRoute({tags:["clients"],method:"patch",path:"/{id}/connections",request:{body:{content:{"application/json":{schema:Kk}}},params:o.z.object({id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["update:clients","auth:write"]}],responses:{200:{content:{"application/json":{schema:zm}},description:"Updated list of connections for this client"}}}),async t=>{const e=t.var.tenant_id,{id:n}=t.req.valid("param"),r=t.req.valid("json");if(!await t.env.data.clients.get(e,n))throw new I(404,{message:"Client not found"});const s=[];for(const c of r)await t.env.data.connections.get(e,c)&&s.push(c);await t.env.data.clients.update(e,n,{connections:s});const a=await Promise.all(s.map(async c=>{const l=await t.env.data.connections.get(e,c);return{connection_id:c,connection:l||void 0}}));return t.json({enabled_connections:a})}),Wk=new o.OpenAPIHono().openapi(o.createRoute({tags:["tenants","settings"],method:"get",path:"/settings",request:{headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["read:tenants","auth:read"]}],responses:{200:{content:{"application/json":{schema:Ka}},description:"Current tenant settings"}}}),async t=>{const e=await t.env.data.tenants.get(t.var.tenant_id);if(!e)throw new I(404,{message:"Tenant not found"});return t.json(e)}).openapi(o.createRoute({tags:["tenants","settings"],method:"patch",path:"/settings",request:{headers:o.z.object({"tenant-id":o.z.string().optional()}),body:{content:{"application/json":{schema:o.z.object(b0.shape).partial()}}}},security:[{Bearer:["update:tenants","auth:write"]}],responses:{200:{content:{"application/json":{schema:Ka}},description:"Updated tenant settings"}}}),async t=>{const e=t.req.valid("json"),{id:n,...r}=e,i=await t.env.data.tenants.get(t.var.tenant_id);if(!i)throw new I(404,{message:"Tenant not found"});const s=Ed(i,r);await t.env.data.tenants.update(t.var.tenant_id,s);const a=await t.env.data.tenants.get(t.var.tenant_id);if(!a)throw new I(500,{message:"Failed to retrieve updated tenant"});return t.json(a)}),Jk=xt.extend({logs:o.z.array(Wa)}),Xk=new o.OpenAPIHono().openapi(o.createRoute({tags:["logs"],method:"get",path:"/",request:{query:et,headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["read:logs","auth:read"]}],responses:{200:{content:{"application/json":{schema:o.z.union([o.z.array(Wa),Jk])}},description:"List of log rows"}}}),async t=>{const{page:e,per_page:n,include_totals:r,sort:i,q:s}=t.req.valid("query"),a=await t.env.data.logs.list(t.var.tenant_id,{page:e,per_page:n,include_totals:r,sort:ut(i),q:s});return r?t.json(a):t.json(a.logs)}).openapi(o.createRoute({tags:["logs"],method:"get",path:"/{id}",request:{headers:o.z.object({"tenant-id":o.z.string().optional()}),params:o.z.object({id:o.z.string()})},security:[{Bearer:["read:logs","auth:read"]}],responses:{200:{content:{"application/json":{schema:Wa}},description:"A log entry"}}}),async t=>{const{id:e}=t.req.valid("param"),n=await t.env.data.logs.get(t.var.tenant_id,e);if(!n)throw new I(404);return t.json(n)}),Zk=17,Yk={organization:"org_",connection:"con_",action:"act_",hook:"h_",rule:"rul_",resource_server:"api_",guardian_factor:"gfa_",invite:"inv_",flow:"af_"};function Jl(t){const r=pb("0123456789abcdefghijklmnopqrstuvwxyz",Zk)();return`${Yk[t]}${r}`}function Qk(){return Jl("organization")}function e$(){return Jl("connection")}function t$(){return Jl("hook")}function n$(){return Jl("invite")}const r$=xt.extend({hooks:o.z.array(ki)}),i$=new o.OpenAPIHono().openapi(o.createRoute({tags:["hooks"],method:"get",path:"/",request:{query:et,headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["read:hooks","auth:read"]}],responses:{200:{content:{"application/json":{schema:o.z.union([o.z.array(ki),r$])}},description:"List of hooks"}}}),async t=>{const{page:e,per_page:n,include_totals:r,sort:i,q:s}=t.req.valid("query"),a=await t.env.data.hooks.list(t.var.tenant_id,{page:e,per_page:n,include_totals:r,sort:ut(i),q:s});return r?t.json(a):t.json(a.hooks)}).openapi(o.createRoute({tags:["hooks"],method:"post",path:"/",request:{headers:o.z.object({"tenant-id":o.z.string().optional()}),body:{content:{"application/json":{schema:ba}}}},security:[{Bearer:["create:hooks","auth:write"]}],responses:{201:{content:{"application/json":{schema:ki}},description:"The created hook"}}}),async t=>{const e=t.req.valid("json"),n={...e,hook_id:e.hook_id||t$()},r=await t.env.data.hooks.create(t.var.tenant_id,n);return t.json(r,{status:201})}).openapi(o.createRoute({tags:["hooks"],method:"patch",path:"/{hook_id}",request:{headers:o.z.object({"tenant-id":o.z.string().optional()}),params:o.z.object({hook_id:o.z.string()}),body:{content:{"application/json":{schema:o.z.union([ba.options[0].omit({hook_id:!0}).partial(),ba.options[1].omit({hook_id:!0}).partial()])}}}},security:[{Bearer:["update:hooks","auth:write"]}],responses:{200:{content:{"application/json":{schema:ki}},description:"The updated hook"},404:{description:"Hook not found"}}}),async t=>{const{hook_id:e}=t.req.valid("param"),n=t.req.valid("json");await t.env.data.hooks.update(t.var.tenant_id,e,n);const r=await t.env.data.hooks.get(t.var.tenant_id,e);if(!r)throw new I(404,{message:"Hook not found"});return t.json(r)}).openapi(o.createRoute({tags:["hooks"],method:"get",path:"/{hook_id}",request:{headers:o.z.object({"tenant-id":o.z.string().optional()}),params:o.z.object({hook_id:o.z.string()})},security:[{Bearer:["read:hooks","auth:read"]}],responses:{200:{content:{"application/json":{schema:ki}},description:"A hook"},404:{description:"Hook not found"}}}),async t=>{const{hook_id:e}=t.req.valid("param"),n=await t.env.data.hooks.get(t.var.tenant_id,e);if(!n)throw new I(404,{message:"Hook not found"});return t.json(n)}).openapi(o.createRoute({tags:["hooks"],method:"delete",path:"/{hook_id}",request:{headers:o.z.object({"tenant-id":o.z.string().optional()}),params:o.z.object({hook_id:o.z.string()})},security:[{Bearer:["delete:hooks","auth:write"]}],responses:{200:{description:"A hook"}}}),async t=>{const{hook_id:e}=t.req.valid("param");if(!await t.env.data.hooks.remove(t.var.tenant_id,e))throw new I(404,{message:"Hook not found"});return t.text("OK")});o.z.object({start:o.z.number(),limit:o.z.number(),length:o.z.number()});Kc.extend({email:o.z.string(),login_count:o.z.number(),multifactor:o.z.array(o.z.string()).optional(),last_ip:o.z.string().optional(),last_login:o.z.string().optional(),user_id:o.z.string()}).catchall(o.z.any());const o$=xt.extend({connections:o.z.array(Ot)}),s$=o.z.object({enabled_clients:o.z.array(o.z.object({client_id:o.z.string(),name:o.z.string()}))}),a$=o.z.array(o.z.object({client_id:o.z.string(),status:o.z.boolean()})),c$=new o.OpenAPIHono().openapi(o.createRoute({tags:["connections"],method:"get",path:"/",request:{query:et,headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["read:connections","auth:read"]}],responses:{200:{content:{"application/json":{schema:o.z.union([o.z.array(Ot),o$])}},description:"List of connectionss"}}}),async t=>{const{page:e,per_page:n,include_totals:r=!1,sort:i,q:s}=t.req.valid("query"),a=await t.env.data.connections.list(t.var.tenant_id,{page:e,per_page:n,include_totals:r,sort:ut(i),q:s});return r?t.json(a):t.json(a.connections)}).openapi(o.createRoute({tags:["connections"],method:"get",path:"/{id}",request:{params:o.z.object({id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["read:connections","auth:read"]}],responses:{200:{content:{"application/json":{schema:Ot}},description:"A connection"}}}),async t=>{const{id:e}=t.req.valid("param"),n=await t.env.data.connections.get(t.var.tenant_id,e);if(!n)throw new I(404);return t.json(n)}).openapi(o.createRoute({tags:["connections"],method:"delete",path:"/{id}",request:{params:o.z.object({id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["delete:connections","auth:write"]}],responses:{200:{description:"Status"}}}),async t=>{const{id:e}=t.req.valid("param"),n=t.var.tenant_id;if(!await t.env.data.connections.remove(n,e))throw new I(404,{message:"Connection not found"});return t.text("OK")}).openapi(o.createRoute({tags:["connections"],method:"patch",path:"/{id}",request:{body:{content:{"application/json":{schema:o.z.object(Va.shape).partial()}}},params:o.z.object({id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["update:connections","auth:write"]}],responses:{200:{content:{"application/json":{schema:Ot}},description:"The updated connection"}}}),async t=>{const{id:e}=t.req.valid("param"),n=t.req.valid("json"),r=t.var.tenant_id;if(!await t.env.data.connections.update(r,e,n))throw new I(404,{message:"Connection not found"});const s=await t.env.data.connections.get(r,e);if(!s)throw new I(404,{message:"Connection not found"});return t.json(s)}).openapi(o.createRoute({tags:["connections"],method:"post",path:"/",request:{body:{content:{"application/json":{schema:o.z.object(Va.shape)}}},headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["create:connections","auth:write"]}],responses:{201:{content:{"application/json":{schema:Ot}},description:"A connection"}}}),async t=>{const e=t.req.valid("json"),n=t.var.tenant_id,r=e.id||e$(),i=await t.env.data.connections.create(n,{...e,id:r});return t.json(i,{status:201})}).openapi(o.createRoute({tags:["connections"],method:"get",path:"/{id}/clients",request:{params:o.z.object({id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["read:connections","auth:read"]}],responses:{200:{content:{"application/json":{schema:s$}},description:"List of clients enabled for this connection"}}}),async t=>{const{id:e}=t.req.valid("param");if(!await t.env.data.connections.get(t.var.tenant_id,e))throw new I(404,{message:"Connection not found"});const{clients:r}=await t.env.data.clients.list(t.var.tenant_id,{per_page:1e3}),i=r.filter(s=>s.connections?.includes(e)).map(s=>({client_id:s.client_id,name:s.name}));return t.json({enabled_clients:i})}).openapi(o.createRoute({tags:["connections"],method:"patch",path:"/{id}/clients",request:{body:{content:{"application/json":{schema:a$}}},params:o.z.object({id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["update:connections","auth:write"]}],responses:{200:{description:"Clients updated successfully"}}}),async t=>{const{id:e}=t.req.valid("param"),n=t.req.valid("json");if(!await t.env.data.connections.get(t.var.tenant_id,e))throw new I(404,{message:"Connection not found"});for(const i of n){const s=await t.env.data.clients.get(t.var.tenant_id,i.client_id);if(!s)continue;const a=s.connections||[];i.status?a.includes(e)||await t.env.data.clients.update(t.var.tenant_id,i.client_id,{connections:[...a,e]}):a.includes(e)&&await t.env.data.clients.update(t.var.tenant_id,i.client_id,{connections:a.filter(c=>c!==e)})}return t.text("OK")}),l$=new o.OpenAPIHono().openapi(o.createRoute({tags:["prompts"],method:"get",path:"/",request:{headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["read:prompts","auth:read"]}],responses:{200:{content:{"application/json":{schema:va}},description:"Branding settings"}}}),async t=>{const e=await t.env.data.promptSettings.get(t.var.tenant_id);return e?t.json(e):t.json(va.parse({}))}).openapi(o.createRoute({tags:["prompts"],method:"patch",path:"/",request:{headers:o.z.object({"tenant-id":o.z.string().optional()}),body:{content:{"application/json":{schema:o.z.object(va.shape).partial()}}}},security:[{Bearer:["update:prompts","auth:write"]}],responses:{200:{description:"Prompts settings"}}}),async t=>{const e=t.req.valid("json"),n=await t.env.data.promptSettings.get(t.var.tenant_id);return Object.assign(n,e),await t.env.data.promptSettings.set(t.var.tenant_id,n),t.json(n)});let Am=!1;function Nf(t){t.use(async(e,n)=>(Am||(t.openAPIRegistry.registerComponent("securitySchemes","Bearer",{type:"oauth2",scheme:"bearer",flows:{implicit:{authorizationUrl:`${e.env.AUTH_URL}/authorize`,scopes:{openid:"Basic user information",email:"User email",profile:"User profile information"}}}}),Am=!0),await n()))}var u$=(t,e)=>{try{return e(t)}catch{return t.replace(/(?:%[0-9A-Fa-f]{2})+/g,n=>{try{return e(n)}catch{return n}})}},d$=decodeURIComponent,p$=/^[\w!#$%&'*.^`|~+-]+$/,f$=/^[ !#-:<-[\]-~]*$/,h$=(t,e)=>{if(t.indexOf(e)===-1)return{};const n=t.trim().split(";"),r={};for(let i of n){i=i.trim();const s=i.indexOf("=");if(s===-1)continue;const a=i.substring(0,s).trim();if(e!==a||!p$.test(a))continue;let c=i.substring(s+1).trim();if(c.startsWith('"')&&c.endsWith('"')&&(c=c.slice(1,-1)),f$.test(c)){r[a]=c.indexOf("%")!==-1?u$(c,d$):c;break}}return r},g$=(t,e,n={})=>{let r=`${t}=${e}`;if(t.startsWith("__Secure-")&&!n.secure)throw new Error("__Secure- Cookie must have Secure attributes");if(t.startsWith("__Host-")){if(!n.secure)throw new Error("__Host- Cookie must have Secure attributes");if(n.path!=="/")throw new Error('__Host- Cookie must have Path attributes with "/"');if(n.domain)throw new Error("__Host- Cookie must not have Domain attributes")}if(n&&typeof n.maxAge=="number"&&n.maxAge>=0){if(n.maxAge>3456e4)throw new Error("Cookies Max-Age SHOULD NOT be greater than 400 days (34560000 seconds) in duration.");r+=`; Max-Age=${n.maxAge|0}`}if(n.domain&&n.prefix!=="host"&&(r+=`; Domain=${n.domain}`),n.path&&(r+=`; Path=${n.path}`),n.expires){if(n.expires.getTime()-Date.now()>3456e7)throw new Error("Cookies Expires SHOULD NOT be greater than 400 days (34560000 seconds) in the future.");r+=`; Expires=${n.expires.toUTCString()}`}if(n.httpOnly&&(r+="; HttpOnly"),n.secure&&(r+="; Secure"),n.sameSite&&(r+=`; SameSite=${n.sameSite.charAt(0).toUpperCase()+n.sameSite.slice(1)}`),n.priority&&(r+=`; Priority=${n.priority.charAt(0).toUpperCase()+n.priority.slice(1)}`),n.partitioned){if(!n.secure)throw new Error("Partitioned Cookie must have Secure attributes");r+="; Partitioned"}return r},Eu=(t,e,n)=>(e=encodeURIComponent(e),g$(t,e,n)),m$=(t,e,n)=>{const r=t.req.raw.headers.get("Cookie");{if(!r)return;let i=e;return h$(r,i)[i]}},_$=(t,e,n)=>{let r;return n?.prefix==="secure"?r=Eu("__Secure-"+t,e,{path:"/",...n,secure:!0}):n?.prefix==="host"?r=Eu("__Host-"+t,e,{...n,path:"/",secure:!0,domain:void 0}):r=Eu(t,e,{path:"/",...n}),r},Em=(t,e,n,r)=>{const i=_$(e,n,r);t.header("Set-Cookie",i,{append:!0})},Dw=t=>Uw(t.replace(/_|-/g,e=>({_:"/","-":"+"})[e]??e)),Uw=t=>{const e=atob(t),n=new Uint8Array(new ArrayBuffer(e.length)),r=e.length/2;for(let i=0,s=e.length-1;i<=r;i++,s--)n[i]=e.charCodeAt(i),n[s]=e.charCodeAt(s);return n},Mw=(t=>(t.HS256="HS256",t.HS384="HS384",t.HS512="HS512",t.RS256="RS256",t.RS384="RS384",t.RS512="RS512",t.PS256="PS256",t.PS384="PS384",t.PS512="PS512",t.ES256="ES256",t.ES384="ES384",t.ES512="ES512",t.EdDSA="EdDSA",t))(Mw||{}),y$=class extends Error{constructor(t){super(`${t} is not an implemented algorithm`),this.name="JwtAlgorithmNotImplemented"}},qw=class extends Error{constructor(t){super(`invalid JWT token: ${t}`),this.name="JwtTokenInvalid"}},b$=class extends Error{constructor(t){super(`token (${t}) is being used before it's valid`),this.name="JwtTokenNotBefore"}},w$=class extends Error{constructor(t){super(`token (${t}) expired`),this.name="JwtTokenExpired"}},v$=class extends Error{constructor(t,e){super(`Invalid "iat" claim, must be a valid number lower than "${t}" (iat: "${e}")`),this.name="JwtTokenIssuedAt"}},Cu=class extends Error{constructor(t,e){super(`expected issuer "${t}", got ${e?`"${e}"`:"none"} `),this.name="JwtTokenIssuer"}},x$=class extends Error{constructor(t){super(`jwt header is invalid: ${JSON.stringify(t)}`),this.name="JwtHeaderInvalid"}},k$=class extends Error{constructor(t){super(`token(${t}) signature mismatched`),this.name="JwtTokenSignatureMismatched"}},$$=class extends Error{constructor(t){super(`required "aud" in jwt payload: ${JSON.stringify(t)}`),this.name="JwtPayloadRequiresAud"}},S$=class extends Error{constructor(t,e){super(`expected audience "${Array.isArray(t)?t.join(", "):t}", got "${e}"`),this.name="JwtTokenAudience"}},Mc=(t=>(t.Encrypt="encrypt",t.Decrypt="decrypt",t.Sign="sign",t.Verify="verify",t.DeriveKey="deriveKey",t.DeriveBits="deriveBits",t.WrapKey="wrapKey",t.UnwrapKey="unwrapKey",t))(Mc||{}),Fw=new TextEncoder,z$=new TextDecoder;async function A$(t,e,n,r){const i=C$(e),s=await E$(t,i);return await crypto.subtle.verify(i,s,n,r)}function Cm(t){return Uw(t.replace(/-+(BEGIN|END).*/g,"").replace(/\s/g,""))}async function E$(t,e){if(!crypto.subtle||!crypto.subtle.importKey)throw new Error("`crypto.subtle.importKey` is undefined. JWT auth middleware requires it.");if(N$(t)){if(t.type==="public"||t.type==="secret")return t;t=await Nm(t)}if(typeof t=="string"&&t.includes("PRIVATE")){const r=await crypto.subtle.importKey("pkcs8",Cm(t),e,!0,[Mc.Sign]);t=await Nm(r)}const n=[Mc.Verify];return typeof t=="object"?await crypto.subtle.importKey("jwk",t,e,!1,n):t.includes("PUBLIC")?await crypto.subtle.importKey("spki",Cm(t),e,!1,n):await crypto.subtle.importKey("raw",Fw.encode(t),e,!1,n)}async function Nm(t){if(t.type!=="private")throw new Error(`unexpected key type: ${t.type}`);if(!t.extractable)throw new Error("unexpected private key is unextractable");const e=await crypto.subtle.exportKey("jwk",t),{kty:n}=e,{alg:r,e:i,n:s}=e,{crv:a,x:c,y:l}=e;return{kty:n,alg:r,e:i,n:s,crv:a,x:c,y:l,key_ops:[Mc.Verify]}}function C$(t){switch(t){case"HS256":return{name:"HMAC",hash:{name:"SHA-256"}};case"HS384":return{name:"HMAC",hash:{name:"SHA-384"}};case"HS512":return{name:"HMAC",hash:{name:"SHA-512"}};case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"RS384":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}};case"RS512":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}};case"PS256":return{name:"RSA-PSS",hash:{name:"SHA-256"},saltLength:32};case"PS384":return{name:"RSA-PSS",hash:{name:"SHA-384"},saltLength:48};case"PS512":return{name:"RSA-PSS",hash:{name:"SHA-512"},saltLength:64};case"ES256":return{name:"ECDSA",hash:{name:"SHA-256"},namedCurve:"P-256"};case"ES384":return{name:"ECDSA",hash:{name:"SHA-384"},namedCurve:"P-384"};case"ES512":return{name:"ECDSA",hash:{name:"SHA-512"},namedCurve:"P-521"};case"EdDSA":return{name:"Ed25519",namedCurve:"Ed25519"};default:throw new y$(t)}}function N$(t){return fb()==="node"&&crypto.webcrypto?t instanceof crypto.webcrypto.CryptoKey:t instanceof CryptoKey}var Im=t=>JSON.parse(z$.decode(Dw(t)));function I$(t){if(typeof t=="object"&&t!==null){const e=t;return"alg"in e&&Object.values(Mw).includes(e.alg)&&(!("typ"in e)||e.typ==="JWT")}return!1}var j$=async(t,e,n)=>{const{alg:r="HS256",iss:i,nbf:s=!0,exp:a=!0,iat:c=!0,aud:l}=typeof n=="string"?{alg:n}:n||{},u=t.split(".");if(u.length!==3)throw new qw(t);const{header:d,payload:f}=Hw(t);if(!I$(d))throw new x$(d);const p=Date.now()/1e3|0;if(s&&f.nbf&&f.nbf>p)throw new b$(t);if(a&&f.exp&&f.exp<=p)throw new w$(t);if(c&&f.iat&&p<f.iat)throw new v$(p,f.iat);if(i){if(!f.iss)throw new Cu(i,null);if(typeof i=="string"&&f.iss!==i)throw new Cu(i,f.iss);if(i instanceof RegExp&&!i.test(f.iss))throw new Cu(i,f.iss)}if(l){if(!f.aud)throw new $$(f);if(!(Array.isArray(f.aud)?f.aud:[f.aud]).some(_=>l instanceof RegExp?l.test(_):typeof l=="string"?_===l:Array.isArray(l)&&l.includes(_)))throw new S$(l,f.aud)}const h=t.substring(0,t.lastIndexOf("."));if(!await A$(e,r,Dw(u[2]),Fw.encode(h)))throw new k$(t);return f},Hw=t=>{try{const[e,n]=t.split("."),r=Im(e),i=Im(n);return{header:r,payload:i}}catch{throw new qw(t)}},Vw={verify:j$,decode:Hw},T$=Vw.verify,O$=Vw.decode;async function e0(t){const{signingKeys:e}=await t.keys.list({q:"type:jwt_signing"});return await Promise.all(e.map(async r=>{const s=await new Wl(r.cert).publicKey.export(),a=await crypto.subtle.exportKey("jwk",s);return S0.parse({...a,kid:r.kid})}))}o.z.object({alg:o.z.literal("RS256"),kty:o.z.literal("RSA"),use:o.z.literal("sig"),n:o.z.string(),e:o.z.string(),kid:o.z.string(),x5t:o.z.string(),x5c:o.z.array(o.z.string())});const Kw="urn:authhero:management";function P$(t){return`urn:authhero:tenant:${t}`}function Gw(t){const e="urn:authhero:tenant:";return t.startsWith(e)?t.slice(e.length):null}async function R$(t){if(t.JWKS_URL&&t.JWKS_SERVICE){const e=await t.JWKS_SERVICE.fetch(t.JWKS_URL);return e.ok?(await e.json()).keys:(console.warn(`JWKS fetch failed with status ${e.status}, falling back to database`),await e0(t.data))}return await e0(t.data)}async function L$(t,e){try{const{header:n}=O$(e),i=(await R$(t.env)).find(c=>c.kid===n.kid);if(!i)throw new X(401,{message:"No matching kid found"});const s=await crypto.subtle.importKey("jwk",i,{name:"RSASSA-PKCS1-v1_5",hash:"SHA-256"},!1,["verify"]);return await T$(e,s,"RS256")}catch(n){throw n instanceof I?n:new X(403,{message:"Invalid JWT signature"})}}function B$(t){return t.replace(/:([a-zA-Z_][a-zA-Z0-9_]*)/g,"{$1}")}function Xl(t){return async(e,n)=>{const r=e.req.matchedRoutes.find(l=>l.method.toUpperCase()===e.req.method&&l.path!=="/*");if(!r)return await n();const i=B$(r.path),s="/api/v2",a=i.startsWith(s)?i.slice(s.length)||"/":i,c=t.openAPIRegistry.definitions.find(l=>"route"in l&&l.route.path===a&&l.route.method.toUpperCase()===e.req.method.toUpperCase());if(c&&"route"in c){const l=c.route.security?.[0]?.Bearer;if(l===void 0)return await n();const u=e.req.header("authorization")||"",[d,f]=u.split(" ");if(d?.toLowerCase()!=="bearer"||!f)throw new X(401,{message:"Missing bearer token"});try{const p=await L$(e,f);e.set("user_id",p.sub),e.set("user",p);const h=Array.isArray(p.aud)?p.aud:[p.aud],m=h.includes(Kw),y=h.find($=>$.startsWith("urn:authhero:tenant:")),w=y?Gw(y):null,_=e.var.tenant_id;if(m){const $=p.org_id,b=p.org_name;if(b&&e.set("org_name",b),$&&e.set("organization_id",$),!(a==="/tenants"||a.startsWith("/tenants/")||a==="/settings"||a.startsWith("/settings/"))){const A=b||$;if(!A)throw new X(403,{message:"Management tokens require org_id or org_name claim for accessing tenant resources"});if(!_)e.set("tenant_id",A);else if(A!==_)throw new X(403,{message:`Token organization '${A}' does not match tenant '${_}'`})}}else if(w){if(w!==_)throw new X(403,{message:`Token audience is for tenant '${w}' but request is for tenant '${_}'`});e.var.tenant_id||e.set("tenant_id",w)}else!e.var.tenant_id&&p.tenant_id&&e.set("tenant_id",p.tenant_id);const k=Array.isArray(p.permissions)?p.permissions:[],v=typeof p.scope=="string"?p.scope.split(" "):Array.isArray(p.scope)?p.scope:[];if(l.length&&!(l.some($=>k.includes($))||l.some($=>v.includes($))))throw new X(403,{message:"Unauthorized"})}catch(p){throw p instanceof I?p:new X(403,{message:"Invalid token"})}}return await n()}}const D$=new o.OpenAPIHono().openapi(o.createRoute({tags:["emails"],method:"get",path:"/",request:{headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["read:emails","auth:read"]}],responses:{200:{content:{"application/json":{schema:xa}},description:"Email provider"}}}),async t=>{const e=await t.env.data.emailProviders.get(t.var.tenant_id);if(!e)throw new I(404,{message:"Email provider not found"});return t.json(e)}).openapi(o.createRoute({tags:["emails"],method:"post",path:"/",request:{headers:o.z.object({"tenant-id":o.z.string().optional()}),body:{content:{"application/json":{schema:o.z.object(xa.shape)}}}},security:[{Bearer:["create:emails","auth:write"]}],responses:{200:{description:"Branding settings"}}}),async t=>{const e=t.req.valid("json");return await t.env.data.emailProviders.create(t.var.tenant_id,e),t.text("OK",{status:201})}).openapi(o.createRoute({tags:["emails"],method:"patch",path:"/",request:{headers:o.z.object({"tenant-id":o.z.string().optional()}),body:{content:{"application/json":{schema:o.z.object(xa.shape).partial()}}}},security:[{Bearer:["update:emails","auth:write"]}],responses:{200:{description:"Branding settings"}}}),async t=>{const e=t.req.valid("json");return await t.env.data.emailProviders.update(t.var.tenant_id,e),t.text("OK")}),U$=new o.OpenAPIHono().openapi(o.createRoute({tags:["sessions"],method:"get",path:"/{id}",request:{params:o.z.object({id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["read:sessions","auth:read"]}],responses:{200:{content:{"application/json":{schema:Xc}},description:"A session"}}}),async t=>{const{id:e}=t.req.valid("param"),n=await t.env.data.sessions.get(t.var.tenant_id,e);if(!n)throw new I(404);return t.json(n)}).openapi(o.createRoute({tags:["sessions"],method:"delete",path:"/{id}",request:{params:o.z.object({id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["delete:sessions","auth:write"]}],responses:{200:{description:"Status"}}}),async t=>{const{id:e}=t.req.valid("param");if(!await t.env.data.sessions.remove(t.var.tenant_id,e))throw new I(404,{message:"Session not found"});return t.text("OK")}).openapi(o.createRoute({tags:["sessions"],method:"post",path:"/{id}/revoke",request:{params:o.z.object({id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["update:sessions","auth:write"]}],responses:{202:{description:"Sesssion deletion status"}}}),async t=>{const{id:e}=t.req.valid("param");if(!await t.env.data.sessions.update(t.var.tenant_id,e,{revoked_at:new Date().toDateString()}))throw new I(404,{message:"Session not found"});return t.text("Session deletion request accepted.",{status:202})}),M$=new o.OpenAPIHono().openapi(o.createRoute({tags:["refresh_tokens"],method:"get",path:"/{id}",request:{params:o.z.object({id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["read:refresh_tokens","auth:read"]}],responses:{200:{content:{"application/json":{schema:A0}},description:"A session"}}}),async t=>{const{id:e}=t.req.valid("param"),n=await t.env.data.refreshTokens.get(t.var.tenant_id,e);if(!n)throw new I(404);return t.json(n)}).openapi(o.createRoute({tags:["refresh_tokens"],method:"delete",path:"/{id}",request:{params:o.z.object({id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["delete:refresh_tokens","auth:write"]}],responses:{200:{description:"Status"}}}),async t=>{const{id:e}=t.req.valid("param");if(!await t.env.data.refreshTokens.remove(t.var.tenant_id,e))throw new I(404,{message:"Session not found"});return t.text("OK")}),q$=new o.OpenAPIHono().openapi(o.createRoute({tags:["custom-domains"],method:"get",path:"/",request:{query:et,headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["read:custom_domains","auth:read"]}],responses:{200:{content:{"application/json":{schema:o.z.array(Qn)}},description:"List of custom domains"}}}),async t=>{const e=await t.env.data.customDomains.list(t.var.tenant_id);return t.json(e)}).openapi(o.createRoute({tags:["custom-domains"],method:"get",path:"/{id}",request:{params:o.z.object({id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["read:custom_domains","auth:read"]}],responses:{200:{content:{"application/json":{schema:Qn}},description:"A customDomain"}}}),async t=>{const{id:e}=t.req.valid("param"),n=await t.env.data.customDomains.get(t.var.tenant_id,e);if(!n)throw new I(404);return t.json(n)}).openapi(o.createRoute({tags:["custom-domains"],method:"delete",path:"/{id}",request:{params:o.z.object({id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["delete:custom_domains","auth:write"]}],responses:{200:{description:"Status"}}}),async t=>{const{id:e}=t.req.valid("param");if(!await t.env.data.customDomains.remove(t.var.tenant_id,e))throw new I(404,{message:"Custom domain not found"});return t.text("OK")}).openapi(o.createRoute({tags:["custom-domains"],method:"patch",path:"/{id}",request:{body:{content:{"application/json":{schema:o.z.object(Qn.shape).partial()}}},params:o.z.object({id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["update:custom_domains","auth:write"]}],responses:{200:{content:{"application/json":{schema:Qn}},description:"The updated custom domain"}}}),async t=>{const{id:e}=t.req.valid("param"),n=t.req.valid("json");if(!await t.env.data.customDomains.update(t.var.tenant_id,e,n))throw new I(404);const i=await t.env.data.customDomains.get(t.var.tenant_id,e);if(!i)throw new I(404);return t.json(i)}).openapi(o.createRoute({tags:["custom-domains"],method:"post",path:"/",request:{body:{content:{"application/json":{schema:o.z.object(w0.shape)}}},headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["create:custom_domains","auth:write"]}],responses:{201:{content:{"application/json":{schema:Qn}},description:"The created custom domain"}}}),async t=>{const e=t.req.valid("json"),n=await t.env.data.customDomains.create(t.var.tenant_id,e);return t.json(n,{status:201})}).openapi(o.createRoute({tags:["custom-domains"],method:"post",path:"/{id}/verify",request:{params:o.z.object({id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["update:custom_domains","auth:write"]}],responses:{200:{content:{"application/json":{schema:Qn}},description:"The custom domain"}}}),async()=>{throw new I(501,{message:"Not implemented"})});function Zl(t,e){const n={};for(const[r,i]of Object.entries(e)){if(i==null)continue;const s={};for(const[a,c]of Object.entries(i))typeof c=="function"?s[a]=async(...l)=>{const u=performance.now();try{const d=await c(...l),p=performance.now()-u,h=t.res.headers.get("Server-Timing")||"",m=h?`${h}, ${r}-${a};dur=${p.toFixed(2)}`:`${r}-${a};dur=${p.toFixed(2)}`;return t.res.headers.set("Server-Timing",m),d}catch(d){const p=performance.now()-u,h=t.res.headers.get("Server-Timing")||"",m=h?`${h}, ${r}-${a}-error;dur=${p.toFixed(2)}`:`${r}-${a}-error;dur=${p.toFixed(2)}`;throw t.res.headers.set("Server-Timing",m),d}}:s[a]=c;n[r]=s}return n}async function Ws(t,e){const n=t.var.user;if(n?.tenant_id){if(n.tenant_id==="control_plane"&&n.org_name)return t.set("tenant_id",n.org_name),await e();if(n.tenant_id)return t.set("tenant_id",n.tenant_id),await e()}const r=t.req.header("tenant-id");if(r)return t.set("tenant_id",r),await e();const i=t.req.header("x-forwarded-host");if(i){const a=await t.env.data.customDomains.getByDomain(i);if(a)return t.set("tenant_id",a.tenant_id),t.set("custom_domain",i),t.set("host",i),await e()}const s=t.req.header("host");if(s){t.set("host",s);const a=s.split(".");if(a.length>1&&typeof a[0]=="string"){const c=a[0];await t.env.data.tenants.get(c)&&t.set("tenant_id",c)}}else t.set("host",new URL(il(t.env)).host);if(!t.var.tenant_id){const{tenants:a}=await t.env.data.tenants.list({per_page:2});a.length===1&&a[0]&&t.set("tenant_id",a[0].id)}return await e()}const F$=o.z.object({name:o.z.string(),version:o.z.string(),env:o.z.object({node:o.z.string().optional()}).optional()});function H$(t){if(t)try{let e=t;try{e=atob(t)}catch{}try{const n=JSON.parse(e);return F$.parse(n)}catch{}}catch{return}}const Js=async(t,e)=>{const n=t.req.query("auth0Client")?.slice(0,255),i=(t.req.header("x-forwarded-host")&&t.req.header("x-forwarded-for")?t.req.header("x-forwarded-for")?.split(",")[0]?.trim():t.req.header("cf-connecting-ip")||t.req.header("x-real-ip"))?.slice(0,45),s=t.req.header("user-agent")?.slice(0,512),a=t.req.header("cf-ipcountry")?.slice(0,2),c=n?H$(n):void 0;c&&t.set("auth0_client",c),i&&t.set("ip",i),s&&t.set("useragent",s),a&&t.set("countryCode",a),await e()};function V$(t,e,n,r){try{const i=`${t}:${e}:${JSON.stringify(n)}`;return r?`${r}:${i}`:i}catch{const s=`${t}:${e}:${Date.now()}-${Math.random()}`;return r?`${r}:${s}`:s}}function Yl(t,e){const{cache:n,defaultTtl:r,customTtls:i={},excludeMethods:s=[],cacheEntities:a=[],keyPrefix:c}=e,l=new Set(s),u=a.length===0,d=new Set(a),f={};for(const[p,h]of Object.entries(t)){if(h==null)continue;const m=u||d.has(p),y={};for(const[w,_]of Object.entries(h))if(typeof _=="function"){if(!m){y[w]=_;continue}const k=`${p}:${w}`;if(l.has(k)){y[w]=_;continue}const v=i[k]??r,$=["create","update","remove","delete","set","used"].includes(w);y[w]=async(...b)=>{if($)return await _.apply(h,b);const z=V$(p,w,b,c),A=await n.get(z);if(A!==null)if(A&&typeof A=="object"&&"isCachedNull"in A){const O=A;return O.isCachedNull?null:O.value}else return A;const N=await _.apply(h,b);if(v>=0)if(N!==null)await n.set(z,N,v);else{const O={value:null,isCachedNull:!0};await n.set(z,O,v)}return N}}else y[w]=_;f[p]=y}return f}function Nu(t,e,n){return e?{...t,create:async(r,i)=>{let s=i;e.beforeCreate&&(s=await e.beforeCreate(n,i));const a=await t.create(r,s);return e.afterCreate&&await e.afterCreate(n,a),a},update:async(r,i,s)=>{let a=s;e.beforeUpdate&&(a=await e.beforeUpdate(n,i,s));const c=await t.update(r,i,a);if(e.afterUpdate){let l;typeof c=="boolean"?l=await t.get(r,i):l=c,l&&await e.afterUpdate(n,i,l)}return c},remove:async(r,i)=>{e.beforeDelete&&await e.beforeDelete(n,i);const s=await t.remove(r,i);return e.afterDelete&&s&&await e.afterDelete(n,i),s}}:t}function K$(t,e,n){return e?{...t,assign:async(r,i,s)=>{let a=s;e.beforeAssign&&(a=await e.beforeAssign(n,i,s));const c=await t.assign(r,i,a);return e.afterAssign&&c&&await e.afterAssign(n,i,a),c},remove:async(r,i,s)=>{let a=s;e.beforeRemove&&(a=await e.beforeRemove(n,i,s));const c=await t.remove(r,i,a);return e.afterRemove&&c&&await e.afterRemove(n,i,a),c}}:t}function G$(t,e,n){return e?{...t,create:async r=>{let i=r;e.beforeCreate&&(i=await e.beforeCreate(n,r));const s=await t.create(i);return e.afterCreate&&await e.afterCreate(n,s),s},update:async(r,i)=>{let s=i;if(e.beforeUpdate&&(s=await e.beforeUpdate(n,r,i)),await t.update(r,s),e.afterUpdate){const a=await t.get(r);a&&await e.afterUpdate(n,r,a)}},remove:async r=>{e.beforeDelete&&await e.beforeDelete(n,r);const i=await t.remove(r);return e.afterDelete&&i&&await e.afterDelete(n,r),i}}:t}function Ww(t,e){const{tenantId:n,entityHooks:r}=e;if(!r)return t;const i={tenantId:n,adapters:t};return{...t,connections:Nu(t.connections,r.connections,i),roles:Nu(t.roles,r.roles,i),resourceServers:Nu(t.resourceServers,r.resourceServers,i),rolePermissions:K$(t.rolePermissions,r.rolePermissions,i),tenants:G$(t.tenants,r.tenants,i)}}class W${constructor(e={}){this.config=e;const n=e.cleanupIntervalMs;n&&n>0&&(this.cleanupTimer=setInterval(()=>{this.cleanupExpired()},n))}cache=new Map;accessOrder=new Map;accessCounter=0;cleanupTimer;async get(e){const n=this.cache.get(e);return n?n.expiresAt&&n.expiresAt<new Date?(this.cache.delete(e),this.accessOrder.delete(e),null):(this.accessOrder.set(e,++this.accessCounter),n.value):null}async set(e,n,r){let i;const s=r??this.config.defaultTtlSeconds,a=s!==void 0,c=a?Math.max(0,s):0;a&&(i=new Date(Date.now()+(c>0?c*1e3:-1))),this.config.maxEntries&&this.cache.size>=this.config.maxEntries&&!this.cache.has(e)&&this.evictLeastRecentlyUsed();const l={value:n,expiresAt:i};this.cache.set(e,l),this.accessOrder.set(e,++this.accessCounter)}async delete(e){const n=this.cache.has(e);return this.cache.delete(e),this.accessOrder.delete(e),n}async clear(){this.cache.clear(),this.accessOrder.clear(),this.accessCounter=0}getStats(){return{size:this.cache.size,maxEntries:this.config.maxEntries,defaultTtlSeconds:this.config.defaultTtlSeconds}}cleanupExpired(){const e=new Date,n=[];for(const[r,i]of this.cache.entries())i.expiresAt&&i.expiresAt<e&&n.push(r);for(const r of n)this.cache.delete(r),this.accessOrder.delete(r)}evictLeastRecentlyUsed(){let e=null,n=1/0;for(const[r,i]of this.accessOrder.entries())i<n&&(n=i,e=r);e&&(this.cache.delete(e),this.accessOrder.delete(e))}destroy(){this.cleanupTimer&&(clearInterval(this.cleanupTimer),this.cleanupTimer=void 0)}}function Xs(t={}){return new W$(t)}const J$=xt.extend({forms:o.z.array(xi)}),X$=new o.OpenAPIHono().openapi(o.createRoute({tags:["forms"],method:"get",path:"/",request:{query:et,headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["read:forms","auth:read"]}],responses:{200:{content:{"application/json":{schema:o.z.union([o.z.array(xi),J$])}},description:"List of forms"}}}),async t=>{const e=t.var.tenant_id,{page:n,per_page:r,include_totals:i=!1,sort:s,q:a}=t.req.valid("query"),c=await t.env.data.forms.list(e,{page:n,per_page:r,include_totals:i,sort:ut(s),q:a});return i?t.json(c):t.json(c.forms)}).openapi(o.createRoute({tags:["forms"],method:"get",path:"/{id}",request:{params:o.z.object({id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["read:forms","auth:read"]}],responses:{200:{content:{"application/json":{schema:xi}},description:"A form"}}}),async t=>{const e=t.var.tenant_id,{id:n}=t.req.valid("param"),r=await t.env.data.forms.get(e,n);if(!r)throw new I(404);return t.json(r)}).openapi(o.createRoute({tags:["forms"],method:"delete",path:"/{id}",request:{params:o.z.object({id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["delete:forms","auth:write"]}],responses:{200:{description:"Status"}}}),async t=>{const e=t.var.tenant_id,{id:n}=t.req.valid("param");if(!await t.env.data.forms.remove(e,n))throw new I(404,{message:"Form not found"});return t.text("OK")}).openapi(o.createRoute({tags:["forms"],method:"patch",path:"/{id}",request:{body:{content:{"application/json":{schema:o.z.object(Ga.shape).partial()}}},params:o.z.object({id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["update:forms","auth:write"]}],responses:{200:{content:{"application/json":{schema:xi}},description:"The updated form"}}}),async t=>{const e=t.var.tenant_id,{id:n}=t.req.valid("param"),r=t.req.valid("json");if(!await t.env.data.forms.update(e,n,r))throw new I(404,{message:"Form not found"});const s=await t.env.data.forms.get(e,n);if(!s)throw new I(404,{message:"Form not found"});return t.json(s)}).openapi(o.createRoute({tags:["forms"],method:"post",path:"/",request:{body:{content:{"application/json":{schema:o.z.object(Ga.shape)}}},headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["create:forms","auth:write"]}],responses:{201:{content:{"application/json":{schema:xi}},description:"A form"}}}),async t=>{const e=t.var.tenant_id,n=t.req.valid("json"),r=await t.env.data.forms.create(e,n);return t.json(r,{status:201})}),Z$=xt.extend({flows:o.z.array(vi)}),Y$=new o.OpenAPIHono().openapi(o.createRoute({tags:["flows"],method:"get",path:"/",request:{query:et,headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["read:flows","auth:read"]}],responses:{200:{content:{"application/json":{schema:o.z.union([o.z.array(vi),Z$])}},description:"List of flows"}}}),async t=>{const e=t.var.tenant_id,{page:n,per_page:r,include_totals:i=!1,sort:s,q:a}=t.req.valid("query"),c=await t.env.data.flows.list(e,{page:n,per_page:r,include_totals:i,sort:ut(s),q:a});return i?t.json(c):t.json(c.flows)}).openapi(o.createRoute({tags:["flows"],method:"get",path:"/{id}",request:{params:o.z.object({id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["read:flows","auth:read"]}],responses:{200:{content:{"application/json":{schema:vi}},description:"A flow"}}}),async t=>{const e=t.var.tenant_id,{id:n}=t.req.valid("param"),r=await t.env.data.flows.get(e,n);if(!r)throw new I(404);return t.json(r)}).openapi(o.createRoute({tags:["flows"],method:"delete",path:"/{id}",request:{params:o.z.object({id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["delete:flows","auth:write"]}],responses:{200:{description:"Status"}}}),async t=>{const e=t.var.tenant_id,{id:n}=t.req.valid("param");if(!await t.env.data.flows.remove(e,n))throw new I(404,{message:"Flow not found"});return t.text("OK")}).openapi(o.createRoute({tags:["flows"],method:"patch",path:"/{id}",request:{body:{content:{"application/json":{schema:o.z.object(Ma.shape).partial()}}},params:o.z.object({id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["update:flows","auth:write"]}],responses:{200:{content:{"application/json":{schema:vi}},description:"The updated flow"}}}),async t=>{const e=t.var.tenant_id,{id:n}=t.req.valid("param"),r=t.req.valid("json"),i=await t.env.data.flows.update(e,n,r);if(!i)throw new I(404,{message:"Flow not found"});return t.json(i)}).openapi(o.createRoute({tags:["flows"],method:"post",path:"/",request:{body:{content:{"application/json":{schema:o.z.object(Ma.shape)}}},headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["create:flows","auth:write"]}],responses:{201:{content:{"application/json":{schema:vi}},description:"The created flow"}}}),async t=>{const e=t.var.tenant_id,n=t.req.valid("json"),r=await t.env.data.flows.create(e,n);return t.json(r,{status:201})}),Q$=xt.extend({roles:o.z.array(Nr)}),e9=new o.OpenAPIHono().openapi(o.createRoute({tags:["roles"],method:"get",path:"/",request:{query:et,headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["read:roles","auth:read"]}],responses:{200:{content:{"application/json":{schema:o.z.union([o.z.array(Nr),Q$])}},description:"List of roles"}}}),async t=>{const{page:e,per_page:n,include_totals:r,sort:i,q:s}=t.req.valid("query"),a=t.var.tenant_id;if(!a)throw new I(400,{message:"tenant-id header is required"});const c=await t.env.data.roles.list(a,{page:e,per_page:n,include_totals:r,sort:ut(i),q:s});return r?t.json(c):t.json(c.roles)}).openapi(o.createRoute({tags:["roles"],method:"get",path:"/{id}",request:{params:o.z.object({id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["read:roles","auth:read"]}],responses:{200:{content:{"application/json":{schema:Nr}},description:"A role"}}}),async t=>{const{id:e}=t.req.valid("param"),n=t.var.tenant_id;if(!n)throw new I(400,{message:"tenant-id header is required"});const r=await t.env.data.roles.get(n,e);if(!r)throw new I(404);return t.json(r)}).openapi(o.createRoute({tags:["roles"],method:"post",path:"/",request:{headers:o.z.object({"tenant-id":o.z.string().optional()}),body:{content:{"application/json":{schema:Xa}}}},security:[{Bearer:["create:roles","auth:write"]}],responses:{201:{content:{"application/json":{schema:Nr}},description:"Role created"}}}),async t=>{const e=t.req.valid("json"),n=t.var.tenant_id;if(!n)throw new I(400,{message:"tenant-id header is required"});const r=await t.env.data.roles.create(n,e);return t.json(r,{status:201})}).openapi(o.createRoute({tags:["roles"],method:"patch",path:"/{id}",request:{params:o.z.object({id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()}),body:{content:{"application/json":{schema:Xa.partial()}}}},security:[{Bearer:["update:roles","auth:write"]}],responses:{200:{content:{"application/json":{schema:Nr}},description:"Updated role"}}}),async t=>{const{id:e}=t.req.valid("param"),n=t.req.valid("json"),r=t.var.tenant_id;if(!r)throw new I(400,{message:"tenant-id header is required"});if(!await t.env.data.roles.update(r,e,n))throw new I(404);const s=await t.env.data.roles.get(r,e);return t.json(s)}).openapi(o.createRoute({tags:["roles"],method:"delete",path:"/{id}",request:{params:o.z.object({id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["delete:roles","auth:write"]}],responses:{200:{description:"Status"}}}),async t=>{const{id:e}=t.req.valid("param"),n=t.var.tenant_id;if(!n)throw new I(400,{message:"tenant-id header is required"});if(!await t.env.data.roles.remove(n,e))throw new I(404);return t.text("OK")}).openapi(o.createRoute({tags:["roles"],method:"get",path:"/{id}/permissions",request:{params:o.z.object({id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()}),query:et},security:[{Bearer:["read:roles","auth:read"]}],responses:{200:{content:{"application/json":{schema:Ky}},description:"Role permissions"}}}),async t=>{const{id:e}=t.req.valid("param"),{page:n,per_page:r,sort:i,q:s}=t.req.valid("query"),a=t.var.tenant_id;if(!a)throw new I(400,{message:"tenant-id header is required"});if(!await t.env.data.roles.get(a,e))throw new I(404,{message:"Role not found"});const l=await t.env.data.rolePermissions.list(a,e,{page:n,per_page:r,include_totals:!1,sort:ut(i),q:s});return t.json(l)}).openapi(o.createRoute({tags:["roles"],method:"post",path:"/{id}/permissions",request:{params:o.z.object({id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()}),body:{content:{"application/json":{schema:o.z.object({permissions:o.z.array(o.z.object({permission_name:o.z.string(),resource_server_identifier:o.z.string()}))})}}}},security:[{Bearer:["update:roles","auth:write"]}],responses:{201:{description:"Permissions assigned to role"}}}),async t=>{const{id:e}=t.req.valid("param"),{permissions:n}=t.req.valid("json"),r=t.var.tenant_id;if(!r)throw new I(400,{message:"tenant-id header is required"});if(!await t.env.data.roles.get(r,e))throw new I(404,{message:"Role not found"});const s=n.map(c=>({role_id:e,resource_server_identifier:c.resource_server_identifier,permission_name:c.permission_name}));if(!await t.env.data.rolePermissions.assign(r,e,s))throw new I(500,{message:"Failed to assign permissions to role"});return t.json({message:"Permissions assigned successfully"},{status:201})}).openapi(o.createRoute({tags:["roles"],method:"delete",path:"/{id}/permissions",request:{params:o.z.object({id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()}),body:{content:{"application/json":{schema:o.z.object({permissions:o.z.array(o.z.object({permission_name:o.z.string(),resource_server_identifier:o.z.string()}))})}}}},security:[{Bearer:["update:roles","auth:write"]}],responses:{200:{description:"Permissions removed from role"}}}),async t=>{const{id:e}=t.req.valid("param"),{permissions:n}=t.req.valid("json"),r=t.var.tenant_id;if(!r)throw new I(400,{message:"tenant-id header is required"});if(!await t.env.data.roles.get(r,e))throw new I(404,{message:"Role not found"});if(!await t.env.data.rolePermissions.remove(r,e,n))throw new I(500,{message:"Failed to remove permissions from role"});return t.json({message:"Permissions removed successfully"})}),t9=xt.extend({resource_servers:o.z.array(Cr)}),n9=new o.OpenAPIHono().openapi(o.createRoute({tags:["resource-servers"],method:"get",path:"/",request:{query:et,headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["read:resource_servers","auth:read"]}],responses:{200:{content:{"application/json":{schema:o.z.union([o.z.array(Cr),t9])}},description:"List of resource servers"}}}),async t=>{const e=t.var.tenant_id,{page:n,per_page:r,include_totals:i=!1,sort:s,q:a}=t.req.valid("query"),c=await t.env.data.resourceServers.list(e,{page:n,per_page:r,include_totals:i,sort:ut(s),q:a});return i?t.json(c):t.json(c.resource_servers)}).openapi(o.createRoute({tags:["resource-servers"],method:"get",path:"/{id}",request:{params:o.z.object({id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["read:resource_servers","auth:read"]}],responses:{200:{content:{"application/json":{schema:Cr}},description:"A resource server"}}}),async t=>{const e=t.var.tenant_id,{id:n}=t.req.valid("param"),r=await t.env.data.resourceServers.get(e,n);if(!r)throw new I(404);return t.json(r)}).openapi(o.createRoute({tags:["resource-servers"],method:"delete",path:"/{id}",request:{params:o.z.object({id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["delete:resource_servers","auth:write"]}],responses:{200:{description:"Status"}}}),async t=>{const e=t.var.tenant_id,{id:n}=t.req.valid("param"),r=await t.env.data.resourceServers.get(e,n);if(!r)throw new I(404,{message:"Resource server not found"});if(r.is_system)throw new I(403,{message:"System entities cannot be deleted"});return await t.env.data.resourceServers.remove(e,n),t.text("OK")}).openapi(o.createRoute({tags:["resource-servers"],method:"patch",path:"/{id}",request:{body:{content:{"application/json":{schema:o.z.object(Ja.shape).partial()}}},params:o.z.object({id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["update:resource_servers","auth:write"]}],responses:{200:{content:{"application/json":{schema:Cr}},description:"The updated resource server"}}}),async t=>{const e=t.var.tenant_id,{id:n}=t.req.valid("param"),r=t.req.valid("json"),i=await t.env.data.resourceServers.get(e,n);if(!i)throw new I(404,{message:"Resource server not found"});if(i.is_system)throw new I(403,{message:"System entities cannot be modified"});await t.env.data.resourceServers.update(e,n,r);const s=await t.env.data.resourceServers.get(e,n);if(!s)throw new I(404,{message:"Resource server not found"});return t.json(s)}).openapi(o.createRoute({tags:["resource-servers"],method:"post",path:"/",request:{body:{content:{"application/json":{schema:o.z.object(Ja.shape)}}},headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["create:resource_servers","auth:write"]}],responses:{201:{content:{"application/json":{schema:Cr}},description:"A resource server"}}}),async t=>{const e=t.var.tenant_id,n=t.req.valid("json"),r=await t.env.data.resourceServers.create(e,n);return t.json(r,{status:201})}),r9=o.z.object({per_page:o.z.string().min(1).optional().default("50").transform(t=>parseInt(t,10)).openapi({description:"Number of results per page. Defaults to 50."}),page:o.z.string().min(0).optional().default("0").transform(t=>parseInt(t,10)).openapi({description:"Page index of the results to return. First page is 0."}),include_totals:o.z.string().optional().default("false").transform(t=>t==="true").openapi({description:"Return results inside an object that contains the total result count (true) or as a direct array of results (false, default)."}),from:o.z.string().optional().openapi({description:"Optional Id from which to start selection."}),take:o.z.string().min(1).optional().transform(t=>t?parseInt(t,10):void 0).openapi({description:"Number of results per page. Defaults to 50."}),audience:o.z.string().optional().openapi({description:"Optional filter on audience."}),client_id:o.z.string().optional().openapi({description:"Optional filter on client_id."}),allow_any_organization:o.z.string().optional().transform(t=>t==="true"?!0:t==="false"?!1:void 0).openapi({description:"Optional filter on allow_any_organization."}),subject_type:o.z.enum(["client","user"]).optional().openapi({description:"EA The type of application access the client grant allows. Use of this field is subject to the applicable Free Trial terms in Okta's Master Subscription Agreement."})}),i9=xt.extend({client_grants:o.z.array(Er)}),o9=new o.OpenAPIHono().openapi(o.createRoute({tags:["client-grants"],method:"get",path:"/",request:{query:r9,headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["read:client_grants","auth:read"]}],responses:{200:{content:{"application/json":{schema:o.z.union([o.z.array(Er),i9])}},description:"List of client grants"}}}),async t=>{const e=t.var.tenant_id,{page:n,per_page:r,include_totals:i=!1,from:s,take:a,audience:c,client_id:l,allow_any_organization:u,subject_type:d}=t.req.valid("query"),f=[];l&&f.push(`client_id:"${l}"`),c&&f.push(`audience:"${c}"`),u!==void 0&&f.push(`allow_any_organization:${u}`),d&&f.push(`subject_type:"${d}"`),s&&f.push(`id:>${s}`);const p=f.length>0?f.join(" AND "):void 0,h=a??r,m=await t.env.data.clientGrants.list(e,{page:n,per_page:h,include_totals:i,q:p});return i?t.json(m):t.json(m.client_grants)}).openapi(o.createRoute({tags:["client-grants"],method:"get",path:"/{id}",request:{params:o.z.object({id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["read:client_grants","auth:read"]}],responses:{200:{content:{"application/json":{schema:Er}},description:"A client grant"}}}),async t=>{const e=t.var.tenant_id,{id:n}=t.req.valid("param"),r=await t.env.data.clientGrants.get(e,n);if(!r)throw new I(404,{message:"Client grant not found"});return t.json(r)}).openapi(o.createRoute({tags:["client-grants"],method:"delete",path:"/{id}",request:{params:o.z.object({id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["delete:client_grants","auth:write"]}],responses:{200:{description:"Status"}}}),async t=>{const e=t.var.tenant_id,{id:n}=t.req.valid("param");if(!await t.env.data.clientGrants.remove(e,n))throw new I(404,{message:"Client grant not found"});return t.text("OK")}).openapi(o.createRoute({tags:["client-grants"],method:"patch",path:"/{id}",request:{params:o.z.object({id:o.z.string()}),body:{content:{"application/json":{schema:o.z.object(Ha.shape).partial()}}},headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["update:client_grants","auth:write"]}],responses:{200:{content:{"application/json":{schema:Er}},description:"The updated client grant"}}}),async t=>{const e=t.var.tenant_id,{id:n}=t.req.valid("param"),r=t.req.valid("json");if(!await t.env.data.clientGrants.get(e,n))throw new I(404,{message:"Client grant not found"});if(!await t.env.data.clientGrants.update(e,n,r))throw new I(500,{message:"Failed to update client grant"});const a=await t.env.data.clientGrants.get(e,n);if(!a)throw new I(404,{message:"Client grant not found"});return t.json(a)}).openapi(o.createRoute({tags:["client-grants"],method:"post",path:"/",request:{body:{content:{"application/json":{schema:o.z.object(Ha.shape)}}},headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["create:client_grants","auth:write"]}],responses:{201:{content:{"application/json":{schema:Er}},description:"A client grant"}}}),async t=>{const e=t.var.tenant_id,n=t.req.valid("json"),r=await t.env.data.clientGrants.create(e,n);return t.json(r,{status:201})}),s9=o.z.object({page:o.z.string().optional().default("0").transform(t=>parseInt(t,10)).openapi({description:"Page index of the results to return. First page is 0."}),per_page:o.z.string().optional().default("50").transform(t=>parseInt(t,10)).openapi({description:"Number of results per page. Defaults to 50."}),include_totals:o.z.string().optional().default("false").transform(t=>t==="true").openapi({description:"When true, return results inside an object that also contains the start and limit. When false (default), a direct array of results is returned."}),fields:o.z.string().optional().openapi({description:"Comma-separated list of fields to include or exclude (based on value provided for include_fields) in the result. Leave empty to retrieve all fields."}),include_fields:o.z.string().optional().default("true").transform(t=>t==="true").openapi({description:"Whether specified fields are to be included (true) or excluded (false). Defaults to true."}),sort:o.z.string().optional().default("created_at:-1").openapi({description:"Field to sort by. Use field:order where order is 1 for ascending and -1 for descending. Defaults to created_at:-1."})}),a9=o.z.object({invitations:o.z.array(qo),start:o.z.number(),limit:o.z.number(),length:o.z.number()}),c9=$0.omit({organization_id:!0,invitation_url:!0}),l9=xt.extend({organizations:o.z.array(er)}),If=o.z.object({user_id:o.z.string().openapi({description:"ID of this user"}),email:o.z.string().email().optional().openapi({description:"Email address of this user",format:"email"}),roles:o.z.array(o.z.object({})).default([]).openapi({description:"Array of roles assigned to this user in the organization"})}),u9=o.z.object({start:o.z.number().openapi({description:"Start index of the current page"}),limit:o.z.number().openapi({description:"Number of items per page"}),total:o.z.number().openapi({description:"Total number of members"}),members:o.z.array(If).openapi({description:"Array of organization members"})}),d9=o.z.object({next:o.z.string().optional().openapi({description:"Checkpoint ID to be used to retrieve the next set of results"}),members:o.z.array(If).openapi({description:"Array of organization members"})}),p9=o.z.object({members:o.z.array(o.z.string()).openapi({description:"Array of user IDs to add to the organization"})}),f9=o.z.object({members:o.z.array(o.z.string()).openapi({description:"Array of user IDs to remove from the organization"})}),h9=new o.OpenAPIHono().openapi(o.createRoute({tags:["organizations"],method:"get",path:"/",request:{query:et,headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["read:organizations","auth:read"]}],responses:{200:{content:{"application/json":{schema:o.z.union([l9,o.z.array(er)])}},description:"List of organizations"}}}),async t=>{const e=t.var.tenant_id,{page:n,per_page:r,include_totals:i,sort:s,q:a}=t.req.valid("query"),c=await t.env.data.organizations.list(e,{page:n,per_page:r,include_totals:i,sort:ut(s),q:a});return i?t.json(c):t.json(c.organizations)}).openapi(o.createRoute({tags:["organizations"],method:"get",path:"/{id}",request:{params:o.z.object({id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["read:organizations","auth:read"]}],responses:{200:{content:{"application/json":{schema:er}},description:"An organization"}}}),async t=>{const e=t.var.tenant_id,{id:n}=t.req.valid("param"),r=await t.env.data.organizations.get(e,n);if(!r)throw new I(404,{message:"Organization not found"});return t.json(r)}).openapi(o.createRoute({tags:["organizations"],method:"delete",path:"/{id}",request:{params:o.z.object({id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["delete:organizations","auth:write"]}],responses:{200:{description:"Organization deleted successfully"}}}),async t=>{const e=t.var.tenant_id,{id:n}=t.req.valid("param");if(!await t.env.data.organizations.remove(e,n))throw new I(404,{message:"Organization not found"});return t.text("OK")}).openapi(o.createRoute({tags:["organizations"],method:"patch",path:"/{id}",request:{body:{content:{"application/json":{schema:Ya.partial()}}},params:o.z.object({id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["update:organizations","auth:write"]}],responses:{200:{content:{"application/json":{schema:er}},description:"The updated organization"}}}),async t=>{const e=t.var.tenant_id,{id:n}=t.req.valid("param"),r=t.req.valid("json");if(!await t.env.data.organizations.update(e,n,r))throw new I(404,{message:"Organization not found"});const s=await t.env.data.organizations.get(e,n);if(!s)throw new I(404,{message:"Organization not found"});return t.json(s)}).openapi(o.createRoute({tags:["organizations"],method:"post",path:"/",request:{body:{content:{"application/json":{schema:Ya}}},headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["create:organizations","auth:write"]}],responses:{201:{content:{"application/json":{schema:er}},description:"The created organization"}}}),async t=>{const e=t.var.tenant_id,n=t.req.valid("json"),r={...n,id:n.id||Qk()},i=await t.env.data.organizations.create(e,r);return t.json(i,{status:201})}).openapi(o.createRoute({tags:["organizations"],method:"get",path:"/{id}/members",request:{params:o.z.object({id:o.z.string()}),query:et,headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["read:organizations","auth:read"]}],responses:{200:{content:{"application/json":{schema:o.z.union([o.z.array(If),u9,d9])}},description:"List of organization members"}}}),async t=>{const e=t.var.tenant_id,{id:n}=t.req.valid("param"),{page:r,per_page:i,include_totals:s,sort:a}=t.req.valid("query");if(!await t.env.data.organizations.get(e,n))throw new I(404,{message:"Organization not found"});const l=await t.env.data.userOrganizations.list(e,{page:r,per_page:i,include_totals:s,sort:ut(a),q:`organization_id:${n}`}),u=[];for(const d of l.userOrganizations){const f=await t.env.data.users.get(e,d.user_id);f&&u.push({user_id:f.user_id,email:f.email||void 0,roles:[]})}return s?t.json({start:l.start,limit:l.limit,total:l.length,members:u}):t.json(u)}).openapi(o.createRoute({tags:["organizations"],method:"post",path:"/{id}/members",request:{params:o.z.object({id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()}),body:{content:{"application/json":{schema:p9}}}},security:[{Bearer:["update:organizations","auth:write"]}],responses:{204:{description:"Members added successfully"}}}),async t=>{const e=t.var.tenant_id,{id:n}=t.req.valid("param"),{members:r}=t.req.valid("json");if(!await t.env.data.organizations.get(e,n))throw new I(404,{message:"Organization not found"});for(const s of r)(await t.env.data.userOrganizations.list(e,{q:`user_id:${s}`,per_page:1})).userOrganizations.some(l=>l.organization_id===n)||await t.env.data.userOrganizations.create(e,{user_id:s,organization_id:n});return new Response(null,{status:204})}).openapi(o.createRoute({tags:["organizations"],method:"delete",path:"/{id}/members",request:{params:o.z.object({id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()}),body:{content:{"application/json":{schema:f9}}}},security:[{Bearer:["update:organizations","auth:write"]}],responses:{200:{description:"Members removed successfully"}}}),async t=>{const e=t.var.tenant_id,{id:n}=t.req.valid("param"),{members:r}=t.req.valid("json");for(const i of r){const a=(await t.env.data.userOrganizations.list(e,{q:`user_id:${i}`,per_page:100})).userOrganizations.find(c=>c.organization_id===n);a&&await t.env.data.userOrganizations.remove(e,a.id)}return t.json({message:"Members removed successfully"})}).openapi(o.createRoute({tags:["organizations"],method:"get",path:"/{id}/members/{user_id}/roles",request:{params:o.z.object({id:o.z.string(),user_id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()}),query:et},security:[{Bearer:["read:organizations","auth:read"]}],responses:{200:{content:{"application/json":{schema:Za}},description:"User roles in organization"}}}),async t=>{const e=t.var.tenant_id,{id:n,user_id:r}=t.req.valid("param");if(!await t.env.data.organizations.get(e,n))throw new I(404,{message:"Organization not found"});if(!await t.env.data.users.get(e,r))throw new I(404,{message:"User not found"});const a=await t.env.data.userRoles.list(e,r,void 0,n);return t.json(a)}).openapi(o.createRoute({tags:["organizations"],method:"post",path:"/{id}/members/{user_id}/roles",request:{params:o.z.object({id:o.z.string(),user_id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()}),body:{content:{"application/json":{schema:o.z.object({roles:o.z.array(o.z.string()).openapi({description:"List of role IDs to associate with the user"})})}}}},security:[{Bearer:["update:organizations","auth:write"]}],responses:{201:{description:"Roles assigned successfully"}}}),async t=>{const e=t.var.tenant_id,{id:n,user_id:r}=t.req.valid("param"),{roles:i}=t.req.valid("json");if(!await t.env.data.organizations.get(e,n))throw new I(404,{message:"Organization not found"});if(!await t.env.data.users.get(e,r))throw new I(404,{message:"User not found"});for(const c of i){if(!await t.env.data.roles.get(e,c))throw new I(400,{message:`Role ${c} not found`});if(!await t.env.data.userRoles.create(e,r,c,n))throw new I(500,{message:`Failed to assign role ${c} to user`})}return t.json({message:"Roles assigned successfully"},{status:201})}).openapi(o.createRoute({tags:["organizations"],method:"delete",path:"/{id}/members/{user_id}/roles",request:{params:o.z.object({id:o.z.string(),user_id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()}),body:{content:{"application/json":{schema:o.z.object({roles:o.z.array(o.z.string()).openapi({description:"List of role IDs to remove from the user"})})}}}},security:[{Bearer:["update:organizations","auth:write"]}],responses:{200:{description:"Roles removed successfully"}}}),async t=>{const e=t.var.tenant_id,{id:n,user_id:r}=t.req.valid("param"),{roles:i}=t.req.valid("json");if(!await t.env.data.organizations.get(e,n))throw new I(404,{message:"Organization not found"});if(!await t.env.data.users.get(e,r))throw new I(404,{message:"User not found"});for(const c of i)if(!await t.env.data.userRoles.remove(e,r,c,n))throw new I(500,{message:`Failed to remove role ${c} from user`});return t.json({message:"Roles removed successfully"})}).openapi(o.createRoute({tags:["organizations"],method:"get",path:"/{id}/roles",request:{params:o.z.object({id:o.z.string()}),headers:o.z.object({"tenant-id":o.z.string().optional()}),query:et},security:[{Bearer:["read:organizations","auth:read"]}],responses:{200:{content:{"application/json":{schema:Za}},description:"List of roles available in organization"}}}),async t=>{const e=t.var.tenant_id,{id:n}=t.req.valid("param"),{page:r,per_page:i,sort:s,q:a}=t.req.valid("query");if(!await t.env.data.organizations.get(e,n))throw new I(404,{message:"Organization not found"});const l=await t.env.data.roles.list(e,{page:r,per_page:i,sort:ut(s),q:a});return t.json(l.roles)}).openapi(o.createRoute({tags:["organizations"],method:"get",path:"/{id}/invitations",request:{params:o.z.object({id:o.z.string().openapi({description:"Organization ID",param:{name:"id",in:"path"}})}),query:s9,headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["read:organizations","auth:read"]}],responses:{200:{content:{"application/json":{schema:o.z.union([o.z.array(qo),a9])}},description:"List of organization invitations"}}}),async t=>{const e=t.var.tenant_id,{id:n}=t.req.valid("param"),{page:r,per_page:i,include_totals:s,fields:a,include_fields:c,sort:l}=t.req.valid("query");if(!await t.env.data.organizations.get(e,n))throw new I(404,{message:"Organization not found"});let f=(await t.env.data.invites.list(e,{page:r,per_page:i})).invites.filter(p=>p.organization_id===n);if(l){const p=ut(l);if(p){const{sort_by:h,sort_order:m}=p;f.sort((y,w)=>{const _=y[h],k=w[h];if(_===void 0||k===void 0||_===k)return 0;const v=_<k?-1:1;return m==="asc"?v:-v})}}if(a){const p=a.split(",").map(h=>h.trim());f=f.map(h=>{const m={};for(const y of Object.keys(h))(c?p.includes(y):!p.includes(y))&&(m[y]=h[y]);return m})}return s?t.json({invitations:f,start:r*i,limit:i,length:f.length}):t.json(f)}).openapi(o.createRoute({tags:["organizations"],method:"get",path:"/{id}/invitations/{invitation_id}",request:{params:o.z.object({id:o.z.string().openapi({description:"Organization ID",param:{name:"id",in:"path"}}),invitation_id:o.z.string().openapi({description:"Invitation ID",param:{name:"invitation_id",in:"path"}})}),headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["read:organizations","auth:read"]}],responses:{200:{content:{"application/json":{schema:qo}},description:"An invitation"},404:{description:"Invitation not found"}}}),async t=>{const e=t.var.tenant_id,{id:n,invitation_id:r}=t.req.valid("param"),i=await t.env.data.invites.get(e,r);if(!i||i.organization_id!==n)throw new I(404,{message:"Invitation not found"});return t.json(i)}).openapi(o.createRoute({tags:["organizations"],method:"post",path:"/{id}/invitations",request:{params:o.z.object({id:o.z.string().openapi({description:"Organization ID",param:{name:"id",in:"path"}})}),body:{content:{"application/json":{schema:c9}}},headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["update:organizations","auth:write"]}],responses:{201:{content:{"application/json":{schema:qo}},description:"The created invitation"}}}),async t=>{const e=t.var.tenant_id,{id:n}=t.req.valid("param"),r=t.req.valid("json");if(!await t.env.data.organizations.get(e,n))throw new I(404,{message:"Organization not found"});const a=`https://invite.placeholder/${n$()}`,c={...r,organization_id:n,invitation_url:a},l=await t.env.data.invites.create(e,c);return t.json(l,{status:201})}).openapi(o.createRoute({tags:["organizations"],method:"delete",path:"/{id}/invitations/{invitation_id}",request:{params:o.z.object({id:o.z.string().openapi({description:"Organization ID",param:{name:"id",in:"path"}}),invitation_id:o.z.string().openapi({description:"Invitation ID",param:{name:"invitation_id",in:"path"}})}),headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["update:organizations","auth:write"]}],responses:{204:{description:"Invitation deleted successfully"},404:{description:"Invitation not found"}}}),async t=>{const e=t.var.tenant_id,{id:n,invitation_id:r}=t.req.valid("param"),i=await t.env.data.invites.get(e,r);if(!i||i.organization_id!==n)throw new I(404,{message:"Invitation not found"});if(!await t.env.data.invites.remove(e,r))throw new I(404,{message:"Invitation not found"});return t.body(null,{status:204})}),g9=new o.OpenAPIHono().openapi(o.createRoute({tags:["stats"],method:"get",path:"/daily",request:{query:o.z.object({from:o.z.string().optional().openapi({description:"Optional first day of the date range (inclusive) in YYYYMMDD format",example:"20251120"}),to:o.z.string().optional().openapi({description:"Optional last day of the date range (inclusive) in YYYYMMDD format",example:"20251219"})}),headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["read:stats","auth:read"]}],responses:{200:{content:{"application/json":{schema:o.z.array(rb)}},description:"Daily statistics including logins, signups, and leaked passwords"}}}),async t=>{const{from:e,to:n}=t.req.valid("query");if(!t.env.data.stats)throw new I(501,{message:"Stats adapter not configured"});const r=await t.env.data.stats.getDaily(t.var.tenant_id,{from:e,to:n});return t.json(r)}).openapi(o.createRoute({tags:["stats"],method:"get",path:"/active-users",request:{headers:o.z.object({"tenant-id":o.z.string().optional()})},security:[{Bearer:["read:stats","auth:read"]}],responses:{200:{content:{"application/json":{schema:o.z.number().openapi({description:"Number of active users in the last 30 days",example:1234})}},description:"Number of active users in the last 30 days"}}}),async t=>{if(!t.env.data.stats)throw new I(501,{message:"Stats adapter not configured"});const e=await t.env.data.stats.getActiveUsers(t.var.tenant_id);return t.json(e)});function m9(t){const e=new o.OpenAPIHono;e.use(V1({origin:r=>r&&t.allowedOrigins?.includes(r)?r:"",allowHeaders:["Tenant-Id","Content-Type","Content-Range","Auth0-Client","Authorization","Range","Upgrade-Insecure-Requests"],allowMethods:["POST","PUT","GET","DELETE","PATCH","OPTIONS"],exposeHeaders:["Content-Length","Content-Range"],maxAge:600,credentials:!0})),Nf(e),e.use(async(r,i)=>{const s=zs(r,t.dataAdapter),a=Xs({defaultTtlSeconds:0,maxEntries:100,cleanupIntervalMs:0}),c=Yl(s,{defaultTtl:0,cacheEntities:["tenants","connections","clients","legacyClients","branding","themes","promptSettings","forms"],cache:a});return r.env.data=Zl(r,c),r.env.entityHooks=t.entityHooks,i()}),e.use(Js).use(Ws).use(Xl(e)).use(async(r,i)=>(t.entityHooks&&r.var.tenant_id&&(r.env.data=Ww(r.env.data,{tenantId:r.var.tenant_id,entityHooks:t.entityHooks})),i()));const n=e.route("/branding",R4).route("/custom-domains",q$).route("/email/providers",D$).route("/users",q8).route("/keys",Fk).route("/users-by-email",Hk).route("/clients",Gk).route("/client-grants",o9).route("/tenants",Wk).route("/logs",Xk).route("/hooks",i$).route("/connections",c$).route("/prompts",l$).route("/sessions",U$).route("/refresh_tokens",M$).route("/forms",X$).route("/flows",Y$).route("/roles",e9).route("/resource-servers",n9).route("/organizations",h9).route("/stats",g9);if(t.managementApiExtensions)for(const r of t.managementApiExtensions)n.route(r.path,r.router);return n.doc("/spec",{openapi:"3.0.0",info:{version:"1.0.0",title:"Management API"},servers:[{url:"/api/v2",description:"API V2"}],security:[{oauth2:["openid","email","profile"]}]}),n}function _9(t,e){Object.keys(e).forEach(n=>{const r=e[n];r!=null&&r.length&&t.searchParams.set(n,r)})}function Hn(t){if(t)return`${t.name}/${t.version}${t.env?.node?` (env: node/${t.env.node})`:""}`}async function uo(t,e){const n=await t.data.legacyClients.get(e);if(!n)throw new X(403,{message:"Client not found"});let r=n;if(t.DEFAULT_CLIENT_ID||t.DEFAULT_TENANT_ID){const i=t.DEFAULT_CLIENT_ID?await t.data.legacyClients.get(t.DEFAULT_CLIENT_ID):void 0,s=await t.data.connections.list(n.tenant.id),a=t.DEFAULT_TENANT_ID?await t.data.connections.list(t.DEFAULT_TENANT_ID):{connections:[]},c=s.connections.map(l=>{const u=a.connections?.find(f=>f.name===l.name);if(!u?.options)return l;const d=Ot.parse({...u||{},...l});return d.options=Si.parse({...u.options||{},...l.options}),d}).filter(l=>l);r={...n,web_origins:[...i?.web_origins||[],...n.web_origins||[]],allowed_logout_urls:[...i?.allowed_logout_urls||[],...n.allowed_logout_urls||[]],callbacks:[...i?.callbacks||[],...n.callbacks||[]],connections:c,tenant:{...i?.tenant||{},...n.tenant}}}return{...r,web_origins:[...r.web_origins||[],`${it(t)}login`],allowed_logout_urls:[...r.allowed_logout_urls||[],t.ISSUER],callbacks:[...r.callbacks||[],`${it(t)}info`]}}async function jm(t,e,n,r){if(!r.state)throw new X(400,{message:"State not found"});const i=e.connections.find(l=>l.name===n);if(!i)throw t.set("client_id",e.client_id),await ye(t,e.tenant.id,{type:ge.FAILED_LOGIN,description:"Connection not found"}),new X(403,{message:"Connection Not Found"});let s=await t.env.data.loginSessions.get(e.tenant.id,r.state);if(!s){const l=t.get("ip"),u=t.get("useragent"),d=t.get("auth0_client");s=await t.env.data.loginSessions.create(e.tenant.id,{expires_at:new Date(Date.now()+Lr*1e3).toISOString(),authParams:r,csrf_token:je(),ip:l,useragent:u,auth0Client:Hn(d)})}const c=await Jb(t,i.strategy).getRedirect(t,i);return await t.env.data.codes.create(e.tenant.id,{login_id:s.id,code_id:c.code,code_type:"oauth2_state",connection_id:i.id,code_verifier:c.codeVerifier,expires_at:new Date(Date.now()+m6*1e3).toISOString()}),new Response(null,{status:302,headers:{location:c.redirectUrl}})}async function Tm(t,{code:e,state:n}){const{env:r}=t,i=await r.data.codes.get(t.var.tenant_id||"",n,"oauth2_state");if(!i||!i.connection_id)throw new X(403,{message:"State not found"});const s=await r.data.loginSessions.get(t.var.tenant_id||"",i.login_id);if(!s)throw new X(403,{message:"Session not found"});if(s.authorization_url){const m=new URL(s.authorization_url).hostname,y=t.var.host||"";if(m!==y&&m){const w=new URL(`https://${m}/callback`);return w.searchParams.set("state",n),w.searchParams.set("code",e),new Response("Redirecting",{status:307,headers:{location:w.toString()}})}}const a=await uo(r,s.authParams.client_id);t.set("client_id",a.client_id),t.set("tenant_id",a.tenant.id);const c=a.connections.find(m=>m.id===i.connection_id);if(!c)throw await ye(t,a.tenant.id,{type:ge.FAILED_LOGIN,description:"Connection not found"}),new X(403,{message:"Connection not found"});if(t.set("connection",c.name),!s.authParams.redirect_uri)throw await ye(t,a.tenant.id,{type:ge.FAILED_LOGIN,description:"Redirect URI not defined"}),new X(403,{message:"Redirect URI not defined"});const u=await Jb(t,c.strategy).validateAuthorizationCodeAndGetUser(t,c,e,i.code_verifier),{sub:d,...f}=u;t.set("user_id",d);const p=u.email?.toLocaleLowerCase()||`${c.name}.${d}@${new URL(t.env.ISSUER).hostname}`;t.set("username",p);const h=await nl(t,{client:a,username:p,provider:c.strategy,connection:c.name,userId:d,profileData:f,isSocial:!0,ip:t.var.ip});return sn(t,{client:a,authParams:s.authParams,loginSession:s,user:h,authStrategy:{strategy:c.strategy,strategy_type:"social"}})}async function ua(t,e,n,r,i,s){const a=await t.env.data.codes.get(t.var.tenant_id||"",e,"oauth2_state");if(!a)throw new I(400,{message:"State not found"});const c=await t.env.data.loginSessions.get(t.var.tenant_id,a.login_id);if(!c)throw new I(400,{message:"Login not found"});const{redirect_uri:l}=c.authParams;if(!l)throw new I(400,{message:"Redirect uri not found"});ye(t,t.var.tenant_id,{type:ge.FAILED_LOGIN,description:`Failed connection login: ${i} ${n}, ${r}`});const u=new URL(l);return _9(u,{error:n,error_description:r,error_reason:s,error_code:i,state:c.authParams.state}),t.redirect(`${it(t.env)}login/identifier?state=${c.id}&error=${n}`)}const y9=new o.OpenAPIHono().openapi(o.createRoute({tags:["oauth2"],method:"get",path:"/",request:{query:o.z.object({state:o.z.string(),code:o.z.string().optional(),scope:o.z.string().optional(),hd:o.z.string().optional(),error:o.z.string().optional(),error_description:o.z.string().optional(),error_code:o.z.string().optional(),error_reason:o.z.string().optional()})},responses:{302:{description:"Redirect to the client's redirect uri"},400:{description:"Bad Request",content:{"application/json":{schema:o.z.object({message:o.z.string()})}}},500:{description:"Internal Server Error",content:{"application/json":{schema:o.z.object({message:o.z.string()})}}}}}),async t=>{const{state:e,code:n,error:r,error_description:i,error_code:s,error_reason:a}=t.req.valid("query");if(r)return ua(t,e,r,i,s,a);if(!n)throw new I(400,{message:"Code is required"});try{const c=await Tm(t,{code:n,state:e});if(!(c instanceof Response))throw new I(500,{message:"Internal server error"});return c}catch(c){if(c instanceof X&&c.status===400){const l=await t.env.data.codes.get(t.var.tenant_id||"",e,"oauth2_state");if(l&&await t.env.data.loginSessions.get(t.var.tenant_id,l.login_id)){let d="access_denied";try{d=JSON.parse(c.message).message||d}catch{d=c.message||d}return ua(t,e,"access_denied",d)}}throw c}}).openapi(o.createRoute({tags:["oauth2"],method:"post",path:"/",request:{body:{content:{"application/x-www-form-urlencoded":{schema:o.z.object({state:o.z.string(),code:o.z.string().optional(),scope:o.z.string().optional(),hd:o.z.string().optional(),error:o.z.string().optional(),error_description:o.z.string().optional(),error_code:o.z.string().optional(),error_reason:o.z.string().optional()})}}}},responses:{302:{description:"Redirect to the client's redirect uri"},400:{description:"Bad Request",content:{"application/json":{schema:o.z.object({message:o.z.string()})}}},500:{description:"Internal Server Error",content:{"application/json":{schema:o.z.object({message:o.z.string()})}}}}}),async t=>{const{state:e,code:n,error:r,error_description:i,error_code:s,error_reason:a}=t.req.valid("form");if(r)return ua(t,e,r,i,s,a);if(!n)throw new I(400,{message:"Code is required"});try{const c=await Tm(t,{code:n,state:e});if(!(c instanceof Response))throw new I(500,{message:"Internal server error"});return c}catch(c){if(c instanceof X&&c.status===400){const l=await t.env.data.codes.get(t.var.tenant_id||"",e,"oauth2_state");if(l&&await t.env.data.loginSessions.get(t.var.tenant_id,l.login_id)){let d="access_denied";try{d=JSON.parse(c.message).message||d}catch{d=c.message||d}return ua(t,e,"access_denied",d)}}throw c}});function jf(t,e=[],n={}){try{const r=new URL(t);return e.some(i=>{try{return b9(r,new URL(i),n)}catch{return!1}})}catch{return!1}}function b9(t,e,n={}){if(t.protocol!==e.protocol)return!1;if(n.allowPathWildcards&&e.pathname.includes("*")){const r=e.pathname.replace(/\*/g,".*").replace(/\//g,"\\/");if(!new RegExp(`^${r}$`).test(t.pathname))return!1}else if(t.pathname!==e.pathname)return!1;if(n.allowSubDomainWildcards&&e.hostname.startsWith("*.")&&e.hostname.split(".").length>2&&["http:","https:"].includes(e.protocol)){const r=e.hostname.split(".").slice(1).join(".");return t.hostname===r||t.hostname.endsWith("."+r)}return t.hostname===e.hostname}const w9=new o.OpenAPIHono().openapi(o.createRoute({tags:["oauth2"],method:"get",path:"/",request:{query:o.z.object({client_id:o.z.string(),returnTo:o.z.string().optional()}),header:o.z.object({cookie:o.z.string().optional()})},responses:{302:{description:"Log the user out"}}}),async t=>{const{client_id:e,returnTo:n}=t.req.valid("query"),r=await t.env.data.legacyClients.get(e);if(!r)return t.text("OK");const i=await t.env.data.legacyClients.get("DEFAULT_CLIENT");t.set("client_id",e),t.set("tenant_id",r.tenant.id);const s=n||t.req.header("referer");if(!s)return t.text("OK");if(!jf(s,[...r.allowed_logout_urls||[],...i?.allowed_logout_urls||[]],{allowPathWildcards:!0,allowSubDomainWildcards:!0}))throw new I(400,{message:"Invalid redirect uri"});const a=t.req.header("cookie");if(a){const c=Ti(r.tenant.id,a);if(c){const l=await t.env.data.sessions.get(r.tenant.id,c);if(l){const u=await t.env.data.users.get(r.tenant.id,l.user_id);u&&(t.set("user_id",u.user_id),t.set("connection",u.connection));const d=await t.env.data.refreshTokens.list(r.tenant.id,{q:`session_id=${c}`,page:0,per_page:100,include_totals:!1});await Promise.all(d.refresh_tokens.map(f=>t.env.data.refreshTokens.remove(r.tenant.id,f.id))),await t.env.data.sessions.update(r.tenant.id,c,{revoked_at:new Date().toISOString()})}}}return ye(t,r.tenant.id,{type:ge.SUCCESS_LOGOUT,description:"User successfully logged out"}),new Response("Redirecting",{status:302,headers:{"set-cookie":wb(r.tenant.id,t.req.header("host")),location:s}})}),Om=o.z.object({sub:o.z.string(),email:o.z.string().optional(),family_name:o.z.string().optional(),given_name:o.z.string().optional(),email_verified:o.z.boolean()}),v9=new o.OpenAPIHono().openapi(o.createRoute({tags:["oauth2"],method:"get",path:"/",request:{},security:[{Bearer:["openid"]}],responses:{200:{content:{"application/json":{schema:Om}},description:"Userinfo"}}}),async t=>{if(!t.var.user)throw new I(404,{message:"User not found"});const e=await t.env.data.users.get(t.var.user.tenant_id,t.var.user.sub);if(!e)throw new I(404,{message:"User not found"});return t.json(Om.parse({...e,sub:e.user_id}))}),x9=new o.OpenAPIHono().openapi(o.createRoute({tags:["well known"],method:"get",path:"/jwks.json",request:{},responses:{200:{content:{"application/json":{schema:Ey}},description:"List of tenants"}}}),async t=>{const e=await e0(t.env.data);return t.json({keys:e},{headers:{"access-control-allow-origin":"*","access-control-allow-method":"GET","cache-control":`public, max-age=${ia}, stale-while-revalidate=${ia*2}, stale-if-error=86400`}})}).openapi(o.createRoute({tags:["well known"],method:"get",path:"/openid-configuration",request:{},responses:{200:{content:{"application/json":{schema:zd}},description:"List of tenants"}}}),async t=>{const e=zd.parse({issuer:il(t.env),authorization_endpoint:`${Oe(t.env)}authorize`,token_endpoint:`${Oe(t.env)}oauth/token`,device_authorization_endpoint:`${Oe(t.env)}oauth/device/code`,userinfo_endpoint:`${Oe(t.env)}userinfo`,mfa_challenge_endpoint:`${Oe(t.env)}mfa/challenge`,jwks_uri:`${Oe(t.env)}.well-known/jwks.json`,registration_endpoint:`${Oe(t.env)}oidc/register`,revocation_endpoint:`${Oe(t.env)}oauth/revoke`,scopes_supported:["openid","profile","offline_access","name","given_name","family_name","nickname","email","email_verified","picture","created_at","identities","phone","address"],response_types_supported:["code","token","id_token","code token","code id_token","token id_token","code token id_token"],code_challenge_methods_supported:["S256","plain"],response_modes_supported:["query","fragment","form_post"],subject_types_supported:["public"],id_token_signing_alg_values_supported:["RS256"],token_endpoint_auth_methods_supported:["client_secret_basic","client_secret_post"],claims_supported:["aud","auth_time","created_at","email","email_verified","exp","family_name","given_name","iat","identities","iss","name","nickname","phone_number","picture","sub"],request_uri_parameter_supported:!1,request_parameter_supported:!1,token_endpoint_auth_signing_alg_values_supported:["RS256","RS384","PS256"]});return t.json(e,{headers:{"access-control-allow-origin":"*","access-control-allow-method":"GET","cache-control":`public, max-age=${ia}, stale-while-revalidate=${ia*2}, stale-if-error=86400`}})});function Xo(t,e){if(!t||!e||t.length!==e.length)return!1;let n=0;for(let r=0;r<t.length;r++)n|=t.charCodeAt(r)^e.charCodeAt(r);return n===0}const Jw=o.z.object({grant_type:o.z.literal("client_credentials"),scope:o.z.string().optional(),client_secret:o.z.string(),client_id:o.z.string(),audience:o.z.string().optional(),organization:o.z.string().optional()});async function k9(t,e){const n=await t.env.data.legacyClients.get(e.client_id);if(!n)throw new X(403,{message:"Invalid client credentials"});if(n.client_secret&&!Xo(n.client_secret,e.client_secret))throw new X(403,{message:"Invalid client credentials"});let r;if(e.organization){const s=await t.env.data.organizations.get(n.tenant.id,e.organization);if(!s)throw new X(400,{error:"invalid_request",error_description:`Organization '${e.organization}' not found`});r={id:s.id,name:s.name}}const i={client_id:n.client_id,scope:e.scope,audience:e.audience||n.tenant.default_audience,organization:e.organization};return{client:n,authParams:i,organization:r}}const $9=o.z.object({grant_type:o.z.literal("authorization_code"),client_id:o.z.string(),code:o.z.string(),redirect_uri:o.z.string().optional(),client_secret:o.z.string().optional(),code_verifier:o.z.string().optional(),organization:o.z.string().optional()}).refine(t=>"client_secret"in t&&!("code_verifier"in t)||!("client_secret"in t)&&"code_verifier"in t,{message:"Must provide either client_secret (standard flow) or code_verifier/code_verifier_mode (PKCE flow), but not both"});async function S9(t,e){const n=await t.env.data.legacyClients.get(e.client_id);if(!n)throw new X(403,{message:"Client not found"});const r=await t.env.data.codes.get(n.tenant.id,e.code,"authorization_code");if(!r||!r.user_id)throw ye(t,n.tenant.id,{type:ge.FAILED_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN,description:"Invalid client credentials"}),new X(403,{message:"Invalid client credentials"});if(new Date(r.expires_at)<new Date)throw ye(t,n.tenant.id,{type:ge.FAILED_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN,description:"Code expired",userId:r.user_id}),new X(403,{message:"Code expired"});if(r.used_at)throw ye(t,n.tenant.id,{type:ge.FAILED_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN,description:"Invalid authorization code",userId:r.user_id}),new X(403,{error:"invalid_grant",error_description:"Invalid authorization code"});const i=await t.env.data.loginSessions.get(n.tenant.id,r.login_id);if(!i)throw new X(403,{message:"Invalid login"});if(e.organization&&i.authParams.organization&&e.organization!==i.authParams.organization)throw new X(400,{error:"invalid_request",error_description:"Organization parameter does not match login session organization"});if("client_secret"in e){const l=await t.env.data.legacyClients.get("DEFAULT_CLIENT");if(!Xo(n.client_secret,e.client_secret)&&!Xo(l?.client_secret,e.client_secret))throw ye(t,n.tenant.id,{type:ge.FAILED_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN,description:"Invalid client credentials",userId:r.user_id}),new X(403,{message:"Invalid client credentials"})}else if(r.code_challenge&&r.code_challenge_method&&e.code_verifier){const l=await f6(e.code_verifier,r.code_challenge_method);if(!Xo(l,r.code_challenge))throw ye(t,n.tenant.id,{type:ge.FAILED_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN,description:"Invalid client credentials",userId:r.user_id}),new X(403,{message:"Invalid client credentials"})}if(r.redirect_uri&&r.redirect_uri!==e.redirect_uri)throw ye(t,n.tenant.id,{type:ge.FAILED_EXCHANGE_AUTHORIZATION_CODE_FOR_ACCESS_TOKEN,description:"Invalid redirect uri",userId:r.user_id}),new X(403,{message:"Invalid redirect uri"});const s=await t.env.data.users.get(n.tenant.id,r.user_id);if(!s)throw new X(403,{message:"User not found"});await t.env.data.codes.used(n.tenant.id,e.code);let a;i.session_id&&i.authParams.scope?.split(" ").includes("offline_access")&&(a=await Ab(t,{user:s,client:n,session_id:i.session_id,scope:i.authParams.scope,audience:i.authParams.audience}));let c;if(i.authParams.organization){const l=await t.env.data.organizations.get(n.tenant.id,i.authParams.organization);l?c={id:l.id,name:l.name}:c={id:i.authParams.organization,name:"Unknown"}}return{user:s,client:n,loginSession:i,session_id:i.session_id,refresh_token:a?.id,organization:c,authParams:{...i.authParams,state:r.state,nonce:r.nonce,response_mode:_n.WEB_MESSAGE,client_id:n.client_id,scope:i.authParams.scope,audience:i.authParams.audience}}}function Pm(t,e){const n=t.var.log;n?t.set("log",`${n}
|
|
82
|
+
${e}`):t.set("log",e)}const z9=o.z.object({grant_type:o.z.literal("refresh_token"),client_id:o.z.string(),redirect_uri:o.z.string().optional(),refresh_token:o.z.string(),client_secret:o.z.string().optional()});async function A9(t,e){const n=await t.env.data.legacyClients.get(e.client_id);if(!n)throw new X(403,{message:"Client not found"});if(e.client_secret&&n.client_secret&&!Xo(n.client_secret,e.client_secret))throw new X(403,{error:"invalid_client",error_description:"Client authentication failed"});const r=await t.env.data.refreshTokens.get(n.tenant.id,e.refresh_token);if(r){if(r.expires_at&&new Date(r.expires_at)<new Date||r.idle_expires_at&&new Date(r.idle_expires_at)<new Date)throw Pm(t,`Refresh token has expired: ${e.refresh_token}`),new X(400,{error:"invalid_grant",error_description:"Refresh token has expired"})}else throw Pm(t,`Invalid refresh token: ${e.refresh_token}`),new X(400,{error:"invalid_grant",error_description:"Invalid refresh token"});const i=await t.env.data.users.get(n.tenant.id,r.user_id);if(!i)throw new X(403,{message:"User not found"});t.set("user_id",i.user_id);const s=r.resource_servers[0];if(r.idle_expires_at){const a=new Date(Date.now()+2592e6);await t.env.data.refreshTokens.update(n.tenant.id,r.id,{idle_expires_at:a.toISOString(),last_exchanged_at:new Date().toISOString(),device:{...r.device,last_ip:t.req.header["x-real-ip"]||"",last_user_agent:t.req.header["user-agent"]||""}})}return{user:i,client:n,refresh_token:r.id,session_id:r.session_id,authParams:{client_id:n.client_id,audience:s?.audience,scope:s?.scopes,response_mode:_n.WEB_MESSAGE}}}const E9={version:4,country_calling_codes:{1:["US","AG","AI","AS","BB","BM","BS","CA","DM","DO","GD","GU","JM","KN","KY","LC","MP","MS","PR","SX","TC","TT","VC","VG","VI"],7:["RU","KZ"],20:["EG"],27:["ZA"],30:["GR"],31:["NL"],32:["BE"],33:["FR"],34:["ES"],36:["HU"],39:["IT","VA"],40:["RO"],41:["CH"],43:["AT"],44:["GB","GG","IM","JE"],45:["DK"],46:["SE"],47:["NO","SJ"],48:["PL"],49:["DE"],51:["PE"],52:["MX"],53:["CU"],54:["AR"],55:["BR"],56:["CL"],57:["CO"],58:["VE"],60:["MY"],61:["AU","CC","CX"],62:["ID"],63:["PH"],64:["NZ"],65:["SG"],66:["TH"],81:["JP"],82:["KR"],84:["VN"],86:["CN"],90:["TR"],91:["IN"],92:["PK"],93:["AF"],94:["LK"],95:["MM"],98:["IR"],211:["SS"],212:["MA","EH"],213:["DZ"],216:["TN"],218:["LY"],220:["GM"],221:["SN"],222:["MR"],223:["ML"],224:["GN"],225:["CI"],226:["BF"],227:["NE"],228:["TG"],229:["BJ"],230:["MU"],231:["LR"],232:["SL"],233:["GH"],234:["NG"],235:["TD"],236:["CF"],237:["CM"],238:["CV"],239:["ST"],240:["GQ"],241:["GA"],242:["CG"],243:["CD"],244:["AO"],245:["GW"],246:["IO"],247:["AC"],248:["SC"],249:["SD"],250:["RW"],251:["ET"],252:["SO"],253:["DJ"],254:["KE"],255:["TZ"],256:["UG"],257:["BI"],258:["MZ"],260:["ZM"],261:["MG"],262:["RE","YT"],263:["ZW"],264:["NA"],265:["MW"],266:["LS"],267:["BW"],268:["SZ"],269:["KM"],290:["SH","TA"],291:["ER"],297:["AW"],298:["FO"],299:["GL"],350:["GI"],351:["PT"],352:["LU"],353:["IE"],354:["IS"],355:["AL"],356:["MT"],357:["CY"],358:["FI","AX"],359:["BG"],370:["LT"],371:["LV"],372:["EE"],373:["MD"],374:["AM"],375:["BY"],376:["AD"],377:["MC"],378:["SM"],380:["UA"],381:["RS"],382:["ME"],383:["XK"],385:["HR"],386:["SI"],387:["BA"],389:["MK"],420:["CZ"],421:["SK"],423:["LI"],500:["FK"],501:["BZ"],502:["GT"],503:["SV"],504:["HN"],505:["NI"],506:["CR"],507:["PA"],508:["PM"],509:["HT"],590:["GP","BL","MF"],591:["BO"],592:["GY"],593:["EC"],594:["GF"],595:["PY"],596:["MQ"],597:["SR"],598:["UY"],599:["CW","BQ"],670:["TL"],672:["NF"],673:["BN"],674:["NR"],675:["PG"],676:["TO"],677:["SB"],678:["VU"],679:["FJ"],680:["PW"],681:["WF"],682:["CK"],683:["NU"],685:["WS"],686:["KI"],687:["NC"],688:["TV"],689:["PF"],690:["TK"],691:["FM"],692:["MH"],850:["KP"],852:["HK"],853:["MO"],855:["KH"],856:["LA"],880:["BD"],886:["TW"],960:["MV"],961:["LB"],962:["JO"],963:["SY"],964:["IQ"],965:["KW"],966:["SA"],967:["YE"],968:["OM"],970:["PS"],971:["AE"],972:["IL"],973:["BH"],974:["QA"],975:["BT"],976:["MN"],977:["NP"],992:["TJ"],993:["TM"],994:["AZ"],995:["GE"],996:["KG"],998:["UZ"]},countries:{AC:["247","00","(?:[01589]\\d|[46])\\d{4}",[5,6]],AD:["376","00","(?:1|6\\d)\\d{7}|[135-9]\\d{5}",[6,8,9],[["(\\d{3})(\\d{3})","$1 $2",["[135-9]"]],["(\\d{4})(\\d{4})","$1 $2",["1"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]]],AE:["971","00","(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}",[5,6,7,8,9,10,11,12],[["(\\d{3})(\\d{2,9})","$1 $2",["60|8"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[236]|[479][2-8]"],"0$1"],["(\\d{3})(\\d)(\\d{5})","$1 $2 $3",["[479]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"]],"0"],AF:["93","00","[2-7]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],"0"],AG:["1","011","(?:268|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([457]\\d{6})$|1","268$1",0,"268"],AI:["1","011","(?:264|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2457]\\d{6})$|1","264$1",0,"264"],AL:["355","00","(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}",[6,7,8,9],[["(\\d{3})(\\d{3,4})","$1 $2",["80|9"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["4[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2358][2-5]|4"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["[23578]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["6"],"0$1"]],"0"],AM:["374","00","(?:[1-489]\\d|55|60|77)\\d{6}",[8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[89]0"],"0 $1"],["(\\d{3})(\\d{5})","$1 $2",["2|3[12]"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["1|47"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[3-9]"],"0$1"]],"0"],AO:["244","00","[29]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[29]"]]]],AR:["54","00","(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}",[10,11],[["(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])","2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["[23]"],"0$1",1],["(\\d)(\\d{4})(\\d{2})(\\d{4})","$2 15-$3-$4",["9(?:2[2-469]|3[3-578])","9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))","9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",0,"$1 $2 $3-$4"],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 15-$3-$4",["91"],"0$1",0,"$1 $2 $3-$4"],["(\\d{3})(\\d{3})(\\d{5})","$1-$2-$3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 15-$3-$4",["9"],"0$1",0,"$1 $2 $3-$4"]],"0",0,"0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?","9$1"],AS:["1","011","(?:[58]\\d\\d|684|900)\\d{7}",[10],0,"1",0,"([267]\\d{6})$|1","684$1",0,"684"],AT:["43","00","1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}",[4,5,6,7,8,9,10,11,12,13],[["(\\d)(\\d{3,12})","$1 $2",["1(?:11|[2-9])"],"0$1"],["(\\d{3})(\\d{2})","$1 $2",["517"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["5[079]"],"0$1"],["(\\d{3})(\\d{3,10})","$1 $2",["(?:31|4)6|51|6(?:48|5[0-3579]|[6-9])|7(?:20|32|8)|[89]","(?:31|4)6|51|6(?:485|5[0-3579]|[6-9])|7(?:20|32|8)|[89]"],"0$1"],["(\\d{4})(\\d{3,9})","$1 $2",["[2-467]|5[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["5"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,7})","$1 $2 $3",["5"],"0$1"]],"0"],AU:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{7}(?:\\d(?:\\d{2})?)?|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}",[5,6,7,8,9,10,12],[["(\\d{2})(\\d{3,4})","$1 $2",["16"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,4})","$1 $2 $3",["16"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["14|4"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[2378]"],"(0$1)"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:30|[89])"]]],"0",0,"(183[12])|0",0,0,0,[["(?:(?:241|349)0\\d\\d|8(?:51(?:0(?:0[03-9]|[12479]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\d|7[89]|9[0-4])|[34]\\d\\d)|91(?:(?:[0-58]\\d|6[0135-9])\\d|7(?:0[0-24-9]|[1-9]\\d)|9(?:[0-46-9]\\d|5[0-79]))))\\d{3}|(?:2(?:[0-26-9]\\d|3[0-8]|4[02-9]|5[0135-9])|3(?:[0-3589]\\d|4[0-578]|6[1-9]|7[0-35-9])|7(?:[013-57-9]\\d|2[0-8])|8(?:55|6[0-8]|[78]\\d|9[02-9]))\\d{6}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,["163\\d{2,6}",[5,6,7,8,9]],["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],AW:["297","00","(?:[25-79]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[25-9]"]]]],AX:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}",[5,6,7,8,9,10,11,12],0,"0",0,0,0,0,"18",0,"00"],AZ:["994","00","365\\d{6}|(?:[124579]\\d|60|88)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[28]|2|365|46","1[28]|2|365[45]|46","1[28]|2|365(?:4|5[02])|46"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[13-9]"],"0$1"]],"0"],BA:["387","00","6\\d{8}|(?:[35689]\\d|49|70)\\d{6}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["6[1-3]|[7-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2-$3",["[3-5]|6[56]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["6"],"0$1"]],"0"],BB:["1","011","(?:246|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","246$1",0,"246"],BD:["880","00","[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{4,6})","$1-$2",["31[5-8]|[459]1"],"0$1"],["(\\d{3})(\\d{3,7})","$1-$2",["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:[15]|28|4[14])|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"],"0$1"],["(\\d{4})(\\d{3,6})","$1-$2",["[13-9]|2[23]"],"0$1"],["(\\d)(\\d{7,8})","$1-$2",["2"],"0$1"]],"0"],BE:["32","00","4\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:80|9)0"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[239]|4[23]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[15-8]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4"],"0$1"]],"0"],BF:["226","00","(?:[025-7]\\d|44)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[024-7]"]]]],BG:["359","00","00800\\d{7}|[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}",[6,7,8,9,12],[["(\\d)(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["43[1-6]|70[1-9]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:70|8)0"],"0$1"],["(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3",["43[1-7]|7"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[48]|9[08]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"]],"0"],BH:["973","00","[136-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[13679]|8[02-4679]"]]]],BI:["257","00","(?:[267]\\d|31)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2367]"]]]],BJ:["229","00","(?:01\\d|8)\\d{7}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["0"]]]],BL:["590","00","(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:2[7-9]|3[3-7]|5[12]|87)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],BM:["1","011","(?:441|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","441$1",0,"441"],BN:["673","00","[2-578]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-578]"]]]],BO:["591","00(?:1\\d)?","8001\\d{5}|(?:[2-467]\\d|50)\\d{6}",[8,9],[["(\\d)(\\d{7})","$1 $2",["[235]|4[46]"]],["(\\d{8})","$1",["[67]"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["8"]]],"0",0,"0(1\\d)?"],BQ:["599","00","(?:[34]1|7\\d)\\d{5}",[7],0,0,0,0,0,0,"[347]"],BR:["55","00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)","[1-467]\\d{9,10}|55[0-46-9]\\d{8}|[34]\\d{7}|55\\d{7,8}|(?:5[0-46-9]|[89]\\d)\\d{7,9}",[8,9,10,11],[["(\\d{4})(\\d{4})","$1-$2",["300|4(?:0[02]|37|86)","300|4(?:0(?:0|20)|370|864)"]],["(\\d{3})(\\d{2,3})(\\d{4})","$1 $2 $3",["(?:[358]|90)0"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"],"($1)"],["(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["[16][1-9]|[2-57-9]"],"($1)"]],"0",0,"(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?","$2"],BS:["1","011","(?:242|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([3-8]\\d{6})$|1","242$1",0,"242"],BT:["975","00","[178]\\d{7}|[2-8]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[2-6]|7[246]|8[2-4]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[67]|[78]"]]]],BW:["267","00","(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}",[7,8,10],[["(\\d{2})(\\d{5})","$1 $2",["90"]],["(\\d{3})(\\d{4})","$1 $2",["[24-6]|3[15-9]"]],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37]"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["8"]]]],BY:["375","810","(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3})","$1 $2",["800"],"8 $1"],["(\\d{3})(\\d{2})(\\d{2,4})","$1 $2 $3",["800"],"8 $1"],["(\\d{4})(\\d{2})(\\d{3})","$1 $2-$3",["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])","1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"],"8 0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["1(?:[56]|7[467])|2[1-3]"],"8 0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-4]"],"8 0$1"],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["[89]"],"8 $1"]],"8",0,"0|80?",0,0,0,0,"8~10"],BZ:["501","00","(?:0800\\d|[2-8])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1-$2",["[2-8]"]],["(\\d)(\\d{3})(\\d{4})(\\d{3})","$1-$2-$3-$4",["0"]]]],CA:["1","011","[2-9]\\d{9}|3\\d{6}",[7,10],0,"1",0,0,0,0,0,[["(?:2(?:04|[23]6|[48]9|5[07]|63)|3(?:06|43|54|6[578]|82)|4(?:03|1[68]|[26]8|3[178]|50|74)|5(?:06|1[49]|48|79|8[147])|6(?:04|[18]3|39|47|72)|7(?:0[59]|42|53|78|8[02])|8(?:[06]7|19|25|7[39])|9(?:0[25]|42))[2-9]\\d{6}",[10]],["",[10]],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",[10]],["900[2-9]\\d{6}",[10]],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:2[125-9]|33|44|66|77|88)|6(?:22|33))[2-9]\\d{6}",[10]],0,["310\\d{4}",[7]],0,["600[2-9]\\d{6}",[10]]]],CC:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CD:["243","00","(?:(?:[189]|5\\d)\\d|2)\\d{7}|[1-68]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[1-6]"],"0$1"],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["5"],"0$1"]],"0"],CF:["236","00","(?:[27]\\d{3}|8776)\\d{4}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[278]"]]]],CG:["242","00","222\\d{6}|(?:0\\d|80)\\d{7}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[02]"]]]],CH:["41","00","8\\d{11}|[2-9]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8[047]|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]|81"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["8"],"0$1"]],"0"],CI:["225","00","[02]\\d{9}",[10],[["(\\d{2})(\\d{2})(\\d)(\\d{5})","$1 $2 $3 $4",["2"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3 $4",["0"]]]],CK:["682","00","[2-578]\\d{4}",[5],[["(\\d{2})(\\d{3})","$1 $2",["[2-578]"]]]],CL:["56","(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0","12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}",[9,10,11],[["(\\d{5})(\\d{4})","$1 $2",["219","2196"],"($1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["60|809"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["44"]],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2[1-36]"],"($1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["9(?:10|[2-9])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-8]|[1-9])"],"($1)"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["60|8"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{3})(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3 $4",["60"]]]],CM:["237","00","[26]\\d{8}|88\\d{6,7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["88"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[26]|88"]]]],CN:["86","00|1(?:[12]\\d|79)\\d\\d00","(?:(?:1[03-689]|2\\d)\\d\\d|6)\\d{8}|1\\d{10}|[126]\\d{6}(?:\\d(?:\\d{2})?)?|86\\d{5,6}|(?:[3-579]\\d|8[0-57-9])\\d{5,9}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5,6})","$1 $2",["(?:10|2[0-57-9])[19]|3(?:[157]|35|49|9[1-68])|4(?:1[124-9]|2[179]|6[47-9]|7|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:07|1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3|4[13]|5[1-5]|7[0-79]|9[0-35-9])|(?:4[35]|59|85)[1-9]","(?:10|2[0-57-9])(?:1[02]|9[56])|8078|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))1","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|80781|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))12","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|807812|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123","10(?:1(?:0|23)|9[56])|2[0-57-9](?:1(?:00|23)|9[56])|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:1[124-9]|2[179]|[35][1-9]|6[47-9]|7\\d|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:078|1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|3\\d|4[13]|5[1-5]|7[0-79]|9[0-35-9]))123"],"0$1"],["(\\d{3})(\\d{5,6})","$1 $2",["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]","(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]","85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])","85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["(?:4|80)0"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|2(?:[02-57-9]|1[1-9])","10|2(?:[02-57-9]|1[1-9])","10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"],"0$1",1],["(\\d{3})(\\d{7,8})","$1 $2",["9"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["80"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[3-578]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["1[3-9]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["[12]"],"0$1",1]],"0",0,"(1(?:[12]\\d|79)\\d\\d)|0",0,0,0,0,"00"],CO:["57","00(?:4(?:[14]4|56)|[579])","(?:46|60\\d\\d)\\d{6}|(?:1\\d|[39])\\d{9}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["46"]],["(\\d{3})(\\d{7})","$1 $2",["6|90"],"($1)"],["(\\d{3})(\\d{7})","$1 $2",["3[0-357]|9[14]"]],["(\\d)(\\d{3})(\\d{7})","$1-$2-$3",["1"],"0$1",0,"$1 $2 $3"]],"0",0,"0([3579]|4(?:[14]4|56))?"],CR:["506","00","(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}",[8,10],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[3-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[89]"]]],0,0,"(19(?:0[0-2468]|1[09]|20|66|77|99))"],CU:["53","119","(?:[2-7]|8\\d\\d)\\d{7}|[2-47]\\d{6}|[34]\\d{5}",[6,7,8,10],[["(\\d{2})(\\d{4,6})","$1 $2",["2[1-4]|[34]"],"(0$1)"],["(\\d)(\\d{6,7})","$1 $2",["7"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["[56]"],"0$1"],["(\\d{3})(\\d{7})","$1 $2",["8"],"0$1"]],"0"],CV:["238","0","(?:[2-59]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2-589]"]]]],CW:["599","00","(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[3467]"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["9[4-8]"]]],0,0,0,0,0,"[69]"],CX:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}",[9]],["4(?:79[01]|83[0-36-9]|95[0-3])\\d{5}|4(?:[0-36]\\d|4[047-9]|[58][0-24-9]|7[02-8]|9[0-47-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CY:["357","00","(?:[279]\\d|[58]0)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[257-9]"]]]],CZ:["420","00","(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}",[9,10,11,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]|9[015-7]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["96"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]]],DE:["49","00","[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:2[024-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[015]\\d|2[13]|31|[46][1-8])\\d{1,9}",[4,5,6,7,8,9,10,11,12,13,14,15],[["(\\d{2})(\\d{3,13})","$1 $2",["3[02]|40|[68]9"],"0$1"],["(\\d{3})(\\d{3,12})","$1 $2",["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1","2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"],"0$1"],["(\\d{4})(\\d{2,11})","$1 $2",["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]","[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["138"],"0$1"],["(\\d{5})(\\d{2,10})","$1 $2",["3"],"0$1"],["(\\d{3})(\\d{5,11})","$1 $2",["181"],"0$1"],["(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3",["1(?:3|80)|9"],"0$1"],["(\\d{3})(\\d{7,8})","$1 $2",["1[67]"],"0$1"],["(\\d{3})(\\d{7,12})","$1 $2",["8"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["185","1850","18500"],"0$1"],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["18[68]"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["15[1279]"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["15[03568]","15(?:[0568]|3[13])"],"0$1"],["(\\d{3})(\\d{8})","$1 $2",["18"],"0$1"],["(\\d{3})(\\d{2})(\\d{7,8})","$1 $2 $3",["1(?:6[023]|7)"],"0$1"],["(\\d{4})(\\d{2})(\\d{7})","$1 $2 $3",["15[279]"],"0$1"],["(\\d{3})(\\d{2})(\\d{8})","$1 $2 $3",["15"],"0$1"]],"0"],DJ:["253","00","(?:2\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[27]"]]]],DK:["45","00","[2-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-9]"]]]],DM:["1","011","(?:[58]\\d\\d|767|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","767$1",0,"767"],DO:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,0,0,0,"8001|8[024]9"],DZ:["213","00","(?:[1-4]|[5-79]\\d|80)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-8]"],"0$1"]],"0"],EC:["593","00","1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}",[8,9,10,11],[["(\\d)(\\d{3})(\\d{4})","$1 $2-$3",["[2-7]"],"(0$1)",0,"$1-$2-$3"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{3})(\\d{3,4})","$1 $2 $3",["1"]]],"0"],EE:["372","00","8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]],["(\\d{4})(\\d{3,4})","$1 $2",["[45]|8(?:00|[1-49])","[45]|8(?:00[1-9]|[1-49])"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],EG:["20","00","[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}",[8,9,10],[["(\\d)(\\d{7,8})","$1 $2",["[23]"],"0$1"],["(\\d{2})(\\d{6,7})","$1 $2",["1[35]|[4-6]|8[2468]|9[235-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{8})","$1 $2",["1"],"0$1"]],"0"],EH:["212","00","[5-8]\\d{8}",[9],0,"0",0,0,0,0,"528[89]"],ER:["291","00","[178]\\d{6}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[178]"],"0$1"]],"0"],ES:["34","00","[5-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]00"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-9]"]]]],ET:["251","00","(?:11|[2-579]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-579]"],"0$1"]],"0"],FI:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}",[5,6,7,8,9,10,11,12],[["(\\d{5})","$1",["20[2-59]"],"0$1"],["(\\d{3})(\\d{3,7})","$1 $2",["(?:[1-3]0|[68])0|70[07-9]"],"0$1"],["(\\d{2})(\\d{4,8})","$1 $2",["[14]|2[09]|50|7[135]"],"0$1"],["(\\d{2})(\\d{6,10})","$1 $2",["7"],"0$1"],["(\\d)(\\d{4,9})","$1 $2",["(?:19|[2568])[1-8]|3(?:0[1-9]|[1-9])|9"],"0$1"]],"0",0,0,0,0,"1[03-79]|[2-9]",0,"00"],FJ:["679","0(?:0|52)","45\\d{5}|(?:0800\\d|[235-9])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1 $2",["[235-9]|45"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]]],0,0,0,0,0,0,0,"00"],FK:["500","00","[2-7]\\d{4}",[5]],FM:["691","00","(?:[39]\\d\\d|820)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[389]"]]]],FO:["298","00","[2-9]\\d{5}",[6],[["(\\d{6})","$1",["[2-9]"]]],0,0,"(10(?:01|[12]0|88))"],FR:["33","00","[1-9]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0 $1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[1-79]"],"0$1"]],"0"],GA:["241","00","(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}",[7,8],[["(\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-7]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["11|[67]"],"0$1"]],0,0,"0(11\\d{6}|60\\d{6}|61\\d{6}|6[256]\\d{6}|7[467]\\d{6})","$1"],GB:["44","00","[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}",[7,9,10],[["(\\d{3})(\\d{4})","$1 $2",["800","8001","80011","800111","8001111"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["845","8454","84546","845464"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["800"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["1(?:38|5[23]|69|76|94)","1(?:(?:38|69)7|5(?:24|39)|768|946)","1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["1(?:[2-69][02-9]|[78])"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[25]|7(?:0|6[02-9])","[25]|7(?:0|6(?:[03-9]|2[356]))"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[1389]"],"0$1"]],"0",0,"0|180020",0,0,0,[["(?:1(?:1(?:3(?:[0-58]\\d\\d|73[0-5])|4(?:(?:[0-5]\\d|70)\\d|69[7-9])|(?:(?:5[0-26-9]|[78][0-49])\\d|6(?:[0-4]\\d|5[01]))\\d)|(?:2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\d)\\d|1(?:[0-7]\\d|8[0-3]))|(?:3(?:0\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\d)\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\d{3})\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\d)|76\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[5-7]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d{3}",[9,10]],["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[2-49]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]],0," x"],GD:["1","011","(?:473|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","473$1",0,"473"],GE:["995","00","(?:[3-57]\\d\\d|800)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["32"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[57]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[348]"],"0$1"]],"0"],GF:["594","00","(?:[56]94\\d|7093)\\d{5}|(?:80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]|9[47]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[89]"],"0$1"]],"0"],GG:["44","00","(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?",[7,9,10],0,"0",0,"([25-9]\\d{5})$|0|180020","1481$1",0,0,[["1481[25-9]\\d{5}",[10]],["7(?:(?:781|839)\\d|911[17])\\d{5}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[0-3]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]]],GH:["233","00","(?:[235]\\d{3}|800)\\d{5}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[235]"],"0$1"]],"0"],GI:["350","00","(?:[25]\\d|60)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["2"]]]],GL:["299","00","(?:19|[2-689]\\d|70)\\d{4}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["19|[2-9]"]]]],GM:["220","00","[2-9]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],GN:["224","00","722\\d{6}|(?:3|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["3"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[67]"]]]],GP:["590","00","(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["590(?:0[1-68]|[14][0-24-9]|2[0-68]|3[1-9]|5[3-579]|[68][0-689]|7[08]|9\\d)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],GQ:["240","00","222\\d{6}|(?:3\\d|55|[89]0)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235]"]],["(\\d{3})(\\d{6})","$1 $2",["[89]"]]]],GR:["30","00","5005000\\d{3}|8\\d{9,11}|(?:[269]\\d|70)\\d{8}",[10,11,12],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["21|7"]],["(\\d{4})(\\d{6})","$1 $2",["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2689]"]],["(\\d{3})(\\d{3,4})(\\d{5})","$1 $2 $3",["8"]]]],GT:["502","00","80\\d{6}|(?:1\\d{3}|[2-7])\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1 $2",["[2-8]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],GU:["1","011","(?:[58]\\d\\d|671|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","671$1",0,"671"],GW:["245","00","[49]\\d{8}|4\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["40"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"]]]],GY:["592","001","(?:[2-8]\\d{3}|9008)\\d{3}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],HK:["852","00(?:30|5[09]|[126-9]?)","8[0-46-9]\\d{6,7}|9\\d{4,7}|(?:[2-7]|9\\d{3})\\d{7}",[5,6,7,8,9,11],[["(\\d{3})(\\d{2,5})","$1 $2",["900","9003"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{3})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]],0,0,0,0,0,0,0,"00"],HN:["504","00","8\\d{10}|[237-9]\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1-$2",["[237-9]"]]]],HR:["385","00","[2-69]\\d{8}|80\\d{5,7}|[1-79]\\d{7}|6\\d{6}",[7,8,9],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["6[01]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{4})(\\d{3})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6|7[245]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-57]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"]],"0"],HT:["509","00","[2-589]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[2-589]"]]]],HU:["36","00","[235-7]\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"06 $1"]],"06"],ID:["62","00[89]","00[1-9]\\d{9,14}|(?:[1-36]|8\\d{5})\\d{6}|00\\d{9}|[1-9]\\d{8,10}|[2-9]\\d{7}",[7,8,9,10,11,12,13,14,15,16,17],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["15"]],["(\\d{2})(\\d{5,9})","$1 $2",["2[124]|[36]1"],"(0$1)"],["(\\d{3})(\\d{5,7})","$1 $2",["800"],"0$1"],["(\\d{3})(\\d{5,8})","$1 $2",["[2-79]"],"(0$1)"],["(\\d{3})(\\d{3,4})(\\d{3})","$1-$2-$3",["8[1-35-9]"],"0$1"],["(\\d{3})(\\d{6,8})","$1 $2",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["804"],"0$1"],["(\\d{3})(\\d)(\\d{3})(\\d{3})","$1 $2 $3 $4",["80"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1-$2-$3",["8"],"0$1"]],"0"],IE:["353","00","(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["2[24-9]|47|58|6[237-9]|9[35-9]"],"(0$1)"],["(\\d{3})(\\d{5})","$1 $2",["[45]0"],"(0$1)"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["1"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2569]|4[1-69]|7[14]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["81"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[78]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["4"],"(0$1)"],["(\\d{2})(\\d)(\\d{3})(\\d{4})","$1 $2 $3 $4",["8"],"0$1"]],"0"],IL:["972","0(?:0|1[2-9])","1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}",[7,8,9,10,11,12],[["(\\d{4})(\\d{3})","$1-$2",["125"]],["(\\d{4})(\\d{2})(\\d{2})","$1-$2-$3",["121"]],["(\\d)(\\d{3})(\\d{4})","$1-$2-$3",["[2-489]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1-$2-$3",["12"]],["(\\d{4})(\\d{6})","$1-$2",["159"]],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3-$4",["1[7-9]"]],["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})","$1-$2 $3-$4",["15"]]],"0"],IM:["44","00","1624\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([25-8]\\d{5})$|0|180020","1624$1",0,"74576|(?:16|7[56])24"],IN:["91","00","(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}",[8,9,10,11,12,13],[["(\\d{8})","$1",["5(?:0|2[23]|3[03]|[67]1|88)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"],0,1],["(\\d{4})(\\d{4,5})","$1 $2",["180","1800"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["140"],0,1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["11|2[02]|33|4[04]|79[1-7]|80[2-46]","11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])","11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|4[47]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67|72)[14]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:2[14]|3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:(?:2[14]|5[15])[2-6]|3171|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|(?:74[47]|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"],"0$1",1],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|28|3[129]|4[1-35689]|5[29]|6[02-5]|70)|807","1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1(?:[013-8]|9[6-9])|28[6-8]|3(?:17|2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]","1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|8(?:28[235-7]|3))|73179|807(?:1|9[1-3])|(?:1552|6(?:(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|7[235689])\\d|8(?:[14-6]\\d|2[0-79]))|7(?:1(?:[013-8]\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"],"0$1",1],["(\\d{5})(\\d{5})","$1 $2",["16|[6-9]"],"0$1",1],["(\\d{4})(\\d{2,4})(\\d{4})","$1 $2 $3",["18[06]","18[06]0"],0,1],["(\\d{4})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["18"],0,1]],"0"],IO:["246","00","3\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["3"]]]],IQ:["964","00","(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-6]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],IR:["98","00","[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}",[4,5,6,7,10],[["(\\d{4,5})","$1",["96"],"0$1"],["(\\d{2})(\\d{4,5})","$1 $2",["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[1-8]"],"0$1"]],"0"],IS:["354","00|1(?:0(?:01|[12]0)|100)","(?:38\\d|[4-9])\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["[4-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["3"]]],0,0,0,0,0,0,0,"00"],IT:["39","00","0\\d{5,11}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|(?:43|55|70)\\d{8}|8\\d{5}(?:\\d{2,4})?",[6,7,8,9,10,11,12],[["(\\d{2})(\\d{4,6})","$1 $2",["0[26]"]],["(\\d{3})(\\d{3,6})","$1 $2",["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])","0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]],["(\\d{4})(\\d{2,6})","$1 $2",["0(?:[13-579][2-46-8]|8[236-8])"]],["(\\d{4})(\\d{4})","$1 $2",["894"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[26]|5"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["1(?:44|[679])|[378]|43"]],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[13-57-9][0159]|14"]],["(\\d{2})(\\d{4})(\\d{5})","$1 $2 $3",["0[26]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[03]"]]],0,0,0,0,0,0,[["0(?:669[0-79]\\d{1,6}|831\\d{2,8})|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[2356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}"],["3[2-9]\\d{7,8}|(?:31|43)\\d{8}",[9,10]],["80(?:0\\d{3}|3)\\d{3}",[6,9]],["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}",[6,8,9,10]],["1(?:78\\d|99)\\d{6}",[9,10]],["3[2-8]\\d{9,10}",[11,12]],0,0,["55\\d{8}",[10]],["84(?:[08]\\d{3}|[17])\\d{3}",[6,9]]]],JE:["44","00","1534\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([0-24-8]\\d{5})$|0|180020","1534$1",0,0,[["1534[0-24-8]\\d{5}"],["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97\\d))\\d{5}"],["80(?:07(?:35|81)|8901)\\d{4}"],["(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}"],["701511\\d{4}"],0,["(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}"],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}"],["56\\d{8}"]]],JM:["1","011","(?:[58]\\d\\d|658|900)\\d{7}",[10],0,"1",0,0,0,0,"658|876"],JO:["962","00","(?:(?:[2689]|7\\d)\\d|32|427|53)\\d{6}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2356]|87"],"(0$1)"],["(\\d{3})(\\d{5,6})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["70"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[47]"],"0$1"]],"0"],JP:["81","010","00[1-9]\\d{6,14}|[25-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}",[8,9,10,11,12,13,14,15,16,17],[["(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3",["(?:12|57|99)0"],"0$1"],["(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51)|9(?:80|9[16])","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2-$3",["3|4(?:2[09]|7[01])|6[1-9]","3|4(?:2(?:0|9[02-69])|7(?:0[019]|1))|6[1-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[0459]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[26-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9]|9[29])|5(?:2|3(?:[045]|9[0-8])|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|3(?:[29]|60)|49|51|6(?:[0-24]|36|5[0-3589]|7[23]|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3(?:[045]|9(?:[0-58]|6[4-9]|7[0-35689]))|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|60|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[2-57-9]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|7(?:2[2-468]|3[78])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"],"0$1"],["(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["[14]|[289][2-9]|5[3-9]|7[2-4679]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["800"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[25-9]"],"0$1"]],"0",0,"(000[2569]\\d{4,6})$|(?:(?:003768)0?)|0","$1"],KE:["254","000","(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}",[7,8,9,10],[["(\\d{2})(\\d{5,7})","$1 $2",["[24-6]"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[17]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0"],KG:["996","00","8\\d{9}|[235-9]\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["3(?:1[346]|[24-79])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-79]|88"],"0$1"],["(\\d{3})(\\d{3})(\\d)(\\d{2,3})","$1 $2 $3 $4",["8"],"0$1"]],"0"],KH:["855","00[14-9]","1\\d{9}|[1-9]\\d{7,8}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],KI:["686","00","(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}",[5,8],0,"0"],KM:["269","00","[3478]\\d{6}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[3478]"]]]],KN:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","869$1",0,"869"],KP:["850","00|99","85\\d{6}|(?:19\\d|[2-7])\\d{7}",[8,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"]],"0"],KR:["82","00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))","00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}",[5,6,8,9,10,11,12,13,14],[["(\\d{2})(\\d{3,4})","$1-$2",["(?:3[1-3]|[46][1-4]|5[1-5])1"],"0$1"],["(\\d{4})(\\d{4})","$1-$2",["1"]],["(\\d)(\\d{3,4})(\\d{4})","$1-$2-$3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[36]0|8"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["[1346]|5[1-5]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{2})(\\d{5})(\\d{4})","$1-$2-$3",["5"],"0$1"]],"0",0,"0(8(?:[1-46-8]|5\\d\\d))?"],KW:["965","00","18\\d{5}|(?:[2569]\\d|41)\\d{6}",[7,8],[["(\\d{4})(\\d{3,4})","$1 $2",["[169]|2(?:[235]|4[1-35-9])|52"]],["(\\d{3})(\\d{5})","$1 $2",["[245]"]]]],KY:["1","011","(?:345|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","345$1",0,"345"],KZ:["7","810","(?:33622|8\\d{8})\\d{5}|[78]\\d{9}",[10,14],0,"8",0,0,0,0,"33622|7",0,"8~10"],LA:["856","00","[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2[13]|3[14]|[4-8]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["3"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[23]"],"0$1"]],"0"],LB:["961","00","[27-9]\\d{7}|[13-9]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[13-69]|7(?:[2-57]|62|8[0-6]|9[04-9])|8[02-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27-9]"]]],"0"],LC:["1","011","(?:[58]\\d\\d|758|900)\\d{7}",[10],0,"1",0,"([2-8]\\d{6})$|1","758$1",0,"758"],LI:["423","00","[68]\\d{8}|(?:[2378]\\d|90)\\d{5}",[7,9],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2379]|8(?:0[09]|7)","[2379]|8(?:0(?:02|9)|7)"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["69"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],"0",0,"(1001)|0"],LK:["94","00","[1-9]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[1-689]"],"0$1"]],"0"],LR:["231","00","(?:[2457]\\d|33|88)\\d{7}|(?:2\\d|[4-6])\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["4[67]|[56]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-578]"],"0$1"]],"0"],LS:["266","00","(?:[256]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2568]"]]]],LT:["370","00","(?:[3469]\\d|52|[78]0)\\d{6}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["52[0-7]"],"(0-$1)",1],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[7-9]"],"0 $1",1],["(\\d{2})(\\d{6})","$1 $2",["37|4(?:[15]|6[1-8])"],"(0-$1)",1],["(\\d{3})(\\d{5})","$1 $2",["[3-6]"],"(0-$1)",1]],"0",0,"[08]"],LU:["352","00","35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}",[4,5,6,7,8,9,10,11],[["(\\d{2})(\\d{3})","$1 $2",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["20[2-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4",["2(?:[0367]|4[3-8])"]],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["80[01]|90[015]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["20"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4 $5",["2(?:[0367]|4[3-8])"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})","$1 $2 $3 $4",["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]]],0,0,"(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)"],LV:["371","00","(?:[268]\\d|78|90)\\d{6}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2679]|8[01]"]]]],LY:["218","00","[2-9]\\d{8}",[9],[["(\\d{2})(\\d{7})","$1-$2",["[2-9]"],"0$1"]],"0"],MA:["212","00","[5-8]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5[45]"],"0$1"],["(\\d{4})(\\d{5})","$1-$2",["5(?:[19]|2[2-46-9]|3[3-9])|8(?:0[89]|92)"],"0$1"],["(\\d{2})(\\d{7})","$1-$2",["8"],"0$1"],["(\\d{3})(\\d{6})","$1-$2",["[5-7]"],"0$1"]],"0",0,0,0,0,0,[["5(?:(?:18|4[0679]|5[03])\\d|2(?:[0-25-79]\\d|3[1-578]|4[02-46-8]|8[0235-7])|3(?:[0-47]\\d|5[02-9]|6[02-8]|8[014-9]|9[3-9]))\\d{5}"],["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[016-8]\\d|2[0-8]|5[0-5]))\\d{6}"],["80[0-7]\\d{6}"],["89\\d{7}"],0,0,0,0,["(?:592(?:4[0-2]|93)|80[89]\\d\\d)\\d{4}"]]],MC:["377","00","(?:[3489]|[67]\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["4"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[389]"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[67]"],"0$1"]],"0"],MD:["373","00","(?:[235-7]\\d|[89]0)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["22|3"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[25-7]"],"0$1"]],"0"],ME:["382","00","(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"0$1"]],"0"],MF:["590","00","(?:590\\d|7090)\\d{5}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:0[079]|[14]3|[27][79]|3[03-7]|5[0-268]|87)\\d{4}"],["(?:69(?:0\\d\\d|1(?:2[2-9]|3[0-5])|4(?:0[89]|1[2-6]|9\\d)|6(?:1[016-9]|5[0-4]|[67]\\d))|7090[0-4])\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:39[5-7]|76[018])\\d|475[0-6])\\d{4}"]]],MG:["261","00","[23]\\d{8}",[9],[["(\\d{2})(\\d{2})(\\d{3})(\\d{2})","$1 $2 $3 $4",["[23]"],"0$1"]],"0",0,"([24-9]\\d{6})$|0","20$1"],MH:["692","011","329\\d{4}|(?:[256]\\d|45)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1-$2",["[2-6]"]]],"1"],MK:["389","00","[2-578]\\d{7}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2|34[47]|4(?:[37]7|5[47]|64)"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[347]"],"0$1"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["[58]"],"0$1"]],"0"],ML:["223","00","[24-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-9]"]]]],MM:["95","00","1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}",[6,7,8,9,10],[["(\\d)(\\d{2})(\\d{3})","$1 $2 $3",["16|2"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["4(?:[2-46]|5[3-5])|5|6(?:[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-5]|(?:60|86)[23]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]|452|678|86","[12]|452|6788|86"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[4-7]|8[1-35]"],"0$1"],["(\\d)(\\d{3})(\\d{4,6})","$1 $2 $3",["9(?:2[0-4]|[35-9]|4[137-9])"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["92"],"0$1"],["(\\d)(\\d{5})(\\d{4})","$1 $2 $3",["9"],"0$1"]],"0"],MN:["976","001","[12]\\d{7,9}|[5-9]\\d{7}",[8,9,10],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[12]1"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[5-9]"]],["(\\d{3})(\\d{5,6})","$1 $2",["[12]2[1-3]"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["[12](?:27|3[2-8]|4[2-68]|5[1-4689])","[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["[12]"],"0$1"]],"0"],MO:["853","00","0800\\d{3}|(?:28|[68]\\d)\\d{6}",[7,8],[["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{4})(\\d{4})","$1 $2",["[268]"]]]],MP:["1","011","[58]\\d{9}|(?:67|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","670$1",0,"670"],MQ:["596","00","(?:596\\d|7091)\\d{5}|(?:69|[89]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-79]|8(?:0[6-9]|[36])"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],MR:["222","00","(?:[2-4]\\d\\d|800)\\d{5}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-48]"]]]],MS:["1","011","(?:[58]\\d\\d|664|900)\\d{7}",[10],0,"1",0,"([34]\\d{6})$|1","664$1",0,"664"],MT:["356","00","3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2357-9]"]]]],MU:["230","0(?:0|[24-7]0|3[03])","(?:[57]|8\\d\\d)\\d{7}|[2-468]\\d{6}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[2-46]|8[013]"]],["(\\d{4})(\\d{4})","$1 $2",["[57]"]],["(\\d{5})(\\d{5})","$1 $2",["8"]]],0,0,0,0,0,0,0,"020"],MV:["960","0(?:0|19)","(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}",[7,10],[["(\\d{3})(\\d{4})","$1-$2",["[34679]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"]]],0,0,0,0,0,0,0,"00"],MW:["265","00","(?:[1289]\\d|31|77)\\d{7}|1\\d{6}",[7,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["1[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[137-9]"],"0$1"]],"0"],MX:["52","0[09]","[2-9]\\d{9}",[10],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["33|5[56]|81"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2-9]"]]],0,0,0,0,0,0,0,"00"],MY:["60","00","1\\d{8,9}|(?:3\\d|[4-9])\\d{7}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1-$2 $3",["[4-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1-$2 $3",["1(?:[02469]|[378][1-9]|53)|8","1(?:[02469]|[37][1-9]|53|8(?:[1-46-9]|5[7-9]))|8"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2 $3",["3"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3-$4",["1(?:[367]|80)"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2 $3",["15"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2 $3",["1"],"0$1"]],"0"],MZ:["258","00","(?:2|8\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2|8[2-79]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],NA:["264","00","[68]\\d{7,8}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["87"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],NC:["687","00","(?:050|[2-57-9]\\d\\d)\\d{3}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1.$2.$3",["[02-57-9]"]]]],NE:["227","00","[027-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["08"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[089]|2[013]|7[0467]"]]]],NF:["672","00","[13]\\d{5}",[6],[["(\\d{2})(\\d{4})","$1 $2",["1[0-3]"]],["(\\d)(\\d{5})","$1 $2",["[13]"]]],0,0,"([0-258]\\d{4})$","3$1"],NG:["234","009","(?:20|9\\d)\\d{8}|[78]\\d{9,13}",[10,11,12,13,14],[["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["20[129]"],"0$1"],["(\\d{4})(\\d{2})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[78]"],"0$1"],["(\\d{3})(\\d{5})(\\d{5,6})","$1 $2 $3",["[78]"],"0$1"]],"0"],NI:["505","00","(?:1800|[25-8]\\d{3})\\d{4}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[125-8]"]]]],NL:["31","00","(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|8\\d{6,9}|9\\d{6,10}|1\\d{4,5}",[5,6,7,8,9,10,11],[["(\\d{3})(\\d{4,7})","$1 $2",["[89]0"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["66"],"0$1"],["(\\d)(\\d{8})","$1 $2",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-578]|91"],"0$1"],["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3",["9"],"0$1"]],"0"],NO:["47","00","(?:0|[2-9]\\d{3})\\d{4}",[5,8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]"]]],0,0,0,0,0,"[02-689]|7[0-8]"],NP:["977","00","(?:1\\d|9)\\d{9}|[1-9]\\d{7}",[8,10,11],[["(\\d)(\\d{7})","$1-$2",["1[2-6]"],"0$1"],["(\\d{2})(\\d{6})","$1-$2",["1[01]|[2-8]|9(?:[1-59]|[67][2-6])"],"0$1"],["(\\d{3})(\\d{7})","$1-$2",["9"]]],"0"],NR:["674","00","(?:222|444|(?:55|8\\d)\\d|666|777|999)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[24-9]"]]]],NU:["683","00","(?:[4-7]|888\\d)\\d{3}",[4,7],[["(\\d{3})(\\d{4})","$1 $2",["8"]]]],NZ:["64","0(?:0|161)","[1289]\\d{9}|50\\d{5}(?:\\d{2,3})?|[27-9]\\d{7,8}|(?:[34]\\d|6[0-35-9])\\d{6}|8\\d{4,6}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,8})","$1 $2",["8[1-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["50[036-8]|8|90","50(?:[0367]|88)|8|90"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["24|[346]|7[2-57-9]|9[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:10|74)|[589]"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1|2[028]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,5})","$1 $2 $3",["2(?:[169]|7[0-35-9])|7"],"0$1"]],"0",0,0,0,0,0,0,"00"],OM:["968","00","(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}",[7,8,9],[["(\\d{3})(\\d{4,6})","$1 $2",["[58]"]],["(\\d{2})(\\d{6})","$1 $2",["2"]],["(\\d{4})(\\d{4})","$1 $2",["[179]"]]]],PA:["507","00","(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}",[7,8,10,11],[["(\\d{3})(\\d{4})","$1-$2",["[1-57-9]"]],["(\\d{4})(\\d{4})","$1-$2",["[68]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]]],PE:["51","00|19(?:1[124]|77|90)00","(?:[14-8]|9\\d)\\d{7}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["80"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["1"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[4-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"]]],"0",0,0,0,0,0,0,"00"," Anexo "],PF:["689","00","4\\d{5}(?:\\d{2})?|8\\d{7,8}",[6,8,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["44"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4|8[7-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],PG:["675","00|140[1-3]","(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["18|[2-69]|85"]],["(\\d{4})(\\d{4})","$1 $2",["[78]"]]],0,0,0,0,0,0,0,"00"],PH:["63","00","(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}",[6,8,9,10,11,12,13],[["(\\d)(\\d{5})","$1 $2",["2"],"(0$1)"],["(\\d{4})(\\d{4,6})","$1 $2",["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2","3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"],"(0$1)"],["(\\d{5})(\\d{4})","$1 $2",["346|4(?:27|9[35])|883","3469|4(?:279|9(?:30|56))|8834"],"(0$1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|8[2-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})","$1 $2 $3 $4",["1"]]],"0"],PK:["92","00","122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,7})","$1 $2 $3",["[89]0"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["1"]],["(\\d{3})(\\d{6,7})","$1 $2",["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])","9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"],"(0$1)"],["(\\d{2})(\\d{7,8})","$1 $2",["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"],"(0$1)"],["(\\d{5})(\\d{5})","$1 $2",["58"],"(0$1)"],["(\\d{3})(\\d{7})","$1 $2",["3"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[24-9]"],"(0$1)"]],"0"],PL:["48","00","(?:6|8\\d\\d)\\d{7}|[1-9]\\d{6}(?:\\d{2})?|[26]\\d{5}",[6,7,8,9,10],[["(\\d{5})","$1",["19"]],["(\\d{3})(\\d{3})","$1 $2",["11|20|64"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1","(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["64"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[2-8]|[2-7]|8[1-79]|9[145]"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["8"]]]],PM:["508","00","[45]\\d{5}|(?:708|8\\d\\d)\\d{6}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[45]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],PR:["1","011","(?:[589]\\d\\d|787)\\d{7}",[10],0,"1",0,0,0,0,"787|939"],PS:["970","00","[2489]2\\d{6}|(?:1\\d|5)\\d{8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2489]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["5"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],PT:["351","00","1693\\d{5}|(?:[26-9]\\d|30)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["2[12]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["16|[236-9]"]]]],PW:["680","01[12]","(?:[24-8]\\d\\d|345|900)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],PY:["595","00","59\\d{4,6}|9\\d{5,10}|(?:[2-46-8]\\d|5[0-8])\\d{4,7}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3,6})","$1 $2",["[2-9]0"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36]"],"(0$1)"],["(\\d{3})(\\d{4,5})","$1 $2",["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["87"]],["(\\d{3})(\\d{6})","$1 $2",["9(?:[5-79]|8[1-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["9"]]],"0"],QA:["974","00","800\\d{4}|(?:2|800)\\d{6}|(?:0080|[3-7])\\d{7}",[7,8,9,11],[["(\\d{3})(\\d{4})","$1 $2",["2[136]|8"]],["(\\d{4})(\\d{4})","$1 $2",["[3-7]"]]]],RE:["262","00","709\\d{6}|(?:26|[689]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[26-9]"],"0$1"]],"0",0,0,0,0,0,[["26(?:2\\d\\d|3(?:0\\d|1[0-6]))\\d{4}"],["(?:69(?:2\\d\\d|3(?:[06][0-6]|1[0-3]|2[0-2]|3[0-39]|4\\d|5[0-5]|7[0-37]|8[0-8]|9[0-479]))|7092[0-3])\\d{4}"],["80\\d{7}"],["89[1-37-9]\\d{6}"],0,0,0,0,["9(?:399[0-3]|479[0-6]|76(?:2[278]|3[0-37]))\\d{4}"],["8(?:1[019]|2[0156]|84|90)\\d{6}"]]],RO:["40","00","(?:[236-8]\\d|90)\\d{7}|[23]\\d{5}",[6,9],[["(\\d{3})(\\d{3})","$1 $2",["2[3-6]","2[3-6]\\d9"],"0$1"],["(\\d{2})(\\d{4})","$1 $2",["219|31"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23]1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[236-9]"],"0$1"]],"0",0,0,0,0,0,0,0," int "],RS:["381","00","38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}",[6,7,8,9,10,11,12],[["(\\d{3})(\\d{3,9})","$1 $2",["(?:2[389]|39)0|[7-9]"],"0$1"],["(\\d{2})(\\d{5,10})","$1 $2",["[1-36]"],"0$1"]],"0"],RU:["7","810","8\\d{13}|[347-9]\\d{9}",[10,14],[["(\\d{4})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-8]|2[1-9])","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:1[23]|[2-9]2))","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"],"8 ($1)",1],["(\\d{5})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-68]|2[1-9])","7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))","7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[349]|8(?:[02-7]|1[1-8])"],"8 ($1)",1],["(\\d{4})(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3 $4",["8"],"8 ($1)"]],"8",0,0,0,0,0,[["336(?:[013-9]\\d|2[013-9])\\d{5}|(?:3(?:0[12]|4[1-35-79]|5[1-3]|65|8[1-58]|9[0145])|4(?:01|1[1356]|2[13467]|7[1-5]|8[1-7]|9[1-689])|8(?:1[1-8]|2[01]|3[13-6]|4[0-8]|5[15-7]|6[0-35-79]|7[1-37-9]))\\d{7}",[10]],["9\\d{9}",[10]],["8(?:0[04]|108\\d{3})\\d{7}"],["80[39]\\d{7}",[10]],["808\\d{7}",[10]]],"8~10"],RW:["250","00","(?:06|[27]\\d\\d|[89]00)\\d{6}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[7-9]"],"0$1"]],"0"],SA:["966","00","(?:[15]\\d|800|92)\\d{7}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["9"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]],"0"],SB:["677","0[01]","[6-9]\\d{6}|[1-6]\\d{4}",[5,7],[["(\\d{2})(\\d{5})","$1 $2",["6[89]|7|8[4-9]|9(?:[1-8]|9[0-8])"]]]],SC:["248","010|0[0-2]","(?:[2489]\\d|64)\\d{5}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[246]|9[57]"]]],0,0,0,0,0,0,0,"00"],SD:["249","00","[19]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[19]"],"0$1"]],"0"],SE:["46","00","(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}",[6,7,8,9,10,12],[["(\\d{2})(\\d{2,3})(\\d{2})","$1-$2 $3",["20"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{4})","$1-$2",["9(?:00|39|44|9)"],"0$1",0,"$1 $2"],["(\\d{2})(\\d{3})(\\d{2})","$1-$2 $3",["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3"],["(\\d)(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2,3})(\\d{2})","$1-$2 $3",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{2,3})(\\d{3})","$1-$2 $3",["9(?:00|39|44)"],"0$1",0,"$1 $2 $3"],["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3 $4"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["10|7"],"0$1",0,"$1 $2 $3 $4"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1-$2 $3 $4",["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{3})","$1-$2 $3 $4",["9"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4 $5",["[26]"],"0$1",0,"$1 $2 $3 $4 $5"]],"0"],SG:["65","0[0-3]\\d","(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["[369]|8(?:0[1-9]|[1-9])"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]],["(\\d{4})(\\d{4})(\\d{3})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],SH:["290","00","(?:[256]\\d|8)\\d{3}",[4,5],0,0,0,0,0,0,"[256]"],SI:["386","00|10(?:22|66|88|99)","[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}",[5,6,7,8],[["(\\d{2})(\\d{3,6})","$1 $2",["8[09]|9"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["59|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37][01]|4[0139]|51|6"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-57]"],"(0$1)"]],"0",0,0,0,0,0,0,"00"],SJ:["47","00","0\\d{4}|(?:[489]\\d|79)\\d{6}",[5,8],0,0,0,0,0,0,"79"],SK:["421","00","[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}",[6,7,9],[["(\\d)(\\d{2})(\\d{3,4})","$1 $2 $3",["21"],"0$1"],["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["[3-5][1-8]1","[3-5][1-8]1[67]"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1/$2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[689]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1/$2 $3 $4",["[3-5]"],"0$1"]],"0"],SL:["232","00","(?:[237-9]\\d|66)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[236-9]"],"(0$1)"]],"0"],SM:["378","00","(?:0549|[5-7]\\d)\\d{6}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]"]],["(\\d{4})(\\d{6})","$1 $2",["0"]]],0,0,"([89]\\d{5})$","0549$1"],SN:["221","00","(?:[378]\\d|93)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[379]"]]]],SO:["252","00","[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}",[6,7,8,9],[["(\\d{2})(\\d{4})","$1 $2",["8[125]"]],["(\\d{6})","$1",["[134]"]],["(\\d)(\\d{6})","$1 $2",["[15]|2[0-79]|3[0-46-8]|4[0-7]"]],["(\\d)(\\d{7})","$1 $2",["(?:2|90)4|[67]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[348]|64|79|90"]],["(\\d{2})(\\d{5,7})","$1 $2",["1|28|6[0-35-9]|7[67]|9[2-9]"]]],"0"],SR:["597","00","(?:[2-5]|[6-8]\\d|90)\\d{5}",[6,7],[["(\\d{2})(\\d{2})(\\d{2})","$1-$2-$3",["56"]],["(\\d{3})(\\d{3})","$1-$2",["[2-5]"]],["(\\d{3})(\\d{4})","$1-$2",["[6-9]"]]]],SS:["211","00","[19]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[19]"],"0$1"]],"0"],ST:["239","00","(?:22|9\\d)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[29]"]]]],SV:["503","00","[25-7]\\d{7}|(?:80\\d|900)\\d{4}(?:\\d{4})?",[7,8,11],[["(\\d{3})(\\d{4})","$1 $2",["[89]"]],["(\\d{4})(\\d{4})","$1 $2",["[25-7]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[89]"]]]],SX:["1","011","7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"(5\\d{6})$|1","721$1",0,"721"],SY:["963","00","[1-359]\\d{8}|[1-5]\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-4]|5[1-3]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[59]"],"0$1",1]],"0"],SZ:["268","00","0800\\d{4}|(?:[237]\\d|900)\\d{6}",[8,9],[["(\\d{4})(\\d{4})","$1 $2",["[0237]"]],["(\\d{5})(\\d{4})","$1 $2",["9"]]]],TA:["290","00","8\\d{3}",[4],0,0,0,0,0,0,"8"],TC:["1","011","(?:[58]\\d\\d|649|900)\\d{7}",[10],0,"1",0,"([2-479]\\d{6})$|1","649$1",0,"649"],TD:["235","00|16","(?:22|30|[689]\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[236-9]"]]],0,0,0,0,0,0,0,"00"],TG:["228","00","[279]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[279]"]]]],TH:["66","00[1-9]","(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}",[8,9,10,13],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[13-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],TJ:["992","810","(?:[0-57-9]\\d|66)\\d{7}",[9],[["(\\d{6})(\\d)(\\d{2})","$1 $2 $3",["331","3317"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["44[02-479]|[34]7"]],["(\\d{4})(\\d)(\\d{4})","$1 $2 $3",["3(?:[1245]|3[12])"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["\\d"]]],0,0,0,0,0,0,0,"8~10"],TK:["690","00","[2-47]\\d{3,6}",[4,5,6,7]],TL:["670","00","7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[2-489]|70"]],["(\\d{4})(\\d{4})","$1 $2",["7"]]]],TM:["993","810","(?:[1-6]\\d|71)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["12"],"(8 $1)"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-5]"],"(8 $1)"],["(\\d{2})(\\d{6})","$1 $2",["[67]"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],TN:["216","00","[2-57-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-57-9]"]]]],TO:["676","00","(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}",[5,7],[["(\\d{2})(\\d{3})","$1-$2",["[2-4]|50|6[09]|7[0-24-69]|8[05]"]],["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[5-9]"]]]],TR:["90","00","4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}",[7,10,12,13],[["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["512|8[01589]|90"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5(?:[0-59]|61)","5(?:[0-59]|61[06])","5(?:[0-59]|61[06]1)"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24][1-8]|3[1-9]"],"(0$1)",1],["(\\d{3})(\\d{3})(\\d{6,7})","$1 $2 $3",["80"],"0$1",1]],"0"],TT:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-46-8]\\d{6})$|1","868$1",0,"868"],TV:["688","00","(?:2|7\\d\\d|90)\\d{4}",[5,6,7],[["(\\d{2})(\\d{3})","$1 $2",["2"]],["(\\d{2})(\\d{4})","$1 $2",["90"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],TW:["886","0(?:0[25-79]|19)","[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}",[7,8,9,10,11],[["(\\d{2})(\\d)(\\d{4})","$1 $2 $3",["202"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[258]0"],"0$1"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["[23568]|4(?:0[02-48]|[1-47-9])|7[1-9]","[23568]|4(?:0[2-48]|[1-47-9])|(?:400|7)[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,5})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,0,0,"#"],TZ:["255","00[056]","(?:[25-8]\\d|41|90)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[24]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["5"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[67]"],"0$1"]],"0"],UA:["380","00","[89]\\d{9}|[3-9]\\d{8}",[9,10],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]","6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6[0135689]|7[4-6])|6(?:[12][3-7]|[459])","3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6(?:[015689]|3[02389])|7[4-6])|6(?:[12][3-7]|[459])"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|89|9[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,0,"0~0"],UG:["256","00[057]","800\\d{6}|(?:[29]0|[347]\\d)\\d{7}",[9],[["(\\d{4})(\\d{5})","$1 $2",["202","2024"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[27-9]|4(?:6[45]|[7-9])"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[34]"],"0$1"]],"0"],US:["1","011","[2-9]\\d{9}|3\\d{6}",[10],[["(\\d{3})(\\d{4})","$1-$2",["310"],0,1],["(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",["[2-9]"],0,1,"$1-$2-$3"]],"1",0,0,0,0,0,[["3052(?:0[0-8]|[1-9]\\d)\\d{4}|(?:2742|305[3-9])\\d{6}|(?:472|983)[2-47-9]\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-57-9]|3[1459]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-47-9]|1[02-9]|2[013-79]|3[0-24679]|4[167]|5[0-3]|6[01349]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-57-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|3[016]|4[0156]|5[01679]|6[0-279]|78|8[0-269])|7(?:0[1-46-8]|1[2-9]|2[04-8]|3[0-247]|4[0378]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[0168]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-3589]|8[04-69]))[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"],0,0,0,["305209\\d{4}"]]],UY:["598","0(?:0|1[3-9]\\d)","0004\\d{2,9}|[1249]\\d{7}|2\\d{3,4}|(?:[49]\\d|80)\\d{5}",[4,5,6,7,8,9,10,11,12,13],[["(\\d{4,5})","$1",["21"]],["(\\d{3})(\\d{3,4})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[49]0|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[124]"]],["(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{2,4})","$1 $2 $3 $4",["0"]]],"0",0,0,0,0,0,0,"00"," int. "],UZ:["998","00","(?:20|33|[5-9]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[235-9]"]]]],VA:["39","00","0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}",[6,7,8,9,10,11,12],0,0,0,0,0,0,"06698"],VC:["1","011","(?:[58]\\d\\d|784|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","784$1",0,"784"],VE:["58","00","[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}",[10],[["(\\d{3})(\\d{7})","$1-$2",["[24-689]"],"0$1"]],"0"],VG:["1","011","(?:284|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-578]\\d{6})$|1","284$1",0,"284"],VI:["1","011","[58]\\d{9}|(?:34|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","340$1",0,"340"],VN:["84","00","[12]\\d{9}|[135-9]\\d{8}|[16]\\d{7}|[16-8]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["80"],"0$1",1],["(\\d{4})(\\d{4,6})","$1 $2",["1"],0,1],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["6"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[357-9]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["2[48]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["2"],"0$1",1]],"0"],VU:["678","00","[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}",[5,7],[["(\\d{3})(\\d{4})","$1 $2",["[57-9]"]]]],WF:["681","00","(?:40|72|8\\d{4})\\d{4}|[89]\\d{5}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[47-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],WS:["685","0","(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}",[5,6,7,10],[["(\\d{5})","$1",["[2-5]|6[1-9]"]],["(\\d{3})(\\d{3,7})","$1 $2",["[68]"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],XK:["383","00","2\\d{7,8}|3\\d{7,11}|(?:4\\d\\d|[89]00)\\d{5}",[8,9,10,11,12],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2|39"],"0$1"],["(\\d{2})(\\d{7,10})","$1 $2",["3"],"0$1"]],"0"],YE:["967","00","(?:1|7\\d)\\d{7}|[1-7]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-6]|7(?:[24-6]|8[0-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"],"0$1"]],"0"],YT:["262","00","7093\\d{5}|(?:80|9\\d)\\d{7}|(?:26|63)9\\d{6}",[9],0,"0",0,0,0,0,0,[["269(?:0[0-467]|15|5[0-4]|6\\d|[78]0)\\d{4}"],["(?:639(?:0[0-79]|1[019]|[267]\\d|3[09]|40|5[05-9]|9[04-79])|7093[5-7])\\d{4}"],["80\\d{7}"],0,0,0,0,0,["9(?:(?:39|47)8[01]|769\\d)\\d{4}"]]],ZA:["27","00","[1-79]\\d{8}|8\\d{4,9}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,4})","$1 $2",["8[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["8[1-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["860"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],ZM:["260","00","800\\d{6}|(?:21|[579]\\d|63)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[28]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[579]"],"0$1"]],"0"],ZW:["263","00","2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}",[5,6,7,8,9,10],[["(\\d{3})(\\d{3,5})","$1 $2",["2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]"],"0$1"],["(\\d)(\\d{3})(\\d{2,4})","$1 $2 $3",["[49]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["80"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2","2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)","2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["29[013-9]|39|54"],"0$1"],["(\\d{4})(\\d{3,5})","$1 $2",["(?:25|54)8","258|5483"],"0$1"]],"0"]},nonGeographic:{800:["800",0,"(?:00|[1-9]\\d)\\d{6}",[8],[["(\\d{4})(\\d{4})","$1 $2",["\\d"]]],0,0,0,0,0,0,[0,0,["(?:00|[1-9]\\d)\\d{6}"]]],808:["808",0,"[1-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[1-9]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,0,["[1-9]\\d{7}"]]],870:["870",0,"7\\d{11}|[235-7]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-7]"]]],0,0,0,0,0,0,[0,["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"],0,0,0,0,0,0,["2\\d{8}",[9]]]],878:["878",0,"10\\d{10}",[12],[["(\\d{2})(\\d{5})(\\d{5})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["10\\d{10}"]]],881:["881",0,"6\\d{9}|[0-36-9]\\d{8}",[9,10],[["(\\d)(\\d{3})(\\d{5})","$1 $2 $3",["[0-37-9]"]],["(\\d)(\\d{3})(\\d{5,6})","$1 $2 $3",["6"]]],0,0,0,0,0,0,[0,["6\\d{9}|[0-36-9]\\d{8}"]]],882:["882",0,"[13]\\d{6}(?:\\d{2,5})?|[19]\\d{7}|(?:[25]\\d\\d|4)\\d{7}(?:\\d{2})?",[7,8,9,10,11,12],[["(\\d{2})(\\d{5})","$1 $2",["16|342"]],["(\\d{2})(\\d{6})","$1 $2",["49"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["1[36]|9"]],["(\\d{2})(\\d{4})(\\d{3})","$1 $2 $3",["3[23]"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["16"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|23|3(?:[15]|4[57])|4|51"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["34"]],["(\\d{2})(\\d{4,5})(\\d{5})","$1 $2 $3",["[1-35]"]]],0,0,0,0,0,0,[0,["342\\d{4}|(?:337|49)\\d{6}|(?:3(?:2|47|7\\d{3})|50\\d{3})\\d{7}",[7,8,9,10,12]],0,0,0,["348[57]\\d{7}",[11]],0,0,["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:345\\d|9[89])\\d{6}|(?:10|2(?:3|85\\d)|3(?:[15]|[69]\\d\\d)|4[15-8]|51)\\d{8}"]]],883:["883",0,"(?:[1-4]\\d|51)\\d{6,10}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,8})","$1 $2 $3",["[14]|2[24-689]|3[02-689]|51[24-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["510"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["21"]],["(\\d{4})(\\d{4})(\\d{4})","$1 $2 $3",["51[13]"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[235]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["(?:2(?:00\\d\\d|10)|(?:370[1-9]|51\\d0)\\d)\\d{7}|51(?:00\\d{5}|[24-9]0\\d{4,7})|(?:1[0-79]|2[24-689]|3[02-689]|4[0-4])0\\d{5,9}"]]],888:["888",0,"\\d{11}",[11],[["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3"]],0,0,0,0,0,0,[0,0,0,0,0,0,["\\d{11}"]]],979:["979",0,"[1359]\\d{8}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[1359]"]]],0,0,0,0,0,0,[0,0,0,["[1359]\\d{8}"]]]}};function C9(t,e){var n=Array.prototype.slice.call(e);return n.push(E9),t.apply(this,n)}function Rm(t,e){t=t.split("-"),e=e.split("-");for(var n=t[0].split("."),r=e[0].split("."),i=0;i<3;i++){var s=Number(n[i]),a=Number(r[i]);if(s>a)return 1;if(a>s)return-1;if(!isNaN(s)&&isNaN(a))return 1;if(isNaN(s)&&!isNaN(a))return-1}return t[1]&&e[1]?t[1]>e[1]?1:t[1]<e[1]?-1:0:!t[1]&&e[1]?1:t[1]&&!e[1]?-1:0}var N9={}.constructor;function Ii(t){return t!=null&&t.constructor===N9}function Wi(t){"@babel/helpers - typeof";return Wi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Wi(t)}function Ql(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function I9(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,j9(r.key),r)}}function eu(t,e,n){return e&&I9(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function j9(t){var e=T9(t,"string");return Wi(e)=="symbol"?e:e+""}function T9(t,e){if(Wi(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Wi(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var O9="1.2.0",P9="1.7.35",Lm=" ext. ",R9=/^\d+$/,ht=(function(){function t(e){Ql(this,t),Xw(e),this.metadata=e,Zw.call(this,e)}return eu(t,[{key:"getCountries",value:function(){return Object.keys(this.metadata.countries).filter(function(n){return n!=="001"})}},{key:"getCountryMetadata",value:function(n){return this.metadata.countries[n]}},{key:"nonGeographic",value:function(){if(!(this.v1||this.v2||this.v3))return this.metadata.nonGeographic||this.metadata.nonGeographical}},{key:"hasCountry",value:function(n){return this.getCountryMetadata(n)!==void 0}},{key:"hasCallingCode",value:function(n){if(this.getCountryCodesForCallingCode(n))return!0;if(this.nonGeographic()){if(this.nonGeographic()[n])return!0}else{var r=this.countryCallingCodes()[n];if(r&&r.length===1&&r[0]==="001")return!0}}},{key:"isNonGeographicCallingCode",value:function(n){return this.nonGeographic()?!!this.nonGeographic()[n]:!this.getCountryCodesForCallingCode(n)}},{key:"country",value:function(n){return this.selectNumberingPlan(n)}},{key:"selectNumberingPlan",value:function(n,r){if(n&&R9.test(n)&&(r=n,n=null),n&&n!=="001"){if(!this.hasCountry(n))throw new Error("Unknown country: ".concat(n));this.numberingPlan=new Bm(this.getCountryMetadata(n),this)}else if(r){if(!this.hasCallingCode(r))throw new Error("Unknown calling code: ".concat(r));this.numberingPlan=new Bm(this.getNumberingPlanMetadata(r),this)}else this.numberingPlan=void 0;return this}},{key:"getCountryCodesForCallingCode",value:function(n){var r=this.countryCallingCodes()[n];if(r)return r.length===1&&r[0].length===3?void 0:r}},{key:"getCountryCodeForCallingCode",value:function(n){var r=this.getCountryCodesForCallingCode(n);if(r)return r[0]}},{key:"getNumberingPlanMetadata",value:function(n){var r=this.getCountryCodeForCallingCode(n);if(r)return this.getCountryMetadata(r);if(this.nonGeographic()){var i=this.nonGeographic()[n];if(i)return i}else{var s=this.countryCallingCodes()[n];if(s&&s.length===1&&s[0]==="001")return this.metadata.countries["001"]}}},{key:"countryCallingCode",value:function(){return this.numberingPlan.callingCode()}},{key:"IDDPrefix",value:function(){return this.numberingPlan.IDDPrefix()}},{key:"defaultIDDPrefix",value:function(){return this.numberingPlan.defaultIDDPrefix()}},{key:"nationalNumberPattern",value:function(){return this.numberingPlan.nationalNumberPattern()}},{key:"possibleLengths",value:function(){return this.numberingPlan.possibleLengths()}},{key:"formats",value:function(){return this.numberingPlan.formats()}},{key:"nationalPrefixForParsing",value:function(){return this.numberingPlan.nationalPrefixForParsing()}},{key:"nationalPrefixTransformRule",value:function(){return this.numberingPlan.nationalPrefixTransformRule()}},{key:"leadingDigits",value:function(){return this.numberingPlan.leadingDigits()}},{key:"hasTypes",value:function(){return this.numberingPlan.hasTypes()}},{key:"type",value:function(n){return this.numberingPlan.type(n)}},{key:"ext",value:function(){return this.numberingPlan.ext()}},{key:"countryCallingCodes",value:function(){return this.v1?this.metadata.country_phone_code_to_countries:this.metadata.country_calling_codes}},{key:"chooseCountryByCountryCallingCode",value:function(n){return this.selectNumberingPlan(n)}},{key:"hasSelectedNumberingPlan",value:function(){return this.numberingPlan!==void 0}}])})(),Bm=(function(){function t(e,n){Ql(this,t),this.globalMetadataObject=n,this.metadata=e,Zw.call(this,n.metadata)}return eu(t,[{key:"callingCode",value:function(){return this.metadata[0]}},{key:"getDefaultCountryMetadataForRegion",value:function(){return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode())}},{key:"IDDPrefix",value:function(){if(!(this.v1||this.v2))return this.metadata[1]}},{key:"defaultIDDPrefix",value:function(){if(!(this.v1||this.v2))return this.metadata[12]}},{key:"nationalNumberPattern",value:function(){return this.v1||this.v2?this.metadata[1]:this.metadata[2]}},{key:"possibleLengths",value:function(){if(!this.v1)return this.metadata[this.v2?2:3]}},{key:"_getFormats",value:function(n){return n[this.v1?2:this.v2?3:4]}},{key:"formats",value:function(){var n=this,r=this._getFormats(this.metadata)||this._getFormats(this.getDefaultCountryMetadataForRegion())||[];return r.map(function(i){return new L9(i,n)})}},{key:"nationalPrefix",value:function(){return this.metadata[this.v1?3:this.v2?4:5]}},{key:"_getNationalPrefixFormattingRule",value:function(n){return n[this.v1?4:this.v2?5:6]}},{key:"nationalPrefixFormattingRule",value:function(){return this._getNationalPrefixFormattingRule(this.metadata)||this._getNationalPrefixFormattingRule(this.getDefaultCountryMetadataForRegion())}},{key:"_nationalPrefixForParsing",value:function(){return this.metadata[this.v1?5:this.v2?6:7]}},{key:"nationalPrefixForParsing",value:function(){return this._nationalPrefixForParsing()||this.nationalPrefix()}},{key:"nationalPrefixTransformRule",value:function(){return this.metadata[this.v1?6:this.v2?7:8]}},{key:"_getNationalPrefixIsOptionalWhenFormatting",value:function(){return!!this.metadata[this.v1?7:this.v2?8:9]}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata)||this._getNationalPrefixIsOptionalWhenFormatting(this.getDefaultCountryMetadataForRegion())}},{key:"leadingDigits",value:function(){return this.metadata[this.v1?8:this.v2?9:10]}},{key:"types",value:function(){return this.metadata[this.v1?9:this.v2?10:11]}},{key:"hasTypes",value:function(){return this.types()&&this.types().length===0?!1:!!this.types()}},{key:"type",value:function(n){if(this.hasTypes()&&Dm(this.types(),n))return new D9(Dm(this.types(),n),this)}},{key:"ext",value:function(){return this.v1||this.v2?Lm:this.metadata[13]||Lm}}])})(),L9=(function(){function t(e,n){Ql(this,t),this._format=e,this.metadata=n}return eu(t,[{key:"pattern",value:function(){return this._format[0]}},{key:"format",value:function(){return this._format[1]}},{key:"leadingDigitsPatterns",value:function(){return this._format[2]||[]}},{key:"nationalPrefixFormattingRule",value:function(){return this._format[3]||this.metadata.nationalPrefixFormattingRule()}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return!!this._format[4]||this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"nationalPrefixIsMandatoryWhenFormattingInNationalFormat",value:function(){return this.usesNationalPrefix()&&!this.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"usesNationalPrefix",value:function(){return!!(this.nationalPrefixFormattingRule()&&!B9.test(this.nationalPrefixFormattingRule()))}},{key:"internationalFormat",value:function(){return this._format[5]||this.format()}}])})(),B9=/^\(?\$1\)?$/,D9=(function(){function t(e,n){Ql(this,t),this.type=e,this.metadata=n}return eu(t,[{key:"pattern",value:function(){return this.metadata.v1?this.type:this.type[0]}},{key:"possibleLengths",value:function(){if(!this.metadata.v1)return this.type[1]||this.metadata.possibleLengths()}}])})();function Dm(t,e){switch(e){case"FIXED_LINE":return t[0];case"MOBILE":return t[1];case"TOLL_FREE":return t[2];case"PREMIUM_RATE":return t[3];case"PERSONAL_NUMBER":return t[4];case"VOICEMAIL":return t[5];case"UAN":return t[6];case"PAGER":return t[7];case"VOIP":return t[8];case"SHARED_COST":return t[9]}}function Xw(t){if(!t)throw new Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");if(!Ii(t)||!Ii(t.countries))throw new Error("[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got ".concat(Ii(t)?"an object of shape: { "+Object.keys(t).join(", ")+" }":"a "+U9(t)+": "+t,"."))}var U9=function(e){return Wi(e)};function Tf(t,e){if(e=new ht(e),e.hasCountry(t))return e.selectNumberingPlan(t).countryCallingCode();throw new Error("Unknown country: ".concat(t))}function M9(t,e){return e.countries.hasOwnProperty(t)}function Zw(t){var e=t.version;typeof e=="number"?(this.v1=e===1,this.v2=e===2,this.v3=e===3,this.v4=e===4):e?Rm(e,O9)===-1?this.v2=!0:Rm(e,P9)===-1?this.v3=!0:this.v4=!0:this.v1=!0}function Of(t,e,n){return q9(t,e,void 0,n)}function q9(t,e,n,r){e&&(r=new ht(r.metadata),r.selectNumberingPlan(e));var i=r.type(n),s=i&&i.possibleLengths()||r.possibleLengths();if(!s)return"IS_POSSIBLE";var a=t.length,c=s[0];return c===a?"IS_POSSIBLE":c>a?"TOO_SHORT":s[s.length-1]<a?"TOO_LONG":s.indexOf(a,1)>=0?"IS_POSSIBLE":"INVALID_LENGTH"}function F9(t,e,n){if(e===void 0&&(e={}),n=new ht(n),e.v2){if(!t.countryCallingCode)throw new Error("Invalid phone number object passed");n.selectNumberingPlan(t.countryCallingCode)}else{if(!t.phone)return!1;if(t.country){if(!n.hasCountry(t.country))throw new Error("Unknown country: ".concat(t.country));n.selectNumberingPlan(t.country)}else{if(!t.countryCallingCode)throw new Error("Invalid phone number object passed");n.selectNumberingPlan(t.countryCallingCode)}}if(n.possibleLengths())return Yw(t.phone||t.nationalNumber,t.country,n);if(t.countryCallingCode&&n.isNonGeographicCallingCode(t.countryCallingCode))return!0;throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.')}function Yw(t,e,n){return Of(t,e,n)==="IS_POSSIBLE"}function Vn(t,e){return t=t||"",new RegExp("^(?:"+e+")$").test(t)}function H9(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=V9(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
83
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function V9(t,e){if(t){if(typeof t=="string")return Um(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Um(t,e):void 0}}function Um(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}var K9=["MOBILE","PREMIUM_RATE","TOLL_FREE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL"];function Pf(t,e,n){if(e=e||{},!(!t.country&&!t.countryCallingCode)){n=new ht(n),n.selectNumberingPlan(t.country,t.countryCallingCode);var r=e.v2?t.nationalNumber:t.phone;if(Vn(r,n.nationalNumberPattern())){if(Iu(r,"FIXED_LINE",n))return n.type("MOBILE")&&n.type("MOBILE").pattern()===""||!n.type("MOBILE")||Iu(r,"MOBILE",n)?"FIXED_LINE_OR_MOBILE":"FIXED_LINE";for(var i=H9(K9),s;!(s=i()).done;){var a=s.value;if(Iu(r,a,n))return a}}}}function Iu(t,e,n){return e=n.type(e),!e||!e.pattern()||e.possibleLengths()&&e.possibleLengths().indexOf(t.length)<0?!1:Vn(t,e.pattern())}function G9(t,e,n){if(e=e||{},n=new ht(n),n.selectNumberingPlan(t.country,t.countryCallingCode),n.hasTypes())return Pf(t,e,n.metadata)!==void 0;var r=e.v2?t.nationalNumber:t.phone;return Vn(r,n.nationalNumberPattern())}function W9(t,e,n){var r=new ht(n),i=r.getCountryCodesForCallingCode(t);return i?i.filter(function(s){return J9(e,s,n)}):[]}function J9(t,e,n){var r=new ht(n);return r.selectNumberingPlan(e),r.numberingPlan.possibleLengths().indexOf(t.length)>=0}var Rf=2,X9=17,Z9=3,an="0-90-9٠-٩۰-۹",Y9="-‐-―−ー-",Q9="//",eS="..",tS=" ",nS="()()[]\\[\\]",rS="~⁓∼~",qc="".concat(Y9).concat(Q9).concat(eS).concat(tS).concat(nS).concat(rS),Lf="++",iS=new RegExp("(["+an+"])");function oS(t,e,n,r){if(e){var i=new ht(r);i.selectNumberingPlan(e,n);var s=new RegExp(i.IDDPrefix());if(t.search(s)===0){t=t.slice(t.match(s)[0].length);var a=t.match(iS);if(!(a&&a[1]!=null&&a[1].length>0&&a[1]==="0"))return t}}}function sS(t,e){if(t&&e.numberingPlan.nationalPrefixForParsing()){var n=new RegExp("^(?:"+e.numberingPlan.nationalPrefixForParsing()+")"),r=n.exec(t);if(r){var i,s,a=r.length-1,c=a>0&&r[a];if(e.nationalPrefixTransformRule()&&c)i=t.replace(n,e.nationalPrefixTransformRule()),a>1&&(s=r[1]);else{var l=r[0];i=t.slice(l.length),c&&(s=r[1])}var u;if(c){var d=t.indexOf(r[1]),f=t.slice(0,d);f===e.numberingPlan.nationalPrefix()&&(u=e.numberingPlan.nationalPrefix())}else u=r[0];return{nationalNumber:i,nationalPrefix:u,carrierCode:s}}}return{nationalNumber:t}}function aS(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=cS(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
84
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cS(t,e){if(t){if(typeof t=="string")return Mm(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Mm(t,e):void 0}}function Mm(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function lS(t,e){var n=e.countries,r=e.metadata;r=new ht(r);for(var i=aS(n),s;!(s=i()).done;){var a=s.value;if(r.selectNumberingPlan(a),r.leadingDigits()){if(t&&t.search(r.leadingDigits())===0)return a}else if(Pf({phone:t,country:a},void 0,r.metadata))return a}}function Qw(t,e){var n=e.nationalNumber,r=e.metadata,i=r.getCountryCodesForCallingCode(t);if(i)return i.length===1?i[0]:lS(n,{countries:i,metadata:r.metadata})}function t0(t,e,n){var r=sS(t,n),i=r.carrierCode,s=r.nationalNumber;if(s!==t){if(!uS(t,s,n))return{nationalNumber:t};if(n.numberingPlan.possibleLengths()&&(e||(e=Qw(n.numberingPlan.callingCode(),{nationalNumber:s,metadata:n})),!dS(s,e,n)))return{nationalNumber:t}}return{nationalNumber:s,carrierCode:i}}function uS(t,e,n){return!(Vn(t,n.nationalNumberPattern())&&!Vn(e,n.nationalNumberPattern()))}function dS(t,e,n){switch(Of(t,e,n)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}function pS(t,e,n,r,i){var s=n?Tf(n,i):r;if(t.indexOf(s)===0){i=new ht(i),i.selectNumberingPlan(n,s);var a=t.slice(s.length),c=t0(a,e,i),l=c.nationalNumber,u=t0(t,e,i),d=u.nationalNumber;if(!Vn(d,i.nationalNumberPattern())&&Vn(l,i.nationalNumberPattern())||Of(d,e,i)==="TOO_LONG")return{countryCallingCode:s,number:a}}return{number:t}}function ev(t,e,n,r,i){if(!t)return{};var s;if(t[0]!=="+"){var a=oS(t,n,r,i);if(a&&a!==t)s=!0,t="+"+a;else{if(n||r){var c=pS(t,e,n,r,i),l=c.countryCallingCode,u=c.number;if(l)return{countryCallingCodeSource:"FROM_NUMBER_WITHOUT_PLUS_SIGN",countryCallingCode:l,number:u}}return{number:t}}}if(t[1]==="0")return{};i=new ht(i);for(var d=2;d-1<=Z9&&d<=t.length;){var f=t.slice(1,d);if(i.hasCallingCode(f))return i.selectNumberingPlan(f),{countryCallingCodeSource:s?"FROM_NUMBER_WITH_IDD":"FROM_NUMBER_WITH_PLUS_SIGN",countryCallingCode:f,number:t.slice(d)};d++}return{}}function fS(t){return t.replace(new RegExp("[".concat(qc,"]+"),"g")," ").trim()}var hS=/(\$\d)/;function gS(t,e,n){var r=n.useInternationalFormat,i=n.withNationalPrefix,s=t.replace(new RegExp(e.pattern()),r?e.internationalFormat():i&&e.nationalPrefixFormattingRule()?e.format().replace(hS,e.nationalPrefixFormattingRule()):e.format());return r?fS(s):s}var mS=/^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;function _S(t,e,n){var r=new ht(n);if(r.selectNumberingPlan(t,e),r.defaultIDDPrefix())return r.defaultIDDPrefix();if(mS.test(r.IDDPrefix()))return r.IDDPrefix()}var yS=";ext=",hi=function(e){return"([".concat(an,"]{1,").concat(e,"})")};function tv(t){var e="20",n="15",r="9",i="6",s="[ \\t,]*",a="[:\\..]?[ \\t,-]*",c="#?",l="(?:e?xt(?:ensi(?:ó?|ó))?n?|e?xtn?|доб|anexo)",u="(?:[xx##~~]|int|int)",d="[- ]+",f="[ \\t]*",p="(?:,{2}|;)",h=yS+hi(e),m=s+l+a+hi(e)+c,y=s+u+a+hi(r)+c,w=d+hi(i)+"#",_=f+p+a+hi(n)+c,k=f+"(?:,)+"+a+hi(r)+c;return h+"|"+m+"|"+y+"|"+w+"|"+_+"|"+k}var bS="["+an+"]{"+Rf+"}",wS="["+Lf+"]{0,1}(?:["+qc+"]*["+an+"]){3,}["+qc+an+"]*",vS=new RegExp("^["+Lf+"]{0,1}(?:["+qc+"]*["+an+"]){1,2}$","i"),xS=wS+"(?:"+tv()+")?",kS=new RegExp("^"+bS+"$|^"+xS+"$","i");function $S(t){return t.length>=Rf&&kS.test(t)}function SS(t){return vS.test(t)}function zS(t){var e=t.number,n=t.ext;if(!e)return"";if(e[0]!=="+")throw new Error('"formatRFC3966()" expects "number" to be in E.164 format.');return"tel:".concat(e).concat(n?";ext="+n:"")}var qm={formatExtension:function(e,n,r){return"".concat(e).concat(r.ext()).concat(n)}};function AS(t,e,n,r){if(n?n=NS({},qm,n):n=qm,r=new ht(r),t.country&&t.country!=="001"){if(!r.hasCountry(t.country))throw new Error("Unknown country: ".concat(t.country));r.selectNumberingPlan(t.country)}else if(t.countryCallingCode)r.selectNumberingPlan(t.countryCallingCode);else return t.phone||"";var i=r.countryCallingCode(),s=n.v2?t.nationalNumber:t.phone,a;switch(e){case"NATIONAL":return s?(a=Fc(s,t.carrierCode,"NATIONAL",r,n),ju(a,t.ext,r,n.formatExtension)):"";case"INTERNATIONAL":return s?(a=Fc(s,null,"INTERNATIONAL",r,n),a="+".concat(i," ").concat(a),ju(a,t.ext,r,n.formatExtension)):"+".concat(i);case"E.164":return"+".concat(i).concat(s);case"RFC3966":return zS({number:"+".concat(i).concat(s),ext:t.ext});case"IDD":if(!n.fromCountry)return;var c=CS(s,t.carrierCode,i,n.fromCountry,r);return ju(c,t.ext,r,n.formatExtension);default:throw new Error('Unknown "format" argument passed to "formatNumber()": "'.concat(e,'"'))}}function Fc(t,e,n,r,i){var s=ES(r.formats(),t);return s?gS(t,s,{useInternationalFormat:n==="INTERNATIONAL",withNationalPrefix:!(s.nationalPrefixIsOptionalWhenFormattingInNationalFormat()&&i&&i.nationalPrefix===!1)}):t}function ES(t,e){return IS(t,function(n){if(n.leadingDigitsPatterns().length>0){var r=n.leadingDigitsPatterns()[n.leadingDigitsPatterns().length-1];if(e.search(r)!==0)return!1}return Vn(e,n.pattern())})}function ju(t,e,n,r){return e?r(t,e,n):t}function CS(t,e,n,r,i){var s=Tf(r,i.metadata);if(s===n){var a=Fc(t,e,"NATIONAL",i);return n==="1"?n+" "+a:a}var c=_S(r,void 0,i.metadata);if(c)return"".concat(c," ").concat(n," ").concat(Fc(t,null,"INTERNATIONAL",i))}function NS(){for(var t=1,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];for(;t<n.length;){if(n[t])for(var i in n[t])n[0][i]=n[t][i];t++}return n[0]}function IS(t,e){for(var n=0;n<t.length;){if(e(t[n]))return t[n];n++}}function ms(t){"@babel/helpers - typeof";return ms=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ms(t)}function Fm(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Hm(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Fm(Object(n),!0).forEach(function(r){jS(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Fm(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function jS(t,e,n){return(e=nv(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function TS(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function OS(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,nv(r.key),r)}}function PS(t,e,n){return e&&OS(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function nv(t){var e=RS(t,"string");return ms(e)=="symbol"?e:e+""}function RS(t,e){if(ms(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(ms(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var LS=(function(){function t(e,n,r){if(TS(this,t),!e)throw new TypeError("First argument is required");if(typeof e!="string")throw new TypeError("First argument must be a string");if(e[0]==="+"&&!n)throw new TypeError("`metadata` argument not passed");if(Ii(n)&&Ii(n.countries)){r=n;var i=e;if(!US.test(i))throw new Error('Invalid `number` argument passed: must consist of a "+" followed by digits');var s=ev(i,void 0,void 0,void 0,r),a=s.countryCallingCode,c=s.number;if(n=c,e=a,!n)throw new Error("Invalid `number` argument passed: too short")}if(!n)throw new TypeError("`nationalNumber` argument is required");if(typeof n!="string")throw new TypeError("`nationalNumber` argument must be a string");Xw(r);var l=DS(e,r),u=l.country,d=l.countryCallingCode;this.country=u,this.countryCallingCode=d,this.nationalNumber=n,this.number="+"+this.countryCallingCode+this.nationalNumber,this.getMetadata=function(){return r}}return PS(t,[{key:"setExt",value:function(n){this.ext=n}},{key:"getPossibleCountries",value:function(){return this.country?[this.country]:W9(this.countryCallingCode,this.nationalNumber,this.getMetadata())}},{key:"isPossible",value:function(){return F9(this,{v2:!0},this.getMetadata())}},{key:"isValid",value:function(){return G9(this,{v2:!0},this.getMetadata())}},{key:"isNonGeographic",value:function(){var n=new ht(this.getMetadata());return n.isNonGeographicCallingCode(this.countryCallingCode)}},{key:"isEqual",value:function(n){return this.number===n.number&&this.ext===n.ext}},{key:"getType",value:function(){return Pf(this,{v2:!0},this.getMetadata())}},{key:"format",value:function(n,r){return AS(this,n,r?Hm(Hm({},r),{},{v2:!0}):{v2:!0},this.getMetadata())}},{key:"formatNational",value:function(n){return this.format("NATIONAL",n)}},{key:"formatInternational",value:function(n){return this.format("INTERNATIONAL",n)}},{key:"getURI",value:function(n){return this.format("RFC3966",n)}}])})(),BS=function(e){return/^[A-Z]{2}$/.test(e)};function DS(t,e){var n,r,i=new ht(e);return BS(t)?(n=t,i.selectNumberingPlan(n),r=i.countryCallingCode()):r=t,{country:n,countryCallingCode:r}}var US=/^\+\d+$/;function n0(t){"@babel/helpers - typeof";return n0=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n0(t)}function MS(t,e,n){return Object.defineProperty(t,"prototype",{writable:!1}),t}function qS(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function FS(t,e,n){return e=ys(e),HS(t,Bf()?Reflect.construct(e,n||[],ys(t).constructor):e.apply(t,n))}function HS(t,e){if(e&&(n0(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return VS(t)}function VS(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function KS(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_s(t,e)}function r0(t){var e=typeof Map=="function"?new Map:void 0;return r0=function(r){if(r===null||!WS(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(e!==void 0){if(e.has(r))return e.get(r);e.set(r,i)}function i(){return GS(r,arguments,ys(this).constructor)}return i.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),_s(i,r)},r0(t)}function GS(t,e,n){if(Bf())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var i=new(t.bind.apply(t,r));return n&&_s(i,n.prototype),i}function Bf(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Bf=function(){return!!t})()}function WS(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}function _s(t,e){return _s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},_s(t,e)}function ys(t){return ys=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ys(t)}var Pn=(function(t){function e(n){var r;return qS(this,e),r=FS(this,e,[n]),Object.setPrototypeOf(r,e.prototype),r.name=r.constructor.name,r}return KS(e,t),MS(e)})(r0(Error)),Vm=new RegExp("(?:"+tv()+")$","i");function JS(t){var e=t.search(Vm);if(e<0)return{};for(var n=t.slice(0,e),r=t.match(Vm),i=1;i<r.length;){if(r[i])return{number:n,ext:r[i]};i++}}var XS={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9"};function ZS(t){return XS[t]}function YS(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=QS(t))||e){n&&(t=n);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
85
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function QS(t,e){if(t){if(typeof t=="string")return Km(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Km(t,e):void 0}}function Km(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Gm(t){for(var e="",n=YS(t.split("")),r;!(r=n()).done;){var i=r.value;e+=e7(i,e)||""}return e}function e7(t,e,n){return t==="+"?e?void 0:"+":ZS(t)}var rv="+",t7="[\\-\\.\\(\\)]?",Wm="(["+an+"]|"+t7+")",n7="^\\"+rv+Wm+"*["+an+"]"+Wm+"*$",r7=new RegExp(n7,"g"),i0=an,i7="["+i0+"]+((\\-)*["+i0+"])*",o7="a-zA-Z",s7="["+o7+"]+((\\-)*["+i0+"])*",a7="^("+i7+"\\.)*"+s7+"\\.?$",c7=new RegExp(a7,"g"),Jm="tel:",o0=";phone-context=",l7=";isub=";function u7(t){var e=t.indexOf(o0);if(e<0)return null;var n=e+o0.length;if(n>=t.length)return"";var r=t.indexOf(";",n);return r>=0?t.substring(n,r):t.substring(n)}function d7(t){return t===null?!0:t.length===0?!1:r7.test(t)||c7.test(t)}function p7(t,e){var n=e.extractFormattedPhoneNumber,r=u7(t);if(!d7(r))throw new Pn("NOT_A_NUMBER");var i;if(r===null)i=n(t)||"";else{i="",r.charAt(0)===rv&&(i+=r);var s=t.indexOf(Jm),a;s>=0?a=s+Jm.length:a=0;var c=t.indexOf(o0);i+=t.substring(a,c)}var l=i.indexOf(l7);if(l>0&&(i=i.substring(0,l)),i!=="")return i}var f7=250,h7=new RegExp("["+Lf+an+"]"),g7=new RegExp("[^"+an+"#]+$");function m7(t,e,n){if(e=e||{},n=new ht(n),e.defaultCountry&&!n.hasCountry(e.defaultCountry))throw e.v2?new Pn("INVALID_COUNTRY"):new Error("Unknown country: ".concat(e.defaultCountry));var r=y7(t,e.v2,e.extract),i=r.number,s=r.ext,a=r.error;if(!i){if(e.v2)throw a==="TOO_SHORT"?new Pn("TOO_SHORT"):new Pn("NOT_A_NUMBER");return{}}var c=w7(i,e.defaultCountry,e.defaultCallingCode,n),l=c.country,u=c.nationalNumber,d=c.countryCallingCode,f=c.countryCallingCodeSource,p=c.carrierCode;if(!n.hasSelectedNumberingPlan()){if(e.v2)throw new Pn("INVALID_COUNTRY");return{}}if(!u||u.length<Rf){if(e.v2)throw new Pn("TOO_SHORT");return{}}if(u.length>X9){if(e.v2)throw new Pn("TOO_LONG");return{}}if(e.v2){var h=new LS(d,u,n.metadata);return l&&(h.country=l),p&&(h.carrierCode=p),s&&(h.ext=s),h.__countryCallingCodeSource=f,h}var m=(e.extended?n.hasSelectedNumberingPlan():l)?Vn(u,n.nationalNumberPattern()):!1;return e.extended?{country:l,countryCallingCode:d,carrierCode:p,valid:m,possible:m?!0:!!(e.extended===!0&&n.possibleLengths()&&Yw(u,l,n)),phone:u,ext:s}:m?b7(l,u,s):{}}function _7(t,e,n){if(t){if(t.length>f7){if(n)throw new Pn("TOO_LONG");return}if(e===!1)return t;var r=t.search(h7);if(!(r<0))return t.slice(r).replace(g7,"")}}function y7(t,e,n){var r=p7(t,{extractFormattedPhoneNumber:function(a){return _7(a,n,e)}});if(!r)return{};if(!$S(r))return SS(r)?{error:"TOO_SHORT"}:{};var i=JS(r);return i.ext?i:{number:r}}function b7(t,e,n){var r={country:t,phone:e};return n&&(r.ext=n),r}function w7(t,e,n,r){var i=ev(Gm(t),void 0,e,n,r.metadata),s=i.countryCallingCodeSource,a=i.countryCallingCode,c=i.number,l;if(a)r.selectNumberingPlan(a);else if(c&&(e||n))r.selectNumberingPlan(e,n),e&&(l=e),a=n||Tf(e,r.metadata);else return{};if(!c)return{countryCallingCodeSource:s,countryCallingCode:a};var u=t0(Gm(c),l,r),d=u.nationalNumber,f=u.carrierCode,p=Qw(a,{nationalNumber:d,metadata:r});return p&&(l=p,p==="001"||r.selectNumberingPlan(l)),{country:l,countryCallingCode:a,countryCallingCodeSource:s,nationalNumber:d,carrierCode:f}}function bs(t){"@babel/helpers - typeof";return bs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bs(t)}function Xm(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Zm(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Xm(Object(n),!0).forEach(function(r){v7(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Xm(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function v7(t,e,n){return(e=x7(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function x7(t){var e=k7(t,"string");return bs(e)=="symbol"?e:e+""}function k7(t,e){if(bs(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(bs(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function $7(t,e,n){return m7(t,Zm(Zm({},e),{},{v2:!0}),n)}function ws(t){"@babel/helpers - typeof";return ws=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ws(t)}function Ym(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function S7(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Ym(Object(n),!0).forEach(function(r){z7(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ym(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function z7(t,e,n){return(e=A7(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function A7(t){var e=E7(t,"string");return ws(e)=="symbol"?e:e+""}function E7(t,e){if(ws(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(ws(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function C7(t,e){return T7(t)||j7(t,e)||I7(t,e)||N7()}function N7(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
86
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function I7(t,e){if(t){if(typeof t=="string")return Qm(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Qm(t,e):void 0}}function Qm(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function j7(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,s,a,c=[],l=!0,u=!1;try{if(s=(n=n.call(t)).next,e!==0)for(;!(l=(r=s.call(n)).done)&&(c.push(r.value),c.length!==e);l=!0);}catch(d){u=!0,i=d}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return c}}function T7(t){if(Array.isArray(t))return t}function O7(t){var e=Array.prototype.slice.call(t),n=C7(e,4),r=n[0],i=n[1],s=n[2],a=n[3],c,l,u;if(typeof r=="string")c=r;else throw new TypeError("A text for parsing must be a string.");if(!i||typeof i=="string")a?(l=s,u=a):(l=void 0,u=s),i&&(l=S7({defaultCountry:i},l));else if(Ii(i))s?(l=i,u=s):u=i;else throw new Error("Invalid second argument: ".concat(i));return{text:c,options:l,metadata:u}}function vs(t){"@babel/helpers - typeof";return vs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vs(t)}function e_(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function t_(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?e_(Object(n),!0).forEach(function(r){P7(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):e_(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function P7(t,e,n){return(e=R7(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function R7(t){var e=L7(t,"string");return vs(e)=="symbol"?e:e+""}function L7(t,e){if(vs(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(vs(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function B7(t,e,n){e&&e.defaultCountry&&!M9(e.defaultCountry,n)&&(e=t_(t_({},e),{},{defaultCountry:void 0}));try{return $7(t,e,n)}catch(r){if(!(r instanceof Pn))throw r}}function D7(){var t=O7(arguments),e=t.text,n=t.options,r=t.metadata;return B7(e,n,r)}function U7(){return C9(D7,arguments)}function tu(t,e="US"){const n=t.trim();if(n.includes("@")){const r=n.toLowerCase(),i=/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(r);return{connectionType:"email",normalized:i?r:null,isValid:i,provider:"email"}}else if(/^\+?\d[\d\s\-().]*$/.test(n)){const r=U7(n,{defaultCountry:e});return r&&r.isValid()?{connectionType:"sms",normalized:r.number,isValid:!0,provider:"sms"}:{connectionType:"sms",normalized:null,isValid:!1,provider:"sms"}}else return{connectionType:"username",normalized:n,isValid:!0,provider:"auth2"}}function Df(t){let e=t.trim();e.startsWith("[")&&e.endsWith("]")&&(e=e.slice(1,-1));const n=e.indexOf("%");return n!==-1&&(e=e.slice(0,n)),e}function M7(t){const n=Df(t).split(".");return n.length!==4?!1:n.every(r=>/^\d+$/.test(r)&&Number(r)>=0&&Number(r)<=255)}function q7(t){const e=Df(t);if(e.length<2||e.indexOf(":")===-1||!/^[0-9a-fA-F:.]+$/.test(e))return!1;const n=e.split(":");return e.includes("::")?n.length<=8:n.length===8}function F7(t){let e=t.trim();const n=/^\[([^\]]+)\](?::\d+)?$/,r=e.match(n);if(r&&r[1])return r[1];const i=e.lastIndexOf(":");if(i!==-1){const s=e.slice(0,i),a=e.slice(i+1);/^[0-9.]+$/.test(s)&&/^\d+$/.test(a)&&(e=s)}return e}function n_(t){if(!t)return null;const e=Df(F7(t));return M7(e)?{family:4,normalized:e}:q7(e)?{family:6,normalized:e.toLowerCase()}:null}function r_(t){if(t.includes("::")){let[e,n]=t.split("::"),r=e?e.split(":").filter(Boolean):[],i=n?n.split(":").filter(Boolean):[],s=8-(r.length+i.length);return[...r.map(a=>a.toLowerCase()||"0"),...Array(s).fill("0"),...i.map(a=>a.toLowerCase()||"0")]}else return t.split(":").map(e=>e.toLowerCase()||"0")}function H7(t,e,n=!0){const r=n_(t),i=n_(e);if(!r||!i||r.family!==i.family)return!1;if(r.family===4)return r.normalized===i.normalized;const s=r_(r.normalized),a=r_(i.normalized);return n?s.length===8&&a.length===8&&s.join(":")===a.join(":"):s.slice(0,4).join(":")===a.slice(0,4).join(":")}class Qr extends Error{location;status;constructor(e,n=302){super(`Redirect to ${e}`),this.name=Qr.name,this.location=e,this.status=n}}const V7=o.z.object({client_id:o.z.string(),username:o.z.string().transform(t=>t.toLowerCase()),otp:o.z.string(),authParams:Yo.optional(),enforceIpCheck:o.z.boolean().optional().default(!1)});async function iv(t,{client_id:e,username:n,otp:r,authParams:i,enforceIpCheck:s=!1}){const a=t.get("ip"),c=t.get("countryCode"),{connectionType:l,normalized:u}=tu(n,c);if(!u)throw new X(400,{message:"Invalid username format"});const d=await t.env.data.legacyClients.get(e);if(!d)throw new X(403,{message:"Client not found"});const{env:f}=t,p=await f.data.codes.get(d.tenant.id,r,"otp");if(!p)throw new X(400,{message:ue("code_invalid")});if(p.expires_at<new Date().toISOString())throw new X(400,{message:ue("code_expired")});if(p.used_at)throw new X(400,{message:ue("code_used")});const h=await f.data.loginSessions.get(d.tenant.id,p.login_id);if(!h||h.authParams.username!==n)throw new X(400,{message:"Code not found or expired"});if(s&&h.ip&&a&&!H7(h.ip,a))throw new Qr(`${it(t.env)}invalid-session?state=${h.id}`);const m=await nl(t,{client:d,username:u,provider:l,connection:l,isSocial:!1,ip:t.var.ip});return await f.data.codes.used(d.tenant.id,r),{user:m,client:d,loginSession:h,session_id:h.session_id,authParams:{...h.authParams,...i||{}}}}async function Uf(t,e){const n=await iv(t,e);return sn(t,{authParams:n.authParams,client:n.client,user:n.user,loginSession:n.loginSession,authStrategy:{strategy:"email",strategy_type:"passwordless"}})}const i_=o.z.object({client_id:o.z.string().optional(),client_secret:o.z.string().optional()}),o_=o.z.union([Jw.extend(i_.shape),o.z.object({grant_type:o.z.literal("authorization_code"),client_id:o.z.string(),code:o.z.string(),redirect_uri:o.z.string(),code_verifier:o.z.string().min(43).max(128),organization:o.z.string().optional()}),o.z.object({grant_type:o.z.literal("authorization_code"),code:o.z.string(),redirect_uri:o.z.string().optional(),organization:o.z.string().optional(),...i_.shape}),o.z.object({grant_type:o.z.literal("refresh_token"),client_id:o.z.string().optional(),refresh_token:o.z.string(),redirect_uri:o.z.string().optional(),client_secret:o.z.string().optional()}),o.z.object({grant_type:o.z.literal("http://auth0.com/oauth/grant-type/passwordless/otp"),client_id:o.z.string(),username:o.z.string(),otp:o.z.string(),realm:o.z.enum(["email","sms"])})]);function K7(t){if(!t)return{};const[e,n]=t.split(" ");if(e?.toLowerCase()==="basic"&&n){const[r,i]=atob(n).split(":");return{client_id:r,client_secret:i}}return{}}const G7=new o.OpenAPIHono().openapi(o.createRoute({tags:["oauth2"],method:"post",path:"/",request:{body:{content:{"application/x-www-form-urlencoded":{schema:o_},"application/json":{schema:o_}}}},responses:{200:{content:{"application/json":{schema:z0}},description:"Tokens"},302:{description:"Redirect for further user interaction (e.g., MFA, consent).",headers:o.z.object({Location:o.z.string().url()}).openapi({})},400:{description:"Bad Request - The request was malformed or invalid.",content:{"application/json":{schema:o.z.object({error:o.z.string(),error_description:o.z.string().optional()})}}},401:{description:"Unauthorized - Client authentication failed.",content:{"application/json":{schema:o.z.object({error:o.z.string(),error_description:o.z.string().optional()})}}},403:{description:"Forbidden - User is not a member of the required organization.",content:{"application/json":{schema:o.z.object({error:o.z.string(),error_description:o.z.string().optional()})}}}}}),async t=>{const n=(t.req.header("Content-Type")||"").includes("application/json")?t.req.valid("json"):t.req.valid("form"),r=K7(t.req.header("Authorization")),i={...n,...r};if(!i.client_id)throw new I(400,{message:"client_id is required"});t.set("client_id",i.client_id);let s;switch(n.grant_type){case Xt.AuthorizationCode:s=await S9(t,$9.parse(i));break;case Xt.ClientCredential:s=await k9(t,Jw.parse(i));break;case Xt.RefreshToken:s=await A9(t,z9.parse(i));break;case Xt.OTP:s=await iv(t,V7.parse(i));break;default:return t.json({error:"unsupported_grant_type",error_description:"Grant type not implemented"},400)}const a=new Headers;if(s.session_id){const u=tc(s.client.tenant.id,s.session_id,t.var.host||"");a.set("Set-Cookie",u)}let c=[];if(s.authParams.audience)try{let u;if(n.grant_type===Xt.ClientCredential)u=await nc(t,{grantType:Xt.ClientCredential,tenantId:s.client.tenant.id,clientId:s.client.client_id,audience:s.authParams.audience,requestedScopes:s.authParams.scope?.split(" ")||[],organizationId:s.organization?.id});else{if(!s.user?.user_id)throw new X(400,{error:"invalid_request",error_description:"User ID is required for user-based grants"});u=await nc(t,{grantType:n.grant_type,tenantId:s.client.tenant.id,userId:s.user.user_id,clientId:s.client.client_id,audience:s.authParams.audience,requestedScopes:s.authParams.scope?.split(" ")||[],organizationId:s.organization?.id})}s.authParams.scope=u.scopes.join(" "),c=u.permissions}catch(u){if(u instanceof I)throw u;console.error("Error calculating scopes and permissions:",u)}const l=await Yc(t,{...s,grantType:n.grant_type,permissions:c.length>0?c:void 0});return t.json(l,{headers:a})}),Zn={TOO_SHORT:"password_too_short",MISSING_LOWERCASE:"password_missing_lowercase",MISSING_UPPERCASE:"password_missing_uppercase",MISSING_NUMBER:"password_missing_number",MISSING_SPECIAL:"password_missing_special",REUSED:"password_reused",CONTAINS_PERSONAL_INFO:"password_contains_personal_info",CONTAINS_FORBIDDEN_WORD:"password_contains_forbidden_word"};class gn extends Error{code;params;constructor(e,n,r){super(n),this.code=e,this.params=r,this.name="PasswordPolicyError"}}async function Mf(t,e){const{newPassword:n,userData:r,data:i,tenantId:s,userId:a}=e,c=t.passwordPolicy!==void 0||t.password_complexity_options!==void 0||t.password_history!==void 0||t.password_no_personal_info!==void 0||t.password_dictionary!==void 0,l=c?t.passwordPolicy:"good",u=c?t.password_complexity_options?.min_length:8;if(u&&n.length<u)throw new gn(Zn.TOO_SHORT,`Password must be at least ${u} characters`,{minLength:u});if(l&&l!=="none"&&l==="good"){if(!/[a-z]/.test(n))throw new gn(Zn.MISSING_LOWERCASE,"Password must contain at least one lowercase letter");if(!/[A-Z]/.test(n))throw new gn(Zn.MISSING_UPPERCASE,"Password must contain at least one uppercase letter");if(!/\d/.test(n))throw new gn(Zn.MISSING_NUMBER,"Password must contain at least one number");if(!/[^A-Za-z0-9]/.test(n))throw new gn(Zn.MISSING_SPECIAL,"Password must contain at least one special character")}if(t.password_history?.enable){const d=t.password_history.size||5,f=await i.passwords.list(s,a,d);for(const p of f)if(await ar.compare(n,p.password))throw new gn(Zn.REUSED,"Password was used recently and cannot be reused",{historySize:d})}if(t.password_no_personal_info?.enable&&r&&[r.email,r.name].filter(Boolean).join(" ").toLowerCase().includes(n.toLowerCase()))throw new gn(Zn.CONTAINS_PERSONAL_INFO,"Password cannot contain personal information like your name or email");if(t.password_dictionary?.enable&&t.password_dictionary.dictionary&&t.password_dictionary.dictionary.some(d=>n.toLowerCase().includes(d.toLowerCase())))throw new gn(Zn.CONTAINS_FORBIDDEN_WORD,"Password contains a forbidden word")}async function qf(t,e,n){return(await t.connections.get(e,n))?.options||{}}async function Zs(t,e){const n=await t.env.data.emailProviders.get(t.var.tenant_id)||(t.env.DEFAULT_TENANT_ID?await t.env.data.emailProviders.get(t.env.DEFAULT_TENANT_ID):null);if(!n)throw new I(500,{message:"Email provider not found"});const r=t.env.emailProviders?.[n.name];if(!r)throw new I(500,{message:"Email provider not found"});await r({emailProvider:n,...e,from:n.default_from_address||`login@${t.env.ISSUER}`})}async function ov(t,e){if(!t.var.client_id)throw new I(500,{message:"Client not found"});const n=await uo(t.env,t.var.client_id),r=n.connections.find(a=>a.strategy==="sms");if(!r)throw new I(500,{message:"SMS provider not found"});const i=r.options?.provider||"twilio",s=t.env.smsProviders?.[i];if(!s)throw new I(500,{message:"SMS provider not found"});await s({options:r.options,to:e.to,from:e.from,text:e.text,template:"auth-code",data:{code:e.code,tenantName:n.tenant.friendly_name,tenantId:n.tenant.id}})}async function sv(t,e,n,r,i){const s=await t.env.data.tenants.get(t.var.tenant_id);if(!s)throw new I(500,{message:"Tenant not found"});const a=`${it(t.env)}reset-password?state=${r}&code=${n}`,c=await t.env.data.branding.get(t.var.tenant_id),l=c?.logo_url||"",u=c?.colors?.primary||"#7d68f4",d={vendorName:s.friendly_name,lng:"en"};await Zs(t,{to:e,subject:ue("reset_password_title",d),html:`Click here to reset your password: ${it(t.env)}reset-password?state=${r}&code=${n}`,template:"auth-password-reset",data:{vendorName:s.friendly_name,logo:l,passwordResetUrl:a,supportUrl:s.support_url||"https://support.sesamy.com",buttonColor:u,passwordResetTitle:ue("password_reset_title",d),resetPasswordEmailClickToReset:ue("reset_password_email_click_to_reset",d),resetPasswordEmailReset:ue("reset_password_email_reset",d),supportInfo:ue("support_info",d),contactUs:ue("contact_us",d),copyright:ue("copyright",d),tenantName:s.friendly_name,tenantId:s.id}}),ye(t,s.id,{type:ge.SUCCESS_CHANGE_PASSWORD_REQUEST,description:e})}async function Ff(t,{to:e,code:n,language:r}){const i=await t.env.data.tenants.get(t.var.tenant_id);if(!i)throw new I(500,{message:"Tenant not found"});const{connectionType:s}=tu(e),a=await t.env.data.branding.get(t.var.tenant_id),c=a?.logo_url||"",l=a?.colors?.primary||"#7d68f4",u=new URL(it(t.env)),d={vendorName:i.friendly_name,vendorId:i.id,loginDomain:u.hostname,code:n,lng:r||"en"};s==="email"?await Zs(t,{to:e,subject:ue("code_email_subject",d),html:`Click here to validate your email: ${it(t.env)}validate-email`,template:"auth-code",data:{code:n,vendorName:i.friendly_name,logo:c,supportUrl:i.support_url||"",buttonColor:l,welcomeToYourAccount:ue("welcome_to_your_account",d),linkEmailClickToLogin:ue("link_email_click_to_login",d),linkEmailLogin:ue("link_email_login",d),linkEmailOrEnterCode:ue("link_email_or_enter_code",d),codeValid30Mins:ue("code_valid_30_minutes",d),supportInfo:ue("support_info",d),contactUs:ue("contact_us",d),copyright:ue("copyright",d)}}):s==="sms"&&await ov(t,{to:e,text:ue("sms_code_text",d),code:n,from:i.friendly_name}),ye(t,i.id,{type:ge.CODE_LINK_SENT,description:e})}async function Hf(t,{to:e,code:n,authParams:r,language:i}){const s=await t.env.data.tenants.get(t.var.tenant_id);if(!s)throw new I(500,{message:"Tenant not found"});if(!r.redirect_uri)throw new I(400,{message:"redirect_uri is required"});const{connectionType:a}=tu(e),c=await t.env.data.branding.get(t.var.tenant_id),l=c?.logo_url||"",u=c?.colors?.primary||"",d=new URL(Oe(t.env));d.pathname="passwordless/verify_redirect",d.searchParams.set("verification_code",n),d.searchParams.set("connection",a),d.searchParams.set("client_id",r.client_id),d.searchParams.set("redirect_uri",r.redirect_uri),d.searchParams.set("email",e),r.response_type&&d.searchParams.set("response_type",r.response_type),r.scope&&d.searchParams.set("scope",r.scope),r.state&&d.searchParams.set("state",r.state),r.nonce&&d.searchParams.set("nonce",r.nonce),r.code_challenge&&d.searchParams.set("code_challenge",r.code_challenge),r.code_challenge_method&&d.searchParams.set("code_challenge_method",r.code_challenge_method),r.audience&&d.searchParams.set("audience",r.audience);const f={vendorName:s.friendly_name,code:n,lng:i||"en"};if(a==="email")await Zs(t,{to:e,subject:ue("code_email_subject",f),html:`Click here to validate your email: ${it(t.env)}validate-email`,template:"auth-link",data:{code:n,vendorName:s.friendly_name,logo:l,supportUrl:s.support_url||"",magicLink:d.toString(),buttonColor:u,welcomeToYourAccount:ue("welcome_to_your_account",f),linkEmailClickToLogin:ue("link_email_click_to_login",f),linkEmailLogin:ue("link_email_login",f),linkEmailOrEnterCode:ue("link_email_or_enter_code",f),codeValid30Mins:ue("code_valid_30_minutes",f),supportInfo:ue("support_info",f),contactUs:ue("contact_us",f),copyright:ue("copyright",f)}});else if(a==="sms")await ov(t,{to:e,text:`${ue("link_sms_login",f)}: ${d.toString()}`,code:n,from:s.friendly_name});else throw new I(400,{message:"Only email and SMS connections are supported for magic links"});ye(t,s.id,{type:ge.CODE_LINK_SENT,description:e})}async function Vf(t,e,n){const r=await t.env.data.tenants.get(t.var.tenant_id);if(!r)throw new I(500,{message:"Tenant not found"});if(!e.email)throw new I(400,{message:"User has no email"});const i=await t.env.data.branding.get(t.var.tenant_id),s=i?.logo_url||"",a=i?.colors?.primary||"#7d68f4",c={vendorName:r.friendly_name,lng:n||"en"};await Zs(t,{to:e.email,subject:ue("welcome_to_your_account",c),html:`Click here to validate your email: ${it(t.env)}validate-email`,template:"auth-verify-email",data:{vendorName:r.friendly_name,logo:s,emailValidationUrl:`${it(t.env)}validate-email`,supportUrl:r.support_url||"https://support.sesamy.com",buttonColor:a,welcomeToYourAccount:ue("welcome_to_your_account",c),verifyEmailVerify:ue("verify_email_verify",c),supportInfo:ue("support_info",c),contactUs:ue("contact_us",c),copyright:ue("copyright",c)}})}async function W7(t,e,n,r,i){const s=await t.env.data.tenants.get(t.var.tenant_id);if(!s)throw new I(500,{message:"Tenant not found"});const a=await t.env.data.branding.get(t.var.tenant_id),c=a?.logo_url||"",l=a?.colors?.primary||"#7d68f4",u={vendorName:s.friendly_name,lng:"en"},d=`${it(t.env)}signup?state=${r}&code=${n}`;await Zs(t,{to:e,subject:ue("register_password_account",u),html:`Click here to register: ${d}`,template:"auth-pre-signup-verification",data:{vendorName:s.friendly_name,logo:c,signupUrl:d,setPassword:ue("set_password",u),registerPasswordAccount:ue("register_password_account",u),clickToSignUpDescription:ue("click_to_sign_up_description",u),supportUrl:s.support_url||"https://support.sesamy.com",buttonColor:l,welcomeToYourAccount:ue("welcome_to_your_account",u),verifyEmailVerify:ue("verify_email_verify",u),supportInfo:ue("support_info",u),contactUs:ue("contact_us",u),copyright:ue("copyright",u)}})}const J7=new o.OpenAPIHono().openapi(o.createRoute({tags:["dbconnections"],method:"post",path:"/signup",request:{body:{content:{"application/json":{schema:o.z.object({client_id:o.z.string(),connection:o.z.literal("Username-Password-Authentication"),email:o.z.string().transform(t=>t.toLowerCase()),password:o.z.string()})}}}},responses:{200:{content:{"application/json":{schema:o.z.object({_id:o.z.string(),email:o.z.string().optional(),email_verified:o.z.boolean(),app_metadata:o.z.object({}),user_metadata:o.z.object({})})}},description:"Created user"}}}),async t=>{const{email:e,password:n,client_id:r}=t.req.valid("json"),i=await t.env.data.legacyClients.get(r);if(!i)throw new I(400,{message:"Client not found"});t.set("client_id",i.client_id),t.set("tenant_id",i.tenant.id);const a=i.connections.find(f=>f.strategy==="Username-Password-Authentication")?.name||"Username-Password-Authentication",c=await qf(t.env.data,i.tenant.id,a);try{await Mf(c,{tenantId:i.tenant.id,userId:"",newPassword:n,data:t.env.data})}catch(f){throw new I(400,{message:f?.message||"Password does not meet the requirements"})}if(await Oi({userAdapter:t.env.data.users,tenant_id:i.tenant.id,username:e,provider:"auth2"}))throw new I(400,{message:"Invalid sign up"});const u=await t.env.data.users.create(i.tenant.id,{user_id:`auth2|${$s()}`,email:e,email_verified:!1,provider:"auth2",connection:"Username-Password-Authentication",is_social:!1});t.set("user_id",u.user_id),t.set("username",u.email),t.set("connection",u.connection);const d=await ar.hash(n,10);return await t.env.data.passwords.create(i.tenant.id,{user_id:u.user_id,password:d,algorithm:"bcrypt",is_current:!0}),await Vf(t,u),ye(t,i.tenant.id,{type:ge.SUCCESS_SIGNUP,description:"Successful signup"}),t.json({_id:u.user_id,email:u.email,email_verified:!1,app_metadata:{},user_metadata:{}})}).openapi(o.createRoute({tags:["dbconnections"],method:"post",path:"/change_password",request:{body:{content:{"application/json":{schema:o.z.object({client_id:o.z.string(),connection:o.z.literal("Username-Password-Authentication"),email:o.z.string().transform(t=>t.toLowerCase())})}}}},responses:{200:{description:"Redirect to the client's redirect uri"}}}),async t=>{const{email:e,client_id:n}=t.req.valid("json"),r=await t.env.data.legacyClients.get(n);if(!r)throw new I(400,{message:"Client not found"});if(t.set("client_id",r.client_id),t.set("tenant_id",r.tenant.id),!await Xi({userAdapter:t.env.data.users,tenant_id:r.tenant.id,username:e,provider:"auth2"}))return t.html("If an account with that email exists, we've sent instructions to reset your password.");const s={client_id:n,username:e},a=await t.env.data.loginSessions.create(r.tenant.id,{expires_at:new Date(Date.now()+Lr*1e3).toISOString(),authParams:s,csrf_token:je(),ip:t.get("ip"),useragent:t.get("useragent"),auth0Client:Hn(t.get("auth0_client"))});return await sv(t,e,a.id,a.authParams.state),t.html("If an account with that email exists, we've sent instructions to reset your password.")});function pr(){const t="1234567890";let e="";for(let n=0;n<6;n+=1)e+=t[Math.floor(Math.random()*10)];return e.toString()}const X7=new o.OpenAPIHono().openapi(o.createRoute({tags:["passwordless"],method:"post",path:"/start",request:{body:{content:{"application/json":{schema:o.z.union([o.z.object({connection:o.z.literal("email"),client_id:o.z.string(),email:o.z.string().transform(t=>t.toLowerCase()),send:o.z.enum(["link","code"]),authParams:Yo.omit({client_id:!0})}),o.z.object({client_id:o.z.string(),connection:o.z.literal("sms"),phone_number:o.z.string(),send:o.z.enum(["link","code"]),authParams:Yo.omit({client_id:!0})})])}}}},responses:{200:{description:"Status"}}}),async t=>{const e=t.req.valid("json"),{env:n}=t,{client_id:r,send:i,authParams:s,connection:a}=e,c=await t.env.data.legacyClients.get(r);if(!c)throw new I(400,{message:"Client not found"});t.set("client_id",c.client_id),t.set("tenant_id",c.tenant.id);const l=a==="email"?e.email:e.phone_number,u=t.get("ip"),d=t.get("useragent"),f=t.get("auth0_client"),p=Hn(f),h=await n.data.loginSessions.create(c.tenant.id,{authParams:{...s,client_id:r,username:l},expires_at:new Date(Date.now()+ka).toISOString(),csrf_token:je(),ip:u,useragent:d,auth0Client:p}),m=await n.data.codes.create(c.tenant.id,{code_id:pr(),code_type:"otp",login_id:h.id,expires_at:new Date(Date.now()+ka).toISOString(),redirect_uri:s.redirect_uri}),y=s?.ui_locales?.split(" ")?.map(w=>w.split("-")[0])[0];return i==="link"?await Hf(t,{to:l,code:m.code_id,authParams:{...s,client_id:r},language:y}):await Ff(t,{to:l,code:m.code_id,language:y}),t.html("OK")}).openapi(o.createRoute({tags:["passwordless"],method:"get",path:"/verify_redirect",request:{query:o.z.object({scope:o.z.string(),response_type:o.z.nativeEnum(Rt),redirect_uri:o.z.string(),state:o.z.string(),nonce:o.z.string().optional(),verification_code:o.z.string(),connection:o.z.string(),client_id:o.z.string(),email:o.z.string().transform(t=>t.toLowerCase()),audience:o.z.string().optional()})},responses:{302:{description:"Successful verification, redirecting to continue flow.",headers:o.z.object({Location:o.z.string().url()}).openapi({})},400:{description:"Bad Request (e.g., invalid client, invalid code, missing parameters).",content:{"application/json":{schema:o.z.object({error:o.z.string(),error_description:o.z.string().optional()})}}},500:{description:"Internal Server Error.",content:{"application/json":{schema:o.z.object({error:o.z.string(),error_description:o.z.string().optional()})}}}}}),async t=>{const{env:e}=t,{client_id:n,email:r,verification_code:i,redirect_uri:s,state:a,scope:c,audience:l,response_type:u,nonce:d}=t.req.valid("query"),f=await uo(e,n);t.set("client_id",f.client_id),t.set("tenant_id",f.tenant.id),t.set("connection","email");const p={client_id:n,redirect_uri:s,state:a,nonce:d,scope:c,audience:l,response_type:u};let h="Something went wrong. Please try again later.";try{const v=await Uf(t,{client_id:n,username:r,otp:i,authParams:p,enforceIpCheck:!0});if(v instanceof Response)return v;if(v&&typeof v=="object"&&"access_token"in v)return t.json(v)}catch(v){const $=v;"message"in $&&typeof $.message=="string"&&(h=$.message)}const m=t.get("ip"),y=t.get("useragent"),w=t.get("auth0_client"),_=Hn(w),k=await e.data.loginSessions.create(f.tenant.id,{authParams:{...p,username:r},expires_at:new Date(Date.now()+ka).toISOString(),csrf_token:je(),ip:m,useragent:y,auth0Client:_});return t.redirect(`${it(t.env)}invalid-session?state=${k.id}&error=${encodeURIComponent(h)}`,302)});class bi extends I{_code;constructor(e,n){super(e,n),this._code=n?.code}get code(){return this._code}}async function Z7(t,e,n){const r=n.app_metadata||{},i=r.failed_logins||[],s=Date.now(),a=[...i.filter(c=>s-c<1e3*60*5),s];r.failed_logins=a,await t.users.update(e,n.user_id,{app_metadata:r})}function Y7(t){const n=(t.app_metadata||{}).failed_logins||[],r=Date.now();return n.filter(i=>r-i<1e3*60*5)}async function av(t,e,n,r){const{data:i}=t.env,{username:s}=n;if(t.set("username",s),!s)throw new X(400,{message:"Username is required"});const a=await Xi({userAdapter:t.env.data.users,tenant_id:e.tenant.id,username:s,provider:"auth2"});if(!a)throw ye(t,e.tenant.id,{type:ge.FAILED_LOGIN_INCORRECT_PASSWORD,description:"Invalid user"}),new bi(403,{message:"User not found",code:"USER_NOT_FOUND"});const c=a.linked_to?await i.users.get(e.tenant.id,a.linked_to):a;if(!c)throw new bi(403,{message:"User not found",code:"USER_NOT_FOUND"});if(t.set("connection",a.connection),t.set("user_id",c.user_id),Y7(c).length>=3)throw ye(t,e.tenant.id,{type:ge.FAILED_LOGIN,description:"Too many failed login attempts"}),new bi(403,{message:"Too many failed login attempts",code:"TOO_MANY_FAILED_LOGINS"});const u=await i.passwords.get(e.tenant.id,a.user_id);if(!(u&&await ar.compare(n.password,u.password)))throw ye(t,e.tenant.id,{type:ge.FAILED_LOGIN_INCORRECT_PASSWORD,description:"Invalid password"}),Z7(i,e.tenant.id,c),new bi(403,{message:"Invalid password",code:"INVALID_PASSWORD"});if(!a.email_verified&&e.client_metadata?.email_validation==="enforced"){const p=r?.authParams?.ui_locales?.split(" ")?.map(h=>h.split("-")[0])[0];throw await Vf(t,a,p),ye(t,e.tenant.id,{type:ge.FAILED_LOGIN,description:"Email not verified"}),new bi(403,{message:"Email not verified",code:"EMAIL_NOT_VERIFIED"})}const f=c.app_metadata||{};return f.failed_logins&&f.failed_logins.length>0&&(f.failed_logins=[],i.users.update(e.tenant.id,c.user_id,{app_metadata:f})),{client:e,authParams:n,user:c,loginSession:r}}async function cv(t,e,n,r,i){const s=await av(t,e,n,r);return sn(t,{...s,ticketAuth:i,authStrategy:{strategy:"Username-Password-Authentication",strategy_type:"database"}})}async function Q7(t,e,n,r){await nl(t,{client:e,username:n,provider:"auth2",connection:"Username-Password-Authentication",isSocial:!1,ip:t.var.ip});let i=pr(),s=await t.env.data.codes.get(e.tenant.id,i,"password_reset");for(;s;)i=pr(),s=await t.env.data.codes.get(e.tenant.id,i,"password_reset");const a=t.get("ip"),c=t.get("useragent"),l=t.get("auth0_client"),u=Hn(l),d=await t.env.data.loginSessions.create(e.tenant.id,{expires_at:new Date(Date.now()+b6).toISOString(),authParams:{client_id:e.client_id,username:n},csrf_token:je(),ip:a,useragent:c,auth0Client:u}),f=await t.env.data.codes.create(e.tenant.id,{code_id:i,code_type:"password_reset",login_id:d.id,expires_at:new Date(Date.now()+y6).toISOString()});await sv(t,n,f.code_id,r)}const ez=new o.OpenAPIHono().openapi(o.createRoute({tags:["oauth"],method:"post",path:"/",request:{body:{content:{"application/json":{schema:o.z.union([o.z.object({credential_type:o.z.literal("http://auth0.com/oauth/grant-type/passwordless/otp"),otp:o.z.string(),client_id:o.z.string(),username:o.z.string().transform(t=>t.toLowerCase()),realm:o.z.enum(["email"]),scope:o.z.string().optional()}),o.z.object({credential_type:o.z.literal("http://auth0.com/oauth/grant-type/password-realm"),client_id:o.z.string(),username:o.z.string().transform(t=>t.toLowerCase()),password:o.z.string(),realm:o.z.enum(["Username-Password-Authentication"]),scope:o.z.string().optional()})])}}}},responses:{200:{description:"List of tenants"}}}),async t=>{const e=t.req.valid("json"),{client_id:n,username:r}=e;t.set("username",r);const i=await t.env.data.legacyClients.get(n);if(!i)throw new I(400,{message:"Client not found"});t.set("client_id",n),t.set("tenant_id",i.tenant.id);const s=r.toLocaleLowerCase(),a=t.get("ip"),c=t.get("useragent"),l=t.get("auth0_client");let u;if("otp"in e)u=await Uf(t,{client_id:n,username:s,otp:e.otp});else if("password"in e){const d=await t.env.data.loginSessions.create(i.tenant.id,{expires_at:new Date(Date.now()+Lr*1e3).toISOString(),authParams:{client_id:n,username:s},csrf_token:je(),ip:a,useragent:c,auth0Client:Hn(l)});u=await cv(t,i,{username:s,password:e.password,client_id:n},d,!0)}else throw new I(400,{message:"Code or password required"});if(!(u instanceof Response))throw new I(500,{message:"Unexpected response from loginWithPassword"});return u});function lv(t,e){if(!t||e.length===0)return!1;const n=Tu(t)?.host??null;if(!n)return!1;for(const r of e){let i;if(r.startsWith("http://")||r.startsWith("https://")?i=Tu(r)?.host??null:i=Tu("https://"+r)?.host??null,n===i)return!0}return!1}function Tu(t){try{return new URL(t)}catch{return null}}async function tz({ctx:t,session:e,client:n,authParams:r,connection:i,login_hint:s}){const a=new URL(t.req.url);t.var.custom_domain&&(a.hostname=t.var.custom_domain);const{ip:c,auth0_client:l,useragent:u}=t.var,d=Hn(l),f=await t.env.data.loginSessions.create(n.tenant.id,{expires_at:new Date(Date.now()+Lr*1e3).toISOString(),authParams:r,csrf_token:je(),authorization_url:a.toString(),ip:c,useragent:u,auth0Client:d});if(e&&s){const p=await t.env.data.users.get(n.tenant.id,e.user_id);if(p?.email===s)return await t.env.data.loginSessions.update(n.tenant.id,f.id,{session_id:e.id}),sn(t,{client:n,loginSession:{...f,session_id:e.id},authParams:r,user:p,sessionId:e.id})}if(i==="email"&&s){const p=pr();return await t.env.data.codes.create(n.tenant.id,{code_id:p,code_type:"otp",login_id:f.id,expires_at:new Date(Date.now()+Lr*1e3).toISOString(),redirect_uri:r.redirect_uri}),await Hf(t,{code:p,to:s,authParams:r}),t.redirect(`/u/enter-code?state=${f.id}`)}return e?t.redirect(`/u/check-account?state=${f.id}`):t.redirect(`/u/login/identifier?state=${f.id}`)}function nz(t){if(t==="Username-Password-Authentication")return"auth2";if(t==="email")return"email";throw new X(403,{message:"Invalid realm"})}async function rz(t,e,n,r,i){const{env:s}=t;t.set("connection",i);const a=await s.data.codes.get(e,n,"ticket");if(!a||a.used_at)throw new X(403,{message:"Ticket not found"});const c=await s.data.loginSessions.get(e,a.login_id);if(!c||!c.authParams.username)throw new X(403,{message:"Session not found"});const l=await s.data.legacyClients.get(c.authParams.client_id);if(!l)throw new X(403,{message:"Client not found"});t.set("client_id",c.authParams.client_id),await s.data.codes.used(e,n);const u=nz(i),f=l.connections.find(y=>y.name===i)?.strategy||(u==="auth2"?"Username-Password-Authentication":"email"),p=f==="Username-Password-Authentication"?"database":"passwordless";let h=await nl(t,{username:c.authParams.username,provider:u,client:l,connection:i,isSocial:!1,ip:t.var.ip});t.set("username",h.email||h.phone_number),t.set("user_id",h.user_id);const m=await Eb(t,{user:h,client:l,loginSession:c});return sn(t,{authParams:{scope:c.authParams?.scope,...r},loginSession:c,sessionId:m.id,user:h,client:l,authStrategy:{strategy:f,strategy_type:p}})}async function iz({ctx:t,client:e,session:n,redirect_uri:r,state:i,nonce:s,code_challenge_method:a,code_challenge:c,audience:l,scope:u,response_type:d,organization:f}){const{env:p}=t,h=new URL(r),m=`${h.protocol}//${h.host}`;async function y(A="Login required"){const N=new Headers;if(n){ye(t,e.tenant.id,{type:ge.FAILED_SILENT_AUTH,description:A});const O=wb(e.tenant.id,t.req.header("host"));N.set("set-cookie",O)}return Td(t,m,JSON.stringify({error:"login_required",error_description:A,state:i}),N)}if(!n||n?.expires_at&&new Date(n.expires_at)<new Date||n?.idle_expires_at&&new Date(n.idle_expires_at)<new Date)return y();t.set("user_id",n.user_id);const _=await p.data.users.get(e.tenant.id,n.user_id);if(!_)return console.error("User not found",n.user_id),y("User not found");t.set("username",_.email),t.set("connection",_.connection);const k=await p.data.loginSessions.create(e.tenant.id,{csrf_token:je(),authParams:{client_id:e.client_id,audience:l,scope:u,state:i,nonce:s,response_type:d,redirect_uri:r,organization:f},expires_at:new Date(Date.now()+300*1e3).toISOString(),session_id:n.id,ip:t.var.ip,useragent:t.var.useragent}),v={client:e,authParams:{client_id:e.client_id,audience:l,code_challenge_method:a,code_challenge:c,scope:u,state:i,nonce:s,response_type:d,redirect_uri:r},user:_,session_id:n.id},$=d===Rt.CODE?await zb(t,{user:_,client:e,authParams:v.authParams,login_id:k.id}):await Yc(t,v);await p.data.sessions.update(e.tenant.id,n.id,{used_at:new Date().toISOString(),last_interaction_at:new Date().toISOString(),login_session_id:k.id,device:{...n.device,last_ip:t.var.ip||"",last_user_agent:t.var.useragent||""},idle_expires_at:n.idle_expires_at?new Date(Date.now()+Zc*1e3).toISOString():void 0}),ye(t,e.tenant.id,{type:ge.SUCCESS_SILENT_AUTH,description:"Successful silent authentication"});const b=new Headers,z=tc(e.tenant.id,n.id,t.req.header("host"));return b.set("set-cookie",z),Td(t,m,JSON.stringify({...$,state:i}),b)}const oz=["email","sms","Username-Password-Authentication"],sz=new o.OpenAPIHono().openapi(o.createRoute({tags:["oauth"],method:"get",path:"/",request:{query:o.z.object({client_id:o.z.string(),vendor_id:o.z.string().optional(),redirect_uri:o.z.string(),scope:o.z.string().optional(),state:o.z.string(),prompt:o.z.string().optional(),response_mode:o.z.nativeEnum(_n).optional(),response_type:o.z.nativeEnum(Rt).optional(),audience:o.z.string().optional(),connection:o.z.string().optional(),nonce:o.z.string().optional(),max_age:o.z.string().optional(),login_ticket:o.z.string().optional(),code_challenge_method:o.z.nativeEnum(Wc).optional(),code_challenge:o.z.string().optional(),realm:o.z.string().optional(),auth0Client:o.z.string().optional(),organization:o.z.string().optional(),login_hint:o.z.string().optional(),screen_hint:o.z.string().openapi({example:"signup",description:'Optional hint for the screen to show, like "signup" or "login".'}).optional(),ui_locales:o.z.string().optional()})},responses:{200:{description:"Successful authorization response. This can be an HTML page (e.g., for silent authentication iframe or universal login page) or a JSON object containing tokens (e.g., for response_mode=web_message).",content:{"text/html":{schema:o.z.string().openapi({example:"<html>...</html>"})},"application/json":{schema:z0}}},302:{description:"Redirect to the client's redirect URI, an authentication page, or an external identity provider.",headers:o.z.object({Location:o.z.string().url()})},400:{description:"Bad Request. Invalid parameters or other client-side errors.",content:{"application/json":{schema:o.z.object({message:o.z.string()})}}},403:{description:"Forbidden. The request is not allowed (e.g., invalid origin).",content:{"application/json":{schema:o.z.object({message:o.z.string()})}}}}}),async t=>{const{env:e}=t,{client_id:n,vendor_id:r,redirect_uri:i,scope:s,state:a,audience:c,nonce:l,connection:u,response_type:d,response_mode:f,code_challenge:p,code_challenge_method:h,prompt:m,login_ticket:y,realm:w,auth0Client:_,login_hint:k,ui_locales:v,organization:$}=t.req.valid("query");t.set("log","authorize");const b=await uo(e,n);t.set("client_id",b.client_id),t.set("tenant_id",b.tenant.id);const z={redirect_uri:i.split("#")[0],scope:s,state:a,client_id:n,vendor_id:r,audience:c,nonce:l,prompt:m,response_type:d,response_mode:f,code_challenge:p,code_challenge_method:h,username:k,ui_locales:v,organization:$},A=t.req.header("origin");if(A&&!lv(A,b.web_origins||[]))throw new I(403,{message:`Origin ${A} not allowed`});if(z.redirect_uri){const P=b.callbacks||[];if(t.var.host&&(P.push(`${il(t.env)}/*`),P.push(`${it(t.env)}/*`)),!jf(z.redirect_uri,P,{allowPathWildcards:!0,allowSubDomainWildcards:!0}))throw new I(400,{message:`Invalid redirect URI - ${z.redirect_uri}`})}const N=Ti(b.tenant.id,t.req.header("cookie")),O=N?await e.data.sessions.get(b.tenant.id,N):void 0,L=O&&!O.revoked_at?O:void 0;if(m=="none"){if(!d)throw new I(400,{message:"Missing response_type"});return iz({ctx:t,session:L||void 0,redirect_uri:i,state:a,response_type:d,client:b,nonce:l,code_challenge_method:h,code_challenge:p,audience:c,scope:s,organization:$})}if(b.connections.length===1&&b.connections[0]&&!oz.includes(b.connections[0].strategy||""))return jm(t,b,b.connections[0].name,z);if(u&&u!=="email")return jm(t,b,u,z);if(y){const P=await rz(t,b.tenant.id,y,z,w);return P instanceof Response?P:t.json(P)}const C=await tz({ctx:t,client:b,authParams:z,session:L||void 0,connection:u,login_hint:k});return C instanceof Response?C:t.json(C)}),az=new o.OpenAPIHono().openapi(o.createRoute({tags:["oauth"],method:"get",path:"/",request:{query:o.z.object({client_id:o.z.string(),redirect_url:o.z.string().optional(),login_hint:o.z.string().toLowerCase().optional(),screen_hint:o.z.enum(["account","change-email","change-phone","change-password"]).optional().default("account")})},responses:{302:{description:"Redirect to the account page with login session state or login page",headers:o.z.object({Location:o.z.string().url()})},400:{description:"Bad Request. Invalid parameters or other client-side errors.",content:{"application/json":{schema:o.z.object({message:o.z.string()})}}}}}),async t=>{const{env:e}=t,{client_id:n,redirect_url:r,login_hint:i,screen_hint:s}=t.req.valid("query");t.set("log","account");const a=await uo(e,n);t.set("client_id",a.client_id),t.set("tenant_id",a.tenant.id);const c={redirect_uri:r||t.req.url,client_id:n,username:i},l=t.req.header("origin");if(l&&!lv(l,a.web_origins||[]))throw new I(403,{message:`Origin ${l} not allowed`});if(c.redirect_uri){const k=a.callbacks||[];if(t.var.host&&(k.push(`${il(t.env)}/*`),k.push(`${it(t.env)}/*`)),!jf(c.redirect_uri,k,{allowPathWildcards:!0,allowSubDomainWildcards:!0}))throw new I(400,{message:`Invalid redirect URI - ${c.redirect_uri}`})}const u=Ti(a.tenant.id,t.req.header("cookie")),d=u?await e.data.sessions.get(a.tenant.id,u):void 0,f=d&&!d.revoked_at?d:void 0,p=new URL(t.req.url);t.var.custom_domain&&(p.hostname=t.var.custom_domain);const{ip:h,auth0_client:m,useragent:y}=t.var,w=Hn(m),_=await e.data.loginSessions.create(a.tenant.id,{expires_at:new Date(Date.now()+Lr*1e3).toISOString(),authParams:c,csrf_token:je(),authorization_url:p.toString(),ip:h,useragent:y,auth0Client:w});if(f){if(i&&(await e.data.users.get(a.tenant.id,f.user_id))?.email!==i)return t.redirect(`${it(t.env)}login/identifier?state=${encodeURIComponent(_.id)}`);if(await e.data.loginSessions.update(a.tenant.id,_.id,{session_id:f.id}),s==="change-email"){const v=new URL("/u/account/change-email",t.req.url);return v.searchParams.set("state",_.id),t.redirect(v.toString())}const k=new URL("/u/account",t.req.url);return k.searchParams.set("state",_.id),t.redirect(k.toString())}return t.redirect(`${it(t.env)}login/identifier?state=${encodeURIComponent(_.id)}`)});function cz(t){const e=new o.OpenAPIHono;e.use(async(r,i)=>{const s=zs(r,t.dataAdapter),a=t.dataAdapter.cache||Xs({defaultTtlSeconds:0,maxEntries:100,cleanupIntervalMs:0}),c=t.dataAdapter.cache?300:0,l=Yl(s,{defaultTtl:c,cacheEntities:["tenants","connections","customDomains","clients","legacyClients","branding","themes","promptSettings","forms","resourceServers","roles","organizations","userRoles","userPermissions"],cache:a});return r.env.data=Zl(r,l),i()}),e.use("/oauth/token",V1({origin:r=>r||"",allowHeaders:["Tenant-Id","Content-Type","Auth0-Client","Upgrade-Insecure-Requests"],allowMethods:["POST"],maxAge:600})),e.use(Js).use(Ws).use(Xl(e));const n=e.route("/v2/logout",w9).route("/userinfo",v9).route("/.well-known",x9).route("/oauth/token",G7).route("/dbconnections",J7).route("/passwordless",X7).route("/co/authenticate",ez).route("/authorize",sz).route("/account",az).route("/callback",y9);return n.doc("/spec",{openapi:"3.0.0",info:{version:"1.0.0",title:"Oauth API"},security:[{oauth2:["openid","email","profile"]}]}),Nf(n),n}async function Ie(t,e,n=!1){const{env:r}=t,i=await r.data.loginSessions.get(t.var.tenant_id||"",e);if(!i)throw new X(400,{message:"Login session not found"});t.set("loginSession",i);const s=await uo(r,i.authParams.client_id);t.set("client_id",s.client_id),t.set("tenant_id",s.tenant.id);let a;try{a=m$(t,"auth_ui_style")}catch{a=void 0}let c=!1;t.req?.url&&(c=(new URL(t.req.url).searchParams.get("style")||a||"classic")==="shadcn");const l=await r.data.tenants.get(s.tenant.id);if(l){if(i.session_id&&!n){if(!i.authParams.redirect_uri)throw new X(400,{message:"Login session closed and no redirect URI available"});const p=new URL(i.authParams.redirect_uri);throw p.searchParams.set("error","access_denied"),p.searchParams.set("error_description","Login session closed"),i.authParams.state&&p.searchParams.set("state",i.authParams.state),new Qr(p.toString(),302)}}else throw new X(400,{message:"Tenant not found"});const u=await r.data.themes.get(l.id,"default"),d=await r.data.branding.get(l.id),f=i.authParams?.ui_locales?.split(" ")?.map(p=>p.split("-")[0])?.find(p=>{if(Array.isArray(E.options.supportedLngs))return E.options.supportedLngs.includes(p)});return await E.changeLanguage(f||"en"),{theme:u,branding:d,client:s,tenant:l,loginSession:i,useShadcn:c}}async function ei(t,e){const{theme:n,branding:r,client:i,tenant:s,loginSession:a,useShadcn:c}=await Ie(t,e,!0),l=Ti(i.tenant.id,t.req.header("cookie")),u=l?await t.env.data.sessions.get(i.tenant.id,l):null;if(!u||!a.session_id)throw new Qr(`/u/login/identifier?state=${encodeURIComponent(e)}`);const d=await t.env.data.sessions.get(i.tenant.id,a.session_id),f=await t.env.data.users.get(i.tenant.id,u.user_id);if(!f||d?.user_id!==u.user_id)throw new Qr(`/u/login/identifier?state=${encodeURIComponent(e)}`);return{theme:n,branding:r,client:i,user:f,tenant:s,loginSession:a,session:d,useShadcn:c}}const Ou={"Username-Password-Authentication":"password",email:"email",sms:"sms"};async function lz(t,e,n,r,i){if(i==="password")return"password";if(i==="code")return r==="sms"?"sms":"email";const a=(r==="email"?await tl({userAdapter:t.env.data.users,tenant_id:e.tenant.id,email:n}):await Oi({userAdapter:t.env.data.users,tenant_id:e.tenant.id,username:n,provider:r==="sms"?"sms":"auth2"}))?.app_metadata?.strategy;if(a&&Ou[a])return Ou[a];const c=e.connections.map(u=>Ou[u.strategy]).filter(u=>u!==void 0);return c.length===1&&c[0]?c[0]:(await t.env.data.promptSettings.get(e.tenant.id)).password_first&&c.includes("password")?"password":r==="sms"?"sms":"email"}var Pu={exports:{}};var s_;function uz(){return s_||(s_=1,(function(t){(function(){var e={}.hasOwnProperty;function n(){for(var s="",a=0;a<arguments.length;a++){var c=arguments[a];c&&(s=i(s,r(c)))}return s}function r(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return n.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var a="";for(var c in s)e.call(s,c)&&s[c]&&(a=i(a,c));return a}function i(s,a){return a?s?s+" "+a:s+a:s}t.exports?(n.default=n,t.exports=n):window.classNames=n})()})(Pu)),Pu.exports}var dz=uz();const fe=Xb(dz),Sn=({children:t,className:e,style:n})=>g("div",{className:fe("rounded-lg border border-gray-200 bg-white shadow-sm dark:border-gray-700 dark:bg-gray-800",e),style:n,children:t}),zn=({children:t,className:e})=>g("div",{className:fe("flex flex-col space-y-1.5 p-6",e),children:t}),An=({children:t,className:e,style:n})=>g("h3",{className:fe("text-2xl font-semibold leading-none tracking-tight",e),style:n,children:t}),En=({children:t,className:e,style:n})=>g("p",{className:fe("text-sm text-gray-500 dark:text-gray-400",e),style:n,children:t}),Cn=({children:t,className:e})=>g("div",{className:fe("p-6 pt-0",e),children:t}),uv=({children:t,className:e})=>g("div",{className:fe("flex items-center p-6 pt-0",e),children:t}),on=({id:t,type:e="text",name:n,placeholder:r,className:i,required:s=!1,value:a,disabled:c=!1,error:l=!1,style:u})=>g("input",{id:t,type:e,name:n,placeholder:r,required:s,value:a,disabled:c,className:fe("flex h-10 w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm ring-offset-white transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-gray-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 dark:border-gray-600 dark:bg-gray-800 dark:ring-offset-gray-900 dark:placeholder:text-gray-400",l&&"border-red-500 focus-visible:ring-red-500",i),style:u}),wn=({children:t,className:e,variant:n="default",size:r="default",type:i="button",disabled:s=!1,style:a})=>{const c={default:"bg-blue-600 text-white hover:bg-blue-700 dark:bg-blue-700 dark:hover:bg-blue-800",outline:"border border-gray-300 bg-transparent hover:bg-gray-100 dark:border-gray-600 dark:hover:bg-gray-800",ghost:"hover:bg-gray-100 dark:hover:bg-gray-800"},l={default:"h-10 px-4 py-2",sm:"h-9 px-3 text-sm",lg:"h-11 px-8"};return g("button",{type:i,disabled:s,className:fe("inline-flex items-center justify-center gap-2 rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 disabled:pointer-events-none disabled:opacity-50",c[n],l[r],e),style:a,children:t})},Lt=({htmlFor:t,className:e,style:n,children:r})=>g("label",{for:t,className:fe("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),style:n,children:r}),tt=({children:t,className:e})=>g("div",{className:fe("mb-2 text-sm text-red",e),children:t}),ln=({theme:t,branding:e})=>{const n=t?.widget?.logo_url||e?.logo_url;return n?g("div",{className:"inline-flex h-9 items-center",children:g("img",{src:n,className:"h-full w-auto",alt:"Logo"})}):g(rs,{})},Ia=({error:t,theme:e,branding:n,loginSession:r,email:i,client:s,className:a,isEmbedded:c,browserName:l})=>{const u=s.connections.map(({strategy:le})=>le),d=u.includes("email")||u.includes("Username-Password-Authentication"),f=u.includes("sms"),p=new Set(["email","sms","Username-Password-Authentication","auth0"]),h=s.connections.filter(le=>!p.has(le.strategy)).filter(le=>le.show_as_button!==!1).map(le=>{const St=U0[le.strategy];return St?{...St,connectionName:le.name,displayName:le.display_name||St.displayName||le.name,iconUrl:le.options.icon_url}:null}).filter(le=>le!==null).filter(le=>!(c&&le.disableEmbeddedBrowsers)),m=d||f,y=d&&f?"email_or_phone_placeholder":d?"email_placeholder":f?"phone_placeholder":null,w=y?E.t(y,d&&f?"Email or Phone Number":d?"Email Address":"Phone Number"):"",_=e?.colors?.primary_button||n?.colors?.primary||"#0066cc",k=e?.colors?.primary_button_label||"#ffffff",v=e?.colors?.body_text||"#333333",$=e?.colors?.input_background||"#ffffff",b=e?.colors?.input_border||"#d1d5db",z=e?.colors?.input_filled_text||"#111827",A=e?.colors?.error||"#dc2626",N=e?.colors?.widget_background||"#ffffff",O=e?.colors?.widget_border||"#e5e7eb",L=e?.borders?.widget_corner_radius||8,C=e?.borders?.input_border_radius||4,P=e?.borders?.button_border_radius||4,M=e?.borders?.show_widget_shadow??!0,K=e?.fonts?.title?.size||24,B=e?.fonts?.title?.bold??!0,oe=e?.fonts?.body_text?.size||14,ae={backgroundColor:N,borderColor:O,borderRadius:`${L}px`,boxShadow:M?"0 1px 3px 0 rgba(0, 0, 0, 0.1)":"none",color:v},se={fontSize:`${K}px`,fontWeight:B?"700":"400",color:e?.colors?.header||v},ve={fontSize:`${oe}px`,color:e?.colors?.input_labels_placeholders||"#6b7280"},Ce={backgroundColor:$,borderColor:t?A:b,borderRadius:`${C}px`,color:z},Ne={backgroundColor:_,color:k,borderRadius:`${P}px`},We=e?.widget?.logo_position||"center",F=We==="left"?"text-left":We==="right"?"text-right":"text-center",Be=e?.widget?.logo_url||n?.logo_url,Mt=We!=="none"&&Be;return g("div",{className:fe("flex flex-col gap-6 w-full max-w-sm",a),children:[g("div",{id:"incognito-warning-container",className:"mb-4 hidden rounded-md border border-yellow-200 bg-yellow-50 p-4 text-sm text-yellow-800 dark:border-yellow-900 dark:bg-yellow-900/20 dark:text-yellow-100",role:"alert",children:g("div",{className:"flex items-start gap-3",children:[g("span",{className:"text-lg leading-none",children:"⚠️"}),g("div",{children:[g("strong",{children:E.t("incognito_mode_detected")}),g("p",{className:"mt-1 text-xs opacity-90",children:E.t("incognito_mode_warning")})]})]})}),c&&g("div",{className:"mb-4 rounded-md border border-orange-200 bg-orange-50 p-4 text-sm text-orange-800 dark:border-orange-900 dark:bg-orange-900/20 dark:text-orange-100",role:"alert",children:g("div",{className:"flex items-start gap-3",children:[g("span",{className:"text-lg leading-none",children:"⚠️"}),g("div",{children:[g("strong",{children:E.t("embedded_browser_detected")}),g("p",{className:"mt-1 text-xs opacity-90",children:E.t("embedded_browser_warning",{browserName:l||"the app"})})]})]})}),g(Sn,{style:ae,className:"border",children:[g(zn,{children:[Mt&&g("div",{className:fe("mb-4",F),children:g(ln,{theme:e,branding:n})}),g(An,{style:se,children:E.t("welcome","Login")}),g(En,{style:ve,children:m?E.t("login_description_template",{authMethod:E.t(y,{defaultValue:d&&f?"email or phone number":d?"email address":"phone number"}).toLocaleLowerCase(),defaultValue:"Enter your {{authMethod}} below to login to your account"}):E.t("login_description_social_only","Choose how to login")})]}),g(Cn,{children:g("form",{method:"post",children:g("div",{className:"grid gap-6",children:[m&&g(rs,{children:[g("div",{className:"grid gap-2",children:[g(Lt,{htmlFor:"username",style:ve,children:E.t(y,d&&f?"Email or Phone Number":d?"Email":"Phone Number")}),g(on,{id:"username",name:"username",type:"text",placeholder:w,required:!0,value:i||"",error:!!t,className:"border lowercase",style:Ce}),t&&g(tt,{children:t})]}),g(wn,{type:"submit",className:"w-full transition-colors hover:brightness-90",style:Ne,children:E.t("continue","Continue")})]}),h.length>0&&g(rs,{children:[m&&g("div",{className:"relative text-center",style:{color:e?.colors?.input_labels_placeholders||"#6b7280",fontSize:`${oe}px`},children:[g("div",{className:"absolute left-0 right-0 top-1/2 border-b",style:{borderColor:O}}),g("div",{className:"relative inline-block px-2",style:{backgroundColor:N},children:E.t("or","Or")})]}),g("div",{className:"flex gap-4 sm:flex-col short:flex-row",children:h.map(le=>{const St=le.logo;return g("a",{href:`/authorize/redirect?state=${r.id}&connection=${le.connectionName}`,className:"inline-flex items-center justify-center gap-2 rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 disabled:pointer-events-none disabled:opacity-50 border bg-transparent hover:bg-gray-100 dark:hover:bg-gray-800 h-10 px-4 py-2 w-full sm:w-full short:flex-1",style:{borderColor:b,borderRadius:`${P}px`,color:v},children:[g(St,{className:"h-5 w-5",iconUrl:le.iconUrl}),g("span",{className:"sm:inline short:hidden",children:E.t("continue_with","Login with {{provider}}",{provider:le.displayName})}),g("span",{className:"hidden short:inline",children:le.displayName})]},le.connectionName)})})]})]})})})]})]})},dv=t=>g("div",{className:"mt-8",children:t.client?.client_metadata?.termsAndConditionsUrl&&g("div",{className:"text-xs text-gray-300",children:[E.t("agree_to")," ",g("a",{href:t.client.client_metadata.termsAndConditionsUrl,className:"text-primary hover:underline",target:"_blank",rel:"noreferrer",children:E.t("terms")})]})}),pz=t=>t==="small"?"text-base":t==="medium"?"text-2xl":t==="large"?"text-3xl":"",Ge=({name:t,size:e,className:n=""})=>{const r=pz(e);return g("span",{className:fe(`uicon-${t}`,n,r)})},fz=(t,e)=>{const n=t.replace("#",""),r=parseInt(n,16),i=r>>16&255,s=r>>8&255,a=r&255,c=Math.min(255,Math.round(i+(255-i)*e)),l=Math.min(255,Math.round(s+(255-s)*e)),u=Math.min(255,Math.round(a+(255-a)*e));return`#${(c<<16|l<<8|u).toString(16).padStart(6,"0")}`},hz=(t,e)=>{const n=t?.colors?.primary_button||e?.colors?.primary||"#000000",r=t?.colors?.base_hover_color||fz(n,.2),i=t?.colors?.primary_button_label||"#ffffff";return`
|
|
87
|
+
body {
|
|
88
|
+
--primary-color: ${n};
|
|
89
|
+
--primary-hover: ${r};
|
|
90
|
+
--text-on-primary: ${i};
|
|
91
|
+
}
|
|
92
|
+
`},gz="https://assets.sesamy.com/images/login-bg.jpg",qe=({title:t,children:e,theme:n,branding:r,client:i})=>{const s={backgroundImage:`url(${n?.page_background?.background_image_url||gz})`};return g("html",{lang:E.language||"en",children:[g("head",{children:[g("title",{children:t}),g("meta",{charset:"UTF-8"}),g("meta",{name:"robots",content:"noindex, follow"}),g("link",{rel:"preload",href:"https://assets.sesamy.com/fonts/khteka/WOFF2/KHTeka-Regular.woff2",as:"font",type:"font/woff2",crossOrigin:"anonymous"}),g("link",{rel:"preload",href:"https://assets.sesamy.com/fonts/khteka/WOFF2/KHTeka-Medium.woff2",as:"font",type:"font/woff2",crossOrigin:"anonymous"}),g("link",{rel:"preload",href:"https://assets.sesamy.com/fonts/khteka/WOFF2/KHTeka-Bold.woff2",as:"font",type:"font/woff2",crossOrigin:"anonymous"}),g("link",{rel:"stylesheet",href:"/u/css/tailwind.css"}),g("meta",{name:"viewport",content:"width=device-width, initial-scale=1, maximum-scale=1"}),g("style",{children:hz(n,r)}),g("meta",{name:"theme-color",content:"#000000"})]}),g("body",{children:[g("div",{className:"row min-h-full w-full overflow-hidden bg-cover bg-center text-sm sm:bg-fixed sm:bg-left-top sm:pt-16 py-2",style:s,children:g("div",{className:"row-up-left w-[calc(100%-theme(space.2)-theme(space.2))] max-w-[1295px] !flex-nowrap sm:w-[calc(100%-theme(space.16)-theme(space.16))]",children:g("div",{className:"column-left w-full sm:w-auto",children:[g("div",{className:"relative flex w-full flex-col rounded-2xl bg-white px-5 py-10 dark:bg-gray-800 dark:text-white sm:min-h-[700px] sm:max-w-md sm:px-14 sm:py-14 md:min-w-[448px] short:min-h-[558px] min-h-[calc(100vh-83px)]",children:[g("div",{className:"mb-16",children:g(ln,{theme:n,branding:r})}),g("div",{className:"flex flex-1 flex-col",children:[e,g(dv,{theme:n,branding:r,client:i})]})]}),g("div",{className:"flex w-full items-center px-6 pb-8 pt-4 justify-between",children:[g("div",{className:"flex justify-center leading-[0]",children:g("a",{href:"https://sesamy.com",target:"_blank",rel:"noreferrer",children:g(Ge,{name:"sesamy",className:"text-xl text-white"})})}),g("div",{className:"flex justify-center space-x-2 text-xs text-white sm:justify-normal md:text-xs"})]})]})})}),g("div",{id:"client-root"})]}),g("script",{type:"module",src:"/u/js/client.js"})]})},mz=t=>t==="small"?"text-base":t==="medium"?"text-2xl":t==="large"?"text-3xl":"",pv=({size:t})=>{const e=mz(t);return g("div",{className:"relative inline-block leading-[0]",children:[g(Ge,{className:fe("text-gray-200 dark:text-[#201a41]",{[e]:e}),name:"spinner-circle"}),g(Ge,{className:fe("absolute inset-0 animate-spin text-primary",{[e]:e}),name:"spinner-inner"})]})},Me=({children:t,className:e,Component:n="button",variant:r="primary",href:i,disabled:s,isLoading:a,id:c})=>{const l=n==="a"?{href:i}:{};return g(n,{class:fe("btn relative w-full rounded-lg text-center",{"px-4 py-5":r!=="custom","bg-primary text-textOnPrimary hover:bg-primaryHover":r==="primary","border border-gray-300 bg-white text-black":r==="secondary","pointer-events-none cursor-not-allowed opacity-40":s,"is-loading":a},"focus:outline-none focus:ring",e),type:"submit",disabled:s,id:c,...l,children:[g("span",{className:"btn-label flex items-center justify-center space-x-2",children:t}),g("div",{className:"btn-spinner absolute left-0 top-0 flex h-full w-full items-center justify-center",children:g(pv,{size:"medium"})})]})},fv=({connection:t,text:e,icon:n=null,canResize:r=!1,loginSession:i})=>{const s=new URLSearchParams({client_id:i.authParams.client_id,connection:t});i.authParams.response_type&&s.set("response_type",i.authParams.response_type),i.authParams.redirect_uri&&s.set("redirect_uri",i.authParams.redirect_uri),i.authParams.scope&&s.set("scope",i.authParams.scope),i.authParams.nonce&&s.set("nonce",i.authParams.nonce),i.authParams.response_type&&s.set("response_type",i.authParams.response_type),i.authParams.state&&s.set("state",i.id);const a=`/authorize?${s.toString()}`;return g(Me,{className:fe("border border-gray-200 bg-white hover:bg-gray-100 dark:border-gray-400 dark:bg-black dark:hover:bg-black/90",{"px-0 py-3 sm:px-10 sm:py-4 short:px-0 short:py-3":r,"px-10 py-3":!r}),variant:"custom","aria-label":e,Component:"a",href:a,children:[n||"",g("div",{className:fe("text-left text-black dark:text-white sm:text-base",{"hidden sm:inline short:hidden":r}),children:e})]})},un=({children:t,className:e})=>g("form",{id:"form",method:"post",className:e,children:t}),ja=({error:t,theme:e,branding:n,loginSession:r,email:i,client:s,isEmbedded:a,browserName:c})=>{const l=s.connections.map(({strategy:v})=>v),u=l.includes("email")||l.includes("Username-Password-Authentication"),d=l.includes("sms"),f=new Set(["email","sms","Username-Password-Authentication","auth0"]),p=s.connections.filter(v=>!f.has(v.strategy)).filter(v=>v.show_as_button!==!1).map(v=>{const $=U0[v.strategy];return $?{...$,connectionName:v.name,displayName:v.display_name||$.displayName||v.name,iconUrl:v.options.icon_url}:null}).filter(v=>v!==null).filter(v=>!(a&&v.disableEmbeddedBrowsers)),h=u||d;let m="text",y="username";const w=u&&d?"email_or_phone_placeholder":u?"email_placeholder":"phone_placeholder";let _=E.t(w,u&&d?"Email or Phone Number":u?"Email Address":"Phone Number");return g(qe,{title:E.t("welcome"),theme:e,branding:n,client:s,children:[g("div",{id:"incognito-warning-container",className:"mb-4 hidden rounded-md border border-yellow-200 bg-yellow-50 p-4 text-sm text-yellow-800 dark:border-yellow-900 dark:bg-yellow-900/20 dark:text-yellow-100",role:"alert",children:g("div",{className:"flex items-start gap-3",children:[g("span",{className:"text-lg leading-none",children:"⚠️"}),g("div",{children:[g("strong",{children:E.t("incognito_mode_detected","Incognito Mode Detected")}),g("p",{className:"mt-1 text-xs opacity-90",children:E.t("incognito_mode_warning","You are in incognito/private mode. Session data may not persist across page refreshes. Some features might not work as expected.")})]})]})}),a&&g("div",{className:"mb-4 rounded-md border border-orange-200 bg-orange-50 p-4 text-sm text-orange-800 dark:border-orange-900 dark:bg-orange-900/20 dark:text-orange-100",role:"alert",children:g("div",{className:"flex items-start gap-3",children:[g("span",{className:"text-lg leading-none",children:"⚠️"}),g("div",{children:[g("strong",{children:E.t("embedded_browser_detected")}),g("p",{className:"mt-1 text-xs opacity-90",children:E.t("embedded_browser_warning",{browserName:c||"app"})})]})]})}),g("div",{className:"mb-4 text-lg font-medium sm:text-2xl",children:E.t("welcome")}),g("div",{className:"mb-8 text-gray-300",children:h?E.t("login_description_template",{authMethod:E.t(w,{defaultValue:u&&d?"email or phone number":u?"email address":"phone number"}).toLocaleLowerCase(),defaultValue:"Sign in with your {{authMethod}}"}):E.t("login_description_social_only","Choose how to login")}),g("div",{className:"flex flex-1 flex-col justify-center",children:[h&&g(un,{className:"mb-7",children:[g("input",{type:m,name:y,placeholder:_,className:fe("mb-2 w-full rounded-lg border bg-gray-100 px-4 py-5 text-base lowercase placeholder:normal-case placeholder:text-gray-300 dark:bg-gray-600 md:text-base",{"border-red":t,"border-gray-100 dark:border-gray-500":!t}),required:!0,value:i||""}),t&&g(tt,{children:t}),g(Me,{className:"sm:mt-4 !text-base",children:[g("span",{children:E.t("continue")}),g(Ge,{className:"text-xs",name:"arrow-right"})]})]}),h&&p.length>0&&g("div",{className:"relative mb-5 block text-center text-gray-300 dark:text-gray-300",children:[g("div",{className:"absolute left-0 right-0 top-1/2 border-b border-gray-200 dark:border-gray-600"}),g("div",{className:"relative inline-block bg-white px-2 dark:bg-gray-800",children:E.t("continue_social_login")})]}),g("div",{className:"flex space-x-4 sm:flex-col sm:space-x-0 sm:space-y-4 short:flex-row short:space-x-4 short:space-y-0",children:p.map(v=>{const $=v.logo;return g(fv,{connection:v.connectionName,text:E.t("continue_with",{provider:v.displayName}),canResize:!0,icon:g($,{className:"h-5 w-5 sm:absolute sm:left-4 sm:top-1/2 sm:h-6 sm:w-6 sm:-translate-y-1/2 short:static short:left-auto short:top-auto short:h-5 short:w-5 short:translate-y-0",iconUrl:v.iconUrl}),loginSession:r},v.connectionName)})})]})]})},_z="https://assets.sesamy.com/images/login-bg.jpg",Le=({title:t,children:e,theme:n,branding:r})=>{const i=n?.page_background?.page_layout||"center",s=n?.page_background?.background_color||"#ffffff",a=n?.page_background?.background_image_url,c=a??_z,l=c?.startsWith("linear-gradient")||c?.startsWith("radial-gradient")||c?.startsWith("conic-gradient"),u=c?l?c:`url(${c})`:void 0;let d="justify-center",f="p-6 md:p-10";i==="left"?(d="justify-start",f="pl-12 pr-6 py-6 md:pl-20 md:pr-10 md:py-10"):i==="right"&&(d="justify-end",f="pr-12 pl-6 py-6 md:pr-20 md:pl-10 md:py-10");const p=fe("min-h-screen w-full flex bg-cover bg-center",d,f),h={...u&&{backgroundImage:u},backgroundColor:s,display:"flex",alignItems:"stretch",justifyContent:i==="left"?"flex-start":i==="right"?"flex-end":"center",minHeight:"100vh",width:"100%"},m=fe("w-full max-w-sm","flex flex-col justify-center");return g("html",{lang:E.language||"en",children:[g("head",{children:[g("title",{children:t}),g("meta",{charset:"UTF-8"}),g("meta",{name:"robots",content:"noindex, follow"}),g("link",{rel:"stylesheet",href:"/u/css/tailwind.css"}),g("link",{rel:"stylesheet",href:"/u/css/shadcn-ui.css"}),g("meta",{name:"viewport",content:"width=device-width, initial-scale=1, maximum-scale=1"}),g("meta",{name:"theme-color",content:"#000000"}),r?.favicon_url&&g("link",{rel:"icon",type:"image/x-icon",href:r.favicon_url}),n?.fonts?.font_url&&g("link",{rel:"stylesheet",href:n.fonts.font_url})]}),g("body",{children:[g("div",{className:p,style:h,children:g("div",{className:m,children:[e,r?.powered_by_logo_url&&g("div",{className:"mt-5 text-left",children:g("a",{href:"https://authhero.com",target:"_blank",rel:"noopener noreferrer",className:"inline-block",children:g("img",{src:r.powered_by_logo_url,alt:"Powered by",className:"h-9 opacity-60 hover:opacity-100 transition-opacity"})})})]})}),g("div",{id:"client-root"}),g("script",{type:"module",src:"/u/js/client.js"})]})]})};class yz{parse(e){const n=this.detectEmbedded(e);return{browser:n.browser,isEmbedded:n.isEmbedded}}detectEmbedded(e){const n=[[/wv\)/i,"WebView"],[/GSA\//i,"Google Search App"],[/FBAN\//i,"Facebook"],[/FBAV\//i,"Facebook"],[/Instagram/i,"Instagram"],[/Snapchat/i,"Snapchat"],[/TikTok/i,"TikTok"],[/Twitter/i,"Twitter/X"],[/LinkedIn/i,"LinkedIn"],[/UC Browser/i,"UC Browser"],[/SamsungBrowser/i,"Samsung Internet"],[/Electron/i,"Electron"],[/Tauri/i,"Tauri"]];for(const[r,i]of n)if(r.test(e))return{isEmbedded:!0,browser:{name:i}};return{isEmbedded:!1}}}function a_(t){const n=new yz().parse(t);return{isEmbedded:n.isEmbedded??!1,browserName:n.browser?.name}}const bz=new o.OpenAPIHono().openapi(o.createRoute({tags:["login"],method:"get",path:"/",request:{query:o.z.object({state:o.z.string().openapi({description:"The state parameter from the authorization request"}),impersonation:o.z.string().optional()})},responses:{200:{description:"Response"}}}),async t=>{const{state:e}=t.req.valid("query"),{theme:n,branding:r,loginSession:i,client:s,useShadcn:a}=await Ie(t,e),c=t.req.header("user-agent")||"",{isEmbedded:l,browserName:u}=a_(c);return a?t.html(g(Le,{title:E.t("welcome","Login"),theme:n,branding:r,client:s,children:g(Ia,{theme:n,branding:r,loginSession:i,client:s,email:i.authParams.username,isEmbedded:l,browserName:u})})):t.html(g(ja,{theme:n,branding:r,loginSession:i,client:s,email:i.authParams.username,isEmbedded:l,browserName:u}))}).openapi(o.createRoute({tags:["login"],method:"post",path:"/",request:{query:o.z.object({state:o.z.string().openapi({description:"The state parameter from the authorization request"}),style:o.z.enum(["classic","shadcn"]).optional().openapi({description:"UI style to use for the login page"})}),body:{content:{"application/x-www-form-urlencoded":{schema:o.z.object({username:o.z.string().transform(t=>t.toLowerCase()),login_selection:o.z.enum(["code","password"]).optional()})}}}},responses:{400:{description:"Error response"},302:{description:"Redirect to enter code or password"}}}),async t=>{const{env:e}=t,{state:n}=t.req.valid("query"),r=t.req.valid("form");t.set("body",r),t.set("username",r.username);const{client:i,loginSession:s,theme:a,branding:c,useShadcn:l}=await Ie(t,n);t.set("client_id",i.client_id);const u=t.req.header("user-agent")||"",{isEmbedded:d,browserName:f}=a_(u),p=t.get("countryCode"),{normalized:h,connectionType:m,provider:y}=tu(r.username,p),w=h?m==="email"?await tl({userAdapter:e.data.users,tenant_id:i.tenant.id,email:h}):await Oi({userAdapter:e.data.users,tenant_id:i.tenant.id,username:h,provider:y}):null;if(!(i.connections.find(N=>N.strategy===m)||w)||!h)return l?t.html(g(Le,{title:E.t("welcome","Login"),theme:a,branding:c,client:i,children:g(Ia,{theme:a,branding:c,loginSession:s,error:E.t("invalid_identifier"),email:r.username,client:i,isEmbedded:d,browserName:f})}),400):t.html(g(ja,{theme:a,branding:c,loginSession:s,error:E.t("invalid_identifier"),email:r.username,client:i}),400);if(w&&t.set("user_id",w.user_id),!w){const N=await Cb(t,i,t.env.data,h,m);if(!N.allowed)return await ye(t,i.tenant.id,{type:ge.FAILED_SIGNUP,description:N.reason||"Public signup is disabled"}),l?t.html(g(Le,{title:E.t("welcome","Login"),theme:a,branding:c,client:i,children:g(Ia,{theme:a,branding:c,loginSession:s,error:E.t("user_account_does_not_exist"),email:r.username,client:i,isEmbedded:d,browserName:f})}),400):t.html(g(ja,{theme:a,branding:c,loginSession:s,error:E.t("user_account_does_not_exist"),email:r.username,client:i,isEmbedded:d,browserName:f}),400)}if(s.authParams.username=h,await e.data.loginSessions.update(i.tenant.id,s.id,s),await lz(t,i,r.username,m,r.login_selection)==="password")return t.redirect(`/u/enter-password?state=${n}`);let v=pr(),$=await e.data.codes.get(i.tenant.id,v,"otp");for(;$;)v=pr(),$=await e.data.codes.get(i.tenant.id,v,"otp");const b=await t.env.data.codes.create(i.tenant.id,{code_id:v,code_type:"otp",login_id:s.id,expires_at:new Date(Date.now()+ka).toISOString(),redirect_uri:s.authParams.redirect_uri}),z=i.connections.find(N=>N.strategy===m);if(!z)throw new I(400,{message:E.t("connection_not_found",{connection:m})});const A=s.authParams?.ui_locales?.split(" ")?.map(N=>N.split("-")[0])[0];return m==="email"&&z.options.authentication_method==="magic_link"?await Hf(t,{to:h,code:b.code_id,authParams:s.authParams,language:A}):await Ff(t,{to:h,code:b.code_id,language:A}),t.redirect(`/u/enter-code?state=${n}`)}),Ct=t=>g("a",{className:"block text-primary hover:text-primaryHover text-center",href:`/u/login/identifier?state=${t.state}`,children:E.t("go_back")});var xs="_hp",wz={Change:"Input",DoubleClick:"DblClick"},vz={svg:"2000/svg",math:"1998/Math/MathML"},ks=[],s0=new WeakMap,Ji=void 0,xz=()=>Ji,Rn=t=>"t"in t,Ru={onClick:["click",!1]},c_=t=>{if(!t.startsWith("on"))return;if(Ru[t])return Ru[t];const e=t.match(/^on([A-Z][a-zA-Z]+?(?:PointerCapture)?)(Capture)?$/);if(e){const[,n,r]=e;return Ru[t]=[(wz[n]||n).toLowerCase(),!!r]}},l_=(t,e)=>Ji&&t instanceof SVGElement&&/[A-Z]/.test(e)&&(e in t.style||e.match(/^(?:o|pai|str|u|ve)/))?e.replace(/([A-Z])/g,"-$1").toLowerCase():e,kz=(t,e,n)=>{e||={};for(let r in e){const i=e[r];if(r!=="children"&&(!n||n[r]!==i)){r=ic(r);const s=c_(r);if(s){if(n?.[r]!==i&&(n&&t.removeEventListener(s[0],n[r],s[1]),i!=null)){if(typeof i!="function")throw new Error(`Event handler for "${r}" is not a function`);t.addEventListener(s[0],i,s[1])}}else if(r==="dangerouslySetInnerHTML"&&i)t.innerHTML=i.__html;else if(r==="ref"){let a;typeof i=="function"?a=i(t)||(()=>i(null)):i&&"current"in i&&(i.current=t,a=()=>i.current=null),s0.set(t,a)}else if(r==="style"){const a=t.style;typeof i=="string"?a.cssText=i:(a.cssText="",i!=null&&Lb(i,a.setProperty.bind(a)))}else{if(r==="value"){const c=t.nodeName;if(c==="INPUT"||c==="TEXTAREA"||c==="SELECT"){if(t.value=i==null||i===!1?null:i,c==="TEXTAREA"){t.textContent=i;continue}else if(c==="SELECT"){t.selectedIndex===-1&&(t.selectedIndex=0);continue}}}else(r==="checked"&&t.nodeName==="INPUT"||r==="selected"&&t.nodeName==="OPTION")&&(t[r]=i);const a=l_(t,r);i==null||i===!1?t.removeAttribute(a):i===!0?t.setAttribute(a,""):typeof i=="string"||typeof i=="number"?t.setAttribute(a,i):t.setAttribute(a,i.toString())}}}if(n)for(let r in n){const i=n[r];if(r!=="children"&&!(r in e)){r=ic(r);const s=c_(r);s?t.removeEventListener(s[0],i,s[1]):r==="ref"?s0.get(t)?.():t.removeAttribute(l_(t,r))}}},$z=(t,e)=>{e[Ue][0]=0,ks.push([t,e]);const n=e.tag[O0]||e.tag,r=n.defaultProps?{...n.defaultProps,...e.props}:e.props;try{return[n.call(null,r)]}finally{ks.pop()}},hv=(t,e,n,r,i)=>{t.vR?.length&&(r.push(...t.vR),delete t.vR),typeof t.tag=="function"&&t[Ue][1][yv]?.forEach(s=>i.push(s)),t.vC.forEach(s=>{if(Rn(s))n.push(s);else if(typeof s.tag=="function"||s.tag===""){s.c=e;const a=n.length;if(hv(s,e,n,r,i),s.s){for(let c=a;c<n.length;c++)n[c].s=!0;s.s=!1}}else n.push(s),s.vR?.length&&(r.push(...s.vR),delete s.vR)})},Sz=t=>{for(;;t=t.tag===xs||!t.vC||!t.pP?t.nN:t.vC[0]){if(!t)return null;if(t.tag!==xs&&t.e)return t.e}},gv=t=>{Rn(t)||(t[Ue]?.[1][yv]?.forEach(e=>e[2]?.()),s0.get(t.e)?.(),t.p===2&&t.vC?.forEach(e=>e.p=2),t.vC?.forEach(gv)),t.p||(t.e?.remove(),delete t.e),typeof t.tag=="function"&&(Bo.delete(t),Ta.delete(t),delete t[Ue][3],t.a=!0)},mv=(t,e,n)=>{t.c=e,_v(t,e,n)},u_=(t,e)=>{if(e){for(let n=0,r=t.length;n<r;n++)if(t[n]===e)return n}},d_=Symbol(),_v=(t,e,n)=>{const r=[],i=[],s=[];hv(t,e,r,i,s),i.forEach(gv);const a=n?void 0:e.childNodes;let c,l=null;if(n)c=-1;else if(!a.length)c=0;else{const u=u_(a,Sz(t.nN));u!==void 0?(l=a[u],c=u):c=u_(a,r.find(d=>d.tag!==xs&&d.e)?.e)??-1,c===-1&&(n=!0)}for(let u=0,d=r.length;u<d;u++,c++){const f=r[u];let p;if(f.s&&f.e)p=f.e,f.s=!1;else{const h=n||!f.e;Rn(f)?(f.e&&f.d&&(f.e.textContent=f.t),f.d=!1,p=f.e||=document.createTextNode(f.t)):(p=f.e||=f.n?document.createElementNS(f.n,f.tag):document.createElement(f.tag),kz(p,f.props,f.pP),_v(f,p,h))}f.tag===xs?c--:n?p.parentNode||e.appendChild(p):a[c]!==p&&a[c-1]!==p&&(a[c+1]===p?e.appendChild(a[c]):e.insertBefore(p,l||a[c]||null))}if(t.pP&&delete t.pP,s.length){const u=[],d=[];s.forEach(([,f,,p,h])=>{f&&u.push(f),p&&d.push(p),h?.()}),u.forEach(f=>f()),d.length&&requestAnimationFrame(()=>{d.forEach(f=>f())})}},zz=(t,e)=>!!(t&&t.length===e.length&&t.every((n,r)=>n[1]===e[r][1])),Ta=new WeakMap,a0=(t,e,n)=>{const r=!n&&e.pC;n&&(e.pC||=e.vC);let i;try{n||=typeof e.tag=="function"?$z(t,e):As(e.props.children),n[0]?.tag===""&&n[0][Pd]&&(i=n[0][Pd],t[5].push([t,i,e]));const s=r?[...e.pC]:e.vC?[...e.vC]:void 0,a=[];let c;for(let l=0;l<n.length;l++){Array.isArray(n[l])&&n.splice(l,1,...n[l].flat());let u=Az(n[l]);if(u){typeof u.tag=="function"&&!u.tag[Ib]&&(Pi.length>0&&(u[Ue][2]=Pi.map(f=>[f,f.values.at(-1)])),t[5]?.length&&(u[Ue][3]=t[5].at(-1)));let d;if(s&&s.length){const f=s.findIndex(Rn(u)?p=>Rn(p):u.key!==void 0?p=>p.key===u.key&&p.tag===u.tag:p=>p.tag===u.tag);f!==-1&&(d=s[f],s.splice(f,1))}if(d)if(Rn(u))d.t!==u.t&&(d.t=u.t,d.d=!0),u=d;else{const f=d.pP=d.props;if(d.props=u.props,d.f||=u.f||e.f,typeof u.tag=="function"){const p=d[Ue][2];d[Ue][2]=u[Ue][2]||[],d[Ue][3]=u[Ue][3],!d.f&&((d.o||d)===u.o||d.tag[g5]?.(f,d.props))&&zz(p,d[Ue][2])&&(d.s=!0)}u=d}else if(!Rn(u)&&Ji){const f=Zi(Ji);f&&(u.n=f)}if(!Rn(u)&&!u.s&&(a0(t,u),delete u.f),a.push(u),c&&!c.s&&!u.s)for(let f=c;f&&!Rn(f);f=f.vC?.at(-1))f.nN=u;c=u}}e.vR=r?[...e.vC,...s||[]]:s||[],e.vC=a,r&&delete e.pC}catch(s){if(e.f=!0,s===d_){if(i)return;throw s}const[a,c,l]=e[Ue]?.[3]||[];if(c){const u=()=>Oa([0,!1,t[2]],l),d=Ta.get(l)||[];d.push(u),Ta.set(l,d);const f=c(s,()=>{const p=Ta.get(l);if(p){const h=p.indexOf(u);if(h!==-1)return p.splice(h,1),u()}});if(f){if(t[0]===1)t[1]=!0;else if(a0(t,l,[f]),(c.length===1||t!==a)&&l.c){mv(l,l.c,!1);return}throw d_}}throw s}finally{i&&t[5].pop()}},Az=t=>{if(!(t==null||typeof t=="boolean")){if(typeof t=="string"||typeof t=="number")return{t:t.toString(),d:!0};if("vR"in t&&(t={tag:t.tag,props:t.props,key:t.key,f:t.f,type:t.tag,ref:t.props.ref,o:t.o||t}),typeof t.tag=="function")t[Ue]=[0,[]];else{const e=vz[t.tag];e&&(Ji||=Tb(""),t.props.children=[{tag:Ji,props:{value:t.n=`http://www.w3.org/${e}`,children:t.props.children}}])}return t}},p_=(t,e)=>{e[Ue][2]?.forEach(([n,r])=>{n.values.push(r)});try{a0(t,e,void 0)}catch{return}if(e.a){delete e.a;return}e[Ue][2]?.forEach(([n])=>{n.values.pop()}),(t[0]!==1||!t[1])&&mv(e,e.c,!1)},Bo=new WeakMap,f_=[],Oa=async(t,e)=>{t[5]||=[];const n=Bo.get(e);n&&n[0](void 0);let r;const i=new Promise(s=>r=s);if(Bo.set(e,[r,()=>{t[2]?t[2](t,e,s=>{p_(s,e)}).then(()=>r(e)):(p_(t,e),r(e))}]),f_.length)f_.at(-1).add(e);else{await Promise.resolve();const s=Bo.get(e);s&&(Bo.delete(e),s[1]())}return i},Ez=(t,e,n)=>({tag:xs,props:{children:t},key:n,e,p:1}),Cz=0,yv=1,Nz=2,Iz=3,Lu=new WeakMap,bv=(t,e)=>!t||!e||t.length!==e.length||e.some((n,r)=>n!==t[r]),jz=void 0,h_=[],Tz=t=>{const e=()=>typeof t=="function"?t():t,n=ks.at(-1);if(!n)return[e(),()=>{}];const[,r]=n,i=r[Ue][1][Cz]||=[],s=r[Ue][0]++;return i[s]||=[e(),a=>{const c=jz,l=i[s];if(typeof a=="function"&&(a=a(l[0])),!Object.is(a,l[0]))if(l[0]=a,h_.length){const[u,d]=h_.at(-1);Promise.all([u===3?r:Oa([u,!1,c],r),d]).then(([f])=>{if(!f||!(u===2||u===3))return;const p=f.vC;requestAnimationFrame(()=>{setTimeout(()=>{p===f.vC&&Oa([u===3?1:0,!1,c],f)})})})}else Oa([0,!1,c],r)}]},Kf=(t,e)=>{const n=ks.at(-1);if(!n)return t;const[,r]=n,i=r[Ue][1][Nz]||=[],s=r[Ue][0]++,a=i[s];return bv(a?.[1],e)?i[s]=[t,e]:t=i[s][0],t},Oz=t=>{const e=Lu.get(t);if(e){if(e.length===2)throw e[1];return e[0]}throw t.then(n=>Lu.set(t,[n]),n=>Lu.set(t,[void 0,n])),t},Pz=(t,e)=>{const n=ks.at(-1);if(!n)return t();const[,r]=n,i=r[Ue][1][Iz]||=[],s=r[Ue][0]++,a=i[s];return bv(a?.[1],e)&&(i[s]=[t(),e]),i[s][0]},Rz=Tb({pending:!1,data:null,method:null,action:null}),g_=new Set,Lz=t=>{g_.add(t),t.finally(()=>g_.delete(t))},Gf=(t,e)=>Pz(()=>n=>{let r;t&&(typeof t=="function"?r=t(n)||(()=>{t(null)}):t&&"current"in t&&(t.current=n,r=()=>{t.current=null}));const i=e(n);return()=>{i?.(),r?.()}},[t]),m_=Object.create(null),__=Object.create(null),Ys=(t,e,n,r,i)=>{if(e?.itemProp)return{tag:t,props:e,type:t,ref:e.ref};const s=document.head;let{onLoad:a,onError:c,precedence:l,blocking:u,...d}=e,f=null,p=!1;const h=$a[t];let m;if(h.length>0){const k=s.querySelectorAll(t);e:for(const v of k)for(const $ of $a[t])if(v.getAttribute($)===e[$]){f=v;break e}if(!f){const v=h.reduce(($,b)=>e[b]===void 0?$:`${$}-${b}-${e[b]}`,t);p=!__[v],f=__[v]||=(()=>{const $=document.createElement(t);for(const b of h)e[b]!==void 0&&$.setAttribute(b,e[b]),e.rel&&$.setAttribute("rel",e.rel);return $})()}}else m=s.querySelectorAll(t);l=r?l??"":void 0,r&&(d[Sa]=l);const y=Kf(k=>{if(h.length>0){let v=!1;for(const $ of s.querySelectorAll(t)){if(v&&$.getAttribute(Sa)!==l){s.insertBefore(k,$);return}$.getAttribute(Sa)===l&&(v=!0)}s.appendChild(k)}else if(m){let v=!1;for(const $ of m)if($===k){v=!0;break}v||s.insertBefore(k,s.contains(m[0])?m[0]:s.querySelector(t)),m=void 0}},[l]),w=Gf(e.ref,k=>{const v=h[0];if(n===2&&(k.innerHTML=""),(p||m)&&y(k),!c&&!a)return;let $=m_[k.getAttribute(v)]||=new Promise((b,z)=>{k.addEventListener("load",b),k.addEventListener("error",z)});a&&($=$.then(a)),c&&($=$.catch(c)),$.catch(()=>{})});if(i&&u==="render"){const k=$a[t][0];if(e[k]){const v=e[k],$=m_[v]||=new Promise((b,z)=>{y(f),f.addEventListener("load",b),f.addEventListener("error",z)});Oz($)}}const _={tag:t,type:t,props:{...d,ref:w},ref:w};return _.p=n,f&&(_.e=f),Ez(_,s)},Bz=t=>{const e=xz();return(e&&Zi(e))?.endsWith("svg")?{tag:"title",props:t,type:"title",ref:t.ref}:Ys("title",t,void 0,!1,!1)},Dz=t=>!t||["src","async"].some(e=>!t[e])?{tag:"script",props:t,type:"script",ref:t.ref}:Ys("script",t,1,!1,!0),Uz=t=>!t||!["href","precedence"].every(e=>e in t)?{tag:"style",props:t,type:"style",ref:t.ref}:(t["data-href"]=t.href,delete t.href,Ys("style",t,2,!0,!0)),Mz=t=>!t||["onLoad","onError"].some(e=>e in t)||t.rel==="stylesheet"&&(!("precedence"in t)||"disabled"in t)?{tag:"link",props:t,type:"link",ref:t.ref}:Ys("link",t,1,"precedence"in t,!0),qz=t=>Ys("meta",t,void 0,!1,!1),wv=Symbol(),Fz=t=>{const{action:e,...n}=t;typeof e!="function"&&(n.action=e);const[r,i]=Tz([null,!1]),s=Kf(async u=>{const d=u.isTrusted?e:u.detail[wv];if(typeof d!="function")return;u.preventDefault();const f=new FormData(u.target);i([f,!0]);const p=d(f);p instanceof Promise&&(Lz(p),await p),i([null,!0])},[]),a=Gf(t.ref,u=>(u.addEventListener("submit",s),()=>{u.removeEventListener("submit",s)})),[c,l]=r;return r[1]=!1,{tag:Rz,props:{value:{pending:c!==null,data:c,method:c?"post":null,action:c?e:null},children:{tag:"form",props:{...n,ref:a},type:"form",ref:a}},f:l}},vv=(t,{formAction:e,...n})=>{if(typeof e=="function"){const r=Kf(i=>{i.preventDefault(),i.currentTarget.form.dispatchEvent(new CustomEvent("submit",{detail:{[wv]:e}}))},[]);n.ref=Gf(n.ref,i=>(i.addEventListener("click",r),()=>{i.removeEventListener("click",r)}))}return{tag:t,props:n,type:t,ref:n.ref}},Hz=t=>vv("input",t),Vz=t=>vv("button",t);Object.assign(Rd,{title:Bz,script:Dz,style:Uz,link:Mz,meta:qz,form:Fz,input:Hz,button:Vz});Ob(null);new TextEncoder;const fr=t=>{const{i18nKey:e,values:n,components:r}=t,i=E.t(e,n),s=/<(\d+)>(.*?)<\/\d+>/g,a=[];let c=0,l;for(;(l=s.exec(i))!==null;){const[,u,d]=l,f=i.substring(c,l.index);f&&a.push(f);const p=parseInt(u,10);a.push(C5(r[p],{},d)),c=s.lastIndex}return c<i.length&&a.push(i.substring(c)),g(rs,{children:a})},y_=6,c0=({error:t,theme:e,branding:n,email:r,state:i,client:s,hasPasswordLogin:a})=>{const c=new URLSearchParams({state:i}),u=s.connections.map(({name:d})=>d).includes("auth2");return g(qe,{title:E.t("verify_your_email"),theme:e,branding:n,client:s,children:[g("div",{className:"mb-4 text-2xl font-medium",children:E.t("verify_your_email")}),g("div",{className:"mb-8 text-gray-300",children:g(fr,{i18nKey:"code_sent_template",components:[g("span",{className:"text-black dark:text-white"},"span")],values:{username:r}})}),g("div",{className:"flex flex-1 flex-col justify-center",children:[g(un,{className:"pt-2",children:[g("input",{autoFocus:!0,type:"text",pattern:"[0-9]*",maxLength:y_,inputMode:"numeric",name:"code",placeholder:"******",className:fe("mb-2 w-full rounded-lg border bg-gray-100 px-4 pb-2 pt-2.5 text-center indent-[5px] font-mono text-3xl placeholder:text-gray-300 dark:bg-gray-600 md:text-3xl",{"border-red":t,"border-gray-100 dark:border-gray-500":!t}),minLength:y_,required:!0,id:"code-input"}),t&&g(tt,{children:t}),g(Me,{className:"sm:mt-4 !text-base",children:[g("span",{children:E.t("login")}),g(Ge,{className:"text-xs",name:"arrow-right"})]}),g("div",{className:"my-4 flex space-x-2 text-sm text-[#B2B2B2]",children:[g(Ge,{className:"text-base",name:"info-bubble"}),g("div",{className:"text-sm text-gray-300 md:text-sm",children:E.t("sent_code_spam")})]}),u&&g("div",{className:"text-center mb-12",children:[g("div",{className:"relative mb-5 block text-center text-gray-300 dark:text-gray-300",children:[g("div",{className:"absolute left-0 right-0 top-1/2 border-b border-gray-200 dark:border-gray-600"}),g("div",{className:"relative inline-block bg-white px-2 dark:bg-gray-800",children:E.t("or")})]}),g(Me,{Component:"a",href:`/u/${a?"enter-password":"pre-signup"}?${c.toString()}`,variant:"secondary",className:"block",children:E.t("enter_your_password_btn")})]})]}),g(Ct,{state:i})]})]})},Kz=({maxLength:t,value:e="",disabled:n=!1,className:r,containerClassName:i,name:s,id:a,required:c,autoFocus:l})=>g("div",{className:fe("flex items-center gap-2 has-[:disabled]:opacity-50",i),"data-input-otp-container":"",children:Array.from({length:t}).map((u,d)=>g("input",{type:"text",inputMode:"numeric",maxLength:1,value:e[d]||"",disabled:n,name:d===0?s:void 0,id:d===0?a:void 0,required:d===0?c:void 0,autoFocus:d===0?l:void 0,className:fe("relative flex h-9 w-9 items-center justify-center border-y border-r border-input text-sm shadow-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md text-center font-mono","focus:z-10 focus:ring-1 focus:ring-ring","disabled:cursor-not-allowed disabled:opacity-50",r),"data-input-otp-slot":d},d))}),Gz=6,b_=({error:t,theme:e,branding:n,email:r,state:i,hasPasswordLogin:s,className:a})=>{const c=new URLSearchParams({state:i}),l=e?.colors?.primary_button||n?.colors?.primary||"#0066cc",u=e?.colors?.primary_button_label||"#ffffff",d=e?.colors?.body_text||"#333333",f=e?.colors?.input_border||"#d1d5db",p=e?.colors?.widget_background||"#ffffff",h=e?.colors?.widget_border||"#e5e7eb",m=e?.borders?.widget_corner_radius||8,y=e?.borders?.button_border_radius||4,w=e?.borders?.show_widget_shadow??!0,_=e?.fonts?.title?.size||24,k=e?.fonts?.title?.bold??!0,v=e?.fonts?.body_text?.size||14,$={backgroundColor:p,borderColor:h,borderRadius:`${m}px`,boxShadow:w?"0 1px 3px 0 rgba(0, 0, 0, 0.1)":"none",color:d},b={fontSize:`${_}px`,fontWeight:k?"700":"400",color:e?.colors?.header||d},z={fontSize:`${v}px`,color:e?.colors?.input_labels_placeholders||"#6b7280"},A={backgroundColor:l,color:u,borderRadius:`${y}px`},N=e?.widget?.logo_position||"center",O=N==="left"?"text-left":N==="right"?"text-right":"text-center",L=e?.widget?.logo_url||n?.logo_url,C=N!=="none"&&L;return g("div",{className:fe("flex flex-col gap-6 w-full max-w-sm",a),children:[g(Sn,{style:$,className:"border",children:[g(zn,{children:[C&&g("div",{className:fe("mb-4",O),children:g(ln,{theme:e,branding:n})}),g(An,{style:b,children:E.t("verify_your_email","Verify your email")}),g(En,{style:z,children:g(fr,{i18nKey:"code_sent_template",components:[g("span",{className:"font-medium"},"span")],values:{username:r}})})]}),g(Cn,{children:g("form",{method:"post",children:g("div",{className:"grid gap-6",children:[g("div",{className:"grid gap-4",children:[g(Lt,{htmlFor:"code",style:z,children:E.t("verification_code","Verification Code")}),g("div",{className:"flex justify-center",children:g(Kz,{maxLength:Gz,name:"code",id:"code",required:!0,autoFocus:!0,containerClassName:"gap-2",className:fe("w-12 h-12 text-center text-lg font-mono border rounded-md transition-colors",t?"border-red-500 focus:ring-red-500":"border-gray-300 focus:ring-blue-500 focus:border-blue-500")})}),t&&g(tt,{children:t})]}),g(wn,{type:"submit",className:"w-full transition-colors hover:brightness-90",style:A,children:E.t("login","Login")}),g("div",{className:"text-center text-xs text-gray-500",children:g("div",{className:"flex items-center justify-center gap-1",children:[g("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",children:g("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z",clipRule:"evenodd"})}),g("span",{children:E.t("sent_code_spam","Check your spam folder if you don't see the code")})]})}),s&&g("div",{className:"text-center",children:[g("div",{className:"relative mb-5 block text-center",style:z,children:[g("div",{className:"absolute left-0 right-0 top-1/2 border-b",style:{borderColor:h}}),g("div",{className:"relative inline-block px-2",style:{backgroundColor:p},children:E.t("or","Or")})]}),g("a",{href:`/u/${s?"enter-password":"pre-signup"}?${c.toString()}`,className:fe("w-full inline-flex items-center justify-center gap-2 rounded-md font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-500","border border-gray-300 bg-transparent hover:bg-gray-100 dark:border-gray-600 dark:hover:bg-gray-800","h-10 px-4 py-2"),style:{borderColor:f,borderRadius:`${y}px`,color:d},children:E.t("enter_your_password_btn","Enter your password instead")})]})]})})})]}),g(Ct,{state:i})]})},Dt=t=>{const{message:e,theme:n,branding:r,client:i,pageTitle:s,state:a}=t;return g(qe,{title:"Login",theme:n,branding:r,client:i,children:[s?g("div",{className:"mb-4 text-2xl font-medium",children:s}):"",g("div",{className:"text-gray-300 mb-12",children:e}),a?g(Ct,{state:a}):""]})},Wz=new o.OpenAPIHono().openapi(o.createRoute({tags:["login"],method:"get",path:"/",request:{query:o.z.object({state:o.z.string().openapi({description:"The state"}),style:o.z.enum(["classic","shadcn"]).optional().openapi({description:"UI style to use for the enter code page"})})},responses:{200:{description:"HTML page to enter verification code.",content:{"text/html":{schema:o.z.string()}}},400:{description:"Bad Request - HTML error page if username is missing in state.",content:{"text/html":{schema:o.z.string()}}},500:{description:"Internal Server Error - HTML error page.",content:{"text/html":{schema:o.z.string()}}}}}),async t=>{const{state:e,style:n}=t.req.valid("query");let r,i,s,a,c;n&&Em(t,"auth_ui_style",n,{path:"/",maxAge:3600*24*365,httpOnly:!0,secure:!0,sameSite:"Lax"});try{if({theme:r,branding:i,loginSession:s,client:a,useShadcn:c}=await Ie(t,e),!s.authParams.username)return t.html(g(Dt,{theme:r,branding:i,client:a,state:e,pageTitle:E.t("error_page_title")||"Error",message:E.t("username_not_found_error")||"Username not found in session."}),400);const l=await Oi({userAdapter:t.env.data.users,tenant_id:a.tenant.id,username:s.authParams.username,provider:"auth2"});return c?t.html(g(Le,{title:E.t("verify_your_email","Verify your email"),theme:r,branding:i,client:a,children:g(b_,{theme:r,branding:i,email:s.authParams.username,state:e,hasPasswordLogin:!!l})})):t.html(g(c0,{theme:r,branding:i,email:s.authParams.username,state:e,client:a,hasPasswordLogin:!!l}))}catch(l){return console.error("Error in GET /u/enter-code:",l),i||(i=null),r||(r=null),a||(a=null),t.html(g(Dt,{theme:r,branding:i,client:a,state:e,pageTitle:E.t("error_page_title")||"Error",message:E.t("unexpected_error_try_again")||"An unexpected error occurred. Please try again."}),500)}}).openapi(o.createRoute({tags:["login"],method:"post",path:"/",request:{query:o.z.object({state:o.z.string().openapi({description:"The state"}),style:o.z.enum(["classic","shadcn"]).optional().openapi({description:"UI style to use for the enter code page"})}),body:{content:{"application/x-www-form-urlencoded":{schema:o.z.object({code:o.z.string()})}}}},responses:{302:{description:"Redirect to continue authentication flow.",headers:o.z.object({Location:o.z.string().url()})},400:{description:"Bad Request - HTML page with an error message (e.g., invalid code, username missing).",content:{"text/html":{schema:o.z.string()}}},500:{description:"Internal Server Error - HTML error page for unexpected issues.",content:{"text/html":{schema:o.z.string()}}}}}),async t=>{const{state:e,style:n}=t.req.valid("query"),{code:r}=t.req.valid("form");n&&Em(t,"auth_ui_style",n,{path:"/",maxAge:3600*24*365,httpOnly:!0,secure:!0,sameSite:"Lax"});const{theme:i,branding:s,client:a,loginSession:c,useShadcn:l}=await Ie(t,e);if(!c.authParams.username)throw new I(400,{message:E.t("username_not_found_error")||"Username not found in session."});try{t.set("client_id",a.client_id);const u=await Uf(t,{client_id:a.client_id,authParams:c.authParams,username:c.authParams.username,otp:r});if(u instanceof Response)return u;throw new I(500,{message:E.t("unexpected_error_try_again")||"An unexpected error occurred. Please try again."})}catch(u){let d;try{d=await Oi({userAdapter:t.env.data.users,tenant_id:a.tenant.id,username:c.authParams.username,provider:"auth2"})}catch{d=null}return l?t.html(g(Le,{title:E.t("verify_your_email","Verify your email"),theme:i,branding:s,client:a,children:g(b_,{theme:i,branding:s,email:c.authParams?.username,state:e,error:u.message,hasPasswordLogin:!!d})}),400):t.html(g(c0,{theme:i,branding:s,email:c.authParams?.username,state:e,client:a,error:u.message,hasPasswordLogin:!!d}),400)}}),xv=t=>{const{theme:e,branding:n,client:r,state:i}=t;return g(qe,{title:E.t("unverified_email"),theme:e,branding:n,client:r,children:[g("div",{className:"flex flex-1 flex-col justify-center",children:[g("p",{className:"mb-8 text-gray-300 text-lg",children:E.t("unverified_email")}),g("div",{className:"my-4 flex space-x-2 text-sm text-[#B2B2B2]",children:[g(Ge,{className:"text-base",name:"info-bubble"}),g("div",{className:"text-sm text-gray-300 md:text-sm",children:E.t("sent_code_spam")})]}),g(Ct,{state:i})]}),g(Ct,{state:i})]})},Jz=({width:t=22,height:e=17,className:n,...r})=>g("svg",{width:t,height:e,className:n,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 576 512",...r,children:g("path",{fill:"currentColor",d:"M288 32c-80.8 0-145.5 36.8-192.6 80.6C48.6 156 17.3 208 2.5 243.7c-3.3 7.9-3.3 16.7 0 24.6C17.3 304 48.6 356 95.4 399.4 142.5 443.2 207.2 480 288 480s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1 3.3-7.9 3.3-16.7 0-24.6-14.9-35.7-46.2-87.7-93-131.1C433.5 68.8 368.8 32 288 32M144 256a144 144 0 1 1 288 0 144 144 0 1 1-288 0m144-64c0 35.3-28.7 64-64 64-7.1 0-13.9-1.2-20.3-3.3-5.5-1.8-11.9 1.6-11.7 7.4.3 6.9 1.3 13.8 3.2 20.7 13.7 51.2 66.4 81.6 117.6 67.9s81.6-66.4 67.9-117.6c-11.1-41.5-47.8-69.4-88.6-71.1-5.8-.2-9.2 6.1-7.4 11.7 2.1 6.4 3.3 13.2 3.3 20.3"})}),Xz=({width:t=23,height:e=18,className:n,...r})=>g("svg",{width:t,height:e,className:n,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 640 512",...r,children:g("path",{fill:"currentColor",d:"M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2s-6.3 25.5 4.1 33.7l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7l-105.2-82.4c39.6-40.6 66.4-86.1 79.9-118.4 3.3-7.9 3.3-16.7 0-24.6-14.9-35.7-46.2-87.7-93-131.1C465.5 68.8 400.8 32 320 32c-68.2 0-125 26.3-169.3 60.8zm184.3 144.4c25.5-23.3 59.6-37.5 96.9-37.5 79.5 0 144 64.5 144 144 0 24.9-6.3 48.3-17.4 68.7L408 294.5c8.4-19.3 10.6-41.4 4.8-63.3-11.1-41.5-47.8-69.4-88.6-71.1-5.8-.2-9.2 6.1-7.4 11.7 2.1 6.4 3.3 13.2 3.3 20.3 0 10.2-2.4 19.8-6.6 28.3l-90.3-70.8zM373 389.9c-16.4 6.5-34.3 10.1-53 10.1-79.5 0-144-64.5-144-144 0-6.9.5-13.6 1.4-20.2l-94.3-74.3c-22.8 29.7-39.1 59.3-48.6 82.2-3.3 7.9-3.3 16.7 0 24.6 14.9 35.7 46.2 87.7 93 131.1 47 43.8 111.7 80.6 192.5 80.6 47.8 0 89.9-12.9 126.2-32.5z"})}),l0=({name:t,placeholder:e=E.t("password")})=>g("div",{className:"password-input relative mb-2","data-password-toggle":!0,children:[g("input",{type:"password",name:t,placeholder:e,className:"w-full rounded-lg bg-gray-100 px-4 py-5 text-base placeholder:text-gray-300 dark:bg-gray-600 md:text-base",required:!0}),g("button",{type:"button","aria-label":E.t("show_password"),title:E.t("show_password"),className:"absolute right-0 top-0 w-10 h-full rounded-r-lg text-gray-400 column hover:bg-black/5","data-password-toggle-btn":!0,children:[g(Jz,{"data-show-icon":!0}),g(Xz,{"data-hide-icon":!0,className:"hidden"})]})]}),Pa=t=>{const{error:e,theme:n,branding:r,email:i,state:s,client:a}=t,c=new URLSearchParams({state:s});return g(qe,{title:E.t("enter_password"),theme:n,branding:r,client:a,children:[g("div",{className:"mb-4 text-lg font-medium sm:text-2xl",children:E.t("enter_password")}),g("div",{className:"mb-6 text-gray-300",children:E.t("enter_password_description")}),g("div",{className:"flex flex-1 flex-col justify-center",children:[g(un,{className:"mb-7",children:[g("input",{type:"text",name:"username",placeholder:E.t("email_placeholder"),className:"mb-2 w-full rounded-lg bg-gray-100 px-4 py-5 text-base placeholder:text-gray-300 dark:bg-gray-600 md:text-base",value:i}),g(l0,{name:"password"}),e&&g(tt,{children:e}),g(Me,{className:"sm:mt-4 !text-base",children:[g("span",{children:E.t("login")}),g(Ge,{className:"text-xs",name:"arrow-right"})]})]}),g("a",{href:`/u/forgot-password?${c.toString()}`,className:"text-primary hover:underline mb-4",children:E.t("forgot_password_link")}),g("div",{className:"text-center mb-12",children:[g("div",{className:"relative mb-5 block text-center text-gray-300 dark:text-gray-300",children:[g("div",{className:"absolute left-0 right-0 top-1/2 border-b border-gray-200 dark:border-gray-600"}),g("div",{className:"relative inline-block bg-white px-2 dark:bg-gray-800",children:E.t("or")})]}),g("form",{method:"post",action:`/u/login/identifier?${c.toString()}`,children:[g("input",{type:"hidden",name:"login_selection",value:"code"}),g("input",{type:"hidden",name:"username",value:i}),g(Me,{variant:"secondary",className:"block",children:E.t("enter_a_code_btn")})]})]}),g(Ct,{state:s})]})]})},Bu=({error:t,theme:e,branding:n,loginSession:r,email:i,className:s})=>{const a=e?.colors?.primary_button||n?.colors?.primary||"#0066cc",c=e?.colors?.primary_button_label||"#ffffff",l=e?.colors?.body_text||"#333333",u=e?.colors?.input_background||"#ffffff",d=e?.colors?.input_border||"#d1d5db",f=e?.colors?.input_filled_text||"#111827",p=e?.colors?.error||"#dc2626",h=e?.colors?.widget_background||"#ffffff",m=e?.colors?.widget_border||"#e5e7eb",y=e?.borders?.widget_corner_radius||8,w=e?.borders?.input_border_radius||4,_=e?.borders?.button_border_radius||4,k=e?.borders?.show_widget_shadow??!0,v=e?.fonts?.title?.size||24,$=e?.fonts?.title?.bold??!0,b=e?.fonts?.body_text?.size||14,z={backgroundColor:h,borderColor:m,borderRadius:`${y}px`,boxShadow:k?"0 1px 3px 0 rgba(0, 0, 0, 0.1)":"none",color:l},A={fontSize:`${v}px`,fontWeight:$?"700":"400",color:e?.colors?.header||l},N={fontSize:`${b}px`,color:e?.colors?.input_labels_placeholders||"#6b7280"},O={backgroundColor:u,borderColor:t?p:d,borderRadius:`${w}px`,color:f},L={backgroundColor:a,color:c,borderRadius:`${_}px`},C=e?.widget?.logo_position||"center",P=C==="left"?"text-left":C==="right"?"text-right":"text-center",M=e?.widget?.logo_url||n?.logo_url,K=C!=="none"&&M;return g("div",{className:fe("flex flex-col gap-6 w-full max-w-sm",s),children:g(Sn,{style:z,className:"border",children:[g(zn,{children:[K&&g("div",{className:fe("mb-4",P),children:g(ln,{theme:e,branding:n})}),g(An,{style:A,children:E.t("enter_password","Enter your password")}),g(En,{style:N,children:E.t("enter_password_description","Enter your password to continue")})]}),g(Cn,{children:g("form",{method:"post",children:g("div",{className:"grid gap-6",children:[g("div",{className:"grid gap-2",children:[g(Lt,{htmlFor:"email",style:N,children:E.t("email","Email")}),g(on,{id:"email",name:"username",type:"email",value:i,disabled:!0,className:"border bg-gray-50",style:{...O,cursor:"not-allowed"}})]}),g("div",{className:"grid gap-2",children:[g("div",{className:"flex items-center justify-between",children:[g(Lt,{htmlFor:"password",style:N,children:E.t("password","Password")}),g("a",{href:`/u/forgot-password?state=${r.id}`,className:"text-sm hover:underline",style:{color:a},children:E.t("forgot_password","Forgot password?")})]}),g("div",{className:"relative","data-password-toggle":!0,children:[g(on,{id:"password",name:"password",type:"password","data-password-input":"password",placeholder:E.t("password_placeholder","Enter your password"),required:!0,error:!!t,className:"border pr-8",style:O}),g("button",{type:"button","data-password-toggle-btn":!0,className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700 transition-colors","aria-label":E.t("toggle_password_visibility","Toggle password visibility"),children:[g("svg",{"data-show-icon":!0,xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[g("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"}),g("circle",{cx:"12",cy:"12",r:"3"})]}),g("svg",{"data-hide-icon":!0,className:"hidden",xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[g("path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24"}),g("path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68"}),g("path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61"}),g("line",{x1:"2",x2:"22",y1:"2",y2:"22"})]})]})]}),t&&g(tt,{children:t})]}),g(wn,{type:"submit",className:"w-full transition-colors hover:brightness-90",style:L,children:E.t("continue","Continue")}),g("div",{className:"text-center",children:g("a",{href:`/u/login/identifier?state=${r.id}`,className:"text-sm hover:underline",style:N,children:["← ",E.t("back","Back")]})})]})})})]})})},Zz=new o.OpenAPIHono().openapi(o.createRoute({tags:["login"],method:"get",path:"/",request:{query:o.z.object({state:o.z.string().openapi({description:"The state parameter from the authorization request"})})},responses:{200:{description:"Response"}}}),async t=>{const{state:e}=t.req.valid("query"),{theme:n,branding:r,client:i,loginSession:s,useShadcn:a}=await Ie(t,e);if(!s.authParams.username)throw new I(400,{message:"Username required"});return a?t.html(g(Le,{title:E.t("enter_your_password","Enter your password"),theme:n,branding:r,client:i,children:g(Bu,{theme:n,branding:r,loginSession:s,email:s.authParams.username,client:i})})):t.html(g(Pa,{theme:n,branding:r,email:s.authParams.username,state:e,client:i}))}).openapi(o.createRoute({tags:["login"],method:"post",path:"/",request:{query:o.z.object({state:o.z.string().openapi({description:"The state parameter from the authorization request"})}),body:{content:{"application/x-www-form-urlencoded":{schema:o.z.object({password:o.z.string()})}}}},responses:{200:{description:"HTML page indicating success or a next step (if not redirecting).",content:{"text/html":{schema:o.z.string()}}},302:{description:"Redirect to continue the authentication flow (e.g., to client, MFA, consent).",headers:o.z.object({Location:o.z.string().url()})},400:{description:"Bad Request - HTML page with an error message (e.g., invalid password, username required).",content:{"text/html":{schema:o.z.string()}}},500:{description:"Internal Server Error - HTML page with an error message.",content:{"text/html":{schema:o.z.string()}}}}}),async t=>{const{state:e}=t.req.valid("query"),n=t.req.valid("form"),{password:r}=n,{theme:i,branding:s,client:a,loginSession:c,useShadcn:l}=await Ie(t,e),{username:u}=c.authParams;if(!u)throw new I(400,{message:"Username required"});try{return await cv(t,a,{...c.authParams,password:r},c)}catch(d){const f=d;return f.code==="INVALID_PASSWORD"||f.code==="USER_NOT_FOUND"?l?t.html(g(Le,{title:E.t("enter_your_password","Enter your password"),theme:i,branding:s,client:a,children:g(Bu,{theme:i,branding:s,loginSession:c,email:u,error:E.t("invalid_password"),client:a})}),400):t.html(g(Pa,{theme:i,branding:s,email:u,error:E.t("invalid_password"),state:e,client:a}),400):f.code==="EMAIL_NOT_VERIFIED"?t.html(g(xv,{theme:i,branding:s,client:a,state:e}),400):l?t.html(g(Le,{title:E.t("enter_your_password","Enter your password"),theme:i,branding:s,client:a,children:g(Bu,{theme:i,branding:s,loginSession:c,email:u,error:f.message||"An unknown error occurred.",client:a})}),f.code?400:500):t.html(g(Pa,{theme:i,branding:s,email:u,error:f.message||"An unknown error occurred.",state:e,client:a}),f.code?400:500)}}),Sr=t=>{const{error:e,theme:n,branding:r,client:i,email:s,state:a,code:c}=t;return g(qe,{title:E.t("sign_up"),theme:n,branding:r,client:i,children:[g("div",{className:"mb-4 text-lg font-medium sm:text-2xl",children:E.t("create_account_title")}),g("div",{className:"mb-6 text-gray-300",children:E.t("create_account_description")}),g("div",{className:"flex flex-1 flex-col justify-center",children:[g(un,{children:[g("input",{type:"hidden",name:"code",value:c}),g("input",{type:"email",name:"username",placeholder:E.t("email_placeholder"),className:"mb-2 w-full rounded-lg bg-gray-100 px-4 py-5 text-base placeholder:text-gray-300 dark:bg-gray-600 md:text-base",required:!0,value:s,disabled:!!s}),g("input",{type:"password",name:"password",placeholder:E.t("enter_new_password_placeholder"),className:"mb-2 w-full rounded-lg bg-gray-100 px-4 py-5 text-base placeholder:text-gray-300 dark:bg-gray-600 md:text-base"}),g("input",{type:"password",name:"re-enter-password",placeholder:E.t("reenter_new_password_placeholder"),className:"mb-2 w-full rounded-lg bg-gray-100 px-4 py-5 text-base placeholder:text-gray-300 dark:bg-gray-600 md:text-base"}),e&&g(tt,{children:e}),g(Me,{className:"sm:mt-4 !text-base",children:E.t("continue")})]}),g(Ct,{state:a})]})]})},mo=({error:t,theme:e,branding:n,loginSession:r,email:i,code:s,className:a})=>{const c=e?.colors?.primary_button||n?.colors?.primary||"#0066cc",l=e?.colors?.primary_button_label||"#ffffff",u=e?.colors?.body_text||"#333333",d=e?.colors?.input_background||"#ffffff",f=e?.colors?.input_border||"#d1d5db",p=e?.colors?.input_filled_text||"#111827",h=e?.colors?.error||"#dc2626",m=e?.colors?.widget_background||"#ffffff",y=e?.colors?.widget_border||"#e5e7eb",w=e?.borders?.widget_corner_radius||8,_=e?.borders?.input_border_radius||4,k=e?.borders?.button_border_radius||4,v=e?.borders?.show_widget_shadow??!0,$=e?.fonts?.title?.size||24,b=e?.fonts?.title?.bold??!0,z=e?.fonts?.body_text?.size||14,A={backgroundColor:m,borderColor:y,borderRadius:`${w}px`,boxShadow:v?"0 1px 3px 0 rgba(0, 0, 0, 0.1)":"none",color:u},N={fontSize:`${$}px`,fontWeight:b?"700":"400",color:e?.colors?.header||u},O={fontSize:`${z}px`,color:e?.colors?.input_labels_placeholders||"#6b7280"},L={backgroundColor:d,borderColor:t?h:f,borderRadius:`${_}px`,color:p},C={backgroundColor:c,color:l,borderRadius:`${k}px`},P=e?.widget?.logo_position||"center",M=P==="left"?"text-left":P==="right"?"text-right":"text-center",K=e?.widget?.logo_url||n?.logo_url,B=P!=="none"&&K;return g("div",{className:fe("flex flex-col gap-6 w-full max-w-sm",a),children:g(Sn,{style:A,className:"border",children:[g(zn,{children:[B&&g("div",{className:fe("mb-4",M),children:g(ln,{theme:e,branding:n})}),g(An,{style:N,children:E.t("create_account_title","Create Account")}),g(En,{style:O,children:E.t("create_account_description","Sign up to get started")})]}),g(Cn,{children:[g("form",{method:"post",className:"space-y-4",children:[g("input",{type:"hidden",name:"state",value:r.authParams.state}),s&&g("input",{type:"hidden",name:"code",value:s}),g("div",{className:"space-y-2",children:[g(Lt,{htmlFor:"username",style:O,children:E.t("email_label","Email")}),g(on,{id:"username",type:"email",name:"username",placeholder:E.t("email_placeholder","Email Address"),value:i,disabled:!!i,style:L,className:"w-full",required:!0})]}),g("div",{className:"space-y-2",children:[g(Lt,{htmlFor:"password",style:O,children:E.t("password","Password")}),g("div",{className:"relative","data-password-toggle":!0,children:[g(on,{id:"password",name:"password",type:"password","data-password-input":"password",placeholder:E.t("enter_new_password_placeholder","Enter new password"),required:!0,error:!!t,className:"border pr-8",style:L}),g("button",{type:"button","data-password-toggle-btn":!0,className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700 transition-colors","aria-label":E.t("toggle_password_visibility","Toggle password visibility"),children:[g("svg",{"data-show-icon":!0,xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[g("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"}),g("circle",{cx:"12",cy:"12",r:"3"})]}),g("svg",{"data-hide-icon":!0,className:"hidden",xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[g("path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24"}),g("path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68"}),g("path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61"}),g("line",{x1:"2",x2:"22",y1:"2",y2:"22"})]})]})]})]}),g("div",{className:"space-y-2",children:[g(Lt,{htmlFor:"re-enter-password",style:O,children:E.t("confirm_password","Confirm Password")}),g("div",{className:"relative","data-password-toggle":!0,children:[g(on,{id:"re-enter-password",name:"re-enter-password",type:"password","data-password-input":"re-enter-password",placeholder:E.t("reenter_new_password_placeholder","Re-enter new password"),required:!0,error:!!t,className:"border pr-8",style:L}),g("button",{type:"button","data-password-toggle-btn":!0,className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700 transition-colors","aria-label":E.t("toggle_password_visibility","Toggle password visibility"),children:[g("svg",{"data-show-icon":!0,xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[g("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"}),g("circle",{cx:"12",cy:"12",r:"3"})]}),g("svg",{"data-hide-icon":!0,className:"hidden",xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[g("path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24"}),g("path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68"}),g("path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61"}),g("line",{x1:"2",x2:"22",y1:"2",y2:"22"})]})]})]})]}),t&&g(tt,{children:t}),g(wn,{type:"submit",className:"w-full",style:C,disabled:!1,children:E.t("continue","Continue")})]}),g("div",{className:"mt-4 text-center",children:g("a",{href:`/u/login/identifier?state=${encodeURIComponent(r.authParams.state||"")}`,className:"text-sm",style:{color:c},children:E.t("back_to_login","Back to Login")})})]})]})})},Yz=new o.OpenAPIHono().openapi(o.createRoute({tags:["login"],method:"get",path:"/",request:{query:o.z.object({state:o.z.string().openapi({description:"The state parameter from the authorization request"}),code:o.z.string().optional().openapi({description:"The code parameter from an email verification link"})})},responses:{200:{description:"Response"}}}),async t=>{const{state:e,code:n}=t.req.valid("query"),{theme:r,branding:i,client:s,loginSession:a,useShadcn:c}=await Ie(t,e),{username:l}=a.authParams;if(!l)throw new I(400,{message:"Username required"});return c?t.html(g(Le,{title:E.t("sign_up","Sign Up"),theme:r,branding:i,client:s,children:g(mo,{theme:r,branding:i,loginSession:a,email:l,code:n,client:s})})):n?t.html(g(Sr,{state:e,theme:r,branding:i,client:s,email:l,code:n})):t.html(g(Sr,{state:e,theme:r,branding:i,client:s,email:l}))}).openapi(o.createRoute({tags:["login"],method:"post",path:"/",request:{query:o.z.object({state:o.z.string().openapi({description:"The state parameter from the authorization request"})}),body:{content:{"application/x-www-form-urlencoded":{schema:o.z.object({password:o.z.string(),"re-enter-password":o.z.string(),code:o.z.string().optional()})}}}},responses:{200:{description:"HTML page indicating success (e.g., email verification sent) or a next step.",content:{"text/html":{schema:o.z.string()}}},302:{description:"Redirect to continue the authentication flow (e.g., to client, MFA, consent) after successful login.",headers:o.z.object({Location:o.z.string().url()})},400:{description:"Bad Request - HTML page with an error message (e.g., passwords don't match, weak password, user exists).",content:{"text/html":{schema:o.z.string()}}},500:{description:"Internal Server Error - HTML page with an error message.",content:{"text/html":{schema:o.z.string()}}}}}),async t=>{const{state:e}=t.req.valid("query"),n=t.req.valid("form"),{env:r}=t,{theme:i,branding:s,client:a,loginSession:c,useShadcn:l}=await Ie(t,e);try{if(!c.authParams.username)throw new I(400,{message:"Username required"});const d=a.connections.find(v=>v.strategy==="Username-Password-Authentication")?.name||"Username-Password-Authentication";if(t.set("connection",d),n.password!==n["re-enter-password"])return l?t.html(g(Le,{title:E.t("sign_up","Sign Up"),theme:i,branding:s,client:a,children:g(mo,{theme:i,branding:s,loginSession:c,email:c.authParams.username,code:n.code,error:E.t("create_account_passwords_didnt_match"),client:a})}),400):t.html(g(Sr,{state:e,code:n.code,theme:i,branding:s,client:a,error:E.t("create_account_passwords_didnt_match"),email:c.authParams.username}),400);const f=await qf(r.data,a.tenant.id,d);try{await Mf(f,{tenantId:a.tenant.id,userId:"",newPassword:n.password,data:r.data})}catch(v){let $;return v instanceof gn?$=E.t(v.code,{defaultValue:v.message,...v.params}):$=v?.message||E.t("create_account_weak_password"),l?t.html(g(Le,{title:E.t("sign_up","Sign Up"),theme:i,branding:s,client:a,children:g(mo,{theme:i,branding:s,loginSession:c,email:c.authParams.username,code:n.code,error:$,client:a})}),400):t.html(g(Sr,{state:e,code:n.code,theme:i,branding:s,client:a,error:$,email:c.authParams.username}),400)}const p=n.code?await r.data.codes.get(a.tenant.id,n.code,"email_verification"):void 0,h=p?await r.data.loginSessions.get(a.tenant.id,p.login_id):void 0;if(await Xi({userAdapter:t.env.data.users,tenant_id:a.tenant.id,username:c.authParams.username,provider:"auth2"}))return l?t.html(g(Le,{title:E.t("sign_up","Sign Up"),theme:i,branding:s,client:a,children:g(mo,{theme:i,branding:s,loginSession:c,email:c.authParams.username,code:n.code,error:E.t("user_exists_error"),client:a})}),400):t.html(g(Sr,{state:e,code:n.code,theme:i,branding:s,client:a,error:E.t("user_exists_error"),email:c.authParams.username}),400);const y=h?.authParams.username===c.authParams.username,w=`auth2|${$s()}`,_=await r.data.users.create(a.tenant.id,{user_id:w,email:c.authParams.username,email_verified:y,provider:"auth2",connection:d,is_social:!1});if(await r.data.passwords.create(a.tenant.id,{user_id:w,password:await ar.hash(n.password,10),algorithm:"bcrypt",is_current:!0}),!y){const v=c.authParams?.ui_locales?.split(" ")?.map($=>$.split("-")[0])[0];return await Vf(t,_,v),t.html(g(Dt,{message:E.t("validate_email_body"),pageTitle:E.t("validate_email_title"),theme:i,branding:s,client:a,state:e}))}const k=await av(t,a,{...c.authParams,password:n.password},c);return sn(t,k)}catch(u){let d=E.t("unknown_error_message"),f=400;return u instanceof I?(d=u.message||d,f=u.status===400?400:500):u instanceof bi?d=u.message||d:u instanceof Error&&(d=u.message||d,f=500),l?t.html(g(Le,{title:E.t("sign_up","Sign Up"),theme:i,branding:s,client:a,children:g(mo,{theme:i,branding:s,loginSession:c,email:c.authParams.username,code:n.code,error:d,client:a})}),f):t.html(g(Sr,{state:e,theme:i,branding:s,client:a,error:d,email:c.authParams.username,code:n.code}),f)}}),wi=t=>{const{error:e,theme:n,branding:r,client:i,email:s}=t;return g(qe,{title:E.t("reset_password_title"),theme:n,branding:r,client:i,children:[g("div",{className:"mb-4 text-lg font-medium sm:text-2xl",children:E.t("reset_password_title")}),g("div",{className:"mb-6 text-gray-300",children:`${E.t("reset_password_description")} ${s}`}),g("div",{className:"flex flex-1 flex-col justify-center",children:g(un,{children:[g(l0,{name:"password",placeholder:E.t("enter_new_password_placeholder")}),g(l0,{name:"re-enter-password",placeholder:E.t("reenter_new_password_placeholder")}),e&&g(tt,{children:e}),g(Me,{className:"sm:mt-4 !text-base",children:E.t("reset_password_cta")})]})})]})},_o=({error:t,theme:e,branding:n,loginSession:r,email:i,className:s})=>{const a=e?.colors?.primary_button||n?.colors?.primary||"#0066cc",c=e?.colors?.primary_button_label||"#ffffff",l=e?.colors?.body_text||"#333333",u=e?.colors?.input_background||"#ffffff",d=e?.colors?.input_border||"#d1d5db",f=e?.colors?.input_filled_text||"#111827",p=e?.colors?.error||"#dc2626",h=e?.colors?.widget_background||"#ffffff",m=e?.colors?.widget_border||"#e5e7eb",y=e?.borders?.widget_corner_radius||8,w=e?.borders?.input_border_radius||4,_=e?.borders?.button_border_radius||4,k=e?.borders?.show_widget_shadow??!0,v=e?.fonts?.title?.size||24,$=e?.fonts?.title?.bold??!0,b=e?.fonts?.body_text?.size||14,z={backgroundColor:h,borderColor:m,borderRadius:`${y}px`,boxShadow:k?"0 1px 3px 0 rgba(0, 0, 0, 0.1)":"none",color:l},A={fontSize:`${v}px`,fontWeight:$?"700":"400",color:e?.colors?.header||l},N={fontSize:`${b}px`,color:e?.colors?.input_labels_placeholders||"#6b7280"},O={backgroundColor:u,borderColor:t?p:d,borderRadius:`${w}px`,color:f},L={backgroundColor:a,color:c,borderRadius:`${_}px`},C=e?.widget?.logo_position||"center",P=C==="left"?"text-left":C==="right"?"text-right":"text-center",M=e?.widget?.logo_url||n?.logo_url,K=C!=="none"&&M;return g("div",{className:fe("flex flex-col gap-6 w-full max-w-sm",s),children:g(Sn,{style:z,className:"border",children:[g(zn,{children:[K&&g("div",{className:fe("mb-4",P),children:g(ln,{theme:e,branding:n})}),g(An,{style:A,children:E.t("reset_password_title","Reset Password")}),g(En,{style:N,children:`${E.t("reset_password_description","Set a new password for")} ${i}`})]}),g(Cn,{children:g("form",{method:"post",className:"space-y-4",children:[g("input",{type:"hidden",name:"state",value:r.authParams.state}),g("div",{className:"space-y-2",children:[g(Lt,{htmlFor:"password",style:N,children:E.t("new_password","New Password")}),g("div",{className:"relative","data-password-toggle":!0,children:[g(on,{id:"password",name:"password",type:"password","data-password-input":"password",placeholder:E.t("enter_new_password_placeholder","Enter new password"),required:!0,error:!!t,className:"border pr-8",style:O}),g("button",{type:"button","data-password-toggle-btn":!0,className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700 transition-colors","aria-label":E.t("toggle_password_visibility","Toggle password visibility"),children:[g("svg",{"data-show-icon":!0,xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[g("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"}),g("circle",{cx:"12",cy:"12",r:"3"})]}),g("svg",{"data-hide-icon":!0,className:"hidden",xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[g("path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24"}),g("path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68"}),g("path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61"}),g("line",{x1:"2",x2:"22",y1:"2",y2:"22"})]})]})]})]}),g("div",{className:"space-y-2",children:[g(Lt,{htmlFor:"re-enter-password",style:N,children:E.t("confirm_password","Confirm Password")}),g("div",{className:"relative","data-password-toggle":!0,children:[g(on,{id:"re-enter-password",name:"re-enter-password",type:"password","data-password-input":"re-enter-password",placeholder:E.t("reenter_new_password_placeholder","Re-enter new password"),required:!0,error:!!t,className:"border pr-8",style:O}),g("button",{type:"button","data-password-toggle-btn":!0,className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700 transition-colors","aria-label":E.t("toggle_password_visibility","Toggle password visibility"),children:[g("svg",{"data-show-icon":!0,xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[g("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"}),g("circle",{cx:"12",cy:"12",r:"3"})]}),g("svg",{"data-hide-icon":!0,className:"hidden",xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[g("path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24"}),g("path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68"}),g("path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61"}),g("line",{x1:"2",x2:"22",y1:"2",y2:"22"})]})]})]})]}),t&&g(tt,{children:t}),g(wn,{type:"submit",className:"w-full",style:L,disabled:!1,children:E.t("reset_password_cta","Reset Password")})]})})]})})},Qz=new o.OpenAPIHono().openapi(o.createRoute({tags:["login"],method:"get",path:"/",request:{query:o.z.object({state:o.z.string().openapi({description:"The state parameter from the authorization request"}),code:o.z.string().openapi({description:"The code parameter from the authorization request"})})},responses:{200:{description:"Response"}}}),async t=>{const{state:e}=t.req.valid("query"),{theme:n,branding:r,client:i,loginSession:s,useShadcn:a}=await Ie(t,e);if(!s.authParams.username)throw new I(400,{message:"Username required"});return a?t.html(g(Le,{title:E.t("reset_password_title","Reset Password"),theme:n,branding:r,client:i,children:g(_o,{theme:n,branding:r,loginSession:s,email:s.authParams.username,client:i})})):t.html(g(wi,{theme:n,branding:r,client:i,email:s.authParams.username}))}).openapi(o.createRoute({tags:["login"],method:"post",path:"/",request:{query:o.z.object({state:o.z.string().openapi({description:"The state parameter from the authorization request"}),code:o.z.string().openapi({description:"The code parameter from the authorization request"})}),body:{content:{"application/x-www-form-urlencoded":{schema:o.z.object({password:o.z.string(),"re-enter-password":o.z.string()})}}}},responses:{200:{description:"Response"}}}),async t=>{const{state:e,code:n}=t.req.valid("query"),{password:r,"re-enter-password":i}=t.req.valid("form"),{env:s}=t,{theme:a,branding:c,client:l,loginSession:u,useShadcn:d}=await Ie(t,e);if(!u.authParams.username)throw new I(400,{message:"Username required"});if(r!==i)return d?t.html(g(Le,{title:E.t("reset_password_title","Reset Password"),theme:a,branding:c,client:l,children:g(_o,{error:E.t("create_account_passwords_didnt_match"),theme:a,branding:c,loginSession:u,email:u.authParams.username,client:l})}),400):t.html(g(wi,{error:E.t("create_account_passwords_didnt_match"),theme:a,branding:c,client:l,email:u.authParams.username}),400);const f=await Xi({userAdapter:s.data.users,tenant_id:l.tenant.id,username:u.authParams.username,provider:"auth2"});if(!f)throw new I(400,{message:"User not found"});const p=await qf(s.data,l.tenant.id,f.connection);try{await Mf(p,{tenantId:l.tenant.id,userId:f.user_id,newPassword:r,userData:f,data:s.data})}catch(h){const m=h?.message||E.t("create_account_weak_password");return d?t.html(g(Le,{title:E.t("reset_password_title","Reset Password"),theme:a,branding:c,client:l,children:g(_o,{error:m,theme:a,branding:c,loginSession:u,email:u.authParams.username,client:l})}),400):t.html(g(wi,{error:m,theme:a,branding:c,client:l,email:u.authParams.username}),400)}try{if(!await s.data.codes.get(l.tenant.id,n,"password_reset")){const y=E.t("password_reset_code_expired","Code not found or expired");return d?t.html(g(Le,{title:E.t("reset_password_title","Reset Password"),theme:a,branding:c,client:l,children:g(_o,{error:y,theme:a,branding:c,loginSession:u,email:u.authParams.username,client:l})}),400):t.html(g(wi,{error:y,theme:a,branding:c,client:l,email:u.authParams.username}),400)}const m=await s.data.passwords.get(l.tenant.id,f.user_id);m&&await s.data.passwords.update(l.tenant.id,{id:m.id,user_id:f.user_id,password:m.password,algorithm:m.algorithm,is_current:!1}),await s.data.passwords.create(l.tenant.id,{user_id:f.user_id,password:await ar.hash(r,10),algorithm:"bcrypt",is_current:!0}),f.email_verified||await s.data.users.update(l.tenant.id,f.user_id,{email_verified:!0}),await ye(t,l.tenant.id,{type:ge.SUCCESS_CHANGE_PASSWORD,description:`Password changed for ${f.email}`,userId:f.user_id})}catch(h){console.error("Password reset failed:",h);const m=h instanceof Error?h.message:JSON.stringify(h);await ye(t,l.tenant.id,{type:ge.FAILED_CHANGE_PASSWORD,description:`Password reset failed for ${f.email}: ${m}`,userId:f.user_id});let y;return h instanceof gn?y=E.t(h.code,{defaultValue:h.message,...h.params}):y=E.t("password_reset_failed","The password could not be reset"),d?t.html(g(Le,{title:E.t("reset_password_title","Reset Password"),theme:a,branding:c,client:l,children:g(_o,{error:y,theme:a,branding:c,loginSession:u,email:u.authParams.username,client:l})}),400):t.html(g(wi,{error:y,theme:a,branding:c,client:l,email:u.authParams.username}),400)}return t.html(g(Dt,{message:E.t("password_has_been_reset"),theme:a,branding:c,client:l,state:e}))}),kv=t=>{const{error:e,theme:n,branding:r,client:i,email:s,state:a}=t;return g(qe,{title:E.t("forgot_password_title"),theme:n,branding:r,client:i,children:[g("div",{className:"mb-4 text-lg font-medium sm:text-2xl",children:E.t("forgot_password_title")}),g("div",{className:"mb-6 text-gray-300",children:E.t("forgot_password_description")}),g("div",{className:"flex flex-1 flex-col justify-center",children:[g(un,{className:"pt-2",children:[g("input",{type:"email",name:"username",placeholder:E.t("email_placeholder"),className:"mb-2 w-full rounded-lg bg-gray-100 px-4 py-5 text-base placeholder:text-gray-300 dark:bg-gray-600 md:text-base",value:s,disabled:!!s}),e&&g(tt,{children:e}),g(Me,{className:"sm:mt-4 !text-base",children:E.t("forgot_password_cta")})]}),g(Ct,{state:a})]})]})},eA=({error:t,theme:e,branding:n,loginSession:r,email:i,className:s})=>{const a=e?.colors?.primary_button||n?.colors?.primary||"#0066cc",c=e?.colors?.primary_button_label||"#ffffff",l=e?.colors?.body_text||"#333333",u=e?.colors?.input_background||"#ffffff",d=e?.colors?.input_border||"#d1d5db",f=e?.colors?.input_filled_text||"#111827",p=e?.colors?.error||"#dc2626",h=e?.colors?.widget_background||"#ffffff",m=e?.colors?.widget_border||"#e5e7eb",y=e?.borders?.widget_corner_radius||8,w=e?.borders?.input_border_radius||4,_=e?.borders?.button_border_radius||4,k=e?.borders?.show_widget_shadow??!0,v=e?.fonts?.title?.size||24,$=e?.fonts?.title?.bold??!0,b=e?.fonts?.body_text?.size||14,z={backgroundColor:h,borderColor:m,borderRadius:`${y}px`,boxShadow:k?"0 1px 3px 0 rgba(0, 0, 0, 0.1)":"none",color:l},A={fontSize:`${v}px`,fontWeight:$?"700":"400",color:e?.colors?.header||l},N={fontSize:`${b}px`,color:e?.colors?.input_labels_placeholders||"#6b7280"},O={backgroundColor:u,borderColor:t?p:d,borderRadius:`${w}px`,color:f},L={backgroundColor:a,color:c,borderRadius:`${_}px`},C=e?.widget?.logo_position||"center",P=C==="left"?"text-left":C==="right"?"text-right":"text-center",M=e?.widget?.logo_url||n?.logo_url,K=C!=="none"&&M;return g("div",{className:fe("flex flex-col gap-6 w-full max-w-sm",s),children:g(Sn,{style:z,className:"border",children:[g(zn,{children:[K&&g("div",{className:fe("mb-4",P),children:g(ln,{theme:e,branding:n})}),g(An,{style:A,children:E.t("forgot_password_title","Forgot Password")}),g(En,{style:N,children:E.t("forgot_password_description","Enter your email address and we'll send you a link to reset your password.")})]}),g(Cn,{children:[g("form",{method:"post",className:"space-y-4",children:[g("input",{type:"hidden",name:"state",value:r.authParams.state}),g("div",{className:"space-y-2",children:[g(Lt,{htmlFor:"username",style:N,className:"text-sm font-medium",children:E.t("email_label","Email")}),g(on,{id:"username",type:"email",name:"username",placeholder:E.t("email_placeholder","Email Address"),value:i,disabled:!!i,style:O,className:"w-full",required:!0})]}),t&&g(tt,{children:t}),g(wn,{type:"submit",className:"w-full",style:L,disabled:!1,children:E.t("forgot_password_cta","Send Reset Link")})]}),g("div",{className:"mt-4 text-center",children:g("a",{href:`/u/login/identifier?state=${encodeURIComponent(r.authParams.state||"")}`,className:"text-sm",style:{color:a},children:E.t("back_to_login","Back to Login")})})]})]})})},$v=t=>{const{theme:e,branding:n,client:r,state:i}=t;return g(qe,{title:"Login",theme:e,branding:n,client:r,children:[g("div",{className:"flex flex-1 flex-col justify-center",children:[g("div",{children:E.t("forgot_password_email_sent")}),g("div",{className:"my-4 flex space-x-2 text-sm text-[#B2B2B2]",children:[g(Ge,{className:"text-base",name:"info-bubble"}),g("div",{className:"text-sm text-gray-300 md:text-sm",children:E.t("sent_code_spam")})]})]}),g(Ct,{state:i})]})},tA=new o.OpenAPIHono().openapi(o.createRoute({tags:["login"],method:"get",path:"/",request:{query:o.z.object({state:o.z.string().openapi({description:"The state parameter from the authorization request"})})},responses:{200:{description:"Response"}}}),async t=>{const{state:e}=t.req.valid("query"),{theme:n,branding:r,client:i,loginSession:s,useShadcn:a}=await Ie(t,e);return a?t.html(g(Le,{title:E.t("forgot_password_title","Forgot Password"),theme:n,branding:r,client:i,children:g(eA,{theme:n,branding:r,loginSession:s,email:s.authParams.username,client:i})})):t.html(g(kv,{theme:n,branding:r,client:i,state:e,email:s.authParams.username}))}).openapi(o.createRoute({tags:["login"],method:"post",path:"/",request:{query:o.z.object({state:o.z.string().openapi({description:"The state parameter from the authorization request"})})},responses:{200:{description:"Response"}}}),async t=>{const{state:e}=t.req.valid("query"),{theme:n,branding:r,client:i,loginSession:s}=await Ie(t,e);return await Q7(t,i,s.authParams.username,s.id),t.html(g($v,{theme:n,branding:r,client:i,state:e}))}),Sv=({theme:t,branding:e,client:n,state:r,user:i})=>g(qe,{title:ue("check_email_title"),theme:t,branding:e,client:n,children:g("div",{className:"flex flex-1 flex-col justify-center",children:[g("div",{className:"mb-8 text-gray-700 dark:text-gray-300",children:[g(fr,{i18nKey:"currently_logged_in_as",components:[g("span",{className:"font-semibold text-gray-900 dark:text-white"},"span")],values:{email:i.email||""}}),g("br",{}),ue("continue_with_sso_provider_headline")]}),g("div",{className:"space-y-6",children:[g(un,{children:g(Me,{className:"!text-base",children:g("span",{children:E.t("yes_continue_with_existing_account")})})}),g("a",{className:"block text-center text-primary hover:text-primaryHover focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 dark:focus:ring-offset-gray-900",href:`/u/login/identifier?state=${encodeURIComponent(r)}`,children:E.t("no_use_another")})]})]})}),nA=({theme:t,branding:e,state:n,user:r,className:i})=>{const s=t?.colors?.primary_button||e?.colors?.primary||"#0066cc",a=t?.colors?.primary_button_label||"#ffffff",c=t?.colors?.body_text||"#333333",l=t?.colors?.widget_background||"#ffffff",u=t?.colors?.widget_border||"#e5e7eb",d=t?.borders?.widget_corner_radius||8,f=t?.borders?.button_border_radius||4,p=t?.borders?.show_widget_shadow??!0,h=t?.fonts?.title?.size||24,m=t?.fonts?.title?.bold??!0,y=t?.fonts?.body_text?.size||14,w={backgroundColor:l,borderColor:u,borderRadius:`${d}px`,boxShadow:p?"0 1px 3px 0 rgba(0, 0, 0, 0.1)":"none",color:c},_={fontSize:`${h}px`,fontWeight:m?"700":"400",color:t?.colors?.header||c},k={fontSize:`${y}px`,color:t?.colors?.input_labels_placeholders||"#6b7280"},v={backgroundColor:s,color:a,borderRadius:`${f}px`},$={color:t?.colors?.links_focused_components||s,fontSize:`${y}px`},b=t?.widget?.logo_position||"center",z=b==="left"?"text-left":b==="right"?"text-right":"text-center",A=t?.widget?.logo_url||e?.logo_url,N=b!=="none"&&A;return g("div",{className:fe("flex flex-col gap-6 w-full max-w-sm",i),children:g(Sn,{style:w,className:"border",children:[g(zn,{children:[N&&g("div",{className:fe("mb-4",z),children:g(ln,{theme:t,branding:e})}),g(An,{style:_,children:E.t("continue_with_account","Continue with account")}),g(En,{style:k,children:[g(fr,{i18nKey:"currently_logged_in_as",components:[g("span",{className:"font-semibold"},"span")],values:{email:r.email||""}}),g("br",{}),g("br",{}),E.t("continue_with_sso_provider_headline","Do you want to continue with this account?")]})]}),g(Cn,{children:g("form",{method:"post",children:g("div",{className:"grid gap-4",children:[g(wn,{type:"submit",className:"w-full transition-colors hover:brightness-90",style:v,children:E.t("yes_continue_with_existing_account","Yes, continue")}),g("div",{className:"text-center",children:g("a",{href:`/u/login/identifier?state=${encodeURIComponent(n)}`,className:"text-sm hover:underline focus:outline-none focus:ring-2 focus:ring-offset-2 transition-colors",style:$,children:E.t("no_use_another","No, use another account")})})]})})})]})})},rA=new o.OpenAPIHono().openapi(o.createRoute({tags:["login"],method:"get",path:"/",request:{query:o.z.object({state:o.z.string().openapi({description:"The state parameter from the authorization request"})})},responses:{200:{description:"HTML page to check account status or verify email.",content:{"text/html":{schema:o.z.string()}}},302:{description:"Redirect to login identifier page if no valid session.",headers:o.z.object({Location:o.z.string().url()})},400:{description:"Bad Request - HTML error page if state is missing or other input error.",content:{"text/html":{schema:o.z.string()}}},500:{description:"Internal Server Error - HTML error page.",content:{"text/html":{schema:o.z.string()}}}}}),async t=>{const{env:e}=t,{state:n}=t.req.valid("query"),{theme:r,branding:i,client:s,useShadcn:a}=await Ie(t,n);if(!s||!s.tenant?.id)return console.error("Client or tenant ID missing in GET /u/check-account after initJSXRoute"),t.html(g(Dt,{theme:r,branding:i,client:s,state:n,pageTitle:E.t("error_page_title")||"Error",message:E.t("configuration_error_message")||"A configuration error occurred."}),500);const c=Ti(s.tenant.id,t.req.header("cookie")),l=c?await e.data.sessions.get(s.tenant.id,c):null;if(!l)return t.redirect(`/u/login/identifier?state=${n}`);const u=await e.data.users.get(s.tenant.id,l.user_id);return u?a?t.html(g(Le,{title:E.t("continue_with_account","Continue with account"),theme:r,branding:i,client:s,children:g(nA,{theme:r,branding:i,client:s,state:n,user:u})})):t.html(g(Sv,{theme:r,branding:i,client:s,state:n,user:u})):t.redirect(`/u/login/identifier?state=${n}`)}).openapi(o.createRoute({tags:["login"],method:"post",path:"/",request:{query:o.z.object({state:o.z.string().openapi({description:"The state parameter from the authorization request"})})},responses:{302:{description:"Redirect to continue authentication flow or to login identifier.",headers:o.z.object({Location:o.z.string().url()})},400:{description:"Bad Request - HTML error page if state is missing or other input error.",content:{"text/html":{schema:o.z.string()}}},500:{description:"Internal Server Error - HTML error page for unexpected issues or if TokenResponse is returned.",content:{"text/html":{schema:o.z.string()}}}}}),async t=>{const{env:e}=t,{state:n}=t.req.valid("query"),{theme:r,branding:i,client:s,loginSession:a}=await Ie(t,n);if(!s||!s.tenant?.id)return console.error("Client or tenant ID missing in POST /u/check-account after initJSXRoute"),t.html(g(Dt,{theme:r,branding:i,client:s,state:n,pageTitle:E.t("error_page_title")||"Error",message:E.t("configuration_error_message")}),500);const c=Ti(s.tenant.id,t.req.header("cookie")),l=c?await e.data.sessions.get(s.tenant.id,c):null;if(!l)return t.redirect(`/u/login/identifier?state=${n}`);const u=await e.data.users.get(s.tenant.id,l.user_id);if(!u)return t.redirect(`/u/login/identifier?state=${n}`);await e.data.loginSessions.update(s.tenant.id,a.id,{session_id:l.id});const d=await sn(t,{user:u,authParams:a.authParams,client:s,loginSession:{...a,session_id:l.id},sessionId:l.id});if(!(d instanceof Response))throw new I(500,{message:E.t("unexpected_error_try_again")});return d}),iA=({width:t=18,height:e=18,className:n})=>g("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:e,viewBox:"0 0 640 640",className:n,fill:"currentColor",role:"img",focusable:"false",children:g("path",{d:"M416.9 85.2 372 130.1 509.9 268l44.9-44.9c13.6-13.5 21.2-31.9 21.2-51.1s-7.6-37.6-21.2-51.1l-35.7-35.7C505.6 71.6 487.2 64 468 64s-37.6 7.6-51.1 21.2M338.1 164 122.9 379.1c-10.7 10.7-18.5 24.1-22.6 38.7L64.9 545.6c-2.3 8.3 0 17.3 6.2 23.4s15.1 8.5 23.4 6.2l127.8-35.5c14.6-4.1 27.9-11.8 38.7-22.6l215-215.2z"})}),oA=!1,w_=t=>{const{theme:e,branding:n,user:r,client:i,error:s,success:a,state:c,csrfToken:l}=t;return r.identities?.filter(u=>!(u.provider===r.provider&&u.user_id===r.user_id.split("|")[1])),g(qe,{title:E.t("account_title")||"Account Settings",theme:e,branding:n,client:i,children:[g("div",{className:"mb-4 text-2xl font-medium",children:E.t("account_title")}),g("div",{className:"mb-8 text-gray-300",children:E.t("account_page_description")}),s&&g(tt,{className:"mb-8",children:s}),a&&g("div",{className:"mb-8 text-green",children:a}),g("div",{className:"column-left gap-6 border-y border-gray-200/50 py-6 mb-8",children:[g("div",{className:"row-left w-full !justify-between !flex-nowrap gap-4",children:[g("div",{className:"column-left gap-1.5",children:[g("div",{className:"text-gray-300",children:E.t("email_placeholder")}),g("div",{className:"font-medium text-base text-gray-800 line-clamp-1 break-all",children:r.email||E.t("no_email_address")})]}),g("a",{className:"bg-gray-200/40 p-2 rounded-md hover:bg-gray-200/75",title:E.t("edit"),"aria-label":E.t("edit"),href:c?`/u/account/change-email?state=${encodeURIComponent(c)}`:`/u/account/change-email?client_id=${encodeURIComponent(i.client_id)}`,children:g(iA,{})})]}),oA]})]})},sA=new o.OpenAPIHono().openapi(o.createRoute({tags:["login"],method:"get",path:"/",request:{query:o.z.object({state:o.z.string().openapi({description:"The state parameter from the authorization request"})})},responses:{200:{description:"HTML page showing account management interface.",content:{"text/html":{schema:o.z.string()}}},302:{description:"Redirect to login if no session",headers:o.z.object({Location:o.z.string().url()})},400:{description:"Bad Request - HTML error page if state is missing or other input error.",content:{"text/html":{schema:o.z.string()}}},500:{description:"Internal Server Error - HTML error page.",content:{"text/html":{schema:o.z.string()}}}}}),async t=>{const{env:e}=t,{state:n}=t.req.valid("query"),{theme:r,branding:i,client:s,user:a,loginSession:c}=await ei(t,n);if(!s||!s.tenant?.id)return console.error("Client or tenant ID missing in GET /u/account after initJSXRoute"),t.html(g(Dt,{theme:r,branding:i,client:s,state:n,pageTitle:E.t("error_page_title")||"Error",message:E.t("configuration_error_message")||"A configuration error occurred."}),500);const l=je();return await e.data.loginSessions.update(s.tenant.id,c.id,{csrf_token:l}),t.html(g(w_,{theme:r,branding:i,user:a,client:s,state:n,csrfToken:l}))}).openapi(o.createRoute({tags:["login"],method:"post",path:"/",request:{query:o.z.object({state:o.z.string().openapi({description:"The state parameter from the authorization request"})}),body:{content:{"application/x-www-form-urlencoded":{schema:o.z.object({action:o.z.enum(["unlink_account"]),provider:o.z.string().optional(),user_id:o.z.string().optional(),csrf_token:o.z.string().optional()})}}}},responses:{200:{description:"HTML response with form results",content:{"text/html":{schema:o.z.string()}}},302:{description:"Redirect to login if no session",headers:o.z.object({Location:o.z.string().url()})},400:{description:"Bad Request - HTML error page if state is missing or other input error.",content:{"text/html":{schema:o.z.string()}}},500:{description:"Internal Server Error - HTML error page.",content:{"text/html":{schema:o.z.string()}}}}}),async t=>{const{env:e}=t,{state:n}=t.req.valid("query"),r=t.req.valid("form"),{theme:i,branding:s,client:a,user:c,loginSession:l}=await ei(t,n);let u,d;try{if(r.action==="unlink_account"&&r.provider&&r.user_id){if(!r.csrf_token||r.csrf_token!==l.csrf_token)throw new Error("Invalid CSRF token");await e.data.users.unlink(a.tenant.id,c.user_id,r.provider,r.user_id),d=E.t("account_unlinked_successfully")||"Account unlinked successfully"}}catch{u=E.t("operation_failed")||"Operation failed"}const f=await e.data.users.get(a.tenant.id,c.user_id),p=je();return await e.data.loginSessions.update(a.tenant.id,l.id,{csrf_token:p}),t.html(g(w_,{theme:i,branding:s,user:f||c,client:a,error:u,success:d,state:n,csrfToken:p}))}),v_=t=>{const{theme:e,branding:n,user:r,client:i,state:s,error:a}=t;return g(qe,{title:E.t("change_email"),theme:e,branding:n,client:i,children:[g("div",{className:"mb-4 text-2xl font-medium",children:E.t("change_email")}),g("div",{className:"column-left gap-1 mb-8",children:[g("div",{className:"text-gray-300",children:E.t("current_email")}),g("div",{className:"font-medium text-base text-gray-800",children:r.email||E.t("no_email_address")})]}),g("div",{className:"flex flex-1 flex-col justify-center",children:[g(un,{children:[g("input",{type:"email",id:"email",name:"email",placeholder:E.t("new_email"),className:fe("mb-2 w-full rounded-lg border bg-gray-100 px-4 py-5 text-base placeholder:text-gray-300 dark:bg-gray-600 md:text-base",{"border-red":a,"border-gray-100 dark:border-gray-500":!a}),required:!0}),a&&g(tt,{children:a}),g(Me,{className:"sm:mt-4 !text-base",children:[g("span",{children:E.t("continue")}),g(Ge,{className:"text-xs",name:"arrow-right"})]}),g("div",{className:"my-4 flex space-x-2 text-sm text-[#B2B2B2]",children:[g("span",{className:"uicon-info-bubble text-base"}),g("div",{className:"text-sm text-gray-300 md:text-sm",children:E.t("new_email_code_info")})]})]}),g("a",{className:"block text-primary hover:text-primaryHover text-center",href:`/u/account?state=${encodeURIComponent(s)}`,children:E.t("go_back")})]})]})},aA=new o.OpenAPIHono().openapi(o.createRoute({tags:["login"],method:"get",path:"/",request:{query:o.z.object({state:o.z.string().openapi({description:"The state parameter from the authorization request"})})},responses:{200:{description:"HTML page showing email change interface.",content:{"text/html":{schema:o.z.string()}}},302:{description:"Redirect to login if no session",headers:o.z.object({Location:o.z.string().url()})},400:{description:"Bad Request - HTML error page if state is missing or other input error.",content:{"text/html":{schema:o.z.string()}}},500:{description:"Internal Server Error - HTML error page.",content:{"text/html":{schema:o.z.string()}}}}}),async t=>{const{state:e}=t.req.valid("query"),{theme:n,branding:r,client:i,user:s}=await ei(t,e);return t.html(g(v_,{theme:n,branding:r,user:s,client:i,state:e}))}).openapi(o.createRoute({tags:["login"],method:"post",path:"/",request:{query:o.z.object({state:o.z.string().openapi({description:"The state parameter from the authorization request"})}),body:{content:{"application/x-www-form-urlencoded":{schema:o.z.object({email:o.z.string().toLowerCase()})}}}},responses:{200:{description:"HTML response with form results",content:{"text/html":{schema:o.z.string()}}},302:{description:"Redirect to change-email verification page",headers:o.z.object({Location:o.z.string().url()})},400:{description:"Bad Request - HTML error page if state is missing or other input error.",content:{"text/html":{schema:o.z.string()}}},500:{description:"Internal Server Error - HTML error page.",content:{"text/html":{schema:o.z.string()}}}}}),async t=>{const{env:e}=t,{state:n}=t.req.valid("query"),{email:r}=t.req.valid("form"),{theme:i,branding:s,client:a,user:c,loginSession:l}=await ei(t,n),u=await e.data.users.list(a.tenant.id,{page:1,per_page:1,include_totals:!1,q:`email:"${r}"`});if(u.users.length>0&&u.users[0]?.user_id!==c.user_id)return t.html(g(v_,{theme:i,branding:s,user:c,client:a,state:n,error:E.t("email_already_taken")||"Email is already taken"}));const d=pr(),f=je();await e.data.codes.create(a.tenant.id,{code_id:f,login_id:"",code_type:"email_verification",expires_at:new Date(Date.now()+jd).toISOString(),user_id:c.user_id}),await e.data.codes.create(a.tenant.id,{code_id:d,login_id:"",code_type:"email_verification",expires_at:new Date(Date.now()+jd).toISOString(),user_id:c.user_id});const p=l.authParams?.ui_locales?.split(" ")?.map(h=>h.split("-")[0])[0];return await Ff(t,{to:r,code:d,language:p}),t.redirect(`/u/account/change-email-verify?state=${encodeURIComponent(n)}&email=${encodeURIComponent(r)}&change_id=${f}`)}),x_=6,u0=({error:t,theme:e,branding:n,client:r,email:i,success:s,state:a,redirectUrl:c})=>s?g(qe,{title:E.t("success"),theme:e,branding:n,client:r,children:[g("div",{className:"mb-4 text-2xl font-medium",children:E.t("success")}),g("div",{className:"mb-8 text-gray-300",children:g(fr,{i18nKey:"email_changed_to_template",components:[g("span",{className:"text-black dark:text-white"},"span")],values:{email:i}})}),g("div",{className:"flex flex-1 flex-col justify-center",children:g(Me,{Component:"a",href:c||(a?`/u/account?state=${encodeURIComponent(a)}`:`/u/account?client_id=${encodeURIComponent(r.client_id)}`),className:"sm:mt-4 !text-base",children:[g("span",{children:E.t("continue")}),g(Ge,{className:"text-xs",name:"arrow-right"})]})})]}):g(qe,{title:E.t("verify_email_verify"),theme:e,branding:n,client:r,children:[g("div",{className:"mb-4 text-2xl font-medium",children:E.t("verify_email_verify")}),g("div",{className:"mb-8 text-gray-300",children:g(fr,{i18nKey:"code_sent_template",components:[g("span",{className:"text-black dark:text-white"},"span")],values:{username:i}})}),g("div",{className:"flex flex-1 flex-col justify-center",children:[g(un,{className:"pt-2",children:[g("input",{autoFocus:!0,type:"text",pattern:"[0-9]*",maxLength:x_,inputMode:"numeric",name:"code",placeholder:"******",className:fe("mb-2 w-full rounded-lg border bg-gray-100 px-4 pb-2 pt-2.5 text-center indent-[5px] font-mono text-3xl placeholder:text-gray-300 dark:bg-gray-600 md:text-3xl",{"border-red":t,"border-gray-100 dark:border-gray-500":!t}),minLength:x_,required:!0,id:"code-input"}),t&&g(tt,{children:t}),g(Me,{className:"sm:mt-4 !text-base",children:[g("span",{children:E.t("continue")}),g(Ge,{className:"text-xs",name:"arrow-right"})]}),g("div",{className:"my-4 flex space-x-2 text-sm text-[#B2B2B2]",children:[g(Ge,{className:"text-base",name:"info-bubble"}),g("div",{className:"text-sm text-gray-300 md:text-sm",children:E.t("sent_code_spam")})]})]}),g("a",{className:"block text-primary hover:text-primaryHover text-center",href:a?`/u/account?state=${encodeURIComponent(a)}`:`/u/account?client_id=${encodeURIComponent(r.client_id)}`,children:E.t("go_back")})]})]}),cA=new o.OpenAPIHono().openapi(o.createRoute({tags:["login"],method:"get",path:"/",request:{query:o.z.object({state:o.z.string().openapi({description:"The state parameter from the authorization request"}),email:o.z.string().email(),change_id:o.z.string()})},responses:{200:{description:"HTML page for email change verification",content:{"text/html":{schema:o.z.string()}}},302:{description:"Redirect to account or login if no session",headers:o.z.object({Location:o.z.string().url()})},400:{description:"Bad Request - HTML error page if state is missing or other input error.",content:{"text/html":{schema:o.z.string()}}},500:{description:"Internal Server Error - HTML error page.",content:{"text/html":{schema:o.z.string()}}}}}),async t=>{const{state:e,email:n,change_id:r}=t.req.valid("query"),{theme:i,branding:s,client:a,user:c}=await ei(t,e),l=await t.env.data.codes.get(a.tenant.id,r,"email_verification");return!l||l.user_id!==c.user_id?t.redirect(`/u/account?state=${e}`):t.html(g(u0,{theme:i,branding:s,client:a,email:n,state:e}))}).openapi(o.createRoute({tags:["login"],method:"post",path:"/",request:{query:o.z.object({state:o.z.string().openapi({description:"The state parameter from the authorization request"}),email:o.z.string().toLowerCase(),change_id:o.z.string()}),body:{content:{"application/x-www-form-urlencoded":{schema:o.z.object({code:o.z.string()})}}}},responses:{200:{description:"HTML response with verification result",content:{"text/html":{schema:o.z.string()}}},302:{description:"Redirect to confirmation page on success",headers:o.z.object({Location:o.z.string().url()})},400:{description:"Bad Request - HTML error page if state is missing or other input error.",content:{"text/html":{schema:o.z.string()}}},500:{description:"Internal Server Error - HTML error page.",content:{"text/html":{schema:o.z.string()}}}}}),async t=>{const{env:e}=t,{state:n,email:r,change_id:i}=t.req.valid("query"),{code:s}=t.req.valid("form"),{theme:a,branding:c,client:l,user:u}=await ei(t,n);let d;try{const f=await e.data.codes.get(l.tenant.id,i,"email_verification");if(!f)d=E.t("invalid_request");else if(f.user_id!==u.user_id)d=E.t("invalid_request");else if(f.used_at)d=E.t("code_already_used");else if(new Date(f.expires_at)<new Date)d=E.t("code_expired");else{const p=await e.data.codes.get(l.tenant.id,s,"email_verification");if(!p)d=E.t("invalid_code");else if(p.used_at)d=E.t("code_already_used");else if(new Date(p.expires_at)<new Date)d=E.t("code_expired");else if(p.user_id!==u.user_id)d=E.t("invalid_code");else{await e.data.codes.used(l.tenant.id,i),await e.data.codes.used(l.tenant.id,s),await e.data.users.update(l.tenant.id,u.user_id,{email:r,email_verified:!0});const h=await e.data.users.list(l.tenant.id,{page:0,per_page:100,include_totals:!1,q:`linked_to:${u.user_id}`});for(const m of h.users)await e.data.users.update(l.tenant.id,m.user_id,{email:r,email_verified:!0});return t.redirect(`/u/account/change-email-confirmation?state=${encodeURIComponent(n)}&email=${encodeURIComponent(r)}`)}}}catch{d=E.t("operation_failed")}return t.html(g(u0,{theme:a,branding:c,client:l,email:r,error:d,state:n}))}),lA=new o.OpenAPIHono().openapi(o.createRoute({tags:["login"],method:"get",path:"/",request:{query:o.z.object({state:o.z.string().openapi({description:"The state parameter from the authorization request"}),email:o.z.string().email()})},responses:{200:{description:"HTML page showing email change confirmation",content:{"text/html":{schema:o.z.string()}}},302:{description:"Redirect to login if no session",headers:o.z.object({Location:o.z.string().url()})},400:{description:"Bad Request - HTML error page if state is missing or other input error.",content:{"text/html":{schema:o.z.string()}}},500:{description:"Internal Server Error - HTML error page.",content:{"text/html":{schema:o.z.string()}}}}}),async t=>{const{state:e,email:n}=t.req.valid("query"),{theme:r,branding:i,client:s,loginSession:a}=await ei(t,e);if(!s||!s.tenant?.id)return console.error("Client or tenant ID missing in GET /u/change-email-confirmation after initJSXRoute"),t.html(g(Dt,{theme:r,branding:i,client:s,state:e,pageTitle:E.t("error_page_title")||"Error",message:E.t("configuration_error_message")||"A configuration error occurred."}),500);let c=`/u/account?state=${encodeURIComponent(e)}`;return a?.authorization_url&&new URL(a.authorization_url).searchParams.get("screen_hint")==="change-email"&&(c=a.authParams?.redirect_uri||c),t.html(g(u0,{theme:r,branding:i,client:s,email:n,success:!0,state:e,redirectUrl:c}))}),zv=t=>{const{theme:e,branding:n,client:r,email:i,state:s}=t;return g(qe,{title:E.t("create_password_account_title"),theme:e,branding:n,client:r,children:[g("div",{className:"mb-4 text-lg font-medium sm:text-2xl",children:E.t("create_password_account_title")}),g("div",{className:"mb-6 text-gray-300",children:E.t("enter_email_for_verification_description")}),g("div",{className:"flex flex-1 flex-col justify-center",children:g(un,{className:"pt-2",children:[g("input",{type:"email",name:"username",placeholder:E.t("email_placeholder"),className:"mb-2 w-full rounded-lg bg-gray-100 px-4 py-5 text-base placeholder:text-gray-300 dark:bg-gray-600 md:text-base",required:!0,value:i,disabled:!0}),g(Me,{className:"sm:mt-4 !text-base",children:E.t("send")})]})}),g(Ct,{state:s})]})},uA=new o.OpenAPIHono().openapi(o.createRoute({tags:["login"],method:"get",path:"/",request:{query:o.z.object({state:o.z.string().openapi({description:"The state parameter from the authorization request"})})},responses:{200:{description:"Response"}}}),async t=>{const{state:e}=t.req.valid("query"),{theme:n,branding:r,client:i,loginSession:s}=await Ie(t,e),{username:a}=s.authParams;if(!a)throw new I(400,{message:"Username required"});return t.html(g(zv,{state:e,theme:n,branding:r,client:i,email:a}))}).openapi(o.createRoute({tags:["login"],method:"post",path:"/",request:{query:o.z.object({state:o.z.string().openapi({description:"The state parameter from the authorization request"})})},responses:{200:{description:"Response"}}}),async t=>{const{state:e}=t.req.valid("query"),{loginSession:n,client:r}=await Ie(t,e),{username:i}=n.authParams;if(!i)throw new I(400,{message:"Username required"});const s=await t.env.data.codes.create(r.tenant.id,{code_id:pr(),code_type:"email_verification",login_id:n.id,expires_at:new Date(Date.now()+jd).toISOString()});return await W7(t,i,s.code_id,n.id),t.redirect(`/u/pre-signup-sent?state=${e}`)}),Av=t=>{const{redirectUrl:e,theme:n,branding:r,client:i}=t;return g(qe,{title:E.t("invalid_session_title"),theme:n,branding:r,client:i,children:[g("div",{className:"flex flex-1 flex-col justify-center",children:E.t("invalid_session_body")}),g("div",{className:"flex flex-1 flex-col justify-center",children:e&&g("a",{className:"block text-primary hover:text-primaryHover text-center",href:e,children:E.t("go_back")})})]})},dA=new o.OpenAPIHono().openapi(o.createRoute({tags:["login"],method:"get",path:"/",request:{query:o.z.object({state:o.z.string()})},responses:{200:{description:"Response"}}}),async t=>{const{state:e}=t.req.valid("query"),{theme:n,branding:r,client:i,loginSession:s}=await Ie(t,e);let a;return s.authParams.redirect_uri&&s.authParams.state&&(a=new URL(s.authParams.redirect_uri),a.searchParams.set("state",s.authParams.state),a.searchParams.set("error","invalid_session"),a.searchParams.set("error_description",s.authParams.username||"")),t.html(g(Av,{redirectUrl:a?.href,theme:n,branding:r,client:i}))}),pA=new o.OpenAPIHono().openapi(o.createRoute({tags:["login"],method:"get",path:"/",request:{query:o.z.object({state:o.z.string().openapi({description:"The state parameter from the authorization request"}),code:o.z.string().openapi({description:"The code parameter from the authorization request"})})},responses:{200:{description:"Response"}}}),async t=>{const{state:e}=t.req.valid("query"),{theme:n,branding:r,client:i}=await Ie(t,e);return t.html(g(Dt,{message:"Not implemented",pageTitle:"User info",theme:n,branding:r,client:i,state:e}))}),Ev=({theme:t,branding:e,client:n,state:r})=>{const i=new URLSearchParams({state:r});return g(qe,{title:E.t("email_validated"),theme:t,branding:e,client:n,children:[g("div",{className:"mb-4 text-lg font-medium sm:text-2xl",children:E.t("email_validated")}),g("div",{className:"flex flex-1 flex-col justify-center mb-7",children:g(Me,{Component:"a",href:`/u/enter-password?${i}`,className:"text-base sm:mt-4 md:text-base",children:g("div",{className:"flex items-center space-x-2",children:[g("span",{children:E.t("email_validated_cta")}),g(Ge,{className:"text-xs",name:"arrow-right"})]})})})]})},fA=({theme:t,branding:e,loginSession:n,className:r})=>{const i=t?.colors?.primary_button||e?.colors?.primary||"#0066cc",s=t?.colors?.primary_button_label||"#ffffff",a=t?.colors?.body_text||"#333333",c=t?.colors?.widget_background||"#ffffff",l=t?.colors?.widget_border||"#e5e7eb",u=t?.colors?.success||"#10b981",d=t?.borders?.widget_corner_radius||8,f=t?.borders?.button_border_radius||4,p=t?.borders?.show_widget_shadow??!0,h=t?.fonts?.title?.size||24,m=t?.fonts?.title?.bold??!0,y=t?.fonts?.body_text?.size||14,w={backgroundColor:c,borderColor:l,borderRadius:`${d}px`,boxShadow:p?"0 1px 3px 0 rgba(0, 0, 0, 0.1)":"none",color:a},_={fontSize:`${h}px`,fontWeight:m?"700":"400",color:t?.colors?.header||a},k={fontSize:`${y}px`,color:t?.colors?.input_labels_placeholders||"#6b7280"},v={backgroundColor:i,color:s,borderRadius:`${f}px`},$=t?.widget?.logo_position||"center",b=$==="left"?"text-left":$==="right"?"text-right":"text-center",z=t?.widget?.logo_url||e?.logo_url,A=$!=="none"&&z;return g("div",{className:fe("flex flex-col gap-6 w-full max-w-sm",r),children:g(Sn,{style:w,className:"border",children:[g(zn,{children:[A&&g("div",{className:fe("mb-4",b),children:g(ln,{theme:t,branding:e})}),g("div",{className:"flex justify-center mb-4",children:g("div",{className:"rounded-full p-3",style:{backgroundColor:`${u}15`},children:g("svg",{xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:u,"stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[g("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),g("polyline",{points:"22 4 12 14.01 9 11.01"})]})})}),g(An,{style:_,className:"text-center",children:E.t("email_validated","Email Verified")}),g(En,{style:k,className:"text-center",children:E.t("email_validated_description","Your email has been successfully verified. You can now continue to login.")})]}),g(Cn,{children:g("a",{href:`/u/enter-password?state=${encodeURIComponent(n.authParams.state||"")}`,className:"w-full flex items-center justify-center gap-2 h-10 px-4 py-2 rounded-md font-medium transition-colors",style:v,children:[g("span",{children:E.t("email_validated_cta","Continue to Login")}),g("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[g("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),g("polyline",{points:"12 5 19 12 12 19"})]})]})})]})})},hA=new o.OpenAPIHono().openapi(o.createRoute({tags:["login"],method:"get",path:"/",request:{query:o.z.object({state:o.z.string().openapi({description:"The state parameter from the authorization request"}),code:o.z.string().openapi({description:"The code parameter from the authorization request"})})},responses:{200:{description:"Response"}}}),async t=>{const{state:e,code:n}=t.req.valid("query"),{env:r}=t,{client:i,loginSession:s,theme:a,branding:c,useShadcn:l}=await Ie(t,e),{username:u}=s.authParams;if(!u)throw new I(400,{message:"Username not found in state"});const d=await Xi({userAdapter:r.data.users,tenant_id:i.tenant.id,username:u,provider:"auth2"});if(!d)throw new I(500,{message:"No user found"});if(!await r.data.codes.get(i.tenant.id,n,"email_verification"))throw new I(400,{message:"Code not found or expired"});await r.data.users.update(i.tenant.id,d.user_id,{email_verified:!0});const h=(await T0(r.data.users,i.tenant.id,u)).filter(m=>m.provider!=="auth2");if(h.length>0){const m=h.filter(y=>!y.linked_to);m.length>1&&console.error("More than one primary user found for email",u),m.length===0&&console.error("No primary user found for email",u),m.length===1&&await r.data.users.update(i.tenant.id,d.user_id,{linked_to:m[0]?.user_id})}return l?t.html(g(Le,{title:E.t("email_validated","Email Verified"),theme:a,branding:c,client:i,children:g(fA,{theme:a,branding:c,loginSession:s,client:i})})):t.html(g(Ev,{theme:a,branding:c,client:i,state:e}))}),Cv=t=>{const{theme:e,branding:n,client:r,email:i,state:s}=t;return g(qe,{title:E.t("sign_up_success"),theme:e,branding:n,client:r,children:[g("div",{className:"mb-4 text-lg font-medium sm:text-2xl",children:E.t("email_verification_for_signup_sent_title")}),g("div",{className:"flex flex-1 flex-col justify-center",children:[g("div",{className:"mb-6 text-gray-300",children:g(fr,{i18nKey:"email_verification_for_signup_sent_description",components:[g("span",{className:"text-black dark:text-white"},"span")],values:{email:i}})}),g("div",{className:"my-4 flex space-x-2 text-sm text-[#B2B2B2]",children:[g(Ge,{className:"text-base",name:"info-bubble"}),g("div",{className:"text-sm text-gray-300 md:text-sm",children:E.t("sent_code_spam")})]})]}),g(Ct,{state:s})]})},gA=new o.OpenAPIHono().openapi(o.createRoute({tags:["login"],method:"get",path:"/",request:{query:o.z.object({state:o.z.string().openapi({description:"The state parameter from the authorization request"})})},responses:{200:{description:"Response"}}}),async t=>{const{state:e}=t.req.valid("query"),{theme:n,branding:r,client:i,loginSession:s}=await Ie(t,e),{username:a}=s.authParams;if(!a)throw new I(400,{message:"Username required"});return t.html(g(Cv,{theme:n,branding:r,client:i,state:e,email:a}))}),Wf=`
|
|
93
|
+
@font-face{font-display:swap;font-family:KHTeka;font-style:normal;font-weight:400;src:url(https://assets.sesamy.com/fonts/khteka/WOFF2/KHTeka-Regular.woff2) format("woff2")}@font-face{font-display:swap;font-family:KHTeka;font-style:normal;font-weight:500;src:url(https://assets.sesamy.com/fonts/khteka/WOFF2/KHTeka-Medium.woff2) format("woff2")}@font-face{font-display:swap;font-family:KHTeka;font-style:normal;font-weight:600;src:url(https://assets.sesamy.com/fonts/khteka/WOFF2/KHTeka-Bold.woff2) format("woff2")}@font-face{font-family:uicon;src:url(https://login2.sesamy.com/_next/static/media/uicon.0b00e08a.woff2)}[class*=" uicon-"],[class^=uicon-]{font-family:uicon!important;font-size:inherit;font-style:normal;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.uicon-apple:before{content:"\\ea01"}.uicon-arrow-down:before{content:"\\ea02"}.uicon-arrow-left:before{content:"\\ea03"}.uicon-arrow-right:before{content:"\\ea04"}.uicon-arrow-up:before{content:"\\ea05"}.uicon-facebook:before{content:"\\ea06"}.uicon-google:before{content:"\\ea07"}.uicon-info-bubble:before{content:"\\ea08"}.uicon-info:before{content:"\\ea09"}.uicon-sesamy:before{content:"\\ea0a"}.uicon-spinner-circle:before{content:"\\ea0b"}.uicon-spinner-inner:before{content:"\\ea0c"}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }
|
|
94
|
+
|
|
95
|
+
/*! tailwindcss v3.4.18 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #bfbcd7;box-sizing:border-box}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:KHTeka,Helvetica Neue,HelveticaNeue,TeX Gyre Heros,TeXGyreHeros,FreeSans,Nimbus Sans L,Liberation Sans,Arimo,Helvetica,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-feature-settings:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#4b4a58;opacity:1}input::placeholder,textarea::placeholder{color:#4b4a58;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}body,html{height:100%}body{--tw-bg-opacity:1;background-color:rgb(248 249 251/var(--tw-bg-opacity,1));font-size:1rem;letter-spacing:.0125rem;line-height:120%;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media (min-width:1280px){body{font-size:1.125rem;line-height:120%}}body:is(.dark *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}button,input,optgroup,select,textarea{font-size:.875rem;letter-spacing:.0125rem;line-height:120%}@media (min-width:1280px){button,input,optgroup,select,textarea{font-size:1rem;line-height:120%}}h1{font-size:1.5rem;font-weight:500;line-height:120%}@media (min-width:1280px){h1{font-size:2rem;line-height:120%}}@media (min-width:640px){h1{font-size:3rem;letter-spacing:-.0625rem;line-height:100%}}@media (min-width:1280px){h1{font-size:3.5rem;letter-spacing:-.0625rem;line-height:100%}}h2{font-size:1.25rem;font-weight:500;line-height:120%}@media (min-width:1280px){h2{font-size:1.5rem;line-height:120%}}@media (min-width:640px){h2{font-size:2rem;letter-spacing:0;line-height:120%}}@media (min-width:1280px){h2{font-size:3rem;letter-spacing:-.0625rem;line-height:100%}}h3{font-size:1.125rem;font-weight:500;line-height:120%}@media (min-width:1280px){h3{font-size:1.25rem;line-height:120%}}@media (min-width:640px){h3{font-size:1.5rem;line-height:120%}}@media (min-width:1280px){h3{font-size:2rem;line-height:120%}}h4{font-size:1rem;font-weight:500;line-height:120%}@media (min-width:1280px){h4{font-size:1.125rem;line-height:120%}}@media (min-width:640px){h4{font-size:1.125rem;line-height:120%}}@media (min-width:1280px){h4{font-size:1.5rem;line-height:120%}}h5{font-size:.875rem;font-weight:500;line-height:120%}@media (min-width:1280px){h5{font-size:1rem;line-height:120%}}@media (min-width:640px){h5{font-size:1rem;line-height:120%}}@media (min-width:1280px){h5{font-size:1.125rem;line-height:120%}}h6{font-size:.75rem;font-weight:500;line-height:135%}@media (min-width:1280px){h6{font-size:.875rem;line-height:120%}}@media (min-width:640px){h6{font-size:.875rem;line-height:120%}}@media (min-width:1280px){h6{font-size:1rem;line-height:120%}}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1920px){.container{max-width:1920px}}.pointer-events-none{pointer-events:none}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.left-0{left:0}.right-0{right:0}.right-2{right:.5rem}.top-0{top:0}.top-1\\/2{top:50%}.my-4{margin-bottom:1rem;margin-top:1rem}.mb-1{margin-bottom:.25rem}.mb-12{margin-bottom:3rem}.mb-16{margin-bottom:4rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.mb-7{margin-bottom:1.75rem}.mb-8{margin-bottom:2rem}.mr-2{margin-right:.5rem}.mr-4{margin-right:1rem}.mt-0\\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-8{margin-top:2rem}.line-clamp-1{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:1}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-5{height:1.25rem}.h-9{height:2.25rem}.h-full{height:100%}.min-h-\\[calc\\(100vh-83px\\)\\]{min-height:calc(100vh - 83px)}.min-h-full{min-height:100%}.min-h-screen{min-height:100vh}.w-10{width:2.5rem}.w-12{width:3rem}.w-5{width:1.25rem}.w-9{width:2.25rem}.w-\\[calc\\(100\\%-theme\\(space\\.2\\)-theme\\(space\\.2\\)\\)\\]{width:calc(100% - 1rem)}.w-auto{width:auto}.w-full{width:100%}.min-w-0{min-width:0}.max-w-\\[1295px\\]{max-width:1295px}.max-w-md{max-width:28rem}.max-w-none{max-width:none}.max-w-sm{max-width:24rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.grow{flex-grow:1}.-translate-y-1\\/2{--tw-translate-y:-50%}.-translate-y-1\\/2,.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes spin{to{transform:rotate(1turn)}}.animate-spin{animation:spin 1s linear infinite}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.flex-col{flex-direction:column}.\\!flex-nowrap{flex-wrap:nowrap!important}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.\\!justify-between{justify-content:space-between!important}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(1rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(1rem*var(--tw-space-x-reverse))}.space-y-1\\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.375rem*var(--tw-space-y-reverse));margin-top:calc(.375rem*(1 - var(--tw-space-y-reverse)))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.5rem*var(--tw-space-y-reverse));margin-top:calc(.5rem*(1 - var(--tw-space-y-reverse)))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.75rem*var(--tw-space-y-reverse));margin-top:calc(.75rem*(1 - var(--tw-space-y-reverse)))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1rem*var(--tw-space-y-reverse));margin-top:calc(1rem*(1 - var(--tw-space-y-reverse)))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1.5rem*var(--tw-space-y-reverse));margin-top:calc(1.5rem*(1 - var(--tw-space-y-reverse)))}.overflow-hidden,.truncate{overflow:hidden}.truncate{text-overflow:ellipsis;white-space:nowrap}.break-all{word-break:break-all}.rounded-2xl{border-radius:1.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.625rem}.rounded-md{border-radius:.375rem}.rounded-r-lg{border-bottom-right-radius:.625rem;border-top-right-radius:.625rem}.border{border-width:1px}.border-y{border-top-width:1px}.border-b,.border-y{border-bottom-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-gray-100{--tw-border-opacity:1;border-color:rgb(248 249 251/var(--tw-border-opacity,1))}.border-gray-200{--tw-border-opacity:1;border-color:rgb(191 188 215/var(--tw-border-opacity,1))}.border-gray-200\\/50{border-color:rgba(191,188,215,.5)}.border-gray-300{--tw-border-opacity:1;border-color:rgb(136 134 159/var(--tw-border-opacity,1))}.border-gray-500{--tw-border-opacity:1;border-color:rgb(59 57 70/var(--tw-border-opacity,1))}.border-red{--tw-border-opacity:1;border-color:rgb(252 90 90/var(--tw-border-opacity,1))}.bg-gray-100{--tw-bg-opacity:1;background-color:rgb(248 249 251/var(--tw-bg-opacity,1))}.bg-gray-200\\/40{background-color:rgba(191,188,215,.4)}.bg-primary{background-color:var(--primary-color)}.bg-primaryHover{background-color:var(--primary-hover)}.bg-red\\/80{background-color:rgba(252,90,90,.8)}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.bg-cover{background-size:cover}.bg-center{background-position:50%}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-0{padding-left:0;padding-right:0}.px-10{padding-left:2.5rem;padding-right:2.5rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.py-10{padding-bottom:2.5rem;padding-top:2.5rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.py-3{padding-bottom:.75rem;padding-top:.75rem}.py-5{padding-bottom:1.25rem;padding-top:1.25rem}.py-6{padding-bottom:1.5rem;padding-top:1.5rem}.pb-2{padding-bottom:.5rem}.pb-8{padding-bottom:2rem}.pl-12{padding-left:3rem}.pl-6{padding-left:1.5rem}.pr-12{padding-right:3rem}.pr-6{padding-right:1.5rem}.pr-8{padding-right:2rem}.pt-0{padding-top:0}.pt-2{padding-top:.5rem}.pt-2\\.5{padding-top:.625rem}.pt-4{padding-top:1rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.indent-\\[5px\\]{text-indent:5px}.align-middle{vertical-align:middle}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.\\!text-base{font-size:1rem!important;line-height:120%!important}.\\!text-xs{font-size:.75rem!important;line-height:135%!important}.text-2xl{font-size:1.5rem;line-height:120%}.text-3xl{font-size:2rem;line-height:120%}.text-base{font-size:1rem;line-height:120%}.text-lg{font-size:1.125rem;line-height:120%}.text-sm{font-size:.875rem;line-height:120%}.text-xl{font-size:1.25rem;line-height:120%}.text-xs{font-size:.75rem;line-height:135%}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.lowercase{text-transform:lowercase}.leading-\\[0\\]{line-height:0}.leading-none{line-height:1}.leading-tight{line-height:1.25}.tracking-tight{letter-spacing:-.025em}.text-\\[\\#B2B2B2\\]{--tw-text-opacity:1;color:rgb(178 178 178/var(--tw-text-opacity,1))}.text-black{--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity,1))}.text-gray-200{--tw-text-opacity:1;color:rgb(191 188 215/var(--tw-text-opacity,1))}.text-gray-300{--tw-text-opacity:1;color:rgb(136 134 159/var(--tw-text-opacity,1))}.text-gray-400{--tw-text-opacity:1;color:rgb(75 74 88/var(--tw-text-opacity,1))}.text-gray-500{--tw-text-opacity:1;color:rgb(59 57 70/var(--tw-text-opacity,1))}.text-gray-700{--tw-text-opacity:1;color:rgb(30 30 39/var(--tw-text-opacity,1))}.text-gray-800{--tw-text-opacity:1;color:rgb(20 20 26/var(--tw-text-opacity,1))}.text-gray-900{--tw-text-opacity:1;color:rgb(8 8 14/var(--tw-text-opacity,1))}.text-green{--tw-text-opacity:1;color:rgb(54 191 118/var(--tw-text-opacity,1))}.text-primary{color:var(--primary-color)}.text-red{--tw-text-opacity:1;color:rgb(252 90 90/var(--tw-text-opacity,1))}.text-textOnPrimary{color:var(--text-on-primary)}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.accent-\\[\\#4F2D7F\\]{accent-color:#4f2d7f}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-90{opacity:.9}.shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.outline{outline-style:solid}.ring-offset-white{--tw-ring-offset-color:#fff}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-transform{transition-duration:.15s;transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-200{transition-duration:.2s}.row-up-left{align-content:flex-start;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:flex-start}.row-left{justify-content:flex-start}.row,.row-left{align-content:center;align-items:center;display:flex;flex-direction:row;flex-wrap:wrap}.row{justify-content:center}.column-left{align-items:flex-start}.column,.column-left{display:flex;flex-direction:column;justify-content:center}.column{align-items:center}@media (min-width:1280px){.text-5xl{font-size:5.125rem;letter-spacing:-.125rem;line-height:100%}.text-4xl{font-size:3.5rem}.text-3xl,.text-4xl{letter-spacing:-.0625rem;line-height:100%}.text-3xl{font-size:3rem}.text-2xl{font-size:2rem}.text-2xl,.text-xl{line-height:120%}.text-xl{font-size:1.5rem}.text-lg{font-size:1.25rem}.text-base,.text-lg{line-height:120%}.text-base{font-size:1.125rem}.text-sm{font-size:1rem}.text-sm,.text-xs{line-height:120%}.text-xs{font-size:.875rem}}:root{--primary-color:#7d68f4;--primary-hover:#9786f6;--text-on-primary:#fff}svg{transform:translate3d(var(--tw-translate-x),var(--tw-translate-y),0) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}*,:after,:before{text-underline-offset:4px}input[type=number],input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;-moz-appearance:textfield!important}.btn.is-loading{cursor:not-allowed;opacity:.4;pointer-events:none}.btn .btn-spinner,.btn.is-loading .btn-label{opacity:0;visibility:hidden}.btn.is-loading .btn-spinner{opacity:1;visibility:visible}[class*=" uicon-"],[class^=uicon-]{letter-spacing:0;line-height:100%}.file\\:border-0::file-selector-button{border-width:0}.file\\:text-sm::file-selector-button{font-size:.875rem;line-height:120%}.file\\:font-medium::file-selector-button{font-weight:500}.placeholder\\:normal-case::-moz-placeholder{text-transform:none}.placeholder\\:normal-case::placeholder{text-transform:none}.placeholder\\:text-gray-300::-moz-placeholder{--tw-text-opacity:1;color:rgb(136 134 159/var(--tw-text-opacity,1))}.placeholder\\:text-gray-300::placeholder{--tw-text-opacity:1;color:rgb(136 134 159/var(--tw-text-opacity,1))}.placeholder\\:text-gray-500::-moz-placeholder{--tw-text-opacity:1;color:rgb(59 57 70/var(--tw-text-opacity,1))}.placeholder\\:text-gray-500::placeholder{--tw-text-opacity:1;color:rgb(59 57 70/var(--tw-text-opacity,1))}.first\\:rounded-l-md:first-child{border-bottom-left-radius:.375rem;border-top-left-radius:.375rem}.first\\:border-l:first-child{border-left-width:1px}.last\\:rounded-r-md:last-child{border-bottom-right-radius:.375rem;border-top-right-radius:.375rem}.hover\\:bg-black\\/5:hover{background-color:rgba(0,0,0,.05)}.hover\\:bg-gray-100:hover{--tw-bg-opacity:1;background-color:rgb(248 249 251/var(--tw-bg-opacity,1))}.hover\\:bg-gray-200:hover{--tw-bg-opacity:1;background-color:rgb(191 188 215/var(--tw-bg-opacity,1))}.hover\\:bg-gray-200\\/75:hover{background-color:rgba(191,188,215,.75)}.hover\\:bg-primaryHover:hover{background-color:var(--primary-hover)}.hover\\:bg-red\\/90:hover{background-color:rgba(252,90,90,.9)}.hover\\:text-gray-700:hover{--tw-text-opacity:1;color:rgb(30 30 39/var(--tw-text-opacity,1))}.hover\\:text-primaryHover:hover{color:var(--primary-hover)}.hover\\:underline:hover{text-decoration-line:underline}.hover\\:opacity-100:hover{opacity:1}.hover\\:brightness-90:hover{--tw-brightness:brightness(.9);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.focus\\:z-10:focus{z-index:10}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:ring:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color)}.focus\\:ring-1:focus,.focus\\:ring:focus{box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\\:ring-1:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color)}.focus\\:ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\\:ring-primary:focus{--tw-ring-color:var(--primary-color)}.focus\\:ring-offset-2:focus{--tw-ring-offset-width:2px}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:ring-2:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:opacity-50:disabled{opacity:.5}.group[open] .group-open\\:rotate-90{--tw-rotate:90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.peer:disabled~.peer-disabled\\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\\:opacity-70{opacity:.7}.has-\\[\\:disabled\\]\\:opacity-50:has(:disabled){opacity:.5}.dark\\:border-gray-400:is(.dark *){--tw-border-opacity:1;border-color:rgb(75 74 88/var(--tw-border-opacity,1))}.dark\\:border-gray-500:is(.dark *){--tw-border-opacity:1;border-color:rgb(59 57 70/var(--tw-border-opacity,1))}.dark\\:border-gray-600:is(.dark *){--tw-border-opacity:1;border-color:rgb(40 40 52/var(--tw-border-opacity,1))}.dark\\:border-gray-700:is(.dark *){--tw-border-opacity:1;border-color:rgb(30 30 39/var(--tw-border-opacity,1))}.dark\\:bg-black:is(.dark *){--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity,1))}.dark\\:bg-gray-600:is(.dark *){--tw-bg-opacity:1;background-color:rgb(40 40 52/var(--tw-bg-opacity,1))}.dark\\:bg-gray-700:is(.dark *){--tw-bg-opacity:1;background-color:rgb(30 30 39/var(--tw-bg-opacity,1))}.dark\\:bg-gray-800:is(.dark *){--tw-bg-opacity:1;background-color:rgb(20 20 26/var(--tw-bg-opacity,1))}.dark\\:text-\\[\\#201a41\\]:is(.dark *){--tw-text-opacity:1;color:rgb(32 26 65/var(--tw-text-opacity,1))}.dark\\:text-gray-300:is(.dark *){--tw-text-opacity:1;color:rgb(136 134 159/var(--tw-text-opacity,1))}.dark\\:text-gray-400:is(.dark *){--tw-text-opacity:1;color:rgb(75 74 88/var(--tw-text-opacity,1))}.dark\\:text-white:is(.dark *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\\:ring-offset-gray-900:is(.dark *){--tw-ring-offset-color:#08080e}.dark\\:placeholder\\:text-gray-400:is(.dark *)::-moz-placeholder{--tw-text-opacity:1;color:rgb(75 74 88/var(--tw-text-opacity,1))}.dark\\:placeholder\\:text-gray-400:is(.dark *)::placeholder{--tw-text-opacity:1;color:rgb(75 74 88/var(--tw-text-opacity,1))}.dark\\:hover\\:bg-black\\/90:hover:is(.dark *){background-color:rgba(0,0,0,.9)}.dark\\:hover\\:bg-gray-700:hover:is(.dark *){--tw-bg-opacity:1;background-color:rgb(30 30 39/var(--tw-bg-opacity,1))}.dark\\:hover\\:bg-gray-800:hover:is(.dark *){--tw-bg-opacity:1;background-color:rgb(20 20 26/var(--tw-bg-opacity,1))}.dark\\:focus\\:ring-offset-gray-900:focus:is(.dark *){--tw-ring-offset-color:#08080e}@media (min-width:640px){.sm\\:absolute{position:absolute}.sm\\:left-4{left:1rem}.sm\\:top-1\\/2{top:50%}.sm\\:mt-4{margin-top:1rem}.sm\\:inline{display:inline}.sm\\:h-6{height:1.5rem}.sm\\:min-h-\\[700px\\]{min-height:700px}.sm\\:w-6{width:1.5rem}.sm\\:w-\\[calc\\(100\\%-theme\\(space\\.16\\)-theme\\(space\\.16\\)\\)\\]{width:calc(100% - 8rem)}.sm\\:w-auto{width:auto}.sm\\:w-full{width:100%}.sm\\:max-w-md{max-width:28rem}.sm\\:-translate-y-1\\/2{--tw-translate-y:-50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.sm\\:flex-col{flex-direction:column}.sm\\:justify-normal{justify-content:normal}.sm\\:space-x-0>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(0px*(1 - var(--tw-space-x-reverse)));margin-right:calc(0px*var(--tw-space-x-reverse))}.sm\\:space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1rem*var(--tw-space-y-reverse));margin-top:calc(1rem*(1 - var(--tw-space-y-reverse)))}.sm\\:bg-fixed{background-attachment:fixed}.sm\\:bg-left-top{background-position:0 0}.sm\\:px-10{padding-left:2.5rem;padding-right:2.5rem}.sm\\:px-14{padding-left:3.5rem;padding-right:3.5rem}.sm\\:py-14{padding-bottom:3.5rem;padding-top:3.5rem}.sm\\:py-4{padding-bottom:1rem;padding-top:1rem}.sm\\:pt-16{padding-top:4rem}.sm\\:text-2xl{font-size:1.5rem;line-height:120%}.sm\\:text-base{font-size:1rem;line-height:120%}}@media (min-width:1280px){.md\\:min-w-\\[448px\\]{min-width:448px}.md\\:p-10{padding:2.5rem}.md\\:py-10{padding-bottom:2.5rem;padding-top:2.5rem}.md\\:pl-10{padding-left:2.5rem}.md\\:pl-20{padding-left:5rem}.md\\:pr-10{padding-right:2.5rem}.md\\:pr-20{padding-right:5rem}.md\\:text-3xl{font-size:2rem;line-height:120%}.md\\:text-base{font-size:1rem;line-height:120%}.md\\:text-sm{font-size:.875rem;line-height:120%}.md\\:text-xs{font-size:.75rem;line-height:135%}}@media (max-height:900px) and (min-width:640px){.short\\:static{position:static}.short\\:left-auto{left:auto}.short\\:top-auto{top:auto}.short\\:inline{display:inline}.short\\:hidden{display:none}.short\\:h-5{height:1.25rem}.short\\:min-h-\\[558px\\]{min-height:558px}.short\\:w-5{width:1.25rem}.short\\:flex-1{flex:1 1 0%}.short\\:translate-y-0{--tw-translate-y:0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.short\\:flex-row{flex-direction:row}.short\\:space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(1rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(1rem*var(--tw-space-x-reverse))}.short\\:space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(0px*var(--tw-space-y-reverse));margin-top:calc(0px*(1 - var(--tw-space-y-reverse)))}.short\\:px-0{padding-left:0;padding-right:0}.short\\:py-3{padding-bottom:.75rem;padding-top:.75rem}}.\\[\\&\\>\\*\\:last-child\\]\\:mb-0>:last-child{margin-bottom:0}.\\[\\&_h1\\]\\:mb-6 h1,.\\[\\&_h2\\]\\:mb-6 h2{margin-bottom:1.5rem}`;function mA(){if(typeof document<"u"){const t=document.createElement("style");t.innerHTML=Wf,t.setAttribute("data-authhero-tailwind",""),document.head.appendChild(t)}}const _A='var Ke={Stringify:1},b=(e,t)=>{const n=new String(e);return n.isEscaped=!0,n.callbacks=t,n},We=/[&<>\'"]/,Ue=async(e,t)=>{let n="";t||=[];const r=await Promise.all(e);for(let a=r.length-1;n+=r[a],a--,!(a<0);a--){let i=r[a];typeof i=="object"&&t.push(...i.callbacks||[]);const s=i.isEscaped;if(i=await(typeof i=="object"?i.toString():i),typeof i=="object"&&t.push(...i.callbacks||[]),i.isEscaped??s)n+=i;else{const o=[n];A(i,o),n=o[0]}}return b(n,t)},A=(e,t)=>{const n=e.search(We);if(n===-1){t[0]+=e;return}let r,a,i=0;for(a=n;a<e.length;a++){switch(e.charCodeAt(a)){case 34:r=""";break;case 39:r="'";break;case 38:r="&";break;case 60:r="<";break;case 62:r=">";break;default:continue}t[0]+=e.substring(i,a)+r,i=a+1}t[0]+=e.substring(i,a)},Ve=e=>{const t=e.callbacks;if(!t?.length)return e;const n=[e],r={};return t.forEach(a=>a({phase:Ke.Stringify,buffer:n,context:r})),n[0]},ee=Symbol("RENDERER"),G=Symbol("ERROR_HANDLER"),v=Symbol("STASH"),Ie=Symbol("INTERNAL"),Ze=Symbol("MEMO"),F=Symbol("PERMALINK"),fe=e=>(e[Ie]=!0,e),Te=e=>({value:t,children:n})=>{if(!n)return;const r={children:[{tag:fe(()=>{e.push(t)}),props:{}}]};Array.isArray(n)?r.children.push(...n.flat()):r.children.push(n),r.children.push({tag:fe(()=>{e.pop()}),props:{}});const a={tag:"",props:r,type:""};return a[G]=i=>{throw e.pop(),i},a},Le=e=>{const t=[e],n=Te(t);return n.values=t,n.Provider=n,C.push(n),n},C=[],Pe=e=>{const t=[e],n=(r=>{t.push(r.value);let a;try{a=r.children?(Array.isArray(r.children)?new $e("",{},r.children):r.children).toString():""}finally{t.pop()}return a instanceof Promise?a.then(i=>b(i,i.callbacks)):b(a)});return n.values=t,n.Provider=n,n[ee]=Te(t),C.push(n),n},T=e=>e.values.at(-1),x={title:[],script:["src"],style:["data-href"],link:["href"],meta:["name","httpEquiv","charset","itemProp"]},Y={},_="data-precedence",M=e=>Array.isArray(e)?e:[e],ue=new WeakMap,de=(e,t,n,r)=>({buffer:a,context:i})=>{if(!a)return;const s=ue.get(i)||{};ue.set(i,s);const o=s[e]||=[];let u=!1;const l=x[e];if(l.length>0){e:for(const[,f]of o)for(const c of l)if((f?.[c]??null)===n?.[c]){u=!0;break e}}if(u?a[0]=a[0].replaceAll(t,""):l.length>0?o.push([t,n,r]):o.unshift([t,n,r]),a[0].indexOf("</head>")!==-1){let f;if(r===void 0)f=o.map(([c])=>c);else{const c=[];f=o.map(([d,,p])=>{let y=c.indexOf(p);return y===-1&&(c.push(p),y=c.length-1),[d,y]}).sort((d,p)=>d[1]-p[1]).map(([d])=>d)}f.forEach(c=>{a[0]=a[0].replaceAll(c,"")}),a[0]=a[0].replace(/(?=<\\/head>)/,f.join(""))}},D=(e,t,n)=>b(new w(e,n,M(t??[])).toString()),$=(e,t,n,r)=>{if("itemProp"in n)return D(e,t,n);let{precedence:a,blocking:i,...s}=n;a=r?a??"":void 0,r&&(s[_]=a);const o=new w(e,s,M(t||[])).toString();return o instanceof Promise?o.then(u=>b(o,[...u.callbacks||[],de(e,u,s,a)])):b(o,[de(e,o,s,a)])},ze=({children:e,...t})=>{const n=te();if(n){const r=T(n);if(r==="svg"||r==="head")return new w("title",t,M(e??[]))}return $("title",e,t,!1)},Je=({children:e,...t})=>{const n=te();return["src","async"].some(r=>!t[r])||n&&T(n)==="head"?D("script",e,t):$("script",e,t,!1)},Xe=({children:e,...t})=>["href","precedence"].every(n=>n in t)?(t["data-href"]=t.href,delete t.href,$("style",e,t,!0)):D("style",e,t),Ge=({children:e,...t})=>["onLoad","onError"].some(n=>n in t)||t.rel==="stylesheet"&&(!("precedence"in t)||"disabled"in t)?D("link",e,t):$("link",e,t,"precedence"in t),Ye=({children:e,...t})=>{const n=te();return n&&T(n)==="head"?D("meta",e,t):$("meta",e,t,!1)},Ne=(e,{children:t,...n})=>new w(e,n,M(t??[])),Qe=e=>(typeof e.action=="function"&&(e.action=F in e.action?e.action[F]:void 0),Ne("form",e)),Me=(e,t)=>(typeof t.formAction=="function"&&(t.formAction=F in t.formAction?t.formAction[F]:void 0),Ne(e,t)),et=e=>Me("input",e),tt=e=>Me("button",e);const V=Object.freeze(Object.defineProperty({__proto__:null,button:tt,form:Qe,input:et,link:Ge,meta:Ye,script:Je,style:Xe,title:ze},Symbol.toStringTag,{value:"Module"}));var nt=new Map([["className","class"],["htmlFor","for"],["crossOrigin","crossorigin"],["httpEquiv","http-equiv"],["itemProp","itemprop"],["fetchPriority","fetchpriority"],["noModule","nomodule"],["formAction","formaction"]]),q=e=>nt.get(e)||e,De=(e,t)=>{for(const[n,r]of Object.entries(e)){const a=n[0]==="-"||!/[A-Z]/.test(n)?n:n.replace(/[A-Z]/g,i=>`-${i.toLowerCase()}`);t(a,r==null?null:typeof r=="number"?a.match(/^(?:a|border-im|column(?:-c|s)|flex(?:$|-[^b])|grid-(?:ar|[^a])|font-w|li|or|sca|st|ta|wido|z)|ty$/)?`${r}`:`${r}px`:r)}},P=void 0,te=()=>P,rt=e=>/[A-Z]/.test(e)&&e.match(/^(?:al|basel|clip(?:Path|Rule)$|co|do|fill|fl|fo|gl|let|lig|i|marker[EMS]|o|pai|pointe|sh|st[or]|text[^L]|tr|u|ve|w)/)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e,at=["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],it=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","defer","disabled","download","formnovalidate","hidden","inert","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"],ne=(e,t)=>{for(let n=0,r=e.length;n<r;n++){const a=e[n];if(typeof a=="string")A(a,t);else{if(typeof a=="boolean"||a===null||a===void 0)continue;a instanceof w?a.toStringToBuffer(t):typeof a=="number"||a.isEscaped?t[0]+=a:a instanceof Promise?t.unshift("",a):ne(a,t)}}},w=class{tag;props;key;children;isEscaped=!0;localContexts;constructor(e,t,n){this.tag=e,this.props=t,this.children=n}get type(){return this.tag}get ref(){return this.props.ref||null}toString(){const e=[""];this.localContexts?.forEach(([t,n])=>{t.values.push(n)});try{this.toStringToBuffer(e)}finally{this.localContexts?.forEach(([t])=>{t.values.pop()})}return e.length===1?"callbacks"in e?Ve(b(e[0],e.callbacks)).toString():e[0]:Ue(e,e.callbacks)}toStringToBuffer(e){const t=this.tag,n=this.props;let{children:r}=this;e[0]+=`<${t}`;const a=P&&T(P)==="svg"?i=>rt(q(i)):i=>q(i);for(let[i,s]of Object.entries(n))if(i=a(i),i!=="children"){if(i==="style"&&typeof s=="object"){let o="";De(s,(u,l)=>{l!=null&&(o+=`${o?";":""}${u}:${l}`)}),e[0]+=\' style="\',A(o,e),e[0]+=\'"\'}else if(typeof s=="string")e[0]+=` ${i}="`,A(s,e),e[0]+=\'"\';else if(s!=null)if(typeof s=="number"||s.isEscaped)e[0]+=` ${i}="${s}"`;else if(typeof s=="boolean"&&it.includes(i))s&&(e[0]+=` ${i}=""`);else if(i==="dangerouslySetInnerHTML"){if(r.length>0)throw new Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");r=[b(s.__html)]}else if(s instanceof Promise)e[0]+=` ${i}="`,e.unshift(\'"\',s);else if(typeof s=="function"){if(!i.startsWith("on")&&i!=="ref")throw new Error(`Invalid prop \'${i}\' of type \'function\' supplied to \'${t}\'.`)}else e[0]+=` ${i}="`,A(s.toString(),e),e[0]+=\'"\'}if(at.includes(t)&&r.length===0){e[0]+="/>";return}e[0]+=">",ne(r,e),e[0]+=`</${t}>`}},Z=class extends w{toStringToBuffer(e){const{children:t}=this,n={...this.props};t.length&&(n.children=t.length===1?t[0]:t);const r=this.tag.call(null,n);if(!(typeof r=="boolean"||r==null))if(r instanceof Promise)if(C.length===0)e.unshift("",r);else{const a=C.map(i=>[i,i.values.at(-1)]);e.unshift("",r.then(i=>(i instanceof w&&(i.localContexts=a),i)))}else r instanceof w?r.toStringToBuffer(e):typeof r=="number"||r.isEscaped?(e[0]+=r,r.callbacks&&(e.callbacks||=[],e.callbacks.push(...r.callbacks))):A(r,e)}},$e=class extends w{toStringToBuffer(e){ne(this.children,e)}},ve=!1,z=(e,t,n)=>{if(!ve){for(const r in Y)V[r][ee]=Y[r];ve=!0}return typeof e=="function"?new Z(e,t,n):V[e]?new Z(V[e],t,n):e==="svg"||e==="head"?(P||=Pe(""),new w(e,t,[new Z(P,{value:e},n)])):new w(e,t,n)},st=({children:e})=>new $e("",{children:e},Array.isArray(e)?e:e?[e]:[]);function O(e,t,n){let r;if(!t||!("children"in t))r=z(e,t,[]);else{const a=t.children;r=Array.isArray(a)?z(e,t,a):z(e,t,[a])}return r.key=n,r}var N="_hp",ot={Change:"Input",DoubleClick:"DblClick"},lt={svg:"2000/svg",math:"1998/Math/MathML"},k=[],Q=new WeakMap,I=void 0,ct=()=>I,S=e=>"t"in e,J={onClick:["click",!1]},pe=e=>{if(!e.startsWith("on"))return;if(J[e])return J[e];const t=e.match(/^on([A-Z][a-zA-Z]+?(?:PointerCapture)?)(Capture)?$/);if(t){const[,n,r]=t;return J[e]=[(ot[n]||n).toLowerCase(),!!r]}},he=(e,t)=>I&&e instanceof SVGElement&&/[A-Z]/.test(t)&&(t in e.style||t.match(/^(?:o|pai|str|u|ve)/))?t.replace(/([A-Z])/g,"-$1").toLowerCase():t,ft=(e,t,n)=>{t||={};for(let r in t){const a=t[r];if(r!=="children"&&(!n||n[r]!==a)){r=q(r);const i=pe(r);if(i){if(n?.[r]!==a&&(n&&e.removeEventListener(i[0],n[r],i[1]),a!=null)){if(typeof a!="function")throw new Error(`Event handler for "${r}" is not a function`);e.addEventListener(i[0],a,i[1])}}else if(r==="dangerouslySetInnerHTML"&&a)e.innerHTML=a.__html;else if(r==="ref"){let s;typeof a=="function"?s=a(e)||(()=>a(null)):a&&"current"in a&&(a.current=e,s=()=>a.current=null),Q.set(e,s)}else if(r==="style"){const s=e.style;typeof a=="string"?s.cssText=a:(s.cssText="",a!=null&&De(a,s.setProperty.bind(s)))}else{if(r==="value"){const o=e.nodeName;if(o==="INPUT"||o==="TEXTAREA"||o==="SELECT"){if(e.value=a==null||a===!1?null:a,o==="TEXTAREA"){e.textContent=a;continue}else if(o==="SELECT"){e.selectedIndex===-1&&(e.selectedIndex=0);continue}}}else(r==="checked"&&e.nodeName==="INPUT"||r==="selected"&&e.nodeName==="OPTION")&&(e[r]=a);const s=he(e,r);a==null||a===!1?e.removeAttribute(s):a===!0?e.setAttribute(s,""):typeof a=="string"||typeof a=="number"?e.setAttribute(s,a):e.setAttribute(s,a.toString())}}}if(n)for(let r in n){const a=n[r];if(r!=="children"&&!(r in t)){r=q(r);const i=pe(r);i?e.removeEventListener(i[0],a,i[1]):r==="ref"?Q.get(e)?.():e.removeAttribute(he(e,r))}}},ut=(e,t)=>{t[v][0]=0,k.push([e,t]);const n=t.tag[ee]||t.tag,r=n.defaultProps?{...n.defaultProps,...t.props}:t.props;try{return[n.call(null,r)]}finally{k.pop()}},Re=(e,t,n,r,a)=>{e.vR?.length&&(r.push(...e.vR),delete e.vR),typeof e.tag=="function"&&e[v][1][ae]?.forEach(i=>a.push(i)),e.vC.forEach(i=>{if(S(i))n.push(i);else if(typeof i.tag=="function"||i.tag===""){i.c=t;const s=n.length;if(Re(i,t,n,r,a),i.s){for(let o=s;o<n.length;o++)n[o].s=!0;i.s=!1}}else n.push(i),i.vR?.length&&(r.push(...i.vR),delete i.vR)})},dt=e=>{for(;;e=e.tag===N||!e.vC||!e.pP?e.nN:e.vC[0]){if(!e)return null;if(e.tag!==N&&e.e)return e.e}},Oe=e=>{S(e)||(e[v]?.[1][ae]?.forEach(t=>t[2]?.()),Q.get(e.e)?.(),e.p===2&&e.vC?.forEach(t=>t.p=2),e.vC?.forEach(Oe)),e.p||(e.e?.remove(),delete e.e),typeof e.tag=="function"&&(L.delete(e),B.delete(e),delete e[v][3],e.a=!0)},re=(e,t,n)=>{e.c=t,xe(e,t,n)},ge=(e,t)=>{if(t){for(let n=0,r=e.length;n<r;n++)if(e[n]===t)return n}},me=Symbol(),xe=(e,t,n)=>{const r=[],a=[],i=[];Re(e,t,r,a,i),a.forEach(Oe);const s=n?void 0:t.childNodes;let o,u=null;if(n)o=-1;else if(!s.length)o=0;else{const l=ge(s,dt(e.nN));l!==void 0?(u=s[l],o=l):o=ge(s,r.find(f=>f.tag!==N&&f.e)?.e)??-1,o===-1&&(n=!0)}for(let l=0,f=r.length;l<f;l++,o++){const c=r[l];let d;if(c.s&&c.e)d=c.e,c.s=!1;else{const p=n||!c.e;S(c)?(c.e&&c.d&&(c.e.textContent=c.t),c.d=!1,d=c.e||=document.createTextNode(c.t)):(d=c.e||=c.n?document.createElementNS(c.n,c.tag):document.createElement(c.tag),ft(d,c.props,c.pP),xe(c,d,p))}c.tag===N?o--:n?d.parentNode||t.appendChild(d):s[o]!==d&&s[o-1]!==d&&(s[o+1]===d?t.appendChild(s[o]):t.insertBefore(d,u||s[o]||null))}if(e.pP&&delete e.pP,i.length){const l=[],f=[];i.forEach(([,c,,d,p])=>{c&&l.push(c),d&&f.push(d),p?.()}),l.forEach(c=>c()),f.length&&requestAnimationFrame(()=>{f.forEach(c=>c())})}},vt=(e,t)=>!!(e&&e.length===t.length&&e.every((n,r)=>n[1]===t[r][1])),B=new WeakMap,K=(e,t,n)=>{const r=!n&&t.pC;n&&(t.pC||=t.vC);let a;try{n||=typeof t.tag=="function"?ut(e,t):M(t.props.children),n[0]?.tag===""&&n[0][G]&&(a=n[0][G],e[5].push([e,a,t]));const i=r?[...t.pC]:t.vC?[...t.vC]:void 0,s=[];let o;for(let u=0;u<n.length;u++){Array.isArray(n[u])&&n.splice(u,1,...n[u].flat());let l=_e(n[u]);if(l){typeof l.tag=="function"&&!l.tag[Ie]&&(C.length>0&&(l[v][2]=C.map(c=>[c,c.values.at(-1)])),e[5]?.length&&(l[v][3]=e[5].at(-1)));let f;if(i&&i.length){const c=i.findIndex(S(l)?d=>S(d):l.key!==void 0?d=>d.key===l.key&&d.tag===l.tag:d=>d.tag===l.tag);c!==-1&&(f=i[c],i.splice(c,1))}if(f)if(S(l))f.t!==l.t&&(f.t=l.t,f.d=!0),l=f;else{const c=f.pP=f.props;if(f.props=l.props,f.f||=l.f||t.f,typeof l.tag=="function"){const d=f[v][2];f[v][2]=l[v][2]||[],f[v][3]=l[v][3],!f.f&&((f.o||f)===l.o||f.tag[Ze]?.(c,f.props))&&vt(d,f[v][2])&&(f.s=!0)}l=f}else if(!S(l)&&I){const c=T(I);c&&(l.n=c)}if(!S(l)&&!l.s&&(K(e,l),delete l.f),s.push(l),o&&!o.s&&!l.s)for(let c=o;c&&!S(c);c=c.vC?.at(-1))c.nN=l;o=l}}t.vR=r?[...t.vC,...i||[]]:i||[],t.vC=s,r&&delete t.pC}catch(i){if(t.f=!0,i===me){if(a)return;throw i}const[s,o,u]=t[v]?.[3]||[];if(o){const l=()=>H([0,!1,e[2]],u),f=B.get(u)||[];f.push(l),B.set(u,f);const c=o(i,()=>{const d=B.get(u);if(d){const p=d.indexOf(l);if(p!==-1)return d.splice(p,1),l()}});if(c){if(e[0]===1)e[1]=!0;else if(K(e,u,[c]),(o.length===1||e!==s)&&u.c){re(u,u.c,!1);return}throw me}}throw i}finally{a&&e[5].pop()}},_e=e=>{if(!(e==null||typeof e=="boolean")){if(typeof e=="string"||typeof e=="number")return{t:e.toString(),d:!0};if("vR"in e&&(e={tag:e.tag,props:e.props,key:e.key,f:e.f,type:e.tag,ref:e.props.ref,o:e.o||e}),typeof e.tag=="function")e[v]=[0,[]];else{const t=lt[e.tag];t&&(I||=Le(""),e.props.children=[{tag:I,props:{value:e.n=`http://www.w3.org/${t}`,children:e.props.children}}])}return e}},Be=(e,t,n)=>{e.c===t&&(e.c=n,e.vC.forEach(r=>Be(r,t,n)))},ye=(e,t)=>{t[v][2]?.forEach(([n,r])=>{n.values.push(r)});try{K(e,t,void 0)}catch{return}if(t.a){delete t.a;return}t[v][2]?.forEach(([n])=>{n.values.pop()}),(e[0]!==1||!e[1])&&re(t,t.c,!1)},L=new WeakMap,Ee=[],H=async(e,t)=>{e[5]||=[];const n=L.get(t);n&&n[0](void 0);let r;const a=new Promise(i=>r=i);if(L.set(t,[r,()=>{e[2]?e[2](e,t,i=>{ye(i,t)}).then(()=>r(t)):(ye(e,t),r(t))}]),Ee.length)Ee.at(-1).add(t);else{await Promise.resolve();const i=L.get(t);i&&(L.delete(t),i[1]())}return a},pt=(e,t)=>{const n=[];n[5]=[],n[4]=!0,K(n,e,void 0),n[4]=!1;const r=document.createDocumentFragment();re(e,r,!0),Be(e,r,t),t.replaceChildren(r)},ht=(e,t,n)=>({tag:N,props:{children:e},key:n,e:t,p:1}),gt=0,ae=1,mt=2,yt=3,X=new WeakMap,ie=(e,t)=>!e||!t||e.length!==t.length||t.some((n,r)=>n!==e[r]),Et=void 0,we=[],He=e=>{const t=()=>typeof e=="function"?e():e,n=k.at(-1);if(!n)return[t(),()=>{}];const[,r]=n,a=r[v][1][gt]||=[],i=r[v][0]++;return a[i]||=[t(),s=>{const o=Et,u=a[i];if(typeof s=="function"&&(s=s(u[0])),!Object.is(s,u[0]))if(u[0]=s,we.length){const[l,f]=we.at(-1);Promise.all([l===3?r:H([l,!1,o],r),f]).then(([c])=>{if(!c||!(l===2||l===3))return;const d=c.vC;requestAnimationFrame(()=>{setTimeout(()=>{d===c.vC&&H([l===3?1:0,!1,o],c)})})})}else H([0,!1,o],r)}]},wt=(e,t,n)=>{const r=k.at(-1);if(!r)return;const[,a]=r,i=a[v][1][ae]||=[],s=a[v][0]++,[o,,u]=i[s]||=[];if(ie(o,n)){u&&u();const l=()=>{f[e]=void 0,f[2]=t()},f=[n,void 0,void 0,void 0,void 0];f[e]=l,i[s]=f}},je=(e,t)=>wt(3,e,t),se=(e,t)=>{const n=k.at(-1);if(!n)return e;const[,r]=n,a=r[v][1][mt]||=[],i=r[v][0]++,s=a[i];return ie(s?.[1],t)?a[i]=[e,t]:e=a[i][0],e},St=e=>{const t=X.get(e);if(t){if(t.length===2)throw t[1];return t[0]}throw e.then(n=>X.set(e,[n]),n=>X.set(e,[void 0,n])),e},bt=(e,t)=>{const n=k.at(-1);if(!n)return e();const[,r]=n,a=r[v][1][yt]||=[],i=r[v][0]++,s=a[i];return ie(s?.[1],t)&&(a[i]=[e(),t]),a[i][0]},At=Le({pending:!1,data:null,method:null,action:null}),Se=new Set,Ct=e=>{Se.add(e),e.finally(()=>Se.delete(e))},oe=(e,t)=>bt(()=>n=>{let r;e&&(typeof e=="function"?r=e(n)||(()=>{e(null)}):e&&"current"in e&&(e.current=n,r=()=>{e.current=null}));const a=t(n);return()=>{a?.(),r?.()}},[e]),be=Object.create(null),Ae=Object.create(null),R=(e,t,n,r,a)=>{if(t?.itemProp)return{tag:e,props:t,type:e,ref:t.ref};const i=document.head;let{onLoad:s,onError:o,precedence:u,blocking:l,...f}=t,c=null,d=!1;const p=x[e];let y;if(p.length>0){const g=i.querySelectorAll(e);e:for(const m of g)for(const h of x[e])if(m.getAttribute(h)===t[h]){c=m;break e}if(!c){const m=p.reduce((h,E)=>t[E]===void 0?h:`${h}-${E}-${t[E]}`,e);d=!Ae[m],c=Ae[m]||=(()=>{const h=document.createElement(e);for(const E of p)t[E]!==void 0&&h.setAttribute(E,t[E]),t.rel&&h.setAttribute("rel",t.rel);return h})()}}else y=i.querySelectorAll(e);u=r?u??"":void 0,r&&(f[_]=u);const le=se(g=>{if(p.length>0){let m=!1;for(const h of i.querySelectorAll(e)){if(m&&h.getAttribute(_)!==u){i.insertBefore(g,h);return}h.getAttribute(_)===u&&(m=!0)}i.appendChild(g)}else if(y){let m=!1;for(const h of y)if(h===g){m=!0;break}m||i.insertBefore(g,i.contains(y[0])?y[0]:i.querySelector(e)),y=void 0}},[u]),ce=oe(t.ref,g=>{const m=p[0];if(n===2&&(g.innerHTML=""),(d||y)&&le(g),!o&&!s)return;let h=be[g.getAttribute(m)]||=new Promise((E,U)=>{g.addEventListener("load",E),g.addEventListener("error",U)});s&&(h=h.then(s)),o&&(h=h.catch(o)),h.catch(()=>{})});if(a&&l==="render"){const g=x[e][0];if(t[g]){const m=t[g],h=be[m]||=new Promise((E,U)=>{le(c),c.addEventListener("load",E),c.addEventListener("error",U)});St(h)}}const W={tag:e,type:e,props:{...f,ref:ce},ref:ce};return W.p=n,c&&(W.e=c),ht(W,i)},kt=e=>{const t=ct();return(t&&T(t))?.endsWith("svg")?{tag:"title",props:e,type:"title",ref:e.ref}:R("title",e,void 0,!1,!1)},It=e=>!e||["src","async"].some(t=>!e[t])?{tag:"script",props:e,type:"script",ref:e.ref}:R("script",e,1,!1,!0),Tt=e=>!e||!["href","precedence"].every(t=>t in e)?{tag:"style",props:e,type:"style",ref:e.ref}:(e["data-href"]=e.href,delete e.href,R("style",e,2,!0,!0)),Lt=e=>!e||["onLoad","onError"].some(t=>t in e)||e.rel==="stylesheet"&&(!("precedence"in e)||"disabled"in e)?{tag:"link",props:e,type:"link",ref:e.ref}:R("link",e,1,"precedence"in e,!0),Pt=e=>R("meta",e,void 0,!1,!1),Fe=Symbol(),Nt=e=>{const{action:t,...n}=e;typeof t!="function"&&(n.action=t);const[r,a]=He([null,!1]),i=se(async l=>{const f=l.isTrusted?t:l.detail[Fe];if(typeof f!="function")return;l.preventDefault();const c=new FormData(l.target);a([c,!0]);const d=f(c);d instanceof Promise&&(Ct(d),await d),a([null,!0])},[]),s=oe(e.ref,l=>(l.addEventListener("submit",i),()=>{l.removeEventListener("submit",i)})),[o,u]=r;return r[1]=!1,{tag:At,props:{value:{pending:o!==null,data:o,method:o?"post":null,action:o?t:null},children:{tag:"form",props:{...n,ref:s},type:"form",ref:s}},f:u}},qe=(e,{formAction:t,...n})=>{if(typeof t=="function"){const r=se(a=>{a.preventDefault(),a.currentTarget.form.dispatchEvent(new CustomEvent("submit",{detail:{[Fe]:t}}))},[]);n.ref=oe(n.ref,a=>(a.addEventListener("click",r),()=>{a.removeEventListener("click",r)}))}return{tag:e,props:n,type:e,ref:n.ref}},Mt=e=>qe("input",e),Dt=e=>qe("button",e);Object.assign(Y,{title:kt,script:It,style:Tt,link:Lt,meta:Pt,form:Nt,input:Mt,button:Dt});Pe(null);new TextEncoder;var $t=(e,t={})=>{let n;return Object.keys(t).length>0&&console.warn("createRoot options are not supported yet"),{render(r){if(n===null)throw new Error("Cannot update an unmounted root");n?n(r):pt(_e({tag:()=>{const[a,i]=He(r);return n=i,a},props:{}}),e)},unmount(){n?.(null),n=null}}},Rt=(e,t,n={})=>{const r=$t(e,n);return r.render(t),r};function Ot(){return je(()=>{const e=document.querySelectorAll("form"),t=[];return e.forEach(n=>{const r=i=>{if(i.defaultPrevented)return;const s=i.submitter;s&&s.type==="submit"&&(s.classList.add("is-loading"),s.disabled=!0)};n.addEventListener("submit",r);const a=i=>{i.persisted&&n.querySelectorAll("button[type=submit]").forEach(o=>{o.classList.remove("is-loading"),o.disabled=!1})};window.addEventListener("pageshow",a),t.push(()=>{n.removeEventListener("submit",r),window.removeEventListener("pageshow",a)})}),()=>{t.forEach(n=>n())}},[]),null}function xt(){return je(()=>{const e=document.querySelectorAll("[data-password-toggle]"),t=[];return e.forEach(n=>{const r=n.querySelector("input[type=\'password\'], input[data-password-input]"),a=n.querySelector("[data-password-toggle-btn]"),i=a?.querySelector("[data-show-icon]"),s=a?.querySelector("[data-hide-icon]");if(!r||!a||!i||!s)return;const o=l=>{l?(r.type="text",r.setAttribute("data-password-input","text"),i.classList.add("hidden"),s.classList.remove("hidden")):(r.type="password",r.setAttribute("data-password-input","password"),s.classList.add("hidden"),i.classList.remove("hidden"))},u=l=>{l.preventDefault();const f=r.type==="password";o(f)};a.addEventListener("click",u),t.push(()=>{a.removeEventListener("click",u)})}),()=>{t.forEach(n=>n())}},[]),null}function _t(){return document.querySelectorAll("[data-input-otp-container]").forEach(t=>{const n=Array.from(t.querySelectorAll("[data-input-otp-slot]"));if(!n.length)return;const r=t.closest("form");let a=null;if(r&&n.length>0){const o=n[0]?.getAttribute("name");o&&(a=r.querySelector(`input[name="${o}"][type="hidden"]`),a||(a=document.createElement("input"),a.type="hidden",a.name=o,r.appendChild(a)),n.forEach(u=>u.removeAttribute("name")))}const i=()=>{if(a){const s=n.map(o=>o.value).join("");a.value=s,s.length===n.length&&r&&setTimeout(()=>{r.requestSubmit()},100)}};n.forEach((s,o)=>{s.addEventListener("input",u=>{const l=u.target;let f=l.value;f=f.replace(/[^0-9]/g,""),f.length>1&&(f=f.charAt(0)),l.value=f,f&&o<n.length-1&&n[o+1]?.focus(),i()}),s.addEventListener("paste",u=>{u.preventDefault();const f=(u.clipboardData?.getData("text")||"").replace(/[^0-9]/g,"");for(let d=0;d<Math.min(f.length,n.length-o);d++){const p=n[o+d],y=f.charAt(d);p&&y&&(p.value=y)}const c=n.findIndex((d,p)=>p>=o&&!d.value);c!==-1?n[c]?.focus():n[Math.min(o+f.length,n.length-1)]?.focus(),i()}),s.addEventListener("keydown",u=>{if(u.key==="Backspace"){const l=u.target;if(!l.value&&o>0){u.preventDefault();const f=n[o-1];f&&(f.value="",f.focus()),i()}else l.value&&setTimeout(()=>i(),0)}else u.key==="ArrowLeft"&&o>0?(u.preventDefault(),n[o-1]?.focus()):u.key==="ArrowRight"&&o<n.length-1&&(u.preventDefault(),n[o+1]?.focus())}),s.addEventListener("focus",()=>{s.select()})}),i()}),null}const j="authhero_incognito_mode",Bt="https://unpkg.com/detectincognitojs@1.6.2";async function Ht(){return window.detectIncognito?window.detectIncognito:new Promise((e,t)=>{const n=document.createElement("script");n.src=Bt,n.type="text/javascript",n.crossOrigin="anonymous",n.onload=()=>{let r=window.detectIncognito;!r&&window.__detectIncognito&&(r=window.__detectIncognito),!r&&window.module&&window.module.exports&&(r=window.module.exports),r&&typeof r=="function"?e(r):r&&r.detectIncognito?e(r.detectIncognito):typeof r=="object"&&r.default?e(r.default):t(new Error("detectIncognito not found after loading script"))},n.onerror=()=>{t(new Error("Failed to load detectincognitojs script"))},document.head.appendChild(n)})}function jt(){try{const e=sessionStorage.getItem(j);return e===null?void 0:e==="true"}catch{return}}async function Ft(){try{const e=sessionStorage.getItem(j);if(e!==null)return e==="true";const t=await Ht(),{isPrivate:n}=await t();return sessionStorage.setItem(j,n.toString()),n}catch{try{sessionStorage.setItem(j,"false")}catch{}return!1}}const qt=()=>{const e=jt();if(e!==void 0){e&&Ce();return}Ft().then(t=>{t&&Ce()}).catch(()=>{})};function Ce(){const e=document.getElementById("incognito-warning-container");e&&e.classList.remove("hidden")}qt();const ke=document.getElementById("client-root");ke&&Rt(ke,O(st,{children:[O(Ot,{}),O(xt,{}),O(_t,{})]}));\n';var Ht={},Vt={},Du={},Kt={},da={},k_;function yA(){return k_||(k_=1,Object.defineProperty(da,"__esModule",{value:!0}),da.default=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(function(t){return t.charCodeAt(0)}))),da}var pa={},$_;function bA(){return $_||($_=1,Object.defineProperty(pa,"__esModule",{value:!0}),pa.default=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(function(t){return t.charCodeAt(0)}))),pa}var Uu={},S_;function z_(){return S_||(S_=1,(function(t){var e;Object.defineProperty(t,"__esModule",{value:!0}),t.replaceCodePoint=t.fromCodePoint=void 0;var n=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);t.fromCodePoint=(e=String.fromCodePoint)!==null&&e!==void 0?e:function(s){var a="";return s>65535&&(s-=65536,a+=String.fromCharCode(s>>>10&1023|55296),s=56320|s&1023),a+=String.fromCharCode(s),a};function r(s){var a;return s>=55296&&s<=57343||s>1114111?65533:(a=n.get(s))!==null&&a!==void 0?a:s}t.replaceCodePoint=r;function i(s){return(0,t.fromCodePoint)(r(s))}t.default=i})(Uu)),Uu}var A_;function Hc(){return A_||(A_=1,(function(t){var e=Kt&&Kt.__createBinding||(Object.create?(function(C,P,M,K){K===void 0&&(K=M);var B=Object.getOwnPropertyDescriptor(P,M);(!B||("get"in B?!P.__esModule:B.writable||B.configurable))&&(B={enumerable:!0,get:function(){return P[M]}}),Object.defineProperty(C,K,B)}):(function(C,P,M,K){K===void 0&&(K=M),C[K]=P[M]})),n=Kt&&Kt.__setModuleDefault||(Object.create?(function(C,P){Object.defineProperty(C,"default",{enumerable:!0,value:P})}):function(C,P){C.default=P}),r=Kt&&Kt.__importStar||function(C){if(C&&C.__esModule)return C;var P={};if(C!=null)for(var M in C)M!=="default"&&Object.prototype.hasOwnProperty.call(C,M)&&e(P,C,M);return n(P,C),P},i=Kt&&Kt.__importDefault||function(C){return C&&C.__esModule?C:{default:C}};Object.defineProperty(t,"__esModule",{value:!0}),t.decodeXML=t.decodeHTMLStrict=t.decodeHTMLAttribute=t.decodeHTML=t.determineBranch=t.EntityDecoder=t.DecodingMode=t.BinTrieFlags=t.fromCodePoint=t.replaceCodePoint=t.decodeCodePoint=t.xmlDecodeTree=t.htmlDecodeTree=void 0;var s=i(yA());t.htmlDecodeTree=s.default;var a=i(bA());t.xmlDecodeTree=a.default;var c=r(z_());t.decodeCodePoint=c.default;var l=z_();Object.defineProperty(t,"replaceCodePoint",{enumerable:!0,get:function(){return l.replaceCodePoint}}),Object.defineProperty(t,"fromCodePoint",{enumerable:!0,get:function(){return l.fromCodePoint}});var u;(function(C){C[C.NUM=35]="NUM",C[C.SEMI=59]="SEMI",C[C.EQUALS=61]="EQUALS",C[C.ZERO=48]="ZERO",C[C.NINE=57]="NINE",C[C.LOWER_A=97]="LOWER_A",C[C.LOWER_F=102]="LOWER_F",C[C.LOWER_X=120]="LOWER_X",C[C.LOWER_Z=122]="LOWER_Z",C[C.UPPER_A=65]="UPPER_A",C[C.UPPER_F=70]="UPPER_F",C[C.UPPER_Z=90]="UPPER_Z"})(u||(u={}));var d=32,f;(function(C){C[C.VALUE_LENGTH=49152]="VALUE_LENGTH",C[C.BRANCH_LENGTH=16256]="BRANCH_LENGTH",C[C.JUMP_TABLE=127]="JUMP_TABLE"})(f=t.BinTrieFlags||(t.BinTrieFlags={}));function p(C){return C>=u.ZERO&&C<=u.NINE}function h(C){return C>=u.UPPER_A&&C<=u.UPPER_F||C>=u.LOWER_A&&C<=u.LOWER_F}function m(C){return C>=u.UPPER_A&&C<=u.UPPER_Z||C>=u.LOWER_A&&C<=u.LOWER_Z||p(C)}function y(C){return C===u.EQUALS||m(C)}var w;(function(C){C[C.EntityStart=0]="EntityStart",C[C.NumericStart=1]="NumericStart",C[C.NumericDecimal=2]="NumericDecimal",C[C.NumericHex=3]="NumericHex",C[C.NamedEntity=4]="NamedEntity"})(w||(w={}));var _;(function(C){C[C.Legacy=0]="Legacy",C[C.Strict=1]="Strict",C[C.Attribute=2]="Attribute"})(_=t.DecodingMode||(t.DecodingMode={}));var k=(function(){function C(P,M,K){this.decodeTree=P,this.emitCodePoint=M,this.errors=K,this.state=w.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=_.Strict}return C.prototype.startEntity=function(P){this.decodeMode=P,this.state=w.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1},C.prototype.write=function(P,M){switch(this.state){case w.EntityStart:return P.charCodeAt(M)===u.NUM?(this.state=w.NumericStart,this.consumed+=1,this.stateNumericStart(P,M+1)):(this.state=w.NamedEntity,this.stateNamedEntity(P,M));case w.NumericStart:return this.stateNumericStart(P,M);case w.NumericDecimal:return this.stateNumericDecimal(P,M);case w.NumericHex:return this.stateNumericHex(P,M);case w.NamedEntity:return this.stateNamedEntity(P,M)}},C.prototype.stateNumericStart=function(P,M){return M>=P.length?-1:(P.charCodeAt(M)|d)===u.LOWER_X?(this.state=w.NumericHex,this.consumed+=1,this.stateNumericHex(P,M+1)):(this.state=w.NumericDecimal,this.stateNumericDecimal(P,M))},C.prototype.addToNumericResult=function(P,M,K,B){if(M!==K){var oe=K-M;this.result=this.result*Math.pow(B,oe)+parseInt(P.substr(M,oe),B),this.consumed+=oe}},C.prototype.stateNumericHex=function(P,M){for(var K=M;M<P.length;){var B=P.charCodeAt(M);if(p(B)||h(B))M+=1;else return this.addToNumericResult(P,K,M,16),this.emitNumericEntity(B,3)}return this.addToNumericResult(P,K,M,16),-1},C.prototype.stateNumericDecimal=function(P,M){for(var K=M;M<P.length;){var B=P.charCodeAt(M);if(p(B))M+=1;else return this.addToNumericResult(P,K,M,10),this.emitNumericEntity(B,2)}return this.addToNumericResult(P,K,M,10),-1},C.prototype.emitNumericEntity=function(P,M){var K;if(this.consumed<=M)return(K=this.errors)===null||K===void 0||K.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(P===u.SEMI)this.consumed+=1;else if(this.decodeMode===_.Strict)return 0;return this.emitCodePoint((0,c.replaceCodePoint)(this.result),this.consumed),this.errors&&(P!==u.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed},C.prototype.stateNamedEntity=function(P,M){for(var K=this.decodeTree,B=K[this.treeIndex],oe=(B&f.VALUE_LENGTH)>>14;M<P.length;M++,this.excess++){var ae=P.charCodeAt(M);if(this.treeIndex=$(K,B,this.treeIndex+Math.max(1,oe),ae),this.treeIndex<0)return this.result===0||this.decodeMode===_.Attribute&&(oe===0||y(ae))?0:this.emitNotTerminatedNamedEntity();if(B=K[this.treeIndex],oe=(B&f.VALUE_LENGTH)>>14,oe!==0){if(ae===u.SEMI)return this.emitNamedEntityData(this.treeIndex,oe,this.consumed+this.excess);this.decodeMode!==_.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1},C.prototype.emitNotTerminatedNamedEntity=function(){var P,M=this,K=M.result,B=M.decodeTree,oe=(B[K]&f.VALUE_LENGTH)>>14;return this.emitNamedEntityData(K,oe,this.consumed),(P=this.errors)===null||P===void 0||P.missingSemicolonAfterCharacterReference(),this.consumed},C.prototype.emitNamedEntityData=function(P,M,K){var B=this.decodeTree;return this.emitCodePoint(M===1?B[P]&~f.VALUE_LENGTH:B[P+1],K),M===3&&this.emitCodePoint(B[P+2],K),K},C.prototype.end=function(){var P;switch(this.state){case w.NamedEntity:return this.result!==0&&(this.decodeMode!==_.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case w.NumericDecimal:return this.emitNumericEntity(0,2);case w.NumericHex:return this.emitNumericEntity(0,3);case w.NumericStart:return(P=this.errors)===null||P===void 0||P.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case w.EntityStart:return 0}},C})();t.EntityDecoder=k;function v(C){var P="",M=new k(C,function(K){return P+=(0,c.fromCodePoint)(K)});return function(B,oe){for(var ae=0,se=0;(se=B.indexOf("&",se))>=0;){P+=B.slice(ae,se),M.startEntity(oe);var ve=M.write(B,se+1);if(ve<0){ae=se+M.end();break}ae=se+ve,se=ve===0?ae+1:ae}var Ce=P+B.slice(ae);return P="",Ce}}function $(C,P,M,K){var B=(P&f.BRANCH_LENGTH)>>7,oe=P&f.JUMP_TABLE;if(B===0)return oe!==0&&K===oe?M:-1;if(oe){var ae=K-oe;return ae<0||ae>=B?-1:C[M+ae]-1}for(var se=M,ve=se+B-1;se<=ve;){var Ce=se+ve>>>1,Ne=C[Ce];if(Ne<K)se=Ce+1;else if(Ne>K)ve=Ce-1;else return C[Ce+B]}return-1}t.determineBranch=$;var b=v(s.default),z=v(a.default);function A(C,P){return P===void 0&&(P=_.Legacy),b(C,P)}t.decodeHTML=A;function N(C){return b(C,_.Attribute)}t.decodeHTMLAttribute=N;function O(C){return b(C,_.Strict)}t.decodeHTMLStrict=O;function L(C){return z(C,_.Strict)}t.decodeXML=L})(Kt)),Kt}var E_;function Nv(){return E_||(E_=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.QuoteType=void 0;var e=Hc(),n;(function(p){p[p.Tab=9]="Tab",p[p.NewLine=10]="NewLine",p[p.FormFeed=12]="FormFeed",p[p.CarriageReturn=13]="CarriageReturn",p[p.Space=32]="Space",p[p.ExclamationMark=33]="ExclamationMark",p[p.Number=35]="Number",p[p.Amp=38]="Amp",p[p.SingleQuote=39]="SingleQuote",p[p.DoubleQuote=34]="DoubleQuote",p[p.Dash=45]="Dash",p[p.Slash=47]="Slash",p[p.Zero=48]="Zero",p[p.Nine=57]="Nine",p[p.Semi=59]="Semi",p[p.Lt=60]="Lt",p[p.Eq=61]="Eq",p[p.Gt=62]="Gt",p[p.Questionmark=63]="Questionmark",p[p.UpperA=65]="UpperA",p[p.LowerA=97]="LowerA",p[p.UpperF=70]="UpperF",p[p.LowerF=102]="LowerF",p[p.UpperZ=90]="UpperZ",p[p.LowerZ=122]="LowerZ",p[p.LowerX=120]="LowerX",p[p.OpeningSquareBracket=91]="OpeningSquareBracket"})(n||(n={}));var r;(function(p){p[p.Text=1]="Text",p[p.BeforeTagName=2]="BeforeTagName",p[p.InTagName=3]="InTagName",p[p.InSelfClosingTag=4]="InSelfClosingTag",p[p.BeforeClosingTagName=5]="BeforeClosingTagName",p[p.InClosingTagName=6]="InClosingTagName",p[p.AfterClosingTagName=7]="AfterClosingTagName",p[p.BeforeAttributeName=8]="BeforeAttributeName",p[p.InAttributeName=9]="InAttributeName",p[p.AfterAttributeName=10]="AfterAttributeName",p[p.BeforeAttributeValue=11]="BeforeAttributeValue",p[p.InAttributeValueDq=12]="InAttributeValueDq",p[p.InAttributeValueSq=13]="InAttributeValueSq",p[p.InAttributeValueNq=14]="InAttributeValueNq",p[p.BeforeDeclaration=15]="BeforeDeclaration",p[p.InDeclaration=16]="InDeclaration",p[p.InProcessingInstruction=17]="InProcessingInstruction",p[p.BeforeComment=18]="BeforeComment",p[p.CDATASequence=19]="CDATASequence",p[p.InSpecialComment=20]="InSpecialComment",p[p.InCommentLike=21]="InCommentLike",p[p.BeforeSpecialS=22]="BeforeSpecialS",p[p.SpecialStartSequence=23]="SpecialStartSequence",p[p.InSpecialTag=24]="InSpecialTag",p[p.BeforeEntity=25]="BeforeEntity",p[p.BeforeNumericEntity=26]="BeforeNumericEntity",p[p.InNamedEntity=27]="InNamedEntity",p[p.InNumericEntity=28]="InNumericEntity",p[p.InHexEntity=29]="InHexEntity"})(r||(r={}));function i(p){return p===n.Space||p===n.NewLine||p===n.Tab||p===n.FormFeed||p===n.CarriageReturn}function s(p){return p===n.Slash||p===n.Gt||i(p)}function a(p){return p>=n.Zero&&p<=n.Nine}function c(p){return p>=n.LowerA&&p<=n.LowerZ||p>=n.UpperA&&p<=n.UpperZ}function l(p){return p>=n.UpperA&&p<=n.UpperF||p>=n.LowerA&&p<=n.LowerF}var u;(function(p){p[p.NoValue=0]="NoValue",p[p.Unquoted=1]="Unquoted",p[p.Single=2]="Single",p[p.Double=3]="Double"})(u=t.QuoteType||(t.QuoteType={}));var d={Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,62]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101])},f=(function(){function p(h,m){var y=h.xmlMode,w=y===void 0?!1:y,_=h.decodeEntities,k=_===void 0?!0:_;this.cbs=m,this.state=r.Text,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=r.Text,this.isSpecial=!1,this.running=!0,this.offset=0,this.currentSequence=void 0,this.sequenceIndex=0,this.trieIndex=0,this.trieCurrent=0,this.entityResult=0,this.entityExcess=0,this.xmlMode=w,this.decodeEntities=k,this.entityTrie=w?e.xmlDecodeTree:e.htmlDecodeTree}return p.prototype.reset=function(){this.state=r.Text,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=r.Text,this.currentSequence=void 0,this.running=!0,this.offset=0},p.prototype.write=function(h){this.offset+=this.buffer.length,this.buffer=h,this.parse()},p.prototype.end=function(){this.running&&this.finish()},p.prototype.pause=function(){this.running=!1},p.prototype.resume=function(){this.running=!0,this.index<this.buffer.length+this.offset&&this.parse()},p.prototype.getIndex=function(){return this.index},p.prototype.getSectionStart=function(){return this.sectionStart},p.prototype.stateText=function(h){h===n.Lt||!this.decodeEntities&&this.fastForwardTo(n.Lt)?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=r.BeforeTagName,this.sectionStart=this.index):this.decodeEntities&&h===n.Amp&&(this.state=r.BeforeEntity)},p.prototype.stateSpecialStartSequence=function(h){var m=this.sequenceIndex===this.currentSequence.length,y=m?s(h):(h|32)===this.currentSequence[this.sequenceIndex];if(!y)this.isSpecial=!1;else if(!m){this.sequenceIndex++;return}this.sequenceIndex=0,this.state=r.InTagName,this.stateInTagName(h)},p.prototype.stateInSpecialTag=function(h){if(this.sequenceIndex===this.currentSequence.length){if(h===n.Gt||i(h)){var m=this.index-this.currentSequence.length;if(this.sectionStart<m){var y=this.index;this.index=m,this.cbs.ontext(this.sectionStart,m),this.index=y}this.isSpecial=!1,this.sectionStart=m+2,this.stateInClosingTagName(h);return}this.sequenceIndex=0}(h|32)===this.currentSequence[this.sequenceIndex]?this.sequenceIndex+=1:this.sequenceIndex===0?this.currentSequence===d.TitleEnd?this.decodeEntities&&h===n.Amp&&(this.state=r.BeforeEntity):this.fastForwardTo(n.Lt)&&(this.sequenceIndex=1):this.sequenceIndex=+(h===n.Lt)},p.prototype.stateCDATASequence=function(h){h===d.Cdata[this.sequenceIndex]?++this.sequenceIndex===d.Cdata.length&&(this.state=r.InCommentLike,this.currentSequence=d.CdataEnd,this.sequenceIndex=0,this.sectionStart=this.index+1):(this.sequenceIndex=0,this.state=r.InDeclaration,this.stateInDeclaration(h))},p.prototype.fastForwardTo=function(h){for(;++this.index<this.buffer.length+this.offset;)if(this.buffer.charCodeAt(this.index-this.offset)===h)return!0;return this.index=this.buffer.length+this.offset-1,!1},p.prototype.stateInCommentLike=function(h){h===this.currentSequence[this.sequenceIndex]?++this.sequenceIndex===this.currentSequence.length&&(this.currentSequence===d.CdataEnd?this.cbs.oncdata(this.sectionStart,this.index,2):this.cbs.oncomment(this.sectionStart,this.index,2),this.sequenceIndex=0,this.sectionStart=this.index+1,this.state=r.Text):this.sequenceIndex===0?this.fastForwardTo(this.currentSequence[0])&&(this.sequenceIndex=1):h!==this.currentSequence[this.sequenceIndex-1]&&(this.sequenceIndex=0)},p.prototype.isTagStartChar=function(h){return this.xmlMode?!s(h):c(h)},p.prototype.startSpecial=function(h,m){this.isSpecial=!0,this.currentSequence=h,this.sequenceIndex=m,this.state=r.SpecialStartSequence},p.prototype.stateBeforeTagName=function(h){if(h===n.ExclamationMark)this.state=r.BeforeDeclaration,this.sectionStart=this.index+1;else if(h===n.Questionmark)this.state=r.InProcessingInstruction,this.sectionStart=this.index+1;else if(this.isTagStartChar(h)){var m=h|32;this.sectionStart=this.index,!this.xmlMode&&m===d.TitleEnd[2]?this.startSpecial(d.TitleEnd,3):this.state=!this.xmlMode&&m===d.ScriptEnd[2]?r.BeforeSpecialS:r.InTagName}else h===n.Slash?this.state=r.BeforeClosingTagName:(this.state=r.Text,this.stateText(h))},p.prototype.stateInTagName=function(h){s(h)&&(this.cbs.onopentagname(this.sectionStart,this.index),this.sectionStart=-1,this.state=r.BeforeAttributeName,this.stateBeforeAttributeName(h))},p.prototype.stateBeforeClosingTagName=function(h){i(h)||(h===n.Gt?this.state=r.Text:(this.state=this.isTagStartChar(h)?r.InClosingTagName:r.InSpecialComment,this.sectionStart=this.index))},p.prototype.stateInClosingTagName=function(h){(h===n.Gt||i(h))&&(this.cbs.onclosetag(this.sectionStart,this.index),this.sectionStart=-1,this.state=r.AfterClosingTagName,this.stateAfterClosingTagName(h))},p.prototype.stateAfterClosingTagName=function(h){(h===n.Gt||this.fastForwardTo(n.Gt))&&(this.state=r.Text,this.baseState=r.Text,this.sectionStart=this.index+1)},p.prototype.stateBeforeAttributeName=function(h){h===n.Gt?(this.cbs.onopentagend(this.index),this.isSpecial?(this.state=r.InSpecialTag,this.sequenceIndex=0):this.state=r.Text,this.baseState=this.state,this.sectionStart=this.index+1):h===n.Slash?this.state=r.InSelfClosingTag:i(h)||(this.state=r.InAttributeName,this.sectionStart=this.index)},p.prototype.stateInSelfClosingTag=function(h){h===n.Gt?(this.cbs.onselfclosingtag(this.index),this.state=r.Text,this.baseState=r.Text,this.sectionStart=this.index+1,this.isSpecial=!1):i(h)||(this.state=r.BeforeAttributeName,this.stateBeforeAttributeName(h))},p.prototype.stateInAttributeName=function(h){(h===n.Eq||s(h))&&(this.cbs.onattribname(this.sectionStart,this.index),this.sectionStart=-1,this.state=r.AfterAttributeName,this.stateAfterAttributeName(h))},p.prototype.stateAfterAttributeName=function(h){h===n.Eq?this.state=r.BeforeAttributeValue:h===n.Slash||h===n.Gt?(this.cbs.onattribend(u.NoValue,this.index),this.state=r.BeforeAttributeName,this.stateBeforeAttributeName(h)):i(h)||(this.cbs.onattribend(u.NoValue,this.index),this.state=r.InAttributeName,this.sectionStart=this.index)},p.prototype.stateBeforeAttributeValue=function(h){h===n.DoubleQuote?(this.state=r.InAttributeValueDq,this.sectionStart=this.index+1):h===n.SingleQuote?(this.state=r.InAttributeValueSq,this.sectionStart=this.index+1):i(h)||(this.sectionStart=this.index,this.state=r.InAttributeValueNq,this.stateInAttributeValueNoQuotes(h))},p.prototype.handleInAttributeValue=function(h,m){h===m||!this.decodeEntities&&this.fastForwardTo(m)?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(m===n.DoubleQuote?u.Double:u.Single,this.index),this.state=r.BeforeAttributeName):this.decodeEntities&&h===n.Amp&&(this.baseState=this.state,this.state=r.BeforeEntity)},p.prototype.stateInAttributeValueDoubleQuotes=function(h){this.handleInAttributeValue(h,n.DoubleQuote)},p.prototype.stateInAttributeValueSingleQuotes=function(h){this.handleInAttributeValue(h,n.SingleQuote)},p.prototype.stateInAttributeValueNoQuotes=function(h){i(h)||h===n.Gt?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(u.Unquoted,this.index),this.state=r.BeforeAttributeName,this.stateBeforeAttributeName(h)):this.decodeEntities&&h===n.Amp&&(this.baseState=this.state,this.state=r.BeforeEntity)},p.prototype.stateBeforeDeclaration=function(h){h===n.OpeningSquareBracket?(this.state=r.CDATASequence,this.sequenceIndex=0):this.state=h===n.Dash?r.BeforeComment:r.InDeclaration},p.prototype.stateInDeclaration=function(h){(h===n.Gt||this.fastForwardTo(n.Gt))&&(this.cbs.ondeclaration(this.sectionStart,this.index),this.state=r.Text,this.sectionStart=this.index+1)},p.prototype.stateInProcessingInstruction=function(h){(h===n.Gt||this.fastForwardTo(n.Gt))&&(this.cbs.onprocessinginstruction(this.sectionStart,this.index),this.state=r.Text,this.sectionStart=this.index+1)},p.prototype.stateBeforeComment=function(h){h===n.Dash?(this.state=r.InCommentLike,this.currentSequence=d.CommentEnd,this.sequenceIndex=2,this.sectionStart=this.index+1):this.state=r.InDeclaration},p.prototype.stateInSpecialComment=function(h){(h===n.Gt||this.fastForwardTo(n.Gt))&&(this.cbs.oncomment(this.sectionStart,this.index,0),this.state=r.Text,this.sectionStart=this.index+1)},p.prototype.stateBeforeSpecialS=function(h){var m=h|32;m===d.ScriptEnd[3]?this.startSpecial(d.ScriptEnd,4):m===d.StyleEnd[3]?this.startSpecial(d.StyleEnd,4):(this.state=r.InTagName,this.stateInTagName(h))},p.prototype.stateBeforeEntity=function(h){this.entityExcess=1,this.entityResult=0,h===n.Number?this.state=r.BeforeNumericEntity:h===n.Amp||(this.trieIndex=0,this.trieCurrent=this.entityTrie[0],this.state=r.InNamedEntity,this.stateInNamedEntity(h))},p.prototype.stateInNamedEntity=function(h){if(this.entityExcess+=1,this.trieIndex=(0,e.determineBranch)(this.entityTrie,this.trieCurrent,this.trieIndex+1,h),this.trieIndex<0){this.emitNamedEntity(),this.index--;return}this.trieCurrent=this.entityTrie[this.trieIndex];var m=this.trieCurrent&e.BinTrieFlags.VALUE_LENGTH;if(m){var y=(m>>14)-1;if(!this.allowLegacyEntity()&&h!==n.Semi)this.trieIndex+=y;else{var w=this.index-this.entityExcess+1;w>this.sectionStart&&this.emitPartial(this.sectionStart,w),this.entityResult=this.trieIndex,this.trieIndex+=y,this.entityExcess=0,this.sectionStart=this.index+1,y===0&&this.emitNamedEntity()}}},p.prototype.emitNamedEntity=function(){if(this.state=this.baseState,this.entityResult!==0){var h=(this.entityTrie[this.entityResult]&e.BinTrieFlags.VALUE_LENGTH)>>14;switch(h){case 1:{this.emitCodePoint(this.entityTrie[this.entityResult]&~e.BinTrieFlags.VALUE_LENGTH);break}case 2:{this.emitCodePoint(this.entityTrie[this.entityResult+1]);break}case 3:this.emitCodePoint(this.entityTrie[this.entityResult+1]),this.emitCodePoint(this.entityTrie[this.entityResult+2])}}},p.prototype.stateBeforeNumericEntity=function(h){(h|32)===n.LowerX?(this.entityExcess++,this.state=r.InHexEntity):(this.state=r.InNumericEntity,this.stateInNumericEntity(h))},p.prototype.emitNumericEntity=function(h){var m=this.index-this.entityExcess-1,y=m+2+ +(this.state===r.InHexEntity);y!==this.index&&(m>this.sectionStart&&this.emitPartial(this.sectionStart,m),this.sectionStart=this.index+Number(h),this.emitCodePoint((0,e.replaceCodePoint)(this.entityResult))),this.state=this.baseState},p.prototype.stateInNumericEntity=function(h){h===n.Semi?this.emitNumericEntity(!0):a(h)?(this.entityResult=this.entityResult*10+(h-n.Zero),this.entityExcess++):(this.allowLegacyEntity()?this.emitNumericEntity(!1):this.state=this.baseState,this.index--)},p.prototype.stateInHexEntity=function(h){h===n.Semi?this.emitNumericEntity(!0):a(h)?(this.entityResult=this.entityResult*16+(h-n.Zero),this.entityExcess++):l(h)?(this.entityResult=this.entityResult*16+((h|32)-n.LowerA+10),this.entityExcess++):(this.allowLegacyEntity()?this.emitNumericEntity(!1):this.state=this.baseState,this.index--)},p.prototype.allowLegacyEntity=function(){return!this.xmlMode&&(this.baseState===r.Text||this.baseState===r.InSpecialTag)},p.prototype.cleanup=function(){this.running&&this.sectionStart!==this.index&&(this.state===r.Text||this.state===r.InSpecialTag&&this.sequenceIndex===0?(this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index):(this.state===r.InAttributeValueDq||this.state===r.InAttributeValueSq||this.state===r.InAttributeValueNq)&&(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=this.index))},p.prototype.shouldContinue=function(){return this.index<this.buffer.length+this.offset&&this.running},p.prototype.parse=function(){for(;this.shouldContinue();){var h=this.buffer.charCodeAt(this.index-this.offset);switch(this.state){case r.Text:{this.stateText(h);break}case r.SpecialStartSequence:{this.stateSpecialStartSequence(h);break}case r.InSpecialTag:{this.stateInSpecialTag(h);break}case r.CDATASequence:{this.stateCDATASequence(h);break}case r.InAttributeValueDq:{this.stateInAttributeValueDoubleQuotes(h);break}case r.InAttributeName:{this.stateInAttributeName(h);break}case r.InCommentLike:{this.stateInCommentLike(h);break}case r.InSpecialComment:{this.stateInSpecialComment(h);break}case r.BeforeAttributeName:{this.stateBeforeAttributeName(h);break}case r.InTagName:{this.stateInTagName(h);break}case r.InClosingTagName:{this.stateInClosingTagName(h);break}case r.BeforeTagName:{this.stateBeforeTagName(h);break}case r.AfterAttributeName:{this.stateAfterAttributeName(h);break}case r.InAttributeValueSq:{this.stateInAttributeValueSingleQuotes(h);break}case r.BeforeAttributeValue:{this.stateBeforeAttributeValue(h);break}case r.BeforeClosingTagName:{this.stateBeforeClosingTagName(h);break}case r.AfterClosingTagName:{this.stateAfterClosingTagName(h);break}case r.BeforeSpecialS:{this.stateBeforeSpecialS(h);break}case r.InAttributeValueNq:{this.stateInAttributeValueNoQuotes(h);break}case r.InSelfClosingTag:{this.stateInSelfClosingTag(h);break}case r.InDeclaration:{this.stateInDeclaration(h);break}case r.BeforeDeclaration:{this.stateBeforeDeclaration(h);break}case r.BeforeComment:{this.stateBeforeComment(h);break}case r.InProcessingInstruction:{this.stateInProcessingInstruction(h);break}case r.InNamedEntity:{this.stateInNamedEntity(h);break}case r.BeforeEntity:{this.stateBeforeEntity(h);break}case r.InHexEntity:{this.stateInHexEntity(h);break}case r.InNumericEntity:{this.stateInNumericEntity(h);break}default:this.stateBeforeNumericEntity(h)}this.index++}this.cleanup()},p.prototype.finish=function(){this.state===r.InNamedEntity&&this.emitNamedEntity(),this.sectionStart<this.index&&this.handleTrailingData(),this.cbs.onend()},p.prototype.handleTrailingData=function(){var h=this.buffer.length+this.offset;this.state===r.InCommentLike?this.currentSequence===d.CdataEnd?this.cbs.oncdata(this.sectionStart,h,0):this.cbs.oncomment(this.sectionStart,h,0):this.state===r.InNumericEntity&&this.allowLegacyEntity()?this.emitNumericEntity(!1):this.state===r.InHexEntity&&this.allowLegacyEntity()?this.emitNumericEntity(!1):this.state===r.InTagName||this.state===r.BeforeAttributeName||this.state===r.BeforeAttributeValue||this.state===r.AfterAttributeName||this.state===r.InAttributeName||this.state===r.InAttributeValueSq||this.state===r.InAttributeValueDq||this.state===r.InAttributeValueNq||this.state===r.InClosingTagName||this.cbs.ontext(this.sectionStart,h)},p.prototype.emitPartial=function(h,m){this.baseState!==r.Text&&this.baseState!==r.InSpecialTag?this.cbs.onattribdata(h,m):this.cbs.ontext(h,m)},p.prototype.emitCodePoint=function(h){this.baseState!==r.Text&&this.baseState!==r.InSpecialTag?this.cbs.onattribentity(h):this.cbs.ontextentity(h)},p})();t.default=f})(Du)),Du}var C_;function N_(){if(C_)return Vt;C_=1;var t=Vt&&Vt.__createBinding||(Object.create?(function(w,_,k,v){v===void 0&&(v=k);var $=Object.getOwnPropertyDescriptor(_,k);(!$||("get"in $?!_.__esModule:$.writable||$.configurable))&&($={enumerable:!0,get:function(){return _[k]}}),Object.defineProperty(w,v,$)}):(function(w,_,k,v){v===void 0&&(v=k),w[v]=_[k]})),e=Vt&&Vt.__setModuleDefault||(Object.create?(function(w,_){Object.defineProperty(w,"default",{enumerable:!0,value:_})}):function(w,_){w.default=_}),n=Vt&&Vt.__importStar||function(w){if(w&&w.__esModule)return w;var _={};if(w!=null)for(var k in w)k!=="default"&&Object.prototype.hasOwnProperty.call(w,k)&&t(_,w,k);return e(_,w),_};Object.defineProperty(Vt,"__esModule",{value:!0}),Vt.Parser=void 0;var r=n(Nv()),i=Hc(),s=new Set(["input","option","optgroup","select","button","datalist","textarea"]),a=new Set(["p"]),c=new Set(["thead","tbody"]),l=new Set(["dd","dt"]),u=new Set(["rt","rp"]),d=new Map([["tr",new Set(["tr","th","td"])],["th",new Set(["th"])],["td",new Set(["thead","th","td"])],["body",new Set(["head","link","script"])],["li",new Set(["li"])],["p",a],["h1",a],["h2",a],["h3",a],["h4",a],["h5",a],["h6",a],["select",s],["input",s],["output",s],["button",s],["datalist",s],["textarea",s],["option",new Set(["option"])],["optgroup",new Set(["optgroup","option"])],["dd",l],["dt",l],["address",a],["article",a],["aside",a],["blockquote",a],["details",a],["div",a],["dl",a],["fieldset",a],["figcaption",a],["figure",a],["footer",a],["form",a],["header",a],["hr",a],["main",a],["nav",a],["ol",a],["pre",a],["section",a],["table",a],["ul",a],["rt",u],["rp",u],["tbody",c],["tfoot",c]]),f=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]),p=new Set(["math","svg"]),h=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignobject","desc","title"]),m=/\s|\//,y=(function(){function w(_,k){k===void 0&&(k={});var v,$,b,z,A;this.options=k,this.startIndex=0,this.endIndex=0,this.openTagStart=0,this.tagname="",this.attribname="",this.attribvalue="",this.attribs=null,this.stack=[],this.foreignContext=[],this.buffers=[],this.bufferOffset=0,this.writeIndex=0,this.ended=!1,this.cbs=_??{},this.lowerCaseTagNames=(v=k.lowerCaseTags)!==null&&v!==void 0?v:!k.xmlMode,this.lowerCaseAttributeNames=($=k.lowerCaseAttributeNames)!==null&&$!==void 0?$:!k.xmlMode,this.tokenizer=new((b=k.Tokenizer)!==null&&b!==void 0?b:r.default)(this.options,this),(A=(z=this.cbs).onparserinit)===null||A===void 0||A.call(z,this)}return w.prototype.ontext=function(_,k){var v,$,b=this.getSlice(_,k);this.endIndex=k-1,($=(v=this.cbs).ontext)===null||$===void 0||$.call(v,b),this.startIndex=k},w.prototype.ontextentity=function(_){var k,v,$=this.tokenizer.getSectionStart();this.endIndex=$-1,(v=(k=this.cbs).ontext)===null||v===void 0||v.call(k,(0,i.fromCodePoint)(_)),this.startIndex=$},w.prototype.isVoidElement=function(_){return!this.options.xmlMode&&f.has(_)},w.prototype.onopentagname=function(_,k){this.endIndex=k;var v=this.getSlice(_,k);this.lowerCaseTagNames&&(v=v.toLowerCase()),this.emitOpenTag(v)},w.prototype.emitOpenTag=function(_){var k,v,$,b;this.openTagStart=this.startIndex,this.tagname=_;var z=!this.options.xmlMode&&d.get(_);if(z)for(;this.stack.length>0&&z.has(this.stack[this.stack.length-1]);){var A=this.stack.pop();(v=(k=this.cbs).onclosetag)===null||v===void 0||v.call(k,A,!0)}this.isVoidElement(_)||(this.stack.push(_),p.has(_)?this.foreignContext.push(!0):h.has(_)&&this.foreignContext.push(!1)),(b=($=this.cbs).onopentagname)===null||b===void 0||b.call($,_),this.cbs.onopentag&&(this.attribs={})},w.prototype.endOpenTag=function(_){var k,v;this.startIndex=this.openTagStart,this.attribs&&((v=(k=this.cbs).onopentag)===null||v===void 0||v.call(k,this.tagname,this.attribs,_),this.attribs=null),this.cbs.onclosetag&&this.isVoidElement(this.tagname)&&this.cbs.onclosetag(this.tagname,!0),this.tagname=""},w.prototype.onopentagend=function(_){this.endIndex=_,this.endOpenTag(!1),this.startIndex=_+1},w.prototype.onclosetag=function(_,k){var v,$,b,z,A,N;this.endIndex=k;var O=this.getSlice(_,k);if(this.lowerCaseTagNames&&(O=O.toLowerCase()),(p.has(O)||h.has(O))&&this.foreignContext.pop(),this.isVoidElement(O))!this.options.xmlMode&&O==="br"&&(($=(v=this.cbs).onopentagname)===null||$===void 0||$.call(v,"br"),(z=(b=this.cbs).onopentag)===null||z===void 0||z.call(b,"br",{},!0),(N=(A=this.cbs).onclosetag)===null||N===void 0||N.call(A,"br",!1));else{var L=this.stack.lastIndexOf(O);if(L!==-1)if(this.cbs.onclosetag)for(var C=this.stack.length-L;C--;)this.cbs.onclosetag(this.stack.pop(),C!==0);else this.stack.length=L;else!this.options.xmlMode&&O==="p"&&(this.emitOpenTag("p"),this.closeCurrentTag(!0))}this.startIndex=k+1},w.prototype.onselfclosingtag=function(_){this.endIndex=_,this.options.xmlMode||this.options.recognizeSelfClosing||this.foreignContext[this.foreignContext.length-1]?(this.closeCurrentTag(!1),this.startIndex=_+1):this.onopentagend(_)},w.prototype.closeCurrentTag=function(_){var k,v,$=this.tagname;this.endOpenTag(_),this.stack[this.stack.length-1]===$&&((v=(k=this.cbs).onclosetag)===null||v===void 0||v.call(k,$,!_),this.stack.pop())},w.prototype.onattribname=function(_,k){this.startIndex=_;var v=this.getSlice(_,k);this.attribname=this.lowerCaseAttributeNames?v.toLowerCase():v},w.prototype.onattribdata=function(_,k){this.attribvalue+=this.getSlice(_,k)},w.prototype.onattribentity=function(_){this.attribvalue+=(0,i.fromCodePoint)(_)},w.prototype.onattribend=function(_,k){var v,$;this.endIndex=k,($=(v=this.cbs).onattribute)===null||$===void 0||$.call(v,this.attribname,this.attribvalue,_===r.QuoteType.Double?'"':_===r.QuoteType.Single?"'":_===r.QuoteType.NoValue?void 0:null),this.attribs&&!Object.prototype.hasOwnProperty.call(this.attribs,this.attribname)&&(this.attribs[this.attribname]=this.attribvalue),this.attribvalue=""},w.prototype.getInstructionName=function(_){var k=_.search(m),v=k<0?_:_.substr(0,k);return this.lowerCaseTagNames&&(v=v.toLowerCase()),v},w.prototype.ondeclaration=function(_,k){this.endIndex=k;var v=this.getSlice(_,k);if(this.cbs.onprocessinginstruction){var $=this.getInstructionName(v);this.cbs.onprocessinginstruction("!".concat($),"!".concat(v))}this.startIndex=k+1},w.prototype.onprocessinginstruction=function(_,k){this.endIndex=k;var v=this.getSlice(_,k);if(this.cbs.onprocessinginstruction){var $=this.getInstructionName(v);this.cbs.onprocessinginstruction("?".concat($),"?".concat(v))}this.startIndex=k+1},w.prototype.oncomment=function(_,k,v){var $,b,z,A;this.endIndex=k,(b=($=this.cbs).oncomment)===null||b===void 0||b.call($,this.getSlice(_,k-v)),(A=(z=this.cbs).oncommentend)===null||A===void 0||A.call(z),this.startIndex=k+1},w.prototype.oncdata=function(_,k,v){var $,b,z,A,N,O,L,C,P,M;this.endIndex=k;var K=this.getSlice(_,k-v);this.options.xmlMode||this.options.recognizeCDATA?((b=($=this.cbs).oncdatastart)===null||b===void 0||b.call($),(A=(z=this.cbs).ontext)===null||A===void 0||A.call(z,K),(O=(N=this.cbs).oncdataend)===null||O===void 0||O.call(N)):((C=(L=this.cbs).oncomment)===null||C===void 0||C.call(L,"[CDATA[".concat(K,"]]")),(M=(P=this.cbs).oncommentend)===null||M===void 0||M.call(P)),this.startIndex=k+1},w.prototype.onend=function(){var _,k;if(this.cbs.onclosetag){this.endIndex=this.startIndex;for(var v=this.stack.length;v>0;this.cbs.onclosetag(this.stack[--v],!0));}(k=(_=this.cbs).onend)===null||k===void 0||k.call(_)},w.prototype.reset=function(){var _,k,v,$;(k=(_=this.cbs).onreset)===null||k===void 0||k.call(_),this.tokenizer.reset(),this.tagname="",this.attribname="",this.attribs=null,this.stack.length=0,this.startIndex=0,this.endIndex=0,($=(v=this.cbs).onparserinit)===null||$===void 0||$.call(v,this),this.buffers.length=0,this.bufferOffset=0,this.writeIndex=0,this.ended=!1},w.prototype.parseComplete=function(_){this.reset(),this.end(_)},w.prototype.getSlice=function(_,k){for(;_-this.bufferOffset>=this.buffers[0].length;)this.shiftBuffer();for(var v=this.buffers[0].slice(_-this.bufferOffset,k-this.bufferOffset);k-this.bufferOffset>this.buffers[0].length;)this.shiftBuffer(),v+=this.buffers[0].slice(0,k-this.bufferOffset);return v},w.prototype.shiftBuffer=function(){this.bufferOffset+=this.buffers[0].length,this.writeIndex--,this.buffers.shift()},w.prototype.write=function(_){var k,v;if(this.ended){(v=(k=this.cbs).onerror)===null||v===void 0||v.call(k,new Error(".write() after done!"));return}this.buffers.push(_),this.tokenizer.running&&(this.tokenizer.write(_),this.writeIndex++)},w.prototype.end=function(_){var k,v;if(this.ended){(v=(k=this.cbs).onerror)===null||v===void 0||v.call(k,new Error(".end() after done!"));return}_&&this.write(_),this.ended=!0,this.tokenizer.end()},w.prototype.pause=function(){this.tokenizer.pause()},w.prototype.resume=function(){for(this.tokenizer.resume();this.tokenizer.running&&this.writeIndex<this.buffers.length;)this.tokenizer.write(this.buffers[this.writeIndex++]);this.ended&&this.tokenizer.end()},w.prototype.parseChunk=function(_){this.write(_)},w.prototype.done=function(_){this.end(_)},w})();return Vt.Parser=y,Vt}var vr={},Mu={},I_;function Qs(){return I_||(I_=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Doctype=t.CDATA=t.Tag=t.Style=t.Script=t.Comment=t.Directive=t.Text=t.Root=t.isTag=t.ElementType=void 0;var e;(function(r){r.Root="root",r.Text="text",r.Directive="directive",r.Comment="comment",r.Script="script",r.Style="style",r.Tag="tag",r.CDATA="cdata",r.Doctype="doctype"})(e=t.ElementType||(t.ElementType={}));function n(r){return r.type===e.Tag||r.type===e.Script||r.type===e.Style}t.isTag=n,t.Root=e.Root,t.Text=e.Text,t.Directive=e.Directive,t.Comment=e.Comment,t.Script=e.Script,t.Style=e.Style,t.Tag=e.Tag,t.CDATA=e.CDATA,t.Doctype=e.Doctype})(Mu)),Mu}var _e={},j_;function T_(){if(j_)return _e;j_=1;var t=_e&&_e.__extends||(function(){var b=function(z,A){return b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(N,O){N.__proto__=O}||function(N,O){for(var L in O)Object.prototype.hasOwnProperty.call(O,L)&&(N[L]=O[L])},b(z,A)};return function(z,A){if(typeof A!="function"&&A!==null)throw new TypeError("Class extends value "+String(A)+" is not a constructor or null");b(z,A);function N(){this.constructor=z}z.prototype=A===null?Object.create(A):(N.prototype=A.prototype,new N)}})(),e=_e&&_e.__assign||function(){return e=Object.assign||function(b){for(var z,A=1,N=arguments.length;A<N;A++){z=arguments[A];for(var O in z)Object.prototype.hasOwnProperty.call(z,O)&&(b[O]=z[O])}return b},e.apply(this,arguments)};Object.defineProperty(_e,"__esModule",{value:!0}),_e.cloneNode=_e.hasChildren=_e.isDocument=_e.isDirective=_e.isComment=_e.isText=_e.isCDATA=_e.isTag=_e.Element=_e.Document=_e.CDATA=_e.NodeWithChildren=_e.ProcessingInstruction=_e.Comment=_e.Text=_e.DataNode=_e.Node=void 0;var n=Qs(),r=(function(){function b(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(b.prototype,"parentNode",{get:function(){return this.parent},set:function(z){this.parent=z},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"previousSibling",{get:function(){return this.prev},set:function(z){this.prev=z},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"nextSibling",{get:function(){return this.next},set:function(z){this.next=z},enumerable:!1,configurable:!0}),b.prototype.cloneNode=function(z){return z===void 0&&(z=!1),v(this,z)},b})();_e.Node=r;var i=(function(b){t(z,b);function z(A){var N=b.call(this)||this;return N.data=A,N}return Object.defineProperty(z.prototype,"nodeValue",{get:function(){return this.data},set:function(A){this.data=A},enumerable:!1,configurable:!0}),z})(r);_e.DataNode=i;var s=(function(b){t(z,b);function z(){var A=b!==null&&b.apply(this,arguments)||this;return A.type=n.ElementType.Text,A}return Object.defineProperty(z.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),z})(i);_e.Text=s;var a=(function(b){t(z,b);function z(){var A=b!==null&&b.apply(this,arguments)||this;return A.type=n.ElementType.Comment,A}return Object.defineProperty(z.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),z})(i);_e.Comment=a;var c=(function(b){t(z,b);function z(A,N){var O=b.call(this,N)||this;return O.name=A,O.type=n.ElementType.Directive,O}return Object.defineProperty(z.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),z})(i);_e.ProcessingInstruction=c;var l=(function(b){t(z,b);function z(A){var N=b.call(this)||this;return N.children=A,N}return Object.defineProperty(z.prototype,"firstChild",{get:function(){var A;return(A=this.children[0])!==null&&A!==void 0?A:null},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"childNodes",{get:function(){return this.children},set:function(A){this.children=A},enumerable:!1,configurable:!0}),z})(r);_e.NodeWithChildren=l;var u=(function(b){t(z,b);function z(){var A=b!==null&&b.apply(this,arguments)||this;return A.type=n.ElementType.CDATA,A}return Object.defineProperty(z.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),z})(l);_e.CDATA=u;var d=(function(b){t(z,b);function z(){var A=b!==null&&b.apply(this,arguments)||this;return A.type=n.ElementType.Root,A}return Object.defineProperty(z.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),z})(l);_e.Document=d;var f=(function(b){t(z,b);function z(A,N,O,L){O===void 0&&(O=[]),L===void 0&&(L=A==="script"?n.ElementType.Script:A==="style"?n.ElementType.Style:n.ElementType.Tag);var C=b.call(this,O)||this;return C.name=A,C.attribs=N,C.type=L,C}return Object.defineProperty(z.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"tagName",{get:function(){return this.name},set:function(A){this.name=A},enumerable:!1,configurable:!0}),Object.defineProperty(z.prototype,"attributes",{get:function(){var A=this;return Object.keys(this.attribs).map(function(N){var O,L;return{name:N,value:A.attribs[N],namespace:(O=A["x-attribsNamespace"])===null||O===void 0?void 0:O[N],prefix:(L=A["x-attribsPrefix"])===null||L===void 0?void 0:L[N]}})},enumerable:!1,configurable:!0}),z})(l);_e.Element=f;function p(b){return(0,n.isTag)(b)}_e.isTag=p;function h(b){return b.type===n.ElementType.CDATA}_e.isCDATA=h;function m(b){return b.type===n.ElementType.Text}_e.isText=m;function y(b){return b.type===n.ElementType.Comment}_e.isComment=y;function w(b){return b.type===n.ElementType.Directive}_e.isDirective=w;function _(b){return b.type===n.ElementType.Root}_e.isDocument=_;function k(b){return Object.prototype.hasOwnProperty.call(b,"children")}_e.hasChildren=k;function v(b,z){z===void 0&&(z=!1);var A;if(m(b))A=new s(b.data);else if(y(b))A=new a(b.data);else if(p(b)){var N=z?$(b.children):[],O=new f(b.name,e({},b.attribs),N);N.forEach(function(M){return M.parent=O}),b.namespace!=null&&(O.namespace=b.namespace),b["x-attribsNamespace"]&&(O["x-attribsNamespace"]=e({},b["x-attribsNamespace"])),b["x-attribsPrefix"]&&(O["x-attribsPrefix"]=e({},b["x-attribsPrefix"])),A=O}else if(h(b)){var N=z?$(b.children):[],L=new u(N);N.forEach(function(K){return K.parent=L}),A=L}else if(_(b)){var N=z?$(b.children):[],C=new d(N);N.forEach(function(K){return K.parent=C}),b["x-mode"]&&(C["x-mode"]=b["x-mode"]),A=C}else if(w(b)){var P=new c(b.name,b.data);b["x-name"]!=null&&(P["x-name"]=b["x-name"],P["x-publicId"]=b["x-publicId"],P["x-systemId"]=b["x-systemId"]),A=P}else throw new Error("Not implemented yet: ".concat(b.type));return A.startIndex=b.startIndex,A.endIndex=b.endIndex,b.sourceCodeLocation!=null&&(A.sourceCodeLocation=b.sourceCodeLocation),A}_e.cloneNode=v;function $(b){for(var z=b.map(function(N){return v(N,!0)}),A=1;A<z.length;A++)z[A].prev=z[A-1],z[A-1].next=z[A];return z}return _e}var O_;function hr(){return O_||(O_=1,(function(t){var e=vr&&vr.__createBinding||(Object.create?(function(c,l,u,d){d===void 0&&(d=u);var f=Object.getOwnPropertyDescriptor(l,u);(!f||("get"in f?!l.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return l[u]}}),Object.defineProperty(c,d,f)}):(function(c,l,u,d){d===void 0&&(d=u),c[d]=l[u]})),n=vr&&vr.__exportStar||function(c,l){for(var u in c)u!=="default"&&!Object.prototype.hasOwnProperty.call(l,u)&&e(l,c,u)};Object.defineProperty(t,"__esModule",{value:!0}),t.DomHandler=void 0;var r=Qs(),i=T_();n(T_(),t);var s={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},a=(function(){function c(l,u,d){this.dom=[],this.root=new i.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof u=="function"&&(d=u,u=s),typeof l=="object"&&(u=l,l=void 0),this.callback=l??null,this.options=u??s,this.elementCB=d??null}return c.prototype.onparserinit=function(l){this.parser=l},c.prototype.onreset=function(){this.dom=[],this.root=new i.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},c.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},c.prototype.onerror=function(l){this.handleCallback(l)},c.prototype.onclosetag=function(){this.lastNode=null;var l=this.tagStack.pop();this.options.withEndIndices&&(l.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(l)},c.prototype.onopentag=function(l,u){var d=this.options.xmlMode?r.ElementType.Tag:void 0,f=new i.Element(l,u,void 0,d);this.addNode(f),this.tagStack.push(f)},c.prototype.ontext=function(l){var u=this.lastNode;if(u&&u.type===r.ElementType.Text)u.data+=l,this.options.withEndIndices&&(u.endIndex=this.parser.endIndex);else{var d=new i.Text(l);this.addNode(d),this.lastNode=d}},c.prototype.oncomment=function(l){if(this.lastNode&&this.lastNode.type===r.ElementType.Comment){this.lastNode.data+=l;return}var u=new i.Comment(l);this.addNode(u),this.lastNode=u},c.prototype.oncommentend=function(){this.lastNode=null},c.prototype.oncdatastart=function(){var l=new i.Text(""),u=new i.CDATA([l]);this.addNode(u),l.parent=u,this.lastNode=l},c.prototype.oncdataend=function(){this.lastNode=null},c.prototype.onprocessinginstruction=function(l,u){var d=new i.ProcessingInstruction(l,u);this.addNode(d)},c.prototype.handleCallback=function(l){if(typeof this.callback=="function")this.callback(l,this.dom);else if(l)throw l},c.prototype.addNode=function(l){var u=this.tagStack[this.tagStack.length-1],d=u.children[u.children.length-1];this.options.withStartIndices&&(l.startIndex=this.parser.startIndex),this.options.withEndIndices&&(l.endIndex=this.parser.endIndex),u.children.push(l),d&&(l.prev=d,d.next=l),l.parent=u,this.lastNode=null},c})();t.DomHandler=a,t.default=a})(vr)),vr}var xr={},fn={},bt={},qu={},In={},fa={},P_;function wA(){if(P_)return fa;P_=1,Object.defineProperty(fa,"__esModule",{value:!0});function t(e){for(var n=1;n<e.length;n++)e[n][0]+=e[n-1][0]+1;return e}return fa.default=new Map(t([[9,"	"],[0,"
"],[22,"!"],[0,"""],[0,"#"],[0,"$"],[0,"%"],[0,"&"],[0,"'"],[0,"("],[0,")"],[0,"*"],[0,"+"],[0,","],[1,"."],[0,"/"],[10,":"],[0,";"],[0,{v:"<",n:8402,o:"<⃒"}],[0,{v:"=",n:8421,o:"=⃥"}],[0,{v:">",n:8402,o:">⃒"}],[0,"?"],[0,"@"],[26,"["],[0,"\"],[0,"]"],[0,"^"],[0,"_"],[0,"`"],[5,{n:106,o:"fj"}],[20,"{"],[0,"|"],[0,"}"],[34," "],[0,"¡"],[0,"¢"],[0,"£"],[0,"¤"],[0,"¥"],[0,"¦"],[0,"§"],[0,"¨"],[0,"©"],[0,"ª"],[0,"«"],[0,"¬"],[0,"­"],[0,"®"],[0,"¯"],[0,"°"],[0,"±"],[0,"²"],[0,"³"],[0,"´"],[0,"µ"],[0,"¶"],[0,"·"],[0,"¸"],[0,"¹"],[0,"º"],[0,"»"],[0,"¼"],[0,"½"],[0,"¾"],[0,"¿"],[0,"À"],[0,"Á"],[0,"Â"],[0,"Ã"],[0,"Ä"],[0,"Å"],[0,"Æ"],[0,"Ç"],[0,"È"],[0,"É"],[0,"Ê"],[0,"Ë"],[0,"Ì"],[0,"Í"],[0,"Î"],[0,"Ï"],[0,"Ð"],[0,"Ñ"],[0,"Ò"],[0,"Ó"],[0,"Ô"],[0,"Õ"],[0,"Ö"],[0,"×"],[0,"Ø"],[0,"Ù"],[0,"Ú"],[0,"Û"],[0,"Ü"],[0,"Ý"],[0,"Þ"],[0,"ß"],[0,"à"],[0,"á"],[0,"â"],[0,"ã"],[0,"ä"],[0,"å"],[0,"æ"],[0,"ç"],[0,"è"],[0,"é"],[0,"ê"],[0,"ë"],[0,"ì"],[0,"í"],[0,"î"],[0,"ï"],[0,"ð"],[0,"ñ"],[0,"ò"],[0,"ó"],[0,"ô"],[0,"õ"],[0,"ö"],[0,"÷"],[0,"ø"],[0,"ù"],[0,"ú"],[0,"û"],[0,"ü"],[0,"ý"],[0,"þ"],[0,"ÿ"],[0,"Ā"],[0,"ā"],[0,"Ă"],[0,"ă"],[0,"Ą"],[0,"ą"],[0,"Ć"],[0,"ć"],[0,"Ĉ"],[0,"ĉ"],[0,"Ċ"],[0,"ċ"],[0,"Č"],[0,"č"],[0,"Ď"],[0,"ď"],[0,"Đ"],[0,"đ"],[0,"Ē"],[0,"ē"],[2,"Ė"],[0,"ė"],[0,"Ę"],[0,"ę"],[0,"Ě"],[0,"ě"],[0,"Ĝ"],[0,"ĝ"],[0,"Ğ"],[0,"ğ"],[0,"Ġ"],[0,"ġ"],[0,"Ģ"],[1,"Ĥ"],[0,"ĥ"],[0,"Ħ"],[0,"ħ"],[0,"Ĩ"],[0,"ĩ"],[0,"Ī"],[0,"ī"],[2,"Į"],[0,"į"],[0,"İ"],[0,"ı"],[0,"IJ"],[0,"ij"],[0,"Ĵ"],[0,"ĵ"],[0,"Ķ"],[0,"ķ"],[0,"ĸ"],[0,"Ĺ"],[0,"ĺ"],[0,"Ļ"],[0,"ļ"],[0,"Ľ"],[0,"ľ"],[0,"Ŀ"],[0,"ŀ"],[0,"Ł"],[0,"ł"],[0,"Ń"],[0,"ń"],[0,"Ņ"],[0,"ņ"],[0,"Ň"],[0,"ň"],[0,"ʼn"],[0,"Ŋ"],[0,"ŋ"],[0,"Ō"],[0,"ō"],[2,"Ő"],[0,"ő"],[0,"Œ"],[0,"œ"],[0,"Ŕ"],[0,"ŕ"],[0,"Ŗ"],[0,"ŗ"],[0,"Ř"],[0,"ř"],[0,"Ś"],[0,"ś"],[0,"Ŝ"],[0,"ŝ"],[0,"Ş"],[0,"ş"],[0,"Š"],[0,"š"],[0,"Ţ"],[0,"ţ"],[0,"Ť"],[0,"ť"],[0,"Ŧ"],[0,"ŧ"],[0,"Ũ"],[0,"ũ"],[0,"Ū"],[0,"ū"],[0,"Ŭ"],[0,"ŭ"],[0,"Ů"],[0,"ů"],[0,"Ű"],[0,"ű"],[0,"Ų"],[0,"ų"],[0,"Ŵ"],[0,"ŵ"],[0,"Ŷ"],[0,"ŷ"],[0,"Ÿ"],[0,"Ź"],[0,"ź"],[0,"Ż"],[0,"ż"],[0,"Ž"],[0,"ž"],[19,"ƒ"],[34,"Ƶ"],[63,"ǵ"],[65,"ȷ"],[142,"ˆ"],[0,"ˇ"],[16,"˘"],[0,"˙"],[0,"˚"],[0,"˛"],[0,"˜"],[0,"˝"],[51,"̑"],[127,"Α"],[0,"Β"],[0,"Γ"],[0,"Δ"],[0,"Ε"],[0,"Ζ"],[0,"Η"],[0,"Θ"],[0,"Ι"],[0,"Κ"],[0,"Λ"],[0,"Μ"],[0,"Ν"],[0,"Ξ"],[0,"Ο"],[0,"Π"],[0,"Ρ"],[1,"Σ"],[0,"Τ"],[0,"Υ"],[0,"Φ"],[0,"Χ"],[0,"Ψ"],[0,"Ω"],[7,"α"],[0,"β"],[0,"γ"],[0,"δ"],[0,"ε"],[0,"ζ"],[0,"η"],[0,"θ"],[0,"ι"],[0,"κ"],[0,"λ"],[0,"μ"],[0,"ν"],[0,"ξ"],[0,"ο"],[0,"π"],[0,"ρ"],[0,"ς"],[0,"σ"],[0,"τ"],[0,"υ"],[0,"φ"],[0,"χ"],[0,"ψ"],[0,"ω"],[7,"ϑ"],[0,"ϒ"],[2,"ϕ"],[0,"ϖ"],[5,"Ϝ"],[0,"ϝ"],[18,"ϰ"],[0,"ϱ"],[3,"ϵ"],[0,"϶"],[10,"Ё"],[0,"Ђ"],[0,"Ѓ"],[0,"Є"],[0,"Ѕ"],[0,"І"],[0,"Ї"],[0,"Ј"],[0,"Љ"],[0,"Њ"],[0,"Ћ"],[0,"Ќ"],[1,"Ў"],[0,"Џ"],[0,"А"],[0,"Б"],[0,"В"],[0,"Г"],[0,"Д"],[0,"Е"],[0,"Ж"],[0,"З"],[0,"И"],[0,"Й"],[0,"К"],[0,"Л"],[0,"М"],[0,"Н"],[0,"О"],[0,"П"],[0,"Р"],[0,"С"],[0,"Т"],[0,"У"],[0,"Ф"],[0,"Х"],[0,"Ц"],[0,"Ч"],[0,"Ш"],[0,"Щ"],[0,"Ъ"],[0,"Ы"],[0,"Ь"],[0,"Э"],[0,"Ю"],[0,"Я"],[0,"а"],[0,"б"],[0,"в"],[0,"г"],[0,"д"],[0,"е"],[0,"ж"],[0,"з"],[0,"и"],[0,"й"],[0,"к"],[0,"л"],[0,"м"],[0,"н"],[0,"о"],[0,"п"],[0,"р"],[0,"с"],[0,"т"],[0,"у"],[0,"ф"],[0,"х"],[0,"ц"],[0,"ч"],[0,"ш"],[0,"щ"],[0,"ъ"],[0,"ы"],[0,"ь"],[0,"э"],[0,"ю"],[0,"я"],[1,"ё"],[0,"ђ"],[0,"ѓ"],[0,"є"],[0,"ѕ"],[0,"і"],[0,"ї"],[0,"ј"],[0,"љ"],[0,"њ"],[0,"ћ"],[0,"ќ"],[1,"ў"],[0,"џ"],[7074," "],[0," "],[0," "],[0," "],[1," "],[0," "],[0," "],[0," "],[0,"​"],[0,"‌"],[0,"‍"],[0,"‎"],[0,"‏"],[0,"‐"],[2,"–"],[0,"—"],[0,"―"],[0,"‖"],[1,"‘"],[0,"’"],[0,"‚"],[1,"“"],[0,"”"],[0,"„"],[1,"†"],[0,"‡"],[0,"•"],[2,"‥"],[0,"…"],[9,"‰"],[0,"‱"],[0,"′"],[0,"″"],[0,"‴"],[0,"‵"],[3,"‹"],[0,"›"],[3,"‾"],[2,"⁁"],[1,"⁃"],[0,"⁄"],[10,"⁏"],[7,"⁗"],[7,{v:" ",n:8202,o:"  "}],[0,"⁠"],[0,"⁡"],[0,"⁢"],[0,"⁣"],[72,"€"],[46,"⃛"],[0,"⃜"],[37,"ℂ"],[2,"℅"],[4,"ℊ"],[0,"ℋ"],[0,"ℌ"],[0,"ℍ"],[0,"ℎ"],[0,"ℏ"],[0,"ℐ"],[0,"ℑ"],[0,"ℒ"],[0,"ℓ"],[1,"ℕ"],[0,"№"],[0,"℗"],[0,"℘"],[0,"ℙ"],[0,"ℚ"],[0,"ℛ"],[0,"ℜ"],[0,"ℝ"],[0,"℞"],[3,"™"],[1,"ℤ"],[2,"℧"],[0,"ℨ"],[0,"℩"],[2,"ℬ"],[0,"ℭ"],[1,"ℯ"],[0,"ℰ"],[0,"ℱ"],[1,"ℳ"],[0,"ℴ"],[0,"ℵ"],[0,"ℶ"],[0,"ℷ"],[0,"ℸ"],[12,"ⅅ"],[0,"ⅆ"],[0,"ⅇ"],[0,"ⅈ"],[10,"⅓"],[0,"⅔"],[0,"⅕"],[0,"⅖"],[0,"⅗"],[0,"⅘"],[0,"⅙"],[0,"⅚"],[0,"⅛"],[0,"⅜"],[0,"⅝"],[0,"⅞"],[49,"←"],[0,"↑"],[0,"→"],[0,"↓"],[0,"↔"],[0,"↕"],[0,"↖"],[0,"↗"],[0,"↘"],[0,"↙"],[0,"↚"],[0,"↛"],[1,{v:"↝",n:824,o:"↝̸"}],[0,"↞"],[0,"↟"],[0,"↠"],[0,"↡"],[0,"↢"],[0,"↣"],[0,"↤"],[0,"↥"],[0,"↦"],[0,"↧"],[1,"↩"],[0,"↪"],[0,"↫"],[0,"↬"],[0,"↭"],[0,"↮"],[1,"↰"],[0,"↱"],[0,"↲"],[0,"↳"],[1,"↵"],[0,"↶"],[0,"↷"],[2,"↺"],[0,"↻"],[0,"↼"],[0,"↽"],[0,"↾"],[0,"↿"],[0,"⇀"],[0,"⇁"],[0,"⇂"],[0,"⇃"],[0,"⇄"],[0,"⇅"],[0,"⇆"],[0,"⇇"],[0,"⇈"],[0,"⇉"],[0,"⇊"],[0,"⇋"],[0,"⇌"],[0,"⇍"],[0,"⇎"],[0,"⇏"],[0,"⇐"],[0,"⇑"],[0,"⇒"],[0,"⇓"],[0,"⇔"],[0,"⇕"],[0,"⇖"],[0,"⇗"],[0,"⇘"],[0,"⇙"],[0,"⇚"],[0,"⇛"],[1,"⇝"],[6,"⇤"],[0,"⇥"],[15,"⇵"],[7,"⇽"],[0,"⇾"],[0,"⇿"],[0,"∀"],[0,"∁"],[0,{v:"∂",n:824,o:"∂̸"}],[0,"∃"],[0,"∄"],[0,"∅"],[1,"∇"],[0,"∈"],[0,"∉"],[1,"∋"],[0,"∌"],[2,"∏"],[0,"∐"],[0,"∑"],[0,"−"],[0,"∓"],[0,"∔"],[1,"∖"],[0,"∗"],[0,"∘"],[1,"√"],[2,"∝"],[0,"∞"],[0,"∟"],[0,{v:"∠",n:8402,o:"∠⃒"}],[0,"∡"],[0,"∢"],[0,"∣"],[0,"∤"],[0,"∥"],[0,"∦"],[0,"∧"],[0,"∨"],[0,{v:"∩",n:65024,o:"∩︀"}],[0,{v:"∪",n:65024,o:"∪︀"}],[0,"∫"],[0,"∬"],[0,"∭"],[0,"∮"],[0,"∯"],[0,"∰"],[0,"∱"],[0,"∲"],[0,"∳"],[0,"∴"],[0,"∵"],[0,"∶"],[0,"∷"],[0,"∸"],[1,"∺"],[0,"∻"],[0,{v:"∼",n:8402,o:"∼⃒"}],[0,{v:"∽",n:817,o:"∽̱"}],[0,{v:"∾",n:819,o:"∾̳"}],[0,"∿"],[0,"≀"],[0,"≁"],[0,{v:"≂",n:824,o:"≂̸"}],[0,"≃"],[0,"≄"],[0,"≅"],[0,"≆"],[0,"≇"],[0,"≈"],[0,"≉"],[0,"≊"],[0,{v:"≋",n:824,o:"≋̸"}],[0,"≌"],[0,{v:"≍",n:8402,o:"≍⃒"}],[0,{v:"≎",n:824,o:"≎̸"}],[0,{v:"≏",n:824,o:"≏̸"}],[0,{v:"≐",n:824,o:"≐̸"}],[0,"≑"],[0,"≒"],[0,"≓"],[0,"≔"],[0,"≕"],[0,"≖"],[0,"≗"],[1,"≙"],[0,"≚"],[1,"≜"],[2,"≟"],[0,"≠"],[0,{v:"≡",n:8421,o:"≡⃥"}],[0,"≢"],[1,{v:"≤",n:8402,o:"≤⃒"}],[0,{v:"≥",n:8402,o:"≥⃒"}],[0,{v:"≦",n:824,o:"≦̸"}],[0,{v:"≧",n:824,o:"≧̸"}],[0,{v:"≨",n:65024,o:"≨︀"}],[0,{v:"≩",n:65024,o:"≩︀"}],[0,{v:"≪",n:new Map(t([[824,"≪̸"],[7577,"≪⃒"]]))}],[0,{v:"≫",n:new Map(t([[824,"≫̸"],[7577,"≫⃒"]]))}],[0,"≬"],[0,"≭"],[0,"≮"],[0,"≯"],[0,"≰"],[0,"≱"],[0,"≲"],[0,"≳"],[0,"≴"],[0,"≵"],[0,"≶"],[0,"≷"],[0,"≸"],[0,"≹"],[0,"≺"],[0,"≻"],[0,"≼"],[0,"≽"],[0,"≾"],[0,{v:"≿",n:824,o:"≿̸"}],[0,"⊀"],[0,"⊁"],[0,{v:"⊂",n:8402,o:"⊂⃒"}],[0,{v:"⊃",n:8402,o:"⊃⃒"}],[0,"⊄"],[0,"⊅"],[0,"⊆"],[0,"⊇"],[0,"⊈"],[0,"⊉"],[0,{v:"⊊",n:65024,o:"⊊︀"}],[0,{v:"⊋",n:65024,o:"⊋︀"}],[1,"⊍"],[0,"⊎"],[0,{v:"⊏",n:824,o:"⊏̸"}],[0,{v:"⊐",n:824,o:"⊐̸"}],[0,"⊑"],[0,"⊒"],[0,{v:"⊓",n:65024,o:"⊓︀"}],[0,{v:"⊔",n:65024,o:"⊔︀"}],[0,"⊕"],[0,"⊖"],[0,"⊗"],[0,"⊘"],[0,"⊙"],[0,"⊚"],[0,"⊛"],[1,"⊝"],[0,"⊞"],[0,"⊟"],[0,"⊠"],[0,"⊡"],[0,"⊢"],[0,"⊣"],[0,"⊤"],[0,"⊥"],[1,"⊧"],[0,"⊨"],[0,"⊩"],[0,"⊪"],[0,"⊫"],[0,"⊬"],[0,"⊭"],[0,"⊮"],[0,"⊯"],[0,"⊰"],[1,"⊲"],[0,"⊳"],[0,{v:"⊴",n:8402,o:"⊴⃒"}],[0,{v:"⊵",n:8402,o:"⊵⃒"}],[0,"⊶"],[0,"⊷"],[0,"⊸"],[0,"⊹"],[0,"⊺"],[0,"⊻"],[1,"⊽"],[0,"⊾"],[0,"⊿"],[0,"⋀"],[0,"⋁"],[0,"⋂"],[0,"⋃"],[0,"⋄"],[0,"⋅"],[0,"⋆"],[0,"⋇"],[0,"⋈"],[0,"⋉"],[0,"⋊"],[0,"⋋"],[0,"⋌"],[0,"⋍"],[0,"⋎"],[0,"⋏"],[0,"⋐"],[0,"⋑"],[0,"⋒"],[0,"⋓"],[0,"⋔"],[0,"⋕"],[0,"⋖"],[0,"⋗"],[0,{v:"⋘",n:824,o:"⋘̸"}],[0,{v:"⋙",n:824,o:"⋙̸"}],[0,{v:"⋚",n:65024,o:"⋚︀"}],[0,{v:"⋛",n:65024,o:"⋛︀"}],[2,"⋞"],[0,"⋟"],[0,"⋠"],[0,"⋡"],[0,"⋢"],[0,"⋣"],[2,"⋦"],[0,"⋧"],[0,"⋨"],[0,"⋩"],[0,"⋪"],[0,"⋫"],[0,"⋬"],[0,"⋭"],[0,"⋮"],[0,"⋯"],[0,"⋰"],[0,"⋱"],[0,"⋲"],[0,"⋳"],[0,"⋴"],[0,{v:"⋵",n:824,o:"⋵̸"}],[0,"⋶"],[0,"⋷"],[1,{v:"⋹",n:824,o:"⋹̸"}],[0,"⋺"],[0,"⋻"],[0,"⋼"],[0,"⋽"],[0,"⋾"],[6,"⌅"],[0,"⌆"],[1,"⌈"],[0,"⌉"],[0,"⌊"],[0,"⌋"],[0,"⌌"],[0,"⌍"],[0,"⌎"],[0,"⌏"],[0,"⌐"],[1,"⌒"],[0,"⌓"],[1,"⌕"],[0,"⌖"],[5,"⌜"],[0,"⌝"],[0,"⌞"],[0,"⌟"],[2,"⌢"],[0,"⌣"],[9,"⌭"],[0,"⌮"],[7,"⌶"],[6,"⌽"],[1,"⌿"],[60,"⍼"],[51,"⎰"],[0,"⎱"],[2,"⎴"],[0,"⎵"],[0,"⎶"],[37,"⏜"],[0,"⏝"],[0,"⏞"],[0,"⏟"],[2,"⏢"],[4,"⏧"],[59,"␣"],[164,"Ⓢ"],[55,"─"],[1,"│"],[9,"┌"],[3,"┐"],[3,"└"],[3,"┘"],[3,"├"],[7,"┤"],[7,"┬"],[7,"┴"],[7,"┼"],[19,"═"],[0,"║"],[0,"╒"],[0,"╓"],[0,"╔"],[0,"╕"],[0,"╖"],[0,"╗"],[0,"╘"],[0,"╙"],[0,"╚"],[0,"╛"],[0,"╜"],[0,"╝"],[0,"╞"],[0,"╟"],[0,"╠"],[0,"╡"],[0,"╢"],[0,"╣"],[0,"╤"],[0,"╥"],[0,"╦"],[0,"╧"],[0,"╨"],[0,"╩"],[0,"╪"],[0,"╫"],[0,"╬"],[19,"▀"],[3,"▄"],[3,"█"],[8,"░"],[0,"▒"],[0,"▓"],[13,"□"],[8,"▪"],[0,"▫"],[1,"▭"],[0,"▮"],[2,"▱"],[1,"△"],[0,"▴"],[0,"▵"],[2,"▸"],[0,"▹"],[3,"▽"],[0,"▾"],[0,"▿"],[2,"◂"],[0,"◃"],[6,"◊"],[0,"○"],[32,"◬"],[2,"◯"],[8,"◸"],[0,"◹"],[0,"◺"],[0,"◻"],[0,"◼"],[8,"★"],[0,"☆"],[7,"☎"],[49,"♀"],[1,"♂"],[29,"♠"],[2,"♣"],[1,"♥"],[0,"♦"],[3,"♪"],[2,"♭"],[0,"♮"],[0,"♯"],[163,"✓"],[3,"✗"],[8,"✠"],[21,"✶"],[33,"❘"],[25,"❲"],[0,"❳"],[84,"⟈"],[0,"⟉"],[28,"⟦"],[0,"⟧"],[0,"⟨"],[0,"⟩"],[0,"⟪"],[0,"⟫"],[0,"⟬"],[0,"⟭"],[7,"⟵"],[0,"⟶"],[0,"⟷"],[0,"⟸"],[0,"⟹"],[0,"⟺"],[1,"⟼"],[2,"⟿"],[258,"⤂"],[0,"⤃"],[0,"⤄"],[0,"⤅"],[6,"⤌"],[0,"⤍"],[0,"⤎"],[0,"⤏"],[0,"⤐"],[0,"⤑"],[0,"⤒"],[0,"⤓"],[2,"⤖"],[2,"⤙"],[0,"⤚"],[0,"⤛"],[0,"⤜"],[0,"⤝"],[0,"⤞"],[0,"⤟"],[0,"⤠"],[2,"⤣"],[0,"⤤"],[0,"⤥"],[0,"⤦"],[0,"⤧"],[0,"⤨"],[0,"⤩"],[0,"⤪"],[8,{v:"⤳",n:824,o:"⤳̸"}],[1,"⤵"],[0,"⤶"],[0,"⤷"],[0,"⤸"],[0,"⤹"],[2,"⤼"],[0,"⤽"],[7,"⥅"],[2,"⥈"],[0,"⥉"],[0,"⥊"],[0,"⥋"],[2,"⥎"],[0,"⥏"],[0,"⥐"],[0,"⥑"],[0,"⥒"],[0,"⥓"],[0,"⥔"],[0,"⥕"],[0,"⥖"],[0,"⥗"],[0,"⥘"],[0,"⥙"],[0,"⥚"],[0,"⥛"],[0,"⥜"],[0,"⥝"],[0,"⥞"],[0,"⥟"],[0,"⥠"],[0,"⥡"],[0,"⥢"],[0,"⥣"],[0,"⥤"],[0,"⥥"],[0,"⥦"],[0,"⥧"],[0,"⥨"],[0,"⥩"],[0,"⥪"],[0,"⥫"],[0,"⥬"],[0,"⥭"],[0,"⥮"],[0,"⥯"],[0,"⥰"],[0,"⥱"],[0,"⥲"],[0,"⥳"],[0,"⥴"],[0,"⥵"],[0,"⥶"],[1,"⥸"],[0,"⥹"],[1,"⥻"],[0,"⥼"],[0,"⥽"],[0,"⥾"],[0,"⥿"],[5,"⦅"],[0,"⦆"],[4,"⦋"],[0,"⦌"],[0,"⦍"],[0,"⦎"],[0,"⦏"],[0,"⦐"],[0,"⦑"],[0,"⦒"],[0,"⦓"],[0,"⦔"],[0,"⦕"],[0,"⦖"],[3,"⦚"],[1,"⦜"],[0,"⦝"],[6,"⦤"],[0,"⦥"],[0,"⦦"],[0,"⦧"],[0,"⦨"],[0,"⦩"],[0,"⦪"],[0,"⦫"],[0,"⦬"],[0,"⦭"],[0,"⦮"],[0,"⦯"],[0,"⦰"],[0,"⦱"],[0,"⦲"],[0,"⦳"],[0,"⦴"],[0,"⦵"],[0,"⦶"],[0,"⦷"],[1,"⦹"],[1,"⦻"],[0,"⦼"],[1,"⦾"],[0,"⦿"],[0,"⧀"],[0,"⧁"],[0,"⧂"],[0,"⧃"],[0,"⧄"],[0,"⧅"],[3,"⧉"],[3,"⧍"],[0,"⧎"],[0,{v:"⧏",n:824,o:"⧏̸"}],[0,{v:"⧐",n:824,o:"⧐̸"}],[11,"⧜"],[0,"⧝"],[0,"⧞"],[4,"⧣"],[0,"⧤"],[0,"⧥"],[5,"⧫"],[8,"⧴"],[1,"⧶"],[9,"⨀"],[0,"⨁"],[0,"⨂"],[1,"⨄"],[1,"⨆"],[5,"⨌"],[0,"⨍"],[2,"⨐"],[0,"⨑"],[0,"⨒"],[0,"⨓"],[0,"⨔"],[0,"⨕"],[0,"⨖"],[0,"⨗"],[10,"⨢"],[0,"⨣"],[0,"⨤"],[0,"⨥"],[0,"⨦"],[0,"⨧"],[1,"⨩"],[0,"⨪"],[2,"⨭"],[0,"⨮"],[0,"⨯"],[0,"⨰"],[0,"⨱"],[1,"⨳"],[0,"⨴"],[0,"⨵"],[0,"⨶"],[0,"⨷"],[0,"⨸"],[0,"⨹"],[0,"⨺"],[0,"⨻"],[0,"⨼"],[2,"⨿"],[0,"⩀"],[1,"⩂"],[0,"⩃"],[0,"⩄"],[0,"⩅"],[0,"⩆"],[0,"⩇"],[0,"⩈"],[0,"⩉"],[0,"⩊"],[0,"⩋"],[0,"⩌"],[0,"⩍"],[2,"⩐"],[2,"⩓"],[0,"⩔"],[0,"⩕"],[0,"⩖"],[0,"⩗"],[0,"⩘"],[1,"⩚"],[0,"⩛"],[0,"⩜"],[0,"⩝"],[1,"⩟"],[6,"⩦"],[3,"⩪"],[2,{v:"⩭",n:824,o:"⩭̸"}],[0,"⩮"],[0,"⩯"],[0,{v:"⩰",n:824,o:"⩰̸"}],[0,"⩱"],[0,"⩲"],[0,"⩳"],[0,"⩴"],[0,"⩵"],[1,"⩷"],[0,"⩸"],[0,"⩹"],[0,"⩺"],[0,"⩻"],[0,"⩼"],[0,{v:"⩽",n:824,o:"⩽̸"}],[0,{v:"⩾",n:824,o:"⩾̸"}],[0,"⩿"],[0,"⪀"],[0,"⪁"],[0,"⪂"],[0,"⪃"],[0,"⪄"],[0,"⪅"],[0,"⪆"],[0,"⪇"],[0,"⪈"],[0,"⪉"],[0,"⪊"],[0,"⪋"],[0,"⪌"],[0,"⪍"],[0,"⪎"],[0,"⪏"],[0,"⪐"],[0,"⪑"],[0,"⪒"],[0,"⪓"],[0,"⪔"],[0,"⪕"],[0,"⪖"],[0,"⪗"],[0,"⪘"],[0,"⪙"],[0,"⪚"],[2,"⪝"],[0,"⪞"],[0,"⪟"],[0,"⪠"],[0,{v:"⪡",n:824,o:"⪡̸"}],[0,{v:"⪢",n:824,o:"⪢̸"}],[1,"⪤"],[0,"⪥"],[0,"⪦"],[0,"⪧"],[0,"⪨"],[0,"⪩"],[0,"⪪"],[0,"⪫"],[0,{v:"⪬",n:65024,o:"⪬︀"}],[0,{v:"⪭",n:65024,o:"⪭︀"}],[0,"⪮"],[0,{v:"⪯",n:824,o:"⪯̸"}],[0,{v:"⪰",n:824,o:"⪰̸"}],[2,"⪳"],[0,"⪴"],[0,"⪵"],[0,"⪶"],[0,"⪷"],[0,"⪸"],[0,"⪹"],[0,"⪺"],[0,"⪻"],[0,"⪼"],[0,"⪽"],[0,"⪾"],[0,"⪿"],[0,"⫀"],[0,"⫁"],[0,"⫂"],[0,"⫃"],[0,"⫄"],[0,{v:"⫅",n:824,o:"⫅̸"}],[0,{v:"⫆",n:824,o:"⫆̸"}],[0,"⫇"],[0,"⫈"],[2,{v:"⫋",n:65024,o:"⫋︀"}],[0,{v:"⫌",n:65024,o:"⫌︀"}],[2,"⫏"],[0,"⫐"],[0,"⫑"],[0,"⫒"],[0,"⫓"],[0,"⫔"],[0,"⫕"],[0,"⫖"],[0,"⫗"],[0,"⫘"],[0,"⫙"],[0,"⫚"],[0,"⫛"],[8,"⫤"],[1,"⫦"],[0,"⫧"],[0,"⫨"],[0,"⫩"],[1,"⫫"],[0,"⫬"],[0,"⫭"],[0,"⫮"],[0,"⫯"],[0,"⫰"],[0,"⫱"],[0,"⫲"],[0,"⫳"],[9,{v:"⫽",n:8421,o:"⫽⃥"}],[44343,{n:new Map(t([[56476,"𝒜"],[1,"𝒞"],[0,"𝒟"],[2,"𝒢"],[2,"𝒥"],[0,"𝒦"],[2,"𝒩"],[0,"𝒪"],[0,"𝒫"],[0,"𝒬"],[1,"𝒮"],[0,"𝒯"],[0,"𝒰"],[0,"𝒱"],[0,"𝒲"],[0,"𝒳"],[0,"𝒴"],[0,"𝒵"],[0,"𝒶"],[0,"𝒷"],[0,"𝒸"],[0,"𝒹"],[1,"𝒻"],[1,"𝒽"],[0,"𝒾"],[0,"𝒿"],[0,"𝓀"],[0,"𝓁"],[0,"𝓂"],[0,"𝓃"],[1,"𝓅"],[0,"𝓆"],[0,"𝓇"],[0,"𝓈"],[0,"𝓉"],[0,"𝓊"],[0,"𝓋"],[0,"𝓌"],[0,"𝓍"],[0,"𝓎"],[0,"𝓏"],[52,"𝔄"],[0,"𝔅"],[1,"𝔇"],[0,"𝔈"],[0,"𝔉"],[0,"𝔊"],[2,"𝔍"],[0,"𝔎"],[0,"𝔏"],[0,"𝔐"],[0,"𝔑"],[0,"𝔒"],[0,"𝔓"],[0,"𝔔"],[1,"𝔖"],[0,"𝔗"],[0,"𝔘"],[0,"𝔙"],[0,"𝔚"],[0,"𝔛"],[0,"𝔜"],[1,"𝔞"],[0,"𝔟"],[0,"𝔠"],[0,"𝔡"],[0,"𝔢"],[0,"𝔣"],[0,"𝔤"],[0,"𝔥"],[0,"𝔦"],[0,"𝔧"],[0,"𝔨"],[0,"𝔩"],[0,"𝔪"],[0,"𝔫"],[0,"𝔬"],[0,"𝔭"],[0,"𝔮"],[0,"𝔯"],[0,"𝔰"],[0,"𝔱"],[0,"𝔲"],[0,"𝔳"],[0,"𝔴"],[0,"𝔵"],[0,"𝔶"],[0,"𝔷"],[0,"𝔸"],[0,"𝔹"],[1,"𝔻"],[0,"𝔼"],[0,"𝔽"],[0,"𝔾"],[1,"𝕀"],[0,"𝕁"],[0,"𝕂"],[0,"𝕃"],[0,"𝕄"],[1,"𝕆"],[3,"𝕊"],[0,"𝕋"],[0,"𝕌"],[0,"𝕍"],[0,"𝕎"],[0,"𝕏"],[0,"𝕐"],[1,"𝕒"],[0,"𝕓"],[0,"𝕔"],[0,"𝕕"],[0,"𝕖"],[0,"𝕗"],[0,"𝕘"],[0,"𝕙"],[0,"𝕚"],[0,"𝕛"],[0,"𝕜"],[0,"𝕝"],[0,"𝕞"],[0,"𝕟"],[0,"𝕠"],[0,"𝕡"],[0,"𝕢"],[0,"𝕣"],[0,"𝕤"],[0,"𝕥"],[0,"𝕦"],[0,"𝕧"],[0,"𝕨"],[0,"𝕩"],[0,"𝕪"],[0,"𝕫"]]))}],[8906,"ff"],[0,"fi"],[0,"fl"],[0,"ffi"],[0,"ffl"]])),fa}var Fu={},R_;function d0(){return R_||(R_=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.escapeText=t.escapeAttribute=t.escapeUTF8=t.escape=t.encodeXML=t.getCodePoint=t.xmlReplacer=void 0,t.xmlReplacer=/["&'<>$\x80-\uFFFF]/g;var e=new Map([[34,"""],[38,"&"],[39,"'"],[60,"<"],[62,">"]]);t.getCodePoint=String.prototype.codePointAt!=null?function(i,s){return i.codePointAt(s)}:function(i,s){return(i.charCodeAt(s)&64512)===55296?(i.charCodeAt(s)-55296)*1024+i.charCodeAt(s+1)-56320+65536:i.charCodeAt(s)};function n(i){for(var s="",a=0,c;(c=t.xmlReplacer.exec(i))!==null;){var l=c.index,u=i.charCodeAt(l),d=e.get(u);d!==void 0?(s+=i.substring(a,l)+d,a=l+1):(s+="".concat(i.substring(a,l),"&#x").concat((0,t.getCodePoint)(i,l).toString(16),";"),a=t.xmlReplacer.lastIndex+=+((u&64512)===55296))}return s+i.substr(a)}t.encodeXML=n,t.escape=n;function r(i,s){return function(c){for(var l,u=0,d="";l=i.exec(c);)u!==l.index&&(d+=c.substring(u,l.index)),d+=s.get(l[0].charCodeAt(0)),u=l.index+1;return d+c.substring(u)}}t.escapeUTF8=r(/[&<>'"]/g,e),t.escapeAttribute=r(/["&\u00A0]/g,new Map([[34,"""],[38,"&"],[160," "]])),t.escapeText=r(/[&<>\u00A0]/g,new Map([[38,"&"],[60,"<"],[62,">"],[160," "]]))})(Fu)),Fu}var L_;function B_(){if(L_)return In;L_=1;var t=In&&In.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(In,"__esModule",{value:!0}),In.encodeNonAsciiHTML=In.encodeHTML=void 0;var e=t(wA()),n=d0(),r=/[\t\n!-,./:-@[-`\f{-}$\x80-\uFFFF]/g;function i(c){return a(r,c)}In.encodeHTML=i;function s(c){return a(n.xmlReplacer,c)}In.encodeNonAsciiHTML=s;function a(c,l){for(var u="",d=0,f;(f=c.exec(l))!==null;){var p=f.index;u+=l.substring(d,p);var h=l.charCodeAt(p),m=e.default.get(h);if(typeof m=="object"){if(p+1<l.length){var y=l.charCodeAt(p+1),w=typeof m.n=="number"?m.n===y?m.o:void 0:m.n.get(y);if(w!==void 0){u+=w,d=c.lastIndex+=1;continue}}m=m.v}if(m!==void 0)u+=m,d=p+1;else{var _=(0,n.getCodePoint)(l,p);u+="&#x".concat(_.toString(16),";"),d=c.lastIndex+=+(_!==h)}}return u+l.substr(d)}return In}var D_;function vA(){return D_||(D_=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.decodeXMLStrict=t.decodeHTML5Strict=t.decodeHTML4Strict=t.decodeHTML5=t.decodeHTML4=t.decodeHTMLAttribute=t.decodeHTMLStrict=t.decodeHTML=t.decodeXML=t.DecodingMode=t.EntityDecoder=t.encodeHTML5=t.encodeHTML4=t.encodeNonAsciiHTML=t.encodeHTML=t.escapeText=t.escapeAttribute=t.escapeUTF8=t.escape=t.encodeXML=t.encode=t.decodeStrict=t.decode=t.EncodingMode=t.EntityLevel=void 0;var e=Hc(),n=B_(),r=d0(),i;(function(p){p[p.XML=0]="XML",p[p.HTML=1]="HTML"})(i=t.EntityLevel||(t.EntityLevel={}));var s;(function(p){p[p.UTF8=0]="UTF8",p[p.ASCII=1]="ASCII",p[p.Extensive=2]="Extensive",p[p.Attribute=3]="Attribute",p[p.Text=4]="Text"})(s=t.EncodingMode||(t.EncodingMode={}));function a(p,h){h===void 0&&(h=i.XML);var m=typeof h=="number"?h:h.level;if(m===i.HTML){var y=typeof h=="object"?h.mode:void 0;return(0,e.decodeHTML)(p,y)}return(0,e.decodeXML)(p)}t.decode=a;function c(p,h){var m;h===void 0&&(h=i.XML);var y=typeof h=="number"?{level:h}:h;return(m=y.mode)!==null&&m!==void 0||(y.mode=e.DecodingMode.Strict),a(p,y)}t.decodeStrict=c;function l(p,h){h===void 0&&(h=i.XML);var m=typeof h=="number"?{level:h}:h;return m.mode===s.UTF8?(0,r.escapeUTF8)(p):m.mode===s.Attribute?(0,r.escapeAttribute)(p):m.mode===s.Text?(0,r.escapeText)(p):m.level===i.HTML?m.mode===s.ASCII?(0,n.encodeNonAsciiHTML)(p):(0,n.encodeHTML)(p):(0,r.encodeXML)(p)}t.encode=l;var u=d0();Object.defineProperty(t,"encodeXML",{enumerable:!0,get:function(){return u.encodeXML}}),Object.defineProperty(t,"escape",{enumerable:!0,get:function(){return u.escape}}),Object.defineProperty(t,"escapeUTF8",{enumerable:!0,get:function(){return u.escapeUTF8}}),Object.defineProperty(t,"escapeAttribute",{enumerable:!0,get:function(){return u.escapeAttribute}}),Object.defineProperty(t,"escapeText",{enumerable:!0,get:function(){return u.escapeText}});var d=B_();Object.defineProperty(t,"encodeHTML",{enumerable:!0,get:function(){return d.encodeHTML}}),Object.defineProperty(t,"encodeNonAsciiHTML",{enumerable:!0,get:function(){return d.encodeNonAsciiHTML}}),Object.defineProperty(t,"encodeHTML4",{enumerable:!0,get:function(){return d.encodeHTML}}),Object.defineProperty(t,"encodeHTML5",{enumerable:!0,get:function(){return d.encodeHTML}});var f=Hc();Object.defineProperty(t,"EntityDecoder",{enumerable:!0,get:function(){return f.EntityDecoder}}),Object.defineProperty(t,"DecodingMode",{enumerable:!0,get:function(){return f.DecodingMode}}),Object.defineProperty(t,"decodeXML",{enumerable:!0,get:function(){return f.decodeXML}}),Object.defineProperty(t,"decodeHTML",{enumerable:!0,get:function(){return f.decodeHTML}}),Object.defineProperty(t,"decodeHTMLStrict",{enumerable:!0,get:function(){return f.decodeHTMLStrict}}),Object.defineProperty(t,"decodeHTMLAttribute",{enumerable:!0,get:function(){return f.decodeHTMLAttribute}}),Object.defineProperty(t,"decodeHTML4",{enumerable:!0,get:function(){return f.decodeHTML}}),Object.defineProperty(t,"decodeHTML5",{enumerable:!0,get:function(){return f.decodeHTML}}),Object.defineProperty(t,"decodeHTML4Strict",{enumerable:!0,get:function(){return f.decodeHTMLStrict}}),Object.defineProperty(t,"decodeHTML5Strict",{enumerable:!0,get:function(){return f.decodeHTMLStrict}}),Object.defineProperty(t,"decodeXMLStrict",{enumerable:!0,get:function(){return f.decodeXML}})})(qu)),qu}var kr={},U_;function xA(){return U_||(U_=1,Object.defineProperty(kr,"__esModule",{value:!0}),kr.attributeNames=kr.elementNames=void 0,kr.elementNames=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(function(t){return[t.toLowerCase(),t]})),kr.attributeNames=new Map(["definitionURL","attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(function(t){return[t.toLowerCase(),t]}))),kr}var M_;function kA(){if(M_)return bt;M_=1;var t=bt&&bt.__assign||function(){return t=Object.assign||function($){for(var b,z=1,A=arguments.length;z<A;z++){b=arguments[z];for(var N in b)Object.prototype.hasOwnProperty.call(b,N)&&($[N]=b[N])}return $},t.apply(this,arguments)},e=bt&&bt.__createBinding||(Object.create?(function($,b,z,A){A===void 0&&(A=z);var N=Object.getOwnPropertyDescriptor(b,z);(!N||("get"in N?!b.__esModule:N.writable||N.configurable))&&(N={enumerable:!0,get:function(){return b[z]}}),Object.defineProperty($,A,N)}):(function($,b,z,A){A===void 0&&(A=z),$[A]=b[z]})),n=bt&&bt.__setModuleDefault||(Object.create?(function($,b){Object.defineProperty($,"default",{enumerable:!0,value:b})}):function($,b){$.default=b}),r=bt&&bt.__importStar||function($){if($&&$.__esModule)return $;var b={};if($!=null)for(var z in $)z!=="default"&&Object.prototype.hasOwnProperty.call($,z)&&e(b,$,z);return n(b,$),b};Object.defineProperty(bt,"__esModule",{value:!0}),bt.render=void 0;var i=r(Qs()),s=vA(),a=xA(),c=new Set(["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"]);function l($){return $.replace(/"/g,""")}function u($,b){var z;if($){var A=((z=b.encodeEntities)!==null&&z!==void 0?z:b.decodeEntities)===!1?l:b.xmlMode||b.encodeEntities!=="utf8"?s.encodeXML:s.escapeAttribute;return Object.keys($).map(function(N){var O,L,C=(O=$[N])!==null&&O!==void 0?O:"";return b.xmlMode==="foreign"&&(N=(L=a.attributeNames.get(N))!==null&&L!==void 0?L:N),!b.emptyAttrs&&!b.xmlMode&&C===""?N:"".concat(N,'="').concat(A(C),'"')}).join(" ")}}var d=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]);function f($,b){b===void 0&&(b={});for(var z=("length"in $)?$:[$],A="",N=0;N<z.length;N++)A+=p(z[N],b);return A}bt.render=f,bt.default=f;function p($,b){switch($.type){case i.Root:return f($.children,b);case i.Doctype:case i.Directive:return w($);case i.Comment:return v($);case i.CDATA:return k($);case i.Script:case i.Style:case i.Tag:return y($,b);case i.Text:return _($,b)}}var h=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignObject","desc","title"]),m=new Set(["svg","math"]);function y($,b){var z;b.xmlMode==="foreign"&&($.name=(z=a.elementNames.get($.name))!==null&&z!==void 0?z:$.name,$.parent&&h.has($.parent.name)&&(b=t(t({},b),{xmlMode:!1}))),!b.xmlMode&&m.has($.name)&&(b=t(t({},b),{xmlMode:"foreign"}));var A="<".concat($.name),N=u($.attribs,b);return N&&(A+=" ".concat(N)),$.children.length===0&&(b.xmlMode?b.selfClosingTags!==!1:b.selfClosingTags&&d.has($.name))?(b.xmlMode||(A+=" "),A+="/>"):(A+=">",$.children.length>0&&(A+=f($.children,b)),(b.xmlMode||!d.has($.name))&&(A+="</".concat($.name,">"))),A}function w($){return"<".concat($.data,">")}function _($,b){var z,A=$.data||"";return((z=b.encodeEntities)!==null&&z!==void 0?z:b.decodeEntities)!==!1&&!(!b.xmlMode&&$.parent&&c.has($.parent.name))&&(A=b.xmlMode||b.encodeEntities!=="utf8"?(0,s.encodeXML)(A):(0,s.escapeText)(A)),A}function k($){return"<![CDATA[".concat($.children[0].data,"]]>")}function v($){return"<!--".concat($.data,"-->")}return bt}var q_;function Iv(){if(q_)return fn;q_=1;var t=fn&&fn.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(fn,"__esModule",{value:!0}),fn.getOuterHTML=i,fn.getInnerHTML=s,fn.getText=a,fn.textContent=c,fn.innerText=l;var e=hr(),n=t(kA()),r=Qs();function i(u,d){return(0,n.default)(u,d)}function s(u,d){return(0,e.hasChildren)(u)?u.children.map(function(f){return i(f,d)}).join(""):""}function a(u){return Array.isArray(u)?u.map(a).join(""):(0,e.isTag)(u)?u.name==="br"?`
|
|
96
|
+
`:a(u.children):(0,e.isCDATA)(u)?a(u.children):(0,e.isText)(u)?u.data:""}function c(u){return Array.isArray(u)?u.map(c).join(""):(0,e.hasChildren)(u)&&!(0,e.isComment)(u)?c(u.children):(0,e.isText)(u)?u.data:""}function l(u){return Array.isArray(u)?u.map(l).join(""):(0,e.hasChildren)(u)&&(u.type===r.ElementType.Tag||(0,e.isCDATA)(u))?l(u.children):(0,e.isText)(u)?u.data:""}return fn}var Gt={},F_;function $A(){if(F_)return Gt;F_=1,Object.defineProperty(Gt,"__esModule",{value:!0}),Gt.getChildren=e,Gt.getParent=n,Gt.getSiblings=r,Gt.getAttributeValue=i,Gt.hasAttrib=s,Gt.getName=a,Gt.nextElementSibling=c,Gt.prevElementSibling=l;var t=hr();function e(u){return(0,t.hasChildren)(u)?u.children:[]}function n(u){return u.parent||null}function r(u){var d,f,p=n(u);if(p!=null)return e(p);for(var h=[u],m=u.prev,y=u.next;m!=null;)h.unshift(m),d=m,m=d.prev;for(;y!=null;)h.push(y),f=y,y=f.next;return h}function i(u,d){var f;return(f=u.attribs)===null||f===void 0?void 0:f[d]}function s(u,d){return u.attribs!=null&&Object.prototype.hasOwnProperty.call(u.attribs,d)&&u.attribs[d]!=null}function a(u){return u.name}function c(u){for(var d,f=u.next;f!==null&&!(0,t.isTag)(f);)d=f,f=d.next;return f}function l(u){for(var d,f=u.prev;f!==null&&!(0,t.isTag)(f);)d=f,f=d.prev;return f}return Gt}var jn={},H_;function SA(){if(H_)return jn;H_=1,Object.defineProperty(jn,"__esModule",{value:!0}),jn.removeElement=t,jn.replaceElement=e,jn.appendChild=n,jn.append=r,jn.prependChild=i,jn.prepend=s;function t(a){if(a.prev&&(a.prev.next=a.next),a.next&&(a.next.prev=a.prev),a.parent){var c=a.parent.children,l=c.lastIndexOf(a);l>=0&&c.splice(l,1)}a.next=null,a.prev=null,a.parent=null}function e(a,c){var l=c.prev=a.prev;l&&(l.next=c);var u=c.next=a.next;u&&(u.prev=c);var d=c.parent=a.parent;if(d){var f=d.children;f[f.lastIndexOf(a)]=c,a.parent=null}}function n(a,c){if(t(c),c.next=null,c.parent=a,a.children.push(c)>1){var l=a.children[a.children.length-2];l.next=c,c.prev=l}else c.prev=null}function r(a,c){t(c);var l=a.parent,u=a.next;if(c.next=u,c.prev=a,a.next=c,c.parent=l,u){if(u.prev=c,l){var d=l.children;d.splice(d.lastIndexOf(u),0,c)}}else l&&l.children.push(c)}function i(a,c){if(t(c),c.parent=a,c.prev=null,a.children.unshift(c)!==1){var l=a.children[1];l.prev=c,c.next=l}else c.next=null}function s(a,c){t(c);var l=a.parent;if(l){var u=l.children;u.splice(u.indexOf(a),0,c)}a.prev&&(a.prev.next=c),c.parent=l,c.prev=a.prev,c.next=a,a.prev=c}return jn}var Tn={},V_;function jv(){if(V_)return Tn;V_=1,Object.defineProperty(Tn,"__esModule",{value:!0}),Tn.filter=e,Tn.find=n,Tn.findOneChild=r,Tn.findOne=i,Tn.existsOne=s,Tn.findAll=a;var t=hr();function e(c,l,u,d){return u===void 0&&(u=!0),d===void 0&&(d=1/0),n(c,Array.isArray(l)?l:[l],u,d)}function n(c,l,u,d){for(var f=[],p=[Array.isArray(l)?l:[l]],h=[0];;){if(h[0]>=p[0].length){if(h.length===1)return f;p.shift(),h.shift();continue}var m=p[0][h[0]++];if(c(m)&&(f.push(m),--d<=0))return f;u&&(0,t.hasChildren)(m)&&m.children.length>0&&(h.unshift(0),p.unshift(m.children))}}function r(c,l){return l.find(c)}function i(c,l,u){u===void 0&&(u=!0);for(var d=Array.isArray(l)?l:[l],f=0;f<d.length;f++){var p=d[f];if((0,t.isTag)(p)&&c(p))return p;if(u&&(0,t.hasChildren)(p)&&p.children.length>0){var h=i(c,p.children,!0);if(h)return h}}return null}function s(c,l){return(Array.isArray(l)?l:[l]).some(function(u){return(0,t.isTag)(u)&&c(u)||(0,t.hasChildren)(u)&&s(c,u.children)})}function a(c,l){for(var u=[],d=[Array.isArray(l)?l:[l]],f=[0];;){if(f[0]>=d[0].length){if(d.length===1)return u;d.shift(),f.shift();continue}var p=d[0][f[0]++];(0,t.isTag)(p)&&c(p)&&u.push(p),(0,t.hasChildren)(p)&&p.children.length>0&&(f.unshift(0),d.unshift(p.children))}}return Tn}var On={},K_;function Tv(){if(K_)return On;K_=1,Object.defineProperty(On,"__esModule",{value:!0}),On.testElement=a,On.getElements=c,On.getElementById=l,On.getElementsByTagName=u,On.getElementsByClassName=d,On.getElementsByTagType=f;var t=hr(),e=jv(),n={tag_name:function(p){return typeof p=="function"?function(h){return(0,t.isTag)(h)&&p(h.name)}:p==="*"?t.isTag:function(h){return(0,t.isTag)(h)&&h.name===p}},tag_type:function(p){return typeof p=="function"?function(h){return p(h.type)}:function(h){return h.type===p}},tag_contains:function(p){return typeof p=="function"?function(h){return(0,t.isText)(h)&&p(h.data)}:function(h){return(0,t.isText)(h)&&h.data===p}}};function r(p,h){return typeof h=="function"?function(m){return(0,t.isTag)(m)&&h(m.attribs[p])}:function(m){return(0,t.isTag)(m)&&m.attribs[p]===h}}function i(p,h){return function(m){return p(m)||h(m)}}function s(p){var h=Object.keys(p).map(function(m){var y=p[m];return Object.prototype.hasOwnProperty.call(n,m)?n[m](y):r(m,y)});return h.length===0?null:h.reduce(i)}function a(p,h){var m=s(p);return m?m(h):!0}function c(p,h,m,y){y===void 0&&(y=1/0);var w=s(p);return w?(0,e.filter)(w,h,m,y):[]}function l(p,h,m){return m===void 0&&(m=!0),Array.isArray(h)||(h=[h]),(0,e.findOne)(r("id",p),h,m)}function u(p,h,m,y){return m===void 0&&(m=!0),y===void 0&&(y=1/0),(0,e.filter)(n.tag_name(p),h,m,y)}function d(p,h,m,y){return m===void 0&&(m=!0),y===void 0&&(y=1/0),(0,e.filter)(r("class",p),h,m,y)}function f(p,h,m,y){return m===void 0&&(m=!0),y===void 0&&(y=1/0),(0,e.filter)(n.tag_type(p),h,m,y)}return On}var Yn={},G_;function zA(){if(G_)return Yn;G_=1,Object.defineProperty(Yn,"__esModule",{value:!0}),Yn.DocumentPosition=void 0,Yn.removeSubsets=e,Yn.compareDocumentPosition=r,Yn.uniqueSort=i;var t=hr();function e(s){for(var a=s.length;--a>=0;){var c=s[a];if(a>0&&s.lastIndexOf(c,a-1)>=0){s.splice(a,1);continue}for(var l=c.parent;l;l=l.parent)if(s.includes(l)){s.splice(a,1);break}}return s}var n;(function(s){s[s.DISCONNECTED=1]="DISCONNECTED",s[s.PRECEDING=2]="PRECEDING",s[s.FOLLOWING=4]="FOLLOWING",s[s.CONTAINS=8]="CONTAINS",s[s.CONTAINED_BY=16]="CONTAINED_BY"})(n||(Yn.DocumentPosition=n={}));function r(s,a){var c=[],l=[];if(s===a)return 0;for(var u=(0,t.hasChildren)(s)?s:s.parent;u;)c.unshift(u),u=u.parent;for(u=(0,t.hasChildren)(a)?a:a.parent;u;)l.unshift(u),u=u.parent;for(var d=Math.min(c.length,l.length),f=0;f<d&&c[f]===l[f];)f++;if(f===0)return n.DISCONNECTED;var p=c[f-1],h=p.children,m=c[f],y=l[f];return h.indexOf(m)>h.indexOf(y)?p===a?n.FOLLOWING|n.CONTAINED_BY:n.FOLLOWING:p===s?n.PRECEDING|n.CONTAINS:n.PRECEDING}function i(s){return s=s.filter(function(a,c,l){return!l.includes(a,c+1)}),s.sort(function(a,c){var l=r(a,c);return l&n.PRECEDING?-1:l&n.FOLLOWING?1:0}),s}return Yn}var ha={},W_;function AA(){if(W_)return ha;W_=1,Object.defineProperty(ha,"__esModule",{value:!0}),ha.getFeed=n;var t=Iv(),e=Tv();function n(p){var h=l(f,p);return h?h.name==="feed"?r(h):i(h):null}function r(p){var h,m=p.children,y={type:"atom",items:(0,e.getElementsByTagName)("entry",m).map(function(k){var v,$=k.children,b={media:c($)};d(b,"id","id",$),d(b,"title","title",$);var z=(v=l("link",$))===null||v===void 0?void 0:v.attribs.href;z&&(b.link=z);var A=u("summary",$)||u("content",$);A&&(b.description=A);var N=u("updated",$);return N&&(b.pubDate=new Date(N)),b})};d(y,"id","id",m),d(y,"title","title",m);var w=(h=l("link",m))===null||h===void 0?void 0:h.attribs.href;w&&(y.link=w),d(y,"description","subtitle",m);var _=u("updated",m);return _&&(y.updated=new Date(_)),d(y,"author","email",m,!0),y}function i(p){var h,m,y=(m=(h=l("channel",p.children))===null||h===void 0?void 0:h.children)!==null&&m!==void 0?m:[],w={type:p.name.substr(0,3),id:"",items:(0,e.getElementsByTagName)("item",p.children).map(function(k){var v=k.children,$={media:c(v)};d($,"id","guid",v),d($,"title","title",v),d($,"link","link",v),d($,"description","description",v);var b=u("pubDate",v)||u("dc:date",v);return b&&($.pubDate=new Date(b)),$})};d(w,"title","title",y),d(w,"link","link",y),d(w,"description","description",y);var _=u("lastBuildDate",y);return _&&(w.updated=new Date(_)),d(w,"author","managingEditor",y,!0),w}var s=["url","type","lang"],a=["fileSize","bitrate","framerate","samplingrate","channels","duration","height","width"];function c(p){return(0,e.getElementsByTagName)("media:content",p).map(function(h){for(var m=h.attribs,y={medium:m.medium,isDefault:!!m.isDefault},w=0,_=s;w<_.length;w++){var k=_[w];m[k]&&(y[k]=m[k])}for(var v=0,$=a;v<$.length;v++){var k=$[v];m[k]&&(y[k]=parseInt(m[k],10))}return m.expression&&(y.expression=m.expression),y})}function l(p,h){return(0,e.getElementsByTagName)(p,h,!0,1)[0]}function u(p,h,m){return m===void 0&&(m=!1),(0,t.textContent)((0,e.getElementsByTagName)(p,h,m,1)).trim()}function d(p,h,m,y,w){w===void 0&&(w=!1);var _=u(m,y,w);_&&(p[h]=_)}function f(p){return p==="rss"||p==="feed"||p==="rdf:RDF"}return ha}var J_;function Hu(){return J_||(J_=1,(function(t){var e=xr&&xr.__createBinding||(Object.create?(function(i,s,a,c){c===void 0&&(c=a);var l=Object.getOwnPropertyDescriptor(s,a);(!l||("get"in l?!s.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return s[a]}}),Object.defineProperty(i,c,l)}):(function(i,s,a,c){c===void 0&&(c=a),i[c]=s[a]})),n=xr&&xr.__exportStar||function(i,s){for(var a in i)a!=="default"&&!Object.prototype.hasOwnProperty.call(s,a)&&e(s,i,a)};Object.defineProperty(t,"__esModule",{value:!0}),t.hasChildren=t.isDocument=t.isComment=t.isText=t.isCDATA=t.isTag=void 0,n(Iv(),t),n($A(),t),n(SA(),t),n(jv(),t),n(Tv(),t),n(zA(),t),n(AA(),t);var r=hr();Object.defineProperty(t,"isTag",{enumerable:!0,get:function(){return r.isTag}}),Object.defineProperty(t,"isCDATA",{enumerable:!0,get:function(){return r.isCDATA}}),Object.defineProperty(t,"isText",{enumerable:!0,get:function(){return r.isText}}),Object.defineProperty(t,"isComment",{enumerable:!0,get:function(){return r.isComment}}),Object.defineProperty(t,"isDocument",{enumerable:!0,get:function(){return r.isDocument}}),Object.defineProperty(t,"hasChildren",{enumerable:!0,get:function(){return r.hasChildren}})})(xr)),xr}var X_;function EA(){return X_||(X_=1,(function(t){var e=Ht&&Ht.__createBinding||(Object.create?(function(_,k,v,$){$===void 0&&($=v);var b=Object.getOwnPropertyDescriptor(k,v);(!b||("get"in b?!k.__esModule:b.writable||b.configurable))&&(b={enumerable:!0,get:function(){return k[v]}}),Object.defineProperty(_,$,b)}):(function(_,k,v,$){$===void 0&&($=v),_[$]=k[v]})),n=Ht&&Ht.__setModuleDefault||(Object.create?(function(_,k){Object.defineProperty(_,"default",{enumerable:!0,value:k})}):function(_,k){_.default=k}),r=Ht&&Ht.__importStar||function(_){if(_&&_.__esModule)return _;var k={};if(_!=null)for(var v in _)v!=="default"&&Object.prototype.hasOwnProperty.call(_,v)&&e(k,_,v);return n(k,_),k},i=Ht&&Ht.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(t,"__esModule",{value:!0}),t.DomUtils=t.parseFeed=t.getFeed=t.ElementType=t.Tokenizer=t.createDomStream=t.parseDOM=t.parseDocument=t.DefaultHandler=t.DomHandler=t.Parser=void 0;var s=N_(),a=N_();Object.defineProperty(t,"Parser",{enumerable:!0,get:function(){return a.Parser}});var c=hr(),l=hr();Object.defineProperty(t,"DomHandler",{enumerable:!0,get:function(){return l.DomHandler}}),Object.defineProperty(t,"DefaultHandler",{enumerable:!0,get:function(){return l.DomHandler}});function u(_,k){var v=new c.DomHandler(void 0,k);return new s.Parser(v,k).end(_),v.root}t.parseDocument=u;function d(_,k){return u(_,k).children}t.parseDOM=d;function f(_,k,v){var $=new c.DomHandler(_,k,v);return new s.Parser($,k)}t.createDomStream=f;var p=Nv();Object.defineProperty(t,"Tokenizer",{enumerable:!0,get:function(){return i(p).default}}),t.ElementType=r(Qs());var h=Hu(),m=Hu();Object.defineProperty(t,"getFeed",{enumerable:!0,get:function(){return m.getFeed}});var y={xmlMode:!0};function w(_,k){return k===void 0&&(k=y),(0,h.getFeed)(d(_,k))}t.parseFeed=w,t.DomUtils=r(Hu())})(Ht)),Ht}var Vu,Z_;function CA(){return Z_||(Z_=1,Vu=t=>{if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}),Vu}var ga={},Y_;function NA(){if(Y_)return ga;Y_=1,Object.defineProperty(ga,"__esModule",{value:!0});function t(n){return Object.prototype.toString.call(n)==="[object Object]"}function e(n){var r,i;return t(n)===!1?!1:(r=n.constructor,r===void 0?!0:(i=r.prototype,!(t(i)===!1||i.hasOwnProperty("isPrototypeOf")===!1)))}return ga.isPlainObject=e,ga}var Ku,Q_;function IA(){if(Q_)return Ku;Q_=1;var t=function(k){return e(k)&&!n(k)};function e(_){return!!_&&typeof _=="object"}function n(_){var k=Object.prototype.toString.call(_);return k==="[object RegExp]"||k==="[object Date]"||s(_)}var r=typeof Symbol=="function"&&Symbol.for,i=r?Symbol.for("react.element"):60103;function s(_){return _.$$typeof===i}function a(_){return Array.isArray(_)?[]:{}}function c(_,k){return k.clone!==!1&&k.isMergeableObject(_)?y(a(_),_,k):_}function l(_,k,v){return _.concat(k).map(function($){return c($,v)})}function u(_,k){if(!k.customMerge)return y;var v=k.customMerge(_);return typeof v=="function"?v:y}function d(_){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(_).filter(function(k){return Object.propertyIsEnumerable.call(_,k)}):[]}function f(_){return Object.keys(_).concat(d(_))}function p(_,k){try{return k in _}catch{return!1}}function h(_,k){return p(_,k)&&!(Object.hasOwnProperty.call(_,k)&&Object.propertyIsEnumerable.call(_,k))}function m(_,k,v){var $={};return v.isMergeableObject(_)&&f(_).forEach(function(b){$[b]=c(_[b],v)}),f(k).forEach(function(b){h(_,b)||(p(_,b)&&v.isMergeableObject(k[b])?$[b]=u(b,v)(_[b],k[b],v):$[b]=c(k[b],v))}),$}function y(_,k,v){v=v||{},v.arrayMerge=v.arrayMerge||l,v.isMergeableObject=v.isMergeableObject||t,v.cloneUnlessOtherwiseSpecified=c;var $=Array.isArray(k),b=Array.isArray(_),z=$===b;return z?$?v.arrayMerge(_,k,v):m(_,k,v):c(k,v)}y.all=function(k,v){if(!Array.isArray(k))throw new Error("first argument should be an array");return k.reduce(function($,b){return y($,b,v)},{})};var w=y;return Ku=w,Ku}var Ra={exports:{}},jA=Ra.exports,e1;function TA(){return e1||(e1=1,(function(t){(function(e,n){t.exports?t.exports=n():e.parseSrcset=n()})(jA,function(){return function(e){function n($){return $===" "||$===" "||$===`
|
|
97
|
+
`||$==="\f"||$==="\r"}function r($){var b,z=$.exec(e.substring(w));if(z)return b=z[0],w+=b.length,b}for(var i=e.length,s=/^[ \t\n\r\u000c]+/,a=/^[, \t\n\r\u000c]+/,c=/^[^ \t\n\r\u000c]+/,l=/[,]+$/,u=/^\d+$/,d=/^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/,f,p,h,m,y,w=0,_=[];;){if(r(a),w>=i)return _;f=r(c),p=[],f.slice(-1)===","?(f=f.replace(l,""),v()):k()}function k(){for(r(s),h="",m="in descriptor";;){if(y=e.charAt(w),m==="in descriptor")if(n(y))h&&(p.push(h),h="",m="after descriptor");else if(y===","){w+=1,h&&p.push(h),v();return}else if(y==="(")h=h+y,m="in parens";else if(y===""){h&&p.push(h),v();return}else h=h+y;else if(m==="in parens")if(y===")")h=h+y,m="in descriptor";else if(y===""){p.push(h),v();return}else h=h+y;else if(m==="after descriptor"&&!n(y))if(y===""){v();return}else m="in descriptor",w-=1;w+=1}}function v(){var $=!1,b,z,A,N,O={},L,C,P,M,K;for(N=0;N<p.length;N++)L=p[N],C=L[L.length-1],P=L.substring(0,L.length-1),M=parseInt(P,10),K=parseFloat(P),u.test(P)&&C==="w"?((b||z)&&($=!0),M===0?$=!0:b=M):d.test(P)&&C==="x"?((b||z||A)&&($=!0),K<0?$=!0:z=K):u.test(P)&&C==="h"?((A||z)&&($=!0),M===0?$=!0:A=M):$=!0;$?console&&console.log&&console.log("Invalid srcset descriptor found in '"+e+"' at '"+L+"'."):(O.url=f,b&&(O.w=b),z&&(O.d=z),A&&(O.h=A),_.push(O))}}})})(Ra)),Ra.exports}var ma={exports:{}},t1;function OA(){if(t1)return ma.exports;t1=1;var t=String,e=function(){return{isColorSupported:!1,reset:t,bold:t,dim:t,italic:t,underline:t,inverse:t,hidden:t,strikethrough:t,black:t,red:t,green:t,yellow:t,blue:t,magenta:t,cyan:t,white:t,gray:t,bgBlack:t,bgRed:t,bgGreen:t,bgYellow:t,bgBlue:t,bgMagenta:t,bgCyan:t,bgWhite:t,blackBright:t,redBright:t,greenBright:t,yellowBright:t,blueBright:t,magentaBright:t,cyanBright:t,whiteBright:t,bgBlackBright:t,bgRedBright:t,bgGreenBright:t,bgYellowBright:t,bgBlueBright:t,bgMagentaBright:t,bgCyanBright:t,bgWhiteBright:t}};return ma.exports=e(),ma.exports.createColors=e,ma.exports}const en=F8(L4);var Gu,n1;function Jf(){if(n1)return Gu;n1=1;let t=OA(),e=en;class n extends Error{constructor(i,s,a,c,l,u){super(i),this.name="CssSyntaxError",this.reason=i,l&&(this.file=l),c&&(this.source=c),u&&(this.plugin=u),typeof s<"u"&&typeof a<"u"&&(typeof s=="number"?(this.line=s,this.column=a):(this.line=s.line,this.column=s.column,this.endLine=a.line,this.endColumn=a.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,n)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(i){if(!this.source)return"";let s=this.source;i==null&&(i=t.isColorSupported);let a=h=>h,c=h=>h,l=h=>h;if(i){let{bold:h,gray:m,red:y}=t.createColors(!0);c=w=>h(y(w)),a=w=>m(w),e&&(l=w=>e(w))}let u=s.split(/\r?\n/),d=Math.max(this.line-3,0),f=Math.min(this.line+2,u.length),p=String(f).length;return u.slice(d,f).map((h,m)=>{let y=d+1+m,w=" "+(" "+y).slice(-p)+" | ";if(y===this.line){if(h.length>160){let k=20,v=Math.max(0,this.column-k),$=Math.max(this.column+k,this.endColumn+k),b=h.slice(v,$),z=a(w.replace(/\d/g," "))+h.slice(0,Math.min(this.column-1,k-1)).replace(/[^\t]/g," ");return c(">")+a(w)+l(b)+`
|
|
98
|
+
`+z+c("^")}let _=a(w.replace(/\d/g," "))+h.slice(0,this.column-1).replace(/[^\t]/g," ");return c(">")+a(w)+l(h)+`
|
|
99
|
+
`+_+c("^")}return" "+a(w)+l(h)}).join(`
|
|
100
|
+
`)}toString(){let i=this.showSourceCode();return i&&(i=`
|
|
101
|
+
|
|
102
|
+
`+i+`
|
|
103
|
+
`),this.name+": "+this.message+i}}return Gu=n,n.default=n,Gu}var Wu,r1;function Ov(){if(r1)return Wu;r1=1;const t={after:`
|
|
104
|
+
`,beforeClose:`
|
|
105
|
+
`,beforeComment:`
|
|
106
|
+
`,beforeDecl:`
|
|
107
|
+
`,beforeOpen:" ",beforeRule:`
|
|
108
|
+
`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function e(r){return r[0].toUpperCase()+r.slice(1)}class n{constructor(i){this.builder=i}atrule(i,s){let a="@"+i.name,c=i.params?this.rawValue(i,"params"):"";if(typeof i.raws.afterName<"u"?a+=i.raws.afterName:c&&(a+=" "),i.nodes)this.block(i,a+c);else{let l=(i.raws.between||"")+(s?";":"");this.builder(a+c+l,i)}}beforeAfter(i,s){let a;i.type==="decl"?a=this.raw(i,null,"beforeDecl"):i.type==="comment"?a=this.raw(i,null,"beforeComment"):s==="before"?a=this.raw(i,null,"beforeRule"):a=this.raw(i,null,"beforeClose");let c=i.parent,l=0;for(;c&&c.type!=="root";)l+=1,c=c.parent;if(a.includes(`
|
|
109
|
+
`)){let u=this.raw(i,null,"indent");if(u.length)for(let d=0;d<l;d++)a+=u}return a}block(i,s){let a=this.raw(i,"between","beforeOpen");this.builder(s+a+"{",i,"start");let c;i.nodes&&i.nodes.length?(this.body(i),c=this.raw(i,"after")):c=this.raw(i,"after","emptyBody"),c&&this.builder(c),this.builder("}",i,"end")}body(i){let s=i.nodes.length-1;for(;s>0&&i.nodes[s].type==="comment";)s-=1;let a=this.raw(i,"semicolon");for(let c=0;c<i.nodes.length;c++){let l=i.nodes[c],u=this.raw(l,"before");u&&this.builder(u),this.stringify(l,s!==c||a)}}comment(i){let s=this.raw(i,"left","commentLeft"),a=this.raw(i,"right","commentRight");this.builder("/*"+s+i.text+a+"*/",i)}decl(i,s){let a=this.raw(i,"between","colon"),c=i.prop+a+this.rawValue(i,"value");i.important&&(c+=i.raws.important||" !important"),s&&(c+=";"),this.builder(c,i)}document(i){this.body(i)}raw(i,s,a){let c;if(a||(a=s),s&&(c=i.raws[s],typeof c<"u"))return c;let l=i.parent;if(a==="before"&&(!l||l.type==="root"&&l.first===i||l&&l.type==="document"))return"";if(!l)return t[a];let u=i.root();if(u.rawCache||(u.rawCache={}),typeof u.rawCache[a]<"u")return u.rawCache[a];if(a==="before"||a==="after")return this.beforeAfter(i,a);{let d="raw"+e(a);this[d]?c=this[d](u,i):u.walk(f=>{if(c=f.raws[s],typeof c<"u")return!1})}return typeof c>"u"&&(c=t[a]),u.rawCache[a]=c,c}rawBeforeClose(i){let s;return i.walk(a=>{if(a.nodes&&a.nodes.length>0&&typeof a.raws.after<"u")return s=a.raws.after,s.includes(`
|
|
110
|
+
`)&&(s=s.replace(/[^\n]+$/,"")),!1}),s&&(s=s.replace(/\S/g,"")),s}rawBeforeComment(i,s){let a;return i.walkComments(c=>{if(typeof c.raws.before<"u")return a=c.raws.before,a.includes(`
|
|
111
|
+
`)&&(a=a.replace(/[^\n]+$/,"")),!1}),typeof a>"u"?a=this.raw(s,null,"beforeDecl"):a&&(a=a.replace(/\S/g,"")),a}rawBeforeDecl(i,s){let a;return i.walkDecls(c=>{if(typeof c.raws.before<"u")return a=c.raws.before,a.includes(`
|
|
112
|
+
`)&&(a=a.replace(/[^\n]+$/,"")),!1}),typeof a>"u"?a=this.raw(s,null,"beforeRule"):a&&(a=a.replace(/\S/g,"")),a}rawBeforeOpen(i){let s;return i.walk(a=>{if(a.type!=="decl"&&(s=a.raws.between,typeof s<"u"))return!1}),s}rawBeforeRule(i){let s;return i.walk(a=>{if(a.nodes&&(a.parent!==i||i.first!==a)&&typeof a.raws.before<"u")return s=a.raws.before,s.includes(`
|
|
113
|
+
`)&&(s=s.replace(/[^\n]+$/,"")),!1}),s&&(s=s.replace(/\S/g,"")),s}rawColon(i){let s;return i.walkDecls(a=>{if(typeof a.raws.between<"u")return s=a.raws.between.replace(/[^\s:]/g,""),!1}),s}rawEmptyBody(i){let s;return i.walk(a=>{if(a.nodes&&a.nodes.length===0&&(s=a.raws.after,typeof s<"u"))return!1}),s}rawIndent(i){if(i.raws.indent)return i.raws.indent;let s;return i.walk(a=>{let c=a.parent;if(c&&c!==i&&c.parent&&c.parent===i&&typeof a.raws.before<"u"){let l=a.raws.before.split(`
|
|
114
|
+
`);return s=l[l.length-1],s=s.replace(/\S/g,""),!1}}),s}rawSemicolon(i){let s;return i.walk(a=>{if(a.nodes&&a.nodes.length&&a.last.type==="decl"&&(s=a.raws.semicolon,typeof s<"u"))return!1}),s}rawValue(i,s){let a=i[s],c=i.raws[s];return c&&c.value===a?c.raw:a}root(i){this.body(i),i.raws.after&&this.builder(i.raws.after)}rule(i){this.block(i,this.rawValue(i,"selector")),i.raws.ownSemicolon&&this.builder(i.raws.ownSemicolon,i,"end")}stringify(i,s){if(!this[i.type])throw new Error("Unknown AST node type "+i.type+". Maybe you need to change PostCSS stringifier.");this[i.type](i,s)}}return Wu=n,n.default=n,Wu}var Ju,i1;function nu(){if(i1)return Ju;i1=1;let t=Ov();function e(n,r){new t(r).stringify(n)}return Ju=e,e.default=e,Ju}var _a={},o1;function Xf(){return o1||(o1=1,_a.isClean=Symbol("isClean"),_a.my=Symbol("my")),_a}var Xu,s1;function ru(){if(s1)return Xu;s1=1;let t=Jf(),e=Ov(),n=nu(),{isClean:r,my:i}=Xf();function s(l,u){let d=new l.constructor;for(let f in l){if(!Object.prototype.hasOwnProperty.call(l,f)||f==="proxyCache")continue;let p=l[f],h=typeof p;f==="parent"&&h==="object"?u&&(d[f]=u):f==="source"?d[f]=p:Array.isArray(p)?d[f]=p.map(m=>s(m,d)):(h==="object"&&p!==null&&(p=s(p)),d[f]=p)}return d}function a(l,u){if(u&&typeof u.offset<"u")return u.offset;let d=1,f=1,p=0;for(let h=0;h<l.length;h++){if(f===u.line&&d===u.column){p=h;break}l[h]===`
|
|
115
|
+
`?(d=1,f+=1):d+=1}return p}class c{get proxyOf(){return this}constructor(u={}){this.raws={},this[r]=!1,this[i]=!0;for(let d in u)if(d==="nodes"){this.nodes=[];for(let f of u[d])typeof f.clone=="function"?this.append(f.clone()):this.append(f)}else this[d]=u[d]}addToError(u){if(u.postcssNode=this,u.stack&&this.source&&/\n\s{4}at /.test(u.stack)){let d=this.source;u.stack=u.stack.replace(/\n\s{4}at /,`$&${d.input.from}:${d.start.line}:${d.start.column}$&`)}return u}after(u){return this.parent.insertAfter(this,u),this}assign(u={}){for(let d in u)this[d]=u[d];return this}before(u){return this.parent.insertBefore(this,u),this}cleanRaws(u){delete this.raws.before,delete this.raws.after,u||delete this.raws.between}clone(u={}){let d=s(this);for(let f in u)d[f]=u[f];return d}cloneAfter(u={}){let d=this.clone(u);return this.parent.insertAfter(this,d),d}cloneBefore(u={}){let d=this.clone(u);return this.parent.insertBefore(this,d),d}error(u,d={}){if(this.source){let{end:f,start:p}=this.rangeBy(d);return this.source.input.error(u,{column:p.column,line:p.line},{column:f.column,line:f.line},d)}return new t(u)}getProxyProcessor(){return{get(u,d){return d==="proxyOf"?u:d==="root"?()=>u.root().toProxy():u[d]},set(u,d,f){return u[d]===f||(u[d]=f,(d==="prop"||d==="value"||d==="name"||d==="params"||d==="important"||d==="text")&&u.markDirty()),!0}}}markClean(){this[r]=!0}markDirty(){if(this[r]){this[r]=!1;let u=this;for(;u=u.parent;)u[r]=!1}}next(){if(!this.parent)return;let u=this.parent.index(this);return this.parent.nodes[u+1]}positionBy(u={}){let d=this.source.start;if(u.index)d=this.positionInside(u.index);else if(u.word){let f="document"in this.source.input?this.source.input.document:this.source.input.css,h=f.slice(a(f,this.source.start),a(f,this.source.end)).indexOf(u.word);h!==-1&&(d=this.positionInside(h))}return d}positionInside(u){let d=this.source.start.column,f=this.source.start.line,p="document"in this.source.input?this.source.input.document:this.source.input.css,h=a(p,this.source.start),m=h+u;for(let y=h;y<m;y++)p[y]===`
|
|
116
|
+
`?(d=1,f+=1):d+=1;return{column:d,line:f,offset:m}}prev(){if(!this.parent)return;let u=this.parent.index(this);return this.parent.nodes[u-1]}rangeBy(u={}){let d="document"in this.source.input?this.source.input.document:this.source.input.css,f={column:this.source.start.column,line:this.source.start.line,offset:a(d,this.source.start)},p=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:typeof this.source.end.offset=="number"?this.source.end.offset:a(d,this.source.end)+1}:{column:f.column+1,line:f.line,offset:f.offset+1};if(u.word){let m=d.slice(a(d,this.source.start),a(d,this.source.end)).indexOf(u.word);m!==-1&&(f=this.positionInside(m),p=this.positionInside(m+u.word.length))}else u.start?f={column:u.start.column,line:u.start.line,offset:a(d,u.start)}:u.index&&(f=this.positionInside(u.index)),u.end?p={column:u.end.column,line:u.end.line,offset:a(d,u.end)}:typeof u.endIndex=="number"?p=this.positionInside(u.endIndex):u.index&&(p=this.positionInside(u.index+1));return(p.line<f.line||p.line===f.line&&p.column<=f.column)&&(p={column:f.column+1,line:f.line,offset:f.offset+1}),{end:p,start:f}}raw(u,d){return new e().raw(this,u,d)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...u){if(this.parent){let d=this,f=!1;for(let p of u)p===this?f=!0:f?(this.parent.insertAfter(d,p),d=p):this.parent.insertBefore(d,p);f||this.remove()}return this}root(){let u=this;for(;u.parent&&u.parent.type!=="document";)u=u.parent;return u}toJSON(u,d){let f={},p=d==null;d=d||new Map;let h=0;for(let m in this){if(!Object.prototype.hasOwnProperty.call(this,m)||m==="parent"||m==="proxyCache")continue;let y=this[m];if(Array.isArray(y))f[m]=y.map(w=>typeof w=="object"&&w.toJSON?w.toJSON(null,d):w);else if(typeof y=="object"&&y.toJSON)f[m]=y.toJSON(null,d);else if(m==="source"){if(y==null)continue;let w=d.get(y.input);w==null&&(w=h,d.set(y.input,h),h++),f[m]={end:y.end,inputId:w,start:y.start}}else f[m]=y}return p&&(f.inputs=[...d.keys()].map(m=>m.toJSON())),f}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(u=n){u.stringify&&(u=u.stringify);let d="";return u(this,f=>{d+=f}),d}warn(u,d,f={}){let p={node:this};for(let h in f)p[h]=f[h];return u.warn(d,p)}}return Xu=c,c.default=c,Xu}var Zu,a1;function iu(){if(a1)return Zu;a1=1;let t=ru();class e extends t{constructor(r){super(r),this.type="comment"}}return Zu=e,e.default=e,Zu}var Yu,c1;function ou(){if(c1)return Yu;c1=1;let t=ru();class e extends t{get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}constructor(r){r&&typeof r.value<"u"&&typeof r.value!="string"&&(r={...r,value:String(r.value)}),super(r),this.type="decl"}}return Yu=e,e.default=e,Yu}var Qu,l1;function ai(){if(l1)return Qu;l1=1;let t=iu(),e=ou(),n=ru(),{isClean:r,my:i}=Xf(),s,a,c,l;function u(p){return p.map(h=>(h.nodes&&(h.nodes=u(h.nodes)),delete h.source,h))}function d(p){if(p[r]=!1,p.proxyOf.nodes)for(let h of p.proxyOf.nodes)d(h)}class f extends n{get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}append(...h){for(let m of h){let y=this.normalize(m,this.last);for(let w of y)this.proxyOf.nodes.push(w)}return this.markDirty(),this}cleanRaws(h){if(super.cleanRaws(h),this.nodes)for(let m of this.nodes)m.cleanRaws(h)}each(h){if(!this.proxyOf.nodes)return;let m=this.getIterator(),y,w;for(;this.indexes[m]<this.proxyOf.nodes.length&&(y=this.indexes[m],w=h(this.proxyOf.nodes[y],y),w!==!1);)this.indexes[m]+=1;return delete this.indexes[m],w}every(h){return this.nodes.every(h)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let h=this.lastEach;return this.indexes[h]=0,h}getProxyProcessor(){return{get(h,m){return m==="proxyOf"?h:h[m]?m==="each"||typeof m=="string"&&m.startsWith("walk")?(...y)=>h[m](...y.map(w=>typeof w=="function"?(_,k)=>w(_.toProxy(),k):w)):m==="every"||m==="some"?y=>h[m]((w,..._)=>y(w.toProxy(),..._)):m==="root"?()=>h.root().toProxy():m==="nodes"?h.nodes.map(y=>y.toProxy()):m==="first"||m==="last"?h[m].toProxy():h[m]:h[m]},set(h,m,y){return h[m]===y||(h[m]=y,(m==="name"||m==="params"||m==="selector")&&h.markDirty()),!0}}}index(h){return typeof h=="number"?h:(h.proxyOf&&(h=h.proxyOf),this.proxyOf.nodes.indexOf(h))}insertAfter(h,m){let y=this.index(h),w=this.normalize(m,this.proxyOf.nodes[y]).reverse();y=this.index(h);for(let k of w)this.proxyOf.nodes.splice(y+1,0,k);let _;for(let k in this.indexes)_=this.indexes[k],y<_&&(this.indexes[k]=_+w.length);return this.markDirty(),this}insertBefore(h,m){let y=this.index(h),w=y===0?"prepend":!1,_=this.normalize(m,this.proxyOf.nodes[y],w).reverse();y=this.index(h);for(let v of _)this.proxyOf.nodes.splice(y,0,v);let k;for(let v in this.indexes)k=this.indexes[v],y<=k&&(this.indexes[v]=k+_.length);return this.markDirty(),this}normalize(h,m){if(typeof h=="string")h=u(a(h).nodes);else if(typeof h>"u")h=[];else if(Array.isArray(h)){h=h.slice(0);for(let w of h)w.parent&&w.parent.removeChild(w,"ignore")}else if(h.type==="root"&&this.type!=="document"){h=h.nodes.slice(0);for(let w of h)w.parent&&w.parent.removeChild(w,"ignore")}else if(h.type)h=[h];else if(h.prop){if(typeof h.value>"u")throw new Error("Value field is missed in node creation");typeof h.value!="string"&&(h.value=String(h.value)),h=[new e(h)]}else if(h.selector||h.selectors)h=[new l(h)];else if(h.name)h=[new s(h)];else if(h.text)h=[new t(h)];else throw new Error("Unknown node type in node creation");return h.map(w=>(w[i]||f.rebuild(w),w=w.proxyOf,w.parent&&w.parent.removeChild(w),w[r]&&d(w),w.raws||(w.raws={}),typeof w.raws.before>"u"&&m&&typeof m.raws.before<"u"&&(w.raws.before=m.raws.before.replace(/\S/g,"")),w.parent=this.proxyOf,w))}prepend(...h){h=h.reverse();for(let m of h){let y=this.normalize(m,this.first,"prepend").reverse();for(let w of y)this.proxyOf.nodes.unshift(w);for(let w in this.indexes)this.indexes[w]=this.indexes[w]+y.length}return this.markDirty(),this}push(h){return h.parent=this,this.proxyOf.nodes.push(h),this}removeAll(){for(let h of this.proxyOf.nodes)h.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(h){h=this.index(h),this.proxyOf.nodes[h].parent=void 0,this.proxyOf.nodes.splice(h,1);let m;for(let y in this.indexes)m=this.indexes[y],m>=h&&(this.indexes[y]=m-1);return this.markDirty(),this}replaceValues(h,m,y){return y||(y=m,m={}),this.walkDecls(w=>{m.props&&!m.props.includes(w.prop)||m.fast&&!w.value.includes(m.fast)||(w.value=w.value.replace(h,y))}),this.markDirty(),this}some(h){return this.nodes.some(h)}walk(h){return this.each((m,y)=>{let w;try{w=h(m,y)}catch(_){throw m.addToError(_)}return w!==!1&&m.walk&&(w=m.walk(h)),w})}walkAtRules(h,m){return m?h instanceof RegExp?this.walk((y,w)=>{if(y.type==="atrule"&&h.test(y.name))return m(y,w)}):this.walk((y,w)=>{if(y.type==="atrule"&&y.name===h)return m(y,w)}):(m=h,this.walk((y,w)=>{if(y.type==="atrule")return m(y,w)}))}walkComments(h){return this.walk((m,y)=>{if(m.type==="comment")return h(m,y)})}walkDecls(h,m){return m?h instanceof RegExp?this.walk((y,w)=>{if(y.type==="decl"&&h.test(y.prop))return m(y,w)}):this.walk((y,w)=>{if(y.type==="decl"&&y.prop===h)return m(y,w)}):(m=h,this.walk((y,w)=>{if(y.type==="decl")return m(y,w)}))}walkRules(h,m){return m?h instanceof RegExp?this.walk((y,w)=>{if(y.type==="rule"&&h.test(y.selector))return m(y,w)}):this.walk((y,w)=>{if(y.type==="rule"&&y.selector===h)return m(y,w)}):(m=h,this.walk((y,w)=>{if(y.type==="rule")return m(y,w)}))}}return f.registerParse=p=>{a=p},f.registerRule=p=>{l=p},f.registerAtRule=p=>{s=p},f.registerRoot=p=>{c=p},Qu=f,f.default=f,f.rebuild=p=>{p.type==="atrule"?Object.setPrototypeOf(p,s.prototype):p.type==="rule"?Object.setPrototypeOf(p,l.prototype):p.type==="decl"?Object.setPrototypeOf(p,e.prototype):p.type==="comment"?Object.setPrototypeOf(p,t.prototype):p.type==="root"&&Object.setPrototypeOf(p,c.prototype),p[i]=!0,p.nodes&&p.nodes.forEach(h=>{f.rebuild(h)})},Qu}var ed,u1;function Zf(){if(u1)return ed;u1=1;let t=ai();class e extends t{constructor(r){super(r),this.type="atrule"}append(...r){return this.proxyOf.nodes||(this.nodes=[]),super.append(...r)}prepend(...r){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...r)}}return ed=e,e.default=e,t.registerAtRule(e),ed}var td,d1;function Yf(){if(d1)return td;d1=1;let t=ai(),e,n;class r extends t{constructor(s){super({type:"document",...s}),this.nodes||(this.nodes=[])}toResult(s={}){return new e(new n,this,s).stringify()}}return r.registerLazyResult=i=>{e=i},r.registerProcessor=i=>{n=i},td=r,r.default=r,td}var nd,p1;function PA(){if(p1)return nd;p1=1;let t="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";return nd={nanoid:(r=21)=>{let i="",s=r|0;for(;s--;)i+=t[Math.random()*64|0];return i},customAlphabet:(r,i=21)=>(s=i)=>{let a="",c=s|0;for(;c--;)a+=r[Math.random()*r.length|0];return a}},nd}var rd,f1;function Pv(){if(f1)return rd;f1=1;let{existsSync:t,readFileSync:e}=en,{dirname:n,join:r}=en,{SourceMapConsumer:i,SourceMapGenerator:s}=en;function a(l){return Buffer?Buffer.from(l,"base64").toString():window.atob(l)}class c{constructor(u,d){if(d.map===!1)return;this.loadAnnotation(u),this.inline=this.startWith(this.annotation,"data:");let f=d.map?d.map.prev:void 0,p=this.loadMap(d.from,f);!this.mapFile&&d.from&&(this.mapFile=d.from),this.mapFile&&(this.root=n(this.mapFile)),p&&(this.text=p)}consumer(){return this.consumerCache||(this.consumerCache=new i(this.text)),this.consumerCache}decodeInline(u){let d=/^data:application\/json;charset=utf-?8;base64,/,f=/^data:application\/json;base64,/,p=/^data:application\/json;charset=utf-?8,/,h=/^data:application\/json,/,m=u.match(p)||u.match(h);if(m)return decodeURIComponent(u.substr(m[0].length));let y=u.match(d)||u.match(f);if(y)return a(u.substr(y[0].length));let w=u.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+w)}getAnnotationURL(u){return u.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(u){return typeof u!="object"?!1:typeof u.mappings=="string"||typeof u._mappings=="string"||Array.isArray(u.sections)}loadAnnotation(u){let d=u.match(/\/\*\s*# sourceMappingURL=/g);if(!d)return;let f=u.lastIndexOf(d.pop()),p=u.indexOf("*/",f);f>-1&&p>-1&&(this.annotation=this.getAnnotationURL(u.substring(f,p)))}loadFile(u){if(this.root=n(u),t(u))return this.mapFile=u,e(u,"utf-8").toString().trim()}loadMap(u,d){if(d===!1)return!1;if(d){if(typeof d=="string")return d;if(typeof d=="function"){let f=d(u);if(f){let p=this.loadFile(f);if(!p)throw new Error("Unable to load previous source map: "+f.toString());return p}}else{if(d instanceof i)return s.fromSourceMap(d).toString();if(d instanceof s)return d.toString();if(this.isMap(d))return JSON.stringify(d);throw new Error("Unsupported previous source map format: "+d.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let f=this.annotation;return u&&(f=r(n(u),f)),this.loadFile(f)}}}startWith(u,d){return u?u.substr(0,d.length)===d:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}}return rd=c,c.default=c,rd}var id,h1;function su(){if(h1)return id;h1=1;let{nanoid:t}=PA(),{isAbsolute:e,resolve:n}=en,{SourceMapConsumer:r,SourceMapGenerator:i}=en,{fileURLToPath:s,pathToFileURL:a}=en,c=Jf(),l=Pv(),u=en,d=Symbol("lineToIndexCache"),f=!!(r&&i),p=!!(n&&e);function h(y){if(y[d])return y[d];let w=y.css.split(`
|
|
117
|
+
`),_=new Array(w.length),k=0;for(let v=0,$=w.length;v<$;v++)_[v]=k,k+=w[v].length+1;return y[d]=_,_}class m{get from(){return this.file||this.id}constructor(w,_={}){if(w===null||typeof w>"u"||typeof w=="object"&&!w.toString)throw new Error(`PostCSS received ${w} instead of CSS string`);if(this.css=w.toString(),this.css[0]==="\uFEFF"||this.css[0]===""?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,_.document&&(this.document=_.document.toString()),_.from&&(!p||/^\w+:\/\//.test(_.from)||e(_.from)?this.file=_.from:this.file=n(_.from)),p&&f){let k=new l(this.css,_);if(k.text){this.map=k;let v=k.consumer().file;!this.file&&v&&(this.file=this.mapResolve(v))}}this.file||(this.id="<input css "+t(6)+">"),this.map&&(this.map.file=this.from)}error(w,_,k,v={}){let $,b,z,A,N;if(_&&typeof _=="object"){let L=_,C=k;if(typeof L.offset=="number"){A=L.offset;let P=this.fromOffset(A);_=P.line,k=P.col}else _=L.line,k=L.column,A=this.fromLineAndColumn(_,k);if(typeof C.offset=="number"){z=C.offset;let P=this.fromOffset(z);b=P.line,$=P.col}else b=C.line,$=C.column,z=this.fromLineAndColumn(C.line,C.column)}else if(k)A=this.fromLineAndColumn(_,k);else{A=_;let L=this.fromOffset(A);_=L.line,k=L.col}let O=this.origin(_,k,b,$);return O?N=new c(w,O.endLine===void 0?O.line:{column:O.column,line:O.line},O.endLine===void 0?O.column:{column:O.endColumn,line:O.endLine},O.source,O.file,v.plugin):N=new c(w,b===void 0?_:{column:k,line:_},b===void 0?k:{column:$,line:b},this.css,this.file,v.plugin),N.input={column:k,endColumn:$,endLine:b,endOffset:z,line:_,offset:A,source:this.css},this.file&&(a&&(N.input.url=a(this.file).toString()),N.input.file=this.file),N}fromLineAndColumn(w,_){return h(this)[w-1]+_-1}fromOffset(w){let _=h(this),k=_[_.length-1],v=0;if(w>=k)v=_.length-1;else{let $=_.length-2,b;for(;v<$;)if(b=v+($-v>>1),w<_[b])$=b-1;else if(w>=_[b+1])v=b+1;else{v=b;break}}return{col:w-_[v]+1,line:v+1}}mapResolve(w){return/^\w+:\/\//.test(w)?w:n(this.map.consumer().sourceRoot||this.map.root||".",w)}origin(w,_,k,v){if(!this.map)return!1;let $=this.map.consumer(),b=$.originalPositionFor({column:_,line:w});if(!b.source)return!1;let z;typeof k=="number"&&(z=$.originalPositionFor({column:v,line:k}));let A;e(b.source)?A=a(b.source):A=new URL(b.source,this.map.consumer().sourceRoot||a(this.map.mapFile));let N={column:b.column,endColumn:z&&z.column,endLine:z&&z.line,line:b.line,url:A.toString()};if(A.protocol==="file:")if(s)N.file=s(A);else throw new Error("file: protocol is not available in this PostCSS build");let O=$.sourceContentFor(b.source);return O&&(N.source=O),N}toJSON(){let w={};for(let _ of["hasBOM","css","file","id"])this[_]!=null&&(w[_]=this[_]);return this.map&&(w.map={...this.map},w.map.consumerCache&&(w.map.consumerCache=void 0)),w}}return id=m,m.default=m,u&&u.registerInput&&u.registerInput(m),id}var od,g1;function ea(){if(g1)return od;g1=1;let t=ai(),e,n;class r extends t{constructor(s){super(s),this.type="root",this.nodes||(this.nodes=[])}normalize(s,a,c){let l=super.normalize(s);if(a){if(c==="prepend")this.nodes.length>1?a.raws.before=this.nodes[1].raws.before:delete a.raws.before;else if(this.first!==a)for(let u of l)u.raws.before=a.raws.before}return l}removeChild(s,a){let c=this.index(s);return!a&&c===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[c].raws.before),super.removeChild(s)}toResult(s={}){return new e(new n,this,s).stringify()}}return r.registerLazyResult=i=>{e=i},r.registerProcessor=i=>{n=i},od=r,r.default=r,t.registerRoot(r),od}var sd,m1;function Rv(){if(m1)return sd;m1=1;let t={comma(e){return t.split(e,[","],!0)},space(e){let n=[" ",`
|
|
118
|
+
`," "];return t.split(e,n)},split(e,n,r){let i=[],s="",a=!1,c=0,l=!1,u="",d=!1;for(let f of e)d?d=!1:f==="\\"?d=!0:l?f===u&&(l=!1):f==='"'||f==="'"?(l=!0,u=f):f==="("?c+=1:f===")"?c>0&&(c-=1):c===0&&n.includes(f)&&(a=!0),a?(s!==""&&i.push(s.trim()),s="",a=!1):s+=f;return(r||s!=="")&&i.push(s.trim()),i}};return sd=t,t.default=t,sd}var ad,_1;function Qf(){if(_1)return ad;_1=1;let t=ai(),e=Rv();class n extends t{get selectors(){return e.comma(this.selector)}set selectors(i){let s=this.selector?this.selector.match(/,\s*/):null,a=s?s[0]:","+this.raw("between","beforeOpen");this.selector=i.join(a)}constructor(i){super(i),this.type="rule",this.nodes||(this.nodes=[])}}return ad=n,n.default=n,t.registerRule(n),ad}var cd,y1;function RA(){if(y1)return cd;y1=1;let t=Zf(),e=iu(),n=ou(),r=su(),i=Pv(),s=ea(),a=Qf();function c(l,u){if(Array.isArray(l))return l.map(p=>c(p));let{inputs:d,...f}=l;if(d){u=[];for(let p of d){let h={...p,__proto__:r.prototype};h.map&&(h.map={...h.map,__proto__:i.prototype}),u.push(h)}}if(f.nodes&&(f.nodes=l.nodes.map(p=>c(p,u))),f.source){let{inputId:p,...h}=f.source;f.source=h,p!=null&&(f.source.input=u[p])}if(f.type==="root")return new s(f);if(f.type==="decl")return new n(f);if(f.type==="rule")return new a(f);if(f.type==="comment")return new e(f);if(f.type==="atrule")return new t(f);throw new Error("Unknown node type: "+l.type)}return cd=c,c.default=c,cd}var ld,b1;function Lv(){if(b1)return ld;b1=1;let{dirname:t,relative:e,resolve:n,sep:r}=en,{SourceMapConsumer:i,SourceMapGenerator:s}=en,{pathToFileURL:a}=en,c=su(),l=!!(i&&s),u=!!(t&&n&&e&&r);class d{constructor(p,h,m,y){this.stringify=p,this.mapOpts=m.map||{},this.root=h,this.opts=m,this.css=y,this.originalCSS=y,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let p;this.isInline()?p="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?p=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?p=this.mapOpts.annotation(this.opts.to,this.root):p=this.outputFile()+".map";let h=`
|
|
119
|
+
`;this.css.includes(`\r
|
|
120
|
+
`)&&(h=`\r
|
|
121
|
+
`),this.css+=h+"/*# sourceMappingURL="+p+" */"}applyPrevMaps(){for(let p of this.previous()){let h=this.toUrl(this.path(p.file)),m=p.root||t(p.file),y;this.mapOpts.sourcesContent===!1?(y=new i(p.text),y.sourcesContent&&(y.sourcesContent=null)):y=p.consumer(),this.map.applySourceMap(y,h,this.toUrl(this.path(m)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let p;for(let h=this.root.nodes.length-1;h>=0;h--)p=this.root.nodes[h],p.type==="comment"&&p.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(h)}else this.css&&(this.css=this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),u&&l&&this.isMap())return this.generateMap();{let p="";return this.stringify(this.root,h=>{p+=h}),[p]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let p=this.previous()[0].consumer();p.file=this.outputFile(),this.map=s.fromSourceMap(p,{ignoreInvalidMapping:!0})}else this.map=new s({file:this.outputFile(),ignoreInvalidMapping:!0}),this.map.addMapping({generated:{column:0,line:1},original:{column:0,line:1},source:this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>"});return this.isSourcesContent()&&this.setSourcesContent(),this.root&&this.previous().length>0&&this.applyPrevMaps(),this.isAnnotation()&&this.addAnnotation(),this.isInline()?[this.css]:[this.css,this.map]}generateString(){this.css="",this.map=new s({file:this.outputFile(),ignoreInvalidMapping:!0});let p=1,h=1,m="<no source>",y={generated:{column:0,line:0},original:{column:0,line:0},source:""},w,_;this.stringify(this.root,(k,v,$)=>{if(this.css+=k,v&&$!=="end"&&(y.generated.line=p,y.generated.column=h-1,v.source&&v.source.start?(y.source=this.sourcePath(v),y.original.line=v.source.start.line,y.original.column=v.source.start.column-1,this.map.addMapping(y)):(y.source=m,y.original.line=1,y.original.column=0,this.map.addMapping(y))),_=k.match(/\n/g),_?(p+=_.length,w=k.lastIndexOf(`
|
|
122
|
+
`),h=k.length-w):h+=k.length,v&&$!=="start"){let b=v.parent||{raws:{}};(!(v.type==="decl"||v.type==="atrule"&&!v.nodes)||v!==b.last||b.raws.semicolon)&&(v.source&&v.source.end?(y.source=this.sourcePath(v),y.original.line=v.source.end.line,y.original.column=v.source.end.column-1,y.generated.line=p,y.generated.column=h-2,this.map.addMapping(y)):(y.source=m,y.original.line=1,y.original.column=0,y.generated.line=p,y.generated.column=h-1,this.map.addMapping(y)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(p=>p.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let p=this.mapOpts.annotation;return typeof p<"u"&&p!==!0?!1:this.previous().length?this.previous().some(h=>h.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(p=>p.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(p){if(this.mapOpts.absolute||p.charCodeAt(0)===60||/^\w+:\/\//.test(p))return p;let h=this.memoizedPaths.get(p);if(h)return h;let m=this.opts.to?t(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(m=t(n(m,this.mapOpts.annotation)));let y=e(m,p);return this.memoizedPaths.set(p,y),y}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(p=>{if(p.source&&p.source.input.map){let h=p.source.input.map;this.previousMaps.includes(h)||this.previousMaps.push(h)}});else{let p=new c(this.originalCSS,this.opts);p.map&&this.previousMaps.push(p.map)}return this.previousMaps}setSourcesContent(){let p={};if(this.root)this.root.walk(h=>{if(h.source){let m=h.source.input.from;if(m&&!p[m]){p[m]=!0;let y=this.usesFileUrls?this.toFileUrl(m):this.toUrl(this.path(m));this.map.setSourceContent(y,h.source.input.css)}}});else if(this.css){let h=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(h,this.css)}}sourcePath(p){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(p.source.input.from):this.toUrl(this.path(p.source.input.from))}toBase64(p){return Buffer?Buffer.from(p).toString("base64"):window.btoa(unescape(encodeURIComponent(p)))}toFileUrl(p){let h=this.memoizedFileURLs.get(p);if(h)return h;if(a){let m=a(p).toString();return this.memoizedFileURLs.set(p,m),m}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(p){let h=this.memoizedURLs.get(p);if(h)return h;r==="\\"&&(p=p.replace(/\\/g,"/"));let m=encodeURI(p).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(p,m),m}}return ld=d,ld}var ud,w1;function LA(){if(w1)return ud;w1=1;const t=39,e=34,n=92,r=47,i=10,s=32,a=12,c=9,l=13,u=91,d=93,f=40,p=41,h=123,m=125,y=59,w=42,_=58,k=64,v=/[\t\n\f\r "#'()/;[\\\]{}]/g,$=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,b=/.[\r\n"'(/\\]/,z=/[\da-f]/i;return ud=function(N,O={}){let L=N.css.valueOf(),C=O.ignoreErrors,P,M,K,B,oe,ae,se,ve,Ce,Ne,We=L.length,F=0,Be=[],Mt=[];function le(){return F}function St(D){throw N.error("Unclosed "+D,F)}function po(){return Mt.length===0&&F>=We}function ci(D){if(Mt.length)return Mt.pop();if(F>=We)return;let Z=D?D.ignoreUnclosed:!1;switch(P=L.charCodeAt(F),P){case i:case s:case c:case l:case a:{B=F;do B+=1,P=L.charCodeAt(B);while(P===s||P===i||P===c||P===l||P===a);ae=["space",L.slice(F,B)],F=B-1;break}case u:case d:case h:case m:case _:case y:case p:{let V=String.fromCharCode(P);ae=[V,V,F];break}case f:{if(Ne=Be.length?Be.pop()[1]:"",Ce=L.charCodeAt(F+1),Ne==="url"&&Ce!==t&&Ce!==e&&Ce!==s&&Ce!==i&&Ce!==c&&Ce!==a&&Ce!==l){B=F;do{if(se=!1,B=L.indexOf(")",B+1),B===-1)if(C||Z){B=F;break}else St("bracket");for(ve=B;L.charCodeAt(ve-1)===n;)ve-=1,se=!se}while(se);ae=["brackets",L.slice(F,B+1),F,B],F=B}else B=L.indexOf(")",F+1),M=L.slice(F,B+1),B===-1||b.test(M)?ae=["(","(",F]:(ae=["brackets",M,F,B],F=B);break}case t:case e:{oe=P===t?"'":'"',B=F;do{if(se=!1,B=L.indexOf(oe,B+1),B===-1)if(C||Z){B=F+1;break}else St("string");for(ve=B;L.charCodeAt(ve-1)===n;)ve-=1,se=!se}while(se);ae=["string",L.slice(F,B+1),F,B],F=B;break}case k:{v.lastIndex=F+1,v.test(L),v.lastIndex===0?B=L.length-1:B=v.lastIndex-2,ae=["at-word",L.slice(F,B+1),F,B],F=B;break}case n:{for(B=F,K=!0;L.charCodeAt(B+1)===n;)B+=1,K=!K;if(P=L.charCodeAt(B+1),K&&P!==r&&P!==s&&P!==i&&P!==c&&P!==l&&P!==a&&(B+=1,z.test(L.charAt(B)))){for(;z.test(L.charAt(B+1));)B+=1;L.charCodeAt(B+1)===s&&(B+=1)}ae=["word",L.slice(F,B+1),F,B],F=B;break}default:{P===r&&L.charCodeAt(F+1)===w?(B=L.indexOf("*/",F+2)+1,B===0&&(C||Z?B=L.length:St("comment")),ae=["comment",L.slice(F,B+1),F,B],F=B):($.lastIndex=F+1,$.test(L),$.lastIndex===0?B=L.length-1:B=$.lastIndex-2,ae=["word",L.slice(F,B+1),F,B],Be.push(ae),F=B);break}}return F++,ae}function li(D){Mt.push(D)}return{back:li,endOfFile:po,nextToken:ci,position:le}},ud}var dd,v1;function BA(){if(v1)return dd;v1=1;let t=Zf(),e=iu(),n=ou(),r=ea(),i=Qf(),s=LA();const a={empty:!0,space:!0};function c(u){for(let d=u.length-1;d>=0;d--){let f=u[d],p=f[3]||f[2];if(p)return p}}class l{constructor(d){this.input=d,this.root=new r,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:d,start:{column:1,line:1,offset:0}}}atrule(d){let f=new t;f.name=d[1].slice(1),f.name===""&&this.unnamedAtrule(f,d),this.init(f,d[2]);let p,h,m,y=!1,w=!1,_=[],k=[];for(;!this.tokenizer.endOfFile();){if(d=this.tokenizer.nextToken(),p=d[0],p==="("||p==="["?k.push(p==="("?")":"]"):p==="{"&&k.length>0?k.push("}"):p===k[k.length-1]&&k.pop(),k.length===0)if(p===";"){f.source.end=this.getPosition(d[2]),f.source.end.offset++,this.semicolon=!0;break}else if(p==="{"){w=!0;break}else if(p==="}"){if(_.length>0){for(m=_.length-1,h=_[m];h&&h[0]==="space";)h=_[--m];h&&(f.source.end=this.getPosition(h[3]||h[2]),f.source.end.offset++)}this.end(d);break}else _.push(d);else _.push(d);if(this.tokenizer.endOfFile()){y=!0;break}}f.raws.between=this.spacesAndCommentsFromEnd(_),_.length?(f.raws.afterName=this.spacesAndCommentsFromStart(_),this.raw(f,"params",_),y&&(d=_[_.length-1],f.source.end=this.getPosition(d[3]||d[2]),f.source.end.offset++,this.spaces=f.raws.between,f.raws.between="")):(f.raws.afterName="",f.params=""),w&&(f.nodes=[],this.current=f)}checkMissedSemicolon(d){let f=this.colon(d);if(f===!1)return;let p=0,h;for(let m=f-1;m>=0&&(h=d[m],!(h[0]!=="space"&&(p+=1,p===2)));m--);throw this.input.error("Missed semicolon",h[0]==="word"?h[3]+1:h[2])}colon(d){let f=0,p,h,m;for(let[y,w]of d.entries()){if(h=w,m=h[0],m==="("&&(f+=1),m===")"&&(f-=1),f===0&&m===":")if(!p)this.doubleColon(h);else{if(p[0]==="word"&&p[1]==="progid")continue;return y}p=h}return!1}comment(d){let f=new e;this.init(f,d[2]),f.source.end=this.getPosition(d[3]||d[2]),f.source.end.offset++;let p=d[1].slice(2,-2);if(/^\s*$/.test(p))f.text="",f.raws.left=p,f.raws.right="";else{let h=p.match(/^(\s*)([^]*\S)(\s*)$/);f.text=h[2],f.raws.left=h[1],f.raws.right=h[3]}}createTokenizer(){this.tokenizer=s(this.input)}decl(d,f){let p=new n;this.init(p,d[0][2]);let h=d[d.length-1];for(h[0]===";"&&(this.semicolon=!0,d.pop()),p.source.end=this.getPosition(h[3]||h[2]||c(d)),p.source.end.offset++;d[0][0]!=="word";)d.length===1&&this.unknownWord(d),p.raws.before+=d.shift()[1];for(p.source.start=this.getPosition(d[0][2]),p.prop="";d.length;){let k=d[0][0];if(k===":"||k==="space"||k==="comment")break;p.prop+=d.shift()[1]}p.raws.between="";let m;for(;d.length;)if(m=d.shift(),m[0]===":"){p.raws.between+=m[1];break}else m[0]==="word"&&/\w/.test(m[1])&&this.unknownWord([m]),p.raws.between+=m[1];(p.prop[0]==="_"||p.prop[0]==="*")&&(p.raws.before+=p.prop[0],p.prop=p.prop.slice(1));let y=[],w;for(;d.length&&(w=d[0][0],!(w!=="space"&&w!=="comment"));)y.push(d.shift());this.precheckMissedSemicolon(d);for(let k=d.length-1;k>=0;k--){if(m=d[k],m[1].toLowerCase()==="!important"){p.important=!0;let v=this.stringFrom(d,k);v=this.spacesFromEnd(d)+v,v!==" !important"&&(p.raws.important=v);break}else if(m[1].toLowerCase()==="important"){let v=d.slice(0),$="";for(let b=k;b>0;b--){let z=v[b][0];if($.trim().startsWith("!")&&z!=="space")break;$=v.pop()[1]+$}$.trim().startsWith("!")&&(p.important=!0,p.raws.important=$,d=v)}if(m[0]!=="space"&&m[0]!=="comment")break}d.some(k=>k[0]!=="space"&&k[0]!=="comment")&&(p.raws.between+=y.map(k=>k[1]).join(""),y=[]),this.raw(p,"value",y.concat(d),f),p.value.includes(":")&&!f&&this.checkMissedSemicolon(d)}doubleColon(d){throw this.input.error("Double colon",{offset:d[2]},{offset:d[2]+d[1].length})}emptyRule(d){let f=new i;this.init(f,d[2]),f.selector="",f.raws.between="",this.current=f}end(d){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(d[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(d)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(d){if(this.spaces+=d[1],this.current.nodes){let f=this.current.nodes[this.current.nodes.length-1];f&&f.type==="rule"&&!f.raws.ownSemicolon&&(f.raws.ownSemicolon=this.spaces,this.spaces="",f.source.end=this.getPosition(d[2]),f.source.end.offset+=f.raws.ownSemicolon.length)}}getPosition(d){let f=this.input.fromOffset(d);return{column:f.col,line:f.line,offset:d}}init(d,f){this.current.push(d),d.source={input:this.input,start:this.getPosition(f)},d.raws.before=this.spaces,this.spaces="",d.type!=="comment"&&(this.semicolon=!1)}other(d){let f=!1,p=null,h=!1,m=null,y=[],w=d[1].startsWith("--"),_=[],k=d;for(;k;){if(p=k[0],_.push(k),p==="("||p==="[")m||(m=k),y.push(p==="("?")":"]");else if(w&&h&&p==="{")m||(m=k),y.push("}");else if(y.length===0)if(p===";")if(h){this.decl(_,w);return}else break;else if(p==="{"){this.rule(_);return}else if(p==="}"){this.tokenizer.back(_.pop()),f=!0;break}else p===":"&&(h=!0);else p===y[y.length-1]&&(y.pop(),y.length===0&&(m=null));k=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(f=!0),y.length>0&&this.unclosedBracket(m),f&&h){if(!w)for(;_.length&&(k=_[_.length-1][0],!(k!=="space"&&k!=="comment"));)this.tokenizer.back(_.pop());this.decl(_,w)}else this.unknownWord(_)}parse(){let d;for(;!this.tokenizer.endOfFile();)switch(d=this.tokenizer.nextToken(),d[0]){case"space":this.spaces+=d[1];break;case";":this.freeSemicolon(d);break;case"}":this.end(d);break;case"comment":this.comment(d);break;case"at-word":this.atrule(d);break;case"{":this.emptyRule(d);break;default:this.other(d);break}this.endFile()}precheckMissedSemicolon(){}raw(d,f,p,h){let m,y,w=p.length,_="",k=!0,v,$;for(let b=0;b<w;b+=1)m=p[b],y=m[0],y==="space"&&b===w-1&&!h?k=!1:y==="comment"?($=p[b-1]?p[b-1][0]:"empty",v=p[b+1]?p[b+1][0]:"empty",!a[$]&&!a[v]?_.slice(-1)===","?k=!1:_+=m[1]:k=!1):_+=m[1];if(!k){let b=p.reduce((z,A)=>z+A[1],"");d.raws[f]={raw:b,value:_}}d[f]=_}rule(d){d.pop();let f=new i;this.init(f,d[0][2]),f.raws.between=this.spacesAndCommentsFromEnd(d),this.raw(f,"selector",d),this.current=f}spacesAndCommentsFromEnd(d){let f,p="";for(;d.length&&(f=d[d.length-1][0],!(f!=="space"&&f!=="comment"));)p=d.pop()[1]+p;return p}spacesAndCommentsFromStart(d){let f,p="";for(;d.length&&(f=d[0][0],!(f!=="space"&&f!=="comment"));)p+=d.shift()[1];return p}spacesFromEnd(d){let f,p="";for(;d.length&&(f=d[d.length-1][0],f==="space");)p=d.pop()[1]+p;return p}stringFrom(d,f){let p="";for(let h=f;h<d.length;h++)p+=d[h][1];return d.splice(f,d.length-f),p}unclosedBlock(){let d=this.current.source.start;throw this.input.error("Unclosed block",d.line,d.column)}unclosedBracket(d){throw this.input.error("Unclosed bracket",{offset:d[2]},{offset:d[2]+1})}unexpectedClose(d){throw this.input.error("Unexpected }",{offset:d[2]},{offset:d[2]+1})}unknownWord(d){throw this.input.error("Unknown word "+d[0][1],{offset:d[0][2]},{offset:d[0][2]+d[0][1].length})}unnamedAtrule(d,f){throw this.input.error("At-rule without name",{offset:f[2]},{offset:f[2]+f[1].length})}}return dd=l,dd}var pd,x1;function eh(){if(x1)return pd;x1=1;let t=ai(),e=su(),n=BA();function r(i,s){let a=new e(i,s),c=new n(a);try{c.parse()}catch(l){throw process.env.NODE_ENV!=="production"&&l.name==="CssSyntaxError"&&s&&s.from&&(/\.scss$/i.test(s.from)?l.message+=`
|
|
123
|
+
You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`:/\.sass/i.test(s.from)?l.message+=`
|
|
124
|
+
You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`:/\.less$/i.test(s.from)&&(l.message+=`
|
|
125
|
+
You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),l}return c.root}return pd=r,r.default=r,t.registerParse(r),pd}var fd,k1;function Bv(){if(k1)return fd;k1=1;class t{constructor(n,r={}){if(this.type="warning",this.text=n,r.node&&r.node.source){let i=r.node.rangeBy(r);this.line=i.start.line,this.column=i.start.column,this.endLine=i.end.line,this.endColumn=i.end.column}for(let i in r)this[i]=r[i]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}}return fd=t,t.default=t,fd}var hd,$1;function th(){if($1)return hd;$1=1;let t=Bv();class e{get content(){return this.css}constructor(r,i,s){this.processor=r,this.messages=[],this.root=i,this.opts=s,this.css="",this.map=void 0}toString(){return this.css}warn(r,i={}){i.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(i.plugin=this.lastPlugin.postcssPlugin);let s=new t(r,i);return this.messages.push(s),s}warnings(){return this.messages.filter(r=>r.type==="warning")}}return hd=e,e.default=e,hd}var gd,S1;function Dv(){if(S1)return gd;S1=1;let t={};return gd=function(n){t[n]||(t[n]=!0,typeof console<"u"&&console.warn&&console.warn(n))},gd}var md,z1;function Uv(){if(z1)return md;z1=1;let t=ai(),e=Yf(),n=Lv(),r=eh(),i=th(),s=ea(),a=nu(),{isClean:c,my:l}=Xf(),u=Dv();const d={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},f={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},p={Once:!0,postcssPlugin:!0,prepare:!0},h=0;function m($){return typeof $=="object"&&typeof $.then=="function"}function y($){let b=!1,z=d[$.type];return $.type==="decl"?b=$.prop.toLowerCase():$.type==="atrule"&&(b=$.name.toLowerCase()),b&&$.append?[z,z+"-"+b,h,z+"Exit",z+"Exit-"+b]:b?[z,z+"-"+b,z+"Exit",z+"Exit-"+b]:$.append?[z,h,z+"Exit"]:[z,z+"Exit"]}function w($){let b;return $.type==="document"?b=["Document",h,"DocumentExit"]:$.type==="root"?b=["Root",h,"RootExit"]:b=y($),{eventIndex:0,events:b,iterator:0,node:$,visitorIndex:0,visitors:[]}}function _($){return $[c]=!1,$.nodes&&$.nodes.forEach(b=>_(b)),$}let k={};class v{get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}constructor(b,z,A){this.stringified=!1,this.processed=!1;let N;if(typeof z=="object"&&z!==null&&(z.type==="root"||z.type==="document"))N=_(z);else if(z instanceof v||z instanceof i)N=_(z.root),z.map&&(typeof A.map>"u"&&(A.map={}),A.map.inline||(A.map.inline=!1),A.map.prev=z.map);else{let O=r;A.syntax&&(O=A.syntax.parse),A.parser&&(O=A.parser),O.parse&&(O=O.parse);try{N=O(z,A)}catch(L){this.processed=!0,this.error=L}N&&!N[l]&&t.rebuild(N)}this.result=new i(b,N,A),this.helpers={...k,postcss:k,result:this.result},this.plugins=this.processor.plugins.map(O=>typeof O=="object"&&O.prepare?{...O,...O.prepare(this.result)}:O)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(b){return this.async().catch(b)}finally(b){return this.async().then(b,b)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(b,z){let A=this.result.lastPlugin;try{if(z&&z.addToError(b),this.error=b,b.name==="CssSyntaxError"&&!b.plugin)b.plugin=A.postcssPlugin,b.setMessage();else if(A.postcssVersion&&process.env.NODE_ENV!=="production"){let N=A.postcssPlugin,O=A.postcssVersion,L=this.result.processor.version,C=O.split("."),P=L.split(".");(C[0]!==P[0]||parseInt(C[1])>parseInt(P[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+L+", but "+N+" uses "+O+". Perhaps this is the source of the error below.")}}catch(N){console&&console.error&&console.error(N)}return b}prepareVisitors(){this.listeners={};let b=(z,A,N)=>{this.listeners[A]||(this.listeners[A]=[]),this.listeners[A].push([z,N])};for(let z of this.plugins)if(typeof z=="object")for(let A in z){if(!f[A]&&/^[A-Z]/.test(A))throw new Error(`Unknown event ${A} in ${z.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!p[A])if(typeof z[A]=="object")for(let N in z[A])N==="*"?b(z,A,z[A][N]):b(z,A+"-"+N.toLowerCase(),z[A][N]);else typeof z[A]=="function"&&b(z,A,z[A])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let b=0;b<this.plugins.length;b++){let z=this.plugins[b],A=this.runOnRoot(z);if(m(A))try{await A}catch(N){throw this.handleError(N)}}if(this.prepareVisitors(),this.hasListener){let b=this.result.root;for(;!b[c];){b[c]=!0;let z=[w(b)];for(;z.length>0;){let A=this.visitTick(z);if(m(A))try{await A}catch(N){let O=z[z.length-1].node;throw this.handleError(N,O)}}}if(this.listeners.OnceExit)for(let[z,A]of this.listeners.OnceExit){this.result.lastPlugin=z;try{if(b.type==="document"){let N=b.nodes.map(O=>A(O,this.helpers));await Promise.all(N)}else await A(b,this.helpers)}catch(N){throw this.handleError(N)}}}return this.processed=!0,this.stringify()}runOnRoot(b){this.result.lastPlugin=b;try{if(typeof b=="object"&&b.Once){if(this.result.root.type==="document"){let z=this.result.root.nodes.map(A=>b.Once(A,this.helpers));return m(z[0])?Promise.all(z):z}return b.Once(this.result.root,this.helpers)}else if(typeof b=="function")return b(this.result.root,this.result)}catch(z){throw this.handleError(z)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let b=this.result.opts,z=a;b.syntax&&(z=b.syntax.stringify),b.stringifier&&(z=b.stringifier),z.stringify&&(z=z.stringify);let N=new n(z,this.result.root,this.result.opts).generate();return this.result.css=N[0],this.result.map=N[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let b of this.plugins){let z=this.runOnRoot(b);if(m(z))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let b=this.result.root;for(;!b[c];)b[c]=!0,this.walkSync(b);if(this.listeners.OnceExit)if(b.type==="document")for(let z of b.nodes)this.visitSync(this.listeners.OnceExit,z);else this.visitSync(this.listeners.OnceExit,b)}return this.result}then(b,z){return process.env.NODE_ENV!=="production"&&("from"in this.opts||u("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(b,z)}toString(){return this.css}visitSync(b,z){for(let[A,N]of b){this.result.lastPlugin=A;let O;try{O=N(z,this.helpers)}catch(L){throw this.handleError(L,z.proxyOf)}if(z.type!=="root"&&z.type!=="document"&&!z.parent)return!0;if(m(O))throw this.getAsyncError()}}visitTick(b){let z=b[b.length-1],{node:A,visitors:N}=z;if(A.type!=="root"&&A.type!=="document"&&!A.parent){b.pop();return}if(N.length>0&&z.visitorIndex<N.length){let[L,C]=N[z.visitorIndex];z.visitorIndex+=1,z.visitorIndex===N.length&&(z.visitors=[],z.visitorIndex=0),this.result.lastPlugin=L;try{return C(A.toProxy(),this.helpers)}catch(P){throw this.handleError(P,A)}}if(z.iterator!==0){let L=z.iterator,C;for(;C=A.nodes[A.indexes[L]];)if(A.indexes[L]+=1,!C[c]){C[c]=!0,b.push(w(C));return}z.iterator=0,delete A.indexes[L]}let O=z.events;for(;z.eventIndex<O.length;){let L=O[z.eventIndex];if(z.eventIndex+=1,L===h){A.nodes&&A.nodes.length&&(A[c]=!0,z.iterator=A.getIterator());return}else if(this.listeners[L]){z.visitors=this.listeners[L];return}}b.pop()}walkSync(b){b[c]=!0;let z=y(b);for(let A of z)if(A===h)b.nodes&&b.each(N=>{N[c]||this.walkSync(N)});else{let N=this.listeners[A];if(N&&this.visitSync(N,b.toProxy()))return}}warnings(){return this.sync().warnings()}}return v.registerPostcss=$=>{k=$},md=v,v.default=v,s.registerLazyResult(v),e.registerLazyResult(v),md}var _d,A1;function DA(){if(A1)return _d;A1=1;let t=Lv(),e=eh();const n=th();let r=nu(),i=Dv();class s{get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let c,l=e;try{c=l(this._css,this._opts)}catch(u){this.error=u}if(this.error)throw this.error;return this._root=c,c}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(c,l,u){l=l.toString(),this.stringified=!1,this._processor=c,this._css=l,this._opts=u,this._map=void 0;let d,f=r;this.result=new n(this._processor,d,this._opts),this.result.css=l;let p=this;Object.defineProperty(this.result,"root",{get(){return p.root}});let h=new t(f,d,this._opts,l);if(h.isMap()){let[m,y]=h.generate();m&&(this.result.css=m),y&&(this.result.map=y)}else h.clearAnnotation(),this.result.css=h.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(c){return this.async().catch(c)}finally(c){return this.async().then(c,c)}sync(){if(this.error)throw this.error;return this.result}then(c,l){return process.env.NODE_ENV!=="production"&&("from"in this._opts||i("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(c,l)}toString(){return this._css}warnings(){return[]}}return _d=s,s.default=s,_d}var yd,E1;function UA(){if(E1)return yd;E1=1;let t=Yf(),e=Uv(),n=DA(),r=ea();class i{constructor(a=[]){this.version="8.5.6",this.plugins=this.normalize(a)}normalize(a){let c=[];for(let l of a)if(l.postcss===!0?l=l():l.postcss&&(l=l.postcss),typeof l=="object"&&Array.isArray(l.plugins))c=c.concat(l.plugins);else if(typeof l=="object"&&l.postcssPlugin)c.push(l);else if(typeof l=="function")c.push(l);else if(typeof l=="object"&&(l.parse||l.stringify)){if(process.env.NODE_ENV!=="production")throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}else throw new Error(l+" is not a PostCSS plugin");return c}process(a,c={}){return!this.plugins.length&&!c.parser&&!c.stringifier&&!c.syntax?new n(this,a,c):new e(this,a,c)}use(a){return this.plugins=this.plugins.concat(this.normalize([a])),this}}return yd=i,i.default=i,r.registerProcessor(i),t.registerProcessor(i),yd}var bd,C1;function MA(){if(C1)return bd;C1=1;let t=Zf(),e=iu(),n=ai(),r=Jf(),i=ou(),s=Yf(),a=RA(),c=su(),l=Uv(),u=Rv(),d=ru(),f=eh(),p=UA(),h=th(),m=ea(),y=Qf(),w=nu(),_=Bv();function k(...v){return v.length===1&&Array.isArray(v[0])&&(v=v[0]),new p(v)}return k.plugin=function($,b){let z=!1;function A(...O){console&&console.warn&&!z&&(z=!0,console.warn($+`: postcss.plugin was deprecated. Migration guide:
|
|
126
|
+
https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn($+`: 里面 postcss.plugin 被弃用. 迁移指南:
|
|
127
|
+
https://www.w3ctech.com/topic/2226`));let L=b(...O);return L.postcssPlugin=$,L.postcssVersion=new p().version,L}let N;return Object.defineProperty(A,"postcss",{get(){return N||(N=A()),N}}),A.process=function(O,L,C){return k([A(C)]).process(O,L)},A},k.stringify=w,k.parse=f,k.fromJSON=a,k.list=u,k.comment=v=>new e(v),k.atRule=v=>new t(v),k.decl=v=>new i(v),k.rule=v=>new y(v),k.root=v=>new m(v),k.document=v=>new s(v),k.CssSyntaxError=r,k.Declaration=i,k.Container=n,k.Processor=p,k.Document=s,k.Comment=e,k.Warning=_,k.AtRule=t,k.Result=h,k.Input=c,k.Rule=y,k.Root=m,k.Node=d,l.registerPostcss(k),bd=k,k.default=k,bd}var wd,N1;function qA(){if(N1)return wd;N1=1;const t=EA(),e=CA(),{isPlainObject:n}=NA(),r=IA(),i=TA(),{parse:s}=MA(),a=["img","audio","video","picture","svg","object","map","iframe","embed"],c=["script","style"];function l(w,_){w&&Object.keys(w).forEach(function(k){_(w[k],k)})}function u(w,_){return{}.hasOwnProperty.call(w,_)}function d(w,_){const k=[];return l(w,function(v){_(v)&&k.push(v)}),k}function f(w){for(const _ in w)if(u(w,_))return!1;return!0}function p(w){return w.map(function(_){if(!_.url)throw new Error("URL missing");return _.url+(_.w?` ${_.w}w`:"")+(_.h?` ${_.h}h`:"")+(_.d?` ${_.d}x`:"")}).join(", ")}wd=m;const h=/^[^\0\t\n\f\r /<=>]+$/;function m(w,_,k){if(w==null)return"";typeof w=="number"&&(w=w.toString());let v="",$="";function b(D,Z){const V=this;this.tag=D,this.attribs=Z||{},this.tagPosition=v.length,this.text="",this.openingTagLength=0,this.mediaChildren=[],this.updateParentNodeText=function(){if(oe.length){const pe=oe[oe.length-1];pe.text+=V.text}},this.updateParentNodeMediaChildren=function(){oe.length&&a.includes(this.tag)&&oe[oe.length-1].mediaChildren.push(this.tag)}}_=Object.assign({},m.defaults,_),_.parser=Object.assign({},y,_.parser);const z=function(D){return _.allowedTags===!1||(_.allowedTags||[]).indexOf(D)>-1};c.forEach(function(D){z(D)&&!_.allowVulnerableTags&&console.warn(`
|
|
128
|
+
|
|
129
|
+
⚠️ Your \`allowedTags\` option includes, \`${D}\`, which is inherently
|
|
130
|
+
vulnerable to XSS attacks. Please remove it from \`allowedTags\`.
|
|
131
|
+
Or, to disable this warning, add the \`allowVulnerableTags\` option
|
|
132
|
+
and ensure you are accounting for this risk.
|
|
133
|
+
|
|
134
|
+
`)});const A=_.nonTextTags||["script","style","textarea","option"];let N,O;_.allowedAttributes&&(N={},O={},l(_.allowedAttributes,function(D,Z){N[Z]=[];const V=[];D.forEach(function(pe){typeof pe=="string"&&pe.indexOf("*")>=0?V.push(e(pe).replace(/\\\*/g,".*")):N[Z].push(pe)}),V.length&&(O[Z]=new RegExp("^("+V.join("|")+")$"))}));const L={},C={},P={};l(_.allowedClasses,function(D,Z){if(N&&(u(N,Z)||(N[Z]=[]),N[Z].push("class")),L[Z]=D,Array.isArray(D)){const V=[];L[Z]=[],P[Z]=[],D.forEach(function(pe){typeof pe=="string"&&pe.indexOf("*")>=0?V.push(e(pe).replace(/\\\*/g,".*")):pe instanceof RegExp?P[Z].push(pe):L[Z].push(pe)}),V.length&&(C[Z]=new RegExp("^("+V.join("|")+")$"))}});const M={};let K;l(_.transformTags,function(D,Z){let V;typeof D=="function"?V=D:typeof D=="string"&&(V=m.simpleTransform(D)),Z==="*"?K=V:M[Z]=V});let B,oe,ae,se,ve,Ce,Ne=!1;F();const We=new t.Parser({onopentag:function(D,Z){if(_.onOpenTag&&_.onOpenTag(D,Z),_.enforceHtmlBoundary&&D==="html"&&F(),ve){Ce++;return}const V=new b(D,Z);oe.push(V);let pe=!1;const Je=!!V.text;let Xe;if(u(M,D)&&(Xe=M[D](D,Z),V.attribs=Z=Xe.attribs,Xe.text!==void 0&&(V.innerText=Xe.text),D!==Xe.tagName&&(V.name=D=Xe.tagName,se[B]=Xe.tagName)),K&&(Xe=K(D,Z),V.attribs=Z=Xe.attribs,D!==Xe.tagName&&(V.name=D=Xe.tagName,se[B]=Xe.tagName)),(!z(D)||_.disallowedTagsMode==="recursiveEscape"&&!f(ae)||_.nestingLimit!=null&&B>=_.nestingLimit)&&(pe=!0,ae[B]=!0,(_.disallowedTagsMode==="discard"||_.disallowedTagsMode==="completelyDiscard")&&A.indexOf(D)!==-1&&(ve=!0,Ce=1)),B++,pe){if(_.disallowedTagsMode==="discard"||_.disallowedTagsMode==="completelyDiscard"){if(V.innerText&&!Je){const ze=Be(V.innerText);_.textFilter?v+=_.textFilter(ze,D):v+=ze,Ne=!0}return}$=v,v=""}v+="<"+D,D==="script"&&(_.allowedScriptHostnames||_.allowedScriptDomains)&&(V.innerText=""),pe&&(_.disallowedTagsMode==="escape"||_.disallowedTagsMode==="recursiveEscape")&&_.preserveEscapedAttributes?l(Z,function(ze,ke){v+=" "+ke+'="'+Be(ze||"",!0)+'"'}):(!N||u(N,D)||N["*"])&&l(Z,function(ze,ke){if(!h.test(ke)){delete V.attribs[ke];return}if(ze===""&&!_.allowedEmptyAttributes.includes(ke)&&(_.nonBooleanAttributes.includes(ke)||_.nonBooleanAttributes.includes("*"))){delete V.attribs[ke];return}let ui=!1;if(!N||u(N,D)&&N[D].indexOf(ke)!==-1||N["*"]&&N["*"].indexOf(ke)!==-1||u(O,D)&&O[D].test(ke)||O["*"]&&O["*"].test(ke))ui=!0;else if(N&&N[D]){for(const $e of N[D])if(n($e)&&$e.name&&$e.name===ke){ui=!0;let Ae="";if($e.multiple===!0){const Nn=ze.split(" ");for(const qt of Nn)$e.values.indexOf(qt)!==-1&&(Ae===""?Ae=qt:Ae+=" "+qt)}else $e.values.indexOf(ze)>=0&&(Ae=ze);ze=Ae}}if(ui){if(_.allowedSchemesAppliedToAttributes.indexOf(ke)!==-1&&Mt(D,ze)){delete V.attribs[ke];return}if(D==="script"&&ke==="src"){let $e=!0;try{const Ae=le(ze);if(_.allowedScriptHostnames||_.allowedScriptDomains){const Nn=(_.allowedScriptHostnames||[]).find(function(zt){return zt===Ae.url.hostname}),qt=(_.allowedScriptDomains||[]).find(function(zt){return Ae.url.hostname===zt||Ae.url.hostname.endsWith(`.${zt}`)});$e=Nn||qt}}catch{$e=!1}if(!$e){delete V.attribs[ke];return}}if(D==="iframe"&&ke==="src"){let $e=!0;try{const Ae=le(ze);if(Ae.isRelativeUrl)$e=u(_,"allowIframeRelativeUrls")?_.allowIframeRelativeUrls:!_.allowedIframeHostnames&&!_.allowedIframeDomains;else if(_.allowedIframeHostnames||_.allowedIframeDomains){const Nn=(_.allowedIframeHostnames||[]).find(function(zt){return zt===Ae.url.hostname}),qt=(_.allowedIframeDomains||[]).find(function(zt){return Ae.url.hostname===zt||Ae.url.hostname.endsWith(`.${zt}`)});$e=Nn||qt}}catch{$e=!1}if(!$e){delete V.attribs[ke];return}}if(ke==="srcset")try{let $e=i(ze);if($e.forEach(function(Ae){Mt("srcset",Ae.url)&&(Ae.evil=!0)}),$e=d($e,function(Ae){return!Ae.evil}),$e.length)ze=p(d($e,function(Ae){return!Ae.evil})),V.attribs[ke]=ze;else{delete V.attribs[ke];return}}catch{delete V.attribs[ke];return}if(ke==="class"){const $e=L[D],Ae=L["*"],Nn=C[D],qt=P[D],zt=P["*"],wr=C["*"],ta=[Nn,wr].concat(qt,zt).filter(function(uu){return uu});if($e&&Ae?ze=li(ze,r($e,Ae),ta):ze=li(ze,$e||Ae,ta),!ze.length){delete V.attribs[ke];return}}if(ke==="style"){if(_.parseStyleAttributes)try{const $e=s(D+" {"+ze+"}",{map:!1}),Ae=St($e,_.allowedStyles);if(ze=po(Ae),ze.length===0){delete V.attribs[ke];return}}catch{typeof window<"u"&&console.warn('Failed to parse "'+D+" {"+ze+`}", If you're running this in a browser, we recommend to disable style parsing: options.parseStyleAttributes: false, since this only works in a node environment due to a postcss dependency, More info: https://github.com/apostrophecms/sanitize-html/issues/547`),delete V.attribs[ke];return}else if(_.allowedStyles)throw new Error("allowedStyles option cannot be used together with parseStyleAttributes: false.")}v+=" "+ke,ze&&ze.length?v+='="'+Be(ze,!0)+'"':_.allowedEmptyAttributes.includes(ke)&&(v+='=""')}else delete V.attribs[ke]}),_.selfClosing.indexOf(D)!==-1?v+=" />":(v+=">",V.innerText&&!Je&&!_.textFilter&&(v+=Be(V.innerText),Ne=!0)),pe&&(v=$+Be(v),$=""),V.openingTagLength=v.length-V.tagPosition},ontext:function(D){if(ve)return;const Z=oe[oe.length-1];let V;if(Z&&(V=Z.tag,D=Z.innerText!==void 0?Z.innerText:D),_.disallowedTagsMode==="completelyDiscard"&&!z(V))D="";else if((_.disallowedTagsMode==="discard"||_.disallowedTagsMode==="completelyDiscard")&&(V==="script"||V==="style"))v+=D;else if(!Ne){const pe=Be(D,!1);_.textFilter?v+=_.textFilter(pe,V):v+=pe}if(oe.length){const pe=oe[oe.length-1];pe.text+=D}},onclosetag:function(D,Z){if(_.onCloseTag&&_.onCloseTag(D,Z),ve)if(Ce--,!Ce)ve=!1;else return;const V=oe.pop();if(!V)return;if(V.tag!==D){oe.push(V);return}ve=_.enforceHtmlBoundary?D==="html":!1,B--;const pe=ae[B];if(pe){if(delete ae[B],_.disallowedTagsMode==="discard"||_.disallowedTagsMode==="completelyDiscard"){V.updateParentNodeText();return}$=v,v=""}if(se[B]&&(D=se[B],delete se[B]),_.exclusiveFilter){const Je=_.exclusiveFilter(V);if(Je==="excludeTag"){pe&&(v=$,$=""),v=v.substring(0,V.tagPosition)+v.substring(V.tagPosition+V.openingTagLength);return}else if(Je){v=v.substring(0,V.tagPosition);return}}if(V.updateParentNodeMediaChildren(),V.updateParentNodeText(),_.selfClosing.indexOf(D)!==-1||Z&&!z(D)&&["escape","recursiveEscape"].indexOf(_.disallowedTagsMode)>=0){pe&&(v=$,$="");return}v+="</"+D+">",pe&&(v=$+Be(v),$=""),Ne=!1}},_.parser);return We.write(w),We.end(),v;function F(){v="",B=0,oe=[],ae={},se={},ve=!1,Ce=0}function Be(D,Z){return typeof D!="string"&&(D=D+""),_.parser.decodeEntities&&(D=D.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),Z&&(D=D.replace(/"/g,"""))),D=D.replace(/&(?![a-zA-Z0-9#]{1,20};)/g,"&").replace(/</g,"<").replace(/>/g,">"),Z&&(D=D.replace(/"/g,""")),D}function Mt(D,Z){for(Z=Z.replace(/[\x00-\x20]+/g,"");;){const Je=Z.indexOf("<!--");if(Je===-1)break;const Xe=Z.indexOf("-->",Je+4);if(Xe===-1)break;Z=Z.substring(0,Je)+Z.substring(Xe+3)}const V=Z.match(/^([a-zA-Z][a-zA-Z0-9.\-+]*):/);if(!V)return Z.match(/^[/\\]{2}/)?!_.allowProtocolRelative:!1;const pe=V[1].toLowerCase();return u(_.allowedSchemesByTag,D)?_.allowedSchemesByTag[D].indexOf(pe)===-1:!_.allowedSchemes||_.allowedSchemes.indexOf(pe)===-1}function le(D){if(D=D.replace(/^(\w+:)?\s*[\\/]\s*[\\/]/,"$1//"),D.startsWith("relative:"))throw new Error("relative: exploit attempt");let Z="relative://relative-site";for(let Je=0;Je<100;Je++)Z+=`/${Je}`;const V=new URL(D,Z);return{isRelativeUrl:V&&V.hostname==="relative-site"&&V.protocol==="relative:",url:V}}function St(D,Z){if(!Z)return D;const V=D.nodes[0];let pe;return Z[V.selector]&&Z["*"]?pe=r(Z[V.selector],Z["*"]):pe=Z[V.selector]||Z["*"],pe&&(D.nodes[0].nodes=V.nodes.reduce(ci(pe),[])),D}function po(D){return D.nodes[0].nodes.reduce(function(Z,V){return Z.push(`${V.prop}:${V.value}${V.important?" !important":""}`),Z},[]).join(";")}function ci(D){return function(Z,V){return u(D,V.prop)&&D[V.prop].some(function(Je){return Je.test(V.value)})&&Z.push(V),Z}}function li(D,Z,V){return Z?(D=D.split(/\s+/),D.filter(function(pe){return Z.indexOf(pe)!==-1||V.some(function(Je){return Je.test(pe)})}).join(" ")):D}}const y={decodeEntities:!0};return m.defaults={allowedTags:["address","article","aside","footer","header","h1","h2","h3","h4","h5","h6","hgroup","main","nav","section","blockquote","dd","div","dl","dt","figcaption","figure","hr","li","menu","ol","p","pre","ul","a","abbr","b","bdi","bdo","br","cite","code","data","dfn","em","i","kbd","mark","q","rb","rp","rt","rtc","ruby","s","samp","small","span","strong","sub","sup","time","u","var","wbr","caption","col","colgroup","table","tbody","td","tfoot","th","thead","tr"],nonBooleanAttributes:["abbr","accept","accept-charset","accesskey","action","allow","alt","as","autocapitalize","autocomplete","blocking","charset","cite","class","color","cols","colspan","content","contenteditable","coords","crossorigin","data","datetime","decoding","dir","dirname","download","draggable","enctype","enterkeyhint","fetchpriority","for","form","formaction","formenctype","formmethod","formtarget","headers","height","hidden","high","href","hreflang","http-equiv","id","imagesizes","imagesrcset","inputmode","integrity","is","itemid","itemprop","itemref","itemtype","kind","label","lang","list","loading","low","max","maxlength","media","method","min","minlength","name","nonce","optimum","pattern","ping","placeholder","popover","popovertarget","popovertargetaction","poster","preload","referrerpolicy","rel","rows","rowspan","sandbox","scope","shape","size","sizes","slot","span","spellcheck","src","srcdoc","srclang","srcset","start","step","style","tabindex","target","title","translate","type","usemap","value","width","wrap","onauxclick","onafterprint","onbeforematch","onbeforeprint","onbeforeunload","onbeforetoggle","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncontextlost","oncontextmenu","oncontextrestored","oncopy","oncuechange","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onformdata","onhashchange","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onlanguagechange","onload","onloadeddata","onloadedmetadata","onloadstart","onmessage","onmessageerror","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onoffline","ononline","onpagehide","onpageshow","onpaste","onpause","onplay","onplaying","onpopstate","onprogress","onratechange","onreset","onresize","onrejectionhandled","onscroll","onscrollend","onsecuritypolicyviolation","onseeked","onseeking","onselect","onslotchange","onstalled","onstorage","onsubmit","onsuspend","ontimeupdate","ontoggle","onunhandledrejection","onunload","onvolumechange","onwaiting","onwheel"],disallowedTagsMode:"discard",allowedAttributes:{a:["href","name","target"],img:["src","srcset","alt","title","width","height","loading"]},allowedEmptyAttributes:["alt"],selfClosing:["img","br","hr","area","base","basefont","input","link","meta"],allowedSchemes:["http","https","ftp","mailto","tel"],allowedSchemesByTag:{},allowedSchemesAppliedToAttributes:["href","src","cite"],allowProtocolRelative:!0,enforceHtmlBoundary:!1,parseStyleAttributes:!0,preserveEscapedAttributes:!1},m.simpleTransform=function(w,_,k){return k=k===void 0?!0:k,_=_||{},function(v,$){let b;if(k)for(b in _)$[b]=_[b];else $=_;return{tagName:w,attribs:$}}},wd}var FA=qA();const HA=Xb(FA);function Mv(t){return HA(t,{allowedTags:["h1","h2","h3","h4","h5","h6","p","br","hr","ul","ol","li","strong","b","em","i","u","s","mark","a","span","div","table","thead","tbody","tr","th","td","blockquote","pre","code","img"],allowedAttributes:{a:["href","target","rel"],img:["src","alt","width","height"],"*":["class","id"]},allowedSchemes:["http","https","mailto"],allowedSchemesAppliedToAttributes:["href","src"],transformTags:{img:(e,n)=>{const r=n.src||"";return r&&!r.startsWith("https://")&&!r.startsWith("data:")?{tagName:"span",attribs:{}}:{tagName:e,attribs:n}},a:(e,n)=>({tagName:e,attribs:{...n,rel:"noopener noreferrer"}})}})}const VA=t=>{const e=Mv(t.config?.content??"");return g("div",{className:"rich-text mb-6 prose prose-gray max-w-none [&>*:last-child]:mb-0 [&_h1]:mb-6 [&_h2]:mb-6",dangerouslySetInnerHTML:{__html:e}},t.id)},KA=t=>{const e=Mv(t.config?.text??"");return g("div",{className:"flex items-center gap-2",children:[g("input",{type:"checkbox",name:t.id,required:!!t.required,className:"w-5 h-5 accent-[#4F2D7F] align-middle",id:t.id}),g("span",{className:"text-base leading-tight",children:g("span",{dangerouslySetInnerHTML:{__html:e}})})]},t.id)},GA=t=>g("div",{className:"mb-4",children:g("input",{type:"text",name:t.id,placeholder:t.config?.placeholder||"",required:!!t.required,className:"w-full rounded-lg border bg-gray-100 px-4 py-5 text-base placeholder:text-gray-300 dark:bg-gray-600 border-gray-100 dark:border-gray-500",id:t.id})},t.id);function WA(t){switch(t.type){case"RICH_TEXT":return VA(t);case"LEGAL":return KA(t);case"TEXT":return GA(t);default:return null}}const vd=({theme:t,branding:e,client:n,formName:r,error:i,components:s})=>{const c=s?.find(u=>u.type==="LEGAL"&&u.required)?.id,l=s?.find(u=>u.type==="NEXT_BUTTON");return g(qe,{title:r,theme:t,branding:e,client:n,children:[i&&g("div",{className:"mb-4 text-red-500",children:i}),g("div",{className:"flex flex-1 flex-col justify-center",children:g("form",{className:"pt-2",method:"post",children:[c&&g("style",{dangerouslySetInnerHTML:{__html:`
|
|
135
|
+
#_legalWrapper:has(#${c}:checked) #continueBtn {
|
|
136
|
+
display: block;
|
|
137
|
+
}
|
|
138
|
+
#_legalWrapper:has(#${c}:checked) #continueBtnDisabled {
|
|
139
|
+
display: none;
|
|
140
|
+
}
|
|
141
|
+
#_legalWrapper:not(:has(#${c}:checked)) #continueBtn {
|
|
142
|
+
display: none;
|
|
143
|
+
}
|
|
144
|
+
#_legalWrapper:not(:has(#${c}:checked)) #continueBtnDisabled {
|
|
145
|
+
display: block;
|
|
146
|
+
}
|
|
147
|
+
`}}),g("div",{id:"_legalWrapper",children:[s&&s.map(u=>{if(u.type==="NEXT_BUTTON")return null;const d=WA(u);return d?g("div",{className:u.type==="RICH_TEXT"?"mb-6":"mb-4",children:d},u.id):null}),l&&g("div",{className:"mb-4",children:c?g(rs,{children:[g(Me,{id:"continueBtn",className:"sm:mt-4 !text-base w-full",children:[g("span",{children:l.config.text||"Continue"}),g(Ge,{className:"text-xs",name:"arrow-right"})]}),g(Me,{id:"continueBtnDisabled",className:"sm:mt-4 !text-base w-full opacity-50 cursor-not-allowed",disabled:!0,children:[g("span",{children:l.config.text||"Continue"}),g(Ge,{className:"text-xs",name:"arrow-right"})]})]}):g(Me,{className:"sm:mt-4 !text-base w-full",children:[g("span",{children:l.config.text||"Continue"}),g(Ge,{className:"text-xs",name:"arrow-right"})]})})]})]})})]})},JA=new o.OpenAPIHono().openapi(o.createRoute({tags:["forms"],method:"get",path:"/:formId/nodes/:nodeId",request:{params:o.z.object({formId:o.z.string(),nodeId:o.z.string()}),query:o.z.object({state:o.z.string()})},responses:{200:{description:"Form node HTML"},404:{description:"Form or node not found"}}}),async t=>{const{formId:e,nodeId:n}=t.req.valid("param"),{state:r}=t.req.valid("query"),{client:i,theme:s,branding:a}=await Ie(t,r,!0),c=await t.env.data.forms.get(i.tenant.id,e);if(!c)throw new I(404,{message:"Form not found"});const l=(c.nodes||[]).find(u=>u.id===n&&u.type==="STEP");if(!l)throw new I(404,{message:"Node not found or not a STEP node"});return t.html(g(vd,{theme:s,branding:a,client:i,state:r,formName:c.name,nodeAlias:l.alias||l.type,components:"components"in l.config?l.config.components:[]}))}).openapi(o.createRoute({tags:["forms"],method:"post",path:"/:formId/nodes/:nodeId",request:{params:o.z.object({formId:o.z.string(),nodeId:o.z.string()}),query:o.z.object({state:o.z.string()}),body:{content:{"application/x-www-form-urlencoded":{schema:o.z.record(o.z.string())}}}},responses:{200:{description:"Form node submitted"},404:{description:"Form or node not found"}}}),async t=>{const{formId:e,nodeId:n}=t.req.valid("param"),{state:r}=t.req.valid("query"),{theme:i,branding:s,client:a}=await Ie(t,r,!0);let c,l,u=[];try{if(c=await t.env.data.forms.get(a.tenant.id,e),!c)throw new I(404,{message:"Form not found"});if(l=(c.nodes||[]).find(k=>k.id===n&&k.type==="STEP"),!l)throw new I(404,{message:"Node not found or not a STEP node"});u="components"in l.config?l.config.components:[];const d=await t.req.parseBody(),f=[],p={};for(const k of u)if(k.type==="LEGAL"){const v=k.id,$=!!k.required,b=d[v];$&&(!b||b==="")?f.push(v):typeof b=="string"&&(p[v]=b)}if(f.length>0)return t.html(g(vd,{theme:i,branding:s,client:a,state:r,formName:c.name,nodeAlias:l.alias||l.type,components:u,error:`Missing required fields: ${f.join(", ")}`}));const h=await t.env.data.loginSessions.get(a.tenant.id,r);if(!h||!h.session_id||!h.authParams)throw new Error("Session expired");const m=await t.env.data.sessions.get(a.tenant.id,h.session_id);if(!m||!m.user_id)throw new Error("Session expired");const y=await t.env.data.users.get(t.var.tenant_id,m.user_id);if(!y)throw new Error("Session expired");const w=l.config?.next_node;if(w&&c.nodes){const k=async $=>{const b=await t.env.data.flows.get(a.tenant.id,$);return b?{actions:b.actions?.map(z=>({type:z.type,action:z.action,params:"params"in z&&z.params&&typeof z.params=="object"&&"target"in z.params?{target:z.params.target,custom_url:"custom_url"in z.params?z.params.custom_url:void 0}:void 0}))}:null},v=await j0(c.nodes,w,{user:y},k);if(v){if(v.type==="redirect"){const $=I0(v.target,v.customUrl,r);return new Response(null,{status:302,headers:{location:$}})}if(v.type==="step")return new Response(null,{status:302,headers:{location:`/u/forms/${e}/nodes/${v.nodeId}?state=${encodeURIComponent(r)}`}})}}return await sn(t,{authParams:h.authParams,client:a,user:y,loginSession:h,skipHooks:!0})}catch{return t.html(g(vd,{theme:i,branding:s,client:a,state:r,formName:c?.name||"",nodeAlias:l?.alias||n||"",components:u||[],error:"Your session has expired. Please try again."}))}});function XA(t,e,n,r="hosted"){if(r==="spa")return`/u/flow/screen?${new URLSearchParams({form:t,state:e}).toString()}`;const i=new URLSearchParams({state:e});return`/u/flow/${t}/screen?${i.toString()}`}function p0(t,e,n,r={}){const i=r.mode??"hosted",s=[...t.config.components].filter(c=>c.visible!==!1).sort((c,l)=>(c.order??0)-(l.order??0)).map(c=>r.fieldErrors?.[c.id]?{...c,messages:[{text:r.fieldErrors[c.id],type:"error"}]}:c);return{action:XA(e,n,void 0,i),method:"POST",title:r.title??t.alias??void 0,description:r.description,components:s,messages:r.messages,links:[]}}const ZA=o.z.object({colors:o.z.object({primary:o.z.string().optional(),page_background:o.z.string().optional()}).optional(),logo_url:o.z.string().optional(),favicon_url:o.z.string().optional(),font:o.z.object({url:o.z.string().optional()}).optional()}),qv=o.z.object({id:o.z.number().optional(),text:o.z.string(),type:o.z.enum(["info","error","success","warning"])}),YA=o.z.object({id:o.z.string(),type:o.z.string(),category:o.z.string().optional(),config:o.z.record(o.z.any()).optional(),order:o.z.number().optional(),visible:o.z.boolean().optional(),required:o.z.boolean().optional(),sensitive:o.z.boolean().optional(),label:o.z.string().optional(),hint:o.z.string().optional(),messages:o.z.array(qv).optional()}),QA=o.z.object({action:o.z.string(),method:o.z.enum(["POST","GET"]),title:o.z.string().optional(),description:o.z.string().optional(),components:o.z.array(YA),messages:o.z.array(qv).optional(),links:o.z.array(o.z.object({id:o.z.string().optional(),text:o.z.string(),href:o.z.string(),linkText:o.z.string().optional()})).optional()}),ya=o.z.object({screen:QA,branding:ZA.optional()});async function I1(t,e,n,r,i="hosted"){const{client:s,branding:a}=await Ie(t,n,!0),c=await t.env.data.forms.get(s.tenant.id,e);if(!c)throw new I(404,{message:"Form not found"});const l=r??c.start?.next_node;if(!l)throw new I(400,{message:"No starting node defined"});const u=(c.nodes||[]).find(f=>f.id===l&&f.type==="STEP");if(!u)throw new I(404,{message:"Node not found or not a STEP node"});const d=p0(u,e,n,{title:c.name,mode:i});return t.json({screen:d,branding:a?{colors:a.colors,logo_url:a.logo_url,favicon_url:a.favicon_url,font:a.font}:void 0})}async function j1(t,e,n,r,i,s="hosted"){const{client:a,branding:c}=await Ie(t,n,!0),l=await t.env.data.forms.get(a.tenant.id,e);if(!l)throw new I(404,{message:"Form not found"});const u=r??l.start?.next_node;if(!u)throw new I(400,{message:"No node specified"});const d=(l.nodes||[]).find(y=>y.id===u&&y.type==="STEP");if(!d)throw new I(404,{message:"Node not found or not a STEP node"});const f={},p=d.config.components;for(const y of p){if("required"in y&&y.required){const w=i[y.id];(w==null||w==="")&&(f[y.id]="This field is required")}y.type==="EMAIL"&&i[y.id]&&(/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(String(i[y.id]))||(f[y.id]="Please enter a valid email address"))}if(Object.keys(f).length>0){const y=p0(d,e,n,{title:l.name,fieldErrors:f,messages:[{text:"Please correct the errors below",type:"error"}],mode:s});return t.json({screen:y,branding:c},400)}const h=await t.env.data.loginSessions.get(a.tenant.id,n);if(!h||!h.authParams)throw new I(400,{message:"Session expired"});const m=d.config?.next_node;if(m&&l.nodes){const y=async k=>{const v=await t.env.data.flows.get(a.tenant.id,k);return v?{actions:v.actions?.map($=>({type:$.type,action:$.action,params:"params"in $&&$.params&&typeof $.params=="object"&&"target"in $.params?{target:$.params.target,custom_url:"custom_url"in $.params?$.params.custom_url:void 0}:void 0}))}:null};let w=null;if(h.session_id){const k=await t.env.data.sessions.get(a.tenant.id,h.session_id);k?.user_id&&(w=await t.env.data.users.get(t.var.tenant_id,k.user_id))}const _=await j0(l.nodes,m,{user:w},y);if(_){if(_.type==="redirect"){const k=I0(_.target,_.customUrl,n);return t.json({redirect:k})}if(_.type==="step"){const k=(l.nodes||[]).find(v=>v.id===_.nodeId&&v.type==="STEP");if(k){const v=p0(k,e,n,{title:l.name,mode:s});return t.json({screen:v,branding:c?{colors:c.colors,logo_url:c.logo_url,favicon_url:c.favicon_url,font:c.font}:void 0})}}}}if(h.session_id){const y=await t.env.data.sessions.get(a.tenant.id,h.session_id);if(y?.user_id){const w=await t.env.data.users.get(t.var.tenant_id,y.user_id);if(w){const _=await sn(t,{authParams:h.authParams,client:a,user:w,loginSession:h,skipHooks:!0});if(_.status===302){const k=_.headers.get("location");if(k)return t.json({redirect:k})}}}}return t.json({complete:!0})}const eE=new o.OpenAPIHono().openapi(o.createRoute({tags:["flow-api"],method:"get",path:"/screen",request:{query:o.z.object({form:o.z.string(),state:o.z.string(),screen:o.z.string().optional()})},responses:{200:{description:"Current screen for widget rendering (SPA mode)",content:{"application/json":{schema:ya}}},404:{description:"Form not found"}}}),async t=>{const{form:e,state:n,screen:r}=t.req.valid("query");return I1(t,e,n,r,"spa")}).openapi(o.createRoute({tags:["flow-api"],method:"get",path:"/:formId/screen",request:{params:o.z.object({formId:o.z.string()}),query:o.z.object({state:o.z.string(),nodeId:o.z.string().optional()})},responses:{200:{description:"Current screen for widget rendering (hosted mode)",content:{"application/json":{schema:ya}}},404:{description:"Form not found"}}}),async t=>{const{formId:e}=t.req.valid("param"),{state:n,nodeId:r}=t.req.valid("query");return I1(t,e,n,r,"hosted")}).openapi(o.createRoute({tags:["flow-api"],method:"post",path:"/screen",request:{query:o.z.object({form:o.z.string(),state:o.z.string(),screen:o.z.string().optional()}),body:{content:{"application/json":{schema:o.z.object({data:o.z.record(o.z.string(),o.z.any())})}}}},responses:{200:{description:"Next screen or completion response (SPA mode)",content:{"application/json":{schema:o.z.union([ya,o.z.object({redirect:o.z.string()}),o.z.object({complete:o.z.boolean(),tokens:o.z.object({access_token:o.z.string().optional(),id_token:o.z.string().optional(),refresh_token:o.z.string().optional()}).optional()})])}}},400:{description:"Validation error"},404:{description:"Form not found"}}}),async t=>{const{form:e,state:n,screen:r}=t.req.valid("query"),{data:i}=t.req.valid("json");return j1(t,e,n,r,i,"spa")}).openapi(o.createRoute({tags:["flow-api"],method:"post",path:"/:formId/screen",request:{params:o.z.object({formId:o.z.string()}),query:o.z.object({state:o.z.string(),nodeId:o.z.string().optional()}),body:{content:{"application/json":{schema:o.z.object({data:o.z.record(o.z.string(),o.z.any())})}}}},responses:{200:{description:"Next screen or completion response (hosted mode)",content:{"application/json":{schema:o.z.union([ya,o.z.object({redirect:o.z.string()}),o.z.object({complete:o.z.boolean(),tokens:o.z.object({access_token:o.z.string().optional(),id_token:o.z.string().optional(),refresh_token:o.z.string().optional()}).optional()})])}}},400:{description:"Validation error"},404:{description:"Form not found"}}}),async t=>{const{formId:e}=t.req.valid("param"),{state:n,nodeId:r}=t.req.valid("query"),{data:i}=t.req.valid("json");return j1(t,e,n,r,i,"hosted")});function f0(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function xd(t){return t.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/</g,"\\x3c").replace(/>/g,"\\x3e")}function T1(t){if(!t)return"";try{const e=new URL(t);return["http:","https:","data:"].includes(e.protocol)?f0(t):""}catch{return t.startsWith("/")?f0(t):""}}function La(t){return t&&/^(#[0-9a-fA-F]{3,8}|rgba?\([^)]+\)|hsla?\([^)]+\)|[a-zA-Z]+)$/.test(t.trim())?t.trim():""}function tE(t){if(!t)return"#f5f5f5";const{type:e,start:n,end:r,angle_deg:i}=t;if(e==="linear-gradient"&&n&&r){const s=La(n),a=La(r);if(s&&a)return`linear-gradient(${typeof i=="number"?i:180}deg, ${s}, ${a})`}if(n){const s=La(n);if(s)return s}return"#f5f5f5"}const nE=new o.OpenAPIHono().openapi(o.createRoute({tags:["flow-widget"],method:"get",path:"/:formId",request:{params:o.z.object({formId:o.z.string()}),query:o.z.object({state:o.z.string()})},responses:{200:{description:"Flow widget page",content:{"text/html":{schema:o.z.string()}}}}}),async t=>{const{formId:e}=t.req.valid("param"),{state:n}=t.req.valid("query"),{branding:r,client:i}=await Ie(t,n,!0),a=`${new URL(t.req.url).origin}/u/flow/${e}/screen?state=${encodeURIComponent(n)}`,c=[],l=La(r?.colors?.primary);l&&c.push(`--ah-color-primary: ${l}`);const u=tE(r?.colors?.page_background),d=T1(r?.favicon_url),f=T1(r?.font?.url),h=`<!DOCTYPE html>
|
|
148
|
+
<html lang="en">
|
|
149
|
+
<head>
|
|
150
|
+
<meta charset="UTF-8">
|
|
151
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
152
|
+
<title>Sign in - ${f0(i.name||"AuthHero")}</title>
|
|
153
|
+
${d?`<link rel="icon" href="${d}">`:""}
|
|
154
|
+
${f?`<link rel="stylesheet" href="${f}">`:""}
|
|
155
|
+
<style>
|
|
156
|
+
* {
|
|
157
|
+
box-sizing: border-box;
|
|
158
|
+
margin: 0;
|
|
159
|
+
padding: 0;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
body {
|
|
163
|
+
min-height: 100vh;
|
|
164
|
+
display: flex;
|
|
165
|
+
align-items: center;
|
|
166
|
+
justify-content: center;
|
|
167
|
+
background: ${u||"#f5f5f5"};
|
|
168
|
+
font-family: ${f?"'Inter', system-ui, sans-serif":"system-ui, -apple-system, sans-serif"};
|
|
169
|
+
padding: 20px;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
authhero-widget {
|
|
173
|
+
${c.join(`;
|
|
174
|
+
`)};
|
|
175
|
+
max-width: 400px;
|
|
176
|
+
width: 100%;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.loading {
|
|
180
|
+
text-align: center;
|
|
181
|
+
padding: 40px;
|
|
182
|
+
color: #666;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.error {
|
|
186
|
+
background: #fee2e2;
|
|
187
|
+
border: 1px solid #ef4444;
|
|
188
|
+
color: #dc2626;
|
|
189
|
+
padding: 16px;
|
|
190
|
+
border-radius: 8px;
|
|
191
|
+
margin-bottom: 16px;
|
|
192
|
+
}
|
|
193
|
+
</style>
|
|
194
|
+
<script type="module" src="/u/widget/authhero-widget.esm.js"><\/script>
|
|
195
|
+
</head>
|
|
196
|
+
<body>
|
|
197
|
+
<authhero-widget id="widget">
|
|
198
|
+
<div class="loading">Loading...</div>
|
|
199
|
+
</authhero-widget>
|
|
200
|
+
|
|
201
|
+
<script type="module">
|
|
202
|
+
const widget = document.getElementById('widget');
|
|
203
|
+
const flowApiUrl = '${xd(a)}';
|
|
204
|
+
let currentNodeId = null;
|
|
205
|
+
|
|
206
|
+
// Fetch and render the current screen
|
|
207
|
+
async function fetchScreen(nodeId = null) {
|
|
208
|
+
try {
|
|
209
|
+
let url = flowApiUrl;
|
|
210
|
+
if (nodeId) {
|
|
211
|
+
url += '&nodeId=' + encodeURIComponent(nodeId);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
const response = await fetch(url, {
|
|
215
|
+
method: 'GET',
|
|
216
|
+
credentials: 'include',
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
if (!response.ok) {
|
|
220
|
+
throw new Error('Failed to load screen');
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
const data = await response.json();
|
|
224
|
+
|
|
225
|
+
if (data.screen) {
|
|
226
|
+
// Set the screen on the widget
|
|
227
|
+
widget.screen = data.screen;
|
|
228
|
+
currentNodeId = nodeId;
|
|
229
|
+
|
|
230
|
+
// Apply branding if present
|
|
231
|
+
if (data.branding?.logo_url) {
|
|
232
|
+
widget.logoUrl = data.branding.logo_url;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
} catch (error) {
|
|
236
|
+
console.error('Error fetching screen:', error);
|
|
237
|
+
widget.innerHTML = '<div class="error">Failed to load. Please try again.</div>';
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
// Handle form submission
|
|
242
|
+
async function submitForm(formData) {
|
|
243
|
+
try {
|
|
244
|
+
widget.loading = true;
|
|
245
|
+
|
|
246
|
+
let url = flowApiUrl;
|
|
247
|
+
if (currentNodeId) {
|
|
248
|
+
url += '&nodeId=' + encodeURIComponent(currentNodeId);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
const response = await fetch(url, {
|
|
252
|
+
method: 'POST',
|
|
253
|
+
credentials: 'include',
|
|
254
|
+
headers: {
|
|
255
|
+
'Content-Type': 'application/json',
|
|
256
|
+
},
|
|
257
|
+
body: JSON.stringify({ data: formData }),
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
const data = await response.json();
|
|
261
|
+
|
|
262
|
+
// Handle redirect response
|
|
263
|
+
if (data.redirect) {
|
|
264
|
+
window.location.href = data.redirect;
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
// Handle next screen response
|
|
269
|
+
if (data.screen) {
|
|
270
|
+
widget.screen = data.screen;
|
|
271
|
+
widget.loading = false;
|
|
272
|
+
return;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// Handle completion
|
|
276
|
+
if (data.complete) {
|
|
277
|
+
widget.innerHTML = '<div class="loading">Authentication complete. Redirecting...</div>';
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
} catch (error) {
|
|
282
|
+
console.error('Error submitting form:', error);
|
|
283
|
+
widget.loading = false;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
// Handle social login
|
|
288
|
+
async function handleSocialLogin(provider) {
|
|
289
|
+
// Redirect to the social login endpoint
|
|
290
|
+
const socialUrl = '/authorize?' + new URLSearchParams({
|
|
291
|
+
connection: provider,
|
|
292
|
+
state: '${xd(n)}',
|
|
293
|
+
}).toString();
|
|
294
|
+
window.location.href = socialUrl;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
// Event listeners
|
|
298
|
+
widget.addEventListener('submit', (e) => {
|
|
299
|
+
e.preventDefault();
|
|
300
|
+
submitForm(e.detail.data);
|
|
301
|
+
});
|
|
302
|
+
|
|
303
|
+
widget.addEventListener('buttonClick', (e) => {
|
|
304
|
+
const { type, value } = e.detail;
|
|
305
|
+
|
|
306
|
+
if (type === 'oidc' || type === 'social') {
|
|
307
|
+
handleSocialLogin(value);
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
|
|
311
|
+
widget.addEventListener('linkClick', (e) => {
|
|
312
|
+
const { href } = e.detail;
|
|
313
|
+
|
|
314
|
+
// Handle internal links
|
|
315
|
+
if (href.startsWith('/u/')) {
|
|
316
|
+
window.location.href = href + '?state=' + encodeURIComponent('${xd(n)}');
|
|
317
|
+
} else {
|
|
318
|
+
window.location.href = href;
|
|
319
|
+
}
|
|
320
|
+
});
|
|
321
|
+
|
|
322
|
+
// Initial load
|
|
323
|
+
fetchScreen();
|
|
324
|
+
<\/script>
|
|
325
|
+
</body>
|
|
326
|
+
</html>`;return t.html(h)}),O1=t=>{const{error:e,theme:n,branding:r,user:i,state:s,client:a}=t;return g(qe,{title:"Impersonation",theme:n,branding:r,client:a,children:[g("div",{className:"flex flex-1 flex-col justify-center",children:[g("div",{className:"mb-6",children:[g("p",{className:"text-sm text-gray-500 mb-4",children:["Current user: ",g("strong",{children:i.email})]}),g("form",{method:"post",action:`/u/impersonate/continue?state=${encodeURIComponent(s)}`,className:"mb-4",children:g(Me,{className:"w-full !text-base",children:[g("span",{children:"Continue"}),g(Ge,{className:"text-xs",name:"arrow-right"})]})}),g("details",{className:"mb-4",children:[g("summary",{className:"cursor-pointer text-primary hover:underline mb-4 select-none flex items-center",children:[g("span",{className:"details-arrow mr-2 transition-transform duration-200",children:"▶"}),"Advanced Options"]}),g("div",{className:"mt-4 p-4 border border-gray-200 dark:border-gray-600 rounded-lg bg-gray-50 dark:bg-gray-700",children:g("form",{method:"post",action:`/u/impersonate/switch?state=${encodeURIComponent(s)}`,children:[g("input",{type:"text",id:"user_id",name:"user_id",placeholder:"Enter user ID to impersonate",className:"mb-4 w-full rounded-lg bg-gray-100 px-4 py-3 text-base placeholder:text-gray-300 dark:bg-gray-600 md:text-base",required:!0}),e&&g(tt,{children:e}),g(Me,{variant:"secondary",className:"w-full !text-base",children:[g("span",{children:"Impersonate"}),g(Ge,{className:"text-xs",name:"arrow-right"})]})]})})]})]}),g(Ct,{state:s})]}),g("style",{children:`
|
|
327
|
+
details[open] .details-arrow {
|
|
328
|
+
transform: rotate(90deg);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/* Hide default details marker */
|
|
332
|
+
details > summary {
|
|
333
|
+
list-style: none;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
details > summary::-webkit-details-marker {
|
|
337
|
+
display: none;
|
|
338
|
+
}
|
|
339
|
+
`})]})},P1=({error:t,theme:e,branding:n,state:r,user:i,className:s})=>{const a=e?.colors?.primary_button||n?.colors?.primary||"#0066cc",c=e?.colors?.primary_button_label||"#ffffff",l=e?.colors?.body_text||"#333333",u=e?.colors?.input_border||"#d1d5db",d=e?.colors?.widget_background||"#ffffff",f=e?.colors?.widget_border||"#e5e7eb",p=e?.borders?.widget_corner_radius||8,h=e?.borders?.button_border_radius||4,m=e?.borders?.show_widget_shadow??!0,y=e?.fonts?.title?.size||24,w=e?.fonts?.title?.bold??!0,_=e?.fonts?.body_text?.size||14,k={backgroundColor:d,borderColor:f,borderRadius:`${p}px`,boxShadow:m?"0 1px 3px 0 rgba(0, 0, 0, 0.1)":"none",color:l},v={fontSize:`${y}px`,fontWeight:w?"700":"400",color:e?.colors?.header||l},$={fontSize:`${_}px`,color:e?.colors?.input_labels_placeholders||"#6b7280"},b={backgroundColor:a,color:c,borderRadius:`${h}px`},z={backgroundColor:"transparent",color:l,borderColor:u,borderRadius:`${h}px`},A={color:e?.colors?.links_focused_components||a,fontSize:`${_}px`},N={borderColor:u,borderRadius:`${h}px`,fontSize:`${_}px`,color:l},O=e?.widget?.logo_position||"center",L=O==="left"?"text-left":O==="right"?"text-right":"text-center",C=e?.widget?.logo_url||n?.logo_url,P=O!=="none"&&C;return g("div",{className:fe("flex flex-col gap-6 w-full max-w-sm",s),children:g(Sn,{style:k,className:"border",children:[g(zn,{children:[P&&g("div",{className:fe("mb-4",L),children:g(ln,{theme:e,branding:n})}),g(An,{style:v,children:E.t("impersonation","Impersonation")}),g(En,{style:$,children:E.t("impersonation_description","You have permission to impersonate other users.")})]}),g(Cn,{children:g("div",{className:"space-y-4",children:[g("div",{className:"p-3 bg-gray-50 dark:bg-gray-800 rounded-md",children:[g("p",{className:"text-xs text-gray-500 dark:text-gray-400 mb-1",children:[E.t("current_user","Current user"),":"]}),g("p",{className:"font-semibold",style:{fontSize:`${_}px`},children:i.email})]}),g("form",{method:"post",action:`/u/impersonate/continue?state=${encodeURIComponent(r)}`,children:g(wn,{type:"submit",className:"w-full transition-colors hover:brightness-90",style:b,children:E.t("continue","Continue")})}),g("div",{className:"relative",children:[g("div",{className:"absolute inset-0 flex items-center","aria-hidden":"true",children:g("div",{className:"w-full border-t",style:{borderColor:f}})}),g("div",{className:"relative flex justify-center text-xs uppercase",children:g("span",{className:"px-2",style:{backgroundColor:d,...$},children:E.t("or","Or")})})]}),g("details",{className:"group",children:[g("summary",{className:"cursor-pointer select-none flex items-center justify-between p-3 rounded-md hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors",style:A,children:[g("span",{className:"font-medium",children:E.t("advanced_options","Advanced Options")}),g("svg",{className:"w-5 h-5 transition-transform group-open:rotate-90",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:g("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]}),g("div",{className:"mt-3 p-4 border rounded-md",style:{borderColor:f},children:g("form",{method:"post",action:`/u/impersonate/switch?state=${encodeURIComponent(r)}`,children:g("div",{className:"space-y-4",children:[g("div",{className:"space-y-2",children:[g(Lt,{htmlFor:"user_id",style:$,children:E.t("user_id_to_impersonate","User ID to Impersonate")}),g(on,{type:"text",id:"user_id",name:"user_id",placeholder:E.t("enter_user_id","Enter user ID"),required:!0,style:N,className:"w-full"}),t&&g(tt,{children:t})]}),g(wn,{type:"submit",variant:"outline",className:"w-full transition-colors border",style:z,children:E.t("impersonate_user","Impersonate User")})]})})})]})]})}),g(uv,{children:g("a",{href:`/u/login/identifier?state=${encodeURIComponent(r)}`,className:"text-sm hover:underline focus:outline-none focus:ring-2 focus:ring-offset-2 transition-colors w-full text-center",style:A,children:E.t("go_back","Go back")})})]})})},rE=new o.OpenAPIHono().openapi(o.createRoute({tags:["impersonation"],method:"get",path:"/",request:{query:o.z.object({state:o.z.string().openapi({description:"The state parameter from the authorization request"})})},responses:{200:{description:"Impersonation page"},400:{description:"Bad Request"}}}),async t=>{const{state:e}=t.req.valid("query"),{theme:n,branding:r,client:i,loginSession:s,useShadcn:a}=await Ie(t,e,!0);if(!s.session_id)throw new I(400,{message:"No session linked to login session"});const c=await t.env.data.sessions.get(i.tenant.id,s.session_id);if(!c)throw new I(400,{message:"Session not found"});const l=await t.env.data.users.get(i.tenant.id,c.user_id);if(!l)throw new I(400,{message:"User not found"});return(await t.env.data.userPermissions.list(i.tenant.id,l.user_id)).some(f=>f.permission_name==="users:impersonate")?a?t.html(g(Le,{title:E.t("impersonation","Impersonation"),theme:n,branding:r,client:i,children:g(P1,{theme:n,branding:r,client:i,user:l,state:e})})):t.html(g(O1,{theme:n,branding:r,client:i,user:l,state:e})):t.html(g(Dt,{theme:n,branding:r,client:i,state:e,pageTitle:"Access Denied",message:"You do not have permission to impersonate other users."}),403)}).openapi(o.createRoute({tags:["impersonation"],method:"post",path:"/continue",request:{query:o.z.object({state:o.z.string().openapi({description:"The state parameter from the authorization request"})})},responses:{302:{description:"Redirect to continue authentication flow",headers:o.z.object({Location:o.z.string().url()})}}}),async t=>{const{state:e}=t.req.valid("query"),{client:n,loginSession:r}=await Ie(t,e,!0);if(!r.session_id)throw new I(400,{message:"No session linked to login session"});const i=await t.env.data.sessions.get(n.tenant.id,r.session_id);if(!i)throw new I(400,{message:"Session not found"});const s=await t.env.data.users.get(n.tenant.id,i.user_id);if(!s)throw new I(400,{message:"User not found"});if(!(await t.env.data.userPermissions.list(n.tenant.id,s.user_id)).some(l=>l.permission_name==="users:impersonate"))throw new I(403,{message:"Access denied: insufficient permissions"});return sn(t,{client:n,authParams:r.authParams,loginSession:r,user:s,sessionId:i.id,skipHooks:!0})}).openapi(o.createRoute({tags:["impersonation"],method:"post",path:"/switch",request:{query:o.z.object({state:o.z.string().openapi({description:"The state parameter from the authorization request"})}),body:{content:{"application/x-www-form-urlencoded":{schema:o.z.object({user_id:o.z.string().min(1,"User ID is required")})}}}},responses:{302:{description:"Redirect to continue authentication flow as impersonated user",headers:o.z.object({Location:o.z.string().url()})},400:{description:"Bad Request - User not found or impersonation failed"}}}),async t=>{const{state:e}=t.req.valid("query"),{user_id:n}=t.req.valid("form"),{theme:r,branding:i,client:s,loginSession:a,useShadcn:c}=await Ie(t,e,!0);if(!a.session_id)throw new I(400,{message:"No session linked to login session"});const l=await t.env.data.sessions.get(s.tenant.id,a.session_id);if(!l)throw new I(400,{message:"Current session not found"});const u=await t.env.data.users.get(s.tenant.id,l.user_id);if(!u)throw new I(400,{message:"Current user not found"});if(!(await t.env.data.userPermissions.list(s.tenant.id,u.user_id)).some(h=>h.permission_name==="users:impersonate"))return t.html(g(Dt,{theme:r,branding:i,client:s,state:e,pageTitle:"Access Denied",message:"You do not have permission to impersonate other users."}),403);const p=await t.env.data.users.get(s.tenant.id,n);return p?(await t.env.data.sessions.update(s.tenant.id,l.id,{user_id:p.user_id}),await ye(t,s.tenant.id,{type:ge.SUCCESS_LOGIN,description:`${p.email||p.user_id} (impersonated by ${u.email||u.user_id})`,userId:p.user_id,connection:p.connection,strategy:p.connection,strategy_type:p.is_social?"social":"database"}),sn(t,{client:s,authParams:a.authParams,loginSession:a,user:p,sessionId:l.id,skipHooks:!0,impersonatingUser:u})):c?t.html(g(Le,{title:E.t("impersonation","Impersonation"),theme:r,branding:i,client:s,children:g(P1,{theme:r,branding:i,client:s,user:u,state:e,error:`User with ID "${n}" not found.`})}),400):t.html(g(O1,{theme:r,branding:i,client:s,user:u,state:e,error:`User with ID "${n}" not found.`}),400)});function iE(t){const e=new o.OpenAPIHono,n=t.dataAdapter.cache||Xs({defaultTtlSeconds:0,maxEntries:100,cleanupIntervalMs:0}),r=t.dataAdapter.cache?300:0;e.onError((s,a)=>s instanceof Qr?a.redirect(s.location,s.status):s instanceof I?a.text(s.message||"Error",s.status):a.text("Unexpected error",500)),e.get("/css/tailwind.css",async s=>{const a=Wf;return s.text(a,200,{"content-type":"text/css; charset=utf-8"})}),e.get("/js/client.js",async s=>s.text(_A,200,{"content-type":"application/javascript; charset=utf-8"})),e.get("/widget/*",async s=>s.json({error:"widget_not_configured",message:"The AuthHero widget is not configured. Install @authhero/widget and serve the dist/authhero-widget directory at /u/widget/"},404)),e.use(async(s,a)=>{const c=zs(s,t.dataAdapter),l=Yl(c,{defaultTtl:r,cacheEntities:["tenants","connections","clients","legacyClients","customDomains","resourceServers","roles","organizations","userRoles","userPermissions","branding","themes","promptSettings","forms"],cache:n});return s.env.data=Zl(s,l),a()}).use(Js).use(Ws);const i=e.route("/info",pA).route("/check-account",rA).route("/account",sA).route("/account/change-email",aA).route("/account/change-email-verify",cA).route("/account/change-email-confirmation",lA).route("/login/identifier",bz).route("/enter-code",Wz).route("/enter-password",Zz).route("/invalid-session",dA).route("/pre-signup",uA).route("/pre-signup-sent",gA).route("/reset-password",Qz).route("/forgot-password",tA).route("/validate-email",hA).route("/signup",Yz).route("/impersonate",rE).route("/forms",JA).route("/flow",eE).route("/flow-widget",nE);return i.doc("/u/spec",{openapi:"3.0.0",info:{version:"1.0.0",title:"Universal login"}}),i}var oE=Object.defineProperty,sE=(t,e,n)=>e in t?oE(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ji=(t,e,n)=>sE(t,typeof e!="symbol"?e+"":e,n);const lt=o.z.object({"#text":o.z.string()}),aE=o.z.object({"#text":o.z.string(),"@_xmlns:saml":o.z.string().optional()}),cE=o.z.object({"samlp:AuthnRequest":o.z.object({"saml:Issuer":aE,"@_xmlns:samlp":o.z.string(),"@_xmlns:saml":o.z.string().optional(),"@_ForceAuthn":o.z.string().transform(t=>t.toLowerCase()==="true").optional(),"@_ID":o.z.string(),"@_IssueInstant":o.z.string().datetime(),"@_Destination":o.z.string().url(),"@_AssertionConsumerServiceURL":o.z.string().url().optional(),"@_ProtocolBinding":o.z.string().optional(),"@_Version":o.z.string()})});o.z.array(o.z.object({":@":o.z.object({"@_xmlns":o.z.string(),"@_entityID":o.z.string()}),EntityDescriptor:o.z.array(o.z.object({":@":o.z.object({"@_protocolSupportEnumeration":o.z.string()}),IDPSSODescriptor:o.z.array(o.z.union([o.z.object({KeyDescriptor:o.z.array(o.z.object({KeyInfo:o.z.array(o.z.object({X509Data:o.z.array(o.z.object({X509Certificate:o.z.array(lt)}))})),":@":o.z.object({"@_xmlns":o.z.string()})})),":@":o.z.object({"@_use":o.z.string()})}),o.z.object({SingleLogoutService:o.z.array(o.z.object({})),":@":o.z.object({"@_Binding":o.z.string(),"@_Location":o.z.string()})}),o.z.object({NameIDFormat:o.z.array(lt)}),o.z.object({SingleSignOnService:o.z.array(o.z.object({})),":@":o.z.object({"@_Binding":o.z.string(),"@_Location":o.z.string()})}),o.z.object({Attribute:o.z.array(o.z.object({})),":@":o.z.object({"@_Name":o.z.string(),"@_NameFormat":o.z.string(),"@_FriendlyName":o.z.string(),"@_xmlns":o.z.string()})})]))}))}));const lE=o.z.object({"saml:Attribute":o.z.array(o.z.object({"saml:AttributeValue":o.z.array(o.z.object({"#text":o.z.string()})),":@":o.z.object({"@_xmlns:xs":o.z.string().optional(),"@_xmlns:xsi":o.z.string(),"@_xsi:type":o.z.string()}).optional()})),":@":o.z.object({"@_Name":o.z.string(),"@_NameFormat":o.z.string(),"@_FriendlyName":o.z.string().optional()})}),uE=o.z.object({"ds:Transform":o.z.array(o.z.any()),":@":o.z.object({"@_Algorithm":o.z.string()})}),R1=o.z.object({"ds:Signature":o.z.array(o.z.union([o.z.object({"ds:SignedInfo":o.z.array(o.z.union([o.z.object({"ds:CanonicalizationMethod":o.z.array(o.z.object({":@":o.z.object({"@_Algorithm":o.z.string()})}))}),o.z.object({"ds:SignatureMethod":o.z.array(o.z.object({":@":o.z.object({"@_Algorithm":o.z.string()})}))}),o.z.object({"ds:Reference":o.z.array(o.z.union([o.z.object({"ds:Transforms":o.z.array(uE)}),o.z.object({"ds:DigestMethod":o.z.array(o.z.object({":@":o.z.object({"@_Algorithm":o.z.string()})}))}),o.z.object({"ds:DigestValue":o.z.array(lt)})])),":@":o.z.object({"@_URI":o.z.string().optional()}).optional()})]))}),o.z.object({"ds:SignatureValue":o.z.array(lt)}),o.z.object({"ds:KeyInfo":o.z.array(o.z.union([o.z.object({"ds:KeyValue":o.z.array(o.z.object({"ds:RSAKeyValue":o.z.array(o.z.union([o.z.object({"ds:Modulus":o.z.array(lt)}),o.z.object({"ds:Exponent":o.z.array(lt)})]))}))}),o.z.object({"ds:X509Data":o.z.array(o.z.object({"ds:X509Certificate":o.z.array(lt)}))}),o.z.object({"ds:KeyValue":o.z.array(o.z.object({"ds:RSAKeyValue":o.z.array(o.z.union([o.z.object({"ds:Modulus":o.z.array(lt)}),o.z.object({"ds:Exponent":o.z.array(lt)})]))})),"ds:X509Data":o.z.array(o.z.object({"ds:X509Certificate":o.z.array(lt)}))})]))})])),":@":o.z.object({"@_xmlns:ds":o.z.string().optional()}).optional()});o.z.array(o.z.object({"samlp:Response":o.z.array(o.z.union([o.z.object({"saml:Issuer":o.z.array(lt)}),R1,o.z.object({"samlp:Status":o.z.array(o.z.object({"samlp:StatusCode":o.z.array(lt),":@":o.z.object({"@_Value":o.z.string()})}))}),o.z.object({"saml:Assertion":o.z.array(o.z.union([o.z.object({"saml:Issuer":o.z.array(lt)}),R1,o.z.object({"saml:Subject":o.z.array(o.z.union([o.z.object({"saml:NameID":o.z.array(lt),":@":o.z.object({"@_Format":o.z.string()})}),o.z.object({"saml:SubjectConfirmation":o.z.array(o.z.object({"saml:SubjectConfirmationData":o.z.array(o.z.any()),":@":o.z.object({"@_InResponseTo":o.z.string(),"@_NotOnOrAfter":o.z.string(),"@_Recipient":o.z.string()})})),":@":o.z.object({"@_Method":o.z.string()})})]))}),o.z.object({"saml:Conditions":o.z.array(o.z.object({"saml:AudienceRestriction":o.z.array(o.z.object({"saml:Audience":o.z.array(lt)}))})),":@":o.z.object({"@_NotBefore":o.z.string(),"@_NotOnOrAfter":o.z.string()})}),o.z.object({"saml:AuthnStatement":o.z.array(o.z.object({"saml:AuthnContext":o.z.array(o.z.object({"saml:AuthnContextClassRef":o.z.array(lt)}))})),":@":o.z.object({"@_AuthnInstant":o.z.string(),"@_SessionIndex":o.z.string(),"@_SessionNotOnOrAfter":o.z.string()})}),o.z.object({"saml:AttributeStatement":o.z.array(lE)})])),":@":o.z.object({"@_xmlns":o.z.string(),"@_ID":o.z.string(),"@_IssueInstant":o.z.string(),"@_Version":o.z.string()})})])),":@":o.z.object({"@_xmlns:samlp":o.z.string(),"@_xmlns:saml":o.z.string(),"@_Destination":o.z.string(),"@_ID":o.z.string(),"@_InResponseTo":o.z.string(),"@_IssueInstant":o.z.string(),"@_Version":o.z.string()})}));var Fv={},au={};(function(t){const e=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",n=e+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",r="["+e+"]["+n+"]*",i=new RegExp("^"+r+"$"),s=function(c,l){const u=[];let d=l.exec(c);for(;d;){const f=[];f.startIndex=l.lastIndex-d[0].length;const p=d.length;for(let h=0;h<p;h++)f.push(d[h]);u.push(f),d=l.exec(c)}return u},a=function(c){const l=i.exec(c);return!(l===null||typeof l>"u")};t.isExist=function(c){return typeof c<"u"},t.isEmptyObject=function(c){return Object.keys(c).length===0},t.merge=function(c,l,u){if(l){const d=Object.keys(l),f=d.length;for(let p=0;p<f;p++)u==="strict"?c[d[p]]=[l[d[p]]]:c[d[p]]=l[d[p]]}},t.getValue=function(c){return t.isExist(c)?c:""},t.isName=a,t.getAllMatches=s,t.nameRegexp=r})(au);const nh=au,dE={allowBooleanAttributes:!1,unpairedTags:[]};Fv.validate=function(t,e){e=Object.assign({},dE,e);const n=[];let r=!1,i=!1;t[0]==="\uFEFF"&&(t=t.substr(1));for(let s=0;s<t.length;s++)if(t[s]==="<"&&t[s+1]==="?"){if(s+=2,s=B1(t,s),s.err)return s}else if(t[s]==="<"){let a=s;if(s++,t[s]==="!"){s=D1(t,s);continue}else{let c=!1;t[s]==="/"&&(c=!0,s++);let l="";for(;s<t.length&&t[s]!==">"&&t[s]!==" "&&t[s]!==" "&&t[s]!==`
|
|
340
|
+
`&&t[s]!=="\r";s++)l+=t[s];if(l=l.trim(),l[l.length-1]==="/"&&(l=l.substring(0,l.length-1),s--),!bE(l)){let f;return l.trim().length===0?f="Invalid space after '<'.":f="Tag '"+l+"' is an invalid name.",Ve("InvalidTag",f,gt(t,s))}const u=hE(t,s);if(u===!1)return Ve("InvalidAttr","Attributes for '"+l+"' have open quote.",gt(t,s));let d=u.value;if(s=u.index,d[d.length-1]==="/"){const f=s-d.length;d=d.substring(0,d.length-1);const p=U1(d,e);if(p===!0)r=!0;else return Ve(p.err.code,p.err.msg,gt(t,f+p.err.line))}else if(c)if(u.tagClosed){if(d.trim().length>0)return Ve("InvalidTag","Closing tag '"+l+"' can't have attributes or invalid starting.",gt(t,a));if(n.length===0)return Ve("InvalidTag","Closing tag '"+l+"' has not been opened.",gt(t,a));{const f=n.pop();if(l!==f.tagName){let p=gt(t,f.tagStartPos);return Ve("InvalidTag","Expected closing tag '"+f.tagName+"' (opened in line "+p.line+", col "+p.col+") instead of closing tag '"+l+"'.",gt(t,a))}n.length==0&&(i=!0)}}else return Ve("InvalidTag","Closing tag '"+l+"' doesn't have proper closing.",gt(t,s));else{const f=U1(d,e);if(f!==!0)return Ve(f.err.code,f.err.msg,gt(t,s-d.length+f.err.line));if(i===!0)return Ve("InvalidXml","Multiple possible root nodes found.",gt(t,s));e.unpairedTags.indexOf(l)!==-1||n.push({tagName:l,tagStartPos:a}),r=!0}for(s++;s<t.length;s++)if(t[s]==="<")if(t[s+1]==="!"){s++,s=D1(t,s);continue}else if(t[s+1]==="?"){if(s=B1(t,++s),s.err)return s}else break;else if(t[s]==="&"){const f=_E(t,s);if(f==-1)return Ve("InvalidChar","char '&' is not expected.",gt(t,s));s=f}else if(i===!0&&!L1(t[s]))return Ve("InvalidXml","Extra text at the end",gt(t,s));t[s]==="<"&&s--}}else{if(L1(t[s]))continue;return Ve("InvalidChar","char '"+t[s]+"' is not expected.",gt(t,s))}if(r){if(n.length==1)return Ve("InvalidTag","Unclosed tag '"+n[0].tagName+"'.",gt(t,n[0].tagStartPos));if(n.length>0)return Ve("InvalidXml","Invalid '"+JSON.stringify(n.map(s=>s.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return Ve("InvalidXml","Start tag expected.",1);return!0};function L1(t){return t===" "||t===" "||t===`
|
|
341
|
+
`||t==="\r"}function B1(t,e){const n=e;for(;e<t.length;e++)if(t[e]=="?"||t[e]==" "){const r=t.substr(n,e-n);if(e>5&&r==="xml")return Ve("InvalidXml","XML declaration allowed only at the start of the document.",gt(t,e));if(t[e]=="?"&&t[e+1]==">"){e++;break}else continue}return e}function D1(t,e){if(t.length>e+5&&t[e+1]==="-"&&t[e+2]==="-"){for(e+=3;e<t.length;e++)if(t[e]==="-"&&t[e+1]==="-"&&t[e+2]===">"){e+=2;break}}else if(t.length>e+8&&t[e+1]==="D"&&t[e+2]==="O"&&t[e+3]==="C"&&t[e+4]==="T"&&t[e+5]==="Y"&&t[e+6]==="P"&&t[e+7]==="E"){let n=1;for(e+=8;e<t.length;e++)if(t[e]==="<")n++;else if(t[e]===">"&&(n--,n===0))break}else if(t.length>e+9&&t[e+1]==="["&&t[e+2]==="C"&&t[e+3]==="D"&&t[e+4]==="A"&&t[e+5]==="T"&&t[e+6]==="A"&&t[e+7]==="["){for(e+=8;e<t.length;e++)if(t[e]==="]"&&t[e+1]==="]"&&t[e+2]===">"){e+=2;break}}return e}const pE='"',fE="'";function hE(t,e){let n="",r="",i=!1;for(;e<t.length;e++){if(t[e]===pE||t[e]===fE)r===""?r=t[e]:r!==t[e]||(r="");else if(t[e]===">"&&r===""){i=!0;break}n+=t[e]}return r!==""?!1:{value:n,index:e,tagClosed:i}}const gE=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function U1(t,e){const n=nh.getAllMatches(t,gE),r={};for(let i=0;i<n.length;i++){if(n[i][1].length===0)return Ve("InvalidAttr","Attribute '"+n[i][2]+"' has no space in starting.",yo(n[i]));if(n[i][3]!==void 0&&n[i][4]===void 0)return Ve("InvalidAttr","Attribute '"+n[i][2]+"' is without value.",yo(n[i]));if(n[i][3]===void 0&&!e.allowBooleanAttributes)return Ve("InvalidAttr","boolean attribute '"+n[i][2]+"' is not allowed.",yo(n[i]));const s=n[i][2];if(!yE(s))return Ve("InvalidAttr","Attribute '"+s+"' is an invalid name.",yo(n[i]));if(!r.hasOwnProperty(s))r[s]=1;else return Ve("InvalidAttr","Attribute '"+s+"' is repeated.",yo(n[i]))}return!0}function mE(t,e){let n=/\d/;for(t[e]==="x"&&(e++,n=/[\da-fA-F]/);e<t.length;e++){if(t[e]===";")return e;if(!t[e].match(n))break}return-1}function _E(t,e){if(e++,t[e]===";")return-1;if(t[e]==="#")return e++,mE(t,e);let n=0;for(;e<t.length;e++,n++)if(!(t[e].match(/\w/)&&n<20)){if(t[e]===";")break;return-1}return e}function Ve(t,e,n){return{err:{code:t,msg:e,line:n.line||n,col:n.col}}}function yE(t){return nh.isName(t)}function bE(t){return nh.isName(t)}function gt(t,e){const n=t.substring(0,e).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function yo(t){return t.startIndex+t[1].length}var rh={};const Hv={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,n){return t}},wE=function(t){return Object.assign({},Hv,t)};rh.buildOptions=wE;rh.defaultOptions=Hv;class vE{constructor(e){this.tagname=e,this.child=[],this[":@"]={}}add(e,n){e==="__proto__"&&(e="#__proto__"),this.child.push({[e]:n})}addChild(e){e.tagname==="__proto__"&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child})}}var xE=vE;const kE=au;function $E(t,e){const n={};if(t[e+3]==="O"&&t[e+4]==="C"&&t[e+5]==="T"&&t[e+6]==="Y"&&t[e+7]==="P"&&t[e+8]==="E"){e=e+9;let r=1,i=!1,s=!1,a="";for(;e<t.length;e++)if(t[e]==="<"&&!s){if(i&&AE(t,e)){e+=7;let c,l;[c,l,e]=SE(t,e+1),l.indexOf("&")===-1&&(n[IE(c)]={regx:RegExp(`&${c};`,"g"),val:l})}else if(i&&EE(t,e))e+=8;else if(i&&CE(t,e))e+=8;else if(i&&NE(t,e))e+=9;else if(zE)s=!0;else throw new Error("Invalid DOCTYPE");r++,a=""}else if(t[e]===">"){if(s?t[e-1]==="-"&&t[e-2]==="-"&&(s=!1,r--):r--,r===0)break}else t[e]==="["?i=!0:a+=t[e];if(r!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:n,i:e}}function SE(t,e){let n="";for(;e<t.length&&t[e]!=="'"&&t[e]!=='"';e++)n+=t[e];if(n=n.trim(),n.indexOf(" ")!==-1)throw new Error("External entites are not supported");const r=t[e++];let i="";for(;e<t.length&&t[e]!==r;e++)i+=t[e];return[n,i,e]}function zE(t,e){return t[e+1]==="!"&&t[e+2]==="-"&&t[e+3]==="-"}function AE(t,e){return t[e+1]==="!"&&t[e+2]==="E"&&t[e+3]==="N"&&t[e+4]==="T"&&t[e+5]==="I"&&t[e+6]==="T"&&t[e+7]==="Y"}function EE(t,e){return t[e+1]==="!"&&t[e+2]==="E"&&t[e+3]==="L"&&t[e+4]==="E"&&t[e+5]==="M"&&t[e+6]==="E"&&t[e+7]==="N"&&t[e+8]==="T"}function CE(t,e){return t[e+1]==="!"&&t[e+2]==="A"&&t[e+3]==="T"&&t[e+4]==="T"&&t[e+5]==="L"&&t[e+6]==="I"&&t[e+7]==="S"&&t[e+8]==="T"}function NE(t,e){return t[e+1]==="!"&&t[e+2]==="N"&&t[e+3]==="O"&&t[e+4]==="T"&&t[e+5]==="A"&&t[e+6]==="T"&&t[e+7]==="I"&&t[e+8]==="O"&&t[e+9]==="N"}function IE(t){if(kE.isName(t))return t;throw new Error(`Invalid entity name ${t}`)}var jE=$E;const TE=/^[-+]?0x[a-fA-F0-9]+$/,OE=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,PE={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function RE(t,e={}){if(e=Object.assign({},PE,e),!t||typeof t!="string")return t;let n=t.trim();if(e.skipLike!==void 0&&e.skipLike.test(n))return t;if(t==="0")return 0;if(e.hex&&TE.test(n))return BE(n,16);if(n.search(/[eE]/)!==-1){const r=n.match(/^([-\+])?(0*)([0-9]*(\.[0-9]*)?[eE][-\+]?[0-9]+)$/);if(r){if(e.leadingZeros)n=(r[1]||"")+r[3];else if(!(r[2]==="0"&&r[3][0]==="."))return t;return e.eNotation?Number(n):t}else return t}else{const r=OE.exec(n);if(r){const i=r[1],s=r[2];let a=LE(r[3]);if(!e.leadingZeros&&s.length>0&&i&&n[2]!=="."||!e.leadingZeros&&s.length>0&&!i&&n[1]!==".")return t;if(e.leadingZeros&&s===t)return 0;{const c=Number(n),l=""+c;return l.search(/[eE]/)!==-1?e.eNotation?c:t:n.indexOf(".")!==-1?l==="0"&&a===""||l===a||i&&l==="-"+a?c:t:s?a===l||i+a===l?c:t:n===l||n===i+l?c:t}}else return t}}function LE(t){return t&&t.indexOf(".")!==-1&&(t=t.replace(/0+$/,""),t==="."?t="0":t[0]==="."?t="0"+t:t[t.length-1]==="."&&(t=t.substr(0,t.length-1))),t}function BE(t,e){if(parseInt)return parseInt(t,e);if(Number.parseInt)return Number.parseInt(t,e);if(window&&window.parseInt)return window.parseInt(t,e);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}var DE=RE;function UE(t){return typeof t=="function"?t:Array.isArray(t)?e=>{for(const n of t)if(typeof n=="string"&&e===n||n instanceof RegExp&&n.test(e))return!0}:()=>!1}var Vv=UE;const Kv=au,bo=xE,ME=jE,qE=DE,FE=Vv;let HE=class{constructor(t){this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(e,n)=>String.fromCharCode(Number.parseInt(n,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(e,n)=>String.fromCharCode(Number.parseInt(n,16))}},this.addExternalEntities=VE,this.parseXml=XE,this.parseTextData=KE,this.resolveNameSpace=GE,this.buildAttributesMap=JE,this.isItStopNode=eC,this.replaceEntitiesValue=YE,this.readStopNodeData=nC,this.saveTextToParentTag=QE,this.addChild=ZE,this.ignoreAttributesFn=FE(this.options.ignoreAttributes)}};function VE(t){const e=Object.keys(t);for(let n=0;n<e.length;n++){const r=e[n];this.lastEntities[r]={regex:new RegExp("&"+r+";","g"),val:t[r]}}}function KE(t,e,n,r,i,s,a){if(t!==void 0&&(this.options.trimValues&&!r&&(t=t.trim()),t.length>0)){a||(t=this.replaceEntitiesValue(t));const c=this.options.tagValueProcessor(e,t,n,i,s);return c==null?t:typeof c!=typeof t||c!==t?c:this.options.trimValues?g0(t,this.options.parseTagValue,this.options.numberParseOptions):t.trim()===t?g0(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function GE(t){if(this.options.removeNSPrefix){const e=t.split(":"),n=t.charAt(0)==="/"?"/":"";if(e[0]==="xmlns")return"";e.length===2&&(t=n+e[1])}return t}const WE=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function JE(t,e,n){if(this.options.ignoreAttributes!==!0&&typeof t=="string"){const r=Kv.getAllMatches(t,WE),i=r.length,s={};for(let a=0;a<i;a++){const c=this.resolveNameSpace(r[a][1]);if(this.ignoreAttributesFn(c,e))continue;let l=r[a][4],u=this.options.attributeNamePrefix+c;if(c.length)if(this.options.transformAttributeName&&(u=this.options.transformAttributeName(u)),u==="__proto__"&&(u="#__proto__"),l!==void 0){this.options.trimValues&&(l=l.trim()),l=this.replaceEntitiesValue(l);const d=this.options.attributeValueProcessor(c,l,e);d==null?s[u]=l:typeof d!=typeof l||d!==l?s[u]=d:s[u]=g0(l,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(s[u]=!0)}if(!Object.keys(s).length)return;if(this.options.attributesGroupName){const a={};return a[this.options.attributesGroupName]=s,a}return s}}const XE=function(t){t=t.replace(/\r\n?/g,`
|
|
342
|
+
`);const e=new bo("!xml");let n=e,r="",i="";for(let s=0;s<t.length;s++)if(t[s]==="<")if(t[s+1]==="/"){const a=jr(t,">",s,"Closing Tag is not closed.");let c=t.substring(s+2,a).trim();if(this.options.removeNSPrefix){const d=c.indexOf(":");d!==-1&&(c=c.substr(d+1))}this.options.transformTagName&&(c=this.options.transformTagName(c)),n&&(r=this.saveTextToParentTag(r,n,i));const l=i.substring(i.lastIndexOf(".")+1);if(c&&this.options.unpairedTags.indexOf(c)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${c}>`);let u=0;l&&this.options.unpairedTags.indexOf(l)!==-1?(u=i.lastIndexOf(".",i.lastIndexOf(".")-1),this.tagsNodeStack.pop()):u=i.lastIndexOf("."),i=i.substring(0,u),n=this.tagsNodeStack.pop(),r="",s=a}else if(t[s+1]==="?"){let a=h0(t,s,!1,"?>");if(!a)throw new Error("Pi Tag is not closed.");if(r=this.saveTextToParentTag(r,n,i),!(this.options.ignoreDeclaration&&a.tagName==="?xml"||this.options.ignorePiTags)){const c=new bo(a.tagName);c.add(this.options.textNodeName,""),a.tagName!==a.tagExp&&a.attrExpPresent&&(c[":@"]=this.buildAttributesMap(a.tagExp,i,a.tagName)),this.addChild(n,c,i)}s=a.closeIndex+1}else if(t.substr(s+1,3)==="!--"){const a=jr(t,"-->",s+4,"Comment is not closed.");if(this.options.commentPropName){const c=t.substring(s+4,a-2);r=this.saveTextToParentTag(r,n,i),n.add(this.options.commentPropName,[{[this.options.textNodeName]:c}])}s=a}else if(t.substr(s+1,2)==="!D"){const a=ME(t,s);this.docTypeEntities=a.entities,s=a.i}else if(t.substr(s+1,2)==="!["){const a=jr(t,"]]>",s,"CDATA is not closed.")-2,c=t.substring(s+9,a);r=this.saveTextToParentTag(r,n,i);let l=this.parseTextData(c,n.tagname,i,!0,!1,!0,!0);l==null&&(l=""),this.options.cdataPropName?n.add(this.options.cdataPropName,[{[this.options.textNodeName]:c}]):n.add(this.options.textNodeName,l),s=a+2}else{let a=h0(t,s,this.options.removeNSPrefix),c=a.tagName;const l=a.rawTagName;let u=a.tagExp,d=a.attrExpPresent,f=a.closeIndex;this.options.transformTagName&&(c=this.options.transformTagName(c)),n&&r&&n.tagname!=="!xml"&&(r=this.saveTextToParentTag(r,n,i,!1));const p=n;if(p&&this.options.unpairedTags.indexOf(p.tagname)!==-1&&(n=this.tagsNodeStack.pop(),i=i.substring(0,i.lastIndexOf("."))),c!==e.tagname&&(i+=i?"."+c:c),this.isItStopNode(this.options.stopNodes,i,c)){let h="";if(u.length>0&&u.lastIndexOf("/")===u.length-1)c[c.length-1]==="/"?(c=c.substr(0,c.length-1),i=i.substr(0,i.length-1),u=c):u=u.substr(0,u.length-1),s=a.closeIndex;else if(this.options.unpairedTags.indexOf(c)!==-1)s=a.closeIndex;else{const y=this.readStopNodeData(t,l,f+1);if(!y)throw new Error(`Unexpected end of ${l}`);s=y.i,h=y.tagContent}const m=new bo(c);c!==u&&d&&(m[":@"]=this.buildAttributesMap(u,i,c)),h&&(h=this.parseTextData(h,c,i,!0,d,!0,!0)),i=i.substr(0,i.lastIndexOf(".")),m.add(this.options.textNodeName,h),this.addChild(n,m,i)}else{if(u.length>0&&u.lastIndexOf("/")===u.length-1){c[c.length-1]==="/"?(c=c.substr(0,c.length-1),i=i.substr(0,i.length-1),u=c):u=u.substr(0,u.length-1),this.options.transformTagName&&(c=this.options.transformTagName(c));const h=new bo(c);c!==u&&d&&(h[":@"]=this.buildAttributesMap(u,i,c)),this.addChild(n,h,i),i=i.substr(0,i.lastIndexOf("."))}else{const h=new bo(c);this.tagsNodeStack.push(n),c!==u&&d&&(h[":@"]=this.buildAttributesMap(u,i,c)),this.addChild(n,h,i),n=h}r="",s=f}}else r+=t[s];return e.child};function ZE(t,e,n){const r=this.options.updateTag(e.tagname,n,e[":@"]);r===!1||(typeof r=="string"&&(e.tagname=r),t.addChild(e))}const YE=function(t){if(this.options.processEntities){for(let e in this.docTypeEntities){const n=this.docTypeEntities[e];t=t.replace(n.regx,n.val)}for(let e in this.lastEntities){const n=this.lastEntities[e];t=t.replace(n.regex,n.val)}if(this.options.htmlEntities)for(let e in this.htmlEntities){const n=this.htmlEntities[e];t=t.replace(n.regex,n.val)}t=t.replace(this.ampEntity.regex,this.ampEntity.val)}return t};function QE(t,e,n,r){return t&&(r===void 0&&(r=e.child.length===0),t=this.parseTextData(t,e.tagname,n,!1,e[":@"]?Object.keys(e[":@"]).length!==0:!1,r),t!==void 0&&t!==""&&e.add(this.options.textNodeName,t),t=""),t}function eC(t,e,n){const r="*."+n;for(const i in t){const s=t[i];if(r===s||e===s)return!0}return!1}function tC(t,e,n=">"){let r,i="";for(let s=e;s<t.length;s++){let a=t[s];if(r)a===r&&(r="");else if(a==='"'||a==="'")r=a;else if(a===n[0])if(n[1]){if(t[s+1]===n[1])return{data:i,index:s}}else return{data:i,index:s};else a===" "&&(a=" ");i+=a}}function jr(t,e,n,r){const i=t.indexOf(e,n);if(i===-1)throw new Error(r);return i+e.length-1}function h0(t,e,n,r=">"){const i=tC(t,e+1,r);if(!i)return;let s=i.data;const a=i.index,c=s.search(/\s/);let l=s,u=!0;c!==-1&&(l=s.substring(0,c),s=s.substring(c+1).trimStart());const d=l;if(n){const f=l.indexOf(":");f!==-1&&(l=l.substr(f+1),u=l!==i.data.substr(f+1))}return{tagName:l,tagExp:s,closeIndex:a,attrExpPresent:u,rawTagName:d}}function nC(t,e,n){const r=n;let i=1;for(;n<t.length;n++)if(t[n]==="<")if(t[n+1]==="/"){const s=jr(t,">",n,`${e} is not closed`);if(t.substring(n+2,s).trim()===e&&(i--,i===0))return{tagContent:t.substring(r,n),i:s};n=s}else if(t[n+1]==="?")n=jr(t,"?>",n+1,"StopNode is not closed.");else if(t.substr(n+1,3)==="!--")n=jr(t,"-->",n+3,"StopNode is not closed.");else if(t.substr(n+1,2)==="![")n=jr(t,"]]>",n,"StopNode is not closed.")-2;else{const s=h0(t,n,">");s&&((s&&s.tagName)===e&&s.tagExp[s.tagExp.length-1]!=="/"&&i++,n=s.closeIndex)}}function g0(t,e,n){if(e&&typeof t=="string"){const r=t.trim();return r==="true"?!0:r==="false"?!1:qE(t,n)}else return Kv.isExist(t)?t:""}var rC=HE,Gv={};function iC(t,e){return Wv(t,e)}function Wv(t,e,n){let r;const i={};for(let s=0;s<t.length;s++){const a=t[s],c=oC(a);let l="";if(n===void 0?l=c:l=n+"."+c,c===e.textNodeName)r===void 0?r=a[c]:r+=""+a[c];else{if(c===void 0)continue;if(a[c]){let u=Wv(a[c],e,l);const d=aC(u,e);a[":@"]?sC(u,a[":@"],l,e):Object.keys(u).length===1&&u[e.textNodeName]!==void 0&&!e.alwaysCreateTextNode?u=u[e.textNodeName]:Object.keys(u).length===0&&(e.alwaysCreateTextNode?u[e.textNodeName]="":u=""),i[c]!==void 0&&i.hasOwnProperty(c)?(Array.isArray(i[c])||(i[c]=[i[c]]),i[c].push(u)):e.isArray(c,l,d)?i[c]=[u]:i[c]=u}}}return typeof r=="string"?r.length>0&&(i[e.textNodeName]=r):r!==void 0&&(i[e.textNodeName]=r),i}function oC(t){const e=Object.keys(t);for(let n=0;n<e.length;n++){const r=e[n];if(r!==":@")return r}}function sC(t,e,n,r){if(e){const i=Object.keys(e),s=i.length;for(let a=0;a<s;a++){const c=i[a];r.isArray(c,n+"."+c,!0,!0)?t[c]=[e[c]]:t[c]=e[c]}}}function aC(t,e){const{textNodeName:n}=e,r=Object.keys(t).length;return!!(r===0||r===1&&(t[n]||typeof t[n]=="boolean"||t[n]===0))}Gv.prettify=iC;const{buildOptions:cC}=rh,lC=rC,{prettify:uC}=Gv,dC=Fv;let pC=class{constructor(t){this.externalEntities={},this.options=cC(t)}parse(t,e){if(typeof t!="string")if(t.toString)t=t.toString();else throw new Error("XML data is accepted in String or Bytes[] form.");if(e){e===!0&&(e={});const i=dC.validate(t,e);if(i!==!0)throw Error(`${i.err.msg}:${i.err.line}:${i.err.col}`)}const n=new lC(this.options);n.addExternalEntities(this.externalEntities);const r=n.parseXml(t);return this.options.preserveOrder||r===void 0?r:uC(r,this.options)}addEntity(t,e){if(e.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(t.indexOf("&")!==-1||t.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'");if(e==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=e}};var fC=pC;const hC=`
|
|
343
|
+
`;function gC(t,e){let n="";return e.format&&e.indentBy.length>0&&(n=hC),Jv(t,e,"",n)}function Jv(t,e,n,r){let i="",s=!1;for(let a=0;a<t.length;a++){const c=t[a],l=mC(c);if(l===void 0)continue;let u="";if(n.length===0?u=l:u=`${n}.${l}`,l===e.textNodeName){let m=c[l];_C(u,e)||(m=e.tagValueProcessor(l,m),m=Xv(m,e)),s&&(i+=r),i+=m,s=!1;continue}else if(l===e.cdataPropName){s&&(i+=r),i+=`<![CDATA[${c[l][0][e.textNodeName]}]]>`,s=!1;continue}else if(l===e.commentPropName){i+=r+`<!--${c[l][0][e.textNodeName]}-->`,s=!0;continue}else if(l[0]==="?"){const m=M1(c[":@"],e),y=l==="?xml"?"":r;let w=c[l][0][e.textNodeName];w=w.length!==0?" "+w:"",i+=y+`<${l}${w}${m}?>`,s=!0;continue}let d=r;d!==""&&(d+=e.indentBy);const f=M1(c[":@"],e),p=r+`<${l}${f}`,h=Jv(c[l],e,u,d);e.unpairedTags.indexOf(l)!==-1?e.suppressUnpairedNode?i+=p+">":i+=p+"/>":(!h||h.length===0)&&e.suppressEmptyNode?i+=p+"/>":h&&h.endsWith(">")?i+=p+`>${h}${r}</${l}>`:(i+=p+">",h&&r!==""&&(h.includes("/>")||h.includes("</"))?i+=r+e.indentBy+h+r:i+=h,i+=`</${l}>`),s=!0}return i}function mC(t){const e=Object.keys(t);for(let n=0;n<e.length;n++){const r=e[n];if(t.hasOwnProperty(r)&&r!==":@")return r}}function M1(t,e){let n="";if(t&&!e.ignoreAttributes)for(let r in t){if(!t.hasOwnProperty(r))continue;let i=e.attributeValueProcessor(r,t[r]);i=Xv(i,e),i===!0&&e.suppressBooleanAttributes?n+=` ${r.substr(e.attributeNamePrefix.length)}`:n+=` ${r.substr(e.attributeNamePrefix.length)}="${i}"`}return n}function _C(t,e){t=t.substr(0,t.length-e.textNodeName.length-1);let n=t.substr(t.lastIndexOf(".")+1);for(let r in e.stopNodes)if(e.stopNodes[r]===t||e.stopNodes[r]==="*."+n)return!0;return!1}function Xv(t,e){if(t&&t.length>0&&e.processEntities)for(let n=0;n<e.entities.length;n++){const r=e.entities[n];t=t.replace(r.regex,r.val)}return t}var yC=gC;const bC=yC,wC=Vv,vC={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&"},{regex:new RegExp(">","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function br(t){this.options=Object.assign({},vC,t),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=wC(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=$C),this.processTextOrObjNode=xC,this.options.format?(this.indentate=kC,this.tagEndChar=`>
|
|
344
|
+
`,this.newLine=`
|
|
345
|
+
`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}br.prototype.build=function(t){return this.options.preserveOrder?bC(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t={[this.options.arrayNodeName]:t}),this.j2x(t,0,[]).val)};br.prototype.j2x=function(t,e,n){let r="",i="";const s=n.join(".");for(let a in t)if(Object.prototype.hasOwnProperty.call(t,a))if(typeof t[a]>"u")this.isAttribute(a)&&(i+="");else if(t[a]===null)this.isAttribute(a)||a===this.options.cdataPropName?i+="":a[0]==="?"?i+=this.indentate(e)+"<"+a+"?"+this.tagEndChar:i+=this.indentate(e)+"<"+a+"/"+this.tagEndChar;else if(t[a]instanceof Date)i+=this.buildTextValNode(t[a],a,"",e);else if(typeof t[a]!="object"){const c=this.isAttribute(a);if(c&&!this.ignoreAttributesFn(c,s))r+=this.buildAttrPairStr(c,""+t[a]);else if(!c)if(a===this.options.textNodeName){let l=this.options.tagValueProcessor(a,""+t[a]);i+=this.replaceEntitiesValue(l)}else i+=this.buildTextValNode(t[a],a,"",e)}else if(Array.isArray(t[a])){const c=t[a].length;let l="",u="";for(let d=0;d<c;d++){const f=t[a][d];if(!(typeof f>"u"))if(f===null)a[0]==="?"?i+=this.indentate(e)+"<"+a+"?"+this.tagEndChar:i+=this.indentate(e)+"<"+a+"/"+this.tagEndChar;else if(typeof f=="object")if(this.options.oneListGroup){const p=this.j2x(f,e+1,n.concat(a));l+=p.val,this.options.attributesGroupName&&f.hasOwnProperty(this.options.attributesGroupName)&&(u+=p.attrStr)}else l+=this.processTextOrObjNode(f,a,e,n);else if(this.options.oneListGroup){let p=this.options.tagValueProcessor(a,f);p=this.replaceEntitiesValue(p),l+=p}else l+=this.buildTextValNode(f,a,"",e)}this.options.oneListGroup&&(l=this.buildObjectNode(l,a,u,e)),i+=l}else if(this.options.attributesGroupName&&a===this.options.attributesGroupName){const c=Object.keys(t[a]),l=c.length;for(let u=0;u<l;u++)r+=this.buildAttrPairStr(c[u],""+t[a][c[u]])}else i+=this.processTextOrObjNode(t[a],a,e,n);return{attrStr:r,val:i}};br.prototype.buildAttrPairStr=function(t,e){return e=this.options.attributeValueProcessor(t,""+e),e=this.replaceEntitiesValue(e),this.options.suppressBooleanAttributes&&e==="true"?" "+t:" "+t+'="'+e+'"'};function xC(t,e,n,r){const i=this.j2x(t,n+1,r.concat(e));return t[this.options.textNodeName]!==void 0&&Object.keys(t).length===1?this.buildTextValNode(t[this.options.textNodeName],e,i.attrStr,n):this.buildObjectNode(i.val,e,i.attrStr,n)}br.prototype.buildObjectNode=function(t,e,n,r){if(t==="")return e[0]==="?"?this.indentate(r)+"<"+e+n+"?"+this.tagEndChar:this.indentate(r)+"<"+e+n+this.closeTag(e)+this.tagEndChar;{let i="</"+e+this.tagEndChar,s="";return e[0]==="?"&&(s="?",i=""),(n||n==="")&&t.indexOf("<")===-1?this.indentate(r)+"<"+e+n+s+">"+t+i:this.options.commentPropName!==!1&&e===this.options.commentPropName&&s.length===0?this.indentate(r)+`<!--${t}-->`+this.newLine:this.indentate(r)+"<"+e+n+s+this.tagEndChar+t+this.indentate(r)+i}};br.prototype.closeTag=function(t){let e="";return this.options.unpairedTags.indexOf(t)!==-1?this.options.suppressUnpairedNode||(e="/"):this.options.suppressEmptyNode?e="/":e=`></${t}`,e};br.prototype.buildTextValNode=function(t,e,n,r){if(this.options.cdataPropName!==!1&&e===this.options.cdataPropName)return this.indentate(r)+`<![CDATA[${t}]]>`+this.newLine;if(this.options.commentPropName!==!1&&e===this.options.commentPropName)return this.indentate(r)+`<!--${t}-->`+this.newLine;if(e[0]==="?")return this.indentate(r)+"<"+e+n+"?"+this.tagEndChar;{let i=this.options.tagValueProcessor(e,t);return i=this.replaceEntitiesValue(i),i===""?this.indentate(r)+"<"+e+n+this.closeTag(e)+this.tagEndChar:this.indentate(r)+"<"+e+n+">"+i+"</"+e+this.tagEndChar}};br.prototype.replaceEntitiesValue=function(t){if(t&&t.length>0&&this.options.processEntities)for(let e=0;e<this.options.entities.length;e++){const n=this.options.entities[e];t=t.replace(n.regex,n.val)}return t};function kC(t){return this.options.indentBy.repeat(t)}function $C(t){return t.startsWith(this.options.attributeNamePrefix)&&t!==this.options.textNodeName?t.substr(this.attrPrefixLen):!1}var SC=br;const zC=fC,AC=SC;var Zv={XMLParser:zC,XMLBuilder:AC};class Yv{constructor(e,n){if(ji(this,"alphabet"),ji(this,"padding"),ji(this,"decodeMap",new Map),e.length!==32)throw new Error("Invalid alphabet");if(this.alphabet=e,this.padding=n?.padding??"=",this.alphabet.includes(this.padding)||this.padding.length!==1)throw new Error("Invalid padding");for(let r=0;r<e.length;r++)this.decodeMap.set(e[r],r)}encode(e,n){let r="",i=0,s=0;for(let a=0;a<e.length;a++)for(i=i<<8|e[a],s+=8;s>=5;)s-=5,r+=this.alphabet[i>>s&31];if(s>0&&(r+=this.alphabet[i<<5-s&31]),n?.includePadding??!0){const a=(8-r.length%8)%8;for(let c=0;c<a;c++)r+="="}return r}decode(e,n){const r=n?.strict??!0,i=Math.ceil(e.length/8),s=[];for(let a=0;a<i;a++){let c=0;const l=[];for(let d=0;d<8;d++){const f=e[a*8+d];if(f==="="){if(a+1!==i)throw new Error(`Invalid character: ${f}`);c+=1;continue}if(f===void 0){if(r)throw new Error("Invalid data");c+=1;continue}const p=this.decodeMap.get(f)??null;if(p===null)throw new Error(`Invalid character: ${f}`);l.push(p)}if(c===8||c===7||c===5||c===2)throw new Error("Invalid padding");const u=(l[0]<<3)+(l[1]>>2);if(s.push(u),c<6){const d=((l[1]&3)<<6)+(l[2]<<1)+(l[3]>>4);s.push(d)}if(c<4){const d=((l[3]&255)<<4)+(l[4]>>1);s.push(d)}if(c<3){const d=((l[4]&1)<<7)+(l[5]<<2)+(l[6]>>3);s.push(d)}if(c<1){const d=((l[6]&7)<<5)+l[7];s.push(d)}}return Uint8Array.from(s)}}new Yv("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567");new Yv("0123456789ABCDEFGHIJKLMNOPQRSTUV");class Qv{constructor(e,n){if(ji(this,"alphabet"),ji(this,"padding"),ji(this,"decodeMap",new Map),e.length!==64)throw new Error("Invalid alphabet");if(this.alphabet=e,this.padding=n?.padding??"=",this.alphabet.includes(this.padding)||this.padding.length!==1)throw new Error("Invalid padding");for(let r=0;r<e.length;r++)this.decodeMap.set(e[r],r)}encode(e,n){let r="",i=0,s=0;for(let a=0;a<e.length;a++)for(i=i<<8|e[a],s+=8;s>=6;)s+=-6,r+=this.alphabet[i>>s&63];if(s>0&&(r+=this.alphabet[i<<6-s&63]),n?.includePadding??!0){const a=(4-r.length%4)%4;for(let c=0;c<a;c++)r+="="}return r}decode(e,n){const r=n?.strict??!0,i=Math.ceil(e.length/4),s=[];for(let a=0;a<i;a++){let c=0,l=0;for(let u=0;u<4;u++){const d=e[a*4+u];if(d==="="){if(a+1!==i)throw new Error(`Invalid character: ${d}`);c+=1;continue}if(d===void 0){if(r)throw new Error("Invalid data");c+=1;continue}const f=this.decodeMap.get(d)??null;if(f===null)throw new Error(`Invalid character: ${d}`);l+=f<<6*(3-u)}s.push(l>>16&255),c<2&&s.push(l>>8&255),c<1&&s.push(l&255)}return Uint8Array.from(s)}}const EC=new Qv("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/");new Qv("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_");async function CC(t){const e=new DecompressionStream("deflate-raw"),n=new Uint8Array(t),r=new Blob([n]).stream().pipeThrough(e);return new Uint8Array(await new Response(r).arrayBuffer())}async function NC(t){const e=await EC.decode(t.replace(/ /g,"+"));try{const n=await CC(e);return new TextDecoder().decode(n)}catch(n){return console.warn("Decompression failed, assuming data is not compressed:",n),new TextDecoder().decode(e)}}async function IC(t){const e=await NC(t),n=new Zv.XMLParser({attributeNamePrefix:"@_",alwaysCreateTextNode:!0,ignoreAttributes:!1}).parse(e);return cE.parse(n)}function jC(t){const e=t.certificates.map(r=>({"@_use":"signing",KeyInfo:{"@_xmlns":"http://www.w3.org/2000/09/xmldsig#",X509Data:{X509Certificate:r}}})),n={EntityDescriptor:{"@_entityID":t.entityId,"@_xmlns":"urn:oasis:names:tc:SAML:2.0:metadata",IDPSSODescriptor:{"@_protocolSupportEnumeration":"urn:oasis:names:tc:SAML:2.0:protocol",KeyDescriptor:e,SingleLogoutService:[{"@_Binding":"urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect","@_Location":t.singleLogoutServiceUrl},{"@_Binding":"urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST","@_Location":t.singleLogoutServiceUrl}],NameIDFormat:["urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress","urn:oasis:names:tc:SAML:2.0:nameid-format:persistent","urn:oasis:names:tc:SAML:2.0:nameid-format:transient"],SingleSignOnService:[{"@_Binding":"urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect","@_Location":t.assertionConsumerServiceUrl},{"@_Binding":"urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST","@_Location":t.assertionConsumerServiceUrl}],Attribute:[{"@_Name":"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress","@_NameFormat":"urn:oasis:names:tc:SAML:2.0:attrname-format:uri","@_FriendlyName":"E-Mail Address","@_xmlns":"urn:oasis:names:tc:SAML:2.0:assertion"},{"@_Name":"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname","@_NameFormat":"urn:oasis:names:tc:SAML:2.0:attrname-format:uri","@_FriendlyName":"Given Name","@_xmlns":"urn:oasis:names:tc:SAML:2.0:assertion"},{"@_Name":"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name","@_NameFormat":"urn:oasis:names:tc:SAML:2.0:attrname-format:uri","@_FriendlyName":"Name","@_xmlns":"urn:oasis:names:tc:SAML:2.0:assertion"},{"@_Name":"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname","@_NameFormat":"urn:oasis:names:tc:SAML:2.0:attrname-format:uri","@_FriendlyName":"Surname","@_xmlns":"urn:oasis:names:tc:SAML:2.0:assertion"},{"@_Name":"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier","@_NameFormat":"urn:oasis:names:tc:SAML:2.0:attrname-format:uri","@_FriendlyName":"Name ID","@_xmlns":"urn:oasis:names:tc:SAML:2.0:assertion"}]}}};return new Zv.XMLBuilder({ignoreAttributes:!1,suppressEmptyNode:!0,preserveOrder:!1,format:!0,attributeNamePrefix:"@_"}).build(n)}const TC=new o.OpenAPIHono().openapi(o.createRoute({tags:["saml"],method:"get",path:"/metadata/{client_id}",request:{params:o.z.object({client_id:o.z.string()})},responses:{200:{description:"Decoded SAML Request",content:{"text/xml":{schema:o.z.string()}}},400:{description:"Bad Request"}}}),async t=>{const{client_id:e}=t.req.valid("param"),n=await t.env.data.legacyClients.get(e);if(!n)throw new I(404,{message:"Client not found"});const{signingKeys:r}=await t.env.data.keys.list({q:"type:saml_encryption"});if(r.length===0)throw new I(500,{message:"No signing key found"});const i=r.map(c=>new Wl(c.cert).toString("base64")),s=t.env.ISSUER,a=jC({entityId:n.addons?.samlp?.audience||n.client_id,certificates:i,assertionConsumerServiceUrl:`${s}samlp/${e}`,singleLogoutServiceUrl:`${s}samlp/${e}/logout`});return new Response(a,{headers:{"Content-Type":"text/xml"}})}).openapi(o.createRoute({tags:["saml"],method:"get",path:"/{client_id}",request:{query:o.z.object({SAMLRequest:o.z.string(),RelayState:o.z.string().optional(),SigAlg:o.z.string().optional(),Signature:o.z.string().optional()}),params:o.z.object({client_id:o.z.string()})},responses:{200:{description:"Decoded SAML Request",content:{"text/xml":{schema:o.z.string()}}},400:{description:"Bad Request"}}}),async t=>{const{client_id:e}=t.req.valid("param"),{SAMLRequest:n,RelayState:r}=t.req.valid("query"),i=await t.env.data.legacyClients.get(e);if(!i)throw new I(404,{message:"Client not found"});t.set("client_id",i.client_id),t.set("tenant_id",i.tenant.id);const s=await IC(n),a=s["samlp:AuthnRequest"]["saml:Issuer"]["#text"],c=await t.env.data.loginSessions.create(t.var.tenant_id,{csrf_token:je(),authParams:{client_id:e,state:JSON.stringify({requestId:s["samlp:AuthnRequest"]["@_ID"],relayState:r}),response_mode:_n.SAML_POST,redirect_uri:s["samlp:AuthnRequest"]["@_AssertionConsumerServiceURL"],audience:a},expires_at:new Date(Date.now()+Lr*1e3).toISOString(),ip:t.get("ip"),useragent:t.get("useragent"),auth0Client:Hn(t.get("auth0_client"))});return t.redirect(`/u/login/identifier?state=${c.id}`)});function OC(t){const e=new o.OpenAPIHono;e.use(async(r,i)=>{const s=zs(r,t.dataAdapter),a=t.dataAdapter.cache||Xs({defaultTtlSeconds:0,maxEntries:100,cleanupIntervalMs:0}),c=t.dataAdapter.cache?300:0,l=Yl(s,{defaultTtl:c,cacheEntities:["tenants","connections","clients","branding","themes","promptSettings","forms"],cache:a});return r.env.data=Zl(r,l),i()}),e.use(Js).use(Ws).use(Xl(e));const n=e.route("/",TC);return n.doc("/spec",{openapi:"3.0.0",info:{version:"1.0.0",title:"SAML API"},security:[{oauth2:["openid","email","profile"]}]}),Nf(n),n}const PC="Account detected",RC="Manage your account details",LC="Account",BC="We have detected that you have already created an account through",DC="By signing in, you agree to our",UC="and",MC="email address",qC="email or phone number",FC="phone number",HC="Callback URL mismatch",VC="The provided redirect_uri is not in the list of allowed callback URLs.",KC="Change email address",GC="continue with user",WC="Please click the button to create a new password account.",JC="Enter the code at {{vendorName}} to complete the login",XC="Welcome to {{vendorName}}! {{code}} is the login code",ZC="Welcome to {{vendorName}}! {{code}} is the login code",YC="Code expired",QC="Invalid code",eN="Please check <0>{{username}}</0> and enter the six-digit code that we've sent you.",tN="The code is already used",nN="The code is valid for 30 minutes",rN="A configuration error occurred.",iN="Confirm password",oN="Are you sure you want to unlink this account?",sN="Need Help?",aN="Contact us",cN="or continue with social account",lN="Continue with {{provider}}",uN="Would you like to continue with your existing account?",dN="Copyright © 2023 SESAMY. All rights reserved.",pN="©2023 Sesamy",fN="Choose a password with a mix of uppercase and lowercase letters, numbers, and symbols.",hN="Please enter a valid email address.",gN="The passwords didn't match. Try again.",mN="Choose password",_N="Password must be at least 8 characters long and contain at least one lowercase letter, one uppercase letter, one number and one symbol.",yN="Create new account",bN="Sign up with password",wN="Current email address",vN="You are currently logged in as <0>{{email}}</0>",xN="Edit",kN="Email",$N="Email is already taken",SN="Email changed to <0>{{email}}</0> ",zN="Email or Phone Number",AN="Email address",EN="Your email address has been validated",CN="Now enter your password to login again",NN="An email has been sent to <0>{{email}}</0> with a verification link. Please click the link to verify your email address and set a password.",IN="Email verification sent",jN="Do you have to keep logging in?",TN="You are currently inside the {{browserName}}. This browser often logs you out, so we recommend using your phone's default browser instead.",ON="Enter a code",PN="We'll send you a verification link to ensure you own this email address.",RN="Enter new email",LN="Enter new password",BN="Enter password",DN="Enter your email address and password to login.",UN="Enter your password",MN="Something went wrong",qN="The magic link has expired. Please click on the button below to receive a new link in your inbox.",FN="Hey! We updated our login experience. <0>Click here to learn more about it.</0>",HN="Send password reset email",VN="Click the button below and we’ll send instructions on how to reset your password.",KN="Password reset email sent",GN="Forgot password?",WN="Forgot password?",JN="Go back",XN="Hide password",ZN="Incognito Mode Detected",YN="You are in incognito/private mode. Session data may not persist across page refreshes. Some features might not work as expected.",QN="Invalid identifier",eI="Invalid password",tI=`The link is no longer valid.
|
|
346
|
+
|
|
347
|
+
Please make sure to open the login link in the same browser you started the login with.
|
|
348
|
+
|
|
349
|
+
You can click the link below to start a new login.`,nI="Invalid link",rI="Linked accounts",iI="Click the button to log in",oI="Login",sI="Or enter the code at {{vendorName}} to complete the login.",aI="Enter your email address to unlock this show on {{service}}",cI="Link your account with {{service}}",lI="You are logged in as",uI="Login",dI="Enter your email address to sign in.",pI="Enter your email address and we will send you a login code.",fI="Enter your email or phone number to sign in",hI="Enter your email address and we will send you a login link.",gI="Enter your phone number to sign in",mI="Enter your {{authMethod}} to sign in.",_I="Log out",yI="New email address",bI="A one-time code will be sent to your new email address, enter the code in the next step.",wI="No email address set",vI="No, I want to use another account",xI="or",kI="Password",$I="Password contains a forbidden word",SI="Password cannot contain personal information like your name or email",zI="The password has been reset",AI="Success",EI="Password must contain at least one lowercase letter",CI="Password must contain at least one number",NI="Password must contain at least one special character",II="Password must contain at least one uppercase letter",jI="Code not found or expired",TI="The password could not be reset",OI="Password was used recently and cannot be reused",PI="Password must be at least {{minLength}} characters",RI="Change password for your {{vendorName}} account",LI="Change password for your {{vendorName}} account",BI="Phone number",DI="Privacy Policy",UI="Redirecting",MI="Confirm password",qI="Register a new password",FI="Resend code",HI="Change password",VI="Enter your new password below for the email account: ",KI="Click the button to reset your password",GI="Click the button to reset your password",WI="Reset your password",JI="Change password for your {{vendorName}} account",XI="Reset password",ZI="Send",YI="Send me a new magic link",QI="Remember to check your spam folder if the email did not arrive.",ej="Set password",tj="Show password",nj="Sign in",rj="Signup",ij="Sign up successful",oj="{{code}} is your login code for {{vendorName}}",sj="It appears that your Spotify account is currently linked to another Sesamy account. But fear not, we're here to guide you through the process to get this fixed.",aj="Go to Spotify's Content Access page",cj=`Let's start by unlinking your Spotify account. Click the button below to go to Spotify's Content Access page. After you've logged in to your Spotify account, find Sesamy on the list of connected platforms. Click "Unlink" next to the Sesamy logo.`,lj="Step 1: Unlink Your Spotify Account",uj="Once you've successfully unlinked your Spotify account, you can relink it to Sesamy. Simply repeat the steps you previously took that led you to this page.",dj="Step 2: Relink Your Spotify Account to Sesamy",pj="Oops! Your Spotify Account Is Already Linked",fj="Success",hj="If you have questions or need assistance, you can contact our support team",gj="Terms and Conditions",mj="Something went wrong. Please try again.",_j="Unlink",yj="Your email address needs validating. We have sent a new email to your inbox",bj="Update email",wj="User account does not exist",vj="User account does not exist",xj="We could not find a user with the provided email address. Please, try again.",kj="Try again.",$j="Validate code",Sj="Check your inbox for email validation instructions.",zj="Signed up",Aj="Click the button to verify your email address",Ej="Validate your email address",Cj="Validate your email address",Nj="Verify account",Ij="Verify your email",jj="Welcome",Tj="Welcome to your {{vendorName}} account!",Oj="Please check your email at <0>{{email}}</0> and enter the six-digit code that we've sent you.",Pj="Continue with this account",Rj="Yes, continue with {{text}}",Lj="Yes, continue with existing account",Bj={account_detected:PC,account_page_description:RC,account_title:LC,account_with_sso_provider:BC,agree_to:DC,and:UC,auth_method_email:MC,auth_method_email_or_phone:qC,auth_method_phone:FC,callback_url_mismatch:HC,callback_url_not_allowed:VC,change_email:KC,check_email_title:GC,click_to_sign_up_description:WC,code_email_enter_code:JC,code_email_subject:XC,code_email_title:ZC,code_expired:YC,code_invalid:QC,code_sent_template:eN,code_used:tN,code_valid_30_minutes:nN,configuration_error_message:rN,confirm_password:iN,confirm_unlink:oN,contact_support:sN,contact_us:aN,continue:"Continue",continue_social_login:cN,continue_with:lN,continue_with_sso_provider_headline:uN,copyright:dN,copyright_sesamy:pN,create_account_description:fN,create_account_email_invalid:hN,create_account_passwords_didnt_match:gN,create_account_title:mN,create_account_weak_password:_N,create_new_account_link:yN,create_password_account_title:bN,current_email:wN,currently_logged_in_as:vN,edit:xN,email:kN,email_already_taken:$N,email_changed_to_template:SN,email_or_phone_placeholder:zN,email_placeholder:AN,email_validated:EN,email_validated_cta:CN,email_verification_for_signup_sent_description:NN,email_verification_for_signup_sent_title:IN,embedded_browser_detected:jN,embedded_browser_warning:TN,enter_a_code_btn:ON,enter_email_for_verification_description:PN,enter_new_email:RN,enter_new_password_placeholder:LN,enter_password:BN,enter_password_description:DN,enter_your_password_btn:UN,error_page_title:MN,expired_code:qN,fokus_info_message:FN,forgot_password_cta:HN,forgot_password_description:VN,forgot_password_email_sent:KN,forgot_password_link:GN,forgot_password_title:WN,go_back:JN,hide_password:XN,incognito_mode_detected:ZN,incognito_mode_warning:YN,"invalid-email":"Invalid email",invalid_identifier:QN,invalid_password:eI,invalid_session_body:tI,invalid_session_title:nI,linked_accounts:rI,link_email_click_to_login:iI,link_email_login:oI,link_email_or_enter_code:sI,link_page_body:aI,link_page_headline:cI,logged_in_as:lI,login:uI,login_description:dI,login_description_code:pI,login_description_combined:fI,login_description_link:hI,login_description_phone:gI,login_description_template:mI,logout:_I,new_email:yI,new_email_code_info:bI,no_email_address:wI,no_use_another:vI,or:xI,password:kI,password_contains_forbidden_word:$I,password_contains_personal_info:SI,password_has_been_reset:zI,password_has_been_reset_title:AI,password_missing_lowercase:EI,password_missing_number:CI,password_missing_special:NI,password_missing_uppercase:II,password_reset_code_expired:jI,password_reset_failed:TI,password_reused:OI,password_too_short:PI,password_reset_subject:RI,password_reset_title:LI,phone_placeholder:BI,privacy_policy:DI,redirecting:UI,reenter_new_password_placeholder:MI,register_password_account:qI,resend_code:FI,reset_password_cta:HI,reset_password_description:VI,reset_password_email_click_to_reset:KI,reset_password_email_cta:GI,reset_password_email_reset:WI,reset_password_subject:JI,reset_password_title:XI,send:ZI,send_me_a_new_magic_link:YI,sent_code_spam:QI,"Server error: Invalid code":"Invalid code",set_password:ej,show_password:tj,sign_in:nj,signup:rj,signup_success:ij,sms_code_text:oj,spotify_already_linked_body:sj,spotify_already_linked_cta:aj,spotify_already_linked_step1_body:cj,spotify_already_linked_step1_title:lj,spotify_already_linked_step2_body:uj,spotify_already_linked_step2_title:dj,spotify_already_linked_title:pj,success:fj,support_info:hj,terms:gj,unexpected_error_try_again:mj,unlink:_j,unverified_email:yj,update_email:bj,user_account_does_not_exist:wj,user_not_found:vj,user_not_found_body:xj,user_not_found_cta:kj,validate_code:$j,validate_email_body:Sj,validate_email_title:zj,verify_email_click_to_verify:Aj,verify_email_subject:Ej,verify_email_title:Cj,verify_email_verify:Nj,verify_your_email:Ij,welcome:jj,welcome_to_your_account:Tj,we_sent_a_code_to:Oj,yes_continue:Pj,yes_continue_with:Rj,yes_continue_with_existing_account:Lj},Dj="Account rilevato",Uj="Gestisci i dettagli del tuo account",Mj="Conto",qj="Abbiamo rilevato che l'utente ha già creato un account tramite",Fj="Effettuando l'accesso, l'utente accetta la nostra",Hj="e",Vj="indirizzo e-mail",Kj="e-mail o numero di telefono",Gj="numero di telefono",Wj="Mancata corrispondenza dell'URL di callback",Jj="Il redirect_uri fornito non è nell'elenco degli URL di callback consentiti.",Xj="Cambia indirizzo email",Zj="continuare con l'utente",Yj="Fare clic sul pulsante per creare un nuovo account con password.",Qj="Inserite il codice all'indirizzo {{vendorName}} per completare il login.",eT="Benvenuti su {{vendorName}}! {{code}} è il codice di accesso",tT="Benvenuti su {{vendorName}}! {{code}} è il codice di accesso",nT="Codice scaduto",rT="Codice non valido",iT="Controllare <0>{{username}}</0> e inserire il codice a sei cifre che vi abbiamo inviato.",oT="Il codice è già utilizzato",sT="Il codice è valido per 30 minuti",aT="Si è verificato un errore di configurazione.",cT="Confermare la password",lT="È sicuro di voler scollegare questo account?",uT="Avete bisogno di aiuto?",dT="Contattateci",pT="o continuare con il conto sociale",fT="Continua con {{provider}}",hT="Desidera continuare a utilizzare l'account esistente?",gT="Copyright © 2023 SESAMY. Tutti i diritti riservati.",mT="©2023 Sesamy",_T="Scegliete una password con un mix di lettere maiuscole e minuscole, numeri e simboli.",yT="Inserire un indirizzo e-mail valido.",bT="Le password non corrispondono. Riprovare.",wT="Scegliere la password",vT="La password deve essere lunga almeno 8 caratteri e contenere almeno una lettera minuscola, una lettera maiuscola, un numero e un simbolo.",xT="Creare un nuovo account",kT="Iscriviti con la password",$T="Indirizzo email attuale",ST="Attualmente si è connessi come <0>{{email}}</0>",zT="Modifica",AT="Email",ET="L'e-mail è già stata presa",CT="L'e-mail è stata modificata in <0>{{email}}</0> ",NT="Indirizzo e-mail o numero di telefono",IT="Indirizzo e-mail",jT="Il tuo indirizzo e-mail è stato convalidato",TT="Ora inserire la password per accedere nuovamente",OT="È stata inviata un'e-mail a <0>{{email}}</0> con un link di verifica. Fare clic sul link per verificare l'indirizzo e-mail e impostare una password.",PT="Email di verifica inviata",RT="È necessario continuare a collegarsi?",LT="Siete attualmente all'interno del sito {{browserName}}. Questo browser vi fa spesso uscire, quindi vi consigliamo di utilizzare il browser predefinito del vostro telefono.",BT="Inserire un codice",DT="Vi invieremo un link di verifica per assicurarvi di possedere questo indirizzo e-mail.",UT="Inserire un nuovo indirizzo e-mail",MT="Inserire la nuova password",qT="Inserire la password",FT="Inserire l'indirizzo e-mail e la password per accedere.",HT="Inserire la password",VT="Qualcosa è andato storto",KT="Il link magico è scaduto. Cliccate sul pulsante sottostante per ricevere un nuovo link nella vostra casella di posta elettronica.",GT="Abbiamo aggiornato la nostra esperienza di accesso. <0>Clicca qui per saperne di più.</0>",WT="Inviare l'e-mail di reimpostazione della password",JT="Fare clic sul pulsante sottostante per ricevere le istruzioni su come reimpostare la password.",XT="Email di reimpostazione della password inviata",ZT="Hai dimenticato la password?",YT="Hai dimenticato la password?",QT="Torna indietro",eO="Nascondere la password",tO="Rilevata la modalità Incognito",nO="Siete in modalità incognito/privata. I dati della sessione potrebbero non persistere durante l'aggiornamento della pagina. Alcune funzioni potrebbero non funzionare come previsto.",rO="Identificatore non valido",iO="Password non valida",oO=`Il link non è più valido.
|
|
350
|
+
|
|
351
|
+
Assicuratevi di aprire il link di accesso con lo stesso browser con cui avete iniziato l'accesso.
|
|
352
|
+
|
|
353
|
+
Potete fare clic sul link sottostante per iniziare un nuovo accesso.`,sO="Collegamento non valido",aO="Account collegati",cO="Fare clic sul pulsante per accedere",lO="Accedi",uO="Oppure inserire il codice all'indirizzo {{vendorName}} per completare il login.",dO="Inserisci il tuo indirizzo e-mail per sbloccare questo spettacolo su {{service}}",pO="Collegate il vostro account con {{service}}",fO="L'utente ha effettuato l'accesso come",hO="Accesso",gO="Inserire l'indirizzo e-mail per accedere.",mO="Inserite il vostro indirizzo e-mail e vi invieremo un codice di accesso.",_O="Inserire l'e-mail o il numero di telefono per accedere",yO="Inserite il vostro indirizzo e-mail e vi invieremo un link di accesso.",bO="Inserire il numero di telefono per accedere",wO="Inserite il vostro {{authMethod}} per accedere.",vO="Disconnettersi",xO="Nuovo indirizzo email",kO="Un codice monouso verrà inviato al tuo nuovo indirizzo email, inserisci il codice nel passaggio successivo.",$O="Nessun indirizzo email impostato",SO="No, voglio usare un altro account",zO="o",AO="Password",EO="La password contiene una parola vietata",CO="La password non può contenere informazioni personali come il nome o l'email",NO="La password è stata reimpostata",IO="Il successo",jO="La password deve contenere almeno una lettera minuscola",TO="La password deve contenere almeno un numero",OO="La password deve contenere almeno un carattere speciale",PO="La password deve contenere almeno una lettera maiuscola",RO="Codice non trovato o scaduto",LO="Impossibile reimpostare la password",BO="La password è stata utilizzata di recente e non può essere riutilizzata",DO="La password deve contenere almeno {{minLength}} caratteri",UO="Cambia la password per il tuo account {{vendorName}}",MO="Modifica della password dell'account {{vendorName}} ",qO="Numero di telefono",FO="Informativa sulla privacy",HO="Reindirizzamento",VO="Confermare la password",KO="Registrazione di una nuova password",GO="Reinvio del codice",WO="Modifica della password",JO="Immettere di seguito la nuova password per l'account e-mail: ",XO="Fare clic sul pulsante per reimpostare la password",ZO="Fare clic sul pulsante per reimpostare la password",YO="Reimpostare la password",QO="Modifica della password dell'account {{vendorName}} ",eP="Reimpostare la password",tP="Inviare",nP="Inviami un nuovo link magico",rP="Ricordate di controllare la cartella spam se l'e-mail non è arrivata.",iP="Impostare la password",oP="Mostra password",sP="Accedi",aP="Iscriviti",cP="Iscriviti con successo",lP="{{code}} è il codice di accesso per {{vendorName}}",uP="Sembra che il vostro account Spotify sia attualmente collegato a un altro account Sesamy. Ma non temete, siamo qui per guidarvi attraverso la procedura per risolvere il problema.",dP="Vai alla pagina di accesso ai contenuti di Spotify",pP=`Cominciamo con lo scollegare il vostro account Spotify. Fare clic sul pulsante sottostante per accedere alla pagina di accesso ai contenuti di Spotify. Dopo aver effettuato l'accesso al vostro account Spotify, trovate Sesamy nell'elenco delle piattaforme collegate. Fate clic su "Unlink" accanto al logo di Sesamy.`,fP="Passo 1: Disconnettere l'account Spotify",hP="Dopo aver scollegato con successo il proprio account Spotify, è possibile ricollegarlo a Sesamy. È sufficiente ripetere i passaggi precedenti che vi hanno portato a questa pagina.",gP="Passo 2: ricollegare l'account Spotify a Sesamy",mP="Ops! Il tuo account Spotify è già collegato",_P="Il successo",yP="Se avete domande o bisogno di assistenza, potete contattare il nostro team di supporto",bP="Termini e condizioni",wP="Qualcosa è andato storto. Riprovare.",vP="Scollega",xP="Il tuo indirizzo e-mail deve essere convalidato. Abbiamo inviato una nuova e-mail alla tua casella di posta.",kP="Aggiornamento e-mail",$P="L'account utente non esiste",SP="L'account utente non esiste",zP="Non è stato possibile trovare un utente con l'indirizzo e-mail fornito. Si prega di riprovare.",AP="Riprova.",EP="Convalida del codice",CP="Controllate la vostra casella di posta per le istruzioni di convalida dell'e-mail.",NP="Iscritta",IP="Fare clic sul pulsante per verificare l'indirizzo e-mail",jP="Convalidare l'indirizzo e-mail",TP="Convalidare l'indirizzo e-mail",OP="Verifica dell'account",PP="Verificare l'e-mail",RP="Benvenuti",LP="Benvenuto nel tuo account {{vendorName}}!",BP="Controllate la vostra e-mail all'indirizzo <0>{{email}}</0> e inserisca il codice a sei cifre che le abbiamo inviato.",DP="Continuare con questo account",UP="Sì, continuare con {{text}}",MP="Sì, continuare con l'account esistente",qP={account_detected:Dj,account_page_description:Uj,account_title:Mj,account_with_sso_provider:qj,agree_to:Fj,and:Hj,auth_method_email:Vj,auth_method_email_or_phone:Kj,auth_method_phone:Gj,callback_url_mismatch:Wj,callback_url_not_allowed:Jj,change_email:Xj,check_email_title:Zj,click_to_sign_up_description:Yj,code_email_enter_code:Qj,code_email_subject:eT,code_email_title:tT,code_expired:nT,code_invalid:rT,code_sent_template:iT,code_used:oT,code_valid_30_minutes:sT,configuration_error_message:aT,confirm_password:cT,confirm_unlink:lT,contact_support:uT,contact_us:dT,continue:"Continua",continue_social_login:pT,continue_with:fT,continue_with_sso_provider_headline:hT,copyright:gT,copyright_sesamy:mT,create_account_description:_T,create_account_email_invalid:yT,create_account_passwords_didnt_match:bT,create_account_title:wT,create_account_weak_password:vT,create_new_account_link:xT,create_password_account_title:kT,current_email:$T,currently_logged_in_as:ST,edit:zT,email:AT,email_already_taken:ET,email_changed_to_template:CT,email_or_phone_placeholder:NT,email_placeholder:IT,email_validated:jT,email_validated_cta:TT,email_verification_for_signup_sent_description:OT,email_verification_for_signup_sent_title:PT,embedded_browser_detected:RT,embedded_browser_warning:LT,enter_a_code_btn:BT,enter_email_for_verification_description:DT,enter_new_email:UT,enter_new_password_placeholder:MT,enter_password:qT,enter_password_description:FT,enter_your_password_btn:HT,error_page_title:VT,expired_code:KT,fokus_info_message:GT,forgot_password_cta:WT,forgot_password_description:JT,forgot_password_email_sent:XT,forgot_password_link:ZT,forgot_password_title:YT,go_back:QT,hide_password:eO,incognito_mode_detected:tO,incognito_mode_warning:nO,"invalid-email":"Email non valida",invalid_identifier:rO,invalid_password:iO,invalid_session_body:oO,invalid_session_title:sO,linked_accounts:aO,link_email_click_to_login:cO,link_email_login:lO,link_email_or_enter_code:uO,link_page_body:dO,link_page_headline:pO,logged_in_as:fO,login:hO,login_description:gO,login_description_code:mO,login_description_combined:_O,login_description_link:yO,login_description_phone:bO,login_description_template:wO,logout:vO,new_email:xO,new_email_code_info:kO,no_email_address:$O,no_use_another:SO,or:zO,password:AO,password_contains_forbidden_word:EO,password_contains_personal_info:CO,password_has_been_reset:NO,password_has_been_reset_title:IO,password_missing_lowercase:jO,password_missing_number:TO,password_missing_special:OO,password_missing_uppercase:PO,password_reset_code_expired:RO,password_reset_failed:LO,password_reused:BO,password_too_short:DO,password_reset_subject:UO,password_reset_title:MO,phone_placeholder:qO,privacy_policy:FO,redirecting:HO,reenter_new_password_placeholder:VO,register_password_account:KO,resend_code:GO,reset_password_cta:WO,reset_password_description:JO,reset_password_email_click_to_reset:XO,reset_password_email_cta:ZO,reset_password_email_reset:YO,reset_password_subject:QO,reset_password_title:eP,send:tP,send_me_a_new_magic_link:nP,sent_code_spam:rP,"Server error: Invalid code":"Codice non valido",set_password:iP,show_password:oP,sign_in:sP,signup:aP,signup_success:cP,sms_code_text:lP,spotify_already_linked_body:uP,spotify_already_linked_cta:dP,spotify_already_linked_step1_body:pP,spotify_already_linked_step1_title:fP,spotify_already_linked_step2_body:hP,spotify_already_linked_step2_title:gP,spotify_already_linked_title:mP,success:_P,support_info:yP,terms:bP,unexpected_error_try_again:wP,unlink:vP,unverified_email:xP,update_email:kP,user_account_does_not_exist:$P,user_not_found:SP,user_not_found_body:zP,user_not_found_cta:AP,validate_code:EP,validate_email_body:CP,validate_email_title:NP,verify_email_click_to_verify:IP,verify_email_subject:jP,verify_email_title:TP,verify_email_verify:OP,verify_your_email:PP,welcome:RP,welcome_to_your_account:LP,we_sent_a_code_to:BP,yes_continue:DP,yes_continue_with:UP,yes_continue_with_existing_account:MP},FP="Konto oppdaget",HP="Administrer kontoinformasjonen din",VP="Konto",KP="Vi har oppdaget at du allerede har opprettet en konto gjennom",GP="Ved å logge på godtar du våre",WP="og",JP="e-postadresse",XP="e-post eller telefonnummer",ZP="telefonnummer",YP="Callback-URLen samsvarer ikke",QP="Den oppgitte redirect_uri er ikke på listen over tillatte tilbakeringings-URLer.",eR="Endre e-postadresse",tR="fortsett med bruker",nR="Klikk på knappen for å opprette en ny passordkonto.",rR="Skriv inn koden på {{vendorName}} for å fullføre påloggingen",iR="Velkommen til {{vendorName}} ! {{code}} er påloggingskoden",oR="Velkommen til {{vendorName}}! {{code}} er påloggingskoden",sR="Koden er utløpt",aR="Ugyldig kode",cR="Vennligst sjekk <0>{{username}}</0> og skriv inn den sekssifrede koden som vi har sendt deg.",lR="Koden er allerede brukt",uR="Koden er gyldig i 30 minutter",dR="Det oppstod en konfigurasjonsfeil.",pR="Bekreft passord",fR="Er du sikker på at du vil fjerne koblingen til denne kontoen?",hR="Trenger hjelp?",gR="Kontakt oss",mR="eller fortsett med sosial konto",_R="Fortsett med {{provider}}",yR="Vil du fortsette med din eksisterende konto?",bR="Opphavsrett © 2023 SESAMY. Alle rettigheter forbeholdt.",wR="©2023 Sesamy",vR="Velg et passord med en blanding av store og små bokstaver, tall og symboler.",xR="Vennligst skriv inn en gyldig e-postadresse.",kR="Passordene stemte ikke overens. Prøv igjen.",$R="Velg passord",SR="Passordet må være på minst 8 tegn og inneholde minst én liten bokstav, én stor bokstav, ett tall og ett symbol.",zR="Opprett ny konto",AR="Registrer deg med passord",ER="Nåværende e-postadresse",CR="Du er logget på som <0> {{email}}</0>",NR="Rediger",IR="E-post",jR="E-posten er allerede opptatt",TR="E-post endret til <0>{{email}}</0> ",OR="E-post eller telefonnummer",PR="E-postadresse",RR="E-postadressen din har blitt validert",LR="Skriv nå inn passordet ditt for å logge inn igjen",BR="En e-post har blitt sendt til <0>{{email}}</0> med en bekreftelseslenke. Klikk på lenken for å bekrefte e-postadressen din og angi et passord.",DR="E-postbekreftelse sendt",UR="Må du fortsette å logge inn?",MR="Du er for øyeblikket inne på {{browserName}}. Denne nettleseren logger deg ofte ut, så vi anbefaler at du bruker telefonens standardnettleser i stedet.",qR="Angi en kode",FR="Vi sender deg en bekreftelseskobling for å sikre at du eier denne e-postadressen.",HR="Skriv inn ny e-post",VR="Skriv inn nytt passord",KR="Oppgi passord",GR="Skriv inn e-postadressen og passordet ditt for å logge inn.",WR="Skriv inn passordet ditt",JR="Noe gikk galt",XR="Den magiske lenken er utløpt. Vennligst klikk på knappen nedenfor for å motta en ny lenke i innboksen din.",ZR="Hei! Vi oppdaterte påloggingsopplevelsen vår. <0>Klikk her for å lære mer om det.</0>",YR="Send e-post om tilbakestilling av passord",QR="Klikk på knappen nedenfor, så sender vi deg instruksjoner om hvordan du tilbakestiller passordet ditt.",eL="E-post om tilbakestilling av passord sendt",tL="Har du glemt passordet?",nL="Har du glemt passordet?",rL="Gå tilbake",iL="Skjul passord",oL="Inkognitomodus oppdaget",sL="Du er i inkognito/privat modus. Øktdataene vedvarer kanskje ikke på tvers av sideoppdateringer. Noen funksjoner fungerer kanskje ikke som forventet.",aL="Ugyldig identifikator",cL="Ugyldig passord",lL=`Lenken er ikke lenger gyldig.
|
|
354
|
+
|
|
355
|
+
Sørg for å åpne påloggingslenken i samme nettleser som du startet påloggingen med.
|
|
356
|
+
|
|
357
|
+
Du kan klikke på lenken nedenfor for å starte en ny pålogging.`,uL="Ugyldig lenke",dL="Koblede kontoer",pL="Klikk på knappen for å logge inn",fL="Logg inn",hL="Eller skriv inn koden på {{vendorName}} for å fullføre påloggingen.",gL="Skriv inn e-postadressen din for å låse opp dette programmet på {{service}}",mL="Koble kontoen din til {{service}}",_L="Du er innlogget som",yL="Logg inn",bL="Skriv inn e-postadressen din for å logge på.",wL="Skriv inn e-postadressen din og vi sender deg en påloggingskode.",vL="Skriv inn e-postadressen eller telefonnummeret ditt for å logge på",xL="Skriv inn e-postadressen din og vi sender deg en påloggingslenke.",kL="Skriv inn telefonnummeret ditt for å logge på",$L="Skriv inn din {{authMethod}} for å logge inn.",SL="Logg ut",zL="Ny e-postadresse",AL="En engangskode vil bli sendt til din nye e-postadresse, skriv inn koden i neste steg.",EL="Ingen e-postadresse satt",CL="Nei, jeg vil bruke en annen konto",NL="eller",IL="Passord",jL="Passordet inneholder et forbudt ord",TL="Passordet kan ikke inneholde personlig informasjon som navn eller e-post",OL="Passordet har blitt tilbakestilt",PL="Suksess",RL="Passordet må inneholde minst én liten bokstav",LL="Passordet må inneholde minst ett tall",BL="Passordet må inneholde minst ett spesialtegn",DL="Passordet må inneholde minst én stor bokstav",UL="Koden ble ikke funnet eller har utløpt",ML="Passordet kunne ikke tilbakestilles",qL="Passordet har blitt brukt nylig og kan ikke gjenbrukes",FL="Passordet må være minst {{minLength}} tegn",HL="Endre passord for din {{vendorName}} konto",VL="Endre passord for {{vendorName}} kontoen din",KL="Telefonnummer",GL="Personvernerklæring",WL="Omdirigerer",JL="Bekreft passord",XL="Registrer et nytt passord",ZL="Send kode på nytt",YL="Endre passord",QL="Skriv inn det nye passordet for e-postkontoen nedenfor: ",eB="Klikk på knappen for å tilbakestille passordet ditt",tB="Klikk på knappen for å tilbakestille passordet ditt",nB="Tilbakestill passordet ditt",rB="Endre passord for {{vendorName}} -kontoen din",iB="Tilbakestill passord",oB="Send",sB="Send meg en ny magisk lenke",aB="Husk å sjekke søppelpostmappen din hvis e-posten ikke kom.",cB="Angi passord",lB="Vis passord",uB="Logg inn",dB="Påmelding",pB="Vellykket registrering",fB="{{code}} er innloggingskoden din for {{vendorName}}",hB="Det ser ut til at Spotify-kontoen din for øyeblikket er koblet til en annen Sesamy-konto. Men ikke vær redd, vi er her for å veilede deg gjennom prosessen for å få dette fikset.",gB="Gå til Spotifys innholdstilgangsside",mB='La oss starte med å koble fra Spotify-kontoen din. Klikk på knappen nedenfor for å gå til Spotifys innholdstilgang-side. Etter at du har logget på Spotify-kontoen din, finner du Sesamy på listen over tilkoblede plattformer. Klikk "Fjern kobling" ved siden av Sesamy-logoen.',_B="Trinn 1: Koble fra Spotify-kontoen din",yB="Når du har koblet fra Spotify-kontoen din, kan du koble den til Sesamy på nytt. Bare gjenta trinnene du tidligere tok som førte deg til denne siden.",bB="Trinn 2: Koble Spotify-kontoen din til Sesamy på nytt",wB="Oops! Spotify-kontoen din er allerede koblet",vB="Ferdig",xB="Hvis du har spørsmål eller trenger hjelp, kan du kontakte supportteamet vårt",kB="vilkår",$B="Noe gikk galt. Vennligst prøv igjen.",SB="Koble fra",zB="E-postadressen din må bekreftes. Vi har sendt en ny e-post til innboksen din.",AB="Oppdater e-post",EB="Brukerkonto eksisterer ikke",CB="Brukerkonto eksisterer ikke",NB="Vi kunne ikke finne en bruker med den oppgitte e-postadressen. Vær så snill, prøv på nytt.",IB="Prøv igjen.",jB="Bekreft koden",TB="Sjekk innboksen din for instruksjoner om e-postvalidering.",OB="Registrerte seg",PB="Klikk på knappen for å bekrefte e-postadressen din",RB="Bekreft e-postadressen din",LB="Bekreft e-postadressen din",BB="Bekreft konto",DB="Bekreft e-posten din",UB="Velkommen",MB="Velkommen til din brukerkonto hos {{vendorName}} !",qB="Vennligst sjekk e-posten din på <0>{{email}}</0> og skriv inn den sekssifrede koden som vi har sendt deg.",FB="Fortsett med denne kontoen",HB="Ja, fortsett med {{text}}",VB="Ja, fortsett med eksisterende konto",KB={account_detected:FP,account_page_description:HP,account_title:VP,account_with_sso_provider:KP,agree_to:GP,and:WP,auth_method_email:JP,auth_method_email_or_phone:XP,auth_method_phone:ZP,callback_url_mismatch:YP,callback_url_not_allowed:QP,change_email:eR,check_email_title:tR,click_to_sign_up_description:nR,code_email_enter_code:rR,code_email_subject:iR,code_email_title:oR,code_expired:sR,code_invalid:aR,code_sent_template:cR,code_used:lR,code_valid_30_minutes:uR,configuration_error_message:dR,confirm_password:pR,confirm_unlink:fR,contact_support:hR,contact_us:gR,continue:"Fortsette",continue_social_login:mR,continue_with:_R,continue_with_sso_provider_headline:yR,copyright:bR,copyright_sesamy:wR,create_account_description:vR,create_account_email_invalid:xR,create_account_passwords_didnt_match:kR,create_account_title:$R,create_account_weak_password:SR,create_new_account_link:zR,create_password_account_title:AR,current_email:ER,currently_logged_in_as:CR,edit:NR,email:IR,email_already_taken:jR,email_changed_to_template:TR,email_or_phone_placeholder:OR,email_placeholder:PR,email_validated:RR,email_validated_cta:LR,email_verification_for_signup_sent_description:BR,email_verification_for_signup_sent_title:DR,embedded_browser_detected:UR,embedded_browser_warning:MR,enter_a_code_btn:qR,enter_email_for_verification_description:FR,enter_new_email:HR,enter_new_password_placeholder:VR,enter_password:KR,enter_password_description:GR,enter_your_password_btn:WR,error_page_title:JR,expired_code:XR,fokus_info_message:ZR,forgot_password_cta:YR,forgot_password_description:QR,forgot_password_email_sent:eL,forgot_password_link:tL,forgot_password_title:nL,go_back:rL,hide_password:iL,incognito_mode_detected:oL,incognito_mode_warning:sL,"invalid-email":"Ugyldig epost",invalid_identifier:aL,invalid_password:cL,invalid_session_body:lL,invalid_session_title:uL,linked_accounts:dL,link_email_click_to_login:pL,link_email_login:fL,link_email_or_enter_code:hL,link_page_body:gL,link_page_headline:mL,logged_in_as:_L,login:yL,login_description:bL,login_description_code:wL,login_description_combined:vL,login_description_link:xL,login_description_phone:kL,login_description_template:$L,logout:SL,new_email:zL,new_email_code_info:AL,no_email_address:EL,no_use_another:CL,or:NL,password:IL,password_contains_forbidden_word:jL,password_contains_personal_info:TL,password_has_been_reset:OL,password_has_been_reset_title:PL,password_missing_lowercase:RL,password_missing_number:LL,password_missing_special:BL,password_missing_uppercase:DL,password_reset_code_expired:UL,password_reset_failed:ML,password_reused:qL,password_too_short:FL,password_reset_subject:HL,password_reset_title:VL,phone_placeholder:KL,privacy_policy:GL,redirecting:WL,reenter_new_password_placeholder:JL,register_password_account:XL,resend_code:ZL,reset_password_cta:YL,reset_password_description:QL,reset_password_email_click_to_reset:eB,reset_password_email_cta:tB,reset_password_email_reset:nB,reset_password_subject:rB,reset_password_title:iB,send:oB,send_me_a_new_magic_link:sB,sent_code_spam:aB,"Server error: Invalid code":"Ugyldig kode",set_password:cB,show_password:lB,sign_in:uB,signup:dB,signup_success:pB,sms_code_text:fB,spotify_already_linked_body:hB,spotify_already_linked_cta:gB,spotify_already_linked_step1_body:mB,spotify_already_linked_step1_title:_B,spotify_already_linked_step2_body:yB,spotify_already_linked_step2_title:bB,spotify_already_linked_title:wB,success:vB,support_info:xB,terms:kB,unexpected_error_try_again:$B,unlink:SB,unverified_email:zB,update_email:AB,user_account_does_not_exist:EB,user_not_found:CB,user_not_found_body:NB,user_not_found_cta:IB,validate_code:jB,validate_email_body:TB,validate_email_title:OB,verify_email_click_to_verify:PB,verify_email_subject:RB,verify_email_title:LB,verify_email_verify:BB,verify_your_email:DB,welcome:UB,welcome_to_your_account:MB,we_sent_a_code_to:qB,yes_continue:FB,yes_continue_with:HB,yes_continue_with_existing_account:VB},GB="Fortsätt med existerande konto",WB="Hantera dina kontouppgifter",JB="Konto",XB="Det verkar som att du redan har skapat ett konto genom",ZB="Genom att logga in godkänner du våra",YB="och",QB="E-postadress",eD="e-post eller telefonnummer",tD="telefonnummer",nD="Callback URL mismatch",rD="The provided redirect_uri is not in the list of allowed callback URLs.",iD="Byt e-postadress",oD="fortsätt med användaren",sD="Klicka på knappen för att skapa ett nytt lösenordskonto.",aD="Skriv in koden på {{vendorName}} för att slutföra inloggningen",cD="Välkommen till {{vendorName}}! {{code}} är koden för att logga in",lD="Välkommen till {{vendorName}}! {{code}} är koden för att logga in",uD="Koden har löpt ut",dD="Ogiltig kod",pD="Vänligen kontrollera <0>{{username}}</0> och ange den sexsiffriga koden som vi har skickat till dig.",fD="Koden är redan använd",hD="Koden är giltig i 30 minuter",gD="Ett konfigurationsfel har inträffat.",mD="Bekräfta lösenord",_D="Är du säker på att du vill ta bort kopplingen till det här kontot?",yD="Behöver du hjälp?",bD="Kontakta oss",wD="eller via sociala medier",vD="Fortsätt med {{provider}}",xD="Vill du fortsätta med det här kontot?",kD="Copyright © 2023 SESAMY. Alla rättigheter förbehållna.",$D="©2023 Sesamy",SD="Välj ett lösenord med en blandning av stora och små bokstäver, siffror och symboler.",zD="Ange en giltig e-postadress.",AD="Lösenorden stämde inte överens. Försök igen.",ED="Välj lösenord",CD="Lösenordet måste vara minst 8 tecken långt och innehålla minst en gemen bokstav, en versal bokstav, en siffra och en symbol.",ND="Skapa nytt konto",ID="Registrera dig med lösenord",jD="Nuvarande e-postadress",TD="Du är inloggad som <0>{{email}}</0>",OD="Redigera",PD="E-postadress",RD="E-postadressen är redan upptagen",LD="E-postadressen ändrades till <0>{{email}}</0> ",BD="E-post eller telefonnummer",DD="E-postadress",UD="Din e-postadress har validerats",MD="Ange nu ditt lösenord för att logga in igen",qD="Ett e-postmeddelande har skickats till <0>{{email}}</0> med en verifieringslänk. Vänligen klicka på länken för att verifiera din e-postadress och välja ett lösenord.",FD="E-postverifiering skickad",HD="Måste du logga in hela tiden?",VD="Du befinner dig för närvarande på {{browserName}}. Den här webbläsaren loggar ofta ut, så vi rekommenderar att du använder telefonens standardwebbläsare istället.",KD="Logga in med kod",GD="Vi skickar dig en verifieringslänk för att säkerställa att du äger den här e-postadressen.",WD="Ange ny e-postadress",JD="Ange nytt lösenord",XD="Ange lösenord",ZD="Ange din e-postadress och ditt lösenord för att logga in.",YD="Logga in med lösenord",QD="Något gick fel",eU="Länken är inte längre giltig. Klicka på knappen för att skicka en ny länk till din epost.",tU="Vi har bytt inloggningssystem, <0>här kan du läsa mer om vad det innebär</0>",nU="Skicka",rU="Klicka på knappen nedan så skickar vi instruktioner om hur du återställer ditt lösenord.",iU="Vi har skickat ett e-postmeddelande med instruktioner om hur du återställer ditt lösenord till den e-postadress du angav.",oU="Har du glömt lösenordet?",sU="Har du glömt lösenordet?",aU="Gå tillbaka",cU="Dölj lösenord",lU="Inkognitoläge upptäckt",uU="Du befinner dig i inkognito/privat läge. Sessionsdata kanske inte kvarstår vid siduppdateringar. Vissa funktioner kanske inte fungerar som förväntat.",dU="Ogiltig identifierare",pU="Ogiltigt lösenord",fU=`Länken är inte längre giltig.
|
|
358
|
+
|
|
359
|
+
Vänligen se till att öppna inloggningslänken i samma webbläsare som du startade inloggningen med.
|
|
360
|
+
|
|
361
|
+
Du kan klicka på länken nedan för att starta en ny inloggning.`,hU="Ogiltig länk",gU="Länkade konton",mU="Klicka på knappen för att logga in",_U="Logga in",yU="Eller skriv in koden på {{vendorName}} för att slutföra inloggningen.",bU="Ange din epost för att låsa upp den här showen på {{service}}",wU="Koppla ditt konto till {{service}}",vU="Du är inloggad som",xU="Logga in",kU="Ange din e-postadress för att logga in.",$U="Ange din mejladress, så skickar vi en kod till dig som du kan logga in med.",SU="Ange din e-postadress eller ditt telefonnummer för att logga in",zU="Ange din mejladress, så skickar vi en länk till dig som du kan logga in med.",AU="Ange ditt telefonnummer för att logga in",EU="Ange din {{authMethod}} för att logga in.",CU="Logga ut",NU="Ny e-postadress",IU="En engångskod skickas till din nya e-postadress, ange koden i nästa steg.",jU="Ingen e-postadress angiven",TU="Nej, jag vill använda ett annat konto",OU="eller",PU="Lösenord",RU="Lösenordet innehåller ett förbjudet ord",LU="Lösenordet får inte innehålla personlig information som ditt namn eller e-post",BU="Lösenordet har återställts",DU="Framgång",UU="Lösenordet måste innehålla minst en liten bokstav",MU="Lösenordet måste innehålla minst en siffra",qU="Lösenordet måste innehålla minst ett specialtecken",FU="Lösenordet måste innehålla minst en stor bokstav",HU="Koden hittades inte eller har löpt ut",VU="Lösenordet kunde inte återställas",KU="Lösenordet har använts nyligen och kan inte återanvändas",GU="Lösenordet måste vara minst {{minLength}} tecken",WU="Byt lösenord för ditt {{vendorName}} konto",JU="Byt lösenord för ditt {{vendorName}} konto",XU="Telefonnummer",ZU="Integritetspolicy",YU="Du skickas vidare",QU="Bekräfta lösenord",eM="Registrera ett nytt lösenord",tM="Skicka koden igen",nM="Ändra lösenord",rM="Ange ditt nya lösenord nedan för e-postkontot: ",iM="Klicka på knappen för att återställa ditt lösenord",oM="Klicka på knappen för att återställa ditt lösenord",sM="Återställ ditt lösenord",aM="Byt lösenord för ditt {{vendorName}} konto",cM="Återställ lösenord",lM="Skicka",uM="Skicka en ny inloggninglänk",dM="Kom ihåg att kontrollera din skräppost om du inte kan hitta mailet vi har skickat.",pM="Välj lösenord",fM="Visa lösenord",hM="Logga in",gM="Registrera dig",mM="Registrera dig framgångsrik",_M="{{code}} är din inloggningskod för {{vendorName}}",yM="Det verkar som att ditt Spotify-konto för närvarande är kopplat till ett annat Sesamy-konto. Ingen fara, vi är här för att guida dig genom processen för att lösa detta.",bM="Gå till Spotify's Content Access sida",wM=`Vi börjar med att avlänka ditt Spotify-konto. Klicka på knappen nedan för att komma till Spotify's Content Access sida. När du har loggat in på ditt Spotify-konto, leta upp Sesamy i listan över anslutna plattformar. Klicka på "Unlink" bredvid Sesamys logotyp.`,vM="Steg 1: Avlänka ditt Spotify-konto",xM="När du har avlänkat ditt Spotify-konto kan du koppla det till Sesamy igen. Upprepa helt enkelt de steg du tog som ledde dig till den här sidan.",kM="Steg 2: Koppla ditt Spotify-konto till Sesamy igen",$M="Oj! Ditt Spotify-konto är redan kopplat",SM="Klart",zM="Om du har frågor eller behöver hjälp kan du kontakta vårt supportteam",AM="Villkor",EM="Något gick fel. Vänligen försök igen.",CM="Koppla bort",NM="Din e-postadress behöver valideras. Vi har skickat ett nytt e-postmeddelande till din inkorg",IM="Ändra e-post",jM="Kontot existerar inte",TM="Kontot extisterar inte",OM="Vi kan inte hitta en användare med denna eposten. Vänligen försök igen.",PM="Försök igen.",RM="Validera kod",LM="Kontrollera din inkorg för instruktioner om validering av e-post.",BM="Registrerad",DM="Klicka på knappen för att verifiera din e-postadress",UM="Bekräfta din e-postadress",MM="Bekräfta din e-postadress",qM="Verifiera konto",FM="Ange engångskod",HM="Välkommen",VM="Välkommen till ditt {{vendorName}}-konto!",KM="Vänligen kontrollera din e-post för <0>{{email}}</0> och ange den sexsiffriga koden som vi har skickat till dig.",GM="Fortsätt med konto",WM="Ja, fortsätt med {{text}}",JM="Ja, fortsätt med detta kontot",XM={account_detected:GB,account_page_description:WB,account_title:JB,account_with_sso_provider:XB,agree_to:ZB,and:YB,auth_method_email:QB,auth_method_email_or_phone:eD,auth_method_phone:tD,callback_url_mismatch:nD,callback_url_not_allowed:rD,change_email:iD,check_email_title:oD,click_to_sign_up_description:sD,code_email_enter_code:aD,code_email_subject:cD,code_email_title:lD,code_expired:uD,code_invalid:dD,code_sent_template:pD,code_used:fD,code_valid_30_minutes:hD,configuration_error_message:gD,confirm_password:mD,confirm_unlink:_D,contact_support:yD,contact_us:bD,continue:"Fortsätt",continue_social_login:wD,continue_with:vD,continue_with_sso_provider_headline:xD,copyright:kD,copyright_sesamy:$D,create_account_description:SD,create_account_email_invalid:zD,create_account_passwords_didnt_match:AD,create_account_title:ED,create_account_weak_password:CD,create_new_account_link:ND,create_password_account_title:ID,current_email:jD,currently_logged_in_as:TD,edit:OD,email:PD,email_already_taken:RD,email_changed_to_template:LD,email_or_phone_placeholder:BD,email_placeholder:DD,email_validated:UD,email_validated_cta:MD,email_verification_for_signup_sent_description:qD,email_verification_for_signup_sent_title:FD,embedded_browser_detected:HD,embedded_browser_warning:VD,enter_a_code_btn:KD,enter_email_for_verification_description:GD,enter_new_email:WD,enter_new_password_placeholder:JD,enter_password:XD,enter_password_description:ZD,enter_your_password_btn:YD,error_page_title:QD,expired_code:eU,fokus_info_message:tU,forgot_password_cta:nU,forgot_password_description:rU,forgot_password_email_sent:iU,forgot_password_link:oU,forgot_password_title:sU,go_back:aU,hide_password:cU,incognito_mode_detected:lU,incognito_mode_warning:uU,"invalid-email":"Ogiltig e-postadress",invalid_identifier:dU,invalid_password:pU,invalid_session_body:fU,invalid_session_title:hU,linked_accounts:gU,link_email_click_to_login:mU,link_email_login:_U,link_email_or_enter_code:yU,link_page_body:bU,link_page_headline:wU,logged_in_as:vU,login:xU,login_description:kU,login_description_code:$U,login_description_combined:SU,login_description_link:zU,login_description_phone:AU,login_description_template:EU,logout:CU,new_email:NU,new_email_code_info:IU,no_email_address:jU,no_use_another:TU,or:OU,password:PU,password_contains_forbidden_word:RU,password_contains_personal_info:LU,password_has_been_reset:BU,password_has_been_reset_title:DU,password_missing_lowercase:UU,password_missing_number:MU,password_missing_special:qU,password_missing_uppercase:FU,password_reset_code_expired:HU,password_reset_failed:VU,password_reused:KU,password_too_short:GU,password_reset_subject:WU,password_reset_title:JU,phone_placeholder:XU,privacy_policy:ZU,redirecting:YU,reenter_new_password_placeholder:QU,register_password_account:eM,resend_code:tM,reset_password_cta:nM,reset_password_description:rM,reset_password_email_click_to_reset:iM,reset_password_email_cta:oM,reset_password_email_reset:sM,reset_password_subject:aM,reset_password_title:cM,send:lM,send_me_a_new_magic_link:uM,sent_code_spam:dM,"Server error: Invalid code":"Koden är inte giltig",set_password:pM,show_password:fM,sign_in:hM,signup:gM,signup_success:mM,sms_code_text:_M,spotify_already_linked_body:yM,spotify_already_linked_cta:bM,spotify_already_linked_step1_body:wM,spotify_already_linked_step1_title:vM,spotify_already_linked_step2_body:xM,spotify_already_linked_step2_title:kM,spotify_already_linked_title:$M,success:SM,support_info:zM,terms:AM,unexpected_error_try_again:EM,unlink:CM,unverified_email:NM,update_email:IM,user_account_does_not_exist:jM,user_not_found:TM,user_not_found_body:OM,user_not_found_cta:PM,validate_code:RM,validate_email_body:LM,validate_email_title:BM,verify_email_click_to_verify:DM,verify_email_subject:UM,verify_email_title:MM,verify_email_verify:qM,verify_your_email:FM,welcome:HM,welcome_to_your_account:VM,we_sent_a_code_to:KM,yes_continue:GM,yes_continue_with:WM,yes_continue_with_existing_account:JM},ZM="Wykryto konto",YM="Zarządzaj szczegółami swojego konta",QM="Konto",eq="Wykryliśmy, że użytkownik utworzył już konto za pośrednictwem",tq="Logując się, wyrażasz zgodę na nasze",nq="i",rq="adres e-mail",iq="e-mail lub numer telefonu",oq="numer telefonu",sq="Niezgodność adresu URL wywołania zwrotnego",aq="Podany adres redirect_uri nie znajduje się na liście dozwolonych adresów URL wywołania zwrotnego.",cq="Zmień adres e-mail",lq="kontynuować z użytkownikiem",uq="Kliknij przycisk, aby utworzyć nowe konto z hasłem.",dq="Wpisz kod na stronie {{vendorName}}, aby się zalogować.",pq="Witamy na {{vendorName}}! {{code}} to kod logowania do Twojego konta.",fq="Witamy na {{vendorName}}! {{code}} to kod logowania.",hq="Kod wygasł",gq="Nieprawidłowy kod",mq="Sprawdź <0>{{username}}</0> i wprowadź sześciocyfrowy kod, który wysłaliśmy.",_q="Kod jest już używany",yq="Kod jest ważny przez 30 minut",bq="Wystąpił błąd konfiguracji.",wq="Potwierdź hasło",vq="Czy na pewno chcesz odłączyć to konto?",xq="Potrzebujesz pomocy?",kq="Skontaktuj się z nami",$q="lub kontynuować korzystanie z konta społecznościowego",Sq="Kontynuuj {{provider}}",zq="Czy chcesz kontynuować korzystanie z istniejącego konta?",Aq="Copyright © 2023 SESAMY. Wszelkie prawa zastrzeżone.",Eq="©2023 Sesamy",Cq="Wybierz hasło składające się z małych i wielkich liter, cyfr i symboli.",Nq="Wprowadź prawidłowy adres e-mail.",Iq="Hasła nie są zgodne. Spróbuj ponownie.",jq="Wybierz hasło",Tq="Hasło musi mieć co najmniej 8 znaków i zawierać co najmniej jedną małą literę, jedną wielką literę, jedną cyfrę i jeden symbol.",Oq="Utwórz nowe konto",Pq="Zarejestruj się przy użyciu hasła",Rq="Aktualny adres e-mail",Lq="Jesteś obecnie zalogowany jako <0>{{email}}</0>",Bq="Edytuj",Dq="E-mail",Uq="E-mail jest już zajęty",Mq="Zmieniono adres e-mail na <0>{{email}}</0> ",qq="E-mail lub numer telefonu",Fq="Adres e-mail",Hq="Twój adres e-mail został zweryfikowany",Vq="Teraz wprowadź hasło, aby zalogować się ponownie",Kq="Wiadomość e-mail została wysłana do <0>{{email}}</0> z linkiem weryfikacyjnym. Kliknij łącze, aby zweryfikować swój adres e-mail i ustawić hasło.",Gq="Wysłano weryfikację e-mail",Wq="Czy musisz się ciągle logować?",Jq="Znajdujesz się obecnie w przeglądarce {{browserName}}. Przeglądarka ta często wylogowuje użytkownika, dlatego zalecamy korzystanie z domyślnej przeglądarki telefonu.",Xq="Wprowadź kod",Zq="Wyślemy Ci link weryfikacyjny, aby upewnić się, że posiadasz ten adres e-mail.",Yq="Wprowadź nowy adres e-mail",Qq="Wprowadź nowe hasło",eF="Wprowadź hasło",tF="Wprowadź swój adres e-mail i hasło, aby się zalogować.",nF="Wprowadź hasło",rF="Coś poszło nie tak",iF="Magiczny link wygasł. Kliknij poniższy przycisk, aby otrzymać nowy link w skrzynce odbiorczej.",oF="Zaktualizowaliśmy sposób logowania. <0>Kliknij tutaj, aby dowiedzieć się więcej.</0>",sF="Wyślij wiadomość e-mail z resetem hasła",aF="Kliknij poniższy przycisk, a my wyślemy Ci instrukcje, jak zresetować hasło.",cF="Wysłano wiadomość e-mail z resetem hasła",lF="Zapomniałeś hasła?",uF="Zapomniałeś hasła?",dF="Wróć",pF="Ukryj hasło",fF="Wykryto tryb incognito",hF="Jesteś w trybie incognito/prywatnym. Dane sesji mogą nie zachować się po odświeżeniu strony. Niektóre funkcje mogą nie działać zgodnie z oczekiwaniami.",gF="Nieprawidłowy identyfikator",mF="Nieprawidłowe hasło",_F=`Link jest już nieaktualny.
|
|
362
|
+
|
|
363
|
+
Upewnij się, że otworzyłeś link logowania w tej samej przeglądarce, w której rozpocząłeś logowanie.
|
|
364
|
+
|
|
365
|
+
Możesz kliknąć poniższy link, aby rozpocząć nowe logowanie.`,yF="Nieprawidłowy link",bF="Połączone konta",wF="Kliknij przycisk, aby się zalogować",vF="Zaloguj się",xF="Lub wprowadź kod na stronie {{vendorName}}, aby dokończyć logowanie.",kF="Wprowadź swój adres e-mail, aby odblokować ten program na {{service}}",$F="Połącz swoje konto z {{service}}",SF="Jesteś zalogowany jako",zF="Logowanie",AF="Wprowadź swój adres e-mail, aby się zalogować.",EF="Wprowadź swój adres e-mail, a my wyślemy Ci kod logowania.",CF="Wprowadź swój adres e-mail lub numer telefonu, aby się zalogować",NF="Wprowadź swój adres e-mail, a my wyślemy Ci link do logowania.",IF="Wprowadź swój numer telefonu, aby się zalogować",jF="Wprowadź swój adres {{authMethod}}, aby się zalogować.",TF="Wylogowanie",OF="Nowy adres e-mail",PF="Jednorazowy kod zostanie wysłany na Twój nowy adres e-mail, wprowadź kod w następnym kroku.",RF="Brak ustawionego adresu e-mail",LF="Nie, chcę użyć innego konta",BF="lub",DF="Hasło",UF="Hasło zawiera zakazane słowo",MF="Hasło nie może zawierać danych osobowych, takich jak imię lub adres e-mail",qF="Hasło zostało zresetowane",FF="Sukces",HF="Hasło musi zawierać co najmniej jedną małą literę",VF="Hasło musi zawierać co najmniej jedną cyfrę",KF="Hasło musi zawierać co najmniej jeden znak specjalny",GF="Hasło musi zawierać co najmniej jedną wielką literę",WF="Kod nie został znaleziony lub wygasł",JF="Nie udało się zresetować hasła",XF="Hasło było niedawno używane i nie może być ponownie użyte",ZF="Hasło musi mieć co najmniej {{minLength}} znaków",YF="Zmień hasło do konta {{vendorName}}",QF="Zmiana hasła do konta {{vendorName}} ",eH="Numer telefonu",tH="Polityka prywatności",nH="Przekierowanie",rH="Potwierdź hasło",iH="Zarejestruj nowe hasło",oH="Wyślij ponownie kod",sH="Zmiana hasła",aH="Wprowadź poniżej nowe hasło do konta e-mail: ",cH="Kliknij przycisk, aby zresetować hasło",lH="Kliknij przycisk, aby zresetować hasło",uH="Zmień hasło",dH="Zmiana hasła do konta {{vendorName}} ",pH="Resetowanie hasła",fH="Wyślij",hH="Wyślij mi nowy magiczny link",gH="Pamiętaj, aby sprawdzić folder spamu, jeśli wiadomość e-mail nie dotarła.",mH="Ustaw hasło",_H="Pokaż hasło",yH="Zaloguj się",bH="Rejestracja",wH="Rejestracja zakończona sukcesem",vH="{{code}} to kod logowania do {{vendorName}}",xH="Wygląda na to, że Twoje konto Spotify jest obecnie połączone z innym kontem Sesamy. Ale nie martw się, jesteśmy tutaj, aby poprowadzić Cię przez proces, aby to naprawić.",kH="Przejdź do strony dostępu do treści Spotify",$H='Zacznijmy od odłączenia konta Spotify. Kliknij poniższy przycisk, aby przejść do strony dostępu do treści Spotify. Po zalogowaniu się na swoje konto Spotify, znajdź Sesamy na liście połączonych platform. Kliknij "Odłącz" obok logo Sesamy.',SH="Krok 1: Odłącz swoje konto Spotify",zH="Po pomyślnym odłączeniu konta Spotify możesz ponownie połączyć je z Sesamy. Wystarczy powtórzyć poprzednie kroki, które doprowadziły Cię do tej strony.",AH="Krok 2: Połącz ponownie swoje konto Spotify z Sesamy",EH="Ups! Twoje konto Spotify jest już połączone",CH="Gotowe",NH="Jeśli masz pytania lub potrzebujesz pomocy, skontaktuj się z nami",IH="Zasady i warunki",jH="Coś poszło nie tak. Spróbuj ponownie.",TH="Odłącz",OH="Twój adres e-mail wymaga weryfikacji. Wysłaliśmy nową wiadomość e-mail na Twoją skrzynkę odbiorczą",PH="Aktualizacja wiadomości e-mail",RH="Konto użytkownika nie istnieje",LH="Konto użytkownika nie istnieje",BH="Nie mogliśmy znaleźć użytkownika o podanym adresie e-mail. Spróbuj ponownie.",DH="Spróbuj ponownie.",UH="Sprawdź poprawność kodu",MH="Sprawdź swoją skrzynkę odbiorczą, aby uzyskać instrukcje dotyczące weryfikacji wiadomości e-mail.",qH="Zarejestrowany",FH="Kliknij przycisk, aby zweryfikować swój adres e-mail",HH="Potwierdź swój adres e-mail",VH="Potwierdź swój adres e-mail",KH="Zweryfikuj konto",GH="Zweryfikuj swój adres e-mail",WH="Witamy",JH="Witamy na koncie {{vendorName}}!",XH="Sprawdź swoją skrzynkę e-mail pod adresem <0>{{email}}</0> i wprowadź sześciocyfrowy kod, który wysłaliśmy.",ZH="Kontynuuj korzystanie z tego konta",YH="Tak, kontynuuj {{text}}",QH="Tak, kontynuuj korzystanie z istniejącego konta",eV={account_detected:ZM,account_page_description:YM,account_title:QM,account_with_sso_provider:eq,agree_to:tq,and:nq,auth_method_email:rq,auth_method_email_or_phone:iq,auth_method_phone:oq,callback_url_mismatch:sq,callback_url_not_allowed:aq,change_email:cq,check_email_title:lq,click_to_sign_up_description:uq,code_email_enter_code:dq,code_email_subject:pq,code_email_title:fq,code_expired:hq,code_invalid:gq,code_sent_template:mq,code_used:_q,code_valid_30_minutes:yq,configuration_error_message:bq,confirm_password:wq,confirm_unlink:vq,contact_support:xq,contact_us:kq,continue:"Kontynuuj",continue_social_login:$q,continue_with:Sq,continue_with_sso_provider_headline:zq,copyright:Aq,copyright_sesamy:Eq,create_account_description:Cq,create_account_email_invalid:Nq,create_account_passwords_didnt_match:Iq,create_account_title:jq,create_account_weak_password:Tq,create_new_account_link:Oq,create_password_account_title:Pq,current_email:Rq,currently_logged_in_as:Lq,edit:Bq,email:Dq,email_already_taken:Uq,email_changed_to_template:Mq,email_or_phone_placeholder:qq,email_placeholder:Fq,email_validated:Hq,email_validated_cta:Vq,email_verification_for_signup_sent_description:Kq,email_verification_for_signup_sent_title:Gq,embedded_browser_detected:Wq,embedded_browser_warning:Jq,enter_a_code_btn:Xq,enter_email_for_verification_description:Zq,enter_new_email:Yq,enter_new_password_placeholder:Qq,enter_password:eF,enter_password_description:tF,enter_your_password_btn:nF,error_page_title:rF,expired_code:iF,fokus_info_message:oF,forgot_password_cta:sF,forgot_password_description:aF,forgot_password_email_sent:cF,forgot_password_link:lF,forgot_password_title:uF,go_back:dF,hide_password:pF,incognito_mode_detected:fF,incognito_mode_warning:hF,"invalid-email":"Nieprawidłowy adres e-mail",invalid_identifier:gF,invalid_password:mF,invalid_session_body:_F,invalid_session_title:yF,linked_accounts:bF,link_email_click_to_login:wF,link_email_login:vF,link_email_or_enter_code:xF,link_page_body:kF,link_page_headline:$F,logged_in_as:SF,login:zF,login_description:AF,login_description_code:EF,login_description_combined:CF,login_description_link:NF,login_description_phone:IF,login_description_template:jF,logout:TF,new_email:OF,new_email_code_info:PF,no_email_address:RF,no_use_another:LF,or:BF,password:DF,password_contains_forbidden_word:UF,password_contains_personal_info:MF,password_has_been_reset:qF,password_has_been_reset_title:FF,password_missing_lowercase:HF,password_missing_number:VF,password_missing_special:KF,password_missing_uppercase:GF,password_reset_code_expired:WF,password_reset_failed:JF,password_reused:XF,password_too_short:ZF,password_reset_subject:YF,password_reset_title:QF,phone_placeholder:eH,privacy_policy:tH,redirecting:nH,reenter_new_password_placeholder:rH,register_password_account:iH,resend_code:oH,reset_password_cta:sH,reset_password_description:aH,reset_password_email_click_to_reset:cH,reset_password_email_cta:lH,reset_password_email_reset:uH,reset_password_subject:dH,reset_password_title:pH,send:fH,send_me_a_new_magic_link:hH,sent_code_spam:gH,"Server error: Invalid code":"Nieprawidłowy kod",set_password:mH,show_password:_H,sign_in:yH,signup:bH,signup_success:wH,sms_code_text:vH,spotify_already_linked_body:xH,spotify_already_linked_cta:kH,spotify_already_linked_step1_body:$H,spotify_already_linked_step1_title:SH,spotify_already_linked_step2_body:zH,spotify_already_linked_step2_title:AH,spotify_already_linked_title:EH,success:CH,support_info:NH,terms:IH,unexpected_error_try_again:jH,unlink:TH,unverified_email:OH,update_email:PH,user_account_does_not_exist:RH,user_not_found:LH,user_not_found_body:BH,user_not_found_cta:DH,validate_code:UH,validate_email_body:MH,validate_email_title:qH,verify_email_click_to_verify:FH,verify_email_subject:HH,verify_email_title:VH,verify_email_verify:KH,verify_your_email:GH,welcome:WH,welcome_to_your_account:JH,we_sent_a_code_to:XH,yes_continue:ZH,yes_continue_with:YH,yes_continue_with_existing_account:QH},tV="Zjištěný účet",nV="Spravujte podrobnosti svého účtu",rV="Účet",iV="Zjistili jsme, že jste si již vytvořili účet prostřednictvím",oV="Přihlášením souhlasíte s našimi",sV="a",aV="e-mailová adresa",cV="e-mail nebo telefonní číslo",lV="telefonní číslo",uV="Neshoda adresy URL zpětného volání",dV="Zadané redirect_uri není v seznamu povolených zpětných adres URL.",pV="Změnit e-mailovou adresu",fV="pokračovat s uživatelem",hV="Klikněte na tlačítko pro vytvoření nového účtu s heslem.",gV="Pro dokončení přihlášení zadejte kód na adrese {{vendorName}}.",mV="Vítejte na {{vendorName}}! {{code}} je přihlašovací kód.",_V="Vítejte na {{vendorName}}! {{code}} je přihlašovací kód.",yV="Kód vypršel",bV="Neplatný kód",wV="Zkontrolujte prosím <0>{{username}}</0> a zadejte šestimístný kód, který jsme vám zaslali.",vV="Kód je již použit",xV="Kód je platný po dobu 30 minut",kV="Došlo k chybě konfigurace.",$V="Potvrzení hesla",SV="Jste si jisti, že chcete zrušit propojení tohoto účtu?",zV="Potřebujete pomoc?",AV="Kontaktujte nás",EV="nebo pokračovat v sociálním účtu",CV="Pokračovat s {{provider}}",NV="Chcete pokračovat ve svém stávajícím účtu?",IV="Copyright © 2023 SESAMY. Všechna práva vyhrazena.",jV="©2023 Sesamy",TV="Zvolte heslo složené z velkých a malých písmen, číslic a symbolů.",OV="Zadejte prosím platnou e-mailovou adresu.",PV="Hesla se neshodovala. Zkuste to znovu.",RV="Zvolte heslo",LV="Heslo musí mít alespoň 8 znaků a obsahovat alespoň jedno malé písmeno, jedno velké písmeno, jednu číslici a jeden symbol.",BV="Vytvořit nový účet",DV="Zaregistrujte se pomocí hesla",UV="Aktuální e-mailová adresa",MV="V současné době jste přihlášeni jako <0>{{email}}</0>",qV="Upravit",FV="E-mail",HV="E-mail je již obsazen",VV="E-mail se změnil na <0>{{email}}</0> ",KV="E-mail nebo telefonní číslo",GV="E-mailová adresa",WV="Vaše e-mailová adresa byla ověřena",JV="Nyní zadejte své heslo a znovu se přihlaste",XV="E-mail byl odeslán na adresu <0>{{email}}</0> s ověřovacím odkazem. Kliknutím na odkaz ověřte svou e-mailovou adresu a nastavte heslo.",ZV="Ověření e-mailem odesláno",YV="Musíte se stále přihlašovat?",QV="Právě se nacházíte v prohlížeči {{browserName}}. Tento prohlížeč vás často odhlašuje, proto doporučujeme použít výchozí prohlížeč telefonu.",eK="Zadejte kód",tK="Pošleme vám ověřovací odkaz, abychom se ujistili, že tuto e-mailovou adresu vlastníte.",nK="Zadejte nový e-mail",rK="Zadejte nové heslo",iK="Zadejte heslo",oK="Pro přihlášení zadejte svou e-mailovou adresu a heslo.",sK="Zadejte své heslo",aK="Něco se pokazilo",cK="Platnost kouzelného odkazu vypršela. Klikněte na tlačítko níže, abyste obdrželi nový odkaz do své e-mailové schránky.",lK="Ahoj! Aktualizovali jsme naše přihlašovací prostředí. <0>Klikněte sem a dozvíte se o něm více.</0>",uK="Odeslání e-mailu pro obnovení hesla",dK="Klikněte na tlačítko níže a my vám zašleme pokyny k obnovení hesla.",pK="Odeslání e-mailu s žádostí o obnovení hesla",fK="Zapomněli jste heslo?",hK="Zapomněli jste heslo?",gK="Vrátit se zpět",mK="Skrýt heslo",_K="Zjištěn režim inkognito",yK="Jste v inkognito/soukromém režimu. Data relace nemusí přetrvávat při obnovení stránky. Některé funkce nemusí fungovat podle očekávání.",bK="Neplatný identifikátor",wK="Neplatné heslo",vK=`Odkaz již není platný.
|
|
366
|
+
|
|
367
|
+
Ujistěte se, že jste odkaz na přihlášení otevřeli ve stejném prohlížeči, ve kterém jste přihlášení zahájili.
|
|
368
|
+
|
|
369
|
+
Kliknutím na odkaz níže můžete zahájit nové přihlášení.`,xK="Neplatný odkaz",kK="Propojené účty",$K="Kliknutím na tlačítko se přihlásíte",SK="Přihlášení",zK="Nebo zadejte kód na adrese {{vendorName}} a dokončete přihlášení.",AK="Zadejte svou e-mailovou adresu pro odemknutí tohoto pořadu na {{service}}",EK="Propojte svůj účet s {{service}}",CK="Jste přihlášeni jako",NK="Přihlášení",IK="Pro přihlášení zadejte svou e-mailovou adresu.",jK="Zadejte svou e-mailovou adresu a my vám zašleme přihlašovací kód.",TK="Pro přihlášení zadejte svůj e-mail nebo telefonní číslo",OK="Zadejte svou e-mailovou adresu a my vám zašleme odkaz pro přihlášení.",PK="Zadejte své telefonní číslo a přihlaste se",RK="Pro přihlášení zadejte adresu {{authMethod}}.",LK="Odhlášení",BK="Nová e-mailová adresa",DK="Na vaši novou e-mailovou adresu bude zaslán jednorázový kód, zadejte kód v dalším kroku.",UK="Žádná e-mailová adresa není nastavena",MK="Ne, chci použít jiný účet",qK="nebo",FK="Heslo",HK="Heslo obsahuje zakázané slovo",VK="Heslo nesmí obsahovat osobní údaje jako jméno nebo e-mail",KK="Heslo bylo resetováno",GK="Úspěch",WK="Heslo musí obsahovat alespoň jedno malé písmeno",JK="Heslo musí obsahovat alespoň jednu číslici",XK="Heslo musí obsahovat alespoň jeden speciální znak",ZK="Heslo musí obsahovat alespoň jedno velké písmeno",YK="Kód nebyl nalezen nebo vypršel",QK="Heslo se nepodařilo resetovat",eG="Heslo bylo nedávno použito a nelze jej znovu použít",tG="Heslo musí mít alespoň {{minLength}} znaků",nG="Změna hesla pro účet {{vendorName}}",rG="Změna hesla k účtu {{vendorName}} ",iG="Telefonní číslo",oG="Zásady ochrany osobních údajů",sG="Přesměrování",aG="Potvrzení hesla",cG="Registrace nového hesla",lG="Opětovné odeslání kódu",uG="Změna hesla",dG="Níže zadejte nové heslo k e-mailovému účtu: ",pG="Kliknutím na tlačítko obnovíte své heslo",fG="Kliknutím na tlačítko obnovíte své heslo",hG="Obnovení hesla",gG="Změna hesla k účtu {{vendorName}} ",mG="Obnovení hesla",_G="Odeslat",yG="Pošlete mi nový kouzelný odkaz",bG="Pokud e-mail nedorazil, nezapomeňte zkontrolovat složku nevyžádané pošty.",wG="Nastavení hesla",vG="Zobrazit heslo",xG="Přihlásit se",kG="Registrace",$G="Úspěšná registrace",SG="{{code}} je váš přihlašovací kód pro {{vendorName}}",zG="Zdá se, že váš účet Spotify je v současné době propojen s jiným účtem Sesamy. Ale nebojte se, jsme tu, abychom vás provedli procesem, jak to napravit.",AG="Přejděte na stránku Spotify pro přístup k obsahu",EG='Začněme odpojením účtu Spotify. Kliknutím na tlačítko níže přejděte na stránku přístupu k obsahu služby Spotify. Po přihlášení k účtu Spotify najděte v seznamu připojených platforem položku Sesamy. Klikněte na tlačítko "Unlink" vedle loga Sesamy.',CG="Krok 1: Odpojení účtu Spotify",NG="Po úspěšném odpojení účtu Spotify jej můžete znovu propojit se službou Sesamy. Stačí zopakovat předchozí kroky, které vás přivedly na tuto stránku.",IG="Krok 2: Propojení účtu Spotify s aplikací Sesamy",jG="Ups! Váš účet Spotify je již propojen",TG="Hotovo",OG="Pokud máte dotazy nebo potřebujete pomoc, můžete se obrátit na náš tým podpory.",PG="Podmínky a pravidla",RG="Něco se pokazilo. Zkuste to prosím znovu.",LG="Odpojit",BG="Vaši e-mailovou adresu je třeba ověřit. Do vaší e-mailové schránky jsme odeslali nový e-mail.",DG="Aktualizace e-mailu",UG="Uživatelský účet neexistuje",MG="Uživatelský účet neexistuje",qG="Nepodařilo se nám najít uživatele se zadanou e-mailovou adresou. Zkuste to prosím znovu.",FG="Zkuste to znovu.",HG="Ověření kódu",VG="Pokyny k ověření e-mailu najdete ve své e-mailové schránce.",KG="Zaregistrovali jste se",GG="Klikněte na tlačítko pro ověření e-mailové adresy",WG="Ověřte svou e-mailovou adresu",JG="Ověřte svou e-mailovou adresu",XG="Ověření účtu",ZG="Ověření e-mailu",YG="Vítejte na",QG="Vítejte na svém účtu {{vendorName}}!",eW="Zkontrolujte si prosím svůj e-mail na adrese <0>{{email}}</0> a zadejte šestimístný kód, který jsme vám zaslali.",tW="Pokračujte s tímto účtem",nW="Ano, pokračujte {{text}}",rW="Ano, pokračujte ve stávajícím účtu",iW={account_detected:tV,account_page_description:nV,account_title:rV,account_with_sso_provider:iV,agree_to:oV,and:sV,auth_method_email:aV,auth_method_email_or_phone:cV,auth_method_phone:lV,callback_url_mismatch:uV,callback_url_not_allowed:dV,change_email:pV,check_email_title:fV,click_to_sign_up_description:hV,code_email_enter_code:gV,code_email_subject:mV,code_email_title:_V,code_expired:yV,code_invalid:bV,code_sent_template:wV,code_used:vV,code_valid_30_minutes:xV,configuration_error_message:kV,confirm_password:$V,confirm_unlink:SV,contact_support:zV,contact_us:AV,continue:"Pokračovat",continue_social_login:EV,continue_with:CV,continue_with_sso_provider_headline:NV,copyright:IV,copyright_sesamy:jV,create_account_description:TV,create_account_email_invalid:OV,create_account_passwords_didnt_match:PV,create_account_title:RV,create_account_weak_password:LV,create_new_account_link:BV,create_password_account_title:DV,current_email:UV,currently_logged_in_as:MV,edit:qV,email:FV,email_already_taken:HV,email_changed_to_template:VV,email_or_phone_placeholder:KV,email_placeholder:GV,email_validated:WV,email_validated_cta:JV,email_verification_for_signup_sent_description:XV,email_verification_for_signup_sent_title:ZV,embedded_browser_detected:YV,embedded_browser_warning:QV,enter_a_code_btn:eK,enter_email_for_verification_description:tK,enter_new_email:nK,enter_new_password_placeholder:rK,enter_password:iK,enter_password_description:oK,enter_your_password_btn:sK,error_page_title:aK,expired_code:cK,fokus_info_message:lK,forgot_password_cta:uK,forgot_password_description:dK,forgot_password_email_sent:pK,forgot_password_link:fK,forgot_password_title:hK,go_back:gK,hide_password:mK,incognito_mode_detected:_K,incognito_mode_warning:yK,"invalid-email":"Neplatný e-mail",invalid_identifier:bK,invalid_password:wK,invalid_session_body:vK,invalid_session_title:xK,linked_accounts:kK,link_email_click_to_login:$K,link_email_login:SK,link_email_or_enter_code:zK,link_page_body:AK,link_page_headline:EK,logged_in_as:CK,login:NK,login_description:IK,login_description_code:jK,login_description_combined:TK,login_description_link:OK,login_description_phone:PK,login_description_template:RK,logout:LK,new_email:BK,new_email_code_info:DK,no_email_address:UK,no_use_another:MK,or:qK,password:FK,password_contains_forbidden_word:HK,password_contains_personal_info:VK,password_has_been_reset:KK,password_has_been_reset_title:GK,password_missing_lowercase:WK,password_missing_number:JK,password_missing_special:XK,password_missing_uppercase:ZK,password_reset_code_expired:YK,password_reset_failed:QK,password_reused:eG,password_too_short:tG,password_reset_subject:nG,password_reset_title:rG,phone_placeholder:iG,privacy_policy:oG,redirecting:sG,reenter_new_password_placeholder:aG,register_password_account:cG,resend_code:lG,reset_password_cta:uG,reset_password_description:dG,reset_password_email_click_to_reset:pG,reset_password_email_cta:fG,reset_password_email_reset:hG,reset_password_subject:gG,reset_password_title:mG,send:_G,send_me_a_new_magic_link:yG,sent_code_spam:bG,"Server error: Invalid code":"Neplatný kód",set_password:wG,show_password:vG,sign_in:xG,signup:kG,signup_success:$G,sms_code_text:SG,spotify_already_linked_body:zG,spotify_already_linked_cta:AG,spotify_already_linked_step1_body:EG,spotify_already_linked_step1_title:CG,spotify_already_linked_step2_body:NG,spotify_already_linked_step2_title:IG,spotify_already_linked_title:jG,success:TG,support_info:OG,terms:PG,unexpected_error_try_again:RG,unlink:LG,unverified_email:BG,update_email:DG,user_account_does_not_exist:UG,user_not_found:MG,user_not_found_body:qG,user_not_found_cta:FG,validate_code:HG,validate_email_body:VG,validate_email_title:KG,verify_email_click_to_verify:GG,verify_email_subject:WG,verify_email_title:JG,verify_email_verify:XG,verify_your_email:ZG,welcome:YG,welcome_to_your_account:QG,we_sent_a_code_to:eW,yes_continue:tW,yes_continue_with:nW,yes_continue_with_existing_account:rW},oW="Tili havaittu",sW="Hallitse tilisi tietoja",aW="Tili",cW="Olemme havainneet, että olet jo luonut tilin kautta",lW="Kirjautumalla sisään hyväksyt",uW="ja",dW="sähköpostiosoite",pW="sähköpostiosoite tai puhelinnumero",fW="puhelinnumero",hW="Takaisinkutsun URL-osoite ei vastaa toisiaan",gW="Annettu redirect_uri ei ole sallittujen takaisinsoitto-URL-osoitteiden luettelossa.",mW="Vaihda sähköpostiosoite",_W="jatka käyttäjän kanssa",yW="Klikkaa painiketta luodaksesi uuden salasanatilin.",bW="Kirjoita koodi osoitteessa {{vendorName}} kirjautumisen loppuun saattamiseksi.",wW="Tervetuloa osoitteeseen {{vendorName}}! {{code}} on kirjautumiskoodi.",vW="Tervetuloa osoitteeseen {{vendorName}}! {{code}} on kirjautumiskoodi.",xW="Koodi päättynyt",kW="Virheellinen koodi",$W="Tarkista <0>{{username}}</0> ja syötä lähettämämme kuusinumeroinen koodi.",SW="Koodi on jo käytössä",zW="Koodi on voimassa 30 minuuttia",AW="Konfigurointivirhe tapahtui.",EW="Vahvista salasana",CW="Oletko varma, että haluat poistaa tämän tilin linkityksen?",NW="Tarvitsetko apua?",IW="Ota yhteyttä",jW="tai jatka sosiaalisella tilillä",TW="Jatka {{provider}}",OW="Haluatko jatkaa olemassa olevalla tililläsi?",PW="Copyright © 2023 SESAMY. Kaikki oikeudet pidätetään.",RW="©2023 Sesamy",LW="Valitse salasana, jossa on isoja ja pieniä kirjaimia, numeroita ja symboleja.",BW="Kirjoita voimassa oleva sähköpostiosoite.",DW="Salasanat eivät vastanneet toisiaan. Yritä uudelleen.",UW="Valitse salasana",MW="Salasanan on oltava vähintään 8 merkkiä pitkä ja sisällettävä vähintään yksi pieni kirjain, yksi iso kirjain, yksi numero ja yksi symboli.",qW="Luo uusi tili",FW="Rekisteröidy salasanalla",HW="Nykyinen sähköpostiosoite",VW="Olet tällä hetkellä kirjautuneena sisään nimellä <0>{{email}}</0>",KW="Muokkaa",GW="Sähköposti",WW="Sähköposti on jo varattu",JW="Sähköposti muutettu muotoon <0>{{email}}</0> ",XW="Sähköposti tai puhelinnumero",ZW="Sähköpostiosoite",YW="Sähköpostiosoitteesi on vahvistettu",QW="Kirjoita nyt salasanasi kirjautuaksesi uudelleen",eJ="Sähköposti on lähetetty osoitteeseen <0>{{email}}</0> jossa on vahvistuslinkki. Klikkaa linkkiä vahvistaaksesi sähköpostiosoitteesi ja asettaaksesi salasanan.",tJ="Sähköpostivarmennus lähetetty",nJ="Pitääkö sinun kirjautua jatkuvasti sisään?",rJ="Olet tällä hetkellä osoitteessa {{browserName}}. Tämä selain kirjautuu usein ulos, joten suosittelemme käyttämään sen sijaan puhelimen oletusselainta.",iJ="Syötä koodi",oJ="Lähetämme sinulle vahvistuslinkin varmistaaksemme, että omistat tämän sähköpostiosoitteen.",sJ="Kirjoita uusi sähköpostiosoite",aJ="Anna uusi salasana",cJ="Anna salasana",lJ="Anna sähköpostiosoitteesi ja salasanasi kirjautuaksesi sisään.",uJ="Syötä salasanasi",dJ="Jotain meni pieleen",pJ="Taikalinkki on vanhentunut. Klikkaa alla olevaa painiketta saadaksesi uuden linkin sähköpostiisi.",fJ="Hei! Päivitimme kirjautumiskokemuksemme. <0>Klikkaa tästä saadaksesi lisätietoja siitä.</0>",hJ="Lähetä salasanan palautussähköposti",gJ="Napsauta alla olevaa painiketta, niin lähetämme ohjeet salasanasi palauttamiseen.",mJ="Salasanan palautussähköposti lähetetty",_J="Unohditko salasanan?",yJ="Unohditko salasanan?",bJ="Palaa takaisin",wJ="Piilota salasana",vJ="Incognito-tila havaittu",xJ="Olet incognito/yksityisessä tilassa. Istuntotiedot eivät välttämättä säily sivun päivitysten aikana. Jotkin ominaisuudet eivät ehkä toimi odotetulla tavalla.",kJ="Virheellinen tunniste",$J="Virheellinen salasana",SJ=`Linkki ei ole enää voimassa.
|
|
370
|
+
|
|
371
|
+
Varmista, että avaat kirjautumislinkin samalla selaimella, jolla aloitit kirjautumisen.
|
|
372
|
+
|
|
373
|
+
Voit aloittaa uuden kirjautumisen klikkaamalla alla olevaa linkkiä.`,zJ="Virheellinen linkki",AJ="Linkitetyt tilit",EJ="Kirjaudu sisään napsauttamalla painiketta",CJ="Kirjaudu sisään",NJ="Tai kirjoita koodi osoitteessa {{vendorName}} kirjautumisen loppuun saattamiseksi.",IJ="Kirjoita sähköpostiosoitteesi avataksesi tämän ohjelman osoitteessa {{service}}",jJ="Yhdistä tilisi {{service}}",TJ="Olet kirjautunut sisään nimellä",OJ="Kirjaudu sisään",PJ="Kirjoita sähköpostiosoitteesi kirjautuaksesi sisään.",RJ="Anna sähköpostiosoitteesi, niin lähetämme sinulle kirjautumiskoodin.",LJ="Kirjoita sähköpostiosoitteesi tai puhelinnumerosi kirjautuaksesi sisään",BJ="Anna sähköpostiosoitteesi, niin lähetämme sinulle kirjautumislinkin.",DJ="Anna puhelinnumerosi kirjautuaksesi sisään",UJ="Kirjoita {{authMethod}} kirjautuaksesi sisään.",MJ="Kirjaudu ulos",qJ="Uusi sähköpostiosoite",FJ="Yksi kertainen koodi lähetetään uuteen sähköpostiosoitteeseesi, syötä koodi seuraavassa vaiheessa.",HJ="Ei sähköpostiosoitetta asetettu",VJ="Ei, haluan käyttää toista tiliä",KJ="tai",GJ="Salasana",WJ="Salasana sisältää kielletyn sanan",JJ="Salasana ei saa sisältää henkilötietoja, kuten nimeäsi tai sähköpostiosoitettasi",XJ="Salasana on nollattu",ZJ="Menestys",YJ="Salasanan on sisällettävä vähintään yksi pieni kirjain",QJ="Salasanan on sisällettävä vähintään yksi numero",eX="Salasanan on sisällettävä vähintään yksi erikoismerkki",tX="Salasanan on sisällettävä vähintään yksi iso kirjain",nX="Koodia ei löytynyt tai se on vanhentunut",rX="Salasanaa ei voitu nollata",iX="Salasanaa on käytetty äskettäin, eikä sitä voi käyttää uudelleen",oX="Salasanan on oltava vähintään {{minLength}} merkkiä",sX="Vaihda salasana tilillesi {{vendorName}} ",aX="Vaihda salasana tilillesi {{vendorName}} ",cX="Puhelinnumero",lX="Tietosuojakäytäntö",uX="Uudelleenohjaus",dX="Vahvista salasana",pX="Rekisteröi uusi salasana",fX="Lähetä koodi uudelleen",hX="Vaihda salasana",gX="Kirjoita alla oleva uusi salasanasi sähköpostitiliä varten: ",mX="Napsauta painiketta salasanasi palauttamiseksi",_X="Napsauta painiketta salasanasi palauttamiseksi",yX="Nollaa salasanasi",bX="Vaihda salasana tilillesi {{vendorName}} ",wX="Nollaa salasana",vX="Lähetä",xX="Lähetä minulle uusi maaginen linkki",kX="Muista tarkistaa roskapostikansiosi, jos sähköposti ei ole saapunut.",$X="Aseta salasana",SX="Näytä salasana",zX="Kirjaudu sisään",AX="Rekisteröityminen",EX="Rekisteröidy onnistuneesti",CX="{{code}} on kirjautumiskoodisi {{vendorName}}",NX="Näyttää siltä, että Spotify-tilisi on tällä hetkellä yhdistetty toiseen Sesamy-tiliin. Mutta älä pelkää, me opastamme sinua prosessin läpi, jotta saat tämän korjattua.",IX="Siirry Spotifyn Content Access -sivulle",jX='Aloitetaan poistamalla Spotify-tilisi linkitys. Klikkaa alla olevaa painiketta siirtyäksesi Spotifyn Content Access -sivulle. Kun olet kirjautunut sisään Spotify-tilillesi, etsi Sesamy yhdistettyjen alustojen luettelosta. Napsauta "Unlink" Sesamyn logon vieressä.',TX="Vaihe 1: Poista Spotify-tilisi linkitys",OX="Kun olet onnistuneesti irrottanut Spotify-tilisi, voit yhdistää sen uudelleen Sesamyn kanssa. Toista vain aiemmin tekemäsi vaiheet, jotka johtivat sinut tälle sivulle.",PX="Vaihe 2: Yhdistä Spotify-tilisi uudelleen Sesamyn kanssa",RX="Hups! Spotify-tilisi on jo linkitetty",LX="Valmis",BX="Jos sinulla on kysyttävää tai tarvitset apua, voit ottaa yhteyttä tukitiimiimme.",DX="Ehdot ja edellytykset",UX="Jokin meni pieleen. Yritä uudelleen.",MX="Irrota",qX="Sähköpostiosoitteesi on vahvistettava. Olemme lähettäneet uuden sähköpostiviestin sähköpostiisi.",FX="Päivitä sähköposti",HX="Käyttäjätiliä ei ole olemassa",VX="Käyttäjätiliä ei ole olemassa",KX="Emme löytäneet käyttäjää, jolla on annettu sähköpostiosoite. Yritä uudelleen.",GX="Yritä uudelleen.",WX="Validoi koodi",JX="Tarkista sähköpostin vahvistusohjeet postilaatikostasi.",XX="Rekisteröitynyt",ZX="Vahvista sähköpostiosoitteesi napsauttamalla painiketta",YX="Vahvista sähköpostiosoitteesi",QX="Vahvista sähköpostiosoitteesi",eZ="Vahvista tili",tZ="Vahvista sähköpostiosoitteesi",nZ="Tervetuloa",rZ="Tervetuloa tilillesi {{vendorName}}!",iZ="Tarkista sähköpostisi osoitteesta <0>{{email}}</0> ja syötä lähettämämme kuusinumeroinen koodi.",oZ="Jatka tällä tilillä",sZ="Kyllä, jatka {{text}}",aZ="Kyllä, jatka olemassa olevalla tilillä",cZ={account_detected:oW,account_page_description:sW,account_title:aW,account_with_sso_provider:cW,agree_to:lW,and:uW,auth_method_email:dW,auth_method_email_or_phone:pW,auth_method_phone:fW,callback_url_mismatch:hW,callback_url_not_allowed:gW,change_email:mW,check_email_title:_W,click_to_sign_up_description:yW,code_email_enter_code:bW,code_email_subject:wW,code_email_title:vW,code_expired:xW,code_invalid:kW,code_sent_template:$W,code_used:SW,code_valid_30_minutes:zW,configuration_error_message:AW,confirm_password:EW,confirm_unlink:CW,contact_support:NW,contact_us:IW,continue:"Jatka",continue_social_login:jW,continue_with:TW,continue_with_sso_provider_headline:OW,copyright:PW,copyright_sesamy:RW,create_account_description:LW,create_account_email_invalid:BW,create_account_passwords_didnt_match:DW,create_account_title:UW,create_account_weak_password:MW,create_new_account_link:qW,create_password_account_title:FW,current_email:HW,currently_logged_in_as:VW,edit:KW,email:GW,email_already_taken:WW,email_changed_to_template:JW,email_or_phone_placeholder:XW,email_placeholder:ZW,email_validated:YW,email_validated_cta:QW,email_verification_for_signup_sent_description:eJ,email_verification_for_signup_sent_title:tJ,embedded_browser_detected:nJ,embedded_browser_warning:rJ,enter_a_code_btn:iJ,enter_email_for_verification_description:oJ,enter_new_email:sJ,enter_new_password_placeholder:aJ,enter_password:cJ,enter_password_description:lJ,enter_your_password_btn:uJ,error_page_title:dJ,expired_code:pJ,fokus_info_message:fJ,forgot_password_cta:hJ,forgot_password_description:gJ,forgot_password_email_sent:mJ,forgot_password_link:_J,forgot_password_title:yJ,go_back:bJ,hide_password:wJ,incognito_mode_detected:vJ,incognito_mode_warning:xJ,"invalid-email":"Virheellinen sähköpostiosoite",invalid_identifier:kJ,invalid_password:$J,invalid_session_body:SJ,invalid_session_title:zJ,linked_accounts:AJ,link_email_click_to_login:EJ,link_email_login:CJ,link_email_or_enter_code:NJ,link_page_body:IJ,link_page_headline:jJ,logged_in_as:TJ,login:OJ,login_description:PJ,login_description_code:RJ,login_description_combined:LJ,login_description_link:BJ,login_description_phone:DJ,login_description_template:UJ,logout:MJ,new_email:qJ,new_email_code_info:FJ,no_email_address:HJ,no_use_another:VJ,or:KJ,password:GJ,password_contains_forbidden_word:WJ,password_contains_personal_info:JJ,password_has_been_reset:XJ,password_has_been_reset_title:ZJ,password_missing_lowercase:YJ,password_missing_number:QJ,password_missing_special:eX,password_missing_uppercase:tX,password_reset_code_expired:nX,password_reset_failed:rX,password_reused:iX,password_too_short:oX,password_reset_subject:sX,password_reset_title:aX,phone_placeholder:cX,privacy_policy:lX,redirecting:uX,reenter_new_password_placeholder:dX,register_password_account:pX,resend_code:fX,reset_password_cta:hX,reset_password_description:gX,reset_password_email_click_to_reset:mX,reset_password_email_cta:_X,reset_password_email_reset:yX,reset_password_subject:bX,reset_password_title:wX,send:vX,send_me_a_new_magic_link:xX,sent_code_spam:kX,"Server error: Invalid code":"Virheellinen koodi",set_password:$X,show_password:SX,sign_in:zX,signup:AX,signup_success:EX,sms_code_text:CX,spotify_already_linked_body:NX,spotify_already_linked_cta:IX,spotify_already_linked_step1_body:jX,spotify_already_linked_step1_title:TX,spotify_already_linked_step2_body:OX,spotify_already_linked_step2_title:PX,spotify_already_linked_title:RX,success:LX,support_info:BX,terms:DX,unexpected_error_try_again:UX,unlink:MX,unverified_email:qX,update_email:FX,user_account_does_not_exist:HX,user_not_found:VX,user_not_found_body:KX,user_not_found_cta:GX,validate_code:WX,validate_email_body:JX,validate_email_title:XX,verify_email_click_to_verify:ZX,verify_email_subject:YX,verify_email_title:QX,verify_email_verify:eZ,verify_your_email:tZ,welcome:nZ,welcome_to_your_account:rZ,we_sent_a_code_to:iZ,yes_continue:oZ,yes_continue_with:sZ,yes_continue_with_existing_account:aZ},lZ="Konto opdaget",uZ="Administrer dine kontooplysninger",dZ="Konto",pZ="Vi har opdaget, at du allerede har oprettet en konto gennem",fZ="Når du logger ind, accepterer du vores",hZ="og",gZ="e-mail-adresse",mZ="e-mail eller telefonnummer",_Z="Telefonnummer",yZ="Uoverensstemmelse mellem URL og tilbagekald",bZ="Den angivne redirect_uri er ikke på listen over tilladte tilbagekalds-URL'er.",wZ="Ændre e-mailadresse",vZ="Fortsæt med brugeren",xZ="Klik på knappen for at oprette en ny adgangskodekonto.",kZ="Indtast koden på {{vendorName}} for at gennemføre login.",$Z="Velkommen til {{vendorName}}! {{code}} er login-koden",SZ="Velkommen til {{vendorName}}! {{code}} er login-koden",zZ="Koden er udløbet",AZ="Ugyldig kode",EZ="Tjek venligst <0>{{username}}</0> og indtast den sekscifrede kode, som vi har sendt til dig.",CZ="Koden er allerede brugt",NZ="Koden er gyldig i 30 minutter",IZ="Der opstod en konfigurationsfejl.",jZ="Bekræft adgangskode",TZ="Er du sikker på, at du vil fjerne forbindelsen til denne konto?",OZ="Har du brug for hjælp?",PZ="Kontakt os",RZ="eller fortsæt med social konto",LZ="Fortsæt med {{provider}}",BZ="Vil du gerne fortsætte med din eksisterende konto?",DZ="Ophavsret © 2023 SESAMY. Alle rettigheder forbeholdes.",UZ="©2023 Sesamy",MZ="Vælg en adgangskode med en blanding af store og små bogstaver, tal og symboler.",qZ="Indtast venligst en gyldig e-mailadresse.",FZ="Adgangskoderne stemte ikke overens. Prøv igen.",HZ="Vælg adgangskode",VZ="Adgangskoden skal være mindst 8 tegn lang og indeholde mindst et lille bogstav, et stort bogstav, et tal og et symbol.",KZ="Opret ny konto",GZ="Tilmeld dig med adgangskode",WZ="Nuværende e-mailadresse",JZ="Du er i øjeblikket logget ind som <0>{{email}}</0>",XZ="Rediger",ZZ="E-mail",YZ="E-mailen er allerede optaget",QZ="E-mail ændret til <0>{{email}}</0> ",eY="E-mail eller telefonnummer",tY="E-mail-adresse",nY="Din e-mailadresse er blevet valideret",rY="Indtast nu din adgangskode for at logge ind igen",iY="Der er sendt en e-mail til <0>{{email}}</0> med et bekræftelseslink. Klik på linket for at bekræfte din e-mailadresse og angive en adgangskode.",oY="E-mail-bekræftelse sendt",sY="Skal man blive ved med at logge ind?",aY="Du er i øjeblikket inde på {{browserName}}. Denne browser logger dig ofte ud, så vi anbefaler, at du bruger din telefons standardbrowser i stedet.",cY="Indtast en kode",lY="Vi sender dig et bekræftelseslink for at sikre, at du ejer denne e-mailadresse.",uY="Indtast ny e-mail",dY="Indtast ny adgangskode",pY="Indtast adgangskode",fY="Indtast din e-mailadresse og adgangskode for at logge ind.",hY="Indtast din adgangskode",gY="Noget gik galt",mY="Det magiske link er udløbet. Klik på knappen nedenfor for at modtage et nyt link i din indbakke.",_Y="Hej! Vi har opdateret vores login-oplevelse. <0>Klik her for at lære mere om det.</0>",yY="Send e-mail til nulstilling af adgangskode",bY="Klik på knappen nedenfor, så sender vi instruktioner om, hvordan du nulstiller din adgangskode.",wY="E-mail til nulstilling af adgangskode sendt",vY="Har du glemt din adgangskode?",xY="Har du glemt din adgangskode?",kY="Gå tilbage",$Y="Skjul adgangskode",SY="Inkognitotilstand opdaget",zY="Du er i inkognito/privat tilstand. Sessionsdata fortsætter muligvis ikke på tværs af sideopdateringer. Nogle funktioner fungerer måske ikke som forventet.",AY="Ugyldig identifikator",EY="Ugyldig adgangskode",CY="Linket er ikke længere gyldigt. Sørg for at åbne login-linket i den samme browser, som du startede login med. Du kan klikke på linket nedenfor for at starte et nyt login.",NY="Ugyldigt link",IY="Koblede konti",jY="Klik på knappen for at logge ind",TY="Login",OY="Eller indtast koden på {{vendorName}} for at gennemføre login.",PY="Indtast din e-mailadresse for at låse op for dette show på {{service}}",RY="Forbind din konto med {{service}}",LY="Du er logget ind som",BY="Login",DY="Indtast din e-mailadresse for at logge ind.",UY="Indtast din e-mailadresse, så sender vi dig en login-kode.",MY="Indtast din e-mail eller dit telefonnummer for at logge ind",qY="Indtast din e-mailadresse, så sender vi dig et login-link.",FY="Indtast dit telefonnummer for at logge ind",HY="Indtast din {{authMethod}} for at logge ind.",VY="Log ud",KY="Ny emailadresse",GY="En engangskode vil blive sendt til din nye e-mailadresse, indtast koden i næste trin.",WY="Ingen e-mailadresse er angivet",JY="Nej, jeg vil bruge en anden konto",XY="eller",ZY="Adgangskode",YY="Adgangskoden indeholder et forbudt ord",QY="Adgangskoden må ikke indeholde personlige oplysninger som dit navn eller e-mail",eQ="Adgangskoden er blevet nulstillet",tQ="Succes",nQ="Adgangskoden skal indeholde mindst ét lille bogstav",rQ="Adgangskoden skal indeholde mindst ét tal",iQ="Adgangskoden skal indeholde mindst ét specialtegn",oQ="Adgangskoden skal indeholde mindst ét stort bogstav",sQ="Koden blev ikke fundet eller er udløbet",aQ="Adgangskoden kunne ikke nulstilles",cQ="Adgangskoden er blevet brugt for nylig og kan ikke genbruges",lQ="Adgangskoden skal være mindst {{minLength}} tegn",uQ="Skift adgangskode til din {{vendorName}} konto",dQ="Skift adgangskode til din {{vendorName}} -konto",pQ="Telefonnummer",fQ="Politik for beskyttelse af personlige oplysninger",hQ="Omdirigering",gQ="Bekræft adgangskode",mQ="Registrer en ny adgangskode",_Q="Send koden igen",yQ="Skift adgangskode",bQ="Indtast din nye adgangskode til e-mailkontoen nedenfor: ",wQ="Klik på knappen for at nulstille din adgangskode",vQ="Klik på knappen for at nulstille din adgangskode",xQ="Nulstil din adgangskode",kQ="Skift adgangskode til din {{vendorName}} -konto",$Q="Nulstil adgangskode",SQ="Send",zQ="Send mig et nyt magisk link",AQ="Husk at tjekke din spam-mappe, hvis e-mailen ikke er kommet frem.",EQ="Indstil adgangskode",CQ="Vis adgangskode",NQ="Log ind",IQ="Tilmelding",jQ="Tilmeld dig med succes",TQ="{{code}} er din login-kode til {{vendorName}}",OQ="Det ser ud til, at din Spotify-konto i øjeblikket er knyttet til en anden Sesamy-konto. Men frygt ikke, vi er her for at guide dig gennem processen med at få det løst.",PQ="Gå til Spotifys side for adgang til indhold",RQ='Lad os starte med at fjerne forbindelsen til din Spotify-konto. Klik på knappen nedenfor for at gå til Spotifys Content Access-side. Når du har logget ind på din Spotify-konto, skal du finde Sesamy på listen over tilsluttede platforme. Klik på "Unlink" ved siden af Sesamy-logoet.',LQ="Trin 1: Fjern forbindelsen til din Spotify-konto",BQ="Når du har afkoblet din Spotify-konto, kan du koble den til Sesamy igen. Du skal blot gentage de trin, du tidligere har taget, og som førte dig til denne side.",DQ="Trin 2: Relink din Spotify-konto til Sesamy",UQ="Ups! Din Spotify-konto er allerede forbundet",MQ="Færdig",qQ="Hvis du har spørgsmål eller brug for hjælp, kan du kontakte vores supportteam",FQ="Vilkår og betingelser",HQ="Noget gik galt. Prøv venligst igen.",VQ="Frakobl",KQ="Din e-mailadresse skal valideres. Vi har sendt en ny e-mail til din indbakke",GQ="Opdatering af e-mail",WQ="Brugerkontoen findes ikke",JQ="Brugerkontoen findes ikke",XQ="Vi kunne ikke finde en bruger med den angivne e-mailadresse. Prøv venligst igen.",ZQ="Prøv igen.",YQ="Valider koden",QQ="Tjek din indbakke for instruktioner om validering af e-mail.",eee="Tilmeldte sig",tee="Klik på knappen for at bekræfte din e-mailadresse",nee="Bekræft din e-mailadresse",ree="Bekræft din e-mailadresse",iee="Bekræft konto",oee="Bekræft din e-mail",see="Velkommen",aee="Velkommen til din {{vendorName}} konto!",cee="Tjek venligst din e-mail på <0>{{email}}</0> og indtast den sekscifrede kode, vi har sendt dig.",lee="Fortsæt med denne konto",uee="Ja, fortsæt med {{text}}",dee="Ja, fortsæt med eksisterende konto",pee={account_detected:lZ,account_page_description:uZ,account_title:dZ,account_with_sso_provider:pZ,agree_to:fZ,and:hZ,auth_method_email:gZ,auth_method_email_or_phone:mZ,auth_method_phone:_Z,callback_url_mismatch:yZ,callback_url_not_allowed:bZ,change_email:wZ,check_email_title:vZ,click_to_sign_up_description:xZ,code_email_enter_code:kZ,code_email_subject:$Z,code_email_title:SZ,code_expired:zZ,code_invalid:AZ,code_sent_template:EZ,code_used:CZ,code_valid_30_minutes:NZ,configuration_error_message:IZ,confirm_password:jZ,confirm_unlink:TZ,contact_support:OZ,contact_us:PZ,continue:"Fortsæt",continue_social_login:RZ,continue_with:LZ,continue_with_sso_provider_headline:BZ,copyright:DZ,copyright_sesamy:UZ,create_account_description:MZ,create_account_email_invalid:qZ,create_account_passwords_didnt_match:FZ,create_account_title:HZ,create_account_weak_password:VZ,create_new_account_link:KZ,create_password_account_title:GZ,current_email:WZ,currently_logged_in_as:JZ,edit:XZ,email:ZZ,email_already_taken:YZ,email_changed_to_template:QZ,email_or_phone_placeholder:eY,email_placeholder:tY,email_validated:nY,email_validated_cta:rY,email_verification_for_signup_sent_description:iY,email_verification_for_signup_sent_title:oY,embedded_browser_detected:sY,embedded_browser_warning:aY,enter_a_code_btn:cY,enter_email_for_verification_description:lY,enter_new_email:uY,enter_new_password_placeholder:dY,enter_password:pY,enter_password_description:fY,enter_your_password_btn:hY,error_page_title:gY,expired_code:mY,fokus_info_message:_Y,forgot_password_cta:yY,forgot_password_description:bY,forgot_password_email_sent:wY,forgot_password_link:vY,forgot_password_title:xY,go_back:kY,hide_password:$Y,incognito_mode_detected:SY,incognito_mode_warning:zY,"invalid-email":"Ugyldig e-mail",invalid_identifier:AY,invalid_password:EY,invalid_session_body:CY,invalid_session_title:NY,linked_accounts:IY,link_email_click_to_login:jY,link_email_login:TY,link_email_or_enter_code:OY,link_page_body:PY,link_page_headline:RY,logged_in_as:LY,login:BY,login_description:DY,login_description_code:UY,login_description_combined:MY,login_description_link:qY,login_description_phone:FY,login_description_template:HY,logout:VY,new_email:KY,new_email_code_info:GY,no_email_address:WY,no_use_another:JY,or:XY,password:ZY,password_contains_forbidden_word:YY,password_contains_personal_info:QY,password_has_been_reset:eQ,password_has_been_reset_title:tQ,password_missing_lowercase:nQ,password_missing_number:rQ,password_missing_special:iQ,password_missing_uppercase:oQ,password_reset_code_expired:sQ,password_reset_failed:aQ,password_reused:cQ,password_too_short:lQ,password_reset_subject:uQ,password_reset_title:dQ,phone_placeholder:pQ,privacy_policy:fQ,redirecting:hQ,reenter_new_password_placeholder:gQ,register_password_account:mQ,resend_code:_Q,reset_password_cta:yQ,reset_password_description:bQ,reset_password_email_click_to_reset:wQ,reset_password_email_cta:vQ,reset_password_email_reset:xQ,reset_password_subject:kQ,reset_password_title:$Q,send:SQ,send_me_a_new_magic_link:zQ,sent_code_spam:AQ,"Server error: Invalid code":"Ugyldig kode",set_password:EQ,show_password:CQ,sign_in:NQ,signup:IQ,signup_success:jQ,sms_code_text:TQ,spotify_already_linked_body:OQ,spotify_already_linked_cta:PQ,spotify_already_linked_step1_body:RQ,spotify_already_linked_step1_title:LQ,spotify_already_linked_step2_body:BQ,spotify_already_linked_step2_title:DQ,spotify_already_linked_title:UQ,success:MQ,support_info:qQ,terms:FQ,unexpected_error_try_again:HQ,unlink:VQ,unverified_email:KQ,update_email:GQ,user_account_does_not_exist:WQ,user_not_found:JQ,user_not_found_body:XQ,user_not_found_cta:ZQ,validate_code:YQ,validate_email_body:QQ,validate_email_title:eee,verify_email_click_to_verify:tee,verify_email_subject:nee,verify_email_title:ree,verify_email_verify:iee,verify_your_email:oee,welcome:see,welcome_to_your_account:aee,we_sent_a_code_to:cee,yes_continue:lee,yes_continue_with:uee,yes_continue_with_existing_account:dee},fee=({...t})=>g("svg",{width:"45",height:"45",viewBox:"0 0 45 45",xmlns:"http://www.w3.org/2000/svg",...t,children:[g("path",{d:"M44.1035 23.0123C44.1054 21.4791 43.9758 19.9486 43.716 18.4375H22.498V27.1028H34.6507C34.4021 28.4868 33.8757 29.8061 33.1034 30.9812C32.3311 32.1562 31.3289 33.1628 30.1571 33.9401V39.5649H37.41C41.6567 35.6494 44.1035 29.859 44.1035 23.0123Z",fill:"#4285F4"}),g("path",{d:"M22.4982 44.9997C28.5698 44.9997 33.6821 43.0061 37.4101 39.5687L30.1573 33.9439C28.1386 35.3126 25.5387 36.0938 22.4982 36.0938C16.6296 36.0938 11.6485 32.1377 9.86736 26.8066H2.39575V32.6033C4.26839 36.3297 7.13989 39.4622 10.6896 41.6512C14.2394 43.8402 18.3277 44.9995 22.4982 44.9997Z",fill:"#34A853"}),g("path",{d:"M9.86737 26.8073C8.92572 24.0138 8.92572 20.9886 9.86737 18.1951V12.3984H2.39576C0.820432 15.5332 0 18.9929 0 22.5012C0 26.0095 0.820432 29.4692 2.39576 32.604L9.86737 26.8073Z",fill:"#FBBC04"}),g("path",{d:"M22.4982 8.90741C25.7068 8.85499 28.8071 10.0673 31.1291 12.2823L37.5507 5.86064C33.4788 2.03602 28.0843 -0.0637686 22.4982 0.00147616C18.3277 0.00166623 14.2394 1.16098 10.6896 3.34999C7.13989 5.539 4.26839 8.67155 2.39575 12.3979L9.86736 18.1946C11.6485 12.8635 16.6296 8.90741 22.4982 8.90741Z",fill:"#EA4335"})]}),hee=t=>{const{theme:e,branding:n,client:r,authParams:i}=t,a=`/authorize?${new URLSearchParams({...i})}`;return g(qe,{theme:e,branding:n,client:r,title:E.t("user_not_found"),children:g("div",{className:"flex flex-1 flex-col justify-center",children:[g("p",{className:"mb-8 text-gray-300 text-lg",children:E.t("user_not_found_body")}),g(Me,{Component:"a",href:a,children:E.t("user_not_found_cta")})]})})},gee=({...t})=>g("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 48 48",enableBackground:"new 0 0 48 48",width:"45",height:"45",...t,children:[g("path",{fill:"#FF5B24",d:"M3.5,8h41c1.9,0,3.5,1.6,3.5,3.5v25c0,1.9-1.6,3.5-3.5,3.5h-41C1.6,40,0,38.4,0,36.5v-25C0,9.6,1.6,8,3.5,8z"}),g("path",{fillRule:"evenodd",clipRule:"evenodd",fill:"#FFFFFF",d:`M27.9,20.3c1.4,0,2.6-1,2.6-2.5h0c0-1.5-1.2-2.5-2.6-2.5c-1.4,0-2.6,1-2.6,2.5C25.3,19.2,26.5,20.3,27.9,20.3z
|
|
374
|
+
M31.2,24.4c-1.7,2.2-3.5,3.8-6.7,3.8h0c-3.2,0-5.8-2-7.7-4.8c-0.8-1.2-2-1.4-2.9-0.8c-0.8,0.6-1,1.8-0.3,2.9
|
|
375
|
+
c2.7,4.1,6.5,6.6,10.9,6.6c4,0,7.2-2,9.6-5.2c0.9-1.2,0.9-2.5,0-3.1C33.3,22.9,32.1,23.2,31.2,24.4z`})]});function mee(t,e){const{mainTenantId:n,mainClientId:r}=e;return{...t,legacyClients:{get:async i=>{const s=await t.legacyClients.get(i);if(!s)return null;const a=r?await t.legacyClients.get(r):void 0,c=await t.connections.list(s.tenant.id),l=n?await t.connections.list(n):{connections:[]},u=c.connections.map(f=>{const p=l.connections?.find(m=>m.name===f.name);if(!p?.options)return f;const h=Ot.parse({...p||{},...f});return h.options=Si.parse({...p.options||{},...f.options}),h}).filter(f=>f),d={...a?.tenant||{},...s.tenant};return!s.tenant.audience&&a?.tenant?.audience&&(d.audience=a.tenant.audience),{...s,web_origins:[...a?.web_origins||[],...s.web_origins||[]],allowed_logout_urls:[...a?.allowed_logout_urls||[],...s.allowed_logout_urls||[]],callbacks:[...a?.callbacks||[],...s.callbacks||[]],connections:u,tenant:d}}},connections:{...t.connections,get:async(i,s)=>{const a=await t.connections.get(i,s);if(!a||!n)return a;const c=await t.connections.get(n,s);if(!c)return a;const l=Ot.parse({...c,...a});return l.options=Si.parse({...c.options||{},...a.options}),l},list:async(i,s)=>{const a=await t.connections.list(i,s);if(!n||i===n)return a;const c=await t.connections.list(n),l=a.connections.map(u=>{const d=c.connections?.find(p=>p.name===u.name);if(!d?.options)return u;const f=Ot.parse({...d,...u});return f.options=Si.parse({...d.options||{},...u.options}),f});return{...a,connections:l}}}}}function _ee(t,e){return mee(t,e)}const Do=[{description:"Read Client Grants",value:"read:client_grants"},{description:"Create Client Grants",value:"create:client_grants"},{description:"Delete Client Grants",value:"delete:client_grants"},{description:"Update Client Grants",value:"update:client_grants"},{description:"Read Users",value:"read:users"},{description:"Update Users",value:"update:users"},{description:"Delete Users",value:"delete:users"},{description:"Create Users",value:"create:users"},{description:"Read Users App Metadata",value:"read:users_app_metadata"},{description:"Update Users App Metadata",value:"update:users_app_metadata"},{description:"Delete Users App Metadata",value:"delete:users_app_metadata"},{description:"Create Users App Metadata",value:"create:users_app_metadata"},{description:"Read Custom User Blocks",value:"read:user_custom_blocks"},{description:"Create Custom User Blocks",value:"create:user_custom_blocks"},{description:"Delete Custom User Blocks",value:"delete:user_custom_blocks"},{description:"Create User Tickets",value:"create:user_tickets"},{description:"Read Clients",value:"read:clients"},{description:"Update Clients",value:"update:clients"},{description:"Delete Clients",value:"delete:clients"},{description:"Create Clients",value:"create:clients"},{description:"Read Client Keys",value:"read:client_keys"},{description:"Update Client Keys",value:"update:client_keys"},{description:"Delete Client Keys",value:"delete:client_keys"},{description:"Create Client Keys",value:"create:client_keys"},{description:"Read Client Credentials",value:"read:client_credentials"},{description:"Update Client Credentials",value:"update:client_credentials"},{description:"Delete Client Credentials",value:"delete:client_credentials"},{description:"Create Client Credentials",value:"create:client_credentials"},{description:"Read Connections",value:"read:connections"},{description:"Update Connections",value:"update:connections"},{description:"Delete Connections",value:"delete:connections"},{description:"Create Connections",value:"create:connections"},{description:"Read Resource Servers",value:"read:resource_servers"},{description:"Update Resource Servers",value:"update:resource_servers"},{description:"Delete Resource Servers",value:"delete:resource_servers"},{description:"Create Resource Servers",value:"create:resource_servers"},{description:"Read Device Credentials",value:"read:device_credentials"},{description:"Update Device Credentials",value:"update:device_credentials"},{description:"Delete Device Credentials",value:"delete:device_credentials"},{description:"Create Device Credentials",value:"create:device_credentials"},{description:"Read Rules",value:"read:rules"},{description:"Update Rules",value:"update:rules"},{description:"Delete Rules",value:"delete:rules"},{description:"Create Rules",value:"create:rules"},{description:"Read Rules Configs",value:"read:rules_configs"},{description:"Update Rules Configs",value:"update:rules_configs"},{description:"Delete Rules Configs",value:"delete:rules_configs"},{description:"Read Hooks",value:"read:hooks"},{description:"Update Hooks",value:"update:hooks"},{description:"Delete Hooks",value:"delete:hooks"},{description:"Create Hooks",value:"create:hooks"},{description:"Read Actions",value:"read:actions"},{description:"Update Actions",value:"update:actions"},{description:"Delete Actions",value:"delete:actions"},{description:"Create Actions",value:"create:actions"},{description:"Read Email Provider",value:"read:email_provider"},{description:"Update Email Provider",value:"update:email_provider"},{description:"Delete Email Provider",value:"delete:email_provider"},{description:"Create Email Provider",value:"create:email_provider"},{description:"Blacklist Tokens",value:"blacklist:tokens"},{description:"Read Stats",value:"read:stats"},{description:"Read Insights",value:"read:insights"},{description:"Read Tenant Settings",value:"read:tenant_settings"},{description:"Update Tenant Settings",value:"update:tenant_settings"},{description:"Read Logs",value:"read:logs"},{description:"Read logs relating to users",value:"read:logs_users"},{description:"Read Shields",value:"read:shields"},{description:"Create Shields",value:"create:shields"},{description:"Update Shields",value:"update:shields"},{description:"Delete Shields",value:"delete:shields"},{description:"Read Anomaly Detection Blocks",value:"read:anomaly_blocks"},{description:"Delete Anomaly Detection Blocks",value:"delete:anomaly_blocks"},{description:"Update Triggers",value:"update:triggers"},{description:"Read Triggers",value:"read:triggers"},{description:"Read User Grants",value:"read:grants"},{description:"Delete User Grants",value:"delete:grants"},{description:"Read Guardian factors configuration",value:"read:guardian_factors"},{description:"Update Guardian factors",value:"update:guardian_factors"},{description:"Read Guardian enrollments",value:"read:guardian_enrollments"},{description:"Delete Guardian enrollments",value:"delete:guardian_enrollments"},{description:"Create enrollment tickets for Guardian",value:"create:guardian_enrollment_tickets"},{description:"Read Users IDP tokens",value:"read:user_idp_tokens"},{description:"Create password checking jobs",value:"create:passwords_checking_job"},{description:"Deletes password checking job and all its resources",value:"delete:passwords_checking_job"},{description:"Read custom domains configurations",value:"read:custom_domains"},{description:"Delete custom domains configurations",value:"delete:custom_domains"},{description:"Configure new custom domains",value:"create:custom_domains"},{description:"Update custom domain configurations",value:"update:custom_domains"},{description:"Read email templates",value:"read:email_templates"},{description:"Create email templates",value:"create:email_templates"},{description:"Update email templates",value:"update:email_templates"},{description:"Read Multifactor Authentication policies",value:"read:mfa_policies"},{description:"Update Multifactor Authentication policies",value:"update:mfa_policies"},{description:"Read roles",value:"read:roles"},{description:"Create roles",value:"create:roles"},{description:"Delete roles",value:"delete:roles"},{description:"Update roles",value:"update:roles"},{description:"Read prompts settings",value:"read:prompts"},{description:"Update prompts settings",value:"update:prompts"},{description:"Read branding settings",value:"read:branding"},{description:"Update branding settings",value:"update:branding"},{description:"Delete branding settings",value:"delete:branding"},{description:"Read log_streams",value:"read:log_streams"},{description:"Create log_streams",value:"create:log_streams"},{description:"Delete log_streams",value:"delete:log_streams"},{description:"Update log_streams",value:"update:log_streams"},{description:"Create signing keys",value:"create:signing_keys"},{description:"Read signing keys",value:"read:signing_keys"},{description:"Update signing keys",value:"update:signing_keys"},{description:"Read entity limits",value:"read:limits"},{description:"Update entity limits",value:"update:limits"},{description:"Create role members",value:"create:role_members"},{description:"Read role members",value:"read:role_members"},{description:"Update role members",value:"delete:role_members"},{description:"Read entitlements",value:"read:entitlements"},{description:"Read attack protection",value:"read:attack_protection"},{description:"Update attack protection",value:"update:attack_protection"},{description:"Read organization summary",value:"read:organizations_summary"},{description:"Create Authentication Methods",value:"create:authentication_methods"},{description:"Read Authentication Methods",value:"read:authentication_methods"},{description:"Update Authentication Methods",value:"update:authentication_methods"},{description:"Delete Authentication Methods",value:"delete:authentication_methods"},{description:"Read Organizations",value:"read:organizations"},{description:"Update Organizations",value:"update:organizations"},{description:"Create Organizations",value:"create:organizations"},{description:"Delete Organizations",value:"delete:organizations"},{description:"Administer Organizations",value:"admin:organizations"},{description:"Read Organization Discovery Domains",value:"read:organization_discovery_domains"},{description:"Update Organization Discovery Domains",value:"update:organization_discovery_domains"},{description:"Create Organization Discovery Domains",value:"create:organization_discovery_domains"},{description:"Delete Organization Discovery Domains",value:"delete:organization_discovery_domains"},{description:"Create organization members",value:"create:organization_members"},{description:"Read organization members",value:"read:organization_members"},{description:"Delete organization members",value:"delete:organization_members"},{description:"Create organization connections",value:"create:organization_connections"},{description:"Read organization connections",value:"read:organization_connections"},{description:"Update organization connections",value:"update:organization_connections"},{description:"Delete organization connections",value:"delete:organization_connections"},{description:"Create organization member roles",value:"create:organization_member_roles"},{description:"Read organization member roles",value:"read:organization_member_roles"},{description:"Delete organization member roles",value:"delete:organization_member_roles"},{description:"Create organization invitations",value:"create:organization_invitations"},{description:"Read organization invitations",value:"read:organization_invitations"},{description:"Delete organization invitations",value:"delete:organization_invitations"},{description:"Read SCIM configuration",value:"read:scim_config"},{description:"Create SCIM configuration",value:"create:scim_config"},{description:"Update SCIM configuration",value:"update:scim_config"},{description:"Delete SCIM configuration",value:"delete:scim_config"},{description:"Create SCIM token",value:"create:scim_token"},{description:"Read SCIM token",value:"read:scim_token"},{description:"Delete SCIM token",value:"delete:scim_token"},{description:"Delete a Phone Notification Provider",value:"delete:phone_providers"},{description:"Create a Phone Notification Provider",value:"create:phone_providers"},{description:"Read a Phone Notification Provider",value:"read:phone_providers"},{description:"Update a Phone Notification Provider",value:"update:phone_providers"},{description:"Delete a Phone Notification Template",value:"delete:phone_templates"},{description:"Create a Phone Notification Template",value:"create:phone_templates"},{description:"Read a Phone Notification Template",value:"read:phone_templates"},{description:"Update a Phone Notification Template",value:"update:phone_templates"},{description:"Create encryption keys",value:"create:encryption_keys"},{description:"Read encryption keys",value:"read:encryption_keys"},{description:"Update encryption keys",value:"update:encryption_keys"},{description:"Delete encryption keys",value:"delete:encryption_keys"},{description:"Read Sessions",value:"read:sessions"},{description:"Update Sessions",value:"update:sessions"},{description:"Delete Sessions",value:"delete:sessions"},{description:"Read Refresh Tokens",value:"read:refresh_tokens"},{description:"Update Refresh Tokens",value:"update:refresh_tokens"},{description:"Delete Refresh Tokens",value:"delete:refresh_tokens"},{description:"Create Self Service Profiles",value:"create:self_service_profiles"},{description:"Read Self Service Profiles",value:"read:self_service_profiles"},{description:"Update Self Service Profiles",value:"update:self_service_profiles"},{description:"Delete Self Service Profiles",value:"delete:self_service_profiles"},{description:"Create SSO Access Tickets",value:"create:sso_access_tickets"},{description:"Delete SSO Access Tickets",value:"delete:sso_access_tickets"},{description:"Read Forms",value:"read:forms"},{description:"Update Forms",value:"update:forms"},{description:"Delete Forms",value:"delete:forms"},{description:"Create Forms",value:"create:forms"},{description:"Read Flows",value:"read:flows"},{description:"Update Flows",value:"update:flows"},{description:"Delete Flows",value:"delete:flows"},{description:"Create Flows",value:"create:flows"},{description:"Read Flows Vault items",value:"read:flows_vault"},{description:"Read Flows Vault connections",value:"read:flows_vault_connections"},{description:"Update Flows Vault connections",value:"update:flows_vault_connections"},{description:"Delete Flows Vault connections",value:"delete:flows_vault_connections"},{description:"Create Flows Vault connections",value:"create:flows_vault_connections"},{description:"Read Flows Executions",value:"read:flows_executions"},{description:"Delete Flows Executions",value:"delete:flows_executions"},{description:"Read Connections Options",value:"read:connections_options"},{description:"Update Connections Options",value:"update:connections_options"},{description:"Read Self Service Profile Custom Texts",value:"read:self_service_profile_custom_texts"},{description:"Update Self Service Profile Custom Texts",value:"update:self_service_profile_custom_texts"},{description:"Create Network ACLs",value:"create:network_acls"},{description:"Update Network ACLs",value:"update:network_acls"},{description:"Read Network ACLs",value:"read:network_acls"},{description:"Delete Network ACLs",value:"delete:network_acls"},{description:"Delete Verifiable Digital Credential Templates",value:"delete:vdcs_templates"},{description:"Read Verifiable Digital Credential Templates",value:"read:vdcs_templates"},{description:"Create Verifiable Digital Credential Templates",value:"create:vdcs_templates"},{description:"Update Verifiable Digital Credential Templates",value:"update:vdcs_templates"},{description:"Create Customer Provided Public Signing Keys",value:"create:custom_signing_keys"},{description:"Read Customer Provided Public Signing Keys",value:"read:custom_signing_keys"},{description:"Update Customer Provided Public Signing Keys",value:"update:custom_signing_keys"},{description:"Delete Customer Provided Public Signing Keys",value:"delete:custom_signing_keys"},{description:"List Federated Connections Tokensets belonging to a user",value:"read:federated_connections_tokens"},{description:"Delete Federated Connections Tokensets belonging to a user",value:"delete:federated_connections_tokens"},{description:"Create User Attribute Profiles",value:"create:user_attribute_profiles"},{description:"Read User Attribute Profiles",value:"read:user_attribute_profiles"},{description:"Update User Attribute Profiles",value:"update:user_attribute_profiles"},{description:"Delete User Attribute Profiles",value:"delete:user_attribute_profiles"},{description:"Read event streams",value:"read:event_streams"},{description:"Create event streams",value:"create:event_streams"},{description:"Delete event streams",value:"delete:event_streams"},{description:"Update event streams",value:"update:event_streams"},{description:"Read event stream deliveries",value:"read:event_deliveries"},{description:"Redeliver event(s) to an event stream",value:"update:event_deliveries"},{description:"Create Connection Profiles",value:"create:connection_profiles"},{description:"Read Connection Profiles",value:"read:connection_profiles"},{description:"Update Connection Profiles",value:"update:connection_profiles"},{description:"Delete Connection Profiles",value:"delete:connection_profiles"},{description:"Read Organization Client Grants",value:"read:organization_client_grants"},{description:"Create Organization Client Grants",value:"create:organization_client_grants"},{description:"Delete Organization Client Grants",value:"delete:organization_client_grants"},{description:"Create Token Exchange Profile",value:"create:token_exchange_profiles"},{description:"Read Token Exchange Profiles",value:"read:token_exchange_profiles"},{description:"Update Token Exchange Profile",value:"update:token_exchange_profiles"},{description:"Delete Token Exchange Profile",value:"delete:token_exchange_profiles"},{description:"Read connection keys",value:"read:connections_keys"},{description:"Update connection keys",value:"update:connections_keys"},{description:"Create connection keys",value:"create:connections_keys"},{description:"Read Tenants",value:"read:tenants"},{description:"Create Tenants",value:"create:tenants"},{description:"Update Tenants",value:"update:tenants"},{description:"Delete Tenants",value:"delete:tenants"},{description:"Read access to authentication resources",value:"auth:read"},{description:"Write access to authentication resources",value:"auth:write"}];async function yee(t,e){const{adminEmail:n,adminPassword:r,tenantId:i="control_plane",tenantName:s="Control Plane",isControlPlane:a=!0,clientId:c="default",callbacks:l=["https://manage.authhero.net/auth-callback","https://local.authhero.net/auth-callback","http://localhost:5173/auth-callback","https://localhost:3000/auth-callback"],allowedLogoutUrls:u=["https://manage.authhero.net","https://local.authhero.net","http://localhost:5173","https://localhost:3000"],debug:d=!0}=e,f=e.audience||(a?"urn:authhero:management":`urn:authhero:tenant:${i}`);await t.tenants.get(i)?d&&console.log(`Tenant "${i}" already exists, skipping...`):(d&&console.log(`Creating tenant "${i}"...`),await t.tenants.create({id:i,friendly_name:s,audience:f,sender_email:"noreply@example.com",sender_name:"AuthHero"}),a&&await t.tenants.update(i,{allow_organization_name_in_authentication_api:!0}),d&&console.log("✅ Tenant created"));const{signingKeys:h}=await t.keys.list({q:"type:jwt_signing"});if(h.length===0){d&&console.log("Creating signing key...");const se=await Uc({name:`CN=${i}`});await t.keys.create(se),d&&console.log("✅ Signing key created")}else d&&console.log("Signing key already exists, skipping...");const m=await t.users.list(i,{q:`email:${n}`});let y;if(m.users.length===0){d&&console.log(`Creating admin user "${n}"...`),y=`auth2|${$s()}`,await t.users.create(i,{user_id:y,email:n,email_verified:!0,connection:"Username-Password-Authentication",provider:"auth2"});const se=await ar.hash(r,10);await t.passwords.create(i,{user_id:y,password:se,algorithm:"bcrypt",is_current:!0}),d&&(console.log("✅ Admin user created"),console.log(` Email: ${n}`))}else y=m.users[0].user_id,d&&console.log(`Admin user "${n}" already exists, skipping...`);(await t.connections.list(i)).connections.some(se=>se.name==="Username-Password-Authentication")?d&&console.log("Password connection already exists, skipping..."):(d&&console.log("Creating password connection..."),await t.connections.create(i,{name:"Username-Password-Authentication",strategy:"Username-Password-Authentication",options:{}}),d&&console.log("✅ Password connection created"));const k=await t.clients.get(i,c);let v;k?(v=k.client_secret||"",d&&console.log("Default client already exists, skipping...")):(d&&console.log("Creating default client..."),v=je(),await t.clients.create(i,{client_id:c,client_secret:v,name:"Default Application",callbacks:l,allowed_logout_urls:u,connections:["Username-Password-Authentication"]}),d&&(console.log("✅ Default client created"),console.log(` Client ID: ${c}`),console.log(` Callback URLs: ${l.join(", ")}`),console.log(` Allowed Logout URLs: ${u.join(", ")}`)));const $=f;(await t.resourceServers.list(i,{})).resource_servers.some(se=>se.identifier===$)?d&&console.log("Management API resource server already exists, skipping..."):(d&&console.log("Creating Management API resource server..."),await t.resourceServers.create(i,{name:"Authhero Management API",identifier:$,allow_offline_access:!0,skip_consent_for_verifiable_first_party_clients:!1,token_lifetime:86400,token_lifetime_for_web:7200,signing_alg:"RS256",scopes:Do,options:{enforce_policies:!0,token_dialect:"access_token_authz"}}),d&&(console.log("✅ Management API resource server created"),console.log(` Identifier: ${$}`),console.log(` Scopes: ${Do.length} permissions`)));const{organizations:A}=await t.organizations.list(i,{q:`name:${i}`});let N=A[0];N?d&&console.log(`Organization "${i}" already exists, skipping...`):(d&&console.log(`Creating organization "${i}"...`),N=await t.organizations.create(i,{id:`org_${je()}`,name:i,display_name:s}),d&&console.log("✅ Organization created"));const O="Tenant Admin";let C=(await t.roles.list(i,{})).roles.find(se=>se.name===O);if(C)d&&console.log(`Admin role "${O}" already exists, skipping...`);else{d&&console.log(`Creating admin role "${O}"...`),C=await t.roles.create(i,{name:O,description:"Full access to tenant management operations"});const se=Do.map(ve=>({role_id:C.id,resource_server_identifier:f,permission_name:ve.value}));await t.rolePermissions.assign(i,C.id,se),d&&console.log(`✅ Admin role created with ${Do.length} permissions`)}return(await t.userOrganizations.listUserOrganizations(i,y,{})).organizations.some(se=>se.id===N.id)?d&&console.log("Admin user already in organization, skipping..."):(d&&console.log(`Adding admin user to organization "${N.name}"...`),await t.userOrganizations.create(i,{user_id:y,organization_id:N.id}),d&&console.log("✅ Admin user added to organization")),(await t.userRoles.list(i,y,void 0,N.id)).some(se=>se.id===C.id)?d&&console.log("Admin user already has admin role, skipping..."):(d&&console.log(`Assigning admin role to user in organization "${N.name}"...`),await t.userRoles.create(i,y,C.id,N.id),d&&console.log("✅ Admin role assigned to user")),(await t.userRoles.list(i,y,void 0,"")).some(se=>se.id===C.id)?d&&console.log("Admin user already has global admin role, skipping..."):(d&&console.log("Assigning global admin role to user..."),await t.userRoles.create(i,y,C.id,""),d&&console.log("✅ Global admin role assigned to user")),d&&console.log(`
|
|
376
|
+
🎉 Seeding complete!`),{tenantId:i,userId:y,email:n,clientId:c,clientSecret:v}}async function bee(t,e,n={}){const{cursorField:r="id",sortOrder:i="asc",pageSize:s=100,maxItems:a=1e4,q:c}=n,l=[];let u,d=!0;for(;d;){let f=c||"";if(u){const w=`${r}:${i==="asc"?">":"<"}${u}`;f=f?`(${f}) AND ${w}`:w}const p={per_page:s,page:0,sort:{sort_by:r,sort_order:i},...f&&{q:f}},m=(await t(p))[e]||[];if(m.length===0)d=!1;else{l.push(...m);const y=m[m.length-1];if(y&&typeof y=="object"){const w=y[r];w!=null&&(u=String(w))}m.length<s&&(d=!1),a!==-1&&l.length>=a&&(console.warn(`fetchAll: Reached maxItems limit (${a}). There may be more items.`),d=!1)}}return l}E.init({supportedLngs:["en","it","nb","sv","pl","cs","fi","da"],fallbackLng:"en",resources:{en:{translation:Bj},it:{translation:qP},nb:{translation:KB},sv:{translation:XM},pl:{translation:eV},cs:{translation:iW},fi:{translation:cZ},da:{translation:pee}}});function wee(t){const e=new o.OpenAPIHono;e.onError((a,c)=>a instanceof I?a.getResponse():(console.error(a),c.json({message:"Internal Server Error"},500))),e.use("*",async(a,c)=>{t.hooks&&(a.env.hooks={...t.hooks,...a.env.hooks||{}}),t.samlSigner&&(a.env.samlSigner=t.samlSigner),await c()}),e.get("/",a=>a.json({name:"authhero"}));const n=m9(t);e.route("/api/v2",n);const r=iE(t);e.route("/u",r);const i=OC(t);e.route("/samlp",i);const s=cz(t);return e.route("/",s),{app:e,managementApp:n,oauthApp:s,samlApp:i,universalApp:r,createX509Certificate:Uc}}exports.AppLogo=ln;exports.Auth0ActionEnum=k3;exports.Auth0Client=Ny;exports.AuthLayout=Le;exports.AuthorizationResponseMode=_n;exports.AuthorizationResponseType=Rt;exports.Button=Me;exports.ButtonUI=wn;exports.CardContent=Cn;exports.CardDescription=En;exports.CardFooter=uv;exports.CardHeader=zn;exports.CardTitle=An;exports.CardUI=Sn;exports.CheckEmailPage=Sv;exports.CodeChallengeMethod=Wc;exports.ComponentCategory=y0;exports.ComponentType=_0;exports.EmailActionEnum=$3;exports.EmailValidatedPage=Ev;exports.EnterCodePage=c0;exports.EnterPasswordPage=Pa;exports.ErrorMessage=tt;exports.FlowActionTypeEnum=x3;exports.Footer=dv;exports.ForgotPasswordPage=kv;exports.ForgotPasswordSentPage=$v;exports.FormComponent=un;exports.GoBack=Ct;exports.GoogleLogo=fee;exports.GrantType=Xt;exports.HttpSamlSigner=Sb;exports.Icon=Ge;exports.IdentifierForm=Ia;exports.IdentifierPage=ja;exports.InputUI=on;exports.InvalidSession=Av;exports.LabelUI=Lt;exports.Layout=qe;exports.LocationInfo=Iy;exports.LogTypes=ge;exports.MANAGEMENT_API_AUDIENCE=Kw;exports.MANAGEMENT_API_SCOPES=Do;exports.Message=Dt;exports.NodeType=sy;exports.PreSignUpConfirmationPage=Cv;exports.PreSignUpPage=zv;exports.RedirectTargetEnum=J1;exports.ResetPasswordPage=wi;exports.SignUpPage=Sr;exports.SocialButton=fv;exports.Spinner=pv;exports.Trans=fr;exports.UnverifiedEmailPage=xv;exports.UserNotFoundPage=hee;exports.VippsLogo=gee;exports.actionNodeSchema=ly;exports.activeUsersResponseSchema=N4;exports.addEntityHooks=Ww;exports.auth0FlowInsertSchema=N3;exports.auth0FlowSchema=hy;exports.auth0QuerySchema=S3;exports.auth0UpdateUserActionSchema=G1;exports.auth0UserResponseSchema=hn;exports.authParamsSchema=Yo;exports.baseUserSchema=Kc;exports.blockComponentSchema=yy;exports.bordersSchema=Ry;exports.brandingSchema=Sd;exports.buttonComponentSchema=ty;exports.clientGrantInsertSchema=Ha;exports.clientGrantListSchema=C3;exports.clientGrantSchema=Er;exports.clientInfoMiddleware=Js;exports.clientInsertSchema=Fa;exports.clientSchema=Ar;exports.codeInsertSchema=my;exports.codeSchema=j3;exports.codeTypeSchema=gy;exports.colorsSchema=Ly;exports.componentMessageSchema=xy;exports.componentSchema=oy;exports.connectionInsertSchema=Va;exports.connectionOptionsSchema=Si;exports.connectionSchema=Ot;exports.coordinatesSchema=ni;exports.createAuthMiddleware=Xl;exports.createInMemoryCache=Xs;exports.createPassthroughAdapter=j4;exports.createWriteOnlyAdapter=T4;exports.customDomainInsertSchema=w0;exports.customDomainSchema=Qn;exports.customDomainWithTenantIdSchema=T3;exports.dailyStatsSchema=rb;exports.emailProviderSchema=xa;exports.emailVerificationRulesSchema=K1;exports.emailVerifyActionSchema=W1;exports.endingSchema=fy;exports.extractTenantIdFromAudience=Gw;exports.fetchAll=bee;exports.fieldComponentSchema=wy;exports.flowActionStepSchema=Z1;exports.flowInsertSchema=Ma;exports.flowSchema=vi;exports.flowsFieldComponentSchema=ry;exports.flowsFlowNodeSchema=cy;exports.flowsStepNodeSchema=ay;exports.fontDetailsSchema=$r;exports.fontsSchema=By;exports.formControlSchema=a4;exports.formInsertSchema=Ga;exports.formNodeComponentDefinition=k0;exports.formNodeSchema=vy;exports.formSchema=xi;exports.genericComponentSchema=iy;exports.genericNodeSchema=uy;exports.getTenantAudience=P$;exports.hookInsertSchema=ba;exports.hookSchema=ki;exports.identitySchema=Q1;exports.init=wee;exports.injectTailwindCSS=mA;exports.inviteInsertSchema=$0;exports.inviteSchema=qo;exports.inviteeSchema=Ay;exports.inviterSchema=zy;exports.isBlockComponent=p4;exports.isFieldComponent=h4;exports.isWidgetComponent=f4;exports.jwksKeySchema=Ey;exports.jwksSchema=S0;exports.legacyClientSchema=I3;exports.legalComponentSchema=ny;exports.logInsertSchema=jy;exports.logSchema=Wa;exports.loginSessionInsertSchema=Cy;exports.loginSessionSchema=b4;exports.nodeSchema=dy;exports.openIDConfigurationSchema=zd;exports.organizationBrandingSchema=Qy;exports.organizationEnabledConnectionSchema=eb;exports.organizationInsertSchema=Ya;exports.organizationSchema=er;exports.organizationTokenQuotaSchema=tb;exports.pageBackgroundSchema=Dy;exports.parseUserId=I4;exports.passwordInsertSchema=Ty;exports.passwordSchema=v4;exports.profileDataSchema=Y1;exports.promptSettingSchema=va;exports.redirectActionSchema=X1;exports.refreshTokenInsertSchema=A0;exports.refreshTokenSchema=x4;exports.resourceServerInsertSchema=Ja;exports.resourceServerListSchema=S4;exports.resourceServerOptionsSchema=Fy;exports.resourceServerSchema=Cr;exports.resourceServerScopeSchema=qy;exports.richTextComponentSchema=ey;exports.roleInsertSchema=Xa;exports.roleListSchema=Za;exports.rolePermissionInsertSchema=Hy;exports.rolePermissionListSchema=Ky;exports.rolePermissionSchema=Vy;exports.roleSchema=Nr;exports.screenLinkSchema=ky;exports.seed=yee;exports.sessionInsertSchema=Py;exports.sessionSchema=Xc;exports.signingKeySchema=Ad;exports.smsProviderSchema=$4;exports.smsSendParamsSchema=k4;exports.startSchema=py;exports.tailwindCss=Wf;exports.tenantInsertSchema=b0;exports.tenantMiddleware=Ws;exports.tenantSchema=Ka;exports.tenantSettingsSchema=C4;exports.themeInsertSchema=My;exports.themeSchema=wa;exports.tokenResponseSchema=z0;exports.totalsSchema=xt;exports.uiScreenSchema=d4;exports.userInsertSchema=qa;exports.userOrganizationInsertSchema=nb;exports.userOrganizationSchema=E4;exports.userPermissionInsertSchema=Gy;exports.userPermissionListSchema=z4;exports.userPermissionSchema=Wy;exports.userPermissionWithDetailsListSchema=Xy;exports.userPermissionWithDetailsSchema=Jy;exports.userResponseSchema=z3;exports.userRoleInsertSchema=Zy;exports.userRoleListSchema=A4;exports.userRoleSchema=Yy;exports.userSchema=m0;exports.verificationMethodsSchema=_y;exports.waitUntil=hb;exports.widgetComponentSchema=by;exports.widgetSchema=Uy;exports.withMainTenantFallback=_ee;
|