PageSourceSearch

https://tresda.institute/assets/Register-DJmRyH3K.js

js tresda.institute collected 2026-10-02 01:59:35 UTC 18,215 bytes, 20 lines download raw bytes

1import{r as t,j as e,a1 as ne,g as ue,k as je,bk as Le,I as de,J as Se,L as me,m as R,cH as Be}from"./index-u0HMC9Vb.js";import{L as pe}from"./label-DF2Jd85R.js";import{M as Ge}from"./minus-BO6K_pEM.js";import{G as He}from"./GoogleIcon-DtqnIDaI.js";import{T as Ve}from"./TRESDALogo-DnjRmaCv.js";var $e=Object.defineProperty,qe=Object.defineProperties,ze=Object.getOwnPropertyDescriptors,ae=Object.getOwnPropertySymbols,Ee=Object.prototype.hasOwnProperty,Ce=Object.prototype.propertyIsEnumerable,Ne=(r,a,s)=>a in r?$e(r,a,{enumerable:!0,configurable:!0,writable:!0,value:s}):r[a]=s,Ye=(r,a)=>{for(var s in a||(a={}))Ee.call(a,s)&&Ne(r,s,a[s]);if(ae)for(var s of ae(a))Ce.call(a,s)&&Ne(r,s,a[s]);return r},Ue=(r,a)=>qe(r,ze(a)),Je=(r,a)=>{var s={};for(var l in r)Ee.call(r,l)&&a.indexOf(l)<0&&(s[l]=r[l]);if(r!=null&&ae)for(var l of ae(r))a.indexOf(l)<0&&Ce.call(r,l)&&(s[l]=r[l]);return s};function Ze(r){let a=setTimeout(r,0),s=setTimeout(r,10),l=setTimeout(r,50);return[a,s,l]}function Ke(r){let a=t.useRef();return t.useEffect(()=>{a.current=r}),a.current}var Qe=18,Pe=40,Xe=`${Pe}px`,et=["[data-lastpass-icon-root]","com-1password-button","[data-dashlanecreated]",'[style$="2147483647 !important;"]'].join(",");function tt({containerRef:r,inputRef:a,pushPasswordManagerStrategy:s,isFocused:l}){let[b,m]=t.useState(!1),[y,h]=t.useState(!1),[S,C]=t.useState(!1),M=t.useMemo(()=>s==="none"?!1:(s==="increase-width"||s==="experimental-no-flickering")&&b&&y,[b,y,s]),I=t.useCallback(()=>{let f=r.current,P=a.current;if(!f||!P||S||s==="none")return;let g=f,N=g.getBoundingClientRect().left+g.offsetWidth,_=g.getBoundingClientRect().top+g.offsetHeight/2,i=N-Qe,u=_;document.querySelectorAll(et).length===0&&document.elementFromPoint(i,u)===f||(m(!0),C(!0))},[r,a,S,s]);return t.useEffect(()=>{let f=r.current;if(!f||s==="none")return;function P(){let N=window.innerWidth-f.getBoundingClientRect().right;h(N>=Pe)}P();let g=setInterval(P,1e3);return()=>{clearInterval(g)}},[r,s]),t.useEffect(()=>{let f=l||document.activeElement===a.current;if(s==="none"||!f)return;let P=setTimeout(I,0),g=setTimeout(I,2e3),N=setTimeout(I,5e3),_=setTimeout(()=>{C(!0)},6e3);return()=>{clearTimeout(P),clearTimeout(g),clearTimeout(N),clearTimeout(_)}},[a,l,s,I]),{hasPWMBadge:b,willPushPWMBadge:M,PWM_BADGE_SPACE_WIDTH:Xe}}var Te=t.createContext({}),ke=t.forwardRef((r,a)=>{var s=r,{value:l,onChange:b,maxLength:m,textAlign:y="left",pattern:h,placeholder:S,inputMode:C="numeric",onComplete:M,pushPasswordManagerStrategy:I="increase-width",pasteTransformer:f,containerClassName:P,noScriptCSSFallback:g=rt,render:N,children:_}=s,i=Je(s,["value","onChange","maxLength","textAlign","pattern","placeholder","inputMode","onComplete","pushPasswordManagerStrategy","pasteTransformer","containerClassName","noScriptCSSFallback","render","children"]),u,A,Y,V,ee;let[U,$]=t.useState(typeof i.defaultValue=="string"?i.defaultValue:""),d=l??U,F=Ke(d),J=t.useCallback(n=>{b==null||b(n),$(n)},[b]),T=t.useMemo(()=>h?typeof h=="string"?new RegExp(h):h:null,[h]),p=t.useRef(null),se=t.useRef(null),oe=t.useRef({value:d,onChange:J,isIOS:typeof window<"u"&&((A=(u=window==null?void 0:window.CSS)==null?void 0:u.supports)==null?void 0:A.call(u,"-webkit-touch-callout","none"))}),te=t.useRef({prev:[(Y=p.current)==null?void 0:Y.selectionStart,(V=p.current)==null?void 0:V.selectionEnd,(ee=p.current)==null?void 0:ee.selectionDirection]});t.useImperativeHandle(a,()=>p.current,[]),t.useEffect(()=>{let n=p.current,o=se.current;if(!n||!o)return;oe.current.value!==n.value&&oe.current.onChange(n.value),te.current.prev=[n.selectionStart,n.selectionEnd,n.selectionDirection];function x(){if(document.activeElement!==n){K(null),Q(null);return}let c=n.selectionStart,v=n.selectionEnd,re=n.selectionDirection,E=n.maxLength,L=n.value,k=te.current.prev,D=-1,O=-1,B;if(L.length!==0&&c!==null&&v!==null){let Ae=c===v,Fe=c===L.length&&L.length<E;if(Ae&&!Fe){let G=c;if(G===0)D=0,O=1,B="forward";else if(G===E)D=G-1,O=G,B="backward";else if(E>1&&L.length>1){let ce=0;if(k[0]!==null&&k[1]!==null){B=G<k[1]?"backward":"forward";let We=k[0]===k[1]&&k[0]<E;B==="backward"&&!We&&(ce=-1)}D=ce+G,O=ce+G+1}}D!==-1&&O!==-1&&D!==O&&p.current.setSelectionRange(D,O,B)}let ye=D!==-1?D:c,we=O!==-1?O:v,Me=B??re;K(ye),Q(we),te.current.prev=[ye,we,Me]}if(document.addEventListener("selectionchange",x,{capture:!0}),x(),document.activeElement===n&&le(!0),!document.getElementById("input-otp-style")){let c=document.createElement("style");if(c.id="input-otp-style",document.head.appendChild(c),c.sheet){let v="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;";X(c.sheet,"[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"),X(c.sheet,`[data-input-otp]:autofill { ${v} }`),X(c.sheet,`[data-input-otp]:-webkit-autofill { ${v} }
1`),X(c.sheet,"@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }"),X(c.sheet,"[data-input-otp] + * { pointer-events: all !important; }")}}let w=()=>{o&&o.style.setProperty("--root-height",`${n.clientHeight}px`)};w();let j=new ResizeObserver(w);return j.observe(n),()=>{document.removeEventListener("selectionchange",x,{capture:!0}),j.disconnect()}},[]);let[he,fe]=t.useState(!1),[Z,le]=t.useState(!1),[W,K]=t.useState(null),[q,Q]=t.useState(null);t.useEffect(()=>{Ze(()=>{var n,o,x,w;(n=p.current)==null||n.dispatchEvent(new Event("input"));let j=(o=p.current)==null?void 0:o.selectionStart,c=(x=p.current)==null?void 0:x.selectionEnd,v=(w=p.current)==null?void 0:w.selectionDirection;j!==null&&c!==null&&(K(j),Q(c),te.current.prev=[j,c,v])})},[d,Z]),t.useEffect(()=>{F!==void 0&&d!==F&&F.length<m&&d.length===m&&(M==null||M(d))},[m,M,F,d]);let z=tt({containerRef:se,inputRef:p,pushPasswordManagerStrategy:I,isFocused:Z}),xe=t.useCallback(n=>{let o=n.currentTarget.value.slice(0,m);if(o.length>0&&T&&!T.test(o)){n.preventDefault();return}typeof F=="string"&&o.length<F.length&&document.dispatchEvent(new Event("selectionchange")),J(o)},[m,J,F,T]),ge=t.useCallback(()=>{var n;if(p.current){let o=Math.min(p.current.value.length,m-1),x=p.current.value.length;(n=p.current)==null||n.setSelectionRange(o,x),K(o),Q(x)}le(!0)},[m]),ve=t.useCallback(n=>{var o,x;let w=p.current;if(!f&&(!oe.current.isIOS||!n.clipboardData||!w))return;let j=n.clipboardData.getData("text/plain"),c=f?f(j):j;n.preventDefault();let v=(o=p.current)==null?void 0:o.selectionStart,re=(x=p.current)==null?void 0:x.selectionEnd,E=(v!==re?d.slice(0,v)+c+d.slice(re):d.slice(0,v)+c+d.slice(v)).slice(0,m);if(E.length>0&&T&&!T.test(E))return;w.value=E,J(E);let L=Math.min(E.length,m-1),k=E.length;w.setSelectionRange(L,k),K(L),Q(k)},[m,J,T,d]),_e=t.useMemo(()=>({position:"relative",cursor:i.disabled?"default":"text",userSelect:"none",WebkitUserSelect:"none",pointerEvents:"none"}),[i.disabled]),be=t.useMemo(()=>({position:"absolute",inset:0,width:z.willPushPWMBadge?`calc(100% + ${z.PWM_BADGE_SPACE_WIDTH})`:"100%",clipPath:z.willPushPWMBadge?`inset(0 ${z.PWM_BADGE_SPACE_WIDTH} 0 0)`:void 0,height:"100%",display:"flex",textAlign:y,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(--root-height)",fontFamily:"monospace",fontVariantNumeric:"tabular-nums"}),[z.PWM_BADGE_SPACE_WIDTH,z.willPushPWMBadge,y]),De=t.useMemo(()=>t.createElement("input",Ue(Ye({autoComplete:i.autoComplete||"one-time-code"},i),{"data-input-otp":!0,"data-input-otp-placeholder-shown":d.length===0||void 0,"data-input-otp-mss":W,"data-input-otp-mse":q,inputMode:C,pattern:T==null?void 0:T.source,"aria-placeholder":S,style:be,maxLength:m,value:d,ref:p,onPaste:n=>{var o;ve(n),(o=i.onPaste)==null||o.call(i,n)},onChange:xe,onMouseOver:n=>{var o;fe(!0),(o=i.onMouseOver)==null||o.call(i,n)},onMouseLeave:n=>{var o;fe(!1),(o=i.onMouseLeave)==null||o.call(i,n)},onFocus:n=>{var o;ge(),(o=i.onFocus)==null||o.call(i,n)},onBlur:n=>{var o;le(!1),(o=i.onBlur)==null||o.call(i,n)}})),[xe,ge,ve,C,be,m,q,W,i,T==null?void 0:T.source,d]),ie=t.useMemo(()=>({slots:Array.from({length:m}).map((n,o)=>{var x;let w=Z&&W!==null&&q!==null&&(W===q&&o===W||o>=W&&o<q),j=d[o]!==void 0?d[o]:null,c=d[0]!==void 0?null:(x=S==null?void 0:S[o])!=null?x:null;return{char:j,placeholderChar:c,isActive:w,hasFakeCaret:w&&j===null}}),isFocused:Z,isHovering:!i.disabled&&he}),[Z,he,m,q,W,i.disabled,d]),Oe=t.useMemo(()=>N?N(ie):t.createElement(Te.Provider,{value:ie},_),[_,ie,N]);return t.createElement(t.Fragment,null,g!==null&&t.createElement("noscript",null,t.createElement("style",null,g)),t.createElement("div",{ref:se,"data-input-otp-container":!0,style:_e,className:P},Oe,t.createElement("div",{style:{position:"absolute",inset:0,pointerEvents:"none"}},De)))});ke.displayName="Input";function X(r,a){try{r.insertRule(a)}catch{console.error("input-otp could not insert CSS rule:",a)}}var rt=`
2[data-input-otp] {
3  --nojs-bg: white !important;
4  --nojs-fg: black !important;
5
6  background-color: var(--nojs-bg) !important;
7  color: var(--nojs-fg) !important;
8  caret-color: var(--nojs-fg) !important;
9  letter-spacing: .25em !important;
10  text-align: center !important;
11  border: 1px solid var(--nojs-fg) !important;
12  border-radius: 4px !important;
13  width: 100% !important;
14}
15@media (prefers-color-scheme: dark) {
16  [data-input-otp] {
17    --nojs-bg: black !important;
18    --nojs-fg: white !important;
19  }
20}`;const Re=t.forwardRef(({className:r,containerClassName:a,...s},l)=>e.jsx(ke,{ref:l,containerClassName:ne("flex items-center gap-2 has-[:disabled]:opacity-50",a),className:ne("disabled:cursor-not-allowed",r),...s}));Re.displayName="InputOTP";const Ie=t.forwardRef(({className:r,...a},s)=>e.jsx("div",{ref:s,className:ne("flex items-center",r),...a}));Ie.displayName="InputOTPGroup";const H=t.forwardRef(({index:r,className:a,...s},l)=>{const b=t.useContext(Te),{char:m,hasFakeCaret:y,isActive:h}=b.slots[r];return e.jsxs("div",{ref:l,className:ne("relative flex h-9 w-9 items-center justify-center border-y border-r border-input text-sm shadow-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md",h&&"z-10 ring-1 ring-ring",a),...s,children:[m,y&&e.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:e.jsx("div",{className:"h-4 w-px animate-caret-blink bg-foreground duration-1000"})})]})});H.displayName="InputOTPSlot";const nt=t.forwardRef(({...r},a)=>e.jsx("div",{ref:a,role:"separator",...r,children:e.jsx(Ge,{})}));nt.displayName="InputOTPSeparator";function ct(){const[r,a]=t.useState(""),[s,l]=t.useState(""),[b,m]=t.useState(""),[y,h]=t.useState(""),[S,C]=t.useState(!1),[M,I]=t.useState(!1),[f,P]=t.useState(""),g=async u=>
20{if(u.preventDefault(),h(""),s!==b){h("Passwords do not match");return}C(!0);try{await R.auth.register({email:r,password:s}),I(!0)}catch(A){h(A.message||"Registration failed")}finally{C(!1)}},N=async()=>{h(""),C(!0);try{const u=await R.auth.verifyOtp({email:r,otpCode:f});u!=null&&u.access_token&&R.auth.setToken(u.access_token);const A=localStorage.getItem("tresda_provisional_sos");if(A)try{const{primary:V,secondary:ee,sos:U}=JSON.parse(A),$=await R.auth.me();if($!=null&&$.id){const d=await R.entities.TRESDAProfile.filter({user_id:$.id});d.length>0&&await R.entities.TRESDAProfile.update(d[0].id,{primary_tra:V,secondary_tra:ee,sos_baseline_self:U.self,sos_baseline_other:U.other,sos_baseline_synthesis:U.synthesis}),localStorage.removeItem("tresda_provisional_sos")}}catch{}const Y=localStorage.getItem("tresda_sos_session_id");if(Y){try{await R.functions.invoke("sendSOSReportPDF",{session_id:Y,email:r})}catch{}localStorage.removeItem("tresda_sos_session_id")}window.location.href="/Trace"}catch(u){h(u.message||"Invalid verification code")}finally{C(!1)}},_=async()=>{h("");try{await R.auth.resendOtp(r),Be({title:"Code sent",description:"Check your email for the new verification code."})}catch(u){h(u.message||"Failed to resend code")}},i=()=>{R.auth.loginWithProvider("google","/Trace")};return M?e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background px-4",children:e.jsxs("div",{className:"w-full max-w-md",children:[e.jsxs("div",{className:"text-center mb-10",children:[e.jsx("p",{className:"text-[10px] uppercase tracking-[0.2em] text-muted-foreground mb-4",children:"TRESDA INSTITUTE OF CREATIVE IDENTITY"}),e.jsx("h1",{className:"text-2xl font-semibold tracking-tight text-foreground mb-3",children:"Verify your email"}),e.jsxs("p",{className:"text-sm text-muted-foreground leading-relaxed",children:["A verification code has been sent to ",e.jsx("span",{className:"text-foreground font-medium",children:r}),". Enter it below to confirm your Resident ID."]})]}),e.jsxs("div",{className:"bg-card border border-border p-8",children:[y&&e.jsx("div",{className:"mb-6 p-3 bg-destructive/10 text-destructive text-sm",children:y}),e.jsx("div",{className:"flex justify-center mb-6",children:e.jsx(Re,{maxLength:6,value:f,onChange:P,autoFocus:!0,autoComplete:"one-time-code",children:e.jsxs(Ie,{children:[e.jsx(H,{index:0}),e.jsx(H,{index:1}),e.jsx(H,{index:2}),e.jsx(H,{index:3}),e.jsx(H,{index:4}),e.jsx(H,{index:5})]})})}),e.jsx(ue,{className:"w-full h-12 font-medium",onClick:N,disabled:S||f.length<6,children:S?e.jsxs(e.Fragment,{children:[e.jsx(je,{className:"w-4 h-4 mr-2 animate-spin"}),"Verifying..."]}):"Confirm Resident ID"}),e.jsxs("p",{className:"text-center text-xs text-muted-foreground mt-5",children:["Didn't receive the code?"," ",e.jsx("button",{onClick:_,className:"text-foreground font-medium hover:underline",children:"Resend"})]})]})]})}):e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background px-4 py-12",children:e.jsxs("div",{className:"w-full max-w-md",children:[e.jsxs("div",{className:"mb-10 text-center",children:[e.jsx("div",{className:"flex justify-center mb-6",children:e.jsx(Ve,{style:{width:20,height:20},color:"currentColor"})}),e.jsx("p",{className:"text-[10px] uppercase tracking-[0.2em] text-muted-foreground mb-5",children:"TRESDA INSTITUTE OF CREATIVE IDENTITY"}),e.jsx("h1",{className:"text-3xl font-semibold tracking-tight text-foreground mb-4 leading-tight",children:"Create Your Resident ID"}),e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:"Your TRESDA Resident ID is your identity within the ecosystem. It connects your traces, projects, portfolio and participation across Labs, Studio and Residency — creating a continuous record of your creative development over time."}),e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed mt-3",children:"Whether you're here to develop a new skill, explore your creative identity or document your process, your journey begins here."}),e.jsx("p",{className:"text-xs text-muted-foreground/70 leading-relaxed mt-4 border-t border-border pt-4",children:"Your work is yours. Everything you create here remains private by default — we can only see work you choose to make public or submit as part of a programme."})]}),e.jsxs("div",{className:"bg-card border border-border p-8",children:[e.jsxs(ue,{variant:"outline",className:"w-full h-12 text-sm font-medium mb-6",onClick:i,children:[e.jsx(He,{className:"w-5 h-5 mr-2"}),"Continue with Google"]}),e.jsxs("div",{className:"relative mb-6",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx("div",{className:"w-full border-t border-border"})}),e.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:e.jsx("span",{className:"bg-card px-3 text-muted-foreground",children:"or"})})]}),y&&e.jsx("div",{className:"mb-5 p-3 bg-destructive/10 text-destructive text-sm",children:y}),e.jsxs("form",{onSubmit:g,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(pe,{htmlFor:"email",children:"Email address"}),e.jsxs("div",{className:"relative",children:[e.jsx(Le,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground","aria-hidden":"true"}),e.jsx(de,{id:"email",type:"email",autoComplete:"email",autoFocus:!0,placeholder:"[email protected]",value:r,onChange:u=>a(u.target.value),className:"pl-10 h-12",required:!0})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(pe,{htmlFor:"password",children:"Password"}),e.jsxs("div",{className:"relative",children:[e.jsx(Se,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground","aria-hidden":"true"}),e.jsx(de,{id:"password",type:"password",autoComplete:"new-password",placeholder:"••••••••",value:s,onChange:u=>l(u.target.value),className:"pl-10 h-12",required:!0})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(pe,{htmlFor:"confirm",children:"Confirm password"}),e.jsxs("div",{className:"relative",children:[e.jsx(Se,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground","aria-hidden":"true"}),e.jsx(de,{id:"confirm",type:"password",autoComplete:"new-password",placeholder:"••••••••",value:b,onChange:u=>m(u.target.value),className:"pl-10 h-12",required:!0})]})]}
20),e.jsx(ue,{type:"submit",className:"w-full h-12 font-medium mt-2",disabled:S,children:S?e.jsxs(e.Fragment,{children:[e.jsx(je,{className:"w-4 h-4 mr-2 animate-spin"}),"Creating your Resident ID..."]}):"Create Resident ID"})]})]}),e.jsxs("p",{className:"text-center text-sm text-muted-foreground mt-6",children:["Already a Resident?"," ",e.jsx(me,{to:"/login",className:"text-foreground font-medium hover:underline",children:"Sign In"})]}),e.jsxs("p",{className:"text-center text-xs text-muted-foreground mt-4",children:[e.jsx(me,{to:"/privacy",className:"hover:underline",children:"Privacy Policy"}),e.jsx("span",{className:"mx-2",children:"·"}),e.jsx(me,{to:"/terms",className:"hover:underline",children:"Terms of Use"})]})]})})}export{ct as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.