1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="841f9cb7-3ce8-47c8-9d9a-ff526d9bfe9f",e._sentryDebugIdIdentifier="sentry-dbid-841f9cb7-3ce8-47c8-9d9a-ff526d9bfe9f")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3332],{3899:(e,t,r)=>{"use strict";r.d(t,{Sk:()=>n});var a=r(37876);function n(e){let{className:t}=e;return(0,a.jsx)("svg",{viewBox:"0 0 24 24",className:t,"aria-hidden":"true",fill:"#D97757",children:(0,a.jsx)("path",{d:"m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.
10182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z"})})}},7793:(e,t,r)=>{"use strict";r.d(t,{CH:()=>o,HU:()=>c,PA:()=>u,dA:()=>s,rL:()=>l,vb:()=>d,yQ:()=>m});var a=r(27925),n=r(15710);function s(){return{"@context":"https://schema.org","@type":"WebSite","@id":"".concat(n.W6,"/#website"),name:n.yy,alternateName:"Dough.do",url:n.W6,publisher:{"@id":"".concat(n.W6,"/#organization")}}}function l(){return{"@context":"https://schema.org","@type":"Organization","@id":"".concat(n.W6,"/#organization"),name:n.yy,legalName:n.$m,alternateName:["Dough.do","Dough app"],url:n.W6,logo:"".concat(n.W6,"/dough_logo.png"),description:n.h1,foundingLocation:{"@type":"Place",name:"".concat(n.F9,", ").concat(n.IK)},address:{"@type":"PostalAddress",addressLocality:n.F9,addressRegion:n.IK,addressCountry:n.OO},email:n.ei,contactPoint:{"@type":"ContactPoint",contactType:"customer support",email:n.ei,url:"".concat(n.W6,"/contact"),availableLanguage:["en"]},founder:i,...n.Ng.length>0?{sameAs:n.Ng}:{}}}let i=[{"@type":"Person",name:"Faheem Kajee",jobTitle:"Co-founder & CEO",sameAs:["https://www.linkedin.com/in/faheemkajee/"]},{"@type":"Person",name:"Stiven Morvan",jobTitle:"Co-founder & CTO",sameAs:["https://www.linkedin.com/in/stiven-morvan/"]}];function o(){return{"@context":"https://schema.org","@type":"AboutPage","@id":"".concat(n.W6,"/about#about"),url:"".concat(n.W6,"/about"),mainEntity:{"@id":"".concat(n.W6,"/#organization"),"@type":"Organization",name:n.yy,foundingLocation:{"@type":"Place",name:"New York, NY"},founder:i}}}function d(){return{"@context":"https://schema.org","@type":"SoftwareApplication","@id":"".concat(n.W6,"/#software"),name:n.yy,url:n.W6,applicationCategory:"BusinessApplication",operatingSystem:"Web, iOS",description:n.h1,image:n.FH,publisher:{"@id":"".concat(n.W6,"/#organization")},offers:{"@type":"Offer",price:String(a.l),priceCurrency:"USD",description:"Everything to design, make, and sell a product for $".concat(a.l,"/month plus a share of what you sell.")}}}function c(e){let t={"@context":"https://schema.org","@type":"Product",name:e.name,description:e.description,url:e.url};return e.imageUrl&&(t.image=e.imageUrl),e.brandName&&(t.brand={"@type":"Brand",name:e.brandName}),null!=e.price&&(t.offers={"@type":"Offer",price:e.price.toFixed(2),priceCurrency:e.currency||"USD",url:e.url,availability:"https://schema.org/".concat(e.availability||"PreOrder")}),t}function u(e){return{"@context":"https://schema.org","@type":"HowTo","@id":"".concat(e.url,"#howto"),name:e.name,description:e.description,url:e.url,publisher:{"@id":"".concat(n.W6,"/#organization")},step:e.steps.map((e,t)=>({"@type":"HowToStep",position:t+1,name:e.name,text:e.text}))}}function m(e){return{"@context":"https://schema.org","@type":"FAQPage",mainEntity:e.map(e=>({"@type":"Question",name:e.question,acceptedAnswer:{"@type":"Answer",text:e.answer}}))}}},12217:(e,t,r)=>{"use strict";async function a(e){var t;let r=null!=(t=e.redirectPath)?t:window.location.pathname,a=await fetch("/api/customer/waitlist",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...e,redirectPath:r})});if(!a.ok)throw Error((await a.json().catch(()=>({}))).error||"Failed to join waitlist");return a.json()}async function n(e){let t=await fetch("/api/customer/waitlist/stats?page_id=".concat(encodeURIComponent(e)));if(!t.ok)throw Error("Failed to load waitlist stats");return t.json()}async function s(e){let t=await fetch("/api/customer/waitlist/list?page_id=".concat(encodeURIComponent(e)));if(!t.ok)throw Error("Failed to load waitlist signups");return(await t.json()).entries}r.d(t,{It:()=>a,aX:()=>s,bz:()=>n})},16247:(e,t,r)=>{"use strict";r.d(t,{$U:()=>s,Sh:()=>i,Zv:()=>l});var a=r(22729),n=r(20006);function s(e){return"/?mode=refine&page_id=".concat(encodeURIComponent(e))}async function l(e){let t=await (0,a.F5)(e);return(0,n.Hq)(t.conversationId),t}async function i(e,t){let r=await (0,a.wc)({referenceRequestId:e,...t?{device:t}:{}});return(0,n.Hq)(r.conversationId),r}},16760:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/",function(){return r(75960)}])},20006:(e,t,r)=>{"use strict";r.d(t,{EC:()=>u,Fq:()=>c,GX:()=>m,Gi:()=>g,H5:()=>d,Hq:()=>i,M0:()=>l,Tz:()=>f,Wo:()=>x,XN:()=>a.XN,_s:()=>a._s,hc:()=>o,k0:()=>h});var a=r(99508);let n="dough_guide_chat_v1",s=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function l(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now();try{let t=window.sessionStorage.getItem(n);if(!t)return null;let r=JSON.parse(t);if(!r||"object"!=typeof r||"string"!=typeof r.conversationId||!s.test(r.conversationId)||"number"!=typeof r.updatedAt||!Number.isFinite(r.updatedAt)||e-r.updatedAt>2592e6)return null;return{conversationId:r.conversationId,updatedAt:r.updatedAt}}catch(e){return null}}function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now();try{window.sessionStorage.setItem(n,JSON.stringify({conversationId:e,updatedAt:t}))}catch(e){}}function o(){try{window.sessionStorage.removeItem(n)}catch(e){}}let d="conversation";function c(e){return"string"==typeof e&&s.test(e)?e:null}function u(e,t){var r,a;return null!=(a=null!=(r=null==e?void 0:e.conversationId)?r:c(t))?a:void 0}function m(e){var t;let{device:r,door:a,resumeId:n,seedPrompt:s}=e,l=(null==a?void 0:a.entry)==="idea"?a:null,i=null!=(t=null==l?void 0:l.message)?t:(null==s?void 0:s.trim())||void 0;return{firstText:i,request:{...r?{device:r}:{},...n?{conversationId:n}:{},...l?{startFresh:!0,entry:"idea"}:{},...(null==l?void 0:l.store)?{store:l.store}:{},...(null==a?void 0:a.entry)==="guide"?{entry:"guide"}:{},...i||l?{}:{opener:!0}}}}let p="dough_guide_chat_entry_v1";function f(e){return"brand"===e.kind?{kind:"existing",brandId:e.brand.brand_id,name:e.brand.name.slice(0,120)}:{kind:"new"}}function h(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Date.now(),a=e=>window.localStorage.setItem(p,JSON.stringify(e));try{a({entry:e,...t,createdAt:r})}catch(n){try{a({entry:e,...t.message?{message:t.message}:{},...t.store?{store:t.store}:{},createdAt:r})}catch(e){}}}function x(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Date.now();try{var t;let r=window.localStorage.getItem(p);if(!r)return null;let a=JSON.parse(r);if(!a||"guide"!==a.entry&&"idea"!==a.entry||"number"!=typeof a.createdAt||e-a.createdAt>864e5)return null;let n=(t=a.store)&&"object"==typeof t?"new"===t.kind?{kind:"new"}:"existing"===t.kind&&"string"==typeof t.brandId&&s.test(t.brandId)&&"string"==typeof t.name?{kind:"existing",brandId:t.brandId,name:t.name.slice(0,120)}:null:null;return{...n?{store:n}:{},entry:a.entry,createdAt:a.createdAt,..."string"==typeof a.message&&a.message.trim()?{message:a.message}:{},..."string"==typeof a.attachmentDataUrl&&a.attachmentDataUrl.startsWith("data:image/")?{attachmentDataUrl:a.attachmentDataUrl}:{}}}catch(e){return null}}function g(){try{window.localStorage.removeItem(p)}catch(e){}}},22729:(e,t,r)=>{"use strict";r.d(t,{E3:()=>u,F5:()=>h,N2:()=>m,Y:()=>d,am:()=>o,nF:()=>c,nK:()=>p,qS:()=>v,wc:()=>f,yu:()=>x});var a=r(91040),n=r(83044),s=r(41592),l=r(82873);function i(e){return"/api/guide/chat/".concat(encodeURIComponent(e))}async function o(e){return(await a.A.post("/api/guide/chat",e)).data}async function d(e){return(await a.A.get(i(e))).data}async function c(e,t){return(await a.A.post("".concat(i(e),"/restore"),t)).data}async function u(e,t){return(await a.A.post("".concat(i(e),"/renders/use"),t)).data}async function m(){return(await a.A.get("/api/guide/chat")).data}async function p(){return(await a.A.get("/api/guide/chat/earlier-ideas")).data}async function f(e){return(await a.A.post("/api/guide/chat/earlier-ideas",e)).data}async function h(e){return(await a.A.post("".concat(i(e),"/reopen"))).data}async function x(e){await a.A.post("".concat(i(e),"/stop"))}async function g(e,t){return(await a.A.post("".concat(i(e),"/built"),t)).data}async function b(e,t){return(await a.A.get("".concat(i(e),"/candidates/").concat(encodeURIComponent(t)))).data}async function v(e){var t;let{conversationId:r,buildId:a,candidate:i,spec:o,pieceIndex:d,storeChoice:c,latestRender:u}=e,m=o.pieces[d];if(!m)throw Error("Spec has no piece at index ".concat(d,"."));let p=await b(r,i.id),f={imageUrl:null!=(t=null==u?void 0:u.imageUrl)?t:p.imageUrl,blueprint:p.blueprint,matchScore:p.matchScore},h="".concat(p.prompt.trim().replace(/\.$/,""),". ").concat((0,l.Ch)(m)),x=(0,n.U)(p.blueprint)?i:null!=u?u:i,v=await (0,s.un)(h,f,c,o,{referenceRequestId:x.referenceRequestId,tileIndex:x.tileIndex},a),w=await (0,s._f)({storeChoice:c,prompt:h,tile:f,catalogLabelUrl:null,refine:v,clientRequestId:a,referenceRequestId:x.referenceRequestId,tileIndex:x.tileIndex,spec:o,pieceIndex:d});return await g(r,{buildId:a,pageId:w}),w}},24157:(e,t,r)=>{"use strict";r.d(t,{A:()=>
1o});var a=r(37876),n=r(12567),s=r(67716),l=r(202),i=r(66442);function o(e){let{open:t,onOpenChange:r,brands:o,status:d,onRetry:c,choice:u,onPick:m}=e,p=(0,l.a)(),f=(0,a.jsx)(i.mY,{brands:o,status:d,onRetry:c,choice:u,onPick:e=>{r(!1),m(e)}});return p?(0,a.jsx)(s._s,{open:t,onOpenChange:r,children:(0,a.jsxs)(s.zj,{className:"max-h-[85vh] rounded-t-3xl",children:[(0,a.jsxs)("div",{className:"px-5 pb-3 pt-1",children:[(0,a.jsx)(s.gk,{className:"text-[17px]",children:i.Q0}),(0,a.jsx)(s.I6,{className:"text-[13px]",children:i.Tj})]}),f]})}):(0,a.jsx)(n.lG,{open:t,onOpenChange:r,children:(0,a.jsxs)(n.Cf,{className:"flex max-h-[80vh] flex-col gap-0 overflow-hidden p-0 sm:max-w-md",children:[(0,a.jsxs)("div",{className:"px-5 pb-3 pt-5",children:[(0,a.jsx)(n.L3,{className:"text-[17px]",children:i.Q0}),(0,a.jsx)(n.rr,{className:"text-[13px]",children:i.Tj})]}),f]})})}},27925:(e,t,r)=>{"use strict";r.d(t,{l:()=>a,w:()=>n});let a=29,n=180},29991:(e,t,r)=>{"use strict";r.d(t,{Ay:()=>l,rE:()=>s,u:()=>n});let a=new Set(["avif","bmp","gif","heic","heif","jpeg","jpg","png","svg","tif","tiff","webp"]);function n(e){var t;if(e.type.startsWith("image/"))return!0;if(e.type&&"application/octet-stream"!==e.type)return!1;let r=null==(t=e.name.split(".").pop())?void 0:t.toLowerCase();return!!r&&a.has(r)}function s(e){var t;return null!=(t=l(e)[0])?t:null}function l(e){let t=[];for(let r=0;r<e.items.length;r+=1){let a=e.items[r];if("file"!==a.kind)continue;let s=a.getAsFile();s&&n(s)&&t.push(s)}if(t.length)return t;let r=[];for(let t=0;t<e.files.length;t+=1){let a=e.files[t];n(a)&&r.push(a)}return r}},32744:(e,t,r)=>{"use strict";r.d(t,{mT:()=>n});let a=["Product Design","Website Content"];function n(e,t){let r=a.map(t=>{var r,a;return null!=(a=e[t])?a:null==(r=Object.entries(e).find(e=>{let[r]=e;return r.startsWith("".concat(t," failed:"))}))?void 0:r[1]});return r.every(e=>"completed"===e)?"ready":r.some(e=>"error"===e)?"failed":t||r.some(e=>"ongoing"===e||"pending"===e)?"waiting":"incomplete"}},37458:(e,t,r)=>{"use strict";r.d(t,{U6:()=>n,hf:()=>s,kA:()=>a,vy:()=>i});let a=["sexual","illicit","violence","minors","likeness","unspecified"];function n(e){return"string"==typeof e&&a.includes(e)}let s="CONTENT_POLICY_BLOCKED",l="This is the image generator judging the picture, not us reviewing your business.",i={sexual:{title:"The image generator blocked this design",why:"The AI image generators behind every product image here refuse suggestive or revealing depictions of people, including as printed artwork on packaging. ".concat(l),fixes:["Describe any figures as fully clothed, and drop poses or wording that reads as suggestive.","Or take the people out entirely and let the type, colour and graphics carry the can.","If you attached a reference image, try again without it first. The model judges the whole picture, not just the part you wanted."]},illicit:{title:"The image generator blocked this design",why:"The AI image generators refuse drug references in generated images, including slang, paraphernalia and packaging that presents a product as a drug. It applies to a name or a joke on the label just as much as to a picture. ".concat(l),fixes:["Rename the product if the name itself is the reference. This is the step most people miss, because they assume only the artwork is being judged.","Remove drug wording and imagery from your description, then generate again.","An energy brand can keep the same loud, irreverent attitude with a name that is not a drug reference."]},violence:{title:"The image generator blocked this design",why:"The AI image generators refuse weapons, gore and graphic violence in generated images, including stylised or cartoon versions on packaging. ".concat(l),fixes:["Remove weapons, blood and injury from your description and from any attached reference.","Aggressive branding usually survives if the aggression is in the type and colour rather than the imagery."]},minors:{title:"This design cannot be generated",why:"The image generator refused this request, and it is not something we will help rephrase. If you believe this is a mistake, contact us and we will look at it.",fixes:[],terminal:!0},likeness:{title:"The image generator blocked this design",why:"The AI image generators refuse to produce real people and recognisable copyrighted characters. That includes cartoon characters, mascots and other brands' logos, even redrawn in a new style. ".concat(l),fixes:["Replace the character or person with an original one of your own.","If you attached a reference image containing a character or logo, try again without it.","Worth knowing regardless: a borrowed character is a trademark problem at manufacturing, not only at image generation."]},unspecified:{title:"The image generator blocked this design",why:"Every product image here is made by an AI image generator, and it refused this one on its content policy without telling us which rule it hit. ".concat(l),fixes:["If you attached a reference image, generate again without it. That is the most common cause, because the model judges the whole image rather than the part you wanted to borrow.","Check the usual triggers: a real person or a copyrighted character, a revealing figure, a drug or weapon reference, or brand names and logos you do not own.","Check the product name as well as the description. A name can trigger the block on its own.","Change the one element you think is the cause and regenerate. The models are inconsistent at the edges, so a small rewording often clears it."]}}},37852:(e,t,r)=>{"use strict";r.d(t,{BJ:()=>l,OB:()=>n,Wz:()=>d,Ye:()=>
1o,mE:()=>c,mq:()=>u});var a=r(62487);let n="dough_return_to",s="https://return-path.invalid";function l(e){let t,r;if("string"!=typeof e||!e||e.length>2048)return null;let a=e;if(!a.startsWith("/"))try{a=decodeURIComponent(a)}catch(e){return null}if(!a.startsWith("/")||a.startsWith("//")||a.startsWith("/\\"))return null;try{t=new URL(a,s)}catch(e){return null}if(t.origin!==s)return null;try{r=decodeURIComponent(t.pathname)}catch(e){return null}return r.includes("..")||r.includes("\\")||r.startsWith("/api/")?null:"".concat(t.pathname).concat(t.search).concat(t.hash)}function i(){let e=(0,a.nS)();return e?"; Domain=".concat(e):""}function o(e){let t=l(e);return t?"".concat(n,"=").concat(encodeURIComponent(t),"; Path=/; Max-Age=").concat(600,"; SameSite=Lax").concat(i()):null}function d(){let e="".concat(n,"=; Path=/; Max-Age=0; SameSite=Lax"),t=i();return t?[e,"".concat(e).concat(t)]:[e]}let c="/signup?tab=login";function u(e){return"string"==typeof e.brand_id&&e.brand_id.length>0}},38693:(e,t,r)=>{"use strict";r.d(t,{Sy:()=>o,Vf:()=>l,eD:()=>n});var a=r(17963);function n(e){(0,a.D)("guide_chat",e)}let s="dough_guide_chat_once";function l(e){var t,r,l;let i="".concat(null!=(t=(0,a.g)())?t:"",":").concat(e);try{let e=null!=(l=null==(r=window.sessionStorage.getItem(s))?void 0:r.split("|"))?l:[];if(e.includes(i))return;window.sessionStorage.setItem(s,[...e,i].slice(-12).join("|"))}catch(e){}n(e)}let i=new Set;function o(e,t){let r="".concat(t,":").concat(e);i.has(r)||(i.add(r),n(e))}},41592:(e,t,r)=>{"use strict";r.d(t,{AK:()=>g,Il:()=>d,_f:()=>x,f9:()=>f,gZ:()=>p,jS:()=>k,sj:()=>y,un:()=>h,vu:()=>m,x6:()=>u});var a=r(91040),n=r(83044),s=r(38241),l=r(87641),i=r(71041);function o(e){var t,r;return{tiles:e.tiles.map(e=>({imageUrl:e.imageUrl,blueprint:"catalog"===e.kind||"stock"===e.kind?e.blueprint:null,matchScore:"catalog"===e.kind||"stock"===e.kind?e.matchScore:null})),catalogLabelUrl:null!=(t=e.catalogLabelUrl)?t:null,referenceRequestId:null!=(r=e.id)?r:null}}async function d(e){if(e)try{await a.A.post("/api/reference-requests/mark-rendered",{id:e})}catch(e){console.error("[guide] mark-rendered ping failed:",e)}}async function c(e){try{let t=await a.A.post("/api/generate/imagine-tiles",e);return o(t.data)}catch(t){if(!(a.A.isAxiosError(t)&&!t.response)||"undefined"==typeof document)throw t;return await ("visible"===document.visibilityState?Promise.resolve():new Promise(e=>{let t=()=>{"visible"===document.visibilityState&&(document.removeEventListener("visibilitychange",t),e())};document.addEventListener("visibilitychange",t)})),o((await a.A.post("/api/generate/imagine-tiles",e)).data)}}let u=s.fk;function m(e,t,r,a){return c({prompt:e,clientRequestId:t,targetCatalogTiles:r,brandId:(0,i.fn)(a)})}function p(e){var t,r;let{prompt:a,styleImageUrl:n,productTile:s,clientRequestId:l}=e;return c({prompt:a,inspirationImage:n,brandId:(0,i.fn)(e.storeChoice),lockedLane:s.blueprint?"catalog":"custom",lockedBlueprint:null!=(t=s.blueprint)?t:void 0,lockedMatchScore:null!=(r=s.matchScore)?r:void 0,clientRequestId:l})}function f(e){var t,r,a,n;let{prompt:s,tile:l,tweakInstruction:o,inspirationImage:d,clientRequestId:u}=e,m=l.blueprint?"catalog":"custom";return c({prompt:s,tweakInstruction:o,brandId:(0,i.fn)(e.storeChoice),sourceImageUrl:"custom"===m?l.imageUrl:void 0,inspirationImage:null!=d?d:void 0,lockedLane:m,lockedBlueprint:null!=(r=l.blueprint)?r:void 0,lockedMatchScore:null!=(a=l.matchScore)?a:void 0,previousLabelUrl:"catalog"===m&&null!=(n=null==(t=l.blueprint)?void 0:t.labelUrl)?n:void 0,clientRequestId:u})}async function h(e,t,r,s,l,o){return(await a.A.post("/api/generate/refine",{prompt:e,selectedImageUrl:t.imageUrl,isInitialRefine:!0,brand_id:(0,i.fn)(r),catalog:t.blueprint?(0,n._)(t.blueprint):void 0,spec:null!=s?s:void 0,...(null==l?void 0:l.referenceRequestId)?{referenceRequestId:l.referenceRequestId,tileIndex:l.tileIndex}:{},...o?{clientRequestId:o}:{}})).data}async function x(e){var t,r,s,o,d,c;let{prompt:u,tile:m,catalogLabelUrl:p,refine:f,clientRequestId:h,referenceRequestId:x,tileIndex:g,spec:b,pieceIndex:v}=e;return(await a.A.post("/api/refine-session/create",{brand_id:(0,i.fn)(e.storeChoice),autoCreateBrand:(null==(t=e.storeChoice)?void 0:t.kind)==="new",prompt:u,selectedImageUrl:m.imageUrl,reference2Url:f.reference2Url,reference3Url:f.reference3Url,specBoardUrl:f.specBoardUrl,specBoardModel:f.specBoardModel,characteristics:f.characteristics,initialMessage:f.message,initialMessageTokens:f.messageTokens,catalog:m.blueprint?{sourcingType:"simplified",blueprint:m.blueprint,category:null!=(s=m.blueprint.category)?s:null,labelUrl:(0,n.U)(m.blueprint)?null:null!=(o=m.blueprint.labelUrl)?o:p}:null,clientRequestId:h,compromiseNote:null!=(c=null!=(d=null==(r=m.blueprint)?void 0:r.compromiseNote)?d:(0,l.M)(f.formatReconciliation))?c:void 0,referenceRequestId:x,tileIndex:g,spec:b,pieceIndex:v})).data.page_id}async function g(e,t){try{var r;return null!=(r=(await a.A.post("/api/generate/guide-questions",{prompt:e,context:t})).data.questions)?r:[]}catch(e){return console.error("[guide] questions fetch failed:",e),[]}}function b(e,t){let r=null==e?void 0:e.trim();if(r)return r.length>t?r.slice(0,t).trimEnd():r}let v=/^(unknown|unspecified|n\/?a|none|null|undefined|tbd)$/i;function w(e){let t=null==e?void 0:e.trim();return t&&!v.test(t)?t:void 0}function j(e){var t,r,a,n,s;let l=e.blueprint;if(!l)return{kind:"custom"};let i=null!=(r=l.configuredOptions)?r:{},o=(null!=(a=l.optionAxes)?a:[]).map(e=>{var t;return b(w(null==(t=e.options.find(t=>t.value===i[e.type]))?void 0:t.label),60)}).filter(e=>!!e).slice(0,8),d=null!=l.lowestBulkPriceCents?l.lowestBulkPriceCents/100:null!=(n=null==(t=l.configuredUnitCost)?void 0:t.unitCost)?n:null!=l.priceCents?l.priceCents/100:null;return{kind:l.offerSnapshot?"stock":"catalog",title:b(l.title,200),description:b(l.description,2e3),options:o.length>0?o:void 0,unitCost:b(null!=d?"".concat(d.toFixed(2)," ").concat(null!=(s=l.currency)?s:"USD"):void 0,24),delivery:b(null!=l.deliveryMinDays&&null!=l.deliveryMaxDays?"".concat(l.deliveryMinDays,"-").concat(l.deliveryMaxDays," days"):void 0,40),c
1ountry:b(w(l.providerCountry),60)}}async function y(e,t){let r={prompt:e,tiles:t.map(j)};for(let e=1;e<=2;e++)try{let n=await a.A.post("/api/generate/guide-insights",r);if(n.data.insights.length===t.length)return n.data.insights;console.warn("[guide] insights returned ".concat(n.data.insights.length," cards for ").concat(t.length," tiles (attempt ").concat(e,")"))}catch(t){console.error("[guide] insights fetch failed (attempt ".concat(e,"):"),t)}return console.warn("[guide] insights unavailable, keeping the raw-facts fallback"),null}async function k(e){var t,r;try{return null!=(t=(await a.A.post("/api/guide/answers",e)).data.id)?t:null}catch(e){if(a.A.isAxiosError(e)&&(null==(r=e.response)?void 0:r.status)===400)return null;return console.error("[guide] answers save failed:",e),null}}},42890:(e,t,r)=>{"use strict";r.d(t,{Ay:()=>h,E3:()=>x,Nt:()=>u,yS:()=>f});var a=r(37876),n=r(75961),s=r.n(n),l=r(80196),i=r(8399),o=r(73270),d=r(14232);let c=["Matching supplier specifications...","Updating product characteristics...","Recalculating pricing...","Generating updated descriptions...","Finalizing product details..."],u=["Analyzing product conceptâ¦","Understanding design elementsâ¦","Extracting characteristicsâ¦","Generating additional viewsâ¦","Preparing refinement toolsâ¦","Finalizing product..."],m=[{icon:"verified",headline:"Vetted & certified suppliers",mobileHeadline:"Certified suppliers",description:"Every supplier in our network is verified for quality and reliability."},{icon:"preorder",headline:"Launch with pre-orders",description:"After setup, finance and validate demand with pre-orders before manufacturing."},{icon:"sample",headline:"Order samples before committing",mobileHeadline:"Order samples",description:"Once your product is financed, you may order samples to validate before launch."}],p={sample:l.A,preorder:i.A,verified:o.A};function f(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:500,a=(0,d.useRef)(t);(0,d.useEffect)(()=>{a.current=t},[t]);let n=(0,d.useRef)(!1);(0,d.useEffect)(()=>{if(e<100){n.current=!1;return}let t=()=>{var e;n.current||(n.current=!0,null==(e=a.current)||e.call(a))},s=setTimeout(t,r),l=()=>{"visible"===document.visibilityState&&t()};return document.addEventListener("visibilitychange",l),window.addEventListener("focus",l),window.addEventListener("pageshow",l),()=>{clearTimeout(s),document.removeEventListener("visibilitychange",l),window.removeEventListener("focus",l),window.removeEventListener("pageshow",l)}},[e,r])}function h(e){let{imageUrl:t,progress:r,progressMessages:n=c,title:l,className:i="",onComplete:o,showVideoBackground:u=!0,showImage:h=!0,tipsPosition:x="below",showConfetti:g=!1,tips:b=m,tipIntervalMs:v=28e3}=e,w=Math.min(Math.floor(r/100*n.length),n.length-1),j=r>=100?"complete":r>=99?"overdue":"running",[y,k]=(0,d.useState)(!1);(0,d.useEffect)(()=>{k(!1)},[t]);let[N,_]=(0,d.useState)(0);(0,d.useEffect)(()=>{if(b.length<=1)return;let e=setInterval(()=>{_(e=>(e+1)%b.length)},v);return()=>clearInterval(e)},[b.length,v]),f(r,o);let C=b[N],I=C?p[C.icon]:null,[S]=(0,d.useState)(()=>{if(!g)return[];let e=["#FF6B6B","#FFD93D","#6BCB77","#4D96FF","#FF8FDA","#A66CFF","#FF9F45","#54E346"],t=["circle","rect","triangle"];return Array.from({length:50},(r,a)=>{let n=a<25,s=e[a%e.length],l=t[a%3],i=-Math.PI/2+(n?-.3-.9*Math.random():.3+.9*Math.random()),o=120+200*Math.random();return{color:s,shape:l,size:8+10*Math.random(),xEnd:Math.cos(i)*o,yEnd:Math.sin(i)*o,startX:n?5+5*Math.random():90+5*Math.random(),startY:5+10*Math.random(),delay:.8*Math.random(),duration:1+1.2*Math.random(),rotation:720*Math.random()-360,id:a}})}),A=(0,d.useRef)(null),P=(0,d.useRef)(!1);(0,d.useEffect)(()=>{if(!g)return;let e=setTimeout(()=>{P.current=!0;let e=A.current;e&&e.querySelectorAll("svg").forEach(e=>{let t=()=>{e.style.animationPlayState="paused",e.style.opacity="0",e.removeEventListener("animationiteration",t)};e.addEventListener("animationiteration",t)})},24e3);return()=>clearTimeout(e)},[g]);let[E]=(0,d.useState)(()=>g?S.map(e=>{let t=80+60*Math.random(),r=.3*e.yEnd,a=.6*e.yEnd,n=.85*e.yEnd+.15*t,s=e.yEnd+t;return"\n @keyframes confetti-".concat(e.id," {\n 0% { transform: translate(0,0) rotate(0deg) scale(0); opacity:0; }\n 20% { transform: translate(").concat(.3*e.xEnd,"px,").concat(r,"px) rotate(").concat(.2*e.rotation,"deg) scale(1); opacity:0.9; }\n 40% { transform: translate(").concat(.6*e.xEnd,"px,").concat(a,"px) rotate(").concat(.4*e.rotation,"deg) scale(1); opacity:0.9; }\n 60% { transform: translate(").concat(.85*e.xEnd,"px,").concat(n,"px) rotate(").concat(.7*e.rotation,"deg) scale(0.9); opacity:0.7; }\n 100% { transform: translate(").concat(e.xEnd,"px,").concat(s,"px) rotate(").concat(e.rotation,"deg) scale(0.3); opacity:0; }\n }")}).join("\n"):""),T=C&&I?(0,a.jsxs)("div",{className:"w-full max-w-[480px] flex flex-col items-center gap-3 ".concat("above"===x?"mb-25 mt-25":"mt-2"),children:[g&&(0,a.jsx)("style",{dangerouslySetInnerHTML:{__html:E}}),(0,a.jsxs)("div",{className:"relative w-full rounded-xl bg-white/10 backdrop-blur-sm border border-white/10 px-5 py-4 flex items-start gap-4 animate-in fade-in slide-in-from-bottom-2 duration-500 overflow-visible min-h-[100px]",children:[g&&(0,a.jsx)("div",{ref:A,className:"absolute inset-0 pointer-events-none overflow-visible -z-10","aria-hidden":"true",children:S.map(e=>(0,a.jsxs)("svg",{style:{position:"absolute",pointerEvents:"none",willChange:"transform, opacity",left:"".concat(e.startX,"%"),top:"".concat(e.startY,"%"),opacity:0,animation:"confetti-".concat(e.id," ").concat(e.duration,"s cubic-bezier(0.2, 0.8, 0.3, 1) ").concat(e.delay,"s infinite both")},width:e.size,height:e.size,viewBox:"0 0 ".concat(e.size," ").concat(e.size),fill:e.color,children:["circle"===e.shape&&(0,a.jsx)("circle",{cx:e.size/2,cy:e.size/2,r:e.size/2}),"rect"===e.shape&&(0,a.jsx)("rect",{width:e.size,height:.5*e.size,y:.25*e.size,rx:1}),"triangle"===e.shape&&(0,a.jsx)("polygon",{points:"".concat(e.size/2,",0 ").concat(e.size,",").concat(e.size," 0,").concat(e.size)})]},e.id))}),(0,a.jsx)("div",{className:"mt-0.5 shrink-0 rounded-lg bg-white/15 p-2 z-10",children:(0,a.jsx)(I,{className:"h-5 w-5 text-foreground"})}),(0,a.jsxs)("div",{className:"flex flex-col gap-1 min-w-0 z-10 flex-1",children:[(0,a.jsx)("span",{className:"text-lg font-semibold text-foreground",children:C.mobileHeadline?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"md:hidden",children:C.mobileHeadline}),(0,a.jsx)("span",{className:"hidden md:inline",children:C.headline})]}):C.headline}
1),(0,a.jsx)("span",{className:"text-sm text-foreground/70 leading-snug",children:C.description}),C.action&&(0,a.jsxs)("a",{href:C.action.href,target:"_blank",rel:"noopener noreferrer",className:"mt-2 self-end inline-flex items-center gap-1.5 text-sm font-medium text-foreground underline underline-offset-2 hover:text-foreground/80 transition-colors",children:[C.action.label,(0,a.jsx)("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})]})]})]},N),b.length>1&&(0,a.jsx)("div",{className:"flex gap-1.5",children:b.map((e,t)=>(0,a.jsx)("div",{className:"h-1.5 w-1.5 rounded-full transition-colors duration-300 ".concat(t===N?"bg-foreground":"bg-foreground/30")},t))})]}):null;return(0,a.jsxs)("div",{className:"jsx-45b7b9c8fbe98703 "+"relative w-full h-full rounded-xl ".concat(i),children:[(0,a.jsx)(s(),{id:"45b7b9c8fbe98703",children:"@keyframes progress-stripes{from{background-position:0 0}to{background-position:1rem 0}}.animate-stripes.jsx-45b7b9c8fbe98703{background-image:linear-gradient(45deg,rgba(255,255,255,.15)25%,transparent 25%,transparent 50%,rgba(255,255,255,.15)50%,rgba(255,255,255,.15)75%,transparent 75%,transparent);background-size:1rem 1rem;animation:progress-stripes 1s linear infinite}"}),(0,a.jsx)("div",{className:"jsx-45b7b9c8fbe98703 absolute inset-0 w-full h-full overflow-hidden rounded-xl z-[0]",children:u?(0,a.jsxs)("video",{autoPlay:!0,loop:!0,muted:!0,playsInline:!0,className:"jsx-45b7b9c8fbe98703 w-full h-full object-cover",children:[(0,a.jsx)("source",{src:"/videos/s-2th-transcode.mp4",type:"video/mp4",className:"jsx-45b7b9c8fbe98703"}),(0,a.jsx)("source",{src:"/videos/s-2th-transcode.webm",type:"video/webm",className:"jsx-45b7b9c8fbe98703"})]}):null}),(0,a.jsxs)("div",{className:"jsx-45b7b9c8fbe98703 relative z-10 flex flex-col items-center justify-center w-full h-full py-8 md:py-0 px-4 md:px-0",children:[l&&(0,a.jsx)("h2",{className:"jsx-45b7b9c8fbe98703 text-xl font-semibold text-foreground mb-6",children:l}),h&&(0,a.jsx)("div",{className:"jsx-45b7b9c8fbe98703 relative aspect-square rounded-2xl overflow-hidden shadow-2xl border-4 border-white/20 max-h-96 max-w-96",children:t&&!y?(0,a.jsx)("img",{src:t,alt:"Product",onError:()=>k(!0),className:"jsx-45b7b9c8fbe98703 w-full h-full object-cover"}):(0,a.jsx)("div",{className:"jsx-45b7b9c8fbe98703 w-full h-full bg-secondary/50 flex items-center justify-center",children:(0,a.jsx)("div",{className:"jsx-45b7b9c8fbe98703 w-16 h-16 border-4 border-primary/30 border-t-primary rounded-full animate-spin"})})}),"above"===x&&T,(0,a.jsxs)("div",{className:"jsx-45b7b9c8fbe98703 mt-8 flex flex-col items-center gap-4 w-full max-w-[640px]",children:[(0,a.jsx)("div",{className:"jsx-45b7b9c8fbe98703 w-full h-3 bg-white/20 rounded-full overflow-hidden",children:(0,a.jsx)("div",{style:{width:"".concat(r,"%")},className:"jsx-45b7b9c8fbe98703 "+"h-full bg-primary rounded-full transition-all duration-300 ".concat("running"===j?"":"animate-stripes")})}),(0,a.jsx)("p",{className:"jsx-45b7b9c8fbe98703 text-lg text-foreground font-bold text-center",children:"complete"===j?"Finishing up...":"overdue"===j?"Taking longer than usual. Keep this page open.":n[w]}),"below"===x&&T]})]})]})}function x(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8e4,[t,r]=(0,d.useState)(0),[a,n]=(0,d.useState)(!1),[s,l]=(0,d.useState)(!1),i=(0,d.useRef)(0);(0,d.useEffect)(()=>{let t;return a&&!s?(r(0),i.current=Date.now(),t=setInterval(()=>{r(Math.min((Date.now()-i.current)/e*100,99))},100)):a||s||r(0),()=>{t&&clearInterval(t)}},[a,s,e]),(0,d.useEffect)(()=>{let t=()=>{"visible"===document.visibilityState&&a&&!s&&r(Math.min((Date.now()-i.current)/e*100,99))};return document.addEventListener("visibilitychange",t),window.addEventListener("focus",t),window.addEventListener("pageshow",t),()=>{document.removeEventListener("visibilitychange",t),window.removeEventListener("focus",t),window.removeEventListener("pageshow",t)}},[a,s,e]);let o=(0,d.useCallback)(()=>{l(!1),n(!0)},[]),c=(0,d.useCallback)(()=>{n(!1),l(!1)},[]);return{progress:t,isActive:a,start:o,stop:c,complete:(0,d.useCallback)(()=>{l(!0),n(!1),r(100)},[]),restart:(0,d.useCallback)(()=>{i.current=Date.now(),r(0),l(!1),n(!0)},[])}}},43945:(e,t,r)=>{"use strict";r.d(t,{Rf:()=>
1o,ZZ:()=>i,bq:()=>l});var a=r(37852),n=r(99662),s=r(79435);function l(e){let t=(0,a.Ye)(e);t&&(document.cookie=t)}function i(){var e;let t="".concat(a.OB,"="),r=null==(e=document.cookie.split("; ").find(e=>e.startsWith(t)))?void 0:e.slice(t.length);if(void 0===r)return null;for(let e of(0,a.Wz)())document.cookie=e;return(0,a.BJ)(r)}async function o(e){l(e),(0,n.Cc)(),await (0,s.U)().auth.signOut({scope:"local"}),window.location.assign(a.mE)}},44711:(e,t,r)=>{"use strict";r.d(t,{K:()=>s,n:()=>n});var a=r(38241);let n="Product wording updated. The page design was not changed, so if you also asked for a layout or section change, ask for that on its own.";async function s(e,t,r){r.onProgressEvent({phase:"classify",status:"start",label:"Starting up",receivedAt:Date.now()});try{var n,s;let l=await (0,a.Tx)(e,t.trim(),{onProgress:r.onProgressEvent,...r.onPreview?{onPreview:r.onPreview}:{},...r.onDraft?{onDraft:r.onDraft}:{},...r.onInterrupted?{onInterrupted:r.onInterrupted}:{},...r.fromScratch?{fromScratch:!0}:{},...r.viewedRoute?{viewedRoute:r.viewedRoute}:{},...(null==(n=r.attachmentUrls)?void 0:n.length)?{attachmentUrls:r.attachmentUrls}:{},...r.firstBuildOnly?{firstBuildOnly:r.firstBuildOnly}:{}});if("done"===l.status)return l.copyOnly&&(null==(s=r.onCopyOnly)||s.call(r)),r.onProgressReset(),await r.onDone(),"done";if("notice"===l.status)return r.onNotice(l.message),"notice";return r.onProgressReset(),await r.onError(l.message),"error"}catch(e){return r.onProgressReset(),await r.onError(e instanceof Error?e.message:r.transportErrorMessage),"error"}}},46033:(e,t,r)=>{"use strict";r.d(t,{c:()=>o,y:()=>i});var a=r(37876),n=r(14232),s=r(12217);let l=(0,n.createContext)(null);function i(e){let{pageId:t,children:r}=e,[i,o]=(0,n.useState)(null),[d,c]=(0,n.useState)(!1),u=(0,n.useCallback)(async()=>{if(t){c(!0);try{o(await (0,s.bz)(t))}catch(e){o({total:0,confirmed:0,unique:0})}finally{c(!1)}}},[t]),m=(0,n.useCallback)(async()=>t?(0,s.aX)(t):[],[t]);return(0,n.useEffect)(()=>{u()},[u]),(0,a.jsx)(l.Provider,{value:{waitlist:i,loading:d,refresh:u,fetchWaitlistEntries:m},children:r})}function o(){let e=(0,n.useContext)(l);if(!e)throw Error("useCustomer must be used within a CustomerProvider");return e}},46435:(e,t,r)=>{"use strict";r.d(t,{j:()=>m});var a=r(37876),n=r(10195),s=r(73348),l=r(27737),i=r(49506),o=r(45989),d=r(78231),c=r(80196);let u={serum:!0,lip_gloss:!1,can:!0,can2:!0,bar:!1,gummies:!0,hot_sauce:!1,coffee:!0,supplement:!0,supplement2:!0,strips:!0,shirt:!0},m=[{key:"can2",label:"Lemonade can",tagline:(0,a.jsxs)(a.Fragment,{children:["Summer bestseller \xb7 low minimums",(0,a.jsx)(n.A,{className:"inline h-3 w-3 ml-1 -mt-0.5",color:"green"})]}),prompt:"Y2K style lemon-lime soda can with a cute character on it, for summer vibes",image:"/images/product_examples/can2.webp"},{key:"serum",label:"Vitamin serum",tagline:(0,a.jsxs)(a.Fragment,{children:["High-margin repeat purchase",(0,a.jsx)(s.A,{className:"inline h-3 w-3 ml-0.5 -mt-0.5",color:"Green"})]}),prompt:"Brightening Vitamin Glow Serum for new moms who want a daily glow",image:"/images/product_examples/serum.webp"},{key:"lip_gloss",label:"Lip gloss",tagline:(0,a.jsx)(a.Fragment,{children:"Plumping gloss for Gen Z TikTokers"}),prompt:"Plumping lip gloss for Gen Z TikTokers",image:"/images/product_examples/lip_gloss.webp"},{key:"bar",label:"Protein bar",tagline:(0,a.jsx)(a.Fragment,{children:"High-protein bar for hot yoga days"}),prompt:"High-protein matcha bar for hot yoga instructors",image:"/images/product_examples/bar.webp"},{key:"hot_sauce",label:"Hot sauce",tagline:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l.A,{className:"inline h-3 w-3 mr-1 -mt-0.5"}),"Small-batch heat for taco purists"]}),prompt:"Small-batch fermented hot sauce for taco purists",image:"/images/product_examples/hot_sauce.webp"},{key:"coffee",label:"Coffee",tagline:(0,a.jsxs)(a.Fragment,{children:["Repeat buyers \xb7 high LTV",(0,a.jsx)(i.A,{className:"inline h-3 w-3 ml-1 -mt-0.5",color:"brown"})]}),prompt:"Single-origin coffee with personalized label for morning routine lovers",image:"/images/product_examples/coffee.webp"},{key:"gummies",label:"Energy gummies",tagline:(0,a.jsxs)(a.Fragment,{children:["Cordyceps UP 120% in 2026",(0,a.jsx)(n.A,{className:"inline h-3 w-3 ml-1 -mt-0.5",color:"green"})]}),prompt:"Energy gummies for gen z styled like chromehearts meets supreme",image:"/images/product_examples/gummies.webp"},{key:"can",label:"Energy drink",tagline:(0,a.jsxs)(a.Fragment,{children:["Top-selling category on Dough",(0,a.jsx)(o.A,{className:"inline h-3 w-3 ml-1 -mt-0.5",color:"orange"})]}),prompt:"Energy drink made for graphic designers and illustrators powering through late-night studio sessions. Risograph-inspired label - electric magenta, cyan, and warm yellow ink overlays on cream, anchored by a chunky hand-drawn wordmark.",image:"/images/product_examples/can.webp"},{key:"supplement",label:"Sleep support",tagline:(0,a.jsxs)(a.Fragment,{children:["High margin option",(0,a.jsx)(s.A,{className:"inline h-3 w-3 ml-0.5 -mt-0.5",color:"Green"})]}),prompt:"y2k inspired relaxation gummies",image:"/images/product_examples/gummies2.webp"},{key:"supplement2",label:"NAD supplements",tagline:(0,a.jsxs)(a.Fragment,{children:["Trending on TikTok",(0,a.jsx)(l.A,{className:"inline h-3 w-3 ml-1 -mt-1",color:"red"})]}),prompt:"nad+ supplements styled like ag1",image:"/images/product_examples/supplement.webp"},{key:"strips",label:"Energy strips",tagline:(0,a.jsxs)(a.Fragment,{children:["Low MOQ \xb7 ships worldwide",(0,a.jsx)(d.A,{className:"inline h-3 w-3 ml-1 -mt-0.5",color:"blue"})]}
1),prompt:"Caffeine energy strips inspired by F1 drivers",image:"/images/product_examples/strips.webp"},{key:"shirt",label:"Graphic tee",tagline:(0,a.jsxs)(a.Fragment,{children:["Print-on-demand, zero inventory",(0,a.jsx)(c.A,{className:"inline h-3 w-3 ml-1 -mt-0.5",color:"black"})]}),prompt:"Graphic t-shirt with minimalist design of a panda with black sunglasses and a bamboo shoot, in a modern streetwear style",image:"/images/product_examples/shirt.webp"}].filter(e=>!0===u[e.key])},50089:(e,t,r)=>{"use strict";r.d(t,{fb:()=>u,rA:()=>d,vd:()=>c});var a=r(37876),n=r(14232),s=r(83442),l=r(19360);let i=(0,n.createContext)({brandId:null,brandName:null,productId:null,productName:null,view:null}),o=(0,n.createContext)(()=>{});function d(e){let{productId:t,productName:r,surface:d,ready:c=!0,children:u}=e,{brandId:m,brand:p}=(0,s.PB)(),[f,h]=(0,n.useState)(null),x=(0,n.useMemo)(()=>{var e;return{brandId:m,brandName:null!=(e=null==p?void 0:p.name)?e:null,productId:t,productName:r,view:d?{surface:d,...f?{detail:f}:{}}:null}},[m,null==p?void 0:p.name,t,r,d,f]);return(0,a.jsx)(o.Provider,{value:h,children:(0,a.jsx)(i.Provider,{value:x,children:(0,a.jsx)(l.hF,{scope:{brandId:m,productId:t,view:x.view,ready:c},children:u})})})}function c(){return(0,n.useContext)(i)}function u(e){let t=(0,n.useContext)(o),r=(null==e?void 0:e.trim().slice(0,120))||null;(0,n.useEffect)(()=>(t(r),()=>t(null)),[r,t])}},52820:(e,t,r)=>{"use strict";r.d(t,{A:()=>w});var a=r(37876),n=r(1164),s=r(8399),l=r(73270),i=r(93846),o=r(82529),d=r(81466),c=r(44366),u=r(67262),m=r(14232),p=r(26054),f=r(70316),h=r(34379),x=r(12567),g=r(50862),b=r(51687),v=r(44949);function w(e){let{open:t,onOpenChange:r,onContinue:w,defaultOptionAOpen:j,pageId:y}=e,[k,N]=(0,m.useState)(null!=j?j:window.innerWidth>=768),[_,C]=(0,m.useState)(!1),{subscription:I,loading:S}=(0,g.R)(),A="pro"===I.tier,P=(0,v.j)({tier:I.tier,source:I.source,pastDue:I.pastDue,hasStripeSubscription:I.hasStripeSubscription,loading:S}),[E,T]=(0,m.useState)(!1),[L,D]=(0,m.useState)(!1),[M,R]=(0,m.useState)(null),O=async()=>{R(null),D(!0);try{await (0,p.P)(),T(!0)}catch(e){R(b.O)}finally{D(!1)}};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(x.lG,{open:t,onOpenChange:r,children:(0,a.jsxs)(x.Cf,{className:"sm:max-w-[540px]",children:[(0,a.jsxs)(x.c7,{children:[(0,a.jsx)(x.L3,{className:"text-2xl font-bold",children:"Finance Your Production"}),(0,a.jsx)(x.rr,{children:"You have two ways to fund manufacturing. Pick whichever fits your situation, or combine both."})]}),(0,a.jsxs)("div",{className:"py-2 space-y-4",children:[(0,a.jsxs)("div",{className:"border border-border rounded-xl overflow-hidden",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>N(e=>!e),className:"w-full flex items-center justify-between p-4 hover:bg-secondary/30 transition-colors",children:[(0,a.jsxs)("div",{className:"flex items-start gap-2",children:[(0,a.jsxs)("span",{className:"text-xs font-semibold uppercase tracking-wider text-blue-600 bg-blue-500/10 px-2 py-0.5 rounded-full mt-0.5",children:[(0,a.jsx)("span",{className:"hidden md:inline",children:"Option "}),"A"]}),(0,a.jsxs)("div",{className:"text-left",children:[(0,a.jsx)("h3",{className:"font-semibold text-sm",children:"Let your customers fund it"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"This will also validate demand"})]})]}),(0,a.jsx)(n.A,{className:"w-4 h-4 text-muted-foreground transition-transform ".concat(k?"rotate-180":"")})]}),k&&(0,a.jsxs)("div",{className:"px-4 pb-4 space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("div",{className:"w-8 h-8 rounded-full border-2 border-primary/50 flex items-center justify-center flex-shrink-0",children:(0,a.jsx)(s.A,{className:"w-4 h-4 text-primary"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h4",{className:"font-semibold text-sm",children:"Collect Pre-orders"}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground mt-0.5",children:"Customers pay upfront to reserve your product before it's manufactured. Set realistic goals, discount and deadlines."})]})]}),(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("div",{className:"w-8 h-8 rounded-full border-2 border-primary/50 flex items-center justify-center flex-shrink-0",children:(0,a.jsx)(l.A,{className:"w-4 h-4 text-primary"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h4",{className:"font-semibold text-sm",children:"Funds Held Safely"}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground mt-0.5",children:"All payments are held in escrow until your campaign goal is met."})]})]}),(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("div",{className:"w-8 h-8 rounded-full border-2 border-primary/50 flex items-center justify-center flex-shrink-0",children:(0,a.jsx)(i.A,{className:"w-4 h-4 text-primary"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h4",{className:"font-semibold text-sm",children:"Risk-Free for Customers"}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground mt-0.5",children:"If you don't reach your goal or decide to cancel the project, all customers are refunded automatically."})]})]}
1),(0,a.jsx)("p",{className:"text-[11px] text-muted-foreground/70 italic mt-1 pt-1",children:"* Pre-order revenue covers per-unit production costs. One-time R&D and setup fees are paid separately during the sampling phase."})]})]}),(0,a.jsxs)("div",{className:"border border-border rounded-xl overflow-hidden",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>C(e=>!e),className:"w-full flex items-center justify-between p-4 hover:bg-secondary/30 transition-colors",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)("span",{className:"text-xs font-semibold uppercase tracking-wider text-green-600 bg-green-500/10 px-2 py-0.5 rounded-full",children:[(0,a.jsx)("span",{className:"hidden md:inline",children:"Option "}),"B"]}),(0,a.jsx)("h3",{className:"font-semibold text-sm",children:"Fund it yourself"})]}),(0,a.jsx)(n.A,{className:"w-4 h-4 text-muted-foreground transition-transform ".concat(_?"rotate-180":"")})]}),_&&(0,a.jsxs)("div",{className:"px-4 pb-4 space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("div",{className:"w-8 h-8 rounded-full border-2 border-primary/50 flex items-center justify-center flex-shrink-0",children:(0,a.jsx)(o.A,{className:"w-4 h-4 text-primary"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h4",{className:"font-semibold text-sm",children:"Self-Finance Production"}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground mt-0.5",children:"If you have the budget, you can skip pre-orders and go straight to manufacturing. You cover the production cost upfront and sell once your product is ready."})]})]}),(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("div",{className:"w-8 h-8 rounded-full border-2 border-primary/50 flex items-center justify-center flex-shrink-0",children:(0,a.jsx)(d.A,{className:"w-4 h-4 text-primary"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h4",{className:"font-semibold text-sm",children:"Faster to Market"}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground mt-0.5",children:"No waiting for a campaign to finish. Start production immediately and ship as soon as it's done."})]})]}),(0,a.jsxs)("div",{className:"rounded-lg border border-amber-200 dark:border-amber-800/60 bg-amber-50/70 dark:bg-amber-950/20 p-3",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("div",{className:"w-8 h-8 rounded-full bg-gradient-to-br from-amber-400 to-amber-600 flex items-center justify-center flex-shrink-0 shadow-[0_2px_8px_rgba(245,158,11,0.3)]",children:(0,a.jsx)(c.A,{className:"w-4 h-4 text-white"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h4",{className:"font-semibold text-sm text-amber-900 dark:text-amber-200",children:"Skip the pre-order quota with Pro"}),(0,a.jsx)("p",{className:"text-sm text-amber-900/70 dark:text-amber-200/70 mt-0.5",children:"Pro starts product development when you decide, with no pre-orders required. One product in development at a time."})]})]}),A?(0,a.jsx)("p",{className:"mt-2.5 text-xs font-medium text-amber-800 dark:text-amber-300",children:"Included in your Pro plan."}):P?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(h.$,{onClick:()=>void O(),disabled:L,className:"mt-3 w-full border-0 bg-gradient-to-r from-amber-500 to-amber-600 text-white shadow-[0_6px_20px_rgba(245,158,11,0.3)] transition-all hover:from-amber-600 hover:to-amber-700 disabled:opacity-70",children:[L&&(0,a.jsx)(u.A,{className:"w-4 h-4 mr-2 animate-spin"}),(0,v.k)(P)]}),M&&(0,a.jsx)("p",{className:"mt-1.5 text-xs text-destructive",children:M})]}):null]})]})]}),(0,a.jsxs)("div",{className:"p-3 bg-primary/5 border border-primary/15 rounded-lg text-sm text-muted-foreground",children:[(0,a.jsx)("span",{className:"font-medium text-foreground",children:"You can combine both:"})," self-fund to start production now while running pre-orders to cover costs and gauge demand."]})]}),(0,a.jsx)(x.Es,{children:w?(0,a.jsx)(h.$,{onClick:w,className:"w-full",children:"Continue to Set Goal"}):(0,a.jsx)("div",{className:"w-full",children:(0,a.jsx)(f.Ik,{className:"h-10 w-full justify-center pl-4 text-base",onClick:()=>r(!1),children:"Got it"})})})]})}),E&&(0,a.jsx)(p.z,{open:E,onOpenChange:T,context:"manufacturing",source:"preorder_explainer",pageId:y})]})}},52928:(e,t,r)=>{"use strict";r.d(t,{n:()=>a});let a="data-guide-build-host"},54795:(e,t,r)=>{"use strict";r.d(t,{A:()=>
1o});var a=r(37876),n=r(14232);let s="/videos/s-2th-poster-00001.jpg",l="(prefers-reduced-motion: reduce)";function i(e){let t=window.matchMedia(l);return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}function o(e){let{className:t}=e;return(0,n.useSyncExternalStore)(i,()=>window.matchMedia(l).matches,()=>!1)?(0,a.jsx)("img",{src:s,alt:"","aria-hidden":!0,className:t,draggable:!1}):(0,a.jsxs)("video",{autoPlay:!0,loop:!0,muted:!0,playsInline:!0,preload:"metadata",poster:s,"aria-hidden":!0,className:t,children:[(0,a.jsx)("source",{src:"/videos/s-2th-transcode.webm",type:"video/webm"}),(0,a.jsx)("source",{src:"/videos/s-2th-transcode.mp4",type:"video/mp4"})]})}},59671:(e,t,r)=>{"use strict";r.d(t,{M0:()=>s,dm:()=>n,pp:()=>a,wY:()=>l});let a="flex snap-x snap-mandatory overflow-x-auto scrollbar-hide",n="[--slide-w:clamp(60vw,40dvh,76vw)]",s={scrollbarWidth:"none",msOverflowStyle:"none",WebkitOverflowScrolling:"touch",paddingLeft:"calc((100% - var(--slide-w, 65vw)) / 2)",paddingRight:"calc((100% - var(--slide-w, 65vw)) / 2)",gap:"1rem"},l="snap-center shrink-0 w-[var(--slide-w,65vw)]"},62295:(e,t,r)=>{"use strict";r.d(t,{W:()=>n});var a=r(14232);function n(e){let{active:t,label:r,check:n,onReady:s,onFailed:l,onTimeout:i,pollIntervalMs:o=2e3,maxPollIntervalMs:d=o,minAnimationMs:c=0,maxWaitMs:u=0}=e,m=(0,a.useRef)(n),p=(0,a.useRef)(s),f=(0,a.useRef)(l),h=(0,a.useRef)(i);(0,a.useEffect)(()=>{m.current=n,p.current=s,f.current=l,h.current=i},[n,s,l,i]),(0,a.useEffect)(()=>{if(!t)return;let e=Date.now(),a=null,n=null,s=null,l=null,i=0,x=0,g=!1,b=()=>{g||(g=!0,console.log("[".concat(r,"] ready, completing transition")),p.current())},v=async function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(g)return;if(null!==s){Date.now()>=s&&b();return}if(null!==l&&Date.now()-l<8e3)return;let a=0===i,p=u>0&&Date.now()-e>=u;if(p&&h.current){g=!0,h.current();return}if(!p&&!t&&Date.now()<x)return;let v="waiting";if(!p){i+=1,x=Date.now()+Math.min(o*2**Math.min(i-1,16),d),l=Date.now();try{v=await m.current()}catch(e){console.error("[".concat(r,"] check failed, will retry:"),e);return}finally{l=null}if(g)return}if("failed"===v){var w;g=!0,null==(w=f.current)||w.call(f);return}if("ready"!==v&&!p)return;let j=a?c:0;s=Date.now()+j,0===j?b():n=setTimeout(b,j)},w=()=>{"visible"===document.visibilityState&&v(!0)};return v(),a=setInterval(()=>void v(),o),document.addEventListener("visibilitychange",w),()=>{g=!0,a&&clearInterval(a),n&&clearTimeout(n),document.removeEventListener("visibilitychange",w)}},[t,r,o,d,c,u])}},65711:(e,t,r)=>{"use strict";r.d(t,{$7:()=>n,dx:()=>s});let a="dough:pro-upgraded";function n(){window.dispatchEvent(new CustomEvent(a))}function s(e){return window.addEventListener(a,e),()=>window.removeEventListener(a,e)}},66043:(e,t,r)=>{"use strict";function a(e){if(!e)return"";let t=e;return(t=(t=(t=(t=t.replace(/<br\s*\/?>/gi,"\n")).replace(/<p[^>]*>\s*\.\s*:\s*([\s\S]*?)<\/p>/gi,"<li>$1</li>")).replace(/(^|\n)\s*\.\s*:\s*([^\n<]+)/g,"$1<li>$2</li>")).replace(/(?:<li>[\s\S]*?<\/li>\s*){1,}/g,e=>"<ul>".concat(e,"</ul>"))).replace(/<p[^>]*>\s*<\/p>/gi,"")}r.d(t,{N:()=>a,q:()=>n});let n={ALLOWED_TAGS:["p","br","ul","ol","li","strong","em","b","i","u","a","span"],ALLOWED_ATTR:["href","title","rel","target"]}},66442:(e,t,r)=>{"use strict";r.d(t,{Bu:()=>h,Pj:()=>x,Q0:()=>p,Tj:()=>f,jU:()=>g,mY:()=>v});var a=r(37876),n=r(13499),s=r(88634),l=r(67262),i=r(32851),o=r(86904),d=r(62822),c=r(14232),u=r(38241),m=r(21257);let p="Add this product to",f="It picks up that brand's colors, type and voice.",h="Named and styled from your idea";function x(e){let[t,r]=(0,c.useState)([]),[a,n]=(0,c.useState)("loading"),[s,l]=(0,c.useState)(0),i=!!e;return(0,c.useEffect)(()=>{if(r([]),!i)return void n("ready");let e=!1;return n("loading"),(0,u.fk)().then(t=>{e||(r(t),n("ready"))}).catch(()=>{e||n("error")}),()=>{e=!0}},[i,e,s]),{brands:t,status:a,reload:(0,c.useCallback)(()=>l(e=>e+1),[]),choiceRequired:i&&("ready"!==a||t.length>0)}}function g(e){var t;let{brand:r,className:s}=e,l=null!=(t=r.product_thumbnails[0])?t:r.identity.logoUrl;return l?(0,a.jsx)("img",{src:l,alt:"",className:(0,m.cn)("shrink-0 object-cover ring-1 ring-black/5",s)}):(0,a.jsx)("span",{className:(0,m.cn)("grid shrink-0 place-items-center ring-1 ring-black/5",s),style:{backgroundColor:r.identity.colors.primary},children:(0,a.jsx)(n.A,{className:"h-1/2 w-1/2 text-white/85"})})}let b="flex w-full items-center gap-3 rounded-xl px-3 text-left transition-colors active:bg-accent";function v(e){let{brands:t,status:r,onRetry:n,choice:u,onPick:p}=e,[f,x]=(0,c.useState)(""),v=t.length>8,w=(0,c.useMemo)(()=>{let e=f.trim().toLowerCase();return e?t.filter(t=>t.name.toLowerCase().includes(e)):t},[t,f]);return(0,a.jsxs)(a.Fragment,{children:[v&&(0,a.jsx)("div",{className:"px-5 pb-2",children:(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(s.A,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),(0,a.jsx)("input",{type:"text",value:f,onChange:e=>x(e.target.value),placeholder:"Filter ".concat(t.length," brands"),"aria-label":"Filter your brands by n
1ame",autoComplete:"off","data-vaul-no-drag":!0,className:"h-11 w-full rounded-xl border border-border bg-muted/40 pl-9 pr-3 text-sm outline-none placeholder:text-muted-foreground focus:border-amber-400 focus:bg-background"})]})}),(0,a.jsxs)("div",{className:"min-h-0 flex-1 overflow-y-auto overscroll-contain scrollbar-hide px-2 pb-1",children:["loading"===r&&(0,a.jsxs)("p",{className:"flex items-center gap-2 px-3 py-4 text-sm text-muted-foreground","aria-live":"polite",children:[(0,a.jsx)(l.A,{className:"h-4 w-4 animate-spin"}),"Loading your brands"]}),"error"===r&&(0,a.jsxs)("button",{type:"button",onClick:n,className:(0,m.cn)(b,"py-4 text-sm text-muted-foreground"),children:[(0,a.jsx)(i.A,{className:"h-4 w-4 shrink-0 text-amber-600"}),(0,a.jsx)("span",{className:"flex-1",children:"Your brands didn't load. Tap to try again."})]}),"ready"===r&&w.map(e=>{let t,r=(null==u?void 0:u.kind)==="brand"&&u.brand.brand_id===e.brand_id;return(0,a.jsxs)("button",{type:"button",onClick:()=>p({kind:"brand",brand:e}),"aria-current":r?"true":void 0,className:(0,m.cn)(b,"min-h-[60px] py-2",r&&"bg-amber-50 text-amber-950"),children:[(0,a.jsx)(g,{brand:e,className:"h-11 w-11 rounded-xl"}),(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsx)("span",{className:(0,m.cn)("block truncate text-[15px]",r?"font-semibold":"font-medium"),children:e.name}),(0,a.jsx)("span",{className:(0,m.cn)("block truncate text-[13px]",r?"text-amber-800/80":"text-muted-foreground"),children:0===(t=e.product_count)?"No products yet":1===t?"1 product":"".concat(t," products")})]}),r&&(0,a.jsx)(o.A,{className:"h-5 w-5 shrink-0 text-amber-600"})]},e.brand_id)}),"ready"===r&&0===w.length&&t.length>0&&(0,a.jsx)("p",{className:"px-3 py-6 text-sm text-muted-foreground",children:"No brand goes by that name. Try another, or start a new one below."})]}),(0,a.jsx)("div",{className:"border-t border-border px-2 pb-[max(0.75rem,env(safe-area-inset-bottom))] pt-2",children:(0,a.jsxs)("button",{type:"button",onClick:()=>p({kind:"new"}),className:(0,m.cn)(b,"min-h-[52px] py-2"),children:[(0,a.jsx)("span",{className:"grid h-11 w-11 shrink-0 place-items-center rounded-xl border border-dashed border-foreground
1/25",children:(0,a.jsx)(d.A,{className:"h-5 w-5 text-muted-foreground"})}),(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsx)("span",{className:"block text-[15px] font-medium",children:"New brand"}),(0,a.jsx)("span",{className:"block text-[13px] text-muted-foreground",children:h})]})]})})]})}},66559:(e,t,r)=>{"use strict";r.d(t,{C:()=>c});var a=r(37876),n=r(19323),s=r(32901),l=r(70829),i=r(34379),o=r(12567),d=r(37458);function c(e){var t;let{open:r,onOpenChange:c,category:u="unspecified",onEditPrompt:m}=e,p=null!=(t=d.vy[u])?t:d.vy.unspecified;return(0,a.jsx)(o.lG,{open:r,onOpenChange:c,children:(0,a.jsxs)(o.Cf,{className:"max-w-md p-0 overflow-y-auto border-slate-200/70 dark:border-slate-700/50",children:[(0,a.jsxs)("div",{className:"relative overflow-hidden bg-gradient-to-br from-slate-50 via-slate-100 to-slate-50 dark:from-slate-900/60 dark:via-slate-800/40 dark:to-slate-900/30 p-6 pb-5",children:[(0,a.jsx)("div",{className:"absolute -top-10 -right-10 w-32 h-32 bg-gradient-to-br from-slate-300/40 to-slate-400/20 dark:from-slate-500/20 dark:to-slate-600/10 rounded-full blur-2xl"}),(0,a.jsxs)("div",{className:"relative flex items-start gap-3",children:[(0,a.jsx)("div",{className:"flex-shrink-0 w-11 h-11 rounded-xl bg-gradient-to-br from-slate-500 to-slate-700 dark:from-slate-600 dark:to-slate-800 flex items-center justify-center shadow-lg shadow-slate-500/20",children:(0,a.jsx)(n.A,{className:"h-5 w-5 text-white"})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0 pt-0.5",children:[(0,a.jsx)(o.L3,{className:"text-lg font-semibold text-slate-900 dark:text-slate-100",children:p.title}),(0,a.jsx)(o.rr,{className:"text-slate-600 dark:text-slate-300/80 text-sm mt-1 leading-relaxed",children:p.why})]})]})]}),(0,a.jsxs)("div",{className:"p-6 pt-4 space-y-4",children:[p.fixes.length>0&&(0,a.jsxs)("div",{className:"space-y-2.5",children:[(0,a.jsxs)("p",{className:"flex items-center gap-2 text-sm font-medium text-slate-800 dark:text-slate-200",children:[(0,a.jsx)(s.A,{className:"h-4 w-4 text-slate-500 dark:text-slate-400"}),"What usually works"]}),(0,a.jsx)("ul",{className:"space-y-2 text-sm text-slate-600 dark:text-slate-300/80",children:p.fixes.map(e=>(0,a.jsxs)("li",{className:"flex items-start gap-2.5 leading-relaxed",children:[(0,a.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-slate-400 dark:bg-slate-500 mt-[7px] flex-shrink-0"}),(0,a.jsx)("span",{children:e})]},e))})]}),p.terminal&&(0,a.jsxs)("div",{className:"flex items-start gap-2.5 p-3 rounded-xl bg-slate-100/70 dark:bg-slate-800/40 border border-slate-200 dark:border-slate-700/50",children:[(0,a.jsx)(l.A,{className:"h-4 w-4 text-slate-500 dark:text-slate-400 flex-shrink-0 mt-0.5"}),(0,a.jsxs)("p",{className:"text-sm text-slate-600 dark:text-slate-300/80 leading-relaxed",children:["Reach us at"," ",(0,a.jsx)("a",{href:"mailto:[email protected]?subject=Blocked%20design",className:"font-medium text-slate-800 underline underline-offset-2 dark:text-slate-100",children:"[email protected]"})," ","if you think this was decided wrongly."]})]}),(0,a.jsxs)("div",{className:"flex gap-2 pt-1",children:[!p.terminal&&m&&(0,a.jsx)(i.$,{onClick:()=>{m(),c(!1)},className:"flex-1",children:"Edit my description"}),(0,a.jsx)(i.$,{variant:"outline",onClick:()=>c(!1),className:p.terminal||!m?"w-full":"flex-1 border-slate-300 dark:border-slate-700",children:p.terminal?"Got it":"Close"})]})]})]})})}},68645:(e,t,r)=>{"use strict";r.d(t,{o:()=>i});var a=r(37876),n=r(17963),s=r(21257);let l=[{label:"TikTok",href:"https://www.tiktok.com/@www.dough.do",icon:(0,a.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:[(0,a.jsx)("title",{children:"TikTok"}),(0,a.jsx)("path",{d:"M19.59 6.69a4.83 4.83 0 01-3.77-4.25V2h-3.45v13.67a2.89 2.89 0 01-2.88 2.5 2.89 2.89 0 01-2.89-2.89 2.89 2.89 0 012.89-2.89c.28 0 .54.04.79.1v-3.5a6.37 6.37 0 00-.79-.05A6.34 6.34 0 003.15 15.2a6.34 6.34 0 006.34 6.34 6.34 6.34 0 006.34-6.34V8.73a8.19 8.19 0 004.76 1.52v-3.4a4.85 4.85 0 01-1-.16z"})]})},{label:"Instagram",href:"https://instagram.com/makesdough",icon:(0,a.jsxs)("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,
1children:[(0,a.jsx)("title",{children:"Instagram"}),(0,a.jsx)("rect",{x:"2",y:"2",width:"20",height:"20",rx:"5"}),(0,a.jsx)("circle",{cx:"12",cy:"12",r:"5"}),(0,a.jsx)("circle",{cx:"17.5",cy:"6.5",r:"1.5"})]})},{label:"X",href:"https://x.com/makesdough",icon:(0,a.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:[(0,a.jsx)("title",{children:"X"}),(0,a.jsx)("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})]})},{label:"LinkedIn",href:"https://www.linkedin.com/company/makesdough",icon:(0,a.jsxs)("svg",{width:"17",height:"17",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":!0,children:[(0,a.jsx)("title",{children:"LinkedIn"}),(0,a.jsx)("path",{d:"M20.45 20.45h-3.56v-5.57c0-1.33-.02-3.04-1.85-3.04-1.85 0-2.14 1.45-2.14 2.94v5.67H9.34V9h3.42v1.56h.05c.48-.9 1.64-1.85 3.37-1.85 3.6 0 4.27 2.37 4.27 5.46zM5.34 7.43a2.07 2.07 0 110-4.14 2.07 2.07 0 010 4.14zM7.12 20.45H3.56V9h3.56zM22.22 0H1.77C.79 0 0 .77 0 1.72v20.56C0 23.23.79 24 1.77 24h20.45c.98 0 1.78-.77 1.78-1.72V1.72C24 .77 23.2 0 22.22 0z"})]})}];function i(e){let{page:t="footer",className:r,linkClassName:i}=e;return(0,a.jsx)("div",{className:(0,s.cn)("flex items-center gap-3",r),children:l.map(e=>(0,a.jsx)("a",{href:e.href,target:"_blank",rel:"noopener noreferrer","aria-label":e.label,onClick:()=>(0,n.D)(t,"footer_social_".concat(e.label.toLowerCase())),className:(0,s.cn)("flex h-9 w-9 items-center justify-center rounded-full border border-black/10 text-foreground/50 transition-colors hover:border-[#ff6a3d] hover:text-[#ff6a3d]",i),children:e.icon},e.label))})}},69202:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});var a=r(37876);function n(e){let{data:t}=e;return(0,a.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(t)}})}},71041:(e,t,r)=>{"use strict";r.d(t,{bB:()=>s,fn:()=>l,ie:()=>n});var a=r(51802);let n=a.gM("kind",[a.Ik({kind:a.eu("new"),ownerId:a.Yj().uuid()}),a.Ik({kind:a.eu("existing"),ownerId:a.Yj().uuid(),brandId:a.Yj().uuid(),name:a.Yj().max(120)})]);function s(e,t,r){if(!e||e.ownerId!==t)return null;if("new"===e.kind)return e;let a=r.find(t=>t.brand_id===e.brandId);return a?{...e,name:a.name}:null}function l(e){return(null==e?void 0:e.kind)==="existing"?e.brandId:void 0}},72468:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var a=r(37876),n=r(38585),s=r(14232),l=r(10628),i=r(43945);function o(e){let{className:t,label:r="Switch account"}=e,[o,d]=(0,s.useState)(!1),c=async()=>{d(!0);try{let{pathname:e,search:t,hash:r}=window.location;await (0,i.Rf)("".concat(e).concat(t).concat(r))}catch(e){d(!1),(0,l.oR)({title:"Could not sign you out. Check your internet and try again.",variant:"destructive"})}};return(0,a.jsxs)("button",{type:"button",className:t,onClick:()=>void c(),disabled:o,children:[(0,a.jsx)(n.A,{className:"w-3.5 h-3.5","aria-hidden":!0}),o?"Signing out":r]})}},75960:(e,t,r)=>{"use strict";r.r(t),r.d(t,{__N_SSP:()=>ns,default:()=>nl});var a=r(37876),n=r(91040),s=r(37255),l=r(12121),i=r(52621),o=r(18847),d=r.n(o),c=r(77328),u=r.n(c),m=r(54587),p=r.n(m),f=r(89099),h=r(14232),x=r(60545),g=r(78082),b=r(50089),v=r(72468),w=r(34379);function j(e){let{title:t,email:r,onHome:n}=e;return(0,a.jsx)("div",{className:"flex items-center justify-center min-h-screen bg-white p-6",children:(0,a.jsxs)("div",{className:"max-w-sm rounded-2xl border border-dashed border-border bg-background p-8 text-center",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold text-foreground",children:t}),(0,a.jsxs)("p",{className:"mt-2 text-sm text-muted-foreground",children:["You're signed in as ",(0,a.jsx)("span",{className:"font-medium text-foreground break-all",children:null!=r?r:"another account"}),". Sign in with the account that created it and this page opens again."]}),(0,a.jsxs)("div",{className:"mt-4 flex items-center justify-center gap-3",children:[(0,a.jsx)(v.A,{className:(0,w.r)()}),(0,a.jsx)(w.$,{variant:"ghost",onClick:n,children:"Go to my stores"})]})]})})}var y=r(83442),k=r(46033),N=r(31083),_=r(94305),C=r(44263),I=r(41207),S=r(62295),A=r(89068),P=r(44711),E=r(51802),T=r(81645),L=r(82909).hp;let D={headline:120,subhead:240,bullet:120,bullets:5,gallery:8,alt:160,specLabel:40,specValue:600,specs:10,faqQuestion:160,faqAnswer:400,faq:8,longform:1200,comparisonRows:8,comparisonFeature:80,comparisonCell:160,comparisonAgainst:80,statNumber:40,statText:240,seoT
1itle:70,seoDescription:160},M=E.Ik({url:E.Yj().url(),alt:E.Yj().max(D.alt)}),R=E.RZ(()=>E.KC([E.Yj(),E.ai(),E.zM(),E.ch(),E.YO(R),E.g1(E.Yj(),R)])),O=E.Ik({headline:E.Yj().min(1).max(D.headline),subhead:E.Yj().max(D.subhead),bullets:E.YO(E.Yj().min(1).max(D.bullet)).max(D.bullets),gallery:E.YO(M).max(D.gallery),specs:E.YO(E.Ik({label:E.Yj().min(1).max(D.specLabel),value:E.Yj().min(1).max(D.specValue)})).max(D.specs),faq:E.YO(E.Ik({q:E.Yj().min(1).max(D.faqQuestion),a:E.Yj().min(1).max(D.faqAnswer)})).max(D.faq),longform:E.Yj().max(D.longform),comparison:E.YO(E.Ik({feature:E.Yj().min(1).max(D.comparisonFeature),us:E.Yj().min(1).max(D.comparisonCell),them:E.Yj().min(1).max(D.comparisonCell)})).max(D.comparisonRows).optional(),comparisonAgainst:E.Yj().max(D.comparisonAgainst).optional(),stat:E.Ik({number:E.Yj().min(1).max(D.statNumber),text:E.Yj().max(D.statText)}).optional(),seo:E.Ik({title:E.Yj().min(1).max(D.seoTitle),description:E.Yj().min(1).max(D.seoDescription)}),extras:E.g1(E.Yj().regex(/^[a-zA-Z][a-zA-Z0-9_]{0,39}
1$/,"Extras keys must be alphanumeric with no dots"),R).default({}),pinned:E.YO(E.Yj().max(40)).max(12).optional()}).superRefine((e,t)=>{var r;let a=L.byteLength(JSON.stringify(null!=(r=e.extras)?r:{}),"utf8");a>4e3&&t.addIssue({code:T.eq.custom,path:["extras"],message:"extras is ".concat(a," bytes, over the ").concat(4e3," cap")})});function F(e,t){let r=null==e?void 0:e.trim();return r?function(e,t){let r=e.trim();if(r.length<=t)return r;let a=Math.max(1,t-1),n=r.slice(0,a),s=n.lastIndexOf(" "),l=s>Math.floor(.5*a)?n.slice(0,s):n;return"".concat(l.replace(/[\s,;:.\-([{/]+$/,""),"â¦")}(r,t):""}E.Ik({current:E.ai().int().min(1),content:E.g1(E.Yj().regex(/^[1-9]\d*$/,"Version keys are positive integers"),O)});var q=r(32744),U=r(54477);async function z(e){let t=AbortSignal.timeout(8e3),r=await fetch("/api/page/".concat(e,"/chat-status?statusOnly=1"),{signal:t});if(!r.ok)throw Error("chat status ".concat(r.status));let a=await r.json(),n=(0,q.mT)(a.agentStatuses,a.hasOngoingActions);if("failed"===n)return"failed";if("ready"!==n)return"waiting";let s=await fetch("/api/page/".concat(e,"?website=draft&t=").concat(Date.now()),{signal:t});if(!s.ok)throw Error("page ".concat(s.status));let l=await s.json(),{missing:i}=function(e,t){var r;let a=function(e,t){var r,a,n,s,l,i,o,d,c,u,m,p;let f=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},h=F(f.productName,D.headline)||F(e.productName,D.headline)||F(e.brandName,D.headline)||"Product",x=null!=(n=null==(r=e.brandName)?void 0:r.trim())?n:"",g=function(e){let t=[e.valueProposition,e.description,e.benefits||e.about].map(e=>{var t;return null!=(t=null==e?void 0:e.trim())?t:""}).filter(Boolean),r=t.length>0&&t[0].length<=D.subhead;return{subhead:r?t[0]:"",longform:F(t.slice(+!!r).join(" "),D.longform)}}(e),b=(null!=(i=null==(l=e.comparisonTable)?void 0:l.rows)?i:[]).map(e=>({feature:F(e.feature,D.comparisonFeature),us:F(e.us,D.comparisonCell),them:F(e.them,D.comparisonCell)})).filter(e=>e.feature&&e.us&&e.them).slice(0,D.comparisonRows),v=function(e){var t,r;let a=F(null==(t=e.supportingStatistic)?void 0:t.number,D.statNumber);return a?{number:a,text:F(null==(r=e.supportingStatistic)?void 0:r.text,D.statText)}:void 0}(e);return O.parse({headline:h,subhead:g.subhead,bullets:(null!=(s=e.featureHighlights)?s:[]).map(e=>F(e.attribute,D.bullet)).filter(Boolean).slice(0,D.bullets),gallery:t.slice(0,D.gallery).map(e=>({url:e.url,alt:F(e.alt,D.alt)||F(h,D.alt)})),specs:[["Size",e.unitSize],[null==(o=e.keyValueProps)?void 0:o.prop1.title,null==(d=e.keyValueProps)?void 0:d.prop1.description],[null==(c=e.keyValueProps)?void 0:c.prop2.title,null==(u=e.keyValueProps)?void 0:u.prop2.description],[null==(m=e.keyValueProps)?void 0:m.prop3.title,null==(p=e.keyValueProps)?void 0:p.prop3.description],[e.ingredientsSectionLabel||"Ingredients",e.ingredients],[e.directionsSectionLabel||"Directions for use",e.directions]].map(e=>{let[t,r]=e;return{label:F(t,D.specLabel),value:F(r,D.specValue)}}).filter(e=>e.label&&e.value).slice(0,D.specs),faq:function(e){let t=e.faqs;return t?[t.faq1,t.faq2,t.faq3].map(e=>({q:F(null==e?void 0:e.question,D.faqQuestion),a:F(null==e?void 0:e.answer,D.faqAnswer)})).filter(e=>e.q&&e.a).slice(0,D.faq):[]}(e),longform:g.longform,comparison:b,comparisonAgainst:b.length?F(null==(a=e.comparisonTable)?void 0:a.competitorName,D.comparisonAgainst):"",...v?{stat:v}:{},seo:{title:F(x?"".concat(h," | ").concat(x):h,D.seoTitle)||h,description:F(e.description,D.seoDescription)||F(e.valueProposition,D.seoDescription)||h},extras:{}})}(e,t),n=[];return(null==(r=e.productName)?void 0:r.trim())||n.push("name"),a.subhead||a.longform||n.push("prose"),a.bullets.length||n.push("bullets"),a.specs.length||n.push("specs"),a.gallery.some(e=>e.url.trim())||n.push("image"),{ready:0===n.length,missing:n}}((0,U.Ou)(l).content,[]);return i.some(e=>"image"!==e)?"waiting":"ready"}var W=r(85702);function Y(e){let{pageId:t,brandId:r,enabled:a}=e,{flagState:n,loading:s}=(0,I._P)(W.Wg.FreestyleDefaultWebsite),l=(0,_.U)(),i=(0,y.PB)(),{reload:o}=(0,y.AL)(),d=(0,h.useRef)(null),c=(0,h.useRef)(null),[u,m]=(0,h.useState)(null),p=u===t,f=a&&!s&&!!n&&!!t&&!!r,x=(0,y.dF)(f&&i.brandId!==r?r:null,"prewarm"),{brandId:g,
1storePageVersion:b,status:v}=i.brandId===r?i:x.value,w=r?null==l?void 0:l.preparationFor(r):null,j=!!r&&(d.current===r||(null==l?void 0:l.startedAt(r))!=null||(null==l?void 0:l.outcomeFor(r))!=null),k=g===r&&"ready"===v&&null!=b,N=null==l?void 0:l.setPreparation,E=(0,h.useCallback)(async()=>t?z(t):"waiting",[t]);(0,h.useEffect)(()=>{f&&r&&!j&&(k?null==N||N(r,null):w||null==N||N(r,"waiting"))},[f,r,j,k,w,N]),(0,h.useEffect)(()=>{if(f&&r)return()=>null==N?void 0:N(r,null)},[f,r,N]),(0,C.Q)(W.Wg.FreestyleDefaultWebsite,a&&!!t&&!!r,"make_prewarm");let T=f&&!p&&!j&&!k&&"paused"!==w;(0,h.useEffect)(()=>{T&&null===c.current&&(c.current=Date.now())},[T]);let L=()=>null===c.current?void 0:Date.now()-c.current;return(0,S.W)({active:T,label:"Freestyle Prewarm Content Gate",check:E,onReady:()=>{(0,A.X)(t,"freestyle_flow_prewarm_gate_ready",L()),m(t)},onFailed:()=>{(0,A.X)(t,"freestyle_flow_prewarm_gate_paused",L()),r&&(null==N||N(r,"paused"))},onTimeout:()=>{(0,A.X)(t,"freestyle_flow_prewarm_gate_paused",L()),r&&(null==N||N(r,"paused"))},pollIntervalMs:3e3,maxPollIntervalMs:3e3,maxWaitMs:24e4}),(0,h.useEffect)(()=>{if(!f||!t||!r||!l||!p||g!==r||"ready"!==v||j||null!=b)return;d.current=r,l.begin(r);let e=Date.now(),a=()=>Date.now()-e;(0,A.X)(t,(0,A.T)("started","prewarm")),(0,P.K)(r,"",{firstBuildOnly:{pageId:t},onDraft:e=>l.setDraft(r,e),onProgressEvent:e=>l.appendEvent(r,e),onProgressReset:()=>l.resetProgress(r),onDone:()=>{x.actions.reload(),o()},onNotice:e=>l.setNotice(r,e),onError:e=>console.warn("[freestyle prewarm] storefront build failed:",e),onInterrupted:()=>(0,A.X)(t,(0,A.T)("interrupted","prewarm"),a()),transportErrorMessage:"Connection issue. Check your internet and try again."}).then(e=>{(0,A.X)(t,(0,A.T)("done"===e?"done":"notice"===e?"notice":"failed","prewarm"),a()),l.end(r,"done"===e?"done":"error")}).catch(()=>{(0,A.X)(t,(0,A.T)("failed","prewarm"),a()),l.end(r,"error")})},[f,p,t,r,l,g,v,b,o,j,x.actions]),null}var B=r(45393),G=r(75961),V=r.n(G),$=r(79708),H=r(17958),J=r(73348),K=r(74052),Q=r(9858),Z=r(77489),X=r(81466),ee=r(2706),et=r(79317),er=r(46039),ea=r(78080),en=r(47716),es=r(27909),el=r(1164),ei=r(50859),eo=r(99777),ed=r(80196),ec=r(85009),eu=r(87753),em=r(67262),ep=r(59671),ef=r(47137),eh=r(21257);let ex=(0,ef.F)("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function eg(e){let{className:t,variant:r,...n}=e;return(0,a.jsx)("div",{"data-slot":"alert",role:"alert",className:(0,eh.cn)(ex({variant:r}),t),...n})}function eb(e){let{className:t,...r}=e;return(0,a.jsx)("div",{"data-slot":"alert-description",className:(0,eh.cn)("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",t),...r})}var ev=r(70316),ew=r(12567),ej=r(94678),ey=r(26532),ek=r(50862),eN=r(73005);function e_(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e3,a=(0,h.useRef)(t);(0,h.useEffect)(()=>{a.current=t},[t]),(0,h.useEffect)(()=>{if(!e)return;let t=Date.now(),n="visible"===document.visibilityState?null:Date.now(),s=()=>{let e=Date.now(),s=e-t;if(t=e,"visible"!==document.visibilityState){null!=n||(n=e);return}let l=null===n?0:e-n;n=null;let i=function(e){let{hiddenMs:t,tickGapMs:r,heartbeatMs:a=5e3}=e;return Math.max(t,Math.max(r-2*a,0))}({hiddenMs:l,tickGapMs:s,heartbeatMs:r});i>0&&a.current(i)},l=setInterval(s,r);return document.addEventListener("visibilitychange",s),window.addEventListener("focus",s),window.addEventListener("pageshow",s),()=>{clearInterval(l),document.removeEventListener("visibilitychange",s),window.removeEventListener("focus",s),window.removeEventListener("pageshow",s)}},[e,r])}let eC="dough_guide_nudge_seen";var eI=r(88887),eS=r(94795),eA=r(37458),eP=r(38693),eE=r(17963);function eT(e){(0,eE.D)("imagine",e)}function eL(e){let t=Math.min(3,Math.max(0,Math.round(e)));return"imagine_generate_succeeded_cat".concat(t)}let eD="dough_imagine_segment";function eM(e){var t;let r="".concat(null!=(t=(0,eE.g)())?t:"",":").concat(e);try{if(window.sessionStorage.getItem(eD)===r)return;window.sessionStorage.setItem(eD,r)}catch(e){}eT("imagine_visitor_".concat(e))}var eR=r(52928);let eO="dough_guide_chat_composer_v2",eF={1:"composer",0:"hero"},eq={composer:"1",hero:"0"};var eU=r(16247),ez=r(20006),eW=r(97478),eY=r(29991);let eB=["in_network","stock"];function eG(e){return e?"stock"===function(e){if(!e||"object"!=typeof e)return"in_network";let t=e.sourcingLane;return"string"==typeof t&&eB.includes(t)?t:"in_network"}(e)?"stock":"in_network":"custom"}function eV(e){return{catalogOnly:!0,catalogStapleFallback:!0,catalogDesignSource:null==e?void 0:e.designSource}}let e$=new Set(["ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_CANCELED","E
1RR_BAD_RESPONSE_TIMEOUT"]);var eH=r(79435);let eJ="dough.imagine.pendingConfirm",eK=E.Ik({v:E.eu(1),userId:E.Yj().min(1),request:E.Ik({prompt:E.Yj(),selectedImageUrl:E.Yj().min(1),clientRequestId:E.Yj().uuid(),referenceRequestId:E.Yj().uuid().nullable(),confirmedAt:E.ai().finite()}).passthrough()}),eQ=null;function eZ(e,t){eQ=t.clientRequestId;try{window.sessionStorage.setItem(eJ,JSON.stringify({v:1,userId:e,request:t}))}catch(e){}}function eX(e){eQ===e&&(eQ=null);try{let t=e0();t&&t.request.clientRequestId!==e||window.sessionStorage.removeItem(eJ)}catch(e){}}function e0(){let e=null;try{e=window.sessionStorage.getItem(eJ)}catch(e){return null}if(!e)return null;try{let t=eK.safeParse(JSON.parse(e));if(!t.success)return window.sessionStorage.removeItem(eJ),null;return{userId:t.data.userId,request:t.data.request}}catch(e){return null}}async function e1(e){var t,r,a;let{referenceRequestId:n,confirmedAt:s}=e;if(!n)return null;let l=(0,eH.U)(),{data:i}=await l.auth.getSession(),o=null==(t=i.session)?void 0:t.user.id;if(!o)return null;let d=new AbortController,c=setTimeout(()=>d.abort(),8e3),{data:u,error:m}=await l.from("pages").select("page_id").eq("owner_id",o).eq("reference_request_id",n).gte("created_on",new Date(s-12e4).toISOString()).is("deleted_at",null).order("created_on",{ascending:!1}).limit(1).abortSignal(d.signal).then(e=>(clearTimeout(c),e));if(m)throw function(e,t,r){let a=[r.message,r.details,r.hint].filter(Boolean).join(" | "),n=r.code?" [".concat(r.code,"]"):"";return Error("[".concat(e,"] ").concat(t).concat(n,": ").concat(a||"no message from PostgREST"),{cause:r})}("imagine/pending-confirm","find draft page for confirm",m);return null!=(a=null==u||null==(r=u[0])?void 0:r.page_id)?a:null}var e2=r(74006),e5=r(47025),e4=r(27358),e3=r(92945),e7=r(9928),e6=r(70850);function e8(e){let{hasUser:t,subscriptionLoading:r,isSubscribed:a,optionAxes:n,supplierName:s}=e;return t&&!r&&a&&!!(null==n?void 0:n.length)&&"diy_beverages"===(0,e6.yk)(s)}function e9(e){return e.filter(e=>{let t=e.type.trim().toLowerCase();return("size"===t||"sizes"===t)&&e.options.some(e=>!e.disabled)})}var te=r(87641),tt=r(30713),tr=r(97066),ta=r(91102);ta.Cp;var tn=r(24157),ts=r(62822),tl=r(13499),ti=r(32851),to=r(67716),td=r(12948),tc=r(202),tu=r(66442);function tm(e){let{brands:t,status:r,onRetry:n,choiceRequired:s,choice:l,onChoiceChange:i,onSubmit:o,promptFilled:d,isGenerating:c,disabled:u,menuOpen:m,onMenuOpenChange:p}=e,f=(0,tc.a)(),h=e=>p(e),x=e=>(0,eh.cn)("h-9 md:h-10 bg-gradient-to-r from-amber-500 to-amber-600 hover:from-amber-600 hover:to-amber-700 shadow-[0_6px_20px_rgba(245,158,11,0.3)] rounded-full gap-0 cursor-pointer flex items-center justify-center transition-all duration-300 disabled:opacity-60 disabled:cursor-not-allowed",d?"px-3.5 md:px-4":"w-9 md:w-10 px-0",e),g=(e,t)=>(0,a.jsx)("span",{className:(0,eh.cn)("overflow-hidden transition-all duration-300 whitespace-nowrap text-white text-xs md:text-sm font-medium",d?"".concat(t," mr-1.5 md:mr-2"):"max-w-0 mr-0"),children:e}),b=e=>{h(!1),i(e),d&&!u&&o(e)},v=e=>(null==l?void 0:l.kind)==="brand"&&l.brand.brand_id===e.brand_id,j="h-7 w-7 shrink-0 rounded-[7px] shadow-[0_1px_3px_rgba(0,0,0,0.22)]",y=(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsx)("span",{className:"block truncate",children:"New brand"}),(0,a.jsx)("span",{className:"block truncate text-[11px] font-normal text-muted-foreground",children:tu.Bu})]}),(0,a.jsx)("span",{className:(0,eh.cn)(j,"grid place-items-center border border-dashed border-foreground
1/25 shadow-none"),children:(0,a.jsx)(ts.A,{className:"h-3.5 w-3.5 text-muted-foreground"})})]}),k=t.length>7,N=(0,a.jsxs)(td.SQ,{align:"end",className:"w-72 overflow-hidden p-0",children:[(0,a.jsxs)("div",{className:"border-b border-border px-3 py-2.5",children:[(0,a.jsx)("p",{className:"text-[13px] font-medium leading-tight text-foreground",children:tu.Q0}),(0,a.jsx)("p",{className:"mt-0.5 text-[12px] leading-snug text-muted-foreground",children:tu.Tj})]}),(0,a.jsx)("div",{className:"border-b border-border p-1",children:(0,a.jsx)(td._2,{onSelect:()=>b({kind:"new"}),className:"gap-3 py-1 cursor-pointer",children:y})}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("div",{className:"max-h-64 overflow-y-auto overscroll-contain scrollbar-hide p-1",children:t.map(e=>(0,a.jsx)(td._2,{onSelect:()=>b({kind:"brand",brand:e}),className:(0,eh.cn)("gap-3 py-1 cursor-pointer",v(e)&&"".concat("bg-amber-50 text-amber-950"," focus:bg-amber-100")),children:((e,t)=>{let r=e.product_thumbnails.slice(0,3),n=3===r.length?e.product_count-3:0;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:(0,eh.cn)("flex-1 truncate",t&&"font-medium"),children:e.name}),(0,a.jsxs)("span",{className:"flex shrink-0 gap-1",children:[r.map((e,t)=>(0,a.jsxs)("span",{className:(0,eh.cn)(j,"relative overflow-hidden"),children:[(0,a.jsx)("img",{src:e,alt:"",className:"h-full w-full object-cover"}),n>0&&t===r.length-1&&(0,a.jsxs)("span",{className:"absolute inset-0 grid place-items-center bg-black/55 text-[11px] font-semibold text-white tabular-nums",children:["+",n]})]},e)),0===r.length&&(0,a.jsx)("span",{className:(0,eh.cn)(j,"grid place-items-center bg-muted shadow-none"),children:(0,a.jsx)(tl.A,{className:"h-3.5 w-3.5 text-muted-foreground"})})]})]})})(e,v(e))},e.brand_id))}),k&&(0,a.jsx)("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 h-8 bg-gradient-to-t from-popover to-transparent"})]})]}),_=(0,a.jsx)(to._s,{open:m,onOpenChange:h,children:(0,a.jsxs)(to.zj,{className:"max-h-[85vh] rounded-t-3xl",children:[(0,a.jsxs)("div",{className:"px-5 pb-3 pt-1",children:[(0,a.jsx)(to.gk,{className:"text-[17px]",children:tu.Q0}),(0,a.jsx)(to.I6,{className:"text-[13px]",children:tu.Tj})]}),(0,a.jsx)(tu.mY,{brands:t,status:r,onRetry:n,choice:l,onPick:b})]})});if(c)return(0,a.jsx)(w.$,{type:"button",disabled:!0,className:x(),"aria-label":"Generating reference images",children:(0,a.jsx)(K.A,{size:18,className:"text-white animate-spin"})});let C=s&&null===l,I=null===l?null:"new"===l.kind?"New brand":l.brand.name;if(!d){if(!C&&null===l)return(0,a.jsx)(w.$,{type:"button",disabled:!0,className:x(),"aria-label":"Write a product idea first",children:(0,a.jsx)(es.A,{size:18,strokeWidth:2.5,className:"text-white flex-shrink-0"})});let e=e=>(0,a.jsxs)(w.$,{type:"button",variant:"outline",className:"h-9 md:h-10 max-w-[11rem] md:max-w-[14rem] gap-1.5 rounded-full border-border bg-background/70 px-3 text-xs md:text-sm font-medium text-foreground/80 shadow-none hover:bg-accent hover:text-foreground cursor-pointer","aria-label":I?"Brand: ".concat(I,". Change it"):"Choose a brand for this product",...e,children:[(null==l?void 0:l.kind)==="brand"&&(0,a.jsx)(tu.jU,{brand:l.brand,className:"h-4 w-4 rounded-[5px]"}),(0,a.jsx)("span",{className:"truncate",children:null!=I?I:"Choose a brand"}),(0,a.jsx)(el.A,{size:15,className:"shrink-0 opacity-60"})]});return f?(0,a.jsxs)(a.Fragment,{children:[e({onClick:()=>h(!0)}),_]}):(0,a.jsxs)(td.rI,{open:m,onOpenChange:h,modal:!1,children:[(0,a.jsx)(td.ty,{asChild:!0,children:e({})}),N]})}if(C&&"loading"===r)return(0,a.jsxs)(w.$,{type:"button",disabled:!0,className:x(),"aria-live":"polite","aria-label":"Checking your brands",children:[g("Checking your brands","max-w-[9rem]"),(0,a.jsx)(em.A,{size:18,className:"text-white animate-spin flex-shrink-0"})]});if(C&&"error"===r)return(0,a.jsxs)(w.$,{type:"button",onClick:n,className:x(),"aria-label":"Retry loading your brands",children:[g("Couldn't load brands. Retry","max-w-[11rem]"),(0,a.jsx)(ti.A,{size:18,className:"text-white flex-shrink-0"})]});if(!C&&null===l)return(0,a.jsxs)(w.$,{type:"button",onClick:()=>o(null),disabled:u,className:x(),"aria-label":"Generate reference images",children:[g("Create","max-w-[4rem]"),(0,a.jsx)(es.A,{size:18,strokeWidth:2.5,className:"text-white flex-shrink-0"})]});
1if(null!==l){let e="new"===l.kind?"a new brand":l.brand.name,t=(0,a.jsxs)(w.$,{type:"button",onClick:()=>o(l),disabled:u,className:x("rounded-r-none pr-2.5 md:pr-3"),"aria-label":"Generate reference images in ".concat(e),children:[(0,a.jsx)("span",{className:"overflow-hidden transition-all duration-300 whitespace-nowrap text-white text-xs md:text-sm font-medium max-w-[8rem] md:max-w-[12rem] mr-1.5 md:mr-2",children:(0,a.jsxs)("span",{className:"block truncate",children:["Create in ",e]})}),(0,a.jsx)(es.A,{size:18,strokeWidth:2.5,className:"text-white flex-shrink-0"})]}),r=e=>(0,a.jsx)(w.$,{type:"button",disabled:u,className:(0,eh.cn)(x(),"w-8 md:w-9 px-0 rounded-l-none border-l border-white/25 shadow-none"),"aria-label":"Change brand",...e,children:(0,a.jsx)(el.A,{size:16,className:"text-white flex-shrink-0"})});return f?(0,a.jsxs)("div",{className:"flex items-center",children:[t,r({onClick:()=>h(!0)}),_]}):(0,a.jsxs)(td.rI,{open:m,onOpenChange:h,modal:!1,children:[(0,a.jsxs)("div",{className:"flex items-center",children:[t,(0,a.jsx)(td.ty,{asChild:!0,children:r({})})]}),N]})}let S=e=>(0,a.jsxs)(w.$,{type:"button",disabled:u,className:x(),"aria-label":"Choose a brand for this product",...e,children:[g("Choose a brand","max-w-[7rem]"),(0,a.jsx)(el.A,{size:18,strokeWidth:2.5,className:"text-white flex-shrink-0"})]});return f?(0,a.jsxs)(a.Fragment,{children:[S({onClick:()=>h(!0)}),_]}):(0,a.jsxs)(td.rI,{open:m,onOpenChange:h,modal:!1,children:[(0,a.jsx)(td.ty,{asChild:!0,children:S({})}),N]})}var tp=r(12227),tf=r(66692),th=r(96852),tx=r(66043);let tg=new Map;function tb(e){var t;let{productId:r,open:s,fallbackCategory:l}=e,[i,o]=(0,h.useState)(null),[d,c]=(0,h.useState)(!1),[u,m]=(0,h.useState)(null),[p,f]=(0,h.useState)(!1);(0,h.useEffect)(()=>{s&&f(!1)},[s,r]),(0,h.useEffect)(()=>{if(!s||!r)return;let e=tg.get(r);if(e){o(e),m(null),c(!1);return}let t=!1;return c(!0),m(null),o(null),n.A.get("/api/catalog/product/".concat(r)).then(e=>{t||(tg.set(r,e.data),o(e.data))}).catch(e=>{var r,a;t||(console.error("Failed to load catalog product:",e),m((null==e||null==(a=e.response)||null==(r=a.data)?void 0:r.message)||"Failed to load product details."))}).finally(()=>{t||c(!1)}),()=>{t=!0}},[s,r]);let x=null!=(t=null==i?void 0:i.product)?t:null,g=(null==x?void 0:x.category)||l||null,b=(0,h.useMemo)(()=>(null==x?void 0:x.description)?tp.A.sanitize((0,tx.N)(x.description),tx.q):"",[null==x?void 0:x.description]),{descriptionPreview:v,descriptionTruncated:w}=(0,h.useMemo)(()=>{if(!b)return{descriptionPreview:"",descriptionTruncated:!1};let e=document.createElement("div");e.innerHTML=b;let t=(e.textContent||"").replace(/\s+/g," ").trim();if(!t)return{descriptionPreview:"",descriptionTruncated:!1};let r=t.split(RegExp("(?<=[.!?])\\s+"));return r.length<=2?{descriptionPreview:t,descriptionTruncated:!1}:{descriptionPreview:r.slice(0,2).join(" "),descriptionTruncated:!0}},[b]);return r?(0,a.jsxs)("section",{children:[(0,a.jsx)("h4",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Characteristics"}),d&&!x?(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,a.jsx)(em.A,{className:"h-4 w-4 animate-spin"}),"Loading product detailsâ¦"]}):u?(0,a.jsx)("p",{className:"text-sm text-destructive",children:u}):(0,a.jsxs)("div",{className:"space-y-2 text-sm",children:[b&&(p||!w?(0,a.jsx)("div",{className:"leading-relaxed text-foreground/90 [&_a]:text-primary [&_a]:underline [&_br]:block [&_em]:italic [&_li]:my-0.5 [&_ol]:list-decimal [&_ol]:pl-5 [&_p]:mb-2 [&_p:last-child]:mb-0 [&_strong]:font-semibold [&_ul]:list-disc [&_ul]:pl-5",dangerouslySetInnerHTML:{__html:b}}):(0,a.jsx)("p",{className:"leading-relaxed text-foreground/90",children:v})),w&&(0,a.jsx)("button",{type:"button",onClick:()=>f(e=>!e),className:"cursor-pointer text-xs font-medium text-primary hover:underline",children:p?"Show less":"Show more"}),(g||(null==x?void 0:x.subcategory))&&(0,a.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[g&&(0,a.jsxs)(th.E,{variant:"secondary",className:"gap-1",children:[(0,a.jsx)(tf.A,{className:"h-3 w-3"}),g]}),(null==x?void 0:x.subcategory)&&(0,a.jsx)(th.E,{variant:"secondary",children:x.subcategory})]}),x&&x.tags.length>0&&(0,a.jsx)("div",{className:"flex flex-wrap gap-1.5 pt-1",children:x.tags.slice(0,12).map(e=>(0,a.jsx)("span",{className:"rounded-full border border-border/60 px-2 py-0.5 text-[10px] text-muted-foreground",children:e},e))})]})]}):null}
1var tv=r(66559),tw=r(99635),tj=r(99508),ty=r(11839),tk=r(96768),tN=r(27737),t_=r(32901);let tC=[{label:"Energy drink",icon:ty.A},{label:"Skincare serum",icon:s.A},{label:"Protein bars",icon:tk.A},{label:"Scented candle",icon:tN.A}];function tI(e){let{open:t,onOpenChange:r,message:n,suggestion:l,onTrySuggestion:i}=e;return(0,a.jsx)(ew.lG,{open:t,onOpenChange:r,children:(0,a.jsxs)(ew.Cf,{className:"max-w-md p-0 overflow-y-auto overflow-x-hidden border-amber-200/60 dark:border-amber-800/40",children:[(0,a.jsxs)("div",{className:"relative bg-gradient-to-br from-amber-50 via-orange-50 to-amber-100 dark:from-amber-950/40 dark:via-orange-950/30 dark:to-amber-900/20 p-6 pb-5",children:[(0,a.jsx)("div",{className:"absolute -top-10 -right-10 w-32 h-32 bg-gradient-to-br from-amber-300/40 to-orange-300/20 dark:from-amber-500/20 dark:to-orange-500/10 rounded-full blur-2xl"}),(0,a.jsxs)("div",{className:"relative flex items-start gap-3",children:[(0,a.jsx)("div",{className:"flex-shrink-0 w-11 h-11 rounded-xl bg-gradient-to-br from-amber-400 to-orange-500 dark:from-amber-500 dark:to-orange-600 flex items-center justify-center shadow-lg shadow-amber-500/25",children:(0,a.jsx)(t_.A,{className:"h-5 w-5 text-white"})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0 pt-0.5",children:[(0,a.jsx)(ew.L3,{className:"text-lg font-semibold text-amber-950 dark:text-amber-100",children:"Review your prompt"}),(0,a.jsx)(ew.rr,{className:"text-amber-800/80 dark:text-amber-200/70 text-sm mt-1 leading-relaxed",children:n||"This doesn't appear to be a physical product we can help you create."})]})]})]}),(0,a.jsxs)("div",{className:"p-6 pt-4 space-y-4",children:[l&&(0,a.jsxs)("div",{className:"relative overflow-hidden rounded-xl bg-gradient-to-r from-amber-50 to-orange-50/50 dark:from-amber-950/30 dark:to-orange-950/20 border border-amber-200/50 dark:border-amber-700/30 p-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,a.jsx)(s.A,{className:"w-4 h-4 text-amber-600 dark:text-amber-400"}),(0,a.jsx)("span",{className:"text-xs font-semibold text-amber-700 dark:text-amber-300 uppercase tracking-wider",children:"Suggestion"})]}),(0,a.jsx)("p",{className:"text-sm text-amber-900 dark:text-amber-100 leading-relaxed",children:l})]}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-amber-800 dark:text-amber-200",children:"Try creating something like:"}),(0,a.jsx)("div",{className:"grid grid-cols-2 gap-2",children:tC.map(e=>{let{label:t,icon:n}=e;return(0,a.jsxs)("button",{onClick:()=>{null==i||i(t),r(!1)},className:"group relative flex items-center gap-2.5 p-3 rounded-xl bg-white dark:bg-white/5 border border-amber-200/60 dark:border-amber-700/30 hover:border-amber-400 dark:hover:border-amber-500/50 hover:bg-amber-50 dark:hover:bg-amber-900/20 transition-all duration-200 hover:shadow-md hover:shadow-amber-100/50 dark:hover:shadow-amber-900/20",children:[(0,a.jsx)("div",{className:"flex-shrink-0 w-8 h-8 rounded-lg bg-gradient-to-br from-amber-100 to-orange-100 dark:from-amber-800/40 dark:to-orange-800/30 flex items-center justify-center",children:(0,a.jsx)(n,{className:"w-4 h-4 text-amber-600 dark:text-amber-400"})}),(0,a.jsx)("span",{className:"text-sm font-medium text-amber-900 dark:text-amber-100 flex-1 text-left",children:t}),(0,a.jsx)(X.A,{className:"w-3.5 h-3.5 text-amber-400 dark:text-amber-500 opacity-0 -translate-x-1 group-hover:opacity-100 group-hover:translate-x-0 transition-all duration-200"})]},t)})})]}),(0,a.jsx)(w.$,{variant:"outline",onClick:()=>r(!1),className:"w-full mt-2 border-amber-300 dark:border-amber-700 hover:bg-amber-100 dark:hover:bg-amber-900/30 text-amber-800 dark:text-amber-100 hover:text-amber-900 dark:hover:text-amber-50",children:"Got it"})]})]})})}var tS=r(90753),tA=r(86904),tP=r(21646),tE=r(46203);function tT(e){return e.priceModifier?"".concat(e.priceModifier>0?"+":"-","$").concat(Math.abs(e.priceModifier).toFixed(2)):null}let tL=function(e){let{open:t,ingredientAxes:r,initialIngredientSelections:n,canAxes:s,variants:l,primaryVariantId:i,onSelectionChange:o,disabled:d}=e,c=(0,h.useMemo)(()=>(function(e,t){let r=(0,e7.mV)(e);if(!t)return r;for(let a of e){let e=t[a.type];e&&a.options.some(t=>t.value===e&&!t.disabled)&&(r[a.type]=e)}return r})(r,n),[r,n]),u=(0,h.useMemo)(()=>e9(s),[s]),m=(0,h.useMemo)(()=>(function(e,t,r){let a=t.find(e=>e.variantId===r);if(!a)return{};let n=(0,e3.TV)(a.options).axes,s={};for(let t of e9(e)){let e=n[t.type];e&&(s[t.type]=e)}return s})(s,l,i),[s,l,i]),[p,f]=(0,h.useState)(c),[x,g]=(0,h.useState)(m);(0,h.useEffect)(()=>{t&&(f(c),g(m))},[t,c,m]);let b=(0,h.useMemo)(()=>[...r].sort((e,t)=>
1e.displayOrder-t.displayOrder),[r]),v=(0,h.useMemo)(()=>[...u].sort((e,t)=>e.displayOrder-t.displayOrder),[u]),w=(0,h.useMemo)(()=>(function(e,t,r,a){var n;let s=t.find(e=>e.variantId===r);if(!s)return r;let l=(0,e3.TV)(s.options).axes,i=new Set(e9(e).map(e=>e.type)),o=t.find(t=>{let r=(0,e3.TV)(t.options).axes;return e.every(e=>{let t=i.has(e.type)?a[e.type]:l[e.type],n=r[e.type];return void 0===t&&void 0===n||void 0!==t&&void 0!==n&&t.trim().toLowerCase()===n.trim().toLowerCase()})});return null!=(n=null==o?void 0:o.variantId)?n:r})(s,l,i,x),[s,l,i,x]);return(0,h.useEffect)(()=>{t&&o({configuredOptions:p,variantId:w})},[p,o,t,w]),(0,a.jsxs)("section",{"aria-labelledby":"drink-configuration-heading",className:"overflow-hidden rounded-xl border border-border bg-background",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3 border-b border-border bg-muted/30 px-4 py-3",children:[(0,a.jsx)(tS.A,{className:"mt-0.5 h-4 w-4 flex-shrink-0 text-amber-600","aria-hidden":!0}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{id:"drink-configuration-heading",className:"text-sm font-semibold text-foreground",children:"Customize your drink"}),(0,a.jsx)("p",{className:"mt-0.5 text-xs leading-relaxed text-muted-foreground",children:"Choose from this supplier's recipe options. Can color and lid stay as shown."})]})]}),(0,a.jsxs)("div",{className:"space-y-5 px-4 py-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h4",{className:"mb-3 text-xs font-semibold text-foreground",children:"Recipe"}),(0,a.jsx)("div",{className:"grid gap-x-3 gap-y-4 sm:grid-cols-2",children:b.map(e=>{let t=e.options.filter(e=>!e.disabled),r=1===t.length?t[0]:null;return(0,a.jsxs)("div",{className:"min-w-0 space-y-1.5",children:[(0,a.jsx)(tP.J,{htmlFor:"drink-".concat(e.type),className:"block truncate text-xs font-medium leading-snug",title:e.label,children:e.label}),r?(0,a.jsx)("div",{className:"flex min-h-9 items-center rounded-lg border border-border bg-muted/35 px-3 text-sm text-muted-foreground",children:r.label}):(0,a.jsxs)(tE.l6,{value:p[e.type],onValueChange:t=>f(r=>({...r,[e.type]:t})),disabled:d,children:[(0,a.jsx)(tE.bq,{id:"drink-".concat(e.type),className:"h-9 w-full bg-background",children:(0,a.jsx)(tE.yv,{placeholder:"Select ".concat(e.label.toLowerCase())})}),(0,a.jsx)(tE.gC,{className:"z-[90]",children:t.map(e=>(0,a.jsxs)(tE.eb,{value:e.value,children:[(0,a.jsx)("span",{children:e.label}),tT(e)&&(0,a.jsx)("span",{className:"text-xs text-muted-foreground",children:tT(e)})]},e.value))})]})]},e.type)})})]}),v.length>0&&(0,a.jsx)("div",{className:"border-t border-border pt-4",children:v.map(e=>(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"mb-2 text-xs font-semibold text-foreground",children:e.label}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:e.options.filter(e=>!e.disabled).map(t=>{var r;let n=(null==(r=x[e.type])?void 0:r.trim().toLowerCase())===t.value.trim().toLowerCase();return(0,a.jsxs)("button",{type:"button",onClick:()=>g(r=>({...r,[e.type]:t.value})),disabled:d,"aria-pressed":n,className:(0,eh.cn)("inline-flex min-h-9 items-center gap-1.5 rounded-lg border px-3 text-sm font-medium transition-[border-color,background-color,color,transform] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 active:scale-[0.98] disabled:cursor-not-allowed disabled:opacity-60",n?"border-amber-500 bg-amber-50 text-amber-950 dark:bg-amber-950/30 dark:text-amber-100":"border-border bg-background text-muted-foreground hover:border-foreground
1/30 hover:text-foreground"),children:[n&&(0,a.jsx)(tA.A,{className:"h-3.5 w-3.5 text-amber-600","aria-hidden":!0}),t.label]},t.value)})})]},e.type))})]})]})};var tD=r(70716);function tM(e){let{onAccept:t,onDismiss:r}=e;return(0,a.jsxs)("section",{"aria-label":"Product ideas offer",className:"jsx-37005bbbfa3a8177 ghb fixed inset-x-3 bottom-3 z-40 mx-auto max-w-xl md:inset-x-0 md:bottom-6",children:[(0,a.jsxs)("div",{className:"jsx-37005bbbfa3a8177 relative rounded-2xl border border-[#ff6a3d]/30 bg-card/95 px-4 py-3 shadow-2xl backdrop-blur-md sm:flex sm:items-center sm:gap-3",children:[(0,a.jsx)("span",{className:"jsx-37005bbbfa3a8177 hidden h-10 w-10 shrink-0 items-center justify-center rounded-full bg-[#ff6a3d]/10 sm:flex",children:(0,a.jsx)(tD.A,{className:"h-5 w-5 text-[#ff6a3d]"})}),(0,a.jsxs)("div",{className:"jsx-37005bbbfa3a8177 min-w-0 flex-1 pr-7 sm:pr-0",children:[(0,a.jsx)("p",{className:"jsx-37005bbbfa3a8177 text-sm font-semibold leading-tight text-foreground",children:"Stuck on what to make?"}),(0,a.jsx)("p",{className:"jsx-37005bbbfa3a8177 mt-0.5 text-xs leading-snug text-muted-foreground",children:"Tell us who you're selling to and your budget. We'll find a product that's already selling."})]}),(0,a.jsx)("button",{type:"button",onClick:t,className:"jsx-37005bbbfa3a8177 mt-2.5 w-full shrink-0 cursor-pointer whitespace-nowrap rounded-full bg-[#ff6a3d] px-3.5 py-2.5 text-sm font-semibold text-white shadow-sm transition-colors hover:bg-[#e2542a] sm:mt-0 sm:w-auto sm:py-2",children:"Find my product"}),(0,a.jsx)("button",{type:"button",onClick:r,"aria-label":"Dismiss",className:"jsx-37005bbbfa3a8177 absolute right-2 top-2 cursor-pointer rounded-full p-1 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground sm:static sm:order-last sm:shrink-0",children:(0,a.jsx)(en.A,{className:"h-4 w-4"})})]}),(0,a.jsx)(V(),{id:"37005bbbfa3a8177",children:".ghb.jsx-37005bbbfa3a8177{animation:ghb-rise.32s cubic-bezier(.22,1,.36,1)}@keyframes ghb-rise{from{opacity:0;transform:translatey(120%)}to{opacity:1;transform:translatey(0)}}@media(prefers-reduced-motion:reduce){.ghb.jsx-37005bbbfa3a8177{animation:none}}"})]})}function tR(e){let{onClick:t,disabled:r=!1,compact:n=!1}=e;return(0,a.jsx)("button",{type:"button",disabled:r,onClick:t,"aria-label":"Guide me",className:(0,eh.cn)("rounded-full border border-[#ff6a3d]/35 text-[#ff6a3d] transition-colors hover:bg-[#ff6a3d] hover:text-white hover:border-[#ff6a3d]",n?"h-8 md:h-10":"h-10",r?"opacity-50 cursor-not-allowed":"cursor-pointer"),children:(0,a.jsxs)("span",{className:"flex h-full items-center gap-1.5 md:gap-2 rounded-full px-3 md:px-4 font-medium",children:[(0,a.jsx)(tD.A,{className:n?"h-4 w-4 md:h-5 md:w-5":"h-5 w-5"}),(0,a.jsx)("span",{className:n?"text-xs md:text-sm":"text-sm",children:"Get ideas"})]})})}var tO=r(82509),tF=r(69384);let tq={generate:{label:"Generated",Icon:s.A,className:"text-muted-foreground"},tweak:{label:"Edited",Icon:tO.A,className:"text-amber-600"},lookSwap:{label:"Look swap",Icon:et.A,className:"text-violet-600"},noInvestment:{label:"No-investment",Icon:er.A,className:"text-emerald-600"}};function tU(e){return new Date(e).toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}function tz(e){let{images:t,size:r}=e;return(0,a.jsx)("div",{className:"flex flex-shrink-0 gap-1",children:t.slice(0,3).map((e,t)=>(0,a.jsx)("img",{src:e,alt:"",className:(0,eh.cn)("rounded-md border border-border object-cover","sm"===r?"h-10 w-10":"h-12 w-12")},t))})}function tW(e){let{open:t,onOpenChange:r,scope:n,chainEntries:s,currentIndex:l,promptEntries:i,onRestoreChain:o,onRestorePrompt:d}=e,c=(0,tc.a)(),[u,m]=(0,h.useState)(!1);(0,h.useEffect)(()=>{t&&m(!1)},[t]);let p="product"!==n||u?"prompts":"product",f=[];for(let e of i.slice(0,50)){let t=function(e){let t=new Date(e),r=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime(),a=Math.round((r(new Date)-r(t))/864e5);return a<=0?"Today":1===a?"Yesterday":t.toLocaleDateString(void 0,{month:"short",day:"numeric"})}(e.timestamp),r=f[f.length-1];r&&r.label===t?r.items.push(e):f.push({label:t,items:[e]})}
1return(0,a.jsx)(tF.cj,{open:t,onOpenChange:r,children:(0,a.jsxs)(tF.h,{side:c?"bottom":"right",className:(0,eh.cn)("z-[81] gap-0",c?"max-h-[75dvh] rounded-t-2xl":"w-full sm:max-w-md"),overlayClassName:"z-[80]",children:[(0,a.jsxs)(tF.Fm,{className:"pb-2",children:[(0,a.jsxs)(tF.qp,{className:"flex items-center gap-2 text-base",children:[(0,a.jsx)(ea.A,{className:"h-4 w-4"}),"product"===p?"Versions of this product":"Your prompts"]}),(0,a.jsx)(tF.Qs,{children:"product"===p?"Step back to any round. Nothing is lost when you switch.":"Pick up again from any past idea."})]}),(0,a.jsx)("div",{className:"flex-1 overflow-y-auto px-4 pb-4",children:"product"===p?(0,a.jsxs)("div",{className:"flex flex-col",children:[0===s.length&&(0,a.jsx)("p",{className:"py-6 text-center text-sm text-muted-foreground",children:"No rounds yet. Every change creates one."}),s.map((e,t)=>{var r,n;let s=tq[null!=(r=e.kind)?r:e.parentId?"tweak":"generate"],i=t===l;return(0,a.jsxs)("button",{type:"button",disabled:i,onClick:()=>o(t),className:(0,eh.cn)("flex w-full items-center gap-3 rounded-lg px-2 py-2 text-left transition-colors",i?"border border-primary/40 bg-primary/5":"cursor-pointer hover:bg-muted"),children:[(0,a.jsx)(tz,{images:e.images,size:"sm"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("span",{className:"text-xs font-semibold",children:["Round ",t+1]}),i?(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"On screen now"}):(0,a.jsxs)("span",{className:(0,eh.cn)("flex items-center gap-1 text-xs",s.className),children:[(0,a.jsx)(s.Icon,{className:"h-3 w-3 flex-shrink-0"}),s.label,(0,a.jsxs)("span",{className:"text-muted-foreground",children:["\xb7 ",tU(e.timestamp)]})]})]})]},"".concat(e.timestamp,"-").concat(null!=(n=e.images[0])?n:""))})]}):(0,a.jsxs)(a.Fragment,{children:[0===i.length&&(0,a.jsx)("p",{className:"py-10 text-center text-sm text-muted-foreground",children:"No prompts yet. Everything you generate will show up here."}),f.map(e=>(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"sticky top-0 z-10 bg-background py-1.5 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:e.label}),(0,a.jsx)("div",{className:"flex flex-col",children:e.items.map(e=>{var t;return(0,a.jsxs)("button",{type:"button",onClick:()=>d(e),className:"flex w-full cursor-pointer items-center gap-3 rounded-lg px-1.5 py-2 text-left transition-colors hover:bg-muted",children:[(0,a.jsx)(tz,{images:e.images,size:"md"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("p",{className:"line-clamp-2 text-xs text-foreground",children:e.prompt}),(0,a.jsx)("span",{className:"text-[11px] text-muted-foreground",children:tU(e.timestamp)})]})]},"".concat(e.timestamp,"-").concat(null!=(t=e.images[0])?t:""))})})]},e.label))]})}),"product"===n&&(0,a.jsx)("div",{className:"border-t border-border px-4 py-2.5",children:(0,a.jsx)("button",{type:"button",onClick:()=>m(e=>!e),className:"w-full cursor-pointer text-center text-xs font-medium text-muted-foreground transition-colors hover:text-foreground",children:u?"Back to this product":"Browse your other prompts"})})]})})}var tY=r(46435);function tB(e){let{currentPrompt:t,onSelect:r,disabled:n=!1}=e,[s,l]=(0,h.useState)(null),[i,o]=(0,h.useState)(null),d=(0,h.useRef)(null),[c,u]=(0,h.useState)(!1);(0,h.useEffect)(()=>{let e=d.current;if(!e)return;let t=()=>{let t=e.firstElementChild,r=null==t?void 0:t.children,a=tY.j.length;if(!r||r.length<a)return;let n=r[0],s=r[a-1],l=s.offsetLeft+s.offsetWidth-n.offsetLeft,i=window.innerWidth;u(e=>e?l>.7*i:l>.8*i)},r=0,a=()=>{r||(r=requestAnimationFrame(()=>{r=0,t()}))};return t(),window.addEventListener("resize",a),()=>{window.removeEventListener("resize",a),r&&cancelAnimationFrame(r)}},[]),(0,h.useEffect)(()=>{let e=d.current;if(!e||!c)return;let t=0,r=!1,a=performance.now(),n=0,s=e.scrollLeft,l=e.scrollLeft,i=!1,o=d=>{let c=d-a;a=d;let u=e.scrollWidth/3;!i&&u>0&&(e.scrollLeft=u,l=u,s=e.scrollLeft,i=!0),u>0&&(e.scrollLeft>=2*u?(e.scrollLeft-=u,l-=u,s-=u):e.scrollLeft<u&&(e.scrollLeft+=u,l+=u,s+=u)),Math.abs(e.scrollLeft-s)>2&&(n=d+1500,l=e.scrollLeft),d>n&&(e.scrollLeft=l+=25*c/1e3),s=e.scrollLeft,r&&(t=requestAnimationFrame(o))},u=()=>{r||(r=!0,a=performance.now(),t=requestAnimationFrame(o))},m=()=>{r=!1,t&&cancelAnimationFrame(t),t=0},p=()=>{n=performance.now()+1500},f=!1,h=new IntersectionObserver(e=>{let[t]=e;
1(f=t.isIntersecting)&&"visible"===document.visibilityState?u():m()},{threshold:0});h.observe(e);let x=()=>{"visible"===document.visibilityState&&f?u():m()};return document.addEventListener("visibilitychange",x),e.addEventListener("touchstart",p,{passive:!0}),e.addEventListener("touchmove",p,{passive:!0}),e.addEventListener("wheel",p,{passive:!0}),e.addEventListener("mousedown",p),()=>{m(),h.disconnect(),document.removeEventListener("visibilitychange",x),e.removeEventListener("touchstart",p),e.removeEventListener("touchmove",p),e.removeEventListener("wheel",p),e.removeEventListener("mousedown",p)}},[c]);let m=e=>{r(e),o(e)},f=[...tY.j,...tY.j,...tY.j];return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{ref:d,className:"w-screen mt-3 scrollbar-hide ".concat(c?"overflow-x-auto":"flex justify-center overflow-x-hidden"),children:(0,a.jsx)("div",{className:"flex md:gap-5 ".concat(c?"w-max":"w-auto"),children:f.map((e,r)=>(0,a.jsxs)("button",{type:"button","aria-hidden":r>=tY.j.length||void 0,tabIndex:r>=tY.j.length||n?-1:0,disabled:n,onClick:()=>(e=>{if(!n){if(0===t.trim().length||t===i)return void m(e);e!==t&&l(e)}})(e.prompt),className:"group relative flex-shrink-0 w-32 h-40 md:w-36 md:h-44 mr-2 md:mr-0 rounded-2xl border border-white/20 bg-white/[0.55] transition-colors duration-200 overflow-hidden text-left [contain:layout_paint]".concat(r>=tY.j.length?c?"":" hidden":""," ").concat(n?"opacity-85 cursor-not-allowed":"cursor-pointer hover:bg-white/50 hover:border-white/40"),children:[(0,a.jsx)("div",{className:"absolute inset-0",style:{maskImage:"radial-gradient(circle at 50% 65%, black 20%, transparent 70%)",WebkitMaskImage:"radial-gradient(circle at 50% 65%, black 20%, transparent 70%)"},children:(0,a.jsx)(p(),{src:e.image,alt:e.label,fill:!0,sizes:"(max-width: 768px) 128px, 144px",className:"object-cover object-bottom scale-103 translate-y-8"})}),(0,a.jsxs)("div",{className:"absolute top-3 left-2.5 right-2.5 z-10 space-y-0.5 [text-shadow:0_1px_3px_rgba(255,255,255,0.7)]",children:[(0,a.jsx)("div",{className:"text-[11.5px] font-bold text-foreground leading-tight",children:e.label}),(0,a.jsx)("div",{className:"text-[10px] text-foreground/80 leading-snug line-clamp-2",children:e.tagline})]}),(0,a.jsx)("div",{className:"absolute bottom-2 right-2 h-7 w-7 rounded-full bg-white/[0.7] border border-white/30 flex items-center justify-center transition-transform duration-200 group-hover:translate-x-0.5",children:(0,a.jsx)(X.A,{className:"h-3.5 w-3.5 text-foreground"})})]},"".concat(e.label,"-").concat(r)))})}),(0,a.jsx)(ew.lG,{open:null!==s,onOpenChange:e=>!e&&l(null),children:(0,a.jsxs)(ew.Cf,{className:"sm:max-w-md",children:[(0,a.jsxs)(ew.c7,{children:[(0,a.jsxs)(ew.L3,{className:"flex items-center gap-2",children:[(0,a.jsx)(ti.A,{className:"h-5 w-5 text-amber-500"}),"Replace your prompt?"]}),(0,a.jsxs)(ew.rr,{className:"pt-2 space-y-2",children:[(0,a.jsx)("span",{className:"block",children:"You already started writing a prompt. Picking an example will discard what you typed."}),(0,a.jsxs)("span",{className:"block text-amber-700 bg-amber-50 border border-amber-200 rounded-md px-3 py-2 mt-2",children:['New prompt: "',s,'"']})]})]}),(0,a.jsxs)("div",{className:"flex flex-col-reverse sm:flex-row sm:justify-end gap-2 pt-2",children:[(0,a.jsx)(w.$,{variant:"outline",onClick:()=>l(null),children:"Cancel"}),(0,a.jsx)(w.$,{onClick:()=>{null!==s&&(m(s),l(null))},children:"Replace"})]})]})})]})}var tG=r(75784),tV=r(90386),t$=r(45481);let tH=[1,.75,.5],tJ=["","hidden [@media(min-height:760px)]:flex","hidden md:[@media(min-height:1000px)]:flex"];function tK(){let e=(0,t$.uA)(),[t,r]=(0,h.useState)(0),[n]=(0,h.useState)(()=>Date.now());if((0,h.useEffect)(()=>{if(e.length<=3||window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;let t=setInterval(()=>r(t=>(t+1)%e.length),5e3);return()=>clearInterval(t)},[e.length]),0===e.length)return null;let s=Array.from({length:Math.min(3,e.length)},(r,a)=>e[(t+a)%e.length]);return(0,a.jsx)("ul",{className:"flex flex-col items-center gap-1 mt-2 relative z-20 list-none p-0 m-0",children:(0,a.jsx)(tG.N,{initial:!1,mode:"popLayout",children:s.map((e,t)=>{var r,s,l;return(0,a.jsxs)(tV.P.li,{layout:!0,initial:{opacity:0,y:10}
1,animate:{opacity:null!=(r=tH[t])?r:.5,y:0},exit:{opacity:0,y:-10},transition:{duration:.45,ease:"easeOut"},className:"flex items-center gap-2 rounded-full border border-border/60 bg-background/40 backdrop-blur-md pl-3 pr-4 py-1 max-w-[92vw] ".concat(null!=(s=tJ[t])?s:"hidden"),children:[(0,a.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-green-500 shrink-0","aria-hidden":"true"}),(0,a.jsx)("span",{className:"text-xs text-foreground truncate",children:function(e){let t=e.product?(0,a.jsx)("b",{className:"font-semibold",children:e.product}):null;switch(e.type){case"brand_created":return t?(0,a.jsxs)(a.Fragment,{children:["Someone just created ",t]}):(0,a.jsx)(a.Fragment,{children:"A new brand was just created"});case"sample_ordered":return t?(0,a.jsxs)(a.Fragment,{children:["A founder ordered a sample of ",t]}):(0,a.jsx)(a.Fragment,{children:"A founder ordered a product sample"});case"order_placed":if(e.region&&t)return(0,a.jsxs)(a.Fragment,{children:["A customer in ",e.region," bought ",t]});if(t)return(0,a.jsxs)(a.Fragment,{children:["A customer bought ",t]});return(0,a.jsx)(a.Fragment,{children:"A brand just made a sale"});
1case"design_updated":{var r;let n=null!=(r=e.name)?r:"A founder";return t?(0,a.jsxs)(a.Fragment,{children:[n," just updated the ",t," design"]}):(0,a.jsxs)(a.Fragment,{children:[n," just updated their product design"]})}}}(e)}),(0,a.jsx)("span",{className:"text-[10px] text-muted-foreground whitespace-nowrap tabular-nums shrink-0",children:function(e,t){let r=t-new Date(e).getTime();if(!Number.isFinite(r)||r<0)return"just now";let a=Math.floor(r/6e4);if(a<1)return"just now";if(a<60)return"".concat(a," min ago");let n=Math.floor(a/60);return n<24?"".concat(n," h ago"):"".concat(Math.floor(n/24)," d ago")}(e.at,n)})]},"".concat(e.at,"-").concat(e.type,"-").concat(null!=(l=e.product)?l:""))})})})}let tQ=["/images/social-proof/user-1.webp","/images/social-proof/user-2.webp","/images/social-proof/user-3.webp","/images/social-proof/user-4.webp"];function tZ(){let e=(0,t$.qI)(),[t,r]=(0,h.useState)(e),n=(0,h.useRef)(null);return(0,h.useEffect)(()=>{if(null!==n.current||e<=t)return void r(e);n.current=t;let a=Math.max(t,e-8),s=performance.now(),l=0,i=n=>{let o=n-s;if(o<2e3)r(Math.round(t+(1-(1-o/2e3)**3)*(a-t)));else if(r(Math.min(a+Math.floor((o-2e3)/1e3)+1,e)),o>=1e4)return;l=requestAnimationFrame(i)};return l=requestAnimationFrame(i),()=>cancelAnimationFrame(l)},[e]),(0,a.jsx)("div",{className:"flex justify-center mt-1 md:-mt-8 relative z-20",children:(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-full border border-border/60 bg-background/40 backdrop-blur-md pl-2 pr-4 py-1.5",children:[(0,a.jsx)("div",{className:"flex -space-x-2",children:tQ.map(e=>(0,a.jsx)("img",{src:e,alt:"",className:"h-7 w-7 rounded-full border-2 border-white object-cover"},e))}),(0,a.jsxs)("span",{className:"text-sm font-semibold text-foreground tabular-nums",children:[(0,t$.Ub)(t)," brands launched this month"]})]})})}function tX(e){let{open:t,onOpenChange:r,message:n,onGenerateDifferent:s}=e;return(0,a.jsx)(ew.lG,{open:t,onOpenChange:r,children:(0,a.jsxs)(ew.Cf,{className:"max-w-md p-0 border-amber-200/60 dark:border-amber-800/40",children:[(0,a.jsxs)("div",{className:"relative overflow-hidden rounded-t-[inherit] bg-gradient-to-br from-amber-50 via-orange-50 to-amber-100 dark:from-amber-950/40 dark:via-orange-950/30 dark:to-amber-900/20 p-6 pb-5",children:[(0,a.jsx)("div",{className:"absolute -top-10 -right-10 w-32 h-32 bg-gradient-to-br from-amber-300/40 to-orange-300/20 dark:from-amber-500/20 dark:to-orange-500/10 rounded-full blur-2xl"}),(0,a.jsxs)("div",{className:"relative flex items-start gap-3",children:[(0,a.jsx)("div",{className:"flex-shrink-0 w-11 h-11 rounded-xl bg-gradient-to-br from-amber-400 to-orange-500 dark:from-amber-500 dark:to-orange-600 flex items-center justify-center shadow-lg shadow-amber-500/25",children:(0,a.jsx)(ed.A,{className:"h-5 w-5 text-white"})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0 pt-0.5",children:[(0,a.jsx)(ew.L3,{className:"text-lg font-semibold text-amber-950 dark:text-amber-100",children:"This packaging is fixed"}),(0,a.jsx)(ew.rr,{className:"text-amber-800/80 dark:text-amber-200/70 text-sm mt-1 leading-relaxed",children:n||"This product ships in a container your manufacturer makes to a fixed spec, so its packaging can't be changed here. You can still edit the label: its artwork, logo, colors, and text."})]})]})]}),(0,a.jsxs)("div",{className:"p-6 pt-4 space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2.5 rounded-xl bg-gradient-to-r from-amber-50 to-orange-50/50 dark:from-amber-950/30 dark:to-orange-950/20 border border-amber-200/50 dark:border-amber-700/30 p-3.5",children:[(0,a.jsx)("div",{className:"flex-shrink-0 w-8 h-8 rounded-lg bg-gradient-to-br from-amber-100 to-orange-100 dark:from-amber-800/40 dark:to-orange-800/30 flex items-center justify-center",children:(0,a.jsx)(tO.A,{className:"w-4 h-4 text-amber-600 dark:text-amber-400"})}),(0,a.jsx)("p",{className:"text-sm text-amber-900 dark:text-amber-100 leading-relaxed",children:"Try a label tweak instead: colors, logo, typography, or artwork."})]}),(0,a.jsxs)(w.$,{onClick:()=>r(!1),className:"w-full bg-gradient-to-r from-amber-500 to-orange-500 hover:from-amber-600 hover:to-orange-600 text-white shadow-lg shadow-amber-500/25",children:[(0,a.jsx)(tO.A,{className:"w-4 h-4 mr-2"}),"Keep editing the label"]}),s&&(0,a.jsx)("button",{type:"button",onClick:s,className:"w-full text-center text-xs rounded-lg py-2 px-3 bg-amber-100/40 dark:bg-amber-900/20 border border-amber-200/50 dark:border-amber-800/30 text-amber-700/70 dark:text-amber-300/60 hover:bg-amber-100/70 dark:hover:bg-amber-900/30 hover:text-amber-800 dark:hover:text-amber-200 transition-colors",children:"Or generate a different product instead"})]})]})})}
1var t0=r(52820),t1=r(44522),t2=r(44366),t5=r(79951),t4=r(8399),t3=r(73270),t7=r(45989),t6=r(78925),t8=r(10195),t9=r(38078),re=r(88792),rt=r(32462),rr=r(30383),ra=r(57619),rn=r(15380);let rs=[{brand:"Fit Chews",category:"Nutrition",creator:"Bert W.",role:"Strength Coach",mockupImage:"/images/mockup_to_sample/mock_fitchews.webp",mockupAlt:"The Fit Chews pouch mockup inside the Dough app",realPhoto:"/images/mockup_to_sample/sample_fitchews.webp",realPhotoAlt:"Bert holding the delivered Fit Chews sample pouch at home",quote:"I needed a product that was high in protein, low in sugar, and safe for my kids. Dough made it happen.",made:["Multiple iterations on flavor and supplements","20g protein, zero sugar formula","Subscriptions built into his store"]},{brand:"Smoked Orchard",category:"Food",creator:"Earl M.",role:"[Role]",mockupImage:"/images/mockup_to_sample/mock_smokedorchard.jpg",mockupAlt:"The Smoked Orchard seasoning pouch mockup inside the Dough app",realPhoto:"/images/mockup_to_sample/sample_smokedorchard.jpg",realPhotoAlt:"The delivered Smoked Orchard seasoning pouch",quote:"Trying to find the right company that actually makes the product, I had a really hard time, and then I discovered Dough.",made:["Small-batch production","Made in Ohio","Black pouch, custom print"]},{brand:"Untitled Femme",category:"Beauty",creator:"Nikki C.",role:"Makeup Artist & Designer",mockupImage:"/images/mockup_to_sample/mock_untitled.jpg",mockupAlt:"The Untitled Femme caged lip oil mockup inside the Dough app",realPhoto:"/images/mockup_to_sample/sample_untitled.jpg",realPhotoAlt:"Untitled Femme prototypes and lip oil samples on the workbench",quote:"What I like the most about Dough is that they handle the manufacturing while I can focus on being more creative.",made:["Custom metal jewelry cage","3D printed fit tests before metal","Own lip oil formula"]},{brand:"Ready, Set, Fail",category:"Food",creator:"John W.",role:"[Role]",mockupImage:"/images/mockup_to_sample/mock_readysetfail.webp",mockupAlt:"The Ready, Set, Fail hot sauce bottle mockup inside the Dough app",realPhoto:"/images/mockup_to_sample/sample_readysetfail.jpg",realPhotoAlt:"The delivered Ready, Set, Fail hot sauce bottle, held in hand",quote:"It went from a joke between friends to a real bottle in my hand.",made:["Carolina Reaper recipe","Custom comic-style label","Small-batch bottling run"]},{brand:"The Snapmat",category:"Fitness",creator:"Bridgette",role:"Founder",mockupImage:"/images/mockup_to_sample/mock_snapmat.webp",mockupAlt:"The Snapmat yoga mat mockup inside the Dough app",realPhoto:"/images/mockup_to_sample/sample_snapmat.jpg",realPhotoAlt:"The delivered Snapmat sample, towel snapped onto the mat",quote:"For years I didn't have the tools to bring it to life, but Dough did it!",made:["Snap-on towel system","Iterated through custom samples","Multiple mat designs to sell"]},{brand:"Pure",category:"Body care",creator:"Rebecca D.",role:"[Role]",mockupImage:"/images/mockup_to_sample/mock_pure.webp",mockupAlt:"The Pure peppermint coffee scrub mockup inside the Dough app",realPhoto:"/images/mockup_to_sample/sample_pure.jpeg",realPhotoAlt:"The delivered Pure peppermint coffee scrub jar at home",quote:"Impressed by how quickly Dough was able to turn my idea into a real product.",made:["Custom coffee scrub formula","Made in the USA","Custom printed jar label"]},{brand:"Steady Strips",category:"Wellness",creator:"Timothy S.",role:"[Role]",mockupImage:"/images/mockup_to_sample/mock_steadystrips.jpg",mockupAlt:"The Steady Strips tin mockup inside the Dough app",realPhoto:"/images/mockup_to_sample/sample_steadystrips.jpg",realPhotoAlt:"The delivered Steady Strips sample tin on the shelf",quote:"The label came out exactly like the mockup. That's when it felt real.",made:["Custom printed tin","Cranberry flavor development","Individually wrapped strips"]}];function rl(e){let{src:t,alt:r,sizes:n}=e,[s,l]=(0,h.useState)(!1);return s?(0,a.jsx)("div",{className:"flex h-full w-full items-center justify-center bg-gradient-to-br from-[#efe3d4] to-[#dfcbb4]",children:(0,a.jsx)(ed.A,{className:"h-8 w-8 text-[#a8916f]",strokeWidth:1.5})}):(0,a.jsx)(p(),{src:t,alt:r,fill:!0,sizes:n,className:"object-cover",onError:()=>l(!0)})}function ri(e){let{story:t}=e;return(0,a.jsxs)("div",{"data-proof-card":!0,className:"flex flex-col snap-center shrink-0 w-[88%] sm:w-[62%] md:w-[290px] rounded-[1.7rem] bg-white/40 backdrop-blur-md p-2",children:[(0,a.jsxs)("div",{className:"relative grid grid-cols-[1fr_1.2fr] gap-1.5",children:[(0,a.jsxs)("div",{className:"relative aspect-[4/5] overflow-hidden rounded-l-[1.35rem] rounded-r-md",children:[(0,a.jsx)(rl,{src:t.mockupImage,alt:t.mockupAlt,sizes:"(max-width: 768px) 42vw, 130px"}),(0,a.jsx)("span",{className:"absolute top-2 left-2 rounded-full bg-white/90 px-2 py-[3px] text-[8px] font-bold uppercase tracking-[0.08em] text-foreground
1/60 backdrop-blur-sm",children:"In the app"})]}),(0,a.jsxs)("div",{className:"relative overflow-hidden rounded-r-[1.35rem] rounded-l-md",children:[(0,a.jsx)(rl,{src:t.realPhoto,alt:t.realPhotoAlt,sizes:"(max-width: 768px) 50vw, 160px"}),(0,a.jsx)("span",{className:"absolute top-2 left-2 rounded-full bg-[#ff6a3d]/95 px-2 py-[3px] text-[8px] font-bold uppercase tracking-[0.08em] text-white shadow-sm",children:"Real photo"})]}),(0,a.jsx)("span",{className:"absolute left-[41%] top-1/2 z-10 flex h-8 w-8 -translate-y-1/2 items-center justify-center rounded-full bg-white text-[#ff6a3d] shadow-[0_6px_14px_-4px_rgba(120,80,40,0.45)] ring-1 ring-black/5",children:(0,a.jsx)(X.A,{className:"h-4 w-4",strokeWidth:2.5})})]}),(0,a.jsxs)("div",{className:"flex flex-1 flex-col px-2.5 pt-3 pb-2",children:[(0,a.jsxs)("p",{className:"text-[13.5px] italic leading-relaxed text-foreground/85",style:{fontFamily:'"Lora", serif'},children:["â",t.quote,"â"]}),(0,a.jsx)("ul",{className:"mt-2.5 mb-3 flex flex-col gap-1.5",children:t.made.map(e=>(0,a.jsxs)("li",{className:"flex items-start gap-1.5 text-[11px] leading-snug text-foreground/65",children:[(0,a.jsx)(tA.A,{className:"mt-px h-3 w-3 shrink-0 text-[#ff6a3d]",strokeWidth:3}),e]},e))}),(0,a.jsxs)("div",{className:"mt-auto flex items-center justify-between gap-2 border-t border-[#2a2018]/[0.07] pt-2.5",children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-col leading-tight",children:[(0,a.jsx)("span",{className:"truncate text-xs font-semibold text-foreground",children:t.creator}),(0,a.jsx)("span",{className:"truncate text-[10px] text-muted-foreground/70",children:t.brand})]}),(0,a.jsx)("span",{className:"shrink-0 rounded-full bg-[#ff6a3d]/10 px-2.5 py-1 text-[10px] font-bold text-[#ff6a3d]",children:t.category})]})]})]})}function ro(e){let{direction:t,onClick:r}=e,n="prev"===t?ra.A:rn.A;return(0,a.jsx)("button",{type:"button",onClick:r,"aria-label":"prev"===t?"Previous brands":"Next brands",className:"absolute top-1/2 z-20 hidden h-12 w-12 -translate-y-1/2 items-center justify-center rounded-full bg-[#ff6a3d] text-white shadow-[0_10px_26px_-6px_rgba(214,74,32,0.6)] ring-1 ring-black/5 transition-[background-color,transform] hover:bg-[#f04f1c] active:scale-95 md:flex ".concat("prev"===t?"left-3":"right-3"),children:(0,a.jsx)(n,{className:"h-6 w-6",strokeWidth:2.75})})}function rd(){let{scrollerRef:e,atStart:t,atEnd:r,scrollByCard:n}=function(){let e=(0,h.useRef)(null),[t,r]=(0,h.useState)({atStart:!0,atEnd:!0}),a=(0,h.useCallback)(()=>{let t=e.current;if(!t)return;let a=t.scrollWidth-t.clientWidth;r({atStart:t.scrollLeft<=8,atEnd:t.scrollLeft>=a-8})},[]);(0,h.useEffect)(()=>{let t=e.current;if(!t)return;a(),t.addEventListener("scroll",a,{passive:!0});let r=new ResizeObserver(a);return r.observe(t),()=>{t.removeEventListener("scroll",a),r.disconnect()}},[a]);let n=(0,h.useCallback)(t=>{let r=e.current;if(!r)return;let a=r.querySelector("[data-proof-card]"),n=Number.parseFloat(getComputedStyle(r).columnGap)||0,s=a?a.offsetWidth+n:.8*r.clientWidth;r.scrollBy({left:t*s,behavior:"smooth"})},[]);return{scrollerRef:e,...t,scrollByCard:n}}();return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"text-center mb-6 px-9",children:[(0,a.jsxs)("h2",{className:"text-2xl md:text-3xl font-bold text-foreground",style:{fontFamily:'"Plus Jakarta Sans", sans-serif'},children:["Hard to believe?"," ",(0,a.jsx)("span",{className:"font-medium italic text-[#ff6a3d]",style:{fontFamily:'"Lora", serif'},children:"It's real."})]}),(0,a.jsx)("p",{className:"mt-2 text-sm text-foreground/60",children:"Every brand below started as a prompt. Then a real box showed up."})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("div",{ref:e,className:"scrollbar-hide flex w-full gap-4 overflow-x-auto snap-x snap-mandatory px-5 pb-2 md:gap-5 md:px-8",style:{justifyContent:"safe center"},children:rs.map(e=>(0,a.jsx)(ri,{story:e},e.brand))}),!t&&(0,a.jsx)(ro,{direction:"prev",onClick:()=>n(-1)}),!r&&(0,a.jsx)(ro,{direction:"next",onClick:()=>n(1)})]}),(0,a.jsxs)("p",{className:"mt-5 text-center text-xs text-foreground
1/50 px-5",children:["Real samples, shipped to real founders. ",(0,a.jsx)("span",{className:"font-semibold text-foreground/70",children:"Yours next."})]})]})}let rc='"Plus Jakarta Sans", sans-serif',ru=[{prompt:"Pre-workout powder for girls",brand:"Girls That Lift",product:["Pre-workout","powder"],image:"/images/girls_that_lift.png",variant:"Cotton candy",cost:"$15",margin:"$9",revenue:"$108,420",growth:"â² 312%",chart:"M0 46 L25 43 L50 44 L75 33 L100 36 L125 24 L150 20 L175 10 L200 4",chartEndY:4,marginLeft:0},{prompt:"Inspirational Dough cap",brand:"Dough",product:["Dough","Cap"],image:"/images/dough_something.png",variant:"Embroidered text",cost:"$8",margin:"$12",revenue:"$96,739",growth:"â² 285%",chart:"M0 42 L25 38 L50 40 L75 30 L100 33 L125 22 L150 25 L175 11 L200 5",chartEndY:5,marginLeft:0},{prompt:"Energy drink for healthcare workers",brand:"3AM",product:["Energy","drink"],image:"/images/3AM.png",variant:"Berry blast",cost:"$2",margin:"$1",revenue:"$15,739",growth:"â² 153%",chart:"M0 42 L25 38 L50 40 L75 30 L100 33 L125 22 L150 25 L175 11 L200 5",chartEndY:5,marginLeft:15}];function rm(e){let{text:t}=e;return(0,a.jsxs)("div",{className:"relative flex h-[150px] w-full items-center justify-center",children:[(0,a.jsx)(t1.A,{className:"absolute right-8 top-6 h-7 w-7 rotate-12 fill-[#ff8a3d] text-[#ff8a3d] drop-shadow-[0_4px_8px_rgba(255,106,61,0.4)]"}),(0,a.jsx)(t1.A,{className:"absolute bottom-7 left-9 h-3.5 w-3.5 fill-[#ffb38a] text-[#ffb38a]"}),(0,a.jsxs)("div",{className:"-rotate-3 flex h-[60px] w-[190px] items-start gap-2 overflow-hidden rounded-2xl bg-white px-4 py-3 shadow-[0_18px_34px_-14px_rgba(120,80,40,0.5)] ring-1 ring-black/5",children:[(0,a.jsx)(s.A,{className:"mt-0.5 h-4 w-4 shrink-0 text-[#ff6a3d]"}),(0,a.jsxs)("span",{className:"min-w-0 flex-1 text-left text-[13px] font-semibold leading-snug text-[#2a2018]",children:[t,(0,a.jsx)("span",{className:"ml-0.5 inline-block h-3.5 w-px translate-y-0.5 animate-pulse bg-[#ff6a3d]"})]})]})]})}function rp(e){let{image:t,variant:r,cost:n,margin:s,marginLeft:l}=e,o=[{kind:"check",label:"Supplier matched"},{kind:"check",label:r},{kind:"kv",label:"Cost",value:n,accent:!1},{kind:"kv",label:"Margin",value:s,accent:!0}];return(0,a.jsx)("div",{className:"relative flex h-[150px] w-full items-center justify-center",children:(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)("div",{className:"relative z-10 h-[130px] w-[86px] shrink-0 rotate-[-10deg]",children:(0,a.jsx)(p(),{src:t,alt:"Product mockup",fill:!0,sizes:"86px",style:{left:"".concat(l,"px")},className:"hiw-flow-pop object-contain drop-shadow-[0_16px_22px_rgba(41,31,24,0.34)]"},t)}),(0,a.jsx)("div",{className:"-ml-11 rounded-2xl bg-white py-2 pr-3.5 pl-11 shadow-[0_16px_30px_-16px_rgba(120,80,40,0.5)] ring-1 ring-black/5",children:(0,a.jsx)("div",{className:"hiw-flow-pop space-y-1.5",style:{fontFamily:rc},children:o.map((e,t)=>"check"===e.kind?(0,a.jsxs)("div",{className:"flex items-center gap-1.5",style:{marginLeft:4*t},children:[(0,a.jsx)(i.A,{className:"h-3.5 w-3.5 shrink-0 text-[#1f9d55]"}),(0,a.jsx)("span",{className:"whitespace-nowrap text-[12.5px] font-semibold text-[#3a2e22]",children:e.label})]},e.label):(0,a.jsxs)("div",{className:"flex items-baseline gap-1.5",style:{marginLeft:4*t,marginTop:3===t?"-5px":0},children:[(0,a.jsx)("span",{className:"text-[11px] font-medium text-[#9a8a78]",children:e.label}),(0,a.jsx)("span",{className:"font-extrabold ".concat(e.accent?"text-[14px] text-[#ff6a3d]":"text-[13px] text-[#2a2018]"),children:e.value})]},e.label))},"".concat(r,"|").concat(n,"|").concat(s))})]})})}function rf(e){let{brand:t,product:r,image:n,flip:s=!1}=e;return(0,a.jsx)("div",{className:"relative flex h-[150px] w-full items-center justify-center",children:(0,a.jsx)("div",{className:"relative w-[92px] ".concat(s?"rotate-[6deg]":"-rotate-[5deg]"," transform-gpu rounded-[1.05rem] bg-[#171717] p-[3px] shadow-[0_24px_38px_-16px_rgba(41,31,24,0.6)] ring-1 ring-[#171717] [backface-visibility:hidden]"),children:(0,a.jsxs)("div",{className:"relative overflow-hidden rounded-[0.85rem] bg-white",children:[(0,a.jsx)("div",{className:"absolute left-1/2 top-[3px] z-10 h-1 w-6 -translate-x-1/2 roun
1ded-full bg-[#171717]"}),(0,a.jsxs)("div",{className:"flex items-center justify-between px-2 pt-[11px] pb-1",children:[(0,a.jsx)("span",{className:"hiw-flow-pop max-w-[58px] truncate text-[6.5px] font-semibold uppercase tracking-wide text-[#2a2018]/45",children:t},t),(0,a.jsx)(t4.A,{className:"h-2.5 w-2.5 text-[#2a2018]/70"})]}),(0,a.jsx)("div",{className:"px-2",children:(0,a.jsxs)("div",{className:"hiw-flow-pop h-[37px] overflow-hidden text-[12px] font-extrabold leading-[1.02] text-[#2a2018]",style:{fontFamily:rc},children:[r[0],(0,a.jsx)("br",{}),r[1]]},r.join("|"))}),(0,a.jsx)("div",{className:"mt-1.5 flex h-[64px] w-full items-center justify-center bg-gradient-to-b from-[#fff4ec] to-[#ffe6da]",children:(0,a.jsx)(p(),{src:n,alt:"",width:54,height:62,sizes:"54px",className:"hiw-flow-pop h-[50px] w-[44px] object-contain md:h-[62px] md:w-[54px]"},n)}),(0,a.jsx)("div",{className:"px-2 pb-2.5 pt-3",children:(0,a.jsx)("span",{className:"block rounded-full bg-[#ff6a3d] py-[5px] text-center text-[7.5px] font-bold text-white",children:"BUY"})})]})})})}function rh(e){let{revenue:t,growth:r,chart:n,chartEndY:s}=e;return(0,a.jsxs)("div",{className:"relative flex h-[150px] w-full items-center justify-center",children:[(0,a.jsx)("div",{className:"absolute h-[104px] w-[148px] translate-x-3 translate-y-2 rotate-[6deg] rounded-xl bg-white/35 ring-1 ring-black/5","aria-hidden":"true"}),(0,a.jsx)("div",{className:"absolute h-[104px] w-[148px] -translate-x-2 translate-y-1 rotate-[-3deg] rounded-xl bg-white/55 ring-1 ring-black/5","aria-hidden":"true"}),(0,a.jsxs)("div",{className:"relative w-[158px] rounded-xl bg-white/90 p-3 shadow-[0_14px_28px_-14px_rgba(120,80,40,0.45)] ring-1 ring-black/5 backdrop-blur-sm",children:[(0,a.jsx)("div",{className:"text-[10px] font-medium text-[#2a2018]/45",children:"Total revenue"}),(0,a.jsxs)("div",{className:"hiw-flow-pop flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-lg font-extrabold tracking-tight text-[#2a2018]",children:t}),(0,a.jsx)("span",{className:"rounded-full bg-[#1f9d55]/10 px-1.5 py-0.5 text-[9px] font-bold text-[#1f9d55]",children:r})]},t),(0,a.jsx)("div",{className:"text-[9px] text-[#2a2018]/40",children:"vs last 30 days"}),(0,a.jsxs)("svg",{viewBox:"0 0 200 50",preserveAspectRatio:"none",className:"hiw-flow-pop mt-1.5 h-9 w-full","aria-hidden":"true",children:[(0,a.jsx)("title",{children:"Revenue trend"}),(0,a.jsx)("defs",{children:(0,a.jsxs)("linearGradient",{id:"flowGrowArea",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,a.jsx)("stop",{offset:"0%",stopColor:"#ff6a3d",stopOpacity:"0.32"}),(0,a.jsx)("stop",{offset:"100%",stopColor:"#ff6a3d",stopOpacity:"0"})]})}),(0,a.jsx)("path",{d:"".concat(n," L200 50 L0 50 Z"),fill:"url(#flowGrowArea)"}),(0,a.jsx)("path",{d:n,fill:"none",stroke:"#ff6a3d",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,a.jsx)("circle",{cx:"200",cy:s,r:"3.5",fill:"#ff6a3d"})]},n)]})]})}let rx=[{num:1,title:"Imagine anything"},{num:2,title:"We manufacture it"},{num:3,title:"We launch it"},{num:4,title:"We grow it"}];function rg(e){let{num:t,demo:r}=e;switch(t){case 1:return(0,a.jsx)(rm,{text:r.typed});case 2:return(0,a.jsx)(rp,{image:r.buildImage,variant:r.variant,cost:r.cost,margin:r.margin,marginLeft:r.marginLeft});case 3:return(0,a.jsx)(rf,{brand:r.brand,product:r.product,image:r.launchImage});default:return(0,a.jsx)(rh,{revenue:r.revenue,growth:r.growth,chart:r.chart,chartEndY:r.chartEndY})}}let rb=["md:-translate-y-[18px]","md:translate-y-[14px]","md:-translate-y-[6px]","md:translate-y-0"];function rv(e){let{num:t,title:r}=e;return(0,a.jsxs)("div",{className:"relative z-10 inline-flex items-center gap-2 rounded-xl bg-white py-1 pr-3.5 pl-1 shadow-[0_8px_18px_-10px_rgba(120,80,40,0.45)] ring-1 ring-black/5",style:{fontFamily:rc},children:[(0,a.jsx)("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-gradient-to-br from-[#ff8a4d] to-[#ff5a1f] text-[13px] font-bold text-white shadow-[0_5px_12px_-3px_rgba(255,106,61,0.65)]",children:t}),(0,a.jsx)("span",{className:"text-[15px] font-bold text-[#2a2018]",children:r})]})}function rw(){let e=function(){let[e,t]=(0,h.useState)(()=>(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.prompt;return{typed:t,brand:e.brand,product:e.product,buildImage:e.image,launchImage:e.image,variant:e.variant,cost:e.cost,margin:e.margin,revenue:e.revenue,growth:e.growth,chart:e.chart,chartEndY:e.chartEndY,marginLeft:e.marginLeft}})(ru[0]));return(0,h.useEffect)(()=>{var e,r;if(null==(e=(r=window).matchMedia)?void 0:e.call(r,"(prefers-reduced-motion: reduce)").matches)return;let a=!1,n=[],s=e=>new Promise(t=>{n.push(setTimeout(t,e))});return(async()=>{let e=0;for(await s(3500);!a;){let r=ru[e],n=ru[(e+1)%ru.length];for(let e=r.prompt.length;e>=0;e--){if(a)return;t(t=>({...t,typed:r.prompt.slice(0,e)})),await s(28)}await s(280);for(let e=1;e<=n.prompt.length;e++){if(a)return;t(t=>({...t,typed:n.prompt.slice(0,e)})),await s(46+60*Math.random())}if(a||(await s(520),t(e=>({...e,buildImage:n.image,marginLeft:n.marginLeft,variant:n.variant,cost:n.cost,margin:n.margin})),await s(680),a)||(t(e=>({...e,launchImage:n.image,brand:n.brand,product:n.product})),await s(680),a))return;t(e=>({...e,revenue:n.revenue,growth:n.growth,chart:n.chart,chartEndY:n.chartEndY})),await s(4200),e=(e+1)%ru.length}})(),()=>{for(let e of(a=!0,n))clearTimeout(e)}},[]),e}();return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(V(),{id:"61f284d35fa472de",children:"@keyframes hiwFlowPop{0%{opacity:0;transform:translatey(5px)scale(.97)}60%{opacity:1}100%{transform:translatey(0)scale(1)}}.hiw-flow-pop{animation:hiwFlowPop.5s cubic-bezier(.22,1,.36,1)}"}),(0,a.jsxs)("div",{className:"jsx-61f284d35fa472de relative hidden md:block",children:[(0,a.jsx)("svg",{viewBox:"0 0 1200 202",preserveAspectRatio:"none","aria-hidden":"true",className:"jsx-61f284d35fa472de pointer-events-none absolute inset-0 h-full w-full",children:["M200 164 C 250 168, 232 196, 326 196","M326 200 C 402 200, 462 200, 512 190 C 548 184, 564 158, 544 150 C 526 143, 512 166, 538 178 C 570 192, 602 182, 630 176","M630 176 C 780 185, 810 180, 836 108 C 864 40, 904 20, 934 20"].map(e=>(0,a.jsx)("path",{d:e,fill:"none",stroke:"#ff7a4d",strokeWidth:"3",strokeLinecap:"round",opacity:"0.85",className:"jsx-61f284d35fa472de"},e))}),(0,a.jsx)("div",{className:"jsx-61f284d35fa472de grid grid-cols-4 gap-3",children:rx.map((t,r)=>{let n=4===t.num;return(0,a.jsxs)("div",{className:"jsx-61f284d35fa472de relative flex flex-col gap-4",children:[(0,a.jsx)("div",{className:"jsx-61f284d35fa472de "+"relative z-10 flex h-[150px] w-full items-center justify-center ".concat(n?"order-2":""),children:(0,a.jsx)(rg,{num:t.num,demo:e})}),(0,a.jsx)("div",{className:"jsx-61f284d35fa472de "+"relative z-10 flex justify-start pl-1 ".concat(rb[r]," ").concat(n?"order-1":""),children:(0,a.jsx)(rv,{num:t.num,title:t.title})})]},t.num)})})]}),(0,a.jsxs)("div",{className:"jsx-61f284d35fa472de relative md:hidden",children:[(0,a.jsx)("svg",{viewBox:"0 0 100 100",preserveAspectRatio:"none","aria-hidden":"true",className:"jsx-61f284d35fa472de pointer-events-none absolute inset-0 h-full w-full",children:(0,a.jsx)("path",{d:"M20 5 C 20 22, 78 22, 78 32 C 78 46, 20 44, 20 54 C 20 67, 48 72, 50 76",fill:"none",stroke:"#ff7a4d",strokeWidth:"2.5",strokeLinecap:"round",opacity:"0.85",vectorEffect:"non-scaling-stroke",className:"jsx-61f284d35fa472de"})}),(0,a.jsxs)("div",{className:"jsx-61f284d35fa472de flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"jsx-61f284d35fa472de relative",children:[(0,a.jsx)(rm,{text:e.typed}),(0,a.jsx)("div",{className:"jsx-61f284d35fa472de absolute top-0 left-1 z-10",children:(0,a.jsx)(rv,{num:1,title:"Imagine anything"})})]}),(0,a.jsxs)("div",{className:"jsx-61f284d35fa472de flex items-center gap-2",children:[(0,a.jsx)("div",{className:"jsx-61f284d35fa472de flex-1",children:(0,a.jsx)(rp,{image:e.buildImage,variant:e.variant,cost:e.cost,margin:e.margin,marginLeft:e.marginLeft})}),(0,a.jsx)("div",{className:"jsx-61f284d35fa472de relative z-10 shrink-0",children:(0,a.jsx)(rv,{num:2,title:"We manufacture it"})})]}),(0,a.jsxs)("div",{className:"jsx-61f284d35fa472de relative mt-4",children:[(0,a.jsx)(rf,{brand:e.brand,product:e.product,image:e.launchImage,flip:!0}),(0,a.jsx)("div",{className:"jsx-61f284d35fa472de absolute top-10 left-3 z-10",children:(0,a.jsx)(rv,{num:3,title:"We launch it"})})]}),(0,a.jsxs)("div",{className:"jsx-61f284d35fa472de mt-10 flex flex-col items-center gap-2",children:[(0,a.jsx)("div",{className:"jsx-61f284d35fa472de relative z-10",children:(0,a.jsx)(rv,{num:4,title:"We grow it"})}),(0,a.jsx)(rh,{revenue:e.revenue,growth:e.growth,chart:e.chart,chartEndY:e.chartEndY})]})]})]})]})}var rj=r(81593),ry=r(23004),rk=r(48230),rN=r.n(rk);let r_=[{src:"/images/team/stiven.png",alt:"Stiven Morvan, co-founder and CTO of Dough"},{src:"/images/team/faheem.png",alt:"Faheem Kajee, co-founder and CEO of Dough"},{src:"/images/team/thomas.png",alt:"Thomas, Dough team"},{src:"/images/team/jonathan.jpg",alt:"Jonathan, Dough team"}];function rC(e){let{src:t,alt:r,zIndex:n}=e,[s,l]=(0,h.useState)(!1);return(0,a.jsx)("span",{className:"relative -ml-2.5 block h-11 w-11 overflow-hidden rounded-full border-[2.5px] border-[#fdf9f4] bg-gradient-to-br from-[#efe3d4] to-[#dfcbb4] first:ml-0",style:{zIndex:n},children:s?(0,a.jsx)("span",{className:"flex h-full w-full items-center justify-center",children:(0,a.jsx)(ry.A,{className:"h-4 w-4 text-[#a8916f]",strokeWidth:1.75})}):(0,a.jsx)(p(),{src:t,alt:r,fill:!0,sizes:"44px",className:"object-cover object-top",onError:()=>l(!0)})})}function rI(){return(0,a.jsxs)("div",{className:"mx-auto mt-16 w-full max-w-3xl px-4 text-center",children:[(0,a.jsxs)("p",{className:"mb-4 inline-flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-[0.22em] text-[#ff6a3d]",children:[(0,a.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-[#ff6a3d]"}),"Who's behind this"]}),(0,a.jsx)("div",{className:"isolate flex justify-center",children:r_.map((e,t)=>(0,a.jsx)(rC,{src:e.src,alt:e.alt,zIndex:r_.length-t},e.src))}),(0,a.jsxs)("p",{className:"mx-auto mt-4 max-w-sm text-[15px] font-bold leading-normal text-foreground",style:{fontFamily:'"Plus Jakarta Sans", sans-serif'},children:["Founders who scaled a $40M brand and shipped ",(0,a.jsx)("span",{className:"text-foreground
1/60",children:"Google's Gemini"}),", now building for you."]}),(0,a.jsxs)(rN(),{href:"/about",className:"mt-3 inline-flex items-center gap-1.5 text-sm font-semibold text-[#ff6a3d] transition-colors hover:text-[#e5522a]",children:["Meet the team",(0,a.jsx)(X.A,{className:"h-4 w-4"})]})]})}function rS(){let e=document.querySelector("textarea");e?(e.scrollIntoView({behavior:"smooth",block:"center"}),e.focus({preventScroll:!0})):window.scrollTo({top:0,behavior:"smooth"})}let rA=[{num:1,title:"Imagine anything",desc:"Describe your idea in a few words.",visual:function(){return(0,a.jsxs)("div",{className:"relative flex h-[150px] items-center justify-center",children:[(0,a.jsx)(t1.A,{className:"absolute right-7 top-5 h-7 w-7 rotate-12 fill-[#ff8a3d] text-[#ff8a3d] drop-shadow-[0_4px_8px_rgba(255,106,61,0.4)]"}),(0,a.jsx)(t1.A,{className:"absolute left-9 bottom-7 h-3.5 w-3.5 fill-[#ffb38a] text-[#ffb38a]"}),(0,a.jsx)("div",{className:"-rotate-3 rounded-2xl bg-white px-4 py-3 shadow-[0_18px_34px_-14px_rgba(120,80,40,0.5)] ring-1 ring-black/5",children:(0,a.jsxs)("span",{className:"flex items-center gap-2 text-[13px] font-semibold leading-snug text-[#2a2018]",children:[(0,a.jsx)(s.A,{className:"h-4 w-4 shrink-0 text-[#ff6a3d]"}),"Energy gummies",(0,a.jsx)("br",{}),"for gamers"]})})]})}},{num:2,title:"We manufacture it",desc:"AI creates your brand and finds the right manufacturers.",visual:function(){return(0,a.jsxs)("div",{className:"relative flex h-[150px] items-end justify-center gap-2.5",children:[(0,a.jsx)("div",{className:"relative h-[140px] w-[100px]",children:(0,a.jsx)(p(),{src:"/images/fitchews_onboarding.png",alt:"FitChew protein gummies",fill:!0,sizes:"100px",className:"object-contain object-bottom drop-shadow-[0_14px_18px_rgba(41,31,24,0.3)] transition-transform duration-500 group-hover:-translate-y-0.5"})}),(0,a.jsxs)("div",{className:"mb-3 flex flex-col gap-2",children:[(0,a.jsx)("span",{className:"flex h-9 w-9 items-center justify-center rounded-xl bg-white text-[#ff6a3d] shadow-[0_6px_14px_-6px_rgba(120,80,40,0.55)] ring-1 ring-black/5",children:(0,a.jsx)(t2.A,{className:"h-[18px] w-[18px]",strokeWidth:1.75})}),(0,a.jsx)("span",{className:"flex h-9 w-9 items-center justify-center rounded-xl bg-white text-[#c98c4e] shadow-[0_6px_14px_-6px_rgba(120,80,40,0.55)] ring-1 ring-black/5",children:(0,a.jsx)(t5.A,{className:"h-[18px] w-[18px]",strokeWidth:1.75})})]})]})}},{num:3,title:"We launch it",desc:"Your store goes live with everything ready.",visual:function(){return(0,a.jsxs)("div",{className:"relative flex h-[150px] items-end justify-center",children:[(0,a.jsx)("div",{className:"absolute bottom-1 h-3 w-28 rounded-[100%] bg-[#e7d6c4]/70 blur-[1px]","aria-hidden":"true"}),(0,a.jsx)("div",{className:"relative mb-2 w-[116px] rounded-[1.4rem] bg-[#141414] p-[5px] shadow-[0_20px_34px_-14px_rgba(41,31,24,0.55)] ring-1 ring-black/10",children:(0,a.jsxs)("div",{className:"overflow-hidden rounded-[1.05rem] bg-white",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-2.5 py-1.5",children:[(0,a.jsx)("span",{className:"text-[8px] font-extrabold tracking-tight text-[#2a2018]",children:"FitChew"}),(0,a.jsx)(t4.A,{className:"h-2.5 w-2.5 text-[#2a2018]"})]}),(0,a.jsxs)("div",{className:"relative h-[74px] bg-gradient-to-b from-[#fff4ec] to-[#ffe6da]",children:[(0,a.jsxs)("span",{className:"absolute left-2 top-1.5 z-10 text-[9px] font-extrabold leading-[1.05] text-[#2a2018]",children:["Focus.",(0,a.jsx)("br",{}),"Energy."]}),(0,a.jsx)(p(),{src:"/images/fitchews_onboarding.png",alt:"",fill:!0,sizes:"116px",className:"object-contain p-1"})]}),(0,a.jsx)("div",{className:"px-2.5 pb-2.5 pt-2",children:(0,a.jsx)("span",{className:"block w-full rounded-full bg-[#ff6a3d] py-1 text-center text-[8px] font-bold text-white",children:"Shop now"})})]})})]})}},{num:4,title:"We grow it",desc:"AI agents run ads, optimize and grow your revenue.",visual:function(){return(0,a.jsx)("div",{className:"flex h-[150px] items-center",children:(0,a.jsxs)("div",{className:"w-full rounded-xl bg-white/85 p-3 shadow-[0_12px_26px_-14px_rgba(120,80,40,0.4)] ring-1 ring-black/5 backdrop-blur-sm",children:[(0,a.jsx)("div",{className:"text-[10px] font-medium text-foreground
1/45",children:"Total revenue"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-xl font-extrabold tracking-tight text-[#2a2018]",children:"$96,739"}),(0,a.jsx)("span",{className:"rounded-full bg-[#1f9d55]/10 px-1.5 py-0.5 text-[10px] font-bold text-[#1f9d55]",children:"â² 285%"})]}),(0,a.jsx)("div",{className:"text-[9px] text-foreground/40",children:"vs last 30 days"}),(0,a.jsxs)("svg",{viewBox:"0 0 200 56",preserveAspectRatio:"none",className:"mt-2 h-11 w-full","aria-hidden":"true",children:[(0,a.jsx)("title",{children:"Revenue trend"}),(0,a.jsx)("defs",{children:(0,a.jsxs)("linearGradient",{id:"v3GrowArea",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,a.jsx)("stop",{offset:"0%",stopColor:"#ff6a3d",stopOpacity:"0.32"}),(0,a.jsx)("stop",{offset:"100%",stopColor:"#ff6a3d",stopOpacity:"0"})]})}),(0,a.jsx)("path",{d:"M0 48 L25 44 L50 46 L75 35 L100 38 L125 25 L150 28 L175 13 L200 6 L200 56 L0 56 Z",fill:"url(#v3GrowArea)"}),(0,a.jsx)("path",{d:"M0 48 L25 44 L50 46 L75 35 L100 38 L125 25 L150 28 L175 13 L200 6",fill:"none",stroke:"#ff6a3d",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,a.jsx)("circle",{cx:"200",cy:"6",r:"3.5",fill:"#ff6a3d"})]})]})})}}];function rP(){return(0,a.jsx)("div",{className:"flex flex-col gap-3 md:flex-row md:items-stretch md:gap-0",children:rA.map((e,t)=>{let r=e.visual;return(0,a.jsxs)(h.Fragment,{children:[(0,a.jsxs)("div",{className:"group flex flex-1 flex-col rounded-[1.4rem] border border-[#f1e6d9] bg-[#fdf7f1]/85 p-5 shadow-[0_16px_38px_-20px_rgba(120,80,40,0.5)] backdrop-blur-sm",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,a.jsx)("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-gradient-to-br from-[#ff8a4d] to-[#ff5a1f] text-[13px] font-bold text-white shadow-[0_5px_12px_-3px_rgba(255,106,61,0.65)]",children:e.num}),(0,a.jsx)("h3",{className:"text-lg font-bold text-[#2a2018]",style:{fontFamily:'"Plus Jakarta Sans", sans-serif'},children:e.title})]}),(0,a.jsx)("p",{className:"mt-2 text-[13px] leading-snug text-[#8a7a68]",children:e.desc}),(0,a.jsx)("div",{className:"mt-auto pt-5",children:(0,a.jsx)(r,{})})]}),t<rA.length-1&&(0,a.jsx)("div",{className:"hidden shrink-0 items-center justify-center md:flex md:px-1.5",children:(0,a.jsx)("span",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-white text-[#ff6a3d] shadow-md ring-1 ring-[#ff6a3d]/15",children:(0,a.jsx)(X.A,{className:"h-4 w-4",strokeWidth:2.25})})})]},e.num)})})}let rE=[{icon:t3.A,headline:"Vetted & certified suppliers",description:"Every supplier in our network is verified for quality, reliability, and ethical manufacturing."},{icon:ed.A,headline:"Order samples before committing",description:"See and feel your product before placing a bulk order. No surprises."},{icon:t7.A,headline:"No upfront investment",description:"Start selling and prove demand before committing to a production run. Manufacture only what you need."},{icon:s.A,headline:"Idea to storefront in minutes",description:"AI handles branding, design, sourcing, and pricing. You focus on the vision."},{icon:t6.A,headline:"Your idea stays yours",description:"You keep full ownership and IP of everything you create. Dough builds it, you own the brand."},{icon:t8.A,headline:"Growth on autopilot",description:"AI agents run your ads and content, optimizing as you scale so sales keep compounding."}];function rT(){let{preFooter:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,h.useRef)([]),r=(0,h.useCallback)((e,r)=>{t.current[r]=e},[]);(0,h.useEffect)(()=>{let e=new IntersectionObserver(t=>{for(let r of t)if(r.isIntersecting){let t=r.target;t.style.opacity="1",t.style.transform="translateY(0)",e.unobserve(t)}},{threshold:.1});for(let r of t.current)r&&e.observe(r);return()=>e.disconnect()},[]);let[n,s]=(0,h.useState)("flow"),[l,i]=(0,h.useState)(0);return(0,a.jsxs)("div",{className:"w-full",children:[(0,a.jsxs)("div",{className:"w-full max-w-5xl mx-auto mt-[30px]",children:[(0,a.jsxs)("div",{className:"text-center mb-6 md:mb-8",children:[(0,a.jsxs)("h2",{className:"mt-2.5 text-[1.7rem] md:text-[2.15rem] leading-[1.1] font-bold text-foreground",style:{fontFamily:'"Plus Jakarta Sans", sans-serif'},children:["Four steps."," ",(0,a.jsx)("span",{className:"font-medium italic text-[#ff6a3d]",style:{fontFamily:'"Lora", serif'},children:"Zero guesswork."})]}),!1]}),"flow"===n?(0,a.jsx)(rw,{}):(0,a.jsx)(rP,{})]}),(0,a.jsx)("div",{ref:e=>r(e,0),className:"-mx-4 mt-24 md:-mx-5 md:mt-32",style:{opacity:0,transform:"translateY(1rem)",transition:"opacity 0.5s ease-out 100ms, transform 0.5s ease-out 100ms"},children:(0,a.jsx)(rd,{})}),(0,a.jsxs)("div",{ref:e=>r(e,1),className:"w-full max-w-3xl mx-auto backdrop-blur-xl bg-white/45 border border-white/40 rounded-3xl mt-16 pt-10 pb-12 px-5",style:{opacity:0,transform:"translateY(1rem)",transition:"opacity 0.5s ease-out 100ms, transform 0.5s ease-out 100ms"},children:[(0,a.jsxs)("div",{className:"text-center mb-6",children:[(0,a.jsxs)("p",{className:"mb-2 inline-flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-[0.22em] text-[#ff6a3d]",children:[(0,a.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-[#ff6a3d]"}),"Why Dough"]}),(0,a.jsxs)("h2",{className:"text-2xl md:text-3xl font-bold text-foreground",style:{fontFamily:'"Plus Jakarta Sans", sans-serif'},children:["Built for"," ",(0,a.jsx)("span",{className:"font-medium italic text-[#ff6a3d]",style:{fontFamily:'"Lora", serif'},children:"first-time founders"})]})]}),(0,a.jsx)("div",{className:"grid grid-cols-1 gap-2.5 md:grid-cols-2 md:gap-4",children:rE.map((e,t)=>{let r=e.icon,n=l===t;return(0,a.jsxs)("button",{type:"button",onClick:()=>i(n?null:t),"aria-expanded":n,className:"rounded-xl bg-white/10 backdrop-blur-sm border border-[#ff6a3d]/10 px-5 py-4 flex items-start gap-4 text-left md:cursor-default",children:[(0,a.jsx)("div",{className:"mt-0.5 shrink-0 rounded-lg bg-[#ff6a3d]/10 p-2",children:(0,a.jsx)(r,{className:"h-5 w-5 text-[#ff6a3d]"})}),(0,a.jsxs)("div",{className:"flex flex-col gap-1 min-w-0 flex-1",children:[(0,a.jsxs)("span",{className:"flex items-center justify-between gap-2 text-sm font-semibold text-foreground min-h-9 md:min-h-0",children:[e.headline,(0,a.jsx)(el.A,{className:"h-4 w-4 shrink-0 text-foreground
1/40 transition-transform duration-300 md:hidden ".concat(n?"rotate-180":"")})]}),(0,a.jsx)("span",{className:"grid transition-[grid-template-rows] duration-300 ease-out ".concat(n?"grid-rows-[1fr]":"grid-rows-[0fr]"," md:grid-rows-[1fr]"),children:(0,a.jsx)("span",{className:"overflow-hidden text-sm text-foreground/70 leading-snug transition-opacity duration-300 ".concat(n?"opacity-100":"opacity-0"," md:opacity-100"),children:e.description})})]})]},e.headline)})})]}),(0,a.jsx)(rI,{}),(0,a.jsx)("div",{className:"w-full max-w-3xl mx-auto mt-16",children:(0,a.jsxs)("div",{className:"relative overflow-hidden rounded-3xl border border-[#ff6a3d]/15 bg-gradient-to-br from-[#1d1410] via-[#241710] to-[#1d1410] px-6 py-12 md:px-14 md:py-16 text-center",children:[(0,a.jsx)("div",{className:"pointer-events-none absolute -top-20 left-1/2 h-56 w-56 -translate-x-1/2 rounded-full bg-[#ff6a3d]/25 blur-3xl","aria-hidden":"true"}),(0,a.jsxs)("div",{className:"relative mb-8 flex items-center justify-center gap-3",children:[(0,a.jsx)("div",{className:"flex -space-x-2.5",children:[{label:"Coffee",icon:t9.A},{label:"Apparel",icon:re.A},{label:"Beauty",icon:rt.A},{label:"Snacks",icon:rr.A},{label:"Wellness",icon:ty.A}].map((e,t)=>{let r=e.icon;return(0,a.jsx)("span",{className:"flex h-9 w-9 items-center justify-center rounded-full bg-white/[0.08] text-white/70 ring-1 ring-white/15 backdrop-blur-sm",style:{opacity:.55+.09*t},children:(0,a.jsx)(r,{className:"h-4 w-4",strokeWidth:1.75})},e.label)})}),(0,a.jsx)(X.A,{className:"h-4 w-4 shrink-0 text-[#ff6a3d]"}),(0,a.jsx)("span",{className:"flex h-12 w-12 shrink-0 items-center justify-center rounded-2xl bg-gradient-to-br from-[#ff6a3d] to-[#ff9269] text-white shadow-[0_10px_28px_-8px_rgba(255,106,61,0.8)] ring-1 ring-white/25",children:(0,a.jsx)(t2.A,{className:"h-6 w-6",strokeWidth:1.75})})]}),(0,a.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-[0.24em] text-[#ff6a3d]",children:"Our Mission"}),(0,a.jsxs)("h2",{className:"mt-3 text-[1.7rem] md:text-[2.3rem] leading-[1.12] font-bold text-white",style:{fontFamily:'"Plus Jakarta Sans", sans-serif'},children:["The"," ",(0,a.jsx)("span",{className:"font-medium italic text-[#ff8a3d]",style:{fontFamily:'"Lora", serif'},children:"everything factory"})]}),(0,a.jsx)("p",{className:"mx-auto mt-4 max-w-xl text-[13.5px] md:text-sm leading-relaxed text-white/65",children:"One front door to any manufacturable good on earth. Want a drink in a specific flavor and bottle? We connect you to the maker who already produces it. No factories to find, no suppliers to vet, no minimums to gamble on. Just describe it, and we bring it to life. You stay the founder with the vision. We become the factory behind it."}),(0,a.jsxs)("p",{className:"mt-6 text-base md:text-lg font-bold text-white",style:{fontFamily:'"Plus Jakarta Sans", sans-serif'},children:["One entry point. ",(0,a.jsx)("span",{className:"text-[#ff8a3d]",children:"Any product."})]}),(0,a.jsxs)("button",{type:"button",onClick:rS,className:"mt-9 inline-flex items-center gap-2 rounded-full bg-[#ff6a3d] px-8 py-3.5 text-[0.95rem] font-semibold text-white shadow-[0_10px_30px_-8px_rgba(255,106,61,0.7)] transition-all duration-200 hover:-translate-y-0.5 hover:bg-[#ff8f6b] hover:shadow-[0_14px_36px_-8px_rgba(255,106,61,0.85)]",children:["Start now",(0,a.jsx)(X.A,{className:"h-4 w-4"})]})]})}),e,(0,a.jsx)(rj.p,{showCta:!1})]})}var rL=r(42890),rD=r(77638),rM=r(96652),rR=r(73917),rO=r(35035),rF=r(10455);let rq=[{label:"Non-alcoholic mixers",icon:t9.A},{label:"Wellness supplements",icon:rD.A},{label:"Energy drinks",icon:t7.A},{label:"Herbal tea blends",icon:s.A}];function rU(e){let{open:t,onOpenChange:r,suggestion:n,onTrySuggestion:s}=e;return(0,a.jsx)(ew.lG,{open:t,onOpenChange:r,children:(0,a.jsxs)(ew.Cf,{className:"max-w-md p-0 overflow-y-auto border-amber-200/60 dark:border-amber-800/40",children:[(0,a.jsxs)("div",{className:"relative bg-gradient-to-br from-amber-50 via-orange-50 to-amber-100 dark:from-amber-950/40 dark:via-orange-950/30 dark:to-amber-900/20 p-6 pb-5",children:[(0,a.jsx)("div",{className:"absolute -top-10 -right-10 w-32 h-32 bg-gradient-to-br from-amber-300/40 to-orange-300/20 dark:from-amber-500/20 dark:to-orange-500/10 rounded-full blur-2xl"}),(0,a.jsxs)("div",{className:"relative flex items-start gap-3",children:[(0,a.jsx)("div",{className:"flex-shrink-0 w-11 h-11 rounded-xl bg-gradient-to-br from-amber-400 to-orange-500 dark:from-amber-500 dark:to-orange-600 flex items-center justify-center shadow-lg shadow-amber-500/25",children:(0,a.jsx)(rM.A,{className:"h-5 w-5 text-white"})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0 pt-0.5",children:[(0,a.jsx)(ew.L3,{className:"text-lg font-semibold text-amber-950 dar
1k:text-amber-100",children:"Regulated Product Category"}),(0,a.jsx)(ew.rr,{className:"text-amber-800/80 dark:text-amber-200/70 text-sm mt-1 leading-relaxed",children:"Alcohol, cannabis, and prescription drugs have complex legal requirements that vary by region."})]})]})]}),(0,a.jsxs)("div",{className:"p-6 pt-4 space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-center gap-4 py-4 rounded-xl bg-gradient-to-r from-amber-50 to-orange-50/50 dark:from-amber-950/30 dark:to-orange-950/20 border border-amber-200/50 dark:border-amber-700/30",children:[(0,a.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,a.jsx)("div",{className:"w-12 h-12 rounded-xl bg-white dark:bg-white/10 border border-amber-200/60 dark:border-amber-700/30 flex items-center justify-center",children:(0,a.jsx)(rR.A,{className:"h-6 w-6 text-amber-600 dark:text-amber-400"})}),(0,a.jsx)("span",{className:"text-xs font-medium text-amber-700 dark:text-amber-300",children:"Alcohol"})]}),(0,a.jsx)("div",{className:"w-px h-14 bg-amber-200 dark:bg-amber-700/50"}),(0,a.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,a.jsx)("div",{className:"w-12 h-12 rounded-xl bg-white dark:bg-white/10 border border-amber-200/60 dark:border-amber-700/30 flex items-center justify-center",children:(0,a.jsx)(rO.A,{className:"h-6 w-6 text-amber-600 dark:text-amber-400"})}),(0,a.jsx)("span",{className:"text-xs font-medium text-amber-700 dark:text-amber-300",children:"Cannabis"})]}),(0,a.jsx)("div",{className:"w-px h-14 bg-amber-200 dark:bg-amber-700/50"}),(0,a.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,a.jsx)("div",{className:"w-12 h-12 rounded-xl bg-white dark:bg-white/10 border border-amber-200/60 dark:border-amber-700/30 flex items-center justify-center",children:(0,a.jsx)(rF.A,{className:"h-6 w-6 text-amber-600 dark:text-amber-400"})}),(0,a.jsx)("span",{className:"text-xs font-medium text-amber-700 dark:text-amber-300",children:"Rx Drugs"})]})]}),(0,a.jsxs)("div",{className:"text-sm space-y-2",children:[(0,a.jsx)("p",{className:"font-medium text-amber-800 dark:text-amber-200",children:"Why these are restricted:"}),(0,a.jsxs)("ul",{className:"space-y-1.5 text-amber-700/80 dark:text-amber-300/70",children:[(0,a.jsxs)("li",{className:"flex items-start gap-2",children:[(0,a.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 dark:bg-amber-500 mt-1.5 flex-shrink-0"}),(0,a.jsx)("span",{children:"Age verification requirements"})]}),(0,a.jsxs)("li",{className:"flex items-start gap-2",children:[(0,a.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 dark:bg-amber-500 mt-1.5 flex-shrink-0"}),(0,a.jsx)("span",{children:"Licensing and permits vary by jurisdiction"})]}),(0,a.jsxs)("li",{className:"flex items-start gap-2",children:[(0,a.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 dark:bg-amber-500 mt-1.5 flex-shrink-0"}),(0,a.jsx)("span",{children:"Shipping restrictions across state/country lines"})]})]})]}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-amber-800 dark:text-amber-200",children:"Try these alternatives instead:"}),(0,a.jsx)("div",{className:"grid grid-cols-2 gap-2",children:rq.map(e=>{let{label:t,icon:n}=e;return(0,a.jsxs)("button",{onClick:()=>{null==s||s(t),r(!1)},className:"group relative flex items-center gap-2.5 p-3 rounded-xl bg-white dark:bg-white/5 border border-amber-200/60 dark:border-amber-700/30 hover:border-amber-400 dark:hover:border-amber-500/50 hover:bg-amber-50 dark:hover:bg-amber-900/20 transition-all duration-200 hover:shadow-md hover:shadow-amber-100/50 dark:hover:shadow-amber-900/20",children:[(0,a.jsx)("div",{className:"flex-shrink-0 w-8 h-8 rounded-lg bg-gradient-to-br from-amber-100 to-orange-100 dark:from-amber-800/40 dark:to-orange-800/30 flex items-center justify-center",children:(0,a.jsx)(n,{className:"w-4 h-4 text-amber-600 dark:text-amber-400"})}),(0,a.jsx)("span",{className:"text-sm font-medium text-amber-900 dark:text-amber-100 flex-1 text-left",children:t}),(0,a.jsx)(X.A,{className:"w-3.5 h-3.5 text-amber-400 dark:text-amber-500 opacity-0 -translate-x-1 group-hover:opacity-100 group-hover:translate-x-0 transition-all duration-200"})]},t)})})]}),(0,a.jsx)(w.$,{variant:"outline",onClick:()=>r(!1),className:"w-full mt-2 border-amber-300 dark:border-amber-700 hover:bg-amber-100 dar
1k:hover:bg-amber-900/30 text-amber-800 dark:text-amber-100 hover:text-amber-900 dark:hover:text-amber-50",children:"Got it"})]})]})})}let rz=[{question:"What is Dough?",answer:"Dough turns a text prompt into a real physical-product brand. AI helps design the product, packaging, branding, and storefront, then Dough coordinates manufacturing and fulfillment with tools for growth."},{question:"Who makes Dough?",answer:"Dough is built by Dough, Inc., a company based in New York, NY, founded by Faheem Kajee and Stiven Morvan. The product lives at dough.do and is not affiliated with other companies that share the name Dough."},{question:"Is Dough a legitimate company?",answer:"Yes. Dough is operated by Dough, Inc., based in New York, NY, founded by Faheem Kajee and Stiven Morvan and backed by Lifelike Capital and Hawke Media. Payments are processed by Stripe, pre-order funds are held in escrow, and the published terms and privacy policy govern every order. Full company details, including the domain history and why the .do registry redacts WHOIS contact fields, are at dough.do/company."},{question:"Is this just dropshipping?",answer:"No. Dough supports both catalog products and custom product development, centered on launching a branded product and storefront rather than only listing a supplier item."},{question:"Who owns the business I create?",answer:"You do, 100%. Dough doesn't take equity. Your brand, products, revenue, and customer list are entirely yours."},{question:"How fast can I validate demand?",answer:"You can publish a storefront and collect waitlist signups or pre-orders before committing to production. Pre-order funds are held in escrow, and customers are refunded if the threshold is not met or the product cannot be delivered."},{question:"How much does Dough cost?",answer:"One plan at $29/month plus a share of what you sell. No setup fee, and you own your brand 100%."}];function rW(){return(0,a.jsxs)("section",{className:"mx-auto mt-8 w-full max-w-3xl rounded-3xl border border-white/50 bg-white/55 px-6 py-8 text-center shadow-[0_16px_38px_-24px_rgba(41,31,24,0.4)] backdrop-blur-md md:px-10 md:py-10","aria-labelledby":"what-is-dough",children:[(0,a.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-[0.22em] text-[#ff6a3d]",children:"What is Dough?"}),(0,a.jsx)("h2",{id:"what-is-dough",className:"mt-2 text-2xl font-bold tracking-tight text-foreground md:text-3xl",style:{fontFamily:'"Plus Jakarta Sans", sans-serif'},children:"An AI platform for building a real physical-product brand"}),(0,a.jsx)("p",{className:"mx-auto mt-4 max-w-2xl text-sm leading-relaxed text-foreground/65 md:text-base",children:"Describe a product idea and Dough helps design the product, packaging, brand, and storefront. From there, Dough connects the work of sampling, manufacturing, launching, and fulfillment so a founder can move from prompt to product in one place."}),(0,a.jsxs)("div",{className:"mt-5 flex flex-wrap items-center justify-center gap-x-5 gap-y-2 text-sm font-semibold",children:[(0,a.jsx)(rN(),{href:"/pricing",className:"text-[#ff6a3d] hover:underline",children:"See pricing"}),(0,a.jsx)(rN(),{href:"/mcp",className:"text-[#ff6a3d] hover:underline",children:"Use Dough with AI agents"})]})]})}function rY(){return(0,a.jsxs)("section",{className:"mx-auto mt-16 w-full max-w-3xl rounded-3xl border border-white/50 bg-white/55 px-5 py-9 shadow-[0_16px_38px_-24px_rgba(41,31,24,0.4)] backdrop-blur-md md:px-10 md:py-12","aria-labelledby":"homepage-faq",children:[(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-[0.22em] text-[#ff6a3d]",children:"The essentials"}),(0,a.jsx)("h2",{id:"homepage-faq",className:"mt-2 text-2xl font-bold tracking-tight text-foreground md:text-3xl",style:{fontFamily:'"Plus Jakarta Sans", sans-serif'},children:"Frequently asked questions"})]}),(0,a.jsx)("dl",{className:"mt-7 divide-y divide-black/[0.06]",children:rz.map(e=>(0,a.jsxs)("div",{className:"grid gap-2 py-5 first:pt-0 last:pb-0 md:grid-cols-[0.85fr_1.35fr] md:gap-8",children:[(0,a.jsx)("dt",{className:"text-sm font-bold leading-relaxed text-foreground",children:e.question}),(0,a.jsx)("dd",{className:"text-sm leading-relaxed text-foreground
1/60",children:e.answer})]},e.question))})]})}var rB=r(18168),rG=r(42260),rV=r(1608);function r$(e,t){return!(0,tt.F$)(e.type,t)}function rH(e,t){return r$(e,t)&&!(0,rV.$Z)(e.type)&&e.options.length>1}function rJ(e,t){return e.some(e=>rH(e,t))}let rK=e=>e.trim().toLowerCase();function rQ(e){let{open:t,axes:r,primaryVariantId:n,defaultOffers:s,variants:l,submitting:i,onOfferedIdsChange:o,className:d}=e,c=(0,h.useMemo)(()=>(0,tt.iU)(l),[l]),u=(0,h.useMemo)(()=>{let e=l.find(e=>e.variantId===n);return e?(0,e3.TV)(e.options).axes:{}},[l,n]),m=(0,h.useMemo)(()=>{var e,t;let a={};for(let e of r)a[e.type]=new Set;for(let t of s)for(let[r,n]of Object.entries(t.combination)){let t=r.toLowerCase();(null!=(e=a[t])?e:a[t]=new Set).add(rK(n))}for(let e of r)if(rH(e,c)){let t=u[e.type];a[e.type]=new Set(t?[rK(t)]:[])}for(let[e,r]of Object.entries(u))(null!=(t=a[e])?t:a[e]=new Set).add(rK(r));for(let e of r)if(!r$(e,c)){let t=u[e.type];a[e.type]=new Set(t?[rK(t)]:[])}return a},[r,s,u,c]),[p,f]=(0,h.useState)(m);(0,h.useEffect)(()=>{t&&f(r0(m))},[t,m]);let x=(e,t)=>{var r;return rK(null!=(r=u[e.type])?r:"")===rK(t)},g=(0,h.useMemo)(()=>r.filter(e=>rH(e,c)),[r,c]),b=(0,h.useMemo)(()=>l.filter(e=>{let t=(0,e3.TV)(e.options).axes;return r.every(e=>{var r,a;let n=t[e.type];return void 0===n||null!=(a=null==(r=p[e.type])?void 0:r.has(rK(n)))&&a})}).map(e=>e.variantId),[l,r,p]);(0,h.useEffect)(()=>{null==o||o(b)},[b,o]);let v=(e,t)=>(0,rV.$Z)(e.type)?(0,rV.hb)(t.value,t.label):t.label,w=(e,t)=>{var r,n;let s=null!=(n=null==(r=p[e.type])?void 0:r.has(rK(t.value)))&&n;return(0,a.jsxs)("button",{type:"button",onClick:()=>{var r,a;return r=e.type,a=t.value,void(!i&&f(e=>{var t;let n=r0(e),s=null!=(t=n[r])?t:new Set,l=rK(a);if(s.has(l)){if(s.size<=1)return e;s.delete(l)}else s.add(l);return n[r]=s,n}))},disabled:i,"aria-pressed":s,title:s?"".concat(t.label," (offered)"):"Offer ".concat(t.label),className:(0,eh.cn)("inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1.5 text-sm transition-colors disabled:cursor-not-allowed disabled:opacity-60",s?"border-amber-500 bg-amber-500/15 font-medium text-foreground":"border-dashed border-border bg-background text-muted-foreground hover:border-foreground
1/40 hover:text-foreground"),children:[(0,a.jsx)(rX,{axisType:e.type,option:t}),(0,a.jsx)("span",{children:v(e,t)}),s?(0,a.jsx)(tA.A,{className:"h-3.5 w-3.5 text-amber-600","aria-hidden":!0}):(0,a.jsx)(ts.A,{className:"h-3.5 w-3.5 opacity-70","aria-hidden":!0})]},t.value)};return(0,a.jsx)("div",{className:(0,eh.cn)("space-y-3",d),children:0===r.length?(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,a.jsx)(em.A,{className:"h-4 w-4 animate-spin"}),"Loading optionsâ¦"]}):0===g.length?(0,a.jsx)("p",{className:"rounded-lg border border-border bg-muted/20 px-4 py-6 text-center text-sm text-muted-foreground",children:"This product ships in a single configuration. There's nothing for shoppers to choose."}):g.map(e=>{let t=e.options.find(t=>x(e,t.value)),r=e.options.filter(t=>!x(e,t.value)),n=t=>{var r,a;return null!=(a=null==(r=p[e.type])?void 0:r.has(rK(t.value)))&&a},s=r.filter(n),l=r.filter(e=>!n(e)),i=e.options.filter(t=>{var r;return null==(r=p[e.type])?void 0:r.has(rK(t.value))}).length;return(0,a.jsxs)("section",{className:"rounded-xl border border-border bg-card p-4",children:[(0,a.jsxs)("div",{className:"flex items-baseline justify-between gap-2",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:e.label}),(0,a.jsxs)("span",{className:"text-[11px] text-muted-foreground tabular-nums",children:[i," of ",e.options.length," offered"]})]}),(0,a.jsxs)("div",{className:"mt-2.5 flex flex-wrap items-center gap-1.5",children:[t&&(0,a.jsxs)("span",{className:"inline-flex items-center gap-2 rounded-full border border-amber-500/60 bg-amber-500/10 py-1.5 pl-2 pr-2.5",children:[(0,a.jsx)(rX,{axisType:e.type,option:t}),(0,a.jsx)("span",{className:"text-sm font-medium text-foreground",children:v(e,t)}),(0,a.jsx)(th.E,{variant:"secondary",className:"h-5 rounded-full px-2 text-[10px] font-semibold uppercase tracking-wide",children:"Default"})]}),s.map(t=>w(e,t))]}),l.length>0&&(0,a.jsx)("div",{className:"mt-2.5 flex flex-wrap items-center gap-1.5 border-t border-border/60 pt-2.5",children:l.map(t=>w(e,t))})]},e.type)})})}function rZ(e){let{open:t,onOpenChange:r,productTitle:n,axes:s,primaryVariantId:l,defaultOffers:i,variants:o,onConfirm:d,submitting:c}=e,[u,m]=(0,h.useState)([]);return(0,a.jsx)(ew.lG,{open:t,onOpenChange:e=>{c||r(e)},children:(0,a.jsxs)(ew.Cf,{className:"max-w-xl p-0 gap-0 flex flex-col max-h-[calc(100dvh-2rem)] overflow-hidden",children:[(0,a.jsxs)(ew.c7,{className:"px-6 pt-5 pb-3 border-b shrink-0",children:[(0,a.jsxs)(ew.L3,{className:"flex items-center gap-2",children:[(0,a.jsx)(ed.A,{className:"h-5 w-5"}),"What should shoppers be able to choose?"]}),(0,a.jsxs)(ew.rr,{children:["Your ",n," ships in the default option on each row. Turn on extra values to let shoppers choose them. Only in-stock choices are shown."]})]}),(0,a.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto p-5",children:(0,a.jsx)(rQ,{open:t,axes:s,primaryVariantId:l,defaultOffers:i,variants:o,submitting:c,onOfferedIdsChange:m})}),(0,a.jsxs)("div",{className:"shrink-0 flex items-center justify-between gap-3 px-5 py-3 border-t bg-muted/20",children:[(0,a.jsxs)("span",{className:"text-xs text-muted-foreground",children:[u.length," variant",1===u.length?"":"s"," will be sold"]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("button",{type:"button",onClick:()=>r(!1),disabled:c,className:"px-4 py-2 rounded-full text-sm font-medium text-muted-foreground hover:text-foreground transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:"Cancel"}),(0,a.jsxs)("button",{type:"button",onClick:()=>{c||0===u.length||d(u)},disabled:c||0===u.length,className:(0,eh.cn)("px-4 py-2 rounded-full text-sm font-medium transition-colors flex items-center gap-2",c||0===u.length?"bg-muted text-muted-foreground cursor-not-allowed":"bg-gradient-to-r from-amber-500 to-amber-600 text-white hover:from-amber-600 hover:to-amber-700 shadow-[0_6px_20px_rgba(245,158,11,0.3)]"),children:[c&&(0,a.jsx)(em.A,{className:"h-3.5 w-3.5 animate-spin"}),"Confirm"]})]})]})]})})}function rX(e){let{axisType:t,option:r}=e;if(r.imageUrl)return(0,a.jsx)("span",{className:"h-4 w-4 shrink-0 overflow-hidden rounded-full border border-black/10",children:(0,a.jsx)(rG.A,{src:r.imageUrl,alt:"",className:"h-full w-full object-cover"})});let n=(0,rV.M7)(t,r);
1return"swatch"===n.kind?(0,a.jsx)("span",{"aria-hidden":!0,className:"h-4 w-4 shrink-0 rounded-full border border-black/10",style:{backgroundColor:n.hex}}):"emoji"===n.kind?(0,a.jsx)("span",{"aria-hidden":!0,className:"text-[15px] leading-none",children:n.char}):(0,a.jsx)("span",{"aria-hidden":!0,className:"h-2 w-2 shrink-0 rounded-full bg-muted-foreground/40"})}function r0(e){let t={};for(let[r,a]of Object.entries(e))t[r]=new Set(a);return t}let r1=[{src:"/images/product_examples/shirt.webp",top:"31%",tilt:"-15deg",inset:"-36px",size:{width:88,height:110}},{src:"/images/product_examples/coffee.webp",top:"50%",tilt:"-6deg",inset:"-60px",size:{width:104,height:130}},{src:"/images/product_examples/gummies.webp",top:"69%",tilt:"-19deg",inset:"-34px",size:{width:80,height:100}}],r2=[{src:"/images/product_examples/serum.webp",top:"32%",tilt:"14deg",inset:"-36px",size:{width:88,height:110}},{src:"/images/product_examples/can2.webp",top:"51%",tilt:"6deg",inset:"-60px",size:{width:104,height:130}},{src:"/images/product_examples/hot_sauce.webp",top:"70%",tilt:"18deg",inset:"-34px",size:{width:80,height:100}}];function r5(e){let{cards:t,side:r}=e,n=t[Math.floor(t.length/2)];return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"absolute block rounded-full",style:{top:n.top,[r]:"calc(".concat(n.inset," + ").concat(n.size.width/2,"px - ").concat(170,"px)"),width:340,height:340,transform:"translateY(-50%)",background:"radial-gradient(closest-side, var(--gc-accent-light) 0%, transparent 72%)"}}),t.map(e=>(0,a.jsx)("span",{className:"absolute block overflow-hidden rounded-xl shadow-[0_10px_24px_-12px_rgba(41,31,24,0.55)] ring-1 ring-black/5",style:{top:e.top,[r]:e.inset,transform:"translateY(-50%) rotate(".concat(e.tilt,")"),width:e.size.width,height:e.size.height},children:(0,a.jsx)(p(),{src:e.src,alt:"",fill:!0,sizes:"104px",draggable:!1,className:"object-cover"})},e.src))]})}function r4(){return(0,a.jsxs)("div",{"aria-hidden":!0,className:"pointer-events-none absolute inset-y-8 left-0 right-0 -z-10 hidden xl:block",children:[(0,a.jsx)(r5,{cards:r1,side:"left"}),(0,a.jsx)(r5,{cards:r2,side:"right"})]})}var r3=r(99126),r7=r(10930),r6=r(93929);let r8=[{src:"/images/product_examples/can2.webp",className:"bottom-0 right-[8px] h-[80px] w-[64px] lg:-right-[24px] lg:bottom-[40px] lg:h-[115px] lg:w-[92px]",tilt:"14deg",depth:.3,delayMs:420,floatSeconds:7.5,sizes:"(min-width: 1024px) 92px, 64px",far:!0},{src:"/images/product_examples/shirt.webp",className:"right-[28px] top-0 h-[88px] w-[70px] lg:-right-[16px] lg:-top-[4px] lg:h-[125px] lg:w-[100px]",tilt:"-7deg",depth:.4,delayMs:360,floatSeconds:5.5,sizes:"(min-width: 1024px) 100px, 70px"},{src:"/images/product_examples/coffee.webp",className:"bottom-[4px] left-[16px] h-[95px] w-[76px] lg:bottom-[12px] lg:left-[30px] lg:h-[138px] lg:w-[110px]",tilt:"12deg",depth:.5,delayMs:280,floatSeconds:6,sizes:"(min-width: 1024px) 110px, 76px"},{src:"/images/product_examples/gummies.webp",className:"left-0 top-[16px] h-[130px] w-[104px] lg:left-0 lg:top-[30px] lg:h-[188px] lg:w-[150px]",tilt:"-9deg",depth:.75,delayMs:120,floatSeconds:7,sizes:"(min-width: 1024px) 150px, 104px"},{src:"/images/product_examples/serum.webp",className:"right-0 top-[90px] h-[125px] w-[100px] lg:right-0 lg:top-[140px] lg:h-[181px] lg:w-[145px]",tilt:"8deg",depth:.8,delayMs:200,floatSeconds:6.5,sizes:"(min-width: 1024px) 145px, 100px"},{src:"/images/product_examples/hot_sauce.webp",className:"left-[80px] top-[50px] h-[200px] w-[160px] lg:left-[100px] lg:top-[70px] lg:h-[300px] lg:w-[240px]",tilt:"-3deg",depth:1,delayMs:40,floatSeconds:6.2,sizes:"(min-width: 1024px) 240px, 160px"}];function r9(e){let{onStart:t,onHaveIdea:r}=e,n=(0,h.useRef)(null),s=(0,h.useRef)([]),l=(0,h.useRef)(null),i=(0,h.useRef)({x:0,y:0}),o=(0,h.useCallback)(()=>{l.current=null;let{x:e,y:t}=i.current;r8.forEach((r,a)=>{let n=s.current[a];n&&(n.style.transform="translate3d(".concat((-e*r.depth*18).toFixed(1),"px, ").concat((-t*r.depth*18).toFixed(1),"px, 0)"))})},[]),d=(0,h.useCallback)(()=>{null===l.current&&(l.current=requestAnimationFrame(o))}
1,[o]),c=(0,h.useCallback)(e=>{let t=n.current;if(!t||"mouse"!==e.pointerType||!window.matchMedia("(hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference)").matches)return;let r=t.getBoundingClientRect();i.current={x:Math.max(-1,Math.min(1,(e.clientX-r.left)/r.width*2-1)),y:Math.max(-1,Math.min(1,(e.clientY-r.top)/r.height*2-1))},d()},[d]),u=(0,h.useCallback)(()=>{i.current={x:0,y:0},d()},[d]);return(0,h.useEffect)(()=>()=>{null!==l.current&&cancelAnimationFrame(l.current)},[]),(0,a.jsxs)("section",{ref:n,onPointerMove:c,onPointerLeave:u,className:"jsx-383d3ac8eb1f1029 mx-auto grid w-full max-w-6xl items-center gap-6 px-2 py-4 md:grid-cols-[minmax(0,1.1fr)_minmax(0,1fr)] md:gap-12 md:py-8",children:[(0,a.jsxs)("div",{className:"jsx-383d3ac8eb1f1029 gh-rise order-2 flex flex-col items-center text-center md:order-1 md:items-start md:text-left",children:[(0,a.jsx)("p",{className:"jsx-383d3ac8eb1f1029 text-[11px] font-bold uppercase tracking-[0.2em] text-(--gc-muted) md:text-xs",children:"dough - the everything factory"}),(0,a.jsx)(r7.Ay,{className:"mt-3 text-4xl sm:text-5xl md:mt-4 md:text-6xl"}),(0,a.jsx)("p",{className:"jsx-383d3ac8eb1f1029 mt-4 max-w-md text-base leading-relaxed text-(--gc-ink)/75 md:mt-5 md:text-lg",children:"Tell us what you have in mind. We design it, find who makes it, and ship it to your customers."}),(0,a.jsxs)("div",{className:"jsx-383d3ac8eb1f1029 mt-7 flex w-full flex-col items-center gap-3 sm:w-auto sm:flex-row md:mt-8",children:[(0,a.jsx)(w.$,{type:"button",onClick:t,className:(0,eh.cn)("h-12 w-full px-8 text-base sm:w-auto md:h-14",r6.ME),children:"Get started"}),(0,a.jsx)("button",{type:"button",onClick:r,className:"jsx-383d3ac8eb1f1029 hover-lift inline-flex h-12 w-full items-center justify-center rounded-full border border-(--gc-border) bg-(--gc-card) px-6 text-base font-semibold text-(--gc-ink) transition-colors hover:border-(--gc-accent) hover:bg-(--gc-accent-light) sm:w-auto md:h-14",children:"I already have an idea"})]}),(0,a.jsxs)("p",{className:"jsx-383d3ac8eb1f1029 mt-4 flex items-center gap-1.5 text-xs text-(--gc-muted) md:text-sm",children:[(0,a.jsx)(ei.A,{className:"h-3 w-3 shrink-0"}),"Takes about 2 minutes. You keep full ownership of everything you create."]})]}),(0,a.jsx)("div",{"aria-hidden":!0,className:"jsx-383d3ac8eb1f1029 order-1 relative mx-auto h-[300px] w-[320px] max-w-full md:order-2 lg:h-[440px] lg:w-[440px]",children:(0,a.jsxs)("div",{className:"jsx-383d3ac8eb1f1029 gh-cluster relative h-full w-full",children:[(0,a.jsx)("div",{className:"jsx-383d3ac8eb1f1029 gh-glow absolute inset-[-12%] rounded-full bg-[radial-gradient(50%_50%_at_50%_50%,var(--gc-accent-light)_0%,transparent_100%)]"}),r8.map((e,t)=>(0,a.jsx)("div",{ref:e=>{s.current[t]=e},className:"jsx-383d3ac8eb1f1029 "+((0,eh.cn)("absolute transition-transform duration-300 ease-out will-change-transform",e.className)||""),children:(0,a.jsx)("div",{style:{"--gh-delay":"".concat(e.delayMs,"ms"),"--gh-float":"".concat(e.floatSeconds,"s"),"--gh-lift":"".concat(-6-6*e.depth,"px")}
1,className:"jsx-383d3ac8eb1f1029 gh-item h-full w-full",children:(0,a.jsx)("div",{style:{transform:"rotate(".concat(e.tilt,")"),boxShadow:"0 ".concat(10+16*e.depth,"px ").concat(24+24*e.depth,"px -").concat(12+6*e.depth,"px rgba(41,31,24,").concat(.3+.25*e.depth,")")},className:"jsx-383d3ac8eb1f1029 "+((0,eh.cn)("relative h-full w-full overflow-hidden rounded-2xl ring-1 ring-black/5",e.far&&"opacity-90 blur-[1.5px]")||""),children:(0,a.jsx)(p(),{src:e.src,alt:"",fill:!0,sizes:e.sizes,draggable:!1,className:"object-cover"})})})},e.src))]})}),(0,a.jsx)(V(),{id:"383d3ac8eb1f1029",children:".gh-rise.jsx-383d3ac8eb1f1029{animation:gh-rise.5s cubic-bezier(.22,1,.36,1)backwards}.gh-item.jsx-383d3ac8eb1f1029{animation:gh-rise.6s cubic-bezier(.22,1,.36,1)var(--gh-delay,0ms)backwards,gh-float var(--gh-float,6s)ease-in-out calc(var(--gh-delay,0ms) + .6s)infinite}.gh-cluster.jsx-383d3ac8eb1f1029{animation:gh-drift 16s ease-in-out infinite alternate}.gh-glow.jsx-383d3ac8eb1f1029{animation:gh-glow 5s ease-in-out infinite alternate}@keyframes gh-rise{from{opacity:0;transform:translatey(14px)}to{opacity:1;transform:translatey(0)}}@keyframes gh-float{0%,100%{transform:translatey(0)}50%{transform:translatey(var(--gh-lift,-9px))}}@keyframes gh-drift{from{transform:rotate(-1.5deg)}to{transform:rotate(1.5deg)}}@keyframes gh-glow{from{opacity:.6;transform:scale(.94)}to{opacity:1;transform:scale(1.06)}}@media(prefers-reduced-motion:reduce){.gh-rise.jsx-383d3ac8eb1f1029,.gh-item.jsx-383d3ac8eb1f1029,.gh-cluster.jsx-383d3ac8eb1f1029,.gh-glow.jsx-383d3ac8eb1f1029{animation:none}}"})]})}var ae=r(54795);let at=d()(()=>r.e(8253).then(r.bind(r,78253)),{loadableGenerated:{webpack:()=>[78253]},ssr:!1}),ar=()=>Promise.all([r.e(4708),r.e(1937),r.e(9504),r.e(4754),r.e(9752)]).then(r.bind(r,31609)),aa=d()(ar,{ssr:!1,loading:()=>(0,a.jsx)(r3.$,{variant:"inline"})}),an=["Caffeine gummies inspired by 'Nike'","Vitamin C serum for new moms","Chocolate peanut butter bars for RPG players","Fragrance inspired by Taylor Swift","Sunscreen that smells like soft serve","Breakfast cereal inspired by Pixar Animation","Extra tall candle for yoga lovers","Luxury travel carrier for small cats on planes"],as=["Reconnecting, please stay on this pageâ¦","Analyzing product conceptâ¦","Generating additional viewsâ¦","Almost there, stay on this pageâ¦"],al=["Understanding your visionâ¦","Searching our supplier networkâ¦","Checking what can be madeâ¦","Choosing its compositionâ¦","Sizing up production optionsâ¦","Designing the productâ¦","Designing the packagingâ¦","Rendering product imagesâ¦","Refining the detailsâ¦","Almost readyâ¦"],ai=(()=>{let e=e=>(1.2**e-1)/(1.2-1),t=e(al.length-1);return al.map((r,a)=>e(a)/t*.83)})();function ao(e){let t=-Math.log(1-Math.min(Math.max(e,0)/99,.999))/3,r=0;for(let e=0;e<ai.length;e++)t>=ai[e]&&(r=e);return al[r]}let ad="group rounded-full font-semibold tracking-[-0.01em] text-white border-0 bg-gradient-to-r from-amber-500 to-amber-600 shadow-[0_6px_20px_rgba(245,158,11,0.3)] [text-shadow:0_1px_0_rgba(120,53,15,0.35)] transition-[transform,box-shadow,filter,background-color] duration-200 hover-lift hover:from-amber-600 hover:to-amber-700 hover:shadow-[0_10px_24px_rgba(245,158,11,0.36)] active:brightness-[0.96] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-amber-600 disabled:bg-none disabled:bg-secondary disabled:text-secondary-foreground disabled:shadow-none disabled:[text-shadow:none] disabled:opacity-60 disabled:brightness-100 disabled:cursor-not-allowed",ac="inline-flex cursor-pointer items-center gap-1.5 rounded-full px-3 py-1 border border-foreground
1/20 bg-[#fffdfa] text-xs font-medium leading-4 text-foreground shadow-md backdrop-blur-md transition-colors hover:border-foreground/35 hover:bg-white disabled:cursor-not-allowed disabled:opacity-50",au=()=>window.matchMedia("(max-width: 767px)").matches,am="dough.imagine.maxInvestmentUsd",ap="rounded-full border border-foreground/20 bg-[#fffdfa] text-foreground/75 hover:bg-[#fdf7ee] hover:text-foreground hover:border-foreground/30 transition-colors flex items-center",af="dough_pending_prompt",ah="dough_pending_prompt_claim",ax="dough_pending_signup",ag="Choose or drop an image file.";function ab(){return(0,a.jsx)("div",{className:"pointer-events-none absolute inset-0 z-30 flex items-center justify-center rounded-3xl bg-card/95",role:"status","aria-live":"polite",children:(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm font-medium text-primary",children:[(0,a.jsx)($.A,{className:"h-5 w-5"}),"Drop image to attach"]})})}function av(){let e="imagine_unauth-tracked-prompt_interact";if(sessionStorage.getItem(e))return;let t=document.cookie.match(/(?:^|; )dough_landing_session=([^;]+)/),r=t?decodeURIComponent(t[1]):null;r&&(sessionStorage.setItem(e,"1"),fetch("/api/analytics/landing",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({page_name:"imagine_unauth",event_type:"page_view",event_name:"prompt_interact",session_id:r})}).catch(()=>{}))}function aw(){var e,t,r,l,i,o,d,c,u,m,p,b,v,j,y,k,N;let _=(0,f.useRouter)(),S=(0,h.useRef)(null),A=(0,h.useRef)(null),P=(0,h.useRef)(null),[E,T]=(0,h.useState)(""),[L,D]=(0,h.useState)([]),[M,R]=(0,h.useState)(!1),[O,F]=(0,h.useState)(""),{progress:q,start:U,stop:z,complete:Y,restart:B}=(0,rL.E3)(5e4),{user:G,isAuthChecking:ef}=(0,g.A)(),ex=(0,h.useRef)(!1),[eD,eB]=(0,h.useState)(!1),eJ=(0,h.useRef)(!1);(0,h.useEffect)(()=>{if(eJ.current||!_.isReady)return;let e=_.query.prompt,t=Array.isArray(e)?e[0]:e;"string"==typeof t&&t.trim()&&(eJ.current=!0,T(e=>e.trim()?e:t))},[_.isReady,_.query.prompt]);let eK=(0,h.useRef)(!1);(0,h.useEffect)(()=>{if(eK.current||!_.isReady)return;let e=_.query.src,t=_.query.ref_page,r=Array.isArray(e)?e[0]:e,a=Array.isArray(t)?t[0]:t;"string"==typeof r&&r.trim()&&(eK.current=!0,sessionStorage.setItem(tr.rv,JSON.stringify({source:r,..."string"==typeof a&&a?{refPageId:a}:{}})))},[_.isReady,_.query.src,_.query.ref_page]);let[e3,e6]=(0,h.useState)(0),[e9,ta]=(0,h.useState)(!1),[ts,tl]=(0,h.useState)(null),ti=(0,h.useRef)(0),to=(0,h.useRef)(!1);(0,h.useEffect)(()=>{if(to.current||!_.isReady||!G)return;let e=_.query.new_version_of,t=Array.isArray(e)?e[0]:e;if("string"!=typeof t||!t.trim())return;to.current=!0;let r=!1;return(0,e2.h_)(t.trim()).then(e=>{!r&&e&&tl(t=>null!=t?t:e)}).catch(e=>console.warn("[ImaginePage] failed to seed new-version inspiration image:",e)).finally(()=>{r||eB(!0)}),()=>{r=!0}},[_.isReady,_.query.new_version_of,G]);let[td,tc]=(0,h.useState)(!1),[tp,tf]=(0,h.useState)([]),[th,tx]=(0,h.useState)(!1),[tg,ty]=(0,h.useState)([]),tk=(0,h.useMemo)(()=>tg.map(e=>e.imageUrl),[tg]),[tN,t_]=(0,h.useState)(!1),[tC,tS]=(0,h.useState)(0),[tA,tP]=(0,h.useState)(!1),[tE,tT]=(0,h.useState)(null),tD=(0,h.useRef)(null);(0,h.useEffect)(()=>{if(tk.length>0){var e;null==(e=A.current)||e.scrollTo({top:0,behavior:"smooth"})}},[tk]);let tO=(0,h.useCallback)(e=>{if(!e||tD.current===e)return;tD.current=e;let t=()=>n.A.post("/api/reference-requests/mark-rendered",{id:e});t().catch(()=>{if("undefined"==typeof document||"visible"===document.visibilityState)return;let e=()=>{"visible"===document.visibilityState&&(document.removeEventListener("visibilitychange",e),t().catch(()=>{}))};document.addEventListener("visibilitychange",e)})},[]);(0,h.useEffect)(()=>{0!==tk.length&&tO(tE)},[tE,tk,tO]),(0,h.useEffect)(()=>{if(tA)return;if(!tN)return void tS(0);let e=Date.now(),t=0,r=setInterval(()=>{let r=1-Math.exp(-3*(Date.now()-e)/95e3),a=Math.max(r-t,0);t=r;let n=.3+1.4*Math.random();tS(e=>Math.min(e+a*n*99,99))},100);return()=>clearInterval(r)},[tN,tA]);let tF=(0,h.useCallback)(()=>new Promise(e=>{tP(!0),tS(100),setTimeout(()=>{tP(!1),tS(0),e()},500)}),[]),[tq,tU]=(0,h.useState)(null),tz=(0,h.useRef)(null),[tY,tG]=(0,h.useState)(0),[tV,t$]=(0,h.useState)(""),[tH,tJ]=(0,h.useState)([]),[tQ,t1]=(0,h.useState)(""),t2=(0,h.useMemo)(()=>tk.map((e,t)=>({id:"ref-".concat(t),src:e,mode:"direct-url"})),[tk]),t5=(0,eI._)(t2),[t4,t3]=(0,h.useState)(null),[t7,t6]=(0,h.useState)(!1),[t8,t9]=(0,h.useState)(null);(0,h.useEffect)(()=>{},[]);let[re,rt]=(0,h.useState)(!1),[rr,ra]=(0,h.useState)(void 0),[rn,rs]=(0,h.useState)(null);(0,h.useEffect)(()=>{},[_.query]);let[rl,ri]=(0,h.useState)(!1),[ro,rd]=(0,h.useState)(null),[rc,ru]=(0,h.useState)(null),[rm,rp]=(0,h.useState)(null),[rf,rh]=(0,h.useState)(null),rx=(0,h.useRef)(null);rx.current=rf;let rg=(0,h.useRef)(null),rb=(0,h.useRef)(!1),rv=(0,h.useRef)(!1),rw=(0,h.useRef)(0),rj=(0,h.useRef)(!1),ry=(0,h.useRef)(!1),rk=(0,h.useRef)(0),rN=(0,h.useRef)(!1);(0,h.useEffect)(()=>{let e=()=>{rN.current=!0},t=()=>{rN.current=!1};return window.addEventListener("pagehide",e),window.addEventListener("pageshow",t),()=>{window.removeEventListener("pagehide",e),window.removeEventListener("pageshow",t)}},[]);let r_=(0,h.useRef)(null),rC=(0,h.useRef)(null),[rI,rS]=(0,h.useState)(!1),rA=(0,h.useRef)(0),rP=(0,h.useRef)(0),rE=(0,h.useRef)(0),rD=(0,h.useRef)(!1),rM=(0,h.useRef)(null),[rR,rO]=(0,h.useState)(!1),rF=(0,h.useRef)(null),rq=(0,h.useRef)(!1),rz=(0,h.useRef)(!1),rG=(0,h.useRef)(0),rV=(0,h.useRef)(!1),[r$,rH]=(0,h.useState)(null),{flagState:rK,loading:rX}=(0,I._P)(W.Wg.GuideMeChat),{flagState:r0,loading:r1}=(0,I._P)(W.Wg.GuideMeChatV2),[r2,r5]=(0,h.useState)(void 0);(0,h.useEffect)(()=>{_.isReady&&r5(function(e){var t,r,a;let n=Array.isArray(e)?e[0]:e,s=void 0===n?null:null!=(t=eF[n])?t:null;try{if(s)return window.localStorage.setItem(eO,eq[s]),s;if("auto"===n)return window.localStorage.removeItem(eO),null;return null!=(a=eF[null!=(r=window.localStorage.getItem(eO))?r:""])?a:null}catch(e){return s}}(_.query.chat_composer))},[_.isReady,_.query]);let r3=rK||null!=r2,r6=r3&&!(void 0!==r2&&(null===r2?r0:"hero"===r2));(0,C.Q)(W.Wg.GuideMeChatV2,r3&&!r1&&null===r2),(0,C.Q)(W.Wg.GuideMeChat,!rX&&null===r2);let[r8,al]=(0,h.useState)(null),ai=(0,h.useRef)(!1);(0,h.useEffect)(()=>
1{if(ai.current||!_.isReady)return;let e=_.query.for_brand,t=Array.isArray(e)?e[0]:e;"string"==typeof t&&t.trim()&&(ai.current=!0,al(t.trim()))},[_.isReady,_.query.for_brand]);let[aw,aj]=(0,h.useState)(!1),{brands:ay,status:ak,reload:aN,choiceRequired:a_}=(0,tu.Pj)(null==G?void 0:G.id),aC=(0,h.useRef)(null);(0,h.useEffect)(()=>{var e;let t=null!=(e=null==G?void 0:G.id)?e:null;aC.current!==t&&(aC.current=t,rH(null),aI.current=!1)},[null==G?void 0:G.id]);let aI=(0,h.useRef)(!1);(0,h.useEffect)(()=>{if(aI.current||"ready"!==ak||!r8||null!==r$)return;let e=ay.find(e=>e.brand_id===r8);e&&(aI.current=!0,rH({kind:"brand",brand:e}))},[ak,ay,r8,r$]);let aS=a_&&null===r$,[aA,aP]=(0,h.useState)(!1),[aE,aT]=(0,h.useState)(!1),[aL,aD]=(0,h.useState)(""),[aM,aR]=(0,h.useState)(!1),[aO,aF]=(0,h.useState)([]),aq=(0,h.useRef)("generate"),[aU,az]=(0,h.useState)(null),[aW,aY]=(0,h.useState)(!1),aB=(0,h.useRef)(null),[aG,aV]=(0,h.useState)(!1),a$=(0,h.useRef)(null),aH=(0,h.useRef)(!1),[aJ,aK]=(0,h.useState)(!1);(0,h.useEffect)(()=>()=>{null!==aB.current&&window.clearTimeout(aB.current),null!==a$.current&&window.clearTimeout(a$.current)},[]);let aQ=(0,h.useRef)(null),[aZ,aX]=(0,h.useState)(!1),a0=(0,h.useRef)(null);a0.current=tq;let a1=(0,h.useRef)(null),a2=(0,h.useRef)(null),[a5,a4]=(0,h.useState)(null),[a3,a7]=(0,h.useState)(null),a6=(0,h.useMemo)(()=>tg.map(e=>e.blueprint),[tg]),a8=(0,h.useMemo)(()=>a6.some(Boolean),[a6]),a9=(0,e5.d)(),ne=e=>{let t={};for(let r of e)r.blueprint&&"number"==typeof r.matchScore&&(t[r.blueprint.productId]=r.matchScore);return t},nt=(0,h.useMemo)(()=>(function(e){let t=[],r=[];return e.forEach((e,a)=>{("custom"===eG(e.blueprint)?t:r).push(a)}),[...t,...r.reverse()]})(tg),[tg]),[nr,na]=(0,h.useState)(null),[nn,ns]=(0,h.useState)(null),[nl,ni]=(0,h.useState)(null),[no,nd]=(0,h.useState)(null),nc=(0,h.useCallback)(e=>{if(!e)return;let t="stock"===eG(e.blueprint)?{lockedLane:null,lockedBlueprint:null,lockedMatchScore:null}:{lockedLane:e.blueprint?"catalog":"custom",lockedBlueprint:e.blueprint,lockedMatchScore:e.matchScore};na(t.lockedLane),ns(t.lockedBlueprint),ni(t.lockedMatchScore)},[]),nu="catalog"===nr,[nm,np]=(0,h.useState)(null),[nf,nh]=(0,h.useState)(null),[nx,ng]=(0,h.useState)(null),[nb,nv]=(0,h.useState)(null),[nw,nj]=(0,h.useState)(!1),[ny,nk]=(0,h.useState)(!1),[nN,n_]=(0,h.useState)(null),[nC,nI]=(0,h.useState)(null),[nS,nA]=(0,h.useState)(null),[nP,nE]=(0,h.useState)(!1),nT=(0,h.useRef)(null),[nL,nD]=(0,h.useState)(null),[nM,nR]=(0,h.useState)(!1),nO=(0,h.useRef)(null),[nF,nq]=(0,h.useState)(null),[nU,nz]=(0,h.useState)([]),[nW,nY]=(0,h.useState)(!1),{subscription:nB,loading:nG}=(0,ek.R)(),nV="active"===nB.status;(0,h.useEffect)(()=>{if(ef)return;if(!G)return void eM("anon");if(nG)return;if(nV)return void eM("sub");let e=!1;return(0,eH.U)().from("pages").select("page_id",{count:"exact",head:!0}).eq("owner_id",G.id).then(t=>{let{count:r,error:a}=t;e||a||null===r||eM(0===r?"new":"free")}),()=>{e=!0}},[ef,G,nG,nV]);let n$=e=>"$".concat(Math.round(e).toLocaleString("en-US")),nH="1"===_.query.guide,nJ=!G,nK=()=>{_.replace({query:{..._.query,guide:"1"}},void 0,{shallow:!0})},nQ=()=>{(0,tj.LW)(),(0,ez.k0)("guide"),nK()},nZ=()=>{G||(0,eE.D)("imagine","guide_pill_clicked"),nQ()},nX=()=>{G||(0,eP.Vf)("guide_chat_landing_interact")},n0=function(){var e,t;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r$,a=E.trim();if(!a){null==(t=S.current)||t.focus();return}G||(0,eE.D)("imagine","guide_composer_sent"),(0,ez.k0)("idea",{message:a,...ts?{attachmentDataUrl:ts}:{},...r?{store:(0,ez.Tz)(r)}:{}}),null==(e=A.current)||e.scrollTo({top:0}),nK()},[n1,n2]=(0,h.useState)(!1),n5=async e=>{var t;if("built"===e.status&&e.builtPageId)return void _.push((0,eU.$U)(e.builtPageId));await (0,eU.Zv)(e.conversationId),n2(!1),null==(t=A.current)||t.scrollTo({top:0}),nK()},n4=r3&&nH;(0,h.useEffect)(()=>{if(!r3||nH)return;let e=()=>void ar();if("function"==typeof window.requestIdleCallback){let t=window.requestIdleCallback(e,{timeout:4e3});return()=>window.cancelIdleCallback(t)}let t=window.setTimeout(e,1500);return()=>window.clearTimeout(t)},[r3,nH]);let[n3,n7]=(0,h.useState)(null),n6=function(e){let{enabled:t,onTrigger:r}=e,a=(0,h.useRef)(!1),n=(0,h.useRef)(!1),s=(0,h.useRef)(0),l=(0,h.useRef)(null),i=(0,h.useRef)(!1),o=(0,h.useRef)(null),d=(0,h.useRef)(null),c=(0,h.useRef)(t);c.current=t;let u=(0,h.useRef)(r);u.current=r;let m=(0,h.useCallback)(()=>{o.current&&clearTimeout(o.current),d.current&&clearTimeout(d.current),o.current=null,d.current=null},[]),p=(0,h.useCallback)(()=>{n.current=!0,m()},[m]),f=(0,h.useCallback)(e=>{if(!a.current&&!n.current&&c.current){try{if(window.sessionStorage.getItem(eC)){n.current=!0;return}window.sessionStorage.setItem(eC,"1")}catch(e){}a.current=!0,m(),u.current(e)}},[m]),x=(0,h.useCallback)(()=>{o.current&&clearTimeout(o.current),o.current=setTimeout(()=>f("idle_focus"),8e3)},[f]),g=(0,h.useCallback)(()=>{!n.current&&(l.current=Date.now(),i.current||x())},[x]),b=(0,h.useCallback)(()=>
1{if(m(),n.current||i.current)return;let e=l.current?Date.now()-l.current:0;l.current=null,e>=2500&&f("empty_blur")},[m,f]),v=(0,h.useCallback)(e=>{if(n.current)return;m();let t=e.trim().split(/\s+/).filter(Boolean).length;return t>=3?void p():(i.current=t>0,0===t)?void x():void(d.current=setTimeout(()=>f("short_prompt_idle"),5e3))},[x,p,m,f]),w=(0,h.useCallback)(()=>{!n.current&&(m(),s.current+=1,s.current>=3&&f("chip_shopping"))},[m,f]),j=(0,h.useCallback)(()=>p(),[p]);return(0,h.useEffect)(()=>m,[m]),{noteFocus:g,noteBlur:b,noteTyped:v,noteChipApplied:w,noteSubmitted:j}}({enabled:nJ&&!nH&&!r3&&!tN&&!M&&0===tk.length&&0===tg.length,onTrigger:e=>{n7(e),(0,eE.D)("imagine","guide_nudge_shown"),(0,eE.D)("imagine","guide_nudge_".concat(e))}}),n8=()=>{(0,tj._s)(),(0,ez.Gi)();let{guide:e,[ez.H5]:t,...r}=_.query;_.replace({query:r},void 0,{shallow:!0})};(0,h.useEffect)(()=>{var e;G&&!nH&&((0,tj.b2)()||(null==(e=(0,tj.wB)())?void 0:e.generationPending))&&nK()},[G,nH]);let n9=(0,h.useCallback)(async(e,t)=>{var r,a;let{isReplay:s}=t,{prompt:l,selectedImageUrl:i,clientRequestId:o,refineCatalog:d,createCatalog:c,brandId:u,autoCreateBrand:m,referenceRequestId:p,tileIndex:f}=e,h=!1;rw.current+=1,rP.current=Date.now();let x=e=>!rv.current&&(rv.current=!0,rE.current=0,rg.current=null,eX(o),r_.current=null,ry.current=!1,rO(!1),rh(e),eT("imagine_refine_succeeded"),console.log("Draft page created: ".concat(e).concat(s?" (replay)":"")),Y(),!0);try{if(s){let t=null;try{t=await e1(e)}catch(e){console.warn("[ImaginePage] draft lookup before replay failed; replaying the confirm:",e)}let r=function(e){let{handedOff:t,existingPageId:r}=e;return t?"already_handed_off":r?"open_existing":"run_confirm"}({handedOff:rv.current,existingPageId:t});if("already_handed_off"===r)return;if("open_existing"===r&&t){eT("imagine_refine_recovered_existing"),x(t);return}}let t=await n.A.post("/api/generate/refine",{prompt:l,selectedImageUrl:i,isInitialRefine:!0,clientRequestId:o,catalog:d,brand_id:u,referenceRequestId:p,tileIndex:f},{timeout:12e4});if(!function(e){let{settled:t,isReplay:r,owningCreateStartedAt:a,now:n,legTimeoutMs:s}=e;return!t||!!r&&(!a||n-a>=s)}({settled:rb.current,isReplay:s,owningCreateStartedAt:rE.current,now:Date.now(),legTimeoutMs:12e4})||rv.current)return;if(!t.data)throw Error("Refine returned an empty response");rb.current=!0,h=!0,rE.current=Date.now();let g=await n.A.post("/api/refine-session/create",{prompt:l,selectedImageUrl:i,reference2Url:t.data.reference2Url,reference3Url:t.data.reference3Url,specBoardUrl:t.data.specBoardUrl,specBoardModel:t.data.specBoardModel,specBoardSpec:t.data.specBoardSpec,characteristics:t.data.characteristics,initialMessage:t.data.message,initialMessageTokens:t.data.messageTokens,catalog:c,brand_id:u,autoCreateBrand:m,clientRequestId:o,compromiseNote:null!=(a=null!=(r=null==c?void 0:c.blueprint.compromiseNote)?r:(0,te.M)(t.data.formatReconciliation))?a:void 0,referenceRequestId:p,tileIndex:f},{timeout:12e4});x(g.data.page_id)}catch(r){let e=rw.current>1;if(h&&(rb.current=!1,rE.current=0),rv.current||rb.current||e){console.warn("[ImaginePage] refine attempt failed but another is live".concat(s?" (replay)":"",":"),r),s&&(ry.current=!1,rO(!1));return}if(rN.current)return void console.warn("[ImaginePage] confirm aborted by a page unload; the next load resumes it");rj.current=!1,ry.current=!1,rg.current=null,eX(o),rO(!1),R(!1),z(),console.error("Initial refine failed".concat(s?" (replay)":"",":"),r);let t=null==r?void 0:r.response;if((null==t?void 0:t.status)===402&&(0,eS.z)(t.data)){eT("imagine_refine_failed_threshold"),t9(t.data),t6(!0);return}if(r&&"object"==typeof r&&!r.response&&(r.request||"string"==typeof r.code&&e$.has(r.code))){eT("imagine_refine_failed_transport"),F("Connection issue. Check your internet and try again.");return}eT("imagine_refine_failed_error"),F("Failed to analyze product")}finally{rw.current-=1,rw.current<=0&&(rP.current=0)}},[Y,z]);e_(M,(0,h.useCallback)(e=>{let t=rg.current;if(!function(e){let{awayMs:t,hasPendingRequest:r,settled:a,replayInFlight:n,replayAttempts:s}=e;return!!r&&!a&&!n&&!(s>=2)&&t>=1e4}({awayMs:e,hasPendingRequest:!!t,settled:rv.current,replayInFlight:ry.current,replayAttempts:rk.current})||!t){t&&e>=1e4&&rk.current>=2&&console.warn("[ImaginePage] Page returned after ".concat(Math.round(e/1e3),"s away but the replay budget is spent; letting the attempt timeout report it"));return}console.log("[ImaginePage] Page returned after ".concat(Math.round(e/1e3),"s away with a pending refine request, replaying...")),eT("imagine_refine_replayed"),rk.current+=1,ry.current=!0,rO(!0),R(!0),B(),n9(t,{isReplay:!0})},[n9,B]));let se=(0,h.useRef)(!1);(0,h.useEffect)(()=>{var e;if(se.current||ef||!G||a9)return;se.current=!0;let t=e0();if(!t)return;let{request:r}=t,a=(e=r.clientRequestId,eQ===e);if(!function(e){let{storedUserId:t,userId:r,confirmedAt:a,liveInThisPage:n,now:s}=e;if(n||t!==r)return!1;let l=s-a;return l>=0&&l<9e5}({storedUserId:t.userId,userId:G.id,confirmedAt:r.confirmedAt,liveInThisPage:a,now:Date.now()})){a||eX(r.clientRequestId);return}rj.current||(console.log("[ImaginePage] Resuming a confirm from ".concat(Math.round((Date.now()-r.confirmedAt)/1e3),"s ago that this tab never handed off")),eT("imagine_refine_resumed_after_reload"),eZ(t.userId,r),rj.current=!0,rg.current=r,rb.current=!1,rE.current=0,rv.current=!1,ry.current=!0,rk.current=1,rA.current=Date.now(),rD.current=!1,r_.current={key:"".concat(r.prompt,"::").concat(r.selectedImageUrl),clientRequestId:r.clientRequestId},t3(r.selectedImageUrl),rS(!1),rO(!0),R(!0),B(),n9(r,{isReplay:!0}))},[ef,G,a9,n9,B]);let st=(0,h.useCallback)(async e=>{if(!e)return null;try{var t,r;let a=await n.A.post("/api/generate/imagine-recover",{clientRequestId:e},{timeout:9e4});return(null==(r=a.data)||null==(t=r.tiles)?void 0:t.length)?a.data:null}catch(e){return null}},[]),sr=(0,h.useCallback)(e=>{if(!rF.current||rq.current||rz.current)return;
1let t=rF.current;rz.current=!0,rG.current=1,console.log("[ImaginePage] Starting imagine-tiles failsafe retry (".concat(e,")...")),t_(!0),F("");let r=async(e,r,a)=>{if(rF.current!==t||rq.current)return;rq.current=!0,rF.current=null;let n="string"==typeof r.tweakInstruction?r.tweakInstruction.trim():"",s="tweak"===a,l="catalog"===r.lockedLane||!0===r.catalogOnly?"catalog":"custom",i=!0===r.catalogOnly&&!!r.catalogDesignSource;if(e.tiles&&e.tiles.length>0){var o,d,c;let t=sw(e.tiles);if(eT(s?i?"imagine_no_investment_succeeded":"catalog"===l?"imagine_tweak_succeeded_catalog":"imagine_tweak_succeeded_custom":eL(t.filter(e=>e.blueprint).length)),ty(t),tT(e.id||null),aq.current=i?"noInvestment":s?"tweak":"generate",nd(function(e){if(!0!==e.catalogOnly)return null;let t=e.catalogDesignSource;if(!t||"object"!=typeof t)return null;let{labelUrl:r,imageUrl:a}=t;return"string"==typeof a&&a?{designSource:{labelUrl:"string"==typeof r?r:null,imageUrl:a}}:null}(r)),az("string"==typeof r.parentRequestId?r.parentRequestId:null),s){let a="string"==typeof r.prompt?r.prompt:"",s=e.effectivePrompt||(n?"".concat(a," + ").concat(n):a);(0,eE.D)("imagine","imagine_tile_edit_success"),t$(s),T(s),"catalog"===l&&(e.catalogLabelUrl&&np(e.catalogLabelUrl),nh(null!=(o=e.catalogLimitations)?o:null));let i=au()?a0.current:null;if(null!=i&&t.length>0){let e=Math.min(i,t.length-1);tU(e),aT(!0),nc(t[e])}else tU(null),aT(!1);let d=aQ.current;aQ.current=null,d&&aF(e=>[d,...e]),aD(""),"catalog"!==l&&tl(null),aR(!1)}else np(null!=(d=e.catalogLabelUrl)?d:null),nh(null!=(c=e.catalogLimitations)?c:null),t$("string"==typeof r.prompt?r.prompt:""),aF([]);tJ(e.variations||[]),t1(e.suggestionQuestion||""),await tF()}else eT(s?i?"imagine_no_investment_failed_error":"imagine_tweak_failed_error":"imagine_generate_failed_error"),F("Failed to generate reference images");t_(!1),aR(!1)},a=(e,s)=>{rF.current!==t||rq.current||(console.log("[ImaginePage] imagine-tiles retry attempt ".concat(s,"/").concat(3)),n.A.post("/api/generate/imagine-tiles",e,{timeout:9e4}).then(async a=>{await r(a.data,e,t.kind)}).catch(async n=>{if(rF.current!==t||rq.current)return;if(console.error("[ImaginePage] imagine retry attempt ".concat(s," failed:"),n),s<3)return void setTimeout(()=>a(e,s+1),1e3*s);let l=await st("string"==typeof e.clientRequestId?e.clientRequestId:null);if(rF.current===t&&!rq.current){if(l)return void await r(l,e,t.kind);rq.current=!0,rF.current=null,t_(!1),aR(!1),eT("tweak"!==t.kind?"imagine_generate_failed_error":!0===e.catalogOnly&&e.catalogDesignSource?"imagine_no_investment_failed_error":"imagine_tweak_failed_error"),F("Connection lost. Please try again.")}}))};setTimeout(()=>a(t.body,1),500)},[nc,tF,st]);e_(tN,(0,h.useCallback)(e=>{sr("page returned after ".concat(Math.round(e/1e3),"s away"))},[sr])),(0,h.useEffect)(()=>{let e,t=tz.current;if(!t||0===tk.length)return;let r=()=>{clearTimeout(e),e=setTimeout(()=>{var e;let r=t.getBoundingClientRect(),a=r.left+r.width/2,n=0,s=1/0;Array.from(t.children).forEach((e,t)=>{let r=e.getBoundingClientRect(),l=Math.abs(r.left+r.width/2-a);l<s&&(s=l,n=t)});let l=n-1,i=l>=0&&null!=(e=nt[l])?e:-1;tG(i),i>=0?(a1.current!==i&&(a1.current=i,(0,eE.D)("imagine","imagine_tile_selected")),tU(i),nc(tg[i]),aE||aT(!0)):(tU(null),aT(!1))},50)};return t.addEventListener("scroll",r,{passive:!0}),()=>{t.removeEventListener("scroll",r),clearTimeout(e)}},[tk.length,aE,tg,nt,nc]),(0,h.useEffect)(()=>{if(tk.length>0){var e;let t=nt.length-1,r=null!=(e=nt[t])?e:0;tG(r),au()&&(tU(r),nc(tg[r]),aT(!0),requestAnimationFrame(()=>{let e=tz.current,r=null==e?void 0:e.children[t+1];r&&r.scrollIntoView({behavior:"instant",block:"nearest",inline:"center"})}))}},[tk,nt,tg,nc]);let sa=(0,h.useCallback)(e=>{var t;rD.current||(rD.current=!0,eT("imagine_refine_handoff_stalled"),console.error("[ImaginePage] refine hand-off stalled (".concat(e,") for ").concat(null!=(t=rx.current)?t:"a page with no id yet","; offering a way out")),rj.current=!1,rS(!0))},[]),sn=(0,h.useCallback)(()=>{let e=rf?"/?mode=refine&page_id=".concat(rf):"/?mode=refine";_.push(e,void 0,{shallow:!0}),rC.current&&clearTimeout(rC.current),rC.current=setTimeout(()=>sa("the route did not take over"),15e3)}
1,[_,rf,sa,15e3]);(0,h.useEffect)(()=>()=>{var e;return clearTimeout(null!=(e=rC.current)?e:void 0)},[]),(0,h.useEffect)(()=>{if(!M||rI)return;let e=()=>{if(!rA.current||"visible"!==document.visibilityState||Date.now()-rA.current<11e4)return;let e=rP.current;e&&Date.now()-e<12e4||sa("the confirm outlived its budget")},t=setInterval(e,5e3);return document.addEventListener("visibilitychange",e),window.addEventListener("focus",e),window.addEventListener("pageshow",e),e(),()=>{clearInterval(t),document.removeEventListener("visibilitychange",e),window.removeEventListener("focus",e),window.removeEventListener("pageshow",e)}},[M,rI,sa,6e4,12e4]),(0,h.useEffect)(()=>{S.current&&(S.current.style.height="auto",S.current.style.height="".concat(S.current.scrollHeight,"px"))},[E]);let ss=e=>{T(e.target.value),n6.noteTyped(e.target.value),e.target.value&&!G&&av()},sl=(0,h.useCallback)(e=>{T(e),n6.noteChipApplied(),e&&!G&&av()},[G,n6.noteChipApplied]),si=e=>{if("Enter"===e.key&&!e.shiftKey){if(e.preventDefault(),aS&&E.trim())return void aj(!0);if(r6)return void n0();sN(e)}};(0,h.useEffect)(()=>{try{let e=window.localStorage.getItem(am);if(null===e||"null"===e||""===e)return;let t=Number(e);!Number.isNaN(t)&&t>=0&&a4(t)}catch(e){}},[]),(0,h.useEffect)(()=>{try{window.localStorage.setItem(am,null===a5?"null":String(a5))}catch(e){}},[a5]),(0,h.useEffect)(()=>{let e=[...an].sort(()=>.5-Math.random());D(Array(an.length).fill(e).flat())},[]),(0,h.useEffect)(()=>{if(ef||!G||ex.current)return;let e=null;try{e=localStorage.getItem(af)}catch(e){return}if(!e)return;let t="".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2));try{localStorage.setItem(ah,t)}catch(e){return}let r=setTimeout(()=>{let r=null;try{r=localStorage.getItem(ah)}catch(e){}if(r===t){ex.current=!0;try{localStorage.removeItem(af),localStorage.removeItem(ah),"undefined"!=typeof document&&(document.cookie="".concat(ax,"=; path=/; max-age=0; SameSite=Lax"))}catch(e){}try{let t=JSON.parse(e);"string"==typeof t.prompt&&t.prompt.trim()&&(T(t.prompt),"string"==typeof t.inspirationImage&&tl(t.inspirationImage),eB(!0))}catch(e){console.warn("[ImaginePage] failed to parse pending prompt:",e)}}},60);return()=>clearTimeout(r)},[G,ef,e3]),(0,h.useEffect)(()=>{G&&e9&&ta(!1)},[G,e9]),(0,h.useEffect)(()=>{if("undefined"==typeof document)return;let e=()=>{"visible"===document.visibilityState&&e6(e=>e+1)};return document.addEventListener("visibilitychange",e),()=>document.removeEventListener("visibilitychange",e)},[]),(0,h.useEffect)(()=>{G&&(0,eH.U)().auth.getSession().then(e=>{let{data:{session:t}}=e;t&&fetch("/api/reference-history",{headers:{Authorization:"Bearer ".concat(t.access_token)}}).then(e=>e.ok?e.json():null).then(e=>{var t;let r=null==e||null==(t=e.history)?void 0:t.filter(e=>!e.isProposal);(null==r?void 0:r.length)&&tf(r)}).catch(()=>{})})},[G]);let[so,sd]=(0,h.useState)(0),[sc,su]=(0,h.useState)(!1);(0,h.useEffect)(()=>{if(L.length>0&&!sc){let e=setInterval(()=>{sd(e=>(e+1)%L.length)},5500);return()=>clearInterval(e)}},[L.length,sc]);let sm=(0,h.useCallback)(e=>{if(!(0,eY.u)(e))return void F(ag);let t=++ti.current;(0,eW.ID)(e).then(e=>{let{dataUrl:r}=e;ti.current===t&&(F(""),tl(r))}).catch(e=>{ti.current===t&&(console.error("Failed to read inspiration image:",e),F("That image couldn't be read. Try a different one, or one saved on this device."))})},[]),sp=(0,h.useCallback)(()=>{ti.current+=1,tl(null)},[]),sf=e=>{var t;let r=null==(t=e.currentTarget.files)?void 0:t[0];e.currentTarget.value="",r&&sm(r)},sh=e=>{e.preventDefault(),e.stopPropagation(),tc(!1);let t=(0,eY.rE)(e.dataTransfer);t?sm(t):Array.from(e.dataTransfer.types).includes("Files")&&F(ag)},sx=e=>{let t=(0,eY.rE)(e.clipboardData);t&&(e.preventDefault(),e.stopPropagation(),sm(t))},sg=e=>{e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect="copy"},sb=e=>{e.preventDefault(),e.stopPropagation(),Array.from(e.dataTransfer.types).includes("Files")&&tc(!0)},sv=e=>{e.preventDefault(),e.stopPropagation(),e.relatedTarget instanceof Node&&e.currentTarget.contains(e.relatedTarget)||tc(!1)},sw=e=>e.map(e=>{var t,r;return{imageUrl:e.imageUrl,blueprint:("catalog"===e.kind||"stock"===e.kind)&&e.blueprint?e.blueprint:null,matchScore:("catalog"===e.kind||"stock"===e.kind)&&null!=(t=e.matchScore)?t:null,estimatedInvestment:"custom"===e.kind&&null!=(r=e.estimatedInvestment)?r:null}}),sj=e=>!!e&&"string"==typeof e.productId,sy=e=>e.map(e=>e.blueprint?e.blueprint:e.estimatedInvestment?{estimatedInvestment:e.estimatedInvestment}:null),sk=()=>{0!==tk.length&&tV&&tf(e=>e.some(e=>e.images[0]===tk[0])?e:[{id:tE||void 0,parentId:aU,prompt:tV,images:[...tk],variations:[...tH],suggestionQuestion:tQ,timestamp:Date.now(),tileBlueprints:sy(tg),tileScores:ne(tg),kind:aq.current,noInvestmentMode:no},...e])},sN=async(e,t)=>{var r,a,s,l,i,o,d;null==e||e.preventDefault();let c=null!=t?t:r$;if(F(""),tU(null),aT(!1),n6.noteSubmitted(),!E.trim())return void F("Please enter a prompt");if(!G){try{localStorage.setItem(af,JSON.stringify({prompt:E.trim(),inspirationImage:null!=ts?t
1s:null})),"undefined"!=typeof document&&(document.cookie="".concat(ax,"=1; path=/; max-age=1800; SameSite=Lax"))}catch(e){console.warn("[ImaginePage] failed to stash pending prompt:",e)}eT("imagine_generate_auth_gate"),ta(!0);return}eT(tV?"imagine_regenerate_submitted":"imagine_generate_submitted"),sk(),t_(!0);let u=E.trim(),m=!!tV&&u!==tV,p=m?null:nr,f=m?null:nn,h=m?null:nl;m&&nr&&(na(null),ns(null),ni(null));let x=()=>{rq.current=!0,rF.current=null},g=(0,e4.b)(),b=(null==c?void 0:c.kind)==="brand"?c.brand.brand_id:void 0,v=no?{prompt:u,inspirationImage:ts||void 0,...eV(no),brandId:b,parentRequestId:null!=tE?tE:void 0,clientRequestId:g}:{prompt:u,inspirationImage:ts||void 0,lockedLane:null!=p?p:void 0,lockedBlueprint:"catalog"===p&&null!=f?f:void 0,lockedMatchScore:"catalog"===p&&null!=h?h:void 0,brandId:b,clientRequestId:g};rF.current={clientRequestId:g,body:v,kind:"generate"},rq.current=!1,rz.current=!1,rG.current=0,rV.current=!1;let w=async e=>{if(e.tiles&&e.tiles.length>0){var t,r;let a=sw(e.tiles);eT(eL(a.filter(e=>e.blueprint).length)),ty(a),tT(e.id||null),np(null!=(t=e.catalogLabelUrl)?t:null),nh(null!=(r=e.catalogLimitations)?r:null),t$(u),tJ(e.variations||[]),t1(e.suggestionQuestion||""),aF([]),aq.current=no?"noInvestment":"generate",az(no&&null!=tE?tE:null),nd(no),await tF()}else eT("imagine_generate_failed_error"),F("Failed to generate reference images")};try{let e=await n.A.post("/api/generate/imagine-tiles",v,{timeout:9e4});if((null==(r=rF.current)?void 0:r.clientRequestId)!==g||rq.current)return;rz.current=!1,x(),await w(e.data)}catch(r){if(rz.current)return;let e=r;if((null==e||null==(a=e.response)?void 0:a.status)===401&&!rV.current){rV.current=!0;try{let e=(0,eH.U)(),{data:{session:t}}=await e.auth.getSession();if(null==t?void 0:t.access_token){console.log("[ImaginePage] auth-race self-heal: 401 on imagine-tiles, replaying with refreshed Bearer token");let e=await n.A.post("/api/generate/imagine-tiles",v,{timeout:9e4,headers:{Authorization:"Bearer ".concat(t.access_token)}});if((null==(o=rF.current)?void 0:o.clientRequestId)!==g||rq.current)return;rz.current=!1,x(),console.log("[ImaginePage] auth-race self-heal: replay succeeded"),await w(e.data);return}console.warn("[ImaginePage] auth-race self-heal: no client session on 401, treating as signed out")}catch(t){console.warn("[ImaginePage] auth-race self-heal: replay failed:",t),e=t}}if((null==e||null==(s=e.response)?void 0:s.status)===402){let t=e.response.data;if((0,eS.z)(t)){x(),eT("imagine_generate_failed_threshold"),t9(t),t6(!0),t_(!1);return}}if((null==e||null==(l=e.response)?void 0:l.status)===400){let t=e.response.data;if((null==t?void 0:t.code)==="RESTRICTED_PRODUCT_TYPE"){x(),eT("imagine_generate_failed_restricted"),ra(t.suggestion),rt(!0);return}if((null==t?void 0:t.code)===eA.hf){x(),eT("imagine_generate_failed_content_policy"),rs(null!=(d=t.refusalCategory)?d:"unspecified");return}if((null==t?void 0:t.code)==="INVALID_PRODUCT_TYPE"){x(),eT("imagine_generate_failed_invalid"),rd({message:t.message||"This doesn't appear to be a physical product we can help you create.",suggestion:t.suggestion}),ri(!0);return}if(null==t?void 0:t.message){x(),eT("imagine_generate_failed_invalid"),F(t.message);return}}if(rq.current)return;if(console.error("Generation error:",e),"undefined"!=typeof document&&"hidden"===document.visibilityState)return void console.log("[ImaginePage] Network error while tab hidden, deferring to visibility-change retry");if(!(null==e?void 0:e.response)&&!(null==(i=n.A.isCancel)?void 0:i.call(n.A,e))){console.log("[ImaginePage] Transport error while tab visible, triggering failsafe retry"),sr("transport error");return}let t=await st(g);if(rz.current)return;if(x(),t){console.log("[ImaginePage] Recovered server-persisted tiles after a non-2xx response"),await w(t);return}eT("imagine_generate_failed_error"),F("Failed to generate images")}finally{!rz.current&&rq.current&&t_(!1)}};(0,h.useEffect)(()=>{eD&&G&&E.trim()&&(eB(!1),sN())},[eD,E,G]);let s_=async(e,t)=>{var r,a,n,s,l,i,o,d;let c,u;if(tN||M)return;if(F(""),!G)return void ta(!0);let m=tV.trim();if(!m)return void F("Please generate images first");
1if((null==(r=t5["ref-".concat(e)])?void 0:r.status)==="failed")return void F("This image couldn't be loaded. Please try regenerating.");tU(e);let p=tk[e],f=null!=(l=null!=(s=null==t?void 0:t.catalogBlueprintOverride)?s:a6[e])?l:null;eT(f?"imagine_confirm_catalog":"imagine_confirm_custom"),f&&(c={variantId:"",preferredVariantId:f.variantId,productId:f.productId,supplierKey:f.supplierName,productTitle:f.title,productCategory:null!=(i=f.category)?i:null,productDescription:null!=(o=f.description)?o:void 0,options:{},availableOptions:{},specs:void 0,defaultPrice:null,currency:null,providerName:f.providerName,providerCountry:f.providerCountry,leadTimeDays:null!=f.deliveryMinDays&&null!=f.deliveryMaxDays?{min:f.deliveryMinDays,max:f.deliveryMaxDays}:null,optionAxes:f.optionAxes,configuredOptions:f.configuredOptions,offerSnapshot:f.offerSnapshot,preservePreferredVariant:f.preserveVariantSelection});let h=f&&(null==(a=nO.current)?void 0:a.productId)===f.productId?nO.current:null;if(f&&(null==t||null==(n=t.availableVariantIds)?void 0:n.length)&&h){let e=new Set(t.availableVariantIds);u=h.variants.filter(t=>e.has(t.variantId)).map(e=>({variantId:e.variantId,options:e.options,price:e.price,currency:e.currency}))}if(rM.current={promptToUse:m,selectedUrl:p,catalogPayload:c,createCatalogArg:f?{sourcingType:"simplified",blueprint:f,category:a3,availableVariants:u,labelUrl:"stock"===eG(f)?null:null!=(d=f.labelUrl)?d:nm}:null},(null==r$?void 0:r$.kind)==="brand")return void sC({brandId:r$.brand.brand_id});if((null==r$?void 0:r$.kind)==="new")return void sC({autoCreateBrand:!0});if(a_){eT("imagine_brand_failsafe_shown"),aP(!0);return}sC({autoCreateBrand:!0})},sC=async e=>{var t;let{brandId:r,autoCreateBrand:a}=e;if(rj.current)return;rj.current=!0;let n=rM.current;if(!n){rj.current=!1;return}let{promptToUse:s,selectedUrl:l,catalogPayload:i,createCatalogArg:o}=n,d=tk.indexOf(l);t3(l),R(!0),rS(!1),U();let c="".concat(s,"::").concat(l),u=(null==(t=r_.current)?void 0:t.key)===c?r_.current.clientRequestId:(0,e4.b)();r_.current={key:c,clientRequestId:u};let m={prompt:s,selectedImageUrl:l,clientRequestId:u,refineCatalog:i,createCatalog:o,brandId:r,autoCreateBrand:a,referenceRequestId:tE,tileIndex:d>=0?d:void 0,confirmedAt:Date.now()};rg.current=m,G&&eZ(G.id,m),rb.current=!1,rE.current=0,rv.current=!1,rk.current=0,rA.current=m.confirmedAt,rD.current=!1,rS(!1),await n9(m,{isReplay:!1})},sI=(0,h.useCallback)(e=>nc(tg[e]),[tg,nc]),sS=e=>{var t,r;tN||M||(null==(t=t5["ref-".concat(e)])?void 0:t.status)==="failed"||(!aE||tq!==e)&&((0,eE.D)("imagine","imagine_tile_selected"),eT((null==(r=tg[e])?void 0:r.blueprint)?"imagine_tile_selected_catalog":"imagine_tile_selected_custom"),tU(e),sI(e),aE||(aT(!0),aD("")))},sA=async(e,t)=>{nY(!0);try{let{data:r}=await n.A.get("/api/catalog/offer-axes",{params:{referenceRequestId:tE,tileIndex:t,preferredVariantId:e.variantId}});
1r.primaryVariantId&&rJ(r.axes,(0,tt.iU)(r.variants))&&r.variants.length>0&&(nO.current=r,nq(r))}catch(e){console.warn("[ImaginePage] details offer-axes fetch failed:",e)}finally{nY(!1)}},sP=async(e,t)=>{if(nT.current=e.productId,nE(!t),t){nO.current=t,nI(t);return}try{let{data:t}=await n.A.get("/api/catalog/offer-axes",{params:{productId:e.productId,preferredVariantId:e.variantId}});if(nT.current!==e.productId)return;nO.current=t,nI(t)}catch(t){console.warn("[ImaginePage] DIY Beverages can-size fetch failed; keeping the tile SKU:",t),nT.current===e.productId&&nI({productId:e.productId,primaryVariantId:e.variantId,axes:[],defaultOffers:[],variants:[]})}finally{nT.current===e.productId&&nE(!1)}},sE=(e,t)=>{var r;let a=tg[e];if(!a||!a.blueprint&&!nV)return;eT(a.blueprint?"imagine_catalog_details":"imagine_investment_details");let n=!!a.blueprint&&e8({hasUser:!!G,subscriptionLoading:nG,isSubscribed:nV,optionAxes:a.blueprint.optionAxes,supplierName:a.blueprint.supplierName});ng(a.blueprint?null:null!=(r=a.estimatedInvestment)?r:null),nv(e),nz([]),nA(null),nI(null),nT.current=n&&a.blueprint?a.blueprint.productId:null,n&&a.blueprint?(nq(null),sP(a.blueprint,t)):t?(nO.current=t,nq(t)):(nq(null),a.blueprint&&sA(a.blueprint,e)),nj(!0)},sT=(e,t)=>{if(tN||M)return null;let r=(0,a.jsxs)("button",{type:"button",onClick:t=>{t.stopPropagation(),sE(e)},className:"pointer-events-auto -mr-1 inline-flex flex-shrink-0 cursor-pointer items-center gap-1 rounded px-1.5 py-0.5 transition-colors hover:bg-white/15",children:[(0,a.jsx)(H.A,{className:"h-3 w-3"}),"See details"]}),n=eG(t);return"stock"===n||"in_network"===n?(0,a.jsx)("div",{className:"absolute bottom-2 left-2 right-2 z-10 pointer-events-none",children:(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 rounded-lg border border-white/15 bg-black/55 px-2.5 py-1.5 text-[11px] font-medium text-emerald-300 ring-1 ring-inset ring-white/5 backdrop-blur-sm",children:[(0,a.jsxs)("span",{className:"flex min-w-0 items-center gap-1",children:[(0,a.jsx)(J.A,{className:"h-3 w-3 flex-shrink-0"}),(0,a.jsx)("span",{className:"truncate",children:"No investment"})]}),r]})}):a8?(0,a.jsx)("div",{className:"absolute bottom-2 left-2 right-2 z-10 pointer-events-none",children:(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 rounded-lg bg-black/55 px-2.5 py-1.5 text-[11px] font-medium text-amber-300 backdrop-blur-sm",children:[(0,a.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,a.jsx)(J.A,{className:"h-3 w-3 flex-shrink-0"}),(0,a.jsx)("span",{className:"truncate",children:"Requires high investment"})]}),nV&&r]})}):null},sL=!!aL.trim()&&!aM&&null!==tq,sD=()=>(0,a.jsxs)(w.$,{type:"button",variant:sL?"default":"outline",onClick:()=>s0(),disabled:aM||!aL.trim()||null===tq,"aria-label":"Apply change",className:(0,eh.cn)("h-10 justify-center transition-all duration-300 disabled:cursor-not-allowed",sL?(0,eh.cn)(ad,"px-4"):(0,eh.cn)(ap,"w-10 px-0 disabled:opacity-40")),children:[aM?(0,a.jsx)(K.A,{size:16,className:"animate-spin flex-shrink-0"}):(0,a.jsx)(Q.A,{size:16,className:"flex-shrink-0"}),sL&&(0,a.jsx)("span",{className:"whitespace-nowrap text-sm font-semibold",children:"Apply change"})]}),sM=()=>{if(aL.trim()){(0,eE.D)("imagine","imagine_tile_confirm_pending_edit"),aX(!0);return}s2()},sR=null!=(o=aO[0])?o:null,sO=aE&&null!==tq&&sR&&sR.images.length>0?sR.images[Math.min(tq,sR.images.length-1)]:null,sF=()=>{!sO||tN||M||aM||(a$.current=window.setTimeout(()=>{aH.current=!0,aV(!0)},350))},sq=()=>{null!==a$.current&&(window.clearTimeout(a$.current),a$.current=null),aV(!1)},sU=e=>sO&&tq===e?{onPointerDown:sF,onPointerUp:sq,onPointerLeave:sq,onPointerCancel:sq,onContextMenu:e=>e.preventDefault()}:{},sz=e=>aG&&sO&&tq===e?(0,a.jsxs)("div",{className:"absolute inset-0 z-20 pointer-events-none",children:[(0,a.jsx)("img",{src:sO,alt:"Previous version",className:"w-full h-full object-cover"}),(0,a.jsx)("div",{className:"absolute top-2 left-2 rounded-full bg-black/60 px-2.5 py-1 text-[10px] font-semibold text-white backdrop-blur-sm",children:"Before"})]}
1):null,sW=e=>{var t,r;let a=a6[e];return a&&null!=(r=null==nf||null==(t=nf.perBlueprint.find(e=>e.productId===a.productId))?void 0:t.note)?r:null},sY=null!==tq?sW(tq):null,sB=null!==tq&&null!=(d=null==(e=a6[tq])?void 0:e.title)?d:null,sG=tk.some((e,t)=>!!sW(t)),sV=aE&&null!==tq&&"in_network"===eG(null==(t=tg[tq])?void 0:t.blueprint)?tg.map((e,t)=>({idx:t,imageUrl:e.imageUrl,lane:eG(e.blueprint)})).filter(e=>e.idx!==tq&&!!e.imageUrl&&"stock"!==e.lane):[],s$=nV&&aE&&null!==tq&&!(null==(r=tg[tq])?void 0:r.blueprint)&&!no,sH=(0,h.useMemo)(()=>{let e=new Map;for(let t of tp)t.id&&e.set(t.id,t);return e},[tp]),sJ=(0,h.useCallback)(e=>{let t=[],r=new Set,a=null!=e?e:null;for(;a&&!r.has(a);){var n;r.add(a);let e=sH.get(a);if(!e)break;t.push(e),a=null!=(n=e.parentId)?n:null}return t},[sH]),sK=(0,h.useCallback)(e=>{var t,r,a;let n=null!=(t=e.id)?t:"t".concat(e.timestamp),s=new Set([n]),l=null!=(r=e.parentId)?r:null;for(;l&&!s.has(l);){s.add(l);let e=sH.get(l);if(n=l,!e)break;l=null!=(a=e.parentId)?a:null}return n},[sH]),sQ=(0,h.useMemo)(()=>{let e=tk.length>0&&tV?{id:tE||void 0,parentId:aU,prompt:tV,images:[...tk],variations:[...tH],suggestionQuestion:tQ,timestamp:Date.now(),tileBlueprints:sy(tg),tileScores:ne(tg),kind:aq.current,noInvestmentMode:no}:null;if(!e)return[];let t=sK(e),r=e.id,a=tp.filter(a=>(r?a.id!==r:a.images[0]!==e.images[0])&&sK(a)===t),n=e=>sJ(e.parentId).length;return[...a,e].sort((e,t)=>n(e)-n(t)||e.timestamp-t.timestamp)},[tp,sK,sJ,tk,tV,tE,aU,tH,tQ,tg,no]),sZ=sQ.findIndex(e=>tE?e.id===tE:e.images[0]===tk[0]),sX=(0,h.useMemo)(()=>{let e=new Map,t=t=>{var r;let a=null!=(r=t.id)?r:"t".concat(t.timestamp),n=e.get(a);if(n)return n;let s=a,l=new Set([a]),i=t;for(;(null==i?void 0:i.parentId)&&!l.has(i.parentId);){l.add(i.parentId);let e=sH.get(i.parentId);if(!e)break;s=i.parentId,i=e}return e.set(a,s),s},r=new Map;for(let e of tp){let a=t(e),n=r.get(a);(!n||e.timestamp>n.timestamp)&&r.set(a,e)}return Array.from(r.values()).sort((e,t)=>t.timestamp-e.timestamp)},[tp,sH]),s0=async e=>{var t,r,a,s,l,i,o,d,c,u,m,p,f,h,x,g,b;let v=(null==e?void 0:e.styleSwap)===!0,w=(null==e?void 0:e.noInvestment)===!0,j=(null!=(t=null==e?void 0:e.instruction)?t:aL).trim();if(!j&&!v&&!w||aM||null===tq)return;(0,eE.D)("imagine","imagine_tile_edit_submit");let y=tg[tq],k=null!=(r=null==y?void 0:y.blueprint)?r:null,N="stock"===eG(k),_=!w&&!v&&(null!==no||N),C=w||_,I=_&&!no?function(e){for(let r of e){var t;if("in_network"!==eG(r.blueprint))continue;let e=null==(t=r.blueprint)?void 0:t.labelUrl;if(e&&r.imageUrl)return{labelUrl:e,imageUrl:r.imageUrl}}return null}(tg):null,S=w?{designSource:{labelUrl:null!=(a=null==k?void 0:k.labelUrl)?a:null,imageUrl:tk[tq]}}:_?null!=no?no:I?{designSource:I}:null:no,A=k||C?"catalog":"custom";eT(C?"imagine_no_investment_submitted":"imagine_tweak_submitted_".concat(A));let P=tk.length>0&&tV?{id:tE||void 0,parentId:aU,prompt:tV,images:[...tk],variations:[...tH],suggestionQuestion:tQ,timestamp:Date.now(),tileBlueprints:sy(tg),tileScores:ne(tg),kind:aq.current,noInvestmentMode:no}:null;P&&tf(e=>{let t="catalog"===A?"".concat(tV,"::").concat(tk.join("|")):tk[0];return e.some(e=>"catalog"===A?"".concat(e.prompt,"::").concat(e.images.join("|"))===t:e.images[0]===t)?e:[P,...e]}),aQ.current=P,aR(!0),t_(!0);let E=(0,e4.b)(),L={prompt:tV,tweakInstruction:v||w?void 0:j,styleSwap:v||void 0,sourceImageUrl:"custom"===A?tk[tq]:void 0,inspirationImage:null!=(s=null==e?void 0:e.inspirationOverride)?s:ts||void 0,styleSwapSource:null==e?void 0:e.swapSource,...C?eV(S):{},lockedLane:C?void 0:A,lockedBlueprint:C||"catalog"!==A?void 0:null!=k?k:void 0,lockedMatchScore:C||"catalog"!==A?void 0:null!=nl?nl:void 0,previousLabelUrl:"catalog"!==A||v||C?void 0:null!=(l=null==k?void 0:k.labelUrl)?l:void 0,brandId:(null==r$?void 0:r$.kind)==="brand"?r$.brand.brand_id:void 0,parentRequestId:null!=tE?tE:void 0,clientRequestId:E};rF.current={clientRequestId:E,body:L,kind:"tweak"},rq.current=!1,rz.current=!1,rG.current=0;try{let t=await n.A.post("/api/generate/imagine-tiles",L,{timeout:9e4});if((null==(i=rF.current)?void 0:i.clientRequestId)!==E||rq.current)return;if(rz.current=!1,rq.current=!0,rF.current=null,t.data.tiles&&t.data.tiles.length>0){eT(C?"imagine_no_investment_succeeded":"imagine_tweak_succeeded_".concat(A));let r=t.data.effectivePrompt||(j?"".concat(tV," + ").concat(j):tV);(0,eE.D)("imagine","imagine_tile_edit_success"),aq.current=_?"noInvestment":null!=(o=null==e?void 0:e.kind)?o:"tweak",nd(S);let a=sw(t.data.tiles);if(ty(a),az(null!=tE?tE:null),tT(t.data.id||null),t$(r),T(r),"catalog"===A&&(t.data.catalogLabelUrl&&np(t.data.catalogLabelUrl),nh(null!=(d=t.data.catalogLimitations)?d:null)),tJ(t.data.variations||[]),t1(t.data.suggestionQuestion||""),au()){let e=Math.min(tq,a.length-1);tU(e),nc(a[e])}else tU(null),aT(!1);let n=aQ.current;aQ.current=null,n&&aF(e=>[n,...e]),null!==aB.current&&window.clearTimeout(aB.current),aY(!0),aB.current=window.setTimeout(()=>aY(!1),8e3),aD(""),"custom"===A&&tl(null),await tF()}}catch(e){if(rz.current)return;if((null==e||null==(c=e.response)?void 0:c.status)===400&&(null==e||null==(m
1=e.response)||null==(u=m.data)?void 0:u.code)==="PACKAGING_LOCKED"){rq.current=!0,rF.current=null,eT("imagine_tweak_failed_locked");let t=tV.trim();rp(j?t?"".concat(t,"\n\n").concat(j):j:t),ru(null!=(b=e.response.data.message)?b:"");return}if((null==e||null==(p=e.response)?void 0:p.status)===400&&(null==e||null==(h=e.response)||null==(f=h.data)?void 0:f.code)==="NO_CATALOG_MATCH"){rq.current=!0,rF.current=null,eT("imagine_no_investment_failed_no_catalog_match"),F(e.response.data.message||"We couldn't find a ready-to-sell alternative right now. Please try again in a moment.");return}if(console.error("Tweak error:",e),(null==e||null==(x=e.response)?void 0:x.status)===402){let t=e.response.data;if((0,eS.z)(t)){rq.current=!0,rF.current=null,eT(C?"imagine_no_investment_failed_threshold":"imagine_tweak_failed_threshold"),t9(t),t6(!0),t_(!1),aR(!1);return}}if(rq.current||"undefined"!=typeof document&&"hidden"===document.visibilityState)return;if(!(null==e?void 0:e.response)&&!(null==(g=n.A.isCancel)?void 0:g.call(n.A,e)))return void sr("tweak transport error");rq.current=!0,rF.current=null,eT(C?"imagine_no_investment_failed_error":"imagine_tweak_failed_error"),F(C?"Failed to find an alternative":"Failed to edit images")}finally{!rz.current&&rq.current&&(t_(!1),aR(!1))}},s1=(e,t)=>{var r,a,n,s;let l,i,o;sk();let d=(l=e.images,i=e.tileBlueprints,o=e.tileScores,l.map((e,t)=>{var r,a,n;let s=null!=(r=null==i?void 0:i[t])?r:null;return sj(s)?{imageUrl:e,blueprint:s,matchScore:null!=(a=null==o?void 0:o[s.productId])?a:null,estimatedInvestment:null}:{imageUrl:e,blueprint:null,matchScore:null,estimatedInvestment:null!=(n=null==s?void 0:s.estimatedInvestment)?n:null}}));ty(d),nh((e=>{let t=(null!=e?e:[]).filter(sj).filter(e=>!!e.compromiseNote).map(e=>({productId:e.productId,note:e.compromiseNote}));return t.length>0?{summary:t[0].note,perBlueprint:t}:null})(e.tileBlueprints)),tT(e.id||null),T(e.prompt),t$(e.prompt),tJ(e.variations),t1(e.suggestionQuestion||""),aq.current=null!=(r=e.kind)?r:e.parentId?"tweak":"generate",nd(null!=(a=e.noInvestmentMode)?a:null),az(null!=(n=e.parentId)?n:null),aF(null!=(s=null==t?void 0:t.roundStack)?s:[]);let c=null==t?void 0:t.keepSelectedIndex;if(null!=c&&e.images.length>0){let t=Math.min(c,e.images.length-1);tU(t),aT(!0),nc(d[t])}else tU(null),aT(!1);aD(""),tx(!1)},s2=async()=>{var e;if(null===tq||nM)return;(0,eE.D)("imagine","imagine_tile_confirm");let t=null!=(e=a6[tq])?e:null;if(t){let e=e8({hasUser:!!G,subscriptionLoading:nG,isSubscribed:nV,optionAxes:t.optionAxes,supplierName:t.supplierName});nR(!0);try{let{data:r}=await n.A.get("/api/catalog/offer-axes",{params:{referenceRequestId:tE,tileIndex:tq,preferredVariantId:t.variantId}});if(nO.current=r,e||r.primaryVariantId&&rJ(r.axes,(0,tt.iU)(r.variants)
1)&&r.variants.length>0){nR(!1),sE(tq,r);return}}catch(r){if(console.warn("[ImaginePage] offer-axes fetch failed; proceeding with the catalog defaults:",r),e){nR(!1),sE(tq,{productId:t.productId,primaryVariantId:t.variantId,axes:[],defaultOffers:[],variants:[]});return}}nR(!1)}aT(!1),s_(tq)},s5=e=>{null!==nN&&(n_(null),nD(null),aT(!1),s_(nN,{availableVariantIds:e}))},s4=()=>{nj(!1),nq(null),nz([]),nI(null),nA(null),nE(!1),nT.current=null},s3=()=>{eT("imagine_back_to_prompt"),sk(),ty([]),na(null),ns(null),ni(null),nd(null),T(""),t$(""),tU(null),aT(!1),aD("")},s7=null!==nb&&null!=(c=tg[nb])?c:null,s6=null!=(u=null==s7?void 0:s7.blueprint)?u:null,s8=eG(s6),s9=!!s6,le="stock"===s8,lt=(0,h.useMemo)(()=>{var e,t;if(!le)return[];let r=(null!=(t=null==s6||null==(e=s6.offerSnapshot)?void 0:e.allSkus)?t:[]).filter(e=>e.available&&"string"==typeof e.imageUrl&&e.imageUrl.length>0);return r.length<2?[]:r.slice(0,8).map(e=>{var t;return{skuId:e.skuId,imageUrl:e.imageUrl,label:Object.values(null!=(t=e.displayOptions)?t:e.options).join(" / ")||"Variant"}})},[le,s6]),lr=!!s6&&e8({hasUser:!!G,subscriptionLoading:nG,isSubscribed:nV,optionAxes:s6.optionAxes,supplierName:s6.supplierName}),la=s6&&null!=(m=null==nf||null==(l=nf.perBlueprint.find(e=>e.productId===s6.productId))?void 0:l.note)?m:null,ln=(()=>{if(!s6)return"Made to order";let e=s6.deliveryMinDays,t=s6.deliveryMaxDays;return null!=e&&null!=t?e===t?"Ships in ".concat(e," days"):"Ships in ".concat(e," to ").concat(t," days"):null!=e?"Ships in ~".concat(e," days"):null!=t?"Ships in ~".concat(t," days"):"Made to order"})();return(0,a.jsxs)("div",{[eR.n]:"",className:"jsx-4cf1a57fb90b2e2b flex flex-grow overflow-hidden relative",children:[(0,a.jsx)(V(),{id:"4cf1a57fb90b2e2b",children:"@keyframes ref-stripes{from{background-position:0 0}to{background-position:1rem 0}}@keyframes slow-bounce{0%,100%{transform:translatey(0)}50%{transform:translatey(-6px)}}.animate-slow-bounce.jsx-4cf1a57fb90b2e2b{animation:slow-bounce 2s ease-in-out infinite}.ref-stripes-animate.jsx-4cf1a57fb90b2e2b{background-image:linear-gradient(45deg,rgba(255,255,255,.35)25%,transparent 25%,transparent 50%,rgba(255,255,255,.35)50%,rgba(255,255,255,.35)75%,transparent 75%,transparent);background-size:1rem 1rem;animation:ref-stripes 1s linear infinite}@keyframes shimmer{0%{background-position:-200%0}100%{background-position:200%0}}.animate-shimmer.jsx-4cf1a57fb90b2e2b{background:linear-gradient(90deg,transparent 0%,rgba(255,255,255,.08)50%,transparent 100%);background-size:200%100%;animation:shimmer 3s ease-in-out infinite}"}),!r3&&(0,a.jsx)("div",{className:"jsx-4cf1a57fb90b2e2b absolute inset-0 w-full h-full overflow-hidden z-[0]",children:(0,a.jsxs)("video",{autoPlay:!0,loop:!0,muted:!0,playsInline:!0,className:"jsx-4cf1a57fb90b2e2b w-full h-full object-cover",children:[(0,a.jsx)("source",{src:"/videos/s-2th-transcode.mp4",type:"video/mp4",className:"jsx-4cf1a57fb90b2e2b"}),(0,a.jsx)("source",{src:"/videos/s-2th-transcode.webm",type:"video/webm",className:"jsx-4cf1a57fb90b2e2b"})]})}),(0,a.jsx)("div",{ref:A,[eN.D]:"",className:"jsx-4cf1a57fb90b2e2b relative z-10 w-full h-full overflow-y-auto overflow-x-hidden",children:(0,a.jsxs)("div",{className:"jsx-4cf1a57fb90b2e2b "+((0,eh.cn)("flex flex-col items-center","px-4 py-5 md:p-5",!G&&"pt-[60px] md:pt-[88px]",n4&&(G?"pt-0 md:pt-2":"pt-[60px]"),M&&t4||tk.length>0?"h-full":"w-full")||""),children:[M&&t4?(0,a.jsx)(rL.Ay,{imageUrl:t4,progress:q,progressMessages:rR?as:rL.Nt,className:"flex-1 w-full z-20",showVideoBackground:!1,onComplete:sn,tips:[]}):null,rI&&M&&(0,a.jsx)("div",{className:"jsx-4cf1a57fb90b2e2b fixed inset-x-0 bottom-0 z-50 flex justify-center p-4",children:(0,a.jsxs)("div",{className:"jsx-4cf1a57fb90b2e2b flex w-full max-w-md flex-col gap-3 rounded-2xl border border-foreground
1/15 bg-[#fffdfa] px-5 py-4 shadow-xl sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"jsx-4cf1a57fb90b2e2b min-w-0",children:[(0,a.jsx)("p",{className:"jsx-4cf1a57fb90b2e2b text-sm font-semibold text-foreground",children:rf?"Your product is ready":"This is taking longer than usual"}),(0,a.jsx)("p",{className:"jsx-4cf1a57fb90b2e2b text-xs text-muted-foreground",children:rf?"This page is taking too long to open it. Nothing is lost.":"Your product is still being built. Nothing is lost, and you can check on it any time."})]}),(0,a.jsx)(w.$,{asChild:!0,className:"flex-shrink-0 border-0 bg-gradient-to-r from-emerald-500 to-emerald-600 text-white hover:from-emerald-600 hover:to-emerald-700",children:(0,a.jsxs)("a",{href:rf?"/?mode=refine&page_id=".concat(rf):"/",className:"jsx-4cf1a57fb90b2e2b",children:[rf?"Open my product":"Go to my products",(0,a.jsx)(X.A,{className:"h-4 w-4"})]})})]})}),M&&t4?null:tk.length>0?(0,a.jsxs)("div",{className:"jsx-4cf1a57fb90b2e2b flex flex-col items-center w-full shrink-0 relative min-h-[calc(100dvh-7rem)] md:min-h-[calc(100dvh-9rem)]",children:[(0,a.jsxs)("div",{className:"jsx-4cf1a57fb90b2e2b text-center w-full space-y-2 relative z-20 max-w-5xl mt-auto",children:[(0,a.jsx)("div",{className:"jsx-4cf1a57fb90b2e2b space-y-[clamp(0.375rem,1.1dvh,0.75rem)]",children:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"jsx-4cf1a57fb90b2e2b mb-[clamp(0.5rem,1.6dvh,1.5rem)] md:mb-3",children:(0,a.jsx)("h2",{className:"jsx-4cf1a57fb90b2e2b text-xl text-muted-foreground font-light max-w-xl mx-auto leading-relaxed",children:aE?(0,a.jsx)("span",{className:"jsx-4cf1a57fb90b2e2b hidden md:inline",children:no?"Refine your no-investment search":nu?"Edit your label":"Edit your product"}):(0,a.jsx)("span",{className:"jsx-4cf1a57fb90b2e2b hidden md:inline",children:"Select your draft product visuals"})})}),(0,a.jsxs)("div",{className:"jsx-4cf1a57fb90b2e2b md:hidden mb-2 -mx-4",children:[(0,a.jsxs)("div",{ref:tz,style:ep.M0,className:"jsx-4cf1a57fb90b2e2b "+((0,eh.cn)(ep.pp,ep.dm)||""),children:[(0,a.jsx)("div",{className:"jsx-4cf1a57fb90b2e2b "+((0,eh.cn)(ep.wY,"relative pb-[clamp(0.5rem,1.2dvh,1rem)]")||""),children:(0,a.jsxs)("div",{onClick:e=>{var t,r;tN||M||(null==(t=e.currentTarget.closest(".snap-center"))||t.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"}),aT(!1),tU(null),aD(""),null==(r=S.current)||r.focus())},className:"jsx-4cf1a57fb90b2e2b "+((0,eh.cn)("aspect-square relative rounded-xl overflow-hidden border-2 border-dashed transition-all duration-300 ease-out flex flex-col items-center justify-center gap-3",tN||M?"cursor-not-allowed opacity-50 border-muted-foreground/20":"cursor-pointer border-muted-foreground/40 active:scale-95",-1===tY?"bg-muted/50 border-primary/50":"bg-muted/30 opacity-60 scale-95")||""),children:[(0,a.jsx)(K.A,{className:"h-8 w-8 text-muted-foreground/60"}),(0,a.jsx)("span",{className:"jsx-4cf1a57fb90b2e2b text-sm font-medium text-muted-foreground/70 text-center px-4",children:"Start over"})]})}),nt.map(e=>{let t=tk[e],r=t5["ref-".concat(e)],n=(null==r?void 0:r.status)==="failed",s=(null==r?void 0:r.url)||t,l=tY===e,i=a6[e];return(0,a.jsx)("div",{className:"jsx-4cf1a57fb90b2e2b "+((0,eh.cn)(ep.wY,"relative pb-[clamp(0.5rem,1.2dvh,1rem)]")||""),children:(0,a.jsx)("div",{className:"jsx-4cf1a57fb90b2e2b "+((0,eh.cn)("overflow-hidden rounded-xl border-2 shadow-xl transition-all duration-300 ease-out group",tN||M||n?"opacity-50":"",l?"border-primary ring-4 ring-primary/25 shadow-2xl shadow-primary/20":"border-white/20 opacity-60 scale-95")||""),children:(0,a.jsxs)("div",{...sU(e),onClick:t=>{var r;if(aH.current){aH.current=!1;return}if(!tN&&!M&&!n){if(tq===e)return void sE(e);null==(r=t.currentTarget.closest(".snap-center"))||r.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"}),sS(e)}},className:"jsx-4cf1a57fb90b2e2b "+((0,eh.cn)("relative aspect-square overflow-hidden",tN||M||n?"cursor-not-allowed":"cursor-pointer")||""),children:[(0,a.jsx)("img",{src:s,alt:"Reference ".concat(e+1),className:"jsx-4cf1a57fb90b2e2b w-full h-full object-cover"}),sT(e,i),sz(e),tN&&(0,a.jsx)("div",{className:"jsx-4cf1a57fb90b2e2b absolute inset-0 bg-black/40 backdrop-blur-sm pointer-events-none z-10"})]})})},t)})]}),(0,a.jsxs)("div",{className:"jsx-4cf1a57fb90b2e2b flex justify-center gap-2 mt-[clamp(0.375rem,1dvh,0.75rem)]",children:[(0,a.jsx)("button",{type:"button",onClick:()=>{let e=tz.current;if(!e)return;let t=e.children[0];t&&t.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})},className:"jsx-4cf1a57fb90b2e2b "+((0,eh.cn)("w-2 h-2 rounded-full transition-all duration-300",-1===tY?"bg-muted-foreground
1/60 w-6":"bg-muted-foreground/30")||"")}),nt.map((e,t)=>(0,a.jsx)("button",{type:"button",onClick:()=>{let e=tz.current;if(!e)return;let r=e.children[t+1];r&&r.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})},className:"jsx-4cf1a57fb90b2e2b "+((0,eh.cn)("w-2 h-2 rounded-full transition-all duration-300",tY===e?"bg-primary w-6":"bg-muted-foreground/30")||"")},e))]})]}),(0,a.jsx)("div",{style:tg.length>=3?{maxWidth:"min(64rem, calc(3 * (100dvh - 30rem) + 3rem))"}:void 0,className:"jsx-4cf1a57fb90b2e2b "+((0,eh.cn)("hidden md:grid gap-6 mb-2 mx-auto w-full",!aE&&"pb-0",1===tg.length&&"grid-cols-1 max-w-sm",2===tg.length&&"grid-cols-2 max-w-2xl",tg.length>=3&&"grid-cols-3")||""),children:tg.map((e,t)=>(e=>{let t=tk[e],r=t5["ref-".concat(e)],n=(null==r?void 0:r.status)==="failed",s=(null==r?void 0:r.url)||t,l=a6[e],i=aE&&tq===e;return(0,a.jsx)("div",{className:"relative pb-5",children:(0,a.jsx)("div",{className:(0,eh.cn)("relative overflow-hidden rounded-xl border-2 shadow-xl transition-all duration-300 ease-out group",tN||M||n?"opacity-50":"hover:scale-[1.03] hover:-translate-y-2 hover:shadow-2xl hover:shadow-primary/20",i?"border-primary ring-4 ring-primary/25 shadow-2xl shadow-primary/20":"border-white/20 hover:border-white/60",aE&&null!==tq&&tq!==e&&!tN&&!M&&"grayscale hover:grayscale-[50%]"),children:(0,a.jsxs)("div",{className:(0,eh.cn)("relative aspect-square overflow-hidden",tN||M||n?"cursor-not-allowed":"cursor-pointer"),...sU(e),onClick:()=>{if(aH.current){aH.current=!1;return}if(!tN&&!M&&tq===e)return void sE(e);sS(e)},children:[(0,a.jsx)("img",{src:s,alt:"Reference ".concat(e+1),className:(0,eh.cn)("w-full h-full object-cover transition-transform duration-500 ease-out group-hover:scale-110",i&&"scale-110")}),sT(e,l),sz(e),tN&&(0,a.jsx)("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm pointer-events-none z-10"}),(0,a.jsx)("div",{className:"absolute inset-0 opacity-0 group-hover:opacity-100 pointer-events-none overflow-hidden",children:(0,a.jsx)("div",{className:"absolute inset-0 -translate-x-full group-hover:translate-x-full transition-transform duration-700 ease-out bg-gradient-to-r from-transparent via-white/25 to-transparent skew-x-12"})}),(0,a.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/20 via-transparent to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300 pointer-events-none"}),!aE&&null===tq&&!tN&&!M&&(0,a.jsxs)("div",{className:"absolute top-2 left-2 z-10 flex items-center gap-1.5 text-white/70 bg-black/20 backdrop-blur-sm rounded-lg px-2.5 py-1.5 pointer-events-none animate-pulse",children:[(0,a.jsx)(ee.A,{className:"h-3 w-3 flex-shrink-0"}),(0,a.jsx)("span",{className:"text-[11px] font-medium",children:"Click to select"})]})]})})},t)})(t))}),(0,a.jsxs)("div",{className:"jsx-4cf1a57fb90b2e2b mx-auto mb-1 flex min-h-7 max-w-2xl flex-wrap items-center justify-center gap-x-4 gap-y-1 px-4",children:[aW&&aO.length>0&&!tN&&!M&&(0,a.jsxs)("span",{className:"jsx-4cf1a57fb90b2e2b inline-flex items-center gap-2 rounded-full border border-white/60 bg-[#fffdfa]/60 px-3 py-1.5 text-xs font-medium shadow-sm backdrop-blur-md",children:[(0,a.jsx)("span",{className:"jsx-4cf1a57fb90b2e2b text-foreground/60",children:"Change applied"}),(0,a.jsx)("button",{type:"button",onClick:()=>{aY(!1);let[e,...t]=aO;e&&((0,eE.D)("imagine","imagine_tile_round_back"),s1(e,{keepSelectedIndex:tq,roundStack:t}))},className:"jsx-4cf1a57fb90b2e2b font-semibold text-primary hover:underline cursor-pointer",children:"Undo"})]}),sV.length>0&&!tN&&!M&&(0,a.jsxs)(ej.AM,{open:aJ,onOpenChange:aK,children:[(0,a.jsx)(ej.Wv,{asChild:!0,children:(0,a.jsxs)("button",{type:"button",disabled:aM,className:"jsx-4cf1a57fb90b2e2b "+(ac||""),children:[(0,a.jsx)(et.A,{className:"h-3.5 w-3.5"}),"Borrow a look"]})}),(0,a.jsxs)(ej.hl,{side:"top",align:"center",className:"w-80 rounded-2xl border-white/60 bg-[#fffdfa]/85 p-4 shadow-xl backdrop-blur-xl",children:[(0,a.jsx)("p",{className:"jsx-4cf1a57fb90b2e2b text-sm font-medium text-foreground",children:"Keep this product, swap the design"}),(0,a.jsx)("p",{className:"jsx-4cf1a57fb90b2e2b mt-1 text-xs text-muted-foreground",children:"Pick a tile to get this product's specs with its design."}),(0,a.jsx)("div",{className:"jsx-4cf1a57fb90b2e2b mt-3 flex justify-center gap-3",children:sV.map(e=>{let{idx:t,imageUrl:r}=e;return(0,a.jsx)("button",{type:"button",onClick:()=>{aK(!1),(e=>{var t,r,a,n;let s=tg[e];!s||aM||tN||M||null===tq||(eT("imagine_look_swap_submitted"),s0({inspirationOverride:null!=(a=null==(t=s.blueprint)?void 0:t.labelUrl)?a:s.imageUrl,swapSource:{labelUrl:null!=(n=null==(r=s.blueprint)?void 0:r.labelUrl)?n:null,imageUrl:s.imageUrl},kind:"lookSwap",styleSwap:!0}))})(t)},className:"jsx-4cf1a57fb90b2e2b aspect-square min-w-0 flex-1 cursor-pointer overflow-hidden rounded-xl border-2 border-white/70 shadow-sm transition-all hover:scale-[1.02] hover:border-primary",children:(0,a.jsx)("img",{src:r,alt:"Another tile from this round",className:"jsx-4cf1a57fb90b2e2b h-full w-full object-cover"})},t)})})]})]}),s$&&!tN&&!M&&(0,a.jsxs)("button",{type:"button",onClick:()=>
1{!s$||aM||tN||M||s0({kind:"noInvestment",noInvestment:!0})},disabled:aM,className:"jsx-4cf1a57fb90b2e2b "+(ac||""),children:[(0,a.jsx)(er.A,{className:"h-3.5 w-3.5"}),"Find a no-investment alternative"]}),no&&!tN&&!M&&(0,a.jsxs)("button",{type:"button",onClick:()=>{no&&((0,eE.D)("imagine","imagine_no_investment_mode_left"),nd(null))},disabled:aM,className:"jsx-4cf1a57fb90b2e2b "+(ac||""),children:[(0,a.jsx)(er.A,{className:"h-3.5 w-3.5"}),"Leave no-investment mode"]}),sG&&!tN&&!M&&(0,a.jsx)("div",{className:"jsx-4cf1a57fb90b2e2b mt-1 flex min-h-[2.75rem] basis-full items-center justify-center",children:sY&&(0,a.jsxs)("p",{className:"jsx-4cf1a57fb90b2e2b flex items-start gap-1.5 rounded-xl border border-amber-300/70 bg-amber-50/70 px-3 py-1.5 text-left text-[11px] leading-snug text-amber-900 shadow-sm backdrop-blur-md",children:[(0,a.jsx)(H.A,{className:"mt-px h-3 w-3 flex-shrink-0 text-amber-700"}),(0,a.jsxs)("span",{className:"jsx-4cf1a57fb90b2e2b",children:[sB&&(0,a.jsxs)("span",{className:"jsx-4cf1a57fb90b2e2b font-semibold",children:[sB,": "]}),sY," Ask for a change below, or confirm."]})]})})]})]})}),(0,a.jsx)("form",{className:"jsx-4cf1a57fb90b2e2b w-full mt-[clamp(0.5rem,1.4dvh,1rem)] mb-auto",children:(0,a.jsxs)("div",{className:"jsx-4cf1a57fb90b2e2b max-w-2xl mx-auto pb-4 md:pb-0",children:[(0,a.jsxs)("div",{onDrop:sh,onPaste:sx,onDragOver:sg,onDragEnter:sb,onDragLeave:sv,className:"jsx-4cf1a57fb90b2e2b "+((0,eh.cn)("w-full font-sans border outline-none overflow-hidden rounded-3xl bg-card text-foreground shadow-lg focus-within:border-input focus-within:shadow-xl transition-all duration-300 flex flex-col relative",td?"border-primary border-dashed":tN?"border-primary/20":"border-border")||""),children:[td&&(0,a.jsx)(ab,{}),tN&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"jsx-4cf1a57fb90b2e2b absolute inset-0 pointer-events-none z-0 rounded-3xl overflow-hidden",children:(0,a.jsx)("div",{style:{width:"".concat(tC,"%"),...tC<100?{maskImage:"linear-gradient(to right, black 95%, transparent 100%)",WebkitMaskImage:"linear-gradient(to right, black 95%, transparent 100%)"}:{}},className:"jsx-4cf1a57fb90b2e2b h-full bg-primary/[0.15] transition-[width] duration-300 ease-out ref-stripes-animate"})}),(0,a.jsxs)("div",{className:"jsx-4cf1a57fb90b2e2b absolute right-2 top-2 z-20 pointer-events-none flex items-center gap-2 rounded-full bg-background/90 backdrop-blur-sm border border-border px-3 py-1 shadow-sm max-w-[calc(100%-1rem)]",children:[(0,a.jsx)(K.A,{className:"h-3.5 w-3.5 text-primary animate-spin flex-shrink-0"}),(0,a.jsx)("span",{className:"jsx-4cf1a57fb90b2e2b text-xs font-medium text-foreground truncate",children:ao(tC)}),(0,a.jsxs)("span",{className:"jsx-4cf1a57fb90b2e2b text-xs font-semibold text-muted-foreground tabular-nums flex-shrink-0",children:[Math.round(tC),"%"]})]})]}),!a9&&nV&&!nu&&tg.length>0&&!a8&&!tN&&!M&&(0,a.jsx)("div",{className:"jsx-4cf1a57fb90b2e2b relative z-10 flex flex-row items-center justify-between gap-2 px-3 py-2 border-b border-border bg-muted/40 sm:gap-2.5 sm:px-4 sm:py-3",children:(0,a.jsxs)("div",{className:"jsx-4cf1a57fb90b2e2b flex items-start gap-2 text-left",children:[(0,a.jsx)(J.A,{className:"mt-0.5 hidden h-4 w-4 flex-shrink-0 text-amber-600 sm:block"}),(0,a.jsxs)("p",{className:"jsx-4cf1a57fb90b2e2b text-[11px] leading-snug text-muted-foreground sm:text-xs",children:[(0,a.jsx)("span",{className:"jsx-4cf1a57fb90b2e2b font-medium text-foreground",children:"These are custom products."}),s$?(0,a.jsxs)(a.Fragment,{children:[" ","Want one with no investment to start? Tap"," ",(0,a.jsx)("span",{className:"jsx-4cf1a57fb90b2e2b font-medium text-foreground",children:"Find a no-investment alternative"})," above."]}):(0,a.jsx)(a.Fragment,{children:" Select one to find an alternative with no investment to start."})]})]})}),(0,a.jsx)("textarea",{ref:aE?a2:S,value:aE?aL:E,onChange:aE?e=>aD(e.target.value):ss,onKeyDown:aE?e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),s0())}:si,placeholder:aE?no?"Describe the change, we will search no-investment products again":nu?"Ask for a change, e.g. 'more neon'":"Ask for a change, or just confirm":"Describe your product idea...",disabled:tN,rows:aE?1:2,className:"jsx-4cf1a57fb90b2e2b "+((0,eh.cn)("w-full text-base bg-transparent placeholder:text-muted-foreground resize-none outline-none border-none overflow-y-auto max-h-28 transition-opacity duration-300",aE?"px-4 py-3 min-h-[clamp(3rem,8dvh,4.5rem)] md:min-
1h-0 md:max-h-20 md:py-2.5":"p-6 min-h-[5rem] md:min-h-0",tN&&"opacity-40")||"")}),(0,a.jsx)("input",{type:"file",accept:"image/*",onChange:sf,id:"inspiration-upload",className:"jsx-4cf1a57fb90b2e2b hidden"}),(0,a.jsx)("div",{className:"jsx-4cf1a57fb90b2e2b "+((0,eh.cn)("flex px-3 py-2.5 border-t border-border",tH.length>0&&tk.length>0?"items-end":"items-center")||""),children:tH.length>0&&tk.length>0?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"jsx-4cf1a57fb90b2e2b hidden md:flex flex-col items-start gap-1 mr-auto pr-3 border-r border-border min-w-0 overflow-hidden text-left",children:[(0,a.jsx)("span",{className:"jsx-4cf1a57fb90b2e2b text-xs text-muted-foreground/60 font-medium pl-1",children:tQ?"Suggestion: ".concat(tQ):"Suggestions"}),(0,a.jsx)("div",{className:"jsx-4cf1a57fb90b2e2b flex items-center gap-1.5 flex-wrap overflow-hidden max-h-[30px] justify-start",children:tH.map((e,t)=>(0,a.jsx)("button",{type:"button",onClick:()=>{aE?(eT("imagine_suggestion_clicked_tweak"),aD(t=>t?"".concat(t," ").concat(e.label):e.label)):(eT("imagine_suggestion_clicked_prompt"),T(t=>(function(e,t){let r=t.trim(),a=e.trimEnd();if(!r)return e;if(!a.trim())return r;if(a.toLowerCase().includes(r.toLowerCase()))return e;let n=/[.,;:!?]$/.test(a)?" ":", ";return"".concat(a).concat(n).concat(r)})(t,e.prompt)))},disabled:tN||M,title:e.prompt,className:"jsx-4cf1a57fb90b2e2b "+((0,eh.cn)("flex items-center gap-1.5 px-3 py-1.5 rounded-full text-xs font-medium","border border-border bg-background/80 backdrop-blur-sm","text-muted-foreground hover:text-foreground hover:bg-muted hover:border-foreground
1/20","transition-all duration-200 cursor-pointer","disabled:opacity-50 disabled:cursor-not-allowed","flex-shrink-0",E===e.prompt&&"border-primary text-primary bg-primary/5")||""),children:(0,a.jsx)("span",{className:"jsx-4cf1a57fb90b2e2b whitespace-nowrap",children:e.label})},t))})]}),(0,a.jsxs)("div",{className:"jsx-4cf1a57fb90b2e2b flex items-center gap-2 ml-auto flex-shrink-0 md:pl-3",children:[tp.length>0&&(0,a.jsxs)(ey.m_,{children:[(0,a.jsx)(ey.k$,{asChild:!0,children:(0,a.jsx)("button",{type:"button",onClick:()=>tx(!0),disabled:tN,className:"jsx-4cf1a57fb90b2e2b "+((0,eh.cn)(ap,"h-10 w-10 justify-center cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed")||""),children:(0,a.jsx)(ea.A,{className:"h-5 w-5"})})}),(0,a.jsx)(ey.ZI,{children:"Previous generations"})]}),ts?(0,a.jsxs)("div",{className:"jsx-4cf1a57fb90b2e2b flex items-center gap-2",children:[(0,a.jsx)("img",{src:ts,alt:"Inspiration",className:"jsx-4cf1a57fb90b2e2b h-8 w-8 object-cover rounded-full"}),(0,a.jsx)(w.$,{onClick:sp,variant:"ghost",size:"icon",className:"h-8 w-8 rounded-full",disabled:tN,"aria-label":"Remove inspiration image",children:(0,a.jsx)(en.A,{className:"h-4 w-4"})})]}):(0,a.jsxs)(ey.m_,{children:[(0,a.jsx)(ey.k$,{asChild:!0,children:(0,a.jsx)("label",{htmlFor:tN?void 0:"inspiration-upload","aria-label":"Add an inspiration image",className:"jsx-4cf1a57fb90b2e2b "+((0,eh.cn)(ap,"h-10 w-10 justify-center",tN?"opacity-50 cursor-not-allowed":"cursor-pointer")||""),children:(0,a.jsx)($.A,{className:"h-5 w-5"})})}),(0,a.jsxs)(ey.ZI,{className:"border-none w-68 p-4",children:[(0,a.jsx)("img",{src:"/images/attach.jpeg",alt:"attachment example",className:"jsx-4cf1a57fb90b2e2b w-full h-auto rounded-md mb-2"}),(0,a.jsx)("h2",{className:"jsx-4cf1a57fb90b2e2b text-lg font-semibold",children:"Try adding a file"}),(0,a.jsx)("p",{className:"jsx-4cf1a57fb90b2e2b text-sm text-muted-foreground",children:"Choose an image, paste one from your clipboard, or drop it into the prompt."})]})]}),aE?sD():(0,a.jsx)(w.$,{type:"button",onClick:sN,disabled:tN||M||!E.trim(),className:(0,eh.cn)("h-10 bg-gradient-to-r from-amber-500 to-amber-600 hover:from-amber-600 hover:to-amber-700 shadow-[0_6px_20px_rgba(245,158,11,0.3)] rounded-full gap-0 cursor-pointer flex items-center justify-center transition-all duration-300 disabled:bg-muted disabled:from-muted disabled:to-muted disabled:shadow-none disabled:cursor-not-allowed",tp.length>0?"px-4 md:w-10 md:px-0":"px-4"),"aria-label":"Generate reference images",children:tN?(0,a.jsx)(K.A,{size:20,className:"text-primary animate-spin"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"jsx-4cf1a57fb90b2e2b "+((0,eh.cn)("text-white text-sm font-medium mr-2 whitespace-nowrap",tp.length>0?"md:hidden":"")||""),children:"Regenerate"}),(0,a.jsx)(K.A,{size:20,className:"text-white"})]})})]})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"jsx-4cf1a57fb90b2e2b flex items-center gap-2",children:[!aE&&!nu&&(0,a.jsx)(tR,{onClick:nZ,disabled:tN}),tp.length>0&&(0,a.jsxs)(ey.m_,{children:[(0,a.jsx)(ey.k$,{asChild:!0,children:(0,a.jsx)("button",{type:"button",onClick:()=>tx(!0),disabled:tN,className:"jsx-4cf1a57fb90b2e2b "+((0,eh.cn)(ap,"h-10 w-10 justify-center cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed")||""),children:(0,a.jsx)(ea.A,{className:"h-5 w-5"})})}),(0,a.jsx)(ey.ZI,{children:"Previous generations"})]}),ts?(0,a.jsxs)("div",{className:"jsx-4cf1a57fb90b2e2b flex items-center gap-2",children:[(0,a.jsx)("img",{src:ts,alt:"Inspiration",className:"jsx-4cf1a57fb90b2e2b h-8 w-8 object-cover rounded-full"}),(0,a.jsx)(w.$,{onClick:sp,variant:"ghost",size:"icon",className:"h-8 w-8 rounded-full",disabled:tN,"aria-label":"Remove inspiration image",children:(0,a.jsx)(en.A,{className:"h-4 w-4"})})]}):(0,a.jsxs)(ey.m_,{children:[(0,a.jsx)(ey.k$,{asChild:!0,children:(0,a.jsxs)("label",{htmlFor:tN?void 0:"inspiration-upload","aria-label":"Add an inspiration image",className:"jsx-4cf1a57fb90b2e2b "+((0,eh.cn)(ap,"h-10 gap-2",tp.length>0?"w-10 justify-center":"w-10 justify-center md:w-auto md:px-4",tN?"opacity-50 cursor-not-allowed":"cursor-pointer")||""),children:[(0,a.jsx)($.A,{className:"h-5 w-5"}),0===tp.length&&(0,a.jsx)("span",{className:"jsx-4cf1a57fb90b2e2b text-sm hidden md:inline",children:"attach"})]})}),(0,a.jsxs)(ey.ZI,{className:"border-none w-68 p-4",children:[(0,a.jsx)("img",{src:"/images/attach.jpeg",alt:"attachment example",className:"jsx-4cf1a57fb90b2e2b w-full h-auto rounded-md mb-2"}),(0,a.jsx)("h2",{className:"jsx-4cf1a57fb90b2e2b text-lg font-semibold",children:"Try adding a file"}),(0,a.jsx)("p",{className:"jsx-4cf1a57fb90b2e2b text-sm text-muted-foreground",children:"Choose an image, paste one from your clipboard, or drop it into the prompt."})]})]})]}),(0,a.jsx)("div",{className:"jsx-4cf1a57fb90b2e2b flex items-center ml-auto",children:aE?sD():(0,a.jsx)(w.$,{type:"button",onClick:sN,disabled:tN||M,className:"h-10 w-10 bg-primary rounded-full gap-0 cursor-pointer flex items-center justify-center transition-all duration-300 disabled:bg-muted disabled:cursor-not-allowed","aria-label":"Generate reference images",children:tN?(0,a.jsx)(K.A,{size:20,className:"text-primary animate-spin"}):(0,a.jsx)(es.A,{size:24,strokeWidth:2.5,className:"text-white"})})})]})})]}),(()=>{let e=aM||M||tN||nM,t=aE&&null!==tq,r=!!aL.trim();return(0,a.jsxs)("div",{className:(0,eh.cn)("mt-3 items-center gap-2 md:justify-end",-1===tY?"hidden md:flex":"flex"),children:[(0,a.jsxs)("button",{type:"button",onClick:()=>(e=>{if(aE&&!(null==e?void 0:e.skipTweakExit)){tU(null),aT(!1),aD("");return}s3()})({skipTweakExit:!0}),className:"mr-auto inline-flex h-11 flex-none items-center gap-1.5 rounded-full border border-foreground
1/20 bg-[#fffdfa] px-5 text-sm font-medium text-foreground shadow-md transition-colors hover:border-foreground/35 hover:bg-white cursor-pointer",children:[(0,a.jsx)(Z.A,{className:"h-4 w-4"}),"New product"]}),t?(0,a.jsx)(w.$,{type:"button",variant:r?"outline":"default",onClick:sM,disabled:e,className:(0,eh.cn)("ml-auto h-11 flex-none px-10 text-[15px] md:min-w-[12rem] md:px-10",r?"rounded-full border-foreground/25 font-medium text-foreground":(0,eh.cn)(ad,"group")),children:aM?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(K.A,{size:16,className:"animate-spin flex-shrink-0"}),(0,a.jsx)("span",{className:"md:hidden",children:"Applying"}),(0,a.jsx)("span",{className:"hidden md:inline",children:"Applying your change"})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"md:hidden",children:"Confirm"}),(0,a.jsx)("span",{className:"hidden md:inline",children:r?"Confirm as is":"Confirm"}),!r&&(0,a.jsx)(X.A,{className:"h-4 w-4 flex-shrink-0 transition-transform duration-200 group-hover:translate-x-0.5"})]})}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(w.$,{type:"button",onClick:sN,disabled:e||!E.trim(),className:(0,eh.cn)(ad,"ml-auto h-11 flex-none px-10 text-[15px] md:hidden"),children:tN?(0,a.jsx)(K.A,{size:18,className:"animate-spin"}):(0,a.jsx)("span",{children:"Regenerate"})}),(0,a.jsxs)(w.$,{type:"button",disabled:!0,className:(0,eh.cn)(ad,"ml-auto hidden h-11 flex-none px-10 text-[15px] md:inline-flex md:min-w-[12rem] md:px-10"),children:[(0,a.jsx)("span",{children:"Confirm"}),(0,a.jsx)(X.A,{className:"h-4 w-4 flex-shrink-0"})]})]})]})})(),O&&(0,a.jsx)(eg,{variant:"destructive",className:"mt-4 bg-destructive/10 border-destructive/20",children:(0,a.jsx)(eb,{className:"text-destructive",children:O})})]})})]}),(0,a.jsx)("div",{className:"jsx-4cf1a57fb90b2e2b flex-1"}),(0,a.jsxs)("button",{type:"button",onClick:()=>{var e;return null==(e=P.current)?void 0:e.scrollIntoView({behavior:"smooth",block:"start"})},className:"jsx-4cf1a57fb90b2e2b "+((0,eh.cn)("flex flex-col items-center gap-1 cursor-pointer transition-opacity duration-200 animate-slow-bounce mt-8 shrink-0","opacity-100 pointer-events-auto hover:opacity-70",aE&&"hidden")||""),children:[(0,a.jsx)("span",{className:"jsx-4cf1a57fb90b2e2b text-sm text-muted-foreground font-medium",children:"Learn more"}),(0,a.jsx)(el.A,{className:"h-5 w-5 text-muted-foreground/60"})]})]}):(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:"jsx-4cf1a57fb90b2e2b "+((0,eh.cn)("flex flex-col items-center gap-1 w-full shrink-0 relative",G?"min-h-[calc(100dvh-6.5rem)] md:min-h-[calc(100dvh-9rem)]":"min-h-[calc(100dvh-5.5rem)] md:min-h-[calc(100dvh-7rem)]",r3&&"guide-chat-surface guide-chat-surface-unpainted isolate")||""),children:[r3&&(0,a.jsx)("div",{"aria-hidden":!0,className:"jsx-4cf1a57fb90b2e2b "+((0,eh.cn)("guide-chat-surface-ground pointer-events-none absolute -inset-x-4 -top-[120px] bottom-0 -z-10 overflow-hidden md:-inset-x-5",n4?"guide-chat-ground-pair":r6?"guide-chat-ground-composer":"guide-chat-ground-doors")||"")}),!G&&!n4&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(tZ,{}),(0,a.jsx)(tK,{})]}),(0,a.jsx)("div",{className:"jsx-4cf1a57fb90b2e2b "+((0,eh.cn)("flex-1",n4&&"hidden md:block")||"")}),n4?(0,a.jsx)("div",{className:"jsx-4cf1a57fb90b2e2b mx-auto flex w-full max-w-3xl flex-col items-center max-md:-mx-4 max-md:w-[calc(100%+2rem)]",children:(0,a.jsxs)("div",{className:"jsx-4cf1a57fb90b2e2b "+((0,eh.cn)("relative isolate flex w-full justify-center",r6&&"gc-expand")||""),children:[(0,a.jsx)(r4,{}),(0,a.jsx)(aa,{variant:"inline",onClose:n8,seedPrompt:r6?void 0:E.trim()||void 0})]})}):r3&&!r6?(0,a.jsx)(r9,{onStart:()=>{G||(0,eE.D)("imagine","guide_hero_get_started"),nX(),nQ()},onHaveIdea:()=>{G||(0,eE.D)("imagine","guide_hero_have_idea"),nX(),(0,ez.k0)("idea"),nK()}}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"jsx-4cf1a57fb90b2e2b text-center w-full space-y-6 md:space-y-8 relative z-20 max-w-2xl",children:[(0,a.jsxs)("div",{className:"jsx-4cf1a57fb90b2e2b space-y-3 md:space-y-4",children:[r6?(0,a.jsxs)("h1",{className:"jsx-4cf1a57fb90b2e2b "+((0,eh.cn)(r7.fY,"mx-auto max-w-[16ch] text-4xl sm:max-w-none sm:text-5xl md:text-6xl")||""),children:["What product do you want to ",(0,a.jsx)(r7.F_,{children:"create"}),"?"]}):(0,a.jsx)("h1",{className:"jsx-4cf1a57fb90b2e2b text-3xl sm:text-4xl md:text-6xl text-foreground tracking-tight font-bold font-sans max-w-[16ch] sm:max-w-none mx-auto",children:"What product do you want to create?"}),(0,a.jsx)("h2",{className:"jsx-4cf1a57fb90b2e2b "+((0,eh.cn)("max-w-xl mx-auto leading-relaxed",r6?"text-base text-(--gc-muted) md:text-lg":"text-base sm:text-xl md:text-2xl text-muted-foreground font-light")||""),children:"We manufacture & deliver it to customers"})]}),(0,a.jsx)("form",{className:"jsx-4cf1a57fb90b2e2b w-full mt-6",children:(0,a.jsxs)("div",{className:"jsx-4cf1a57fb90b2e2b max-w-2xl mx-auto pb-4 md:pb-0",children:[(0,a.jsxs)("div",{onDrop:sh,onPaste:sx,onDragOver:sg,onDragEnter:sb,onDragLeave:sv,className:"jsx-4cf1a57fb90b2e2b "+((0,eh.cn)("w-full font-sans border outline-none overflow-hidden rounded-3xl bg-card text-foreground shadow-lg focus-within:border-input focus-within:shadow-xl transition-all duration-300 flex flex-col relative",td?"border-primary border-dashed":tN?"border-primary/20":"border-border")||""),children:[td&&(0,a.jsx)(ab,{}),tN&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"jsx-4cf1a57fb90b2e2b absolute inset-0 pointer-events-none z-0 rounded-3xl overflow-hidden",children:(0,a.jsx)("div",{style:{width:"".concat(tC,"%"),...tC<100?{maskImage:"linear-gradient(to right, black 95%, transparent 100%)",WebkitMaskImage:"linear-gradient(to right, black 95%, transparent 100%)"}:{}},className:"jsx-4cf1a57fb90b2e2b h-full bg-primary/[0.15] transition-[width] duration-300 ease-out ref-stripes-animate"})}),(0,a.jsxs)("div",{className:"jsx-4cf1a57fb90b2e2b absolute right-2 top-2 z-20 pointer-events-none flex items-center gap-2 rounded-full bg-background/90 backdrop-blur-sm border border-border px-3 py-1 shadow-sm max-w-[calc(100%-1rem)]",children:[(0,a.jsx)(K.A,{className:"h-3.5 w-3.5 text-primary animate-spin flex-shrink-0"}),(0,a.jsx)("span",{className:"jsx-4cf1a57fb90b2e2b text-xs font-medium text-foreground truncate",children:ao(tC)}),(0,a.jsxs)("span",{className:"jsx-4cf1a57fb90b2e2b text-xs font-semibold text-muted-foreground tabular-nums flex-shrink-0",children:[Math.round(tC),"%"]})]})]}),(0,a.jsx)("textarea",{ref:S,value:E,onChange:ss,onKeyDown:si,onFocus:n6.noteFocus,onBlur:n6.noteBlur,placeholder:"A protein bar, a hot sauce, a lip gloss...",disabled:tN,rows:2,className:"jsx-4cf1a57fb90b2e2b "+((0,eh.cn)("w-full p-6 text-base bg-transparent placeholder:text-muted-foreground resize-none outline-none border-none overflow-y-auto max-h-28 min-h-[5rem] md:min-
1h-0 transition-opacity duration-300",tN&&"opacity-40")||"")}),(0,a.jsx)("input",{type:"file",accept:"image/*",onChange:sf,id:"inspiration-upload-initial",className:"jsx-4cf1a57fb90b2e2b hidden"}),(0,a.jsxs)("div",{className:"jsx-4cf1a57fb90b2e2b flex px-2.5 py-2 md:px-3 md:py-2.5 border-t border-border items-center",children:[(0,a.jsxs)("div",{className:"jsx-4cf1a57fb90b2e2b flex items-center gap-1.5 md:gap-2",children:[!nu&&(0,a.jsx)(tR,{compact:!0,onClick:nZ,disabled:tN}),(r6?!!G:tp.length>0)&&(0,a.jsxs)(ey.m_,{children:[(0,a.jsx)(ey.k$,{asChild:!0,children:(0,a.jsx)("button",{type:"button",onClick:()=>r6?n2(!0):tx(!0),disabled:tN,className:"jsx-4cf1a57fb90b2e2b "+((0,eh.cn)(ap,"h-8 w-8 md:h-10 md:w-10 justify-center cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed")||""),children:(0,a.jsx)(ea.A,{className:"h-4 w-4 md:h-5 md:w-5"})})}),(0,a.jsx)(ey.ZI,{children:r6?"History":"Previous generations"})]}),ts?(0,a.jsxs)("div",{className:"jsx-4cf1a57fb90b2e2b flex items-center gap-2",children:[(0,a.jsx)("img",{src:ts,alt:"Inspiration",className:"jsx-4cf1a57fb90b2e2b h-8 w-8 object-cover rounded-full"}),(0,a.jsx)(w.$,{onClick:sp,variant:"ghost",size:"icon",className:"h-8 w-8 rounded-full",disabled:tN,"aria-label":"Remove inspiration image",children:(0,a.jsx)(en.A,{className:"h-4 w-4"})})]}):(0,a.jsxs)(ey.m_,{children:[(0,a.jsx)(ey.k$,{asChild:!0,children:(0,a.jsx)("label",{htmlFor:tN?void 0:"inspiration-upload-initial","aria-label":"Add an inspiration image",className:"jsx-4cf1a57fb90b2e2b "+((0,eh.cn)(ap,"h-8 w-8 md:h-10 md:w-10 justify-center",tN?"opacity-50 cursor-not-allowed":"cursor-pointer")||""),children:(0,a.jsx)($.A,{className:"h-4 w-4 md:h-5 md:w-5"})})}),(0,a.jsxs)(ey.ZI,{className:"border-none w-68 p-4",children:[(0,a.jsx)("img",{src:"/images/attach.jpeg",alt:"attachment example",className:"jsx-4cf1a57fb90b2e2b w-full h-auto rounded-md mb-2"}),(0,a.jsx)("h2",{className:"jsx-4cf1a57fb90b2e2b text-lg font-semibold",children:"Try adding a file"}),(0,a.jsx)("p",{className:"jsx-4cf1a57fb90b2e2b text-sm text-muted-foreground",children:"Choose an image, paste one from your clipboard, or drop it into the prompt."})]})]})]}),(0,a.jsx)("div",{className:"jsx-4cf1a57fb90b2e2b flex items-center ml-auto",children:r6&&!a_&&null===r$?(0,a.jsxs)(w.$,{type:"button",onClick:()=>n0(null),disabled:!E.trim(),className:(0,eh.cn)("h-10 gap-1.5 rounded-full px-4 text-sm font-semibold cursor-pointer transition-colors disabled:opacity-50 disabled:cursor-not-allowed",ev.sU),children:["Start",(0,a.jsx)(es.A,{className:"h-4 w-4",strokeWidth:2.5})]}):(0,a.jsx)(tm,{brands:ay,status:ak,onRetry:aN,choiceRequired:a_,choice:r$,onChoiceChange:rH,onSubmit:e=>r6?n0(e):void sN(void 0,e),promptFilled:!!E.trim(),isGenerating:tN,disabled:M,menuOpen:aw,onMenuOpenChange:aj})})]})]}),O&&(0,a.jsx)(eg,{variant:"destructive",className:"mt-4 bg-destructive/10 border-destructive/20",children:(0,a.jsx)(eb,{className:"text-destructive",children:O})}),(0,a.jsxs)("p",{className:"jsx-4cf1a57fb90b2e2b mt-1.5 flex items-center justify-center gap-1 text-[0.7em] leading-tight text-muted-foreground/80",children:[(0,a.jsx)(ei.A,{className:"h-2.5 w-2.5 shrink-0"}),"You keep full ownership and IP of everything you create."]})]})})]}),0===tk.length&&(0,a.jsx)(tB,{currentPrompt:E,onSelect:sl,disabled:tN||M})]}),(0,a.jsx)("div",{className:"jsx-4cf1a57fb90b2e2b flex-1"}),(0,a.jsxs)("button",{type:"button",onClick:()=>{var e;return null==(e=P.current)?void 0:e.scrollIntoView({behavior:"smooth",block:"start"})},className:"jsx-4cf1a57fb90b2e2b "+((0,eh.cn)("flex flex-col items-center gap-1 cursor-pointer transition-all duration-200 animate-slow-bounce mt-auto shrink-0",r3&&(n4?"mt-2 md:mt-3":"mt-2 md:mt-8"),0!==tk.length||tN||0!==tg.length?"opacity-0 pointer-events-none":"opacity-100 pointer-events-auto hover:opacity-70")||""),children:[(0,a.jsx)("span",{className:"jsx-4cf1a57fb90b2e2b hidden md:inline text-sm text-muted-foreground font-medium",children:"Learn more"}),(0,a.jsx)(el.A,{className:"hidden md:block h-5 w-5 text-muted-foreground/60"}
1),(0,a.jsx)(eo.A,{className:"md:hidden h-6 w-6 text-muted-foreground/70"})]})]})}),r3&&!(tk.length>0&&tN)&&!(M&&t4)&&(0,a.jsx)("div",{"aria-hidden":!0,className:"jsx-4cf1a57fb90b2e2b pointer-events-none sticky top-0 -z-10 -mx-4 h-[100dvh] -mb-[100dvh] shrink-0 self-stretch overflow-hidden [mask-image:linear-gradient(to_bottom,transparent,black_12rem)] md:-mx-5",children:(0,a.jsx)(ae.A,{className:"h-full w-full object-cover"})}),!(tk.length>0&&tN)&&!(M&&t4)&&(0,a.jsx)("div",{ref:P,className:"jsx-4cf1a57fb90b2e2b w-full",children:(0,a.jsx)(rT,{preFooter:G?void 0:(0,a.jsxs)("div",{className:"jsx-4cf1a57fb90b2e2b sr-only",children:[(0,a.jsx)(rW,{}),(0,a.jsx)(rY,{})]})})})]})}),e9&&(0,a.jsx)(x.default,{isOpen:e9,onClose:()=>ta(!1),skipInviteCode:!G,bypassCode:G?void 0:_.query["invite-code"]||"advertisement",defaultTab:"signup"}),nH&&!r3&&void 0!==r2&&(0,a.jsx)(at,{onClose:n8}),null!==n3&&!nH&&0===tk.length&&(0,a.jsx)(tM,{onAccept:()=>{(0,eE.D)("imagine","guide_nudge_accepted"),n3&&(0,eE.D)("imagine","guide_nudge_accepted_".concat(n3)),n7(null),nQ()},onDismiss:()=>{(0,eE.D)("imagine","guide_nudge_dismissed"),n3&&(0,eE.D)("imagine","guide_nudge_dismissed_".concat(n3)),n7(null)}}),t8&&(0,a.jsx)(rB.UsageThresholdDialog,{open:t7,onOpenChange:e=>{t6(e),e||t9(null)},currentCost:t8.currentCost,threshold:t8.threshold,limit:null!=(p=t8.limit)?p:"monthly",tier:t8.tier,pageId:null!=rf?rf:void 0}),(0,a.jsx)(tv.C,{open:null!==rn,onOpenChange:e=>{e||rs(null)},category:null!=rn?rn:void 0,onEditPrompt:()=>{var e;rs(null),null==(e=S.current)||e.focus()}}),(0,a.jsx)(rU,{open:re,onOpenChange:rt,suggestion:rr,onTrySuggestion:e=>{sl(e),rt(!1)}}),(0,a.jsx)(tI,{open:rl,onOpenChange:ri,message:null==ro?void 0:ro.message,suggestion:null==ro?void 0:ro.suggestion,onTrySuggestion:e=>{sl(e),ri(!1)}}),(0,a.jsx)(tX,{open:null!==rc,onOpenChange:e=>{e||(ru(null),rp(null))},message:rc||void 0,onGenerateDifferent:()=>{eT("imagine_packaging_escape"),sk();let e=null==rm?void 0:rm.trim();ru(null),rp(null),na(null),ns(null),ni(null),nd(null),ty([]),t$(""),tU(null),aT(!1),aD(""),aF([]),np(null),nh(null),tJ([]),t1(""),F(""),e&&T(e)}}),(0,a.jsx)(ew.lG,{open:nw,onOpenChange:e=>e?nj(!0):s4(),children:(0,a.jsxs)(ew.Cf,{className:(0,eh.cn)("inset-0 flex h-[100dvh] max-h-[100dvh] w-full max-w-none translate-x-0 translate-y-0 flex-col overflow-hidden rounded-none border-0 p-0 sm:inset-auto sm:top-[50%] sm:left-[50%] sm:h-auto sm:max-h-[90vh] sm:w-[calc(100%-2rem)] sm:translate-x-[-50%] sm:translate-y-[-50%] sm:rounded-lg sm:border",lr?"sm:max-w-2xl":"sm:max-w-md"),children:[null!==nb&&tk[nb]&&(0,a.jsx)("div",{className:"jsx-4cf1a57fb90b2e2b "+((0,eh.cn)("relative w-full flex-shrink-0 bg-muted",lr?"h-24 sm:h-28":"h-28 sm:h-32")||""),children:(0,a.jsx)("img",{src:tk[nb],alt:"Your product",className:"jsx-4cf1a57fb90b2e2b h-full w-full object-cover"})}),(0,a.jsxs)("div",{className:"jsx-4cf1a57fb90b2e2b min-h-0 flex-1 space-y-4 overflow-y-auto px-5 pb-2 pt-4",children:[(0,a.jsxs)(ew.c7,{className:"space-y-1 text-left",children:[(0,a.jsxs)(ew.L3,{className:"flex items-center gap-2 text-lg",children:[le?(0,a.jsx)(ei.A,{className:"h-5 w-5 text-sky-500"}):s9?(0,a.jsx)(ed.A,{className:"h-5 w-5 text-emerald-500"}):(0,a.jsx)(s.A,{className:"h-5 w-5 text-amber-500"}),s9&&null!=(b=null==s6?void 0:s6.title)?b:"Your product"]}),(0,a.jsx)(ew.rr,{children:le?"A finished product you can start selling today, exactly as it is. Here's what that means.":lr?"Review the product and choose the recipe options supported by this supplier.":s9?"A ready-to-sell product from our vetted catalog. Here's what it takes to launch it.":"A one-of-a-kind product, made from scratch just for you. Here's what it takes to bring it to life."})]}),le&&(0,a.jsxs)("div",{className:"jsx-4cf1a57fb90b2e2b rounded-xl border border-sky-200 bg-sky-50/70 px-4 py-3",children:[(0,a.jsxs)("p",{className:"jsx-4cf1a57fb90b2e2b flex items-center gap-1.5 text-sm font-semibold text-sky-900",children:[(0,a.jsx)(ei.A,{className:"h-4 w-4 flex-shrink-0 text-sky-600"}),"Stock product"]}),(0,a.jsx)("p",{className:"jsx-4cf1a57fb90b2e2b mt-1 text-xs leading-snug text-sky-900/80",children:"It ships exactly as shown. The design can't be changed: no logo, no colors of your own, no edits after you pick it. You'd be selling this product as it is, under your brand."}),(0,a.jsx)("p",{className:"jsx-4cf1a57fb90b2e2b mt-1.5 text-xs leading-snug text-sky-900/80",children:"Want your own design on it? Pick one of the products above instead."}),lt.length>0&&(0,a.jsxs)("div",{className:"jsx-4cf1a57fb90b2e2b mt-3",children:[(0,a.jsx)("p",{className:"jsx-4cf1a57fb90b2e2b text-[11px] font-medium text-sky-900/80",children:"Variants you will offer"}),(0,a.jsx)("div",{className:"jsx-4cf1a57fb90b2e2b mt-1.5 flex flex-wrap gap-1.5",children:lt.map(e=>(0,a.jsx)("img",{src:e.imageUrl,alt:e.label,title:e.label,loading:"lazy",className:"jsx-4cf1a57fb90b2e2b h-12 w-12 rounded-lg border border-white/80 object-cover shadow-sm"},e.skuId))})]})]}),s9?le?(0,a.jsxs)("div",{className:"jsx-4cf1a57fb90b2e2b rounded-xl border border-emerald-200 bg-emerald-50/70 px-4 py-3",children:[(0,a.jsx)("p",{className:"jsx-4cf1a57fb90b2e2b text-[11px] font-semibold uppercase tracking-wide text-emerald-900/70",children:"Cost to start"}),(0,a.jsx)("p",{className:"jsx-4cf1a57fb90b2e2b mt-0.5 text-2xl font-bold text-emerald-600",children:"No investment"}),(0,a.jsx)("p",{className:"jsx-4cf1a57fb90b2e2b mt-1 text-xs text-emerald-900/70",children:"This product already exists and is stocked by its supplier, so there's no tooling, minimum order, or upfront cost. You only pay per unit as you sell."})]}):lr?(0,a.jsxs)("div",{className:"jsx-4cf1a57fb90b2e2b flex items-center justify-between gap-3 rounded-xl border border-emerald-200 bg-emerald-50/70 px-4 py-3",children:[(0,a.jsxs)("div",{className:"jsx-4cf1a57fb90b2e2b",children:[(0,a.jsx)("p",{className:"jsx-4cf1a57fb90b2e2b text-sm font-semibold text-emerald-900",children:"No upfront investment"}),(0,a.jsx)("p",{className:"jsx-4cf1a57fb90b2e2b mt-0.5 text-xs text-emerald-900/70",children:"Pay per case as you sell."})]}),(0,a.jsx)("span",{className:"jsx-4cf1a57fb90b2e2b flex-shrink-0 text-lg font-bold text-emerald-600",children:"$0 to start"})]}):(0,a.jsxs)("div",{className:"jsx-4cf1a57fb90b2e2b rounded-xl border border-emerald-200 bg-emerald-50/70 px-4 py-3",children:[(0,a.jsx)("p",{className:"jsx-4cf1a57fb90b2e2b text-[11px] font-semibold uppercase tracking-wide text-emerald-900/70",children:"Cost to start"}),(0,a.jsx)("p",{className:"jsx-4cf1a57fb90b2e2b mt-0.5 text-2xl font-bold text-emerald-600",children:"No investment"}),(0,a.jsx)("p",{className:"jsx-4cf1a57fb90b2e2b mt-1 text-xs text-emerald-900/70",children:"This product already exists in our catalog, so there's no tooling, minimum order, or upfront cost. You only pay per unit as you sell."})]}):nx&&(0,a.jsxs)("div",{className:"jsx-4cf1a57fb90b2e2b rounded-xl border border-blue-200 bg-blue-50/70 px-4 py-3",children:[(0,a.jsx)("p",{className:"jsx-4cf1a57fb90b2e2b text-[11px] font-semibold uppercase tracking-wide text-blue-900/70",children:"Estimated funding to start"}),(0,a.jsxs)("p",{className:"jsx-4cf1a57fb90b2e2b mt-0.5 text-2xl font-bold text-blue-600",children:[n$(nx.low),(0,a.jsx)("span",{className:"jsx-4cf1a57fb90b2e2b px-1.5 text-base font-medium text-blue-600/50",children:"to"}),n$(nx.high)]}),(0,a.jsx)("p",{className:"jsx-4cf1a57fb90b2e2b mt-1 text-xs text-blue-900/70",children:"These are estimates. The exact cost is only set once you source it, and it can land lower or higher than this range."}),(0,a.jsxs)("p",{className:"jsx-4cf1a57fb90b2e2b mt-2 text-xs text-blue-900/80",children:["You don't need this upfront. With pre-orders, your customers fund production before you make anything."," ",(0,a.jsx)("button",{type:"button",onClick:()=>{eT("imagine_investment_preorder_learn_more"),nk(!0)},className:"jsx-4cf1a57fb90b2e2b font-semibold text-blue-600 underline underline-offset-2 hover:text-blue-700",children:"Learn more"})]})]}),s9&&la&&(0,a.jsxs)("div",{className:"jsx-4cf1a57fb90b2e2b rounded-lg border border-amber-200 bg-amber-50/70 px-3 py-2 text-xs leading-snug text-amber-900/90",children:[(0,a.jsx)("span",{className:"jsx-4cf1a57fb90b2e2b font-semibold",children:"Compromise: "}),la]}),lr&&(null==s6||null==(i=s6.optionAxes)?void 0:i.length)&&(0,a.jsx)(tL,{open:nw,ingredientAxes:s6.optionAxes,initialIngredientSelections:s6.configuredOptions,canAxes:null!=(v=null==nC?void 0:nC.axes)?v:[],variants:null!=(j=null==nC?void 0:nC.variants)?j:[],primaryVariantId:null!=(k=null!=(y=null==nC?void 0:nC.primaryVariantId)?y:s6.variantId)?k:"",onSelectionChange:nA,disabled:M||nP}),s9&&!1,s9&&!le&&!lr&&(0,a.jsx)(tb,{productId:null!=(N=null==s6?void 0:s6.productId)?N:null,open:nw,fallbackCategory:null==s6?void 0:s6.category}),le&&(null==s6?void 0:s6.description)&&(0,a.jsxs)("div",{className:"jsx-4cf1a57fb90b2e2b space-y-1",children:[(0,a.jsx)("p",{className:"jsx-4cf1a57fb90b2e2b text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"What you'd be selling"}),(0,a.jsx)("p",{className:"jsx-4cf1a57fb90b2e2b text-xs leading-relaxed text-muted-foreground",children:s6.description})]}),!lr&&(0,a.jsx)("div",{className:"jsx-4cf1a57fb90b2e2b space-y-3",children:(le?[{icon:J.A,title:"No upfront investment",desc:"Already made and in stock. You only pay per unit as you sell."},{icon:ei.A,title:"Fixed design",desc:"It ships in the design you see here. You cannot change it, now or later."},{icon:ec.A,title:ln,desc:"Packed and shipped by the supplier once an order comes in."}]:s9?[{icon:J.A,title:"No upfront investment",desc:"Made on demand from our vetted catalog. You only pay per unit as you sell."}
1,{icon:ed.A,title:"No minimum order",desc:"Order one or a thousand. Start with a sample before you commit."},{icon:ec.A,title:ln,desc:"Printed and shipped from the supplier once an order comes in."}]:[{icon:J.A,title:"Minimum order",desc:"Made in one batch, usually a few hundred to a few thousand units."},{icon:eu.A,title:"Tooling & samples",desc:"One-time setup and sample fees before the first unit ships."},{icon:ea.A,title:"Lead time",desc:"The supplier prototypes and produces your first run."}]).map(e=>(0,a.jsxs)("div",{className:"jsx-4cf1a57fb90b2e2b flex gap-3",children:[(0,a.jsx)("div",{className:"jsx-4cf1a57fb90b2e2b flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-full bg-muted text-muted-foreground",children:(0,a.jsx)(e.icon,{className:"h-4 w-4"})}),(0,a.jsxs)("div",{className:"jsx-4cf1a57fb90b2e2b min-w-0",children:[(0,a.jsx)("p",{className:"jsx-4cf1a57fb90b2e2b text-sm font-medium text-foreground",children:e.title}),(0,a.jsx)("p",{className:"jsx-4cf1a57fb90b2e2b text-xs leading-snug text-muted-foreground",children:e.desc})]})]},e.title))})]}),(0,a.jsxs)("div",{className:"jsx-4cf1a57fb90b2e2b flex flex-shrink-0 flex-col gap-3 border-t-2 border-border bg-background px-5 pb-[calc(0.75rem+env(safe-area-inset-bottom))] pt-3 shadow-[0_-8px_16px_-8px_rgba(0,0,0,0.12)] sm:pb-3",children:[(null==nF?void 0:nF.primaryVariantId)&&(0,a.jsxs)("div",{className:"jsx-4cf1a57fb90b2e2b space-y-2",children:[(0,a.jsxs)("div",{className:"jsx-4cf1a57fb90b2e2b space-y-0.5",children:[(0,a.jsxs)("h4",{className:"jsx-4cf1a57fb90b2e2b flex items-center gap-1.5 text-sm font-semibold text-foreground",children:[(0,a.jsx)(ed.A,{className:"h-4 w-4 text-emerald-500"}),"What should shoppers be able to choose?"]}),(0,a.jsx)("p",{className:"jsx-4cf1a57fb90b2e2b text-xs text-muted-foreground",children:"Ships in the default on each row. Turn on extra values to let shoppers choose them."})]}),(0,a.jsx)("div",{className:"jsx-4cf1a57fb90b2e2b -mx-1 max-h-48 overflow-y-auto px-1",children:(0,a.jsx)(rQ,{open:nw,axes:nF.axes,primaryVariantId:nF.primaryVariantId,defaultOffers:nF.defaultOffers,variants:nF.variants,submitting:M,onOfferedIdsChange:nz})})]}),nW&&!nF&&(0,a.jsxs)("div",{className:"jsx-4cf1a57fb90b2e2b flex items-center gap-2 text-sm text-muted-foreground",children:[(0,a.jsx)(em.A,{className:"h-4 w-4 animate-spin"}),"Loading optionsâ¦"]}),lr&&nP&&(0,a.jsxs)("div",{className:"jsx-4cf1a57fb90b2e2b flex items-center gap-2 text-sm text-muted-foreground",children:[(0,a.jsx)(em.A,{className:"h-4 w-4 animate-spin"}),"Loading can sizesâ¦"]}),(0,a.jsxs)("div",{className:"jsx-4cf1a57fb90b2e2b flex flex-wrap items-center gap-2 sm:flex-nowrap sm:justify-end",children:[nF&&(0,a.jsxs)("span",{className:"jsx-4cf1a57fb90b2e2b w-full text-xs text-muted-foreground sm:mr-auto sm:w-auto",children:[nU.length," variant",1===nU.length?"":"s"," will be sold"]}),(0,a.jsx)(w.$,{variant:"outline",onClick:s4,disabled:M,className:"flex-1 basis-0 sm:flex-none sm:basis-auto",children:"Keep browsing"}),(0,a.jsxs)(w.$,{onClick:()=>{var e,t;let r;if(null===nb)return;let a=a6[nb],n=!!a,s=!!a&&e8({hasUser:!!G,subscriptionLoading:nG,isSubscribed:nV,optionAxes:a.optionAxes,supplierName:a.supplierName}),l=nF&&nU.length>0?nU:null,i=(null==nS?void 0:nS.variantId)||(null==a?void 0:a.variantId),o=null!=(t=null==nC||null==(e=nC.variants.find(e=>e.variantId===i))?void 0:e.price)?t:null,d=null!=o?o:(null==a?void 0:a.priceCents)!=null?a.priceCents/100:null,c=s&&a&&nS?{...a,configuredOptions:nS.configuredOptions,configuredUnitCost:a.optionAxes&&null!=d?(0,e7.Ez)(a.optionAxes,nS.configuredOptions,[{min_qty:1,unit_cost:d}],1):a.configuredUnitCost,variantId:nS.variantId||a.variantId,preserveVariantSelection:!0}
1:null;c&&(ty(e=>e.map((e,t)=>t===nb?{...e,blueprint:c}:e)),ns(e=>(null==e?void 0:e.productId)===c.productId?c:e)),eT(n?"imagine_catalog_confirm":"imagine_investment_confirm"),s4(),aT(!1),c?r={catalogBlueprintOverride:c}:l&&(r={availableVariantIds:l}),s_(nb,r)},disabled:M||nW||nP||lr&&!nS||!!nF&&0===nU.length,className:(0,eh.cn)("flex-1 basis-0 border-0 text-white sm:flex-none sm:basis-auto",le?"bg-gradient-to-r from-sky-500 to-sky-600 hover:from-sky-600 hover:to-sky-700":s9?"bg-gradient-to-r from-emerald-500 to-emerald-600 hover:from-emerald-600 hover:to-emerald-700":"bg-gradient-to-r from-amber-500 to-amber-600 hover:from-amber-600 hover:to-amber-700"),children:[(nW||nP)&&(0,a.jsx)(em.A,{className:"h-4 w-4 animate-spin"}),le?"Sell it as shown":"Confirm and start",(0,a.jsx)(X.A,{className:"h-4 w-4"})]})]})]})]})}),(0,a.jsx)(t0.A,{open:ny,onOpenChange:nk}),null!==nN&&nL&&nL.primaryVariantId&&(()=>{let e=a6[nN];return e?(0,a.jsx)(rZ,{open:!0,onOpenChange:e=>{e||(n_(null),nD(null))},productTitle:e.title,axes:nL.axes,primaryVariantId:nL.primaryVariantId,defaultOffers:nL.defaultOffers,variants:nL.variants,onConfirm:s5,submitting:M}):null})(),(0,a.jsx)(ew.lG,{open:aZ,onOpenChange:aX,children:(0,a.jsxs)(ew.Cf,{className:"sm:max-w-md",children:[(0,a.jsxs)(ew.c7,{children:[(0,a.jsx)(ew.L3,{children:"Continue without your change?"}),(0,a.jsxs)(ew.rr,{className:"pt-2 space-y-2",children:[(0,a.jsx)("span",{className:"jsx-4cf1a57fb90b2e2b block",children:"You've asked for a change that hasn't been applied yet:"}),(0,a.jsx)("span",{className:"jsx-4cf1a57fb90b2e2b block rounded-md border border-border bg-muted/50 px-3 py-2 italic text-foreground line-clamp-3",children:aL.trim()}),(0,a.jsx)("span",{className:"jsx-4cf1a57fb90b2e2b block",children:"Continue and we'll start building the draft exactly as you see it now, without that change."})]})]}),(0,a.jsxs)("div",{className:"jsx-4cf1a57fb90b2e2b flex flex-col-reverse gap-2 pt-2 sm:flex-row sm:justify-end",children:[(0,a.jsxs)(w.$,{variant:"outline",onClick:()=>{aX(!1),s0()},children:[(0,a.jsx)(Q.A,{className:"h-4 w-4"}),"Apply it first"]}),(0,a.jsxs)(w.$,{onClick:()=>{aX(!1),s2()},className:(0,eh.cn)(ad,"h-10 px-5"),children:["Continue anyway",(0,a.jsx)(X.A,{className:"h-4 w-4"})]})]})]})}),(0,a.jsx)(tW,{open:th,onOpenChange:tx,scope:tk.length>0?"product":"prompts",chainEntries:sQ,currentIndex:sZ,promptEntries:sX,onRestoreChain:e=>{let t=sQ[e];t&&((0,eE.D)("imagine","imagine_tile_round_back"),s1(t,{keepSelectedIndex:tq,roundStack:sJ(t.parentId)}))},onRestorePrompt:e=>s1(e,{roundStack:sJ(e.parentId)})}),r6?(0,a.jsx)(tw.A,{open:n1,onOpenChange:n2,onOpenConversation:n5,onOpenEarlierIdea:()=>{var e;n2(!1),null==(e=A.current)||e.scrollTo({top:0}),nK()}}):null,(0,a.jsx)(tn.A,{open:aA,onOpenChange:aP,brands:ay,status:ak,onRetry:aN,choice:r$,onPick:e=>{eT("brand"===e.kind?"imagine_brand_failsafe_answered_brand":"imagine_brand_failsafe_answered_new"),rH(e),sC("brand"===e.kind?{brandId:e.brand.brand_id}:{autoCreateBrand:!0})}})]})}var aj=r(45105),ay=r.n(aj),ak=r(46503);function aN(){return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(ay(),{id:"meta-pixel",strategy:"afterInteractive",children:"!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,document,'script','https://connect.facebook.net/en_US/fbevents.js');fbq('init','".concat("4252528331635139","',{},{autoConfig:false});fbq('trackSingle','").concat("4252528331635139","','PageView');")}),(0,a.jsx)("noscript",{children:(0,a.jsx)("img",{height:"1",width:"1",style:{display:"none"},src:"https://www.facebook.com/tr?id=".concat("4252528331635139","&ev=PageView&noscript=1"),alt:""})})]}),(0,a.jsx)(ay(),{id:"tiktok-pixel",strategy:"afterInteractive",children:(0,ak.k)("D78KOF3C77U41AUTLIQ0",!0)})]})}function a_(e){let{children:t}=e;return(0,tc.a)(),(0,a.jsx)(a.Fragment,{children:t})}r(8407),r(77861),r(28077);let aC=(0,h.createContext)(null);function aI(e){let{page:t,hasInNetworkSupplier:r,children:n}=e,s=(0,h.useMemo)(()=>({page:t,isCatalogProduct:r}),[t,r]);return(0,a.jsx)(aC.Provider,{value:s,children:n})}var aS=r(69202),aA=r(10628),aP=r(31322),aE=r(37852);async function aT(e,t){var r;let{name:a,concept:s}=function(e){var t,r,a,n,s,l,i,o,d;let c=null==e||null==(r=e.elements)||null==(t=r.find(e=>"characteristics"===e.id))?void 0:t.content,u=(null==c||null==(n=c.brandIdentity)||null==(a=n.brandName)?void 0:a.trim())||(null==e||null==(s=e.product_name)?void 0:s.trim())||(null==e||null==(l=e.initial_prompt)?void 0:l.trim().slice(0,60))||"My brand",m=(null==c||null==(o=c.brandIdentity)||null==(i=o.positioningStatement)?void 0:i.trim())||(null==e||null==(d=e.initial_prompt)?void 0:d.trim())||"A brand for ".concat(u);return{name:u.slice(0,60),concept:m.slice(0,500)}}(e),{data:l}=await n.A.post("/api/brand/create",{name:a,concept:s,theme:function(e){if(e)try{let{theme:t}=(0,U.Ou)(e);return{colors:t.colors,typography:t.typography,mode:t.mode}}catch(e){return}}(e)}),i=null==l||null==(r=l.brand)?void 0:r.brand_id;if(!i)throw Error("Store creation failed");if(await n.A.patch("/api/page/".concat(e.page_id,"/brand"),{brand_id:i}),!(await fetch("/api/subdomain/publish",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({subdomain:t,page_id:e.page_id})})).ok)throw Error("Publishing the store URL failed");return{brandId:i,subdomain:t}}let aL="customize";var aD=r(13073),aM=r(43945),aR=r(48443),aO=r(38241),aF=r(8042),aq=r(1059),aU=r(25667),az=r(65711),aW=r(22201),aY=r(99662),aB=r(97128),aG=r(15710),aV=r(7793);ta.Cp.free,ta.Cp.standard,ta.Cp.pro;let a$={free:["Limited usage","Basic generations","Community support"],standard:["Manufacturing flow access","10x generations","Order samples","Email support"],pro:["Manufacture without pre-orders, one product at a time","3x the generations of Premium","Order samples","Priority support"]};var aH=r(99488),aJ=r(30193);let aK=d()(()=>Promise.all([r.e(4012),r.e(9300)]).then(r.bind(r,59300)),{loadableGenerated:{webpack:()=>[59300]},ssr:!1});function aQ(){return(0,a.jsx)("div",{className:"flex flex-1 w-full items-center justify-center min-h-[40vh]",children:(0,a.jsx)("div",{className:"w-8 h-8 border-3 border-[#
1E07A5F] border-t-transparent rounded-full animate-spin"})})}let aZ=d()(()=>Promise.all([r.e(4708),r.e(3600),r.e(1937),r.e(661),r.e(6870),r.e(1137),r.e(9504),r.e(9249),r.e(5269),r.e(5692),r.e(5666),r.e(923),r.e(5911),r.e(4754),r.e(8209),r.e(8391),r.e(3535),r.e(580),r.e(7192),r.e(2860),r.e(4928)]).then(r.bind(r,438)),{loadableGenerated:{webpack:()=>[438]},ssr:!1,loading:aQ}),aX=d()(()=>(r.e(9542).then(r.bind(r,9542)),Promise.all([r.e(4708),r.e(1937),r.e(661),r.e(6870),r.e(1137),r.e(9504),r.e(9249),r.e(5666),r.e(923),r.e(5911),r.e(4754),r.e(8209),r.e(8391),r.e(3535),r.e(580),r.e(7192),r.e(2860),r.e(6085),r.e(5172)]).then(r.bind(r,47305)).then(e=>e.TasksPage)),{loadableGenerated:{webpack:()=>[47305]},ssr:!1,loading:aQ}),a0=d()(()=>Promise.all([r.e(5587),r.e(661),r.e(6870),r.e(8595),r.e(1137),r.e(5806),r.e(2573),r.e(4278),r.e(2778),r.e(4821),r.e(4358),r.e(8071),r.e(923),r.e(8209),r.e(1530),r.e(3535),r.e(6345),r.e(4805),r.e(5335)]).then(r.bind(r,77291)),{loadableGenerated:{webpack:()=>[77291]},ssr:!1,loading:aQ}),a1=d()(()=>Promise.all([r.e(4708),r.e(1937),r.e(661),r.e(6870),r.e(1137),r.e(9504),r.e(9249),r.e(5666),r.e(923),r.e(5911),r.e(4754),r.e(8209),r.e(8391),r.e(3535),r.e(580),r.e(8064)]).then(r.bind(r,1062)),{loadableGenerated:{webpack:()=>[1062]},ssr:!1,loading:aQ}),a2=d()(()=>Promise.all([r.e(8209),r.e(5037)]).then(r.bind(r,30100)),{loadableGenerated:{webpack:()=>[30100]},ssr:!1,loading:aQ}
1),a5=d()(()=>Promise.all([r.e(661),r.e(6870),r.e(1137),r.e(923),r.e(179)]).then(r.bind(r,15513)),{loadableGenerated:{webpack:()=>[15513]},ssr:!1,loading:aQ}),a4=d()(()=>Promise.all([r.e(2573),r.e(4278),r.e(4821),r.e(8071),r.e(9646),r.e(6345),r.e(9651)]).then(r.bind(r,69013)),{loadableGenerated:{webpack:()=>[69013]},ssr:!1,loading:aQ}),a3=d()(()=>Promise.all([r.e(8595),r.e(7996),r.e(5200)]).then(r.bind(r,27031)),{loadableGenerated:{webpack:()=>[27031]},ssr:!1,loading:aQ}),a7=d()(()=>Promise.all([r.e(4708),r.e(1937),r.e(9504),r.e(5911),r.e(4754),r.e(8391),r.e(7911)]).then(r.bind(r,58391)),{loadableGenerated:{webpack:()=>[58391]},ssr:!1,loading:aQ}),a6=d()(()=>Promise.all([r.e(1937),r.e(531),r.e(5911),r.e(8258)]).then(r.bind(r,48258)),{loadableGenerated:{webpack:()=>[48258]},ssr:!1,loading:aQ}),a8=d()(()=>r.e(9542).then(r.bind(r,9542)),{loadableGenerated:{webpack:()=>[9542]},ssr:!1,loading:()=>null}),a9=d()(()=>Promise.all([r.e(4429),r.e(3600),r.e(2666),r.e(5269),r.e(5692),r.e(4278),r.e(3172),r.e(8764)]).then(r.bind(r,53172)),{loadableGenerated:{webpack:()=>[53172]},ssr:!1,loading:function(){return(0,a.jsx)("div",{className:"bg-background w-full h-14 md:h-[88px]"})}});var ne=function(e){return e.Imagine="Imagine",e.Product="Product",e.Make="Make",e.Website="Website",e.Validate="Validate",e.Financials="Financials",e.Grow="Grow",e.Tasks="Tasks",e}(ne||{});let nt=Object.values(ne),nr=e=>fetch(e,"undefined"!=typeof AbortSignal&&"function"==typeof AbortSignal.timeout?{signal:AbortSignal.timeout(15e3)}:void 0);function na(e){return nt.includes(e)}function nn(e){let{imaginePageKey:t}=e,r=(0,f.useRouter)(),n=(0,aP.P)({page_name:"imagine_unauth"});(0,eN.C)({page_name:"imagine_unauth",session_id:n,enabled:!0});let[s,l]=(0,h.useState)(!1),i=r.query["invite-code"],o=i||"advertisement",d=!!(i&&"outreach"!==i&&"advertisement"!==i);return(0,h.useEffect)(()=>{d&&l(!0)},[d]),(0,a.jsxs)(a_,{children:[(0,a.jsx)(aN,{}),(0,a.jsxs)("div",{className:"w-full h-full bg-background flex flex-col safe-area-inset relative",children:[(0,a.jsx)("div",{className:"absolute top-0 left-0 right-0 z-30 pointer-events-none",children:(0,a.jsx)("div",{className:"border-b border-white/40 bg-white/45 px-6 py-3 backdrop-blur-xl pointer-events-auto",children:(0,a.jsxs)("div",{className:"mx-auto flex max-w-5xl items-center justify-between",children:[(0,a.jsx)(p(),{src:"/dough_logo.svg",alt:"Dough",width:88,height:28,priority:!0,className:"drop-shadow-sm"}),(0,a.jsx)(B.A,{className:"min-w-0 flex-1 px-4"}),(0,a.jsx)("button",{type:"button",onClick:()=>l(!0),className:"rounded-full px-4 py-1.5 text-sm font-medium text-white backdrop-blur-md transition-colors cursor-pointer bg-[#ff6a3d] hover:bg-[#ff8f6b]",children:"Sign in"})]})})}),(0,a.jsx)(aw,{},t)]}),s&&(0,a.jsx)(x.default,{isOpen:s,onClose:()=>l(!1),skipInviteCode:!0,bypassCode:o,defaultTab:d?"signup":"login"})]})}var ns=!0;function nl(e){var t,r,o,d,c,m,x,v,C;let{initialPageId:S,initialTab:A,initialBrandId:P,initialAnonymous:E}=e,T=(0,f.useRouter)(),{user:L,isAuthChecking:D}=(0,g.A)(),{role:M,loading:R}=(0,aD.$)(),O=(0,h.useRef)(!1);(0,h.useEffect)(()=>{if(L){O.current=!0;return}!D&&!O.current&&void 0===T.query[aB.$5]&&(0,aE.mq)(T.query)&&((0,aM.bq)(T.asPath),T.replace(aE.mE))},[L,D,T]);let F=P?["Website","Products","Grow"].includes(A)?A:"Website":A&&nt.includes(A)?A:void 0,[z,B]=(0,h.useState)(F),[G,V]=(0,h.useState)(S),[$,H]=(0,h.useState)(P),[J,K]=(0,h.useState)(null),[Q,Z]=(0,h.useState)(!1),[X,ee]=(0,h.useState)(0),[et,er]=(0,h.useState)(0),[ea,en]=(0,h.useState)(0),[es,el]=(0,h.useState)(!1),[ei,eo]=(0,h.useState)(null),[ed,ec]=(0,h.useState)(!1),[eu,em]=(0,h.useState)("pro"),[ep,ef]=(0,h.useState)(0),[eh,ex]=(0,h.useState)(!1),[eg,eb]=(0,h.useState)(!1),[ev,ej]=(0,h.useState)(!1),[ey,eN]=(0,h.useState)(!1),[e_,eC]=(0,h.useState)(!1),[eI,eA]=(0,h.useState)(null),[eP,eE]=(0,h.useState)(null),[eT,eL]=(0,h.useState)(!1),[eD,eM]=(0,h.useState)(!1),[eR,eO]=(0,h.useState)(0),[eF,eq]=(0,h.useState)(!0),eU=(0,h.useRef)(!1),ez=(0,h.useRef)(0),eW=(0,h.useRef)(null);(0,h.useEffect)(()=>{G&&(eW.current!==G&&(K(null),eW.current=G),Z(!1),n.A.get("/api/page/".concat(G,"?t=").concat(Date.now())).then(e=>{K(e.data)}).catch(e=>{var t;if(n.A.isAxiosError(e)&&(null==(t=e.response)?void 0:t.status)===410){Z(!0),K(null);return}console.error("Failed to fetch page data for editor:",e),K(null)}))},[G,et]),(0,h.useEffect)(()=>{(0,aU.ow)()&&!T.query[aB.$5]&&T.replace({pathname:T.pathname,query:{...T.query,[aB.$5]:"1"}},void 0,{shallow:!0})},[T]),(0,h.useEffect)(()=>{H("string"==typeof T.query.brand_id?T.query.brand_id:null)},[T.query.brand_id]);let eY="string"==typeof T.query.approve?T.query.approve:null,eB="1"===T.query.simulator,eG="freestyle"===T.query[aL],eV=(0,h.useCallback)(()=>{let{[aL]:e,...t}=T.query;T.replace({pathname:T.pathname,query:t},void 0,{shallow:!0})},[T]),[e$,eH]=(0,h.useState)(!0),eJ=null!=(o=null!=$?$:null==J?void 0:J.brand_id)?o:null,{value:eK,actions:eQ}=(0,y.dF)(eJ,String(et)),{brand:eZ}=eK,{setBrand:eX,reload:e0}=eQ,e1=(0,y.IH)(eK),e2=(0,h.useRef)(!1);(0,h.useEffect)(()=>
1{if(!$||G||e2.current)return;e2.current=!0;let e=!1;return(async()=>{try{let t=(await (0,aO.OF)($))[0];if(!e&&t){let e={brand_id:$,page_id:t.page_id};"string"==typeof T.query.tab&&(e.tab=T.query.tab),T.replace({pathname:"/",query:e},void 0,{shallow:!0})}}catch(e){console.error("[index] auto-select first brand product failed",e)}finally{e2.current=!1}})(),()=>{e=!0}},[$,G,T]),(0,h.useEffect)(()=>{(async()=>{if(!G)return ej(!1);let e=await (0,aq.f)(G).catch(()=>null);ej(!!e),e&&eA(e)})()},[G,et]),(0,h.useEffect)(()=>{let{subscription:e,tier:t,session_id:r,meta_event_id:a,meta_event:n}=T.query,s=Array.isArray(e)?e[e.length-1]:e,l=Array.isArray(r)?r[r.length-1]:r,i=Array.isArray(a)?a[a.length-1]:a,o=Array.isArray(n)?n[n.length-1]:n;if("success"===s){if(("standard"===t||"pro"===t)&&em(t),ec(!0),"StartTrial"===o&&i&&1){let e="meta_st_".concat(i);sessionStorage.getItem(e)||((0,aW.Xe)("StartTrial",{value:0,currency:"USD"},{eventID:i}),sessionStorage.setItem(e,"1"))}(async()=>{if(await new Promise(e=>setTimeout(e,1e3)),"string"==typeof l&&l)try{await fetch("/api/stripe/verify-session",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session_id:l})})}catch(e){console.warn("[Subscription] verify-session failed:",e)}try{let e=await fetch("/api/stripe/sync-subscription",{method:"POST",headers:{"Content-Type":"application/json"}});if(e.ok){let t=await e.json();console.log("[Subscription] Synced from Stripe:",t),await tD();let r=Object.fromEntries(Object.entries(T.query).filter(e=>{let[t]=e;return"subscription"!==t&&"tier"!==t&&"session_id"!==t&&"meta_event_id"!==t&&"meta_event"!==t}));T.replace({pathname:"/",query:r},void 0,{shallow:!0})}}catch(e){console.error("[Subscription] Failed to sync:",e)}ef(e=>e+1);for(let e=0;e<2;e++)await new Promise(e=>setTimeout(e,1500)),ef(e=>e+1);eq(!1)})()}else eq(!1)},[T.query]),(0,h.useEffect)(()=>{let e,t=(0,az.dx)(()=>{em("pro"),e=setTimeout(()=>ec(!0),250)});return()=>{t(),e&&clearTimeout(e)}},[]);let{budgets:e5}=(0,eS.d)(),e4=(0,h.useRef)(e5);e4.current=e5,(0,h.useEffect)(()=>{let{topup:e,session_id:t}=T.query,r=Array.isArray(e)?e[e.length-1]:e,a=Array.isArray(t)?t[t.length-1]:t;if("success"!==r&&"canceled"!==r)return;let n=()=>{let e=Object.fromEntries(Object.entries(T.query).filter(e=>{let[t]=e;return"topup"!==t&&"session_id"!==t}));T.replace({pathname:"/",query:e},void 0,{shallow:!0})};if("success"!==r||"string"!=typeof a||!a)return void n();let s="topup_verified_".concat(a);if(sessionStorage.getItem(s))return void n();sessionStorage.setItem(s,"1"),(async()=>{try{let e=await (0,aR.PL)(a);(e.granted||e.already_granted)&&(0,aA.oR)({title:"Tokens added",description:"".concat((0,aH.AK)(e.amount_usd,e4.current).toLocaleString()," tokens are ready to use.")})}catch(e){console.warn("[TokenTopup] verify failed:",e)}n()})()},[T.query,T.replace]);let e3=e=>{eU.current=!0,V(e),el(!0),eb(!1),B("Make"),th(Date.now()),tu(!1),tp(!1),T.push("/?page_id=".concat(e,"&tab=","Make"),void 0,{shallow:!0}),ee(e=>e+1)},e7=(0,h.useCallback)(()=>{(0,aY.Cc)(),eb(!1),B("Imagine"),V(null),el(!1),eo(null),th(null),tu(!1),tp(!1),eO(e=>e+1),Z(!1),T.replace("/",void 0,{shallow:!0})},[T]),e6=(0,h.useCallback)(()=>{console.log("Action completed - reloading page data"),er(e=>e+1),en(e=>e+1),tE(!1)},[]),e8=(0,h.useCallback)(()=>{console.log("Page updated - reloading page data"),er(e=>e+1)},[]),e9=(0,h.useRef)(null),[te,tt]=(0,h.useState)(0),tr=(0,h.useCallback)(async e=>{try{let t=await fetch("/api/page/".concat(e,"/generate-ads"),{method:"POST",signal:AbortSignal.timeout(3e5)});if(t.ok)return!0;let r=await t.json().catch(()=>null);if(402===t.status&&(0,eS.z)(r))return eE(r),eL(!0),!1;console.error("Ad generation failed:",t.status,r)}catch(e){console.error("Error generating ads:",e)}return(0,aA.oR)({title:"We couldn't finish your ad creatives",description:"Your store is live. Open the Grow tab to try again.",variant:"destructive"}),!1},[]),ta=(0,h.useCallback)(async(e,t)=>{e9.current=e,eC(!0),eA(t),ex(!0),ej(!0),B("Grow"),T.push("/?page_id=".concat(e,"&tab=Grow"),void 0,{shallow:!0}),await tr(e),eC(!1),ex(!1),er(e=>e+1)},[T,tr]),tn=(0,h.useCallback)(e=>{B("Grow"),eM(!0),T.push({pathname:"/",query:{page_id:e,tab:"Grow"}},void 0,{shallow:!0})},[T]),ts=(0,h.useCallback)(async(e,t,r)=>{var a;e9.current=e,eC(!0),ex(!0),eA(null!=(a=null!=r?r:null==J?void 0:J.brand_subdomain)?a:""),B("Grow"),T.push({pathname:"/",query:{brand_id:t,page_id:e,tab:"Grow"}},void 0,{shallow:!0}),await tr(e),eC(!1),ex(!1),er(e=>e+1)},[T,null==J?void 0:J.brand_subdomain,tr]),tl=(0,h.useCallback)(async(e,t)=>{if(J){e9.current=e,eC(!0),eA(t),ex(!0),ej(!0),B("Grow");try{let{brandId:r}=await aT(J,t);T.push({pathname:"/",query:{brand_id:r,page_id:e,tab:"Grow"}},void 0,{shallow:!0}),await tr(e)}catch(e){console.error("Error creating store:",e)}finally{eC(!1),ex(!1),er(e=>e+1)}}},[T,J,tr]),ti=(0,h.useCallback)(async()=>{G&&(eC(!0),ex(!0),await tr(G),eC(!1),ex(!1),er(e=>e+1))},[G,tr]);(0,h.useEffect)(()=>{var e,t;if("Grow"!==z||!G||!J||e_||eh||eD||!(ev||J.brand_subdomain)||!(0,aJ.td)(J)||(null==(e=J.elements)?void 0:e.some(e=>"adImageDescription1"===e.id))||e9.current===G)return;e9.current=G;let r=null!=(t=J.brand_subdomain)?t:null;(async()=>{let e=await n.A.get("/api/page/".concat(G,"/chat-status"),{params:{statusOnly:"1"}}).catch(()=>null);if(e&&"waiting"===(0,q.mT)(e.data.agentStatuses,e.data.hasOngoingActions))return setTimeout(()=>{e9.current===G&&(e9.current=null,tt(e=>e+1))},3e4);eC(!0),eA(r),await tr(G),eC(!1),er(e=>e+1)})()},[z,G,J,ev,e_,eh,eD,tr,te]);let to=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>!1;if(!(eU.current||t()))try{var r;let a=await nr("/api/page/".concat(e,"/mode"));if(eU.current||t())return;if(!a.ok)return void T.replace("/",void 0,{shallow:!0});let n=await a.json();if(eU.current||t())return;if("pending"!==n.page_mode)return void T.replace("/?page_id=".concat(e,"&tab=Make"),void 0,{shallow:!0});let s=await nr("/api/page/".concat(e,"/chat-status"));if(s.ok&&(await s.json()).hasOngoingActions&&!t()){eN(!0),eb(!0),B("Product"),V(null);return}let l=await nr("/api/refine-session/resume?page_id=".concat(e));for(let r=0;r<2&&!l.ok&&404!==l.status;
1r++){if(await new Promise(e=>setTimeout(e,400*(r+1))),eU.current||t())return;l=await nr("/api/refine-session/resume?page_id=".concat(e))}if(eU.current||t())return;if(!l.ok)return void T.replace("/",void 0,{shallow:!0});let i=await l.json(),o={prompt:i.prompt,selectedImageUrl:i.selectedImageUrl,reference2Url:i.reference2Url,reference3Url:i.reference3Url,characteristics:i.characteristics,conversationHistory:i.conversationHistory,initialMessage:i.initialMessage,timestamp:Date.now(),page_id:e,userId:null==L?void 0:L.id,brand_id:null!=(r=i.brand_id)?r:null};if(localStorage.setItem(aY.wy,JSON.stringify(o)),localStorage.setItem(aY.Dy,"imagine"),eU.current||t())return;eb(!0),B("Product"),V(null)}catch(r){console.error("Error handling refine reload for ".concat(e,":"),r),eU.current||t()||T.replace("/",void 0,{shallow:!0})}};(0,h.useEffect)(()=>{ez.current+=1;let e=ez.current,t=()=>ez.current!==e,{page_id:r,mode:a,tab:s,new:l,brand_id:i}=T.query,o="string"==typeof r&&r.includes("?")?r.split("?")[0]:r;if("string"==typeof i&&i.length>0){eb(!1),V("string"==typeof o&&o.length>0?o:null),B("string"==typeof s&&("Website"===s||"Products"===s||"Grow"===s)?s:"Website"),el(!1),th(null),tu(!1),tp(!1);return}if("string"==typeof r&&r.includes("?")&&o){let e={};s&&(e.tab=String(s)),e.page_id=String(o),T.replace({pathname:"/",query:e},void 0,{shallow:!0});return}if(l)return void T.replace("/",void 0,{shallow:!0});if("refine"===a&&(0,aU.ow)()){let e="string"==typeof o&&o||(0,aU.WH)();if(e)return void T.replace({pathname:"/",query:{page_id:e,tab:"Product"}},void 0,{shallow:!0})}if("refine"===a){let e="string"==typeof o?o:null;if(e)to(e,t);else{let e=(0,aY.ue)(null==L?void 0:L.id);if(null==e?void 0:e.page_id)return void T.replace("/?mode=refine&page_id=".concat(e.page_id),void 0,{shallow:!0});eU.current=!1,eb(!0),B("Product"),V(null),th(null),tu(!1),tp(!1)}return}if(eb(!1),"string"==typeof o){if(eU.current){eU.current=!1;return}(async()=>{let e="Grow"===s&&!!J&&(0,aJ.Tf)(J,ev).Grow,r="string"==typeof s&&na(s)&&("Grow"!==s||e),a=r||tR&&"Grow"===s||es?null:Promise.all([(0,aq.f)(o).then(Boolean).catch(()=>!1),n.A.get("/api/page/".concat(o)).then(e=>e.data).catch(()=>null)]);null==a||a.catch(()=>{});try{let e=await fetch("/api/page/".concat(o,"/mode")),n=await e.json();if("pending"===n.page_mode){for(let e=0;e<3;e++){let t=await fetch("/api/refine-session/resume?page_id=".concat(o));if(t.ok){var l;let e=await t.json(),r={prompt:e.prompt,selectedImageUrl:e.selectedImageUrl,reference2Url:e.reference2Url,reference3Url:e.reference3Url,characteristics:e.characteristics,conversationHistory:e.conversationHistory,initialMessage:e.initialMessage,timestamp:Date.now(),page_id:o,userId:null==L?void 0:L.id,brand_id:null!=(l=e.brand_id)?l:null};localStorage.setItem(aY.wy,JSON.stringify(r)),localStorage.setItem(aY.Dy,"imagine");break}if(404===t.status)break;await new Promise(t=>setTimeout(t,400*(e+1)))}if(t())return;T.push("/?mode=refine&page_id=".concat(o),void 0,{shallow:!0});return}if(t())return;if(V(o),r)B(s);else if(tR&&"Grow"===s)B("Grow");else if(a){let[e,r]=await a;if(t())return;B(function(e,t){let r=(0,aJ.Tf)(e,t);return r.Grow?"Grow":r.Website?"Website":r.Make?"Make":"Product"}(r,e))}es||(th(null),tu(!1),tp(!1))}catch(e){if(console.error("Error checking page mode:",e),t())return;V(o),"string"==typeof s&&na(s)?B(s):es||B("Make")}})()}else V(null),"string"==typeof s&&na(s)?B(s):B("Imagine"),el(!1),th(null),tu(!1),tp(!1)},[T.query,L]);let[td,tu]=(0,h.useState)(!1),[tm,tp]=(0,h.useState)(!1),[tf,th]=(0,h.useState)(null),[tx,tg]=(0,h.useState)(0),[tb,tv]=(0,h.useState)(!1),[tw,tj]=(0,h.useState)(null),ty=(0,tc.a)(),[tk,tN]=(0,h.useState)(null),[t_,tC]=(0,h.useState)(!1),[tI,tS]=(0,h.useState)(!1),tA=(0,h.useRef)(!1),[tP,tE]=(0,h.useState)(!1),{subscription:tT,loading:tL,refresh:tD}=(0,ek.R)(),tM="free"!==tT.tier,tR=!tM&&!tL,tO=!!J&&(0,aJ.Tf)(J,ev).Grow,tF="expired"===tT.status||tT.pastDue,tq=tR&&(tF||!tO),{flagState:tU}=(0,I._P)(W.Wg.PaywallSampleOffer),tz=(0,I.z3)(W.Wg.AgentChat,G),[tW,tY]=(0,h.useState)(null);(0,h.useEffect)(()=>{tz.loading||tY(tz.flagState)},[tz.loading,tz.flagState]);let tB=tz.loading&&null!=tW?tW:tz.flagState,tG=!!J&&!tO,tV=null==J||null==(r=J.elements)||null==(t=r.find(e=>"productName"===e.id))?void 0:t.content,t$="string"==typeof tV?tV:null,tH=(null==J?void 0:J.page_id)===G?t$:null;(0,h.useEffect)(()=>
1{if(tL||tM||eg||tR||!z||!aJ.UJ.includes(z))return;B("Product");let e={tab:"Product"};G&&(e.page_id=G),T.push({pathname:"/",query:e},void 0,{shallow:!0})},[z,tL,tM,G,eg,tR]),(0,h.useEffect)(()=>{!tA.current||t_||tb||tS(!0),tA.current=t_},[t_,tb]),(0,h.useEffect)(()=>{tb&&tS(!1)},[tb]),(0,h.useEffect)(()=>{if(!tb)return;let e=e=>{"Escape"===e.key&&tv(!1)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[tb]),(0,h.useEffect)(()=>{ei&&!eg&&G!==ei.page_id&&eo(null)},[ei,eg,G]),(0,h.useEffect)(()=>{G&&es&&"Imagine"===z&&n.A.get("/api/page/".concat(G,"/chat-status")).then(e=>{let{agentStatuses:t}=e.data;"completed"===t["Product Design"]&&tu(!0),"completed"===t["Supplier Sourcing"]&&tp(!0)}).catch(e=>console.error("Error checking initial status:",e))},[G,es,z]),(0,h.useEffect)(()=>{if(es&&"Imagine"===z&&tf){if(tm&&td){console.log("â
Supplier Sourcing completed, navigating immediately to Product page"),B("Make"),th(null);return}let e=Date.now()-tf,t=Math.max(0,13e4-e);if(e>=13e4){B("Product"),th(null);return}let r=setTimeout(()=>{tm&&td?B("Make"):B("Product"),th(null)},t);return()=>clearTimeout(r)}},[tm,td,es,z,tf]),(0,h.useEffect)(()=>{if(!G||!es)return;let e=null,t=0,r=async()=>{try{t++;let{agentStatuses:r}=(await n.A.get("/api/page/".concat(G,"/chat-status"))).data,a=r["Website Content"],s=r["Product Design"];console.log("[Generation Poll #".concat(t,"] Website: ").concat(a,", Design: ").concat(s)),("completed"===a||t>6&&"completed"===s)&&(console.log("[Generation Poll] Generation complete, triggering chat refresh"),tg(e=>e+1),e&&(clearInterval(e),e=null)),t>=60&&e&&(console.log("[Generation Poll] Max polls reached, stopping"),clearInterval(e),e=null,tg(e=>e+1))}catch(e){console.error("[Generation Poll] Error checking status:",e)}},a=setTimeout(()=>{e=setInterval(r,5e3)},1e4);return()=>{clearTimeout(a),e&&clearInterval(e)}},[G,es]);let tJ=e=>{if(eh)return void console.log("Cannot navigate to ".concat(e," - regeneration in progress"));if(eJ&&("Grow"===e&&!tR||"Products"===e||"Website"===e&&!G)){B(e);let t={brand_id:eJ,tab:e};G&&(t.page_id=G),T.push({pathname:"/",query:t},void 0,{shallow:!0});return}if($&&!G)return;if(eg)return"Product"===e?void B(e):void console.log("Cannot navigate to ".concat(e," - refine mode active"));let t=(0,aJ.Tf)(J,ev)[e],r="Make"===e&&!!G,a="Grow"===e&&tR&&!!G;if(t||r||a||"Imagine"===e){B(e),"Website"!==e&&tj(null);let t={tab:e};G&&(t.page_id=G),T.push({pathname:"/",query:t},void 0,{shallow:!0})}else{console.log("Cannot navigate to ".concat(e," - required data not yet available"));let t=(0,aJ.qV)(e,J);t&&(0,aA.oR)({title:"".concat(e," isn't ready yet"),description:t})}},tK=(e,t)=>{J&&t&&K({...J,launch_status:t}),er(e=>e+1),B(e);let r={tab:e};G&&(r.page_id=G),T.push({pathname:"/",query:r},void 0,{shallow:!0})},tQ=!!((G||tB&&eJ)&&!eg&&!eh&&z&&(["Product","Website","Validate","Make","Financials","Grow"].includes(z)||eJ&&"Products"===z)),tZ=tQ&&!(!ty&&"Website"===z&&tw),tX=!S&&!P,t0=null!=(d=$?null==eZ?void 0:eZ.name:null)?d:J?(0,U.Ou)(J).content.brandName:null;return(0,a.jsxs)(a.Fragment,{children:[!tX&&(0,a.jsx)(u(),{children:(0,a.jsx)("title",{children:(0,aG.ps)(t0)})}),tX&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(u(),{children:[(0,a.jsx)("title",{children:aG.FO}),(0,a.jsx)("meta",{name:"description",content:aG.h1}),(0,a.jsx)("link",{rel:"canonical",href:(0,aG.$N)("/")}),(0,a.jsx)("meta",{property:"og:type",content:"website"}),(0,a.jsx)("meta",{property:"og:site_name",content:aG.yy}),(0,a.jsx)("meta",{property:"og:title",content:aG.p3}),(0,a.jsx)("meta",{property:"og:description",content:aG.h1}),(0,a.jsx)("meta",{property:"og:url",content:(0,aG.$N)("/")}),(0,a.jsx)("meta",{property:"og:image",content:aG.Sc}),(0,a.jsx)("meta",{name:"twitter:card",content:"summary_large_image"}),(0,a.jsx)("meta",{name:"twitter:title",content:aG.p3}),(0,a.jsx)("meta",{name:"twitter:description",content:aG.h1}),(0,a.jsx)("meta",{name:"twitter:image",content:aG.Sc})]}),(0,a.jsx)(aS.Z,{data:[(0,aV.dA)(),(0,aV.rL)(),(0,aV.vb)()]})]}),!L&&(E||!D)&&(0,a.jsx)(nn,{imaginePageKey:eR}),L&&(0,a.jsx)(a_,{children:(0,a.jsx)(y.jO,{value:eK,actions:eQ,
1children:(0,a.jsx)(b.rA,{productId:G,productName:tH,surface:function(e){switch(e){case"Products":return"products";case"Product":return"product";case"Make":return"make";case"Website":return"website";case"Validate":return"validate";case"Financials":return"financials";case"Grow":case"Tasks":return"grow";default:return null}}(z),ready:!G||(null==J?void 0:J.page_id)===G,children:(0,a.jsx)(N.E,{available:tZ,pageId:null!=G?G:null,onSend:e=>{tv(!0),tN(null),setTimeout(()=>tN(e),0)},children:(0,a.jsxs)("div",{className:"w-full h-full bg-background flex flex-col safe-area-inset",children:[(0,a.jsx)(a9,{user:L,activePage:z,onPageChange:tJ,pageId:G,brandId:$,projectCreationCounter:X,page:J,isChatVisible:tb,isChatBusy:t_,hasUnreadChat:tI,onChatToggle:tQ?()=>tv(!tb):void 0,onChatClose:()=>tv(!1),isNavigationBlocked:eh,transitionTo:eh&&"Make"===z?"Website":void 0,refineMode:eg,isNewlyCreatedBrand:es,refreshTrigger:et,subscriptionRefreshTrigger:ep,onNewProject:e7}),(0,a.jsx)("div",{className:"flex-1 flex flex-col overflow-hidden ".concat("Imagine"===z?"":"md:mb-5 md:mx-5"),children:(0,a.jsxs)(_.e,{children:[(e=>{let t=!!(G&&!eg&&z&&(["Product","Website","Validate","Make","Financials","Grow"].includes(z)||$&&("Products"===z||"Grow"===z)));if((G||eJ)&&!eg&&z&&"Imagine"!==z){var r;let n,s="Make"===z?"Make":"Website"===z||"Website"===z?"Website":"Grow"===z||"Grow"===z?"Grow":"Product",l=null!=(r=null!=$?$:null==J?void 0:J.brand_id)?r:null,i=tB&&l||G&&t?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{type:"button","aria-label":"Close chat assistant",className:"fixed inset-0 z-[65] bg-black/50 transition-opacity duration-300 md:hidden ".concat(tb?"visible opacity-100":"invisible pointer-events-none opacity-0"),onClick:()=>tv(!1)}),(0,a.jsx)("aside",{"aria-label":"Dough Assistant",className:"fixed inset-x-0 bottom-0 z-[70] h-[80vh] rounded-t-2xl bg-secondary p-0 transition-transform duration-300 ease-in-out md:relative md:inset-auto md:z-auto md:h-auto md:min-h-0 md:w-auto md:translate-y-0 md:rounded-2xl md:p-3 ".concat("Website"===z&&tw||eh?"md:hidden":"md:flex"," ").concat(tb?"visible translate-y-0":"invisible translate-y-full md:visible"),children:(0,a.jsx)("div",{className:"h-full bg-secondary rounded-t-2xl",children:(n=()=>tv(!1),tB&&l?(0,a.jsx)(a6,{onActionCompleted:e6,refreshTrigger:tx,onClose:n,externalMessage:tk,onBusyStateChange:tC,onExternalMessageConsumed:()=>tN(null)}):G?(0,a.jsx)(a7,{pageId:G,featureContext:"design",chatHistory:[],onActionCompleted:e6,refreshTrigger:tx,onClose:n,externalMessage:tk,onBusyStateChange:tC,onExternalMessageConsumed:()=>tN(null),visibleStep:s},G):null)})})]}):null,o=(0,a.jsx)("div",{className:"w-full md:w-96 bg-background border border-gray-200 rounded-xl h-full flex-shrink-0 flex items-center justify-center",children:(0,a.jsx)("div",{className:"w-6 h-6 border-2 border-primary border-t-transparent rounded-full animate-spin opacity-50"})});return(0,a.jsxs)("div",{className:"flex flex-col flex-1 w-full max-w-full overflow-hidden gap-4 md:flex-row",children:[i,"Website"===z&&tw?(0,a.jsx)("div",{className:"hidden ".concat(eh?"md:hidden":"md:flex"," bg-secondary rounded-2xl p-3 min-h-0"),children:tw}):i?null:(0,a.jsx)("div",{className:"hidden ".concat(eh?"md:hidden":"md:flex"," bg-secondary rounded-2xl p-3 min-h-0"),children:o}),(0,a.jsx)("div",{className:"".concat("Make"===z?"@container/make":""," flex flex-1 bg-secondary min-h-0 md:rounded-2xl md:p-3 ").concat(eh?"":"md:border-primary/70 md:border-4"),children:e})]})}return e})((()=>{let e,t=(0,a.jsx)("div",{className:"flex items-center justify-center min-h-screen bg-white",children:(0,a.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[(0,a.jsx)(p(),{src:"/dough_logo.svg",alt:"Dough",width:80,height:40,className:"h-10 w-auto",priority:!0}),(0,a.jsx)("div",{className:"w-8 h-8 border-3 border-[#E07A5F] border-t-transparent rounded-full animate-spin"})]})}),r=!!T.query.page_id,n=!$&&"Products"===z;if(r&&!eg&&!$&&(!G||n)||eF)return t;if(L&&!(0,aU.ow)()&&(null==J?void 0:J.page_id)===G&&J.owner_id&&J.owner_id!==L.id){if(R)return t;if(!M)return(0,a.jsx)(j,{title:"This product isn't on this account",email:L.email,onHome:()=>(0,aF.eM)(T)})}if(z&&aJ.UJ.includes(z)&&(tL||!tM)&&!eg&&!tR)return t;if($){if(!eZ)return"not_found"===eK.status?(0,a.jsx)(j,{title:"This store isn't on this account",email:null==L?void 0:L.email,onHome:()=>(0,aF.eM)(T)}):e1?(0,a.jsx)("div",{className:"flex items-center justify-center min-h-screen bg-white p-6",children:(0,a.jsxs)("div",{className:"max-w-sm rounded-2xl border border-dashed border-border bg-background p-8 text-center",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold text-foreground",children:"Couldn't open this
1store"}),(0,a.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"Your store is still there. This is a loading problem on our side."}),(0,a.jsxs)("div",{className:"mt-4 flex items-center justify-center gap-3",children:[(0,a.jsx)(w.$,{onClick:()=>e0(),children:"Try again"}),(0,a.jsx)(w.$,{variant:"ghost",onClick:()=>(0,aF.eM)(T),children:"Go back"})]})]})}):t;e="Products"===z?(0,a.jsx)(a3,{brand:eZ,onBrandUpdate:eX,operator:(0,a.jsx)(a8,{brandId:$,focusTaskId:eY},$)}):"Grow"===z?G?(0,a.jsx)(aX,{pageId:G,onPageChange:tJ,isAdsGenerating:e_,adsSubdomain:eI,brandId:$,hideChatPanel:!0,growPaywallLocked:tq,growShowLaunch:tG,isPaidUser:tM,productName:t$,openSimulator:eB,operatorSlot:e=>(0,a.jsx)(a8,{brandId:$,focusTaskId:eY,onShownChange:eH,ownerMove:e},$),brandOperatorActive:e$},G):(0,a.jsxs)("div",{className:"flex flex-1 flex-col items-center justify-center gap-6 p-4 md:p-6",children:[(0,a.jsx)("div",{className:"w-full max-w-3xl",children:(0,a.jsx)(a8,{brandId:$,focusTaskId:eY},$)}),(0,a.jsxs)("div",{className:"max-w-md rounded-2xl border border-dashed border-border bg-background p-6 text-center",children:[(0,a.jsx)("h2",{className:"text-base font-semibold text-foreground",children:"Pick a product to operate"}),(0,a.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"Use the products picker in the header to open a product's Operate dashboard: tasks, autopilot and progress are per-product."})]})]}):(0,a.jsx)(a4,{brand:eZ,onBrandUpdate:eX,chatRefreshTrigger:tx,previewRefreshSignal:ea,onCustomizePanelChange:tj,openFreestyleDraft:eG,onFreestyleDraftOpened:eV})}else switch(z){case"Website":e=J?(0,a.jsx)(a0,{page:J,onPageUpdate:e8,onPageChange:tJ,onFirstPublish:ta,onBrandProductComplete:ts,onCreateStore:tl,onCustomizePanelChange:tj,onSkipToGrow:tR?tn:void 0,previewRefreshSignal:ea},null!=G?G:void 0):(0,a.jsx)("div",{className:"flex flex-grow items-center justify-center p-5",children:(0,a.jsxs)("div",{className:"text-center text-primary-foreground",children:[(0,a.jsx)("h1",{className:"text-4xl mb-4 font-sans font-bold",children:"Loading Page..."}),(0,a.jsx)("p",{className:"text-xl text-muted-foreground font-sans",children:"Please wait while we fetch your page data."})]})});break;case"Imagine":default:e=(0,a.jsx)(aw,{},eR);break;case"Product":e=eg?(0,a.jsx)(a1,{page:null,mode:"refine",onBrandCreated:e3,onGenerationStarted:eo,onBrandCreationStart:()=>{eo(null),eU.current=!0},onPageChange:tJ,isGenerationInProgress:ey,onGenerationComplete:()=>eN(!1)}):J?(0,a.jsx)(a1,{page:J,page_id:G,pageRefreshTrigger:et,mode:"view",onPageChange:tJ,onSendChatMessage:e=>{tE(!0),tN(null),setTimeout(()=>tN(e),0)},isSavingToChat:tP,onProductRefresh:()=>er(e=>e+1)},G):(0,a.jsx)("div",{className:"flex flex-grow items-center justify-center p-5",children:(0,a.jsxs)("div",{className:"text-center text-primary-foreground",children:[(0,a.jsx)("h1",{className:"text-4xl mb-4 font-sans font-bold",children:"Loading Page..."}),(0,a.jsx)("p",{className:"text-xl text-muted-foreground font-sans",children:"Please wait while we fetch your page data."})]})});break;case"Validate":e=(0,a.jsx)(a2,{page_id:G,pageRefreshTrigger:et,isAdsGenerating:e_,adsSubdomain:eI,onPageChange:tJ,onGenerateAds:ti});break;case"Financials":e=J?(0,a.jsx)(a5,{page_id:G,pageRefreshTrigger:et,page:J}):(0,a.jsx)("div",{className:"flex flex-grow items-center justify-center p-5",children:(0,a.jsxs)("div",{className:"text-center text-primary-foreground",children:[(0,a.jsx)("h1",{className:"text-4xl mb-4 font-sans font-bold",children:"Loading Page..."}),(0,a.jsx)("p",{className:"text-xl text-muted-foreground font-sans",children:"Please wait while we fetch your page data."})]})});break;case"Make":if(!G){e=(0,a.jsx)(aw,{},eR);break}e=(0,a.jsx)(aZ,{page_id:G,pageRefreshTrigger:et,onPageChange:tJ,onRegenerationStateChange:ex,onRefreshAndNavigate:tK,onTimelineActionComplete:()=>er(e=>e+1),onSendOptimizationMessage:e=>{tN(null),setTimeout(()=>tN(e),0)},isChatBusy:t_,user:L,growPaywallLocked:tq,sampleOfferCta:tU});break;case"Grow":if(G){var s;let t=null!=(s=null==J?void 0:J.brand_id)?s:null;e=(0,a.jsx)(aX,{pageId:G,onPageChange:tJ,isAdsGenerating:e_,adsSubdomain:eI,brandId:t,hideChatPanel:!0,growPaywallLocked:tq,growShowLaunch:tG,isPaidUser:tM,growIntro:eD,onGrowIntroDone:()=>eM(!1),productName:t$,openSimulator:eB,...t?{operatorSlot:e=>(0,a.jsx)(a8,{brandId:t,focusTaskId:eY,onShownChange:eH,ownerMove:e},t),brandOperatorActive:e$}:{}},G)}else e=(0,a.jsx)(aw,{},eR)}return(0,a.jsx)(k.y,{pageId:G,children:(0,a.jsx)(aI,{page:null!=J?J:null,hasInNetworkSupplier:!1,children:e})})})()),(0,a.jsx)(Y,{pageId:null!=(c=null==ei?void 0:ei.page_id)?c:G,brandId:null!=(x=null==ei?void 0:ei.brand_id)?x:(null==J?void 0:J.page_id)===G&&null!=(m=null==J?void 0:J.brand_id)?m:null,enabled:!!ei||es&&!eg},null!=(v=null==ei?void 0:ei.page_id)?v:G)]})}),Q&&(0,a.jsx)(ew.lG,{open:!0,children:(0,a.jsxs)(ew.Cf,{className:"sm:max-w-md",showCloseButton:!1,onEscapeKeyDown:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,a.jsxs)(ew.c7,{children:[(0,a.jsx)(ew.L3,{children:"This product is no longer available"}),(0,a.jsx)(ew.rr,{children:"The owner has taken this product down, so it can't be opened from here. Start a new product to keep building on Dough."})]}),(0,a.jsx)(w.$,{onClick:e7,className:"w-full mt-2",children:"Create a new product"})]})}),(0,a.jsx)(ew.lG,{open:ed,onOpenChange:ec,children:(0,a.jsxs)(ew.Cf,{className:"sm:max-w-md p-0",children:[(0,a.jsx)("div",{className:"absolute inset-0 bg-gradient-to-br from-purple-50 via-blue-50 to-indigo-50 opacity-60"}),(0,a.jsx)("div",{className:"absolute top-4 right-4 text-yellow-400 animate-pulse",children:(0,a.jsx)(s.A,{className:"w-6 h-6"})}),(0,a.jsx)("div",{className:"absolute top-12 right-12 text-yellow-300 animate-pulse delay-75",children:(0,a.jsx)(s.A,{className:"w-4 h-4"})}),(0,a.jsx)("div",{className:"absolute bottom-8 left-6 text-purple-300 animate-pulse delay-150",children:(0,a.jsx)(s.A,{className:"w-5 h-5"})}),(0,a.jsxs)("div",{className:"relative p-8 text-center",children:[(0,a.jsxs)("div",{className:"mx-auto w-20 h-20 mb-6 relative",children:[(0,a.jsx)("div",{className:"absolute inset-0 bg-gradient-to-br from-purple-500 to-blue-600 rounded-full animate-ping opacity-20"}),(0,a.jsx)("div",{className:"relative flex items-center justify-center w-full h-full bg-gradient-to-br from-purple-500 to-blue-600 rounded-full shadow-lg",children:(0,a.jsx)(l.A,{className:"w-12 h-12 text-white",strokeWidth:2.5})})]}),(0,a.jsxs)("h2",{className:"text-3xl font-bold text-gray-900 mb-3",children:["Welcome to Dough ","pro"===eu?"Pro":"Premium","! \uD83C\uDF89"]}),(0,a.jsxs)("p",{className:"text-lg text-gray-700 mb-2",children:["Your subscription is now ",(0,a.jsx)("span",{className:"font-semibold text-purple-600",children:"active"}),"."]}),(0,a.jsx)("p",{className:"text-sm text-gray-600 mb-6",children:"pro"===eu?"You now have access to every Pro feature. Let's build something amazing!":"You now have access to every Premium feature. Let's build something amazing!"}),(0,a.jsxs)("div",{className:"bg-white/80 backdrop-blur-sm rounded-lg p-5 mb-6 border border-gray-200 text-left",children:[(0,a.jsx)("p",{className:"text-xs uppercase tracking-wider text-gray-500 mb-3 font-semibold text-center",children:"What's included"}),(0,a.jsx)("div",{className:"space-y-2",children:a$[eu].map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-gray-700",children:[(0,a.jsx)(i.A,{className:"w-4 h-4 text-purple-500 flex-shrink-0"}),(0,a.jsx)("span",{children:e})]},e))})]}),(0,a.jsx)(w.$,{onClick:()=>ec(!1),className:"w-full bg-gradient-to-r from-purple-600 to-blue-600 hover:from-purple-700 hover:to-blue-700 text-white font-semibold py-3 rounded-lg shadow-md transition-all duration-200 transform hover:scale-[1.02]",children:"Start Creating"})]})]})}),eP&&(0,a.jsx)(rB.UsageThresholdDialog,{open:eT,onOpenChange:e=>{eL(e),e||eE(null)},currentCost:eP.currentCost,threshold:eP.threshold,limit:null!=(C=eP.limit)?C:"monthly",tier:eP.tier,pageId:null!=G?G:void 0}),(0,a.jsx)(aK,{})]})})})})})]})}},81593:(e,t,r)=>{"use strict";r.d(t,{p:()=>w});var a=r(37876),n=r(35776),s=r(54587),l=r.n(s),i=r(14232),o=r(60545),d=r(78082),c=r(68645),u=r(81466),m=r(48230),p=r.n(m),f=r(3899),h=r(21257);function x(e){let{className:t,onClick:r}=e;return(0,a.jsxs)(p(),{href:"/mcp","aria-label":"Use Dough in Claude",onClick:r,className:(0,h.cn)("group inline-flex items-center gap-1.5 rounded-full border border-border/60 bg-background/70 py-1 pl-1 pr-2.5 text-xs font-medium text-muted-foreground shadow-sm backdrop-blur-sm transition-colors hover:border-primary/40 hover:text-foreground",t),children:[(0,a.jsx)("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-white shadow-sm ring-1 ring-black/5",children:(0,a.jsx)(f.Sk,{className:"h-3 w-3"})}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"Use Dough in Claude"}),(0,a.jsx)("span",{className:"sm:hidden",children:"Use in Claude"}),(0,a.jsx)(u.A,{className:"h-3 w-3 shrink-0 transition-transform group-hover:translate-x-0.5"})]})}var g=r(17963),b=r(81206),v=r(15042);function w(){let{ctaHeadline:e="Letâs build your",ctaPill:t="best-seller",showCta:r=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{user:s}=(0,d.A)(),[u,m]=(0,i.useState)(!1),[p,f]=(0,i.useState)(!1);return(0,a.jsxs)("div",{className:"-mx-4 -mb-5 mt-20 md:-mx-5",children:[r&&(0,a.jsxs)("section",{className:"flex flex-col items-center px-6 pt-4 pb-16 text-center",children:[(0,a.jsxs)("div",{className:"mb-5 flex items-center gap-2 text-sm font-semibold text-foreground",children:[(0,a.jsx)(l(),{src:"/dough.svg",alt:"",width:16,height:16,className:"h-4 w-4"}),"Create"]}),(0,a.jsx)("h2",{className:"text-[clamp(1.75rem,4.5vw,3rem)] font-medium leading-[1.15] text-foreground",style:{fontFamily:'"Plus Jakarta Sans", sans-serif'},children:e}),(0,a.jsx)("span",{className:"mb-7 text-[clamp(1.75rem,4.5vw,3rem)] font-bold italic leading-[1.1] text-[#ff6a3d]",style:{fontFamily:'"Lora", serif'},children:t}),(0,a.jsx)("button",{type:"button",onClick:()=>{(0,g.D)("footer","footer_start_now");let e=document.querySelector("textarea");e?(e.scrollIntoView({behavior:"smooth",block:"center"}),e.focus({preventScroll:!0})):window.scrollTo({top:0,behavior:"smooth"})},className:"inline-flex items-center rounded-full bg-[#ff6a3d] px-8 py-3.5 text-[0.95rem] font-semibold text-white shadow-sm transition-all duration-200 hover:-translate-y-0.5 hover:bg-[#ff8f6b] hover:shadow-[0_8px_24px_rgba(255,106,61,0.3)]",children:"â Start now"})]}),(0,a.jsx)("footer",{className:"rounded-t-[2rem] border-t border-white/40 bg-white/45 px-6 pt-8 pb-5 backdrop-blur-xl",children:(0,a.jsxs)("div",{className:"mx-auto max-w-5xl",children:[(0,a.jsxs)("div",{className:"grid grid-cols-1 items-center gap-6 text-center md:grid-cols-3 md:text-left",children:[(0,a.jsxs)("div",{className:"flex flex-col items-center gap-3 md:items-start",children:[(0,a.jsx)("a",{href:"/",children:(0,a.jsx)(l(),{src:"/dough_logo.svg",alt:"Dough",width:120,height:48,className:"h-8 w-auto"})}),(0,a.jsxs)("p",{className:"text-sm leading-relaxed text-foreground
1/55",children:["Shape your brand.",(0,a.jsx)("br",{}),"Bake your success."]})]}),(0,a.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-x-7 gap-y-3",children:[(0,a.jsx)("a",{href:"/contact",onClick:()=>(0,g.D)("footer","footer_contact"),className:"text-sm text-foreground/55 transition-colors hover:text-[#ff6a3d]",children:"Contact"}),(0,a.jsx)("a",{href:"/about",onClick:()=>(0,g.D)("footer","footer_team"),className:"text-sm text-foreground/55 transition-colors hover:text-[#ff6a3d]",children:"Team"}),(0,a.jsx)("a",{href:"/company",onClick:()=>(0,g.D)("footer","footer_company"),className:"text-sm text-foreground/55 transition-colors hover:text-[#ff6a3d]",children:"Company"}),(0,a.jsx)("a",{href:"/pricing",onClick:()=>(0,g.D)("footer","footer_pricing"),className:"text-sm text-foreground/55 transition-colors hover:text-[#ff6a3d]",children:"Pricing"}),(0,a.jsx)("a",{href:"/learn",onClick:()=>(0,g.D)("footer","footer_learn"),className:"text-sm text-foreground/55 transition-colors hover:text-[#ff6a3d]",children:"Learn"}),(0,a.jsx)("a",{href:"/careers",onClick:()=>(0,g.D)("footer","footer_careers"),className:"text-sm text-foreground/55 transition-colors hover:text-[#ff6a3d]",children:"Careers"})]}),(0,a.jsx)(x,{onClick:()=>(0,g.D)("footer","footer_use_in_claude")})]}),(0,a.jsx)(c.o,{page:"footer",className:"justify-center md:justify-end"})]}),(0,a.jsx)("div",{className:"mt-6 flex justify-center",children:(0,a.jsxs)("button",{type:"button",onClick:function(){(0,g.D)("footer","footer_referral"),s?m(!0):f(!0)},className:"group inline-flex cursor-pointer items-center gap-1.5 text-sm text-foreground/55 transition-colors hover:text-[#ff6a3d]",children:[(0,a.jsx)(n.A,{className:"h-3.5 w-3.5 text-[#ff6a3d]"}),"Earn $",b.$f," per referral",(0,a.jsx)("span",{className:"transition-transform duration-200 group-hover:translate-x-0.5","aria-hidden":!0,children:"â"})]})}),(0,a.jsxs)("div",{className:"mt-5 flex flex-col items-center gap-2 border-t border-black/[0.06] pt-4 text-center text-[0.7rem] text-foreground/40 sm:flex-row sm:justify-center sm:gap-3",children:[(0,a.jsxs)("p",{children:["\xa9 ",new Date().getFullYear()," Dough. All rights reserved."]}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"\xb7"}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("a",{href:"/terms",onClick:()=>(0,g.D)("footer","footer_terms"),className:"transition-colors hover:text-[#ff6a3d]",children:"Terms"}),(0,a.jsx)("a",{href:"/privacy",onClick:()=>(0,g.D)("footer","footer_privacy"),className:"transition-colors hover:text-[#ff6a3d]",children:"Privacy Policy"})]})]})]})}),s?(0,a.jsx)(v.E,{open:u,onOpenChange:m}):p&&(0,a.jsx)(o.default,{isOpen:p,onClose:()=>f(!1),defaultTab:"signup",skipInviteCode:!0,bypassCode:"advertisement"})]})}},83044:(e,t,r)=>{"use strict";r.d(t,{U:()=>i,_:()=>o});var a=r(51802);let n=a.Ik({min_qty:a.ai(),unit_cost:a.ai()}),s=a.Ik({schemaVersion:a.eu(1),provider:a.Yj(),offerId:a.Yj(),offerUrl:a.Yj(),productId:a.Yj().uuid(),variantId:a.Yj().uuid(),skuId:a.Yj(),title:a.Yj(),normalizedDescription:a.Yj(),facts:a.g1(a.Yj(),a.L5()),unsupportedClaims:a.YO(a.Yj()),unitPriceUsd:a.ai(),shippingToUsUsd:a.ai(),shippingEstimated:a.zM().default(!1),landedUnitCostUsd:a.ai(),currency:a.Yj(),moq:a.eu(1),pricingTiers:a.YO(n).length(1),options:a.g1(a.Yj(),a.Yj()),leadTimeDays:a.Ik({min:a.ai(),max:a.ai()}).nullable(),shipsFromCountry:a.Yj().nullable(),sourceImageUrl:a.Yj(),sourcePhotoUrl:a.Yj().url().optional(),restagedImageUrl:a.Yj().nullable(),capturedAt:a.Yj(),offerFreshness:a.k5(["fresh","stale"]),offerStatus:a.k5(["available","delisted"]),allSkus:a.YO(a.Ik({skuId:a.Yj(),variantId:a.Yj().uuid(),options:a.g1(a.Yj(),a.Yj()),unitPriceUsd:a.ai(),available:a.zM(),imageUrl:a.Yj().url().optional(),displayOptions:a.g1(a.Yj(),a.Yj()).optional()}))});var l=r(9928);function i(e){return!!e&&("stock"===e.sourcingLane||!!e.offerSnapshot)}function o(e){var t,r,a;return{variantId:"",preferredVariantId:e.variantId,preservePreferredVariant:e.preserveVariantSelection,productId:e.productId,supplierKey:e.supplierName,productTitle:e.title,productCategory:null!=(t=e.category)?t:null,productDescription:null!=(r=e.description)?r:void 0,options:{},availableOptions:{}
1,specs:void 0,defaultPrice:"number"==typeof e.priceCents&&e.priceCents>0?Math.round(100*(e.priceCents/100+(0,l.Sx)(e.optionAxes,e.configuredOptions)))/100:null,currency:null!=(a=e.currency)?a:null,providerName:e.providerName,providerCountry:e.providerCountry,leadTimeDays:null!=e.deliveryMinDays&&null!=e.deliveryMaxDays?{min:e.deliveryMinDays,max:e.deliveryMaxDays}:null,optionAxes:e.optionAxes,configuredOptions:e.configuredOptions,...e.offerSnapshot?{offerSnapshot:s.parse(e.offerSnapshot)}:{}}}},83442:(e,t,r)=>{"use strict";r.d(t,{AL:()=>f,IH:()=>x,PB:()=>p,dF:()=>h,jO:()=>m});var a=r(37876),n=r(14232),s=r(45485),l=r(38241);let i=Object.freeze([]),o={brandId:null,brand:null,storePageVersion:null,sitePages:i,viewerIsOwner:null,status:"idle"},d={reload:()=>{},setBrand:()=>{}},c=(0,n.createContext)(null),u=(0,n.createContext)(null);function m(e){let{value:t,actions:r,children:n}=e;return(0,a.jsx)(c.Provider,{value:t,children:(0,a.jsx)(u.Provider,{value:r,children:n})})}function p(){var e;return null!=(e=(0,n.useContext)(c))?e:o}function f(){var e;return null!=(e=(0,n.useContext)(u))?e:d}function h(e,t){let r=(0,s.m)(async()=>e?await (0,l.VM)(e):null,[e,t],{enabled:!!e}),[a,o]=(0,n.useState)(null),d=r.data&&r.data.brand.brand_id===e?r.data:null;(0,n.useEffect)(()=>{o(null)},[e,r.data]);let{reload:c}=r,u=(0,n.useMemo)(()=>({reload:c,setBrand:o}),[c]),m=(0,n.useMemo)(()=>e?"error"===r.status?"error":"loading"===r.status||r.data&&r.data.brand.brand_id!==e?"loading":d?"ready":"not_found":"idle",[e,r.status,d]),p=(0,n.useMemo)(()=>{var t,r,n,s;return{brandId:e,brand:null!=(t=null!=a?a:null==d?void 0:d.brand)?t:null,storePageVersion:null!=(r=null==d?void 0:d.storePageVersion)?r:null,sitePages:null!=(n=null==d?void 0:d.sitePages)?n:i,viewerIsOwner:null!=(s=null==d?void 0:d.viewerIsOwner)?s:null,status:m}},[e,a,d,m]);return(0,n.useMemo)(()=>({value:p,actions:u}),[p,u])}function x(e){return"not_found"===e.status||"error"===e.status&&!e.brand}},87641:(e,t,r)=>{"use strict";function a(e){var t,r;let a=null==e||null==(t=e.requestedFormat)?void 0:t.trim(),n=null==e||null==(r=e.actualFormat)?void 0:r.trim();return a&&n&&a.toLowerCase()!==n.toLowerCase()?"the packaging is ".concat(n,", not ").concat(a):null}r.d(t,{M:()=>a})},88887:(e,t,r)=>{"use strict";r.d(t,{_:()=>s});var a=r(14232);function n(e){let t=e.includes("?")?"&":"?";return"".concat(e).concat(t,"_t=").concat(Date.now())}function s(e,t){var r,s,l;let i=null!=(r=null==t?void 0:t.maxRetries)?r:3,o=null!=(s=null==t?void 0:t.retryDelay)?s:1e3,d=null==(l=null==t?void 0:t.enabled)||l,c=(0,a.useRef)(new Map),[,u]=(0,a.useState)(0),m=(0,a.useCallback)(()=>u(e=>e+1),[]),p=JSON.stringify(e.map(e=>({id:e.id,src:e.src,mode:e.mode})));(0,a.useEffect)(()=>{if(!d){let e=c.current;for(let[,t]of e)t.timeoutId&&clearTimeout(t.timeoutId),t.abortController&&t.abortController.abort();e.clear(),m();return}let t=c.current,r=new Set(e.map(e=>e.id));for(let[e,a]of t)r.has(e)||(a.timeoutId&&clearTimeout(a.timeoutId),a.abortController&&a.abortController.abort(),t.delete(e));for(let r of e){if(!r.src){let e=t.get(r.id);e&&(e.timeoutId&&clearTimeout(e.timeoutId),e.abortController&&e.abortController.abort()),t.set(r.id,{url:null,status:"idle",retryCount:0,timeoutId:null,abortController:null});continue}let e=t.get(r.id);((null==e?void 0:e.status)!=="loaded"||!e.url)&&(e&&("loading"===e.status||"retrying"===e.status)||function e(t,r){let a=c.current,s=new AbortController;a.set(t.id,{url:null,status:0===r?"loading":"retrying",retryCount:r,timeoutId:null,abortController:s}),m(),(async()=>{try{var l;let e;if("api-endpoint"===t.mode){let r=n(t.src),a=await fetch(r,{signal:s.signal});if(!a.ok)throw Error("API returned ".concat(a.status));if(!(e=(await a.json()).imageUrl))throw Error("No imageUrl in response")}else e=n(t.src);if(await (l=e,new Promise((e,t)=>{let r=new Image;r.onload=()=>e(),r.onerror=()=>t(Error("Image failed to load")),r.src=l})),s.signal.aborted)return;let i=a.get(t.id);i&&(i.url=e,i.status="loaded",i.retryCount=r,i.abortController=null,m())}catch(n){if(s.signal.aborted)return;if(r<i){let n=setTimeout(()=>{e(t,r+1)},o),s=a.get(t.id);s&&(s.status="retrying",s.retryCount=r,s.timeoutId=n,s.abortController=null,m())}else{let e=a.get(t.id);e&&(e.status="failed",e.retryCount=r,e.abortController=null,m())}}})()}(r,0))}return m(),()=>{for(let[,e]of t)e.timeoutId&&clearTimeout(e.timeoutId),e.abortController&&e.abortController.abort();t.clear()}},[p,d]);let f={};for(let[e,t]of c.current)f[e]={url:t.url,status:t.status,retryCount:t.retryCount};return f}},89068:(e,t,r)=>{"use strict";r.d(t,{T:()=>s,X:()=>n});var a=r(37539);function n(e,t,r){(0,a.Q5)(e,t,null==r?void 0:Math.max(0,Math.round(r/1e3)))}function s(e,t){return"freestyle_flow_run_".concat(e,"_").concat(t)}},92945:(e,t,r)=>{"use strict";r.d(t,{TV:()=>s});var a=r(94784),n=r(30713);function s(e){let t={},r={},s=null;if(!e)return{axes:t,codes:r,mockupUrl:s};for(let[l,i]of Object.entries(e)){let e=l.toLowerCase(),o=function(e){if("string"==typeof e){let t=e.trim();return t.length>0?t:null}return"number"==typeof e||"boolean"==typeof e?String(e):null}(i);if(null!==o){if("_mockup_url"===e){o.startsWith("https://")&&(s=o);continue}if(e.endsWith("_code")){let t=(0,a.$h)(o);t&&(r[e.slice(0,-5)]=t);continue}(0,n.h3)(e)||(t[e]=o)}}return{axes:t,codes:r,mockupUrl:s}}},93929:(e,t,r)=>{"use strict";r.d(t,{AO:()=>s,Ik:()=>l,ME:()=>a,vO:()=>n});let a="rounded-full bg-(--gc-accent) hover:bg-(--gc-accent-edge) text-white font-semibold shadow-[0_6px_16px_-6px_rgba(255,106,61,0.55)] transition-[background-color,transform] duration-150 active:scale-[0.98] disabled:bg-muted disabled:text-muted-foreground disabled:shadow-none disabled:active:scale-100",n="roun
1ded-full border border-(--gc-border) bg-(--gc-card) text-(--gc-ink) transition-colors hover:border-(--gc-accent) hover:bg-(--gc-accent-light) disabled:opacity-50",s="inline-flex items-center gap-1.5 rounded-full text-xs font-medium text-(--gc-muted) transition-colors hover:bg-(--gc-accent-light) hover:text-(--gc-ink) disabled:opacity-50",l="rounded-2xl border border-(--gc-border) bg-(--gc-card) p-3 shadow-[0_8px_24px_rgba(41,31,24,0.05)]"},94305:(e,t,r)=>{"use strict";r.d(t,{U:()=>d,e:()=>o});var a=r(37876),n=r(14232);let s=[],l={failures:0,startedAt:null,events:[],notice:null,outcome:null,draft:null,preparation:null},i=(0,n.createContext)(null);function o(e){let{children:t}=e,[r,o]=(0,n.useState)({}),[d,c]=(0,n.useState)({}),[u,m]=(0,n.useState)({}),[p,f]=(0,n.useState)({}),h=(0,n.useCallback)(e=>o(t=>{var r,a,n,s;return{...t,[e]:{...l,draft:null!=(n=null==(r=t[e])?void 0:r.draft)?n:null,failures:null!=(s=null==(a=t[e])?void 0:a.failures)?s:0,startedAt:Date.now()}}}),[]),x=(0,n.useCallback)((e,t)=>o(r=>{var a;let n=null!=(a=r[e])?a:l;return{...r,[e]:{...n,events:[...n.events,t]}}}),[]),g=(0,n.useCallback)(e=>o(t=>{let r=t[e];return r?{...t,[e]:{...r,events:[]}}:t}),[]),b=(0,n.useCallback)((e,t)=>o(r=>{var a;let n=null!=(a=r[e])?a:l;return{...r,[e]:{...n,notice:t}}}),[]),v=(0,n.useCallback)((e,t)=>o(r=>{let a=r[e];return a?{...r,[e]:{...a,startedAt:null,outcome:null!=t?t:a.outcome,failures:"done"===t?0:"error"===t&&null!=a.startedAt?a.failures+1:a.failures}}:r}),[]),w=(0,n.useCallback)(e=>{var t,a;return null!=(a=null==(t=r[e])?void 0:t.startedAt)?a:null},[r]),j=(0,n.useCallback)(e=>{var t,a;return null!=(a=null==(t=r[e])?void 0:t.outcome)?a:null},[r]),y=(0,n.useCallback)(e=>{var t,a;return null!=(a=null==(t=r[e])?void 0:t.events)?a:[]},[r]),k=(0,n.useCallback)(e=>{var t,a;return null!=(a=null==(t=r[e])?void 0:t.notice)?a:null},[r]),N=(0,n.useCallback)(e=>{var t,a;return null!=(a=null==(t=r[e])?void 0:t.failures)?a:0},[r]),_=(0,n.useCallback)(e=>{var t,a;return null!=(a=null==(t=r[e])?void 0:t.draft)?a:null},[r]),C=(0,n.useCallback)(e=>{var t,a;return null!=(a=null==(t=r[e])?void 0:t.preparation)?a:null},[r]),I=(0,n.useCallback)((e,t)=>o(r=>{var a;let n=null!=(a=r[e])?a:l;return null!=n.startedAt||null!=n.outcome||n.preparation===t?r:{...r,[e]:{...n,preparation:t}}}),[]),S=(0,n.useCallback)((e,t)=>o(r=>{let a=r[e];return(null==a?void 0:a.startedAt)!=null?{...r,[e]:{...a,draft:t}}:r}),[]),A=(0,n.useCallback)(e=>{var t;return null!=(t=d[e])?t:""},[d]),P=(0,n.useCallback)((e,t)=>c(r=>({...r,[e]:t})),[]),E=(0,n.useCallback)(e=>{var t;return null!=(t=p[e])?t:s},[p]),T=(0,n.useCallback)((e,t)=>f(r=>({...r,[e]:t})),[]),L=(0,n.useCallback)(e=>{var t;return null!=(t=u[e])&&t},[u]),D=(0,n.useCallback)((e,t)=>m(r=>({...r,[e]:t})),[]),M=(0,n.useMemo)(()=>({startedAt:w,outcomeFor:j,eventsFor:y,noticeFor:k,failuresFor:N,draftFor:_,setDraft:S,preparationFor:C,setPreparation:I,instructionFor:A,setInstruction:P,composerExpandedFor:L,setComposerExpanded:D,attachmentsFor:E,setAttachments:T,begin:h,appendEvent:x,resetProgress:g,setNotice:b,end:v}),[w,j,y,k,N,_,S,C,I,A,P,L,D,E,T,h,x,g,b,v]);return(0,a.jsx)(i.Provider,{value:M,children:t})}function d(){return(0,n.useContext)(i)}},99126:(e,t,r)=>{"use strict";r.d(t,{$:()=>o,J:()=>i});var a=r(37876),n=r(78082),s=r(21257);let l={anonymous:"h-[min(calc(100dvh-6.75rem),900px)] md:h-[min(calc(100dvh-11.25rem),900px)]",authed:"h-[min(calc(100dvh-7.75rem),900px)] md:h-[min(calc(100dvh-12.5rem),900px)]"};function i(e,t){return(0,s.cn)("guide-chat-surface flex flex-col overflow-hidden","inline"===e?(0,s.cn)("guide-chat-panel relative w-full max-w-3xl min-h-[24rem] rounded-2xl border border-(--gc-border)","shadow-[0_1px_2px_rgba(41,31,24,0.04),0_18px_44px_-28px_rgba(41,31,24,0.35)]","max-md:rounded-none max-md:border-x-0 max-md:border-t-0 max-md:shadow-none",t?l.authed:l.anonymous):"fixed inset-0 z-[80]")}function o(e){let{variant:t}=e,{user:r}=(0,n.A)();return(0,a.jsxs)("div",{className:i(t,!!r),"aria-busy":!0,children:[(0,a.jsx)("div",{className:"h-[45px] shrink-0 border-b border-(--gc-border) md:h-[61px] md:[@media(max-height:700px)]:h-[53px]"}),(0,a.jsx)("div",{className:"flex flex-1 items-center justify-center px-6 pb-16",children:(0,a.jsx)("p",{className:"chat-shimmer-text text-sm font-medium",children:"Opening your chat."})})]})}},99508:(e,t,r)=>{"use strict";r.d(t,{$V:()=>R,EB:()=>m,EX:()=>y,Ej:()=>I,GD:()=>c,Iv:()=>P,LW:()=>O,Mt:()=>V,N7:()=>
1o,NY:()=>k,OD:()=>E,Sh:()=>A,UA:()=>p,Wv:()=>b,XN:()=>U,Y3:()=>w,YJ:()=>G,Z:()=>T,_s:()=>Y,b2:()=>W,cK:()=>C,eR:()=>_,g7:()=>x,ix:()=>u,j7:()=>i,km:()=>j,nv:()=>d,pR:()=>B,pW:()=>l,rM:()=>F,sD:()=>S,wB:()=>M,yZ:()=>N});var a=r(79077),n=r(71041),s=r(97076);let l={goal:null,moneyPath:null,personalReason:null,budget:null,distribution:null,audienceAccounts:[],productPrompt:"",vibe:null,customVibe:"",brandNameChoice:null,ownBrandName:"",productDetails:[],surprisePicked:!1,sellTo:null,sellToAge:null,sellChannels:[],sellChannelsOther:"",interests:[],selectedTrendId:null,extraContext:""};function i(e){return!!(e.selectedTrendId||e.extraContext.trim()||e.interests.length>0||e.sellTo||e.sellToAge||e.sellChannels.length>0||e.sellChannelsOther.trim())}let o="rounded-full bg-gradient-to-b from-amber-400 to-amber-600 text-white font-semibold shadow-[0_5px_0_0_#b45309,0_10px_22px_rgba(217,119,6,0.35)] hover:from-amber-400 hover:to-amber-600 active:translate-y-[3px] active:shadow-[0_2px_0_0_#b45309,0_5px_14px_rgba(217,119,6,0.30)] transition-[transform,box-shadow] duration-150 disabled:from-muted disabled:to-muted disabled:text-muted-foreground disabled:shadow-none disabled:translate-y-0",d=Object.fromEntries(a.qR.filter(e=>e.questionKey).map(e=>{let t=(0,a.NL)(e.question);return[e.questionKey,{key:e.questionKey,...t}]})),c="Quick one. This shapes your first designs.",u="Preparing a couple of quick questions about your product...";function m(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"v1";return(0,a.TE)(e,(0,a.fp)(t))}function p(e){var t,r,n,l;let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"v1",o={...e},d=m(o,i);d.includes("money-path")||(o.moneyPath=null),d.includes("personal-reason")||(o.personalReason=null),d.includes("distribution")||(o.distribution=null),m(o,i).includes("audience")||(o.audienceAccounts=[]);let c=null!=(l=null==(t=(0,a.NL)(null!=(n=null==(r=(0,a.fp)(i).budget)?void 0:r.question)?n:null,o))?void 0:t.options)?l:[];return o.budget&&!c.some(e=>e.value===o.budget)&&(o.budget=null),o.selectedTrendId&&!(0,s.HQ)(o).some(e=>e.id===o.selectedTrendId)&&(o.selectedTrendId=null),o}function f(e,t){switch(e){case"goal":return!!t.goal;case"money-path":return!!t.moneyPath;case"personal-reason":return!!t.personalReason;case"budget":return!!t.budget;case"distribution":return!!t.distribution;
1case"audience":return t.audienceAccounts.length>0;case"product":return!!t.productPrompt.trim();case"vibe":return h(t);case"sell-to":return!!t.sellTo;case"sell-to-age":return!!t.sellToAge;case"sell-channels":return t.sellChannels.length>0;case"interests":return t.interests.length>0;default:return!0}}function h(e){return!!e.vibe&&("custom"!==e.vibe||!!e.customVibe.trim())}a.LS.investment,[...a.LS.standard.options,...a.LS.investment.options.filter(e=>!a.LS.standard.options.some(t=>t.value===e.value))];let x="Designing your product",g=["Exploring designs that match your vibe...","Rendering product images...","Picking the best ones..."],b="Up next: Pick your favorite. Labels and specs can still change later.";function v(e,t){let r=e.trim();return r.length<=t?r:"".concat(r.slice(0,t-1).trimEnd(),"â¦")}function w(e){let t=(0,s.jN)(e.selectedTrendId),r=t?v(t.name,40):v(e.productPrompt,40);return r?['Sketching ideas for "'.concat(r,'"...'),...g]:[...g]}let j="Here is your product!",y="It does not need to be perfect, just close to your vision. The label, name and details stay editable later.",k="I love it, keep going",N="Want a small change? e.g. darker label, add lemon...",_="Edit",C="Back to previous version",I="Editing your product...",S="Blending your two picks",A=["Taking the product you loved...","Borrowing the style you picked...","Rendering the combined design..."],P="Setting up your product",E=["Locking in your product...","Saving your design...","Opening your workspace..."];function T(e){var t,r,n,l,i,o,c,u,m,p,f,h;let x=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"v1",g=(0,a.fp)(x),b=[],w=(null==(t=e.storeChoice)?void 0:t.kind)==="existing"?e.storeChoice:null,j=e.productPrompt.trim();j&&b.push({emoji:"\uD83D\uDCA1",label:'"'.concat(v(j,40),'"')}),w?b.push({emoji:"\uD83C\uDFEA",label:v(w.name,28)}):"own"===e.brandNameChoice&&e.ownBrandName.trim()&&b.push({emoji:"\uD83C\uDFF7ï¸",label:v(e.ownBrandName,28)});let y=null==(r=(0,a.NL)(null!=(o=null==(n=g.goal)?void 0:n.question)?o:null,e))?void 0:r.options.find(t=>t.value===e.goal);(null==y?void 0:y.emoji)&&b.push({emoji:y.emoji,label:null!=(c=y.recapLabel)?c:y.label});let k=null==(l=(0,a.NL)(null!=(u=null==(i=g.budget)?void 0:i.question)?u:null,e))?void 0:l.options.find(t=>t.value===e.budget);(null==k?void 0:k.emoji)&&b.push({emoji:k.emoji,label:null!=(m=k.recapLabel)?m:k.label});let N=(0,s.jN)(e.selectedTrendId);if(N)b.push({emoji:N.emoji,label:v(N.name,28)});else if(e.interests.length>0){let t=null==(p=(0,a.NL)(null!=(h=null==(f=g.interests)?void 0:f.question)?h:null,e))?void 0:p.options.find(t=>t.value===e.interests[0]);(null==t?void 0:t.emoji)&&b.push({emoji:t.emoji,label:t.label})}if(!w&&"custom"===e.vibe&&e.customVibe.trim())b.push({emoji:"âï¸",label:v(e.customVibe,28)});else if(!w&&e.vibe){let t=d.vibe.options.find(t=>t.value===e.vibe);(null==t?void 0:t.emoji)&&b.push({emoji:t.emoji,label:t.label})}return b}let L="dough_guide_state_v1",D=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function M(){try{var e;let t=window.localStorage.getItem(L);if(!t)return null;let r=JSON.parse(t);if(!r||"object"!=typeof r||!r.answers)return null;return{answers:{...l,...r.answers,storeChoice:null!=(e=n.ie.safeParse(r.answers.storeChoice).data)?e:null,productDetails:Array.isArray(r.answers.productDetails)?r.answers.productDetails.slice(-5):[]},finalImageUrl:"string"==typeof r.finalImageUrl?r.finalImageUrl:null,answersRowId:"string"==typeof r.answersRowId&&D.test(r.answersRowId)?r.answersRowId:null,generationPending:!0===r.generationPending}}catch(e){return null}}function R(e){try{window.localStorage.setItem(L,JSON.stringify(e))}catch(e){}}function O(){try{window.localStorage.removeItem(L),Y()}catch(e){}}function F(){return/Mobi|Android|iPhone|iPad/i.test(window.navigator.userAgent)?"mobile":"desktop"}let q="dough_guide_auth_pending";function U(){try{window.localStorage.setItem(q,String(Date.now()))}catch(e){}}function z(){var e;let t=null!=(e=window.localStorage.getItem(q))?e:window.sessionStorage.getItem(q);if(!t)return!1;if("1"===t)return!0;let r=Number(t);return Number.isFinite(r)&&Date.now()-r<864e5}function W(){try{return z()}catch(e){return!1}}function Y(){try{let e=z();return window.localStorage.removeItem(q),window.sessionStorage.removeItem(q),e}catch(e){return!1}}function B(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"v1";for(let r of m(e,t)){if("brand-name"===r)break;
1if(!f(r,e))return!1}return!0}function G(e){return!!e.brandNameChoice&&("own"!==e.brandNameChoice||!!e.ownBrandName.trim())}function V(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"v1";if(!e)return"intro";let r=e.answers;if(!r.goal)return"intro";for(let e of m(r,t)){if("brand-name"===e)break;if(!f(e,r))return e}return"v2"===t?(0,s.HQ)(r).length>0&&!r.selectedTrendId?"recommendations":h(r)?G(r)?"context":"brand-name":"vibe":"brand-name"}},99635:(e,t,r)=>{"use strict";r.d(t,{A:()=>g});var a=r(37876),n=r(91040),s=r(78080),l=r(62822),i=r(67262),o=r(32273),d=r(14232),c=r(99508),u=r(69384),m=r(202),p=r(16247),f=r(22729),h=r(21257);function x(e,t){let r=Math.max(0,Math.round((t-new Date(e).getTime())/1e3));if(r<45)return"just now";let a=Math.round(r/60);if(a<60)return"".concat(a," min ago");let n=Math.round(a/60);return n<24?"".concat(n," h ago"):"".concat(Math.round(n/24)," d ago")}function g(e){let{open:t,onOpenChange:r,currentConversationId:g=null,onOpenConversation:b,onOpenEarlierIdea:v,disabled:w,onNewConversation:j,newConversationDisabled:y}=e,k=(0,m.a)(),[N,_]=(0,d.useState)(null),[C,I]=(0,d.useState)({status:"loading"}),[S,A]=(0,d.useState)({status:"loading"}),[P,E]=(0,d.useState)(null),T=async e=>{E({id:e.conversationId,error:null});try{await b(e),E(null)}catch(t){E({id:e.conversationId,error:n.A.isAxiosError(t)&&!t.response?"Connection issue. Check your internet and try again.":"That conversation could not be reopened."})}},L=async e=>{E({id:e.referenceRequestId,error:null});try{let t=await (0,p.Sh)(e.referenceRequestId,(0,c.rM)());E(null),v(t)}catch(t){E({id:e.referenceRequestId,error:n.A.isAxiosError(t)&&!t.response?"Connection issue. Check your internet and try again.":"That idea could not be opened."})}},D=(0,d.useCallback)(async()=>{I({status:"loading"});try{let{conversations:e}=await (0,f.N2)();I({status:"ready",conversations:e})}catch(e){I({status:"error",message:n.A.isAxiosError(e)&&!e.response?"Connection issue. Check your internet and try again.":"Your earlier conversations could not be loaded."})}},[]),M=(0,d.useCallback)(async()=>{A({status:"loading"});try{let e=await (0,f.nK)();A({status:"ready",ideas:e.ideas})}catch(e){A({status:"error",message:n.A.isAxiosError(e)&&!e.response?"Connection issue. Check your internet and try again.":"Your earlier ideas could not be loaded."})}},[]),R=(0,d.useCallback)(()=>{D(),M()},[D,M]);(0,d.useEffect)(()=>{if(!t)return;_(Date.now()),R();let e=setInterval(()=>_(Date.now()),3e4);return()=>clearInterval(e)},[t,R]);let O="ready"===C.status?C.conversations.filter(e=>e.conversationId!==g):[],F="ready"===S.status?S.ideas:[],q=(null==P?void 0:P.error)===null;return(0,a.jsx)(u.cj,{open:t,onOpenChange:r,children:(0,a.jsxs)(u.h,{side:k?"bottom":"right",className:(0,h.cn)("guide-chat-surface guide-chat-panel z-[83] gap-0 border-(--gc-border)",k?"max-h-[75dvh] rounded-t-2xl":"w-full sm:max-w-md"),overlayClassName:"z-[82]",children:[(0,a.jsxs)(u.Fm,{className:"pb-2",children:[(0,a.jsxs)(u.qp,{className:"flex items-center gap-2 text-base",children:[(0,a.jsx)(s.A,{className:"h-4 w-4"}),"History"]}),(0,a.jsx)(u.Qs,{children:"Pick up a conversation where you left it."})]}),(0,a.jsxs)("div",{className:"flex-1 overflow-y-auto px-4 pb-4",children:[j?(0,a.jsxs)("button",{type:"button",disabled:y,onClick:()=>{r(!1),j()},className:"mb-2 flex w-full cursor-pointer items-center gap-3 rounded-xl border border-(--gc-border) px-2 py-2 text-left transition-colors hover:bg-(--gc-accent-light) disabled:cursor-not-allowed disabled:opacity-50",children:[(0,a.jsx)("span",{className:"grid h-10 w-10 shrink-0 place-items-center rounded-lg bg-(--gc-accent-light) text-(--gc-accent-ink)",children:(0,a.jsx)(l.A,{className:"h-4 w-4"})}),(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsx)("span",{className:"block text-sm font-semibold text-(--gc-ink)",children:"New conversation"}),(0,a.jsx)("span",{className:"block text-xs text-(--gc-muted)",children:"Start again from the beginning."})]})]}):null,(0,a.jsx)("section",{children:"loading"===C.status?(0,a.jsxs)("p",{className:"flex items-center justify-center gap-2 py-6 text-sm text-(--gc-muted)",children:[(0,a.jsx)(i.A,{className:"h-4 w-4 animate-spin"})," Loading..."]}):"error"===C.status?(0,a.jsxs)("div",{className:"flex flex-col items-center gap-2 py-6 text-center",children:[(0,a.jsx)("p",{className:"text-sm text-(--gc-muted)",children:C.message}),(0,a.jsx)("button",{type:"button",onClick:()=>void D(),className:"text-sm font-semibold text-(--gc-accent-edge) hover:underline",children:"Try again"})]}):0===O.length?"loading"===S.status||F.length>0?null:(0,a.jsx)("p",{className:"py-6 text-center text-sm text-(--gc-muted)",children:"Nothing earlier yet."}):(0,a.jsx)("div",{className:"flex flex-col",children:O.map(e=>(0,a.jsxs)("button",{type:"button",disabled:w||q,onClick:()=>void T(e),className:"flex w-full cursor-pointer items-center gap-3 rounded-xl px-2 py-2 text-left transition-colors hover:bg-(--gc-accent-light) disabled:opacity-50",children:[e.imageUrl?(0,a.jsx)("img",{src:e.imageUrl,alt:"",className:"h-10 w-10 shrink-0 rounded-lg object-cover ring-1 ring-(--gc-border)"}):(0,a.jsx)("span",{className:"grid h-10 w-10 shrink-0 place-items-center rounded-lg bg-(--gc-card) text-(--gc-muted) ring-1 ring-(--gc-border)",children:(0,a.jsx)(o.A,{className:"h-4 w-4"})}),(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsx)("span",{className:"block truncate text-sm font-semibold text-(--gc-ink)",children:e.title}),(0,a.jsx)("span",{className:"block text-xs text-(--gc-muted)",children:(null==P?void 0:P.id)===e.conversationId&&null===P.error?"Opening...":"".concat("built"===e.status?"Built. Open the product":"Continue").concat(N?" \xb7 ".concat(x(e.updatedAt,N)):"")}),(null==P?void 0:P.id)===e.conversationId&&P.error?(0,a.jsx)("span",{className:"block text-xs text-destructive",children:P.error}):null]})]},e.conversationId))})}),"error"===S.status?(0,a.jsxs)("div",{className:"flex flex-col items-center gap-2 py-4 text-center",children:[(0,a.jsx)("p",{className:"text-sm text-(--gc-muted)",children:S.message}),(0,a.jsx)("button",{type:"button",onClick:()=>void M(),className:"text-sm font-semibold text-(--gc-accent-edge) hover:underline",children:"Try again"})]}):F.length>0?(0,a.jsxs)("section",{className:"mt-4",children:[(0,a.jsx)("h3",{className:"px-2 text-xs font-semibold tracking-wide text-(--gc-muted) uppercase",children:"Earlier ideas"}),(0,a.jsx)("p",{className:"px-2 pb-1 text-xs text-(--gc-muted)",children:"Designs y
1ou made before this chat. Open one to keep working on it."}),(0,a.jsx)("div",{className:"flex flex-col",children:F.map(e=>(0,a.jsxs)("button",{type:"button",disabled:w||q,onClick:()=>void L(e),className:"flex w-full cursor-pointer items-center gap-3 rounded-xl px-2 py-2 text-left transition-colors hover:bg-(--gc-accent-light) disabled:opacity-50",children:[(0,a.jsx)("img",{src:e.imageUrl,alt:"",className:"h-10 w-10 shrink-0 rounded-lg object-cover ring-1 ring-(--gc-border)"}),(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsx)("span",{className:"block truncate text-sm font-semibold text-(--gc-ink)",children:e.title}),(0,a.jsx)("span",{className:"block text-xs text-(--gc-muted)",children:(null==P?void 0:P.id)===e.referenceRequestId&&null===P.error?"Opening, this takes a few seconds...":"Open".concat(N?" \xb7 ".concat(x(e.createdAt,N)):"")}),(null==P?void 0:P.id)===e.referenceRequestId&&P.error?(0,a.jsx)("span",{className:"block text-xs text-destructive",children:P.error}):null]})]},e.referenceRequestId))})]}):null]})]})})}}},e=>{e.O(0,[4587,1812,7802,8230,559,5930,9712,8988,936,7154,7452,2765,659,6303,7262,2823,5533,8448,4477,545,3589,6473,8442,357,636,6593,8792],()=>e(e.s=16760)),_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.