@atlasauth/embed 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/embed.js +30 -7
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/widget/flow.js +23 -4
- package/dist/widget/flow.js.map +1 -1
- package/dist/widget/forms.js +28 -4
- package/dist/widget/forms.js.map +1 -1
- package/dist/widget/policies.d.ts +29 -0
- package/dist/widget/policies.js +118 -0
- package/dist/widget/policies.js.map +1 -0
- package/dist/widget/render.js +11 -1
- package/dist/widget/render.js.map +1 -1
- package/dist/widget.d.ts +10 -1
- package/dist/widget.js +8 -0
- package/dist/widget.js.map +1 -1
- package/package.json +2 -2
package/dist/embed.js
CHANGED
|
@@ -1,18 +1,41 @@
|
|
|
1
|
-
"use strict";(()=>{var Vs=Object.create;var Pt=Object.defineProperty;var Gs=Object.getOwnPropertyDescriptor;var Ys=Object.getOwnPropertyNames;var Js=Object.getPrototypeOf,Zs=Object.prototype.hasOwnProperty;var Xs=(e,t,n)=>t in e?Pt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Tt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Qs=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Ys(t))!Zs.call(e,o)&&o!==n&&Pt(e,o,{get:()=>t[o],enumerable:!(r=Gs(t,o))||r.enumerable});return e};var ea=(e,t,n)=>(n=e!=null?Vs(Js(e)):{},Qs(t||!e||!e.__esModule?Pt(n,"default",{value:e,enumerable:!0}):n,e));var h=(e,t,n)=>Xs(e,typeof t!="symbol"?t+"":t,n);var po=Tt(ce=>{"use strict";Object.defineProperty(ce,"__esModule",{value:!0});ce.ForbiddenError=void 0;ce.evaluate=dn;ce.hasFromClaims=_i;ce.protectFromClaims=xi;function vi(e){return e.permission!==void 0||e.role!==void 0||e.anyPermission!==void 0||e.allPermissions!==void 0}function dn(e,t={}){var o,s,a,l;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((s=e.app_permissions)!=null?s:[]);if(t.appRole!==void 0&&!((a=e.app_roles)!=null?a:[]).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(i=>n.has(i)))return{allowed:!1,reason:"missing_permission"};if(t.allAppPermissions&&!t.allAppPermissions.every(i=>n.has(i)))return{allowed:!1,reason:"missing_permission"};if(!vi(t))return{allowed:!0};if(!e.org_id)return{allowed:!1,reason:"no_organization"};let r=new Set((l=e.org_permissions)!=null?l:[]);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(i=>r.has(i))?{allowed:!1,reason:"missing_permission"}:t.allPermissions&&!t.allPermissions.every(i=>r.has(i))?{allowed:!1,reason:"missing_permission"}:{allowed:!0}}function _i(e,t={}){return dn(e,t).allowed}var tt=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.");h(this,"reason");h(this,"condition");this.name="ForbiddenError",this.reason=n,this.condition=r}};ce.ForbiddenError=tt;function xi(e,t={}){let n=dn(e,t);if(!n.allowed)throw new tt(n.reason,t)}});var fo=Tt(K=>{"use strict";Object.defineProperty(K,"__esModule",{value:!0});K.PERMISSION_KEY_PATTERN=K.ROLE_KEY_PATTERN=void 0;K.isRoleKey=wi;K.isPermissionKey=Si;K.ROLE_KEY_PATTERN=/^org:[a-z][a-z0-9_]{1,31}$/;K.PERMISSION_KEY_PATTERN=/^org:[a-z][a-z0-9_]{1,31}:[a-z][a-z0-9_]{1,31}$/;function wi(e){return K.ROLE_KEY_PATTERN.test(e)}function Si(e){return K.PERMISSION_KEY_PATTERN.test(e)}});var go=Tt(U=>{"use strict";Object.defineProperty(U,"__esModule",{value:!0});U.isPermissionKey=U.isRoleKey=U.PERMISSION_KEY_PATTERN=U.ROLE_KEY_PATTERN=U.ForbiddenError=U.protectFromClaims=U.hasFromClaims=U.evaluate=void 0;var nt=po();Object.defineProperty(U,"evaluate",{enumerable:!0,get:function(){return nt.evaluate}});Object.defineProperty(U,"hasFromClaims",{enumerable:!0,get:function(){return nt.hasFromClaims}});Object.defineProperty(U,"protectFromClaims",{enumerable:!0,get:function(){return nt.protectFromClaims}});Object.defineProperty(U,"ForbiddenError",{enumerable:!0,get:function(){return nt.ForbiddenError}});var rt=fo();Object.defineProperty(U,"ROLE_KEY_PATTERN",{enumerable:!0,get:function(){return rt.ROLE_KEY_PATTERN}});Object.defineProperty(U,"PERMISSION_KEY_PATTERN",{enumerable:!0,get:function(){return rt.PERMISSION_KEY_PATTERN}});Object.defineProperty(U,"isRoleKey",{enumerable:!0,get:function(){return rt.isRoleKey}});Object.defineProperty(U,"isPermissionKey",{enumerable:!0,get:function(){return rt.isPermissionKey}})});var El=30*24*60*60*1e3;function Bn(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 Wn(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 z(e){var t,n;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"complete":return{kind:"done",sessionId:(n=e.created_session_id)!=null?n:null};case"abandoned":return{kind:"restart",reason:"abandoned"};default:return{kind:"unknown",status:e.status}}}function Hn(e){return e.status==="complete"||e.status==="abandoned"}function jn(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 s=n.meta;return s&&typeof s=="object"&&!Array.isArray(s)&&(r.meta=s),r}):[]}function He(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 Yl=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","waitlisted","identifier_not_allowed","disposable_email_blocked","sso_required","sign_ins_disabled","sign_ups_disabled","high_risk_blocked","sms_region_blocked"]);function ta(e){return`error.${e}`}var na="Something went wrong. Please try again.",ra=/^[a-z][a-z0-9_]{0,63}$/;function oa(e,t){let n=!0,r=e.replace(/\{(\w+)\}/g,(o,s)=>{let a=t&&Object.prototype.hasOwnProperty.call(t,s)?t[s]:void 0;return typeof a=="string"&&a!==""?a:typeof a=="number"&&Number.isFinite(a)?String(a):(n=!1,o)});return n?r:null}function It(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 Kn(e,t,n){var s,a;let r=typeof e=="string"?{message:e}:e!=null?e:{},o=typeof r.reason=="string"?r.reason:"";if(o&&ra.test(o)){let l=It(t,ta(o)),i=l?oa(l,r.meta):null;if(i)return i}return typeof r.message=="string"&&r.message.trim()!==""?r.message:(a=(s=It(t,"error.generic"))!=null?s:It(n,"error.generic"))!=null?a:na}function qn(e){if(!e||typeof e!="object")return;let t=e.locale;return typeof t=="string"&&t.trim()!==""?t:void 0}var Ot="atlas:oauth",sa="atlas_popup_result",Vn="atlas:oauth";function aa(e){return`${Vn}:${e}`}function Gn(){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 ia(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 la(e){var t;try{return(t=Bn(e))!=null?t:Wn(e)}catch{return null}}function Yn(e,t,n){let r=la(e);if(!r)return Promise.resolve(!1);let o=Gn();return new Promise(s=>{let a=!1,l=d=>{a||(a=!0,clearTimeout(c),i(),r.close(),s(d))},i=r.subscribe(d=>{ia(d)&&d.type==="atlas:oauth:ack"&&d.id===o&&l(!0)}),c=setTimeout(()=>l(!1),n);try{r.post({...t,id:o})}catch{l(!1)}})}function ca(e){if(!e||e.length<2)return null;let t=new URLSearchParams(e.replace(/^#/,"")).get(sa);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,l=>l.charCodeAt(0)),s=JSON.parse(new TextDecoder().decode(o));if(!s||typeof s!="object")return null;let a=s;return a.v!==1||typeof a.n!="string"||!a.n||typeof a.type!="string"||!a.type.startsWith("atlas:oauth:")?null:{nonce:a.n,payload:a}}catch{return null}}async function Jn(e={}){var o,s;let t=(o=e.win)!=null?o:typeof window!="undefined"?window:void 0;if(!t)return null;let n=ca(t.location.hash);if(!n)return null;try{t.history.replaceState(t.history.state,"",t.location.href.split("#")[0])}catch{}try{t.name=Ot}catch{}let r=await Yn(aa(n.nonce),{type:"atlas:oauth:result",result:n.payload},(s=e.ackTimeoutMs)!=null?s:1500);return r&&Xn(t),{payload:n.payload,delivered:r}}async function Zn(e={}){var o,s;let t=(o=e.win)!=null?o:typeof window!="undefined"?window:void 0;if(!t||t.name!==Ot)return!1;let n=await Yn(Vn,{type:"atlas:oauth:signed_in"},(s=e.ackTimeoutMs)!=null?s:1500),r=!1;try{r=!!t.opener&&!t.opener.closed}catch{r=!1}return!n&&!r?!1:(Xn(t),!0)}function Xn(e){try{e.close()}catch{}}var da=["__atlas_attempt","__atlas_ticket","__atlas_status"];function Qn(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)};default:return null}}var tc=5*6e4;function er(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");return!r&&!o?null:{attemptId:n,...r?{ticket:r}:{},...o?{status:o}:{}}}function je(e){let t=new URL(e);for(let n of da)t.searchParams.delete(n);return t.toString()}var tr="0.17.0";var rr={name:"@atlasauth/js",version:tr},or="x-atlas-sdk",ua="atlas-sdk-advisory";function sr(e){return`${e.name}/${e.version}`}function pa(e){return typeof e!="string"||!e.trim()?[]:e.split(",").map(t=>{let[n,...r]=t.split(";").map(s=>s.trim()),o=s=>{var a,l;return(l=(a=r.find(i=>i.startsWith(`${s}=`)))==null?void 0:a.slice(s.length+1))!=null?l:null};return{action:n!=null?n:"",min:o("min"),reason:o("reason")}}).filter(t=>t.action!=="")}var nr=new Set;function ar(e,t,n=fa){var s,a,l,i,c;let r=null;try{r=(l=(a=(s=e==null?void 0:e.headers)==null?void 0:s.get)==null?void 0:a.call(s,ua))!=null?l:null}catch{return[]}let o=[];for(let d of pa(r)){let u=`${t.name}|${(i=d.reason)!=null?i:""}|${(c=d.min)!=null?c:""}`;nr.has(u)||(nr.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 fa(e){typeof console!="undefined"&&console.warn(e)}var fe="__atlas_dev_session:",ir="/v1/client/tickets/exchange",lr="/v1/client",cr=/^\/v1\/client\/sessions\/[^/]+\/tokens$/,ga=/^\/v1\/client\/sessions\/[^/]+\/revoke$/;function ie(){try{let e=globalThis.localStorage;return e&&typeof e.getItem=="function"?e:null}catch{return null}}function fr(e){return e.startsWith("pk_test_")&&ie()!==null}function gr(e){var t,n;try{return(n=(t=ie())==null?void 0:t.getItem(fe+e))!=null?n:null}catch{return null}}var Dt=":sid";function dr(e,t,n){var r,o;if(!(typeof t!="string"||!t))try{(r=ie())==null||r.setItem(fe+e,t),typeof n=="string"&&n&&((o=ie())==null||o.setItem(fe+e+Dt,n))}catch{}}function ma(e){var t,n;try{return(n=(t=ie())==null?void 0:t.getItem(fe+e+Dt))!=null?n:null}catch{return null}}function Ke(e){var t,n;try{(t=ie())==null||t.removeItem(fe+e),(n=ie())==null||n.removeItem(fe+e+Dt)}catch{}}function ha(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 ur(e){let t=/^\/v1\/client\/sessions\/([^/]+)\//.exec(e);return t?decodeURIComponent(t[1]):null}async function Lt(e){try{let t=await e.clone().json();return t&&typeof t=="object"&&!Array.isArray(t)?t:null}catch{return null}}var pr=Symbol.for("atlas.devBrowser");function Ft(e,t){if(!e.startsWith("pk_test_")||t[pr])return t;let n=async(r,o)=>{var u,f;if(!fr(e))return t(r,o);let s=ha(r),a=((u=o==null?void 0:o.method)!=null?u:"GET").toUpperCase(),l=o,i=!1;if(s===ir&&a==="POST"&&typeof(o==null?void 0:o.body)=="string")try{let p=JSON.parse(o.body);p&&typeof p=="object"&&!Array.isArray(p)&&(l={...o,body:JSON.stringify({...p,return_refresh_token:!0})})}catch{}let c=gr(e);if(c&&(s===lr&&a==="GET"||s&&cr.test(s)&&a==="POST")){let p=new Headers(l==null?void 0:l.headers);p.has("x-refresh-token")||p.set("x-refresh-token",c),l={...l,headers:p},i=!0}let d=await t(r,l);if(!s)return d;if(s===ir&&d.ok){let p=await Lt(d);dr(e,p==null?void 0:p.refresh_token,p==null?void 0:p.id)}else if(s&&cr.test(s))d.ok?dr(e,(f=await Lt(d))==null?void 0:f.refresh_token,ur(s)):i&&d.status===401&&Ke(e);else if(s===lr&&i&&d.ok){let p=await Lt(d);p&&p.session===null&&Ke(e)}else if(s&&ga.test(s)&&(d.ok||d.status===404)){let p=ma(e);(!p||p===ur(s))&&Ke(e)}return d};return n[pr]=!0,n}function Mt(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}}async function ba(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 s=l=>typeof l=="string"&&l?l:void 0,a={strategy:n.strategy,factorId:o.factor_id};if(n.strategy==="totp"){s(o.secret)&&(a.secret=s(o.secret)),s(o.uri)&&(a.uri=s(o.uri));let l=s(o.qr_code);l&&/^data:image\//.test(l)&&(a.qrCode=l)}else s(o.phone)&&(a.phone=s(o.phone));return{enrollment:a,errors:[],status:r.status}}function mr(e){return e.replace(/\s+/g,"").replace(/(.{4})(?=.)/g,"$1 ")}function ya(e,t){return t===409?!0:e.some(n=>n.code==="STRATEGY_DISABLED"||n.param==="strategy")}function hr(e,t){let n=()=>typeof t=="function"?t():t,r=p=>{let m=[];return p.totp&&m.push("totp"),p.sms&&m.push("phone_code"),m.length?m:["totp"]},o=()=>{let p=n();return{options:r(p),method:null,enrollment:null,busy:!1,errors:[],totpCodes:p.totpCodes}},s=o(),a=null,l="",i=0,c=new Set,d=p=>{s={...s,...p};for(let m of c)m(s)},u=async p=>{let m=a;if(!m)return;let b=i;d({busy:!0,errors:[]});let y=await ba(e,m,p);if(b===i){if(y.enrollment){d({busy:!1,enrollment:y.enrollment,errors:[]});return}if(ya(y.errors,y.status)&&s.options.length>1){let A=s.options.filter(E=>E!==p.strategy);d({busy:!1,options:A,method:null,enrollment:null,errors:y.errors}),A.length===1&&await f.choose(A[0]);return}d({busy:!1,errors:y.errors})}},f={get state(){return s},subscribe(p){return c.add(p),()=>c.delete(p)},start(p){p!==a&&(i+=1,a=p,l="",s=o(),d({}),s.options.length===1&&f.choose(s.options[0]))},async choose(p){s.options.includes(p)&&(d({method:p,enrollment:null,errors:[]}),p==="totp"&&await u({strategy:"totp"}))},async sendPhone(p){let m=p.trim();if(!m){d({errors:[{code:"FORM_PARAM_MISSING",message:"A phone number is required.",param:"phone"}]});return}l=m,await u({strategy:"phone_code",phone:m})},async resend(){s.method==="phone_code"&&l&&await u({strategy:"phone_code",phone:l})},async submit(p){var y,A,E,v;if(s.method==="phone_code"&&!s.enrollment)return await f.sendPhone((y=p.phone)!=null?y:""),null;let m=s.enrollment;return m?m.strategy==="phone_code"?{factorId:m.factorId,enrollStrategy:"phone_code",code:(A=p.code)!=null?A:""}:{factorId:m.factorId,code:(E=p.code)!=null?E:"",secondCode:(v=p.secondCode)!=null?v:""}:null},reset(){i+=1,a=null,l="",s=o(),d({})}};return f}function br(e){return e.method===null?null:e.method==="phone_code"&&!e.enrollment?"mfa.sendCode":e.enrollment?"signIn.submit":null}async function yr(e,t,n){var o,s;let r=await e.post(`/v1/client/sign_ins/${encodeURIComponent(t)}/prepare_second_factor`,{strategy:n});if(!r.ok){let a=r.errors[0],l=new Error((o=a==null?void 0:a.message)!=null?o:"Could not send the code.");throw a!=null&&a.code&&(l.code=a.code),l}return{sentTo:typeof((s=r.data)==null?void 0:s.sent_to)=="string"?r.data.sent_to:""}}function kr(e){if(!Array.isArray(e))return null;let t=e.filter(n=>typeof n=="string"&&n.length>0);return t.length?t:null}function Ce(e){var t;return((t=e.attempt)==null?void 0:t.status)!=="complete"?null:e.recoveryCodes&&e.recoveryCodes.length?e.recoveryCodes:null}function vr(e){return{...e,recoveryCodes:null}}function ka(e){return`${e.join(`
|
|
1
|
+
"use strict";(()=>{var Ts=Object.create;var Mt=Object.defineProperty;var Is=Object.getOwnPropertyDescriptor;var Os=Object.getOwnPropertyNames;var Ls=Object.getPrototypeOf,Ds=Object.prototype.hasOwnProperty;var Fs=(e,t,n)=>t in e?Mt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ut=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ms=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Os(t))!Ds.call(e,o)&&o!==n&&Mt(e,o,{get:()=>t[o],enumerable:!(r=Is(t,o))||r.enumerable});return e};var Us=(e,t,n)=>(n=e!=null?Ts(Ls(e)):{},Ms(t||!e||!e.__esModule?Mt(n,"default",{value:e,enumerable:!0}):n,e));var k=(e,t,n)=>Fs(e,typeof t!="symbol"?t+"":t,n);var Ko=Ut(pe=>{"use strict";Object.defineProperty(pe,"__esModule",{value:!0});pe.ForbiddenError=void 0;pe.evaluate=Rn;pe.hasFromClaims=yl;pe.protectFromClaims=bl;function hl(e){return e.permission!==void 0||e.role!==void 0||e.anyPermission!==void 0||e.allPermissions!==void 0}function Rn(e,t={}){var o,i,s,l;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(a=>n.has(a)))return{allowed:!1,reason:"missing_permission"};if(t.allAppPermissions&&!t.allAppPermissions.every(a=>n.has(a)))return{allowed:!1,reason:"missing_permission"};if(!hl(t))return{allowed:!0};if(!e.org_id)return{allowed:!1,reason:"no_organization"};let r=new Set((l=e.org_permissions)!=null?l:[]);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(a=>r.has(a))?{allowed:!1,reason:"missing_permission"}:t.allPermissions&&!t.allPermissions.every(a=>r.has(a))?{allowed:!1,reason:"missing_permission"}:{allowed:!0}}function yl(e,t={}){return Rn(e,t).allowed}var at=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.");k(this,"reason");k(this,"condition");this.name="ForbiddenError",this.reason=n,this.condition=r}};pe.ForbiddenError=at;function bl(e,t={}){let n=Rn(e,t);if(!n.allowed)throw new at(n.reason,t)}});var qo=Ut(G=>{"use strict";Object.defineProperty(G,"__esModule",{value:!0});G.PERMISSION_KEY_PATTERN=G.ROLE_KEY_PATTERN=void 0;G.isRoleKey=kl;G.isPermissionKey=vl;G.ROLE_KEY_PATTERN=/^org:[a-z][a-z0-9_]{1,31}$/;G.PERMISSION_KEY_PATTERN=/^org:[a-z][a-z0-9_]{1,31}:[a-z][a-z0-9_]{1,31}$/;function kl(e){return G.ROLE_KEY_PATTERN.test(e)}function vl(e){return G.PERMISSION_KEY_PATTERN.test(e)}});var Vo=Ut(N=>{"use strict";Object.defineProperty(N,"__esModule",{value:!0});N.isPermissionKey=N.isRoleKey=N.PERMISSION_KEY_PATTERN=N.ROLE_KEY_PATTERN=N.ForbiddenError=N.protectFromClaims=N.hasFromClaims=N.evaluate=void 0;var lt=Ko();Object.defineProperty(N,"evaluate",{enumerable:!0,get:function(){return lt.evaluate}});Object.defineProperty(N,"hasFromClaims",{enumerable:!0,get:function(){return lt.hasFromClaims}});Object.defineProperty(N,"protectFromClaims",{enumerable:!0,get:function(){return lt.protectFromClaims}});Object.defineProperty(N,"ForbiddenError",{enumerable:!0,get:function(){return lt.ForbiddenError}});var ct=qo();Object.defineProperty(N,"ROLE_KEY_PATTERN",{enumerable:!0,get:function(){return ct.ROLE_KEY_PATTERN}});Object.defineProperty(N,"PERMISSION_KEY_PATTERN",{enumerable:!0,get:function(){return ct.PERMISSION_KEY_PATTERN}});Object.defineProperty(N,"isRoleKey",{enumerable:!0,get:function(){return ct.isRoleKey}});Object.defineProperty(N,"isPermissionKey",{enumerable:!0,get:function(){return ct.isPermissionKey}})});var xc=30*24*60*60*1e3;function lr(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 cr(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 $(e){var t,n,r;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"complete":return{kind:"done",sessionId:(r=e.created_session_id)!=null?r:null};case"abandoned":return{kind:"restart",reason:"abandoned"};default:return{kind:"unknown",status:e.status}}}function dr(e){return e.status==="complete"||e.status==="abandoned"}function ur(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}):[]}function Ge(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 Kc=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","waitlisted","identifier_not_allowed","disposable_email_blocked","sso_required","sign_ins_disabled","sign_ups_disabled","high_risk_blocked","sms_region_blocked"]);function zs(e){return`error.${e}`}var Ns="Something went wrong. Please try again.",$s=/^[a-z][a-z0-9_]{0,63}$/;function Bs(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 zt(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 pr(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&&$s.test(o)){let l=zt(t,zs(o)),a=l?Bs(l,r.meta):null;if(a)return a}return typeof r.message=="string"&&r.message.trim()!==""?r.message:(s=(i=zt(t,"error.generic"))!=null?i:zt(n,"error.generic"))!=null?s:Ns}function fr(e){if(!e||typeof e!="object")return;let t=e.locale;return typeof t=="string"&&t.trim()!==""?t:void 0}var Nt="atlas:oauth",Hs="atlas_popup_result",gr="atlas:oauth";function Ws(e){return`${gr}:${e}`}function mr(){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 js(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 Ks(e){var t;try{return(t=lr(e))!=null?t:cr(e)}catch{return null}}function hr(e,t,n){let r=Ks(e);if(!r)return Promise.resolve(!1);let o=mr();return new Promise(i=>{let s=!1,l=c=>{s||(s=!0,clearTimeout(d),a(),r.close(),i(c))},a=r.subscribe(c=>{js(c)&&c.type==="atlas:oauth:ack"&&c.id===o&&l(!0)}),d=setTimeout(()=>l(!1),n);try{r.post({...t,id:o})}catch{l(!1)}})}function qs(e){if(!e||e.length<2)return null;let t=new URLSearchParams(e.replace(/^#/,"")).get(Hs);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,l=>l.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 yr(e={}){var o,i;let t=(o=e.win)!=null?o:typeof window!="undefined"?window:void 0;if(!t)return null;let n=qs(t.location.hash);if(!n)return null;try{t.history.replaceState(t.history.state,"",t.location.href.split("#")[0])}catch{}try{t.name=Nt}catch{}let r=await hr(Ws(n.nonce),{type:"atlas:oauth:result",result:n.payload},(i=e.ackTimeoutMs)!=null?i:1500);return r&&kr(t),{payload:n.payload,delivered:r}}async function br(e={}){var o,i;let t=(o=e.win)!=null?o:typeof window!="undefined"?window:void 0;if(!t||t.name!==Nt)return!1;let n=await hr(gr,{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:(kr(t),!0)}function kr(e){try{e.close()}catch{}}var Vs=["__atlas_attempt","__atlas_ticket","__atlas_status","__atlas_policy_token"];function vr(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 Zc=5*6e4;function _r(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"&&i?{policyToken:i}:{}}}function Ye(e){let t=new URL(e);for(let n of Vs)t.searchParams.delete(n);return t.toString()}async function xr(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 wr(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}:{}}}var Sr="0.19.0";var Er={name:"@atlasauth/js",version:Sr},Ar="x-atlas-sdk",Gs="atlas-sdk-advisory";function Pr(e){return`${e.name}/${e.version}`}function Ys(e){return typeof e!="string"||!e.trim()?[]:e.split(",").map(t=>{let[n,...r]=t.split(";").map(i=>i.trim()),o=i=>{var s,l;return(l=(s=r.find(a=>a.startsWith(`${i}=`)))==null?void 0:s.slice(i.length+1))!=null?l:null};return{action:n!=null?n:"",min:o("min"),reason:o("reason")}}).filter(t=>t.action!=="")}var Cr=new Set;function Rr(e,t,n=Js){var i,s,l,a,d;let r=null;try{r=(l=(s=(i=e==null?void 0:e.headers)==null?void 0:i.get)==null?void 0:s.call(i,Gs))!=null?l:null}catch{return[]}let o=[];for(let c of Ys(r)){let u=`${t.name}|${(a=c.reason)!=null?a:""}|${(d=c.min)!=null?d:""}`;Cr.has(u)||(Cr.add(u),o.push(c),n(`[Atlas] ${t.name} ${t.version} has a known problem${c.reason?` (${c.reason})`:""}${c.min?` fixed in ${c.min}. Upgrade ${t.name} to ${c.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 Js(e){typeof console!="undefined"&&console.warn(e)}var ye="__atlas_dev_session:",Tr="/v1/client/tickets/exchange",Ir="/v1/client",Or=/^\/v1\/client\/sessions\/[^/]+\/tokens$/,Zs=/^\/v1\/client\/sessions\/[^/]+\/revoke$/;function de(){try{let e=globalThis.localStorage;return e&&typeof e.getItem=="function"?e:null}catch{return null}}function Mr(e){return e.startsWith("pk_test_")&&de()!==null}function Ur(e){var t,n;try{return(n=(t=de())==null?void 0:t.getItem(ye+e))!=null?n:null}catch{return null}}var Bt=":sid";function Lr(e,t,n){var r,o;if(!(typeof t!="string"||!t))try{(r=de())==null||r.setItem(ye+e,t),typeof n=="string"&&n&&((o=de())==null||o.setItem(ye+e+Bt,n))}catch{}}function Xs(e){var t,n;try{return(n=(t=de())==null?void 0:t.getItem(ye+e+Bt))!=null?n:null}catch{return null}}function Je(e){var t,n;try{(t=de())==null||t.removeItem(ye+e),(n=de())==null||n.removeItem(ye+e+Bt)}catch{}}function Qs(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 Dr(e){let t=/^\/v1\/client\/sessions\/([^/]+)\//.exec(e);return t?decodeURIComponent(t[1]):null}async function $t(e){try{let t=await e.clone().json();return t&&typeof t=="object"&&!Array.isArray(t)?t:null}catch{return null}}var Fr=Symbol.for("atlas.devBrowser");function Ht(e,t){if(!e.startsWith("pk_test_")||t[Fr])return t;let n=async(r,o)=>{var u,f;if(!Mr(e))return t(r,o);let i=Qs(r),s=((u=o==null?void 0:o.method)!=null?u:"GET").toUpperCase(),l=o,a=!1;if(i===Tr&&s==="POST"&&typeof(o==null?void 0:o.body)=="string")try{let p=JSON.parse(o.body);p&&typeof p=="object"&&!Array.isArray(p)&&(l={...o,body:JSON.stringify({...p,return_refresh_token:!0})})}catch{}let d=Ur(e);if(d&&(i===Ir&&s==="GET"||i&&Or.test(i)&&s==="POST")){let p=new Headers(l==null?void 0:l.headers);p.has("x-refresh-token")||p.set("x-refresh-token",d),l={...l,headers:p},a=!0}let c=await t(r,l);if(!i)return c;if(i===Tr&&c.ok){let p=await $t(c);Lr(e,p==null?void 0:p.refresh_token,p==null?void 0:p.id)}else if(i&&Or.test(i))c.ok?Lr(e,(f=await $t(c))==null?void 0:f.refresh_token,Dr(i)):a&&c.status===401&&Je(e);else if(i===Ir&&a&&c.ok){let p=await $t(c);p&&p.session===null&&Je(e)}else if(i&&Zs.test(i)&&(c.ok||c.status===404)){let p=Xs(e);(!p||p===Dr(i))&&Je(e)}return c};return n[Fr]=!0,n}function Wt(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}}async function ea(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=l=>typeof l=="string"&&l?l: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 l=i(o.qr_code);l&&/^data:image\//.test(l)&&(s.qrCode=l)}else i(o.phone)&&(s.phone=i(o.phone));return{enrollment:s,errors:[],status:r.status}}function zr(e){return e.replace(/\s+/g,"").replace(/(.{4})(?=.)/g,"$1 ")}function ta(e,t){return t===409?!0:e.some(n=>n.code==="STRATEGY_DISABLED"||n.param==="strategy")}function Nr(e,t){let n=()=>typeof t=="function"?t():t,r=p=>{let g=[];return p.totp&&g.push("totp"),p.sms&&g.push("phone_code"),g.length?g:["totp"]},o=()=>{let p=n();return{options:r(p),method:null,enrollment:null,busy:!1,errors:[],totpCodes:p.totpCodes}},i=o(),s=null,l="",a=0,d=new Set,c=p=>{i={...i,...p};for(let g of d)g(i)},u=async p=>{let g=s;if(!g)return;let y=a;c({busy:!0,errors:[]});let m=await ea(e,g,p);if(y===a){if(m.enrollment){c({busy:!1,enrollment:m.enrollment,errors:[]});return}if(ta(m.errors,m.status)&&i.options.length>1){let C=i.options.filter(E=>E!==p.strategy);c({busy:!1,options:C,method:null,enrollment:null,errors:m.errors}),C.length===1&&await f.choose(C[0]);return}c({busy:!1,errors:m.errors})}},f={get state(){return i},subscribe(p){return d.add(p),()=>d.delete(p)},start(p){p!==s&&(a+=1,s=p,l="",i=o(),c({}),i.options.length===1&&f.choose(i.options[0]))},async choose(p){i.options.includes(p)&&(c({method:p,enrollment:null,errors:[]}),p==="totp"&&await u({strategy:"totp"}))},async sendPhone(p){let g=p.trim();if(!g){c({errors:[{code:"FORM_PARAM_MISSING",message:"A phone number is required.",param:"phone"}]});return}l=g,await u({strategy:"phone_code",phone:g})},async resend(){i.method==="phone_code"&&l&&await u({strategy:"phone_code",phone:l})},async submit(p){var m,C,E,A;if(i.method==="phone_code"&&!i.enrollment)return await f.sendPhone((m=p.phone)!=null?m:""),null;let g=i.enrollment;return g?g.strategy==="phone_code"?{factorId:g.factorId,enrollStrategy:"phone_code",code:(C=p.code)!=null?C:""}:{factorId:g.factorId,code:(E=p.code)!=null?E:"",secondCode:(A=p.secondCode)!=null?A:""}:null},reset(){a+=1,s=null,l="",i=o(),c({})}};return f}function $r(e){return e.method===null?null:e.method==="phone_code"&&!e.enrollment?"mfa.sendCode":e.enrollment?"signIn.submit":null}async function Br(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],l=new Error((o=s==null?void 0:s.message)!=null?o:"Could not send the code.");throw s!=null&&s.code&&(l.code=s.code),l}return{sentTo:typeof((i=r.data)==null?void 0:i.sent_to)=="string"?r.data.sent_to:""}}function Hr(e){if(!Array.isArray(e))return null;let t=e.filter(n=>typeof n=="string"&&n.length>0);return t.length?t:null}function Te(e){var t;return((t=e.attempt)==null?void 0:t.status)!=="complete"?null:e.recoveryCodes&&e.recoveryCodes.length?e.recoveryCodes:null}function Wr(e){return{...e,recoveryCodes:null}}function na(e){return`${e.join(`
|
|
2
2
|
`)}
|
|
3
|
-
`}async function
|
|
4
|
-
`)),!0}catch{return!1}}function Ut(){return typeof document!="undefined"&&typeof Blob!="undefined"&&typeof URL!="undefined"&&typeof URL.createObjectURL=="function"}function xr(e,t="recovery-codes.txt"){var r;if(!Ut())return!1;let n=URL.createObjectURL(new Blob([ka(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 va=/^[A-Za-z0-9_-]{3,64}$/,le=e=>!!e&&typeof e=="object"&&!Array.isArray(e),zt=e=>typeof e=="string"&&va.test(e.trim())?e.trim():null,$t=["referally","rewardful","tolt","promotekit","firstpromoter","partnerstack","dub"],Er=["cookiemunch","onetrust","cookiebot","didomi","usercentrics","osano","cookieyes","complianz","klaro","tcf","consent_mode"];function _(e,t){try{return e!=null&&(typeof e=="object"||typeof e=="function")?e[t]:void 0}catch{return}}function G(e,t,...n){try{return typeof e=="function"?e.apply(t,n):void 0}catch{return}}function Ee(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 Ar(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 Ar(Number(e));let t=Date.parse(e);if(Number.isFinite(t))return new Date(t).toISOString()}}function ee(e,t,n,r,o){let s={source:e,code:zt(t),clickId:zt(n),anonId:zt(r)},a=Ar(o);return a&&(s.capturedAt=a),s.code||s.clickId||s.anonId?s:null}var _a={referally:({win:e})=>{var r,o;let t=_(e,"aff"),n=G(_(t,"getReferral"),t);return le(n)?ee("referally",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=_(e,"Rewardful");return ee("rewardful",_(_(t,"affiliate"),"token"),_(t,"referral"),null)},tolt:({win:e})=>ee("tolt",null,_(e,"tolt_referral"),null),promotekit:({win:e})=>ee("promotekit",null,_(e,"promotekit_referral"),null),firstpromoter:({cookies:e})=>ee("firstpromoter",Ee(e,"_fprom_ref"),Ee(e,"_fprom_tid"),null),partnerstack:({cookies:e})=>ee("partnerstack",Ee(e,"ps_partner_key"),Ee(e,"ps_xid"),null),dub:({cookies:e})=>ee("dub",null,Ee(e,"dub_id"),null)};function Bt(e){var n,r,o;if(typeof e!="function")return null;let t;try{t=e()}catch{return null}return le(t)?ee("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 Ae(e,t){for(let n of t){let r=_a[n];if(!r)continue;let o=null;try{o=r(e)}catch{o=null}if(o)return o}return null}var xa={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 Rr(e){var t;return(t=xa[e.trim().toLowerCase()])!=null?t:null}var Q=e=>typeof e=="boolean"?e:void 0;function V(e,t){return(n,r)=>{let o=t(r);if(o!==void 0)return o;let s=Rr(r),a=s?e[s]:void 0;return a?t(a):void 0}}var Nt=null,wr=!1;function Wt(e){let t=_(e,"__tcfapi");wr||typeof t!="function"||(wr=!0,G(t,e,"addEventListener",2,(n,r)=>{r&&le(n)&&(Nt=n)}))}function wa(e){if(Nt)return Nt;let t=null;return G(_(e,"__tcfapi"),e,"getTCData",2,(n,r)=>{r&&le(n)&&(t=n)}),t}var Sr={necessary:"necessary",preferences:"preferences",statistics:"statistics",marketing:"marketing"},Cr=(e,t)=>Array.isArray(e)&&e.includes(t),Sa={cookiemunch:{present:e=>le(_(_(e,"CookieMunch"),"consent")),ask:(e,t)=>{let n=_(_(e,"CookieMunch"),"consent");return V(Sr,r=>Q(_(n,r)))(e,t)}},onetrust:{present:e=>{var t;return typeof((t=_(e,"OnetrustActiveGroups"))!=null?t:_(e,"OptanonActiveGroups"))=="string"},ask:(e,t)=>{var r,o;let n=String((o=(r=_(e,"OnetrustActiveGroups"))!=null?r:_(e,"OptanonActiveGroups"))!=null?o:"").split(",").map(s=>s.trim()).filter(Boolean);return V({necessary:"C0001",statistics:"C0002",preferences:"C0003",marketing:"C0004"},s=>/^C\d{4}$/.test(s)||n.includes(s)?n.includes(s):void 0)(e,t)}},cookiebot:{present:e=>!_(e,"CookieMunch")&&le(_(_(e,"Cookiebot"),"consent")),ask:(e,t)=>{let n=_(_(e,"Cookiebot"),"consent");return V(Sr,r=>Q(_(n,r)))(e,t)}},didomi:{present:e=>typeof _(_(e,"Didomi"),"getUserStatus")=="function",ask:(e,t)=>{let n=_(e,"Didomi"),r=_(_(G(_(n,"getUserStatus"),n),"purposes"),"global"),o=_(r,"enabled"),s=_(r,"disabled");return V({marketing:"cookies",statistics:"measure_content_performance"},a=>Cr(o,a)?!0:Cr(s,a)?!1:void 0)(e,t)}},usercentrics:{present:e=>typeof _(_(e,"UC_UI"),"getServicesBaseInfo")=="function",ask:(e,t)=>{let n=_(e,"UC_UI"),r=G(_(n,"getServicesBaseInfo"),n);if(Array.isArray(r))return V({necessary:"essential",preferences:"functional",statistics:"functional",marketing:"marketing"},o=>{let s=r.filter(a=>_(a,"categorySlug")===o);return s.length?s.every(a=>_(_(a,"consent"),"status")===!0):void 0})(e,t)}},osano:{present:e=>typeof _(_(_(e,"Osano"),"cm"),"getConsent")=="function",ask:(e,t)=>{let n=_(_(e,"Osano"),"cm"),r=G(_(n,"getConsent"),n);return V({necessary:"ESSENTIAL",preferences:"PERSONALIZATION",statistics:"ANALYTICS",marketing:"MARKETING"},o=>{var a;let s=(a=_(r,o))!=null?a:_(r,o.toUpperCase());return s==="ACCEPT"?!0:s==="DENY"?!1:void 0})(e,t)}},cookieyes:{present:e=>typeof _(e,"getCkyConsent")=="function",ask:(e,t)=>{let n=_(G(_(e,"getCkyConsent"),e),"categories");return V({necessary:"necessary",preferences:"functional",statistics:"analytics",marketing:"advertisement"},r=>Q(_(n,r)))(e,t)}},complianz:{present:e=>typeof _(e,"cmplz_has_consent")=="function",ask:(e,t)=>V({necessary:"functional",preferences:"preferences",statistics:"statistics",marketing:"marketing"},n=>Q(G(_(e,"cmplz_has_consent"),e,n)))(e,t)},klaro:{present:e=>typeof _(_(e,"klaro"),"getManager")=="function",ask:(e,t)=>{let n=_(e,"klaro"),r=_(G(_(n,"getManager"),n),"consents");return Q(_(r,t))}},tcf:{present:e=>typeof _(e,"__tcfapi")=="function",ask:e=>{var n;let t=wa(e);if(t)return t.gdprApplies===!1?!0:(n=Q(_(_(_(t,"purpose"),"consents"),"1")))!=null?n:!1}},consent_mode:{present:e=>le(_(_(_(e,"google_tag_data"),"ics"),"entries")),ask:(e,t)=>{let n=_(_(_(e,"google_tag_data"),"ics"),"entries");return V({preferences:"functionality_storage",statistics:"analytics_storage",marketing:"ad_storage"},r=>{var s;let o=_(n,r);return(s=Q(_(o,"update")))!=null?s:Q(_(o,"default"))})(e,t)}}};function Ca(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 Ht(e,t,n={}){let r=n.provider||"auto",o=()=>{let l=Ca(n.appConsent);return l===void 0?{granted:!1,by:"none"}:{granted:l,by:"app"}};if(r==="app")return o();let s=r==="auto"?Er:[r],a=t.filter(l=>typeof l=="string"&&l.trim().length>0);for(let l of s){let i=Sa[l],c=!1;try{c=!!i&&i.present(e)}catch{c=!1}if(!(!i||!c)){for(let d of a){let u;try{u=i.ask(e,d)}catch{u=void 0}if(u!==void 0)return{granted:u,by:l}}return{granted:!1,by:l}}}return o()}var Pr=new Set(["referally","rewardful","tolt","promotekit"]),Tr=["referally"],Ir=Object.freeze({enabled:!1,sources:[],consentProvider:"auto",urlParams:[],contextCookie:null,consentCategory:"referrals",consentFallbackCategory:"marketing",challengeReferredSignups:"inherit",codeLookupUrl:null,signupCodeField:!1}),Ea=/^[A-Za-z0-9_-]{3,64}$/,Aa=/^[A-Za-z0-9_.-]{1,40}$/,Ra=/^[A-Za-z0-9_.-]{1,64}$/,Re=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function te(e){if(typeof e!="string")return null;let t=e.trim();return Ea.test(t)?t:null}function Or(e){let t=Re(e)&&Re(e.referrals)?e.referrals:e;if(!Re(t)||t.enabled!==!0)return{...Ir,urlParams:[],sources:[]};let n=Array.isArray(t.url_params)?t.url_params.filter(o=>typeof o=="string"&&Aa.test(o)).slice(0,10):[];return{enabled:!0,sources:Array.isArray(t.browser_sources)?t.browser_sources.filter(o=>typeof o=="string"&&/^[a-z0-9_]{1,40}$/.test(o)).slice(0,20):[...Tr],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:typeof t.context_cookie=="string"&&Ra.test(t.context_cookie)?t.context_cookie:null,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 Pa(e,t){if(!e)return null;let n;try{n=new URLSearchParams(e)}catch{return null}for(let r of t){let o=te(n.get(r));if(o)return o}return null}function Ta(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 s;try{s=new URLSearchParams(o)}catch{continue}for(let a of["redirect_url","after_url","redirect_url_complete","after_sign_up_url","after_sign_in_url"]){let l=s.get(a);if(l)try{r(new URL(l,t!=null?t:"https://invalid.example").search)}catch{}}}return n}function qe(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 qe(Number(e));let t=Date.parse(e);return Number.isFinite(t)?new Date(t).toISOString():null}function Ia(e,t=Date.now()){var a,l,i;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 Re(d)?d:null}catch{return null}},o=(a=r(e.trim()))!=null?a:r(n.trim());if(o){let c=qe(o.exp);if(c&&Date.parse(c)<=t)return null;let d={code:te(o.code),clickId:te((l=o.clickId)!=null?l:o.click_id),anonId:te((i=o.anonId)!=null?i:o.anon_id)},u=qe(o.ts);return u&&(d.capturedAt=u),d.code||d.clickId||d.anonId?d:null}let s=te(n);return s?{code:null,clickId:s,anonId:null}:null}function Oa(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 La=["ref_click_id","ref_anon_id","ref_consent","ref_captured_at"];function Da(e){if(!e)return null;let t;try{t=new URLSearchParams(e)}catch{return null}if(!La.some(s=>t.get(s)!==null))return null;let n=t.get("ref_consent")==="granted",r={code:te(t.get("ref")),clickId:te(t.get("ref_click_id")),anonId:te(t.get("ref_anon_id")),consentGranted:n},o=qe(t.get("ref_captured_at"));return o&&(r.capturedAt=o),r.code||r.clickId||r.anonId?r:null}function jt(e,t,n,r){var i;let s=!!(e.clickId||e.anonId)?t():null,a=!!(s!=null&&s.granted),l={code:e.code,click_id:a?e.clickId:null,anon_id:a?e.anonId:null,consent:a?"granted":"not_required",captured_at:(i=e.capturedAt)!=null?i:n,source:r,...s?{consent_by:s.by}:{}};return l.code||l.click_id||l.anon_id?l:null}function Fa(e){return e.win!==void 0?e.win:{CookieMunch:e.cookieMunch,aff:e.aff}}function Ma(e,t,n,r){var y,A;if(!e.enabled)return null;let o=(y=t.capturedAt)!=null?y:new Date().toISOString(),s=Fa(t),a,l=()=>a!=null?a:a=Ht(s,[e.consentCategory,e.consentFallbackCategory],{provider:e.consentProvider,appConsent:n}),i=E=>E?jt(E,l,o,E.source):null,c=(A=e.sources)!=null?A:Tr,d={win:s,cookies:t.cookies},u=i(Bt(r));if(u)return u;let f=i(Ae(d,c.filter(E=>Pr.has(E))));if(f)return f;let p=Ta(t.searches,t.base);for(let E of p){let v=Da(E);if(!v)continue;let C=jt(v,()=>v.consentGranted?{granted:!0,by:"url"}:l(),o,"url");if(C)return C}for(let E of p){let v=Pa(E,e.urlParams);if(v)return{code:v,click_id:null,anon_id:null,consent:"not_required",captured_at:o,source:"url"}}let m=e.contextCookie?Ia(Oa(t.cookies,e.contextCookie)):null,b=m?jt(m,l,o,"cookie"):null;return b||i(Ae(d,c.filter(E=>!Pr.has(E))))}var Ua=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/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/siwf/nonce","/v1/oauth/siwf/verify"]),za=/^\/v1\/client\/(sign_ins\/[^/]+\/(prepare_first_factor|attempt_first_factor)|sign_ups\/[^/]+\/(prepare_verification|attempt_verification|passkey\/finish))$/;function Lr(e){var n;let t=(n=e.split("?")[0])!=null?n:e;return Ua.has(t)||za.test(t)}var he=()=>typeof window=="undefined"?null:window,Ve=[],me=null;function qt(){var t,n;let e=(n=(t=he())==null?void 0:t.location)==null?void 0:n.search;!e||Ve.includes(e)||(Ve.push(e),me!=null||(me=new Date().toISOString()))}qt();he()&&Wt(he());var Kt={};var ge=new Map;function Dr(e,t){return`${e!=null?e:""}|${t}`}function Fr(e,t){!Re(t)||!("referrals"in t)||ge.set(e,Promise.resolve(Or(t)))}function Mr(e){let t=ge.get(e.referralCacheKey);if(!t){let n=e.referralCacheKey,r=()=>(ge.get(n)===t&&ge.delete(n),{...Ir,urlParams:[]});t=e.get("/v1/client/environment").then(o=>o.ok?Or(o.data):r()).catch(r),ge.set(n,t)}return t}function Ur(e){var n,r,o;let t=he();return ge.has(e.referralCacheKey)||!!((n=t==null?void 0:t.location)!=null&&n.search)||Ve.length>0||Bt(Vt(e).referralSource)!==null||Ae({win:t,cookies:(o=(r=t==null?void 0:t.document)==null?void 0:r.cookie)!=null?o:null},$t)!==null}function Vt(e){var n,r,o;let t=e.referralOptions;return{referral:(n=t.referral)!=null?n:Kt.referral,referralConsent:(r=t.referralConsent)!=null?r:Kt.referralConsent,referralSource:(o=t.referralSource)!=null?o:Kt.referralSource}}async function Gt(e){var r,o,s,a,l;let t=he();if(!t)return null;let n=Vt(e);if(n.referral===!1)return null;try{let i=(o=(r=t.location)==null?void 0:r.search)!=null?o:"";if(!Ur(e))return null;let c=await Mr(e);return c.enabled?(Wt(t),Ma(c,{searches:[i,...Ve],cookies:(a=(s=t.document)==null?void 0:s.cookie)!=null?a:null,win:t,base:(l=t.location)==null?void 0:l.href,capturedAt:me!=null?me:void 0},n.referralConsent,n.referralSource)):null}catch{return null}}async function Yt(e){if(!he()||Vt(e).referral===!1||!Ur(e))return!1;try{if((await Mr(e)).challengeReferredSignups!=="always")return!1;let n=await Gt(e);return!!(n!=null&&n.code)}catch{return!1}}var zr=typeof window!="undefined",Pe=()=>typeof navigator!="undefined"?navigator:void 0;function O(e,t){try{return e()}catch{return t}}function Na(){return O(()=>{if(!zr||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 $a(){return O(()=>{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),Xt(e.toDataURL())):null},null)}function Ba(){var l;let e=Pe(),t=zr?window:{},n=(l=e==null?void 0:e.userAgent)!=null?l:"",r=O(()=>(e==null?void 0:e.webdriver)===!0,!1),o=O(()=>"chrome"in t&&!!t.chrome,!1),s=/headless/i.test(n)||/chrome/i.test(n)&&!o&&O(()=>{var i,c;return((c=(i=e==null?void 0:e.plugins)==null?void 0:i.length)!=null?c:0)===0},!1),a=O(()=>r||"_phantom"in t||"callPhantom"in t||"__nightmare"in t||"domAutomation"in t||"domAutomationController"in t||typeof document!="undefined"&&Object.keys(document).some(i=>i.startsWith("cdc_")||i.startsWith("$cdc_"))||/electron|phantomjs|slimerjs/i.test(n),r);return{webdriver:r,headless:s,hasChrome:o,automationHint:a}}function Wa(){let e=Pe(),t=Na(),n=Ba(),r=O(()=>{var s;return Array.from((s=e==null?void 0:e.languages)!=null?s:[])},[]),o=t.renderer;return{screenWidth:O(()=>{var s,a;return(a=(s=window.screen)==null?void 0:s.width)!=null?a:null},null),screenHeight:O(()=>{var s,a;return(a=(s=window.screen)==null?void 0:s.height)!=null?a:null},null),colorDepth:O(()=>{var s,a;return(a=(s=window.screen)==null?void 0:s.colorDepth)!=null?a:null},null),pixelRatio:O(()=>{var s;return(s=window.devicePixelRatio)!=null?s:null},null),timezone:O(()=>{var s;return(s=Intl.DateTimeFormat().resolvedOptions().timeZone)!=null?s:null},null),timezoneOffset:O(()=>new Date().getTimezoneOffset(),null),language:O(()=>{var s;return(s=e==null?void 0:e.language)!=null?s:null},null),languages:r,platform:O(()=>{var s;return(s=e==null?void 0:e.platform)!=null?s:null},null),hardwareConcurrency:O(()=>{var s;return(s=e==null?void 0:e.hardwareConcurrency)!=null?s:null},null),deviceMemory:O(()=>{var s;return(s=e==null?void 0:e.deviceMemory)!=null?s:null},null),maxTouchPoints:O(()=>{var s;return(s=e==null?void 0:e.maxTouchPoints)!=null?s:null},null),touchSupport:O(()=>{var s;return((s=e==null?void 0:e.maxTouchPoints)!=null?s:0)>0||"ontouchstart"in window},!1),cookieEnabled:O(()=>{var s;return(s=e==null?void 0:e.cookieEnabled)!=null?s:null},null),doNotTrack:O(()=>(e==null?void 0:e.doNotTrack)==="1"||(e==null?void 0:e.doNotTrack)==="yes",null),webglVendor:t.vendor,webglRenderer:o,pluginCount:O(()=>{var s,a;return(a=(s=e==null?void 0:e.plugins)==null?void 0:s.length)!=null?a:null},null),pointerType:O(()=>{var s,a;return(a=(s=window.matchMedia)==null?void 0:s.call(window,"(pointer: fine)"))!=null&&a.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 Ha(){var e;return(e=O(()=>{var o,s;let t=Pe(),n=typeof window!="undefined"?window:void 0,r=(s=(o=t==null?void 0:t.doNotTrack)!=null?o:t==null?void 0:t.msDoNotTrack)!=null?s:n==null?void 0:n.doNotTrack;return r==="1"||r==="yes"},!1))!=null?e:!1}function Zt(){return O(()=>{let e=()=>{var r,o;return"d_"+Xt(String(Math.random())+String(Date.now())+((o=(r=Pe())==null?void 0:r.userAgent)!=null?o:""))};if(Ha())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 ja(e){let t=[e.timezone,e.platform,e.languages.join(","),e.webglVendor,e.webglRenderer,e.screenWidth,e.screenHeight,e.colorDepth,e.hardwareConcurrency,$a()];return Xt(t.map(n=>n==null?"":String(n)).join("|"))}function Xt(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 Ge=e=>e.length?e.reduce((t,n)=>t+n,0)/e.length:null,Jt=e=>{let t=Ge(e);return t===null?null:e.reduce((n,r)=>n+(r-t)**2,0)/e.length},Ye=class{constructor(t){h(this,"start",Date.now());h(this,"firstInteraction",null);h(this,"moves",0);h(this,"distance",0);h(this,"maxSpeed",0);h(this,"speeds",[]);h(this,"lastX",null);h(this,"lastY",null);h(this,"lastMoveT",0);h(this,"netDx",0);h(this,"netDy",0);h(this,"keyCount",0);h(this,"downAt",new Map);h(this,"dwell",[]);h(this,"flight",[]);h(this,"lastUpAt",null);h(this,"pastes",0);h(this,"backspaces",0);h(this,"focusChanges",0);h(this,"scrolls",0);h(this,"target");h(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)=>{O(()=>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 s,a;this.mark();let n=(s=t.clientX)!=null?s:0,r=(a=t.clientY)!=null?a:0,o=Date.now();if(this.lastX!==null&&this.lastY!==null){let l=n-this.lastX,i=r-this.lastY,c=Math.hypot(l,i);this.distance+=c,this.netDx+=l,this.netDy+=i;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:Ge(this.speeds),mouseMaxSpeed:Math.round(this.maxSpeed*1e3)/1e3,mouseSpeedVariance:Jt(this.speeds),mouseStraightLineRatio:this.distance>0?Math.min(1,t/this.distance):null,keyCount:this.keyCount,keyAvgDwellMs:Ge(this.dwell),keyAvgFlightMs:Ge(this.flight),keyDwellVariance:Jt(this.dwell),keyFlightVariance:Jt(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)O(()=>t.removeEventListener(n,r),void 0);this.bound=[]}}};async function Nr(e){return O(async()=>{var i,c,d;let t=Wa(),n={attempt_id:e.attemptId,kind:(i=e.kind)!=null?i:"telemetry",device_id:Zt(),device_fingerprint:ja(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),s=Pe();if(!e.fetchImpl&&s&&typeof s.sendBeacon=="function"&&typeof Blob!="undefined"&&s.sendBeacon(r,new Blob([o],{type:"application/json"})))return!0;let a=(d=e.fetchImpl)!=null?d:typeof fetch!="undefined"?fetch:void 0;return a?(await a(r,{method:"POST",headers:{"content-type":"application/json","x-publishable-key":e.publishableKey},body:o,keepalive:!0,credentials:"include"})).ok:!1},Promise.resolve(!1))}function $r(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 Ka=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/discourse","/v1/client/sign_ins/id_token","/v1/client/sign_ins/external_jwt","/v1/client/sign_ins/ldap","/v1/oauth/telegram","/v1/oauth/siwe/verify","/v1/oauth/siws/verify","/v1/oauth/siwf/verify"]),Je=class{constructor(t){this.options=t;qt()}get referralCacheKey(){return Dr(this.options.baseUrl,this.options.publishableKey)}get referralOptions(){return{referral:this.options.referral,referralConsent:this.options.referralConsent,referralSource:this.options.referralSource}}get locale(){return $r(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 c,d,u,f;let r=Ft(this.options.publishableKey,(c=this.options.fetchImpl)!=null?c:fetch),o=this.locale,s=(d=this.options.sdk)!=null?d:rr,a;try{a=await r(`${(u=this.options.baseUrl)!=null?u:""}${t}`,{...n,credentials:"include",headers:{"x-publishable-key":this.options.publishableKey,[or]:sr(s),...o?{"accept-language":o}:{},...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."}]}}ar(a,s);let l=null;try{l=await a.json()}catch{}let i=t.split("?")[0];return a.ok&&((f=n.method)!=null?f:"GET")==="GET"&&(i==="/v1/client/environment"||i==="/v1/appearance")&&Fr(this.referralCacheKey,l),{ok:a.ok,status:a.status,data:a.ok?l:null,errors:a.ok?[]:jn(l)}}async post(t,n){let r=n;if(r!==null&&typeof r=="object"&&!Array.isArray(r)&&!("referral"in r)&&Lr(t)){let s=await Gt(this);s&&(r={...r,referral:s})}let o=t.split("?")[0];if(o!==void 0&&Ka.has(o)&&r!==null&&typeof r=="object"&&!Array.isArray(r)&&!("device_id"in r)){let s=Zt();s&&(r={...r,device_id:s})}return this.request(t,{method:"POST",body:r===void 0?void 0:JSON.stringify(r)})}get(t){return this.request(t,{method:"GET"})}};var N={attempt:null,errors:[],busy:!1,pollSecret:null,ticket:null,prepared:null};function qa(e,t){var o,s,a,l,i,c,d,u,f,p,m,b,y;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=z(e),r=(s=e.id)!=null?s:"";switch(n.kind){case"collect_identifier":return{path:"/v1/client/sign_ins",body:{identifier:(a=t.identifier)!=null?a:"",...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:(l=t.password)!=null?l:""}};case"collect_second_factor":return{path:`/v1/client/sign_ins/${r}/attempt_second_factor`,body:{code:(i=t.code)!=null?i:"",...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:[(f=t.code)!=null?f:"",(p=t.secondCode)!=null?p:""]}};case"collect_email_code":return{path:`/v1/client/sign_ups/${r}/attempt_verification`,body:{code:(m=t.code)!=null?m:""}};case"collect_captcha":return t.captcha_token?{path:"/v1/client/sign_ins",body:{identifier:(b=t.identifier)!=null?b:"",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"await_oauth":case"done":case"restart":case"unknown":return null}}function Ze(e){return e?{...N,attempt:{id:e.id,status:e.status}}:N}async function Te(e,t,n){var c,d,u,f;let r=qa(t.attempt,n);if(!r)return t;let o=await e.post(r.path,r.body);if(!o.ok||!o.data)return{...t,busy:!1,errors:o.errors};let{backup_codes:s,...a}=o.data,l=kr(s),i=a.id===((c=t.attempt)==null?void 0:c.id)&&a.status===((d=t.attempt)==null?void 0:d.status);return{attempt:a,errors:[],busy:!1,pollSecret:t.pollSecret,ticket:(u=a.ticket)!=null?u:null,prepared:i&&(f=t.prepared)!=null?f:null,...l?{recoveryCodes:l}:{}}}async function Qt(e,t){var o,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}:{}});return!r.ok||!r.data?{...N,busy:!1,errors:r.errors}:{attempt:r.data,errors:[],busy:!1,pollSecret:(o=r.data.poll_secret)!=null?o:N.pollSecret,ticket:(s=r.data.ticket)!=null?s:null}}async function Br(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 Xe(e,t){return!!e&&e.object==="sign_up_attempt"&&e.status==="needs_email_verification"&&t==="link"}async function Wr(e,t,n){var s,a,l;let r=(s=t.attempt)==null?void 0:s.id;if(!r)return t;let o=await e.post(`/v1/client/sign_ins/${r}/prepare_first_factor`,{strategy:n});return o.ok?{...t,busy:!1,errors:[],pollSecret:n==="email_link"&&(l=(a=o.data)==null?void 0:a.poll_secret)!=null?l:null,prepared:n}:{...t,busy:!1,errors:o.errors}}async function Hr(e,t){var s,a,l;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)}`);return!o.ok||!o.data?{state:t,ticket:null}:{state:{...t,attempt:o.data},ticket:(l=o.data.ticket)!=null?l:null}}function en(e){var r;if(!e.pollSecret||!e.attempt||Hn(e.attempt))return!1;let t=e.attempt;return!(t.object==="sign_up_attempt"&&t.status==="needs_first_factor"&&((r=t.supported_first_factors)!=null?r:[]).includes("passkey"))}var vc=Object.freeze({entries:[],loading:!1,forbidden:!1,hasMore:!1});function qr(e){return{provider:e.provider,id_token:e.idToken,...e.nonce?{nonce:e.nonce}:{}}}function Vr(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 jr="https://accounts.google.com/gsi/client",Qe=null;function Va(){return typeof process!="undefined"&&!1}var Kr=new Set,Ga=!1;function Ya(e){return Qe||(Qe=new Promise((t,n)=>{if(e.querySelector(`script[src="${jr}"]`)){t();return}let r=e.createElement("script");r.src=jr,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)}),Qe)}async function Gr(e){var E,v,C,x,k,w;let t=(E=e.host)!=null?E:window,n=t.document;await Ya(n);let r=(C=(v=t.google)==null?void 0:v.accounts)==null?void 0:C.id;if(!r)throw new Error("Google Identity Services unavailable.");r.initialize({client_id:e.clientId,nonce:e.nonce,callback:S=>{var T;S.credential?(Ga=!0,e.onCredential(S.credential)):(T=e.onError)==null||T.call(e,new Error("Google returned no credential."))}});let o=e.wrapper.style.position!=="";o||(e.wrapper.style.position="relative");let s=(x=e.visible)!=null?x:!1,a=n.createElement("div");s||a.setAttribute("aria-hidden","true");let l=.004;a.style.cssText=`position:absolute;inset:0;z-index:2;opacity:${s?1:l};overflow:hidden;`,e.wrapper.appendChild(a);let i={provider:"google",wrapper:e.wrapper,overlay:a};Kr.add(i);let c=S=>{let T=S==null?void 0:S.style;T&&(T.width!=="100%"&&(T.width="100%"),T.height!=="100%"&&(T.height="100%"))},d=()=>{c(a.firstElementChild);let S=a.querySelector("iframe");c(S);let T=S==null?void 0:S.style;T&&T.margin!=="0px"&&(T.margin="0")},u=()=>{var I;let S=Math.round(e.wrapper.getBoundingClientRect().width)||320,T=Math.max(200,Math.min(400,S));a.replaceChildren(),r.renderButton(a,{type:"standard",theme:"outline",size:(I=e.size)!=null?I:"large",text:"continue_with",width:T}),d(),p()},f=S=>({width:S.width,height:S.height,top:S.top,left:S.left,right:S.right,bottom:S.bottom}),p=()=>{if(Va()&&typeof window!="undefined")try{let S=e.wrapper.getBoundingClientRect(),T=a.getBoundingClientRect(),I=T.left<=S.left+1&&T.top<=S.top+1&&T.right>=S.right-1&&T.bottom>=S.bottom-1,X=a.querySelector("iframe"),$=X==null?void 0:X.getBoundingClientRect(),B=!!$&&$.width>=8&&$.height>=8;(!I||!B)&&console.warn("[atlas] Google overlay misaligned/undersized \u2014 clicks may miss the invisible GSI button",{covers:I,iframeOk:B,wrapper:f(S),overlay:f(T),iframe:$?{width:$.width,height:$.height}:null})}catch{}};u();let m,b=(k=t.ResizeObserver)!=null?k:typeof ResizeObserver!="undefined"?ResizeObserver:void 0;b&&(m=new b(()=>u()),m.observe(e.wrapper));let y,A=(w=t.MutationObserver)!=null?w:typeof MutationObserver!="undefined"?MutationObserver:void 0;return A&&(y=new A(()=>d()),y.observe(a,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","width","height"]})),e.oneTap&&r.prompt(),{destroy:()=>{m==null||m.disconnect(),y==null||y.disconnect(),Kr.delete(i),a.remove(),o||(e.wrapper.style.position="")}}}var Ja=()=>{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 Yr(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 s=0;s<r.length;s+=1)o[s]=r.charCodeAt(s);return o.buffer}function be(e){return typeof(e!=null?e:globalThis.PublicKeyCredential)!="undefined"}async function Qr(){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 Jr(e){return typeof e=="string"?new TextEncoder().encode(e):e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function Zr(e){return{first:Jr(e.first),...e.second!==void 0?{second:Jr(e.second)}:{}}}function Za(e,t){if(!e)return;let n={};return e.eval&&(n.eval=Zr(e.eval)),t==="get"&&e.evalByCredential&&(n.evalByCredential=Object.fromEntries(Object.entries(e.evalByCredential).map(([r,o])=>[r,Zr(o)]))),{prf:n}}var Xr=e=>e instanceof ArrayBuffer?new Uint8Array(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):void 0;function Xa(e){var s,a,l,i;let t=(a=(s=e.getClientExtensionResults)==null?void 0:s.call(e))!=null?a:{},n={credentialId:Ie(e.rawId)},r=t.prf;if(r&&typeof r=="object"){let c=Xr((l=r.results)==null?void 0:l.first),d=Xr((i=r.results)==null?void 0:i.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 tn(e,t={}){var l,i;let n=(l=t.host)!=null?l:Ja(),r=(i=e.allowCredentials)!=null?i:[],o={challenge:Yr(e.challenge),rpId:e.rpId,allowCredentials:r.map(c=>({type:c.type,id:Yr(c.id)})),userVerification:e.userVerification,timeout:e.timeout,...Qa(Za(t.prf,"get"),e.extensions)},s=await n.credentials.get({publicKey:o,...t.mediation?{mediation:t.mediation}:{},...t.signal?{signal:t.signal}:{}});if(!s)throw new Error("Passkey sign-in was cancelled.");let a=s.response;return t.onExtensionResults&&t.onExtensionResults(Xa(s)),{handle:e.handle,challenge:e.challenge,credential_id:Ie(s.rawId),authenticator_data:Ie(a.authenticatorData),client_data_json:Ie(a.clientDataJSON),signature:Ie(a.signature)}}function Qa(e,t){let n=t&&typeof t=="object"&&!Array.isArray(t)?t:void 0;return!e&&!n?{}:{extensions:{...n!=null?n:{},...e!=null?e:{}}}}var ei={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."},ti={checking:"captcha.checking",verified:"captcha.verified",puzzlePrompt:"captcha.puzzlePrompt",confirm:"captcha.puzzleConfirm",tile:"captcha.puzzleTile",alternative:"captcha.puzzleAlternative"};function nn(e){if(!e)return{};let t=typeof e=="function"?e:r=>e[r],n={};for(let[r,o]of Object.entries(ti)){let s=t(o);typeof s=="string"&&s.trim()&&s!==o&&(n[r]=s)}return n}var ni=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},et=2e3;async function ri(e,t,n,r=()=>!1){let o=new TextEncoder;for(let s=t;s<=n;s+=et){if(r())return null;let a=Math.min(n,s+et-1),l=[];for(let c=s;c<=a;c++)l.push(crypto.subtle.digest("SHA-256",o.encode(`${e.salt}${c}`)));let i=await Promise.all(l);for(let c=0;c<i.length;c++)if(ni(i[c])===e.challenge)return s+c}return null}var oi=`
|
|
3
|
+
`}async function jr(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 jt(){return typeof document!="undefined"&&typeof Blob!="undefined"&&typeof URL!="undefined"&&typeof URL.createObjectURL=="function"}function Kr(e,t="recovery-codes.txt"){var r;if(!jt())return!1;let n=URL.createObjectURL(new Blob([na(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 ra=/^[A-Za-z0-9_-]{3,64}$/,ue=e=>!!e&&typeof e=="object"&&!Array.isArray(e),Kt=e=>typeof e=="string"&&ra.test(e.trim())?e.trim():null,Vt=["referally","rewardful","tolt","promotekit","firstpromoter","partnerstack","dub"],Yr=["cookiemunch","onetrust","cookiebot","didomi","usercentrics","osano","cookieyes","complianz","klaro","tcf","consent_mode"];function _(e,t){try{return e!=null&&(typeof e=="object"||typeof e=="function")?e[t]:void 0}catch{return}}function Z(e,t,...n){try{return typeof e=="function"?e.apply(t,n):void 0}catch{return}}function Ie(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 Jr(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 Jr(Number(e));let t=Date.parse(e);if(Number.isFinite(t))return new Date(t).toISOString()}}function re(e,t,n,r,o){let i={source:e,code:Kt(t),clickId:Kt(n),anonId:Kt(r)},s=Jr(o);return s&&(i.capturedAt=s),i.code||i.clickId||i.anonId?i:null}var oa={referally:({win:e})=>{var r,o;let t=_(e,"aff"),n=Z(_(t,"getReferral"),t);return ue(n)?re("referally",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=_(e,"Rewardful");return re("rewardful",_(_(t,"affiliate"),"token"),_(t,"referral"),null)},tolt:({win:e})=>re("tolt",null,_(e,"tolt_referral"),null),promotekit:({win:e})=>re("promotekit",null,_(e,"promotekit_referral"),null),firstpromoter:({cookies:e})=>re("firstpromoter",Ie(e,"_fprom_ref"),Ie(e,"_fprom_tid"),null),partnerstack:({cookies:e})=>re("partnerstack",Ie(e,"ps_partner_key"),Ie(e,"ps_xid"),null),dub:({cookies:e})=>re("dub",null,Ie(e,"dub_id"),null)};function Gt(e){var n,r,o;if(typeof e!="function")return null;let t;try{t=e()}catch{return null}return ue(t)?re("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 Oe(e,t){for(let n of t){let r=oa[n];if(!r)continue;let o=null;try{o=r(e)}catch{o=null}if(o)return o}return null}var ia={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 Zr(e){var t;return(t=ia[e.trim().toLowerCase()])!=null?t:null}var ne=e=>typeof e=="boolean"?e:void 0;function J(e,t){return(n,r)=>{let o=t(r);if(o!==void 0)return o;let i=Zr(r),s=i?e[i]:void 0;return s?t(s):void 0}}var qt=null,qr=!1;function Yt(e){let t=_(e,"__tcfapi");qr||typeof t!="function"||(qr=!0,Z(t,e,"addEventListener",2,(n,r)=>{r&&ue(n)&&(qt=n)}))}function sa(e){if(qt)return qt;let t=null;return Z(_(e,"__tcfapi"),e,"getTCData",2,(n,r)=>{r&&ue(n)&&(t=n)}),t}var Vr={necessary:"necessary",preferences:"preferences",statistics:"statistics",marketing:"marketing"},Gr=(e,t)=>Array.isArray(e)&&e.includes(t),aa={cookiemunch:{present:e=>ue(_(_(e,"CookieMunch"),"consent")),ask:(e,t)=>{let n=_(_(e,"CookieMunch"),"consent");return J(Vr,r=>ne(_(n,r)))(e,t)}},onetrust:{present:e=>{var t;return typeof((t=_(e,"OnetrustActiveGroups"))!=null?t:_(e,"OptanonActiveGroups"))=="string"},ask:(e,t)=>{var r,o;let n=String((o=(r=_(e,"OnetrustActiveGroups"))!=null?r:_(e,"OptanonActiveGroups"))!=null?o:"").split(",").map(i=>i.trim()).filter(Boolean);return J({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=>!_(e,"CookieMunch")&&ue(_(_(e,"Cookiebot"),"consent")),ask:(e,t)=>{let n=_(_(e,"Cookiebot"),"consent");return J(Vr,r=>ne(_(n,r)))(e,t)}},didomi:{present:e=>typeof _(_(e,"Didomi"),"getUserStatus")=="function",ask:(e,t)=>{let n=_(e,"Didomi"),r=_(_(Z(_(n,"getUserStatus"),n),"purposes"),"global"),o=_(r,"enabled"),i=_(r,"disabled");return J({marketing:"cookies",statistics:"measure_content_performance"},s=>Gr(o,s)?!0:Gr(i,s)?!1:void 0)(e,t)}},usercentrics:{present:e=>typeof _(_(e,"UC_UI"),"getServicesBaseInfo")=="function",ask:(e,t)=>{let n=_(e,"UC_UI"),r=Z(_(n,"getServicesBaseInfo"),n);if(Array.isArray(r))return J({necessary:"essential",preferences:"functional",statistics:"functional",marketing:"marketing"},o=>{let i=r.filter(s=>_(s,"categorySlug")===o);return i.length?i.every(s=>_(_(s,"consent"),"status")===!0):void 0})(e,t)}},osano:{present:e=>typeof _(_(_(e,"Osano"),"cm"),"getConsent")=="function",ask:(e,t)=>{let n=_(_(e,"Osano"),"cm"),r=Z(_(n,"getConsent"),n);return J({necessary:"ESSENTIAL",preferences:"PERSONALIZATION",statistics:"ANALYTICS",marketing:"MARKETING"},o=>{var s;let i=(s=_(r,o))!=null?s:_(r,o.toUpperCase());return i==="ACCEPT"?!0:i==="DENY"?!1:void 0})(e,t)}},cookieyes:{present:e=>typeof _(e,"getCkyConsent")=="function",ask:(e,t)=>{let n=_(Z(_(e,"getCkyConsent"),e),"categories");return J({necessary:"necessary",preferences:"functional",statistics:"analytics",marketing:"advertisement"},r=>ne(_(n,r)))(e,t)}},complianz:{present:e=>typeof _(e,"cmplz_has_consent")=="function",ask:(e,t)=>J({necessary:"functional",preferences:"preferences",statistics:"statistics",marketing:"marketing"},n=>ne(Z(_(e,"cmplz_has_consent"),e,n)))(e,t)},klaro:{present:e=>typeof _(_(e,"klaro"),"getManager")=="function",ask:(e,t)=>{let n=_(e,"klaro"),r=_(Z(_(n,"getManager"),n),"consents");return ne(_(r,t))}},tcf:{present:e=>typeof _(e,"__tcfapi")=="function",ask:e=>{var n;let t=sa(e);if(t)return t.gdprApplies===!1?!0:(n=ne(_(_(_(t,"purpose"),"consents"),"1")))!=null?n:!1}},consent_mode:{present:e=>ue(_(_(_(e,"google_tag_data"),"ics"),"entries")),ask:(e,t)=>{let n=_(_(_(e,"google_tag_data"),"ics"),"entries");return J({preferences:"functionality_storage",statistics:"analytics_storage",marketing:"ad_storage"},r=>{var i;let o=_(n,r);return(i=ne(_(o,"update")))!=null?i:ne(_(o,"default"))})(e,t)}}};function la(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 Jt(e,t,n={}){let r=n.provider||"auto",o=()=>{let l=la(n.appConsent);return l===void 0?{granted:!1,by:"none"}:{granted:l,by:"app"}};if(r==="app")return o();let i=r==="auto"?Yr:[r],s=t.filter(l=>typeof l=="string"&&l.trim().length>0);for(let l of i){let a=aa[l],d=!1;try{d=!!a&&a.present(e)}catch{d=!1}if(!(!a||!d)){for(let c of s){let u;try{u=a.ask(e,c)}catch{u=void 0}if(u!==void 0)return{granted:u,by:l}}return{granted:!1,by:l}}}return o()}var Xr=new Set(["referally","rewardful","tolt","promotekit"]),Qr=["referally"],eo=Object.freeze({enabled:!1,sources:[],consentProvider:"auto",urlParams:[],contextCookie:null,consentCategory:"referrals",consentFallbackCategory:"marketing",challengeReferredSignups:"inherit",codeLookupUrl:null,signupCodeField:!1}),ca=/^[A-Za-z0-9_-]{3,64}$/,da=/^[A-Za-z0-9_.-]{1,40}$/,ua=/^[A-Za-z0-9_.-]{1,64}$/,Le=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function oe(e){if(typeof e!="string")return null;let t=e.trim();return ca.test(t)?t:null}function to(e){let t=Le(e)&&Le(e.referrals)?e.referrals:e;if(!Le(t)||t.enabled!==!0)return{...eo,urlParams:[],sources:[]};let n=Array.isArray(t.url_params)?t.url_params.filter(o=>typeof o=="string"&&da.test(o)).slice(0,10):[];return{enabled:!0,sources:Array.isArray(t.browser_sources)?t.browser_sources.filter(o=>typeof o=="string"&&/^[a-z0-9_]{1,40}$/.test(o)).slice(0,20):[...Qr],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:typeof t.context_cookie=="string"&&ua.test(t.context_cookie)?t.context_cookie:null,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 pa(e,t){if(!e)return null;let n;try{n=new URLSearchParams(e)}catch{return null}for(let r of t){let o=oe(n.get(r));if(o)return o}return null}function fa(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 l=i.get(s);if(l)try{r(new URL(l,t!=null?t:"https://invalid.example").search)}catch{}}}return n}function Ze(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 Ze(Number(e));let t=Date.parse(e);return Number.isFinite(t)?new Date(t).toISOString():null}function ga(e,t=Date.now()){var s,l,a;if(typeof e!="string"||!e||e.length>4096)return null;let n=e;try{n=decodeURIComponent(e)}catch{}let r=d=>{if(!d.startsWith("{"))return null;try{let c=JSON.parse(d);return Le(c)?c:null}catch{return null}},o=(s=r(e.trim()))!=null?s:r(n.trim());if(o){let d=Ze(o.exp);if(d&&Date.parse(d)<=t)return null;let c={code:oe(o.code),clickId:oe((l=o.clickId)!=null?l:o.click_id),anonId:oe((a=o.anonId)!=null?a:o.anon_id)},u=Ze(o.ts);return u&&(c.capturedAt=u),c.code||c.clickId||c.anonId?c:null}let i=oe(n);return i?{code:null,clickId:i,anonId:null}:null}function ma(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 ha=["ref_click_id","ref_anon_id","ref_consent","ref_captured_at"];function ya(e){if(!e)return null;let t;try{t=new URLSearchParams(e)}catch{return null}if(!ha.some(i=>t.get(i)!==null))return null;let n=t.get("ref_consent")==="granted",r={code:oe(t.get("ref")),clickId:oe(t.get("ref_click_id")),anonId:oe(t.get("ref_anon_id")),consentGranted:n},o=Ze(t.get("ref_captured_at"));return o&&(r.capturedAt=o),r.code||r.clickId||r.anonId?r:null}function Zt(e,t,n,r){var a;let i=!!(e.clickId||e.anonId)?t():null,s=!!(i!=null&&i.granted),l={code:e.code,click_id:s?e.clickId:null,anon_id:s?e.anonId:null,consent:s?"granted":"not_required",captured_at:(a=e.capturedAt)!=null?a:n,source:r,...i?{consent_by:i.by}:{}};return l.code||l.click_id||l.anon_id?l:null}function ba(e){return e.win!==void 0?e.win:{CookieMunch:e.cookieMunch,aff:e.aff}}function ka(e,t,n,r){var m,C;if(!e.enabled)return null;let o=(m=t.capturedAt)!=null?m:new Date().toISOString(),i=ba(t),s,l=()=>s!=null?s:s=Jt(i,[e.consentCategory,e.consentFallbackCategory],{provider:e.consentProvider,appConsent:n}),a=E=>E?Zt(E,l,o,E.source):null,d=(C=e.sources)!=null?C:Qr,c={win:i,cookies:t.cookies},u=a(Gt(r));if(u)return u;let f=a(Oe(c,d.filter(E=>Xr.has(E))));if(f)return f;let p=fa(t.searches,t.base);for(let E of p){let A=ya(E);if(!A)continue;let x=Zt(A,()=>A.consentGranted?{granted:!0,by:"url"}:l(),o,"url");if(x)return x}for(let E of p){let A=pa(E,e.urlParams);if(A)return{code:A,click_id:null,anon_id:null,consent:"not_required",captured_at:o,source:"url"}}let g=e.contextCookie?ga(ma(t.cookies,e.contextCookie)):null,y=g?Zt(g,l,o,"cookie"):null;return y||a(Oe(c,d.filter(E=>!Xr.has(E))))}var va=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/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/siwf/nonce","/v1/oauth/siwf/verify"]),_a=/^\/v1\/client\/(sign_ins\/[^/]+\/(prepare_first_factor|attempt_first_factor)|sign_ups\/[^/]+\/(prepare_verification|attempt_verification|passkey\/finish))$/;function no(e){var n;let t=(n=e.split("?")[0])!=null?n:e;return va.has(t)||_a.test(t)}var ve=()=>typeof window=="undefined"?null:window,Xe=[],ke=null;function Qt(){var t,n;let e=(n=(t=ve())==null?void 0:t.location)==null?void 0:n.search;!e||Xe.includes(e)||(Xe.push(e),ke!=null||(ke=new Date().toISOString()))}Qt();ve()&&Yt(ve());var Xt={};var be=new Map;function ro(e,t){return`${e!=null?e:""}|${t}`}function oo(e,t){!Le(t)||!("referrals"in t)||be.set(e,Promise.resolve(to(t)))}function io(e){let t=be.get(e.referralCacheKey);if(!t){let n=e.referralCacheKey,r=()=>(be.get(n)===t&&be.delete(n),{...eo,urlParams:[]});t=e.get("/v1/client/environment").then(o=>o.ok?to(o.data):r()).catch(r),be.set(n,t)}return t}function so(e){var n,r,o;let t=ve();return be.has(e.referralCacheKey)||!!((n=t==null?void 0:t.location)!=null&&n.search)||Xe.length>0||Gt(en(e).referralSource)!==null||Oe({win:t,cookies:(o=(r=t==null?void 0:t.document)==null?void 0:r.cookie)!=null?o:null},Vt)!==null}function en(e){var n,r,o;let t=e.referralOptions;return{referral:(n=t.referral)!=null?n:Xt.referral,referralConsent:(r=t.referralConsent)!=null?r:Xt.referralConsent,referralSource:(o=t.referralSource)!=null?o:Xt.referralSource}}async function tn(e){var r,o,i,s,l;let t=ve();if(!t)return null;let n=en(e);if(n.referral===!1)return null;try{let a=(o=(r=t.location)==null?void 0:r.search)!=null?o:"";if(!so(e))return null;let d=await io(e);return d.enabled?(Yt(t),ka(d,{searches:[a,...Xe],cookies:(s=(i=t.document)==null?void 0:i.cookie)!=null?s:null,win:t,base:(l=t.location)==null?void 0:l.href,capturedAt:ke!=null?ke:void 0},n.referralConsent,n.referralSource)):null}catch{return null}}async function nn(e){if(!ve()||en(e).referral===!1||!so(e))return!1;try{if((await io(e)).challengeReferredSignups!=="always")return!1;let n=await tn(e);return!!(n!=null&&n.code)}catch{return!1}}var ao=typeof window!="undefined",De=()=>typeof navigator!="undefined"?navigator:void 0;function D(e,t){try{return e()}catch{return t}}function xa(){return D(()=>{if(!ao||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 wa(){return D(()=>{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),sn(e.toDataURL())):null},null)}function Sa(){var l;let e=De(),t=ao?window:{},n=(l=e==null?void 0:e.userAgent)!=null?l:"",r=D(()=>(e==null?void 0:e.webdriver)===!0,!1),o=D(()=>"chrome"in t&&!!t.chrome,!1),i=/headless/i.test(n)||/chrome/i.test(n)&&!o&&D(()=>{var a,d;return((d=(a=e==null?void 0:e.plugins)==null?void 0:a.length)!=null?d:0)===0},!1),s=D(()=>r||"_phantom"in t||"callPhantom"in t||"__nightmare"in t||"domAutomation"in t||"domAutomationController"in t||typeof document!="undefined"&&Object.keys(document).some(a=>a.startsWith("cdc_")||a.startsWith("$cdc_"))||/electron|phantomjs|slimerjs/i.test(n),r);return{webdriver:r,headless:i,hasChrome:o,automationHint:s}}function Ca(){let e=De(),t=xa(),n=Sa(),r=D(()=>{var i;return Array.from((i=e==null?void 0:e.languages)!=null?i:[])},[]),o=t.renderer;return{screenWidth:D(()=>{var i,s;return(s=(i=window.screen)==null?void 0:i.width)!=null?s:null},null),screenHeight:D(()=>{var i,s;return(s=(i=window.screen)==null?void 0:i.height)!=null?s:null},null),colorDepth:D(()=>{var i,s;return(s=(i=window.screen)==null?void 0:i.colorDepth)!=null?s:null},null),pixelRatio:D(()=>{var i;return(i=window.devicePixelRatio)!=null?i:null},null),timezone:D(()=>{var i;return(i=Intl.DateTimeFormat().resolvedOptions().timeZone)!=null?i:null},null),timezoneOffset:D(()=>new Date().getTimezoneOffset(),null),language:D(()=>{var i;return(i=e==null?void 0:e.language)!=null?i:null},null),languages:r,platform:D(()=>{var i;return(i=e==null?void 0:e.platform)!=null?i:null},null),hardwareConcurrency:D(()=>{var i;return(i=e==null?void 0:e.hardwareConcurrency)!=null?i:null},null),deviceMemory:D(()=>{var i;return(i=e==null?void 0:e.deviceMemory)!=null?i:null},null),maxTouchPoints:D(()=>{var i;return(i=e==null?void 0:e.maxTouchPoints)!=null?i:null},null),touchSupport:D(()=>{var i;return((i=e==null?void 0:e.maxTouchPoints)!=null?i:0)>0||"ontouchstart"in window},!1),cookieEnabled:D(()=>{var i;return(i=e==null?void 0:e.cookieEnabled)!=null?i:null},null),doNotTrack:D(()=>(e==null?void 0:e.doNotTrack)==="1"||(e==null?void 0:e.doNotTrack)==="yes",null),webglVendor:t.vendor,webglRenderer:o,pluginCount:D(()=>{var i,s;return(s=(i=e==null?void 0:e.plugins)==null?void 0:i.length)!=null?s:null},null),pointerType:D(()=>{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 Ea(){var e;return(e=D(()=>{var o,i;let t=De(),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 on(){return D(()=>{let e=()=>{var r,o;return"d_"+sn(String(Math.random())+String(Date.now())+((o=(r=De())==null?void 0:r.userAgent)!=null?o:""))};if(Ea())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 Aa(e){let t=[e.timezone,e.platform,e.languages.join(","),e.webglVendor,e.webglRenderer,e.screenWidth,e.screenHeight,e.colorDepth,e.hardwareConcurrency,wa()];return sn(t.map(n=>n==null?"":String(n)).join("|"))}function sn(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 Qe=e=>e.length?e.reduce((t,n)=>t+n,0)/e.length:null,rn=e=>{let t=Qe(e);return t===null?null:e.reduce((n,r)=>n+(r-t)**2,0)/e.length},et=class{constructor(t){k(this,"start",Date.now());k(this,"firstInteraction",null);k(this,"moves",0);k(this,"distance",0);k(this,"maxSpeed",0);k(this,"speeds",[]);k(this,"lastX",null);k(this,"lastY",null);k(this,"lastMoveT",0);k(this,"netDx",0);k(this,"netDy",0);k(this,"keyCount",0);k(this,"downAt",new Map);k(this,"dwell",[]);k(this,"flight",[]);k(this,"lastUpAt",null);k(this,"pastes",0);k(this,"backspaces",0);k(this,"focusChanges",0);k(this,"scrolls",0);k(this,"target");k(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)=>{D(()=>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 l=n-this.lastX,a=r-this.lastY,d=Math.hypot(l,a);this.distance+=d,this.netDx+=l,this.netDy+=a;let c=o-this.lastMoveT;if(c>0){let u=d/c;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:Qe(this.speeds),mouseMaxSpeed:Math.round(this.maxSpeed*1e3)/1e3,mouseSpeedVariance:rn(this.speeds),mouseStraightLineRatio:this.distance>0?Math.min(1,t/this.distance):null,keyCount:this.keyCount,keyAvgDwellMs:Qe(this.dwell),keyAvgFlightMs:Qe(this.flight),keyDwellVariance:rn(this.dwell),keyFlightVariance:rn(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)D(()=>t.removeEventListener(n,r),void 0);this.bound=[]}}};async function lo(e){return D(async()=>{var a,d,c;let t=Ca(),n={attempt_id:e.attemptId,kind:(a=e.kind)!=null?a:"telemetry",device_id:on(),device_fingerprint:Aa(t),device:t,behavior:(d=e.recorder)==null?void 0:d.snapshot()},r=`${e.api}/v1/client/telemetry?publishable_key=${encodeURIComponent(e.publishableKey)}`,o=JSON.stringify(n),i=De();if(!e.fetchImpl&&i&&typeof i.sendBeacon=="function"&&typeof Blob!="undefined"&&i.sendBeacon(r,new Blob([o],{type:"application/json"})))return!0;let s=(c=e.fetchImpl)!=null?c: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 Pa=["checkbox","scroll","link"];function W(e){return typeof e=="string"&&e!==""?e:null}function Ra(e){return typeof e=="number"&&Number.isFinite(e)?new Date(e).toISOString():W(e)}function ln(e){var a,d,c,u,f;if(!e||typeof e!="object")return null;let t=e,n=[t.version,t.current_version].find(p=>p&&typeof p=="object"),r=p=>t[p]!==void 0?t[p]:n==null?void 0:n[p],o=(a=W(t.key))!=null?a:W(t.policy),i=(d=W(r("version_id")))!=null?d:W(n==null?void 0:n.id);if(!o||!i)return null;let s=Pa.includes(t.display)?t.display:"checkbox",l=(c=W(typeof t.version=="string"?t.version:n==null?void 0:n.version))!=null?c:"";return{key:o,title:(u=W(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:l,contentHtml:W(r("content_html")),contentMarkdown:W(r("content_markdown")),contentUrl:W(r("content_url")),contentSha256:(f=W(r("content_sha256")))!=null?f:"",effectiveAt:Ra(r("effective_at")),summaryOfChanges:W(r("summary_of_changes")),reaccept:typeof t.reaccept=="boolean"?t.reaccept:null}}function Ta(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(ln).filter(r=>r!==null):[]}function cn(e){return!!(e!=null&&e.some(t=>t.code==="POLICY_ACCEPTANCE_REQUIRED"))}async function Fe(e,t={}){let n=await xr(e,t.locale?{locale:t.locale}:{});if(!n.ok)return[];let r=Ta(n.data);return t.signIn?r.filter(o=>o.appliesTo==="sign_in_and_sign_up"):r}function co(e){if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}var _e=class{constructor(t=[],n={}){k(this,"list",[]);k(this,"entries",new Map);k(this,"open",null);k(this,"listeners",new Set);k(this,"now");k(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 Ia(e,t=2){return e.scrollHeight-e.clientHeight-e.scrollTop<=t}function dn(e,t,n){let r=!1,o=null,i=()=>{r||(r=!0,l(),n())},s=()=>{Ia(e)&&i()},l=()=>{o==null||o.disconnect(),e.removeEventListener("scroll",s),typeof window!="undefined"&&window.removeEventListener("resize",s)};return t&&typeof IntersectionObserver!="undefined"&&(o=new IntersectionObserver(a=>{a.some(d=>d.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,l()}}var Oa='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])';function uo(e,t={}){var s;let n=e.ownerDocument,r=n.activeElement,o=l=>{if(l.key==="Escape"&&t.escape!==!0){l.preventDefault(),l.stopPropagation();return}if(l.key!=="Tab")return;let a=Array.from(e.querySelectorAll(Oa)).filter(f=>!f.hasAttribute("hidden"));if(a.length===0){l.preventDefault(),e.focus();return}let d=a[0],c=a[a.length-1],u=n.activeElement;l.shiftKey&&(u===d||!e.contains(u))?(l.preventDefault(),c.focus()):!l.shiftKey&&(u===c||!e.contains(u))&&(l.preventDefault(),d.focus())},i=l=>{var a;l.target instanceof Node&&!e.contains(l.target)&&((a=t.initialFocus)!=null?a:e).focus()};return n.addEventListener("keydown",o,!0),n.addEventListener("focusin",i),((s=t.initialFocus)!=null?s:e).focus(),()=>{var l;n.removeEventListener("keydown",o,!0),n.removeEventListener("focusin",i),(l=r==null?void 0:r.focus)==null||l.call(r)}}function La(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function an(e){let t=La(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 Da(e){let t=e.replace(/\r\n?/g,`
|
|
5
|
+
`).split(`
|
|
6
|
+
`),n=[],r=[],o=null,i=()=>{r.length&&n.push(`<p>${an(r.join(" "))}</p>`),r=[]},s=()=>{o&&n.push(`</${o}>`),o=null};for(let l of t){let a=/^(#{1,6})\s+(.*)$/.exec(l),d=/^\s*[-*+]\s+(.*)$/.exec(l),c=/^\s*\d+[.)]\s+(.*)$/.exec(l);if(a){i(),s();let u=a[1].length;n.push(`<h${u}>${an(a[2])}</h${u}>`)}else if(d||c){i();let u=d?"ul":"ol";o!==u&&(s(),n.push(`<${u}>`),o=u),n.push(`<li>${an((d!=null?d:c)[1])}</li>`)}else l.trim()===""?(i(),s()):(s(),r.push(l.trim()))}return i(),s(),n.join(`
|
|
7
|
+
`)}function po(e){return e.contentHtml?e.contentHtml:e.contentMarkdown?Da(e.contentMarkdown):""}function fo(e){if(!e)return"";let t=new Date(e);return Number.isNaN(t.getTime())?"":t.toISOString().slice(0,10)}var Fa=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 go(e){return(t,n={})=>{var i;let r=e(t,n);return r&&r!==t?r:((i=Fa[t])!=null?i:t).replace(/\{(\w+)\}/g,(s,l)=>{var a;return(a=n[l])!=null?a:s})}}function un(e,t){let n=e.indexOf(`{${t}}`);return n<0?[e,""]:[e.slice(0,n),e.slice(n+t.length+2)]}async function mo(e,t,n={}){let r=Array.isArray(t==null?void 0:t.pending_policies)?t.pending_policies:[];if(r.length===0){let i=await Fe(e,n);return new _e(i.filter(s=>s.required),n)}let o=r.map(ln).filter(i=>i!==null);if(o.some(i=>!i.contentHtml&&!i.contentMarkdown)){let i=await Fe(e,n);o=o.map((s,l)=>{var u,f,p,g;let a=i.find(y=>y.key===s.key);if(!a)return s;let d=(u=r.find(y=>{var m;return((m=ln(y))==null?void 0:m.key)===s.key}))!=null?u:r[l],c=y=>d[y]!==void 0&&d[y]!==null;return{...a,...c("title")?{title:s.title}:{},...c("display")?{display:s.display}:{},versionId:s.versionId,version:s.version||a.version,contentHtml:(f=s.contentHtml)!=null?f:a.contentHtml,contentMarkdown:(p=s.contentMarkdown)!=null?p:a.contentMarkdown,contentSha256:s.contentSha256||a.contentSha256,summaryOfChanges:(g=s.summaryOfChanges)!=null?g:a.summaryOfChanges,reaccept:s.reaccept}})}return new _e(o.map(i=>({...i,required:!0})),n)}function ho(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 Ma=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/discourse","/v1/client/sign_ins/id_token","/v1/client/sign_ins/external_jwt","/v1/client/sign_ins/ldap","/v1/oauth/telegram","/v1/oauth/siwe/verify","/v1/oauth/siws/verify","/v1/oauth/siwf/verify"]),tt=class{constructor(t){this.options=t;Qt()}get referralCacheKey(){return ro(this.options.baseUrl,this.options.publishableKey)}get referralOptions(){return{referral:this.options.referral,referralConsent:this.options.referralConsent,referralSource:this.options.referralSource}}get locale(){return ho(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 d,c,u,f;let r=Ht(this.options.publishableKey,(d=this.options.fetchImpl)!=null?d:fetch),o=this.locale,i=(c=this.options.sdk)!=null?c:Er,s;try{s=await r(`${(u=this.options.baseUrl)!=null?u:""}${t}`,{...n,credentials:"include",headers:{"x-publishable-key":this.options.publishableKey,[Ar]:Pr(i),...o?{"accept-language":o}:{},...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."}]}}Rr(s,i);let l=null;try{l=await s.json()}catch{}let a=t.split("?")[0];return s.ok&&((f=n.method)!=null?f:"GET")==="GET"&&(a==="/v1/client/environment"||a==="/v1/appearance")&&oo(this.referralCacheKey,l),{ok:s.ok,status:s.status,data:s.ok?l:null,errors:s.ok?[]:ur(l)}}async post(t,n){let r=n;if(r!==null&&typeof r=="object"&&!Array.isArray(r)&&!("referral"in r)&&no(t)){let i=await tn(this);i&&(r={...r,referral:i})}let o=t.split("?")[0];if(o!==void 0&&Ma.has(o)&&r!==null&&typeof r=="object"&&!Array.isArray(r)&&!("device_id"in r)){let i=on();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"})}};var B={attempt:null,errors:[],busy:!1,pollSecret:null,ticket:null,prepared:null};function Ua(e,t){var o,i,s,l,a,d,c,u,f,p,g,y,m;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=$(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:(l=t.password)!=null?l:""}};case"collect_second_factor":return{path:`/v1/client/sign_ins/${r}/attempt_second_factor`,body:{code:(a=t.code)!=null?a:"",...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:(d=t.factorId)!=null?d:"",code:(c=t.code)!=null?c:""}}:{path:`/v1/client/sign_ins/${r}/attempt_mfa_enrollment`,body:{factor_id:(u=t.factorId)!=null?u:"",codes:[(f=t.code)!=null?f:"",(p=t.secondCode)!=null?p:""]}};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:(y=t.identifier)!=null?y:"",captcha_token:t.captcha_token}}:null;case"collect_new_password":return{path:`/v1/client/password_resets/${r}/set_new_password`,body:{password:(m=t.password)!=null?m:""}};case"accept_policies":return{path:`/v1/client/sign_ins/${r}/accept_policies`,body:wr({policyToken:t.policy_acceptance_token,attempt:e,pollSecret:t.poll_secret},co(t.policy_acceptances))};case"await_oauth":case"done":case"restart":case"unknown":return null}}function nt(e){return e?{...B,attempt:{id:e.id,status:e.status},...e.policyToken?{policyToken:e.policyToken}:{}}:B}async function Me(e,t,n){var u,f,p,g;let r=t.attempt?$(t.attempt).kind==="accept_policies":!1,o={};r&&t.policyToken&&n.policy_acceptance_token===void 0&&(o.policy_acceptance_token=t.policyToken),r&&t.pollSecret&&n.poll_secret===void 0&&(o.poll_secret=t.pollSecret);let i=Ua(t.attempt,{...n,...o});if(!i)return t;let s=await e.post(i.path,i.body);if(!s.ok||!s.data)return{...t,busy:!1,errors:s.errors};let{backup_codes:l,...a}=s.data,d=Hr(l),c=a.id===((u=t.attempt)==null?void 0:u.id)&&a.status===((f=t.attempt)==null?void 0:f.status);return{attempt:a,errors:[],busy:!1,pollSecret:t.pollSecret,ticket:(p=a.ticket)!=null?p:null,prepared:c&&(g=t.prepared)!=null?g:null,...d?{recoveryCodes:d}:{},...a.policy_acceptance_token?{policyToken:a.policy_acceptance_token}:{}}}async function pn(e,t){var o,i;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?{...B,busy:!1,errors:r.errors}:{attempt:r.data,errors:[],busy:!1,pollSecret:(o=r.data.poll_secret)!=null?o:B.pollSecret,ticket:(i=r.data.ticket)!=null?i:null,...r.data.policy_acceptance_token?{policyToken:r.data.policy_acceptance_token}:{}}}async function yo(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 rt(e,t){return!!e&&e.object==="sign_up_attempt"&&e.status==="needs_email_verification"&&t==="link"}async function bo(e,t,n){var i,s,l;let r=(i=t.attempt)==null?void 0:i.id;if(!r)return t;let o=await e.post(`/v1/client/sign_ins/${r}/prepare_first_factor`,{strategy:n});return o.ok?{...t,busy:!1,errors:[],pollSecret:n==="email_link"&&(l=(s=o.data)==null?void 0:s.poll_secret)!=null?l:null,prepared:n}:{...t,busy:!1,errors:o.errors}}async function ko(e,t){var i,s,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)}`);return!o.ok||!o.data?{state:t,ticket:null}:{state:{...t,attempt:o.data},ticket:(l=o.data.ticket)!=null?l:null}}function fn(e){var r;if(!e.pollSecret||!e.attempt||dr(e.attempt))return!1;let t=e.attempt;return!(t.object==="sign_up_attempt"&&t.status==="needs_first_factor"&&((r=t.supported_first_factors)!=null?r:[]).includes("passkey"))}var Cd=Object.freeze({entries:[],loading:!1,forbidden:!1,hasMore:!1});var za=`.atlas-policy-consent{display:flex;flex-direction:column;gap:8px;font-size:.875rem;}
|
|
8
|
+
.atlas-policy-row{display:flex;gap:8px;align-items:flex-start;}
|
|
9
|
+
.atlas-policy-link{padding:0;font:inherit;color:var(--atlas-color-primary,#5b5bd6);background:none;border:0;cursor:pointer;text-decoration:underline;}
|
|
10
|
+
.atlas-policy-clickwrap{margin:0;font-size:.8125rem;color:var(--atlas-color-muted,#666);text-align:center;}
|
|
11
|
+
.atlas-policy-viewer{display:flex;flex-direction:column;gap:8px;border:1px solid var(--atlas-color-border,#e4e4e9);border-radius:var(--atlas-border-radius,8px);padding:12px;}
|
|
12
|
+
.atlas-policy-viewer-head{display:flex;justify-content:space-between;align-items:center;gap:8px;}
|
|
13
|
+
.atlas-policy-meta{margin:0;font-size:.75rem;color:var(--atlas-color-muted,#666);}
|
|
14
|
+
.atlas-policy-body{max-height:min(50vh,22rem);overflow:auto;padding:0 4px;font-size:.875rem;line-height:1.55;overscroll-behavior:contain;}
|
|
15
|
+
.atlas-policy-body:focus-visible{outline:2px solid var(--atlas-color-focus-ring,var(--atlas-color-primary,#5b5bd6));outline-offset:2px;}
|
|
16
|
+
.atlas-policy-sentinel{display:block;height:1px;}
|
|
17
|
+
.atlas-policy-overlay{position:fixed;inset:0;z-index:2147483000;display:flex;align-items:center;justify-content:center;padding:16px;background:rgba(0,0,0,.55);}
|
|
18
|
+
.atlas-policy-modal{display:flex;flex-direction:column;gap:12px;width:100%;max-width:36rem;max-height:calc(100vh - 32px);padding:20px;background:var(--atlas-color-background,#fff);color:var(--atlas-color-text,#1c1c1f);border:1px solid var(--atlas-color-border,#e4e4e9);border-radius:var(--atlas-border-radius,8px);box-shadow:0 12px 40px rgba(0,0,0,.3);font-family:var(--atlas-font-family,ui-sans-serif,system-ui,sans-serif);}
|
|
19
|
+
.atlas-policy-modal h2{margin:0;font-size:1.125rem;}
|
|
20
|
+
.atlas-policy-summary{padding:8px 12px;font-size:.8125rem;background:var(--atlas-color-surface,rgba(91,91,214,.08));border-radius:var(--atlas-border-radius,8px);}
|
|
21
|
+
.atlas-policy-summary strong{display:block;margin-bottom:2px;}
|
|
22
|
+
.atlas-policy-hint{margin:0;font-size:.8125rem;color:var(--atlas-color-muted,#666);}
|
|
23
|
+
.atlas-policy-actions{display:flex;justify-content:flex-end;gap:8px;}
|
|
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
|
+
.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
|
+
.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));}`,vo="atlas-policy-styles";function yn(e=document){if(e.getElementById(vo))return;let t=e.createElement("style");t.id=vo,t.textContent=za,e.head.appendChild(t)}var Na=new Set(["SCRIPT","STYLE","IFRAME","OBJECT","EMBED","FORM","LINK","META","BASE","SVG","MATH"]);function $a(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(Na.has(o.tagName.toUpperCase())){o.remove();continue}for(let i of Array.from(o.attributes)){let s=i.name.toLowerCase(),l=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(l))&&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 _o(e){return $a(po(e))}function O(e,t,n,r={},o){let i=e.createElement(t);n&&(i.className=n);for(let[s,l]of Object.entries(r))i.setAttribute(s,l);return o!==void 0&&(i.textContent=o),i}var z=(...e)=>e.filter(Boolean).join(" "),mn=0,gn=new WeakSet,ot=new WeakMap;function hn(e,t,n,r){var i;let o=O(e,"button",z("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 xo(e,t,n,r){let[o,i]=un(t,"policies"),s=e.createDocumentFragment();return s.append(o),n.forEach((l,a)=>{a>0&&s.append(a===n.length-1?` ${r} `:", "),s.append(l)}),s.append(i),s}function bn(e,t,n){var d;let r=(d=n.document)!=null?d:e.ownerDocument,{t:o,classes:i}=n,s=null,l=()=>{s==null||s(),s=null,e.textContent="",e.className=z("atlas-policy-consent",i==null?void 0:i.root),e.setAttribute("data-atlas-policies","");let c=t.viewing;if(c){e.append(Ba(r,c,t,n,p=>s=p));return}let u=t.checkboxPolicies();if(u.length===0)return;let f=o("policy.and");if(t.combined){let p=`atlas-policy-${++mn}`,g=O(r,"div","atlas-policy-row atlas-consent"),y=O(r,"input",z("atlas-policy-checkbox",i==null?void 0:i.checkbox),{type:"checkbox",id:p,name:"policies","data-atlas-policy-all":""});y.checked=t.snapshot().combinedChecked,y.addEventListener("change",()=>t.setAllChecked(y.checked));let m=O(r,"label",z("atlas-text",i==null?void 0:i.text),{for:p});m.append(xo(r,o("policy.agreeCombined"),u.map(C=>hn(r,C,t,n)),f)),g.append(y,m),e.append(g)}else for(let p of u){let g=`atlas-policy-${++mn}`,y=O(r,"div","atlas-policy-row atlas-consent"),m=O(r,"input",z("atlas-policy-checkbox",i==null?void 0:i.checkbox),{type:"checkbox",id:g,name:`policy_${p.key}`,"data-atlas-policy-box":p.key});m.checked=t.isChecked(p.key),m.addEventListener("change",()=>t.setChecked(p.key,m.checked));let C=O(r,"label",z("atlas-text",i==null?void 0:i.text),{for:g}),[E,A]=un(o("policy.agreeOne"),"policy");C.append(E,hn(r,p,t,n),A),y.append(m,C),e.append(y)}},a=t.subscribe(l);return l(),{render:l,destroy(){a(),s==null||s(),e.textContent=""}}}function kn(e,t,n){var a;let r=(a=n.document)!=null?a:e.ownerDocument,{t:o,classes:i}=n,s=()=>{e.textContent="";let d=t.linkPolicies();e.hidden=d.length===0,d.length!==0&&(e.className=z("atlas-policy-clickwrap",i==null?void 0:i.text),e.setAttribute("data-atlas-policy-clickwrap",""),e.append(xo(r,o("policy.clickwrap"),d.map(c=>hn(r,c,t,n)),o("policy.and"))))},l=t.subscribe(s);return s(),{render:s,destroy(){l(),e.textContent=""}}}function Ba(e,t,n,r,o){let{t:i,classes:s}=r,l=O(e,"div",z("atlas-policy-viewer",s==null?void 0:s.viewer),{role:"region","aria-label":t.title,"data-atlas-policy-viewer":t.key}),a=O(e,"div","atlas-policy-viewer-head");a.append(O(e,"strong",void 0,{},t.title));let d=O(e,"button",z("atlas-policy-link",s==null?void 0:s.link),{type:"button","data-atlas-policy-back":""},i("policy.viewerBack"));d.addEventListener("click",()=>n.closeDocument()),a.append(d);let c=[t.version?i("policy.version",{version:t.version}):"",t.effectiveAt?i("policy.effective",{date:fo(t.effectiveAt)}):""].filter(Boolean).join(" \xB7 "),u=O(e,"div",z("atlas-policy-body",s==null?void 0:s.viewerBody),{tabindex:"0","data-atlas-policy-content":""});u.innerHTML=_o(t);let f=O(e,"span","atlas-policy-sentinel",{"aria-hidden":"true"});return u.append(f),l.append(a),c&&l.append(O(e,"p","atlas-policy-meta",{},c)),l.append(u),o(dn(u,f,()=>n.markScrolledToEnd(t.key))),l}function Ha(e,t){var v,S;let n=(v=t.document)!=null?v:document,{t:r,classes:o,controller:i}=t,s=++mn,l=`atlas-policy-title-${s}`,a=`atlas-policy-hint-${s}`,d=O(n,"div",z("atlas-policy-overlay",o==null?void 0:o.overlay),{"data-atlas-policy-modal":e.key}),c=O(n,"div",z("atlas-policy-modal",o==null?void 0:o.modal),{role:"dialog","aria-modal":"true","aria-labelledby":l,"aria-describedby":a,tabindex:"-1"});if(c.append(O(n,"h2",void 0,{id:l},t.reaccept&&e.reaccept!==!1?r("policy.reacceptTitle",{policy:e.title}):e.title)),t.reaccept&&e.reaccept!==!1&&e.summaryOfChanges){let w=O(n,"div",z("atlas-policy-summary",o==null?void 0:o.summary),{"data-atlas-policy-summary":""});w.append(O(n,"strong",void 0,{},r("policy.summaryTitle")),O(n,"span",void 0,{},e.summaryOfChanges)),c.append(w)}let u=O(n,"div",z("atlas-policy-body",o==null?void 0:o.viewerBody),{tabindex:"0",role:"region","aria-label":e.title,"data-atlas-policy-content":""});u.innerHTML=_o(e);let f=O(n,"span","atlas-policy-sentinel",{"aria-hidden":"true","data-atlas-policy-end":""});u.append(f);let p=O(n,"p","atlas-policy-hint",{id:a,"aria-live":"polite"},r("policy.scrollHint")),g=O(n,"div","atlas-policy-actions"),y=O(n,"button",z(o==null?void 0:o.button),{type:"button","data-atlas-policy-decline":""},r("policy.decline")),m=O(n,"button",z("atlas-policy-accept",o==null?void 0:o.primaryButton),{type:"button","data-atlas-policy-accept":"",disabled:"","aria-disabled":"true"},r("policy.accept"));g.append(y,m),c.append(u,p,g),d.append(c),((S=t.container)!=null?S:n.body).append(d);let C=!1,E=dn(u,f,()=>{C=!0,m.disabled=!1,m.removeAttribute("disabled"),m.setAttribute("aria-disabled","false"),p.textContent="",i==null||i.markScrolledToEnd(e.key)});i==null||i.startClock(e.key);let A=uo(c,{initialFocus:u}),x=!1,b=()=>{x||(x=!0,E(),A(),i==null||i.stopClock(e.key),d.remove())};return m.addEventListener("click",()=>{C&&(b(),t.onAccept())}),y.addEventListener("click",()=>{b(),t.onDecline()}),{close:b,get acceptEnabled(){return C}}}function vn(e,t){return new Promise(n=>{let r=()=>{let o=e.pendingScroll();if(!o){n(!0);return}Ha(o,{...t,controller:e,onAccept:()=>{e.acceptScroll(o.key),r()},onDecline:()=>n(!1)})};r()})}function wo(e,t,n){var E;let r=(E=n.document)!=null?E:e.ownerDocument,{t:o,classes:i}=n,s=!1,l=!0;e.textContent="",e.setAttribute("data-atlas-policy-step","");let a=t.policies.some(A=>A.display!=="scroll");e.append(O(r,"p",z("atlas-text",i==null?void 0:i.text),{},o("policy.pendingIntro")));let d=O(r,"div"),c=O(r,"p"),u=bn(d,t,n),f=kn(c,t,n);e.append(d);let p=null,g=()=>{p&&(p.disabled=s||!t.canSubmit()||t.pendingScroll()!==null)};a&&(p=O(r,"button",z("atlas-button",i==null?void 0:i.primaryButton),{type:"button","data-atlas-policy-continue":""},o("policy.submit")),p.addEventListener("click",()=>n.onSubmit(t.build())),e.append(p)),e.append(c);let y=t.subscribe(g);g();let m={hasOthers:a,onSubmit:n.onSubmit,onDecline:n.onDecline};return ot.set(t,m),(()=>{!l||gn.has(t)||!t.pendingScroll()||(gn.add(t),vn(t,{...n,reaccept:!0}).then(A=>{gn.delete(t);let x=ot.get(t);if(x)if(A)x.hasOthers||x.onSubmit(t.build());else{let b=t.policies.find(v=>v.display==="scroll"&&!t.isChecked(v.key));b&&x.onDecline(b)}}))})(),{render(){u.render(),f.render(),g()},setBusy(A){s=A,g()},destroy(){l=!1,ot.get(t)===m&&ot.delete(t),y(),u.destroy(),f.destroy(),e.textContent=""}}}function Eo(e){return{provider:e.provider,id_token:e.idToken,...e.nonce?{nonce:e.nonce}:{}}}function Ao(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 So="https://accounts.google.com/gsi/client",it=null;function Wa(){return typeof process!="undefined"&&!1}var Co=new Set,ja=!1;function Ka(e){return it||(it=new Promise((t,n)=>{if(e.querySelector(`script[src="${So}"]`)){t();return}let r=e.createElement("script");r.src=So,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)}),it)}async function Po(e){var E,A,x,b,v,S;let t=(E=e.host)!=null?E:window,n=t.document;await Ka(n);let r=(x=(A=t.google)==null?void 0:A.accounts)==null?void 0:x.id;if(!r)throw new Error("Google Identity Services unavailable.");r.initialize({client_id:e.clientId,nonce:e.nonce,callback:w=>{var T;w.credential?(ja=!0,e.onCredential(w.credential)):(T=e.onError)==null||T.call(e,new Error("Google returned no credential."))}});let o=e.wrapper.style.position!=="";o||(e.wrapper.style.position="relative");let i=(b=e.visible)!=null?b:!1,s=n.createElement("div");i||s.setAttribute("aria-hidden","true");let l=.004;s.style.cssText=`position:absolute;inset:0;z-index:2;opacity:${i?1:l};overflow:hidden;`,e.wrapper.appendChild(s);let a={provider:"google",wrapper:e.wrapper,overlay:s};Co.add(a);let d=w=>{let T=w==null?void 0:w.style;T&&(T.width!=="100%"&&(T.width="100%"),T.height!=="100%"&&(T.height="100%"))},c=()=>{d(s.firstElementChild);let w=s.querySelector("iframe");d(w);let T=w==null?void 0:w.style;T&&T.margin!=="0px"&&(T.margin="0")},u=()=>{var L;let w=Math.round(e.wrapper.getBoundingClientRect().width)||320,T=Math.max(200,Math.min(400,w));s.replaceChildren(),r.renderButton(s,{type:"standard",theme:"outline",size:(L=e.size)!=null?L:"large",text:"continue_with",width:T}),c(),p()},f=w=>({width:w.width,height:w.height,top:w.top,left:w.left,right:w.right,bottom:w.bottom}),p=()=>{if(Wa()&&typeof window!="undefined")try{let w=e.wrapper.getBoundingClientRect(),T=s.getBoundingClientRect(),L=T.left<=w.left+1&&T.top<=w.top+1&&T.right>=w.right-1&&T.bottom>=w.bottom-1,te=s.querySelector("iframe"),H=te==null?void 0:te.getBoundingClientRect(),j=!!H&&H.width>=8&&H.height>=8;(!L||!j)&&console.warn("[atlas] Google overlay misaligned/undersized \u2014 clicks may miss the invisible GSI button",{covers:L,iframeOk:j,wrapper:f(w),overlay:f(T),iframe:H?{width:H.width,height:H.height}:null})}catch{}};u();let g,y=(v=t.ResizeObserver)!=null?v:typeof ResizeObserver!="undefined"?ResizeObserver:void 0;y&&(g=new y(()=>u()),g.observe(e.wrapper));let m,C=(S=t.MutationObserver)!=null?S:typeof MutationObserver!="undefined"?MutationObserver:void 0;return C&&(m=new C(()=>c()),m.observe(s,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","width","height"]})),e.oneTap&&r.prompt(),{destroy:()=>{g==null||g.disconnect(),m==null||m.disconnect(),Co.delete(a),s.remove(),o||(e.wrapper.style.position="")}}}var qa=()=>{let e=globalThis.navigator;if(!e||!e.credentials)throw new Error("WebAuthn is not available in this environment.");return e};function Ue(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 Ro(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 xe(e){return typeof(e!=null?e:globalThis.PublicKeyCredential)!="undefined"}async function Lo(){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 To(e){return typeof e=="string"?new TextEncoder().encode(e):e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function Io(e){return{first:To(e.first),...e.second!==void 0?{second:To(e.second)}:{}}}function Va(e,t){if(!e)return;let n={};return e.eval&&(n.eval=Io(e.eval)),t==="get"&&e.evalByCredential&&(n.evalByCredential=Object.fromEntries(Object.entries(e.evalByCredential).map(([r,o])=>[r,Io(o)]))),{prf:n}}var Oo=e=>e instanceof ArrayBuffer?new Uint8Array(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):void 0;function Ga(e){var i,s,l,a;let t=(s=(i=e.getClientExtensionResults)==null?void 0:i.call(e))!=null?s:{},n={credentialId:Ue(e.rawId)},r=t.prf;if(r&&typeof r=="object"){let d=Oo((l=r.results)==null?void 0:l.first),c=Oo((a=r.results)==null?void 0:a.second);n.prf={...typeof r.enabled=="boolean"?{enabled:r.enabled}:{},...d?{results:{first:d,...c?{second:c}:{}}}:{}}}let o=t.credProps;return o&&typeof o=="object"&&(n.credProps=typeof o.rk=="boolean"?{rk:o.rk}:{}),n}async function _n(e,t={}){var l,a;let n=(l=t.host)!=null?l:qa(),r=(a=e.allowCredentials)!=null?a:[],o={challenge:Ro(e.challenge),rpId:e.rpId,allowCredentials:r.map(d=>({type:d.type,id:Ro(d.id)})),userVerification:e.userVerification,timeout:e.timeout,...Ya(Va(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(Ga(i)),{handle:e.handle,challenge:e.challenge,credential_id:Ue(i.rawId),authenticator_data:Ue(s.authenticatorData),client_data_json:Ue(s.clientDataJSON),signature:Ue(s.signature)}}function Ya(e,t){let n=t&&typeof t=="object"&&!Array.isArray(t)?t:void 0;return!e&&!n?{}:{extensions:{...n!=null?n:{},...e!=null?e:{}}}}var Ja={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."},Za={checking:"captcha.checking",verified:"captcha.verified",puzzlePrompt:"captcha.puzzlePrompt",confirm:"captcha.puzzleConfirm",tile:"captcha.puzzleTile",alternative:"captcha.puzzleAlternative"};function xn(e){if(!e)return{};let t=typeof e=="function"?e:r=>e[r],n={};for(let[r,o]of Object.entries(Za)){let i=t(o);typeof i=="string"&&i.trim()&&i!==o&&(n[r]=i)}return n}var Xa=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},st=2e3;async function Qa(e,t,n,r=()=>!1){let o=new TextEncoder;for(let i=t;i<=n;i+=st){if(r())return null;let s=Math.min(n,i+st-1),l=[];for(let d=i;d<=s;d++)l.push(crypto.subtle.digest("SHA-256",o.encode(`${e.salt}${d}`)));let a=await Promise.all(l);for(let d=0;d<a.length;d++)if(Xa(a[d])===e.challenge)return i+d}return null}var el=`
|
|
5
28
|
self.onmessage = async function (e) {
|
|
6
29
|
var d = e.data, enc = new TextEncoder();
|
|
7
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; }
|
|
8
|
-
for (var start = d.from; start <= d.to; start += ${
|
|
9
|
-
var end = Math.min(d.to, start + ${
|
|
31
|
+
for (var start = d.from; start <= d.to; start += ${st}) {
|
|
32
|
+
var end = Math.min(d.to, start + ${st} - 1), batch = [];
|
|
10
33
|
for (var n = start; n <= end; n++) batch.push(crypto.subtle.digest('SHA-256', enc.encode(d.salt + n)));
|
|
11
34
|
var hs = await Promise.all(batch);
|
|
12
35
|
for (var i = 0; i < hs.length; i++) if (hex(hs[i]) === d.challenge) { self.postMessage({ n: start + i }); return; }
|
|
13
36
|
}
|
|
14
37
|
self.postMessage({ n: null });
|
|
15
|
-
};`;async function si(e,t={}){var s,a,l,i;let n=(s=t.cancelled)!=null?s:()=>!1,r=globalThis;if(t.workers!==!1&&r.Worker&&r.Blob&&((a=r.URL)!=null&&a.createObjectURL)){let c=await ai(e,Math.max(1,Math.min(4,(i=(l=r.navigator)==null?void 0:l.hardwareConcurrency)!=null?i:2)),n).catch(()=>{});if(c!==void 0){if(c===null)throw new Error("captcha: no solution");return{n:c,worker:!0}}}let o=await ri(e,0,e.maxnumber,n);if(o===null)throw new Error(n()?"captcha: cancelled":"captcha: no solution");return{n:o,worker:!1}}function ai(e,t,n){let r=URL.createObjectURL(new Blob([oi],{type:"text/javascript"})),o=[],s=()=>{for(let a of o)a.terminate();URL.revokeObjectURL(r)};return new Promise((a,l)=>{let i=t,c=Math.ceil((e.maxnumber+1)/t),d=setInterval(()=>{n()&&(clearInterval(d),s(),a(null))},100),u=f=>{clearInterval(d),s(),f instanceof Error?l(f):a(f)};try{for(let f=0;f<t;f++){let p=new Worker(r);o.push(p),p.onmessage=b=>{var y;typeof((y=b.data)==null?void 0:y.n)=="number"?u(b.data.n):--i===0&&u(null)},p.onerror=()=>u(new Error("captcha: worker failed"));let m=f*c;p.postMessage({salt:e.salt,challenge:e.challenge,from:m,to:Math.min(e.maxnumber,m+c-1)})}}catch(f){u(f instanceof Error?f:new Error("captcha: worker failed"))}})}var ii=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 li(e){return`atlas1.${ii(JSON.stringify(e))}`}async function ci(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 eo(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 di(e,t,n,r){let o=e.ownerDocument;return new Promise((s,a)=>{e.replaceChildren();let l=o.createElement("div");l.setAttribute("role","group"),l.setAttribute("data-atlas-captcha-puzzle",""),l.style.cssText="display:flex;flex-direction:column;align-items:center;gap:8px";let i=o.createElement("p");i.style.cssText="margin:0;font-size:13px;text-align:center",i.textContent=n.puzzlePrompt,l.append(i,eo(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((f,p)=>{let m=o.createElement("button");m.type="button",m.setAttribute("aria-pressed","false"),m.setAttribute("aria-label",n.tile.replace("{n}",String(p+1))),m.setAttribute("data-atlas-captcha-tile",String(p)),m.style.cssText="padding:3px;border:2px solid transparent;border-radius:8px;background:none;cursor:pointer",m.append(eo(o,f)),m.addEventListener("click",()=>{d^=1<<p;let b=(d&1<<p)!==0;m.setAttribute("aria-pressed",b?"true":"false"),m.style.borderColor=b?"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()?a(new Error("captcha: widget removed")):s(d)),l.append(c,u),t.accessible_alternative){let f=o.createElement("button");f.type="button",f.setAttribute("data-atlas-captcha-alternative",""),f.style.cssText="font-size:12px;background:none;border:0;text-decoration:underline;cursor:pointer",f.textContent=n.alternative,f.addEventListener("click",()=>s("accessible")),l.append(f)}e.append(l)})}function rn(e,t){var p,m;let n={...ei,...t.labels},r=(p=t.mode)!=null?p:"managed",o=e.ownerDocument,s=(m=t.fetchChallenge)!=null?m:b=>t.challengeUrl?ci(t.challengeUrl,b):Promise.reject(new Error("captcha: no challenge URL")),a=!1,l=0,i=()=>a,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=b=>{c.replaceChildren(),c.textContent=b},u=async b=>{let y=await s(b);if(a)throw new Error("captcha: widget removed");l=Date.parse(y.expires_at)||0,(r==="visible"||y.interactive)&&d(n.checking);let A=Date.now(),E=si(y,{workers:t.workers,cancelled:i}).then(w=>({...w,ms:Date.now()-A}));E.catch(()=>{});let v;if(y.interactive){let w=await di(c,y,n,i);if(w==="accessible")return d(n.checking),u(!0);v=w,d(n.checking)}let{n:C,worker:x,ms:k}=await E;if(a)throw new Error("captcha: widget removed");return(r==="visible"||v!==void 0)&&d(n.verified),li({t:y.token,n:C,ms:k,...x?{w:1}:{},...v!==void 0?{sel:v}:{}})},f=u(!1);return f.catch(()=>{}),{token:f,stale:()=>l>0&&Date.now()>l-15e3,remove(){a=!0,c.remove()}}}var ui=new Set(["atlas","turnstile","hcaptcha","recaptcha","recaptcha_v3","recaptcha_enterprise","captchafox","vercel_botid"]);function Oe(e,t){return!e||!ui.has(e)?!1:e==="vercel_botid"?!!(t!=null&&t.attestationUrl):!0}function ye(e){return!!e&&e.enabled===!0&&Oe(e.provider,e)}var pi=["CAPTCHA_REQUIRED","CAPTCHA_FAILED"];function on(e){return!!e&&typeof e.code=="string"&&pi.includes(e.code)}var fi={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 to(e,t,n){let r=fi[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,s=`__atlasCaptchaLoad_${e}`,a=n[s];if(a)return a;let l=new Promise((i,c)=>{var p,m;let d=()=>{n[r.global]?i(n[r.global]):c(new Error(`captcha: ${e} script loaded but global missing`))},u=r.src(t),f=o.querySelector(`script[src="${u}"]`);if(f){if(n[r.global])return i(n[r.global]);f.addEventListener("load",d,{once:!0}),f.addEventListener("error",()=>c(new Error(`captcha: ${e} script failed`)),{once:!0});return}f=o.createElement("script"),f.src=u,f.async=!0,f.defer=!0,f.addEventListener("load",d,{once:!0}),f.addEventListener("error",()=>c(new Error(`captcha: ${e} script failed`)),{once:!0}),((m=(p=o.head)!=null?p:o.body)!=null?m:o.documentElement).appendChild(f)});return n[s]=l,l.catch(()=>{n[s]===l&&delete n[s]}),l}function gi(e,t,n,r,o){return new Promise((s,a)=>{let l=e.render(t,{sitekey:n,appearance:r==="invisible"?"interaction-only":"always",callback:i=>s(i),"error-callback":()=>a(new Error("captcha: turnstile error")),"timeout-callback":()=>a(new Error("captcha: turnstile timeout"))});o(()=>{var i;return(i=e.remove)==null?void 0:i.call(e,l)}),r==="invisible"&&e.execute&&e.execute(l)})}function mi(e,t,n,r,o){return new Promise((s,a)=>{let l=e.render(t,{sitekey:n,size:r==="invisible"?"invisible":"normal",callback:i=>s(i),"error-callback":()=>a(new Error("captcha: hcaptcha error"))});if(o(()=>{var i;return(i=e.remove)==null?void 0:i.call(e,l)}),r==="invisible"){let i=e.execute(l,{async:!0});i&&typeof i.then=="function"&&i.then(c=>s(c.response),a)}})}function hi(e,t,n,r,o){return new Promise((s,a)=>{let l=e.render(t,{sitekey:n,size:r==="invisible"?"invisible":"normal",callback:i=>s(i),"error-callback":()=>a(new Error("captcha: recaptcha error"))});if(o(()=>{var i;return(i=e.reset)==null?void 0:i.call(e,l)}),r==="invisible"&&e.execute){let i=e.execute(void 0,{widgetId:l});i&&typeof i.then=="function"&&i.then(s,a)}})}function bi(e,t,n,r,o){return new Promise((s,a)=>{let l=()=>a(new Error("captcha: captchafox error"));Promise.resolve(e.render(t,{sitekey:n,mode:r==="invisible"?"hidden":"inline",onVerify:i=>s(i),onError:l,onFail:l})).then(i=>{o(()=>{var c;return(c=e.remove)==null?void 0:c.call(e,i)}),r==="invisible"&&e.execute&&Promise.resolve(e.execute(i)).then(c=>{typeof c=="string"&&c&&s(c)},l)},l)})}async function no(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 yi(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 ro(e,t,n={}){var f,p,m,b,y,A,E,v,C;let r=(f=e.provider)!=null?f:"";if(r==="atlas")return rn(t,{challengeUrl:e.challengeUrl,mode:(p=e.widget)!=null?p:"managed",...n.atlas});if(r==="vercel_botid"){let x=!1,k=(b=(m=t.ownerDocument)==null?void 0:m.defaultView)!=null?b:globalThis,w=e.attestationUrl?no(e.attestationUrl,(y=k.fetch)==null?void 0:y.bind(k)).then(S=>{if(x)throw new Error("captcha: widget removed");return S}):Promise.reject(new Error("captcha: vercel_botid needs an attestationUrl"));return w.catch(()=>{}),{token:w,remove(){x=!0}}}let o=(A=e.siteKey)!=null?A:"",s=(E=e.widget)!=null?E:"managed",a=(C=(v=t.ownerDocument)==null?void 0:v.defaultView)!=null?C:globalThis,l=!1,i=null,c=null,d=x=>{i=x};return{token:new Promise((x,k)=>{c=k,to(r,o,a).then(w=>{if(l)throw new Error("captcha: widget removed");switch(r){case"turnstile":return gi(w,t,o,s,d);case"hcaptcha":return mi(w,t,o,s,d);case"recaptcha":return hi(w,t,o,s,d);case"recaptcha_v3":case"recaptcha_enterprise":return yi(w,o);case"captchafox":return bi(w,t,o,s,d);default:throw new Error(`captcha: ${r} is not renderable`)}}).then(x,k)}),remove(){if(!l){l=!0;try{i==null||i()}catch{}for(;t.firstChild;)t.removeChild(t.firstChild);c==null||c(new Error("captcha: widget removed"))}}}}async function sn(e,t,n){return ro(e,t,n).token}var ki="/v1/client/sign_ins/passkey/begin",oo=async(e,t)=>{try{return await e(t)||null}catch{return null}};async function an(e,t={}){var i;let n=c=>e.post(ki,c?{captcha_token:c}:{}),r=(i=t.captcha)!=null?i:null,o=r?await oo(r,{retry:!1}):null,s=await n(o);if(s.ok||!r)return s;let a=s.errors.find(c=>on(c));if(!a)return s;let l=await oo(r,{retry:!0,refused:a.code==="CAPTCHA_FAILED"?"CAPTCHA_FAILED":"CAPTCHA_REQUIRED"});return l?n(l):s}var Le={attempt:null,errors:[],busy:!1,ticket:null};async function so(e,t,n){let r=await e.post("/v1/client/password_resets",{email_address:t,captcha_token:n});return!r.ok||!r.data?{...Le,errors:r.errors}:{attempt:r.data,errors:[],busy:!1,ticket:null}}async function ao(e,t,n){var l,i,c,d;let r=t.attempt;if(!r)return t;let o=null,s={};switch(r.status){case"needs_email_verification":o=`/v1/client/password_resets/${r.id}/attempt_verification`,s={code:(l=n.code)!=null?l:""};break;case"needs_second_factor":o=`/v1/client/password_resets/${r.id}/attempt_second_factor`,s={code:(i=n.code)!=null?i:""};break;case"needs_new_password":o=`/v1/client/password_resets/${r.id}/set_new_password`,s={password:(c=n.password)!=null?c:""};break;default:return t}let a=await e.post(o,s);return!a.ok||!a.data?{...t,busy:!1,errors:a.errors}:{attempt:{id:a.data.id,status:a.data.status},errors:[],busy:!1,ticket:(d=a.data.ticket)!=null?d:null}}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 io(e,t){let n=t.attempt;if(!(n!=null&&n.poll_secret))return t;let r=await e.get(`/v1/client/password_resets/${n.id}?poll_secret=${encodeURIComponent(n.poll_secret)}`);return!r.ok||!r.data?t:{...t,attempt:{id:r.data.id,status:r.data.status,poll_secret:n.poll_secret}}}var ld=Object.freeze({available:!0,passwordReset:!0,passwordSignUp:!0}),co="This app can't send email right now. Try another sign-in method or contact the app owner.";var De=e=>!!e&&typeof e=="object"&&!Array.isArray(e);var ln=Object.freeze({username:null,lastSignInMethod:!1,emailVerification:"code",passwordReset:"code",emailSecondFactor:!1,passkeySignUp:null}),lo=e=>e==="link"||e==="both"?e:"code";function cn(e){var o;let t=De(e)&&De(e.account)?e.account:null;if(!t)return{...ln};let n=De(t.username)?t.username:null,r=(s,a)=>typeof s=="number"&&Number.isInteger(s)?s:a;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:lo(t.email_verification),passwordReset:lo(t.password_reset),emailSecondFactor:t.email_second_factor===!0,...De(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}}:{},passkeySignUp:De(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 uo(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 ne=ea(go());var mo=["auto","light","dark"],de=["primary","primaryInk","accent","background","surface","text","muted","border","danger","success","inputBackground","inputText"],ot=["none","uppercase"],ho={"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},bo=Object.keys(ho),st=["none","sm","md","lg","xl"],at=["compact","comfortable","spacious"],it=["solid","glass","outline","none"],lt=["narrow","normal","wide"],ct=["center","left","right","split"],dt=["left","right"],ut=["card","page","hidden"],pt=["sm","md","lg"],ft=["solid","outline","soft","gradient"],gt=["list","grid","icons"],mt=["outline","filled","underline"],yo=["linear","radial"],un=["cover","contain"],pn=["top-left","top","top-right","left","center","right","bottom-left","bottom","bottom-right"],Fe=["none","dots","grid","noise"],ht=["minimal","atlas","glass","midnight","editorial","terminal","sunrise","forest","grape","slate","split-photo","bold"],fn=/^#[0-9a-fA-F]{6}$/,gn=/^dasset_[0-9A-HJKMNP-TV-Z]{26}$/;var W="system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",bt="Georgia, Cambria, 'Times New Roman', Times, serif",mn="ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace",H="wght@400;500;600;700;800",ko=[{id:"system",label:"System UI",family:null,category:"sans-serif",fallback:`-apple-system, BlinkMacSystemFont, ${W}`,google:null},{id:"system-serif",label:"System serif (Georgia)",family:null,category:"serif",fallback:bt,google:null},{id:"system-mono",label:"System monospace",family:null,category:"monospace",fallback:mn,google:null},{id:"inter",label:"Inter",family:"Inter",category:"sans-serif",fallback:W,google:`Inter:${H}`},{id:"roboto",label:"Roboto",family:"Roboto",category:"sans-serif",fallback:W,google:"Roboto:wght@400;500;700;800"},{id:"open-sans",label:"Open Sans",family:"Open Sans",category:"sans-serif",fallback:W,google:`Open+Sans:${H}`},{id:"lato",label:"Lato",family:"Lato",category:"sans-serif",fallback:W,google:"Lato:wght@400;700;900"},{id:"montserrat",label:"Montserrat",family:"Montserrat",category:"sans-serif",fallback:W,google:`Montserrat:${H}`},{id:"poppins",label:"Poppins",family:"Poppins",category:"sans-serif",fallback:W,google:`Poppins:${H}`},{id:"nunito",label:"Nunito",family:"Nunito",category:"sans-serif",fallback:W,google:`Nunito:${H}`},{id:"work-sans",label:"Work Sans",family:"Work Sans",category:"sans-serif",fallback:W,google:`Work+Sans:${H}`},{id:"dm-sans",label:"DM Sans",family:"DM Sans",category:"sans-serif",fallback:W,google:`DM+Sans:${H}`},{id:"manrope",label:"Manrope",family:"Manrope",category:"sans-serif",fallback:W,google:`Manrope:${H}`},{id:"source-serif",label:"Source Serif",family:"Source Serif 4",category:"serif",fallback:bt,google:`Source+Serif+4:${H}`},{id:"merriweather",label:"Merriweather",family:"Merriweather",category:"serif",fallback:bt,google:"Merriweather:wght@400;700;900"},{id:"playfair-display",label:"Playfair Display",family:"Playfair Display",category:"serif",fallback:bt,google:`Playfair+Display:${H}`},{id:"jetbrains-mono",label:"JetBrains Mono",family:"JetBrains Mono",category:"monospace",fallback:mn,google:`JetBrains+Mono:${H}`},{id:"ibm-plex-mono",label:"IBM Plex Mono",family:"IBM Plex Mono",category:"monospace",fallback:mn,google:"IBM+Plex+Mono:wght@400;500;600;700"}],vo=ko.map(e=>e.id),_o=new Map(ko.map(e=>[e.id,e]));function hn(e){return typeof e=="string"?_o.get(e):void 0}function bn(e){var n;let t=(n=hn(e))!=null?n:_o.get("system");return t.family?`'${t.family}', ${t.fallback}`:t.fallback}function xo(e){let t=hn(e);return t!=null&&t.google?`/v1/design/fonts/${t.id}.css`:null}var yn=e=>{if(!e||typeof e!="object"||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},ue=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),M=e=>t=>typeof t=="string"&&e.includes(t),Y=(e,t,n=1)=>r=>typeof r=="number"&&Number.isInteger(r)&&r>=e&&r<=t&&r%n===0,So=(e,t)=>n=>typeof n=="number"&&!Number.isNaN(n)&&n>=e&&n<=t,Me=e=>typeof e=="string"&&fn.test(e),kn=e=>typeof e=="string"&&gn.test(e);function re(e,t=[]){return n=>{if(!yn(n))return!1;for(let r of Object.keys(n)){if(!ue(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=>ue(n,r)&&n[r]!==void 0)}}var wo=M(vo),vn={palette:Object.fromEntries(de.map(e=>[e,Me])),paletteDark:Object.fromEntries(de.map(e=>[e,Me])),typography:{font:wo,headingFont:wo,baseSize:Y(12,20),headingWeight:Y(400,800,100),bodyWeight:Y(300,600,100),letterCase:M(ot),scale:M(bo)},shape:{radius:Y(0,32),controlRadius:Y(0,999),borderWidth:Y(0,3)},elevation:{cardShadow:M(st)},spacing:{density:M(at)},card:{style:M(it),blur:Y(0,40),width:M(lt)},layout:{position:M(ct),splitImageSide:M(dt),logoPlacement:M(ut),logoSize:M(pt)},buttons:{style:M(ft),socialLayout:M(gt)},inputs:{style:M(mt)},logo:{assetId:kn,darkAssetId:kn}},Ci=e=>{if(!re({type:M(yo),angle:Y(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(re({color:Me,at:So(0,100)},["color","at"]))},Ei=re({assetId:kn,fit:M(un),position:M(pn),overlay:re({color:Me,opacity:So(0,1)},["color","opacity"]),blur:Y(0,20)},["assetId"]),_n={color:Me,gradient:Ci,image:Ei,pattern:M(Fe)},Ue={version:e=>e===1,preset:M(ht),colorScheme:M(mo),background:re(_n),backgroundDark:re(_n),...Object.fromEntries(Object.entries(vn).map(([e,t])=>[e,re(t)]))};function Co(e,t){return ue(Ue,e)&&Ue[e](t)}var Eo=re(Ue);function Ao(e,t=()=>{},n=""){let r=(...s)=>[n,...s].filter(Boolean).join(".");if(e==null)return{};if(!yn(e))return t({path:n||"(root)",message:"must be an object"}),{};let o={};for(let[s,a]of Object.entries(e)){if(a===void 0)continue;if(!ue(Ue,s)){t({path:r(s),message:"Unknown setting."});continue}if(Ue[s](a)){o[s]=a;continue}let l=ue(vn,s)?vn[s]:s==="background"||s==="backgroundDark"?_n:null;if(!l||!yn(a)){t({path:r(s),message:"Invalid value."});continue}let i={};for(let[c,d]of Object.entries(a))d!==void 0&&(ue(l,c)&&l[c](d)?i[c]=d:t({path:r(s,c),message:ue(l,c)?"Invalid value.":"Unknown setting."}));Object.keys(i).length&&(o[s]=i)}return o}var Ai=new Set(["__proto__","constructor","prototype"]),Ro=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function xn(e,t){let n={...e};for(let[r,o]of Object.entries(t)){if(Ai.has(r)||o===void 0)continue;if(o===null){delete n[r];continue}let s=n[r];n[r]=Ro(s)&&Ro(o)?xn(s,o):o}return n}function F(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 Po={version:1,preset:"minimal",colorScheme:"auto",palette:F("#18181b #ffffff #4f46e5 #fafafa #ffffff #18181b #71717a #e4e4e7 #dc2626 #15803d #ffffff #18181b"),paletteDark:F("#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:{}},To={minimal:{design:{}},atlas:{design:{palette:F("#6d4aff #ffffff #0e8fc7 #f6f5ff #ffffff #0b0d17 #5b6078 #e2def5 #d92d3a #0f7a52 #ffffff #0b0d17"),paletteDark:F("#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:F("#4338ca - #db2777 #eef2ff #ffffff #111827 #4b5563 #ffffff - - #ffffff #111827"),paletteDark:F("#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:F("#1d4ed8 - #7c3aed #eef2f9 #ffffff #0b1020 #475569 #d5dceb - - #ffffff #0b1020"),paletteDark:F("#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:F("#8b2e1f - #8a6410 #f7f3ec #fffdf8 #1f1a14 #6b6157 #e3dacb - - #fffdf8 #1f1a14"),paletteDark:F("#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:F("#166534 - #0e7490 #f4fbf3 #ffffff #0b2a0b #3f6b3c #b7d8b4 - - #ffffff #0b2a0b"),paletteDark:F("#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:F("#c2410c - #be185d #fff1e6 #ffffff #2a1a12 #7c5e52 #f4d9cb - - #ffffff #2a1a12"),paletteDark:F("#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:F("#166534 - #a16207 #f3f7f2 #ffffff #14261a #53685a #d6e3d8 - - #f3f7f2 #14261a"),paletteDark:F("#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:F("#7e22ce - #be185d #faf5ff #ffffff #2e1065 #6b5b8a #e9d5ff - - #ffffff #2e1065"),paletteDark:F("#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:F("#334155 - #0369a1 #f1f5f9 #ffffff #0f172a #64748b #cbd5e1 - - #f8fafc #0f172a"),paletteDark:F("#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:F("#4338ca - #ca8a04 #4338ca #ffffff #111827 #4b5563 #e5e7eb - - #ffffff #111827"),paletteDark:F("#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 ve=(e,t,n)=>Math.min(n,Math.max(t,e));function _e(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 i=n[1];if((i.length===3||i.length===4)&&(i=[...i].map(d=>d+d).join("")),i.length!==6&&i.length!==8)return null;let c=d=>parseInt(i.slice(d,d+2),16);return{r:c(0),g:c(2),b:c(4),a:i.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 s=i=>i.endsWith("%")?parseFloat(i)/100*255:parseFloat(i),a=i=>i===void 0?1:i.endsWith("%")?parseFloat(i)/100:parseFloat(i),l={r:ve(s(o[0]),0,255),g:ve(s(o[1]),0,255),b:ve(s(o[2]),0,255),a:ve(a(o[3]),0,1)};return[l.r,l.g,l.b,l.a].some(Number.isNaN)?null:l}var yt=e=>ve(Math.round(e),0,255).toString(16).padStart(2,"0");function vt(e){return`#${yt(e.r)}${yt(e.g)}${yt(e.b)}`}function Ri(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 kt(e){let t=_e(e);return t?Ri(t):null}function ze(e,t){let n=kt(e),r=kt(t);if(n===null||r===null)return 1;let o=Math.max(n,r),s=Math.min(n,r);return(o+.05)/(s+.05)}var Pi=4.5,Ti=3;function Io(e){var t;return((t=kt(e))!=null?t:0)>.179?"#111827":"#ffffff"}function Ii(e,t,n){let r=e/255,o=t/255,s=n/255,a=Math.max(r,o,s),l=Math.min(r,o,s),i=(a+l)/2;if(a===l)return[0,0,i];let c=a-l,d=i>.5?c/(2-a-l):c/(a+l);return[a===r?((o-s)/c+(o<s?6:0))/6:a===o?((s-r)/c+2)/6:((r-o)/c+4)/6,d,i]}function Oi(e,t,n){let r=n<.5?n*(1+t):n+t-n*t,o=2*n-r,s=l=>{let i=l;return i<0&&(i+=1),i>1&&(i-=1),i<1/6?o+(r-o)*6*i:i<1/2?r:i<2/3?o+(r-o)*(2/3-i)*6:o};return`#${(t===0?[n,n,n]:[s(e+1/3),s(e),s(e-1/3)]).map(l=>yt(ve(l,0,1)*255)).join("")}`}function Li(e,t,n=Pi){var u;let r=_e(e);if(!r||t.length===0)return e;let o=f=>t.every(p=>ze(f,p)>=n);if(o(e))return e;let a=((u=kt(t[0]))!=null?u:1)>.179?-.01:.01,[l,i,c]=Ii(r.r,r.g,r.b),d=e;for(let f=1;f<=100;f+=1){let p=c+a*f;if(p<0||p>1)break;if(d=Oi(l,i,p),o(d))return d}return d}function Oo(e,t){return Li(e,t,Ti)}var Di=["primary","accent","danger","success"],se=e=>JSON.parse(JSON.stringify(e));function Do(e){if(!e||typeof e!="object"||Array.isArray(e))return{};if(Eo(e))return se(e);let t={};for(let[n,r]of Object.entries(e))r!==void 0&&Co(n,r)&&(t[n]=se(r));return t}function Lo(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=Io(t.primary)),n}function wn(e,t,n){var s,a,l;t.colorScheme&&(e.colorScheme=t.colorScheme);let r=e.palette;e.palette=Lo(e.palette,t.palette);let o=t.paletteDark?{...t.paletteDark}:void 0;if(n.carryBrand&&t.palette){for(let i of Di){let c=t.palette[i];c&&c!==r[i]&&!((s=t.paletteDark)!=null&&s[i])&&(o={...o!=null?o:{},[i]:c})}t.palette.primaryInk&&!((a=t.paletteDark)!=null&&a.primaryInk)&&(o!=null&&o.primary)&&(o.primaryInk=t.palette.primaryInk)}if(e.paletteDark=Lo(e.paletteDark,o),t.typography){let i=t.typography;e.typography={...e.typography,...oe(i),headingFont:(l=i.headingFont)!=null?l:i.font?i.font:e.typography.headingFont}}if(t.shape&&(e.shape={...e.shape,...oe(t.shape)}),t.elevation&&(e.elevation={...e.elevation,...oe(t.elevation)}),t.spacing&&(e.spacing={...e.spacing,...oe(t.spacing)}),t.card&&(e.card={...e.card,...oe(t.card)}),t.layout&&(e.layout={...e.layout,...oe(t.layout)}),t.buttons&&(e.buttons={...e.buttons,...oe(t.buttons)}),t.inputs&&(e.inputs={...e.inputs,...oe(t.inputs)}),t.background&&(e.background=se(t.background)),t.backgroundDark)e.backgroundDark=se(t.backgroundDark);else if(t.background&&n.carryBrand){let i={};t.background.gradient&&(i.gradient=se(t.background.gradient)),t.background.image&&(i.image=se(t.background.image)),t.background.pattern&&(i.pattern=t.background.pattern),e.backgroundDark=i}t.logo&&(e.logo=se(t.logo))}function oe(e){let t={};for(let[n,r]of Object.entries(e))r!==void 0&&(t[n]=r);return t}function Sn(e){return typeof e=="string"&&ht.includes(e)}function Ne(e){let t=Do(e),n=Sn(t.preset)?t.preset:"minimal",r=se(Po);return r.preset=n,wn(r,To[n].design,{carryBrand:!1}),wn(r,t,{carryBrand:!0}),r}function Fo(e,t){let n=Ne(e),r=Do(t);return delete r.preset,wn(n,r,{carryBrand:!0}),n}function Cn(e){var o,s,a,l,i,c,d,u,f,p,m,b,y,A;let t=(E,v,C)=>typeof v=="string"&&E.includes(v)?v:C,n=(o=e==null?void 0:e.background)!=null?o:{},r={"data-atlas-layout":t(ct,(s=e==null?void 0:e.layout)==null?void 0:s.position,"center"),"data-atlas-split-side":t(dt,(a=e==null?void 0:e.layout)==null?void 0:a.splitImageSide,"left"),"data-atlas-logo":t(ut,(l=e==null?void 0:e.layout)==null?void 0:l.logoPlacement,"card"),"data-atlas-logo-size":t(pt,(i=e==null?void 0:e.layout)==null?void 0:i.logoSize,"md"),"data-atlas-card":t(it,(c=e==null?void 0:e.card)==null?void 0:c.style,"solid"),"data-atlas-card-width":t(lt,(d=e==null?void 0:e.card)==null?void 0:d.width,"normal"),"data-atlas-shadow":t(st,(u=e==null?void 0:e.elevation)==null?void 0:u.cardShadow,"md"),"data-atlas-density":t(at,(f=e==null?void 0:e.spacing)==null?void 0:f.density,"comfortable"),"data-atlas-button":t(ft,(p=e==null?void 0:e.buttons)==null?void 0:p.style,"solid"),"data-atlas-social":t(gt,(m=e==null?void 0:e.buttons)==null?void 0:m.socialLayout,"list"),"data-atlas-input":t(mt,(b=e==null?void 0:e.inputs)==null?void 0:b.style,"outline"),"data-atlas-pattern":t(Fe,n.pattern,"none"),"data-atlas-pattern-dark":t(Fe,(y=e==null?void 0:e.backgroundDark)==null?void 0:y.pattern,"none"),"data-atlas-letter-case":t(ot,(A=e==null?void 0:e.typography)==null?void 0:A.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 Mo(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 s=xo(o);s&&t.add(s)}return[...t]}function En(){try{return typeof process!="undefined"&&!1}catch{return!1}}var zo=e=>{En()&&console.warn(`[atlas] ${e}`)},Uo=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function Fi(e,t=zo,n="design"){return e!=null&&(typeof e!="object"||Array.isArray(e))?(t(`${n} must be an object; ignored.`),{}):Ao(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 No(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 Mi=/^(?:https:\/\/[A-Za-z0-9.-]+(?::\d{1,5})?|http:\/\/(?:localhost|127\.0\.0\.1)(?::\d{1,5})?)$/;function Ui(e,t){let n=(t!=null?t:"").replace(/\/+$/,"");return n&&!Mi.test(n)?[]:Mo(e).map(r=>`${n}${r}`)}function zi(e){if(!(!Uo(e)||!Uo(e.resolved)))return e.resolved}function $o(e){var c,d,u;let t=(c=e.warn)!=null?c:zo,n=zi(e.instance),r=Fi(e.design,t,"appearance.design"),o,s=(d=e.preset)!=null?d:r.preset;s!==void 0&&(Sn(s)?o=s:t(`appearance.preset "${String(s)}" is not a preset; ignored.`));let a=o!==void 0||Object.keys(r).some(f=>f!=="preset");if(!n&&!a)return null;let l=o?Ne({preset:o}):n?Ne(n):Ne({}),i=xn((u=e.tokensDesign)!=null?u:{},r);return Fo(l,i)}function Bo(e,t){return Ui(e,t)}var Wo=new Set,Ho=e=>{var t;!En()||Wo.has(e)||(Wo.add(e),(t=globalThis.console)==null||t.warn(`[atlas] ${e}`))};function jo(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 Ko(e,t,n,r){var o,s;for(let a of(o=r==null?void 0:r.attributes)!=null?o:[])a in n.attributes||t.removeAttribute(a);for(let a of(s=r==null?void 0:r.style)!=null?s:[])a in n.style||t.style.removeProperty(a);for(let[a,l]of Object.entries(n.style))t.style.setProperty(a,l);for(let[a,l]of Object.entries(n.attributes))t.setAttribute(a,l);if(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),l.textContent=n.css,e.head.appendChild(l)}if(n.fontStylesheets.length){let a=new Set(Array.from(e.head.querySelectorAll("link[data-atlas-font]")).map(l=>l.getAttribute("href")));for(let l of n.fontStylesheets){if(a.has(l))continue;let i=e.createElement("link");i.setAttribute("rel","stylesheet"),i.setAttribute("href",l),i.setAttribute("data-atlas-font",""),e.head.appendChild(i)}}return{attributes:Object.keys(n.attributes),style:Object.keys(n.style)}}var Ni=["boxes","single"];function Vo(e,t){for(let n of[t,e])if(n&&Ni.includes(n))return n;return"boxes"}var Go=8,$i=["solid","outline","soft","ghost"],Bi=["none","scale","lift","glow","ripple"],Wi=["none","sm","md","lg"],Hi=["comfortable","compact"],ji=["outline","filled","underline"],Ki=["slow","normal","fast"],qi=["spinner","skeleton","dots","bar"],Yo={slow:280,normal:160,fast:80};function _t(e,t){let n=(r,o,...s)=>{for(let a of s)if(a!==void 0&&r.includes(a))return a;return o};return{buttonStyle:n($i,"solid",t==null?void 0:t.buttonStyle,e==null?void 0:e.buttonStyle),buttonEffect:n(Bi,"scale",t==null?void 0:t.buttonEffect,e==null?void 0:e.buttonEffect),shadow:n(Wi,"md",t==null?void 0:t.shadow,e==null?void 0:e.shadow),density:n(Hi,"comfortable",t==null?void 0:t.density,e==null?void 0:e.density),inputStyle:n(ji,"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(Ki,"normal",t==null?void 0:t.motionSpeed,e==null?void 0:e.motionSpeed),loading:n(qi,"spinner",t==null?void 0:t.loading,e==null?void 0:e.loading)}}var Vi=["block","compact","icon"],Gi=["sm","md","lg"],Yi=["list","grid","carousel"],Ji=["auto","always","never"];function An(e,t){var r,o,s;let n=(a,...l)=>{for(let i of l)if(i!==void 0&&a.includes(i))return i;return a[0]};return{variant:n(Vi,t==null?void 0:t.variant,e==null?void 0:e.variant),size:n(Gi,(r=t==null?void 0:t.size)!=null?r:"md",e==null?void 0:e.size,"md"),layout:n(Yi,t==null?void 0:t.layout,e==null?void 0:e.layout),labels:{...(o=e==null?void 0:e.labels)!=null?o:{},...(s=t==null?void 0:t.labels)!=null?s:{}},search:n(Ji,t==null?void 0:t.search,e==null?void 0:e.search)}}var J={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 Zi(e){return e?{colorPrimary:e.colorPrimary||J.colorPrimary,colorText:e.colorText||J.colorText,colorBackground:e.colorBackground||J.colorBackground,colorAccent:e.colorAccent||e.colorPrimary||J.colorAccent,colorCard:e.colorCard||e.colorBackground||J.colorCard,colorBorder:e.colorBorder||J.colorBorder,borderRadius:e.borderRadius||J.borderRadius,fontFamily:e.fontStack||J.fontFamily}:J}function Jo(e,t){var o;let n={...Zi(e)},r=(o=t==null?void 0:t.variables)!=null?o:{};for(let[s,a]of Object.entries(r))a!==void 0&&(n[s]=a);return n}function Zo(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 Xo(e){let t=_e(e);if(!t)return"#ffffff";let n=vt(t);return ze("#ffffff",n)>=ze("#111111",n)?"#ffffff":"#111111"}function Qo(e,t){let n=_e(e);if(!n)return e;let r=vt(n),o=t.map(s=>_e(s)).filter(s=>!!s&&s.a>0).map(vt);return o.length===0||o.every(s=>ze(r,s)>=3)?e:Oo(r,o)}function es(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 ts(e,t){var a,l;let n=(a=t==null?void 0:t.providerOrder)!=null?a:[],r=new Set((l=t==null?void 0:t.providerHidden)!=null?l:[]),o=new Set(e.filter(i=>!r.has(i))),s=[];for(let i of n)o.has(i)&&!s.includes(i)&&s.push(i);for(let i of e)o.has(i)&&!s.includes(i)&&s.push(i);return s}var qo={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 xt(e){return qo[e]?qo[e]:e.split(/[_-]/).map(t=>t&&t[0].toUpperCase()+t.slice(1)).join(" ")}var Xi="0.10.0",ns={name:"@atlasauth/embed",version:Xi};function Qi(e,t){return(n,r)=>{let o=typeof n=="string"?n:n.toString(),s;try{s=new URL(o)}catch{return t(n,r)}return s.searchParams.has("publishable_key")||s.searchParams.set("publishable_key",e),t(s.toString(),r)}}function rs(e){var n;let t=(n=e.fetchImpl)!=null?n:fetch;return new Je({publishableKey:e.publishableKey,baseUrl:e.frontendApi.replace(/\/$/,""),fetchImpl:Qi(e.publishableKey,t),locale:e.locale,sdk:ns,referral:e.referral,referralConsent:e.referralConsent})}async function os(e){let t=await e.get("/v1/appearance");return t.ok?t.data:null}var ss="atlas-embed-styles",el=`
|
|
38
|
+
};`;async function tl(e,t={}){var i,s,l,a;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 d=await nl(e,Math.max(1,Math.min(4,(a=(l=r.navigator)==null?void 0:l.hardwareConcurrency)!=null?a:2)),n).catch(()=>{});if(d!==void 0){if(d===null)throw new Error("captcha: no solution");return{n:d,worker:!0}}}let o=await Qa(e,0,e.maxnumber,n);if(o===null)throw new Error(n()?"captcha: cancelled":"captcha: no solution");return{n:o,worker:!1}}function nl(e,t,n){let r=URL.createObjectURL(new Blob([el],{type:"text/javascript"})),o=[],i=()=>{for(let s of o)s.terminate();URL.revokeObjectURL(r)};return new Promise((s,l)=>{let a=t,d=Math.ceil((e.maxnumber+1)/t),c=setInterval(()=>{n()&&(clearInterval(c),i(),s(null))},100),u=f=>{clearInterval(c),i(),f instanceof Error?l(f):s(f)};try{for(let f=0;f<t;f++){let p=new Worker(r);o.push(p),p.onmessage=y=>{var m;typeof((m=y.data)==null?void 0:m.n)=="number"?u(y.data.n):--a===0&&u(null)},p.onerror=()=>u(new Error("captcha: worker failed"));let g=f*d;p.postMessage({salt:e.salt,challenge:e.challenge,from:g,to:Math.min(e.maxnumber,g+d-1)})}}catch(f){u(f instanceof Error?f:new Error("captcha: worker failed"))}})}var rl=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 ol(e){return`atlas1.${rl(JSON.stringify(e))}`}async function il(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 Do(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 sl(e,t,n,r){let o=e.ownerDocument;return new Promise((i,s)=>{e.replaceChildren();let l=o.createElement("div");l.setAttribute("role","group"),l.setAttribute("data-atlas-captcha-puzzle",""),l.style.cssText="display:flex;flex-direction:column;align-items:center;gap:8px";let a=o.createElement("p");a.style.cssText="margin:0;font-size:13px;text-align:center",a.textContent=n.puzzlePrompt,l.append(a,Do(o,t.interactive.example));let d=o.createElement("div");d.style.cssText="display:grid;grid-template-columns:repeat(3,72px);gap:6px";let c=0;t.interactive.tiles.forEach((f,p)=>{let g=o.createElement("button");g.type="button",g.setAttribute("aria-pressed","false"),g.setAttribute("aria-label",n.tile.replace("{n}",String(p+1))),g.setAttribute("data-atlas-captcha-tile",String(p)),g.style.cssText="padding:3px;border:2px solid transparent;border-radius:8px;background:none;cursor:pointer",g.append(Do(o,f)),g.addEventListener("click",()=>{c^=1<<p;let y=(c&1<<p)!==0;g.setAttribute("aria-pressed",y?"true":"false"),g.style.borderColor=y?"currentColor":"transparent"}),d.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(c)),l.append(d,u),t.accessible_alternative){let f=o.createElement("button");f.type="button",f.setAttribute("data-atlas-captcha-alternative",""),f.style.cssText="font-size:12px;background:none;border:0;text-decoration:underline;cursor:pointer",f.textContent=n.alternative,f.addEventListener("click",()=>i("accessible")),l.append(f)}e.append(l)})}function wn(e,t){var p,g;let n={...Ja,...t.labels},r=(p=t.mode)!=null?p:"managed",o=e.ownerDocument,i=(g=t.fetchChallenge)!=null?g:y=>t.challengeUrl?il(t.challengeUrl,y):Promise.reject(new Error("captcha: no challenge URL")),s=!1,l=0,a=()=>s,d=o.createElement("div");d.setAttribute("role","status"),d.setAttribute("aria-live","polite"),d.setAttribute("data-atlas-captcha-provider","atlas"),d.style.cssText="font-size:13px;opacity:.85;text-align:center",e.append(d);let c=y=>{d.replaceChildren(),d.textContent=y},u=async y=>{let m=await i(y);if(s)throw new Error("captcha: widget removed");l=Date.parse(m.expires_at)||0,(r==="visible"||m.interactive)&&c(n.checking);let C=Date.now(),E=tl(m,{workers:t.workers,cancelled:a}).then(S=>({...S,ms:Date.now()-C}));E.catch(()=>{});let A;if(m.interactive){let S=await sl(d,m,n,a);if(S==="accessible")return c(n.checking),u(!0);A=S,c(n.checking)}let{n:x,worker:b,ms:v}=await E;if(s)throw new Error("captcha: widget removed");return(r==="visible"||A!==void 0)&&c(n.verified),ol({t:m.token,n:x,ms:v,...b?{w:1}:{},...A!==void 0?{sel:A}:{}})},f=u(!1);return f.catch(()=>{}),{token:f,stale:()=>l>0&&Date.now()>l-15e3,remove(){s=!0,d.remove()}}}var al=new Set(["atlas","turnstile","hcaptcha","recaptcha","recaptcha_v3","recaptcha_enterprise","captchafox","vercel_botid"]);function ze(e,t){return!e||!al.has(e)?!1:e==="vercel_botid"?!!(t!=null&&t.attestationUrl):!0}function we(e){return!!e&&e.enabled===!0&&ze(e.provider,e)}var ll=["CAPTCHA_REQUIRED","CAPTCHA_FAILED"];function Sn(e){return!!e&&typeof e.code=="string"&&ll.includes(e.code)}var cl={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 Fo(e,t,n){let r=cl[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 l=new Promise((a,d)=>{var p,g;let c=()=>{n[r.global]?a(n[r.global]):d(new Error(`captcha: ${e} script loaded but global missing`))},u=r.src(t),f=o.querySelector(`script[src="${u}"]`);if(f){if(n[r.global])return a(n[r.global]);f.addEventListener("load",c,{once:!0}),f.addEventListener("error",()=>d(new Error(`captcha: ${e} script failed`)),{once:!0});return}f=o.createElement("script"),f.src=u,f.async=!0,f.defer=!0,f.addEventListener("load",c,{once:!0}),f.addEventListener("error",()=>d(new Error(`captcha: ${e} script failed`)),{once:!0}),((g=(p=o.head)!=null?p:o.body)!=null?g:o.documentElement).appendChild(f)});return n[i]=l,l.catch(()=>{n[i]===l&&delete n[i]}),l}function dl(e,t,n,r,o){return new Promise((i,s)=>{let l=e.render(t,{sitekey:n,appearance:r==="invisible"?"interaction-only":"always",callback:a=>i(a),"error-callback":()=>s(new Error("captcha: turnstile error")),"timeout-callback":()=>s(new Error("captcha: turnstile timeout"))});o(()=>{var a;return(a=e.remove)==null?void 0:a.call(e,l)}),r==="invisible"&&e.execute&&e.execute(l)})}function ul(e,t,n,r,o){return new Promise((i,s)=>{let l=e.render(t,{sitekey:n,size:r==="invisible"?"invisible":"normal",callback:a=>i(a),"error-callback":()=>s(new Error("captcha: hcaptcha error"))});if(o(()=>{var a;return(a=e.remove)==null?void 0:a.call(e,l)}),r==="invisible"){let a=e.execute(l,{async:!0});a&&typeof a.then=="function"&&a.then(d=>i(d.response),s)}})}function pl(e,t,n,r,o){return new Promise((i,s)=>{let l=e.render(t,{sitekey:n,size:r==="invisible"?"invisible":"normal",callback:a=>i(a),"error-callback":()=>s(new Error("captcha: recaptcha error"))});if(o(()=>{var a;return(a=e.reset)==null?void 0:a.call(e,l)}),r==="invisible"&&e.execute){let a=e.execute(void 0,{widgetId:l});a&&typeof a.then=="function"&&a.then(i,s)}})}function fl(e,t,n,r,o){return new Promise((i,s)=>{let l=()=>s(new Error("captcha: captchafox error"));Promise.resolve(e.render(t,{sitekey:n,mode:r==="invisible"?"hidden":"inline",onVerify:a=>i(a),onError:l,onFail:l})).then(a=>{o(()=>{var d;return(d=e.remove)==null?void 0:d.call(e,a)}),r==="invisible"&&e.execute&&Promise.resolve(e.execute(a)).then(d=>{typeof d=="string"&&d&&i(d)},l)},l)})}async function Mo(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 gl(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 Uo(e,t,n={}){var f,p,g,y,m,C,E,A,x;let r=(f=e.provider)!=null?f:"";if(r==="atlas")return wn(t,{challengeUrl:e.challengeUrl,mode:(p=e.widget)!=null?p:"managed",...n.atlas});if(r==="vercel_botid"){let b=!1,v=(y=(g=t.ownerDocument)==null?void 0:g.defaultView)!=null?y:globalThis,S=e.attestationUrl?Mo(e.attestationUrl,(m=v.fetch)==null?void 0:m.bind(v)).then(w=>{if(b)throw new Error("captcha: widget removed");return w}):Promise.reject(new Error("captcha: vercel_botid needs an attestationUrl"));return S.catch(()=>{}),{token:S,remove(){b=!0}}}let o=(C=e.siteKey)!=null?C:"",i=(E=e.widget)!=null?E:"managed",s=(x=(A=t.ownerDocument)==null?void 0:A.defaultView)!=null?x:globalThis,l=!1,a=null,d=null,c=b=>{a=b};return{token:new Promise((b,v)=>{d=v,Fo(r,o,s).then(S=>{if(l)throw new Error("captcha: widget removed");switch(r){case"turnstile":return dl(S,t,o,i,c);case"hcaptcha":return ul(S,t,o,i,c);case"recaptcha":return pl(S,t,o,i,c);case"recaptcha_v3":case"recaptcha_enterprise":return gl(S,o);case"captchafox":return fl(S,t,o,i,c);default:throw new Error(`captcha: ${r} is not renderable`)}}).then(b,v)}),remove(){if(!l){l=!0;try{a==null||a()}catch{}for(;t.firstChild;)t.removeChild(t.firstChild);d==null||d(new Error("captcha: widget removed"))}}}}async function Cn(e,t,n){return Uo(e,t,n).token}var ml="/v1/client/sign_ins/passkey/begin",zo=async(e,t)=>{try{return await e(t)||null}catch{return null}};async function En(e,t={}){var a;let n=d=>e.post(ml,d?{captcha_token:d}:{}),r=(a=t.captcha)!=null?a:null,o=r?await zo(r,{retry:!1}):null,i=await n(o);if(i.ok||!r)return i;let s=i.errors.find(d=>Sn(d));if(!s)return i;let l=await zo(r,{retry:!0,refused:s.code==="CAPTCHA_FAILED"?"CAPTCHA_FAILED":"CAPTCHA_REQUIRED"});return l?n(l):i}var Ne={attempt:null,errors:[],busy:!1,ticket:null};async function No(e,t,n){let r=await e.post("/v1/client/password_resets",{email_address:t,captcha_token:n});return!r.ok||!r.data?{...Ne,errors:r.errors}:{attempt:r.data,errors:[],busy:!1,ticket:null}}async function $o(e,t,n){var l,a,d,c;let r=t.attempt;if(!r)return t;let o=null,i={};switch(r.status){case"needs_email_verification":o=`/v1/client/password_resets/${r.id}/attempt_verification`,i={code:(l=n.code)!=null?l:""};break;case"needs_second_factor":o=`/v1/client/password_resets/${r.id}/attempt_second_factor`,i={code:(a=n.code)!=null?a:""};break;case"needs_new_password":o=`/v1/client/password_resets/${r.id}/set_new_password`,i={password:(d=n.password)!=null?d:""};break;default:return t}let s=await e.post(o,i);return!s.ok||!s.data?{...t,busy:!1,errors:s.errors}:{attempt:{id:s.data.id,status:s.data.status},errors:[],busy:!1,ticket:(c=s.data.ticket)!=null?c:null}}function Se(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 Bo(e,t){let n=t.attempt;if(!(n!=null&&n.poll_secret))return t;let r=await e.get(`/v1/client/password_resets/${n.id}?poll_secret=${encodeURIComponent(n.poll_secret)}`);return!r.ok||!r.data?t:{...t,attempt:{id:r.data.id,status:r.data.status,poll_secret:n.poll_secret}}}var yu=Object.freeze({available:!0,passwordReset:!0,passwordSignUp:!0}),Wo="This app can't send email right now. Try another sign-in method or contact the app owner.";var $e=e=>!!e&&typeof e=="object"&&!Array.isArray(e);var An=Object.freeze({username:null,lastSignInMethod:!1,emailVerification:"code",passwordReset:"code",emailSecondFactor:!1,passkeySignUp:null}),Ho=e=>e==="link"||e==="both"?e:"code";function Pn(e){var o;let t=$e(e)&&$e(e.account)?e.account:null;if(!t)return{...An};let n=$e(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:Ho(t.email_verification),passwordReset:Ho(t.password_reset),emailSecondFactor:t.email_second_factor===!0,...$e(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}}:{},passkeySignUp:$e(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 jo(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 ie=Us(Vo());var Go=["auto","light","dark"],fe=["primary","primaryInk","accent","background","surface","text","muted","border","danger","success","inputBackground","inputText"],dt=["none","uppercase"],Yo={"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},Jo=Object.keys(Yo),ut=["none","sm","md","lg","xl"],pt=["compact","comfortable","spacious"],ft=["solid","glass","outline","none"],gt=["narrow","normal","wide"],mt=["center","left","right","split"],ht=["left","right"],yt=["card","page","hidden"],bt=["sm","md","lg"],kt=["solid","outline","soft","gradient"],vt=["list","grid","icons"],_t=["outline","filled","underline"],Zo=["linear","radial"],Tn=["cover","contain"],In=["top-left","top","top-right","left","center","right","bottom-left","bottom","bottom-right"],Be=["none","dots","grid","noise"],xt=["minimal","atlas","glass","midnight","editorial","terminal","sunrise","forest","grape","slate","split-photo","bold"],On=/^#[0-9a-fA-F]{6}$/,Ln=/^dasset_[0-9A-HJKMNP-TV-Z]{26}$/;var K="system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",wt="Georgia, Cambria, 'Times New Roman', Times, serif",Dn="ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace",q="wght@400;500;600;700;800",Xo=[{id:"system",label:"System UI",family:null,category:"sans-serif",fallback:`-apple-system, BlinkMacSystemFont, ${K}`,google:null},{id:"system-serif",label:"System serif (Georgia)",family:null,category:"serif",fallback:wt,google:null},{id:"system-mono",label:"System monospace",family:null,category:"monospace",fallback:Dn,google:null},{id:"inter",label:"Inter",family:"Inter",category:"sans-serif",fallback:K,google:`Inter:${q}`},{id:"roboto",label:"Roboto",family:"Roboto",category:"sans-serif",fallback:K,google:"Roboto:wght@400;500;700;800"},{id:"open-sans",label:"Open Sans",family:"Open Sans",category:"sans-serif",fallback:K,google:`Open+Sans:${q}`},{id:"lato",label:"Lato",family:"Lato",category:"sans-serif",fallback:K,google:"Lato:wght@400;700;900"},{id:"montserrat",label:"Montserrat",family:"Montserrat",category:"sans-serif",fallback:K,google:`Montserrat:${q}`},{id:"poppins",label:"Poppins",family:"Poppins",category:"sans-serif",fallback:K,google:`Poppins:${q}`},{id:"nunito",label:"Nunito",family:"Nunito",category:"sans-serif",fallback:K,google:`Nunito:${q}`},{id:"work-sans",label:"Work Sans",family:"Work Sans",category:"sans-serif",fallback:K,google:`Work+Sans:${q}`},{id:"dm-sans",label:"DM Sans",family:"DM Sans",category:"sans-serif",fallback:K,google:`DM+Sans:${q}`},{id:"manrope",label:"Manrope",family:"Manrope",category:"sans-serif",fallback:K,google:`Manrope:${q}`},{id:"source-serif",label:"Source Serif",family:"Source Serif 4",category:"serif",fallback:wt,google:`Source+Serif+4:${q}`},{id:"merriweather",label:"Merriweather",family:"Merriweather",category:"serif",fallback:wt,google:"Merriweather:wght@400;700;900"},{id:"playfair-display",label:"Playfair Display",family:"Playfair Display",category:"serif",fallback:wt,google:`Playfair+Display:${q}`},{id:"jetbrains-mono",label:"JetBrains Mono",family:"JetBrains Mono",category:"monospace",fallback:Dn,google:`JetBrains+Mono:${q}`},{id:"ibm-plex-mono",label:"IBM Plex Mono",family:"IBM Plex Mono",category:"monospace",fallback:Dn,google:"IBM+Plex+Mono:wght@400;500;600;700"}],Qo=Xo.map(e=>e.id),ei=new Map(Xo.map(e=>[e.id,e]));function Fn(e){return typeof e=="string"?ei.get(e):void 0}function Mn(e){var n;let t=(n=Fn(e))!=null?n:ei.get("system");return t.family?`'${t.family}', ${t.fallback}`:t.fallback}function ti(e){let t=Fn(e);return t!=null&&t.google?`/v1/design/fonts/${t.id}.css`:null}var Un=e=>{if(!e||typeof e!="object"||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},ge=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),U=e=>t=>typeof t=="string"&&e.includes(t),X=(e,t,n=1)=>r=>typeof r=="number"&&Number.isInteger(r)&&r>=e&&r<=t&&r%n===0,ri=(e,t)=>n=>typeof n=="number"&&!Number.isNaN(n)&&n>=e&&n<=t,He=e=>typeof e=="string"&&On.test(e),zn=e=>typeof e=="string"&&Ln.test(e);function se(e,t=[]){return n=>{if(!Un(n))return!1;for(let r of Object.keys(n)){if(!ge(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=>ge(n,r)&&n[r]!==void 0)}}var ni=U(Qo),Nn={palette:Object.fromEntries(fe.map(e=>[e,He])),paletteDark:Object.fromEntries(fe.map(e=>[e,He])),typography:{font:ni,headingFont:ni,baseSize:X(12,20),headingWeight:X(400,800,100),bodyWeight:X(300,600,100),letterCase:U(dt),scale:U(Jo)},shape:{radius:X(0,32),controlRadius:X(0,999),borderWidth:X(0,3)},elevation:{cardShadow:U(ut)},spacing:{density:U(pt)},card:{style:U(ft),blur:X(0,40),width:U(gt)},layout:{position:U(mt),splitImageSide:U(ht),logoPlacement:U(yt),logoSize:U(bt)},buttons:{style:U(kt),socialLayout:U(vt)},inputs:{style:U(_t)},logo:{assetId:zn,darkAssetId:zn}},_l=e=>{if(!se({type:U(Zo),angle:X(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:He,at:ri(0,100)},["color","at"]))},xl=se({assetId:zn,fit:U(Tn),position:U(In),overlay:se({color:He,opacity:ri(0,1)},["color","opacity"]),blur:X(0,20)},["assetId"]),$n={color:He,gradient:_l,image:xl,pattern:U(Be)},We={version:e=>e===1,preset:U(xt),colorScheme:U(Go),background:se($n),backgroundDark:se($n),...Object.fromEntries(Object.entries(Nn).map(([e,t])=>[e,se(t)]))};function oi(e,t){return ge(We,e)&&We[e](t)}var ii=se(We);function si(e,t=()=>{},n=""){let r=(...i)=>[n,...i].filter(Boolean).join(".");if(e==null)return{};if(!Un(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(!ge(We,i)){t({path:r(i),message:"Unknown setting."});continue}if(We[i](s)){o[i]=s;continue}let l=ge(Nn,i)?Nn[i]:i==="background"||i==="backgroundDark"?$n:null;if(!l||!Un(s)){t({path:r(i),message:"Invalid value."});continue}let a={};for(let[d,c]of Object.entries(s))c!==void 0&&(ge(l,d)&&l[d](c)?a[d]=c:t({path:r(i,d),message:ge(l,d)?"Invalid value.":"Unknown setting."}));Object.keys(a).length&&(o[i]=a)}return o}var wl=new Set(["__proto__","constructor","prototype"]),ai=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function Bn(e,t){let n={...e};for(let[r,o]of Object.entries(t)){if(wl.has(r)||o===void 0)continue;if(o===null){delete n[r];continue}let i=n[r];n[r]=ai(i)&&ai(o)?Bn(i,o):o}return n}function M(e){let t=e.split(" ");if(t.length!==fe.length)throw new Error(`palette spec needs ${fe.length} slots: ${e}`);let n={};return t.forEach((r,o)=>{r!=="-"&&(n[fe[o]]=r)}),n}var li={version:1,preset:"minimal",colorScheme:"auto",palette:M("#18181b #ffffff #4f46e5 #fafafa #ffffff #18181b #71717a #e4e4e7 #dc2626 #15803d #ffffff #18181b"),paletteDark:M("#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:{}},ci={minimal:{design:{}},atlas:{design:{palette:M("#6d4aff #ffffff #0e8fc7 #f6f5ff #ffffff #0b0d17 #5b6078 #e2def5 #d92d3a #0f7a52 #ffffff #0b0d17"),paletteDark:M("#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:M("#4338ca - #db2777 #eef2ff #ffffff #111827 #4b5563 #ffffff - - #ffffff #111827"),paletteDark:M("#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:M("#1d4ed8 - #7c3aed #eef2f9 #ffffff #0b1020 #475569 #d5dceb - - #ffffff #0b1020"),paletteDark:M("#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:M("#8b2e1f - #8a6410 #f7f3ec #fffdf8 #1f1a14 #6b6157 #e3dacb - - #fffdf8 #1f1a14"),paletteDark:M("#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:M("#166534 - #0e7490 #f4fbf3 #ffffff #0b2a0b #3f6b3c #b7d8b4 - - #ffffff #0b2a0b"),paletteDark:M("#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:M("#c2410c - #be185d #fff1e6 #ffffff #2a1a12 #7c5e52 #f4d9cb - - #ffffff #2a1a12"),paletteDark:M("#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:M("#166534 - #a16207 #f3f7f2 #ffffff #14261a #53685a #d6e3d8 - - #f3f7f2 #14261a"),paletteDark:M("#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:M("#7e22ce - #be185d #faf5ff #ffffff #2e1065 #6b5b8a #e9d5ff - - #ffffff #2e1065"),paletteDark:M("#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:M("#334155 - #0369a1 #f1f5f9 #ffffff #0f172a #64748b #cbd5e1 - - #f8fafc #0f172a"),paletteDark:M("#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:M("#4338ca - #ca8a04 #4338ca #ffffff #111827 #4b5563 #e5e7eb - - #ffffff #111827"),paletteDark:M("#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 Ce=(e,t,n)=>Math.min(n,Math.max(t,e));function Ee(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 a=n[1];if((a.length===3||a.length===4)&&(a=[...a].map(c=>c+c).join("")),a.length!==6&&a.length!==8)return null;let d=c=>parseInt(a.slice(c,c+2),16);return{r:d(0),g:d(2),b:d(4),a:a.length===8?d(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=a=>a.endsWith("%")?parseFloat(a)/100*255:parseFloat(a),s=a=>a===void 0?1:a.endsWith("%")?parseFloat(a)/100:parseFloat(a),l={r:Ce(i(o[0]),0,255),g:Ce(i(o[1]),0,255),b:Ce(i(o[2]),0,255),a:Ce(s(o[3]),0,1)};return[l.r,l.g,l.b,l.a].some(Number.isNaN)?null:l}var St=e=>Ce(Math.round(e),0,255).toString(16).padStart(2,"0");function Et(e){return`#${St(e.r)}${St(e.g)}${St(e.b)}`}function Sl(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 Ct(e){let t=Ee(e);return t?Sl(t):null}function je(e,t){let n=Ct(e),r=Ct(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 Cl=4.5,El=3;function di(e){var t;return((t=Ct(e))!=null?t:0)>.179?"#111827":"#ffffff"}function Al(e,t,n){let r=e/255,o=t/255,i=n/255,s=Math.max(r,o,i),l=Math.min(r,o,i),a=(s+l)/2;if(s===l)return[0,0,a];let d=s-l,c=a>.5?d/(2-s-l):d/(s+l);return[s===r?((o-i)/d+(o<i?6:0))/6:s===o?((i-r)/d+2)/6:((r-o)/d+4)/6,c,a]}function Pl(e,t,n){let r=n<.5?n*(1+t):n+t-n*t,o=2*n-r,i=l=>{let a=l;return a<0&&(a+=1),a>1&&(a-=1),a<1/6?o+(r-o)*6*a:a<1/2?r:a<2/3?o+(r-o)*(2/3-a)*6:o};return`#${(t===0?[n,n,n]:[i(e+1/3),i(e),i(e-1/3)]).map(l=>St(Ce(l,0,1)*255)).join("")}`}function Rl(e,t,n=Cl){var u;let r=Ee(e);if(!r||t.length===0)return e;let o=f=>t.every(p=>je(f,p)>=n);if(o(e))return e;let s=((u=Ct(t[0]))!=null?u:1)>.179?-.01:.01,[l,a,d]=Al(r.r,r.g,r.b),c=e;for(let f=1;f<=100;f+=1){let p=d+s*f;if(p<0||p>1)break;if(c=Pl(l,a,p),o(c))return c}return c}function ui(e,t){return Rl(e,t,El)}var Tl=["primary","accent","danger","success"],le=e=>JSON.parse(JSON.stringify(e));function fi(e){if(!e||typeof e!="object"||Array.isArray(e))return{};if(ii(e))return le(e);let t={};for(let[n,r]of Object.entries(e))r!==void 0&&oi(n,r)&&(t[n]=le(r));return t}function pi(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=di(t.primary)),n}function Hn(e,t,n){var i,s,l;t.colorScheme&&(e.colorScheme=t.colorScheme);let r=e.palette;e.palette=pi(e.palette,t.palette);let o=t.paletteDark?{...t.paletteDark}:void 0;if(n.carryBrand&&t.palette){for(let a of Tl){let d=t.palette[a];d&&d!==r[a]&&!((i=t.paletteDark)!=null&&i[a])&&(o={...o!=null?o:{},[a]:d})}t.palette.primaryInk&&!((s=t.paletteDark)!=null&&s.primaryInk)&&(o!=null&&o.primary)&&(o.primaryInk=t.palette.primaryInk)}if(e.paletteDark=pi(e.paletteDark,o),t.typography){let a=t.typography;e.typography={...e.typography,...ae(a),headingFont:(l=a.headingFont)!=null?l:a.font?a.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=le(t.background)),t.backgroundDark)e.backgroundDark=le(t.backgroundDark);else if(t.background&&n.carryBrand){let a={};t.background.gradient&&(a.gradient=le(t.background.gradient)),t.background.image&&(a.image=le(t.background.image)),t.background.pattern&&(a.pattern=t.background.pattern),e.backgroundDark=a}t.logo&&(e.logo=le(t.logo))}function ae(e){let t={};for(let[n,r]of Object.entries(e))r!==void 0&&(t[n]=r);return t}function Wn(e){return typeof e=="string"&&xt.includes(e)}function Ke(e){let t=fi(e),n=Wn(t.preset)?t.preset:"minimal",r=le(li);return r.preset=n,Hn(r,ci[n].design,{carryBrand:!1}),Hn(r,t,{carryBrand:!0}),r}function gi(e,t){let n=Ke(e),r=fi(t);return delete r.preset,Hn(n,r,{carryBrand:!0}),n}function jn(e){var o,i,s,l,a,d,c,u,f,p,g,y,m,C;let t=(E,A,x)=>typeof A=="string"&&E.includes(A)?A:x,n=(o=e==null?void 0:e.background)!=null?o:{},r={"data-atlas-layout":t(mt,(i=e==null?void 0:e.layout)==null?void 0:i.position,"center"),"data-atlas-split-side":t(ht,(s=e==null?void 0:e.layout)==null?void 0:s.splitImageSide,"left"),"data-atlas-logo":t(yt,(l=e==null?void 0:e.layout)==null?void 0:l.logoPlacement,"card"),"data-atlas-logo-size":t(bt,(a=e==null?void 0:e.layout)==null?void 0:a.logoSize,"md"),"data-atlas-card":t(ft,(d=e==null?void 0:e.card)==null?void 0:d.style,"solid"),"data-atlas-card-width":t(gt,(c=e==null?void 0:e.card)==null?void 0:c.width,"normal"),"data-atlas-shadow":t(ut,(u=e==null?void 0:e.elevation)==null?void 0:u.cardShadow,"md"),"data-atlas-density":t(pt,(f=e==null?void 0:e.spacing)==null?void 0:f.density,"comfortable"),"data-atlas-button":t(kt,(p=e==null?void 0:e.buttons)==null?void 0:p.style,"solid"),"data-atlas-social":t(vt,(g=e==null?void 0:e.buttons)==null?void 0:g.socialLayout,"list"),"data-atlas-input":t(_t,(y=e==null?void 0:e.inputs)==null?void 0:y.style,"outline"),"data-atlas-pattern":t(Be,n.pattern,"none"),"data-atlas-pattern-dark":t(Be,(m=e==null?void 0:e.backgroundDark)==null?void 0:m.pattern,"none"),"data-atlas-letter-case":t(dt,(C=e==null?void 0:e.typography)==null?void 0:C.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 mi(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=ti(o);i&&t.add(i)}return[...t]}function Kn(){try{return typeof process!="undefined"&&!1}catch{return!1}}var yi=e=>{Kn()&&console.warn(`[atlas] ${e}`)},hi=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function Il(e,t=yi,n="design"){return e!=null&&(typeof e!="object"||Array.isArray(e))?(t(`${n} must be an object; ignored.`),{}):si(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 bi(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 Ol=/^(?:https:\/\/[A-Za-z0-9.-]+(?::\d{1,5})?|http:\/\/(?:localhost|127\.0\.0\.1)(?::\d{1,5})?)$/;function Ll(e,t){let n=(t!=null?t:"").replace(/\/+$/,"");return n&&!Ol.test(n)?[]:mi(e).map(r=>`${n}${r}`)}function Dl(e){if(!(!hi(e)||!hi(e.resolved)))return e.resolved}function ki(e){var d,c,u;let t=(d=e.warn)!=null?d:yi,n=Dl(e.instance),r=Il(e.design,t,"appearance.design"),o,i=(c=e.preset)!=null?c:r.preset;i!==void 0&&(Wn(i)?o=i:t(`appearance.preset "${String(i)}" is not a preset; ignored.`));let s=o!==void 0||Object.keys(r).some(f=>f!=="preset");if(!n&&!s)return null;let l=o?Ke({preset:o}):n?Ke(n):Ke({}),a=Bn((u=e.tokensDesign)!=null?u:{},r);return gi(l,a)}function vi(e,t){return Ll(e,t)}var _i=new Set,xi=e=>{var t;!Kn()||_i.has(e)||(_i.add(e),(t=globalThis.console)==null||t.warn(`[atlas] ${e}`))};function wi(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 Si(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,l]of Object.entries(n.style))t.style.setProperty(s,l);for(let[s,l]of Object.entries(n.attributes))t.setAttribute(s,l);if(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),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(l=>l.getAttribute("href")));for(let l of n.fontStylesheets){if(s.has(l))continue;let a=e.createElement("link");a.setAttribute("rel","stylesheet"),a.setAttribute("href",l),a.setAttribute("data-atlas-font",""),e.head.appendChild(a)}}return{attributes:Object.keys(n.attributes),style:Object.keys(n.style)}}var Fl=["boxes","single"];function Ei(e,t){for(let n of[t,e])if(n&&Fl.includes(n))return n;return"boxes"}var Ai=8,Ml=["solid","outline","soft","ghost"],Ul=["none","scale","lift","glow","ripple"],zl=["none","sm","md","lg"],Nl=["comfortable","compact"],$l=["outline","filled","underline"],Bl=["slow","normal","fast"],Hl=["spinner","skeleton","dots","bar"],Pi={slow:280,normal:160,fast:80};function At(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(Ml,"solid",t==null?void 0:t.buttonStyle,e==null?void 0:e.buttonStyle),buttonEffect:n(Ul,"scale",t==null?void 0:t.buttonEffect,e==null?void 0:e.buttonEffect),shadow:n(zl,"md",t==null?void 0:t.shadow,e==null?void 0:e.shadow),density:n(Nl,"comfortable",t==null?void 0:t.density,e==null?void 0:e.density),inputStyle:n($l,"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(Bl,"normal",t==null?void 0:t.motionSpeed,e==null?void 0:e.motionSpeed),loading:n(Hl,"spinner",t==null?void 0:t.loading,e==null?void 0:e.loading)}}var Wl=["block","compact","icon"],jl=["sm","md","lg"],Kl=["list","grid","carousel"],ql=["auto","always","never"];function qn(e,t){var r,o,i;let n=(s,...l)=>{for(let a of l)if(a!==void 0&&s.includes(a))return a;return s[0]};return{variant:n(Wl,t==null?void 0:t.variant,e==null?void 0:e.variant),size:n(jl,(r=t==null?void 0:t.size)!=null?r:"md",e==null?void 0:e.size,"md"),layout:n(Kl,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(ql,t==null?void 0:t.search,e==null?void 0:e.search)}}var Q={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 Vl(e){return e?{colorPrimary:e.colorPrimary||Q.colorPrimary,colorText:e.colorText||Q.colorText,colorBackground:e.colorBackground||Q.colorBackground,colorAccent:e.colorAccent||e.colorPrimary||Q.colorAccent,colorCard:e.colorCard||e.colorBackground||Q.colorCard,colorBorder:e.colorBorder||Q.colorBorder,borderRadius:e.borderRadius||Q.borderRadius,fontFamily:e.fontStack||Q.fontFamily}:Q}function Ri(e,t){var o;let n={...Vl(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 Ti(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 Ii(e){let t=Ee(e);if(!t)return"#ffffff";let n=Et(t);return je("#ffffff",n)>=je("#111111",n)?"#ffffff":"#111111"}function Oi(e,t){let n=Ee(e);if(!n)return e;let r=Et(n),o=t.map(i=>Ee(i)).filter(i=>!!i&&i.a>0).map(Et);return o.length===0||o.every(i=>je(r,i)>=3)?e:ui(r,o)}function Li(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 Di(e,t){var s,l;let n=(s=t==null?void 0:t.providerOrder)!=null?s:[],r=new Set((l=t==null?void 0:t.providerHidden)!=null?l:[]),o=new Set(e.filter(a=>!r.has(a))),i=[];for(let a of n)o.has(a)&&!i.includes(a)&&i.push(a);for(let a of e)o.has(a)&&!i.includes(a)&&i.push(a);return i}var Ci={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 Pt(e){return Ci[e]?Ci[e]:e.split(/[_-]/).map(t=>t&&t[0].toUpperCase()+t.slice(1)).join(" ")}var Gl="0.11.0",Fi={name:"@atlasauth/embed",version:Gl};function Yl(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 Mi(e){var n;let t=(n=e.fetchImpl)!=null?n:fetch;return new tt({publishableKey:e.publishableKey,baseUrl:e.frontendApi.replace(/\/$/,""),fetchImpl:Yl(e.publishableKey,t),locale:e.locale,sdk:Fi,referral:e.referral,referralConsent:e.referralConsent})}async function Ui(e){let t=await e.get("/v1/appearance");return t.ok?t.data:null}var zi="atlas-embed-styles",Jl=`
|
|
16
39
|
.atlas-embed-root {
|
|
17
40
|
--_bg: var(--atlas-embed-color-background, #ffffff);
|
|
18
41
|
--_card: var(--atlas-embed-color-card, #ffffff);
|
|
@@ -384,4 +407,4 @@ form > .atlas-embed-step-back { display: block; width: 100%; text-align: center;
|
|
|
384
407
|
.atlas-embed-loadbar::before { position: static; width: 100%; }
|
|
385
408
|
}
|
|
386
409
|
@keyframes atlas-embed-pulse { 0%,100% { opacity: 0.4; } 50% { opacity: 1; } }
|
|
387
|
-
`;function as(e=document){var n;if(e.querySelector(`style[data-${ss}]`))return;let t=e.createElement("style");t.setAttribute(`data-${ss}`,""),t.textContent=el,((n=e.head)!=null?n:e.documentElement).appendChild(t)}function is(e,t,n={}){var u;let r=$o({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:Ho});if(!r)return null;let s=r.colorScheme==="dark"||r.colorScheme==="auto"&&!!n.prefersDark?r.paletteDark:r.palette,a={colorPrimary:s.primary,colorText:s.text,colorBackground:s.background,colorAccent:s.accent,colorCard:s.surface,colorBorder:s.border,borderRadius:`${Math.min(r.shape.controlRadius,24)}px`,fontFamily:bn(r.typography.font)};for(let[f,p]of Object.entries((u=t==null?void 0:t.variables)!=null?u:{}))p!==void 0&&(a[f]=p);let l=r.elevation.cardShadow==="xl"?"lg":r.elevation.cardShadow,i={buttonStyle:r.buttons.style==="gradient"?"solid":r.buttons.style,shadow:r.card.style==="outline"||r.card.style==="none"?"none":l,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=No(JSON.stringify(r));return{render:{style:{},attributes:{...Cn(r),"data-atlas-design":d},css:"",key:d,fontStylesheets:Bo(r,n.frontendApi)},tokens:a,interaction:i,socialButtons:c,resolved:r}}var ls=new Set(["bluesky"]),cs='<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>',ds='<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>',pe={"sign-in":{title:"Sign in",submit:"Continue"},"sign-up":{title:"Create your account",submit:"Continue"}};function L(e){var t;return(t=e.root.ownerDocument)!=null?t:document}function g(e,t,n,r){let o=L(e).createElement(t);return n&&(o.className=n),r!=null&&(o.textContent=r),(o.classList.contains("atlas-embed-button")||o.classList.contains("atlas-embed-social-button"))&&tl(e,o),o}function R(e,t,n){return es(t,n,e.options.appearance)}function tl(e,t){e.interaction.buttonEffect!=="ripple"||!e.interaction.animations||t.addEventListener("pointerdown",n=>{let r=t.getBoundingClientRect(),o=Math.max(r.width,r.height),s=L(e).createElement("span");s.className="atlas-embed-ripple",s.style.width=s.style.height=`${o}px`,s.style.left=`${n.clientX-r.left-o/2}px`,s.style.top=`${n.clientY-r.top-o/2}px`,s.addEventListener("animationend",()=>s.remove()),t.appendChild(s)})}function xe(e,t){let n=g(e,"button",R(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=g(e,"span","atlas-embed-btn-spinner");r.setAttribute("aria-hidden","true"),n.appendChild(r)}else n.textContent=t;return n}function us(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 $e(e,t,n=!1){var l,i,c;let r=e.captchaFlows[t];if(!(n?!!r&&Oe(r.provider,r):ye(r))||!r)return null;let s=(l=e.root.ownerDocument)!=null?l:document,a=s.createElement("div");a.className="atlas-embed-captcha",((c=(i=e.root.parentElement)!=null?i:s.body)!=null?c:s.documentElement).appendChild(a);try{return await sn(r,a,{atlas:{labels:nn(e.options.localization)}})}catch{return null}finally{a.remove()}}var Rn=new WeakMap;async function nl(e){let t=Rn.get(e);if(t){let o=await t;return o?{...o,owner:!1}:null}let n=Jn({win:e}).catch(()=>null);Rn.set(e,n),n.finally(()=>Rn.delete(e));let r=await n;return r?{...r,owner:!0}:null}async function gs(e){var o,s;let t=(s=(o=e.root.ownerDocument)==null?void 0:o.defaultView)!=null?s:typeof window!="undefined"?window:null;if(!t)return!1;let n=await nl(t);if(n!=null&&n.delivered)return we(e,"Signed in. You can close this window."),!0;if(n!=null&&n.owner){let a=Qn(n.payload);if(a!=null&&a.ticket&&a.attemptId)return await ps(e,t,a.attemptId,a.ticket),!0;if(a!=null&&a.continuationUrl)return t.location.replace(a.continuationUrl),!0}let r=er(t.location.search);return r?r.ticket?(await ps(e,t,r.attemptId,r.ticket,()=>fs(e,t)),!0):(r.status&&(e.state=Ze({id:r.attemptId,status:r.status}),fs(e,t)),!1):!1}async function ps(e,t,n,r,o){let s=await ae(e,n,r);o==null||o(),!(s&&await Zn({win:t}).catch(()=>!1))&&await j(e,n)}function fs(e,t){try{t.history.replaceState({},t.document.title,je(t.location.href))}catch{}}async function ae(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 j(e,t){var o,s;let n=(s=(o=e.root.ownerDocument)==null?void 0:o.defaultView)!=null?s:typeof window!="undefined"?window:null,r=us(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){we(e,"Sign-in works \u2014 this is a preview, so no session was created.");return}if(r&&n){n.location.assign(r);return}we(e,"You are signed in.")}function Be(e,t){Nr({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 We(e,t,n){var l,i,c,d,u;if(e.busy)return;if((l=e.conditionalAbort)==null||l.abort(),e.flash=null,typeof t.identifier=="string"&&t.identifier.trim()&&(e.enteredIdentifier=t.identifier.trim()),e.busy=!0,Be(e,(i=e.state.attempt)==null?void 0:i.id),P(e),e.state=await Te(e.client,e.state,t),e.state.attempt&&z(e.state.attempt).kind==="collect_captcha"){let f=await $e(e,"signIn",!0);f&&(e.state=await Te(e.client,e.state,{identifier:(d=(c=e.enteredIdentifier)!=null?c:t.identifier)!=null?d:"",captcha_token:f}))}let r=e.state.attempt?z(e.state.attempt):null;n&&(r==null?void 0:r.kind)==="collect_first_factor"&&e.state.errors.length===0?r.strategies.includes(n)?await wt(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 Te(e.client,e.state,{password:t.password})),e.busy=!1;let o=e.state.attempt?z(e.state.attempt):null;e.mode==="sign-in"&&e.passwordEnabled&&(o==null?void 0:o.kind)==="collect_first_factor"&&!e.state.prepared&&(e.state={...N,errors:e.state.errors});let s=e.state.attempt?z(e.state.attempt):null;if((s==null?void 0:s.kind)==="collect_first_factor"&&!e.state.prepared&&e.state.errors.length===0){let f=He(e.emailDeliveryAvailable?s.strategies:s.strategies.filter(p=>p!=="email_code"&&p!=="email_link")).autoSend;f&&await wt(e,f,!1)}let a=e.state.attempt;if(Ce(e.state)){P(e);return}if((a==null?void 0:a.status)==="complete"){let f=(u=a.id)!=null?u:null;e.state.ticket&&f&&await ae(e,f,e.state.ticket),await j(e,f);return}P(e)}async function ms(e){var n,r;if(e.busy||!Ce(e.state))return;e.state=vr(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 ae(e,t,e.state.ticket)}finally{e.busy=!1}await j(e,t)}async function wt(e,t,n=!0){var s;if(n){if(e.busy)return;e.busy=!0,P(e)}let r=(s=e.state.prepared)!=null?s:null,o=await Wr(e.client,e.state,t);e.state=o.errors.length>0?{...o,prepared:r}:o,t==="email_link"&&o.errors.length===0&&bs(e),n&&(e.busy=!1,P(e))}async function hs(e){e.busy||(e.busy=!0,P(e),e.state=await Br(e.client,e.state),e.busy=!1,e.flash=e.state.errors.length===0?"We sent you a new email.":null,P(e))}function bs(e){e.linkPoll&&clearInterval(e.linkPoll),e.linkPoll=setInterval(()=>{(async()=>{var s,a;if(!en(e.state)){e.linkPoll&&clearInterval(e.linkPoll),e.linkPoll=null;return}let t=(s=e.state.attempt)==null?void 0:s.status,{state:n,ticket:r}=await Hr(e.client,e.state);if(e.state=n,!r&&n.attempt&&n.attempt.status!==t&&P(e),!r||!n.attempt)return;e.linkPoll&&clearInterval(e.linkPoll),e.linkPoll=null;let o=(a=n.attempt.id)!=null?a:null;o&&await ae(e,o,r),await j(e,o)})()},2e3)}async function St(e,t,n){var l,i,c;Be(e);let r=(i=(l=e.root.ownerDocument)==null?void 0:l.defaultView)!=null?i:typeof window!="undefined"?window:null,o=r?je(r.location.href):e.options.frontendApi,s=await e.client.post("/v1/client/sign_ins/oauth",{provider:t,redirect_url:o,...n?{identifier:n}:{}}),a=(c=s.data)==null?void 0:c.authorization_url;a&&r?r.location.assign(a):(e.handlePrompt=null,Z(e,s.errors))}async function Pn(e,t,n={}){var l,i,c;Be(e);let r=(i=(l=e.root.ownerDocument)==null?void 0:l.defaultView)!=null?i:typeof window!="undefined"?window:null,o=r?je(r.location.href):e.options.frontendApi;if(n.popup&&r){await ol(e,t,r,o);return}let s=await e.client.post("/v1/client/sign_ins/sso",{connection_id:t,redirect_url:o}),a=(c=s.data)==null?void 0:c.authorization_url;a&&r?r.location.assign(a):Z(e,s.errors)}function rl(e){let t=e.options.frontendApi;try{return new URL(/^https?:\/\//.test(t)?t:`https://${t}`).origin}catch{return t}}async function ol(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 Pn(e,t);return}let s=r.includes("?")?"&":"?",a=`${r}${s}__atlas_display=popup`,l=rl(e),i=f=>{if(f.origin!==l)return;let p=f.data;if(!(!p||p.type!=="atlas-sso")){n.removeEventListener("message",i);try{o.close()}catch{}if(p.error){Z(e,[{code:"sso_popup_cancelled",message:"Sign-in was cancelled."}]);return}if(p.status==="complete"&&p.ticket&&p.attempt_id){let m=p.attempt_id,b=p.ticket;(async()=>(await ae(e,m,b),await j(e,m)))();return}p.attempt_id&&p.status&&(e.state=Ze({id:p.attempt_id,status:p.status}),P(e))}};n.addEventListener("message",i);let c=await e.client.post("/v1/client/sign_ins/sso",{connection_id:t,redirect_url:a}),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",i),n.location.assign(d)}else{n.removeEventListener("message",i);try{o.close()}catch{}Z(e,c.errors)}}async function ys(e,t,n){let r=await e.client.post("/v1/client/sign_ins/id_token",qr({provider:t,idToken:n})),o=Vr(r.data);if(!o){Z(e,r.errors);return}if(o.status==="complete"&&o.ticket){await ae(e,o.attemptId,o.ticket),await j(e,o.attemptId);return}e.state=Ze({id:o.attemptId,status:o.status}),P(e)}function ks(e){e.resetFlow={...Le},P(e)}async function Tn(e,t){var r,o,s;if(e.busy||!e.resetFlow)return;if(e.busy=!0,Be(e),P(e),ke(e.resetFlow)==="request"){typeof t.email=="string"&&t.email.trim()&&(e.enteredIdentifier=t.email.trim());let a=await $e(e,"passwordReset");e.resetFlow=await so(e.client,(r=t.email)!=null?r:"",a!=null?a:void 0),(o=e.resetFlow.attempt)!=null&&o.poll_secret&&sl(e)}else e.resetFlow=await ao(e.client,e.resetFlow,{code:t.code,password:t.password});e.busy=!1;let n=e.resetFlow;if(((s=n==null?void 0:n.attempt)==null?void 0:s.status)==="complete"){let a=n.attempt.id;e.resetFlow=null,n.ticket?(await ae(e,a,n.ticket),await j(e,a)):(e.flash="Password updated. Sign in with your new password.",e.state=N,P(e));return}P(e)}function sl(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 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 s=await io(e.client,o);e.resetFlow!==o||((a=s.attempt)==null?void 0:a.status)==="needs_email_verification"||(e.linkPoll&&clearInterval(e.linkPoll),e.linkPoll=null,e.resetFlow=s,P(e))})()},2e3)}async function vs(e,t,n=!0){var c;if(e.busy)return;e.busy=!0,Be(e),P(e);let{identifier:r,password:o,...s}=t,a={};for(let[d,u]of Object.entries(s))u&&(a[d]=u);let l=await $e(e,"signUp");e.state=await Qt(e.client,{email:r!=null?r:"",password:o!=null?o:"",fields:a,consent:n,captchaToken:l!=null?l:void 0}),e.busy=!1;let i=e.state.attempt;if((i==null?void 0:i.status)==="complete"){let d=(c=i.id)!=null?c:null;e.state.ticket&&d&&await ae(e,d,e.state.ticket),await j(e,d);return}en(e.state)&&bs(e),P(e)}var al={"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"};function D(e,t,n={}){var a;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:(a=al[t])!=null?a:t).replace(/\{(\w+)\}/g,(l,i)=>{var c;return(c=n[i])!=null?c:l})}function _s(e){var n;let t=(n=e.state.attempt)==null?void 0:n.id;return t?(e.enrollment||(e.enrollment=hr(e.client,()=>Mt(e.account)),e.enrollment.subscribe(()=>queueMicrotask(()=>P(e)))),e.enrollment.start(t),e.enrollment):null}function xs(e,t,n,r){var i;let o=_s(e);if(!o)return r;let s=o.state,a=(c,d)=>{let u=g(e,"button","atlas-embed-step-back",D(e,c==="totp"?"mfa.enrollTotpOption":"mfa.enrollSmsOption"));u.type="button",u.setAttribute("data-atlas-mfa-method",c),u.disabled=e.busy||s.busy,u.addEventListener("click",()=>void o.choose(c)),Array.isArray(d)?d.push(u):d.appendChild(u)};if(s.method===null){t.appendChild(g(e,"p","atlas-embed-note",D(e,"mfa.enrollChoose")));for(let c of s.options)a(c,t)}else if(s.method==="totp"){let c=s.enrollment;if(c){if(t.appendChild(g(e,"p","atlas-embed-note",D(e,"mfa.enrollScan"))),c.qrCode){let d=L(e).createElement("img");d.className="atlas-embed-mfa-qr",d.setAttribute("data-atlas","mfa-qr"),d.src=c.qrCode,d.alt=D(e,"mfa.enrollQrAlt"),d.width=180,d.height=180,t.appendChild(d)}if(c.secret){let d=g(e,"p","atlas-embed-note",`${D(e,"mfa.enrollSetupKey")}: `);d.setAttribute("data-atlas","mfa-setup-key"),d.appendChild(g(e,"code","atlas-embed-mfa-key",mr(c.secret))),t.appendChild(d)}n.addCodeField("code",D(e,"mfa.enrollFirstCodeLabel"),!0),s.totpCodes>=2&&n.addCodeField("secondCode",D(e,"mfa.enrollSecondCodeLabel"),!1)}else{let d=g(e,"p","atlas-embed-note",s.busy?D(e,"mfa.enrollPreparing"):"");d.setAttribute("aria-live","polite"),t.appendChild(d)}}else if(!s.enrollment)n.addField("phone",D(e,"mfa.phoneLabel"),"tel","tel"),t.appendChild(g(e,"p","atlas-embed-note",D(e,"mfa.phoneHint")));else{let c=g(e,"p","atlas-embed-note",D(e,"mfa.codeTextedTo",{phone:(i=s.enrollment.phone)!=null?i:""}));c.setAttribute("data-atlas","mfa-code-texted"),t.appendChild(c),n.addCodeField("code",D(e,"mfa.codeLabel"),!0);let d=g(e,"button","atlas-embed-step-back",D(e,"signIn.resendCode"));d.type="button",d.setAttribute("data-atlas-resend",""),d.disabled=e.busy||s.busy,d.addEventListener("click",()=>void o.resend()),n.trailing.push(d)}for(let c of s.errors){let d=g(e,"p","atlas-embed-error",e.errorText(c));d.setAttribute("role","alert"),t.appendChild(d)}if(s.method!==null&&s.options.length>1)for(let c of s.options.filter(d=>d!==s.method))a(c,n.trailing);let l=br(s);return l===null?null:l==="mfa.sendCode"?D(e,"mfa.sendCode"):r}async function ws(e,t){let n=_s(e);if(!n)return;let r=await n.submit(t);r&&await We(e,r)}function Ss(e,t){var a;let n=(a=e.state.attempt)==null?void 0:a.id;if(!n)return;let r=Mt(e.account),o=e.secondFactorCode&&e.secondFactorCode.attemptId===n?e.secondFactorCode:null,s=[];r.sms&&s.push("sms"),r.emailCode&&s.push("email_code");for(let l of s){let i=l==="sms"?"sms-second-factor":"email-second-factor";if((o==null?void 0:o.strategy)===l&&o.sentTo!==void 0){let u=g(e,"p","atlas-embed-note",l==="sms"?D(e,"mfa.codeTextedTo",{phone:o.sentTo}):D(e,"signIn.codeSentTo",{email:o.sentTo}));u.setAttribute("data-atlas",`${i}-sent`),u.setAttribute("aria-live","polite"),t.push(u);continue}let c=(o==null?void 0:o.strategy)===l&&o.busy===!0,d=g(e,"button","atlas-embed-step-back",c?D(e,"signIn.sending"):D(e,l==="sms"?"mfa.smsCodeOption":"signIn.emailCodeOption"));if(d.type="button",d.setAttribute("data-atlas",i),d.disabled=e.busy||c,d.addEventListener("click",()=>{e.secondFactorCode={attemptId:n,strategy:l,busy:!0},P(e),yr(e.client,n,l).then(({sentTo:u})=>{e.secondFactorCode={attemptId:n,strategy:l,sentTo:u},P(e)},u=>{e.secondFactorCode={attemptId:n,strategy:l,error:u instanceof Error?u.message:String(u)},P(e)})}),t.push(d),(o==null?void 0:o.strategy)===l&&o.error){let u=g(e,"p","atlas-embed-error",o.error);u.setAttribute("role","alert"),t.push(u)}}}function Cs(e,t){var a,l;let n=g(e,"div","atlas-embed-recovery-codes");n.setAttribute("data-atlas","recovery-codes"),n.appendChild(g(e,"h2",R(e,"title","atlas-embed-title"),D(e,"mfa.recoveryCodesTitle"))),n.appendChild(g(e,"p","atlas-embed-note",D(e,"mfa.recoveryCodesHelp")));let r=g(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 i of t){let c=g(e,"li");c.appendChild(g(e,"code","atlas-embed-mfa-key",i)),r.appendChild(c)}n.appendChild(r);let o=((a=L(e).defaultView)!=null?a:globalThis).navigator;if((l=o==null?void 0:o.clipboard)!=null&&l.writeText){let i=g(e,"button","atlas-embed-step-back",D(e,"mfa.recoveryCodesCopy"));i.type="button",i.setAttribute("data-atlas","recovery-codes-copy"),i.addEventListener("click",()=>{_r(t).then(c=>{if(!c||n.querySelector('[data-atlas="recovery-codes-copied"]'))return;let d=g(e,"p","atlas-embed-note",D(e,"mfa.recoveryCodesCopied"));d.setAttribute("data-atlas","recovery-codes-copied"),d.setAttribute("aria-live","polite"),n.insertBefore(d,s)})}),n.appendChild(i)}if(Ut()){let i=g(e,"button","atlas-embed-step-back",D(e,"mfa.recoveryCodesDownload"));i.type="button",i.setAttribute("data-atlas","recovery-codes-download"),i.addEventListener("click",()=>xr(t)),n.appendChild(i)}let s=g(e,"button",R(e,"buttonPrimary","atlas-embed-button"),D(e,"mfa.recoveryCodesSaved"));return s.type="button",s.setAttribute("data-atlas","recovery-codes-saved"),s.disabled=e.busy,s.addEventListener("click",()=>{s.disabled=!0,ms(e)}),n.appendChild(s),n}function Es(e){var p;let t=e.resetFlow,n=ke(t),r=g(e,"div","atlas-embed-reset");r.appendChild(g(e,"h1",R(e,"title","atlas-embed-title"),"Reset your password"));let o=L(e).createElement("form"),s=t.errors,a=new Map,l=s.find(m=>!m.param);l&&o.appendChild(g(e,"div","atlas-embed-form-error",e.errorText(l)));let i=null,c="Continue",d=!0,u=e.account.passwordReset;switch(n){case"request":i=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",Ct(e,o,a,s,"email","Email address","email","username");{let m=a.get("email");m&&(e.enteredIdentifier&&(m.value=e.enteredIdentifier),m.setAttribute("data-atlas-autofocus",""))}break;case"collect_email_code":if(u==="link"){d=!1,i="Check your email";let m=g(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 b=g(e,"button","atlas-embed-step-back","Send another link");b.type="button",b.setAttribute("data-atlas-resend",""),b.disabled=e.busy,b.addEventListener("click",()=>{var y;e.resetFlow={...Le},Tn(e,{email:(y=e.enteredIdentifier)!=null?y:""})}),o.appendChild(b);break}i=e.enteredIdentifier?`Enter the code we sent to ${e.enteredIdentifier}`:"Enter the code we sent to your email",In(e,o,a,s,"code","Reset code",!0);break;case"collect_second_factor":i="Enter the code from your authenticator app",In(e,o,a,s,"code","Two-factor code",!0);break;case"collect_new_password":i="Choose a new password",c="Set new password",Ct(e,o,a,s,"password","New password","password","new-password"),(p=a.get("password"))==null||p.setAttribute("data-atlas-autofocus","");break;default:d=!1,o.appendChild(g(e,"p","atlas-embed-note","You\u2019re all set."))}i&&r.appendChild(g(e,"p",R(e,"subtitle","atlas-embed-subtitle"),i)),r.appendChild(o),d&&o.appendChild(xe(e,c));let f=g(e,"button","atlas-embed-step-back","Back to sign in");return f.type="button",f.addEventListener("click",()=>{e.resetFlow=null,P(e)}),o.appendChild(f),o.addEventListener("submit",m=>{m.preventDefault();let b={};for(let[y,A]of a)b[y]=A.value;Tn(e,b)}),r}function Ct(e,t,n,r,o,s,a,l){let i=g(e,"label",R(e,"field","atlas-embed-field"));i.appendChild(g(e,"span",R(e,"label","atlas-embed-label"),s));let c=L(e).createElement("input");if(c.className=R(e,"input","atlas-embed-input"),c.type=a,c.name=o,c.setAttribute("autocomplete",l),a==="password"){let d=g(e,"div","atlas-embed-password");d.appendChild(c);let u=g(e,"button","atlas-embed-password-toggle","Show");u.type="button",u.setAttribute("aria-label","Show password"),u.addEventListener("click",f=>{f.preventDefault();let p=c.type==="password";c.type=p?"text":"password",u.textContent=p?"Hide":"Show",u.setAttribute("aria-label",p?"Hide password":"Show password")}),d.appendChild(u),i.appendChild(d)}else i.appendChild(c);for(let d of r.filter(u=>u.param===o))i.appendChild(g(e,"span",R(e,"error","atlas-embed-error"),e.errorText(d)));n.set(o,c),t.appendChild(i)}function In(e,t,n,r,o,s,a){var m;if(e.codeInputStyle==="single"){Ct(e,t,n,r,o,s,"text","one-time-code"),a&&((m=n.get(o))==null||m.setAttribute("data-atlas-autofocus",""));return}let i=g(e,"div",R(e,"field","atlas-embed-field"));i.appendChild(g(e,"span",R(e,"label","atlas-embed-label"),s));let c=g(e,"div","atlas-embed-code");c.setAttribute("role","group"),c.setAttribute("aria-label",s);let d=L(e).createElement("input");d.type="hidden",d.name=o,n.set(o,d);let u=[],f=()=>{d.value=u.map(b=>b.value).join("")},p=()=>{d.value.length!==6||e.busy||t.dispatchEvent(new Event("submit",{cancelable:!0,bubbles:!0}))};for(let b=0;b<6;b++){let y=L(e).createElement("input");y.className="atlas-embed-code-box",y.type="text",y.setAttribute("inputmode","numeric"),y.setAttribute("autocomplete",b===0?"one-time-code":"off"),y.setAttribute("aria-label",`${s} digit ${b+1}`),y.maxLength=1,a&&b===0&&y.setAttribute("data-atlas-autofocus",""),y.addEventListener("input",()=>{y.value=y.value.replace(/\D/g,"").slice(0,1),f(),y.value&&b<5&&u[b+1].focus(),p()}),y.addEventListener("keydown",A=>{A.key==="Backspace"&&!y.value&&b>0&&u[b-1].focus()}),y.addEventListener("paste",A=>{var v,C,x;A.preventDefault();let E=((C=(v=A.clipboardData)==null?void 0:v.getData("text"))!=null?C:"").replace(/\D/g,"").slice(0,6);for(let k=0;k<6;k++)u[k].value=(x=E[k])!=null?x:"";f(),u[Math.min(E.length,5)].focus(),p()}),u.push(y),c.appendChild(y)}i.appendChild(c),i.appendChild(d);for(let b of r.filter(y=>y.param===o))i.appendChild(g(e,"span",R(e,"error","atlas-embed-error"),e.errorText(b)));t.appendChild(i)}function As(e,t){var f,p,m,b,y,A,E,v,C;let n=L(e).createElement("form"),r=e.state.errors.find(x=>!x.param);r&&n.appendChild(g(e,"div","atlas-embed-form-error",e.errorText(r)));let o=new Map,s=e.state.errors,a=(x,k,w,S)=>Ct(e,n,o,s,x,k,w,S),l=(x,k,w)=>In(e,n,o,s,x,k,w),i=!0,c=pe[e.mode].submit,d=[];switch(t){case"collect_identifier":if(a("identifier","Email address","email",e.passkeyEnabled&&be()?"username webauthn":"username"),e.enteredIdentifier&&(o.get("identifier").value=e.enteredIdentifier),e.mode==="sign-in"&&e.passwordEnabled){a("password","Password","password","current-password");let x=[];e.emailDeliveryAvailable&&e.emailCodeEnabled?x.push("email_code"):e.emailDeliveryAvailable&&e.emailLinkEnabled&&x.push("email_link");for(let k of x){let w=g(e,"button","atlas-embed-step-back",k==="email_code"?"Email me a code instead":"Email me a sign-in link instead");w.type="button",w.setAttribute("data-strategy",k),w.disabled=e.busy,w.addEventListener("click",()=>{var T;let S=o.get("identifier");if(!S.value.trim()){(T=S.reportValidity)==null||T.call(S),S.focus();return}We(e,{identifier:S.value},k)}),d.push(w)}}if(e.mode==="sign-in"&&e.rememberMeEnabled){let x=g(e,"label","atlas-embed-remember"),k=L(e).createElement("input");k.type="checkbox",k.className="atlas-embed-remember-check",k.checked=e.remember,k.addEventListener("change",()=>{e.remember=k.checked}),x.appendChild(k),x.appendChild(g(e,"span","atlas-embed-remember-text","Remember me")),n.appendChild(x)}break;case"collect_first_factor":{let x=e.state.attempt?(f=z(e.state.attempt).strategies)!=null?f:[]:[],k=He(e.emailDeliveryAvailable?x:x.filter(I=>I!=="email_code"&&I!=="email_link")),w=(p=e.state.prepared)!=null?p:null,S=(y=(b=e.enteredIdentifier)!=null?b:(m=e.state.attempt)==null?void 0:m.identifier)!=null?y:"",T=(I,X,$)=>{let B=g(e,"button","atlas-embed-step-back",X);return B.type="button",B.setAttribute($,$==="data-strategy"?I:""),B.disabled=e.busy,B.addEventListener("click",()=>void wt(e,I)),B};if(w==="email_code"){let I=g(e,"p","atlas-embed-note",S?`We sent a code to ${S}. Enter it below.`:"We sent you a code. Enter it below.");I.setAttribute("data-atlas-code-sent",""),n.appendChild(I),l("code","Verification code",!0),d.push(T("email_code","Resend code","data-atlas-resend"))}else if(w==="email_link"){i=!1;let I=g(e,"p","atlas-embed-note",S?`We sent a sign-in link to ${S}. Open it on any device to continue.`:"Check your email for a sign-in link.");I.setAttribute("data-atlas-link-sent",""),n.appendChild(I),d.push(T("email_link","Resend link","data-atlas-resend"))}else if(!k.password&&k.email.length>0){i=!1;for(let I of k.email)d.push(T(I,I==="email_code"?"Email me a code":"Email me a sign-in link","data-strategy"))}else{a("password","Password","password","current-password");for(let I of k.email)d.push(T(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?a("code","Backup code","text","one-time-code"):l("code","Two-factor code",!0),e.trustedDeviceEnabled){let x=g(e,"label","atlas-embed-remember"),k=L(e).createElement("input");k.type="checkbox",k.className="atlas-embed-remember-check",k.checked=e.rememberDevice,k.addEventListener("change",()=>{e.rememberDevice=k.checked}),x.appendChild(k),x.appendChild(g(e,"span","atlas-embed-remember-text","Remember this device")),n.appendChild(x)}Ss(e,d);break;case"collect_email_code":{let x=Xe(e.state.attempt,e.account.emailVerification);if(x){i=!1;let k=(v=(E=e.enteredIdentifier)!=null?E:(A=e.state.attempt)==null?void 0:A.identifier)!=null?v:"",w=g(e,"p","atlas-embed-note",k?`We sent a confirmation link to ${k}. 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.");w.setAttribute("data-atlas-link-sent",""),n.appendChild(w)}else l("code","Verification code",!0);if(((C=e.state.attempt)==null?void 0:C.object)==="sign_up_attempt"){let k=g(e,"button","atlas-embed-step-back",x?"Resend link":"Resend code");k.type="button",k.setAttribute("data-atlas-resend",""),k.disabled=e.busy,k.addEventListener("click",()=>void hs(e)),d.push(k)}break}case"collect_new_password":a("password","New password","password","new-password");break;case"enroll_second_factor":{let x=xs(e,n,{addField:a,addCodeField:l,trailing:d},c);x===null?i=!1:c=x;break}default:i=!1,n.appendChild(g(e,"p","atlas-embed-note","Please continue in your application."))}i&&n.appendChild(xe(e,c));for(let x of d)n.appendChild(x);if(t==="collect_second_factor"){let x=g(e,"button","atlas-embed-step-back",e.backupCodeMode?"Use your authenticator app":"Use a backup code instead");x.type="button",x.addEventListener("click",()=>{e.backupCodeMode=!e.backupCodeMode,P(e)}),n.appendChild(x)}if((t==="collect_identifier"&&e.mode==="sign-in"&&e.passwordEnabled||t==="collect_first_factor"&&o.has("password"))&&e.passwordResetEnabled){let x=g(e,"button","atlas-embed-step-back","Forgot password?");x.type="button",x.addEventListener("click",()=>ks(e)),n.appendChild(x)}return n.addEventListener("submit",x=>{x.preventDefault();let k={};for(let[w,S]of o)k[w]=S.value;if(t==="collect_second_factor"&&e.trustedDeviceEnabled&&e.rememberDevice&&(k.remember_device="true"),t==="enroll_second_factor"){ws(e,k);return}We(e,k)}),n}function il(e){var i;let t=(i=e.appearance)==null?void 0:i.legal;if(!t||!t.termsUrl&&!t.privacyUrl)return null;let n=L(e),r=g(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 s=g(e,"span","atlas-embed-consent-text"),a=(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};s.appendChild(n.createTextNode(t.required?"I agree to the ":"By continuing you agree to the "));let l=[];return t.termsUrl&&l.push(a(t.termsUrl,"Terms of Service")),t.privacyUrl&&l.push(a(t.privacyUrl,"Privacy Policy")),l.forEach((c,d)=>{d>0&&s.appendChild(n.createTextNode(" and ")),s.appendChild(c)}),s.appendChild(n.createTextNode(".")),r.appendChild(s),{row:r,checkbox:o}}function Rs(e){var i;let t=L(e).createElement("form");if(!e.passwordSignUpEnabled)return t.appendChild(g(e,"div","atlas-embed-form-error",co)),t;let n=e.state.errors.find(c=>!c.param);n&&t.appendChild(g(e,"div","atlas-embed-form-error",e.errorText(n)));let r=new Map,o=(c,d,u)=>{var y,A,E;let f=(y=u.type)!=null?y:"text",p=f==="radio"||f==="multiselect",m=g(e,p?"fieldset":"label",R(e,"field","atlas-embed-field"));m.appendChild(g(e,p?"legend":"span",R(e,"label","atlas-embed-label"),u.required?d:`${d} (optional)`));let b=L(e);if(f==="select"){let v=b.createElement("select");v.className=R(e,"input","atlas-embed-input"),v.name=c;let C=b.createElement("option");C.value="",C.textContent=u.placeholder||"Select\u2026",v.appendChild(C);for(let x of(A=u.options)!=null?A:[]){let k=b.createElement("option");k.value=x,k.textContent=x,v.appendChild(k)}m.appendChild(v),r.set(c,()=>v.value)}else if(f==="textarea"){let v=b.createElement("textarea");v.className=R(e,"input","atlas-embed-input"),v.name=c,v.rows=3,u.placeholder&&v.setAttribute("placeholder",u.placeholder),m.appendChild(v),r.set(c,()=>v.value)}else if(f==="checkbox"){let v=b.createElement("input");v.type="checkbox",v.name=c,v.className="atlas-embed-checkbox",m.classList.add("atlas-embed-field-checkbox"),m.appendChild(v),r.set(c,()=>v.checked?"true":"")}else if(f==="radio"||f==="multiselect"){let v=b.createElement("div");v.className="atlas-embed-choices";let C=[];for(let x of(E=u.options)!=null?E:[]){let k=b.createElement("label");k.className="atlas-embed-choice";let w=b.createElement("input");w.type=f==="radio"?"radio":"checkbox",w.name=c,w.value=x,C.push(w),k.appendChild(w),k.appendChild(g(e,"span",void 0,x)),v.appendChild(k)}m.appendChild(v),r.set(c,()=>{var x,k;return f==="radio"?(k=(x=C.find(w=>w.checked))==null?void 0:x.value)!=null?k:"":C.filter(w=>w.checked).map(w=>w.value).join(", ")})}else{let v=b.createElement("input");v.className=R(e,"input","atlas-embed-input"),v.type=f,v.name=c,u.autocomplete&&v.setAttribute("autocomplete",u.autocomplete),u.placeholder&&v.setAttribute("placeholder",u.placeholder),m.appendChild(v),r.set(c,()=>v.value)}for(let v of e.state.errors.filter(C=>C.param===c))m.appendChild(g(e,"span",R(e,"error","atlas-embed-error"),e.errorText(v)));t.appendChild(m)};for(let c of e.signUpFields)o(c.key,c.label,{type:c.type,required:c.required,placeholder:c.placeholder,options:c.options});o("identifier","Email address",{type:"email",required:!0,autocomplete:"email"}),o("password","Password",{type:"password",required:!0,autocomplete:"new-password"});let s=il(e);s&&t.appendChild(s.row);let a=xe(e,pe[e.mode].submit),l=()=>!(s!=null&&s.checkbox)||s.checkbox.checked;return a.disabled=e.busy||!l(),(i=s==null?void 0:s.checkbox)==null||i.addEventListener("change",()=>{a.disabled=e.busy||!l()}),t.appendChild(a),t.addEventListener("submit",c=>{c.preventDefault();let d={};for(let[u,f]of r)d[u]=f();vs(e,d,l())}),t}var ll={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"/>'},cl={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 Ps(e){let t=ll[e];if(t)return`<svg viewBox="0 0 24 24" width="18" height="18" aria-hidden="true" focusable="false">${t}</svg>`;let n=cl[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 Ts(e,t){return!t||!t.id||!t.status||t.status==="complete"?!1:(e.state={...e.state,attempt:t,errors:[]},P(e),!0)}function Is(e){let t=e.options.passkeyPrf;return t?{prf:t,onExtensionResults:n=>{var a,l,i,c,d;let r={credentialId:n.credentialId,enabled:!!((a=n.prf)!=null&&a.results)||((l=n.prf)==null?void 0:l.enabled)===!0,...(i=n.prf)!=null&&i.results?{results:n.prf.results}:{}},o=(c=e.root.ownerDocument)==null?void 0:c.defaultView,s=(d=o==null?void 0:o.CustomEvent)!=null?d:CustomEvent;e.root.dispatchEvent(new s("atlas:passkey-prf",{detail:r,bubbles:!1}))}}:{}}async function Os(e){var o,s,a;if(e.busy)return;(o=e.conditionalAbort)==null||o.abort(),e.busy=!0,P(e);let t=await an(e.client,{captcha:({retry:l})=>$e(e,"signIn",l)});if(!t.ok||!t.data){e.busy=!1,Z(e,t.errors);return}let n;try{n=await tn(t.data,Is(e))}catch{e.busy=!1,P(e);return}let r=await e.client.post("/v1/client/sign_ins/passkey/finish",n);if(e.busy=!1,r.ok&&((s=r.data)==null?void 0:s.status)==="complete"){await j(e,(a=r.data.created_session_id)!=null?a:null);return}r.ok&&Ts(e,r.data)||Z(e,r.errors)}async function Ls(e){var r,o,s;if(e.mode!=="sign-in"||!e.passkeyEnabled||!be())return;let t=!1;try{t=await Qr()}catch{t=!1}if(!t||ye(e.captchaFlows.signIn))return;(r=e.conditionalAbort)==null||r.abort();let n=new AbortController;e.conditionalAbort=n;try{let a=await an(e.client);if(!a.ok||!a.data||n.signal.aborted)return;let l=await tn(a.data,{mediation:"conditional",signal:n.signal,...Is(e)});if(n.signal.aborted)return;let i=await e.client.post("/v1/client/sign_ins/passkey/finish",l);i.ok&&((o=i.data)==null?void 0:o.status)==="complete"?await j(e,(s=i.data.created_session_id)!=null?s:null):i.ok&&Ts(e,i.data)}catch{}}function Ds(e){let t=g(e,"button",R(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",()=>{Os(e)}),t}function On(e){let t=[...e.providers];for(let n of e.nativeProviders)t.includes(n.provider)||t.push(n.provider);return t}var dl='<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 ul(e,t){var l;let{variant:n,labels:r}=e.social,o=(l=r.atlas)!=null?l:n==="block"?"Continue with Atlas":"Atlas",s=g(e,"button",R(e,"socialButton","atlas-embed-social-button"));s.type="button",s.setAttribute("data-atlas-provider","atlas"),s.setAttribute("data-variant",n);let a=L(e).createElement("span");if(a.className="atlas-embed-social-icon",a.innerHTML=dl,s.appendChild(a),n==="icon")s.setAttribute("aria-label","Continue with Atlas"),s.setAttribute("title","Atlas");else{let i=L(e).createElement("span");i.className="atlas-embed-social-label",i.textContent=o,s.appendChild(i)}return s.addEventListener("click",()=>{Pn(e,t,{popup:!0})}),s}function Fs(e){let t=On(e),n=g(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(ul(e,e.signInWithAtlas.connection_id));for(let c of t){let d=e.nativeProviders.find(f=>f.provider===c),u=c==="google"&&(d!=null&&d.client_id)?gl(e,d.client_id):fl(e,c);u.getAttribute("data-atlas-provider")||u.setAttribute("data-atlas-provider",c),n.appendChild(u)}let r=e.social.layout==="carousel"?pl(e,n):n;if(!(e.social.search==="always"||e.social.search==="auto"&&t.length>Go))return r;let s=g(e,"div","atlas-embed-social-field"),a=L(e).createElement("input");a.type="search",a.className="atlas-embed-social-search",a.setAttribute("placeholder","Search sign-in options\u2026"),a.setAttribute("aria-label","Search sign-in options"),a.autocomplete="off";let l=g(e,"div","atlas-embed-social-empty");l.textContent="No matching sign-in options.",l.setAttribute("hidden","");let i=Array.from(n.children);return a.addEventListener("input",()=>{var u;let c=a.value.trim().toLowerCase(),d=0;for(let f of i){let p=(u=f.getAttribute("data-atlas-provider"))!=null?u:"",m=c===""||xt(p).toLowerCase().includes(c)||p.toLowerCase().includes(c);f.toggleAttribute("hidden",!m),m&&(d+=1)}l.toggleAttribute("hidden",d!==0),n.dispatchEvent(new Event("scroll"))}),s.appendChild(a),s.appendChild(r),s.appendChild(l),s}function pl(e,t){var c;let n=(c=L(e).defaultView)!=null?c:typeof window!="undefined"?window:null,r=g(e,"div","atlas-embed-carousel"),o=d=>{let u=g(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"?cs:ds,u.addEventListener("click",()=>{let f=Math.max(t.clientWidth*.8,140);typeof t.scrollBy=="function"&&t.scrollBy({left:(d==="prev"?-1:1)*f,behavior:"smooth"})}),u},s=o("prev"),a=o("next"),l=()=>{let d=t.scrollWidth-t.clientWidth,u=d>2;r.setAttribute("data-overflow",u?"true":"false"),s.disabled=!u||t.scrollLeft<=1,a.disabled=!u||t.scrollLeft>=d-1};t.addEventListener("scroll",l,{passive:!0});let i=n&&n.ResizeObserver;return i?new i(l).observe(t):n&&n.addEventListener("resize",l),n!=null&&n.requestAnimationFrame&&n.requestAnimationFrame(l),l(),r.appendChild(s),r.appendChild(t),r.appendChild(a),r}function Ms(e,t,n="button"){var c;let{variant:r,labels:o}=e.social,s=xt(t),a=(c=o[t])!=null?c:r==="block"?`Continue with ${s}`:s,l=g(e,n,R(e,"socialButton","atlas-embed-social-button"));n==="button"&&(l.type="button"),l.setAttribute("data-atlas-provider",t),l.setAttribute("data-variant",r);let i=Ps(t);if(i){let d=L(e).createElement("span");d.className="atlas-embed-social-icon",d.innerHTML=i,l.appendChild(d)}if(r==="icon")l.setAttribute("aria-label",`Continue with ${s}`),l.setAttribute("title",s);else{let d=L(e).createElement("span");d.className="atlas-embed-social-label",d.textContent=a,l.appendChild(d)}return l}function fl(e,t){let n=Ms(e,t);return n.addEventListener("click",()=>{ls.has(t)?(e.handlePrompt=t,P(e)):St(e,t)}),n}function Us(e,t){let n=xt(t),r=L(e).createElement("form");r.className="atlas-embed-form",r.setAttribute("novalidate","true");for(let i of e.state.errors.filter(c=>!c.param))r.appendChild(g(e,"div","atlas-embed-form-error",e.errorText(i)));let o=g(e,"label",R(e,"field","atlas-embed-field"));o.appendChild(g(e,"span",R(e,"label","atlas-embed-label"),`${n} handle`));let s=L(e).createElement("input");s.className=R(e,"input","atlas-embed-input"),s.type="text",s.name="identifier",s.placeholder="you.bsky.social",s.setAttribute("autocomplete","username"),s.setAttribute("autocapitalize","none"),s.setAttribute("spellcheck","false"),o.appendChild(s),r.appendChild(o);let a=xe(e,pe[e.mode].submit);r.appendChild(a);let l=g(e,"button","atlas-embed-handle-back","Back");return l.type="button",l.addEventListener("click",()=>{e.handlePrompt=null,e.state={...e.state,errors:[]},P(e)}),r.appendChild(l),r.addEventListener("submit",i=>{i.preventDefault();let c=s.value.trim();if(!c){e.state={...e.state,errors:[{code:"validation_error",message:`Enter your ${n} handle.`}]},P(e);return}St(e,t,c)}),r}function gl(e,t){let n=Ms(e,"google","div");return n.setAttribute("role","button"),n.setAttribute("tabindex","0"),Gr({wrapper:n,clientId:t,onCredential:r=>void ys(e,"google",r),onError:()=>we(e,"Google sign-in could not start.")}).catch(()=>{n.addEventListener("click",()=>void St(e,"google"))}),n}function we(e,t){e.root.textContent="";let n=g(e,"div",R(e,"card","atlas-embed-card"));n.appendChild(g(e,"p","atlas-embed-note",t)),e.root.appendChild(n)}function zs(e){e.root.textContent="";let t=g(e,"div",R(e,"card","atlas-embed-card")),n=e.interaction.loading,r=g(e,"div","atlas-embed-loading");if(r.setAttribute("data-loading",n),r.setAttribute("role","status"),r.setAttribute("aria-label","Loading"),n==="skeleton")for(let s of["title","sub","input","input","button"])r.appendChild(g(e,"div",`atlas-embed-skel atlas-embed-skel-${s}`));else if(n==="dots")for(let s=0;s<3;s+=1)r.appendChild(g(e,"span","atlas-embed-dot"));else n==="bar"?r.appendChild(g(e,"span","atlas-embed-loadbar")):r.appendChild(g(e,"span","atlas-embed-spinner"));let o=g(e,"span","atlas-embed-sr","Loading\u2026");r.appendChild(o),t.appendChild(r),e.root.appendChild(t)}function Z(e,t){e.state={...e.state,errors:[...t]},P(e)}function P(e){var d,u,f,p,m,b,y,A,E,v;e.root.textContent="";let t=g(e,"div",R(e,"card","atlas-embed-card")),n=(u=(d=e.appearance)==null?void 0:d.logoUrl)!=null?u:null;if(n){let C=L(e).createElement("img");C.className="atlas-embed-logo",C.src=n,C.alt=(p=(f=e.appearance)==null?void 0:f.applicationName)!=null?p:"",t.appendChild(C)}if(e.resetFlow){let C=`reset_${ke(e.resetFlow)}`;if(t.setAttribute("data-step",C),C!==e.lastStepKind&&t.setAttribute("data-enter",""),e.lastStepKind=C,t.appendChild(Es(e)),(m=e.appearance)!=null&&m.footer&&t.appendChild(g(e,"p",R(e,"footer","atlas-embed-footer"),e.appearance.footer)),e.root.appendChild(t),t.hasAttribute("data-enter")){let x=t.querySelector("[data-atlas-autofocus]");x instanceof HTMLElement&&x.focus()}return}let r=Ce(e.state);if(r){t.setAttribute("data-step","recovery_codes"),e.lastStepKind!=="recovery_codes"&&t.setAttribute("data-enter",""),e.lastStepKind="recovery_codes",t.appendChild(Cs(e,r)),e.root.appendChild(t);return}let o=e.state.attempt?z(e.state.attempt):{kind:"collect_identifier"},s=e.mode==="sign-up"&&!e.state.attempt,a=s||o.kind==="collect_identifier",l=e.handlePrompt?"handle":o.kind;t.setAttribute("data-step",l),l!==e.lastStepKind&&t.setAttribute("data-enter",""),e.lastStepKind=l;let i=(y=(b=e.appearance)==null?void 0:b.headline)!=null?y:pe[e.mode].title;t.appendChild(g(e,"h1",R(e,"title","atlas-embed-title"),i));let c=a?null:ml(e,o.kind);if(c?t.appendChild(c):(A=e.appearance)!=null&&A.subheadline&&t.appendChild(g(e,"p",R(e,"subtitle","atlas-embed-subtitle"),e.appearance.subheadline)),e.flash&&t.appendChild(g(e,"div","atlas-embed-flash",e.flash)),e.handlePrompt){t.appendChild(Us(e,e.handlePrompt)),(E=e.appearance)!=null&&E.footer&&t.appendChild(g(e,"p",R(e,"footer","atlas-embed-footer"),e.appearance.footer)),e.root.appendChild(t);return}if(a&&(On(e).length>0||e.signInWithAtlas.enabled)&&(t.appendChild(Fs(e)),t.appendChild(g(e,"div",R(e,"divider","atlas-embed-divider"),"or"))),t.appendChild(s?Rs(e):As(e,o.kind)),a&&e.mode==="sign-in"&&e.passkeyEnabled&&be()&&t.appendChild(Ds(e)),(v=e.appearance)!=null&&v.footer&&t.appendChild(g(e,"p",R(e,"footer","atlas-embed-footer"),e.appearance.footer)),e.root.appendChild(t),t.hasAttribute("data-enter")){let C=t.querySelector("[data-atlas-autofocus]");C instanceof HTMLElement&&C.focus()}}function ml(e,t){let n=e.enteredIdentifier,r=null,o=!1;switch(t){case"collect_email_code":r=Xe(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":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=D(e,"mfa.enrollChoose");break;default:return null}let s=g(e,"div","atlas-embed-step-context");if(s.appendChild(g(e,"p",R(e,"subtitle","atlas-embed-subtitle"),r)),o){let a=g(e,"button","atlas-embed-step-back","Use a different email");a.type="button",a.addEventListener("click",()=>hl(e)),s.appendChild(a)}return s}function hl(e){e.state=N,e.backupCodeMode=!1,e.handlePrompt=null,e.enteredIdentifier=null,P(e)}var Se=class{constructor(t,n){this.root=t;this.options=n;h(this,"client");h(this,"mode");h(this,"appearance",null);h(this,"design",null);h(this,"appliedDesign");h(this,"providers",[]);h(this,"nativeProviders",[]);h(this,"signInWithAtlas",{enabled:!1});h(this,"social",An(void 0,void 0));h(this,"codeInputStyle","boxes");h(this,"interaction",_t(void 0,void 0));h(this,"backupCodeMode",!1);h(this,"enrollment",null);h(this,"secondFactorCode",null);h(this,"enteredIdentifier",null);h(this,"lastStepKind",null);h(this,"signUpFields",[]);h(this,"passwordEnabled",!0);h(this,"emailCodeEnabled",!1);h(this,"emailLinkEnabled",!1);h(this,"emailDeliveryAvailable",!0);h(this,"passkeyEnabled",!1);h(this,"passwordResetEnabled",!0);h(this,"passwordSignUpEnabled",!0);h(this,"conditionalAbort");h(this,"linkPoll",null);h(this,"account",{...ln});h(this,"rememberMeEnabled",!1);h(this,"remember",!0);h(this,"trustedDeviceEnabled",!1);h(this,"rememberDevice",!1);h(this,"captchaFlows",{});h(this,"captchaHost");h(this,"state",N);h(this,"resetFlow",null);h(this,"flash",null);h(this,"handlePrompt",null);h(this,"busy",!1);h(this,"recorder");var r,o,s;this.mode=(r=n.mode)!=null?r:"sign-in",this.interaction=_t(void 0,(o=n.appearance)==null?void 0:o.interaction),this.client=rs({publishableKey:n.publishableKey,frontendApi:n.frontendApi,fetchImpl:n.fetchImpl,locale:(s=n.locale)!=null?s:qn(n.localization),referral:n.referral,referralConsent:n.referralConsent})}errorText(t){return Kn(t,this.options.localization)}async mount(){var r,o,s,a,l,i,c,d,u,f,p,m,b,y,A,E,v,C,x,k,w,S,T,I,X,$,B,Mn,Un,zn,Nn;if(as((r=this.root.ownerDocument)!=null?r:document),this.root.classList.add("atlas-embed-root"),this.resolveDesign(null),this.applyTheme(),this.applyInteraction(),zs(this),await gs(this))return;let n=await os(this.client);if(n){this.appearance=n.appearance;let qs=(o=n.provider_scopes)!=null?o:{},$n=At=>{let Rt=qs[At];return Rt?this.mode==="sign-up"?Rt.sign_up:Rt.sign_in:!0};this.providers=ts((s=n.providers)!=null?s:[],n.appearance).filter($n),this.nativeProviders=((a=n.native_providers)!=null?a:[]).filter(At=>$n(At.provider)),this.passwordEnabled=(i=(l=n.strategies)==null?void 0:l.password)!=null?i:!0,this.passkeyEnabled=(d=(c=n.strategies)==null?void 0:c.passkey)!=null?d:!1,this.emailCodeEnabled=(f=(u=n.strategies)==null?void 0:u.emailCode)!=null?f:!1,this.emailLinkEnabled=(m=(p=n.strategies)==null?void 0:p.emailLink)!=null?m:!1,this.passwordResetEnabled=(y=(b=n.email_delivery)==null?void 0:b.password_reset)!=null?y:!0,this.emailDeliveryAvailable=(E=(A=n.email_delivery)==null?void 0:A.available)!=null?E:!0,this.passwordSignUpEnabled=(C=(v=n.email_delivery)==null?void 0:v.password_sign_up)!=null?C:!0,this.account=cn(n),this.signInWithAtlas=(x=n.sign_in_with_atlas)!=null?x:{enabled:!1},this.rememberMeEnabled=n.rememberMe===!0,this.trustedDeviceEnabled=n.rememberDevice===!0,this.captchaFlows=(k=n.captchaFlows)!=null?k:{},await Yt(this.client)&&(this.captchaFlows=uo(this.captchaFlows)),this.resolveDesign(jo(n)),this.applyTheme()}this.social=An(this.design?{...(w=this.appearance)==null?void 0:w.socialButtons,...this.design.socialButtons}:(S=this.appearance)==null?void 0:S.socialButtons,(T=this.options.appearance)==null?void 0:T.socialButtons),this.codeInputStyle=Vo((I=this.appearance)==null?void 0:I.codeInput,(X=this.options.appearance)==null?void 0:X.codeInput),this.interaction=_t(this.design?{...($=this.appearance)==null?void 0:$.interaction,...this.design.interaction}:(B=this.appearance)==null?void 0:B.interaction,(Mn=this.options.appearance)==null?void 0:Mn.interaction),this.applyInteraction(),this.signUpFields=(zn=(Un=this.appearance)==null?void 0:Un.signUpFields)!=null?zn:[];try{this.recorder=new Ye((Nn=this.root.ownerDocument)!=null?Nn:document)}catch{}P(this),Ls(this)}applyTheme(){var r,o,s,a,l,i;let t=(o=(r=this.design)==null?void 0:r.tokens)!=null?o:Jo(this.appearance,this.options.appearance),n=Zo(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",Xo(t.colorPrimary)),this.root.style.setProperty("--atlas-embed-color-focus-ring",(l=(a=(s=this.options.appearance)==null?void 0:s.variables)==null?void 0:a.colorFocusRing)!=null?l:Qo(t.colorPrimary,[t.colorCard,t.colorBackground])),this.design&&(this.appliedDesign=Ko((i=this.root.ownerDocument)!=null?i:document,this.root,this.design.render,this.appliedDesign))}resolveDesign(t){var o,s,a;let n=(s=(o=this.root.ownerDocument)==null?void 0:o.defaultView)!=null?s:typeof window!="undefined"?window:null,r=!1;try{r=!!((a=n==null?void 0:n.matchMedia)!=null&&a.call(n,"(prefers-color-scheme: dark)").matches)}catch{}this.design=is(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?Yo[t.motionSpeed]:0;this.root.style.setProperty("--atlas-embed-motion",`${n}ms`)}};var q={};function Ns(e){q=e}function $s(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 Bs(e,t){var p,m,b,y,A,E,v,C,x,k,w,S;let n=e.dataset,r=T=>{var I;return(I=e.getAttribute(T))!=null?I:void 0},o=(m=(p=n.atlasKey)!=null?p:r("publishable-key"))!=null?m:q.publishableKey,s=(y=(b=n.atlasFapi)!=null?b:r("frontend-api"))!=null?y:q.frontendApi,a=(E=(A=n.atlasRedirect)!=null?A:r("redirect"))!=null?E:q.redirect;if(!o||!s)return null;let l={publishableKey:o,frontendApi:s,mode:t};a&&(l.redirect=a);let i=(C=(v=n.atlasLocale)!=null?v:r("locale"))!=null?C:q.locale;i&&(l.locale=i);let c=(x=n.atlasPreset)!=null?x:r("preset");c&&(l.appearance={preset:c});let d=(k=n.atlasReferral)!=null?k:r("referral");(d==="off"||d==="false")&&(l.referral=!1);let u=(w=n.atlasReferralConsent)!=null?w:r("referral-consent");(u==="granted"||u==="denied")&&(l.referralConsent=u);let f=(S=n.atlasPasskeyPrf)!=null?S:r("passkey-prf");return f&&(l.passkeyPrf={eval:{first:f}}),l}function Ws(e,t={}){var o,s,a,l,i;let n=(o=t.publishableKey)!=null?o:q.publishableKey,r=(s=t.frontendApi)!=null?s:q.frontendApi;return!n||!r?null:{...t,publishableKey:n,frontendApi:r,redirect:(a=t.redirect)!=null?a:q.redirect,...((l=t.locale)!=null?l:q.locale)?{locale:(i=t.locale)!=null?i:q.locale}:{},mode:e}}var Et=class extends HTMLElement{constructor(){super(...arguments);h(this,"widget",null)}connectedCallback(){if(this.widget)return;let n=Bs(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 Se(this,n),this.widget.mount()}},Ln=class extends Et{constructor(){super(...arguments);h(this,"mode","sign-in")}},Dn=class extends Et{constructor(){super(...arguments);h(this,"mode","sign-up")}};function Fn(){typeof customElements!="undefined"&&(customElements.get("atlas-sign-in")||customElements.define("atlas-sign-in",Ln),customElements.get("atlas-sign-up")||customElements.define("atlas-sign-up",Dn))}function bl(e){let t=typeof e=="string"?document.querySelector(e):e;return t instanceof HTMLElement?t:null}function Hs(e,t,n){let r=bl(t);if(!r)return null;let o=Ws(e,n);if(!o)return r.textContent="Atlas: a publishable key and a frontend API origin are required to mount the widget.",null;let s=new Se(r,o);return s.mount(),s}function js(e,t={}){return Hs("sign-in",e,t)}function Ks(e,t={}){return Hs("sign-up",e,t)}function yl(){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 kl(){Ns($s(yl())),Fn(),window.Atlas={mountSignIn:js,mountSignUp:Ks,defineElements:Fn}}kl();})();
|
|
410
|
+
`;function Ni(e=document){var n;if(e.querySelector(`style[data-${zi}]`))return;let t=e.createElement("style");t.setAttribute(`data-${zi}`,""),t.textContent=Jl,((n=e.head)!=null?n:e.documentElement).appendChild(t)}function $i(e,t,n={}){var u;let r=ki({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:xi});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:Mn(r.typography.font)};for(let[f,p]of Object.entries((u=t==null?void 0:t.variables)!=null?u:{}))p!==void 0&&(s[f]=p);let l=r.elevation.cardShadow==="xl"?"lg":r.elevation.cardShadow,a={buttonStyle:r.buttons.style==="gradient"?"solid":r.buttons.style,shadow:r.card.style==="outline"||r.card.style==="none"?"none":l,density:r.spacing.density==="compact"?"compact":"comfortable",inputStyle:r.inputs.style},d=r.buttons.socialLayout==="icons"?{variant:"icon",layout:"grid"}:{layout:r.buttons.socialLayout==="grid"?"grid":"list"},c=bi(JSON.stringify(r));return{render:{style:{},attributes:{...jn(r),"data-atlas-design":c},css:"",key:c,fontStylesheets:vi(r,n.frontendApi)},tokens:s,interaction:a,socialButtons:d,resolved:r}}var Bi=new Set(["bluesky"]),Hi='<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>',Wi='<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 I(e){var t;return(t=e.root.ownerDocument)!=null?t:document}function h(e,t,n,r){let o=I(e).createElement(t);return n&&(o.className=n),r!=null&&(o.textContent=r),(o.classList.contains("atlas-embed-button")||o.classList.contains("atlas-embed-social-button"))&&Zl(e,o),o}function R(e,t,n){return Li(t,n,e.options.appearance)}function Zl(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=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 Ae(e,t){let n=h(e,"button",R(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=h(e,"span","atlas-embed-btn-spinner");r.setAttribute("aria-hidden","true"),n.appendChild(r)}else n.textContent=t;return n}function ji(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 qe(e,t,n=!1){var l,a,d;let r=e.captchaFlows[t];if(!(n?!!r&&ze(r.provider,r):we(r))||!r)return null;let i=(l=e.root.ownerDocument)!=null?l:document,s=i.createElement("div");s.className="atlas-embed-captcha",((d=(a=e.root.parentElement)!=null?a:i.body)!=null?d:i.documentElement).appendChild(s);try{return await Cn(r,s,{atlas:{labels:xn(e.options.localization)}})}catch{return null}finally{s.remove()}}var Vn=new WeakMap;async function Xl(e){let t=Vn.get(e);if(t){let o=await t;return o?{...o,owner:!1}:null}let n=yr({win:e}).catch(()=>null);Vn.set(e,n),n.finally(()=>Vn.delete(e));let r=await n;return r?{...r,owner:!0}:null}async function Vi(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 Xl(t);if(n!=null&&n.delivered)return Pe(e,"Signed in. You can close this window."),!0;if(n!=null&&n.owner){let s=vr(n.payload);if(s!=null&&s.ticket&&s.attemptId)return await Ki(e,t,s.attemptId,s.ticket),!0;if(s!=null&&s.continuationUrl)return t.location.replace(s.continuationUrl),!0}let r=_r(t.location.search);return r?r.ticket?(await Ki(e,t,r.attemptId,r.ticket,()=>qi(e,t)),!0):(r.status&&(e.state=nt({id:r.attemptId,status:r.status,...r.policyToken?{policyToken:r.policyToken}:{}}),qi(e,t)),!1):!1}async function Ki(e,t,n,r,o){let i=await ce(e,n,r);o==null||o(),!(i&&await br({win:t}).catch(()=>!1))&&await V(e,n)}function qi(e,t){try{t.history.replaceState({},t.document.title,Ye(t.location.href))}catch{}}async function ce(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 V(e,t){var o,i;let n=(i=(o=e.root.ownerDocument)==null?void 0:o.defaultView)!=null?i:typeof window!="undefined"?window:null,r=ji(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){Pe(e,"Sign-in works \u2014 this is a preview, so no session was created.");return}if(r&&n){n.location.assign(r);return}Pe(e,"You are signed in.")}function Ve(e,t){lo({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 he(e,t,n){var l,a,d,c,u;if(e.busy)return;if((l=e.conditionalAbort)==null||l.abort(),e.flash=null,typeof t.identifier=="string"&&t.identifier.trim()&&(e.enteredIdentifier=t.identifier.trim()),e.busy=!0,Ve(e,(a=e.state.attempt)==null?void 0:a.id),P(e),e.state=await Me(e.client,e.state,t),e.state.attempt&&$(e.state.attempt).kind==="collect_captcha"){let f=await qe(e,"signIn",!0);f&&(e.state=await Me(e.client,e.state,{identifier:(c=(d=e.enteredIdentifier)!=null?d:t.identifier)!=null?c:"",captcha_token:f}))}let r=e.state.attempt?$(e.state.attempt):null;n&&(r==null?void 0:r.kind)==="collect_first_factor"&&e.state.errors.length===0?r.strategies.includes(n)?await Rt(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 Me(e.client,e.state,{password:t.password})),e.busy=!1;let o=e.state.attempt?$(e.state.attempt):null;e.mode==="sign-in"&&e.passwordEnabled&&(o==null?void 0:o.kind)==="collect_first_factor"&&!e.state.prepared&&(e.state={...B,errors:e.state.errors});let i=e.state.attempt?$(e.state.attempt):null;if((i==null?void 0:i.kind)==="collect_first_factor"&&!e.state.prepared&&e.state.errors.length===0){let f=Ge(e.emailDeliveryAvailable?i.strategies:i.strategies.filter(p=>p!=="email_code"&&p!=="email_link")).autoSend;f&&await Rt(e,f,!1)}let s=e.state.attempt;if(Te(e.state)){P(e);return}if((s==null?void 0:s.status)==="complete"){let f=(u=s.id)!=null?u:null;e.state.ticket&&f&&await ce(e,f,e.state.ticket),await V(e,f);return}P(e)}async function Gi(e){var n,r;if(e.busy||!Te(e.state))return;e.state=Wr(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 ce(e,t,e.state.ticket)}finally{e.busy=!1}await V(e,t)}async function Rt(e,t,n=!0){var i;if(n){if(e.busy)return;e.busy=!0,P(e)}let r=(i=e.state.prepared)!=null?i:null,o=await bo(e.client,e.state,t);e.state=o.errors.length>0?{...o,prepared:r}:o,t==="email_link"&&o.errors.length===0&&Ji(e),n&&(e.busy=!1,P(e))}async function Yi(e){e.busy||(e.busy=!0,P(e),e.state=await yo(e.client,e.state),e.busy=!1,e.flash=e.state.errors.length===0?"We sent you a new email.":null,P(e))}function Ji(e){e.linkPoll&&clearInterval(e.linkPoll),e.linkPoll=setInterval(()=>{(async()=>{var i,s;if(!fn(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 ko(e.client,e.state);if(e.state=n,!r&&n.attempt&&n.attempt.status!==t&&P(e),!r||!n.attempt)return;e.linkPoll&&clearInterval(e.linkPoll),e.linkPoll=null;let o=(s=n.attempt.id)!=null?s:null;o&&await ce(e,o,r),await V(e,o)})()},2e3)}async function Tt(e,t,n){var l,a,d;Ve(e);let r=(a=(l=e.root.ownerDocument)==null?void 0:l.defaultView)!=null?a:typeof window!="undefined"?window:null,o=r?Ye(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=(d=i.data)==null?void 0:d.authorization_url;s&&r?r.location.assign(s):(e.handlePrompt=null,ee(e,i.errors))}async function Gn(e,t,n={}){var l,a,d;Ve(e);let r=(a=(l=e.root.ownerDocument)==null?void 0:l.defaultView)!=null?a:typeof window!="undefined"?window:null,o=r?Ye(r.location.href):e.options.frontendApi;if(n.popup&&r){await ec(e,t,r,o);return}let i=await e.client.post("/v1/client/sign_ins/sso",{connection_id:t,redirect_url:o}),s=(d=i.data)==null?void 0:d.authorization_url;s&&r?r.location.assign(s):ee(e,i.errors)}function Ql(e){let t=e.options.frontendApi;try{return new URL(/^https?:\/\//.test(t)?t:`https://${t}`).origin}catch{return t}}async function ec(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 Gn(e,t);return}let i=r.includes("?")?"&":"?",s=`${r}${i}__atlas_display=popup`,l=Ql(e),a=f=>{if(f.origin!==l)return;let p=f.data;if(!(!p||p.type!=="atlas-sso")){n.removeEventListener("message",a);try{o.close()}catch{}if(p.error){ee(e,[{code:"sso_popup_cancelled",message:"Sign-in was cancelled."}]);return}if(p.status==="complete"&&p.ticket&&p.attempt_id){let g=p.attempt_id,y=p.ticket;(async()=>(await ce(e,g,y),await V(e,g)))();return}p.attempt_id&&p.status&&(e.state=nt({id:p.attempt_id,status:p.status,...typeof p.policy_token=="string"?{policyToken:p.policy_token}:{}}),P(e))}};n.addEventListener("message",a);let d=await e.client.post("/v1/client/sign_ins/sso",{connection_id:t,redirect_url:s}),c=(u=d.data)==null?void 0:u.authorization_url;if(c)try{o.location.assign(c)}catch{try{o.close()}catch{}n.removeEventListener("message",a),n.location.assign(c)}else{n.removeEventListener("message",a);try{o.close()}catch{}ee(e,d.errors)}}async function Zi(e,t,n){let r=await e.client.post("/v1/client/sign_ins/id_token",Eo({provider:t,idToken:n})),o=Ao(r.data);if(!o){ee(e,r.errors);return}if(o.status==="complete"&&o.ticket){await ce(e,o.attemptId,o.ticket),await V(e,o.attemptId);return}let i=r.data,s=nt({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,P(e)}function Xi(e){e.resetFlow={...Ne},P(e)}async function Yn(e,t){var r,o,i;if(e.busy||!e.resetFlow)return;if(e.busy=!0,Ve(e),P(e),Se(e.resetFlow)==="request"){typeof t.email=="string"&&t.email.trim()&&(e.enteredIdentifier=t.email.trim());let s=await qe(e,"passwordReset");e.resetFlow=await No(e.client,(r=t.email)!=null?r:"",s!=null?s:void 0),(o=e.resetFlow.attempt)!=null&&o.poll_secret&&tc(e)}else e.resetFlow=await $o(e.client,e.resetFlow,{code:t.code,password:t.password});e.busy=!1;let n=e.resetFlow;if(((i=n==null?void 0:n.attempt)==null?void 0:i.status)==="complete"){let s=n.attempt.id;e.resetFlow=null,n.ticket?(await ce(e,s,n.ticket),await V(e,s)):(e.flash="Password updated. Sign in with your new password.",e.state=B,P(e));return}P(e)}function tc(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;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 Bo(e.client,o);e.resetFlow!==o||((s=i.attempt)==null?void 0:s.status)==="needs_email_verification"||(e.linkPoll&&clearInterval(e.linkPoll),e.linkPoll=null,e.resetFlow=i,P(e))})()},2e3)}async function Jn(e,t,n=!0){var d;if(e.busy)return;e.busy=!0,Ve(e),P(e);let{identifier:r,password:o,...i}=t,s={};for(let[c,u]of Object.entries(i))u&&(s[c]=u);let l=await qe(e,"signUp");e.state=await pn(e.client,{email:r!=null?r:"",password:o!=null?o:"",fields:s,consent:n,captchaToken:l!=null?l:void 0,policyAcceptances:e.policies.build()}),e.busy=!1,await Qi(e);let a=e.state.attempt;if((a==null?void 0:a.status)==="complete"){let c=(d=a.id)!=null?d:null;e.state.ticket&&c&&await ce(e,c,e.state.ticket),await V(e,c);return}fn(e.state)&&Ji(e),P(e)}var nc={"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"};function F(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=nc[t])!=null?s:t).replace(/\{(\w+)\}/g,(l,a)=>{var d;return(d=n[a])!=null?d:l})}function es(e){var n;let t=(n=e.state.attempt)==null?void 0:n.id;return t?(e.enrollment||(e.enrollment=Nr(e.client,()=>Wt(e.account)),e.enrollment.subscribe(()=>queueMicrotask(()=>P(e)))),e.enrollment.start(t),e.enrollment):null}function ts(e,t,n,r){var a;let o=es(e);if(!o)return r;let i=o.state,s=(d,c)=>{let u=h(e,"button","atlas-embed-step-back",F(e,d==="totp"?"mfa.enrollTotpOption":"mfa.enrollSmsOption"));u.type="button",u.setAttribute("data-atlas-mfa-method",d),u.disabled=e.busy||i.busy,u.addEventListener("click",()=>void o.choose(d)),Array.isArray(c)?c.push(u):c.appendChild(u)};if(i.method===null){t.appendChild(h(e,"p","atlas-embed-note",F(e,"mfa.enrollChoose")));for(let d of i.options)s(d,t)}else if(i.method==="totp"){let d=i.enrollment;if(d){if(t.appendChild(h(e,"p","atlas-embed-note",F(e,"mfa.enrollScan"))),d.qrCode){let c=I(e).createElement("img");c.className="atlas-embed-mfa-qr",c.setAttribute("data-atlas","mfa-qr"),c.src=d.qrCode,c.alt=F(e,"mfa.enrollQrAlt"),c.width=180,c.height=180,t.appendChild(c)}if(d.secret){let c=h(e,"p","atlas-embed-note",`${F(e,"mfa.enrollSetupKey")}: `);c.setAttribute("data-atlas","mfa-setup-key"),c.appendChild(h(e,"code","atlas-embed-mfa-key",zr(d.secret))),t.appendChild(c)}n.addCodeField("code",F(e,"mfa.enrollFirstCodeLabel"),!0),i.totpCodes>=2&&n.addCodeField("secondCode",F(e,"mfa.enrollSecondCodeLabel"),!1)}else{let c=h(e,"p","atlas-embed-note",i.busy?F(e,"mfa.enrollPreparing"):"");c.setAttribute("aria-live","polite"),t.appendChild(c)}}else if(!i.enrollment)n.addField("phone",F(e,"mfa.phoneLabel"),"tel","tel"),t.appendChild(h(e,"p","atlas-embed-note",F(e,"mfa.phoneHint")));else{let d=h(e,"p","atlas-embed-note",F(e,"mfa.codeTextedTo",{phone:(a=i.enrollment.phone)!=null?a:""}));d.setAttribute("data-atlas","mfa-code-texted"),t.appendChild(d),n.addCodeField("code",F(e,"mfa.codeLabel"),!0);let c=h(e,"button","atlas-embed-step-back",F(e,"signIn.resendCode"));c.type="button",c.setAttribute("data-atlas-resend",""),c.disabled=e.busy||i.busy,c.addEventListener("click",()=>void o.resend()),n.trailing.push(c)}for(let d of i.errors){let c=h(e,"p","atlas-embed-error",e.errorText(d));c.setAttribute("role","alert"),t.appendChild(c)}if(i.method!==null&&i.options.length>1)for(let d of i.options.filter(c=>c!==i.method))s(d,n.trailing);let l=$r(i);return l===null?null:l==="mfa.sendCode"?F(e,"mfa.sendCode"):r}async function ns(e,t){let n=es(e);if(!n)return;let r=await n.submit(t);r&&await he(e,r)}function rs(e,t){var s;let n=(s=e.state.attempt)==null?void 0:s.id;if(!n)return;let r=Wt(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 l of i){let a=l==="sms"?"sms-second-factor":"email-second-factor";if((o==null?void 0:o.strategy)===l&&o.sentTo!==void 0){let u=h(e,"p","atlas-embed-note",l==="sms"?F(e,"mfa.codeTextedTo",{phone:o.sentTo}):F(e,"signIn.codeSentTo",{email:o.sentTo}));u.setAttribute("data-atlas",`${a}-sent`),u.setAttribute("aria-live","polite"),t.push(u);continue}let d=(o==null?void 0:o.strategy)===l&&o.busy===!0,c=h(e,"button","atlas-embed-step-back",d?F(e,"signIn.sending"):F(e,l==="sms"?"mfa.smsCodeOption":"signIn.emailCodeOption"));if(c.type="button",c.setAttribute("data-atlas",a),c.disabled=e.busy||d,c.addEventListener("click",()=>{e.secondFactorCode={attemptId:n,strategy:l,busy:!0},P(e),Br(e.client,n,l).then(({sentTo:u})=>{e.secondFactorCode={attemptId:n,strategy:l,sentTo:u},P(e)},u=>{e.secondFactorCode={attemptId:n,strategy:l,error:u instanceof Error?u.message:String(u)},P(e)})}),t.push(c),(o==null?void 0:o.strategy)===l&&o.error){let u=h(e,"p","atlas-embed-error",o.error);u.setAttribute("role","alert"),t.push(u)}}}function os(e,t){var s,l;let n=h(e,"div","atlas-embed-recovery-codes");n.setAttribute("data-atlas","recovery-codes"),n.appendChild(h(e,"h2",R(e,"title","atlas-embed-title"),F(e,"mfa.recoveryCodesTitle"))),n.appendChild(h(e,"p","atlas-embed-note",F(e,"mfa.recoveryCodesHelp")));let r=h(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 a of t){let d=h(e,"li");d.appendChild(h(e,"code","atlas-embed-mfa-key",a)),r.appendChild(d)}n.appendChild(r);let o=((s=I(e).defaultView)!=null?s:globalThis).navigator;if((l=o==null?void 0:o.clipboard)!=null&&l.writeText){let a=h(e,"button","atlas-embed-step-back",F(e,"mfa.recoveryCodesCopy"));a.type="button",a.setAttribute("data-atlas","recovery-codes-copy"),a.addEventListener("click",()=>{jr(t).then(d=>{if(!d||n.querySelector('[data-atlas="recovery-codes-copied"]'))return;let c=h(e,"p","atlas-embed-note",F(e,"mfa.recoveryCodesCopied"));c.setAttribute("data-atlas","recovery-codes-copied"),c.setAttribute("aria-live","polite"),n.insertBefore(c,i)})}),n.appendChild(a)}if(jt()){let a=h(e,"button","atlas-embed-step-back",F(e,"mfa.recoveryCodesDownload"));a.type="button",a.setAttribute("data-atlas","recovery-codes-download"),a.addEventListener("click",()=>Kr(t)),n.appendChild(a)}let i=h(e,"button",R(e,"buttonPrimary","atlas-embed-button"),F(e,"mfa.recoveryCodesSaved"));return i.type="button",i.setAttribute("data-atlas","recovery-codes-saved"),i.disabled=e.busy,i.addEventListener("click",()=>{i.disabled=!0,Gi(e)}),n.appendChild(i),n}function It(e){return go((t,n)=>F(e,t,n!=null?n:{}))}async function is(e){e.mode==="sign-up"&&(yn(I(e)),e.policies.setPolicies(await Fe(e.client)))}function Zn(e){return{link:"atlas-embed-consent-link",text:"atlas-embed-consent-text"}}function ss(e){for(let t of e.policyDispose.splice(0))t()}function as(e,t){let n=e.policies;if(n.policies.length===0)return null;let r=It(e),o=I(e),i=h(e,"div"),s=h(e,"p");return e.policyDispose.push(bn(i,n,{t:r,document:o,classes:Zn(e)}).destroy),e.policyDispose.push(kn(s,n,{t:r,document:o,classes:Zn(e)}).destroy),e.policyDispose.push(n.subscribe(t)),{consent:i,clickwrap:s,canSubmit:()=>n.canSubmit(),async read(){return n.pendingScroll()?vn(n,{t:r,document:o,container:e.root}):!0}}}async function Qi(e){cn(e.state.errors)&&e.policies.setPolicies(await Fe(e.client))}function ls(e){var a;let t=It(e),n=I(e),r=h(e,"div","atlas-embed-policies");yn(n);let o=e.state.attempt,i=(a=o==null?void 0:o.id)!=null?a:null;(!e.pendingPolicies||e.pendingPolicies.attemptId!==i)&&(e.pendingPolicies={attemptId:i,controller:null},mo(e.client,o,{}).then(d=>{var c;((c=e.pendingPolicies)==null?void 0:c.attemptId)===i&&(e.pendingPolicies={attemptId:i,controller:d},P(e))}));let s=e.pendingPolicies.attemptId===i?e.pendingPolicies.controller:null;if(!s)return r.appendChild(h(e,"p","atlas-embed-note",t("policy.loading"))),r;let l=wo(r,s,{t,document:n,container:e.root,classes:Zn(e),onSubmit:d=>{e.pendingPolicies=null,he(e,{policy_acceptances:JSON.stringify(d)})},onDecline:d=>{e.pendingPolicies=null,e.state={attempt:null,errors:[{code:"POLICY_DECLINED",message:t("policy.declined",{policy:d.title})}],busy:!1,pollSecret:null,ticket:null},P(e)}});return l.setBusy(e.busy),e.policyDispose.push(l.destroy),r}function cs(e){var p;let t=e.resetFlow,n=Se(t),r=h(e,"div","atlas-embed-reset");r.appendChild(h(e,"h1",R(e,"title","atlas-embed-title"),"Reset your password"));let o=I(e).createElement("form"),i=t.errors,s=new Map,l=i.find(g=>!g.param);l&&o.appendChild(h(e,"div","atlas-embed-form-error",e.errorText(l)));let a=null,d="Continue",c=!0,u=e.account.passwordReset;switch(n){case"request":a=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.",d=u==="link"?"Send reset link":"Send reset code",Ot(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"){c=!1,a="Check your email";let g=h(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 y=h(e,"button","atlas-embed-step-back","Send another link");y.type="button",y.setAttribute("data-atlas-resend",""),y.disabled=e.busy,y.addEventListener("click",()=>{var m;e.resetFlow={...Ne},Yn(e,{email:(m=e.enteredIdentifier)!=null?m:""})}),o.appendChild(y);break}a=e.enteredIdentifier?`Enter the code we sent to ${e.enteredIdentifier}`:"Enter the code we sent to your email",Xn(e,o,s,i,"code","Reset code",!0);break;case"collect_second_factor":a="Enter the code from your authenticator app",Xn(e,o,s,i,"code","Two-factor code",!0);break;case"collect_new_password":a="Choose a new password",d="Set new password",Ot(e,o,s,i,"password","New password","password","new-password"),(p=s.get("password"))==null||p.setAttribute("data-atlas-autofocus","");break;default:c=!1,o.appendChild(h(e,"p","atlas-embed-note","You\u2019re all set."))}a&&r.appendChild(h(e,"p",R(e,"subtitle","atlas-embed-subtitle"),a)),r.appendChild(o),c&&o.appendChild(Ae(e,d));let f=h(e,"button","atlas-embed-step-back","Back to sign in");return f.type="button",f.addEventListener("click",()=>{e.resetFlow=null,P(e)}),o.appendChild(f),o.addEventListener("submit",g=>{g.preventDefault();let y={};for(let[m,C]of s)y[m]=C.value;Yn(e,y)}),r}function Ot(e,t,n,r,o,i,s,l){let a=h(e,"label",R(e,"field","atlas-embed-field"));a.appendChild(h(e,"span",R(e,"label","atlas-embed-label"),i));let d=I(e).createElement("input");if(d.className=R(e,"input","atlas-embed-input"),d.type=s,d.name=o,d.setAttribute("autocomplete",l),s==="password"){let c=h(e,"div","atlas-embed-password");c.appendChild(d);let u=h(e,"button","atlas-embed-password-toggle","Show");u.type="button",u.setAttribute("aria-label","Show password"),u.addEventListener("click",f=>{f.preventDefault();let p=d.type==="password";d.type=p?"text":"password",u.textContent=p?"Hide":"Show",u.setAttribute("aria-label",p?"Hide password":"Show password")}),c.appendChild(u),a.appendChild(c)}else a.appendChild(d);for(let c of r.filter(u=>u.param===o))a.appendChild(h(e,"span",R(e,"error","atlas-embed-error"),e.errorText(c)));n.set(o,d),t.appendChild(a)}function Xn(e,t,n,r,o,i,s){var g;if(e.codeInputStyle==="single"){Ot(e,t,n,r,o,i,"text","one-time-code"),s&&((g=n.get(o))==null||g.setAttribute("data-atlas-autofocus",""));return}let a=h(e,"div",R(e,"field","atlas-embed-field"));a.appendChild(h(e,"span",R(e,"label","atlas-embed-label"),i));let d=h(e,"div","atlas-embed-code");d.setAttribute("role","group"),d.setAttribute("aria-label",i);let c=I(e).createElement("input");c.type="hidden",c.name=o,n.set(o,c);let u=[],f=()=>{c.value=u.map(y=>y.value).join("")},p=()=>{c.value.length!==6||e.busy||t.dispatchEvent(new Event("submit",{cancelable:!0,bubbles:!0}))};for(let y=0;y<6;y++){let m=I(e).createElement("input");m.className="atlas-embed-code-box",m.type="text",m.setAttribute("inputmode","numeric"),m.setAttribute("autocomplete",y===0?"one-time-code":"off"),m.setAttribute("aria-label",`${i} digit ${y+1}`),m.maxLength=1,s&&y===0&&m.setAttribute("data-atlas-autofocus",""),m.addEventListener("input",()=>{m.value=m.value.replace(/\D/g,"").slice(0,1),f(),m.value&&y<5&&u[y+1].focus(),p()}),m.addEventListener("keydown",C=>{C.key==="Backspace"&&!m.value&&y>0&&u[y-1].focus()}),m.addEventListener("paste",C=>{var A,x,b;C.preventDefault();let E=((x=(A=C.clipboardData)==null?void 0:A.getData("text"))!=null?x:"").replace(/\D/g,"").slice(0,6);for(let v=0;v<6;v++)u[v].value=(b=E[v])!=null?b:"";f(),u[Math.min(E.length,5)].focus(),p()}),u.push(m),d.appendChild(m)}a.appendChild(d),a.appendChild(c);for(let y of r.filter(m=>m.param===o))a.appendChild(h(e,"span",R(e,"error","atlas-embed-error"),e.errorText(y)));t.appendChild(a)}function ds(e,t){var f,p,g,y,m,C,E,A,x;let n=I(e).createElement("form"),r=e.state.errors.find(b=>!b.param);r&&n.appendChild(h(e,"div","atlas-embed-form-error",e.errorText(r)));let o=new Map,i=e.state.errors,s=(b,v,S,w)=>Ot(e,n,o,i,b,v,S,w),l=(b,v,S)=>Xn(e,n,o,i,b,v,S),a=!0,d=me[e.mode].submit,c=[];switch(t){case"collect_identifier":if(s("identifier","Email address","email",e.passkeyEnabled&&xe()?"username webauthn":"username"),e.enteredIdentifier&&(o.get("identifier").value=e.enteredIdentifier),e.mode==="sign-in"&&e.passwordEnabled){s("password","Password","password","current-password");let b=[];e.emailDeliveryAvailable&&e.emailCodeEnabled?b.push("email_code"):e.emailDeliveryAvailable&&e.emailLinkEnabled&&b.push("email_link");for(let v of b){let S=h(e,"button","atlas-embed-step-back",v==="email_code"?"Email me a code instead":"Email me a sign-in link instead");S.type="button",S.setAttribute("data-strategy",v),S.disabled=e.busy,S.addEventListener("click",()=>{var T;let w=o.get("identifier");if(!w.value.trim()){(T=w.reportValidity)==null||T.call(w),w.focus();return}he(e,{identifier:w.value},v)}),c.push(S)}}if(e.mode==="sign-in"&&e.rememberMeEnabled){let b=h(e,"label","atlas-embed-remember"),v=I(e).createElement("input");v.type="checkbox",v.className="atlas-embed-remember-check",v.checked=e.remember,v.addEventListener("change",()=>{e.remember=v.checked}),b.appendChild(v),b.appendChild(h(e,"span","atlas-embed-remember-text","Remember me")),n.appendChild(b)}break;case"collect_first_factor":{let b=e.state.attempt?(f=$(e.state.attempt).strategies)!=null?f:[]:[],v=Ge(e.emailDeliveryAvailable?b:b.filter(L=>L!=="email_code"&&L!=="email_link")),S=(p=e.state.prepared)!=null?p:null,w=(m=(y=e.enteredIdentifier)!=null?y:(g=e.state.attempt)==null?void 0:g.identifier)!=null?m:"",T=(L,te,H)=>{let j=h(e,"button","atlas-embed-step-back",te);return j.type="button",j.setAttribute(H,H==="data-strategy"?L:""),j.disabled=e.busy,j.addEventListener("click",()=>void Rt(e,L)),j};if(S==="email_code"){let L=h(e,"p","atlas-embed-note",w?`We sent a code to ${w}. Enter it below.`:"We sent you a code. Enter it below.");L.setAttribute("data-atlas-code-sent",""),n.appendChild(L),l("code","Verification code",!0),c.push(T("email_code","Resend code","data-atlas-resend"))}else if(S==="email_link"){a=!1;let L=h(e,"p","atlas-embed-note",w?`We sent a sign-in link to ${w}. Open it on any device to continue.`:"Check your email for a sign-in link.");L.setAttribute("data-atlas-link-sent",""),n.appendChild(L),c.push(T("email_link","Resend link","data-atlas-resend"))}else if(!v.password&&v.email.length>0){a=!1;for(let L of v.email)c.push(T(L,L==="email_code"?"Email me a code":"Email me a sign-in link","data-strategy"))}else{s("password","Password","password","current-password");for(let L of v.email)c.push(T(L,L==="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"):l("code","Two-factor code",!0),e.trustedDeviceEnabled){let b=h(e,"label","atlas-embed-remember"),v=I(e).createElement("input");v.type="checkbox",v.className="atlas-embed-remember-check",v.checked=e.rememberDevice,v.addEventListener("change",()=>{e.rememberDevice=v.checked}),b.appendChild(v),b.appendChild(h(e,"span","atlas-embed-remember-text","Remember this device")),n.appendChild(b)}rs(e,c);break;case"collect_email_code":{let b=rt(e.state.attempt,e.account.emailVerification);if(b){a=!1;let v=(A=(E=e.enteredIdentifier)!=null?E:(C=e.state.attempt)==null?void 0:C.identifier)!=null?A:"",S=h(e,"p","atlas-embed-note",v?`We sent a confirmation link to ${v}. 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.");S.setAttribute("data-atlas-link-sent",""),n.appendChild(S)}else l("code","Verification code",!0);if(((x=e.state.attempt)==null?void 0:x.object)==="sign_up_attempt"){let v=h(e,"button","atlas-embed-step-back",b?"Resend link":"Resend code");v.type="button",v.setAttribute("data-atlas-resend",""),v.disabled=e.busy,v.addEventListener("click",()=>void Yi(e)),c.push(v)}break}case"collect_new_password":s("password","New password","password","new-password");break;case"enroll_second_factor":{let b=ts(e,n,{addField:s,addCodeField:l,trailing:c},d);b===null?a=!1:d=b;break}default:a=!1,n.appendChild(h(e,"p","atlas-embed-note","Please continue in your application."))}a&&n.appendChild(Ae(e,d));for(let b of c)n.appendChild(b);if(t==="collect_second_factor"){let b=h(e,"button","atlas-embed-step-back",e.backupCodeMode?"Use your authenticator app":"Use a backup code instead");b.type="button",b.addEventListener("click",()=>{e.backupCodeMode=!e.backupCodeMode,P(e)}),n.appendChild(b)}if((t==="collect_identifier"&&e.mode==="sign-in"&&e.passwordEnabled||t==="collect_first_factor"&&o.has("password"))&&e.passwordResetEnabled){let b=h(e,"button","atlas-embed-step-back","Forgot password?");b.type="button",b.addEventListener("click",()=>Xi(e)),n.appendChild(b)}return n.addEventListener("submit",b=>{b.preventDefault();let v={};for(let[S,w]of o)v[S]=w.value;if(t==="collect_second_factor"&&e.trustedDeviceEnabled&&e.rememberDevice&&(v.remember_device="true"),t==="enroll_second_factor"){ns(e,v);return}he(e,v)}),n}function rc(e){var a;let t=(a=e.appearance)==null?void 0:a.legal;if(!t||!t.termsUrl&&!t.privacyUrl)return null;let n=I(e),r=h(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=h(e,"span","atlas-embed-consent-text"),s=(d,c)=>{let u=n.createElement("a");return u.href=d,u.textContent=c,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 l=[];return t.termsUrl&&l.push(s(t.termsUrl,"Terms of Service")),t.privacyUrl&&l.push(s(t.privacyUrl,"Privacy Policy")),l.forEach((d,c)=>{c>0&&i.appendChild(n.createTextNode(" and ")),i.appendChild(d)}),i.appendChild(n.createTextNode(".")),r.appendChild(i),{row:r,checkbox:o}}function us(e){var d;let t=I(e).createElement("form");if(!e.passwordSignUpEnabled)return t.appendChild(h(e,"div","atlas-embed-form-error",Wo)),t;let n=e.state.errors.find(c=>!c.param);n&&t.appendChild(h(e,"div","atlas-embed-form-error",e.errorText(n)));let r=new Map,o=(c,u,f)=>{var C,E,A;let p=(C=f.type)!=null?C:"text",g=p==="radio"||p==="multiselect",y=h(e,g?"fieldset":"label",R(e,"field","atlas-embed-field"));y.appendChild(h(e,g?"legend":"span",R(e,"label","atlas-embed-label"),f.required?u:`${u} (optional)`));let m=I(e);if(p==="select"){let x=m.createElement("select");x.className=R(e,"input","atlas-embed-input"),x.name=c;let b=m.createElement("option");b.value="",b.textContent=f.placeholder||"Select\u2026",x.appendChild(b);for(let v of(E=f.options)!=null?E:[]){let S=m.createElement("option");S.value=v,S.textContent=v,x.appendChild(S)}y.appendChild(x),r.set(c,()=>x.value)}else if(p==="textarea"){let x=m.createElement("textarea");x.className=R(e,"input","atlas-embed-input"),x.name=c,x.rows=3,f.placeholder&&x.setAttribute("placeholder",f.placeholder),y.appendChild(x),r.set(c,()=>x.value)}else if(p==="checkbox"){let x=m.createElement("input");x.type="checkbox",x.name=c,x.className="atlas-embed-checkbox",y.classList.add("atlas-embed-field-checkbox"),y.appendChild(x),r.set(c,()=>x.checked?"true":"")}else if(p==="radio"||p==="multiselect"){let x=m.createElement("div");x.className="atlas-embed-choices";let b=[];for(let v of(A=f.options)!=null?A:[]){let S=m.createElement("label");S.className="atlas-embed-choice";let w=m.createElement("input");w.type=p==="radio"?"radio":"checkbox",w.name=c,w.value=v,b.push(w),S.appendChild(w),S.appendChild(h(e,"span",void 0,v)),x.appendChild(S)}y.appendChild(x),r.set(c,()=>{var v,S;return p==="radio"?(S=(v=b.find(w=>w.checked))==null?void 0:v.value)!=null?S:"":b.filter(w=>w.checked).map(w=>w.value).join(", ")})}else{let x=m.createElement("input");x.className=R(e,"input","atlas-embed-input"),x.type=p,x.name=c,f.autocomplete&&x.setAttribute("autocomplete",f.autocomplete),f.placeholder&&x.setAttribute("placeholder",f.placeholder),y.appendChild(x),r.set(c,()=>x.value)}for(let x of e.state.errors.filter(b=>b.param===c))y.appendChild(h(e,"span",R(e,"error","atlas-embed-error"),e.errorText(x)));t.appendChild(y)};for(let c of e.signUpFields)o(c.key,c.label,{type:c.type,required:c.required,placeholder:c.placeholder,options:c.options});o("identifier","Email address",{type:"email",required:!0,autocomplete:"email"}),o("password","Password",{type:"password",required:!0,autocomplete:"new-password"});let i,s=as(e,()=>{i&&(i.disabled=e.busy||!(s!=null&&s.canSubmit()))}),l=s?null:rc(e);l&&t.appendChild(l.row),s&&t.appendChild(s.consent),i=Ae(e,me[e.mode].submit);let a=()=>s?s.canSubmit():!(l!=null&&l.checkbox)||l.checkbox.checked;return i.disabled=e.busy||!a(),(d=l==null?void 0:l.checkbox)==null||d.addEventListener("change",()=>{i.disabled=e.busy||!a()}),t.appendChild(i),s&&t.appendChild(s.clickwrap),t.addEventListener("submit",c=>{c.preventDefault();let u={};for(let[f,p]of r)u[f]=p();if(!s){Jn(e,u,a());return}s.read().then(f=>{var g,y;if(f){Jn(e,u,!0);return}let p=(y=(g=e.policies.policies.find(m=>!e.policies.isChecked(m.key)))==null?void 0:g.title)!=null?y:"";e.state={...e.state,errors:[{code:"POLICY_DECLINED",message:It(e)("policy.declined",{policy:p})}]},P(e)})}),t}var oc={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"/>'},ic={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 ps(e){let t=oc[e];if(t)return`<svg viewBox="0 0 24 24" width="18" height="18" aria-hidden="true" focusable="false">${t}</svg>`;let n=ic[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 fs(e,t){return!t||!t.id||!t.status||t.status==="complete"?!1:(e.state={...e.state,attempt:t,errors:[]},P(e),!0)}function gs(e){let t=e.options.passkeyPrf;return t?{prf:t,onExtensionResults:n=>{var s,l,a,d,c;let r={credentialId:n.credentialId,enabled:!!((s=n.prf)!=null&&s.results)||((l=n.prf)==null?void 0:l.enabled)===!0,...(a=n.prf)!=null&&a.results?{results:n.prf.results}:{}},o=(d=e.root.ownerDocument)==null?void 0:d.defaultView,i=(c=o==null?void 0:o.CustomEvent)!=null?c:CustomEvent;e.root.dispatchEvent(new i("atlas:passkey-prf",{detail:r,bubbles:!1}))}}:{}}async function ms(e){var o,i,s;if(e.busy)return;(o=e.conditionalAbort)==null||o.abort(),e.busy=!0,P(e);let t=await En(e.client,{captcha:({retry:l})=>qe(e,"signIn",l)});if(!t.ok||!t.data){e.busy=!1,ee(e,t.errors);return}let n;try{n=await _n(t.data,gs(e))}catch{e.busy=!1,P(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 V(e,(s=r.data.created_session_id)!=null?s:null);return}r.ok&&fs(e,r.data)||ee(e,r.errors)}async function hs(e){var r,o,i;if(e.mode!=="sign-in"||!e.passkeyEnabled||!xe())return;let t=!1;try{t=await Lo()}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 En(e.client);if(!s.ok||!s.data||n.signal.aborted)return;let l=await _n(s.data,{mediation:"conditional",signal:n.signal,...gs(e)});if(n.signal.aborted)return;let a=await e.client.post("/v1/client/sign_ins/passkey/finish",l);a.ok&&((o=a.data)==null?void 0:o.status)==="complete"?await V(e,(i=a.data.created_session_id)!=null?i:null):a.ok&&fs(e,a.data)}catch{}}function ys(e){let t=h(e,"button",R(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",()=>{ms(e)}),t}function Qn(e){let t=[...e.providers];for(let n of e.nativeProviders)t.includes(n.provider)||t.push(n.provider);return t}var sc='<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 ac(e,t){var l;let{variant:n,labels:r}=e.social,o=(l=r.atlas)!=null?l:n==="block"?"Continue with Atlas":"Atlas",i=h(e,"button",R(e,"socialButton","atlas-embed-social-button"));i.type="button",i.setAttribute("data-atlas-provider","atlas"),i.setAttribute("data-variant",n);let s=I(e).createElement("span");if(s.className="atlas-embed-social-icon",s.innerHTML=sc,i.appendChild(s),n==="icon")i.setAttribute("aria-label","Continue with Atlas"),i.setAttribute("title","Atlas");else{let a=I(e).createElement("span");a.className="atlas-embed-social-label",a.textContent=o,i.appendChild(a)}return i.addEventListener("click",()=>{Gn(e,t,{popup:!0})}),i}function bs(e){let t=Qn(e),n=h(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(ac(e,e.signInWithAtlas.connection_id));for(let d of t){let c=e.nativeProviders.find(f=>f.provider===d),u=d==="google"&&(c!=null&&c.client_id)?dc(e,c.client_id):cc(e,d);u.getAttribute("data-atlas-provider")||u.setAttribute("data-atlas-provider",d),n.appendChild(u)}let r=e.social.layout==="carousel"?lc(e,n):n;if(!(e.social.search==="always"||e.social.search==="auto"&&t.length>Ai))return r;let i=h(e,"div","atlas-embed-social-field"),s=I(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 l=h(e,"div","atlas-embed-social-empty");l.textContent="No matching sign-in options.",l.setAttribute("hidden","");let a=Array.from(n.children);return s.addEventListener("input",()=>{var u;let d=s.value.trim().toLowerCase(),c=0;for(let f of a){let p=(u=f.getAttribute("data-atlas-provider"))!=null?u:"",g=d===""||Pt(p).toLowerCase().includes(d)||p.toLowerCase().includes(d);f.toggleAttribute("hidden",!g),g&&(c+=1)}l.toggleAttribute("hidden",c!==0),n.dispatchEvent(new Event("scroll"))}),i.appendChild(s),i.appendChild(r),i.appendChild(l),i}function lc(e,t){var d;let n=(d=I(e).defaultView)!=null?d:typeof window!="undefined"?window:null,r=h(e,"div","atlas-embed-carousel"),o=c=>{let u=h(e,"button","atlas-embed-carousel-nav");return u.type="button",u.setAttribute("data-dir",c),u.setAttribute("aria-label",c==="prev"?"Scroll to previous sign-in options":"Scroll to more sign-in options"),u.innerHTML=c==="prev"?Hi:Wi,u.addEventListener("click",()=>{let f=Math.max(t.clientWidth*.8,140);typeof t.scrollBy=="function"&&t.scrollBy({left:(c==="prev"?-1:1)*f,behavior:"smooth"})}),u},i=o("prev"),s=o("next"),l=()=>{let c=t.scrollWidth-t.clientWidth,u=c>2;r.setAttribute("data-overflow",u?"true":"false"),i.disabled=!u||t.scrollLeft<=1,s.disabled=!u||t.scrollLeft>=c-1};t.addEventListener("scroll",l,{passive:!0});let a=n&&n.ResizeObserver;return a?new a(l).observe(t):n&&n.addEventListener("resize",l),n!=null&&n.requestAnimationFrame&&n.requestAnimationFrame(l),l(),r.appendChild(i),r.appendChild(t),r.appendChild(s),r}function ks(e,t,n="button"){var d;let{variant:r,labels:o}=e.social,i=Pt(t),s=(d=o[t])!=null?d:r==="block"?`Continue with ${i}`:i,l=h(e,n,R(e,"socialButton","atlas-embed-social-button"));n==="button"&&(l.type="button"),l.setAttribute("data-atlas-provider",t),l.setAttribute("data-variant",r);let a=ps(t);if(a){let c=I(e).createElement("span");c.className="atlas-embed-social-icon",c.innerHTML=a,l.appendChild(c)}if(r==="icon")l.setAttribute("aria-label",`Continue with ${i}`),l.setAttribute("title",i);else{let c=I(e).createElement("span");c.className="atlas-embed-social-label",c.textContent=s,l.appendChild(c)}return l}function cc(e,t){let n=ks(e,t);return n.addEventListener("click",()=>{Bi.has(t)?(e.handlePrompt=t,P(e)):Tt(e,t)}),n}function vs(e,t){let n=Pt(t),r=I(e).createElement("form");r.className="atlas-embed-form",r.setAttribute("novalidate","true");for(let a of e.state.errors.filter(d=>!d.param))r.appendChild(h(e,"div","atlas-embed-form-error",e.errorText(a)));let o=h(e,"label",R(e,"field","atlas-embed-field"));o.appendChild(h(e,"span",R(e,"label","atlas-embed-label"),`${n} handle`));let i=I(e).createElement("input");i.className=R(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=Ae(e,me[e.mode].submit);r.appendChild(s);let l=h(e,"button","atlas-embed-handle-back","Back");return l.type="button",l.addEventListener("click",()=>{e.handlePrompt=null,e.state={...e.state,errors:[]},P(e)}),r.appendChild(l),r.addEventListener("submit",a=>{a.preventDefault();let d=i.value.trim();if(!d){e.state={...e.state,errors:[{code:"validation_error",message:`Enter your ${n} handle.`}]},P(e);return}Tt(e,t,d)}),r}function dc(e,t){let n=ks(e,"google","div");return n.setAttribute("role","button"),n.setAttribute("tabindex","0"),Po({wrapper:n,clientId:t,onCredential:r=>void Zi(e,"google",r),onError:()=>Pe(e,"Google sign-in could not start.")}).catch(()=>{n.addEventListener("click",()=>void Tt(e,"google"))}),n}function Pe(e,t){e.root.textContent="";let n=h(e,"div",R(e,"card","atlas-embed-card"));n.appendChild(h(e,"p","atlas-embed-note",t)),e.root.appendChild(n)}function _s(e){e.root.textContent="";let t=h(e,"div",R(e,"card","atlas-embed-card")),n=e.interaction.loading,r=h(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(h(e,"div",`atlas-embed-skel atlas-embed-skel-${i}`));else if(n==="dots")for(let i=0;i<3;i+=1)r.appendChild(h(e,"span","atlas-embed-dot"));else n==="bar"?r.appendChild(h(e,"span","atlas-embed-loadbar")):r.appendChild(h(e,"span","atlas-embed-spinner"));let o=h(e,"span","atlas-embed-sr","Loading\u2026");r.appendChild(o),t.appendChild(r),e.root.appendChild(t)}function ee(e,t){e.state={...e.state,errors:[...t]},P(e)}function P(e){var u,f,p,g,y,m,C,E,A,x;ss(e);let t=Array.from(e.root.children).filter(b=>b.hasAttribute("data-atlas-policy-modal"));e.root.textContent="";for(let b of t)e.root.appendChild(b);let n=h(e,"div",R(e,"card","atlas-embed-card")),r=(f=(u=e.appearance)==null?void 0:u.logoUrl)!=null?f:null;if(r){let b=I(e).createElement("img");b.className="atlas-embed-logo",b.src=r,b.alt=(g=(p=e.appearance)==null?void 0:p.applicationName)!=null?g:"",n.appendChild(b)}if(e.resetFlow){let b=`reset_${Se(e.resetFlow)}`;if(n.setAttribute("data-step",b),b!==e.lastStepKind&&n.setAttribute("data-enter",""),e.lastStepKind=b,n.appendChild(cs(e)),(y=e.appearance)!=null&&y.footer&&n.appendChild(h(e,"p",R(e,"footer","atlas-embed-footer"),e.appearance.footer)),e.root.appendChild(n),n.hasAttribute("data-enter")){let v=n.querySelector("[data-atlas-autofocus]");v instanceof HTMLElement&&v.focus()}return}let o=Te(e.state);if(o){n.setAttribute("data-step","recovery_codes"),e.lastStepKind!=="recovery_codes"&&n.setAttribute("data-enter",""),e.lastStepKind="recovery_codes",n.appendChild(os(e,o)),e.root.appendChild(n);return}let i=e.state.attempt?$(e.state.attempt):{kind:"collect_identifier"},s=e.mode==="sign-up"&&!e.state.attempt,l=s||i.kind==="collect_identifier",a=e.handlePrompt?"handle":i.kind;n.setAttribute("data-step",a),a!==e.lastStepKind&&n.setAttribute("data-enter",""),e.lastStepKind=a;let d=(C=(m=e.appearance)==null?void 0:m.headline)!=null?C:me[e.mode].title;n.appendChild(h(e,"h1",R(e,"title","atlas-embed-title"),d));let c=l?null:uc(e,i.kind);if(c?n.appendChild(c):(E=e.appearance)!=null&&E.subheadline&&n.appendChild(h(e,"p",R(e,"subtitle","atlas-embed-subtitle"),e.appearance.subheadline)),e.flash&&n.appendChild(h(e,"div","atlas-embed-flash",e.flash)),e.handlePrompt){n.appendChild(vs(e,e.handlePrompt)),(A=e.appearance)!=null&&A.footer&&n.appendChild(h(e,"p",R(e,"footer","atlas-embed-footer"),e.appearance.footer)),e.root.appendChild(n);return}if(l&&(Qn(e).length>0||e.signInWithAtlas.enabled)&&(n.appendChild(bs(e)),n.appendChild(h(e,"div",R(e,"divider","atlas-embed-divider"),"or"))),n.appendChild(s?us(e):i.kind==="accept_policies"?ls(e):ds(e,i.kind)),l&&e.mode==="sign-in"&&e.passkeyEnabled&&xe()&&n.appendChild(ys(e)),(x=e.appearance)!=null&&x.footer&&n.appendChild(h(e,"p",R(e,"footer","atlas-embed-footer"),e.appearance.footer)),e.root.appendChild(n),n.hasAttribute("data-enter")){let b=n.querySelector("[data-atlas-autofocus]");b instanceof HTMLElement&&b.focus()}}function uc(e,t){let n=e.enteredIdentifier,r=null,o=!1;switch(t){case"collect_email_code":r=rt(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":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=F(e,"mfa.enrollChoose");break;default:return null}let i=h(e,"div","atlas-embed-step-context");if(i.appendChild(h(e,"p",R(e,"subtitle","atlas-embed-subtitle"),r)),o){let s=h(e,"button","atlas-embed-step-back","Use a different email");s.type="button",s.addEventListener("click",()=>pc(e)),i.appendChild(s)}return i}function pc(e){e.state=B,e.backupCodeMode=!1,e.handlePrompt=null,e.enteredIdentifier=null,P(e)}var Re=class{constructor(t,n){this.root=t;this.options=n;k(this,"client");k(this,"mode");k(this,"appearance",null);k(this,"design",null);k(this,"appliedDesign");k(this,"providers",[]);k(this,"nativeProviders",[]);k(this,"signInWithAtlas",{enabled:!1});k(this,"social",qn(void 0,void 0));k(this,"codeInputStyle","boxes");k(this,"interaction",At(void 0,void 0));k(this,"backupCodeMode",!1);k(this,"policies",new _e([]));k(this,"pendingPolicies",null);k(this,"policyDispose",[]);k(this,"enrollment",null);k(this,"secondFactorCode",null);k(this,"enteredIdentifier",null);k(this,"lastStepKind",null);k(this,"signUpFields",[]);k(this,"passwordEnabled",!0);k(this,"emailCodeEnabled",!1);k(this,"emailLinkEnabled",!1);k(this,"emailDeliveryAvailable",!0);k(this,"passkeyEnabled",!1);k(this,"passwordResetEnabled",!0);k(this,"passwordSignUpEnabled",!0);k(this,"conditionalAbort");k(this,"linkPoll",null);k(this,"account",{...An});k(this,"rememberMeEnabled",!1);k(this,"remember",!0);k(this,"trustedDeviceEnabled",!1);k(this,"rememberDevice",!1);k(this,"captchaFlows",{});k(this,"captchaHost");k(this,"state",B);k(this,"resetFlow",null);k(this,"flash",null);k(this,"handlePrompt",null);k(this,"busy",!1);k(this,"recorder");var r,o,i;this.mode=(r=n.mode)!=null?r:"sign-in",this.interaction=At(void 0,(o=n.appearance)==null?void 0:o.interaction),this.client=Mi({publishableKey:n.publishableKey,frontendApi:n.frontendApi,fetchImpl:n.fetchImpl,locale:(i=n.locale)!=null?i:fr(n.localization),referral:n.referral,referralConsent:n.referralConsent})}errorText(t){return pr(t,this.options.localization)}async mount(){var r,o,i,s,l,a,d,c,u,f,p,g,y,m,C,E,A,x,b,v,S,w,T,L,te,H,j,rr,or,ir,sr;if(Ni((r=this.root.ownerDocument)!=null?r:document),this.root.classList.add("atlas-embed-root"),this.resolveDesign(null),this.applyTheme(),this.applyInteraction(),_s(this),await Vi(this))return;let n=await Ui(this.client);if(n){this.appearance=n.appearance;let Rs=(o=n.provider_scopes)!=null?o:{},ar=Dt=>{let Ft=Rs[Dt];return Ft?this.mode==="sign-up"?Ft.sign_up:Ft.sign_in:!0};this.providers=Di((i=n.providers)!=null?i:[],n.appearance).filter(ar),this.nativeProviders=((s=n.native_providers)!=null?s:[]).filter(Dt=>ar(Dt.provider)),this.passwordEnabled=(a=(l=n.strategies)==null?void 0:l.password)!=null?a:!0,this.passkeyEnabled=(c=(d=n.strategies)==null?void 0:d.passkey)!=null?c:!1,this.emailCodeEnabled=(f=(u=n.strategies)==null?void 0:u.emailCode)!=null?f:!1,this.emailLinkEnabled=(g=(p=n.strategies)==null?void 0:p.emailLink)!=null?g:!1,this.passwordResetEnabled=(m=(y=n.email_delivery)==null?void 0:y.password_reset)!=null?m:!0,this.emailDeliveryAvailable=(E=(C=n.email_delivery)==null?void 0:C.available)!=null?E:!0,this.passwordSignUpEnabled=(x=(A=n.email_delivery)==null?void 0:A.password_sign_up)!=null?x:!0,this.account=Pn(n),this.signInWithAtlas=(b=n.sign_in_with_atlas)!=null?b:{enabled:!1},this.rememberMeEnabled=n.rememberMe===!0,this.trustedDeviceEnabled=n.rememberDevice===!0,this.captchaFlows=(v=n.captchaFlows)!=null?v:{},await nn(this.client)&&(this.captchaFlows=jo(this.captchaFlows)),this.resolveDesign(wi(n)),this.applyTheme()}this.social=qn(this.design?{...(S=this.appearance)==null?void 0:S.socialButtons,...this.design.socialButtons}:(w=this.appearance)==null?void 0:w.socialButtons,(T=this.options.appearance)==null?void 0:T.socialButtons),this.codeInputStyle=Ei((L=this.appearance)==null?void 0:L.codeInput,(te=this.options.appearance)==null?void 0:te.codeInput),this.interaction=At(this.design?{...(H=this.appearance)==null?void 0:H.interaction,...this.design.interaction}:(j=this.appearance)==null?void 0:j.interaction,(rr=this.options.appearance)==null?void 0:rr.interaction),this.applyInteraction(),this.signUpFields=(ir=(or=this.appearance)==null?void 0:or.signUpFields)!=null?ir:[],await is(this);try{this.recorder=new et((sr=this.root.ownerDocument)!=null?sr:document)}catch{}P(this),hs(this)}applyTheme(){var r,o,i,s,l,a;let t=(o=(r=this.design)==null?void 0:r.tokens)!=null?o:Ri(this.appearance,this.options.appearance),n=Ti(t);for(let[d,c]of Object.entries(n))this.root.style.setProperty(d,c);this.root.style.setProperty("--atlas-embed-color-text-on-primary",Ii(t.colorPrimary)),this.root.style.setProperty("--atlas-embed-color-focus-ring",(l=(s=(i=this.options.appearance)==null?void 0:i.variables)==null?void 0:s.colorFocusRing)!=null?l:Oi(t.colorPrimary,[t.colorCard,t.colorBackground])),this.design&&(this.appliedDesign=Si((a=this.root.ownerDocument)!=null?a: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=$i(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?Pi[t.motionSpeed]:0;this.root.style.setProperty("--atlas-embed-motion",`${n}ms`)}};var Y={};function xs(e){Y=e}function ws(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 Ss(e,t){var p,g,y,m,C,E,A,x,b,v,S,w;let n=e.dataset,r=T=>{var L;return(L=e.getAttribute(T))!=null?L:void 0},o=(g=(p=n.atlasKey)!=null?p:r("publishable-key"))!=null?g:Y.publishableKey,i=(m=(y=n.atlasFapi)!=null?y:r("frontend-api"))!=null?m:Y.frontendApi,s=(E=(C=n.atlasRedirect)!=null?C:r("redirect"))!=null?E:Y.redirect;if(!o||!i)return null;let l={publishableKey:o,frontendApi:i,mode:t};s&&(l.redirect=s);let a=(x=(A=n.atlasLocale)!=null?A:r("locale"))!=null?x:Y.locale;a&&(l.locale=a);let d=(b=n.atlasPreset)!=null?b:r("preset");d&&(l.appearance={preset:d});let c=(v=n.atlasReferral)!=null?v:r("referral");(c==="off"||c==="false")&&(l.referral=!1);let u=(S=n.atlasReferralConsent)!=null?S:r("referral-consent");(u==="granted"||u==="denied")&&(l.referralConsent=u);let f=(w=n.atlasPasskeyPrf)!=null?w:r("passkey-prf");return f&&(l.passkeyPrf={eval:{first:f}}),l}function Cs(e,t={}){var o,i,s,l,a;let n=(o=t.publishableKey)!=null?o:Y.publishableKey,r=(i=t.frontendApi)!=null?i:Y.frontendApi;return!n||!r?null:{...t,publishableKey:n,frontendApi:r,redirect:(s=t.redirect)!=null?s:Y.redirect,...((l=t.locale)!=null?l:Y.locale)?{locale:(a=t.locale)!=null?a:Y.locale}:{},mode:e}}var Lt=class extends HTMLElement{constructor(){super(...arguments);k(this,"widget",null)}connectedCallback(){if(this.widget)return;let n=Ss(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 Re(this,n),this.widget.mount()}},er=class extends Lt{constructor(){super(...arguments);k(this,"mode","sign-in")}},tr=class extends Lt{constructor(){super(...arguments);k(this,"mode","sign-up")}};function nr(){typeof customElements!="undefined"&&(customElements.get("atlas-sign-in")||customElements.define("atlas-sign-in",er),customElements.get("atlas-sign-up")||customElements.define("atlas-sign-up",tr))}function fc(e){let t=typeof e=="string"?document.querySelector(e):e;return t instanceof HTMLElement?t:null}function Es(e,t,n){let r=fc(t);if(!r)return null;let o=Cs(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 Re(r,o);return i.mount(),i}function As(e,t={}){return Es("sign-in",e,t)}function Ps(e,t={}){return Es("sign-up",e,t)}function gc(){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 mc(){xs(ws(gc())),nr(),window.Atlas={mountSignIn:As,mountSignUp:Ps,defineElements:nr}}mc();})();
|