1import{S as U,i as O,s as X,l as D,e as g,o as J,d as f,p as E,c as y,a as I,f as k,g as C,h as m,q as j,r as B,u as Y,k as T,v as K,w as Q,G as z,t as P,a3 as V,b as H,B as Z,j as G,n as L,y as $,z as ee,A as te,F as re,X as se}from"../chunks/BPGMEduu.js";import"../chunks/IHki7fMi.js";import{p as le}from"../chunks/HWzqw_LS.js";import{g as W}from"../chunks/BhwR6Udm.js";import{h as oe,W as ae,u as F,d as ne}from"../chunks/CwO6co3r.js";import{s as ie,g as ce}from"../chunks/BCPYsc6D.js";import{b as ue}from"../chunks/DewGqWv7.js";import{t as N}from"../chunks/D75uhvUr.js";import{b as de}from"../chunks/ypBqgJst.js";import{S as fe}from"../chunks/mPuSQebK.js";function q(_){let t,s,i,l,r,u;const a=[ve,he,me],e=[];function c(n,h){return n[1]?0:n[2]?1:n[3]?2:-1}return~(l=c(_))&&(r=e[l]=a[l](_)),{c(){t=g("div"),s=g("div"),i=g("div"),r&&r.c(),this.h()},l(n){t=y(n,"DIV",{class:!0});var h=I(t);s=y(h,"DIV",{class:!0});var p=I(s);i=y(p,"DIV",{class:!0});var v=I(i);r&&r.l(v),v.forEach(f),p.forEach(f),h.forEach(f),this.h()},h(){k(i,"class","my-auto pb-10 w-full dark:text-gray-100"),k(s,"class","w-full sm:max-w-md px-10 min-h-screen flex flex-col text-center"),k(t,"class","fixed bg-transparent min-h-screen w-full flex justify-center font-primary z-50 text-black dark:text-white")},m(n,h){C(n,t,h),m(t,s),m(s,i),~l&&e[l].m(i,null),u=!0},p(n,h){let p=l;l=c(n),l===p?~l&&e[l].p(n,h):(r&&(z(),B(e[p],1,1,()=>{e[p]=null}),Y()),~l?(r=e[l],r?r.p(n,h):(r=e[l]=a[l](n),r.c()),j(r,1),r.m(i,null)):r=null)},i(n){u||(j(r),u=!0)},o(n){B(r),u=!1},d(n){n&&f(t),~l&&e[l].d()}}}function me(_){let t,s,i='<div class="mx-auto flex items-center justify-center h-16 w-16 rounded-full bg-red-100 dark:bg-red-900"><svg class="h-8 w-8 text-red-600 dark:text-red-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path></svg></div>',l,r,u="Something went wrong",a,e,c=(_[3]||"An unexpected error occurred")+"",n,h,p,v,S="Go to Sign In",b,x;return{c(){t=g("div"),s=g("div"),s.innerHTML=i,l=D(),r=g("div"),r.textContent=u,a=D(),e=g("div"),n=P(c),h=D(),p=g("div"),v=g("button"),v.textContent=S,this.h()},l(o){t=y(o,"DIV",{class:!0});var d=I(t);s=y(d,"DIV",{class:!0,"data-svelte-h":!0}),V(s)!=="svelte-m1vp0e"&&(s.innerHTML=i),l=E(d),r=y(d,"DIV",{class:!0,"data-svelte-h":!0}),V(r)!=="svelte-1yvwm61"&&(r.textContent=u),a=E(d),e=y(d,"DIV",{class:!0});var w=I(e);n=H(w,c),w.forEach(f),d.forEach(f),h=E(o),p=y(o,"DIV",{class:!0});var A=I(p);v=y(A,"BUTTON",{class:!0,"data-svelte-h":!0}),V(v)!=="svelte-1dhzmb4"&&(v.textContent=S),A.forEach(f),this.h()},h(){k(s,"class","flex justify-center mb-6"),k(r,"class","text-2xl font-medium mb-4"),k(e,"class","text-gray-600 dark:text-gray-300 mb-6"),k(t,"class","mb-7"),k(v,"class","bg-gray-700/5 hover:bg-gray-700/10 dark:bg-gray-100/5 dark:hover:bg-gray-100/10 dark:text-gray-300 dark:hover:text-white transition w-full rounded-full font-medium text-sm py-2.5"),k(p,"class","mt-5")},m(o,d){C(o,t,d),m(t,s),m(t,l),m(t,r),m(t,a),m(t,e),m(e,n),C(o,h,d),C(o,p,d),m(p,v),b||(x=Z(v,"click",_[6]),b=!0)},p(o,d){d&8&&c!==(c=(o[3]||"An unexpected error occurred")+"")&&G(n,c)},i:L,o:L,d(o){o&&(f(t),f(h),f(p)),b=!1,x()}}}function he(_){let t,s,i='<div class="mx-auto flex items-center justify-center h-16 w-16 rounded-full bg-green-100 dark:bg-green-900"><svg class="h-8 w-8 text-green-600 dark:text-green-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path></svg></div>',l,r,u,a,e,c,n,h="Your payment has been processed successfully. Your account is now ready.",p,v,S="Setting up your experience...";return{c(){t=g("div"),s=g("div"),s.innerHTML=i,l=D(),r=g("div"),u=P("Welcome to "),a=P(_[4]),e=P("!"),c=D(),n=g("div"),n.textContent=h,p=D(),v=g("div"),v.textContent=S,this.h()},l(b){t=y(b,"DIV",{class:!0});var x=I(t);s=y(x,"DIV",{class:!0,"data-svelte-h":!0}),V(s)!=="svelte-r25oxp"&&(s.innerHTML=i),l=E(x),r=y(x,"DIV",{class:!0});var o=I(r);u=H(o,"Welcome to "),a=H(o,_[4]),e=H(o,"!"),o.forEach(f),c=E(x),n=y(x,"DIV",{class:!0,"data-svelte-h":!0}),V(n)!=="svelte-t0ii6g"&&(n.textContent=h),p=E(x),v=y(x,"DIV",{class:!0,"data-svelte-h":!0}),V(v)!=="svelte-y5xur5"&&(v.textContent=S),x.forEach(f),this.h()},h(){k(s,"class","flex justify-center mb-6"),k(r,"class","text-2xl font-medium mb-4"),k(n,"class","text-gray-600 dark:text-gray-300 mb-6"),k(v,"class","text-sm text-gray-500 dark:text-gray-400"),k(t,"class","mb-7")},m(b,x){C(b,t,x),m(t,s),m(t,l),m(t,r),m(r,u),m(r,a),m(r,e),m(t,c),m(t,n),m(t,p),m(t,v)},p(b,x){x&16&&G(a,b[4])},i:L,o:L,d(b){b&&f(t)}}}function ve(_){let t,s='<div class="text-2xl font-medium mb-4">Setting up your account</div> <div class="text-gray-600 dark:text-gray-300 mb-6">Please wait while we verify your payment and prepare your workspace.</div>',i,l,r,u,a;
1return u=new fe({}),{c(){t=g("div"),t.innerHTML=s,i=D(),l=g("div"),r=g("div"),$(u.$$.fragment),this.h()},l(e){t=y(e,"DIV",{class:!0,"data-svelte-h":!0}),V(t)!=="svelte-nkfstq"&&(t.innerHTML=s),i=E(e),l=y(e,"DIV",{class:!0});var c=I(l);r=y(c,"DIV",{});var n=I(r);ee(u.$$.fragment,n),n.forEach(f),c.forEach(f),this.h()},h(){k(t,"class","mb-7"),k(l,"class","flex items-center justify-center gap-3 text-xl sm:text-2xl text-center font-semibold dark:text-gray-200")},m(e,c){C(e,t,c),C(e,i,c),C(e,l,c),m(l,r),te(u,r,null),a=!0},p:L,i(e){a||(j(u.$$.fragment,e),a=!0)},o(e){B(u.$$.fragment,e),a=!1},d(e){e&&(f(t),f(i),f(l)),re(u)}}}function pe(_){let t,s,i,l,r,u;document.title=t=_[4]+" - Checkout Success";let a=_[0]&&q(_);return{c(){s=D(),i=g("div"),l=g("div"),r=D(),a&&a.c(),this.h()},l(e){J("svelte-afk7aq",document.head).forEach(f),s=E(e),i=y(e,"DIV",{class:!0});var n=I(i);l=y(n,"DIV",{class:!0}),I(l).forEach(f),r=E(n),a&&a.l(n),n.forEach(f),this.h()},h(){k(l,"class","w-full h-full absolute top-0 left-0 bg-white dark:bg-black"),k(i,"class","w-full h-screen max-h-[100dvh] text-white relative")},m(e,c){C(e,s,c),C(e,i,c),m(i,l),m(i,r),a&&a.m(i,null),u=!0},p(e,[c]){(!u||c&16)&&t!==(t=e[4]+" - Checkout Success")&&(document.title=t),e[0]?a?(a.p(e,c),c&1&&j(a,1)):(a=q(e),a.c(),j(a,1),a.m(i,null)):a&&(z(),B(a,1,1,()=>{a=null}),Y())},i(e){u||(j(a),u=!0)},o(e){B(a),u=!1},d(e){e&&(f(s),f(i)),a&&a.d()}}}function _e(_,t,s){let i,l,r,u;T(_,le,o=>s(7,i=o)),T(_,oe,o=>s(8,l=o)),T(_,ae,o=>s(4,u=o));const a=K("i18n");T(_,a,o=>s(9,r=o));let e=!1,c=!0,n=!1,h=null;const p=async o=>{o&&(console.log(o),N.success(r.t("You're now logged in.")),o.token&&(localStorage.token=o.token),l&&l.emit("user-join",{auth:{token:o.token}}),await F.set(o),await ne.set(await ue()))},v=async()=>{const o=localStorage.getItem("upsell_price_id_y");if(o)return console.log("Found yearly price in localStorage:",o),o;try{const d=await fetch(`${de}/api/v1/stripe/config`);if(d.ok){const w=await d.json();if(w.yearly_price)return console.log("Found yearly price from backend:",w.yearly_price),localStorage.setItem("upsell_price_id_y",w.yearly_price),w.yearly_price}}catch(d){console.error("Failed to fetch yearly price from backend:",d)}return console.log("No yearly price configured, skipping upsell"),null},S=async(o=8e3)=>{var A;const d=Date.now(),w=M=>M==="user"||M==="admin";if(!w((A=se(F))==null?void 0:A.role))for(;Date.now()-d<o;){await new Promise(R=>setTimeout(R,800));const M=await ce(localStorage.token).catch(()=>null);if(M&&(await F.set(M),w(M.role)))return}},b=async o=>{try{const d=await ie(o);if(d&&d.token){await p(d),s(2,n=!0);const w=await v();await S(),w?W("/upsell"):W("/onboarding")}else throw new Error("Invalid response from checkout signin")}catch(d){console.error("Checkout signin error:",d),s(3,h=d.message||"Authentication failed"),N.error(h)}finally{s(1,c=!1),s(0,e=!0)}};return Q(()=>{const o=i.url.searchParams.get("session_id");if(!o){s(3,h="No session ID provided"),s(1,c=!1),s(0,e=!0);return}b(o)}),[e,c,n,h,u,a,()=>W("/auth")]}class Se extends U{constructor(t){super(),O(this,t,_e,pe,X,{})}}export{Se as component}; 2//# sourceMappingURL=59.DRSGAmjK.js.map
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.