@toa.io/extensions.configuration 1.0.0-alpha.31 → 1.0.0-alpha.310
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/components/configuration.values/manifest.toa.yaml +151 -0
- package/components/configuration.values/migrations/0002-indexes.yaml +7 -0
- package/components/configuration.values/operations/create.js +32 -0
- package/components/configuration.values/operations/fetch.js +13 -0
- package/components/configuration.values/operations/get.js +19 -0
- package/components/configuration.values/operations/lib/map.js +22 -0
- package/components/configuration.values/operations/lib/resolve.js +24 -0
- package/components/configuration.values/operations/list.js +11 -0
- package/components/configuration.values/source/create.ts +56 -0
- package/components/configuration.values/source/fetch.ts +26 -0
- package/components/configuration.values/source/get.ts +32 -0
- package/components/configuration.values/source/lib/map.ts +36 -0
- package/components/configuration.values/source/lib/resolve.ts +57 -0
- package/components/configuration.values/source/list.ts +21 -0
- package/components/configuration.values/tsconfig.json +10 -0
- package/components/configuration.values/types/index.d.ts +3 -0
- package/components/configuration.values/types/toa.d.ts +69 -0
- package/package.json +21 -10
- package/readme.md +178 -50
- package/transpiled/Aspect.d.ts +19 -4
- package/transpiled/Aspect.js +62 -9
- package/transpiled/Aspect.js.map +1 -1
- package/transpiled/Client.d.ts +59 -0
- package/transpiled/Client.js +171 -0
- package/transpiled/Client.js.map +1 -0
- package/transpiled/Composition.d.ts +14 -0
- package/transpiled/Composition.js +38 -0
- package/transpiled/Composition.js.map +1 -0
- package/transpiled/Factory.d.ts +9 -2
- package/transpiled/Factory.js +21 -9
- package/transpiled/Factory.js.map +1 -1
- package/transpiled/Secret.d.ts +15 -0
- package/transpiled/Secret.js +26 -0
- package/transpiled/Secret.js.map +1 -0
- package/transpiled/UI.d.ts +25 -0
- package/transpiled/UI.js +173 -0
- package/transpiled/UI.js.map +1 -0
- package/transpiled/configuration.d.ts +7 -2
- package/transpiled/configuration.js +33 -43
- package/transpiled/configuration.js.map +1 -1
- package/transpiled/index.d.ts +3 -3
- package/transpiled/index.js +4 -9
- package/transpiled/index.js.map +1 -1
- package/ui/dist/_app/env.js +1 -0
- package/ui/dist/_app/immutable/assets/0.BGFdDICE.css +2 -0
- package/ui/dist/_app/immutable/assets/ui.BghF56l_.css +1 -0
- package/ui/dist/_app/immutable/chunks/Bjy-W4x2.js +81 -0
- package/ui/dist/_app/immutable/chunks/BkLAzDsj.js +1 -0
- package/ui/dist/_app/immutable/chunks/C_aaOW6e.js +1 -0
- package/ui/dist/_app/immutable/chunks/CcD_ISxM.js +3 -0
- package/ui/dist/_app/immutable/chunks/Ccdp29n0.js +6 -0
- package/ui/dist/_app/immutable/chunks/Dw75U_Lh.js +50 -0
- package/ui/dist/_app/immutable/chunks/sXOccAdQ.js +8 -0
- package/ui/dist/_app/immutable/chunks/xihTtKlq.js +1 -0
- package/ui/dist/_app/immutable/entry/app.DgOXi1S4.js +2 -0
- package/ui/dist/_app/immutable/entry/start.C5YMpV87.js +1 -0
- package/ui/dist/_app/immutable/nodes/0.BGAo0V8q.js +1 -0
- package/ui/dist/_app/immutable/nodes/1.DYGSbNvw.js +1 -0
- package/ui/dist/_app/immutable/nodes/2.nR_WPY04.js +1 -0
- package/ui/dist/_app/immutable/nodes/3.p9Hd9gcE.js +1 -0
- package/ui/dist/_app/immutable/nodes/4.Chf5nqMR.js +1 -0
- package/ui/dist/_app/version.json +1 -0
- package/ui/dist/apple-touch-icon.png +0 -0
- package/ui/dist/favicon-96x96.png +0 -0
- package/ui/dist/favicon.ico +0 -0
- package/ui/dist/index.html +57 -0
- package/ui/dist/robots.txt +3 -0
- package/notes/consistency.md +0 -69
- package/schemas/annotation.cos.yaml +0 -1
- package/schemas/manifest.cos.yaml +0 -2
- package/source/Aspect.test.ts +0 -15
- package/source/Aspect.ts +0 -23
- package/source/Factory.ts +0 -12
- package/source/configuration.test.ts +0 -90
- package/source/configuration.ts +0 -59
- package/source/deployment.test.ts +0 -21
- package/source/deployment.ts +0 -86
- package/source/index.ts +0 -3
- package/source/manifest.test.ts +0 -15
- package/source/manifest.ts +0 -15
- package/source/schemas.ts +0 -9
- package/transpiled/Aspect.test.d.ts +0 -1
- package/transpiled/Aspect.test.js +0 -15
- package/transpiled/Aspect.test.js.map +0 -1
- package/transpiled/configuration.test.d.ts +0 -1
- package/transpiled/configuration.test.js +0 -64
- package/transpiled/configuration.test.js.map +0 -1
- package/transpiled/deployment.d.ts +0 -8
- package/transpiled/deployment.js +0 -88
- package/transpiled/deployment.js.map +0 -1
- package/transpiled/deployment.test.d.ts +0 -1
- package/transpiled/deployment.test.js +0 -18
- package/transpiled/deployment.test.js.map +0 -1
- package/transpiled/manifest.d.ts +0 -6
- package/transpiled/manifest.js +0 -35
- package/transpiled/manifest.js.map +0 -1
- package/transpiled/manifest.test.d.ts +0 -1
- package/transpiled/manifest.test.js +0 -14
- package/transpiled/manifest.test.js.map +0 -1
- package/transpiled/schemas.d.ts +0 -3
- package/transpiled/schemas.js +0 -33
- package/transpiled/schemas.js.map +0 -1
- package/transpiled/tsconfig.tsbuildinfo +0 -1
- package/tsconfig.json +0 -9
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{$ as e,A as t,B as n,Dt as r,E as i,Et as a,J as o,L as s,M as c,N as l,P as u,Q as d,R as f,S as p,Tt as m,a as h,b as g,bt as _,c as v,d as y,dt as b,et as x,i as S,it as C,j as w,k as T,kt as E,l as D,m as O,n as ee,nt as te,o as k,ot as A,p as j,pt as ne,q as M,s as N,st as P,tt as F,u as I,ut as L,v as R,w as z,x as re,y as B,yt as V}from"./CcD_ISxM.js";import"./BkLAzDsj.js";import"./xihTtKlq.js";import{A as ie,C as ae,D as oe,E as se,O as ce,_ as le,a as ue,c as de,d as fe,f as pe,g as me,h as he,i as ge,j as H,l as _e,m as ve,n as ye,p as be,s as xe,u as Se,w as Ce,x as we}from"./Ccdp29n0.js";import{A as Te,B as Ee,C as De,D as Oe,E as ke,F as Ae,G as je,H as U,I as W,L as Me,M as G,N as Ne,O as Pe,P as Fe,R as Ie,S as Le,T as K,U as Re,V as ze,W as q,b as Be,d as Ve,f as He,g as Ue,h as We,j as Ge,k as Ke,m as qe,p as Je,u as J,v as Ye,w as Xe,x as Ze,y as Qe,z as $e}from"./Dw75U_Lh.js";var et=new Set([`$$slots`,`$$events`,`$$legacy`]);function tt(e,t){let n=h(t,et),r=[[`path`,{d:`m16 17 5-5-5-5`}],[`path`,{d:`M21 12H9`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`}]];H(e,k({name:`log-out`},()=>n,{get iconNode(){return r}}))}var nt=new Set([`$$slots`,`$$events`,`$$legacy`,`class`,`role`,`name`,`color`,`stroke`,`aria-label`]);function Y(e,t){_(t,!0);let r=S(t,`role`,3,`status`),i=S(t,`aria-label`,3,`Loading`),a=h(t,nt);{let o=P(()=>t.name===null?void 0:t.name),s=P(()=>t.color===null?void 0:t.color),c=P(()=>t.stroke===null?void 0:t.stroke),l=P(()=>q(`size-4 animate-spin`,t.class));ie(e,k({get role(){return r()},get name(){return n(o)},get color(){return n(s)},get stroke(){return n(c)},get"aria-label"(){return i()},get class(){return n(l)}},()=>a))}V()}var rt={"en-US":{auth:{signupTitle:`One-tap sign-up`,passwordTitle:`Hop in with password`,passwordDescription:`Create an account or sign in`,passkey:`Passkeys`,email:`Email`,alreadyHaveAccount:`Already have an account?`,betterSecurity:`Better security`,passkeysNotSupported:`Passkeys not supported`,passkeysWarning:`Your browser does not respect your privacy and security.`,learnMore:`Learn more`,passwordBlank:`Leave password blank <nobr>to receive</nobr> <nobr>a one-time</nobr> passcode.`,otpInstructions:`Enter the code sent to your email. It expires in 5 minutes.`,continueWith:e=>`Continue with ${e}`,passkeysDescription:`Passkeys are safer than passwords, easier to use, and can’t be stolen.`,yourName:`Your name`,password:`Password`,refresh:{description:e=>`${e?e+`, for`:`For`} security reasons, your credentials have expired. Please log in again to continue.`,title:`Welcome back`,continue:`Continue`},signout:`Sign out`,login:`Log In`,signin:`Sign In`,copyId:`Copy account ID`},credentials:{connect:`Connect`,email:{title:`Email`,description:`Connect your email address`},google:{title:`Google`,description:`Connect your Google account`},apple:{title:`Apple`,description:`Connect your Apple ID`},passkeys:{title:`Passkeys`,tagline:`Sign in faster with a passkey`,create:`Create`,manage:`Manage`,collapse:`Collapse`,add:`Enter passkey name`,delete:`Hold to delete`,unknown:`Unknown`,count:e=>{let t={one:`{n} passkey`,other:`{n} passkeys`},n=`en-US`,r=new Intl.PluralRules(n).select(e),i=t;return(i[r]??i.other).replace(/{n}/g,new Intl.NumberFormat(n).format(e))},meta:(e,t)=>`Added ${e} · Used ${t}`,duplicate:`This device already has a passkey for your account`,failed:`Could not create the passkey. Please try again.`},transfer:{action:`Sign in on another device`,title:`Scan to sign in`,description:`Use your other device to scan this code and sign in.`,done:`Done`}}}},X=ne(ye,e=>rt[e]),it=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`children`]),at=w(`<div><!></div>`);function ot(e,t){_(t,!0);let n=S(t,`ref`,15,null),i=h(t,it);var o=at();I(o,e=>({"data-slot":`card-content`,class:e,...i}),[()=>q(`px-(--card-spacing)`,t.class)]);var s=d(o);B(s,()=>t.children??r),a(o),N(o,e=>n(e),()=>n()),T(e,o),V()}var st=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`children`]),ct=w(`<p><!></p>`);function lt(e,t){_(t,!0);let n=S(t,`ref`,15,null),i=h(t,st);var o=ct();I(o,e=>({"data-slot":`card-description`,class:e,...i}),[()=>q(`text-sm text-muted-foreground`,t.class)]);var s=d(o);B(s,()=>t.children??r),a(o),N(o,e=>n(e),()=>n()),T(e,o),V()}var ut=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`children`]),dt=w(`<div><!></div>`);function ft(e,t){_(t,!0);let n=S(t,`ref`,15,null),i=h(t,ut);var o=dt();I(o,e=>({"data-slot":`card-footer`,class:e,...i}),[()=>q(`rounded-b-xl border-t bg-muted/50 p-(--card-spacing) flex items-center`,t.class)]);var s=d(o);B(s,()=>t.children??r),a(o),N(o,e=>n(e),()=>n()),T(e,o),V()}var pt=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`children`]),mt=w(`<div><!></div>`);function ht(e,t){_(t,!0);let n=S(t,`ref`,15,null),i=h(t,pt);var o=mt();I(o,e=>({"data-slot":`card-header`,class:e,...i}),[()=>q(`gap-1 rounded-t-xl px-(--card-spacing) [.border-b]:pb-(--card-spacing) group/card-header @container/card-header grid auto-rows-min items-start has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto]`,t.class)]);var s=d(o);B(s,()=>t.children??r),a(o),N(o,e=>n(e),()=>n()),T(e,o),V()}var gt=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`children`]),_t=w(`<div><!></div>`);function vt(e,t){_(t,!0);let n=S(t,`ref`,15,null),i=h(t,gt);var o=_t();I(o,e=>({"data-slot":`card-title`,class:e,...i}),[()=>q(`text-base leading-snug font-medium group-data-[size=sm]/card:text-sm`,t.class)]);var s=d(o);B(s,()=>t.children??r),a(o),N(o,e=>n(e),()=>n()),T(e,o),V()}var yt=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`children`,`size`]),bt=w(`<div><!></div>`);function xt(e,t){_(t,!0);let n=S(t,`ref`,15,null),i=S(t,`size`,3,`default`),o=h(t,yt);var s=bt();I(s,e=>({"data-slot":`card`,"data-size":i(),class:e,...o}),[()=>q(`gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl group/card flex flex-col`,t.class)]);var c=d(s);B(c,()=>t.children??r),a(s),N(s,e=>n(e),()=>n()),T(e,s),V()}var St=new Set([`$$slots`,`$$events`,`$$legacy`]);function Ct(e,t){let n=h(t,St),r=[[`path`,{d:`M5 12h14`}],[`path`,{d:`m12 5 7 7-7 7`}]];H(e,k({name:`arrow-right`},()=>n,{get iconNode(){return r}}))}var wt=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`value`,`type`,`files`,`class`,`data-slot`]),Tt=w(`<input/>`);function Et(n,r){_(r,!0);let i=S(r,`ref`,15,null),a=S(r,`value`,15),o=S(r,`files`,15),s=S(r,`data-slot`,3,`input`),c=h(r,wt);var l=t(),u=e(l),d=e=>{var t=Tt();I(t,e=>({"data-slot":s(),class:e,type:`file`,...c}),[()=>q(`h-8 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors file:h-6 file:text-sm file:font-medium focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:bg-input/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,r.class)],void 0,void 0,void 0,!0),N(t,e=>i(e),()=>i()),v(t,o),D(t,a),T(e,t)},f=e=>{var t=Tt();I(t,e=>({"data-slot":s(),class:e,type:r.type,...c}),[()=>q(`h-8 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors file:h-6 file:text-sm file:font-medium focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:bg-input/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,r.class)],void 0,void 0,void 0,!0),N(t,e=>i(e),()=>i()),D(t,a),T(e,t)};z(u,e=>{r.type===`file`?e(d):e(f,-1)}),T(n,l),V()}var Dt=w(`<div><!></div>`);function Ot(e,t){_(t,!0);let r=A(!1);async function i(){C(r,!0),await new Promise(e=>setTimeout(e,500)),C(r,!1)}var o={shake:i},s=Dt(),c=d(s);return B(c,()=>t.children),a(s),M(()=>j(s,1,O([t.class,n(r)&&`shake`]),`svelte-alh7mr`)),T(e,s),V(o)}function Z(e){let t=A(te(e));return{[Ne]:!0,[$e]:!0,get current(){return n(t)},set current(e){C(t,e,!0)}}}Z.from=Ae,Z.with=W,Z.flatten=Fe,Z.readonly=ze,Z.isBox=Me,Z.isWritableBox=Ie;function kt(e){return window.getComputedStyle(e).getPropertyValue(`direction`)}var At=[Je,Be,Ye],jt=[Ue,Qe,`End`];[...At,...jt];function Mt(e=`ltr`,t=`horizontal`){return{horizontal:e===`rtl`?qe:We,vertical:Je}[t]}function Nt(e=`ltr`,t=`horizontal`){return{horizontal:e===`rtl`?We:qe,vertical:Ue}[t]}function Pt(e=`ltr`,t=`horizontal`){return[`ltr`,`rtl`].includes(e)||(e=`ltr`),[`horizontal`,`vertical`].includes(t)||(t=`horizontal`),{nextKey:Mt(e,t),prevKey:Nt(e,t)}}var Ft=class{#e;#t=Z(null);constructor(e){this.#e=e}getCandidateNodes(){return this.#e.rootNode.current?this.#e.candidateSelector?Array.from(this.#e.rootNode.current.querySelectorAll(this.#e.candidateSelector)):this.#e.candidateAttr?Array.from(this.#e.rootNode.current.querySelectorAll(`[${this.#e.candidateAttr}]:not([data-disabled])`)):[]:[]}focusFirstCandidate(){let e=this.getCandidateNodes();e.length&&e[0]?.focus()}handleKeydown(e,t,n=!1){let r=this.#e.rootNode.current;if(!r||!e)return;let i=this.getCandidateNodes();if(!i.length)return;let a=i.indexOf(e),{nextKey:o,prevKey:s}=Pt(kt(r),this.#e.orientation.current),c=this.#e.loop.current,l={[o]:a+1,[s]:a-1,[Ye]:0,End:i.length-1};if(n){let e=o===`ArrowDown`?We:Je,t=s===`ArrowUp`?qe:Ue;l[e]=a+1,l[t]=a-1}let u=l[t.key];if(u===void 0)return;t.preventDefault(),u<0&&c?u=i.length-1:u===i.length&&c&&(u=0);let d=i[u];if(d)return d.focus(),this.#t.current=d.id,this.#e.onCandidateFocus?.(d),d}getTabIndex(e){let t=this.getCandidateNodes(),n=this.#t.current!==null;return e&&!n&&t[0]===e?(this.#t.current=e.id,0):e?.id===this.#t.current?0:-1}setCurrentTabStopId(e){this.#t.current=e}focusCurrentTabStop(){let e=this.#t.current;if(!e)return;let t=this.#e.rootNode.current?.querySelector(`#${e}`);t&&He(t)&&t.focus()}},It=18,Lt=40,Rt=`${Lt}px`,zt=[`[data-lastpass-icon-root]`,`com-1password-button`,`[data-dashlanecreated]`,`[style$="2147483647 !important;"]`].join(`,`);function Bt({containerRef:e,inputRef:t,pushPasswordManagerStrategy:r,isFocused:i,domContext:a}){let s=A(!1),c=A(!1),l=A(!1);function u(){let e=r.current;return e!==`none`&&e===`increase-width`&&n(s)&&n(c)}function d(){let i=e.current,o=t.current;if(!i||!o||n(l)||r.current===`none`)return;let c=i,u=c.getBoundingClientRect().left+c.offsetWidth,d=c.getBoundingClientRect().top+c.offsetHeight/2,f=u-It,p=d;(a.querySelectorAll(zt).length!==0||a.getDocument().elementFromPoint(f,p)!==i)&&(C(s,!0),C(l,!0))}return o(()=>{let t=e.current;if(!t||r.current===`none`)return;function n(){let e=Oe(t).innerWidth-t.getBoundingClientRect().right;C(c,e>=Lt)}n();let i=setInterval(n,1e3);return()=>{clearInterval(i)}}),o(()=>{let e=i.current||a.getActiveElement()===t.current;if(r.current===`none`||!e)return;let n=setTimeout(d,0),o=setTimeout(d,2e3),s=setTimeout(d,5e3),c=setTimeout(()=>{C(l,!0)},6e3);return()=>{clearTimeout(n),clearTimeout(o),clearTimeout(s),clearTimeout(c)}}),{get hasPwmBadge(){return n(s)},get willPushPwmBadge(){return u()},PWM_BADGE_SPACE_WIDTH:Rt}}var Vt=`^\\d+$`,Ht=Xe({component:`pin-input`,parts:[`root`,`cell`]}),Ut=[`Backspace`,`Delete`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`,`Home`,`End`,`Escape`,`Enter`,`Tab`,`Shift`,`Control`,`Meta`],Wt=class e{static create(t){return new e(t)}opts;attachment;inputAttachment;#e=A(!1);#t=Ee(!1);#n=A(null);#r=A(null);#i=new Pe(()=>this.opts.value.current??``);#a=P(()=>typeof this.opts.pattern.current==`string`?new RegExp(this.opts.pattern.current):this.opts.pattern.current);#o=A(te({prev:[null,null,`none`],willSyntheticBlur:!1}));#s;#c;domContext;constructor(e){this.opts=e,this.attachment=K(this.opts.ref),this.inputAttachment=K(this.opts.inputRef),this.domContext=new ke(e.ref),this.#c={value:this.opts.value,isIOS:typeof window<`u`&&window?.CSS?.supports(`-webkit-touch-callout`,`none`)},this.#s=Bt({containerRef:this.opts.ref,inputRef:this.opts.inputRef,isFocused:this.#t,pushPasswordManagerStrategy:this.opts.pushPasswordManagerStrategy,domContext:this.domContext}),ee(()=>{let e=this.opts.inputRef.current,t=this.opts.ref.current;if(!e||!t)return;this.#c.value.current!==e.value&&(this.opts.value.current=e.value),n(this.#o).prev=[e.selectionStart,e.selectionEnd,e.selectionDirection??`none`];let r=f(this.domContext.getDocument(),`selectionchange`,this.#m,{capture:!0});this.#m(),this.domContext.getActiveElement()===e&&(this.#t.current=!0),this.domContext.getElementById(`pin-input-style`)||this.#p();let i=()=>{t&&t.style.setProperty(`--bits-pin-input-root-height`,`${e.clientHeight}px`)};i();let a=new ResizeObserver(i);return a.observe(e),()=>{r(),a.disconnect()}}),Ke([()=>this.opts.value.current,()=>this.opts.inputRef.current],()=>{Kt(()=>{let e=this.opts.inputRef.current;if(!e)return;e.dispatchEvent(new Event(`input`));let t=e.selectionStart,r=e.selectionEnd,i=e.selectionDirection??`none`;t!==null&&r!==null&&(C(this.#n,t,!0),C(this.#r,r,!0),n(this.#o).prev=[t,r,i])},this.domContext)}),o(()=>{let e=this.opts.value.current,t=this.#i.current,n=this.opts.maxLength.current,r=this.opts.onComplete.current;t!==void 0&&e!==t&&t.length<n&&e.length===n&&r(e)})}onkeydown=e=>{let t=e.key;Ut.includes(t)||e.ctrlKey||e.metaKey||t&&n(this.#a)&&!n(this.#a).test(t)&&e.preventDefault()};#l=P(()=>({position:`relative`,cursor:this.opts.disabled.current?`default`:`text`,userSelect:`none`,WebkitUserSelect:`none`,pointerEvents:`none`}));#u=P(()=>({id:this.opts.id.current,[Ht.root]:``,style:n(this.#l),...this.attachment}));get rootProps(){return n(this.#u)}set rootProps(e){C(this.#u,e)}#d=P(()=>({style:{position:`absolute`,inset:0,pointerEvents:`none`}}));get inputWrapperProps(){return n(this.#d)}set inputWrapperProps(e){C(this.#d,e)}#f=P(()=>({position:`absolute`,inset:0,width:this.#s.willPushPwmBadge?`calc(100% + ${this.#s.PWM_BADGE_SPACE_WIDTH})`:`100%`,clipPath:this.#s.willPushPwmBadge?`inset(0 ${this.#s.PWM_BADGE_SPACE_WIDTH} 0 0)`:void 0,height:`100%`,display:`flex`,textAlign:this.opts.textAlign.current,opacity:`1`,color:`transparent`,pointerEvents:`all`,background:`transparent`,caretColor:`transparent`,border:`0 solid transparent`,outline:`0 solid transparent`,boxShadow:`none`,lineHeight:`1`,letterSpacing:`-.5em`,fontSize:`var(--bits-pin-input-root-height)`,fontFamily:`monospace`,fontVariantNumeric:`tabular-nums`}));#p(){let e=this.domContext.getDocument(),t=e.createElement(`style`);if(t.id=`pin-input-style`,e.head.appendChild(t),t.sheet){let e=`background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;`;qt(t.sheet,`[data-pin-input-input]::selection { background: transparent !important; color: transparent !important; }`),qt(t.sheet,`[data-pin-input-input]:autofill { ${e} }`),qt(t.sheet,`[data-pin-input-input]:-webkit-autofill { ${e} }`),qt(t.sheet,`@supports (-webkit-touch-callout: none) { [data-pin-input-input] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }`),qt(t.sheet,`[data-pin-input-input] + * { pointer-events: all !important; }`)}}#m=()=>{let e=this.opts.inputRef.current,t=this.opts.ref.current;if(!e||!t)return;if(this.domContext.getActiveElement()!==e){C(this.#n,null),C(this.#r,null);return}let r=e.selectionStart,i=e.selectionEnd,a=e.selectionDirection??`none`,o=e.maxLength,s=e.value,c=n(this.#o).prev,l=-1,u=-1,d;if(s.length!==0&&r!==null&&i!==null){let e=r===i,t=r===s.length&&s.length<o;if(e&&!t){let e=r;if(e===0)l=0,u=1,d=`forward`;else if(e===o)l=e-1,u=e,d=`backward`;else if(o>1&&s.length>1){let t=0;if(c[0]!==null&&c[1]!==null){d=e<c[1]?`backward`:`forward`;let n=c[0]===c[1]&&c[0]<o;d===`backward`&&!n&&(t=-1)}l=t+e,u=t+e+1}}l!==-1&&u!==-1&&l!==u&&this.opts.inputRef.current?.setSelectionRange(l,u,d)}let f=l===-1?r:l,p=u===-1?i:u,m=d??a;C(this.#n,f,!0),C(this.#r,p,!0),n(this.#o).prev=[f,p,m]};oninput=e=>{let t=e.currentTarget.value.slice(0,this.opts.maxLength.current);if(t.length>0&&n(this.#a)&&!n(this.#a).test(t)){e.preventDefault();return}typeof this.#i.current==`string`&&t.length<this.#i.current.length&&this.domContext.getDocument().dispatchEvent(new Event(`selectionchange`)),this.opts.value.current=t};onfocus=e=>{let t=this.opts.inputRef.current;if(t){let e=Math.min(t.value.length,this.opts.maxLength.current-1),n=t.value.length;t.setSelectionRange(e,n),C(this.#n,e,!0),C(this.#r,n,!0)}this.#t.current=!0};onpaste=e=>{let t=this.opts.inputRef.current;if(!t)return;let r=e=>{let n=t.selectionStart===null?void 0:t.selectionStart,r=t.selectionEnd===null?void 0:t.selectionEnd,i=n!==r,a=this.opts.value.current;return(i?a.slice(0,n)+e+a.slice(r):a.slice(0,n)+e+a.slice(n)).slice(0,this.opts.maxLength.current)},i=e=>e.length>0&&n(this.#a)&&!n(this.#a).test(e);if(!this.opts.pasteTransformer?.current&&(!this.#c.isIOS||!e.clipboardData||!t)){i(r(e.clipboardData?.getData(`text/plain`)))&&e.preventDefault();return}let a=e.clipboardData?.getData(`text/plain`)??``,o=this.opts.pasteTransformer?.current?this.opts.pasteTransformer.current(a):a;e.preventDefault();let s=r(o);if(i(s))return;t.value=s,this.opts.value.current=s;let c=Math.min(s.length,this.opts.maxLength.current-1),l=s.length;t.setSelectionRange(c,l),C(this.#n,c,!0),C(this.#r,l,!0)};onmouseover=e=>{C(this.#e,!0)};onmouseleave=e=>{C(this.#e,!1)};onblur=e=>{if(n(this.#o).willSyntheticBlur){n(this.#o).willSyntheticBlur=!1;return}this.#t.current=!1};#h=P(()=>({id:this.opts.inputId.current,style:n(this.#f),autocomplete:this.opts.autocomplete.current||`one-time-code`,"data-pin-input-input":``,"data-pin-input-input-mss":n(this.#n),"data-pin-input-input-mse":n(this.#r),inputmode:this.opts.inputmode.current,pattern:n(this.#a)?.source,maxlength:this.opts.maxLength.current,value:this.opts.value.current,disabled:De(this.opts.disabled.current),onpaste:this.onpaste,oninput:this.oninput,onkeydown:this.onkeydown,onmouseover:this.onmouseover,onmouseleave:this.onmouseleave,onfocus:this.onfocus,onblur:this.onblur,...this.inputAttachment}));get inputProps(){return n(this.#h)}set inputProps(e){C(this.#h,e)}#g=P(()=>Array.from({length:this.opts.maxLength.current}).map((e,t)=>{let r=this.#t.current&&n(this.#n)!==null&&n(this.#r)!==null&&(n(this.#n)===n(this.#r)&&t===n(this.#n)||t>=n(this.#n)&&t<n(this.#r)),i=this.opts.value.current[t]===void 0?null:this.opts.value.current[t];return{char:i,isActive:r,hasFakeCaret:r&&i===null}}));#_=P(()=>({cells:n(this.#g),isFocused:this.#t.current,isHovering:n(this.#e)}));get snippetProps(){return n(this.#_)}set snippetProps(e){C(this.#_,e)}},Gt=class e{static create(t){return new e(t)}opts;attachment;constructor(e){this.opts=e,this.attachment=K(this.opts.ref)}#e=P(()=>({id:this.opts.id.current,[Ht.cell]:``,"data-active":this.opts.cell.current.isActive?``:void 0,"data-inactive":this.opts.cell.current.isActive?void 0:``,...this.attachment}));get props(){return n(this.#e)}set props(e){C(this.#e,e)}};function Kt(e,t){return[t.setTimeout(e,0),t.setTimeout(e,10),t.setTimeout(e,50)]}function qt(e,t){try{e.insertRule(t)}catch{console.error(`pin input could not insert CSS rule:`,t)}}var Jt=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`inputId`,`ref`,`inputRef`,`maxlength`,`textalign`,`pattern`,`inputmode`,`onComplete`,`pushPasswordManagerStrategy`,`class`,`children`,`autocomplete`,`disabled`,`value`,`onValueChange`,`pasteTransformer`]),Yt=w(`<div><!> <div><input/></div></div>`);function Xt(e,t){let i=l();_(t,!0);let o=S(t,`id`,19,()=>J(i)),s=S(t,`inputId`,19,()=>`${J(i)}-input`),c=S(t,`ref`,15,null),u=S(t,`inputRef`,15,null),f=S(t,`maxlength`,3,6),p=S(t,`textalign`,3,`left`),m=S(t,`inputmode`,3,`numeric`),g=S(t,`onComplete`,3,Ve),v=S(t,`pushPasswordManagerStrategy`,3,`increase-width`),y=S(t,`class`,3,``),b=S(t,`autocomplete`,3,`one-time-code`),x=S(t,`disabled`,3,!1),C=S(t,`value`,15,``),w=S(t,`onValueChange`,3,Ve),E=h(t,Jt),D=Wt.create({id:W(()=>o()),ref:W(()=>c(),e=>c(e)),inputRef:W(()=>u(),e=>u(e)),inputId:W(()=>s()),autocomplete:W(()=>b()),maxLength:W(()=>f()),textAlign:W(()=>p()),disabled:W(()=>x()),inputmode:W(()=>m()),pattern:W(()=>t.pattern),onComplete:W(()=>g()),value:W(()=>C(),e=>{C(e),w()(e)}),pushPasswordManagerStrategy:W(()=>v()),pasteTransformer:W(()=>t.pasteTransformer)}),O=P(()=>G(E,D.inputProps)),ee=P(()=>G(D.rootProps,{class:y()})),te=P(()=>G(D.inputWrapperProps,{}));var k=Yt();I(k,()=>({...n(ee)}));var A=d(k);B(A,()=>t.children??r,()=>D.snippetProps);var j=F(A,2);I(j,()=>({...n(te)}));var ne=d(j);I(ne,()=>({...n(O)}),void 0,void 0,void 0,void 0,!0),a(j),a(k),T(e,k),V()}var Zt=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`cell`,`child`,`children`]),Qt=w(`<div><!></div>`);function $t(i,o){let s=l();_(o,!0);let c=S(o,`id`,19,()=>J(s)),u=S(o,`ref`,15,null),f=h(o,Zt),p=Gt.create({id:W(()=>c()),ref:W(()=>u(),e=>u(e)),cell:W(()=>o.cell)}),m=P(()=>G(f,p.props));var g=t(),v=e(g),y=r=>{var i=t(),a=e(i);B(a,()=>o.child,()=>({props:n(m)})),T(r,i)},b=e=>{var t=Qt();I(t,()=>({...n(m)}));var i=d(t);B(i,()=>o.children??r),a(t),T(e,t)};z(v,e=>{o.child?e(y):e(b,-1)}),T(i,g),V()}var en=Xe({component:`tabs`,parts:[`root`,`list`,`trigger`,`content`]}),tn=new Te(`Tabs.Root`),nn=class e{static create(t){return tn.set(new e(t))}opts;attachment;rovingFocusGroup;#e=A(te([]));get triggerIds(){return n(this.#e)}set triggerIds(e){C(this.#e,e,!0)}valueToTriggerId=new Ge;valueToContentId=new Ge;constructor(e){this.opts=e,this.attachment=K(e.ref),this.rovingFocusGroup=new Ft({candidateAttr:en.trigger,rootNode:this.opts.ref,loop:this.opts.loop,orientation:this.opts.orientation})}registerTrigger(e,t){return this.triggerIds.push(e),this.valueToTriggerId.set(t,e),()=>{this.triggerIds=this.triggerIds.filter(t=>t!==e),this.valueToTriggerId.delete(t)}}registerContent(e,t){return this.valueToContentId.set(t,e),()=>{this.valueToContentId.delete(t)}}setValue(e){this.opts.value.current=e}#t=P(()=>({id:this.opts.id.current,"data-orientation":this.opts.orientation.current,[en.root]:``,...this.attachment}));get props(){return n(this.#t)}set props(e){C(this.#t,e)}},rn=class e{static create(t){return new e(t,tn.get())}opts;root;attachment;#e=P(()=>this.root.opts.disabled.current);constructor(e,t){this.opts=e,this.root=t,this.attachment=K(e.ref)}#t=P(()=>({id:this.opts.id.current,role:`tablist`,"aria-orientation":this.root.opts.orientation.current,"data-orientation":this.root.opts.orientation.current,[en.list]:``,"data-disabled":Ze(n(this.#e)),...this.attachment}));get props(){return n(this.#t)}set props(e){C(this.#t,e)}},an=class e{static create(t){return new e(t,tn.get())}opts;root;attachment;#e=A(0);#t=P(()=>this.root.opts.value.current===this.opts.value.current);#n=P(()=>this.opts.disabled.current||this.root.opts.disabled.current);#r=P(()=>this.root.valueToContentId.get(this.opts.value.current));constructor(e,t){this.opts=e,this.root=t,this.attachment=K(e.ref),Ke([()=>this.opts.id.current,()=>this.opts.value.current],([e,t])=>this.root.registerTrigger(e,t)),o(()=>{this.root.triggerIds.length,n(this.#t)||!this.root.opts.value.current?C(this.#e,0):C(this.#e,-1)}),this.onfocus=this.onfocus.bind(this),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this)}#i(){this.root.opts.value.current!==this.opts.value.current&&this.root.setValue(this.opts.value.current)}onfocus(e){this.root.opts.activationMode.current!==`automatic`||n(this.#n)||this.#i()}onclick(e){n(this.#n)||this.#i()}onkeydown(e){if(!n(this.#n)){if(e.key===` `||e.key===`Enter`){e.preventDefault(),this.#i();return}this.root.rovingFocusGroup.handleKeydown(this.opts.ref.current,e)}}#a=P(()=>({id:this.opts.id.current,role:`tab`,"data-state":sn(n(this.#t)),"data-value":this.opts.value.current,"data-orientation":this.root.opts.orientation.current,"data-disabled":Ze(n(this.#n)),"aria-selected":Le(n(this.#t)),"aria-controls":n(this.#r),[en.trigger]:``,disabled:De(n(this.#n)),tabindex:n(this.#e),onclick:this.onclick,onfocus:this.onfocus,onkeydown:this.onkeydown,...this.attachment}));get props(){return n(this.#a)}set props(e){C(this.#a,e)}},on=class e{static create(t){return new e(t,tn.get())}opts;root;attachment;#e=P(()=>this.root.opts.value.current===this.opts.value.current);#t=P(()=>this.root.valueToTriggerId.get(this.opts.value.current));constructor(e,t){this.opts=e,this.root=t,this.attachment=K(e.ref),Ke([()=>this.opts.id.current,()=>this.opts.value.current],([e,t])=>this.root.registerContent(e,t))}#n=P(()=>({id:this.opts.id.current,role:`tabpanel`,hidden:De(!n(this.#e)),tabindex:0,"data-value":this.opts.value.current,"data-state":sn(n(this.#e)),"aria-labelledby":n(this.#t),"data-orientation":this.root.opts.orientation.current,[en.content]:``,...this.attachment}));get props(){return n(this.#n)}set props(e){C(this.#n,e)}};function sn(e){return e?`active`:`inactive`}var cn=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`value`,`onValueChange`,`orientation`,`loop`,`activationMode`,`disabled`,`children`,`child`]),ln=w(`<div><!></div>`);function un(i,o){let s=l();_(o,!0);let c=S(o,`id`,19,()=>J(s)),u=S(o,`ref`,15,null),f=S(o,`value`,15,``),p=S(o,`onValueChange`,3,Ve),m=S(o,`orientation`,3,`horizontal`),g=S(o,`loop`,3,!0),v=S(o,`activationMode`,3,`automatic`),y=S(o,`disabled`,3,!1),b=h(o,cn),x=nn.create({id:W(()=>c()),value:W(()=>f(),e=>{f(e),p()(e)}),orientation:W(()=>m()),loop:W(()=>g()),activationMode:W(()=>v()),disabled:W(()=>y()),ref:W(()=>u(),e=>u(e))}),C=P(()=>G(b,x.props));var w=t(),E=e(w),D=r=>{var i=t(),a=e(i);B(a,()=>o.child,()=>({props:n(C)})),T(r,i)},O=e=>{var t=ln();I(t,()=>({...n(C)}));var i=d(t);B(i,()=>o.children??r),a(t),T(e,t)};z(E,e=>{o.child?e(D):e(O,-1)}),T(i,w),V()}var dn=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`id`,`ref`,`value`]),fn=w(`<div><!></div>`);function pn(i,o){let s=l();_(o,!0);let c=S(o,`id`,19,()=>J(s)),u=S(o,`ref`,15,null),f=h(o,dn),p=on.create({value:W(()=>o.value),id:W(()=>c()),ref:W(()=>u(),e=>u(e))}),m=P(()=>G(f,p.props));var g=t(),v=e(g),y=r=>{var i=t(),a=e(i);B(a,()=>o.child,()=>({props:n(m)})),T(r,i)},b=e=>{var t=fn();I(t,()=>({...n(m)}));var i=d(t);B(i,()=>o.children??r),a(t),T(e,t)};z(v,e=>{o.child?e(y):e(b,-1)}),T(i,g),V()}var mn=new Set([`$$slots`,`$$events`,`$$legacy`,`child`,`children`,`id`,`ref`]),hn=w(`<div><!></div>`);function gn(i,o){let s=l();_(o,!0);let c=S(o,`id`,19,()=>J(s)),u=S(o,`ref`,15,null),f=h(o,mn),p=rn.create({id:W(()=>c()),ref:W(()=>u(),e=>u(e))}),m=P(()=>G(f,p.props));var g=t(),v=e(g),y=r=>{var i=t(),a=e(i);B(a,()=>o.child,()=>({props:n(m)})),T(r,i)},b=e=>{var t=hn();I(t,()=>({...n(m)}));var i=d(t);B(i,()=>o.children??r),a(t),T(e,t)};z(v,e=>{o.child?e(y):e(b,-1)}),T(i,g),V()}var _n=new Set([`$$slots`,`$$events`,`$$legacy`,`child`,`children`,`disabled`,`id`,`type`,`value`,`ref`]),vn=w(`<button><!></button>`);function yn(i,o){let s=l();_(o,!0);let c=S(o,`disabled`,3,!1),u=S(o,`id`,19,()=>J(s)),f=S(o,`type`,3,`button`),p=S(o,`ref`,15,null),m=h(o,_n),g=an.create({id:W(()=>u()),disabled:W(()=>c()??!1),value:W(()=>o.value),ref:W(()=>p(),e=>p(e))}),v=P(()=>G(m,g.props,{type:f()}));var y=t(),b=e(y),x=r=>{var i=t(),a=e(i);B(a,()=>o.child,()=>({props:n(v)})),T(r,i)},C=e=>{var t=vn();I(t,()=>({...n(v)}));var i=d(t);B(i,()=>o.children??r),a(t),T(e,t)};z(b,e=>{o.child?e(x):e(C,-1)}),T(i,y),V()}var bn=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`children`]),xn=w(`<div><!></div>`);function Sn(e,t){_(t,!0);let n=S(t,`ref`,15,null),i=h(t,bn);var o=xn();I(o,e=>({"data-slot":`input-otp-group`,class:e,...i}),[()=>q(`rounded-lg has-aria-invalid:border-destructive has-aria-invalid:ring-3 has-aria-invalid:ring-destructive/20 dark:has-aria-invalid:ring-destructive/40 flex items-center`,t.class)]);var s=d(o);B(s,()=>t.children??r),a(o),N(o,e=>n(e),()=>n()),T(e,o),V()}var Cn=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`cell`,`class`]),wn=w(`<div class="cn-input-otp-caret pointer-events-none absolute inset-0 flex items-center justify-center"><div class="h-4 w-px animate-caret-blink bg-foreground duration-1000 h-4 w-px bg-foreground"></div></div>`),Tn=w(` <!>`,1);function En(r,a){_(a,!0);let o=S(a,`ref`,15,null),s=h(a,Cn);var c=t(),l=e(c);{let t=P(()=>q(`size-8 border-y border-r border-input text-sm transition-all outline-none first:rounded-l-lg first:border-l last:rounded-r-lg aria-invalid:border-destructive data-[active=true]:border-ring data-[active=true]:ring-3 data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:border-destructive data-[active=true]:aria-invalid:ring-destructive/20 dark:bg-input/30 dark:data-[active=true]:aria-invalid:ring-destructive/40 relative flex items-center justify-center data-[active=true]:z-10`,a.class));R(l,()=>$t,(r,c)=>{c(r,k({get cell(){return a.cell},"data-slot":`input-otp-slot`,get class(){return n(t)}},()=>s,{get ref(){return o()},set ref(e){o(e)},children:(t,n)=>{m();var r=Tn(),o=e(r),s=F(o),c=e=>{var t=wn();T(e,t)};z(s,e=>{a.cell.hasFakeCaret&&e(c)}),M(()=>i(o,`${a.cell.char??``} `)),T(t,r)},$$slots:{default:!0}}))})}T(r,c),V()}var Dn=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`value`]);function On(r,i){_(i,!0);let a=S(i,`ref`,15,null),o=S(i,`value`,15,``),s=h(i,Dn);var c=t(),l=e(c);{let e=P(()=>q(`cn-input-otp-input gap-2 flex items-center disabled:cursor-not-allowed has-disabled:opacity-50`,i.class));R(l,()=>Xt,(t,r)=>{r(t,k({"data-slot":`input-otp`,spellcheck:!1,get class(){return n(e)}},()=>s,{get ref(){return a()},set ref(e){a(e)},get value(){return o()},set value(e){o(e)}}))})}T(r,c),V()}var kn=w(`<div class="w-full flex items-center"><!></div>`);function An(r,i){_(i,!0);let o=()=>b(X,`$dict`,s),[s,c]=L(),l=S(i,`ref`,15,null),u=S(i,`mode`,11,`password`),f=S(i,`password`,15,``),m=S(i,`otp`,15,``);var h=kn(),g=d(h),v=e=>{Et(e,{id:`iam-password-input`,name:`password`,type:`password`,minlength:6,autocomplete:`current-password`,get placeholder(){return o().auth.password},class:`placeholder:text-sm`,get value(){return f()},set value(e){f(e)}})},y=r=>{var i=t(),a=e(i);{let r=(r,i)=>{let a=()=>(i?.()).cells;var o=t(),s=e(o);R(s,()=>Sn,(r,i)=>{i(r,{children:(r,i)=>{var o=t(),s=e(o);re(s,17,()=>a().slice(0,6),p,(r,i)=>{var a=t(),o=e(a);R(o,()=>En,(e,t)=>{t(e,{get cell(){return n(i)},class:`size-[40px] bg-background`})}),T(r,a)}),T(r,o)},$$slots:{default:!0}})}),T(r,o)};R(a,()=>On,(e,t)=>{t(e,{maxlength:6,get pattern(){return Vt},required:!0,get value(){return m()},set value(e){m(e)},children:r,$$slots:{default:!0}})})}T(r,i)};z(g,e=>{u()===`password`?e(v):e(y,-1)}),a(h),N(h,e=>l(e),()=>l()),T(r,h),V(),c()}var jn=w(`<!> <span class="sr-only"> </span>`,1),Mn=w(`<form><fieldset class="space-y-2"><!> <div class="space-y-2"><div class="flex items-center gap-2"><!> <!></div> <div class="text-sm text-muted-foreground px-1"><!></div></div></fieldset></form>`);function Nn(r,o){_(o,!0);let c=()=>b(X,`$dict`,l),[l,f]=L(),p=A(!1),m=A(``),h=A(``),v=A(``),y=A(null),S=A(`password`),w=A(void 0);async function E(){n(h).length===0?n(S)===`password`?await ee():await te():await D()}async function D(){C(p,!0);let e=o.account===void 0?await O():await be(o.account.id,{username:n(m),password:n(h)});C(p,!1),e instanceof Error&&await k()}async function O(){let e=await ve(n(m),n(h));return e instanceof Error||we(e)?.status===201&&o.oncreate?.(e),e}async function ee(){C(p,!0);let e=o.account===void 0?await fe(n(m)):await Se(o.account.id,n(m));C(p,!1),!(e instanceof Error)&&(C(S,`otp`),requestAnimationFrame(()=>j()))}async function te(){if(n(m).length===0){console.error(`username is required`);return}if(n(v).length!==6){await k();return}C(p,!0);let e=await pe(n(m),n(v));if(C(p,!1),e instanceof Error){C(v,``),await k();return}return we(e)?.status===201&&o.oncreate?.(e),e}async function k(){await n(w)?.shake(),j()}function j(){ue&&n(y)?.querySelector(`input`)?.focus()}var ne=Mn(),I=P(()=>je(E)),R=d(ne),re=d(R);{let e=P(()=>n(S)===`otp`||void 0);Et(re,{id:`iam-username-input`,name:`username`,type:`email`,autocomplete:`username`,required:!0,get disabled(){return n(e)},get autofocus(){return ue},get placeholder(){return c().auth.email},get value(){return n(m)},set value(e){C(m,e,!0)}})}var B=F(re,2),ie=d(B),ae=d(ie);N(Ot(ae,{class:`w-full`,children:(e,t)=>{An(e,{get mode(){return n(S)},get ref(){return n(y)},set ref(e){C(y,e,!0)},get password(){return n(h)},set password(e){C(h,e,!0)},get otp(){return n(v)},set otp(e){C(v,e,!0)}})},$$slots:{default:!0}}),e=>C(w,e,!0),()=>n(w));var oe=F(ae,2);U(oe,{size:`icon-lg`,type:`submit`,children:(t,r)=>{var a=jn(),o=e(a),s=e=>{Y(e,{})},l=e=>{Ct(e,{})};z(o,e=>{n(p)?e(s):e(l,-1)});var u=F(o,2),d=x(u,!0);M(()=>i(d,c().auth.login)),T(t,a)},$$slots:{default:!0}}),a(ie);var se=F(ie,2),ce=d(se),le=n=>{var r=t(),i=e(r);g(i,()=>c().auth.passwordBlank),T(n,r)},de=e=>{var t=u();M(()=>i(t,c().auth.otpInstructions)),T(e,t)};z(ce,e=>{n(S)===`password`?e(le):e(de,-1)}),a(se),a(B),a(R),a(ne),s(`submit`,ne,function(...e){n(I)?.apply(this,e)}),T(r,ne),V(),f()}var Pn=w(`<h2> </h2>`),Fn=w(`<!> <!>`,1);function In(r,a){_(a,!0);let o=()=>b(X,`$dict`,s),[s,c]=L();var l=t(),d=e(l);{let t=P(()=>q(`pt-4 gap-4 bg-background/75`,a.class));R(d,()=>xt,(r,s)=>{s(r,{get class(){return n(t)},children:(t,n)=>{var r=Fn(),s=e(r);R(s,()=>ht,(t,n)=>{n(t,{class:`gap-0`,children:(t,n)=>{var r=Fn(),a=e(r);R(a,()=>vt,(e,t)=>{t(e,{children:(e,t)=>{var n=Pn(),r=x(n,!0);M(()=>i(r,o().auth.passwordTitle)),T(e,n)},$$slots:{default:!0}})});var s=F(a,2);R(s,()=>lt,(e,t)=>{t(e,{children:(e,t)=>{m();var n=u();M(()=>i(n,o().auth.passwordDescription)),T(e,n)},$$slots:{default:!0}})}),T(t,r)},$$slots:{default:!0}})});var c=F(s,2);R(c,()=>ot,(e,t)=>{t(e,{children:(e,t)=>{Nn(e,{get account(){return a.account},get oncreate(){return a.oncreate}})},$$slots:{default:!0}})}),T(t,r)},$$slots:{default:!0}})})}T(r,l),V(),c()}function Ln(e){Nn(e,{})}var Rn=new Set([`$$slots`,`$$events`,`$$legacy`]);function zn(e,t){let n=h(t,Rn),r=[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`}],[`path`,{d:`m9 12 2 2 4-4`}]];H(e,k({name:`shield-check`},()=>n,{get iconNode(){return r}}))}var Bn=new Set([`$$slots`,`$$events`,`$$legacy`]);function Vn(e,t){let n=h(t,Bn),r=[[`path`,{d:`m2 2 20 20`}],[`path`,{d:`M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71`}],[`path`,{d:`M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264`}]];H(e,k({name:`shield-off`},()=>n,{get iconNode(){return r}}))}var Hn=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`children`]),Un=w(`<div><!></div>`);function Wn(e,t){_(t,!0);let n=S(t,`ref`,15,null),i=h(t,Hn);var o=Un();I(o,e=>({"data-slot":`alert-description`,class:e,...i}),[()=>q(`text-sm text-balance text-muted-foreground md:text-pretty [&_p:not(:last-child)]:mb-4 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground`,t.class)]);var s=d(o);B(s,()=>t.children??r),a(o),N(o,e=>n(e),()=>n()),T(e,o),V()}var Gn=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`children`]),Kn=w(`<div><!></div>`);function qn(e,t){_(t,!0);let n=S(t,`ref`,15,null),i=h(t,Gn);var o=Kn();I(o,e=>({"data-slot":`alert-title`,class:e,...i}),[()=>q(`font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground`,t.class)]);var s=d(o);B(s,()=>t.children??r),a(o),N(o,e=>n(e),()=>n()),T(e,o),V()}var Jn=Re({base:`grid gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4 group/alert relative w-full`,variants:{variant:{default:`bg-card text-card-foreground`,destructive:`bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current`}},defaultVariants:{variant:`default`}}),Yn=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`variant`,`children`]),Xn=w(`<div><!></div>`);function Zn(e,t){_(t,!0);let n=S(t,`ref`,15,null),i=S(t,`variant`,3,`default`),o=h(t,Yn);var s=Xn();I(s,e=>({"data-slot":`alert`,role:`alert`,class:e,...o}),[()=>q(Jn({variant:i()}),t.class)]);var c=d(s);B(c,()=>t.children??r),a(s),N(s,e=>n(e),()=>n()),T(e,s),V()}var Qn=new Set([`$$slots`,`$$events`,`$$legacy`]);function $n(e,t){let n=h(t,Qn),r=[[`path`,{d:`M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4`}],[`path`,{d:`M14 13.12c0 2.38 0 6.38-1 8.88`}],[`path`,{d:`M17.29 21.02c.12-.6.43-2.3.5-3.02`}],[`path`,{d:`M2 12a10 10 0 0 1 18-6`}],[`path`,{d:`M2 16h.01`}],[`path`,{d:`M21.8 16c.2-2 .131-5.354 0-6`}],[`path`,{d:`M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2`}],[`path`,{d:`M8.65 22c.21-.66.45-1.32.57-2`}],[`path`,{d:`M9 6.8a6 6 0 0 1 9 5.2v2`}]];H(e,k({name:`fingerprint-pattern`},()=>n,{get iconNode(){return r}}))}var er=w(`<!> `,1),tr=w(`<div class="flex flex-col items-center justify-center gap-2"><p> </p> <!></div>`);function nr(t,r){_(r,!0);let o=()=>b(X,`$dict`,s),[s,c]=L(),l=A(!1);async function u(){C(l,!0),await xe(),C(l,!1)}var f=tr(),p=d(f),m=x(p,!0),h=F(p,2);U(h,{id:`iam-passkey-login-button`,variant:`secondary`,onclick:u,children:(t,r)=>{var a=er(),s=e(a),c=e=>{Y(e,{})},u=e=>{$n(e,{})};z(s,e=>{n(l)?e(c):e(u,-1)});var d=F(s);M(()=>i(d,` ${o().auth.signin??``}`)),T(t,a)},$$slots:{default:!0}}),a(f),M(()=>i(m,o().auth.alreadyHaveAccount)),T(t,f),V(),c()}var rr=w(`<form><fieldset class="space-y-1"><div class="flex items-center gap-2"><!> <!></div></fieldset></form>`);function ir(r,i){_(i,!0);let o=()=>b(X,`$dict`,c),[c,l]=L(),u=P(()=>i.account?.name??``),f=A(!1);async function p(){let e=n(u).trim();if(e.length===0)return;C(f,!0);let t=await de(e,i.account?.id);C(f,!1),!(t instanceof Error)&&i.oncreate?.(t)}var m=rr(),h=P(()=>je(p)),g=d(m),v=d(g),y=d(v);Et(y,{id:`name`,type:`text`,get placeholder(){return o().auth.yourName},autocomplete:`given-name`,required:!0,get autofocus(){return ue},get value(){return n(u)},set value(e){C(u,e)}});var x=F(y,2);U(x,{id:`iam-passkey-create-button`,size:`icon-lg`,type:`submit`,children:(r,i)=>{var a=t(),o=e(a),s=e=>{Y(e,{})},c=e=>{Ct(e,{})};z(o,e=>{n(f)?e(s):e(c,-1)}),T(r,a)},$$slots:{default:!0}}),a(v),a(g),a(m),M(()=>g.disabled=i.disabled),s(`submit`,m,function(...e){n(h)?.apply(this,e)}),T(r,m),V(),l()}var ar=w(`<p> <a target="_blank" class="text-nowrap"> </a></p>`),or=w(`<h2> </h2>`),sr=w(`<!> <!>`,1),cr=w(`<!> <!> <!>`,1),lr=w(`<p> </p> <!>`,1),ur=w(`<div class="space-y-4"><!> <!></div>`);function dr(r,o){_(o,!0);let s=()=>b(X,`$dict`,c),[c,l]=L(),f=e=>{var t=ar(),n=d(t),r=F(n),o=x(r,!0);a(t),M(()=>{i(n,`${s().auth.passkeysDescription??``} `),y(r,`href`,p),i(o,s().auth.learnMore)}),T(e,t)},p=ge?`https://support.apple.com/en-us/102195`:`https://support.google.com/accounts/answer/13548313`;var h=ur(),g=d(h);{let r=P(()=>q(`gap-4 bg-background/75`,_e&&`pt-4`,o.class));R(g,()=>xt,(a,c)=>{c(a,{get class(){return n(r)},children:(n,r)=>{var a=sr(),c=e(a),l=n=>{var r=sr(),a=e(r);R(a,()=>ht,(n,r)=>{r(n,{class:`gap-0`,children:(n,r)=>{var a=t(),o=e(a);R(o,()=>vt,(e,t)=>{t(e,{children:(e,t)=>{var n=or(),r=x(n,!0);M(()=>i(r,s().auth.signupTitle)),T(e,n)},$$slots:{default:!0}})}),T(n,a)},$$slots:{default:!0}})});var c=F(a,2);R(c,()=>ot,(e,t)=>{t(e,{children:(e,t)=>{ir(e,{get account(){return o.account},get oncreate(){return o.oncreate}})},$$slots:{default:!0}})}),T(n,r)};z(c,e=>{_e&&e(l)});var d=F(c,2);R(d,()=>ft,(n,r)=>{r(n,{children:(n,r)=>{var a=t(),o=e(a),c=n=>{var r=t(),a=e(r);R(a,()=>Zn,(t,n)=>{n(t,{children:(t,n)=>{var r=cr(),a=e(r);zn(a,{color:`green`});var o=F(a,2);R(o,()=>qn,(e,t)=>{t(e,{children:(e,t)=>{m();var n=u();M(()=>i(n,s().auth.betterSecurity)),T(e,n)},$$slots:{default:!0}})});var c=F(o,2);R(c,()=>Wn,(e,t)=>{t(e,{children:(e,t)=>{f(e)},$$slots:{default:!0}})}),T(t,r)},$$slots:{default:!0}})}),T(n,r)},l=n=>{var r=t(),a=e(r);R(a,()=>Zn,(t,n)=>{n(t,{children:(t,n)=>{var r=cr(),a=e(r);Vn(a,{color:`red`,class:`animate-pulse`});var o=F(a,2);R(o,()=>qn,(e,t)=>{t(e,{children:(e,t)=>{m();var n=u();M(()=>i(n,s().auth.passkeysNotSupported)),T(e,n)},$$slots:{default:!0}})});var c=F(o,2);R(c,()=>Wn,(t,n)=>{n(t,{children:(t,n)=>{var r=lr(),a=e(r),o=x(a,!0),c=F(a,2);f(c),M(()=>i(o,s().auth.passkeysWarning)),T(t,r)},$$slots:{default:!0}})}),T(t,r)},$$slots:{default:!0}})}),T(n,r)};z(o,e=>{_e?e(c):e(l,-1)}),T(n,a)},$$slots:{default:!0}})}),T(n,a)},$$slots:{default:!0}})})}var v=F(g,2),S=e=>{nr(e,{})};z(v,e=>{_e&&!o.account&&e(S)}),a(h),T(r,h),V(),l()}var fr=w(`<!> <!> `,1);function pr(t,n){_(n,!0);let r=()=>b(X,`$dict`,a),[a,o]=L();async function s(e){let t=e.currentTarget;t.disabled=!0,await xe(n.account.id),t.disabled=!1}U(t,{class:`w-full disabled:[&>.x-icon]:hidden [&>.x-spinner]:hidden disabled:[&>.x-spinner]:block`,onclick:s,children:(t,n)=>{var a=fr(),o=e(a);$n(o,{class:`size-5 x-icon`});var s=F(o,2);Y(s,{class:`x-spinner`});var c=F(s);M(()=>i(c,` ${r().auth.refresh.continue??``}`)),T(t,a)},$$slots:{default:!0}}),V(),o()}var mr=c(`<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none"><path d="M19.84 10.2273C19.84 9.5182 19.7764 8.8364 19.6582 8.1818H10.24V12.05H15.6218C15.39 13.3 14.6855 14.3591 13.6264 15.0682V17.5773H16.8582C18.7491 15.8364 19.84 13.2727 19.84 10.2273Z" fill="#4285F4"></path><path d="M10.24 20C12.94 20 15.2036 19.1045 16.8581 17.5773L13.6263 15.0682C12.7309 15.6682 11.5854 16.0227 10.24 16.0227C7.6354 16.0227 5.4309 14.2636 4.6445 11.9H1.3036V14.4909C2.9491 17.7591 6.3309 20 10.24 20Z" fill="#34A853"></path><path d="M4.6445 11.9C4.4445 11.3 4.3309 10.6591 4.3309 10C4.3309 9.3409 4.4445 8.7 4.6445 8.1V5.5091H1.3036C0.6264 6.8591 0.24 8.3864 0.24 10C0.24 11.6136 0.6264 13.1409 1.3036 14.4909L4.6445 11.9Z" fill="#FBBC04"></path><path d="M10.24 3.9773C11.7081 3.9773 13.0263 4.4818 14.0627 5.4727L16.9309 2.6045C15.1991 0.9909 12.9354 0 10.24 0C6.3309 0 2.9491 2.2409 1.3036 5.5091L4.6445 8.1C5.4309 5.7364 7.6354 3.9773 10.24 3.9773Z" fill="#E94235"></path></svg>`);function hr(e,t){var n=mr();M(()=>j(n,0,O(t.class))),T(e,n)}var gr=c(`<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" fill="currentColor" viewBox="0 0 814 1000"><path d="M788.1 340.9c-5.8 4.5-108.2 62.2-108.2 190.5 0 148.4 130.3 200.9 134.2 202.2-.6 3.2-20.7 71.9-68.7 141.9-42.8 61.6-87.5 123.1-155.5 123.1s-85.5-39.5-164-39.5c-76.5 0-103.7 40.8-165.9 40.8s-105.6-57-155.5-127C46.7 790.7 0 663 0 541.8c0-194.4 126.4-297.5 250.8-297.5 66.1 0 121.2 43.4 162.7 43.4 39.5 0 101.1-46 176.3-46 28.5 0 130.9 2.6 198.3 99.2zm-234-181.5c31.1-36.9 53.1-88.1 53.1-139.3 0-7.1-.6-14.3-1.9-20.1-50.6 1.9-110.8 33.7-147.1 75.8-28.5 32.4-55.1 83.6-55.1 135.5 0 7.8 1.3 15.6 1.9 18.1 3.2.6 8.4 1.3 13.6 1.3 45.4 0 102.5-30.4 135.5-71.3z"></path></svg>`);function _r(e,t){_(t,!0);var n=gr(),r=x(n);M(e=>{j(n,0,e),y(r,`fill`,t.fill)},[()=>O(q(`size-5 -mt-[3px]`,t.class))]),T(e,n),V()}var vr={google:hr,apple:_r},yr=w(`<!> <!> <!>`,1);function br(t,i){_(i,!0);let a=P(()=>vr[i.idp]);async function o(e){let t=e.currentTarget;t.disabled=!0,await me(i.idp,i.account?.id),t.disabled=!1}{let s=P(()=>i.children?`default`:`icon`),c=P(()=>q(`disabled:[&_.x-icon]:hidden [&_.x-spinner]:hidden disabled:[&_.x-spinner]:block`,i.class));U(t,{variant:`outline`,get size(){return n(s)},onclick:o,get class(){return n(c)},children:(t,o)=>{var s=yr(),c=e(s);R(c,()=>n(a),(e,t)=>{t(e,{class:`x-icon`})});var l=F(c,2);Y(l,{class:`x-spinner`});var u=F(l,2);B(u,()=>i.children??r),T(t,s)},$$slots:{default:!0}})}V()}var xr=w(`<div class="flex gap-2"><!> <!></div>`);function Sr(e,t){_(t,!0);var n=xr(),r=d(n),i=e=>{br(e,{idp:`google`,get account(){return t.account}})};z(r,e=>{le.google.client&&e(i)});var o=F(r,2),s=e=>{br(e,{idp:`apple`,get account(){return t.account}})};z(o,e=>{le.apple.client&&e(s)}),a(n),T(e,n),V()}function Cr(e,t){_(t,!0);let n=()=>b(X,`$dict`,r),[r,a]=L(),o={google:`Google`,apple:`Apple`};br(e,{get idp(){return t.idp},class:`w-full`,children:(e,r)=>{m();var a=u();M(e=>i(a,e),[()=>n().auth.continueWith(o[t.idp])]),T(e,a)},$$slots:{default:!0}}),V(),a()}var wr=w(`<!> <!>`,1);function Tr(n,r){var a=t(),o=e(a);R(o,()=>xt,(n,a)=>{a(n,{class:`w-full`,children:(n,a)=>{var o=wr(),s=e(o);R(s,()=>ht,(t,n)=>{n(t,{children:(t,n)=>{var a=wr(),o=e(a);R(o,()=>vt,(e,t)=>{t(e,{children:(e,t)=>{m();var n=u();M(()=>i(n,r.title)),T(e,n)},$$slots:{default:!0}})});var s=F(o,2);R(s,()=>lt,(e,t)=>{t(e,{children:(e,t)=>{m();var n=u();M(()=>i(n,r.description)),T(e,n)},$$slots:{default:!0}})}),T(t,a)},$$slots:{default:!0}})});var c=F(s,2);R(c,()=>ot,(n,i)=>{i(n,{class:`flex flex-col`,children:(n,i)=>{var a=t(),o=e(a);B(o,()=>r.action),T(n,a)},$$slots:{default:!0}})}),T(n,o)},$$slots:{default:!0}})}),T(n,a)}var Er=w(`<!> `,1),Dr=w(`<div class="flex flex-col items-center gap-4 w-full"><!> <!></div>`);function Or(r,o){_(o,!0);let s=()=>b(X,`$dict`,c),[c,l]=L();ee(()=>{o.method===null&&he()});var u=Dr(),f=d(u);{let r=n=>{var r=t(),i=e(r),a=e=>{pr(e,{get account(){return o.account}})},s=e=>{Ln(e,{})},c=e=>{Cr(e,{idp:`apple`})},l=e=>{Cr(e,{idp:`google`})};z(i,e=>{o.method===`passkey`?e(a):o.method===`password`?e(s,1):o.method===`apple`?e(c,2):o.method===`google`&&e(l,3)}),T(n,r)},i=P(()=>s().auth.refresh.description(o.account.name));Tr(f,{get title(){return s().auth.refresh.title},get description(){return n(i)},action:r,$$slots:{action:!0}})}var p=F(f,2);U(p,{variant:`outline`,get onclick(){return he},children:(t,n)=>{var r=Er(),a=e(r);tt(a,{});var o=F(a);M(()=>i(o,` ${s().auth.signout??``}`)),T(t,r)},$$slots:{default:!0}}),a(u),T(r,u),V(),l()}var kr=new Set([`$$slots`,`$$events`,`$$legacy`]);function Ar(e,t){let n=h(t,kr),r=[[`circle`,{cx:`12`,cy:`12`,r:`4`}],[`path`,{d:`M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8`}]];H(e,k({name:`at-sign`},()=>n,{get iconNode(){return r}}))}var jr=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function Mr(r,i){_(i,!0);let a=S(i,`ref`,15,null),o=h(i,jr);var s=t(),c=e(s);{let e=P(()=>q(`text-sm flex-1 outline-none`,i.class));R(c,()=>pn,(t,r)=>{r(t,k({"data-slot":`tabs-content`,get class(){return n(e)}},()=>o,{get ref(){return a()},set ref(e){a(e)}}))})}T(r,s),V()}var Nr=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function Pr(r,i){_(i,!0);let a=S(i,`ref`,15,null),o=h(i,Nr);var s=t(),c=e(s);{let e=P(()=>q(`gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg:not([class*='size-'])]:size-4 relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent`,`data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100`,i.class));R(c,()=>yn,(t,r)=>{r(t,k({"data-slot":`tabs-trigger`,get class(){return n(e)}},()=>o,{get ref(){return a()},set ref(e){a(e)}}))})}T(r,s),V()}var Fr=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`value`,`class`]);function Ir(r,i){_(i,!0);let a=S(i,`ref`,15,null),o=S(i,`value`,15,``),s=h(i,Fr);var c=t(),l=e(c);{let e=P(()=>q(`gap-2 group/tabs flex data-[orientation=horizontal]:flex-col`,i.class));R(l,()=>un,(t,r)=>{r(t,k({"data-slot":`tabs`,get class(){return n(e)}},()=>s,{get ref(){return a()},set ref(e){a(e)},get value(){return o()},set value(e){o(e)}}))})}T(r,c),V()}var Lr=Re({base:`rounded-lg p-[3px] group-data-horizontal/tabs:h-8 data-[variant=line]:rounded-none group/tabs-list inline-flex w-fit items-center justify-center text-muted-foreground group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col`,variants:{variant:{default:`cn-tabs-list-variant-default bg-muted`,line:`cn-tabs-list-variant-line gap-1 bg-transparent`}},defaultVariants:{variant:`default`}}),Rr=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`variant`,`class`]);function zr(r,i){_(i,!0);let a=S(i,`ref`,15,null),o=S(i,`variant`,3,`default`),s=h(i,Rr);var c=t(),l=e(c);{let e=P(()=>q(Lr({variant:o()}),i.class));R(l,()=>gn,(t,r)=>{r(t,k({"data-slot":`tabs-list`,get"data-variant"(){return o()},get class(){return n(e)}},()=>s,{get ref(){return a()},set ref(e){a(e)}}))})}T(r,c),V()}var Br=w(`<!> `,1),Vr=w(`<!> <!>`,1),Hr=w(`<div class="flex justify-between gap-2"><!> <!></div> <!> <!>`,1);function Ur(r,o){_(o,!0);let s=()=>b(X,`$dict`,c),[c,l]=L(),u=A(null);function f(e){requestAnimationFrame(()=>{n(u)?.querySelector(`[data-value="${e}"] input[autofocus]`)?.focus()})}let p=A(`passkey`);ee(()=>{C(p,_e?`passkey`:`password`,!0)});var m=t(),h=e(m);{let t=P(()=>q(`w-full`,o.class));R(h,()=>Ir,(r,c)=>{c(r,{get class(){return n(t)},onValueChange:f,get value(){return n(p)},set value(e){C(p,e,!0)},get ref(){return n(u)},set ref(e){C(u,e,!0)},children:(t,n)=>{var r=Hr(),c=e(r),l=d(c);R(l,()=>zr,(t,n)=>{n(t,{children:(t,n)=>{var r=Vr(),a=e(r);R(a,()=>Pr,(t,n)=>{n(t,{value:`passkey`,"data-marker":`passkey-tab`,children:(t,n)=>{var r=Br(),a=e(r);$n(a,{color:`var(--muted-foreground)`});var o=F(a);M(()=>i(o,` ${s().auth.passkey??``}`)),T(t,r)},$$slots:{default:!0}})});var o=F(a,2);R(o,()=>Pr,(t,n)=>{n(t,{value:`password`,id:`iam-email-tab`,children:(t,n)=>{var r=Br(),a=e(r);Ar(a,{color:`var(--muted-foreground)`});var o=F(a);M(()=>i(o,` ${s().auth.email??``}`)),T(t,r)},$$slots:{default:!0}})}),T(t,r)},$$slots:{default:!0}})}),Sr(F(l,2),{get account(){return o.account}}),a(c);var u=F(c,2);R(u,()=>Mr,(e,t)=>{t(e,{value:`passkey`,children:(e,t)=>{dr(e,{get account(){return o.account},oncreate:e=>o.oncreate?.(e,`passkey`)})},$$slots:{default:!0}})});var f=F(u,2);R(f,()=>Mr,(e,t)=>{t(e,{value:`password`,children:(e,t)=>{In(e,{get account(){return o.account},oncreate:e=>o.oncreate?.(e,`password`)})},$$slots:{default:!0}})}),T(t,r)},$$slots:{default:!0}})})}T(r,m),V(),l()}var Wr=w(`<div class="flex items-center justify-center h-screen"><!></div>`),Gr=w(`<div class="flex w-full max-w-sm items-center justify-center pt-[14vh] px-4 mx-auto"><!></div>`);function Kr(r,i){_(i,!0);let o=()=>b(ae,`$iam`,f),s=()=>b(oe,`$method`,f),c=()=>b(Ce,`$authenticated`,f),l=()=>b(se,`$greeting`,f),u=()=>b(ce,`$processing`,f),[f,p]=L(),m=r=>{var a=t(),c=e(a),l=e=>{Or(e,{get account(){return o()},get method(){return s()}})},u=e=>{{let t=P(()=>q(`scale-0 transition-transform`,`scale-100`));Ur(e,{get class(){return n(t)},get account(){return i.account},get oncreate(){return i.oncreate}})}};z(c,e=>{o()?e(l):e(u,-1)}),T(r,a)};var h=t(),g=e(h),v=n=>{var r=t(),a=e(r);B(a,()=>i.children),T(n,r)},y=e=>{var t=Wr();Y(d(t),{}),a(t),T(e,t)},x=n=>{var r=t(),a=e(r);B(a,()=>i.screen,()=>({authentication:m})),T(n,r)},S=e=>{var t=Gr(),n=d(t);m(n),a(t),T(e,t)};z(g,e=>{c()?e(v):l()||u()?e(y,1):i.screen?e(x,2):e(S,-1)}),T(r,h),V(),p()}var qr=new Set([`$$slots`,`$$events`,`$$legacy`]);function Jr(e,t){let n=h(t,qr),r=[[`path`,{d:`M20 6 9 17l-5-5`}]];H(e,k({name:`check`},()=>n,{get iconNode(){return r}}))}var Yr=new Set([`$$slots`,`$$events`,`$$legacy`]);function Xr(e,t){let n=h(t,Yr),r=[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`}]];H(e,k({name:`copy`},()=>n,{get iconNode(){return r}}))}var Zr=new Set([`$$slots`,`$$events`,`$$legacy`,`text`,`label`,`disabled`,`oncopy`,`icon`,`class`]),Qr=w(`<!> <!>`,1);function $r(r,a){_(a,!0);let o=h(a,Zr),s=A(!1),c=A(!1),l=!navigator.clipboard;async function d(){if(!n(s)){if(C(c,!0),typeof ClipboardItem>`u`){let e=typeof a.text==`function`?await a.text():a.text;if(e===null)return;await navigator.clipboard.writeText(e)}else{let e=f(a.text);await navigator.clipboard.write([e])}C(c,!1),C(s,!0),a.oncopy?.(),setTimeout(()=>C(s,!1),2e3)}}function f(e){return typeof e==`function`?p(e):new ClipboardItem({"text/plain":new Blob([e],{type:`text/plain`})})}function p(e){return new ClipboardItem({"text/plain":e().then(e=>new Blob([e??``],{type:`text/plain`}))})}{let f=P(()=>q(a.class)),p=P(()=>a.disabled||l||n(c));U(r,k({get class(){return n(f)},onclick:d,get disabled(){return n(p)}},()=>o,{children:(r,o)=>{var l=Qr(),d=e(l),f=e=>{Jr(e,{class:`text-constructive`,strokeWidth:3})},p=e=>{Y(e,{})},m=n=>{var r=t(),i=e(r);B(i,()=>a.icon),T(n,r)},h=e=>{Xr(e,{})};z(d,e=>{n(s)?e(f):n(c)?e(p,1):a.icon===void 0?e(h,-1):e(m,2)});var g=F(d,2),_=e=>{var t=u();M(()=>i(t,a.label)),T(e,t)};z(g,e=>{a.label!==null&&e(_)}),T(r,l)},$$slots:{default:!0}}))}V()}function ei(e,t){return!!(e.dev!==void 0&&e.dev===!1||e.beta!==void 0&&e.beta===ti()||e.debug!==void 0&&e.debug===ni()||e.role!==void 0&&t?.roles!==void 0&&ri(t.roles,e.role))}function ti(){return typeof window<`u`&&window.location.hostname.startsWith(`beta.`)}function ni(){return ti()}function ri(e,t){for(let n of e)if(n===t||t.startsWith(n+`:`))return!0;return!1}var ii=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`denied`]),ai=w(`<div class="flex justify-center pt-[14vh]"><!></div>`);function oi(r,i){_(i,!0);let o=()=>b(ae,`$account`,c),s=()=>b(X,`$dict`,c),[c,l]=L(),u=h(i,ii),f=P(()=>ei(u,o())),p=P(()=>o()?.id??``);var m=t(),g=e(m),v=n=>{var r=t(),a=e(r);B(a,()=>i.children),T(n,r)},y=n=>{var r=t(),a=e(r);B(a,()=>i.denied),T(n,r)},x=e=>{var t=ai(),r=d(t);{let e=P(()=>n(p).slice(0,8));$r(r,{get text(){return n(p)},get label(){return n(e)},get"aria-label"(){return s().auth.copyId},variant:`outline`,class:`font-mono`})}a(t),T(e,t)};z(g,e=>{n(f)?e(v):i.denied===void 0?n(p)!==``&&e(x,2):e(y,1)}),T(r,m),V(),l()}var si=E(((e,t)=>{t.exports=function(){return typeof Promise==`function`&&Promise.prototype&&Promise.prototype.then}})),Q=E((e=>{var t,n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];e.getSymbolSize=function(e){if(!e)throw Error(`"version" cannot be null or undefined`);if(e<1||e>40)throw Error(`"version" should be in range from 1 to 40`);return e*4+17},e.getSymbolTotalCodewords=function(e){return n[e]},e.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t},e.setToSJISFunction=function(e){if(typeof e!=`function`)throw Error(`"toSJISFunc" is not a valid function.`);t=e},e.isKanjiModeEnabled=function(){return t!==void 0},e.toSJIS=function(e){return t(e)}})),ci=E((e=>{e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`l`:case`low`:return e.L;case`m`:case`medium`:return e.M;case`q`:case`quartile`:return e.Q;case`h`:case`high`:return e.H;default:throw Error(`Unknown EC Level: `+t)}}e.isValid=function(e){return e&&e.bit!==void 0&&e.bit>=0&&e.bit<4},e.from=function(n,r){if(e.isValid(n))return n;try{return t(n)}catch{return r}}})),li=E(((e,t)=>{function n(){this.buffer=[],this.length=0}n.prototype={get:function(e){let t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(let n=0;n<t;n++)this.putBit((e>>>t-n-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){let t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},t.exports=n})),ui=E(((e,t)=>{function n(e){if(!e||e<1)throw Error(`BitMatrix size must be defined and greater than 0`);this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}n.prototype.set=function(e,t,n,r){let i=e*this.size+t;this.data[i]=n,r&&(this.reservedBit[i]=!0)},n.prototype.get=function(e,t){return this.data[e*this.size+t]},n.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n},n.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},t.exports=n})),di=E((e=>{var t=Q().getSymbolSize;e.getRowColCoords=function(e){if(e===1)return[];let n=Math.floor(e/7)+2,r=t(e),i=r===145?26:Math.ceil((r-13)/(2*n-2))*2,a=[r-7];for(let e=1;e<n-1;e++)a[e]=a[e-1]-i;return a.push(6),a.reverse()},e.getPositions=function(t){let n=[],r=e.getRowColCoords(t),i=r.length;for(let e=0;e<i;e++)for(let t=0;t<i;t++)e===0&&t===0||e===0&&t===i-1||e===i-1&&t===0||n.push([r[e],r[t]]);return n}})),fi=E((e=>{var t=Q().getSymbolSize,n=7;e.getPositions=function(e){let r=t(e);return[[0,0],[r-n,0],[0,r-n]]}})),pi=E((e=>{e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(e){return e!=null&&e!==``&&!isNaN(e)&&e>=0&&e<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(e){let n=e.size,r=0,i=0,a=0,o=null,s=null;for(let c=0;c<n;c++){i=a=0,o=s=null;for(let l=0;l<n;l++){let n=e.get(c,l);n===o?i++:(i>=5&&(r+=t.N1+(i-5)),o=n,i=1),n=e.get(l,c),n===s?a++:(a>=5&&(r+=t.N1+(a-5)),s=n,a=1)}i>=5&&(r+=t.N1+(i-5)),a>=5&&(r+=t.N1+(a-5))}return r},e.getPenaltyN2=function(e){let n=e.size,r=0;for(let t=0;t<n-1;t++)for(let i=0;i<n-1;i++){let n=e.get(t,i)+e.get(t,i+1)+e.get(t+1,i)+e.get(t+1,i+1);(n===4||n===0)&&r++}return r*t.N2},e.getPenaltyN3=function(e){let n=e.size,r=0,i=0,a=0;for(let t=0;t<n;t++){i=a=0;for(let o=0;o<n;o++)i=i<<1&2047|e.get(t,o),o>=10&&(i===1488||i===93)&&r++,a=a<<1&2047|e.get(o,t),o>=10&&(a===1488||a===93)&&r++}return r*t.N3},e.getPenaltyN4=function(e){let n=0,r=e.data.length;for(let t=0;t<r;t++)n+=e.data[t];return Math.abs(Math.ceil(n*100/r/5)-10)*t.N4};function n(t,n,r){switch(t){case e.Patterns.PATTERN000:return(n+r)%2==0;case e.Patterns.PATTERN001:return n%2==0;case e.Patterns.PATTERN010:return r%3==0;case e.Patterns.PATTERN011:return(n+r)%3==0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2==0;case e.Patterns.PATTERN101:return n*r%2+n*r%3==0;case e.Patterns.PATTERN110:return(n*r%2+n*r%3)%2==0;case e.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2==0;default:throw Error(`bad maskPattern:`+t)}}e.applyMask=function(e,t){let r=t.size;for(let i=0;i<r;i++)for(let a=0;a<r;a++)t.isReserved(a,i)||t.xor(a,i,n(e,a,i))},e.getBestMask=function(t,n){let r=Object.keys(e.Patterns).length,i=0,a=1/0;for(let o=0;o<r;o++){n(o),e.applyMask(o,t);let r=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(o,t),r<a&&(a=r,i=o)}return i}})),mi=E((e=>{var t=ci(),n=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];e.getBlocksCount=function(e,r){switch(r){case t.L:return n[(e-1)*4+0];case t.M:return n[(e-1)*4+1];case t.Q:return n[(e-1)*4+2];case t.H:return n[(e-1)*4+3];default:return}},e.getTotalCodewordsCount=function(e,n){switch(n){case t.L:return r[(e-1)*4+0];case t.M:return r[(e-1)*4+1];case t.Q:return r[(e-1)*4+2];case t.H:return r[(e-1)*4+3];default:return}}})),hi=E((e=>{var t=new Uint8Array(512),n=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)t[r]=e,n[e]=r,e<<=1,e&256&&(e^=285);for(let e=255;e<512;e++)t[e]=t[e-255]})(),e.log=function(e){if(e<1)throw Error(`log(`+e+`)`);return n[e]},e.exp=function(e){return t[e]},e.mul=function(e,r){return e===0||r===0?0:t[n[e]+n[r]]}})),gi=E((e=>{var t=hi();e.mul=function(e,n){let r=new Uint8Array(e.length+n.length-1);for(let i=0;i<e.length;i++)for(let a=0;a<n.length;a++)r[i+a]^=t.mul(e[i],n[a]);return r},e.mod=function(e,n){let r=new Uint8Array(e);for(;r.length-n.length>=0;){let e=r[0];for(let i=0;i<n.length;i++)r[i]^=t.mul(n[i],e);let i=0;for(;i<r.length&&r[i]===0;)i++;r=r.slice(i)}return r},e.generateECPolynomial=function(n){let r=new Uint8Array([1]);for(let i=0;i<n;i++)r=e.mul(r,new Uint8Array([1,t.exp(i)]));return r}})),_i=E(((e,t)=>{var n=gi();function r(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}r.prototype.initialize=function(e){this.degree=e,this.genPoly=n.generateECPolynomial(this.degree)},r.prototype.encode=function(e){if(!this.genPoly)throw Error(`Encoder not initialized`);let t=new Uint8Array(e.length+this.degree);t.set(e);let r=n.mod(t,this.genPoly),i=this.degree-r.length;if(i>0){let e=new Uint8Array(this.degree);return e.set(r,i),e}return r},t.exports=r})),vi=E((e=>{e.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}})),yi=E((e=>{var t=`[0-9]+`,n=`[A-Z $%*+\\-./:]+`,r=`(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+`;r=r.replace(/u/g,`\\u`);var i=`(?:(?![A-Z0-9 $%*+\\-./:]|`+r+`)(?:.|[\r
|
|
2
|
+
]))+`;e.KANJI=new RegExp(r,`g`),e.BYTE_KANJI=RegExp(`[^A-Z0-9 $%*+\\-./:]+`,`g`),e.BYTE=new RegExp(i,`g`),e.NUMERIC=new RegExp(t,`g`),e.ALPHANUMERIC=new RegExp(n,`g`);var a=RegExp(`^`+r+`$`),o=RegExp(`^[0-9]+$`),s=RegExp(`^[A-Z0-9 $%*+\\-./:]+$`);e.testKanji=function(e){return a.test(e)},e.testNumeric=function(e){return o.test(e)},e.testAlphanumeric=function(e){return s.test(e)}})),$=E((e=>{var t=vi(),n=yi();e.NUMERIC={id:`Numeric`,bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:`Alphanumeric`,bit:2,ccBits:[9,11,13]},e.BYTE={id:`Byte`,bit:4,ccBits:[8,16,16]},e.KANJI={id:`Kanji`,bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(e,n){if(!e.ccBits)throw Error(`Invalid mode: `+e);if(!t.isValid(n))throw Error(`Invalid version: `+n);return n>=1&&n<10?e.ccBits[0]:n<27?e.ccBits[1]:e.ccBits[2]},e.getBestModeForData=function(t){return n.testNumeric(t)?e.NUMERIC:n.testAlphanumeric(t)?e.ALPHANUMERIC:n.testKanji(t)?e.KANJI:e.BYTE},e.toString=function(e){if(e&&e.id)return e.id;throw Error(`Invalid mode`)},e.isValid=function(e){return e&&e.bit&&e.ccBits};function r(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`numeric`:return e.NUMERIC;case`alphanumeric`:return e.ALPHANUMERIC;case`kanji`:return e.KANJI;case`byte`:return e.BYTE;default:throw Error(`Unknown mode: `+t)}}e.from=function(t,n){if(e.isValid(t))return t;try{return r(t)}catch{return n}}})),bi=E((e=>{var t=Q(),n=mi(),r=ci(),i=$(),a=vi(),o=7973,s=t.getBCHDigit(o);function c(t,n,r){for(let i=1;i<=40;i++)if(n<=e.getCapacity(i,r,t))return i}function l(e,t){return i.getCharCountIndicator(e,t)+4}function u(e,t){let n=0;return e.forEach(function(e){let r=l(e.mode,t);n+=r+e.getBitsLength()}),n}function d(t,n){for(let r=1;r<=40;r++)if(u(t,r)<=e.getCapacity(r,n,i.MIXED))return r}e.from=function(e,t){return a.isValid(e)?parseInt(e,10):t},e.getCapacity=function(e,r,o){if(!a.isValid(e))throw Error(`Invalid QR Code version`);o===void 0&&(o=i.BYTE);let s=(t.getSymbolTotalCodewords(e)-n.getTotalCodewordsCount(e,r))*8;if(o===i.MIXED)return s;let c=s-l(o,e);switch(o){case i.NUMERIC:return Math.floor(c/10*3);case i.ALPHANUMERIC:return Math.floor(c/11*2);case i.KANJI:return Math.floor(c/13);case i.BYTE:default:return Math.floor(c/8)}},e.getBestVersionForData=function(e,t){let n,i=r.from(t,r.M);if(Array.isArray(e)){if(e.length>1)return d(e,i);if(e.length===0)return 1;n=e[0]}else n=e;return c(n.mode,n.getLength(),i)},e.getEncodedBits=function(e){if(!a.isValid(e)||e<7)throw Error(`Invalid QR Code version`);let n=e<<12;for(;t.getBCHDigit(n)-s>=0;)n^=o<<t.getBCHDigit(n)-s;return e<<12|n}})),xi=E((e=>{var t=Q(),n=1335,r=21522,i=t.getBCHDigit(n);e.getEncodedBits=function(e,a){let o=e.bit<<3|a,s=o<<10;for(;t.getBCHDigit(s)-i>=0;)s^=n<<t.getBCHDigit(s)-i;return(o<<10|s)^r}})),Si=E(((e,t)=>{var n=$();function r(e){this.mode=n.NUMERIC,this.data=e.toString()}r.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(e){let t,n,r;for(t=0;t+3<=this.data.length;t+=3)n=this.data.substr(t,3),r=parseInt(n,10),e.put(r,10);let i=this.data.length-t;i>0&&(n=this.data.substr(t),r=parseInt(n,10),e.put(r,i*3+1))},t.exports=r})),Ci=E(((e,t)=>{var n=$(),r=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`.split(``);function i(e){this.mode=n.ALPHANUMERIC,this.data=e}i.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t=0;for(;t+2<=this.data.length;t+=2){let n=r.indexOf(this.data[t])*45;n+=r.indexOf(this.data[t+1]),e.put(n,11)}this.data.length%2&&e.put(r.indexOf(this.data[t]),6)},t.exports=i})),wi=E(((e,t)=>{var n=$();function r(e){this.mode=n.BYTE,this.data=typeof e==`string`?new TextEncoder().encode(e):new Uint8Array(e)}r.getBitsLength=function(e){return e*8},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(e){for(let t=0,n=this.data.length;t<n;t++)e.put(this.data[t],8)},t.exports=r})),Ti=E(((e,t)=>{var n=$(),r=Q();function i(e){this.mode=n.KANJI,this.data=e}i.getBitsLength=function(e){return e*13},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t=0;for(;t<this.data.length;t++){let n=r.toSJIS(this.data[t]);if(n>=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw Error(`Invalid SJIS character: `+this.data[t]+`
|
|
3
|
+
Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),e.put(n,13)}},t.exports=i})),Ei=E(((e,t)=>{var n={single_source_shortest_paths:function(e,t,r){var i={},a={};a[t]=0;var o=n.PriorityQueue.make();o.push(t,0);for(var s,c,l,u,d,f,p,m,h;!o.empty();)for(l in s=o.pop(),c=s.value,u=s.cost,d=e[c]||{},d)d.hasOwnProperty(l)&&(f=d[l],p=u+f,m=a[l],h=a[l]===void 0,(h||m>p)&&(a[l]=p,o.push(l,p),i[l]=c));if(r!==void 0&&a[r]===void 0){var g=[`Could not find a path from `,t,` to `,r,`.`].join(``);throw Error(g)}return i},extract_shortest_path_from_predecessor_list:function(e,t){for(var n=[],r=t;r;)n.push(r),e[r],r=e[r];return n.reverse(),n},find_path:function(e,t,r){var i=n.single_source_shortest_paths(e,t,r);return n.extract_shortest_path_from_predecessor_list(i,r)},PriorityQueue:{make:function(e){var t=n.PriorityQueue,r={},i;for(i in e||={},t)t.hasOwnProperty(i)&&(r[i]=t[i]);return r.queue=[],r.sorter=e.sorter||t.default_sorter,r},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var n={value:e,cost:t};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t!==void 0&&(t.exports=n)})),Di=E((e=>{var t=$(),n=Si(),r=Ci(),i=wi(),a=Ti(),o=yi(),s=Q(),c=Ei();function l(e){return unescape(encodeURIComponent(e)).length}function u(e,t,n){let r=[],i;for(;(i=e.exec(n))!==null;)r.push({data:i[0],index:i.index,mode:t,length:i[0].length});return r}function d(e){let n=u(o.NUMERIC,t.NUMERIC,e),r=u(o.ALPHANUMERIC,t.ALPHANUMERIC,e),i,a;return s.isKanjiModeEnabled()?(i=u(o.BYTE,t.BYTE,e),a=u(o.KANJI,t.KANJI,e)):(i=u(o.BYTE_KANJI,t.BYTE,e),a=[]),n.concat(r,i,a).sort(function(e,t){return e.index-t.index}).map(function(e){return{data:e.data,mode:e.mode,length:e.length}})}function f(e,o){switch(o){case t.NUMERIC:return n.getBitsLength(e);case t.ALPHANUMERIC:return r.getBitsLength(e);case t.KANJI:return a.getBitsLength(e);case t.BYTE:return i.getBitsLength(e)}}function p(e){return e.reduce(function(e,t){let n=e.length-1>=0?e[e.length-1]:null;return n&&n.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)},[])}function m(e){let n=[];for(let r=0;r<e.length;r++){let i=e[r];switch(i.mode){case t.NUMERIC:n.push([i,{data:i.data,mode:t.ALPHANUMERIC,length:i.length},{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.ALPHANUMERIC:n.push([i,{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.KANJI:n.push([i,{data:i.data,mode:t.BYTE,length:l(i.data)}]);break;case t.BYTE:n.push([{data:i.data,mode:t.BYTE,length:l(i.data)}])}}return n}function h(e,n){let r={},i={start:{}},a=[`start`];for(let o=0;o<e.length;o++){let s=e[o],c=[];for(let e=0;e<s.length;e++){let l=s[e],u=``+o+e;c.push(u),r[u]={node:l,lastCount:0},i[u]={};for(let e=0;e<a.length;e++){let o=a[e];r[o]&&r[o].node.mode===l.mode?(i[o][u]=f(r[o].lastCount+l.length,l.mode)-f(r[o].lastCount,l.mode),r[o].lastCount+=l.length):(r[o]&&(r[o].lastCount=l.length),i[o][u]=f(l.length,l.mode)+4+t.getCharCountIndicator(l.mode,n))}}a=c}for(let e=0;e<a.length;e++)i[a[e]].end=0;return{map:i,table:r}}function g(e,o){let c,l=t.getBestModeForData(e);if(c=t.from(o,l),c!==t.BYTE&&c.bit<l.bit)throw Error(`"`+e+`" cannot be encoded with mode `+t.toString(c)+`.
|
|
4
|
+
Suggested mode is: `+t.toString(l));switch(c===t.KANJI&&!s.isKanjiModeEnabled()&&(c=t.BYTE),c){case t.NUMERIC:return new n(e);case t.ALPHANUMERIC:return new r(e);case t.KANJI:return new a(e);case t.BYTE:return new i(e)}}e.fromArray=function(e){return e.reduce(function(e,t){return typeof t==`string`?e.push(g(t,null)):t.data&&e.push(g(t.data,t.mode)),e},[])},e.fromString=function(t,n){let r=h(m(d(t,s.isKanjiModeEnabled())),n),i=c.find_path(r.map,`start`,`end`),a=[];for(let e=1;e<i.length-1;e++)a.push(r.table[i[e]].node);return e.fromArray(p(a))},e.rawSplit=function(t){return e.fromArray(d(t,s.isKanjiModeEnabled()))}})),Oi=E((e=>{var t=Q(),n=ci(),r=li(),i=ui(),a=di(),o=fi(),s=pi(),c=mi(),l=_i(),u=bi(),d=xi(),f=$(),p=Di();function m(e,t){let n=e.size,r=o.getPositions(t);for(let t=0;t<r.length;t++){let i=r[t][0],a=r[t][1];for(let t=-1;t<=7;t++)if(!(i+t<=-1||n<=i+t))for(let r=-1;r<=7;r++)a+r<=-1||n<=a+r||(t>=0&&t<=6&&(r===0||r===6)||r>=0&&r<=6&&(t===0||t===6)||t>=2&&t<=4&&r>=2&&r<=4?e.set(i+t,a+r,!0,!0):e.set(i+t,a+r,!1,!0))}}function h(e){let t=e.size;for(let n=8;n<t-8;n++){let t=n%2==0;e.set(n,6,t,!0),e.set(6,n,t,!0)}}function g(e,t){let n=a.getPositions(t);for(let t=0;t<n.length;t++){let r=n[t][0],i=n[t][1];for(let t=-2;t<=2;t++)for(let n=-2;n<=2;n++)t===-2||t===2||n===-2||n===2||t===0&&n===0?e.set(r+t,i+n,!0,!0):e.set(r+t,i+n,!1,!0)}}function _(e,t){let n=e.size,r=u.getEncodedBits(t),i,a,o;for(let t=0;t<18;t++)i=Math.floor(t/3),a=t%3+n-8-3,o=(r>>t&1)==1,e.set(i,a,o,!0),e.set(a,i,o,!0)}function v(e,t,n){let r=e.size,i=d.getEncodedBits(t,n),a,o;for(a=0;a<15;a++)o=(i>>a&1)==1,a<6?e.set(a,8,o,!0):a<8?e.set(a+1,8,o,!0):e.set(r-15+a,8,o,!0),a<8?e.set(8,r-a-1,o,!0):a<9?e.set(8,15-a-1+1,o,!0):e.set(8,15-a-1,o,!0);e.set(r-8,8,1,!0)}function y(e,t){let n=e.size,r=-1,i=n-1,a=7,o=0;for(let s=n-1;s>0;s-=2)for(s===6&&s--;;){for(let n=0;n<2;n++)if(!e.isReserved(i,s-n)){let r=!1;o<t.length&&(r=(t[o]>>>a&1)==1),e.set(i,s-n,r),a--,a===-1&&(o++,a=7)}if(i+=r,i<0||n<=i){i-=r,r=-r;break}}}function b(e,n,i){let a=new r;i.forEach(function(t){a.put(t.mode.bit,4),a.put(t.getLength(),f.getCharCountIndicator(t.mode,e)),t.write(a)});let o=(t.getSymbolTotalCodewords(e)-c.getTotalCodewordsCount(e,n))*8;for(a.getLengthInBits()+4<=o&&a.put(0,4);a.getLengthInBits()%8!=0;)a.putBit(0);let s=(o-a.getLengthInBits())/8;for(let e=0;e<s;e++)a.put(e%2?17:236,8);return x(a,e,n)}function x(e,n,r){let i=t.getSymbolTotalCodewords(n),a=i-c.getTotalCodewordsCount(n,r),o=c.getBlocksCount(n,r),s=o-i%o,u=Math.floor(i/o),d=Math.floor(a/o),f=d+1,p=u-d,m=new l(p),h=0,g=Array(o),_=Array(o),v=0,y=new Uint8Array(e.buffer);for(let e=0;e<o;e++){let t=e<s?d:f;g[e]=y.slice(h,h+t),_[e]=m.encode(g[e]),h+=t,v=Math.max(v,t)}let b=new Uint8Array(i),x=0,S,C;for(S=0;S<v;S++)for(C=0;C<o;C++)S<g[C].length&&(b[x++]=g[C][S]);for(S=0;S<p;S++)for(C=0;C<o;C++)b[x++]=_[C][S];return b}function S(e,n,r,a){let o;if(Array.isArray(e))o=p.fromArray(e);else if(typeof e==`string`){let t=n;if(!t){let n=p.rawSplit(e);t=u.getBestVersionForData(n,r)}o=p.fromString(e,t||40)}else throw Error(`Invalid data`);let c=u.getBestVersionForData(o,r);if(!c)throw Error(`The amount of data is too big to be stored in a QR Code`);if(!n)n=c;else if(n<c)throw Error(`
|
|
5
|
+
The chosen QR Code version cannot contain this amount of data.
|
|
6
|
+
Minimum version required to store current data is: `+c+`.
|
|
7
|
+
`);let l=b(n,r,o),d=new i(t.getSymbolSize(n));return m(d,n),h(d),g(d,n),v(d,r,0),n>=7&&_(d,n),y(d,l),isNaN(a)&&(a=s.getBestMask(d,v.bind(null,d,r))),s.applyMask(a,d),v(d,r,a),{modules:d,version:n,errorCorrectionLevel:r,maskPattern:a,segments:o}}e.create=function(e,r){if(e===void 0||e===``)throw Error(`No input text`);let i=n.M,a,o;return r!==void 0&&(i=n.from(r.errorCorrectionLevel,n.M),a=u.from(r.version),o=s.from(r.maskPattern),r.toSJISFunc&&t.setToSJISFunction(r.toSJISFunc)),S(e,a,i,o)}})),ki=E((e=>{function t(e){if(typeof e==`number`&&(e=e.toString()),typeof e!=`string`)throw Error(`Color should be defined as hex string`);let t=e.slice().replace(`#`,``).split(``);if(t.length<3||t.length===5||t.length>8)throw Error(`Invalid hex color: `+e);(t.length===3||t.length===4)&&(t=Array.prototype.concat.apply([],t.map(function(e){return[e,e]}))),t.length===6&&t.push(`F`,`F`);let n=parseInt(t.join(``),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:n&255,hex:`#`+t.slice(0,6).join(``)}}e.getOptions=function(e){e||={},e.color||(e.color={});let n=e.margin===void 0||e.margin===null||e.margin<0?4:e.margin,r=e.width&&e.width>=21?e.width:void 0,i=e.scale||4;return{width:r,scale:r?4:i,margin:n,color:{dark:t(e.color.dark||`#000000ff`),light:t(e.color.light||`#ffffffff`)},type:e.type,rendererOpts:e.rendererOpts||{}}},e.getScale=function(e,t){return t.width&&t.width>=e+t.margin*2?t.width/(e+t.margin*2):t.scale},e.getImageWidth=function(t,n){let r=e.getScale(t,n);return Math.floor((t+n.margin*2)*r)},e.qrToImageData=function(t,n,r){let i=n.modules.size,a=n.modules.data,o=e.getScale(i,r),s=Math.floor((i+r.margin*2)*o),c=r.margin*o,l=[r.color.light,r.color.dark];for(let e=0;e<s;e++)for(let n=0;n<s;n++){let u=(e*s+n)*4,d=r.color.light;if(e>=c&&n>=c&&e<s-c&&n<s-c){let t=Math.floor((e-c)/o),r=Math.floor((n-c)/o);d=l[+!!a[t*i+r]]}t[u++]=d.r,t[u++]=d.g,t[u++]=d.b,t[u]=d.a}}})),Ai=E((e=>{var t=ki();function n(e,t,n){e.clearRect(0,0,t.width,t.height),t.style||={},t.height=n,t.width=n,t.style.height=n+`px`,t.style.width=n+`px`}function r(){try{return document.createElement(`canvas`)}catch{throw Error(`You need to specify a canvas element`)}}e.render=function(e,i,a){let o=a,s=i;o===void 0&&(!i||!i.getContext)&&(o=i,i=void 0),i||(s=r()),o=t.getOptions(o);let c=t.getImageWidth(e.modules.size,o),l=s.getContext(`2d`),u=l.createImageData(c,c);return t.qrToImageData(u.data,e,o),n(l,s,c),l.putImageData(u,0,0),s},e.renderToDataURL=function(t,n,r){let i=r;i===void 0&&(!n||!n.getContext)&&(i=n,n=void 0),i||={};let a=e.render(t,n,i),o=i.type||`image/png`,s=i.rendererOpts||{};return a.toDataURL(o,s.quality)}})),ji=E((e=>{var t=ki();function n(e,t){let n=e.a/255,r=t+`="`+e.hex+`"`;return n<1?r+` `+t+`-opacity="`+n.toFixed(2).slice(1)+`"`:r}function r(e,t,n){let r=e+t;return n!==void 0&&(r+=` `+n),r}function i(e,t,n){let i=``,a=0,o=!1,s=0;for(let c=0;c<e.length;c++){let l=Math.floor(c%t),u=Math.floor(c/t);!l&&!o&&(o=!0),e[c]?(s++,c>0&&l>0&&e[c-1]||(i+=o?r(`M`,l+n,.5+u+n):r(`m`,a,0),a=0,o=!1),l+1<t&&e[c+1]||(i+=r(`h`,s),s=0)):a++}return i}e.render=function(e,r,a){let o=t.getOptions(r),s=e.modules.size,c=e.modules.data,l=s+o.margin*2,u=o.color.light.a?`<path `+n(o.color.light,`fill`)+` d="M0 0h`+l+`v`+l+`H0z"/>`:``,d=`<path `+n(o.color.dark,`stroke`)+` d="`+i(c,s,o.margin)+`"/>`,f=`viewBox="0 0 `+l+` `+l+`"`,p=`<svg xmlns="http://www.w3.org/2000/svg" `+(o.width?`width="`+o.width+`" height="`+o.width+`" `:``)+f+` shape-rendering="crispEdges">`+u+d+`</svg>
|
|
8
|
+
`;return typeof a==`function`&&a(null,p),p}}));E((e=>{var t=si(),n=Oi(),r=Ai(),i=ji();function a(e,r,i,a,o){let s=[].slice.call(arguments,1),c=s.length,l=typeof s[c-1]==`function`;if(!l&&!t())throw Error(`Callback required as last argument`);if(l){if(c<2)throw Error(`Too few arguments provided`);c===2?(o=i,i=r,r=a=void 0):c===3&&(r.getContext&&o===void 0?(o=a,a=void 0):(o=a,a=i,i=r,r=void 0))}else{if(c<1)throw Error(`Too few arguments provided`);return c===1?(i=r,r=a=void 0):c===2&&!r.getContext&&(a=i,i=r,r=void 0),new Promise(function(t,o){try{t(e(n.create(i,a),r,a))}catch(e){o(e)}})}try{let t=n.create(i,a);o(null,e(t,r,a))}catch(e){o(e)}}e.create=n.create,e.toCanvas=a.bind(null,r.render),e.toDataURL=a.bind(null,r.renderToDataURL),e.toString=a.bind(null,function(e,t,n){return i.render(e,n)})}))(),vr.google,vr.apple;export{tt as i,Kr as n,Et as r,oi as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`);
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/.configuration/_app/immutable/nodes/0.BGAo0V8q.js","/.configuration/_app/immutable/chunks/CcD_ISxM.js","/.configuration/_app/immutable/chunks/BkLAzDsj.js","/.configuration/_app/immutable/chunks/xihTtKlq.js","/.configuration/_app/immutable/chunks/Ccdp29n0.js","/.configuration/_app/immutable/chunks/C_aaOW6e.js","/.configuration/_app/immutable/assets/0.BGFdDICE.css","/.configuration/_app/immutable/nodes/1.DYGSbNvw.js","/.configuration/_app/immutable/nodes/2.nR_WPY04.js","/.configuration/_app/immutable/chunks/Dw75U_Lh.js","/.configuration/_app/immutable/chunks/sXOccAdQ.js","/.configuration/_app/immutable/assets/ui.BghF56l_.css","/.configuration/_app/immutable/nodes/3.p9Hd9gcE.js","/.configuration/_app/immutable/nodes/4.Chf5nqMR.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{$ as e,A as t,B as n,E as r,Et as i,H as a,J as o,P as s,Q as c,Y as l,bt as u,i as d,it as f,j as p,k as m,n as h,ot as g,q as _,r as v,s as y,st as b,tt as x,v as S,w as C,yt as w}from"../chunks/CcD_ISxM.js";import"../chunks/xihTtKlq.js";var T=`modulepreload`,E=function(e,t){return new URL(e,t).href},D={},O=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=E(t,n),t=s(t),t in D)return;D[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:T,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},k={},A=p(`<div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"><!></div>`),j=p(`<!> <!>`,1);function M(p,v){u(v,!0);let T=d(v,`components`,23,()=>[]),E=d(v,`data_0`,3,null),D=d(v,`data_1`,3,null),O=d(v,`data_2`,3,null);l(()=>v.stores.page.set(v.page)),o(()=>{v.stores,v.page,v.constructors,T(),v.form,E(),D(),O(),v.stores.page.notify()});let k=g(!1),M=g(!1),N=g(null);h(()=>{let e=v.stores.page.subscribe(()=>{n(k)&&(f(M,!0),a().then(()=>{f(N,document.title||`untitled page`,!0)}))});return f(k,!0),e});let P=b(()=>v.constructors[2]);var F=j(),I=e(F),L=r=>{let i=b(()=>v.constructors[0]);var a=t(),o=e(a);S(o,()=>n(i),(r,i)=>{y(i(r,{get data(){return E()},get form(){return v.form},get params(){return v.page.params},children:(r,i)=>{var a=t(),o=e(a),s=r=>{let i=b(()=>v.constructors[1]);var a=t(),o=e(a);S(o,()=>n(i),(r,i)=>{y(i(r,{get data(){return D()},get form(){return v.form},get params(){return v.page.params},children:(r,i)=>{var a=t(),o=e(a);S(o,()=>n(P),(e,t)=>{y(t(e,{get data(){return O()},get form(){return v.form},get params(){return v.page.params}}),e=>T()[2]=e,()=>T()?.[2])}),m(r,a)},$$slots:{default:!0}}),e=>T()[1]=e,()=>T()?.[1])}),m(r,a)},c=r=>{let i=b(()=>v.constructors[1]);var a=t(),o=e(a);S(o,()=>n(i),(e,t)=>{y(t(e,{get data(){return D()},get form(){return v.form},get params(){return v.page.params}}),e=>T()[1]=e,()=>T()?.[1])}),m(r,a)};C(o,e=>{v.constructors[2]?e(s):e(c,-1)}),m(r,a)},$$slots:{default:!0}}),e=>T()[0]=e,()=>T()?.[0])}),m(r,a)},R=r=>{let i=b(()=>v.constructors[0]);var a=t(),o=e(a);S(o,()=>n(i),(e,t)=>{y(t(e,{get data(){return E()},get form(){return v.form},get params(){return v.page.params}}),e=>T()[0]=e,()=>T()?.[0])}),m(r,a)};C(I,e=>{v.constructors[1]?e(L):e(R,-1)});var z=x(I,2),B=e=>{var t=A(),a=c(t),o=e=>{var t=s();_(()=>r(t,n(N))),m(e,t)};C(a,e=>{n(M)&&e(o)}),i(t),m(e,t)};C(z,e=>{n(k)&&e(B)}),m(p,F),w()}var N=v(M),P=[()=>O(()=>import(`../nodes/0.BGAo0V8q.js`),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url),()=>O(()=>import(`../nodes/1.DYGSbNvw.js`),__vite__mapDeps([7,1,3,5,2]),import.meta.url),()=>O(()=>import(`../nodes/2.nR_WPY04.js`),__vite__mapDeps([8,1,2,3,4,9,5,10,11]),import.meta.url),()=>O(()=>import(`../nodes/3.p9Hd9gcE.js`),__vite__mapDeps([12,1,3,9,2,4]),import.meta.url),()=>O(()=>import(`../nodes/4.Chf5nqMR.js`),__vite__mapDeps([13,1,2,3,4,9,5,10,11]),import.meta.url)],F=[],I={"/(private)":[3,[2]],"/(private)/[component]":[4,[2]]},L={handleError:(({error:e})=>{console.error(e)}),reroute:(()=>{}),transport:{}},R=Object.fromEntries(Object.entries(L.transport).map(([e,t])=>[e,t.decode])),z=Object.fromEntries(Object.entries(L.transport).map(([e,t])=>[e,t.encode])),B=!1,V=(e,t)=>R[e](t),H=()=>O(()=>import(`../chunks/Bjy-W4x2.js`).then(e=>e.default),[],import.meta.url);export{V as decode,R as decoders,I as dictionary,z as encoders,H as get_error_template,B as hash,L as hooks,k as matchers,P as nodes,N as root,F as server_loads};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e,r as t}from"../chunks/BkLAzDsj.js";export{e as load_css,t as start};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as e,A as t,B as n,G as r,J as i,X as a,bt as o,d as s,dt as c,g as l,ht as u,j as d,jt as f,k as p,q as m,st as h,ut as g,y as _,yt as v}from"../chunks/CcD_ISxM.js";import{n as y}from"../chunks/BkLAzDsj.js";import"../chunks/xihTtKlq.js";import{C as b,S as x,T as S,b as C,o as w,r as T,t as E,v as D,w as O,y as k}from"../chunks/Ccdp29n0.js";import{t as A}from"../chunks/C_aaOW6e.js";var j=x();j.on(`*`,(e,t)=>{t===void 0?console.debug(e):console.debug(e,t)});var M=u({status:`disconnected`,events:[]});j.on(`*`,(e,t)=>{M.update(n=>(n.events.push({label:e,payload:t}),n.events=n.events.slice(-128),n))});function N(e){M.update(t=>(t.status=e,(e===`connected`||e===`disconnected`)&&t.events.push({label:e}),t))}function P(){M.update(()=>({status:`disconnected`,events:[]}))}var F=k.resource(`/presence/`);async function I(e,t){return await F.multipart(e,{credentials:`include`,...t})}var L=null,R=null;async function z(e){if(L!==null&&L!==e&&V(),L!==e)for(L=e;L===e;){N(`connecting`);let t=await B(e).catch(e=>e);t!==void 0&&(t.name===`AbortError`?console.debug(`Realtime connection aborted`):(console.warn(`Realtime connection exception`,t),await new Promise(e=>setTimeout(e,3e3))))}}async function B(e){R=new AbortController;let t=R.signal,n=Intl.DateTimeFormat().resolvedOptions().timeZone,r=await I(e,{signal:t,body:{timezone:n}});if(r instanceof Error)throw N(`disconnected`),r;console.debug(`Realtime connected`,e),N(`connected`);for await(let e of r)H(e);console.debug(`Realtime connection lost`,e)}function V(){if(L!==null){if(L=null,R===null)throw Error(`Realtime controller is NULL`);R.abort(),P()}}function H(e){typeof e==`string`?j.emit(`heartbeat`):j.emit(e.event,e.data)}function U(){O.subscribe(e=>{let t=b.extract();e?z(t.id):V()})}function W(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`);return atob(t.padEnd(t.length+(4-t.length%4)%4,`=`))}function G(){let e=T(`challenge`);return e===null?null:W(e)}function K(){k.events.on(`challenge`,e=>S.set(e)),k.events.on(`error`,e=>{e.code===401&&S.set(null)}),S.subscribe(e=>k.authenticate(e));let e=G();e!==null&&S.set(e),D()}var q=f({prerender:()=>!1,ssr:()=>!1,trailingSlash:()=>J});K(),U();var J=`always`,Y=d(`<meta name="description"/>`);function X(u,d){o(d,!0);let f=()=>c(E,`$dict`,b),[b,x]=g(),S=h(()=>A.data.meta?.title??C.title),T=h(()=>A.data.meta?.description??C.description);y(w),i(()=>{document.dir=f().dir});var D=t();l(`12qhfyh`,e=>{var t=Y();m(()=>s(t,`content`,n(T))),r(()=>{a.title=n(S)??``}),p(e,t)});var O=e(D);_(O,()=>d.children),p(u,D),v(),x()}export{X as component,q as universal};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as e,E as t,bt as n,et as r,j as i,k as a,q as o,tt as s,yt as c}from"../chunks/CcD_ISxM.js";import"../chunks/xihTtKlq.js";import{t as l}from"../chunks/C_aaOW6e.js";var u=i(`<h1> </h1> <p> </p>`,1);function d(i,d){n(d,!0);var f=u(),p=e(f),m=r(p,!0),h=s(p,2),g=r(h,!0);o(()=>{t(m,l.status),t(g,l.error?.message)}),a(i,f),c()}export{d as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as e,A as t,B as n,Dt as r,E as i,Et as a,L as o,P as s,Q as c,Tt as l,Z as u,a as d,bt as f,d as p,dt as m,et as h,ft as g,i as _,it as v,j as y,k as b,lt as x,o as S,ot as C,q as w,s as T,st as E,tt as D,u as O,ut as k,y as A,yt as j}from"../chunks/CcD_ISxM.js";import{c as M,n as N}from"../chunks/BkLAzDsj.js";import"../chunks/xihTtKlq.js";import{b as P,h as F,i as I,j as L,t as R}from"../chunks/Ccdp29n0.js";import{H as z,W as B,o as V,s as H}from"../chunks/Dw75U_Lh.js";import{t as U}from"../chunks/C_aaOW6e.js";import{i as W,n as G,r as K,t as q}from"../chunks/sXOccAdQ.js";var J=new Set([`$$slots`,`$$events`,`$$legacy`]);function Y(e,t){let n=d(t,J),r=[[`path`,{d:`m21 21-4.34-4.34`}],[`circle`,{cx:`11`,cy:`11`,r:`8`}]];L(e,S({name:`search`},()=>n,{get iconNode(){return r}}))}var X=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`children`]),Z=y(`<kbd><!></kbd>`);function Q(e,t){f(t,!0);let n=_(t,`ref`,15,null),i=d(t,X);var o=Z();O(o,e=>({"data-slot":`kbd`,class:e,...i}),[()=>B(`h-5 w-fit min-w-5 gap-1 rounded-sm bg-muted px-1 font-sans text-xs font-medium text-muted-foreground in-data-[slot=tooltip-content]:bg-background/20 in-data-[slot=tooltip-content]:text-background dark:in-data-[slot=tooltip-content]:bg-background/10 [&_svg:not([class*='size-'])]:size-3 pointer-events-none inline-flex items-center justify-center select-none`,t.class)]);var s=c(o);A(s,()=>t.children??r),a(o),T(o,e=>n(e),()=>n()),b(e,o),j()}var $=y(`<div class="flex h-dvh flex-col"><header class="flex items-center gap-4 px-4 py-3" style="view-transition-name: chrome"><div class="hidden flex-1 items-center gap-4 md:flex"><h1 class="min-w-0 truncate text-lg font-medium"><a id="nav-home-link" class="hover:text-muted-foreground transition-colors"> </a></h1></div> <div class="relative w-full max-w-64 min-w-0 shrink"><!> <!> <!></div> <div class="flex flex-1 justify-end"><!></div></header> <main class="min-h-0 flex-1"><!></main></div>`);function ee(r,d){f(d,!0);let _=()=>m(V,`$only`,T),y=()=>m(H,`$query`,T),S=()=>m(R,`$dict`,T),[T,O]=k(),L=E(()=>U.url.pathname===M+`/`?`.`:`..`);N(()=>H.set(``));let B=C(null);function J(e){e.key===`Enter`&&_()?.()}function X(e){e.key===`k`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),n(B)?.focus(),n(B)?.select())}o(`keydown`,u,X),G(r,{children:(r,o)=>{var u=$(),f=c(u),m=c(f),_=c(m),C=c(_),T=h(C,!0);a(_),a(m);var E=D(m,2),O=c(E);Y(O,{class:`text-muted-foreground pointer-events-none absolute start-2.5 top-1/2 size-3.5 -translate-y-1/2`});var k=D(O,2);K(k,{id:`nav-filter-input`,type:`search`,onkeydown:J,get"aria-label"(){return S().nav.filter},class:`ps-8 pe-3 md:pe-14 [&::-webkit-search-cancel-button]:hidden`,get ref(){return n(B)},set ref(e){v(B,e,!0)},get value(){return x(),y()},set value(e){g(H,e)}}),Q(D(k,2),{class:`absolute end-2 top-1/2 hidden -translate-y-1/2 md:inline-flex`,children:(e,t)=>{l();var n=s();w(()=>i(n,I?`⌘K`:`Ctrl K`)),b(e,n)},$$slots:{default:!0}}),a(E);var j=D(E,2),M=c(j);z(M,{id:`iam-logout-button`,variant:`ghost`,size:`icon`,get"aria-label"(){return S().nav.signout},class:`text-destructive hover:text-destructive`,get onclick(){return F},children:(e,t)=>{W(e,{})},$$slots:{default:!0}}),a(j),a(f);var N=D(f,2),R=c(N);q(R,{role:`system:configuration:get`,children:(n,r)=>{var i=t(),a=e(i);A(a,()=>d.children),b(n,i)},$$slots:{default:!0}}),a(N),a(u),w(()=>{p(C,`href`,n(L)),i(T,P.title)}),b(r,u)},$$slots:{default:!0}}),j(),O()}export{ee as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Et as e,Q as t,j as n,k as r}from"../chunks/CcD_ISxM.js";import"../chunks/xihTtKlq.js";import{r as i}from"../chunks/Dw75U_Lh.js";var a=n(`<div class="mx-auto h-full max-w-7xl overflow-auto px-4 pb-12"><!></div>`);function o(n){var o=a(),s=t(o);i(s,{}),e(o),r(n,o)}export{o as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as e,A as t,B as n,Dt as r,E as i,Et as a,Q as o,a as s,bt as c,d as l,dt as u,et as d,j as f,k as p,o as m,q as h,st as g,tt as _,ut as v,w as y,yt as b}from"../chunks/CcD_ISxM.js";import{c as x}from"../chunks/BkLAzDsj.js";import"../chunks/xihTtKlq.js";import{j as S,k as C}from"../chunks/Ccdp29n0.js";import{c as w,i as T,l as E,n as D,t as O}from"../chunks/Dw75U_Lh.js";import{t as k}from"../chunks/C_aaOW6e.js";import{t as A}from"../chunks/sXOccAdQ.js";var j=new Set([`$$slots`,`$$events`,`$$legacy`]);function M(e,t){let n=s(t,j),r=[[`path`,{d:`m15 18-6-6 6-6`}]];S(e,m({name:`chevron-left`},()=>n,{get iconNode(){return r}}))}var N=f(`<span class="text-muted-foreground"> </span>`),P=f(`<!> <p class="text-muted-foreground mt-2 text-center font-mono text-xs"> </p>`,1),F=f(`<p class="text-muted-foreground py-20 text-center"> </p>`),I=f(`<p class="text-destructive py-20 text-center"> </p>`),L=f(`<div class="mx-auto h-full max-w-2xl overflow-auto px-4 pb-12"><div class="flex items-center gap-2 py-2"><a id="configuration-back-link" class="text-muted-foreground hover:text-foreground -ms-1 rounded-md p-1 transition-colors"><!></a> <h2 class="min-w-0 truncate font-medium"><!> </h2> <div class="ms-auto"><!></div></div> <!></div>`);function R(s,f){c(f,!0);let m=()=>u(T,`$dict`,S),[S,j]=v(),R=g(()=>k.params.component??``),z=g(()=>E.get(n(R))),B=g(()=>w(n(R)));function V(e){return`code`in e&&e.code===404}var H=L(),U=o(H),W=o(U);M(o(W),{class:`size-4`}),a(W);var G=_(W,2),K=o(G),q=e=>{var t=N(),r=d(t);h(()=>i(r,`${n(B).namespace??``}.`)),p(e,t)};y(K,e=>{n(B).namespace!=="default"&&e(q)});var J=_(K,1,!0);a(G);var Y=_(G,2),X=o(Y);C(X,{get store(){return n(z)},silent:!0,awaited:(e,t=r)=>{A(e,{role:`system:configuration:create`,denied:e=>{},children:(e,n)=>{O(e,{get configuration(){return t()}})},$$slots:{denied:!0,default:!0}})},$$slots:{awaited:!0}}),a(Y),a(U);var Z=_(U,2);C(Z,{get store(){return n(z)},awaited:(t,n=r)=>{var a=P(),o=e(a);D(o,{get value(){return n().configuration}});var s=_(o,2),c=d(s,!0);h(()=>i(c,n().epoch)),p(t,a)},error:(a,o=r)=>{var s=t(),c=e(s),l=e=>{var t=F(),n=d(t,!0);h(()=>i(n,m().value.none)),p(e,t)},u=g(()=>V(o())),f=e=>{var t=I(),n=d(t,!0);h(()=>i(n,o().message)),p(e,t)};y(c,e=>{n(u)?e(l):e(f,-1)}),p(a,s)},$$slots:{awaited:!0,error:!0}}),a(H),h(()=>{l(W,`href`,`${x??``}/`),l(W,`aria-label`,m().value.title),i(J,n(B).component)}),p(s,H),b(),j()}export{R as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":"1789573524913"}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html translate="no" lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
6
|
+
<meta name="robots" content="noindex,nofollow" />
|
|
7
|
+
<meta name="google" content="notranslate" />
|
|
8
|
+
|
|
9
|
+
<!-- `/.configuration`, so they resolve under the path the page is mounted at -->
|
|
10
|
+
<link rel="icon" href="/.configuration/favicon.ico" sizes="32x32" />
|
|
11
|
+
<link
|
|
12
|
+
rel="icon"
|
|
13
|
+
href="/.configuration/favicon-96x96.png"
|
|
14
|
+
type="image/png"
|
|
15
|
+
sizes="96x96"
|
|
16
|
+
/>
|
|
17
|
+
<link rel="apple-touch-icon" href="/.configuration/apple-touch-icon.png" />
|
|
18
|
+
|
|
19
|
+
<link href="/.configuration/_app/immutable/entry/start.C5YMpV87.js" rel="modulepreload">
|
|
20
|
+
<link href="/.configuration/_app/immutable/chunks/BkLAzDsj.js" rel="modulepreload">
|
|
21
|
+
<link href="/.configuration/_app/immutable/chunks/CcD_ISxM.js" rel="modulepreload">
|
|
22
|
+
<link href="/.configuration/_app/immutable/entry/app.DgOXi1S4.js" rel="modulepreload">
|
|
23
|
+
<link href="/.configuration/_app/immutable/chunks/xihTtKlq.js" rel="modulepreload">
|
|
24
|
+
<link href="/.configuration/_app/immutable/nodes/0.BGAo0V8q.js" rel="modulepreload">
|
|
25
|
+
<link href="/.configuration/_app/immutable/chunks/Ccdp29n0.js" rel="modulepreload">
|
|
26
|
+
<link href="/.configuration/_app/immutable/chunks/C_aaOW6e.js" rel="modulepreload">
|
|
27
|
+
<link href="/.configuration/_app/env.js" rel="modulepreload">
|
|
28
|
+
|
|
29
|
+
<link href="/.configuration/_app/immutable/assets/0.BGFdDICE.css" rel="stylesheet">
|
|
30
|
+
</head>
|
|
31
|
+
<body data-sveltekit-preload-data="hover">
|
|
32
|
+
<div style="display: contents">
|
|
33
|
+
<script>
|
|
34
|
+
{
|
|
35
|
+
__sveltekit_1e99waj = {
|
|
36
|
+
base: "/.configuration",
|
|
37
|
+
assets: "/.configuration",
|
|
38
|
+
env: null
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const element = document.currentScript.parentElement;
|
|
42
|
+
|
|
43
|
+
import("/.configuration/_app/env.js").then(({ env }) => {
|
|
44
|
+
__sveltekit_1e99waj.env = env;
|
|
45
|
+
|
|
46
|
+
Promise.all([
|
|
47
|
+
import("/.configuration/_app/immutable/entry/start.C5YMpV87.js"),
|
|
48
|
+
import("/.configuration/_app/immutable/entry/app.DgOXi1S4.js")
|
|
49
|
+
]).then(([kit, app]) => {
|
|
50
|
+
kit.start(app, element);
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
</script>
|
|
55
|
+
</div>
|
|
56
|
+
</body>
|
|
57
|
+
</html>
|
package/notes/consistency.md
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
# Configuration Consistency
|
|
2
|
-
|
|
3
|
-

|
|
4
|
-
|
|
5
|
-
## Problem Definition
|
|
6
|
-
|
|
7
|
-
At arbitrary moments when the configuration has changed, some distributed operations have started
|
|
8
|
-
but haven't yet
|
|
9
|
-
finished. This leads to operations that start with certain configuration values but will finish with
|
|
10
|
-
another, which may
|
|
11
|
-
result in logical problems.
|
|
12
|
-
|
|
13
|
-
Given that distributed operations may have arbitrary participants and last for an arbitrary period,
|
|
14
|
-
there is no such
|
|
15
|
-
single moment when configuration can be safely changed. Thus, it must be a process.
|
|
16
|
-
|
|
17
|
-
## ~~Not a~~ Solution
|
|
18
|
-
|
|
19
|
-
1. Configuration is a single versioned object.
|
|
20
|
-
2. Configuration version value is included in the Uniform Communication Interface.
|
|
21
|
-
3. The first distributed operation participant (which is the one who has received a UCI without the
|
|
22
|
-
configuration
|
|
23
|
-
version value) must include in the outgoing UCI the configuration version value that it considers
|
|
24
|
-
as current.
|
|
25
|
-
4. Non-first distributed operations participants (which is those who has received a UCI with the
|
|
26
|
-
configuration version
|
|
27
|
-
value) must use the configuration version specified in the UCI.
|
|
28
|
-
5. Non-first distributed operation participants must include in the outgoing UCI the same
|
|
29
|
-
configuration version value as
|
|
30
|
-
they received in the incoming.
|
|
31
|
-
|
|
32
|
-
## Restrictions
|
|
33
|
-
|
|
34
|
-
1. Configuration updates are always backward compatible.
|
|
35
|
-
2. Configuration updates are always being delivered before algorithm updates.
|
|
36
|
-
1. Including federated deployment, that is: first deliver configuration to all facilities (data
|
|
37
|
-
centers, zones,
|
|
38
|
-
whatever), then deliver algorithm updates.
|
|
39
|
-
3. Configuration storage and access solution must provide the transactional updates, that is if any
|
|
40
|
-
arbitrary
|
|
41
|
-
participant observed a certain configuration version, then any other participant is guaranteed to
|
|
42
|
-
be able to
|
|
43
|
-
subsequently observe that version.
|
|
44
|
-
1. Including federated deployment[^1].
|
|
45
|
-
|
|
46
|
-
## Solution
|
|
47
|
-
|
|
48
|
-
The configuration compatibility problem described above is a particular case of a common
|
|
49
|
-
compatibility problem for
|
|
50
|
-
distributed operation participants. It is not the only configuration that may change while a
|
|
51
|
-
distributed operation is
|
|
52
|
-
running, but participant algorithms themselves. This leads to the conclusion that this particular
|
|
53
|
-
solution must be
|
|
54
|
-
propagated to algorithm versions, that is: which system (as a set of algorithms and configuration)
|
|
55
|
-
version was used to
|
|
56
|
-
start the operation, and that system version must be used to finish the operation.
|
|
57
|
-
|
|
58
|
-
This kind of solution results in the need to run all versions of the system with appropriate message
|
|
59
|
-
routing. The
|
|
60
|
-
implementation complexity of this solution and its operations costs are considered unreasonable.
|
|
61
|
-
However, an attempt
|
|
62
|
-
will be made to implement this solution with a certain
|
|
63
|
-
constraints [#147](https://github.com/toa-io/toa/issues/147).
|
|
64
|
-
|
|
65
|
-
[^1]: Since it looks like there is no reasonable way to provide this kind of guarantee without
|
|
66
|
-
significant performance
|
|
67
|
-
and/or availability impact, it may be implemented as a mechanism with read retries and with a
|
|
68
|
-
timeout considered as
|
|
69
|
-
“enough for the most of fail-over scenarios”.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<object>
|
package/source/Aspect.test.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Aspect } from './Aspect'
|
|
2
|
-
|
|
3
|
-
it('should return value', async () => {
|
|
4
|
-
const configuration = {
|
|
5
|
-
foo: 'bar',
|
|
6
|
-
bar: {
|
|
7
|
-
baz: 'quux'
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const aspect = new Aspect(configuration)
|
|
12
|
-
|
|
13
|
-
expect(aspect.invoke(['foo'])).toStrictEqual(configuration.foo)
|
|
14
|
-
expect(aspect.invoke(['bar', 'baz'])).toStrictEqual(configuration.bar.baz)
|
|
15
|
-
})
|
package/source/Aspect.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Connector, type extensions } from '@toa.io/core'
|
|
2
|
-
|
|
3
|
-
export class Aspect extends Connector implements extensions.Aspect {
|
|
4
|
-
public readonly name = 'configuration'
|
|
5
|
-
|
|
6
|
-
private readonly value: object
|
|
7
|
-
|
|
8
|
-
public constructor (value: object) {
|
|
9
|
-
super()
|
|
10
|
-
|
|
11
|
-
this.value = value
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
public invoke (path: string[]): any {
|
|
15
|
-
let cursor: any = this.value
|
|
16
|
-
|
|
17
|
-
if (path !== undefined)
|
|
18
|
-
for (const segment of path)
|
|
19
|
-
cursor = cursor[segment]
|
|
20
|
-
|
|
21
|
-
return cursor
|
|
22
|
-
}
|
|
23
|
-
}
|
package/source/Factory.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { type Locator, type extensions } from '@toa.io/core'
|
|
2
|
-
import { Aspect } from './Aspect'
|
|
3
|
-
import { type Manifest } from './manifest'
|
|
4
|
-
import { get } from './configuration'
|
|
5
|
-
|
|
6
|
-
export class Factory implements extensions.Factory {
|
|
7
|
-
public aspect (locator: Locator, manifest: Manifest): extensions.Aspect {
|
|
8
|
-
const value = get(locator, manifest)
|
|
9
|
-
|
|
10
|
-
return new Aspect(value)
|
|
11
|
-
}
|
|
12
|
-
}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { encode } from '@toa.io/generic'
|
|
2
|
-
import { Locator } from '@toa.io/core'
|
|
3
|
-
import { generate } from 'randomstring'
|
|
4
|
-
import { get } from './configuration'
|
|
5
|
-
import { type Manifest } from './manifest'
|
|
6
|
-
|
|
7
|
-
let locator: Locator
|
|
8
|
-
let manifest: Manifest
|
|
9
|
-
|
|
10
|
-
beforeEach(() => {
|
|
11
|
-
locator = new Locator(generate(), generate())
|
|
12
|
-
manifest = { schema: { foo: 'string' } }
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
afterEach(() => {
|
|
16
|
-
for (const name of used)
|
|
17
|
-
delete process.env[name]
|
|
18
|
-
|
|
19
|
-
used = []
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
it('should read value', async () => {
|
|
23
|
-
manifest.schema = { foo: 'string' }
|
|
24
|
-
|
|
25
|
-
const value: object = { foo: generate() }
|
|
26
|
-
|
|
27
|
-
set(value)
|
|
28
|
-
|
|
29
|
-
const result = get(locator, manifest)
|
|
30
|
-
|
|
31
|
-
expect(result).toStrictEqual(value)
|
|
32
|
-
})
|
|
33
|
-
|
|
34
|
-
it('should return empty object if no value set', async () => {
|
|
35
|
-
expect(get(locator, manifest)).toStrictEqual({})
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
it('should substitute secrets', async () => {
|
|
39
|
-
const value: object = { foo: '$BAR' }
|
|
40
|
-
|
|
41
|
-
set(value)
|
|
42
|
-
set('bar', '_BAR')
|
|
43
|
-
|
|
44
|
-
const result = get(locator, manifest)
|
|
45
|
-
|
|
46
|
-
expect(result).toStrictEqual({ foo: 'bar' })
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
it('should use defaults', async () => {
|
|
50
|
-
manifest.schema = { foo: 'string', bar: ['number'], 'baz?': 'string' }
|
|
51
|
-
manifest.defaults = { foo: 'bar', bar: [1] }
|
|
52
|
-
|
|
53
|
-
const values = { bar: [2], baz: 'foo' }
|
|
54
|
-
|
|
55
|
-
set(values)
|
|
56
|
-
|
|
57
|
-
const result = get(locator, manifest)
|
|
58
|
-
|
|
59
|
-
expect(result).toStrictEqual({
|
|
60
|
-
foo: 'bar',
|
|
61
|
-
bar: [2],
|
|
62
|
-
baz: 'foo'
|
|
63
|
-
})
|
|
64
|
-
})
|
|
65
|
-
|
|
66
|
-
it('should validate', async () => {
|
|
67
|
-
manifest.schema = { foo: 'hello', bar: 'number' }
|
|
68
|
-
|
|
69
|
-
const values = { bar: 5 }
|
|
70
|
-
|
|
71
|
-
set(values)
|
|
72
|
-
|
|
73
|
-
const result = get(locator, manifest)
|
|
74
|
-
|
|
75
|
-
expect(result).toStrictEqual({
|
|
76
|
-
foo: 'hello',
|
|
77
|
-
bar: 5
|
|
78
|
-
})
|
|
79
|
-
})
|
|
80
|
-
|
|
81
|
-
function set (value: object | string, key = locator.uppercase): void {
|
|
82
|
-
const string = typeof value === 'string' ? value : encode(value)
|
|
83
|
-
const name = 'TOA_CONFIGURATION_' + key
|
|
84
|
-
|
|
85
|
-
process.env[name] = string
|
|
86
|
-
|
|
87
|
-
used.push(name)
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
let used: string[] = []
|
package/source/configuration.ts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { type Locator } from '@toa.io/core'
|
|
2
|
-
import { decode, add } from '@toa.io/generic'
|
|
3
|
-
import * as schemas from '@toa.io/schemas'
|
|
4
|
-
import { PREFIX, SECRET_RX } from './deployment'
|
|
5
|
-
import { type Manifest } from './manifest'
|
|
6
|
-
import type { Schema } from '@toa.io/schemas'
|
|
7
|
-
|
|
8
|
-
export function get (locator: Locator, manifest: Manifest): Node {
|
|
9
|
-
const values = getConfiguration(locator.uppercase)
|
|
10
|
-
|
|
11
|
-
substituteSecrets(values)
|
|
12
|
-
|
|
13
|
-
if (manifest.defaults !== undefined)
|
|
14
|
-
add(values, manifest.defaults)
|
|
15
|
-
|
|
16
|
-
const schema: Schema<any> = schemas.schema(manifest.schema)
|
|
17
|
-
|
|
18
|
-
schema.validate(values)
|
|
19
|
-
|
|
20
|
-
return values
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function getConfiguration (suffix: string): Node {
|
|
24
|
-
const variable = PREFIX + suffix
|
|
25
|
-
const string = process.env[variable]
|
|
26
|
-
|
|
27
|
-
if (string === undefined)
|
|
28
|
-
return {}
|
|
29
|
-
else
|
|
30
|
-
return decode(string)
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function substituteSecrets (configuration: Node): void {
|
|
34
|
-
for (const [key, value] of Object.entries(configuration)) {
|
|
35
|
-
if (typeof value === 'object' && value !== null)
|
|
36
|
-
substituteSecrets(value as Node)
|
|
37
|
-
|
|
38
|
-
if (typeof value !== 'string') continue
|
|
39
|
-
|
|
40
|
-
const match = value.match(SECRET_RX)
|
|
41
|
-
|
|
42
|
-
if (match === null) continue
|
|
43
|
-
|
|
44
|
-
const name = match.groups?.variable
|
|
45
|
-
|
|
46
|
-
configuration[key] = getSecret(name!)
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function getSecret (name: string): string {
|
|
51
|
-
const variable = PREFIX + '_' + name
|
|
52
|
-
const value = process.env[variable]
|
|
53
|
-
|
|
54
|
-
if (value === undefined) throw new Error(`${variable} is not set.`)
|
|
55
|
-
|
|
56
|
-
return value
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
export type Node = Record<string, unknown>
|