vendor: 6,736 bytes, line 1
1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,176699,e=>{"use strict";let t=(0,e.i(456420).default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);e.s(["default",0,t])},689854,e=>{"use strict";var t=e.i(176699);e.s(["MinusIcon",()=>t.default])},136665,423892,330380,e=>{"use strict";var t=e.i(843476),n=e.i(271645),r=Object.defineProperty,i=Object.defineProperties,a=Object.getOwnPropertyDescriptors,l=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,u=(e,t,n)=>t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,c=n.createContext({}),d=n.forwardRef((e,t)=>{let r;var d,h,f,g,v,{value:x,onChange:b,maxLength:w,textAlign:y="left",pattern:j,placeholder:S,inputMode:C="numeric",onComplete:P,pushPasswordManagerStrategy:k="increase-width",pasteTransformer:_,containerClassName:E,noScriptCSSFallback:D=m,render:N,children:T}=e,O=((e,t)=>{var n={};for(var r in e)o.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&l)for(var r of l(e))0>t.indexOf(r)&&s.call(e,r)&&(n[r]=e[r]);return n})(e,["value","onChange","maxLength","textAlign","pattern","placeholder","inputMode","onComplete","pushPasswordManagerStrategy","pasteTransformer","containerClassName","noScriptCSSFallback","render","children"]);let[R,I]=n.useState("string"==typeof O.defaultValue?O.defaultValue:""),L=null!=x?x:R,M=(r=n.useRef(),n.useEffect(()=>{r.current=L}),r.current),F=n.useCallback(e=>{null==b||b(e),I(e)},[b]),B=n.useMemo(()=>j?"string"==typeof j?new RegExp(j):j:null,[j]),A=n.useRef(null),W=n.useRef(null),H=n.useRef({value:L,onChange:F,isIOS:"u">typeof window&&(null==(h=null==(d=null==window?void 0:window.CSS)?void 0:d.supports)?void 0:h.call(d,"-webkit-touch-callout","none"))}),G=n.useRef({prev:[null==(f=A.current)?void 0:f.selectionStart,null==(g=A.current)?void 0:g.selectionEnd,null==(v=A.current)?void 0:v.selectionDirection]});n.useImperativeHandle(t,()=>A.current,[]),n.useEffect(()=>{let e=A.current,t=W.current;if(!e||!t)return;function n(){if(document.activeElement!==e){K(null),Y(null);return}let t=e.selectionStart,n=e.selectionEnd,r=e.selectionDirection,i=e.maxLength,a=e.value,l=G.current.prev,o=-1,s=-1,u;if(0!==a.length&&null!==t&&null!==n){let e=t===n,r=t===a.length&&a.length<i;if(e&&!r){if(0===t)o=0,s=1,u="forward";else if(t===i)o=t-1,s=t,u="backward";else if(i>1&&a.length>1){let e=0;if(null!==l[0]&&null!==l[1]){u=t<l[1]?"backward":"forward";let n=l[0]===l[1]&&l[0]<i;"backward"!==u||n||(e=-1)}o=e+t,s=e+t+1}}-1!==o&&-1!==s&&o!==s&&A.current.setSelectionRange(o,s,u)}let c=-1!==o?o:t,d=-1!==s?s:n,p=null!=u?u:r;K(c),Y(d),G.current.prev=[c,d,p]}if(H.current.value!==e.value&&H.current.onChange(e.value),G.current.prev=[e.selectionStart,e.selectionEnd,e.selectionDirection],document.addEventListener("selectionchange",n,{capture:!0}),n(),document.activeElement===e&&q(!0),!document.getElementById("input-otp-style")){let e=document.createElement("style");if(e.id="input-otp-style",document.head.appendChild(e),e.sheet){let t="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;";p(e.sheet,"[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"),p(e.sheet,`[data-input-otp]:autofill { ${t} }`),p(e.sheet,`[data-input-otp]:-webkit-autofill { ${t} }`),p(e.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; } }"),p(e.sheet,"[data-input-otp] + * { pointer-events: all !important; }")}}let r=()=>{t&&t.style.setProperty("--root-height",`${e.clientHeight}px`)};r();let i=new ResizeObserver(r);return i.observe(e),()=>{document.removeEventListener("selectionchange",n,{capture:!0}),i.disconnect()}},[]);let[$,z]=n.useState(!1),[U,q]=n.useState(!1),[V,K]=n.useState(null),[X,Y]=n.useState(null);n.useEffect(()=>{var e;setTimeout(e=()=>{var e,t,n,r;null==(e=A.current)||e.dispatchEvent(new Event("input"));let i=null==(t=A.current)?void 0:t.selectionStart,a=null==(n=A.current)?void 0:n.selectionEnd,l=null==(r=A.current)?void 0:r.selectionDirection;null!==i&&null!==a&&(K(i),Y(a),G.current.prev=[i,a,l])},0),setTimeout(e,10),setTimeout(e,50)},[L,U]),n.useEffect(()=>{void 0!==M&&L!==M&&M.length<w&&L.length===w&&(null==P||P(L))},[w,P,M,L]);let J=function({containerRef:e,inputRef:t,pushPasswordManagerStrategy:r,isFocused:i}){let[a,l]=n.useState(!1),[o,s]=n.useState(!1),[u,c]=n.useState(!1),d=n.useMemo(()=>"none"!==r&&("increase-width"===r||"experimental-no-flickering"===r)&&a&&o,[a,o,r]),p=n.useCallback(()=>{let n=e.current,i=t.current;if(!n||!i||u||"none"===r)return;let a=n.getBoundingClientRect().left+n.offsetWidth,o=n.getBoundingClientRect().top+n.offsetHeight/2;0===document.querySelectorAll('[data-lastpass-icon-root],com-1password-button,[data-dashlanecreated],[style$="2147483647 !important;"]').length&&document.elementFromPoint(a-18,o)===n||(l(!0),c(!0))},[e,t,u,r]);return n.useEffect(()=>{let t=e.current;if(!t||"none"===r)return;function n(){s(window.innerWidth-t.getBoundingClientRect().right>=40)}n();let i=setInterval(n,1e3);return()=>{clearInterval(i)}},[e,r]),n.useEffect(()=>{let e=i||document.activeElement===t.current;if("none"===r||!e)return;let n=setTimeout(p,0),a=setTimeout(p,2e3),l=setTimeout(p,5e3),o=setTimeout(()=>{c(!0)},6e3);return()=>{clearTimeout(n),clearTimeout(a),clearTimeout(l),clearTimeout(o)}},[t,i,r,p]),{hasPWMBadge:a,willPushPWMBadge:d,PWM_BADGE_SPACE_WIDTH:"40px"}}({containerRef:W,inputRef:A,pushPasswordManagerStrategy:k,isFocused:U}),Z=n.useCallback(e=>{let t=e.currentTarget.value.slice(0,w);t.length>0&&B&&!B.test(t)?e.preventDefault():("string"==typeof M&&t.length<M.length&&document.dispatchEvent(new Event("selectionchange")),F(t))},[w,F,M,B]),Q=n.useCallback(()=>{var e;if(A.current){let t=Math.min(A.current.value.length,w-1),n=A.current.value.length;null==(e=A.current)||e.setSelectionRange(t,n),K(t),Y(n)}q(!0)},[w]),ee=n.useCallback(e=>{var t,n;let r=A.current;if(!_&&(!H.current.isIOS||!e.clipboardData||!r))return;let i=e.clipboardData.getData("text/plain"),a=_?_(i):i;e.preventDefault();let l=null==(t=A.current)?void 0:t.selectionStart,o=null==(n=A.current)?void 0:n.selectionEnd,s=(l!==o?L.slice(0,l)+a+L.slice(o):L.slice(0,l)+a+L.slice(l)).slice(0,w);if(s.length>0&&B&&!B.test(s))return;r.value=s,F(s);let u=Math.min(s.length,w-1),c=s.length;r.setSelectionRange(u,c),K(u),Y(c)},[w,F,B,L]),et=n.useMemo(()=>
1({position:"relative",cursor:O.disabled?"default":"text",userSelect:"none",WebkitUserSelect:"none",pointerEvents:"none"}),[O.disabled]),en=n.useMemo(()=>({position:"absolute",inset:0,width:J.willPushPWMBadge?`calc(100% + ${J.PWM_BADGE_SPACE_WIDTH})`:"100%",clipPath:J.willPushPWMBadge?`inset(0 ${J.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"}),[J.PWM_BADGE_SPACE_WIDTH,J.willPushPWMBadge,y]),er=n.useMemo(()=>n.createElement("input",i(((e,t)=>{for(var n in t||(t={}))o.call(t,n)&&u(e,n,t[n]);if(l)for(var n of l(t))s.call(t,n)&&u(e,n,t[n]);return e})({autoComplete:O.autoComplete||"one-time-code"},O),a({"data-input-otp":!0,"data-input-otp-placeholder-shown":0===L.length||void 0,"data-input-otp-mss":V,"data-input-otp-mse":X,inputMode:C,pattern:null==B?void 0:B.source,"aria-placeholder":S,style:en,maxLength:w,value:L,ref:A,onPaste:e=>{var t;ee(e),null==(t=O.onPaste)||t.call(O,e)},onChange:Z,onMouseOver:e=>{var t;z(!0),null==(t=O.onMouseOver)||t.call(O,e)},onMouseLeave:e=>{var t;z(!1),null==(t=O.onMouseLeave)||t.call(O,e)},onFocus:e=>{var t;Q(),null==(t=O.onFocus)||t.call(O,e)},onBlur:e=>{var t;q(!1),null==(t=O.onBlur)||t.call(O,e)}}))),[Z,Q,ee,C,en,w,X,V,O,null==B?void 0:B.source,L]),ei=n.useMemo(()=>({slots:Array.from({length:w}).map((e,t)=>{var n;let r=U&&null!==V&&null!==X&&(V===X&&t===V||t>=V&&t<X),i=void 0!==L[t]?L[t]:null;return{char:i,placeholderChar:void 0!==L[0]?null:null!=(n=null==S?void 0:S[t])?n:null,isActive:r,hasFakeCaret:r&&null===i}}),isFocused:U,isHovering:!O.disabled&&$}),[U,$,w,X,V,O.disabled,L]),ea=n.useMemo(()=>N?N(ei):n.createElement(c.Provider,{value:ei},T),[T,ei,N]);return n.createElement(n.Fragment,null,null!==D&&n.createElement("noscript",null,n.createElement("style",null,D)),n.createElement("div",{ref:W,"data-input-otp-container":!0,style:et,className:E},ea,n.createElement("div",{style:{position:"absolute",inset:0,pointerEvents:"none"}},er)))});function p(e,t){try{e.insertRule(t)}catch(e){console.error("input-otp could not insert CSS rule:",t)}}d.displayName="Input";var m=` 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}`;e.s(["OTPInput",0,d,"OTPInputContext",0,c,"REGEXP_ONLY_DIGITS",0,"^\\d+$","REGEXP_ONLY_DIGITS_AND_CHARS",0,"^[a-zA-Z0-9]+$"],423892);var h=e.i(231178);let f=(0,n.createContext)(null);var g=e.i(287022),v=e.i(674008);let x=e=>!e.isLayoutDirty&&e.willUpdate(!1),b=({children:e,id:r,inherit:i=!0})=>{let a=(0,n.useContext)(h.LayoutGroupContext),l=(0,n.useContext)(f),[o,s]=function(){let e,t=(e=(0,n.useRef)(!1),(0,v.useIsomorphicLayoutEffect)(()=>(e.current=!0,()=>{e.current=!1}),[]),e),[r,i]=(0,n.useState)(0),a=(0,n.useCallback)(()=>{t.current&&i(r+1)},[r]);return[(0,n.useCallback)(()=>g.frame.postRender(a),[a]),r]}(),u=(0,n.useRef)(null),c=a.id||l;if(null===u.current){let e,t,n,l;(!0==(!0===(l=i))||"id"===l)&&c&&(r=r?c+"-"+r:c),u.current={id:r,group:!0===i&&a.group||(e=new Set,t=new WeakMap,{add:r=>{e.add(r),t.set(r,r.addEventListener("willUpdate",n))},remove:r=>{e.delete(r);let i=t.get(r);i&&(i(),t.delete(r)),n()},dirty:n=()=>e.forEach(x)})}}let d=(0,n.useMemo)(()=>({...u.current,forceRender:o}),[s]);return(0,t.jsx)(h.LayoutGroupContext.Provider,{value:d,children:e})};var w=e.i(532181),y=e.i(259961),j=e.i(689854);let S=n.createContext(null);e.s(["InputOTP",0,function({className:e,containerClassName:r,pushPasswordManagerStrategy:i="none",...a}){let l=n.useId();return(0,t.jsx)(S.Provider,{value:l,children:(0,t.jsx)(b,{id:l,children:(0,t.jsx)(d,{"data-slot":"input-otp",containerClassName:(0,y.cn)("cn-input-otp flex items-center has-disabled:opacity-50",r),spellCheck:!1,className:(0,y.cn)("disabled:cursor-not-allowed",e),pushPasswordManagerStrategy:i,...a})})})},"InputOTPGroup",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"input-otp-group",className:(0,y.cn)("flex items-center 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",e),...n})},"InputOTPSeparator",0,function({...e}){return(0,t.jsx)("div",{"data-slot":"input-otp-separator",className:"flex items-center [&_svg:not([class*='size-'])]:size-4",role:"separator",...e,children:(0,t.jsx)(j.MinusIcon,{})})},"InputOTPSlot",0,function({index:e,className:r,...i}){let a=n.useContext(c),l=n.useContext(S),{char:o,hasFakeCaret:s,isActive:u}=a?.slots[e]??{};return(0,t.jsxs)("div",{"data-slot":"input-otp-slot","data-active":u,className:(0,y.cn)("group/otp-slot relative flex size-8 items-center justify-center border-y border-r border-input text-sm outline-none transition-[border-color,background-color] duration-150 ease-[
20cubic-bezier(0.22,1,0.36,1)] first:rounded-l-lg first:border-l last:rounded-r-lg aria-invalid:border-destructive data-[active=true]:z-10 data-[active=true]:border-l data-[active=true]:border-transparent dark:bg-input/30",r),...i,children:[u&&l?(0,t.jsx)(w.motion.div,{layoutId:`${l}-active`,className:"pointer-events-none absolute -inset-px rounded-[inherit] border border-ring ring-3 ring-ring/50 group-aria-invalid/otp-slot:border-destructive group-aria-invalid/otp-slot:ring-destructive/20 dark:group-aria-invalid/otp-slot:ring-destructive/40",transition:{type:"spring",duration:.18,bounce:0},"aria-hidden":!0}):null,(0,t.jsx)("span",{className:"relative z-10",children:o}),s&&(0,t.jsx)("div",{className:"pointer-events-none absolute inset-0 z-10 flex items-center justify-center",children:(0,t.jsx)("div",{className:"h-4 w-px animate-caret-blink bg-foreground duration-1000"})})]})}],330380),e.s([],136665)},791310,e=>{"use strict";e.i(271645);var t=e.i(938611);let n=new Set(["meta","twitter"]);var r=e.i(194561);async function i({platform:e,eventType:a,payload:l,eventId:o}){if(!n.has(e))return;let s=(0,t.captureFbclid)(),u=(0,r.captureTwclid)();await fetch("/api/analytics/track",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({platform:e,eventType:a,payload:l,...o?{eventId:o}:{},metaClickIds:s,twitterClickIds:u}),keepalive:!0})}function a(e,t={}){let n={};for(let[e,r]of Object.entries(t))null!=r&&""!==r&&(n[e]=r);window.cherrie?.track?.(e,n)}async function l(e,t){let n=e.trim();if(!n)return;let r=`interested:${n.toLowerCase()}`,l=t?.customerTag?.trim()||"interested",o=t?.phone?.trim()||void 0;await i({platform:"meta",eventType:"interested",payload:{email:n,...o?{phone:o}:{},tag:l},eventId:r}),a("interested",{email:n,...o?{phone:o}:{},tags:[l],memories:["Signed up on cherrie.ai."],event_id:r})}async function o(e){let{eventId:t,email:n,firstName:r,lastName:l,phone:o,company:s,companyUrl:u,value:c,when:d,estimatedMonthlyAdSpend:p}=e;n.trim()&&(a("booked_demo_call",{email:n.trim(),...r?.trim()?{first_name:r.trim()}:{},...l?.trim()?{last_name:l.trim()}:{},...o?.trim()?{phone:o.trim()}:{},...s?.trim()?{company:s.trim()}:{},...u?.trim()?{company_url:u.trim()}:{},tags:["booked_demo"],event_id:t,..."number"==typeof c?{value:c,currency:"USD"}:{},...d?.trim()?{when:d.trim()}:{},...p?.trim()?{estimated_monthly_ad_spend:p.trim()}:{}}),await i({platform:"meta",eventType:"booked_demo_call",payload:{email:n.trim(),...r?.trim()?{firstName:r.trim()}:{},...l?.trim()?{lastName:l.trim()}:{},...o?.trim()?{phone:o.trim()}:{},...s?.trim()?{company:s.trim()}:{},...u?.trim()?{companyUrl:u.trim()}:{},..."number"==typeof c?{value:c}:{},...d?.trim()?{when:d.trim()}:{},...p?.trim()?{estimatedMonthlyAdSpend:p.trim()}:{}},eventId:t}))}async function s(e,t,n={}){t&&await i({platform:"meta",eventType:e,payload:{brandId:t},...n.eventId?{eventId:n.eventId}:{}})}async function u({brandId:e,isFirstUserFunding:t}){t&&await s("purchase",e)}e.s(["trackBookedDemoCallEvent",0,o,"trackInterestedEvent",0,l,"trackPurchaseIfFirstUserFunding",0,u],791310)},24554,e=>{"use strict";var t=e.i(970789);let n=new Set(["8aed6a8a-2cd1-4bf9-b1f7-d94960fafb4c"]);function r(e){return"string"==typeof e&&e.trim().length>0}function i(e){return null!==e&&r(e.first_name)&&r(e.last_name)&&r(e.phone)}function a(e){return e.some(e=>null!==e)}function l(e,t){let n=s(e,t);return n?.has_app_access===!0}function o(e,n){let r=(0,t.resolveMembershipBrandId)(n);if(r&&e.some(e=>e?.id===r))return r;let i=e.find(e=>null!=e&&!0===e.has_app_access);if(i)return i.id??null;let a=e.find(e=>null!=e&&!0!==e.has_app_access);return a?a.id??null:e[0]?.id??null}function s(e,t){let n=o(e,t);return n?e.find(e=>e?.id===n)??null:t?null:e.find(e=>null!=e&&!0===e.has_app_access)??e.find(e=>null!=e&&!0!==e.has_app_access)??e[0]??null}function u(e,t){if(!i(e.profile)||!a(e.brands))return!1;let n=s(e.brands,t);return!!n&&"number"==typeof n?.estimated_monthly_ad_spend_cents&&n.estimated_monthly_ad_spend_cents>=0}function c(e,t){return i(e.profile)?a(e.brands)?l(e.brands,t)?"complete":u(e,t)?"book-call":"brand":"colors":"profile"}function d(e,t,n){return"profile"===e||("colors"===e||"brand"===e?i(t.profile):"book-call"===e&&!l(t.brands,n)&&u(t,n))}e.s(["isOnboardingTabAccessible",0,d,"pickRequiredRoute",0,function(e,t,r){return"string"==typeof r&&n.has(r)?"/":"complete"!==c(e,t)?"/onboarding":"/"},"resolveOnboardingTab",0,function(e,t,n){let r=c(e,t);return n&&"complete"!==n?"billing"===n||"connectors"===n?d("book-call",e,t)?"book-call":r:("brand"!==n||i(e.profile))&&("colors"!==n||i(e.profile))?"book-call"!==n||u(e,t)?d(n,e,t)?n:r:i(e.profile)?a(e.brands)?"brand":"colors":"profile":"profile":r},"resolvePolicyBrandId",0,o])},207832,57715,e=>{"use strict";var t=e.i(843476),n=e.i(271645),r=e.i(618566),i=e.i(64863);e.i(874950);var a=e.i(266824);e.i(522912);var l=e.i(374145),o=e.i(259961);e.i(696307);var s=e.i(846921),u=e.i(633178);e.i(208556);var c=e.i(889322);e.i(136665);var d=e.i(330380),p=e.i(423892);e.i(247167);var m=e.i(24554);function h(e){return e.trim().toLowerCase()}function f(e){return e?"sign-in":"sign-up"}function g(e){return!(e.exists&&e.hasPhone)}function v(e,t){return"sign-in"===e?{title:"Welcome back to Cherrie",description:`Enter your password to continue as ${t}.`,showForgotPassword:!0,submitLabel:"Continue to Cherrie"}:{title:"Sign up to Cherrie",description:`Create a password for ${t}.`,showForgotPassword:!1,submitLabel:"Continue to Cherrie"}}function x(e){let t=e.map(e=>e.toLowerCase());return!!t.includes("google")&&!t.includes("email")}let b="/api/auth/callback";function w(e,t,n,r){let i=function(e,t,n){return"localhost"===e||"127.0.0.1"===e||e.startsWith("192.168.")||e.startsWith("10.")||e.endsWith(".local")||"cherrie.ai"===e||e.endsWith(".cherrie.ai")?t:(n?.trim()||"https://cherrie.ai".trim()||"https://cherrie.ai").replace(/\/+$/,"")}(t,n,r);return`${i}${e.startsWith("/")?e:`/${e}`}`}function y(e){return"1"===e?"reset-form":"error"===e?"reset-error":null}function j(e,t){return e.length<6?"Password must be at least 6 characters.":e!==t?"Passwords don't match.":null}function S(e){if(!e)return null;let t=e.message?.toLowerCase()??"";return"email_not_confirmed"===(e.code?.toLowerCase()??"")||t.includes("email not confirmed")?"unverified":"invalid"}function C(e){if(!e)return null;let t=e.message??"",n=t.toLowerCase(),r=e.code?.toLowerCase()??"",i="over_email_send_rate_limit"===r||n.includes("email rate limit exceeded"),a=n.includes("for security purposes")||/after \d+ seconds?/.test(n);if(429===e.status||r.includes("rate_limit")||n.includes("rate limit")||a||n.includes("too many")){if(i)return"Too many verification emails were sent. Check your inbox for an earlier co
20de and try again in a few minutes.";if(a){let e=function(e){let t=e.match(/after (\d+) seconds?/i);if(!t)return null;let n=Number(t[1]);return Number.isFinite(n)&&n>0?n:null}(t)??3;return`Please wait ${e} seconds before requesting another code.`}return"Too many requests. Please wait a moment before requesting another code."}return e.message??"Couldn't send the code. Please try again."}function P(e,t){return(0,m.pickRequiredRoute)(e,void 0,t)}e.s(["OTP_RESEND_COOLDOWN_SECONDS",0,3,"PASSWORD_RESET_CALLBACK_PATH",0,b,"buildAuthCallbackUrl",0,w,"classifyResendError",0,C,"classifySignInError",0,S,"getPasswordStepCopy",0,v,"normalizeAuthEmail",0,h,"pickPostLoginRoute",0,P,"resolvePasswordStepMode",0,f,"resolveRecoveryStep",0,y,"shouldCollectSignupPhone",0,g,"shouldUseGoogleOAuthForProviders",0,x,"validateResetPassword",0,j],57715);var k=e.i(95187);let _=(0,k.createServerReference)("40c9bc94e07976a1a1b3ebe5acfa13802c2c009455",k.callServer,void 0,k.findSourceMapURL,"checkUserExistsByEmail"),E=(0,k.createServerReference)("40a6e489ccfe99d354380f5f1004bb88de99b71bce",k.callServer,void 0,k.findSourceMapURL,"markLeadConverted");async function D(e,t,n){let r=n.trim();if(!r||!t)return;let i=await e.from("profiles").upsert({id:t,phone:r,updated_at:new Date().toISOString()});i.error&&console.error("[Auth] persistSignupPhone failed:",i.error.message)}function N(e){if("u"<typeof document)return;let t=e.trim();t&&(document.cookie=`cherrie_signup_phone=${encodeURIComponent(t)}; path=/; max-age=3600; SameSite=Lax`)}var T=e.i(791310);let O="h-8 w-full min-w-0 rounded-lg border bg-2 px-3 py-1 text-sm transition-colors outline-none placeholder:text-10 focus-visible:border-7 focus-visible:ring-[3px] focus-visible:ring-color-11 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",R="size-8 rounded-lg border border-input bg-2 text-sm first:rounded-lg last:rounded-lg first:border-l",I="Google account found. Redirecting to Google...";function L(){return(0,t.jsxs)("svg",{className:"size-4",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,t.jsx)("path",{fill:"#4285F4",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),(0,t.jsx)("path",{fill:"#34A853",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),(0,t.jsx)("path",{fill:"#FBBC05",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),(0,t.jsx)("path",{fill:"#EA4335",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]})}function M({triggerClassName:e,triggerLabel:m="Log in",trigger:k,open:F,onOpenChange:B,initialEmail:A,customerTag:W,showTrigger:H=!0,recoveryListener:G=!1}={}){let $=n.useMemo(()=>(0,i.createClient)(),[]),z=(0,r.useRouter)(),U=(0,r.useSearchParams)(),q=U.get("recovery"),V=void 0!==F,[K,X]=n.useState(!1),Y=V?F:K,[J,Z]=n.useState("initial"),[Q,ee]=n.useState("sign-in"),[et,en]=n.useState(""),[er,ei]=n.useState(""),[ea,el]=n.useState([]),[eo,es]=n.useState(!1),[eu,ec]=n.useState(!1),[ed,ep]=n.useState(""),[em,eh]=n.useState(""),[ef,eg]=n.useState(""),[ev,ex]=n.useState(""),[eb,ew]=n.useState(null),[ey,ej]=n.useState(!1),eS=n.useRef(null),[eC,eP]=n.useState(0);async function ek(e){try{let{data:{user:t}}=await $.auth.getUser();if(t?.email&&h(t.email)===e)return t}catch{await $.auth.signOut({scope:"local"})}return null}async function e_(e){let[t,n]=await Promise.all([$.from("profiles").select("first_name,last_name,phone").eq("id",e).maybeSingle(),$.from("user_brands").select("brand:brands(id,has_app_access,brand_accounts(account_id,is_active))").eq("user_id",e)]),r=t.data??null,i=(n.data??[]).map(e=>e.brand).filter(e=>null!==e);window.location.href=P({profile:r,brands:i},e)}async function eE(e){let t=e.phone?.trim()||"";(t&&N(t),e.exists||(0,T.trackInterestedEvent)(e.normalizedEmail,{...W?{customerTag:W}:{},...t?{phone:t}:{}}),e.preferGoogle||eu||e.exists&&x(e.providers))?await eF(I):(ee(f(e.exists)),ep(""),Z("password"),ej(!1))}async function eD(e){e.preventDefault(),ew(null),ej(!0),ec(!1);let t=h(et);en(t);let n=await ek(t);if(n)return void await e_(n.id);let{exists:r,providers:i=[],hasPhone:a=!1}=await _(t);if(el(i),g({exists:r,hasPhone:a}
20)){es(!0),ee(f(r)),Z("phone"),ej(!1);return}es(!1),await eE({normalizedEmail:t,providers:i,exists:r})}async function eN(e){e.preventDefault(),ew(null),ej(!0);let t=er.trim();ei(t),await eE({normalizedEmail:et,providers:ea,exists:"sign-in"===Q,phone:t,preferGoogle:eu})}async function eT(e){if(e.preventDefault(),ew(null),ej(!0),"sign-up"===Q)return void await eO();let{data:t,error:n}=await $.auth.signInWithPassword({email:et,password:ed}),r=S(n);if(null===r&&t.user){await D($,t.user.id,er),await e_(t.user.id);return}if("unverified"===r){Z("verify-otp"),ej(!1);return}ew("Incorrect password. Try again or reset it below."),ej(!1)}async function eO(){let{data:e,error:t}=await $.auth.signUp({email:et,password:ed});if(t){/already.*regist|already.*exist/i.test(t.message)?ew("An account with this email already exists, but the password is incorrect."):ew(C(t)??t.message),ej(!1);return}if(e.user&&(e.user.identities?.length??0)===0){ew("An account with this email already exists, but the password is incorrect."),ej(!1);return}e.user&&D($,e.user.id,er),eP(3),Z("verify-otp"),ej(!1)}async function eR(){let{error:e}=await $.auth.resend({type:"signup",email:et}),t=C(e);t&&ew(t),eP(3),Z("verify-otp")}async function eI(e){e.preventDefault(),ew(null),ej(!0);let{data:t,error:n}=await $.auth.verifyOtp({email:et,token:ev,type:"signup"});if(n){ew("Invalid or expired code. Please try again."),ej(!1);return}t.user&&(E({email:et,user_id:t.user.id}),await D($,t.user.id,er)),window.location.href="/onboarding"}async function eL(e){e.preventDefault(),ew(null),ej(!0);let t=w(b,window.location.hostname,window.location.origin),{error:n}=await $.auth.resetPasswordForEmail(et,{redirectTo:t});if(n){ew(n.message),ej(!1);return}Z("forgot-sent"),ej(!1)}async function eM(e){e.preventDefault(),ew(null);let t=j(em,ef);if(t)return void ew(t);ej(!0);let{error:n}=await $.auth.updateUser({password:em});if(n){ew(n.message),ej(!1);return}Z("reset-done"),window.location.href="/"}async function eF(e){ew(e??null),ej(!0),N(er);let{data:t,error:n}=await $.auth.signInWithOAuth({provider:"google",options:{redirectTo:w("/api/auth/google",window.location.hostname,window.location.origin),queryParams:{prompt:"select_account"}}});if(n||!t?.url){ew(n?.message??"Could not start Google sign-in."),ej(!1);return}window.location.href=t.url}async function eB(){let e=h(et);if(!e)return void await eF();ew(null),ej(!0),en(e),ec(!0);let t=await ek(e);if(t)return void await e_(t.id);let{exists:n,providers:r=[],hasPhone:i=!1}=await _(e);if(el(r),ee(f(n)),g({exists:n,hasPhone:i})){es(!0),Z("phone"),ej(!1);return}es(!1),await eE({normalizedEmail:e,providers:r,exists:n,preferGoogle:!0})}n.useEffect(()=>{if(eC<=0)return;let e=setTimeout(()=>eP(e=>e-1),1e3);return()=>clearTimeout(e)},[eC]),n.useEffect(()=>{Y&&A&&en(A)},[Y,A]),n.useEffect(()=>{if(!G||!q||eS.current===q)return;let e=y(q);if(e){let t,n,r;eS.current=q,(t=new URLSearchParams(U.toString())).delete("recovery"),n=t.toString(),r=window.location.pathname,z.replace(n?`${r}?${n}`:r,{scroll:!1}),ew("reset-error"===e?"This reset link is invalid or has expired.":null),Z(e),V?B?.(!0):X(!0)}},[G,q]);let eA="password"===J?v(Q,et):null;return(0,t.jsxs)(s.Dialog,{open:Y,onOpenChange:function(e){V?B?.(e):X(e),e||(Z("initial"),ee("sign-in"),en(""),ei(""),el([]),es(!1),ec(!1),ep(""),eh(""),eg(""),ex(""),ew(null),ej(!1),eP(0))},children:[!V&&H&&(0,t.jsx)(s.DialogTrigger,{asChild:!0,children:k??(0,t.jsx)("button",{type:"button",className:(0,o.cn)("rounded-full bg-white/20 px-3 py-1 text-sm font-medium text-white transition-colors hover:bg-white/30",e),children:m})}),(0,t.jsxs)(u.DialogAnimatedContent,{stepKey:J,maxHeightPx:640,className:"sm:max-w-sm",children:["initial"===J&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(s.DialogHeader,{children:[(0,t.jsx)(s.DialogTitle,{children:"Continue to Cherrie"}),(0,t.jsx)(s.DialogDescription,{children:"Enter your email to sign in or create an account."})]}),(0,t.jsxs)("div",{className:"grid gap-2",children:[(0,t.jsxs)("form",{onSubmit:eD,className:"grid gap-3",children:[(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsx)(c.Label,{htmlFor:"auth-email",children:"Email"}),(0,t.jsx)("input",{id:"auth-email",type:"email",className:O,placeholder:"[email protected]",autoComplete:"email",required:!0,value:et,onChange:e=>en(e.target.value)})]}),eb&&(0,t.jsx)("p",{className:(0,o.cn)("text-sm",eb===I?"text-color-green-15":"text-destructive"),children:eb}),(0,t.jsx)(a.Button,{type:"submit",disabled:ey||!et.trim(),children:ey?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.Spinner,{"data-icon":"inl
20ine-start"}),"Loading"]}):"Continue to Cherrie"})]}),(0,t.jsxs)(a.Button,{type:"button",variant:"outline",className:"w-full gap-2",disabled:ey,onClick:eB,children:[(0,t.jsx)(L,{}),"Continue with Google"]})]})]}),"phone"===J&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(s.DialogHeader,{children:[(0,t.jsx)(s.DialogTitle,{children:"Add your phone number"}),(0,t.jsx)(s.DialogDescription,{children:"We use this to reach you about your account."})]}),(0,t.jsxs)("form",{onSubmit:eN,className:"grid gap-3",children:[(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsx)(c.Label,{htmlFor:"auth-email-phone-step",children:"Email"}),(0,t.jsx)("input",{id:"auth-email-phone-step",type:"email",className:O,autoComplete:"email",readOnly:!0,value:et})]}),(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsx)(c.Label,{htmlFor:"auth-phone",children:"Phone"}),(0,t.jsx)("input",{id:"auth-phone",type:"tel",className:O,placeholder:"+1 (555) 000-0000",autoComplete:"tel",required:!0,value:er,onChange:e=>ei(e.target.value)})]}),eb&&(0,t.jsx)("p",{className:"text-sm text-destructive",children:eb}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(a.Button,{type:"button",variant:"outline",disabled:ey,onClick:()=>{ew(null),ei(""),es(!1),ec(!1),Z("initial")},children:"Back"}),(0,t.jsx)(a.Button,{type:"submit",className:"flex-1",disabled:ey||!er.trim(),children:ey?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.Spinner,{"data-icon":"inline-start"}),"Loading"]}):"Continue to Cherrie"})]})]})]}),"password"===J&&eA&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(s.DialogHeader,{children:[(0,t.jsx)(s.DialogTitle,{children:eA.title}),(0,t.jsx)(s.DialogDescription,{children:eA.description})]}),(0,t.jsxs)("form",{onSubmit:eT,className:"grid gap-3",children:[(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsx)(c.Label,{htmlFor:"auth-email-readonly",children:"Email"}),(0,t.jsx)("input",{id:"auth-email-readonly",type:"email",className:O,autoComplete:"email",readOnly:!0,value:et})]}),(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsx)(c.Label,{htmlFor:"auth-password",children:"Password"}),(0,t.jsx)("input",{id:"auth-password",type:"password",className:O,placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",autoComplete:"sign-in"===Q?"current-password":"new-password",required:!0,value:ed,onChange:e=>ep(e.target.value)}),eA.showForgotPassword&&(0,t.jsx)("button",{type:"button",className:"justify-self-start text-xs text-muted-foreground underline-offset-4 hover:text-foreground hover:underline",onClick:()=>{ew(null),Z("forgot")},children:"Forgot password?"})]}),eb&&(0,t.jsx)("p",{className:"text-sm text-destructive",children:eb}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(a.Button,{type:"button",variant:"outline",disabled:ey,onClick:()=>{ew(null),ep(""),Z(eo?"phone":"initial")},children:"Back"}),(0,t.jsx)(a.Button,{type:"submit",className:"flex-1",disabled:ey||!ed,children:ey?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.Spinner,{"data-icon":"inline-start"}),"Loading"]}):eA.submitLabel})]})]})]}),"verify-otp"===J&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(s.DialogHeader,{children:[(0,t.jsx)(s.DialogTitle,{children:"Verify your email"}),(0,t.jsxs)(s.DialogDescription,{children:["Enter the 6-digit code we sent to ",(0,t.jsx)("strong",{children:et}),". Check your spam folder if you don't see it."]})]}),(0,t.jsxs)("form",{onSubmit:eI,className:"grid gap-3",children:[(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsx)(c.Label,{htmlFor:"auth-otp",children:"Verification code"}),(0,t.jsx)(d.InputOTP,{id:"auth-otp",maxLength:6,pattern:p.REGEXP_ONLY_DIGITS,autoComplete:"one-time-code",inputMode:"numeric",required:!0,value:ev,onChange:ex,disabled:ey,"aria-invalid":!!eb||void 0,children:(0,t.jsxs)(d.InputOTPGroup,{className:"gap-2",children:[(0,t.jsx)(d.InputOTPSlot,{index:0,className:R}),(0,t.jsx)(d.InputOTPSlot,{index:1,className:R}),(0,t.jsx)(d.InputOTPSlot,{index:2,className:R}),(0,t.jsx)(d.InputOTPSlot,{index:3,className:R}),(0,t.jsx)(d.InputOTPSlot,{index:4,className:R}),(0,t.jsx)(d.InputOTPSlot,{index:5,className:R})]})})]}),eb&&(0,t.jsx)("p",{className:"text-sm text-destructive",children:eb}),(0,t.jsx)(a.Button,{type:"submit",disabled:ey||ev.length<6,children:ey?"Verifyingâ¦":"Verify email"}),(0,t.jsx)("button",{type:"button",disabled:eC>0,className:"justify-self-center text-xs text-muted-foreground underline-offset-4 hover:text-foreground hover:underline disabled:pointer-events-none disabled:opacity-50",onClick:()=>{ew(null),eR()},children:eC>0?`Resend code in ${eC}s`:"Resend code"})]})]}),"forgot"===J&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(s.DialogHeader,{children:[(0,t.jsx)(s.DialogTitle,{children:"Reset your password"}),(0,t.jsx)(s.DialogDescription,{children:"We'll email you a link to set a new password."})]}),(0,t.jsxs)("form",{onSubmit:eL,className:"grid gap-3",children:[(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsx)(c.Label,{htmlFor:"auth-forgot-email",children:"Email"}),(0,t.jsx)("input",{id:"auth-forgot-email",type:"email",className:O,placeholder:"[email protected]",autoComplete:"email",required:!0,value:et,onChange:e=>en(e.target.value)})]}),eb&&(0,t.jsx)("p",{className:"text-sm text-destructive",children:eb}),(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(a.Button,{type:"button",variant:"outline",disabled:ey,onClick:()=>{ew(null),Z("password")},children:"Back"}),(0,t.jsx)(a.Button,{type:"submit",className:"flex-1",disabled:ey||!et,children:ey?"Sendingâ¦":"Send reset link"})]})]})]}),"forgot-sent"===J&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(s.DialogHeader,{children:[(0,t.jsx)(s.DialogTitle,{children:"Check your email"}),(0,t.jsxs)(s.DialogDescription,{children:["We sent a password reset link to ",(0,t.jsx)("strong",{children:et}),". Follow it to set a new password."]})]}),(0,t.jsx)(a.Button,{type:"button",variant:"outline",onClick:()=>Z("password"),children:"Back to sign in"})]}),"reset-error"===J&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(s.DialogHeader,{children:[(0,t.jsx)(s.DialogTitle,{children:"Reset link problem"}),(0,t.jsx)(s.DialogDescription,{children:eb})]}),(0,t.jsx)(a.Button,{type:"button",variant:"outline",onClick:()=>{ew(null),Z("initial")},children:"Back to sign in"})]}),"reset-form"===J&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(s.DialogHeader,{children:[(0,t.jsx)(s.DialogTitle,{children:"Set a new password"}),(0,t.jsx)(s.DialogDescription,{children:"Enter and confirm your new password below."})]}),(0,t.jsxs)("form",{onSubmit:eM,className:"grid gap-3",children:[(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsx)(c.Label,{htmlFor:"auth-reset-password",children:"New password"}),(0,t.jsx)("input",{id:"auth-reset-password",type:"password",className:O,placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",autoComplete:"new-password",required:!0,minLength:6,value:em,onChange:e=>eh(e.target.value)})]}),(0,t.jsxs)("div",{className:"grid gap-1.5",children:[(0,t.jsx)(c.Label,{htmlFor:"auth-reset-confirm",children:"Confirm password"}),(0,t.jsx)("input",{id:"auth-reset-confirm",type:"password",className:O,placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",autoComplete:"new-password",required:!0,minLength:6,value:ef,onChange:e=>eg(e.target.value)})]}),eb&&(0,t.jsx)("p",{className:"text-sm text-destructive",children:eb}),(0,t.jsx)(a.Button,{type:"submit",disabled:ey||!em||!ef,children:ey?"Savingâ¦":"Update password"})]})]}),"reset-done"===J&&(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)(s.DialogHeader,{children:[(0,t.jsx)(s.DialogTitle,{children:"Password updated"}),(0,t.jsx)(s.DialogDescription,{children:"Redirectingâ¦"})]})})]})]})}e.s(["AuthDialog",0,function(e={}){return(0,t.jsx)(n.Suspense,{fallback:null,children:(0,t.jsx)(M,{...e})})}],207832)}]);
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.