1import{d as jn}from"./faListCheck-DLKcNtcQ.js";import{r as a,j as t,z as kn,e as K,X as _r,L as Sr,a0 as vn,B as Cn,n as ue,Z as wn,T as jr,s as kr}from"./react-CiToEmDU.js";import{b as Fn,f as bt,a as Tn,e as zn,u as Rn,x as _t,j as ee,H as vr,I as Cr,w as An,s as St,ar as $n,bN as wr}from"./index-BYjFgc3L.js";import{u as Pn,e as Ln,N as In,P as Bn,O as Wn,l as Dn,m as En,E as qn}from"./App-Brufidul.js";import{S as Mn}from"./ui-RDrFZQ6P.js";import{F as Un}from"./index-VeBbZI0v.js";import{C as pe}from"./Checkout-CZ0hzh0E.js";import{A as jt}from"./Auth-BdlmebOy.js";import{u as Nn}from"./AuthUser-CvWiDbrb.js";import{w as Hn,g as On}from"./recaptcha-DFwfAuPM.js";import{h9 as Fr,g3 as Yn,G as kt,ha as Tr,hb as zr,hc as Rr,ab as Kn,O as Ar}from"./ResourceNode-OBIHQGrc.js";import{s as Qn}from"./sanitizeDescriptionHtml-A7zke0tu.js";import{a as Gn}from"./stripeWalletBilling-B9cd8HBR.js";import{S as Jn,I as Zn}from"./InvitationBar-WNcbm_Lw.js";import{A as Xn}from"./AuthModal-DJ1EXo9i.js";import{n as vt}from"./faPencil-i7LcEqDF.js";import{a as Vn}from"./authFieldErrors-DLXOBThd.js";import{t as _e}from"./TrackMixpanel-C5L6PEAt.js";import{t as eo,a as to}from"./AuthAnalytics-Bwj4VnQf.js";import"./utils-D0PJbLwx.js";import"./media-CVQTa9EZ.js";import"./analytics-BXHdaAVG.js";import"./headerLayout-oz_V-s5H.js";import"./Helmet-Dnl5bqjF.js";import"./tiptap-nRqHaR__.js";import"./Summary-DYvDEkHw.js";import"./faXmark-B7G55HuF.js";import"./charts-llrkN2aQ.js";import"./UserMenu-B_jYy3Li.js";import"./faArrowRight-4u0hryvz.js";import"./faCloudArrowUp-C66WGIf9.js";import"./faHouse-CoXf9sah.js";import"./faHouse-U1l3zx8N.js";import"./SutraLogo-Bi9M0uSf.js";import"./faBoxArchive-tpsCW6hI.js";import"./faFileLines-D3zdxiD5.js";import"./faArrowUpRightFromSquare-DxPh7tzK.js";import"./PresetCard-DwaDohyt.js";import"./faEllipsis-HcBaDDIO.js";import"./default-COrDvlHP.js";import"./FontDropdown-CVwK6Nll.js";import"./UploadedFilesList-sj2xJC_U.js";import"./CoboltLauncher-CbQFsgoE.js";import"./faScaleBalanced-D5aakmWf.js";import"./faClipboardCheck-S11E7M81.js";import"./module-xE8hoDfr.js";(function(){try{var s=typeof window!="undefined"?window:typeof global!="undefined"?global:typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:{};s.SENTRY_RELEASE={id:"e15ff996bbe7105fef2b7e48186cc5ea2cf1c022"};var u=new s.Error().stack;u&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[u]="780644f8-20b1-4c80-99a4-364f6a3925e4",s._sentryDebugIdIdentifier="sentry-dbid-780644f8-20b1-4c80-99a4-364f6a3925e4")}catch{}})();function ro(){return new URLSearchParams(window.location.hash.slice(1)).get("checkout_resume")}function no({slug:s,email:u,selection:y,preview:C}){const[q,he]=a.useState(!1),[b,Se]=a.useState(null),[Q,P]=a.useState(""),[A]=a.useState(ro),[G,$e]=a.useState(!!A&&!C),L=a.useRef(null),x=a.useRef(Promise.resolve()),ge=a.useRef(Promise.resolve()),p=a.useRef(!1),M=a.useRef({email:u,selection:y});M.current={email:u,selection:y};const _=F=>{if(F){L.current=F;try{window.sessionStorage.setItem(`checkout-recovery:${s}`,F)}catch{}}};return a.useEffect(()=>{var S,j;if(!s||C)return;let F=!0;if(A){const k=new URLSearchParams(window.location.hash.slice(1));k.delete("checkout_resume"),window.history.replaceState(window.history.state,"",window.location.pathname+window.location.search+(k.size?`#${k}`:""))}try{L.current=window.sessionStorage.getItem(`checkout-recovery:${s}`)}catch{}return ge.current=(S=window.$api)==null?void 0:S.get(`/api/v4/spaces/${s}/checkout/recovery.json`,{timeout:3e3}).then(({data:k})=>{F&&(p.current=k.enabled===!0,he(k.enabled===!0))}).catch(()=>{}),A&&((j=window.$api)==null||j.get(`/api/v4/spaces/${s}/checkout/recovery/resume.json`,{params:{resume_token:A},timeout:1e4}).then(({data:k})=>{F&&Se(k.selection)}).catch(()=>{F&&P("This recovery link is no longer available. You can start a new checkout below.")}).finally(()=>{F&&$e(!1)})),()=>{F=!1}},[s,C,A]),{enabled:q,prepare:async()=>{if(await ge.current,!(!p.current||C))return x.current=x.current.catch(()=>{}).then(async()=>{if(!L.current)try{const{data:F}=await window.$api.post(`/api/v4/spaces/${s}/checkout/recovery.json`,{...M.current.selection,activity:!1},{timeout:3e3});_(F.checkout_token)}catch{}}),x.current},identify:(F={})=>!q||C?Promise.resolve():(x.current=x.current.catch(()=>{}).then(async()=>{var j,k,w,je,N;const S={...M.current,...F};if(!(!((j=S.email)!=null&&j.trim())||!((w=(k=S.selection)==null?void 0:k.space_plan_ids)!=null&&w.length)))try{const B={...S.selection,email:S.email.trim(),checkout_token:L.current,resume_token:A||void 0},J=`/api/v4/spaces/${s}/checkout/recovery.json`;let d;try{d=await window.$api.post(J,B,{timeout:3e3})}catch(te){if(((N=(je=te.response)==null?void 0:je.data)==null?void 0:N.co
1de)!=="checkout_expired")throw te;L.current=null;try{window.sessionStorage.removeItem(`checkout-recovery:${s}`)}catch{}d=await window.$api.post(J,{...B,checkout_token:void 0},{timeout:3e3})}const{data:T}=d;_(T.checkout_token)}catch{}}),x.current),remember:_,token:L,restored:b,resumeError:Q,resumePending:G}}const oo={layout:"tabs",wallets:{link:"never"}},so=({intentType:s,onConfirmed:u,onPaymentSubmit:y,onPaymentError:C,processing:q,buttonText:he,primaryColor:b,buttonTextColor:Se,validateBeforeSubmit:Q,parentError:P,onClearParentError:A,termsRequired:G,termsAccepted:$e,termsCheckbox:L,errorText:x,errorBg:ge,errorBorder:p,taxCollection:M,walletBilling:_})=>{const U=Pn(),I=Ln(),[F,S]=a.useState(!1),[j,k]=a.useState(!1),[w,je]=a.useState(!1),[N,B]=a.useState(null),J=async d=>{if(d.preventDefault(),!(!U||!I)){if(G&&!$e){B("Please accept the terms to continue.");return}if(Q){const T=Q();if(T){B(T);return}}if(S(!0),B(null),y==null||y(),s==="payment_intent"){const{error:T,paymentIntent:te}=await U.confirmPayment({elements:I,redirect:"if_required"});if(T){B(T.message),S(!1),C==null||C(T);return}u(te.payment_method)}else{const{error:T,setupIntent:te}=await U.confirmSetup({elements:I,redirect:"if_required"});if(T){B(T.message),S(!1),C==null||C(T);return}u(te.payment_method)}S(!1)}};return t.jsx("form",{onSubmit:J,children:t.jsxs(kn,{gap:"md",children:[M&&t.jsx(In,{options:{mode:"shipping",fields:{ph
1one:"never"}},onChange:d=>je(d.complete)}),t.jsx(Bn,{onReady:()=>k(!0),options:{...oo,...Gn(_)}}),L,(N||P)&&t.jsxs("div",{style:{fontSize:14,color:x||"#DF1B41",backgroundColor:ge||"#FEF2F2",border:`1px solid ${p||"#FECACA"}`,borderRadius:8,padding:"10px 14px",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[t.jsx("span",{children:N||P}),P&&!N&&A&&t.jsx("button",{onClick:A,style:{background:"none",border:"none",color:x||"#DF1B41",cursor:"pointer",fontSize:18,lineHeight:1,padding:"0 0 0 12px"},children:"Ã"})]}),t.jsx(K,{type:"submit",fullWidth:!0,size:"md",loading:F||q,disabled:!U||!j||M&&!w,style:{backgroundColor:b||"#7950f2",color:Se||"#FFFFFF",borderRadius:8,height:44,fontSize:15,fontWeight:600},children:he||"Pay"})]})})},io="_spaceDescription_1wnaq_1",co="_authInput_1wnaq_38",lo="_checkbox_1wnaq_56",ao="_modalClose_1wnaq_67",uo="_couponInput_1wnaq_71",Me={spaceDescription:io,authInput:co,checkbox:lo,modalClose:ao,couponInput:uo},$r="Username can include only numbers and letters and must be between 3 and 20 characters long.";function Ae(s,u){const y=s==null?void 0:s.error;return typeof y=="string"?y||u:(y==null?void 0:y.message)||u}function Ct(s){var u;return((u=s==null?void 0:s.error)==null?void 0:u.code)==="duplicate_subscription"}const po=["username","email"];function ho(s){const u=s.trim();return!/^[A-Za-z\d]+$/.test(u)||u.length<3||u.length>20?$r:null}const go=()=>{var sr,ir,cr,lr,ar,dr,ur,pr,hr,gr,mr,fr,yr,xr;const s=bt(e=>e.space),u=bt(e=>e.colors),y=bt(e=>e.user),C=Tn(),q=zn(),[he]=Rn(),b=he.get("preview")==="true",[Se]=a.useState(()=>window.location.pathname),Q=a.useRef(!0);a.useEffect(()=>(Q.current=!0,()=>{Q.current=!1}),[]);const[P]=a.useState(()=>({explicit:Yn(he),saved:Fr(s==null?void 0:s.slug)})),A=a.useRef(P.saved),G=a.useRef(!1),[$e,L]=a.useState(()=>!b&&!!(P.explicit||P.saved||new URLSearchParams(window.location.hash.slice(1)).has("checkout_resume"))),[x,ge]=a.useState([]),[p,M]=a.useState([]),[_,U]=a.useState({}),[I,F]=a.useState(!1),[S,j]=a.useState(!1),[k,w]=a.useState(null),[je,N]=a.useState(!1),[B,J]=a.useState(""),[d,T]=a.useState(null),[te,re]=a.useState(null),[wt,ke]=a.useState([]),[O,Pr]=a.useState(""),Ft=a.useRef(!1),[ve,Lr]=a.useState(!1),[Tt,Ir]=a.useState(null),[Ue,Br]=a.useState(null),[z,ne]=a.useState(null),[zt,Wr]=a.useState(()=>kt()),[Ne]=a.useState(()=>kt()),Rt=a.useRef(!1),[oe,Pe]=a.useState("email"),[v,Dr]=a.useState(""),[se,He]=a.useState(""),[Oe,Er]=a.useState(""),[Ye,qr]=a.useState(""),[Le,Mr]=a.useState(""),[At,Z]=a.useState(null),[$t,Ie]=a.useState({}),[st,ie]=a.useState(!1),[Ur,it]=a.useState(!1),Pt=a.useRef(!1),{setAuthUser:Nr,removeAuthUser:Lt}=Nn(),[Ke,Hr]=a.useState(!1),[Or,It]=a.useState(!1),Bt=a.useRef(null),me=a.useRef(0),fe=a.useRef(null),Wt=(sr=s==null?void 0:s.payment_settings)==null?void 0:sr.allow_multiple_space_plan_selections,Y=(ir=s==null?void 0:s.payment_settings)==null?void 0:ir.guest_checkout_enabled,R=y&&y.id,Yr=(cr=s==null?void 0:s.payment_settings)==null?void 0:cr.tax_collection,ce=(lr=s==null?void 0:s.payment_settings)==null?void 0:lr.terms_enabled,Dt=((ar=s==null?void 0:s.payment_settings)==null?void 0:ar.terms_link_label)||"Terms and Conditions",Kr=((dr=s==null?void 0:s.payment_settings)==null?void 0:dr.terms_content)||"",m=no({slug:s==null?void 0:s.slug,email:(y==null?void 0:y.email)||(Y?O:v),selection:{space_plan_ids:p,coupon_code:d==null?void 0:d.code,pwyc_amounts:_},preview:b}),Et=a.useRef(!1),[ct,Qr]=a.useState(!1),Qe=$e||m.resumePending||!!(m.restored&&!ct);a.useEffect(()=>{if(!I||!m.restored||Et.current)return;Et.current=!0;const e=(m.restored.space_plan_ids||[]).filter(r=>x.some(i=>i.id===r));e.length&&(M(e),ne(null)),m.restored.pwyc_amounts&&U(m.restored.pwyc_amounts),!P.explicit&&!m.restored.coupon_code&&!(d!=null&&d.code)&&(Tr(s.slug,P.saved),A.current=null),Qr(!0)},[I,m.restored,x]),a.useEffect(()=>{var r;if(!I||m.resumePending||m.restored&&!ct||G.current)return;if(G.current=!0,b||ve){L(!1);return}const e=P.explicit||(m.restored?m.restored.coupon_code:(r=P.saved)==null?void 0:r.code);if(!e||!p.length){L(!1);return}A.current=P.explicit||m.restored?zr(s.slug,e):P.saved,J(e),Kt(e)},[I,m.resumePending,m.restored,ct,p,ve]);const qt=()=>{var i;const e=new URL(window.location.href),r=(d==null?void 0:d.code)||B||((i=A.current)==null?void 0:i.code)||(G.current?null:P.explicit);return r?e.searchParams.set("coupon",r):e.searchParams.delete("coupon"),ee()?e.href:`/space/${s.slug}/checkout${e.search}${e.hash}`}
1,X=(e="auth",r=v||O)=>{const i=_t();$n({mode:e,navigate:q,returnTo:qt(),intent:"checkout",context:{s:s==null?void 0:s.slug},extraParams:{email:(r==null?void 0:r.trim())||void 0,invitation_slug:i||void 0}})},Gr=e=>{const r=(e||"").trim();if(!r)return;const i=new URLSearchParams({email:r}),o=x.find(c=>p.includes(c.id))||x[0];if(o!=null&&o.name&&i.set("plan",o.name),o){const c=we(o);c>0&&i.set("cents",c.toString()),i.set("currency",(o.currency||"usd").toLowerCase())}q(`/space/${s.slug}/checkout-confirmed?${i.toString()}`)};a.useEffect(()=>{if(b||R||!I)return;const e=_t();!e||Ft.current||(Ft.current=!0,pe.onLookup(s.slug,{invitation_slug:e},r=>{if(!((r==null?void 0:r.status)!=="already_paid"||!r.email)){if(ee()){X(r.next==="sign_in"?"sign_in":"sign_up",r.email);return}Gr(r.email)}},()=>{}))},[b,R,I,s==null?void 0:s.slug]),a.useEffect(()=>(C(vr({hidden:!0})),C(Cr({hidden:!0})),Hn(),Jr(),An.onFetchSimple(s.slug,"payment",e=>Ir(e),()=>{}),()=>{C(vr({hidden:!1})),C(Cr({hidden:!1}))}),[]);const Ge=e=>e.pwyc_default>0?e.pwyc_default:Math.max(Number(e.pwyc_min)||0,0),Mt=e=>{const r={};e.forEach(i=>{i.pwyc_enabled&&(r[i.id]=Ge(i))}),Object.keys(r).length>0&&U(i=>({...i,...r}))},Jr=()=>{const e=he.get("plan"),r=i=>{ge(i),M(i.length>0?[i[0].id]:[]),F(!0)};Wn.onFetchAll(s.slug,i=>{let o=Array.isArray(i)?i:i.space_plans||[];if(!Array.isArray(i)&&i.free_access_invitation&&Lr(!0),b&&(o=o.filter(c=>c.visibility!=="hidden")),Mt(o),e){const c=o.find(l=>l.uid===e||l.id===parseInt(e));c?(Mt([c]),ge([c]),M([c.id]),F(!0)):(w("Plan not found"),r(o))}else r(o)},()=>{w("Unable to load plans"),F(!0)},e&&!b?{plan:e}:{})},Ut=(e,r)=>e?r.reduce((i,o)=>(Object.prototype.hasOwnProperty.call(e,o)&&(i[o]=e[o]),i),{}):{},Zr=(e,r)=>e&&{...e,applicable_space_plan_ids:(e.applicable_space_plan_ids||[]).filter(i=>r.includes(i)),quoted_discount_cents_by_plan_id:Ut(e.quoted_discount_cents_by_plan_id,r),quoted_final_amount_cents_by_plan_id:Ut(e.quoted_final_amount_cents_by_plan_id,r)},Nt=(e,r,i)=>JSON.stringify({code:(e||"").toUpperCase(),planIds:[...r].sort((o,c)=>o-c),pwyc:[...r].sort((o,c)=>o-c).map(o=>{var c,l;return[o,(l=(c=i[o])!=null?c:i[String(o)])!=null?l:null]})}),Je=()=>{me.current+=1,fe.current=null,L(!1)},Ht=()=>{Je(),ne(null)},Xr=e=>{const r=x.find(o=>o.id===e);r!=null&&r.pwyc_enabled&&_[e]==null&&U(o=>({...o,[e]:Ge(r)}));let i=p;if(Wt)if(p.includes(e)){if(p.length<=1)return;i=p.filter(o=>o!==e)}else{if(p.length>0){const o=x.find(h=>h.id===p[0]),c=((o==null?void 0:o.currency)||"usd").toLowerCase(),l=((r==null?void 0:r.currency)||"usd").toLowerCase();if(c!==l){w(`Cannot combine plans with different currencies (${c.toUpperCase()} and ${l.toUpperCase()})`);return}}i=[...p,e]}else i=[e];Je(),M(i),m.identify({selection:{space_plan_ids:i,coupon_code:d==null?void 0:d.code,pwyc_amounts:_}}),d&&(T(o=>
1Zr(o,i)),ke(o=>o.filter(c=>i.includes(c.space_plan_id)))),ne(null)};a.useEffect(()=>{if(!(d!=null&&d.code)||p.length===0)return;const e=Nt(d.code,p,_);if(e===fe.current)return;const r=setTimeout(()=>{const i=++me.current;pe.onApplyCoupon(s.slug,{coupon_code:d.code,space_plan_ids:p,pwyc_amounts:_},o=>{i===me.current&&(o.valid?(fe.current=e,T(o.coupon),ke(o.inapplicable_plans||[]),re(null),ne(null)):(fe.current=null,T(null),ke(o.inapplicable_plans||[]),re(o.error||"Coupon no longer applies"),ne(null)))},o=>{i===me.current&&re((o==null?void 0:o.error)||"Unable to refresh coupon")})},400);return()=>clearTimeout(r)},[d==null?void 0:d.code,p,_,s.slug]),a.useEffect(()=>{b||ve||Qe||(R||Y)&&p.length>0&&!z&&!S&&I&&Ot()},[p,R,I,d,z,_,Qe]);const ye=(e={})=>({feature:"checkout",checkout_id:Ne,space_id:s==null?void 0:s.id,space_slug:s==null?void 0:s.slug,is_guest:!R,...e}),Ot=async({showError:e=!1}={})=>{if(Qe)return;const r=Zt();if(r){e&&w(r);return}j(!0),w(null),N(!1),await m.prepare();const i=kt();Wr(i),pe.onCreate(s.slug,{space_plan_ids:p,pwyc_amounts:_,coupon_code:d==null?void 0:d.code,idempotency_key:i,checkout_token:m.token.current},o=>{var c;if(o.publishable_key&&Br(Dn(o.publishable_key)),m.remember(o.checkout_token),ne(o),j(!1),!Rt.current){Rt.current=!0;const l=x.filter(h=>p.includes(h.id));_e("Checkout Started",ye({plan_ids:p,plan_count:p.length,amount_cents:lt(),currency:(((c=l[0])==null?void 0:c.currency)||"usd").toLowerCase(),intent_type:o.type,has_coupon:!!d}))}},o=>{N(Ct(o)),w(Ae(o,"Checkout failed")),j(!1)})},Yt=()=>{if(!R&&Y&&O){const r=x.filter(o=>p.includes(o.id))[0],i=new URLSearchParams({email:O});if(r!=null&&r.name&&i.set("plan",r.name),r){const o=we(r);o>0&&i.set("cents",o.toString()),i.set("currency",(r.currency||"usd").toLowerCase())}return`/space/${s.slug}/checkout-confirmed?${i.toString()}`}if(p.length===1){const e=x.find(r=>r.id===p[0]);if(e!=null&&e.redirect_after_purchase)return`/space/${e.redirect_after_purchase}`}return`/space/${s.slug}/${s.version||"content"}`},Vr=async e=>{j(!0),await m.identify(),pe.onConfirm(s.slug,{space_plan_ids:p,customer_id:z.customer_id,payment_method_id:e,payment_intent_id:z.payment_intent_id||void 0,pwyc_amounts:_,coupon_code:d==null?void 0:d.code,email:O||void 0,idempotency_key:zt,checkout_id:Ne,checkout_token:m.token.current},async r=>{var l,h;const i=r==null?void 0:r.analytics;if(r.success&&!r.requires_confirmation&&Be(),r.requires_confirmation&&((l=r.pending_intents)==null?void 0:l.length)>0){const f=await Ue;let E=!0;for(const H of r.pending_intents){const V={return_url:window.location.href};e&&(V.payment_method=e);const{error:ot,paymentIntent:ze}=await f.confirmPayment({clientSecret:H.client_secret,confirmParams:V,redirect:"if_required"});if(ot){w(ot.message),j(!1);return}E=E&&(ze==null?void 0:ze.status)==="succeeded"}r.success&&E&&Be()}let o=null;await pe.onFinalize(s.slug,f=>{o=(f==null?void 0:f.analytics)||null},()=>{},Ne),wr((h=o==null?void 0:o.events)!=null&&h.length?o:i),j(!1);const c=Yt();console.log("[Checkout] redirectUrl:",c,"isLoggedIn:",R,"isGuestCheckout:",Y,"guestEmail:",O),q(c)},r=>{N(Ct(r)),w(Ae(r,"Payment confirmation failed")),j(!1),_e("Checkout Failed",ye({stage:"confirm",error:Ae(r,"Payment confirmation failed")}))})},en=()=>{j(!0),w(null),pe.onConfirm(s.slug,{space_plan_ids:p,coupon_code:d==null?void 0:d.code,pwyc_amounts:_,email:O||void 0,idempotency_key:zt,checkout_id:Ne,checkout_token:m.token.current},e=>{e.success&&Be(),wr(e==null?void 0:e.analytics),j(!1);const r=Yt();q(r)},e=>{N(Ct(e)),w(Ae(e,"Could not complete free checkout")),j(!1),_e("Checkout Failed",ye({stage:"free_checkout",error:Ae(e,"Could not complete free checkout")}))})},Kt=(e=B)=>{re(null);const r=++me.current,i=new URLSearchParams(window.location.search).get("coupon");fe.current=null,pe.onApplyCoupon(s.slug,{coupon_code:e,space_plan_ids:p,pwyc_amounts:_},o=>{if(!(!Q.current||r!==me.current))if(L(!1),o.valid){if(fe.current=Nt(o.coupon.code,p,_),T(o.coupon),J(o.coupon.code),!b){const l=Fr(s.slug),h=A.current;(!h||(l==null?void 0:l.code)===h.code&&(l==null?void 0:l.capturedAt)===h.capturedAt)&&(A.current=zr(s.slug,o.coupon.code)),Rr(o.coupon.code,i,Se)}ke(o.inapplicable_plans||[]),re(null),ne(null);const c=Object.values(o.coupon.quoted_discount_cents_by_plan_id||{}).reduce((l,h)=>l+(Number(h)||0),0);_e("Coupon Applied",ye({coupon:o.coupon.code,discount_cents:c,inapplicable_plan_count:(o.inapplicable_plans||[]).length}))}else fe.current=null,T(null),ke(o.inapplicable_plans||[]),re(o.error),_e("Coupon Rejected",ye({coupon:e,error:o.error}))},o=>{!Q.current||r!==me.current||(L(!1),re((o==null?void 0:o.error)||"Unable to validate coupon"))})},Be=()=>{var e;Tr(s.slug,A.current),Rr(null,(d==null?void 0:d.code)||((e=A.current)==null?void 0:e.code)||B||null,Se),A.current=null},tn=()=>{Je(),G.current=!0,L(!1),b||Be(),T(null),J(""),re(null),ke([]),ne(null)},Ze=e=>{if(!e)return null;const r=e.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\n/g,"<br />");return t.jsx("span",{dangerouslySetInnerHTML:{__html:r}}
1)},W=(e,r)=>{const i=e/100,o=i%1!==0;try{return new Intl.NumberFormat("en-US",{style:"currency",currency:(r||"usd").toUpperCase(),minimumFractionDigits:o?2:0,maximumFractionDigits:2}).format(i)}catch{return o?`$${i.toFixed(2)}`:`$${i.toFixed(0)}`}},We=e=>{switch(e){case"monthly":return"/month";case"quarterly":return"/quarter";case"yearly":return"/year";default:return""}},Ce=()=>x.filter(e=>p.includes(e.id)),Qt=e=>{var r;return(r=_[e.id])!=null?r:_[String(e.id)]},we=e=>{const r=Qt(e);return e.pwyc_enabled&&r!==null&&r!==void 0?r:e.amount},Gt=e=>{var i;const r=(i=d==null?void 0:d.quoted_final_amount_cents_by_plan_id)==null?void 0:i[e.id];return r===void 0?we(e):r},Jt=e=>e.has_trial?0:Gt(e),lt=()=>{let e=0;return Ce().forEach(r=>{e+=Jt(r)}),e},rn=()=>{const e={};return Ce().forEach(r=>{const i=(r.currency||"usd").toLowerCase();e[i]=(e[i]||0)+Jt(r)}),e},Xe=()=>new Set(Ce().map(r=>(r.currency||"usd").toLowerCase())).size>1,nn=e=>{var l,h;if(!d)return null;if(d.discount_type==="percent")return`${d.value}%`;const r=e.filter(f=>(d.applicable_space_plan_ids||[]).includes(f.id)),i=(((l=r[0])==null?void 0:l.currency)||((h=e[0])==null?void 0:h.currency)||"usd").toLowerCase(),o=r.reduce((f,E)=>{var V;const H=(V=d.quoted_discount_cents_by_plan_id)==null?void 0:V[E.id];return f+(H||0)},0);if(o>0)return W(o,i);const c=(d.currency_amounts||[]).find(({currency:f})=>(f||"").toLowerCase()===i);return c?W(Math.round(c.amount*100),i):null},at=e=>({usd:"USD",eur:"EUR",gbp:"GBP",cad:"CAD",aud:"AUD",sek:"SEK",chf:"CHF",nzd:"NZD",brl:"BRL",mxn:"MXN",inr:"INR",pln:"PLN"})[e]||e.toUpperCase(),Zt=()=>{for(const e of Ce()){if(!e.pwyc_enabled)continue;const r=Qt(e);if(r==null)return`${e.name}: please enter an amount`;if(r<0)return`${e.name}: amount cannot be negative`;if(e.pwyc_min>0&&r<e.pwyc_min)return`${e.name}: minimum is ${W(e.pwyc_min,e.currency)}`;if(e.pwyc_max>0&&r>e.pwyc_max)return`${e.name}: maximum is ${W(e.pwyc_max,e.currency)}`}return null},on=()=>!R&&Y&&!O?"Please enter your email address.":Zt(),dt=()=>{var c;const e=Ce(),r=e.length>0&&e.every(l=>l.has_trial),i=lt();if(r)return"Start free trial";if(i===0)return"Get access";const o=e.some(l=>l.has_trial);return Xe()?o?"Pay today":"Pay now":`Pay ${W(i,((c=e[0])==null?void 0:c.currency)||"usd")}${o?" today":""}`},Xt=async()=>{if(v.trim()){if(await m.identify(),ee()){X("auth",v);return}ie(!0),Z(null),jt.onStart(v.trim(),s.slug,()=>{Pe("login"),ie(!1)},()=>{Pt.current||(Pt.current=!0,eo({feature:"checkout",channel:"checkout",registration_type:"network",space_slug:s.slug})),Pe("register"),ie(!1)})}},Vt=(e,{isSignup:r=!1}={})=>{Nr(e.user,e.session_token,e.session_token_scope),C(St(e.user)),to(e.user,{isSignup:r,feature:"checkout",channel:"checkout",registration_type:"network",accountCreatedProps:{space_slug:s.slug}}),Z(null),ie(!1)},er=()=>{j(!0),w(null),pe.onClaimFree(s.slug,e=>{j(!1),e.redirect_url?q(e.redirect_url,{replace:!0}):q(`/space/${s.slug}/${s.version||"content"}`,{replace:!0})},e=>{w(Ae(e,"Unable to claim free access")),j(!1)})},ut=()=>{if(!(!v.trim()||!se)){if(ee()){X("sign_in",v);return}ie(!0),Z(null),jt.onSignIn(v.trim(),se,{slug:s.slug},e=>Vt(e),e=>{Z((e==null?void 0:e.message)||"Invalid email or password"),ie(!1)})}},pt=async()=>{if(!v.trim()||!se||!Oe.trim()||!Ye.trim()||!Le.trim())return;const e=ho(Le);if(e){Ie({username:e});return}if(ee()){X("sign_up",v);return}ie(!0),Z(null),Ie({});const r=await On();jt.onSignUp({first_name:Oe.trim(),last_name:Ye.trim(),username:Le.trim(),email:v.trim(),password:se,recaptcha_token:r},{slug:s.slug,channel:"checkout",registration_type:"network"},i=>Vt(i,{isSignup:!0}),i=>{const o=Vn(i,po);Ie(o),Z(Object.keys(o).length>0?null:(i==null?void 0:i.message)||"Could not create account"),ie(!1)})},sn=x.length===1,D=Ce(),g=D[0];if(!I)return t.jsx(_r,{py:80,children:t.jsx(Sr,{color:((u==null?void 0:u.registration_page_button_background_color)||"").trim()||"#7950f2"})});const Ve=e=>{if(!e||typeof e!="string")return"#000000";const r=e.trim().toLowerCase();if(r==="white")return"#ffffff";if(r==="black"||r==="transparent")return"#000000";const i=r.match(/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);if(i){const[,c,l,h]=i;return`#${((1<<24)+(+c<<16)+(+l<<8)+ +h).toString(16).slice(1)}`}const o=r.replace("#","");return o.length===3?`#${o[0]}${o[0]}${o[1]}${o[1]}${o[2]}${o[2]}`:o.length>=6?`#${o.substring(0,6)}`:"#000000"},le=(e,r)=>{const o=Ve(e).replace("#",""),c=parseInt(o.substring(0,2),16),l=parseInt(o.substring(2,4),16),h=parseInt(o.substring(4,6),16),f=Math.round(c+(255-c)*r),E=Math.round(l+(255-l)*r),H=Math.round(h+(255-h)*r);return`#${((1<<24)+(f<<16)+(E<<8)+H).toString(16).slice(1)}`},ht=(e,r)=>{const o=Ve(e).replace("#",""),c=parseInt(o.substring(0,2),16),l=parseInt(o.substring(2,4),16),h=parseInt(o.substring(4,6),16),f=Math.round(c*(1-r)),E=Math.round(l*(1-r)),H=Math.round(h*(1-r));return`#${((1<<24)+(f<<16)+(E<<8)+H).toString(16).slice(1)}`},tr=e=>{const r=Ve(e).replace("#",""),i=parseInt(r.substring(0,2),16)/255,o=parseInt(r.substring(2,4),16)/255,c=parseInt(r.substring(4,6),16)/255,l=h=>h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4);return .2126*l(i)+.7152*l(o)+.0722*l(c)},cn=(e,r)=>{const i=tr(e),o=tr(r),c=Math.max(i,o),l=Math.min(i,o);return(c+.05)/(l+.05)},De=(e,r,i=4.5)=>{let o=Ve(e);const c=!vt(r);for(let l=0;l<20;l++){if(cn(o,r)>=i)return o;o=c?ht(o,.08):le(o,.08)}return o},ae=Kn(u),ln=ae&&((u==null?void 0:u.registration_page_background_color)||"").trim()||"#FAFAFA",an=ae&&((u==null?void 0:u.registration_page_sidebar_background_color)||"").trim()||"#FFFFFF",rr=ae&&((u==null?void 0:u.registration_page_default_text_color)||"").trim()||"#1F2937",Ee=ae&&((u==null?void 0:u.registration_page_sidebar_text_color)||"").trim()||"#1F2937",et=ae&&((u==null?void 0:u.registration_page_button_background_color)||"").trim()||"#7950f2",dn=ae&&((u==null?void 0:u.registration_page_button_text_color)||"").trim()||"#FFFFFF",un=ae&&((u==null?void 0:u.registration_page_link_color)||"").trim()||et,tt=!ae,rt=tt?"#FAFAFA":ln,Fe=tt?"#FFFFFF":an,pn=vt(rt),$=vt(Fe),n={bg:rt,card:Fe,border:tt?"#E5E7EB":Ar(Ee).setAlpha(.25).toString(),borderLight:tt?"#F3F4F6":Ar(Ee).setAlpha(.12).toString(),pageText:De(rr,rt,7),pageTextSecondary:De(le(rr,pn?.3:.45),rt,4.5),text:De(Ee,Fe,7),textSecondary:De(le(Ee,$?.25:.35),Fe,4.5),textMuted:De(le(Ee,$?.4:.55),Fe,3),primary:et,primaryLight:$?le(Fe,.08):le(et,.93),btnText:dn,link:un,green:"#10B981",greenLight:$?"rgba(16, 185, 129, 0.12)":"#ECFDF5",greenBorder:$?"rgba(16, 185, 129, 0.25)":"#A7F3D0",errorText:$?"#FF6B8A":"#DF1B41",errorBg:$?"rgba(239, 68, 68, 0.1)":"#FEF2F2",errorBorder:$?"rgba(255, 107, 138, 0.3)":"#FECACA"},nt=()=>t.jsx(wn,{checked:Ke,onChange:e=>Hr(e.currentTarget.checked),color:n.primary,iconColor:n.btnText,classNames:{input:Me.checkbox},styles:{input:{"--checkout-checkbox-unchecked-bg":n.card,"--checkout-checkbox-unchecked-border":n.border}},label:t.jsxs(jr,{size:"sm",style:{color:n.text},children:["I agree to the"," ",t.jsx(kr,{href:"#",size:"sm",onClick:e=>{e.preventDefault(),e.stopPropagation(),It(!0)},style:{color:n.link,fontWeight:500},children:Dt})]})}),Te=()=>t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:t.jsx("polyline",{points:"20 6 9 17 4 12"})}),hn=()=>{var e;return s.plain_description||((e=s.calendar)==null?void 0:e.plain_description)||""},gt=(e="4px 0 0")=>{const r=hn();return r?t.jsx(Cn,{style:{margin:e,fontSize:16,color:n.pageText,lineHeight:1.5},className:Me.spaceDescription,dangerouslySetInnerHTML:{__html:Qn(r)}}):null},gn=({selected:e})=>t.jsx("div",{style:{width:20,height:20,borderRadius:99,flexShrink:0,border:e?`6px solid ${n.primary}`:`2px solid ${n.border}`,backgroundColor:n.card}}),mn=({checked:e})=>t.jsx("div",{style:{width:18,height:18,borderRadius:4,flexShrink:0,border:e?"none":`2px solid ${n.border}`,backgroundColor:e?n.primary:n.card,display:"flex",alignItems:"center",justifyContent:"center"},children:e&&t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:n.btnText,strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:t.jsx("polyline",{points:"20 6 9 17 4 12"})})}),nr=({plan:e,pwycAmounts:r,setPwycAmounts:i,cx:o,formatPrice:c,onAmountChanged:l})=>{var ze,br;const h=(br=(ze=r[e.id])!=null?ze:r[String(e.id)])!=null?br:Ge(e),[f,E]=a.useState(h!=null?(h/100).toFixed(2):""),[H,V]=a.useState(null),ot=qe=>{const xt=parseFloat(qe);if(isNaN(xt)||xt<0){const Re=Ge(e);E(Re!=null?(Re/100).toFixed(2):"");const _n=r[e.id];i(Sn=>({...Sn,[e.id]:Re})),V(null),Re!==_n&&l&&l();return}let be=Math.round(xt*100);e.pwyc_min>0&&be<e.pwyc_min&&(be=e.pwyc_min),e.pwyc_max>0&&be>e.pwyc_max&&(be=e.pwyc_max),V(null),E((be/100).toFixed(2));const bn=r[e.id];i(Re=>
1({...Re,[e.id]:be})),be!==bn&&l&&l()};return t.jsxs("div",{style:{marginTop:10},onClick:qe=>qe.stopPropagation(),children:[t.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",border:`1px solid ${H?o.errorText:o.border}`,borderRadius:8,overflow:"hidden",backgroundColor:o.card,width:120},children:[t.jsx("span",{style:{padding:"8px 0 8px 10px",color:o.textMuted,fontSize:14},children:{usd:"$",eur:"â¬",gbp:"£",cad:"CA$",aud:"A$",sek:"kr",chf:"CHF",brl:"R$",mxn:"MX$",inr:"â¹",pln:"zÅ",nzd:"NZ$"}[(e.currency||"usd").toLowerCase()]||"$"}),t.jsx("input",{type:"text",inputMode:"decimal",value:f,onChange:qe=>{E(qe.target.value),V(null)},onBlur:()=>ot(f),style:{flex:1,padding:"8px 10px 8px 4px",border:"none",outline:"none",fontSize:14,color:o.text,backgroundColor:"transparent",width:"100%"}})]}),t.jsxs("span",{style:{fontSize:12,color:o.textSecondary},children:[(e.pwyc_min>0||e.pwyc_max>0)&&t.jsx(t.Fragment,{children:e.pwyc_min>0&&e.pwyc_max>0?`${c(e.pwyc_min,e.currency)} â ${c(e.pwyc_max,e.currency)}`:e.pwyc_min>0?`min ${c(e.pwyc_min,e.currency)}`:`max ${c(e.pwyc_max,e.currency)}`}),(e.pwyc_min>0||e.pwyc_max>0)&&e.pwyc_default>0&&" · ",e.pwyc_default>0&&t.jsxs(t.Fragment,{children:[t.jsx("span",{style:{textTransform:"uppercase",fontSize:10,fontWeight:600,letterSpacing:.5},children:"suggested"})," ",c(e.pwyc_default,e.currency)]})]})]}),H&&t.jsx("div",{style:{fontSize:12,color:o.errorText,marginTop:4},children:H})]})},fn=e=>{const r=p.includes(e.id),i=e.prerequisite_met===!1,o=e.at_capacity===!0,c=i||o;return t.jsxs("div",{onClick:()=>!c&&Xr(e.id),style:{display:"flex",alignItems:"flex-start",gap:12,padding:16,borderRadius:10,cursor:c?"not-allowed":"pointer",transition:"all 0.15s",border:r?`2px solid ${n.primary}`:`1px solid ${n.border}`,backgroundColor:r?n.primaryLight:n.card,opacity:c?.6:1},children:[Wt?t.jsx("div",{style:{marginTop:2},children:t.jsx(mn,{checked:r})}):t.jsx("div",{style:{marginTop:2},children:t.jsx(gn,{selected:r})}),t.jsxs("div",{style:{flex:1,minWidth:0},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flexWrap:"wrap"},children:[t.jsx("span",{style:{fontSize:16,fontWeight:600,color:n.text},children:e.name}),e.recommended&&!o&&t.jsx("span",{style:{display:"inline-flex",alignItems:"center",padding:"2px 10px",fontSize:12,fontWeight:500,borderRadius:99,backgroundColor:n.greenLight,color:n.green,border:`1px solid ${n.greenBorder}`},children:"Recommended"}),o&&t.jsx("span",{style:{display:"inline-flex",alignItems:"center",padding:"2px 10px",fontSize:12,fontWeight:600,borderRadius:99,backgroundColor:$?"rgba(255,255,255,0.1)":n.borderLight,color:n.textMuted},children:"Sold out"})]}),e.short_description&&t.jsx("div",{style:{fontSize:16,color:n.textSecondary,marginTop:2,lineHeight:1.5},children:Ze(e.short_description)}),e.pwyc_enabled?!r&&t.jsx("div",{style:{marginTop:8},children:t.jsx("span",{style:{fontSize:18,fontWeight:700,color:n.text},children:"Pay What You Can"})}):t.jsxs("div",{style:{marginTop:8},children:[t.jsx("span",{style:{fontSize:18,fontWeight:700,color:n.text},children:e.amount===0?"Free":W(e.amount,e.currency)}),e.frequency!=="once"&&t.jsxs("span",{style:{fontSize:14,fontWeight:400,color:n.textSecondary},children:[" ",We(e.frequency)]}),e.has_trial&&t.jsxs("span",{style:{fontSize:13,fontWeight:400,color:n.green},children:[" · ",e.trial_period_days,"-day free trial"]})]}),i&&t.jsxs("div",{style:{fontSize:12,color:n.errorText,marginTop:6,display:"flex",alignItems:"center",gap:4},children:[t.jsx(Un,{icon:jn.faLock,size:"xs"})," Prerequisites required"]}),r&&e.pwyc_enabled&&t.jsx(nr,{plan:e,pwycAmounts:_,setPwycAmounts:U,cx:n,formatPrice:W,onAmountChanged:Ht})]})]},e.id)},or=()=>{if(D.length===0)return null;const e=Xe();return t.jsx("div",{style:{padding:16,borderRadius:8,backgroundColor:n.borderLight,marginBottom:16},children:D.map((r,i)=>{const o=we(r);return t.jsxs("div",{style:{marginTop:i>0?10:0},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:16,fontSize:14,color:n.text},children:[t.jsx("span",{style:{fontWeight:500},children:r.name}),t.jsxs("span",{style:{fontWeight:600,fontSize:15},children:[W(o,r.currency),r.frequency!=="once"&&t.jsx("span",{style:{fontSize:12,fontWeight:500,marginLeft:2},children:We(r.frequency)}),e&&t.jsx("span",{style:{fontSize:12,fontWeight:500,color:n.textSecondary,marginLeft:4},children:at(r.currency)})]})]}),r.has_trial&&t.jsxs("div",{style:{fontSize:12,color:n.green,marginTop:4,display:"flex",alignItems:"flex-start",ga
1p:4},children:[t.jsx("span",{style:{flexShrink:0,marginTop:1},children:t.jsx(Te,{})}),t.jsxs("span",{children:[r.trial_period_days,"-day free trial included"]})]})]},r.id)})})},de={label:{color:n.text,fontSize:14,fontWeight:500,marginBottom:6},input:{height:44,fontSize:16,borderRadius:8,padding:"0 12px",transition:"border-color 0.15s ease, box-shadow 0.15s ease",backgroundColor:n.card,borderColor:n.border,color:n.text,"--checkout-input-placeholder":n.textMuted,"--checkout-input-focus-color":n.primary}},xe={input:Me.authInput},mt=()=>{const e=new URLSearchParams({mode:"forgot",intent:"checkout",return_to:qt()});s!=null&&s.slug&&e.set("s",s.slug),v.trim()&&e.set("email",v.trim());const r=`/user/auth?${e.toString()}`,i={email:"Enter your email to get started",login:"Welcome back",register:"Create your account"};return t.jsxs("div",{children:[t.jsx("div",{style:{fontSize:16,fontWeight:600,color:n.text,marginBottom:16},children:i[oe]}),!ve&&or(),At&&t.jsx("div",{style:{padding:"8px 12px",borderRadius:8,marginBottom:12,backgroundColor:n.errorBg,border:`1px solid ${n.errorBorder}`,fontSize:13,color:n.errorText},children:At}),t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:14,marginBottom:20},children:[t.jsx(ue,{label:"Email address",placeholder:"[email protected]",value:v,onChange:o=>{Dr(o.currentTarget.value),Ie(c=>({...c,email:void 0}))},error:$t.email,onKeyDown:o=>{o.key==="Enter"&&(o.preventDefault(),oe==="email"?Xt():oe==="login"?ut():pt())},size:"md",classNames:xe,styles:de}),oe==="login"&&t.jsx(t.Fragment,{children:t.jsx(ue,{label:t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",width:"100%"},children:[t.jsx("span",{children:"Password"}),t.jsx("a",{href:r,onClick:o=>{o.preventDefault(),X("forgot",v)},tabIndex:-1,style:{fontSize:12,fontWeight:400,color:n.textSecondary,textDecoration:"none"},children:"Forgot your password?"})]}),placeholder:"Your password",type:"password",value:se,onChange:o=>He(o.currentTarget.value),onKeyDown:o=>{o.key==="Enter"&&(o.preventDefault(),ut())},size:"md",autoFocus:!0,classNames:xe,styles:{...de,label:{...de.label,width:"100%"}}})}),oe==="register"&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{style:{display:"flex",gap:8},children:[t.jsx(ue,{label:"First name",placeholder:"First name",value:Oe,onChange:o=>Er(o.currentTarget.value),size:"md",autoFocus:!0,style:{flex:1},classNames:xe,styles:de}),t.jsx(ue,{label:"Last name",placeholder:"Last name",value:Ye,onChange:o=>qr(o.currentTarget.value),size:"md",style:{flex:1},classNames:xe,styles:de})]}),t.jsx(ue,{label:"Username",placeholder:"Choose a username",value:Le,onChange:o=>{Mr(o.currentTarget.value),Ie(c=>({...c,username:void 0}))},error:$t.username,size:"md",classNames:xe,styles:de}),t.jsx(ue,{label:"Password",placeholder:"Create a password",type:"password",value:se,onChange:o=>He(o.currentTarget.value),onKeyDown:o=>{o.key==="Enter"&&(o.preventDefault(),pt())},size:"md",classNames:xe,styles:de})]})]}),oe==="email"&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[t.jsx(K,{fullWidth:!0,size:"md",loading:st,onClick:Xt,disabled:!v.trim(),style:{backgroundColor:n.primary,color:n.btnText,borderRadius:8,height:44,fontSize:15,fontWeight:600},children:"Continue"}),t.jsxs("p",{style:{margin:"6px 0 0",fontSize:14,color:n.textSecondary,textAlign:"center"},children:["Already registered?"," ",t.jsx("span",{style:{color:n.link,cursor:"pointer",fontWeight:500},onClick:()=>{if(ee()){X("sign_in",v);return}Pe("login"),Z(null)},children:"Log in"})]})]}),oe==="login"&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[t.jsx(K,{fullWidth:!0,size:"md",loading:st,onClick:ut,disabled:!v.trim()||!se,style:{backgroundColor:n.primary,color:n.btnText,borderRadius:8,height:44,fontSize:15,fontWeight:600},children:"Log in"}),t.jsxs("p",{style:{margin:"6px 0 0",fontSize:14,color:n.textSecondary,textAlign:"center"},children:["Don't have an account?"," ",t.jsx("span",{style:{color:n.link,cursor:"pointer",fontWeight:500},onClick:()=>{if(ee()){X("sign_up",v);return}Pe("register"),Z(null),He("")},children:"Create one"})]})]}),oe==="register"&&t.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[t.jsx(K,{fullWidth:!0,size:"md",loading:st,onClick:pt,disabled:!v.trim()||!se||!Oe.trim()||!Ye.trim()||!Le.trim(),style:{backgroundColor:n.primary,color:n.btnText,borderRadius:8,height:44,fontSize:15,fontWeight:600},children:"Create account"}),t.jsxs("p",{style:{margin:"6px 0 0",fontSize:14,color:n.textSecondary,textAlign:"center"},children:["Already registered?"," ",t.jsx("span",{style:{color:n.link,cursor:"pointer",fontWeight:500},onClick:()=>
1{if(ee()){X("sign_in",v);return}Pe("login"),Z(null),He("")},children:"Log in"})]})]})]})},yn=()=>t.jsxs("div",{children:[t.jsx("div",{style:{fontSize:16,fontWeight:600,color:n.text,marginBottom:16},children:"Order summary"}),D.length===0?t.jsx("div",{style:{fontSize:13,color:n.textMuted},children:"Select a plan to continue"}):t.jsxs("div",{children:[t.jsxs("div",{style:{padding:16,borderRadius:8,backgroundColor:n.borderLight,marginBottom:16},children:[(()=>{const e=Xe();return D.map((r,i)=>{const o=we(r);return t.jsxs("div",{style:{marginTop:i>0?10:0},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:16,fontSize:14,color:n.text},children:[t.jsx("span",{style:{fontWeight:500},children:r.name}),t.jsxs("span",{style:{fontWeight:600,fontSize:15},children:[W(o,r.currency),r.frequency!=="once"&&t.jsx("span",{style:{fontSize:12,fontWeight:500,marginLeft:2},children:We(r.frequency)}),e&&t.jsx("span",{style:{fontSize:12,fontWeight:500,color:n.textSecondary,marginLeft:4},children:at(r.currency)})]})]}),r.has_trial&&t.jsxs("div",{style:{fontSize:12,color:n.green,marginTop:4,display:"flex",alignItems:"flex-start",gap:4},children:[t.jsx("span",{style:{flexShrink:0,marginTop:1},children:t.jsx(Te,{})}),t.jsxs("span",{children:["Free trial included · first charge in ",r.trial_period_days," days"]})]})]},r.id)})})(),d&&(()=>{const e=(d.applicable_space_plan_ids||[]).some(i=>D.some(o=>o.id===i)),r=nn(D);return t.jsxs("div",{style:{marginTop:8,paddingTop:8,borderTop:`1px solid ${n.border}`},children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:12,color:e?n.green:n.textMuted,fontWeight:500},children:[t.jsxs("span",{style:{display:"flex",alignItems:"center",gap:4},children:["Coupon ",d.code,t.jsx("span",{onClick:tn,style:{color:n.textMuted,cursor:"pointer",fontSize:14,lineHeight:1},children:"Ã"})]}),e&&r&&t.jsxs("span",{children:["-",r]})]}),!e&&t.jsx("div",{style:{fontSize:11,color:n.textMuted,marginTop:4},children:"Coupon doesn't apply to the selected plan"})]})})(),(()=>{var i;const e=Xe(),r=e?rn():null;return e?t.jsxs("div",{style:{marginTop:8,paddingTop:8,borderTop:`1px solid ${n.border}`},children:[t.jsx("div",{style:{fontSize:14,fontWeight:600,color:n.text,marginBottom:4},children:"Due today"}),Object.entries(r).map(([o,c])=>t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:14,fontWeight:600,color:n.text},children:[t.jsx("span",{style:{fontWeight:400,color:n.textSecondary},children:at(o)}),t.jsx("span",{style:{fontSize:16},children:W(c,o)})]},o))]}):t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginTop:8,paddingTop:8,borderTop:`1px solid ${n.border}`,fontSize:14,fontWeight:600,color:n.text},children:[t.jsx("span",{children:"Due today"}),t.jsx("span",{style:{fontSize:16},children:W(lt(),((i=D[0])==null?void 0:i.currency)||"usd")})]})})()]}),!d&&t.jsx("div",{style:{marginBottom:16},children:t.jsxs("div",{style:{display:"flex",gap:8,alignItems:"flex-start"},children:[t.jsx(ue,{size:"md",placeholder:"Coupon code",value:B,onChange:e=>{Je(),G.current=!0,L(!1),!e.currentTarget.value.trim()&&!b&&Be(),J(e.currentTarget.value)},style:{flex:1},error:te,classNames:{input:Me.couponInput},styles:{input:{height:44,fontSize:16,borderRadius:6,backgroundColor:n.card,borderColor:n.border,color:n.text,"--checkout-coupon-placeholder":$?le(n.text,.4):ht(n.card,.35),"--checkout-input-focus-color":n.primary,"--checkout-error-color":n.errorText},error:{color:n.errorText}}}),t.jsx(K,{size:"md",variant:"default",onClick:()=>Kt(),disabled:!B||p.length===0,style:{height:44,borderRadius:6,fontSize:16,paddingLeft:20,paddingRight:20,backgroundColor:$?le(n.card,.1):ht(n.card,.06),color:n.text,borderColor:n.border},children:"Apply"})]})}),wt.length>0&&t.jsx("div",{style:{marginBottom:16,padding:"10px 12px",borderRadius:8,backgroundColor:$?"rgba(245, 158, 11, 0.12)":"#FFFBEB",border:`1px solid ${$?"rgba(245, 158, 11, 0.25)":"#FDE68A"}`,color:$?"#FCD34D":"#92400E",fontSize:13,lineHeight:1.5},children:wt.map(e=>{const r=e.reason==="plan_restricted"?"restricted to other plans":e.reason==="currency_not_supported"?`does not support ${e.plan_currency.toUpperCase()}`:e.reason==="invalid_amount"?e.message||"amount is outside the allowed range":"is no longer valid";return t.jsxs("div",{children:[e.space_plan_name,": ",r]},e.space_plan_id)})}),!R&&Y&&t.jsx("div",{style:{marginBottom:12,display:"flex",flexDirection:"column",gap:10},children:t.jsx(ue,{label:"Email address",placeholder:"[email protected]",value:O,onChange:e=>Pr(e.currentTarget.value),required:!0,size:"md",classNames:xe,styles:de})}),m.resumeError&&t.jsx(jr,{size:"sm",c:"dimmed",children:m.resumeError}),p.length>0&&!z&&S&&t.jsx(_r,{py:"md",children:t.jsx(Sr,{size:"sm",color:n.primary})}),p.length>0&&!z&&!S&&!R&&Y&&t.jsx(t.Fragment,{children:ce&&t.jsx("div",{style:{marginBottom:12},children:nt()})}),k&&!(z&&z.type!=="free"&&Ue)&&t.jsxs("div",{style:{padding:"10px 14px",borderRadius:8,marginBottom:12,backgroundColor:n.errorBg,border:`1px solid ${n.errorBorder}`,color:n.errorText,fontSize:14,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[t.jsxs("span",{children:[k,je&&R&&t.jsxs(t.Fragment,{children:[" ",t.jsx(kr,{component:"button",type:"button",onClick:()=>q("/settings/paid_subscriptions"),style:{color:"inherit",textDecoration:"underline",fontSize:14},children:"Manage your subscriptions"})]})]}),t.jsx("button",{onClick:()=>w(null),style:{background:"none",border:"none",color:n.errorText,cursor:"pointer",fontSize:18,lineHeight:1,padding:"0 0 0 12px"},children:"Ã"})]}),p.length>0&&!z&&!S&&!R&&Y&&t.jsx(K,{fullWidth:!0,size:"md",onClick:()=>Ot({showError:!0}),disabled:Qe||!O||ce&&!Ke,style:{backgroundColor:n.primary,color:n.btnText,borderRadius:8,height:44,fontSize:15,fontWeight:600},children:dt()}),z&&z.type==="free"&&ce&&t.jsx("div",{style:{marginBottom:12},children:nt()}),z&&z.type==="free"&&t.jsx(K,{fullWidth:!0,size:"md",onClick:()=>
1{if(ce&&!Ke){w("Please accept the terms to continue.");return}en()},loading:S,style:{backgroundColor:n.primary,color:n.btnText,borderRadius:8,height:44,fontSize:15,fontWeight:600},children:"Join for free"}),z&&z.type!=="free"&&Ue&&t.jsx(qn,{stripe:Ue,options:{clientSecret:z.client_secret,appearance:{theme:$?"night":"stripe",variables:{colorPrimary:n.primary,borderRadius:"8px",fontSizeBase:"16px",colorBackground:n.card,colorText:n.text,colorTextSecondary:n.textSecondary},rules:{".Tab":{border:"none",boxShadow:"none"},".TabIcon":{display:"none"},".Label":{fontWeight:"500",fontSize:"14px",marginBottom:"6px"},".Input":{borderColor:n.border},".Error":{color:n.errorText}}}},children:t.jsx(so,{intentType:z.type,walletBilling:z.wallet_billing,onConfirmed:Vr,onPaymentSubmit:()=>_e("Payment Info Entered",ye({intent_type:z.type})),onPaymentError:e=>_e("Checkout Failed",ye({stage:"payment",error_code:e==null?void 0:e.code,decline_code:e==null?void 0:e.decline_code,error_type:e==null?void 0:e.type,error:e==null?void 0:e.message})),processing:S,buttonText:dt(),primaryColor:n.primary,buttonTextColor:n.btnText,validateBeforeSubmit:on,parentError:k,onClearParentError:()=>w(null),errorText:n.errorText,errorBg:n.errorBg,errorBorder:n.errorBorder,taxCollection:Yr,termsRequired:ce,termsAccepted:Ke,termsCheckbox:ce?nt():null})}),D.length>0&&t.jsx("p",{style:{margin:"16px 0 0",fontSize:14,color:n.textSecondary,textAlign:"center",lineHeight:1.5},children:(()=>{const e=D.filter(l=>l.frequency!=="once");if(e.length===0)return"Secure payment processed by Stripe.";const r=l=>{const h=we(l);return!d||d.frequency!=="forever"?h:Gt(l)},i={};e.forEach(l=>{const h=(l.currency||"usd").toLowerCase(),f=`${h}|${l.frequency}`;i[f]||(i[f]={currency:h,frequency:l.frequency,total:0}),i[f].total+=r(l)});const o=Object.values(i).map(l=>`${W(l.total,l.currency)}${We(l.frequency)}`).join(" + ");return e.every(l=>l.has_trial)?`After your free trial, you'll be charged ${o}. Cancel anytime.`:`You'll be charged ${o}. Cancel anytime.`})()}),!R&&Y&&t.jsxs(t.Fragment,{children:[t.jsx("div",{style:{height:1,backgroundColor:n.border,margin:"16px 0"}}),t.jsxs("p",{style:{margin:0,fontSize:13,color:n.textSecondary,textAlign:"center"},children:["Already have an account?"," ",t.jsx("button",{type:"button",onClick:()=>{if(ee()){X("sign_in");return}it(!0)},style:{color:n.link,fontWeight:500,textDecoration:"none",background:"none",border:"none",cursor:"pointer",padding:0,font:"inherit"},children:"Sign in"})]})]})]})]}),ft=()=>t.jsxs("div",{style:{backgroundColor:n.card,borderRadius:12,border:`1px solid ${n.border}`,padding:24},children:[or(),ce&&t.jsx("div",{style:{marginBottom:12},children:nt()}),t.jsx(K,{fullWidth:!0,size:"md",onClick:()=>{Mn.fire({title:"Preview mode",text:"This is a preview of your checkout page. A new visitor would enter their payment details and complete their purchase here.",icon:"info",confirmButtonColor:n.primary})},style:{backgroundColor:n.primary,color:n.btnText,borderRadius:8,height:44,fontSize:15,fontWeight:600},children:dt()}),t.jsx("p",{style:{margin:"16px 0 0",fontSize:13,color:n.textSecondary,textAlign:"center",lineHeight:1.5},children:"Payment form hidden in preview mode."})]}),xn=()=>R?t.jsxs("div",{children:[t.jsxs("div",{style:{padding:16,borderRadius:10,marginBottom:16,border:`2px solid ${n.green}`,backgroundColor:n.greenLight},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:4},children:[t.jsx(Te,{}),t.jsx("span",{style:{fontSize:16,fontWeight:600,color:n.text},children:"Free Access"})]}),t.jsx("p",{style:{margin:0,fontSize:13,color:n.textSecondary},children:"You've been invited to join this space for free."})]}),k&&t.jsx("div",{style:{padding:"8px 12px",borderRadius:8,marginBottom:12,backgroundColor:n.errorBg,border:`1px solid ${n.errorBorder}`,fontSize:13,color:n.errorText},children:k}),t.jsx(K,{fullWidth:!0,size:"md",onClick:er,loading:S,style:{backgroundColor:n.primary,color:n.btnText,borderRadius:8,height:44,fontSize:15,fontWeight:600},children:"Join for free"})]}):mt(),yt=()=>t.jsxs(t.Fragment,{children:[t.jsx("div",{style:{backgroundColor:n.card,borderRadius:12,border:`1px solid ${n.border}`,padding:24},children:b?null:D.every(e=>e.at_capacity)&&D.length>0?t.jsxs("div",{style:{textAlign:"center",padding:"20px 0"},children:[t.jsx("div",{style:{display:"inline-flex",alignItems:"center",gap:6,padding:"6px 16px",fontSize:14,fontWeight:600,color:n.textMuted,borderRadius:99,backgroundColor:$?"rgba(255,255,255,0.1)":n.borderLight,marginBottom:8},children:"Sold out"}),t.jsx("p",{style:{fontSize:13,color:n.textSecondary,margin:"8px 0 0"},children:"This plan is currently at capacity. Please check back later."})]}):ve?xn():!R&&!Y?mt():yn()}),R&&y.email&&!b&&t.jsxs("div",{style:{textAlign:"center",marginTop:16,fontSize:11,color:n.pageText,opacity:.7,lineHeight:1.4},children:["Logged in as ",y.email," â¢"," ",t.jsx("span",{onClick:async()=>{var e,r;try{await Promise.race([(e=window.$api)==null?void 0:e.post("/api/v4/auth/sign_out_user.json"),new Promise(i=>setTimeout(i,3e3))])}catch{return}Lt(),C(St({})),(r=Bt.current)==null||r.scrollTo({top:0,behavior:"smooth"})},style:{cursor:"pointer",textDecoration:"underline"},children:"Logout"})]})]});return t.jsxs("div",{ref:Bt,style:{backgroundColor:n.bg,minHeight:"100vh",overflow:"auto",height:"100vh"},children:[t.jsx(Xn,{opened:Ur,onClose:()=>it(!1),spaceSlug:s==null?void 0:s.slug,spaceName:s==null?void 0:s.name,onAuthSuccess:()=>
1it(!1),colors:u,analyticsChannel:"checkout"}),ce&&t.jsx(vn,{opened:Or,onClose:()=>It(!1),title:Dt,size:"lg",centered:!0,radius:16,classNames:{close:Me.modalClose},styles:{content:{backgroundColor:n.card,border:`1px solid ${n.border}`},title:{fontWeight:600,fontSize:18,color:n.text},close:{color:n.textMuted,"--checkout-close-hover":n.borderLight},overlay:{backgroundColor:"rgba(0,0,0,0.5)"}},children:t.jsx("div",{style:{maxHeight:"60vh",overflowY:"auto",paddingRight:12,fontSize:14,lineHeight:1.7,color:n.text},className:"tiptap-terms-display",dangerouslySetInnerHTML:{__html:Kr}})}),b&&t.jsxs("div",{style:{padding:"14px 10px",backgroundColor:"#FEF9C3",borderBottom:"1px solid #FDE68A",fontSize:14,fontWeight:500,color:"#92400E",textAlign:"center"},children:["Preview mode â this is what your participants will see."," ",t.jsx("a",{href:En("main",{space:s.slug,ret:s.slug}),style:{color:"#92400E",fontWeight:600,textDecoration:"underline"},children:"Return to settings"})]}),!b&&R&&((ur=s==null?void 0:s.permissions)==null?void 0:ur.is_member)&&t.jsx(Jn,{spaceId:s.slug,isMember:s.permissions.is_member}),Tt&&_t()&&t.jsx(Zn,{invitation:Tt,spaceId:s.slug,isMember:(pr=s.permissions)==null?void 0:pr.is_member,isFull:(hr=s.permissions)==null?void 0:hr.is_full,hideButton:!0}),t.jsx("div",{style:{maxWidth:900,margin:"0 auto",padding:"40px 20px"},children:ve?t.jsxs("div",{style:{maxWidth:480,margin:"40px auto 0"},children:[t.jsxs("div",{style:{textAlign:"center",marginBottom:24},children:[t.jsx("h2",{style:{margin:0,fontSize:28,fontWeight:700,color:n.pageText},children:s.intention||s.name}),gt("8px 0 0")]}),t.jsxs("div",{style:{backgroundColor:n.card,borderRadius:12,border:`1px solid ${n.border}`,padding:32},children:[t.jsxs("div",{style:{padding:16,borderRadius:10,marginBottom:20,border:`1px solid ${n.greenBorder}`,backgroundColor:n.greenLight,textAlign:"center"},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:8,marginBottom:4},children:[t.jsx("span",{style:{color:n.green},children:t.jsx(Te,{})}),t.jsx("span",{style:{fontSize:18,fontWeight:600,color:n.text},children:"Free Access"})]}),t.jsx("p",{style:{margin:0,fontSize:14,color:n.textSecondary},children:"You've been invited to join this space for free."})]}),R?t.jsxs(t.Fragment,{children:[k&&t.jsx("div",{style:{padding:"8px 12px",borderRadius:8,marginBottom:12,backgroundColor:n.errorBg,border:`1px solid ${n.errorBorder}`,fontSize:13,color:n.errorText},children:k}),t.jsx(K,{fullWidth:!0,size:"md",onClick:er,loading:S,style:{backgroundColor:n.primary,color:n.btnText,borderRadius:8,height:48,fontSize:16,fontWeight:600},children:"Join for free"})]}):t.jsx(t.Fragment,{children:mt()})]}),R&&y.email&&t.jsxs("div",{style:{textAlign:"center",marginTop:16,fontSize:11,color:n.pageText,opacity:.7,lineHeight:1.4},children:["Logged in as ",y.email," â¢"," ",t.jsx("span",{onClick:async()=>{var e;try{await Promise.race([(e=window.$api)==null?void 0:e.post("/api/v4/auth/sign_out_user.json"),new Promise(r=>setTimeout(r,3e3))])}catch{return}Lt(),C(St({}))},style:{cursor:"pointer",textDecoration:"underline"},children:"Logout"})]})]}):x.length===0?t.jsxs("div",{style:{display:"flex",gap:32,alignItems:"flex-start",flexWrap:"wrap"},children:[t.jsxs("div",{style:{flex:1,minWidth:300},children:[t.jsx("div",{style:{marginBottom:20},children:t.jsx("h2",{style:{margin:0,fontSize:28,fontWeight:700,color:n.pageText},children:s.intention||s.name})}),t.jsx("div",{style:{padding:24,borderRadius:10,backgroundColor:n.card,border:`1px solid ${n.border}`},children:t.jsx("p",{style:{margin:0,fontSize:15,color:n.textSecondary,lineHeight:1.5},children:"This space has not set up any payment plans yet."})})]}),t.jsx("div",{style:{width:340,flexShrink:0,alignSelf:"stretch"},children:b?ft():yt()})]}):sn&&g?t.jsxs("div",{style:{display:"flex",gap:32,alignItems:"flex-start",flexWrap:"wrap"},children:[t.jsxs("div",{style:{flex:1,minWidth:300},children:[t.jsxs("div",{style:{marginBottom:20},children:[t.jsx("h2",{style:{margin:0,fontSize:28,fontWeight:700,color:n.pageText},children:s.intention||s.name}),gt()]}),t.jsxs("div",{style:{padding:16,borderRadius:10,marginBottom:20,border:`2px solid ${g.at_capacity?n.border:n.primary}`,backgroundColor:g.at_capacity?n.card:n.primaryLight,opacity:g.at_capacity?.7:1},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[t.jsx("span",{style:{fontSize:16,fontWeight:600,color:n.text},children:g.name}),g.at_capacity&&t.jsx("span",{style:{display:"inline-flex",alignItems:"center",padding:"2px 10px",fontSize:12,fontWeight:600,borderRadius:99,backgroundColor:$?"rgba(255,255,255,0.1)":n.borderLight,color:n.textMuted},children:"Sold out"}),!g.at_capacity&&g.recommended&&t.jsx("span",{style:{display:"inline-flex",alignItems:"center",padding:"2px 10px",fontSize:12,fontWeight:500,borderRadius:99,backgroundColor:n.greenLight,color:n.green,border:`1px solid ${n.greenBorder}`},children:"Recommended"})]}),g.short_description&&t.jsx("div",{style:{fontSize:16,color:n.textSecondary,marginTop:2,lineHeight:1.5},children:Ze(g.short_description)}),g.pwyc_enabled?t.jsxs(t.Fragment,{children:[t.jsx("div",{style:{fontSize:18,fontWeight:700,color:n.text,marginTop:8},children:"Pay What You Can"}),t.jsx(nr,{plan:g,pwycAmounts:_,setPwycAmounts:U,cx:n,formatPrice:W,onAmountChanged:Ht})]}):t.jsxs("div",{style:{fontSize:18,fontWeight:700,color:n.text,marginTop:8},children:[g.amount===0?"Free":W(g.amount,g.currency),g.frequency!=="once"&&t.jsxs("span",{style:{fontSize:14,fontWeight:400,color:n.textSecondary},children:[" ",We(g.frequency)]}),g.has_trial&&t.jsxs("span",{style:{fontSize:13,fontWeight:400,color:n.green},children:[" · ",g.trial_period_days,"-day free trial"]})]})]}),(((gr=g.features)==null?void 0:gr.length)>0||g.long_description)&&t.jsxs("div",{style:{padding:20,borderRadius:10,backgroundColor:n.card,border:`1px solid ${n.border}`},children:[((mr=g.features)==null?void 0:mr.length)>0&&t.jsxs(t.Fragment,{children:[t.jsx("div",{style:{fontSize:12,fontWeight:600,color:n.primary,textTransform:"uppercase",letterSpacing:.5,marginBottom:10},children:"What's included"}),t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:6},children:g.features.map((e,r)=>
1t.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:8,fontSize:16,color:n.textSecondary},children:[t.jsx("span",{style:{color:n.green,flexShrink:0},children:t.jsx(Te,{})})," ",e]},r))})]}),g.long_description&&t.jsx("p",{style:{margin:((fr=g.features)==null?void 0:fr.length)>0?"12px 0 0":0,fontSize:16,color:n.textSecondary,lineHeight:1.6,borderTop:((yr=g.features)==null?void 0:yr.length)>0?`1px solid ${n.border}`:"none",paddingTop:((xr=g.features)==null?void 0:xr.length)>0?12:0},children:Ze(g.long_description)})]})]}),t.jsx("div",{style:{width:340,flexShrink:0,alignSelf:"stretch"},children:b?ft():yt()})]}):t.jsx("div",{children:t.jsxs("div",{style:{display:"flex",gap:32,alignItems:"flex-start",flexWrap:"wrap"},children:[t.jsxs("div",{style:{flex:1,minWidth:300},children:[t.jsxs("div",{style:{marginBottom:20},children:[t.jsx("h2",{style:{margin:0,fontSize:28,fontWeight:700,color:n.pageText},children:s.intention||s.name}),gt()]}),t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:10},children:x.map(e=>fn(e))}),D.length>0&&t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:16,marginTop:20},children:D.map(e=>{var r,i,o,c,l;return(((r=e.features)==null?void 0:r.length)>0||e.long_description)&&t.jsxs("div",{style:{padding:20,borderRadius:10,backgroundColor:n.card,border:`1px solid ${n.border}`},children:[t.jsx("div",{style:{fontSize:12,fontWeight:600,color:n.primary,textTransform:"uppercase",letterSpacing:.5,marginBottom:10},children:e.name}),((i=e.features)==null?void 0:i.length)>0&&t.jsx("div",{style:{display:"flex",flexDirection:"column",gap:6},children:e.features.map((h,f)=>t.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:8,fontSize:16,color:n.textSecondary},children:[t.jsx("span",{style:{color:n.green,flexShrink:0},children:t.jsx(Te,{})})," ",h]},f))}),e.long_description&&t.jsx("p",{style:{margin:((o=e.features)==null?void 0:o.length)>0?"12px 0 0":0,fontSize:16,color:n.textSecondary,lineHeight:1.6,borderTop:((c=e.features)==null?void 0:c.length)>0?`1px solid ${n.border}`:"none",paddingTop:((l=e.features)==null?void 0:l.length)>0?12:0},children:Ze(e.long_description)})]},e.id)})})]}),t.jsx("div",{style:{width:340,flexShrink:0,alignSelf:"stretch"},children:b?ft():yt()})]})})})]})};function cs(){const s=Fn();return t.jsx(go,{},s.key)}export{cs 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.