@atlasauth/embed 0.18.1 → 0.19.1
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/CHANGELOG.md +8 -0
- package/dist/embed.js +11 -11
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/widget/email-link.d.ts +10 -0
- package/dist/widget/email-link.js +72 -0
- package/dist/widget/email-link.js.map +1 -0
- package/dist/widget/flow.js +6 -3
- package/dist/widget/flow.js.map +1 -1
- package/dist/widget/forms.js +46 -12
- package/dist/widget/forms.js.map +1 -1
- package/dist/widget/mfa.js +48 -6
- package/dist/widget/mfa.js.map +1 -1
- package/dist/widget/render.js +11 -0
- package/dist/widget/render.js.map +1 -1
- package/dist/widget.d.ts +3 -1
- package/dist/widget.js +2 -0
- package/dist/widget.js.map +1 -1
- package/package.json +2 -2
package/dist/embed.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";(()=>{var Xa=Object.create;var yn=Object.defineProperty;var el=Object.getOwnPropertyDescriptor;var tl=Object.getOwnPropertyNames;var nl=Object.getPrototypeOf,rl=Object.prototype.hasOwnProperty;var ol=(e,t,n)=>t in e?yn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var kt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var il=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of tl(t))!rl.call(e,o)&&o!==n&&yn(e,o,{get:()=>t[o],enumerable:!(r=el(t,o))||r.enumerable});return e};var sl=(e,t,n)=>(n=e!=null?Xa(nl(e)):{},il(t||!e||!e.__esModule?yn(n,"default",{value:e,enumerable:!0}):n,e));var v=(e,t,n)=>ol(e,typeof t!="symbol"?t+"":t,n);var es=kt(Re=>{"use strict";Object.defineProperty(Re,"__esModule",{value:!0});Re.ForbiddenError=void 0;Re.evaluate=hr;Re.hasFromClaims=od;Re.protectFromClaims=id;function rd(e){return e.permission!==void 0||e.role!==void 0||e.anyPermission!==void 0||e.allPermissions!==void 0}function hr(e,t={}){var o,i,s,a;if(!e)return{allowed:!1,reason:"signed_out"};if(t.plan!==void 0&&e.pla!==t.plan)return{allowed:!1,reason:"missing_entitlement"};if(t.feature!==void 0&&!((o=e.fea)!=null?o:[]).includes(t.feature))return{allowed:!1,reason:"missing_entitlement"};let n=new Set((i=e.app_permissions)!=null?i:[]);if(t.appRole!==void 0&&!((s=e.app_roles)!=null?s:[]).includes(t.appRole))return{allowed:!1,reason:"missing_permission"};if(t.appPermission!==void 0&&!n.has(t.appPermission))return{allowed:!1,reason:"missing_permission"};if(t.anyAppPermission&&!t.anyAppPermission.some(l=>n.has(l)))return{allowed:!1,reason:"missing_permission"};if(t.allAppPermissions&&!t.allAppPermissions.every(l=>n.has(l)))return{allowed:!1,reason:"missing_permission"};if(!rd(t))return{allowed:!0};if(!e.org_id)return{allowed:!1,reason:"no_organization"};let r=new Set((a=e.org_permissions)!=null?a:[]);return t.role!==void 0&&e.org_role!==t.role?{allowed:!1,reason:"missing_permission"}:t.permission!==void 0&&!r.has(t.permission)?{allowed:!1,reason:"missing_permission"}:t.anyPermission&&!t.anyPermission.some(l=>r.has(l))?{allowed:!1,reason:"missing_permission"}:t.allPermissions&&!t.allPermissions.every(l=>r.has(l))?{allowed:!1,reason:"missing_permission"}:{allowed:!0}}function od(e,t={}){return hr(e,t).allowed}var Nt=class extends Error{constructor(n,r){super(n==="signed_out"?"Not signed in.":n==="no_organization"?"No active organization for this authorization check.":n==="missing_entitlement"?"Missing the required plan or feature.":"Missing the required permission or role.");v(this,"reason");v(this,"condition");this.name="ForbiddenError",this.reason=n,this.condition=r}};Re.ForbiddenError=Nt;function id(e,t={}){let n=hr(e,t);if(!n.allowed)throw new Nt(n.reason,t)}});var ts=kt(de=>{"use strict";Object.defineProperty(de,"__esModule",{value:!0});de.PERMISSION_KEY_PATTERN=de.ROLE_KEY_PATTERN=void 0;de.isRoleKey=sd;de.isPermissionKey=ad;de.ROLE_KEY_PATTERN=/^org:[a-z][a-z0-9_]{1,31}$/;de.PERMISSION_KEY_PATTERN=/^org:[a-z][a-z0-9_]{1,31}:[a-z][a-z0-9_]{1,31}$/;function sd(e){return de.ROLE_KEY_PATTERN.test(e)}function ad(e){return de.PERMISSION_KEY_PATTERN.test(e)}});var is=kt(ge=>{"use strict";Object.defineProperty(ge,"__esModule",{value:!0});ge.FilterCompileError=void 0;ge.likeToRegExp=os;ge.evalFilter=br;ge.filterToSql=dd;ge.filterToPrisma=ud;ge.filterToDrizzle=pd;var Q=class extends Error{};ge.FilterCompileError=Q;var yr={eq:"=",ne:"<>",lt:"<",lte:"<=",gt:">",gte:">="},rs=e=>{if(e&&typeof e=="object"&&!Array.isArray(e)){let t=e;if(typeof t.type=="string"&&typeof t.id=="string"&&Object.keys(t).length===2)return`${t.type}::${t.id}`}return e};function je(e,t){let n=t.split("."),r=e[n[0]];for(let o of n.slice(1)){if(r===null||typeof r!="object"||Array.isArray(r))return;r=r[o]}return r===null?void 0:rs(r)}function Te(e,t){if("value"in e)return e.value;if("field"in e){let o=je(t,e.field);return typeof o=="string"||typeof o=="number"||typeof o=="boolean"?o:void 0}if("neg"in e){let o=Te(e.neg,t);return typeof o=="number"?-o:void 0}let n=Te(e.left,t),r=Te(e.right,t);if(!(typeof n!="number"||typeof r!="number"))return e.arith==="add"?n+r:e.arith==="sub"?n-r:n*r}function ns(e,t,n){return e==="eq"?t===n:e==="ne"?t!==n:typeof t!="number"||typeof n!="number"?!1:e==="lt"?t<n:e==="lte"?t<=n:e==="gt"?t>n:t>=n}function os(e){return new RegExp(`^${e.split("*").map(t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join(".*")}$`,"s")}function br(e,t){switch(e.op){case"true":return!0;case"false":return!1;case"and":return e.args.every(n=>br(n,t));case"or":return e.args.some(n=>br(n,t));case"eq":case"ne":case"lt":case"lte":case"gt":case"gte":{let n=Te({field:e.field},t),r="ref"in e?Te({field:e.ref},t):e.value;return n!==void 0&&r!==void 0&&ns(e.op,n,r)}case"cmp":{let n=Te(e.left,t),r=Te(e.right,t);return n!==void 0&&r!==void 0&&ns(e.cmp,n,r)}case"in":case"not_in":{let n=je(t,e.field);return n===void 0||Array.isArray(n)?!1:e.values.includes(n)===(e.op==="in")}case"contains":case"not_contains":{let n=je(t,e.field);return Array.isArray(n)?n.map(rs).includes(e.value)===(e.op==="contains"):!1}case"like":case"not_like":{let n=je(t,e.field);return typeof n=="string"&&os(e.pattern).test(n)===(e.op==="like")}case"exists":return je(t,e.field)!==void 0;case"missing":return je(t,e.field)===void 0;case"relation":case"not_relation":throw new Q("Unresolved relation condition: ask the server to resolve it (resolve_relations).")}}var ld=/^[A-Za-z_][A-Za-z0-9_$]*$/,cd=/^[A-Za-z0-9_]+$/,kr=class{constructor(t,n){v(this,"o");v(this,"d");v(this,"params",[]);v(this,"kindOf",t=>typeof t=="number"?"number":typeof t=="boolean"?"boolean":"string");this.o=t,this.d=n}quote(t){let n=t.split(".");if(n.length>2||!n.every(o=>ld.test(o)))throw new Q(`"${t}" is not a safe column name (letters, digits and underscore, optionally table.column).`);let r=this.d==="mysql"?"`":'"';return n.map(o=>`${r}${o}${r}`).join(".")}param(t){var n;return this.params.push(t),this.d==="postgres"?`$${((n=this.o.paramOffset)!=null?n:0)+this.params.length}`:"?"}spec(t){var i;let n=this.o.columns[t];if(n===void 0)throw new Q(`No column is mapped for field "${t}".`);let r=typeof n=="string"?{column:n}:n,o=this.quote(r.column);if(r.json!==void 0){let s=r.json.split(".");if(!s.every(a=>cd.test(a)))throw new Q(`"${r.json}" is not a safe JSON path.`);return{col:o,kind:r.kind==="array"||r.kind==="json"?"json":"scalar",path:s}}return{col:o,kind:(i=r.kind)!=null?i:"scalar"}}scalar(t,n){let{col:r,path:o}=this.spec(t);if(!o)return r;if(this.d==="sqlite")return`json_extract(${r}, '$.${o.join(".")}')`;if(this.d==="mysql"){let s=`JSON_UNQUOTE(JSON_EXTRACT(${r}, '$.${o.join(".")}'))`;return n==="number"?`CAST(${s} AS DECIMAL(38,10))`:s}let i=`(${r} #>> '{${o.join(",")}}')`;return n==="number"?`${i}::numeric`:n==="boolean"?`${i}::boolean`:i}setExpr(t){let{col:n,kind:r,path:o}=this.spec(t);if(o)return this.d==="postgres"?{sql:`(${n} #> '{${o.join(",")}}')`,native:!1}:this.d==="mysql"?{sql:`JSON_EXTRACT(${n}, '$.${o.join(".")}')`,native:!1}:{sql:`json_extract(${n}, '$.${o.join(".")}')`,native:!1};let i=r==="scalar"?this.d==="postgres"?"array":"json":r;return{sql:n,native:i==="array"}}term(t,n="number"){return"field"in t?this.scalar(t.field,n):"value"in t?this.param(t.value):"neg"in t?`(-${this.term(t.neg)})`:`(${this.term(t.left)} ${t.arith==="add"?"+":t.arith==="sub"?"-":"*"} ${this.term(t.right)})`}likePattern(t){return t.split("*").map(n=>n.replace(/[\\%_]/g,"\\$&")).join("%")}build(t){switch(t.op){case"true":return"(1 = 1)";case"false":return"(1 = 0)";case"and":case"or":return t.args.length===0?t.op==="and"?"(1 = 1)":"(1 = 0)":`(${t.args.map(n=>this.build(n)).join(t.op==="and"?" AND ":" OR ")})`;case"eq":case"ne":case"lt":case"lte":case"gt":case"gte":{if("ref"in t)return`(${this.scalar(t.field,"string")} ${yr[t.op]} ${this.scalar(t.ref,"string")})`;let n=this.kindOf(t.value);return`(${this.scalar(t.field,n)} ${yr[t.op]} ${this.param(t.value)})`}case"cmp":return`(${this.term(t.left)} ${yr[t.cmp]} ${this.term(t.right)})`;case"in":case"not_in":{if(t.values.length===0)return t.op==="in"?"(1 = 0)":"(1 = 1)";let n=this.kindOf(t.values[0]),r=this.scalar(t.field,n);if(this.d==="postgres"&&t.values.every(i=>typeof i=="string"))return t.op==="in"?`(${r} = ANY(${this.param(t.values)}))`:`(${r} <> ALL(${this.param(t.values)}))`;let o=t.values.map(i=>this.param(i)).join(", ");return`(${r} ${t.op==="in"?"IN":"NOT IN"} (${o}))`}case"contains":case"not_contains":{let n=t.op==="not_contains",{sql:r,native:o}=this.setExpr(t.field),i;return this.d==="postgres"?i=o?`${this.param(t.value)} = ANY(${r})`:`${r} @> ${this.param(JSON.stringify([t.value]))}::jsonb`:this.d==="mysql"?i=`JSON_CONTAINS(${r}, ${this.param(JSON.stringify(t.value))})`:i=`EXISTS (SELECT 1 FROM json_each(${r}) WHERE value = ${this.param(t.value)})`,n?`(${this.d==="sqlite"?`${r} IS NOT NULL AND `:""}NOT ${i})`:`(${i})`}case"like":case"not_like":{let n=this.scalar(t.field,"string"),r=t.op==="not_like"?"NOT ":"";if(this.d==="sqlite")return`(${n} ${r}GLOB ${this.param(t.pattern.replace(/[?[]/g,"[$&]"))})`;let o=this.param(this.likePattern(t.pattern));return this.d==="mysql"?`(${n} ${r}LIKE BINARY ${o} ESCAPE '\\\\')`:`(${n} ${r}LIKE ${o} ESCAPE '\\')`}case"exists":case"missing":{let{col:n,path:r}=this.spec(t.field);return`(${r?this.scalar(t.field,"string"):n} IS ${t.op==="exists"?"NOT ":""}NULL)`}case"relation":case"not_relation":throw new Q("Relation conditions must be resolved first: pass resolve_relations to partial_evaluate.")}}};function dd(e,t){var o;let n=new kr(t,(o=t.dialect)!=null?o:"postgres");return{text:n.build(e),params:n.params}}var ie=(e,t)=>e.split(".").reduceRight((n,r)=>({[r]:n}),t);function ud(e,t){let n=o=>{let i=t.fields[o];if(i===void 0)throw new Q(`No Prisma field is mapped for "${o}".`);return i},r=o=>{switch(o.op){case"true":return{};case"false":return{OR:[]};case"and":return{AND:o.args.map(r)};case"or":return{OR:o.args.map(r)};case"eq":case"ne":case"lt":case"lte":case"gt":case"gte":{if("ref"in o)throw new Q("Comparing two fields has no Prisma form; use filterToSql.");let i=o.op==="eq"?{equals:o.value}:o.op==="ne"?{not:o.value}:{[o.op]:o.value};return ie(n(o.field),i)}case"cmp":throw new Q("Arithmetic has no Prisma form; use filterToSql.");case"in":return ie(n(o.field),{in:o.values});case"not_in":return{AND:[ie(n(o.field),{notIn:o.values}),ie(n(o.field),{not:null})]};case"contains":return ie(n(o.field),{has:o.value});case"not_contains":return{AND:[{NOT:ie(n(o.field),{has:o.value})},ie(n(o.field),{not:null})]};case"exists":return ie(n(o.field),{not:null});case"missing":return ie(n(o.field),{equals:null});case"like":case"not_like":{let i=/^(\*?)([^*]*)(\*?)$/.exec(o.pattern);if(!i)throw new Q(`Pattern "${o.pattern}" has no Prisma form (only x, x*, *x and *x*); use filterToSql.`);let[,s,a,l]=i,c=s&&l?{contains:a}:s?{endsWith:a}:l?{startsWith:a}:{equals:a},d=ie(n(o.field),c);return o.op==="like"?d:{AND:[{NOT:d},ie(n(o.field),{not:null})]}}case"relation":case"not_relation":throw new Q("Relation conditions must be resolved first: pass resolve_relations to partial_evaluate.")}};return r(e)}function pd(e,t){let{ops:n,columns:r}=t,{sql:o}=n,i=c=>{if(!(c in r))throw new Q(`No Drizzle column is mapped for "${c}".`);return r[c]},s=c=>{if("field"in c)return i(c.field);if("value"in c)return o`${c.value}`;if("neg"in c)return o`(-${s(c.neg)})`;let[d,u]=[s(c.left),s(c.right)];return c.arith==="add"?o`(${d} + ${u})`:c.arith==="sub"?o`(${d} - ${u})`:o`(${d} * ${u})`},a=c=>c.split("*").map(d=>d.replace(/[\\%_]/g,"\\$&")).join("%"),l=c=>{var d;switch(c.op){case"true":return o`(1 = 1)`;case"false":return o`(1 = 0)`;case"and":return c.args.length?n.and(...c.args.map(l)):o`(1 = 1)`;case"or":return c.args.length?n.or(...c.args.map(l)):o`(1 = 0)`;case"eq":case"ne":case"lt":case"lte":case"gt":case"gte":return n[c.op](i(c.field),"ref"in c?i(c.ref):c.value);case"cmp":{let[u,p]=[s(c.left),s(c.right)];switch(c.cmp){case"eq":return o`${u} = ${p}`;case"ne":return o`${u} <> ${p}`;case"lt":return o`${u} < ${p}`;case"lte":return o`${u} <= ${p}`;case"gt":return o`${u} > ${p}`;case"gte":return o`${u} >= ${p}`}}case"in":return c.values.length?n.inArray(i(c.field),c.values):o`(1 = 0)`;case"not_in":return c.values.length?n.and(n.notInArray(i(c.field),c.values),n.isNotNull(i(c.field))):o`(1 = 1)`;case"contains":case"not_contains":{let u=i(c.field),p=(d=t.arrayFields)!=null&&d.includes(c.field)?o`${c.value} = ANY(${u})`:o`${u} @> ${JSON.stringify([c.value])}::jsonb`;return c.op==="contains"?p:n.and(n.isNotNull(u),o`NOT (${p})`)}case"like":return n.like(i(c.field),a(c.pattern));case"not_like":return n.notLike(i(c.field),a(c.pattern));case"exists":return n.isNotNull(i(c.field));case"missing":return n.isNull(i(c.field));case"relation":case"not_relation":throw new Q("Relation conditions must be resolved first: pass resolve_relations to partial_evaluate.")}};return l(e)}});var ss=kt(z=>{"use strict";Object.defineProperty(z,"__esModule",{value:!0});z.likeToRegExp=z.filterToSql=z.filterToPrisma=z.filterToDrizzle=z.evalFilter=z.FilterCompileError=z.isPermissionKey=z.isRoleKey=z.PERMISSION_KEY_PATTERN=z.ROLE_KEY_PATTERN=z.ForbiddenError=z.protectFromClaims=z.hasFromClaims=z.evaluate=void 0;var zt=es();Object.defineProperty(z,"evaluate",{enumerable:!0,get:function(){return zt.evaluate}});Object.defineProperty(z,"hasFromClaims",{enumerable:!0,get:function(){return zt.hasFromClaims}});Object.defineProperty(z,"protectFromClaims",{enumerable:!0,get:function(){return zt.protectFromClaims}});Object.defineProperty(z,"ForbiddenError",{enumerable:!0,get:function(){return zt.ForbiddenError}});var Bt=ts();Object.defineProperty(z,"ROLE_KEY_PATTERN",{enumerable:!0,get:function(){return Bt.ROLE_KEY_PATTERN}});Object.defineProperty(z,"PERMISSION_KEY_PATTERN",{enumerable:!0,get:function(){return Bt.PERMISSION_KEY_PATTERN}});Object.defineProperty(z,"isRoleKey",{enumerable:!0,get:function(){return Bt.isRoleKey}});Object.defineProperty(z,"isPermissionKey",{enumerable:!0,get:function(){return Bt.isPermissionKey}});var qe=is();Object.defineProperty(z,"FilterCompileError",{enumerable:!0,get:function(){return qe.FilterCompileError}});Object.defineProperty(z,"evalFilter",{enumerable:!0,get:function(){return qe.evalFilter}});Object.defineProperty(z,"filterToDrizzle",{enumerable:!0,get:function(){return qe.filterToDrizzle}});Object.defineProperty(z,"filterToPrisma",{enumerable:!0,get:function(){return qe.filterToPrisma}});Object.defineProperty(z,"filterToSql",{enumerable:!0,get:function(){return qe.filterToSql}});Object.defineProperty(z,"likeToRegExp",{enumerable:!0,get:function(){return qe.likeToRegExp}})});var ku=30*24*60*60*1e3;function al(e,t,n=0){return e?e.expiresAt-n>t:!1}var _t=class{constructor(t=()=>Date.now()){this.now=t;v(this,"token",null)}set(t){this.token=t}get(t=0){return al(this.token,this.now(),t)?this.token:null}peek(){return this.token}clear(){this.token=null}};async function Qr(e,t={}){let n=t.locale?`?locale=${encodeURIComponent(t.locale)}`:"",r=await e.request(`/v1/client/policies${n}`,{method:"GET"});return r.ok&&r.data?{ok:!0,data:r.data}:{ok:!1,errors:r.errors}}function Zr(e,t){var o;let n=typeof((o=e.attempt)==null?void 0:o.policy_acceptance_token)=="string"?e.attempt.policy_acceptance_token:null,r=e.policyToken||n;return{policy_acceptances:t,...r?{policy_acceptance_token:r}:e.pollSecret?{poll_secret:e.pollSecret}:{}}}function X(e){var t,n,r,o;switch(e.status){case"needs_identifier":return{kind:"collect_identifier"};case"needs_first_factor":return{kind:"collect_first_factor",strategies:(t=e.supported_first_factors)!=null?t:[]};case"needs_second_factor":return{kind:"collect_second_factor"};case"needs_mfa_enrollment":return{kind:"enroll_second_factor"};case"needs_email_verification":return{kind:"collect_email_code"};case"needs_captcha":return{kind:"collect_captcha"};case"needs_oauth_callback":return{kind:"await_oauth"};case"needs_new_password":return{kind:"collect_new_password"};case"needs_policy_acceptance":return{kind:"accept_policies",policies:(n=e.pending_policies)!=null?n:[]};case"needs_required_action":return{kind:"complete_required_action",actions:(r=e.pending_required_actions)!=null?r:[]};case"complete":return{kind:"done",sessionId:(o=e.created_session_id)!=null?o:null};case"abandoned":return{kind:"restart",reason:"abandoned"};default:return{kind:"unknown",status:e.status}}}function Xr(e){return e.status==="complete"||e.status==="abandoned"}function eo(e){if(!e||typeof e!="object")return[];let t=e.errors;return Array.isArray(t)?t.filter(n=>!!n&&typeof n.message=="string").map(n=>{let r={code:n.code,message:n.message,param:n.param},o=n.reason;typeof o=="string"&&o!==""&&(r.reason=o);let i=n.meta;return i&&typeof i=="object"&&!Array.isArray(i)&&(r.meta=i),r}):[]}var to="0.33.1";var ro={name:"@atlasauth/js",version:to},oo="x-atlas-sdk",ll="atlas-sdk-advisory";function io(e){return`${e.name}/${e.version}`}function cl(e){return typeof e!="string"||!e.trim()?[]:e.split(",").map(t=>{let[n,...r]=t.split(";").map(i=>i.trim()),o=i=>{var s,a;return(a=(s=r.find(l=>l.startsWith(`${i}=`)))==null?void 0:s.slice(i.length+1))!=null?a:null};return{action:n!=null?n:"",min:o("min"),reason:o("reason")}}).filter(t=>t.action!=="")}var no=new Set;function so(e,t,n=dl){var i,s,a,l,c;let r=null;try{r=(a=(s=(i=e==null?void 0:e.headers)==null?void 0:i.get)==null?void 0:s.call(i,ll))!=null?a:null}catch{return[]}let o=[];for(let d of cl(r)){let u=`${t.name}|${(l=d.reason)!=null?l:""}|${(c=d.min)!=null?c:""}`;no.has(u)||(no.add(u),o.push(d),n(`[Atlas] ${t.name} ${t.version} has a known problem${d.reason?` (${d.reason})`:""}${d.min?` fixed in ${d.min}. Upgrade ${t.name} to ${d.min} or later`:". Upgrade it"} \u2014 with a 0.x version a caret range does not move past your lockfile on its own. Details: https://atlasauth.net/v1/sdk_advisories/${encodeURIComponent(t.name)}`))}return o}function dl(e){typeof console!="undefined"&&console.warn(e)}var De="__atlas_dev_session:",vn="/v1/client/tickets/exchange",ao="/v1/client",lo=/^\/v1\/client\/sessions\/[^/]+\/tokens$/,ul=/^\/v1\/client\/sessions\/[^/]+\/revoke$/,bn=new Map,pl={getItem:e=>{var t;return(t=bn.get(e))!=null?t:null},setItem:(e,t)=>void bn.set(e,t),removeItem:e=>void bn.delete(e)},xn="local";function wn(e){xn=e!=null?e:"local"}function Ae(){if(xn==="memory")return pl;try{let e=globalThis,t=xn==="session"?e.sessionStorage:e.localStorage;return t&&typeof t.getItem=="function"?t:null}catch{return null}}function go(e){return e.startsWith("pk_test_")&&Ae()!==null}function mo(e){var t,n;try{return(n=(t=Ae())==null?void 0:t.getItem(De+e))!=null?n:null}catch{return null}}var Sn=":sid";function co(e,t,n){var r,o;if(!(typeof t!="string"||!t))try{(r=Ae())==null||r.setItem(De+e,t),typeof n=="string"&&n&&((o=Ae())==null||o.setItem(De+e+Sn,n))}catch{}}function fl(e){var t,n;try{return(n=(t=Ae())==null?void 0:t.getItem(De+e+Sn))!=null?n:null}catch{return null}}function vt(e){var t,n;try{(t=Ae())==null||t.removeItem(De+e),(n=Ae())==null||n.removeItem(De+e+Sn)}catch{}}function ho(e){try{let t=typeof e=="string"?e:e instanceof URL?e.href:e.url;return new URL(t,"https://invalid.example").pathname}catch{return null}}function uo(e){let t=/^\/v1\/client\/sessions\/([^/]+)\//.exec(e);return t?decodeURIComponent(t[1]):null}async function kn(e){try{let t=await e.clone().json();return t&&typeof t=="object"&&!Array.isArray(t)?t:null}catch{return null}}var _n=Symbol.for("atlas.devBrowser"),gl=1e4,po=new WeakMap;function ml(e){if(typeof(e==null?void 0:e.body)!="string")return null;try{let t=JSON.parse(e.body);return typeof t.attempt_id=="string"&&typeof t.ticket=="string"?`${t.attempt_id}\0${t.ticket}`:null}catch{return null}}function fo(e,t,n,r){var a,l;let o=((a=n==null?void 0:n.method)!=null?a:"GET").toUpperCase()==="POST"&&ho(t)===vn?ml(n):null;if(!o)return r();let i=(l=po.get(e))!=null?l:new Map;po.set(e,i);let s=i.get(o);if(!s){s=r(),i.set(o,s);let c=()=>{i.get(o)===s&&i.delete(o)};s.then(d=>{var p;if(!d.ok)return c();let u=setTimeout(c,gl);(p=u.unref)==null||p.call(u)},c)}return s.then(c=>c.clone())}function Cn(e,t){if(t[_n])return t;if(!e.startsWith("pk_test_")){let o=(i,s)=>fo(t,i,s,()=>t(i,s));return o[_n]=!0,o}let n=(o,i)=>fo(t,o,i,()=>r(o,i)),r=async(o,i)=>{var p,f;if(!go(e))return t(o,i);let s=ho(o),a=((p=i==null?void 0:i.method)!=null?p:"GET").toUpperCase(),l=i,c=!1;if(s===vn&&a==="POST"&&typeof(i==null?void 0:i.body)=="string")try{let g=JSON.parse(i.body);g&&typeof g=="object"&&!Array.isArray(g)&&(l={...i,body:JSON.stringify({...g,return_refresh_token:!0})})}catch{}let d=mo(e);if(d&&(s===ao&&a==="GET"||s&&lo.test(s)&&a==="POST")){let g=new Headers(l==null?void 0:l.headers);g.has("x-refresh-token")||g.set("x-refresh-token",d),l={...l,headers:g},c=!0}let u=await t(o,l);if(!s)return u;if(s===vn&&u.ok){let g=await kn(u);co(e,g==null?void 0:g.refresh_token,g==null?void 0:g.id)}else if(s&&lo.test(s))u.ok?co(e,(f=await kn(u))==null?void 0:f.refresh_token,uo(s)):c&&u.status===401&&vt(e);else if(s===ao&&c&&u.ok){let g=await kn(u);g&&g.session===null&&vt(e)}else if(s&&ul.test(s)&&(u.ok||u.status===404)){let g=fl(e);(!g||g===uo(s))&&vt(e)}return u};return n[_n]=!0,n}function An(e){let t=e==null?void 0:e.mfa;return{totp:t?t.totp:!0,sms:t?t.sms:!1,emailCode:(e==null?void 0:e.emailSecondFactor)===!0,totpCodes:t?t.totpCodes:2,...(t==null?void 0:t.duo)===!0?{duo:!0}:{}}}async function hl(e,t,n){let r=await e.post(`/v1/client/sign_ins/${encodeURIComponent(t)}/prepare_mfa_enrollment`,n.strategy==="phone_code"?{strategy:"phone_code",phone:n.phone}:{strategy:"totp"}),o=r.data;if(!r.ok||!o||typeof o.factor_id!="string")return{enrollment:null,errors:r.errors,status:r.status};let i=a=>typeof a=="string"&&a?a:void 0,s={strategy:n.strategy,factorId:o.factor_id};if(n.strategy==="totp"){i(o.secret)&&(s.secret=i(o.secret)),i(o.uri)&&(s.uri=i(o.uri));let a=i(o.qr_code);a&&/^data:image\//.test(a)&&(s.qrCode=a)}else i(o.phone)&&(s.phone=i(o.phone));return{enrollment:s,errors:[],status:r.status}}function yo(e){return e.replace(/\s+/g,"").replace(/(.{4})(?=.)/g,"$1 ")}function yl(e,t){return t===409?!0:e.some(n=>n.code==="STRATEGY_DISABLED"||n.param==="strategy")}function bo(e,t){let n=()=>typeof t=="function"?t():t,r=f=>{let g=[];return f.totp&&g.push("totp"),f.sms&&g.push("phone_code"),g.length?g:["totp"]},o=()=>{let f=n();return{options:r(f),method:null,enrollment:null,busy:!1,errors:[],totpCodes:f.totpCodes}},i=o(),s=null,a="",l=0,c=new Set,d=f=>{i={...i,...f};for(let g of c)g(i)},u=async f=>{let g=s;if(!g)return;let m=l;d({busy:!0,errors:[]});let h=await hl(e,g,f);if(m===l){if(h.enrollment){d({busy:!1,enrollment:h.enrollment,errors:[]});return}if(yl(h.errors,h.status)&&i.options.length>1){let w=i.options.filter(C=>C!==f.strategy);d({busy:!1,options:w,method:null,enrollment:null,errors:h.errors}),w.length===1&&await p.choose(w[0]);return}d({busy:!1,errors:h.errors})}},p={get state(){return i},subscribe(f){return c.add(f),()=>c.delete(f)},start(f){f!==s&&(l+=1,s=f,a="",i=o(),d({}),i.options.length===1&&p.choose(i.options[0]))},async choose(f){i.options.includes(f)&&(d({method:f,enrollment:null,errors:[]}),f==="totp"&&await u({strategy:"totp"}))},async sendPhone(f){let g=f.trim();if(!g){d({errors:[{code:"FORM_PARAM_MISSING",message:"A phone number is required.",param:"phone"}]});return}a=g,await u({strategy:"phone_code",phone:g})},async resend(){i.method==="phone_code"&&a&&await u({strategy:"phone_code",phone:a})},async submit(f){var h,w,C,S;if(i.method==="phone_code"&&!i.enrollment)return await p.sendPhone((h=f.phone)!=null?h:""),null;let g=i.enrollment;return g?g.strategy==="phone_code"?{factorId:g.factorId,enrollStrategy:"phone_code",code:(w=f.code)!=null?w:""}:{factorId:g.factorId,code:(C=f.code)!=null?C:"",secondCode:(S=f.secondCode)!=null?S:""}:null},reset(){l+=1,s=null,a="",i=o(),d({})}};return p}function ko(e){return e.method===null?null:e.method==="phone_code"&&!e.enrollment?"mfa.sendCode":e.enrollment?"signIn.submit":null}async function _o(e,t,n){var o,i;let r=await e.post(`/v1/client/sign_ins/${encodeURIComponent(t)}/prepare_second_factor`,{strategy:n});if(!r.ok){let s=r.errors[0],a=new Error((o=s==null?void 0:s.message)!=null?o:"Could not send the code.");throw s!=null&&s.code&&(a.code=s.code),a}return{sentTo:typeof((i=r.data)==null?void 0:i.sent_to)=="string"?r.data.sent_to:""}}function vo(e){if(!Array.isArray(e))return null;let t=e.filter(n=>typeof n=="string"&&n.length>0);return t.length?t:null}function Ze(e){var t;return((t=e.attempt)==null?void 0:t.status)!=="complete"?null:e.recoveryCodes&&e.recoveryCodes.length?e.recoveryCodes:null}function xo(e){return{...e,recoveryCodes:null}}function bl(e){return`${e.join(`
|
|
1
|
+
"use strict";(()=>{var ml=Object.create;var xn=Object.defineProperty;var hl=Object.getOwnPropertyDescriptor;var yl=Object.getOwnPropertyNames;var bl=Object.getPrototypeOf,kl=Object.prototype.hasOwnProperty;var _l=(e,t,n)=>t in e?xn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var wt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var vl=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of yl(t))!kl.call(e,o)&&o!==n&&xn(e,o,{get:()=>t[o],enumerable:!(r=hl(t,o))||r.enumerable});return e};var xl=(e,t,n)=>(n=e!=null?ml(bl(e)):{},vl(t||!e||!e.__esModule?xn(n,"default",{value:e,enumerable:!0}):n,e));var v=(e,t,n)=>_l(e,typeof t!="symbol"?t+"":t,n);var ms=wt(Fe=>{"use strict";Object.defineProperty(Fe,"__esModule",{value:!0});Fe.ForbiddenError=void 0;Fe.evaluate=wr;Fe.hasFromClaims=yd;Fe.protectFromClaims=bd;function hd(e){return e.permission!==void 0||e.role!==void 0||e.anyPermission!==void 0||e.allPermissions!==void 0}function wr(e,t={}){var o,i,s,a;if(!e)return{allowed:!1,reason:"signed_out"};if(t.plan!==void 0&&e.pla!==t.plan)return{allowed:!1,reason:"missing_entitlement"};if(t.feature!==void 0&&!((o=e.fea)!=null?o:[]).includes(t.feature))return{allowed:!1,reason:"missing_entitlement"};let n=new Set((i=e.app_permissions)!=null?i:[]);if(t.appRole!==void 0&&!((s=e.app_roles)!=null?s:[]).includes(t.appRole))return{allowed:!1,reason:"missing_permission"};if(t.appPermission!==void 0&&!n.has(t.appPermission))return{allowed:!1,reason:"missing_permission"};if(t.anyAppPermission&&!t.anyAppPermission.some(l=>n.has(l)))return{allowed:!1,reason:"missing_permission"};if(t.allAppPermissions&&!t.allAppPermissions.every(l=>n.has(l)))return{allowed:!1,reason:"missing_permission"};if(!hd(t))return{allowed:!0};if(!e.org_id)return{allowed:!1,reason:"no_organization"};let r=new Set((a=e.org_permissions)!=null?a:[]);return t.role!==void 0&&e.org_role!==t.role?{allowed:!1,reason:"missing_permission"}:t.permission!==void 0&&!r.has(t.permission)?{allowed:!1,reason:"missing_permission"}:t.anyPermission&&!t.anyPermission.some(l=>r.has(l))?{allowed:!1,reason:"missing_permission"}:t.allPermissions&&!t.allPermissions.every(l=>r.has(l))?{allowed:!1,reason:"missing_permission"}:{allowed:!0}}function yd(e,t={}){return wr(e,t).allowed}var Ht=class extends Error{constructor(n,r){super(n==="signed_out"?"Not signed in.":n==="no_organization"?"No active organization for this authorization check.":n==="missing_entitlement"?"Missing the required plan or feature.":"Missing the required permission or role.");v(this,"reason");v(this,"condition");this.name="ForbiddenError",this.reason=n,this.condition=r}};Fe.ForbiddenError=Ht;function bd(e,t={}){let n=wr(e,t);if(!n.allowed)throw new Ht(n.reason,t)}});var hs=wt(de=>{"use strict";Object.defineProperty(de,"__esModule",{value:!0});de.PERMISSION_KEY_PATTERN=de.ROLE_KEY_PATTERN=void 0;de.isRoleKey=kd;de.isPermissionKey=_d;de.ROLE_KEY_PATTERN=/^org:[a-z][a-z0-9_]{1,31}$/;de.PERMISSION_KEY_PATTERN=/^org:[a-z][a-z0-9_]{1,31}:[a-z][a-z0-9_]{1,31}$/;function kd(e){return de.ROLE_KEY_PATTERN.test(e)}function _d(e){return de.PERMISSION_KEY_PATTERN.test(e)}});var _s=wt(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.FilterCompileError=void 0;he.likeToRegExp=ks;he.evalFilter=Sr;he.filterToSql=wd;he.filterToPrisma=Cd;he.filterToDrizzle=Sd;var Z=class extends Error{};he.FilterCompileError=Z;var Cr={eq:"=",ne:"<>",lt:"<",lte:"<=",gt:">",gte:">="},bs=e=>{if(e&&typeof e=="object"&&!Array.isArray(e)){let t=e;if(typeof t.type=="string"&&typeof t.id=="string"&&Object.keys(t).length===2)return`${t.type}::${t.id}`}return e};function Ge(e,t){let n=t.split("."),r=e[n[0]];for(let o of n.slice(1)){if(r===null||typeof r!="object"||Array.isArray(r))return;r=r[o]}return r===null?void 0:bs(r)}function Le(e,t){if("value"in e)return e.value;if("field"in e){let o=Ge(t,e.field);return typeof o=="string"||typeof o=="number"||typeof o=="boolean"?o:void 0}if("neg"in e){let o=Le(e.neg,t);return typeof o=="number"?-o:void 0}let n=Le(e.left,t),r=Le(e.right,t);if(!(typeof n!="number"||typeof r!="number"))return e.arith==="add"?n+r:e.arith==="sub"?n-r:n*r}function ys(e,t,n){return e==="eq"?t===n:e==="ne"?t!==n:typeof t!="number"||typeof n!="number"?!1:e==="lt"?t<n:e==="lte"?t<=n:e==="gt"?t>n:t>=n}function ks(e){return new RegExp(`^${e.split("*").map(t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join(".*")}$`,"s")}function Sr(e,t){switch(e.op){case"true":return!0;case"false":return!1;case"and":return e.args.every(n=>Sr(n,t));case"or":return e.args.some(n=>Sr(n,t));case"eq":case"ne":case"lt":case"lte":case"gt":case"gte":{let n=Le({field:e.field},t),r="ref"in e?Le({field:e.ref},t):e.value;return n!==void 0&&r!==void 0&&ys(e.op,n,r)}case"cmp":{let n=Le(e.left,t),r=Le(e.right,t);return n!==void 0&&r!==void 0&&ys(e.cmp,n,r)}case"in":case"not_in":{let n=Ge(t,e.field);return n===void 0||Array.isArray(n)?!1:e.values.includes(n)===(e.op==="in")}case"contains":case"not_contains":{let n=Ge(t,e.field);return Array.isArray(n)?n.map(bs).includes(e.value)===(e.op==="contains"):!1}case"like":case"not_like":{let n=Ge(t,e.field);return typeof n=="string"&&ks(e.pattern).test(n)===(e.op==="like")}case"exists":return Ge(t,e.field)!==void 0;case"missing":return Ge(t,e.field)===void 0;case"relation":case"not_relation":throw new Z("Unresolved relation condition: ask the server to resolve it (resolve_relations).")}}var vd=/^[A-Za-z_][A-Za-z0-9_$]*$/,xd=/^[A-Za-z0-9_]+$/,Ar=class{constructor(t,n){v(this,"o");v(this,"d");v(this,"params",[]);v(this,"kindOf",t=>typeof t=="number"?"number":typeof t=="boolean"?"boolean":"string");this.o=t,this.d=n}quote(t){let n=t.split(".");if(n.length>2||!n.every(o=>vd.test(o)))throw new Z(`"${t}" is not a safe column name (letters, digits and underscore, optionally table.column).`);let r=this.d==="mysql"?"`":'"';return n.map(o=>`${r}${o}${r}`).join(".")}param(t){var n;return this.params.push(t),this.d==="postgres"?`$${((n=this.o.paramOffset)!=null?n:0)+this.params.length}`:"?"}spec(t){var i;let n=this.o.columns[t];if(n===void 0)throw new Z(`No column is mapped for field "${t}".`);let r=typeof n=="string"?{column:n}:n,o=this.quote(r.column);if(r.json!==void 0){let s=r.json.split(".");if(!s.every(a=>xd.test(a)))throw new Z(`"${r.json}" is not a safe JSON path.`);return{col:o,kind:r.kind==="array"||r.kind==="json"?"json":"scalar",path:s}}return{col:o,kind:(i=r.kind)!=null?i:"scalar"}}scalar(t,n){let{col:r,path:o}=this.spec(t);if(!o)return r;if(this.d==="sqlite")return`json_extract(${r}, '$.${o.join(".")}')`;if(this.d==="mysql"){let s=`JSON_UNQUOTE(JSON_EXTRACT(${r}, '$.${o.join(".")}'))`;return n==="number"?`CAST(${s} AS DECIMAL(38,10))`:s}let i=`(${r} #>> '{${o.join(",")}}')`;return n==="number"?`${i}::numeric`:n==="boolean"?`${i}::boolean`:i}setExpr(t){let{col:n,kind:r,path:o}=this.spec(t);if(o)return this.d==="postgres"?{sql:`(${n} #> '{${o.join(",")}}')`,native:!1}:this.d==="mysql"?{sql:`JSON_EXTRACT(${n}, '$.${o.join(".")}')`,native:!1}:{sql:`json_extract(${n}, '$.${o.join(".")}')`,native:!1};let i=r==="scalar"?this.d==="postgres"?"array":"json":r;return{sql:n,native:i==="array"}}term(t,n="number"){return"field"in t?this.scalar(t.field,n):"value"in t?this.param(t.value):"neg"in t?`(-${this.term(t.neg)})`:`(${this.term(t.left)} ${t.arith==="add"?"+":t.arith==="sub"?"-":"*"} ${this.term(t.right)})`}likePattern(t){return t.split("*").map(n=>n.replace(/[\\%_]/g,"\\$&")).join("%")}build(t){switch(t.op){case"true":return"(1 = 1)";case"false":return"(1 = 0)";case"and":case"or":return t.args.length===0?t.op==="and"?"(1 = 1)":"(1 = 0)":`(${t.args.map(n=>this.build(n)).join(t.op==="and"?" AND ":" OR ")})`;case"eq":case"ne":case"lt":case"lte":case"gt":case"gte":{if("ref"in t)return`(${this.scalar(t.field,"string")} ${Cr[t.op]} ${this.scalar(t.ref,"string")})`;let n=this.kindOf(t.value);return`(${this.scalar(t.field,n)} ${Cr[t.op]} ${this.param(t.value)})`}case"cmp":return`(${this.term(t.left)} ${Cr[t.cmp]} ${this.term(t.right)})`;case"in":case"not_in":{if(t.values.length===0)return t.op==="in"?"(1 = 0)":"(1 = 1)";let n=this.kindOf(t.values[0]),r=this.scalar(t.field,n);if(this.d==="postgres"&&t.values.every(i=>typeof i=="string"))return t.op==="in"?`(${r} = ANY(${this.param(t.values)}))`:`(${r} <> ALL(${this.param(t.values)}))`;let o=t.values.map(i=>this.param(i)).join(", ");return`(${r} ${t.op==="in"?"IN":"NOT IN"} (${o}))`}case"contains":case"not_contains":{let n=t.op==="not_contains",{sql:r,native:o}=this.setExpr(t.field),i;return this.d==="postgres"?i=o?`${this.param(t.value)} = ANY(${r})`:`${r} @> ${this.param(JSON.stringify([t.value]))}::jsonb`:this.d==="mysql"?i=`JSON_CONTAINS(${r}, ${this.param(JSON.stringify(t.value))})`:i=`EXISTS (SELECT 1 FROM json_each(${r}) WHERE value = ${this.param(t.value)})`,n?`(${this.d==="sqlite"?`${r} IS NOT NULL AND `:""}NOT ${i})`:`(${i})`}case"like":case"not_like":{let n=this.scalar(t.field,"string"),r=t.op==="not_like"?"NOT ":"";if(this.d==="sqlite")return`(${n} ${r}GLOB ${this.param(t.pattern.replace(/[?[]/g,"[$&]"))})`;let o=this.param(this.likePattern(t.pattern));return this.d==="mysql"?`(${n} ${r}LIKE BINARY ${o} ESCAPE '\\\\')`:`(${n} ${r}LIKE ${o} ESCAPE '\\')`}case"exists":case"missing":{let{col:n,path:r}=this.spec(t.field);return`(${r?this.scalar(t.field,"string"):n} IS ${t.op==="exists"?"NOT ":""}NULL)`}case"relation":case"not_relation":throw new Z("Relation conditions must be resolved first: pass resolve_relations to partial_evaluate.")}}};function wd(e,t){var o;let n=new Ar(t,(o=t.dialect)!=null?o:"postgres");return{text:n.build(e),params:n.params}}var se=(e,t)=>e.split(".").reduceRight((n,r)=>({[r]:n}),t);function Cd(e,t){let n=o=>{let i=t.fields[o];if(i===void 0)throw new Z(`No Prisma field is mapped for "${o}".`);return i},r=o=>{switch(o.op){case"true":return{};case"false":return{OR:[]};case"and":return{AND:o.args.map(r)};case"or":return{OR:o.args.map(r)};case"eq":case"ne":case"lt":case"lte":case"gt":case"gte":{if("ref"in o)throw new Z("Comparing two fields has no Prisma form; use filterToSql.");let i=o.op==="eq"?{equals:o.value}:o.op==="ne"?{not:o.value}:{[o.op]:o.value};return se(n(o.field),i)}case"cmp":throw new Z("Arithmetic has no Prisma form; use filterToSql.");case"in":return se(n(o.field),{in:o.values});case"not_in":return{AND:[se(n(o.field),{notIn:o.values}),se(n(o.field),{not:null})]};case"contains":return se(n(o.field),{has:o.value});case"not_contains":return{AND:[{NOT:se(n(o.field),{has:o.value})},se(n(o.field),{not:null})]};case"exists":return se(n(o.field),{not:null});case"missing":return se(n(o.field),{equals:null});case"like":case"not_like":{let i=/^(\*?)([^*]*)(\*?)$/.exec(o.pattern);if(!i)throw new Z(`Pattern "${o.pattern}" has no Prisma form (only x, x*, *x and *x*); use filterToSql.`);let[,s,a,l]=i,c=s&&l?{contains:a}:s?{endsWith:a}:l?{startsWith:a}:{equals:a},d=se(n(o.field),c);return o.op==="like"?d:{AND:[{NOT:d},se(n(o.field),{not:null})]}}case"relation":case"not_relation":throw new Z("Relation conditions must be resolved first: pass resolve_relations to partial_evaluate.")}};return r(e)}function Sd(e,t){let{ops:n,columns:r}=t,{sql:o}=n,i=c=>{if(!(c in r))throw new Z(`No Drizzle column is mapped for "${c}".`);return r[c]},s=c=>{if("field"in c)return i(c.field);if("value"in c)return o`${c.value}`;if("neg"in c)return o`(-${s(c.neg)})`;let[d,u]=[s(c.left),s(c.right)];return c.arith==="add"?o`(${d} + ${u})`:c.arith==="sub"?o`(${d} - ${u})`:o`(${d} * ${u})`},a=c=>c.split("*").map(d=>d.replace(/[\\%_]/g,"\\$&")).join("%"),l=c=>{var d;switch(c.op){case"true":return o`(1 = 1)`;case"false":return o`(1 = 0)`;case"and":return c.args.length?n.and(...c.args.map(l)):o`(1 = 1)`;case"or":return c.args.length?n.or(...c.args.map(l)):o`(1 = 0)`;case"eq":case"ne":case"lt":case"lte":case"gt":case"gte":return n[c.op](i(c.field),"ref"in c?i(c.ref):c.value);case"cmp":{let[u,p]=[s(c.left),s(c.right)];switch(c.cmp){case"eq":return o`${u} = ${p}`;case"ne":return o`${u} <> ${p}`;case"lt":return o`${u} < ${p}`;case"lte":return o`${u} <= ${p}`;case"gt":return o`${u} > ${p}`;case"gte":return o`${u} >= ${p}`}}case"in":return c.values.length?n.inArray(i(c.field),c.values):o`(1 = 0)`;case"not_in":return c.values.length?n.and(n.notInArray(i(c.field),c.values),n.isNotNull(i(c.field))):o`(1 = 1)`;case"contains":case"not_contains":{let u=i(c.field),p=(d=t.arrayFields)!=null&&d.includes(c.field)?o`${c.value} = ANY(${u})`:o`${u} @> ${JSON.stringify([c.value])}::jsonb`;return c.op==="contains"?p:n.and(n.isNotNull(u),o`NOT (${p})`)}case"like":return n.like(i(c.field),a(c.pattern));case"not_like":return n.notLike(i(c.field),a(c.pattern));case"exists":return n.isNotNull(i(c.field));case"missing":return n.isNull(i(c.field));case"relation":case"not_relation":throw new Z("Relation conditions must be resolved first: pass resolve_relations to partial_evaluate.")}};return l(e)}});var vs=wt(B=>{"use strict";Object.defineProperty(B,"__esModule",{value:!0});B.likeToRegExp=B.filterToSql=B.filterToPrisma=B.filterToDrizzle=B.evalFilter=B.FilterCompileError=B.isPermissionKey=B.isRoleKey=B.PERMISSION_KEY_PATTERN=B.ROLE_KEY_PATTERN=B.ForbiddenError=B.protectFromClaims=B.hasFromClaims=B.evaluate=void 0;var Wt=ms();Object.defineProperty(B,"evaluate",{enumerable:!0,get:function(){return Wt.evaluate}});Object.defineProperty(B,"hasFromClaims",{enumerable:!0,get:function(){return Wt.hasFromClaims}});Object.defineProperty(B,"protectFromClaims",{enumerable:!0,get:function(){return Wt.protectFromClaims}});Object.defineProperty(B,"ForbiddenError",{enumerable:!0,get:function(){return Wt.ForbiddenError}});var Kt=hs();Object.defineProperty(B,"ROLE_KEY_PATTERN",{enumerable:!0,get:function(){return Kt.ROLE_KEY_PATTERN}});Object.defineProperty(B,"PERMISSION_KEY_PATTERN",{enumerable:!0,get:function(){return Kt.PERMISSION_KEY_PATTERN}});Object.defineProperty(B,"isRoleKey",{enumerable:!0,get:function(){return Kt.isRoleKey}});Object.defineProperty(B,"isPermissionKey",{enumerable:!0,get:function(){return Kt.isPermissionKey}});var Ve=_s();Object.defineProperty(B,"FilterCompileError",{enumerable:!0,get:function(){return Ve.FilterCompileError}});Object.defineProperty(B,"evalFilter",{enumerable:!0,get:function(){return Ve.evalFilter}});Object.defineProperty(B,"filterToDrizzle",{enumerable:!0,get:function(){return Ve.filterToDrizzle}});Object.defineProperty(B,"filterToPrisma",{enumerable:!0,get:function(){return Ve.filterToPrisma}});Object.defineProperty(B,"filterToSql",{enumerable:!0,get:function(){return Ve.filterToSql}});Object.defineProperty(B,"likeToRegExp",{enumerable:!0,get:function(){return Ve.likeToRegExp}})});var Ou=30*24*60*60*1e3;function wl(e,t,n=0){return e?e.expiresAt-n>t:!1}var Ct=class{constructor(t=()=>Date.now()){this.now=t;v(this,"token",null)}set(t){this.token=t}get(t=0){return wl(this.token,this.now(),t)?this.token:null}peek(){return this.token}clear(){this.token=null}};async function io(e,t={}){let n=t.locale?`?locale=${encodeURIComponent(t.locale)}`:"",r=await e.request(`/v1/client/policies${n}`,{method:"GET"});return r.ok&&r.data?{ok:!0,data:r.data}:{ok:!1,errors:r.errors}}function so(e,t){var o;let n=typeof((o=e.attempt)==null?void 0:o.policy_acceptance_token)=="string"?e.attempt.policy_acceptance_token:null,r=e.policyToken||n;return{policy_acceptances:t,...r?{policy_acceptance_token:r}:e.pollSecret?{poll_secret:e.pollSecret}:{}}}function ee(e){var t,n,r,o;switch(e.status){case"needs_identifier":return{kind:"collect_identifier"};case"needs_first_factor":return{kind:"collect_first_factor",strategies:(t=e.supported_first_factors)!=null?t:[]};case"needs_second_factor":return{kind:"collect_second_factor"};case"needs_mfa_enrollment":return{kind:"enroll_second_factor"};case"needs_email_verification":return{kind:"collect_email_code"};case"needs_captcha":return{kind:"collect_captcha"};case"needs_oauth_callback":return{kind:"await_oauth"};case"needs_new_password":return{kind:"collect_new_password"};case"needs_policy_acceptance":return{kind:"accept_policies",policies:(n=e.pending_policies)!=null?n:[]};case"needs_required_action":return{kind:"complete_required_action",actions:(r=e.pending_required_actions)!=null?r:[]};case"complete":return{kind:"done",sessionId:(o=e.created_session_id)!=null?o:null};case"abandoned":return{kind:"restart",reason:"abandoned"};default:return{kind:"unknown",status:e.status}}}function wn(e){return e.status==="complete"||e.status==="abandoned"}function ao(e){if(!e||typeof e!="object")return[];let t=e.errors;return Array.isArray(t)?t.filter(n=>!!n&&typeof n.message=="string").map(n=>{let r={code:n.code,message:n.message,param:n.param},o=n.reason;typeof o=="string"&&o!==""&&(r.reason=o);let i=n.meta;return i&&typeof i=="object"&&!Array.isArray(i)&&(r.meta=i),r}):[]}var lo="0.34.0";var uo={name:"@atlasauth/js",version:lo},po="x-atlas-sdk",Cl="atlas-sdk-advisory";function fo(e){return`${e.name}/${e.version}`}function Sl(e){return typeof e!="string"||!e.trim()?[]:e.split(",").map(t=>{let[n,...r]=t.split(";").map(i=>i.trim()),o=i=>{var s,a;return(a=(s=r.find(l=>l.startsWith(`${i}=`)))==null?void 0:s.slice(i.length+1))!=null?a:null};return{action:n!=null?n:"",min:o("min"),reason:o("reason")}}).filter(t=>t.action!=="")}var co=new Set;function go(e,t,n=Al){var i,s,a,l,c;let r=null;try{r=(a=(s=(i=e==null?void 0:e.headers)==null?void 0:i.get)==null?void 0:s.call(i,Cl))!=null?a:null}catch{return[]}let o=[];for(let d of Sl(r)){let u=`${t.name}|${(l=d.reason)!=null?l:""}|${(c=d.min)!=null?c:""}`;co.has(u)||(co.add(u),o.push(d),n(`[Atlas] ${t.name} ${t.version} has a known problem${d.reason?` (${d.reason})`:""}${d.min?` fixed in ${d.min}. Upgrade ${t.name} to ${d.min} or later`:". Upgrade it"} \u2014 with a 0.x version a caret range does not move past your lockfile on its own. Details: https://atlasauth.net/v1/sdk_advisories/${encodeURIComponent(t.name)}`))}return o}function Al(e){typeof console!="undefined"&&console.warn(e)}var Ue="__atlas_dev_session:",Pn="/v1/client/tickets/exchange",mo="/v1/client",ho=/^\/v1\/client\/sessions\/[^/]+\/tokens$/,Pl=/^\/v1\/client\/sessions\/[^/]+\/revoke$/,Cn=new Map,El={getItem:e=>{var t;return(t=Cn.get(e))!=null?t:null},setItem:(e,t)=>void Cn.set(e,t),removeItem:e=>void Cn.delete(e)},En="local";function Rn(e){En=e!=null?e:"local"}function Re(){if(En==="memory")return El;try{let e=globalThis,t=En==="session"?e.sessionStorage:e.localStorage;return t&&typeof t.getItem=="function"?t:null}catch{return null}}function vo(e){return e.startsWith("pk_test_")&&Re()!==null}function xo(e){var t,n;try{return(n=(t=Re())==null?void 0:t.getItem(Ue+e))!=null?n:null}catch{return null}}var Tn=":sid";function yo(e,t,n){var r,o;if(!(typeof t!="string"||!t))try{(r=Re())==null||r.setItem(Ue+e,t),typeof n=="string"&&n&&((o=Re())==null||o.setItem(Ue+e+Tn,n))}catch{}}function Rl(e){var t,n;try{return(n=(t=Re())==null?void 0:t.getItem(Ue+e+Tn))!=null?n:null}catch{return null}}function St(e){var t,n;try{(t=Re())==null||t.removeItem(Ue+e),(n=Re())==null||n.removeItem(Ue+e+Tn)}catch{}}function wo(e){try{let t=typeof e=="string"?e:e instanceof URL?e.href:e.url;return new URL(t,"https://invalid.example").pathname}catch{return null}}function bo(e){let t=/^\/v1\/client\/sessions\/([^/]+)\//.exec(e);return t?decodeURIComponent(t[1]):null}async function Sn(e){try{let t=await e.clone().json();return t&&typeof t=="object"&&!Array.isArray(t)?t:null}catch{return null}}var An=Symbol.for("atlas.devBrowser"),Tl=1e4,ko=new WeakMap;function Il(e){if(typeof(e==null?void 0:e.body)!="string")return null;try{let t=JSON.parse(e.body);return typeof t.attempt_id=="string"&&typeof t.ticket=="string"?`${t.attempt_id}\0${t.ticket}`:null}catch{return null}}function _o(e,t,n,r){var a,l;let o=((a=n==null?void 0:n.method)!=null?a:"GET").toUpperCase()==="POST"&&wo(t)===Pn?Il(n):null;if(!o)return r();let i=(l=ko.get(e))!=null?l:new Map;ko.set(e,i);let s=i.get(o);if(!s){s=r(),i.set(o,s);let c=()=>{i.get(o)===s&&i.delete(o)};s.then(d=>{var p;if(!d.ok)return c();let u=setTimeout(c,Tl);(p=u.unref)==null||p.call(u)},c)}return s.then(c=>c.clone())}function In(e,t){if(t[An])return t;if(!e.startsWith("pk_test_")){let o=(i,s)=>_o(t,i,s,()=>t(i,s));return o[An]=!0,o}let n=(o,i)=>_o(t,o,i,()=>r(o,i)),r=async(o,i)=>{var p,f;if(!vo(e))return t(o,i);let s=wo(o),a=((p=i==null?void 0:i.method)!=null?p:"GET").toUpperCase(),l=i,c=!1;if(s===Pn&&a==="POST"&&typeof(i==null?void 0:i.body)=="string")try{let m=JSON.parse(i.body);m&&typeof m=="object"&&!Array.isArray(m)&&(l={...i,body:JSON.stringify({...m,return_refresh_token:!0})})}catch{}let d=xo(e);if(d&&(s===mo&&a==="GET"||s&&ho.test(s)&&a==="POST")){let m=new Headers(l==null?void 0:l.headers);m.has("x-refresh-token")||m.set("x-refresh-token",d),l={...l,headers:m},c=!0}let u=await t(o,l);if(!s)return u;if(s===Pn&&u.ok){let m=await Sn(u);yo(e,m==null?void 0:m.refresh_token,m==null?void 0:m.id)}else if(s&&ho.test(s))u.ok?yo(e,(f=await Sn(u))==null?void 0:f.refresh_token,bo(s)):c&&u.status===401&&St(e);else if(s===mo&&c&&u.ok){let m=await Sn(u);m&&m.session===null&&St(e)}else if(s&&Pl.test(s)&&(u.ok||u.status===404)){let m=Rl(e);(!m||m===bo(s))&&St(e)}return u};return n[An]=!0,n}var On=e=>`atlas_link_${e}`;function Fn(){var e;try{return(e=globalThis.localStorage)!=null?e:null}catch{return null}}function Te(e,t){var r;let n=typeof t.match_code=="string"&&t.match_code?t.match_code:null;if(n&&typeof t.poll_secret=="string"&&t.poll_secret)try{(r=Fn())==null||r.setItem(On(e),t.poll_secret)}catch{}return n}function Ol(e){var t,n;try{return(n=(t=Fn())==null?void 0:t.getItem(On(e)))!=null?n:null}catch{return null}}function fe(e){var t;try{(t=Fn())==null||t.removeItem(On(e))}catch{}}function So(e,t="sign_in"){var r;let n=e!=null?e:(r=globalThis.location)==null?void 0:r.href;if(!n)return null;try{let o=new URL(n).searchParams,i=o.get("attempt"),s=o.get("token");return i!=null&&i.startsWith("sia_")&&s?{attempt:i,token:s,flow:t}:null}catch{return null}}var Ao=e=>`/v1/client/${e.flow==="sign_up"?"sign_ups":e.flow==="password_reset"?"password_resets":"sign_ins"}/verify`;async function Fl(e,t){let n=await e.get(`${Ao(t)}?attempt=${encodeURIComponent(t.attempt)}&token=${encodeURIComponent(t.token)}`);return!n.ok||!n.data?null:{requiresConfirmation:n.data.requires_confirmation===!0}}function Co(e,t){return e.post(`${Ao(t)}/confirm`,{attempt:t.attempt,token:t.token,...t.pollSecret?{poll_secret:t.pollSecret}:{match_code:t.matchCode}})}function Po(e,t){let n={status:"checking",busy:!1,errors:[]},r=!1,o=new Set,i=a=>{n={...n,...a};for(let l of o)l(n)},s=a=>{var c;fe(t.attempt);let l=(c=a.data)==null?void 0:c.reset_url;i({status:"confirmed",busy:!1,errors:[],...typeof l=="string"&&/^https:\/\//i.test(l)?{resetUrl:l}:{}})};return{get state(){return n},subscribe(a){return o.add(a),()=>o.delete(a)},async start(){if(r)return;r=!0;let a=await Fl(e,t);if(!(a!=null&&a.requiresConfirmation)){i({status:"invalid"});return}let l=Ol(t.attempt);if(l){let c=await Co(e,{...t,pollSecret:l});if(c.ok){s(c);return}}i({status:"needs_code"})},async submitCode(a){let l=a.replace(/\s+/g,"");if(n.status!=="needs_code"||n.busy||!l)return;i({busy:!0,errors:[]});let c=await Co(e,{...t,matchCode:l});c.ok?s(c):c.status===0||c.status===429?i({busy:!1,errors:c.errors}):i({status:"invalid",busy:!1,errors:[]})}}}var Io=()=>{let e=globalThis.navigator;if(!e||!e.credentials)throw new Error("WebAuthn is not available in this environment.");return e};function Ie(e){let t=e instanceof Uint8Array?e:new Uint8Array(e),n="";for(let r=0;r<t.length;r+=1)n+=String.fromCharCode(t[r]);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function nt(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.length%4===0?"":"=".repeat(4-t.length%4),r=atob(t+n),o=new Uint8Array(r.length);for(let i=0;i<r.length;i+=1)o[i]=r.charCodeAt(i);return o.buffer}function ge(e){return typeof(e!=null?e:globalThis.PublicKeyCredential)!="undefined"}async function Ln(){var t;let e=globalThis.PublicKeyCredential;try{return await((t=e==null?void 0:e.isConditionalMediationAvailable)==null?void 0:t.call(e))===!0}catch{return!1}}function Eo(e){return typeof e=="string"?new TextEncoder().encode(e):e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function Ro(e){return{first:Eo(e.first),...e.second!==void 0?{second:Eo(e.second)}:{}}}function Oo(e,t){if(!e)return;let n={};return e.eval&&(n.eval=Ro(e.eval)),t==="get"&&e.evalByCredential&&(n.evalByCredential=Object.fromEntries(Object.entries(e.evalByCredential).map(([r,o])=>[r,Ro(o)]))),{prf:n}}var To=e=>e instanceof ArrayBuffer?new Uint8Array(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):void 0;function Fo(e){var i,s,a,l;let t=(s=(i=e.getClientExtensionResults)==null?void 0:i.call(e))!=null?s:{},n={credentialId:Ie(e.rawId)},r=t.prf;if(r&&typeof r=="object"){let c=To((a=r.results)==null?void 0:a.first),d=To((l=r.results)==null?void 0:l.second);n.prf={...typeof r.enabled=="boolean"?{enabled:r.enabled}:{},...c?{results:{first:c,...d?{second:d}:{}}}:{}}}let o=t.credProps;return o&&typeof o=="object"&&(n.credProps=typeof o.rk=="boolean"?{rk:o.rk}:{}),n}async function At(e,t={}){var l,c;let n=(l=t.host)!=null?l:Io(),r=e.user,o=(c=e.excludeCredentials)!=null?c:[],i={challenge:nt(e.challenge),rp:e.rp,user:{...r,id:nt(r.id)},pubKeyCredParams:e.pubKeyCredParams,excludeCredentials:o.map(d=>({type:d.type,id:nt(d.id)})),authenticatorSelection:e.authenticatorSelection,timeout:e.timeout,attestation:e.attestation,...Array.isArray(e.hints)&&e.hints.length?{hints:e.hints}:{},...Lo(Oo(t.prf,"create"),e.extensions)},s=await n.credentials.create({publicKey:i,...t.mediation?{mediation:t.mediation}:{},...t.signal?{signal:t.signal}:{}});if(!s)throw new Error("Passkey registration was cancelled.");let a=s.response;return t.onExtensionResults&&t.onExtensionResults(Fo(s)),{challenge:e.challenge,attestation_object:Ie(a.attestationObject),client_data_json:Ie(a.clientDataJSON),...t.name?{name:t.name}:{}}}async function rt(e,t={}){var a,l;let n=(a=t.host)!=null?a:Io(),r=(l=e.allowCredentials)!=null?l:[],o={challenge:nt(e.challenge),rpId:e.rpId,allowCredentials:r.map(c=>({type:c.type,id:nt(c.id)})),userVerification:e.userVerification,timeout:e.timeout,...Array.isArray(e.hints)&&e.hints.length?{hints:e.hints}:{},...Lo(Oo(t.prf,"get"),e.extensions)},i=await n.credentials.get({publicKey:o,...t.mediation?{mediation:t.mediation}:{},...t.signal?{signal:t.signal}:{}});if(!i)throw new Error("Passkey sign-in was cancelled.");let s=i.response;return t.onExtensionResults&&t.onExtensionResults(Fo(i)),{handle:e.handle,challenge:e.challenge,credential_id:Ie(i.rawId),authenticator_data:Ie(s.authenticatorData),client_data_json:Ie(s.clientDataJSON),signature:Ie(s.signature)}}function Lo(e,t){let n=t&&typeof t=="object"&&!Array.isArray(t)?t:void 0;return!e&&!n?{}:{extensions:{...n!=null?n:{},...e!=null?e:{}}}}function Do(e){return{totp:"mfa.enrollTotpOption",phone_code:"mfa.enrollSmsOption",hotp:"mfa.enrollHotpOption",yubikey:"mfa.enrollYubikeyOption",duo:"mfa.enrollDuoOption",passkey:"mfa.enrollPasskeyOption"}[e]}function Dn(e){let t=e==null?void 0:e.mfa;return{totp:t?t.totp:!0,sms:t?t.sms:!1,emailCode:(e==null?void 0:e.emailSecondFactor)===!0,totpCodes:t?t.totpCodes:2,...(t==null?void 0:t.duo)===!0?{duo:!0}:{},...(t==null?void 0:t.hotp)===!0?{hotp:!0}:{},...(t==null?void 0:t.yubikey)===!0?{yubikey:!0}:{},...(t==null?void 0:t.passkey)===!0?{passkey:!0}:{}}}async function Ll(e,t,n){var l;let r=await e.post(`/v1/client/sign_ins/${encodeURIComponent(t)}/prepare_mfa_enrollment`,n),o=r.data,i=o&&(n.strategy==="passkey"?typeof o.options=="object"&&o.options!==null:typeof o.factor_id=="string");if(!r.ok||!o||!i)return{enrollment:null,errors:r.errors,status:r.status};let s=c=>typeof c=="string"&&c?c:void 0,a={strategy:n.strategy,factorId:(l=s(o.factor_id))!=null?l:""};if(n.strategy==="passkey")a.passkeyOptions=o.options;else if(n.strategy==="duo"){let c=s(o.authorization_url);c&&/^https:\/\//i.test(c)&&(a.authorizationUrl=c)}else if(n.strategy==="totp"||n.strategy==="hotp"){s(o.secret)&&(a.secret=s(o.secret)),s(o.uri)&&(a.uri=s(o.uri));let c=s(o.qr_code);c&&/^data:image\//.test(c)&&(a.qrCode=c)}else s(o.phone)&&(a.phone=s(o.phone));return{enrollment:a,errors:[],status:r.status}}function $o(e){return e.replace(/\s+/g,"").replace(/(.{4})(?=.)/g,"$1 ")}function Dl(e,t){return t===409?!0:e.some(n=>n.code==="STRATEGY_DISABLED"||n.param==="strategy")}function Mo(e,t,n={}){let r=()=>typeof t=="function"?t():t,o=g=>{let _=[];return g.totp&&_.push("totp"),g.sms&&_.push("phone_code"),g.hotp&&_.push("hotp"),g.yubikey&&_.push("yubikey"),g.duo&&_.push("duo"),g.passkey&&ge(n.host)&&_.push("passkey"),_.length?_:["totp"]},i=()=>{let g=r();return{options:o(g),method:null,enrollment:null,busy:!1,errors:[],totpCodes:g.totpCodes}},s=i(),a=null,l="",c=0,d=!1,u=new Set,p=g=>{s={...s,...g};for(let _ of u)_(s)},f=async g=>{let _=a;if(!_)return;let S=c;p({busy:!0,errors:[]});let x=await Ll(e,_,g);if(S===c){if(x.enrollment){p({busy:!1,enrollment:x.enrollment,errors:[]});return}if(Dl(x.errors,x.status)&&s.options.length>1){let w=s.options.filter(P=>P!==g.strategy);p({busy:!1,options:w,method:null,enrollment:null,errors:x.errors}),w.length===1&&await k.choose(w[0]);return}p({busy:!1,errors:x.errors})}},m=async()=>{var S;let g=c;if(d){if(await f({strategy:"passkey"}),g!==c||s.errors.length>0)return null;d=!1}let _=(S=s.enrollment)==null?void 0:S.passkeyOptions;if(!_)return null;p({busy:!0,errors:[]});try{let x=await At(_,{...n.host?{host:n.host}:{}});return g!==c?null:(d=!0,p({busy:!1}),{enrollStrategy:"passkey",challenge:x.challenge,attestation_object:x.attestation_object,client_data_json:x.client_data_json})}catch(x){return g===c&&p({busy:!1,errors:[{code:"PASSKEY_CANCELLED",message:x instanceof Error&&x.message?x.message:"The passkey was not created."}]}),null}},k={get state(){return s},subscribe(g){return u.add(g),()=>u.delete(g)},start(g){g!==a&&(c+=1,a=g,l="",d=!1,s=i(),p({}),s.options.length===1&&k.choose(s.options[0]))},async choose(g){s.options.includes(g)&&(d=!1,p({method:g,enrollment:null,errors:[]}),g!=="phone_code"&&g!=="yubikey"&&await f({strategy:g}))},async sendPhone(g){let _=g.trim();if(!_){p({errors:[{code:"FORM_PARAM_MISSING",message:"A phone number is required.",param:"phone"}]});return}l=_,await f({strategy:"phone_code",phone:_})},async resend(){s.method==="phone_code"&&l&&await f({strategy:"phone_code",phone:l})},async submit(g){var S,x,w,P,C,y;if(s.method==="phone_code"&&!s.enrollment)return await k.sendPhone((S=g.phone)!=null?S:""),null;if(s.method==="yubikey")return{enrollStrategy:"yubikey",otp:(x=g.otp)!=null?x:""};let _=s.enrollment;return _?_.strategy==="passkey"?m():_.strategy==="phone_code"?{factorId:_.factorId,enrollStrategy:"phone_code",code:(w=g.code)!=null?w:""}:_.strategy==="hotp"?{factorId:_.factorId,enrollStrategy:"hotp",code:(P=g.code)!=null?P:""}:_.strategy==="duo"?{factorId:_.factorId,enrollStrategy:"duo"}:{factorId:_.factorId,code:(C=g.code)!=null?C:"",secondCode:(y=g.secondCode)!=null?y:""}:null},reset(){c+=1,a=null,l="",d=!1,s=i(),p({})}};return k}function Uo(e){return e.method===null?null:e.method==="phone_code"&&!e.enrollment?"mfa.sendCode":e.method==="yubikey"?"signIn.submit":e.method==="passkey"&&e.enrollment?"mfa.enrollPasskeyCreate":e.enrollment?"signIn.submit":null}async function No(e,t,n){var o,i;let r=await e.post(`/v1/client/sign_ins/${encodeURIComponent(t)}/prepare_second_factor`,{strategy:n});if(!r.ok){let s=r.errors[0],a=new Error((o=s==null?void 0:s.message)!=null?o:"Could not send the code.");throw s!=null&&s.code&&(a.code=s.code),a}return{sentTo:typeof((i=r.data)==null?void 0:i.sent_to)=="string"?r.data.sent_to:""}}function zo(e){if(!Array.isArray(e))return null;let t=e.filter(n=>typeof n=="string"&&n.length>0);return t.length?t:null}function ot(e){var t;return((t=e.attempt)==null?void 0:t.status)!=="complete"?null:e.recoveryCodes&&e.recoveryCodes.length?e.recoveryCodes:null}function jo(e){return{...e,recoveryCodes:null}}function $l(e){return`${e.join(`
|
|
2
2
|
`)}
|
|
3
|
-
`}async function
|
|
4
|
-
`)),!0}catch{return!1}}function Pn(){return typeof document!="undefined"&&typeof Blob!="undefined"&&typeof URL!="undefined"&&typeof URL.createObjectURL=="function"}function So(e,t="recovery-codes.txt"){var r;if(!Pn())return!1;let n=URL.createObjectURL(new Blob([bl(e)],{type:"text/plain;charset=utf-8"}));try{let o=document.createElement("a");return o.href=n,o.download=t,o.rel="noopener",o.style.display="none",((r=document.body)!=null?r:document.documentElement).appendChild(o),o.click(),o.remove(),!0}catch{return!1}finally{setTimeout(()=>URL.revokeObjectURL(n),0)}}var kl=/^[A-Za-z0-9_-]{3,64}$/,Pe=e=>!!e&&typeof e=="object"&&!Array.isArray(e),En=e=>typeof e=="string"&&kl.test(e.trim())?e.trim():null,Tn=["referalli","rewardful","tolt","promotekit","firstpromoter","partnerstack","dub"],Eo=["atlasconsent","cookiemunch","onetrust","cookiebot","didomi","usercentrics","osano","cookieyes","complianz","klaro","tcf","consent_mode","gpc"];function P(e,t){try{return e!=null&&(typeof e=="object"||typeof e=="function")?e[t]:void 0}catch{return}}function ce(e,t,...n){try{return typeof e=="function"?e.apply(t,n):void 0}catch{return}}function Xe(e,t){if(!e)return null;for(let n of e.split(";")){let r=n.trim();if(r.startsWith(`${t}=`)){let o=r.slice(t.length+1);try{return decodeURIComponent(o)}catch{return o}}}return null}function Ro(e){if(typeof e=="number"&&Number.isFinite(e)&&e>0)return new Date(e<1e12?e*1e3:e).toISOString();if(typeof e=="string"&&e&&e.length<=40){if(/^\d{9,13}$/.test(e))return Ro(Number(e));let t=Date.parse(e);if(Number.isFinite(t))return new Date(t).toISOString()}}function _e(e,t,n,r,o){let i={source:e,code:En(t),clickId:En(n),anonId:En(r)},s=Ro(o);return s&&(i.capturedAt=s),i.code||i.clickId||i.anonId?i:null}var _l={referalli:({win:e})=>{var r,o;let t=P(e,"aff"),n=ce(P(t,"getReferral"),t);return Pe(n)?_e("referalli",n.code,(r=n.clickId)!=null?r:n.click_id,(o=n.anonId)!=null?o:n.anon_id,n.ts):null},rewardful:({win:e})=>{let t=P(e,"Rewardful");return _e("rewardful",P(P(t,"affiliate"),"token"),P(t,"referral"),null)},tolt:({win:e})=>_e("tolt",null,P(e,"tolt_referral"),null),promotekit:({win:e})=>_e("promotekit",null,P(e,"promotekit_referral"),null),firstpromoter:({cookies:e})=>_e("firstpromoter",Xe(e,"_fprom_ref"),Xe(e,"_fprom_tid"),null),partnerstack:({cookies:e})=>_e("partnerstack",Xe(e,"ps_partner_key"),Xe(e,"ps_xid"),null),dub:({cookies:e})=>_e("dub",null,Xe(e,"dub_id"),null)};function In(e){var n,r,o;if(typeof e!="function")return null;let t;try{t=e()}catch{return null}return Pe(t)?_e("custom",t.code,(n=t.clickId)!=null?n:t.click_id,(r=t.anonId)!=null?r:t.anon_id,(o=t.capturedAt)!=null?o:t.ts):null}function et(e,t){for(let n of t){let o=_l[n==="referally"?"referalli":n];if(!o)continue;let i=null;try{i=o(e)}catch{i=null}if(i)return i}return null}var vl={necessary:"necessary",essential:"necessary",strictly_necessary:"necessary",preferences:"preferences",functional:"preferences",functionality:"preferences",personalization:"preferences",statistics:"statistics",analytics:"statistics",performance:"statistics",marketing:"marketing",advertising:"marketing",advertisement:"marketing",targeting:"marketing",ads:"marketing"};function To(e){var t;return(t=vl[e.trim().toLowerCase()])!=null?t:null}var ke=e=>typeof e=="boolean"?e:void 0;function fe(e,t){return(n,r)=>{let o=t(r);if(o!==void 0)return o;let i=To(r),s=i?e[i]:void 0;return s?t(s):void 0}}var Rn=null,Co=!1;function On(e){let t=P(e,"__tcfapi");Co||typeof t!="function"||(Co=!0,ce(t,e,"addEventListener",2,(n,r)=>{r&&Pe(n)&&(Rn=n)}))}function xl(e){if(Rn)return Rn;let t=null;return ce(P(e,"__tcfapi"),e,"getTCData",2,(n,r)=>{r&&Pe(n)&&(t=n)}),t}var Ao={necessary:"necessary",preferences:"preferences",statistics:"statistics",marketing:"marketing"},Po=(e,t)=>Array.isArray(e)&&e.includes(t),wl={atlasconsent:{present:e=>P(P(e,"__atlasConsent"),"version")===1&&typeof P(P(e,"__atlasConsent"),"has")=="function",ask:(e,t)=>{let n=P(e,"__atlasConsent"),r=ce(P(n,"has"),n,t);return r===!0?!0:r===!1?!1:void 0}},cookiemunch:{present:e=>Pe(P(P(e,"CookieMunch"),"consent")),ask:(e,t)=>{let n=P(P(e,"CookieMunch"),"consent");return fe(Ao,r=>ke(P(n,r)))(e,t)}},onetrust:{present:e=>{var t;return typeof((t=P(e,"OnetrustActiveGroups"))!=null?t:P(e,"OptanonActiveGroups"))=="string"},ask:(e,t)=>{var r,o;let n=String((o=(r=P(e,"OnetrustActiveGroups"))!=null?r:P(e,"OptanonActiveGroups"))!=null?o:"").split(",").map(i=>i.trim()).filter(Boolean);return fe({necessary:"C0001",statistics:"C0002",preferences:"C0003",marketing:"C0004"},i=>/^C\d{4}$/.test(i)||n.includes(i)?n.includes(i):void 0)(e,t)}},cookiebot:{present:e=>!P(e,"CookieMunch")&&Pe(P(P(e,"Cookiebot"),"consent")),ask:(e,t)=>{let n=P(P(e,"Cookiebot"),"consent");return fe(Ao,r=>ke(P(n,r)))(e,t)}},didomi:{present:e=>typeof P(P(e,"Didomi"),"getUserStatus")=="function",ask:(e,t)=>{let n=P(e,"Didomi"),r=P(P(ce(P(n,"getUserStatus"),n),"purposes"),"global"),o=P(r,"enabled"),i=P(r,"disabled");return fe({marketing:"cookies",statistics:"measure_content_performance"},s=>Po(o,s)?!0:Po(i,s)?!1:void 0)(e,t)}},usercentrics:{present:e=>typeof P(P(e,"UC_UI"),"getServicesBaseInfo")=="function",ask:(e,t)=>{let n=P(e,"UC_UI"),r=ce(P(n,"getServicesBaseInfo"),n);if(Array.isArray(r))return fe({necessary:"essential",preferences:"functional",statistics:"functional",marketing:"marketing"},o=>{let i=r.filter(s=>P(s,"categorySlug")===o);return i.length?i.every(s=>P(P(s,"consent"),"status")===!0):void 0})(e,t)}},osano:{present:e=>typeof P(P(P(e,"Osano"),"cm"),"getConsent")=="function",ask:(e,t)=>{let n=P(P(e,"Osano"),"cm"),r=ce(P(n,"getConsent"),n);return fe({necessary:"ESSENTIAL",preferences:"PERSONALIZATION",statistics:"ANALYTICS",marketing:"MARKETING"},o=>{var s;let i=(s=P(r,o))!=null?s:P(r,o.toUpperCase());return i==="ACCEPT"?!0:i==="DENY"?!1:void 0})(e,t)}},cookieyes:{present:e=>typeof P(e,"getCkyConsent")=="function",ask:(e,t)=>{let n=P(ce(P(e,"getCkyConsent"),e),"categories");return fe({necessary:"necessary",preferences:"functional",statistics:"analytics",marketing:"advertisement"},r=>ke(P(n,r)))(e,t)}},complianz:{present:e=>typeof P(e,"cmplz_has_consent")=="function",ask:(e,t)=>fe({necessary:"functional",preferences:"preferences",statistics:"statistics",marketing:"marketing"},n=>ke(ce(P(e,"cmplz_has_consent"),e,n)))(e,t)},klaro:{present:e=>typeof P(P(e,"klaro"),"getManager")=="function",ask:(e,t)=>{let n=P(e,"klaro"),r=P(ce(P(n,"getManager"),n),"consents");return ke(P(r,t))}},tcf:{present:e=>typeof P(e,"__tcfapi")=="function",ask:e=>{var n;let t=xl(e);if(t)return t.gdprApplies===!1?!0:(n=ke(P(P(P(t,"purpose"),"consents"),"1")))!=null?n:!1}},consent_mode:{present:e=>Pe(P(P(P(e,"google_tag_data"),"ics"),"entries")),ask:(e,t)=>{let n=P(P(P(e,"google_tag_data"),"ics"),"entries");return fe({preferences:"functionality_storage",statistics:"analytics_storage",marketing:"ad_storage"},r=>{var i;let o=P(n,r);return(i=ke(P(o,"update")))!=null?i:ke(P(o,"default"))})(e,t)}},gpc:{present:e=>P(P(e,"navigator"),"globalPrivacyControl")===!0,ask:(e,t)=>t==="marketing"||t==="referrals"?!1:void 0}};function Sl(e){let t=e;if(typeof e=="function")try{t=e()}catch{t=void 0}if(t==="granted"||t===!0)return!0;if(t==="denied"||t===!1)return!1}function tt(e,t,n={}){let r=n.provider||"auto",o=()=>{let a=Sl(n.appConsent);return a===void 0?{granted:!1,by:"none"}:{granted:a,by:"app"}};if(r==="app")return o();let i=r==="auto"?Eo:[r],s=t.filter(a=>typeof a=="string"&&a.trim().length>0);for(let a of i){let l=wl[a],c=!1;try{c=!!l&&l.present(e)}catch{c=!1}if(!(!l||!c)){for(let d of s){let u;try{u=l.ask(e,d)}catch{u=void 0}if(u!==void 0)return{granted:u,by:a}}return{granted:!1,by:a}}}return o()}var Io=new Set(["referalli","rewardful","tolt","promotekit"]),Oo=["referalli"],Fo=Object.freeze({enabled:!1,sources:[],consentProvider:"auto",urlParams:[],contextCookie:null,contextCookies:[],consentCategory:"referrals",consentFallbackCategory:"marketing",challengeReferredSignups:"inherit",codeLookupUrl:null,signupCodeField:!1}),Cl=/^[A-Za-z0-9_-]{3,64}$/,Al=/^[A-Za-z0-9_.-]{1,40}$/,Pl=/^[A-Za-z0-9_.-]{1,64}$/,nt=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function ve(e){if(typeof e!="string")return null;let t=e.trim();return Cl.test(t)?t:null}function Do(e){var i;let t=nt(e)&&nt(e.referrals)?e.referrals:e;if(!nt(t)||t.enabled!==!0)return{...Fo,urlParams:[],sources:[]};let n=Array.isArray(t.url_params)?t.url_params.filter(s=>typeof s=="string"&&Al.test(s)).slice(0,10):[],r=Array.isArray(t.browser_sources)?t.browser_sources.filter(s=>typeof s=="string"&&/^[a-z0-9_]{1,40}$/.test(s)).map(s=>s==="referally"?"referalli":s).slice(0,20):[...Oo],o=(Array.isArray(t.context_cookies)?t.context_cookies:typeof t.context_cookie=="string"?[t.context_cookie]:[]).filter(s=>typeof s=="string"&&Pl.test(s)).filter((s,a,l)=>l.indexOf(s)===a).slice(0,5);return{enabled:!0,sources:r,consentProvider:typeof t.consent_provider=="string"&&/^[a-z0-9_]{1,40}$/.test(t.consent_provider)?t.consent_provider:"auto",urlParams:n.length?n:["ref","via","aff"],contextCookie:(i=o[0])!=null?i:null,contextCookies:o,consentCategory:typeof t.consent_category=="string"&&t.consent_category?t.consent_category:"referrals",consentFallbackCategory:typeof t.consent_fallback_category=="string"&&t.consent_fallback_category?t.consent_fallback_category:null,challengeReferredSignups:t.challenge_referred_signups==="always"?"always":"inherit",codeLookupUrl:typeof t.code_lookup_url=="string"&&/^https?:\/\//i.test(t.code_lookup_url)&&t.code_lookup_url.includes("{code}")?t.code_lookup_url:null,signupCodeField:t.signup_code_field===!0}}function El(e,t){if(!e)return null;let n;try{n=new URLSearchParams(e)}catch{return null}for(let r of t){let o=ve(n.get(r));if(o)return o}return null}function Rl(e,t){let n=[],r=o=>{o&&!n.includes(o)&&n.push(o)};for(let o of e)r(o);for(let o of e){let i;try{i=new URLSearchParams(o)}catch{continue}for(let s of["redirect_url","after_url","redirect_url_complete","after_sign_up_url","after_sign_in_url"]){let a=i.get(s);if(a)try{r(new URL(a,t!=null?t:"https://invalid.example").search)}catch{}}}return n}function xt(e){if(typeof e=="number"&&Number.isFinite(e)&&e>0)return new Date(e<1e12?e*1e3:e).toISOString();if(typeof e!="string"||!e||e.length>40)return null;if(/^\d{9,13}$/.test(e))return xt(Number(e));let t=Date.parse(e);return Number.isFinite(t)?new Date(t).toISOString():null}function Tl(e,t=Date.now()){var s,a,l;if(typeof e!="string"||!e||e.length>4096)return null;let n=e;try{n=decodeURIComponent(e)}catch{}let r=c=>{if(!c.startsWith("{"))return null;try{let d=JSON.parse(c);return nt(d)?d:null}catch{return null}},o=(s=r(e.trim()))!=null?s:r(n.trim());if(o){let c=xt(o.exp);if(c&&Date.parse(c)<=t)return null;let d={code:ve(o.code),clickId:ve((a=o.clickId)!=null?a:o.click_id),anonId:ve((l=o.anonId)!=null?l:o.anon_id)},u=xt(o.ts);return u&&(d.capturedAt=u),d.code||d.clickId||d.anonId?d:null}let i=ve(n);return i?{code:null,clickId:i,anonId:null}:null}function Il(e,t){if(!e)return null;for(let n of e.split(";")){let r=n.trim();if(r.startsWith(`${t}=`))return r.slice(t.length+1)}return null}var Ol=["ref_click_id","ref_anon_id","ref_consent","ref_captured_at"];function Fl(e){if(!e)return null;let t;try{t=new URLSearchParams(e)}catch{return null}if(!Ol.some(i=>t.get(i)!==null))return null;let n=t.get("ref_consent")==="granted",r={code:ve(t.get("ref")),clickId:ve(t.get("ref_click_id")),anonId:ve(t.get("ref_anon_id")),consentGranted:n},o=xt(t.get("ref_captured_at"));return o&&(r.capturedAt=o),r.code||r.clickId||r.anonId?r:null}function Fn(e,t,n,r){var l;let i=!!(e.clickId||e.anonId)?t():null,s=!!(i!=null&&i.granted),a={code:e.code,click_id:s?e.clickId:null,anon_id:s?e.anonId:null,consent:s?"granted":"not_required",captured_at:(l=e.capturedAt)!=null?l:n,source:r,...i?{consent_by:i.by}:{}};return a.code||a.click_id||a.anon_id?a:null}function Dl(e){return e.win!==void 0?e.win:{CookieMunch:e.cookieMunch,aff:e.aff}}function Ll(e,t,n,r){var g,m,h;if(!e.enabled)return null;let o=(g=t.capturedAt)!=null?g:new Date().toISOString(),i=Dl(t),s,a=()=>s!=null?s:s=tt(i,[e.consentCategory,e.consentFallbackCategory],{provider:e.consentProvider,appConsent:n}),l=w=>w?Fn(w,a,o,w.source):null,c=(m=e.sources)!=null?m:Oo,d={win:i,cookies:t.cookies},u=l(In(r));if(u)return u;let p=l(et(d,c.filter(w=>Io.has(w))));if(p)return p;let f=Rl(t.searches,t.base);for(let w of f){let C=Fl(w);if(!C)continue;let S=Fn(C,()=>C.consentGranted?{granted:!0,by:"url"}:a(),o,"url");if(S)return S}for(let w of f){let C=El(w,e.urlParams);if(C)return{code:C,click_id:null,anon_id:null,consent:"not_required",captured_at:o,source:"url"}}for(let w of(h=e.contextCookies)!=null?h:e.contextCookie?[e.contextCookie]:[]){let C=Tl(Il(t.cookies,w)),S=C?Fn(C,a,o,"cookie"):null;if(S)return S}return l(et(d,c.filter(w=>!Io.has(w))))}var $l=new Set(["/v1/client/sign_ups","/v1/client/sign_ups/passkey","/v1/client/sign_ins","/v1/client/sign_ins/oauth","/v1/client/sign_ins/sso","/v1/client/sign_ins/saml","/v1/client/sign_ins/wsfed","/v1/client/sign_ins/discourse","/v1/client/sign_ins/id_token","/v1/client/sign_ins/id_token/nonce","/v1/client/sign_ins/external_jwt","/v1/client/sign_ins/ldap","/v1/client/sign_ins/passkey/finish","/v1/oauth/telegram","/v1/oauth/siwe/nonce","/v1/oauth/siwe/verify","/v1/oauth/siws/nonce","/v1/oauth/siws/verify","/v1/oauth/siwb/nonce","/v1/oauth/siwb/verify","/v1/oauth/siwf/nonce","/v1/oauth/siwf/verify"]),Ml=/^\/v1\/client\/(sign_ins\/[^/]+\/(prepare_first_factor|attempt_first_factor)|sign_ups\/[^/]+\/(prepare_verification|attempt_verification|passkey\/finish))$/;function Lo(e){var n;let t=(n=e.split("?")[0])!=null?n:e;return $l.has(t)||Ml.test(t)}var Me=()=>typeof window=="undefined"?null:window,wt=[],$e=null;function Ln(){var t,n;let e=(n=(t=Me())==null?void 0:t.location)==null?void 0:n.search;!e||wt.includes(e)||(wt.push(e),$e!=null||($e=new Date().toISOString()))}Ln();Me()&&On(Me());var Dn={};var Le=new Map;function $o(e,t){return`${e!=null?e:""}|${t}`}function Mo(e,t){!nt(t)||!("referrals"in t)||Le.set(e,Promise.resolve(Do(t)))}function Uo(e){let t=Le.get(e.referralCacheKey);if(!t){let n=e.referralCacheKey,r=()=>(Le.get(n)===t&&Le.delete(n),{...Fo,urlParams:[]});t=e.get("/v1/client/environment").then(o=>o.ok?Do(o.data):r()).catch(r),Le.set(n,t)}return t}function No(e){var n,r,o;let t=Me();return Le.has(e.referralCacheKey)||!!((n=t==null?void 0:t.location)!=null&&n.search)||wt.length>0||In($n(e).referralSource)!==null||et({win:t,cookies:(o=(r=t==null?void 0:t.document)==null?void 0:r.cookie)!=null?o:null},Tn)!==null}function $n(e){var n,r,o;let t=e.referralOptions;return{referral:(n=t.referral)!=null?n:Dn.referral,referralConsent:(r=t.referralConsent)!=null?r:Dn.referralConsent,referralSource:(o=t.referralSource)!=null?o:Dn.referralSource}}async function Mn(e){var r,o,i,s,a;let t=Me();if(!t)return null;let n=$n(e);if(n.referral===!1)return null;try{let l=(o=(r=t.location)==null?void 0:r.search)!=null?o:"";if(!No(e))return null;let c=await Uo(e);return c.enabled?(On(t),Ll(c,{searches:[l,...wt],cookies:(s=(i=t.document)==null?void 0:i.cookie)!=null?s:null,win:t,base:(a=t.location)==null?void 0:a.href,capturedAt:$e!=null?$e:void 0},n.referralConsent,n.referralSource)):null}catch{return null}}async function Un(e){if(!Me()||$n(e).referral===!1||!No(e))return!1;try{if((await Uo(e)).challengeReferredSignups!=="always")return!1;let n=await Mn(e);return!!(n!=null&&n.code)}catch{return!1}}var zo=typeof window!="undefined",rt=()=>typeof navigator!="undefined"?navigator:void 0;function j(e,t){try{return e()}catch{return t}}function Ul(){return j(()=>{if(!zo||typeof document=="undefined")return{vendor:null,renderer:null};let e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");if(!t)return{vendor:null,renderer:null};let n=t.getExtension("WEBGL_debug_renderer_info"),r=n?t.getParameter(n.UNMASKED_VENDOR_WEBGL):null,o=n?t.getParameter(n.UNMASKED_RENDERER_WEBGL):null;return{vendor:r!=null?r:null,renderer:o!=null?o:null}},{vendor:null,renderer:null})}function Nl(){return j(()=>{if(typeof document=="undefined")return null;let e=document.createElement("canvas");e.width=220,e.height=40;let t=e.getContext("2d");return t?(t.textBaseline="top",t.font="14px 'Arial'",t.fillStyle="#f60",t.fillRect(0,0,60,20),t.fillStyle="#069",t.fillText("Atlas anti-bot \u2708 1.0",2,15),Bn(e.toDataURL())):null},null)}function zl(){var a;let e=rt(),t=zo?window:{},n=(a=e==null?void 0:e.userAgent)!=null?a:"",r=j(()=>(e==null?void 0:e.webdriver)===!0,!1),o=j(()=>"chrome"in t&&!!t.chrome,!1),i=/headless/i.test(n)||/chrome/i.test(n)&&!o&&j(()=>{var l,c;return((c=(l=e==null?void 0:e.plugins)==null?void 0:l.length)!=null?c:0)===0},!1),s=j(()=>r||"_phantom"in t||"callPhantom"in t||"__nightmare"in t||"domAutomation"in t||"domAutomationController"in t||typeof document!="undefined"&&Object.keys(document).some(l=>l.startsWith("cdc_")||l.startsWith("$cdc_"))||/electron|phantomjs|slimerjs/i.test(n),r);return{webdriver:r,headless:i,hasChrome:o,automationHint:s}}function Bl(){let e=rt(),t=Ul(),n=zl(),r=j(()=>{var i;return Array.from((i=e==null?void 0:e.languages)!=null?i:[])},[]),o=t.renderer;return{screenWidth:j(()=>{var i,s;return(s=(i=window.screen)==null?void 0:i.width)!=null?s:null},null),screenHeight:j(()=>{var i,s;return(s=(i=window.screen)==null?void 0:i.height)!=null?s:null},null),colorDepth:j(()=>{var i,s;return(s=(i=window.screen)==null?void 0:i.colorDepth)!=null?s:null},null),pixelRatio:j(()=>{var i;return(i=window.devicePixelRatio)!=null?i:null},null),timezone:j(()=>{var i;return(i=Intl.DateTimeFormat().resolvedOptions().timeZone)!=null?i:null},null),timezoneOffset:j(()=>new Date().getTimezoneOffset(),null),language:j(()=>{var i;return(i=e==null?void 0:e.language)!=null?i:null},null),languages:r,platform:j(()=>{var i;return(i=e==null?void 0:e.platform)!=null?i:null},null),hardwareConcurrency:j(()=>{var i;return(i=e==null?void 0:e.hardwareConcurrency)!=null?i:null},null),deviceMemory:j(()=>{var i;return(i=e==null?void 0:e.deviceMemory)!=null?i:null},null),maxTouchPoints:j(()=>{var i;return(i=e==null?void 0:e.maxTouchPoints)!=null?i:null},null),touchSupport:j(()=>{var i;return((i=e==null?void 0:e.maxTouchPoints)!=null?i:0)>0||"ontouchstart"in window},!1),cookieEnabled:j(()=>{var i;return(i=e==null?void 0:e.cookieEnabled)!=null?i:null},null),doNotTrack:j(()=>(e==null?void 0:e.doNotTrack)==="1"||(e==null?void 0:e.doNotTrack)==="yes",null),webglVendor:t.vendor,webglRenderer:o,pluginCount:j(()=>{var i,s;return(s=(i=e==null?void 0:e.plugins)==null?void 0:i.length)!=null?s:null},null),pointerType:j(()=>{var i,s;return(s=(i=window.matchMedia)==null?void 0:i.call(window,"(pointer: fine)"))!=null&&s.matches?"fine":"coarse"},null),webdriver:n.webdriver,headless:n.headless,hasChrome:n.hasChrome,webglSoftware:o?/swiftshader|llvmpipe|software|basic render/i.test(o):!1,automationHint:n.automationHint}}function jl(){var e;return(e=j(()=>{var o,i;let t=rt(),n=typeof window!="undefined"?window:void 0,r=(i=(o=t==null?void 0:t.doNotTrack)!=null?o:t==null?void 0:t.msDoNotTrack)!=null?i:n==null?void 0:n.doNotTrack;return r==="1"||r==="yes"},!1))!=null?e:!1}function zn(){return j(()=>{let e=()=>{var r,o;return"d_"+Bn(String(Math.random())+String(Date.now())+((o=(r=rt())==null?void 0:r.userAgent)!=null?o:""))};if(jl())return e();if(typeof localStorage=="undefined")return null;let t="__atlas_did",n=localStorage.getItem(t);return n||(n=e(),localStorage.setItem(t,n)),n},null)}function ql(e){let t=[e.timezone,e.platform,e.languages.join(","),e.webglVendor,e.webglRenderer,e.screenWidth,e.screenHeight,e.colorDepth,e.hardwareConcurrency,Nl()];return Bn(t.map(n=>n==null?"":String(n)).join("|"))}function Bn(e){let t=5381;for(let n=0;n<e.length;n+=1)t=(t<<5)+t+e.charCodeAt(n)>>>0;return t.toString(16).padStart(8,"0")}var St=e=>e.length?e.reduce((t,n)=>t+n,0)/e.length:null,Nn=e=>{let t=St(e);return t===null?null:e.reduce((n,r)=>n+(r-t)**2,0)/e.length},Ct=class{constructor(t){v(this,"start",Date.now());v(this,"firstInteraction",null);v(this,"moves",0);v(this,"distance",0);v(this,"maxSpeed",0);v(this,"speeds",[]);v(this,"lastX",null);v(this,"lastY",null);v(this,"lastMoveT",0);v(this,"netDx",0);v(this,"netDy",0);v(this,"keyCount",0);v(this,"downAt",new Map);v(this,"dwell",[]);v(this,"flight",[]);v(this,"lastUpAt",null);v(this,"pastes",0);v(this,"backspaces",0);v(this,"focusChanges",0);v(this,"scrolls",0);v(this,"target");v(this,"bound",[]);this.target=t!=null?t:typeof document!="undefined"?document:void 0,this.attach()}mark(){this.firstInteraction===null&&(this.firstInteraction=Date.now()-this.start)}attach(){let t=this.target;if(!t)return;let n=(r,o)=>{j(()=>t.addEventListener(r,o,{passive:!0}),void 0),this.bound.push([r,o])};n("pointermove",r=>this.onMove(r)),n("mousemove",r=>this.onMove(r)),n("keydown",r=>this.onKeyDown(r)),n("keyup",r=>this.onKeyUp(r)),n("paste",()=>{this.mark(),this.pastes+=1}),n("focusin",()=>{this.mark(),this.focusChanges+=1}),n("scroll",()=>{this.mark(),this.scrolls+=1})}onMove(t){var i,s;this.mark();let n=(i=t.clientX)!=null?i:0,r=(s=t.clientY)!=null?s:0,o=Date.now();if(this.lastX!==null&&this.lastY!==null){let a=n-this.lastX,l=r-this.lastY,c=Math.hypot(a,l);this.distance+=c,this.netDx+=a,this.netDy+=l;let d=o-this.lastMoveT;if(d>0){let u=c/d;this.speeds.push(u),u>this.maxSpeed&&(this.maxSpeed=u)}}this.moves+=1,this.lastX=n,this.lastY=r,this.lastMoveT=o}onKeyDown(t){this.mark(),this.keyCount+=1,t.key==="Backspace"&&(this.backspaces+=1),this.downAt.set(t.code||t.key||String(this.keyCount),Date.now()),this.lastUpAt!==null&&this.flight.push(Date.now()-this.lastUpAt)}onKeyUp(t){let n=t.code||t.key||"",r=this.downAt.get(n),o=Date.now();r!==void 0&&(this.dwell.push(o-r),this.downAt.delete(n)),this.lastUpAt=o}snapshot(){let t=Math.hypot(this.netDx,this.netDy);return{mouseMoves:this.moves,mouseDistance:Math.round(this.distance),mouseAvgSpeed:St(this.speeds),mouseMaxSpeed:Math.round(this.maxSpeed*1e3)/1e3,mouseSpeedVariance:Nn(this.speeds),mouseStraightLineRatio:this.distance>0?Math.min(1,t/this.distance):null,keyCount:this.keyCount,keyAvgDwellMs:St(this.dwell),keyAvgFlightMs:St(this.flight),keyDwellVariance:Nn(this.dwell),keyFlightVariance:Nn(this.flight),pasteCount:this.pastes,backspaceCount:this.backspaces,timeToFirstInteractionMs:this.firstInteraction,timeToSubmitMs:Date.now()-this.start,focusChanges:this.focusChanges,scrollCount:this.scrolls,hadPointerMove:this.moves>0,hadKeydown:this.keyCount>0,interactionCount:this.moves+this.keyCount+this.scrolls+this.focusChanges}}stop(){let t=this.target;if(t){for(let[n,r]of this.bound)j(()=>t.removeEventListener(n,r),void 0);this.bound=[]}}};async function Bo(e){return j(async()=>{var l,c,d;let t=Bl(),n={attempt_id:e.attemptId,kind:(l=e.kind)!=null?l:"telemetry",device_id:zn(),device_fingerprint:ql(t),device:t,behavior:(c=e.recorder)==null?void 0:c.snapshot()},r=`${e.api}/v1/client/telemetry?publishable_key=${encodeURIComponent(e.publishableKey)}`,o=JSON.stringify(n),i=rt();if(!e.fetchImpl&&i&&typeof i.sendBeacon=="function"&&typeof Blob!="undefined"&&i.sendBeacon(r,new Blob([o],{type:"application/json"})))return!0;let s=(d=e.fetchImpl)!=null?d:typeof fetch!="undefined"?fetch:void 0;return s?(await s(r,{method:"POST",headers:{"content-type":"application/json","x-publishable-key":e.publishableKey},body:o,keepalive:!0,credentials:"include"})).ok:!1},Promise.resolve(!1))}var Hl=[/^\/v1\/client\/sign_ups(\?|$)/,/^\/v1\/client\/sign_ins(\?|$)/,/^\/v1\/client\/me\/phone_numbers(\?|$)/,/^\/v1\/client\/me\/phone_numbers\/[^/]+\/prepare_verification(\?|$)/],jo=(e,t)=>t==="POST"&&Hl.some(n=>n.test(e));function Wl(e,t){let n=t.platform==="ios"?{p:"ios",n:e,a:t.assertion,r:t.receipt}:t.platform==="ios_devicecheck"?{p:"ios_dc",n:e,t:t.deviceToken}:{p:"android",n:e,t:t.integrityToken};return btoa(JSON.stringify(n)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function qo(e,t){let n=await e.request("/v1/client/attestation/challenge",{method:"POST",body:"{}"});return!n.ok||!n.data?null:Wl(n.data.nonce,await t.prove(n.data.nonce))}var Kl=["checkbox","scroll","link"];function te(e){return typeof e=="string"&&e!==""?e:null}function Gl(e){return typeof e=="number"&&Number.isFinite(e)?new Date(e).toISOString():te(e)}function qn(e){var l,c,d,u,p;if(!e||typeof e!="object")return null;let t=e,n=[t.version,t.current_version].find(f=>f&&typeof f=="object"),r=f=>t[f]!==void 0?t[f]:n==null?void 0:n[f],o=(l=te(t.key))!=null?l:te(t.policy),i=(c=te(r("version_id")))!=null?c:te(n==null?void 0:n.id);if(!o||!i)return null;let s=Kl.includes(t.display)?t.display:"checkbox",a=(d=te(typeof t.version=="string"?t.version:n==null?void 0:n.version))!=null?d:"";return{key:o,title:(u=te(t.title))!=null?u:o,display:s,required:t.required!==!1,appliesTo:t.applies_to==="sign_in_and_sign_up"?"sign_in_and_sign_up":"sign_up",versionId:i,version:a,contentHtml:te(r("content_html")),contentMarkdown:te(r("content_markdown")),contentUrl:te(r("content_url")),contentSha256:(p=te(r("content_sha256")))!=null?p:"",effectiveAt:Gl(r("effective_at")),summaryOfChanges:te(r("summary_of_changes")),reaccept:typeof t.reaccept=="boolean"?t.reaccept:null}}function Vl(e){var n;let t=Array.isArray(e)?e:e&&typeof e=="object"?(n=e.policies)!=null?n:e.data:null;return Array.isArray(t)?t.map(qn).filter(r=>r!==null):[]}function Hn(e){return!!(e!=null&&e.some(t=>t.code==="POLICY_ACCEPTANCE_REQUIRED"))}async function ot(e,t={}){let n=await Qr(e,t.locale?{locale:t.locale}:{});if(!n.ok)return[];let r=Vl(n.data);return t.signIn?r.filter(o=>o.appliesTo==="sign_in_and_sign_up"):r}function Ho(e){if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}var Ue=class{constructor(t=[],n={}){v(this,"list",[]);v(this,"entries",new Map);v(this,"open",null);v(this,"listeners",new Set);v(this,"now");v(this,"combined");var r;this.combined=n.combined!==!1,this.now=(r=n.now)!=null?r:()=>Date.now(),this.setPolicies(t)}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}emit(){for(let t of[...this.listeners])t()}entry(t){let n=this.list.find(i=>i.key===t),r=n?n.versionId:t,o=this.entries.get(r);return o||(o={checked:!1,scrolledToEnd:!1,viewMs:0,openedAt:null},this.entries.set(r,o)),o}get policies(){return this.list}get viewing(){var t;return(t=this.list.find(n=>n.key===this.open))!=null?t:null}snapshot(){let t=this.checkboxPolicies();return{policies:this.list,combined:this.combined,viewing:this.open,combinedChecked:t.length>0&&t.every(n=>this.isChecked(n.key))}}setPolicies(t){this.list=t,this.open&&!t.some(n=>n.key===this.open)&&(this.open=null),this.emit()}checkboxPolicies(){return this.list.filter(t=>t.display==="checkbox")}scrollPolicies(){return this.list.filter(t=>t.display==="scroll")}linkPolicies(){return this.list.filter(t=>t.display==="link")}isChecked(t){let n=this.list.find(r=>r.key===t);return n?n.display==="link"?!0:this.entry(t).checked:!1}setChecked(t,n){this.entry(t).checked=n,this.emit()}setAllChecked(t){for(let n of this.checkboxPolicies())this.entry(n.key).checked=t;this.emit()}acceptScroll(t){let n=this.entry(t);n.checked=!0,n.scrolledToEnd=!0,this.emit()}pendingScroll(){var t;return(t=this.scrollPolicies().find(n=>!this.isChecked(n.key)))!=null?t:null}openDocument(t){this.open&&this.closeDocument(),this.list.some(n=>n.key===t)&&(this.open=t,this.entry(t).openedAt=this.now(),this.emit())}closeDocument(){this.open&&(this.stopClock(this.open),this.open=null,this.emit())}startClock(t){let n=this.entry(t);n.openedAt===null&&(n.openedAt=this.now())}stopClock(t){let n=this.entry(t);n.openedAt!==null&&(n.viewMs+=Math.max(0,this.now()-n.openedAt),n.openedAt=null)}markScrolledToEnd(t){let n=this.entry(t);n.scrolledToEnd||(n.scrolledToEnd=!0,this.emit())}hasScrolledToEnd(t){return this.entry(t).scrolledToEnd}viewMs(t){let n=this.entry(t);return Math.round(n.viewMs+(n.openedAt!==null?Math.max(0,this.now()-n.openedAt):0))}missing(){return this.list.filter(t=>t.required&&!this.isChecked(t.key))}satisfied(){return this.missing().length===0}canSubmit(){return this.list.every(t=>!t.required||t.display==="scroll"||this.isChecked(t.key))}build(){let t=[];for(let n of this.list){if(!this.isChecked(n.key))continue;let r=this.entry(n.key),o=this.viewMs(n.key);t.push({policy:n.key,version_id:n.versionId,content_sha256:n.contentSha256,display:n.display,...n.display==="scroll"||r.scrolledToEnd?{scrolled_to_end:r.scrolledToEnd}:{},...o>0?{view_ms:o}:{}})}return t}};function Yl(e,t=2){return e.scrollHeight-e.clientHeight-e.scrollTop<=t}function Wn(e,t,n){let r=!1,o=null,i=()=>{r||(r=!0,a(),n())},s=()=>{Yl(e)&&i()},a=()=>{o==null||o.disconnect(),e.removeEventListener("scroll",s),typeof window!="undefined"&&window.removeEventListener("resize",s)};return t&&typeof IntersectionObserver!="undefined"&&(o=new IntersectionObserver(l=>{l.some(c=>c.isIntersecting)&&i()},{root:e,threshold:0}),o.observe(t)),e.addEventListener("scroll",s,{passive:!0}),typeof window!="undefined"&&window.addEventListener("resize",s),s(),()=>{r=!0,a()}}var Jl='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])';function Wo(e,t={}){var s;let n=e.ownerDocument,r=n.activeElement,o=a=>{if(a.key==="Escape"&&t.escape!==!0){a.preventDefault(),a.stopPropagation();return}if(a.key!=="Tab")return;let l=Array.from(e.querySelectorAll(Jl)).filter(p=>!p.hasAttribute("hidden"));if(l.length===0){a.preventDefault(),e.focus();return}let c=l[0],d=l[l.length-1],u=n.activeElement;a.shiftKey&&(u===c||!e.contains(u))?(a.preventDefault(),d.focus()):!a.shiftKey&&(u===d||!e.contains(u))&&(a.preventDefault(),c.focus())},i=a=>{var l;a.target instanceof Node&&!e.contains(a.target)&&((l=t.initialFocus)!=null?l:e).focus()};return n.addEventListener("keydown",o,!0),n.addEventListener("focusin",i),((s=t.initialFocus)!=null?s:e).focus(),()=>{var a;n.removeEventListener("keydown",o,!0),n.removeEventListener("focusin",i),(a=r==null?void 0:r.focus)==null||a.call(r)}}function Ql(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function jn(e){let t=Ql(e);return t=t.replace(/`([^`]+)`/g,"<code>$1</code>"),t=t.replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>"),t=t.replace(/(^|[^*])\*([^*\s][^*]*)\*/g,"$1<em>$2</em>"),t=t.replace(/\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g,'<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>'),t}function Zl(e){let t=e.replace(/\r\n?/g,`
|
|
3
|
+
`}async function Bo(e){var n;let t=(n=globalThis.navigator)==null?void 0:n.clipboard;if(!(t!=null&&t.writeText))return!1;try{return await t.writeText(e.join(`
|
|
4
|
+
`)),!0}catch{return!1}}function $n(){return typeof document!="undefined"&&typeof Blob!="undefined"&&typeof URL!="undefined"&&typeof URL.createObjectURL=="function"}function qo(e,t="recovery-codes.txt"){var r;if(!$n())return!1;let n=URL.createObjectURL(new Blob([$l(e)],{type:"text/plain;charset=utf-8"}));try{let o=document.createElement("a");return o.href=n,o.download=t,o.rel="noopener",o.style.display="none",((r=document.body)!=null?r:document.documentElement).appendChild(o),o.click(),o.remove(),!0}catch{return!1}finally{setTimeout(()=>URL.revokeObjectURL(n),0)}}var Ml=/^[A-Za-z0-9_-]{3,64}$/,Oe=e=>!!e&&typeof e=="object"&&!Array.isArray(e),Mn=e=>typeof e=="string"&&Ml.test(e.trim())?e.trim():null,Nn=["referalli","rewardful","tolt","promotekit","firstpromoter","partnerstack","dub"],Go=["atlasconsent","cookiemunch","onetrust","cookiebot","didomi","usercentrics","osano","cookieyes","complianz","klaro","tcf","consent_mode","gpc"];function A(e,t){try{return e!=null&&(typeof e=="object"||typeof e=="function")?e[t]:void 0}catch{return}}function ce(e,t,...n){try{return typeof e=="function"?e.apply(t,n):void 0}catch{return}}function it(e,t){if(!e)return null;for(let n of e.split(";")){let r=n.trim();if(r.startsWith(`${t}=`)){let o=r.slice(t.length+1);try{return decodeURIComponent(o)}catch{return o}}}return null}function Vo(e){if(typeof e=="number"&&Number.isFinite(e)&&e>0)return new Date(e<1e12?e*1e3:e).toISOString();if(typeof e=="string"&&e&&e.length<=40){if(/^\d{9,13}$/.test(e))return Vo(Number(e));let t=Date.parse(e);if(Number.isFinite(t))return new Date(t).toISOString()}}function xe(e,t,n,r,o){let i={source:e,code:Mn(t),clickId:Mn(n),anonId:Mn(r)},s=Vo(o);return s&&(i.capturedAt=s),i.code||i.clickId||i.anonId?i:null}var Ul={referalli:({win:e})=>{var r,o;let t=A(e,"aff"),n=ce(A(t,"getReferral"),t);return Oe(n)?xe("referalli",n.code,(r=n.clickId)!=null?r:n.click_id,(o=n.anonId)!=null?o:n.anon_id,n.ts):null},rewardful:({win:e})=>{let t=A(e,"Rewardful");return xe("rewardful",A(A(t,"affiliate"),"token"),A(t,"referral"),null)},tolt:({win:e})=>xe("tolt",null,A(e,"tolt_referral"),null),promotekit:({win:e})=>xe("promotekit",null,A(e,"promotekit_referral"),null),firstpromoter:({cookies:e})=>xe("firstpromoter",it(e,"_fprom_ref"),it(e,"_fprom_tid"),null),partnerstack:({cookies:e})=>xe("partnerstack",it(e,"ps_partner_key"),it(e,"ps_xid"),null),dub:({cookies:e})=>xe("dub",null,it(e,"dub_id"),null)};function zn(e){var n,r,o;if(typeof e!="function")return null;let t;try{t=e()}catch{return null}return Oe(t)?xe("custom",t.code,(n=t.clickId)!=null?n:t.click_id,(r=t.anonId)!=null?r:t.anon_id,(o=t.capturedAt)!=null?o:t.ts):null}function st(e,t){for(let n of t){let o=Ul[n==="referally"?"referalli":n];if(!o)continue;let i=null;try{i=o(e)}catch{i=null}if(i)return i}return null}var Nl={necessary:"necessary",essential:"necessary",strictly_necessary:"necessary",preferences:"preferences",functional:"preferences",functionality:"preferences",personalization:"preferences",statistics:"statistics",analytics:"statistics",performance:"statistics",marketing:"marketing",advertising:"marketing",advertisement:"marketing",targeting:"marketing",ads:"marketing"};function Yo(e){var t;return(t=Nl[e.trim().toLowerCase()])!=null?t:null}var ve=e=>typeof e=="boolean"?e:void 0;function me(e,t){return(n,r)=>{let o=t(r);if(o!==void 0)return o;let i=Yo(r),s=i?e[i]:void 0;return s?t(s):void 0}}var Un=null,Ho=!1;function jn(e){let t=A(e,"__tcfapi");Ho||typeof t!="function"||(Ho=!0,ce(t,e,"addEventListener",2,(n,r)=>{r&&Oe(n)&&(Un=n)}))}function zl(e){if(Un)return Un;let t=null;return ce(A(e,"__tcfapi"),e,"getTCData",2,(n,r)=>{r&&Oe(n)&&(t=n)}),t}var Wo={necessary:"necessary",preferences:"preferences",statistics:"statistics",marketing:"marketing"},Ko=(e,t)=>Array.isArray(e)&&e.includes(t),jl={atlasconsent:{present:e=>A(A(e,"__atlasConsent"),"version")===1&&typeof A(A(e,"__atlasConsent"),"has")=="function",ask:(e,t)=>{let n=A(e,"__atlasConsent"),r=ce(A(n,"has"),n,t);return r===!0?!0:r===!1?!1:void 0}},cookiemunch:{present:e=>Oe(A(A(e,"CookieMunch"),"consent")),ask:(e,t)=>{let n=A(A(e,"CookieMunch"),"consent");return me(Wo,r=>ve(A(n,r)))(e,t)}},onetrust:{present:e=>{var t;return typeof((t=A(e,"OnetrustActiveGroups"))!=null?t:A(e,"OptanonActiveGroups"))=="string"},ask:(e,t)=>{var r,o;let n=String((o=(r=A(e,"OnetrustActiveGroups"))!=null?r:A(e,"OptanonActiveGroups"))!=null?o:"").split(",").map(i=>i.trim()).filter(Boolean);return me({necessary:"C0001",statistics:"C0002",preferences:"C0003",marketing:"C0004"},i=>/^C\d{4}$/.test(i)||n.includes(i)?n.includes(i):void 0)(e,t)}},cookiebot:{present:e=>!A(e,"CookieMunch")&&Oe(A(A(e,"Cookiebot"),"consent")),ask:(e,t)=>{let n=A(A(e,"Cookiebot"),"consent");return me(Wo,r=>ve(A(n,r)))(e,t)}},didomi:{present:e=>typeof A(A(e,"Didomi"),"getUserStatus")=="function",ask:(e,t)=>{let n=A(e,"Didomi"),r=A(A(ce(A(n,"getUserStatus"),n),"purposes"),"global"),o=A(r,"enabled"),i=A(r,"disabled");return me({marketing:"cookies",statistics:"measure_content_performance"},s=>Ko(o,s)?!0:Ko(i,s)?!1:void 0)(e,t)}},usercentrics:{present:e=>typeof A(A(e,"UC_UI"),"getServicesBaseInfo")=="function",ask:(e,t)=>{let n=A(e,"UC_UI"),r=ce(A(n,"getServicesBaseInfo"),n);if(Array.isArray(r))return me({necessary:"essential",preferences:"functional",statistics:"functional",marketing:"marketing"},o=>{let i=r.filter(s=>A(s,"categorySlug")===o);return i.length?i.every(s=>A(A(s,"consent"),"status")===!0):void 0})(e,t)}},osano:{present:e=>typeof A(A(A(e,"Osano"),"cm"),"getConsent")=="function",ask:(e,t)=>{let n=A(A(e,"Osano"),"cm"),r=ce(A(n,"getConsent"),n);return me({necessary:"ESSENTIAL",preferences:"PERSONALIZATION",statistics:"ANALYTICS",marketing:"MARKETING"},o=>{var s;let i=(s=A(r,o))!=null?s:A(r,o.toUpperCase());return i==="ACCEPT"?!0:i==="DENY"?!1:void 0})(e,t)}},cookieyes:{present:e=>typeof A(e,"getCkyConsent")=="function",ask:(e,t)=>{let n=A(ce(A(e,"getCkyConsent"),e),"categories");return me({necessary:"necessary",preferences:"functional",statistics:"analytics",marketing:"advertisement"},r=>ve(A(n,r)))(e,t)}},complianz:{present:e=>typeof A(e,"cmplz_has_consent")=="function",ask:(e,t)=>me({necessary:"functional",preferences:"preferences",statistics:"statistics",marketing:"marketing"},n=>ve(ce(A(e,"cmplz_has_consent"),e,n)))(e,t)},klaro:{present:e=>typeof A(A(e,"klaro"),"getManager")=="function",ask:(e,t)=>{let n=A(e,"klaro"),r=A(ce(A(n,"getManager"),n),"consents");return ve(A(r,t))}},tcf:{present:e=>typeof A(e,"__tcfapi")=="function",ask:e=>{var n;let t=zl(e);if(t)return t.gdprApplies===!1?!0:(n=ve(A(A(A(t,"purpose"),"consents"),"1")))!=null?n:!1}},consent_mode:{present:e=>Oe(A(A(A(e,"google_tag_data"),"ics"),"entries")),ask:(e,t)=>{let n=A(A(A(e,"google_tag_data"),"ics"),"entries");return me({preferences:"functionality_storage",statistics:"analytics_storage",marketing:"ad_storage"},r=>{var i;let o=A(n,r);return(i=ve(A(o,"update")))!=null?i:ve(A(o,"default"))})(e,t)}},gpc:{present:e=>A(A(e,"navigator"),"globalPrivacyControl")===!0,ask:(e,t)=>t==="marketing"||t==="referrals"?!1:void 0}};function Bl(e){let t=e;if(typeof e=="function")try{t=e()}catch{t=void 0}if(t==="granted"||t===!0)return!0;if(t==="denied"||t===!1)return!1}function at(e,t,n={}){let r=n.provider||"auto",o=()=>{let a=Bl(n.appConsent);return a===void 0?{granted:!1,by:"none"}:{granted:a,by:"app"}};if(r==="app")return o();let i=r==="auto"?Go:[r],s=t.filter(a=>typeof a=="string"&&a.trim().length>0);for(let a of i){let l=jl[a],c=!1;try{c=!!l&&l.present(e)}catch{c=!1}if(!(!l||!c)){for(let d of s){let u;try{u=l.ask(e,d)}catch{u=void 0}if(u!==void 0)return{granted:u,by:a}}return{granted:!1,by:a}}}return o()}var Jo=new Set(["referalli","rewardful","tolt","promotekit"]),Qo=["referalli"],Xo=Object.freeze({enabled:!1,sources:[],consentProvider:"auto",urlParams:[],contextCookie:null,contextCookies:[],consentCategory:"referrals",consentFallbackCategory:"marketing",challengeReferredSignups:"inherit",codeLookupUrl:null,signupCodeField:!1}),ql=/^[A-Za-z0-9_-]{3,64}$/,Hl=/^[A-Za-z0-9_.-]{1,40}$/,Wl=/^[A-Za-z0-9_.-]{1,64}$/,lt=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function we(e){if(typeof e!="string")return null;let t=e.trim();return ql.test(t)?t:null}function Zo(e){var i;let t=lt(e)&<(e.referrals)?e.referrals:e;if(!lt(t)||t.enabled!==!0)return{...Xo,urlParams:[],sources:[]};let n=Array.isArray(t.url_params)?t.url_params.filter(s=>typeof s=="string"&&Hl.test(s)).slice(0,10):[],r=Array.isArray(t.browser_sources)?t.browser_sources.filter(s=>typeof s=="string"&&/^[a-z0-9_]{1,40}$/.test(s)).map(s=>s==="referally"?"referalli":s).slice(0,20):[...Qo],o=(Array.isArray(t.context_cookies)?t.context_cookies:typeof t.context_cookie=="string"?[t.context_cookie]:[]).filter(s=>typeof s=="string"&&Wl.test(s)).filter((s,a,l)=>l.indexOf(s)===a).slice(0,5);return{enabled:!0,sources:r,consentProvider:typeof t.consent_provider=="string"&&/^[a-z0-9_]{1,40}$/.test(t.consent_provider)?t.consent_provider:"auto",urlParams:n.length?n:["ref","via","aff"],contextCookie:(i=o[0])!=null?i:null,contextCookies:o,consentCategory:typeof t.consent_category=="string"&&t.consent_category?t.consent_category:"referrals",consentFallbackCategory:typeof t.consent_fallback_category=="string"&&t.consent_fallback_category?t.consent_fallback_category:null,challengeReferredSignups:t.challenge_referred_signups==="always"?"always":"inherit",codeLookupUrl:typeof t.code_lookup_url=="string"&&/^https?:\/\//i.test(t.code_lookup_url)&&t.code_lookup_url.includes("{code}")?t.code_lookup_url:null,signupCodeField:t.signup_code_field===!0}}function Kl(e,t){if(!e)return null;let n;try{n=new URLSearchParams(e)}catch{return null}for(let r of t){let o=we(n.get(r));if(o)return o}return null}function Gl(e,t){let n=[],r=o=>{o&&!n.includes(o)&&n.push(o)};for(let o of e)r(o);for(let o of e){let i;try{i=new URLSearchParams(o)}catch{continue}for(let s of["redirect_url","after_url","redirect_url_complete","after_sign_up_url","after_sign_in_url"]){let a=i.get(s);if(a)try{r(new URL(a,t!=null?t:"https://invalid.example").search)}catch{}}}return n}function Pt(e){if(typeof e=="number"&&Number.isFinite(e)&&e>0)return new Date(e<1e12?e*1e3:e).toISOString();if(typeof e!="string"||!e||e.length>40)return null;if(/^\d{9,13}$/.test(e))return Pt(Number(e));let t=Date.parse(e);return Number.isFinite(t)?new Date(t).toISOString():null}function Vl(e,t=Date.now()){var s,a,l;if(typeof e!="string"||!e||e.length>4096)return null;let n=e;try{n=decodeURIComponent(e)}catch{}let r=c=>{if(!c.startsWith("{"))return null;try{let d=JSON.parse(c);return lt(d)?d:null}catch{return null}},o=(s=r(e.trim()))!=null?s:r(n.trim());if(o){let c=Pt(o.exp);if(c&&Date.parse(c)<=t)return null;let d={code:we(o.code),clickId:we((a=o.clickId)!=null?a:o.click_id),anonId:we((l=o.anonId)!=null?l:o.anon_id)},u=Pt(o.ts);return u&&(d.capturedAt=u),d.code||d.clickId||d.anonId?d:null}let i=we(n);return i?{code:null,clickId:i,anonId:null}:null}function Yl(e,t){if(!e)return null;for(let n of e.split(";")){let r=n.trim();if(r.startsWith(`${t}=`))return r.slice(t.length+1)}return null}var Jl=["ref_click_id","ref_anon_id","ref_consent","ref_captured_at"];function Ql(e){if(!e)return null;let t;try{t=new URLSearchParams(e)}catch{return null}if(!Jl.some(i=>t.get(i)!==null))return null;let n=t.get("ref_consent")==="granted",r={code:we(t.get("ref")),clickId:we(t.get("ref_click_id")),anonId:we(t.get("ref_anon_id")),consentGranted:n},o=Pt(t.get("ref_captured_at"));return o&&(r.capturedAt=o),r.code||r.clickId||r.anonId?r:null}function Bn(e,t,n,r){var l;let i=!!(e.clickId||e.anonId)?t():null,s=!!(i!=null&&i.granted),a={code:e.code,click_id:s?e.clickId:null,anon_id:s?e.anonId:null,consent:s?"granted":"not_required",captured_at:(l=e.capturedAt)!=null?l:n,source:r,...i?{consent_by:i.by}:{}};return a.code||a.click_id||a.anon_id?a:null}function Xl(e){return e.win!==void 0?e.win:{CookieMunch:e.cookieMunch,aff:e.aff}}function Zl(e,t,n,r){var m,k,g;if(!e.enabled)return null;let o=(m=t.capturedAt)!=null?m:new Date().toISOString(),i=Xl(t),s,a=()=>s!=null?s:s=at(i,[e.consentCategory,e.consentFallbackCategory],{provider:e.consentProvider,appConsent:n}),l=_=>_?Bn(_,a,o,_.source):null,c=(k=e.sources)!=null?k:Qo,d={win:i,cookies:t.cookies},u=l(zn(r));if(u)return u;let p=l(st(d,c.filter(_=>Jo.has(_))));if(p)return p;let f=Gl(t.searches,t.base);for(let _ of f){let S=Ql(_);if(!S)continue;let x=Bn(S,()=>S.consentGranted?{granted:!0,by:"url"}:a(),o,"url");if(x)return x}for(let _ of f){let S=Kl(_,e.urlParams);if(S)return{code:S,click_id:null,anon_id:null,consent:"not_required",captured_at:o,source:"url"}}for(let _ of(g=e.contextCookies)!=null?g:e.contextCookie?[e.contextCookie]:[]){let S=Vl(Yl(t.cookies,_)),x=S?Bn(S,a,o,"cookie"):null;if(x)return x}return l(st(d,c.filter(_=>!Jo.has(_))))}var ec=new Set(["/v1/client/sign_ups","/v1/client/sign_ups/passkey","/v1/client/sign_ins","/v1/client/sign_ins/oauth","/v1/client/sign_ins/sso","/v1/client/sign_ins/saml","/v1/client/sign_ins/wsfed","/v1/client/sign_ins/discourse","/v1/client/sign_ins/id_token","/v1/client/sign_ins/id_token/nonce","/v1/client/sign_ins/external_jwt","/v1/client/sign_ins/ldap","/v1/client/sign_ins/passkey/finish","/v1/oauth/telegram","/v1/oauth/siwe/nonce","/v1/oauth/siwe/verify","/v1/oauth/siws/nonce","/v1/oauth/siws/verify","/v1/oauth/siwb/nonce","/v1/oauth/siwb/verify","/v1/oauth/siwf/nonce","/v1/oauth/siwf/verify"]),tc=/^\/v1\/client\/(sign_ins\/[^/]+\/(prepare_first_factor|attempt_first_factor)|sign_ups\/[^/]+\/(prepare_verification|attempt_verification|passkey\/finish))$/;function ei(e){var n;let t=(n=e.split("?")[0])!=null?n:e;return ec.has(t)||tc.test(t)}var je=()=>typeof window=="undefined"?null:window,Et=[],ze=null;function Hn(){var t,n;let e=(n=(t=je())==null?void 0:t.location)==null?void 0:n.search;!e||Et.includes(e)||(Et.push(e),ze!=null||(ze=new Date().toISOString()))}Hn();je()&&jn(je());var qn={};var Ne=new Map;function ti(e,t){return`${e!=null?e:""}|${t}`}function ni(e,t){!lt(t)||!("referrals"in t)||Ne.set(e,Promise.resolve(Zo(t)))}function ri(e){let t=Ne.get(e.referralCacheKey);if(!t){let n=e.referralCacheKey,r=()=>(Ne.get(n)===t&&Ne.delete(n),{...Xo,urlParams:[]});t=e.get("/v1/client/environment").then(o=>o.ok?Zo(o.data):r()).catch(r),Ne.set(n,t)}return t}function oi(e){var n,r,o;let t=je();return Ne.has(e.referralCacheKey)||!!((n=t==null?void 0:t.location)!=null&&n.search)||Et.length>0||zn(Wn(e).referralSource)!==null||st({win:t,cookies:(o=(r=t==null?void 0:t.document)==null?void 0:r.cookie)!=null?o:null},Nn)!==null}function Wn(e){var n,r,o;let t=e.referralOptions;return{referral:(n=t.referral)!=null?n:qn.referral,referralConsent:(r=t.referralConsent)!=null?r:qn.referralConsent,referralSource:(o=t.referralSource)!=null?o:qn.referralSource}}async function Kn(e){var r,o,i,s,a;let t=je();if(!t)return null;let n=Wn(e);if(n.referral===!1)return null;try{let l=(o=(r=t.location)==null?void 0:r.search)!=null?o:"";if(!oi(e))return null;let c=await ri(e);return c.enabled?(jn(t),Zl(c,{searches:[l,...Et],cookies:(s=(i=t.document)==null?void 0:i.cookie)!=null?s:null,win:t,base:(a=t.location)==null?void 0:a.href,capturedAt:ze!=null?ze:void 0},n.referralConsent,n.referralSource)):null}catch{return null}}async function Gn(e){if(!je()||Wn(e).referral===!1||!oi(e))return!1;try{if((await ri(e)).challengeReferredSignups!=="always")return!1;let n=await Kn(e);return!!(n!=null&&n.code)}catch{return!1}}var ii=typeof window!="undefined",ct=()=>typeof navigator!="undefined"?navigator:void 0;function q(e,t){try{return e()}catch{return t}}function nc(){return q(()=>{if(!ii||typeof document=="undefined")return{vendor:null,renderer:null};let e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");if(!t)return{vendor:null,renderer:null};let n=t.getExtension("WEBGL_debug_renderer_info"),r=n?t.getParameter(n.UNMASKED_VENDOR_WEBGL):null,o=n?t.getParameter(n.UNMASKED_RENDERER_WEBGL):null;return{vendor:r!=null?r:null,renderer:o!=null?o:null}},{vendor:null,renderer:null})}function rc(){return q(()=>{if(typeof document=="undefined")return null;let e=document.createElement("canvas");e.width=220,e.height=40;let t=e.getContext("2d");return t?(t.textBaseline="top",t.font="14px 'Arial'",t.fillStyle="#f60",t.fillRect(0,0,60,20),t.fillStyle="#069",t.fillText("Atlas anti-bot \u2708 1.0",2,15),Jn(e.toDataURL())):null},null)}function oc(){var a;let e=ct(),t=ii?window:{},n=(a=e==null?void 0:e.userAgent)!=null?a:"",r=q(()=>(e==null?void 0:e.webdriver)===!0,!1),o=q(()=>"chrome"in t&&!!t.chrome,!1),i=/headless/i.test(n)||/chrome/i.test(n)&&!o&&q(()=>{var l,c;return((c=(l=e==null?void 0:e.plugins)==null?void 0:l.length)!=null?c:0)===0},!1),s=q(()=>r||"_phantom"in t||"callPhantom"in t||"__nightmare"in t||"domAutomation"in t||"domAutomationController"in t||typeof document!="undefined"&&Object.keys(document).some(l=>l.startsWith("cdc_")||l.startsWith("$cdc_"))||/electron|phantomjs|slimerjs/i.test(n),r);return{webdriver:r,headless:i,hasChrome:o,automationHint:s}}function ic(){let e=ct(),t=nc(),n=oc(),r=q(()=>{var i;return Array.from((i=e==null?void 0:e.languages)!=null?i:[])},[]),o=t.renderer;return{screenWidth:q(()=>{var i,s;return(s=(i=window.screen)==null?void 0:i.width)!=null?s:null},null),screenHeight:q(()=>{var i,s;return(s=(i=window.screen)==null?void 0:i.height)!=null?s:null},null),colorDepth:q(()=>{var i,s;return(s=(i=window.screen)==null?void 0:i.colorDepth)!=null?s:null},null),pixelRatio:q(()=>{var i;return(i=window.devicePixelRatio)!=null?i:null},null),timezone:q(()=>{var i;return(i=Intl.DateTimeFormat().resolvedOptions().timeZone)!=null?i:null},null),timezoneOffset:q(()=>new Date().getTimezoneOffset(),null),language:q(()=>{var i;return(i=e==null?void 0:e.language)!=null?i:null},null),languages:r,platform:q(()=>{var i;return(i=e==null?void 0:e.platform)!=null?i:null},null),hardwareConcurrency:q(()=>{var i;return(i=e==null?void 0:e.hardwareConcurrency)!=null?i:null},null),deviceMemory:q(()=>{var i;return(i=e==null?void 0:e.deviceMemory)!=null?i:null},null),maxTouchPoints:q(()=>{var i;return(i=e==null?void 0:e.maxTouchPoints)!=null?i:null},null),touchSupport:q(()=>{var i;return((i=e==null?void 0:e.maxTouchPoints)!=null?i:0)>0||"ontouchstart"in window},!1),cookieEnabled:q(()=>{var i;return(i=e==null?void 0:e.cookieEnabled)!=null?i:null},null),doNotTrack:q(()=>(e==null?void 0:e.doNotTrack)==="1"||(e==null?void 0:e.doNotTrack)==="yes",null),webglVendor:t.vendor,webglRenderer:o,pluginCount:q(()=>{var i,s;return(s=(i=e==null?void 0:e.plugins)==null?void 0:i.length)!=null?s:null},null),pointerType:q(()=>{var i,s;return(s=(i=window.matchMedia)==null?void 0:i.call(window,"(pointer: fine)"))!=null&&s.matches?"fine":"coarse"},null),webdriver:n.webdriver,headless:n.headless,hasChrome:n.hasChrome,webglSoftware:o?/swiftshader|llvmpipe|software|basic render/i.test(o):!1,automationHint:n.automationHint}}function sc(){var e;return(e=q(()=>{var o,i;let t=ct(),n=typeof window!="undefined"?window:void 0,r=(i=(o=t==null?void 0:t.doNotTrack)!=null?o:t==null?void 0:t.msDoNotTrack)!=null?i:n==null?void 0:n.doNotTrack;return r==="1"||r==="yes"},!1))!=null?e:!1}function Yn(){return q(()=>{let e=()=>{var r,o;return"d_"+Jn(String(Math.random())+String(Date.now())+((o=(r=ct())==null?void 0:r.userAgent)!=null?o:""))};if(sc())return e();if(typeof localStorage=="undefined")return null;let t="__atlas_did",n=localStorage.getItem(t);return n||(n=e(),localStorage.setItem(t,n)),n},null)}function ac(e){let t=[e.timezone,e.platform,e.languages.join(","),e.webglVendor,e.webglRenderer,e.screenWidth,e.screenHeight,e.colorDepth,e.hardwareConcurrency,rc()];return Jn(t.map(n=>n==null?"":String(n)).join("|"))}function Jn(e){let t=5381;for(let n=0;n<e.length;n+=1)t=(t<<5)+t+e.charCodeAt(n)>>>0;return t.toString(16).padStart(8,"0")}var Rt=e=>e.length?e.reduce((t,n)=>t+n,0)/e.length:null,Vn=e=>{let t=Rt(e);return t===null?null:e.reduce((n,r)=>n+(r-t)**2,0)/e.length},Tt=class{constructor(t){v(this,"start",Date.now());v(this,"firstInteraction",null);v(this,"moves",0);v(this,"distance",0);v(this,"maxSpeed",0);v(this,"speeds",[]);v(this,"lastX",null);v(this,"lastY",null);v(this,"lastMoveT",0);v(this,"netDx",0);v(this,"netDy",0);v(this,"keyCount",0);v(this,"downAt",new Map);v(this,"dwell",[]);v(this,"flight",[]);v(this,"lastUpAt",null);v(this,"pastes",0);v(this,"backspaces",0);v(this,"focusChanges",0);v(this,"scrolls",0);v(this,"target");v(this,"bound",[]);this.target=t!=null?t:typeof document!="undefined"?document:void 0,this.attach()}mark(){this.firstInteraction===null&&(this.firstInteraction=Date.now()-this.start)}attach(){let t=this.target;if(!t)return;let n=(r,o)=>{q(()=>t.addEventListener(r,o,{passive:!0}),void 0),this.bound.push([r,o])};n("pointermove",r=>this.onMove(r)),n("mousemove",r=>this.onMove(r)),n("keydown",r=>this.onKeyDown(r)),n("keyup",r=>this.onKeyUp(r)),n("paste",()=>{this.mark(),this.pastes+=1}),n("focusin",()=>{this.mark(),this.focusChanges+=1}),n("scroll",()=>{this.mark(),this.scrolls+=1})}onMove(t){var i,s;this.mark();let n=(i=t.clientX)!=null?i:0,r=(s=t.clientY)!=null?s:0,o=Date.now();if(this.lastX!==null&&this.lastY!==null){let a=n-this.lastX,l=r-this.lastY,c=Math.hypot(a,l);this.distance+=c,this.netDx+=a,this.netDy+=l;let d=o-this.lastMoveT;if(d>0){let u=c/d;this.speeds.push(u),u>this.maxSpeed&&(this.maxSpeed=u)}}this.moves+=1,this.lastX=n,this.lastY=r,this.lastMoveT=o}onKeyDown(t){this.mark(),this.keyCount+=1,t.key==="Backspace"&&(this.backspaces+=1),this.downAt.set(t.code||t.key||String(this.keyCount),Date.now()),this.lastUpAt!==null&&this.flight.push(Date.now()-this.lastUpAt)}onKeyUp(t){let n=t.code||t.key||"",r=this.downAt.get(n),o=Date.now();r!==void 0&&(this.dwell.push(o-r),this.downAt.delete(n)),this.lastUpAt=o}snapshot(){let t=Math.hypot(this.netDx,this.netDy);return{mouseMoves:this.moves,mouseDistance:Math.round(this.distance),mouseAvgSpeed:Rt(this.speeds),mouseMaxSpeed:Math.round(this.maxSpeed*1e3)/1e3,mouseSpeedVariance:Vn(this.speeds),mouseStraightLineRatio:this.distance>0?Math.min(1,t/this.distance):null,keyCount:this.keyCount,keyAvgDwellMs:Rt(this.dwell),keyAvgFlightMs:Rt(this.flight),keyDwellVariance:Vn(this.dwell),keyFlightVariance:Vn(this.flight),pasteCount:this.pastes,backspaceCount:this.backspaces,timeToFirstInteractionMs:this.firstInteraction,timeToSubmitMs:Date.now()-this.start,focusChanges:this.focusChanges,scrollCount:this.scrolls,hadPointerMove:this.moves>0,hadKeydown:this.keyCount>0,interactionCount:this.moves+this.keyCount+this.scrolls+this.focusChanges}}stop(){let t=this.target;if(t){for(let[n,r]of this.bound)q(()=>t.removeEventListener(n,r),void 0);this.bound=[]}}};async function si(e){return q(async()=>{var l,c,d;let t=ic(),n={attempt_id:e.attemptId,kind:(l=e.kind)!=null?l:"telemetry",device_id:Yn(),device_fingerprint:ac(t),device:t,behavior:(c=e.recorder)==null?void 0:c.snapshot()},r=`${e.api}/v1/client/telemetry?publishable_key=${encodeURIComponent(e.publishableKey)}`,o=JSON.stringify(n),i=ct();if(!e.fetchImpl&&i&&typeof i.sendBeacon=="function"&&typeof Blob!="undefined"&&i.sendBeacon(r,new Blob([o],{type:"application/json"})))return!0;let s=(d=e.fetchImpl)!=null?d:typeof fetch!="undefined"?fetch:void 0;return s?(await s(r,{method:"POST",headers:{"content-type":"application/json","x-publishable-key":e.publishableKey},body:o,keepalive:!0,credentials:"include"})).ok:!1},Promise.resolve(!1))}var lc=[/^\/v1\/client\/sign_ups(\?|$)/,/^\/v1\/client\/sign_ins(\?|$)/,/^\/v1\/client\/me\/phone_numbers(\?|$)/,/^\/v1\/client\/me\/phone_numbers\/[^/]+\/prepare_verification(\?|$)/],ai=(e,t)=>t==="POST"&&lc.some(n=>n.test(e));function cc(e,t){let n=t.platform==="ios"?{p:"ios",n:e,a:t.assertion,r:t.receipt}:t.platform==="ios_devicecheck"?{p:"ios_dc",n:e,t:t.deviceToken}:{p:"android",n:e,t:t.integrityToken};return btoa(JSON.stringify(n)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function li(e,t){let n=await e.request("/v1/client/attestation/challenge",{method:"POST",body:"{}"});return!n.ok||!n.data?null:cc(n.data.nonce,await t.prove(n.data.nonce))}var dc=["checkbox","scroll","link"];function ne(e){return typeof e=="string"&&e!==""?e:null}function uc(e){return typeof e=="number"&&Number.isFinite(e)?new Date(e).toISOString():ne(e)}function Xn(e){var l,c,d,u,p;if(!e||typeof e!="object")return null;let t=e,n=[t.version,t.current_version].find(f=>f&&typeof f=="object"),r=f=>t[f]!==void 0?t[f]:n==null?void 0:n[f],o=(l=ne(t.key))!=null?l:ne(t.policy),i=(c=ne(r("version_id")))!=null?c:ne(n==null?void 0:n.id);if(!o||!i)return null;let s=dc.includes(t.display)?t.display:"checkbox",a=(d=ne(typeof t.version=="string"?t.version:n==null?void 0:n.version))!=null?d:"";return{key:o,title:(u=ne(t.title))!=null?u:o,display:s,required:t.required!==!1,appliesTo:t.applies_to==="sign_in_and_sign_up"?"sign_in_and_sign_up":"sign_up",versionId:i,version:a,contentHtml:ne(r("content_html")),contentMarkdown:ne(r("content_markdown")),contentUrl:ne(r("content_url")),contentSha256:(p=ne(r("content_sha256")))!=null?p:"",effectiveAt:uc(r("effective_at")),summaryOfChanges:ne(r("summary_of_changes")),reaccept:typeof t.reaccept=="boolean"?t.reaccept:null}}function pc(e){var n;let t=Array.isArray(e)?e:e&&typeof e=="object"?(n=e.policies)!=null?n:e.data:null;return Array.isArray(t)?t.map(Xn).filter(r=>r!==null):[]}function Zn(e){return!!(e!=null&&e.some(t=>t.code==="POLICY_ACCEPTANCE_REQUIRED"))}async function dt(e,t={}){let n=await io(e,t.locale?{locale:t.locale}:{});if(!n.ok)return[];let r=pc(n.data);return t.signIn?r.filter(o=>o.appliesTo==="sign_in_and_sign_up"):r}function ci(e){if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}var Be=class{constructor(t=[],n={}){v(this,"list",[]);v(this,"entries",new Map);v(this,"open",null);v(this,"listeners",new Set);v(this,"now");v(this,"combined");var r;this.combined=n.combined!==!1,this.now=(r=n.now)!=null?r:()=>Date.now(),this.setPolicies(t)}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}emit(){for(let t of[...this.listeners])t()}entry(t){let n=this.list.find(i=>i.key===t),r=n?n.versionId:t,o=this.entries.get(r);return o||(o={checked:!1,scrolledToEnd:!1,viewMs:0,openedAt:null},this.entries.set(r,o)),o}get policies(){return this.list}get viewing(){var t;return(t=this.list.find(n=>n.key===this.open))!=null?t:null}snapshot(){let t=this.checkboxPolicies();return{policies:this.list,combined:this.combined,viewing:this.open,combinedChecked:t.length>0&&t.every(n=>this.isChecked(n.key))}}setPolicies(t){this.list=t,this.open&&!t.some(n=>n.key===this.open)&&(this.open=null),this.emit()}checkboxPolicies(){return this.list.filter(t=>t.display==="checkbox")}scrollPolicies(){return this.list.filter(t=>t.display==="scroll")}linkPolicies(){return this.list.filter(t=>t.display==="link")}isChecked(t){let n=this.list.find(r=>r.key===t);return n?n.display==="link"?!0:this.entry(t).checked:!1}setChecked(t,n){this.entry(t).checked=n,this.emit()}setAllChecked(t){for(let n of this.checkboxPolicies())this.entry(n.key).checked=t;this.emit()}acceptScroll(t){let n=this.entry(t);n.checked=!0,n.scrolledToEnd=!0,this.emit()}pendingScroll(){var t;return(t=this.scrollPolicies().find(n=>!this.isChecked(n.key)))!=null?t:null}openDocument(t){this.open&&this.closeDocument(),this.list.some(n=>n.key===t)&&(this.open=t,this.entry(t).openedAt=this.now(),this.emit())}closeDocument(){this.open&&(this.stopClock(this.open),this.open=null,this.emit())}startClock(t){let n=this.entry(t);n.openedAt===null&&(n.openedAt=this.now())}stopClock(t){let n=this.entry(t);n.openedAt!==null&&(n.viewMs+=Math.max(0,this.now()-n.openedAt),n.openedAt=null)}markScrolledToEnd(t){let n=this.entry(t);n.scrolledToEnd||(n.scrolledToEnd=!0,this.emit())}hasScrolledToEnd(t){return this.entry(t).scrolledToEnd}viewMs(t){let n=this.entry(t);return Math.round(n.viewMs+(n.openedAt!==null?Math.max(0,this.now()-n.openedAt):0))}missing(){return this.list.filter(t=>t.required&&!this.isChecked(t.key))}satisfied(){return this.missing().length===0}canSubmit(){return this.list.every(t=>!t.required||t.display==="scroll"||this.isChecked(t.key))}build(){let t=[];for(let n of this.list){if(!this.isChecked(n.key))continue;let r=this.entry(n.key),o=this.viewMs(n.key);t.push({policy:n.key,version_id:n.versionId,content_sha256:n.contentSha256,display:n.display,...n.display==="scroll"||r.scrolledToEnd?{scrolled_to_end:r.scrolledToEnd}:{},...o>0?{view_ms:o}:{}})}return t}};function fc(e,t=2){return e.scrollHeight-e.clientHeight-e.scrollTop<=t}function er(e,t,n){let r=!1,o=null,i=()=>{r||(r=!0,a(),n())},s=()=>{fc(e)&&i()},a=()=>{o==null||o.disconnect(),e.removeEventListener("scroll",s),typeof window!="undefined"&&window.removeEventListener("resize",s)};return t&&typeof IntersectionObserver!="undefined"&&(o=new IntersectionObserver(l=>{l.some(c=>c.isIntersecting)&&i()},{root:e,threshold:0}),o.observe(t)),e.addEventListener("scroll",s,{passive:!0}),typeof window!="undefined"&&window.addEventListener("resize",s),s(),()=>{r=!0,a()}}var gc='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])';function di(e,t={}){var s;let n=e.ownerDocument,r=n.activeElement,o=a=>{if(a.key==="Escape"&&t.escape!==!0){a.preventDefault(),a.stopPropagation();return}if(a.key!=="Tab")return;let l=Array.from(e.querySelectorAll(gc)).filter(p=>!p.hasAttribute("hidden"));if(l.length===0){a.preventDefault(),e.focus();return}let c=l[0],d=l[l.length-1],u=n.activeElement;a.shiftKey&&(u===c||!e.contains(u))?(a.preventDefault(),d.focus()):!a.shiftKey&&(u===d||!e.contains(u))&&(a.preventDefault(),c.focus())},i=a=>{var l;a.target instanceof Node&&!e.contains(a.target)&&((l=t.initialFocus)!=null?l:e).focus()};return n.addEventListener("keydown",o,!0),n.addEventListener("focusin",i),((s=t.initialFocus)!=null?s:e).focus(),()=>{var a;n.removeEventListener("keydown",o,!0),n.removeEventListener("focusin",i),(a=r==null?void 0:r.focus)==null||a.call(r)}}function mc(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Qn(e){let t=mc(e);return t=t.replace(/`([^`]+)`/g,"<code>$1</code>"),t=t.replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>"),t=t.replace(/(^|[^*])\*([^*\s][^*]*)\*/g,"$1<em>$2</em>"),t=t.replace(/\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g,'<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>'),t}function hc(e){let t=e.replace(/\r\n?/g,`
|
|
5
5
|
`).split(`
|
|
6
|
-
`),n=[],r=[],o=null,i=()=>{r.length&&n.push(`<p>${
|
|
7
|
-
`)}function Ko(e){return e.contentHtml?e.contentHtml:e.contentMarkdown?Zl(e.contentMarkdown):""}function Go(e){if(!e)return"";let t=new Date(e);return Number.isNaN(t.getTime())?"":t.toISOString().slice(0,10)}var Xl=Object.freeze({"policy.agreeCombined":"I agree to the {policies}","policy.agreeOne":"I agree to the {policy}","policy.clickwrap":"By continuing you agree to the {policies}.","policy.and":"and","policy.read":"Read the {policy}","policy.viewerBack":"Back","policy.version":"Version {version}","policy.effective":"Effective {date}","policy.scrollHint":"Scroll to the end to accept","policy.accept":"Accept","policy.decline":"Decline","policy.summaryTitle":"What changed","policy.reacceptTitle":"{policy} has been updated","policy.reacceptIntro":"Please review and accept the updated terms to continue.","policy.pendingTitle":"Accept to continue","policy.pendingIntro":"Please accept the following to continue signing in.","policy.required":"Please accept the {policy} to continue.","policy.requiredGeneric":"Please accept the required policies to continue.","policy.declined":"You need to accept the {policy} to use this app.","policy.loading":"Loading\u2026","policy.bannerTitle":"Updated policies","policy.bannerBody":"We have updated: {policies}. Please review and accept.","policy.bannerGrace":"Accept by {date} to keep your access.","policy.bannerReview":"Review and accept","policy.submit":"Accept and continue"});function Vo(e){return(t,n={})=>{var i;let r=e(t,n);return r&&r!==t?r:((i=Xl[t])!=null?i:t).replace(/\{(\w+)\}/g,(s,a)=>{var l;return(l=n[a])!=null?l:s})}}function Kn(e,t){let n=e.indexOf(`{${t}}`);return n<0?[e,""]:[e.slice(0,n),e.slice(n+t.length+2)]}async function Yo(e,t,n={}){let r=Array.isArray(t==null?void 0:t.pending_policies)?t.pending_policies:[];if(r.length===0){let i=await ot(e,n);return new Ue(i.filter(s=>s.required),n)}let o=r.map(qn).filter(i=>i!==null);if(o.some(i=>!i.contentHtml&&!i.contentMarkdown)){let i=await ot(e,n);o=o.map((s,a)=>{var u,p,f,g;let l=i.find(m=>m.key===s.key);if(!l)return s;let c=(u=r.find(m=>{var h;return((h=qn(m))==null?void 0:h.key)===s.key}))!=null?u:r[a],d=m=>c[m]!==void 0&&c[m]!==null;return{...l,...d("title")?{title:s.title}:{},...d("display")?{display:s.display}:{},versionId:s.versionId,version:s.version||l.version,contentHtml:(p=s.contentHtml)!=null?p:l.contentHtml,contentMarkdown:(f=s.contentMarkdown)!=null?f:l.contentMarkdown,contentSha256:s.contentSha256||l.contentSha256,summaryOfChanges:(g=s.summaryOfChanges)!=null?g:l.summaryOfChanges,reaccept:s.reaccept}})}return new Ue(o.map(i=>({...i,required:!0})),n)}function Jo(e){if(typeof e!="string")return null;let t=e.trim().replace(/_/g,"-");return/^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$/.test(t)?t:null}var ec=new Set(["/v1/client/sign_ups","/v1/client/sign_ins/oauth","/v1/client/sign_ins/sso","/v1/client/sign_ins/saml","/v1/client/sign_ins/wsfed","/v1/client/sign_ins/discourse","/v1/client/sign_ins/id_token","/v1/client/sign_ins/external_jwt","/v1/client/sign_ins/ldap","/v1/oauth/telegram","/v1/oauth/game_platform","/v1/oauth/siwe/verify","/v1/oauth/siws/verify","/v1/oauth/siwb/verify","/v1/oauth/siwf/verify"]),At=class{constructor(t){this.options=t;Ln(),t.persistence&&wn(t.persistence),t.exposeSession!==!1&&typeof window!="undefined"&&ni(this)}get referralCacheKey(){return $o(this.options.baseUrl,this.options.publishableKey)}get referralOptions(){return{referral:this.options.referral,referralConsent:this.options.referralConsent,referralSource:this.options.referralSource}}get publishableKey(){return this.options.publishableKey}urlFor(t){return`${this.options.baseUrl||(typeof window!="undefined"?window.location.origin:"")}${t}`}get locale(){return Jo(this.options.locale)}get frontendApiOrigin(){let t=this.options.baseUrl;if(!t)return"";try{return new URL(t).origin}catch{return""}}async request(t,n={}){var u,p,f,g,m,h;let r=Cn(this.options.publishableKey,(u=this.options.fetchImpl)!=null?u:fetch),o=this.locale,i=(p=this.options.sdk)!=null?p:ro,s,a=this.options.attestation,l=a&&jo(t,((f=n.method)!=null?f:"GET").toUpperCase())?await qo(this,a):null;try{s=await r(`${(g=this.options.baseUrl)!=null?g:""}${t}`,{...n,credentials:(m=n.credentials)!=null?m:"include",headers:{"x-publishable-key":this.options.publishableKey,[oo]:io(i),...o?{"accept-language":o}:{},...l?{"atlas-attestation":l}:{},...n.body?{"content-type":"application/json"}:{},...n.headers}})}catch{return{ok:!1,status:0,data:null,errors:[{code:"NETWORK",reason:"network",message:"We could not reach the server."}]}}so(s,i);let c=null;try{c=await s.json()}catch{}let d=t.split("?")[0];return s.ok&&((h=n.method)!=null?h:"GET")==="GET"&&(d==="/v1/client/environment"||d==="/v1/appearance")&&Mo(this.referralCacheKey,c),{ok:s.ok,status:s.status,data:s.ok?c:null,errors:s.ok?[]:eo(c)}}async post(t,n){let r=n;if(r!==null&&typeof r=="object"&&!Array.isArray(r)&&!("referral"in r)&&Lo(t)){let i=await Mn(this);i&&(r={...r,referral:i})}let o=t.split("?")[0];if(o!==void 0&&ec.has(o)&&r!==null&&typeof r=="object"&&!Array.isArray(r)&&!("device_id"in r)){let i=zn();i&&(r={...r,device_id:i})}return this.request(t,{method:"POST",body:r===void 0?void 0:JSON.stringify(r)})}get(t){return this.request(t,{method:"GET"})}};async function Qo(e,t,n){var o;let r=await e.post(`/v1/client/sessions/${encodeURIComponent(t)}/tokens/${encodeURIComponent(n)}`);return!r.ok||!((o=r.data)!=null&&o.jwt)?null:{jwt:r.data.jwt,expiresIn:r.data.expires_in}}function tc(e={}){var r;let t=new URLSearchParams;e.spaceId&&t.set("space_id",e.spaceId);for(let[o,i]of Object.entries((r=e.audienceParams)!=null?r:{}))typeof i=="string"&&i&&t.set(o,i);e.cbid&&t.set("cbid",e.cbid),e.audience&&t.set("audience",e.audience);let n=t.toString();return n?`?${n}`:""}async function Zo(e,t,n,r={}){var a;let o=tc(r),i=await e.post(`/v1/client/sessions/${encodeURIComponent(t)}/integration_tokens/${encodeURIComponent(n)}${o}`);if(!i.ok||!((a=i.data)!=null&&a.jwt))return null;let s=i.data;return{jwt:s.jwt,expiresIn:s.expires_in,integration:s.integration,audience:s.audience,...s.org_id?{orgId:s.org_id}:{},...s.space_id?{spaceId:s.space_id}:{},...s.redeem_url?{redeemUrl:s.redeem_url}:{}}}var Y={attempt:null,errors:[],busy:!1,pollSecret:null,ticket:null,prepared:null};function nc(e,t){var o,i,s,a,l,c,d,u,p,f,g,m,h,w,C,S,A;if(!e)return{path:"/v1/client/sign_ins",body:{identifier:(o=t.identifier)!=null?o:"",...t.captcha_token?{captcha_token:t.captcha_token}:{}}};let n=X(e),r=(i=e.id)!=null?i:"";switch(n.kind){case"collect_identifier":return{path:"/v1/client/sign_ins",body:{identifier:(s=t.identifier)!=null?s:"",...t.captcha_token?{captcha_token:t.captcha_token}:{}}};case"collect_first_factor":return t.code?{path:`/v1/client/sign_ins/${r}/attempt_first_factor`,body:{strategy:"email_code",code:t.code}}:{path:`/v1/client/sign_ins/${r}/attempt_first_factor`,body:{strategy:"password",password:(a=t.password)!=null?a:""}};case"collect_second_factor":return t.strategy==="duo"?{path:`/v1/client/sign_ins/${r}/attempt_second_factor`,body:{strategy:"duo",...t.remember_device==="true"?{remember_device:!0}:{}}}:{path:`/v1/client/sign_ins/${r}/attempt_second_factor`,body:{code:(l=t.code)!=null?l:"",...t.strategy==="custom_challenge"?{strategy:"custom_challenge"}:{},...t.remember_device==="true"?{remember_device:!0}:{}}};case"enroll_second_factor":return t.enrollStrategy==="phone_code"?{path:`/v1/client/sign_ins/${r}/attempt_mfa_enrollment`,body:{factor_id:(c=t.factorId)!=null?c:"",code:(d=t.code)!=null?d:""}}:{path:`/v1/client/sign_ins/${r}/attempt_mfa_enrollment`,body:{factor_id:(u=t.factorId)!=null?u:"",codes:[(p=t.code)!=null?p:"",(f=t.secondCode)!=null?f:""]}};case"collect_email_code":return{path:`/v1/client/sign_ups/${r}/attempt_verification`,body:{code:(g=t.code)!=null?g:""}};case"collect_captcha":return t.captcha_token?{path:"/v1/client/sign_ins",body:{identifier:(m=t.identifier)!=null?m:"",captcha_token:t.captcha_token}}:null;case"collect_new_password":return{path:`/v1/client/password_resets/${r}/set_new_password`,body:{password:(h=t.password)!=null?h:""}};case"accept_policies":return{path:`/v1/client/sign_ins/${r}/accept_policies`,body:Zr({policyToken:t.policy_acceptance_token,attempt:e,pollSecret:t.poll_secret},Ho(t.policy_acceptances))};case"complete_required_action":{let k=(C=(w=e==null?void 0:e.pending_required_actions)==null?void 0:w[0])==null?void 0:C.action,y={action:(A=(S=t.action)!=null?S:k)!=null?A:""};for(let _ of["password","first_name","last_name","username","step","code","redirect_url","required_action_token","poll_secret"])t[_]!==void 0&&(y[_]=t[_]);let x={};for(let[_,R]of Object.entries(t))_.startsWith("field:")&&(x[_.slice(6)]=R);return Object.keys(x).length>0&&(y.fields=x),t.skip==="true"&&(y.skip=!0),{path:`/v1/client/sign_ins/${r}/required_actions`,body:y}}case"await_oauth":case"done":case"restart":case"unknown":return null}}function Pt(e){return e?{...Y,attempt:{id:e.id,status:e.status},...e.policyToken?{policyToken:e.policyToken}:{}}:Y}async function it(e,t,n){var p,f,g,m,h;let r=t.attempt?X(t.attempt).kind:null,o=r==="accept_policies"||r==="complete_required_action",i={};r==="accept_policies"&&t.policyToken&&n.policy_acceptance_token===void 0&&(i.policy_acceptance_token=t.policyToken),r==="complete_required_action"&&t.policyToken&&n.required_action_token===void 0&&(i.required_action_token=t.policyToken),o&&t.pollSecret&&n.poll_secret===void 0&&(i.poll_secret=t.pollSecret);let s=nc(t.attempt,{...n,...i});if(!s)return t;let a=await e.post(s.path,s.body);if(!a.ok||!a.data){let w=a.errors.map(C=>{var S;return(S=C.meta)==null?void 0:S.verification_attempt_id}).find(C=>typeof C=="string");return{...t,busy:!1,errors:a.errors,...w?{passwordHold:{attemptId:w,email:null,released:!1}}:{}}}let{backup_codes:l,...c}=a.data,d=vo(l),u=c.id===((p=t.attempt)==null?void 0:p.id)&&c.status===((f=t.attempt)==null?void 0:f.status);return{attempt:c,errors:[],busy:!1,pollSecret:t.pollSecret,ticket:(g=c.ticket)!=null?g:null,prepared:u&&(m=t.prepared)!=null?m:null,...c.existing_account||t.existingAccount?{existingAccount:!0}:{},...d?{recoveryCodes:d}:{},...c.policy_acceptance_token||c.required_action_token?{policyToken:(h=c.policy_acceptance_token)!=null?h:c.required_action_token}:u&&t.policyToken&&c.status==="needs_required_action"?{policyToken:t.policyToken}:{}}}async function Gn(e,t){var o,i,s;let n=t.fields&&Object.keys(t.fields).length>0,r=await e.post("/v1/client/sign_ups",{email:t.email,password:t.password,...n?{fields:t.fields}:{},...t.consent?{consent:!0}:{},...t.captchaToken?{captcha_token:t.captchaToken}:{},...t.username?{username:t.username}:{},...t.policyAcceptances&&t.policyAcceptances.length>0?{policy_acceptances:t.policyAcceptances}:{}});return!r.ok||!r.data?{...Y,busy:!1,errors:r.errors}:{attempt:r.data,errors:[],busy:!1,pollSecret:(o=r.data.poll_secret)!=null?o:Y.pollSecret,ticket:(i=r.data.ticket)!=null?i:null,...r.data.policy_acceptance_token||r.data.required_action_token?{policyToken:(s=r.data.policy_acceptance_token)!=null?s:r.data.required_action_token}:{}}}async function Xo(e,t){var o;let n=(o=t.attempt)==null?void 0:o.id;if(!n)return t;let r=await e.post(`/v1/client/sign_ups/${n}/prepare_verification`,{});return r.ok?{...t,busy:!1,errors:[]}:{...t,busy:!1,errors:r.errors}}function Et(e,t){return!!e&&e.object==="sign_up_attempt"&&e.status==="needs_email_verification"&&t==="link"}async function ei(e,t,n,r={}){var s,a,l,c,d;let o=(s=t.attempt)==null?void 0:s.id;if(!o)return t;let i=await e.post(`/v1/client/sign_ins/${o}/prepare_first_factor`,{strategy:n,...r.crossDevice&&n==="email_link"?{cross_device:!0}:{}});return i.ok?{...t,busy:!1,errors:[],pollSecret:n==="email_link"&&(l=(a=i.data)==null?void 0:a.poll_secret)!=null?l:null,prepared:n,matchCode:(d=(c=i.data)==null?void 0:c.match_code)!=null?d:null}:{...t,busy:!1,errors:i.errors}}async function ti(e,t){var i,s,a,l;let n=(i=t.attempt)==null?void 0:i.id;if(!n||!t.pollSecret)return{state:t,ticket:null};let r=((s=t.attempt)==null?void 0:s.object)==="sign_up_attempt"?"sign_ups":"sign_ins",o=await e.get(`/v1/client/${r}/${n}?poll_secret=${encodeURIComponent(t.pollSecret)}`);if(!o.ok||!o.data)return{state:t,ticket:null};if(o.data.password_hold_released){let c=(a=o.data.identifier)!=null?a:null;return{state:{...t,attempt:o.data,pollSecret:null,prepared:null,passwordHold:{attemptId:n,email:c,released:!0}},ticket:null}}return{state:{...t,attempt:o.data},ticket:(l=o.data.ticket)!=null?l:null}}function Vn(e){if(!e.pollSecret||!e.attempt||Xr(e.attempt))return!1;let t=e.attempt;return!(t.object==="sign_up_attempt"&&t.status!=="needs_email_verification")}function Ne(e){var t,n;return((t=e.attempt)==null?void 0:t.status)==="complete"&&e.existingAccount===!0&&e.sessionKept===void 0&&!((n=e.recoveryCodes)!=null&&n.length)}function Yn(e){return{...e,existingAccount:!1,ticket:null}}function Rt(e){var t;return!!e&&e.object==="sign_up_attempt"&&e.status==="needs_first_factor"&&!((t=e.supported_first_factors)!=null?t:[]).includes("passkey")}var rc="atlas:session";function oc(e){return{atlas_user_id:e.id,...e.external_id?{atlas_external_id:e.external_id}:{}}}var Tt=null,ri;function ic(e){var s;if(typeof window=="undefined")return()=>{};let t={};Tt=t;let n=a=>e.getToken(a),r={getToken:n,getIdToken:n,get user(){return e.user()},get isSignedIn(){return e.user()!==null}},o={customerMetadata(){var l,c,d;let a=e.user();return a?oc({id:a.id,external_id:(d=(c=a.external_id)!=null?c:(l=e.externalId)==null?void 0:l.call(e))!=null?d:null}):null}},i=(s=window.Atlas)!=null?s:{};return window.Atlas=Object.assign(i,{session:r,billing:o}),()=>{if(Tt!==t)return;Tt=null;let a=window.Atlas;a&&(delete a.session,delete a.billing)}}function sc(e){typeof window=="undefined"||typeof window.dispatchEvent!="function"||typeof CustomEvent!="function"||ri===e||(ri=e,window.dispatchEvent(new CustomEvent(rc,{detail:{signedIn:e!==null,userId:e}})))}function ac(e){var t;try{let n=(t=e.split(".")[1])!=null?t:"",r=atob(n.replace(/-/g,"+").replace(/_/g,"/").padEnd(Math.ceil(n.length/4)*4,"="));return JSON.parse(r)}catch{return null}}function lc(e){let t=new _t,n=null,r=null,o=null,i=null,s=(c,d)=>{let u=ac(c),p=typeof(u==null?void 0:u.exp)=="number"?u.exp*1e3:Date.now()+3e4,f={jwt:c,expiresAt:p,sessionId:d};t.set(f),r=d,o=typeof(u==null?void 0:u.external_id)=="string"?u.external_id:null},a=async()=>{var d,u;let c=await e.get("/v1/client");!c.ok||!((d=c.data)!=null&&d.session)||!c.data.user?(n=null,r=null,o=null,t.clear()):(n=c.data.user,r=c.data.session.id,c.data.jwt&&s(c.data.jwt,r)),sc((u=n==null?void 0:n.id)!=null?u:null)},l=c=>(i!=null||(i=c().finally(()=>{i=null})),i);return{reload:()=>l(a),user:()=>n,externalId:()=>o,async getToken(c){var u,p,f,g,m,h,w,C;if(c!=null&&c.template||c!=null&&c.for)return r||await l(a),r?c.for?(p=(u=await Zo(e,r,c.for,c))==null?void 0:u.jwt)!=null?p:null:(g=(f=await Qo(e,r,c.template))==null?void 0:f.jwt)!=null?g:null:null;let d=t.get(5e3);if(d)return d.jwt;if(r){let S=await e.post(`/v1/client/sessions/${encodeURIComponent(r)}/tokens`);if(S.ok&&((m=S.data)!=null&&m.jwt))return s(S.data.jwt,(h=S.data.session_id)!=null?h:r),S.data.jwt}return await l(a),(C=(w=t.get(5e3))==null?void 0:w.jwt)!=null?C:null}}}function ni(e){if(Tt!==null)return;let t=lc(e);ic(t)}function oi(e){if(typeof BroadcastChannel=="undefined")return null;let t=new BroadcastChannel(e);return{post:n=>t.postMessage(n),subscribe(n){let r=o=>n(o.data);return t.addEventListener("message",r),()=>t.removeEventListener("message",r)},close:()=>t.close()}}function ii(e){if(typeof window=="undefined"||typeof window.localStorage=="undefined")return null;let t=`atlas:${e}`;return{post(n){try{window.localStorage.setItem(t,JSON.stringify({message:n,at:Date.now()})),window.localStorage.removeItem(t)}catch{}},subscribe(n){let r=o=>{if(!(o.key!==t||!o.newValue))try{n(JSON.parse(o.newValue).message)}catch{}};return window.addEventListener("storage",r),()=>window.removeEventListener("storage",r)},close:()=>{}}}function It(e){var r;let t=["email_code","email_link"].filter(o=>e.includes(o)),n=e.includes("password");return{password:n,email:t,autoSend:n?null:(r=t[0])!=null?r:null}}var vp=Object.freeze(["form_password_incorrect","form_code_incorrect","form_code_already_used","form_code_expired","form_code_max_attempts","form_link_invalid","form_identifier_not_found","form_identifier_exists","form_password_pwned","form_password_too_short","form_password_too_long","form_password_requires_uppercase","form_password_requires_lowercase","form_password_requires_number","form_password_requires_symbol","form_password_not_allowed","form_password_contains_identifier","form_password_same_as_current","form_password_reused","password_expired","email_not_verified","sign_in_token_invalid","too_many_attempts","too_many_requests","captcha_required","captcha_failed","captcha_unavailable","email_delivery_unavailable","strategy_disabled","sign_up_restricted","sign_up_denied","password_not_yet_usable","account_deleted","waitlisted","identifier_not_allowed","disposable_email_blocked","sso_required","sign_ins_disabled","sign_ups_disabled","high_risk_blocked","sms_region_blocked","github_team_required"]);function cc(e){return`error.${e}`}var dc="Something went wrong. Please try again.",uc=/^[a-z][a-z0-9_]{0,63}$/;function pc(e,t){let n=!0,r=e.replace(/\{(\w+)\}/g,(o,i)=>{let s=t&&Object.prototype.hasOwnProperty.call(t,i)?t[i]:void 0;return typeof s=="string"&&s!==""?s:typeof s=="number"&&Number.isFinite(s)?String(s):(n=!1,o)});return n?r:null}function Jn(e,t){if(!e)return null;let n;if(typeof e=="function"?n=e(t):n=Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0,typeof n!="string")return null;let r=n.trim();return r===""||r===t?null:n}function si(e,t,n){var i,s;let r=typeof e=="string"?{message:e}:e!=null?e:{},o=typeof r.reason=="string"?r.reason:"";if(o&&uc.test(o)){let a=Jn(t,cc(o)),l=a?pc(a,r.meta):null;if(l)return l}return typeof r.message=="string"&&r.message.trim()!==""?r.message:(s=(i=Jn(t,"error.generic"))!=null?i:Jn(n,"error.generic"))!=null?s:dc}function ai(e){if(!e||typeof e!="object")return;let t=e.locale;return typeof t=="string"&&t.trim()!==""?t:void 0}var Qn="atlas:oauth",fc="atlas_popup_result",li="atlas:oauth";function gc(e){return`${li}:${e}`}function ci(){let e=new Uint8Array(16),t=globalThis.crypto;if(t!=null&&t.getRandomValues)t.getRandomValues(e);else for(let r=0;r<e.length;r++)e[r]=Math.floor(Math.random()*256);let n="";for(let r of e)n+=String.fromCharCode(r);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function mc(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.id!="string"?!1:t.type==="atlas:oauth:result"?!!t.result&&typeof t.result=="object":t.type==="atlas:oauth:signed_in"||t.type==="atlas:oauth:ack"}function hc(e){var t;try{return(t=oi(e))!=null?t:ii(e)}catch{return null}}function di(e,t,n){let r=hc(e);if(!r)return Promise.resolve(!1);let o=ci();return new Promise(i=>{let s=!1,a=d=>{s||(s=!0,clearTimeout(c),l(),r.close(),i(d))},l=r.subscribe(d=>{mc(d)&&d.type==="atlas:oauth:ack"&&d.id===o&&a(!0)}),c=setTimeout(()=>a(!1),n);try{r.post({...t,id:o})}catch{a(!1)}})}function yc(e){if(!e||e.length<2)return null;let t=new URLSearchParams(e.replace(/^#/,"")).get(fc);if(!t)return null;try{let n=t.replace(/-/g,"+").replace(/_/g,"/"),r=atob(n+"=".repeat((4-n.length%4)%4)),o=Uint8Array.from(r,a=>a.charCodeAt(0)),i=JSON.parse(new TextDecoder().decode(o));if(!i||typeof i!="object")return null;let s=i;return s.v!==1||typeof s.n!="string"||!s.n||typeof s.type!="string"||!s.type.startsWith("atlas:oauth:")?null:{nonce:s.n,payload:s}}catch{return null}}async function ui(e={}){var o,i;let t=(o=e.win)!=null?o:typeof window!="undefined"?window:void 0;if(!t)return null;let n=yc(t.location.hash);if(!n)return null;try{t.history.replaceState(t.history.state,"",t.location.href.split("#")[0])}catch{}try{t.name=Qn}catch{}let r=await di(gc(n.nonce),{type:"atlas:oauth:result",result:n.payload},(i=e.ackTimeoutMs)!=null?i:1500);return r&&fi(t),{payload:n.payload,delivered:r}}async function pi(e={}){var o,i;let t=(o=e.win)!=null?o:typeof window!="undefined"?window:void 0;if(!t||t.name!==Qn)return!1;let n=await di(li,{type:"atlas:oauth:signed_in"},(i=e.ackTimeoutMs)!=null?i:1500),r=!1;try{r=!!t.opener&&!t.opener.closed}catch{r=!1}return!n&&!r?!1:(fi(t),!0)}function fi(e){try{e.close()}catch{}}var bc=["__atlas_attempt","__atlas_ticket","__atlas_status","__atlas_policy_token"];function gi(e){var r;if(!e||typeof e!="object")return null;let t=e,n=o=>typeof o=="string"?o:void 0;switch(t.type){case"atlas:oauth:complete":return{ticket:n(t.ticket),attemptId:n(t.attemptId)};case"atlas:oauth:error":return{error:(r=n(t.code))!=null?r:"error",continuationUrl:n(t.continuationUrl)};case"atlas:oauth:continue":return{status:n(t.status),attemptId:n(t.attemptId),continuationUrl:n(t.continuationUrl),...n(t.policyToken)?{policyToken:n(t.policyToken)}:{}};default:return null}}var Pp=5*6e4;function mi(e){let t=new URLSearchParams(e),n=t.get("__atlas_attempt");if(!n)return null;let r=t.get("__atlas_ticket"),o=t.get("__atlas_status");if(!r&&!o)return null;let i=t.get("__atlas_policy_token");return{attemptId:n,...r?{ticket:r}:{},...o?{status:o}:{},...(o==="needs_policy_acceptance"||o==="needs_required_action")&&i?{policyToken:i}:{}}}function Ot(e){let t=new URL(e);for(let n of bc)t.searchParams.delete(n);return t.toString()}var Rp=Object.freeze({entries:[],loading:!1,forbidden:!1,hasMore:!1});var kc=`.atlas-policy-consent{display:flex;flex-direction:column;gap:8px;font-size:.875rem;}
|
|
6
|
+
`),n=[],r=[],o=null,i=()=>{r.length&&n.push(`<p>${Qn(r.join(" "))}</p>`),r=[]},s=()=>{o&&n.push(`</${o}>`),o=null};for(let a of t){let l=/^(#{1,6})\s+(.*)$/.exec(a),c=/^\s*[-*+]\s+(.*)$/.exec(a),d=/^\s*\d+[.)]\s+(.*)$/.exec(a);if(l){i(),s();let u=l[1].length;n.push(`<h${u}>${Qn(l[2])}</h${u}>`)}else if(c||d){i();let u=c?"ul":"ol";o!==u&&(s(),n.push(`<${u}>`),o=u),n.push(`<li>${Qn((c!=null?c:d)[1])}</li>`)}else a.trim()===""?(i(),s()):(s(),r.push(a.trim()))}return i(),s(),n.join(`
|
|
7
|
+
`)}function ui(e){return e.contentHtml?e.contentHtml:e.contentMarkdown?hc(e.contentMarkdown):""}function pi(e){if(!e)return"";let t=new Date(e);return Number.isNaN(t.getTime())?"":t.toISOString().slice(0,10)}var yc=Object.freeze({"policy.agreeCombined":"I agree to the {policies}","policy.agreeOne":"I agree to the {policy}","policy.clickwrap":"By continuing you agree to the {policies}.","policy.and":"and","policy.read":"Read the {policy}","policy.viewerBack":"Back","policy.version":"Version {version}","policy.effective":"Effective {date}","policy.scrollHint":"Scroll to the end to accept","policy.accept":"Accept","policy.decline":"Decline","policy.summaryTitle":"What changed","policy.reacceptTitle":"{policy} has been updated","policy.reacceptIntro":"Please review and accept the updated terms to continue.","policy.pendingTitle":"Accept to continue","policy.pendingIntro":"Please accept the following to continue signing in.","policy.required":"Please accept the {policy} to continue.","policy.requiredGeneric":"Please accept the required policies to continue.","policy.declined":"You need to accept the {policy} to use this app.","policy.loading":"Loading\u2026","policy.bannerTitle":"Updated policies","policy.bannerBody":"We have updated: {policies}. Please review and accept.","policy.bannerGrace":"Accept by {date} to keep your access.","policy.bannerReview":"Review and accept","policy.submit":"Accept and continue"});function fi(e){return(t,n={})=>{var i;let r=e(t,n);return r&&r!==t?r:((i=yc[t])!=null?i:t).replace(/\{(\w+)\}/g,(s,a)=>{var l;return(l=n[a])!=null?l:s})}}function tr(e,t){let n=e.indexOf(`{${t}}`);return n<0?[e,""]:[e.slice(0,n),e.slice(n+t.length+2)]}async function gi(e,t,n={}){let r=Array.isArray(t==null?void 0:t.pending_policies)?t.pending_policies:[];if(r.length===0){let i=await dt(e,n);return new Be(i.filter(s=>s.required),n)}let o=r.map(Xn).filter(i=>i!==null);if(o.some(i=>!i.contentHtml&&!i.contentMarkdown)){let i=await dt(e,n);o=o.map((s,a)=>{var u,p,f,m;let l=i.find(k=>k.key===s.key);if(!l)return s;let c=(u=r.find(k=>{var g;return((g=Xn(k))==null?void 0:g.key)===s.key}))!=null?u:r[a],d=k=>c[k]!==void 0&&c[k]!==null;return{...l,...d("title")?{title:s.title}:{},...d("display")?{display:s.display}:{},versionId:s.versionId,version:s.version||l.version,contentHtml:(p=s.contentHtml)!=null?p:l.contentHtml,contentMarkdown:(f=s.contentMarkdown)!=null?f:l.contentMarkdown,contentSha256:s.contentSha256||l.contentSha256,summaryOfChanges:(m=s.summaryOfChanges)!=null?m:l.summaryOfChanges,reaccept:s.reaccept}})}return new Be(o.map(i=>({...i,required:!0})),n)}function mi(e){if(typeof e!="string")return null;let t=e.trim().replace(/_/g,"-");return/^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$/.test(t)?t:null}var bc=new Set(["/v1/client/sign_ups","/v1/client/sign_ins/oauth","/v1/client/sign_ins/sso","/v1/client/sign_ins/saml","/v1/client/sign_ins/wsfed","/v1/client/sign_ins/discourse","/v1/client/sign_ins/id_token","/v1/client/sign_ins/external_jwt","/v1/client/sign_ins/ldap","/v1/oauth/telegram","/v1/oauth/game_platform","/v1/oauth/siwe/verify","/v1/oauth/siws/verify","/v1/oauth/siwb/verify","/v1/oauth/siwf/verify"]),It=class{constructor(t){this.options=t;Hn(),t.persistence&&Rn(t.persistence),t.exposeSession!==!1&&typeof window!="undefined"&&vi(this)}get referralCacheKey(){return ti(this.options.baseUrl,this.options.publishableKey)}get referralOptions(){return{referral:this.options.referral,referralConsent:this.options.referralConsent,referralSource:this.options.referralSource}}get publishableKey(){return this.options.publishableKey}urlFor(t){return`${this.options.baseUrl||(typeof window!="undefined"?window.location.origin:"")}${t}`}get locale(){return mi(this.options.locale)}get frontendApiOrigin(){let t=this.options.baseUrl;if(!t)return"";try{return new URL(t).origin}catch{return""}}async request(t,n={}){var u,p,f,m,k,g;let r=In(this.options.publishableKey,(u=this.options.fetchImpl)!=null?u:fetch),o=this.locale,i=(p=this.options.sdk)!=null?p:uo,s,a=this.options.attestation,l=a&&ai(t,((f=n.method)!=null?f:"GET").toUpperCase())?await li(this,a):null;try{s=await r(`${(m=this.options.baseUrl)!=null?m:""}${t}`,{...n,credentials:(k=n.credentials)!=null?k:"include",headers:{"x-publishable-key":this.options.publishableKey,[po]:fo(i),...o?{"accept-language":o}:{},...l?{"atlas-attestation":l}:{},...n.body?{"content-type":"application/json"}:{},...n.headers}})}catch{return{ok:!1,status:0,data:null,errors:[{code:"NETWORK",reason:"network",message:"We could not reach the server."}]}}go(s,i);let c=null;try{c=await s.json()}catch{}let d=t.split("?")[0];return s.ok&&((g=n.method)!=null?g:"GET")==="GET"&&(d==="/v1/client/environment"||d==="/v1/appearance")&&ni(this.referralCacheKey,c),{ok:s.ok,status:s.status,data:s.ok?c:null,errors:s.ok?[]:ao(c)}}async post(t,n){let r=n;if(r!==null&&typeof r=="object"&&!Array.isArray(r)&&!("referral"in r)&&ei(t)){let i=await Kn(this);i&&(r={...r,referral:i})}let o=t.split("?")[0];if(o!==void 0&&bc.has(o)&&r!==null&&typeof r=="object"&&!Array.isArray(r)&&!("device_id"in r)){let i=Yn();i&&(r={...r,device_id:i})}return this.request(t,{method:"POST",body:r===void 0?void 0:JSON.stringify(r)})}get(t){return this.request(t,{method:"GET"})}};async function hi(e,t,n){var o;let r=await e.post(`/v1/client/sessions/${encodeURIComponent(t)}/tokens/${encodeURIComponent(n)}`);return!r.ok||!((o=r.data)!=null&&o.jwt)?null:{jwt:r.data.jwt,expiresIn:r.data.expires_in}}function kc(e={}){var r;let t=new URLSearchParams;e.spaceId&&t.set("space_id",e.spaceId);for(let[o,i]of Object.entries((r=e.audienceParams)!=null?r:{}))typeof i=="string"&&i&&t.set(o,i);e.cbid&&t.set("cbid",e.cbid),e.audience&&t.set("audience",e.audience);let n=t.toString();return n?`?${n}`:""}async function yi(e,t,n,r={}){var a;let o=kc(r),i=await e.post(`/v1/client/sessions/${encodeURIComponent(t)}/integration_tokens/${encodeURIComponent(n)}${o}`);if(!i.ok||!((a=i.data)!=null&&a.jwt))return null;let s=i.data;return{jwt:s.jwt,expiresIn:s.expires_in,integration:s.integration,audience:s.audience,...s.org_id?{orgId:s.org_id}:{},...s.space_id?{spaceId:s.space_id}:{},...s.redeem_url?{redeemUrl:s.redeem_url}:{}}}var X={attempt:null,errors:[],busy:!1,pollSecret:null,ticket:null,prepared:null};function _c(e,t){var o,i,s,a,l,c,d,u,p,f,m,k,g,_,S,x,w,P,C,y,h,R,E,D;if(!e)return{path:"/v1/client/sign_ins",body:{identifier:(o=t.identifier)!=null?o:"",...t.captcha_token?{captcha_token:t.captcha_token}:{}}};let n=ee(e),r=(i=e.id)!=null?i:"";switch(n.kind){case"collect_identifier":return{path:"/v1/client/sign_ins",body:{identifier:(s=t.identifier)!=null?s:"",...t.captcha_token?{captcha_token:t.captcha_token}:{}}};case"collect_first_factor":return t.code?{path:`/v1/client/sign_ins/${r}/attempt_first_factor`,body:{strategy:"email_code",code:t.code}}:{path:`/v1/client/sign_ins/${r}/attempt_first_factor`,body:{strategy:"password",password:(a=t.password)!=null?a:""}};case"collect_second_factor":return t.strategy==="duo"?{path:`/v1/client/sign_ins/${r}/attempt_second_factor`,body:{strategy:"duo",...t.remember_device==="true"?{remember_device:!0}:{}}}:{path:`/v1/client/sign_ins/${r}/attempt_second_factor`,body:{code:(l=t.code)!=null?l:"",...t.strategy==="custom_challenge"?{strategy:"custom_challenge"}:{},...t.remember_device==="true"?{remember_device:!0}:{}}};case"enroll_second_factor":if(t.enrollStrategy==="phone_code")return{path:`/v1/client/sign_ins/${r}/attempt_mfa_enrollment`,body:{factor_id:(c=t.factorId)!=null?c:"",code:(d=t.code)!=null?d:""}};if(t.enrollStrategy==="hotp"||t.enrollStrategy==="duo"||t.enrollStrategy==="yubikey"||t.enrollStrategy==="passkey"){let I=t.enrollStrategy;return{path:`/v1/client/sign_ins/${r}/attempt_mfa_enrollment`,body:I==="hotp"?{strategy:I,factor_id:(u=t.factorId)!=null?u:"",code:(p=t.code)!=null?p:""}:I==="duo"?{strategy:I,factor_id:(f=t.factorId)!=null?f:""}:I==="yubikey"?{strategy:I,otp:(m=t.otp)!=null?m:""}:{strategy:I,challenge:(k=t.challenge)!=null?k:"",attestation_object:(g=t.attestation_object)!=null?g:"",client_data_json:(_=t.client_data_json)!=null?_:""}}}return{path:`/v1/client/sign_ins/${r}/attempt_mfa_enrollment`,body:{factor_id:(S=t.factorId)!=null?S:"",codes:[(x=t.code)!=null?x:"",(w=t.secondCode)!=null?w:""]}};case"collect_email_code":return{path:`/v1/client/sign_ups/${r}/attempt_verification`,body:{code:(P=t.code)!=null?P:""}};case"collect_captcha":return t.captcha_token?{path:"/v1/client/sign_ins",body:{identifier:(C=t.identifier)!=null?C:"",captcha_token:t.captcha_token}}:null;case"collect_new_password":return{path:`/v1/client/password_resets/${r}/set_new_password`,body:{password:(y=t.password)!=null?y:""}};case"accept_policies":return{path:`/v1/client/sign_ins/${r}/accept_policies`,body:so({policyToken:t.policy_acceptance_token,attempt:e,pollSecret:t.poll_secret},ci(t.policy_acceptances))};case"complete_required_action":{let I=(R=(h=e==null?void 0:e.pending_required_actions)==null?void 0:h[0])==null?void 0:R.action,L={action:(D=(E=t.action)!=null?E:I)!=null?D:""};for(let H of["password","first_name","last_name","username","step","code","redirect_url","required_action_token","poll_secret"])t[H]!==void 0&&(L[H]=t[H]);let W={};for(let[H,Q]of Object.entries(t))H.startsWith("field:")&&(W[H.slice(6)]=Q);return Object.keys(W).length>0&&(L.fields=W),t.skip==="true"&&(L.skip=!0),{path:`/v1/client/sign_ins/${r}/required_actions`,body:L}}case"await_oauth":case"done":case"restart":case"unknown":return null}}function Ot(e){return e?{...X,attempt:{id:e.id,status:e.status},...e.policyToken?{policyToken:e.policyToken}:{}}:X}async function ut(e,t,n){var p,f,m,k,g,_;let r=t.attempt?ee(t.attempt).kind:null,o=r==="accept_policies"||r==="complete_required_action",i={};r==="accept_policies"&&t.policyToken&&n.policy_acceptance_token===void 0&&(i.policy_acceptance_token=t.policyToken),r==="complete_required_action"&&t.policyToken&&n.required_action_token===void 0&&(i.required_action_token=t.policyToken),o&&t.pollSecret&&n.poll_secret===void 0&&(i.poll_secret=t.pollSecret);let s=_c(t.attempt,{...n,...i});if(!s)return t;let a=await e.post(s.path,s.body);if(!a.ok||!a.data){let S=a.errors.map(x=>{var w;return(w=x.meta)==null?void 0:w.verification_attempt_id}).find(x=>typeof x=="string");return{...t,busy:!1,errors:a.errors,...S?{passwordHold:{attemptId:S,email:null,released:!1}}:{}}}let{backup_codes:l,...c}=a.data,d=zo(l),u=c.id===((p=t.attempt)==null?void 0:p.id)&&c.status===((f=t.attempt)==null?void 0:f.status);return(m=t.attempt)!=null&&m.id&&wn(c)&&fe(t.attempt.id),{attempt:c,errors:[],busy:!1,pollSecret:t.pollSecret,ticket:(k=c.ticket)!=null?k:null,prepared:u&&(g=t.prepared)!=null?g:null,...u&&t.matchCode?{matchCode:t.matchCode}:{},...c.existing_account||t.existingAccount?{existingAccount:!0}:{},...d?{recoveryCodes:d}:{},...c.policy_acceptance_token||c.required_action_token?{policyToken:(_=c.policy_acceptance_token)!=null?_:c.required_action_token}:u&&t.policyToken&&c.status==="needs_required_action"?{policyToken:t.policyToken}:{}}}async function nr(e,t){var i,s,a,l;let n=t.fields&&Object.keys(t.fields).length>0,r=await e.post("/v1/client/sign_ups",{email:t.email,password:t.password,...n?{fields:t.fields}:{},...t.consent?{consent:!0}:{},...t.captchaToken?{captcha_token:t.captchaToken}:{},...t.username?{username:t.username}:{},...t.policyAcceptances&&t.policyAcceptances.length>0?{policy_acceptances:t.policyAcceptances}:{}});if(!r.ok||!r.data)return{...X,busy:!1,errors:r.errors};let o=Te((i=r.data.id)!=null?i:"",r.data);return{attempt:r.data,errors:[],busy:!1,pollSecret:(s=r.data.poll_secret)!=null?s:X.pollSecret,ticket:(a=r.data.ticket)!=null?a:null,...o?{matchCode:o}:{},...r.data.policy_acceptance_token||r.data.required_action_token?{policyToken:(l=r.data.policy_acceptance_token)!=null?l:r.data.required_action_token}:{}}}async function bi(e,t){var s,a,l;let n=(s=t.attempt)==null?void 0:s.id;if(!n)return t;let r=await e.post(`/v1/client/sign_ups/${n}/prepare_verification`,{});if(!r.ok)return{...t,busy:!1,errors:r.errors};let o=(a=r.data)==null?void 0:a.poll_secret;if(!o)return{...t,busy:!1,errors:[]};let i=Te(n,(l=r.data)!=null?l:{});return i||fe(n),{...t,busy:!1,errors:[],pollSecret:o,matchCode:i}}function Ft(e,t){return!!e&&e.object==="sign_up_attempt"&&e.status==="needs_email_verification"&&t==="link"}async function ki(e,t,n,r={}){var s,a,l,c;let o=(s=t.attempt)==null?void 0:s.id;if(!o)return t;let i=await e.post(`/v1/client/sign_ins/${o}/prepare_first_factor`,{strategy:n});return i.ok?{...t,busy:!1,errors:[],pollSecret:n==="email_link"&&(l=(a=i.data)==null?void 0:a.poll_secret)!=null?l:null,prepared:n,matchCode:n==="email_link"?Te(o,(c=i.data)!=null?c:{}):null}:{...t,busy:!1,errors:i.errors}}async function _i(e,t){var s,a,l,c,d;let n=(s=t.attempt)==null?void 0:s.id;if(!n||!t.pollSecret)return{state:t,ticket:null};let r=((a=t.attempt)==null?void 0:a.object)==="sign_up_attempt"?"sign_ups":"sign_ins",o=await e.get(`/v1/client/${r}/${n}?poll_secret=${encodeURIComponent(t.pollSecret)}`);if(!o.ok||!o.data)return{state:t,ticket:null};if(o.data.password_hold_released){let u=(l=o.data.identifier)!=null?l:null;return fe(n),{state:{...t,attempt:o.data,pollSecret:null,prepared:null,matchCode:null,passwordHold:{attemptId:n,email:u,released:!0}},ticket:null}}let i={...t,attempt:o.data};return Lt(i)?{state:i,ticket:(c=o.data.ticket)!=null?c:null}:(fe(n),{state:{...i,matchCode:null},ticket:(d=o.data.ticket)!=null?d:null})}function Lt(e){if(!e.pollSecret||!e.attempt||wn(e.attempt))return!1;let t=e.attempt;return t.finished_elsewhere?!1:!(t.object==="sign_up_attempt"&&t.status!=="needs_email_verification")}function qe(e){var t,n;return((t=e.attempt)==null?void 0:t.status)==="complete"&&e.existingAccount===!0&&e.sessionKept===void 0&&!((n=e.recoveryCodes)!=null&&n.length)}function rr(e){return{...e,existingAccount:!1,ticket:null}}function He(e){var t;return!!e&&e.object==="sign_up_attempt"&&(e.finished_elsewhere===!0||e.status==="needs_first_factor"&&!((t=e.supported_first_factors)!=null?t:[]).includes("passkey"))}var vc="atlas:session";function xc(e){return{atlas_user_id:e.id,...e.external_id?{atlas_external_id:e.external_id}:{}}}var Dt=null,xi;function wc(e){var s;if(typeof window=="undefined")return()=>{};let t={};Dt=t;let n=a=>e.getToken(a),r={getToken:n,getIdToken:n,get user(){return e.user()},get isSignedIn(){return e.user()!==null}},o={customerMetadata(){var l,c,d;let a=e.user();return a?xc({id:a.id,external_id:(d=(c=a.external_id)!=null?c:(l=e.externalId)==null?void 0:l.call(e))!=null?d:null}):null}},i=(s=window.Atlas)!=null?s:{};return window.Atlas=Object.assign(i,{session:r,billing:o}),()=>{if(Dt!==t)return;Dt=null;let a=window.Atlas;a&&(delete a.session,delete a.billing)}}function Cc(e){typeof window=="undefined"||typeof window.dispatchEvent!="function"||typeof CustomEvent!="function"||xi===e||(xi=e,window.dispatchEvent(new CustomEvent(vc,{detail:{signedIn:e!==null,userId:e}})))}function Sc(e){var t;try{let n=(t=e.split(".")[1])!=null?t:"",r=atob(n.replace(/-/g,"+").replace(/_/g,"/").padEnd(Math.ceil(n.length/4)*4,"="));return JSON.parse(r)}catch{return null}}function Ac(e){let t=new Ct,n=null,r=null,o=null,i=null,s=(c,d)=>{let u=Sc(c),p=typeof(u==null?void 0:u.exp)=="number"?u.exp*1e3:Date.now()+3e4,f={jwt:c,expiresAt:p,sessionId:d};t.set(f),r=d,o=typeof(u==null?void 0:u.external_id)=="string"?u.external_id:null},a=async()=>{var d,u;let c=await e.get("/v1/client");!c.ok||!((d=c.data)!=null&&d.session)||!c.data.user?(n=null,r=null,o=null,t.clear()):(n=c.data.user,r=c.data.session.id,c.data.jwt&&s(c.data.jwt,r)),Cc((u=n==null?void 0:n.id)!=null?u:null)},l=c=>(i!=null||(i=c().finally(()=>{i=null})),i);return{reload:()=>l(a),user:()=>n,externalId:()=>o,async getToken(c){var u,p,f,m,k,g,_,S;if(c!=null&&c.template||c!=null&&c.for)return r||await l(a),r?c.for?(p=(u=await yi(e,r,c.for,c))==null?void 0:u.jwt)!=null?p:null:(m=(f=await hi(e,r,c.template))==null?void 0:f.jwt)!=null?m:null:null;let d=t.get(5e3);if(d)return d.jwt;if(r){let x=await e.post(`/v1/client/sessions/${encodeURIComponent(r)}/tokens`);if(x.ok&&((k=x.data)!=null&&k.jwt))return s(x.data.jwt,(g=x.data.session_id)!=null?g:r),x.data.jwt}return await l(a),(S=(_=t.get(5e3))==null?void 0:_.jwt)!=null?S:null}}}function vi(e){if(Dt!==null)return;let t=Ac(e);wc(t)}function wi(e){if(typeof BroadcastChannel=="undefined")return null;let t=new BroadcastChannel(e);return{post:n=>t.postMessage(n),subscribe(n){let r=o=>n(o.data);return t.addEventListener("message",r),()=>t.removeEventListener("message",r)},close:()=>t.close()}}function Ci(e){if(typeof window=="undefined"||typeof window.localStorage=="undefined")return null;let t=`atlas:${e}`;return{post(n){try{window.localStorage.setItem(t,JSON.stringify({message:n,at:Date.now()})),window.localStorage.removeItem(t)}catch{}},subscribe(n){let r=o=>{if(!(o.key!==t||!o.newValue))try{n(JSON.parse(o.newValue).message)}catch{}};return window.addEventListener("storage",r),()=>window.removeEventListener("storage",r)},close:()=>{}}}function $t(e){var r;let t=["email_code","email_link"].filter(o=>e.includes(o)),n=e.includes("password");return{password:n,email:t,autoSend:n?null:(r=t[0])!=null?r:null}}var Up=Object.freeze(["form_password_incorrect","form_code_incorrect","form_code_already_used","form_code_expired","form_code_max_attempts","form_link_invalid","form_identifier_not_found","form_identifier_exists","form_password_pwned","form_password_too_short","form_password_too_long","form_password_requires_uppercase","form_password_requires_lowercase","form_password_requires_number","form_password_requires_symbol","form_password_not_allowed","form_password_contains_identifier","form_password_same_as_current","form_password_reused","password_expired","email_not_verified","mfa_setup_unavailable","sign_in_token_invalid","too_many_attempts","too_many_requests","captcha_required","captcha_failed","captcha_unavailable","email_delivery_unavailable","strategy_disabled","sign_up_restricted","sign_up_denied","password_not_yet_usable","account_deleted","waitlisted","identifier_not_allowed","disposable_email_blocked","sso_required","sign_ins_disabled","sign_ups_disabled","high_risk_blocked","sms_region_blocked","github_team_required"]);function Pc(e){return`error.${e}`}var Ec="Something went wrong. Please try again.",Rc=/^[a-z][a-z0-9_]{0,63}$/;function Tc(e,t){let n=!0,r=e.replace(/\{(\w+)\}/g,(o,i)=>{let s=t&&Object.prototype.hasOwnProperty.call(t,i)?t[i]:void 0;return typeof s=="string"&&s!==""?s:typeof s=="number"&&Number.isFinite(s)?String(s):(n=!1,o)});return n?r:null}function or(e,t){if(!e)return null;let n;if(typeof e=="function"?n=e(t):n=Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0,typeof n!="string")return null;let r=n.trim();return r===""||r===t?null:n}function Si(e,t,n){var i,s;let r=typeof e=="string"?{message:e}:e!=null?e:{},o=typeof r.reason=="string"?r.reason:"";if(o&&Rc.test(o)){let a=or(t,Pc(o)),l=a?Tc(a,r.meta):null;if(l)return l}return typeof r.message=="string"&&r.message.trim()!==""?r.message:(s=(i=or(t,"error.generic"))!=null?i:or(n,"error.generic"))!=null?s:Ec}function Ai(e){if(!e||typeof e!="object")return;let t=e.locale;return typeof t=="string"&&t.trim()!==""?t:void 0}var ir="atlas:oauth",Ic="atlas_popup_result",Pi="atlas:oauth";function Oc(e){return`${Pi}:${e}`}function Ei(){let e=new Uint8Array(16),t=globalThis.crypto;if(t!=null&&t.getRandomValues)t.getRandomValues(e);else for(let r=0;r<e.length;r++)e[r]=Math.floor(Math.random()*256);let n="";for(let r of e)n+=String.fromCharCode(r);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Fc(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.id!="string"?!1:t.type==="atlas:oauth:result"?!!t.result&&typeof t.result=="object":t.type==="atlas:oauth:signed_in"||t.type==="atlas:oauth:ack"}function Lc(e){var t;try{return(t=wi(e))!=null?t:Ci(e)}catch{return null}}function Ri(e,t,n){let r=Lc(e);if(!r)return Promise.resolve(!1);let o=Ei();return new Promise(i=>{let s=!1,a=d=>{s||(s=!0,clearTimeout(c),l(),r.close(),i(d))},l=r.subscribe(d=>{Fc(d)&&d.type==="atlas:oauth:ack"&&d.id===o&&a(!0)}),c=setTimeout(()=>a(!1),n);try{r.post({...t,id:o})}catch{a(!1)}})}function Dc(e){if(!e||e.length<2)return null;let t=new URLSearchParams(e.replace(/^#/,"")).get(Ic);if(!t)return null;try{let n=t.replace(/-/g,"+").replace(/_/g,"/"),r=atob(n+"=".repeat((4-n.length%4)%4)),o=Uint8Array.from(r,a=>a.charCodeAt(0)),i=JSON.parse(new TextDecoder().decode(o));if(!i||typeof i!="object")return null;let s=i;return s.v!==1||typeof s.n!="string"||!s.n||typeof s.type!="string"||!s.type.startsWith("atlas:oauth:")?null:{nonce:s.n,payload:s}}catch{return null}}async function Ti(e={}){var o,i;let t=(o=e.win)!=null?o:typeof window!="undefined"?window:void 0;if(!t)return null;let n=Dc(t.location.hash);if(!n)return null;try{t.history.replaceState(t.history.state,"",t.location.href.split("#")[0])}catch{}try{t.name=ir}catch{}let r=await Ri(Oc(n.nonce),{type:"atlas:oauth:result",result:n.payload},(i=e.ackTimeoutMs)!=null?i:1500);return r&&Oi(t),{payload:n.payload,delivered:r}}async function Ii(e={}){var o,i;let t=(o=e.win)!=null?o:typeof window!="undefined"?window:void 0;if(!t||t.name!==ir)return!1;let n=await Ri(Pi,{type:"atlas:oauth:signed_in"},(i=e.ackTimeoutMs)!=null?i:1500),r=!1;try{r=!!t.opener&&!t.opener.closed}catch{r=!1}return!n&&!r?!1:(Oi(t),!0)}function Oi(e){try{e.close()}catch{}}var $c=["__atlas_attempt","__atlas_ticket","__atlas_status","__atlas_policy_token"];function Fi(e){var r;if(!e||typeof e!="object")return null;let t=e,n=o=>typeof o=="string"?o:void 0;switch(t.type){case"atlas:oauth:complete":return{ticket:n(t.ticket),attemptId:n(t.attemptId)};case"atlas:oauth:error":return{error:(r=n(t.code))!=null?r:"error",continuationUrl:n(t.continuationUrl)};case"atlas:oauth:continue":return{status:n(t.status),attemptId:n(t.attemptId),continuationUrl:n(t.continuationUrl),...n(t.policyToken)?{policyToken:n(t.policyToken)}:{}};default:return null}}var Hp=5*6e4;function Li(e){let t=new URLSearchParams(e),n=t.get("__atlas_attempt");if(!n)return null;let r=t.get("__atlas_ticket"),o=t.get("__atlas_status");if(!r&&!o)return null;let i=t.get("__atlas_policy_token");return{attemptId:n,...r?{ticket:r}:{},...o?{status:o}:{},...(o==="needs_policy_acceptance"||o==="needs_required_action")&&i?{policyToken:i}:{}}}function Mt(e){let t=new URL(e);for(let n of $c)t.searchParams.delete(n);return t.toString()}var Kp=Object.freeze({entries:[],loading:!1,forbidden:!1,hasMore:!1});var Mc=`.atlas-policy-consent{display:flex;flex-direction:column;gap:8px;font-size:.875rem;}
|
|
8
8
|
.atlas-policy-row{display:flex;gap:8px;align-items:flex-start;}
|
|
9
9
|
.atlas-policy-link{padding:0;font:inherit;color:var(--atlas-color-primary,#5b5bd6);background:none;border:0;cursor:pointer;text-decoration:underline;}
|
|
10
10
|
.atlas-policy-clickwrap{margin:0;font-size:.8125rem;color:var(--atlas-color-muted,#666);text-align:center;}
|
|
@@ -24,18 +24,18 @@
|
|
|
24
24
|
.atlas-policy-actions button{min-height:40px;padding:8px 16px;font:inherit;font-weight:600;border-radius:var(--atlas-border-radius,8px);cursor:pointer;border:1px solid var(--atlas-color-border,#e4e4e9);background:transparent;color:inherit;}
|
|
25
25
|
.atlas-policy-actions button.atlas-policy-accept{color:var(--atlas-color-text-on-primary,#fff);background:var(--atlas-color-primary,#5b5bd6);border-color:transparent;}
|
|
26
26
|
.atlas-policy-actions button:disabled{opacity:.55;cursor:not-allowed;}
|
|
27
|
-
.atlas-policy-banner{display:flex;flex-wrap:wrap;gap:8px;align-items:center;justify-content:space-between;padding:10px 14px;font-size:.875rem;border:1px solid var(--atlas-color-border,#e4e4e9);border-radius:var(--atlas-border-radius,8px);background:var(--atlas-color-surface,rgba(91,91,214,.08));}`,hi="atlas-policy-styles";function tr(e=document){if(e.getElementById(hi))return;let t=e.createElement("style");t.id=hi,t.textContent=kc,e.head.appendChild(t)}var _c=new Set(["SCRIPT","STYLE","IFRAME","OBJECT","EMBED","FORM","LINK","META","BASE","SVG","MATH"]);function vc(e){if(typeof document=="undefined"||typeof document.createElement!="function")return e.replace(/&/g,"&").replace(/</g,"<");let t=document.createElement("template");t.innerHTML=e;let n=r=>{for(let o of Array.from(r.children)){if(_c.has(o.tagName.toUpperCase())){o.remove();continue}for(let i of Array.from(o.attributes)){let s=i.name.toLowerCase(),a=i.value.trim().toLowerCase().replace(/[\s\u0000-\u001f]/g,"");(s.startsWith("on")||s==="style"||(s==="href"||s==="src"||s==="xlink:href")&&/^(javascript|data|vbscript):/.test(a))&&o.removeAttribute(i.name)}o.tagName==="A"&&(o.setAttribute("target","_blank"),o.setAttribute("rel","noopener noreferrer")),n(o)}};return n(t.content),t.innerHTML}function yi(e){return vc(Ko(e))}function N(e,t,n,r={},o){let i=e.createElement(t);n&&(i.className=n);for(let[s,a]of Object.entries(r))i.setAttribute(s,a);return o!==void 0&&(i.textContent=o),i}var V=(...e)=>e.filter(Boolean).join(" "),Xn=0,Zn=new WeakSet,Ft=new WeakMap;function er(e,t,n,r){var i;let o=N(e,"button",V("atlas-policy-link",(i=r.classes)==null?void 0:i.link),{type:"button","data-atlas-policy-open":t.key,"aria-haspopup":"dialog"},t.title);return o.addEventListener("click",s=>{s.preventDefault(),n.openDocument(t.key)}),o}function bi(e,t,n,r){let[o,i]=Kn(t,"policies"),s=e.createDocumentFragment();return s.append(o),n.forEach((a,l)=>{l>0&&s.append(l===n.length-1?` ${r} `:", "),s.append(a)}),s.append(i),s}function nr(e,t,n){var c;let r=(c=n.document)!=null?c:e.ownerDocument,{t:o,classes:i}=n,s=null,a=()=>{s==null||s(),s=null,e.textContent="",e.className=V("atlas-policy-consent",i==null?void 0:i.root),e.setAttribute("data-atlas-policies","");let d=t.viewing;if(d){e.append(xc(r,d,t,n,f=>s=f));return}let u=t.checkboxPolicies();if(u.length===0)return;let p=o("policy.and");if(t.combined){let f=`atlas-policy-${++Xn}`,g=N(r,"div","atlas-policy-row atlas-consent"),m=N(r,"input",V("atlas-policy-checkbox",i==null?void 0:i.checkbox),{type:"checkbox",id:f,name:"policies","data-atlas-policy-all":""});m.checked=t.snapshot().combinedChecked,m.addEventListener("change",()=>t.setAllChecked(m.checked));let h=N(r,"label",V("atlas-text",i==null?void 0:i.text),{for:f});h.append(bi(r,o("policy.agreeCombined"),u.map(w=>er(r,w,t,n)),p)),g.append(m,h),e.append(g)}else for(let f of u){let g=`atlas-policy-${++Xn}`,m=N(r,"div","atlas-policy-row atlas-consent"),h=N(r,"input",V("atlas-policy-checkbox",i==null?void 0:i.checkbox),{type:"checkbox",id:g,name:`policy_${f.key}`,"data-atlas-policy-box":f.key});h.checked=t.isChecked(f.key),h.addEventListener("change",()=>t.setChecked(f.key,h.checked));let w=N(r,"label",V("atlas-text",i==null?void 0:i.text),{for:g}),[C,S]=Kn(o("policy.agreeOne"),"policy");w.append(C,er(r,f,t,n),S),m.append(h,w),e.append(m)}},l=t.subscribe(a);return a(),{render:a,destroy(){l(),s==null||s(),e.textContent=""}}}function rr(e,t,n){var l;let r=(l=n.document)!=null?l:e.ownerDocument,{t:o,classes:i}=n,s=()=>{e.textContent="";let c=t.linkPolicies();e.hidden=c.length===0,c.length!==0&&(e.className=V("atlas-policy-clickwrap",i==null?void 0:i.text),e.setAttribute("data-atlas-policy-clickwrap",""),e.append(bi(r,o("policy.clickwrap"),c.map(d=>er(r,d,t,n)),o("policy.and"))))},a=t.subscribe(s);return s(),{render:s,destroy(){a(),e.textContent=""}}}function xc(e,t,n,r,o){let{t:i,classes:s}=r,a=N(e,"div",V("atlas-policy-viewer",s==null?void 0:s.viewer),{role:"region","aria-label":t.title,"data-atlas-policy-viewer":t.key}),l=N(e,"div","atlas-policy-viewer-head");l.append(N(e,"strong",void 0,{},t.title));let c=N(e,"button",V("atlas-policy-link",s==null?void 0:s.link),{type:"button","data-atlas-policy-back":""},i("policy.viewerBack"));c.addEventListener("click",()=>n.closeDocument()),l.append(c);let d=[t.version?i("policy.version",{version:t.version}):"",t.effectiveAt?i("policy.effective",{date:Go(t.effectiveAt)}):""].filter(Boolean).join(" \xB7 "),u=N(e,"div",V("atlas-policy-body",s==null?void 0:s.viewerBody),{tabindex:"0","data-atlas-policy-content":""});u.innerHTML=yi(t);let p=N(e,"span","atlas-policy-sentinel",{"aria-hidden":"true"});return u.append(p),a.append(l),d&&a.append(N(e,"p","atlas-policy-meta",{},d)),a.append(u),o(Wn(u,p,()=>n.markScrolledToEnd(t.key))),a}function wc(e,t){var y,x;let n=(y=t.document)!=null?y:document,{t:r,classes:o,controller:i}=t,s=++Xn,a=`atlas-policy-title-${s}`,l=`atlas-policy-hint-${s}`,c=N(n,"div",V("atlas-policy-overlay",o==null?void 0:o.overlay),{"data-atlas-policy-modal":e.key}),d=N(n,"div",V("atlas-policy-modal",o==null?void 0:o.modal),{role:"dialog","aria-modal":"true","aria-labelledby":a,"aria-describedby":l,tabindex:"-1"});if(d.append(N(n,"h2",void 0,{id:a},t.reaccept&&e.reaccept!==!1?r("policy.reacceptTitle",{policy:e.title}):e.title)),t.reaccept&&e.reaccept!==!1&&e.summaryOfChanges){let _=N(n,"div",V("atlas-policy-summary",o==null?void 0:o.summary),{"data-atlas-policy-summary":""});_.append(N(n,"strong",void 0,{},r("policy.summaryTitle")),N(n,"span",void 0,{},e.summaryOfChanges)),d.append(_)}let u=N(n,"div",V("atlas-policy-body",o==null?void 0:o.viewerBody),{tabindex:"0",role:"region","aria-label":e.title,"data-atlas-policy-content":""});u.innerHTML=yi(e);let p=N(n,"span","atlas-policy-sentinel",{"aria-hidden":"true","data-atlas-policy-end":""});u.append(p);let f=N(n,"p","atlas-policy-hint",{id:l,"aria-live":"polite"},r("policy.scrollHint")),g=N(n,"div","atlas-policy-actions"),m=N(n,"button",V(o==null?void 0:o.button),{type:"button","data-atlas-policy-decline":""},r("policy.decline")),h=N(n,"button",V("atlas-policy-accept",o==null?void 0:o.primaryButton),{type:"button","data-atlas-policy-accept":"",disabled:"","aria-disabled":"true"},r("policy.accept"));g.append(m,h),d.append(u,f,g),c.append(d),((x=t.container)!=null?x:n.body).append(c);let w=!1,C=Wn(u,p,()=>{w=!0,h.disabled=!1,h.removeAttribute("disabled"),h.setAttribute("aria-disabled","false"),f.textContent="",i==null||i.markScrolledToEnd(e.key)});i==null||i.startClock(e.key);let S=Wo(d,{initialFocus:u}),A=!1,k=()=>{A||(A=!0,C(),S(),i==null||i.stopClock(e.key),c.remove())};return h.addEventListener("click",()=>{w&&(k(),t.onAccept())}),m.addEventListener("click",()=>{k(),t.onDecline()}),{close:k,get acceptEnabled(){return w}}}function or(e,t){return new Promise(n=>{let r=()=>{let o=e.pendingScroll();if(!o){n(!0);return}wc(o,{...t,controller:e,onAccept:()=>{e.acceptScroll(o.key),r()},onDecline:()=>n(!1)})};r()})}function ki(e,t,n){var C;let r=(C=n.document)!=null?C:e.ownerDocument,{t:o,classes:i}=n,s=!1,a=!0;e.textContent="",e.setAttribute("data-atlas-policy-step","");let l=t.policies.some(S=>S.display!=="scroll");e.append(N(r,"p",V("atlas-text",i==null?void 0:i.text),{},o("policy.pendingIntro")));let c=N(r,"div"),d=N(r,"p"),u=nr(c,t,n),p=rr(d,t,n);e.append(c);let f=null,g=()=>{f&&(f.disabled=s||!t.canSubmit()||t.pendingScroll()!==null)};l&&(f=N(r,"button",V("atlas-button",i==null?void 0:i.primaryButton),{type:"button","data-atlas-policy-continue":""},o("policy.submit")),f.addEventListener("click",()=>n.onSubmit(t.build())),e.append(f)),e.append(d);let m=t.subscribe(g);g();let h={hasOthers:l,onSubmit:n.onSubmit,onDecline:n.onDecline};return Ft.set(t,h),(()=>{!a||Zn.has(t)||!t.pendingScroll()||(Zn.add(t),or(t,{...n,reaccept:!0}).then(S=>{Zn.delete(t);let A=Ft.get(t);if(A)if(S)A.hasOthers||A.onSubmit(t.build());else{let k=t.policies.find(y=>y.display==="scroll"&&!t.isChecked(y.key));k&&A.onDecline(k)}}))})(),{render(){u.render(),p.render(),g()},setBusy(S){s=S,g()},destroy(){a=!1,Ft.get(t)===h&&Ft.delete(t),m(),u.destroy(),p.destroy(),e.textContent=""}}}function xi(e){return{provider:e.provider,id_token:e.idToken,...e.nonce?{nonce:e.nonce}:{}}}function wi(e){if(!e||typeof e!="object")return null;let t=e;return typeof t.id!="string"||typeof t.status!="string"?null:{attemptId:t.id,status:t.status,...typeof t.ticket=="string"?{ticket:t.ticket}:{}}}var _i="https://accounts.google.com/gsi/client",Dt=null;function Sc(){return typeof process!="undefined"&&!1}var vi=new Set,Cc=!1;function Ac(e){return Dt||(Dt=new Promise((t,n)=>{if(e.querySelector(`script[src="${_i}"]`)){t();return}let r=e.createElement("script");r.src=_i,r.async=!0,r.defer=!0,r.addEventListener("load",()=>t()),r.addEventListener("error",()=>n(new Error("Failed to load Google Identity Services."))),e.head.appendChild(r)}),Dt)}async function Si(e){var C,S,A,k,y,x;let t=(C=e.host)!=null?C:window,n=t.document;await Ac(n);let r=(A=(S=t.google)==null?void 0:S.accounts)==null?void 0:A.id;if(!r)throw new Error("Google Identity Services unavailable.");r.initialize({client_id:e.clientId,nonce:e.nonce,callback:_=>{var R;_.credential?(Cc=!0,e.onCredential(_.credential)):(R=e.onError)==null||R.call(e,new Error("Google returned no credential."))}});let o=e.wrapper.style.position!=="";o||(e.wrapper.style.position="relative");let i=(k=e.visible)!=null?k:!1,s=n.createElement("div");i||s.setAttribute("aria-hidden","true");let a=.004;s.style.cssText=`position:absolute;inset:0;z-index:2;opacity:${i?1:a};overflow:hidden;`,e.wrapper.appendChild(s);let l={provider:"google",wrapper:e.wrapper,overlay:s};vi.add(l);let c=_=>{let R=_==null?void 0:_.style;R&&(R.width!=="100%"&&(R.width="100%"),R.height!=="100%"&&(R.height="100%"))},d=()=>{c(s.firstElementChild);let _=s.querySelector("iframe");c(_);let R=_==null?void 0:_.style;R&&R.margin!=="0px"&&(R.margin="0")},u=()=>{var E;let _=Math.round(e.wrapper.getBoundingClientRect().width)||320,R=Math.max(200,Math.min(400,_));s.replaceChildren(),r.renderButton(s,{type:"standard",theme:"outline",size:(E=e.size)!=null?E:"large",text:"continue_with",width:R}),d(),f()},p=_=>({width:_.width,height:_.height,top:_.top,left:_.left,right:_.right,bottom:_.bottom}),f=()=>{if(Sc()&&typeof window!="undefined")try{let _=e.wrapper.getBoundingClientRect(),R=s.getBoundingClientRect(),E=R.left<=_.left+1&&R.top<=_.top+1&&R.right>=_.right-1&&R.bottom>=_.bottom-1,B=s.querySelector("iframe"),W=B==null?void 0:B.getBoundingClientRect(),F=!!W&&W.width>=8&&W.height>=8;(!E||!F)&&console.warn("[atlas] Google overlay misaligned/undersized \u2014 clicks may miss the invisible GSI button",{covers:E,iframeOk:F,wrapper:p(_),overlay:p(R),iframe:W?{width:W.width,height:W.height}:null})}catch{}};u();let g,m=(y=t.ResizeObserver)!=null?y:typeof ResizeObserver!="undefined"?ResizeObserver:void 0;m&&(g=new m(()=>u()),g.observe(e.wrapper));let h,w=(x=t.MutationObserver)!=null?x:typeof MutationObserver!="undefined"?MutationObserver:void 0;return w&&(h=new w(()=>d()),h.observe(s,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","width","height"]})),e.oneTap&&r.prompt(),{destroy:()=>{g==null||g.disconnect(),h==null||h.disconnect(),vi.delete(l),s.remove(),o||(e.wrapper.style.position="")}}}var Pc=()=>{let e=globalThis.navigator;if(!e||!e.credentials)throw new Error("WebAuthn is not available in this environment.");return e};function st(e){let t=e instanceof Uint8Array?e:new Uint8Array(e),n="";for(let r=0;r<t.length;r+=1)n+=String.fromCharCode(t[r]);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Ci(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.length%4===0?"":"=".repeat(4-t.length%4),r=atob(t+n),o=new Uint8Array(r.length);for(let i=0;i<r.length;i+=1)o[i]=r.charCodeAt(i);return o.buffer}function Ee(e){return typeof(e!=null?e:globalThis.PublicKeyCredential)!="undefined"}async function ir(){var t;let e=globalThis.PublicKeyCredential;try{return await((t=e==null?void 0:e.isConditionalMediationAvailable)==null?void 0:t.call(e))===!0}catch{return!1}}function Ai(e){return typeof e=="string"?new TextEncoder().encode(e):e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function Pi(e){return{first:Ai(e.first),...e.second!==void 0?{second:Ai(e.second)}:{}}}function Ec(e,t){if(!e)return;let n={};return e.eval&&(n.eval=Pi(e.eval)),t==="get"&&e.evalByCredential&&(n.evalByCredential=Object.fromEntries(Object.entries(e.evalByCredential).map(([r,o])=>[r,Pi(o)]))),{prf:n}}var Ei=e=>e instanceof ArrayBuffer?new Uint8Array(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):void 0;function Rc(e){var i,s,a,l;let t=(s=(i=e.getClientExtensionResults)==null?void 0:i.call(e))!=null?s:{},n={credentialId:st(e.rawId)},r=t.prf;if(r&&typeof r=="object"){let c=Ei((a=r.results)==null?void 0:a.first),d=Ei((l=r.results)==null?void 0:l.second);n.prf={...typeof r.enabled=="boolean"?{enabled:r.enabled}:{},...c?{results:{first:c,...d?{second:d}:{}}}:{}}}let o=t.credProps;return o&&typeof o=="object"&&(n.credProps=typeof o.rk=="boolean"?{rk:o.rk}:{}),n}async function at(e,t={}){var a,l;let n=(a=t.host)!=null?a:Pc(),r=(l=e.allowCredentials)!=null?l:[],o={challenge:Ci(e.challenge),rpId:e.rpId,allowCredentials:r.map(c=>({type:c.type,id:Ci(c.id)})),userVerification:e.userVerification,timeout:e.timeout,...Array.isArray(e.hints)&&e.hints.length?{hints:e.hints}:{},...Tc(Ec(t.prf,"get"),e.extensions)},i=await n.credentials.get({publicKey:o,...t.mediation?{mediation:t.mediation}:{},...t.signal?{signal:t.signal}:{}});if(!i)throw new Error("Passkey sign-in was cancelled.");let s=i.response;return t.onExtensionResults&&t.onExtensionResults(Rc(i)),{handle:e.handle,challenge:e.challenge,credential_id:st(i.rawId),authenticator_data:st(s.authenticatorData),client_data_json:st(s.clientDataJSON),signature:st(s.signature)}}function Tc(e,t){let n=t&&typeof t=="object"&&!Array.isArray(t)?t:void 0;return!e&&!n?{}:{extensions:{...n!=null?n:{},...e!=null?e:{}}}}async function Ri(e,t){let n=await e.get(`/v1/client/password_resets/${encodeURIComponent(t)}/security_questions`);return n.ok&&n.data?{required:n.data.required,questions:n.data.questions}:null}var Ic={checking:"Checking your browser\u2026",verified:"Security check complete.",puzzlePrompt:"Select every picture that shows the same shape as this one. Colour and size don't matter.",confirm:"Confirm",tile:"Picture {n}",alternative:"Can't do the picture check? Use a longer automatic check instead."},Oc={checking:"captcha.checking",verified:"captcha.verified",puzzlePrompt:"captcha.puzzlePrompt",confirm:"captcha.puzzleConfirm",tile:"captcha.puzzleTile",alternative:"captcha.puzzleAlternative"};function sr(e){if(!e)return{};let t=typeof e=="function"?e:r=>e[r],n={};for(let[r,o]of Object.entries(Oc)){let i=t(o);typeof i=="string"&&i.trim()&&i!==o&&(n[r]=i)}return n}var Fc=e=>{let t=new Uint8Array(e),n="";for(let r=0;r<t.length;r++)n+=(t[r]<16?"0":"")+t[r].toString(16);return n},Lt=2e3;async function Dc(e,t,n,r=()=>!1){let o=new TextEncoder;for(let i=t;i<=n;i+=Lt){if(r())return null;let s=Math.min(n,i+Lt-1),a=[];for(let c=i;c<=s;c++)a.push(crypto.subtle.digest("SHA-256",o.encode(`${e.salt}${c}`)));let l=await Promise.all(a);for(let c=0;c<l.length;c++)if(Fc(l[c])===e.challenge)return i+c}return null}var Lc=`
|
|
27
|
+
.atlas-policy-banner{display:flex;flex-wrap:wrap;gap:8px;align-items:center;justify-content:space-between;padding:10px 14px;font-size:.875rem;border:1px solid var(--atlas-color-border,#e4e4e9);border-radius:var(--atlas-border-radius,8px);background:var(--atlas-color-surface,rgba(91,91,214,.08));}`,Di="atlas-policy-styles";function cr(e=document){if(e.getElementById(Di))return;let t=e.createElement("style");t.id=Di,t.textContent=Mc,e.head.appendChild(t)}var Uc=new Set(["SCRIPT","STYLE","IFRAME","OBJECT","EMBED","FORM","LINK","META","BASE","SVG","MATH"]);function Nc(e){if(typeof document=="undefined"||typeof document.createElement!="function")return e.replace(/&/g,"&").replace(/</g,"<");let t=document.createElement("template");t.innerHTML=e;let n=r=>{for(let o of Array.from(r.children)){if(Uc.has(o.tagName.toUpperCase())){o.remove();continue}for(let i of Array.from(o.attributes)){let s=i.name.toLowerCase(),a=i.value.trim().toLowerCase().replace(/[\s\u0000-\u001f]/g,"");(s.startsWith("on")||s==="style"||(s==="href"||s==="src"||s==="xlink:href")&&/^(javascript|data|vbscript):/.test(a))&&o.removeAttribute(i.name)}o.tagName==="A"&&(o.setAttribute("target","_blank"),o.setAttribute("rel","noopener noreferrer")),n(o)}};return n(t.content),t.innerHTML}function $i(e){return Nc(ui(e))}function j(e,t,n,r={},o){let i=e.createElement(t);n&&(i.className=n);for(let[s,a]of Object.entries(r))i.setAttribute(s,a);return o!==void 0&&(i.textContent=o),i}var J=(...e)=>e.filter(Boolean).join(" "),ar=0,sr=new WeakSet,Ut=new WeakMap;function lr(e,t,n,r){var i;let o=j(e,"button",J("atlas-policy-link",(i=r.classes)==null?void 0:i.link),{type:"button","data-atlas-policy-open":t.key,"aria-haspopup":"dialog"},t.title);return o.addEventListener("click",s=>{s.preventDefault(),n.openDocument(t.key)}),o}function Mi(e,t,n,r){let[o,i]=tr(t,"policies"),s=e.createDocumentFragment();return s.append(o),n.forEach((a,l)=>{l>0&&s.append(l===n.length-1?` ${r} `:", "),s.append(a)}),s.append(i),s}function dr(e,t,n){var c;let r=(c=n.document)!=null?c:e.ownerDocument,{t:o,classes:i}=n,s=null,a=()=>{s==null||s(),s=null,e.textContent="",e.className=J("atlas-policy-consent",i==null?void 0:i.root),e.setAttribute("data-atlas-policies","");let d=t.viewing;if(d){e.append(zc(r,d,t,n,f=>s=f));return}let u=t.checkboxPolicies();if(u.length===0)return;let p=o("policy.and");if(t.combined){let f=`atlas-policy-${++ar}`,m=j(r,"div","atlas-policy-row atlas-consent"),k=j(r,"input",J("atlas-policy-checkbox",i==null?void 0:i.checkbox),{type:"checkbox",id:f,name:"policies","data-atlas-policy-all":""});k.checked=t.snapshot().combinedChecked,k.addEventListener("change",()=>t.setAllChecked(k.checked));let g=j(r,"label",J("atlas-text",i==null?void 0:i.text),{for:f});g.append(Mi(r,o("policy.agreeCombined"),u.map(_=>lr(r,_,t,n)),p)),m.append(k,g),e.append(m)}else for(let f of u){let m=`atlas-policy-${++ar}`,k=j(r,"div","atlas-policy-row atlas-consent"),g=j(r,"input",J("atlas-policy-checkbox",i==null?void 0:i.checkbox),{type:"checkbox",id:m,name:`policy_${f.key}`,"data-atlas-policy-box":f.key});g.checked=t.isChecked(f.key),g.addEventListener("change",()=>t.setChecked(f.key,g.checked));let _=j(r,"label",J("atlas-text",i==null?void 0:i.text),{for:m}),[S,x]=tr(o("policy.agreeOne"),"policy");_.append(S,lr(r,f,t,n),x),k.append(g,_),e.append(k)}},l=t.subscribe(a);return a(),{render:a,destroy(){l(),s==null||s(),e.textContent=""}}}function ur(e,t,n){var l;let r=(l=n.document)!=null?l:e.ownerDocument,{t:o,classes:i}=n,s=()=>{e.textContent="";let c=t.linkPolicies();e.hidden=c.length===0,c.length!==0&&(e.className=J("atlas-policy-clickwrap",i==null?void 0:i.text),e.setAttribute("data-atlas-policy-clickwrap",""),e.append(Mi(r,o("policy.clickwrap"),c.map(d=>lr(r,d,t,n)),o("policy.and"))))},a=t.subscribe(s);return s(),{render:s,destroy(){a(),e.textContent=""}}}function zc(e,t,n,r,o){let{t:i,classes:s}=r,a=j(e,"div",J("atlas-policy-viewer",s==null?void 0:s.viewer),{role:"region","aria-label":t.title,"data-atlas-policy-viewer":t.key}),l=j(e,"div","atlas-policy-viewer-head");l.append(j(e,"strong",void 0,{},t.title));let c=j(e,"button",J("atlas-policy-link",s==null?void 0:s.link),{type:"button","data-atlas-policy-back":""},i("policy.viewerBack"));c.addEventListener("click",()=>n.closeDocument()),l.append(c);let d=[t.version?i("policy.version",{version:t.version}):"",t.effectiveAt?i("policy.effective",{date:pi(t.effectiveAt)}):""].filter(Boolean).join(" \xB7 "),u=j(e,"div",J("atlas-policy-body",s==null?void 0:s.viewerBody),{tabindex:"0","data-atlas-policy-content":""});u.innerHTML=$i(t);let p=j(e,"span","atlas-policy-sentinel",{"aria-hidden":"true"});return u.append(p),a.append(l),d&&a.append(j(e,"p","atlas-policy-meta",{},d)),a.append(u),o(er(u,p,()=>n.markScrolledToEnd(t.key))),a}function jc(e,t){var C,y;let n=(C=t.document)!=null?C:document,{t:r,classes:o,controller:i}=t,s=++ar,a=`atlas-policy-title-${s}`,l=`atlas-policy-hint-${s}`,c=j(n,"div",J("atlas-policy-overlay",o==null?void 0:o.overlay),{"data-atlas-policy-modal":e.key}),d=j(n,"div",J("atlas-policy-modal",o==null?void 0:o.modal),{role:"dialog","aria-modal":"true","aria-labelledby":a,"aria-describedby":l,tabindex:"-1"});if(d.append(j(n,"h2",void 0,{id:a},t.reaccept&&e.reaccept!==!1?r("policy.reacceptTitle",{policy:e.title}):e.title)),t.reaccept&&e.reaccept!==!1&&e.summaryOfChanges){let h=j(n,"div",J("atlas-policy-summary",o==null?void 0:o.summary),{"data-atlas-policy-summary":""});h.append(j(n,"strong",void 0,{},r("policy.summaryTitle")),j(n,"span",void 0,{},e.summaryOfChanges)),d.append(h)}let u=j(n,"div",J("atlas-policy-body",o==null?void 0:o.viewerBody),{tabindex:"0",role:"region","aria-label":e.title,"data-atlas-policy-content":""});u.innerHTML=$i(e);let p=j(n,"span","atlas-policy-sentinel",{"aria-hidden":"true","data-atlas-policy-end":""});u.append(p);let f=j(n,"p","atlas-policy-hint",{id:l,"aria-live":"polite"},r("policy.scrollHint")),m=j(n,"div","atlas-policy-actions"),k=j(n,"button",J(o==null?void 0:o.button),{type:"button","data-atlas-policy-decline":""},r("policy.decline")),g=j(n,"button",J("atlas-policy-accept",o==null?void 0:o.primaryButton),{type:"button","data-atlas-policy-accept":"",disabled:"","aria-disabled":"true"},r("policy.accept"));m.append(k,g),d.append(u,f,m),c.append(d),((y=t.container)!=null?y:n.body).append(c);let _=!1,S=er(u,p,()=>{_=!0,g.disabled=!1,g.removeAttribute("disabled"),g.setAttribute("aria-disabled","false"),f.textContent="",i==null||i.markScrolledToEnd(e.key)});i==null||i.startClock(e.key);let x=di(d,{initialFocus:u}),w=!1,P=()=>{w||(w=!0,S(),x(),i==null||i.stopClock(e.key),c.remove())};return g.addEventListener("click",()=>{_&&(P(),t.onAccept())}),k.addEventListener("click",()=>{P(),t.onDecline()}),{close:P,get acceptEnabled(){return _}}}function pr(e,t){return new Promise(n=>{let r=()=>{let o=e.pendingScroll();if(!o){n(!0);return}jc(o,{...t,controller:e,onAccept:()=>{e.acceptScroll(o.key),r()},onDecline:()=>n(!1)})};r()})}function Ui(e,t,n){var S;let r=(S=n.document)!=null?S:e.ownerDocument,{t:o,classes:i}=n,s=!1,a=!0;e.textContent="",e.setAttribute("data-atlas-policy-step","");let l=t.policies.some(x=>x.display!=="scroll");e.append(j(r,"p",J("atlas-text",i==null?void 0:i.text),{},o("policy.pendingIntro")));let c=j(r,"div"),d=j(r,"p"),u=dr(c,t,n),p=ur(d,t,n);e.append(c);let f=null,m=()=>{f&&(f.disabled=s||!t.canSubmit()||t.pendingScroll()!==null)};l&&(f=j(r,"button",J("atlas-button",i==null?void 0:i.primaryButton),{type:"button","data-atlas-policy-continue":""},o("policy.submit")),f.addEventListener("click",()=>n.onSubmit(t.build())),e.append(f)),e.append(d);let k=t.subscribe(m);m();let g={hasOthers:l,onSubmit:n.onSubmit,onDecline:n.onDecline};return Ut.set(t,g),(()=>{!a||sr.has(t)||!t.pendingScroll()||(sr.add(t),pr(t,{...n,reaccept:!0}).then(x=>{sr.delete(t);let w=Ut.get(t);if(w)if(x)w.hasOthers||w.onSubmit(t.build());else{let P=t.policies.find(C=>C.display==="scroll"&&!t.isChecked(C.key));P&&w.onDecline(P)}}))})(),{render(){u.render(),p.render(),m()},setBusy(x){s=x,m()},destroy(){a=!1,Ut.get(t)===g&&Ut.delete(t),k(),u.destroy(),p.destroy(),e.textContent=""}}}function ji(e){return{provider:e.provider,id_token:e.idToken,...e.nonce?{nonce:e.nonce}:{}}}function Bi(e){if(!e||typeof e!="object")return null;let t=e;return typeof t.id!="string"||typeof t.status!="string"?null:{attemptId:t.id,status:t.status,...typeof t.ticket=="string"?{ticket:t.ticket}:{}}}var Ni="https://accounts.google.com/gsi/client",Nt=null;function Bc(){return typeof process!="undefined"&&!1}var zi=new Set,qc=!1;function Hc(e){return Nt||(Nt=new Promise((t,n)=>{if(e.querySelector(`script[src="${Ni}"]`)){t();return}let r=e.createElement("script");r.src=Ni,r.async=!0,r.defer=!0,r.addEventListener("load",()=>t()),r.addEventListener("error",()=>n(new Error("Failed to load Google Identity Services."))),e.head.appendChild(r)}),Nt)}async function qi(e){var S,x,w,P,C,y;let t=(S=e.host)!=null?S:window,n=t.document;await Hc(n);let r=(w=(x=t.google)==null?void 0:x.accounts)==null?void 0:w.id;if(!r)throw new Error("Google Identity Services unavailable.");r.initialize({client_id:e.clientId,nonce:e.nonce,callback:h=>{var R;h.credential?(qc=!0,e.onCredential(h.credential)):(R=e.onError)==null||R.call(e,new Error("Google returned no credential."))}});let o=e.wrapper.style.position!=="";o||(e.wrapper.style.position="relative");let i=(P=e.visible)!=null?P:!1,s=n.createElement("div");i||s.setAttribute("aria-hidden","true");let a=.004;s.style.cssText=`position:absolute;inset:0;z-index:2;opacity:${i?1:a};overflow:hidden;`,e.wrapper.appendChild(s);let l={provider:"google",wrapper:e.wrapper,overlay:s};zi.add(l);let c=h=>{let R=h==null?void 0:h.style;R&&(R.width!=="100%"&&(R.width="100%"),R.height!=="100%"&&(R.height="100%"))},d=()=>{c(s.firstElementChild);let h=s.querySelector("iframe");c(h);let R=h==null?void 0:h.style;R&&R.margin!=="0px"&&(R.margin="0")},u=()=>{var E;let h=Math.round(e.wrapper.getBoundingClientRect().width)||320,R=Math.max(200,Math.min(400,h));s.replaceChildren(),r.renderButton(s,{type:"standard",theme:"outline",size:(E=e.size)!=null?E:"large",text:"continue_with",width:R}),d(),f()},p=h=>({width:h.width,height:h.height,top:h.top,left:h.left,right:h.right,bottom:h.bottom}),f=()=>{if(Bc()&&typeof window!="undefined")try{let h=e.wrapper.getBoundingClientRect(),R=s.getBoundingClientRect(),E=R.left<=h.left+1&&R.top<=h.top+1&&R.right>=h.right-1&&R.bottom>=h.bottom-1,D=s.querySelector("iframe"),I=D==null?void 0:D.getBoundingClientRect(),L=!!I&&I.width>=8&&I.height>=8;(!E||!L)&&console.warn("[atlas] Google overlay misaligned/undersized \u2014 clicks may miss the invisible GSI button",{covers:E,iframeOk:L,wrapper:p(h),overlay:p(R),iframe:I?{width:I.width,height:I.height}:null})}catch{}};u();let m,k=(C=t.ResizeObserver)!=null?C:typeof ResizeObserver!="undefined"?ResizeObserver:void 0;k&&(m=new k(()=>u()),m.observe(e.wrapper));let g,_=(y=t.MutationObserver)!=null?y:typeof MutationObserver!="undefined"?MutationObserver:void 0;return _&&(g=new _(()=>d()),g.observe(s,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","width","height"]})),e.oneTap&&r.prompt(),{destroy:()=>{m==null||m.disconnect(),g==null||g.disconnect(),zi.delete(l),s.remove(),o||(e.wrapper.style.position="")}}}async function Hi(e,t){let n=await e.get(`/v1/client/password_resets/${encodeURIComponent(t)}/security_questions`);return n.ok&&n.data?{required:n.data.required,questions:n.data.questions}:null}var Wc={checking:"Checking your browser\u2026",verified:"Security check complete.",puzzlePrompt:"Select every picture that shows the same shape as this one. Colour and size don't matter.",confirm:"Confirm",tile:"Picture {n}",alternative:"Can't do the picture check? Use a longer automatic check instead."},Kc={checking:"captcha.checking",verified:"captcha.verified",puzzlePrompt:"captcha.puzzlePrompt",confirm:"captcha.puzzleConfirm",tile:"captcha.puzzleTile",alternative:"captcha.puzzleAlternative"};function fr(e){if(!e)return{};let t=typeof e=="function"?e:r=>e[r],n={};for(let[r,o]of Object.entries(Kc)){let i=t(o);typeof i=="string"&&i.trim()&&i!==o&&(n[r]=i)}return n}var Gc=e=>{let t=new Uint8Array(e),n="";for(let r=0;r<t.length;r++)n+=(t[r]<16?"0":"")+t[r].toString(16);return n},zt=2e3;async function Vc(e,t,n,r=()=>!1){let o=new TextEncoder;for(let i=t;i<=n;i+=zt){if(r())return null;let s=Math.min(n,i+zt-1),a=[];for(let c=i;c<=s;c++)a.push(crypto.subtle.digest("SHA-256",o.encode(`${e.salt}${c}`)));let l=await Promise.all(a);for(let c=0;c<l.length;c++)if(Gc(l[c])===e.challenge)return i+c}return null}var Yc=`
|
|
28
28
|
self.onmessage = async function (e) {
|
|
29
29
|
var d = e.data, enc = new TextEncoder();
|
|
30
30
|
function hex(buf) { var b = new Uint8Array(buf), s = ''; for (var i = 0; i < b.length; i++) s += (b[i] < 16 ? '0' : '') + b[i].toString(16); return s; }
|
|
31
|
-
for (var start = d.from; start <= d.to; start += ${
|
|
32
|
-
var end = Math.min(d.to, start + ${
|
|
31
|
+
for (var start = d.from; start <= d.to; start += ${zt}) {
|
|
32
|
+
var end = Math.min(d.to, start + ${zt} - 1), batch = [];
|
|
33
33
|
for (var n = start; n <= end; n++) batch.push(crypto.subtle.digest('SHA-256', enc.encode(d.salt + n)));
|
|
34
34
|
var hs = await Promise.all(batch);
|
|
35
35
|
for (var i = 0; i < hs.length; i++) if (hex(hs[i]) === d.challenge) { self.postMessage({ n: start + i }); return; }
|
|
36
36
|
}
|
|
37
37
|
self.postMessage({ n: null });
|
|
38
|
-
};`;async function $c(e,t={}){var i,s,a,l;let n=(i=t.cancelled)!=null?i:()=>!1,r=globalThis;if(t.workers!==!1&&r.Worker&&r.Blob&&((s=r.URL)!=null&&s.createObjectURL)){let c=await Mc(e,Math.max(1,Math.min(4,(l=(a=r.navigator)==null?void 0:a.hardwareConcurrency)!=null?l:2)),n).catch(()=>{});if(c!==void 0){if(c===null)throw new Error("captcha: no solution");return{n:c,worker:!0}}}let o=await Dc(e,0,e.maxnumber,n);if(o===null)throw new Error(n()?"captcha: cancelled":"captcha: no solution");return{n:o,worker:!1}}function Mc(e,t,n){let r=URL.createObjectURL(new Blob([Lc],{type:"text/javascript"})),o=[],i=()=>{for(let s of o)s.terminate();URL.revokeObjectURL(r)};return new Promise((s,a)=>{let l=t,c=Math.ceil((e.maxnumber+1)/t),d=setInterval(()=>{n()&&(clearInterval(d),i(),s(null))},100),u=p=>{clearInterval(d),i(),p instanceof Error?a(p):s(p)};try{for(let p=0;p<t;p++){let f=new Worker(r);o.push(f),f.onmessage=m=>{var h;typeof((h=m.data)==null?void 0:h.n)=="number"?u(m.data.n):--l===0&&u(null)},f.onerror=()=>u(new Error("captcha: worker failed"));let g=p*c;f.postMessage({salt:e.salt,challenge:e.challenge,from:g,to:Math.min(e.maxnumber,g+c-1)})}}catch(p){u(p instanceof Error?p:new Error("captcha: worker failed"))}})}var Uc=e=>{let t=new TextEncoder().encode(e),n="";for(let r=0;r<t.length;r++)n+=String.fromCharCode(t[r]);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")};function Nc(e){return`atlas1.${Uc(JSON.stringify(e))}`}async function zc(e,t=!1){let n=t?`${e}${e.includes("?")?"&":"?"}accessible=true`:e,r=await fetch(n,{method:"GET",credentials:"omit"});if(!r.ok)throw new Error(`captcha: challenge refused (${r.status})`);return await r.json()}function Ti(e,t){let n=e.createElement("img");return n.src=`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(t)))}`,n.alt="",n.width=64,n.height=64,n.style.cssText="display:block;width:64px;height:64px;border-radius:6px",n}function Bc(e,t,n,r){let o=e.ownerDocument;return new Promise((i,s)=>{e.replaceChildren();let a=o.createElement("div");a.setAttribute("role","group"),a.setAttribute("data-atlas-captcha-puzzle",""),a.style.cssText="display:flex;flex-direction:column;align-items:center;gap:8px";let l=o.createElement("p");l.style.cssText="margin:0;font-size:13px;text-align:center",l.textContent=n.puzzlePrompt,a.append(l,Ti(o,t.interactive.example));let c=o.createElement("div");c.style.cssText="display:grid;grid-template-columns:repeat(3,72px);gap:6px";let d=0;t.interactive.tiles.forEach((p,f)=>{let g=o.createElement("button");g.type="button",g.setAttribute("aria-pressed","false"),g.setAttribute("aria-label",n.tile.replace("{n}",String(f+1))),g.setAttribute("data-atlas-captcha-tile",String(f)),g.style.cssText="padding:3px;border:2px solid transparent;border-radius:8px;background:none;cursor:pointer",g.append(Ti(o,p)),g.addEventListener("click",()=>{d^=1<<f;let m=(d&1<<f)!==0;g.setAttribute("aria-pressed",m?"true":"false"),g.style.borderColor=m?"currentColor":"transparent"}),c.append(g)});let u=o.createElement("button");if(u.type="button",u.setAttribute("data-atlas-captcha-confirm",""),u.textContent=n.confirm,u.addEventListener("click",()=>r()?s(new Error("captcha: widget removed")):i(d)),a.append(c,u),t.accessible_alternative){let p=o.createElement("button");p.type="button",p.setAttribute("data-atlas-captcha-alternative",""),p.style.cssText="font-size:12px;background:none;border:0;text-decoration:underline;cursor:pointer",p.textContent=n.alternative,p.addEventListener("click",()=>i("accessible")),a.append(p)}e.append(a)})}function ar(e,t){var f,g;let n={...Ic,...t.labels},r=(f=t.mode)!=null?f:"managed",o=e.ownerDocument,i=(g=t.fetchChallenge)!=null?g:m=>t.challengeUrl?zc(t.challengeUrl,m):Promise.reject(new Error("captcha: no challenge URL")),s=!1,a=0,l=()=>s,c=o.createElement("div");c.setAttribute("role","status"),c.setAttribute("aria-live","polite"),c.setAttribute("data-atlas-captcha-provider","atlas"),c.style.cssText="font-size:13px;opacity:.85;text-align:center",e.append(c);let d=m=>{c.replaceChildren(),c.textContent=m},u=async m=>{let h=await i(m);if(s)throw new Error("captcha: widget removed");a=Date.parse(h.expires_at)||0,(r==="visible"||h.interactive)&&d(n.checking);let w=Date.now(),C=$c(h,{workers:t.workers,cancelled:l}).then(x=>({...x,ms:Date.now()-w}));C.catch(()=>{});let S;if(h.interactive){let x=await Bc(c,h,n,l);if(x==="accessible")return d(n.checking),u(!0);S=x,d(n.checking)}let{n:A,worker:k,ms:y}=await C;if(s)throw new Error("captcha: widget removed");return(r==="visible"||S!==void 0)&&d(n.verified),Nc({t:h.token,n:A,ms:y,...k?{w:1}:{},...S!==void 0?{sel:S}:{}})},p=u(!1);return p.catch(()=>{}),{token:p,stale:()=>a>0&&Date.now()>a-15e3,remove(){s=!0,c.remove()}}}var jc=new Set(["atlas","turnstile","hcaptcha","recaptcha","recaptcha_v3","recaptcha_enterprise","captchafox","vercel_botid"]);function lt(e,t){return!e||!jc.has(e)?!1:e==="vercel_botid"?!!(t!=null&&t.attestationUrl):!0}function ze(e){return!!e&&e.enabled===!0&<(e.provider,e)}var qc=["CAPTCHA_REQUIRED","CAPTCHA_FAILED"];function lr(e){return!!e&&typeof e.code=="string"&&qc.includes(e.code)}var Hc={turnstile:{src:()=>"https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit",global:"turnstile"},hcaptcha:{src:()=>"https://js.hcaptcha.com/1/api.js?render=explicit",global:"hcaptcha"},recaptcha:{src:()=>"https://www.google.com/recaptcha/api.js?render=explicit",global:"grecaptcha"},recaptcha_v3:{src:e=>`https://www.google.com/recaptcha/api.js?render=${encodeURIComponent(e)}`,global:"grecaptcha"},recaptcha_enterprise:{src:e=>`https://www.google.com/recaptcha/enterprise.js?render=${encodeURIComponent(e)}`,global:"grecaptcha"},captchafox:{src:()=>"https://cdn.captchafox.com/api.js?render=explicit",global:"captchafox"}};function Ii(e,t,n){let r=Hc[e];if(!r)return Promise.reject(new Error(`captcha: ${e} is not renderable`));if(n[r.global])return Promise.resolve(n[r.global]);let o=n.document,i=`__atlasCaptchaLoad_${e}`,s=n[i];if(s)return s;let a=new Promise((l,c)=>{var f,g;let d=()=>{n[r.global]?l(n[r.global]):c(new Error(`captcha: ${e} script loaded but global missing`))},u=r.src(t),p=o.querySelector(`script[src="${u}"]`);if(p){if(n[r.global])return l(n[r.global]);p.addEventListener("load",d,{once:!0}),p.addEventListener("error",()=>c(new Error(`captcha: ${e} script failed`)),{once:!0});return}p=o.createElement("script"),p.src=u,p.async=!0,p.defer=!0,p.addEventListener("load",d,{once:!0}),p.addEventListener("error",()=>c(new Error(`captcha: ${e} script failed`)),{once:!0}),((g=(f=o.head)!=null?f:o.body)!=null?g:o.documentElement).appendChild(p)});return n[i]=a,a.catch(()=>{n[i]===a&&delete n[i]}),a}function Wc(e,t,n,r,o){return new Promise((i,s)=>{let a=e.render(t,{sitekey:n,appearance:r==="invisible"?"interaction-only":"always",callback:l=>i(l),"error-callback":()=>s(new Error("captcha: turnstile error")),"timeout-callback":()=>s(new Error("captcha: turnstile timeout"))});o(()=>{var l;return(l=e.remove)==null?void 0:l.call(e,a)}),r==="invisible"&&e.execute&&e.execute(a)})}function Kc(e,t,n,r,o){return new Promise((i,s)=>{let a=e.render(t,{sitekey:n,size:r==="invisible"?"invisible":"normal",callback:l=>i(l),"error-callback":()=>s(new Error("captcha: hcaptcha error"))});if(o(()=>{var l;return(l=e.remove)==null?void 0:l.call(e,a)}),r==="invisible"){let l=e.execute(a,{async:!0});l&&typeof l.then=="function"&&l.then(c=>i(c.response),s)}})}function Gc(e,t,n,r,o){return new Promise((i,s)=>{let a=e.render(t,{sitekey:n,size:r==="invisible"?"invisible":"normal",callback:l=>i(l),"error-callback":()=>s(new Error("captcha: recaptcha error"))});if(o(()=>{var l;return(l=e.reset)==null?void 0:l.call(e,a)}),r==="invisible"&&e.execute){let l=e.execute(void 0,{widgetId:a});l&&typeof l.then=="function"&&l.then(i,s)}})}function Vc(e,t,n,r,o){return new Promise((i,s)=>{let a=()=>s(new Error("captcha: captchafox error"));Promise.resolve(e.render(t,{sitekey:n,mode:r==="invisible"?"hidden":"inline",onVerify:l=>i(l),onError:a,onFail:a})).then(l=>{o(()=>{var c;return(c=e.remove)==null?void 0:c.call(e,l)}),r==="invisible"&&e.execute&&Promise.resolve(e.execute(l)).then(c=>{typeof c=="string"&&c&&i(c)},a)},a)})}async function Oi(e,t=globalThis.fetch){let n=await t(e,{method:"POST",credentials:"same-origin",headers:{accept:"application/json"}});if(!n.ok)throw new Error(`captcha: BotID attestation route answered ${n.status}`);let r=await n.json();if(typeof r.token!="string"||!r.token)throw new Error("captcha: BotID attestation missing");return r.token}function Yc(e,t){let n=()=>{let r=e.execute(t,{action:"submit"});return r&&typeof r.then=="function"?r:Promise.reject(new Error("captcha: recaptcha v3 execute returned no promise"))};return new Promise((r,o)=>{e.ready?e.ready(()=>n().then(r,o)):n().then(r,o)})}function Fi(e,t,n={}){var p,f,g,m,h,w,C,S,A;let r=(p=e.provider)!=null?p:"";if(r==="atlas")return ar(t,{challengeUrl:e.challengeUrl,mode:(f=e.widget)!=null?f:"managed",...n.atlas});if(r==="vercel_botid"){let k=!1,y=(m=(g=t.ownerDocument)==null?void 0:g.defaultView)!=null?m:globalThis,x=e.attestationUrl?Oi(e.attestationUrl,(h=y.fetch)==null?void 0:h.bind(y)).then(_=>{if(k)throw new Error("captcha: widget removed");return _}):Promise.reject(new Error("captcha: vercel_botid needs an attestationUrl"));return x.catch(()=>{}),{token:x,remove(){k=!0}}}let o=(w=e.siteKey)!=null?w:"",i=(C=e.widget)!=null?C:"managed",s=(A=(S=t.ownerDocument)==null?void 0:S.defaultView)!=null?A:globalThis,a=!1,l=null,c=null,d=k=>{l=k};return{token:new Promise((k,y)=>{c=y,Ii(r,o,s).then(x=>{if(a)throw new Error("captcha: widget removed");switch(r){case"turnstile":return Wc(x,t,o,i,d);case"hcaptcha":return Kc(x,t,o,i,d);case"recaptcha":return Gc(x,t,o,i,d);case"recaptcha_v3":case"recaptcha_enterprise":return Yc(x,o);case"captchafox":return Vc(x,t,o,i,d);default:throw new Error(`captcha: ${r} is not renderable`)}}).then(k,y)}),remove(){if(!a){a=!0;try{l==null||l()}catch{}for(;t.firstChild;)t.removeChild(t.firstChild);c==null||c(new Error("captcha: widget removed"))}}}}async function cr(e,t,n){return Fi(e,t,n).token}var Jc="/v1/client/sign_ins/passkey/begin",Di=async(e,t)=>{try{return await e(t)||null}catch{return null}};async function dr(e,t={}){var l;let n=c=>e.post(Jc,c?{captcha_token:c}:{}),r=(l=t.captcha)!=null?l:null,o=r?await Di(r,{retry:!1}):null,i=await n(o);if(i.ok||!r)return i;let s=i.errors.find(c=>lr(c));if(!s)return i;let a=await Di(r,{retry:!0,refused:s.code==="CAPTCHA_FAILED"?"CAPTCHA_FAILED":"CAPTCHA_REQUIRED"});return a?n(a):i}var Li="FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6BF12FFA06D98A0864D87602733EC86A64521F2B18177B200CBBE117577A615D6C770988C0BAD946E208E24FA074E5AB3143DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF",rf=BigInt("0x"+Li),of=BigInt(0),sf=BigInt(1),af=BigInt(5),lf=Li.length/2,cf=new TextEncoder;var $t=class extends Error{constructor(n,r,o,i,s,a){super(o);v(this,"code");v(this,"status");v(this,"param");v(this,"reason");v(this,"meta");this.name="OrganizationRequestError",this.status=n,this.code=r,this.param=i,s&&(this.reason=s),a&&(this.meta=a)}get needsReverification(){return this.code==="STEP_UP_REQUIRED"}};var G=encodeURIComponent,L=e=>`/v1/client/organizations/${G(e)}`;async function $(e,t,n={}){var o,i;let r=await e.request(t,n);if(!r.ok||!r.data){let s=r.errors[0];throw new $t(r.status,(o=s==null?void 0:s.code)!=null?o:"UNKNOWN",(i=s==null?void 0:s.message)!=null?i:"The request failed.",s==null?void 0:s.param,s==null?void 0:s.reason,s==null?void 0:s.meta)}return r.data}var M=(e,t)=>t===void 0?{method:e}:{method:e,body:JSON.stringify(t)},U={getSso:(e,t)=>$(e,`${L(t)}/sso_connection`,M("GET")),saveSso:(e,t,n)=>$(e,`${L(t)}/sso_connection`,M("PATCH",n)),getDirectory:(e,t)=>$(e,`${L(t)}/directory`,M("GET")),createDirectoryToken:(e,t)=>$(e,`${L(t)}/directory/tokens`,M("POST")),revokeDirectoryToken:(e,t,n)=>$(e,`${L(t)}/directory/tokens/${G(n)}`,M("DELETE")),listDomains:async(e,t)=>(await $(e,`${L(t)}/domains`,M("GET"))).data,addDomain:(e,t,n)=>$(e,`${L(t)}/domains`,M("POST",{domain:n})),verifyDomain:(e,t,n)=>$(e,`${L(t)}/domains/${G(n)}/verify`,M("POST")),removeDomain:(e,t,n)=>$(e,`${L(t)}/domains/${G(n)}`,M("DELETE")),listLogStreams:async(e,t)=>(await $(e,`${L(t)}/log_streams`,M("GET"))).data,addLogStream:(e,t,n)=>$(e,`${L(t)}/log_streams`,M("POST",n)),removeLogStream:(e,t,n)=>$(e,`${L(t)}/log_streams/${G(n)}`,M("DELETE")),listApiKeys:async(e,t)=>(await $(e,`${L(t)}/api_keys`,M("GET"))).data,createApiKey:(e,t,n={})=>$(e,`${L(t)}/api_keys`,M("POST",n)),revokeApiKey:(e,t,n)=>$(e,`${L(t)}/api_keys/${G(n)}`,M("DELETE")),getIpAllowlist:(e,t)=>$(e,`${L(t)}/ip_allowlist`,M("GET")),setIpAllowlist:(e,t,n)=>$(e,`${L(t)}/ip_allowlist`,M("PATCH",{entries:n})),listWebhooks:async(e,t)=>(await $(e,`${L(t)}/webhook_endpoints`,M("GET"))).data,createWebhook:(e,t,n)=>$(e,`${L(t)}/webhook_endpoints`,M("POST",n)),updateWebhook:(e,t,n,r)=>$(e,`${L(t)}/webhook_endpoints/${G(n)}`,M("PATCH",r)),deleteWebhook:(e,t,n)=>$(e,`${L(t)}/webhook_endpoints/${G(n)}`,M("DELETE")),rotateWebhookSecret:(e,t,n)=>$(e,`${L(t)}/webhook_endpoints/${G(n)}/rotate_secret`,M("POST")),webhookDeliveries:async(e,t,n)=>(await $(e,`${L(t)}/webhook_endpoints/${G(n)}/deliveries`,M("GET"))).data,listAppEventTypes:async(e,t)=>(await $(e,`${L(t)}/app_event_types`,M("GET"))).data,listAppWebhooks:async(e,t)=>(await $(e,`${L(t)}/app_webhook_endpoints`,M("GET"))).data,createAppWebhook:(e,t,n)=>$(e,`${L(t)}/app_webhook_endpoints`,M("POST",n)),updateAppWebhook:(e,t,n,r)=>$(e,`${L(t)}/app_webhook_endpoints/${G(n)}`,M("PATCH",r)),deleteAppWebhook:(e,t,n)=>$(e,`${L(t)}/app_webhook_endpoints/${G(n)}`,M("DELETE")),revealAppWebhookSecret:(e,t,n)=>$(e,`${L(t)}/app_webhook_endpoints/${G(n)}/reveal_secret`,M("POST")),rotateAppWebhookSecret:(e,t,n)=>$(e,`${L(t)}/app_webhook_endpoints/${G(n)}/rotate_secret`,M("POST")),testAppWebhook:(e,t,n)=>$(e,`${L(t)}/app_webhook_endpoints/${G(n)}/test?wait=10s`,M("POST")),appWebhookDeliveries:async(e,t,n)=>(await $(e,`${L(t)}/app_webhook_endpoints/${G(n)}/deliveries`,M("GET"))).data,redeliverAppWebhook:(e,t,n,r)=>$(e,`${L(t)}/app_webhook_endpoints/${G(n)}/deliveries/${G(r)}/redeliver`,M("POST")),replayAppWebhook:(e,t,n,r="failing_since")=>$(e,`${L(t)}/app_webhook_endpoints/${G(n)}/replay`,M("POST",{since:r}))};var ur=e=>{let t=typeof e=="string"?Number(e):e;return typeof t=="number"&&Number.isFinite(t)?t:0};function $i(e,t,n){try{return new Intl.NumberFormat(n,{style:"currency",currency:t.toUpperCase()}).format(e/100)}catch{return`${(e/100).toFixed(2)} ${t.toUpperCase()}`}}function Mi(e,t={}){var d,u;let n=e.interval==="year"?"year":"month",r=(d=t.interval)!=null?d:n,o=e.annual_available&&e.annual_amount!=null?ur(e.annual_amount):null,i=r===n?ur(e.amount):r==="year"&&o!==null?o:ur(e.amount),s=r===n||r==="year"&&o!==null?r:n,a=e.promotion&&!(e.promotion.ends_at!==void 0&&e.promotion.ends_at<=((u=t.now)!=null?u:Date.now()))?e.promotion:null,l=i;a!=null&&a.percent_off?l=Math.round(i*(1-a.percent_off/100)):a!=null&&a.amount_off&&(l=Math.max(0,i-a.amount_off));let c=a!==null&&l<i;return{price:$i(l,e.currency,t.locale),...c?{originalPrice:$i(i,e.currency,t.locale)}:{},interval:s,free:l===0&&i===0,trialDays:e.trial_days&&e.trial_days>0?e.trial_days:null,...a?{promotionLabel:a.label}:{},...a!=null&&a.code?{promotionCode:a.code}:{},amount:l}}async function Ui(e,t={}){var o;let n=await e.get("/v1/client/billing/plans"),r=n.ok&&n.data?(o=n.data.data)!=null?o:[]:[];return t.audience?r.filter(i=>i.audience===t.audience):r}async function Ni(e,t){var r,o,i,s;let n=await e.post("/v1/client/billing/checkout",{plan_id:t.planId,...t.orgId?{org_id:t.orgId}:{},...t.interval?{interval:t.interval}:{},success_url:t.successUrl,cancel_url:(r=t.cancelUrl)!=null?r:t.successUrl});return n.ok&&((o=n.data)!=null&&o.url)?{url:n.data.url}:{url:null,error:(s=(i=n.errors[0])==null?void 0:i.message)!=null?s:"Could not start checkout."}}var Mt="atlas_marketing",qi=90*24*60*6e4,zi={enabled:!1,params:[],consentCategory:"marketing"},Bi=new Map;function Zc(e){let t=e.referralCacheKey,n=Bi.get(t);return n||(n=e.get("/v1/client/marketing").then(r=>{var s;let o=r.ok?(s=r.data)==null?void 0:s.capture:void 0;return o!=null&&o.enabled?{enabled:!0,params:Array.isArray(o.params)?o.params.filter(a=>typeof a=="string"):[],consentCategory:typeof o.consent_category=="string"?o.consent_category:"marketing"}:zi}).catch(()=>zi),Bi.set(t,n)),n}var Xc=()=>typeof window=="undefined"?null:window,pr=()=>{try{return typeof localStorage=="undefined"?null:localStorage}catch{return null}},ji=e=>{if(!e)return null;try{let t=new URL(e);return t.protocol==="http:"||t.protocol==="https:"?`${t.origin}${t.pathname}`:null}catch{return null}};function ed(e,t,n=new Date){var s,a,l,c,d;let r=new URLSearchParams((a=(s=t.location)==null?void 0:s.search)!=null?a:""),o={};for(let u of e.params.length?e.params:[]){let p=r.get(u);p&&p.trim()&&(o[u]=p.trim().slice(0,200))}if(Object.keys(o).length===0)return null;let i=(l=t.location)!=null&&l.origin?`${t.location.origin}${(c=t.location.pathname)!=null?c:"/"}`:null;return{params:o,landing_url:ji(i),referrer:ji((d=t.document)==null?void 0:d.referrer),captured_at:n.toISOString()}}var fr=e=>{try{let t=e==null?void 0:e.getItem(Mt);if(!t)return null;let n=JSON.parse(t);return n.expires_at!==void 0&&n.expires_at<Date.now()?(e==null||e.removeItem(Mt),null):n.first_touch&&n.last_touch?n:null}catch{return null}};function td(e={}){return fr(e.storage===void 0?pr():e.storage)}function nd(e,t,n){return tt(t,[e.consentCategory],{provider:"auto",appConsent:n.consent})}async function Ut(e,t={}){var l,c;let n=t.win===void 0?Xc():t.win,r=t.storage===void 0?pr():t.storage;if(!n||!r||!((l=n.location)!=null&&l.search)||n.location.search==="?")return!1;let o=await Zc(e);if(!o.enabled)return!1;let i=ed(o,n);if(!i||!nd(o,n,t).granted)return!1;let s=fr(r),a={first_touch:(c=s==null?void 0:s.first_touch)!=null?c:i,last_touch:i,expires_at:Date.now()+qi};try{return r.setItem(Mt,JSON.stringify(a)),!0}catch{return!1}}async function Hi(e,t={}){var i;let n=t.storage===void 0?pr():t.storage,r=fr(n);if(!r||r.sent)return!1;let o=await e.post("/v1/client/me/marketing",{...r.last_touch,first_touch:r.first_touch});if(!o.ok)return!1;try{n==null||n.setItem(Mt,JSON.stringify({...r,sent:!0,expires_at:Date.now()+qi}))}catch{}return((i=o.data)==null?void 0:i.recorded)===!0}async function Wi(e,t,n={}){var i,s;let r=td(n),o=await e.post("/v1/client/marketing/leads",{email:t.email,...t.name?{name:t.name}:{},...t.form?{form:t.form}:{},consent:t.consent===!0,...t.website?{website:t.website}:{},...r?{marketing:{...r.first_touch}}:{}});return o.ok?{ok:!0}:{ok:!1,error:(s=(i=o.errors[0])==null?void 0:i.message)!=null?s:"Could not submit."}}var ct={attempt:null,errors:[],busy:!1,ticket:null};async function Ki(e,t,n){let r=await e.post("/v1/client/password_resets",{email_address:t,captcha_token:n});return!r.ok||!r.data?{...ct,errors:r.errors}:{attempt:r.data,errors:[],busy:!1,ticket:null}}async function Gi(e,t,n,r={}){var g,m,h,w,C;let o=t.attempt;if(!o)return t;let i=null,s={};switch(o.status){case"needs_email_verification":i=`/v1/client/password_resets/${o.id}/attempt_verification`,s={code:(g=n.code)!=null?g:""};break;case"needs_second_factor":i=`/v1/client/password_resets/${o.id}/attempt_second_factor`,s={code:(m=n.code)!=null?m:""};break;case"needs_new_password":i=`/v1/client/password_resets/${o.id}/set_new_password`,s={password:(h=n.password)!=null?h:"",...(w=n.securityAnswers)!=null&&w.length?{security_answers:n.securityAnswers}:{}};break;default:return t}let a=await e.post(i,s);if(!a.ok||!a.data)return{...t,busy:!1,errors:a.errors};let{id:l,status:c,pending_policies:d,policy_acceptance_token:u,pending_required_actions:p,required_action_token:f}=a.data;return{attempt:{id:l,status:c,...d?{pending_policies:d}:{},...u?{policy_acceptance_token:u}:{},...p?{pending_required_actions:p}:{},...f?{required_action_token:f}:{}},errors:[],busy:!1,ticket:(C=a.data.ticket)!=null?C:null,...r.askQuestions?await Yi(e,a.data.id,a.data.status):{}}}function Vi(e){var r;let t=e.attempt;if((t==null?void 0:t.status)!=="needs_policy_acceptance"&&(t==null?void 0:t.status)!=="needs_required_action")return null;let n=(r=t.policy_acceptance_token)!=null?r:t.required_action_token;return{...Y,attempt:t,...n?{policyToken:n}:{}}}async function Yi(e,t,n){if(n!=="needs_new_password")return{};let r=await Ri(e,t);return r!=null&&r.required?{securityQuestions:r.questions}:{}}function Be(e){var n;let t=(n=e.attempt)==null?void 0:n.status;if(!t)return"request";switch(t){case"needs_email_verification":return"collect_email_code";case"needs_second_factor":return"collect_second_factor";case"needs_new_password":return"collect_new_password";case"complete":return"done";default:return"unknown"}}async function Ji(e,t,n={}){let r=t.attempt;if(!(r!=null&&r.poll_secret))return t;let o=await e.get(`/v1/client/password_resets/${r.id}?poll_secret=${encodeURIComponent(r.poll_secret)}`);return!o.ok||!o.data?t:{...t,attempt:{id:o.data.id,status:o.data.status,poll_secret:r.poll_secret},...n.askQuestions?await Yi(e,o.data.id,o.data.status):{}}}var eg=Object.freeze({available:!0,passwordReset:!0,passwordSignUp:!0}),Zi="This app can't send email right now. Try another sign-in method or contact the app owner.";var dt=e=>!!e&&typeof e=="object"&&!Array.isArray(e);var gr=Object.freeze({username:null,lastSignInMethod:!1,emailVerification:"code",passwordReset:"code",emailSecondFactor:!1,passkeySignUp:null}),Qi=e=>e==="link"||e==="both"?e:"code";function mr(e){var o;let t=dt(e)&&dt(e.account)?e.account:null;if(!t)return{...gr};let n=dt(t.username)?t.username:null,r=(i,s)=>typeof i=="number"&&Number.isInteger(i)?i:s;return{username:n?{minLength:r(n.min_length,3),maxLength:r(n.max_length,30),charset:n.charset==="alphanumeric"||n.charset==="alphanumeric_underscore"?n.charset:"default",requiredAtSignUp:n.required_at_sign_up===!0}:null,lastSignInMethod:t.last_sign_in_method===!0,emailVerification:Qi(t.email_verification),passwordReset:Qi(t.password_reset),emailSecondFactor:t.email_second_factor===!0,...t.custom_second_factor===!0?{customSecondFactor:!0}:{},...dt(t.mfa)?{mfa:{totp:t.mfa.totp!==!1,sms:t.mfa.sms===!0,totpCodes:Number((o=t.mfa.totp_codes)!=null?o:t.mfa.totpCodes)>=2?2:1,...t.mfa.hotp===!0?{hotp:!0}:{},...t.mfa.yubikey===!0?{yubikey:!0}:{},...t.mfa.duo===!0?{duo:!0}:{},...t.mfa.security_questions===!0?{securityQuestions:!0}:{},...t.mfa.smart_card===!0?{smartCard:!0}:{}}}:{},passkeySignUp:dt(t.passkey_sign_up)?{email:t.passkey_sign_up.email==="off"||t.passkey_sign_up.email==="optional"?t.passkey_sign_up.email:"required"}:null}}function Xi(e){let t={...e};for(let n of["signUp","signIn"]){let r=t[n];r&&r.provider&&!r.enabled&&(t[n]={...r,enabled:!0})}return t}var xe=sl(ss());var Pg=new TextEncoder;var as=["auto","light","dark"],Ie=["primary","primaryInk","accent","background","surface","text","muted","border","danger","success","inputBackground","inputText"],jt=["none","uppercase"],ls={"minor-second":1.067,"major-second":1.125,"minor-third":1.2,"major-third":1.25,"perfect-fourth":1.333,"augmented-fourth":1.414,"perfect-fifth":1.5,golden:1.618,"minor-seventh":1.778,octave:2},cs=Object.keys(ls),qt=["none","sm","md","lg","xl"],Ht=["compact","comfortable","spacious"],Wt=["solid","glass","outline","none"],Kt=["narrow","normal","wide"],Gt=["center","left","right","split"],Vt=["left","right"],Yt=["card","page","hidden"],Jt=["sm","md","lg"],Qt=["solid","outline","soft","gradient"],Zt=["list","grid","icons"],Xt=["outline","filled","underline"],ds=["linear","radial"],_r=["cover","contain"],vr=["top-left","top","top-right","left","center","right","bottom-left","bottom","bottom-right"],ut=["none","dots","grid","noise"],en=["minimal","atlas","glass","midnight","editorial","terminal","sunrise","forest","grape","slate","split-photo","bold"],xr=/^#[0-9a-fA-F]{6}$/,wr=/^dasset_[0-9A-HJKMNP-TV-Z]{26}$/;var ne="system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",tn="Georgia, Cambria, 'Times New Roman', Times, serif",Sr="ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace",se="wght@400;500;600;700;800",us=[{id:"system",label:"System UI",family:null,category:"sans-serif",fallback:`-apple-system, BlinkMacSystemFont, ${ne}`,google:null},{id:"system-serif",label:"System serif (Georgia)",family:null,category:"serif",fallback:tn,google:null},{id:"system-mono",label:"System monospace",family:null,category:"monospace",fallback:Sr,google:null},{id:"inter",label:"Inter",family:"Inter",category:"sans-serif",fallback:ne,google:`Inter:${se}`},{id:"roboto",label:"Roboto",family:"Roboto",category:"sans-serif",fallback:ne,google:"Roboto:wght@400;500;700;800"},{id:"open-sans",label:"Open Sans",family:"Open Sans",category:"sans-serif",fallback:ne,google:`Open+Sans:${se}`},{id:"lato",label:"Lato",family:"Lato",category:"sans-serif",fallback:ne,google:"Lato:wght@400;700;900"},{id:"montserrat",label:"Montserrat",family:"Montserrat",category:"sans-serif",fallback:ne,google:`Montserrat:${se}`},{id:"poppins",label:"Poppins",family:"Poppins",category:"sans-serif",fallback:ne,google:`Poppins:${se}`},{id:"nunito",label:"Nunito",family:"Nunito",category:"sans-serif",fallback:ne,google:`Nunito:${se}`},{id:"work-sans",label:"Work Sans",family:"Work Sans",category:"sans-serif",fallback:ne,google:`Work+Sans:${se}`},{id:"dm-sans",label:"DM Sans",family:"DM Sans",category:"sans-serif",fallback:ne,google:`DM+Sans:${se}`},{id:"manrope",label:"Manrope",family:"Manrope",category:"sans-serif",fallback:ne,google:`Manrope:${se}`},{id:"source-serif",label:"Source Serif",family:"Source Serif 4",category:"serif",fallback:tn,google:`Source+Serif+4:${se}`},{id:"merriweather",label:"Merriweather",family:"Merriweather",category:"serif",fallback:tn,google:"Merriweather:wght@400;700;900"},{id:"playfair-display",label:"Playfair Display",family:"Playfair Display",category:"serif",fallback:tn,google:`Playfair+Display:${se}`},{id:"jetbrains-mono",label:"JetBrains Mono",family:"JetBrains Mono",category:"monospace",fallback:Sr,google:`JetBrains+Mono:${se}`},{id:"ibm-plex-mono",label:"IBM Plex Mono",family:"IBM Plex Mono",category:"monospace",fallback:Sr,google:"IBM+Plex+Mono:wght@400;500;600;700"}],ps=us.map(e=>e.id),fs=new Map(us.map(e=>[e.id,e])),fd=/^custom-[a-f0-9]{32}$/;function nn(e){return typeof e=="string"&&fd.test(e)}function gd(e){return`Brand ${e.slice(7,15)}`}function Cr(e){return nn(e)?{id:e,label:"Brand font",family:gd(e),category:"sans-serif",fallback:ne,google:null}:typeof e=="string"?fs.get(e):void 0}function Ar(e){var n;let t=(n=Cr(e))!=null?n:fs.get("system");return t.family?`'${t.family}', ${t.fallback}`:t.fallback}function gs(e){if(nn(e))return`/v1/design/fonts/${e}.css`;let t=Cr(e);return t!=null&&t.google?`/v1/design/fonts/${t.id}.css`:null}var Pr=e=>{if(!e||typeof e!="object"||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},Oe=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),K=e=>t=>typeof t=="string"&&e.includes(t),me=(e,t,n=1)=>r=>typeof r=="number"&&Number.isInteger(r)&&r>=e&&r<=t&&r%n===0,hs=(e,t)=>n=>typeof n=="number"&&!Number.isNaN(n)&&n>=e&&n<=t,pt=e=>typeof e=="string"&&xr.test(e),Er=e=>typeof e=="string"&&wr.test(e);function we(e,t=[]){return n=>{if(!Pr(n))return!1;for(let r of Object.keys(n)){if(!Oe(e,r))return!1;let o=n[r];if(o===void 0){if(t.includes(r))return!1;continue}if(!e[r](o))return!1}return t.every(r=>Oe(n,r)&&n[r]!==void 0)}}var md=K(ps),ms=e=>md(e)||nn(e),Rr={palette:Object.fromEntries(Ie.map(e=>[e,pt])),paletteDark:Object.fromEntries(Ie.map(e=>[e,pt])),typography:{font:ms,headingFont:ms,baseSize:me(12,20),headingWeight:me(400,800,100),bodyWeight:me(300,600,100),letterCase:K(jt),scale:K(cs)},shape:{radius:me(0,32),controlRadius:me(0,999),borderWidth:me(0,3)},elevation:{cardShadow:K(qt)},spacing:{density:K(Ht)},card:{style:K(Wt),blur:me(0,40),width:K(Kt)},layout:{position:K(Gt),splitImageSide:K(Vt),logoPlacement:K(Yt),logoSize:K(Jt)},buttons:{style:K(Qt),socialLayout:K(Zt)},inputs:{style:K(Xt)},logo:{assetId:Er,darkAssetId:Er}},hd=e=>{if(!we({type:K(ds),angle:me(0,360),stops:()=>!0},["type","stops"])(e))return!1;let t=e.stops;return Array.isArray(t)&&t.length>=2&&t.length<=4&&t.every(we({color:pt,at:hs(0,100)},["color","at"]))},yd=we({assetId:Er,fit:K(_r),position:K(vr),overlay:we({color:pt,opacity:hs(0,1)},["color","opacity"]),blur:me(0,20)},["assetId"]),Tr={color:pt,gradient:hd,image:yd,pattern:K(ut)},ft={version:e=>e===1,preset:K(en),colorScheme:K(as),background:we(Tr),backgroundDark:we(Tr),...Object.fromEntries(Object.entries(Rr).map(([e,t])=>[e,we(t)]))};function ys(e,t){return Oe(ft,e)&&ft[e](t)}var bs=we(ft);function ks(e,t=()=>{},n=""){let r=(...i)=>[n,...i].filter(Boolean).join(".");if(e==null)return{};if(!Pr(e))return t({path:n||"(root)",message:"must be an object"}),{};let o={};for(let[i,s]of Object.entries(e)){if(s===void 0)continue;if(!Oe(ft,i)){t({path:r(i),message:"Unknown setting."});continue}if(ft[i](s)){o[i]=s;continue}let a=Oe(Rr,i)?Rr[i]:i==="background"||i==="backgroundDark"?Tr:null;if(!a||!Pr(s)){t({path:r(i),message:"Invalid value."});continue}let l={};for(let[c,d]of Object.entries(s))d!==void 0&&(Oe(a,c)&&a[c](d)?l[c]=d:t({path:r(i,c),message:Oe(a,c)?"Invalid value.":"Unknown setting."}));Object.keys(l).length&&(o[i]=l)}return o}var bd=new Set(["__proto__","constructor","prototype"]),_s=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function Ir(e,t){let n={...e};for(let[r,o]of Object.entries(t)){if(bd.has(r)||o===void 0)continue;if(o===null){delete n[r];continue}let i=n[r];n[r]=_s(i)&&_s(o)?Ir(i,o):o}return n}function q(e){let t=e.split(" ");if(t.length!==Ie.length)throw new Error(`palette spec needs ${Ie.length} slots: ${e}`);let n={};return t.forEach((r,o)=>{r!=="-"&&(n[Ie[o]]=r)}),n}var vs={version:1,preset:"minimal",colorScheme:"auto",palette:q("#18181b #ffffff #4f46e5 #fafafa #ffffff #18181b #71717a #e4e4e7 #dc2626 #15803d #ffffff #18181b"),paletteDark:q("#fafafa #18181b #818cf8 #09090b #18181b #fafafa #a1a1aa #3f3f46 #f87171 #4ade80 #09090b #fafafa"),typography:{font:"inter",headingFont:"inter",baseSize:15,headingWeight:600,bodyWeight:400,letterCase:"none",scale:"perfect-fourth"},shape:{radius:12,controlRadius:8,borderWidth:1},elevation:{cardShadow:"md"},spacing:{density:"comfortable"},card:{style:"solid",blur:16,width:"normal"},layout:{position:"center",splitImageSide:"left",logoPlacement:"card",logoSize:"md"},buttons:{style:"solid",socialLayout:"list"},inputs:{style:"outline"},background:{},backgroundDark:{},logo:{}},xs={minimal:{design:{}},atlas:{design:{palette:q("#6d4aff #ffffff #0e8fc7 #f6f5ff #ffffff #0b0d17 #5b6078 #e2def5 #d92d3a #0f7a52 #ffffff #0b0d17"),paletteDark:q("#7455fa #ffffff #46c7ff #070811 #0f1120 #eef0f6 #959bb0 #262a40 #ff6b6b #43d9a0 #0b0d17 #eef0f6"),typography:{font:"system",headingFont:"system",headingWeight:600},shape:{radius:14,controlRadius:9,borderWidth:1},elevation:{cardShadow:"lg"},buttons:{style:"gradient"},background:{gradient:{type:"linear",angle:160,stops:[{color:"#f6f5ff",at:0},{color:"#eef6ff",at:100}]}},backgroundDark:{gradient:{type:"radial",stops:[{color:"#1a1440",at:0},{color:"#070811",at:70}]},pattern:"grid"}}},glass:{design:{palette:q("#4338ca - #db2777 #eef2ff #ffffff #111827 #4b5563 #ffffff - - #ffffff #111827"),paletteDark:q("#a5b4fc - #f472b6 #1e1b4b #111827 #f9fafb #cbd5e1 #374151 - - #0b1120 #f9fafb"),shape:{radius:20,controlRadius:12},elevation:{cardShadow:"xl"},card:{style:"glass",blur:20},background:{gradient:{type:"linear",angle:135,stops:[{color:"#6366f1",at:0},{color:"#ec4899",at:55},{color:"#f59e0b",at:100}]}},backgroundDark:{gradient:{type:"linear",angle:135,stops:[{color:"#1e1b4b",at:0},{color:"#4c1d95",at:55},{color:"#831843",at:100}]}}}},midnight:{design:{colorScheme:"dark",palette:q("#1d4ed8 - #7c3aed #eef2f9 #ffffff #0b1020 #475569 #d5dceb - - #ffffff #0b1020"),paletteDark:q("#60a5fa - #a78bfa #0b1020 #121a2f #e6eaf5 #94a3b8 #24314f #f87171 #34d399 #0e1528 #e6eaf5"),typography:{font:"manrope",headingFont:"manrope"},shape:{radius:16,controlRadius:10},elevation:{cardShadow:"lg"},backgroundDark:{pattern:"dots"}}},editorial:{design:{palette:q("#8b2e1f - #8a6410 #f7f3ec #fffdf8 #1f1a14 #6b6157 #e3dacb - - #fffdf8 #1f1a14"),paletteDark:q("#e07a5f - #d4a64a #16130f #1f1b16 #f2ebe0 #a89f92 #3a332a - - #16130f #f2ebe0"),typography:{font:"source-serif",headingFont:"playfair-display",baseSize:16,headingWeight:700,scale:"golden"},shape:{radius:4,controlRadius:2},elevation:{cardShadow:"sm"},inputs:{style:"underline"}}},terminal:{design:{colorScheme:"dark",palette:q("#166534 - #0e7490 #f4fbf3 #ffffff #0b2a0b #3f6b3c #b7d8b4 - - #ffffff #0b2a0b"),paletteDark:q("#39ff14 #031003 #00e5ff #0a0f0a #0d140d #c8f7c5 #7fb57b #2c5a2c #ff5555 #39ff14 #050805 #c8f7c5"),typography:{font:"jetbrains-mono",headingFont:"jetbrains-mono",baseSize:14,letterCase:"uppercase",scale:"major-second"},shape:{radius:0,controlRadius:0,borderWidth:1},elevation:{cardShadow:"none"},card:{style:"outline"},buttons:{style:"outline"},backgroundDark:{pattern:"grid"}}},sunrise:{design:{palette:q("#c2410c - #be185d #fff1e6 #ffffff #2a1a12 #7c5e52 #f4d9cb - - #ffffff #2a1a12"),paletteDark:q("#fb923c - #f472b6 #1a0f0a #24150f #fdebe1 #c4a092 #4a2e22 - - #1a0f0a #fdebe1"),typography:{font:"poppins",headingFont:"poppins"},shape:{radius:20,controlRadius:999},elevation:{cardShadow:"lg"},background:{gradient:{type:"linear",angle:160,stops:[{color:"#fff1e6",at:0},{color:"#ffe4ec",at:100}]}},backgroundDark:{gradient:{type:"linear",angle:160,stops:[{color:"#2a1209",at:0},{color:"#2a0f1c",at:100}]}}}},forest:{design:{palette:q("#166534 - #a16207 #f3f7f2 #ffffff #14261a #53685a #d6e3d8 - - #f3f7f2 #14261a"),paletteDark:q("#4ade80 - #facc15 #0c1510 #13201a #e3efe6 #9db5a4 #2a3d31 - - #0c1510 #e3efe6"),typography:{font:"dm-sans",headingFont:"dm-sans"},shape:{radius:10,controlRadius:8},inputs:{style:"filled"}}},grape:{design:{palette:q("#7e22ce - #be185d #faf5ff #ffffff #2e1065 #6b5b8a #e9d5ff - - #ffffff #2e1065"),paletteDark:q("#c084fc - #f472b6 #12081f #1c1030 #f3e8ff #b4a3cf #3b2559 - - #12081f #f3e8ff"),typography:{font:"nunito",headingFont:"nunito",headingWeight:800},shape:{radius:24,controlRadius:14},buttons:{socialLayout:"grid"},background:{pattern:"dots"},backgroundDark:{pattern:"dots"}}},slate:{design:{palette:q("#334155 - #0369a1 #f1f5f9 #ffffff #0f172a #64748b #cbd5e1 - - #f8fafc #0f172a"),paletteDark:q("#cbd5e1 - #38bdf8 #0f172a #1e293b #f1f5f9 #94a3b8 #334155 - - #0f172a #f1f5f9"),typography:{font:"work-sans",headingFont:"work-sans"},shape:{radius:8,controlRadius:6},elevation:{cardShadow:"sm"},spacing:{density:"compact"},inputs:{style:"filled"}}},"split-photo":{design:{layout:{position:"split",splitImageSide:"left",logoPlacement:"page"},card:{style:"none",width:"normal"},elevation:{cardShadow:"none"},shape:{radius:0,controlRadius:8},background:{gradient:{type:"linear",angle:135,stops:[{color:"#0f172a",at:0},{color:"#334155",at:100}]}},backgroundDark:{gradient:{type:"linear",angle:135,stops:[{color:"#020617",at:0},{color:"#1e293b",at:100}]}}}},bold:{design:{palette:q("#4338ca - #ca8a04 #4338ca #ffffff #111827 #4b5563 #e5e7eb - - #ffffff #111827"),paletteDark:q("#a5b4fc - #facc15 #1e1b4b #111827 #f9fafb #cbd5e1 #374151 - - #0b1120 #f9fafb"),typography:{font:"montserrat",headingFont:"montserrat",baseSize:17,headingWeight:800,letterCase:"uppercase",scale:"octave"},shape:{radius:24,controlRadius:999,borderWidth:0},elevation:{cardShadow:"xl"},spacing:{density:"spacious"},card:{width:"wide"}}}};var He=(e,t,n)=>Math.min(n,Math.max(t,e));function We(e){if(!e||typeof e!="string")return null;let t=e.trim().toLowerCase();if(t==="transparent")return{r:0,g:0,b:0,a:0};let n=/^#([0-9a-f]{3,8})$/.exec(t);if(n){let l=n[1];if((l.length===3||l.length===4)&&(l=[...l].map(d=>d+d).join("")),l.length!==6&&l.length!==8)return null;let c=d=>parseInt(l.slice(d,d+2),16);return{r:c(0),g:c(2),b:c(4),a:l.length===8?c(6)/255:1}}let r=/^rgba?\(([^)]+)\)$/.exec(t);if(!r)return null;let o=r[1].replace("/"," ").split(/[\s,]+/).filter(Boolean);if(o.length<3)return null;let i=l=>l.endsWith("%")?parseFloat(l)/100*255:parseFloat(l),s=l=>l===void 0?1:l.endsWith("%")?parseFloat(l)/100:parseFloat(l),a={r:He(i(o[0]),0,255),g:He(i(o[1]),0,255),b:He(i(o[2]),0,255),a:He(s(o[3]),0,1)};return[a.r,a.g,a.b,a.a].some(Number.isNaN)?null:a}var rn=e=>He(Math.round(e),0,255).toString(16).padStart(2,"0");function sn(e){return`#${rn(e.r)}${rn(e.g)}${rn(e.b)}`}function kd(e){let t=n=>{let r=n/255;return r<=.03928?r/12.92:((r+.055)/1.055)**2.4};return .2126*t(e.r)+.7152*t(e.g)+.0722*t(e.b)}function on(e){let t=We(e);return t?kd(t):null}function gt(e,t){let n=on(e),r=on(t);if(n===null||r===null)return 1;let o=Math.max(n,r),i=Math.min(n,r);return(o+.05)/(i+.05)}var _d=4.5,vd=3;function ws(e){var t;return((t=on(e))!=null?t:0)>.179?"#111827":"#ffffff"}function xd(e,t,n){let r=e/255,o=t/255,i=n/255,s=Math.max(r,o,i),a=Math.min(r,o,i),l=(s+a)/2;if(s===a)return[0,0,l];let c=s-a,d=l>.5?c/(2-s-a):c/(s+a);return[s===r?((o-i)/c+(o<i?6:0))/6:s===o?((i-r)/c+2)/6:((r-o)/c+4)/6,d,l]}function wd(e,t,n){let r=n<.5?n*(1+t):n+t-n*t,o=2*n-r,i=a=>{let l=a;return l<0&&(l+=1),l>1&&(l-=1),l<1/6?o+(r-o)*6*l:l<1/2?r:l<2/3?o+(r-o)*(2/3-l)*6:o};return`#${(t===0?[n,n,n]:[i(e+1/3),i(e),i(e-1/3)]).map(a=>rn(He(a,0,1)*255)).join("")}`}function Sd(e,t,n=_d){var u;let r=We(e);if(!r||t.length===0)return e;let o=p=>t.every(f=>gt(p,f)>=n);if(o(e))return e;let s=((u=on(t[0]))!=null?u:1)>.179?-.01:.01,[a,l,c]=xd(r.r,r.g,r.b),d=e;for(let p=1;p<=100;p+=1){let f=c+s*p;if(f<0||f>1)break;if(d=wd(a,l,f),o(d))return d}return d}function Ss(e,t){return Sd(e,t,vd)}var Cd=["primary","accent","danger","success"],Ce=e=>JSON.parse(JSON.stringify(e));function As(e){if(!e||typeof e!="object"||Array.isArray(e))return{};if(bs(e))return Ce(e);let t={};for(let[n,r]of Object.entries(e))r!==void 0&&ys(n,r)&&(t[n]=Ce(r));return t}function Cs(e,t){if(!t)return e;let n={...e};for(let[r,o]of Object.entries(t))o!==void 0&&(n[r]=o);return t.primary&&!t.primaryInk&&(n.primaryInk=ws(t.primary)),n}function Or(e,t,n){var i,s,a;t.colorScheme&&(e.colorScheme=t.colorScheme);let r=e.palette;e.palette=Cs(e.palette,t.palette);let o=t.paletteDark?{...t.paletteDark}:void 0;if(n.carryBrand&&t.palette){for(let l of Cd){let c=t.palette[l];c&&c!==r[l]&&!((i=t.paletteDark)!=null&&i[l])&&(o={...o!=null?o:{},[l]:c})}t.palette.primaryInk&&!((s=t.paletteDark)!=null&&s.primaryInk)&&(o!=null&&o.primary)&&(o.primaryInk=t.palette.primaryInk)}if(e.paletteDark=Cs(e.paletteDark,o),t.typography){let l=t.typography;e.typography={...e.typography,...Se(l),headingFont:(a=l.headingFont)!=null?a:l.font?l.font:e.typography.headingFont}}if(t.shape&&(e.shape={...e.shape,...Se(t.shape)}),t.elevation&&(e.elevation={...e.elevation,...Se(t.elevation)}),t.spacing&&(e.spacing={...e.spacing,...Se(t.spacing)}),t.card&&(e.card={...e.card,...Se(t.card)}),t.layout&&(e.layout={...e.layout,...Se(t.layout)}),t.buttons&&(e.buttons={...e.buttons,...Se(t.buttons)}),t.inputs&&(e.inputs={...e.inputs,...Se(t.inputs)}),t.background&&(e.background=Ce(t.background)),t.backgroundDark)e.backgroundDark=Ce(t.backgroundDark);else if(t.background&&n.carryBrand){let l={};t.background.gradient&&(l.gradient=Ce(t.background.gradient)),t.background.image&&(l.image=Ce(t.background.image)),t.background.pattern&&(l.pattern=t.background.pattern),e.backgroundDark=l}t.logo&&(e.logo=Ce(t.logo))}function Se(e){let t={};for(let[n,r]of Object.entries(e))r!==void 0&&(t[n]=r);return t}function Fr(e){return typeof e=="string"&&en.includes(e)}function mt(e){let t=As(e),n=Fr(t.preset)?t.preset:"minimal",r=Ce(vs);return r.preset=n,Or(r,xs[n].design,{carryBrand:!1}),Or(r,t,{carryBrand:!0}),r}function Ps(e,t){let n=mt(e),r=As(t);return delete r.preset,Or(n,r,{carryBrand:!0}),n}var Ad=Object.freeze({"--atlas-color-primary":"--atlas-host-accent","--atlas-color-primary-ink":"--atlas-host-accent-ink","--atlas-color-surface":"--atlas-host-surface","--atlas-card-background":"--atlas-host-surface","--atlas-color-text":"--atlas-host-ink","--atlas-color-border":"--atlas-host-line","--atlas-radius-control":"--atlas-host-radius","--atlas-font-body":"--atlas-host-font","--atlas-focus-outline-color":"--atlas-host-focus-ring"});function Dr(e){var o,i,s,a,l,c,d,u,p,f,g,m,h,w;let t=(C,S,A)=>typeof S=="string"&&C.includes(S)?S:A,n=(o=e==null?void 0:e.background)!=null?o:{},r={"data-atlas-layout":t(Gt,(i=e==null?void 0:e.layout)==null?void 0:i.position,"center"),"data-atlas-split-side":t(Vt,(s=e==null?void 0:e.layout)==null?void 0:s.splitImageSide,"left"),"data-atlas-logo":t(Yt,(a=e==null?void 0:e.layout)==null?void 0:a.logoPlacement,"card"),"data-atlas-logo-size":t(Jt,(l=e==null?void 0:e.layout)==null?void 0:l.logoSize,"md"),"data-atlas-card":t(Wt,(c=e==null?void 0:e.card)==null?void 0:c.style,"solid"),"data-atlas-card-width":t(Kt,(d=e==null?void 0:e.card)==null?void 0:d.width,"normal"),"data-atlas-shadow":t(qt,(u=e==null?void 0:e.elevation)==null?void 0:u.cardShadow,"md"),"data-atlas-density":t(Ht,(p=e==null?void 0:e.spacing)==null?void 0:p.density,"comfortable"),"data-atlas-button":t(Qt,(f=e==null?void 0:e.buttons)==null?void 0:f.style,"solid"),"data-atlas-social":t(Zt,(g=e==null?void 0:e.buttons)==null?void 0:g.socialLayout,"list"),"data-atlas-input":t(Xt,(m=e==null?void 0:e.inputs)==null?void 0:m.style,"outline"),"data-atlas-pattern":t(ut,n.pattern,"none"),"data-atlas-pattern-dark":t(ut,(h=e==null?void 0:e.backgroundDark)==null?void 0:h.pattern,"none"),"data-atlas-letter-case":t(jt,(w=e==null?void 0:e.typography)==null?void 0:w.letterCase,"none")};return((e==null?void 0:e.colorScheme)==="dark"||(e==null?void 0:e.colorScheme)==="light")&&(r["data-atlas-theme"]=e.colorScheme),r}function Es(e){var n,r;let t=new Set;for(let o of[(n=e==null?void 0:e.typography)==null?void 0:n.font,(r=e==null?void 0:e.typography)==null?void 0:r.headingFont]){let i=gs(o);i&&t.add(i)}return[...t]}var _h=Object.freeze([...new Set(Object.values(Ad))]);function Lr(){try{return typeof process!="undefined"&&!1}catch{return!1}}var Ts=e=>{Lr()&&console.warn(`[atlas] ${e}`)},Rs=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function Pd(e,t=Ts,n="design"){return e!=null&&(typeof e!="object"||Array.isArray(e))?(t(`${n} must be an object; ignored.`),{}):ks(e,r=>t(r.message==="Unknown setting."&&r.path.split(".").length===n.split(".").length+1?`${r.path} is not a design setting; ignored.`:`${r.path} is invalid; ignored.`),n)}function Is(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619)>>>0;return t.toString(36)}var Ed=/^(?:https:\/\/[A-Za-z0-9.-]+(?::\d{1,5})?|http:\/\/(?:localhost|127\.0\.0\.1)(?::\d{1,5})?)$/;function Rd(e,t){let n=(t!=null?t:"").replace(/\/+$/,"");return n&&!Ed.test(n)?[]:Es(e).map(r=>`${n}${r}`)}function Td(e){if(!(!Rs(e)||!Rs(e.resolved)))return e.resolved}function Os(e){var c,d,u;let t=(c=e.warn)!=null?c:Ts,n=Td(e.instance),r=Pd(e.design,t,"appearance.design"),o,i=(d=e.preset)!=null?d:r.preset;i!==void 0&&(Fr(i)?o=i:t(`appearance.preset "${String(i)}" is not a preset; ignored.`));let s=o!==void 0||Object.keys(r).some(p=>p!=="preset");if(!n&&!s)return null;let a=o?mt({preset:o}):n?mt(n):mt({}),l=Ir((u=e.tokensDesign)!=null?u:{},r);return Ps(a,l)}function Fs(e,t){return Rd(e,t)}var Ds=null;function Id(e){var t,n;if(Ds)return Ds;try{let r=(t=e.querySelector)==null?void 0:t.call(e,'meta[name="csp-nonce"]'),o=r==null?void 0:r.getAttribute("content");if(o)return o;let i=(n=e.querySelector)==null?void 0:n.call(e,"script[nonce]"),s=i?i.nonce||i.getAttribute("nonce"):null;if(s)return s}catch{}return null}var Ls=new WeakMap,$s=new WeakMap;function an(e,t){let n=Id(e);if(n){t.setAttribute("nonce",n);try{t.nonce=n}catch{}}}function ln(e,t,n){var o;let r=globalThis.CSSStyleSheet;if(r&&Array.isArray(e.adoptedStyleSheets)&&typeof((o=r.prototype)==null?void 0:o.replaceSync)=="function")try{let i=Ls.get(e);i||Ls.set(e,i=new Map);let s=$s.get(e);s||$s.set(e,s=new Map),s.set(t,n);let a=i.get(t);return a?a.replaceSync(n):(a=new r,i.set(t,a),a.replaceSync(n),e.adoptedStyleSheets=[...e.adoptedStyleSheets,a]),!0}catch{}return!1}var Ms=new Set,Us=e=>{var t;!Lr()||Ms.has(e)||(Ms.add(e),(t=globalThis.console)==null||t.warn(`[atlas] ${e}`))};function Ns(e){var r,o;if(!e||typeof e!="object")return null;let t=e,n=(o=t.design)!=null?o:(r=t.appearance)==null?void 0:r.design;return n&&typeof n=="object"&&n.resolved?n:null}function zs(e,t,n,r){var o,i;for(let s of(o=r==null?void 0:r.attributes)!=null?o:[])s in n.attributes||t.removeAttribute(s);for(let s of(i=r==null?void 0:r.style)!=null?i:[])s in n.style||t.style.removeProperty(s);for(let[s,a]of Object.entries(n.style))t.style.setProperty(s,a);for(let[s,a]of Object.entries(n.attributes))t.setAttribute(s,a);if(n.css){let s=e;if(!ln(s,`design:${n.key}`,n.css)&&!Array.from(e.head.querySelectorAll("style[data-atlas-design]")).some(l=>l.getAttribute("data-atlas-design")===n.key)){let l=e.createElement("style");l.setAttribute("data-atlas-design",n.key),an(s,l),l.textContent=n.css,e.head.appendChild(l)}}if(n.fontStylesheets.length){let s=new Set(Array.from(e.head.querySelectorAll("link[data-atlas-font]")).map(a=>a.getAttribute("href")));for(let a of n.fontStylesheets){if(s.has(a))continue;let l=e.createElement("link");l.setAttribute("rel","stylesheet"),l.setAttribute("href",a),l.setAttribute("data-atlas-font",""),e.head.appendChild(l)}}return{attributes:Object.keys(n.attributes),style:Object.keys(n.style)}}var Od=["boxes","single"];function js(e,t){for(let n of[t,e])if(n&&Od.includes(n))return n;return"boxes"}var qs=8,Fd=["solid","outline","soft","ghost"],Dd=["none","scale","lift","glow","ripple"],Ld=["none","sm","md","lg"],$d=["comfortable","compact"],Md=["outline","filled","underline"],Ud=["slow","normal","fast"],Nd=["spinner","skeleton","dots","bar"],Hs={slow:280,normal:160,fast:80};function cn(e,t){let n=(r,o,...i)=>{for(let s of i)if(s!==void 0&&r.includes(s))return s;return o};return{buttonStyle:n(Fd,"solid",t==null?void 0:t.buttonStyle,e==null?void 0:e.buttonStyle),buttonEffect:n(Dd,"scale",t==null?void 0:t.buttonEffect,e==null?void 0:e.buttonEffect),shadow:n(Ld,"md",t==null?void 0:t.shadow,e==null?void 0:e.shadow),density:n($d,"comfortable",t==null?void 0:t.density,e==null?void 0:e.density),inputStyle:n(Md,"outline",t==null?void 0:t.inputStyle,e==null?void 0:e.inputStyle),animations:typeof(t==null?void 0:t.animations)=="boolean"?t.animations:typeof(e==null?void 0:e.animations)=="boolean"?e.animations:!0,motionSpeed:n(Ud,"normal",t==null?void 0:t.motionSpeed,e==null?void 0:e.motionSpeed),loading:n(Nd,"spinner",t==null?void 0:t.loading,e==null?void 0:e.loading)}}var zd=["block","compact","icon"],Bd=["sm","md","lg"],jd=["list","grid","carousel"],qd=["auto","always","never"];function $r(e,t){var r,o,i;let n=(s,...a)=>{for(let l of a)if(l!==void 0&&s.includes(l))return l;return s[0]};return{variant:n(zd,t==null?void 0:t.variant,e==null?void 0:e.variant),size:n(Bd,(r=t==null?void 0:t.size)!=null?r:"md",e==null?void 0:e.size,"md"),layout:n(jd,t==null?void 0:t.layout,e==null?void 0:e.layout),labels:{...(o=e==null?void 0:e.labels)!=null?o:{},...(i=t==null?void 0:t.labels)!=null?i:{}},search:n(qd,t==null?void 0:t.search,e==null?void 0:e.search)}}var he={colorPrimary:"#5b5bd6",colorText:"#1c1c1f",colorBackground:"#ffffff",colorAccent:"#5b5bd6",colorCard:"#ffffff",colorBorder:"#e4e4e9",borderRadius:"10px",fontFamily:'ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif'};function Hd(e){return e?{colorPrimary:e.colorPrimary||he.colorPrimary,colorText:e.colorText||he.colorText,colorBackground:e.colorBackground||he.colorBackground,colorAccent:e.colorAccent||e.colorPrimary||he.colorAccent,colorCard:e.colorCard||e.colorBackground||he.colorCard,colorBorder:e.colorBorder||he.colorBorder,borderRadius:e.borderRadius||he.borderRadius,fontFamily:e.fontStack||he.fontFamily}:he}function Ws(e,t){var o;let n={...Hd(e)},r=(o=t==null?void 0:t.variables)!=null?o:{};for(let[i,s]of Object.entries(r))s!==void 0&&(n[i]=s);return n}function Ks(e){let t={};for(let[n,r]of Object.entries(e))t[`--atlas-embed-${n.replace(/[A-Z]/g,o=>`-${o.toLowerCase()}`)}`]=r;return t}function Gs(e){let t=We(e);if(!t)return"#ffffff";let n=sn(t);return gt("#ffffff",n)>=gt("#111111",n)?"#ffffff":"#111111"}function Vs(e,t){let n=We(e);if(!n)return e;let r=sn(n),o=t.map(i=>We(i)).filter(i=>!!i&&i.a>0).map(sn);return o.length===0||o.every(i=>gt(r,i)>=3)?e:Ss(r,o)}function Ys(e,t,n){var o;let r=(o=n==null?void 0:n.elements)==null?void 0:o[e];return r?`${t} ${r}`:t}function Js(e,t){var s,a;let n=(s=t==null?void 0:t.providerOrder)!=null?s:[],r=new Set((a=t==null?void 0:t.providerHidden)!=null?a:[]),o=new Set(e.filter(l=>!r.has(l))),i=[];for(let l of n)o.has(l)&&!i.includes(l)&&i.push(l);for(let l of e)o.has(l)&&!i.includes(l)&&i.push(l);return i}var Bs={google:"Google",github:"GitHub",gitlab:"GitLab",facebook:"Facebook",apple:"Apple",microsoft:"Microsoft",discord:"Discord",linkedin:"LinkedIn",twitter:"X",twitter_v1:"X",x:"X",slack:"Slack",spotify:"Spotify",twitch:"Twitch",notion:"Notion",linear:"Linear",steam:"Steam"};function dn(e){return Bs[e]?Bs[e]:e.split(/[_-]/).map(t=>t&&t[0].toUpperCase()+t.slice(1)).join(" ")}var Wd="0.18.1",Qs={name:"@atlasauth/embed",version:Wd};function Kd(e,t){return(n,r)=>{let o=typeof n=="string"?n:n.toString(),i;try{i=new URL(o)}catch{return t(n,r)}return i.searchParams.has("publishable_key")||i.searchParams.set("publishable_key",e),t(i.toString(),r)}}function ue(e){var n;let t=(n=e.fetchImpl)!=null?n:fetch;return new At({publishableKey:e.publishableKey,baseUrl:e.frontendApi.replace(/\/$/,""),fetchImpl:Kd(e.publishableKey,t),locale:e.locale,sdk:Qs,referral:e.referral,referralConsent:e.referralConsent})}async function Zs(e){let t=await e.get("/v1/appearance");return t.ok?t.data:null}var Mr="atlas-embed-styles",Xs=`
|
|
38
|
+
};`;async function Jc(e,t={}){var i,s,a,l;let n=(i=t.cancelled)!=null?i:()=>!1,r=globalThis;if(t.workers!==!1&&r.Worker&&r.Blob&&((s=r.URL)!=null&&s.createObjectURL)){let c=await Qc(e,Math.max(1,Math.min(4,(l=(a=r.navigator)==null?void 0:a.hardwareConcurrency)!=null?l:2)),n).catch(()=>{});if(c!==void 0){if(c===null)throw new Error("captcha: no solution");return{n:c,worker:!0}}}let o=await Vc(e,0,e.maxnumber,n);if(o===null)throw new Error(n()?"captcha: cancelled":"captcha: no solution");return{n:o,worker:!1}}function Qc(e,t,n){let r=URL.createObjectURL(new Blob([Yc],{type:"text/javascript"})),o=[],i=()=>{for(let s of o)s.terminate();URL.revokeObjectURL(r)};return new Promise((s,a)=>{let l=t,c=Math.ceil((e.maxnumber+1)/t),d=setInterval(()=>{n()&&(clearInterval(d),i(),s(null))},100),u=p=>{clearInterval(d),i(),p instanceof Error?a(p):s(p)};try{for(let p=0;p<t;p++){let f=new Worker(r);o.push(f),f.onmessage=k=>{var g;typeof((g=k.data)==null?void 0:g.n)=="number"?u(k.data.n):--l===0&&u(null)},f.onerror=()=>u(new Error("captcha: worker failed"));let m=p*c;f.postMessage({salt:e.salt,challenge:e.challenge,from:m,to:Math.min(e.maxnumber,m+c-1)})}}catch(p){u(p instanceof Error?p:new Error("captcha: worker failed"))}})}var Xc=e=>{let t=new TextEncoder().encode(e),n="";for(let r=0;r<t.length;r++)n+=String.fromCharCode(t[r]);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")};function Zc(e){return`atlas1.${Xc(JSON.stringify(e))}`}async function ed(e,t=!1){let n=t?`${e}${e.includes("?")?"&":"?"}accessible=true`:e,r=await fetch(n,{method:"GET",credentials:"omit"});if(!r.ok)throw new Error(`captcha: challenge refused (${r.status})`);return await r.json()}function Wi(e,t){let n=e.createElement("img");return n.src=`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(t)))}`,n.alt="",n.width=64,n.height=64,n.style.cssText="display:block;width:64px;height:64px;border-radius:6px",n}function td(e,t,n,r){let o=e.ownerDocument;return new Promise((i,s)=>{e.replaceChildren();let a=o.createElement("div");a.setAttribute("role","group"),a.setAttribute("data-atlas-captcha-puzzle",""),a.style.cssText="display:flex;flex-direction:column;align-items:center;gap:8px";let l=o.createElement("p");l.style.cssText="margin:0;font-size:13px;text-align:center",l.textContent=n.puzzlePrompt,a.append(l,Wi(o,t.interactive.example));let c=o.createElement("div");c.style.cssText="display:grid;grid-template-columns:repeat(3,72px);gap:6px";let d=0;t.interactive.tiles.forEach((p,f)=>{let m=o.createElement("button");m.type="button",m.setAttribute("aria-pressed","false"),m.setAttribute("aria-label",n.tile.replace("{n}",String(f+1))),m.setAttribute("data-atlas-captcha-tile",String(f)),m.style.cssText="padding:3px;border:2px solid transparent;border-radius:8px;background:none;cursor:pointer",m.append(Wi(o,p)),m.addEventListener("click",()=>{d^=1<<f;let k=(d&1<<f)!==0;m.setAttribute("aria-pressed",k?"true":"false"),m.style.borderColor=k?"currentColor":"transparent"}),c.append(m)});let u=o.createElement("button");if(u.type="button",u.setAttribute("data-atlas-captcha-confirm",""),u.textContent=n.confirm,u.addEventListener("click",()=>r()?s(new Error("captcha: widget removed")):i(d)),a.append(c,u),t.accessible_alternative){let p=o.createElement("button");p.type="button",p.setAttribute("data-atlas-captcha-alternative",""),p.style.cssText="font-size:12px;background:none;border:0;text-decoration:underline;cursor:pointer",p.textContent=n.alternative,p.addEventListener("click",()=>i("accessible")),a.append(p)}e.append(a)})}function gr(e,t){var f,m;let n={...Wc,...t.labels},r=(f=t.mode)!=null?f:"managed",o=e.ownerDocument,i=(m=t.fetchChallenge)!=null?m:k=>t.challengeUrl?ed(t.challengeUrl,k):Promise.reject(new Error("captcha: no challenge URL")),s=!1,a=0,l=()=>s,c=o.createElement("div");c.setAttribute("role","status"),c.setAttribute("aria-live","polite"),c.setAttribute("data-atlas-captcha-provider","atlas"),c.style.cssText="font-size:13px;opacity:.85;text-align:center",e.append(c);let d=k=>{c.replaceChildren(),c.textContent=k},u=async k=>{let g=await i(k);if(s)throw new Error("captcha: widget removed");a=Date.parse(g.expires_at)||0,(r==="visible"||g.interactive)&&d(n.checking);let _=Date.now(),S=Jc(g,{workers:t.workers,cancelled:l}).then(y=>({...y,ms:Date.now()-_}));S.catch(()=>{});let x;if(g.interactive){let y=await td(c,g,n,l);if(y==="accessible")return d(n.checking),u(!0);x=y,d(n.checking)}let{n:w,worker:P,ms:C}=await S;if(s)throw new Error("captcha: widget removed");return(r==="visible"||x!==void 0)&&d(n.verified),Zc({t:g.token,n:w,ms:C,...P?{w:1}:{},...x!==void 0?{sel:x}:{}})},p=u(!1);return p.catch(()=>{}),{token:p,stale:()=>a>0&&Date.now()>a-15e3,remove(){s=!0,c.remove()}}}var nd=new Set(["atlas","turnstile","hcaptcha","recaptcha","recaptcha_v3","recaptcha_enterprise","captchafox","vercel_botid"]);function pt(e,t){return!e||!nd.has(e)?!1:e==="vercel_botid"?!!(t!=null&&t.attestationUrl):!0}function We(e){return!!e&&e.enabled===!0&&pt(e.provider,e)}var rd=["CAPTCHA_REQUIRED","CAPTCHA_FAILED"];function mr(e){return!!e&&typeof e.code=="string"&&rd.includes(e.code)}var od={turnstile:{src:()=>"https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit",global:"turnstile"},hcaptcha:{src:()=>"https://js.hcaptcha.com/1/api.js?render=explicit",global:"hcaptcha"},recaptcha:{src:()=>"https://www.google.com/recaptcha/api.js?render=explicit",global:"grecaptcha"},recaptcha_v3:{src:e=>`https://www.google.com/recaptcha/api.js?render=${encodeURIComponent(e)}`,global:"grecaptcha"},recaptcha_enterprise:{src:e=>`https://www.google.com/recaptcha/enterprise.js?render=${encodeURIComponent(e)}`,global:"grecaptcha"},captchafox:{src:()=>"https://cdn.captchafox.com/api.js?render=explicit",global:"captchafox"}};function Ki(e,t,n){let r=od[e];if(!r)return Promise.reject(new Error(`captcha: ${e} is not renderable`));if(n[r.global])return Promise.resolve(n[r.global]);let o=n.document,i=`__atlasCaptchaLoad_${e}`,s=n[i];if(s)return s;let a=new Promise((l,c)=>{var f,m;let d=()=>{n[r.global]?l(n[r.global]):c(new Error(`captcha: ${e} script loaded but global missing`))},u=r.src(t),p=o.querySelector(`script[src="${u}"]`);if(p){if(n[r.global])return l(n[r.global]);p.addEventListener("load",d,{once:!0}),p.addEventListener("error",()=>c(new Error(`captcha: ${e} script failed`)),{once:!0});return}p=o.createElement("script"),p.src=u,p.async=!0,p.defer=!0,p.addEventListener("load",d,{once:!0}),p.addEventListener("error",()=>c(new Error(`captcha: ${e} script failed`)),{once:!0}),((m=(f=o.head)!=null?f:o.body)!=null?m:o.documentElement).appendChild(p)});return n[i]=a,a.catch(()=>{n[i]===a&&delete n[i]}),a}function id(e,t,n,r,o){return new Promise((i,s)=>{let a=e.render(t,{sitekey:n,appearance:r==="invisible"?"interaction-only":"always",callback:l=>i(l),"error-callback":()=>s(new Error("captcha: turnstile error")),"timeout-callback":()=>s(new Error("captcha: turnstile timeout"))});o(()=>{var l;return(l=e.remove)==null?void 0:l.call(e,a)}),r==="invisible"&&e.execute&&e.execute(a)})}function sd(e,t,n,r,o){return new Promise((i,s)=>{let a=e.render(t,{sitekey:n,size:r==="invisible"?"invisible":"normal",callback:l=>i(l),"error-callback":()=>s(new Error("captcha: hcaptcha error"))});if(o(()=>{var l;return(l=e.remove)==null?void 0:l.call(e,a)}),r==="invisible"){let l=e.execute(a,{async:!0});l&&typeof l.then=="function"&&l.then(c=>i(c.response),s)}})}function ad(e,t,n,r,o){return new Promise((i,s)=>{let a=e.render(t,{sitekey:n,size:r==="invisible"?"invisible":"normal",callback:l=>i(l),"error-callback":()=>s(new Error("captcha: recaptcha error"))});if(o(()=>{var l;return(l=e.reset)==null?void 0:l.call(e,a)}),r==="invisible"&&e.execute){let l=e.execute(void 0,{widgetId:a});l&&typeof l.then=="function"&&l.then(i,s)}})}function ld(e,t,n,r,o){return new Promise((i,s)=>{let a=()=>s(new Error("captcha: captchafox error"));Promise.resolve(e.render(t,{sitekey:n,mode:r==="invisible"?"hidden":"inline",onVerify:l=>i(l),onError:a,onFail:a})).then(l=>{o(()=>{var c;return(c=e.remove)==null?void 0:c.call(e,l)}),r==="invisible"&&e.execute&&Promise.resolve(e.execute(l)).then(c=>{typeof c=="string"&&c&&i(c)},a)},a)})}async function Gi(e,t=globalThis.fetch){let n=await t(e,{method:"POST",credentials:"same-origin",headers:{accept:"application/json"}});if(!n.ok)throw new Error(`captcha: BotID attestation route answered ${n.status}`);let r=await n.json();if(typeof r.token!="string"||!r.token)throw new Error("captcha: BotID attestation missing");return r.token}function cd(e,t){let n=()=>{let r=e.execute(t,{action:"submit"});return r&&typeof r.then=="function"?r:Promise.reject(new Error("captcha: recaptcha v3 execute returned no promise"))};return new Promise((r,o)=>{e.ready?e.ready(()=>n().then(r,o)):n().then(r,o)})}function Vi(e,t,n={}){var p,f,m,k,g,_,S,x,w;let r=(p=e.provider)!=null?p:"";if(r==="atlas")return gr(t,{challengeUrl:e.challengeUrl,mode:(f=e.widget)!=null?f:"managed",...n.atlas});if(r==="vercel_botid"){let P=!1,C=(k=(m=t.ownerDocument)==null?void 0:m.defaultView)!=null?k:globalThis,y=e.attestationUrl?Gi(e.attestationUrl,(g=C.fetch)==null?void 0:g.bind(C)).then(h=>{if(P)throw new Error("captcha: widget removed");return h}):Promise.reject(new Error("captcha: vercel_botid needs an attestationUrl"));return y.catch(()=>{}),{token:y,remove(){P=!0}}}let o=(_=e.siteKey)!=null?_:"",i=(S=e.widget)!=null?S:"managed",s=(w=(x=t.ownerDocument)==null?void 0:x.defaultView)!=null?w:globalThis,a=!1,l=null,c=null,d=P=>{l=P};return{token:new Promise((P,C)=>{c=C,Ki(r,o,s).then(y=>{if(a)throw new Error("captcha: widget removed");switch(r){case"turnstile":return id(y,t,o,i,d);case"hcaptcha":return sd(y,t,o,i,d);case"recaptcha":return ad(y,t,o,i,d);case"recaptcha_v3":case"recaptcha_enterprise":return cd(y,o);case"captchafox":return ld(y,t,o,i,d);default:throw new Error(`captcha: ${r} is not renderable`)}}).then(P,C)}),remove(){if(!a){a=!0;try{l==null||l()}catch{}for(;t.firstChild;)t.removeChild(t.firstChild);c==null||c(new Error("captcha: widget removed"))}}}}async function hr(e,t,n){return Vi(e,t,n).token}var dd="/v1/client/sign_ins/passkey/begin",Yi=async(e,t)=>{try{return await e(t)||null}catch{return null}};async function yr(e,t={}){var l;let n=c=>e.post(dd,c?{captcha_token:c}:{}),r=(l=t.captcha)!=null?l:null,o=r?await Yi(r,{retry:!1}):null,i=await n(o);if(i.ok||!r)return i;let s=i.errors.find(c=>mr(c));if(!s)return i;let a=await Yi(r,{retry:!0,refused:s.code==="CAPTCHA_FAILED"?"CAPTCHA_FAILED":"CAPTCHA_REQUIRED"});return a?n(a):i}var Ji="FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6BF12FFA06D98A0864D87602733EC86A64521F2B18177B200CBBE117577A615D6C770988C0BAD946E208E24FA074E5AB3143DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF",vf=BigInt("0x"+Ji),xf=BigInt(0),wf=BigInt(1),Cf=BigInt(5),Sf=Ji.length/2,Af=new TextEncoder;var jt=class extends Error{constructor(n,r,o,i,s,a){super(o);v(this,"code");v(this,"status");v(this,"param");v(this,"reason");v(this,"meta");this.name="OrganizationRequestError",this.status=n,this.code=r,this.param=i,s&&(this.reason=s),a&&(this.meta=a)}get needsReverification(){return this.code==="STEP_UP_REQUIRED"}};var Y=encodeURIComponent,M=e=>`/v1/client/organizations/${Y(e)}`;async function U(e,t,n={}){var o,i;let r=await e.request(t,n);if(!r.ok||!r.data){let s=r.errors[0];throw new jt(r.status,(o=s==null?void 0:s.code)!=null?o:"UNKNOWN",(i=s==null?void 0:s.message)!=null?i:"The request failed.",s==null?void 0:s.param,s==null?void 0:s.reason,s==null?void 0:s.meta)}return r.data}var N=(e,t)=>t===void 0?{method:e}:{method:e,body:JSON.stringify(t)},z={getSso:(e,t)=>U(e,`${M(t)}/sso_connection`,N("GET")),saveSso:(e,t,n)=>U(e,`${M(t)}/sso_connection`,N("PATCH",n)),getDirectory:(e,t)=>U(e,`${M(t)}/directory`,N("GET")),createDirectoryToken:(e,t)=>U(e,`${M(t)}/directory/tokens`,N("POST")),revokeDirectoryToken:(e,t,n)=>U(e,`${M(t)}/directory/tokens/${Y(n)}`,N("DELETE")),listDomains:async(e,t)=>(await U(e,`${M(t)}/domains`,N("GET"))).data,addDomain:(e,t,n)=>U(e,`${M(t)}/domains`,N("POST",{domain:n})),verifyDomain:(e,t,n)=>U(e,`${M(t)}/domains/${Y(n)}/verify`,N("POST")),removeDomain:(e,t,n)=>U(e,`${M(t)}/domains/${Y(n)}`,N("DELETE")),listLogStreams:async(e,t)=>(await U(e,`${M(t)}/log_streams`,N("GET"))).data,addLogStream:(e,t,n)=>U(e,`${M(t)}/log_streams`,N("POST",n)),removeLogStream:(e,t,n)=>U(e,`${M(t)}/log_streams/${Y(n)}`,N("DELETE")),listApiKeys:async(e,t)=>(await U(e,`${M(t)}/api_keys`,N("GET"))).data,createApiKey:(e,t,n={})=>U(e,`${M(t)}/api_keys`,N("POST",n)),revokeApiKey:(e,t,n)=>U(e,`${M(t)}/api_keys/${Y(n)}`,N("DELETE")),getIpAllowlist:(e,t)=>U(e,`${M(t)}/ip_allowlist`,N("GET")),setIpAllowlist:(e,t,n)=>U(e,`${M(t)}/ip_allowlist`,N("PATCH",{entries:n})),listWebhooks:async(e,t)=>(await U(e,`${M(t)}/webhook_endpoints`,N("GET"))).data,createWebhook:(e,t,n)=>U(e,`${M(t)}/webhook_endpoints`,N("POST",n)),updateWebhook:(e,t,n,r)=>U(e,`${M(t)}/webhook_endpoints/${Y(n)}`,N("PATCH",r)),deleteWebhook:(e,t,n)=>U(e,`${M(t)}/webhook_endpoints/${Y(n)}`,N("DELETE")),rotateWebhookSecret:(e,t,n)=>U(e,`${M(t)}/webhook_endpoints/${Y(n)}/rotate_secret`,N("POST")),webhookDeliveries:async(e,t,n)=>(await U(e,`${M(t)}/webhook_endpoints/${Y(n)}/deliveries`,N("GET"))).data,listAppEventTypes:async(e,t)=>(await U(e,`${M(t)}/app_event_types`,N("GET"))).data,listAppWebhooks:async(e,t)=>(await U(e,`${M(t)}/app_webhook_endpoints`,N("GET"))).data,createAppWebhook:(e,t,n)=>U(e,`${M(t)}/app_webhook_endpoints`,N("POST",n)),updateAppWebhook:(e,t,n,r)=>U(e,`${M(t)}/app_webhook_endpoints/${Y(n)}`,N("PATCH",r)),deleteAppWebhook:(e,t,n)=>U(e,`${M(t)}/app_webhook_endpoints/${Y(n)}`,N("DELETE")),revealAppWebhookSecret:(e,t,n)=>U(e,`${M(t)}/app_webhook_endpoints/${Y(n)}/reveal_secret`,N("POST")),rotateAppWebhookSecret:(e,t,n)=>U(e,`${M(t)}/app_webhook_endpoints/${Y(n)}/rotate_secret`,N("POST")),testAppWebhook:(e,t,n)=>U(e,`${M(t)}/app_webhook_endpoints/${Y(n)}/test?wait=10s`,N("POST")),appWebhookDeliveries:async(e,t,n)=>(await U(e,`${M(t)}/app_webhook_endpoints/${Y(n)}/deliveries`,N("GET"))).data,redeliverAppWebhook:(e,t,n,r)=>U(e,`${M(t)}/app_webhook_endpoints/${Y(n)}/deliveries/${Y(r)}/redeliver`,N("POST")),replayAppWebhook:(e,t,n,r="failing_since")=>U(e,`${M(t)}/app_webhook_endpoints/${Y(n)}/replay`,N("POST",{since:r}))};var br=e=>{let t=typeof e=="string"?Number(e):e;return typeof t=="number"&&Number.isFinite(t)?t:0};function Qi(e,t,n){try{return new Intl.NumberFormat(n,{style:"currency",currency:t.toUpperCase()}).format(e/100)}catch{return`${(e/100).toFixed(2)} ${t.toUpperCase()}`}}function Xi(e,t={}){var d,u;let n=e.interval==="year"?"year":"month",r=(d=t.interval)!=null?d:n,o=e.annual_available&&e.annual_amount!=null?br(e.annual_amount):null,i=r===n?br(e.amount):r==="year"&&o!==null?o:br(e.amount),s=r===n||r==="year"&&o!==null?r:n,a=e.promotion&&!(e.promotion.ends_at!==void 0&&e.promotion.ends_at<=((u=t.now)!=null?u:Date.now()))?e.promotion:null,l=i;a!=null&&a.percent_off?l=Math.round(i*(1-a.percent_off/100)):a!=null&&a.amount_off&&(l=Math.max(0,i-a.amount_off));let c=a!==null&&l<i;return{price:Qi(l,e.currency,t.locale),...c?{originalPrice:Qi(i,e.currency,t.locale)}:{},interval:s,free:l===0&&i===0,trialDays:e.trial_days&&e.trial_days>0?e.trial_days:null,...a?{promotionLabel:a.label}:{},...a!=null&&a.code?{promotionCode:a.code}:{},amount:l}}async function Zi(e,t={}){var o;let n=await e.get("/v1/client/billing/plans"),r=n.ok&&n.data?(o=n.data.data)!=null?o:[]:[];return t.audience?r.filter(i=>i.audience===t.audience):r}async function es(e,t){var r,o,i,s;let n=await e.post("/v1/client/billing/checkout",{plan_id:t.planId,...t.orgId?{org_id:t.orgId}:{},...t.interval?{interval:t.interval}:{},success_url:t.successUrl,cancel_url:(r=t.cancelUrl)!=null?r:t.successUrl});return n.ok&&((o=n.data)!=null&&o.url)?{url:n.data.url}:{url:null,error:(s=(i=n.errors[0])==null?void 0:i.message)!=null?s:"Could not start checkout."}}var Bt="atlas_marketing",os=90*24*60*6e4,ts={enabled:!1,params:[],consentCategory:"marketing"},ns=new Map;function ud(e){let t=e.referralCacheKey,n=ns.get(t);return n||(n=e.get("/v1/client/marketing").then(r=>{var s;let o=r.ok?(s=r.data)==null?void 0:s.capture:void 0;return o!=null&&o.enabled?{enabled:!0,params:Array.isArray(o.params)?o.params.filter(a=>typeof a=="string"):[],consentCategory:typeof o.consent_category=="string"?o.consent_category:"marketing"}:ts}).catch(()=>ts),ns.set(t,n)),n}var pd=()=>typeof window=="undefined"?null:window,kr=()=>{try{return typeof localStorage=="undefined"?null:localStorage}catch{return null}},rs=e=>{if(!e)return null;try{let t=new URL(e);return t.protocol==="http:"||t.protocol==="https:"?`${t.origin}${t.pathname}`:null}catch{return null}};function fd(e,t,n=new Date){var s,a,l,c,d;let r=new URLSearchParams((a=(s=t.location)==null?void 0:s.search)!=null?a:""),o={};for(let u of e.params.length?e.params:[]){let p=r.get(u);p&&p.trim()&&(o[u]=p.trim().slice(0,200))}if(Object.keys(o).length===0)return null;let i=(l=t.location)!=null&&l.origin?`${t.location.origin}${(c=t.location.pathname)!=null?c:"/"}`:null;return{params:o,landing_url:rs(i),referrer:rs((d=t.document)==null?void 0:d.referrer),captured_at:n.toISOString()}}var _r=e=>{try{let t=e==null?void 0:e.getItem(Bt);if(!t)return null;let n=JSON.parse(t);return n.expires_at!==void 0&&n.expires_at<Date.now()?(e==null||e.removeItem(Bt),null):n.first_touch&&n.last_touch?n:null}catch{return null}};function gd(e={}){return _r(e.storage===void 0?kr():e.storage)}function md(e,t,n){return at(t,[e.consentCategory],{provider:"auto",appConsent:n.consent})}async function qt(e,t={}){var l,c;let n=t.win===void 0?pd():t.win,r=t.storage===void 0?kr():t.storage;if(!n||!r||!((l=n.location)!=null&&l.search)||n.location.search==="?")return!1;let o=await ud(e);if(!o.enabled)return!1;let i=fd(o,n);if(!i||!md(o,n,t).granted)return!1;let s=_r(r),a={first_touch:(c=s==null?void 0:s.first_touch)!=null?c:i,last_touch:i,expires_at:Date.now()+os};try{return r.setItem(Bt,JSON.stringify(a)),!0}catch{return!1}}async function is(e,t={}){var i;let n=t.storage===void 0?kr():t.storage,r=_r(n);if(!r||r.sent)return!1;let o=await e.post("/v1/client/me/marketing",{...r.last_touch,first_touch:r.first_touch});if(!o.ok)return!1;try{n==null||n.setItem(Bt,JSON.stringify({...r,sent:!0,expires_at:Date.now()+os}))}catch{}return((i=o.data)==null?void 0:i.recorded)===!0}async function ss(e,t,n={}){var i,s;let r=gd(n),o=await e.post("/v1/client/marketing/leads",{email:t.email,...t.name?{name:t.name}:{},...t.form?{form:t.form}:{},consent:t.consent===!0,...t.website?{website:t.website}:{},...r?{marketing:{...r.first_touch}}:{}});return o.ok?{ok:!0}:{ok:!1,error:(s=(i=o.errors[0])==null?void 0:i.message)!=null?s:"Could not submit."}}var ft={attempt:null,errors:[],busy:!1,ticket:null};async function as(e,t,n){let r=await e.post("/v1/client/password_resets",{email_address:t,captcha_token:n});return!r.ok||!r.data?{...ft,errors:r.errors}:(Te(r.data.id,r.data),{attempt:r.data,errors:[],busy:!1,ticket:null})}async function ls(e,t,n,r={}){var m,k,g,_,S;let o=t.attempt;if(!o)return t;let i=null,s={};switch(o.status){case"needs_email_verification":i=`/v1/client/password_resets/${o.id}/attempt_verification`,s={code:(m=n.code)!=null?m:""};break;case"needs_second_factor":i=`/v1/client/password_resets/${o.id}/attempt_second_factor`,s={code:(k=n.code)!=null?k:""};break;case"needs_new_password":i=`/v1/client/password_resets/${o.id}/set_new_password`,s={password:(g=n.password)!=null?g:"",...(_=n.securityAnswers)!=null&&_.length?{security_answers:n.securityAnswers}:{}};break;default:return t}let a=await e.post(i,s);if(!a.ok||!a.data)return{...t,busy:!1,errors:a.errors};let{id:l,status:c,pending_policies:d,policy_acceptance_token:u,pending_required_actions:p,required_action_token:f}=a.data;return c!=="needs_email_verification"&&fe(o.id),{attempt:{id:l,status:c,...d?{pending_policies:d}:{},...u?{policy_acceptance_token:u}:{},...p?{pending_required_actions:p}:{},...f?{required_action_token:f}:{}},errors:[],busy:!1,ticket:(S=a.data.ticket)!=null?S:null,...r.askQuestions?await ds(e,a.data.id,a.data.status):{}}}function cs(e){var r;let t=e.attempt;if((t==null?void 0:t.status)!=="needs_policy_acceptance"&&(t==null?void 0:t.status)!=="needs_required_action")return null;let n=(r=t.policy_acceptance_token)!=null?r:t.required_action_token;return{...X,attempt:t,...n?{policyToken:n}:{}}}async function ds(e,t,n){if(n!=="needs_new_password")return{};let r=await Hi(e,t);return r!=null&&r.required?{securityQuestions:r.questions}:{}}function Ke(e){var n;let t=(n=e.attempt)==null?void 0:n.status;if(!t)return"request";switch(t){case"needs_email_verification":return"collect_email_code";case"needs_second_factor":return"collect_second_factor";case"needs_new_password":return"collect_new_password";case"complete":return"done";default:return"unknown"}}async function us(e,t,n={}){let r=t.attempt;if(!(r!=null&&r.poll_secret))return t;let o=await e.get(`/v1/client/password_resets/${r.id}?poll_secret=${encodeURIComponent(r.poll_secret)}`);if(!o.ok||!o.data)return t;let i=o.data.status==="needs_email_verification";return i||fe(r.id),{...t,attempt:{id:o.data.id,status:o.data.status,poll_secret:r.poll_secret,...i&&r.match_code?{match_code:r.match_code}:{}},...n.askQuestions?await ds(e,o.data.id,o.data.status):{}}}var bg=Object.freeze({available:!0,passwordReset:!0,passwordSignUp:!0}),fs="This app can't send email right now. Try another sign-in method or contact the app owner.";var gt=e=>!!e&&typeof e=="object"&&!Array.isArray(e);var vr=Object.freeze({username:null,lastSignInMethod:!1,emailVerification:"code",passwordReset:"code",emailSecondFactor:!1,passkeySignUp:null}),ps=e=>e==="link"||e==="both"?e:"code";function xr(e){var o;let t=gt(e)&>(e.account)?e.account:null;if(!t)return{...vr};let n=gt(t.username)?t.username:null,r=(i,s)=>typeof i=="number"&&Number.isInteger(i)?i:s;return{username:n?{minLength:r(n.min_length,3),maxLength:r(n.max_length,30),charset:n.charset==="alphanumeric"||n.charset==="alphanumeric_underscore"?n.charset:"default",requiredAtSignUp:n.required_at_sign_up===!0}:null,lastSignInMethod:t.last_sign_in_method===!0,emailVerification:ps(t.email_verification),passwordReset:ps(t.password_reset),emailSecondFactor:t.email_second_factor===!0,...t.custom_second_factor===!0?{customSecondFactor:!0}:{},...gt(t.mfa)?{mfa:{totp:t.mfa.totp!==!1,sms:t.mfa.sms===!0,totpCodes:Number((o=t.mfa.totp_codes)!=null?o:t.mfa.totpCodes)>=2?2:1,...t.mfa.hotp===!0?{hotp:!0}:{},...t.mfa.yubikey===!0?{yubikey:!0}:{},...t.mfa.duo===!0?{duo:!0}:{},...t.mfa.passkey===!0?{passkey:!0}:{},...t.mfa.security_questions===!0?{securityQuestions:!0}:{},...t.mfa.smart_card===!0?{smartCard:!0}:{}}}:{},passkeySignUp:gt(t.passkey_sign_up)?{email:t.passkey_sign_up.email==="off"||t.passkey_sign_up.email==="optional"?t.passkey_sign_up.email:"required"}:null}}function gs(e){let t={...e};for(let n of["signUp","signIn"]){let r=t[n];r&&r.provider&&!r.enabled&&(t[n]={...r,enabled:!0})}return t}var Ce=xl(vs());var Wg=new TextEncoder;var xs=["auto","light","dark"],De=["primary","primaryInk","accent","background","surface","text","muted","border","danger","success","inputBackground","inputText"],Gt=["none","uppercase"],ws={"minor-second":1.067,"major-second":1.125,"minor-third":1.2,"major-third":1.25,"perfect-fourth":1.333,"augmented-fourth":1.414,"perfect-fifth":1.5,golden:1.618,"minor-seventh":1.778,octave:2},Cs=Object.keys(ws),Vt=["none","sm","md","lg","xl"],Yt=["compact","comfortable","spacious"],Jt=["solid","glass","outline","none"],Qt=["narrow","normal","wide"],Xt=["center","left","right","split"],Zt=["left","right"],en=["card","page","hidden"],tn=["sm","md","lg"],nn=["solid","outline","soft","gradient"],rn=["list","grid","icons"],on=["outline","filled","underline"],Ss=["linear","radial"],Pr=["cover","contain"],Er=["top-left","top","top-right","left","center","right","bottom-left","bottom","bottom-right"],mt=["none","dots","grid","noise"],sn=["minimal","atlas","glass","midnight","editorial","terminal","sunrise","forest","grape","slate","split-photo","bold"],Rr=/^#[0-9a-fA-F]{6}$/,Tr=/^dasset_[0-9A-HJKMNP-TV-Z]{26}$/;var re="system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",an="Georgia, Cambria, 'Times New Roman', Times, serif",Ir="ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace",ae="wght@400;500;600;700;800",As=[{id:"system",label:"System UI",family:null,category:"sans-serif",fallback:`-apple-system, BlinkMacSystemFont, ${re}`,google:null},{id:"system-serif",label:"System serif (Georgia)",family:null,category:"serif",fallback:an,google:null},{id:"system-mono",label:"System monospace",family:null,category:"monospace",fallback:Ir,google:null},{id:"inter",label:"Inter",family:"Inter",category:"sans-serif",fallback:re,google:`Inter:${ae}`},{id:"roboto",label:"Roboto",family:"Roboto",category:"sans-serif",fallback:re,google:"Roboto:wght@400;500;700;800"},{id:"open-sans",label:"Open Sans",family:"Open Sans",category:"sans-serif",fallback:re,google:`Open+Sans:${ae}`},{id:"lato",label:"Lato",family:"Lato",category:"sans-serif",fallback:re,google:"Lato:wght@400;700;900"},{id:"montserrat",label:"Montserrat",family:"Montserrat",category:"sans-serif",fallback:re,google:`Montserrat:${ae}`},{id:"poppins",label:"Poppins",family:"Poppins",category:"sans-serif",fallback:re,google:`Poppins:${ae}`},{id:"nunito",label:"Nunito",family:"Nunito",category:"sans-serif",fallback:re,google:`Nunito:${ae}`},{id:"work-sans",label:"Work Sans",family:"Work Sans",category:"sans-serif",fallback:re,google:`Work+Sans:${ae}`},{id:"dm-sans",label:"DM Sans",family:"DM Sans",category:"sans-serif",fallback:re,google:`DM+Sans:${ae}`},{id:"manrope",label:"Manrope",family:"Manrope",category:"sans-serif",fallback:re,google:`Manrope:${ae}`},{id:"source-serif",label:"Source Serif",family:"Source Serif 4",category:"serif",fallback:an,google:`Source+Serif+4:${ae}`},{id:"merriweather",label:"Merriweather",family:"Merriweather",category:"serif",fallback:an,google:"Merriweather:wght@400;700;900"},{id:"playfair-display",label:"Playfair Display",family:"Playfair Display",category:"serif",fallback:an,google:`Playfair+Display:${ae}`},{id:"jetbrains-mono",label:"JetBrains Mono",family:"JetBrains Mono",category:"monospace",fallback:Ir,google:`JetBrains+Mono:${ae}`},{id:"ibm-plex-mono",label:"IBM Plex Mono",family:"IBM Plex Mono",category:"monospace",fallback:Ir,google:"IBM+Plex+Mono:wght@400;500;600;700"}],Ps=As.map(e=>e.id),Es=new Map(As.map(e=>[e.id,e])),Ad=/^custom-[a-f0-9]{32}$/;function ln(e){return typeof e=="string"&&Ad.test(e)}function Pd(e){return`Brand ${e.slice(7,15)}`}function Or(e){return ln(e)?{id:e,label:"Brand font",family:Pd(e),category:"sans-serif",fallback:re,google:null}:typeof e=="string"?Es.get(e):void 0}function Fr(e){var n;let t=(n=Or(e))!=null?n:Es.get("system");return t.family?`'${t.family}', ${t.fallback}`:t.fallback}function Rs(e){if(ln(e))return`/v1/design/fonts/${e}.css`;let t=Or(e);return t!=null&&t.google?`/v1/design/fonts/${t.id}.css`:null}var Lr=e=>{if(!e||typeof e!="object"||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},$e=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),V=e=>t=>typeof t=="string"&&e.includes(t),ye=(e,t,n=1)=>r=>typeof r=="number"&&Number.isInteger(r)&&r>=e&&r<=t&&r%n===0,Is=(e,t)=>n=>typeof n=="number"&&!Number.isNaN(n)&&n>=e&&n<=t,ht=e=>typeof e=="string"&&Rr.test(e),Dr=e=>typeof e=="string"&&Tr.test(e);function Se(e,t=[]){return n=>{if(!Lr(n))return!1;for(let r of Object.keys(n)){if(!$e(e,r))return!1;let o=n[r];if(o===void 0){if(t.includes(r))return!1;continue}if(!e[r](o))return!1}return t.every(r=>$e(n,r)&&n[r]!==void 0)}}var Ed=V(Ps),Ts=e=>Ed(e)||ln(e),$r={palette:Object.fromEntries(De.map(e=>[e,ht])),paletteDark:Object.fromEntries(De.map(e=>[e,ht])),typography:{font:Ts,headingFont:Ts,baseSize:ye(12,20),headingWeight:ye(400,800,100),bodyWeight:ye(300,600,100),letterCase:V(Gt),scale:V(Cs)},shape:{radius:ye(0,32),controlRadius:ye(0,999),borderWidth:ye(0,3)},elevation:{cardShadow:V(Vt)},spacing:{density:V(Yt)},card:{style:V(Jt),blur:ye(0,40),width:V(Qt)},layout:{position:V(Xt),splitImageSide:V(Zt),logoPlacement:V(en),logoSize:V(tn)},buttons:{style:V(nn),socialLayout:V(rn)},inputs:{style:V(on)},logo:{assetId:Dr,darkAssetId:Dr}},Rd=e=>{if(!Se({type:V(Ss),angle:ye(0,360),stops:()=>!0},["type","stops"])(e))return!1;let t=e.stops;return Array.isArray(t)&&t.length>=2&&t.length<=4&&t.every(Se({color:ht,at:Is(0,100)},["color","at"]))},Td=Se({assetId:Dr,fit:V(Pr),position:V(Er),overlay:Se({color:ht,opacity:Is(0,1)},["color","opacity"]),blur:ye(0,20)},["assetId"]),Mr={color:ht,gradient:Rd,image:Td,pattern:V(mt)},yt={version:e=>e===1,preset:V(sn),colorScheme:V(xs),background:Se(Mr),backgroundDark:Se(Mr),...Object.fromEntries(Object.entries($r).map(([e,t])=>[e,Se(t)]))};function Os(e,t){return $e(yt,e)&&yt[e](t)}var Fs=Se(yt);function Ls(e,t=()=>{},n=""){let r=(...i)=>[n,...i].filter(Boolean).join(".");if(e==null)return{};if(!Lr(e))return t({path:n||"(root)",message:"must be an object"}),{};let o={};for(let[i,s]of Object.entries(e)){if(s===void 0)continue;if(!$e(yt,i)){t({path:r(i),message:"Unknown setting."});continue}if(yt[i](s)){o[i]=s;continue}let a=$e($r,i)?$r[i]:i==="background"||i==="backgroundDark"?Mr:null;if(!a||!Lr(s)){t({path:r(i),message:"Invalid value."});continue}let l={};for(let[c,d]of Object.entries(s))d!==void 0&&($e(a,c)&&a[c](d)?l[c]=d:t({path:r(i,c),message:$e(a,c)?"Invalid value.":"Unknown setting."}));Object.keys(l).length&&(o[i]=l)}return o}var Id=new Set(["__proto__","constructor","prototype"]),Ds=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function Ur(e,t){let n={...e};for(let[r,o]of Object.entries(t)){if(Id.has(r)||o===void 0)continue;if(o===null){delete n[r];continue}let i=n[r];n[r]=Ds(i)&&Ds(o)?Ur(i,o):o}return n}function K(e){let t=e.split(" ");if(t.length!==De.length)throw new Error(`palette spec needs ${De.length} slots: ${e}`);let n={};return t.forEach((r,o)=>{r!=="-"&&(n[De[o]]=r)}),n}var $s={version:1,preset:"minimal",colorScheme:"auto",palette:K("#18181b #ffffff #4f46e5 #fafafa #ffffff #18181b #71717a #e4e4e7 #dc2626 #15803d #ffffff #18181b"),paletteDark:K("#fafafa #18181b #818cf8 #09090b #18181b #fafafa #a1a1aa #3f3f46 #f87171 #4ade80 #09090b #fafafa"),typography:{font:"inter",headingFont:"inter",baseSize:15,headingWeight:600,bodyWeight:400,letterCase:"none",scale:"perfect-fourth"},shape:{radius:12,controlRadius:8,borderWidth:1},elevation:{cardShadow:"md"},spacing:{density:"comfortable"},card:{style:"solid",blur:16,width:"normal"},layout:{position:"center",splitImageSide:"left",logoPlacement:"card",logoSize:"md"},buttons:{style:"solid",socialLayout:"list"},inputs:{style:"outline"},background:{},backgroundDark:{},logo:{}},Ms={minimal:{design:{}},atlas:{design:{palette:K("#6d4aff #ffffff #0e8fc7 #f6f5ff #ffffff #0b0d17 #5b6078 #e2def5 #d92d3a #0f7a52 #ffffff #0b0d17"),paletteDark:K("#7455fa #ffffff #46c7ff #070811 #0f1120 #eef0f6 #959bb0 #262a40 #ff6b6b #43d9a0 #0b0d17 #eef0f6"),typography:{font:"system",headingFont:"system",headingWeight:600},shape:{radius:14,controlRadius:9,borderWidth:1},elevation:{cardShadow:"lg"},buttons:{style:"gradient"},background:{gradient:{type:"linear",angle:160,stops:[{color:"#f6f5ff",at:0},{color:"#eef6ff",at:100}]}},backgroundDark:{gradient:{type:"radial",stops:[{color:"#1a1440",at:0},{color:"#070811",at:70}]},pattern:"grid"}}},glass:{design:{palette:K("#4338ca - #db2777 #eef2ff #ffffff #111827 #4b5563 #ffffff - - #ffffff #111827"),paletteDark:K("#a5b4fc - #f472b6 #1e1b4b #111827 #f9fafb #cbd5e1 #374151 - - #0b1120 #f9fafb"),shape:{radius:20,controlRadius:12},elevation:{cardShadow:"xl"},card:{style:"glass",blur:20},background:{gradient:{type:"linear",angle:135,stops:[{color:"#6366f1",at:0},{color:"#ec4899",at:55},{color:"#f59e0b",at:100}]}},backgroundDark:{gradient:{type:"linear",angle:135,stops:[{color:"#1e1b4b",at:0},{color:"#4c1d95",at:55},{color:"#831843",at:100}]}}}},midnight:{design:{colorScheme:"dark",palette:K("#1d4ed8 - #7c3aed #eef2f9 #ffffff #0b1020 #475569 #d5dceb - - #ffffff #0b1020"),paletteDark:K("#60a5fa - #a78bfa #0b1020 #121a2f #e6eaf5 #94a3b8 #24314f #f87171 #34d399 #0e1528 #e6eaf5"),typography:{font:"manrope",headingFont:"manrope"},shape:{radius:16,controlRadius:10},elevation:{cardShadow:"lg"},backgroundDark:{pattern:"dots"}}},editorial:{design:{palette:K("#8b2e1f - #8a6410 #f7f3ec #fffdf8 #1f1a14 #6b6157 #e3dacb - - #fffdf8 #1f1a14"),paletteDark:K("#e07a5f - #d4a64a #16130f #1f1b16 #f2ebe0 #a89f92 #3a332a - - #16130f #f2ebe0"),typography:{font:"source-serif",headingFont:"playfair-display",baseSize:16,headingWeight:700,scale:"golden"},shape:{radius:4,controlRadius:2},elevation:{cardShadow:"sm"},inputs:{style:"underline"}}},terminal:{design:{colorScheme:"dark",palette:K("#166534 - #0e7490 #f4fbf3 #ffffff #0b2a0b #3f6b3c #b7d8b4 - - #ffffff #0b2a0b"),paletteDark:K("#39ff14 #031003 #00e5ff #0a0f0a #0d140d #c8f7c5 #7fb57b #2c5a2c #ff5555 #39ff14 #050805 #c8f7c5"),typography:{font:"jetbrains-mono",headingFont:"jetbrains-mono",baseSize:14,letterCase:"uppercase",scale:"major-second"},shape:{radius:0,controlRadius:0,borderWidth:1},elevation:{cardShadow:"none"},card:{style:"outline"},buttons:{style:"outline"},backgroundDark:{pattern:"grid"}}},sunrise:{design:{palette:K("#c2410c - #be185d #fff1e6 #ffffff #2a1a12 #7c5e52 #f4d9cb - - #ffffff #2a1a12"),paletteDark:K("#fb923c - #f472b6 #1a0f0a #24150f #fdebe1 #c4a092 #4a2e22 - - #1a0f0a #fdebe1"),typography:{font:"poppins",headingFont:"poppins"},shape:{radius:20,controlRadius:999},elevation:{cardShadow:"lg"},background:{gradient:{type:"linear",angle:160,stops:[{color:"#fff1e6",at:0},{color:"#ffe4ec",at:100}]}},backgroundDark:{gradient:{type:"linear",angle:160,stops:[{color:"#2a1209",at:0},{color:"#2a0f1c",at:100}]}}}},forest:{design:{palette:K("#166534 - #a16207 #f3f7f2 #ffffff #14261a #53685a #d6e3d8 - - #f3f7f2 #14261a"),paletteDark:K("#4ade80 - #facc15 #0c1510 #13201a #e3efe6 #9db5a4 #2a3d31 - - #0c1510 #e3efe6"),typography:{font:"dm-sans",headingFont:"dm-sans"},shape:{radius:10,controlRadius:8},inputs:{style:"filled"}}},grape:{design:{palette:K("#7e22ce - #be185d #faf5ff #ffffff #2e1065 #6b5b8a #e9d5ff - - #ffffff #2e1065"),paletteDark:K("#c084fc - #f472b6 #12081f #1c1030 #f3e8ff #b4a3cf #3b2559 - - #12081f #f3e8ff"),typography:{font:"nunito",headingFont:"nunito",headingWeight:800},shape:{radius:24,controlRadius:14},buttons:{socialLayout:"grid"},background:{pattern:"dots"},backgroundDark:{pattern:"dots"}}},slate:{design:{palette:K("#334155 - #0369a1 #f1f5f9 #ffffff #0f172a #64748b #cbd5e1 - - #f8fafc #0f172a"),paletteDark:K("#cbd5e1 - #38bdf8 #0f172a #1e293b #f1f5f9 #94a3b8 #334155 - - #0f172a #f1f5f9"),typography:{font:"work-sans",headingFont:"work-sans"},shape:{radius:8,controlRadius:6},elevation:{cardShadow:"sm"},spacing:{density:"compact"},inputs:{style:"filled"}}},"split-photo":{design:{layout:{position:"split",splitImageSide:"left",logoPlacement:"page"},card:{style:"none",width:"normal"},elevation:{cardShadow:"none"},shape:{radius:0,controlRadius:8},background:{gradient:{type:"linear",angle:135,stops:[{color:"#0f172a",at:0},{color:"#334155",at:100}]}},backgroundDark:{gradient:{type:"linear",angle:135,stops:[{color:"#020617",at:0},{color:"#1e293b",at:100}]}}}},bold:{design:{palette:K("#4338ca - #ca8a04 #4338ca #ffffff #111827 #4b5563 #e5e7eb - - #ffffff #111827"),paletteDark:K("#a5b4fc - #facc15 #1e1b4b #111827 #f9fafb #cbd5e1 #374151 - - #0b1120 #f9fafb"),typography:{font:"montserrat",headingFont:"montserrat",baseSize:17,headingWeight:800,letterCase:"uppercase",scale:"octave"},shape:{radius:24,controlRadius:999,borderWidth:0},elevation:{cardShadow:"xl"},spacing:{density:"spacious"},card:{width:"wide"}}}};var Ye=(e,t,n)=>Math.min(n,Math.max(t,e));function Je(e){if(!e||typeof e!="string")return null;let t=e.trim().toLowerCase();if(t==="transparent")return{r:0,g:0,b:0,a:0};let n=/^#([0-9a-f]{3,8})$/.exec(t);if(n){let l=n[1];if((l.length===3||l.length===4)&&(l=[...l].map(d=>d+d).join("")),l.length!==6&&l.length!==8)return null;let c=d=>parseInt(l.slice(d,d+2),16);return{r:c(0),g:c(2),b:c(4),a:l.length===8?c(6)/255:1}}let r=/^rgba?\(([^)]+)\)$/.exec(t);if(!r)return null;let o=r[1].replace("/"," ").split(/[\s,]+/).filter(Boolean);if(o.length<3)return null;let i=l=>l.endsWith("%")?parseFloat(l)/100*255:parseFloat(l),s=l=>l===void 0?1:l.endsWith("%")?parseFloat(l)/100:parseFloat(l),a={r:Ye(i(o[0]),0,255),g:Ye(i(o[1]),0,255),b:Ye(i(o[2]),0,255),a:Ye(s(o[3]),0,1)};return[a.r,a.g,a.b,a.a].some(Number.isNaN)?null:a}var cn=e=>Ye(Math.round(e),0,255).toString(16).padStart(2,"0");function un(e){return`#${cn(e.r)}${cn(e.g)}${cn(e.b)}`}function Od(e){let t=n=>{let r=n/255;return r<=.03928?r/12.92:((r+.055)/1.055)**2.4};return .2126*t(e.r)+.7152*t(e.g)+.0722*t(e.b)}function dn(e){let t=Je(e);return t?Od(t):null}function bt(e,t){let n=dn(e),r=dn(t);if(n===null||r===null)return 1;let o=Math.max(n,r),i=Math.min(n,r);return(o+.05)/(i+.05)}var Fd=4.5,Ld=3;function Us(e){var t;return((t=dn(e))!=null?t:0)>.179?"#111827":"#ffffff"}function Dd(e,t,n){let r=e/255,o=t/255,i=n/255,s=Math.max(r,o,i),a=Math.min(r,o,i),l=(s+a)/2;if(s===a)return[0,0,l];let c=s-a,d=l>.5?c/(2-s-a):c/(s+a);return[s===r?((o-i)/c+(o<i?6:0))/6:s===o?((i-r)/c+2)/6:((r-o)/c+4)/6,d,l]}function $d(e,t,n){let r=n<.5?n*(1+t):n+t-n*t,o=2*n-r,i=a=>{let l=a;return l<0&&(l+=1),l>1&&(l-=1),l<1/6?o+(r-o)*6*l:l<1/2?r:l<2/3?o+(r-o)*(2/3-l)*6:o};return`#${(t===0?[n,n,n]:[i(e+1/3),i(e),i(e-1/3)]).map(a=>cn(Ye(a,0,1)*255)).join("")}`}function Md(e,t,n=Fd){var u;let r=Je(e);if(!r||t.length===0)return e;let o=p=>t.every(f=>bt(p,f)>=n);if(o(e))return e;let s=((u=dn(t[0]))!=null?u:1)>.179?-.01:.01,[a,l,c]=Dd(r.r,r.g,r.b),d=e;for(let p=1;p<=100;p+=1){let f=c+s*p;if(f<0||f>1)break;if(d=$d(a,l,f),o(d))return d}return d}function Ns(e,t){return Md(e,t,Ld)}var Ud=["primary","accent","danger","success"],Pe=e=>JSON.parse(JSON.stringify(e));function js(e){if(!e||typeof e!="object"||Array.isArray(e))return{};if(Fs(e))return Pe(e);let t={};for(let[n,r]of Object.entries(e))r!==void 0&&Os(n,r)&&(t[n]=Pe(r));return t}function zs(e,t){if(!t)return e;let n={...e};for(let[r,o]of Object.entries(t))o!==void 0&&(n[r]=o);return t.primary&&!t.primaryInk&&(n.primaryInk=Us(t.primary)),n}function Nr(e,t,n){var i,s,a;t.colorScheme&&(e.colorScheme=t.colorScheme);let r=e.palette;e.palette=zs(e.palette,t.palette);let o=t.paletteDark?{...t.paletteDark}:void 0;if(n.carryBrand&&t.palette){for(let l of Ud){let c=t.palette[l];c&&c!==r[l]&&!((i=t.paletteDark)!=null&&i[l])&&(o={...o!=null?o:{},[l]:c})}t.palette.primaryInk&&!((s=t.paletteDark)!=null&&s.primaryInk)&&(o!=null&&o.primary)&&(o.primaryInk=t.palette.primaryInk)}if(e.paletteDark=zs(e.paletteDark,o),t.typography){let l=t.typography;e.typography={...e.typography,...Ae(l),headingFont:(a=l.headingFont)!=null?a:l.font?l.font:e.typography.headingFont}}if(t.shape&&(e.shape={...e.shape,...Ae(t.shape)}),t.elevation&&(e.elevation={...e.elevation,...Ae(t.elevation)}),t.spacing&&(e.spacing={...e.spacing,...Ae(t.spacing)}),t.card&&(e.card={...e.card,...Ae(t.card)}),t.layout&&(e.layout={...e.layout,...Ae(t.layout)}),t.buttons&&(e.buttons={...e.buttons,...Ae(t.buttons)}),t.inputs&&(e.inputs={...e.inputs,...Ae(t.inputs)}),t.background&&(e.background=Pe(t.background)),t.backgroundDark)e.backgroundDark=Pe(t.backgroundDark);else if(t.background&&n.carryBrand){let l={};t.background.gradient&&(l.gradient=Pe(t.background.gradient)),t.background.image&&(l.image=Pe(t.background.image)),t.background.pattern&&(l.pattern=t.background.pattern),e.backgroundDark=l}t.logo&&(e.logo=Pe(t.logo))}function Ae(e){let t={};for(let[n,r]of Object.entries(e))r!==void 0&&(t[n]=r);return t}function zr(e){return typeof e=="string"&&sn.includes(e)}function kt(e){let t=js(e),n=zr(t.preset)?t.preset:"minimal",r=Pe($s);return r.preset=n,Nr(r,Ms[n].design,{carryBrand:!1}),Nr(r,t,{carryBrand:!0}),r}function Bs(e,t){let n=kt(e),r=js(t);return delete r.preset,Nr(n,r,{carryBrand:!0}),n}var Nd=Object.freeze({"--atlas-color-primary":"--atlas-host-accent","--atlas-color-primary-ink":"--atlas-host-accent-ink","--atlas-color-surface":"--atlas-host-surface","--atlas-card-background":"--atlas-host-surface","--atlas-color-text":"--atlas-host-ink","--atlas-color-border":"--atlas-host-line","--atlas-radius-control":"--atlas-host-radius","--atlas-font-body":"--atlas-host-font","--atlas-focus-outline-color":"--atlas-host-focus-ring"});function jr(e){var o,i,s,a,l,c,d,u,p,f,m,k,g,_;let t=(S,x,w)=>typeof x=="string"&&S.includes(x)?x:w,n=(o=e==null?void 0:e.background)!=null?o:{},r={"data-atlas-layout":t(Xt,(i=e==null?void 0:e.layout)==null?void 0:i.position,"center"),"data-atlas-split-side":t(Zt,(s=e==null?void 0:e.layout)==null?void 0:s.splitImageSide,"left"),"data-atlas-logo":t(en,(a=e==null?void 0:e.layout)==null?void 0:a.logoPlacement,"card"),"data-atlas-logo-size":t(tn,(l=e==null?void 0:e.layout)==null?void 0:l.logoSize,"md"),"data-atlas-card":t(Jt,(c=e==null?void 0:e.card)==null?void 0:c.style,"solid"),"data-atlas-card-width":t(Qt,(d=e==null?void 0:e.card)==null?void 0:d.width,"normal"),"data-atlas-shadow":t(Vt,(u=e==null?void 0:e.elevation)==null?void 0:u.cardShadow,"md"),"data-atlas-density":t(Yt,(p=e==null?void 0:e.spacing)==null?void 0:p.density,"comfortable"),"data-atlas-button":t(nn,(f=e==null?void 0:e.buttons)==null?void 0:f.style,"solid"),"data-atlas-social":t(rn,(m=e==null?void 0:e.buttons)==null?void 0:m.socialLayout,"list"),"data-atlas-input":t(on,(k=e==null?void 0:e.inputs)==null?void 0:k.style,"outline"),"data-atlas-pattern":t(mt,n.pattern,"none"),"data-atlas-pattern-dark":t(mt,(g=e==null?void 0:e.backgroundDark)==null?void 0:g.pattern,"none"),"data-atlas-letter-case":t(Gt,(_=e==null?void 0:e.typography)==null?void 0:_.letterCase,"none")};return((e==null?void 0:e.colorScheme)==="dark"||(e==null?void 0:e.colorScheme)==="light")&&(r["data-atlas-theme"]=e.colorScheme),r}function qs(e){var n,r;let t=new Set;for(let o of[(n=e==null?void 0:e.typography)==null?void 0:n.font,(r=e==null?void 0:e.typography)==null?void 0:r.headingFont]){let i=Rs(o);i&&t.add(i)}return[...t]}var Nh=Object.freeze([...new Set(Object.values(Nd))]);function Br(){try{return typeof process!="undefined"&&!1}catch{return!1}}var Ws=e=>{Br()&&console.warn(`[atlas] ${e}`)},Hs=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function zd(e,t=Ws,n="design"){return e!=null&&(typeof e!="object"||Array.isArray(e))?(t(`${n} must be an object; ignored.`),{}):Ls(e,r=>t(r.message==="Unknown setting."&&r.path.split(".").length===n.split(".").length+1?`${r.path} is not a design setting; ignored.`:`${r.path} is invalid; ignored.`),n)}function Ks(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619)>>>0;return t.toString(36)}var jd=/^(?:https:\/\/[A-Za-z0-9.-]+(?::\d{1,5})?|http:\/\/(?:localhost|127\.0\.0\.1)(?::\d{1,5})?)$/;function Bd(e,t){let n=(t!=null?t:"").replace(/\/+$/,"");return n&&!jd.test(n)?[]:qs(e).map(r=>`${n}${r}`)}function qd(e){if(!(!Hs(e)||!Hs(e.resolved)))return e.resolved}function Gs(e){var c,d,u;let t=(c=e.warn)!=null?c:Ws,n=qd(e.instance),r=zd(e.design,t,"appearance.design"),o,i=(d=e.preset)!=null?d:r.preset;i!==void 0&&(zr(i)?o=i:t(`appearance.preset "${String(i)}" is not a preset; ignored.`));let s=o!==void 0||Object.keys(r).some(p=>p!=="preset");if(!n&&!s)return null;let a=o?kt({preset:o}):n?kt(n):kt({}),l=Ur((u=e.tokensDesign)!=null?u:{},r);return Bs(a,l)}function Vs(e,t){return Bd(e,t)}var Ys=null;function Hd(e){var t,n;if(Ys)return Ys;try{let r=(t=e.querySelector)==null?void 0:t.call(e,'meta[name="csp-nonce"]'),o=r==null?void 0:r.getAttribute("content");if(o)return o;let i=(n=e.querySelector)==null?void 0:n.call(e,"script[nonce]"),s=i?i.nonce||i.getAttribute("nonce"):null;if(s)return s}catch{}return null}var Js=new WeakMap,Qs=new WeakMap;function pn(e,t){let n=Hd(e);if(n){t.setAttribute("nonce",n);try{t.nonce=n}catch{}}}function fn(e,t,n){var o;let r=globalThis.CSSStyleSheet;if(r&&Array.isArray(e.adoptedStyleSheets)&&typeof((o=r.prototype)==null?void 0:o.replaceSync)=="function")try{let i=Js.get(e);i||Js.set(e,i=new Map);let s=Qs.get(e);s||Qs.set(e,s=new Map),s.set(t,n);let a=i.get(t);return a?a.replaceSync(n):(a=new r,i.set(t,a),a.replaceSync(n),e.adoptedStyleSheets=[...e.adoptedStyleSheets,a]),!0}catch{}return!1}var Xs=new Set,Zs=e=>{var t;!Br()||Xs.has(e)||(Xs.add(e),(t=globalThis.console)==null||t.warn(`[atlas] ${e}`))};function ea(e){var r,o;if(!e||typeof e!="object")return null;let t=e,n=(o=t.design)!=null?o:(r=t.appearance)==null?void 0:r.design;return n&&typeof n=="object"&&n.resolved?n:null}function ta(e,t,n,r){var o,i;for(let s of(o=r==null?void 0:r.attributes)!=null?o:[])s in n.attributes||t.removeAttribute(s);for(let s of(i=r==null?void 0:r.style)!=null?i:[])s in n.style||t.style.removeProperty(s);for(let[s,a]of Object.entries(n.style))t.style.setProperty(s,a);for(let[s,a]of Object.entries(n.attributes))t.setAttribute(s,a);if(n.css){let s=e;if(!fn(s,`design:${n.key}`,n.css)&&!Array.from(e.head.querySelectorAll("style[data-atlas-design]")).some(l=>l.getAttribute("data-atlas-design")===n.key)){let l=e.createElement("style");l.setAttribute("data-atlas-design",n.key),pn(s,l),l.textContent=n.css,e.head.appendChild(l)}}if(n.fontStylesheets.length){let s=new Set(Array.from(e.head.querySelectorAll("link[data-atlas-font]")).map(a=>a.getAttribute("href")));for(let a of n.fontStylesheets){if(s.has(a))continue;let l=e.createElement("link");l.setAttribute("rel","stylesheet"),l.setAttribute("href",a),l.setAttribute("data-atlas-font",""),e.head.appendChild(l)}}return{attributes:Object.keys(n.attributes),style:Object.keys(n.style)}}var Wd=["boxes","single"];function ra(e,t){for(let n of[t,e])if(n&&Wd.includes(n))return n;return"boxes"}var oa=8,Kd=["solid","outline","soft","ghost"],Gd=["none","scale","lift","glow","ripple"],Vd=["none","sm","md","lg"],Yd=["comfortable","compact"],Jd=["outline","filled","underline"],Qd=["slow","normal","fast"],Xd=["spinner","skeleton","dots","bar"],ia={slow:280,normal:160,fast:80};function gn(e,t){let n=(r,o,...i)=>{for(let s of i)if(s!==void 0&&r.includes(s))return s;return o};return{buttonStyle:n(Kd,"solid",t==null?void 0:t.buttonStyle,e==null?void 0:e.buttonStyle),buttonEffect:n(Gd,"scale",t==null?void 0:t.buttonEffect,e==null?void 0:e.buttonEffect),shadow:n(Vd,"md",t==null?void 0:t.shadow,e==null?void 0:e.shadow),density:n(Yd,"comfortable",t==null?void 0:t.density,e==null?void 0:e.density),inputStyle:n(Jd,"outline",t==null?void 0:t.inputStyle,e==null?void 0:e.inputStyle),animations:typeof(t==null?void 0:t.animations)=="boolean"?t.animations:typeof(e==null?void 0:e.animations)=="boolean"?e.animations:!0,motionSpeed:n(Qd,"normal",t==null?void 0:t.motionSpeed,e==null?void 0:e.motionSpeed),loading:n(Xd,"spinner",t==null?void 0:t.loading,e==null?void 0:e.loading)}}var Zd=["block","compact","icon"],eu=["sm","md","lg"],tu=["list","grid","carousel"],nu=["auto","always","never"];function qr(e,t){var r,o,i;let n=(s,...a)=>{for(let l of a)if(l!==void 0&&s.includes(l))return l;return s[0]};return{variant:n(Zd,t==null?void 0:t.variant,e==null?void 0:e.variant),size:n(eu,(r=t==null?void 0:t.size)!=null?r:"md",e==null?void 0:e.size,"md"),layout:n(tu,t==null?void 0:t.layout,e==null?void 0:e.layout),labels:{...(o=e==null?void 0:e.labels)!=null?o:{},...(i=t==null?void 0:t.labels)!=null?i:{}},search:n(nu,t==null?void 0:t.search,e==null?void 0:e.search)}}var be={colorPrimary:"#5b5bd6",colorText:"#1c1c1f",colorBackground:"#ffffff",colorAccent:"#5b5bd6",colorCard:"#ffffff",colorBorder:"#e4e4e9",borderRadius:"10px",fontFamily:'ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif'};function ru(e){return e?{colorPrimary:e.colorPrimary||be.colorPrimary,colorText:e.colorText||be.colorText,colorBackground:e.colorBackground||be.colorBackground,colorAccent:e.colorAccent||e.colorPrimary||be.colorAccent,colorCard:e.colorCard||e.colorBackground||be.colorCard,colorBorder:e.colorBorder||be.colorBorder,borderRadius:e.borderRadius||be.borderRadius,fontFamily:e.fontStack||be.fontFamily}:be}function sa(e,t){var o;let n={...ru(e)},r=(o=t==null?void 0:t.variables)!=null?o:{};for(let[i,s]of Object.entries(r))s!==void 0&&(n[i]=s);return n}function aa(e){let t={};for(let[n,r]of Object.entries(e))t[`--atlas-embed-${n.replace(/[A-Z]/g,o=>`-${o.toLowerCase()}`)}`]=r;return t}function la(e){let t=Je(e);if(!t)return"#ffffff";let n=un(t);return bt("#ffffff",n)>=bt("#111111",n)?"#ffffff":"#111111"}function ca(e,t){let n=Je(e);if(!n)return e;let r=un(n),o=t.map(i=>Je(i)).filter(i=>!!i&&i.a>0).map(un);return o.length===0||o.every(i=>bt(r,i)>=3)?e:Ns(r,o)}function da(e,t,n){var o;let r=(o=n==null?void 0:n.elements)==null?void 0:o[e];return r?`${t} ${r}`:t}function ua(e,t){var s,a;let n=(s=t==null?void 0:t.providerOrder)!=null?s:[],r=new Set((a=t==null?void 0:t.providerHidden)!=null?a:[]),o=new Set(e.filter(l=>!r.has(l))),i=[];for(let l of n)o.has(l)&&!i.includes(l)&&i.push(l);for(let l of e)o.has(l)&&!i.includes(l)&&i.push(l);return i}var na={google:"Google",github:"GitHub",gitlab:"GitLab",facebook:"Facebook",apple:"Apple",microsoft:"Microsoft",discord:"Discord",linkedin:"LinkedIn",twitter:"X",twitter_v1:"X",x:"X",slack:"Slack",spotify:"Spotify",twitch:"Twitch",notion:"Notion",linear:"Linear",steam:"Steam"};function mn(e){return na[e]?na[e]:e.split(/[_-]/).map(t=>t&&t[0].toUpperCase()+t.slice(1)).join(" ")}var ou="0.19.1",pa={name:"@atlasauth/embed",version:ou};function iu(e,t){return(n,r)=>{let o=typeof n=="string"?n:n.toString(),i;try{i=new URL(o)}catch{return t(n,r)}return i.searchParams.has("publishable_key")||i.searchParams.set("publishable_key",e),t(i.toString(),r)}}function ue(e){var n;let t=(n=e.fetchImpl)!=null?n:fetch;return new It({publishableKey:e.publishableKey,baseUrl:e.frontendApi.replace(/\/$/,""),fetchImpl:iu(e.publishableKey,t),locale:e.locale,sdk:pa,referral:e.referral,referralConsent:e.referralConsent})}async function fa(e){let t=await e.get("/v1/appearance");return t.ok?t.data:null}var Hr="atlas-embed-styles",ga=`
|
|
39
39
|
/* The host page's --atlas-host-* variables (shared UI-kit names) restyle the widget
|
|
40
40
|
where the page sets them; explicit --atlas-embed-* settings still win. */
|
|
41
41
|
.atlas-embed-root {
|
|
@@ -410,5 +410,5 @@ form > .atlas-embed-step-back { display: block; width: 100%; text-align: center;
|
|
|
410
410
|
.atlas-embed-loadbar::before { position: static; width: 100%; }
|
|
411
411
|
}
|
|
412
412
|
@keyframes atlas-embed-pulse { 0%,100% { opacity: 0.4; } 50% { opacity: 1; } }
|
|
413
|
-
`,ea=new WeakSet;function ta(e=document){var n;if(ea.has(e)||e.querySelector(`style[data-${Mr}]`))return;if(ln(e,Mr,Xs)){ea.add(e);return}let t=e.createElement("style");t.setAttribute(`data-${Mr}`,""),an(e,t),t.textContent=Xs,((n=e.head)!=null?n:e.documentElement).appendChild(t)}function na(e,t,n={}){var u;let r=Os({instance:(t==null?void 0:t.instanceDesign)===!1?null:e,preset:t==null?void 0:t.preset,design:t==null?void 0:t.design,warn:Us});if(!r)return null;let i=r.colorScheme==="dark"||r.colorScheme==="auto"&&!!n.prefersDark?r.paletteDark:r.palette,s={colorPrimary:i.primary,colorText:i.text,colorBackground:i.background,colorAccent:i.accent,colorCard:i.surface,colorBorder:i.border,borderRadius:`${Math.min(r.shape.controlRadius,24)}px`,fontFamily:Ar(r.typography.font)};for(let[p,f]of Object.entries((u=t==null?void 0:t.variables)!=null?u:{}))f!==void 0&&(s[p]=f);let a=r.elevation.cardShadow==="xl"?"lg":r.elevation.cardShadow,l={buttonStyle:r.buttons.style==="gradient"?"solid":r.buttons.style,shadow:r.card.style==="outline"||r.card.style==="none"?"none":a,density:r.spacing.density==="compact"?"compact":"comfortable",inputStyle:r.inputs.style},c=r.buttons.socialLayout==="icons"?{variant:"icon",layout:"grid"}:{layout:r.buttons.socialLayout==="grid"?"grid":"list"},d=Is(JSON.stringify(r));return{render:{style:{},attributes:{...Dr(r),"data-atlas-design":d},css:"",key:d,fontStylesheets:Fs(r,n.frontendApi)},tokens:s,interaction:l,socialButtons:c,resolved:r}}var ra=new Set(["bluesky"]),oa='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg>',ia='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 18l6-6-6-6"/></svg>',Fe={"sign-in":{title:"Sign in",submit:"Continue"},"sign-up":{title:"Create your account",submit:"Continue"}};function D(e){var t;return(t=e.root.ownerDocument)!=null?t:document}function b(e,t,n,r){let o=D(e).createElement(t);return n&&(o.className=n),r!=null&&(o.textContent=r),(o.classList.contains("atlas-embed-form-error")||o.classList.contains("atlas-embed-error"))&&o.setAttribute("role","alert"),(o.classList.contains("atlas-embed-button")||o.classList.contains("atlas-embed-social-button"))&&Gd(e,o),o}function I(e,t,n){return Ys(t,n,e.options.appearance)}function Gd(e,t){e.interaction.buttonEffect!=="ripple"||!e.interaction.animations||t.addEventListener("pointerdown",n=>{let r=t.getBoundingClientRect(),o=Math.max(r.width,r.height),i=D(e).createElement("span");i.className="atlas-embed-ripple",i.style.width=i.style.height=`${o}px`,i.style.left=`${n.clientX-r.left-o/2}px`,i.style.top=`${n.clientY-r.top-o/2}px`,i.addEventListener("animationend",()=>i.remove()),t.appendChild(i)})}function Ke(e,t){let n=b(e,"button",I(e,"buttonPrimary","atlas-embed-button"));if(n.type="submit",n.disabled=e.busy,e.busy){n.setAttribute("data-busy",""),n.setAttribute("aria-label",t);let r=b(e,"span","atlas-embed-btn-spinner");r.setAttribute("aria-hidden","true"),n.appendChild(r)}else n.textContent=t;return n}function sa(e,t=typeof window!="undefined"?window.location.origin:""){if(!e||typeof e!="string")return null;if(e.startsWith("/")&&!e.startsWith("//"))try{return t?new URL(e,t).toString():e}catch{return null}let n;try{n=new URL(e)}catch{return null}return t&&n.origin===t||n.protocol==="https:"?n.toString():null}async function ht(e,t,n=!1){var a,l,c;let r=e.captchaFlows[t];if(!(n?!!r&<(r.provider,r):ze(r))||!r)return null;let i=(a=e.root.ownerDocument)!=null?a:document,s=i.createElement("div");s.className="atlas-embed-captcha",((c=(l=e.root.parentElement)!=null?l:i.body)!=null?c:i.documentElement).appendChild(s);try{return await cr(r,s,{atlas:{labels:sr(e.options.localization)}})}catch{return null}finally{s.remove()}}var Ur=new WeakMap;async function Vd(e){let t=Ur.get(e);if(t){let o=await t;return o?{...o,owner:!1}:null}let n=ui({win:e}).catch(()=>null);Ur.set(e,n),n.finally(()=>Ur.delete(e));let r=await n;return r?{...r,owner:!0}:null}async function ca(e){var o,i;let t=(i=(o=e.root.ownerDocument)==null?void 0:o.defaultView)!=null?i:typeof window!="undefined"?window:null;if(!t)return!1;let n=await Vd(t);if(n!=null&&n.delivered)return Ge(e,"Signed in. You can close this window."),!0;if(n!=null&&n.owner){let s=gi(n.payload);if(s!=null&&s.ticket&&s.attemptId)return await aa(e,t,s.attemptId,s.ticket),!0;if(s!=null&&s.continuationUrl)return t.location.replace(s.continuationUrl),!0}let r=mi(t.location.search);return r?r.ticket?(await aa(e,t,r.attemptId,r.ticket,()=>la(e,t)),!0):(r.status&&(e.state=Pt({id:r.attemptId,status:r.status,...r.policyToken?{policyToken:r.policyToken}:{}}),la(e,t)),!1):!1}async function aa(e,t,n,r,o){let i=await ye(e,n,r);o==null||o(),!(i&&await pi({win:t}).catch(()=>!1))&&await re(e,n)}function la(e,t){try{t.history.replaceState({},t.document.title,Ot(t.location.href))}catch{}}async function ye(e,t,n){return e.options.preview?!1:(await e.client.post("/v1/client/tickets/exchange",{attempt_id:t,ticket:n,remember:e.remember})).ok}async function re(e,t){var o,i;if(Ne(e.state)){O(e);return}e.options.preview||await Hi(e.client).catch(()=>{});let n=(i=(o=e.root.ownerDocument)==null?void 0:o.defaultView)!=null?i:typeof window!="undefined"?window:null,r=sa(e.options.redirect,n?n.location.origin:void 0);if(e.root.dispatchEvent(new CustomEvent("atlas:complete",{bubbles:!0,detail:{attemptId:t,redirected:!!r}})),e.options.preview){Ge(e,"Sign-in works \u2014 this is a preview, so no session was created.");return}if(r&&n){n.location.assign(r);return}Ge(e,"You are signed in.")}function yt(e,t){Bo({api:e.options.frontendApi,publishableKey:e.options.publishableKey,attemptId:t!=null?t:void 0,kind:e.mode==="sign-up"?"sign_up":"sign_in",recorder:e.recorder,fetchImpl:e.options.fetchImpl})}async function oe(e,t,n){var a,l,c,d,u,p,f;if(e.busy)return;if((a=e.conditionalAbort)==null||a.abort(),e.flash=null,typeof t.identifier=="string"&&t.identifier.trim()&&(e.enteredIdentifier=t.identifier.trim()),e.busy=!0,yt(e,(l=e.state.attempt)==null?void 0:l.id),O(e),e.state=await it(e.client,e.state,t),e.state.attempt&&X(e.state.attempt).kind==="collect_captcha"){let g=await ht(e,"signIn",!0);g&&(e.state=await it(e.client,e.state,{identifier:(d=(c=e.enteredIdentifier)!=null?c:t.identifier)!=null?d:"",captcha_token:g}))}let r=e.state.attempt?X(e.state.attempt):null;n&&(r==null?void 0:r.kind)==="collect_first_factor"&&e.state.errors.length===0?r.strategies.includes(n)?await un(e,n,!1):e.state={...e.state,errors:[{code:"STRATEGY_DISABLED",message:"That sign-in method is not available for this account."}]}:(r==null?void 0:r.kind)==="collect_first_factor"&&t.password&&e.state.errors.length===0&&(e.state=await it(e.client,e.state,{password:t.password})),e.busy=!1;let o=e.state.attempt?X(e.state.attempt):null;e.mode==="sign-in"&&e.passwordEnabled&&(o==null?void 0:o.kind)==="collect_first_factor"&&!e.state.prepared&&(e.state={...Y,errors:e.state.errors});let i=e.state.attempt?X(e.state.attempt):null;if((i==null?void 0:i.kind)==="collect_first_factor"&&!e.state.prepared&&e.state.errors.length===0){let g=It(e.emailDeliveryAvailable?i.strategies:i.strategies.filter(m=>m!=="email_code"&&m!=="email_link")).autoSend;g&&await un(e,g,!1)}let s=e.state.attempt;if(Ze(e.state)){let g=(p=(u=e.state.attempt)==null?void 0:u.id)!=null?p:null;e.busy=!0,O(e),e.state.ticket&&g&&await ye(e,g,e.state.ticket)&&(e.state={...e.state,ticket:null}),e.busy=!1,O(e);return}if((s==null?void 0:s.status)==="complete"){let g=(f=s.id)!=null?f:null;if(g&&g===e.heldResetAttempt&&!e.state.ticket){da(e);return}e.state.ticket&&g&&await ye(e,g,e.state.ticket),await re(e,g);return}O(e)}function da(e){e.flash="Password updated. Sign in with your new password.",e.state=Y,e.mode="sign-in",O(e)}function ua(e){var t,n,r;(r=e.enteredIdentifier)!=null||(e.enteredIdentifier=(n=(t=e.state.attempt)==null?void 0:t.identifier)!=null?n:null),e.state=Y,e.mode="sign-in",O(e)}async function pa(e){var n,r;if(e.busy||!Ze(e.state))return;e.state=xo(e.state);let t=(r=(n=e.state.attempt)==null?void 0:n.id)!=null?r:null;e.busy=!0;try{e.state.ticket&&t&&await ye(e,t,e.state.ticket)}finally{e.busy=!1}await re(e,t)}async function fa(e){var n,r;if(e.busy||!Ne(e.state))return;let t=(r=(n=e.state.attempt)==null?void 0:n.id)!=null?r:null;e.state=Yn(e.state),await re(e,t)}async function un(e,t,n=!0){var i;if(n){if(e.busy)return;e.busy=!0,O(e)}let r=(i=e.state.prepared)!=null?i:null,o=await ei(e.client,e.state,t);e.state=o.errors.length>0?{...o,prepared:r}:o,t==="email_link"&&o.errors.length===0&&ma(e),n&&(e.busy=!1,O(e))}async function ga(e){e.busy||(e.busy=!0,O(e),e.state=await Xo(e.client,e.state),e.busy=!1,e.flash=e.state.errors.length===0?"We sent you a new email.":null,O(e))}function ma(e){e.linkPoll&&clearInterval(e.linkPoll),e.linkPoll=setInterval(()=>{(async()=>{var i,s;if(!Vn(e.state)){e.linkPoll&&clearInterval(e.linkPoll),e.linkPoll=null;return}let t=(i=e.state.attempt)==null?void 0:i.status,{state:n,ticket:r}=await ti(e.client,e.state);if(e.state=n,!r&&n.attempt&&n.attempt.status!==t&&O(e),!r||!n.attempt)return;e.linkPoll&&clearInterval(e.linkPoll),e.linkPoll=null;let o=(s=n.attempt.id)!=null?s:null;o&&await ye(e,o,r),await re(e,o)})()},2e3)}async function pn(e,t,n){var a,l,c;yt(e);let r=(l=(a=e.root.ownerDocument)==null?void 0:a.defaultView)!=null?l:typeof window!="undefined"?window:null,o=r?Ot(r.location.href):e.options.frontendApi,i=await e.client.post("/v1/client/sign_ins/oauth",{provider:t,redirect_url:o,...n?{identifier:n}:{}}),s=(c=i.data)==null?void 0:c.authorization_url;s&&r?r.location.assign(s):(e.handlePrompt=null,be(e,i.errors))}async function Nr(e,t,n={}){var a,l,c;yt(e);let r=(l=(a=e.root.ownerDocument)==null?void 0:a.defaultView)!=null?l:typeof window!="undefined"?window:null,o=r?Ot(r.location.href):e.options.frontendApi;if(n.popup&&r){await Jd(e,t,r,o);return}let i=await e.client.post("/v1/client/sign_ins/sso",{connection_id:t,redirect_url:o}),s=(c=i.data)==null?void 0:c.authorization_url;s&&r?r.location.assign(s):be(e,i.errors)}function Yd(e){let t=e.options.frontendApi;try{return new URL(/^https?:\/\//.test(t)?t:`https://${t}`).origin}catch{return t}}async function Jd(e,t,n,r){var u;let o=n.open("about:blank","atlas-sso","width=480,height=640,menubar=no,toolbar=no,location=no,status=no");if(!o){await Nr(e,t);return}let i=r.includes("?")?"&":"?",s=`${r}${i}__atlas_display=popup`,a=Yd(e),l=p=>{if(p.origin!==a)return;let f=p.data;if(!(!f||f.type!=="atlas-sso")){n.removeEventListener("message",l);try{o.close()}catch{}if(f.error){be(e,[{code:"sso_popup_cancelled",message:"Sign-in was cancelled."}]);return}if(f.status==="complete"&&f.ticket&&f.attempt_id){let g=f.attempt_id,m=f.ticket;(async()=>(await ye(e,g,m),await re(e,g)))();return}f.attempt_id&&f.status&&(e.state=Pt({id:f.attempt_id,status:f.status,...typeof f.policy_token=="string"?{policyToken:f.policy_token}:{}}),O(e))}};n.addEventListener("message",l);let c=await e.client.post("/v1/client/sign_ins/sso",{connection_id:t,redirect_url:s}),d=(u=c.data)==null?void 0:u.authorization_url;if(d)try{o.location.assign(d)}catch{try{o.close()}catch{}n.removeEventListener("message",l),n.location.assign(d)}else{n.removeEventListener("message",l);try{o.close()}catch{}be(e,c.errors)}}async function ha(e,t,n){let r=await e.client.post("/v1/client/sign_ins/id_token",xi({provider:t,idToken:n})),o=wi(r.data);if(!o){be(e,r.errors);return}if(o.status==="complete"&&o.ticket){await ye(e,o.attemptId,o.ticket),await re(e,o.attemptId);return}let i=r.data,s=Pt({id:o.attemptId,status:o.status,...typeof(i==null?void 0:i.policy_acceptance_token)=="string"?{policyToken:i.policy_acceptance_token}:{}});e.state=o.status==="needs_policy_acceptance"&&s.attempt&&Array.isArray(i==null?void 0:i.pending_policies)?{...s,attempt:{...s.attempt,pending_policies:i.pending_policies}}:s,O(e)}function zr(e){e.resetFlow={...ct},O(e)}async function Br(e,t){var o,i,s,a,l,c,d;if(e.busy||!e.resetFlow)return;if(e.busy=!0,yt(e),O(e),Be(e.resetFlow)==="request"){typeof t.email=="string"&&t.email.trim()&&(e.enteredIdentifier=t.email.trim());let u=await ht(e,"passwordReset");e.resetFlow=await Ki(e.client,(o=t.email)!=null?o:"",u!=null?u:void 0),(i=e.resetFlow.attempt)!=null&&i.poll_secret&&Qd(e)}else e.resetFlow=await Gi(e.client,e.resetFlow,{code:t.code,password:t.password,securityAnswers:((s=e.resetFlow.securityQuestions)!=null?s:[]).map((u,p)=>{var f;return{question:u,answer:(f=t[`security_answer_${p}`])!=null?f:""}})},{askQuestions:((a=e.account.mfa)==null?void 0:a.securityQuestions)===!0});e.busy=!1;let n=e.resetFlow,r=n?Vi(n):null;if(r){e.resetFlow=null,e.heldResetAttempt=(c=(l=r.attempt)==null?void 0:l.id)!=null?c:null,e.state=r,O(e);return}if(((d=n==null?void 0:n.attempt)==null?void 0:d.status)==="complete"){let u=n.attempt.id;e.resetFlow=null,Ne(e.state)&&(e.state=Yn(e.state)),n.ticket?(await ye(e,u,n.ticket),await re(e,u)):da(e);return}O(e)}function Qd(e){var n,r;e.linkPoll&&clearInterval(e.linkPoll);let t=(r=(n=e.resetFlow)==null?void 0:n.attempt)==null?void 0:r.id;e.linkPoll=setInterval(()=>{(async()=>{var s,a;let o=e.resetFlow;if(!(o!=null&&o.attempt)||o.attempt.id!==t||o.attempt.status!=="needs_email_verification"){e.linkPoll&&clearInterval(e.linkPoll),e.linkPoll=null;return}let i=await Ji(e.client,o,{askQuestions:((s=e.account.mfa)==null?void 0:s.securityQuestions)===!0});e.resetFlow!==o||((a=i.attempt)==null?void 0:a.status)==="needs_email_verification"||(e.linkPoll&&clearInterval(e.linkPoll),e.linkPoll=null,e.resetFlow=i,O(e))})()},2e3)}async function jr(e,t,n=!0){var c;if(e.busy)return;e.busy=!0,yt(e),O(e);let{identifier:r,password:o,...i}=t,s={};for(let[d,u]of Object.entries(i))u&&(s[d]=u);let a=await ht(e,"signUp");e.state=await Gn(e.client,{email:r!=null?r:"",password:o!=null?o:"",fields:s,consent:n,captchaToken:a!=null?a:void 0,policyAcceptances:e.policies.build()}),e.busy=!1,await ya(e);let l=e.state.attempt;if((l==null?void 0:l.status)==="complete"){let d=(c=l.id)!=null?c:null;e.state.ticket&&d&&await ye(e,d,e.state.ticket),await re(e,d);return}Vn(e.state)&&ma(e),O(e)}var Zd={"mfa.enrollChoose":"Set up a second step for signing in.","mfa.enrollTotpOption":"Use an authenticator app","mfa.enrollSmsOption":"Use text messages","mfa.enrollScan":"Scan this QR code with your authenticator app, or enter the setup key.","mfa.enrollQrAlt":"QR code for your authenticator app","mfa.enrollSetupKey":"Setup key","mfa.enrollPreparing":"Setting up\u2026","mfa.enrollFirstCodeLabel":"Code from your authenticator app","mfa.enrollSecondCodeLabel":"The next code it shows","mfa.phoneLabel":"Mobile number","mfa.phoneHint":"Include the country code, for example +14155550101.","mfa.sendCode":"Text me a code","mfa.codeTextedTo":"Enter the code we texted to {phone}.","mfa.codeLabel":"Code","mfa.smsCodeOption":"Text me a code instead","mfa.recoveryCodesTitle":"Save your recovery codes","mfa.recoveryCodesHelp":"Each code works once. If you can't use your second step, sign in with one of these. Keep them somewhere safe: they won't be shown again.","mfa.recoveryCodesCopy":"Copy codes","mfa.recoveryCodesCopied":"Copied.","mfa.recoveryCodesDownload":"Download as .txt","mfa.recoveryCodesSaved":"I've saved my codes","signIn.emailCodeOption":"Email me a code instead","signIn.codeSentTo":"We sent a code to {email}. Enter it below.","signIn.resendCode":"Resend code","signIn.sending":"Sending\u2026","signIn.forgotPassword":"Forgot password?","signUp.existingAccount":"You already had an account. Your existing password still applies.","signUp.emailConfirmed":"Your email is confirmed. Sign in to continue.","signUp.submit":"Continue","signIn.title":"Sign in","requiredAction.firstNameLabel":"First name","requiredAction.lastNameLabel":"Last name","requiredAction.sendCode":"Email me a code","requiredAction.skip":"Skip for now","requiredAction.customIntro":"Your account needs one more step before you continue.","requiredAction.verifyIntro":"We will email a code to confirm your address.","requiredAction.idvIntro":"To continue, verify your identity with a photo ID and a selfie.","requiredAction.idvStart":"Start verification","requiredAction.idvOpen":"Open the verification page","requiredAction.idvWaiting":"Waiting for your verification to finish\u2026","requiredAction.idvCheck":"I've finished","requiredAction.idvDeclined":"We could not verify your identity. You can try again.","requiredAction.idvReview":"Your verification is being reviewed. This can take a little while."};function T(e,t,n={}){var s;let r=e.options.localization,o=typeof r=="function"?r(t):r&&typeof r=="object"?r[t]:void 0;return(typeof o=="string"&&o.trim()?o:(s=Zd[t])!=null?s:t).replace(/\{(\w+)\}/g,(a,l)=>{var c;return(c=n[l])!=null?c:a})}function ba(e){var n;let t=(n=e.state.attempt)==null?void 0:n.id;return t?(e.enrollment||(e.enrollment=bo(e.client,()=>An(e.account)),e.enrollment.subscribe(()=>queueMicrotask(()=>O(e)))),e.enrollment.start(t),e.enrollment):null}function ka(e,t,n,r){var l;let o=ba(e);if(!o)return r;let i=o.state,s=(c,d)=>{let u=b(e,"button","atlas-embed-step-back",T(e,c==="totp"?"mfa.enrollTotpOption":"mfa.enrollSmsOption"));u.type="button",u.setAttribute("data-atlas-mfa-method",c),u.disabled=e.busy||i.busy,u.addEventListener("click",()=>void o.choose(c)),Array.isArray(d)?d.push(u):d.appendChild(u)};if(i.method===null){t.appendChild(b(e,"p","atlas-embed-note",T(e,"mfa.enrollChoose")));for(let c of i.options)s(c,t)}else if(i.method==="totp"){let c=i.enrollment;if(c){if(t.appendChild(b(e,"p","atlas-embed-note",T(e,"mfa.enrollScan"))),c.qrCode){let d=D(e).createElement("img");d.className="atlas-embed-mfa-qr",d.setAttribute("data-atlas","mfa-qr"),d.src=c.qrCode,d.alt=T(e,"mfa.enrollQrAlt"),d.width=180,d.height=180,t.appendChild(d)}if(c.secret){let d=b(e,"p","atlas-embed-note",`${T(e,"mfa.enrollSetupKey")}: `);d.setAttribute("data-atlas","mfa-setup-key"),d.appendChild(b(e,"code","atlas-embed-mfa-key",yo(c.secret))),t.appendChild(d)}n.addCodeField("code",T(e,"mfa.enrollFirstCodeLabel"),!0),i.totpCodes>=2&&n.addCodeField("secondCode",T(e,"mfa.enrollSecondCodeLabel"),!1)}else{let d=b(e,"p","atlas-embed-note",i.busy?T(e,"mfa.enrollPreparing"):"");d.setAttribute("aria-live","polite"),t.appendChild(d)}}else if(!i.enrollment)n.addField("phone",T(e,"mfa.phoneLabel"),"tel","tel"),t.appendChild(b(e,"p","atlas-embed-note",T(e,"mfa.phoneHint")));else{let c=b(e,"p","atlas-embed-note",T(e,"mfa.codeTextedTo",{phone:(l=i.enrollment.phone)!=null?l:""}));c.setAttribute("data-atlas","mfa-code-texted"),t.appendChild(c),n.addCodeField("code",T(e,"mfa.codeLabel"),!0);let d=b(e,"button","atlas-embed-step-back",T(e,"signIn.resendCode"));d.type="button",d.setAttribute("data-atlas-resend",""),d.disabled=e.busy||i.busy,d.addEventListener("click",()=>void o.resend()),n.trailing.push(d)}for(let c of i.errors){let d=b(e,"p","atlas-embed-error",e.errorText(c));d.setAttribute("role","alert"),t.appendChild(d)}if(i.method!==null&&i.options.length>1)for(let c of i.options.filter(d=>d!==i.method))s(c,n.trailing);let a=ko(i);return a===null?null:a==="mfa.sendCode"?T(e,"mfa.sendCode"):r}async function _a(e,t){let n=ba(e);if(!n)return;let r=await n.submit(t);r&&await oe(e,r)}function va(e,t){var s;let n=(s=e.state.attempt)==null?void 0:s.id;if(!n)return;let r=An(e.account),o=e.secondFactorCode&&e.secondFactorCode.attemptId===n?e.secondFactorCode:null,i=[];r.sms&&i.push("sms"),r.emailCode&&i.push("email_code");for(let a of i){let l=a==="sms"?"sms-second-factor":"email-second-factor";if((o==null?void 0:o.strategy)===a&&o.sentTo!==void 0){let u=b(e,"p","atlas-embed-note",a==="sms"?T(e,"mfa.codeTextedTo",{phone:o.sentTo}):T(e,"signIn.codeSentTo",{email:o.sentTo}));u.setAttribute("data-atlas",`${l}-sent`),u.setAttribute("aria-live","polite"),t.push(u);continue}let c=(o==null?void 0:o.strategy)===a&&o.busy===!0,d=b(e,"button","atlas-embed-step-back",c?T(e,"signIn.sending"):T(e,a==="sms"?"mfa.smsCodeOption":"signIn.emailCodeOption"));if(d.type="button",d.setAttribute("data-atlas",l),d.disabled=e.busy||c,d.addEventListener("click",()=>{e.secondFactorCode={attemptId:n,strategy:a,busy:!0},O(e),_o(e.client,n,a).then(({sentTo:u})=>{e.secondFactorCode={attemptId:n,strategy:a,sentTo:u},O(e)},u=>{e.secondFactorCode={attemptId:n,strategy:a,error:u instanceof Error?u.message:String(u)},O(e)})}),t.push(d),(o==null?void 0:o.strategy)===a&&o.error){let u=b(e,"p","atlas-embed-error",o.error);u.setAttribute("role","alert"),t.push(u)}}}function xa(e,t){var s,a;let n=b(e,"div","atlas-embed-recovery-codes");n.setAttribute("data-atlas","recovery-codes"),n.appendChild(b(e,"h2",I(e,"title","atlas-embed-title"),T(e,"mfa.recoveryCodesTitle"))),n.appendChild(b(e,"p","atlas-embed-note",T(e,"mfa.recoveryCodesHelp")));let r=b(e,"ul","atlas-embed-recovery-list");r.setAttribute("data-atlas","recovery-codes-list"),r.setAttribute("style","list-style:none;padding:0;margin:8px 0 12px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;text-align:center");for(let l of t){let c=b(e,"li");c.appendChild(b(e,"code","atlas-embed-mfa-key",l)),r.appendChild(c)}n.appendChild(r);let o=((s=D(e).defaultView)!=null?s:globalThis).navigator;if((a=o==null?void 0:o.clipboard)!=null&&a.writeText){let l=b(e,"button","atlas-embed-step-back",T(e,"mfa.recoveryCodesCopy"));l.type="button",l.setAttribute("data-atlas","recovery-codes-copy"),l.addEventListener("click",()=>{wo(t).then(c=>{if(!c||n.querySelector('[data-atlas="recovery-codes-copied"]'))return;let d=b(e,"p","atlas-embed-note",T(e,"mfa.recoveryCodesCopied"));d.setAttribute("data-atlas","recovery-codes-copied"),d.setAttribute("aria-live","polite"),n.insertBefore(d,i)})}),n.appendChild(l)}if(Pn()){let l=b(e,"button","atlas-embed-step-back",T(e,"mfa.recoveryCodesDownload"));l.type="button",l.setAttribute("data-atlas","recovery-codes-download"),l.addEventListener("click",()=>So(t)),n.appendChild(l)}let i=b(e,"button",I(e,"buttonPrimary","atlas-embed-button"),T(e,"mfa.recoveryCodesSaved"));return i.type="button",i.setAttribute("data-atlas","recovery-codes-saved"),i.disabled=e.busy,i.addEventListener("click",()=>{i.disabled=!0,pa(e)}),n.appendChild(i),n}function fn(e){return Vo((t,n)=>T(e,t,n!=null?n:{}))}async function wa(e){e.mode==="sign-up"&&(tr(D(e)),e.policies.setPolicies(await ot(e.client)))}function qr(e){return{link:"atlas-embed-consent-link",text:"atlas-embed-consent-text"}}function Sa(e){for(let t of e.policyDispose.splice(0))t()}function Ca(e,t){let n=e.policies;if(n.policies.length===0)return null;let r=fn(e),o=D(e),i=b(e,"div"),s=b(e,"p");return e.policyDispose.push(nr(i,n,{t:r,document:o,classes:qr(e)}).destroy),e.policyDispose.push(rr(s,n,{t:r,document:o,classes:qr(e)}).destroy),e.policyDispose.push(n.subscribe(t)),{consent:i,clickwrap:s,canSubmit:()=>n.canSubmit(),async read(){return n.pendingScroll()?or(n,{t:r,document:o,container:e.root}):!0}}}async function ya(e){Hn(e.state.errors)&&e.policies.setPolicies(await ot(e.client))}function Aa(e){var l;let t=fn(e),n=D(e),r=b(e,"div","atlas-embed-policies");tr(n);let o=e.state.attempt,i=(l=o==null?void 0:o.id)!=null?l:null;(!e.pendingPolicies||e.pendingPolicies.attemptId!==i)&&(e.pendingPolicies={attemptId:i,controller:null},Yo(e.client,o,{}).then(c=>{var d;((d=e.pendingPolicies)==null?void 0:d.attemptId)===i&&(e.pendingPolicies={attemptId:i,controller:c},O(e))}));let s=e.pendingPolicies.attemptId===i?e.pendingPolicies.controller:null;if(!s)return r.appendChild(b(e,"p","atlas-embed-note",t("policy.loading"))),r;let a=ki(r,s,{t,document:n,container:e.root,classes:qr(e),onSubmit:c=>{e.pendingPolicies=null,oe(e,{policy_acceptances:JSON.stringify(c)})},onDecline:c=>{e.pendingPolicies=null,e.state={attempt:null,errors:[{code:"POLICY_DECLINED",message:t("policy.declined",{policy:c.title})}],busy:!1,pollSecret:null,ticket:null},O(e)}});return a.setBusy(e.busy),e.policyDispose.push(a.destroy),r}function Pa(e){let t=b(e,"div","atlas-embed-existing-account");t.setAttribute("data-atlas","existing-account");let n=b(e,"p","atlas-embed-note",T(e,"signUp.existingAccount"));if(n.setAttribute("role","status"),t.appendChild(n),e.passwordResetEnabled){let o=b(e,"button","atlas-embed-step-back",T(e,"signIn.forgotPassword"));o.type="button",o.addEventListener("click",()=>{var i,s,a;(a=e.enteredIdentifier)!=null||(e.enteredIdentifier=(s=(i=e.state.attempt)==null?void 0:i.identifier)!=null?s:null),zr(e)}),t.appendChild(o)}let r=b(e,"button",I(e,"buttonPrimary","atlas-embed-button"),T(e,"signUp.submit"));return r.type="button",r.setAttribute("data-atlas","existing-account-continue"),r.addEventListener("click",()=>void fa(e)),t.appendChild(r),t}function Ea(e){var f,g;let t=e.resetFlow,n=Be(t),r=b(e,"div","atlas-embed-reset");r.appendChild(b(e,"h1",I(e,"title","atlas-embed-title"),"Reset your password"));let o=D(e).createElement("form"),i=t.errors,s=new Map,a=i.find(m=>!m.param);a&&o.appendChild(b(e,"div","atlas-embed-form-error",e.errorText(a)));let l=null,c="Continue",d=!0,u=e.account.passwordReset;switch(n){case"request":l=u==="link"?"Enter your email and we\u2019ll send you a reset link.":u==="both"?"Enter your email and we\u2019ll send you a reset link and code.":"Enter your email and we\u2019ll send you a reset code.",c=u==="link"?"Send reset link":"Send reset code",bt(e,o,s,i,"email","Email address","email","username");{let m=s.get("email");m&&(e.enteredIdentifier&&(m.value=e.enteredIdentifier),m.setAttribute("data-atlas-autofocus",""))}break;case"collect_email_code":if(u==="link"){d=!1,l="Check your email";let m=b(e,"p","atlas-embed-note",e.enteredIdentifier?`We sent a reset link to ${e.enteredIdentifier}. Open it on any device; this page continues on its own.`:"We sent you a reset link. Open it on any device; this page continues on its own.");m.setAttribute("data-atlas-link-sent",""),o.appendChild(m);let h=b(e,"button","atlas-embed-step-back","Send another link");h.type="button",h.setAttribute("data-atlas-resend",""),h.disabled=e.busy,h.addEventListener("click",()=>{var w;e.resetFlow={...ct},Br(e,{email:(w=e.enteredIdentifier)!=null?w:""})}),o.appendChild(h);break}l=e.enteredIdentifier?`Enter the code we sent to ${e.enteredIdentifier}`:"Enter the code we sent to your email",Hr(e,o,s,i,"code","Reset code",!0);break;case"collect_second_factor":l="Enter the code from your authenticator app",Hr(e,o,s,i,"code","Two-factor code",!0);break;case"collect_new_password":l="Choose a new password",c="Set new password",bt(e,o,s,i,"password","New password","password","new-password"),(f=s.get("password"))==null||f.setAttribute("data-atlas-autofocus",""),((g=t.securityQuestions)!=null?g:[]).forEach((m,h)=>bt(e,o,s,i,`security_answer_${h}`,m,"text","off"));break;default:d=!1,o.appendChild(b(e,"p","atlas-embed-note","You\u2019re all set."))}l&&r.appendChild(b(e,"p",I(e,"subtitle","atlas-embed-subtitle"),l)),r.appendChild(o),d&&o.appendChild(Ke(e,c));let p=b(e,"button","atlas-embed-step-back","Back to sign in");return p.type="button",p.addEventListener("click",()=>{e.resetFlow=null,O(e)}),o.appendChild(p),o.addEventListener("submit",m=>{m.preventDefault();let h={};for(let[w,C]of s)h[w]=C.value;Br(e,h)}),r}function Ra(e){var t,n;return(n=(t=e.state.attempt)==null?void 0:t.pending_required_actions)==null?void 0:n[0]}function Xd(e,t,n,r){var a,l,c,d;let o=Ra(e),i=u=>t.appendChild(b(e,"p","atlas-embed-note",u)),s=(u,p,f=!1)=>{let g=b(e,"button",f?I(e,"buttonPrimary","atlas-embed-button"):"atlas-embed-step-back",u);return g.type="button",g.disabled=e.busy,g.addEventListener("click",p),g};switch(o==null?void 0:o.action){case"update_password":return r.addField("password","New password","password","new-password"),!0;case"update_profile":return r.addField("first_name",T(e,"requiredAction.firstNameLabel"),"text","given-name"),r.addField("last_name",T(e,"requiredAction.lastNameLabel"),"text","family-name"),!0;case"complete_profile":case"journey_form":{o.title&&i(o.title),o.intro&&i(o.intro);let u=(a=o.fields)!=null?a:[];for(let p of u)eu(e,t,n,r.addField,p);return o.action==="complete_profile"&&u.every(p=>!p.required)&&r.trailing.push(s(T(e,"requiredAction.skip"),()=>void oe(e,{action:"complete_profile",skip:"true"}))),!0}case"verify_email":return i(T(e,"requiredAction.verifyIntro")),r.trailing.push(s(T(e,"requiredAction.sendCode"),()=>void oe(e,{action:"verify_email",step:"send"}))),r.addCodeField("code","Verification code",!0),!0;case"identity_verification":{let u=(c=(l=e.state.attempt)==null?void 0:l.identity_verification)!=null?c:null;if(i(T(e,"requiredAction.idvIntro")),u!=null&&u.url){let f=b(e,"a",I(e,"buttonPrimary","atlas-embed-button"),T(e,"requiredAction.idvOpen"));f.href=u.url,f.target="_blank",f.rel="noopener noreferrer",t.appendChild(f),t.appendChild(s(T(e,"requiredAction.idvCheck"),()=>void oe(e,{action:"identity_verification"})))}else{let f=(d=D(e).defaultView)==null?void 0:d.location,g=(f==null?void 0:f.protocol)==="https:"?f.href:void 0;t.appendChild(s(T(e,"requiredAction.idvStart"),()=>void oe(e,{action:"identity_verification",step:"start",...g?{redirect_url:g}:{}}),!0))}let p=(u==null?void 0:u.status)==="declined"?"requiredAction.idvDeclined":(u==null?void 0:u.status)==="needs_review"?"requiredAction.idvReview":u!=null&&u.url?"requiredAction.idvWaiting":null;return p&&i(T(e,p)).setAttribute("role","status"),!1}default:if(i(T(e,"requiredAction.customIntro")),o!=null&&o.url){let u=b(e,"a",I(e,"buttonPrimary","atlas-embed-button"),T(e,"signUp.submit"));u.href=o.url,u.rel="noopener",t.appendChild(u)}return!1}}function eu(e,t,n,r,o){var a,l;let i=`field:${o.key}`,s=`${o.label}${o.required?" *":""}`;if(o.type==="select"||o.type==="textarea"||o.type==="checkbox"){let c=b(e,"label",I(e,"field","atlas-embed-field"));c.appendChild(b(e,"span",I(e,"label","atlas-embed-label"),s));let d;if(o.type==="select"){d=D(e).createElement("select"),d.appendChild(D(e).createElement("option"));for(let u of(a=o.options)!=null?a:[]){let p=D(e).createElement("option");p.value=u,p.textContent=u,d.appendChild(p)}}else if(o.type==="textarea")d=D(e).createElement("textarea");else{let u=D(e).createElement("input");u.type="checkbox",u.value="false",u.addEventListener("change",()=>{u.value=u.checked?"true":"false"}),d=u}o.type!=="checkbox"&&(d.className=I(e,"input","atlas-embed-input")),d.name=i,c.appendChild(d),t.appendChild(c),n.set(i,d);return}r(i,s,["tel","email","url","number","date"].includes(o.type)?o.type:"text","off"),o.placeholder&&((l=n.get(i))==null||l.setAttribute("placeholder",o.placeholder))}function bt(e,t,n,r,o,i,s,a){let l=b(e,"label",I(e,"field","atlas-embed-field"));l.appendChild(b(e,"span",I(e,"label","atlas-embed-label"),i));let c=D(e).createElement("input");if(c.className=I(e,"input","atlas-embed-input"),c.type=s,c.name=o,c.setAttribute("autocomplete",a),s==="password"){let d=b(e,"div","atlas-embed-password");d.appendChild(c);let u=b(e,"button","atlas-embed-password-toggle","Show");u.type="button",u.setAttribute("aria-label","Show password"),u.addEventListener("click",p=>{p.preventDefault();let f=c.type==="password";c.type=f?"text":"password",u.textContent=f?"Hide":"Show",u.setAttribute("aria-label",f?"Hide password":"Show password")}),d.appendChild(u),l.appendChild(d)}else l.appendChild(c);for(let d of r.filter(u=>u.param===o))l.appendChild(b(e,"span",I(e,"error","atlas-embed-error"),e.errorText(d)));n.set(o,c),t.appendChild(l)}function Hr(e,t,n,r,o,i,s){var g;if(e.codeInputStyle==="single"){bt(e,t,n,r,o,i,"text","one-time-code"),s&&((g=n.get(o))==null||g.setAttribute("data-atlas-autofocus",""));return}let l=b(e,"div",I(e,"field","atlas-embed-field"));l.appendChild(b(e,"span",I(e,"label","atlas-embed-label"),i));let c=b(e,"div","atlas-embed-code");c.setAttribute("role","group"),c.setAttribute("aria-label",i);let d=D(e).createElement("input");d.type="hidden",d.name=o,n.set(o,d);let u=[],p=()=>{d.value=u.map(m=>m.value).join("")},f=()=>{d.value.length!==6||e.busy||t.dispatchEvent(new Event("submit",{cancelable:!0,bubbles:!0}))};for(let m=0;m<6;m++){let h=D(e).createElement("input");h.className="atlas-embed-code-box",h.type="text",h.setAttribute("inputmode","numeric"),h.setAttribute("autocomplete",m===0?"one-time-code":"off"),h.setAttribute("aria-label",`${i} digit ${m+1}`),h.maxLength=1,s&&m===0&&h.setAttribute("data-atlas-autofocus",""),h.addEventListener("input",()=>{h.value=h.value.replace(/\D/g,"").slice(0,1),p(),h.value&&m<5&&u[m+1].focus(),f()}),h.addEventListener("keydown",w=>{w.key==="Backspace"&&!h.value&&m>0&&u[m-1].focus()}),h.addEventListener("paste",w=>{var S,A,k;w.preventDefault();let C=((A=(S=w.clipboardData)==null?void 0:S.getData("text"))!=null?A:"").replace(/\D/g,"").slice(0,6);for(let y=0;y<6;y++)u[y].value=(k=C[y])!=null?k:"";p(),u[Math.min(C.length,5)].focus(),f()}),u.push(h),c.appendChild(h)}l.appendChild(c),l.appendChild(d);for(let m of r.filter(h=>h.param===o))l.appendChild(b(e,"span",I(e,"error","atlas-embed-error"),e.errorText(m)));t.appendChild(l)}function Ta(e,t){var p,f,g,m,h,w,C,S,A;let n=D(e).createElement("form"),r=e.state.errors.find(k=>!k.param);r&&n.appendChild(b(e,"div","atlas-embed-form-error",e.errorText(r)));let o=new Map,i=e.state.errors,s=(k,y,x,_)=>bt(e,n,o,i,k,y,x,_),a=(k,y,x)=>Hr(e,n,o,i,k,y,x),l=!0,c=Fe[e.mode].submit,d=[];switch(t){case"collect_identifier":if(s("identifier","Email address","email",e.passkeyEnabled&&Ee()?"username webauthn":"username"),e.enteredIdentifier&&(o.get("identifier").value=e.enteredIdentifier),e.mode==="sign-in"&&e.passwordEnabled){s("password","Password","password","current-password");let k=[];e.emailDeliveryAvailable&&e.emailCodeEnabled?k.push("email_code"):e.emailDeliveryAvailable&&e.emailLinkEnabled&&k.push("email_link");for(let y of k){let x=b(e,"button","atlas-embed-step-back",y==="email_code"?"Email me a code instead":"Email me a sign-in link instead");x.type="button",x.setAttribute("data-strategy",y),x.disabled=e.busy,x.addEventListener("click",()=>{var R;let _=o.get("identifier");if(!_.value.trim()){(R=_.reportValidity)==null||R.call(_),_.focus();return}oe(e,{identifier:_.value},y)}),d.push(x)}}if(e.mode==="sign-in"&&e.rememberMeEnabled){let k=b(e,"label","atlas-embed-remember"),y=D(e).createElement("input");y.type="checkbox",y.className="atlas-embed-remember-check",y.checked=e.remember,y.addEventListener("change",()=>{e.remember=y.checked}),k.appendChild(y),k.appendChild(b(e,"span","atlas-embed-remember-text","Remember me")),n.appendChild(k)}break;case"collect_first_factor":{if(Rt(e.state.attempt)){l=!1;let E=b(e,"p","atlas-embed-note",T(e,"signUp.emailConfirmed"));E.setAttribute("role","status"),E.setAttribute("data-atlas-email-confirmed",""),n.appendChild(E);let B=b(e,"button",I(e,"buttonPrimary","atlas-embed-button"),T(e,"signIn.title"));B.type="button",B.setAttribute("data-atlas","email-confirmed-sign-in"),B.addEventListener("click",()=>ua(e)),n.appendChild(B);break}let k=e.state.attempt?(p=X(e.state.attempt).strategies)!=null?p:[]:[],y=It(e.emailDeliveryAvailable?k:k.filter(E=>E!=="email_code"&&E!=="email_link")),x=(f=e.state.prepared)!=null?f:null,_=(h=(m=e.enteredIdentifier)!=null?m:(g=e.state.attempt)==null?void 0:g.identifier)!=null?h:"",R=(E,B,W)=>{let F=b(e,"button","atlas-embed-step-back",B);return F.type="button",F.setAttribute(W,W==="data-strategy"?E:""),F.disabled=e.busy,F.addEventListener("click",()=>void un(e,E)),F};if(x==="email_code"){let E=b(e,"p","atlas-embed-note",_?`We sent a code to ${_}. Enter it below.`:"We sent you a code. Enter it below.");E.setAttribute("data-atlas-code-sent",""),n.appendChild(E),a("code","Verification code",!0),d.push(R("email_code","Resend code","data-atlas-resend"))}else if(x==="email_link"){l=!1;let E=b(e,"p","atlas-embed-note",_?`We sent a sign-in link to ${_}. Open it on any device to continue.`:"Check your email for a sign-in link.");E.setAttribute("data-atlas-link-sent",""),n.appendChild(E),d.push(R("email_link","Resend link","data-atlas-resend"))}else if(!y.password&&y.email.length>0){l=!1;for(let E of y.email)d.push(R(E,E==="email_code"?"Email me a code":"Email me a sign-in link","data-strategy"))}else{s("password","Password","password","current-password");for(let E of y.email)d.push(R(E,E==="email_code"?"Email me a code instead":"Email me a sign-in link instead","data-strategy"))}break}case"collect_second_factor":if(e.backupCodeMode?s("code","Backup code","text","one-time-code"):a("code","Two-factor code",!0),e.trustedDeviceEnabled){let k=b(e,"label","atlas-embed-remember"),y=D(e).createElement("input");y.type="checkbox",y.className="atlas-embed-remember-check",y.checked=e.rememberDevice,y.addEventListener("change",()=>{e.rememberDevice=y.checked}),k.appendChild(y),k.appendChild(b(e,"span","atlas-embed-remember-text","Remember this device")),n.appendChild(k)}va(e,d);break;case"collect_email_code":{let k=Et(e.state.attempt,e.account.emailVerification);if(k){l=!1;let y=(S=(C=e.enteredIdentifier)!=null?C:(w=e.state.attempt)==null?void 0:w.identifier)!=null?S:"",x=b(e,"p","atlas-embed-note",y?`We sent a confirmation link to ${y}. Open it on any device; this page continues on its own.`:"We sent you a confirmation link. Open it on any device; this page continues on its own.");x.setAttribute("data-atlas-link-sent",""),n.appendChild(x)}else a("code","Verification code",!0);if(((A=e.state.attempt)==null?void 0:A.object)==="sign_up_attempt"){let y=b(e,"button","atlas-embed-step-back",k?"Resend link":"Resend code");y.type="button",y.setAttribute("data-atlas-resend",""),y.disabled=e.busy,y.addEventListener("click",()=>void ga(e)),d.push(y)}break}case"collect_new_password":s("password","New password","password","new-password");break;case"complete_required_action":c=T(e,"signUp.submit"),l=Xd(e,n,o,{addField:s,addCodeField:a,trailing:d});break;case"enroll_second_factor":{let k=ka(e,n,{addField:s,addCodeField:a,trailing:d},c);k===null?l=!1:c=k;break}default:l=!1,n.appendChild(b(e,"p","atlas-embed-note","Please continue in your application."))}l&&n.appendChild(Ke(e,c));for(let k of d)n.appendChild(k);if(t==="collect_second_factor"){let k=b(e,"button","atlas-embed-step-back",e.backupCodeMode?"Use your authenticator app":"Use a backup code instead");k.type="button",k.addEventListener("click",()=>{e.backupCodeMode=!e.backupCodeMode,O(e)}),n.appendChild(k)}if((t==="collect_identifier"&&e.mode==="sign-in"&&e.passwordEnabled||t==="collect_first_factor"&&o.has("password"))&&e.passwordResetEnabled){let k=b(e,"button","atlas-embed-step-back","Forgot password?");k.type="button",k.addEventListener("click",()=>zr(e)),n.appendChild(k)}return n.addEventListener("submit",k=>{var x,_;k.preventDefault();let y={};for(let[R,E]of o)y[R]=E.value;if(t==="collect_second_factor"&&e.trustedDeviceEnabled&&e.rememberDevice&&(y.remember_device="true"),t==="enroll_second_factor"){_a(e,y);return}if(t==="complete_required_action"){let R=(_=(x=Ra(e))==null?void 0:x.action)!=null?_:"";for(let E of Object.keys(y))E.startsWith("field:")&&!y[E]&&delete y[E];oe(e,{...y,action:R,...R==="verify_email"?{step:"verify"}:{}});return}oe(e,y)}),n}function tu(e){var l;let t=(l=e.appearance)==null?void 0:l.legal;if(!t||!t.termsUrl&&!t.privacyUrl)return null;let n=D(e),r=b(e,"div","atlas-embed-consent"),o=null;t.required&&(o=n.createElement("input"),o.type="checkbox",o.className="atlas-embed-consent-check",o.setAttribute("aria-label","Agree to the terms and privacy policy"),r.appendChild(o));let i=b(e,"span","atlas-embed-consent-text"),s=(c,d)=>{let u=n.createElement("a");return u.href=c,u.textContent=d,u.target="_blank",u.rel="noopener noreferrer",u.className="atlas-embed-consent-link",u};i.appendChild(n.createTextNode(t.required?"I agree to the ":"By continuing you agree to the "));let a=[];return t.termsUrl&&a.push(s(t.termsUrl,"Terms of Service")),t.privacyUrl&&a.push(s(t.privacyUrl,"Privacy Policy")),a.forEach((c,d)=>{d>0&&i.appendChild(n.createTextNode(" and ")),i.appendChild(c)}),i.appendChild(n.createTextNode(".")),r.appendChild(i),{row:r,checkbox:o}}function Ia(e){var c;let t=D(e).createElement("form");if(!e.passwordSignUpEnabled)return t.appendChild(b(e,"div","atlas-embed-form-error",Zi)),t;let n=e.state.errors.find(d=>!d.param);n&&t.appendChild(b(e,"div","atlas-embed-form-error",e.errorText(n)));let r=new Map,o=(d,u,p)=>{var w,C,S;let f=(w=p.type)!=null?w:"text",g=f==="radio"||f==="multiselect",m=b(e,g?"fieldset":"label",I(e,"field","atlas-embed-field"));m.appendChild(b(e,g?"legend":"span",I(e,"label","atlas-embed-label"),p.required?u:`${u} (optional)`));let h=D(e);if(f==="select"){let A=h.createElement("select");A.className=I(e,"input","atlas-embed-input"),A.name=d;let k=h.createElement("option");k.value="",k.textContent=p.placeholder||"Select\u2026",A.appendChild(k);for(let y of(C=p.options)!=null?C:[]){let x=h.createElement("option");x.value=y,x.textContent=y,A.appendChild(x)}m.appendChild(A),r.set(d,()=>A.value)}else if(f==="textarea"){let A=h.createElement("textarea");A.className=I(e,"input","atlas-embed-input"),A.name=d,A.rows=3,p.placeholder&&A.setAttribute("placeholder",p.placeholder),m.appendChild(A),r.set(d,()=>A.value)}else if(f==="checkbox"){let A=h.createElement("input");A.type="checkbox",A.name=d,A.className="atlas-embed-checkbox",m.classList.add("atlas-embed-field-checkbox"),m.appendChild(A),r.set(d,()=>A.checked?"true":"")}else if(f==="radio"||f==="multiselect"){let A=h.createElement("div");A.className="atlas-embed-choices";let k=[];for(let y of(S=p.options)!=null?S:[]){let x=h.createElement("label");x.className="atlas-embed-choice";let _=h.createElement("input");_.type=f==="radio"?"radio":"checkbox",_.name=d,_.value=y,k.push(_),x.appendChild(_),x.appendChild(b(e,"span",void 0,y)),A.appendChild(x)}m.appendChild(A),r.set(d,()=>{var y,x;return f==="radio"?(x=(y=k.find(_=>_.checked))==null?void 0:y.value)!=null?x:"":k.filter(_=>_.checked).map(_=>_.value).join(", ")})}else{let A=h.createElement("input");A.className=I(e,"input","atlas-embed-input"),A.type=f,A.name=d,p.autocomplete&&A.setAttribute("autocomplete",p.autocomplete),p.placeholder&&A.setAttribute("placeholder",p.placeholder),m.appendChild(A),r.set(d,()=>A.value)}for(let A of e.state.errors.filter(k=>k.param===d))m.appendChild(b(e,"span",I(e,"error","atlas-embed-error"),e.errorText(A)));t.appendChild(m)};for(let d of e.signUpFields)o(d.key,d.label,{type:d.type,required:d.required,placeholder:d.placeholder,options:d.options});o("identifier","Email address",{type:"email",required:!0,autocomplete:"email"}),o("password","Password",{type:"password",required:!0,autocomplete:"new-password"});let i,s=Ca(e,()=>{i&&(i.disabled=e.busy||!(s!=null&&s.canSubmit()))}),a=s?null:tu(e);a&&t.appendChild(a.row),s&&t.appendChild(s.consent),i=Ke(e,Fe[e.mode].submit);let l=()=>s?s.canSubmit():!(a!=null&&a.checkbox)||a.checkbox.checked;return i.disabled=e.busy||!l(),(c=a==null?void 0:a.checkbox)==null||c.addEventListener("change",()=>{i.disabled=e.busy||!l()}),t.appendChild(i),s&&t.appendChild(s.clickwrap),t.addEventListener("submit",d=>{d.preventDefault();let u={};for(let[p,f]of r)u[p]=f();if(!s){jr(e,u,l());return}s.read().then(p=>{var g,m;if(p){jr(e,u,!0);return}let f=(m=(g=e.policies.policies.find(h=>!e.policies.isChecked(h.key)))==null?void 0:g.title)!=null?m:"";e.state={...e.state,errors:[{code:"POLICY_DECLINED",message:fn(e)("policy.declined",{policy:f})}]},O(e)})}),t}var nu={google:'<path fill="#4285F4" d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"/><path fill="#34A853" d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"/><path fill="#FBBC05" d="M5.84 14.1c-.22-.66-.35-1.36-.35-2.1s.13-1.44.35-2.1V7.06H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.94l3.66-2.84z"/><path fill="#EA4335" d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.06l3.66 2.84C6.71 7.31 9.14 5.38 12 5.38z"/>',microsoft:'<path fill="#F25022" d="M2 2h9.3v9.3H2z"/><path fill="#7FBA00" d="M12.7 2H22v9.3h-9.3z"/><path fill="#00A4EF" d="M2 12.7h9.3V22H2z"/><path fill="#FFB900" d="M12.7 12.7H22V22h-9.3z"/>'},ru={github:{fill:"currentColor",path:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"},apple:{fill:"currentColor",path:"M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701"},x:{fill:"currentColor",path:"M14.234 10.162 22.977 0h-2.072l-7.591 8.824L7.251 0H.258l9.168 13.343L.258 24H2.33l8.016-9.318L16.749 24h6.993zm-2.837 3.299-.929-1.329L3.076 1.56h3.182l5.965 8.532.929 1.329 7.754 11.09h-3.182z"},notion:{fill:"currentColor",path:"M4.459 4.208c.746.606 1.026.56 2.428.466l13.215-.793c.28 0 .047-.28-.046-.326L17.86 1.968c-.42-.326-.981-.7-2.055-.607L3.01 2.295c-.466.046-.56.28-.374.466zm.793 3.08v13.904c0 .747.373 1.027 1.214.98l14.523-.84c.841-.046.935-.56.935-1.167V6.354c0-.606-.233-.933-.748-.887l-15.177.887c-.56.047-.747.327-.747.933zm14.337.745c.093.42 0 .84-.42.888l-.7.14v10.264c-.608.327-1.168.514-1.635.514-.748 0-.935-.234-1.495-.933l-4.577-7.186v6.952L12.21 19s0 .84-1.168.84l-3.222.186c-.093-.186 0-.653.327-.746l.84-.233V9.854L7.822 9.76c-.094-.42.14-1.026.793-1.073l3.456-.233 4.764 7.279v-6.44l-1.215-.139c-.093-.514.28-.887.747-.933zM1.936 1.035l13.31-.98c1.634-.14 2.055-.047 3.082.7l4.249 2.986c.7.513.934.653.934 1.213v16.378c0 1.026-.373 1.634-1.68 1.726l-15.458.934c-.98.047-1.448-.093-1.962-.747l-3.129-4.06c-.56-.747-.793-1.306-.793-1.96V2.667c0-.839.374-1.54 1.447-1.632z"},facebook:{fill:"#0866FF",path:"M9.101 23.691v-7.98H6.627v-3.667h2.474v-1.58c0-4.085 1.848-5.978 5.858-5.978.401 0 .955.042 1.468.103a8.68 8.68 0 0 1 1.141.195v3.325a8.623 8.623 0 0 0-.653-.036 26.805 26.805 0 0 0-.733-.009c-.707 0-1.259.096-1.675.309a1.686 1.686 0 0 0-.679.622c-.258.42-.374.995-.374 1.752v1.297h3.919l-.386 2.103-.287 1.564h-3.246v8.245C19.396 23.238 24 18.179 24 12.044c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.628 3.874 10.35 9.101 11.647Z"},discord:{fill:"#5865F2",path:"M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"},gitlab:{fill:"#FC6D26",path:"m23.6004 9.5927-.0337-.0862L20.3.9814a.851.851 0 0 0-.3362-.405.8748.8748 0 0 0-.9997.0539.8748.8748 0 0 0-.29.4399l-2.2055 6.748H7.5375l-2.2057-6.748a.8573.8573 0 0 0-.29-.4412.8748.8748 0 0 0-.9997-.0537.8585.8585 0 0 0-.3362.4049L.4332 9.5015l-.0325.0862a6.0657 6.0657 0 0 0 2.0119 7.0105l.0113.0087.03.0213 4.976 3.7264 2.462 1.8633 1.4995 1.1321a1.0085 1.0085 0 0 0 1.2197 0l1.4995-1.1321 2.4619-1.8633 5.006-3.7489.0125-.01a6.0682 6.0682 0 0 0 2.0094-7.003z"},spotify:{fill:"#1ED760",path:"M12 0C5.4 0 0 5.4 0 12s5.4 12 12 12 12-5.4 12-12S18.66 0 12 0zm5.521 17.34c-.24.359-.66.48-1.021.24-2.82-1.74-6.36-2.101-10.561-1.141-.418.122-.779-.179-.899-.539-.12-.421.18-.78.54-.9 4.56-1.021 8.52-.6 11.64 1.32.42.18.479.659.301 1.02zm1.44-3.3c-.301.42-.841.6-1.262.3-3.239-1.98-8.159-2.58-11.939-1.38-.479.12-1.02-.12-1.14-.6-.12-.48.12-1.021.6-1.141C9.6 9.9 15 10.561 18.72 12.84c.361.181.54.78.241 1.2zm.12-3.36C15.24 8.4 8.82 8.16 5.16 9.301c-.6.179-1.2-.181-1.38-.721-.18-.601.18-1.2.72-1.381 4.26-1.26 11.28-1.02 15.721 1.621.539.3.719 1.02.419 1.56-.299.421-1.02.599-1.559.3z"},twitch:{fill:"#9146FF",path:"M11.571 4.714h1.715v5.143H11.57zm4.715 0H18v5.143h-1.714zM6 0L1.714 4.286v15.428h5.143V24l4.286-4.286h3.428L22.286 12V0zm14.571 11.143l-3.428 3.428h-3.429l-3 3v-3H6.857V1.714h13.714Z"},reddit:{fill:"#FF4500",path:"M12 0C5.373 0 0 5.373 0 12c0 3.314 1.343 6.314 3.515 8.485l-2.286 2.286C.775 23.225 1.097 24 1.738 24H12c6.627 0 12-5.373 12-12S18.627 0 12 0Zm4.388 3.199c1.104 0 1.999.895 1.999 1.999 0 1.105-.895 2-1.999 2-.946 0-1.739-.657-1.947-1.539v.002c-1.147.162-2.032 1.15-2.032 2.341v.007c1.776.067 3.4.567 4.686 1.363.473-.363 1.064-.58 1.707-.58 1.547 0 2.802 1.254 2.802 2.802 0 1.117-.655 2.081-1.601 2.531-.088 3.256-3.637 5.876-7.997 5.876-4.361 0-7.905-2.617-7.998-5.87-.954-.447-1.614-1.415-1.614-2.538 0-1.548 1.255-2.802 2.803-2.802.645 0 1.239.218 1.712.585 1.275-.79 2.881-1.291 4.64-1.365v-.01c0-1.663 1.263-3.034 2.88-3.207.188-.911.993-1.595 1.959-1.595Zm-8.085 8.376c-.784 0-1.459.78-1.506 1.797-.047 1.016.64 1.429 1.426 1.429.786 0 1.371-.369 1.418-1.385.047-1.017-.553-1.841-1.338-1.841Zm7.406 0c-.786 0-1.385.824-1.338 1.841.047 1.017.634 1.385 1.418 1.385.785 0 1.473-.413 1.426-1.429-.046-1.017-.721-1.797-1.506-1.797Zm-3.703 4.013c-.974 0-1.907.048-2.77.135-.147.015-.241.168-.183.305.483 1.154 1.622 1.964 2.953 1.964 1.33 0 2.47-.81 2.953-1.964.057-.137-.037-.29-.184-.305-.863-.087-1.795-.135-2.769-.135Z"},figma:{fill:"#F24E1E",path:"M15.852 8.981h-4.588V0h4.588c2.476 0 4.49 2.014 4.49 4.49s-2.014 4.491-4.49 4.491zM12.735 7.51h3.117c1.665 0 3.019-1.355 3.019-3.019s-1.355-3.019-3.019-3.019h-3.117V7.51zm0 1.471H8.148c-2.476 0-4.49-2.014-4.49-4.49S5.672 0 8.148 0h4.588v8.981zm-4.587-7.51c-1.665 0-3.019 1.355-3.019 3.019s1.354 3.02 3.019 3.02h3.117V1.471H8.148zm4.587 15.019H8.148c-2.476 0-4.49-2.014-4.49-4.49s2.014-4.49 4.49-4.49h4.588v8.98zM8.148 8.981c-1.665 0-3.019 1.355-3.019 3.019s1.355 3.019 3.019 3.019h3.117V8.981H8.148zM8.172 24c-2.489 0-4.515-2.014-4.515-4.49s2.014-4.49 4.49-4.49h4.588v4.441c0 2.503-2.047 4.539-4.563 4.539zm-.024-7.51a3.023 3.023 0 0 0-3.019 3.019c0 1.665 1.365 3.019 3.044 3.019 1.705 0 3.093-1.376 3.093-3.068v-2.97H8.148zm7.704 0h-.098c-2.476 0-4.49-2.014-4.49-4.49s2.014-4.49 4.49-4.49h.098c2.476 0 4.49 2.014 4.49 4.49s-2.014 4.49-4.49 4.49zm-.097-7.509c-1.665 0-3.019 1.355-3.019 3.019s1.355 3.019 3.019 3.019h.098c1.665 0 3.019-1.355 3.019-3.019s-1.355-3.019-3.019-3.019h-.098z"},dropbox:{fill:"#0061FF",path:"M6 1.807L0 5.629l6 3.822 6.001-3.822L6 1.807zM18 1.807l-6 3.822 6 3.822 6-3.822-6-3.822zM0 13.274l6 3.822 6.001-3.822L6 9.452l-6 3.822zM18 9.452l-6 3.822 6 3.822 6-3.822-6-3.822zM6 18.371l6.001 3.822 6-3.822-6-3.822L6 18.371z"},gitee:{fill:"#C71D23",path:"M11.984 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.016 0zm6.09 5.333c.328 0 .593.266.592.593v1.482a.594.594 0 0 1-.593.592H9.777c-.982 0-1.778.796-1.778 1.778v5.63c0 .327.266.592.593.592h5.63c.982 0 1.778-.796 1.778-1.778v-.296a.593.593 0 0 0-.592-.593h-4.15a.592.592 0 0 1-.592-.592v-1.482a.593.593 0 0 1 .593-.592h6.815c.327 0 .593.265.593.592v3.408a4 4 0 0 1-4 4H5.926a.593.593 0 0 1-.593-.593V9.778a4.444 4.444 0 0 1 4.445-4.444h8.296Z"}};function Oa(e){let t=nu[e];if(t)return`<svg viewBox="0 0 24 24" width="18" height="18" aria-hidden="true" focusable="false">${t}</svg>`;let n=ru[e];return n?`<svg viewBox="0 0 24 24" width="18" height="18" fill="${n.fill}" aria-hidden="true" focusable="false"><path d="${n.path}"/></svg>`:null}function Fa(e,t){return!t||!t.id||!t.status||t.status==="complete"?!1:(e.state={...e.state,attempt:t,errors:[]},O(e),!0)}function Da(e){let t=e.options.passkeyPrf;return t?{prf:t,onExtensionResults:n=>{var s,a,l,c,d;let r={credentialId:n.credentialId,enabled:!!((s=n.prf)!=null&&s.results)||((a=n.prf)==null?void 0:a.enabled)===!0,...(l=n.prf)!=null&&l.results?{results:n.prf.results}:{}},o=(c=e.root.ownerDocument)==null?void 0:c.defaultView,i=(d=o==null?void 0:o.CustomEvent)!=null?d:CustomEvent;e.root.dispatchEvent(new i("atlas:passkey-prf",{detail:r,bubbles:!1}))}}:{}}async function La(e){var o,i,s;if(e.busy)return;(o=e.conditionalAbort)==null||o.abort(),e.busy=!0,O(e);let t=await dr(e.client,{captcha:({retry:a})=>ht(e,"signIn",a)});if(!t.ok||!t.data){e.busy=!1,be(e,t.errors);return}let n;try{n=await at(t.data,Da(e))}catch{e.busy=!1,O(e);return}let r=await e.client.post("/v1/client/sign_ins/passkey/finish",n);if(e.busy=!1,r.ok&&((i=r.data)==null?void 0:i.status)==="complete"){await re(e,(s=r.data.created_session_id)!=null?s:null);return}r.ok&&Fa(e,r.data)||be(e,r.errors)}async function $a(e){var r,o,i;if(e.mode!=="sign-in"||!e.passkeyEnabled||!Ee())return;let t=!1;try{t=await ir()}catch{t=!1}if(!t||ze(e.captchaFlows.signIn))return;(r=e.conditionalAbort)==null||r.abort();let n=new AbortController;e.conditionalAbort=n;try{let s=await dr(e.client);if(!s.ok||!s.data||n.signal.aborted)return;let a=await at(s.data,{mediation:"conditional",signal:n.signal,...Da(e)});if(n.signal.aborted)return;let l=await e.client.post("/v1/client/sign_ins/passkey/finish",a);l.ok&&((o=l.data)==null?void 0:o.status)==="complete"?await re(e,(i=l.data.created_session_id)!=null?i:null):l.ok&&Fa(e,l.data)}catch{}}function Ma(e){let t=b(e,"button",I(e,"socialButton","atlas-embed-social-button"),"Sign in with a passkey");return t.type="button",t.setAttribute("data-atlas-passkey",""),t.disabled=e.busy,t.addEventListener("click",()=>{La(e)}),t}function Wr(e){let t=[...e.providers];for(let n of e.nativeProviders)t.includes(n.provider)||t.push(n.provider);return t}var ou='<svg viewBox="0 0 24 24" width="18" height="18" aria-hidden="true" fill="none"><path d="M12 2 3 21h4l5-11 5 11h4L12 2z" fill="currentColor"/></svg>';function iu(e,t){var a;let{variant:n,labels:r}=e.social,o=(a=r.atlas)!=null?a:n==="block"?"Continue with Atlas":"Atlas",i=b(e,"button",I(e,"socialButton","atlas-embed-social-button"));i.type="button",i.setAttribute("data-atlas-provider","atlas"),i.setAttribute("data-variant",n);let s=D(e).createElement("span");if(s.className="atlas-embed-social-icon",s.innerHTML=ou,i.appendChild(s),n==="icon")i.setAttribute("aria-label","Continue with Atlas"),i.setAttribute("title","Atlas");else{let l=D(e).createElement("span");l.className="atlas-embed-social-label",l.textContent=o,i.appendChild(l)}return i.addEventListener("click",()=>{Nr(e,t,{popup:!0})}),i}function Ua(e){let t=Wr(e),n=b(e,"div","atlas-embed-social");n.setAttribute("data-layout",e.social.layout),n.setAttribute("data-size",e.social.size),n.setAttribute("data-variant",e.social.variant),e.signInWithAtlas.enabled&&e.signInWithAtlas.connection_id&&n.appendChild(iu(e,e.signInWithAtlas.connection_id));for(let c of t){let d=e.nativeProviders.find(p=>p.provider===c),u=c==="google"&&(d!=null&&d.client_id)?lu(e,d.client_id):au(e,c);u.getAttribute("data-atlas-provider")||u.setAttribute("data-atlas-provider",c),n.appendChild(u)}let r=e.social.layout==="carousel"?su(e,n):n;if(!(e.social.search==="always"||e.social.search==="auto"&&t.length>qs))return r;let i=b(e,"div","atlas-embed-social-field"),s=D(e).createElement("input");s.type="search",s.className="atlas-embed-social-search",s.setAttribute("placeholder","Search sign-in options\u2026"),s.setAttribute("aria-label","Search sign-in options"),s.autocomplete="off";let a=b(e,"div","atlas-embed-social-empty");a.textContent="No matching sign-in options.",a.setAttribute("hidden","");let l=Array.from(n.children);return s.addEventListener("input",()=>{var u;let c=s.value.trim().toLowerCase(),d=0;for(let p of l){let f=(u=p.getAttribute("data-atlas-provider"))!=null?u:"",g=c===""||dn(f).toLowerCase().includes(c)||f.toLowerCase().includes(c);p.toggleAttribute("hidden",!g),g&&(d+=1)}a.toggleAttribute("hidden",d!==0),n.dispatchEvent(new Event("scroll"))}),i.appendChild(s),i.appendChild(r),i.appendChild(a),i}function su(e,t){var c;let n=(c=D(e).defaultView)!=null?c:typeof window!="undefined"?window:null,r=b(e,"div","atlas-embed-carousel"),o=d=>{let u=b(e,"button","atlas-embed-carousel-nav");return u.type="button",u.setAttribute("data-dir",d),u.setAttribute("aria-label",d==="prev"?"Scroll to previous sign-in options":"Scroll to more sign-in options"),u.innerHTML=d==="prev"?oa:ia,u.addEventListener("click",()=>{let p=Math.max(t.clientWidth*.8,140);typeof t.scrollBy=="function"&&t.scrollBy({left:(d==="prev"?-1:1)*p,behavior:"smooth"})}),u},i=o("prev"),s=o("next"),a=()=>{let d=t.scrollWidth-t.clientWidth,u=d>2;r.setAttribute("data-overflow",u?"true":"false"),i.disabled=!u||t.scrollLeft<=1,s.disabled=!u||t.scrollLeft>=d-1};t.addEventListener("scroll",a,{passive:!0});let l=n&&n.ResizeObserver;return l?new l(a).observe(t):n&&n.addEventListener("resize",a),n!=null&&n.requestAnimationFrame&&n.requestAnimationFrame(a),a(),r.appendChild(i),r.appendChild(t),r.appendChild(s),r}function Na(e,t,n="button"){var c;let{variant:r,labels:o}=e.social,i=dn(t),s=(c=o[t])!=null?c:r==="block"?`Continue with ${i}`:i,a=b(e,n,I(e,"socialButton","atlas-embed-social-button"));n==="button"&&(a.type="button"),a.setAttribute("data-atlas-provider",t),a.setAttribute("data-variant",r);let l=Oa(t);if(l){let d=D(e).createElement("span");d.className="atlas-embed-social-icon",d.innerHTML=l,a.appendChild(d)}if(r==="icon")a.setAttribute("aria-label",`Continue with ${i}`),a.setAttribute("title",i);else{let d=D(e).createElement("span");d.className="atlas-embed-social-label",d.textContent=s,a.appendChild(d)}return a}function au(e,t){let n=Na(e,t);return n.addEventListener("click",()=>{ra.has(t)?(e.handlePrompt=t,O(e)):pn(e,t)}),n}function za(e,t){let n=dn(t),r=D(e).createElement("form");r.className="atlas-embed-form",r.setAttribute("novalidate","true");for(let l of e.state.errors.filter(c=>!c.param))r.appendChild(b(e,"div","atlas-embed-form-error",e.errorText(l)));let o=b(e,"label",I(e,"field","atlas-embed-field"));o.appendChild(b(e,"span",I(e,"label","atlas-embed-label"),`${n} handle`));let i=D(e).createElement("input");i.className=I(e,"input","atlas-embed-input"),i.type="text",i.name="identifier",i.placeholder="you.bsky.social",i.setAttribute("autocomplete","username"),i.setAttribute("autocapitalize","none"),i.setAttribute("spellcheck","false"),o.appendChild(i),r.appendChild(o);let s=Ke(e,Fe[e.mode].submit);r.appendChild(s);let a=b(e,"button","atlas-embed-handle-back","Back");return a.type="button",a.addEventListener("click",()=>{e.handlePrompt=null,e.state={...e.state,errors:[]},O(e)}),r.appendChild(a),r.addEventListener("submit",l=>{l.preventDefault();let c=i.value.trim();if(!c){e.state={...e.state,errors:[{code:"validation_error",message:`Enter your ${n} handle.`}]},O(e);return}pn(e,t,c)}),r}function lu(e,t){let n=Na(e,"google","div");return n.setAttribute("role","button"),n.setAttribute("tabindex","0"),Si({wrapper:n,clientId:t,onCredential:r=>void ha(e,"google",r),onError:()=>Ge(e,"Google sign-in could not start.")}).catch(()=>{n.addEventListener("click",()=>void pn(e,"google"))}),n}function Ge(e,t){e.root.textContent="";let n=b(e,"div",I(e,"card","atlas-embed-card"));n.appendChild(b(e,"p","atlas-embed-note",t)),e.root.appendChild(n)}function Ba(e){e.root.textContent="";let t=b(e,"div",I(e,"card","atlas-embed-card")),n=e.interaction.loading,r=b(e,"div","atlas-embed-loading");if(r.setAttribute("data-loading",n),r.setAttribute("role","status"),r.setAttribute("aria-label","Loading"),n==="skeleton")for(let i of["title","sub","input","input","button"])r.appendChild(b(e,"div",`atlas-embed-skel atlas-embed-skel-${i}`));else if(n==="dots")for(let i=0;i<3;i+=1)r.appendChild(b(e,"span","atlas-embed-dot"));else n==="bar"?r.appendChild(b(e,"span","atlas-embed-loadbar")):r.appendChild(b(e,"span","atlas-embed-spinner"));let o=b(e,"span","atlas-embed-sr","Loading\u2026");r.appendChild(o),t.appendChild(r),e.root.appendChild(t)}function be(e,t){e.state={...e.state,errors:[...t]},O(e)}function O(e){var u,p,f,g,m,h,w,C,S,A;Sa(e);let t=Array.from(e.root.children).filter(k=>k.hasAttribute("data-atlas-policy-modal"));e.root.textContent="";for(let k of t)e.root.appendChild(k);let n=b(e,"div",I(e,"card","atlas-embed-card")),r=(p=(u=e.appearance)==null?void 0:u.logoUrl)!=null?p:null;if(r){let k=D(e).createElement("img");k.className="atlas-embed-logo",k.src=r,k.alt=(g=(f=e.appearance)==null?void 0:f.applicationName)!=null?g:"",n.appendChild(k)}if(e.resetFlow){let k=`reset_${Be(e.resetFlow)}`;if(n.setAttribute("data-step",k),k!==e.lastStepKind&&n.setAttribute("data-enter",""),e.lastStepKind=k,n.appendChild(Ea(e)),(m=e.appearance)!=null&&m.footer&&n.appendChild(b(e,"p",I(e,"footer","atlas-embed-footer"),e.appearance.footer)),e.root.appendChild(n),n.hasAttribute("data-enter")){let y=n.querySelector("[data-atlas-autofocus]");y instanceof HTMLElement&&y.focus()}return}let o=Ze(e.state);if(o){n.setAttribute("data-step","recovery_codes"),e.lastStepKind!=="recovery_codes"&&n.setAttribute("data-enter",""),e.lastStepKind="recovery_codes",n.appendChild(xa(e,o)),e.root.appendChild(n);return}if(Ne(e.state)){n.setAttribute("data-step","existing_account"),e.lastStepKind!=="existing_account"&&n.setAttribute("data-enter",""),e.lastStepKind="existing_account",n.appendChild(Pa(e)),e.root.appendChild(n);return}let i=e.state.attempt?X(e.state.attempt):{kind:"collect_identifier"},s=e.mode==="sign-up"&&!e.state.attempt,a=s||i.kind==="collect_identifier",l=e.handlePrompt?"handle":i.kind;n.setAttribute("data-step",l),l!==e.lastStepKind&&n.setAttribute("data-enter",""),e.lastStepKind=l;let c=(w=(h=e.appearance)==null?void 0:h.headline)!=null?w:Fe[e.mode].title;n.appendChild(b(e,"h1",I(e,"title","atlas-embed-title"),c));let d=a?null:cu(e,i.kind);if(d?n.appendChild(d):(C=e.appearance)!=null&&C.subheadline&&n.appendChild(b(e,"p",I(e,"subtitle","atlas-embed-subtitle"),e.appearance.subheadline)),e.flash&&n.appendChild(b(e,"div","atlas-embed-flash",e.flash)),e.handlePrompt){n.appendChild(za(e,e.handlePrompt)),(S=e.appearance)!=null&&S.footer&&n.appendChild(b(e,"p",I(e,"footer","atlas-embed-footer"),e.appearance.footer)),e.root.appendChild(n);return}if(a&&(Wr(e).length>0||e.signInWithAtlas.enabled)&&(n.appendChild(Ua(e)),n.appendChild(b(e,"div",I(e,"divider","atlas-embed-divider"),"or"))),n.appendChild(s?Ia(e):i.kind==="accept_policies"?Aa(e):Ta(e,i.kind)),a&&e.mode==="sign-in"&&e.passkeyEnabled&&Ee()&&n.appendChild(Ma(e)),(A=e.appearance)!=null&&A.footer&&n.appendChild(b(e,"p",I(e,"footer","atlas-embed-footer"),e.appearance.footer)),e.root.appendChild(n),n.hasAttribute("data-enter")){let k=n.querySelector("[data-atlas-autofocus]");k instanceof HTMLElement&&k.focus()}}function cu(e,t){let n=e.enteredIdentifier,r=null,o=!1;switch(t){case"collect_email_code":r=Et(e.state.attempt,e.account.emailVerification)?"Check your email":n?`Enter the code we sent to ${n}`:"Enter the code we sent to your email",o=!0;break;case"collect_first_factor":if(Rt(e.state.attempt))return null;r=n?`Enter the password for ${n}`:"Enter your password",o=!0;break;case"collect_second_factor":r=e.backupCodeMode?"Enter one of your backup codes":"Enter the code from your authenticator app";break;case"collect_new_password":r="Choose a new password";break;case"enroll_second_factor":r=T(e,"mfa.enrollChoose");break;default:return null}let i=b(e,"div","atlas-embed-step-context");if(i.appendChild(b(e,"p",I(e,"subtitle","atlas-embed-subtitle"),r)),o){let s=b(e,"button","atlas-embed-step-back","Use a different email");s.type="button",s.addEventListener("click",()=>du(e)),i.appendChild(s)}return i}function du(e){e.state=Y,e.backupCodeMode=!1,e.handlePrompt=null,e.enteredIdentifier=null,O(e)}var Ve=class{constructor(t,n){this.root=t;this.options=n;v(this,"client");v(this,"mode");v(this,"appearance",null);v(this,"design",null);v(this,"appliedDesign");v(this,"providers",[]);v(this,"nativeProviders",[]);v(this,"signInWithAtlas",{enabled:!1});v(this,"social",$r(void 0,void 0));v(this,"codeInputStyle","boxes");v(this,"interaction",cn(void 0,void 0));v(this,"backupCodeMode",!1);v(this,"policies",new Ue([]));v(this,"pendingPolicies",null);v(this,"policyDispose",[]);v(this,"enrollment",null);v(this,"secondFactorCode",null);v(this,"enteredIdentifier",null);v(this,"lastStepKind",null);v(this,"signUpFields",[]);v(this,"passwordEnabled",!0);v(this,"emailCodeEnabled",!1);v(this,"emailLinkEnabled",!1);v(this,"emailDeliveryAvailable",!0);v(this,"passkeyEnabled",!1);v(this,"passwordResetEnabled",!0);v(this,"passwordSignUpEnabled",!0);v(this,"conditionalAbort");v(this,"linkPoll",null);v(this,"heldResetAttempt",null);v(this,"account",{...gr});v(this,"rememberMeEnabled",!1);v(this,"remember",!0);v(this,"trustedDeviceEnabled",!1);v(this,"rememberDevice",!1);v(this,"captchaFlows",{});v(this,"captchaHost");v(this,"state",Y);v(this,"resetFlow",null);v(this,"flash",null);v(this,"handlePrompt",null);v(this,"busy",!1);v(this,"recorder");var r,o,i;this.mode=(r=n.mode)!=null?r:"sign-in",this.interaction=cn(void 0,(o=n.appearance)==null?void 0:o.interaction),this.client=ue({publishableKey:n.publishableKey,frontendApi:n.frontendApi,fetchImpl:n.fetchImpl,locale:(i=n.locale)!=null?i:ai(n.localization),referral:n.referral,referralConsent:n.referralConsent})}errorText(t){return si(t,this.options.localization)}async mount(){var r,o,i,s,a,l,c,d,u,p,f,g,m,h,w,C,S,A,k,y,x,_,R,E,B,W,F,J,le,Z,Qe;if(ta((r=this.root.ownerDocument)!=null?r:document),this.root.classList.add("atlas-embed-root"),this.options.locale&&!this.root.hasAttribute("lang")&&this.root.setAttribute("lang",this.options.locale),this.resolveDesign(null),this.applyTheme(),this.applyInteraction(),Ba(this),Ut(this.client).catch(()=>{}),await ca(this))return;let n=await Zs(this.client);if(n){this.appearance=n.appearance;let Za=(o=n.provider_scopes)!=null?o:{},Jr=mn=>{let hn=Za[mn];return hn?this.mode==="sign-up"?hn.sign_up:hn.sign_in:!0};this.providers=Js((i=n.providers)!=null?i:[],n.appearance).filter(Jr),this.nativeProviders=((s=n.native_providers)!=null?s:[]).filter(mn=>Jr(mn.provider)),this.passwordEnabled=(l=(a=n.strategies)==null?void 0:a.password)!=null?l:!0,this.passkeyEnabled=(d=(c=n.strategies)==null?void 0:c.passkey)!=null?d:!1,this.emailCodeEnabled=(p=(u=n.strategies)==null?void 0:u.emailCode)!=null?p:!1,this.emailLinkEnabled=(g=(f=n.strategies)==null?void 0:f.emailLink)!=null?g:!1,this.passwordResetEnabled=(h=(m=n.email_delivery)==null?void 0:m.password_reset)!=null?h:!0,this.emailDeliveryAvailable=(C=(w=n.email_delivery)==null?void 0:w.available)!=null?C:!0,this.passwordSignUpEnabled=(A=(S=n.email_delivery)==null?void 0:S.password_sign_up)!=null?A:!0,this.account=mr(n),this.signInWithAtlas=(k=n.sign_in_with_atlas)!=null?k:{enabled:!1},this.rememberMeEnabled=n.rememberMe===!0,this.trustedDeviceEnabled=n.rememberDevice===!0,this.captchaFlows=(y=n.captchaFlows)!=null?y:{},await Un(this.client)&&(this.captchaFlows=Xi(this.captchaFlows)),this.resolveDesign(Ns(n)),this.applyTheme()}this.social=$r(this.design?{...(x=this.appearance)==null?void 0:x.socialButtons,...this.design.socialButtons}:(_=this.appearance)==null?void 0:_.socialButtons,(R=this.options.appearance)==null?void 0:R.socialButtons),this.codeInputStyle=js((E=this.appearance)==null?void 0:E.codeInput,(B=this.options.appearance)==null?void 0:B.codeInput),this.interaction=cn(this.design?{...(W=this.appearance)==null?void 0:W.interaction,...this.design.interaction}:(F=this.appearance)==null?void 0:F.interaction,(J=this.options.appearance)==null?void 0:J.interaction),this.applyInteraction(),this.signUpFields=(Z=(le=this.appearance)==null?void 0:le.signUpFields)!=null?Z:[],await wa(this);try{this.recorder=new Ct((Qe=this.root.ownerDocument)!=null?Qe:document)}catch{}O(this),$a(this)}applyTheme(){var r,o,i,s,a,l;let t=(o=(r=this.design)==null?void 0:r.tokens)!=null?o:Ws(this.appearance,this.options.appearance),n=Ks(t);for(let[c,d]of Object.entries(n))this.root.style.setProperty(c,d);this.root.style.setProperty("--atlas-embed-color-text-on-primary",Gs(t.colorPrimary)),this.root.style.setProperty("--atlas-embed-color-focus-ring",(a=(s=(i=this.options.appearance)==null?void 0:i.variables)==null?void 0:s.colorFocusRing)!=null?a:Vs(t.colorPrimary,[t.colorCard,t.colorBackground])),this.design&&(this.appliedDesign=zs((l=this.root.ownerDocument)!=null?l:document,this.root,this.design.render,this.appliedDesign))}resolveDesign(t){var o,i,s;let n=(i=(o=this.root.ownerDocument)==null?void 0:o.defaultView)!=null?i:typeof window!="undefined"?window:null,r=!1;try{r=!!((s=n==null?void 0:n.matchMedia)!=null&&s.call(n,"(prefers-color-scheme: dark)").matches)}catch{}this.design=na(t,this.options.appearance,{frontendApi:this.options.frontendApi,prefersDark:r})}applyInteraction(){let t=this.interaction;this.root.setAttribute("data-button-style",t.buttonStyle),this.root.setAttribute("data-button-effect",t.buttonEffect),this.root.setAttribute("data-shadow",t.shadow),this.root.setAttribute("data-density",t.density),this.root.setAttribute("data-input-style",t.inputStyle);let n=t.animations?Hs[t.motionSpeed]:0;this.root.style.setProperty("--atlas-embed-motion",`${n}ms`)}};var ae={};function ja(e){ae=e}function Ye(){return ae}function Kr(e){if(!e)return{};let t=e.dataset,n={};return t.atlasKey&&(n.publishableKey=t.atlasKey),t.atlasFapi&&(n.frontendApi=t.atlasFapi),t.atlasRedirect&&(n.redirect=t.atlasRedirect),t.atlasLocale&&(n.locale=t.atlasLocale),n}function qa(e,t){var f,g,m,h,w,C,S,A,k,y,x,_;let n=e.dataset,r=R=>{var E;return(E=e.getAttribute(R))!=null?E:void 0},o=(g=(f=n.atlasKey)!=null?f:r("publishable-key"))!=null?g:ae.publishableKey,i=(h=(m=n.atlasFapi)!=null?m:r("frontend-api"))!=null?h:ae.frontendApi,s=(C=(w=n.atlasRedirect)!=null?w:r("redirect"))!=null?C:ae.redirect;if(!o||!i)return null;let a={publishableKey:o,frontendApi:i,mode:t};s&&(a.redirect=s);let l=(A=(S=n.atlasLocale)!=null?S:r("locale"))!=null?A:ae.locale;l&&(a.locale=l);let c=(k=n.atlasPreset)!=null?k:r("preset");c&&(a.appearance={preset:c});let d=(y=n.atlasReferral)!=null?y:r("referral");(d==="off"||d==="false")&&(a.referral=!1);let u=(x=n.atlasReferralConsent)!=null?x:r("referral-consent");(u==="granted"||u==="denied")&&(a.referralConsent=u);let p=(_=n.atlasPasskeyPrf)!=null?_:r("passkey-prf");return p&&(a.passkeyPrf={eval:{first:p}}),a}function Ha(e,t={}){var o,i,s,a,l;let n=(o=t.publishableKey)!=null?o:ae.publishableKey,r=(i=t.frontendApi)!=null?i:ae.frontendApi;return!n||!r?null:{...t,publishableKey:n,frontendApi:r,redirect:(s=t.redirect)!=null?s:ae.redirect,...((a=t.locale)!=null?a:ae.locale)?{locale:(l=t.locale)!=null?l:ae.locale}:{},mode:e}}var gn=class extends HTMLElement{constructor(){super(...arguments);v(this,"widget",null)}connectedCallback(){if(this.widget)return;let n=qa(this,this.mode);if(!n){this.textContent="Atlas: set data-atlas-key (publishable key) and data-atlas-fapi (frontend API origin).";return}this.widget=new Ve(this,n),this.widget.mount()}},Gr=class extends gn{constructor(){super(...arguments);v(this,"mode","sign-in")}},Vr=class extends gn{constructor(){super(...arguments);v(this,"mode","sign-up")}};function Yr(){typeof customElements!="undefined"&&(customElements.get("atlas-sign-in")||customElements.define("atlas-sign-in",Gr),customElements.get("atlas-sign-up")||customElements.define("atlas-sign-up",Vr))}function uu(e){let t=typeof e=="string"?document.querySelector(e):e;return t instanceof HTMLElement?t:null}function Wa(e,t,n){let r=uu(t);if(!r)return null;let o=Ha(e,n);if(!o)return r.textContent="Atlas: a publishable key and a frontend API origin are required to mount the widget.",null;let i=new Ve(r,o);return i.mount(),i}function Ka(e,t={}){return Wa("sign-in",e,t)}function Ga(e,t={}){return Wa("sign-up",e,t)}var H=(e,t={},...n)=>{let r=document.createElement(e);for(let[o,i]of Object.entries(t))r.setAttribute(o,i);for(let o of n)o!==null&&r.append(o);return r};function Je(e,t,n){let r=H("ul",{class:"atlas-list"});for(let o of e){let i=H("li",{"data-id":o.id},o.text),s=H("button",{type:"button",class:"atlas-button-secondary"},t);s.addEventListener("click",()=>void n(o.id)),i.append(" ",s),r.append(i)}return r}function Va(e,t){var C,S,A;let n=typeof e=="string"?document.querySelector(e):e,r=Ye(),o=(C=t.publishableKey)!=null?C:r.publishableKey,i=(S=t.frontendApi)!=null?S:r.frontendApi;if(!n)return null;if(!o||!i)return n.textContent="Atlas: a publishable key and a frontend API origin are required.",null;let s=ue({publishableKey:o,frontendApi:i,locale:(A=t.locale)!=null?A:r.locale,fetchImpl:t.fetchImpl}),a=t.organizationId,l=null,c=null,d=null,u=!0,p=async k=>{try{await k(),d=null}catch(y){d=y instanceof Error?y.message:"The request failed."}await w()},f=k=>p(async()=>{var x,_;let y=await k();l=(_=(x=y.secret)!=null?x:y.token)!=null?_:null}),g=(k,y="text",x="")=>{let _=H("input",{type:y,placeholder:x,"aria-label":k});return[H("label",{class:"atlas-field"},H("span",{},k),_),_]},m=(k,y,x=!0)=>{let _=H("button",{type:"button",class:x?"atlas-button":"atlas-button-secondary"},k);return _.addEventListener("click",y),_};async function h(){var k,y;switch(t.section){case"domains":{let x=await U.listDomains(s,a),[_,R]=g("Email domain","text","acme.com");return[Je(x.map(E=>({id:E.id,text:`${E.domain} \u2014 ${E.status}${E.status==="verified"?"":` (TXT ${E.verification.record_name} = ${E.verification.record_value})`}`})),"Remove",E=>p(()=>U.removeDomain(s,a,E))),...x.filter(E=>E.status!=="verified").map(E=>m(`Verify ${E.domain}`,()=>void p(()=>U.verifyDomain(s,a,E.id)),!1)),_,m("Add domain",()=>void p(()=>U.addDomain(s,a,R.value.trim())))]}case"logStreams":{let x=await U.listLogStreams(s,a),[_,R]=g("HTTPS endpoint","url","https://siem.example.com/ingest");return[Je(x.map(E=>({id:E.id,text:E.url})),"Remove",E=>p(()=>U.removeLogStream(s,a,E))),_,m("Add destination",()=>void f(()=>U.addLogStream(s,a,{url:R.value.trim()})))]}case"apiKeys":{let x=await U.listApiKeys(s,a),[_,R]=g("Key name");return[Je(x.map(E=>{var B;return{id:E.id,text:`${(B=E.name)!=null?B:E.prefix} (${E.prefix})`}}),"Revoke",E=>p(()=>U.revokeApiKey(s,a,E))),_,m("Create key",()=>void f(()=>U.createApiKey(s,a,{name:R.value.trim()||void 0})))]}case"webhooks":{let x=await U.listWebhooks(s,a),[_,R]=g("HTTPS endpoint","url","https://example.com/hooks/atlas");return[Je(x.map(E=>({id:E.id,text:`${E.url} \u2014 ${E.health}`})),"Remove",E=>p(()=>U.deleteWebhook(s,a,E))),_,m("Add endpoint",()=>void f(()=>U.createWebhook(s,a,{url:R.value.trim()})))]}case"appWebhooks":{let[x,_]=await Promise.all([U.listAppWebhooks(s,a),U.listAppEventTypes(s,a)]),[R,E]=g("HTTPS endpoint","url","https://example.com/webhooks"),B=_.map(F=>{let J=H("input",{type:"checkbox",value:F.type,"aria-label":F.type});return{box:J,el:H("label",{class:"atlas-text"},J,` ${F.type}${F.description?` \u2014 ${F.description}`:""}`)}}),W=[];for(let F of x){let J=H("li",{"data-id":F.id,"data-health":F.health},`${F.url} \u2014 ${F.health} \u2014 ${F.enabled_events.includes("*")?"all events":F.enabled_events.join(", ")} `);if(J.append(m("Send test",()=>void p(async()=>{var Z;let le=await U.testAppWebhook(s,a,F.id);if(le.status!=="success")throw new Error(`Test failed: ${(Z=le.error)!=null?Z:`HTTP ${le.http_status}`}`)}),!1),F.active?m("Pause",()=>void p(()=>U.updateAppWebhook(s,a,F.id,{active:!1})),!1):m("Enable",()=>void p(async()=>{await U.updateAppWebhook(s,a,F.id,{active:!0}),F.health!=="healthy"&&await U.replayAppWebhook(s,a,F.id)}),!1),m("Reveal secret",()=>void f(()=>U.revealAppWebhookSecret(s,a,F.id)),!1),m("Rotate secret",()=>void f(()=>U.rotateAppWebhookSecret(s,a,F.id)),!1),m("Deliveries",()=>{c=c===F.id?null:F.id,w()},!1),m("Remove",()=>void p(()=>U.deleteAppWebhook(s,a,F.id)),!1)),c===F.id){let le=await U.appWebhookDeliveries(s,a,F.id);J.append(Je(le.map(Z=>{var Qe;return{id:Z.id,text:`${(Qe=Z.event_type)!=null?Qe:"\u2014"} \xB7 ${Z.status}${Z.http_status?` \xB7 HTTP ${Z.http_status}`:""} \xB7 ${new Date(Z.created_at).toLocaleString()}`}}),"Redeliver",Z=>p(()=>U.redeliverAppWebhook(s,a,F.id,Z))))}W.push(J)}return[H("ul",{class:"atlas-list"},...W),R,H("fieldset",{class:"atlas-field"},H("legend",{},"Events (none selected = all)"),...B.map(F=>F.el)),m("Add endpoint",()=>{let F=B.filter(J=>J.box.checked).map(J=>J.box.value);f(()=>U.createAppWebhook(s,a,{url:E.value.trim(),enabled_events:F.length?F:["*"]}))})]}case"directory":{let x=await U.getDirectory(s,a);return[H("p",{},`SCIM base URL: ${x.base_url}`),Je(x.tokens.map(_=>({id:_.id,text:_.prefix})),"Revoke",_=>p(()=>U.revokeDirectoryToken(s,a,_))),m("Generate token",()=>void f(()=>U.createDirectoryToken(s,a)))]}case"ipAllowlist":{let x=await U.getIpAllowlist(s,a),_=H("textarea",{rows:"5","aria-label":"Sign-in IP allowlist"});return _.value=x.entries.join(`
|
|
414
|
-
`),[
|
|
413
|
+
`,ma=new WeakSet;function ha(e=document){var n;if(ma.has(e)||e.querySelector(`style[data-${Hr}]`))return;if(fn(e,Hr,ga)){ma.add(e);return}let t=e.createElement("style");t.setAttribute(`data-${Hr}`,""),pn(e,t),t.textContent=ga,((n=e.head)!=null?n:e.documentElement).appendChild(t)}function ya(e,t,n={}){var u;let r=Gs({instance:(t==null?void 0:t.instanceDesign)===!1?null:e,preset:t==null?void 0:t.preset,design:t==null?void 0:t.design,warn:Zs});if(!r)return null;let i=r.colorScheme==="dark"||r.colorScheme==="auto"&&!!n.prefersDark?r.paletteDark:r.palette,s={colorPrimary:i.primary,colorText:i.text,colorBackground:i.background,colorAccent:i.accent,colorCard:i.surface,colorBorder:i.border,borderRadius:`${Math.min(r.shape.controlRadius,24)}px`,fontFamily:Fr(r.typography.font)};for(let[p,f]of Object.entries((u=t==null?void 0:t.variables)!=null?u:{}))f!==void 0&&(s[p]=f);let a=r.elevation.cardShadow==="xl"?"lg":r.elevation.cardShadow,l={buttonStyle:r.buttons.style==="gradient"?"solid":r.buttons.style,shadow:r.card.style==="outline"||r.card.style==="none"?"none":a,density:r.spacing.density==="compact"?"compact":"comfortable",inputStyle:r.inputs.style},c=r.buttons.socialLayout==="icons"?{variant:"icon",layout:"grid"}:{layout:r.buttons.socialLayout==="grid"?"grid":"list"},d=Ks(JSON.stringify(r));return{render:{style:{},attributes:{...jr(r),"data-atlas-design":d},css:"",key:d,fontStylesheets:Vs(r,n.frontendApi)},tokens:s,interaction:l,socialButtons:c,resolved:r}}var ba=new Set(["bluesky"]),ka='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M15 18l-6-6 6-6"/></svg>',_a='<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 18l6-6-6-6"/></svg>',Me={"sign-in":{title:"Sign in",submit:"Continue"},"sign-up":{title:"Create your account",submit:"Continue"}};function $(e){var t;return(t=e.root.ownerDocument)!=null?t:document}function b(e,t,n,r){let o=$(e).createElement(t);return n&&(o.className=n),r!=null&&(o.textContent=r),(o.classList.contains("atlas-embed-form-error")||o.classList.contains("atlas-embed-error"))&&o.setAttribute("role","alert"),(o.classList.contains("atlas-embed-button")||o.classList.contains("atlas-embed-social-button"))&&su(e,o),o}function O(e,t,n){return da(t,n,e.options.appearance)}function su(e,t){e.interaction.buttonEffect!=="ripple"||!e.interaction.animations||t.addEventListener("pointerdown",n=>{let r=t.getBoundingClientRect(),o=Math.max(r.width,r.height),i=$(e).createElement("span");i.className="atlas-embed-ripple",i.style.width=i.style.height=`${o}px`,i.style.left=`${n.clientX-r.left-o/2}px`,i.style.top=`${n.clientY-r.top-o/2}px`,i.addEventListener("animationend",()=>i.remove()),t.appendChild(i)})}function Ee(e,t){let n=b(e,"button",O(e,"buttonPrimary","atlas-embed-button"));if(n.type="submit",n.disabled=e.busy,e.busy){n.setAttribute("data-busy",""),n.setAttribute("aria-label",t);let r=b(e,"span","atlas-embed-btn-spinner");r.setAttribute("aria-hidden","true"),n.appendChild(r)}else n.textContent=t;return n}function va(e,t=typeof window!="undefined"?window.location.origin:""){if(!e||typeof e!="string")return null;if(e.startsWith("/")&&!e.startsWith("//"))try{return t?new URL(e,t).toString():e}catch{return null}let n;try{n=new URL(e)}catch{return null}return t&&n.origin===t||n.protocol==="https:"?n.toString():null}async function _t(e,t,n=!1){var a,l,c;let r=e.captchaFlows[t];if(!(n?!!r&&pt(r.provider,r):We(r))||!r)return null;let i=(a=e.root.ownerDocument)!=null?a:document,s=i.createElement("div");s.className="atlas-embed-captcha",((c=(l=e.root.parentElement)!=null?l:i.body)!=null?c:i.documentElement).appendChild(s);try{return await hr(r,s,{atlas:{labels:fr(e.options.localization)}})}catch{return null}finally{s.remove()}}var Wr=new WeakMap;async function au(e){let t=Wr.get(e);if(t){let o=await t;return o?{...o,owner:!1}:null}let n=Ti({win:e}).catch(()=>null);Wr.set(e,n),n.finally(()=>Wr.delete(e));let r=await n;return r?{...r,owner:!0}:null}async function Ca(e){var o,i;let t=(i=(o=e.root.ownerDocument)==null?void 0:o.defaultView)!=null?i:typeof window!="undefined"?window:null;if(!t)return!1;let n=await au(t);if(n!=null&&n.delivered)return Qe(e,"Signed in. You can close this window."),!0;if(n!=null&&n.owner){let s=Fi(n.payload);if(s!=null&&s.ticket&&s.attemptId)return await xa(e,t,s.attemptId,s.ticket),!0;if(s!=null&&s.continuationUrl)return t.location.replace(s.continuationUrl),!0}let r=Li(t.location.search);return r?r.ticket?(await xa(e,t,r.attemptId,r.ticket,()=>wa(e,t)),!0):(r.status&&(e.state=Ot({id:r.attemptId,status:r.status,...r.policyToken?{policyToken:r.policyToken}:{}}),wa(e,t)),!1):!1}async function xa(e,t,n,r,o){let i=await ke(e,n,r);o==null||o(),!(i&&await Ii({win:t}).catch(()=>!1))&&await oe(e,n)}function wa(e,t){try{t.history.replaceState({},t.document.title,Mt(t.location.href))}catch{}}async function ke(e,t,n){return e.options.preview?!1:(await e.client.post("/v1/client/tickets/exchange",{attempt_id:t,ticket:n,remember:e.remember})).ok}async function oe(e,t){var o,i;if(qe(e.state)){F(e);return}e.options.preview||await is(e.client).catch(()=>{});let n=(i=(o=e.root.ownerDocument)==null?void 0:o.defaultView)!=null?i:typeof window!="undefined"?window:null,r=va(e.options.redirect,n?n.location.origin:void 0);if(e.root.dispatchEvent(new CustomEvent("atlas:complete",{bubbles:!0,detail:{attemptId:t,redirected:!!r}})),e.options.preview){Qe(e,"Sign-in works \u2014 this is a preview, so no session was created.");return}if(r&&n){n.location.assign(r);return}Qe(e,"You are signed in.")}function vt(e,t){si({api:e.options.frontendApi,publishableKey:e.options.publishableKey,attemptId:t!=null?t:void 0,kind:e.mode==="sign-up"?"sign_up":"sign_in",recorder:e.recorder,fetchImpl:e.options.fetchImpl})}async function ie(e,t,n){var a,l,c,d,u,p,f;if(e.busy)return;if((a=e.conditionalAbort)==null||a.abort(),e.flash=null,typeof t.identifier=="string"&&t.identifier.trim()&&(e.enteredIdentifier=t.identifier.trim()),e.busy=!0,vt(e,(l=e.state.attempt)==null?void 0:l.id),F(e),e.state=await ut(e.client,e.state,t),e.state.attempt&&ee(e.state.attempt).kind==="collect_captcha"){let m=await _t(e,"signIn",!0);m&&(e.state=await ut(e.client,e.state,{identifier:(d=(c=e.enteredIdentifier)!=null?c:t.identifier)!=null?d:"",captcha_token:m}))}let r=e.state.attempt?ee(e.state.attempt):null;n&&(r==null?void 0:r.kind)==="collect_first_factor"&&e.state.errors.length===0?r.strategies.includes(n)?await hn(e,n,!1):e.state={...e.state,errors:[{code:"STRATEGY_DISABLED",message:"That sign-in method is not available for this account."}]}:(r==null?void 0:r.kind)==="collect_first_factor"&&t.password&&e.state.errors.length===0&&(e.state=await ut(e.client,e.state,{password:t.password})),e.busy=!1;let o=e.state.attempt?ee(e.state.attempt):null;e.mode==="sign-in"&&e.passwordEnabled&&(o==null?void 0:o.kind)==="collect_first_factor"&&!e.state.prepared&&(e.state={...X,errors:e.state.errors});let i=e.state.attempt?ee(e.state.attempt):null;if((i==null?void 0:i.kind)==="collect_first_factor"&&!e.state.prepared&&e.state.errors.length===0){let m=$t(e.emailDeliveryAvailable?i.strategies:i.strategies.filter(k=>k!=="email_code"&&k!=="email_link")).autoSend;m&&await hn(e,m,!1)}let s=e.state.attempt;if(ot(e.state)){let m=(p=(u=e.state.attempt)==null?void 0:u.id)!=null?p:null;e.busy=!0,F(e),e.state.ticket&&m&&await ke(e,m,e.state.ticket)&&(e.state={...e.state,ticket:null}),e.busy=!1,F(e);return}if((s==null?void 0:s.status)==="complete"){let m=(f=s.id)!=null?f:null;if(m&&m===e.heldResetAttempt&&!e.state.ticket){Sa(e);return}e.state.ticket&&m&&await ke(e,m,e.state.ticket),await oe(e,m);return}F(e)}function Sa(e){e.flash="Password updated. Sign in with your new password.",e.state=X,e.mode="sign-in",F(e)}function Kr(e){var t,n,r;(r=e.enteredIdentifier)!=null||(e.enteredIdentifier=(n=(t=e.state.attempt)==null?void 0:t.identifier)!=null?n:null),e.state=X,e.mode="sign-in",F(e)}async function Aa(e){var n,r;if(e.busy||!ot(e.state))return;e.state=jo(e.state);let t=(r=(n=e.state.attempt)==null?void 0:n.id)!=null?r:null;e.busy=!0;try{e.state.ticket&&t&&await ke(e,t,e.state.ticket)}finally{e.busy=!1}await oe(e,t)}async function Pa(e){var n,r;if(e.busy||!qe(e.state))return;let t=(r=(n=e.state.attempt)==null?void 0:n.id)!=null?r:null;e.state=rr(e.state),await oe(e,t)}async function hn(e,t,n=!0){var i;if(n){if(e.busy)return;e.busy=!0,F(e)}let r=(i=e.state.prepared)!=null?i:null,o=await ki(e.client,e.state,t);e.state=o.errors.length>0?{...o,prepared:r}:o,t==="email_link"&&o.errors.length===0&&Ra(e),n&&(e.busy=!1,F(e))}async function Ea(e){e.busy||(e.busy=!0,F(e),e.state=await bi(e.client,e.state),e.busy=!1,e.flash=e.state.errors.length===0?"We sent you a new email.":null,F(e))}function Ra(e){e.linkPoll&&clearInterval(e.linkPoll),e.linkPoll=setInterval(()=>{(async()=>{var s,a;if(!Lt(e.state)){e.linkPoll&&clearInterval(e.linkPoll),e.linkPoll=null;return}let t=(s=e.state.attempt)==null?void 0:s.status,n=e.state,{state:r,ticket:o}=await _i(e.client,n);if(e.state.pollSecret===n.pollSecret&&(e.state=r),!o&&r.attempt&&(r.attempt.status!==t||r.attempt.finished_elsewhere)&&F(e),!o||!r.attempt)return;e.linkPoll&&clearInterval(e.linkPoll),e.linkPoll=null;let i=(a=r.attempt.id)!=null?a:null;i&&await ke(e,i,o),await oe(e,i)})()},2e3)}async function yn(e,t,n){var a,l,c;vt(e);let r=(l=(a=e.root.ownerDocument)==null?void 0:a.defaultView)!=null?l:typeof window!="undefined"?window:null,o=r?Mt(r.location.href):e.options.frontendApi,i=await e.client.post("/v1/client/sign_ins/oauth",{provider:t,redirect_url:o,...n?{identifier:n}:{}}),s=(c=i.data)==null?void 0:c.authorization_url;s&&r?r.location.assign(s):(e.handlePrompt=null,_e(e,i.errors))}async function Gr(e,t,n={}){var a,l,c;vt(e);let r=(l=(a=e.root.ownerDocument)==null?void 0:a.defaultView)!=null?l:typeof window!="undefined"?window:null,o=r?Mt(r.location.href):e.options.frontendApi;if(n.popup&&r){await cu(e,t,r,o);return}let i=await e.client.post("/v1/client/sign_ins/sso",{connection_id:t,redirect_url:o}),s=(c=i.data)==null?void 0:c.authorization_url;s&&r?r.location.assign(s):_e(e,i.errors)}function lu(e){let t=e.options.frontendApi;try{return new URL(/^https?:\/\//.test(t)?t:`https://${t}`).origin}catch{return t}}async function cu(e,t,n,r){var u;let o=n.open("about:blank","atlas-sso","width=480,height=640,menubar=no,toolbar=no,location=no,status=no");if(!o){await Gr(e,t);return}let i=r.includes("?")?"&":"?",s=`${r}${i}__atlas_display=popup`,a=lu(e),l=p=>{if(p.origin!==a)return;let f=p.data;if(!(!f||f.type!=="atlas-sso")){n.removeEventListener("message",l);try{o.close()}catch{}if(f.error){_e(e,[{code:"sso_popup_cancelled",message:"Sign-in was cancelled."}]);return}if(f.status==="complete"&&f.ticket&&f.attempt_id){let m=f.attempt_id,k=f.ticket;(async()=>(await ke(e,m,k),await oe(e,m)))();return}f.attempt_id&&f.status&&(e.state=Ot({id:f.attempt_id,status:f.status,...typeof f.policy_token=="string"?{policyToken:f.policy_token}:{}}),F(e))}};n.addEventListener("message",l);let c=await e.client.post("/v1/client/sign_ins/sso",{connection_id:t,redirect_url:s}),d=(u=c.data)==null?void 0:u.authorization_url;if(d)try{o.location.assign(d)}catch{try{o.close()}catch{}n.removeEventListener("message",l),n.location.assign(d)}else{n.removeEventListener("message",l);try{o.close()}catch{}_e(e,c.errors)}}async function Ta(e,t,n){let r=await e.client.post("/v1/client/sign_ins/id_token",ji({provider:t,idToken:n})),o=Bi(r.data);if(!o){_e(e,r.errors);return}if(o.status==="complete"&&o.ticket){await ke(e,o.attemptId,o.ticket),await oe(e,o.attemptId);return}let i=r.data,s=Ot({id:o.attemptId,status:o.status,...typeof(i==null?void 0:i.policy_acceptance_token)=="string"?{policyToken:i.policy_acceptance_token}:{}});e.state=o.status==="needs_policy_acceptance"&&s.attempt&&Array.isArray(i==null?void 0:i.pending_policies)?{...s,attempt:{...s.attempt,pending_policies:i.pending_policies}}:s,F(e)}function Vr(e){e.resetFlow={...ft},F(e)}async function Yr(e,t){var o,i,s,a,l,c,d;if(e.busy||!e.resetFlow)return;if(e.busy=!0,vt(e),F(e),Ke(e.resetFlow)==="request"){typeof t.email=="string"&&t.email.trim()&&(e.enteredIdentifier=t.email.trim());let u=await _t(e,"passwordReset");e.resetFlow=await as(e.client,(o=t.email)!=null?o:"",u!=null?u:void 0),(i=e.resetFlow.attempt)!=null&&i.poll_secret&&du(e)}else e.resetFlow=await ls(e.client,e.resetFlow,{code:t.code,password:t.password,securityAnswers:((s=e.resetFlow.securityQuestions)!=null?s:[]).map((u,p)=>{var f;return{question:u,answer:(f=t[`security_answer_${p}`])!=null?f:""}})},{askQuestions:((a=e.account.mfa)==null?void 0:a.securityQuestions)===!0});e.busy=!1;let n=e.resetFlow,r=n?cs(n):null;if(r){e.resetFlow=null,e.heldResetAttempt=(c=(l=r.attempt)==null?void 0:l.id)!=null?c:null,e.state=r,F(e);return}if(((d=n==null?void 0:n.attempt)==null?void 0:d.status)==="complete"){let u=n.attempt.id;e.resetFlow=null,qe(e.state)&&(e.state=rr(e.state)),n.ticket?(await ke(e,u,n.ticket),await oe(e,u)):Sa(e);return}F(e)}function du(e){var n,r;e.linkPoll&&clearInterval(e.linkPoll);let t=(r=(n=e.resetFlow)==null?void 0:n.attempt)==null?void 0:r.id;e.linkPoll=setInterval(()=>{(async()=>{var s,a;let o=e.resetFlow;if(!(o!=null&&o.attempt)||o.attempt.id!==t||o.attempt.status!=="needs_email_verification"){e.linkPoll&&clearInterval(e.linkPoll),e.linkPoll=null;return}let i=await us(e.client,o,{askQuestions:((s=e.account.mfa)==null?void 0:s.securityQuestions)===!0});e.resetFlow!==o||((a=i.attempt)==null?void 0:a.status)==="needs_email_verification"||(e.linkPoll&&clearInterval(e.linkPoll),e.linkPoll=null,e.resetFlow=i,F(e))})()},2e3)}async function Jr(e,t,n=!0){var c;if(e.busy)return;e.busy=!0,vt(e),F(e);let{identifier:r,password:o,...i}=t,s={};for(let[d,u]of Object.entries(i))u&&(s[d]=u);let a=await _t(e,"signUp");e.state=await nr(e.client,{email:r!=null?r:"",password:o!=null?o:"",fields:s,consent:n,captchaToken:a!=null?a:void 0,policyAcceptances:e.policies.build()}),e.busy=!1,await Ia(e);let l=e.state.attempt;if((l==null?void 0:l.status)==="complete"){let d=(c=l.id)!=null?c:null;e.state.ticket&&d&&await ke(e,d,e.state.ticket),await oe(e,d);return}Lt(e.state)&&Ra(e),F(e)}var uu={"mfa.enrollChoose":"Set up a second step for signing in.","mfa.enrollTotpOption":"Use an authenticator app","mfa.enrollSmsOption":"Use text messages","link.title":"Confirm it's you","link.matchCodeHint":"Opening the link on another device? Enter this code there.","link.checking":"Checking your link\u2026","link.enterCodeHelp":"Enter the code shown on the device where you started.","link.codeLabel":"Code","link.confirm":"Confirm","link.confirmed":"Confirmed. You can close this tab and go back to where you started.","link.invalid":"This link is no longer valid. Go back to where you started and ask for a new one.","mfa.enrollHotpOption":"Use a counter-based code generator","mfa.enrollYubikeyOption":"Use a YubiKey","mfa.enrollDuoOption":"Use Duo","mfa.enrollPasskeyOption":"Use a passkey","mfa.yubikeyLabel":"Touch your YubiKey","mfa.enrollDuoHelp":"Open Duo and approve the request, then come back and continue.","mfa.enrollDuoOpen":"Open Duo","mfa.enrollPasskeyHelp":"Create a passkey on this device to use as your second step. It must ask for your PIN or biometrics.","mfa.enrollPasskeyCreate":"Create passkey","mfa.enrollScan":"Scan this QR code with your authenticator app, or enter the setup key.","mfa.enrollQrAlt":"QR code for your authenticator app","mfa.enrollSetupKey":"Setup key","mfa.enrollPreparing":"Setting up\u2026","mfa.enrollFirstCodeLabel":"Code from your authenticator app","mfa.enrollSecondCodeLabel":"The next code it shows","mfa.phoneLabel":"Mobile number","mfa.phoneHint":"Include the country code, for example +14155550101.","mfa.sendCode":"Text me a code","mfa.codeTextedTo":"Enter the code we texted to {phone}.","mfa.codeLabel":"Code","mfa.smsCodeOption":"Text me a code instead","mfa.recoveryCodesTitle":"Save your recovery codes","mfa.recoveryCodesHelp":"Each code works once. If you can't use your second step, sign in with one of these. Keep them somewhere safe: they won't be shown again.","mfa.recoveryCodesCopy":"Copy codes","mfa.recoveryCodesCopied":"Copied.","mfa.recoveryCodesDownload":"Download as .txt","mfa.recoveryCodesSaved":"I've saved my codes","signIn.emailCodeOption":"Email me a code instead","signIn.codeSentTo":"We sent a code to {email}. Enter it below.","signIn.resendCode":"Resend code","signIn.sending":"Sending\u2026","signIn.forgotPassword":"Forgot password?","signUp.existingAccount":"You already had an account. Your existing password still applies.","signUp.emailConfirmed":"Your email is confirmed. Sign in to continue.","signUp.submit":"Continue","signIn.title":"Sign in","requiredAction.firstNameLabel":"First name","requiredAction.lastNameLabel":"Last name","requiredAction.sendCode":"Email me a code","requiredAction.skip":"Skip for now","requiredAction.customIntro":"Your account needs one more step before you continue.","requiredAction.verifyIntro":"We will email a code to confirm your address.","requiredAction.idvIntro":"To continue, verify your identity with a photo ID and a selfie.","requiredAction.idvStart":"Start verification","requiredAction.idvOpen":"Open the verification page","requiredAction.idvWaiting":"Waiting for your verification to finish\u2026","requiredAction.idvCheck":"I've finished","requiredAction.idvDeclined":"We could not verify your identity. You can try again.","requiredAction.idvReview":"Your verification is being reviewed. This can take a little while."};function T(e,t,n={}){var s;let r=e.options.localization,o=typeof r=="function"?r(t):r&&typeof r=="object"?r[t]:void 0;return(typeof o=="string"&&o.trim()?o:(s=uu[t])!=null?s:t).replace(/\{(\w+)\}/g,(a,l)=>{var c;return(c=n[l])!=null?c:a})}function Oa(e){var n;let t=(n=e.state.attempt)==null?void 0:n.id;return t?(e.enrollment||(e.enrollment=Mo(e.client,()=>Dn(e.account)),e.enrollment.subscribe(()=>queueMicrotask(()=>F(e)))),e.enrollment.start(t),e.enrollment):null}function Fa(e,t,n,r){var l;let o=Oa(e);if(!o)return r;let i=o.state,s=(c,d)=>{let u=b(e,"button","atlas-embed-step-back",T(e,Do(c)));u.type="button",u.setAttribute("data-atlas-mfa-method",c),u.disabled=e.busy||i.busy,u.addEventListener("click",()=>void o.choose(c)),Array.isArray(d)?d.push(u):d.appendChild(u)};if(i.method===null){t.appendChild(b(e,"p","atlas-embed-note",T(e,"mfa.enrollChoose")));for(let c of i.options)s(c,t)}else if(i.method==="yubikey")n.addField("otp",T(e,"mfa.yubikeyLabel"),"text","off");else if(i.method==="duo"||i.method==="passkey"){let c=i.enrollment;if(c){if(i.method==="passkey")t.appendChild(b(e,"p","atlas-embed-note",T(e,"mfa.enrollPasskeyHelp")));else if(t.appendChild(b(e,"p","atlas-embed-note",T(e,"mfa.enrollDuoHelp"))),c.authorizationUrl){let d=b(e,"a","atlas-embed-step-back",T(e,"mfa.enrollDuoOpen"));d.setAttribute("data-atlas","mfa-duo-open"),d.href=c.authorizationUrl,d.target="_blank",d.rel="noopener noreferrer",t.appendChild(d)}}else{let d=b(e,"p","atlas-embed-note",i.busy?T(e,"mfa.enrollPreparing"):"");d.setAttribute("aria-live","polite"),t.appendChild(d)}}else if(i.method==="totp"||i.method==="hotp"){let c=i.enrollment;if(c){if(t.appendChild(b(e,"p","atlas-embed-note",T(e,"mfa.enrollScan"))),c.qrCode){let d=$(e).createElement("img");d.className="atlas-embed-mfa-qr",d.setAttribute("data-atlas","mfa-qr"),d.src=c.qrCode,d.alt=T(e,"mfa.enrollQrAlt"),d.width=180,d.height=180,t.appendChild(d)}if(c.secret){let d=b(e,"p","atlas-embed-note",`${T(e,"mfa.enrollSetupKey")}: `);d.setAttribute("data-atlas","mfa-setup-key"),d.appendChild(b(e,"code","atlas-embed-mfa-key",$o(c.secret))),t.appendChild(d)}n.addCodeField("code",T(e,"mfa.enrollFirstCodeLabel"),!0),i.method==="totp"&&i.totpCodes>=2&&n.addCodeField("secondCode",T(e,"mfa.enrollSecondCodeLabel"),!1)}else{let d=b(e,"p","atlas-embed-note",i.busy?T(e,"mfa.enrollPreparing"):"");d.setAttribute("aria-live","polite"),t.appendChild(d)}}else if(!i.enrollment)n.addField("phone",T(e,"mfa.phoneLabel"),"tel","tel"),t.appendChild(b(e,"p","atlas-embed-note",T(e,"mfa.phoneHint")));else{let c=b(e,"p","atlas-embed-note",T(e,"mfa.codeTextedTo",{phone:(l=i.enrollment.phone)!=null?l:""}));c.setAttribute("data-atlas","mfa-code-texted"),t.appendChild(c),n.addCodeField("code",T(e,"mfa.codeLabel"),!0);let d=b(e,"button","atlas-embed-step-back",T(e,"signIn.resendCode"));d.type="button",d.setAttribute("data-atlas-resend",""),d.disabled=e.busy||i.busy,d.addEventListener("click",()=>void o.resend()),n.trailing.push(d)}for(let c of i.errors){let d=b(e,"p","atlas-embed-error",e.errorText(c));d.setAttribute("role","alert"),t.appendChild(d)}if(i.method!==null&&i.options.length>1)for(let c of i.options.filter(d=>d!==i.method))s(c,n.trailing);let a=Uo(i);return a===null?null:a==="signIn.submit"?r:T(e,a)}async function La(e,t){let n=Oa(e);if(!n)return;let r=await n.submit(t);r&&await ie(e,r)}function Da(e,t){var s;let n=(s=e.state.attempt)==null?void 0:s.id;if(!n)return;let r=Dn(e.account),o=e.secondFactorCode&&e.secondFactorCode.attemptId===n?e.secondFactorCode:null,i=[];r.sms&&i.push("sms"),r.emailCode&&i.push("email_code");for(let a of i){let l=a==="sms"?"sms-second-factor":"email-second-factor";if((o==null?void 0:o.strategy)===a&&o.sentTo!==void 0){let u=b(e,"p","atlas-embed-note",a==="sms"?T(e,"mfa.codeTextedTo",{phone:o.sentTo}):T(e,"signIn.codeSentTo",{email:o.sentTo}));u.setAttribute("data-atlas",`${l}-sent`),u.setAttribute("aria-live","polite"),t.push(u);continue}let c=(o==null?void 0:o.strategy)===a&&o.busy===!0,d=b(e,"button","atlas-embed-step-back",c?T(e,"signIn.sending"):T(e,a==="sms"?"mfa.smsCodeOption":"signIn.emailCodeOption"));if(d.type="button",d.setAttribute("data-atlas",l),d.disabled=e.busy||c,d.addEventListener("click",()=>{e.secondFactorCode={attemptId:n,strategy:a,busy:!0},F(e),No(e.client,n,a).then(({sentTo:u})=>{e.secondFactorCode={attemptId:n,strategy:a,sentTo:u},F(e)},u=>{e.secondFactorCode={attemptId:n,strategy:a,error:u instanceof Error?u.message:String(u)},F(e)})}),t.push(d),(o==null?void 0:o.strategy)===a&&o.error){let u=b(e,"p","atlas-embed-error",o.error);u.setAttribute("role","alert"),t.push(u)}}}function $a(e,t){var s,a;let n=b(e,"div","atlas-embed-recovery-codes");n.setAttribute("data-atlas","recovery-codes"),n.appendChild(b(e,"h2",O(e,"title","atlas-embed-title"),T(e,"mfa.recoveryCodesTitle"))),n.appendChild(b(e,"p","atlas-embed-note",T(e,"mfa.recoveryCodesHelp")));let r=b(e,"ul","atlas-embed-recovery-list");r.setAttribute("data-atlas","recovery-codes-list"),r.setAttribute("style","list-style:none;padding:0;margin:8px 0 12px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;text-align:center");for(let l of t){let c=b(e,"li");c.appendChild(b(e,"code","atlas-embed-mfa-key",l)),r.appendChild(c)}n.appendChild(r);let o=((s=$(e).defaultView)!=null?s:globalThis).navigator;if((a=o==null?void 0:o.clipboard)!=null&&a.writeText){let l=b(e,"button","atlas-embed-step-back",T(e,"mfa.recoveryCodesCopy"));l.type="button",l.setAttribute("data-atlas","recovery-codes-copy"),l.addEventListener("click",()=>{Bo(t).then(c=>{if(!c||n.querySelector('[data-atlas="recovery-codes-copied"]'))return;let d=b(e,"p","atlas-embed-note",T(e,"mfa.recoveryCodesCopied"));d.setAttribute("data-atlas","recovery-codes-copied"),d.setAttribute("aria-live","polite"),n.insertBefore(d,i)})}),n.appendChild(l)}if($n()){let l=b(e,"button","atlas-embed-step-back",T(e,"mfa.recoveryCodesDownload"));l.type="button",l.setAttribute("data-atlas","recovery-codes-download"),l.addEventListener("click",()=>qo(t)),n.appendChild(l)}let i=b(e,"button",O(e,"buttonPrimary","atlas-embed-button"),T(e,"mfa.recoveryCodesSaved"));return i.type="button",i.setAttribute("data-atlas","recovery-codes-saved"),i.disabled=e.busy,i.addEventListener("click",()=>{i.disabled=!0,Aa(e)}),n.appendChild(i),n}function bn(e){return fi((t,n)=>T(e,t,n!=null?n:{}))}async function Ma(e){e.mode==="sign-up"&&(cr($(e)),e.policies.setPolicies(await dt(e.client)))}function Qr(e){return{link:"atlas-embed-consent-link",text:"atlas-embed-consent-text"}}function Ua(e){for(let t of e.policyDispose.splice(0))t()}function Na(e,t){let n=e.policies;if(n.policies.length===0)return null;let r=bn(e),o=$(e),i=b(e,"div"),s=b(e,"p");return e.policyDispose.push(dr(i,n,{t:r,document:o,classes:Qr(e)}).destroy),e.policyDispose.push(ur(s,n,{t:r,document:o,classes:Qr(e)}).destroy),e.policyDispose.push(n.subscribe(t)),{consent:i,clickwrap:s,canSubmit:()=>n.canSubmit(),async read(){return n.pendingScroll()?pr(n,{t:r,document:o,container:e.root}):!0}}}async function Ia(e){Zn(e.state.errors)&&e.policies.setPolicies(await dt(e.client))}function za(e){var l;let t=bn(e),n=$(e),r=b(e,"div","atlas-embed-policies");cr(n);let o=e.state.attempt,i=(l=o==null?void 0:o.id)!=null?l:null;(!e.pendingPolicies||e.pendingPolicies.attemptId!==i)&&(e.pendingPolicies={attemptId:i,controller:null},gi(e.client,o,{}).then(c=>{var d;((d=e.pendingPolicies)==null?void 0:d.attemptId)===i&&(e.pendingPolicies={attemptId:i,controller:c},F(e))}));let s=e.pendingPolicies.attemptId===i?e.pendingPolicies.controller:null;if(!s)return r.appendChild(b(e,"p","atlas-embed-note",t("policy.loading"))),r;let a=Ui(r,s,{t,document:n,container:e.root,classes:Qr(e),onSubmit:c=>{e.pendingPolicies=null,ie(e,{policy_acceptances:JSON.stringify(c)})},onDecline:c=>{e.pendingPolicies=null,e.state={attempt:null,errors:[{code:"POLICY_DECLINED",message:t("policy.declined",{policy:c.title})}],busy:!1,pollSecret:null,ticket:null},F(e)}});return a.setBusy(e.busy),e.policyDispose.push(a.destroy),r}function ja(e){let t=b(e,"div","atlas-embed-existing-account");t.setAttribute("data-atlas","existing-account");let n=b(e,"p","atlas-embed-note",T(e,"signUp.existingAccount"));if(n.setAttribute("role","status"),t.appendChild(n),e.passwordResetEnabled){let o=b(e,"button","atlas-embed-step-back",T(e,"signIn.forgotPassword"));o.type="button",o.addEventListener("click",()=>{var i,s,a;(a=e.enteredIdentifier)!=null||(e.enteredIdentifier=(s=(i=e.state.attempt)==null?void 0:i.identifier)!=null?s:null),Vr(e)}),t.appendChild(o)}let r=b(e,"button",O(e,"buttonPrimary","atlas-embed-button"),T(e,"signUp.submit"));return r.type="button",r.setAttribute("data-atlas","existing-account-continue"),r.addEventListener("click",()=>void Pa(e)),t.appendChild(r),t}function Ba(e){var f,m,k;let t=e.resetFlow,n=Ke(t),r=b(e,"div","atlas-embed-reset");r.appendChild(b(e,"h1",O(e,"title","atlas-embed-title"),"Reset your password"));let o=$(e).createElement("form"),i=t.errors,s=new Map,a=i.find(g=>!g.param);a&&o.appendChild(b(e,"div","atlas-embed-form-error",e.errorText(a)));let l=null,c="Continue",d=!0,u=e.account.passwordReset;switch(n){case"request":l=u==="link"?"Enter your email and we\u2019ll send you a reset link.":u==="both"?"Enter your email and we\u2019ll send you a reset link and code.":"Enter your email and we\u2019ll send you a reset code.",c=u==="link"?"Send reset link":"Send reset code",xt(e,o,s,i,"email","Email address","email","username");{let g=s.get("email");g&&(e.enteredIdentifier&&(g.value=e.enteredIdentifier),g.setAttribute("data-atlas-autofocus",""))}break;case"collect_email_code":if(u==="link"){d=!1,l="Check your email";let g=b(e,"p","atlas-embed-note",e.enteredIdentifier?`We sent a reset link to ${e.enteredIdentifier}. Open it on any device; this page continues on its own.`:"We sent you a reset link. Open it on any device; this page continues on its own.");g.setAttribute("data-atlas-link-sent",""),o.appendChild(g);let _=b(e,"button","atlas-embed-step-back","Send another link");_.type="button",_.setAttribute("data-atlas-resend",""),_.disabled=e.busy,_.addEventListener("click",()=>{var S;e.resetFlow={...ft},Yr(e,{email:(S=e.enteredIdentifier)!=null?S:""})}),o.appendChild(_);break}l=e.enteredIdentifier?`Enter the code we sent to ${e.enteredIdentifier}`:"Enter the code we sent to your email",Xr(e,o,s,i,"code","Reset code",!0);break;case"collect_second_factor":l="Enter the code from your authenticator app",Xr(e,o,s,i,"code","Two-factor code",!0);break;case"collect_new_password":l="Choose a new password",c="Set new password",xt(e,o,s,i,"password","New password","password","new-password"),(f=s.get("password"))==null||f.setAttribute("data-atlas-autofocus",""),((m=t.securityQuestions)!=null?m:[]).forEach((g,_)=>xt(e,o,s,i,`security_answer_${_}`,g,"text","off"));break;default:d=!1,o.appendChild(b(e,"p","atlas-embed-note","You\u2019re all set."))}if(n==="collect_email_code"&&((k=t.attempt)!=null&&k.match_code)){let g=b(e,"p","atlas-embed-note",`${T(e,"link.matchCodeHint")} `);g.setAttribute("data-atlas","link-match-code"),g.appendChild(b(e,"code","atlas-embed-mfa-key",t.attempt.match_code)),o.appendChild(g)}l&&r.appendChild(b(e,"p",O(e,"subtitle","atlas-embed-subtitle"),l)),r.appendChild(o),d&&o.appendChild(Ee(e,c));let p=b(e,"button","atlas-embed-step-back","Back to sign in");return p.type="button",p.addEventListener("click",()=>{e.resetFlow=null,F(e)}),o.appendChild(p),o.addEventListener("submit",g=>{g.preventDefault();let _={};for(let[S,x]of s)_[S]=x.value;Yr(e,_)}),r}function qa(e){var t,n;return(n=(t=e.state.attempt)==null?void 0:t.pending_required_actions)==null?void 0:n[0]}function pu(e,t,n,r){var a,l,c,d;let o=qa(e),i=u=>t.appendChild(b(e,"p","atlas-embed-note",u)),s=(u,p,f=!1)=>{let m=b(e,"button",f?O(e,"buttonPrimary","atlas-embed-button"):"atlas-embed-step-back",u);return m.type="button",m.disabled=e.busy,m.addEventListener("click",p),m};switch(o==null?void 0:o.action){case"update_password":return r.addField("password","New password","password","new-password"),!0;case"update_profile":return r.addField("first_name",T(e,"requiredAction.firstNameLabel"),"text","given-name"),r.addField("last_name",T(e,"requiredAction.lastNameLabel"),"text","family-name"),!0;case"complete_profile":case"journey_form":{o.title&&i(o.title),o.intro&&i(o.intro);let u=(a=o.fields)!=null?a:[];for(let p of u)fu(e,t,n,r.addField,p);return o.action==="complete_profile"&&u.every(p=>!p.required)&&r.trailing.push(s(T(e,"requiredAction.skip"),()=>void ie(e,{action:"complete_profile",skip:"true"}))),!0}case"verify_email":return i(T(e,"requiredAction.verifyIntro")),r.trailing.push(s(T(e,"requiredAction.sendCode"),()=>void ie(e,{action:"verify_email",step:"send"}))),r.addCodeField("code","Verification code",!0),!0;case"identity_verification":{let u=(c=(l=e.state.attempt)==null?void 0:l.identity_verification)!=null?c:null;if(i(T(e,"requiredAction.idvIntro")),u!=null&&u.url){let f=b(e,"a",O(e,"buttonPrimary","atlas-embed-button"),T(e,"requiredAction.idvOpen"));f.href=u.url,f.target="_blank",f.rel="noopener noreferrer",t.appendChild(f),t.appendChild(s(T(e,"requiredAction.idvCheck"),()=>void ie(e,{action:"identity_verification"})))}else{let f=(d=$(e).defaultView)==null?void 0:d.location,m=(f==null?void 0:f.protocol)==="https:"?f.href:void 0;t.appendChild(s(T(e,"requiredAction.idvStart"),()=>void ie(e,{action:"identity_verification",step:"start",...m?{redirect_url:m}:{}}),!0))}let p=(u==null?void 0:u.status)==="declined"?"requiredAction.idvDeclined":(u==null?void 0:u.status)==="needs_review"?"requiredAction.idvReview":u!=null&&u.url?"requiredAction.idvWaiting":null;return p&&i(T(e,p)).setAttribute("role","status"),!1}default:if(i(T(e,"requiredAction.customIntro")),o!=null&&o.url){let u=b(e,"a",O(e,"buttonPrimary","atlas-embed-button"),T(e,"signUp.submit"));u.href=o.url,u.rel="noopener",t.appendChild(u)}return!1}}function fu(e,t,n,r,o){var a,l;let i=`field:${o.key}`,s=`${o.label}${o.required?" *":""}`;if(o.type==="select"||o.type==="textarea"||o.type==="checkbox"){let c=b(e,"label",O(e,"field","atlas-embed-field"));c.appendChild(b(e,"span",O(e,"label","atlas-embed-label"),s));let d;if(o.type==="select"){d=$(e).createElement("select"),d.appendChild($(e).createElement("option"));for(let u of(a=o.options)!=null?a:[]){let p=$(e).createElement("option");p.value=u,p.textContent=u,d.appendChild(p)}}else if(o.type==="textarea")d=$(e).createElement("textarea");else{let u=$(e).createElement("input");u.type="checkbox",u.value="false",u.addEventListener("change",()=>{u.value=u.checked?"true":"false"}),d=u}o.type!=="checkbox"&&(d.className=O(e,"input","atlas-embed-input")),d.name=i,c.appendChild(d),t.appendChild(c),n.set(i,d);return}r(i,s,["tel","email","url","number","date"].includes(o.type)?o.type:"text","off"),o.placeholder&&((l=n.get(i))==null||l.setAttribute("placeholder",o.placeholder))}function xt(e,t,n,r,o,i,s,a){let l=b(e,"label",O(e,"field","atlas-embed-field"));l.appendChild(b(e,"span",O(e,"label","atlas-embed-label"),i));let c=$(e).createElement("input");if(c.className=O(e,"input","atlas-embed-input"),c.type=s,c.name=o,c.setAttribute("autocomplete",a),s==="password"){let d=b(e,"div","atlas-embed-password");d.appendChild(c);let u=b(e,"button","atlas-embed-password-toggle","Show");u.type="button",u.setAttribute("aria-label","Show password"),u.addEventListener("click",p=>{p.preventDefault();let f=c.type==="password";c.type=f?"text":"password",u.textContent=f?"Hide":"Show",u.setAttribute("aria-label",f?"Hide password":"Show password")}),d.appendChild(u),l.appendChild(d)}else l.appendChild(c);for(let d of r.filter(u=>u.param===o))l.appendChild(b(e,"span",O(e,"error","atlas-embed-error"),e.errorText(d)));n.set(o,c),t.appendChild(l)}function Xr(e,t,n,r,o,i,s){var m;if(e.codeInputStyle==="single"){xt(e,t,n,r,o,i,"text","one-time-code"),s&&((m=n.get(o))==null||m.setAttribute("data-atlas-autofocus",""));return}let l=b(e,"div",O(e,"field","atlas-embed-field"));l.appendChild(b(e,"span",O(e,"label","atlas-embed-label"),i));let c=b(e,"div","atlas-embed-code");c.setAttribute("role","group"),c.setAttribute("aria-label",i);let d=$(e).createElement("input");d.type="hidden",d.name=o,n.set(o,d);let u=[],p=()=>{d.value=u.map(k=>k.value).join("")},f=()=>{d.value.length!==6||e.busy||t.dispatchEvent(new Event("submit",{cancelable:!0,bubbles:!0}))};for(let k=0;k<6;k++){let g=$(e).createElement("input");g.className="atlas-embed-code-box",g.type="text",g.setAttribute("inputmode","numeric"),g.setAttribute("autocomplete",k===0?"one-time-code":"off"),g.setAttribute("aria-label",`${i} digit ${k+1}`),g.maxLength=1,s&&k===0&&g.setAttribute("data-atlas-autofocus",""),g.addEventListener("input",()=>{g.value=g.value.replace(/\D/g,"").slice(0,1),p(),g.value&&k<5&&u[k+1].focus(),f()}),g.addEventListener("keydown",_=>{_.key==="Backspace"&&!g.value&&k>0&&u[k-1].focus()}),g.addEventListener("paste",_=>{var x,w,P;_.preventDefault();let S=((w=(x=_.clipboardData)==null?void 0:x.getData("text"))!=null?w:"").replace(/\D/g,"").slice(0,6);for(let C=0;C<6;C++)u[C].value=(P=S[C])!=null?P:"";p(),u[Math.min(S.length,5)].focus(),f()}),u.push(g),c.appendChild(g)}l.appendChild(c),l.appendChild(d);for(let k of r.filter(g=>g.param===o))l.appendChild(b(e,"span",O(e,"error","atlas-embed-error"),e.errorText(k)));t.appendChild(l)}function Ha(e,t){var m,k,g,_,S,x,w,P,C;let n=$(e).createElement("form"),r=e.state.errors.find(y=>!y.param);if(r){let y=b(e,"div","atlas-embed-form-error",e.errorText(r));if(e.mode==="sign-up"&&t==="collect_email_code"&&r.code==="IDENTIFIER_EXISTS"){let h=b(e,"button","atlas-embed-step-back",T(e,"signIn.title"));h.type="button",h.setAttribute("data-atlas","identifier-exists-sign-in"),h.addEventListener("click",()=>Kr(e)),y.append(" ",h)}n.appendChild(y)}let o=new Map,i=e.state.errors,s=(y,h,R,E)=>xt(e,n,o,i,y,h,R,E),a=(y,h,R)=>Xr(e,n,o,i,y,h,R),l=!0,c=Me[e.mode].submit,d=[],u=()=>{l=!1;let y=b(e,"p","atlas-embed-note",T(e,"signUp.emailConfirmed"));y.setAttribute("role","status"),y.setAttribute("data-atlas-email-confirmed",""),n.appendChild(y);let h=b(e,"button",O(e,"buttonPrimary","atlas-embed-button"),T(e,"signIn.title"));h.type="button",h.setAttribute("data-atlas","email-confirmed-sign-in"),h.addEventListener("click",()=>Kr(e)),n.appendChild(h)},p=()=>{if(!e.state.matchCode)return;let y=b(e,"p","atlas-embed-note",`${T(e,"link.matchCodeHint")} `);y.setAttribute("data-atlas","link-match-code"),y.appendChild(b(e,"code","atlas-embed-mfa-key",e.state.matchCode)),n.appendChild(y)};switch(t){case"collect_identifier":if(s("identifier","Email address","email",e.passkeyEnabled&&ge()?"username webauthn":"username"),e.enteredIdentifier&&(o.get("identifier").value=e.enteredIdentifier),e.mode==="sign-in"&&e.passwordEnabled){s("password","Password","password","current-password");let y=[];e.emailDeliveryAvailable&&e.emailCodeEnabled?y.push("email_code"):e.emailDeliveryAvailable&&e.emailLinkEnabled&&y.push("email_link");for(let h of y){let R=b(e,"button","atlas-embed-step-back",h==="email_code"?"Email me a code instead":"Email me a sign-in link instead");R.type="button",R.setAttribute("data-strategy",h),R.disabled=e.busy,R.addEventListener("click",()=>{var D;let E=o.get("identifier");if(!E.value.trim()){(D=E.reportValidity)==null||D.call(E),E.focus();return}ie(e,{identifier:E.value},h)}),d.push(R)}}if(e.mode==="sign-in"&&e.rememberMeEnabled){let y=b(e,"label","atlas-embed-remember"),h=$(e).createElement("input");h.type="checkbox",h.className="atlas-embed-remember-check",h.checked=e.remember,h.addEventListener("change",()=>{e.remember=h.checked}),y.appendChild(h),y.appendChild(b(e,"span","atlas-embed-remember-text","Remember me")),n.appendChild(y)}break;case"collect_first_factor":{if(He(e.state.attempt)){u();break}let y=e.state.attempt?(m=ee(e.state.attempt).strategies)!=null?m:[]:[],h=$t(e.emailDeliveryAvailable?y:y.filter(I=>I!=="email_code"&&I!=="email_link")),R=(k=e.state.prepared)!=null?k:null,E=(S=(_=e.enteredIdentifier)!=null?_:(g=e.state.attempt)==null?void 0:g.identifier)!=null?S:"",D=(I,L,W)=>{let H=b(e,"button","atlas-embed-step-back",L);return H.type="button",H.setAttribute(W,W==="data-strategy"?I:""),H.disabled=e.busy,H.addEventListener("click",()=>void hn(e,I)),H};if(R==="email_code"){let I=b(e,"p","atlas-embed-note",E?`We sent a code to ${E}. Enter it below.`:"We sent you a code. Enter it below.");I.setAttribute("data-atlas-code-sent",""),n.appendChild(I),a("code","Verification code",!0),d.push(D("email_code","Resend code","data-atlas-resend"))}else if(R==="email_link"){l=!1;let I=b(e,"p","atlas-embed-note",E?`We sent a sign-in link to ${E}. Open it on any device to continue.`:"Check your email for a sign-in link.");I.setAttribute("data-atlas-link-sent",""),n.appendChild(I),p(),d.push(D("email_link","Resend link","data-atlas-resend"))}else if(!h.password&&h.email.length>0){l=!1;for(let I of h.email)d.push(D(I,I==="email_code"?"Email me a code":"Email me a sign-in link","data-strategy"))}else{s("password","Password","password","current-password");for(let I of h.email)d.push(D(I,I==="email_code"?"Email me a code instead":"Email me a sign-in link instead","data-strategy"))}break}case"collect_second_factor":if(e.backupCodeMode?s("code","Backup code","text","one-time-code"):a("code","Two-factor code",!0),e.trustedDeviceEnabled){let y=b(e,"label","atlas-embed-remember"),h=$(e).createElement("input");h.type="checkbox",h.className="atlas-embed-remember-check",h.checked=e.rememberDevice,h.addEventListener("change",()=>{e.rememberDevice=h.checked}),y.appendChild(h),y.appendChild(b(e,"span","atlas-embed-remember-text","Remember this device")),n.appendChild(y)}Da(e,d);break;case"collect_email_code":{if(He(e.state.attempt)){u();break}let y=Ft(e.state.attempt,e.account.emailVerification);if(y){l=!1;let h=(P=(w=e.enteredIdentifier)!=null?w:(x=e.state.attempt)==null?void 0:x.identifier)!=null?P:"",R=b(e,"p","atlas-embed-note",h?`We sent a confirmation link to ${h}. Open it on any device; this page continues on its own.`:"We sent you a confirmation link. Open it on any device; this page continues on its own.");R.setAttribute("data-atlas-link-sent",""),n.appendChild(R)}else a("code","Verification code",!0);if(p(),((C=e.state.attempt)==null?void 0:C.object)==="sign_up_attempt"){let h=b(e,"button","atlas-embed-step-back",y?"Resend link":"Resend code");h.type="button",h.setAttribute("data-atlas-resend",""),h.disabled=e.busy,h.addEventListener("click",()=>void Ea(e)),d.push(h)}break}case"collect_new_password":s("password","New password","password","new-password");break;case"complete_required_action":c=T(e,"signUp.submit"),l=pu(e,n,o,{addField:s,addCodeField:a,trailing:d});break;case"enroll_second_factor":{let y=Fa(e,n,{addField:s,addCodeField:a,trailing:d},c);y===null?l=!1:c=y;break}default:l=!1,n.appendChild(b(e,"p","atlas-embed-note","Please continue in your application."))}l&&n.appendChild(Ee(e,c));for(let y of d)n.appendChild(y);if(t==="collect_second_factor"){let y=b(e,"button","atlas-embed-step-back",e.backupCodeMode?"Use your authenticator app":"Use a backup code instead");y.type="button",y.addEventListener("click",()=>{e.backupCodeMode=!e.backupCodeMode,F(e)}),n.appendChild(y)}if((t==="collect_identifier"&&e.mode==="sign-in"&&e.passwordEnabled||t==="collect_first_factor"&&o.has("password"))&&e.passwordResetEnabled){let y=b(e,"button","atlas-embed-step-back","Forgot password?");y.type="button",y.addEventListener("click",()=>Vr(e)),n.appendChild(y)}return n.addEventListener("submit",y=>{var R,E;y.preventDefault();let h={};for(let[D,I]of o)h[D]=I.value;if(t==="collect_second_factor"&&e.trustedDeviceEnabled&&e.rememberDevice&&(h.remember_device="true"),t==="enroll_second_factor"){La(e,h);return}if(t==="complete_required_action"){let D=(E=(R=qa(e))==null?void 0:R.action)!=null?E:"";for(let I of Object.keys(h))I.startsWith("field:")&&!h[I]&&delete h[I];ie(e,{...h,action:D,...D==="verify_email"?{step:"verify"}:{}});return}ie(e,h)}),n}function gu(e){var l;let t=(l=e.appearance)==null?void 0:l.legal;if(!t||!t.termsUrl&&!t.privacyUrl)return null;let n=$(e),r=b(e,"div","atlas-embed-consent"),o=null;t.required&&(o=n.createElement("input"),o.type="checkbox",o.className="atlas-embed-consent-check",o.setAttribute("aria-label","Agree to the terms and privacy policy"),r.appendChild(o));let i=b(e,"span","atlas-embed-consent-text"),s=(c,d)=>{let u=n.createElement("a");return u.href=c,u.textContent=d,u.target="_blank",u.rel="noopener noreferrer",u.className="atlas-embed-consent-link",u};i.appendChild(n.createTextNode(t.required?"I agree to the ":"By continuing you agree to the "));let a=[];return t.termsUrl&&a.push(s(t.termsUrl,"Terms of Service")),t.privacyUrl&&a.push(s(t.privacyUrl,"Privacy Policy")),a.forEach((c,d)=>{d>0&&i.appendChild(n.createTextNode(" and ")),i.appendChild(c)}),i.appendChild(n.createTextNode(".")),r.appendChild(i),{row:r,checkbox:o}}function Wa(e){var c;let t=$(e).createElement("form");if(!e.passwordSignUpEnabled)return t.appendChild(b(e,"div","atlas-embed-form-error",fs)),t;let n=e.state.errors.find(d=>!d.param);n&&t.appendChild(b(e,"div","atlas-embed-form-error",e.errorText(n)));let r=new Map,o=(d,u,p)=>{var _,S,x;let f=(_=p.type)!=null?_:"text",m=f==="radio"||f==="multiselect",k=b(e,m?"fieldset":"label",O(e,"field","atlas-embed-field"));k.appendChild(b(e,m?"legend":"span",O(e,"label","atlas-embed-label"),p.required?u:`${u} (optional)`));let g=$(e);if(f==="select"){let w=g.createElement("select");w.className=O(e,"input","atlas-embed-input"),w.name=d;let P=g.createElement("option");P.value="",P.textContent=p.placeholder||"Select\u2026",w.appendChild(P);for(let C of(S=p.options)!=null?S:[]){let y=g.createElement("option");y.value=C,y.textContent=C,w.appendChild(y)}k.appendChild(w),r.set(d,()=>w.value)}else if(f==="textarea"){let w=g.createElement("textarea");w.className=O(e,"input","atlas-embed-input"),w.name=d,w.rows=3,p.placeholder&&w.setAttribute("placeholder",p.placeholder),k.appendChild(w),r.set(d,()=>w.value)}else if(f==="checkbox"){let w=g.createElement("input");w.type="checkbox",w.name=d,w.className="atlas-embed-checkbox",k.classList.add("atlas-embed-field-checkbox"),k.appendChild(w),r.set(d,()=>w.checked?"true":"")}else if(f==="radio"||f==="multiselect"){let w=g.createElement("div");w.className="atlas-embed-choices";let P=[];for(let C of(x=p.options)!=null?x:[]){let y=g.createElement("label");y.className="atlas-embed-choice";let h=g.createElement("input");h.type=f==="radio"?"radio":"checkbox",h.name=d,h.value=C,P.push(h),y.appendChild(h),y.appendChild(b(e,"span",void 0,C)),w.appendChild(y)}k.appendChild(w),r.set(d,()=>{var C,y;return f==="radio"?(y=(C=P.find(h=>h.checked))==null?void 0:C.value)!=null?y:"":P.filter(h=>h.checked).map(h=>h.value).join(", ")})}else{let w=g.createElement("input");w.className=O(e,"input","atlas-embed-input"),w.type=f,w.name=d,p.autocomplete&&w.setAttribute("autocomplete",p.autocomplete),p.placeholder&&w.setAttribute("placeholder",p.placeholder),k.appendChild(w),r.set(d,()=>w.value)}for(let w of e.state.errors.filter(P=>P.param===d))k.appendChild(b(e,"span",O(e,"error","atlas-embed-error"),e.errorText(w)));t.appendChild(k)};for(let d of e.signUpFields)o(d.key,d.label,{type:d.type,required:d.required,placeholder:d.placeholder,options:d.options});o("identifier","Email address",{type:"email",required:!0,autocomplete:"email"}),o("password","Password",{type:"password",required:!0,autocomplete:"new-password"});let i,s=Na(e,()=>{i&&(i.disabled=e.busy||!(s!=null&&s.canSubmit()))}),a=s?null:gu(e);a&&t.appendChild(a.row),s&&t.appendChild(s.consent),i=Ee(e,Me[e.mode].submit);let l=()=>s?s.canSubmit():!(a!=null&&a.checkbox)||a.checkbox.checked;return i.disabled=e.busy||!l(),(c=a==null?void 0:a.checkbox)==null||c.addEventListener("change",()=>{i.disabled=e.busy||!l()}),t.appendChild(i),s&&t.appendChild(s.clickwrap),t.addEventListener("submit",d=>{d.preventDefault();let u={};for(let[p,f]of r)u[p]=f();if(!s){Jr(e,u,l());return}s.read().then(p=>{var m,k;if(p){Jr(e,u,!0);return}let f=(k=(m=e.policies.policies.find(g=>!e.policies.isChecked(g.key)))==null?void 0:m.title)!=null?k:"";e.state={...e.state,errors:[{code:"POLICY_DECLINED",message:bn(e)("policy.declined",{policy:f})}]},F(e)})}),t}var mu={google:'<path fill="#4285F4" d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"/><path fill="#34A853" d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"/><path fill="#FBBC05" d="M5.84 14.1c-.22-.66-.35-1.36-.35-2.1s.13-1.44.35-2.1V7.06H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.94l3.66-2.84z"/><path fill="#EA4335" d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.06l3.66 2.84C6.71 7.31 9.14 5.38 12 5.38z"/>',microsoft:'<path fill="#F25022" d="M2 2h9.3v9.3H2z"/><path fill="#7FBA00" d="M12.7 2H22v9.3h-9.3z"/><path fill="#00A4EF" d="M2 12.7h9.3V22H2z"/><path fill="#FFB900" d="M12.7 12.7H22V22h-9.3z"/>'},hu={github:{fill:"currentColor",path:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"},apple:{fill:"currentColor",path:"M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701"},x:{fill:"currentColor",path:"M14.234 10.162 22.977 0h-2.072l-7.591 8.824L7.251 0H.258l9.168 13.343L.258 24H2.33l8.016-9.318L16.749 24h6.993zm-2.837 3.299-.929-1.329L3.076 1.56h3.182l5.965 8.532.929 1.329 7.754 11.09h-3.182z"},notion:{fill:"currentColor",path:"M4.459 4.208c.746.606 1.026.56 2.428.466l13.215-.793c.28 0 .047-.28-.046-.326L17.86 1.968c-.42-.326-.981-.7-2.055-.607L3.01 2.295c-.466.046-.56.28-.374.466zm.793 3.08v13.904c0 .747.373 1.027 1.214.98l14.523-.84c.841-.046.935-.56.935-1.167V6.354c0-.606-.233-.933-.748-.887l-15.177.887c-.56.047-.747.327-.747.933zm14.337.745c.093.42 0 .84-.42.888l-.7.14v10.264c-.608.327-1.168.514-1.635.514-.748 0-.935-.234-1.495-.933l-4.577-7.186v6.952L12.21 19s0 .84-1.168.84l-3.222.186c-.093-.186 0-.653.327-.746l.84-.233V9.854L7.822 9.76c-.094-.42.14-1.026.793-1.073l3.456-.233 4.764 7.279v-6.44l-1.215-.139c-.093-.514.28-.887.747-.933zM1.936 1.035l13.31-.98c1.634-.14 2.055-.047 3.082.7l4.249 2.986c.7.513.934.653.934 1.213v16.378c0 1.026-.373 1.634-1.68 1.726l-15.458.934c-.98.047-1.448-.093-1.962-.747l-3.129-4.06c-.56-.747-.793-1.306-.793-1.96V2.667c0-.839.374-1.54 1.447-1.632z"},facebook:{fill:"#0866FF",path:"M9.101 23.691v-7.98H6.627v-3.667h2.474v-1.58c0-4.085 1.848-5.978 5.858-5.978.401 0 .955.042 1.468.103a8.68 8.68 0 0 1 1.141.195v3.325a8.623 8.623 0 0 0-.653-.036 26.805 26.805 0 0 0-.733-.009c-.707 0-1.259.096-1.675.309a1.686 1.686 0 0 0-.679.622c-.258.42-.374.995-.374 1.752v1.297h3.919l-.386 2.103-.287 1.564h-3.246v8.245C19.396 23.238 24 18.179 24 12.044c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.628 3.874 10.35 9.101 11.647Z"},discord:{fill:"#5865F2",path:"M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"},gitlab:{fill:"#FC6D26",path:"m23.6004 9.5927-.0337-.0862L20.3.9814a.851.851 0 0 0-.3362-.405.8748.8748 0 0 0-.9997.0539.8748.8748 0 0 0-.29.4399l-2.2055 6.748H7.5375l-2.2057-6.748a.8573.8573 0 0 0-.29-.4412.8748.8748 0 0 0-.9997-.0537.8585.8585 0 0 0-.3362.4049L.4332 9.5015l-.0325.0862a6.0657 6.0657 0 0 0 2.0119 7.0105l.0113.0087.03.0213 4.976 3.7264 2.462 1.8633 1.4995 1.1321a1.0085 1.0085 0 0 0 1.2197 0l1.4995-1.1321 2.4619-1.8633 5.006-3.7489.0125-.01a6.0682 6.0682 0 0 0 2.0094-7.003z"},spotify:{fill:"#1ED760",path:"M12 0C5.4 0 0 5.4 0 12s5.4 12 12 12 12-5.4 12-12S18.66 0 12 0zm5.521 17.34c-.24.359-.66.48-1.021.24-2.82-1.74-6.36-2.101-10.561-1.141-.418.122-.779-.179-.899-.539-.12-.421.18-.78.54-.9 4.56-1.021 8.52-.6 11.64 1.32.42.18.479.659.301 1.02zm1.44-3.3c-.301.42-.841.6-1.262.3-3.239-1.98-8.159-2.58-11.939-1.38-.479.12-1.02-.12-1.14-.6-.12-.48.12-1.021.6-1.141C9.6 9.9 15 10.561 18.72 12.84c.361.181.54.78.241 1.2zm.12-3.36C15.24 8.4 8.82 8.16 5.16 9.301c-.6.179-1.2-.181-1.38-.721-.18-.601.18-1.2.72-1.381 4.26-1.26 11.28-1.02 15.721 1.621.539.3.719 1.02.419 1.56-.299.421-1.02.599-1.559.3z"},twitch:{fill:"#9146FF",path:"M11.571 4.714h1.715v5.143H11.57zm4.715 0H18v5.143h-1.714zM6 0L1.714 4.286v15.428h5.143V24l4.286-4.286h3.428L22.286 12V0zm14.571 11.143l-3.428 3.428h-3.429l-3 3v-3H6.857V1.714h13.714Z"},reddit:{fill:"#FF4500",path:"M12 0C5.373 0 0 5.373 0 12c0 3.314 1.343 6.314 3.515 8.485l-2.286 2.286C.775 23.225 1.097 24 1.738 24H12c6.627 0 12-5.373 12-12S18.627 0 12 0Zm4.388 3.199c1.104 0 1.999.895 1.999 1.999 0 1.105-.895 2-1.999 2-.946 0-1.739-.657-1.947-1.539v.002c-1.147.162-2.032 1.15-2.032 2.341v.007c1.776.067 3.4.567 4.686 1.363.473-.363 1.064-.58 1.707-.58 1.547 0 2.802 1.254 2.802 2.802 0 1.117-.655 2.081-1.601 2.531-.088 3.256-3.637 5.876-7.997 5.876-4.361 0-7.905-2.617-7.998-5.87-.954-.447-1.614-1.415-1.614-2.538 0-1.548 1.255-2.802 2.803-2.802.645 0 1.239.218 1.712.585 1.275-.79 2.881-1.291 4.64-1.365v-.01c0-1.663 1.263-3.034 2.88-3.207.188-.911.993-1.595 1.959-1.595Zm-8.085 8.376c-.784 0-1.459.78-1.506 1.797-.047 1.016.64 1.429 1.426 1.429.786 0 1.371-.369 1.418-1.385.047-1.017-.553-1.841-1.338-1.841Zm7.406 0c-.786 0-1.385.824-1.338 1.841.047 1.017.634 1.385 1.418 1.385.785 0 1.473-.413 1.426-1.429-.046-1.017-.721-1.797-1.506-1.797Zm-3.703 4.013c-.974 0-1.907.048-2.77.135-.147.015-.241.168-.183.305.483 1.154 1.622 1.964 2.953 1.964 1.33 0 2.47-.81 2.953-1.964.057-.137-.037-.29-.184-.305-.863-.087-1.795-.135-2.769-.135Z"},figma:{fill:"#F24E1E",path:"M15.852 8.981h-4.588V0h4.588c2.476 0 4.49 2.014 4.49 4.49s-2.014 4.491-4.49 4.491zM12.735 7.51h3.117c1.665 0 3.019-1.355 3.019-3.019s-1.355-3.019-3.019-3.019h-3.117V7.51zm0 1.471H8.148c-2.476 0-4.49-2.014-4.49-4.49S5.672 0 8.148 0h4.588v8.981zm-4.587-7.51c-1.665 0-3.019 1.355-3.019 3.019s1.354 3.02 3.019 3.02h3.117V1.471H8.148zm4.587 15.019H8.148c-2.476 0-4.49-2.014-4.49-4.49s2.014-4.49 4.49-4.49h4.588v8.98zM8.148 8.981c-1.665 0-3.019 1.355-3.019 3.019s1.355 3.019 3.019 3.019h3.117V8.981H8.148zM8.172 24c-2.489 0-4.515-2.014-4.515-4.49s2.014-4.49 4.49-4.49h4.588v4.441c0 2.503-2.047 4.539-4.563 4.539zm-.024-7.51a3.023 3.023 0 0 0-3.019 3.019c0 1.665 1.365 3.019 3.044 3.019 1.705 0 3.093-1.376 3.093-3.068v-2.97H8.148zm7.704 0h-.098c-2.476 0-4.49-2.014-4.49-4.49s2.014-4.49 4.49-4.49h.098c2.476 0 4.49 2.014 4.49 4.49s-2.014 4.49-4.49 4.49zm-.097-7.509c-1.665 0-3.019 1.355-3.019 3.019s1.355 3.019 3.019 3.019h.098c1.665 0 3.019-1.355 3.019-3.019s-1.355-3.019-3.019-3.019h-.098z"},dropbox:{fill:"#0061FF",path:"M6 1.807L0 5.629l6 3.822 6.001-3.822L6 1.807zM18 1.807l-6 3.822 6 3.822 6-3.822-6-3.822zM0 13.274l6 3.822 6.001-3.822L6 9.452l-6 3.822zM18 9.452l-6 3.822 6 3.822 6-3.822-6-3.822zM6 18.371l6.001 3.822 6-3.822-6-3.822L6 18.371z"},gitee:{fill:"#C71D23",path:"M11.984 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.016 0zm6.09 5.333c.328 0 .593.266.592.593v1.482a.594.594 0 0 1-.593.592H9.777c-.982 0-1.778.796-1.778 1.778v5.63c0 .327.266.592.593.592h5.63c.982 0 1.778-.796 1.778-1.778v-.296a.593.593 0 0 0-.592-.593h-4.15a.592.592 0 0 1-.592-.592v-1.482a.593.593 0 0 1 .593-.592h6.815c.327 0 .593.265.593.592v3.408a4 4 0 0 1-4 4H5.926a.593.593 0 0 1-.593-.593V9.778a4.444 4.444 0 0 1 4.445-4.444h8.296Z"}};function Ka(e){let t=mu[e];if(t)return`<svg viewBox="0 0 24 24" width="18" height="18" aria-hidden="true" focusable="false">${t}</svg>`;let n=hu[e];return n?`<svg viewBox="0 0 24 24" width="18" height="18" fill="${n.fill}" aria-hidden="true" focusable="false"><path d="${n.path}"/></svg>`:null}function Ga(e,t){return!t||!t.id||!t.status||t.status==="complete"?!1:(e.state={...e.state,attempt:t,errors:[]},F(e),!0)}function Va(e){let t=e.options.passkeyPrf;return t?{prf:t,onExtensionResults:n=>{var s,a,l,c,d;let r={credentialId:n.credentialId,enabled:!!((s=n.prf)!=null&&s.results)||((a=n.prf)==null?void 0:a.enabled)===!0,...(l=n.prf)!=null&&l.results?{results:n.prf.results}:{}},o=(c=e.root.ownerDocument)==null?void 0:c.defaultView,i=(d=o==null?void 0:o.CustomEvent)!=null?d:CustomEvent;e.root.dispatchEvent(new i("atlas:passkey-prf",{detail:r,bubbles:!1}))}}:{}}async function Ya(e){var o,i,s;if(e.busy)return;(o=e.conditionalAbort)==null||o.abort(),e.busy=!0,F(e);let t=await yr(e.client,{captcha:({retry:a})=>_t(e,"signIn",a)});if(!t.ok||!t.data){e.busy=!1,_e(e,t.errors);return}let n;try{n=await rt(t.data,Va(e))}catch{e.busy=!1,F(e);return}let r=await e.client.post("/v1/client/sign_ins/passkey/finish",n);if(e.busy=!1,r.ok&&((i=r.data)==null?void 0:i.status)==="complete"){await oe(e,(s=r.data.created_session_id)!=null?s:null);return}r.ok&&Ga(e,r.data)||_e(e,r.errors)}async function Ja(e){var r,o,i;if(e.mode!=="sign-in"||!e.passkeyEnabled||!ge())return;let t=!1;try{t=await Ln()}catch{t=!1}if(!t||We(e.captchaFlows.signIn))return;(r=e.conditionalAbort)==null||r.abort();let n=new AbortController;e.conditionalAbort=n;try{let s=await yr(e.client);if(!s.ok||!s.data||n.signal.aborted)return;let a=await rt(s.data,{mediation:"conditional",signal:n.signal,...Va(e)});if(n.signal.aborted)return;let l=await e.client.post("/v1/client/sign_ins/passkey/finish",a);l.ok&&((o=l.data)==null?void 0:o.status)==="complete"?await oe(e,(i=l.data.created_session_id)!=null?i:null):l.ok&&Ga(e,l.data)}catch{}}function Qa(e){let t=b(e,"button",O(e,"socialButton","atlas-embed-social-button"),"Sign in with a passkey");return t.type="button",t.setAttribute("data-atlas-passkey",""),t.disabled=e.busy,t.addEventListener("click",()=>{Ya(e)}),t}function Zr(e){let t=[...e.providers];for(let n of e.nativeProviders)t.includes(n.provider)||t.push(n.provider);return t}var yu='<svg viewBox="0 0 24 24" width="18" height="18" aria-hidden="true" fill="none"><path d="M12 2 3 21h4l5-11 5 11h4L12 2z" fill="currentColor"/></svg>';function bu(e,t){var a;let{variant:n,labels:r}=e.social,o=(a=r.atlas)!=null?a:n==="block"?"Continue with Atlas":"Atlas",i=b(e,"button",O(e,"socialButton","atlas-embed-social-button"));i.type="button",i.setAttribute("data-atlas-provider","atlas"),i.setAttribute("data-variant",n);let s=$(e).createElement("span");if(s.className="atlas-embed-social-icon",s.innerHTML=yu,i.appendChild(s),n==="icon")i.setAttribute("aria-label","Continue with Atlas"),i.setAttribute("title","Atlas");else{let l=$(e).createElement("span");l.className="atlas-embed-social-label",l.textContent=o,i.appendChild(l)}return i.addEventListener("click",()=>{Gr(e,t,{popup:!0})}),i}function Xa(e){let t=Zr(e),n=b(e,"div","atlas-embed-social");n.setAttribute("data-layout",e.social.layout),n.setAttribute("data-size",e.social.size),n.setAttribute("data-variant",e.social.variant),e.signInWithAtlas.enabled&&e.signInWithAtlas.connection_id&&n.appendChild(bu(e,e.signInWithAtlas.connection_id));for(let c of t){let d=e.nativeProviders.find(p=>p.provider===c),u=c==="google"&&(d!=null&&d.client_id)?vu(e,d.client_id):_u(e,c);u.getAttribute("data-atlas-provider")||u.setAttribute("data-atlas-provider",c),n.appendChild(u)}let r=e.social.layout==="carousel"?ku(e,n):n;if(!(e.social.search==="always"||e.social.search==="auto"&&t.length>oa))return r;let i=b(e,"div","atlas-embed-social-field"),s=$(e).createElement("input");s.type="search",s.className="atlas-embed-social-search",s.setAttribute("placeholder","Search sign-in options\u2026"),s.setAttribute("aria-label","Search sign-in options"),s.autocomplete="off";let a=b(e,"div","atlas-embed-social-empty");a.textContent="No matching sign-in options.",a.setAttribute("hidden","");let l=Array.from(n.children);return s.addEventListener("input",()=>{var u;let c=s.value.trim().toLowerCase(),d=0;for(let p of l){let f=(u=p.getAttribute("data-atlas-provider"))!=null?u:"",m=c===""||mn(f).toLowerCase().includes(c)||f.toLowerCase().includes(c);p.toggleAttribute("hidden",!m),m&&(d+=1)}a.toggleAttribute("hidden",d!==0),n.dispatchEvent(new Event("scroll"))}),i.appendChild(s),i.appendChild(r),i.appendChild(a),i}function ku(e,t){var c;let n=(c=$(e).defaultView)!=null?c:typeof window!="undefined"?window:null,r=b(e,"div","atlas-embed-carousel"),o=d=>{let u=b(e,"button","atlas-embed-carousel-nav");return u.type="button",u.setAttribute("data-dir",d),u.setAttribute("aria-label",d==="prev"?"Scroll to previous sign-in options":"Scroll to more sign-in options"),u.innerHTML=d==="prev"?ka:_a,u.addEventListener("click",()=>{let p=Math.max(t.clientWidth*.8,140);typeof t.scrollBy=="function"&&t.scrollBy({left:(d==="prev"?-1:1)*p,behavior:"smooth"})}),u},i=o("prev"),s=o("next"),a=()=>{let d=t.scrollWidth-t.clientWidth,u=d>2;r.setAttribute("data-overflow",u?"true":"false"),i.disabled=!u||t.scrollLeft<=1,s.disabled=!u||t.scrollLeft>=d-1};t.addEventListener("scroll",a,{passive:!0});let l=n&&n.ResizeObserver;return l?new l(a).observe(t):n&&n.addEventListener("resize",a),n!=null&&n.requestAnimationFrame&&n.requestAnimationFrame(a),a(),r.appendChild(i),r.appendChild(t),r.appendChild(s),r}function Za(e,t,n="button"){var c;let{variant:r,labels:o}=e.social,i=mn(t),s=(c=o[t])!=null?c:r==="block"?`Continue with ${i}`:i,a=b(e,n,O(e,"socialButton","atlas-embed-social-button"));n==="button"&&(a.type="button"),a.setAttribute("data-atlas-provider",t),a.setAttribute("data-variant",r);let l=Ka(t);if(l){let d=$(e).createElement("span");d.className="atlas-embed-social-icon",d.innerHTML=l,a.appendChild(d)}if(r==="icon")a.setAttribute("aria-label",`Continue with ${i}`),a.setAttribute("title",i);else{let d=$(e).createElement("span");d.className="atlas-embed-social-label",d.textContent=s,a.appendChild(d)}return a}function _u(e,t){let n=Za(e,t);return n.addEventListener("click",()=>{ba.has(t)?(e.handlePrompt=t,F(e)):yn(e,t)}),n}function el(e,t){let n=mn(t),r=$(e).createElement("form");r.className="atlas-embed-form",r.setAttribute("novalidate","true");for(let l of e.state.errors.filter(c=>!c.param))r.appendChild(b(e,"div","atlas-embed-form-error",e.errorText(l)));let o=b(e,"label",O(e,"field","atlas-embed-field"));o.appendChild(b(e,"span",O(e,"label","atlas-embed-label"),`${n} handle`));let i=$(e).createElement("input");i.className=O(e,"input","atlas-embed-input"),i.type="text",i.name="identifier",i.placeholder="you.bsky.social",i.setAttribute("autocomplete","username"),i.setAttribute("autocapitalize","none"),i.setAttribute("spellcheck","false"),o.appendChild(i),r.appendChild(o);let s=Ee(e,Me[e.mode].submit);r.appendChild(s);let a=b(e,"button","atlas-embed-handle-back","Back");return a.type="button",a.addEventListener("click",()=>{e.handlePrompt=null,e.state={...e.state,errors:[]},F(e)}),r.appendChild(a),r.addEventListener("submit",l=>{l.preventDefault();let c=i.value.trim();if(!c){e.state={...e.state,errors:[{code:"validation_error",message:`Enter your ${n} handle.`}]},F(e);return}yn(e,t,c)}),r}function vu(e,t){let n=Za(e,"google","div");return n.setAttribute("role","button"),n.setAttribute("tabindex","0"),qi({wrapper:n,clientId:t,onCredential:r=>void Ta(e,"google",r),onError:()=>Qe(e,"Google sign-in could not start.")}).catch(()=>{n.addEventListener("click",()=>void yn(e,"google"))}),n}function tl(e){if(e.emailLinkPage===void 0){let t=So(void 0,e.mode==="sign-up"?"sign_up":"sign_in");e.emailLinkPage=t?Po(e.client,t):null,e.emailLinkPage&&(e.emailLinkPage.subscribe(()=>queueMicrotask(()=>F(e))),e.emailLinkPage.start())}return e.emailLinkPage}function nl(e,t){let{status:n,busy:r,errors:o,resetUrl:i}=t.state,s=b(e,"div","atlas-embed-email-link");if(s.setAttribute("data-atlas","email-link"),s.setAttribute("data-atlas-status",n),s.appendChild(b(e,"h1",O(e,"title","atlas-embed-title"),T(e,"link.title"))),n!=="needs_code"){let u=b(e,"p","atlas-embed-note",T(e,n==="confirmed"?"link.confirmed":n==="invalid"?"link.invalid":"link.checking"));if(u.setAttribute("role","status"),u.setAttribute("aria-live","polite"),s.appendChild(u),i){let p=b(e,"a","atlas-embed-step-back",T(e,"signIn.forgotPassword"));p.setAttribute("data-atlas-reset-link",""),p.href=i,s.appendChild(p)}return s}let a=b(e,"form","atlas-embed-form");a.appendChild(b(e,"p","atlas-embed-note",T(e,"link.enterCodeHelp")));let l=b(e,"label",O(e,"field","atlas-embed-field"));l.appendChild(b(e,"span",O(e,"label","atlas-embed-label"),T(e,"link.codeLabel")));let c=b(e,"input",O(e,"input","atlas-embed-input"));c.type="text",c.name="match_code",c.autocomplete="off",c.inputMode="numeric",c.required=!0,l.appendChild(c),a.appendChild(l);for(let u of o){let p=b(e,"p","atlas-embed-error",e.errorText(u));p.setAttribute("role","alert"),a.appendChild(p)}let d=Ee(e,T(e,"link.confirm"));return d.disabled=r,a.appendChild(d),a.addEventListener("submit",u=>{u.preventDefault(),t.submitCode(c.value)}),s.appendChild(a),s}function Qe(e,t){e.root.textContent="";let n=b(e,"div",O(e,"card","atlas-embed-card"));n.appendChild(b(e,"p","atlas-embed-note",t)),e.root.appendChild(n)}function rl(e){e.root.textContent="";let t=b(e,"div",O(e,"card","atlas-embed-card")),n=e.interaction.loading,r=b(e,"div","atlas-embed-loading");if(r.setAttribute("data-loading",n),r.setAttribute("role","status"),r.setAttribute("aria-label","Loading"),n==="skeleton")for(let i of["title","sub","input","input","button"])r.appendChild(b(e,"div",`atlas-embed-skel atlas-embed-skel-${i}`));else if(n==="dots")for(let i=0;i<3;i+=1)r.appendChild(b(e,"span","atlas-embed-dot"));else n==="bar"?r.appendChild(b(e,"span","atlas-embed-loadbar")):r.appendChild(b(e,"span","atlas-embed-spinner"));let o=b(e,"span","atlas-embed-sr","Loading\u2026");r.appendChild(o),t.appendChild(r),e.root.appendChild(t)}function _e(e,t){e.state={...e.state,errors:[...t]},F(e)}function F(e){var p,f,m,k,g,_,S,x,w,P;Ua(e);let t=Array.from(e.root.children).filter(C=>C.hasAttribute("data-atlas-policy-modal"));e.root.textContent="";for(let C of t)e.root.appendChild(C);let n=b(e,"div",O(e,"card","atlas-embed-card")),r=(f=(p=e.appearance)==null?void 0:p.logoUrl)!=null?f:null;if(r){let C=$(e).createElement("img");C.className="atlas-embed-logo",C.src=r,C.alt=(k=(m=e.appearance)==null?void 0:m.applicationName)!=null?k:"",n.appendChild(C)}let o=tl(e);if(o){n.setAttribute("data-step","email_link"),n.appendChild(nl(e,o)),e.root.appendChild(n);return}if(e.resetFlow){let C=`reset_${Ke(e.resetFlow)}`;if(n.setAttribute("data-step",C),C!==e.lastStepKind&&n.setAttribute("data-enter",""),e.lastStepKind=C,n.appendChild(Ba(e)),(g=e.appearance)!=null&&g.footer&&n.appendChild(b(e,"p",O(e,"footer","atlas-embed-footer"),e.appearance.footer)),e.root.appendChild(n),n.hasAttribute("data-enter")){let y=n.querySelector("[data-atlas-autofocus]");y instanceof HTMLElement&&y.focus()}return}let i=ot(e.state);if(i){n.setAttribute("data-step","recovery_codes"),e.lastStepKind!=="recovery_codes"&&n.setAttribute("data-enter",""),e.lastStepKind="recovery_codes",n.appendChild($a(e,i)),e.root.appendChild(n);return}if(qe(e.state)){n.setAttribute("data-step","existing_account"),e.lastStepKind!=="existing_account"&&n.setAttribute("data-enter",""),e.lastStepKind="existing_account",n.appendChild(ja(e)),e.root.appendChild(n);return}let s=e.state.attempt?ee(e.state.attempt):{kind:"collect_identifier"},a=e.mode==="sign-up"&&!e.state.attempt,l=a||s.kind==="collect_identifier",c=e.handlePrompt?"handle":s.kind;n.setAttribute("data-step",c),c!==e.lastStepKind&&n.setAttribute("data-enter",""),e.lastStepKind=c;let d=(S=(_=e.appearance)==null?void 0:_.headline)!=null?S:Me[e.mode].title;n.appendChild(b(e,"h1",O(e,"title","atlas-embed-title"),d));let u=l?null:xu(e,s.kind);if(u?n.appendChild(u):(x=e.appearance)!=null&&x.subheadline&&n.appendChild(b(e,"p",O(e,"subtitle","atlas-embed-subtitle"),e.appearance.subheadline)),e.flash&&n.appendChild(b(e,"div","atlas-embed-flash",e.flash)),e.handlePrompt){n.appendChild(el(e,e.handlePrompt)),(w=e.appearance)!=null&&w.footer&&n.appendChild(b(e,"p",O(e,"footer","atlas-embed-footer"),e.appearance.footer)),e.root.appendChild(n);return}if(l&&(Zr(e).length>0||e.signInWithAtlas.enabled)&&(n.appendChild(Xa(e)),n.appendChild(b(e,"div",O(e,"divider","atlas-embed-divider"),"or"))),n.appendChild(a?Wa(e):s.kind==="accept_policies"?za(e):Ha(e,s.kind)),l&&e.mode==="sign-in"&&e.passkeyEnabled&&ge()&&n.appendChild(Qa(e)),(P=e.appearance)!=null&&P.footer&&n.appendChild(b(e,"p",O(e,"footer","atlas-embed-footer"),e.appearance.footer)),e.root.appendChild(n),n.hasAttribute("data-enter")){let C=n.querySelector("[data-atlas-autofocus]");C instanceof HTMLElement&&C.focus()}}function xu(e,t){let n=e.enteredIdentifier,r=null,o=!1;switch(t){case"collect_email_code":if(He(e.state.attempt))return null;r=Ft(e.state.attempt,e.account.emailVerification)?"Check your email":n?`Enter the code we sent to ${n}`:"Enter the code we sent to your email",o=!0;break;case"collect_first_factor":if(He(e.state.attempt))return null;r=n?`Enter the password for ${n}`:"Enter your password",o=!0;break;case"collect_second_factor":r=e.backupCodeMode?"Enter one of your backup codes":"Enter the code from your authenticator app";break;case"collect_new_password":r="Choose a new password";break;case"enroll_second_factor":r=T(e,"mfa.enrollChoose");break;default:return null}let i=b(e,"div","atlas-embed-step-context");if(i.appendChild(b(e,"p",O(e,"subtitle","atlas-embed-subtitle"),r)),o){let s=b(e,"button","atlas-embed-step-back","Use a different email");s.type="button",s.addEventListener("click",()=>wu(e)),i.appendChild(s)}return i}function wu(e){e.state=X,e.backupCodeMode=!1,e.handlePrompt=null,e.enteredIdentifier=null,F(e)}var Xe=class{constructor(t,n){this.root=t;this.options=n;v(this,"client");v(this,"mode");v(this,"appearance",null);v(this,"design",null);v(this,"appliedDesign");v(this,"providers",[]);v(this,"nativeProviders",[]);v(this,"signInWithAtlas",{enabled:!1});v(this,"social",qr(void 0,void 0));v(this,"codeInputStyle","boxes");v(this,"interaction",gn(void 0,void 0));v(this,"backupCodeMode",!1);v(this,"policies",new Be([]));v(this,"pendingPolicies",null);v(this,"policyDispose",[]);v(this,"enrollment",null);v(this,"emailLinkPage");v(this,"secondFactorCode",null);v(this,"enteredIdentifier",null);v(this,"lastStepKind",null);v(this,"signUpFields",[]);v(this,"passwordEnabled",!0);v(this,"emailCodeEnabled",!1);v(this,"emailLinkEnabled",!1);v(this,"emailDeliveryAvailable",!0);v(this,"passkeyEnabled",!1);v(this,"passwordResetEnabled",!0);v(this,"passwordSignUpEnabled",!0);v(this,"conditionalAbort");v(this,"linkPoll",null);v(this,"heldResetAttempt",null);v(this,"account",{...vr});v(this,"rememberMeEnabled",!1);v(this,"remember",!0);v(this,"trustedDeviceEnabled",!1);v(this,"rememberDevice",!1);v(this,"captchaFlows",{});v(this,"captchaHost");v(this,"state",X);v(this,"resetFlow",null);v(this,"flash",null);v(this,"handlePrompt",null);v(this,"busy",!1);v(this,"recorder");var r,o,i;this.mode=(r=n.mode)!=null?r:"sign-in",this.interaction=gn(void 0,(o=n.appearance)==null?void 0:o.interaction),this.client=ue({publishableKey:n.publishableKey,frontendApi:n.frontendApi,fetchImpl:n.fetchImpl,locale:(i=n.locale)!=null?i:Ai(n.localization),referral:n.referral,referralConsent:n.referralConsent})}errorText(t){return Si(t,this.options.localization)}async mount(){var r,o,i,s,a,l,c,d,u,p,f,m,k,g,_,S,x,w,P,C,y,h,R,E,D,I,L,W,H,Q,tt;if(ha((r=this.root.ownerDocument)!=null?r:document),this.root.classList.add("atlas-embed-root"),this.options.locale&&!this.root.hasAttribute("lang")&&this.root.setAttribute("lang",this.options.locale),this.resolveDesign(null),this.applyTheme(),this.applyInteraction(),rl(this),qt(this.client).catch(()=>{}),await Ca(this))return;let n=await fa(this.client);if(n){this.appearance=n.appearance;let gl=(o=n.provider_scopes)!=null?o:{},oo=_n=>{let vn=gl[_n];return vn?this.mode==="sign-up"?vn.sign_up:vn.sign_in:!0};this.providers=ua((i=n.providers)!=null?i:[],n.appearance).filter(oo),this.nativeProviders=((s=n.native_providers)!=null?s:[]).filter(_n=>oo(_n.provider)),this.passwordEnabled=(l=(a=n.strategies)==null?void 0:a.password)!=null?l:!0,this.passkeyEnabled=(d=(c=n.strategies)==null?void 0:c.passkey)!=null?d:!1,this.emailCodeEnabled=(p=(u=n.strategies)==null?void 0:u.emailCode)!=null?p:!1,this.emailLinkEnabled=(m=(f=n.strategies)==null?void 0:f.emailLink)!=null?m:!1,this.passwordResetEnabled=(g=(k=n.email_delivery)==null?void 0:k.password_reset)!=null?g:!0,this.emailDeliveryAvailable=(S=(_=n.email_delivery)==null?void 0:_.available)!=null?S:!0,this.passwordSignUpEnabled=(w=(x=n.email_delivery)==null?void 0:x.password_sign_up)!=null?w:!0,this.account=xr(n),this.signInWithAtlas=(P=n.sign_in_with_atlas)!=null?P:{enabled:!1},this.rememberMeEnabled=n.rememberMe===!0,this.trustedDeviceEnabled=n.rememberDevice===!0,this.captchaFlows=(C=n.captchaFlows)!=null?C:{},await Gn(this.client)&&(this.captchaFlows=gs(this.captchaFlows)),this.resolveDesign(ea(n)),this.applyTheme()}this.social=qr(this.design?{...(y=this.appearance)==null?void 0:y.socialButtons,...this.design.socialButtons}:(h=this.appearance)==null?void 0:h.socialButtons,(R=this.options.appearance)==null?void 0:R.socialButtons),this.codeInputStyle=ra((E=this.appearance)==null?void 0:E.codeInput,(D=this.options.appearance)==null?void 0:D.codeInput),this.interaction=gn(this.design?{...(I=this.appearance)==null?void 0:I.interaction,...this.design.interaction}:(L=this.appearance)==null?void 0:L.interaction,(W=this.options.appearance)==null?void 0:W.interaction),this.applyInteraction(),this.signUpFields=(Q=(H=this.appearance)==null?void 0:H.signUpFields)!=null?Q:[],await Ma(this);try{this.recorder=new Tt((tt=this.root.ownerDocument)!=null?tt:document)}catch{}F(this),Ja(this)}applyTheme(){var r,o,i,s,a,l;let t=(o=(r=this.design)==null?void 0:r.tokens)!=null?o:sa(this.appearance,this.options.appearance),n=aa(t);for(let[c,d]of Object.entries(n))this.root.style.setProperty(c,d);this.root.style.setProperty("--atlas-embed-color-text-on-primary",la(t.colorPrimary)),this.root.style.setProperty("--atlas-embed-color-focus-ring",(a=(s=(i=this.options.appearance)==null?void 0:i.variables)==null?void 0:s.colorFocusRing)!=null?a:ca(t.colorPrimary,[t.colorCard,t.colorBackground])),this.design&&(this.appliedDesign=ta((l=this.root.ownerDocument)!=null?l:document,this.root,this.design.render,this.appliedDesign))}resolveDesign(t){var o,i,s;let n=(i=(o=this.root.ownerDocument)==null?void 0:o.defaultView)!=null?i:typeof window!="undefined"?window:null,r=!1;try{r=!!((s=n==null?void 0:n.matchMedia)!=null&&s.call(n,"(prefers-color-scheme: dark)").matches)}catch{}this.design=ya(t,this.options.appearance,{frontendApi:this.options.frontendApi,prefersDark:r})}applyInteraction(){let t=this.interaction;this.root.setAttribute("data-button-style",t.buttonStyle),this.root.setAttribute("data-button-effect",t.buttonEffect),this.root.setAttribute("data-shadow",t.shadow),this.root.setAttribute("data-density",t.density),this.root.setAttribute("data-input-style",t.inputStyle);let n=t.animations?ia[t.motionSpeed]:0;this.root.style.setProperty("--atlas-embed-motion",`${n}ms`)}};var le={};function ol(e){le=e}function Ze(){return le}function eo(e){if(!e)return{};let t=e.dataset,n={};return t.atlasKey&&(n.publishableKey=t.atlasKey),t.atlasFapi&&(n.frontendApi=t.atlasFapi),t.atlasRedirect&&(n.redirect=t.atlasRedirect),t.atlasLocale&&(n.locale=t.atlasLocale),n}function il(e,t){var f,m,k,g,_,S,x,w,P,C,y,h;let n=e.dataset,r=R=>{var E;return(E=e.getAttribute(R))!=null?E:void 0},o=(m=(f=n.atlasKey)!=null?f:r("publishable-key"))!=null?m:le.publishableKey,i=(g=(k=n.atlasFapi)!=null?k:r("frontend-api"))!=null?g:le.frontendApi,s=(S=(_=n.atlasRedirect)!=null?_:r("redirect"))!=null?S:le.redirect;if(!o||!i)return null;let a={publishableKey:o,frontendApi:i,mode:t};s&&(a.redirect=s);let l=(w=(x=n.atlasLocale)!=null?x:r("locale"))!=null?w:le.locale;l&&(a.locale=l);let c=(P=n.atlasPreset)!=null?P:r("preset");c&&(a.appearance={preset:c});let d=(C=n.atlasReferral)!=null?C:r("referral");(d==="off"||d==="false")&&(a.referral=!1);let u=(y=n.atlasReferralConsent)!=null?y:r("referral-consent");(u==="granted"||u==="denied")&&(a.referralConsent=u);let p=(h=n.atlasPasskeyPrf)!=null?h:r("passkey-prf");return p&&(a.passkeyPrf={eval:{first:p}}),a}function sl(e,t={}){var o,i,s,a,l;let n=(o=t.publishableKey)!=null?o:le.publishableKey,r=(i=t.frontendApi)!=null?i:le.frontendApi;return!n||!r?null:{...t,publishableKey:n,frontendApi:r,redirect:(s=t.redirect)!=null?s:le.redirect,...((a=t.locale)!=null?a:le.locale)?{locale:(l=t.locale)!=null?l:le.locale}:{},mode:e}}var kn=class extends HTMLElement{constructor(){super(...arguments);v(this,"widget",null)}connectedCallback(){if(this.widget)return;let n=il(this,this.mode);if(!n){this.textContent="Atlas: set data-atlas-key (publishable key) and data-atlas-fapi (frontend API origin).";return}this.widget=new Xe(this,n),this.widget.mount()}},to=class extends kn{constructor(){super(...arguments);v(this,"mode","sign-in")}},no=class extends kn{constructor(){super(...arguments);v(this,"mode","sign-up")}};function ro(){typeof customElements!="undefined"&&(customElements.get("atlas-sign-in")||customElements.define("atlas-sign-in",to),customElements.get("atlas-sign-up")||customElements.define("atlas-sign-up",no))}function Cu(e){let t=typeof e=="string"?document.querySelector(e):e;return t instanceof HTMLElement?t:null}function al(e,t,n){let r=Cu(t);if(!r)return null;let o=sl(e,n);if(!o)return r.textContent="Atlas: a publishable key and a frontend API origin are required to mount the widget.",null;let i=new Xe(r,o);return i.mount(),i}function ll(e,t={}){return al("sign-in",e,t)}function cl(e,t={}){return al("sign-up",e,t)}var G=(e,t={},...n)=>{let r=document.createElement(e);for(let[o,i]of Object.entries(t))r.setAttribute(o,i);for(let o of n)o!==null&&r.append(o);return r};function et(e,t,n){let r=G("ul",{class:"atlas-list"});for(let o of e){let i=G("li",{"data-id":o.id},o.text),s=G("button",{type:"button",class:"atlas-button-secondary"},t);s.addEventListener("click",()=>void n(o.id)),i.append(" ",s),r.append(i)}return r}function dl(e,t){var S,x,w;let n=typeof e=="string"?document.querySelector(e):e,r=Ze(),o=(S=t.publishableKey)!=null?S:r.publishableKey,i=(x=t.frontendApi)!=null?x:r.frontendApi;if(!n)return null;if(!o||!i)return n.textContent="Atlas: a publishable key and a frontend API origin are required.",null;let s=ue({publishableKey:o,frontendApi:i,locale:(w=t.locale)!=null?w:r.locale,fetchImpl:t.fetchImpl}),a=t.organizationId,l=null,c=null,d=null,u=!0,p=async P=>{try{await P(),d=null}catch(C){d=C instanceof Error?C.message:"The request failed."}await _()},f=P=>p(async()=>{var y,h;let C=await P();l=(h=(y=C.secret)!=null?y:C.token)!=null?h:null}),m=(P,C="text",y="")=>{let h=G("input",{type:C,placeholder:y,"aria-label":P});return[G("label",{class:"atlas-field"},G("span",{},P),h),h]},k=(P,C,y=!0)=>{let h=G("button",{type:"button",class:y?"atlas-button":"atlas-button-secondary"},P);return h.addEventListener("click",C),h};async function g(){var P,C;switch(t.section){case"domains":{let y=await z.listDomains(s,a),[h,R]=m("Email domain","text","acme.com");return[et(y.map(E=>({id:E.id,text:`${E.domain} \u2014 ${E.status}${E.status==="verified"?"":` (TXT ${E.verification.record_name} = ${E.verification.record_value})`}`})),"Remove",E=>p(()=>z.removeDomain(s,a,E))),...y.filter(E=>E.status!=="verified").map(E=>k(`Verify ${E.domain}`,()=>void p(()=>z.verifyDomain(s,a,E.id)),!1)),h,k("Add domain",()=>void p(()=>z.addDomain(s,a,R.value.trim())))]}case"logStreams":{let y=await z.listLogStreams(s,a),[h,R]=m("HTTPS endpoint","url","https://siem.example.com/ingest");return[et(y.map(E=>({id:E.id,text:E.url})),"Remove",E=>p(()=>z.removeLogStream(s,a,E))),h,k("Add destination",()=>void f(()=>z.addLogStream(s,a,{url:R.value.trim()})))]}case"apiKeys":{let y=await z.listApiKeys(s,a),[h,R]=m("Key name");return[et(y.map(E=>{var D;return{id:E.id,text:`${(D=E.name)!=null?D:E.prefix} (${E.prefix})`}}),"Revoke",E=>p(()=>z.revokeApiKey(s,a,E))),h,k("Create key",()=>void f(()=>z.createApiKey(s,a,{name:R.value.trim()||void 0})))]}case"webhooks":{let y=await z.listWebhooks(s,a),[h,R]=m("HTTPS endpoint","url","https://example.com/hooks/atlas");return[et(y.map(E=>({id:E.id,text:`${E.url} \u2014 ${E.health}`})),"Remove",E=>p(()=>z.deleteWebhook(s,a,E))),h,k("Add endpoint",()=>void f(()=>z.createWebhook(s,a,{url:R.value.trim()})))]}case"appWebhooks":{let[y,h]=await Promise.all([z.listAppWebhooks(s,a),z.listAppEventTypes(s,a)]),[R,E]=m("HTTPS endpoint","url","https://example.com/webhooks"),D=h.map(L=>{let W=G("input",{type:"checkbox",value:L.type,"aria-label":L.type});return{box:W,el:G("label",{class:"atlas-text"},W,` ${L.type}${L.description?` \u2014 ${L.description}`:""}`)}}),I=[];for(let L of y){let W=G("li",{"data-id":L.id,"data-health":L.health},`${L.url} \u2014 ${L.health} \u2014 ${L.enabled_events.includes("*")?"all events":L.enabled_events.join(", ")} `);if(W.append(k("Send test",()=>void p(async()=>{var Q;let H=await z.testAppWebhook(s,a,L.id);if(H.status!=="success")throw new Error(`Test failed: ${(Q=H.error)!=null?Q:`HTTP ${H.http_status}`}`)}),!1),L.active?k("Pause",()=>void p(()=>z.updateAppWebhook(s,a,L.id,{active:!1})),!1):k("Enable",()=>void p(async()=>{await z.updateAppWebhook(s,a,L.id,{active:!0}),L.health!=="healthy"&&await z.replayAppWebhook(s,a,L.id)}),!1),k("Reveal secret",()=>void f(()=>z.revealAppWebhookSecret(s,a,L.id)),!1),k("Rotate secret",()=>void f(()=>z.rotateAppWebhookSecret(s,a,L.id)),!1),k("Deliveries",()=>{c=c===L.id?null:L.id,_()},!1),k("Remove",()=>void p(()=>z.deleteAppWebhook(s,a,L.id)),!1)),c===L.id){let H=await z.appWebhookDeliveries(s,a,L.id);W.append(et(H.map(Q=>{var tt;return{id:Q.id,text:`${(tt=Q.event_type)!=null?tt:"\u2014"} \xB7 ${Q.status}${Q.http_status?` \xB7 HTTP ${Q.http_status}`:""} \xB7 ${new Date(Q.created_at).toLocaleString()}`}}),"Redeliver",Q=>p(()=>z.redeliverAppWebhook(s,a,L.id,Q))))}I.push(W)}return[G("ul",{class:"atlas-list"},...I),R,G("fieldset",{class:"atlas-field"},G("legend",{},"Events (none selected = all)"),...D.map(L=>L.el)),k("Add endpoint",()=>{let L=D.filter(W=>W.box.checked).map(W=>W.box.value);f(()=>z.createAppWebhook(s,a,{url:E.value.trim(),enabled_events:L.length?L:["*"]}))})]}case"directory":{let y=await z.getDirectory(s,a);return[G("p",{},`SCIM base URL: ${y.base_url}`),et(y.tokens.map(h=>({id:h.id,text:h.prefix})),"Revoke",h=>p(()=>z.revokeDirectoryToken(s,a,h))),k("Generate token",()=>void f(()=>z.createDirectoryToken(s,a)))]}case"ipAllowlist":{let y=await z.getIpAllowlist(s,a),h=G("textarea",{rows:"5","aria-label":"Sign-in IP allowlist"});return h.value=y.entries.join(`
|
|
414
|
+
`),[G("p",{},`One IP or CIDR per line; empty allows anywhere. Your IP: ${y.your_ip}`),h,k("Save",()=>void p(()=>z.setIpAllowlist(s,a,h.value.split(/[\s,]+/).filter(Boolean))))]}case"sso":{let y=await z.getSso(s,a),h=(C=(P=y.connection)==null?void 0:P.type)!=null?C:"oidc",E=(h==="oidc"?[["oidc_issuer","Issuer URL","text"],["oidc_client_id","Client ID","text"],["oidc_client_secret","Client secret","password"]]:[["saml_metadata_xml","IdP metadata XML","text"],["saml_idp_certificate","IdP certificate (PEM)","text"]]).map(([D,I,L])=>{let[W,H]=m(I,L);return{key:D,l:W,f:H}});return[G("p",{},y.connection?`${y.connection.type.toUpperCase()} \u2014 ${y.connection.status}`:"No connection yet."),G("p",{},`ACS URL: ${y.sp.acs_url} \xB7 Redirect URI: ${y.sp.oidc_redirect_uri}`),...E.map(D=>D.l),k("Save connection",()=>{let D={};for(let I of E)I.f.value&&(D[I.key]=I.f.value);p(()=>z.saveSso(s,a,{type:h,...D}))})]}}}async function _(){if(!u)return;let P;try{P=await g()}catch(y){let h=y.status;n.replaceChildren(...h===403||h===404?[]:[G("p",{role:"alert"},y instanceof Error?y.message:"The request failed.")]);return}let C=[];d&&C.push(G("p",{role:"alert"},d)),l&&C.push(G("p",{"data-atlas":"one-time-secret"},"Copy this now \u2014 it will not be shown again: ",G("code",{},l))),n.dataset.atlas=`organization-admin-${t.section}`,n.replaceChildren(...C,...P)}return _(),{destroy(){u=!1,n.replaceChildren()}}}var te=(e,t={},...n)=>{let r=document.createElement(e);for(let[o,i]of Object.entries(t))r.setAttribute(o,i);for(let o of n)o!==null&&r.append(o);return r};function ul(e,t={}){var f,m,k,g;let n=typeof e=="string"?document.querySelector(e):e,r=Ze(),o=(f=t.publishableKey)!=null?f:r.publishableKey,i=(m=t.frontendApi)!=null?m:r.frontendApi;if(!n)return null;if(!o||!i)return n.textContent="Atlas: a publishable key and a frontend API origin are required.",null;let s=ue({publishableKey:o,frontendApi:i,locale:(k=t.locale)!=null?k:r.locale,fetchImpl:t.fetchImpl}),a={monthly:"Monthly",yearly:"Yearly",perMonth:"month",perYear:"year",free:"Free",subscribe:"Subscribe",trial:_=>`${_}-day free trial`,useCode:_=>`Use code ${_} at checkout`,...t.labels},l=(g=t.locale)!=null?g:document.documentElement.lang||void 0,c="month",d=[],u=!0,p=()=>{if(!u)return;let _=[];if(d.some(S=>S.annual_available)){let S=te("div",{role:"group","aria-label":"Billing interval","data-atlas":"pricing-interval"});for(let x of["month","year"]){let w=te("button",{type:"button",class:"atlas-button-secondary","aria-pressed":String(c===x)},x==="month"?a.monthly:a.yearly);w.addEventListener("click",()=>{c=x,p()}),S.append(w)}_.push(S)}for(let S of d){let x=Xi(S,{interval:c,locale:l}),w=te("p",{class:"atlas-price"});x.originalPrice&&w.append(te("s",{"data-atlas":"pricing-original"},x.originalPrice)," "),w.append(x.free?a.free:x.price),x.free||w.append(te("span",{class:"atlas-interval"},` / ${x.interval==="year"?a.perYear:a.perMonth}`));let P=te("button",{type:"button",class:"atlas-button"},a.subscribe);P.addEventListener("click",async()=>{var y,h,R,E;let C=await es(s,{planId:S.id,orgId:t.organizationId,...S.annual_available?{interval:c}:{},successUrl:(y=t.successUrl)!=null?y:window.location.href});C.url?((h=t.navigate)!=null?h:D=>window.location.assign(D))(C.url):(E=t.onError)==null||E.call(t,(R=C.error)!=null?R:"Could not start checkout.")}),_.push(te("div",{class:"atlas-card","data-atlas":"pricing-plan"},te("h3",{class:"atlas-plan-name"},S.name),x.promotionLabel?te("p",{"data-atlas":"pricing-promotion",class:"atlas-badge"},x.promotionLabel):null,w,x.trialDays?te("p",{"data-atlas":"pricing-trial",class:"atlas-badge"},a.trial(x.trialDays)):null,x.promotionCode?te("p",{"data-atlas":"pricing-code"},a.useCode(x.promotionCode)):null,S.features.length?te("ul",{class:"atlas-list"},...S.features.map(C=>te("li",{},C))):null,P))}n.dataset.atlas="pricing-table",n.replaceChildren(..._)};return Zi(s,{audience:t.audience}).then(_=>{d=_,p()}),{destroy(){u=!1,n.replaceChildren()}}}var pe=(e,t={},...n)=>{let r=document.createElement(e);for(let[o,i]of Object.entries(t))r.setAttribute(o,i);for(let o of n)o!==null&&r.append(o);return r};function pl(e,t={}){var S,x,w;let n=typeof e=="string"?document.querySelector(e):e,r=Ze(),o=(S=t.publishableKey)!=null?S:r.publishableKey,i=(x=t.frontendApi)!=null?x:r.frontendApi;if(!n)return null;if(!o||!i)return n.textContent="Atlas: a publishable key and a frontend API origin are required.",null;let s=ue({publishableKey:o,frontendApi:i,locale:(w=t.locale)!=null?w:r.locale,fetchImpl:t.fetchImpl});qt(s).catch(()=>{});let a={email:"Email address",name:"Name",submit:"Subscribe",consent:"I agree to receive emails",thanks:"Thanks \u2014 you are on the list.",invalid:"Enter a valid email address.",failed:"Could not subscribe. Try again.",...t.labels},l=pe("form",{class:"atlas-card","data-atlas":"lead-form",novalidate:"true"}),c=(P,C,y,h)=>{let R=pe("input",{class:"atlas-input",type:y,name:C,autocomplete:h});return[pe("label",{class:"atlas-field"},pe("span",{class:"atlas-field-label"},P),R),R]},[d,u]=c(a.name,"name","text","name"),[p,f]=c(a.email,"email","email","email"),m=pe("input",{type:"checkbox"}),k=pe("input",{name:"website","aria-hidden":"true",tabindex:"-1",autocomplete:"off",style:"position:absolute;left:-10000px;width:1px;height:1px;opacity:0"}),g=pe("p",{class:"atlas-error",role:"alert"});g.hidden=!0;let _=pe("button",{class:"atlas-button",type:"submit"},a.submit);return t.showName&&l.append(d),l.append(p),t.requireConsent&&(_.disabled=!0,m.addEventListener("change",()=>{_.disabled=!m.checked}),l.append(pe("label",{class:"atlas-field"},m,` ${a.consent}`))),l.append(k,g,_),l.addEventListener("submit",async P=>{var h,R;P.preventDefault();let C=f.value.trim();if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(C)){g.textContent=a.invalid,g.hidden=!1;return}_.disabled=!0,g.hidden=!0;let y=await ss(s,{email:C,name:u.value.trim()||void 0,form:t.form,consent:m.checked,website:k.value});y.ok?(n.replaceChildren(pe("div",{class:"atlas-card","data-atlas":"lead-form",role:"status"},a.thanks)),(h=t.onSubmitted)==null||h.call(t,C)):(_.disabled=t.requireConsent?!m.checked:!1,g.textContent=(R=y.error)!=null?R:a.failed,g.hidden=!1)}),n.replaceChildren(l),{destroy:()=>n.replaceChildren()}}function fl(){var t;let e=document.currentScript;return e instanceof HTMLScriptElement?e:(t=document.querySelector("script[data-atlas-key]"))!=null?t:document.querySelector('script[src*="embed.js"]')}function Su(){var t;ol(eo(fl())),ro();let e=eo(fl());e.publishableKey&&e.frontendApi&&ue({publishableKey:e.publishableKey,frontendApi:e.frontendApi,locale:e.locale}),window.Atlas=Object.assign((t=window.Atlas)!=null?t:{},{mountSignIn:ll,mountSignUp:cl,mountOrganizationAdmin:dl,mountPricingTable:ul,mountLeadForm:pl,defineElements:ro})}Su();})();
|