PageSourceSearch

https://ontariocanna.ca/assets/Register-TCFMFS6B.js

js ontariocanna.ca collected 2026-10-08 06:15:59 UTC 14,114 bytes, 25 lines download raw bytes

vendor: 4,121 bytes, lines 1-6
1import{c as Ie,r as e,j as o,h as U,d as Ae,W as De,L as We,f as Z}from"./index-BseVR5nP.js";import{A as Be}from"./AuthLayout-BNGtXJd6.js";import{B as ae}from"./button-BUwGLm5M.js";import{I as le}from"./input-W8vO3KBC.js";import{N as Fe}from"./NoIndexMeta-DMqfc6g_.js";import{G as _e}from"./GoogleIcon-J_vc5n-4.js";/**
2 * @license lucide-react v0.475.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const Le=[["path",{d:"M5 12h14",key:"1ays0h"}]],Ge=Ie("Minus",Le);var He=Object.defineProperty,Ve=Object.defineProperties,$e=Object.getOwnPropertyDescriptors,X=Object.getOwnPropertySymbols,be=Object.prototype.hasOwnProperty,xe=Object.prototype.propertyIsEnumerable,ve=(t,r,a)=>r in t?He(t,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[r]=a,qe=(t,r)=>{for(var a in r||(r={}))be.call(r,a)&&ve(t,a,r[a]);if(X)for(var a of X(r))xe.call(r,a)&&ve(t,a,r[a]);return t},ze=(t,r)=>Ve(t,$e(r)),Ze=(t,r)=>{var a={};for(var s in t)be.call(t,s)&&r.indexOf(s)<0&&(a[s]=t[s]);if(t!=null&&X)for(var s of X(t))r.indexOf(s)<0&&xe.call(t,s)&&(a[s]=t[s]);return a};function Je(t){let r=setTimeout(t,0),a=setTimeout(t,10),s=setTimeout(t,50);return[r,a,s]}function Ke(t){let r=e.useRef();return e.useEffect(()=>{r.current=t}),r.current}var Qe=18,we=40,Ue=`${we}px`,Xe=["[data-lastpass-icon-root]","com-1password-button","[data-dashlanecreated]",'[style$="2147483647 !important;"]'].join(",");function Ye({containerRef:t,inputRef:r,pushPasswordManagerStrategy:a,isFocused:s}){let[w,d]=e.useState(!1),[j,P]=e.useState(!1),[O,D]=e.useState(!1),k=e.useMemo(()=>a==="none"?!1:(a==="increase-width"||a==="experimental-no-flickering")&&w&&j,[w,j,a]),h=e.useCallback(()=>{let i=t.current,g=r.current;if(!i||!g||O||a==="none")return;let b=i,C=b.getBoundingClientRect().left+b.offsetWidth,M=b.getBoundingClientRect().top+b.offsetHeight/2,u=C-Qe,p=M;document.querySelectorAll(Xe).length===0&&document.elementFromPoint(u,p)===i||(d(!0),D(!0))},[t,r,O,a]);return e.useEffect(()=>{let i=t.current;if(!i||a==="none")return;function g(){let C=window.innerWidth-i.getBoundingClientRect().right;P(C>=we)}g();let b=setInterval(g,1e3);return()=>{clearInterval(b)}},[t,a]),e.useEffect(()=>{let i=s||document.activeElement===r.current;if(a==="none"||!i)return;let g=setTimeout(h,0),b=setTimeout(h,2e3),C=setTimeout(h,5e3),M=setTimeout(()=>{D(!0)},6e3);return()=>{clearTimeout(g),clearTimeout(b),clearTimeout(C),clearTimeout(M)}},[r,s,a,h]),{hasPWMBadge:w,willPushPWMBadge:k,PWM_BADGE_SPACE_WIDTH:Ue}}var ye=e.createContext({}),Se=e.forwardRef((t,r)=>{var a=t,{value:s,onChange:w,maxLength:d,textAlign:j="left",pattern:P,placeholder:O,inputMode:D="numeric",onComplete:k,pushPasswordManagerStrategy:h="increase-width",pasteTransformer:i,containerClassName:g,noScriptCSSFallback:b=et,render:C,children:M}=a,u=Ze(a,["value","onChange","maxLength","textAlign","pattern","placeholder","inputMode","onComplete","pushPasswordManagerStrategy","pasteTransformer","containerClassName","noScriptCSSFallback","render","children"]),p,R,oe,se,ie;let[Pe,Ce]=e.useState(typeof u.defaultValue=="string"?u.defaultValue:""),m=s??Pe,W=Ke(m),V=e.useCallback(n=>{w?.(n),Ce(n)},[w]),N=e.useMemo(()=>P?typeof P=="string"?new RegExp(P):P:null,[P]),f=e.useRef(null),Y=e.useRef(null),ee=e.useRef({value:m,onChange:V,isIOS:typeof window<"u"&&((R=(p=window?.CSS)==null?void 0:p.supports)==null?void 0:R.call(p,"-webkit-touch-callout","none"))}),K=e.useRef({prev:[(oe=f.current)==null?void 0:oe.selectionStart,(se=f.current)==null?void 0:se.selectionEnd,(ie=f.current)==null?void 0:ie.selectionDirection]});e.useImperativeHandle(r,()=>f.current,[]),e.useEffect(()=>{let n=f.current,l=Y.current;if(!n||!l)return;ee.current.value!==n.value&&ee.current.onChange(n.value),K.current.prev=[n.selectionStart,n.selectionEnd,n.selectionDirection];function v(){if(document.activeElement!==n){q(null),z(null);return}let c=n.selectionStart,x=n.selectionEnd,Q=n.selectionDirection,E=n.maxLength,F=n.value,T=K.current.prev,I=-1,A=-1,_;if(F.length!==0&&c!==null&&x!==null){let ke=c===x,Me=c===F.length&&F.length<E;
6if(ke&&!Me){let L=c;if(L===0)I=0,A=1,_="forward";else if(L===E)I=L-1,A=L,_="backward";else if(E>1&&F.length>1){let re=0;if(T[0]!==null&&T[1]!==null){_=L<T[1]?"backward":"forward";let Re=T[0]===T[1]&&T[0]<E;_==="backward"&&!Re&&(re=-1)}I=re+L,A=re+L+1}}I!==-1&&A!==-1&&I!==A&&f.current.setSelectionRange(I,A,_)}let he=I!==-1?I:c,ge=A!==-1?A:x,Te=_??Q;q(he),z(ge),K.current.prev=[he,ge,Te]}if(document.addEventListener("selectionchange",v,{capture:!0}),v(),document.activeElement===n&&te(!0),!document.getElementById("input-otp-style")){let c=document.createElement("style");if(c.id="input-otp-style",document.head.appendChild(c),c.sheet){let x="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;";J(c.sheet,"[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"),J(c.sheet,`[data-input-otp]:autofill { ${x} }`),J(c.sheet,`[data-input-otp]:-webkit-autofill { ${x} }`),J(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; } }"),J(c.sheet,"[data-input-otp] + * { pointer-events: all !important; }")}}let y=()=>{l&&l.style.setProperty("--root-height",`${n.clientHeight}px`)};y();let S=new ResizeObserver(y);return S.observe(n),()=>{document.removeEventListener("selectionchange",v,{capture:!0}),S.disconnect()}},[]);let[ue,ce]=e.useState(!1),[$,te]=e.useState(!1),[B,q]=e.useState(null),[G,z]=e.useState(null);e.useEffect(()=>{Je(()=>{var n,l,v,y;(n=f.current)==null||n.dispatchEvent(new Event("input"));let S=(l=f.current)==null?void 0:l.selectionStart,c=(v=f.current)==null?void 0:v.selectionEnd,x=(y=f.current)==null?void 0:y.selectionDirection;S!==null&&c!==null&&(q(S),z(c),K.current.prev=[S,c,x])})},[m,$]),e.useEffect(()=>{W!==void 0&&m!==W&&W.length<d&&m.length===d&&k?.(m)},[d,k,W,m]);let H=Ye({containerRef:Y,inputRef:f,pushPasswordManagerStrategy:h,isFocused:$}),de=e.useCallback(n=>{let l=n.currentTarget.value.slice(0,d);if(l.length>0&&N&&!N.test(l)){n.preventDefault();return}typeof W=="string"&&l.length<W.length&&document.dispatchEvent(new Event("selectionchange")),V(l)},[d,V,W,N]),pe=e.useCallback(()=>{var n;if(f.current){let l=Math.min(f.current.value.length,d-1),v=f.current.value.length;(n=f.current)==null||n.setSelectionRange(l,v),q(l),z(v)}te(!0)},[d]),me=e.useCallback(n=>{var l,v;let y=f.current;if(!i&&(!ee.current.isIOS||!n.clipboardData||!y))return;let S=n.clipboardData.getData("text/plain"),c=i?i(S):S;n.preventDefault();let x=(l=f.current)==null?void 0:l.selectionStart,Q=(v=f.current)==null?void 0:v.selectionEnd,E=(x!==Q?m.slice(0,x)+c+m.slice(Q):m.slice(0,x)+c+m.slice(x)).slice(0,d);if(E.length>0&&N&&!N.test(E))return;y.value=E,V(E);let F=Math.min(E.length,d-1),T=E.length;y.setSelectionRange(F,T),q(F),z(T)},[d,V,N,m]),Ee=e.useMemo(()=>({position:"relative",cursor:u.disabled?"default":"text",userSelect:"none",WebkitUserSelect:"none",pointerEvents:"none"}),[u.disabled]),fe=e.useMemo(()=>({position:"absolute",inset:0,width:H.willPushPWMBadge?`calc(100% + ${H.PWM_BADGE_SPACE_WIDTH})`:"100%",clipPath:H.willPushPWMBadge?`inset(0 ${H.PWM_BADGE_SPACE_WIDTH} 0 0)`:void 0,height:"100%",display:"flex",textAlign:j,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"}),[H.PWM_BADGE_SPACE_WIDTH,H.willPushPWMBadge,j]),Oe=e.useMemo(()=>e.createElement("input",ze(qe({autoComplete:u.autoComplete||"one-time-code"},u),{"data-input-otp":!0,"data-input-otp-placeholder-shown":m.length===0||void 0,"data-input-otp-mss":B,"data-input-otp-mse":G,inputMode:D,pattern:N?.source,"aria-placeholder":O,style:fe,maxLength:d,value:m,ref:f,onPaste:n=>{var l;me(n),(l=u.onPaste)==null||l.call(u,n)},onChange:de,onMouseOver:n=>{var l;ce(!0),(l=u.onMouseOver)==null||l.call(u,n)},onMouseLeave:n=>{var l;ce(!1),(l=u.onMouseLeave)==null||l.call(u,n)},onFocus:n=>{var l;pe(),(l=u.onFocus)==null||l.call(u,n)},onBlur:n=>{var l;te(!1),(l=u.onBlur)==null||l.call(u,n)}})),[de,pe,me,D,fe,d,G,B,u,N?.source,m]),ne=e.useMemo(()=>({slots:Array.from({length:d}).map((n,l)=>{var v;let y=$&&B!==null&&G!==null&&(B===G&&l===B||l>=B&&l<G),S=m[l]!==void 0?m[l]:null,c=m[0]!==void 0?null:(v=O?.[l])!=null?v:null;return{char:S,placeholderChar:c,isActive:y,hasFakeCaret:y&&S===null}}),isFocused:$,isHovering:!u.disabled&&ue}),[$,ue,d,G,B,u.disabled,m]),Ne=e.useMemo(()=>C?C(ne):e.createElement(ye.Provider,{value:ne},M),[M,ne,C]);return e.createElement(e.Fragment,null,b!==null&&e.createElement("noscript",null,e.createElement("style",null,b)),e.createElement("div",{ref:Y,"data-input-otp-container":!0,style:Ee,className:g},Ne,e.createElement("div",{style:{position:"absolute",inset:0,pointerEvents:"none"}},Oe)))});Se.displayName="Input";function J(t,r){try{t.insertRule(r)}catch{console.error("input-otp could not insert CSS rule:",r)}}var et=`
7[data-input-otp] {
8  --nojs-bg: white !important;
9  --nojs-fg: black !important;
10
11  background-color: var(--nojs-bg) !important;
12  color: var(--nojs-fg) !important;
13  caret-color: var(--nojs-fg) !important;
14  letter-spacing: .25em !important;
15  text-align: center !important;
16  border: 1px solid var(--nojs-fg) !important;
17  border-radius: 4px !important;
18  width: 100% !important;
19}
20@media (prefers-color-scheme: dark) {
21  [data-input-otp] {
22    --nojs-bg: black !important;
23    --nojs-fg: white !important;
24  }
25}`;const je=e.forwardRef(({className:t,containerClassName:r,...a},s)=>o.jsx(Se,{ref:s,containerClassName:U("flex items-center gap-2 has-[:disabled]:opacity-50",r),className:U("disabled:cursor-not-allowed",t),...a}));
25je.displayName="InputOTP";const tt=e.forwardRef(({className:t,...r},a)=>o.jsx("div",{ref:a,className:U("flex items-center",t),...r}));tt.displayName="InputOTPGroup";const nt=e.forwardRef(({index:t,className:r,...a},s)=>{const w=e.useContext(ye),{char:d,hasFakeCaret:j,isActive:P}=w.slots[t];return o.jsxs("div",{ref:s,className:U("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",P&&"z-10 ring-1 ring-ring",r),...a,children:[d,j&&o.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:o.jsx("div",{className:"h-4 w-px animate-caret-blink bg-foreground duration-1000"})})]})});nt.displayName="InputOTPSlot";const rt=e.forwardRef(({...t},r)=>o.jsx("div",{ref:r,role:"separator",...t,children:o.jsx(Ge,{})}));rt.displayName="InputOTPSeparator";function ct(){const[t,r]=e.useState(""),[a,s]=e.useState(""),[w,d]=e.useState(""),[j,P]=e.useState(!1),[O,D]=e.useState(""),[k,h]=e.useState(""),[i,g]=e.useState(!1);Ae();const b=async p=>{if(p.preventDefault(),h(""),a!==w){h("Passwords do not match");return}g(!0);try{await Z.auth.register({email:t,password:a}),P(!0)}catch(R){h(R.message||"Registration failed"),g(!1)}},C=async p=>{p.preventDefault(),h(""),g(!0);try{const R=await Z.auth.verifyOtp({email:t,otpCode:O});await Z.auth.setToken(R.access_token),window.location.href="/"}catch(R){h(R.message||"OTP verification failed"),g(!1)}},M=async()=>{h(""),g(!0);try{await Z.auth.resendOtp(t),h("")}catch(p){h(p.message||"Failed to resend OTP")}g(!1)},u=async()=>{try{await Z.auth.loginWithProvider("google","/")}catch(p){h(p.message||"Google registration failed")}};return o.jsxs(o.Fragment,{children:[o.jsx(De,{children:o.jsx("title",{children:"Create Account - OntarioCanna"})}),o.jsx(Fe,{}),o.jsxs(Be,{icon:"✨",title:j?"Verify Email":"Create Account",subtitle:j?"Enter the code sent to your email":"Sign up for OntarioCanna",children:[k&&o.jsx("div",{className:"mb-4 p-3 bg-destructive/10 border border-destructive/30 rounded-lg",children:o.jsx("p",{className:"text-sm text-destructive",children:k})}),j?o.jsxs(o.Fragment,{children:[o.jsxs("form",{onSubmit:C,className:"space-y-4 mb-6",children:[o.jsx("div",{className:"flex justify-center",children:o.jsx(je,{value:O,onChange:D,maxLength:6,disabled:i})}),o.jsx(ae,{type:"submit",className:"w-full",disabled:i||O.length!==6,children:i?"Verifying...":"Verify Email"})]}),o.jsxs("div",{className:"text-sm text-center",children:["Didn't receive the code?"," ",o.jsx("button",{onClick:M,disabled:i,className:"text-primary hover:underline font-medium",children:"Resend OTP"})]})]}):o.jsxs(o.Fragment,{children:[o.jsxs("form",{onSubmit:b,className:"space-y-4 mb-6",children:[o.jsx(le,{type:"email",placeholder:"Email address",value:t,onChange:p=>r(p.target.value),disabled:i,required:!0}),o.jsx(le,{type:"password",placeholder:"Password",value:a,onChange:p=>s(p.target.value),disabled:i,required:!0}),o.jsx(le,{type:"password",placeholder:"Confirm password",value:w,onChange:p=>d(p.target.value),disabled:i,required:!0}),o.jsx(ae,{type:"submit",className:"w-full",disabled:i,children:i?"Creating account...":"Create Account"})]}),o.jsxs("div",{className:"relative mb-6",children:[o.jsx("div",{className:"absolute inset-0 flex items-center",children:o.jsx("div",{className:"w-full border-t border-border"})}),o.jsx("div",{className:"relative flex justify-center text-sm",children:o.jsx("span",{className:"px-2 bg-card text-muted-foreground",children:"Or sign up with"})})]}),o.jsxs(ae,{onClick:u,variant:"outline",className:"w-full mb-6",disabled:i,children:[o.jsx(_e,{className:"mr-2"}),"Sign up with Google"]}),o.jsxs("div",{className:"text-sm text-center",children:["Already have an account?"," ",o.jsx(We,{to:"/login",className:"text-primary hover:underline font-medium",children:"Sign in"})]})]})]})]})}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.