1import{j as t}from"./client-BDJMow-F.js";import{r as d}from"./tabler-icons-development-DI2L2NPt.js";import{B as c}from"./bcm-Ca0CeI2L.js";import{u as x,m as f,D as u,O as g}from"./bcm-CD_Dzdh2.js";import"./_FullInternals-CIQpAQ79.js";import"./ReactKonvaCore-CeM6JKnF.js";import"./bcm-DQgLIQ8a.js";import"./createLucideIcon-CBKpTRs4.js";import"./bcm-BeaF3O-g.js";import"./island-loader-BUXT1hHI.js";import"./browser-CeceZ__e.js";import"./x-EZi2ne8V.js";import"./trash-2-BJRHHE8c.js";import"./bcm-DJgeTDuW.js";import"./rotate-ccw-CMOsTBTs.js";import"./quote-hS1nxYjs.js";import"./file-text-Ce6qA2oi.js";import"./shopping-cart-CjBOAKXr.js";import"./credit-card-CdVaB3NU.js";import"./zap-C5UpIOzI.js";import"./phone-CVOy7GaV.js";import"./upload-CzW_wOUd.js";import"./shapes-Bg_B1OAT.js";import"./check-BPArOp9j.js";import"./circle-question-mark-Do9-8d7H.js";import"./circle-alert-xn4NmiVy.js";import"./chevron-down-CeIlD8WT.js";import"./chevron-right-DsGSz8qe.js";import"./arrow-left-DsDbIGGG.js";import"./arrow-right-BTIAVbz8.js";import"./loader-circle-DOm-wbBL.js";import"./_commonjs-dynamic-modules-TDtrdbi3.js";import"./bcm-DUM2Nbkl.js";import"./bcm-CbczZFqC.js";import"./makerDraft-gfWUxcfP.js";import"./bcm-BabvgCed.js";import"./truck-C91zXwUi.js";const b=()=>typeof window>"u"?"landscape":new URLSearchParams(window.location.search).get("orientation")==="portrait"?"portrait":"landscape",et=({templateData:e,templateExternalId:o})=>{const r=d.useRef(null),{currentTemplateData:s,resolvedExternalId:a,mode:n,loadingTemplateId:i,fetchError:l,clearFetchError:m,selectTemplate:p}=x({initialTemplateData:e??f(b()),initialExternalId:e&&o?o:void 0});return t.jsxs("div",{children:[t.jsx(c,{ref:r,initialMode:n,accent:"purple",layout:"studio",templateData:s,templateExternalId:a,loadingTemplateId:i,isTemplateLoading:i!==null,onTemplateSelect:p}),t.jsxs("div",{className:"hidden md:flex justify-center items-center gap-4 mt-8",children:[t.jsx(u,{makerRef:r,templateExternalId:a,className:"",buttonClassName:"jb-btn btn-black w-72"}),t.jsx(g,{makerRef:r,templateExternalId:a,hasDesign:!0,className:""})]}),l&&t.jsx("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center",style:{background:"rgba(0, 0, 0, 0.5)",backdropFilter:"blur(4px)"},children:t.jsxs("div",{className:"bg-white w-[90%] max-w-[400px] p-8 flex flex-col gap-4 text-center",style:{borderRadius:"24px",boxShadow:"0 25px 50px -12px rgba(0, 0, 0, 0.25)"},children:[t.jsx("h3",{className:"text-lg font-bold text-gray-900 font-dm-sans",children:"Unable to load template"}),t.jsx("p",{className:"text-sm text-gray-500 leading-relaxed",children:"Something went wrong. Please try again or pick a different template."}),t.jsxs("div",{className:"flex gap-3 mt-2",children:[t.jsx("a",{href:"/business-card-maker",className:"flex-1 py-3 px-4 bg-gray-100 hover:bg-gray-200 text-gray-700 font-bold text-sm font-dm-sans rounded-xl transition-colors text-center no-underline",children:"Back to templates"}),t.jsx("button",{onClick:m,className:"flex-1 py-3 px-4 bg-[#8b5cf6] hover:bg-[#7c3aed] text-white font-bold text-sm font-dm-sans rounded-xl transition-colors",children:"OK"})]})]})})]})};export{et as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.