@atlasauth/embed 0.12.0 → 0.13.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 CHANGED
@@ -1,5 +1,9 @@
1
1
  # @atlasauth/embed changelog
2
2
 
3
+ ## 0.13.0 — 2026-10-24
4
+
5
+ - SSO organization claims, app adoption, validating dry runs, sealed secrets, consent API adapters; see the Atlas changelog.
6
+
3
7
  ## 0.12.0 — 2026-10-24
4
8
 
5
9
  ### Added
package/dist/embed.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";(()=>{var $s=Object.create;var Nt=Object.defineProperty;var Ns=Object.getOwnPropertyDescriptor;var zs=Object.getOwnPropertyNames;var Bs=Object.getPrototypeOf,Hs=Object.prototype.hasOwnProperty;var js=(e,t,n)=>t in e?Nt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var zt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ws=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of zs(t))!Hs.call(e,o)&&o!==n&&Nt(e,o,{get:()=>t[o],enumerable:!(r=Ns(t,o))||r.enumerable});return e};var Ks=(e,t,n)=>(n=e!=null?$s(Bs(e)):{},Ws(t||!e||!e.__esModule?Nt(n,"default",{value:e,enumerable:!0}):n,e));var k=(e,t,n)=>js(e,typeof t!="symbol"?t+"":t,n);var Yo=zt(pe=>{"use strict";Object.defineProperty(pe,"__esModule",{value:!0});pe.ForbiddenError=void 0;pe.evaluate=On;pe.hasFromClaims=Cl;pe.protectFromClaims=Al;function Sl(e){return e.permission!==void 0||e.role!==void 0||e.anyPermission!==void 0||e.allPermissions!==void 0}function On(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(!Sl(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 Cl(e,t={}){return On(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 Al(e,t={}){let n=On(e,t);if(!n.allowed)throw new at(n.reason,t)}});var Jo=zt(Y=>{"use strict";Object.defineProperty(Y,"__esModule",{value:!0});Y.PERMISSION_KEY_PATTERN=Y.ROLE_KEY_PATTERN=void 0;Y.isRoleKey=El;Y.isPermissionKey=Pl;Y.ROLE_KEY_PATTERN=/^org:[a-z][a-z0-9_]{1,31}$/;Y.PERMISSION_KEY_PATTERN=/^org:[a-z][a-z0-9_]{1,31}:[a-z][a-z0-9_]{1,31}$/;function El(e){return Y.ROLE_KEY_PATTERN.test(e)}function Pl(e){return Y.PERMISSION_KEY_PATTERN.test(e)}});var Zo=zt(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=Yo();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=Jo();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 Dc=30*24*60*60*1e3;function pr(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 fr(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,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 gr(e){return e.status==="complete"||e.status==="abandoned"}function mr(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 rd=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 qs(e){return`error.${e}`}var Vs="Something went wrong. Please try again.",Gs=/^[a-z][a-z0-9_]{0,63}$/;function Ys(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 Bt(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 hr(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&&Gs.test(o)){let l=Bt(t,qs(o)),a=l?Ys(l,r.meta):null;if(a)return a}return typeof r.message=="string"&&r.message.trim()!==""?r.message:(s=(i=Bt(t,"error.generic"))!=null?i:Bt(n,"error.generic"))!=null?s:Vs}function yr(e){if(!e||typeof e!="object")return;let t=e.locale;return typeof t=="string"&&t.trim()!==""?t:void 0}var Ht="atlas:oauth",Js="atlas_popup_result",br="atlas:oauth";function Zs(e){return`${br}:${e}`}function kr(){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 Xs(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 Qs(e){var t;try{return(t=pr(e))!=null?t:fr(e)}catch{return null}}function vr(e,t,n){let r=Qs(e);if(!r)return Promise.resolve(!1);let o=kr();return new Promise(i=>{let s=!1,l=c=>{s||(s=!0,clearTimeout(d),a(),r.close(),i(c))},a=r.subscribe(c=>{Xs(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 ea(e){if(!e||e.length<2)return null;let t=new URLSearchParams(e.replace(/^#/,"")).get(Js);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 _r(e={}){var o,i;let t=(o=e.win)!=null?o:typeof window!="undefined"?window:void 0;if(!t)return null;let n=ea(t.location.hash);if(!n)return null;try{t.history.replaceState(t.history.state,"",t.location.href.split("#")[0])}catch{}try{t.name=Ht}catch{}let r=await vr(Zs(n.nonce),{type:"atlas:oauth:result",result:n.payload},(i=e.ackTimeoutMs)!=null?i:1500);return r&&wr(t),{payload:n.payload,delivered:r}}async function xr(e={}){var o,i;let t=(o=e.win)!=null?o:typeof window!="undefined"?window:void 0;if(!t||t.name!==Ht)return!1;let n=await vr(br,{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:(wr(t),!0)}function wr(e){try{e.close()}catch{}}var ta=["__atlas_attempt","__atlas_ticket","__atlas_status","__atlas_policy_token"];function Sr(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 cd=5*6e4;function Cr(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 ta)t.searchParams.delete(n);return t.toString()}async function Ar(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 Er(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 Pr="0.19.0";var Tr={name:"@atlasauth/js",version:Pr},Ir="x-atlas-sdk",na="atlas-sdk-advisory";function Or(e){return`${e.name}/${e.version}`}function ra(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 Rr=new Set;function Lr(e,t,n=oa){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,na))!=null?l:null}catch{return[]}let o=[];for(let c of ra(r)){let u=`${t.name}|${(a=c.reason)!=null?a:""}|${(d=c.min)!=null?d:""}`;Rr.has(u)||(Rr.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 oa(e){typeof console!="undefined"&&console.warn(e)}var ye="__atlas_dev_session:",Dr="/v1/client/tickets/exchange",Fr="/v1/client",Mr=/^\/v1\/client\/sessions\/[^/]+\/tokens$/,ia=/^\/v1\/client\/sessions\/[^/]+\/revoke$/;function de(){try{let e=globalThis.localStorage;return e&&typeof e.getItem=="function"?e:null}catch{return null}}function zr(e){return e.startsWith("pk_test_")&&de()!==null}function Br(e){var t,n;try{return(n=(t=de())==null?void 0:t.getItem(ye+e))!=null?n:null}catch{return null}}var Wt=":sid";function Ur(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+Wt,n))}catch{}}function sa(e){var t,n;try{return(n=(t=de())==null?void 0:t.getItem(ye+e+Wt))!=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+Wt)}catch{}}function aa(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 $r(e){let t=/^\/v1\/client\/sessions\/([^/]+)\//.exec(e);return t?decodeURIComponent(t[1]):null}async function jt(e){try{let t=await e.clone().json();return t&&typeof t=="object"&&!Array.isArray(t)?t:null}catch{return null}}var Nr=Symbol.for("atlas.devBrowser");function Kt(e,t){if(!e.startsWith("pk_test_")||t[Nr])return t;let n=async(r,o)=>{var u,f;if(!zr(e))return t(r,o);let i=aa(r),s=((u=o==null?void 0:o.method)!=null?u:"GET").toUpperCase(),l=o,a=!1;if(i===Dr&&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=Br(e);if(d&&(i===Fr&&s==="GET"||i&&Mr.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===Dr&&c.ok){let p=await jt(c);Ur(e,p==null?void 0:p.refresh_token,p==null?void 0:p.id)}else if(i&&Mr.test(i))c.ok?Ur(e,(f=await jt(c))==null?void 0:f.refresh_token,$r(i)):a&&c.status===401&&Je(e);else if(i===Fr&&a&&c.ok){let p=await jt(c);p&&p.session===null&&Je(e)}else if(i&&ia.test(i)&&(c.ok||c.status===404)){let p=sa(e);(!p||p===$r(i))&&Je(e)}return c};return n[Nr]=!0,n}function qt(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 la(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 Hr(e){return e.replace(/\s+/g,"").replace(/(.{4})(?=.)/g,"$1 ")}function ca(e,t){return t===409?!0:e.some(n=>n.code==="STRATEGY_DISABLED"||n.param==="strategy")}function jr(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 la(e,g,p);if(y===a){if(m.enrollment){c({busy:!1,enrollment:m.enrollment,errors:[]});return}if(ca(m.errors,m.status)&&i.options.length>1){let S=i.options.filter(E=>E!==p.strategy);c({busy:!1,options:S,method:null,enrollment:null,errors:m.errors}),S.length===1&&await f.choose(S[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,S,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:(S=p.code)!=null?S:""}:{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 Wr(e){return e.method===null?null:e.method==="phone_code"&&!e.enrollment?"mfa.sendCode":e.enrollment?"signIn.submit":null}async function Kr(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 qr(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 Vr(e){return{...e,recoveryCodes:null}}function da(e){return`${e.join(`
1
+ "use strict";(()=>{var $s=Object.create;var Nt=Object.defineProperty;var Ns=Object.getOwnPropertyDescriptor;var zs=Object.getOwnPropertyNames;var Bs=Object.getPrototypeOf,Hs=Object.prototype.hasOwnProperty;var js=(e,t,n)=>t in e?Nt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var zt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ws=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of zs(t))!Hs.call(e,o)&&o!==n&&Nt(e,o,{get:()=>t[o],enumerable:!(r=Ns(t,o))||r.enumerable});return e};var Ks=(e,t,n)=>(n=e!=null?$s(Bs(e)):{},Ws(t||!e||!e.__esModule?Nt(n,"default",{value:e,enumerable:!0}):n,e));var k=(e,t,n)=>js(e,typeof t!="symbol"?t+"":t,n);var Yo=zt(pe=>{"use strict";Object.defineProperty(pe,"__esModule",{value:!0});pe.ForbiddenError=void 0;pe.evaluate=On;pe.hasFromClaims=Cl;pe.protectFromClaims=Al;function Sl(e){return e.permission!==void 0||e.role!==void 0||e.anyPermission!==void 0||e.allPermissions!==void 0}function On(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(!Sl(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 Cl(e,t={}){return On(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 Al(e,t={}){let n=On(e,t);if(!n.allowed)throw new at(n.reason,t)}});var Jo=zt(Y=>{"use strict";Object.defineProperty(Y,"__esModule",{value:!0});Y.PERMISSION_KEY_PATTERN=Y.ROLE_KEY_PATTERN=void 0;Y.isRoleKey=El;Y.isPermissionKey=Pl;Y.ROLE_KEY_PATTERN=/^org:[a-z][a-z0-9_]{1,31}$/;Y.PERMISSION_KEY_PATTERN=/^org:[a-z][a-z0-9_]{1,31}:[a-z][a-z0-9_]{1,31}$/;function El(e){return Y.ROLE_KEY_PATTERN.test(e)}function Pl(e){return Y.PERMISSION_KEY_PATTERN.test(e)}});var Zo=zt(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=Yo();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=Jo();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 Dc=30*24*60*60*1e3;function pr(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 fr(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,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 gr(e){return e.status==="complete"||e.status==="abandoned"}function mr(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 rd=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 qs(e){return`error.${e}`}var Vs="Something went wrong. Please try again.",Gs=/^[a-z][a-z0-9_]{0,63}$/;function Ys(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 Bt(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 hr(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&&Gs.test(o)){let l=Bt(t,qs(o)),a=l?Ys(l,r.meta):null;if(a)return a}return typeof r.message=="string"&&r.message.trim()!==""?r.message:(s=(i=Bt(t,"error.generic"))!=null?i:Bt(n,"error.generic"))!=null?s:Vs}function yr(e){if(!e||typeof e!="object")return;let t=e.locale;return typeof t=="string"&&t.trim()!==""?t:void 0}var Ht="atlas:oauth",Js="atlas_popup_result",br="atlas:oauth";function Zs(e){return`${br}:${e}`}function kr(){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 Xs(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 Qs(e){var t;try{return(t=pr(e))!=null?t:fr(e)}catch{return null}}function vr(e,t,n){let r=Qs(e);if(!r)return Promise.resolve(!1);let o=kr();return new Promise(i=>{let s=!1,l=c=>{s||(s=!0,clearTimeout(d),a(),r.close(),i(c))},a=r.subscribe(c=>{Xs(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 ea(e){if(!e||e.length<2)return null;let t=new URLSearchParams(e.replace(/^#/,"")).get(Js);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 _r(e={}){var o,i;let t=(o=e.win)!=null?o:typeof window!="undefined"?window:void 0;if(!t)return null;let n=ea(t.location.hash);if(!n)return null;try{t.history.replaceState(t.history.state,"",t.location.href.split("#")[0])}catch{}try{t.name=Ht}catch{}let r=await vr(Zs(n.nonce),{type:"atlas:oauth:result",result:n.payload},(i=e.ackTimeoutMs)!=null?i:1500);return r&&wr(t),{payload:n.payload,delivered:r}}async function xr(e={}){var o,i;let t=(o=e.win)!=null?o:typeof window!="undefined"?window:void 0;if(!t||t.name!==Ht)return!1;let n=await vr(br,{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:(wr(t),!0)}function wr(e){try{e.close()}catch{}}var ta=["__atlas_attempt","__atlas_ticket","__atlas_status","__atlas_policy_token"];function Sr(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 cd=5*6e4;function Cr(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 ta)t.searchParams.delete(n);return t.toString()}async function Ar(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 Er(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 Pr="0.21.0";var Tr={name:"@atlasauth/js",version:Pr},Ir="x-atlas-sdk",na="atlas-sdk-advisory";function Or(e){return`${e.name}/${e.version}`}function ra(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 Rr=new Set;function Lr(e,t,n=oa){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,na))!=null?l:null}catch{return[]}let o=[];for(let c of ra(r)){let u=`${t.name}|${(a=c.reason)!=null?a:""}|${(d=c.min)!=null?d:""}`;Rr.has(u)||(Rr.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 oa(e){typeof console!="undefined"&&console.warn(e)}var ye="__atlas_dev_session:",Dr="/v1/client/tickets/exchange",Fr="/v1/client",Mr=/^\/v1\/client\/sessions\/[^/]+\/tokens$/,ia=/^\/v1\/client\/sessions\/[^/]+\/revoke$/;function de(){try{let e=globalThis.localStorage;return e&&typeof e.getItem=="function"?e:null}catch{return null}}function zr(e){return e.startsWith("pk_test_")&&de()!==null}function Br(e){var t,n;try{return(n=(t=de())==null?void 0:t.getItem(ye+e))!=null?n:null}catch{return null}}var Wt=":sid";function Ur(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+Wt,n))}catch{}}function sa(e){var t,n;try{return(n=(t=de())==null?void 0:t.getItem(ye+e+Wt))!=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+Wt)}catch{}}function aa(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 $r(e){let t=/^\/v1\/client\/sessions\/([^/]+)\//.exec(e);return t?decodeURIComponent(t[1]):null}async function jt(e){try{let t=await e.clone().json();return t&&typeof t=="object"&&!Array.isArray(t)?t:null}catch{return null}}var Nr=Symbol.for("atlas.devBrowser");function Kt(e,t){if(!e.startsWith("pk_test_")||t[Nr])return t;let n=async(r,o)=>{var u,f;if(!zr(e))return t(r,o);let i=aa(r),s=((u=o==null?void 0:o.method)!=null?u:"GET").toUpperCase(),l=o,a=!1;if(i===Dr&&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=Br(e);if(d&&(i===Fr&&s==="GET"||i&&Mr.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===Dr&&c.ok){let p=await jt(c);Ur(e,p==null?void 0:p.refresh_token,p==null?void 0:p.id)}else if(i&&Mr.test(i))c.ok?Ur(e,(f=await jt(c))==null?void 0:f.refresh_token,$r(i)):a&&c.status===401&&Je(e);else if(i===Fr&&a&&c.ok){let p=await jt(c);p&&p.session===null&&Je(e)}else if(i&&ia.test(i)&&(c.ok||c.status===404)){let p=sa(e);(!p||p===$r(i))&&Je(e)}return c};return n[Nr]=!0,n}function qt(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 la(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 Hr(e){return e.replace(/\s+/g,"").replace(/(.{4})(?=.)/g,"$1 ")}function ca(e,t){return t===409?!0:e.some(n=>n.code==="STRATEGY_DISABLED"||n.param==="strategy")}function jr(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 la(e,g,p);if(y===a){if(m.enrollment){c({busy:!1,enrollment:m.enrollment,errors:[]});return}if(ca(m.errors,m.status)&&i.options.length>1){let S=i.options.filter(E=>E!==p.strategy);c({busy:!1,options:S,method:null,enrollment:null,errors:m.errors}),S.length===1&&await f.choose(S[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,S,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:(S=p.code)!=null?S:""}:{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 Wr(e){return e.method===null?null:e.method==="phone_code"&&!e.enrollment?"mfa.sendCode":e.enrollment?"signIn.submit":null}async function Kr(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 qr(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 Vr(e){return{...e,recoveryCodes:null}}function da(e){return`${e.join(`
2
2
  `)}
3
3
  `}async function Gr(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
4
  `)),!0}catch{return!1}}function Vt(){return typeof document!="undefined"&&typeof Blob!="undefined"&&typeof URL!="undefined"&&typeof URL.createObjectURL=="function"}function Yr(e,t="recovery-codes.txt"){var r;if(!Vt())return!1;let n=URL.createObjectURL(new Blob([da(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 ua=/^[A-Za-z0-9_-]{3,64}$/,ue=e=>!!e&&typeof e=="object"&&!Array.isArray(e),Gt=e=>typeof e=="string"&&ua.test(e.trim())?e.trim():null,Jt=["referalli","rewardful","tolt","promotekit","firstpromoter","partnerstack","dub"],Qr=["atlasconsent","cookiemunch","onetrust","cookiebot","didomi","usercentrics","osano","cookieyes","complianz","klaro","tcf","consent_mode","gpc"];function v(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 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 eo(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 eo(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:Gt(t),clickId:Gt(n),anonId:Gt(r)},s=eo(o);return s&&(i.capturedAt=s),i.code||i.clickId||i.anonId?i:null}var pa={referalli:({win:e})=>{var r,o;let t=v(e,"aff"),n=G(v(t,"getReferral"),t);return ue(n)?re("referalli",n.code,(r=n.clickId)!=null?r:n.click_id,(o=n.anonId)!=null?o:n.anon_id,n.ts):null},rewardful:({win:e})=>{let t=v(e,"Rewardful");return re("rewardful",v(v(t,"affiliate"),"token"),v(t,"referral"),null)},tolt:({win:e})=>re("tolt",null,v(e,"tolt_referral"),null),promotekit:({win:e})=>re("promotekit",null,v(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 Zt(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 o=pa[n==="referally"?"referalli":n];if(!o)continue;let i=null;try{i=o(e)}catch{i=null}if(i)return i}return null}var fa={necessary:"necessary",essential:"necessary",strictly_necessary:"necessary",preferences:"preferences",functional:"preferences",functionality:"preferences",personalization:"preferences",statistics:"statistics",analytics:"statistics",performance:"statistics",marketing:"marketing",advertising:"marketing",advertisement:"marketing",targeting:"marketing",ads:"marketing"};function to(e){var t;return(t=fa[e.trim().toLowerCase()])!=null?t:null}var ne=e=>typeof e=="boolean"?e:void 0;function Z(e,t){return(n,r)=>{let o=t(r);if(o!==void 0)return o;let i=to(r),s=i?e[i]:void 0;return s?t(s):void 0}}var Yt=null,Jr=!1;function Xt(e){let t=v(e,"__tcfapi");Jr||typeof t!="function"||(Jr=!0,G(t,e,"addEventListener",2,(n,r)=>{r&&ue(n)&&(Yt=n)}))}function ga(e){if(Yt)return Yt;let t=null;return G(v(e,"__tcfapi"),e,"getTCData",2,(n,r)=>{r&&ue(n)&&(t=n)}),t}var Zr={necessary:"necessary",preferences:"preferences",statistics:"statistics",marketing:"marketing"},Xr=(e,t)=>Array.isArray(e)&&e.includes(t),ma={atlasconsent:{present:e=>v(v(e,"__atlasConsent"),"version")===1&&typeof v(v(e,"__atlasConsent"),"has")=="function",ask:(e,t)=>{let n=v(e,"__atlasConsent"),r=G(v(n,"has"),n,t);return r===!0?!0:r===!1?!1:void 0}},cookiemunch:{present:e=>ue(v(v(e,"CookieMunch"),"consent")),ask:(e,t)=>{let n=v(v(e,"CookieMunch"),"consent");return Z(Zr,r=>ne(v(n,r)))(e,t)}},onetrust:{present:e=>{var t;return typeof((t=v(e,"OnetrustActiveGroups"))!=null?t:v(e,"OptanonActiveGroups"))=="string"},ask:(e,t)=>{var r,o;let n=String((o=(r=v(e,"OnetrustActiveGroups"))!=null?r:v(e,"OptanonActiveGroups"))!=null?o:"").split(",").map(i=>i.trim()).filter(Boolean);return Z({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=>!v(e,"CookieMunch")&&ue(v(v(e,"Cookiebot"),"consent")),ask:(e,t)=>{let n=v(v(e,"Cookiebot"),"consent");return Z(Zr,r=>ne(v(n,r)))(e,t)}},didomi:{present:e=>typeof v(v(e,"Didomi"),"getUserStatus")=="function",ask:(e,t)=>{let n=v(e,"Didomi"),r=v(v(G(v(n,"getUserStatus"),n),"purposes"),"global"),o=v(r,"enabled"),i=v(r,"disabled");return Z({marketing:"cookies",statistics:"measure_content_performance"},s=>Xr(o,s)?!0:Xr(i,s)?!1:void 0)(e,t)}},usercentrics:{present:e=>typeof v(v(e,"UC_UI"),"getServicesBaseInfo")=="function",ask:(e,t)=>{let n=v(e,"UC_UI"),r=G(v(n,"getServicesBaseInfo"),n);if(Array.isArray(r))return Z({necessary:"essential",preferences:"functional",statistics:"functional",marketing:"marketing"},o=>{let i=r.filter(s=>v(s,"categorySlug")===o);return i.length?i.every(s=>v(v(s,"consent"),"status")===!0):void 0})(e,t)}},osano:{present:e=>typeof v(v(v(e,"Osano"),"cm"),"getConsent")=="function",ask:(e,t)=>{let n=v(v(e,"Osano"),"cm"),r=G(v(n,"getConsent"),n);return Z({necessary:"ESSENTIAL",preferences:"PERSONALIZATION",statistics:"ANALYTICS",marketing:"MARKETING"},o=>{var s;let i=(s=v(r,o))!=null?s:v(r,o.toUpperCase());return i==="ACCEPT"?!0:i==="DENY"?!1:void 0})(e,t)}},cookieyes:{present:e=>typeof v(e,"getCkyConsent")=="function",ask:(e,t)=>{let n=v(G(v(e,"getCkyConsent"),e),"categories");return Z({necessary:"necessary",preferences:"functional",statistics:"analytics",marketing:"advertisement"},r=>ne(v(n,r)))(e,t)}},complianz:{present:e=>typeof v(e,"cmplz_has_consent")=="function",ask:(e,t)=>Z({necessary:"functional",preferences:"preferences",statistics:"statistics",marketing:"marketing"},n=>ne(G(v(e,"cmplz_has_consent"),e,n)))(e,t)},klaro:{present:e=>typeof v(v(e,"klaro"),"getManager")=="function",ask:(e,t)=>{let n=v(e,"klaro"),r=v(G(v(n,"getManager"),n),"consents");return ne(v(r,t))}},tcf:{present:e=>typeof v(e,"__tcfapi")=="function",ask:e=>{var n;let t=ga(e);if(t)return t.gdprApplies===!1?!0:(n=ne(v(v(v(t,"purpose"),"consents"),"1")))!=null?n:!1}},consent_mode:{present:e=>ue(v(v(v(e,"google_tag_data"),"ics"),"entries")),ask:(e,t)=>{let n=v(v(v(e,"google_tag_data"),"ics"),"entries");return Z({preferences:"functionality_storage",statistics:"analytics_storage",marketing:"ad_storage"},r=>{var i;let o=v(n,r);return(i=ne(v(o,"update")))!=null?i:ne(v(o,"default"))})(e,t)}},gpc:{present:e=>v(v(e,"navigator"),"globalPrivacyControl")===!0,ask:(e,t)=>t==="marketing"||t==="referrals"?!1:void 0}};function ha(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 Qt(e,t,n={}){let r=n.provider||"auto",o=()=>{let l=ha(n.appConsent);return l===void 0?{granted:!1,by:"none"}:{granted:l,by:"app"}};if(r==="app")return o();let i=r==="auto"?Qr:[r],s=t.filter(l=>typeof l=="string"&&l.trim().length>0);for(let l of i){let a=ma[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 no=new Set(["referalli","rewardful","tolt","promotekit"]),ro=["referalli"],oo=Object.freeze({enabled:!1,sources:[],consentProvider:"auto",urlParams:[],contextCookie:null,contextCookies:[],consentCategory:"referrals",consentFallbackCategory:"marketing",challengeReferredSignups:"inherit",codeLookupUrl:null,signupCodeField:!1}),ya=/^[A-Za-z0-9_-]{3,64}$/,ba=/^[A-Za-z0-9_.-]{1,40}$/,ka=/^[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 ya.test(t)?t:null}function io(e){var i;let t=Le(e)&&Le(e.referrals)?e.referrals:e;if(!Le(t)||t.enabled!==!0)return{...oo,urlParams:[],sources:[]};let n=Array.isArray(t.url_params)?t.url_params.filter(s=>typeof s=="string"&&ba.test(s)).slice(0,10):[],r=Array.isArray(t.browser_sources)?t.browser_sources.filter(s=>typeof s=="string"&&/^[a-z0-9_]{1,40}$/.test(s)).map(s=>s==="referally"?"referalli":s).slice(0,20):[...ro],o=(Array.isArray(t.context_cookies)?t.context_cookies:typeof t.context_cookie=="string"?[t.context_cookie]:[]).filter(s=>typeof s=="string"&&ka.test(s)).filter((s,l,a)=>a.indexOf(s)===l).slice(0,5);return{enabled:!0,sources:r,consentProvider:typeof t.consent_provider=="string"&&/^[a-z0-9_]{1,40}$/.test(t.consent_provider)?t.consent_provider:"auto",urlParams:n.length?n:["ref","via","aff"],contextCookie:(i=o[0])!=null?i:null,contextCookies:o,consentCategory:typeof t.consent_category=="string"&&t.consent_category?t.consent_category:"referrals",consentFallbackCategory:typeof t.consent_fallback_category=="string"&&t.consent_fallback_category?t.consent_fallback_category:null,challengeReferredSignups:t.challenge_referred_signups==="always"?"always":"inherit",codeLookupUrl:typeof t.code_lookup_url=="string"&&/^https?:\/\//i.test(t.code_lookup_url)&&t.code_lookup_url.includes("{code}")?t.code_lookup_url:null,signupCodeField:t.signup_code_field===!0}}function va(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 _a(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 xa(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 wa(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 Sa=["ref_click_id","ref_anon_id","ref_consent","ref_captured_at"];function Ca(e){if(!e)return null;let t;try{t=new URLSearchParams(e)}catch{return null}if(!Sa.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 en(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 Aa(e){return e.win!==void 0?e.win:{CookieMunch:e.cookieMunch,aff:e.aff}}function Ea(e,t,n,r){var g,y,m;if(!e.enabled)return null;let o=(g=t.capturedAt)!=null?g:new Date().toISOString(),i=Aa(t),s,l=()=>s!=null?s:s=Qt(i,[e.consentCategory,e.consentFallbackCategory],{provider:e.consentProvider,appConsent:n}),a=S=>S?en(S,l,o,S.source):null,d=(y=e.sources)!=null?y:ro,c={win:i,cookies:t.cookies},u=a(Zt(r));if(u)return u;let f=a(Oe(c,d.filter(S=>no.has(S))));if(f)return f;let p=_a(t.searches,t.base);for(let S of p){let E=Ca(S);if(!E)continue;let A=en(E,()=>E.consentGranted?{granted:!0,by:"url"}:l(),o,"url");if(A)return A}for(let S of p){let E=va(S,e.urlParams);if(E)return{code:E,click_id:null,anon_id:null,consent:"not_required",captured_at:o,source:"url"}}for(let S of(m=e.contextCookies)!=null?m:e.contextCookie?[e.contextCookie]:[]){let E=xa(wa(t.cookies,S)),A=E?en(E,l,o,"cookie"):null;if(A)return A}return a(Oe(c,d.filter(S=>!no.has(S))))}var Pa=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"]),Ra=/^\/v1\/client\/(sign_ins\/[^/]+\/(prepare_first_factor|attempt_first_factor)|sign_ups\/[^/]+\/(prepare_verification|attempt_verification|passkey\/finish))$/;function so(e){var n;let t=(n=e.split("?")[0])!=null?n:e;return Pa.has(t)||Ra.test(t)}var ve=()=>typeof window=="undefined"?null:window,Xe=[],ke=null;function nn(){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()))}nn();ve()&&Xt(ve());var tn={};var be=new Map;function ao(e,t){return`${e!=null?e:""}|${t}`}function lo(e,t){!Le(t)||!("referrals"in t)||be.set(e,Promise.resolve(io(t)))}function co(e){let t=be.get(e.referralCacheKey);if(!t){let n=e.referralCacheKey,r=()=>(be.get(n)===t&&be.delete(n),{...oo,urlParams:[]});t=e.get("/v1/client/environment").then(o=>o.ok?io(o.data):r()).catch(r),be.set(n,t)}return t}function uo(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||Zt(rn(e).referralSource)!==null||Oe({win:t,cookies:(o=(r=t==null?void 0:t.document)==null?void 0:r.cookie)!=null?o:null},Jt)!==null}function rn(e){var n,r,o;let t=e.referralOptions;return{referral:(n=t.referral)!=null?n:tn.referral,referralConsent:(r=t.referralConsent)!=null?r:tn.referralConsent,referralSource:(o=t.referralSource)!=null?o:tn.referralSource}}async function on(e){var r,o,i,s,l;let t=ve();if(!t)return null;let n=rn(e);if(n.referral===!1)return null;try{let a=(o=(r=t.location)==null?void 0:r.search)!=null?o:"";if(!uo(e))return null;let d=await co(e);return d.enabled?(Xt(t),Ea(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 sn(e){if(!ve()||rn(e).referral===!1||!uo(e))return!1;try{if((await co(e)).challengeReferredSignups!=="always")return!1;let n=await on(e);return!!(n!=null&&n.code)}catch{return!1}}var po=typeof window!="undefined",De=()=>typeof navigator!="undefined"?navigator:void 0;function D(e,t){try{return e()}catch{return t}}function Ta(){return D(()=>{if(!po||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 Ia(){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),cn(e.toDataURL())):null},null)}function Oa(){var l;let e=De(),t=po?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 La(){let e=De(),t=Ta(),n=Oa(),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 Da(){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 ln(){return D(()=>{let e=()=>{var r,o;return"d_"+cn(String(Math.random())+String(Date.now())+((o=(r=De())==null?void 0:r.userAgent)!=null?o:""))};if(Da())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 Fa(e){let t=[e.timezone,e.platform,e.languages.join(","),e.webglVendor,e.webglRenderer,e.screenWidth,e.screenHeight,e.colorDepth,e.hardwareConcurrency,Ia()];return cn(t.map(n=>n==null?"":String(n)).join("|"))}function cn(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,an=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:an(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:an(this.dwell),keyFlightVariance:an(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 fo(e){return D(async()=>{var a,d,c;let t=La(),n={attempt_id:e.attemptId,kind:(a=e.kind)!=null?a:"telemetry",device_id:ln(),device_fingerprint:Fa(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 Ma=["checkbox","scroll","link"];function j(e){return typeof e=="string"&&e!==""?e:null}function Ua(e){return typeof e=="number"&&Number.isFinite(e)?new Date(e).toISOString():j(e)}function un(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=j(t.key))!=null?a:j(t.policy),i=(d=j(r("version_id")))!=null?d:j(n==null?void 0:n.id);if(!o||!i)return null;let s=Ma.includes(t.display)?t.display:"checkbox",l=(c=j(typeof t.version=="string"?t.version:n==null?void 0:n.version))!=null?c:"";return{key:o,title:(u=j(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:j(r("content_html")),contentMarkdown:j(r("content_markdown")),contentUrl:j(r("content_url")),contentSha256:(f=j(r("content_sha256")))!=null?f:"",effectiveAt:Ua(r("effective_at")),summaryOfChanges:j(r("summary_of_changes")),reaccept:typeof t.reaccept=="boolean"?t.reaccept:null}}function $a(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(un).filter(r=>r!==null):[]}function pn(e){return!!(e!=null&&e.some(t=>t.code==="POLICY_ACCEPTANCE_REQUIRED"))}async function Fe(e,t={}){let n=await Ar(e,t.locale?{locale:t.locale}:{});if(!n.ok)return[];let r=$a(n.data);return t.signIn?r.filter(o=>o.appliesTo==="sign_in_and_sign_up"):r}function go(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 Na(e,t=2){return e.scrollHeight-e.clientHeight-e.scrollTop<=t}function fn(e,t,n){let r=!1,o=null,i=()=>{r||(r=!0,l(),n())},s=()=>{Na(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 za='a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])';function mo(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(za)).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 Ba(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function dn(e){let t=Ba(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 Ha(e){let t=e.replace(/\r\n?/g,`
@@ -35,7 +35,7 @@ self.onmessage = async function (e) {
35
35
  for (var i = 0; i < hs.length; i++) if (hex(hs[i]) === d.challenge) { self.postMessage({ n: start + i }); return; }
36
36
  }
37
37
  self.postMessage({ n: null });
38
- };`;async function cl(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 dl(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 al(e,0,e.maxnumber,n);if(o===null)throw new Error(n()?"captcha: cancelled":"captcha: no solution");return{n:o,worker:!1}}function dl(e,t,n){let r=URL.createObjectURL(new Blob([ll],{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 ul=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 pl(e){return`atlas1.${ul(JSON.stringify(e))}`}async function fl(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 $o(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 gl(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,$o(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($o(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 An(e,t){var p,g;let n={...ol,...t.labels},r=(p=t.mode)!=null?p:"managed",o=e.ownerDocument,i=(g=t.fetchChallenge)!=null?g:y=>t.challengeUrl?fl(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 S=Date.now(),E=cl(m,{workers:t.workers,cancelled:a}).then(C=>({...C,ms:Date.now()-S}));E.catch(()=>{});let A;if(m.interactive){let C=await gl(d,m,n,a);if(C==="accessible")return c(n.checking),u(!0);A=C,c(n.checking)}let{n:x,worker:b,ms:_}=await E;if(s)throw new Error("captcha: widget removed");return(r==="visible"||A!==void 0)&&c(n.verified),pl({t:m.token,n:x,ms:_,...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 ml=new Set(["atlas","turnstile","hcaptcha","recaptcha","recaptcha_v3","recaptcha_enterprise","captchafox","vercel_botid"]);function $e(e,t){return!e||!ml.has(e)?!1:e==="vercel_botid"?!!(t!=null&&t.attestationUrl):!0}function we(e){return!!e&&e.enabled===!0&&$e(e.provider,e)}var hl=["CAPTCHA_REQUIRED","CAPTCHA_FAILED"];function En(e){return!!e&&typeof e.code=="string"&&hl.includes(e.code)}var yl={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 No(e,t,n){let r=yl[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 bl(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 kl(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 vl(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 _l(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 zo(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 xl(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 Bo(e,t,n={}){var f,p,g,y,m,S,E,A,x;let r=(f=e.provider)!=null?f:"";if(r==="atlas")return An(t,{challengeUrl:e.challengeUrl,mode:(p=e.widget)!=null?p:"managed",...n.atlas});if(r==="vercel_botid"){let b=!1,_=(y=(g=t.ownerDocument)==null?void 0:g.defaultView)!=null?y:globalThis,C=e.attestationUrl?zo(e.attestationUrl,(m=_.fetch)==null?void 0:m.bind(_)).then(w=>{if(b)throw new Error("captcha: widget removed");return w}):Promise.reject(new Error("captcha: vercel_botid needs an attestationUrl"));return C.catch(()=>{}),{token:C,remove(){b=!0}}}let o=(S=e.siteKey)!=null?S:"",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,_)=>{d=_,No(r,o,s).then(C=>{if(l)throw new Error("captcha: widget removed");switch(r){case"turnstile":return bl(C,t,o,i,c);case"hcaptcha":return kl(C,t,o,i,c);case"recaptcha":return vl(C,t,o,i,c);case"recaptcha_v3":case"recaptcha_enterprise":return xl(C,o);case"captchafox":return _l(C,t,o,i,c);default:throw new Error(`captcha: ${r} is not renderable`)}}).then(b,_)}),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 Pn(e,t,n){return Bo(e,t,n).token}var wl="/v1/client/sign_ins/passkey/begin",Ho=async(e,t)=>{try{return await e(t)||null}catch{return null}};async function Rn(e,t={}){var a;let n=d=>e.post(wl,d?{captcha_token:d}:{}),r=(a=t.captcha)!=null?a:null,o=r?await Ho(r,{retry:!1}):null,i=await n(o);if(i.ok||!r)return i;let s=i.errors.find(d=>En(d));if(!s)return i;let l=await Ho(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 jo(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 Wo(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 Ko(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 Tu=Object.freeze({available:!0,passwordReset:!0,passwordSignUp:!0}),Vo="This app can't send email right now. Try another sign-in method or contact the app owner.";var ze=e=>!!e&&typeof e=="object"&&!Array.isArray(e);var Tn=Object.freeze({username:null,lastSignInMethod:!1,emailVerification:"code",passwordReset:"code",emailSecondFactor:!1,passkeySignUp:null}),qo=e=>e==="link"||e==="both"?e:"code";function In(e){var o;let t=ze(e)&&ze(e.account)?e.account:null;if(!t)return{...Tn};let n=ze(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:qo(t.email_verification),passwordReset:qo(t.password_reset),emailSecondFactor:t.email_second_factor===!0,...ze(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:ze(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 Go(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=Ks(Zo());var Xo=["auto","light","dark"],fe=["primary","primaryInk","accent","background","surface","text","muted","border","danger","success","inputBackground","inputText"],dt=["none","uppercase"],Qo={"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},ei=Object.keys(Qo),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"],ti=["linear","radial"],Ln=["cover","contain"],Dn=["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"],Fn=/^#[0-9a-fA-F]{6}$/,Mn=/^dasset_[0-9A-HJKMNP-TV-Z]{26}$/;var W="system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",wt="Georgia, Cambria, 'Times New Roman', Times, serif",Un="ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace",q="wght@400;500;600;700;800",ni=[{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:wt,google:null},{id:"system-mono",label:"System monospace",family:null,category:"monospace",fallback:Un,google:null},{id:"inter",label:"Inter",family:"Inter",category:"sans-serif",fallback:W,google:`Inter:${q}`},{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:${q}`},{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:${q}`},{id:"poppins",label:"Poppins",family:"Poppins",category:"sans-serif",fallback:W,google:`Poppins:${q}`},{id:"nunito",label:"Nunito",family:"Nunito",category:"sans-serif",fallback:W,google:`Nunito:${q}`},{id:"work-sans",label:"Work Sans",family:"Work Sans",category:"sans-serif",fallback:W,google:`Work+Sans:${q}`},{id:"dm-sans",label:"DM Sans",family:"DM Sans",category:"sans-serif",fallback:W,google:`DM+Sans:${q}`},{id:"manrope",label:"Manrope",family:"Manrope",category:"sans-serif",fallback:W,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:Un,google:`JetBrains+Mono:${q}`},{id:"ibm-plex-mono",label:"IBM Plex Mono",family:"IBM Plex Mono",category:"monospace",fallback:Un,google:"IBM+Plex+Mono:wght@400;500;600;700"}],ri=ni.map(e=>e.id),oi=new Map(ni.map(e=>[e.id,e])),Rl=/^custom-[a-f0-9]{32}$/;function St(e){return typeof e=="string"&&Rl.test(e)}function Tl(e){return`Brand ${e.slice(7,15)}`}function $n(e){return St(e)?{id:e,label:"Brand font",family:Tl(e),category:"sans-serif",fallback:W,google:null}:typeof e=="string"?oi.get(e):void 0}function Nn(e){var n;let t=(n=$n(e))!=null?n:oi.get("system");return t.family?`'${t.family}', ${t.fallback}`:t.fallback}function ii(e){if(St(e))return`/v1/design/fonts/${e}.css`;let t=$n(e);return t!=null&&t.google?`/v1/design/fonts/${t.id}.css`:null}var zn=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,ai=(e,t)=>n=>typeof n=="number"&&!Number.isNaN(n)&&n>=e&&n<=t,He=e=>typeof e=="string"&&Fn.test(e),Bn=e=>typeof e=="string"&&Mn.test(e);function se(e,t=[]){return n=>{if(!zn(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 Il=U(ri),si=e=>Il(e)||St(e),Hn={palette:Object.fromEntries(fe.map(e=>[e,He])),paletteDark:Object.fromEntries(fe.map(e=>[e,He])),typography:{font:si,headingFont:si,baseSize:X(12,20),headingWeight:X(400,800,100),bodyWeight:X(300,600,100),letterCase:U(dt),scale:U(ei)},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:Bn,darkAssetId:Bn}},Ol=e=>{if(!se({type:U(ti),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:ai(0,100)},["color","at"]))},Ll=se({assetId:Bn,fit:U(Ln),position:U(Dn),overlay:se({color:He,opacity:ai(0,1)},["color","opacity"]),blur:X(0,20)},["assetId"]),jn={color:He,gradient:Ol,image:Ll,pattern:U(Be)},je={version:e=>e===1,preset:U(xt),colorScheme:U(Xo),background:se(jn),backgroundDark:se(jn),...Object.fromEntries(Object.entries(Hn).map(([e,t])=>[e,se(t)]))};function li(e,t){return ge(je,e)&&je[e](t)}var ci=se(je);function di(e,t=()=>{},n=""){let r=(...i)=>[n,...i].filter(Boolean).join(".");if(e==null)return{};if(!zn(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(je,i)){t({path:r(i),message:"Unknown setting."});continue}if(je[i](s)){o[i]=s;continue}let l=ge(Hn,i)?Hn[i]:i==="background"||i==="backgroundDark"?jn:null;if(!l||!zn(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 Dl=new Set(["__proto__","constructor","prototype"]),ui=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function Wn(e,t){let n={...e};for(let[r,o]of Object.entries(t)){if(Dl.has(r)||o===void 0)continue;if(o===null){delete n[r];continue}let i=n[r];n[r]=ui(i)&&ui(o)?Wn(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 pi={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:{}},fi={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 Ae(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 Ct=e=>Ce(Math.round(e),0,255).toString(16).padStart(2,"0");function Et(e){return`#${Ct(e.r)}${Ct(e.g)}${Ct(e.b)}`}function Fl(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 At(e){let t=Ae(e);return t?Fl(t):null}function We(e,t){let n=At(e),r=At(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 Ml=4.5,Ul=3;function gi(e){var t;return((t=At(e))!=null?t:0)>.179?"#111827":"#ffffff"}function $l(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 Nl(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=>Ct(Ce(l,0,1)*255)).join("")}`}function zl(e,t,n=Ml){var u;let r=Ae(e);if(!r||t.length===0)return e;let o=f=>t.every(p=>We(f,p)>=n);if(o(e))return e;let s=((u=At(t[0]))!=null?u:1)>.179?-.01:.01,[l,a,d]=$l(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=Nl(l,a,p),o(c))return c}return c}function mi(e,t){return zl(e,t,Ul)}var Bl=["primary","accent","danger","success"],le=e=>JSON.parse(JSON.stringify(e));function yi(e){if(!e||typeof e!="object"||Array.isArray(e))return{};if(ci(e))return le(e);let t={};for(let[n,r]of Object.entries(e))r!==void 0&&li(n,r)&&(t[n]=le(r));return t}function hi(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=gi(t.primary)),n}function Kn(e,t,n){var i,s,l;t.colorScheme&&(e.colorScheme=t.colorScheme);let r=e.palette;e.palette=hi(e.palette,t.palette);let o=t.paletteDark?{...t.paletteDark}:void 0;if(n.carryBrand&&t.palette){for(let a of Bl){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=hi(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 qn(e){return typeof e=="string"&&xt.includes(e)}function Ke(e){let t=yi(e),n=qn(t.preset)?t.preset:"minimal",r=le(pi);return r.preset=n,Kn(r,fi[n].design,{carryBrand:!1}),Kn(r,t,{carryBrand:!0}),r}function bi(e,t){let n=Ke(e),r=yi(t);return delete r.preset,Kn(n,r,{carryBrand:!0}),n}var Hl=Object.freeze({"--atlas-color-primary":"--atlas-host-accent","--atlas-color-primary-ink":"--atlas-host-accent-ink","--atlas-color-surface":"--atlas-host-surface","--atlas-card-background":"--atlas-host-surface","--atlas-color-text":"--atlas-host-ink","--atlas-color-border":"--atlas-host-line","--atlas-radius-control":"--atlas-host-radius","--atlas-font-body":"--atlas-host-font","--atlas-focus-outline-color":"--atlas-host-focus-ring"});function Vn(e){var o,i,s,l,a,d,c,u,f,p,g,y,m,S;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,(S=e==null?void 0:e.typography)==null?void 0:S.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 ki(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=ii(o);i&&t.add(i)}return[...t]}var mf=Object.freeze([...new Set(Object.values(Hl))]);function Gn(){try{return typeof process!="undefined"&&!1}catch{return!1}}var _i=e=>{Gn()&&console.warn(`[atlas] ${e}`)},vi=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function jl(e,t=_i,n="design"){return e!=null&&(typeof e!="object"||Array.isArray(e))?(t(`${n} must be an object; ignored.`),{}):di(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 xi(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 Wl=/^(?:https:\/\/[A-Za-z0-9.-]+(?::\d{1,5})?|http:\/\/(?:localhost|127\.0\.0\.1)(?::\d{1,5})?)$/;function Kl(e,t){let n=(t!=null?t:"").replace(/\/+$/,"");return n&&!Wl.test(n)?[]:ki(e).map(r=>`${n}${r}`)}function ql(e){if(!(!vi(e)||!vi(e.resolved)))return e.resolved}function wi(e){var d,c,u;let t=(d=e.warn)!=null?d:_i,n=ql(e.instance),r=jl(e.design,t,"appearance.design"),o,i=(c=e.preset)!=null?c:r.preset;i!==void 0&&(qn(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=Wn((u=e.tokensDesign)!=null?u:{},r);return bi(l,a)}function Si(e,t){return Kl(e,t)}var Ci=null;function Vl(e){var t,n;if(Ci)return Ci;try{let r=(t=e.querySelector)==null?void 0:t.call(e,'meta[name="csp-nonce"]'),o=r==null?void 0:r.getAttribute("content");if(o)return o;let i=(n=e.querySelector)==null?void 0:n.call(e,"script[nonce]"),s=i?i.nonce||i.getAttribute("nonce"):null;if(s)return s}catch{}return null}var Ai=new WeakMap,Ei=new WeakMap;function Pt(e,t){let n=Vl(e);if(n){t.setAttribute("nonce",n);try{t.nonce=n}catch{}}}function Rt(e,t,n){var o;let r=globalThis.CSSStyleSheet;if(r&&Array.isArray(e.adoptedStyleSheets)&&typeof((o=r.prototype)==null?void 0:o.replaceSync)=="function")try{let i=Ai.get(e);i||Ai.set(e,i=new Map);let s=Ei.get(e);s||Ei.set(e,s=new Map),s.set(t,n);let l=i.get(t);return l?l.replaceSync(n):(l=new r,i.set(t,l),l.replaceSync(n),e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]),!0}catch{}return!1}var Pi=new Set,Ri=e=>{var t;!Gn()||Pi.has(e)||(Pi.add(e),(t=globalThis.console)==null||t.warn(`[atlas] ${e}`))};function Ti(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 Ii(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){let s=e;if(!Rt(s,`design:${n.key}`,n.css)&&!Array.from(e.head.querySelectorAll("style[data-atlas-design]")).some(a=>a.getAttribute("data-atlas-design")===n.key)){let a=e.createElement("style");a.setAttribute("data-atlas-design",n.key),Pt(s,a),a.textContent=n.css,e.head.appendChild(a)}}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 Gl=["boxes","single"];function Li(e,t){for(let n of[t,e])if(n&&Gl.includes(n))return n;return"boxes"}var Di=8,Yl=["solid","outline","soft","ghost"],Jl=["none","scale","lift","glow","ripple"],Zl=["none","sm","md","lg"],Xl=["comfortable","compact"],Ql=["outline","filled","underline"],ec=["slow","normal","fast"],tc=["spinner","skeleton","dots","bar"],Fi={slow:280,normal:160,fast:80};function Tt(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(Yl,"solid",t==null?void 0:t.buttonStyle,e==null?void 0:e.buttonStyle),buttonEffect:n(Jl,"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(Xl,"comfortable",t==null?void 0:t.density,e==null?void 0:e.density),inputStyle:n(Ql,"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(ec,"normal",t==null?void 0:t.motionSpeed,e==null?void 0:e.motionSpeed),loading:n(tc,"spinner",t==null?void 0:t.loading,e==null?void 0:e.loading)}}var nc=["block","compact","icon"],rc=["sm","md","lg"],oc=["list","grid","carousel"],ic=["auto","always","never"];function Yn(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(nc,t==null?void 0:t.variant,e==null?void 0:e.variant),size:n(rc,(r=t==null?void 0:t.size)!=null?r:"md",e==null?void 0:e.size,"md"),layout:n(oc,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(ic,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 sc(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 Mi(e,t){var o;let n={...sc(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 Ui(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 $i(e){let t=Ae(e);if(!t)return"#ffffff";let n=Et(t);return We("#ffffff",n)>=We("#111111",n)?"#ffffff":"#111111"}function Ni(e,t){let n=Ae(e);if(!n)return e;let r=Et(n),o=t.map(i=>Ae(i)).filter(i=>!!i&&i.a>0).map(Et);return o.length===0||o.every(i=>We(r,i)>=3)?e:mi(r,o)}function zi(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 Bi(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 Oi={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 It(e){return Oi[e]?Oi[e]:e.split(/[_-]/).map(t=>t&&t[0].toUpperCase()+t.slice(1)).join(" ")}var ac="0.11.0",Hi={name:"@atlasauth/embed",version:ac};function lc(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 ji(e){var n;let t=(n=e.fetchImpl)!=null?n:fetch;return new tt({publishableKey:e.publishableKey,baseUrl:e.frontendApi.replace(/\/$/,""),fetchImpl:lc(e.publishableKey,t),locale:e.locale,sdk:Hi,referral:e.referral,referralConsent:e.referralConsent})}async function Wi(e){let t=await e.get("/v1/appearance");return t.ok?t.data:null}var Jn="atlas-embed-styles",Ki=`
38
+ };`;async function cl(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 dl(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 al(e,0,e.maxnumber,n);if(o===null)throw new Error(n()?"captcha: cancelled":"captcha: no solution");return{n:o,worker:!1}}function dl(e,t,n){let r=URL.createObjectURL(new Blob([ll],{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 ul=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 pl(e){return`atlas1.${ul(JSON.stringify(e))}`}async function fl(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 $o(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 gl(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,$o(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($o(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 An(e,t){var p,g;let n={...ol,...t.labels},r=(p=t.mode)!=null?p:"managed",o=e.ownerDocument,i=(g=t.fetchChallenge)!=null?g:y=>t.challengeUrl?fl(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 S=Date.now(),E=cl(m,{workers:t.workers,cancelled:a}).then(C=>({...C,ms:Date.now()-S}));E.catch(()=>{});let A;if(m.interactive){let C=await gl(d,m,n,a);if(C==="accessible")return c(n.checking),u(!0);A=C,c(n.checking)}let{n:x,worker:b,ms:_}=await E;if(s)throw new Error("captcha: widget removed");return(r==="visible"||A!==void 0)&&c(n.verified),pl({t:m.token,n:x,ms:_,...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 ml=new Set(["atlas","turnstile","hcaptcha","recaptcha","recaptcha_v3","recaptcha_enterprise","captchafox","vercel_botid"]);function $e(e,t){return!e||!ml.has(e)?!1:e==="vercel_botid"?!!(t!=null&&t.attestationUrl):!0}function we(e){return!!e&&e.enabled===!0&&$e(e.provider,e)}var hl=["CAPTCHA_REQUIRED","CAPTCHA_FAILED"];function En(e){return!!e&&typeof e.code=="string"&&hl.includes(e.code)}var yl={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 No(e,t,n){let r=yl[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 bl(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 kl(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 vl(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 _l(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 zo(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 xl(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 Bo(e,t,n={}){var f,p,g,y,m,S,E,A,x;let r=(f=e.provider)!=null?f:"";if(r==="atlas")return An(t,{challengeUrl:e.challengeUrl,mode:(p=e.widget)!=null?p:"managed",...n.atlas});if(r==="vercel_botid"){let b=!1,_=(y=(g=t.ownerDocument)==null?void 0:g.defaultView)!=null?y:globalThis,C=e.attestationUrl?zo(e.attestationUrl,(m=_.fetch)==null?void 0:m.bind(_)).then(w=>{if(b)throw new Error("captcha: widget removed");return w}):Promise.reject(new Error("captcha: vercel_botid needs an attestationUrl"));return C.catch(()=>{}),{token:C,remove(){b=!0}}}let o=(S=e.siteKey)!=null?S:"",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,_)=>{d=_,No(r,o,s).then(C=>{if(l)throw new Error("captcha: widget removed");switch(r){case"turnstile":return bl(C,t,o,i,c);case"hcaptcha":return kl(C,t,o,i,c);case"recaptcha":return vl(C,t,o,i,c);case"recaptcha_v3":case"recaptcha_enterprise":return xl(C,o);case"captchafox":return _l(C,t,o,i,c);default:throw new Error(`captcha: ${r} is not renderable`)}}).then(b,_)}),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 Pn(e,t,n){return Bo(e,t,n).token}var wl="/v1/client/sign_ins/passkey/begin",Ho=async(e,t)=>{try{return await e(t)||null}catch{return null}};async function Rn(e,t={}){var a;let n=d=>e.post(wl,d?{captcha_token:d}:{}),r=(a=t.captcha)!=null?a:null,o=r?await Ho(r,{retry:!1}):null,i=await n(o);if(i.ok||!r)return i;let s=i.errors.find(d=>En(d));if(!s)return i;let l=await Ho(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 jo(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 Wo(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 Ko(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 Tu=Object.freeze({available:!0,passwordReset:!0,passwordSignUp:!0}),Vo="This app can't send email right now. Try another sign-in method or contact the app owner.";var ze=e=>!!e&&typeof e=="object"&&!Array.isArray(e);var Tn=Object.freeze({username:null,lastSignInMethod:!1,emailVerification:"code",passwordReset:"code",emailSecondFactor:!1,passkeySignUp:null}),qo=e=>e==="link"||e==="both"?e:"code";function In(e){var o;let t=ze(e)&&ze(e.account)?e.account:null;if(!t)return{...Tn};let n=ze(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:qo(t.email_verification),passwordReset:qo(t.password_reset),emailSecondFactor:t.email_second_factor===!0,...ze(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:ze(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 Go(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=Ks(Zo());var Xo=["auto","light","dark"],fe=["primary","primaryInk","accent","background","surface","text","muted","border","danger","success","inputBackground","inputText"],dt=["none","uppercase"],Qo={"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},ei=Object.keys(Qo),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"],ti=["linear","radial"],Ln=["cover","contain"],Dn=["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"],Fn=/^#[0-9a-fA-F]{6}$/,Mn=/^dasset_[0-9A-HJKMNP-TV-Z]{26}$/;var W="system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",wt="Georgia, Cambria, 'Times New Roman', Times, serif",Un="ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace",q="wght@400;500;600;700;800",ni=[{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:wt,google:null},{id:"system-mono",label:"System monospace",family:null,category:"monospace",fallback:Un,google:null},{id:"inter",label:"Inter",family:"Inter",category:"sans-serif",fallback:W,google:`Inter:${q}`},{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:${q}`},{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:${q}`},{id:"poppins",label:"Poppins",family:"Poppins",category:"sans-serif",fallback:W,google:`Poppins:${q}`},{id:"nunito",label:"Nunito",family:"Nunito",category:"sans-serif",fallback:W,google:`Nunito:${q}`},{id:"work-sans",label:"Work Sans",family:"Work Sans",category:"sans-serif",fallback:W,google:`Work+Sans:${q}`},{id:"dm-sans",label:"DM Sans",family:"DM Sans",category:"sans-serif",fallback:W,google:`DM+Sans:${q}`},{id:"manrope",label:"Manrope",family:"Manrope",category:"sans-serif",fallback:W,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:Un,google:`JetBrains+Mono:${q}`},{id:"ibm-plex-mono",label:"IBM Plex Mono",family:"IBM Plex Mono",category:"monospace",fallback:Un,google:"IBM+Plex+Mono:wght@400;500;600;700"}],ri=ni.map(e=>e.id),oi=new Map(ni.map(e=>[e.id,e])),Rl=/^custom-[a-f0-9]{32}$/;function St(e){return typeof e=="string"&&Rl.test(e)}function Tl(e){return`Brand ${e.slice(7,15)}`}function $n(e){return St(e)?{id:e,label:"Brand font",family:Tl(e),category:"sans-serif",fallback:W,google:null}:typeof e=="string"?oi.get(e):void 0}function Nn(e){var n;let t=(n=$n(e))!=null?n:oi.get("system");return t.family?`'${t.family}', ${t.fallback}`:t.fallback}function ii(e){if(St(e))return`/v1/design/fonts/${e}.css`;let t=$n(e);return t!=null&&t.google?`/v1/design/fonts/${t.id}.css`:null}var zn=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,ai=(e,t)=>n=>typeof n=="number"&&!Number.isNaN(n)&&n>=e&&n<=t,He=e=>typeof e=="string"&&Fn.test(e),Bn=e=>typeof e=="string"&&Mn.test(e);function se(e,t=[]){return n=>{if(!zn(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 Il=U(ri),si=e=>Il(e)||St(e),Hn={palette:Object.fromEntries(fe.map(e=>[e,He])),paletteDark:Object.fromEntries(fe.map(e=>[e,He])),typography:{font:si,headingFont:si,baseSize:X(12,20),headingWeight:X(400,800,100),bodyWeight:X(300,600,100),letterCase:U(dt),scale:U(ei)},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:Bn,darkAssetId:Bn}},Ol=e=>{if(!se({type:U(ti),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:ai(0,100)},["color","at"]))},Ll=se({assetId:Bn,fit:U(Ln),position:U(Dn),overlay:se({color:He,opacity:ai(0,1)},["color","opacity"]),blur:X(0,20)},["assetId"]),jn={color:He,gradient:Ol,image:Ll,pattern:U(Be)},je={version:e=>e===1,preset:U(xt),colorScheme:U(Xo),background:se(jn),backgroundDark:se(jn),...Object.fromEntries(Object.entries(Hn).map(([e,t])=>[e,se(t)]))};function li(e,t){return ge(je,e)&&je[e](t)}var ci=se(je);function di(e,t=()=>{},n=""){let r=(...i)=>[n,...i].filter(Boolean).join(".");if(e==null)return{};if(!zn(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(je,i)){t({path:r(i),message:"Unknown setting."});continue}if(je[i](s)){o[i]=s;continue}let l=ge(Hn,i)?Hn[i]:i==="background"||i==="backgroundDark"?jn:null;if(!l||!zn(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 Dl=new Set(["__proto__","constructor","prototype"]),ui=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function Wn(e,t){let n={...e};for(let[r,o]of Object.entries(t)){if(Dl.has(r)||o===void 0)continue;if(o===null){delete n[r];continue}let i=n[r];n[r]=ui(i)&&ui(o)?Wn(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 pi={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:{}},fi={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 Ae(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 Ct=e=>Ce(Math.round(e),0,255).toString(16).padStart(2,"0");function Et(e){return`#${Ct(e.r)}${Ct(e.g)}${Ct(e.b)}`}function Fl(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 At(e){let t=Ae(e);return t?Fl(t):null}function We(e,t){let n=At(e),r=At(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 Ml=4.5,Ul=3;function gi(e){var t;return((t=At(e))!=null?t:0)>.179?"#111827":"#ffffff"}function $l(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 Nl(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=>Ct(Ce(l,0,1)*255)).join("")}`}function zl(e,t,n=Ml){var u;let r=Ae(e);if(!r||t.length===0)return e;let o=f=>t.every(p=>We(f,p)>=n);if(o(e))return e;let s=((u=At(t[0]))!=null?u:1)>.179?-.01:.01,[l,a,d]=$l(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=Nl(l,a,p),o(c))return c}return c}function mi(e,t){return zl(e,t,Ul)}var Bl=["primary","accent","danger","success"],le=e=>JSON.parse(JSON.stringify(e));function yi(e){if(!e||typeof e!="object"||Array.isArray(e))return{};if(ci(e))return le(e);let t={};for(let[n,r]of Object.entries(e))r!==void 0&&li(n,r)&&(t[n]=le(r));return t}function hi(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=gi(t.primary)),n}function Kn(e,t,n){var i,s,l;t.colorScheme&&(e.colorScheme=t.colorScheme);let r=e.palette;e.palette=hi(e.palette,t.palette);let o=t.paletteDark?{...t.paletteDark}:void 0;if(n.carryBrand&&t.palette){for(let a of Bl){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=hi(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 qn(e){return typeof e=="string"&&xt.includes(e)}function Ke(e){let t=yi(e),n=qn(t.preset)?t.preset:"minimal",r=le(pi);return r.preset=n,Kn(r,fi[n].design,{carryBrand:!1}),Kn(r,t,{carryBrand:!0}),r}function bi(e,t){let n=Ke(e),r=yi(t);return delete r.preset,Kn(n,r,{carryBrand:!0}),n}var Hl=Object.freeze({"--atlas-color-primary":"--atlas-host-accent","--atlas-color-primary-ink":"--atlas-host-accent-ink","--atlas-color-surface":"--atlas-host-surface","--atlas-card-background":"--atlas-host-surface","--atlas-color-text":"--atlas-host-ink","--atlas-color-border":"--atlas-host-line","--atlas-radius-control":"--atlas-host-radius","--atlas-font-body":"--atlas-host-font","--atlas-focus-outline-color":"--atlas-host-focus-ring"});function Vn(e){var o,i,s,l,a,d,c,u,f,p,g,y,m,S;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,(S=e==null?void 0:e.typography)==null?void 0:S.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 ki(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=ii(o);i&&t.add(i)}return[...t]}var mf=Object.freeze([...new Set(Object.values(Hl))]);function Gn(){try{return typeof process!="undefined"&&!1}catch{return!1}}var _i=e=>{Gn()&&console.warn(`[atlas] ${e}`)},vi=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function jl(e,t=_i,n="design"){return e!=null&&(typeof e!="object"||Array.isArray(e))?(t(`${n} must be an object; ignored.`),{}):di(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 xi(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 Wl=/^(?:https:\/\/[A-Za-z0-9.-]+(?::\d{1,5})?|http:\/\/(?:localhost|127\.0\.0\.1)(?::\d{1,5})?)$/;function Kl(e,t){let n=(t!=null?t:"").replace(/\/+$/,"");return n&&!Wl.test(n)?[]:ki(e).map(r=>`${n}${r}`)}function ql(e){if(!(!vi(e)||!vi(e.resolved)))return e.resolved}function wi(e){var d,c,u;let t=(d=e.warn)!=null?d:_i,n=ql(e.instance),r=jl(e.design,t,"appearance.design"),o,i=(c=e.preset)!=null?c:r.preset;i!==void 0&&(qn(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=Wn((u=e.tokensDesign)!=null?u:{},r);return bi(l,a)}function Si(e,t){return Kl(e,t)}var Ci=null;function Vl(e){var t,n;if(Ci)return Ci;try{let r=(t=e.querySelector)==null?void 0:t.call(e,'meta[name="csp-nonce"]'),o=r==null?void 0:r.getAttribute("content");if(o)return o;let i=(n=e.querySelector)==null?void 0:n.call(e,"script[nonce]"),s=i?i.nonce||i.getAttribute("nonce"):null;if(s)return s}catch{}return null}var Ai=new WeakMap,Ei=new WeakMap;function Pt(e,t){let n=Vl(e);if(n){t.setAttribute("nonce",n);try{t.nonce=n}catch{}}}function Rt(e,t,n){var o;let r=globalThis.CSSStyleSheet;if(r&&Array.isArray(e.adoptedStyleSheets)&&typeof((o=r.prototype)==null?void 0:o.replaceSync)=="function")try{let i=Ai.get(e);i||Ai.set(e,i=new Map);let s=Ei.get(e);s||Ei.set(e,s=new Map),s.set(t,n);let l=i.get(t);return l?l.replaceSync(n):(l=new r,i.set(t,l),l.replaceSync(n),e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]),!0}catch{}return!1}var Pi=new Set,Ri=e=>{var t;!Gn()||Pi.has(e)||(Pi.add(e),(t=globalThis.console)==null||t.warn(`[atlas] ${e}`))};function Ti(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 Ii(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){let s=e;if(!Rt(s,`design:${n.key}`,n.css)&&!Array.from(e.head.querySelectorAll("style[data-atlas-design]")).some(a=>a.getAttribute("data-atlas-design")===n.key)){let a=e.createElement("style");a.setAttribute("data-atlas-design",n.key),Pt(s,a),a.textContent=n.css,e.head.appendChild(a)}}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 Gl=["boxes","single"];function Li(e,t){for(let n of[t,e])if(n&&Gl.includes(n))return n;return"boxes"}var Di=8,Yl=["solid","outline","soft","ghost"],Jl=["none","scale","lift","glow","ripple"],Zl=["none","sm","md","lg"],Xl=["comfortable","compact"],Ql=["outline","filled","underline"],ec=["slow","normal","fast"],tc=["spinner","skeleton","dots","bar"],Fi={slow:280,normal:160,fast:80};function Tt(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(Yl,"solid",t==null?void 0:t.buttonStyle,e==null?void 0:e.buttonStyle),buttonEffect:n(Jl,"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(Xl,"comfortable",t==null?void 0:t.density,e==null?void 0:e.density),inputStyle:n(Ql,"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(ec,"normal",t==null?void 0:t.motionSpeed,e==null?void 0:e.motionSpeed),loading:n(tc,"spinner",t==null?void 0:t.loading,e==null?void 0:e.loading)}}var nc=["block","compact","icon"],rc=["sm","md","lg"],oc=["list","grid","carousel"],ic=["auto","always","never"];function Yn(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(nc,t==null?void 0:t.variant,e==null?void 0:e.variant),size:n(rc,(r=t==null?void 0:t.size)!=null?r:"md",e==null?void 0:e.size,"md"),layout:n(oc,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(ic,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 sc(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 Mi(e,t){var o;let n={...sc(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 Ui(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 $i(e){let t=Ae(e);if(!t)return"#ffffff";let n=Et(t);return We("#ffffff",n)>=We("#111111",n)?"#ffffff":"#111111"}function Ni(e,t){let n=Ae(e);if(!n)return e;let r=Et(n),o=t.map(i=>Ae(i)).filter(i=>!!i&&i.a>0).map(Et);return o.length===0||o.every(i=>We(r,i)>=3)?e:mi(r,o)}function zi(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 Bi(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 Oi={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 It(e){return Oi[e]?Oi[e]:e.split(/[_-]/).map(t=>t&&t[0].toUpperCase()+t.slice(1)).join(" ")}var ac="0.13.0",Hi={name:"@atlasauth/embed",version:ac};function lc(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 ji(e){var n;let t=(n=e.fetchImpl)!=null?n:fetch;return new tt({publishableKey:e.publishableKey,baseUrl:e.frontendApi.replace(/\/$/,""),fetchImpl:lc(e.publishableKey,t),locale:e.locale,sdk:Hi,referral:e.referral,referralConsent:e.referralConsent})}async function Wi(e){let t=await e.get("/v1/appearance");return t.ok?t.data:null}var Jn="atlas-embed-styles",Ki=`
39
39
  /* The host page's --atlas-host-* variables (shared UI-kit names) restyle the widget
40
40
  where the page sets them; explicit --atlas-embed-* settings still win. */
41
41
  .atlas-embed-root {
package/dist/version.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import type { AtlasSdkInfo } from '@atlasauth/js';
2
2
  /** This package's version, sent as `X-Atlas-SDK` (kept in step with package.json by a test). */
3
- export declare const ATLAS_EMBED_VERSION = "0.11.0";
3
+ export declare const ATLAS_EMBED_VERSION = "0.13.0";
4
4
  export declare const ATLAS_EMBED_SDK: AtlasSdkInfo;
package/dist/version.js CHANGED
@@ -2,6 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ATLAS_EMBED_SDK = exports.ATLAS_EMBED_VERSION = void 0;
4
4
  /** This package's version, sent as `X-Atlas-SDK` (kept in step with package.json by a test). */
5
- exports.ATLAS_EMBED_VERSION = '0.11.0';
5
+ exports.ATLAS_EMBED_VERSION = '0.13.0';
6
6
  exports.ATLAS_EMBED_SDK = { name: '@atlasauth/embed', version: exports.ATLAS_EMBED_VERSION };
7
7
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@atlasauth/embed",
3
- "version": "0.12.0",
3
+ "version": "0.13.0",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "dependencies": {
7
7
  "@atlasauth/design": "0.3.0",
8
- "@atlasauth/js": "0.20.0"
8
+ "@atlasauth/js": "0.21.0"
9
9
  },
10
10
  "devDependencies": {
11
11
  "esbuild": "^0.21.5",
@@ -18,6 +18,7 @@
18
18
  },
19
19
  "files": [
20
20
  "dist",
21
+ "!dist/*.tsbuildinfo",
21
22
  "README.md",
22
23
  "CHANGELOG.md"
23
24
  ],