1import{j as e,b as Q,u as Re,c as ke}from"./query-Q_ThwKGI.js";import{r as N,R as ze,u as De,i as Be}from"./react-vendor-wefok28f.js";import{s as M}from"./client-DjLwxtrO.js";import{B as g}from"./button-DrepnwkX.js";import{e as Me,s as ie,A as ne,o as oe,f as de,p as H,v as ce,S as Ue,D as Oe,C as Le,w as Ee,z as Ve,n as He,R as qe,q as Ke,c as $e,u as We}from"./index-C4Kq7kkR.js";import{T as me,a as ue,b as q,c as K}from"./tabs-CMLwnORc.js";import{S as Y}from"./scroll-area-D3rGvhtF.js";import{C as he,b as xe,c as pe,d as Ge,a as Qe}from"./card-DYyqUxY6.js";import{u as z}from"./useTranslation-DNoH3foE.js";import{X as J,_ as G,b0 as je,F as Ye,L as Je,ac as I,aa as _,b1 as Xe,ar as Ze,b2 as es,aP as ss,y as B,O as as,A as ts,al as ls}from"./icons-By8asZST.js";import{S as U}from"./switch-CnLyyNmH.js";import{D as rs,C as is,P as ns}from"./dnd.esm-C5CUyiL7.js";import{L as i}from"./label-Ch0F7L4t.js";import{I as o}from"./input-Cu6Tiemi.js";import{T}from"./textarea-DJfrjX2A.js";import{S as b,a as C,b as w,c as S,d as x}from"./select-DECm7gW5.js";import{h as os,R as ds,u as cs,F as ms}from"./index-DviHZN-M.js";import{F as ae,S as te}from"./index-D12SM9ia.js";import{R as us,a as le}from"./radio-group-CTqv7D_7.js";import{S as k}from"./separator-BOvWbUMa.js";import{C as O,a as L,b as E}from"./collapsible-l8V3raC7.js";import{T as hs}from"./TrackingSettings-0-C5O2gu.js";import{F as xs}from"./FooterLinksSettings-CwAjswvP.js";import{C as ps}from"./checkbox-Gmf95s3M.js";import{c as js}from"./utmUtils-B5TLLIZ-.js";import"./supabase-COHOFxoQ.js";import"./index-lwN0GFAE.js";import"./index-CryppvJw.js";import"./index-CSO0Tzy2.js";import"./tiny-invariant-BaFNuDhB.js";import"./index-Bdz2fkUq.js";const vs=({onSelect:s,onCancel:t})=>{const{t:r}=z("salesPages"),d=[{type:"hero",titleKey:"hero",descKey:"heroDesc"},{type:"authority",titleKey:"authority",descKey:"authorityDesc"},{type:"pain-desire",titleKey:"painDesire",descKey:"painDesireDesc"},{type:"target-audience",titleKey:"targetAudience",descKey:"targetAudienceDesc"},{type:"how-it-works",titleKey:"howItWorks",descKey:"howItWorksDesc"},{type:"deliverables",titleKey:"deliverables",descKey:"deliverablesDesc"},{type:"testimonials",titleKey:"testimonials",descKey:"testimonialsDesc"},{type:"objection",titleKey:"objection",descKey:"objectionDesc"},{type:"author",titleKey:"author",descKey:"authorDesc"},{type:"pricing",titleKey:"pricing",descKey:"pricingDesc"},{type:"full-width-banner",titleKey:"fullWidthBanner",descKey:"fullWidthBannerDesc"},{type:"argument",titleKey:"argument",descKey:"argumentDesc"},{type:"faq",titleKey:"faq",descKey:"faqDesc"},{type:"cta-button",titleKey:"ctaButton",descKey:"ctaButtonDesc"},{type:"upsell",titleKey:"upsell",descKey:"upsellDesc"},{type:"leads-flow-form",titleKey:"leadsFlowForm",descKey:"leadsFlowFormDesc"}],c=a=>{const l={id:`${a}-${Date.now()}`,type:a,enabled:!0,order:0};switch(a){case"hero":return{...l,type:"hero",headline:"Transform Your Life",subheadline:"Complete method to achieve your goals",ctaText:"GET STARTED NOW",ctaUrl:"",mediaType:"video",mediaUrl:"",showFeatures:!1,features:[]};case"authority":return{...l,type:"authority",logos:[]};case"pain-desire":return{...l,type:"pain-desire",headline:"Pain vs Desire",painTitle:"Problems:",painItems:[],desireTitle:"Solutions:",desireItems:[]};case"target-audience":return{...l,type:"target-audience",headline:"Who is this for?",profiles:[]};case"how-it-works":return{...l,type:"how-it-works",headline:"How it works",steps:[]};case"deliverables":return{...l,type:"deliverables",headline:"What you get",imageUrl:"",items:[]};case"testimonials":return{...l,type:"testimonials",headline:"Testimonials",testimonials:[{text:"Excellent!",name:"John Doe"}]};case"objection":return{...l,type:"objection",title:"Objection Killer",headline:"Does it work?",answer:"Yes! Because...",imageUrl:"",imagePosition:"right"};case"author":return{...l,type:"author",headline:"About the Author",photo:"",bio:""};case"pricing":return{...l,type:"pricing",title:"Qual é o valor do investimento?",items:[],question:"E quanto vai custar tudo isso?",finalValueText:"por apenas",finalValue:"12x R$103,11",cashPaymentText:"ou à vista por R$997",ctaText:"QUERO GARANTIR MINHA VAGA!",ctaUrl:"",buttonSize:"lg"};case"full-width-banner":return{...l,type:"full-width-banner",backgroundColor:"#10b981",subtitle:"Important Information",explanation:"This is where you provide critical details..."};case"argument":return{...l,type:"argument",argumentType:"news",headline:"Data proves it",explanation:"Detailed explanation..."};case"faq":return{...l,type:"faq",headline:"FAQ",questions:[{question:"How does it work?",answer:"It's simple..."}]};case"cta-button":return{...l,type:"cta-button",ctaText:"QUERO GARANTIR MINHA VAGA!",ctaUrl:"",buttonSize:"lg",showFeatures:!1,features:[]};case"upsell":return{...l,type:"upsell",headline:"Special Upsell Offer",subheadline:"Get more value now",explanation:"Here's why you should take advantage of this offer...",mediaType:"video",mediaUrl:""};case"leads-flow-form":return{...l,type:"leads-flow-form",formId:"",headline:"",subheadline:"",showMediaFromForm:!1,compactMode:!1};default:return l}};return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("h4",{className:"font-semibold",children:r("editor.blocks.selectBlock")}),e.jsx(g,{variant:"ghost",size:"sm",onClick:t,children:e.jsx(J,{className:"h-4 w-4"})})]}),e.jsx("div",{className:"grid gap-3",children:d.map(a=>e.jsx(he,{className:"cursor-pointer hover:border-primary transition-colors",onClick:()=>s(c(a.type)),children:e.jsxs(xe,{children:[e.jsx(pe,{className:"text-base",children:r(`editor.blocks.types.${a.titleKey}`)}),e.jsx(Ge,{className:"text-sm",children:r(`editor.blocks.types.${a.descKey}`)})]})},a.type))})]})};var X="Popover",[ve,Ma]=Me(X,[ie]),$=ie(),[gs,D]=ve(X),ge=s=>{const{__scopePopover:t,children:r,open:d,defaultOpen:c,onOpenChange:a,modal:l=!1}=s,n=$(t),m=N.useRef(null),[j,p]=N.useState(!1),[u=!1,h]=He({prop:d,defaultProp:c,onChange:a});return e.jsx(qe,{...n,children:e.jsx(gs,{scope:t,contentId:Ke(),triggerRef:m,open:u,onOpenChange:h,onOpenToggle:N.useCallback(()=>h(v=>!v),[h]),hasCustomAnchor:j,onCustomAnchorAdd:N.useCallback(()=>p(!0),[]),onCustomAnchorRemove:N.useCallback(()=>p(!1),[]),modal:l,children:r})})};ge.displayName=X;var fe="PopoverAnchor",fs=N.forwardRef((s,t)=>{const{__scopePopover:r,...d}=s,c=D(fe,r),a=$(r),{onCustomAnchorAdd:l,onCustomAnchorRemove:n}=c;return N.useEffect(()=>(l(),()=>n()),[l,n]),e.jsx(ne,{...a,...d,ref:t})});fs.displayName=fe;var Ne="PopoverTrigger",ye=N.forwardRef((s,t)=>{const{__scopePopover:r,...d}=s,c=D(Ne,r),a=$(r),l=oe(t,c.triggerRef),n=e.jsx(de.button,{type:"button","aria-haspopup":"dialog","aria-expanded":c.open,"aria-controls":c.contentId,"data-state":Te(c.open),...d,ref:l,onClick:H(s.onClick,c.onOpenToggle)});return c.hasCustomAnchor?n:e.jsx(ne,{asChild:!0,...a,children:n})});ye.displayName=Ne;var Z="PopoverPortal",[Ns,ys]=ve(Z,{forceMount:void 0}),be=s=>{const{__scopePopover:t,forceMount:r,children:d,container:c}=s,a=D(Z,t);return e.jsx(Ns,{scope:t,forceMount:r,children:e.jsx(ce,{present:r||a.open,children:e.jsx(Ve,{asChild:!0,container:c,children:d})})})};be.displayName=Z;var V="PopoverContent",Ce=N.forwardRef((s,t)=>{const r=ys(V,s.__scopePopover),{forceMount:d=r.forceMount,...c}=s,a=D(V,s.__scopePopover);return e.jsx(ce,{present:d||a.open,children:a.modal?e.jsx(bs,{...c,ref:t}):e.jsx(Cs,{...c,ref:t})})});Ce.displayName=V;var bs=N.forwardRef((s,t)=>{const r=D(V,s.__scopePopover),d=N.useRef(null),c=oe(t,d),a=N.useRef(!1);return N.useEffect(()=>{const l=d.current;if(l)return os(l)},[]),e.jsx(ds,{as:Ue,allowPinchZoom:!0,children:e.jsx(we,{...s,ref:c,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:H(s.onCloseAutoFocus,l=>{var n;l.preventDefault(),a.current||(n=r.triggerRef.current)==null||n.focus()}),onPointerDownOutside:H(s.onPointerDownOutside,l=>{const n=l.detail.originalEvent,m=n.button===0&&n.ctrlKey===!0,j=n.button===2||m;a.current=j},{checkForDefaultPrevented:!1}),onFocusOutside:H(s.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})}),Cs=N.forwardRef((s,t)=>{const r=D(V,s.__scopePopover),d=N.useRef(!1),c=N.useRef(!1);return e.jsx(we,{...s,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var l,n;(l=s.onCloseAutoFocus)==null||l.call(s,a),a.defaultPrevented||(d.current||(n=r.triggerRef.current)==null||n.focus(),a.preventDefault()),d.current=!1,c.current=!1},onInteractOutside:a=>{var m,j;(m=s.onInteractOutside)==null||m.call(s,a),a.defaultPrevented||(d.current=!0,a.detail.originalEvent.type==="pointerdown"&&(c.current=!0));const l=a.target;((j=r.triggerRef.current)==null?void 0:j.contains(l))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&c.current&&a.preventDefault()}})}),we=N.forwardRef((s,t)=>{const{__scopePopover:r,trapFocus:d,onOpenAutoFocus:c,onCloseAutoFocus:a,disableOutsidePointerEvents:l,onEscapeKeyDown:n,onPointerDownOutside:m,onFocusOutside:j,onInteractOutside:p,...u}=s,h=D(V,r),v=$(r);return cs(),e.jsx(ms,{asChild:!0,loop:!0,trapped:d,onMountAutoFocus:c,onUnmountAutoFocus:a,children:e.jsx(Oe,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:p,onEscapeKeyDown:n,onPointerDownOutside:m,onFocusOutside:j,onDismiss:()=>h.onOpenChange(!1),children:e.jsx(Le,{"data-state":Te(h.open),role:"dialog",id:h.contentId,...v,...u,ref:t,style:{...u.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Se="PopoverClose",ws=N.forwardRef((s,t)=>{const{__scopePopover:r,...d}=s,c=D(Se,r);return e.jsx(de.button,{type:"button",...d,ref:t,onClick:H(s.onClick,()=>c.onOpenChange(!1))})});ws.displayName=Se;var Ss="PopoverArrow",Ts=N.forwardRef((s,t)=>{const{__scopePopover:r,...d}=s,c=$(r);return e.jsx(Ee,{...c,...d,ref:t})});Ts.displayName=Ss;function Te(s){return s?"open":"closed"}var Fs=ge,Is=ye,Ps=be,Fe=Ce;const Ie=Fs,Pe=Is,ee=N.forwardRef(({className:s,align:t="center",sideOffset:r=4,...d},c)=>e.jsx(Ps,{children:e.jsx(Fe,{ref:c,align:t,sideOffset:r,className:$e("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
1de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s),...d})}));ee.displayName=Fe.displayName;const _s=["CheckCircle","Star","Heart","ThumbsUp","Award","Shield","Zap","Target","TrendingUp","Users","Clock","Calendar","Mail","Phone","MapPin","Globe","Lock","Key","Search","Filter","Settings","Tool","Download","Upload","Camera","Video","Image","File","Folder","Database","Server","Cloud","Wifi","Smartphone","Monitor","Tablet","CreditCard","DollarSign","ShoppingCart","Package","Truck","Store","Home","Building","Briefcase","GraduationCap","BookOpen","Lightbulb","Rocket","Flag","Trophy","Gift","Sparkles","Crown"],W=({value:s,onChange:t})=>{const[r,d]=N.useState(""),[c,a]=N.useState(!1),l=s&&G[s]?G[s]:je,n=_s.filter(m=>m.toLowerCase().includes(r.toLowerCase()));return e.jsxs(Ie,{open:c,onOpenChange:a,children:[e.jsx(Pe,{asChild:!0,children:e.jsxs(g,{variant:"outline",className:"w-full justify-start gap-2",children:[e.jsx(l,{size:20}),e.jsx("span",{className:"flex-1 text-left",children:s||"Select Icon"})]})}),e.jsxs(ee,{className:"w-80 p-0",align:"start",children:[e.jsx("div",{className:"p-3 border-b",children:e.jsx(o,{placeholder:"Search icons...",value:r,onChange:m=>d(m.target.value)})}),e.jsx(Y,{className:"h-80",children:e.jsx("div",{className:"grid grid-cols-6 gap-2 p-3",children:n.map(m=>{const j=G[m];return j?e.jsx("button",{onClick:()=>{t(m),a(!1)},className:`p-3 rounded-lg hover:bg-accent transition-colors ${s===m?"bg-accent":""}`,title:m,children:e.jsx(j,{size:24})},m):null})})})]})]})},se=({useFormInsteadOfCta:s,formId:t,formButtonText:r,onToggle:d,onFormSelect:c,onButtonTextChange:a})=>{const{data:l,isLoading:n}=Q({queryKey:["user-forms-for-cta"],queryFn:async()=>{const{data:{user:m}}=await M.auth.getUser();if(!m)return[];const{data:j,error:p}=await M.from("forms").select("id, name, button_text").eq("user_id",m.id).order("name");if(p)throw p;return j||[]}});return e.jsxs("div",{className:"space-y-4 p-4 border rounded-lg bg-muted/30",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Ye,{className:"w-4 h-4 text-primary"}),e.jsxs("div",{children:[e.jsx(i,{className:"text-base font-semibold",children:"Use Form instead of CTA"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Capture leads directly with a form from your Forms module"})]})]}),e.jsx(U,{checked:s,onCheckedChange:d})]}),s&&e.jsxs("div",{className:"space-y-4 pl-6 border-l-2 border-primary/20",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Select Form"}),n?e.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[e.jsx(Je,{className:"w-4 h-4 animate-spin"}),e.jsx("span",{className:"text-sm",children:"Loading forms..."})]}):l&&l.length>0?e.jsxs(b,{value:t||"",onValueChange:c,children:[e.jsx(C,{children:e.jsx(w,{placeholder:"Choose a form..."})}),e.jsx(S,{children:l.map(m=>e.jsx(x,{value:m.id,children:m.name},m.id))})]}):e.jsx("p",{className:"text-sm text-muted-foreground",children:"No forms found. Create a form in the Forms module first."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Button Text Override (optional)"}),e.jsx(o,{value:r||"",onChange:m=>a(m.target.value),placeholder:"Leave empty to use form's default button text"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Override the form's button text for this block"})]})]})]})},As=({block:s,onChange:t})=>{const r=()=>{const a=s.features||[];t({features:[...a,{icon:"CheckCircle",text:"New feature"}]})},d=a=>{const l=s.features||[];t({features:l.filter((n,m)=>m!==a)})},c=(a,l)=>{const n=[...s.features||[]];n[a]={...n[a],...l},t({features:n})};return e.jsxs("div",{className:"space-y-4 p-4 border-t",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Logo URL (optional)"}),e.jsx(o,{value:s.logoUrl||"",onChange:a=>t({logoUrl:a.target.value}),placeholder:"https://... (logo will appear centered at top)"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Social Proof Image URL (optional)"}),e.jsx(o,{value:s.socialProofUrl||"",onChange:a=>t({socialProofUrl:a.target.value}),placeholder:"https://... (small proof image)"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Social Proof Text (optional)"}),e.jsx(o,{value:s.socialProofText||"",onChange:a=>t({socialProofText:a.target.value}),placeholder:"mais de 15.000 profissionais formados"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Main Headline"}),e.jsx(o,{value:s.headline,onChange:a=>t({headline:a.target.value}),placeholder:"Your powerful headline"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Supports markdown: **bold**, *italic*, [link](url)"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Headline Color (optional)"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{type:"color",value:s.headlineColor||"#222222",onChange:a=>t({headlineColor:a.target.value}),className:"w-20 h-10"}),e.jsx(o,{value:s.headlineColor||"",onChange:a=>t({headlineColor:a.target.value}),placeholder:"Use theme default"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Headline Size (Optional)"}),e.jsxs(b,{value:s.headlineSize||"theme",onValueChange:a=>t({headlineSize:a==="theme"?void 0:a}),children:[e.jsx(C,{children:e.jsx(w,{})}),e.jsxs(S,{children:[e.jsx(x,{value:"theme",children:"Use Theme Default"}),e.jsx(x,{value:"sm",children:"Small"}),e.jsx(x,{value:"md",children:"Medium"}),e.jsx(x,{value:"lg",children:"Large"}),e.jsx(x,{value:"xl",children:"Extra Large"})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Override theme size for this block only"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Subheadline"}),e.jsx(T,{value:s.subheadline,onChange:a=>t({subheadline:a.target.value}),placeholder:"Supporting description",rows:3}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Supports markdown: **bold**, *italic*, [link](url)"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Subheadline Color (optional)"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{type:"color",value:s.subheadlineColor||"#666666",onChange:a=>t({subheadlineColor:a.target.value}),className:"w-20 h-10"}),e.jsx(o,{value:s.subheadlineColor||"",onChange:a=>t({subheadlineColor:a.target.value}),placeholder:"Use theme default"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Subheadline Size (Optional)"}),e.jsxs(b,{value:s.subheadlineSize||"theme",onValueChange:a=>t({subheadlineSize:a==="theme"?void 0:a}),children:[e.jsx(C,{children:e.jsx(w,{})}),e.jsxs(S,{children:[e.jsx(x,{value:"theme",children:"Use Theme Default"}),e.jsx(x,{value:"sm",children:"Small"}),e.jsx(x,{value:"md",children:"Medium"}),e.jsx(x,{value:"lg",children:"Large"})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Override theme size for this block only"})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Media Type"}),e.jsxs(b,{value:s.mediaType,onValueChange:a=>t({mediaType:a}),children:[e.jsx(C,{children:e.jsx(w,{})}),e.jsxs(S,{children:[e.jsx(x,{value:"video",children:"Video"}),e.jsx(x,{value:"image",children:"Image"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Media URL"}),e.jsx(o,{value:s.mediaUrl,onChange:a=>t({mediaUrl:a.target.value}),placeholder:"https://..."})]})]}),s.mediaType==="video"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Embed Code (optional)"}),e.jsx(T,{value:s.embedCode||"",onChange:a=>t({embedCode:a.target.value}),placeholder:"<iframe...>",rows:3})]}),e.jsx(se,{useFormInsteadOfCta:s.useFormInsteadOfCta||!1,formId:s.formId,formButtonText:s.formButtonText,onToggle:a=>t({useFormInsteadOfCta:a}),onFormSelect:a=>t({formId:a}),onButtonTextChange:a=>t({formButtonText:a})}),!s.useFormInsteadOfCta&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"CTA Button Text"}),e.jsx(o,{value:s.ctaText,onChange:a=>t({ctaText:a.target.value}),placeholder:"Get Started"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"CTA Button URL"}),e.jsx(o,{value:s.ctaUrl,onChange:a=>t({ctaUrl:a.target.value}),placeholder:"https://..."})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Button Color (optional)"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{type:"color",value:s.buttonColor||"#7E69AB",onChange:a=>t({buttonColor:a.target.value}),className:"w-20 h-10"}),e.jsx(o,{value:s.buttonColor||"",onChange:a=>t({buttonColor:a.target.value}),placeholder:"Use theme primary"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Button Size"}),e.jsxs(b,{value:s.buttonSize||"lg",onValueChange:a=>t({buttonSize:a}),children:[e.jsx(C,{children:e.jsx(w,{})}),e.jsxs(S,{children:[e.jsx(x,{value:"sm",children:"Small"}),e.jsx(x,{value:"md",children:"Medium"}),e.jsx(x,{value:"lg",children:"Large"})]})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Support Text (optional)"}),e.jsx(o,{value:s.supportText||"",onChange:a=>t({supportText:a.target.value}),placeholder:"e.g., No credit card required"})]}),e.jsxs("div",{className:"border-t pt-4 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(i,{children:"Show Feature Badges"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Display trust badges below CTA"})]}
1),e.jsx(U,{checked:s.showFeatures||!1,onCheckedChange:a=>t({showFeatures:a})})]}),s.showFeatures&&e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx(i,{children:"Features"}),e.jsxs(g,{onClick:r,size:"sm",variant:"outline",children:[e.jsx(I,{className:"w-4 h-4 mr-1"}),"Add Feature"]})]}),(s.features||[]).map((a,l)=>e.jsxs("div",{className:"flex gap-2 items-start p-3 border rounded-lg",children:[e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx(i,{children:"Icon"}),e.jsx(W,{value:a.icon,onChange:n=>c(l,{icon:n})}),e.jsx(o,{value:a.text,onChange:n=>c(l,{text:n.target.value}),placeholder:"Feature text"})]}),e.jsx(g,{onClick:()=>d(l),size:"icon",variant:"ghost",className:"text-destructive",children:e.jsx(_,{className:"w-4 h-4"})})]},l))]})]})]})},Rs=({block:s,onChange:t})=>{var a;const r=()=>{const l=[...s.items||[],{text:"",price:""}];t({items:l})},d=l=>{const n=s.items.filter((m,j)=>j!==l);t({items:n})},c=(l,n,m)=>{const j=[...s.items];j[l]={...j[l],[n]:m},t({items:j})};return e.jsxs("div",{className:"space-y-4 p-4 border-t",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Headline (opcional)"}),e.jsx(o,{value:s.headline||"",onChange:l=>t({headline:l.target.value}),placeholder:"TÃtulo principal opcional"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Subheadline (opcional)"}),e.jsx(o,{value:s.subheadline||"",onChange:l=>t({subheadline:l.target.value}),placeholder:"SubtÃtulo opcional"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"TÃtulo da Seção"}),e.jsx(o,{value:s.title,onChange:l=>t({title:l.target.value}),placeholder:"Qual é o valor do investimento?"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Itens (Módulos/Bônus/BenefÃcios)"}),(a=s.items)==null?void 0:a.map((l,n)=>e.jsxs("div",{className:"flex gap-2 items-start border rounded-lg p-3 bg-muted/50",children:[e.jsx("div",{className:"flex items-center justify-center w-8 h-8 rounded-full bg-primary text-primary-foreground font-bold text-sm flex-shrink-0",children:n+1}),e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx(o,{value:l.text,onChange:m=>c(n,"text",m.target.value),placeholder:"Nome do item"}),e.jsx(o,{value:l.price||"",onChange:m=>c(n,"price",m.target.value),placeholder:"Preço (opcional, ex: R$ 197,00)"})]}),e.jsx(g,{variant:"ghost",size:"icon",onClick:()=>d(n),className:"mt-1 flex-shrink-0",children:e.jsx(J,{className:"w-4 h-4"})})]},n)),e.jsxs(g,{variant:"outline",size:"sm",onClick:r,className:"w-full",children:[e.jsx(I,{className:"w-4 h-4 mr-2"}),"Adicionar Item"]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Valor Total Riscado (opcional)"}),e.jsx(o,{value:s.fullValueCrossed||"",onChange:l=>t({fullValueCrossed:l.target.value}),placeholder:"R$ 797,00"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Pergunta"}),e.jsx(o,{value:s.question,onChange:l=>t({question:l.target.value}),placeholder:"E quanto vai custar tudo isso?"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Texto Valor Final"}),e.jsx(o,{value:s.finalValueText,onChange:l=>t({finalValueText:l.target.value}),placeholder:"de apenas / por apenas"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Valor Final (Parcelado)"}),e.jsx(o,{value:s.finalValue,onChange:l=>t({finalValue:l.target.value}),placeholder:"12x R$103,11"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Texto Pagamento à Vista"}),e.jsx(o,{value:s.cashPaymentText,onChange:l=>t({cashPaymentText:l.target.value}),placeholder:"ou à vista por R$997"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Instruções do Botão (opcional)"}),e.jsx(o,{value:s.buttonInstructions||"",onChange:l=>t({buttonInstructions:l.target.value}),placeholder:"Clique no botão abaixo para garantir sua vaga"})]}),e.jsx(se,{useFormInsteadOfCta:s.useFormInsteadOfCta||!1,formId:s.formId,formButtonText:s.formButtonText,onToggle:l=>t({useFormInsteadOfCta:l}),onFormSelect:l=>t({formId:l}),onButtonTextChange:l=>t({formButtonText:l})}),!s.useFormInsteadOfCta&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Texto do Botão"}),e.jsx(o,{value:s.ctaText,onChange:l=>t({ctaText:l.target.value}),placeholder:"VOU CAIR PRA DENTRO E TER MAIS RESULTADO!"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"URL do Botão"}),e.jsx(o,{value:s.ctaUrl,onChange:l=>t({ctaUrl:l.target.value}),placeholder:"https://..."})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Cor do Botão (opcional)"}),e.jsx(o,{type:"color",value:s.buttonColor||"#22c55e",onChange:l=>t({buttonColor:l.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Tamanho do Botão"}),e.jsxs(b,{value:s.buttonSize||"lg",onValueChange:l=>t({buttonSize:l}),children:[e.jsx(C,{children:e.jsx(w,{})}),e.jsxs(S,{children:[e.jsx(x,{value:"sm",children:"Pequeno"}),e.jsx(x,{value:"md",children:"Médio"}),e.jsx(x,{value:"lg",children:"Grande"})]})]})]})]})},ks=({block:s,onChange:t})=>{const r=()=>{t({videoTestimonials:[...s.videoTestimonials||[],{videoUrl:"",thumbnailUrl:"",name:"",result:"",description:""}]})},d=u=>{t({videoTestimonials:(s.videoTestimonials||[]).filter((h,v)=>v!==u)})},c=(u,h,v)=>{const y=[...s.videoTestimonials||[]];y[u]={...y[u],[h]:v},t({videoTestimonials:y})},a=()=>{t({proofImages:[...s.proofImages||[],{imageUrl:"",caption:""}]})},l=u=>{t({proofImages:(s.proofImages||[]).filter((h,v)=>v!==u)})},n=(u,h,v)=>{const y=[...s.proofImages||[]];y[u]={...y[u],[h]:v},t({proofImages:y})},m=()=>{t({testimonials:[...s.testimonials,{text:"",name:"",photo:""}]})},j=u=>{t({testimonials:s.testimonials.filter((h,v)=>v!==u)})},p=(u,h,v)=>{const y=[...s.testimonials];y[u]={...y[u],[h]:v},t({testimonials:y})};return e.jsxs("div",{className:"space-y-4 p-4 border-t",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Section Headline"}),e.jsx(o,{value:s.headline,onChange:u=>t({headline:u.target.value}),placeholder:"What Our Clients Say"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Subheadline (optional)"}),e.jsx(o,{value:s.subheadline||"",onChange:u=>t({subheadline:u.target.value}),placeholder:"Optional subtitle"})]}),e.jsxs(me,{defaultValue:"videos",className:"w-full",children:[e.jsxs(ue,{className:"grid w-full grid-cols-3",children:[e.jsxs(q,{value:"videos",children:[e.jsx(Xe,{className:"h-4 w-4 mr-2"}),"Video Testimonials"]}),e.jsxs(q,{value:"proofs",children:[e.jsx(Ze,{className:"h-4 w-4 mr-2"}),"Proofs/Screenshots"]}),e.jsx(q,{value:"text",children:"Text Testimonials"})]}
1),e.jsxs(K,{value:"videos",className:"space-y-4 mt-4",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx(i,{children:"Video Testimonials"}),e.jsxs(g,{size:"sm",variant:"outline",onClick:r,children:[e.jsx(I,{className:"h-4 w-4 mr-2"}),"Add Video"]})]}),(s.videoTestimonials||[]).map((u,h)=>e.jsxs("div",{className:"space-y-3 p-3 border rounded-lg",children:[e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsxs("span",{className:"text-sm font-medium",children:["Video ",h+1]}),e.jsx(g,{size:"sm",variant:"ghost",onClick:()=>d(h),children:e.jsx(_,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{className:"text-xs",children:"Video URL (YouTube, Vimeo, or MP4)"}),e.jsx(o,{value:u.videoUrl,onChange:v=>c(h,"videoUrl",v.target.value),placeholder:"https://www.youtube.com/watch?v=..."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{className:"text-xs",children:"Thumbnail URL (optional)"}),e.jsx(o,{value:u.thumbnailUrl||"",onChange:v=>c(h,"thumbnailUrl",v.target.value),placeholder:"https://..."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{className:"text-xs",children:"Client Name"}),e.jsx(o,{value:u.name,onChange:v=>c(h,"name",v.target.value),placeholder:"John Silva"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{className:"text-xs",children:"Result/Achievement"}),e.jsx(o,{value:u.result,onChange:v=>c(h,"result",v.target.value),placeholder:"EARNED OVER R$1 MILLION IN 1 YEAR"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{className:"text-xs",children:"Description"}),e.jsx(T,{value:u.description,onChange:v=>c(h,"description",v.target.value),placeholder:"Client's story and how the product helped them...",rows:3})]})]},h)),(!s.videoTestimonials||s.videoTestimonials.length===0)&&e.jsx("div",{className:"text-center py-4 border-2 border-dashed rounded-lg",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"No video testimonials added"})})]}),e.jsxs(K,{value:"proofs",className:"space-y-4 mt-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Proofs Section Subheadline"}),e.jsx(o,{value:s.proofsHeadline||"",onChange:u=>t({proofsHeadline:u.target.value}),placeholder:"I challenge any other product to have as many proofs of results as VTSD"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Uses theme subheadline styling. Markdown supported."})]}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx(i,{children:"Proof Images"}),e.jsxs(g,{size:"sm",variant:"outline",onClick:a,children:[e.jsx(I,{className:"h-4 w-4 mr-2"}),"Add Image"]})]}),(s.proofImages||[]).map((u,h)=>e.jsxs("div",{className:"space-y-3 p-3 border rounded-lg",children:[e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsxs("span",{className:"text-sm font-medium",children:["Image ",h+1]}),e.jsx(g,{size:"sm",variant:"ghost",onClick:()=>l(h),children:e.jsx(_,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{className:"text-xs",children:"Image URL"}),e.jsx(o,{value:u.imageUrl,onChange:v=>n(h,"imageUrl",v.target.value),placeholder:"https://... (upload an image with testimonial screenshots)"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{className:"text-xs",children:"Caption (optional)"}),e.jsx(o,{value:u.caption||"",onChange:v=>n(h,"caption",v.target.value),placeholder:"Brief description of this proof..."})]})]},h)),(!s.proofImages||s.proofImages.length===0)&&e.jsx("div",{className:"text-center py-4 border-2 border-dashed rounded-lg",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"No proof images added"})})]}),e.jsxs(K,{value:"text",className:"space-y-4 mt-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Text Testimonials Section Subheadline"}),e.jsx(o,{value:s.textTestimonialsHeadline||"",onChange:u=>t({textTestimonialsHeadline:u.target.value}),placeholder:"See what our clients are saying..."}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Uses theme subheadline styling. Markdown supp
1orted."})]}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx(i,{children:"Text Testimonials"}),e.jsxs(g,{size:"sm",variant:"outline",onClick:m,children:[e.jsx(I,{className:"h-4 w-4 mr-2"}),"Add"]})]}),s.testimonials.map((u,h)=>e.jsxs("div",{className:"space-y-3 p-3 border rounded-lg",children:[e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsxs("span",{className:"text-sm font-medium",children:["Testimonial ",h+1]}),e.jsx(g,{size:"sm",variant:"ghost",onClick:()=>j(h),children:e.jsx(_,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{className:"text-xs",children:"Text"}),e.jsx(T,{value:u.text,onChange:v=>p(h,"text",v.target.value),placeholder:"The client testimonial...",rows:3})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{className:"text-xs",children:"Name"}),e.jsx(o,{value:u.name,onChange:v=>p(h,"name",v.target.value),placeholder:"John Silva"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{className:"text-xs",children:"Photo URL (optional)"}),e.jsx(o,{value:u.photo||"",onChange:v=>p(h,"photo",v.target.value),placeholder:"https://..."})]})]},h)),s.testimonials.length===0&&e.jsx("div",{className:"text-center py-4 border-2 border-dashed rounded-lg",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"No text testimonials added"})})]})]})]})},zs=({block:s,onChange:t})=>{const r=()=>{t({questions:[...s.questions,{question:"",answer:""}]})},d=a=>{t({questions:s.questions.filter((l,n)=>n!==a)})},c=(a,l,n)=>{const m=[...s.questions];m[a]={...m[a],[l]:n},t({questions:m})};return e.jsxs("div",{className:"space-y-4 p-4 border-t",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Section Headline"}),e.jsx(o,{value:s.headline,onChange:a=>t({headline:a.target.value}),placeholder:"Frequently Asked Questions"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Subheadline (optional)"}),e.jsx(o,{value:s.subheadline||"",onChange:a=>t({subheadline:a.target.value}),placeholder:"Optional subtitle"})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx(i,{children:"Questions"}),e.jsxs(g,{size:"sm",variant:"outline",onClick:r,children:[e.jsx(I,{className:"h-4 w-4 mr-2"}),"Add Question"]})]}),s.questions.map((a,l)=>e.jsxs("div",{className:"space-y-3 p-3 border rounded-lg",children:[e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsxs("span",{className:"text-sm font-medium",children:["Question ",l+1]}),e.jsx(g,{size:"sm",variant:"ghost",onClick:()=>d(l),children:e.jsx(_,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{className:"text-xs",children:"Question"}),e.jsx(o,{value:a.question,onChange:n=>c(l,"question",n.target.value),placeholder:"What is the question?"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{className:"text-xs",children:"Answer"}),e.jsx(T,{value:a.answer,onChange:n=>c(l,"answer",n.target.value),placeholder:"The complete answer...",rows:3})]})]},l)),s.questions.length===0&&e.jsx("div",{className:"text-center py-4 border-2 border-dashed rounded-lg",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"No questions added"})})]})]})},Ds=({block:s,onChange:t})=>{const r=()=>{t({logos:[...s.logos,{url:"",alt:""}]})},d=a=>{t({logos:s.logos.filter((l,n)=>n!==a)})},c=(a,l,n)=>{const m=[...s.logos];m[a]={...m[a],[l]:n},t({logos:m})};return e.jsxs("div",{className:"space-y-4 p-4 border-t",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Headline (optional)"}),e.jsx(o,{value:s.headline||"",onChange:a=>t({headline:a.target.value}),placeholder:"Main headline"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Subheadline (optional)"}),e.jsx(o,{value:s.subheadline||"",onChange:a=>t({subheadline:a.target.value}),placeholder:"Optional subtitle"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Small Title (optional - legacy)"}),e.jsx(o,{value:s.title||"",onChange:a=>t({title:a.target.value}),placeholder:"As seen in..."})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx(i,{children:"Logos"}),e.jsxs(g,{size:"sm",variant:"outline",onClick:r,children:[e.jsx(I,{className:"h-4 w-4 mr-1"}),"Add Logo"]})]}),s.logos.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"No logos added"}),s.logos.map((a,l)=>e.jsxs("div",{className:"flex gap-2 items-start p-3 border rounded",children:[e.jsxs("div",{className:"flex-1 space-y-2",children:[e.jsx(o,{placeholder:"Logo URL",value:a.url,onChange:n=>c(l,"url",n.target.value)}),e.jsx(o,{placeholder:"Alternative text",value:a.alt,onChange:n=>c(l,"alt",n.target.value)})]}),e.jsx(g,{size:"sm",variant:"ghost",onClick:()=>d(l),children:e.jsx(_,{className:"h-4 w-4"})})]},l))]})]})},Bs=({block:s,onChange:t})=>{const r=()=>{t({painItems:[...s.painItems,""]})},d=m=>{t({painItems:s.painItems.filter((j,p)=>p!==m)})},c=(m,j)=>{const p=[...s.painItems];p[m]=j,t({painItems:p})},a=()=>{t({desireItems:[...s.desireItems,""]})},l=m=>{t({desireItems:s.desireItems.filter((j,p)=>p!==m)})},n=(m,j)=>{const p=[...s.desireItems];p[m]=j,t({desireItems:p})};return e.jsxs("div",{className:"space-y-4 p-4 border-t",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Main Headline"}),e.jsx(o,{value:s.headline,onChange:m=>t({headline:m.target.value}),placeholder:"Pains vs Desires"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Subheadline (optional)"}),e.jsx(o,{value:s.subheadline||"",onChange:m=>t({subheadline:m.target.value}),placeholder:"Optional subtitle"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"flex justify-between items-center",children:e.jsx(i,{children:"Pain Points Title"})}),e.jsx(o,{value:s.painTitle,onChange:m=>t({painTitle:m.target.value}),placeholder:"Your current problems:"}),e.jsx("div",{className:"flex justify-end",children:e.jsxs(g,{size:"sm",variant:"outline",onClick:r,children:[e.jsx(I,{className:"h-4 w-4 mr-1"}),"Add Item"]})}),s.painItems.map((m,j)=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{value:m,onChange:p=>c(j,p.target.value),placeholder:"Pain point item"}),e.jsx(g,{size:"sm",variant:"ghost",onClick:()=>d(j),children:e.jsx(_,{className:"h-4 w-4"})})]},j))]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"flex justify-between items-center",children:e.jsx(i,{children:"Desires Title"})}),e.jsx(o,{value:s.desireTitle,onChange:m=>t({desireTitle:m.target.value}),placeholder:"What you will achieve:"}),e.jsx("div",{className:"flex justify-end",children:e.jsxs(g,{size:"sm",variant:"outline",onClick:a,children:[e.jsx(I,{className:"h-4 w-4 mr-1"}),"Add Item"]})}),s.desireItems.map((m,j)=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{value:m,onChange:p=>n(j,p.target.value),placeholder:"Desire item"}),e.jsx(g,{size:"sm",variant:"ghost",onClick:()=>l(j),children:e.jsx(_,{className:"h-4 w-4"})})]},j))]})]})},Ms=({block:s,onChange:t})=>{const r=()=>{t({profiles:[...s.profiles,{icon:"",title:"",description:""}]})},d=a=>{t({profiles:s.profiles.filter((l,n)=>n!==a)})},c=(a,l,n)=>{const m=[...s.profiles];m[a]={...m[a],[l]:n},t({profiles:m})};return e.jsxs("div",{className:"space-y-4 p-4 border-t",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Headline"}),e.jsx(o,{value:s.headline,onChange:a=>t({headline:a.target.value}),placeholder:"Who is this product for?"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Subheadline (optional)"}),e.jsx(o,{value:s.subheadline||"",onChange:a=>t({subheadline:a.target.value}),placeholder:"Optional subtitle"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx(i,{children:"Audience Profiles"}),e.jsxs(g,{size:"sm",variant:"outline",onClick:r,children:[e.jsx(I,{className:"h-4 w-4 mr-1"}),"Add Profile"]})]}),s.profiles.map((a,l)=>e.jsxs("div",{className:"p-3 border rounded space-y-2",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsxs(i,{className:"text-sm",children:["Profile ",l+1]}),e.jsx(g,{size:"sm",variant:"ghost",onClick:()=>d(l),children:e.jsx(_,{className:"h-4 w-4"})})]}),e.jsx(i,{children:"Icon"}),e.jsx(W,{value:a.icon,onChange:n=>c(l,"icon",n)}),e.jsx(o,{placeholder:"Profile title",value:a.title,onChange:n=>c(l,"title",n.target.value)}),e.jsx(T,{placeholder:"Description",value:a.description,onChange:n=>c(l,"description",n.target.value),rows:2})]},l))]})]})},Us=({block:s,onChange:t})=>{const r=()=>{t({steps:[...s.steps,{icon:"",title:"",description:"",badge:"",imageUrl:""}]})},d=a=>{t({steps:s.steps.filter((l,n)=>n!==a)})},c=(a,l,n)=>{const m=[...s.steps];m[a]={...m[a],[l]:n},t({steps:m})};return e.jsxs("div",{className:"space-y-4 p-4 border-t",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Headline"}),e.jsx(o,{value:s.headline,onChange:a=>t({headline:a.target.value}),placeholder:"How It Works"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Subheadline (optional)"}),e.jsx(o,{value:s.subheadline||"",onChange:a=>t({subheadline:a.target.value}),placeholder:"Optional subtitle"})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx(i,{children:"Steps"}),e.jsxs(g,{size:"sm",variant:"outline",onClick:r,children:[e.jsx(I,{className:"h-4 w-4 mr-1"}),"Add Step"]})]}),s.steps.map((a,l)=>e.jsxs("div",{className:"p-3 border rounded space-y-2",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsxs(i,{className:"text-sm",children:["Step ",l+1]}),e.jsx(g,{size:"sm",variant:"ghost",onClick:()=>d(l),children:e.jsx(_,{className:"h-4 w-4"})})]}),e.jsx(i,{children:"Icon"}),e.jsx(W,{value:a.icon,onChange:n=>c(l,"icon",n)}),e.jsx(o,{placeholder:"Badge text (optional)",value:a.badge||"",onChange:n=>c(l,"badge",n.target.value)}),e.jsx(o,{placeholder:"Step title",value:a.title,onChange:n=>c(l,"title",n.target.value)}),e.jsx(T,{placeholder:"Description",value:a.description,onChange:n=>c(l,"description",n.target.value),rows:2}),e.jsx(o,{placeholder:"Image URL (optional)",value:a.imageUrl||"",onChange:n=>c(l,"imageUrl",n.target.value)})]},l))]})]})},Os=({block:s,onChange:t})=>{const r=()=>{t({items:[...s.items,""]})},d=a=>{t({items:s.items.filter((l,n)=>n!==a)})},c=(a,l)=>{const n=[...s.items];n[a]=l,t({items:n})};return e.jsxs("div",{className:"space-y-4 p-4 border-t",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Headline (Conexão Método + Produto)"}),e.jsx(o,{value:s.headline,onChange:a=>t({headline:a.target.value}),placeholder:"Avaliar não é adivinhar â é compreender o que ninguém vê."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Subheadline (opcional)"}),e.jsx(o,{value:s.subheadline||"",onChange:a=>t({subheadline:a.target.value}
1),placeholder:"SubtÃtulo opcional"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Explicação (Conexão Método + Curso)"}),e.jsx(T,{value:s.explanation||"",onChange:a=>t({explanation:a.target.value}),placeholder:"Texto explicando como o método + curso trazem resultados. Suporta markdown para negrito e itálico.",rows:8})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"TÃtulo da Transformação"}),e.jsx(o,{value:s.transformationHeadline||"",onChange:a=>t({transformationHeadline:a.target.value}),placeholder:"O QUE O PROFISSIONAL CONQUISTA AO APLICAR O MÃTODO?"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"URL da Imagem do Produto"}),e.jsx(o,{value:s.imageUrl,onChange:a=>t({imageUrl:a.target.value}),placeholder:"https://..."})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx(i,{children:"Resultados da Transformação"}),e.jsxs(g,{size:"sm",variant:"outline",onClick:r,children:[e.jsx(I,{className:"h-4 w-4 mr-1"}),"Adicionar"]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Liste os resultados/conquistas que o aluno terá ao aplicar o método (foco na transformação, não em entregas)"}),s.items.map((a,l)=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx(T,{value:a,onChange:n=>c(l,n.target.value),placeholder:"Aprende a diferenciar TDAH de outras dificuldades...",rows:2}),e.jsx(g,{size:"sm",variant:"ghost",onClick:()=>d(l),children:e.jsx(_,{className:"h-4 w-4"})})]},l))]})]})},Ls=({block:s,onChange:t})=>e.jsxs("div",{className:"space-y-4 p-4 border-t",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Headline (optional)"}),e.jsx(o,{value:s.headline||"",onChange:r=>t({headline:r.target.value}),placeholder:"Main headline"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Subheadline (optional)"}),e.jsx(o,{value:s.subheadline||"",onChange:r=>t({subheadline:r.target.value}),placeholder:"Optional subtitle"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Title / Question (Main Content)"}),e.jsx(o,{value:s.title,onChange:r=>t({title:r.target.value}),placeholder:"But does this really work?"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Answer/Explanation"}),e.jsx(T,{value:s.answer,onChange:r=>t({answer:r.target.value}),placeholder:"Yes! And here's why...",rows:4})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Image URL"}),e.jsx(o,{value:s.imageUrl,onChange:r=>t({imageUrl:r.target.value}),placeholder:"https://..."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Image Position"}),e.jsxs(b,{value:s.imagePosition,onValueChange:r=>t({imagePosition:r}),children:[e.jsx(C,{children:e.jsx(w,{})}),e.jsxs(S,{children:[e.jsx(x,{value:"top",children:"Top"}),e.jsx(x,{value:"left",children:"Left"}),e.jsx(x,{value:"right",children:"Right"})]})]})]})]}),re=[{name:"FaInstagram",label:"Instagram"},{name:"FaFacebook",label:"Facebook"},{name:"FaTwitter",label:"Twitter"},{name:"FaLinkedin",label:"LinkedIn"},{name:"FaYoutube",label:"YouTube"},{name:"FaTiktok",label:"TikTok"},{name:"FaWhatsapp",label:"WhatsApp"},{name:"FaTelegram",label:"Telegram"},{name:"FaSnapchat",label:"Snapchat"},{name:"FaPinterest",label:"Pinterest"},{name:"FaReddit",label:"Reddit"},{name:"FaDiscord",label:"Discord"},{name:"FaTwitch",label:"Twitch"},{name:"FaGithub",label:"GitHub"},{name:"FaMedium",label:"Medium"},{name:"FaSpotify",label:"Spotify"},{name:"SiX",label:"X (Twitter)"},{name:"FaLink",label:"Website"}],Es=({value:s,onChange:t})=>{var l;const[r,d]=N.useState(!1),a=(()=>{if(s){const n=ae[s],m=te[s];if(n)return n;if(m)return m}return je})();return e.jsxs(Ie,{open:r,onOpenChange:d,children:[e.jsx(Pe,{asChild:!0,children:e.jsxs(g,{variant:"outline",className:"w-full justify-start gap-2",children:[e.jsx(a,{size:20}),e.jsx("span",{className:"flex-1 text-left",children:((l=re.find(n=>n.name===s))==null?void 0:l.label)||"Select Social Icon"})]})}),e.jsx(ee,{className:"w-80 p-0",align:"start",children:e.jsx(Y,{className:"h-80",children:e.jsx("div",{className:"grid grid-cols-4 gap-2 p-3",children:re.map(({name:n,label:m})=>{const j=ae[n],p=te[n],u=j||p;return u?e.jsxs("button",{onClick:()=>{t(n),d(!1)},className:`p-3 rounded-lg hover:bg-accent transition-colors flex flex-col items-center gap-1 ${s===n?"bg-accent":""}`,title:m,children:[e.jsx(u,{size:24}),e.jsx("span",{className:"text-[10px] text-center",children:m})]},n):null})})})})]})},Vs=({block:s,onChange:t})=>{const r=()=>{t({socialLinks:[...s.socialLinks||[],{platform:"",url:"",icon:"FaInstagram"}]})},d=a=>{var l;t({socialLinks:(l=s.socialLinks)==null?void 0:l.filter((n,m)=>m!==a)})},c=(a,l,n)=>{const m=[...s.socialLinks||[]];m[a]={...m[a],[l]:n},t({socialLinks:m})};return e.jsxs("div",{className:"space-y-4 p-4 border-t",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Headline"}),e.jsx(o,{value:s.headline,onChange:a=>t({headline:a.target.value}),placeholder:"Who is the author?"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Subheadline (optional)"}),e.jsx(o,{value:s.subheadline||"",onChange:a=>t({subheadline:a.target.value}),placeholder:"Optional subtitle"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Author Photo"}),e.jsx(o,{value:s.photo,onChange:a=>t({photo:a.target.value}),placeholder:"https://..."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Biography"}),e.jsx(T,{value:s.bio,onChange:a=>t({bio:a.target.value}),placeholder:"Tell your story...",rows:4})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx(i,{children:"Social Media (optional)"}),e.jsxs(g,{size:"sm",variant:"outline",onClick:r,children:[e.jsx(I,{className:"h-4 w-4 mr-1"}),"Add Link"]})]}),(s.socialLinks||[]).map((a,l)=>e.jsxs("div",{className:"space-y-2 p-3 border rounded-lg",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx(i,{className:"text-xs",children:"Social Icon"}),e.jsx(Es,{value:a.icon||"FaInstagram",onChange:n=>c(l,"icon",n)})]}),e.jsx(g,{size:"sm",variant:"ghost",onClick:()=>d(l),className:"mt-5",children:e.jsx(_,{className:"h-4 w-4"})})]}),e.jsxs("div",{children:[e.jsx(i,{className:"text-xs",children:"URL"}),e.jsx(o,{placeholder:"https://...",value:a.url,onChange:n=>c(l,"url",n.target.value)})]})]},l))]})]})},Hs=({block:s,onChange:t})=>{const r=()=>{const a=s.items||[];t({items:[...a,""]})},d=(a,l)=>{const n=[...s.items||[]];n[a]=l,t({items:n})},c=a=>{var n;const l=((n=s.items)==null?void 0:n.filter((m,j)=>j!==a))||[];t({items:l})};return e.jsxs("div",{className:"space-y-4 p-4 border-t",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Argument Type"}),e.jsxs(b,{value:s.argumentType||"news",onValueChange:a=>t({argumentType:a}),children:[e.jsx(C,{children:e.jsx(w,{})}),e.jsxs(S,{children:[e.jsx(x,{value:"news",children:"News"}),e.jsx(x,{value:"market-research",children:"Market Research"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Headline / Title"}),e.jsx(o,{value:s.headline,onChange:a=>t({headline:a.target.value}),placeholder:"Research shows that..."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Subheadline (optional)"}),e.jsx(o,{value:s.subheadline||"",onChange:a=>t({subheadline:a.target.value}),placeholder:"Optional subtitle"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Image URL"}),e.jsx(o,{value:s.imageUrl||"",onChange:a=>t({imageUrl:a.target.value}),placeholder:"https://..."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Explanation"}),e.jsx(T,{value:s.explanation||"",onChange:a=>t({explanation:a.target.value}),placeholder:"Detailed explanation...",rows:4})]}),s.argumentType==="market-research"&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Image Position"}),e.jsxs(b,{value:s.imagePosition||"left",onValueChange:a=>t({imagePosition:a}),children:[e.jsx(C,{children:e.jsx(w,{})}),e.jsxs(S,{children:[e.jsx(x,{value:"left",children:"Left"}),e.jsx(x,{value:"right",children:"Right"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx(i,{children:"Research Items (Numbered List)"}),e.jsxs(g,{type:"button",size:"sm",onClick:r,children:[e.jsx(I,{className:"h-4 w-4 mr-1"}),"Add Item"]})]}),(s.items||[]).map((a,l)=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{value:a,onChange:n=>d(l,n.target.value),placeholder:`Item ${l+1}`}),e.jsx(g,{type:"button",size:"icon",variant:"ghost",onClick:()=>c(l),children:e.jsx(_,{className:"h-4 w-4"})})]},l))]})]})]})},qs=({block:s,onChange:t})=>e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(i,{htmlFor:"backgroundColor",children:"Backgroun
1d Color"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{id:"backgroundColor",type:"color",value:s.backgroundColor,onChange:r=>t({backgroundColor:r.target.value}),className:"w-20 h-10"}),e.jsx(o,{value:s.backgroundColor,onChange:r=>t({backgroundColor:r.target.value}),placeholder:"#f9fafb"})]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Choose a color that stands out from your main background"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Headline (optional)"}),e.jsx(o,{value:s.headline||"",onChange:r=>t({headline:r.target.value}),placeholder:"Main headline"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Subheadline (optional)"}),e.jsx(o,{value:s.subheadline||"",onChange:r=>t({subheadline:r.target.value}),placeholder:"Optional subtitle"})]}),e.jsxs("div",{children:[e.jsx(i,{children:"Icon (Optional)"}),e.jsx(W,{value:s.icon||"",onChange:r=>t({icon:r})})]}),e.jsxs("div",{children:[e.jsx(i,{htmlFor:"subtitle",children:"Icon Subtitle"}),e.jsx(o,{id:"subtitle",value:s.subtitle,onChange:r=>t({subtitle:r.target.value}),placeholder:"Important information"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Supports markdown: **bold**, *italic*, [link](url)"})]}),e.jsxs("div",{children:[e.jsx(i,{htmlFor:"explanation",children:"Explanation"}),e.jsx(T,{id:"explanation",value:s.explanation,onChange:r=>t({explanation:r.target.value}),placeholder:"Detailed explanation...",rows:4}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Supports markdown: **bold**, *italic*, [link](url)"})]})]}),Ks=({block:s,onChange:t})=>{const r=()=>{const a=s.features||[];t({features:[...a,{icon:"CheckCircle",text:""}]})},d=a=>{const l=s.features||[];t({features:l.filter((n,m)=>m!==a)})},c=(a,l,n)=>{const j=[...s.features||[]];j[a]={...j[a],[l]:n},t({features:j})};return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Headline (opcional)"}),e.jsx(o,{value:s.headline||"",onChange:a=>t({headline:a.target.value}),placeholder:"TÃtulo principal"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Subheadline (opcional)"}),e.jsx(o,{value:s.subheadline||"",onChange:a=>t({subheadline:a.target.value}),placeholder:"SubtÃtulo opcional"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Subtitle Text (opcional)"}),e.jsx(o,{value:s.subtitle||"",onChange:a=>t({subtitle:a.target.value}),placeholder:"Um texto pequeno acima do botão"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Instruções do Botão (opcional)"}),e.jsx(o,{value:s.buttonInstructions||"",onChange:a=>t({buttonInstructions:a.target.value}),placeholder:"Clique no botão abaixo para garantir sua vaga"})]}),e.jsx(se,{useFormInsteadOfCta:s.useFormInsteadOfCta||!1,formId:s.formId,formButtonText:s.formButtonText,onToggle:a=>t({useFormInsteadOfCta:a}),onFormSelect:a=>t({formId:a}),onButtonTextChange:a=>t({formButtonText:a})}),e.jsxs("div",{className:"space-y-4 p-4 border rounded-lg bg-muted/30",children:[e.jsx(i,{className:"text-base font-semibold",children:"Configurações do Botão"}),!s.useFormInsteadOfCta&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Texto do Botão"}),e.jsx(o,{value:s.ctaText,onChange:a=>t({ctaText:a.target.value}),placeholder:"Quero garantir minha vaga!"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"URL do Botão"}),e.jsx(o,{value:s.ctaUrl,onChange:a=>t({ctaUrl:a.target.value}),placeholder:"https://checkout.com/buy"})]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Cor do Botão (opcional)"}),e.jsx(o,{type:"color",value:s.buttonColor||"#000000",onChange:a=>t({buttonColor:a.target.value})})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Tamanho do Botão"}),e.jsxs(b,{value:s.buttonSize||"lg",onValueChange:a=>t({buttonSize:a}),children:[e.jsx(C,{children:e.jsx(w,{})}),e.jsxs(S,{children:[e.jsx(x,{value:"sm",children:"Pequeno"}),e.jsx(x,{value:"default",children:"Médio"}),e.jsx(x,{value:"lg",children:"Grande"})]})]})]})]})]}),e.jsxs("div",{className:"space-y-4 p-4 border rounded-lg bg-muted/30",children:[e.jsx(i,{className:"text-base font-semibold",children:"Timer (opcional)"}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Texto do Timer"}),e.jsx(o,{value:s.timerText||"",onChange:a=>t({timerText:a.target.value}),placeholder:"Oferta expira em:"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Tipo de Timer"}),e.jsxs(b,{value:s.timerType||"date",onValueChange:a=>t({timerType:a}),children:[e.jsx(C,{children:e.jsx(w,{})}),e.jsxs(S,{children:[e.jsx(x,{value:"date",children:"Data/Hora EspecÃfica"}),e.jsx(x,{value:"minutes",children:"Minutos"})]})]})]})]}),s.timerType==="minutes"?e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Minutos para Countdown"}),e.jsx(o,{type:"number",min:"1",value:s.timerMinutes||"",onChange:a=>t({timerMinutes:parseInt(a.target.value)||0}),placeholder:"75"})]}):e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Data/Hora do Timer"}),e.jsx(o,{type:"datetime-local",value:s.timerTime||"",onChange:a=>t({timerTime:a.target.value})})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(i,{children:"Mostrar Badges de Funcionalidades"}
1),e.jsx(U,{checked:s.showFeatures||!1,onCheckedChange:a=>t({showFeatures:a})})]}),s.showFeatures&&e.jsxs("div",{className:"space-y-4 pl-4 border-l-2 border-border",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(i,{className:"text-sm",children:"Funcionalidades"}),e.jsxs(g,{type:"button",size:"sm",onClick:r,variant:"outline",children:[e.jsx(I,{className:"h-4 w-4 mr-1"}),"Adicionar"]})]}),(s.features||[]).map((a,l)=>e.jsxs("div",{className:"flex gap-2 items-start",children:[e.jsx("div",{className:"flex-shrink-0 w-32",children:e.jsx(W,{value:a.icon,onChange:n=>c(l,"icon",n)})}),e.jsx(o,{value:a.text,onChange:n=>c(l,"text",n.target.value),placeholder:"Texto da funcionalidade",className:"flex-1"}),e.jsx(g,{type:"button",size:"icon",variant:"ghost",onClick:()=>d(l),children:e.jsx(J,{className:"h-4 w-4"})})]},l))]})]})]})},$s=({block:s,onChange:t})=>e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Logo URL (optional)"}),e.jsx(o,{value:s.logoUrl||"",onChange:r=>t({logoUrl:r.target.value}),placeholder:"https://example.com/logo.png"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Headline"}),e.jsx(o,{value:s.headline,onChange:r=>t({headline:r.target.value}),placeholder:"Your main headline"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Supports markdown: **bold**, *italic*, [link](url)"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Headline Color (optional)"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{type:"color",value:s.headlineColor||"#222222",onChange:r=>t({headlineColor:r.target.value}),className:"w-20 h-10"}),e.jsx(o,{value:s.headlineColor||"",onChange:r=>t({headlineColor:r.target.value}),placeholder:"Use theme default"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Headline Size (Optional)"}),e.jsxs(b,{value:s.headlineSize||"theme",onValueChange:r=>t({headlineSize:r==="theme"?void 0:r}),children:[e.jsx(C,{children:e.jsx(w,{})}),e.jsxs(S,{children:[e.jsx(x,{value:"theme",children:"Use Theme Default"}),e.jsx(x,{value:"sm",children:"Small"}),e.jsx(x,{value:"md",children:"Medium"}),e.jsx(x,{value:"lg",children:"Large"}),e.jsx(x,{value:"xl",children:"Extra Large"})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Override theme size for this block only"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Subheadline"}),e.jsx(o,{value:s.subheadline,onChange:r=>t({subheadline:r.target.value}),placeholder:"Your subheadline"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Supports markdown: **bold**, *italic*, [link](url)"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Subheadline Color (optional)"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{type:"color",value:s.subheadlineColor||"#666666",onChange:r=>t({subheadlineColor:r.target.value}),className:"w-20 h-10"}),e.jsx(o,{value:s.subheadlineColor||"",onChange:r=>t({subheadlineColor:r.target.value}),placeholder:"Use theme default"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Subheadline Size (Optional)"}),e.jsxs(b,{value:s.subheadlineSize||"theme",onValueChange:r=>t({subheadlineSize:r==="theme"?void 0:r}),children:[e.jsx(C,{children:e.jsx(w,{})}),e.jsxs(S,{children:[e.jsx(x,{value:"theme",children:"Use Theme Default"}),e.jsx(x,{value:"sm",children:"Small"}),e.jsx(x,{value:"md",children:"Medium"}),e.jsx(x,{value:"lg",children:"Large"})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Override theme size for this block only"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Explanation"}),e.jsx(T,{value:s.explanation,onChange:r=>t({explanation:r.target.value}),placeholder:"Explanation text after subheadline",rows:4}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Supports markdown: **bold**, *italic*, [link](url)"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Explanation Color (optional)"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{type:"color",value:s.explanationColor||"#666666",onChange:r=>t({explanationColor:r.target.value}),className:"w-20 h-10"}),e.jsx(o,{value:s.explanationColor||"",onChange:r=>t({explanationColor:r.target.value}),placeholder:"Use theme default"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Explanation Size (Optional)"}),e.jsxs(b,{value:s.explanationSize||"theme",onValueChange:r=>t({explanationSize:r==="theme"?void 0:r}),children:[e.jsx(C,{children:e.jsx(w,{})}),e.jsxs(S,{children:[e.jsx(x,{value:"theme",children:"Use Theme Default"}),e.jsx(x,{value:"sm",children:"Small"}),e.jsx(x,{value:"md",children:"Medium"}),e.jsx(x,{value:"lg",children:"Large"})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Override theme size for this block only"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Media Type"}),e.jsxs(us,{value:s.mediaType,onValueChange:r=>t({mediaType:r}),children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(le,{value:"video",id:"video"}),e.jsx(i,{htmlFor:"video",children:"Video"})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(le,{value:"image",id:"image"}),e.jsx(i,{htmlFor:"image",children:"Image"})]})]})]}),s.mediaType==="video"&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Embed Code (optional - for custom video players)"}),e.jsx(T,{value:s.embedCode||"",onChange:r=>t({embedCode:r.target.value}),placeholder:'<iframe src="..." />',rows:4})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:s.mediaType==="video"?"Video URL":"Image URL"}),e.jsx(o,{value:s.mediaUrl,onChange:r=>t({mediaUrl:r.target.value}),placeholder:s.mediaType==="video"?"https://youtube.com/watch?v=...":"https://example.com/image.jpg"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"HTML Script (Hotmart/Clickfunnels code)"}),e.jsx(T,{value:s.htmlScript||"",onChange:r=>t({htmlScript:r.target.value}),placeholder:"Paste your upsell script/embed code here",rows:6})]}),e.jsxs("div",{className:"space-y-4 p-4 border rounded-lg bg-muted/30",children:[e.jsx(i,{className:"text-base font-semibold",children:"Timer/Countdown (opcional)"}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Texto do Timer"}),e.jsx(o,{value:s.timerText||"",onChange:r=>t({timerText:r.target.value}),placeholder:"Oferta expira em:"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Tipo de Timer"}),e.jsxs(b,{value:s.timerType||"date",onValueChange:r=>t({timerType:r}),children:[e.jsx(C,{children:e.jsx(w,{})}),e.jsxs(S,{children:[e.jsx(x,{value:"date",children:"Data/Hora EspecÃfica"}),e.jsx(x,{value:"minutes",children:"Minutos"})]})]})]})]}),s.timerType==="minutes"?e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Minutos para Countdown"}),e.jsx(o,{type:"number",min:"1",value:s.timerMinutes||"",onChange:r=>t({timerMinutes:parseInt(r.target.value)||0}),placeholder:"75"})]}):e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Data/Hora do Timer"}),e.jsx(o,{type:"datetime-local",value:s.timerTime||"",onChange:r=>t({timerTime:r.target.value})})]})]})]}),Ws=({block:s,onChange:t})=>{const{data:r,isLoading:d}=Q({queryKey:["user-forms-for-sales-page"],queryFn:async()=>{const{data:{user:a}}=await M.auth.getUser();if(!a)return[];const{data:l,error:n}=await M.from("forms").select("id, name").eq("user_id",a.id).order("name",{ascending:!0});if(n)throw n;return l||[]}}),c=r==null?void 0:r.find(a=>a.id===s.formId);return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Select Form"}),e.jsxs(b,{value:s.formId||"",onValueChange:a=>t({formId:a}),children:[e.jsx(C,{children:e.jsx(w,{placeholder:d?"Loading forms...":"Select a form"})}),e.jsx(S,{children:r==null?void 0:r.map(a=>e.jsx(x,{value:a.id,children:a.name},a.id))})]}),c&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Selected: ",c.name]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Headline (optional)"}),e.jsx(o,{value:s.headline||"",onChange:a=>t({headline:a.target.value}),placeholder:"Custom headline above the form"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Subheadline (optional)"}),e.jsx(o,{value:s.subheadline||"",onChange:a=>t({subheadline:a.target.value}),placeholder:"Custom subheadline below the headline"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Button Text Override (optional)"}),e.jsx(o,{value:s.buttonText||"",onChange:a=>t({buttonText:a.target.value}),placeholder:"Leave empty to use form's button text"})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(i,{children:"Show Form Media"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Display form's image/video if available"})]}),e.jsx(U,{checked:s.showMediaFromForm||!1,onCheckedChange:a=>t({showMediaFromForm:a})})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(i,{children:"Compact Mode"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Smaller version with minimal spacing"})]}),e.jsx(U,{checked:s.compactMode||!1,onCheckedChange:a=>t({compactMode:a})})]}),!s.formId&&e.jsx("div",{className:"p-3 bg-amber-50 border border-amber-200 rounded-md",children:e.jsx("p",{className:"text-sm text-amber-800",children:"Please select a form to display on this block."})})]})},Gs=({blocks:s,onRemove:t,onUpdate:r,onReorder:d})=>{const{t:c}=z("salesPages"),[a,l]=N.useState(null),n=p=>{const h={hero:"hero",authority:"authority","pain-desire":"painDesire","target-audience":"targetAudience","how-it-works":"howItWorks",deliverables:"deliverables",testimonials:"testimonials",objection:"objection",author:"author",pricing:"pricing","full-width-banner":"fullWidthBanner",argument:"argument",faq:"faq","cta-button":"ctaButton",upsell:"upsell","leads-flow-form":"leadsFlowForm"}[p.type];return h?c(`editor.blocks.types.${h}`):p.type};if(s.length===0)return e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:c("editor.blocks.noBlocks")});const m=p=>{if(!p.destination)return;const u=Array.from(s),[h]=u.splice(p.source.index,1);
1u.splice(p.destination.index,0,h);const v=u.map((y,f)=>({...y,order:f}));d(v)},j=p=>{const u={onChange:h=>r(p.id,h)};switch(p.type){case"hero":return e.jsx(As,{block:p,...u});case"pricing":return e.jsx(Rs,{block:p,...u});case"testimonials":return e.jsx(ks,{block:p,...u});case"faq":return e.jsx(zs,{block:p,...u});case"authority":return e.jsx(Ds,{block:p,...u});case"pain-desire":return e.jsx(Bs,{block:p,...u});case"target-audience":return e.jsx(Ms,{block:p,...u});case"how-it-works":return e.jsx(Us,{block:p,...u});case"deliverables":return e.jsx(Os,{block:p,...u});case"objection":return e.jsx(Ls,{block:p,...u});case"author":return e.jsx(Vs,{block:p,...u});case"full-width-banner":return e.jsx(qs,{block:p,...u});case"argument":return e.jsx(Hs,{block:p,...u});case"cta-button":return e.jsx(Ks,{block:p,...u});case"upsell":return e.jsx($s,{block:p,...u});case"leads-flow-form":return e.jsx(Ws,{block:p,...u});default:return null}};return e.jsx(rs,{onDragEnd:m,children:e.jsx(is,{droppableId:"blocks",children:p=>e.jsxs("div",{...p.droppableProps,ref:p.innerRef,className:"space-y-4",children:[s.map((u,h)=>e.jsx(ns,{draggableId:u.id,index:h,children:v=>e.jsxs(he,{ref:v.innerRef,...v.draggableProps,children:[e.jsxs(xe,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[e.jsx("div",{...v.dragHandleProps,children:e.jsx(es,{className:"h-4 w-4 text-muted-foreground cursor-move"})}),e.jsx(pe,{className:"text-base",children:n(u)})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(U,{checked:u.enabled,onCheckedChange:y=>r(u.id,{enabled:y})}),e.jsx(g,{variant:"ghost",size:"sm",onClick:()=>l(a===u.id?null:u.id),children:a===u.id?e.jsx(ss,{className:"h-4 w-4"}):e.jsx(B,{className:"h-4 w-4"})}),e.jsx(g,{variant:"ghost",size:"sm",onClick:()=>t(u.id),children:e.jsx(_,{className:"h-4 w-4"})})]})]}),a===u.id&&e.jsx(Qe,{className:"pt-0",children:j(u)})]})},u.id)),p.placeholder]})})})},Qs=({blocks:s,onChange:t})=>{const{t:r}=z("salesPages"),[d,c]=N.useState(!1),a=j=>{t([...s,j]),c(!1)},l=j=>{t(s.filter(p=>p.id!==j))},n=(j,p)=>{t(s.map(u=>u.id===j?{...u,...p}:u))},m=j=>{t(j)};return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("h3",{className:"text-lg font-semibold",children:r("editor.blocks.title")}),e.jsxs(g,{size:"sm",onClick:()=>c(!0),children:[e.jsx(I,{className:"h-4 w-4 mr-2"}),r("editor.blocks.addBlock")]})]}),d?e.jsx(vs,{onSelect:a,onCancel:()=>c(!1)}):e.jsx(Gs,{blocks:s,onRemove:l,onUpdate:n,onReorder:m})]})},Ys=({theme:s,onChange:t})=>{const{t:r}=z("salesPages");return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:r("editor.theme.colorScheme")}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"primaryColor",children:r("editor.theme.primaryColor")}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{id:"primaryColor",type:"color",value:s.primaryColor,onChange:d=>t({primaryColor:d.target.value}),className:"w-20 h-10"}),e.jsx(o,{value:s.primaryColor,onChange:d=>t({primaryColor:d.target.value}),placeholder:"#7E69AB"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"secondaryColor",children:r("editor.theme.secondaryColor")}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{id:"secondaryColor",type:"color",value:s.secondaryColor,onChange:d=>t({secondaryColor:d.target.value}),className:"w-20 h-10"}),e.jsx(o,{value:s.secondaryColor,onChange:d=>t({secondaryColor:d.target.value}),placeholder:"#9b87f5"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"backgroundColor",children:r("editor.theme.backgroundColor")}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{id:"backgroundColor",type:"color",value:s.backgroundColor,onChange:d=>t({backgroundColor:d.target.value}),className:"w-20 h-10"}),e.jsx(o,{value:s.backgroundColor,onChange:d=>t({backgroundColor:d.target.value}),placeholder:"#ffffff"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"headlineColor",children:r("editor.theme.headlineColor")}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{id:"headlineColor",type:"color",value:s.headlineColor||"#222222",onChange:d=>t({headlineColor:d.target.value}),className:"w-20 h-10"}),e.jsx(o,{value:s.headlineColor||"#222222",onChange:d=>t({headlineColor:d.target.value}),placeholder:"#222222"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"subheadlineColor",children:r("editor.theme.subheadlineColor")}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{id:"subheadlineColor",type:"color",value:s.subheadlineColor||"#666666",onChange:d=>t({subheadlineColor:d.target.value}),className:"w-20 h-10"}),e.jsx(o,{value:s.subheadlineColor||"#666666",onChange:d=>t({subheadlineColor:d.target.value}),placeholder:"#666666"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"contentColor",children:r("editor.theme.contentTextColor")}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{id:"contentColor",type:"color",value:s.contentColor||"#444444",onChange:d=>t({contentColor:d.target.value}),className:"w-20 h-10"}),e.jsx(o,{value:s.contentColor||"#444444",onChange:d=>t({contentColor:d.target.value}),placeholder:"#444444"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"blockBackgroun
1dColor",children:r("editor.theme.blockBackgroundColor")}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(o,{id:"blockBackgroundColor",type:"color",value:s.blockBackgroundColor||"#f9fafb",onChange:d=>t({blockBackgroundColor:d.target.value}),className:"w-20 h-10"}),e.jsx(o,{value:s.blockBackgroundColor||"#f9fafb",onChange:d=>t({blockBackgroundColor:d.target.value}),placeholder:"#f9fafb"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:r("editor.theme.blockBackgroundHint")})]})]})]}),e.jsx(k,{}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:r("editor.theme.typography")}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"fontFamily",children:r("editor.theme.fontFamily")}),e.jsxs(b,{value:s.fontFamily,onValueChange:d=>t({fontFamily:d}),children:[e.jsx(C,{id:"fontFamily",children:e.jsx(w,{})}),e.jsxs(S,{children:[e.jsx(x,{value:"Inter",children:"Inter (Modern Sans)"}),e.jsx(x,{value:"Roboto",children:"Roboto (Professional)"}),e.jsx(x,{value:"Poppins",children:"Poppins (Friendly)"}),e.jsx(x,{value:"Playfair Display",children:"Playfair Display (Elegant Serif)"}),e.jsx(x,{value:"Montserrat",children:"Montserrat (Bold Sans)"}),e.jsx(x,{value:"Open Sans",children:"Open Sans (Clean Sans)"}),e.jsx(x,{value:"Lato",children:"Lato (Minimalist)"}),e.jsx(x,{value:"Oswald",children:"Oswald (Strong Headers)"}),e.jsx(x,{value:"Source Sans Pro",children:"Source Sans Pro (Readable)"}),e.jsx(x,{value:"Raleway",children:"Raleway (Sophisticated)"}),e.jsx(x,{value:"PT Sans",children:"PT Sans (Versatile)"}),e.jsx(x,{value:"Merriweather",children:"Merriweather (Classic Serif)"}),e.jsx(x,{value:"Nunito",children:"Nunito (Rounded)"}),e.jsx(x,{value:"Ubuntu",children:"Ubuntu (Tech-friendly)"}),e.jsx(x,{value:"Mukta",children:"Mukta (Contemporary)"})]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"buttonStyle",children:r("editor.theme.buttonStyle")}),e.jsxs(b,{value:s.buttonStyle||"rounded",onValueChange:d=>t({buttonStyle:d}),children:[e.jsx(C,{id:"buttonStyle",children:e.jsx(w,{})}),e.jsxs(S,{children:[e.jsx(x,{value:"rounded",children:r("editor.theme.buttonStyles.rounded")}),e.jsx(x,{value:"sharp",children:r("editor.theme.buttonStyles.sharp")}),e.jsx(x,{value:"pill",children:r("editor.theme.buttonStyles.pill")})]})]})]})]})]}),e.jsx(k,{}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:r("editor.theme.textSizes")}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:r("editor.theme.textSizesHint")}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx(i,{className:"text-base font-medium mb-3 block",children:r("editor.theme.headlines")}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"headlineSizeDesktop",className:"text-sm text-muted-foreground",children:r("editor.theme.desktopSize")}),e.jsx(o,{id:"headlineSizeDesktop",type:"number",min:10,max:100,step:1,value:s.headlineSizeDesktop||"",onChange:d=>t({headlineSizeDesktop:d.target.value?Number(d.target.value):void 0}),placeholder:"28",className:"w-full"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"headlineSizeMobile",className:"text-sm text-muted-foreground",children:r("editor.theme.mobileSize")}),e.jsx(o,{id:"headlineSizeMobile",type:"number",min:10,max:100,step:1,value:s.headlineSizeMobile||"",onChange:d=>t({headlineSizeMobile:d.target.value?Number(d.target.value):void 0}),placeholder:"26",className:"w-full"})]})]})]}),e.jsxs("div",{children:[e.jsx(i,{className:"text-base font-medium mb-3 block",children:r("editor.theme.subheadlines")}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"subheadlineSizeDesktop",className:"text-sm text-muted-foreground",children:r("editor.theme.desktopSize")}),e.jsx(o,{id:"subheadlineSizeDesktop",type:"number",min:10,max:100,step:1,value:s.subheadlineSizeDesktop||"",onChange:d=>t({subheadlineSizeDesktop:d.target.value?Number(d.target.value):void 0}),placeholder:"22",className:"w-full"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"subheadlineSizeMobile",className:"text-sm text-muted-foreground",children:r("editor.theme.mobileSize")}),e.jsx(o,{id:"subheadlineSizeMobile",type:"number",min:10,max:100,step:1,value:s.subheadlineSizeMobile||"",onChange:d=>t({subheadlineSizeMobile:d.target.value?Number(d.target.value):void 0}),placeholder:"20",className:"w-full"})]})]})]}),e.jsxs("div",{children:[e.jsx(i,{className:"text-base font-medium mb-3 block",children:r("editor.theme.contentText")}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"contentSizeDesktop",className:"text-sm text-muted-foreground",children:r("editor.theme.desktopSize")}),e.jsx(o,{id:"contentSizeDesktop",type:"number",min:10,max:100,step:1,value:s.contentSizeDesktop||"",onChange:d=>t({contentSizeDesktop:d.target.value?Number(d.target.value):void 0}),placeholder:"16",className:"w-full"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"contentSizeMobile",className:"text-sm text-muted-foreground",children:r("editor.theme.mobileSize")}),e.jsx(o,{id:"contentSizeMobile",type:"number",min:10,max:100,step:1,value:s.contentSizeMobile||"",onChange:d=>t({contentSizeMobile:d.target.value?Number(d.target.value):void 0}),placeholder:"16",className:"w-full"})]})]})]}),e.jsxs("div",{children:[e.jsx(i,{className:"text-base font-medium mb-3 block",children:r("editor.theme.listsBullets")}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"listSizeDesktop",className:"text-sm text-muted-foreground",children:r("editor.theme.desktopSize")}),e.jsx(o,{id:"listSizeDesktop",type:"number",min:10,max:100,step:1,value:s.listSizeDesktop||"",onChange:d=>t({listSizeDesktop:d.target.value?Number(d.target.value):void 0}),placeholder:"16",className:"w-full"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"listSizeMobile",className:"text-sm text-muted-foreground",children:r("editor.theme.mobileSize")}),e.jsx(o,{id:"listSizeMobile",type:"number",min:10,max:100,step:1,value:s.listSizeMobile||"",onChange:d=>t({listSizeMobile:d.target.value?Number(d.target.value):void 0}),placeholder:"16",className:"w-full"})]})]})]})]})]})]})},Js=[{name:"Modern Tech",theme:{primaryColor:"#0066FF",secondaryColor:"#00D9FF",backgroundColor:"#ffffff",blockBackgroun
1dColor:"#f9fafb",fontFamily:"Inter",headlineColor:"#1a1a1a",subheadlineColor:"#666666",buttonStyle:"rounded"}},{name:"Vibrant Energy",theme:{primaryColor:"#FF6B00",secondaryColor:"#FFB800",backgroundColor:"#ffffff",blockBackgroundColor:"#fff7ed",fontFamily:"Poppins",headlineColor:"#1a1a1a",subheadlineColor:"#666666",buttonStyle:"pill"}},{name:"Professional",theme:{primaryColor:"#1E3A8A",secondaryColor:"#64748B",backgroundColor:"#ffffff",blockBackgroundColor:"#f8fafc",fontFamily:"Roboto",headlineColor:"#1a1a1a",subheadlineColor:"#475569",buttonStyle:"rounded"}},{name:"Elegant",theme:{primaryColor:"#B8860B",secondaryColor:"#FFF8DC",backgroundColor:"#FFFEF9",blockBackgroundColor:"#faf8f3",fontFamily:"Playfair Display",headlineColor:"#2d2d2d",subheadlineColor:"#6b6b6b",buttonStyle:"sharp"}},{name:"Minimal",theme:{primaryColor:"#000000",secondaryColor:"#f5f5f5",backgroundColor:"#ffffff",blockBackgroundColor:"#fafafa",fontFamily:"Inter",headlineColor:"#000000",subheadlineColor:"#666666",buttonStyle:"sharp"}},{name:"Nature",theme:{primaryColor:"#22C55E",secondaryColor:"#14B8A6",backgroundColor:"#ffffff",blockBackgroundColor:"#f0fdf4",fontFamily:"Montserrat",headlineColor:"#1a1a1a",subheadlineColor:"#4b5563",buttonStyle:"rounded"}}],Xs=({onApply:s})=>{const{t}=z("salesPages");return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-2",children:t("editor.presets.title")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t("editor.presets.description")})]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4",children:Js.map(r=>e.jsxs("button",{onClick:()=>s(r.theme),className:"p-4 border rounded-lg hover:shadow-md transition-shadow text-left group",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx("div",{className:"w-6 h-6 rounded-full",style:{backgroundColor:r.theme.primaryColor}}),e.jsx("div",{className:"w-6 h-6 rounded-full",style:{backgroundColor:r.theme.secondaryColor}})]}),e.jsx("h4",{className:"font-semibold text-sm mb-1",children:r.name}),e.jsx("p",{className:"text-xs text-muted-foreground",children:r.theme.fontFamily})]},r.name))})]})},Zs=[{value:"utm_source",label:"utm_source - Traffic source (e.g., facebook, google)"},{value:"utm_medium",label:"utm_medium - Marketing medium (e.g., cpc, email)"},{value:"utm_campaign",label:"utm_campaign - Campaign name"},{value:"utm_term",label:"utm_term - Paid keywords"},{value:"utm_content",label:"utm_content - Ad content/variation"}],ea=[{value:"_",label:"Underscore (_)"},{value:"-",label:"Hyphen (-)"},{value:"|",label:"Pipe (|)"},{value:"none",label:"No separator"}],sa=({salesPage:s,onChange:t})=>{const r=s.utm_tracking||!1,d=s.utm_parameter_name||"sck",c=s.utm_tracked_params||["utm_source","utm_campaign","utm_medium"],a=s.utm_separator||"_",l=s.utm_params_order||["utm_source","utm_campaign","utm_medium"],n=js({enabled:r,parameterName:d,trackedParams:c,separator:a,paramsOrder:l}),m=n.length,j=m>100,p=f=>{t({utm_tracking:f})},u=f=>{t({utm_parameter_name:f})},h=(f,R)=>{let F=[...c],P=[...l];R?(F.includes(f)||F.push(f),P.includes(f)||P.push(f)):(F=F.filter(A=>A!==f),P=P.filter(A=>A!==f)),t({utm_tracked_params:F,utm_params_order:P})},v=f=>{t({utm_separator:f})},y=(f,R)=>{const F=l.indexOf(f);if(F===-1)return;const P=[...l],A=R==="up"?F-1:F+1;A<0||A>=P.length||([P[F],P[A]]=[P[A],P[F]],t({utm_params_order:P}))};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(i,{children:"Enable UTM Tracking"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Automatically append UTM parameters from the URL to CTA links"})]}),e.jsx(U,{checked:r,onCheckedChange:p})]}),r&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"utm-param-name",children:"Parameter Name"}),e.jsx(o,{id:"utm-param-name",value:d,onChange:f=>u(f.target.value),placeholder:"sck",className:"max-w-xs"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:'Custom parameter name for the consolidated UTM string (e.g., "sck", "src", "ref")'})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(i,{children:"Parameters to Track"}),e.jsx("div",{className:"space-y-2",children:Zs.map(f=>e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(ps,{id:f.value,checked:c.includes(f.value),onCheckedChange:R=>h(f.value,R)}),e.jsx("label",{htmlFor:f.value,className:"text-sm font-normal leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:f.label})]},f.value))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{htmlFor:"utm-separator",children:"Separator"}),e.jsxs(b,{value:a,onValueChange:v,children:[e.jsx(C,{id:"utm-separator",className:"max-w-xs",children:e.jsx(w,{})}),e.jsx(S,{children:ea.map(f=>e.jsx(x,{value:f.value,children:f.label},f.value))})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Character used to separate UTM values"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(i,{children:"Parameter Order"}),e.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:"Reorder parameters by clicking the arrows"}),e.jsx("div",{className:"space-y-1",children:l.map((f,R)=>e.jsxs("div",{className:"flex items-center justify-between bg-muted/50 p-2 rounded",children:[e.jsx("span",{className:"text-sm",children:f}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx("button",{type:"button",onClick:()=>y(f,"up"),disabled:R===0,className:"p-1 text-xs hover:bg-muted rounded disabled:opacity-30",children:"â"}),e.jsx("button",{type:"button",onClick:()=>y(f,"down"),disabled:R===l.length-1,className:"p-1 text-xs hover:bg-muted rounded disabled:opacity-30",children:"â"})]})]},f))})]}),e.jsxs("div",{className:"p-4 bg-muted/30 rounded-lg space-y-2",children:[e.jsx(i,{children:"Preview"}),e.jsx("code",{className:"block text-xs bg-background p-2 rounded border break-all",children:n}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Example URL with your configuration (",m," characters)"]}),j&&e.jsxs("div",{className:"flex items-start gap-2 text-xs text-amber-600 dar
1k:text-amber-500",children:[e.jsx(as,{className:"w-4 h-4 mt-0.5 flex-shrink-0"}),e.jsx("p",{children:"Long UTM strings may exceed URL length limits in some platforms. Consider tracking fewer parameters."})]})]})]})]})},aa=s=>s.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-z0-9\s-]/g,"").trim().replace(/\s+/g,"-").replace(/-+/g,"-"),ta=({salesPage:s,onChange:t})=>{var c,a;const{t:r}=z("salesPages"),d=l=>{const n=aa(l);t({name:l,slug:n})};return e.jsxs("div",{className:"space-y-8",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold mb-4",children:r("editor.settings.generalSettings")}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(i,{htmlFor:"name",children:r("editor.settings.pageName")}),e.jsx(o,{id:"name",value:s.name,onChange:l=>d(l.target.value)})]}),e.jsxs("div",{children:[e.jsx(i,{htmlFor:"slug",children:r("editor.settings.urlSlug")}),e.jsx(o,{id:"slug",value:s.slug,onChange:l=>t({slug:l.target.value}),placeholder:r("editor.settings.urlSlugPlaceholder")}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:r("editor.settings.urlSlugHint")})]}),e.jsxs("div",{children:[e.jsx(i,{htmlFor:"description",children:r("editor.settings.description")}),e.jsx(T,{id:"description",value:s.description||"",onChange:l=>t({description:l.target.value}),rows:3})]}),e.jsxs("div",{children:[e.jsx(i,{htmlFor:"status",children:r("editor.settings.status")}),e.jsxs(b,{value:s.status,onValueChange:l=>t({status:l}),children:[e.jsx(C,{id:"status",children:e.jsx(w,{})}),e.jsxs(S,{children:[e.jsx(x,{value:"draft",children:r("editor.settings.draft")}),e.jsx(x,{value:"published",children:r("editor.settings.published")})]})]})]})]})]}),e.jsx(k,{}),e.jsxs(O,{defaultOpen:!0,children:[e.jsxs(L,{className:"flex items-center justify-between w-full group",children:[e.jsxs("div",{className:"text-left",children:[e.jsx("h3",{className:"text-lg font-semibold mb-2",children:r("editor.settings.designTheme")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:r("editor.settings.designThemeDesc")})]}),e.jsx(B,{className:"h-5 w-5 flex-shrink-0 transition-transform group-data-[state=open]:rotate-180"})]}),e.jsxs(E,{className:"space-y-6 pt-4",children:[e.jsx(Xs,{onApply:l=>t({theme:l})}),e.jsx(k,{className:"my-6"}),e.jsx(Ys,{theme:s.theme,onChange:l=>t({theme:{...s.theme,...l}})})]})]}),e.jsx(k,{}),e.jsxs(O,{children:[e.jsxs(L,{className:"flex items-center justify-between w-full group",children:[e.jsxs("div",{className:"text-left",children:[e.jsx("h3",{className:"text-lg font-semibold mb-2",children:r("editor.settings.footerLinks")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:r("editor.settings.footerLinksDesc")})]}),e.jsx(B,{className:"h-5 w-5 flex-shrink-0 transition-transform group-data-[state=open]:rotate-180"})]}),e.jsx(E,{className:"pt-4",children:e.jsx(xs,{links:s.footer_links||[],onLinksChange:l=>t({footer_links:l})})})]}),e.jsx(k,{}),e.jsxs(O,{children:[e.jsxs(L,{className:"flex items-center justify-between w-full group",children:[e.jsxs("div",{className:"text-left",children:[e.jsx("h3",{className:"text-lg font-semibold mb-2",children:r("editor.settings.advancedSettings")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:r("editor.settings.advancedSettingsDesc")})]}),e.jsx(B,{className:"h-5 w-5 flex-shrink-0 transition-transform group-data-[state=open]:rotate-180"})]}),e.jsxs(E,{className:"pt-4 space-y-6",children:[e.jsx("div",{children:e.jsxs(O,{children:[e.jsxs(L,{className:"flex items-center justify-between w-full group",children:[e.jsxs("div",{className:"text-left",children:[e.jsx("h4",{className:"text-base font-semibold mb-1",children:r("editor.settings.trackingSettings")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:r("editor.settings.trackingSettingsDesc")})]}),e.jsx(B,{className:"h-4 w-4 flex-shrink-0 transition-transform group-data-[state=open]:rotate-180"})]}),e.jsx(E,{className:"pt-4",children:e.jsx(hs,{facebookPixelId:s.facebook_pixel_id||"",setFacebookPixelId:l=>t({facebook_pixel_id:l}),googleAnalyticsId:s.google_analytics_id||"",setGoogleAnalyticsId:l=>t({google_analytics_id:l}),googleTagManagerId:s.google_tag_manager_id||"",setGoogleTagManagerId:l=>t({google_tag_manager_id:l})})})]})}),e.jsx(k,{}),e.jsx("div",{children:e.jsxs(O,{children:[e.jsxs(L,{className:"flex items-center justify-between w-full group",children:[e.jsxs("div",{className:"text-left",children:[e.jsx("h4",{className:"text-base font-semibold mb-1",children:r("editor.settings.utmTracking")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:r("editor.settings.utmTrackingDesc")})]}),e.jsx(B,{className:"h-4 w-4 flex-shrink-0 transition-transform group-data-[state=open]:rotate-180"})]}),e.jsx(E,{className:"pt-4",children:e.jsx(sa,{salesPage:s,onChange:t})})]})}),e.jsx(k,{}),e.jsx("div",{children:e.jsxs(O,{children:[e.jsxs(L,{className:"flex items-center justify-between w-full group",children:[e.jsxs("div",{className:"text-left",children:[e.jsx("h4",{className:"text-base font-semibold mb-1",children:r("editor.settings.customScripts")}),e.jsx("p",{className:"text-sm text-muted-foreground",children:r("editor.settings.customScriptsDesc")})]}),e.jsx(B,{className:"h-4 w-4 flex-shrink-0 transition-transform group-data-[state=open]:rotate-180"})]}),e.jsx(E,{className:"pt-4",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(i,{htmlFor:"headScripts",children:r("editor.settings.headScripts")}),e.jsx(T,{id:"headScripts",value:((c=s.custom_scripts)==null?void 0:c.head)||"",onChange:l=>t({custom_scripts:{...s.custom_scripts,head:l.target.value}}),rows:6,placeholder:`<!-- Scripts to be inserted in <head> --> 2<script> 3 // Your code here 4<\/script>`,className:"font-mono text-xs"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:r("editor.settings.headScriptsHint")})]}),e.jsxs("div",{children:[e.jsx(i,{htmlFor:"bodyScripts",children:r("editor.settings.bodyScripts")}),e.jsx(T,{id:"bodyScripts",value:((a=s.custom_scripts)==null?void 0:a.body)||"",onChange:l=>t({custom_scripts:{...s.custom_scripts,body:l.target.value}}),rows:6,placeholder:`<!-- Scripts to be inserted before </body> --> 5<script> 6 // Your code here 7<\/script>`,className:"font-mono text-xs"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:r("editor.settings.bodyScriptsHint")})]})]})})]})})]})]})]})},la=({salesPage:s,onSave:t})=>{const{t:r}=z("salesPages"),[d,c]=N.useState(s);ze.useEffect(()=>{c(s)},[s.id,s.updated_at]);const a=n=>{const m={...d,blocks:n};c(m),t(m)},l=n=>{const m={...d,...n};c(m),t(m)};return e.jsx("div",{className:"h-full",children:e.jsxs(me,{defaultValue:"blocks",className:"h-full flex flex-col",children:[e.jsxs(ue,{className:"w-full justify-start rounded-none border-b",children:[e.jsx(q,{value:"blocks",children:r("editor.tabs.blocks")}),e.jsx(q,{value:"settings",children:r("editor.tabs.settings")})]}),e.jsxs(Y,{className:"flex-1",children:[e.jsx(K,{value:"blocks",className:"m-0 p-4",children:e.jsx(Qs,{blocks:d.blocks,onChange:a})}),e.jsx(K,{value:"settings",className:"m-0 p-4",children:e.jsx(ta,{salesPage:d,onChange:l})})]})]})})},Ua=()=>{const{pageId:s}=De(),t=Be(),{toast:r}=We(),d=Re(),{t:c}=z(["salesPages","common"]),[a,l]=N.useState(null),{data:n,isLoading:m}=Q({queryKey:["sales-page",s],queryFn:async()=>{const{data:h,error:v}=await M.from("sales_pages").select("*").eq("id",s).single();if(v)throw v;const{data:y}
7=await M.from("profiles").select("user_code").eq("id",h.user_id).single();return{...h,user_code:(y==null?void 0:y.user_code)||"",blocks:h.blocks||[],theme:h.theme||{primaryColor:"#7E69AB",secondaryColor:"#9b87f5",fontFamily:"Inter",backgroundColor:"#ffffff"},custom_scripts:h.custom_scripts||{head:"",body:""}}},enabled:!!s}),j=ke({mutationFn:async h=>{var A;const v=(A=h.blocks)==null?void 0:A.map(_e=>{const{ctaType:ra,...Ae}=_e;return Ae}),y={...h,blocks:v||h.blocks,utm_tracking:h.utm_tracking,utm_parameter_name:h.utm_parameter_name,utm_tracked_params:h.utm_tracked_params,utm_separator:h.utm_separator,utm_params_order:h.utm_params_order,custom_scripts:h.custom_scripts},{user_code:f,...R}=y,{data:F,error:P}=await M.from("sales_pages").update(R).eq("id",s).select().single();if(P)throw P;return{...F,blocks:F.blocks||[],theme:F.theme||h.theme,custom_scripts:F.custom_scripts||h.custom_scripts,footer_links:F.footer_links||[]}},onSuccess:()=>{d.invalidateQueries({queryKey:["sales-page",s]}),d.invalidateQueries({queryKey:["sales-pages"]}),r({title:c("common:success"),description:c("details.saveSuccess")})},onError:()=>{r({title:c("common:error"),description:c("details.saveError"),variant:"destructive"})}}),p=h=>{j.mutate(h)};if(m)return e.jsx("div",{className:"flex items-center justify-center h-screen",children:e.jsx("p",{children:c("common:loading")})});if(!n)return e.jsx("div",{className:"flex items-center justify-center min-h-screen",children:e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"text-2xl font-bold mb-2",children:c("details.notFound")}),e.jsx(g,{onClick:()=>t("/sales-pages"),children:c("backToList")})]})});const u=`${window.location.origin}/${n.user_code}/sales/${n.slug}`;return e.jsxs("div",{className:"container mx-auto py-8 px-4 max-w-6xl",children:[e.jsxs("div",{className:"mb-8",children:[e.jsxs(g,{variant:"ghost",onClick:()=>t("/sales-pages"),className:"mb-4",children:[e.jsx(ts,{className:"w-4 h-4 mr-2"}),c("backToList")]}),e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold mb-2",children:n.name}),e.jsx("p",{className:"text-muted-foreground",children:c("details.subtitle")})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(g,{variant:"outline",onClick:()=>t(`/sales-pages/${s}/statistics`),children:c("actions.viewStats")}),e.jsxs(g,{variant:"outline",onClick:()=>window.open(u,"_blank"),children:[e.jsx(ls,{className:"w-4 h-4 mr-2"}),c("viewPage")]}),e.jsx(g,{onClick:()=>p(a||n),disabled:j.isPending,children:j.isPending?c("common:saving"):c("saveChanges")})]})]})]}),e.jsx("div",{className:"space-y-8",children:e.jsx(la,{salesPage:n,onSave:h=>{l(h)}})})]})};export{Ua 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.