@bailierich/booking-components 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- 'use strict';var jsxRuntime=require('react/jsx-runtime'),lucideReact=require('lucide-react'),Ge=require('react'),framerMotion=require('framer-motion'),supabaseJs=require('@supabase/supabase-js'),reactDom=require('react-dom');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Ge__default=/*#__PURE__*/_interopDefault(Ge);function tn({logoUrl:e,fallbackText:t,size:r="medium",alignment:a="center",colors:o,enableInlineEditing:i=false,sectionId:n=""}){let l={small:80,medium:120,large:160}[r];return jsxRuntime.jsx("div",{className:`container mx-auto px-4 flex ${a==="center"?"justify-center":a==="right"?"justify-end":"justify-start"}`,children:e?jsxRuntime.jsx("img",{src:e,alt:t||"Logo",className:"object-contain",style:{height:`${l}px`,width:"auto"}}):t?jsxRuntime.jsx("div",{className:"flex items-center justify-center rounded-full font-bold",style:{width:`${l}px`,height:`${l}px`,backgroundColor:o.primary,color:"#FFFFFF",fontSize:`${l*.4}px`},children:t.slice(0,2).toUpperCase()}):jsxRuntime.jsx("div",{className:"rounded-full",style:{width:`${l}px`,height:`${l}px`,backgroundColor:o.primary,opacity:.2}})})}function nn({name:e,title:t,bio:r,showName:a=true,showTitle:o=true,showBio:i=true,colors:n,typography:s,enableInlineEditing:l=false,sectionId:c=""}){return jsxRuntime.jsxs("div",{className:"container mx-auto px-4 text-center",children:[a&&jsxRuntime.jsx("h1",{className:"text-4xl font-bold mb-3",style:{fontFamily:s.headingFont,color:n.text},...l&&{"data-editable":true,"data-section-id":c,"data-field-path":"settings.name"},children:e||"Your Name"}),o&&jsxRuntime.jsx("p",{className:"text-lg opacity-80 mb-2",...l&&{"data-editable":true,"data-section-id":c,"data-field-path":"settings.title"},children:t||"Beauty Professional"}),i&&jsxRuntime.jsx("p",{className:"text-base opacity-70 max-w-md mx-auto",...l&&{"data-editable":true,"data-section-id":c,"data-field-path":"settings.bio"},children:r||"Transform your look \u2728"})]})}function on({text:e,url:t,style:r="gradient",size:a="large",colors:o,enableInlineEditing:i=false,sectionId:n=""}){let s=()=>{let c="";switch(a){case "small":c="p-3 text-base";break;case "medium":c="p-4 text-lg";break;case "large":c="p-5 text-xl";break;default:c="p-5 text-xl";}let d="";switch(r){case "gradient":d="rounded-full";break;case "solid":d="rounded-lg";break;case "outline":d="rounded-full border-2";break;default:d="rounded-full";}return `block max-w-2xl mx-auto ${c} ${d} text-center font-semibold transition-all hover:scale-105 hover:shadow-xl`},l=()=>{switch(r){case "gradient":return {background:`linear-gradient(135deg, ${o.primary} 0%, ${o.secondary} 100%)`,color:"#FFFFFF"};case "solid":return {backgroundColor:o.primary,color:"#FFFFFF"};case "outline":return {backgroundColor:"transparent",borderColor:o.primary,color:o.primary};default:return {backgroundColor:o.primary,color:"#FFFFFF"}}};return jsxRuntime.jsx("div",{className:"container mx-auto px-4",children:jsxRuntime.jsx("a",{href:t||"/book",className:s(),style:l(),...i&&{"data-editable":true,"data-section-id":n,"data-field-path":"settings.text"},children:e||"\u{1F485} Book Now"})})}function sn({links:e,style:t="pill",colors:r,enableInlineEditing:a=false,sectionId:o=""}){let i=()=>{let s="block w-full p-4 text-center font-medium transition-all hover:scale-105";switch(t){case "pill":return `${s} rounded-full`;case "square":return `${s} rounded-md`;case "outline":return `${s} rounded-full border-2`;default:return `${s} rounded-lg`}},n=s=>s?{backgroundColor:"transparent",borderColor:r.primary,color:r.primary}:{backgroundColor:r.linkBackground||r.primary,color:r.linkText||"#FFFFFF"};return jsxRuntime.jsx("div",{className:"container mx-auto px-4",children:jsxRuntime.jsx("div",{className:"max-w-2xl mx-auto space-y-3",children:e.map((s,l)=>jsxRuntime.jsx("a",{href:s.url,target:"_blank",rel:"noopener noreferrer",className:i(),style:n(t==="outline"),...a&&{"data-editable":true,"data-section-id":o,"data-field-path":`settings.links.${l}.label`},children:s.label},s.id))})})}function ln({platforms:e,socialLinks:t={},style:r="filled",size:a="large",position:o="center",invertIcons:i=false,colors:n,enableInlineEditing:s=false,sectionId:l=""}){let c=p=>{let b=p.replace("#",""),w=parseInt(b.substr(0,2),16),N=parseInt(b.substr(2,2),16),g=parseInt(b.substr(4,2),16);return (.299*w+.587*N+.114*g)/255>.5?"#000000":"#FFFFFF"},d=p=>{let b=a==="small"?20:a==="medium"?24:28;switch(p){case "instagram":return jsxRuntime.jsx(lucideReact.Instagram,{size:b});case "facebook":return jsxRuntime.jsx(lucideReact.Facebook,{size:b});case "tiktok":return jsxRuntime.jsx(lucideReact.Music,{size:b});case "twitter":return jsxRuntime.jsx(lucideReact.Twitter,{size:b});case "youtube":return jsxRuntime.jsx(lucideReact.Youtube,{size:b});case "pinterest":return jsxRuntime.jsx(lucideReact.PinIcon,{size:b});default:return jsxRuntime.jsx(lucideReact.Instagram,{size:b})}},u=()=>{let p="";switch(a){case "small":p="w-10 h-10 text-lg";break;case "medium":p="w-12 h-12 text-xl";break;case "large":p="w-14 h-14 text-2xl";break;default:p="w-14 h-14 text-2xl";}let b="";switch(r){case "filled":b="rounded-full";break;case "outline":b="rounded-full border-2";break;case "ghost":b="rounded-full";break;default:b="rounded-full";}return `${p} ${b} flex items-center justify-center hover:scale-110 transition-transform`},m=()=>{switch(r){case "filled":return {backgroundColor:n.primary,color:c(n.primary||"#BCB4FF")};case "outline":return {backgroundColor:"transparent",borderColor:n.primary,color:n.primary};case "ghost":return {backgroundColor:"rgba(0,0,0,0.05)",color:n.primary};default:return {backgroundColor:n.primary,color:c(n.primary||"#BCB4FF")}}};return o==="left-vertical"||o==="right-vertical"?jsxRuntime.jsx("div",{className:`fixed top-6 z-40 flex flex-col gap-3 ${o==="left-vertical"?"left-4":"right-4"}`,children:e.map(p=>{let b=t[p]||`https://${p}.com/`;return jsxRuntime.jsx("a",{href:b,target:"_blank",rel:"noopener noreferrer",className:u(),style:{...m(),filter:i?"invert(1)":"none"},title:p.charAt(0).toUpperCase()+p.slice(1),children:d(p)},p)})}):jsxRuntime.jsx("div",{className:"container mx-auto px-4 py-8 text-center",children:jsxRuntime.jsx("div",{className:"flex items-center justify-center gap-4",children:e.map(p=>{let b=t[p]||`https://${p}.com/`;return jsxRuntime.jsx("a",{href:b,target:"_blank",rel:"noopener noreferrer",className:u(),style:{...m(),filter:i?"invert(1)":"none"},title:p.charAt(0).toUpperCase()+p.slice(1),children:d(p)},p)})})})}function cn({headline:e,subheadline:t,heroImage:r,ctaButton:a,layout:o="split",imagePosition:i="right",contentDisplay:n="side",colors:s,typography:l,enableInlineEditing:c=false,sectionId:d=""}){let u=jsxRuntime.jsxs("div",{className:o==="full"?"text-center max-w-4xl z-10":"text-left",children:[jsxRuntime.jsx("h1",{className:o==="full"?"text-5xl md:text-6xl font-bold mb-6":"text-5xl font-bold mb-4",style:{fontFamily:l.headingFont,color:o==="full"&&r?"#FFFFFF":s.text,textShadow:o==="full"&&r?"0 2px 10px rgba(0,0,0,0.3)":"none"},...c&&{"data-editable":true,"data-section-id":d,"data-field-path":"settings.headline"},children:e||"Welcome"}),t&&jsxRuntime.jsx("p",{className:o==="full"?"text-xl md:text-2xl opacity-90 mb-12":"text-xl opacity-80 mb-8",style:{color:o==="full"&&r?"#FFFFFF":s.text,textShadow:o==="full"&&r?"0 2px 10px rgba(0,0,0,0.3)":"none"},...c&&{"data-editable":true,"data-section-id":d,"data-field-path":"settings.subheadline"},children:t}),a&&jsxRuntime.jsx("a",{href:a.url||"#",className:"inline-block px-8 py-4 rounded-lg font-semibold text-lg transition-all hover:scale-105 shadow-lg",style:{backgroundColor:s.primary,color:"#FFFFFF"},...c&&{"data-editable":true,"data-section-id":d,"data-field-path":"settings.ctaButton.text"},children:a.text||"Get Started"})]}),m=r?jsxRuntime.jsx("div",{className:"w-full h-full rounded-2xl overflow-hidden",children:jsxRuntime.jsx("img",{src:r,alt:e||"Hero",className:"w-full h-full object-cover"})}):jsxRuntime.jsx("div",{className:"w-full h-full rounded-2xl flex items-center justify-center",style:{backgroundColor:s.primary,opacity:.1},children:jsxRuntime.jsx("span",{className:"text-sm opacity-50",children:"Add hero image"})});return o==="full"?jsxRuntime.jsxs("div",{className:"relative py-20 md:py-24 px-4 flex items-center justify-center",style:{backgroundImage:r?`url(${r})`:"none",backgroundSize:"cover",backgroundPosition:"center",backgroundColor:r?"transparent":s.primary,opacity:r?1:.1},children:[r&&jsxRuntime.jsx("div",{className:"absolute inset-0 bg-black/40"}),u]}):n==="overlay"?jsxRuntime.jsx("div",{className:"container mx-auto px-4 py-16",children:jsxRuntime.jsxs("div",{className:"relative max-w-6xl mx-auto rounded-2xl overflow-hidden",style:{height:"500px"},children:[r?jsxRuntime.jsx("img",{src:r,alt:e||"Hero",className:"absolute inset-0 w-full h-full object-cover"}):jsxRuntime.jsx("div",{className:"absolute inset-0",style:{backgroundColor:s.primary,opacity:.1}}),jsxRuntime.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-black/60 to-black/20"}),jsxRuntime.jsx("div",{className:`relative h-full flex items-center ${i==="left"?"justify-end":"justify-start"} px-12`,children:jsxRuntime.jsx("div",{className:"max-w-lg",style:{color:"#FFFFFF",textShadow:"0 2px 10px rgba(0,0,0,0.3)"},children:u})})]})}):jsxRuntime.jsx("div",{className:"container mx-auto px-4 py-16",children:jsxRuntime.jsxs("div",{className:"grid md:grid-cols-2 gap-12 items-center max-w-6xl mx-auto",children:[i==="left"&&jsxRuntime.jsx("div",{className:"aspect-[4/3]",children:m}),jsxRuntime.jsx("div",{children:u}),i==="right"&&jsxRuntime.jsx("div",{className:"aspect-[4/3]",children:m})]})})}function dn({title:e,content:t,image:r,layout:a="centered",colors:o,typography:i,enableInlineEditing:n=false,sectionId:s=""}){return a==="centered"?jsxRuntime.jsx("div",{className:"container mx-auto px-4 py-16",children:jsxRuntime.jsxs("div",{className:"max-w-3xl mx-auto text-center",children:[jsxRuntime.jsx("h2",{className:"text-3xl font-bold mb-6",style:{fontFamily:i.headingFont,color:o.text},...n&&{"data-editable":true,"data-section-id":s,"data-field-path":"settings.title"},children:e||"About Us"}),jsxRuntime.jsx("p",{className:"text-lg opacity-80",...n&&{"data-editable":true,"data-section-id":s,"data-field-path":"settings.content"},children:t||"Tell your story here..."})]})}):a==="split"?jsxRuntime.jsx("div",{className:"container mx-auto px-4 py-16",children:jsxRuntime.jsxs("div",{className:"max-w-6xl mx-auto grid md:grid-cols-2 gap-12 items-center",children:[jsxRuntime.jsx("div",{className:"aspect-square rounded-2xl overflow-hidden",children:r?jsxRuntime.jsx("img",{src:r,alt:e||"About",className:"w-full h-full object-cover"}):jsxRuntime.jsx("div",{className:"w-full h-full flex items-center justify-center",style:{backgroundColor:o.primary,opacity:.2},children:jsxRuntime.jsx("span",{className:"text-sm opacity-50",children:"Add image"})})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:"text-3xl font-bold mb-6",style:{fontFamily:i.headingFont,color:o.text},...n&&{"data-editable":true,"data-section-id":s,"data-field-path":"settings.title"},children:e||"About Us"}),jsxRuntime.jsx("p",{className:"text-lg opacity-80 leading-relaxed",...n&&{"data-editable":true,"data-section-id":s,"data-field-path":"settings.content"},children:t||"Tell your story here..."})]})]})}):jsxRuntime.jsx("div",{className:"container mx-auto px-4 py-16",children:jsxRuntime.jsxs("div",{className:"max-w-7xl mx-auto",children:[jsxRuntime.jsx("h2",{className:"text-4xl font-bold mb-8 text-left",style:{fontFamily:i.headingFont,color:o.text},...n&&{"data-editable":true,"data-section-id":s,"data-field-path":"settings.title"},children:e||"About Us"}),jsxRuntime.jsx("p",{className:"text-xl opacity-80 leading-relaxed columns-2 gap-12",...n&&{"data-editable":true,"data-section-id":s,"data-field-path":"settings.content"},children:t||"Tell your story here..."})]})})}function un({title:e,services:t=[],layout:r="grid",columns:a=3,showPrices:o=true,showDuration:i=true,colors:n,typography:s,enableInlineEditing:l=false,sectionId:c=""}){let d={2:"grid-cols-1 md:grid-cols-2",3:"grid-cols-1 md:grid-cols-3",4:"grid-cols-1 md:grid-cols-2 lg:grid-cols-4"},u=t.length>0?t:[{id:1,name:"Haircut & Style",description:"Professional cut and styling",price:75,duration:60},{id:2,name:"Color Treatment",description:"Full color or highlights",price:150,duration:120},{id:3,name:"Deep Conditioning",description:"Restorative treatment",price:50,duration:45}],m=()=>{switch(r){case "grid":return `grid ${d[a]} gap-8`;case "list":return "flex flex-col gap-4 max-w-3xl mx-auto";case "carousel":return "flex overflow-x-auto snap-x gap-6 pb-4";default:return `grid ${d[a]} gap-8`}};return jsxRuntime.jsx("section",{className:"py-16 px-6",children:jsxRuntime.jsxs("div",{className:"max-w-7xl mx-auto",children:[jsxRuntime.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-center mb-12",style:{fontFamily:s.headingFont,color:n.text},...l&&{"data-editable":true,"data-section-id":c,"data-field-path":"settings.title"},children:e||"Our Services"}),jsxRuntime.jsx("div",{className:m(),children:u.map(p=>jsxRuntime.jsxs("div",{className:`p-6 rounded-lg border hover:scale-105 transition-transform shadow-lg ${r==="carousel"?"snap-center flex-shrink-0 w-80":""} ${r==="list"?"flex items-center gap-6":""}`,style:{backgroundColor:"rgba(255, 255, 255, 0.95)",borderColor:`${n.primary}20`},children:[r==="list"&&jsxRuntime.jsx("div",{className:"flex-shrink-0 w-24 h-24 rounded-lg",style:{backgroundColor:n.primary,opacity:.2}}),jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx("h3",{className:"text-xl font-semibold mb-3",style:{color:"#1a1a1a"},children:p.name}),jsxRuntime.jsx("p",{className:"text-sm opacity-80 mb-4",style:{color:"#333333"},children:p.description}),jsxRuntime.jsxs("div",{className:`flex ${r==="list"?"gap-4":"justify-between"} items-center`,children:[o&&jsxRuntime.jsxs("p",{className:"font-bold text-lg",style:{color:n.primary},children:["$",p.price]}),i&&jsxRuntime.jsxs("p",{className:"text-sm opacity-70",style:{color:"#666666"},children:[p.duration," min"]})]})]})]},p.id))})]})})}function mn({title:e,images:t=[],columns:r=3,colors:a,typography:o,enableInlineEditing:i=false,sectionId:n=""}){let s={2:"grid-cols-2",3:"grid-cols-2 md:grid-cols-3",4:"grid-cols-2 md:grid-cols-4"},l=t.length>0?t:[1,2,3,4,5,6].map(c=>({id:c,url:void 0}));return jsxRuntime.jsx("section",{className:"py-16 px-6",children:jsxRuntime.jsxs("div",{className:"max-w-7xl mx-auto",children:[jsxRuntime.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-center mb-12",style:{fontFamily:o.headingFont,color:a.text},...i&&{"data-editable":true,"data-section-id":n,"data-field-path":"settings.title"},children:e||"Gallery"}),jsxRuntime.jsx("div",{className:`grid ${s[r]} gap-4`,children:l.map((c,d)=>jsxRuntime.jsx("div",{className:"relative aspect-square overflow-hidden rounded-lg group",children:c.url?jsxRuntime.jsx("img",{src:c.url,alt:c.alt||"",className:"w-full h-full object-cover transition-transform group-hover:scale-110"}):jsxRuntime.jsx("div",{className:"w-full h-full flex items-center justify-center transition-transform group-hover:scale-110",style:{backgroundColor:a.primary,opacity:.2},children:jsxRuntime.jsx("span",{className:"text-sm opacity-50",children:"Add image"})})},c.id||d))})]})})}function gn({title:e,testimonials:t=[],layout:r="grid",colors:a,typography:o,enableInlineEditing:i=false,sectionId:n=""}){let s=r==="carousel"?"flex overflow-x-auto snap-x gap-6 pb-4":"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",l=t.length>0?t:[{id:1,text:"Amazing service! I love my new look.",author:"Sarah M.",rating:5},{id:2,text:"Professional and friendly staff.",author:"Jessica L.",rating:5},{id:3,text:"Best salon in town!",author:"Emily R.",rating:5}];return jsxRuntime.jsx("section",{className:"py-16 px-6",children:jsxRuntime.jsxs("div",{className:"max-w-7xl mx-auto",children:[jsxRuntime.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-center mb-12",style:{fontFamily:o.headingFont,color:a.text},...i&&{"data-editable":true,"data-section-id":n,"data-field-path":"settings.title"},children:e||"What Our Clients Say"}),jsxRuntime.jsx("div",{className:s,children:l.map(c=>jsxRuntime.jsxs("div",{className:`p-6 rounded-lg bg-white/10 backdrop-blur-sm ${r==="carousel"?"snap-center flex-shrink-0 w-80":""}`,children:[jsxRuntime.jsx("div",{className:"flex gap-1 mb-4",children:[...Array(5)].map((d,u)=>jsxRuntime.jsx("svg",{className:"w-5 h-5",fill:u<c.rating?a.primary||"#8B5CF6":"#E5E7EB",viewBox:"0 0 20 20",children:jsxRuntime.jsx("path",{d:"M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"})},u))}),jsxRuntime.jsxs("p",{className:"mb-4 italic",style:{color:a.text},children:['"',c.text,'"']}),jsxRuntime.jsx("p",{className:"font-semibold",style:{color:a.text},children:c.author})]},c.id))})]})})}function fn({title:e,members:t=[],colors:r,typography:a,enableInlineEditing:o=false,sectionId:i=""}){let n=t.length>0?t:[{id:1,name:"Sarah Johnson",role:"Master Stylist",bio:"Expert in color and styling with 10+ years experience"},{id:2,name:"Michael Chen",role:"Senior Stylist",bio:"Specializing in precision cuts and modern styles"},{id:3,name:"Emma Davis",role:"Stylist",bio:"Passionate about creating beautiful transformations"}];return jsxRuntime.jsx("section",{className:"py-16 px-6",children:jsxRuntime.jsxs("div",{className:"max-w-7xl mx-auto",children:[jsxRuntime.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-center mb-12",style:{fontFamily:a.headingFont,color:r.text},...o&&{"data-editable":true,"data-section-id":i,"data-field-path":"settings.title"},children:e||"Meet Our Team"}),jsxRuntime.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:n.map(s=>jsxRuntime.jsxs("div",{className:"text-center",children:[jsxRuntime.jsx("div",{className:"w-32 h-32 rounded-full mx-auto mb-4",style:{backgroundColor:r.primary,opacity:.2}}),jsxRuntime.jsx("h3",{className:"text-xl font-semibold mb-2",style:{color:r.text},children:s.name}),jsxRuntime.jsx("p",{className:"text-sm mb-3",style:{color:r.primary},children:s.role}),jsxRuntime.jsx("p",{className:"text-sm opacity-80",style:{color:r.text},children:s.bio})]},s.id))})]})})}function yn({title:e,email:t="contact@example.com",phone:r="(555) 123-4567",address:a="123 Main Street, City, State 12345",showForm:o=true,colors:i,typography:n,enableInlineEditing:s=false,sectionId:l=""}){return jsxRuntime.jsx("section",{className:"py-16 px-6",children:jsxRuntime.jsxs("div",{className:"max-w-7xl mx-auto",children:[jsxRuntime.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-center mb-12",style:{fontFamily:n.headingFont,color:i.text},...s&&{"data-editable":true,"data-section-id":l,"data-field-path":"settings.title"},children:e||"Get In Touch"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-12",children:[jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-4",children:[jsxRuntime.jsx("svg",{className:"w-6 h-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",style:{color:i.primary},children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})}),jsxRuntime.jsx("span",{style:{color:i.text},children:t})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-4",children:[jsxRuntime.jsx("svg",{className:"w-6 h-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",style:{color:i.primary},children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"})}),jsxRuntime.jsx("span",{style:{color:i.text},children:r})]}),jsxRuntime.jsxs("div",{className:"flex items-start gap-4",children:[jsxRuntime.jsxs("svg",{className:"w-6 h-6 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",style:{color:i.primary},children:[jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})]}),jsxRuntime.jsx("span",{style:{color:i.text},children:a})]})]}),o&&jsxRuntime.jsxs("form",{className:"space-y-4",children:[jsxRuntime.jsx("input",{type:"text",placeholder:"Name",className:"w-full px-4 py-3 rounded-lg bg-white/10 backdrop-blur-sm border border-white/20",style:{color:i.text}}),jsxRuntime.jsx("input",{type:"email",placeholder:"Email",className:"w-full px-4 py-3 rounded-lg bg-white/10 backdrop-blur-sm border border-white/20",style:{color:i.text}}),jsxRuntime.jsx("textarea",{placeholder:"Message",rows:4,className:"w-full px-4 py-3 rounded-lg bg-white/10 backdrop-blur-sm border border-white/20",style:{color:i.text}}),jsxRuntime.jsx("button",{type:"submit",className:"w-full px-6 py-3 rounded-lg font-semibold transition-all hover:scale-105",style:{backgroundColor:i.primary,color:"#FFFFFF"},children:"Send Message"})]})]})]})})}function bn({brandName:e,logoUrl:t,style:r="both",alignment:a="left",sticky:o=true,colors:i,typography:n,enableInlineEditing:s=false,sectionId:l=""}){let c=a==="center"?"justify-center":a==="right"?"justify-end":"justify-start";return jsxRuntime.jsx("header",{className:`${o?"sticky top-0 z-50 backdrop-blur-sm":""} border-b`,style:{backgroundColor:o?"rgba(255, 255, 255, 0.8)":"transparent",borderColor:i.primary},children:jsxRuntime.jsx("div",{className:`container mx-auto px-4 py-4 flex items-center ${c}`,children:jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[(r==="logo"||r==="both")&&jsxRuntime.jsx(jsxRuntime.Fragment,{children:t?jsxRuntime.jsx("img",{src:t,alt:e||"Logo",className:"h-10 w-auto object-contain"}):jsxRuntime.jsx("div",{className:"w-10 h-10 rounded-full",style:{backgroundColor:i.primary,opacity:.2}})}),(r==="text"||r==="both"||!r)&&jsxRuntime.jsx("h1",{className:"text-2xl font-bold",style:{fontFamily:n.headingFont,color:i.text},...s&&{"data-editable":true,"data-section-id":l,"data-field-path":"settings.brandName"},children:e||"Your Brand"})]})})})}function xn({links:e,style:t="horizontal",colors:r,enableInlineEditing:a=false,sectionId:o=""}){let i=(n,s)=>{if(s.startsWith("#")){n.preventDefault();let l=s.substring(1),c=document.querySelector(`[data-section-id="${l}"]`);c&&c.scrollIntoView({behavior:"smooth",block:"start"});}};return jsxRuntime.jsx("nav",{className:"container mx-auto px-4 py-4",children:jsxRuntime.jsx("div",{className:`flex ${t==="vertical"?"flex-col space-y-2":"flex-row space-x-6 justify-center"}`,children:e.map((n,s)=>jsxRuntime.jsx("a",{href:n.url,onClick:l=>i(l,n.url),className:"text-base font-medium transition-colors hover:opacity-70",style:{color:r.text},...n.linkType==="external"&&!n.url.startsWith("#")?{target:"_blank",rel:"noopener noreferrer"}:{},...a&&{"data-editable":true,"data-section-id":o,"data-field-path":`settings.links.${s}.label`},children:n.label},n.id))})})}function vn({footerText:e,alignment:t="center",showSocial:r=true,showContact:a=true,showLinks:o=true,colors:i,enableInlineEditing:n=false,sectionId:s=""}){let l=t==="center"?"text-center":t==="right"?"text-right":"text-left";return jsxRuntime.jsx("footer",{className:"border-t py-8",style:{borderColor:i.primary},children:jsxRuntime.jsx("div",{className:`container mx-auto px-4 ${l}`,children:jsxRuntime.jsxs("div",{className:"space-y-4",children:[r&&jsxRuntime.jsx("div",{className:`flex gap-4 ${t==="center"?"justify-center":t==="right"?"justify-end":"justify-start"}`,children:["instagram","facebook","twitter"].map(c=>jsxRuntime.jsx("a",{href:`https://${c}.com/`,className:"w-8 h-8 rounded-full flex items-center justify-center transition-transform hover:scale-110",style:{backgroundColor:i.primary,color:"#FFFFFF"},children:c[0].toUpperCase()},c))}),a&&jsxRuntime.jsx("div",{className:"text-sm opacity-70",style:{color:i.text},children:jsxRuntime.jsx("p",{children:"contact@example.com | (555) 123-4567"})}),o&&jsxRuntime.jsxs("div",{className:`flex gap-4 text-sm ${t==="center"?"justify-center":t==="right"?"justify-end":"justify-start"}`,children:[jsxRuntime.jsx("a",{href:"/privacy",className:"hover:opacity-70",style:{color:i.text},children:"Privacy"}),jsxRuntime.jsx("a",{href:"/terms",className:"hover:opacity-70",style:{color:i.text},children:"Terms"})]}),jsxRuntime.jsx("p",{className:"text-sm opacity-60",style:{color:i.text},...n&&{"data-editable":true,"data-section-id":s,"data-field-path":"settings.footerText"},children:e||"\xA9 2025 Your Business"})]})})})}function wn({headline:e,description:t,image:r,buttonText:a,buttonUrl:o,layout:i="image-right",showButton:n=true,colors:s,typography:l,enableInlineEditing:c=false,sectionId:d=""}){let u=jsxRuntime.jsx("div",{className:"w-full h-full aspect-video rounded-lg overflow-hidden bg-gray-100",children:r?jsxRuntime.jsx("img",{src:r,alt:e||"Feature image",className:"w-full h-full object-cover"}):jsxRuntime.jsx("div",{className:"w-full h-full flex items-center justify-center",style:{backgroundColor:s.primary,opacity:.2},children:jsxRuntime.jsx("span",{className:"text-sm opacity-50",children:"Add image"})})}),m=jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsx("h2",{className:"text-3xl font-bold",style:{fontFamily:l.headingFont,color:s.text},...c&&{"data-editable":true,"data-section-id":d,"data-field-path":"settings.headline"},children:e||"Feature Headline"}),jsxRuntime.jsx("p",{className:"text-lg opacity-80",style:{color:s.text},...c&&{"data-editable":true,"data-section-id":d,"data-field-path":"settings.description"},children:t||"Feature description goes here..."}),n&&jsxRuntime.jsx("a",{href:o||"#",className:"inline-block px-6 py-3 rounded-lg font-semibold transition-all hover:scale-105",style:{backgroundColor:s.primary,color:"#FFFFFF"},...c&&{"data-editable":true,"data-section-id":d,"data-field-path":"settings.buttonText"},children:a||"Learn More"})]});return jsxRuntime.jsx("div",{className:"container mx-auto px-4 py-16",children:jsxRuntime.jsxs("div",{className:`grid md:grid-cols-2 gap-12 items-center ${i==="image-top"?"grid-cols-1":""}`,children:[i==="image-left"&&u,m,i==="image-right"&&u,i==="image-top"&&u]})})}function Cn({title:e,comparisons:t=[],colors:r,typography:a,enableInlineEditing:o=false,sectionId:i=""}){let n=t.length>0?t:[{id:1,title:"Hair Transformation",beforeImage:"",afterImage:""}];return jsxRuntime.jsx("section",{className:"py-16 px-6",children:jsxRuntime.jsxs("div",{className:"max-w-7xl mx-auto",children:[jsxRuntime.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-center mb-12",style:{fontFamily:a.headingFont,color:r.text},...o&&{"data-editable":true,"data-section-id":i,"data-field-path":"settings.title"},children:e||"Results"}),jsxRuntime.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:n.map((s,l)=>jsxRuntime.jsxs("div",{className:"space-y-4",children:[s.title&&jsxRuntime.jsx("h3",{className:"text-xl font-semibold text-center",style:{color:r.text},children:s.title}),jsxRuntime.jsxs("div",{className:"relative aspect-[4/3] rounded-lg overflow-hidden",children:[jsxRuntime.jsx("div",{className:"absolute inset-0",style:{backgroundColor:r.primary,opacity:.1}}),jsxRuntime.jsx("div",{className:"absolute top-4 left-4 bg-black/50 text-white px-3 py-1 rounded text-sm",children:"Before"}),jsxRuntime.jsx("div",{className:"absolute top-4 right-4 bg-black/50 text-white px-3 py-1 rounded text-sm",children:"After"})]})]},s.id||l))})]})})}function Sn({title:e,plans:t=[],colors:r,typography:a,enableInlineEditing:o=false,sectionId:i=""}){let n=t.length>0?t:[{id:1,name:"Basic",price:50,features:["Service 1","Service 2"]},{id:2,name:"Premium",price:100,features:["Service 1","Service 2","Service 3"],featured:true},{id:3,name:"Deluxe",price:150,features:["All Services","Priority Booking"]}];return jsxRuntime.jsx("section",{className:"py-16 px-6",children:jsxRuntime.jsxs("div",{className:"max-w-7xl mx-auto",children:[jsxRuntime.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-center mb-12",style:{fontFamily:a.headingFont,color:r.text},...o&&{"data-editable":true,"data-section-id":i,"data-field-path":"settings.title"},children:e||"Pricing"}),jsxRuntime.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8",children:n.map(s=>jsxRuntime.jsxs("div",{className:`p-8 rounded-lg border-2 ${s.featured?"scale-105 shadow-xl":""}`,style:{borderColor:s.featured?r.primary:"rgba(255,255,255,0.1)",backgroundColor:s.featured?`${r.primary}15`:"rgba(255,255,255,0.05)"},children:[jsxRuntime.jsx("h3",{className:"text-2xl font-bold mb-2 text-center",style:{color:r.text},children:s.name}),jsxRuntime.jsx("div",{className:"text-center mb-6",children:jsxRuntime.jsxs("span",{className:"text-4xl font-bold",style:{color:r.primary},children:["$",s.price]})}),jsxRuntime.jsx("ul",{className:"space-y-3 mb-6",children:s.features.map((l,c)=>jsxRuntime.jsxs("li",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",style:{color:r.primary},children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),jsxRuntime.jsx("span",{style:{color:r.text},children:l})]},c))}),jsxRuntime.jsx("button",{className:"w-full px-6 py-3 rounded-lg font-semibold transition-all hover:scale-105",style:{backgroundColor:s.featured?r.primary:"rgba(255,255,255,0.1)",color:s.featured?"#FFFFFF":r.text},children:"Choose Plan"})]},s.id))})]})})}function Fn({username:e,colors:t,enableInlineEditing:r=false,sectionId:a=""}){return jsxRuntime.jsx("div",{className:"container mx-auto px-4 py-8",children:jsxRuntime.jsxs("div",{className:"max-w-4xl mx-auto",children:[jsxRuntime.jsxs("p",{className:"text-center text-sm opacity-60 mb-4",children:["Instagram Feed: ",e||"@handle"]}),jsxRuntime.jsx("div",{className:"grid grid-cols-3 gap-1",children:[1,2,3,4,5,6].map(o=>jsxRuntime.jsx("div",{className:"aspect-square rounded",style:{backgroundColor:t.primary,opacity:.2}},o))})]})})}function In({name:e,subheading:t,bio:r,links:a=[],bookingButtonText:o,bookingButtonUrl:i,showBookingButton:n=true,position:s="bottom-left",cardWidth:l="medium",cardColor:c="#FFFFFF",colors:d,typography:u,enableInlineEditing:m=false,sectionId:p=""}){let b=(C,S)=>{let x=parseInt(C.slice(1,3),16),F=parseInt(C.slice(3,5),16),k=parseInt(C.slice(5,7),16);return `rgba(${x}, ${F}, ${k}, ${S})`},w={small:"280px",medium:"320px",large:"400px"},N={"bottom-left":"bottom-0 left-0","bottom-right":"bottom-0 right-0","bottom-center":"bottom-0 left-1/2 -translate-x-1/2"},g=s==="bottom-left"?"text-left":s==="bottom-right"?"text-right":"text-center",v=s==="bottom-left"?"justify-start":s==="bottom-right"?"justify-end":"justify-center",f=()=>s==="bottom-left"?"rounded-tr-3xl rounded-tl-none":s==="bottom-right"?"rounded-tl-3xl rounded-tr-none":"rounded-t-3xl";return jsxRuntime.jsx("div",{className:`fixed z-50 ${N[s]}`,style:{width:w[l]},children:jsxRuntime.jsxs("div",{className:`${f()} shadow-2xl border-t border-x`,style:{backgroundColor:b(c,.9),borderColor:b(c,.3),boxShadow:"0 -10px 40px rgba(0, 0, 0, 0.1)"},children:[jsxRuntime.jsx("div",{className:`px-8 pt-8 pb-3 ${g}`,children:jsxRuntime.jsx("h3",{className:"text-2xl font-bold",style:{fontFamily:u.headingFont,color:d.text},...m&&{"data-editable":true,"data-section-id":p,"data-field-path":"settings.name"},children:e||"Your Name"})}),jsxRuntime.jsx("div",{className:"mb-6",children:t?jsxRuntime.jsxs("div",{className:`flex items-center gap-3 px-8 ${v}`,children:[jsxRuntime.jsx("span",{className:"text-xs font-medium whitespace-nowrap",style:{color:d.primary},...m&&{"data-editable":true,"data-section-id":p,"data-field-path":"settings.subheading"},children:t}),jsxRuntime.jsx("div",{className:"flex-1 h-px",style:{backgroundColor:d.primary,opacity:.3}})]}):jsxRuntime.jsx("div",{className:"w-full h-px",style:{backgroundColor:d.primary,opacity:.3}})}),jsxRuntime.jsxs("div",{className:`px-8 pb-8 ${g}`,children:[jsxRuntime.jsx("p",{className:"text-sm opacity-80 mb-4",style:{color:d.text},...m&&{"data-editable":true,"data-section-id":p,"data-field-path":"settings.bio"},children:r||"Transforming beauty, one client at a time \u2728"}),a.length>0&&jsxRuntime.jsx("div",{className:"space-y-2 mb-4",children:a.map((C,S)=>jsxRuntime.jsx("a",{href:C.url,target:"_blank",rel:"noopener noreferrer",className:"block text-sm font-medium hover:opacity-70 transition-opacity",style:{color:d.primary},...m&&{"data-editable":true,"data-section-id":p,"data-field-path":`settings.links.${S}.label`},children:C.label},C.id))}),n&&jsxRuntime.jsx("a",{href:i||"/book",className:"block w-full py-3 px-4 rounded-xl text-center font-semibold transition-all hover:scale-105 hover:shadow-lg",style:{backgroundColor:d.primary,color:d.buttonText||"#FFFFFF"},...m&&{"data-editable":true,"data-section-id":p,"data-field-path":"settings.bookingButtonText"},children:o||"Book Appointment"})]})]})})}function En({config:e,colors:t,BookingFlowComponent:r,enableInlineEditing:a=false,sectionId:o=""}){return r?jsxRuntime.jsx("div",{className:"container mx-auto px-4 py-16",children:jsxRuntime.jsx(r,{config:e,colors:t})}):jsxRuntime.jsx("div",{className:"container mx-auto px-4 py-16",children:jsxRuntime.jsx("div",{className:"max-w-4xl mx-auto text-center",children:jsxRuntime.jsxs("div",{className:"p-12 rounded-2xl border-2 border-dashed",style:{borderColor:t.primary,opacity:.5},children:[jsxRuntime.jsx("div",{className:"text-6xl mb-4",children:"\u{1F4C5}"}),jsxRuntime.jsx("h3",{className:"text-2xl font-bold mb-3",style:{color:t.text},children:"Booking Flow"}),jsxRuntime.jsx("p",{className:"text-base opacity-70",style:{color:t.text},children:"Pass a BookingFlowComponent prop to render your custom booking flow here."})]})})})}function Rn({videoUrl:e,aspectRatio:t="16:9",autoplay:r=false,loop:a=false,muted:o=true,controls:i=true,allowFullScreen:n=true,coverImage:s,maxWidth:l="large",alignment:c="center",borderRadius:d=12,colors:u,enableInlineEditing:m=false,sectionId:p=""}){let w=(f=>{let C=f.match(/(?:youtube\.com\/watch\?v=|youtu\.be\/|youtube\.com\/embed\/)([a-zA-Z0-9_-]+)/);if(C){let x=C[1],F=new URLSearchParams({...r?{autoplay:"1"}:{},...a?{loop:"1",playlist:x}:{},...o?{mute:"1"}:{},...i?{}:{controls:"0"}});return {type:"youtube",embedUrl:`https://www.youtube.com/embed/${x}?${F.toString()}`}}let S=f.match(/(?:vimeo\.com\/)(\d+)/);if(S){let x=S[1],F=new URLSearchParams({...r?{autoplay:"1"}:{},...a?{loop:"1"}:{},...o?{muted:"1"}:{},...i?{}:{controls:"0"}});return {type:"vimeo",embedUrl:`https://player.vimeo.com/video/${x}?${F.toString()}`}}return f.match(/\.(mp4|webm|ogg)$/i)?{type:"direct",embedUrl:f}:null})(e),N={"16:9":"56.25%","4:3":"75%","1:1":"100%","9:16":"177.78%"},g={full:"max-w-full",large:"max-w-6xl",medium:"max-w-4xl",small:"max-w-2xl"},v=c==="center"?"mx-auto":c==="right"?"ml-auto":"mr-auto";return jsxRuntime.jsx("div",{className:"container mx-auto px-4",children:jsxRuntime.jsx("div",{className:`${g[l]} ${v}`,children:jsxRuntime.jsx("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:N[t],borderRadius:`${d}px`},children:w?w.type==="direct"?jsxRuntime.jsx("video",{src:w.embedUrl,autoPlay:r,loop:a,muted:o,controls:i,poster:s,className:"absolute top-0 left-0 w-full h-full object-cover"}):jsxRuntime.jsx("iframe",{src:w.embedUrl,className:"absolute top-0 left-0 w-full h-full",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:n,title:"Video"}):jsxRuntime.jsx("div",{className:"absolute top-0 left-0 w-full h-full flex items-center justify-center",style:{backgroundColor:`${u.primary}20`},children:jsxRuntime.jsxs("div",{className:"text-center px-4",children:[jsxRuntime.jsxs("svg",{className:"w-16 h-16 mx-auto mb-4",fill:"none",stroke:u.primary,viewBox:"0 0 24 24",children:[jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z"}),jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})]}),jsxRuntime.jsx("p",{style:{color:u.text,opacity:.6},children:e?"Invalid video URL":"Add a video URL to display"})]})})})})})}function Pn({text:e="SCROLL TEXT",scrollDirection:t="left",scrollSpeed:r="medium",orientation:a="horizontal",dividerIcon:o="bullet",customIcon:i,textSize:n="medium",textColor:s,fontWeight:l="bold",backgroundColor:c,backgroundGradient:d,pauseOnHover:u=true,colors:m,typography:p,enableInlineEditing:b=false,sectionId:w=""}){let[N,g]=Ge.useState(false),f={bullet:"\u2022",star:"\u2605",diamond:"\u25C6",custom:i||"\u2022",none:""}[o],S=typeof r=="number"?r:{slow:60,medium:30,fast:15}[r],x={small:"text-xl md:text-2xl",medium:"text-2xl md:text-4xl",large:"text-3xl md:text-5xl",xl:"text-4xl md:text-6xl"},F={light:"font-light",normal:"font-normal",bold:"font-bold"},k={horizontal:"0deg","diagonal-left":"-5deg","diagonal-right":"5deg"},I=f?`${e} ${f} `.repeat(20):`${e} `.repeat(20);return jsxRuntime.jsxs("div",{className:"relative overflow-hidden py-3",style:{...d?{background:d}:{backgroundColor:c||"transparent"},transform:`rotate(${k[a]})`},onMouseEnter:()=>u&&g(true),onMouseLeave:()=>u&&g(false),children:[jsxRuntime.jsx("style",{children:`
1
+ 'use strict';var jsxRuntime=require('react/jsx-runtime'),lucideReact=require('lucide-react'),Ge=require('react'),framerMotion=require('framer-motion'),supabaseJs=require('@supabase/supabase-js'),reactDom=require('react-dom');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Ge__default=/*#__PURE__*/_interopDefault(Ge);function tn({logoUrl:e,fallbackText:t,size:r="medium",alignment:a="center",colors:o,enableInlineEditing:i=false,sectionId:n=""}){let l={small:80,medium:120,large:160}[r];return jsxRuntime.jsx("div",{className:`container mx-auto px-4 flex ${a==="center"?"justify-center":a==="right"?"justify-end":"justify-start"}`,children:e?jsxRuntime.jsx("img",{src:e,alt:t||"Logo",className:"object-contain",style:{height:`${l}px`,width:"auto"}}):t?jsxRuntime.jsx("div",{className:"flex items-center justify-center rounded-full font-bold",style:{width:`${l}px`,height:`${l}px`,backgroundColor:o.primary,color:"#FFFFFF",fontSize:`${l*.4}px`},children:t.slice(0,2).toUpperCase()}):jsxRuntime.jsx("div",{className:"rounded-full",style:{width:`${l}px`,height:`${l}px`,backgroundColor:o.primary,opacity:.2}})})}function nn({name:e,title:t,bio:r,showName:a=true,showTitle:o=true,showBio:i=true,colors:n,typography:s,enableInlineEditing:l=false,sectionId:c=""}){return jsxRuntime.jsxs("div",{className:"container mx-auto px-4 text-center",children:[a&&jsxRuntime.jsx("h1",{className:"text-4xl font-bold mb-3",style:{fontFamily:s.headingFont,color:n.text},...l&&{"data-editable":true,"data-section-id":c,"data-field-path":"settings.name"},children:e||"Your Name"}),o&&jsxRuntime.jsx("p",{className:"text-lg opacity-80 mb-2",...l&&{"data-editable":true,"data-section-id":c,"data-field-path":"settings.title"},children:t||"Beauty Professional"}),i&&jsxRuntime.jsx("p",{className:"text-base opacity-70 max-w-md mx-auto",...l&&{"data-editable":true,"data-section-id":c,"data-field-path":"settings.bio"},children:r||"Transform your look \u2728"})]})}function on({text:e,url:t,style:r="gradient",size:a="large",colors:o,enableInlineEditing:i=false,sectionId:n=""}){let s=()=>{let c="";switch(a){case "small":c="p-3 text-base";break;case "medium":c="p-4 text-lg";break;case "large":c="p-5 text-xl";break;default:c="p-5 text-xl";}let d="";switch(r){case "gradient":d="rounded-full";break;case "solid":d="rounded-lg";break;case "outline":d="rounded-full border-2";break;default:d="rounded-full";}return `block max-w-2xl mx-auto ${c} ${d} text-center font-semibold transition-all hover:scale-105 hover:shadow-xl`},l=()=>{switch(r){case "gradient":return {background:`linear-gradient(135deg, ${o.primary} 0%, ${o.secondary} 100%)`,color:"#FFFFFF"};case "solid":return {backgroundColor:o.primary,color:"#FFFFFF"};case "outline":return {backgroundColor:"transparent",borderColor:o.primary,color:o.primary};default:return {backgroundColor:o.primary,color:"#FFFFFF"}}};return jsxRuntime.jsx("div",{className:"container mx-auto px-4",children:jsxRuntime.jsx("a",{href:t||"/book",className:s(),style:l(),...i&&{"data-editable":true,"data-section-id":n,"data-field-path":"settings.text"},children:e||"\u{1F485} Book Now"})})}function sn({links:e,style:t="pill",colors:r,enableInlineEditing:a=false,sectionId:o=""}){let i=()=>{let s="block w-full p-4 text-center font-medium transition-all hover:scale-105";switch(t){case "pill":return `${s} rounded-full`;case "square":return `${s} rounded-md`;case "outline":return `${s} rounded-full border-2`;default:return `${s} rounded-lg`}},n=s=>s?{backgroundColor:"transparent",borderColor:r.primary,color:r.primary}:{backgroundColor:r.linkBackground||r.primary,color:r.linkText||"#FFFFFF"};return jsxRuntime.jsx("div",{className:"container mx-auto px-4",children:jsxRuntime.jsx("div",{className:"max-w-2xl mx-auto space-y-3",children:e.map((s,l)=>jsxRuntime.jsx("a",{href:s.url,target:"_blank",rel:"noopener noreferrer",className:i(),style:n(t==="outline"),...a&&{"data-editable":true,"data-section-id":o,"data-field-path":`settings.links.${l}.label`},children:s.label},s.id))})})}function ln({platforms:e,socialLinks:t={},style:r="filled",size:a="large",position:o="center",invertIcons:i=false,colors:n,enableInlineEditing:s=false,sectionId:l=""}){let c=g=>{let b=g.replace("#",""),v=parseInt(b.substr(0,2),16),w=parseInt(b.substr(2,2),16),f=parseInt(b.substr(4,2),16);return (.299*v+.587*w+.114*f)/255>.5?"#000000":"#FFFFFF"},d=g=>{let b=a==="small"?20:a==="medium"?24:28;switch(g){case "instagram":return jsxRuntime.jsx(lucideReact.Instagram,{size:b});case "facebook":return jsxRuntime.jsx(lucideReact.Facebook,{size:b});case "tiktok":return jsxRuntime.jsx(lucideReact.Music,{size:b});case "twitter":return jsxRuntime.jsx(lucideReact.Twitter,{size:b});case "youtube":return jsxRuntime.jsx(lucideReact.Youtube,{size:b});case "pinterest":return jsxRuntime.jsx(lucideReact.PinIcon,{size:b});default:return jsxRuntime.jsx(lucideReact.Instagram,{size:b})}},u=()=>{let g="";switch(a){case "small":g="w-10 h-10 text-lg";break;case "medium":g="w-12 h-12 text-xl";break;case "large":g="w-14 h-14 text-2xl";break;default:g="w-14 h-14 text-2xl";}let b="";switch(r){case "filled":b="rounded-full";break;case "outline":b="rounded-full border-2";break;case "ghost":b="rounded-full";break;default:b="rounded-full";}return `${g} ${b} flex items-center justify-center hover:scale-110 transition-transform`},p=()=>{switch(r){case "filled":return {backgroundColor:n.primary,color:c(n.primary||"#BCB4FF")};case "outline":return {backgroundColor:"transparent",borderColor:n.primary,color:n.primary};case "ghost":return {backgroundColor:"rgba(0,0,0,0.05)",color:n.primary};default:return {backgroundColor:n.primary,color:c(n.primary||"#BCB4FF")}}};return o==="left-vertical"||o==="right-vertical"?jsxRuntime.jsx("div",{className:`fixed top-6 z-40 flex flex-col gap-3 ${o==="left-vertical"?"left-4":"right-4"}`,children:e.map(g=>{let b=t[g]||`https://${g}.com/`;return jsxRuntime.jsx("a",{href:b,target:"_blank",rel:"noopener noreferrer",className:u(),style:{...p(),filter:i?"invert(1)":"none"},title:g.charAt(0).toUpperCase()+g.slice(1),children:d(g)},g)})}):jsxRuntime.jsx("div",{className:"container mx-auto px-4 py-8 text-center",children:jsxRuntime.jsx("div",{className:"flex items-center justify-center gap-4",children:e.map(g=>{let b=t[g]||`https://${g}.com/`;return jsxRuntime.jsx("a",{href:b,target:"_blank",rel:"noopener noreferrer",className:u(),style:{...p(),filter:i?"invert(1)":"none"},title:g.charAt(0).toUpperCase()+g.slice(1),children:d(g)},g)})})})}function cn({headline:e,subheadline:t,heroImage:r,ctaButton:a,layout:o="split",imagePosition:i="right",contentDisplay:n="side",colors:s,typography:l,enableInlineEditing:c=false,sectionId:d=""}){let u=jsxRuntime.jsxs("div",{className:o==="full"?"text-center max-w-4xl z-10":"text-left",children:[jsxRuntime.jsx("h1",{className:o==="full"?"text-5xl md:text-6xl font-bold mb-6":"text-5xl font-bold mb-4",style:{fontFamily:l.headingFont,color:o==="full"&&r?"#FFFFFF":s.text,textShadow:o==="full"&&r?"0 2px 10px rgba(0,0,0,0.3)":"none"},...c&&{"data-editable":true,"data-section-id":d,"data-field-path":"settings.headline"},children:e||"Welcome"}),t&&jsxRuntime.jsx("p",{className:o==="full"?"text-xl md:text-2xl opacity-90 mb-12":"text-xl opacity-80 mb-8",style:{color:o==="full"&&r?"#FFFFFF":s.text,textShadow:o==="full"&&r?"0 2px 10px rgba(0,0,0,0.3)":"none"},...c&&{"data-editable":true,"data-section-id":d,"data-field-path":"settings.subheadline"},children:t}),a&&jsxRuntime.jsx("a",{href:a.url||"#",className:"inline-block px-8 py-4 rounded-lg font-semibold text-lg transition-all hover:scale-105 shadow-lg",style:{backgroundColor:s.primary,color:"#FFFFFF"},...c&&{"data-editable":true,"data-section-id":d,"data-field-path":"settings.ctaButton.text"},children:a.text||"Get Started"})]}),p=r?jsxRuntime.jsx("div",{className:"w-full h-full rounded-2xl overflow-hidden",children:jsxRuntime.jsx("img",{src:r,alt:e||"Hero",className:"w-full h-full object-cover"})}):jsxRuntime.jsx("div",{className:"w-full h-full rounded-2xl flex items-center justify-center",style:{backgroundColor:s.primary,opacity:.1},children:jsxRuntime.jsx("span",{className:"text-sm opacity-50",children:"Add hero image"})});return o==="full"?jsxRuntime.jsxs("div",{className:"relative py-20 md:py-24 px-4 flex items-center justify-center",style:{backgroundImage:r?`url(${r})`:"none",backgroundSize:"cover",backgroundPosition:"center",backgroundColor:r?"transparent":s.primary,opacity:r?1:.1},children:[r&&jsxRuntime.jsx("div",{className:"absolute inset-0 bg-black/40"}),u]}):n==="overlay"?jsxRuntime.jsx("div",{className:"container mx-auto px-4 py-16",children:jsxRuntime.jsxs("div",{className:"relative max-w-6xl mx-auto rounded-2xl overflow-hidden",style:{height:"500px"},children:[r?jsxRuntime.jsx("img",{src:r,alt:e||"Hero",className:"absolute inset-0 w-full h-full object-cover"}):jsxRuntime.jsx("div",{className:"absolute inset-0",style:{backgroundColor:s.primary,opacity:.1}}),jsxRuntime.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-black/60 to-black/20"}),jsxRuntime.jsx("div",{className:`relative h-full flex items-center ${i==="left"?"justify-end":"justify-start"} px-12`,children:jsxRuntime.jsx("div",{className:"max-w-lg",style:{color:"#FFFFFF",textShadow:"0 2px 10px rgba(0,0,0,0.3)"},children:u})})]})}):jsxRuntime.jsx("div",{className:"container mx-auto px-4 py-16",children:jsxRuntime.jsxs("div",{className:"grid md:grid-cols-2 gap-12 items-center max-w-6xl mx-auto",children:[i==="left"&&jsxRuntime.jsx("div",{className:"aspect-[4/3]",children:p}),jsxRuntime.jsx("div",{children:u}),i==="right"&&jsxRuntime.jsx("div",{className:"aspect-[4/3]",children:p})]})})}function dn({title:e,content:t,image:r,layout:a="centered",colors:o,typography:i,enableInlineEditing:n=false,sectionId:s=""}){return a==="centered"?jsxRuntime.jsx("div",{className:"container mx-auto px-4 py-16",children:jsxRuntime.jsxs("div",{className:"max-w-3xl mx-auto text-center",children:[jsxRuntime.jsx("h2",{className:"text-3xl font-bold mb-6",style:{fontFamily:i.headingFont,color:o.text},...n&&{"data-editable":true,"data-section-id":s,"data-field-path":"settings.title"},children:e||"About Us"}),jsxRuntime.jsx("p",{className:"text-lg opacity-80",...n&&{"data-editable":true,"data-section-id":s,"data-field-path":"settings.content"},children:t||"Tell your story here..."})]})}):a==="split"?jsxRuntime.jsx("div",{className:"container mx-auto px-4 py-16",children:jsxRuntime.jsxs("div",{className:"max-w-6xl mx-auto grid md:grid-cols-2 gap-12 items-center",children:[jsxRuntime.jsx("div",{className:"aspect-square rounded-2xl overflow-hidden",children:r?jsxRuntime.jsx("img",{src:r,alt:e||"About",className:"w-full h-full object-cover"}):jsxRuntime.jsx("div",{className:"w-full h-full flex items-center justify-center",style:{backgroundColor:o.primary,opacity:.2},children:jsxRuntime.jsx("span",{className:"text-sm opacity-50",children:"Add image"})})}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h2",{className:"text-3xl font-bold mb-6",style:{fontFamily:i.headingFont,color:o.text},...n&&{"data-editable":true,"data-section-id":s,"data-field-path":"settings.title"},children:e||"About Us"}),jsxRuntime.jsx("p",{className:"text-lg opacity-80 leading-relaxed",...n&&{"data-editable":true,"data-section-id":s,"data-field-path":"settings.content"},children:t||"Tell your story here..."})]})]})}):jsxRuntime.jsx("div",{className:"container mx-auto px-4 py-16",children:jsxRuntime.jsxs("div",{className:"max-w-7xl mx-auto",children:[jsxRuntime.jsx("h2",{className:"text-4xl font-bold mb-8 text-left",style:{fontFamily:i.headingFont,color:o.text},...n&&{"data-editable":true,"data-section-id":s,"data-field-path":"settings.title"},children:e||"About Us"}),jsxRuntime.jsx("p",{className:"text-xl opacity-80 leading-relaxed columns-2 gap-12",...n&&{"data-editable":true,"data-section-id":s,"data-field-path":"settings.content"},children:t||"Tell your story here..."})]})})}function un({title:e,services:t=[],layout:r="grid",columns:a=3,showPrices:o=true,showDuration:i=true,colors:n,typography:s,enableInlineEditing:l=false,sectionId:c=""}){let d={2:"grid-cols-1 md:grid-cols-2",3:"grid-cols-1 md:grid-cols-3",4:"grid-cols-1 md:grid-cols-2 lg:grid-cols-4"},u=t.length>0?t:[{id:1,name:"Haircut & Style",description:"Professional cut and styling",price:75,duration:60},{id:2,name:"Color Treatment",description:"Full color or highlights",price:150,duration:120},{id:3,name:"Deep Conditioning",description:"Restorative treatment",price:50,duration:45}],p=()=>{switch(r){case "grid":return `grid ${d[a]} gap-8`;case "list":return "flex flex-col gap-4 max-w-3xl mx-auto";case "carousel":return "flex overflow-x-auto snap-x gap-6 pb-4";default:return `grid ${d[a]} gap-8`}};return jsxRuntime.jsx("section",{className:"py-16 px-6",children:jsxRuntime.jsxs("div",{className:"max-w-7xl mx-auto",children:[jsxRuntime.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-center mb-12",style:{fontFamily:s.headingFont,color:n.text},...l&&{"data-editable":true,"data-section-id":c,"data-field-path":"settings.title"},children:e||"Our Services"}),jsxRuntime.jsx("div",{className:p(),children:u.map(g=>jsxRuntime.jsxs("div",{className:`p-6 rounded-lg border hover:scale-105 transition-transform shadow-lg ${r==="carousel"?"snap-center flex-shrink-0 w-80":""} ${r==="list"?"flex items-center gap-6":""}`,style:{backgroundColor:"rgba(255, 255, 255, 0.95)",borderColor:`${n.primary}20`},children:[r==="list"&&jsxRuntime.jsx("div",{className:"flex-shrink-0 w-24 h-24 rounded-lg",style:{backgroundColor:n.primary,opacity:.2}}),jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx("h3",{className:"text-xl font-semibold mb-3",style:{color:"#1a1a1a"},children:g.name}),jsxRuntime.jsx("p",{className:"text-sm opacity-80 mb-4",style:{color:"#333333"},children:g.description}),jsxRuntime.jsxs("div",{className:`flex ${r==="list"?"gap-4":"justify-between"} items-center`,children:[o&&jsxRuntime.jsxs("p",{className:"font-bold text-lg",style:{color:n.primary},children:["$",g.price]}),i&&jsxRuntime.jsxs("p",{className:"text-sm opacity-70",style:{color:"#666666"},children:[g.duration," min"]})]})]})]},g.id))})]})})}function mn({title:e,images:t=[],columns:r=3,colors:a,typography:o,enableInlineEditing:i=false,sectionId:n=""}){let s={2:"grid-cols-2",3:"grid-cols-2 md:grid-cols-3",4:"grid-cols-2 md:grid-cols-4"},l=t.length>0?t:[1,2,3,4,5,6].map(c=>({id:c,url:void 0}));return jsxRuntime.jsx("section",{className:"py-16 px-6",children:jsxRuntime.jsxs("div",{className:"max-w-7xl mx-auto",children:[jsxRuntime.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-center mb-12",style:{fontFamily:o.headingFont,color:a.text},...i&&{"data-editable":true,"data-section-id":n,"data-field-path":"settings.title"},children:e||"Gallery"}),jsxRuntime.jsx("div",{className:`grid ${s[r]} gap-4`,children:l.map((c,d)=>jsxRuntime.jsx("div",{className:"relative aspect-square overflow-hidden rounded-lg group",children:c.url?jsxRuntime.jsx("img",{src:c.url,alt:c.alt||"",className:"w-full h-full object-cover transition-transform group-hover:scale-110"}):jsxRuntime.jsx("div",{className:"w-full h-full flex items-center justify-center transition-transform group-hover:scale-110",style:{backgroundColor:a.primary,opacity:.2},children:jsxRuntime.jsx("span",{className:"text-sm opacity-50",children:"Add image"})})},c.id||d))})]})})}function gn({title:e,testimonials:t=[],layout:r="grid",colors:a,typography:o,enableInlineEditing:i=false,sectionId:n=""}){let s=r==="carousel"?"flex overflow-x-auto snap-x gap-6 pb-4":"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",l=t.length>0?t:[{id:1,text:"Amazing service! I love my new look.",author:"Sarah M.",rating:5},{id:2,text:"Professional and friendly staff.",author:"Jessica L.",rating:5},{id:3,text:"Best salon in town!",author:"Emily R.",rating:5}];return jsxRuntime.jsx("section",{className:"py-16 px-6",children:jsxRuntime.jsxs("div",{className:"max-w-7xl mx-auto",children:[jsxRuntime.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-center mb-12",style:{fontFamily:o.headingFont,color:a.text},...i&&{"data-editable":true,"data-section-id":n,"data-field-path":"settings.title"},children:e||"What Our Clients Say"}),jsxRuntime.jsx("div",{className:s,children:l.map(c=>jsxRuntime.jsxs("div",{className:`p-6 rounded-lg bg-white/10 backdrop-blur-sm ${r==="carousel"?"snap-center flex-shrink-0 w-80":""}`,children:[jsxRuntime.jsx("div",{className:"flex gap-1 mb-4",children:[...Array(5)].map((d,u)=>jsxRuntime.jsx("svg",{className:"w-5 h-5",fill:u<c.rating?a.primary||"#8B5CF6":"#E5E7EB",viewBox:"0 0 20 20",children:jsxRuntime.jsx("path",{d:"M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"})},u))}),jsxRuntime.jsxs("p",{className:"mb-4 italic",style:{color:a.text},children:['"',c.text,'"']}),jsxRuntime.jsx("p",{className:"font-semibold",style:{color:a.text},children:c.author})]},c.id))})]})})}function fn({title:e,members:t=[],colors:r,typography:a,enableInlineEditing:o=false,sectionId:i=""}){let n=t.length>0?t:[{id:1,name:"Sarah Johnson",role:"Master Stylist",bio:"Expert in color and styling with 10+ years experience"},{id:2,name:"Michael Chen",role:"Senior Stylist",bio:"Specializing in precision cuts and modern styles"},{id:3,name:"Emma Davis",role:"Stylist",bio:"Passionate about creating beautiful transformations"}];return jsxRuntime.jsx("section",{className:"py-16 px-6",children:jsxRuntime.jsxs("div",{className:"max-w-7xl mx-auto",children:[jsxRuntime.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-center mb-12",style:{fontFamily:a.headingFont,color:r.text},...o&&{"data-editable":true,"data-section-id":i,"data-field-path":"settings.title"},children:e||"Meet Our Team"}),jsxRuntime.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:n.map(s=>jsxRuntime.jsxs("div",{className:"text-center",children:[jsxRuntime.jsx("div",{className:"w-32 h-32 rounded-full mx-auto mb-4",style:{backgroundColor:r.primary,opacity:.2}}),jsxRuntime.jsx("h3",{className:"text-xl font-semibold mb-2",style:{color:r.text},children:s.name}),jsxRuntime.jsx("p",{className:"text-sm mb-3",style:{color:r.primary},children:s.role}),jsxRuntime.jsx("p",{className:"text-sm opacity-80",style:{color:r.text},children:s.bio})]},s.id))})]})})}function yn({title:e,email:t="contact@example.com",phone:r="(555) 123-4567",address:a="123 Main Street, City, State 12345",showForm:o=true,colors:i,typography:n,enableInlineEditing:s=false,sectionId:l=""}){return jsxRuntime.jsx("section",{className:"py-16 px-6",children:jsxRuntime.jsxs("div",{className:"max-w-7xl mx-auto",children:[jsxRuntime.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-center mb-12",style:{fontFamily:n.headingFont,color:i.text},...s&&{"data-editable":true,"data-section-id":l,"data-field-path":"settings.title"},children:e||"Get In Touch"}),jsxRuntime.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-12",children:[jsxRuntime.jsxs("div",{className:"space-y-6",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-4",children:[jsxRuntime.jsx("svg",{className:"w-6 h-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",style:{color:i.primary},children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})}),jsxRuntime.jsx("span",{style:{color:i.text},children:t})]}),jsxRuntime.jsxs("div",{className:"flex items-center gap-4",children:[jsxRuntime.jsx("svg",{className:"w-6 h-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",style:{color:i.primary},children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"})}),jsxRuntime.jsx("span",{style:{color:i.text},children:r})]}),jsxRuntime.jsxs("div",{className:"flex items-start gap-4",children:[jsxRuntime.jsxs("svg",{className:"w-6 h-6 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",style:{color:i.primary},children:[jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})]}),jsxRuntime.jsx("span",{style:{color:i.text},children:a})]})]}),o&&jsxRuntime.jsxs("form",{className:"space-y-4",children:[jsxRuntime.jsx("input",{type:"text",placeholder:"Name",className:"w-full px-4 py-3 rounded-lg bg-white/10 backdrop-blur-sm border border-white/20",style:{color:i.text}}),jsxRuntime.jsx("input",{type:"email",placeholder:"Email",className:"w-full px-4 py-3 rounded-lg bg-white/10 backdrop-blur-sm border border-white/20",style:{color:i.text}}),jsxRuntime.jsx("textarea",{placeholder:"Message",rows:4,className:"w-full px-4 py-3 rounded-lg bg-white/10 backdrop-blur-sm border border-white/20",style:{color:i.text}}),jsxRuntime.jsx("button",{type:"submit",className:"w-full px-6 py-3 rounded-lg font-semibold transition-all hover:scale-105",style:{backgroundColor:i.primary,color:"#FFFFFF"},children:"Send Message"})]})]})]})})}function bn({brandName:e,logoUrl:t,style:r="both",alignment:a="left",sticky:o=true,colors:i,typography:n,enableInlineEditing:s=false,sectionId:l=""}){let c=a==="center"?"justify-center":a==="right"?"justify-end":"justify-start";return jsxRuntime.jsx("header",{className:`${o?"sticky top-0 z-50 backdrop-blur-sm":""} border-b`,style:{backgroundColor:o?"rgba(255, 255, 255, 0.8)":"transparent",borderColor:i.primary},children:jsxRuntime.jsx("div",{className:`container mx-auto px-4 py-4 flex items-center ${c}`,children:jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[(r==="logo"||r==="both")&&jsxRuntime.jsx(jsxRuntime.Fragment,{children:t?jsxRuntime.jsx("img",{src:t,alt:e||"Logo",className:"h-10 w-auto object-contain"}):jsxRuntime.jsx("div",{className:"w-10 h-10 rounded-full",style:{backgroundColor:i.primary,opacity:.2}})}),(r==="text"||r==="both"||!r)&&jsxRuntime.jsx("h1",{className:"text-2xl font-bold",style:{fontFamily:n.headingFont,color:i.text},...s&&{"data-editable":true,"data-section-id":l,"data-field-path":"settings.brandName"},children:e||"Your Brand"})]})})})}function xn({links:e,style:t="horizontal",colors:r,enableInlineEditing:a=false,sectionId:o=""}){let i=(n,s)=>{if(s.startsWith("#")){n.preventDefault();let l=s.substring(1),c=document.querySelector(`[data-section-id="${l}"]`);c&&c.scrollIntoView({behavior:"smooth",block:"start"});}};return jsxRuntime.jsx("nav",{className:"container mx-auto px-4 py-4",children:jsxRuntime.jsx("div",{className:`flex ${t==="vertical"?"flex-col space-y-2":"flex-row space-x-6 justify-center"}`,children:e.map((n,s)=>jsxRuntime.jsx("a",{href:n.url,onClick:l=>i(l,n.url),className:"text-base font-medium transition-colors hover:opacity-70",style:{color:r.text},...n.linkType==="external"&&!n.url.startsWith("#")?{target:"_blank",rel:"noopener noreferrer"}:{},...a&&{"data-editable":true,"data-section-id":o,"data-field-path":`settings.links.${s}.label`},children:n.label},n.id))})})}function vn({footerText:e,alignment:t="center",showSocial:r=true,showContact:a=true,showLinks:o=true,colors:i,enableInlineEditing:n=false,sectionId:s=""}){let l=t==="center"?"text-center":t==="right"?"text-right":"text-left";return jsxRuntime.jsx("footer",{className:"border-t py-8",style:{borderColor:i.primary},children:jsxRuntime.jsx("div",{className:`container mx-auto px-4 ${l}`,children:jsxRuntime.jsxs("div",{className:"space-y-4",children:[r&&jsxRuntime.jsx("div",{className:`flex gap-4 ${t==="center"?"justify-center":t==="right"?"justify-end":"justify-start"}`,children:["instagram","facebook","twitter"].map(c=>jsxRuntime.jsx("a",{href:`https://${c}.com/`,className:"w-8 h-8 rounded-full flex items-center justify-center transition-transform hover:scale-110",style:{backgroundColor:i.primary,color:"#FFFFFF"},children:c[0].toUpperCase()},c))}),a&&jsxRuntime.jsx("div",{className:"text-sm opacity-70",style:{color:i.text},children:jsxRuntime.jsx("p",{children:"contact@example.com | (555) 123-4567"})}),o&&jsxRuntime.jsxs("div",{className:`flex gap-4 text-sm ${t==="center"?"justify-center":t==="right"?"justify-end":"justify-start"}`,children:[jsxRuntime.jsx("a",{href:"/privacy",className:"hover:opacity-70",style:{color:i.text},children:"Privacy"}),jsxRuntime.jsx("a",{href:"/terms",className:"hover:opacity-70",style:{color:i.text},children:"Terms"})]}),jsxRuntime.jsx("p",{className:"text-sm opacity-60",style:{color:i.text},...n&&{"data-editable":true,"data-section-id":s,"data-field-path":"settings.footerText"},children:e||"\xA9 2025 Your Business"})]})})})}function wn({headline:e,description:t,image:r,buttonText:a,buttonUrl:o,layout:i="image-right",showButton:n=true,colors:s,typography:l,enableInlineEditing:c=false,sectionId:d=""}){let u=jsxRuntime.jsx("div",{className:"w-full h-full aspect-video rounded-lg overflow-hidden bg-gray-100",children:r?jsxRuntime.jsx("img",{src:r,alt:e||"Feature image",className:"w-full h-full object-cover"}):jsxRuntime.jsx("div",{className:"w-full h-full flex items-center justify-center",style:{backgroundColor:s.primary,opacity:.2},children:jsxRuntime.jsx("span",{className:"text-sm opacity-50",children:"Add image"})})}),p=jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsx("h2",{className:"text-3xl font-bold",style:{fontFamily:l.headingFont,color:s.text},...c&&{"data-editable":true,"data-section-id":d,"data-field-path":"settings.headline"},children:e||"Feature Headline"}),jsxRuntime.jsx("p",{className:"text-lg opacity-80",style:{color:s.text},...c&&{"data-editable":true,"data-section-id":d,"data-field-path":"settings.description"},children:t||"Feature description goes here..."}),n&&jsxRuntime.jsx("a",{href:o||"#",className:"inline-block px-6 py-3 rounded-lg font-semibold transition-all hover:scale-105",style:{backgroundColor:s.primary,color:"#FFFFFF"},...c&&{"data-editable":true,"data-section-id":d,"data-field-path":"settings.buttonText"},children:a||"Learn More"})]});return jsxRuntime.jsx("div",{className:"container mx-auto px-4 py-16",children:jsxRuntime.jsxs("div",{className:`grid md:grid-cols-2 gap-12 items-center ${i==="image-top"?"grid-cols-1":""}`,children:[i==="image-left"&&u,p,i==="image-right"&&u,i==="image-top"&&u]})})}function Cn({title:e,comparisons:t=[],colors:r,typography:a,enableInlineEditing:o=false,sectionId:i=""}){let n=t.length>0?t:[{id:1,title:"Hair Transformation",beforeImage:"",afterImage:""}];return jsxRuntime.jsx("section",{className:"py-16 px-6",children:jsxRuntime.jsxs("div",{className:"max-w-7xl mx-auto",children:[jsxRuntime.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-center mb-12",style:{fontFamily:a.headingFont,color:r.text},...o&&{"data-editable":true,"data-section-id":i,"data-field-path":"settings.title"},children:e||"Results"}),jsxRuntime.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:n.map((s,l)=>jsxRuntime.jsxs("div",{className:"space-y-4",children:[s.title&&jsxRuntime.jsx("h3",{className:"text-xl font-semibold text-center",style:{color:r.text},children:s.title}),jsxRuntime.jsxs("div",{className:"relative aspect-[4/3] rounded-lg overflow-hidden",children:[jsxRuntime.jsx("div",{className:"absolute inset-0",style:{backgroundColor:r.primary,opacity:.1}}),jsxRuntime.jsx("div",{className:"absolute top-4 left-4 bg-black/50 text-white px-3 py-1 rounded text-sm",children:"Before"}),jsxRuntime.jsx("div",{className:"absolute top-4 right-4 bg-black/50 text-white px-3 py-1 rounded text-sm",children:"After"})]})]},s.id||l))})]})})}function Sn({title:e,plans:t=[],colors:r,typography:a,enableInlineEditing:o=false,sectionId:i=""}){let n=t.length>0?t:[{id:1,name:"Basic",price:50,features:["Service 1","Service 2"]},{id:2,name:"Premium",price:100,features:["Service 1","Service 2","Service 3"],featured:true},{id:3,name:"Deluxe",price:150,features:["All Services","Priority Booking"]}];return jsxRuntime.jsx("section",{className:"py-16 px-6",children:jsxRuntime.jsxs("div",{className:"max-w-7xl mx-auto",children:[jsxRuntime.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-center mb-12",style:{fontFamily:a.headingFont,color:r.text},...o&&{"data-editable":true,"data-section-id":i,"data-field-path":"settings.title"},children:e||"Pricing"}),jsxRuntime.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8",children:n.map(s=>jsxRuntime.jsxs("div",{className:`p-8 rounded-lg border-2 ${s.featured?"scale-105 shadow-xl":""}`,style:{borderColor:s.featured?r.primary:"rgba(255,255,255,0.1)",backgroundColor:s.featured?`${r.primary}15`:"rgba(255,255,255,0.05)"},children:[jsxRuntime.jsx("h3",{className:"text-2xl font-bold mb-2 text-center",style:{color:r.text},children:s.name}),jsxRuntime.jsx("div",{className:"text-center mb-6",children:jsxRuntime.jsxs("span",{className:"text-4xl font-bold",style:{color:r.primary},children:["$",s.price]})}),jsxRuntime.jsx("ul",{className:"space-y-3 mb-6",children:s.features.map((l,c)=>jsxRuntime.jsxs("li",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",style:{color:r.primary},children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),jsxRuntime.jsx("span",{style:{color:r.text},children:l})]},c))}),jsxRuntime.jsx("button",{className:"w-full px-6 py-3 rounded-lg font-semibold transition-all hover:scale-105",style:{backgroundColor:s.featured?r.primary:"rgba(255,255,255,0.1)",color:s.featured?"#FFFFFF":r.text},children:"Choose Plan"})]},s.id))})]})})}function Fn({username:e,colors:t,enableInlineEditing:r=false,sectionId:a=""}){return jsxRuntime.jsx("div",{className:"container mx-auto px-4 py-8",children:jsxRuntime.jsxs("div",{className:"max-w-4xl mx-auto",children:[jsxRuntime.jsxs("p",{className:"text-center text-sm opacity-60 mb-4",children:["Instagram Feed: ",e||"@handle"]}),jsxRuntime.jsx("div",{className:"grid grid-cols-3 gap-1",children:[1,2,3,4,5,6].map(o=>jsxRuntime.jsx("div",{className:"aspect-square rounded",style:{backgroundColor:t.primary,opacity:.2}},o))})]})})}function In({name:e,subheading:t,bio:r,links:a=[],bookingButtonText:o,bookingButtonUrl:i,showBookingButton:n=true,position:s="bottom-left",cardWidth:l="medium",cardColor:c="#FFFFFF",colors:d,typography:u,enableInlineEditing:p=false,sectionId:g=""}){let b=(N,C)=>{let h=parseInt(N.slice(1,3),16),k=parseInt(N.slice(3,5),16),S=parseInt(N.slice(5,7),16);return `rgba(${h}, ${k}, ${S}, ${C})`},v={small:"280px",medium:"320px",large:"400px"},w={"bottom-left":"bottom-0 left-0","bottom-right":"bottom-0 right-0","bottom-center":"bottom-0 left-1/2 -translate-x-1/2"},f=s==="bottom-left"?"text-left":s==="bottom-right"?"text-right":"text-center",x=s==="bottom-left"?"justify-start":s==="bottom-right"?"justify-end":"justify-center",y=()=>s==="bottom-left"?"rounded-tr-3xl rounded-tl-none":s==="bottom-right"?"rounded-tl-3xl rounded-tr-none":"rounded-t-3xl";return jsxRuntime.jsx("div",{className:`fixed z-50 ${w[s]}`,style:{width:v[l]},children:jsxRuntime.jsxs("div",{className:`${y()} shadow-2xl border-t border-x`,style:{backgroundColor:b(c,.9),borderColor:b(c,.3),boxShadow:"0 -10px 40px rgba(0, 0, 0, 0.1)"},children:[jsxRuntime.jsx("div",{className:`px-8 pt-8 pb-3 ${f}`,children:jsxRuntime.jsx("h3",{className:"text-2xl font-bold",style:{fontFamily:u.headingFont,color:d.text},...p&&{"data-editable":true,"data-section-id":g,"data-field-path":"settings.name"},children:e||"Your Name"})}),jsxRuntime.jsx("div",{className:"mb-6",children:t?jsxRuntime.jsxs("div",{className:`flex items-center gap-3 px-8 ${x}`,children:[jsxRuntime.jsx("span",{className:"text-xs font-medium whitespace-nowrap",style:{color:d.primary},...p&&{"data-editable":true,"data-section-id":g,"data-field-path":"settings.subheading"},children:t}),jsxRuntime.jsx("div",{className:"flex-1 h-px",style:{backgroundColor:d.primary,opacity:.3}})]}):jsxRuntime.jsx("div",{className:"w-full h-px",style:{backgroundColor:d.primary,opacity:.3}})}),jsxRuntime.jsxs("div",{className:`px-8 pb-8 ${f}`,children:[jsxRuntime.jsx("p",{className:"text-sm opacity-80 mb-4",style:{color:d.text},...p&&{"data-editable":true,"data-section-id":g,"data-field-path":"settings.bio"},children:r||"Transforming beauty, one client at a time \u2728"}),a.length>0&&jsxRuntime.jsx("div",{className:"space-y-2 mb-4",children:a.map((N,C)=>jsxRuntime.jsx("a",{href:N.url,target:"_blank",rel:"noopener noreferrer",className:"block text-sm font-medium hover:opacity-70 transition-opacity",style:{color:d.primary},...p&&{"data-editable":true,"data-section-id":g,"data-field-path":`settings.links.${C}.label`},children:N.label},N.id))}),n&&jsxRuntime.jsx("a",{href:i||"/book",className:"block w-full py-3 px-4 rounded-xl text-center font-semibold transition-all hover:scale-105 hover:shadow-lg",style:{backgroundColor:d.primary,color:d.buttonText||"#FFFFFF"},...p&&{"data-editable":true,"data-section-id":g,"data-field-path":"settings.bookingButtonText"},children:o||"Book Appointment"})]})]})})}function En({config:e,colors:t,BookingFlowComponent:r,enableInlineEditing:a=false,sectionId:o=""}){return r?jsxRuntime.jsx("div",{className:"container mx-auto px-4 py-16",children:jsxRuntime.jsx(r,{config:e,colors:t})}):jsxRuntime.jsx("div",{className:"container mx-auto px-4 py-16",children:jsxRuntime.jsx("div",{className:"max-w-4xl mx-auto text-center",children:jsxRuntime.jsxs("div",{className:"p-12 rounded-2xl border-2 border-dashed",style:{borderColor:t.primary,opacity:.5},children:[jsxRuntime.jsx("div",{className:"text-6xl mb-4",children:"\u{1F4C5}"}),jsxRuntime.jsx("h3",{className:"text-2xl font-bold mb-3",style:{color:t.text},children:"Booking Flow"}),jsxRuntime.jsx("p",{className:"text-base opacity-70",style:{color:t.text},children:"Pass a BookingFlowComponent prop to render your custom booking flow here."})]})})})}function Rn({videoUrl:e,aspectRatio:t="16:9",autoplay:r=false,loop:a=false,muted:o=true,controls:i=true,allowFullScreen:n=true,coverImage:s,maxWidth:l="large",alignment:c="center",borderRadius:d=12,colors:u,enableInlineEditing:p=false,sectionId:g=""}){let v=(y=>{let N=y.match(/(?:youtube\.com\/watch\?v=|youtu\.be\/|youtube\.com\/embed\/)([a-zA-Z0-9_-]+)/);if(N){let h=N[1],k=new URLSearchParams({...r?{autoplay:"1"}:{},...a?{loop:"1",playlist:h}:{},...o?{mute:"1"}:{},...i?{}:{controls:"0"}});return {type:"youtube",embedUrl:`https://www.youtube.com/embed/${h}?${k.toString()}`}}let C=y.match(/(?:vimeo\.com\/)(\d+)/);if(C){let h=C[1],k=new URLSearchParams({...r?{autoplay:"1"}:{},...a?{loop:"1"}:{},...o?{muted:"1"}:{},...i?{}:{controls:"0"}});return {type:"vimeo",embedUrl:`https://player.vimeo.com/video/${h}?${k.toString()}`}}return y.match(/\.(mp4|webm|ogg)$/i)?{type:"direct",embedUrl:y}:null})(e),w={"16:9":"56.25%","4:3":"75%","1:1":"100%","9:16":"177.78%"},f={full:"max-w-full",large:"max-w-6xl",medium:"max-w-4xl",small:"max-w-2xl"},x=c==="center"?"mx-auto":c==="right"?"ml-auto":"mr-auto";return jsxRuntime.jsx("div",{className:"container mx-auto px-4",children:jsxRuntime.jsx("div",{className:`${f[l]} ${x}`,children:jsxRuntime.jsx("div",{className:"relative w-full overflow-hidden",style:{paddingBottom:w[t],borderRadius:`${d}px`},children:v?v.type==="direct"?jsxRuntime.jsx("video",{src:v.embedUrl,autoPlay:r,loop:a,muted:o,controls:i,poster:s,className:"absolute top-0 left-0 w-full h-full object-cover"}):jsxRuntime.jsx("iframe",{src:v.embedUrl,className:"absolute top-0 left-0 w-full h-full",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:n,title:"Video"}):jsxRuntime.jsx("div",{className:"absolute top-0 left-0 w-full h-full flex items-center justify-center",style:{backgroundColor:`${u.primary}20`},children:jsxRuntime.jsxs("div",{className:"text-center px-4",children:[jsxRuntime.jsxs("svg",{className:"w-16 h-16 mx-auto mb-4",fill:"none",stroke:u.primary,viewBox:"0 0 24 24",children:[jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z"}),jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})]}),jsxRuntime.jsx("p",{style:{color:u.text,opacity:.6},children:e?"Invalid video URL":"Add a video URL to display"})]})})})})})}function Pn({text:e="SCROLL TEXT",scrollDirection:t="left",scrollSpeed:r="medium",orientation:a="horizontal",dividerIcon:o="bullet",customIcon:i,textSize:n="medium",textColor:s,fontWeight:l="bold",backgroundColor:c,backgroundGradient:d,pauseOnHover:u=true,colors:p,typography:g,enableInlineEditing:b=false,sectionId:v=""}){let[w,f]=Ge.useState(false),y={bullet:"\u2022",star:"\u2605",diamond:"\u25C6",custom:i||"\u2022",none:""}[o],C=typeof r=="number"?r:{slow:60,medium:30,fast:15}[r],h={small:"text-xl md:text-2xl",medium:"text-2xl md:text-4xl",large:"text-3xl md:text-5xl",xl:"text-4xl md:text-6xl"},k={light:"font-light",normal:"font-normal",bold:"font-bold"},S={horizontal:"0deg","diagonal-left":"-5deg","diagonal-right":"5deg"},I=y?`${e} ${y} `.repeat(20):`${e} `.repeat(20);return jsxRuntime.jsxs("div",{className:"relative overflow-hidden py-3",style:{...d?{background:d}:{backgroundColor:c||"transparent"},transform:`rotate(${S[a]})`},onMouseEnter:()=>u&&f(true),onMouseLeave:()=>u&&f(false),children:[jsxRuntime.jsx("style",{children:`
2
2
  @keyframes scroll-${t} {
3
3
  0% {
4
4
  transform: translateX(${t==="left"?"0%":"-50%"});
@@ -7,16 +7,16 @@
7
7
  transform: translateX(${t==="left"?"-50%":"0%"});
8
8
  }
9
9
  }
10
- `}),jsxRuntime.jsxs("div",{className:`flex items-center whitespace-nowrap ${x[n]} ${F[l]} uppercase tracking-wider`,style:{fontFamily:p?.headingFont||"inherit",color:s||m.text,animation:`scroll-${t} ${S}s linear infinite`,animationPlayState:N?"paused":"running"},children:[jsxRuntime.jsx("span",{className:"inline-block",children:I}),jsxRuntime.jsx("span",{className:"inline-block","aria-hidden":"true",children:I})]})]})}function An({address:e,displayType:t="both",mapHeight:r="medium",mapStyle:a="roadmap",zoom:o=15,showMarker:i=true,borderRadius:n=12,directionsButtonText:s="Get Directions",colors:l,typography:c,enableInlineEditing:d=false,sectionId:u=""}){let p={small:300,medium:400,large:500}[r],b=encodeURIComponent(e),w=`https://www.google.com/maps/dir/?api=1&destination=${b}`,g=`https://www.google.com/maps/embed/v1/place?key=${undefined?.VITE_GOOGLE_MAPS_API_KEY||typeof globalThis<"u"&&globalThis.process?.env?.NEXT_PUBLIC_GOOGLE_MAPS_API_KEY||""}&q=${b}&zoom=${o}&maptype=${a}`;return jsxRuntime.jsx("div",{className:"container mx-auto px-4",children:jsxRuntime.jsxs("div",{className:"max-w-4xl mx-auto",children:[(t==="map-only"||t==="both")&&e&&jsxRuntime.jsx("div",{className:"w-full overflow-hidden mb-6",style:{height:`${p}px`,borderRadius:`${n}px`},children:jsxRuntime.jsx("iframe",{src:g,className:"w-full h-full",style:{border:0},allowFullScreen:true,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",title:"Location Map"})}),(t==="address-only"||t==="both")&&jsxRuntime.jsx("div",{className:"p-6 rounded-lg border",style:{backgroundColor:`${l.primary}10`,borderColor:`${l.primary}30`,borderRadius:`${n}px`},children:jsxRuntime.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-4",children:[jsxRuntime.jsx("div",{className:"flex-1",children:jsxRuntime.jsxs("div",{className:"flex items-start gap-3",children:[jsxRuntime.jsxs("svg",{className:"w-5 h-5 mt-0.5 flex-shrink-0",fill:"none",stroke:l.primary,viewBox:"0 0 24 24",children:[jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"font-medium mb-1",style:{color:l.text,fontFamily:c?.bodyFont||"inherit"},...d&&{"data-editable":true,"data-section-id":u,"data-field-path":"settings.address"},children:e||"Add your address"}),e&&jsxRuntime.jsx("a",{href:w,target:"_blank",rel:"noopener noreferrer",className:"text-sm underline hover:no-underline",style:{color:l.primary},children:"View in Google Maps \uFFFD"})]})]})}),e&&jsxRuntime.jsx("a",{href:w,target:"_blank",rel:"noopener noreferrer",className:"px-6 py-3 rounded-lg font-semibold transition-all hover:opacity-90 text-center",style:{backgroundColor:l.primary,color:"#FFFFFF"},children:s})]})}),!e&&jsxRuntime.jsxs("div",{className:"p-12 rounded-lg border-2 border-dashed text-center",style:{borderColor:`${l.primary}30`,borderRadius:`${n}px`},children:[jsxRuntime.jsxs("svg",{className:"w-12 h-12 mx-auto mb-4",fill:"none",stroke:l.primary,viewBox:"0 0 24 24",children:[jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})]}),jsxRuntime.jsx("p",{style:{color:l.text,opacity:.6},children:"Add your business address to display a map"})]})]})})}function Mn({imageUrl:e,altText:t="",caption:r,maxWidth:a="large",alignment:o="center",aspectRatio:i="auto",borderRadius:n=12,linkUrl:s,openInNewTab:l=true,colors:c,typography:d,enableInlineEditing:u=false,sectionId:m=""}){let p={full:"max-w-full",large:"max-w-6xl",medium:"max-w-4xl",small:"max-w-2xl"},b={auto:null,"16:9":"56.25%","4:3":"75%","1:1":"100%","3:2":"66.67%"},w=o==="center"?"mx-auto":o==="right"?"ml-auto":"mr-auto",N=jsxRuntime.jsxs("div",{className:`${p[a]} ${w}`,children:[jsxRuntime.jsx("div",{className:"relative w-full overflow-hidden",style:{borderRadius:`${n}px`,...b[i]&&{paddingBottom:b[i]}},children:e?jsxRuntime.jsx("img",{src:e,alt:t||"Image",className:i==="auto"?"w-full h-auto":"absolute top-0 left-0 w-full h-full object-cover",style:{borderRadius:`${n}px`}}):jsxRuntime.jsx("div",{className:"flex items-center justify-center bg-gray-100",style:{backgroundColor:`${c.primary}10`,borderRadius:`${n}px`,minHeight:i==="auto"?"300px":void 0},children:jsxRuntime.jsxs("div",{className:"text-center px-4",children:[jsxRuntime.jsx("svg",{className:"w-16 h-16 mx-auto mb-4",fill:"none",stroke:c.primary,viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),jsxRuntime.jsx("p",{style:{color:c.text,opacity:.6},children:"Add an image URL to display"})]})})}),r&&e&&jsxRuntime.jsx("p",{className:"mt-3 text-sm text-center",style:{color:c.text,opacity:.7,fontFamily:d?.bodyFont||"inherit"},...u&&{"data-editable":true,"data-section-id":m,"data-field-path":"settings.caption"},children:r})]});return jsxRuntime.jsx("div",{className:a==="full"?"w-full":"container mx-auto px-4",children:s&&e?jsxRuntime.jsx("a",{href:s,target:l?"_blank":"_self",rel:l?"noopener noreferrer":void 0,className:"block",children:N}):N})}function Xa({faq:e,index:t,colors:r,typography:a,enableInlineEditing:o,sectionId:i}){let[n,s]=Ge.useState(false);return jsxRuntime.jsxs("div",{className:"border-b border-opacity-10",style:{borderColor:r.text},children:[jsxRuntime.jsxs("button",{onClick:()=>s(!n),className:"w-full py-4 px-6 flex items-center justify-between text-left hover:bg-opacity-5 transition-colors",style:{backgroundColor:n?`${r.primary}10`:"transparent"},children:[jsxRuntime.jsx("span",{className:"font-semibold text-lg pr-4",style:{color:r.text,fontFamily:a?.headingFont||"inherit"},...o&&{"data-editable":true,"data-section-id":i,"data-field-path":`settings.faqs.${t}.question`},children:e.question||"Add question..."}),jsxRuntime.jsx("svg",{className:"w-5 h-5 flex-shrink-0 transition-transform",style:{color:r.primary,transform:n?"rotate(180deg)":"rotate(0deg)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),n&&jsxRuntime.jsx("div",{className:"px-6 pb-4 pt-2",style:{color:r.text,opacity:.8,fontFamily:a?.bodyFont||"inherit"},...o&&{"data-editable":true,"data-section-id":i,"data-field-path":`settings.faqs.${t}.answer`},children:e.answer||"Add answer..."})]})}function $n({title:e="Frequently Asked Questions",faqs:t=[],layout:r="accordion",maxWidth:a="large",colors:o,typography:i,enableInlineEditing:n=false,sectionId:s=""}){return jsxRuntime.jsx("div",{className:"container mx-auto px-4",children:jsxRuntime.jsxs("div",{className:`${{full:"max-w-full",large:"max-w-4xl",medium:"max-w-3xl",small:"max-w-2xl"}[a]} mx-auto`,children:[e&&jsxRuntime.jsx("h2",{className:"text-3xl font-bold text-center mb-8",style:{color:o.text,fontFamily:i?.headingFont||"inherit"},...n&&{"data-editable":true,"data-section-id":s,"data-field-path":"settings.title"},children:e}),t.length>0?jsxRuntime.jsx("div",{className:"rounded-lg overflow-hidden",style:{border:`1px solid ${o.text}20`,backgroundColor:`${o.primary}05`},children:t.map((c,d)=>r==="accordion"?jsxRuntime.jsx(Xa,{faq:c,index:d,colors:o,typography:i,enableInlineEditing:n,sectionId:s},d):jsxRuntime.jsxs("div",{className:"border-b border-opacity-10 last:border-b-0 p-6",style:{borderColor:o.text},children:[jsxRuntime.jsx("h3",{className:"font-semibold text-lg mb-2",style:{color:o.text,fontFamily:i?.headingFont||"inherit"},...n&&{"data-editable":true,"data-section-id":s,"data-field-path":`settings.faqs.${d}.question`},children:c.question||"Add question..."}),jsxRuntime.jsx("p",{style:{color:o.text,opacity:.8,fontFamily:i?.bodyFont||"inherit"},...n&&{"data-editable":true,"data-section-id":s,"data-field-path":`settings.faqs.${d}.answer`},children:c.answer||"Add answer..."})]},d))}):jsxRuntime.jsxs("div",{className:"p-12 rounded-lg border-2 border-dashed text-center",style:{borderColor:`${o.primary}30`,backgroundColor:`${o.primary}05`},children:[jsxRuntime.jsx("svg",{className:"w-12 h-12 mx-auto mb-4",fill:"none",stroke:o.primary,viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),jsxRuntime.jsx("p",{style:{color:o.text,opacity:.6},children:"Add FAQ items to get started"})]})]})})}function Bn({brandName:e="Your Brand",logoUrl:t,showLogo:r=true,showBrandName:a=true,links:o=[],ctaText:i,ctaUrl:n,sticky:s=true,transparentOnTop:l=false,colors:c,typography:d,enableInlineEditing:u=false,sectionId:m=""}){let[p,b]=Ge.useState(false),[w,N]=Ge.useState(false),[g,v]=Ge.useState("");Ge.useEffect(()=>{let x=()=>{N(window.scrollY>20);};return window.addEventListener("scroll",x),()=>window.removeEventListener("scroll",x)},[]),Ge.useEffect(()=>{let x=()=>{let F=o.filter(I=>I.url.startsWith("#")).map(I=>document.querySelector(`[data-section-id="${I.url.substring(1)}"]`)).filter(Boolean),k="";F.forEach(I=>{if(I){let y=I.getBoundingClientRect();y.top<=100&&y.bottom>=100&&(k=I.getAttribute("data-section-id")||"");}}),v(k);};return window.addEventListener("scroll",x),()=>window.removeEventListener("scroll",x)},[o]);let f=(x,F)=>{if(F.startsWith("#")){x.preventDefault();let k=F.substring(1),I=document.querySelector(`[data-section-id="${k}"]`);I&&I.scrollIntoView({behavior:"smooth",block:"start"}),b(false);}},C=l&&!w;return jsxRuntime.jsx("nav",{className:`${s?"sticky top-0 z-50":""} ${C?"bg-transparent":s?"bg-white/80 backdrop-blur-md border-b":"bg-white border-b"} transition-all duration-300`,style:{borderColor:C?"transparent":`${c.primary}20`},children:jsxRuntime.jsxs("div",{className:"container mx-auto px-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between h-16 md:h-20",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[r&&t&&jsxRuntime.jsx("img",{src:t,alt:e,className:"h-8 md:h-10 w-auto object-contain"}),a&&jsxRuntime.jsx("h1",{className:"text-xl md:text-2xl font-bold",style:{fontFamily:d?.headingFont||"inherit",color:c.text},...u&&{"data-editable":true,"data-section-id":m,"data-field-path":"settings.brandName"},children:e})]}),jsxRuntime.jsxs("div",{className:"hidden md:flex items-center gap-8",children:[o.map((x,F)=>{let k=x.url.startsWith("#")&&x.url.substring(1)===g;return jsxRuntime.jsxs("a",{href:x.url,onClick:I=>f(I,x.url),className:"relative text-base font-medium transition-colors group",style:{color:k?c.primary:c.text,fontFamily:d?.bodyFont||"inherit"},...x.linkType==="external"&&!x.url.startsWith("#")?{target:"_blank",rel:"noopener noreferrer"}:{},...u&&{"data-editable":true,"data-section-id":m,"data-field-path":`settings.links.${F}.label`},children:[x.label,jsxRuntime.jsx("span",{className:`absolute -bottom-1 left-0 h-0.5 transition-all ${k?"w-full":"w-0 group-hover:w-full"}`,style:{backgroundColor:c.primary}})]},x.id)}),i&&n&&jsxRuntime.jsx("a",{href:n,className:"px-6 py-2.5 rounded-full font-semibold transition-all hover:opacity-90 hover:scale-105",style:{backgroundColor:c.primary,color:c.buttonText||"#FFFFFF",fontFamily:d?.bodyFont||"inherit"},children:i})]}),jsxRuntime.jsx("button",{onClick:()=>b(!p),className:"md:hidden p-2 rounded-lg transition-colors hover:bg-black/5","aria-label":"Toggle menu",children:jsxRuntime.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:c.text,viewBox:"0 0 24 24",children:p?jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"}):jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})]}),jsxRuntime.jsx("div",{className:`md:hidden overflow-hidden transition-all duration-300 ${p?"max-h-96 pb-4":"max-h-0"}`,children:jsxRuntime.jsxs("div",{className:"flex flex-col space-y-3 pt-4 border-t",style:{borderColor:`${c.primary}20`},children:[o.map((x,F)=>{let k=x.url.startsWith("#")&&x.url.substring(1)===g;return jsxRuntime.jsx("a",{href:x.url,onClick:I=>f(I,x.url),className:"text-base font-medium py-2 px-4 rounded-lg transition-colors",style:{color:k?c.primary:c.text,backgroundColor:k?`${c.primary}10`:"transparent",fontFamily:d?.bodyFont||"inherit"},...x.linkType==="external"&&!x.url.startsWith("#")?{target:"_blank",rel:"noopener noreferrer"}:{},children:x.label},x.id)}),i&&n&&jsxRuntime.jsx("a",{href:n,className:"px-6 py-3 rounded-full font-semibold text-center transition-all hover:opacity-90",style:{backgroundColor:c.primary,color:c.buttonText||"#FFFFFF",fontFamily:d?.bodyFont||"inherit"},children:i})]})})]})})}function zn({title:e,content:t,alignment:r="left",maxWidth:a="medium",textSize:o="medium",backgroundColor:i,textColor:n,paddingY:s="medium",colors:l,typography:c,enableInlineEditing:d=false,sectionId:u=""}){let m={full:"max-w-full",large:"max-w-6xl",medium:"max-w-4xl",small:"max-w-2xl"},p={left:"text-left",center:"text-center",right:"text-right"},b={small:"text-sm",medium:"text-base",large:"text-lg"};return jsxRuntime.jsx("div",{className:{none:"py-0",small:"py-8",medium:"py-16",large:"py-24"}[s],style:{backgroundColor:i||"transparent"},children:jsxRuntime.jsx("div",{className:"container mx-auto px-4",children:jsxRuntime.jsxs("div",{className:`${m[a]} mx-auto ${p[r]}`,children:[e&&jsxRuntime.jsx("h2",{className:"text-3xl md:text-4xl font-bold mb-6",style:{color:n||l.text,fontFamily:c?.headingFont||"inherit"},...d&&{"data-editable":true,"data-section-id":u,"data-field-path":"settings.title"},children:e}),jsxRuntime.jsx("div",{className:`${b[o]} leading-relaxed whitespace-pre-wrap`,style:{color:n||l.text,fontFamily:c?.bodyFont||"inherit"},...d&&{"data-editable":true,"data-section-id":u,"data-field-path":"settings.content"},children:t||"Add your text content here..."})]})})})}function Ac(e,t=false){if(t)return .15;switch(e){case "fast":return .2;case "slow":return .5;default:return .3}}function Ja(e=50){return {enter:t=>({x:t==="forward"?e:-e,opacity:0}),center:{x:0,opacity:1},exit:t=>({x:t==="forward"?-e:e,opacity:0})}}function Qa(){return {enter:()=>({opacity:0,scale:.95}),center:{opacity:1,scale:1},exit:()=>({opacity:0,scale:.95})}}function Mc(e,t){return e==="fade"?Qa():Ja(t)}var rr={easing:[.4,0,.2,1],spring:{type:"spring",damping:30,stiffness:300},staggerChildren:{staggerChildren:.05,delayChildren:.1},cardHover:{scale:1.02,transition:{duration:.2}},buttonHover:{scale:1.05,transition:{duration:.2}},fadeIn:{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},slideUp:{initial:{y:"100%"},animate:{y:0},exit:{y:"100%"}},scaleIn:{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9}},slideInLeft:{initial:{opacity:0,x:-10},animate:{opacity:1,x:0}},slideInRight:{initial:{opacity:0,x:10},animate:{opacity:1,x:0}},backdrop:{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}}};function $c(){return typeof window>"u"?false:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function Lc(e,t=.1,r=.05){return Array.from({length:e},(a,o)=>({initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.3,delay:t+o*r,ease:rr.easing}}))}function ge(e=0,t=.3){return {initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:t,delay:e,ease:rr.easing}}}function On({services:e,categories:t=[],selectedService:r,onServiceSelect:a,settings:o,colors:i}){let[n,s]=Ge.useState(null),[l,c]=Ge.useState(new Set(t.length>0?[t[0].id]:[])),d=o.serviceLayout||"grid",u=o.columns||2,m=o.headerContent?.value||"Choose Your Service",p=o.subheaderContent?.value||"Select the service you'd like to book",b=o.showPricing!==false,w=o.showDuration!==false,N=o.showDescription!==false,g=o.enableCategories===true,v=o.categoryStyle||"dropdown",f=o.policyImages||[],C=o.policyText||null,S=o.imageSpacing||"small",x={none:"0px",small:"8px",medium:"16px",large:"24px"},F=o.imageBorderRadius||"0px",k={1:"grid-cols-1",2:"grid-cols-1 sm:grid-cols-2",3:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",4:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4"}[u]||"grid-cols-2",I=g&&n?e.filter(h=>h.category===n):e,y=(h,E)=>{let W=r===h.id;return jsxRuntime.jsx("button",{onClick:()=>a(h.id),className:`w-full ${E==="grid"?"h-full":""} p-4 rounded-lg border-2 transition-all text-left ${E==="grid"?"flex flex-col":""} ${W?"border-current shadow-lg":"border-gray-200 hover:border-gray-300"}`,style:{borderColor:W?i.primary:void 0,backgroundColor:W?`${i.primary}10`:void 0},children:E==="grid"?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("p",{className:"font-semibold mb-1",children:h.name}),N&&jsxRuntime.jsx("p",{className:"text-xs opacity-70 mb-2 flex-1",children:h.description}),jsxRuntime.jsxs("div",{className:"flex justify-between items-center text-sm mt-auto",children:[b&&jsxRuntime.jsxs("span",{className:"font-bold",style:{color:i.primary},children:["$",h.price]}),w&&jsxRuntime.jsxs("span",{className:"opacity-60",children:[h.duration," min"]})]})]}):jsxRuntime.jsxs("div",{className:"flex justify-between items-start",children:[jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx("p",{className:"font-semibold mb-1",children:h.name}),N&&jsxRuntime.jsx("p",{className:"text-sm opacity-70",children:h.description})]}),jsxRuntime.jsxs("div",{className:"text-right ml-4",children:[b&&jsxRuntime.jsxs("p",{className:"font-bold",style:{color:i.primary},children:["$",h.price]}),w&&jsxRuntime.jsxs("p",{className:"text-sm opacity-60",children:[h.duration," min"]})]})]})},h.id)};return jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs(framerMotion.motion.div,{...ge(.05),className:"text-center sm:text-left",children:[jsxRuntime.jsx("h2",{className:"text-xl sm:text-2xl font-bold mb-2",style:{color:i.primary},children:m}),jsxRuntime.jsx("p",{className:"text-sm opacity-70",children:p})]}),f&&f.length>0&&jsxRuntime.jsx("div",{className:"w-full flex flex-col",style:{gap:x[S]},children:f.slice(0,3).map((h,E)=>jsxRuntime.jsx("div",{className:"w-full overflow-hidden",style:{aspectRatio:"720 / 300",borderRadius:F},children:jsxRuntime.jsx("img",{src:h.url,alt:h.alt||`Policy image ${E+1}`,className:"w-full h-full object-cover"})},E))}),(!f||f.length===0)&&C&&jsxRuntime.jsx("div",{className:"w-full p-4 rounded-lg border",style:{backgroundColor:`${i.primary}10`,borderColor:`${i.primary}30`},dangerouslySetInnerHTML:{__html:C}}),g&&t.length>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[v==="dropdown"&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-2",children:"Service Category"}),jsxRuntime.jsxs("select",{value:n||"all",onChange:h=>s(h.target.value==="all"?null:h.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:border-transparent transition-all",style:{"--tw-ring-color":i.primary},children:[jsxRuntime.jsx("option",{value:"all",children:"All Services"}),t.map(h=>jsxRuntime.jsx("option",{value:h.id,children:h.name},h.id))]})]}),v==="tabs"&&jsxRuntime.jsxs("div",{className:"flex gap-2 flex-wrap",children:[jsxRuntime.jsx("button",{onClick:()=>s(null),className:`px-4 py-2 rounded-lg transition-all text-sm font-medium ${n===null?"text-white shadow-lg":"border border-gray-300 hover:border-gray-400"}`,style:{backgroundColor:n===null?i.primary:void 0},children:"All Services"}),t.map(h=>jsxRuntime.jsx("button",{onClick:()=>s(h.id),className:`px-4 py-2 rounded-lg transition-all text-sm font-medium ${n===h.id?"text-white shadow-lg":"border border-gray-300 hover:border-gray-400"}`,style:{backgroundColor:n===h.id?i.primary:void 0},children:h.name},h.id))]}),v==="pills"&&jsxRuntime.jsxs("div",{className:"flex gap-2 overflow-x-auto pb-2 scrollbar-hide",children:[jsxRuntime.jsx("button",{onClick:()=>s(null),className:`px-5 py-2 rounded-full transition-all text-sm font-medium whitespace-nowrap ${n===null?"text-white shadow-md":"bg-gray-100 hover:bg-gray-200"}`,style:{backgroundColor:n===null?i.primary:void 0},children:"All"}),t.map(h=>jsxRuntime.jsx("button",{onClick:()=>s(h.id),className:`px-5 py-2 rounded-full transition-all text-sm font-medium whitespace-nowrap ${n===h.id?"text-white shadow-md":"bg-gray-100 hover:bg-gray-200"}`,style:{backgroundColor:n===h.id?i.primary:void 0},children:h.name},h.id))]}),v==="chips"&&jsxRuntime.jsxs("div",{className:"flex gap-2 flex-wrap",children:[jsxRuntime.jsxs("button",{onClick:()=>s(null),className:`px-3 py-1.5 rounded-lg transition-all text-xs font-medium flex items-center gap-1.5 ${n===null?"text-white":"border border-gray-300 bg-white hover:border-gray-400"}`,style:{backgroundColor:n===null?i.primary:void 0,borderColor:n===null?i.primary:void 0},children:[n===null&&jsxRuntime.jsx("span",{className:"text-[10px]",children:"\u2713"}),"All"]}),t.map(h=>jsxRuntime.jsxs("button",{onClick:()=>s(h.id),className:`px-3 py-1.5 rounded-lg transition-all text-xs font-medium flex items-center gap-1.5 ${n===h.id?"text-white":"border border-gray-300 bg-white hover:border-gray-400"}`,style:{backgroundColor:n===h.id?i.primary:void 0,borderColor:n===h.id?i.primary:void 0},children:[n===h.id&&jsxRuntime.jsx("span",{className:"text-[10px]",children:"\u2713"}),h.name]},h.id))]})]}),g&&v==="accordion"?jsxRuntime.jsx("div",{className:"space-y-4",children:t.map(h=>{let E=l.has(h.id),W=e.filter(O=>O.category===h.id);return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("button",{onClick:()=>{let O=new Set(l);E?O.delete(h.id):O.add(h.id),c(O);},className:"w-full flex items-center justify-between py-2 border-b-2 transition-all group",style:{borderColor:E?i.primary:"#e5e7eb"},children:[jsxRuntime.jsx("span",{className:"font-semibold text-left transition-colors",style:{color:E?i.primary:void 0},children:h.name}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:`w-4 h-4 transition-all ${E?"rotate-180":""}`,style:{color:E?i.primary:"#9ca3af"}})]}),E&&jsxRuntime.jsx("div",{className:`mt-4 ${d==="grid"?`grid ${k} gap-3`:"space-y-3"}`,children:W.map(O=>y(O,d))})]},h.id)})}):d==="grid"?jsxRuntime.jsx("div",{className:`grid ${k} gap-3`,children:I.map(h=>y(h,"grid"))}):jsxRuntime.jsx("div",{className:"space-y-3",children:I.map(h=>y(h,"list"))})]})}function oi(){let e=[],t=new Date;t.setHours(0,0,0,0);for(let r=0;r<3;r++){let a=new Date(t.getFullYear(),t.getMonth()+r,1),o=new Date(a.getFullYear(),a.getMonth()+1,0).getDate();for(let i=1;i<=o;i++){if(new Date(a.getFullYear(),a.getMonth(),i)<t||Math.random()>.6)continue;let s=`${a.getFullYear()}-${String(a.getMonth()+1).padStart(2,"0")}-${String(i).padStart(2,"0")}`;e.push(s);}}return e}var ko={avoid:{bg:"#FEE2E2",text:"#991B1B",label:"Avoid"},caution:{bg:"#FEF3C7",text:"#92400E",label:"Caution"},optimal:{bg:"#D1FAE5",text:"#065F46",label:"Optimal"},neutral:{bg:"#F3F4F6",text:"#4B5563",label:"Neutral"}};function nr({availableDates:e,selectedDate:t,onDateSelect:r,settings:a,colors:o,cyclePhases:i,selectedService:n,addons:s=[],selectedAddons:l=[],onAddonsChange:c,addonPlacement:d="date_selection"}){console.log("[DateSelection] Addon Debug:",{addonsLength:s.length,hasOnAddonsChange:!!c,addonPlacement:d,showAddons:d!=="separate_step"&&s.length>0&&!!c,addons:s,selectedService:n});let u=a.calendarView||"month",m=a.headerContent?.value||"Select a Date",p=!e||e.length===0,b=Ge.useMemo(()=>p?oi():e,[p,e]),w=Ge.useMemo(()=>{let D=new Date;if(D.setHours(0,0,0,0),b.length>0){let T=b.find(P=>new Date(P)>=D);if(T){let P=new Date(T);return `${P.getFullYear()}-${String(P.getMonth()+1).padStart(2,"0")}`}}return `${D.getFullYear()}-${String(D.getMonth()+1).padStart(2,"0")}`},[b]),[N,g]=Ge.useState(w),v=Ge.useMemo(()=>new Set(b),[b]),[f,C]=N.split("-").map(Number),x=["January","February","March","April","May","June","July","August","September","October","November","December"][C-1],F=Ge.useMemo(()=>{let D=new Date(f,C-1,1),T=new Date(f,C,0),P=D.getDay(),L=T.getDate(),K=[];for(let Y=0;Y<P;Y++)K.push(null);for(let Y=1;Y<=L;Y++){let Te=`${f}-${String(C).padStart(2,"0")}-${String(Y).padStart(2,"0")}`,H=new Date(Te),ie=new Date;ie.setHours(0,0,0,0),K.push({day:Y,dateStr:Te,isAvailable:v.has(Te)&&H>=ie});}return K},[f,C,v]),k=Ge.useMemo(()=>{let D=new Date(f,C-2,1),T=`${D.getFullYear()}-${String(D.getMonth()+1).padStart(2,"0")}`;return b.some(P=>P.startsWith(T))},[b,f,C]),I=Ge.useMemo(()=>{let D=new Date(f,C,1),T=`${D.getFullYear()}-${String(D.getMonth()+1).padStart(2,"0")}`;return b.some(P=>P.startsWith(T))},[b,f,C]),y=()=>{if(!k)return;let D=new Date(f,C-2,1);g(`${D.getFullYear()}-${String(D.getMonth()+1).padStart(2,"0")}`);},h=()=>{if(!I)return;let D=new Date(f,C,1);g(`${D.getFullYear()}-${String(D.getMonth()+1).padStart(2,"0")}`);},E=i&&Object.keys(i).length>0,W=()=>{let D=n?.price||0;return l.length>0&&s.length>0&&l.forEach(T=>{let P=s.find(L=>L.id===T);P&&(D+=P.addonPrice||P.price||0);}),D},O=D=>{if(!c)return;let T=l.includes(D);c(T?l.filter(P=>P!==D):[...l,D]);};return jsxRuntime.jsxs("div",{className:"space-y-6",children:[n&&jsxRuntime.jsx(framerMotion.motion.div,{...ge(.05),className:"bg-gradient-to-br from-white to-gray-50/30 rounded-xl border border-gray-200/80 p-6 shadow-sm hover:shadow-md transition-shadow",children:jsxRuntime.jsxs("div",{className:"flex items-start justify-between gap-4",children:[jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx("div",{className:"flex items-center gap-2 mb-3",children:jsxRuntime.jsx("h3",{className:"text-sm font-semibold tracking-wide uppercase",style:{color:o.primary},children:"Your Selection"})}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("p",{className:"font-bold text-lg text-gray-900",children:n.name}),n.description&&jsxRuntime.jsx("p",{className:"text-sm text-gray-600 leading-relaxed",children:n.description}),n.duration&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-gray-500",children:[jsxRuntime.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),jsxRuntime.jsxs("span",{children:[n.duration," minutes"]})]})]})]}),jsxRuntime.jsxs("div",{className:"text-right",children:[jsxRuntime.jsx("div",{className:"text-xs text-gray-500 mb-1 font-medium",children:"Price"}),jsxRuntime.jsxs("div",{className:"text-2xl font-bold",style:{color:o.primary},children:["$",n.price]})]})]})}),d!=="separate_step"&&s.length>0&&c&&jsxRuntime.jsxs(framerMotion.motion.div,{...ge(.1),className:"bg-white rounded-xl border border-gray-200/80 p-6 shadow-sm hover:shadow-md transition-shadow",children:[jsxRuntime.jsx("div",{className:"flex items-center gap-2 mb-4",children:jsxRuntime.jsx("h3",{className:"text-sm font-semibold tracking-wide uppercase",style:{color:o.primary},children:"Enhance Your Experience"})}),jsxRuntime.jsx("div",{className:"space-y-3",children:s.map(D=>{let T=l.includes(D.id),P=D.addonPrice||D.price||0;return jsxRuntime.jsxs("label",{className:"flex items-start gap-4 p-4 rounded-xl border-2 cursor-pointer transition-all group",style:{borderColor:T?o.primary:"#E5E7EB",backgroundColor:T?`${o.primary}08`:"transparent",boxShadow:T?`0 0 0 3px ${o.primary}15`:"none"},children:[jsxRuntime.jsx("div",{className:"flex items-center pt-0.5",children:jsxRuntime.jsx("input",{type:"checkbox",checked:T,onChange:()=>O(D.id),className:"w-5 h-5 rounded border-2 border-gray-300 cursor-pointer",style:{accentColor:o.primary}})}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-start justify-between gap-3 mb-1",children:[jsxRuntime.jsx("span",{className:"font-semibold text-base text-gray-900 group-hover:text-gray-700 transition-colors",children:D.name}),jsxRuntime.jsxs("span",{className:"text-base font-bold whitespace-nowrap flex-shrink-0",style:{color:o.primary},children:["+$",P]})]}),D.description&&jsxRuntime.jsx("p",{className:"text-sm text-gray-600 leading-relaxed",children:D.description})]})]},D.id)})}),l.length>0&&jsxRuntime.jsx("div",{className:"mt-6 pt-5 border-t-2 border-gray-100",children:jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-xs text-gray-500 mb-1 font-medium uppercase tracking-wide",children:"New Total"}),jsxRuntime.jsxs("div",{className:"text-sm text-gray-600",children:["Service + ",l.length," add-on",l.length>1?"s":""]})]}),jsxRuntime.jsxs("div",{className:"text-3xl font-bold",style:{color:o.primary},children:["$",W()]})]})})]}),jsxRuntime.jsx(framerMotion.motion.h2,{...ge(.15),className:"text-xl sm:text-2xl font-bold text-center sm:text-left",style:{color:o.primary},children:m}),E&&jsxRuntime.jsx(framerMotion.motion.div,{...ge(.1),className:"bg-white rounded-lg border border-gray-200 px-4 py-3",children:jsxRuntime.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-2 text-xs",children:[jsxRuntime.jsx("span",{className:"font-medium flex items-center",style:{color:o.primary},children:"Cycle Calendar:"}),jsxRuntime.jsx("div",{className:"flex items-center gap-3",children:Object.entries(ko).map(([D,T])=>jsxRuntime.jsxs("div",{className:"flex items-center space-x-1.5",children:[jsxRuntime.jsx("div",{className:"w-3 h-3 rounded border border-gray-300",style:{backgroundColor:T.bg}}),jsxRuntime.jsx("span",{children:T.label})]},D))})]})}),u==="month"?jsxRuntime.jsxs("div",{className:"border border-gray-200 rounded-lg p-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-4",children:[jsxRuntime.jsx("button",{className:`p-2 rounded transition-colors ${k?"hover:bg-gray-100":"opacity-30 cursor-not-allowed"}`,onClick:y,disabled:!k,children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"w-4 h-4"})}),jsxRuntime.jsxs("p",{className:"font-semibold",children:[x," ",f]}),jsxRuntime.jsx("button",{className:`p-2 rounded transition-colors ${I?"hover:bg-gray-100":"opacity-30 cursor-not-allowed"}`,onClick:h,disabled:!I,children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-4 h-4"})})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-7 gap-2",children:[["Su","Mo","Tu","We","Th","Fr","Sa"].map(D=>jsxRuntime.jsx("div",{className:"text-center text-xs font-medium py-2 opacity-60",children:D},D)),F.map((D,T)=>{if(!D)return jsxRuntime.jsx("div",{},`empty-${T}`);let{day:P,dateStr:L,isAvailable:K}=D,Y=t===L,Te=i?.[L],H=Te?ko[Te]:null;return jsxRuntime.jsx("button",{onClick:()=>K&&r(L),disabled:!K,className:`aspect-square rounded-lg text-sm transition-all ${Y?"text-white shadow-lg font-semibold":K?"hover:scale-105 cursor-pointer":"bg-gray-50 text-gray-300 cursor-not-allowed opacity-40"}`,style:{backgroundColor:Y?o.primary:H?.bg||void 0,color:Y?"white":H?.text||void 0},children:P},L)})]})]}):jsxRuntime.jsx("div",{className:"grid grid-cols-5 gap-3",children:b.slice(0,5).map(D=>{let T=new Date(D),P=T.getDate(),K=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][T.getDay()],Y=t===D;return jsxRuntime.jsxs("button",{onClick:()=>r(D),className:`p-4 rounded-lg border-2 transition-all text-center ${Y?"border-current text-white":"border-gray-200 hover:border-gray-300"}`,style:{borderColor:Y?o.primary:void 0,backgroundColor:Y?o.primary:void 0},children:[jsxRuntime.jsx("p",{className:"text-xs mb-1 opacity-75",children:K}),jsxRuntime.jsx("p",{className:"text-2xl font-semibold",children:P})]},D)})})]})}function Hn({availableTimes:e,selectedTime:t,onTimeSelect:r,settings:a,serviceDuration:o,colors:i,selectedService:n,selectedDate:s,selectedAddons:l=[],addons:c=[]}){let d=a.timeFormat||"12h",u=a.showDuration!==false,m=a.headerContent?.value||"Pick a Time",p=a.columns||3,b=()=>{let v=n?.price||0;return l.length>0&&c.length>0&&l.forEach(f=>{let C=c.find(S=>S.id===f);C&&(v+=C.addonPrice||C.price||0);}),v},w=v=>new Date(v+"T00:00:00").toLocaleDateString("en-US",{weekday:"long",month:"long",day:"numeric",year:"numeric"}),N=v=>{let f=v.trim().split(" "),[C,S]=f[0].split(":"),x=parseInt(C),F=S||"00";if(f.length>1){let k=f[1];return d==="24h"?(k==="PM"&&x!==12?x+=12:k==="AM"&&x===12&&(x=0),`${String(x).padStart(2,"0")}:${F}`):v}if(d==="12h"){let k=x>=12?"PM":"AM";return `${x===0?12:x>12?x-12:x}:${F} ${k}`}return `${String(x).padStart(2,"0")}:${F}`},g={2:"grid-cols-2",3:"grid-cols-2 sm:grid-cols-3",4:"grid-cols-2 sm:grid-cols-3 lg:grid-cols-4"}[p]||"grid-cols-3";return jsxRuntime.jsxs("div",{className:"space-y-6",children:[n&&s&&jsxRuntime.jsxs(framerMotion.motion.div,{...ge(.05),className:"bg-gradient-to-br from-white to-gray-50/30 rounded-xl border border-gray-200/80 p-6 shadow-sm hover:shadow-md transition-shadow",children:[jsxRuntime.jsx("div",{className:"flex items-center gap-2 mb-4",children:jsxRuntime.jsx("h3",{className:"text-sm font-semibold tracking-wide uppercase",style:{color:i.primary},children:"Your Booking"})}),jsxRuntime.jsxs("div",{className:"mb-3",children:[jsxRuntime.jsx("p",{className:"font-bold text-lg text-gray-900",children:n.name}),n.duration&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-gray-500 mt-1",children:[jsxRuntime.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),jsxRuntime.jsxs("span",{children:[n.duration," minutes"]})]})]}),l.length>0&&c.length>0&&jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-bold text-gray-900 mb-2",children:"Add-ons"}),jsxRuntime.jsx("div",{className:"space-y-2",children:l.map(v=>{let f=c.find(C=>C.id===v);return f?jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:"text-sm text-gray-700 font-medium",children:f.name}),jsxRuntime.jsxs("span",{className:"text-sm font-semibold text-gray-900",children:["$",f.addonPrice||f.price||0]})]},v):null})})]}),jsxRuntime.jsx("div",{className:"border-t border-gray-200 -mx-6 mb-4"}),jsxRuntime.jsx("div",{className:"bg-gray-50/50 -mx-6 px-6 py-4 mb-4",children:jsxRuntime.jsx("div",{className:"flex items-center justify-between",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("svg",{className:"w-5 h-5",style:{color:i.primary},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),jsxRuntime.jsx("span",{className:"font-bold text-base text-gray-900",children:w(s)})]})})}),jsxRuntime.jsx("div",{className:"border-t border-gray-200 -mx-6 mb-4"}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:"text-base font-bold text-gray-900",children:"Total"}),jsxRuntime.jsxs("span",{className:"text-2xl font-bold",style:{color:i.primary},children:["$",b()]})]})]}),jsxRuntime.jsx(framerMotion.motion.h2,{...ge(n&&s?.15:.05),className:"text-xl sm:text-2xl font-bold text-center sm:text-left",style:{color:i.primary},children:m}),jsxRuntime.jsx(framerMotion.motion.div,{className:`grid ${g} gap-3`,initial:{opacity:0},animate:{opacity:1},transition:{duration:.3,delay:n&&s?.2:.1},children:e.map((v,f)=>{let C=t===v;return jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>r(v),className:`p-3 rounded-lg border-2 transition-all text-center hover:scale-105 ${C?"border-current text-white shadow-lg":"border-gray-200 hover:border-gray-300"}`,style:{borderColor:C?i.primary:void 0,backgroundColor:C?i.primary:void 0},initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2,delay:.15+f*.03,ease:"easeOut"},children:[jsxRuntime.jsx("p",{className:"font-medium",children:N(v)}),u&&o&&jsxRuntime.jsxs("p",{className:"text-xs mt-1 opacity-75",children:[o," min"]})]},v)})})]})}function Wn({addons:e,selectedAddons:t,onAddonsChange:r,settings:a,colors:o}){let i=a.headerContent?.value||"Add Extras",n=a.subheaderContent?.value||"Enhance your experience with these optional add-ons",s=a.showPricing!==false,l=a.showDuration!==false,c=d=>{let u=t.includes(d)?t.filter(m=>m!==d):[...t,d];r(u);};return jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs(framerMotion.motion.div,{...ge(.05),className:"text-center sm:text-left",children:[jsxRuntime.jsx("h2",{className:"text-xl sm:text-2xl font-bold mb-2",style:{color:o.primary},children:i}),jsxRuntime.jsx("p",{className:"text-sm opacity-70",children:n})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:e.map((d,u)=>{let m=t.includes(d.id);return jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>c(d.id),className:`p-4 rounded-lg border-2 transition-all text-left relative ${m?"border-current shadow-lg":"border-gray-200 hover:border-gray-300"}`,style:{borderColor:m?o.primary:void 0,backgroundColor:m?`${o.primary}10`:void 0},initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.3,delay:.1+u*.05},children:[m&&jsxRuntime.jsx("div",{className:"absolute top-3 right-3 w-6 h-6 rounded-full flex items-center justify-center text-white text-sm",style:{backgroundColor:o.primary},children:"\u2713"}),jsxRuntime.jsx("p",{className:"font-semibold mb-1 pr-8",children:d.name}),jsxRuntime.jsx("p",{className:"text-xs opacity-70 mb-3",children:d.description}),jsxRuntime.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s&&jsxRuntime.jsxs("span",{className:"font-bold",style:{color:o.primary},children:["+$",d.price]}),l&&jsxRuntime.jsxs("span",{className:"opacity-60",children:["+",d.duration," min"]})]})]},d.id)})}),t.length>0&&jsxRuntime.jsxs(framerMotion.motion.div,{className:"bg-gray-50 rounded-lg p-4 mt-4",initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},children:[jsxRuntime.jsx("p",{className:"text-sm font-medium mb-2",children:"Selected Add-ons:"}),jsxRuntime.jsx("div",{className:"space-y-1",children:t.map(d=>{let u=e.find(m=>m.id===d);return u?jsxRuntime.jsxs("div",{className:"flex justify-between text-sm",children:[jsxRuntime.jsx("span",{children:u.name}),jsxRuntime.jsxs("span",{className:"font-medium",style:{color:o.primary},children:["+$",u.price]})]},d):null})})]})]})}function jn({isOpen:e,onClose:t,title:r,children:a,isRequired:o=false,maxHeight:i="80vh"}){return Ge.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset";}),[e]),Ge.useEffect(()=>{if(!o&&e){let n=s=>{s.key==="Escape"&&t();};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)}},[e,o,t]),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:e&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.div,{...rr.backdrop,onClick:o?void 0:t,className:"fixed inset-0 bg-black/50 z-50",style:{backdropFilter:"blur(4px)"}}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{y:"100%"},animate:{y:0},exit:{y:"100%"},transition:rr.spring,className:"fixed bottom-0 left-0 right-0 bg-white rounded-t-2xl shadow-2xl z-50",style:{maxHeight:i},children:[jsxRuntime.jsx("div",{className:"flex justify-center pt-3 pb-2",children:jsxRuntime.jsx("div",{className:"w-12 h-1 bg-gray-300 rounded-full"})}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-6 pb-4 border-b border-gray-200",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[r&&jsxRuntime.jsx("h3",{className:"text-lg font-semibold",children:r}),o&&jsxRuntime.jsx("span",{className:"text-xs font-medium px-2 py-0.5 bg-amber-100 text-amber-800 rounded",children:"Required"})]}),!o&&jsxRuntime.jsx("button",{onClick:t,className:"p-2 hover:bg-gray-100 rounded-lg transition-colors","aria-label":"Close",children:jsxRuntime.jsx(lucideReact.X,{className:"w-5 h-5"})})]}),jsxRuntime.jsx("div",{className:"overflow-y-auto",style:{maxHeight:`calc(${i} - 120px)`},children:jsxRuntime.jsx("div",{className:"px-6 py-6",children:a})})]})]})})}function Vn({contactInfo:e,onContactInfoChange:t,settings:r,optInModules:a=[],onOptInData:o,colors:i,isPreview:n=false}){let[s,l]=Ge.useState(false),[c,d]=Ge.useState(null),[u,m]=Ge.useState({}),[p,b]=Ge.useState({}),[w,N]=Ge.useState({}),g=r.headerContent?.value||"Your Information",v=y=>y?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(y)?null:"Please enter a valid email address":"Email is required",f=y=>y?y.replace(/\D/g,"").length<10?"Please enter a valid phone number":null:"Phone number is required",C=y=>!y||y.trim().length===0?"Name is required":y.trim().length<2?"Name must be at least 2 characters":null,S=(y,h)=>{switch(y){case "email":return v(h);case "phone":return f(h);case "name":return C(h);default:return null}},x=[{label:"Name *",type:"text",placeholder:"Your full name",field:"name"},{label:"Email *",type:"email",placeholder:"your@email.com",field:"email"},{label:"Phone *",type:"tel",placeholder:"(555) 123-4567",field:"phone"},{label:"Notes (optional)",type:"textarea",placeholder:"Any special requests or notes...",field:"notes"}],F=(y,h)=>{if(t({...e,[y]:h}),!n&&w[y]){let E=S(y,h);b(W=>({...W,[y]:E||""}));}},k=y=>{if(n)return;N(W=>({...W,[y]:true}));let h=e[y]||"",E=S(y,h);b(W=>({...W,[y]:E||""}));},I=(y,h)=>{m(E=>({...E,[y.id]:h})),h&&(d(y),l(true));};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsx(framerMotion.motion.h2,{...ge(.05),className:"text-xl sm:text-2xl font-bold text-center sm:text-left",style:{color:i.primary},children:g}),jsxRuntime.jsxs("div",{className:"space-y-3",children:[x.map((y,h)=>jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{duration:.3,delay:.1+h*.05,ease:"easeOut"},children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:y.label}),y.type==="textarea"?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("textarea",{className:`w-full px-3 py-2 border rounded-lg focus:ring-2 focus:border-transparent resize-none transition-all ${!n&&p[y.field]&&w[y.field]?"border-red-500":"border-gray-300"}`,style:{"--tw-ring-color":i.primary},rows:3,placeholder:y.placeholder,value:e[y.field]||"",onChange:E=>F(y.field,E.target.value),onBlur:()=>k(y.field)}),!n&&p[y.field]&&w[y.field]&&jsxRuntime.jsx("p",{className:"text-red-500 text-xs mt-1",children:p[y.field]})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("input",{type:y.type,className:`w-full px-3 py-2 border rounded-lg focus:ring-2 focus:border-transparent transition-all ${!n&&p[y.field]&&w[y.field]?"border-red-500":"border-gray-300"}`,style:{"--tw-ring-color":i.primary},placeholder:y.placeholder,value:e[y.field]||"",onChange:E=>F(y.field,E.target.value),onBlur:()=>k(y.field)}),!n&&p[y.field]&&w[y.field]&&jsxRuntime.jsx("p",{className:"text-red-500 text-xs mt-1",children:p[y.field]})]})]},y.label)),a.length>0&&jsxRuntime.jsx(framerMotion.motion.div,{className:"pt-3 border-t border-gray-200 space-y-3",initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.3,delay:.3},children:a.map(y=>jsxRuntime.jsxs("label",{className:"flex items-start gap-3 cursor-pointer group",children:[jsxRuntime.jsx("input",{type:"checkbox",checked:u[y.id]||false,onChange:h=>I(y,h.target.checked),className:"mt-1 w-4 h-4 rounded border-gray-300",style:{accentColor:i.primary}}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("span",{className:"text-sm font-medium",children:[y.label,y.required&&jsxRuntime.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),jsxRuntime.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:"Check this to provide additional information"})]})]},y.id))})]})]}),c&&jsxRuntime.jsx(jn,{isOpen:s,onClose:()=>l(false),title:c.formTitle||"Additional Information",isRequired:c.required,children:c.renderCustomForm?c.renderCustomForm(()=>l(false),y=>{o&&o(c.id,y);},i):jsxRuntime.jsxs("div",{className:"space-y-4",children:[c.formFields?.map(y=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-1",children:[y.label,y.required&&jsxRuntime.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),y.type==="textarea"?jsxRuntime.jsx("textarea",{className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:border-transparent resize-none",style:{"--tw-ring-color":i.primary},rows:3,placeholder:y.placeholder}):y.type==="select"&&y.options?jsxRuntime.jsx("select",{className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:border-transparent",style:{"--tw-ring-color":i.primary},children:y.options.map(h=>jsxRuntime.jsx("option",{value:h.value,children:h.label},h.value))}):jsxRuntime.jsx("input",{type:y.type,className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:border-transparent",style:{"--tw-ring-color":i.primary},placeholder:y.placeholder})]},y.id)),jsxRuntime.jsx("button",{onClick:()=>{o&&c&&o(c.id,{}),l(false);},className:"w-full py-3 rounded-lg text-white font-medium transition-all hover:opacity-90",style:{backgroundColor:i.primary},children:"Save & Continue"})]})})]})}function Yn({service:e,addons:t=[],selectedDate:r,selectedTime:a,paymentProvider:o,paymentConfig:i,onConfirm:n,colors:s,isPreview:l=false}){let c=e?.price||0,d=t.reduce((f,C)=>f+(C.addonPrice||C.price||0),0),u=c+d,m=e?.duration||0,p=t.reduce((f,C)=>f+(C.duration||0),0),b=m+p,w=i.depositPercentage||20,N=(u*(w/100)).toFixed(2),g=u.toFixed(2),v=(parseFloat(g)-parseFloat(N)).toFixed(2);return jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsx(framerMotion.motion.h2,{...ge(.05),className:"text-xl font-bold text-center",style:{color:s.primary},children:"Confirm & Pay"}),jsxRuntime.jsx(framerMotion.motion.div,{className:"bg-gray-50 rounded-lg p-4",initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.3,delay:.1},children:jsxRuntime.jsxs("div",{className:"space-y-2",children:[e&&jsxRuntime.jsxs("div",{className:"flex justify-between items-center text-sm",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"font-medium",children:e.name}),jsxRuntime.jsxs("p",{className:"text-xs opacity-70",children:[b," min total"]})]}),jsxRuntime.jsxs("span",{className:"font-bold",style:{color:s.primary},children:["$",c]})]}),t.length>0&&jsxRuntime.jsx("div",{className:"space-y-1 text-xs",children:t.map(f=>jsxRuntime.jsxs("div",{className:"flex justify-between opacity-70",children:[jsxRuntime.jsxs("span",{children:["+ ",f.name]}),jsxRuntime.jsxs("span",{children:["+$",f.addonPrice||f.price||0]})]},f.id))}),r&&jsxRuntime.jsxs("div",{className:"flex justify-between items-center text-sm pt-2 border-t border-gray-200",children:[jsxRuntime.jsx("span",{className:"opacity-70",children:new Date(r+"T00:00:00").toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"})}),jsxRuntime.jsx("span",{children:a})]}),jsxRuntime.jsxs("div",{className:"pt-2 mt-2 border-t border-gray-200 flex justify-between items-center",children:[jsxRuntime.jsx("span",{className:"text-sm font-medium",children:"Due Today"}),jsxRuntime.jsxs("span",{className:"text-lg font-bold",style:{color:s.primary},children:["$",N]})]})]})}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.3,delay:.2},children:l?jsxRuntime.jsxs("div",{className:"border border-gray-200 rounded-lg p-4 bg-white",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("div",{className:"h-10 bg-gray-50 border border-gray-200 rounded flex items-center px-3",children:jsxRuntime.jsx("span",{className:"text-xs text-gray-400",children:"Card Number"})}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[jsxRuntime.jsx("div",{className:"h-10 bg-gray-50 border border-gray-200 rounded flex items-center px-3",children:jsxRuntime.jsx("span",{className:"text-xs text-gray-400",children:"MM/YY"})}),jsxRuntime.jsx("div",{className:"h-10 bg-gray-50 border border-gray-200 rounded flex items-center px-3",children:jsxRuntime.jsx("span",{className:"text-xs text-gray-400",children:"CVV"})})]})]}),jsxRuntime.jsxs("div",{className:"mt-3 flex items-center justify-center gap-1",children:[jsxRuntime.jsx("svg",{className:"w-3 h-3 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})}),jsxRuntime.jsxs("span",{className:"text-xs text-gray-400",children:["Powered by ",o==="square"?"Square":"Stripe"]})]})]}):jsxRuntime.jsx("div",{className:"border border-gray-200 rounded-lg p-4 bg-white",children:jsxRuntime.jsxs("div",{className:"text-center py-8 text-sm text-gray-500",children:[jsxRuntime.jsxs("div",{className:"animate-pulse",children:["Initializing ",o==="square"?"Square":"Stripe"," payment..."]}),jsxRuntime.jsx("div",{className:"mt-4 text-xs text-gray-400",children:"Please wait while we securely load the payment form"})]})})}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.3,delay:.3},children:jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs("label",{className:"flex items-start gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",className:"mt-0.5 w-4 h-4 rounded border-gray-300",style:{accentColor:s.primary}}),jsxRuntime.jsxs("span",{className:"text-xs",children:["I agree to the ",jsxRuntime.jsx("a",{href:"#",className:"underline",style:{color:s.primary},children:"cancellation policy"})," and understand the $",v," balance is due at appointment."]})]}),jsxRuntime.jsxs("label",{className:"flex items-start gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",className:"mt-0.5 w-4 h-4 rounded border-gray-300",style:{accentColor:s.primary}}),jsxRuntime.jsxs("span",{className:"text-xs",children:["I agree to the ",jsxRuntime.jsx("a",{href:"#",className:"underline",style:{color:s.primary},children:"terms of service"}),"."]})]})]})})]})}var Io={avoid:{phase:"avoid",color:"#EF4444",bgColor:"#FEF2F2",label:"Avoid",icon:"\u{1F534}",description:"Period - avoid waxing"},caution:{phase:"caution",color:"#F59E0B",bgColor:"#FFFBEB",label:"Caution",icon:"\u{1F7E1}",description:"End of period - proceed with caution"},optimal:{phase:"optimal",color:"#10B981",bgColor:"#F0FDF4",label:"Optimal",icon:"\u{1F7E2}",description:"Best time for waxing"},neutral:{phase:"neutral",color:"#6B7280",bgColor:"#F9FAFB",label:"Neutral",icon:"\u26AA",description:"Okay but not optimal"},unknown:{phase:"unknown",color:"#9CA3AF",bgColor:"#F3F4F6",label:"Unknown",icon:"\u2753",description:"No cycle data available"}};function ui({availableDates:e,selectedDate:t,onDateSelect:r,settings:a,colors:o,fetchCycleData:i,selectedClient:n,onCycleWarning:s,cycleAwareEnabled:l}){let[c,d]=Ge.useState({}),[u,m]=Ge.useState(false),[p,b]=Ge.useState(null),w=Ge.useMemo(()=>l!==void 0?l:!!(n?.cycle_opt_in&&i),[l,n?.cycle_opt_in,i]);Ge.useEffect(()=>{if(!w||!i||!n){d({});return}e.length!==0&&(m(true),b(null),i(n,e).then(g=>{d(g);}).catch(g=>{console.error("[CycleAwareDateSelection] Error fetching cycle data:",g),b(g.message||"Failed to load cycle data"),d({});}).finally(()=>{m(false);}));},[w,i,n,e]);let N=Ge.useCallback(g=>{let v=c[g];v?.phase==="avoid"&&s&&s(v,g),r(g,v);},[c,r,s]);return jsxRuntime.jsxs("div",{className:"cycle-aware-date-selection space-y-4",children:[w&&Object.keys(c).length>0&&jsxRuntime.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-4",children:[jsxRuntime.jsxs("h4",{className:"font-medium mb-3 flex items-center",style:{color:o.primary},children:[jsxRuntime.jsx("span",{className:"mr-2",children:"\u{1F4C5}"}),"Your Cycle Calendar"]}),jsxRuntime.jsx("div",{className:"grid grid-cols-2 gap-3 text-sm",children:Object.entries(Io).map(([g,v])=>g!=="unknown"&&jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full border border-gray-300",style:{backgroundColor:v.color}}),jsxRuntime.jsx("span",{children:v.label})]},g))}),jsxRuntime.jsx("p",{className:"text-xs opacity-70 mt-2",children:"Green dates are optimal for comfortable waxing appointments"})]}),w&&u&&jsxRuntime.jsx("div",{className:"text-center py-2 text-sm opacity-70",children:"Loading cycle predictions..."}),w&&p&&jsxRuntime.jsx("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-3",children:jsxRuntime.jsxs("p",{className:"text-yellow-800 text-sm",children:["Unable to load cycle predictions: ",p]})}),jsxRuntime.jsx(nr,{availableDates:e,selectedDate:t,onDateSelect:N,settings:a,colors:o}),w&&t&&c[t]?.phase==="avoid"&&jsxRuntime.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:jsxRuntime.jsxs("div",{className:"flex items-start space-x-3",children:[jsxRuntime.jsx("span",{className:"text-red-500 text-xl",children:"\u26A0\uFE0F"}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h4",{className:"font-medium text-red-800 mb-1",children:"This date falls during your predicted period"}),jsxRuntime.jsx("p",{className:"text-red-700 text-sm mb-3",children:"Waxing during this time may be more uncomfortable than usual. Would you like to see better alternatives?"}),jsxRuntime.jsxs("div",{className:"flex space-x-2",children:[jsxRuntime.jsx("button",{className:"px-3 py-1 bg-red-100 text-red-700 rounded text-sm hover:bg-red-200 transition-colors",onClick:()=>{let g=e.filter(v=>c[v]?.phase==="optimal");g.length>0&&N(g[0]);},children:"Show optimal dates"}),jsxRuntime.jsx("button",{className:"px-3 py-1 text-red-600 text-sm hover:underline",children:"Continue anyway"})]})]})]})})]})}var mi={enabled:true,duration:6e5,warningThreshold:12e4,maxExtensions:2,extensionDuration:3e5,showActions:true,showWarning:true};function Rr({holdStatus:e,config:t,colors:r,onExtend:a,onRelease:o,onWarning:i,onExpired:n,className:s=""}){let[l,c]=Ge.useState(Date.now()),[d,u]=Ge.useState(false),[m,p]=Ge.useState(false),[b,w]=Ge.useState(false),N={...mi,...t};Ge.useEffect(()=>{if(!e)return;let E=setInterval(()=>{c(Date.now());},1e3);return ()=>clearInterval(E)},[e]);let g=e?Math.max(0,e.expiresAt-l):0,v=g===0&&e!==null,f=g<=N.warningThreshold&&g>0;Ge.useEffect(()=>{f&&!d&&i&&e&&(u(true),i(g));},[f,d,i,e,g]),Ge.useEffect(()=>{v&&e&&n&&n();},[v,e,n]),Ge.useEffect(()=>{u(false);},[e?.holdKey]);let C=Ge.useCallback(async()=>{if(!(!a||!e||m))try{p(!0),await a(),u(!1);}catch(E){console.error("[HoldTimer] Failed to extend hold:",E);}finally{p(false);}},[a,e,m]),S=Ge.useCallback(async()=>{if(!(!o||!e||b))try{w(!0),await o();}catch(E){console.error("[HoldTimer] Failed to release hold:",E);}finally{w(false);}},[o,e,b]);if(!e||!N.enabled)return null;let x=Math.floor(g/6e4),F=Math.floor(g%6e4/1e3),k=`${x}:${F.toString().padStart(2,"0")}`,I="rgba(139, 92, 246, 0.1)",y="rgba(139, 92, 246, 0.3)",h=r.primary;return v?(I="rgba(239, 68, 68, 0.1)",y="rgba(239, 68, 68, 0.3)",h="#EF4444"):f&&N.showWarning&&(I=`${r.secondary}1A`,y=`${r.secondary}4D`,h=r.secondary),jsxRuntime.jsx("div",{className:`rounded-lg p-4 text-center ${s}`,style:{backgroundColor:I,borderWidth:"1px",borderStyle:"solid",borderColor:y},children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center justify-center",children:[jsxRuntime.jsx("div",{className:"flex flex-col items-center gap-2 mb-4",children:v?jsxRuntime.jsxs("div",{style:{color:h},className:"font-medium text-base",children:[jsxRuntime.jsx("span",{children:"Time expired - "}),jsxRuntime.jsx("button",{onClick:S,disabled:b,className:"underline hover:no-underline focus:outline-none focus:ring-2 focus:ring-offset-2 inline disabled:opacity-50",style:{color:h},children:b?"Releasing...":"select a new time"})]}):jsxRuntime.jsxs("div",{style:{color:h},className:"font-medium text-base",children:["Your time slot is reserved for ",k]})}),N.showActions&&!v&&jsxRuntime.jsxs("div",{className:"flex justify-center gap-2",children:[a&&e.canExtend&&jsxRuntime.jsxs("button",{onClick:C,disabled:!e.canExtend||m,className:"px-4 py-2 text-sm font-medium rounded transition-all active:scale-95 disabled:opacity-50 disabled:cursor-not-allowed text-white",style:{backgroundColor:r.primary},"aria-label":`Extend hold (${e.maxExtensions-e.extensions} extensions remaining)`,children:[m?"Extending...":"Extend",!m&&e.maxExtensions-e.extensions>0&&jsxRuntime.jsxs("span",{className:"ml-1",children:["(",e.maxExtensions-e.extensions,")"]})]}),o&&jsxRuntime.jsx("button",{onClick:S,disabled:b,className:"px-4 py-2 text-sm font-medium rounded border transition-all active:scale-95 disabled:opacity-50 disabled:cursor-not-allowed",style:{borderColor:"rgba(255, 255, 255, 0.2)",color:r.text||"#000000"},"aria-label":"Release hold and return to time selection",children:b?"Releasing...":"Release"})]}),!v&&!e.canExtend&&e.extensions>=e.maxExtensions&&jsxRuntime.jsx("div",{className:"mt-3 pt-3 border-t border-white/10 text-center",children:jsxRuntime.jsxs("div",{className:"text-sm",style:{color:r.secondary},children:["Maximum extensions reached - complete booking now or"," ",jsxRuntime.jsx("button",{onClick:S,disabled:b,className:"hover:underline focus:outline-none focus:underline disabled:opacity-50",style:{color:r.primary},children:b?"releasing...":"select a different time"})]})})]})})}function Ro({config:e,colors:t,services:r=[],categories:a=[],dates:o=[],times:i=[],addons:n=[],paymentProvider:s,paymentConfig:l,isPreview:c=false,onComplete:d,onStepChange:u,onServiceSelect:m,onDateSelect:p,onContactInfoChange:b,validateStep:w,holdTimer:N,stepOrder:g,optInModules:v=[],onOptInData:f,customPaymentForm:C,cyclePhases:S}){let[x,F]=Ge.useState(0),[k,I]=Ge.useState("forward"),[y,h]=Ge.useState(null),[E,W]=Ge.useState(null),[O,D]=Ge.useState(null),[T,P]=Ge.useState([]),[L,K]=Ge.useState({}),[Y,Te]=Ge.useState({}),[H,ie]=Ge.useState(null),Xe=t.bookingText||t.text||"#000000",ot=e.transitions||{},xe=ot.style||"slide",At=ot.speed||"normal",je=typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,fe=e.background||{type:"color",value:"#FFFFFF"},B={service:{id:"service",name:"Service",enabled:e.steps?.service_selection?.enabled!==false,settings:e.steps?.service_selection?.settings||{}},date:{id:"date",name:"Date",enabled:e.steps?.date_selection?.enabled!==false,settings:e.steps?.date_selection?.settings||{}},time:{id:"time",name:"Time",enabled:e.steps?.time_selection?.enabled!==false,settings:e.steps?.time_selection?.settings||{}},addons:{id:"addons",name:"Add-ons",enabled:e.steps?.addon_selection?.enabled===true,settings:e.steps?.addon_selection?.settings||{}},details:{id:"details",name:"Details",enabled:e.steps?.contact_form?.enabled!==false,settings:e.steps?.contact_form?.settings||{}},confirm:{id:"confirm",name:"Confirm",enabled:e.steps?.confirmation?.enabled===true,settings:e.steps?.confirmation?.settings||{}}},Ne=g||["service","date","time","addons","details","confirm"],J=Ne.map(R=>B[R]).filter(R=>R&&R.enabled);console.log("[BookingFlow] Step configuration:",{customStepOrder:g,orderedStepIds:Ne,allSteps:J.map(R=>R.id),currentStepIndex:x,currentStepId:J[x]?.id});let re=J[x],at=()=>fe.type==="gradient"?{background:fe.value}:fe.type==="image"?{backgroundImage:`url(${fe.value})`,backgroundSize:"cover",backgroundPosition:"center"}:{backgroundColor:fe.value},it=()=>{if(je)return .15;switch(At){case "fast":return .2;case "slow":return .5;default:return .3}},gr=()=>xe==="fade"?{enter:()=>({opacity:0,scale:.95}),center:{opacity:1,scale:1},exit:()=>({opacity:0,scale:.95})}:{enter:()=>({x:k==="forward"?50:-50,opacity:0}),center:{x:0,opacity:1},exit:()=>({x:k==="forward"?-50:50,opacity:0})},Kt=()=>{let R=re?.id;if(w)return w(R,{service:y,date:E,time:O,addons:T,contact:L});switch(R){case "service":return y!==null;case "date":return E!==null;case "time":return O!==null;case "details":if(c)return true;let U=L?.name&&L.name.trim().length>=2,_=L?.email&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(L.email),ye=L?.phone&&L.phone.replace(/\D/g,"").length>=10;return U&&_&&ye;default:return true}},$t=R=>R<x,Ce=R=>{I(R>x?"forward":"backward"),F(R),u&&u(R,J[R]?.id);},bt=()=>{x<J.length-1&&Ce(x+1);},Lt=async()=>{if(x===0)return;let R=x-1;if(J[R]?.id==="time"&&H&&N?.releaseHold)try{await N.releaseHold(H.holdId),ie(null),D(null);}catch(_){console.error("[BookingFlow] Failed to release hold:",_);}Ce(R);},fr=async R=>{if(D(R),N?.enabled&&N.createHold&&E&&y)try{let U=r.find(ye=>ye.id===y),_=await N.createHold({date:E,time:R,serviceId:y,serviceDuration:U?.duration||60});ie(_);}catch(U){console.error("[BookingFlow] Failed to create hold:",U);return}bt();},yr=()=>{ie(null),D(null);let R=J.findIndex(U=>U.id==="time");R>=0&&Ce(R);},Jt=async()=>{d&&d({service:y,date:E,time:O,addons:T,contact:L,optIn:Y});},Zr=()=>{if(!re)return null;let R={settings:re.settings,colors:t},U=r.find(_=>_.id===y);switch(re.id){case "service":return jsxRuntime.jsx(On,{...R,services:r,categories:a,selectedService:y,onServiceSelect:se=>{h(se),m&&m(se);}});case "date":return jsxRuntime.jsx(nr,{...R,availableDates:o,selectedDate:E,onDateSelect:se=>{W(se),p&&p(se);},cyclePhases:S,selectedService:U,addons:n,selectedAddons:T,onAddonsChange:P,addonPlacement:e.steps?.addon_selection?.settings?.placement||"date_selection"});case "time":return jsxRuntime.jsx(Hn,{...R,availableTimes:i,selectedTime:O,onTimeSelect:fr,serviceDuration:U?.duration||60,selectedService:U,selectedDate:E,selectedAddons:T,addons:n});case "addons":return jsxRuntime.jsx(Wn,{...R,addons:n,selectedAddons:T,onAddonsChange:P});case "details":return jsxRuntime.jsx(Vn,{...R,contactInfo:L,onContactInfoChange:se=>{K(se),b&&b(se);},optInModules:v,onOptInData:f});case "confirm":let _=n.filter(se=>T.includes(se.id)),ye=_.reduce((se,Pe)=>se+(Pe.addonPrice||Pe.price||0),0),br=(U?.price||0)+ye,hr=_.reduce((se,Pe)=>Pe.affectsDuration&&Pe.additionalDuration?se+Pe.additionalDuration:se,U?.duration||60);return C?jsxRuntime.jsx(C,{bookingData:{service:y,serviceName:U?.name,date:E,time:O,addons:T,contact:L,amount:U?.price||0,duration:hr,clientName:L?.name,clientEmail:L?.email,clientPhone:L?.phone,pendingBooking:{customerClientId:null,serviceId:y,date:E,time:O,notes:L?.notes||"",selectedAddons:_,addonServices:T,addonTotalCost:ye,totalAmount:br,duration:hr}},onPaymentSuccess:Jt,onPaymentError:Pe=>{console.error("[BookingFlow] Payment error:",Pe);}}):jsxRuntime.jsx(Yn,{...R,service:U,addons:_,selectedDate:E||"",selectedTime:O||"",paymentProvider:s||"square",paymentConfig:l||{depositPercentage:20},isPreview:c,onConfirm:Jt});default:return null}},st=()=>{let R=e.progressBar?.style||"dots";return R==="bar"?jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-2",children:[jsxRuntime.jsxs("span",{className:"text-sm font-medium",children:["Step ",x+1," of ",J.length]}),jsxRuntime.jsx("span",{className:"text-xs opacity-60",children:re?.name})]}),jsxRuntime.jsx("div",{className:"w-full h-2 bg-gray-200 rounded-full overflow-hidden",children:jsxRuntime.jsx(framerMotion.motion.div,{className:"h-full rounded-full",style:{backgroundColor:t.primary},initial:{width:0},animate:{width:`${(x+1)/J.length*100}%`},transition:{duration:.3,ease:"easeOut"}})})]}):R==="minimal"?jsxRuntime.jsxs("div",{className:"mb-6 text-center",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium",style:{color:t.primary},children:re?.name}),jsxRuntime.jsxs("p",{className:"text-xs opacity-60 mt-1",children:["Step ",x+1," of ",J.length]})]}):jsxRuntime.jsx("div",{className:"flex justify-center mb-4 overflow-x-auto py-2",children:jsxRuntime.jsx("div",{className:"flex items-center space-x-1.5 px-4 min-w-max",children:J.map((U,_)=>jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx(framerMotion.motion.div,{className:`w-6 h-6 rounded-full flex items-center justify-center font-medium text-xs transition-all flex-shrink-0 ${_===x?"text-white shadow-md":$t(_)?"text-white":"bg-gray-200 text-gray-500"}`,style:{backgroundColor:_<=x?t.primary:void 0},animate:{scale:_===x?1.05:1},transition:{duration:.2},children:$t(_)?"\u2713":_+1}),_<J.length-1&&jsxRuntime.jsx(framerMotion.motion.div,{className:`w-4 h-0.5 mx-1 transition-all flex-shrink-0 ${_<x?"":"bg-gray-200"}`,style:{backgroundColor:_<x?t.primary:void 0},initial:{scaleX:0},animate:{scaleX:1},transition:{duration:.3,delay:.1}})]},U.id))})})};return jsxRuntime.jsxs("div",{className:"w-full max-w-4xl mx-auto p-6 rounded-2xl shadow-xl",style:{...at(),color:Xe},children:[st(),N?.enabled&&H&&re?.id!=="time"&&jsxRuntime.jsx(Rr,{holdStatus:H,config:N.config,colors:t,onExtend:async()=>{if(N.extendHold&&H)try{let R=await N.extendHold(H.holdId);ie(R);}catch(R){console.error("[BookingFlow] Failed to extend hold:",R);}},onRelease:async()=>{if(N.releaseHold&&H)try{await N.releaseHold(H.holdId),ie(null),D(null);let R=J.findIndex(U=>U.id==="time");R>=0&&Ce(R);}catch(R){console.error("[BookingFlow] Failed to release hold:",R);}},onExpired:yr,className:"mb-6"}),jsxRuntime.jsx("div",{className:"mb-6 min-h-[300px] relative overflow-hidden",children:jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",custom:k,children:jsxRuntime.jsx(framerMotion.motion.div,{custom:k,variants:gr(),initial:"enter",animate:"center",exit:"exit",transition:{duration:it(),ease:[.4,0,.2,1]},children:Zr()},x)})}),!(re?.id==="confirm"&&C)&&jsxRuntime.jsxs("div",{className:"flex items-center justify-between pt-4 border-t border-gray-200",children:[jsxRuntime.jsx("button",{onClick:Lt,disabled:x===0,className:"px-4 py-2 rounded-lg border border-gray-300 disabled:opacity-30 disabled:cursor-not-allowed hover:bg-gray-50 transition-all text-sm font-medium",children:"Back"}),x<J.length-1?jsxRuntime.jsx("button",{onClick:bt,disabled:!Kt(),className:"px-6 py-2 rounded-lg text-white disabled:opacity-50 disabled:cursor-not-allowed hover:opacity-90 transition-all text-sm font-medium shadow-md",style:{backgroundColor:t.primary},children:"Next"}):jsxRuntime.jsx("button",{onClick:Jt,disabled:!Kt(),className:"px-6 py-2 rounded-lg text-white disabled:opacity-50 disabled:cursor-not-allowed hover:opacity-90 transition-all text-sm font-medium shadow-md",style:{backgroundColor:t.primary},children:re?.id==="confirm"?"Pay & Confirm":"Complete"})]})]})}function gi({section:e,theme:t,BookingFlowComponent:r,config:a,enableInlineEditing:o=false}){let{type:i,settings:n}=e,s=e.id;i==="video_section"&&console.log("\u{1F3AC} Rendering video_section:",{type:i,settings:n,sectionId:s});let l=t?.colors||{primary:"#BCB4FF",secondary:"#CAC426",text:"#000000"},c=t?.typography||{headingFont:"Geist Sans",bodyFont:"Inter",bodySize:"16px"};switch(i){case "logo":return jsxRuntime.jsx(tn,{logoUrl:n.logoUrl,fallbackText:n.fallbackText,size:n.size,alignment:n.alignment,colors:l,enableInlineEditing:o,sectionId:s});case "header":return jsxRuntime.jsx(nn,{name:n.name,title:n.title,bio:n.bio,showName:n.showName,showTitle:n.showTitle,showBio:n.showBio,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "featured_link":return jsxRuntime.jsx(on,{text:n.text,url:n.url,style:n.style,size:n.size,colors:l,enableInlineEditing:o,sectionId:s});case "link_list":return jsxRuntime.jsx(sn,{links:n.links||[],style:n.style,colors:l,enableInlineEditing:o,sectionId:s});case "social_bar":return jsxRuntime.jsx(ln,{platforms:n.platforms||[],socialLinks:n.socialLinks,style:n.style,size:n.size,position:n.position,invertIcons:n.invertIcons,colors:l,enableInlineEditing:o,sectionId:s});case "instagram_feed":return jsxRuntime.jsx(Fn,{username:n.username,colors:l,enableInlineEditing:o,sectionId:s});case "minimal_header":return jsxRuntime.jsx(bn,{brandName:n.brandName,logoUrl:n.logoUrl,style:n.style,alignment:n.alignment,sticky:n.sticky,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "minimal_navigation":return jsxRuntime.jsx(xn,{links:n.links||[],style:n.style,colors:l,enableInlineEditing:o,sectionId:s});case "feature_content":return jsxRuntime.jsx(wn,{headline:n.headline,description:n.description,image:n.image,buttonText:n.buttonText,buttonUrl:n.buttonUrl,showButton:n.showButton,layout:n.layout,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "minimal_footer":return jsxRuntime.jsx(vn,{alignment:n.alignment,showSocial:n.showSocial,showContact:n.showContact,showLinks:n.showLinks,footerText:n.footerText,colors:l,enableInlineEditing:o,sectionId:s});case "hero":return jsxRuntime.jsx(cn,{headline:n.headline,subheadline:n.subheadline,heroImage:n.heroImage,ctaButton:n.ctaButton,layout:n.layout,imagePosition:n.imagePosition,contentDisplay:n.contentDisplay,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "about":return jsxRuntime.jsx(dn,{title:n.title,content:n.content,image:n.image,layout:n.layout,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "services_preview":return jsxRuntime.jsx(un,{title:n.title,services:n.services,layout:n.layout,columns:n.columns,showPrices:n.showPrices,showDuration:n.showDuration,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "gallery":return jsxRuntime.jsx(mn,{title:n.title,images:n.images||[],columns:n.columns,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "testimonials":return jsxRuntime.jsx(gn,{title:n.title,testimonials:n.testimonials,layout:n.layout,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "team":return jsxRuntime.jsx(fn,{title:n.title,members:n.members,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "contact":return jsxRuntime.jsx(yn,{title:n.title,showForm:n.showForm,email:n.email,phone:n.phone,address:n.address,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "before_after":return jsxRuntime.jsx(Cn,{title:n.title,comparisons:n.comparisons,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "pricing_table":return jsxRuntime.jsx(Sn,{title:n.title,plans:n.plans,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "booking":return jsxRuntime.jsx(En,{config:a||{},colors:l,BookingFlowComponent:r,enableInlineEditing:o,sectionId:s});case "fixed_info_card":return jsxRuntime.jsx(In,{name:n.name,subheading:n.subheading,bio:n.bio,links:n.links||[],bookingButtonText:n.bookingButtonText,bookingButtonUrl:n.bookingButtonUrl,showBookingButton:n.showBookingButton,position:n.position,cardWidth:n.cardWidth,cardColor:n.cardColor,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "video_section":return jsxRuntime.jsx(Rn,{videoUrl:n.videoUrl,aspectRatio:n.aspectRatio,autoplay:n.autoplay,loop:n.loop,muted:n.muted,controls:n.controls,allowFullScreen:n.allowFullScreen,coverImage:n.coverImage,maxWidth:n.maxWidth,alignment:n.alignment,borderRadius:n.borderRadius,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "scrolling_text_divider":return jsxRuntime.jsx(Pn,{text:n.text,scrollDirection:n.scrollDirection,scrollSpeed:n.scrollSpeed,orientation:n.orientation,dividerIcon:n.dividerIcon,customIcon:n.customIcon,textSize:n.textSize,textColor:n.textColor,fontWeight:n.fontWeight,backgroundColor:n.backgroundColor,backgroundGradient:n.backgroundGradient,pauseOnHover:n.pauseOnHover,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "location_map":return jsxRuntime.jsx(An,{address:n.address,displayType:n.displayType,mapHeight:n.mapHeight,mapStyle:n.mapStyle,zoom:n.zoom,showMarker:n.showMarker,borderRadius:n.borderRadius,directionsButtonText:n.directionsButtonText,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "image_section":return jsxRuntime.jsx(Mn,{imageUrl:n.imageUrl,altText:n.altText,caption:n.caption,maxWidth:n.maxWidth,alignment:n.alignment,aspectRatio:n.aspectRatio,borderRadius:n.borderRadius,linkUrl:n.linkUrl,openInNewTab:n.openInNewTab,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "faq_section":return jsxRuntime.jsx($n,{title:n.title,faqs:n.faqs,layout:n.layout,maxWidth:n.maxWidth,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "navbar":return jsxRuntime.jsx(Bn,{brandName:n.brandName,logoUrl:n.logoUrl,showLogo:n.showLogo,showBrandName:n.showBrandName,links:n.links,ctaText:n.ctaText,ctaUrl:n.ctaUrl,sticky:n.sticky,transparentOnTop:n.transparentOnTop,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "text_section":return jsxRuntime.jsx(zn,{title:n.title,content:n.content,alignment:n.alignment,maxWidth:n.maxWidth,textSize:n.textSize,backgroundColor:n.backgroundColor,textColor:n.textColor,paddingY:n.paddingY,colors:l,typography:c,enableInlineEditing:o,sectionId:s});default:return jsxRuntime.jsx("div",{className:"container mx-auto px-4 py-16",children:jsxRuntime.jsx("div",{className:"max-w-4xl mx-auto p-8 rounded-lg border-2 border-dashed text-center",style:{borderColor:l.primary,opacity:.5},children:jsxRuntime.jsxs("p",{className:"text-lg",style:{color:l.text},children:["Unknown section type: ",i]})})})}}var Xn=null;function bi(){if(!Xn){let e=undefined.VITE_SUPABASE_URL||process.env.NEXT_PUBLIC_SUPABASE_URL,t=undefined.VITE_SUPABASE_ANON_KEY||process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY;if(!e||!t)throw new Error("Supabase URL and Anon Key must be provided");Xn=supabaseJs.createClient(e,t);}return Xn}var nt={bucket:"form-uploads",limits:{maxSize:5*1024*1024,allowedTypes:["image/jpeg","image/png","image/webp","image/jpg"]}};async function To(e,t,r){if(console.log("\u{1F4E6} uploadFormImage called:",{fileName:e.name,clientId:t,formId:r}),e.size>nt.limits.maxSize)throw new Error(`File size exceeds maximum of ${nt.limits.maxSize/1024/1024}MB`);if(!nt.limits.allowedTypes.includes(e.type))throw new Error(`File type ${e.type} not allowed. Accepted types: JPG, PNG, WebP`);console.log("\u{1F3A8} Starting image optimization...");let a=await hi(e);console.log("\u2705 Image optimized:",{originalSize:e.size,optimizedSize:a.size});let o=Date.now();e.name.split(".").pop()?.toLowerCase()||"jpg";let n=e.name.replace(/[^a-zA-Z0-9.-]/g,"_").substring(0,50),s=`${o}_${n}`,l=`${t}/${r}/${s}`;console.log("\u2601\uFE0F Uploading to Supabase:",{filePath:l,bucket:nt.bucket});let c=bi(),{data:d,error:u}=await c.storage.from(nt.bucket).upload(l,a,{cacheControl:"3600",upsert:false,contentType:a.type});if(console.log("\u{1F4E4} Upload result:",{data:d,error:u}),u)throw console.error("\u274C Supabase upload error:",u),new Error(`Upload failed: ${u.message}`);console.log("\u2705 Upload successful, getting public URL...");let{data:{publicUrl:m}}=c.storage.from(nt.bucket).getPublicUrl(l);return console.log("\u2705 Public URL obtained:",m),{url:m,path:l,filename:e.name,size:a.size,type:a.type}}async function hi(e,t=1920,r=.85){console.log("\u{1F5BC}\uFE0F optimizeImage: Starting optimization");let a=e.type==="image/png"||e.type==="image/webp",o=a?e.type:"image/jpeg";return console.log("\u{1F5BC}\uFE0F optimizeImage: Output type:",o,"Transparency:",a),new Promise((i,n)=>{let s=setTimeout(()=>{console.error("\u23F1\uFE0F optimizeImage: Timeout after 30 seconds"),n(new Error("Image optimization timed out"));},3e4),l=new Image,c=document.createElement("canvas"),d=c.getContext("2d",{alpha:a});if(!d){clearTimeout(s),console.error("\u274C optimizeImage: Canvas context not available"),n(new Error("Canvas context not available"));return}console.log("\u{1F5BC}\uFE0F optimizeImage: Created canvas and context"),l.onload=()=>{console.log("\u{1F5BC}\uFE0F optimizeImage: Image loaded",{width:l.width,height:l.height});try{let u=Math.min(t/l.width,1);c.width=l.width*u,c.height=l.height*u,console.log("\u{1F5BC}\uFE0F optimizeImage: Resizing to",{width:c.width,height:c.height}),a&&d.clearRect(0,0,c.width,c.height),d.drawImage(l,0,0,c.width,c.height),console.log("\u{1F5BC}\uFE0F optimizeImage: Image drawn, converting to blob..."),c.toBlob(m=>{if(clearTimeout(s),!m){console.error("\u274C optimizeImage: Blob conversion failed"),n(new Error("Image optimization failed"));return}console.log("\u2705 optimizeImage: Blob created",{size:m.size,type:o});let p=new File([m],e.name,{type:o,lastModified:Date.now()});console.log("\u2705 optimizeImage: Optimization complete"),i(p);},o,r);}catch(u){clearTimeout(s),console.error("\u274C optimizeImage: Error during processing",u),n(u);}},l.onerror=u=>{clearTimeout(s),console.error("\u274C optimizeImage: Failed to load image",u),n(new Error("Failed to load image"));},console.log("\u{1F5BC}\uFE0F optimizeImage: Creating object URL and loading image..."),l.src=URL.createObjectURL(e);})}function Po(e){return e.size>nt.limits.maxSize?{valid:false,error:`File size exceeds maximum of ${nt.limits.maxSize/1024/1024}MB`}:nt.limits.allowedTypes.includes(e.type)?{valid:true}:{valid:false,error:"File type not allowed. Accepted: JPG, PNG, WebP"}}function Pr({field:e,value:t,error:r,onChange:a,businessId:o,formId:i,styling:n}){let s=Ge.useRef(null),[l,c]=Ge.useState(false),[d,u]=Ge.useState(null),m=n?.labelColor||"#374151",p=n?.fieldStyle||"outlined",w=(()=>{let g="w-full px-4 py-2 transition-all focus:outline-none";if(r)return `${g} bg-red-50 border border-red-300 rounded-lg focus:ring-2 focus:ring-red-500`;switch(p){case "filled":return `${g} bg-gray-100 border border-transparent rounded-lg focus:bg-white focus:ring-2 focus:ring-gray-900 focus:border-transparent`;case "underlined":return `${g} bg-transparent border-0 border-b-2 border-gray-300 rounded-none focus:border-gray-900 focus:ring-0 px-0`;case "minimal":return `${g} bg-transparent border border-gray-200 rounded-lg focus:border-gray-400 focus:ring-1 focus:ring-gray-300`;case "outlined":default:return `${g} bg-white border-2 border-gray-300 rounded-lg focus:border-gray-900 focus:ring-2 focus:ring-gray-900`}})(),N="block text-sm font-medium mb-1";if(e.type==="text"||e.type==="email"||e.type==="tel")return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:e.id,className:N,style:{color:m},children:[e.label,e.required&&jsxRuntime.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),jsxRuntime.jsx("input",{type:e.type,id:e.id,name:e.id,value:t||"",onChange:g=>a(g.target.value),placeholder:e.placeholder,required:e.required,className:w,style:{color:m}}),r&&jsxRuntime.jsx("p",{className:"mt-1 text-xs text-red-600",children:r})]});if(e.type==="textarea")return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:e.id,className:N,style:{color:m},children:[e.label,e.required&&jsxRuntime.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),jsxRuntime.jsx("textarea",{id:e.id,name:e.id,value:t||"",onChange:g=>a(g.target.value),placeholder:e.placeholder,required:e.required,rows:4,className:w,style:{color:m}}),r&&jsxRuntime.jsx("p",{className:"mt-1 text-xs text-red-600",children:r})]});if(e.type==="date")return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:e.id,className:N,style:{color:m},children:[e.label,e.required&&jsxRuntime.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),jsxRuntime.jsx("input",{type:"date",id:e.id,name:e.id,value:t||"",onChange:g=>a(g.target.value),required:e.required,className:w,style:{color:m}}),r&&jsxRuntime.jsx("p",{className:"mt-1 text-xs text-red-600",children:r})]});if(e.type==="select"&&e.options)return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:e.id,className:N,style:{color:m},children:[e.label,e.required&&jsxRuntime.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),jsxRuntime.jsxs("select",{id:e.id,name:e.id,value:t||"",onChange:g=>a(g.target.value),required:e.required,className:w,style:{color:m},children:[jsxRuntime.jsx("option",{value:"",children:"Select an option..."}),e.options.map(g=>jsxRuntime.jsx("option",{value:g.value,children:g.label},g.value))]}),r&&jsxRuntime.jsx("p",{className:"mt-1 text-xs text-red-600",children:r})]});if(e.type==="radio"&&e.options)return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{className:N,style:{color:m},children:[e.label,e.required&&jsxRuntime.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),jsxRuntime.jsx("div",{className:"space-y-2 mt-2",children:e.options.map(g=>jsxRuntime.jsxs("label",{className:"flex items-center space-x-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"radio",name:e.id,value:g.value,checked:t===g.value,onChange:v=>a(v.target.value),required:e.required,className:"w-4 h-4 text-gray-900 focus:ring-gray-900 focus:ring-2"}),jsxRuntime.jsx("span",{className:"text-sm",style:{color:n?.labelColor||"#000000"},children:g.label})]},g.value))}),r&&jsxRuntime.jsx("p",{className:"mt-1 text-xs text-red-600",children:r})]});if(e.type==="checkbox"&&e.options){let g=Array.isArray(t)?t:[],v=f=>{let C=g.includes(f)?g.filter(S=>S!==f):[...g,f];a(C);};return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{className:N,style:{color:m},children:[e.label,e.required&&jsxRuntime.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),jsxRuntime.jsx("div",{className:"space-y-2 mt-2",children:e.options.map(f=>jsxRuntime.jsxs("label",{className:"flex items-center space-x-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",name:`${e.id}[]`,value:f.value,checked:g.includes(f.value),onChange:()=>v(f.value),className:"w-4 h-4 text-gray-900 focus:ring-gray-900 focus:ring-2 rounded"}),jsxRuntime.jsx("span",{className:"text-sm",style:{color:n?.labelColor||"#000000"},children:f.label})]},f.value))}),r&&jsxRuntime.jsx("p",{className:"mt-1 text-xs text-red-600",children:r})]})}if(e.type==="photo"){let g=async v=>{let f=v.target.files?.[0];if(!f)return;u(null);let C=Po(f);if(!C.valid){u(C.error||"Invalid file"),s.current&&(s.current.value="");return}if(!o||!i){u("Missing required configuration for file upload"),s.current&&(s.current.value="");return}c(true);try{let S=await To(f,o,i);a({url:S.url,filename:S.filename,size:S.size,type:S.type,uploadedAt:new Date().toISOString()}),u(null);}catch(S){console.error("Photo upload error:",S),u(S instanceof Error?S.message:"Upload failed"),s.current&&(s.current.value="");}finally{c(false);}};return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:e.id,className:N,style:{color:m},children:[e.label,e.required&&jsxRuntime.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),jsxRuntime.jsxs("div",{className:"mt-1",children:[jsxRuntime.jsx("input",{ref:s,type:"file",id:e.id,name:e.id,accept:"image/*",onChange:g,required:e.required,disabled:l,className:`block w-full text-sm text-gray-500
10
+ `}),jsxRuntime.jsxs("div",{className:`flex items-center whitespace-nowrap ${h[n]} ${k[l]} uppercase tracking-wider`,style:{fontFamily:g?.headingFont||"inherit",color:s||p.text,animation:`scroll-${t} ${C}s linear infinite`,animationPlayState:w?"paused":"running"},children:[jsxRuntime.jsx("span",{className:"inline-block",children:I}),jsxRuntime.jsx("span",{className:"inline-block","aria-hidden":"true",children:I})]})]})}function An({address:e,displayType:t="both",mapHeight:r="medium",mapStyle:a="roadmap",zoom:o=15,showMarker:i=true,borderRadius:n=12,directionsButtonText:s="Get Directions",colors:l,typography:c,enableInlineEditing:d=false,sectionId:u=""}){let g={small:300,medium:400,large:500}[r],b=encodeURIComponent(e),v=`https://www.google.com/maps/dir/?api=1&destination=${b}`,f=`https://www.google.com/maps/embed/v1/place?key=${undefined?.VITE_GOOGLE_MAPS_API_KEY||typeof globalThis<"u"&&globalThis.process?.env?.NEXT_PUBLIC_GOOGLE_MAPS_API_KEY||""}&q=${b}&zoom=${o}&maptype=${a}`;return jsxRuntime.jsx("div",{className:"container mx-auto px-4",children:jsxRuntime.jsxs("div",{className:"max-w-4xl mx-auto",children:[(t==="map-only"||t==="both")&&e&&jsxRuntime.jsx("div",{className:"w-full overflow-hidden mb-6",style:{height:`${g}px`,borderRadius:`${n}px`},children:jsxRuntime.jsx("iframe",{src:f,className:"w-full h-full",style:{border:0},allowFullScreen:true,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",title:"Location Map"})}),(t==="address-only"||t==="both")&&jsxRuntime.jsx("div",{className:"p-6 rounded-lg border",style:{backgroundColor:`${l.primary}10`,borderColor:`${l.primary}30`,borderRadius:`${n}px`},children:jsxRuntime.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-4",children:[jsxRuntime.jsx("div",{className:"flex-1",children:jsxRuntime.jsxs("div",{className:"flex items-start gap-3",children:[jsxRuntime.jsxs("svg",{className:"w-5 h-5 mt-0.5 flex-shrink-0",fill:"none",stroke:l.primary,viewBox:"0 0 24 24",children:[jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"font-medium mb-1",style:{color:l.text,fontFamily:c?.bodyFont||"inherit"},...d&&{"data-editable":true,"data-section-id":u,"data-field-path":"settings.address"},children:e||"Add your address"}),e&&jsxRuntime.jsx("a",{href:v,target:"_blank",rel:"noopener noreferrer",className:"text-sm underline hover:no-underline",style:{color:l.primary},children:"View in Google Maps \uFFFD"})]})]})}),e&&jsxRuntime.jsx("a",{href:v,target:"_blank",rel:"noopener noreferrer",className:"px-6 py-3 rounded-lg font-semibold transition-all hover:opacity-90 text-center",style:{backgroundColor:l.primary,color:"#FFFFFF"},children:s})]})}),!e&&jsxRuntime.jsxs("div",{className:"p-12 rounded-lg border-2 border-dashed text-center",style:{borderColor:`${l.primary}30`,borderRadius:`${n}px`},children:[jsxRuntime.jsxs("svg",{className:"w-12 h-12 mx-auto mb-4",fill:"none",stroke:l.primary,viewBox:"0 0 24 24",children:[jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})]}),jsxRuntime.jsx("p",{style:{color:l.text,opacity:.6},children:"Add your business address to display a map"})]})]})})}function Mn({imageUrl:e,altText:t="",caption:r,maxWidth:a="large",alignment:o="center",aspectRatio:i="auto",borderRadius:n=12,linkUrl:s,openInNewTab:l=true,colors:c,typography:d,enableInlineEditing:u=false,sectionId:p=""}){let g={full:"max-w-full",large:"max-w-6xl",medium:"max-w-4xl",small:"max-w-2xl"},b={auto:null,"16:9":"56.25%","4:3":"75%","1:1":"100%","3:2":"66.67%"},v=o==="center"?"mx-auto":o==="right"?"ml-auto":"mr-auto",w=jsxRuntime.jsxs("div",{className:`${g[a]} ${v}`,children:[jsxRuntime.jsx("div",{className:"relative w-full overflow-hidden",style:{borderRadius:`${n}px`,...b[i]&&{paddingBottom:b[i]}},children:e?jsxRuntime.jsx("img",{src:e,alt:t||"Image",className:i==="auto"?"w-full h-auto":"absolute top-0 left-0 w-full h-full object-cover",style:{borderRadius:`${n}px`}}):jsxRuntime.jsx("div",{className:"flex items-center justify-center bg-gray-100",style:{backgroundColor:`${c.primary}10`,borderRadius:`${n}px`,minHeight:i==="auto"?"300px":void 0},children:jsxRuntime.jsxs("div",{className:"text-center px-4",children:[jsxRuntime.jsx("svg",{className:"w-16 h-16 mx-auto mb-4",fill:"none",stroke:c.primary,viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),jsxRuntime.jsx("p",{style:{color:c.text,opacity:.6},children:"Add an image URL to display"})]})})}),r&&e&&jsxRuntime.jsx("p",{className:"mt-3 text-sm text-center",style:{color:c.text,opacity:.7,fontFamily:d?.bodyFont||"inherit"},...u&&{"data-editable":true,"data-section-id":p,"data-field-path":"settings.caption"},children:r})]});return jsxRuntime.jsx("div",{className:a==="full"?"w-full":"container mx-auto px-4",children:s&&e?jsxRuntime.jsx("a",{href:s,target:l?"_blank":"_self",rel:l?"noopener noreferrer":void 0,className:"block",children:w}):w})}function Xa({faq:e,index:t,colors:r,typography:a,enableInlineEditing:o,sectionId:i}){let[n,s]=Ge.useState(false);return jsxRuntime.jsxs("div",{className:"border-b border-opacity-10",style:{borderColor:r.text},children:[jsxRuntime.jsxs("button",{onClick:()=>s(!n),className:"w-full py-4 px-6 flex items-center justify-between text-left hover:bg-opacity-5 transition-colors",style:{backgroundColor:n?`${r.primary}10`:"transparent"},children:[jsxRuntime.jsx("span",{className:"font-semibold text-lg pr-4",style:{color:r.text,fontFamily:a?.headingFont||"inherit"},...o&&{"data-editable":true,"data-section-id":i,"data-field-path":`settings.faqs.${t}.question`},children:e.question||"Add question..."}),jsxRuntime.jsx("svg",{className:"w-5 h-5 flex-shrink-0 transition-transform",style:{color:r.primary,transform:n?"rotate(180deg)":"rotate(0deg)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),n&&jsxRuntime.jsx("div",{className:"px-6 pb-4 pt-2",style:{color:r.text,opacity:.8,fontFamily:a?.bodyFont||"inherit"},...o&&{"data-editable":true,"data-section-id":i,"data-field-path":`settings.faqs.${t}.answer`},children:e.answer||"Add answer..."})]})}function $n({title:e="Frequently Asked Questions",faqs:t=[],layout:r="accordion",maxWidth:a="large",colors:o,typography:i,enableInlineEditing:n=false,sectionId:s=""}){return jsxRuntime.jsx("div",{className:"container mx-auto px-4",children:jsxRuntime.jsxs("div",{className:`${{full:"max-w-full",large:"max-w-4xl",medium:"max-w-3xl",small:"max-w-2xl"}[a]} mx-auto`,children:[e&&jsxRuntime.jsx("h2",{className:"text-3xl font-bold text-center mb-8",style:{color:o.text,fontFamily:i?.headingFont||"inherit"},...n&&{"data-editable":true,"data-section-id":s,"data-field-path":"settings.title"},children:e}),t.length>0?jsxRuntime.jsx("div",{className:"rounded-lg overflow-hidden",style:{border:`1px solid ${o.text}20`,backgroundColor:`${o.primary}05`},children:t.map((c,d)=>r==="accordion"?jsxRuntime.jsx(Xa,{faq:c,index:d,colors:o,typography:i,enableInlineEditing:n,sectionId:s},d):jsxRuntime.jsxs("div",{className:"border-b border-opacity-10 last:border-b-0 p-6",style:{borderColor:o.text},children:[jsxRuntime.jsx("h3",{className:"font-semibold text-lg mb-2",style:{color:o.text,fontFamily:i?.headingFont||"inherit"},...n&&{"data-editable":true,"data-section-id":s,"data-field-path":`settings.faqs.${d}.question`},children:c.question||"Add question..."}),jsxRuntime.jsx("p",{style:{color:o.text,opacity:.8,fontFamily:i?.bodyFont||"inherit"},...n&&{"data-editable":true,"data-section-id":s,"data-field-path":`settings.faqs.${d}.answer`},children:c.answer||"Add answer..."})]},d))}):jsxRuntime.jsxs("div",{className:"p-12 rounded-lg border-2 border-dashed text-center",style:{borderColor:`${o.primary}30`,backgroundColor:`${o.primary}05`},children:[jsxRuntime.jsx("svg",{className:"w-12 h-12 mx-auto mb-4",fill:"none",stroke:o.primary,viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),jsxRuntime.jsx("p",{style:{color:o.text,opacity:.6},children:"Add FAQ items to get started"})]})]})})}function Bn({brandName:e="Your Brand",logoUrl:t,showLogo:r=true,showBrandName:a=true,links:o=[],ctaText:i,ctaUrl:n,sticky:s=true,transparentOnTop:l=false,colors:c,typography:d,enableInlineEditing:u=false,sectionId:p=""}){let[g,b]=Ge.useState(false),[v,w]=Ge.useState(false),[f,x]=Ge.useState("");Ge.useEffect(()=>{let h=()=>{w(window.scrollY>20);};return window.addEventListener("scroll",h),()=>window.removeEventListener("scroll",h)},[]),Ge.useEffect(()=>{let h=()=>{let k=o.filter(I=>I.url.startsWith("#")).map(I=>document.querySelector(`[data-section-id="${I.url.substring(1)}"]`)).filter(Boolean),S="";k.forEach(I=>{if(I){let R=I.getBoundingClientRect();R.top<=100&&R.bottom>=100&&(S=I.getAttribute("data-section-id")||"");}}),x(S);};return window.addEventListener("scroll",h),()=>window.removeEventListener("scroll",h)},[o]);let y=(h,k)=>{if(k.startsWith("#")){h.preventDefault();let S=k.substring(1),I=document.querySelector(`[data-section-id="${S}"]`);I&&I.scrollIntoView({behavior:"smooth",block:"start"}),b(false);}},N=l&&!v;return jsxRuntime.jsx("nav",{className:`${s?"sticky top-0 z-50":""} ${N?"bg-transparent":s?"bg-white/80 backdrop-blur-md border-b":"bg-white border-b"} transition-all duration-300`,style:{borderColor:N?"transparent":`${c.primary}20`},children:jsxRuntime.jsxs("div",{className:"container mx-auto px-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between h-16 md:h-20",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[r&&t&&jsxRuntime.jsx("img",{src:t,alt:e,className:"h-8 md:h-10 w-auto object-contain"}),a&&jsxRuntime.jsx("h1",{className:"text-xl md:text-2xl font-bold",style:{fontFamily:d?.headingFont||"inherit",color:c.text},...u&&{"data-editable":true,"data-section-id":p,"data-field-path":"settings.brandName"},children:e})]}),jsxRuntime.jsxs("div",{className:"hidden md:flex items-center gap-8",children:[o.map((h,k)=>{let S=h.url.startsWith("#")&&h.url.substring(1)===f;return jsxRuntime.jsxs("a",{href:h.url,onClick:I=>y(I,h.url),className:"relative text-base font-medium transition-colors group",style:{color:S?c.primary:c.text,fontFamily:d?.bodyFont||"inherit"},...h.linkType==="external"&&!h.url.startsWith("#")?{target:"_blank",rel:"noopener noreferrer"}:{},...u&&{"data-editable":true,"data-section-id":p,"data-field-path":`settings.links.${k}.label`},children:[h.label,jsxRuntime.jsx("span",{className:`absolute -bottom-1 left-0 h-0.5 transition-all ${S?"w-full":"w-0 group-hover:w-full"}`,style:{backgroundColor:c.primary}})]},h.id)}),i&&n&&jsxRuntime.jsx("a",{href:n,className:"px-6 py-2.5 rounded-full font-semibold transition-all hover:opacity-90 hover:scale-105",style:{backgroundColor:c.primary,color:c.buttonText||"#FFFFFF",fontFamily:d?.bodyFont||"inherit"},children:i})]}),jsxRuntime.jsx("button",{onClick:()=>b(!g),className:"md:hidden p-2 rounded-lg transition-colors hover:bg-black/5","aria-label":"Toggle menu",children:jsxRuntime.jsx("svg",{className:"w-6 h-6",fill:"none",stroke:c.text,viewBox:"0 0 24 24",children:g?jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"}):jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})]}),jsxRuntime.jsx("div",{className:`md:hidden overflow-hidden transition-all duration-300 ${g?"max-h-96 pb-4":"max-h-0"}`,children:jsxRuntime.jsxs("div",{className:"flex flex-col space-y-3 pt-4 border-t",style:{borderColor:`${c.primary}20`},children:[o.map((h,k)=>{let S=h.url.startsWith("#")&&h.url.substring(1)===f;return jsxRuntime.jsx("a",{href:h.url,onClick:I=>y(I,h.url),className:"text-base font-medium py-2 px-4 rounded-lg transition-colors",style:{color:S?c.primary:c.text,backgroundColor:S?`${c.primary}10`:"transparent",fontFamily:d?.bodyFont||"inherit"},...h.linkType==="external"&&!h.url.startsWith("#")?{target:"_blank",rel:"noopener noreferrer"}:{},children:h.label},h.id)}),i&&n&&jsxRuntime.jsx("a",{href:n,className:"px-6 py-3 rounded-full font-semibold text-center transition-all hover:opacity-90",style:{backgroundColor:c.primary,color:c.buttonText||"#FFFFFF",fontFamily:d?.bodyFont||"inherit"},children:i})]})})]})})}function zn({title:e,content:t,alignment:r="left",maxWidth:a="medium",textSize:o="medium",backgroundColor:i,textColor:n,paddingY:s="medium",colors:l,typography:c,enableInlineEditing:d=false,sectionId:u=""}){let p={full:"max-w-full",large:"max-w-6xl",medium:"max-w-4xl",small:"max-w-2xl"},g={left:"text-left",center:"text-center",right:"text-right"},b={small:"text-sm",medium:"text-base",large:"text-lg"};return jsxRuntime.jsx("div",{className:{none:"py-0",small:"py-8",medium:"py-16",large:"py-24"}[s],style:{backgroundColor:i||"transparent"},children:jsxRuntime.jsx("div",{className:"container mx-auto px-4",children:jsxRuntime.jsxs("div",{className:`${p[a]} mx-auto ${g[r]}`,children:[e&&jsxRuntime.jsx("h2",{className:"text-3xl md:text-4xl font-bold mb-6",style:{color:n||l.text,fontFamily:c?.headingFont||"inherit"},...d&&{"data-editable":true,"data-section-id":u,"data-field-path":"settings.title"},children:e}),jsxRuntime.jsx("div",{className:`${b[o]} leading-relaxed whitespace-pre-wrap`,style:{color:n||l.text,fontFamily:c?.bodyFont||"inherit"},...d&&{"data-editable":true,"data-section-id":u,"data-field-path":"settings.content"},children:t||"Add your text content here..."})]})})})}function $c(e,t=false){if(t)return .15;switch(e){case "fast":return .2;case "slow":return .5;default:return .3}}function Ja(e=50){return {enter:t=>({x:t==="forward"?e:-e,opacity:0}),center:{x:0,opacity:1},exit:t=>({x:t==="forward"?-e:e,opacity:0})}}function Qa(){return {enter:()=>({opacity:0,scale:.95}),center:{opacity:1,scale:1},exit:()=>({opacity:0,scale:.95})}}function Lc(e,t){return e==="fade"?Qa():Ja(t)}var rr={easing:[.4,0,.2,1],spring:{type:"spring",damping:30,stiffness:300},staggerChildren:{staggerChildren:.05,delayChildren:.1},cardHover:{scale:1.02,transition:{duration:.2}},buttonHover:{scale:1.05,transition:{duration:.2}},fadeIn:{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},slideUp:{initial:{y:"100%"},animate:{y:0},exit:{y:"100%"}},scaleIn:{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9}},slideInLeft:{initial:{opacity:0,x:-10},animate:{opacity:1,x:0}},slideInRight:{initial:{opacity:0,x:10},animate:{opacity:1,x:0}},backdrop:{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}}};function Bc(){return typeof window>"u"?false:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function zc(e,t=.1,r=.05){return Array.from({length:e},(a,o)=>({initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.3,delay:t+o*r,ease:rr.easing}}))}function ge(e=0,t=.3){return {initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:t,delay:e,ease:rr.easing}}}function On({services:e,categories:t=[],selectedService:r,onServiceSelect:a,settings:o,colors:i}){let[n,s]=Ge.useState(null),[l,c]=Ge.useState(new Set(t.length>0?[t[0].id]:[])),d=o.serviceLayout||"grid",u=o.columns||2,p=o.headerContent?.value||"Choose Your Service",g=o.subheaderContent?.value||"Select the service you'd like to book",b=o.showPricing!==false,v=o.showDuration!==false,w=o.showDescription!==false,f=o.enableCategories===true,x=o.categoryStyle||"dropdown",y=o.policyImages||[],N=o.policyText||null,C=o.imageSpacing||"small",h={none:"0px",small:"8px",medium:"16px",large:"24px"},k=o.imageBorderRadius||"0px",S={1:"grid-cols-1",2:"grid-cols-1 sm:grid-cols-2",3:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3",4:"grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4"}[u]||"grid-cols-2",I=f&&n?e.filter(m=>m.category===n):e,R=(m,F)=>{let M=r===m.id;return jsxRuntime.jsx("button",{onClick:()=>a(m.id),className:`w-full ${F==="grid"?"h-full":""} p-4 rounded-lg border-2 transition-all text-left ${F==="grid"?"flex flex-col":""} ${M?"border-current shadow-lg":"border-gray-200 hover:border-gray-300"}`,style:{borderColor:M?i.primary:void 0,backgroundColor:M?`${i.primary}10`:void 0},children:F==="grid"?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("p",{className:"font-semibold mb-1",children:m.name}),w&&jsxRuntime.jsx("p",{className:"text-xs opacity-70 mb-2 flex-1",children:m.description}),jsxRuntime.jsxs("div",{className:"flex justify-between items-center text-sm mt-auto",children:[b&&jsxRuntime.jsxs("span",{className:"font-bold",style:{color:i.primary},children:["$",m.price]}),v&&jsxRuntime.jsxs("span",{className:"opacity-60",children:[m.duration," min"]})]})]}):jsxRuntime.jsxs("div",{className:"flex justify-between items-start",children:[jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx("p",{className:"font-semibold mb-1",children:m.name}),w&&jsxRuntime.jsx("p",{className:"text-sm opacity-70",children:m.description})]}),jsxRuntime.jsxs("div",{className:"text-right ml-4",children:[b&&jsxRuntime.jsxs("p",{className:"font-bold",style:{color:i.primary},children:["$",m.price]}),v&&jsxRuntime.jsxs("p",{className:"text-sm opacity-60",children:[m.duration," min"]})]})]})},m.id)};return jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs(framerMotion.motion.div,{...ge(.05),className:"text-center sm:text-left",children:[jsxRuntime.jsx("h2",{className:"text-xl sm:text-2xl font-bold mb-2",style:{color:i.primary},children:p}),jsxRuntime.jsx("p",{className:"text-sm opacity-70",children:g})]}),y&&y.length>0&&jsxRuntime.jsx("div",{className:"w-full flex flex-col",style:{gap:h[C]},children:y.slice(0,3).map((m,F)=>jsxRuntime.jsx("div",{className:"w-full overflow-hidden",style:{aspectRatio:"720 / 300",borderRadius:k},children:jsxRuntime.jsx("img",{src:m.url,alt:m.alt||`Policy image ${F+1}`,className:"w-full h-full object-cover"})},F))}),(!y||y.length===0)&&N&&jsxRuntime.jsx("div",{className:"w-full p-4 rounded-lg border",style:{backgroundColor:`${i.primary}10`,borderColor:`${i.primary}30`},dangerouslySetInnerHTML:{__html:N}}),f&&t.length>0&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[x==="dropdown"&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-2",children:"Service Category"}),jsxRuntime.jsxs("select",{value:n||"all",onChange:m=>s(m.target.value==="all"?null:m.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:border-transparent transition-all",style:{"--tw-ring-color":i.primary},children:[jsxRuntime.jsx("option",{value:"all",children:"All Services"}),t.map(m=>jsxRuntime.jsx("option",{value:m.id,children:m.name},m.id))]})]}),x==="tabs"&&jsxRuntime.jsxs("div",{className:"flex gap-2 flex-wrap",children:[jsxRuntime.jsx("button",{onClick:()=>s(null),className:`px-4 py-2 rounded-lg transition-all text-sm font-medium ${n===null?"text-white shadow-lg":"border border-gray-300 hover:border-gray-400"}`,style:{backgroundColor:n===null?i.primary:void 0},children:"All Services"}),t.map(m=>jsxRuntime.jsx("button",{onClick:()=>s(m.id),className:`px-4 py-2 rounded-lg transition-all text-sm font-medium ${n===m.id?"text-white shadow-lg":"border border-gray-300 hover:border-gray-400"}`,style:{backgroundColor:n===m.id?i.primary:void 0},children:m.name},m.id))]}),x==="pills"&&jsxRuntime.jsxs("div",{className:"flex gap-2 overflow-x-auto pb-2 scrollbar-hide",children:[jsxRuntime.jsx("button",{onClick:()=>s(null),className:`px-5 py-2 rounded-full transition-all text-sm font-medium whitespace-nowrap ${n===null?"text-white shadow-md":"bg-gray-100 hover:bg-gray-200"}`,style:{backgroundColor:n===null?i.primary:void 0},children:"All"}),t.map(m=>jsxRuntime.jsx("button",{onClick:()=>s(m.id),className:`px-5 py-2 rounded-full transition-all text-sm font-medium whitespace-nowrap ${n===m.id?"text-white shadow-md":"bg-gray-100 hover:bg-gray-200"}`,style:{backgroundColor:n===m.id?i.primary:void 0},children:m.name},m.id))]}),x==="chips"&&jsxRuntime.jsxs("div",{className:"flex gap-2 flex-wrap",children:[jsxRuntime.jsxs("button",{onClick:()=>s(null),className:`px-3 py-1.5 rounded-lg transition-all text-xs font-medium flex items-center gap-1.5 ${n===null?"text-white":"border border-gray-300 bg-white hover:border-gray-400"}`,style:{backgroundColor:n===null?i.primary:void 0,borderColor:n===null?i.primary:void 0},children:[n===null&&jsxRuntime.jsx("span",{className:"text-[10px]",children:"\u2713"}),"All"]}),t.map(m=>jsxRuntime.jsxs("button",{onClick:()=>s(m.id),className:`px-3 py-1.5 rounded-lg transition-all text-xs font-medium flex items-center gap-1.5 ${n===m.id?"text-white":"border border-gray-300 bg-white hover:border-gray-400"}`,style:{backgroundColor:n===m.id?i.primary:void 0,borderColor:n===m.id?i.primary:void 0},children:[n===m.id&&jsxRuntime.jsx("span",{className:"text-[10px]",children:"\u2713"}),m.name]},m.id))]})]}),f&&x==="accordion"?jsxRuntime.jsx("div",{className:"space-y-4",children:t.map(m=>{let F=l.has(m.id),M=e.filter(A=>A.category===m.id);return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("button",{onClick:()=>{let A=new Set(l);F?A.delete(m.id):A.add(m.id),c(A);},className:"w-full flex items-center justify-between py-2 border-b-2 transition-all group",style:{borderColor:F?i.primary:"#e5e7eb"},children:[jsxRuntime.jsx("span",{className:"font-semibold text-left transition-colors",style:{color:F?i.primary:void 0},children:m.name}),jsxRuntime.jsx(lucideReact.ChevronDown,{className:`w-4 h-4 transition-all ${F?"rotate-180":""}`,style:{color:F?i.primary:"#9ca3af"}})]}),F&&jsxRuntime.jsx("div",{className:`mt-4 ${d==="grid"?`grid ${S} gap-3`:"space-y-3"}`,children:M.map(A=>R(A,d))})]},m.id)})}):d==="grid"?jsxRuntime.jsx("div",{className:`grid ${S} gap-3`,children:I.map(m=>R(m,"grid"))}):jsxRuntime.jsx("div",{className:"space-y-3",children:I.map(m=>R(m,"list"))})]})}function oi(){let e=[],t=new Date;t.setHours(0,0,0,0);for(let r=0;r<3;r++){let a=new Date(t.getFullYear(),t.getMonth()+r,1),o=new Date(a.getFullYear(),a.getMonth()+1,0).getDate();for(let i=1;i<=o;i++){if(new Date(a.getFullYear(),a.getMonth(),i)<t||Math.random()>.6)continue;let s=`${a.getFullYear()}-${String(a.getMonth()+1).padStart(2,"0")}-${String(i).padStart(2,"0")}`;e.push(s);}}return e}var ko={avoid:{bg:"#FEE2E2",text:"#991B1B",label:"Avoid"},caution:{bg:"#FEF3C7",text:"#92400E",label:"Caution"},optimal:{bg:"#D1FAE5",text:"#065F46",label:"Optimal"},neutral:{bg:"#F3F4F6",text:"#4B5563",label:"Neutral"}};function nr({availableDates:e,selectedDate:t,onDateSelect:r,settings:a,colors:o,cyclePhases:i,selectedService:n,addons:s=[],selectedAddons:l=[],onAddonsChange:c,addonPlacement:d="date_selection"}){console.log("[DateSelection] Addon Debug:",{addonsLength:s.length,hasOnAddonsChange:!!c,addonPlacement:d,showAddons:d!=="separate_step"&&s.length>0&&!!c,addons:s,selectedService:n});let u=a.calendarView||"month",p=a.headerContent?.value||"Select a Date",g=!e||e.length===0,b=Ge.useMemo(()=>g?oi():e,[g,e]),v=Ge.useMemo(()=>{let D=new Date;if(D.setHours(0,0,0,0),b.length>0){let T=b.find(P=>new Date(P)>=D);if(T){let P=new Date(T);return `${P.getFullYear()}-${String(P.getMonth()+1).padStart(2,"0")}`}}return `${D.getFullYear()}-${String(D.getMonth()+1).padStart(2,"0")}`},[b]),[w,f]=Ge.useState(v),x=Ge.useMemo(()=>new Set(b),[b]),[y,N]=w.split("-").map(Number),h=["January","February","March","April","May","June","July","August","September","October","November","December"][N-1],k=Ge.useMemo(()=>{let D=new Date(y,N-1,1),T=new Date(y,N,0),P=D.getDay(),z=T.getDate(),K=[];for(let Y=0;Y<P;Y++)K.push(null);for(let Y=1;Y<=z;Y++){let Te=`${y}-${String(N).padStart(2,"0")}-${String(Y).padStart(2,"0")}`,U=new Date(Te),ie=new Date;ie.setHours(0,0,0,0),K.push({day:Y,dateStr:Te,isAvailable:x.has(Te)&&U>=ie});}return K},[y,N,x]),S=Ge.useMemo(()=>{let D=new Date(y,N-2,1),T=`${D.getFullYear()}-${String(D.getMonth()+1).padStart(2,"0")}`;return b.some(P=>P.startsWith(T))},[b,y,N]),I=Ge.useMemo(()=>{let D=new Date(y,N,1),T=`${D.getFullYear()}-${String(D.getMonth()+1).padStart(2,"0")}`;return b.some(P=>P.startsWith(T))},[b,y,N]),R=()=>{if(!S)return;let D=new Date(y,N-2,1);f(`${D.getFullYear()}-${String(D.getMonth()+1).padStart(2,"0")}`);},m=()=>{if(!I)return;let D=new Date(y,N,1);f(`${D.getFullYear()}-${String(D.getMonth()+1).padStart(2,"0")}`);},F=i&&Object.keys(i).length>0,M=()=>{let D=n?.price||0;return l.length>0&&s.length>0&&l.forEach(T=>{let P=s.find(z=>z.id===T);P&&(D+=P.addonPrice||P.price||0);}),D},A=D=>{if(!c)return;let T=l.includes(D);c(T?l.filter(P=>P!==D):[...l,D]);};return jsxRuntime.jsxs("div",{className:"space-y-6",children:[n&&jsxRuntime.jsx(framerMotion.motion.div,{...ge(.05),className:"bg-gradient-to-br from-white to-gray-50/30 rounded-xl border border-gray-200/80 p-6 shadow-sm hover:shadow-md transition-shadow",children:jsxRuntime.jsxs("div",{className:"flex items-start justify-between gap-4",children:[jsxRuntime.jsxs("div",{className:"flex-1",children:[jsxRuntime.jsx("div",{className:"flex items-center gap-2 mb-3",children:jsxRuntime.jsx("h3",{className:"text-sm font-semibold tracking-wide uppercase",style:{color:o.primary},children:"Your Selection"})}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("p",{className:"font-bold text-lg text-gray-900",children:n.name}),n.description&&jsxRuntime.jsx("p",{className:"text-sm text-gray-600 leading-relaxed",children:n.description}),n.duration&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-gray-500",children:[jsxRuntime.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),jsxRuntime.jsxs("span",{children:[n.duration," minutes"]})]})]})]}),jsxRuntime.jsxs("div",{className:"text-right",children:[jsxRuntime.jsx("div",{className:"text-xs text-gray-500 mb-1 font-medium",children:"Price"}),jsxRuntime.jsxs("div",{className:"text-2xl font-bold",style:{color:o.primary},children:["$",n.price]})]})]})}),d!=="separate_step"&&s.length>0&&c&&jsxRuntime.jsxs(framerMotion.motion.div,{...ge(.1),className:"bg-white rounded-xl border border-gray-200/80 p-6 shadow-sm hover:shadow-md transition-shadow",children:[jsxRuntime.jsx("div",{className:"flex items-center gap-2 mb-4",children:jsxRuntime.jsx("h3",{className:"text-sm font-semibold tracking-wide uppercase",style:{color:o.primary},children:"Enhance Your Experience"})}),jsxRuntime.jsx("div",{className:"space-y-3",children:s.map(D=>{let T=l.includes(D.id),P=D.addonPrice||D.price||0;return jsxRuntime.jsxs("label",{className:"flex items-start gap-4 p-4 rounded-xl border-2 cursor-pointer transition-all group",style:{borderColor:T?o.primary:"#E5E7EB",backgroundColor:T?`${o.primary}08`:"transparent",boxShadow:T?`0 0 0 3px ${o.primary}15`:"none"},children:[jsxRuntime.jsx("div",{className:"flex items-center pt-0.5",children:jsxRuntime.jsx("input",{type:"checkbox",checked:T,onChange:()=>A(D.id),className:"w-5 h-5 rounded border-2 border-gray-300 cursor-pointer",style:{accentColor:o.primary}})}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsxs("div",{className:"flex items-start justify-between gap-3 mb-1",children:[jsxRuntime.jsx("span",{className:"font-semibold text-base text-gray-900 group-hover:text-gray-700 transition-colors",children:D.name}),jsxRuntime.jsxs("span",{className:"text-base font-bold whitespace-nowrap flex-shrink-0",style:{color:o.primary},children:["+$",P]})]}),D.description&&jsxRuntime.jsx("p",{className:"text-sm text-gray-600 leading-relaxed",children:D.description})]})]},D.id)})}),l.length>0&&jsxRuntime.jsx("div",{className:"mt-6 pt-5 border-t-2 border-gray-100",children:jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-xs text-gray-500 mb-1 font-medium uppercase tracking-wide",children:"New Total"}),jsxRuntime.jsxs("div",{className:"text-sm text-gray-600",children:["Service + ",l.length," add-on",l.length>1?"s":""]})]}),jsxRuntime.jsxs("div",{className:"text-3xl font-bold",style:{color:o.primary},children:["$",M()]})]})})]}),jsxRuntime.jsx(framerMotion.motion.h2,{...ge(.15),className:"text-xl sm:text-2xl font-bold text-center sm:text-left",style:{color:o.primary},children:p}),F&&jsxRuntime.jsx(framerMotion.motion.div,{...ge(.1),className:"bg-white rounded-lg border border-gray-200 px-4 py-3",children:jsxRuntime.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-2 text-xs",children:[jsxRuntime.jsx("span",{className:"font-medium flex items-center",style:{color:o.primary},children:"Cycle Calendar:"}),jsxRuntime.jsx("div",{className:"flex items-center gap-3",children:Object.entries(ko).map(([D,T])=>jsxRuntime.jsxs("div",{className:"flex items-center space-x-1.5",children:[jsxRuntime.jsx("div",{className:"w-3 h-3 rounded border border-gray-300",style:{backgroundColor:T.bg}}),jsxRuntime.jsx("span",{children:T.label})]},D))})]})}),u==="month"?jsxRuntime.jsxs("div",{className:"border border-gray-200 rounded-lg p-4",children:[jsxRuntime.jsxs("div",{className:"flex items-center justify-between mb-4",children:[jsxRuntime.jsx("button",{className:`p-2 rounded transition-colors ${S?"hover:bg-gray-100":"opacity-30 cursor-not-allowed"}`,onClick:R,disabled:!S,children:jsxRuntime.jsx(lucideReact.ChevronLeft,{className:"w-4 h-4"})}),jsxRuntime.jsxs("p",{className:"font-semibold",children:[h," ",y]}),jsxRuntime.jsx("button",{className:`p-2 rounded transition-colors ${I?"hover:bg-gray-100":"opacity-30 cursor-not-allowed"}`,onClick:m,disabled:!I,children:jsxRuntime.jsx(lucideReact.ChevronRight,{className:"w-4 h-4"})})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-7 gap-2",children:[["Su","Mo","Tu","We","Th","Fr","Sa"].map(D=>jsxRuntime.jsx("div",{className:"text-center text-xs font-medium py-2 opacity-60",children:D},D)),k.map((D,T)=>{if(!D)return jsxRuntime.jsx("div",{},`empty-${T}`);let{day:P,dateStr:z,isAvailable:K}=D,Y=t===z,Te=i?.[z],U=Te?ko[Te]:null;return jsxRuntime.jsx("button",{onClick:()=>K&&r(z),disabled:!K,className:`aspect-square rounded-lg text-sm transition-all ${Y?"text-white shadow-lg font-semibold":K?"hover:scale-105 cursor-pointer":"bg-gray-50 text-gray-300 cursor-not-allowed opacity-40"}`,style:{backgroundColor:Y?o.primary:U?.bg||void 0,color:Y?"white":U?.text||void 0},children:P},z)})]})]}):jsxRuntime.jsx("div",{className:"grid grid-cols-5 gap-3",children:b.slice(0,5).map(D=>{let T=new Date(D),P=T.getDate(),K=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"][T.getDay()],Y=t===D;return jsxRuntime.jsxs("button",{onClick:()=>r(D),className:`p-4 rounded-lg border-2 transition-all text-center ${Y?"border-current text-white":"border-gray-200 hover:border-gray-300"}`,style:{borderColor:Y?o.primary:void 0,backgroundColor:Y?o.primary:void 0},children:[jsxRuntime.jsx("p",{className:"text-xs mb-1 opacity-75",children:K}),jsxRuntime.jsx("p",{className:"text-2xl font-semibold",children:P})]},D)})})]})}function Hn({availableTimes:e,selectedTime:t,onTimeSelect:r,settings:a,serviceDuration:o,colors:i,selectedService:n,selectedDate:s,selectedAddons:l=[],addons:c=[]}){let d=a.timeFormat||"12h",u=a.showDuration!==false,p=a.headerContent?.value||"Pick a Time",g=a.columns||3,b=()=>{let x=n?.price||0;return l.length>0&&c.length>0&&l.forEach(y=>{let N=c.find(C=>C.id===y);N&&(x+=N.addonPrice||N.price||0);}),x},v=x=>new Date(x+"T00:00:00").toLocaleDateString("en-US",{weekday:"long",month:"long",day:"numeric",year:"numeric"}),w=x=>{let y=x.trim().split(" "),[N,C]=y[0].split(":"),h=parseInt(N),k=C||"00";if(y.length>1){let S=y[1];return d==="24h"?(S==="PM"&&h!==12?h+=12:S==="AM"&&h===12&&(h=0),`${String(h).padStart(2,"0")}:${k}`):x}if(d==="12h"){let S=h>=12?"PM":"AM";return `${h===0?12:h>12?h-12:h}:${k} ${S}`}return `${String(h).padStart(2,"0")}:${k}`},f={2:"grid-cols-2",3:"grid-cols-2 sm:grid-cols-3",4:"grid-cols-2 sm:grid-cols-3 lg:grid-cols-4"}[g]||"grid-cols-3";return jsxRuntime.jsxs("div",{className:"space-y-6",children:[n&&s&&jsxRuntime.jsxs(framerMotion.motion.div,{...ge(.05),className:"bg-gradient-to-br from-white to-gray-50/30 rounded-xl border border-gray-200/80 p-6 shadow-sm hover:shadow-md transition-shadow",children:[jsxRuntime.jsx("div",{className:"flex items-center gap-2 mb-4",children:jsxRuntime.jsx("h3",{className:"text-sm font-semibold tracking-wide uppercase",style:{color:i.primary},children:"Your Booking"})}),jsxRuntime.jsxs("div",{className:"mb-3",children:[jsxRuntime.jsx("p",{className:"font-bold text-lg text-gray-900",children:n.name}),n.duration&&jsxRuntime.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-gray-500 mt-1",children:[jsxRuntime.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),jsxRuntime.jsxs("span",{children:[n.duration," minutes"]})]})]}),l.length>0&&c.length>0&&jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("p",{className:"text-sm font-bold text-gray-900 mb-2",children:"Add-ons"}),jsxRuntime.jsx("div",{className:"space-y-2",children:l.map(x=>{let y=c.find(N=>N.id===x);return y?jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:"text-sm text-gray-700 font-medium",children:y.name}),jsxRuntime.jsxs("span",{className:"text-sm font-semibold text-gray-900",children:["$",y.addonPrice||y.price||0]})]},x):null})})]}),jsxRuntime.jsx("div",{className:"border-t border-gray-200 -mx-6 mb-4"}),jsxRuntime.jsx("div",{className:"bg-gray-50/50 -mx-6 px-6 py-4 mb-4",children:jsxRuntime.jsx("div",{className:"flex items-center justify-between",children:jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntime.jsx("svg",{className:"w-5 h-5",style:{color:i.primary},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),jsxRuntime.jsx("span",{className:"font-bold text-base text-gray-900",children:v(s)})]})})}),jsxRuntime.jsx("div",{className:"border-t border-gray-200 -mx-6 mb-4"}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("span",{className:"text-base font-bold text-gray-900",children:"Total"}),jsxRuntime.jsxs("span",{className:"text-2xl font-bold",style:{color:i.primary},children:["$",b()]})]})]}),jsxRuntime.jsx(framerMotion.motion.h2,{...ge(n&&s?.15:.05),className:"text-xl sm:text-2xl font-bold text-center sm:text-left",style:{color:i.primary},children:p}),jsxRuntime.jsx(framerMotion.motion.div,{className:`grid ${f} gap-3`,initial:{opacity:0},animate:{opacity:1},transition:{duration:.3,delay:n&&s?.2:.1},children:e.map((x,y)=>{let N=t===x;return jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>r(x),className:`p-3 rounded-lg border-2 transition-all text-center hover:scale-105 ${N?"border-current text-white shadow-lg":"border-gray-200 hover:border-gray-300"}`,style:{borderColor:N?i.primary:void 0,backgroundColor:N?i.primary:void 0},initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.2,delay:.15+y*.03,ease:"easeOut"},children:[jsxRuntime.jsx("p",{className:"font-medium",children:w(x)}),u&&o&&jsxRuntime.jsxs("p",{className:"text-xs mt-1 opacity-75",children:[o," min"]})]},x)})})]})}function Wn({addons:e,selectedAddons:t,onAddonsChange:r,settings:a,colors:o}){let i=a.headerContent?.value||"Add Extras",n=a.subheaderContent?.value||"Enhance your experience with these optional add-ons",s=a.showPricing!==false,l=a.showDuration!==false,c=d=>{let u=t.includes(d)?t.filter(p=>p!==d):[...t,d];r(u);};return jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsxs(framerMotion.motion.div,{...ge(.05),className:"text-center sm:text-left",children:[jsxRuntime.jsx("h2",{className:"text-xl sm:text-2xl font-bold mb-2",style:{color:o.primary},children:i}),jsxRuntime.jsx("p",{className:"text-sm opacity-70",children:n})]}),jsxRuntime.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:e.map((d,u)=>{let p=t.includes(d.id);return jsxRuntime.jsxs(framerMotion.motion.button,{onClick:()=>c(d.id),className:`p-4 rounded-lg border-2 transition-all text-left relative ${p?"border-current shadow-lg":"border-gray-200 hover:border-gray-300"}`,style:{borderColor:p?o.primary:void 0,backgroundColor:p?`${o.primary}10`:void 0},initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.3,delay:.1+u*.05},children:[p&&jsxRuntime.jsx("div",{className:"absolute top-3 right-3 w-6 h-6 rounded-full flex items-center justify-center text-white text-sm",style:{backgroundColor:o.primary},children:"\u2713"}),jsxRuntime.jsx("p",{className:"font-semibold mb-1 pr-8",children:d.name}),jsxRuntime.jsx("p",{className:"text-xs opacity-70 mb-3",children:d.description}),jsxRuntime.jsxs("div",{className:"flex justify-between items-center text-sm",children:[s&&jsxRuntime.jsxs("span",{className:"font-bold",style:{color:o.primary},children:["+$",d.price]}),l&&jsxRuntime.jsxs("span",{className:"opacity-60",children:["+",d.duration," min"]})]})]},d.id)})}),t.length>0&&jsxRuntime.jsxs(framerMotion.motion.div,{className:"bg-gray-50 rounded-lg p-4 mt-4",initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},children:[jsxRuntime.jsx("p",{className:"text-sm font-medium mb-2",children:"Selected Add-ons:"}),jsxRuntime.jsx("div",{className:"space-y-1",children:t.map(d=>{let u=e.find(p=>p.id===d);return u?jsxRuntime.jsxs("div",{className:"flex justify-between text-sm",children:[jsxRuntime.jsx("span",{children:u.name}),jsxRuntime.jsxs("span",{className:"font-medium",style:{color:o.primary},children:["+$",u.price]})]},d):null})})]})]})}function jn({isOpen:e,onClose:t,title:r,children:a,isRequired:o=false,maxHeight:i="80vh"}){return Ge.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset";}),[e]),Ge.useEffect(()=>{if(!o&&e){let n=s=>{s.key==="Escape"&&t();};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)}},[e,o,t]),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:e&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(framerMotion.motion.div,{...rr.backdrop,onClick:o?void 0:t,className:"fixed inset-0 bg-black/50 z-50",style:{backdropFilter:"blur(4px)"}}),jsxRuntime.jsxs(framerMotion.motion.div,{initial:{y:"100%"},animate:{y:0},exit:{y:"100%"},transition:rr.spring,className:"fixed bottom-0 left-0 right-0 bg-white rounded-t-2xl shadow-2xl z-50",style:{maxHeight:i},children:[jsxRuntime.jsx("div",{className:"flex justify-center pt-3 pb-2",children:jsxRuntime.jsx("div",{className:"w-12 h-1 bg-gray-300 rounded-full"})}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between px-6 pb-4 border-b border-gray-200",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-2",children:[r&&jsxRuntime.jsx("h3",{className:"text-lg font-semibold",children:r}),o&&jsxRuntime.jsx("span",{className:"text-xs font-medium px-2 py-0.5 bg-amber-100 text-amber-800 rounded",children:"Required"})]}),!o&&jsxRuntime.jsx("button",{onClick:t,className:"p-2 hover:bg-gray-100 rounded-lg transition-colors","aria-label":"Close",children:jsxRuntime.jsx(lucideReact.X,{className:"w-5 h-5"})})]}),jsxRuntime.jsx("div",{className:"overflow-y-auto",style:{maxHeight:`calc(${i} - 120px)`},children:jsxRuntime.jsx("div",{className:"px-6 py-6",children:a})})]})]})})}function Vn({contactInfo:e,onContactInfoChange:t,settings:r,optInModules:a=[],onOptInData:o,colors:i,isPreview:n=false}){let[s,l]=Ge.useState(false),[c,d]=Ge.useState(null),[u,p]=Ge.useState(()=>{let m={};return a.forEach(F=>{F.defaultChecked&&(m[F.id]=true);}),m}),[g,b]=Ge.useState({}),[v,w]=Ge.useState({}),f=Ge.useRef(false);Ge.useEffect(()=>{f.current||(f.current=true,a.forEach(m=>{m.defaultChecked&&m.renderCustomForm&&o&&m.renderCustomForm(()=>{},F=>o(m.id,F),i);}));},[]);let x=r.headerContent?.value||"Your Information",y=m=>m?/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(m)?null:"Please enter a valid email address":"Email is required",N=m=>m?m.replace(/\D/g,"").length<10?"Please enter a valid phone number":null:"Phone number is required",C=m=>!m||m.trim().length===0?"Name is required":m.trim().length<2?"Name must be at least 2 characters":null,h=(m,F)=>{switch(m){case "email":return y(F);case "phone":return N(F);case "name":return C(F);default:return null}},k=[{label:"Name *",type:"text",placeholder:"Your full name",field:"name"},{label:"Email *",type:"email",placeholder:"your@email.com",field:"email"},{label:"Phone *",type:"tel",placeholder:"(555) 123-4567",field:"phone"},{label:"Notes (optional)",type:"textarea",placeholder:"Any special requests or notes...",field:"notes"}],S=(m,F)=>{if(t({...e,[m]:F}),!n&&v[m]){let M=h(m,F);b(A=>({...A,[m]:M||""}));}},I=m=>{if(n)return;w(A=>({...A,[m]:true}));let F=e[m]||"",M=h(m,F);b(A=>({...A,[m]:M||""}));},R=(m,F)=>{if(p(M=>({...M,[m.id]:F})),F){if(m.renderCustomForm){let M=false;if(m.renderCustomForm(()=>{},D=>{o&&o(m.id,D),M=true;},i)===null&&M)return}d(m),l(true);}else o&&o(m.id,null);};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsx(framerMotion.motion.h2,{...ge(.05),className:"text-xl sm:text-2xl font-bold text-center sm:text-left",style:{color:i.primary},children:x}),jsxRuntime.jsxs("div",{className:"space-y-3",children:[k.map((m,F)=>jsxRuntime.jsxs(framerMotion.motion.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{duration:.3,delay:.1+F*.05,ease:"easeOut"},children:[jsxRuntime.jsx("label",{className:"block text-sm font-medium mb-1",children:m.label}),m.type==="textarea"?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("textarea",{className:`w-full px-3 py-2 border rounded-lg focus:ring-2 focus:border-transparent resize-none transition-all ${!n&&g[m.field]&&v[m.field]?"border-red-500":"border-gray-300"}`,style:{"--tw-ring-color":i.primary},rows:3,placeholder:m.placeholder,value:e[m.field]||"",onChange:M=>S(m.field,M.target.value),onBlur:()=>I(m.field)}),!n&&g[m.field]&&v[m.field]&&jsxRuntime.jsx("p",{className:"text-red-500 text-xs mt-1",children:g[m.field]})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("input",{type:m.type,className:`w-full px-3 py-2 border rounded-lg focus:ring-2 focus:border-transparent transition-all ${!n&&g[m.field]&&v[m.field]?"border-red-500":"border-gray-300"}`,style:{"--tw-ring-color":i.primary},placeholder:m.placeholder,value:e[m.field]||"",onChange:M=>S(m.field,M.target.value),onBlur:()=>I(m.field)}),!n&&g[m.field]&&v[m.field]&&jsxRuntime.jsx("p",{className:"text-red-500 text-xs mt-1",children:g[m.field]})]})]},m.label)),a.length>0&&jsxRuntime.jsx(framerMotion.motion.div,{className:"pt-3 border-t border-gray-200 space-y-3",initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.3,delay:.3},children:a.map(m=>jsxRuntime.jsxs("label",{className:"flex items-start gap-3 cursor-pointer group",children:[jsxRuntime.jsx("input",{type:"checkbox",checked:u[m.id]||false,onChange:F=>R(m,F.target.checked),className:"mt-1 w-4 h-4 rounded border-gray-300",style:{accentColor:i.primary}}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("span",{className:"text-sm font-medium",children:[m.label,m.required&&jsxRuntime.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),m.description&&jsxRuntime.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:m.description})]})]},m.id))})]})]}),c&&jsxRuntime.jsx(jn,{isOpen:s,onClose:()=>l(false),title:c.formTitle||"Additional Information",isRequired:c.required,children:c.renderCustomForm?c.renderCustomForm(()=>l(false),m=>{o&&o(c.id,m);},i):jsxRuntime.jsxs("div",{className:"space-y-4",children:[c.formFields?.map(m=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{className:"block text-sm font-medium mb-1",children:[m.label,m.required&&jsxRuntime.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),m.type==="textarea"?jsxRuntime.jsx("textarea",{className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:border-transparent resize-none",style:{"--tw-ring-color":i.primary},rows:3,placeholder:m.placeholder}):m.type==="select"&&m.options?jsxRuntime.jsx("select",{className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:border-transparent",style:{"--tw-ring-color":i.primary},children:m.options.map(F=>jsxRuntime.jsx("option",{value:F.value,children:F.label},F.value))}):jsxRuntime.jsx("input",{type:m.type,className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:border-transparent",style:{"--tw-ring-color":i.primary},placeholder:m.placeholder})]},m.id)),jsxRuntime.jsx("button",{onClick:()=>{o&&c&&o(c.id,{}),l(false);},className:"w-full py-3 rounded-lg text-white font-medium transition-all hover:opacity-90",style:{backgroundColor:i.primary},children:"Save & Continue"})]})})]})}function Yn({service:e,addons:t=[],selectedDate:r,selectedTime:a,paymentProvider:o,paymentConfig:i,onConfirm:n,colors:s,isPreview:l=false}){let c=e?.price||0,d=t.reduce((y,N)=>y+(N.addonPrice||N.price||0),0),u=c+d,p=e?.duration||0,g=t.reduce((y,N)=>y+(N.duration||0),0),b=p+g,v=i.depositPercentage||20,w=(u*(v/100)).toFixed(2),f=u.toFixed(2),x=(parseFloat(f)-parseFloat(w)).toFixed(2);return jsxRuntime.jsxs("div",{className:"space-y-4",children:[jsxRuntime.jsx(framerMotion.motion.h2,{...ge(.05),className:"text-xl font-bold text-center",style:{color:s.primary},children:"Confirm & Pay"}),jsxRuntime.jsx(framerMotion.motion.div,{className:"bg-gray-50 rounded-lg p-4",initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.3,delay:.1},children:jsxRuntime.jsxs("div",{className:"space-y-2",children:[e&&jsxRuntime.jsxs("div",{className:"flex justify-between items-center text-sm",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"font-medium",children:e.name}),jsxRuntime.jsxs("p",{className:"text-xs opacity-70",children:[b," min total"]})]}),jsxRuntime.jsxs("span",{className:"font-bold",style:{color:s.primary},children:["$",c]})]}),t.length>0&&jsxRuntime.jsx("div",{className:"space-y-1 text-xs",children:t.map(y=>jsxRuntime.jsxs("div",{className:"flex justify-between opacity-70",children:[jsxRuntime.jsxs("span",{children:["+ ",y.name]}),jsxRuntime.jsxs("span",{children:["+$",y.addonPrice||y.price||0]})]},y.id))}),r&&jsxRuntime.jsxs("div",{className:"flex justify-between items-center text-sm pt-2 border-t border-gray-200",children:[jsxRuntime.jsx("span",{className:"opacity-70",children:new Date(r+"T00:00:00").toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"})}),jsxRuntime.jsx("span",{children:a})]}),jsxRuntime.jsxs("div",{className:"pt-2 mt-2 border-t border-gray-200 flex justify-between items-center",children:[jsxRuntime.jsx("span",{className:"text-sm font-medium",children:"Due Today"}),jsxRuntime.jsxs("span",{className:"text-lg font-bold",style:{color:s.primary},children:["$",w]})]})]})}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.3,delay:.2},children:l?jsxRuntime.jsxs("div",{className:"border border-gray-200 rounded-lg p-4 bg-white",children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx("div",{className:"h-10 bg-gray-50 border border-gray-200 rounded flex items-center px-3",children:jsxRuntime.jsx("span",{className:"text-xs text-gray-400",children:"Card Number"})}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[jsxRuntime.jsx("div",{className:"h-10 bg-gray-50 border border-gray-200 rounded flex items-center px-3",children:jsxRuntime.jsx("span",{className:"text-xs text-gray-400",children:"MM/YY"})}),jsxRuntime.jsx("div",{className:"h-10 bg-gray-50 border border-gray-200 rounded flex items-center px-3",children:jsxRuntime.jsx("span",{className:"text-xs text-gray-400",children:"CVV"})})]})]}),jsxRuntime.jsxs("div",{className:"mt-3 flex items-center justify-center gap-1",children:[jsxRuntime.jsx("svg",{className:"w-3 h-3 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})}),jsxRuntime.jsxs("span",{className:"text-xs text-gray-400",children:["Powered by ",o==="square"?"Square":"Stripe"]})]})]}):jsxRuntime.jsx("div",{className:"border border-gray-200 rounded-lg p-4 bg-white",children:jsxRuntime.jsxs("div",{className:"text-center py-8 text-sm text-gray-500",children:[jsxRuntime.jsxs("div",{className:"animate-pulse",children:["Initializing ",o==="square"?"Square":"Stripe"," payment..."]}),jsxRuntime.jsx("div",{className:"mt-4 text-xs text-gray-400",children:"Please wait while we securely load the payment form"})]})})}),jsxRuntime.jsx(framerMotion.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.3,delay:.3},children:jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsxs("label",{className:"flex items-start gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",className:"mt-0.5 w-4 h-4 rounded border-gray-300",style:{accentColor:s.primary}}),jsxRuntime.jsxs("span",{className:"text-xs",children:["I agree to the ",jsxRuntime.jsx("a",{href:"#",className:"underline",style:{color:s.primary},children:"cancellation policy"})," and understand the $",x," balance is due at appointment."]})]}),jsxRuntime.jsxs("label",{className:"flex items-start gap-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",className:"mt-0.5 w-4 h-4 rounded border-gray-300",style:{accentColor:s.primary}}),jsxRuntime.jsxs("span",{className:"text-xs",children:["I agree to the ",jsxRuntime.jsx("a",{href:"#",className:"underline",style:{color:s.primary},children:"terms of service"}),"."]})]})]})})]})}var Io={avoid:{phase:"avoid",color:"#EF4444",bgColor:"#FEF2F2",label:"Avoid",icon:"\u{1F534}",description:"Period - avoid waxing"},caution:{phase:"caution",color:"#F59E0B",bgColor:"#FFFBEB",label:"Caution",icon:"\u{1F7E1}",description:"End of period - proceed with caution"},optimal:{phase:"optimal",color:"#10B981",bgColor:"#F0FDF4",label:"Optimal",icon:"\u{1F7E2}",description:"Best time for waxing"},neutral:{phase:"neutral",color:"#6B7280",bgColor:"#F9FAFB",label:"Neutral",icon:"\u26AA",description:"Okay but not optimal"},unknown:{phase:"unknown",color:"#9CA3AF",bgColor:"#F3F4F6",label:"Unknown",icon:"\u2753",description:"No cycle data available"}};function pi({availableDates:e,selectedDate:t,onDateSelect:r,settings:a,colors:o,fetchCycleData:i,selectedClient:n,onCycleWarning:s,cycleAwareEnabled:l}){let[c,d]=Ge.useState({}),[u,p]=Ge.useState(false),[g,b]=Ge.useState(null),v=Ge.useMemo(()=>l!==void 0?l:!!(n?.cycle_opt_in&&i),[l,n?.cycle_opt_in,i]);Ge.useEffect(()=>{if(!v||!i||!n){d({});return}e.length!==0&&(p(true),b(null),i(n,e).then(f=>{d(f);}).catch(f=>{console.error("[CycleAwareDateSelection] Error fetching cycle data:",f),b(f.message||"Failed to load cycle data"),d({});}).finally(()=>{p(false);}));},[v,i,n,e]);let w=Ge.useCallback(f=>{let x=c[f];x?.phase==="avoid"&&s&&s(x,f),r(f,x);},[c,r,s]);return jsxRuntime.jsxs("div",{className:"cycle-aware-date-selection space-y-4",children:[v&&Object.keys(c).length>0&&jsxRuntime.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-4",children:[jsxRuntime.jsxs("h4",{className:"font-medium mb-3 flex items-center",style:{color:o.primary},children:[jsxRuntime.jsx("span",{className:"mr-2",children:"\u{1F4C5}"}),"Your Cycle Calendar"]}),jsxRuntime.jsx("div",{className:"grid grid-cols-2 gap-3 text-sm",children:Object.entries(Io).map(([f,x])=>f!=="unknown"&&jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("div",{className:"w-3 h-3 rounded-full border border-gray-300",style:{backgroundColor:x.color}}),jsxRuntime.jsx("span",{children:x.label})]},f))}),jsxRuntime.jsx("p",{className:"text-xs opacity-70 mt-2",children:"Green dates are optimal for comfortable waxing appointments"})]}),v&&u&&jsxRuntime.jsx("div",{className:"text-center py-2 text-sm opacity-70",children:"Loading cycle predictions..."}),v&&g&&jsxRuntime.jsx("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-3",children:jsxRuntime.jsxs("p",{className:"text-yellow-800 text-sm",children:["Unable to load cycle predictions: ",g]})}),jsxRuntime.jsx(nr,{availableDates:e,selectedDate:t,onDateSelect:w,settings:a,colors:o}),v&&t&&c[t]?.phase==="avoid"&&jsxRuntime.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:jsxRuntime.jsxs("div",{className:"flex items-start space-x-3",children:[jsxRuntime.jsx("span",{className:"text-red-500 text-xl",children:"\u26A0\uFE0F"}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("h4",{className:"font-medium text-red-800 mb-1",children:"This date falls during your predicted period"}),jsxRuntime.jsx("p",{className:"text-red-700 text-sm mb-3",children:"Waxing during this time may be more uncomfortable than usual. Would you like to see better alternatives?"}),jsxRuntime.jsxs("div",{className:"flex space-x-2",children:[jsxRuntime.jsx("button",{className:"px-3 py-1 bg-red-100 text-red-700 rounded text-sm hover:bg-red-200 transition-colors",onClick:()=>{let f=e.filter(x=>c[x]?.phase==="optimal");f.length>0&&w(f[0]);},children:"Show optimal dates"}),jsxRuntime.jsx("button",{className:"px-3 py-1 text-red-600 text-sm hover:underline",children:"Continue anyway"})]})]})]})})]})}var gi={enabled:true,duration:6e5,warningThreshold:12e4,maxExtensions:2,extensionDuration:3e5,showActions:true,showWarning:true};function Rr({holdStatus:e,config:t,colors:r,onExtend:a,onRelease:o,onWarning:i,onExpired:n,className:s=""}){let[l,c]=Ge.useState(Date.now()),[d,u]=Ge.useState(false),[p,g]=Ge.useState(false),[b,v]=Ge.useState(false),w={...gi,...t};Ge.useEffect(()=>{if(!e)return;let F=setInterval(()=>{c(Date.now());},1e3);return ()=>clearInterval(F)},[e]);let f=e?Math.max(0,e.expiresAt-l):0,x=f===0&&e!==null,y=f<=w.warningThreshold&&f>0;Ge.useEffect(()=>{y&&!d&&i&&e&&(u(true),i(f));},[y,d,i,e,f]),Ge.useEffect(()=>{x&&e&&n&&n();},[x,e,n]),Ge.useEffect(()=>{u(false);},[e?.holdKey]);let N=Ge.useCallback(async()=>{if(!(!a||!e||p))try{g(!0),await a(),u(!1);}catch(F){console.error("[HoldTimer] Failed to extend hold:",F);}finally{g(false);}},[a,e,p]),C=Ge.useCallback(async()=>{if(!(!o||!e||b))try{v(!0),await o();}catch(F){console.error("[HoldTimer] Failed to release hold:",F);}finally{v(false);}},[o,e,b]);if(!e||!w.enabled)return null;let h=Math.floor(f/6e4),k=Math.floor(f%6e4/1e3),S=`${h}:${k.toString().padStart(2,"0")}`,I="rgba(139, 92, 246, 0.1)",R="rgba(139, 92, 246, 0.3)",m=r.primary;return x?(I="rgba(239, 68, 68, 0.1)",R="rgba(239, 68, 68, 0.3)",m="#EF4444"):y&&w.showWarning&&(I=`${r.secondary}1A`,R=`${r.secondary}4D`,m=r.secondary),jsxRuntime.jsx("div",{className:`rounded-lg p-4 text-center ${s}`,style:{backgroundColor:I,borderWidth:"1px",borderStyle:"solid",borderColor:R},children:jsxRuntime.jsxs("div",{className:"flex flex-col items-center justify-center",children:[jsxRuntime.jsx("div",{className:"flex flex-col items-center gap-2 mb-4",children:x?jsxRuntime.jsxs("div",{style:{color:m},className:"font-medium text-base",children:[jsxRuntime.jsx("span",{children:"Time expired - "}),jsxRuntime.jsx("button",{onClick:C,disabled:b,className:"underline hover:no-underline focus:outline-none focus:ring-2 focus:ring-offset-2 inline disabled:opacity-50",style:{color:m},children:b?"Releasing...":"select a new time"})]}):jsxRuntime.jsxs("div",{style:{color:m},className:"font-medium text-base",children:["Your time slot is reserved for ",S]})}),w.showActions&&!x&&jsxRuntime.jsxs("div",{className:"flex justify-center gap-2",children:[a&&e.canExtend&&jsxRuntime.jsxs("button",{onClick:N,disabled:!e.canExtend||p,className:"px-4 py-2 text-sm font-medium rounded transition-all active:scale-95 disabled:opacity-50 disabled:cursor-not-allowed text-white",style:{backgroundColor:r.primary},"aria-label":`Extend hold (${e.maxExtensions-e.extensions} extensions remaining)`,children:[p?"Extending...":"Extend",!p&&e.maxExtensions-e.extensions>0&&jsxRuntime.jsxs("span",{className:"ml-1",children:["(",e.maxExtensions-e.extensions,")"]})]}),o&&jsxRuntime.jsx("button",{onClick:C,disabled:b,className:"px-4 py-2 text-sm font-medium rounded border transition-all active:scale-95 disabled:opacity-50 disabled:cursor-not-allowed",style:{borderColor:"rgba(255, 255, 255, 0.2)",color:r.text||"#000000"},"aria-label":"Release hold and return to time selection",children:b?"Releasing...":"Release"})]}),!x&&!e.canExtend&&e.extensions>=e.maxExtensions&&jsxRuntime.jsx("div",{className:"mt-3 pt-3 border-t border-white/10 text-center",children:jsxRuntime.jsxs("div",{className:"text-sm",style:{color:r.secondary},children:["Maximum extensions reached - complete booking now or"," ",jsxRuntime.jsx("button",{onClick:C,disabled:b,className:"hover:underline focus:outline-none focus:underline disabled:opacity-50",style:{color:r.primary},children:b?"releasing...":"select a different time"})]})})]})})}function Ro({config:e,colors:t,services:r=[],categories:a=[],dates:o=[],times:i=[],addons:n=[],paymentProvider:s,paymentConfig:l,isPreview:c=false,onComplete:d,onStepChange:u,onServiceSelect:p,onDateSelect:g,onContactInfoChange:b,validateStep:v,holdTimer:w,stepOrder:f,optInModules:x=[],onOptInData:y,customPaymentForm:N,cyclePhases:C}){let[h,k]=Ge.useState(0),[S,I]=Ge.useState("forward"),[R,m]=Ge.useState(null),[F,M]=Ge.useState(null),[A,D]=Ge.useState(null),[T,P]=Ge.useState([]),[z,K]=Ge.useState({}),[Y,Te]=Ge.useState({}),[U,ie]=Ge.useState(null),Xe=t.bookingText||t.text||"#000000",ot=e.transitions||{},xe=ot.style||"slide",At=ot.speed||"normal",je=typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,fe=e.background||{type:"color",value:"#FFFFFF"},O={service:{id:"service",name:"Service",enabled:e.steps?.service_selection?.enabled!==false,settings:e.steps?.service_selection?.settings||{}},date:{id:"date",name:"Date",enabled:e.steps?.date_selection?.enabled!==false,settings:e.steps?.date_selection?.settings||{}},time:{id:"time",name:"Time",enabled:e.steps?.time_selection?.enabled!==false,settings:e.steps?.time_selection?.settings||{}},addons:{id:"addons",name:"Add-ons",enabled:e.steps?.addon_selection?.enabled===true,settings:e.steps?.addon_selection?.settings||{}},details:{id:"details",name:"Details",enabled:e.steps?.contact_form?.enabled!==false,settings:e.steps?.contact_form?.settings||{}},confirm:{id:"confirm",name:"Confirm",enabled:e.steps?.confirmation?.enabled===true,settings:e.steps?.confirmation?.settings||{}}},Ne=f||["service","date","time","addons","details","confirm"],J=Ne.map(E=>O[E]).filter(E=>E&&E.enabled);console.log("[BookingFlow] Step configuration:",{customStepOrder:f,orderedStepIds:Ne,allSteps:J.map(E=>E.id),currentStepIndex:h,currentStepId:J[h]?.id});let re=J[h],at=()=>fe.type==="gradient"?{background:fe.value}:fe.type==="image"?{backgroundImage:`url(${fe.value})`,backgroundSize:"cover",backgroundPosition:"center"}:{backgroundColor:fe.value},it=()=>{if(je)return .15;switch(At){case "fast":return .2;case "slow":return .5;default:return .3}},gr=()=>xe==="fade"?{enter:()=>({opacity:0,scale:.95}),center:{opacity:1,scale:1},exit:()=>({opacity:0,scale:.95})}:{enter:()=>({x:S==="forward"?50:-50,opacity:0}),center:{x:0,opacity:1},exit:()=>({x:S==="forward"?-50:50,opacity:0})},Kt=()=>{let E=re?.id;if(v)return v(E,{service:R,date:F,time:A,addons:T,contact:z});switch(E){case "service":return R!==null;case "date":return F!==null;case "time":return A!==null;case "details":if(c)return true;let W=z?.name&&z.name.trim().length>=2,_=z?.email&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(z.email),ye=z?.phone&&z.phone.replace(/\D/g,"").length>=10;return W&&_&&ye;default:return true}},$t=E=>E<h,Ce=E=>{I(E>h?"forward":"backward"),k(E),u&&u(E,J[E]?.id);},bt=()=>{h<J.length-1&&Ce(h+1);},Lt=async()=>{if(h===0)return;let E=h-1;if(J[E]?.id==="time"&&U&&w?.releaseHold)try{await w.releaseHold(U.holdId),ie(null),D(null);}catch(_){console.error("[BookingFlow] Failed to release hold:",_);}Ce(E);},fr=async E=>{if(D(E),w?.enabled&&w.createHold&&F&&R)try{let W=r.find(ye=>ye.id===R),_=await w.createHold({date:F,time:E,serviceId:R,serviceDuration:W?.duration||60});ie(_);}catch(W){console.error("[BookingFlow] Failed to create hold:",W);return}bt();},yr=()=>{ie(null),D(null);let E=J.findIndex(W=>W.id==="time");E>=0&&Ce(E);},Jt=async()=>{d&&d({service:R,date:F,time:A,addons:T,contact:z,optIn:Y});},Zr=()=>{if(!re)return null;let E={settings:re.settings,colors:t},W=r.find(_=>_.id===R);switch(re.id){case "service":return jsxRuntime.jsx(On,{...E,services:r,categories:a,selectedService:R,onServiceSelect:se=>{m(se),p&&p(se);}});case "date":return jsxRuntime.jsx(nr,{...E,availableDates:o,selectedDate:F,onDateSelect:se=>{M(se),g&&g(se);},cyclePhases:C,selectedService:W,addons:n,selectedAddons:T,onAddonsChange:P,addonPlacement:e.steps?.addon_selection?.settings?.placement||"date_selection"});case "time":return jsxRuntime.jsx(Hn,{...E,availableTimes:i,selectedTime:A,onTimeSelect:fr,serviceDuration:W?.duration||60,selectedService:W,selectedDate:F,selectedAddons:T,addons:n});case "addons":return jsxRuntime.jsx(Wn,{...E,addons:n,selectedAddons:T,onAddonsChange:P});case "details":return jsxRuntime.jsx(Vn,{...E,contactInfo:z,onContactInfoChange:se=>{K(se),b&&b(se);},optInModules:x,onOptInData:y});case "confirm":let _=n.filter(se=>T.includes(se.id)),ye=_.reduce((se,Pe)=>se+(Pe.addonPrice||Pe.price||0),0),br=(W?.price||0)+ye,hr=_.reduce((se,Pe)=>Pe.affectsDuration&&Pe.additionalDuration?se+Pe.additionalDuration:se,W?.duration||60);return N?jsxRuntime.jsx(N,{bookingData:{service:R,serviceName:W?.name,date:F,time:A,addons:T,contact:z,amount:W?.price||0,duration:hr,clientName:z?.name,clientEmail:z?.email,clientPhone:z?.phone,pendingBooking:{customerClientId:null,serviceId:R,date:F,time:A,notes:z?.notes||"",selectedAddons:_,addonServices:T,addonTotalCost:ye,totalAmount:br,duration:hr}},onPaymentSuccess:Jt,onPaymentError:Pe=>{console.error("[BookingFlow] Payment error:",Pe);}}):jsxRuntime.jsx(Yn,{...E,service:W,addons:_,selectedDate:F||"",selectedTime:A||"",paymentProvider:s||"square",paymentConfig:l||{depositPercentage:20},isPreview:c,onConfirm:Jt});default:return null}},st=()=>{let E=e.progressBar?.style||"dots";return E==="bar"?jsxRuntime.jsxs("div",{className:"mb-6",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-2",children:[jsxRuntime.jsxs("span",{className:"text-sm font-medium",children:["Step ",h+1," of ",J.length]}),jsxRuntime.jsx("span",{className:"text-xs opacity-60",children:re?.name})]}),jsxRuntime.jsx("div",{className:"w-full h-2 bg-gray-200 rounded-full overflow-hidden",children:jsxRuntime.jsx(framerMotion.motion.div,{className:"h-full rounded-full",style:{backgroundColor:t.primary},initial:{width:0},animate:{width:`${(h+1)/J.length*100}%`},transition:{duration:.3,ease:"easeOut"}})})]}):E==="minimal"?jsxRuntime.jsxs("div",{className:"mb-6 text-center",children:[jsxRuntime.jsx("p",{className:"text-sm font-medium",style:{color:t.primary},children:re?.name}),jsxRuntime.jsxs("p",{className:"text-xs opacity-60 mt-1",children:["Step ",h+1," of ",J.length]})]}):jsxRuntime.jsx("div",{className:"flex justify-center mb-4 overflow-x-auto py-2",children:jsxRuntime.jsx("div",{className:"flex items-center space-x-1.5 px-4 min-w-max",children:J.map((W,_)=>jsxRuntime.jsxs("div",{className:"flex items-center",children:[jsxRuntime.jsx(framerMotion.motion.div,{className:`w-6 h-6 rounded-full flex items-center justify-center font-medium text-xs transition-all flex-shrink-0 ${_===h?"text-white shadow-md":$t(_)?"text-white":"bg-gray-200 text-gray-500"}`,style:{backgroundColor:_<=h?t.primary:void 0},animate:{scale:_===h?1.05:1},transition:{duration:.2},children:$t(_)?"\u2713":_+1}),_<J.length-1&&jsxRuntime.jsx(framerMotion.motion.div,{className:`w-4 h-0.5 mx-1 transition-all flex-shrink-0 ${_<h?"":"bg-gray-200"}`,style:{backgroundColor:_<h?t.primary:void 0},initial:{scaleX:0},animate:{scaleX:1},transition:{duration:.3,delay:.1}})]},W.id))})})};return jsxRuntime.jsxs("div",{className:"w-full max-w-4xl mx-auto p-6 rounded-2xl shadow-xl",style:{...at(),color:Xe},children:[st(),w?.enabled&&U&&re?.id!=="time"&&jsxRuntime.jsx(Rr,{holdStatus:U,config:w.config,colors:t,onExtend:async()=>{if(w.extendHold&&U)try{let E=await w.extendHold(U.holdId);ie(E);}catch(E){console.error("[BookingFlow] Failed to extend hold:",E);}},onRelease:async()=>{if(w.releaseHold&&U)try{await w.releaseHold(U.holdId),ie(null),D(null);let E=J.findIndex(W=>W.id==="time");E>=0&&Ce(E);}catch(E){console.error("[BookingFlow] Failed to release hold:",E);}},onExpired:yr,className:"mb-6"}),jsxRuntime.jsx("div",{className:"mb-6 min-h-[300px] relative overflow-hidden",children:jsxRuntime.jsx(framerMotion.AnimatePresence,{mode:"wait",custom:S,children:jsxRuntime.jsx(framerMotion.motion.div,{custom:S,variants:gr(),initial:"enter",animate:"center",exit:"exit",transition:{duration:it(),ease:[.4,0,.2,1]},children:Zr()},h)})}),!(re?.id==="confirm"&&N)&&jsxRuntime.jsxs("div",{className:"flex items-center justify-between pt-4 border-t border-gray-200",children:[jsxRuntime.jsx("button",{onClick:Lt,disabled:h===0,className:"px-4 py-2 rounded-lg border border-gray-300 disabled:opacity-30 disabled:cursor-not-allowed hover:bg-gray-50 transition-all text-sm font-medium",children:"Back"}),h<J.length-1?jsxRuntime.jsx("button",{onClick:bt,disabled:!Kt(),className:"px-6 py-2 rounded-lg text-white disabled:opacity-50 disabled:cursor-not-allowed hover:opacity-90 transition-all text-sm font-medium shadow-md",style:{backgroundColor:t.primary},children:"Next"}):jsxRuntime.jsx("button",{onClick:Jt,disabled:!Kt(),className:"px-6 py-2 rounded-lg text-white disabled:opacity-50 disabled:cursor-not-allowed hover:opacity-90 transition-all text-sm font-medium shadow-md",style:{backgroundColor:t.primary},children:re?.id==="confirm"?"Pay & Confirm":"Complete"})]})]})}function yi({section:e,theme:t,BookingFlowComponent:r,config:a,enableInlineEditing:o=false}){let{type:i,settings:n}=e,s=e.id;i==="video_section"&&console.log("\u{1F3AC} Rendering video_section:",{type:i,settings:n,sectionId:s});let l=t?.colors||{primary:"#BCB4FF",secondary:"#CAC426",text:"#000000"},c=t?.typography||{headingFont:"Geist Sans",bodyFont:"Inter",bodySize:"16px"};switch(i){case "logo":return jsxRuntime.jsx(tn,{logoUrl:n.logoUrl,fallbackText:n.fallbackText,size:n.size,alignment:n.alignment,colors:l,enableInlineEditing:o,sectionId:s});case "header":return jsxRuntime.jsx(nn,{name:n.name,title:n.title,bio:n.bio,showName:n.showName,showTitle:n.showTitle,showBio:n.showBio,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "featured_link":return jsxRuntime.jsx(on,{text:n.text,url:n.url,style:n.style,size:n.size,colors:l,enableInlineEditing:o,sectionId:s});case "link_list":return jsxRuntime.jsx(sn,{links:n.links||[],style:n.style,colors:l,enableInlineEditing:o,sectionId:s});case "social_bar":return jsxRuntime.jsx(ln,{platforms:n.platforms||[],socialLinks:n.socialLinks,style:n.style,size:n.size,position:n.position,invertIcons:n.invertIcons,colors:l,enableInlineEditing:o,sectionId:s});case "instagram_feed":return jsxRuntime.jsx(Fn,{username:n.username,colors:l,enableInlineEditing:o,sectionId:s});case "minimal_header":return jsxRuntime.jsx(bn,{brandName:n.brandName,logoUrl:n.logoUrl,style:n.style,alignment:n.alignment,sticky:n.sticky,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "minimal_navigation":return jsxRuntime.jsx(xn,{links:n.links||[],style:n.style,colors:l,enableInlineEditing:o,sectionId:s});case "feature_content":return jsxRuntime.jsx(wn,{headline:n.headline,description:n.description,image:n.image,buttonText:n.buttonText,buttonUrl:n.buttonUrl,showButton:n.showButton,layout:n.layout,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "minimal_footer":return jsxRuntime.jsx(vn,{alignment:n.alignment,showSocial:n.showSocial,showContact:n.showContact,showLinks:n.showLinks,footerText:n.footerText,colors:l,enableInlineEditing:o,sectionId:s});case "hero":return jsxRuntime.jsx(cn,{headline:n.headline,subheadline:n.subheadline,heroImage:n.heroImage,ctaButton:n.ctaButton,layout:n.layout,imagePosition:n.imagePosition,contentDisplay:n.contentDisplay,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "about":return jsxRuntime.jsx(dn,{title:n.title,content:n.content,image:n.image,layout:n.layout,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "services_preview":return jsxRuntime.jsx(un,{title:n.title,services:n.services,layout:n.layout,columns:n.columns,showPrices:n.showPrices,showDuration:n.showDuration,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "gallery":return jsxRuntime.jsx(mn,{title:n.title,images:n.images||[],columns:n.columns,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "testimonials":return jsxRuntime.jsx(gn,{title:n.title,testimonials:n.testimonials,layout:n.layout,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "team":return jsxRuntime.jsx(fn,{title:n.title,members:n.members,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "contact":return jsxRuntime.jsx(yn,{title:n.title,showForm:n.showForm,email:n.email,phone:n.phone,address:n.address,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "before_after":return jsxRuntime.jsx(Cn,{title:n.title,comparisons:n.comparisons,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "pricing_table":return jsxRuntime.jsx(Sn,{title:n.title,plans:n.plans,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "booking":return jsxRuntime.jsx(En,{config:a||{},colors:l,BookingFlowComponent:r,enableInlineEditing:o,sectionId:s});case "fixed_info_card":return jsxRuntime.jsx(In,{name:n.name,subheading:n.subheading,bio:n.bio,links:n.links||[],bookingButtonText:n.bookingButtonText,bookingButtonUrl:n.bookingButtonUrl,showBookingButton:n.showBookingButton,position:n.position,cardWidth:n.cardWidth,cardColor:n.cardColor,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "video_section":return jsxRuntime.jsx(Rn,{videoUrl:n.videoUrl,aspectRatio:n.aspectRatio,autoplay:n.autoplay,loop:n.loop,muted:n.muted,controls:n.controls,allowFullScreen:n.allowFullScreen,coverImage:n.coverImage,maxWidth:n.maxWidth,alignment:n.alignment,borderRadius:n.borderRadius,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "scrolling_text_divider":return jsxRuntime.jsx(Pn,{text:n.text,scrollDirection:n.scrollDirection,scrollSpeed:n.scrollSpeed,orientation:n.orientation,dividerIcon:n.dividerIcon,customIcon:n.customIcon,textSize:n.textSize,textColor:n.textColor,fontWeight:n.fontWeight,backgroundColor:n.backgroundColor,backgroundGradient:n.backgroundGradient,pauseOnHover:n.pauseOnHover,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "location_map":return jsxRuntime.jsx(An,{address:n.address,displayType:n.displayType,mapHeight:n.mapHeight,mapStyle:n.mapStyle,zoom:n.zoom,showMarker:n.showMarker,borderRadius:n.borderRadius,directionsButtonText:n.directionsButtonText,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "image_section":return jsxRuntime.jsx(Mn,{imageUrl:n.imageUrl,altText:n.altText,caption:n.caption,maxWidth:n.maxWidth,alignment:n.alignment,aspectRatio:n.aspectRatio,borderRadius:n.borderRadius,linkUrl:n.linkUrl,openInNewTab:n.openInNewTab,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "faq_section":return jsxRuntime.jsx($n,{title:n.title,faqs:n.faqs,layout:n.layout,maxWidth:n.maxWidth,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "navbar":return jsxRuntime.jsx(Bn,{brandName:n.brandName,logoUrl:n.logoUrl,showLogo:n.showLogo,showBrandName:n.showBrandName,links:n.links,ctaText:n.ctaText,ctaUrl:n.ctaUrl,sticky:n.sticky,transparentOnTop:n.transparentOnTop,colors:l,typography:c,enableInlineEditing:o,sectionId:s});case "text_section":return jsxRuntime.jsx(zn,{title:n.title,content:n.content,alignment:n.alignment,maxWidth:n.maxWidth,textSize:n.textSize,backgroundColor:n.backgroundColor,textColor:n.textColor,paddingY:n.paddingY,colors:l,typography:c,enableInlineEditing:o,sectionId:s});default:return jsxRuntime.jsx("div",{className:"container mx-auto px-4 py-16",children:jsxRuntime.jsx("div",{className:"max-w-4xl mx-auto p-8 rounded-lg border-2 border-dashed text-center",style:{borderColor:l.primary,opacity:.5},children:jsxRuntime.jsxs("p",{className:"text-lg",style:{color:l.text},children:["Unknown section type: ",i]})})})}}var Xn=null;function xi(){if(!Xn){let e=undefined.VITE_SUPABASE_URL||process.env.NEXT_PUBLIC_SUPABASE_URL,t=undefined.VITE_SUPABASE_ANON_KEY||process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY;if(!e||!t)throw new Error("Supabase URL and Anon Key must be provided");Xn=supabaseJs.createClient(e,t);}return Xn}var nt={bucket:"form-uploads",limits:{maxSize:5*1024*1024,allowedTypes:["image/jpeg","image/png","image/webp","image/jpg"]}};async function To(e,t,r){if(console.log("\u{1F4E6} uploadFormImage called:",{fileName:e.name,clientId:t,formId:r}),e.size>nt.limits.maxSize)throw new Error(`File size exceeds maximum of ${nt.limits.maxSize/1024/1024}MB`);if(!nt.limits.allowedTypes.includes(e.type))throw new Error(`File type ${e.type} not allowed. Accepted types: JPG, PNG, WebP`);console.log("\u{1F3A8} Starting image optimization...");let a=await vi(e);console.log("\u2705 Image optimized:",{originalSize:e.size,optimizedSize:a.size});let o=Date.now();e.name.split(".").pop()?.toLowerCase()||"jpg";let n=e.name.replace(/[^a-zA-Z0-9.-]/g,"_").substring(0,50),s=`${o}_${n}`,l=`${t}/${r}/${s}`;console.log("\u2601\uFE0F Uploading to Supabase:",{filePath:l,bucket:nt.bucket});let c=xi(),{data:d,error:u}=await c.storage.from(nt.bucket).upload(l,a,{cacheControl:"3600",upsert:false,contentType:a.type});if(console.log("\u{1F4E4} Upload result:",{data:d,error:u}),u)throw console.error("\u274C Supabase upload error:",u),new Error(`Upload failed: ${u.message}`);console.log("\u2705 Upload successful, getting public URL...");let{data:{publicUrl:p}}=c.storage.from(nt.bucket).getPublicUrl(l);return console.log("\u2705 Public URL obtained:",p),{url:p,path:l,filename:e.name,size:a.size,type:a.type}}async function vi(e,t=1920,r=.85){console.log("\u{1F5BC}\uFE0F optimizeImage: Starting optimization");let a=e.type==="image/png"||e.type==="image/webp",o=a?e.type:"image/jpeg";return console.log("\u{1F5BC}\uFE0F optimizeImage: Output type:",o,"Transparency:",a),new Promise((i,n)=>{let s=setTimeout(()=>{console.error("\u23F1\uFE0F optimizeImage: Timeout after 30 seconds"),n(new Error("Image optimization timed out"));},3e4),l=new Image,c=document.createElement("canvas"),d=c.getContext("2d",{alpha:a});if(!d){clearTimeout(s),console.error("\u274C optimizeImage: Canvas context not available"),n(new Error("Canvas context not available"));return}console.log("\u{1F5BC}\uFE0F optimizeImage: Created canvas and context"),l.onload=()=>{console.log("\u{1F5BC}\uFE0F optimizeImage: Image loaded",{width:l.width,height:l.height});try{let u=Math.min(t/l.width,1);c.width=l.width*u,c.height=l.height*u,console.log("\u{1F5BC}\uFE0F optimizeImage: Resizing to",{width:c.width,height:c.height}),a&&d.clearRect(0,0,c.width,c.height),d.drawImage(l,0,0,c.width,c.height),console.log("\u{1F5BC}\uFE0F optimizeImage: Image drawn, converting to blob..."),c.toBlob(p=>{if(clearTimeout(s),!p){console.error("\u274C optimizeImage: Blob conversion failed"),n(new Error("Image optimization failed"));return}console.log("\u2705 optimizeImage: Blob created",{size:p.size,type:o});let g=new File([p],e.name,{type:o,lastModified:Date.now()});console.log("\u2705 optimizeImage: Optimization complete"),i(g);},o,r);}catch(u){clearTimeout(s),console.error("\u274C optimizeImage: Error during processing",u),n(u);}},l.onerror=u=>{clearTimeout(s),console.error("\u274C optimizeImage: Failed to load image",u),n(new Error("Failed to load image"));},console.log("\u{1F5BC}\uFE0F optimizeImage: Creating object URL and loading image..."),l.src=URL.createObjectURL(e);})}function Po(e){return e.size>nt.limits.maxSize?{valid:false,error:`File size exceeds maximum of ${nt.limits.maxSize/1024/1024}MB`}:nt.limits.allowedTypes.includes(e.type)?{valid:true}:{valid:false,error:"File type not allowed. Accepted: JPG, PNG, WebP"}}function Pr({field:e,value:t,error:r,onChange:a,businessId:o,formId:i,styling:n}){let s=Ge.useRef(null),[l,c]=Ge.useState(false),[d,u]=Ge.useState(null),p=n?.labelColor||"#374151",g=n?.fieldStyle||"outlined",v=(()=>{let f="w-full px-4 py-2 transition-all focus:outline-none";if(r)return `${f} bg-red-50 border border-red-300 rounded-lg focus:ring-2 focus:ring-red-500`;switch(g){case "filled":return `${f} bg-gray-100 border border-transparent rounded-lg focus:bg-white focus:ring-2 focus:ring-gray-900 focus:border-transparent`;case "underlined":return `${f} bg-transparent border-0 border-b-2 border-gray-300 rounded-none focus:border-gray-900 focus:ring-0 px-0`;case "minimal":return `${f} bg-transparent border border-gray-200 rounded-lg focus:border-gray-400 focus:ring-1 focus:ring-gray-300`;case "outlined":default:return `${f} bg-white border-2 border-gray-300 rounded-lg focus:border-gray-900 focus:ring-2 focus:ring-gray-900`}})(),w="block text-sm font-medium mb-1";if(e.type==="text"||e.type==="email"||e.type==="tel")return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:e.id,className:w,style:{color:p},children:[e.label,e.required&&jsxRuntime.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),jsxRuntime.jsx("input",{type:e.type,id:e.id,name:e.id,value:t||"",onChange:f=>a(f.target.value),placeholder:e.placeholder,required:e.required,className:v,style:{color:p}}),r&&jsxRuntime.jsx("p",{className:"mt-1 text-xs text-red-600",children:r})]});if(e.type==="textarea")return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:e.id,className:w,style:{color:p},children:[e.label,e.required&&jsxRuntime.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),jsxRuntime.jsx("textarea",{id:e.id,name:e.id,value:t||"",onChange:f=>a(f.target.value),placeholder:e.placeholder,required:e.required,rows:4,className:v,style:{color:p}}),r&&jsxRuntime.jsx("p",{className:"mt-1 text-xs text-red-600",children:r})]});if(e.type==="date")return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:e.id,className:w,style:{color:p},children:[e.label,e.required&&jsxRuntime.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),jsxRuntime.jsx("input",{type:"date",id:e.id,name:e.id,value:t||"",onChange:f=>a(f.target.value),required:e.required,className:v,style:{color:p}}),r&&jsxRuntime.jsx("p",{className:"mt-1 text-xs text-red-600",children:r})]});if(e.type==="select"&&e.options)return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:e.id,className:w,style:{color:p},children:[e.label,e.required&&jsxRuntime.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),jsxRuntime.jsxs("select",{id:e.id,name:e.id,value:t||"",onChange:f=>a(f.target.value),required:e.required,className:v,style:{color:p},children:[jsxRuntime.jsx("option",{value:"",children:"Select an option..."}),e.options.map(f=>jsxRuntime.jsx("option",{value:f.value,children:f.label},f.value))]}),r&&jsxRuntime.jsx("p",{className:"mt-1 text-xs text-red-600",children:r})]});if(e.type==="radio"&&e.options)return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{className:w,style:{color:p},children:[e.label,e.required&&jsxRuntime.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),jsxRuntime.jsx("div",{className:"space-y-2 mt-2",children:e.options.map(f=>jsxRuntime.jsxs("label",{className:"flex items-center space-x-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"radio",name:e.id,value:f.value,checked:t===f.value,onChange:x=>a(x.target.value),required:e.required,className:"w-4 h-4 text-gray-900 focus:ring-gray-900 focus:ring-2"}),jsxRuntime.jsx("span",{className:"text-sm",style:{color:n?.labelColor||"#000000"},children:f.label})]},f.value))}),r&&jsxRuntime.jsx("p",{className:"mt-1 text-xs text-red-600",children:r})]});if(e.type==="checkbox"&&e.options){let f=Array.isArray(t)?t:[],x=y=>{let N=f.includes(y)?f.filter(C=>C!==y):[...f,y];a(N);};return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{className:w,style:{color:p},children:[e.label,e.required&&jsxRuntime.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),jsxRuntime.jsx("div",{className:"space-y-2 mt-2",children:e.options.map(y=>jsxRuntime.jsxs("label",{className:"flex items-center space-x-2 cursor-pointer",children:[jsxRuntime.jsx("input",{type:"checkbox",name:`${e.id}[]`,value:y.value,checked:f.includes(y.value),onChange:()=>x(y.value),className:"w-4 h-4 text-gray-900 focus:ring-gray-900 focus:ring-2 rounded"}),jsxRuntime.jsx("span",{className:"text-sm",style:{color:n?.labelColor||"#000000"},children:y.label})]},y.value))}),r&&jsxRuntime.jsx("p",{className:"mt-1 text-xs text-red-600",children:r})]})}if(e.type==="photo"){let f=async x=>{let y=x.target.files?.[0];if(!y)return;u(null);let N=Po(y);if(!N.valid){u(N.error||"Invalid file"),s.current&&(s.current.value="");return}if(!o||!i){u("Missing required configuration for file upload"),s.current&&(s.current.value="");return}c(true);try{let C=await To(y,o,i);a({url:C.url,filename:C.filename,size:C.size,type:C.type,uploadedAt:new Date().toISOString()}),u(null);}catch(C){console.error("Photo upload error:",C),u(C instanceof Error?C.message:"Upload failed"),s.current&&(s.current.value="");}finally{c(false);}};return jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("label",{htmlFor:e.id,className:w,style:{color:p},children:[e.label,e.required&&jsxRuntime.jsx("span",{className:"text-red-500 ml-1",children:"*"})]}),jsxRuntime.jsxs("div",{className:"mt-1",children:[jsxRuntime.jsx("input",{ref:s,type:"file",id:e.id,name:e.id,accept:"image/*",onChange:f,required:e.required,disabled:l,className:`block w-full text-sm text-gray-500
11
11
  file:mr-4 file:py-2 file:px-4
12
12
  file:rounded-lg file:border-0
13
13
  file:text-sm file:font-medium
14
14
  file:bg-gray-900 file:text-white
15
15
  hover:file:bg-gray-800
16
16
  file:cursor-pointer cursor-pointer
17
- disabled:opacity-50 disabled:cursor-not-allowed`}),l&&jsxRuntime.jsxs("div",{className:"mt-2 flex items-center gap-2 text-xs text-blue-600",children:[jsxRuntime.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-2 border-blue-600 border-t-transparent"}),jsxRuntime.jsx("span",{children:"Uploading..."})]}),t&&!l&&jsxRuntime.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[jsxRuntime.jsx("svg",{className:"w-4 h-4 text-green-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),jsxRuntime.jsxs("span",{className:"text-xs text-gray-600",children:[t.filename," (",Math.round(t.size/1024),"KB)"]})]})]}),jsxRuntime.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Max file size: 5MB \u2022 JPG, PNG, WebP"}),d&&jsxRuntime.jsx("p",{className:"mt-1 text-xs text-red-600",children:d}),r&&jsxRuntime.jsx("p",{className:"mt-1 text-xs text-red-600",children:r})]})}if(e.type==="image"){let g=e,v=g.imageUrl;if(!v)return null;let f=g.imageSize||"medium",C=f==="full",S={small:"200px",medium:"400px",large:"600px"},x=C?"none":S[f]||S.medium,F={none:"0",sm:"0.25rem",md:"0.375rem",lg:"0.5rem",full:"9999px"},k=F[g.borderRadius]||F.md,I=C?"":{left:"mr-auto",center:"mx-auto",right:"ml-auto"}[g.imageAlignment||"center"],y={maxWidth:x,...C&&{width:"100%"}};return jsxRuntime.jsx("div",{className:I,style:y,children:jsxRuntime.jsx("img",{src:v,alt:e.label||"",className:"w-full h-auto",style:{borderRadius:k}})})}return null}function Lo(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Ge.useMemo(()=>a=>{t.forEach(o=>o(a));},t)}var ar=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ft(e){let t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Mr(e){return "nodeType"in e}function he(e){var t,r;return e?Ft(e)?e:Mr(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function $r(e){let{Document:t}=he(e);return e instanceof t}function _t(e){return Ft(e)?false:e instanceof he(e).HTMLElement}function Qn(e){return e instanceof he(e).SVGElement}function Dt(e){return e?Ft(e)?e.document:Mr(e)?$r(e)?e:_t(e)||Qn(e)?e.ownerDocument:document:document:document}var Be=ar?Ge.useLayoutEffect:Ge.useEffect;function Lr(e){let t=Ge.useRef(e);return Be(()=>{t.current=e;}),Ge.useCallback(function(){for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return t.current==null?void 0:t.current(...a)},[])}function Bo(){let e=Ge.useRef(null),t=Ge.useCallback((a,o)=>{e.current=setInterval(a,o);},[]),r=Ge.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null);},[]);return [t,r]}function qt(e,t){t===void 0&&(t=[e]);let r=Ge.useRef(e);return Be(()=>{r.current!==e&&(r.current=e);},t),r}function Vt(e,t){let r=Ge.useRef();return Ge.useMemo(()=>{let a=e(r.current);return r.current=a,a},[...t])}function ir(e){let t=Lr(e),r=Ge.useRef(null),a=Ge.useCallback(o=>{o!==r.current&&t?.(o,r.current),r.current=o;},[]);return [r,a]}function Br(e){let t=Ge.useRef();return Ge.useEffect(()=>{t.current=e;},[e]),t.current}var Kn={};function It(e,t){return Ge.useMemo(()=>{if(t)return t;let r=Kn[e]==null?0:Kn[e]+1;return Kn[e]=r,e+"-"+r},[e,t])}function zo(e){return function(t){for(var r=arguments.length,a=new Array(r>1?r-1:0),o=1;o<r;o++)a[o-1]=arguments[o];return a.reduce((i,n)=>{let s=Object.entries(n);for(let[l,c]of s){let d=i[l];d!=null&&(i[l]=d+e*c);}return i},{...t})}}var Et=zo(1),Yt=zo(-1);function wi(e){return "clientX"in e&&"clientY"in e}function sr(e){if(!e)return false;let{KeyboardEvent:t}=he(e.target);return t&&e instanceof t}function Ni(e){if(!e)return false;let{TouchEvent:t}=he(e.target);return t&&e instanceof t}function zr(e){if(Ni(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:r}=e.touches[0];return {x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:r}=e.changedTouches[0];return {x:t,y:r}}}return wi(e)?{x:e.clientX,y:e.clientY}:null}var ft=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:r}=e;return "translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:r}=e;return "scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return [ft.Translate.toString(e),ft.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:a}=e;return t+" "+r+"ms "+a}}}),Mo="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Oo(e){return e.matches(Mo)?e:e.querySelector(Mo)}var ki={display:"none"};function Uo(e){let{id:t,value:r}=e;return Ge__default.default.createElement("div",{id:t,style:ki},r)}function Wo(e){let{id:t,announcement:r,ariaLiveType:a="assertive"}=e,o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return Ge__default.default.createElement("div",{id:t,style:o,role:"status","aria-live":a,"aria-atomic":true},r)}function jo(){let[e,t]=Ge.useState("");return {announce:Ge.useCallback(a=>{a!=null&&t(a);},[]),announcement:e}}var ta=Ge.createContext(null);function Ei(e){let t=Ge.useContext(ta);Ge.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t]);}function Ri(){let[e]=Ge.useState(()=>new Set),t=Ge.useCallback(a=>(e.add(a),()=>e.delete(a)),[e]);return [Ge.useCallback(a=>{let{type:o,event:i}=a;e.forEach(n=>{var s;return (s=n[o])==null?void 0:s.call(n,i)});},[e]),t]}var Ti={draggable:`
17
+ disabled:opacity-50 disabled:cursor-not-allowed`}),l&&jsxRuntime.jsxs("div",{className:"mt-2 flex items-center gap-2 text-xs text-blue-600",children:[jsxRuntime.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-2 border-blue-600 border-t-transparent"}),jsxRuntime.jsx("span",{children:"Uploading..."})]}),t&&!l&&jsxRuntime.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[jsxRuntime.jsx("svg",{className:"w-4 h-4 text-green-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),jsxRuntime.jsxs("span",{className:"text-xs text-gray-600",children:[t.filename," (",Math.round(t.size/1024),"KB)"]})]})]}),jsxRuntime.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Max file size: 5MB \u2022 JPG, PNG, WebP"}),d&&jsxRuntime.jsx("p",{className:"mt-1 text-xs text-red-600",children:d}),r&&jsxRuntime.jsx("p",{className:"mt-1 text-xs text-red-600",children:r})]})}if(e.type==="image"){let f=e,x=f.imageUrl;if(!x)return null;let y=f.imageSize||"medium",N=y==="full",C={small:"200px",medium:"400px",large:"600px"},h=N?"none":C[y]||C.medium,k={none:"0",sm:"0.25rem",md:"0.375rem",lg:"0.5rem",full:"9999px"},S=k[f.borderRadius]||k.md,I=N?"":{left:"mr-auto",center:"mx-auto",right:"ml-auto"}[f.imageAlignment||"center"],R={maxWidth:h,...N&&{width:"100%"}};return jsxRuntime.jsx("div",{className:I,style:R,children:jsxRuntime.jsx("img",{src:x,alt:e.label||"",className:"w-full h-auto",style:{borderRadius:S}})})}return null}function Lo(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Ge.useMemo(()=>a=>{t.forEach(o=>o(a));},t)}var ar=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ft(e){let t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Mr(e){return "nodeType"in e}function he(e){var t,r;return e?Ft(e)?e:Mr(e)&&(t=(r=e.ownerDocument)==null?void 0:r.defaultView)!=null?t:window:window}function $r(e){let{Document:t}=he(e);return e instanceof t}function _t(e){return Ft(e)?false:e instanceof he(e).HTMLElement}function Qn(e){return e instanceof he(e).SVGElement}function Dt(e){return e?Ft(e)?e.document:Mr(e)?$r(e)?e:_t(e)||Qn(e)?e.ownerDocument:document:document:document}var Be=ar?Ge.useLayoutEffect:Ge.useEffect;function Lr(e){let t=Ge.useRef(e);return Be(()=>{t.current=e;}),Ge.useCallback(function(){for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return t.current==null?void 0:t.current(...a)},[])}function Bo(){let e=Ge.useRef(null),t=Ge.useCallback((a,o)=>{e.current=setInterval(a,o);},[]),r=Ge.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null);},[]);return [t,r]}function qt(e,t){t===void 0&&(t=[e]);let r=Ge.useRef(e);return Be(()=>{r.current!==e&&(r.current=e);},t),r}function Vt(e,t){let r=Ge.useRef();return Ge.useMemo(()=>{let a=e(r.current);return r.current=a,a},[...t])}function ir(e){let t=Lr(e),r=Ge.useRef(null),a=Ge.useCallback(o=>{o!==r.current&&t?.(o,r.current),r.current=o;},[]);return [r,a]}function Br(e){let t=Ge.useRef();return Ge.useEffect(()=>{t.current=e;},[e]),t.current}var Kn={};function It(e,t){return Ge.useMemo(()=>{if(t)return t;let r=Kn[e]==null?0:Kn[e]+1;return Kn[e]=r,e+"-"+r},[e,t])}function zo(e){return function(t){for(var r=arguments.length,a=new Array(r>1?r-1:0),o=1;o<r;o++)a[o-1]=arguments[o];return a.reduce((i,n)=>{let s=Object.entries(n);for(let[l,c]of s){let d=i[l];d!=null&&(i[l]=d+e*c);}return i},{...t})}}var Et=zo(1),Yt=zo(-1);function Ci(e){return "clientX"in e&&"clientY"in e}function sr(e){if(!e)return false;let{KeyboardEvent:t}=he(e.target);return t&&e instanceof t}function Si(e){if(!e)return false;let{TouchEvent:t}=he(e.target);return t&&e instanceof t}function zr(e){if(Si(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:r}=e.touches[0];return {x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:r}=e.changedTouches[0];return {x:t,y:r}}}return Ci(e)?{x:e.clientX,y:e.clientY}:null}var ft=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:r}=e;return "translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:r}=e;return "scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return [ft.Translate.toString(e),ft.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:a}=e;return t+" "+r+"ms "+a}}}),Mo="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Oo(e){return e.matches(Mo)?e:e.querySelector(Mo)}var Di={display:"none"};function Uo(e){let{id:t,value:r}=e;return Ge__default.default.createElement("div",{id:t,style:Di},r)}function Wo(e){let{id:t,announcement:r,ariaLiveType:a="assertive"}=e,o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return Ge__default.default.createElement("div",{id:t,style:o,role:"status","aria-live":a,"aria-atomic":true},r)}function jo(){let[e,t]=Ge.useState("");return {announce:Ge.useCallback(a=>{a!=null&&t(a);},[]),announcement:e}}var ta=Ge.createContext(null);function Ti(e){let t=Ge.useContext(ta);Ge.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t]);}function Pi(){let[e]=Ge.useState(()=>new Set),t=Ge.useCallback(a=>(e.add(a),()=>e.delete(a)),[e]);return [Ge.useCallback(a=>{let{type:o,event:i}=a;e.forEach(n=>{var s;return (s=n[o])==null?void 0:s.call(n,i)});},[e]),t]}var Ai={draggable:`
18
18
  To pick up a draggable item, press the space bar.
19
19
  While dragging, use the arrow keys to move the item.
20
20
  Press space again to drop the item in its new position, or press escape to cancel.
21
- `},Pi={onDragStart(e){let{active:t}=e;return "Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return "Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Ai(e){let{announcements:t=Pi,container:r,hiddenTextDescribedById:a,screenReaderInstructions:o=Ti}=e,{announce:i,announcement:n}=jo(),s=It("DndLiveRegion"),[l,c]=Ge.useState(false);if(Ge.useEffect(()=>{c(true);},[]),Ei(Ge.useMemo(()=>({onDragStart(u){let{active:m}=u;i(t.onDragStart({active:m}));},onDragMove(u){let{active:m,over:p}=u;t.onDragMove&&i(t.onDragMove({active:m,over:p}));},onDragOver(u){let{active:m,over:p}=u;i(t.onDragOver({active:m,over:p}));},onDragEnd(u){let{active:m,over:p}=u;i(t.onDragEnd({active:m,over:p}));},onDragCancel(u){let{active:m,over:p}=u;i(t.onDragCancel({active:m,over:p}));}}),[i,t])),!l)return null;let d=Ge__default.default.createElement(Ge__default.default.Fragment,null,Ge__default.default.createElement(Uo,{id:a,value:o.draggable}),Ge__default.default.createElement(Wo,{id:s,announcement:n}));return r?reactDom.createPortal(d,r):d}var oe;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable";})(oe||(oe={}));function Ur(){}function ra(e,t){return Ge.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function na(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Ge.useMemo(()=>[...t].filter(a=>a!=null),[...t])}var We=Object.freeze({x:0,y:0});function Mi(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function $i(e,t){let{data:{value:r}}=e,{data:{value:a}}=t;return r-a}function Li(e,t){let{data:{value:r}}=e,{data:{value:a}}=t;return a-r}function oa(e,t){if(!e||e.length===0)return null;let[r]=e;return r[t]}function _o(e,t,r){return t===void 0&&(t=e.left),r===void 0&&(r=e.top),{x:t+e.width*.5,y:r+e.height*.5}}var aa=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:a}=e,o=_o(t,t.left,t.top),i=[];for(let n of a){let{id:s}=n,l=r.get(s);if(l){let c=Mi(_o(l),o);i.push({id:s,data:{droppableContainer:n,value:c}});}}return i.sort($i)};function Bi(e,t){let r=Math.max(t.top,e.top),a=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),n=o-a,s=i-r;if(a<o&&r<i){let l=t.width*t.height,c=e.width*e.height,d=n*s,u=d/(l+c-d);return Number(u.toFixed(4))}return 0}var zi=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:a}=e,o=[];for(let i of a){let{id:n}=i,s=r.get(n);if(s){let l=Bi(s,t);l>0&&o.push({id:n,data:{droppableContainer:i,value:l}});}}return o.sort(Li)};function Oi(e,t,r){return {...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function ia(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:We}function Hi(e){return function(r){for(var a=arguments.length,o=new Array(a>1?a-1:0),i=1;i<a;i++)o[i-1]=arguments[i];return o.reduce((n,s)=>({...n,top:n.top+e*s.y,bottom:n.bottom+e*s.y,left:n.left+e*s.x,right:n.right+e*s.x}),{...r})}}var Ui=Hi(1);function Wi(e){if(e.startsWith("matrix3d(")){let t=e.slice(9,-1).split(/, /);return {x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){let t=e.slice(7,-1).split(/, /);return {x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function ji(e,t,r){let a=Wi(t);if(!a)return e;let{scaleX:o,scaleY:i,x:n,y:s}=a,l=e.left-n-(1-o)*parseFloat(r),c=e.top-s-(1-i)*parseFloat(r.slice(r.indexOf(" ")+1)),d=o?e.width/o:e.width,u=i?e.height/i:e.height;return {width:d,height:u,top:c,right:l+d,bottom:c+u,left:l}}var _i={ignoreTransform:false};function Pt(e,t){t===void 0&&(t=_i);let r=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:c,transformOrigin:d}=he(e).getComputedStyle(e);c&&(r=ji(r,c,d));}let{top:a,left:o,width:i,height:n,bottom:s,right:l}=r;return {top:a,left:o,width:i,height:n,bottom:s,right:l}}function qo(e){return Pt(e,{ignoreTransform:true})}function qi(e){let t=e.innerWidth,r=e.innerHeight;return {top:0,left:0,right:t,bottom:r,width:t,height:r}}function Vi(e,t){return t===void 0&&(t=he(e).getComputedStyle(e)),t.position==="fixed"}function Yi(e,t){t===void 0&&(t=he(e).getComputedStyle(e));let r=/(auto|scroll|overlay)/;return ["overflow","overflowX","overflowY"].some(o=>{let i=t[o];return typeof i=="string"?r.test(i):false})}function _r(e,t){let r=[];function a(o){if(t!=null&&r.length>=t||!o)return r;if($r(o)&&o.scrollingElement!=null&&!r.includes(o.scrollingElement))return r.push(o.scrollingElement),r;if(!_t(o)||Qn(o)||r.includes(o))return r;let i=he(e).getComputedStyle(o);return o!==e&&Yi(o,i)&&r.push(o),Vi(o,i)?r:a(o.parentNode)}return e?a(e):r}function sa(e){let[t]=_r(e,1);return t??null}function Zn(e){return !ar||!e?null:Ft(e)?e:Mr(e)?$r(e)||e===Dt(e).scrollingElement?window:_t(e)?e:null:null}function la(e){return Ft(e)?e.scrollX:e.scrollLeft}function ca(e){return Ft(e)?e.scrollY:e.scrollTop}function ro(e){return {x:la(e),y:ca(e)}}var ce;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward";})(ce||(ce={}));function da(e){return !ar||!e?false:e===document.scrollingElement}function ua(e){let t={x:0,y:0},r=da(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},a={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},o=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,n=e.scrollTop>=a.y,s=e.scrollLeft>=a.x;return {isTop:o,isLeft:i,isBottom:n,isRight:s,maxScroll:a,minScroll:t}}var Gi={x:.2,y:.2};function Xi(e,t,r,a,o){let{top:i,left:n,right:s,bottom:l}=r;a===void 0&&(a=10),o===void 0&&(o=Gi);let{isTop:c,isBottom:d,isLeft:u,isRight:m}=ua(e),p={x:0,y:0},b={x:0,y:0},w={height:t.height*o.y,width:t.width*o.x};return !c&&i<=t.top+w.height?(p.y=ce.Backward,b.y=a*Math.abs((t.top+w.height-i)/w.height)):!d&&l>=t.bottom-w.height&&(p.y=ce.Forward,b.y=a*Math.abs((t.bottom-w.height-l)/w.height)),!m&&s>=t.right-w.width?(p.x=ce.Forward,b.x=a*Math.abs((t.right-w.width-s)/w.width)):!u&&n<=t.left+w.width&&(p.x=ce.Backward,b.x=a*Math.abs((t.left+w.width-n)/w.width)),{direction:p,speed:b}}function Ki(e){if(e===document.scrollingElement){let{innerWidth:i,innerHeight:n}=window;return {top:0,left:0,right:i,bottom:n,width:i,height:n}}let{top:t,left:r,right:a,bottom:o}=e.getBoundingClientRect();return {top:t,left:r,right:a,bottom:o,width:e.clientWidth,height:e.clientHeight}}function ma(e){return e.reduce((t,r)=>Et(t,ro(r)),We)}function Ji(e){return e.reduce((t,r)=>t+la(r),0)}function Qi(e){return e.reduce((t,r)=>t+ca(r),0)}function Zi(e,t){if(t===void 0&&(t=Pt),!e)return;let{top:r,left:a,bottom:o,right:i}=t(e);sa(e)&&(o<=0||i<=0||r>=window.innerHeight||a>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"});}var es=[["x",["left","right"],Ji],["y",["top","bottom"],Qi]],cr=class{constructor(t,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let a=_r(r),o=ma(a);this.rect={...t},this.width=t.width,this.height=t.height;for(let[i,n,s]of es)for(let l of n)Object.defineProperty(this,l,{get:()=>{let c=s(a),d=o[i]-c;return this.rect[l]+d},enumerable:true});Object.defineProperty(this,"rect",{enumerable:false});}},Rt=class{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var a;return (a=this.target)==null?void 0:a.removeEventListener(...r)});},this.target=t;}add(t,r,a){var o;(o=this.target)==null||o.addEventListener(t,r,a),this.listeners.push([t,r,a]);}};function ts(e){let{EventTarget:t}=he(e);return e instanceof t?e:Dt(e)}function eo(e,t){let r=Math.abs(e.x),a=Math.abs(e.y);return typeof t=="number"?Math.sqrt(r**2+a**2)>t:"x"in t&&"y"in t?r>t.x&&a>t.y:"x"in t?r>t.x:"y"in t?a>t.y:false}var ze;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange";})(ze||(ze={}));function Vo(e){e.preventDefault();}function rs(e){e.stopPropagation();}var $;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab";})($||($={}));var pa={start:[$.Space,$.Enter],cancel:[$.Esc],end:[$.Space,$.Enter,$.Tab]},ns=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case $.Right:return {...r,x:r.x+25};case $.Left:return {...r,x:r.x-25};case $.Down:return {...r,y:r.y+25};case $.Up:return {...r,y:r.y-25}}},Wr=class{constructor(t){this.props=void 0,this.autoScrollEnabled=false,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;let{event:{target:r}}=t;this.props=t,this.listeners=new Rt(Dt(r)),this.windowListeners=new Rt(he(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach();}attach(){this.handleStart(),this.windowListeners.add(ze.Resize,this.handleCancel),this.windowListeners.add(ze.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(ze.Keydown,this.handleKeyDown));}handleStart(){let{activeNode:t,onStart:r}=this.props,a=t.node.current;a&&Zi(a),r(We);}handleKeyDown(t){if(sr(t)){let{active:r,context:a,options:o}=this.props,{keyboardCodes:i=pa,coordinateGetter:n=ns,scrollBehavior:s="smooth"}=o,{code:l}=t;if(i.end.includes(l)){this.handleEnd(t);return}if(i.cancel.includes(l)){this.handleCancel(t);return}let{collisionRect:c}=a.current,d=c?{x:c.left,y:c.top}:We;this.referenceCoordinates||(this.referenceCoordinates=d);let u=n(t,{active:r,context:a.current,currentCoordinates:d});if(u){let m=Yt(u,d),p={x:0,y:0},{scrollableAncestors:b}=a.current;for(let w of b){let N=t.code,{isTop:g,isRight:v,isLeft:f,isBottom:C,maxScroll:S,minScroll:x}=ua(w),F=Ki(w),k={x:Math.min(N===$.Right?F.right-F.width/2:F.right,Math.max(N===$.Right?F.left:F.left+F.width/2,u.x)),y:Math.min(N===$.Down?F.bottom-F.height/2:F.bottom,Math.max(N===$.Down?F.top:F.top+F.height/2,u.y))},I=N===$.Right&&!v||N===$.Left&&!f,y=N===$.Down&&!C||N===$.Up&&!g;if(I&&k.x!==u.x){let h=w.scrollLeft+m.x,E=N===$.Right&&h<=S.x||N===$.Left&&h>=x.x;if(E&&!m.y){w.scrollTo({left:h,behavior:s});return}E?p.x=w.scrollLeft-h:p.x=N===$.Right?w.scrollLeft-S.x:w.scrollLeft-x.x,p.x&&w.scrollBy({left:-p.x,behavior:s});break}else if(y&&k.y!==u.y){let h=w.scrollTop+m.y,E=N===$.Down&&h<=S.y||N===$.Up&&h>=x.y;if(E&&!m.x){w.scrollTo({top:h,behavior:s});return}E?p.y=w.scrollTop-h:p.y=N===$.Down?w.scrollTop-S.y:w.scrollTop-x.y,p.y&&w.scrollBy({top:-p.y,behavior:s});break}}this.handleMove(t,Et(Yt(u,this.referenceCoordinates),p));}}}handleMove(t,r){let{onMove:a}=this.props;t.preventDefault(),a(r);}handleEnd(t){let{onEnd:r}=this.props;t.preventDefault(),this.detach(),r();}handleCancel(t){let{onCancel:r}=this.props;t.preventDefault(),this.detach(),r();}detach(){this.listeners.removeAll(),this.windowListeners.removeAll();}};Wr.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:a=pa,onActivation:o}=t,{active:i}=r,{code:n}=e.nativeEvent;if(a.start.includes(n)){let s=i.activatorNode.current;return s&&e.target!==s?false:(e.preventDefault(),o?.({event:e.nativeEvent}),true)}return false}}];function Yo(e){return !!(e&&"distance"in e)}function Go(e){return !!(e&&"delay"in e)}var dr=class{constructor(t,r,a){var o;a===void 0&&(a=ts(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=true,this.document=void 0,this.activated=false,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=r;let{event:i}=t,{target:n}=i;this.props=t,this.events=r,this.document=Dt(n),this.documentListeners=new Rt(this.document),this.listeners=new Rt(a),this.windowListeners=new Rt(he(n)),this.initialCoordinates=(o=zr(i))!=null?o:We,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach();}attach(){let{events:t,props:{options:{activationConstraint:r,bypassActivationConstraint:a}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:false}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(ze.Resize,this.handleCancel),this.windowListeners.add(ze.DragStart,Vo),this.windowListeners.add(ze.VisibilityChange,this.handleCancel),this.windowListeners.add(ze.ContextMenu,Vo),this.documentListeners.add(ze.Keydown,this.handleKeydown),r){if(a!=null&&a({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Go(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(Yo(r)){this.handlePending(r);return}}this.handleStart();}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null);}handlePending(t,r){let{active:a,onPending:o}=this.props;o(a,t,this.initialCoordinates,r);}handleStart(){let{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=true,this.documentListeners.add(ze.Click,rs,{capture:true}),this.removeTextSelection(),this.documentListeners.add(ze.SelectionChange,this.removeTextSelection),r(t));}handleMove(t){var r;let{activated:a,initialCoordinates:o,props:i}=this,{onMove:n,options:{activationConstraint:s}}=i;if(!o)return;let l=(r=zr(t))!=null?r:We,c=Yt(o,l);if(!a&&s){if(Yo(s)){if(s.tolerance!=null&&eo(c,s.tolerance))return this.handleCancel();if(eo(c,s.distance))return this.handleStart()}if(Go(s)&&eo(c,s.tolerance))return this.handleCancel();this.handlePending(s,c);return}t.cancelable&&t.preventDefault(),n(l);}handleEnd(){let{onAbort:t,onEnd:r}=this.props;this.detach(),this.activated||t(this.props.active),r();}handleCancel(){let{onAbort:t,onCancel:r}=this.props;this.detach(),this.activated||t(this.props.active),r();}handleKeydown(t){t.code===$.Esc&&this.handleCancel();}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges();}},os={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}},Xt=class extends dr{constructor(t){let{event:r}=t,a=Dt(r.target);super(t,os,a);}};Xt.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:a}=t;return !r.isPrimary||r.button!==0?false:(a?.({event:r}),true)}}];var as={move:{name:"mousemove"},end:{name:"mouseup"}},no;(function(e){e[e.RightClick=2]="RightClick";})(no||(no={}));var oo=class extends dr{constructor(t){super(t,as,Dt(t.event.target));}};oo.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:a}=t;return r.button===no.RightClick?false:(a?.({event:r}),true)}}];var to={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}},ao=class extends dr{constructor(t){super(t,to);}static setup(){return window.addEventListener(to.move.name,t,{capture:false,passive:false}),function(){window.removeEventListener(to.move.name,t);};function t(){}}};ao.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:a}=t,{touches:o}=r;return o.length>1?false:(a?.({event:r}),true)}}];var lr;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect";})(lr||(lr={}));var jr;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder";})(jr||(jr={}));function is(e){let{acceleration:t,activator:r=lr.Pointer,canScroll:a,draggingRect:o,enabled:i,interval:n=5,order:s=jr.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:d,delta:u,threshold:m}=e,p=ls({delta:u,disabled:!i}),[b,w]=Bo(),N=Ge.useRef({x:0,y:0}),g=Ge.useRef({x:0,y:0}),v=Ge.useMemo(()=>{switch(r){case lr.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case lr.DraggableRect:return o}},[r,o,l]),f=Ge.useRef(null),C=Ge.useCallback(()=>{let x=f.current;if(!x)return;let F=N.current.x*g.current.x,k=N.current.y*g.current.y;x.scrollBy(F,k);},[]),S=Ge.useMemo(()=>s===jr.TreeOrder?[...c].reverse():c,[s,c]);Ge.useEffect(()=>{if(!i||!c.length||!v){w();return}for(let x of S){if(a?.(x)===false)continue;let F=c.indexOf(x),k=d[F];if(!k)continue;let{direction:I,speed:y}=Xi(x,k,v,t,m);for(let h of ["x","y"])p[h][I[h]]||(y[h]=0,I[h]=0);if(y.x>0||y.y>0){w(),f.current=x,b(C,n),N.current=y,g.current=I;return}}N.current={x:0,y:0},g.current={x:0,y:0},w();},[t,C,a,w,i,n,JSON.stringify(v),JSON.stringify(p),b,c,S,d,JSON.stringify(m)]);}var ss={x:{[ce.Backward]:false,[ce.Forward]:false},y:{[ce.Backward]:false,[ce.Forward]:false}};function ls(e){let{delta:t,disabled:r}=e,a=Br(t);return Vt(o=>{if(r||!a||!o)return ss;let i={x:Math.sign(t.x-a.x),y:Math.sign(t.y-a.y)};return {x:{[ce.Backward]:o.x[ce.Backward]||i.x===-1,[ce.Forward]:o.x[ce.Forward]||i.x===1},y:{[ce.Backward]:o.y[ce.Backward]||i.y===-1,[ce.Forward]:o.y[ce.Forward]||i.y===1}}},[r,t,a])}function cs(e,t){let r=t!=null?e.get(t):void 0,a=r?r.node.current:null;return Vt(o=>{var i;return t==null?null:(i=a??o)!=null?i:null},[a,t])}function ds(e,t){return Ge.useMemo(()=>e.reduce((r,a)=>{let{sensor:o}=a,i=o.activators.map(n=>({eventName:n.eventName,handler:t(n.handler,a)}));return [...r,...i]},[]),[e,t])}var ur;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging";})(ur||(ur={}));var io;(function(e){e.Optimized="optimized";})(io||(io={}));var Xo=new Map;function us(e,t){let{dragging:r,dependencies:a,config:o}=t,[i,n]=Ge.useState(null),{frequency:s,measure:l,strategy:c}=o,d=Ge.useRef(e),u=N(),m=qt(u),p=Ge.useCallback(function(g){g===void 0&&(g=[]),!m.current&&n(v=>v===null?g:v.concat(g.filter(f=>!v.includes(f))));},[m]),b=Ge.useRef(null),w=Vt(g=>{if(u&&!r)return Xo;if(!g||g===Xo||d.current!==e||i!=null){let v=new Map;for(let f of e){if(!f)continue;if(i&&i.length>0&&!i.includes(f.id)&&f.rect.current){v.set(f.id,f.rect.current);continue}let C=f.node.current,S=C?new cr(l(C),C):null;f.rect.current=S,S&&v.set(f.id,S);}return v}return g},[e,i,r,u,l]);return Ge.useEffect(()=>{d.current=e;},[e]),Ge.useEffect(()=>{u||p();},[r,u]),Ge.useEffect(()=>{i&&i.length>0&&n(null);},[JSON.stringify(i)]),Ge.useEffect(()=>{u||typeof s!="number"||b.current!==null||(b.current=setTimeout(()=>{p(),b.current=null;},s));},[s,u,p,...a]),{droppableRects:w,measureDroppableContainers:p,measuringScheduled:i!=null};function N(){switch(c){case ur.Always:return false;case ur.BeforeDragging:return r;default:return !r}}}function ga(e,t){return Vt(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function ms(e,t){return ga(e,t)}function ps(e){let{callback:t,disabled:r}=e,a=Lr(t),o=Ge.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;let{MutationObserver:i}=window;return new i(a)},[a,r]);return Ge.useEffect(()=>()=>o?.disconnect(),[o]),o}function qr(e){let{callback:t,disabled:r}=e,a=Lr(t),o=Ge.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;let{ResizeObserver:i}=window;return new i(a)},[r]);return Ge.useEffect(()=>()=>o?.disconnect(),[o]),o}function gs(e){return new cr(Pt(e),e)}function Ko(e,t,r){t===void 0&&(t=gs);let[a,o]=Ge.useState(null);function i(){o(l=>{if(!e)return null;if(e.isConnected===false){var c;return (c=l??r)!=null?c:null}let d=t(e);return JSON.stringify(l)===JSON.stringify(d)?l:d});}let n=ps({callback(l){if(e)for(let c of l){let{type:d,target:u}=c;if(d==="childList"&&u instanceof HTMLElement&&u.contains(e)){i();break}}}}),s=qr({callback:i});return Be(()=>{i(),e?(s?.observe(e),n?.observe(document.body,{childList:true,subtree:true})):(s?.disconnect(),n?.disconnect());},[e]),a}function fs(e){let t=ga(e);return ia(e,t)}var Jo=[];function ys(e){let t=Ge.useRef(e),r=Vt(a=>e?a&&a!==Jo&&e&&t.current&&e.parentNode===t.current.parentNode?a:_r(e):Jo,[e]);return Ge.useEffect(()=>{t.current=e;},[e]),r}function bs(e){let[t,r]=Ge.useState(null),a=Ge.useRef(e),o=Ge.useCallback(i=>{let n=Zn(i.target);n&&r(s=>s?(s.set(n,ro(n)),new Map(s)):null);},[]);return Ge.useEffect(()=>{let i=a.current;if(e!==i){n(i);let s=e.map(l=>{let c=Zn(l);return c?(c.addEventListener("scroll",o,{passive:true}),[c,ro(c)]):null}).filter(l=>l!=null);r(s.length?new Map(s):null),a.current=e;}return ()=>{n(e),n(i);};function n(s){s.forEach(l=>{let c=Zn(l);c?.removeEventListener("scroll",o);});}},[o,e]),Ge.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,n)=>Et(i,n),We):ma(e):We,[e,t])}function Qo(e,t){t===void 0&&(t=[]);let r=Ge.useRef(null);return Ge.useEffect(()=>{r.current=null;},t),Ge.useEffect(()=>{let a=e!==We;a&&!r.current&&(r.current=e),!a&&r.current&&(r.current=null);},[e]),r.current?Yt(e,r.current):We}function hs(e){Ge.useEffect(()=>{if(!ar)return;let t=e.map(r=>{let{sensor:a}=r;return a.setup==null?void 0:a.setup()});return ()=>{for(let r of t)r?.();}},e.map(t=>{let{sensor:r}=t;return r}));}function xs(e,t){return Ge.useMemo(()=>e.reduce((r,a)=>{let{eventName:o,handler:i}=a;return r[o]=n=>{i(n,t);},r},{}),[e,t])}function fa(e){return Ge.useMemo(()=>e?qi(e):null,[e])}var Zo=[];function vs(e,t){t===void 0&&(t=Pt);let[r]=e,a=fa(r?he(r):null),[o,i]=Ge.useState(Zo);function n(){i(()=>e.length?e.map(l=>da(l)?a:new cr(t(l),l)):Zo);}let s=qr({callback:n});return Be(()=>{s?.disconnect(),n(),e.forEach(l=>s?.observe(l));},[e]),o}function ws(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return _t(t)?t:e}function Ns(e){let{measure:t}=e,[r,a]=Ge.useState(null),o=Ge.useCallback(c=>{for(let{target:d}of c)if(_t(d)){a(u=>{let m=t(d);return u?{...u,width:m.width,height:m.height}:m});break}},[t]),i=qr({callback:o}),n=Ge.useCallback(c=>{let d=ws(c);i?.disconnect(),d&&i?.observe(d),a(d?t(d):null);},[t,i]),[s,l]=ir(n);return Ge.useMemo(()=>({nodeRef:s,rect:r,setRef:l}),[r,s,l])}var Cs=[{sensor:Xt,options:{}},{sensor:Wr,options:{}}],Ss={current:{}},Hr={draggable:{measure:qo},droppable:{measure:qo,strategy:ur.WhileDragging,frequency:io.Optimized},dragOverlay:{measure:Pt}},Tt=class extends Map{get(t){var r;return t!=null&&(r=super.get(t))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:r}=t;return !r})}getNodeFor(t){var r,a;return (r=(a=this.get(t))==null?void 0:a.node.current)!=null?r:void 0}},ks={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Tt,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ur},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Hr,measureDroppableContainers:Ur,windowRect:null,measuringScheduled:false},Fs={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ur,draggableNodes:new Map,over:null,measureDroppableContainers:Ur},Vr=Ge.createContext(Fs),ya=Ge.createContext(ks);function Ds(){return {draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Tt}}}function Is(e,t){switch(t.type){case oe.DragStart:return {...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case oe.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case oe.DragEnd:case oe.DragCancel:return {...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case oe.RegisterDroppable:{let{element:r}=t,{id:a}=r,o=new Tt(e.droppable.containers);return o.set(a,r),{...e,droppable:{...e.droppable,containers:o}}}case oe.SetDroppableDisabled:{let{id:r,key:a,disabled:o}=t,i=e.droppable.containers.get(r);if(!i||a!==i.key)return e;let n=new Tt(e.droppable.containers);return n.set(r,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:n}}}case oe.UnregisterDroppable:{let{id:r,key:a}=t,o=e.droppable.containers.get(r);if(!o||a!==o.key)return e;let i=new Tt(e.droppable.containers);return i.delete(r),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function Es(e){let{disabled:t}=e,{active:r,activatorEvent:a,draggableNodes:o}=Ge.useContext(Vr),i=Br(a),n=Br(r?.id);return Ge.useEffect(()=>{if(!t&&!a&&i&&n!=null){if(!sr(i)||document.activeElement===i.target)return;let s=o.get(n);if(!s)return;let{activatorNode:l,node:c}=s;if(!l.current&&!c.current)return;requestAnimationFrame(()=>{for(let d of [l.current,c.current]){if(!d)continue;let u=Oo(d);if(u){u.focus();break}}});}},[a,t,o,n,i]),null}function Rs(e,t){let{transform:r,...a}=t;return e!=null&&e.length?e.reduce((o,i)=>i({transform:o,...a}),r):r}function Ts(e){return Ge.useMemo(()=>({draggable:{...Hr.draggable,...e?.draggable},droppable:{...Hr.droppable,...e?.droppable},dragOverlay:{...Hr.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function Ps(e){let{activeNode:t,measure:r,initialRect:a,config:o=true}=e,i=Ge.useRef(false),{x:n,y:s}=typeof o=="boolean"?{x:o,y:o}:o;Be(()=>{if(!n&&!s||!t){i.current=false;return}if(i.current||!a)return;let c=t?.node.current;if(!c||c.isConnected===false)return;let d=r(c),u=ia(d,a);if(n||(u.x=0),s||(u.y=0),i.current=true,Math.abs(u.x)>0||Math.abs(u.y)>0){let m=sa(c);m&&m.scrollBy({top:u.y,left:u.x});}},[t,n,s,a,r]);}var ba=Ge.createContext({...We,scaleX:1,scaleY:1}),yt;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized";})(yt||(yt={}));var ha=Ge.memo(function(t){var r,a,o,i;let{id:n,accessibility:s,autoScroll:l=true,children:c,sensors:d=Cs,collisionDetection:u=zi,measuring:m,modifiers:p,...b}=t,w=Ge.useReducer(Is,void 0,Ds),[N,g]=w,[v,f]=Ri(),[C,S]=Ge.useState(yt.Uninitialized),x=C===yt.Initialized,{draggable:{active:F,nodes:k,translate:I},droppable:{containers:y}}=N,h=F!=null?k.get(F):null,E=Ge.useRef({initial:null,translated:null}),W=Ge.useMemo(()=>{var pe;return F!=null?{id:F,data:(pe=h?.data)!=null?pe:Ss,rect:E}:null},[F,h]),O=Ge.useRef(null),[D,T]=Ge.useState(null),[P,L]=Ge.useState(null),K=qt(b,Object.values(b)),Y=It("DndDescribedBy",n),Te=Ge.useMemo(()=>y.getEnabled(),[y]),H=Ts(m),{droppableRects:ie,measureDroppableContainers:Xe,measuringScheduled:ot}=us(Te,{dragging:x,dependencies:[I.x,I.y],config:H.droppable}),xe=cs(k,F),At=Ge.useMemo(()=>P?zr(P):null,[P]),je=La(),fe=ms(xe,H.draggable.measure);Ps({activeNode:F!=null?k.get(F):null,config:je.layoutShiftCompensation,initialRect:fe,measure:H.draggable.measure});let B=Ko(xe,H.draggable.measure,fe),Mt=Ko(xe?xe.parentElement:null),Ne=Ge.useRef({activatorEvent:null,active:null,activeNode:xe,collisionRect:null,collisions:null,droppableRects:ie,draggableNodes:k,draggingNode:null,draggingNodeRect:null,droppableContainers:y,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),J=y.getNodeFor((r=Ne.current.over)==null?void 0:r.id),re=Ns({measure:H.dragOverlay.measure}),at=(a=re.nodeRef.current)!=null?a:xe,it=x?(o=re.rect)!=null?o:B:null,gr=!!(re.nodeRef.current&&re.rect),Kt=fs(gr?null:B),$t=fa(at?he(at):null),Ce=ys(x?J??xe:null),bt=vs(Ce),Lt=Rs(p,{transform:{x:I.x-Kt.x,y:I.y-Kt.y,scaleX:1,scaleY:1},activatorEvent:P,active:W,activeNodeRect:B,containerNodeRect:Mt,draggingNodeRect:it,over:Ne.current.over,overlayNodeRect:re.rect,scrollableAncestors:Ce,scrollableAncestorRects:bt,windowRect:$t}),fr=At?Et(At,I):null,yr=bs(Ce),Jt=Qo(yr),Zr=Qo(yr,[B]),st=Et(Lt,Jt),R=it?Ui(it,Lt):null,U=W&&R?u({active:W,collisionRect:R,droppableRects:ie,droppableContainers:Te,pointerCoordinates:fr}):null,_=oa(U,"id"),[ye,br]=Ge.useState(null),hr=gr?Lt:Et(Lt,Zr),se=Oi(hr,(i=ye?.rect)!=null?i:null,B),Pe=Ge.useRef(null),uo=Ge.useCallback((pe,Se)=>{let{sensor:ke,options:lt}=Se;if(O.current==null)return;let Ae=k.get(O.current);if(!Ae)return;let Fe=pe.nativeEvent,_e=new ke({active:O.current,activeNode:Ae,event:Fe,options:lt,context:Ne,onAbort(de){if(!k.get(de))return;let{onDragAbort:qe}=K.current,Ke={id:de};qe?.(Ke),v({type:"onDragAbort",event:Ke});},onPending(de,ct,qe,Ke){if(!k.get(de))return;let{onDragPending:Zt}=K.current,dt={id:de,constraint:ct,initialCoordinates:qe,offset:Ke};Zt?.(dt),v({type:"onDragPending",event:dt});},onStart(de){let ct=O.current;if(ct==null)return;let qe=k.get(ct);if(!qe)return;let{onDragStart:Ke}=K.current,Qt={activatorEvent:Fe,active:{id:ct,data:qe.data,rect:E}};reactDom.unstable_batchedUpdates(()=>{Ke?.(Qt),S(yt.Initializing),g({type:oe.DragStart,initialCoordinates:de,active:ct}),v({type:"onDragStart",event:Qt}),T(Pe.current),L(Fe);});},onMove(de){g({type:oe.DragMove,coordinates:de});},onEnd:Bt(oe.DragEnd),onCancel:Bt(oe.DragCancel)});Pe.current=_e;function Bt(de){return async function(){let{active:qe,collisions:Ke,over:Qt,scrollAdjustedTranslate:Zt}=Ne.current,dt=null;if(qe&&Zt){let{cancelDrop:er}=K.current;dt={activatorEvent:Fe,active:qe,collisions:Ke,delta:Zt,over:Qt},de===oe.DragEnd&&typeof er=="function"&&await Promise.resolve(er(dt))&&(de=oe.DragCancel);}O.current=null,reactDom.unstable_batchedUpdates(()=>{g({type:de}),S(yt.Uninitialized),br(null),T(null),L(null),Pe.current=null;let er=de===oe.DragEnd?"onDragEnd":"onDragCancel";if(dt){let en=K.current[er];en?.(dt),v({type:er,event:dt});}});}}},[k]),Aa=Ge.useCallback((pe,Se)=>(ke,lt)=>{let Ae=ke.nativeEvent,Fe=k.get(lt);if(O.current!==null||!Fe||Ae.dndKit||Ae.defaultPrevented)return;let _e={active:Fe};pe(ke,Se.options,_e)===true&&(Ae.dndKit={capturedBy:Se.sensor},O.current=lt,uo(ke,Se));},[k,uo]),mo=ds(d,Aa);hs(d),Be(()=>{B&&C===yt.Initializing&&S(yt.Initialized);},[B,C]),Ge.useEffect(()=>{let{onDragMove:pe}=K.current,{active:Se,activatorEvent:ke,collisions:lt,over:Ae}=Ne.current;if(!Se||!ke)return;let Fe={active:Se,activatorEvent:ke,collisions:lt,delta:{x:st.x,y:st.y},over:Ae};reactDom.unstable_batchedUpdates(()=>{pe?.(Fe),v({type:"onDragMove",event:Fe});});},[st.x,st.y]),Ge.useEffect(()=>{let{active:pe,activatorEvent:Se,collisions:ke,droppableContainers:lt,scrollAdjustedTranslate:Ae}=Ne.current;if(!pe||O.current==null||!Se||!Ae)return;let{onDragOver:Fe}=K.current,_e=lt.get(_),Bt=_e&&_e.rect.current?{id:_e.id,rect:_e.rect.current,data:_e.data,disabled:_e.disabled}:null,de={active:pe,activatorEvent:Se,collisions:ke,delta:{x:Ae.x,y:Ae.y},over:Bt};reactDom.unstable_batchedUpdates(()=>{br(Bt),Fe?.(de),v({type:"onDragOver",event:de});});},[_]),Be(()=>{Ne.current={activatorEvent:P,active:W,activeNode:xe,collisionRect:R,collisions:U,droppableRects:ie,draggableNodes:k,draggingNode:at,draggingNodeRect:it,droppableContainers:y,over:ye,scrollableAncestors:Ce,scrollAdjustedTranslate:st},E.current={initial:it,translated:R};},[W,xe,U,R,k,at,it,ie,y,ye,Ce,st]),is({...je,delta:I,draggingRect:R,pointerCoordinates:fr,scrollableAncestors:Ce,scrollableAncestorRects:bt});let Ma=Ge.useMemo(()=>({active:W,activeNode:xe,activeNodeRect:B,activatorEvent:P,collisions:U,containerNodeRect:Mt,dragOverlay:re,draggableNodes:k,droppableContainers:y,droppableRects:ie,over:ye,measureDroppableContainers:Xe,scrollableAncestors:Ce,scrollableAncestorRects:bt,measuringConfiguration:H,measuringScheduled:ot,windowRect:$t}),[W,xe,B,P,U,Mt,re,k,y,ie,ye,Xe,Ce,bt,H,ot,$t]),$a=Ge.useMemo(()=>({activatorEvent:P,activators:mo,active:W,activeNodeRect:B,ariaDescribedById:{draggable:Y},dispatch:g,draggableNodes:k,over:ye,measureDroppableContainers:Xe}),[P,mo,W,B,g,Y,k,ye,Xe]);return Ge__default.default.createElement(ta.Provider,{value:f},Ge__default.default.createElement(Vr.Provider,{value:$a},Ge__default.default.createElement(ya.Provider,{value:Ma},Ge__default.default.createElement(ba.Provider,{value:se},c)),Ge__default.default.createElement(Es,{disabled:s?.restoreFocus===false})),Ge__default.default.createElement(Ai,{...s,hiddenTextDescribedById:Y}));function La(){let pe=D?.autoScrollEnabled===false,Se=typeof l=="object"?l.enabled===false:l===false,ke=x&&!pe&&!Se;return typeof l=="object"?{...l,enabled:ke}:{enabled:ke}}}),As=Ge.createContext(null),ea="button",Ms="Draggable";function xa(e){let{id:t,data:r,disabled:a=false,attributes:o}=e,i=It(Ms),{activators:n,activatorEvent:s,active:l,activeNodeRect:c,ariaDescribedById:d,draggableNodes:u,over:m}=Ge.useContext(Vr),{role:p=ea,roleDescription:b="draggable",tabIndex:w=0}=o??{},N=l?.id===t,g=Ge.useContext(N?ba:As),[v,f]=ir(),[C,S]=ir(),x=xs(n,t),F=qt(r);Be(()=>(u.set(t,{id:t,key:i,node:v,activatorNode:C,data:F}),()=>{let I=u.get(t);I&&I.key===i&&u.delete(t);}),[u,t]);let k=Ge.useMemo(()=>({role:p,tabIndex:w,"aria-disabled":a,"aria-pressed":N&&p===ea?true:void 0,"aria-roledescription":b,"aria-describedby":d.draggable}),[a,p,w,N,b,d.draggable]);return {active:l,activatorEvent:s,activeNodeRect:c,attributes:k,isDragging:N,listeners:a?void 0:x,node:v,over:m,setNodeRef:f,setActivatorNodeRef:S,transform:g}}function va(){return Ge.useContext(ya)}var $s="Droppable",Ls={timeout:25};function wa(e){let{data:t,disabled:r=false,id:a,resizeObserverConfig:o}=e,i=It($s),{active:n,dispatch:s,over:l,measureDroppableContainers:c}=Ge.useContext(Vr),d=Ge.useRef({disabled:r}),u=Ge.useRef(false),m=Ge.useRef(null),p=Ge.useRef(null),{disabled:b,updateMeasurementsFor:w,timeout:N}={...Ls,...o},g=qt(w??a),v=Ge.useCallback(()=>{if(!u.current){u.current=true;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{c(Array.isArray(g.current)?g.current:[g.current]),p.current=null;},N);},[N]),f=qr({callback:v,disabled:b||!n}),C=Ge.useCallback((k,I)=>{f&&(I&&(f.unobserve(I),u.current=false),k&&f.observe(k));},[f]),[S,x]=ir(C),F=qt(t);return Ge.useEffect(()=>{!f||!S.current||(f.disconnect(),u.current=false,f.observe(S.current));},[S,f]),Ge.useEffect(()=>(s({type:oe.RegisterDroppable,element:{id:a,key:i,disabled:r,node:S,rect:m,data:F}}),()=>s({type:oe.UnregisterDroppable,key:i,id:a})),[a]),Ge.useEffect(()=>{r!==d.current.disabled&&(s({type:oe.SetDroppableDisabled,id:a,key:i,disabled:r}),d.current.disabled=r);},[a,i,r,s]),{active:n,rect:m,isOver:l?.id===a,node:S,over:l,setNodeRef:x}}function Ca(e,t,r){let a=e.slice();return a.splice(r<0?a.length+r:r,0,a.splice(t,1)[0]),a}function Os(e,t){return e.reduce((r,a,o)=>{let i=t.get(a);return i&&(r[o]=i),r},Array(e.length))}function Yr(e){return e!==null&&e>=0}function Hs(e,t){if(e===t)return true;if(e.length!==t.length)return false;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return false;return true}function Us(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}var Sa=e=>{let{rects:t,activeIndex:r,overIndex:a,index:o}=e,i=Ca(t,a,r),n=t[o],s=i[o];return !s||!n?null:{x:s.left-n.left,y:s.top-n.top,scaleX:s.width/n.width,scaleY:s.height/n.height}};var Gr={scaleX:1,scaleY:1},ka=e=>{var t;let{activeIndex:r,activeNodeRect:a,index:o,rects:i,overIndex:n}=e,s=(t=i[r])!=null?t:a;if(!s)return null;if(o===r){let c=i[n];return c?{x:0,y:r<n?c.top+c.height-(s.top+s.height):c.top-s.top,...Gr}:null}let l=Ws(i,o,r);return o>r&&o<=n?{x:0,y:-s.height-l,...Gr}:o<r&&o>=n?{x:0,y:s.height+l,...Gr}:{x:0,y:0,...Gr}};function Ws(e,t,r){let a=e[t],o=e[t-1],i=e[t+1];return a?r<t?o?a.top-(o.top+o.height):i?i.top-(a.top+a.height):0:i?i.top-(a.top+a.height):o?a.top-(o.top+o.height):0:0}var Fa="Sortable",Da=Ge__default.default.createContext({activeIndex:-1,containerId:Fa,disableTransforms:false,items:[],overIndex:-1,useDragOverlay:false,sortedRects:[],strategy:Sa,disabled:{draggable:false,droppable:false}});function Ia(e){let{children:t,id:r,items:a,strategy:o=Sa,disabled:i=false}=e,{active:n,dragOverlay:s,droppableRects:l,over:c,measureDroppableContainers:d}=va(),u=It(Fa,r),m=s.rect!==null,p=Ge.useMemo(()=>a.map(x=>typeof x=="object"&&"id"in x?x.id:x),[a]),b=n!=null,w=n?p.indexOf(n.id):-1,N=c?p.indexOf(c.id):-1,g=Ge.useRef(p),v=!Hs(p,g.current),f=N!==-1&&w===-1||v,C=Us(i);Be(()=>{v&&b&&d(p);},[v,p,b,d]),Ge.useEffect(()=>{g.current=p;},[p]);let S=Ge.useMemo(()=>({activeIndex:w,containerId:u,disabled:C,disableTransforms:f,items:p,overIndex:N,useDragOverlay:m,sortedRects:Os(p,l),strategy:o}),[w,u,C.draggable,C.droppable,f,p,N,l,m,o]);return Ge__default.default.createElement(Da.Provider,{value:S},t)}var js=e=>{let{id:t,items:r,activeIndex:a,overIndex:o}=e;return Ca(r,a,o).indexOf(t)},_s=e=>{let{containerId:t,isSorting:r,wasDragging:a,index:o,items:i,newIndex:n,previousItems:s,previousContainerId:l,transition:c}=e;return !c||!a||s!==i&&o===n?false:r?true:n!==o&&t===l},qs={duration:200,easing:"ease"},Ea="transform",Vs=ft.Transition.toString({property:Ea,duration:0,easing:"linear"}),Ys={roleDescription:"sortable"};function Gs(e){let{disabled:t,index:r,node:a,rect:o}=e,[i,n]=Ge.useState(null),s=Ge.useRef(r);return Be(()=>{if(!t&&r!==s.current&&a.current){let l=o.current;if(l){let c=Pt(a.current,{ignoreTransform:true}),d={x:l.left-c.left,y:l.top-c.top,scaleX:l.width/c.width,scaleY:l.height/c.height};(d.x||d.y)&&n(d);}}r!==s.current&&(s.current=r);},[t,r,a,o]),Ge.useEffect(()=>{i&&n(null);},[i]),i}function Ra(e){let{animateLayoutChanges:t=_s,attributes:r,disabled:a,data:o,getNewIndex:i=js,id:n,strategy:s,resizeObserverConfig:l,transition:c=qs}=e,{items:d,containerId:u,activeIndex:m,disabled:p,disableTransforms:b,sortedRects:w,overIndex:N,useDragOverlay:g,strategy:v}=Ge.useContext(Da),f=Xs(a,p),C=d.indexOf(n),S=Ge.useMemo(()=>({sortable:{containerId:u,index:C,items:d},...o}),[u,o,C,d]),x=Ge.useMemo(()=>d.slice(d.indexOf(n)),[d,n]),{rect:F,node:k,isOver:I,setNodeRef:y}=wa({id:n,data:S,disabled:f.droppable,resizeObserverConfig:{updateMeasurementsFor:x,...l}}),{active:h,activatorEvent:E,activeNodeRect:W,attributes:O,setNodeRef:D,listeners:T,isDragging:P,over:L,setActivatorNodeRef:K,transform:Y}=xa({id:n,data:S,attributes:{...Ys,...r},disabled:f.draggable}),Te=Lo(y,D),H=!!h,ie=H&&!b&&Yr(m)&&Yr(N),Xe=!g&&P,ot=Xe&&ie?Y:null,At=ie?ot??(s??v)({rects:w,activeNodeRect:W,activeIndex:m,overIndex:N,index:C}):null,je=Yr(m)&&Yr(N)?i({id:n,items:d,activeIndex:m,overIndex:N}):C,fe=h?.id,B=Ge.useRef({activeId:fe,items:d,newIndex:je,containerId:u}),Mt=d!==B.current.items,Ne=t({active:h,containerId:u,isDragging:P,isSorting:H,id:n,index:C,items:d,newIndex:B.current.newIndex,previousItems:B.current.items,previousContainerId:B.current.containerId,transition:c,wasDragging:B.current.activeId!=null}),J=Gs({disabled:!Ne,index:C,node:k,rect:F});return Ge.useEffect(()=>{H&&B.current.newIndex!==je&&(B.current.newIndex=je),u!==B.current.containerId&&(B.current.containerId=u),d!==B.current.items&&(B.current.items=d);},[H,je,u,d]),Ge.useEffect(()=>{if(fe===B.current.activeId)return;if(fe!=null&&B.current.activeId==null){B.current.activeId=fe;return}let at=setTimeout(()=>{B.current.activeId=fe;},50);return ()=>clearTimeout(at)},[fe]),{active:h,activeIndex:m,attributes:O,data:S,rect:F,index:C,newIndex:je,items:d,isOver:I,isSorting:H,isDragging:P,listeners:T,node:k,overIndex:N,over:L,setNodeRef:Te,setActivatorNodeRef:K,setDroppableNodeRef:y,setDraggableNodeRef:D,transform:J??At,transition:re()};function re(){if(J||Mt&&B.current.newIndex===C)return Vs;if(!(Xe&&!sr(E)||!c)&&(H||Ne))return ft.Transition.toString({...c,property:Ea})}}function Xs(e,t){var r,a;return typeof e=="boolean"?{draggable:e,droppable:false}:{draggable:(r=e?.draggable)!=null?r:t.draggable,droppable:(a=e?.droppable)!=null?a:t.droppable}}[$.Down,$.Right,$.Up,$.Left];function Js({field:e,value:t,error:r,onChange:a,businessId:o,formId:i,styling:n}){let{attributes:s,listeners:l,setNodeRef:c,transform:d,transition:u,isDragging:m}=Ra({id:e.id}),p={transform:ft.Transform.toString(d),transition:u,opacity:m?.5:1};return jsxRuntime.jsxs("div",{ref:c,style:p,className:`relative group ${m?"z-50":""}`,children:[jsxRuntime.jsx("div",{...s,...l,className:"absolute -left-8 top-1/2 -translate-y-1/2 z-50 opacity-0 group-hover:opacity-100 transition-opacity cursor-grab active:cursor-grabbing",onClick:b=>b.stopPropagation(),children:jsxRuntime.jsx("div",{className:"flex items-center gap-1 bg-[#BCB4FF] text-black px-1.5 py-1 rounded-md shadow-lg border border-black/10",children:jsxRuntime.jsx(lucideReact.GripVertical,{className:"w-3 h-3"})})}),jsxRuntime.jsx("div",{className:"absolute inset-0 pointer-events-none transition-all rounded-lg group-hover:border border-[#BCB4FF]/30"}),jsxRuntime.jsx("div",{style:{pointerEvents:"auto"},children:jsxRuntime.jsx(Pr,{field:e,value:t,error:r,onChange:a,businessId:o,formId:i,styling:n})})]})}function Jr({block:e,formData:t,errors:r,onChange:a,businessId:o,formId:i,styling:n,previewMode:s,onFieldReorder:l}){let c=na(ra(Xt,{activationConstraint:{distance:8}})),d=u=>{let{active:m,over:p}=u;if(p&&m.id!==p.id&&l&&e.fields){let b=e.fields.findIndex(N=>N.id===m.id),w=e.fields.findIndex(N=>N.id===p.id);l(e.id,b,w);}};if(e.type==="section"){let u=e.fields||[];return s&&l?jsxRuntime.jsxs("div",{className:"border rounded-lg p-6",style:{backgroundColor:n?.sectionBackground||"#FFFFFF",borderColor:n?.fieldBorder?`${n.fieldBorder}30`:"#E5E7EB"},children:[e.title&&jsxRuntime.jsx("h2",{className:"text-xl font-semibold mb-2",style:{color:n?.labelColor||"#000000"},children:e.title}),e.description&&jsxRuntime.jsx("p",{className:"text-sm mb-6",style:{color:n?.textColor||"#000000"},children:e.description}),jsxRuntime.jsx(ha,{sensors:c,collisionDetection:aa,onDragEnd:d,children:jsxRuntime.jsx(Ia,{items:u.map(m=>m.id),strategy:ka,children:jsxRuntime.jsx("div",{className:"space-y-4",children:u.map(m=>jsxRuntime.jsx(Js,{field:m,value:t[m.id],error:r[m.id],onChange:p=>a(m.id,p,m),businessId:o,formId:i,styling:n},m.id))})})})]}):jsxRuntime.jsxs("div",{className:"border rounded-lg p-6",style:{backgroundColor:n?.sectionBackground||"#FFFFFF",borderColor:n?.fieldBorder?`${n.fieldBorder}30`:"#E5E7EB"},children:[e.title&&jsxRuntime.jsx("h2",{className:"text-xl font-semibold mb-2",style:{color:n?.labelColor||"#000000"},children:e.title}),e.description&&jsxRuntime.jsx("p",{className:"text-sm mb-6",style:{color:n?.textColor||"#000000"},children:e.description}),jsxRuntime.jsx("div",{className:"space-y-4",children:u.map(m=>jsxRuntime.jsx(Pr,{field:m,value:t[m.id],error:r[m.id],onChange:p=>a(m.id,p,m),businessId:o,formId:i,styling:n},m.id))})]})}if(e.type==="text"){let u={left:"text-left",center:"text-center",right:"text-right"}[e.alignment||"left"];return jsxRuntime.jsx("div",{className:`prose prose-gray max-w-none ${u}`,children:jsxRuntime.jsx("p",{className:"whitespace-pre-wrap",style:{color:n?.textColor||"#000000"},children:e.content})})}if(e.type==="image"&&e.imageUrl){let u=e.imageSize||"medium",m=u==="full",p=m?"":{left:"mr-auto",center:"mx-auto",right:"ml-auto"}[e.alignment||"center"],b={small:"300px",medium:"500px",large:"700px"},w=m?"none":b[u]||b.medium,N={none:"0",sm:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem",full:"9999px"},g=N[e.borderRadius]||N.lg,v={maxWidth:w,...m&&{width:"100vw",marginLeft:"50%",transform:"translateX(-50%)"}};return jsxRuntime.jsx("div",{className:p,style:v,children:jsxRuntime.jsx("img",{src:e.imageUrl,alt:"",className:"w-full h-auto",style:{borderRadius:g,objectFit:"cover"}})})}return null}function co(e,t){if(t.required){if(e==null||e==="")return {isValid:false,error:`${t.label} is required`};if(Array.isArray(e)&&e.length===0)return {isValid:false,error:`Please select at least one ${t.label.toLowerCase()}`};if(t.type==="photo"&&!e.data)return {isValid:false,error:`${t.label} is required`}}if(t.type==="email"&&e&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e))return {isValid:false,error:"Please enter a valid email address"};if(t.type==="tel"&&e&&(!/^[\d\s\-\+\(\)]+$/.test(e)||e.replace(/\D/g,"").length<10))return {isValid:false,error:"Please enter a valid phone number"};if(t.type==="date"&&e){let r=new Date(e);if(isNaN(r.getTime()))return {isValid:false,error:"Please enter a valid date"}}return {isValid:true}}function Ta(e,t){let r={},a=true;return t.forEach(o=>{let i=co(e[o.id],o);!i.isValid&&i.error&&(r[o.id]=i.error,a=false);}),{isValid:a,errors:r}}function Au(e){let t={};return Object.keys(e).forEach(r=>{let a=e[r];typeof a=="string"?t[r]=a.trim():(Array.isArray(a)||a&&typeof a=="object"&&a.data,t[r]=a);}),t}function Pa({form:e,businessId:t,onSuccess:r}){let[a,o]=Ge.useState({}),[i,n]=Ge.useState({}),[s,l]=Ge.useState(false),[c,d]=Ge.useState(false),[u,m]=Ge.useState(null),p=(v,f,C)=>{if(o(S=>({...S,[v]:f})),i[v]){let S=co(f,C);n(x=>{let F={...x};return S.isValid?delete F[v]:F[v]=S.error||"",F});}},b=async v=>{v.preventDefault(),m(null);let f=[];e.settings.blocks.forEach(S=>{S.type==="section"&&S.fields&&f.push(...S.fields);});let C=Ta(a,f);if(!C.isValid){n(C.errors);return}l(true);try{let x=typeof window<"u"&&undefined?"/api/forms/submit":`/api/studio/forms/${t}/${e.slug}/submit`,F=await fetch(x,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({formId:e.id,slug:e.slug,data:a})});if(!F.ok){let k=await F.json();throw new Error(k.message||"Failed to submit form")}d(!0),o({}),n({}),r&&r();}catch(S){console.error("Form submission error:",S),m(S.message||"Failed to submit form. Please try again.");}finally{l(false);}};if(c)return jsxRuntime.jsx("div",{className:"max-w-2xl mx-auto px-4 py-12",children:jsxRuntime.jsxs("div",{className:"bg-green-50 border border-green-200 rounded-lg p-8 text-center",children:[jsxRuntime.jsx("div",{className:"w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-4",children:jsxRuntime.jsx("svg",{className:"w-8 h-8 text-green-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),jsxRuntime.jsx("h3",{className:"text-xl font-semibold mb-2",style:{color:e.settings.styling?.labelColor||"#000000"},children:"Success!"}),jsxRuntime.jsx("p",{style:{color:e.settings.styling?.textColor||"#000000"},children:e.settings.successMessage}),jsxRuntime.jsx("button",{onClick:()=>d(false),className:"mt-6 px-4 py-2 bg-gray-900 text-white rounded-lg hover:bg-gray-800 transition-colors",children:"Submit Another Response"})]})});let w=e.settings.styling?.alignment||"left",N=w==="center"?"text-center":w==="right"?"text-right":"text-left",g=e.settings.styling?.buttonColor||"#CAC426";return jsxRuntime.jsxs("div",{className:"max-w-2xl mx-auto px-4 py-12",children:[jsxRuntime.jsxs("div",{className:`mb-8 ${N}`,children:[jsxRuntime.jsx("h1",{className:"text-3xl font-bold mb-2",style:{color:e.settings.styling?.textColor||"#000000"},children:e.settings.title}),e.settings.description&&jsxRuntime.jsx("p",{style:{color:e.settings.styling?.textColor||"#000000"},children:e.settings.description})]}),jsxRuntime.jsxs("form",{onSubmit:b,className:"space-y-8",children:[e.settings.blocks.map(v=>jsxRuntime.jsx(Jr,{block:v,formData:a,errors:i,onChange:p,businessId:t,formId:e.id,styling:e.settings.styling},v.id)),u&&jsxRuntime.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:jsxRuntime.jsx("p",{className:"text-sm text-red-600",children:u})}),jsxRuntime.jsx("div",{className:"pt-6",children:jsxRuntime.jsx("button",{type:"submit",disabled:s,className:"w-full px-6 py-3 text-white rounded-lg disabled:opacity-50 disabled:cursor-not-allowed transition-all font-medium hover:opacity-90",style:{backgroundColor:g},children:s?"Submitting...":e.settings.submitButtonText})})]})]})}exports.About=dn;exports.AddonsSelection=Wn;exports.BeforeAfter=Cn;exports.BookingFlow=Ro;exports.BookingSection=En;exports.BottomSheet=jn;exports.CYCLE_PHASES=Io;exports.Confirmation=Yn;exports.Contact=yn;exports.ContactForm=Vn;exports.CycleAwareDateSelection=ui;exports.DateSelection=nr;exports.FAQSection=$n;exports.FeatureContent=wn;exports.FeaturedLink=on;exports.FixedInfoCard=In;exports.FormBlock=Jr;exports.FormRenderer=Pa;exports.Gallery=mn;exports.Header=nn;exports.Hero=cn;exports.HoldTimer=Rr;exports.ImageSection=Mn;exports.InstagramFeed=Fn;exports.LinkList=sn;exports.LocationMap=An;exports.Logo=tn;exports.MinimalFooter=vn;exports.MinimalHeader=bn;exports.MinimalNavigation=xn;exports.Navbar=Bn;exports.PricingTable=Sn;exports.ScrollingTextDivider=Pn;exports.SectionRenderer=gi;exports.ServiceSelection=On;exports.ServicesPreview=un;exports.SocialBar=ln;exports.Team=fn;exports.Testimonials=gn;exports.TextSection=zn;exports.TimeSelection=Hn;exports.VideoSection=Rn;exports.animations=rr;exports.createEntranceAnimation=ge;exports.createStaggerAnimation=Lc;exports.getAnimationDuration=Ac;exports.getFadeVariants=Qa;exports.getSlideVariants=Ja;exports.getTransitionVariants=Mc;exports.sanitizeFormData=Au;exports.shouldReduceMotion=$c;exports.validateField=co;exports.validateForm=Ta;//# sourceMappingURL=index.js.map
21
+ `},Mi={onDragStart(e){let{active:t}=e;return "Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return "Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function $i(e){let{announcements:t=Mi,container:r,hiddenTextDescribedById:a,screenReaderInstructions:o=Ai}=e,{announce:i,announcement:n}=jo(),s=It("DndLiveRegion"),[l,c]=Ge.useState(false);if(Ge.useEffect(()=>{c(true);},[]),Ti(Ge.useMemo(()=>({onDragStart(u){let{active:p}=u;i(t.onDragStart({active:p}));},onDragMove(u){let{active:p,over:g}=u;t.onDragMove&&i(t.onDragMove({active:p,over:g}));},onDragOver(u){let{active:p,over:g}=u;i(t.onDragOver({active:p,over:g}));},onDragEnd(u){let{active:p,over:g}=u;i(t.onDragEnd({active:p,over:g}));},onDragCancel(u){let{active:p,over:g}=u;i(t.onDragCancel({active:p,over:g}));}}),[i,t])),!l)return null;let d=Ge__default.default.createElement(Ge__default.default.Fragment,null,Ge__default.default.createElement(Uo,{id:a,value:o.draggable}),Ge__default.default.createElement(Wo,{id:s,announcement:n}));return r?reactDom.createPortal(d,r):d}var oe;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable";})(oe||(oe={}));function Ur(){}function ra(e,t){return Ge.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function na(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Ge.useMemo(()=>[...t].filter(a=>a!=null),[...t])}var We=Object.freeze({x:0,y:0});function Li(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Bi(e,t){let{data:{value:r}}=e,{data:{value:a}}=t;return r-a}function zi(e,t){let{data:{value:r}}=e,{data:{value:a}}=t;return a-r}function oa(e,t){if(!e||e.length===0)return null;let[r]=e;return r[t]}function _o(e,t,r){return t===void 0&&(t=e.left),r===void 0&&(r=e.top),{x:t+e.width*.5,y:r+e.height*.5}}var aa=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:a}=e,o=_o(t,t.left,t.top),i=[];for(let n of a){let{id:s}=n,l=r.get(s);if(l){let c=Li(_o(l),o);i.push({id:s,data:{droppableContainer:n,value:c}});}}return i.sort(Bi)};function Oi(e,t){let r=Math.max(t.top,e.top),a=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),n=o-a,s=i-r;if(a<o&&r<i){let l=t.width*t.height,c=e.width*e.height,d=n*s,u=d/(l+c-d);return Number(u.toFixed(4))}return 0}var Hi=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:a}=e,o=[];for(let i of a){let{id:n}=i,s=r.get(n);if(s){let l=Oi(s,t);l>0&&o.push({id:n,data:{droppableContainer:i,value:l}});}}return o.sort(zi)};function Ui(e,t,r){return {...e,scaleX:t&&r?t.width/r.width:1,scaleY:t&&r?t.height/r.height:1}}function ia(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:We}function Wi(e){return function(r){for(var a=arguments.length,o=new Array(a>1?a-1:0),i=1;i<a;i++)o[i-1]=arguments[i];return o.reduce((n,s)=>({...n,top:n.top+e*s.y,bottom:n.bottom+e*s.y,left:n.left+e*s.x,right:n.right+e*s.x}),{...r})}}var ji=Wi(1);function _i(e){if(e.startsWith("matrix3d(")){let t=e.slice(9,-1).split(/, /);return {x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){let t=e.slice(7,-1).split(/, /);return {x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function qi(e,t,r){let a=_i(t);if(!a)return e;let{scaleX:o,scaleY:i,x:n,y:s}=a,l=e.left-n-(1-o)*parseFloat(r),c=e.top-s-(1-i)*parseFloat(r.slice(r.indexOf(" ")+1)),d=o?e.width/o:e.width,u=i?e.height/i:e.height;return {width:d,height:u,top:c,right:l+d,bottom:c+u,left:l}}var Vi={ignoreTransform:false};function Pt(e,t){t===void 0&&(t=Vi);let r=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:c,transformOrigin:d}=he(e).getComputedStyle(e);c&&(r=qi(r,c,d));}let{top:a,left:o,width:i,height:n,bottom:s,right:l}=r;return {top:a,left:o,width:i,height:n,bottom:s,right:l}}function qo(e){return Pt(e,{ignoreTransform:true})}function Yi(e){let t=e.innerWidth,r=e.innerHeight;return {top:0,left:0,right:t,bottom:r,width:t,height:r}}function Gi(e,t){return t===void 0&&(t=he(e).getComputedStyle(e)),t.position==="fixed"}function Xi(e,t){t===void 0&&(t=he(e).getComputedStyle(e));let r=/(auto|scroll|overlay)/;return ["overflow","overflowX","overflowY"].some(o=>{let i=t[o];return typeof i=="string"?r.test(i):false})}function _r(e,t){let r=[];function a(o){if(t!=null&&r.length>=t||!o)return r;if($r(o)&&o.scrollingElement!=null&&!r.includes(o.scrollingElement))return r.push(o.scrollingElement),r;if(!_t(o)||Qn(o)||r.includes(o))return r;let i=he(e).getComputedStyle(o);return o!==e&&Xi(o,i)&&r.push(o),Gi(o,i)?r:a(o.parentNode)}return e?a(e):r}function sa(e){let[t]=_r(e,1);return t??null}function Zn(e){return !ar||!e?null:Ft(e)?e:Mr(e)?$r(e)||e===Dt(e).scrollingElement?window:_t(e)?e:null:null}function la(e){return Ft(e)?e.scrollX:e.scrollLeft}function ca(e){return Ft(e)?e.scrollY:e.scrollTop}function ro(e){return {x:la(e),y:ca(e)}}var ce;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward";})(ce||(ce={}));function da(e){return !ar||!e?false:e===document.scrollingElement}function ua(e){let t={x:0,y:0},r=da(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},a={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},o=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,n=e.scrollTop>=a.y,s=e.scrollLeft>=a.x;return {isTop:o,isLeft:i,isBottom:n,isRight:s,maxScroll:a,minScroll:t}}var Ki={x:.2,y:.2};function Ji(e,t,r,a,o){let{top:i,left:n,right:s,bottom:l}=r;a===void 0&&(a=10),o===void 0&&(o=Ki);let{isTop:c,isBottom:d,isLeft:u,isRight:p}=ua(e),g={x:0,y:0},b={x:0,y:0},v={height:t.height*o.y,width:t.width*o.x};return !c&&i<=t.top+v.height?(g.y=ce.Backward,b.y=a*Math.abs((t.top+v.height-i)/v.height)):!d&&l>=t.bottom-v.height&&(g.y=ce.Forward,b.y=a*Math.abs((t.bottom-v.height-l)/v.height)),!p&&s>=t.right-v.width?(g.x=ce.Forward,b.x=a*Math.abs((t.right-v.width-s)/v.width)):!u&&n<=t.left+v.width&&(g.x=ce.Backward,b.x=a*Math.abs((t.left+v.width-n)/v.width)),{direction:g,speed:b}}function Qi(e){if(e===document.scrollingElement){let{innerWidth:i,innerHeight:n}=window;return {top:0,left:0,right:i,bottom:n,width:i,height:n}}let{top:t,left:r,right:a,bottom:o}=e.getBoundingClientRect();return {top:t,left:r,right:a,bottom:o,width:e.clientWidth,height:e.clientHeight}}function ma(e){return e.reduce((t,r)=>Et(t,ro(r)),We)}function Zi(e){return e.reduce((t,r)=>t+la(r),0)}function es(e){return e.reduce((t,r)=>t+ca(r),0)}function ts(e,t){if(t===void 0&&(t=Pt),!e)return;let{top:r,left:a,bottom:o,right:i}=t(e);sa(e)&&(o<=0||i<=0||r>=window.innerHeight||a>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"});}var rs=[["x",["left","right"],Zi],["y",["top","bottom"],es]],cr=class{constructor(t,r){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let a=_r(r),o=ma(a);this.rect={...t},this.width=t.width,this.height=t.height;for(let[i,n,s]of rs)for(let l of n)Object.defineProperty(this,l,{get:()=>{let c=s(a),d=o[i]-c;return this.rect[l]+d},enumerable:true});Object.defineProperty(this,"rect",{enumerable:false});}},Rt=class{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(r=>{var a;return (a=this.target)==null?void 0:a.removeEventListener(...r)});},this.target=t;}add(t,r,a){var o;(o=this.target)==null||o.addEventListener(t,r,a),this.listeners.push([t,r,a]);}};function ns(e){let{EventTarget:t}=he(e);return e instanceof t?e:Dt(e)}function eo(e,t){let r=Math.abs(e.x),a=Math.abs(e.y);return typeof t=="number"?Math.sqrt(r**2+a**2)>t:"x"in t&&"y"in t?r>t.x&&a>t.y:"x"in t?r>t.x:"y"in t?a>t.y:false}var ze;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange";})(ze||(ze={}));function Vo(e){e.preventDefault();}function os(e){e.stopPropagation();}var B;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab";})(B||(B={}));var pa={start:[B.Space,B.Enter],cancel:[B.Esc],end:[B.Space,B.Enter,B.Tab]},as=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case B.Right:return {...r,x:r.x+25};case B.Left:return {...r,x:r.x-25};case B.Down:return {...r,y:r.y+25};case B.Up:return {...r,y:r.y-25}}},Wr=class{constructor(t){this.props=void 0,this.autoScrollEnabled=false,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;let{event:{target:r}}=t;this.props=t,this.listeners=new Rt(Dt(r)),this.windowListeners=new Rt(he(r)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach();}attach(){this.handleStart(),this.windowListeners.add(ze.Resize,this.handleCancel),this.windowListeners.add(ze.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(ze.Keydown,this.handleKeyDown));}handleStart(){let{activeNode:t,onStart:r}=this.props,a=t.node.current;a&&ts(a),r(We);}handleKeyDown(t){if(sr(t)){let{active:r,context:a,options:o}=this.props,{keyboardCodes:i=pa,coordinateGetter:n=as,scrollBehavior:s="smooth"}=o,{code:l}=t;if(i.end.includes(l)){this.handleEnd(t);return}if(i.cancel.includes(l)){this.handleCancel(t);return}let{collisionRect:c}=a.current,d=c?{x:c.left,y:c.top}:We;this.referenceCoordinates||(this.referenceCoordinates=d);let u=n(t,{active:r,context:a.current,currentCoordinates:d});if(u){let p=Yt(u,d),g={x:0,y:0},{scrollableAncestors:b}=a.current;for(let v of b){let w=t.code,{isTop:f,isRight:x,isLeft:y,isBottom:N,maxScroll:C,minScroll:h}=ua(v),k=Qi(v),S={x:Math.min(w===B.Right?k.right-k.width/2:k.right,Math.max(w===B.Right?k.left:k.left+k.width/2,u.x)),y:Math.min(w===B.Down?k.bottom-k.height/2:k.bottom,Math.max(w===B.Down?k.top:k.top+k.height/2,u.y))},I=w===B.Right&&!x||w===B.Left&&!y,R=w===B.Down&&!N||w===B.Up&&!f;if(I&&S.x!==u.x){let m=v.scrollLeft+p.x,F=w===B.Right&&m<=C.x||w===B.Left&&m>=h.x;if(F&&!p.y){v.scrollTo({left:m,behavior:s});return}F?g.x=v.scrollLeft-m:g.x=w===B.Right?v.scrollLeft-C.x:v.scrollLeft-h.x,g.x&&v.scrollBy({left:-g.x,behavior:s});break}else if(R&&S.y!==u.y){let m=v.scrollTop+p.y,F=w===B.Down&&m<=C.y||w===B.Up&&m>=h.y;if(F&&!p.x){v.scrollTo({top:m,behavior:s});return}F?g.y=v.scrollTop-m:g.y=w===B.Down?v.scrollTop-C.y:v.scrollTop-h.y,g.y&&v.scrollBy({top:-g.y,behavior:s});break}}this.handleMove(t,Et(Yt(u,this.referenceCoordinates),g));}}}handleMove(t,r){let{onMove:a}=this.props;t.preventDefault(),a(r);}handleEnd(t){let{onEnd:r}=this.props;t.preventDefault(),this.detach(),r();}handleCancel(t){let{onCancel:r}=this.props;t.preventDefault(),this.detach(),r();}detach(){this.listeners.removeAll(),this.windowListeners.removeAll();}};Wr.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:a=pa,onActivation:o}=t,{active:i}=r,{code:n}=e.nativeEvent;if(a.start.includes(n)){let s=i.activatorNode.current;return s&&e.target!==s?false:(e.preventDefault(),o?.({event:e.nativeEvent}),true)}return false}}];function Yo(e){return !!(e&&"distance"in e)}function Go(e){return !!(e&&"delay"in e)}var dr=class{constructor(t,r,a){var o;a===void 0&&(a=ns(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=true,this.document=void 0,this.activated=false,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=r;let{event:i}=t,{target:n}=i;this.props=t,this.events=r,this.document=Dt(n),this.documentListeners=new Rt(this.document),this.listeners=new Rt(a),this.windowListeners=new Rt(he(n)),this.initialCoordinates=(o=zr(i))!=null?o:We,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach();}attach(){let{events:t,props:{options:{activationConstraint:r,bypassActivationConstraint:a}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:false}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(ze.Resize,this.handleCancel),this.windowListeners.add(ze.DragStart,Vo),this.windowListeners.add(ze.VisibilityChange,this.handleCancel),this.windowListeners.add(ze.ContextMenu,Vo),this.documentListeners.add(ze.Keydown,this.handleKeydown),r){if(a!=null&&a({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Go(r)){this.timeoutId=setTimeout(this.handleStart,r.delay),this.handlePending(r);return}if(Yo(r)){this.handlePending(r);return}}this.handleStart();}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null);}handlePending(t,r){let{active:a,onPending:o}=this.props;o(a,t,this.initialCoordinates,r);}handleStart(){let{initialCoordinates:t}=this,{onStart:r}=this.props;t&&(this.activated=true,this.documentListeners.add(ze.Click,os,{capture:true}),this.removeTextSelection(),this.documentListeners.add(ze.SelectionChange,this.removeTextSelection),r(t));}handleMove(t){var r;let{activated:a,initialCoordinates:o,props:i}=this,{onMove:n,options:{activationConstraint:s}}=i;if(!o)return;let l=(r=zr(t))!=null?r:We,c=Yt(o,l);if(!a&&s){if(Yo(s)){if(s.tolerance!=null&&eo(c,s.tolerance))return this.handleCancel();if(eo(c,s.distance))return this.handleStart()}if(Go(s)&&eo(c,s.tolerance))return this.handleCancel();this.handlePending(s,c);return}t.cancelable&&t.preventDefault(),n(l);}handleEnd(){let{onAbort:t,onEnd:r}=this.props;this.detach(),this.activated||t(this.props.active),r();}handleCancel(){let{onAbort:t,onCancel:r}=this.props;this.detach(),this.activated||t(this.props.active),r();}handleKeydown(t){t.code===B.Esc&&this.handleCancel();}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges();}},is={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}},Xt=class extends dr{constructor(t){let{event:r}=t,a=Dt(r.target);super(t,is,a);}};Xt.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:a}=t;return !r.isPrimary||r.button!==0?false:(a?.({event:r}),true)}}];var ss={move:{name:"mousemove"},end:{name:"mouseup"}},no;(function(e){e[e.RightClick=2]="RightClick";})(no||(no={}));var oo=class extends dr{constructor(t){super(t,ss,Dt(t.event.target));}};oo.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:a}=t;return r.button===no.RightClick?false:(a?.({event:r}),true)}}];var to={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}},ao=class extends dr{constructor(t){super(t,to);}static setup(){return window.addEventListener(to.move.name,t,{capture:false,passive:false}),function(){window.removeEventListener(to.move.name,t);};function t(){}}};ao.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:a}=t,{touches:o}=r;return o.length>1?false:(a?.({event:r}),true)}}];var lr;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect";})(lr||(lr={}));var jr;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder";})(jr||(jr={}));function ls(e){let{acceleration:t,activator:r=lr.Pointer,canScroll:a,draggingRect:o,enabled:i,interval:n=5,order:s=jr.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:d,delta:u,threshold:p}=e,g=ds({delta:u,disabled:!i}),[b,v]=Bo(),w=Ge.useRef({x:0,y:0}),f=Ge.useRef({x:0,y:0}),x=Ge.useMemo(()=>{switch(r){case lr.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case lr.DraggableRect:return o}},[r,o,l]),y=Ge.useRef(null),N=Ge.useCallback(()=>{let h=y.current;if(!h)return;let k=w.current.x*f.current.x,S=w.current.y*f.current.y;h.scrollBy(k,S);},[]),C=Ge.useMemo(()=>s===jr.TreeOrder?[...c].reverse():c,[s,c]);Ge.useEffect(()=>{if(!i||!c.length||!x){v();return}for(let h of C){if(a?.(h)===false)continue;let k=c.indexOf(h),S=d[k];if(!S)continue;let{direction:I,speed:R}=Ji(h,S,x,t,p);for(let m of ["x","y"])g[m][I[m]]||(R[m]=0,I[m]=0);if(R.x>0||R.y>0){v(),y.current=h,b(N,n),w.current=R,f.current=I;return}}w.current={x:0,y:0},f.current={x:0,y:0},v();},[t,N,a,v,i,n,JSON.stringify(x),JSON.stringify(g),b,c,C,d,JSON.stringify(p)]);}var cs={x:{[ce.Backward]:false,[ce.Forward]:false},y:{[ce.Backward]:false,[ce.Forward]:false}};function ds(e){let{delta:t,disabled:r}=e,a=Br(t);return Vt(o=>{if(r||!a||!o)return cs;let i={x:Math.sign(t.x-a.x),y:Math.sign(t.y-a.y)};return {x:{[ce.Backward]:o.x[ce.Backward]||i.x===-1,[ce.Forward]:o.x[ce.Forward]||i.x===1},y:{[ce.Backward]:o.y[ce.Backward]||i.y===-1,[ce.Forward]:o.y[ce.Forward]||i.y===1}}},[r,t,a])}function us(e,t){let r=t!=null?e.get(t):void 0,a=r?r.node.current:null;return Vt(o=>{var i;return t==null?null:(i=a??o)!=null?i:null},[a,t])}function ms(e,t){return Ge.useMemo(()=>e.reduce((r,a)=>{let{sensor:o}=a,i=o.activators.map(n=>({eventName:n.eventName,handler:t(n.handler,a)}));return [...r,...i]},[]),[e,t])}var ur;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging";})(ur||(ur={}));var io;(function(e){e.Optimized="optimized";})(io||(io={}));var Xo=new Map;function ps(e,t){let{dragging:r,dependencies:a,config:o}=t,[i,n]=Ge.useState(null),{frequency:s,measure:l,strategy:c}=o,d=Ge.useRef(e),u=w(),p=qt(u),g=Ge.useCallback(function(f){f===void 0&&(f=[]),!p.current&&n(x=>x===null?f:x.concat(f.filter(y=>!x.includes(y))));},[p]),b=Ge.useRef(null),v=Vt(f=>{if(u&&!r)return Xo;if(!f||f===Xo||d.current!==e||i!=null){let x=new Map;for(let y of e){if(!y)continue;if(i&&i.length>0&&!i.includes(y.id)&&y.rect.current){x.set(y.id,y.rect.current);continue}let N=y.node.current,C=N?new cr(l(N),N):null;y.rect.current=C,C&&x.set(y.id,C);}return x}return f},[e,i,r,u,l]);return Ge.useEffect(()=>{d.current=e;},[e]),Ge.useEffect(()=>{u||g();},[r,u]),Ge.useEffect(()=>{i&&i.length>0&&n(null);},[JSON.stringify(i)]),Ge.useEffect(()=>{u||typeof s!="number"||b.current!==null||(b.current=setTimeout(()=>{g(),b.current=null;},s));},[s,u,g,...a]),{droppableRects:v,measureDroppableContainers:g,measuringScheduled:i!=null};function w(){switch(c){case ur.Always:return false;case ur.BeforeDragging:return r;default:return !r}}}function ga(e,t){return Vt(r=>e?r||(typeof t=="function"?t(e):e):null,[t,e])}function gs(e,t){return ga(e,t)}function fs(e){let{callback:t,disabled:r}=e,a=Lr(t),o=Ge.useMemo(()=>{if(r||typeof window>"u"||typeof window.MutationObserver>"u")return;let{MutationObserver:i}=window;return new i(a)},[a,r]);return Ge.useEffect(()=>()=>o?.disconnect(),[o]),o}function qr(e){let{callback:t,disabled:r}=e,a=Lr(t),o=Ge.useMemo(()=>{if(r||typeof window>"u"||typeof window.ResizeObserver>"u")return;let{ResizeObserver:i}=window;return new i(a)},[r]);return Ge.useEffect(()=>()=>o?.disconnect(),[o]),o}function ys(e){return new cr(Pt(e),e)}function Ko(e,t,r){t===void 0&&(t=ys);let[a,o]=Ge.useState(null);function i(){o(l=>{if(!e)return null;if(e.isConnected===false){var c;return (c=l??r)!=null?c:null}let d=t(e);return JSON.stringify(l)===JSON.stringify(d)?l:d});}let n=fs({callback(l){if(e)for(let c of l){let{type:d,target:u}=c;if(d==="childList"&&u instanceof HTMLElement&&u.contains(e)){i();break}}}}),s=qr({callback:i});return Be(()=>{i(),e?(s?.observe(e),n?.observe(document.body,{childList:true,subtree:true})):(s?.disconnect(),n?.disconnect());},[e]),a}function bs(e){let t=ga(e);return ia(e,t)}var Jo=[];function hs(e){let t=Ge.useRef(e),r=Vt(a=>e?a&&a!==Jo&&e&&t.current&&e.parentNode===t.current.parentNode?a:_r(e):Jo,[e]);return Ge.useEffect(()=>{t.current=e;},[e]),r}function xs(e){let[t,r]=Ge.useState(null),a=Ge.useRef(e),o=Ge.useCallback(i=>{let n=Zn(i.target);n&&r(s=>s?(s.set(n,ro(n)),new Map(s)):null);},[]);return Ge.useEffect(()=>{let i=a.current;if(e!==i){n(i);let s=e.map(l=>{let c=Zn(l);return c?(c.addEventListener("scroll",o,{passive:true}),[c,ro(c)]):null}).filter(l=>l!=null);r(s.length?new Map(s):null),a.current=e;}return ()=>{n(e),n(i);};function n(s){s.forEach(l=>{let c=Zn(l);c?.removeEventListener("scroll",o);});}},[o,e]),Ge.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,n)=>Et(i,n),We):ma(e):We,[e,t])}function Qo(e,t){t===void 0&&(t=[]);let r=Ge.useRef(null);return Ge.useEffect(()=>{r.current=null;},t),Ge.useEffect(()=>{let a=e!==We;a&&!r.current&&(r.current=e),!a&&r.current&&(r.current=null);},[e]),r.current?Yt(e,r.current):We}function vs(e){Ge.useEffect(()=>{if(!ar)return;let t=e.map(r=>{let{sensor:a}=r;return a.setup==null?void 0:a.setup()});return ()=>{for(let r of t)r?.();}},e.map(t=>{let{sensor:r}=t;return r}));}function ws(e,t){return Ge.useMemo(()=>e.reduce((r,a)=>{let{eventName:o,handler:i}=a;return r[o]=n=>{i(n,t);},r},{}),[e,t])}function fa(e){return Ge.useMemo(()=>e?Yi(e):null,[e])}var Zo=[];function Ns(e,t){t===void 0&&(t=Pt);let[r]=e,a=fa(r?he(r):null),[o,i]=Ge.useState(Zo);function n(){i(()=>e.length?e.map(l=>da(l)?a:new cr(t(l),l)):Zo);}let s=qr({callback:n});return Be(()=>{s?.disconnect(),n(),e.forEach(l=>s?.observe(l));},[e]),o}function Cs(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return _t(t)?t:e}function Ss(e){let{measure:t}=e,[r,a]=Ge.useState(null),o=Ge.useCallback(c=>{for(let{target:d}of c)if(_t(d)){a(u=>{let p=t(d);return u?{...u,width:p.width,height:p.height}:p});break}},[t]),i=qr({callback:o}),n=Ge.useCallback(c=>{let d=Cs(c);i?.disconnect(),d&&i?.observe(d),a(d?t(d):null);},[t,i]),[s,l]=ir(n);return Ge.useMemo(()=>({nodeRef:s,rect:r,setRef:l}),[r,s,l])}var ks=[{sensor:Xt,options:{}},{sensor:Wr,options:{}}],Fs={current:{}},Hr={draggable:{measure:qo},droppable:{measure:qo,strategy:ur.WhileDragging,frequency:io.Optimized},dragOverlay:{measure:Pt}},Tt=class extends Map{get(t){var r;return t!=null&&(r=super.get(t))!=null?r:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:r}=t;return !r})}getNodeFor(t){var r,a;return (r=(a=this.get(t))==null?void 0:a.node.current)!=null?r:void 0}},Ds={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Tt,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ur},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Hr,measureDroppableContainers:Ur,windowRect:null,measuringScheduled:false},Is={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ur,draggableNodes:new Map,over:null,measureDroppableContainers:Ur},Vr=Ge.createContext(Is),ya=Ge.createContext(Ds);function Es(){return {draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Tt}}}function Rs(e,t){switch(t.type){case oe.DragStart:return {...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case oe.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case oe.DragEnd:case oe.DragCancel:return {...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case oe.RegisterDroppable:{let{element:r}=t,{id:a}=r,o=new Tt(e.droppable.containers);return o.set(a,r),{...e,droppable:{...e.droppable,containers:o}}}case oe.SetDroppableDisabled:{let{id:r,key:a,disabled:o}=t,i=e.droppable.containers.get(r);if(!i||a!==i.key)return e;let n=new Tt(e.droppable.containers);return n.set(r,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:n}}}case oe.UnregisterDroppable:{let{id:r,key:a}=t,o=e.droppable.containers.get(r);if(!o||a!==o.key)return e;let i=new Tt(e.droppable.containers);return i.delete(r),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function Ts(e){let{disabled:t}=e,{active:r,activatorEvent:a,draggableNodes:o}=Ge.useContext(Vr),i=Br(a),n=Br(r?.id);return Ge.useEffect(()=>{if(!t&&!a&&i&&n!=null){if(!sr(i)||document.activeElement===i.target)return;let s=o.get(n);if(!s)return;let{activatorNode:l,node:c}=s;if(!l.current&&!c.current)return;requestAnimationFrame(()=>{for(let d of [l.current,c.current]){if(!d)continue;let u=Oo(d);if(u){u.focus();break}}});}},[a,t,o,n,i]),null}function Ps(e,t){let{transform:r,...a}=t;return e!=null&&e.length?e.reduce((o,i)=>i({transform:o,...a}),r):r}function As(e){return Ge.useMemo(()=>({draggable:{...Hr.draggable,...e?.draggable},droppable:{...Hr.droppable,...e?.droppable},dragOverlay:{...Hr.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function Ms(e){let{activeNode:t,measure:r,initialRect:a,config:o=true}=e,i=Ge.useRef(false),{x:n,y:s}=typeof o=="boolean"?{x:o,y:o}:o;Be(()=>{if(!n&&!s||!t){i.current=false;return}if(i.current||!a)return;let c=t?.node.current;if(!c||c.isConnected===false)return;let d=r(c),u=ia(d,a);if(n||(u.x=0),s||(u.y=0),i.current=true,Math.abs(u.x)>0||Math.abs(u.y)>0){let p=sa(c);p&&p.scrollBy({top:u.y,left:u.x});}},[t,n,s,a,r]);}var ba=Ge.createContext({...We,scaleX:1,scaleY:1}),yt;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized";})(yt||(yt={}));var ha=Ge.memo(function(t){var r,a,o,i;let{id:n,accessibility:s,autoScroll:l=true,children:c,sensors:d=ks,collisionDetection:u=Hi,measuring:p,modifiers:g,...b}=t,v=Ge.useReducer(Rs,void 0,Es),[w,f]=v,[x,y]=Pi(),[N,C]=Ge.useState(yt.Uninitialized),h=N===yt.Initialized,{draggable:{active:k,nodes:S,translate:I},droppable:{containers:R}}=w,m=k!=null?S.get(k):null,F=Ge.useRef({initial:null,translated:null}),M=Ge.useMemo(()=>{var pe;return k!=null?{id:k,data:(pe=m?.data)!=null?pe:Fs,rect:F}:null},[k,m]),A=Ge.useRef(null),[D,T]=Ge.useState(null),[P,z]=Ge.useState(null),K=qt(b,Object.values(b)),Y=It("DndDescribedBy",n),Te=Ge.useMemo(()=>R.getEnabled(),[R]),U=As(p),{droppableRects:ie,measureDroppableContainers:Xe,measuringScheduled:ot}=ps(Te,{dragging:h,dependencies:[I.x,I.y],config:U.droppable}),xe=us(S,k),At=Ge.useMemo(()=>P?zr(P):null,[P]),je=La(),fe=gs(xe,U.draggable.measure);Ms({activeNode:k!=null?S.get(k):null,config:je.layoutShiftCompensation,initialRect:fe,measure:U.draggable.measure});let O=Ko(xe,U.draggable.measure,fe),Mt=Ko(xe?xe.parentElement:null),Ne=Ge.useRef({activatorEvent:null,active:null,activeNode:xe,collisionRect:null,collisions:null,droppableRects:ie,draggableNodes:S,draggingNode:null,draggingNodeRect:null,droppableContainers:R,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),J=R.getNodeFor((r=Ne.current.over)==null?void 0:r.id),re=Ss({measure:U.dragOverlay.measure}),at=(a=re.nodeRef.current)!=null?a:xe,it=h?(o=re.rect)!=null?o:O:null,gr=!!(re.nodeRef.current&&re.rect),Kt=bs(gr?null:O),$t=fa(at?he(at):null),Ce=hs(h?J??xe:null),bt=Ns(Ce),Lt=Ps(g,{transform:{x:I.x-Kt.x,y:I.y-Kt.y,scaleX:1,scaleY:1},activatorEvent:P,active:M,activeNodeRect:O,containerNodeRect:Mt,draggingNodeRect:it,over:Ne.current.over,overlayNodeRect:re.rect,scrollableAncestors:Ce,scrollableAncestorRects:bt,windowRect:$t}),fr=At?Et(At,I):null,yr=xs(Ce),Jt=Qo(yr),Zr=Qo(yr,[O]),st=Et(Lt,Jt),E=it?ji(it,Lt):null,W=M&&E?u({active:M,collisionRect:E,droppableRects:ie,droppableContainers:Te,pointerCoordinates:fr}):null,_=oa(W,"id"),[ye,br]=Ge.useState(null),hr=gr?Lt:Et(Lt,Zr),se=Ui(hr,(i=ye?.rect)!=null?i:null,O),Pe=Ge.useRef(null),uo=Ge.useCallback((pe,Se)=>{let{sensor:ke,options:lt}=Se;if(A.current==null)return;let Ae=S.get(A.current);if(!Ae)return;let Fe=pe.nativeEvent,_e=new ke({active:A.current,activeNode:Ae,event:Fe,options:lt,context:Ne,onAbort(de){if(!S.get(de))return;let{onDragAbort:qe}=K.current,Ke={id:de};qe?.(Ke),x({type:"onDragAbort",event:Ke});},onPending(de,ct,qe,Ke){if(!S.get(de))return;let{onDragPending:Zt}=K.current,dt={id:de,constraint:ct,initialCoordinates:qe,offset:Ke};Zt?.(dt),x({type:"onDragPending",event:dt});},onStart(de){let ct=A.current;if(ct==null)return;let qe=S.get(ct);if(!qe)return;let{onDragStart:Ke}=K.current,Qt={activatorEvent:Fe,active:{id:ct,data:qe.data,rect:F}};reactDom.unstable_batchedUpdates(()=>{Ke?.(Qt),C(yt.Initializing),f({type:oe.DragStart,initialCoordinates:de,active:ct}),x({type:"onDragStart",event:Qt}),T(Pe.current),z(Fe);});},onMove(de){f({type:oe.DragMove,coordinates:de});},onEnd:Bt(oe.DragEnd),onCancel:Bt(oe.DragCancel)});Pe.current=_e;function Bt(de){return async function(){let{active:qe,collisions:Ke,over:Qt,scrollAdjustedTranslate:Zt}=Ne.current,dt=null;if(qe&&Zt){let{cancelDrop:er}=K.current;dt={activatorEvent:Fe,active:qe,collisions:Ke,delta:Zt,over:Qt},de===oe.DragEnd&&typeof er=="function"&&await Promise.resolve(er(dt))&&(de=oe.DragCancel);}A.current=null,reactDom.unstable_batchedUpdates(()=>{f({type:de}),C(yt.Uninitialized),br(null),T(null),z(null),Pe.current=null;let er=de===oe.DragEnd?"onDragEnd":"onDragCancel";if(dt){let en=K.current[er];en?.(dt),x({type:er,event:dt});}});}}},[S]),Aa=Ge.useCallback((pe,Se)=>(ke,lt)=>{let Ae=ke.nativeEvent,Fe=S.get(lt);if(A.current!==null||!Fe||Ae.dndKit||Ae.defaultPrevented)return;let _e={active:Fe};pe(ke,Se.options,_e)===true&&(Ae.dndKit={capturedBy:Se.sensor},A.current=lt,uo(ke,Se));},[S,uo]),mo=ms(d,Aa);vs(d),Be(()=>{O&&N===yt.Initializing&&C(yt.Initialized);},[O,N]),Ge.useEffect(()=>{let{onDragMove:pe}=K.current,{active:Se,activatorEvent:ke,collisions:lt,over:Ae}=Ne.current;if(!Se||!ke)return;let Fe={active:Se,activatorEvent:ke,collisions:lt,delta:{x:st.x,y:st.y},over:Ae};reactDom.unstable_batchedUpdates(()=>{pe?.(Fe),x({type:"onDragMove",event:Fe});});},[st.x,st.y]),Ge.useEffect(()=>{let{active:pe,activatorEvent:Se,collisions:ke,droppableContainers:lt,scrollAdjustedTranslate:Ae}=Ne.current;if(!pe||A.current==null||!Se||!Ae)return;let{onDragOver:Fe}=K.current,_e=lt.get(_),Bt=_e&&_e.rect.current?{id:_e.id,rect:_e.rect.current,data:_e.data,disabled:_e.disabled}:null,de={active:pe,activatorEvent:Se,collisions:ke,delta:{x:Ae.x,y:Ae.y},over:Bt};reactDom.unstable_batchedUpdates(()=>{br(Bt),Fe?.(de),x({type:"onDragOver",event:de});});},[_]),Be(()=>{Ne.current={activatorEvent:P,active:M,activeNode:xe,collisionRect:E,collisions:W,droppableRects:ie,draggableNodes:S,draggingNode:at,draggingNodeRect:it,droppableContainers:R,over:ye,scrollableAncestors:Ce,scrollAdjustedTranslate:st},F.current={initial:it,translated:E};},[M,xe,W,E,S,at,it,ie,R,ye,Ce,st]),ls({...je,delta:I,draggingRect:E,pointerCoordinates:fr,scrollableAncestors:Ce,scrollableAncestorRects:bt});let Ma=Ge.useMemo(()=>({active:M,activeNode:xe,activeNodeRect:O,activatorEvent:P,collisions:W,containerNodeRect:Mt,dragOverlay:re,draggableNodes:S,droppableContainers:R,droppableRects:ie,over:ye,measureDroppableContainers:Xe,scrollableAncestors:Ce,scrollableAncestorRects:bt,measuringConfiguration:U,measuringScheduled:ot,windowRect:$t}),[M,xe,O,P,W,Mt,re,S,R,ie,ye,Xe,Ce,bt,U,ot,$t]),$a=Ge.useMemo(()=>({activatorEvent:P,activators:mo,active:M,activeNodeRect:O,ariaDescribedById:{draggable:Y},dispatch:f,draggableNodes:S,over:ye,measureDroppableContainers:Xe}),[P,mo,M,O,f,Y,S,ye,Xe]);return Ge__default.default.createElement(ta.Provider,{value:y},Ge__default.default.createElement(Vr.Provider,{value:$a},Ge__default.default.createElement(ya.Provider,{value:Ma},Ge__default.default.createElement(ba.Provider,{value:se},c)),Ge__default.default.createElement(Ts,{disabled:s?.restoreFocus===false})),Ge__default.default.createElement($i,{...s,hiddenTextDescribedById:Y}));function La(){let pe=D?.autoScrollEnabled===false,Se=typeof l=="object"?l.enabled===false:l===false,ke=h&&!pe&&!Se;return typeof l=="object"?{...l,enabled:ke}:{enabled:ke}}}),$s=Ge.createContext(null),ea="button",Ls="Draggable";function xa(e){let{id:t,data:r,disabled:a=false,attributes:o}=e,i=It(Ls),{activators:n,activatorEvent:s,active:l,activeNodeRect:c,ariaDescribedById:d,draggableNodes:u,over:p}=Ge.useContext(Vr),{role:g=ea,roleDescription:b="draggable",tabIndex:v=0}=o??{},w=l?.id===t,f=Ge.useContext(w?ba:$s),[x,y]=ir(),[N,C]=ir(),h=ws(n,t),k=qt(r);Be(()=>(u.set(t,{id:t,key:i,node:x,activatorNode:N,data:k}),()=>{let I=u.get(t);I&&I.key===i&&u.delete(t);}),[u,t]);let S=Ge.useMemo(()=>({role:g,tabIndex:v,"aria-disabled":a,"aria-pressed":w&&g===ea?true:void 0,"aria-roledescription":b,"aria-describedby":d.draggable}),[a,g,v,w,b,d.draggable]);return {active:l,activatorEvent:s,activeNodeRect:c,attributes:S,isDragging:w,listeners:a?void 0:h,node:x,over:p,setNodeRef:y,setActivatorNodeRef:C,transform:f}}function va(){return Ge.useContext(ya)}var Bs="Droppable",zs={timeout:25};function wa(e){let{data:t,disabled:r=false,id:a,resizeObserverConfig:o}=e,i=It(Bs),{active:n,dispatch:s,over:l,measureDroppableContainers:c}=Ge.useContext(Vr),d=Ge.useRef({disabled:r}),u=Ge.useRef(false),p=Ge.useRef(null),g=Ge.useRef(null),{disabled:b,updateMeasurementsFor:v,timeout:w}={...zs,...o},f=qt(v??a),x=Ge.useCallback(()=>{if(!u.current){u.current=true;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{c(Array.isArray(f.current)?f.current:[f.current]),g.current=null;},w);},[w]),y=qr({callback:x,disabled:b||!n}),N=Ge.useCallback((S,I)=>{y&&(I&&(y.unobserve(I),u.current=false),S&&y.observe(S));},[y]),[C,h]=ir(N),k=qt(t);return Ge.useEffect(()=>{!y||!C.current||(y.disconnect(),u.current=false,y.observe(C.current));},[C,y]),Ge.useEffect(()=>(s({type:oe.RegisterDroppable,element:{id:a,key:i,disabled:r,node:C,rect:p,data:k}}),()=>s({type:oe.UnregisterDroppable,key:i,id:a})),[a]),Ge.useEffect(()=>{r!==d.current.disabled&&(s({type:oe.SetDroppableDisabled,id:a,key:i,disabled:r}),d.current.disabled=r);},[a,i,r,s]),{active:n,rect:p,isOver:l?.id===a,node:C,over:l,setNodeRef:h}}function Ca(e,t,r){let a=e.slice();return a.splice(r<0?a.length+r:r,0,a.splice(t,1)[0]),a}function Us(e,t){return e.reduce((r,a,o)=>{let i=t.get(a);return i&&(r[o]=i),r},Array(e.length))}function Yr(e){return e!==null&&e>=0}function Ws(e,t){if(e===t)return true;if(e.length!==t.length)return false;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return false;return true}function js(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}var Sa=e=>{let{rects:t,activeIndex:r,overIndex:a,index:o}=e,i=Ca(t,a,r),n=t[o],s=i[o];return !s||!n?null:{x:s.left-n.left,y:s.top-n.top,scaleX:s.width/n.width,scaleY:s.height/n.height}};var Gr={scaleX:1,scaleY:1},ka=e=>{var t;let{activeIndex:r,activeNodeRect:a,index:o,rects:i,overIndex:n}=e,s=(t=i[r])!=null?t:a;if(!s)return null;if(o===r){let c=i[n];return c?{x:0,y:r<n?c.top+c.height-(s.top+s.height):c.top-s.top,...Gr}:null}let l=_s(i,o,r);return o>r&&o<=n?{x:0,y:-s.height-l,...Gr}:o<r&&o>=n?{x:0,y:s.height+l,...Gr}:{x:0,y:0,...Gr}};function _s(e,t,r){let a=e[t],o=e[t-1],i=e[t+1];return a?r<t?o?a.top-(o.top+o.height):i?i.top-(a.top+a.height):0:i?i.top-(a.top+a.height):o?a.top-(o.top+o.height):0:0}var Fa="Sortable",Da=Ge__default.default.createContext({activeIndex:-1,containerId:Fa,disableTransforms:false,items:[],overIndex:-1,useDragOverlay:false,sortedRects:[],strategy:Sa,disabled:{draggable:false,droppable:false}});function Ia(e){let{children:t,id:r,items:a,strategy:o=Sa,disabled:i=false}=e,{active:n,dragOverlay:s,droppableRects:l,over:c,measureDroppableContainers:d}=va(),u=It(Fa,r),p=s.rect!==null,g=Ge.useMemo(()=>a.map(h=>typeof h=="object"&&"id"in h?h.id:h),[a]),b=n!=null,v=n?g.indexOf(n.id):-1,w=c?g.indexOf(c.id):-1,f=Ge.useRef(g),x=!Ws(g,f.current),y=w!==-1&&v===-1||x,N=js(i);Be(()=>{x&&b&&d(g);},[x,g,b,d]),Ge.useEffect(()=>{f.current=g;},[g]);let C=Ge.useMemo(()=>({activeIndex:v,containerId:u,disabled:N,disableTransforms:y,items:g,overIndex:w,useDragOverlay:p,sortedRects:Us(g,l),strategy:o}),[v,u,N.draggable,N.droppable,y,g,w,l,p,o]);return Ge__default.default.createElement(Da.Provider,{value:C},t)}var qs=e=>{let{id:t,items:r,activeIndex:a,overIndex:o}=e;return Ca(r,a,o).indexOf(t)},Vs=e=>{let{containerId:t,isSorting:r,wasDragging:a,index:o,items:i,newIndex:n,previousItems:s,previousContainerId:l,transition:c}=e;return !c||!a||s!==i&&o===n?false:r?true:n!==o&&t===l},Ys={duration:200,easing:"ease"},Ea="transform",Gs=ft.Transition.toString({property:Ea,duration:0,easing:"linear"}),Xs={roleDescription:"sortable"};function Ks(e){let{disabled:t,index:r,node:a,rect:o}=e,[i,n]=Ge.useState(null),s=Ge.useRef(r);return Be(()=>{if(!t&&r!==s.current&&a.current){let l=o.current;if(l){let c=Pt(a.current,{ignoreTransform:true}),d={x:l.left-c.left,y:l.top-c.top,scaleX:l.width/c.width,scaleY:l.height/c.height};(d.x||d.y)&&n(d);}}r!==s.current&&(s.current=r);},[t,r,a,o]),Ge.useEffect(()=>{i&&n(null);},[i]),i}function Ra(e){let{animateLayoutChanges:t=Vs,attributes:r,disabled:a,data:o,getNewIndex:i=qs,id:n,strategy:s,resizeObserverConfig:l,transition:c=Ys}=e,{items:d,containerId:u,activeIndex:p,disabled:g,disableTransforms:b,sortedRects:v,overIndex:w,useDragOverlay:f,strategy:x}=Ge.useContext(Da),y=Js(a,g),N=d.indexOf(n),C=Ge.useMemo(()=>({sortable:{containerId:u,index:N,items:d},...o}),[u,o,N,d]),h=Ge.useMemo(()=>d.slice(d.indexOf(n)),[d,n]),{rect:k,node:S,isOver:I,setNodeRef:R}=wa({id:n,data:C,disabled:y.droppable,resizeObserverConfig:{updateMeasurementsFor:h,...l}}),{active:m,activatorEvent:F,activeNodeRect:M,attributes:A,setNodeRef:D,listeners:T,isDragging:P,over:z,setActivatorNodeRef:K,transform:Y}=xa({id:n,data:C,attributes:{...Xs,...r},disabled:y.draggable}),Te=Lo(R,D),U=!!m,ie=U&&!b&&Yr(p)&&Yr(w),Xe=!f&&P,ot=Xe&&ie?Y:null,At=ie?ot??(s??x)({rects:v,activeNodeRect:M,activeIndex:p,overIndex:w,index:N}):null,je=Yr(p)&&Yr(w)?i({id:n,items:d,activeIndex:p,overIndex:w}):N,fe=m?.id,O=Ge.useRef({activeId:fe,items:d,newIndex:je,containerId:u}),Mt=d!==O.current.items,Ne=t({active:m,containerId:u,isDragging:P,isSorting:U,id:n,index:N,items:d,newIndex:O.current.newIndex,previousItems:O.current.items,previousContainerId:O.current.containerId,transition:c,wasDragging:O.current.activeId!=null}),J=Ks({disabled:!Ne,index:N,node:S,rect:k});return Ge.useEffect(()=>{U&&O.current.newIndex!==je&&(O.current.newIndex=je),u!==O.current.containerId&&(O.current.containerId=u),d!==O.current.items&&(O.current.items=d);},[U,je,u,d]),Ge.useEffect(()=>{if(fe===O.current.activeId)return;if(fe!=null&&O.current.activeId==null){O.current.activeId=fe;return}let at=setTimeout(()=>{O.current.activeId=fe;},50);return ()=>clearTimeout(at)},[fe]),{active:m,activeIndex:p,attributes:A,data:C,rect:k,index:N,newIndex:je,items:d,isOver:I,isSorting:U,isDragging:P,listeners:T,node:S,overIndex:w,over:z,setNodeRef:Te,setActivatorNodeRef:K,setDroppableNodeRef:R,setDraggableNodeRef:D,transform:J??At,transition:re()};function re(){if(J||Mt&&O.current.newIndex===N)return Gs;if(!(Xe&&!sr(F)||!c)&&(U||Ne))return ft.Transition.toString({...c,property:Ea})}}function Js(e,t){var r,a;return typeof e=="boolean"?{draggable:e,droppable:false}:{draggable:(r=e?.draggable)!=null?r:t.draggable,droppable:(a=e?.droppable)!=null?a:t.droppable}}[B.Down,B.Right,B.Up,B.Left];function Zs({field:e,value:t,error:r,onChange:a,businessId:o,formId:i,styling:n}){let{attributes:s,listeners:l,setNodeRef:c,transform:d,transition:u,isDragging:p}=Ra({id:e.id}),g={transform:ft.Transform.toString(d),transition:u,opacity:p?.5:1};return jsxRuntime.jsxs("div",{ref:c,style:g,className:`relative group ${p?"z-50":""}`,children:[jsxRuntime.jsx("div",{...s,...l,className:"absolute -left-8 top-1/2 -translate-y-1/2 z-50 opacity-0 group-hover:opacity-100 transition-opacity cursor-grab active:cursor-grabbing",onClick:b=>b.stopPropagation(),children:jsxRuntime.jsx("div",{className:"flex items-center gap-1 bg-[#BCB4FF] text-black px-1.5 py-1 rounded-md shadow-lg border border-black/10",children:jsxRuntime.jsx(lucideReact.GripVertical,{className:"w-3 h-3"})})}),jsxRuntime.jsx("div",{className:"absolute inset-0 pointer-events-none transition-all rounded-lg group-hover:border border-[#BCB4FF]/30"}),jsxRuntime.jsx("div",{style:{pointerEvents:"auto"},children:jsxRuntime.jsx(Pr,{field:e,value:t,error:r,onChange:a,businessId:o,formId:i,styling:n})})]})}function Jr({block:e,formData:t,errors:r,onChange:a,businessId:o,formId:i,styling:n,previewMode:s,onFieldReorder:l}){let c=na(ra(Xt,{activationConstraint:{distance:8}})),d=u=>{let{active:p,over:g}=u;if(g&&p.id!==g.id&&l&&e.fields){let b=e.fields.findIndex(w=>w.id===p.id),v=e.fields.findIndex(w=>w.id===g.id);l(e.id,b,v);}};if(e.type==="section"){let u=e.fields||[];return s&&l?jsxRuntime.jsxs("div",{className:"border rounded-lg p-6",style:{backgroundColor:n?.sectionBackground||"#FFFFFF",borderColor:n?.fieldBorder?`${n.fieldBorder}30`:"#E5E7EB"},children:[e.title&&jsxRuntime.jsx("h2",{className:"text-xl font-semibold mb-2",style:{color:n?.labelColor||"#000000"},children:e.title}),e.description&&jsxRuntime.jsx("p",{className:"text-sm mb-6",style:{color:n?.textColor||"#000000"},children:e.description}),jsxRuntime.jsx(ha,{sensors:c,collisionDetection:aa,onDragEnd:d,children:jsxRuntime.jsx(Ia,{items:u.map(p=>p.id),strategy:ka,children:jsxRuntime.jsx("div",{className:"space-y-4",children:u.map(p=>jsxRuntime.jsx(Zs,{field:p,value:t[p.id],error:r[p.id],onChange:g=>a(p.id,g,p),businessId:o,formId:i,styling:n},p.id))})})})]}):jsxRuntime.jsxs("div",{className:"border rounded-lg p-6",style:{backgroundColor:n?.sectionBackground||"#FFFFFF",borderColor:n?.fieldBorder?`${n.fieldBorder}30`:"#E5E7EB"},children:[e.title&&jsxRuntime.jsx("h2",{className:"text-xl font-semibold mb-2",style:{color:n?.labelColor||"#000000"},children:e.title}),e.description&&jsxRuntime.jsx("p",{className:"text-sm mb-6",style:{color:n?.textColor||"#000000"},children:e.description}),jsxRuntime.jsx("div",{className:"space-y-4",children:u.map(p=>jsxRuntime.jsx(Pr,{field:p,value:t[p.id],error:r[p.id],onChange:g=>a(p.id,g,p),businessId:o,formId:i,styling:n},p.id))})]})}if(e.type==="text"){let u={left:"text-left",center:"text-center",right:"text-right"}[e.alignment||"left"];return jsxRuntime.jsx("div",{className:`prose prose-gray max-w-none ${u}`,children:jsxRuntime.jsx("p",{className:"whitespace-pre-wrap",style:{color:n?.textColor||"#000000"},children:e.content})})}if(e.type==="image"&&e.imageUrl){let u=e.imageSize||"medium",p=u==="full",g=p?"":{left:"mr-auto",center:"mx-auto",right:"ml-auto"}[e.alignment||"center"],b={small:"300px",medium:"500px",large:"700px"},v=p?"none":b[u]||b.medium,w={none:"0",sm:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem",full:"9999px"},f=w[e.borderRadius]||w.lg,x={maxWidth:v,...p&&{width:"100vw",marginLeft:"50%",transform:"translateX(-50%)"}};return jsxRuntime.jsx("div",{className:g,style:x,children:jsxRuntime.jsx("img",{src:e.imageUrl,alt:"",className:"w-full h-auto",style:{borderRadius:f,objectFit:"cover"}})})}return null}function co(e,t){if(t.required){if(e==null||e==="")return {isValid:false,error:`${t.label} is required`};if(Array.isArray(e)&&e.length===0)return {isValid:false,error:`Please select at least one ${t.label.toLowerCase()}`};if(t.type==="photo"&&!e.data)return {isValid:false,error:`${t.label} is required`}}if(t.type==="email"&&e&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e))return {isValid:false,error:"Please enter a valid email address"};if(t.type==="tel"&&e&&(!/^[\d\s\-\+\(\)]+$/.test(e)||e.replace(/\D/g,"").length<10))return {isValid:false,error:"Please enter a valid phone number"};if(t.type==="date"&&e){let r=new Date(e);if(isNaN(r.getTime()))return {isValid:false,error:"Please enter a valid date"}}return {isValid:true}}function Ta(e,t){let r={},a=true;return t.forEach(o=>{let i=co(e[o.id],o);!i.isValid&&i.error&&(r[o.id]=i.error,a=false);}),{isValid:a,errors:r}}function $u(e){let t={};return Object.keys(e).forEach(r=>{let a=e[r];typeof a=="string"?t[r]=a.trim():(Array.isArray(a)||a&&typeof a=="object"&&a.data,t[r]=a);}),t}function Pa({form:e,businessId:t,onSuccess:r}){let[a,o]=Ge.useState({}),[i,n]=Ge.useState({}),[s,l]=Ge.useState(false),[c,d]=Ge.useState(false),[u,p]=Ge.useState(null),g=(x,y,N)=>{if(o(C=>({...C,[x]:y})),i[x]){let C=co(y,N);n(h=>{let k={...h};return C.isValid?delete k[x]:k[x]=C.error||"",k});}},b=async x=>{x.preventDefault(),p(null);let y=[];e.settings.blocks.forEach(C=>{C.type==="section"&&C.fields&&y.push(...C.fields);});let N=Ta(a,y);if(!N.isValid){n(N.errors);return}l(true);try{let h=typeof window<"u"&&undefined?"/api/forms/submit":`/api/studio/forms/${t}/${e.slug}/submit`,k=await fetch(h,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({formId:e.id,slug:e.slug,data:a})});if(!k.ok){let S=await k.json();throw new Error(S.message||"Failed to submit form")}d(!0),o({}),n({}),r&&r();}catch(C){console.error("Form submission error:",C),p(C.message||"Failed to submit form. Please try again.");}finally{l(false);}};if(c)return jsxRuntime.jsx("div",{className:"max-w-2xl mx-auto px-4 py-12",children:jsxRuntime.jsxs("div",{className:"bg-green-50 border border-green-200 rounded-lg p-8 text-center",children:[jsxRuntime.jsx("div",{className:"w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-4",children:jsxRuntime.jsx("svg",{className:"w-8 h-8 text-green-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),jsxRuntime.jsx("h3",{className:"text-xl font-semibold mb-2",style:{color:e.settings.styling?.labelColor||"#000000"},children:"Success!"}),jsxRuntime.jsx("p",{style:{color:e.settings.styling?.textColor||"#000000"},children:e.settings.successMessage}),jsxRuntime.jsx("button",{onClick:()=>d(false),className:"mt-6 px-4 py-2 bg-gray-900 text-white rounded-lg hover:bg-gray-800 transition-colors",children:"Submit Another Response"})]})});let v=e.settings.styling?.alignment||"left",w=v==="center"?"text-center":v==="right"?"text-right":"text-left",f=e.settings.styling?.buttonColor||"#CAC426";return jsxRuntime.jsxs("div",{className:"max-w-2xl mx-auto px-4 py-12",children:[jsxRuntime.jsxs("div",{className:`mb-8 ${w}`,children:[jsxRuntime.jsx("h1",{className:"text-3xl font-bold mb-2",style:{color:e.settings.styling?.textColor||"#000000"},children:e.settings.title}),e.settings.description&&jsxRuntime.jsx("p",{style:{color:e.settings.styling?.textColor||"#000000"},children:e.settings.description})]}),jsxRuntime.jsxs("form",{onSubmit:b,className:"space-y-8",children:[e.settings.blocks.map(x=>jsxRuntime.jsx(Jr,{block:x,formData:a,errors:i,onChange:g,businessId:t,formId:e.id,styling:e.settings.styling},x.id)),u&&jsxRuntime.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:jsxRuntime.jsx("p",{className:"text-sm text-red-600",children:u})}),jsxRuntime.jsx("div",{className:"pt-6",children:jsxRuntime.jsx("button",{type:"submit",disabled:s,className:"w-full px-6 py-3 text-white rounded-lg disabled:opacity-50 disabled:cursor-not-allowed transition-all font-medium hover:opacity-90",style:{backgroundColor:f},children:s?"Submitting...":e.settings.submitButtonText})})]})]})}exports.About=dn;exports.AddonsSelection=Wn;exports.BeforeAfter=Cn;exports.BookingFlow=Ro;exports.BookingSection=En;exports.BottomSheet=jn;exports.CYCLE_PHASES=Io;exports.Confirmation=Yn;exports.Contact=yn;exports.ContactForm=Vn;exports.CycleAwareDateSelection=pi;exports.DateSelection=nr;exports.FAQSection=$n;exports.FeatureContent=wn;exports.FeaturedLink=on;exports.FixedInfoCard=In;exports.FormBlock=Jr;exports.FormRenderer=Pa;exports.Gallery=mn;exports.Header=nn;exports.Hero=cn;exports.HoldTimer=Rr;exports.ImageSection=Mn;exports.InstagramFeed=Fn;exports.LinkList=sn;exports.LocationMap=An;exports.Logo=tn;exports.MinimalFooter=vn;exports.MinimalHeader=bn;exports.MinimalNavigation=xn;exports.Navbar=Bn;exports.PricingTable=Sn;exports.ScrollingTextDivider=Pn;exports.SectionRenderer=yi;exports.ServiceSelection=On;exports.ServicesPreview=un;exports.SocialBar=ln;exports.Team=fn;exports.Testimonials=gn;exports.TextSection=zn;exports.TimeSelection=Hn;exports.VideoSection=Rn;exports.animations=rr;exports.createEntranceAnimation=ge;exports.createStaggerAnimation=zc;exports.getAnimationDuration=$c;exports.getFadeVariants=Qa;exports.getSlideVariants=Ja;exports.getTransitionVariants=Lc;exports.sanitizeFormData=$u;exports.shouldReduceMotion=Bc;exports.validateField=co;exports.validateForm=Ta;//# sourceMappingURL=index.js.map
22
22
  //# sourceMappingURL=index.js.map