1import{F as v,dA as w,dz as N,r,c as C,j as t,dC as A,S as d,e9 as m,N as S,x as h,e8 as T}from"./index-Dp6uzjnE.js";import{A as E}from"./arionMarketingShared-L_eE-bBc.js";import{c as M,C as L,d as _,T as P,a as O}from"./ArionMarketingTemplateGallery-B0IH4ETq.js";const B=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],G=v("palette",B);function I(){const{orgId:i}=w(),x=N(),[s,u]=r.useState([]),[y,p]=r.useState(!0),[f,g]=r.useState(null),[l,b]=r.useState("all"),[o,j]=r.useState("");r.useEffect(()=>{document.title="Arion â Email templates â Medarion"},[]),r.useEffect(()=>{i&&(p(!0),C(`/api/v1/crm/marketing/templates?org_profile_id=${i}`).then(e=>u(e.results||[])).catch(()=>u([])).finally(()=>p(!1)))},[i]);const k=s.filter(e=>e.is_system).length,n=r.useMemo(()=>{const e=o.trim().toLowerCase();return s.filter(a=>l!=="all"&&a.category!==l?!1:e?[a.name,a.description,a.category,a.subject_line,...a.tags||[]].filter(Boolean).join(" ").toLowerCase().includes(e):!0)},[s,l,o]),c=r.useMemo(()=>{const e={all:s.length};for(const a of s)e[a.category]=(e[a.category]||0)+1;return e},[s]);return t.jsxs(A,{title:"Template gallery",lead:"Professional, mobile-ready email designs â curated by Arion for healthcare, finance, and B2B teams. Preview any template, then launch a campaign in one click.",badge:"Templates",icon:m,loading:y,stats:[{icon:m,label:"Gallery",value:s.length,color:d.indigo},{icon:S,label:"Curated pro",value:k,color:d.violet},{icon:G,label:"Categories",value:Object.keys(c).length-1,color:d.emerald}],children:[t.jsxs("div",{className:"space-y-5",children:[t.jsx(E,{}),t.jsx("div",{className:"rounded-2xl border border-border bg-gradient-to-br from-[#fffefa] via-white to-violet-50/40 p-5 sm:p-6 shadow-sm",children:t.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-center lg:justify-between gap-4",children:[t.jsxs("div",{children:[t.jsx("p",{className:"text-[11px] font-bold uppercase tracking-widest text-violet-600 mb-1",children:"Mailchimp-grade designs"}),t.jsx("h2",{className:"text-lg font-bold text-ink-950",children:"Every template is responsive, tracked, and personalization-ready"}),t.jsxs("p",{className:"mt-1 text-sm text-ink-500 max-w-xl",children:["Built with table-based layouts tested across Gmail, Outlook, and Apple Mail. Merge tags like"," ",t.jsx("code",{className:"rounded bg-surface-muted px-1 py-0.5 text-[11px]",children:"{{first_name}}"})," fill automatically from your audiences."]})]}),t.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 shrink-0",children:[t.jsxs(h,{to:x.marketingEditor,className:"inline-flex items-center justify-center gap-2 rounded-xl border border-primary bg-white px-5 py-2.5 text-sm font-semibold text-primary shadow-sm hover:bg-primary/5 transition",children:[t.jsx(T,{className:"h-4 w-4"}),"Create email"]}),t.jsx(h,{to:`${x.base}/marketing/campaigns`,className:"inline-flex items-center justify-center rounded-xl bg-primary px-5 py-2.5 text-sm font-semibold text-white shadow-sm hover:bg-primary/90 transition",children:"Start a campaign"})]})]})}),t.jsx(M,{value:o,onChange:j,count:n.length}),t.jsx("div",{className:"flex flex-wrap gap-2",children:L.filter(e=>e==="all"||c[e]).map(e=>t.jsxs("button",{type:"button",onClick:()=>b(e),className:`rounded-full px-3.5 py-1.5 text-xs font-semibold transition ${l===e?"bg-ink-950 text-white shadow-sm":"bg-white text-ink-600 ring-1 ring-border hover:bg-surface-muted"}`,children:[_[e]||e,t.jsx("span",{className:`ml-1.5 ${l===e?"text-white/70":"text-ink-400"}`,children:c[e]||0})]},e))}),n.length===0?t.jsxs("div",{className:"rounded-2xl border border-dashed border-border bg-surface-muted/20 py-16 text-center",children:[t.jsx(m,{className:"mx-auto h-8 w-8 text-ink-300 mb-3"}),t.jsx("p",{className:"text-sm font-medium text-ink-700",children:"No templates match your search"}),t.jsx("p",{className:"text-xs text-ink-400 mt-1",children:"Try a different category or clear the search."})]}):t.jsx("div",{className:"grid sm:grid-cols-2 xl:grid-cols-3 gap-5",children:n.map(e=>t.jsx(P,{template:e,onPreview:()=>g(e)},String(e.id)))})]}),f&&t.jsx(O,{template:f,onClose:()=>g(null)})]})}export{I as ArionMarketingTemplatesPage};
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.