PageSourceSearch

https://omni-smart.ai/static/js/4770.978665bd.chunk.js

js omni-smart.ai collected 2026-10-05 13:17:48 UTC 20,387 bytes, 2 lines download raw bytes

1"use strict";(globalThis.webpackChunkfrontend=globalThis.webpackChunkfrontend||[]).push([[4770],{4770(e,t,s){s.r(t),s.d(t,{default:()=>B});var l=s(5043),a=s(9364),n=s(6328),i=s(6511),c=s(5258),d=s(8326),r=s(4651),o=s(5087),x=s(1680),m=s(4259),p=s(5505),h=s(1360),u=s(8693),g=s(3782),b=s(9855),j=s(614),v=s(579);const f=["hero","features","grid","cards","cta","content","testimonials","stats","gallery","form","logos","faq"],N=["Home","LayoutDashboard","FileText","Blocks","Layers","Rocket","Target","Users","MessageCircle","Phone","Settings","Info"];function y(e){let{open:t,onClose:s,title:l,children:a}=e;return t?(0,v.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",onClick:s,children:(0,v.jsxs)("div",{className:"bg-white rounded-2xl shadow-2xl w-full max-w-lg mx-4 max-h-[80vh] overflow-y-auto",onClick:e=>e.stopPropagation(),children:[(0,v.jsxs)("div",{className:"flex items-center justify-between p-5 border-b border-[#0A1128]/5",children:[(0,v.jsx)("h2",{className:"font-display font-bold text-lg text-[#0A1128]",children:l}),(0,v.jsx)("button",{onClick:s,className:"p-1 rounded-lg hover:bg-[#0A1128]/5",children:(0,v.jsx)(j.A,{className:"w-4 h-4 text-[#0A1128]/60"})})]}),(0,v.jsx)("div",{className:"p-5",children:a})]})}):null}function w(e){let{label:t,value:s,onChange:l,placeholder:a,rows:n}=e;return(0,v.jsxs)("div",{className:"mb-4",children:[(0,v.jsx)("label",{className:"font-mono-accent text-[10px] text-[#0B1529]/60 mb-1 block",children:t}),n?(0,v.jsx)("textarea",{rows:n,value:null!==s&&void 0!==s?s:"",onChange:e=>l(e.target.value),placeholder:a,className:"w-full px-4 py-3 rounded-xl border border-[#0A1128]/10 text-sm resize-none"}):(0,v.jsx)("input",{value:null!==s&&void 0!==s?s:"",onChange:e=>l(e.target.value),placeholder:a,className:"w-full px-4 py-3 rounded-xl border border-[#0A1128]/10 text-sm"})]})}function A(e){let{value:t,onChange:s}=e;return(0,v.jsx)("button",{onClick:()=>s(!t),className:"relative w-10 h-5 rounded-full transition-colors "+(t?"bg-[#0052FF]":"bg-[#0A1128]/20"),children:(0,v.jsx)("span",{className:"absolute top-0.5 left-0.5 w-4 h-4 rounded-full bg-white shadow transition-transform "+(t?"translate-x-5":"")})})}function C(e){let{page:t,index:s,onEdit:l,onDelete:a,onToggle:n}=e;return(0,v.jsx)(i.sx,{draggableId:t.id,index:s,children:(e,s)=>(0,v.jsxs)("div",{ref:e.innerRef,...e.draggableProps,className:"flex items-center gap-3 p-3 rounded-xl border transition-all "+(s.isDragging?"border-[#0052FF] shadow-lg bg-[#F0F5FF]":"border-[#0A1128]/5 bg-white hover:border-[#0A1128]/20"),children:[(0,v.jsx)("div",{...e.dragHandleProps,className:"text-[#0A1128]/30 hover:text-[#0A1128]/60 cursor-grab active:cursor-grabbing",children:(0,v.jsx)(m.A,{className:"w-4 h-4"})}),(0,v.jsx)("div",{className:"w-8 h-8 rounded-lg bg-[#F0F5FF] flex items-center justify-center flex-shrink-0",children:(0,v.jsx)(x.A,{className:"w-4 h-4 text-[#0052FF]"})}),(0,v.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,v.jsx)("div",{className:"font-display font-bold text-sm text-[#0A1128] truncate",children:t.title||"Untitled"}),(0,v.jsxs)("div",{className:"font-mono-accent text-[10px] text-[#0B1529]/40",children:["/",t.slug]})]}),(0,v.jsxs)("div",{className:"flex items-center gap-1",children:[(0,v.jsx)("button",{onClick:()=>n(t),className:"p-1.5 rounded-lg hover:bg-[#0A1128]/5",title:t.visible?"Visible":"Hidden",children:t.visible?(0,v.jsx)(o.A,{className:"w-3.5 h-3.5 text-[#0A1128]/50"}):(0,v.jsx)(r.A,{className:"w-3.5 h-3.5 text-red-400"})}),(0,v.jsx)("button",{onClick:()=>l(t),className:"p-1.5 rounded-lg hover:bg-[#0A1128]/5",children:(0,v.jsx)(p.A,{className:"w-3.5 h-3.5 text-[#0A1128]/50"})}),(0,v.jsx)("button",{onClick:()=>a(t),className:"p-1.5 rounded-lg hover:bg-red-50",children:(0,v.jsx)(b.A,{className:"w-3.5 h-3.5 text-red-400"})})]})]})})}function F(e){let{section:t,index:s,onEdit:l,onDelete:a,onToggle:n}=e;return(0,v.jsx)(i.sx,{draggableId:t.id,index:s,children:(e,s)=>(0,v.jsxs)("div",{ref:e.innerRef,...e.draggableProps,className:"flex items-center gap-3 p-3 rounded-xl border transition-all "+(s.isDragging?"border-[#0052FF] shadow-lg bg-[#F0F5FF]":"border-[#0A1128]/5 bg-white hover:border-[#0A1128]/20"),children:[(0,v.jsx)("div",{...e.dragHandleProps,className:"text-[#0A1128]/30 hover:text-[#0A1128]/60 cursor-grab active:cursor-grabbing",children:(0,v.jsx)(m.A,{className:"w-4 h-4"})}),(0,v.jsx)("div",{className:"w-8 h-8 rounded-lg bg-[#F0F5FF] flex items-center justify-center flex-shrink-0",children:(0,v.jsx)(c.A,{className:"w-4 h-4 text-emerald-500"})}),(0,v.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,v.jsxs)("div",{className:"flex items-center gap-2",children:[(0,v.jsx)("span",{className:"font-mono-accent text-[9px] px-1.5 py-0.5 rounded bg-[#0A1128]/5 text-[#0A1128]/60 uppercase",children:t.type}),(0,v.jsx)("span",{className:"font-display font-bold text-sm text-[#0A1128] truncate",children:t.title||"Untitled"})]}),t.subtitle&&(0,v.jsx)("div",{className:"font-mono-accent text-[10px] text-[#0B1529]/40 truncate mt-0.5",children:t.subtitle})]}),(0,v.jsxs)("div",{className:"flex items-center gap-1",children:[(0,v.jsx)("button",{onClick:()=>n(t),className:"p-1.5 rounded-lg hover:bg-[#0A1128]/5",title:t.visible?"Visible":"Hidden",children:t.visible?(0,v.jsx)(o.A,{className:"w-3.5 h-3.5 text-[#0A1128]/50"}):(0,v.jsx)(r.A,{className:"w-3.5 h-3.5 text-red-400"})}),(0,v.jsx)("button",{onClick:()=>l(t),className:"p-1.5 rounded-lg hover:bg-[#0A1128]/5",children:(0,v.jsx)(p.A,{className:"w-3.5 h-3.5 text-[#0A1128]/50"})}),(0,v.jsx)("button",{onClick:()=>a(t),className:"p-1.5 rounded-lg hover:bg-red-50",children:(0,v.jsx)(b.A,{className:"w-3.5 h-3.5 text-red-400"})})]})]})})}
1function k(e){let{content:t,onChange:s}=e;const l=Object.keys(t||{});return(0,v.jsxs)("div",{children:[(0,v.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,v.jsx)("label",{className:"font-mono-accent text-[10px] text-[#0B1529]/60",children:"Section Content (JSON)"}),(0,v.jsx)("button",{onClick:()=>{const e=prompt("Field name:");e&&s({...t||{},[e]:""})},className:"text-[9px] font-mono-accent text-[#0052FF] hover:underline",children:"+ Add field"})]}),(0,v.jsx)("div",{className:"space-y-2 max-h-48 overflow-y-auto",children:l.map(e=>{var l;return(0,v.jsxs)("div",{className:"flex gap-2 items-start",children:[(0,v.jsx)("span",{className:"font-mono-accent text-[10px] text-[#0B1529]/50 w-20 pt-2 flex-shrink-0",children:e}),(0,v.jsx)("textarea",{rows:2,value:null!==(l=null===t||void 0===t?void 0:t[e])&&void 0!==l?l:"",onChange:l=>s({...t,[e]:l.target.value}),className:"flex-1 px-3 py-1.5 rounded-lg border border-[#0A1128]/10 text-xs resize-none font-mono-accent"}),(0,v.jsx)("button",{onClick:()=>{const{[e]:l,...a}=t||{};s(a)},className:"p-1.5 text-red-400 hover:text-red-600",children:(0,v.jsx)(j.A,{className:"w-3 h-3"})})]},e)})})]})}function S(e){let{page:t}=e;if(!t)return null;const s=(t.sections||[]).filter(e=>e.visible);return(0,v.jsxs)("div",{className:"space-y-6",children:[(0,v.jsxs)("div",{className:"border-b border-[#0A1128]/10 pb-4",children:[(0,v.jsxs)("div",{className:"font-mono-accent text-[10px] text-[#0B1529]/40",children:["/",t.slug]}),(0,v.jsx)("h2",{className:"font-display font-black text-2xl text-[#0A1128]",children:t.title}),t.description&&(0,v.jsx)("p",{className:"text-sm text-[#0B1529]/50 mt-1",children:t.description}),(0,v.jsx)("span",{className:"inline-flex items-center gap-1 mt-2 text-[10px] font-mono-accent px-2 py-0.5 rounded "+(t.visible?"bg-emerald-50 text-emerald-600":"bg-red-50 text-red-400"),children:t.visible?"Published (live)":"Hidden (draft)"})]}),0===s.length&&(0,v.jsx)("div",{className:"text-sm text-[#0B1529]/40 text-center py-8",children:"No visible sections to preview."}),s.map(e=>(0,v.jsxs)("div",{className:"rounded-xl border border-[#0A1128]/5 p-4",children:[(0,v.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,v.jsx)("span",{className:"font-mono-accent text-[9px] px-1.5 py-0.5 rounded bg-[#0A1128]/5 text-[#0A1128]/60 uppercase",children:e.type}),e.title&&(0,v.jsx)("span",{className:"font-display font-bold text-sm text-[#0A1128]",children:e.title})]}),e.subtitle&&(0,v.jsx)("div",{className:"text-xs text-[#0B1529]/50 mb-2",children:e.subt
1itle}),(0,v.jsxs)("div",{className:"space-y-1",children:[Object.entries(e.content||{}).map(e=>{let[t,s]=e;return(0,v.jsxs)("div",{className:"text-xs",children:[(0,v.jsxs)("span",{className:"font-mono-accent text-[10px] text-[#0B1529]/40 mr-2",children:[t,":"]}),(0,v.jsx)("span",{className:"text-[#0A1128]/80 whitespace-pre-wrap",children:String(s)})]},t)}),0===Object.keys(e.content||{}).length&&(0,v.jsx)("div",{className:"text-xs text-[#0B1529]/30",children:"No content fields."})]})]},e.id))]})}function B(){const[e,t]=(0,l.useState)([]),[s,r]=(0,l.useState)(null),[m,p]=(0,l.useState)(!1),[b,j]=(0,l.useState)(!0),[B,R]=(0,l.useState)(null),[P,T]=(0,l.useState)(!1),[D,$]=(0,l.useState)(null),[E,I]=(0,l.useState)({slug:"",title:"",description:"",icon:"FileText"}),[H,L]=(0,l.useState)(!1),[z,O]=(0,l.useState)(null),[U,V]=(0,l.useState)({type:"content",title:"",subtitle:"",content:{}}),[J,q]=(0,l.useState)(!1),M=(0,l.useCallback)(async()=>{j(!0),R(null);try{const{data:e}=await a.Ay.get("/admin/pages");t(e.pages||[])}catch(l){var e,s;const t=(null===l||void 0===l||null===(e=l.response)||void 0===e||null===(s=e.data)||void 0===s?void 0:s.detail)||(null===l||void 0===l?void 0:l.message)||"Failed to load pages";R(t),n.oR.error(t)}finally{j(!1)}},[]);(0,l.useEffect)(()=>{M()},[M]),(0,l.useEffect)(()=>{s&&!e.find(e=>e.id===s.id)&&r(null)},[e,s]);const Y=(0,l.useCallback)(async()=>{if(!s)return;const{data:e}=await a.Ay.get(`/admin/pages/${s.id}`);r(e.page),t(t=>t.map(t=>t.id===e.page.id?e.page:t))},[s]),G=e=>{e?($(e),I({slug:e.slug,title:e.title,description:e.description||"",icon:e.icon||"FileText"})):($(null),I({slug:"",title:"",description:"",icon:"FileText"})),T(!0)},K=async e=>{if(window.confirm(`Delete page "${e.title}"? This cannot be undone.`))try{await a.Ay.delete(`/admin/pages/${e.id}`),n.oR.success("Page deleted"),await M()}catch(t){n.oR.error("Failed to delete")}},Q=async e=>{await a.Ay.put(`/admin/pages/${e.id}`,{visible:!e.visible}),await M()},W=e=>{e?(O(e),V({type:e.type,title:e.title||"",subtitle:e.subtitle||"",content:e.content||{}})):(O(null),V({type:"content",title:"",subtitle:"",content:{}})),L(!0)},X=async e=>{if(s&&window.confirm(`Delete section "${e.title||e.type}"?`))try{await a.Ay.delete(`/admin/pages/${s.id}/sections/${e.id}`),n.oR.success("Section deleted"),await Y()}catch(t){n.oR.error("Failed to delete")}},Z=async e=>{await a.Ay.put(`/admin/pages/${s.id}/sections/${e.id}`,{visible:!e.visible}),await Y()};return(0,v.jsxs)("div",{children:[(0,v.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,v.jsxs)("div",{children:[(0,v.jsx)("h1",{className:"font-display font-black text-2xl text-[#0A1128]",children:"Page Manager"}),(0,v.jsx)("p",{className:"text-sm text-[#0B1529]/50 mt-1",children:"Create, reorder, and manage pages and their sections"})]}),(0,v.jsxs)("button",{onClick:()=>G(null),className:"btn-primary !py-2.5 !px-5 flex items-center gap-2",children:[(0,v.jsx)(h.A,{className:"w-4 h-4"})," New Page"]})]}),(0,v.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-5 gap-6",children:[(0,v.jsx)("div",{className:"lg:col-span-2",children:(0,v.jsxs)("div",{className:"bg-white rounded-2xl border border-[#0A1128]/5 p-4",children:[(0,v.jsxs)("div",{className:"font-display font-bold text-sm text-[#0A1128] mb-3 flex items-center gap-2",children:[(0,v.jsx)(x.A,{className:"w-4 h-4 text-[#0052FF]"})," Pages ",(0,v.jsxs)("span",{className:"font-mono-accent text-[10px] text-[#0B1529]/40",children:["(",e.length,")"]})]}),(0,v.jsx)(i.JY,{onDragEnd:async s=>{if(!s.destination)return;const l=Array.from(e),[i]=l.splice(s.source.index,1);l.splice(s.destination.index,0,i),t(l);try{await a.Ay.post("/admin/pages/reorder",{ids:l.map(e=>e.id)})}catch{n.oR.error("Reorder failed")}},children:(0,v.jsx)(i.gL,{droppableId:"pages",children:t=>(0,v.jsxs)("div",{ref:t.innerRef,...t.droppableProps,className:"space-y-2 min-h-[200px]",children:[e.map((e,t)=>(0,v.jsx)("div",{onClick:()=>r(e),className:"cursor-pointer rounded-xl transition-all "+((null===s||void 0===s?void 0:s.id)===e.id?"ring-2 ring-[#0052FF]":""),children:(0,v.jsx)(C,{page:e,index:t,onEdit:e=>{var t;null===(t=e.stopPropagation)||void 0===t||t.call(e),G(e)},onDelete:K,onToggle:Q})},e.id)),t.placeholder,b&&(0,v.jsx)("div",{className:"text-center py-10 text-[#0B1529]/30 text-sm",children:"Loading pages\u2026"}),!b&&B&&(0,v.jsxs)("div",{className:"text-center py-10 text-red-400 text-sm px-4",children:["Couldn't load pages: ",B,(0,v.jsx)("button",{onClick:M,className:"block mx-auto mt-2 text-[#0052FF] hover:underline text-xs",children:"Retry"})]}),!b&&!B&&0===e.length&&(0,v.jsx)("div",{className:"text-center py-10 text-[#0B1529]/30 text-sm",children:"No pages yet"})]})})})]})}),(0,v.jsxs)("div",{className:"lg:col-span-3",children:[s?(0,v.jsxs)("div",{className:"bg-white rounded-2xl border border-[#0A1128]/5 p-4",children:[(0,v.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,v.jsxs)("div",{className:"font-display font-bold text-sm text-[#0A1128] flex items-center gap-2",children:[(0,v.jsx)(c.A,{className:"w-4 h-4 text-emerald-500"})," Sections for ",(0,v.jsx)("span",{className:"text-[#0052FF]",children:s.title}),(0,v.jsxs)("span",{className:"font-mono-accent text-[10px] text-[#0B1529]/40",children:["(",(s.sections||[]).length,")"]})]}),(0,v.jsxs)("button",{onClick:()=>W(null),className:"btn-outline text-xs !py-1.5 !px-4 flex items-center gap-1.5",children:[(0,v.jsx)(h.A,{className:"w-3 h-3"})," Add Section"]}),(0,v.jsxs)("button",{onClick:()=>q(!0),className:"btn-outline text-xs !py-1.5 !px-4 flex items-center gap-1.5",children:[(0,v.jsx)(o.A,{className:"w-3 h-3"})," Preview"]})]}),(0,v.jsx)(i.JY,{onDragEnd:async e=>{if(!e.destination||!s)return;const t=[...s.sections||[]],[l]=t.splice(e.source.index,1);t.splice(e.destination.index,0,l),r({...s,sections:t});try{await a.Ay.post(`/admin/pages/${s.id}/sections/reorder`,{ids:t.map(e=>e.id)})}catch{n.oR.error("Reorder failed")}},children:(0,v.jsx)(i.gL,{droppableId:"sections",children:e=>(0,v.jsxs)("div",{ref:e.innerRef,...e.droppableProps,className:"space-y-2 min-h-[200px]",children:[(s.sections||[]).map((e,t)=>(0,v.jsx)(F,{section:e,index:t,onEdit:W,onDelete:X,onToggle:Z},e.id)),e.placeholder,0===(s.sections||[]).length&&(0,v.jsx)("div",{className:"text-center py-10 text-[#0B1529]/30 text-sm",children:'No sections on this page yet. Click "Add Section".'})]})})})]}):(0,v.jsx)("div",{className:"bg-white rounded-2xl border border-[#0A1128]/5 p-4 flex items-center justify-center min-h-[300px]",children:(0,v.jsxs)("div",{className:"text-center",children:[(0,v.jsx)(d.A,{className:"w-8 h-8 text-[#0B1529]/20 mx-auto mb-3"}),(0,v.jsx)("div",{className:"text-sm text-[#0B1529]/40",children:"Select a page to manage its sections"})]})}),s&&(0,v.jsxs)("div",{className:"bg-white rounded-2xl border border-[#0A1128]/5 p-4 mt
1-4",children:[(0,v.jsxs)("div",{className:"font-display font-bold text-sm text-[#0A1128] mb-3 flex items-center gap-2",children:[(0,v.jsx)(g.A,{className:"w-4 h-4 text-[#0A1128]/50"})," Page Details"]}),(0,v.jsxs)("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[(0,v.jsxs)("div",{children:[(0,v.jsx)("span",{className:"font-mono-accent text-[10px] text-[#0B1529]/60",children:"Slug"}),(0,v.jsxs)("div",{className:"font-mono-accent text-xs text-[#0A1128] mt-0.5",children:["/",s.slug]})]}),(0,v.jsxs)("div",{children:[(0,v.jsx)("span",{className:"font-mono-accent text-[10px] text-[#0B1529]/60",children:"Visibility"}),(0,v.jsxs)("div",{className:"flex items-center gap-2 mt-0.5",children:[(0,v.jsx)(A,{value:s.visible,onChange:()=>Q(s)}),(0,v.jsx)("span",{className:"text-xs text-[#0B1529]/60",children:s.visible?"Published":"Hidden"})]})]}),(0,v.jsxs)("div",{className:"col-span-2",children:[(0,v.jsx)("span",{className:"font-mono-accent text-[10px] text-[#0B1529]/60",children:"Description"}),(0,v.jsx)("div",{className:"text-xs text-[#0A1128]/70 mt-0.5",children:s.description||"\u2014"})]}),(0,v.jsxs)("div",{className:"col-span-2",children:[(0,v.jsx)("span",{className:"font-mono-accent text-[10px] text-[#0B1529]/60",children:"Page ID"}),(0,v.jsx)("div",{className:"font-mono-accent text-[10px] text-[#0B1529]/40 mt-0.5",children:s.id})]})]})]})]})]}),(0,v.jsxs)(y,{open:P,onClose:()=>T(!1),title:D?"Edit Page":"New Page",children:[(0,v.jsx)(w,{label:"Slug",value:E.slug,onChange:e=>I({...E,slug:e.toLowerCase().replace(/[^a-z0-9-]/g,"-")}),placeholder:"e.g. about-us"}),(0,v.jsx)(w,{label:"Title",value:E.title,onChange:e=>I({...E,title:e}),placeholder:"e.g. About Us"}),(0,v.jsx)(w,{label:"Description",value:E.description,onChange:e=>I({...E,description:e}),placeholder:"Brief description",rows:2}),(0,v.jsxs)("div",{className:"mb-4",children:[(0,v.jsx)("label",{className:"font-mono-accent text-[10px] text-[#0B1529]/60 mb-1 block",children:"Icon"}),(0,v.jsx)("select",{value:E.icon,onChange:e=>I({...E,icon:e.target.value}),className:"w-full px-4 py-3 rounded-xl border border-[#0A1128]/10 text-sm",children:N.map(e=>(0,v.jsx)("option",{value:e,children:e},e))})]}),(0,v.jsxs)("div",{className:"flex gap-3 justify-end pt-2",children:[(0,v.jsx)("button",{onClick:()=>
1T(!1),className:"btn-outline !py-2.5 !px-6",children:"Cancel"}),(0,v.jsxs)("button",{onClick:async()=>{if(E.slug&&E.title){p(!0);try{D?(await a.Ay.put(`/admin/pages/${D.id}`,E),n.oR.success("Page updated")):(await a.Ay.post("/admin/pages",E),n.oR.success("Page created")),T(!1),await M()}catch(s){var e,t;n.oR.error((null===(e=s.response)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.detail)||"Failed")}finally{p(!1)}}else n.oR.error("Slug and title required")},disabled:m,className:"btn-primary !py-2.5 !px-6 flex items-center gap-2",children:[(0,v.jsx)(u.A,{className:"w-4 h-4"})," ",m?"Saving...":"Save"]})]})]}),(0,v.jsxs)(y,{open:H,onClose:()=>L(!1),title:z?"Edit Section":"Add Section",children:[(0,v.jsxs)("div",{className:"mb-4",children:[(0,v.jsx)("label",{className:"font-mono-accent text-[10px] text-[#0B1529]/60 mb-1 block",children:"Section Type"}),(0,v.jsx)("div",{className:"flex flex-wrap gap-1.5",children:f.map(e=>(0,v.jsx)("button",{onClick:()=>V({...U,type:e}),className:"text-[10px] font-mono-accent px-2 py-1 rounded-lg border transition-all "+(U.type===e?"border-[#0052FF] bg-[#F0F5FF] text-[#0052FF]":"border-[#0A1128]/10 text-[#0A1128]/50 hover:border-[#0A1128]/30"),children:e},e))})]}),(0,v.jsx)(w,{label:"Title",value:U.title,onChange:e=>V({...U,title:e}),placeholder:"Section heading"}),(0,v.jsx)(w,{label:"Subtitle",value:U.subtitle,onChange:e=>V({...U,subtitle:e}),placeholder:"Supporting text",rows:2}),(0,v.jsx)(k,{content:U.content,onChange:e=>V({...U,content:e})}),(0,v.jsxs)("div",{className:"flex gap-3 justify-end pt-4",children:[(0,v.jsx)("button",{onClick:()=>
1L(!1),className:"btn-outline !py-2.5 !px-6",children:"Cancel"}),(0,v.jsxs)("button",{onClick:async()=>{if(s){p(!0);try{z?(await a.Ay.put(`/admin/pages/${s.id}/sections/${z.id}`,U),n.oR.success("Section updated")):(await a.Ay.post(`/admin/pages/${s.id}/sections`,U),n.oR.success("Section added")),L(!1),await Y()}catch(l){var e,t;n.oR.error((null===(e=l.response)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.detail)||"Failed")}finally{p(!1)}}else n.oR.error("Select a page first")},disabled:m,className:"btn-primary !py-2.5 !px-6 flex items-center gap-2",children:[(0,v.jsx)(u.A,{className:"w-4 h-4"})," ",m?"Saving...":"Save"]})]})]}),(0,v.jsxs)(y,{open:J,onClose:()=>q(!1),title:`Preview \u2014 ${(null===s||void 0===s?void 0:s.title)||""}`,children:[(0,v.jsx)("div",{className:"max-h-[60vh] overflow-y-auto",children:(0,v.jsx)(S,{page:s})}),(0,v.jsxs)("div",{className:"flex items-center justify-between pt-4 mt-2 border-t border-[#0A1128]/5",children:[(0,v.jsx)("span",{className:"text-[10px] font-mono-accent text-[#0B1529]/40",children:null!==s&&void 0!==s&&s.visible?"This page is LIVE. Toggle visibility to hold as draft.":"This page is a DRAFT (hidden from site)."}),(0,v.jsx)("button",{onClick:()=>
1q(!1),className:"btn-outline !py-2 !px-5 text-xs",children:"Close"})]})]})]})}}}]);
2//# sourceMappingURL=4770.978665bd.chunk.js.map

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.