PageSourceSearch

https://bestaiphotoeditor.app/_next/static/chunks/app/%5Blocale%5D/page-ba9cd42c776c85b4.js

js bestaiphotoeditor.app collected 2026-10-01 23:45:38 UTC 184,302 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[465],{2147:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>w});var a=r(80735),s=r(14679),l=r(1801),n=r(43506),i=r(83239),o=r(49009),d=r(24859),c=r(5322),u=r(60726),m=r(70060),x=r(83563),p=r(49630);r(43779);var g=r(55431),f=r(17527);let b={video:{tabs:["tabs.video"],descriptions:["descriptions.video"]},editor:{tabs:["tabs.image","tabs.editor"],descriptions:["descriptions.image","descriptions.editor"]}};function h(e,t){if("makerai"===t)switch(e){case"video":return"/ai-video-generator";case"editor":return"/ai-image-generator"}if("aidance"===t)switch(e){case"video":return"/photo-to-video-ai";case"editor":return null}if("museaiimage"===t)switch(e){case"video":return"/meta-ai-video-generator";case"editor":return"/meta-ai-image-generator"}switch(e){case"video":return(0,f.H)(t);case"editor":return"/image-to-image-ai"}}let v=(0,n.default)(()=>Promise.resolve().then(r.bind(r,43956)),{loadableGenerated:{webpack:()=>[43956]},loading:()=>(0,a.jsx)("div",{className:"min-h-[360px] rounded-xl border border-border/40 bg-muted/20 animate-pulse"})}),j=(0,n.default)(()=>Promise.all([r.e(2363),r.e(4823),r.e(2051)]).then(r.bind(r,74823)).then(e=>({default:e.VideoToolSwitchShell})),{loadableGenerated:{webpack:()=>[74823]},loading:()=>(0,a.jsx)("div",{className:"min-h-[360px] rounded-xl border border-border/40 bg-muted/20 animate-pulse"})}),N=(0,n.default)(()=>Promise.all([r.e(2192),r.e(8208)]).then(r.bind(r,62192)).then(e=>({default:e.default})),{loadableGenerated:{webpack:()=>[62192]},loading:()=>(0,a.jsx)("div",{className:"min-h-[360px] rounded-xl border border-border/40 bg-muted/20 animate-pulse"})});function w(e){var t,r;let{newImgGenConfig:n,videoConfig:f,defaultTab:w="editor",videoTabMode:y="video-generator",motionTransferConfig:_}=e,k=(0,l.c)("HomePage.AIToolTabs"),C=(0,l.c)("VideoGenerator"),A=(0,s.useMemo)(()=>{let e=new Set((0,m.nQ)()),t=(e,t)=>{let r=b[e][t];for(let e of r)if(k.has(e))return k(e);return k(r[r.length-1])};var r=[{id:"video",label:t("video","tabs"),icon:i.A,dashboardLink:h("video",u.CQ.siteId),description:t("video","descriptions")},{id:"editor",label:t("editor","tabs"),icon:o.A,dashboardLink:h("editor",u.CQ.siteId),description:t("editor","descriptions")}].filter(t=>e.has(t.id));if(!w)return[...r];let a=r.findIndex(e=>e.id===w);return a<=0?[...r]:[r[a],...r.slice(0,a),...r.slice(a+1)]},[w,k]),P=null!==(r=null===(t=A[0])||void 0===t?void 0:t.id)&&void 0!==r?r:null,S=A.some(e=>e.id===w)?w:P,[L,M]=(0,s.useState)(S),[I,E]=(0,s.useState)(()=>S?[S]:[]);(0,s.useEffect)(()=>{let e=new Set(A.map(e=>e.id));M(t=>t&&e.has(t)?t:S)},[S,A]),(0,s.useEffect)(()=>{let e=new Set(A.map(e=>e.id));E(t=>{let r=t.filter(t=>e.has(t)),a=null!=L?L:S;return a&&!r.includes(a)&&r.push(a),r})},[L,S,A]);let z=(0,s.useMemo)(()=>(function(){var e,t,r,a;let s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=(0,g.Y8)(s.enabledModels||(0,p.jk)().map(e=>e.id),null===(e=u.CQ.models)||void 0===e?void 0:e.video),n=s.defaultMode||(null===(t=u.CQ.models)||void 0===t?void 0:t.defaultVideoMode)||"image-to-video",i=function(e,t,r){for(let a of e)if(a&&(0,g.O$)(a,r)&&(!(null==t?void 0:t.length)||t.includes(a)))return a;return null==t?void 0:t[0]}([s.defaultModel,null===(r=u.CQ.models)||void 0===r?void 0:r.defaultVideoModel],l,null===(a=u.CQ.models)||void 0===a?void 0:a.video),o={...p.oV.getUIConfig({enabledModels:l,defaultMode:n,defaultModel:i})};return s.pageTitle&&(o.pageTitle=s.pageTitle),s.taskPreset&&(o.taskPreset=s.taskPreset),{config:o,defaultMode:n,defaultModel:i,enabledModels:l}})({defaultMode:(null==f?void 0:f.defaultMode)||"image-to-video",defaultModel:null==f?void 0:f.defaultModel,enabledModels:null==f?void 0:f.enabledModels}).config,[null==f?void 0:f.defaultMode,null==f?void 0:f.defaultModel,null==f?void 0:f.enabledModels]),R=(0,s.useMemo)(()=>{let e={...z,taskPreset:"standard"},t={...z,taskPreset:"fixed-frames"},r={...z,taskPreset:"video-to-video"};return[{toolSlug:"image-to-video-ai",label:C("ui.tool_switcher.text_image_to_video"),config:e,defaultMode:(null==f?void 0:f.defaultMode)||"image-to-vi
1deo",defaultModel:null==f?void 0:f.defaultModel,defaultPrompt:null==f?void 0:f.defaultPrompt},{toolSlug:"fixed-first-and-last-frames",label:C("ui.tool_switcher.frames_to_video"),config:t,defaultMode:"image-to-video",defaultModel:null==f?void 0:f.defaultModel},{toolSlug:"video-to-video-ai",label:C("ui.tool_switcher.video_to_video"),config:r,defaultMode:"image-to-video",defaultModel:null==f?void 0:f.defaultModel}]},[z,null==f?void 0:f.defaultMode,null==f?void 0:f.defaultModel,null==f?void 0:f.defaultPrompt,C]),U=A.find(e=>e.id===L);return 0!==A.length&&U?(0,a.jsxs)("div",{className:"w-full max-w-7xl mx-auto space-y-4",children:[(0,a.jsx)("div",{className:"flex justify-center",children:(0,a.jsxs)("div",{className:"inline-flex w-full items-center gap-1 rounded-2xl border border-border bg-card/70 p-1 shadow-sm backdrop-blur-sm sm:w-auto",children:[A.map(e=>{let t=e.icon,r=L===e.id;return(0,a.jsxs)("button",{onClick:()=>M(e.id),className:(0,x.cn)("flex h-10 min-w-0 flex-1 items-center justify-center gap-2 rounded-xl px-4 text-sm font-medium transition-all duration-200 sm:flex-none sm:px-5",r?"border border-border bg-background text-foreground shadow-sm":"text-muted-foreground hover:bg-muted/50 hover:text-foreground"),children:[(0,a.jsx)(t,{className:(0,x.cn)("h-4 w-4",r?"text-primary":"opacity-70")}),(0,a.jsx)("span",{children:e.label})]},e.id)}),(null==U?void 0:U.dashboardLink)&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"mx-1 hidden h-6 w-px bg-border/60 sm:block"}),(0,a.jsx)(c.PublicLink,{href:U.dashboardLink,"aria-label":k("view_on_dashboard"),
1className:"ml-auto inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-xl text-muted-foreground transition-colors hover:bg-background/70 hover:text-foreground sm:ml-0",children:(0,a.jsx)(d.A,{className:"h-4 w-4"})})]})]})}),(0,a.jsxs)("div",{className:"w-full animate-in fade-in zoom-in-98 duration-200",children:[I.includes("editor")?(0,a.jsx)("div",{className:(0,x.cn)("editor"===L?"block":"hidden"),"aria-hidden":"editor"!==L,children:(0,a.jsx)(v,{config:{...n,layout:{mode:"compact",fullHeight:!1,spacing:"tight",border:!0,shadow:!0}}})}):null,I.includes("video")?(0,a.jsx)("div",{className:(0,x.cn)("video"===L?"block":"hidden"),"aria-hidden":"video"!==L,children:"motion-transfer"===y?(0,a.jsx)(N,{config:_}):(0,a.jsx)(j,{items:R,defaultToolSlug:"image-to-video-ai"})}):null]})]}):null}},3425:(e,t,r)=>{Promise.resolve().then(r.bind(r,44989)),Promise.resolve().then(r.bind(r,9670)),Promise.resolve().then(r.bind(r,2147)),Promise.resolve().then(r.bind(r,69029)),Promise.resolve().then(r.bind(r,99299)),Promise.resolve().then(r.bind(r,75958)),Promise.resolve().then(r.bind(r,92139)),Promise.resolve().then(r.bind(r,83893)),Promise.resolve().then(r.bind(r,17635)),Promise.resolve().then(r.bind(r,68617)),Promise.resolve().then(r.bind(r,42429)),Promise.resolve().then(r.bind(r,42096)),Promise.resolve().then(r.bind(r,54887)),Promise.resolve().then(r.bind(r,62057)),Promise.resolve().then(r.bind(r,9018)),Promise.resolve().then(r.bind(r,80756)),Promise.resolve().then(r.bind(r,54702)),Promise.resolve().then(r.bind(r,84871)),Promise.resolve().then(r.bind(r,3820)),Promise.resolve().then(r.bind(r,34801)),Promise.resolve().then(r.bind(r,61422)),Promise.resolve().then(r.bind(r,17856)),Promise.resolve().then(r.bind(r,58694)),Promise.resolve().then(r.bind(r,77724)),Promise.resolve().then(r.bind(r,69520)),Promise.resolve().then(r.bind(r,92053)),Promise.resolve().then(r.bind(r,59188)),Promise.resolve().then(r.bind(r,75264)),Promise.resolve().then(r.bind(r,1594)),Promise.resolve().then(r.bind(r,97080)),Promise.resolve().then(r.bind(r,93991)),Promise.resolve().then(r.bind(r,68758)),Promise.resolve().then(r.bind(r,40360)),Promise.resolve().then(r.bind(r,25987)),Promise.resolve().then(r.bind(r,25815)),Promise.resolve().then(r.bind(r,87171)),Promise.resolve().then(r.bind(r,73683)),Promise.resolve().then(r.bind(r,7874)),Promise.resolve().then(r.bind(r,39705)),Promise.resolve().then(r.bind(r,26688)),Promise.resolve().then(r.bind(r,23354)),Promise.resolve().then(r.bind(r,60569)),Promise.resolve().then(r.bind(r,5322)),Promise.resolve().then(r.t.bind(r,25711,23)),Promise.resolve().then(r.bind(r,5104)),Promise.resolve().then(r.bind(r,68610)),Promise.resolve().then(r.bind(r,10241)),Promise.resolve().then(r.bind(r,28937)),Promise.resolve().then(r.bind(r,86129)),Promise.resolve().then(r.bind(r,36595)),Promise.resolve().then(r.bind(r,71168)),Promise.resolve().then(r.bind(r,78386)),Promise.resolve().then(r.bind(r,3461)),Promise.resolve().then(r.bind(r,88399)),Promise.resolve().then(r.t.bind(r,87304,23)),Promise.resolve().then(r.t.bind(r,87665,23))},7934:(e,t,r)=>{"use strict";r.d(t,{A:()=>s,aU:()=>n,bX:()=>o,pX:()=>l,zM:()=>i});let a="makerai:hero-product",s=8388608;function l(e){try{return window.sessionStorage.setItem(a,JSON.stringify(e)),!0}catch(e){return!1}}function n(){let e;try{(e=window.sessionStorage.getItem(a))&&window.sessionStorage.removeItem(a)}catch(e){return null}if(!e)return null;try{let t=JSON.parse(e);if("image"===t.kind&&t.dataUrl&&t.fileName||"url"===t.kind&&t.sourceUrl)return t;return null}catch(e){return null}}function i(e){return e.size>s?Promise.resolve(null):new Promise(t=>{let r=new FileReader;r.onload=()=>{t("string"==typeof r.result?r.result:null)},r.onerror=()=>
1t(null),r.readAsDataURL(e)})}function o(e,t){let r=/^data:([^;]+);base64,(.+)$/.exec(e);if(!r)return null;let[,a,s]=r;try{let e=atob(s),r=new Uint8Array(e.length);for(let t=0;t<e.length;t+=1)r[t]=e.charCodeAt(t);return new File([r],t,{type:a})}catch(e){return null}}},9018:(e,t,r)=>{"use strict";r.d(t,{default:()=>I});var a=r(80735),s=r(14679),l=r(13916),n=r(12164),i=r(6744),o=r(93430),d=r(83563);let c=s.forwardRef((e,t)=>{let{className:r,children:s,...l}=e;return(0,a.jsxs)(n.bL,{ref:t,className:(0,d.cn)("relative z-10 flex max-w-max flex-1 items-center justify-center",r),...l,children:[s,(0,a.jsx)(f,{})]})});c.displayName=n.bL.displayName;let u=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)(n.B8,{ref:t,className:(0,d.cn)("group flex flex-1 list-none items-center justify-center gap-1",r),...s})});u.displayName=n.B8.displayName;let m=n.q7,x=(0,i.F)("group inline-flex h-9 w-max items-center justify-center rounded-md px-4 py-2 text-sm font-medium transition-all duration-200 hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50"),p=s.forwardRef((e,t)=>{let{className:r,children:s,...l}=e;return(0,a.jsxs)(n.l9,{ref:t,className:(0,d.cn)(x(),"group",r),...l,children:[s," ",(0,a.jsx)(o.A,{className:"relative top-[1px] ml-1 h-3 w-3 transition-transform duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"})]})});p.displayName=n.l9.displayName;let g=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)(n.UC,{ref:t,className:(0,d.cn)("left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto",r),...s})});g.displayName=n.UC.displayName,n.N_;let f=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("div",{className:(0,d.cn)("absolute left-0 top-full flex justify-center"),children:(0,a.jsx)(n.LM,{className:(0,d.cn)("origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-lg border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]",r),ref:t,...s})})});f.displayName=n.LM.displayName,s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)(n.C1,{ref:t,className:(0,d.cn)("top-full z-1 flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in",r),...s,children:(0,a.jsx)("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"})})}).displayName=n.C1.displayName;var b=r(62017),h=r(60569),v=r(80291),j=r(5322),N=r(50020),w=r(8472),y=r(88003),_=r(62239),k=r(84733),C=r(1801),A=r(68610);let P=new Map(Object.values(N.C).flatMap(e=>"image"in e&&"string"==typeof e.image?[[e.href.replace(/\/$/,"")||"/",e.image]]:[]));function S(e){var t,r;let{item:s}=e,l=null===(t=s.image)||void 0===t?void 0:t.src,n=(s.url||"").replace(/\/$/,"")||"/",i=P.get(n),o=l||i;return(0,a.jsxs)(j.PublicLink,{className:(0,d.cn)("flex select-none gap-4 roun
1ded-md p-3 leading-none no-underline outline-hidden transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground"),href:s.url||"",target:s.target,children:[o?(0,a.jsx)(A.LocalizedImage,{src:o,alt:(null===(r=s.image)||void 0===r?void 0:r.alt)||s.title||"Model logo",width:20,height:20,className:"size-5 shrink-0 object-contain"}):s.icon&&(0,a.jsx)(h.default,{name:s.icon,className:"size-5 shrink-0","aria-hidden":"true"}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("div",{className:"text-sm font-semibold",children:s.title}),s.description&&(0,a.jsx)("p",{className:"text-sm leading-snug text-muted-foreground",children:s.description})]})]})}function L(e){let{item:t}=e;return(0,a.jsx)(j.PublicLink,{href:t.url||"",target:t.target,className:"flex min-h-11 items-center rounded-md border border-border/60 px-3 py-2 text-sm font-medium text-foreground transition-colors hover:bg-accent hover:text-accent-foreground",children:(0,a.jsx)("span",{className:"line-clamp-2",children:t.title})})}function M(e){var t,r,n,i,c,u,m,x,p,g,f,v,N;let{header:P,isHomePage:S,isScrolled:M,supportedLocales:I,variant:E="default"}=e,z=(0,C.c)("alt"),R=(0,C.c)("admin.sidebar"),[U,T]=(0,s.useState)(""),V="inline"===E?"pointer-events-auto flex items-center justify-between gap-3 px-1 py-1":(0,d.cn)("pointer-events-auto rounded-[20px] border px-4 py-2 shadow-[0_18px_40px_-28px_rgba(30,20,10,0.48)] transition-all duration-300",S&&!M?"border-border/35 bg-background/54 backdrop-blur-xl supports-[backdrop-filter]:bg-background/34":"border-border/60 bg-background/90 backdrop-blur-xl supports-[backdrop-filter]:bg-background/74");return(0,a.jsx)("div",{className:"block lg:hidden",children:(0,a.jsxs)("div",{className:(0,d.cn)("flex items-center justify-between gap-3",V),children:[(0,a.jsxs)(j.PublicLink,{href:(null===(t=P.brand)||void 0===t?void 0:t.url)||"/",className:"flex items-center gap-2",children:[(null===(n=P.brand)||void 0===n?void 0:null===(r=n.logo)||void 0===r?void 0:r.src)&&(0,a.jsx)(A.LocalizedImage,{src:P.brand.logo.src,alt:P.brand.logo.alt||P.brand.title||z("brand_logo"),width:32,height:32,className:"w-8 h-auto"}),(null===(i=P.brand)||void 0===i?void 0:i.title)&&(0,a.jsx)("span",{className:"text-base font-medium tracking-[-0.01em] text-foreground/88",children:(null===(c=P.brand)||void 0===c?void 0:c.title)||""})]}),(0,a.jsxs)(b.cj,{children:[(0,a.jsx)(b.CG,{asChild:!0,children:(0,a.jsx)(l.$,{variant:"ghost",size:"icon",className:"inline-flex h-10 w-10 items-center justify-center rounded-2xl border border-border/55 bg-background/72 text-foreground shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground","aria-label":R("menu"),title:R("menu"),children:(0,a.jsx)(y.A,{className:"size-4"})})}),(0,a.jsxs)(b.h,{className:"inset-y-2 right-2 h-auto max-h-[calc(100dvh-1rem)] w-[min(88vw,24rem)] overflow-y-auto rounded-2xl border border-border/70 bg-background/98 shadow-2xl backdrop-blur-sm sm:inset-y-0 sm:right-0 sm:h-full sm:max-h-none sm:w-3/4 sm:rounded-none sm:border-y-0 sm:border-r-0 sm:border-l sm:bg-background sm:shadow-lg sm:backdrop-blur-0",children:[(0,a.jsxs)(b.Fm,{className:"gap-2 border-b border-border/50 px-5 pb-4 pt-5 pr-14",children:[(0,a.jsx)(b.qp,{children:(0,a.jsxs)(j.PublicLink,{href:(null===(u=P.brand)||void 0===u?void 0:u.url)||"/",className:"flex items-center gap-2",children:[(null===(x=P.brand)||void 0===x?void 0:null===(m=x.logo)||void 0===m?void 0:m.src)&&(0,a.jsx)(A.LocalizedImage,{src:P.brand.logo.src,alt:P.brand.logo.alt||P.brand.title||z("brand_logo"),width:32,height:32,className:"w-8 h-auto"}),(null===(p=P.brand)||void 0===p?void 0:p.title)&&(0,a.jsx)("span",{className:"text-base font-medium tracking-[-0.01em] text-foreground/88",children:(null===(g=P.brand)||void 0===g?void 0:g.title)||""})]})}),(0,a.jsx)(b.Qs,{className:"sr-only",children:"Browse site navigation, product links, and account actions."})]}),(0,a.jsx)("div",{className:"flex flex-col gap-5 px-5 py-5",children:null===(v=P.nav)||void 0===v?void 0:null===(f=v.items)||void 0===f?void 0:f.map((e,t)=>{let r="mobile-nav-".concat(t),s=U===r;return e.categories&&e.categories.length>0?(0,a.jsxs)("div",{className:"border-b-0",children:[(0,a.jsxs)("button",{type:"button","aria-expanded":s,className:"flex min-h-11 w-full items-center justify-between rounded-lg px-1 text-left font-semibold",onClick:()=>T(e=>e===r?"":r),children:[(0,a.jsx)("span",{children:e.title}),(0,a.jsx)(o.A,{className:(0,d.cn)("size-4 shrink-0 transition-transform",s&&"rotate-180"),"aria-hidden":"true"})]}),s&&(0,a.jsx)("div",{className:"mt-3",children:e.categories.map((e,r)=>(0,a.jsxs)("div",{className:"mb-5 last:mb-0",role:"group","aria-labelledby":"mobile-category-".concat(t,"-").concat(r),children:[(0,a.jsx)("h4",{id:"mobile-category-".concat(t,"-").concat(r),className:"mb-3 px-1 text-xs font-semibold uppercase tracking-[0.08em] text-muted-foreground",children:e.title||e.name}),(0,a.jsx)("div",{className:"grid grid-cols-1 gap-3 min-[360px]:grid-cols-2",children:e.items.filter(e=>null!=e).map(e=>(0,a.jsx)(L,{item:e},e.url||e.title))})]},e.name))})]},t):e.children&&e.children.length>0?(0,a.jsxs)("div",{className:"border-b-0",children:[(0,a.jsxs)("button",{type:"button","aria-expanded":s,className:"flex min-h-11 w-full items-center justify-between rounded-lg px-1 text-left font-semibold",onClick:()=>T(e=>e===r?"":r),children:[(0,a.jsx)("span",{children:e.title}),(0,a.jsx)(o.A,{className:(0,d.cn)("size-4 shrink-0 transition-transform",s&&"rotate-180"),"aria-hidden":"true"})]}),s&&(0,a.jsx)("div",{className:"mt-3 grid grid-cols-1 gap-3 min-[360px]:grid-cols-2",children:e.children.filter(e=>null!=e).map(e=>(0,a.jsx)(L,{item:e},e.url||e.title))})]},t):(0,a.jsxs)(j.PublicLink,{href:e.url||"",target:e.target,className:"flex min-h-11 items-center gap-2 rounded-lg px-3 font-semibold transition-colors hover:bg-accent/60",children:[e.icon&&(0,a.jsx)(h.default,{name:e.icon,className:"size-4 shrink-0","aria-hidden":"true"}),e.title]},t)})}),(0,a.jsx)("div",{className:"flex-1"}),(0,a.jsxs)("div",{className:"border-t border-border/50 px-5 pb-6 pt-4",children:[(0,a.jsxs)("div",{className:"mt-2 flex flex-col gap-3",children:[null===(N=P.buttons)||void 0===N?void 0:N.map((e,t)=>(0,a.jsx)(l.$,{variant:e.variant,asChild:!0,children:(0,a.jsxs)(j.PublicLink,{href:e.url||"",target:e.target||"",className:"flex items-center gap-1",children:[e.title,e.icon&&(0,a.jsx)(h.default,{name:e.icon,className:"size-4 shrink-0"})]})},t)),P.show_sign&&(0,a.jsx)(_.A,{})]}),(0,a.jsxs)("div",{className:"mt-4 flex items-center gap-2",children:[P.show_locale&&(0,a.jsx)(w.A,{supportedLocales:I}),(0,a.jsx)("div",{className:"flex-1"}),P.show_theme&&(0,a.jsx)(k.A,{})]})]})]})]})]})})}function I(e){var t,r,n,i,o,f,b,N;let{header:y,supportedLocales:P,variant:L="default"}=e,I=(0,C.c)("alt");(0,C.c)("admin.sidebar");
1let E="/"===(0,v.a8)(),[z,R]=(0,s.useState)(!1);if((0,s.useEffect)(()=>{let e=0,t=()=>{e=0;let t=window.scrollY>18;R(e=>e===t?e:t)};t();let r=()=>{0===e&&(e=window.requestAnimationFrame(t))};return window.addEventListener("scroll",r,{passive:!0}),()=>{0!==e&&window.cancelAnimationFrame(e),window.removeEventListener("scroll",r)}},[]),y.disabled)return null;let U="inline"===L,T=(0,d.cn)("z-50 w-full transition-all duration-300",U?(0,d.cn)("border-b border-border/60 bg-background/95 supports-[backdrop-filter]:bg-background/88","sticky top-0"):(0,d.cn)("pointer-events-none",E?"fixed inset-x-0 top-0":"sticky top-0")),V=U?"mx-auto hidden items-center justify-between px-2 py-1.5 lg:flex":(0,d.cn)("pointer-events-auto mx-auto hidden items-center justify-between rounded-[24px] border px-5 py-2 lg:flex","backdrop-blur-xl transition-[background-color,border-color,box-shadow] duration-300",E&&!z?"border-border/35 bg-background/90 shadow-[0_20px_48px_-32px_rgba(26,18,10,0.38)] supports-[backdrop-filter]:bg-background/78":"border-border/65 bg-background/92 shadow-[0_24px_56px_-34px_rgba(26,18,10,0.5)] supports-[backdrop-filter]:bg-background/78"),F="h-10 rounded-2xl bg-transparent px-3.5 text-[0.93rem] font-medium text-foreground/72 transition-all duration-200 hover:bg-foreground
1/[0.05] hover:text-foreground focus:bg-foreground/[0.05] focus:text-foreground data-[active]:bg-background/82 data-[active]:text-foreground data-[active]:shadow-sm data-[state=open]:bg-background/82 data-[state=open]:text-foreground data-[state=open]:shadow-sm",B=U?"flex shrink-0 items-center gap-1":(0,d.cn)("flex shrink-0 items-center gap-1 rounded-[16px] border px-1.5 py-0.5 shadow-[inset_0_1px_0_rgba(255,255,255,0.08)]",E&&!z?"border-border/30 bg-background/48 supports-[backdrop-filter]:bg-background/30":"border-border/50 bg-background/80 supports-[backdrop-filter]:bg-background/62");return(0,a.jsx)("section",{className:T,children:(0,a.jsxs)("div",{className:(0,d.cn)("container",U?"py-1.5":"pt-2.5 pb-1.5 sm:pt-3"),children:[(0,a.jsxs)("nav",{className:V,children:[(0,a.jsxs)("div",{className:"flex items-center gap-5",children:[(0,a.jsxs)(j.PublicLink,{href:(null===(t=y.brand)||void 0===t?void 0:t.url)||"/",className:"flex items-center gap-2",children:[(null===(n=y.brand)||void 0===n?void 0:null===(r=n.logo)||void 0===r?void 0:r.src)&&(0,a.jsx)(A.LocalizedImage,{src:y.brand.logo.src,alt:y.brand.logo.alt||y.brand.title||I("brand_logo"),width:32,height:32,className:"h-auto w-7"}),(null===(i=y.brand)||void 0===i?void 0:i.title)&&(0,a.jsx)("span",{className:"whitespace-nowrap text-[0.95rem] font-medium tracking-[-0.01em] text-foreground/84 sm:text-[1.18rem]",children:(null===(o=y.brand)||void 0===o?void 0:o.title)||""})]}),(0,a.jsx)("div",{className:"flex items-center",children:(0,a.jsx)(c,{children:(0,a.jsx)(u,{children:null===(b=y.nav)||void 0===b?void 0:null===(f=b.items)||void 0===f?void 0:f.map((e,t)=>e.categories&&e.categories.length>0?(0,a.jsxs)(m,{className:"text-muted-foreground",children:[(0,a.jsxs)(p,{className:F,children:[e.icon&&(0,a.jsx)(h.default,{name:e.icon,className:"size-4 shrink-0 mr-2","aria-hidden":"true"}),(0,a.jsx)("span",{children:e.title})]}),(0,a.jsx)(g,{children:(0,a.jsx)("div",{className:"w-[800px] max-w-[90vw] p-4 max-h-[600px] overflow-y-auto",children:e.categories.map((e,r)=>(0,a.jsxs)("div",{className:"mb-6 last:mb-0",role:"group","aria-labelledby":"category-".concat(t,"-").concat(r),children:[(0,a.jsx)("h3",{id:"category-".concat(t,"-").concat(r),className:"text-base font-bold capitalize text-foreground mb-3 px-1",children:e.title||e.name}),(0,a.jsx)("ul",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-3",children:e.items.filter(e=>null!=e).map(e=>(0,a.jsx)("li",{children:(0,a.jsx)(S,{item:e})},e.url||e.title))})]},e.name))})})]},t):e.children&&e.children.length>0?(0,a.jsxs)(m,{className:"text-muted-foreground",children:[(0,a.jsxs)(p,{className:F,children:[e.icon&&(0,a.jsx)(h.default,{name:e.icon,className:"size-4 shrink-0 mr-2","aria-hidden":"true"}),(0,a.jsx)("span",{children:e.title})]}),(0,a.jsx)(g,{children:(0,a.jsx)("ul",{className:"w-80 p-3",children:e.children.filter(e=>null!=e).map(e=>(0,a.jsx)("li",{children:(0,a.jsx)(S,{item:e})},e.url||e.title))})})]},t):(0,a.jsx)(m,{children:(0,a.jsxs)(j.PublicLink,{className:(0,d.cn)("h-10 rounded-2xl px-3.5 text-[0.93rem] font-medium text-foreground/72 hover:bg-foreground
1/[0.05] hover:text-foreground",x,(0,l.r)({variant:"ghost"})),href:e.url||"",target:e.target,children:[e.icon&&(0,a.jsx)(h.default,{name:e.icon,className:"mr-2 size-4 shrink-0","aria-hidden":"true"}),e.title]})},t))})})})]}),(0,a.jsxs)("div",{className:B,children:[y.show_locale&&(0,a.jsx)(w.A,{supportedLocales:P}),y.show_theme&&(0,a.jsx)(k.A,{}),null===(N=y.buttons)||void 0===N?void 0:N.map((e,t)=>(0,a.jsx)(l.$,{variant:e.variant,asChild:!0,children:(0,a.jsxs)(j.PublicLink,{href:e.url||"",target:e.target||"",className:"flex items-center gap-1",children:[e.title,e.icon&&(0,a.jsx)(h.default,{name:e.icon,className:"size-4 shrink-0"})]})},t)),y.show_sign&&(0,a.jsx)(_.A,{})]})]}),(0,a.jsx)(M,{header:y,isHomePage:E,isScrolled:z,supportedLocales:P,variant:L})]})})}},9670:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>g});var a=r(80735),s=r(14679),l=r(2119),n=r(70677),i=r(87478),o=r(61199),d=r(54768),c=r(25760),u=r(83563),m=r(47427);function x(){return(0,a.jsx)("div",{className:"flex items-center justify-center w-10 md:w-12 shrink-0",children:(0,a.jsxs)("svg",{className:"w-10 h-8 md:w-12 md:h-10",viewBox:"0 0 48 32",fill:"none",children:[(0,a.jsx)("path",{d:"M4 8 C16 8, 28 24, 44 8",stroke:"white",strokeWidth:"2",strokeLinecap:"round",fill:"none",opacity:"0.4"}),(0,a.jsx)("path",{d:"M38 4 L46 8 L38 12",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",opacity:"0.6"})]})})}function p(e){let{item:t,isActive:r,shouldLoadMedia:o,imageLabel:d,aiCreatedLabel:p}=e,g=(0,s.useRef)(null),[f,b]=(0,s.useState)(!0),[h,v]=(0,s.useState)(!1),j=(0,m.a)();return(0,s.useEffect)(()=>{let e=g.current;e&&(r?j?(v(!1),e.pause(),e.currentTime=0):(e.play().catch(()=>{}),v(!0)):(e.pause(),e.currentTime=0,e.muted=!0,b(!0),v(!1)))},[r,j]),(0,a.jsxs)("div",{className:(0,u.cn)("bg-card rounded-2xl p-3 md:p-4 border border-border/50","flex items-center justify-center gap-2 md:gap-3 h-full","transition-opacity duration-300",!r&&"opacity-60"),children:[(0,a.jsxs)("div",{className:"relative aspect-[9/16] h-full max-h-[380px] md:max-h-[460px] rounded-xl overflow-hidden bg-muted",children:[d?(0,a.jsx)("span",{className:"absolute top-2 left-2 z-10 px-2 py-0.5 text-[10px] md:text-[11px] font-medium bg-black/40 text-white/90 rounded-md",children:d}):null,o?(0,a.jsx)(c.default,{src:t.referenceImage,alt:"Reference",fill:!0,className:"object-cover",sizes:"(max-width: 768px) 200px, 300px",priority:r}):(0,a.jsx)("div",{className:"w-full h-full bg-muted","aria-hidden":"true"}),(0,a.jsx)("div",{className:"absolute bottom-0 left-0 right-0 p-2.5 bg-gradient-to-t from-black/90 via-black/60 to-transparent",children:(0,a.jsx)("p",{className:"text-white/85 text-[10px] md:text-xs leading-relaxed line-clamp-3",children:t.prompt})})]}),(0,a.jsx)(x,{}),(0,a.jsxs)("div",{className:"relative aspect-[9/16] h-full max-h-[380px] md:max-h-[460px] rounded-xl overflow-hidden bg-black",onClick:e=>{e.stopPropagation();let t=g.current;t&&(h?(t.pause(),v(!1)):(t.play().catch(()=>{}),v(!0)))},children:[p?(0,a.jsx)("span",{className:"absolute top-2 left-2 z-10 px-2 py-0.5 text-[10px] md:text-[11px] font-medium bg-black/40 text-white/90 rounded-md",children:p}):null,o&&(0,a.jsx)("button",{onClick:e=>{e.stopPropagation();let t=g.current;t&&(t.muted=!t.muted,b(!f))},className:"absolute top-2 right-2 z-10 p-2 rounded-full bg-black/60 hover:bg-black/80 transition-colors","aria-label":f?"Unmute":"Mute",children:f?(0,a.jsx)(l.A,{className:"w-4 h-4 text-white/80"}):(0,a.jsx)(n.A,{className:"w-4 h-4 text-white"})}),!h&&o&&(0,a.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-black/10 z-10 cursor-pointer",children:(0,a.jsx)("div",{className:"w-14 h-14 rounded-full bg-white/20 flex items-center justify-center hover:bg-white/30 transition-colors",children:(0,a.jsx)(i.A,{className:"w-6 h-6 text-white ml-0.5",fill:"white"})})}),o?(0,a.jsx)("video",{ref:g,src:t.videoUrl,muted:f,loop:!0,playsInline:!0,preload:"none",poster:t.poster,className:"w-full h-full object-cover"}):(0,a.jsx)("div",{className:"w-full h-full bg-black","aria-hidden":"true"})]})]})}function g(e){var t;let{section:r}
1=e,l=null!==(t=r.items)&&void 0!==t?t:[],[n,i]=(0,s.useState)(0),c=(0,s.useRef)(null),[m,x]=(0,s.useState)(0),[g,f]=(0,s.useState)(780);if((0,s.useEffect)(()=>{let e=()=>{c.current&&x(c.current.offsetWidth),f(window.innerWidth<768?Math.min(window.innerWidth-32,360):780)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),r.disabled||0===l.length)return null;let b=e=>{e!==n&&i(e)},h=(e,t)=>{let r=Math.abs(e-t);return Math.min(r,l.length-r)},v=m/2-g/2-n*(g+24);return(0,a.jsxs)("div",{id:r.name,className:"relative w-full",ref:c,children:[(0,a.jsxs)("div",{className:"text-center mb-8 md:mb-10",children:[r.title?(0,a.jsx)("h2",{className:"text-2xl md:text-3xl lg:text-4xl font-bold mb-3",children:r.title}):null,r.description?(0,a.jsx)("p",{className:"text-muted-foreground text-sm md:text-base max-w-2xl mx-auto",children:r.description}):null]}),(0,a.jsx)("div",{className:"relative overflow-hidden",children:(0,a.jsx)("div",{className:"flex gap-6 transition-transform duration-500 ease-out py-4",style:{transform:"translateX(".concat(v,"px)")},children:l.map((e,t)=>(0,a.jsx)("div",{className:"flex-shrink-0 cursor-pointer w-[calc(100vw-2rem)] max-w-[780px] md:w-[780px]",onClick:()=>b(t),children:(0,a.jsx)(p,{item:e,isActive:t===n,shouldLoadMedia:1>=h(t,n),imageLabel:r.imageLabel,aiCreatedLabel:r.aiCreatedLabel})},e.id))})}),(0,a.jsxs)("div",{className:"flex items-center justify-center gap-4 mt-6",children:[(0,a.jsx)("button",{onClick:()=>i(e=>0===e?l.length-1:e-1),className:(0,u.cn)("p-2.5 rounded-full bg-muted border border-border/50","text-muted-foreground hover:text-foreground hover:bg-muted/80","transition-all duration-200 hover:scale-105"),"aria-label":"Previous",children:(0,a.jsx)(o.A,{className:"w-5 h-5"})}),(0,a.jsx)("div",{className:"flex items-center gap-2",children:l.map((e,t)=>(0,a.jsx)("button",{onClick:()=>b(t),className:(0,u.cn)("h-8 w-8 rounded-full transition-all duration-300","flex items-center justify-center","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40",t===n?"bg-muted":"bg-transparent"),"aria-label":"Go to slide ".concat(t+1),children:(0,a.jsx)("span",{className:(0,u.cn)("rounded-full transition-all duration-300",t===n?"bg-foreground h-2 w-6":"bg-muted-foreground/50 hover:bg-muted-foreground h-2 w-2"),"aria-hidden":"true"})},t))}),(0,a.jsx)("button",{onClick:()=>i(e=>e===l.length-1?0:e+1),className:(0,u.cn)("p-2.5 rounded-full bg-muted border border-border/50","text-muted-foreground hover:text-foreground hover:bg-muted/80","transition-all duration-200 hover:scale-105"),"aria-label":"Next",children:(0,a.jsx)(d.A,{className:"w-5 h-5"})})]})]})}},23354:(e,t,r)=>{"use strict";r.d(t,{AccentComparisonShowcase:()=>f,VoiceEmulationShowcase:()=>x});var a=r(80735),s=r(14679),l=r(46854),n=r(93070),i=r(87478),o=r(89920),d=r(83563);function c(e,t){return Object.entries(t).reduce((e,t)=>{let[r,a]=t;return e.replaceAll("{".concat(r,"}"),String(a))},e)}function u(e){let{id:t,comparisonId:r,label:o,audioSrc:u,activeId:m,setActiveId:x,messages:p,className:g}=e,f=(0,s.useRef)(null),b=m===t,[h,v]=(0,s.useState)(!1),j=function(e){switch(e){case"original":default:return{labelClassName:"text-foreground",buttonClassName:"border-border/70 bg-background/82 text-foreground/82 hover:border-primary/30 hover:bg-background",iconClassName:"border-border/70 bg-foreground
1/[0.04] text-foreground/72 group-hover:border-primary/30 group-hover:text-primary"};case"voxtral":return{labelClassName:"text-primary",buttonClassName:"border-primary/22 bg-primary/[0.07] text-foreground/86 hover:border-primary/38 hover:bg-primary/[0.10]",iconClassName:"border-primary/25 bg-primary/12 text-primary group-hover:border-primary/40 group-hover:bg-primary/16"};case"elevenlabs":return{labelClassName:"text-[rgba(128,96,71,0.92)]",badgeClassName:"border-[rgba(160,129,101,0.24)] bg-[rgba(160,129,101,0.09)] text-[rgba(128,96,71,0.92)]",buttonClassName:"border-[rgba(160,129,101,0.22)] bg-[rgba(255,251,246,0.92)] text-foreground/80 hover:border-[rgba(160,129,101,0.36)] hover:bg-background",iconClassName:"border-[rgba(160,129,101,0.24)] bg-[rgba(160,129,101,0.10)] text-[rgba(128,96,71,0.9)] group-hover:border-[rgba(160,129,101,0.36)]"}}}(r);(0,s.useEffect)(()=>{if(b)return;let e=f.current;e&&(e.pause(),e.currentTime=0,v(!1))},[b]);let N=async()=>{let e=f.current;if(e){if(b){e.pause(),e.currentTime=0,x(null),v(!1);return}v(!0),x(t),e.currentTime=0;try{await e.play()}catch(e){x(null),v(!1)}}};return(0,a.jsxs)("div",{"data-voxtral-audio-card":t,className:(0,d.cn)("min-w-0 overflow-hidden rounded-[20px] border border-border/60 bg-[linear-gradient(180deg,rgba(255,255,255,0.84),rgba(248,242,235,0.94))] px-4 py-3 shadow-[0_12px_30px_-26px_var(--glow-secondary)] transition-all duration-200",b?"border-primary/44 bg-[linear-gradient(180deg,rgba(255,249,244,0.98),rgba(250,240,232,0.98))] shadow-[0_18px_44px_-30px_var(--glow-primary)]":"hover:border-border/80 hover:shadow-[0_16px_36px_-30px_var(--glow-secondary)]",g),children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-2.5",children:[(0,a.jsx)("div",{className:"min-w-0 flex-1",children:(0,a.jsx)("p",{className:(0,d.cn)("break-words text-[15px] font-semibold leading-5",j.labelClassName),children:o})}),(0,a.jsx)("button",{type:"button","aria-label":b?c(p.stopLabel,{label:o}):c(p.playLabel,{label:o}),onClick:N,className:(0,d.cn)("group flex h-10 w-10 shrink-0 items-center justify-center rounded-full border transition-all duration-200",b?"border-primary/42 bg-primary/12 text-primary shadow-[0_16px_36px_-28px_var(--glow-primary)]":j.buttonClassName),children:(0,a.jsx)("span",{className:(0,d.cn)("flex h-8 w-8 shrink-0 items-center justify-center rounded-full border transition-all duration-200",b?"border-primary/34 bg-primary/16 text-primary":j.iconClassName),children:h?(0,a.jsx)(l.A,{className:"h-4 w-4 animate-spin"}):b?(0,a.jsx)(n.A,{className:"h-4 w-4"}):(0,a.jsx)(i.A,{className:"ml-0.5 h-4 w-4",fill:"currentColor"})})})]}),(0,a.jsx)("audio",{ref:f,preload:"none",src:u,onPlaying:()=>v(!1),onEnded:()=>{x(null),v(!1)}})]})}function m(e){let{profile:t,layout:r="default",messages:l}=e,[n,i]=(0,s.useState)(null),o="stacked"===r;return(0,s.useEffect)(()=>{i(null)},[t.id]),(0,a.jsxs)("article",{className:(0,d.cn)("grid rounded-[24px] border border-border/40 bg-[linear-gradient(180deg,rgba(255,255,255,0.52),rgba(249,243,236,0.76))] shadow-[0_18px_42px_-42px_var(--glow-secondary)]",o?"gap-4 p-4":"gap-3 p-2.5 md:grid-cols-[minmax(0,0.82fr)_minmax(0,1fr)]"),children:[(0,a.jsxs)("div",{className:(0,d.cn)("relative overflow-hidden rounded-[20px] bg-background/76 shadow-[0_18px_38px_-34px_rgba(56,34,22,0.24)]",o&&"mx-auto w-full max-w-[360px]"),children:[(0,a.jsx)("img",{src:t.imageSrc,alt:t.name,loading:"lazy",className:(0,d.cn)("w-full object-cover object-top",o?"aspect-[1.04]":"aspect-[0.92] h-full")}),(0,a.jsxs)("div",{"data-voxtral-profile-overlay":t.id,className:"absolute inset-x-0 bottom-0 bg-[linear-gradient(180deg,rgba(25,20,18,0)_0%,rgba(25,20,18,0.2)_28%,rgba(25,20,18,0.76)_100%)] px-4 pb-4 pt-10",children:[(0,a.jsx)("h3",{className:"text-2xl font-semibold tracking-tight text-white",children:t.name}),t.role?(0,a.jsx)("p",{className:"mt-1 text-sm font-medium text-white/82",children:t.role}):null,t.locale?(0,a.jsx)("p",{className:"mt-1 text-xs uppercase tracking-[0.16em] text-white/72",children:t.locale}):null]})]}),(0,a.jsx)("div",{className:(0,d.cn)("min-w-0",o?"":"self-end px-1"),children:(0,a.jsx)("div",{className:(0,d.cn)("grid gap-2.5",o&&"md:grid-cols-3"),children:t.comparisons.map(e=>(0,a.jsx)(u,{id:"".concat(t.id,"-").concat(e.id),comparisonId:e.id,label:e.label,audioSrc:e.audioSrc,activeId:n,setActiveId:i,messages:l},e.id))})})]})}function x(e){var t,r,l;let{profiles:n,layout:i="default",messages:d}
1=e,[c,u]=(0,s.useState)(null!==(r=null===(t=n[0])||void 0===t?void 0:t.id)&&void 0!==r?r:"");return(null!==(l=n.find(e=>e.id===c))&&void 0!==l?l:n[0])?(0,a.jsxs)(o.tU,{value:c,onValueChange:u,"data-voxtral-voice-emulation-layout":i,className:"gap-2 rounded-[30px] border border-border/35 bg-[linear-gradient(180deg,rgba(255,249,244,0.62),rgba(247,240,232,0.74))] p-3 shadow-[0_24px_56px_-50px_var(--glow-secondary)] backdrop-blur-[6px]",children:[(0,a.jsx)(o.j7,{className:"h-auto w-full flex-wrap justify-start gap-1.5 rounded-[22px] bg-background/[0.22] p-1.5",children:n.map(e=>(0,a.jsx)(o.Xi,{value:e.id,"data-voxtral-voice-tab":e.id,className:"h-auto rounded-full border border-transparent px-2.5 py-1.5 text-foreground/76 transition-all duration-200 data-[state=active]:border-primary/35 data-[state=active]:bg-background/96 data-[state=active]:text-foreground data-[state=active]:shadow-[0_14px_28px_-22px_var(--glow-primary)]",children:(0,a.jsxs)("span",{className:"flex items-center gap-2",children:[(0,a.jsx)("img",{src:e.imageSrc,alt:"","aria-hidden":"true",loading:"lazy",className:"h-8 w-8 rounded-full object-cover"}),(0,a.jsx)("span",{className:"text-xs font-medium leading-5",children:e.locale})]})},e.id))}),n.map(e=>(0,a.jsx)(o.av,{value:e.id,className:"mt-0",children:(0,a.jsx)(m,{profile:e,layout:i,messages:d})},e.id))]}):null}function p(e){var t,r;let{voice:s,prompt:l,messages:n}=e;return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"rounded-2xl border border-dashed border-border/70 bg-muted/24 p-4",children:[(0,a.jsx)("p",{className:"text-xs font-semibold uppercase tracking-[0.16em] text-muted-foreground",children:n.promptLabel}),(0,a.jsx)("p",{className:"mt-2 text-sm leading-7 text-foreground/84",children:l.prompt})]}),(0,a.jsxs)("div",{className:"rounded-2xl border border-border/65 bg-card/84 p-4",children:[(0,a.jsx)("p",{className:"text-sm font-semibold text-foreground",children:l.label}),(0,a.jsx)("p",{className:"text-xs uppercase tracking-[0.16em] text-muted-foreground",children:c(n.translationOutputWithVoiceLabel,{voice:s.name})}),(0,a.jsx)("div",{className:"mt-3",children:(0,a.jsx)("audio",{controls:!0,preload:"none",src:(t=s.id,r=l.audioKey,"".concat("https://mistral.ai","/audio/tts/demo/").concat(t,"/").concat(r,".mp3")),className:"w-full"})})]})]})}function g(e){var t,r;let{voice:l,prompts:n,messages:i}=e,[d,u]=(0,s.useState)(null!==(r=null===(t=n[0])||void 0===t?void 0:t.id)&&void 0!==r?r:""),m=(0,s.useId)();return(0,s.useEffect)(()=>{var e,t;u(null!==(t=null===(e=n[0])||void 0===e?void 0:e.id)&&void 0!==t?t:"")},[l.id,n]),(0,a.jsxs)("div",{className:"grid gap-6 rounded-[28px] border border-border/65 bg-card/86 p-5 shadow-[0_24px_80px_-72px_var(--glow-secondary)] xl:grid-cols-[minmax(0,0.92fr)_minmax(0,1.08fr)]",children:[(0,a.jsx)("div",{className:"space-y-4",children:(0,a.jsxs)("article",{className:"rounded-2xl border border-border/65 bg-background/70 p-5",children:[(0,a.jsx)("p",{className:"text-xs font-semibold uppercase tracking-[0.16em] text-primary/75",children:i.referenceVoiceLabel}),(0,a.jsx)("h3",{className:"mt-3 text-xl font-semibold text-foreground",children:l.name}),(0,a.jsx)("p",{className:"mt-1 text-xs uppercase tracking-[0.16em] text-muted-foreground",children:l.locale}),(0,a.jsx)("p",{className:"mt-4 text-sm leading-7 text-muted-foreground",children:i.referenceVoiceDescription}),(0,a.jsx)("div",{className:"mt-4",children:(0,a.jsx)("audio",{controls:!0,preload:"none",src:l.audioSrc,className:"w-full"})})]})}),(0,a.jsxs)("div",{className:"rounded-2xl border border-border/65 bg-background/65 p-4",children:[(0,a.jsx)("p",{className:"text-xs font-semibold uppercase tracking-[0.16em] text-primary/75",children:c(i.stepLabel,{step:2})}),(0,a.jsx)("h4",{className:"mt-2 text-base font-semibold text-foreground",children:i.cascadedTranslationTitle}),(0,a.jsx)("p",{className:"mt-3 text-sm leading-7 text-muted-foreground",children:i.cascadedTranslationDescription}),(0,a.jsxs)(o.tU,{value:d,onValueChange:u,className:"mt-4 gap-4",children:[(0,a.jsx)(o.j7,{"aria-label":c(i.translationLanguagesAriaLabel,{voice:l.name}),id:m,className:"h-auto w-full flex-wrap justify-start rounded-[18px] bg-muted/35 p-2",children:n.map(e=>(0,a.jsx)(o.Xi,{value:e.id,className:"rounded-full border border-transparent px-3 py-1.5 data-[state=active]:border-primary/35",children:e.label},e.id))}),n.map(e=>(0,a.jsx)(o.av,{value:e.id,className:"mt-4",children:(0,a.jsx)(p,{voice:l,prompt:e,messages:i})},e.id))]})]})]})}function f(e){var t,r,l;let{voices:n,prompts:i,messages:o}
1=e,[u,m]=(0,s.useState)(null!==(r=null===(t=n[0])||void 0===t?void 0:t.id)&&void 0!==r?r:""),x=null!==(l=n.find(e=>e.id===u))&&void 0!==l?l:n[0];return x?(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"rounded-[24px] border border-border/65 bg-card/84 p-4 shadow-[0_20px_64px_-56px_var(--glow-secondary)]",children:[(0,a.jsx)("div",{className:"flex flex-col gap-3 md:flex-row md:items-end md:justify-between",children:(0,a.jsxs)("div",{className:"max-w-2xl",children:[(0,a.jsx)("p",{className:"text-xs font-semibold uppercase tracking-[0.16em] text-primary/75",children:c(o.stepLabel,{step:1})}),(0,a.jsx)("h3",{className:"mt-2 text-lg font-semibold text-foreground",children:o.pickReferenceVoiceTitle}),(0,a.jsx)("p",{className:"mt-2 text-sm leading-7 text-muted-foreground",children:o.pickReferenceVoiceDescription})]})}),(0,a.jsx)("div",{className:"mt-4 flex flex-wrap gap-3",children:n.map(e=>{let t=e.id===u;return(0,a.jsxs)("button",{type:"button","data-voxtral-accent-voice-option":e.id,"aria-pressed":t,onClick:()=>m(e.id),className:(0,d.cn)("flex min-w-[132px] flex-col items-start gap-1 rounded-[18px] border px-4 py-3 text-left transition-all duration-200",t?"border-primary/35 bg-background shadow-sm":"border-border/60 bg-background/45 text-muted-foreground hover:border-primary/24 hover:bg-background/70 hover:text-foreground"),children:[(0,a.jsx)("span",{className:"text-sm font-semibold text-foreground",children:e.name}),(0,a.jsx)("span",{className:"text-xs",children:e.locale})]},e.id)})})]}),(0,a.jsx)(g,{voice:x,prompts:i,messages:o})]}):null}},25987:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>x});var a=r(80735),s=r(14679),l=r(2119),n=r(70677),i=r(87478),o=r(19940),d=r(70616),c=r(25760),u=r(47427);function m(e){let{item:t,isEdge:r=!1,offsetY:m=0}=e,x=(0,s.useRef)(null),[p,g]=(0,s.useState)(!1),[f,b]=(0,s.useState)(!0),h=(0,u.a)();return(0,a.jsx)("div",{className:"flex-shrink-0 transition-all duration-300 ".concat(r?"w-[160px] md:w-[200px]":"w-[216px] md:w-[252px] lg:w-[270px]"),style:{transform:"translateY(".concat(m,"px)"),opacity:r?.6:1},onMouseEnter:()=>{if(r||h)return;let e=x.current;e&&(e.play().catch(()=>{}),g(!0))},onMouseLeave:()=>{if(h)return;let e=x.current;e&&(e.pause(),g(!1))},onClick:()=>{if(r)return;let e=x.current;e&&(p?(e.pause(),g(!1)):(e.play().catch(()=>{}),g(!0)))},children:(0,a.jsxs)("div",{className:"relative rounded-2xl bg-card/80 border border-border/50 shadow-2xl p-3 md:p-4 ".concat(r?"blur-[2px]":""),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[t.avatar?(0,a.jsx)(c.default,{src:t.avatar,alt:t.username,width:28,height:28,className:"w-7 h-7 rounded-full object-cover"}):(0,a.jsx)("div",{className:"w-7 h-7 rounded-full bg-muted flex items-center justify-center text-muted-foreground text-[10px] font-bold",children:t.username.charAt(0).toUpperCase()}),(0,a.jsx)("span",{className:"text-foreground text-xs font-medium truncate max-w-[100px]",children:t.username})]}),t.isActive&&!r&&(0,a.jsxs)("span",{className:"flex items-center gap-1 px-2 py-1 rounded-full bg-emerald-500/20 border border-emerald-500/30",children:[(0,a.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse"}),(0,a.jsx)("span",{className:"text-emerald-400 text-[10px] font-medium",children:"ACTIVE"})]})]}),(0,a.jsxs)("div",{className:"relative aspect-[9/16] rounded-xl overflow-hidden bg-black border border-border/30",children:[(0,a.jsx)("video",{ref:x,src:t.videoUrl,muted:f,loop:!0,playsInline:!0,preload:"none",poster:t.poster,className:"absolute inset-0 w-full h-full object-cover"}),!r&&(0,a.jsx)("button",{onClick:e=>{e.stopPropagation();let t=x.current;t&&(t.muted=!t.muted,b(!f))},className:"absolute top-2 right-2 p-2 rounded-full bg-black/60 hover:bg-black/80 transition-colors z-20","aria-label":f?"Unmute":"Mute",children:f?(0,a.jsx)(l.A,{className:"w-4 h-4 text-white/80"}):(0,a.jsx)(n.A,{className:"w-4 h-4 text-white"})}),!p&&!r&&(0,a.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-black/10 cursor-pointer",children:(0,a.jsx)("div",{className:"w-14 h-14 roun
1ded-full bg-white/20 flex items-center justify-center hover:bg-white/30 transition-colors",children:(0,a.jsx)(i.A,{className:"w-6 h-6 text-white ml-0.5",fill:"white"})})})]}),(0,a.jsxs)("div",{className:"mt-3 grid grid-cols-2 gap-3",children:[(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsxs)("div",{className:"text-[10px] text-muted-foreground uppercase tracking-wide mb-1 flex items-center justify-center gap-1",children:[(0,a.jsx)(o.A,{className:"w-3 h-3"}),"LIKES"]}),(0,a.jsxs)("div",{className:"flex items-baseline justify-center gap-1",children:[(0,a.jsx)("span",{className:"font-bold text-foreground ".concat(r?"text-sm":"text-base"),children:t.likes}),(0,a.jsx)("span",{className:"font-medium text-emerald-500 ".concat(r?"text-[9px]":"text-xs"),children:t.likesGrowth})]})]}),(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsxs)("div",{className:"text-[10px] text-muted-foreground uppercase tracking-wide mb-1 flex items-center justify-center gap-1",children:[(0,a.jsx)(d.A,{className:"w-3 h-3"}),"FOLLOWERS"]}),(0,a.jsxs)("div",{className:"flex items-baseline justify-center gap-1",children:[(0,a.jsx)("span",{className:"font-bold text-foreground ".concat(r?"text-sm":"text-base"),children:t.followers}),(0,a.jsx)("span",{className:"font-medium text-emerald-500 ".concat(r?"text-[9px]":"text-xs"),children:t.followersGrowth})]})]})]})]})})}function x(e){var t;let{section:r}=e;if(r.disabled)return null;let s=null!==(t=r.items)&&void 0!==t?t:[];if(0===s.length)return null;let l=s.length>=5?s:[...s,...s].slice(0,5),n=s.length>=3?s:l.slice(1,4);return(0,a.jsx)("div",{id:r.name,className:"container",children:(0,a.jsxs)("div",{className:"relative py-2 md:py-6",children:[(0,a.jsxs)("div",{className:"text-center mb-6 lg:mb-8 px-4",children:[r.headline?(0,a.jsx)("h2",{className:"text-2xl md:text-3xl lg:text-4xl font-bold mb-3 text-foreground tracking-tight",children:r.headline}):null,r.subheadlinePrefix||r.subheadlineBrand?(0,a.jsxs)("p",{className:"text-sm md:text-base text-muted-foreground",children:[r.subheadlinePrefix," ",r.subheadlineBrand?(0,a.jsx)("span",{className:"font-semibold text-foreground",children:r.subheadlineBrand}):null]}):null]}),(0,a.jsx)("div",{className:"md:hidden -mx-4 overflow-x-auto snap-x snap-mandatory scroll-px-4 px-4 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:(0,a.jsx)("div",{className:"flex items-end gap-4 pb-4",children:n.map(e=>(0,a.jsx)("div",{className:"snap-start shrink-0",children:(0,a.jsx)(m,{item:e})},e.id))})}),(0,a.jsxs)("div",{className:"hidden md:flex items-end justify-center gap-4 md:gap-6 lg:gap-8 -mx-16 md:-mx-20 lg:-mx-24",children:[(0,a.jsx)(m,{item:l[0],isEdge:!0,offsetY:20}),(0,a.jsx)(m,{item:l[1],offsetY:16}),(0,a.jsx)(m,{item:l[2],offsetY:-12}),(0,a.jsx)(m,{item:l[3],offsetY:24}),(0,a.jsx)(m,{item:l[4],isEdge:!0,offsetY:8})]})]})})}},26688:(e,t,r)=>{"use strict";r.d(t,{MakerAIUploadCard:()=>v});var a=r(80735),s=r(14679),l=r(46854),n=r(77559),i=r(69286),o=r(55e3),d=r(10670),c=r(91533),u=r(13916),m=r(61294),x=r(66848),p=r(68610),g=r(80291),f=r(83563),b=r(7934);let h=/^https?:\/\/.+/i;function v(){let e=(0,g.rd)(),t=(0,s.useId)(),[r,v]=(0,s.useState)(""),[j,N]=(0,s.useState)(null),[w,y]=(0,s.useState)(!1),_=(0,s.useMemo)(()=>h.test(r.trim()),[r]),k=(0,s.useCallback)(async t=>{var r;let a=null===(r=t.target.files)||void 0===r?void 0:r[0];if(!a)return;if(a.size>b.A){c.oR.error("Image is over 8MB. Please pick a smaller file."),t.target.value="";return}N(e=>(e&&URL.revokeObjectURL(e),URL.createObjectURL(a))),v(""),y(!0);let s=await (0,b.zM)(a);if(!s){c.oR.error("Could not read your image. Please try a different file."),y(!1);return}(0,b.pX)({kind:"image",dataUrl:s,fileName:a.name}),e.push("/product-to-ads?from=hero")},[e]),C=(0,s.useCallback)(()=>{if(w||!_)return;y(!0);let t=r.trim();(0,b.pX)({kind:"url",sourceUrl:t});let a=new URLSearchParams({from:"hero",source_url:t});e.push("/product-to-ads?".concat(a.toString()))},[_,w,r,e]);return(0,a.jsxs)("div",{className:"w-full",children:[(0,a.jsx)(m.Zp,{className:"overflow-hidden border-2 border-dashed border-border/70 bg-card/60 backdrop-blur-sm",children:(0,a.jsxs)("label",{htmlFor:t,className:(0,f.cn)("flex cursor-pointer flex-col items-center gap-4 p-6 transition-colors sm:p-8",w?"pointer-events-none opacity-80":"hover:bg-muted/30"),children:[j?(0,a.jsxs)("div",{className:"relative h-40 w-40 overflow-hidden rounded-2xl border border-border",children:[(0,a.jsx)(p.LocalizedImage,{src:j,alt:"Product",fill:!0,className:"object-cover"}),w&&(0,a.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-background/70",children:(0,a.jsx)(l.A,{className:"size-6 animate-spin text-primary"})})]}):(0,a.jsx)("div",{className:"flex h-40 w-40 items-center justify-center rounded-2xl border-2 border-dashed border-border/50 bg-muted/30",children:(0,a.jsx)(n.A,{className:"size-9 text-muted-foreground
1/50"})}),(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("p",{className:"text-sm font-medium sm:text-base",children:w?"Preparing your ad workspace...":j?"Change image":"Drop product image here or click to upload"}),(0,a.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:"PNG, JPG, WebP up to 8MB"})]}),(0,a.jsx)("input",{id:t,type:"file",accept:"image/png,image/jpeg,image/webp",className:"sr-only",onChange:e=>void k(e),disabled:w})]})}),j&&w&&(0,a.jsxs)("div",{className:"mt-3 flex items-center justify-center gap-2 text-sm text-primary",children:[(0,a.jsx)(i.A,{className:"size-4"}),"Sending to AI ad generator..."]}),!j&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"my-4 flex items-center gap-3",children:[(0,a.jsx)("div",{className:"h-px flex-1 bg-border/70"}),(0,a.jsx)("span",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:"or paste a product link"}),(0,a.jsx)("div",{className:"h-px flex-1 bg-border/70"})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,a.jsxs)("div",{className:"relative flex-1",children:[(0,a.jsx)(o.A,{className:"pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),(0,a.jsx)(x.p,{type:"url",inputMode:"url",value:r,onChange:e=>v(e.target.value),placeholder:"https://amazon.com/dp/... or Shopify URL",className:"pl-9",onKeyDown:e=>{"Enter"===e.key&&C()}})]}),(0,a.jsxs)(u.$,{type:"button",variant:"ai",disabled:!_||w,onClick:C,children:[w?(0,a.jsx)(l.A,{className:"size-4 animate-spin"}):(0,a.jsx)(d.A,{className:"size-4"}),"Generate"]})]})]})]})}},39705:(e,t,r)=>{"use strict";r.d(t,{default:()=>o});var a=r(80735),s=r(14679),l=r(48780),n=r(43956),i=r(83563);function o(e){let{config:t,closeLabel:r="Close"}=e,[o,d]=(0,s.useState)(!1);(0,s.useEffect)(()=>{let e=()=>d(!0);return document.addEventListener("fillPromptFromInspiration",e),()=>{document.removeEventListener("fillPromptFromInspiration",e)}},[]);let c=(0,s.useCallback)(()=>d(!1),[]);return(0,a.jsx)("div",{"aria-hidden":!o,className:(0,i.cn)("fixed inset-x-0 bottom-0 z-40 px-4 pb-1 transition-transform duration-300 ease-out sm:pb-2","pointer-events-none translate-y-[calc(100%+2rem)]",o&&"pointer-events-auto translate-y-0"),children:(0,a.jsxs)("div",{className:"relative mx-auto max-w-3xl",children:[(0,a.jsx)("button",{type:"button",onClick:c,"aria-label":r,className:"absolute -top-3 right-1 z-10 inline-flex h-8 w-8 items-center justify-center rounded-full border border-border/60 bg-background text-muted-foreground shadow-md transition-colors hover:bg-muted hover:text-foreground",children:(0,a.jsx)(l.A,{className:"h-4 w-4"})}),(0,a.jsx)("div",{className:"max-h-[70vh] overflow-y-auto [&_section]:!py-1 [&_textarea]:!min-h-[80px]",children:(0,a.jsx)(n.default,{config:t})})]})})}},54702:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>v});var a=r(80735),s=r(14679),l=r(1801),n=r(5104),i=r(99120),o=r(21168);function d(){return{defaultAlt:(0,o.G)().title||"User avatar"}}function c(e){let{compact:t=!1}=e,r=(0,l.c)("hero"),{defaultAlt:s}=d();return r.has("happy_users")?t?(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsxs)("div",{className:"flex flex-col items-center gap-1",children:[(0,a.jsx)("span",{className:"inline-flex items-center -space-x-1.5",children:Array.from({length:5}).map((e,t)=>(0,a.jsx)(n.Avatar,{className:"size-8 border border-background",children:(0,a.jsx)(n.AvatarImage,{src:"/imgs/users/".concat(t+6,".webp"),alt:s})},t))}),(0,a.jsxs)("div",{className:"flex items-center gap-0.5",children:[Array.from({length:5}).map((e,t)=>(0,a.jsx)(i.A,{className:"size-3.5 ".concat(t<4?"fill-yellow-400 text-yellow-400":"fill-yellow-400/70 text-yellow-400/70")},t)),(0,a.jsx)("span",{className:"text-xs text-muted-foreground ml-0.5",children:"4.7"})]})]}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:r("happy_users")})]}):(0,a.jsxs)("div",{className:"mx-auto mt-8 flex w-fit flex-col items-center gap-2 sm:flex-row",children:[(0,a.jsx)("span",{className:"mx-4 inline-flex items-center -space-x-2",children:Array.from({length:5}).map((e,t)=>(0,a.jsx)(n.Avatar,{className:"size-12 border",children:(0,a.jsx)(n.AvatarImage,{src:"/imgs/users/".concat(t+6,".webp"),alt:s})},t))}),(0,a.jsxs)("div",{className:"flex flex-col items-center gap-1 md:items-start",children:[(0,a.jsx)("div",{className:"flex items-center gap-1",children:Array.from({length:5}).map((e,t)=>(0,a.jsx)(i.A,{className:"size-5 fill-yellow-400 text-yellow-400"},t))}),(0,a.jsx)("p",{className:"text-left font-medium text-muted-foreground",children:r("happy_users")})]})]}):null}var u=r(80756),m=r(25760),x=r(6292),p=r(13916),g=r(60569),f=r(83563);function b(e){let{image:t,onClose:r,usePromptUrl:l}
1=e,[n,i]=(0,s.useState)(!1),o=null!==t,d=async()=>{if(null==t?void 0:t.prompt)try{await navigator.clipboard.writeText(t.prompt),i(!0),window.setTimeout(()=>i(!1),2e3)}catch(e){}},c=async()=>{if(null==t?void 0:t.prompt)try{await navigator.clipboard.writeText(t.prompt)}catch(e){}window.location.href=l};return(0,a.jsx)(x.lG,{open:o,onOpenChange:e=>{e||(i(!1),r())},children:(0,a.jsxs)(x.Cf,{className:(0,f.cn)("p-0 overflow-hidden gap-0","w-[min(96vw,1100px)] max-w-none","max-h-[92dvh] sm:max-h-[88vh]","grid grid-rows-[1fr_auto] lg:grid-rows-1 lg:grid-cols-[minmax(0,1.1fr)_minmax(0,1fr)]"),children:[(0,a.jsx)(x.L3,{className:"sr-only",children:(null==t?void 0:t.label)||"Example image"}),(0,a.jsx)(x.rr,{className:"sr-only",children:"Preview of an AI-generated product photo example, including the prompt used to generate it."}),t?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"relative w-full bg-black/90 flex items-center justify-center min-h-[40vh] lg:min-h-0",children:(0,a.jsx)(m.default,{src:t.src,alt:t.alt||t.label||"Example image",width:1080,height:1440,className:"max-h-full max-w-full w-auto h-auto object-contain",unoptimized:!0,priority:!0})}),(0,a.jsxs)("div",{className:"flex min-h-0 flex-col gap-4 p-5 sm:p-6 bg-background",children:[(0,a.jsx)("div",{className:"flex items-start justify-between gap-3",children:(0,a.jsxs)("div",{children:[t.industry?(0,a.jsx)("p",{className:"text-xs uppercase tracking-[0.14em] text-muted-foreground mb-1",children:t.industry}):null,t.label?(0,a.jsx)("h3",{className:"text-lg sm:text-xl font-semibold leading-tight",children:t.label}):null]})}),(0,a.jsx)("p",{className:"text-xs font-medium uppercase tracking-[0.12em] text-muted-foreground",children:"Prompt"}),(0,a.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto rounded-xl border border-border bg-muted/40 p-3 sm:p-4 text-[12.5px] leading-6 text-foreground/85 whitespace-pre-wrap font-mono",children:t.prompt||"No prompt available."}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,a.jsxs)(p.$,{type:"button",variant:"outline",size:"sm",onClick:d,disabled:!t.prompt,className:"gap-1.5",children:[(0,a.jsx)(g.default,{name:n?"RiCheckLine":"RiFileCopyLine",className:"size-4"}),n?"Copied":"Copy prompt"]}),(0,a.jsxs)(p.$,{type:"button",size:"sm",onClick:c,className:"flex-1 sm:flex-none gap-1.5",children:["Use this prompt",(0,a.jsx)(g.default,{name:"GoArrowUpRight",className:"size-4"})]})]})]})]}):null]})})}var h=r(5322);function v(e){var t,r,n,i,o,x,v,N,w;let{hero:y,showBackground:_=!0,sectionClassName:k}=e,{defaultAlt:C}=d(),A=(0,l.c)("hero"),[P,S]=(0,s.useState)(null);if(y.disabled)return null;let L=null!==(o=null===(t=y.showcase_strip)||void 0===t?void 0:t.usePromptUrl)&&void 0!==o?o:"/auth/sign-up?next=/ai-product-photography",M=y.highlight_text,I=!1!==y.show_happy_users&&A.has("happy_users"),E=!!(y.show_badge||I),z=null;return M&&(z=null===(x=y.title)||void 0===x?void 0:x.split(M,2)),(0,a.jsxs)("section",{className:(0,f.cn)("relative pb-16 pt-28 lg:pb-24 lg:pt-36",_?"isolate overflow-hidden bg-background":null,k,y.sectionClassName),children:[_?(0,a.jsx)(u.default,{}):null,(0,a.jsxs)("div",{className:"relative z-10",children:[(0,a.jsxs)("div",{className:"container",children:[E?(0,a.jsxs)("div",{className:"mb-8 flex flex-col items-center justify-center gap-4 py-2 sm:flex-row sm:gap-6",children:[y.show_badge&&(0,a.jsx)(m.default,{src:"/imgs/badges/phdaily.svg",alt:C,width:160,height:32,className:"h-7 w-auto object-cover opacity-90 transition-opacity hover:opacity-100"}),I?(0,a.jsx)(c,{compact:!0}):null]}):null,(0,a.jsxs)("div",{className:"text-center",children:[y.chip?(0,a.jsxs)("div",{className:"mb-7 inline-flex items-center gap-2 px-3.5 py-1.5 rounded-full border border-border text-xs text-muted-foreground",children:[(0,a.jsx)("span",{className:"w-1.5 h-1.5 rounded-full shadow-[0_0_6px_currentColor]",style:{color:null!==(v=y.chip.dotColor)&&void 0!==v?v:"rgb(251 113 133)",backgroundColor:null!==(N=y.chip.dotColor)&&void 0!==N?N:"rgb(251 113 133)"}}),y.chip.text]}):null,z&&z.length>1?(0,a.jsxs)("h1",{className:"mx-auto mb-4 max-w-5xl text-balance text-4xl font-bold tracking-tight md:text-5xl lg:mb-6 lg:text-6xl",children:[z[0],(0,a.jsx)("span",{className:"text-primary",children:M}),z[1]]}):(0,a.jsx)("h1",{className:"mx-auto mb-4 mt-4 max-w-5xl text-balance text-4xl font-bold tracking-tight md:text-5xl lg:mb-8 lg:text-6xl",children:y.title}),(0,a.jsx)("p",{className:"mx-auto max-w-3xl text-muted-foreground text-lg lg:text-xl leading-relaxed",dangerouslySetInnerHTML:{__html:y.description||""}}),(null===(r=y.buttons)||void 0===r?void 0:r.length)?(0,a.jsx)("div",{className:"mt-8 flex flex-wrap items-center justify-center gap-3",children:y.buttons.map((e,t)=>{let r=e.variant||"default";return(0,a.jsx)(p.$,{variant:r,size:"sm"===e.size?"sm":"lg"===e.size?"lg":"default",asChild:!0,children:(0,a.jsxs)(h.PublicLink,{href:e.url||"/",target:e.target||void 0,className:"inline-flex items-center gap-2",children:[(0,a.jsx)("span",{children:e.title}),e.icon?(0,a.jsx)(g.default,{name:e.icon,className:"size-4 shrink-0"}):null]})},"".concat(e.title||e.url||"hero-button","-").concat(t))})}):null,y.promise_line?(0,a.jsx)("p",{className:"mt-4 text-sm text-muted-foreground",children:y.promise_line}):null]})]}),(null===(i=y.showcase_strip)||void 0===i?void 0:null===(n=i.images)||void 0===n?void 0:n.length)?y.showcase_strip.marquee?(0,a.jsx)("div",{className:"mt-12 lg:mt-16 w-screen overflow-hidden",style:{"--hero-marquee-duration":"".concat(null!==(w=y.showcase_strip.marqueeDurationSeconds)&&void 0!==w?w:40,"s")},children:(0,a.jsx)("div",{className:"hero-marquee-track gap-4 lg:gap-5 pb-1",children:[...y.showcase_strip.images,...y.showcase_strip.images].map((e,t)=>{let r=!!e.prompt,s=t>=y.showcase_strip.images.length;return(0,a.jsx)(j,{image:e,ariaHidden:s,eager:t<6,defaultAlt:C,onClick:r?()=>S(e):void 0},"marquee-".concat(t))})})}):(0,a.jsx)("div",{className:"mt-12 lg:mt-16 w-screen overflow-hidden",children:(0,a.jsx)("div",{className:(0,f.cn)("flex items-stretch gap-4 lg:gap-5 px-4 pb-1","overflow-x-auto snap-x snap-mandatory","lg:overflow-visible lg:snap-none"),style:{scrollbarWidth:"none"},children:y.showcase_strip.images.map((e,t)=>{var r;let s=!!e.prompt;return(0,a.jsx)(j,{image:e,snap:!0,eager:t<3,defaultAlt:C,onClick:s?()=>S(e):void 0},"".concat(null!==(r=e.src)&&void 0!==r?r:"showcase","-").concat(t))})})}):null]}),(0,a.jsx)(b,{image:P,onClose:()=>S(null),usePromptUrl:L})]})}function j(e){let{image:t,defaultAlt:r,ariaHidden:s,snap:l,eager:n,onClick:i}=e,o=(0,f.cn)("shrink-0 rounded-2xl overflow-hidden border border-border/60 bg-muted shadow-[0_8px_24px_-12px_rgba(0,0,0,0.25)] relative",l&&"snap-center",i&&"cursor-pointer transition-transform hover:scale-[1.02] focus-visible:scale-[1.02] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 group"),d={width:"18rem",aspectRatio:"3 / 4"},c=(0,a.jsxs)(a.Fragment,{children:[t.src?(0,a.jsx)(m.default,{src:t.src,alt:t.alt||r,width:288,height:384,className:"w-full h-full object-cover",loading:n?"eager":"lazy"}):null,i?(0,a.jsxs)("span",{"aria-hidden":"true",className:"absolute inset-x-0 bottom-0 flex items-center justify-between gap-2 px-3 py-2 bg-gradient-to-t from-black/70 via-black/35 to-transparent text-white opacity-0 transition-opacity group-hover:opacity-100",children:[(0,a.jsx)("span",{className:"text-xs font-medium truncate",children:t.label||"View prompt"}),(0,a.jsx)(g.default,{name:"GoArrowUpRight",className:"size-3.5 shrink-0"})]}):null]});return i?(0,a.jsx)("button",{type:"button","aria-hidden":s,tabIndex:s?-1:0,onClick:i,className:o,style:d,"aria-label":t.label?"View prompt: ".concat(t.label):"View prompt",children:c}):(0,a.jsx)("div",{"aria-hidden":s,className:o,style:d,children:c})}},54887:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>f});var a=r(80735),s=r(14679),l=r(2119),n=r(70677),i=r(87478),o=r(10670),d=r(25760),c=r(83563),u=r(47427);function m(){return(0,a.jsx)("div",{className:"flex items-center justify-center w-8 md:w-10 shrink-0",children:(0,a.jsxs)("svg",{className:"w-8 h-6 md:w-10 md:h-8",viewBox:"0 0 48 32",fill:"none",children:[(0,a.jsx)("path",{d:"M4 8 C16 8, 28 24, 44 8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",fill:"none",className:"stroke-muted-foreground
1/40"}),(0,a.jsx)("path",{d:"M38 4 L46 8 L38 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",fill:"none",className:"stroke-muted-foreground/60"})]})})}function x(e){let{item:t,imageLabel:r,aiCreatedLabel:o}=e,x=(0,s.useRef)(null),[p,g]=(0,s.useState)(!0),[f,b]=(0,s.useState)(!1),h=(0,u.a)();return(0,a.jsxs)("div",{className:(0,c.cn)("bg-card rounded-2xl p-3 md:p-4 border border-border/50","flex items-center justify-center gap-2 md:gap-3"),children:[(0,a.jsxs)("div",{className:"relative aspect-[9/16] w-[140px] md:w-[180px] shrink-0 rounded-xl overflow-hidden bg-muted",children:[r?(0,a.jsx)("span",{className:"absolute top-2 left-2 z-10 px-2 py-0.5 text-[10px] md:text-[11px] font-medium bg-black/40 text-white/90 rounded-md backdrop-blur-sm",children:r}):null,(0,a.jsx)(d.default,{src:t.referenceImage,alt:"Reference",fill:!0,className:"object-cover",sizes:"(max-width: 768px) 140px, 180px"}),t.prompt?(0,a.jsx)("div",{className:"absolute bottom-0 left-0 right-0 p-2.5 bg-gradient-to-t from-black/90 via-black/60 to-transparent",children:(0,a.jsx)("p",{className:"text-white/90 text-[10px] md:text-xs leading-relaxed line-clamp-3",children:t.prompt})}):null]}),(0,a.jsx)(m,{}),t.outputImage?(0,a.jsxs)("div",{className:"relative aspect-[9/16] w-[140px] md:w-[180px] shrink-0 rounded-xl overflow-hidden bg-muted",children:[o?(0,a.jsx)("span",{className:"absolute top-2 left-2 z-10 px-2 py-0.5 text-[10px] md:text-[11px] font-medium bg-black/40 text-white/90 rounded-md backdrop-blur-sm",children:o}):null,(0,a.jsx)(d.default,{src:t.outputImage,alt:"AI-generated product photo",fill:!0,className:"object-cover",sizes:"(max-width: 768px) 140px, 180px"})]}):(0,a.jsxs)("div",{className:"relative aspect-[9/16] w-[140px] md:w-[180px] shrink-0 rounded-xl overflow-hidden bg-black cursor-pointer",onMouseEnter:()=>{if(h)return;let e=x.current;e&&(e.play().catch(()=>{}),b(!0))},onMouseLeave:()=>{if(h)return;let e=x.current;e&&(e.pause(),e.currentTime=0,b(!1))},onClick:()=>{let e=x.current;e&&(f?(e.pause(),b(!1)):(e.play().catch(()=>{}),b(!0)))},children:[o?(0,a.jsx)("span",{className:"absolute top-2 left-2 z-10 px-2 py-0.5 text-[10px] md:text-[11px] font-medium bg-black/40 text-white/90 rounded-md backdrop-blur-sm",children:o}):null,(0,a.jsx)("button",{onClick:e=>{e.stopPropagation();let t=x.current;t&&(t.muted=!t.muted,g(!p))},className:"absolute top-2 right-2 z-20 p-2 rounded-full bg-black/60 backdrop-blur-sm hover:bg-black/80 transition-colors","aria-label":p?"Unmute":"Mute",children:p?(0,a.jsx)(l.A,{className:"w-4 h-4 text-white/80"}):(0,a.jsx)(n.A,{className:"w-4 h-4 text-white"})}),!f&&(0,a.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-black/10 z-10 cursor-pointer",children:(0,a.jsx)("div",{className:"w-14 h-14 rounded-full bg-white/20 backdrop-blur-sm flex items-center justify-center hover:bg-white/30 transition-colors",children:(0,a.jsx)(i.A,{className:"w-6 h-6 text-white ml-0.5",fill:"white"})})}),(0,a.jsx)("video",{ref:x,src:t.videoUrl,muted:p,loop:!0,playsInline:!0,preload:"metadata",className:"w-full h-full object-cover"})]})]})}function p(e){let{item:t,imageLabel:r,aiCreatedLabel:o}=e,d=(0,s.useRef)(null),[m,p]=(0,s.useState)(!0),[g,f]=(0,s.useState)(!1),[b,h]=(0,s.useState)(0),v=(0,u.a)(),j=t.videos||[],N=j[b],w=e=>{if(e===b)return;let t=d.current;t&&(t.pause(),t.currentTime=0),h(e),f(!1)};return 0===j.length?(0,a.jsx)(x,{item:t,imageLabel:r,aiCreatedLabel:o}):(0,a.jsxs)("div",{className:(0,c.cn)("bg-card rounded-2xl p-3 md:p-4 border border-border/50","flex items-center justify-center gap-3 md:gap-4"),children:[(0,a.jsx)("div",{className:"flex flex-col gap-1.5 shrink-0",children:j.map((e,t)=>(0,a.jsxs)("button",{onClick:()=>w(t),className:(0,c.cn)("px-2 py-1.5 rounded-lg text-[10px] md:text-xs font-medium transition-all duration-200","flex items-center gap-1.5 min-w-[80px] md:min-w-[100px]",b===t?"bg-background text-foreground shadow-lg scale-105":"bg-muted/50 text-muted-foreground hover:bg-muted hover:text-foreground"),children:[(0,a.jsx)("span",{className:"text-base",children:e.flag}),(0,a.jsx)("span",{children:e.label})]},e.lang))}),(0,a.jsxs)("div",{className:"relative aspect-[9/16] w-[140px] md:w-[180px] shrink-0 rounded-xl overflow-hidden bg-black cursor-pointer",onMouseEnter:()=>{if(v)return;let e=d.current;e&&(e.play().catch(()=>{}),f(!0))},onMouseLeave:()=>{if(v)return;let e=d.current;e&&(e.pause(),e.currentTime=0,f(!1))},onClick:()=>{let e=d.current;e&&(g?(e.pause(),f(!1)):(e.play().catch(()=>{}),f(!0)))},children:[o?(0,a.jsx)("span",{className:"absolute top-2 left-2 z-10 px-2 py-0.5 text-[10px] md:text-[11px] font-medium bg-black/40 text-white/90 rounded-md backdrop-blur-sm",children:o}):null,(0,a.jsx)("button",{onClick:e=>{e.stopPropagation();let t=d.current;t&&(t.muted=!t.muted,p(!m))},className:"absolute top-2 right-2 z-20 p-2 rounded-full bg-black/60 backdrop-blur-sm hover:bg-black/80 transition-colors","aria-label":m?"Unmute":"Mute",children:m?(0,a.jsx)(l.A,{className:"w-4 h-4 text-white/80"}):(0,a.jsx)(n.A,{className:"w-4 h-4 text-white"})}),!g&&(0,a.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-black/10 z-10 cursor-pointer",children:(0,a.jsx)("div",{className:"w-14 h-14 roun
1ded-full bg-white/20 backdrop-blur-sm flex items-center justify-center hover:bg-white/30 transition-colors",children:(0,a.jsx)(i.A,{className:"w-6 h-6 text-white ml-0.5",fill:"white"})})}),(0,a.jsx)("video",{ref:d,src:(null==N?void 0:N.videoUrl)||t.videoUrl,muted:m,loop:!0,playsInline:!0,preload:"metadata",className:"w-full h-full object-cover"},null==N?void 0:N.videoUrl)]})]})}function g(e){let{item:t,index:r,imageLabel:l,aiCreatedLabel:n}=e,i=r%2==1,d=(0,s.useCallback)(e=>{var r;e.preventDefault();let a=null!==(r=t.buttonLink)&&void 0!==r?r:"",s=a.includes("#")?a.split("#")[1]:"ai-tool",l=document.getElementById(s);l?l.scrollIntoView({behavior:"smooth",block:"start"}):window.scrollTo({top:0,behavior:"smooth"})},[t.buttonLink]);return(0,a.jsxs)("div",{className:(0,c.cn)("grid grid-cols-1 lg:grid-cols-2 gap-6 lg:gap-10 items-center","py-8 md:py-12",0!==r&&"border-t border-border/50"),children:[(0,a.jsxs)("div",{className:(0,c.cn)("flex flex-col gap-4 md:gap-6",i&&"lg:order-2"),children:[t.title?(0,a.jsx)("h3",{className:"text-2xl md:text-3xl lg:text-4xl font-bold text-foreground",children:t.title}):null,t.description?(0,a.jsx)("p",{className:"text-muted-foreground text-sm md:text-base lg:text-lg leading-relaxed",children:t.description}):null,t.buttonLabel?(0,a.jsxs)("button",{onClick:d,className:(0,c.cn)("inline-flex items-center gap-2 w-fit","px-5 py-2.5 md:px-6 md:py-3","bg-foreground text-background font-semibold","rounded-full","hover:opacity-90 transition-all duration-200","group cursor-pointer"),children:[t.buttonLabel,(0,a.jsx)(o.A,{className:"w-4 h-4 transition-transform group-hover:translate-x-1"})]}):null]}),(0,a.jsx)("div",{className:(0,c.cn)("w-full max-w-[500px] mx-auto lg:mx-0",i&&"lg:order-1"),children:t.videos&&t.videos.length>0?(0,a.jsx)(p,{item:t,imageLabel:l,aiCreatedLabel:n}):(0,a.jsx)(x,{item:t,imageLabel:l,aiCreatedLabel:n})})]})}function f(e){var t;let{section:r}=e;if(r.disabled)return null;let s=null!==(t=r.items)&&void 0!==t?t:[];return 0===s.length?null:(0,a.jsxs)("div",{id:r.name,className:"relative w-full",children:[(0,a.jsxs)("div",{className:"text-center mb-8 md:mb-10",children:[r.title?(0,a.jsx)("h2",{className:"text-2xl md:text-3xl lg:text-4xl font-bold mb-3 text-foreground",children:r.title}):null,r.description?(0,a.jsx)("p",{className:"text-muted-foreground text-sm md:text-base max-w-2xl mx-auto",children:r.description}):null]}),(0,a.jsx)("div",{className:"rounded-2xl bg-muted/30 border border-border/50 px-4 md:px-8 lg:px-12",children:s.map((e,t)=>(0,a.jsx)(g,{item:e,index:t,imageLabel:r.imageLabel,aiCreatedLabel:r.aiCreatedLabel},e.id))})]})}},61294:(e,t,r)=>{"use strict";r.d(t,{BT:()=>c,Wu:()=>m,X9:()=>u,ZB:()=>d,Zp:()=>i,aR:()=>o,wL:()=>x});var a=r(80735);r(14679);var s=r(6744),l=r(83563);let n=(0,s.F)("bg-card text-card-foreground flex flex-col rounded-xl border shadow-sm",{variants:{variant:{default:"border-border",interactive:"border-border transition-all duration-200 hover:border-primary/50 hover:shadow-md cursor-pointer","interactive-scale":"border-border transition-all duration-200 hover:border-primary/50 hover:shadow-md hover:scale-[1.02] cursor-pointer",selected:"border-primary/60 bg-primary/5 shadow-md",ai:"border-primary/30 shadow-md","ai-selected":"border-primary bg-primary/5 shadow-md",outline:"border-border bg-transparent",ghost:"border-transparent bg-transparent shadow-none"},padding:{default:"p-6",sm:"p-4",lg:"p-8",none:"p-0"}},defaultVariants:{variant:"default",padding:"default"}});function i(e){let{className:t,variant:r,padding:s,...i}=e;return(0,a.jsx)("div",{"data-slot":"card",className:(0,l.cn)(n({variant:r,padding:s,className:t})),...i})}function o(e){let{className:t,...r}=e;return(0,a.jsx)("div",{"data-slot":"card-header",className:(0,l.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6 [.p-0_&]:px-0 [.p-4_&]:px-4 [.p-8_&]:px-8",t),...r})}function d(e){let{className:t,...r}=e;return(0,a.jsx)("div",{"data-slot":"card-title",className:(0,l.cn)("leading-none font-semibold tracking-tight",t),...r})}function c(e){let{className:t,...r}=e;return(0,a.jsx)("div",{"data-slot":"card-description",className:(0,l.cn)("text-muted-foreground text-sm",t),...r})}function u(e){let{className:t,...r}=e;return(0,a.jsx)("div",{"data-slot":"card-action",className:(0,l.cn)("col-start-2 row-span-2 row-start-1 self-start justify-self-end",t),...r})}function m(e){let{className:t,...r}=e;return(0,a.jsx)("div",{"data-slot":"card-content",className:(0,l.cn)("px-6 [.p-0_&]:px-0 [.p-4_&]:px-4 [.p-8_&]:px-8",t),...r})}function x(e){let{className:t,...r}=e;return(0,a.jsx)("div",{"data-slot":"card-footer",className:(0,l.cn)("flex items-center px-6 [.border-t]:pt-6 [.p-0_&]:px-0 [.p-4_&]:px-4 [.p-8_&]:px-8",t),...r})}},61422:(e,t,r)=>{"use strict";r.d(t,{default:()=>f});var a=r(80735),s=r(87304),l=r.n(s),n=r(14679),i=r(84787),o=r(93430),d=r(99816),c=r(13179),u=r(19325),m=r(9900),x=r
1(87478),p=r(83563);let g=["Teach me the water cycle for 5th grade, with a quiz","Turn this biology chapter into a narrated lesson","Explain the French Revolution in 8 slides","Onboarding: how our refund policy works"];function f(e){var t,r,s,f,v,j;let{section:N}=e,w=(null===(t=N.examples)||void 0===t?void 0:t.length)?N.examples:g,y=N.launchUrl||"/api/app/launch",[_,k]=(0,n.useState)(""),[C,A]=(0,n.useState)(0),P=(0,n.useRef)(!1);(0,n.useEffect)(()=>{let e=window.setInterval(()=>{P.current||_||A(e=>(e+1)%w.length)},3200);return()=>window.clearInterval(e)},[w.length,_]);let S=N.placeholder||w[C],L=()=>{try{let e=_.trim();e&&window.sessionStorage.setItem("lessonlab:draftPrompt",e)}catch(e){}window.location.href=y},M=N.preview,I=(null==M?void 0:null===(r=M.quizOptions)||void 0===r?void 0:r.length)?M.quizOptions:["Evaporation","Photosynthesis","Condensation"],E="number"==typeof(null==M?void 0:M.correctIndex)?M.correctIndex:0,z=(0,n.useMemo)(()=>Array.from({length:28}),[]);return(0,a.jsxs)("section",{className:"relative overflow-hidden",children:[(0,a.jsx)("style",{children:h}),(0,a.jsx)("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 opacity-[0.55]",style:{background:"radial-gradient(60% 55% at 50% 0%, color-mix(in oklch, var(--primary) 9%, transparent) 0%, transparent 70%)"}}),(0,a.jsx)("div",{className:"container relative mx-auto px-4 py-16 md:py-24",children:(0,a.jsxs)("div",{className:"grid items-center gap-10 lg:grid-cols-2 lg:gap-14",children:[(0,a.jsxs)("div",{className:"mx-auto w-full max-w-xl lg:mx-0",children:[N.chip?(0,a.jsxs)("div",{className:"mb-5 inline-flex items-center gap-2 rounded-full border border-border bg-card px-3 py-1 text-xs font-medium text-muted-foreground",children:[(0,a.jsx)(i.A,{className:"h-3.5 w-3.5 text-primary"}),N.chip]}):null,(0,a.jsx)("h1",{className:"text-balance text-4xl font-semibold leading-[1.08] tracking-tight text-foreground md:text-5xl",children:function(e,t){if(!e)return null;if(!t||!e.includes(t))return e;let[r,s]=e.split(t);return(0,a.jsxs)(a.Fragment,{children:[r,(0,a.jsx)("span",{className:"text-primary",children:t}),s]})}(N.title,N.highlight_text)}),N.description?(0,a.jsx)("p",{className:"mt-5 max-w-lg text-base leading-relaxed text-muted-foreground md:text-lg",children:N.description}):null,(0,a.jsxs)("div",{className:"mt-7 rounded-2xl border border-border bg-card p-3 shadow-[0_18px_50px_-24px_rgba(20,30,45,0.45)] transition focus-within:border-primary/40",children:[(0,a.jsx)("label",{htmlFor:"lesson-composer-input",className:"sr-only",children:"Describe the lesson you want"}),(0,a.jsx)("textarea",{id:"lesson-composer-input",value:_,onChange:e=>k(e.target.value),onFocus:()=>P.current=!0,onBlur:()=>P.current=!1,onKeyDown:e=>{(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&L()},rows:3,placeholder:S,className:"max-h-48 min-h-[92px] w-full resize-none bg-transparent px-2 py-1.5 text-[15px] leading-relaxed text-foreground outline-none placeholder:text-muted-foreground/70"}),(0,a.jsxs)("div",{className:"mt-1 flex items-center justify-between gap-2",children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-1.5",children:[(0,a.jsx)(b,{icon:(0,a.jsx)(o.A,{className:"h-3.5 w-3.5"}),children:(null===(s=N.toolbar)||void 0===s?void 0:s.model)||"Smart"}),(0,a.jsx)(b,{icon:(0,a.jsx)(d.A,{className:"h-3.5 w-3.5"}),children:(0,a.jsx)("span",{className:"hidden sm:inline",children:(null===(f=N.toolbar)||void 0===f?void 0:f.upload)||"PDF"})}),(0,a.jsx)(b,{icon:(0,a.jsx)(c.A,{className:"h-3.5 w-3.5"}),children:(0,a.jsx)("span",{className:"hidden sm:inline",children:(null===(v=N.toolbar)||void 0===v?void 0:v.voice)||"Narration"})})]}),(0,a.jsxs)("button",{type:"button",onClick:L,className:"inline-flex shrink-0 items-center gap-1.5 rounded-xl bg-primary px-4 py-2.5 text-sm font-semibold text-primary-foreground shadow-sm transition hover:opacity-90 active:scale-[0.98]",children:[N.submitLabel||"Create a lesson",(0,a.jsx)(u.A,{className:"h-4 w-4"})]})]})]}),N.secondaryLabel?(0,a.jsx)("div",{className:"mt-4 flex items-center gap-4 text-sm",children:(0,a.jsx)(l(),{href:N.secondaryUrl||"/pricing",className:"font-medium text-primary underline-offset-4 hover:underline",children:N.secondaryLabel})}):null,(null===(j=N.trustChips)||void 0===j?void 0:j.length)?(0,a.jsx)("ul",{className:"mt-6 flex flex-wrap gap-x-5 gap-y-2 text-sm text-muted-foreground",children:N.trustChips.map(e=>(0,a.jsxs)("li",{className:"inline-flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-[var(--ai-accent)]"}),e]},e))}):null]}),(0,a.jsx)("div",{className:"relative mx-auto w-full max-w-xl lg:mx-0",children:(0,a.jsxs)("div",{className:"llc-float roun
1ded-2xl border border-border bg-card p-4 shadow-[0_30px_80px_-40px_rgba(20,30,45,0.6)]",children:[(0,a.jsxs)("div",{className:"mb-3 flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("span",{className:"h-2.5 w-2.5 rounded-full bg-[var(--ai-accent)]/70"}),(0,a.jsx)("span",{className:"h-2.5 w-2.5 rounded-full bg-primary/30"}),(0,a.jsx)("span",{className:"h-2.5 w-2.5 rounded-full bg-primary/20"})]}),(0,a.jsx)("span",{className:"text-[11px] font-medium text-muted-foreground",children:(null==M?void 0:M.sceneLabel)||"Scene 3 / 8"})]}),(0,a.jsxs)("div",{className:"rounded-xl border border-border bg-background p-5",children:[(0,a.jsxs)("div",{className:"mb-4 flex items-center gap-2",children:[(0,a.jsx)(m.A,{className:"h-4 w-4 text-primary"}),(0,a.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:(null==M?void 0:M.slideTitle)||"How the water cycle works"})]}),(0,a.jsx)("div",{className:"flex h-24 items-end gap-2",children:[62,88,45,74,96,58,80].map((e,t)=>(0,a.jsx)("div",{className:"llc-bar flex-1 rounded-t-md",style:{height:"".concat(e,"%"),background:t%2==0?"var(--primary)":"var(--ai-accent)",animationDelay:"".concat(.12*t,"s")}},t))}),(0,a.jsxs)("div",{className:"mt-4 flex items-center gap-3 rounded-lg bg-secondary/60 px-3 py-2",children:[(0,a.jsx)("span",{className:"grid h-7 w-7 shrink-0 place-items-center rounded-full bg-primary text-primary-foreground",children:(0,a.jsx)(x.A,{className:"h-3.5 w-3.5",fill:"currentColor"})}),(0,a.jsx)("div",{className:"flex h-6 flex-1 items-center gap-[3px]",children:z.map((e,t)=>(0,a.jsx)("span",{className:"llc-wave w-[3px] rounded-full bg-primary/60",style:{animationDelay:"".concat(t%14*.08,"s")}},t))}),(0,a.jsx)("span",{className:"shrink-0 text-[11px] font-medium text-muted-foreground",children:(null==M?void 0:M.narrationLabel)||"Narrating"})]})]}),(0,a.jsxs)("div",{className:"mt-3 rounded-xl border border-border bg-background p-4",children:[(0,a.jsx)("p",{className:"mb-3 text-xs font-semibold text-foreground",children:(null==M?void 0:M.quizPrompt)||"Which step turns vapor back into water?"}),(0,a.jsx)("div",{className:"space-y-2",children:I.map((e,t)=>(0,a.jsxs)("div",{className:(0,p.cn)("flex items-center justify-between rounded-lg border px-3 py-2 text-xs",t===E?"llc-correct border-primary/40 text-foreground":"border-border text-muted-foreground"),children:[(0,a.jsx)("span",{children:e}),t===E?(0,a.jsx)("span",{className:"llc-check text-primary",children:"✓"}):null]},e))})]}),(0,a.jsx)("div",{className:"mt-3 flex items-center justify-center gap-1.5",children:Array.from({length:8}).map((e,t)=>(0,a.jsx)("span",{className:"llc-dot h-1.5 rounded-full bg-primary/25",style:{animationDelay:"".concat(.5*t,"s")}},t))})]})})]})})]})}function b(e){let{icon:t,children:r}=e;return(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-lg border border-border bg-background px-2.5 py-1.5 text-xs font-medium text-muted-foreground",children:[t,r]})}let h="\n@keyframes llc-float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }\n@keyframes llc-bar { 0%,100%{transform:scaleY(0.72)} 50%{transform:scaleY(1)} }\n@keyframes llc-wave { 0%,100%{transform:scaleY(0.35)} 50%{transform:scaleY(1)} }\n@keyframes llc-dot { 0%,100%{width:6px;opacity:.35} 50%{width:20px;opacity:1} }\n@keyframes llc-correct { 0%,55%{background:transparent} 62%,100%{background:color-mix(in oklch, var(--primary) 10%, transparent)} }\n@keyframes llc-check { 0%,55%{opacity:0;transform:scale(.6)} 68%,100%{opacity:1;transform:scale(1)} }\n.llc-float{animation:llc-float 6s ease-in-out infinite;will-change:transform}\n.llc-bar{transform-origin:bottom;animation:llc-bar 2.4s ease-in-out infinite;will-change:transform}\n.llc-wave{height:100%;transform-origin:center;animation:llc-wave 1.1s ease-in-out infinite;will-change:transform}\n.llc-dot{animation:llc-dot 4s ease-in-out infinite}\n.llc-correct{animation:llc-correct 5s ease-in-out infinite}\n.llc-check{animation:llc-check 5s ease-in-out infinite}\n@media (prefers-reduced-motion: reduce){\n  .llc-float,.llc-bar,.llc-wave,.llc-dot,.llc-correct,.llc-check{animation:none}\n}\n"}
1,69029:(e,t,r)=>{"use strict";r.d(t,{default:()=>m});var a=r(80735),s=r(14679),l=r(16559),n=r(93070),i=r(87478),o=r(40552),d=r(68647),c=r(40424),u=r(32420);function m(e){var t,r;let{section:m}=e,x=null!==(t=null==m?void 0:m.items)&&void 0!==t?t:[],{play:p,toggle:g}=(0,c.Kw)(),f=(0,c.kT)(),b=(0,u.u)(e=>e.isPlaying),h=(0,s.useMemo)(()=>x.filter(e=>e.audioUrl).map(e=>({id:e.audioUrl,audioUrl:e.audioUrl,coverUrl:e.cover,title:e.title,subtitle:e.prompt||e.label,lyrics:e.lyrics,instrumental:e.instrumental,source:"showcase"})),[x]),v=e=>{if(!e.audioUrl)return;if((null==f?void 0:f.id)===e.audioUrl){g();return}let t=h.findIndex(t=>t.id===e.audioUrl);t>=0&&p(h,t)};return 0===x.length?null:(0,a.jsx)("section",{id:null!==(r=null==m?void 0:m.name)&&void 0!==r?r:"audio-showcase",className:"py-16 lg:py-24",children:(0,a.jsxs)("div",{className:"container",children:[(0,a.jsxs)("div",{className:"text-center max-w-2xl mx-auto mb-10 lg:mb-14",children:[(null==m?void 0:m.label)&&(0,a.jsx)("div",{className:"text-xs font-medium uppercase tracking-wider text-muted-foreground mb-3",children:m.label}),(null==m?void 0:m.title)&&(0,a.jsx)("h2",{className:"text-3xl lg:text-4xl font-semibold tracking-tight mb-4",children:m.title}),(null==m?void 0:m.description)&&(0,a.jsx)("p",{className:"text-muted-foreground text-base lg:text-lg leading-relaxed",children:m.description})]}),(0,a.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4 lg:gap-5",children:x.map((e,t)=>{let r=!!(e.audioUrl&&(null==f?void 0:f.id)===e.audioUrl),s=r&&b,c=!!e.audioUrl;return(0,a.jsxs)("article",{"data-active":r||void 0,className:"group rounded-2xl bg-card border border-border data-[active]:border-foreground
1/30 transition-all duration-200 hover:shadow-[0_12px_24px_-16px_rgba(0,0,0,0.25)] data-[active]:shadow-[0_16px_32px_-16px_rgba(0,0,0,0.28)]",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>v(e),disabled:!c,"aria-label":s?"Pause ".concat(e.title):"Play ".concat(e.title),"aria-pressed":s,className:"relative block w-full overflow-hidden rounded-2xl rounded-b-none focus:outline-none focus-visible:ring-2 focus-visible:ring-foreground/40",children:[(0,a.jsx)(o.z,{src:e.cover,alt:e.title,fallback:(0,a.jsx)("span",{className:"absolute inset-0 grid place-items-center",children:(0,a.jsx)(l.A,{className:"h-7 w-7 text-muted-foreground"})}),className:"aspect-square w-full",imgClassName:"transition-transform duration-[600ms] ease-out ".concat(r?"scale-[1.04]":"group-hover:scale-[1.04]")}),(0,a.jsx)("span",{"aria-hidden":!0,className:"absolute inset-0 transition-colors duration-200 ".concat(r?"bg-black/20":"bg-black/0 group-hover:bg-black/15")}),s&&(0,a.jsx)("span",{className:"absolute top-2.5 left-2.5 inline-flex items-center gap-1.5 h-7 px-2.5 rounded-full bg-black/65 backdrop-blur-sm text-white shadow-sm",children:(0,a.jsx)(d.Z,{})}),c?(0,a.jsx)("span",{"aria-hidden":!0,className:"absolute bottom-2.5 right-2.5 flex items-center justify-center h-11 w-11 rounded-full bg-white text-black shadow-[0_8px_20px_-6px_rgba(0,0,0,0.4)] transition-transform duration-200 ".concat(r?"scale-105":"group-hover:scale-110 group-active:scale-95"),children:s?(0,a.jsx)(n.A,{className:"w-5 h-5",fill:"currentColor"}):(0,a.jsx)(i.A,{className:"w-5 h-5 ml-0.5",fill:"currentColor"})}):(0,a.jsx)("span",{className:"absolute bottom-2.5 left-2.5 inline-flex items-center h-6 px-2 rounded-full bg-background/90 text-[10px] font-medium uppercase tracking-wide text-muted-foreground shadow-sm",children:"Coming soon"})]}),(0,a.jsxs)("div",{className:"p-3.5 sm:p-4",children:[(0,a.jsx)("h3",{className:"text-[15px] font-semibold tracking-tight truncate text-foreground",children:e.title}),e.label&&(0,a.jsx)("p",{className:"mt-0.5 text-[11.5px] font-medium text-muted-foreground tabular-nums truncate",children:e.label}),e.prompt&&(0,a.jsx)("p",{className:"mt-2 text-[11.5px] text-muted-foreground/90 line-clamp-2 leading-snug",children:e.prompt}),(()=>{var t,r;let s=[];e.instrumental&&(null==m?void 0:m.instrumentalLabel)&&s.push(m.instrumentalLabel),e.language&&(null==m?void 0:null===(t=m.languageLabels)||void 0===t?void 0:t[e.language])&&s.push(m.languageLabels[e.language]);let l=null!==(r=e.tags)&&void 0!==r?r:[];return 0===s.length&&0===l.length?null:(0,a.jsxs)("div",{className:"mt-3 flex flex-wrap gap-1.5",children:[s.map(e=>(0,a.jsx)("span",{className:"px-2 py-0.5 rounded-full border border-foreground
1/25 bg-background text-[10px] font-medium text-foreground",children:e},"meta-".concat(e))),l.map(e=>(0,a.jsx)("span",{className:"px-2 py-0.5 rounded-full bg-muted text-[10px] font-medium text-muted-foreground",children:e},e))]})})()]})]},"".concat(e.title,"-").concat(t))})})]})})}},69520:(e,t,r)=>{"use strict";r.d(t,{default:()=>i});var a=r(80735),s=r(14679),l=r(64930),n=r(83563);function i(e){let{title:t,subtitle:r,tabs:i,defaultTab:o=0,className:d}=e,[c,u]=(0,s.useState)(o);return(0,a.jsxs)("section",{className:(0,n.cn)("w-full pt-10 pb-16 lg:pt-12 lg:pb-24 space-y-6",d),children:[(0,a.jsxs)("div",{className:"text-center space-y-2 px-4 md:px-8",children:[(0,a.jsx)("h2",{className:"text-3xl lg:text-4xl font-bold tracking-tight",children:(0,a.jsx)("span",{className:"text-primary",children:t})}),(0,a.jsx)("p",{className:"text-muted-foreground text-lg max-w-2xl mx-auto",children:r})]}),(0,a.jsxs)("div",{className:"container mx-auto px-4",children:[(0,a.jsx)("div",{className:"overflow-x-auto scrollbar-hide mb-6",children:(0,a.jsx)("div",{role:"tablist","aria-label":"Model comparison categories",className:"flex gap-2 min-w-max px-4 lg:px-0 lg:justify-center",children:i.map((e,t)=>(0,a.jsx)("button",{role:"tab","aria-selected":c===t,"aria-controls":"tabpanel-".concat(e.id),id:"tab-".concat(e.id),onClick:()=>u(t),className:(0,n.cn)("px-4 md:px-6 py-2.5 md:py-3 rounded-lg text-sm md:text-base font-medium transition-all duration-200 whitespace-nowrap focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2",c===t?"bg-primary/20 text-white font-semibold border border-primary/30":"bg-muted/60 text-muted-foreground hover:bg-muted hover:text-foreground border border-transparent"),children:e.label},e.id))})}),i.map((e,t)=>(0,a.jsx)("div",{id:"tabpanel-".concat(e.id),role:"tabpanel","aria-labelledby":"tab-".concat(e.id),className:c===t?"block":"hidden",children:(0,a.jsx)(l.default,{...e.showcaseProps,useDefaultHeader:!1,isActive:c===t})},e.id))]})]})}},71168:(e,t,r)=>{"use strict";r.d(t,{Table:()=>l,TableBody:()=>i,TableCell:()=>c,TableHead:()=>d,TableHeader:()=>n,TableRow:()=>o});var a=r(80735);r(14679);var s=r(83563);function l(e){let{className:t,...r}=e;return(0,a.jsx)("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto rounded-lg border border-border",children:(0,a.jsx)("table",{"data-slot":"table",className:(0,s.cn)("w-full caption-bottom text-sm",t),...r})})}function n(e){let{className:t,...r}=e;return(0,a.jsx)("thead",{"data-slot":"table-header",className:(0,s.cn)("bg-muted/50 [&_tr]:border-b",t),...r})}function i(e){let{className:t,...r}=e;return(0,a.jsx)("tbody",{"data-slot":"table-body",className:(0,s.cn)("divide-y divide-border [&_tr:last-child]:border-0",t),...r})}function o(e){let{className:t,...r}=e;return(0,a.jsx)("tr",{"data-slot":"table-row",className:(0,s.cn)("hover:bg-muted/50 data-[state=selected]:bg-muted transition-colors duration-150",t),...r})}function d(e){let{className:t,...r}=e;return(0,a.jsx)("th",{"data-slot":"table-head",className:(0,s.cn)("text-foreground h-12 px-4 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...r})}function c(e){let{className:t,...r}=e;return(0,a.jsx)("td",{"data-slot":"table-cell",className:(0,s.cn)("px-4 py-3 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...r})}},73683:(e,t,r)=>{"use strict";r.d(t,{AudioVoiceStudio:()=>eu});var a=r(80735),s=r(14679),l=r(56061),n=r(54768),i=r(48780),o=r(73918),d=r(99463),c=r(70677),u=r(46854),m=r(4168),x=r(1801),p=r(91533),g=r(13916),f=r(4150),b=r(74383),h=r(35360),v=r(83563);function j(e){return e.trim().length}let N=[{id:"530e2e20-58e2-45d8-b0a5-4594f4915944",name:"Paul - Sad",slug:"en_paul_sad",languages:["en_us"],gender:"male",age:30,tags:["casual","animated","sad"],color:"#1ABC9C",userId:null},{id:"c69964a6-ab8b-4f8a-9465-ec0925096ec8",name:"Paul - Neutral",slug:"en_paul_neutral",languages:["en_us"],gender:"male",age:30,tags:["casual","animated","neutral"],color:"#1ABC9C",userId:null},{id:"1024d823-a11e-43ee-bf3d-d440dccc0577",name:"Paul - Happy",slug:"en_paul_happy",languages:["en_us"],gender:"male",age:30,tags:["casual","animated","happy"],color:"#1ABC9C",userId:null},{id:"1f017bcb-02e5-460d-989b-db065c0c6122",name:"Paul - Frustrated",slug:"en_paul_frustrated",languages:["en_us"],gender:"male",age:30,tags:["casual","animated","frustrated"],color:"#1ABC9C",userId:null},{id:"5940190b-f58a-4c3e-8264-a40d63fd6883",name:"Paul - Excited",slug:"en_paul_excited",languages:["en_us"],gender:"male",age:30,tags:["casual","animated","excited"],color:"#1ABC9C",userId:null},{id:"98559b22-62b5-4a64-a7cd-fc78ca41faa8",name:"Paul - Confident",slug:"en_paul_confident",languages:["en_us"],gender:"male",age:30,tags:["casual","animated","confident"],color:"#1ABC9C",userId:null}
1,{id:"01d985cd-5e0c-4457-bfd8-80ba31a5bc03",name:"Paul - Cheerful",slug:"en_paul_cheerful",languages:["en_us"],gender:"male",age:30,tags:["casual","animated","cheerful"],color:"#1ABC9C",userId:null},{id:"cb891218-482c-4392-9878-91e8d999d57a",name:"Paul - Angry",slug:"en_paul_angry",languages:["en_us"],gender:"male",age:30,tags:["casual","animated","angry"],color:"#1ABC9C",userId:null},{id:"e3596645-b1af-469e-b857-f18ddedc7652",name:"Oliver - Neutral",slug:"gb_oliver_neutral",languages:["en_gb"],gender:"male",age:30,tags:["articulate","excited","neutral"],color:"#C347C8",userId:null},{id:"a3e41ea8-020b-44c0-8d8b-f6cc03524e31",name:"Jane - Sarcasm",slug:"gb_jane_sarcasm",languages:["en_gb"],gender:"female",age:30,tags:["polite","dramatic","sarcasm"],color:"#318E68",userId:null},{id:"7d0a90a3-c211-4489-aaa0-61269299edc7",name:"Jane - Confused",slug:"gb_jane_confused",languages:["en_gb"],gender:"female",age:30,tags:["polite","dramatic","confused"],color:"#318E68",userId:null},{id:"d4101b8f-12c3-450d-a812-7d700b3a3245",name:"Oliver - Sad",slug:"gb_oliver_sad",languages:["en_gb"],gender:"male",age:30,tags:["articulate","excited","sad"],color:"#C347C8",userId:null},{id:"e8e5b1de-493c-4061-8414-e2170f9f4b6f",name:"Oliver - Excited",slug:"gb_oliver_excited",languages:["en_gb"],gender:"male",age:30,tags:["articulate","excited","excited"],color:"#C347C8",userId:null},{id:"390c8a2b-60a6-4882-8437-c49a8bd33b63",name:"Oliver - Curious",slug:"gb_oliver_curious",languages:["en_gb"],gender:"male",age:30,tags:["articulate","excited","curious"],color:"#C347C8",userId:null},{id:"8169ab87-bc99-4669-a5ec-6855860ace24",name:"Oliver - Confident",slug:"gb_oliver_confident",languages:["en_gb"],gender:"male",age:30,tags:["articulate","excited","confident"],color:"#C347C8",userId:null},{id:"5ad5d44e-6b4e-4a57-a8a8-4cae088034ed",name:"Oliver - Cheerful",slug:"gb_oliver_cheerful",languages:["en_gb"],gender:"male",age:30,tags:["articulate","excited","cheerful"],color:"#C347C8",userId:null},{id:"862274a7-8333-48f7-b668-f19c932999e0",name:"Oliver - Angry",slug:"gb_oliver_angry",languages:["en_gb"],gender:"male",age:30,tags:["articulate","excited","angry"],color:"#C347C8",userId:null},{id:"4adeb2c6-25a3-44bc-8100-5234dfc1193b",name:"Marie - Sad",slug:"fr_marie_sad",languages:["fr_fr"],gender:"female",age:30,tags:["strong","commercial","sad"],color:"#0082E6",userId:null},{id:"5a271406-039d-46fe-835b-fbbb00eaf08d",name:"Marie - Neutral",slug:"fr_marie_neutral",languages:["fr_fr"],gender:"female",age:30,tags:["strong","commercial","neutral"],color:"#0082E6",userId:null},{id:"49d024dd-981b-4462-bb17-74d381eb8fd7",name:"Marie - Happy",slug:"fr_marie_happy",languages:["fr_fr"],gender:"female",age:30,tags:["strong","commercial","happy"],color:"#0082E6",userId:null},{id:"2f62b1af-aea3-4079-9d10-7ca665ee7243",name:"Marie - Excited",slug:"fr_marie_excited",languages:["fr_fr"],gender:"female",age:30,tags:["strong","commercial","excited"],color:"#0082E6",userId:null},{id:"e0580ce5-e63c-4cbe-88c8-a983b80c5f1f",name:"Marie - Curious",slug:"fr_marie_curious",languages:["fr_fr"],gender:"female",age:30,tags:["strong","commercial","curious"],color:"#0082E6",userId:null},{id:"a7c07cdc-1c35-4d87-a938-c610a654f600",name:"Marie - Angry",slug:"fr_marie_angry",languages:["fr_fr"],gender:"female",age:30,tags:["strong","commercial","angry"],color:"#0082E6",userId:null},{id:"230ccacf-8800-4aa0-8ac2-8d004f1d9fb7",name:"Jane - Shameful",slug:"gb_jane_shameful",languages:["en_gb"],gender:"female",age:30,tags:["polite","dramatic","shameful"],color:"#318E68",userId:null},{id:"c7a8eb83-5247-4540-89f3-6650d349100d",name:"Jane - Sad",slug:"gb_jane_sad",languages:["en_gb"],gender:"female",age:30,tags:["polite","dramatic","sad"],color:"#318E68",userId:null},{id:"82c99ee6-f932-423f-a4a3-d403c8914b8d",name:"Jane - Neutral",slug:"gb_jane_neutral",languages:["en_gb"],gender:"female",age:30,tags:["polite","dramatic","neutral"],color:"#318E68",userId:null},{id:"e7168caa-f7ed-4e1c-98a1-434251f4f2b0",name:"Jane - Jealousy",slug:"gb_jane_jealousy",languages:["en_gb"],gender:"female",age:30,tags:["polite","dramatic","jealousy"],color:"#318E68",userId:null},{id:"60844938-221d-4d1e-8233-34203f787d9f",name:"Jane - Frustrated",slug:"gb_jane_frustrated",languages:["en_gb"],gender:"female",age:30,tags:["polite","dramatic","frustrated"],color:"#318E68",userId:null},{id:"5de47977-6e47-4266-a938-3bc1d76b4676",name:"Jane - Curious",slug:"gb_jane_curious",languages:["en_gb"],gender:"female",age:30,tags:["polite","dramatic","curious"],color:"#318E68",userId:null},{id:"cbe96cf0-85ec-4a10-accb-0b35c93b6dfd",name:"Jane - Confident",slug:"gb_jane_confident",languages:["en_gb"],gender:"female",age:30,tags:["polite","dramatic","confident"],color:"#318E68",userId:null}],w="c69964a6-ab8b-4f8a-9465-ec0925096ec8";var y=r(93616);function _(e){if(!e||"object"!=typeof e)return"Voice generation failed. Please try again.";for(let t of[e.message,e.msg,e.error])if("string"==typeof t&&t.trim())return t.trim();return"Voice generation failed. Please try again."}async function k(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:fetch,r=await t("/api/audio/speech",{method:"POST",body:e});
1if(401===r.status)return{kind:"auth_required"};if(402===r.status){let e=await (0,y.gb)(r);return{kind:"insufficient_credits",creditsInfo:(0,y.Nw)(e),message:_(e)}}return r.ok?{kind:"success",response:r}:{kind:"error",message:_(await (0,y.gb)(r))}}var C=r(80641),A=r(99015),P=r(13179);function S(e){let{durationSeconds:t,fileInputRef:r,isPreparing:s,isRecording:l,recorderErrorMessage:n,recordingSupported:o,referenceAudio:d,referenceAudioUrl:m,t:x,onClearReferenceAudio:p,onFileChange:f,onStartRecording:b,onStopRecording:h}=e;return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("div",{className:"text-base font-semibold text-foreground",children:x("ui.voice_studio_your_voice_title")}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:x("ui.voice_studio_your_voice_description")})]}),(0,a.jsx)("input",{ref:r,type:"file",accept:"audio/*",className:"hidden",onChange:e=>{var t,r;f(null!==(r=null===(t=e.target.files)||void 0===t?void 0:t[0])&&void 0!==r?r:null)}}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsxs)(g.$,{type:"button",variant:"outline",onClick:()=>{var e;return null===(e=r.current)||void 0===e?void 0:e.click()},children:[(0,a.jsx)(C.A,{className:"h-4 w-4"}),x(d?"ui.voiceover_reference_audio_replace":"ui.voiceover_reference_audio_pick")]}),o?l?(0,a.jsxs)(g.$,{type:"button",variant:"outline",onClick:h,children:[(0,a.jsx)(A.A,{className:"h-4 w-4"}),x("ui.voice_studio_record_stop")]}):(0,a.jsxs)(g.$,{type:"button",variant:"outline",onClick:()=>void b(),disabled:s,children:[s?(0,a.jsx)(u.A,{className:"h-4 w-4 animate-spin"}):(0,a.jsx)(P.A,{className:"h-4 w-4"}),x(d?"ui.voice_studio_record_retry":"ui.voice_studio_record_start")]}):(0,a.jsx)("div",{className:"rounded-full border border-border bg-muted/30 px-3 py-1 text-xs text-muted-foreground",children:x("ui.voice_studio_recording_not_supported")}),l?(0,a.jsxs)("div",{className:"inline-flex items-center gap-2 rounded-full border border-primary/20 bg-primary/10 px-3 py-1 text-xs text-primary",children:[(0,a.jsxs)("span",{className:"relative flex h-2 w-2",children:[(0,a.jsx)("span",{className:"absolute inline-flex h-full w-full animate-ping rounded-full bg-primary opacity-75"}),(0,a.jsx)("span",{className:"relative inline-flex h-2 w-2 rounded-full bg-primary"})]}),x("ui.voice_studio_recording")," ",function(e){let t=Math.floor(e/60);return"".concat(String(t).padStart(2,"0"),":").concat(String(e%60).padStart(2,"0"))}(t)]}):null]}),n?(0,a.jsx)("div",{className:"rounded-lg border border-destructive/30 bg-destructive/5 px-3 py-2 text-sm text-destructive",children:n}):null,d?(0,a.jsxs)("div",{className:"space-y-3 rounded-xl border border-border/60 bg-background/70 p-3",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,a.jsxs)("div",{className:"min-w-0 space-y-1",children:[(0,a.jsxs)("div",{className:"inline-flex max-w-full items-center gap-2 text-sm font-medium text-foreground",children:[(0,a.jsx)(c.A,{className:"h-4 w-4 text-primary"}),(0,a.jsx)("span",{children:x("ui.voice_studio_clone_label")})]}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:x("ui.voice_studio_clone_ready")})]}),(0,a.jsxs)("button",{type:"button",onClick:p,className:"inline-flex items-center gap-1 text-xs text-muted-foreground transition-colors hover:text-foreground",children:[(0,a.jsx)(i.A,{className:"h-3.5 w-3.5"}),x("ui.voiceover_clear_reference_audio")]})]}),m?(0,a.jsx)("audio",{controls:!0,src:m,className:"w-full"}):null]}):null]})}var L=r(35008),M=r(98459),I=r(62017),E=r(77196);function z(e){let{voice:t,t:r}=e;return(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-border/70 bg-background/80 px-2.5 py-1 text-xs font-medium text-foreground",children:[(0,a.jsx)("span",{"aria-hidden":"true",children:t.emotion.emoji}),(0,a.jsx)("span",{children:r(t.emotion.labelKey)})]})}function R(e){let{voice:t,selected:r,t:s,onSelect:l}=e;return(0,a.jsx)("button",{type:"button",onClick:()=>l(t),className:(0,v.cn)("rounded-xl border p-3 text-left transition-all duration-200",r?"border-primary bg-primary/10 ring-1 ring-primary/20":"border-border bg-card/70 hover:border-primary/50 hover:bg-muted/40"),children:(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,a.jsxs)("div",{className:"min-w-0 space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-lg leading-none","aria-hidden":"true",children:t.locale.flag}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("div",{className:"truncate text-sm font-medium text-foreground",children:t.personaName}),(0,a.jsx)("div",{className:"truncate text-xs text-muted-foreground",children:s(t.locale.labelKey)})]})]}),(0,a.jsx)(z,{voice:t,t:s}),t.description?(0,a.jsx)("p",{className:"line-clamp-2 text-xs text-muted-foreground",children:t.description}):null]}),r?(0,a.jsx)(L.A,{className:"mt-0.5 h-4 w-4 text-primary"}):null]})})}function U(e){let{voice:t,selected:r,t:s,onSelect:l}=e;return(0,a.jsx)("button",{type:"button",onClick:()=>l(t),className:(0,v.cn)("rounded-xl border p-3 text-left transition-all duration-200",r?"border-primary bg-primary/10 ring-1 ring-primary/20":"border-border bg-card/70 hover:border-primary/50 hover:bg-muted/40"),children:(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,a.jsxs)("div",{className:"min-w-0 space-y-2",children:[(0,a.jsx)("div",{className:"truncate text-sm font-medium text-foreground",children:t.name}),(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,a.jsx)("span",{className:"text-base leading-none","aria-hidden":"true",children:t.locale.flag}),(0,a.jsx)("span",{children:s(t.locale.labelKey)})]}),t.description?(0,a.jsx)("p",{className:"line-clamp-2 text-xs text-muted-foreground",children:t.description}):null]}),r?(0,a.jsx)(L.A,{className:"mt-0.5 h-4 w-4 text-primary"}):null]})})}function T(e){var t;let{activeLocaleKey:r,isSignedIn:s,selectedVoiceId:l,t:n,voiceCatalog:i,voicesError:o,voicesLoading:d,onActiveLocaleChange:c,onSelectVoice:u}=e,m=null!==(t=i.presetGroups.find(e=>e.locale.key===r))&&void 0!==t?t:i.presetGroups[0],x=s&&(d||!!o||i.savedVoices.length>0);return(0,a.jsxs)("div",{className:"space-y-6",children:[x?(0,a.jsxs)("section",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-sm font-semibold text-foreground",children:n("ui.voice_studio_saved_voices_title")}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:n("ui.voice_studio_saved_voices_hint")})]}),i.totalSavedVoices>0?(0,a.jsx)("span",{className:"inline-flex h-6 items-center rounded-full border border-border bg-background/70 px-2.5 text-xs font-medium text-muted-foreground",children:i.totalSavedVoices}):null]}),d?(0,a.jsx)("div",{className:"rounded-xl border border-dashed border-border bg-muted/20 px-4 py-5 text-sm text-muted-foreground",children:n("ui.voice_studio_saved_voices_loading")}):null,!d&&o?(0,a.jsx)("div",{className:"rounded-xl border border-dashed border-border bg-muted/20 px-4 py-5 text-sm text-muted-foreground",children:o}):null,!d&&i.savedVoices.length>0?(0,a.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:i.savedVoices.map(e=>(0,a.jsx)(U,{voice:e,selected:e.id===l,t:n,onSelect:e=>u(e.id)},e.id))}):null]}):null,i.presetGroups.length>0?(0,a.jsxs)("section",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-sm font-semibold text-foreground",children:n("ui.voice_studio_system_presets_title")}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:n("ui.voice_studio_library_description")})]}),(0,a.jsx)("span",{className:"inline-flex h-6 items-center rounded-full border border-border bg-background/70 px-2.5 text-xs font-medium text-muted-foreground",children:i.totalPresetVoices})]}),(0,a.jsx)("div",{className:"rounded-2xl border border-border/60 bg-background/40 p-3 md:p-4",children:(0,a.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[220px_minmax(0,1fr)]",children:[(0,a.jsx)("div",{className:"flex gap-2 overflow-x-auto pb-1 lg:block lg:space-y-2 lg:overflow-visible lg:pb-0",children:i.presetGroups.map(e=>{let t=e.locale.key===(null==m?void 0:m.locale.key);return(0,a.jsxs)("button",{type:"button",onClick:()=>c(e.locale.key),className:(0,v.cn)("flex min-w-[170px] shrink-0 items-center justify-between gap-3 rounded-xl border px-3 py-2.5 text-left transition-all duration-200 lg:w-full lg:min-w-0",t?"border-primary bg-primary/10 ring-1 ring-primary/20":"border-border bg-card/70 hover:border-primary/50 hover:bg-muted/40"),children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-lg leading-none","aria-hidden":"true",children:e.locale.flag}),(0,a.jsx)("span",{className:"truncate text-sm font-medium text-foreground",children:n(e.locale.labelKey)})]}),(0,a.jsx)("div",{className:"mt-1 text-xs text-muted-foreground",children:e.personas.length})]}),(0,a.jsx)("span",{className:"inline-flex h-6 shrink-0 items-center rounded-full border border-border/70 bg-background/80 px-2 text-xs font-medium text-muted-foreground",children:e.totalVoices})]},e.id)})}),m?(0,a.jsxs)("div",{className:"min-w-0 rounded-xl border border-border/60 bg-card/60 p-3 md:p-4",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-lg leading-none","aria-hidden":"true",children:m.locale.flag}),(0,a.jsx)("div",{className:"text-sm font-medium text-foreground",children:n(m.locale.labelKey)})]}),(0,a.jsx)("span",{className:"inline-flex h-6 items-center rounded-full border border-border bg-background/70 px-2.5 text-xs font-medium text-muted-foreground",children:m.totalVoices})]}),(0,a.jsx)("div",{className:"mt-4 space-y-4",children:m.personas.map(e=>(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,a.jsx)("div",{className:"text-xs font-medium uppercase tracking-[0.16em] text-muted-foreground",children:e.name}),(0,a.jsx)("span",{className:"inline-flex h-5 items-center rounded-full border border-border/70 bg-background/80 px-2 text-[11px] font-medium text-muted-foreground",children:e.voices.length})]}),(0,a.jsx)("div",{className:"grid gap-2 sm:grid-cols-2 xl:grid-cols-3",children:e.voices.map(e=>(0,a.jsx)(R,{voice:e,selected:e.id===l,t:n,onSelect:e=>u(e.id,e.locale.key)},e.id))})]},e.id))})]}):null]})})]}):null]})}function V(e){let{selectedVoiceEntry:t,t:r,onOpenLibrary:s}=e;return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("div",{className:"text-base font-semibold text-foreground",children:r("ui.voice_studio_current_voice_title")}),t?(0,a.jsxs)("div",{className:"space-y-3 rounded-xl border border-border/60 bg-background/70 p-3",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-lg leading-none","aria-hidden":"true",children:t.locale.flag}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-sm font-medium text-foreground",children:t.personaName}),(0,a.jsx)("div",{className:"text-xs text-muted-foreground",children:r(t.locale.labelKey)})]})]}),(0,a.jsx)(g.$,{type:"button",variant:"outline",onClick:s,children:r("ui.voice_studio_change_voice")})]}),(0,a.jsx)(z,{voice:t,t:r}),t.description?(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:t.description}):null]}):(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)("p",{className:"max-w-md text-sm text-muted-foreground",children:r("ui.voice_studio_voice_summary_empty")}),(0,a.jsx)(g.$,{type:"button",variant:"outline",onClick:s,children:r("ui.voice_studio_choose_voice")})]})]})}function F(e){let{activeLocaleKey:t,isOpen:r,isSignedIn:s,selectedVoiceId:l,t:n,voiceCatalog:i,voicesError:o,voicesLoading:d,onActiveLocaleChange:c,onOpenChange:u,onSelectVoice:m}=e,x=(0,E.U)("(min-width: 768px)"),p=(0,a.jsx)(T,{activeLocaleKey:t,isSignedIn:s,selectedVoiceId:l,t:n,voiceCatalog:i,voicesError:o,voicesLoading:d,onActiveLocaleChange:c,onSelectVoice:m});return x?(0,a.jsx)(I.cj,{open:r,onOpenChange:u,children:(0,a.jsxs)(I.h,{side:"right",className:"w-full gap-0 p-0 sm:max-w-4xl",children:[(0,a.jsxs)(I.Fm,{className:"border-b border-border/60 px-6 py-5 pr-14 text-left",children:[(0,a.jsx)(I.qp,{children:n("ui.voice_studio_library_title")}),(0,a.jsx)(I.Qs,{children:n("ui.voice_studio_library_description")})]}),(0,a.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto px-6 py-5",children:p})]})}):(0,a.jsx)(M._s,{open:r,onOpenChange:u,children:(0,a.jsxs)(M.zj,{
1className:"max-h-[88vh]",children:[(0,a.jsxs)(M.BE,{className:"text-left",children:[(0,a.jsx)(M.gk,{children:n("ui.voice_studio_library_title")}),(0,a.jsx)(M.I6,{children:n("ui.voice_studio_library_description")})]}),(0,a.jsx)("div",{className:"overflow-y-auto px-4 pb-6",children:p})]})})}var B=r(97392),D=r(65476),O=r(843),K=r(66848),G=r(85989);let $=[".txt",".md",".srt",".vtt"];function q(e){var t,r,a;let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=null!==(t=s.maxCharacters)&&void 0!==t?t:12e3,n=null!==(r=s.maxSegmentCharacters)&&void 0!==r?r:160,i=(a=e,/(^|\n)Page\s+\d+\s*:/i.test(a)?a.replace(/\r\n?/g,"\n").replace(/(^|\n)Page\s+\d+\s*:\s*/gi,"\n[[PAGE_BREAK]]").split("[[PAGE_BREAK]]").map(e=>e.replace(/\n+/g," ").replace(/\s+/g," ").trim()).filter(Boolean):a.replace(/\r\n?/g,"\n").split("\n").map(e=>e.replace(/^Page\s+\d+\s*:\s*/i,"").replace(/^#{1,6}\s+/g,"").replace(/^[-*]\s+/g,"").trim()).join("\n").split(/\n{2,}/).map(e=>e.replace(/\n+/g," ").replace(/\s+/g," ").trim()).filter(Boolean));return function(e,t){let r=[],a=0,s=!1;for(let l of e){if(!l)continue;let e=2*(r.length>0),n=t-a-e;if(n<=0){s=!0;break}if(l.length<=n){r.push(l),a+=e+l.length;continue}r.push(l.slice(0,n).trim()),a+=e+r.at(-1).length,s=!0;break}let l=r.join("\n\n").trim();return{text:l,characterCount:l.length,segmentCount:r.length,truncated:s}}((/(^|\n)Page\s+\d+\s*:/i.test(e)?i:function(e,t){let r=[],a="";for(let s of e){let e=a?"".concat(a," ").concat(s):s;if(e.length<=t){a=e;continue}a&&r.push(a),a=s}return a&&r.push(a),r}(i,n)).flatMap(e=>(function(e,t){var r,a;if(e.length<=t)return[e];let s=null!==(a=null===(r=e.match(/[^.!?。!?]+[.!?。!?]?/g))||void 0===r?void 0:r.map(e=>e.trim()))&&void 0!==a?a:[e],l=[],n="";for(let e of s){if(!e)continue;let r=n?"".concat(n," ").concat(e):e;if(r.length<=t){n=r;continue}if(n&&l.push(n),e.length<=t){n=e;continue}for(let r=0;r<e.length;r+=t)l.push(e.slice(r,r+t).trim());n=""}return n&&l.push(n),l.filter(Boolean)})(e,n)),l)}async function W(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!function(e){let t=e.toLowerCase();return $.some(e=>t.endsWith(e))}(e.name))throw Error("Script files must be txt, md, srt, or vtt.");let r=q(await e.text(),t);return{fileName:e.name,...r}}let Y=(0,s.forwardRef)(function(e,t){var r;let{disabled:l=!1,className:n,lastImportedSource:o=null,onImport:d,onClearImportedContent:c,variant:m="empty"}=e,f=(0,x.c)("VideoGenerator"),b=(0,s.useRef)(null),h=(0,s.useRef)(null),[j,N]=(0,s.useState)(""),[w,_]=(0,s.useState)(!1),[k,A]=(0,s.useState)(null),[P,S]=(0,s.useState)(null);(0,s.useEffect)(()=>{if("url"===P){var e;null===(e=h.current)||void 0===e||e.focus()}},[P]);let L=null!==(r=null==o?void 0:o.value)&&void 0!==r?r:null==o?void 0:o.label,M=async(e,t,r)=>{if(!l&&!w){_(!0),A(e);try{let e=await t();d(e),null==r||r(),p.oR.success(f("ui.voice_studio_content_import_success"))}catch(t){let e=t instanceof Error?t.message:f("ui.voice_studio_content_import_error");p.oR.error(e)}finally{_(!1),A(null)}}},I=async e=>{await M("file",async()=>{if("application/pdf"===e.type||e.name.toLowerCase().endsWith(".pdf")){let t=new FormData;t.set("file",e);let r=await fetch("/api/audio/extract-pdf",{method:"POST",body:t}),a=await (0,y.u0)(r);if(0!==a.code||!a.data)throw Error(a.message||f("ui.voice_studio_content_import_error"));let s=q(a.data.text);return{text:s.text,sourceKind:"file",sourceLabel:"".concat(e.name," \xb7 ").concat(s.segmentCount," ").concat(f("ui.voice_studio_content_segments_suffix")),sourceValue:e.name,truncated:a.data.truncated||s.truncated}}let t=await W(e);return{text:t.text,sourceKind:"file",sourceLabel:"".concat(e.name," \xb7 ").concat(t.segmentCount," ").concat(f("ui.voice_studio_content_segments_suffix")),sourceValue:e.name}})},E=()=>void M("url",async()=>{let e=await fetch("/api/audio/extract-text",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({url:j.trim()})}),t=await (0,y.u0)(e);if(0!==t.code||!t.data)throw Error(t.message||f("ui.voice_studio_content_import_error"));return{text:t.data.text,sourceKind:"url",sourceLabel:"".concat(t.data.title," \xb7 ").concat(t.data.segmentCount," ").concat(f("ui.voice_studio_content_segments_suffix")),sourceValue:t.data.sourceUrl}},()=>{N(""),S(null)}),z=()=>{var e;l||w||null===(e=b.current)||void 0===e||e.click()};return(0,s.useImperativeHandle)(t,()=>({importFile:I,openFilePicker:z}),[I,z]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("input",{ref:b,type:"file",className:"hidden",accept:".pdf,.txt,.md,.srt,.vtt,application/pdf,text/plain,text/markdown,text/vtt",onChange:e=>{var t;let r=null===(t=e.currentTarget.files)||void 0===t?void 0:t[0];r&&I(r),e.currentTarget.value=""}}),(0,a.jsxs)("div",{className:(0,v.cn)("flex min-w-0 flex-1 flex-wrap items-center gap-2 sm:flex-nowrap","toolbar"===m&&"gap-2.5",n),children:[(0,a.jsxs)("div",{className:(0,v.cn)("inline-flex items-center rounded-full border border-border/70 bg-background/90 shadow-none transition-all duration-200","file"===k&&"border-primary/35 bg-primary/8 shadow-[0_0_0_3px_color-mix(in_oklch,var(--primary)_14%,transparent)]"),children:[(0,a.jsxs)(g.$,{type:"button",variant:"ghost",disabled:l||w,"aria-busy":"file"===k,className:(0,v.cn)("h-9 rounded-full rounded-r-none px-3.5 text-sm font-medium text-foreground shadow-none hover:bg-accent/50","file"===k&&"text-primary"),onClick:z,children:["file"===k?(0,a.jsx)(u.A,{className:"h-4 w-4 animate-spin"}):(0,a.jsx)(C.A,{className:"h-4 w-4 text-muted-foreground"}),f("ui.voice_studio_content_file_action")]}),"url"!==P?(0,a.jsxs)(G.m_,{children:[(0,a.jsx)(G.k$,{asChild:!0,children:(0,a.jsxs)("button",{type:"button",disabled:l||w,"aria-label":f("ui.voice_studio_content_formats_label"),className:"flex h-9 min-w-9 items-center justify-center rounded-r-full border-l border-border/70 text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground disabled:pointer-events-none disabled:opacity-50",children:[(0,a.jsx)(B.A,{className:"h-3.5 w-3.5"}),(0,a.jsx)("span",{className:"sr-only",children:f("ui.voice_studio_content_formats_label")})]})}),(0,a.jsx)(G.ZI,{side:"top",className:"max-w-[260px]",children:(0,a.jsx)("p",{className:"text-xs leading-5",children:f("ui.voice_studio_content_drop_hint")})})]}):null]}),"url"===P?(0,a.jsxs)("div",{className:(0,v.cn)("flex min-w-0 flex-1 items-center gap-2 rounded-full border pl-1.5 pr-1 shadow-sm transition-all duration-200","url"===k?"border-primary/40 bg-primary/8 shadow-[0_0_0_3px_color-mix(in_oklch,var(--primary)_14%,transparent)]":"border-primary/22 bg-primary/6"),children:[(0,a.jsx)("button",{type:"button",disabled:l||w,className:(0,v.cn)("flex h-7 w-7 shrink-0 items-center justify-center rounded-full transition-colors hover:bg-background/70 disabled:pointer-events-none","url"===k?"text-primary":"text-primary/80"),"aria-label":f("ui.voice_studio_content_url_label"),onClick:()=>S(null),children:(0,a.jsx)(D.A,{className:"h-4 w-4"})}),(0,a.jsx)(K.p,{ref:h,id:"audio-voice-article-url",value:j,disabled:l||w,onChange:e=>N(e.target.value),onKeyDown:e=>{if("Escape"===e.key&&!j.trim()){e.preventDefault(),S(null);return}"Enter"===e.key&&j.trim()&&!l&&!w&&(e.preventDefault(),E())},placeholder:f("ui.voice_studio_content_url_placeholder"),className:"h-9 min-w-0 flex-1 border-0 bg-transparent px-0 text-sm text-foreground shadow-none placeholder:text-muted-foreground
1/72 focus-visible:ring-0 focus-visible:ring-offset-0"}),(0,a.jsx)(g.$,{type:"button",disabled:l||w||!j.trim(),className:(0,v.cn)("h-7 rounded-full px-3 text-xs","url"===k&&"bg-primary text-primary-foreground shadow-[0_10px_24px_-16px_var(--glow-primary)]"),onClick:E,children:w?(0,a.jsx)(u.A,{className:"h-3.5 w-3.5 animate-spin"}):f("ui.voice_studio_content_import_action")})]}):null,"url"!==P&&(null==o?void 0:o.kind)==="url"?(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-1 rounded-full border border-border/70 bg-background/90 pl-3 pr-1 shadow-sm",children:[(0,a.jsxs)("button",{type:"button",className:"flex min-w-0 flex-1 items-center gap-2 text-left text-sm text-foreground",onClick:()=>{var e;N(null!==(e=o.value)&&void 0!==e?e:""),S("url")},children:[(0,a.jsx)(D.A,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),(0,a.jsx)("span",{className:"truncate",children:L})]}),(0,a.jsx)("button",{type:"button",className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-muted/45 hover:text-foreground","aria-label":"Clear imported URL",onClick:()=>{N(""),S(null),null==c||c()},children:(0,a.jsx)(i.A,{className:"h-3.5 w-3.5"})})]}):null,"url"!==P&&(null==o?void 0:o.kind)!=="url"?(0,a.jsxs)(g.$,{type:"button",variant:"outline",disabled:l||w,className:"h-9 rounded-full border-border/70 bg-background/90 px-3.5 text-sm font-medium text-foreground shadow-none hover:bg-accent/50",onClick:()=>S("url"),children:[(0,a.jsx)(O.A,{className:"h-4 w-4 text-muted-foreground"}),f("ui.voice_studio_content_url_label")]}):null]})]})}),H=["audio/webm;codecs=opus","audio/mp4","audio/ogg;codecs=opus","audio/webm"],J="audio/wav";function Q(e,t,r){for(let a=0;a<r.length;a+=1)e.setUint8(t+a,r.charCodeAt(a));return t+r.length}async function X(e,t){let r=function(){let e=globalThis.AudioContext||globalThis.webkitAudioContext;if(!e)throw Error("This browser cannot convert recorded audio to wav.");return new e}();try{let a=await e.arrayBuffer(),s=await r.decodeAudioData(a.slice(0)),l=Array.from({length:s.numberOfChannels},(e,t)=>s.getChannelData(t).slice()),n=function(e){var t,r,a,s;let l=Math.max(1,e.channelData.length),n=null!==(r=null===(t=e.channelData[0])||void 0===t?void 0:t.length)&&void 0!==r?r:0,i=2*l,o=e.sampleRate*i,d=n*i,c=new ArrayBuffer(44+d),u=new DataView(c),m=0;m=Q(u,0,"RIFF"),u.setUint32(m,36+d,!0),m+=4,m=Q(u,m,"WAVE"),m=Q(u,m,"fmt "),u.setUint32(m,16,!0),m+=4,u.setUint16(m,1,!0),m+=2,u.setUint16(m,l,!0),m+=2,u.setUint32(m,e.sampleRate,!0),m+=4,u.setUint32(m,o,!0),m+=4,u.setUint16(m,i,!0),m+=2,u.setUint16(m,16,!0),m+=2,m=Q(u,m,"data"),u.setUint32(m,d,!0),m+=4;for(let t=0;t<n;t+=1)for(let r=0;r<l;r+=1){let l=null!==(a=e.channelData[r])&&void 0!==a?a:e.channelData[0],n=Math.max(-1,Math.min(1,null!==(s=null==l?void 0:l[t])&&void 0!==s?s:0)),i=n<0?32768*n:32767*n;u.setInt16(m,Math.round(i),!0),m+=2}return c}({sampleRate:s.sampleRate,channelData:l});return function(e,t){var r,a;let s=(null==t?void 0:t.mimeType)||e.type||"audio/webm",l=function(e){let t=e.toLowerCase();return t.includes("mp4")?"m4a":t.includes("ogg")?"ogg":t.includes("wav")?"wav":t.includes("mpeg")||t.includes("mp3")?"mp3":t.includes("flac")?"flac":(t.includes("opus"),"webm")}(s),n=null!==(r=null==t?void 0:t.timestamp)&&void 0!==r?r:Date.now(),i=null!==(a=null==t?void 0:t.fileNamePrefix)&&void 0!==a?a:"recording";return new File([e],"".concat(i,"-").concat(n,".").concat(l),{type:s})}(new Blob([n],{type:J}),{fileNamePrefix:null==t?void 0:t.fileNamePrefix,mimeType:J,timestamp:null==t?void 0:t.timestamp})}finally{await r.close().catch(()=>void 0)}}function Z(e){null==e||e.getTracks().forEach(e=>e.stop())}let ee={en_us:{key:"en_us",flag:"\uD83C\uDDFA\uD83C\uDDF8",labelKey:"ui.voice_studio_language_en_us",order:0},en_gb:{key:"en_gb",flag:"\uD83C\uDDEC\uD83C\uDDE7",labelKey:"ui.voice_studio_language_en_gb",order:1},fr_fr:{key:"fr_fr",flag:"\uD83C\uDDEB\uD83C\uDDF7",labelKey:"ui.voice_studio_language_fr_fr",order:2}},et={en:"en_us",gb:"en_gb",fr:"fr_fr"},er={key:"unknown",flag:"\uD83C\uDF10",labelKey:"ui.voice_studio_language_unknown",order:Number.MAX_SAFE_INTEGER},ea={neutral:{key:"neutral",emoji:"\uD83D\uDE10",labelKey:"ui.voice_studio_emotion_neutral",order:0},happy:{key:"happy",emoji:"\uD83D\uDE0A",labelKey:"ui.voice_studio_emotion_happy",order:1},cheerful:{key:"cheerful",emoji:"\uD83D\uDE01",labelKey:"ui.voice_studio_emotion_cheerful",order:2},confident:{key:"confident",emoji:"\uD83D\uDE0E",labelKey:"ui.voice_studio_emotion_confident",order:3},excited:{key:"excited",emoji:"\uD83E\uDD29",labelKey:"ui.voice_studio_emotion_excited",order:4},curious:{key:"curious",emoji:"\uD83E\uDD14",labelKey:"ui.voice_studio_emotion_curious",order:5},confused:{key:"confused",emoji:"\uD83D\uDE15",labelKey:"ui.voice_studio_emotion_confused",order:6},sarcasm:{key:"sarcasm",emoji:"\uD83D\uDE43",labelKey:"ui.voice_studio_emotion_sarcasm",order:7},frustrated:{key:"frustrated",emoji:"\uD83D\uDE24",labelKey:"ui.voice_studio_emotion_frustrated",order:8},angry:{key:"angry",emoji:"\uD83D\uDE20",labelKey:"ui.voice_studio_emotion_angry",order:9},sad:{key:"sad",emoji:"\uD83D\uDE14",labelKey:"ui.voice_studio_emotion_sad",order:10},shameful:{key:"shameful",emoji:"\uD83D\uDE33",labelKey:"ui.voice_studio_emotion_shameful",order:11},jealousy:{key:"jealousy",emoji:"\uD83D\uDE12",labelKey:"ui.voice_studio_emotion_jealousy",order:12}};function es(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"")}function el(e){return e&&es(e)||"neutral"}function en(e,t){return"".concat(e,":").concat(t)}function ei(e){let t=function(e){var t,r,a;let s=null===(t=e.languages[0])||void 0===t?void 0:t.toLowerCase().replace(/-/g,"_");
1if(s&&ee[s])return ee[s];let l=null===(a=e.slug)||void 0===a?void 0:null===(r=a.split("_")[0])||void 0===r?void 0:r.toLowerCase();return l&&et[l]?ee[et[l]]:er}(e),r=function(e){var t;let r=e.name.split(" - "),a=r.length>=2?el(r.slice(1).join(" ")):"";if(a&&ea[a])return ea[a];let s=null===(t=e.slug)||void 0===t?void 0:t.split("_"),l=s&&s.length>=3?el(s.slice(2).join("_")):"";if(l&&ea[l])return ea[l];let n=e.tags.map(e=>el(e)).find(e=>!!ea[e]);return n?ea[n]:ea.neutral}(e);return{id:e.id,voiceId:e.id,name:e.name,slug:e.slug,personaName:function(e){var t,r;let a=null===(t=e.name.split(" - ")[0])||void 0===t?void 0:t.trim();if(a)return a;let s=null===(r=e.slug)||void 0===r?void 0:r.split("_");return s&&s.length>=2?s[1].split(/[_\s-]+/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "):(0,e.name)}(e),locale:t,emotion:r,styleTags:e.tags.filter(e=>el(e)!==r.key),isSavedVoice:!!e.userId,color:e.color,gender:e.gender,age:e.age,description:e.description,userId:e.userId}}function eo(e,t){return e.emotion.order!==t.emotion.order?e.emotion.order-t.emotion.order:e.name.localeCompare(t.name)}function ed(e,t){return e.locale.order!==t.locale.order?e.locale.order-t.locale.order:e.locale.key.localeCompare(t.locale.key)}function ec(e,t,r){var a;let s=null==e?void 0:null===(a=e.get(t))||void 0===a?void 0:a.trim();if(s)return s.slice(0,r)}function eu(e){var t,r;let{showCreditsEstimate:y=!0,variant:_="default"}=e,C=(0,x.c)("VideoGenerator"),A=(0,l.useSearchParams)(),{user:P,setUser:L,ensureUserForAction:M,setInsufficientCreditsInfo:I,setShowPricingDialog:E,setShowSignModal:z}=(0,b.U)(),R=(0,s.useMemo)(()=>(function(e){let t=ec(e,"voiceScript",600),r=ec(e,"voicePreset",128);return{...t?{script:t}:{},...r?{voiceId:r}:{}}})(A),[A]),[U,T]=(0,s.useState)("preset"),[B,D]=(0,s.useState)(null!==(t=R.script)&&void 0!==t?t:""),[O,K]=(0,s.useState)(null!==(r=R.voiceId)&&void 0!==r?r:w),[G,$]=(0,s.useState)(N),[q,W]=(0,s.useState)(!1),[J,Q]=(0,s.useState)(null),[ee,et]=(0,s.useState)(null),[er,ea]=(0,s.useState)(null),[el,eu]=(0,s.useState)(null),[em,ex]=(0,s.useState)(null),[ep,eg]=(0,s.useState)("voiceover.mp3"),[ef,eb]=(0,s.useState)(null),[eh,ev]=(0,s.useState)(null),[ej,eN]=(0,s.useState)(!1),[ew,ey]=(0,s.useState)(!1),[e_,ek]=(0,s.useState)(!1),eC=(0,s.useRef)(null),eA=(0,s.useRef)(null),eP=(0,s.useRef)(null),{recordedFile:eS,isPreparing:eL,isRecording:eM,durationSeconds:eI,recordingSupported:eE,errorMessage:ez,startRecording:eR,stopRecording:eU,clearRecording:eT}=function(){var e;let t=(0,s.useRef)(!0),r=(0,s.useRef)(null),a=(0,s.useRef)(null),l=(0,s.useRef)([]),n=(0,s.useRef)(null),i=(0,s.useRef)(null),[o,d]=(0,s.useState)(null),[c,u]=(0,s.useState)(!1),[m,x]=(0,s.use
1State)(!1),[p,g]=(0,s.useState)(0),[f,b]=(0,s.useState)(null),h="undefined"!=typeof navigator&&"function"==typeof(null===(e=navigator.mediaDevices)||void 0===e?void 0:e.getUserMedia)&&"undefined"!=typeof MediaRecorder,v=e=>"undefined"!=typeof MediaRecorder&&("function"==typeof MediaRecorder.isTypeSupported?MediaRecorder.isTypeSupported(e):"audio/webm"===e),j=()=>{null!==n.current&&(window.clearInterval(n.current),n.current=null)},N=()=>{j(),i.current=null,r.current=null,Z(a.current),a.current=null,l.current=[]};(0,s.useEffect)(()=>()=>{t.current=!1,r.current&&"inactive"!==r.current.state&&r.current.stop(),N()},[]);let w=async()=>{if(!h){b("This browser does not support in-page audio recording.");return}N(),b(null),u(!0),g(0);try{let e=await navigator.mediaDevices.getUserMedia({audio:!0});a.current=e;let s=function(e){let t=H.find(t=>e(t));return null!=t?t:"audio/webm"}(v),o=s&&v(s)?new MediaRecorder(e,{mimeType:s}):new MediaRecorder(e);l.current=[],o.addEventListener("dataavailable",e=>{e.data.size>0&&l.current.push(e.data)}),o.addEventListener("stop",()=>{(async()=>{if(!t.current){N();return}u(!0);let e=o.mimeType||s||"audio/webm",r=new Blob(l.current,{type:e}),a=null;if(r.size>0)try{a=await X(r,{fileNamePrefix:"voice-clone-sample"})}catch(e){if(!t.current){N();return}d(null),b(e instanceof Error?e.message:"Recorded audio could not be converted to wav. Please try again or upload an mp3/wav file.")}if(!t.current){N();return}a&&d(a),x(!1),u(!1),g(0),N()})()}),o.addEventListener("error",()=>{if(!t.current){N();return}b("Microphone recording failed. Please try again."),x(!1),u(!1),g(0),N()}),i.current=Date.now(),o.start(),r.current=o,u(!1),x(!0),n.current=window.setInterval(()=>{i.current&&g(Math.max(1,Math.floor((Date.now()-i.current)/1e3)))},250)}catch(e){if(!t.current){Z(a.current),a.current=null;return}u(!1),x(!1),g(0),Z(a.current),a.current=null,b(e instanceof Error?e.message:"Microphone recording failed. Please try again.")}};return{recordedFile:o,isPreparing:c,isRecording:m,durationSeconds:p,recordingSupported:h,errorMessage:f,startRecording:w,stopRecording:()=>{r.current&&"inactive"!==r.current.state&&(j(),r.current.stop())},clearRecording:()=>{d(null),b(null),g(0)}}}(),eV=(0,s.useMemo)(()=>{var e;return null!==(e=G.find(e=>e.id===O))&&void 0!==e?e:null},[O,G]),eF=(0,s.useMemo)(()=>(function(e){let t=new Map,r=[];for(let a of e){let e=ei(a);if(e.isSavedVoice){r.push(e);continue}let s=t.get(e.locale.key);if(!s){let r=es(e.personaName);t.set(e.locale.key,{id:e.locale.key,locale:e.locale,totalVoices:1,personas:[{id:en(e.locale.key,r),key:r,name:e.personaName,gender:e.gender,age:e.age,voices:[e]}]});continue}s.totalVoices+=1;let l=es(e.personaName),n=s.personas.find(e=>e.key===l);if(!n){s.personas.push({id:en(e.locale.key,l),key:l,name:e.personaName,gender:e.gender,age:e.age,voices:[e]}),s.personas.sort((e,t)=>e.name.localeCompare(t.name));continue}n.voices.push(e),n.voices.sort(eo)}return r.sort((e,t)=>e.name.localeCompare(t.name)),{presetGroups:[...t.values()].sort(ed),savedVoices:r,totalPresetVoices:[...t.values()].reduce((e,t)=>e+t.totalVoices,0),totalSavedVoices:r.length}})(G),[G]),eB=(0,s.useMemo)(()=>eV?ei(eV):null,[eV]),eD=(0,s.useMemo)(()=>(function(e){let t=j(e);return t<=0?0:Math.ceil(t/1e3*16)})(B),[B]),eO=(0,s.useMemo)(()=>j(B),[B]),eK=eO>0&&("preset"===U?O.trim().length>0:!!er),eG="hero"===_,e$=!eG||e_||!!em||!!ef,eq=B.trim().length>0,eW=(0,s.useMemo)(()=>{var e,t;return null!==(t=null==eh?void 0:null===(e=eh.label)||void 0===e?void 0:e.split(" \xb7 ").filter(Boolean))&&void 0!==t?t:[]},[eh]),eY=(null==eh?void 0:eh.kind)==="file"&&eW.length>0,eH=eO>0;(0,s.useEffect)(()=>{if(!er){eu(e=>(e&&URL.revokeObjectURL(e),null));return}let e=URL.createObjectURL(er);return eu(t=>(t&&URL.revokeObjectURL(t),e)),()=>{URL.revokeObjectURL(e)}},[er]),(0,s.useEffect)(()=>{R.script&&D(R.script),R.voiceId&&(T("preset"),K(R.voiceId),eb(null))},[R.script,R.voiceId]),(0,s.useEffect)(()=>()=>{em&&URL.revokeObjectURL(em)},[em]),(0,s.useEffect)(()=>{eS&&(ea(eS),eb(null),T("clone"))},[eS]),(0,s.useEffect)(()=>{if(0===eF.presetGroups.length){et(null);return}!(ee&&eF.presetGroups.some(e=>e.locale.key===ee))&&et(eB&&!eB.isSavedVoice?eB.locale.key:eF.presetGroups[0].locale.key)},[ee,eB,eF.presetGroups]);let eJ=e=>{ex(t=>(t&&URL.revokeObjectURL(t),e))},eQ=(0,s.useCallback)(async()=>
1{if(!P){$(N),W(!1),Q(null);return}W(!0),Q(null);try{let e=await fetch("/api/audio/voices",{method:"GET",cache:"no-store"});if(!e.ok)throw Error(C("ui.voice_studio_load_voices_failed"));let t=await e.json();$(function(e){let t=new Map;for(let e of N)t.set(e.id,e);for(let a of e){var r;t.set(a.id,{...a,userId:null!==(r=a.userId)&&void 0!==r?r:null})}return[...t.values()]}(Array.isArray(t.voices)?t.voices:[]))}catch(e){Q(C("ui.voice_studio_load_voices_failed")),$(e=>e.length>0?e:N)}finally{W(!1)}},[C,P]);(0,s.useEffect)(()=>{if(!P){$(N),W(!1),Q(null);return}eQ()},[eQ,P]),(0,s.useEffect)(()=>{var e,t;if("preset"!==U||G.some(e=>e.id===O))return;let r=null!==(t=null===(e=G.find(e=>!e.userId))||void 0===e?void 0:e.id)&&void 0!==t?t:w;r&&K(r)},[O,U,G]);let eX=e=>{ea(e),eb(null),T("clone"),e&&eT()},eZ=()=>{eB&&!eB.isSavedVoice&&et(eB.locale.key),ey(!0)},e0=async()=>{var e,t,r,a,s,l,n,i;if(!eK)return;let o=await M({refresh:!0,showModal:!0});if(o){if((null!==(t=null===(e=o.credits)||void 0===e?void 0:e.left_credits)&&void 0!==t?t:0)<eD){I({required:eD,available:null!==(a=null===(r=o.credits)||void 0===r?void 0:r.left_credits)&&void 0!==a?a:0}),E(!0);return}ek(!0),eb(null);try{let e=await k(function(e){var t,r;let a=new FormData;return a.set("text",e.text),a.set("voice_mode",e.voiceMode),a.set("model",null!==(t=e.model)&&void 0!==t?t:"voxtral-mini-tts-2603"),a.set("format",null!==(r=e.format)&&void 0!==r?r:"mp3"),"preset"===e.voiceMode&&e.voiceId&&a.set("voice_id",e.voiceId),"clone"===e.voiceMode&&e.referenceAudio&&a.set("ref_audio",e.referenceAudio),a}({text:B,voiceMode:U,voiceId:O,referenceAudio:er}));if("auth_required"===e.kind){z(!0);return}if("insufficient_credits"===e.kind){let t=e.creditsInfo;I({required:null!==(l=null==t?void 0:t.required)&&void 0!==l?l:eD,available:null!==(i=null!==(n=null==t?void 0:t.available)&&void 0!==n?n:null===(s=o.credits)||void 0===s?void 0:s.left_credits)&&void 0!==i?i:0}),E(!0);return}if("error"===e.kind)throw Error(e.message);let t=e.response,r=await t.blob();eJ(URL.createObjectURL(r)),eg(function(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"voiceover.mp3";if(!e)return r;let a=e.match(/filename="?([^"]+)"?/i);return null!==(t=null==a?void 0:a[1])&&void 0!==t?t:r}(t.headers.get("content-disposition")));let a=(0,h.kz)(t.headers.get("x-audio-credits-used"));"number"==typeof a&&o.credits&&L({...o,credits:{...o.credits,left_credits:Math.max(0,(o.credits.left_credits||0)-a)}}),p.oR.success(C("ui.voiceover_success"))}catch(t){let e=t instanceof Error?t.message:C("ui.voiceover_error_default");eb(e),p.oR.error(e)}finally{ek(!1)}}},e1=()=>{ev(null),D(""),eb(null),window.setTimeout(()=>{var e;null===(e=eA.current)||void 0===e||e.focus()},0)};return(0,a.jsx)("section",{"data-voice-studio-variant":_,className:(0,v.cn)("px-4 py-10 md:px-6 lg:py-12",eG&&"px-0 py-0 md:px-0 lg:py-0"),children:(0,a.jsxs)("div",{className:(0,v.cn)("mx-auto max-w-6xl space-y-6",eG&&"max-w-none space-y-4"),children:[eG?null:(0,a.jsxs)("header",{className:"mx-auto max-w-3xl space-y-3 text-center",children:[(0,a.jsx)("p",{className:"text-xs font-medium uppercase tracking-[0.2em] text-primary",children:C("ui.voice_studio_model_chip")}),(0,a.jsx)("h1",{className:"text-4xl font-bold tracking-tight md:text-5xl",children:C("ui.voice_studio_title")}),(0,a.jsx)("p",{className:"text-base text-muted-foreground md:text-lg",children:C("ui.voice_studio_description")})]}),(0,a.jsxs)("div",{className:(0,v.cn)("grid gap-6 xl:items-start",e$?"xl:grid-cols-[minmax(0,1fr)_360px]":"xl:grid-cols-1",eG&&(e$?"gap-4 xl:grid-cols-[minmax(0,1fr)_320px]":"gap-4 xl:grid-cols-1")),children:[(0,a.jsx)("div",{className:"min-w-0",children:(0,a.jsxs)("div",{className:"relative rounded-2xl p-[1.5px]",children:[(0,a.jsxs)("div",{className:"pointer-events-none absolute inset-0 overflow-hidden rounded-2xl",children:[(0,a.jsx)("div",{className:"absolute inset-[-52%] animate-glow-spin voice-studio-glow-conic-bg"}),(0,a.jsx)("div",{className:"absolute inset-[-52%] animate-glow-spin voice-studio-glow-conic-bg opacity-70 [animation-direction:reverse] [animation-duration:6.5s]"})]}),(0,a.jsx)("div",{className:"pointer-events-none absolute inset-0 overflow-hidden rounded-2xl opacity-30 blur-[10px]",children:(0,a.jsx)("div",{className:"absolute inset-[-52%] animate-glow-spin voice-studio-glow-conic-bg"})}),(0,a.jsx)("div",{className:(0,v.cn)("pointer-events-none absolute voice-studio-glow-cover",eG&&"voice-studio-glow-cover-hero")}),(0,a.jsx)("div",{className:(0,v.cn)("relative overflow-hidden rounded-2xl border border-border bg-background",eG&&"border-border/70 bg-card/68 backdrop-blur-sm"),children:(0,a.jsxs)("div",{className:(0,v.cn)("grid gap-4 p-4 sm:p-6 xl:grid-cols-[minmax(0,1.28fr)_minmax(288px,0.72fr)]",eG&&"gap-3 p-3 sm:p-4 xl:grid-cols-[minmax(0,1.24fr)_minmax(264px,0.76fr)]"),children:[(0,a.jsx)("div",{className:(0,v.cn)("space-y-4",eG&&"space-y-3"),children:(0,a.jsx)("div",{className:(0,v.cn)("rounded-[28px] border border-border/60 bg-card/45 p-4 backdrop-blur-sm sm:p-5",eG&&"bg-background/68 p-4 sm:p-4"),children:(0,a.jsxs)("div",{className:(0,v.cn)("relative rounded-2xl bg-background/80 px-4 pt-4 pb-2.5 transition-colors",ej&&"bg-primary/6 ring-1 ring-primary/35",eG&&"px-3.5 pt-3.5 pb-2"),onDragOver:e=>{e.preventDefault(),eN(!0)},onDragLeave:()=>eN(!1),onDrop:e=>{var t,r;e.preventDefault(),eN(!1);let a=null===(t=e.dataTransfer.files)||void 0===t?void 0:t[0];a&&(null===(r=eP.current)||void 0===r||r.importFile(a))},children:[(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(f.T,{ref:eA,id:"audio-voice-script","aria-label":C("ui.voiceover_script_label"),value:B,onChange:e=>{D(e.target.value)},placeholder:C("ui.voiceover_script_placeholder"),className:(0,v.cn)("resize-none border-0 bg-transparent p-0 text-base leading-7 shadow-none placeholder:text-muted-foreground
1/60 focus-visible:ring-0 focus-visible:ring-offset-0",eG?eq?"min-h-[320px] sm:min-h-[380px]":"min-h-[260px] sm:min-h-[300px]":eq?"min-h-[420px] sm:min-h-[520px]":"min-h-[340px] sm:min-h-[420px]")}),(0,a.jsx)("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 h-16 bg-gradient-to-b from-transparent to-background"})]}),(0,a.jsxs)("div",{className:(0,v.cn)("mt-3 space-y-2.5",eG&&"mt-2.5 space-y-2"),children:[eY?(0,a.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:(0,a.jsxs)("div",{className:"inline-flex min-w-0 max-w-full items-center gap-1.5 rounded-xl border border-border/65 bg-card/72 px-3 py-1.5 text-xs text-muted-foreground",children:[(0,a.jsx)("span",{className:"shrink-0 font-medium text-foreground/78",children:C("ui.voice_studio_content_last_imported")}),eW.map((e,t)=>(0,a.jsxs)("span",{className:"inline-flex min-w-0 items-center gap-1.5",children:[(0,a.jsx)(n.A,{className:"h-3 w-3 shrink-0 text-muted-foreground/60"}),(0,a.jsx)("span",{className:(0,v.cn)("truncate",t===eW.length-1&&"text-foreground/82"),children:e})]},"".concat(e,"-").concat(t))),(0,a.jsx)("button",{type:"button",className:"ml-1 flex h-5 w-5 shrink-0 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-muted/45 hover:text-foreground","aria-label":"Clear imported content",onClick:e1,children:(0,a.jsx)(i.A,{className:"h-3 w-3"})})]})}):null,(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)(Y,{ref:eP,className:"min-w-0 flex-1",disabled:e_,lastImportedSource:eh,onImport:e=>{let{text:t,sourceKind:r,sourceLabel:a,sourceValue:s}=e;D(e=>e.trim().length>0?"".concat(e.trim(),"\n\n").concat(t):t),ev({kind:r,label:a,value:null!=s?s:null}),eb(null),window.setTimeout(()=>{var e,t;null===(e=eA.current)||void 0===e||e.focus(),null===(t=eA.current)||void 0===t||t.setSelectionRange(0,0)},0)},onClearImportedContent:e1,variant:eq?"toolbar":"empty"}),eH?(0,a.jsx)("span",{className:"ml-auto inline-flex h-8 items-center rounded-full border border-border/60 bg-background/85 px-3 text-xs font-medium text-muted-foreground",children:eO}):null]})]})]})})}),(0,a.jsx)("div",{className:(0,v.cn)("space-y-4",eG&&"space-y-3"),children:(0,a.jsx)("div",{className:(0,v.cn)("rounded-2xl border border-border/60 bg-card/60 p-4",eG&&"bg-background/64 p-3.5"),children:eq?(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"inline-flex h-10 items-center gap-1 rounded-xl border border-border bg-background/70 p-1",children:[(0,a.jsx)("button",{type:"button",onClick:()=>{T("preset"),eb(null)},className:(0,v.cn)("flex h-8 items-center justify-center gap-2 rounded-lg px-3 text-sm font-medium transition-all duration-200","preset"===U?"border border-border bg-background text-foreground shadow-sm":"text-muted-foreground hover:bg-muted/50 hover:text-foreground"),children:C("ui.voiceover_mode_preset")}),(0,a.jsx)("button",{type:"button",onClick:()=>{T("clone"),eb(null)},className:(0,v.cn)("flex h-8 items-center justify-center gap-2 rounded-lg px-3 text-sm font-medium transition-all duration-200","clone"===U?"border border-border bg-background text-foreground shadow-sm":"text-muted-foreground hover:bg-muted/50 hover:text-foreground"),children:C("ui.voiceover_mode_clone")})]}),"preset"===U?(0,a.jsx)(V,{selectedVoiceEntry:eB,t:C,onOpenLibrary:eZ}):(0,a.jsx)(S,{durationSeconds:eI,fileInputRef:eC,isPreparing:eL,isRecording:eM,recorderErrorMessage:ez,recordingSupported:eE,referenceAudio:er,referenceAudioUrl:el,t:C,onClearReferenceAudio:()=>{ea(null),eT()},onFileChange:eX,onStartRecording:eR,onStopRecording:eU}),ef?(0,a.jsx)("div",{className:"rounded-lg border border-destructive/30 bg-destructive/5 px-3 py-2 text-sm text-destructive",children:ef}):null,(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsxs)("div",{className:"inline-flex h-8 items-center gap-2 rounded-md border border-border bg-background/80 px-2.5 text-sm font-medium text-foreground",children:[(0,a.jsx)(o.A,{className:"h-4 w-4 text-primary"}),(0,a.jsx)("span",{children:C("ui.voice_studio_model_chip")})]}),"preset"===U&&eB?(0,a.jsxs)("div",{className:"inline-flex h-8 items-center gap-2 rounded-md border border-border bg-background/80 px-2.5 text-sm text-muted-foreground",children:[(0,a.jsx)(d.A,{className:"h-4 w-4 text-primary"}),(0,a.jsxs)("span",{className:"max-w-[220px] truncate",children:[eB.locale.flag," ",eB.personaName]})]}):"clone"===U&&er?(0,a.jsxs)("div",{className:"inline-flex h-8 max-w-full items-center gap-2 rounded-md border border-border bg-background/80 px-2.5 text-sm text-muted-foreground",children:[(0,a.jsx)(c.A,{className:"h-4 w-4 text-primary"}),(0,a.jsx)("span",{className:"truncate",children:C("ui.voice_studio_clone_label")})]}):null]}),(0,a.jsxs)("div",{className:(0,v.cn)("flex items-center gap-2 max-sm:flex-col max-sm:items-stretch",!y&&"justify-end"),children:[y?(0,a.jsx)("div",{className:"flex items-center gap-1.5 px-1.5 text-xs text-muted-foreground whitespace-nowrap",children:(0,a.jsx)("span",{className:"tabular-nums text-xs font-medium text-muted-foreground",children:eD})}):null,(0,a.jsx)(g.$,{type:"button",variant:"ai",onClick:e0,disabled:!eK||e_,className:(0,v.cn)("gap-2 max-sm:w-full",y&&"ml-auto"),children:e_?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(u.A,{className:"h-4 w-4 animate-spin"}),C("ui.voiceover_generating")]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.A,{className:"h-4 w-4"}),C("ui.voiceover_generate")]})})]})]}):(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"inline-flex h-10 items-center gap-1 rounded-xl border border-border bg-background/70 p-1",children:[(0,a.jsx)("button",{type:"button",onClick:()=>{T("preset"),eb(null)},className:(0,v.cn)("flex h-8 items-center justify-center gap-2 rounded-lg px-3 text-sm font-medium transition-all duration-200","preset"===U?"border border-border bg-background text-foreground shadow-sm":"text-muted-foreground hover:bg-muted/50 hover:text-foreground"),children:C("ui.voiceover_mode_preset")}),(0,a.jsx)("button",{type:"button",onClick:()=>{T("clone"),eb(null)},className:(0,v.cn)("flex h-8 items-center justify-center gap-2 rounded-lg px-3 text-sm font-medium transition-all duration-200","clone"===U?"border border-border bg-background text-foreground shadow-sm":"text-muted-foreground hover:bg-muted/50 hover:text-foreground"),children:C("ui.voiceover_mode_clone")})]}),"preset"===U?(0,a.jsx)(V,{selectedVoiceEntry:eB,t:C,onOpenLibrary:eZ}):(0,a.jsx)(S,{durationSeconds:eI,fileInputRef:eC,isPreparing:eL,isRecording:eM,recorderErrorMessage:ez,recordingSupported:eE,referenceAudio:er,referenceAudioUrl:el,t:C,onClearReferenceAudio:()=>{ea(null),eT()},onFileChange:eX,onStartRecording:eR,onStopRecording:eU}),ef?(0,a.jsx)("div",{className:"rounded-lg border border-destructive/30 bg-destructive/5 px-3 py-2 text-sm text-destructive",children:ef}):null,(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsxs)("div",{className:"inline-flex h-8 items-center gap-2 rounded-md border border-border bg-background/80 px-2.5 text-sm font-medium text-foreground",children:[(0,a.jsx)(o.A,{className:"h-4 w-4 text-primary"}),(0,a.jsx)("span",{children:C("ui.voice_studio_model_chip")})]}),"preset"===U&&eB?(0,a.jsxs)("div",{className:"inline-flex h-8 items-center gap-2 rounded-md border border-border bg-background/80 px-2.5 text-sm text-muted-foreground",children:[(0,a.jsx)(d.A,{className:"h-4 w-4 text-primary"}),(0,a.jsxs)("span",{className:"max-w-[220px] truncate",children:[eB.locale.flag," ",eB.personaName," \xb7"," ",eB.emotion.emoji," ",C(eB.emotion.labelKey)]})]}):"clone"===U&&er?(0,a.jsxs)("div",{className:"inline-flex h-8 max-w-full items-center gap-2 rounded-md border border-border bg-background/80 px-2.5 text-sm text-muted-foreground",children:[(0,a.jsx)(c.A,{className:"h-4 w-4 text-primary"}),(0,a.jsx)("span",{className:"truncate",children:C("ui.voice_studio_clone_label")})]}):null]}),(0,a.jsxs)("div",{className:(0,v.cn)("flex items-center gap-2 max-sm:flex-col max-sm:items-stretch",!y&&"justify-end"),children:[y?(0,a.jsx)("div",{className:"flex items-center gap-1.5 px-1.5 text-xs text-muted-foreground whitespace-nowrap",children:(0,a.jsx)("span",{className:"tabular-nums text-xs font-medium text-muted-foreground",children:eD})}):null,(0,a.jsx)(g.$,{type:"button",variant:"ai",onClick:e0,disabled:!eK||e_,className:(0,v.cn)("gap-2 max-sm:w-full",y&&"ml-auto"),children:e_?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(u.A,{className:"h-4 w-4 animate-spin"}),C("ui.voiceover_generating")]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.A,{className:"h-4 w-4"}),C("ui.voiceover_generate")]})})]})]})})})]})})]})}),e$?(0,a.jsx)("div",{className:(0,v.cn)("min-w-0 xl:sticky xl:top-24",eG&&"xl:top-8"),children:(0,a.jsxs)("div",{className:(0,v.cn)("rounded-xl border border-border bg-card/80 p-4 shadow-sm backdrop-blur-sm sm:p-5",eG&&"border-border/70 bg-card/70 p-3.5 shadow-[0_24px_72px_-58px_var(--glow-primary)] sm:p-4"),children:[(0,a.jsxs)("div",{className:"mb-3 space-y-1",children:[(0,a.jsx)("div",{className:"text-sm font-medium text-muted-foreground",children:C("ui.voice_studio_result_title")}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:C("ui.voice_studio_result_description")})]}),"preset"===U&&eB?(0,a.jsxs)("div",{className:"mb-4 inline-flex items-center gap-2 rounded-full border border-border/70 bg-background/70 px-3 py-1.5 text-sm text-foreground",children:[(0,a.jsx)("span",{"aria-hidden":"true",children:eB.locale.flag}),(0,a.jsx)("span",{children:eB.personaName}),(0,a.jsx)("span",{className:"text-muted-foreground",children:"\xb7"}),(0,a.jsx)("span",{"aria-hidden":"true",children:eB.emotion.emoji}),(0,a.jsx)("span",{children:C(eB.emotion.labelKey)})]}):"clone"===U&&er?(0,a.jsxs)("div",{className:"mb-4 inline-flex max-w-full items-center gap-2 rounded-full border border-border/70 bg-background/70 px-3 py-1.5 text-sm text-foreground",children:[(0,a.jsx)(c.A,{className:"h-4 w-4 text-primary"}),(0,a.jsx)("span",{className:"truncate",children:C("ui.voice_studio_clone_label")})]}):null,(0,a.jsx)("div",{className:(0,v.cn)("flex items-center justify-center rounded-xl border border-border/60 bg-muted/20 p-4",eG?"min-h-[220px]":"min-h-[300px]"),children:e_?(0,a.jsxs)("div",{className:"space-y-3 text-center",children:[(0,a.jsx)(u.A,{className:"mx-auto h-8 w-8 animate-spin text-primary"}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:C("ui.voiceover_generating")})]}
1):ef?(0,a.jsxs)("div",{className:"max-w-md space-y-3 text-center",children:[(0,a.jsx)("div",{className:"mx-auto flex h-14 w-14 items-center justify-center rounded-full bg-destructive/10",children:(0,a.jsx)(i.A,{className:"h-7 w-7 text-destructive"})}),(0,a.jsx)("p",{className:"text-sm text-destructive",children:ef})]}):em?(0,a.jsxs)("div",{className:"w-full space-y-4",children:[(0,a.jsx)("div",{className:"rounded-xl border border-border/60 bg-background/80 p-4",children:(0,a.jsx)("audio",{controls:!0,src:em,className:"w-full"})}),(0,a.jsxs)(g.$,{type:"button",variant:"outline",onClick:()=>{if(!em)return;let e=document.createElement("a");e.href=em,e.download=ep,document.body.appendChild(e),e.click(),document.body.removeChild(e)},className:"w-full",children:[(0,a.jsx)(m.A,{className:"h-4 w-4"}),C("ui.voiceover_download")]})]}):(0,a.jsxs)("div",{className:"max-w-xs space-y-3 text-center",children:[(0,a.jsx)("div",{className:"mx-auto flex h-14 w-14 items-center justify-center rounded-full bg-primary/10",children:(0,a.jsx)(c.A,{className:"h-7 w-7 text-primary"})}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:C("ui.voice_studio_result_empty")})]})})]})}):null]}),(0,a.jsx)(F,{activeLocaleKey:ee,isOpen:ew,isSignedIn:!!P,selectedVoiceId:O,t:C,voiceCatalog:eF,voicesError:J,voicesLoading:q,onActiveLocaleChange:et,onOpenChange:ey,onSelectVoice:(e,t)=>{t&&et(t),K(e),eb(null),ey(!1)}})]})})}},75264:(e,t,r)=>{"use strict";r.d(t,{default:()=>i});var a=r(80735),s=r(47010),l=r(91533);let n=function(e){let{text:t,children:r}=e;return(0,a.jsx)(s.CopyToClipboard,{text:t,onCopy:()=>l.oR.success("Copied"),children:(0,a.jsx)("div",{className:"cursor-pointer",children:r})})};n.displayName="CopyComponent";let i=n},75958:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>u});var a=r(80735),s=r(14679),l=r(87478),n=r(60569),i=r(83563),o=r(47427);function d(e){var t;let{showcase:r}=e,n=(0,s.useRef)(null),d=(0,s.useRef)([]),[c,u]=(0,s.useState)(0),[m,x]=(0,s.use
1State)(!1),[p,g]=(0,s.useState)(!1),f=(0,o.a)(),b=r.videos,h=null!==(t=r.autoplayIntervalMs)&&void 0!==t?t:5e3;(0,s.useEffect)(()=>{if(!n.current)return;let e=new IntersectionObserver(e=>{let[t]=e;return x(t.isIntersecting)},{threshold:.3});return e.observe(n.current),()=>e.disconnect()},[]),(0,s.useEffect)(()=>{d.current.forEach((e,t)=>{e&&(t===c?f?p?e.play().catch(()=>{}):e.pause():m?(e.play().catch(()=>{}),g(!0)):(e.pause(),g(!1)):e.pause())})},[m,c,f,p]),(0,s.useEffect)(()=>{f&&g(!1)},[c,f]),(0,s.useEffect)(()=>{if(!m||f||b.length<=1)return;let e=setInterval(()=>{u(e=>(e+1)%b.length)},h);return()=>clearInterval(e)},[m,f,b.length,h]);let v=e=>{e===c?f&&g(!p):u(e)};return(0,a.jsxs)("div",{ref:n,className:(0,i.cn)("bg-card rounded-2xl p-4 border border-border/50","flex flex-col h-full"),children:[(0,a.jsx)("div",{className:"relative flex items-center justify-center gap-2 md:gap-3 h-[220px] md:h-[260px]",children:b.map((e,t)=>(0,a.jsxs)("div",{onClick:()=>v(t),className:(0,i.cn)("relative rounded-xl overflow-hidden cursor-pointer bg-black","border-2 border-border/50 shadow-xl","transition-all duration-500 ease-out","w-[110px] h-[160px] md:w-[130px] md:h-[185px]",t===c&&"!w-[140px] !h-[200px] md:!w-[160px] md:!h-[230px] z-10 border-primary/50 ring-2 ring-primary/20"),children:[(0,a.jsx)("video",{ref:e=>{d.current[t]=e},src:e,muted:!0,loop:!0,playsInline:!0,preload:"metadata",className:"w-full h-full object-cover"}),(0,a.jsx)("div",{className:(0,i.cn)("absolute inset-0 bg-black/60 transition-opacity duration-500",t===c?"opacity-0":"opacity-100")}),t===c&&!p&&(0,a.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-black/10 z-20 cursor-pointer",children:(0,a.jsx)("div",{className:"w-12 h-12 rounded-full bg-white/20 flex items-center justify-center hover:bg-white/30 transition-colors",children:(0,a.jsx)(l.A,{className:"w-5 h-5 text-white ml-0.5",fill:"white"})})})]},e))}),(0,a.jsx)("div",{className:"flex justify-center gap-1.5 mt-3",children:b.map((e,t)=>(0,a.jsx)("button",{onClick:()=>u(t),className:(0,i.cn)("w-1.5 h-1.5 rounded-full transition-all",t===c?"bg-primary w-4":"bg-muted-foreground/30")},t))}),(r.title||r.description)&&(0,a.jsxs)("div",{className:"mt-2 text-center",children:[r.title?(0,a.jsx)("h3",{className:"text-foreground font-semibold text-sm",children:r.title}):null,r.description?(0,a.jsx)("p",{className:"text-muted-foreground text-xs mt-0.5",children:r.description}):null]})]})}function c(e){let{item:t}=e;return(0,a.jsx)("div",{className:(0,i.cn)("bg-card rounded-2xl p-4","border border-border/50 hover:border-primary/50 transition-colors","h-full flex flex-col justify-center"),children:(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[t.icon?(0,a.jsx)("div",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-foreground/70 shrink-0",children:(0,a.jsx)(n.default,{name:t.icon,className:"w-5 h-5"})}):null,(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[t.title?(0,a.jsx)("h3",{className:"text-foreground font-semibold text-sm leading-tight",children:t.title}):null,t.description?(0,a.jsx)("p",{className:"text-muted-foreground text-xs mt-1 leading-relaxed",children:t.description}):null]})]})})}function u(e){var t;let{section:r}=e;if(r.disabled)return null;let s=null!==(t=r.features)&&void 0!==t?t:[];return(0,a.jsxs)("div",{id:r.name,className:"relative w-full",children:[(0,a.jsxs)("div",{className:"text-center mb-6 md:mb-8",children:[r.title?(0,a.jsx)("h2",{className:"text-2xl md:text-3xl lg:text-4xl font-bold mb-3",children:r.title}):null,r.description?(0,a.jsx)("p",{className:"text-muted-foreground text-sm md:text-base max-w-2xl mx-auto",children:r.description}):null]}),(0,a.jsx)("div",{className:"rounded-2xl bg-muted/30 border border-border/50 p-3 md:p-4 lg:p-5",children:(0,a.jsx)("div",{className:"flex flex-col lg:flex-row gap-3 md:gap-4",children:s.length>=4?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"grid grid-cols-2 lg:grid-cols-1 gap-3 md:gap-4 lg:w-1/4",children:[(0,a.jsx)(c,{item:s[0]}),(0,a.jsx)(c,{item:s[1]})]}),(0,a.jsx)("div",{className:"lg:w-1/2 min-h-[320px]",children:(0,a.jsx)(d,{showcase:r.showcase})}),(0,a.jsxs)("div",{className:"grid grid-cols-2 lg:grid-cols-1 gap-3 md:gap-4 lg:w-1/4",children:[(0,a.jsx)(c,{item:s[2]}),(0,a.jsx)(c,{item:s[3]})]})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"lg:w-2/3 min-h-[320px]",children:(0,a.jsx)(d,{showcase:r.showcase})}),s.length>0?(0,a.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-1 gap-3 md:gap-4 lg:w-1/3",children:s.map((e,t)=>(0,a.jsx)(c,{item:e},t))}):null]})})})]})}}
1,77196:(e,t,r)=>{"use strict";r.d(t,{U:()=>s});var a=r(14679);function s(e){let[t,r]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{let t=window.matchMedia(e);r(t.matches);let a=e=>{r(e.matches)};return t.addEventListener("change",a),()=>{t.removeEventListener("change",a)}},[e]),t}},80756:(e,t,r)=>{"use strict";r.d(t,{default:()=>b});var a=r(80735),s=r(14679),l=r(25760),n=r(60726),i=r(83563);let o=e=>{let{children:t,className:r,containerClassName:s}=e;return(0,a.jsxs)("div",{style:{background:"linear-gradient(40deg, var(--hero-gradient-start), var(--hero-gradient-end))"},className:(0,i.cn)("relative h-full w-full overflow-hidden",s),children:[(0,a.jsx)("div",{className:(0,i.cn)("",r),children:t}),(0,a.jsxs)("div",{className:"gradients-container h-full w-full",children:[(0,a.jsx)("div",{style:{background:"radial-gradient(circle at center, var(--hero-orb-1) 0, transparent 50%) no-repeat"},className:(0,i.cn)("w-[var(--size)] h-[var(--size)] top-[calc(50%-var(--size)/2)] left-[calc(50%-var(--size)/2)]","[transform-origin:center_center]","animate-first","opacity-100")}),(0,a.jsx)("div",{style:{background:"radial-gradient(circle at center, var(--hero-orb-2) 0, transparent 50%) no-repeat"},className:(0,i.cn)("w-[var(--size)] h-[var(--size)] top-[calc(50%-var(--size)/2)] left-[calc(50%-var(--size)/2)]","[transform-origin:calc(50%-400px)]","animate-second","opacity-100")}),(0,a.jsx)("div",{style:{background:"radial-gradient(circle at center, var(--hero-orb-3) 0, transparent 50%) no-repeat"},className:(0,i.cn)("w-[var(--size)] h-[var(--size)] top-[calc(50%-var(--size)/2)] left-[calc(50%-var(--size)/2)]","[transform-origin:calc(50%+400px)]","animate-third","opacity-100")})]})]})},d="pointer-events-none absolute inset-0 -z-10 overflow-hidden",c=function(){let e="";for(let t=0;t<=2880;t+=10){let r=150+66*Math.sin(2*Math.PI*t/1440-.6)+20*Math.sin(2*Math.PI*t/480+1.1);e+=(0===t?"M":"L")+t+","+r.toFixed(1)+" "}return e}(),u=function(){let e="";for(let t=0;t<=1440;t+=8){let r=110+42*Math.sin(3*Math.PI*t/1440)*Math.pow(Math.sin(Math.PI*t/1440),.35);e+=(0===t?"M":"L")+t+","+r.toFixed(1)+" "}return e}();function m(e){let{className:t}=e,r="nanobanana"===n.CQ.siteId?"h-full w-full opacity-58 dark:opacity-44":"h-full w-full opacity-35",s="nanobanana"===n.CQ.siteId?"absolute inset-0 bg-background/3 dark:bg-background/24":"absolute inset-0 bg-background/14 dark:bg-background/22",l="nanobanana"===n.CQ.siteId?{"--hero-gradient-start":"color-mix(in oklch, var(--background) 62%, #C79A5A)","--hero-gradient-end":"color-mix(in oklch, var(--background) 36%, #5E554D)","--hero-orb-1":"color-mix(in oklch, #C79A5A 52%, transparent)","--hero-orb-2":"color-mix(in oklch, #8D705A 46%, transparent)","--hero-orb-3":"color-mix(in oklch, #5E554D 38%, transparent)"}:void 0;return(0,a.jsxs)("div",{"aria-hidden":"true","data-hero-bg-mode":"gradient",className:(0,i.cn)(d,t),style:l,children:[(0,a.jsx)(o,{containerClassName:r}),(0,a.jsx)("div",{className:s}),(0,a.jsx)("div",{className:"absolute inset-x-0 bottom-0 h-40 bg-gradient-to-b from-transparent via-background/68 to-background"})]})}function x(e){let{className:t}=e;return(0,a.jsxs)("div",{"aria-hidden":"true","data-hero-bg-mode":"static",className:(0,i.cn)(d,t),children:[(0,a.jsx)("div",{className:"absolute inset-0",style:{background:"radial-gradient(ellipse 90% 62% at 50% 0%, color-mix(in oklch, var(--ai-gradient-from) 16%, transparent), transparent 72%)"}}),(0,a.jsx)("div",{className:"absolute inset-0",style:{background:"radial-gradient(ellipse 52% 40% at 84% 10%, color-mix(in oklch, var(--ai-gradient-to) 12%, transparent), transparent 70%)"}}),(0,a.jsx)("div",{className:"absolute inset-0",style:{background:"radial-gradient(ellipse 46% 36% at 12% 18%, color-mix(in oklch, var(--ai-gradient-via) 10%, transparent), transparent 70%)"}}),(0,a.jsx)("div",{className:"absolute inset-x-0 bottom-0 h-40 bg-gradient-to-b from-transparent via-background/68 to-background"})]})}function p(e){let{videoSrc:t,posterSrc:r,className:n}=e,o=(0,s.useRef)(null),[c,u]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{var e;let t=window.matchMedia("(prefers-reduced-motion: reduce)").matches,r
1=!!(null===(e=navigator.connection)||void 0===e?void 0:e.saveData);u(!t&&!r)},[]),(0,s.useEffect)(()=>{c&&o.current&&(o.current.load(),o.current.play().catch(()=>{}))},[c]),(0,a.jsxs)("div",{"aria-hidden":"true","data-hero-bg-mode":"video",className:(0,i.cn)(d,n),children:[r?(0,a.jsx)(l.default,{src:r,alt:"",fill:!0,priority:!0,sizes:"100vw",className:"object-cover"}):null,(0,a.jsx)("video",{ref:o,className:"absolute inset-0 h-full w-full object-cover",muted:!0,playsInline:!0,loop:!0,preload:"none",autoPlay:c,poster:r,children:c?(0,a.jsx)("source",{src:t,type:"video/mp4"}):null}),(0,a.jsx)("div",{className:"absolute inset-0 bg-background/30 dark:bg-background/56"}),(0,a.jsx)("div",{className:"absolute inset-0",style:{background:"linear-gradient(180deg, color-mix(in oklch, var(--background) 18%, transparent) 0%, color-mix(in oklch, var(--background) 46%, transparent) 48%, color-mix(in oklch, var(--background) 82%, transparent) 100%)"}}),(0,a.jsx)("div",{className:"absolute inset-0",style:{background:"radial-gradient(circle at 50% 18%, color-mix(in oklch, var(--card) 26%, transparent), transparent 44%)"}}),(0,a.jsx)("div",{className:"absolute inset-0",style:{background:"linear-gradient(90deg, color-mix(in oklch, var(--background) 38%, transparent) 0%, transparent 18%, transparent 82%, color-mix(in oklch, var(--background) 38%, transparent) 100%)"}}),(0,a.jsx)("div",{className:"absolute inset-x-0 bottom-0 h-48 bg-gradient-to-b from-transparent via-background/72 to-background"})]})}function g(e){let{className:t}=e;return(0,a.jsxs)("div",{"aria-hidden":"true","data-hero-bg-mode":"ribbon",className:(0,i.cn)(d,t),style:{"--ribbon-core":"var(--primary)","--ribbon-hi":"color-mix(in oklch, var(--primary) 55%, white)"},children:[(0,a.jsx)("div",{className:"absolute inset-0",style:{background:"radial-gradient(ellipse 62% 46% at 50% 44%, color-mix(in oklch, var(--ai-gradient-from) 12%, transparent), transparent 72%)"}}),(0,a.jsx)("div",{className:"hero-fx-band hero-ribbon-band",children:(0,a.jsxs)("div",{className:"hero-ribbon-breathe",children:[(0,a.jsx)("div",{className:"hero-ribbon-drift hero-ribbon-bloom",children:(0,a.jsx)("svg",{viewBox:"0 0 2880 300",preserveAspectRatio:"none",children:(0,a.jsx)("path",{d:c})})}),(0,a.jsx)("div",{className:"hero-ribbon-drift hero-ribbon-core",children:(0,a.jsxs)("svg",{viewBox:"0 0 2880 300",preserveAspectRatio:"none",children:[(0,a.jsx)("defs",{children:(0,a.jsxs)("linearGradient",{id:"heroRibbonGrad",gradientUnits:"userSpaceOnUse",x1:"0",y1:"0",x2:"0",y2:"300",children:[(0,a.jsx)("stop",{offset:"0",stopColor:"var(--ribbon-core)"}),(0,a.jsx)("stop",{offset:"0.5",stopColor:"var(--ribbon-hi)"}),(0,a.jsx)("stop",{offset:"1",stopColor:"var(--ribbon-core)"})]})}),(0,a.jsx)("path",{d:c})]})})]})}),(0,a.jsx)("div",{className:"absolute inset-x-0 bottom-0 h-40 bg-gradient-to-b from-transparent via-background/68 to-background"})]})}function f(e){let{className:t}=e;return(0,a.jsxs)("div",{"aria-hidden":"true","data-hero-bg-mode":"string",className:(0,i.cn)(d,t),style:{"--string-core":"var(--primary)","--string-hi":"color-mix(in oklch, var(--primary) 60%, white)"},children:[(0,a.jsx)("div",{className:"absolute inset-0",style:{background:"radial-gradient(ellipse 60% 42% at 50% 50%, color-mix(in oklch, var(--primary) 8%, transparent), transparent 72%)"}}),(0,a.jsxs)("div",{className:"hero-string-band",children:[(0,a.jsx)("div",{className:"hero-string-axis"}),(0,a.jsx)("svg",{className:"hero-string-ghost hero-string-g1",viewBox:"0 0 1440 220",preserveAspectRatio:"none",children:(0,a.jsx)("path",{d:u,vectorEffect:"non-scaling-stroke"})}),(0,a.jsx)("svg",{className:"hero-string-ghost hero-string-g2",viewBox:"0 0 1440 220",preserveAspectRatio:"none",children:(0,a.jsx)("path",{d:u,vectorEffect:"non-scaling-stroke"})}),(0,a.jsx)("svg",{className:"hero-string-bloom",viewBox:"0 0 1440 220",preserveAspectRatio:"none",children:(0,a.jsx)("path",{d:u,vectorEffect:"non-scaling-stroke"})}),(0,a.jsx)("svg",{className:"hero-string-core",viewBox:"0 0 1440 220",preserveAspectRatio:"none",children:(0,a.jsx)("path",{d:u,vectorEffect:"non-scaling-stroke"})})]}),(0,a.jsx)("div",{className:"absolute inset-x-0 bottom-0 h-40 bg-gradient-to-b from-transparent via-background/68 to-background"})]})}function b(e){var t,r;let{className:s}
1=e,l=n.CQ.homepage,i=(null==l?void 0:l.heroBackgroundMode)||"gradient",o=null==l?void 0:null===(t=l.heroVideo)||void 0===t?void 0:t.trim();return"ribbon"===i?(0,a.jsx)(g,{className:s}):"string"===i?(0,a.jsx)(f,{className:s}):"video"===i&&o?(0,a.jsx)(p,{videoSrc:o,posterSrc:null==l?void 0:null===(r=l.heroPoster)||void 0===r?void 0:r.trim(),className:s}):"static"===i?(0,a.jsx)(x,{className:s}):(0,a.jsx)(m,{className:s})}},84871:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>y});var a=r(80735),s=r(14679),l=r(90961),n=r(46854),i=r(87478),o=r(2119),d=r(70677),c=r(93070),u=r(25760),m=r(47427),x=r(83563);let p=["https://pub-eb5b81bfee5c4e39ba2d1f7195360ef2.r2.dev/ads-ai/avatars/898c3d69f78748c99fd71725c97fa709.webp","https://pub-eb5b81bfee5c4e39ba2d1f7195360ef2.r2.dev/ads-ai/avatars/839ac106a31a40f7861f3b997434cddc.webp","https://pub-eb5b81bfee5c4e39ba2d1f7195360ef2.r2.dev/ads-ai/avatars/1585ddbf3fbf4f29bff809eb13a6daab.webp"],g=[{url:"https://pub-eb5b81bfee5c4e39ba2d1f7195360ef2.r2.dev/ads-ai/5.mp4"},{url:"https://pub-eb5b81bfee5c4e39ba2d1f7195360ef2.r2.dev/ads-ai/7.mp4"},{url:"https://pub-eb5b81bfee5c4e39ba2d1f7195360ef2.r2.dev/ads-ai/8.mp4"}];function f(e){let{images:t,grain:r}=e;return(0,a.jsx)("div",{className:"relative w-full aspect-[4/3] rounded-xl overflow-hidden bg-card border border-border/50",children:(0,a.jsxs)("div",{className:"absolute inset-4 flex items-center justify-center gap-3",children:[(0,a.jsxs)("div",{className:"w-24 h-32 md:w-28 md:h-36 rounded-lg bg-muted shadow-lg overflow-hidden border border-border/50 relative",children:[(0,a.jsx)(u.default,{src:t[0],alt:"Avatar",fill:!0,className:"object-cover",sizes:"(max-width: 768px) 100px, 120px"}),r&&(0,a.jsx)("span",{"aria-hidden":!0,className:"music-grain"})]}),(0,a.jsxs)("div",{className:"w-28 h-36 md:w-32 md:h-40 rounded-lg bg-muted shadow-xl overflow-hidden relative z-10 border border-border/50 ring-2 ring-background/80",children:[(0,a.jsx)(u.default,{src:t[1],alt:"Avatar",fill:!0,className:"object-cover",sizes:"(max-width: 768px) 120px, 140px"}),r&&(0,a.jsx)("span",{"aria-hidden":!0,className:"music-grain"})]}),(0,a.jsxs)("div",{className:"w-24 h-32 md:w-28 md:h-36 rounded-lg bg-muted shadow-lg overflow-hidden border border-border/50 relative",children:[(0,a.jsx)(u.default,{src:t[2],alt:"Avatar",fill:!0,className:"object-cover",sizes:"(max-width: 768px) 100px, 120px"}),r&&(0,a.jsx)("span",{"aria-hidden":!0,className:"music-grain"})]})]})})}function b(e){let{step2:t}=e;return(0,a.jsx)("div",{className:"relative w-full aspect-[4/3] rounded-xl overflow-hidden bg-card border border-border/50 flex items-center justify-center p-6",children:(0,a.jsxs)("div",{className:"w-full max-w-xs bg-popover rounded-xl shadow-lg p-5 border border-border/50",children:[(0,a.jsx)("div",{className:"text-foreground font-semibold text-sm mb-4",children:null==t?void 0:t.progressTitle}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)(l.A,{className:"w-5 h-5 text-primary flex-shrink-0"}),(0,a.jsx)("span",{className:"text-sm text-muted-foreground",children:null==t?void 0:t.progress1})]}),(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsxs)("div",{className:"flex flex-col items-center",children:[(0,a.jsx)(l.A,{className:"w-5 h-5 text-primary flex-shrink-0"}),(0,a.jsx)("div",{className:"w-px h-4 bg-border mt-1"})]}),(0,a.jsx)("span",{className:"text-sm text-muted-foreground",children:null==t?void 0:t.progress2})]}),(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)(n.A,{className:"w-5 h-5 text-primary/70 flex-shrink-0 animate-spin"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-sm text-foreground font-medium",children:null==t?void 0:t.progress3}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:null==t?void 0:t.progressWaiting})]})]})]})]})})}function h(e){let{video:t}=e,r=(0,s.useRef)(null),[l,n]=(0,s.useState)(!1),[c,u]=(0,s.useState)(!0),x=(0,m.a)();return(0,a.jsxs)("div",{className:"relative rounded-lg overflow-hidden bg-black shadow-lg border border-border/50 cursor-pointer",onMouseEnter:()=>{if(x)return;let e=r.current;e&&(e.play().catch(()=>{}),n(!0))},onMouseLeave:()=>{if(x)return;let e=r.current;e&&(e.pause(),e.currentTime=0,n(!1))},onClick:()=>{let e=r.current;e&&(l?(e.pause(),n(!1)):(e.play().catch(()=>{}),n(!0)))}
1,children:[(0,a.jsx)("video",{ref:r,src:t.url,muted:c,loop:!0,playsInline:!0,preload:"metadata",className:"w-full h-full object-cover"}),!l&&(0,a.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-black/10 z-10 cursor-pointer",children:(0,a.jsx)("div",{className:"w-12 h-12 rounded-full bg-white/20 backdrop-blur-sm flex items-center justify-center hover:bg-white/30 transition-colors",children:(0,a.jsx)(i.A,{className:"w-5 h-5 text-white ml-0.5",fill:"white"})})}),(0,a.jsx)("button",{onClick:e=>{e.stopPropagation();let t=r.current;t&&(t.muted=!t.muted,u(!c))},className:"absolute top-1.5 right-1.5 p-1.5 rounded-full bg-black/60 backdrop-blur-sm hover:bg-black/80 transition-colors z-10","aria-label":c?"Unmute":"Mute",children:c?(0,a.jsx)(o.A,{className:"w-3 h-3 text-white/80"}):(0,a.jsx)(d.A,{className:"w-3 h-3 text-white"})})]})}function v(e){let{videos:t}=e;return(0,a.jsx)("div",{className:"relative w-full aspect-[4/3] rounded-xl overflow-hidden bg-card border border-border/50 p-4",children:(0,a.jsx)("div",{className:"grid grid-cols-3 gap-2 h-full",children:t.map((e,t)=>(0,a.jsx)(h,{video:e},t))})})}function j(e){let{audio:t,isActive:r,onToggle:l}=e,n=(0,s.useRef)(null);return(0,s.useEffect)(()=>{let e=n.current;e&&(r?e.play().catch(()=>{}):(e.pause(),e.currentTime=0))},[r]),(0,a.jsxs)("button",{type:"button",onClick:l,className:"relative rounded-lg overflow-hidden bg-muted shadow-lg border border-border/50 cursor-pointer group focus:outline-none focus-visible:ring-2 focus-visible:ring-primary","aria-label":r?"Pause ".concat(t.title):"Play ".concat(t.title),children:[t.cover?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("img",{src:t.cover,alt:t.title||"Audio cover",className:"absolute inset-0 w-full h-full object-cover",loading:"lazy"}),(0,a.jsx)("span",{"aria-hidden":!0,className:"music-grain"})]}):(0,a.jsx)("div",{className:"absolute inset-0 bg-gradient-to-br from-primary/30 via-primary/20 to-primary/30"}),(0,a.jsx)("div",{className:"absolute inset-0 bg-black/15 group-hover:bg-black/30 transition-colors"}),(0,a.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,a.jsx)("div",{className:"w-12 h-12 rounded-full bg-white/95 text-black flex items-center justify-center shadow-md transition-transform group-hover:scale-105 group-active:scale-95",children:r?(0,a.jsx)(c.A,{className:"w-5 h-5",fill:"currentColor"}):(0,a.jsx)(i.A,{className:"w-5 h-5 ml-0.5",fill:"currentColor"})})}),t.title&&(0,a.jsx)("div",{className:"absolute left-0 right-0 bottom-0 px-2 py-1.5 bg-gradient-to-t from-black/70 to-transparent text-white text-[10px] sm:text-xs font-medium truncate text-left",children:t.title}),(0,a.jsx)("audio",{ref:n,src:t.url,preload:"none",className:"hidden"})]})}function N(e){let{audios:t}=e,[r,l]=(0,s.useState)(null);return(0,a.jsx)("div",{className:"relative w-full aspect-[4/3] rounded-xl overflow-hidden bg-card border border-border/50 p-4",children:(0,a.jsx)("div",{className:"grid grid-cols-3 gap-2 h-full",children:t.map((e,t)=>(0,a.jsx)(j,{audio:e,isActive:r===t,onToggle:()=>l(e=>e===t?null:t)},e.url||t))})})}function w(e){let{stepNumber:t,title:r,description:s,visual:l,reversed:n=!1}=e;return(0,a.jsxs)("div",{className:(0,x.cn)("grid gap-6 md:gap-8 items-center","grid-cols-1 md:grid-cols-2",n&&"md:[&>*:first-child]:order-2"),children:[(0,a.jsx)("div",{className:"w-full",children:l}),(0,a.jsxs)("div",{className:(0,x.cn)("flex flex-col",n?"md:items-end md:text-right":"md:items-start md:text-left","items-center text-center"),children:[(0,a.jsx)("div",{className:"flex items-center gap-2 mb-3",children:(0,a.jsx)("span",{className:"flex items-center justify-center w-7 h-7 rounded-full border-2 border-primary text-primary text-sm font-bold",children:t})}),(0,a.jsx)("h3",{className:"text-xl md:text-2xl font-bold text-foreground mb-2",children:r}),(0,a.jsx)("p",{className:"text-muted-foreground text-sm md:text-base max-w-md leading-relaxed",children:s})]})]})}function y(e){var t,r,s,l,n,i;let{section:o}=e;if(o.disabled)return null;let d=o.avatarImages&&o.avatarImages.length>=3?o.avatarImages:p,c=o.audios&&o.audios.length>=3?o.audios:null,u=o.videos&&o.videos.length>=3?o.videos:g,m=c?(0,a.jsx)(N,{audios:c.slice(0,3)}):(0,a.jsx)(v,{videos:u});return(0,a.jsx)("section",{id:o.name,className:"w-full py-12 lg:py-16",children:(0,a.jsxs)("div",{className:"container px-4 md:px-6",children:[(0,a.jsxs)("div",{className:"text-center mb-10 md:mb-14",children:[(0,a.jsx)("h2",{className:"text-2xl md:text-3xl lg:text-4xl font-bold mb-3 text-foreground",children:o.title}),(0,a.jsx)("p",{className:"text-muted-foreground text-sm md:text-base max-w-2xl mx-auto",children:o.description})]}),(0,a.jsx)("div",{className:"rounded-2xl bg-muted/30 border border-border/50 p-6 md:p-8 lg:p-12",children:(0,a.jsxs)("div",{className:"space-y-12 md:space-y-16 lg:space-y-20 max-w-5xl mx-auto",children:[(0,a.jsx)(w,{stepNumber:1,title:null===(t=o.step1)||void 0===t?void 0:t.t
1itle,description:null===(r=o.step1)||void 0===r?void 0:r.description,visual:(0,a.jsx)(f,{images:d,grain:!!c})}),(0,a.jsx)(w,{stepNumber:2,title:null===(s=o.step2)||void 0===s?void 0:s.title,description:null===(l=o.step2)||void 0===l?void 0:l.description,visual:(0,a.jsx)(b,{step2:o.step2}),reversed:!0}),(0,a.jsx)(w,{stepNumber:3,title:null===(n=o.step3)||void 0===n?void 0:n.title,description:null===(i=o.step3)||void 0===i?void 0:i.description,visual:m})]})})]})})}},89920:(e,t,r)=>{"use strict";r.d(t,{Xi:()=>o,av:()=>d,j7:()=>i,tU:()=>n});var a=r(80735);r(14679);var s=r(32338),l=r(83563);function n(e){let{className:t,...r}=e;return(0,a.jsx)(s.bL,{"data-slot":"tabs",className:(0,l.cn)("flex flex-col gap-2",t),...r})}function i(e){let{className:t,...r}=e;return(0,a.jsx)(s.B8,{"data-slot":"tabs-list",className:(0,l.cn)("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-1 gap-1",t),...r})}function o(e){let{className:t,...r}=e;return(0,a.jsx)(s.l9,{"data-slot":"tabs-trigger",className:(0,l.cn)("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1.5 text-sm font-medium ring-offset-background transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50","data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm","data-[state=inactive]:text-muted-foreground data-[state=inactive]:hover:text-foreground data-[state=inactive]:hover:bg-background/50","[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 gap-1.5",t),...r})}function d(e){let{className:t,...r}=e;return(0,a.jsx)(s.UC,{"data-slot":"tabs-content",className:(0,l.cn)("flex-1 outline-none ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...r})}},92053:(e,t,r)=>{"use strict";r.d(t,{default:()=>c});var a=r(80735),s=r(14679),l=r(60569),n=r(5322),i=r(13916),o=r(69591);function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en-US";return e>=9999999?"$10M+":new Intl.NumberFormat(t,{style:"currency",currency:"USD",maximumFractionDigits:2*(e<100)}).format(e)}function c(e){var t;let{section:r}
1=e,[o,c]=(0,s.useState)(r.inputs.skus.default),[m,x]=(0,s.useState)(r.inputs.photos_per_sku.default),[p,g]=(0,s.useState)(r.inputs.cost_per_photo_traditional.default),f=(t={skus:o,photosPerSku:m,costPerPhotoTraditional:p,makerAiCostPerImage:r.maker_ai_cost_per_image},(0,s.useMemo)(()=>(function(e){let t=Math.max(0,e.skus)*Math.max(0,e.photosPerSku),r=t*Math.max(0,e.costPerPhotoTraditional),a=t*Math.max(0,e.makerAiCostPerImage),s=Math.max(0,Math.min(r-a,9999999));return{totalImages:t,traditionalCost:r,makerAiCost:a,saved:s}})(t),[t.skus,t.photosPerSku,t.costPerPhotoTraditional,t.makerAiCostPerImage])),b=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:800,[r,a]=(0,s.useState)(e),l=(0,s.useRef)(null),n=(0,s.useRef)(e),i=(0,s.useRef)(0);return(0,s.useEffect)(()=>{n.current=r,i.current=performance.now();let s=r=>{let o=Math.min(1,(r-i.current)/t),d=1-Math.pow(1-o,3);a(n.current+(e-n.current)*d),o<1&&(l.current=requestAnimationFrame(s))};return l.current=requestAnimationFrame(s),()=>{l.current&&cancelAnimationFrame(l.current)}},[e,t]),r}(f.saved);if(r.disabled)return null;let{inputs:h,output:v}=r;return(0,a.jsx)("section",{id:r.name,className:"py-16 lg:py-24",children:(0,a.jsxs)("div",{className:"container",children:[r.title?(0,a.jsx)("h2",{className:"text-3xl md:text-4xl font-bold text-center mb-3",children:r.title}):null,r.description?(0,a.jsx)("p",{className:"text-center text-muted-foreground max-w-2xl mx-auto mb-12",children:r.description}):null,(0,a.jsxs)("div",{className:"grid lg:grid-cols-2 gap-6 max-w-5xl mx-auto",children:[(0,a.jsxs)("div",{className:"p-6 lg:p-8 rounded-2xl border border-border bg-card space-y-7",children:[(0,a.jsx)(u,{config:h.skus,value:o,onChange:c,formatValue:e=>e.toString()}),(0,a.jsx)(u,{config:h.photos_per_sku,value:m,onChange:x,formatValue:e=>e.toString()}),(0,a.jsx)(u,{config:h.cost_per_photo_traditional,value:p,onChange:g,formatValue:e=>"$".concat(e)})]}),(0,a.jsxs)("div",{className:"p-6 lg:p-8 rounded-2xl bg-ai-gradient text-primary-foreground flex flex-col justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"text-xs font-semibold tracking-widest uppercase opacity-80 mb-3",children:v.saving_label||"Estimated savings"}),(0,a.jsx)("div",{className:"text-5xl lg:text-6xl font-bold tabular-nums mb-6",children:d(b)}),(0,a.jsxs)("div",{className:"space-y-2 text-sm mb-8",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between opacity-90",children:[(0,a.jsx)("span",{children:v.breakdown_studio_label||"Studio cost"}),(0,a.jsx)("span",{className:"tabular-nums line-through opacity-70",children:d(f.traditionalCost)})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between opacity-90",children:[(0,a.jsx)("span",{children:v.breakdown_maker_label||"Maker AI cost"}),(0,a.jsx)("span",{className:"tabular-nums",children:d(f.makerAiCost)})]}),(0,a.jsx)("div",{className:"h-px bg-current opacity-30 my-2"}),(0,a.jsxs)("div",{className:"flex items-center justify-between font-semibold",children:[(0,a.jsx)("span",{children:v.breakdown_save_label||"You save"}),(0,a.jsx)("span",{className:"tabular-nums",children:d(f.saved)})]})]})]}),(0,a.jsx)(i.$,{asChild:!0,size:"lg",className:"bg-background text-foreground hover:bg-background/90 w-full",children:(0,a.jsxs)(n.PublicLink,{href:v.cta.url||"/",target:v.cta.target,className:"inline-flex items-center justify-center gap-2",children:[v.cta.title,v.cta.icon?(0,a.jsx)(l.default,{name:v.cta.icon,className:"size-4 shrink-0"}):null]})})]})]})]})})}function u(e){var t;let{config:r,value:s,onChange:l,formatValue:n}=e;return(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,a.jsx)("span",{className:"text-sm font-medium",children:r.label}),(0,a.jsx)("span",{className:"text-base font-bold text-primary tabular-nums",children:n(s)})]}),(0,a.jsx)(o.A,{value:[s],min:r.min,max:r.max,step:null!==(t=r.step)&&void 0!==t?t:1,onValueChange:e=>{var t;return l(null!==(t=e[0])&&void 0!==t?t:r.default)},"aria-label":r.label}),(0,a.jsxs)("div",{className:"flex justify-between text-xs text-muted-foreground mt-1.5",children:[(0,a.jsx)("span",{children:n(r.min)}),(0,a.jsx)("span",{children:n(r.max)})]})]})}},98459:(e,t,r)=>{"use strict";r.d(t,{BE:()=>c,I6:()=>m,_s:()=>n,gk:()=>u,zj:()=>d});var a=r(80735);r(14679);var s=r(99926),l=r(83563);function n(e){let{...t}=e;return(0,a.jsx)(s._s.Root,{"data-slot":"drawer",...t})}function i(e){let{...t}=e;return(0,a.jsx)(s._s.Portal,{"data-slot":"drawer-portal",...t})}function o(e){let{className:t,...r}=e;return(0,a.jsx)(s._s.Overlay,{"data-slot":"drawer-overlay",className:(0,l.cn)("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...r})}function d(e){let{className:t,children:r,...n}=e;return(0,a.jsxs)(i,{"data-slot":"drawer-portal",children:[(0,a.jsx)(o,{}),(0,a.jsxs)(s._s.Content,{"data-slot":"drawer-content",className:(0,l.cn)("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",t),...n,children:[(0,a.jsx)("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),r]})]})}function c(e){let{className:t,...r}=e;return(0,a.jsx)("div",{"data-slot":"drawer-header",className:(0,l.cn)("flex flex-col gap-1.5 p-4",t),...r})}function u(e){let{className:t,...r}=e;return(0,a.jsx)(s._s.Title,{"data-slot":"drawer-title",className:(0,l.cn)("text-foreground font-semibold",t),...r})}function m(e){let{className:t,...r}=e;return(0,a.jsx)(s._s.Description,{"data-slot":"drawer-description",className:(0,l.cn)("text-muted-foreground text-sm",t),...r})}},99299:(e,t,r)=>{"use strict";r.d(t,{default:()=>i});var a=r(80735),s=r(14679),l=r(83563);function n(e){let{pair:t,defaultPosition:r}
1=e,n=(0,s.useRef)(null),[i,o]=(0,s.useState)(r),[d,c]=(0,s.useState)(!1),[u,m]=(0,s.useState)(!1),[x,p]=(0,s.useState)(!1),g=(0,s.useCallback)(e=>{let t=n.current;if(!t)return;let r=t.getBoundingClientRect();o(Math.max(0,Math.min(100,(e-r.left)/r.width*100)))},[]),f=(0,s.useCallback)(e=>{let t=n.current;if(t){try{t.setPointerCapture(e.pointerId)}catch(e){}c(!0),g(e.clientX)}},[g]),b=(0,s.useCallback)(e=>{d&&g(e.clientX)},[d,g]),h=(0,s.useCallback)(e=>{let t=n.current;try{null==t||t.releasePointerCapture(e.pointerId)}catch(e){}c(!1)},[]),v=(0,s.useCallback)(e=>{"ArrowLeft"===e.key?o(e=>Math.max(0,e-5)):"ArrowRight"===e.key?o(e=>Math.min(100,e+5)):"Home"===e.key?o(0):"End"===e.key&&o(100)},[]);return(0,a.jsxs)("figure",{className:"flex flex-col gap-3",children:[(0,a.jsx)("div",{ref:n,className:"relative w-full rounded-2xl overflow-hidden border border-border bg-muted touch-none select-none cursor-ew-resize",style:{aspectRatio:"4 / 5"},onPointerDown:f,onPointerMove:b,onPointerUp:h,onPointerCancel:h,children:u&&x?(0,a.jsx)("div",{className:"absolute inset-0 flex items-center justify-center text-sm text-muted-foreground",children:"Preview unavailable"}):(0,a.jsxs)(a.Fragment,{children:[u?null:(0,a.jsx)("img",{src:t.before.src,alt:t.before.alt,className:"absolute inset-0 w-full h-full object-cover select-none",draggable:!1,onError:()=>m(!0)}),x?null:(0,a.jsx)("div",{className:"absolute inset-0",style:{clipPath:"inset(0 0 0 ".concat(i,"%)")},children:(0,a.jsx)("img",{src:t.after.src,alt:t.after.alt,className:"absolute inset-0 w-full h-full object-cover select-none",draggable:!1,onError:()=>p(!0)})}),t.before.label?(0,a.jsx)("span",{className:"absolute top-3 left-3 px-2.5 py-1 rounded-full text-[11px] font-medium bg-background/90 text-foreground backdrop-blur-sm",children:t.before.label}):null,t.after.label&&!x?(0,a.jsx)("span",{className:"absolute top-3 right-3 px-2.5 py-1 rounded-full text-[11px] font-medium bg-primary text-primary-foreground transition-opacity",style:{opacity:+(i<90)},children:t.after.label}):null,(0,a.jsx)("div",{className:"absolute top-0 bottom-0 w-0.5 bg-primary pointer-events-none",style:{left:"".concat(i,"%"),transform:"translateX(-50%)"}}),(0,a.jsx)("button",{type:"button",role:"slider","aria-label":"Before / after slider","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(i),tabIndex:0,onKeyDown:v,className:(0,l.cn)("absolute top-1/2 size-10 rounded-full bg-primary text-primary-foreground","flex items-center justify-center shadow-lg cursor-ew-resize","focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2",d?"scale-110":"scale-100","transition-transform"),style:{left:"".concat(i,"%"),transform:"translate(-50%, -50%)"},children:(0,a.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,a.jsx)("polyline",{points:"15 18 9 12 15 6"}),(0,a.jsx)("polyline",{points:"9 18 3 12 9 6"}),(0,a.jsx)("polyline",{points:"15 18 21 12 15 6"})]})})]})}),t.caption?(0,a.jsx)("figcaption",{className:"text-sm text-muted-foreground text-center",children:t.caption}):null]})}function i(e){var t,r;let{section:s}=e,i=null!==(t=s.pairs)&&void 0!==t?t:[];if(s.disabled||0===i.length)return null;let o=null!==(r=s.default_position)&&void 0!==r?r:50;return(0,a.jsx)("section",{id:s.name,className:"py-16 lg:py-24",children:(0,a.jsxs)("div",{className:"container",children:[s.title?(0,a.jsx)("h2",{className:"text-3xl md:text-4xl font-bold text-center mb-3",children:s.title}):null,s.description?(0,a.jsx)("p",{className:"text-center text-muted-foreground max-w-2xl mx-auto mb-10",children:s.description}):null,(0,a.jsx)("div",{className:(0,l.cn)("grid grid-cols-1 gap-6 lg:gap-8",2===i.length&&"md:grid-cols-2",3===i.length&&"md:grid-cols-2 lg:grid-cols-3",i.length>=4&&"md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4"),children:i.map(e=>(0,a.jsx)(n,{pair:e,defaultPosition:o},e.id))})]})})}}},e=>{e.O(0,[465],()=>{e.E(5249),e.E(4739)},5);var t=t=>e(e.s=t);e.O(0,[8995,2236,2580,9423,86,9270,7304,691,4576,2595,7271,7665,6824,83,5121,9462,3636,8553,4585,7210,3352,2266,9926,4273,1128,1684,5249,5633,3231,20,7737,6527,3956,9346,3820,4989,1848,7856,5815,7724,5041,5492,7358],()=>t(3425)),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.