@socialgen_user/socialgen 2.3.7 → 2.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_nuxt/{1ESij7sf.js → B78a3Sxl.js} +1 -1
  3. package/.output/public/_nuxt/{8t3Wih-_.js → BycW_AbN.js} +2 -2
  4. package/.output/public/_nuxt/{DO1pBuIJ.js → C3AzmEfZ.js} +1 -1
  5. package/.output/public/_nuxt/{wZeFhB0j.js → CjD98tqT.js} +1 -1
  6. package/.output/public/_nuxt/{CpvOZWox.js → D8-z3n9k.js} +1 -1
  7. package/.output/public/_nuxt/DgtyvE5j.js +110 -0
  8. package/.output/public/_nuxt/{DR2NdyVN.js → DlkI5gBO.js} +3 -3
  9. package/.output/public/_nuxt/builds/latest.json +1 -1
  10. package/.output/public/_nuxt/builds/meta/3bc20a90-1ba1-4732-9b91-8461723358ec.json +1 -0
  11. package/.output/public/_nuxt/pages.BNNMR0bP.css +1 -0
  12. package/.output/server/chunks/_/content.mjs +2 -12
  13. package/.output/server/chunks/_/content.mjs.map +1 -1
  14. package/.output/server/chunks/_/nitro.mjs +79 -79
  15. package/.output/server/chunks/build/LivePreview-styles.BbGT7KVf.mjs +8 -0
  16. package/.output/server/chunks/build/LivePreview-styles.BbGT7KVf.mjs.map +1 -0
  17. package/.output/server/chunks/build/{TableCard-0mU9UOj0.mjs → TableCard-BbsnLJbe.mjs} +6 -2
  18. package/.output/server/chunks/build/{TableCard-0mU9UOj0.mjs.map → TableCard-BbsnLJbe.mjs.map} +1 -1
  19. package/.output/server/chunks/build/{_mode_-CU43fOkL.mjs → _mode_-VQfmy6-6.mjs} +2 -2
  20. package/.output/server/chunks/build/{_mode_-CU43fOkL.mjs.map → _mode_-VQfmy6-6.mjs.map} +1 -1
  21. package/.output/server/chunks/build/client.precomputed.mjs +1 -1
  22. package/.output/server/chunks/build/entry-styles.kVRyZFAc.mjs +8 -0
  23. package/.output/server/chunks/build/entry-styles.kVRyZFAc.mjs.map +1 -0
  24. package/.output/server/chunks/build/index-styles-1.mjs-CBmp9qkk.mjs +4 -0
  25. package/.output/server/chunks/build/index-styles-1.mjs-CBmp9qkk.mjs.map +1 -0
  26. package/.output/server/chunks/build/index-styles.B8HyMUMp.mjs +11 -0
  27. package/.output/server/chunks/build/index-styles.B8HyMUMp.mjs.map +1 -0
  28. package/.output/server/chunks/build/{pages-DAxeAK3-.mjs → pages-BZo1uEaJ.mjs} +245 -158
  29. package/.output/server/chunks/build/pages-BZo1uEaJ.mjs.map +1 -0
  30. package/.output/server/chunks/build/server.mjs +2 -2
  31. package/.output/server/chunks/build/styles.mjs +5 -4
  32. package/.output/server/chunks/build/styles.mjs.map +1 -1
  33. package/.output/server/package.json +1 -1
  34. package/data/history.json +11 -6
  35. package/data/history_generations.json +132 -0
  36. package/data/last_session.json +4 -2
  37. package/data/templates.json +63 -0
  38. package/package.json +1 -1
  39. package/.output/public/_nuxt/JDUjn-YJ.js +0 -91
  40. package/.output/public/_nuxt/builds/meta/dd531369-b462-4ab9-9c49-be9d1a58097d.json +0 -1
  41. package/.output/public/_nuxt/pages.Df3hoeGN.css +0 -1
  42. package/.output/server/chunks/build/entry-styles.BcjSvkjT.mjs +0 -8
  43. package/.output/server/chunks/build/entry-styles.BcjSvkjT.mjs.map +0 -1
  44. package/.output/server/chunks/build/index-styles.CQioNwpv.mjs +0 -8
  45. package/.output/server/chunks/build/index-styles.CQioNwpv.mjs.map +0 -1
  46. package/.output/server/chunks/build/pages-DAxeAK3-.mjs.map +0 -1
@@ -0,0 +1,110 @@
1
+ import{h as sa,d as fa,i as S,M as ke,o as ma,A as p,B as m,l as o,C as t,E as k,G as z,D as x,N as I,O as ce,P as Oe,Q as st,R as Ot,S as xe,T as he,U as Ne,V as mt,W as j,X as Ee,Y as vt,m as re,c as ps,Z as Ia,_ as fs}from"./BycW_AbN.js";import{_ as ms}from"./DlkI5gBO.js";async function bt(n){if(!n)return!1;if(typeof window<"u"&&window.isSecureContext&&navigator?.clipboard?.writeText)try{return await navigator.clipboard.writeText(n),!0}catch(e){console.warn("[SocialGen Clipboard] navigator.clipboard.writeText failed, falling back to execCommand:",e)}if(typeof document<"u")try{const e=document.createElement("textarea");if(e.value=n,e.style.position="fixed",e.style.left="-9999px",e.style.top=(window.pageYOffset||document.documentElement.scrollTop||0)+"px",e.style.width="2em",e.style.height="2em",e.style.padding="0",e.style.border="none",e.style.outline="none",e.style.boxShadow="none",e.style.background="transparent",e.style.fontSize="16px",document.body.appendChild(e),typeof navigator<"u"&&/ipad|iphone|ipod/i.test(navigator.userAgent)){e.contentEditable="true",e.readOnly=!1;const l=document.createRange();l.selectNodeContents(e);const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(l)),e.setSelectionRange(0,999999)}else e.focus(),e.select();let i=!1;try{i=document.execCommand("copy")}catch(l){console.warn("[SocialGen Clipboard] execCommand call threw error:",l)}if(document.body.removeChild(e),i)return!0}catch(e){console.warn("[SocialGen Clipboard] DOM fallback failed:",e)}return!1}const xs=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var Nt={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};const hs=({size:n,strokeWidth:e=2,absoluteStrokeWidth:s,color:i,iconNode:l,name:d,class:f,...c},{slots:C})=>sa("svg",{...Nt,width:n||Nt.width,height:n||Nt.height,stroke:i||Nt.stroke,"stroke-width":s?Number(e)*24/Number(n):e,class:["lucide",`lucide-${xs(d??"icon")}`],...c},[...l.map(w=>sa(...w)),...C.default?[C.default()]:[]]);const H=(n,e)=>(s,{slots:i})=>sa(hs,{...s,iconNode:e,name:n},i);const Yt=H("BookmarkIcon",[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]]);const qe=H("CheckIcon",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const Ma=H("CircleAlertIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);const bs=H("CircleCheckIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const Xt=H("ClockIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const Qt=H("CodeIcon",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const He=H("CopyIcon",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const $a=H("EyeIcon",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const ea=H("FileTextIcon",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const na=H("FilmIcon",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M3 7.5h4",key:"zfgn84"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 16.5h4",key:"1230mu"}],["path",{d:"M17 3v18",key:"in4fa5"}],["path",{d:"M17 7.5h4",key:"myr1c1"}],["path",{d:"M17 16.5h4",key:"go4c1d"}]]);const gs=H("GlobeIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);const vs=H("LayersIcon",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);const Da=H("LayoutTemplateIcon",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]]);const oa=H("MusicIcon",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]);const ys=H("PauseIcon",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);const It=H("PenIcon",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]);const Xa=H("PlayIcon",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);const xt=H("PlusIcon",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const ja=H("RefreshCwIcon",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);const Qa=H("RotateCcwIcon",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);const ia=H("ScissorsIcon",[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]]);const Ea=H("SettingsIcon",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const ks=H("ShieldAlertIcon",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);const ws=H("SlidersVerticalIcon",[["line",{x1:"4",x2:"4",y1:"21",y2:"14",key:"1p332r"}],["line",{x1:"4",x2:"4",y1:"10",y2:"3",key:"gb41h5"}],["line",{x1:"12",x2:"12",y1:"21",y2:"12",key:"hf2csr"}],["line",{x1:"12",x2:"12",y1:"8",y2:"3",key:"1kfi7u"}],["line",{x1:"20",x2:"20",y1:"21",y2:"16",key:"1lhrwl"}],["line",{x1:"20",x2:"20",y1:"12",y2:"3",key:"16vvfq"}],["line",{x1:"2",x2:"6",y1:"14",y2:"14",key:"1uebub"}],["line",{x1:"10",x2:"14",y1:"8",y2:"8",key:"1yglbp"}],["line",{x1:"18",x2:"22",y1:"16",y2:"16",key:"1jxqpz"}]]);const ot=H("SparklesIcon",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);const nt=H("Trash2Icon",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);const Mt=H("UploadIcon",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);const _s=H("Volume2Icon",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);const Ss=H("VolumeXIcon",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);const Ts=H("WandSparklesIcon",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);const ta=H("XIcon",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);const Cs=H("ZoomInIcon",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);const As=H("ZoomOutIcon",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]),Os={class:"flex flex-col gap-3 text-slate-100"},Ns={key:0,class:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm flex items-center justify-center p-4"},Is={class:"bg-slate-900 border border-slate-700 rounded-3xl max-w-xl w-full p-5 shadow-2xl flex flex-col gap-4 text-xs max-h-[90vh] overflow-y-auto custom-scrollbar"},Ms={class:"flex items-center justify-between pb-3 border-b border-slate-800"},$s={class:"text-sm font-black text-white flex items-center gap-2"},Ds={class:"p-3.5 bg-slate-950 rounded-2xl border border-slate-800 flex flex-col gap-2.5"},js={class:"font-bold text-sky-400 flex items-center justify-between"},Es={class:"grid grid-cols-1 sm:grid-cols-2 gap-2"},Rs={class:"flex flex-col gap-2"},Ps={class:"text-[11px] font-bold text-slate-400 uppercase tracking-wider"},Ls={class:"flex flex-col gap-2 max-h-[220px] overflow-y-auto pr-1 custom-scrollbar"},Vs={class:"flex-1"},Bs={class:"flex items-center gap-2 mb-1"},Js={class:"font-extrabold text-white text-xs"},Fs={class:"px-1.5 py-0.2 rounded text-[9px] font-bold bg-slate-800 text-slate-300 border border-slate-700"},Hs={class:"text-[11px] text-slate-400 leading-snug"},Zs={class:"flex items-center gap-1"},Us=["onClick"],zs=["onClick"],Gs={key:1,class:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm flex items-center justify-center p-4"},Ks={class:"bg-slate-900 border border-slate-700 rounded-3xl max-w-2xl w-full p-6 shadow-2xl flex flex-col gap-4 text-xs max-h-[90vh]"},Ws={class:"flex items-center justify-between pb-3 border-b border-slate-800"},qs={class:"text-sm font-black text-white flex items-center gap-2"},Ys={class:"flex items-center gap-2 bg-slate-950 p-2.5 rounded-xl border border-slate-800 text-[11px] flex-wrap"},Xs={class:"text-white font-semibold"},Qs={class:"text-white font-semibold"},en={class:"text-white font-semibold"},tn={class:"text-purple-400 font-bold"},an={class:"relative flex-1 min-h-[220px]"},sn=["value"],nn={class:"flex items-center justify-between pt-2 border-t border-slate-800"},on={class:"bg-slate-900 border border-slate-700 rounded-3xl max-w-2xl w-full p-5 shadow-2xl flex flex-col gap-4 text-xs max-h-[92vh] overflow-hidden"},ln={class:"flex items-center justify-between pb-3 border-b border-slate-800"},rn={class:"text-sm font-black text-white flex items-center gap-2"},dn={class:"flex items-center justify-between bg-slate-950 p-1 rounded-xl border border-slate-800"},un={class:"flex items-center gap-1"},cn={key:0,class:"px-2.5 py-0.5 rounded-lg bg-amber-500/20 text-amber-300 border border-amber-500/40 text-[10px] font-bold flex items-center gap-1"},pn={key:0,class:"flex-1 overflow-y-auto pr-1 flex flex-col gap-2.5 custom-scrollbar min-h-[300px]"},fn={key:0,class:"text-center py-12 text-slate-500 text-xs"},mn={class:"flex-1 min-w-0"},xn={class:"flex items-center gap-2 mb-1 flex-wrap"},hn={class:"font-extrabold text-white text-xs"},bn={class:"px-1.5 py-0.2 rounded text-[9px] font-bold bg-sky-950 text-sky-300 border border-sky-800"},gn={class:"text-[9px] text-slate-500 font-mono"},vn={class:"text-[11px] text-slate-400 leading-snug line-clamp-2"},yn={class:"flex items-center gap-1.5 flex-shrink-0 self-end sm:self-center"},kn=["onClick"],wn=["onClick"],_n=["onClick"],Sn=["onClick"],Tn={key:1,class:"flex-1 overflow-y-auto pr-1 flex flex-col gap-3 custom-scrollbar min-h-[350px]"},Cn={key:0,class:"p-2 rounded-xl bg-rose-950/60 border border-rose-500/50 text-rose-300 text-[11px] font-semibold"},An={key:1,class:"p-2.5 rounded-2xl bg-amber-950/60 border border-amber-500/50 text-amber-200 text-xs flex items-center justify-between shadow-lg"},On={class:"flex items-center gap-2 min-w-0"},Nn={class:"p-1 rounded-lg bg-amber-500/20 text-amber-400 shrink-0"},In={class:"min-w-0"},Mn={class:"font-extrabold text-white text-xs flex items-center gap-1.5 truncate"},$n={class:"text-amber-300 truncate"},Dn={class:"text-[10px] text-amber-400/80"},jn={class:"p-3 rounded-2xl bg-gradient-to-r from-sky-950/60 via-indigo-950/40 to-slate-900 border border-sky-500/30 flex flex-col gap-2.5"},En={class:"flex flex-col sm:flex-row sm:items-center justify-between gap-2"},Rn={class:"flex items-center gap-1.5 shrink-0 flex-wrap"},Pn=["title"],Ln={key:0,class:"mt-1 flex flex-col gap-2 p-2.5 rounded-xl bg-slate-950/90 border border-sky-500/40"},Vn={class:"flex items-center justify-between"},Bn=["value"],Jn={key:1,class:"mt-1 flex flex-col gap-2 p-2.5 rounded-xl bg-slate-950/90 border border-sky-500/40"},Fn={class:"flex justify-end gap-2"},Hn={class:"grid grid-cols-1 sm:grid-cols-3 gap-2.5"},Zn=["disabled"],Un={class:"grid grid-cols-1 sm:grid-cols-2 gap-2.5"},zn=["value"],Gn={key:2,class:"flex flex-col gap-2.5 p-3 rounded-2xl bg-slate-950/80 border border-sky-500/30"},Kn={class:"flex items-center justify-between"},Wn={class:"text-[11px] font-black text-sky-400 flex items-center gap-1"},qn={class:"flex items-center justify-end gap-2 pt-2 border-t border-slate-800"},Yn={class:"flex lg:hidden flex-col gap-3 pb-24"},Xn={class:"flex items-center justify-between gap-1 p-1 bg-slate-900/95 border border-slate-800 rounded-2xl shadow-lg sticky top-0 z-20 backdrop-blur-md"},Qn={class:"flex items-center gap-1 overflow-x-auto no-scrollbar flex-1 py-0.5"},eo={key:0,class:"flex flex-col gap-3"},to={class:"flex items-start gap-2.5"},ao={class:"min-w-0 flex-1"},so={class:"font-black text-white text-xs"},no={class:"text-[11px] mt-0.5 leading-relaxed opacity-90"},oo={key:0},io={key:1},lo={class:"underline text-white"},ro={class:"underline text-white"},uo={key:2},co={class:"flex items-center gap-2 pt-1 border-t border-white/10 flex-wrap"},po={key:1,class:"p-2.5 rounded-xl bg-slate-900/60 border border-slate-800 flex items-center justify-between text-[11px] shadow-sm"},fo={class:"flex items-center gap-2 text-slate-300 truncate"},mo={class:"font-extrabold text-white truncate"},xo={class:"p-3.5 bg-slate-900/90 border border-slate-800 rounded-2xl space-y-1.5 shadow-md"},ho=["value"],bo={class:"p-3.5 bg-slate-900/90 border border-slate-800 rounded-2xl space-y-1.5 shadow-md"},go=["value"],vo={class:"grid grid-cols-1 sm:grid-cols-2 gap-2.5"},yo={class:"p-3 bg-slate-900/90 border border-slate-800 rounded-2xl space-y-1 shadow-md"},ko=["value"],wo={class:"p-3 bg-slate-900/90 border border-slate-800 rounded-2xl space-y-1 shadow-md"},_o=["value"],So={class:"p-3.5 bg-slate-900/90 border border-slate-800 rounded-2xl space-y-2 shadow-md"},To={class:"flex items-center justify-between"},Co=["value"],Ao={key:1,class:"flex flex-col gap-3"},Oo={class:"p-3.5 bg-slate-900/90 border border-slate-800 rounded-2xl space-y-2.5 shadow-md"},No={class:"flex items-center justify-between"},Io={class:"text-xs font-extrabold text-white"},Mo={key:0,class:"p-2.5 rounded-xl bg-amber-950/70 border border-amber-500/40 text-amber-200 text-xs flex items-center justify-between shadow"},$o={class:"flex items-center gap-1.5 truncate"},Do={class:"text-[11px] truncate"},jo={key:0},Eo={key:1},Ro={key:2},Po={class:"flex gap-2 overflow-x-auto no-scrollbar py-1"},Lo=["onClick"],Vo={class:"w-8 h-8 rounded-xl bg-slate-800 flex items-center justify-center text-sm shadow"},Bo={class:"text-[10px] font-black text-white leading-tight truncate w-full"},Jo={class:"p-3.5 bg-slate-900/90 border border-slate-800 rounded-2xl space-y-2.5 shadow-md"},Fo={class:"flex items-center justify-between"},Ho={class:"text-[10px] text-sky-400 font-bold"},Zo={class:"grid grid-cols-5 gap-2.5 py-1"},Uo=["onClick","title"],zo={class:"text-[8px] text-slate-400 truncate w-full text-center"},Go={class:"pt-2 border-t border-slate-800 flex items-center justify-between gap-2"},Ko={class:"flex items-center gap-2"},Wo=["value"],qo={class:"flex items-center gap-1.5"},Yo=["value"],Xo={class:"p-3.5 bg-slate-900/90 border border-slate-800 rounded-2xl flex flex-col gap-3 shadow-md"},Qo={class:"flex items-center justify-between"},ei={class:"pt-2.5 border-t border-slate-800/80 flex items-center justify-between gap-2"},ti={class:"flex items-center gap-1.5"},ai={key:0,class:"p-2 rounded-xl bg-slate-950 border border-sky-500/40"},si=["value"],ni={key:2,class:"flex flex-col gap-3"},oi={class:"p-3.5 bg-slate-900/90 border border-slate-800 rounded-2xl space-y-2.5 shadow-md"},ii={class:"flex items-center justify-between"},li={class:"text-xs font-extrabold text-sky-400 flex items-center gap-1.5"},ri=["disabled"],di=["value"],ui=["value"],ci={class:"pt-1 space-y-1"},pi={class:"flex items-center justify-between text-[11px]"},fi={class:"text-slate-400 font-mono"},mi={class:"text-sky-300 font-bold"},xi=["max","value"],hi={class:"p-3.5 bg-slate-900/90 border border-slate-800 rounded-2xl space-y-2.5 shadow-md"},bi={class:"flex items-center justify-between"},gi={class:"text-xs font-extrabold text-purple-400 flex items-center gap-1.5"},vi=["disabled"],yi=["value"],ki=["value"],wi={class:"pt-1 space-y-1"},_i={class:"flex items-center justify-between text-[11px]"},Si={class:"text-slate-400 font-mono"},Ti={class:"text-purple-300 font-bold"},Ci=["max","value"],Ai={class:"p-3.5 bg-slate-900/90 border border-slate-800 rounded-2xl flex items-center justify-between shadow-md"},Oi={class:"text-xs font-bold text-slate-300 flex items-center gap-1.5"},Ni={class:"flex items-center gap-1.5"},Ii=["onClick"],Mi={class:"p-3 bg-slate-900/90 border border-slate-800 rounded-2xl space-y-1.5 shadow-md"},$i={class:"grid grid-cols-3 gap-2"},Di=["checked"],ji=["checked"],Ei=["checked"],Ri={key:3,class:"flex flex-col gap-3"},Pi={class:"p-4 rounded-3xl bg-gradient-to-br from-indigo-950/80 via-slate-900 to-sky-950/80 border border-sky-500/30 space-y-3 shadow-xl"},Li={class:"flex items-center justify-between"},Vi={class:"text-xs font-black text-sky-300 uppercase tracking-wider flex items-center gap-1.5"},Bi={class:"text-[9px] px-2 py-0.5 rounded-full bg-emerald-500/20 text-emerald-400 font-bold border border-emerald-500/30"},Ji={class:"grid grid-cols-2 gap-2"},Fi={class:"space-y-1"},Hi=["value"],Zi={class:"space-y-1"},Ui=["disabled"],zi={class:"p-3.5 bg-slate-900/90 border border-purple-500/30 rounded-2xl space-y-2.5 shadow-md"},Gi={class:"flex items-center justify-between"},Ki={class:"flex items-center gap-1.5"},Wi={class:"flex items-center gap-2"},qi=["disabled"],Yi={key:4,class:"flex flex-col gap-3"},Xi={class:"flex items-center justify-between bg-slate-900/90 p-1 rounded-2xl border border-slate-800 text-xs font-bold shadow-md"},Qi={key:0,class:"flex flex-col gap-2"},el={class:"flex items-center justify-between px-1"},tl={key:0,class:"text-center py-10 text-slate-500 text-xs bg-slate-900/50 rounded-2xl border border-slate-800"},al=["onClick"],sl={class:"flex-1 pr-2 truncate"},nl={class:"font-extrabold text-xs text-white truncate"},ol={class:"text-[10px] text-slate-400 font-mono"},il=["onClick"],ll={key:1,class:"flex flex-col gap-2"},rl={class:"flex items-center justify-between px-1"},dl={key:0,class:"text-center py-10 text-slate-500 text-xs bg-slate-900/50 rounded-2xl border border-slate-800"},ul=["onClick"],cl={class:"flex-1 pr-2 truncate"},pl={class:"font-extrabold text-xs text-white truncate"},fl={class:"text-[10px] text-slate-400 font-mono"},ml=["onClick"],xl={key:5,class:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm flex flex-col justify-end"},hl={class:"w-full max-h-[80vh] bg-slate-900 border-t border-slate-700 rounded-t-3xl p-4 flex flex-col gap-3 shadow-2xl animate-in slide-in-from-bottom"},bl={class:"flex items-center justify-between pb-2 border-b border-slate-800"},gl={class:"flex items-center gap-1.5 truncate"},vl={class:"truncate"},yl={key:0},kl={key:1},wl={key:2},_l=["value"],Sl={class:"flex items-center justify-between gap-2"},Tl={class:"hidden lg:flex flex-col h-full overflow-hidden w-full"},Cl={class:"h-12 px-3 bg-slate-900/90 border-b border-slate-800/80 flex items-center justify-between shrink-0 shadow-sm z-20"},Al={class:"flex items-center gap-2"},Ol={class:"flex items-center gap-1.5 mr-1"},Nl={class:"flex items-center gap-1 bg-slate-950 px-2 py-1 rounded-xl border border-slate-800 shadow-inner"},Il=["value"],Ml={class:"flex items-center gap-1 bg-slate-950 px-2 py-1 rounded-xl border border-slate-800 shadow-inner"},$l={class:"flex items-center gap-2"},Dl=["disabled"],jl={class:"relative group"},El={class:"absolute right-0 mt-1 hidden group-hover:flex flex-col bg-slate-900 border border-slate-800 rounded-xl shadow-2xl py-2 z-30 w-56 text-xs"},Rl={class:"px-3 py-1.5"},Pl={key:0,class:"p-2.5 bg-gradient-to-r from-sky-950 via-indigo-950 to-purple-950 border-b border-sky-500/50 flex items-center gap-3 animate-pulse shadow-md shrink-0"},Ll={class:"w-5 h-5 rounded-lg bg-sky-500/20 border border-sky-400/40 flex items-center justify-center flex-shrink-0"},Vl={class:"text-[11px] flex items-center gap-2"},Bl={class:"text-[9px] px-1.5 py-0.2 rounded bg-sky-500/30 text-sky-200 border border-sky-400/30"},Jl={class:"flex-1 flex flex-row overflow-hidden min-h-0"},Fl={class:"w-80 xl:w-96 bg-slate-900/80 border-r border-slate-800/80 flex flex-col shrink-0 overflow-hidden"},Hl={class:"p-2 border-b border-slate-800/80 bg-slate-950/70 flex items-center justify-between shrink-0"},Zl={class:"flex items-center gap-1.5 w-full"},Ul={key:0,class:"flex-1 flex flex-col overflow-hidden min-h-0"},zl={class:"p-2.5 border-b border-slate-800/60 flex flex-col gap-2 shrink-0"},Gl={class:"flex items-center justify-between"},Kl={class:"text-[10px] font-extrabold uppercase tracking-wider text-slate-400"},Wl={class:"relative"},ql={class:"flex-1 overflow-y-auto p-2 space-y-1.5 custom-scrollbar"},Yl=["onClick"],Xl={class:"flex items-center justify-between"},Ql={class:"text-xs font-black truncate text-white group-hover:text-sky-300 transition"},er={key:0,class:"w-2 h-2 rounded-full bg-sky-400 shrink-0"},tr={key:1,class:"text-[9px] text-amber-400 font-bold shrink-0"},ar={class:"text-[10px] text-slate-400 line-clamp-1 leading-snug"},sr={class:"flex items-center gap-1 mt-0.5 flex-wrap"},nr={class:"px-1.5 py-0.2 rounded text-[8px] font-bold bg-sky-900/60 text-sky-300 border border-sky-700/50 uppercase"},or={key:0,class:"px-1.5 py-0.2 rounded text-[8px] font-bold bg-slate-800 text-slate-400 uppercase"},ir={class:"p-2.5 border-t border-slate-800/80 bg-slate-950/80 flex items-center justify-between shrink-0"},lr={class:"text-[10px] font-bold text-slate-400 flex items-center gap-1"},rr={key:1,class:"flex-1 flex flex-col overflow-hidden min-h-0"},dr={class:"p-2.5 border-b border-slate-800/60 flex items-center justify-between shrink-0"},ur={class:"text-[10px] font-extrabold uppercase tracking-wider text-slate-400"},cr={class:"flex-1 overflow-y-auto p-2 space-y-1.5 custom-scrollbar"},pr={key:0,class:"p-2 rounded-xl bg-amber-500/15 border border-amber-500/40 text-amber-200 flex items-center justify-between gap-1 shadow-sm text-xs mb-1"},fr={class:"truncate text-[10px]"},mr={class:"text-amber-100 font-semibold truncate"},xr={key:1,class:"text-center py-8 text-slate-500 text-[11px] leading-relaxed"},hr=["onClick"],br={class:"flex-1 min-w-0 pr-1"},gr={class:"flex items-center gap-1 mb-0.5"},vr={class:"px-1.5 py-0.2 rounded text-[8px] font-bold uppercase bg-amber-500/20 text-amber-300 border border-amber-500/30"},yr={class:"text-[9px] text-slate-400 font-semibold truncate"},kr={class:"font-bold text-[11px] truncate text-slate-100"},wr=["onClick"],_r={key:2,class:"flex-1 flex flex-col overflow-hidden min-h-0"},Sr={class:"p-2.5 border-b border-slate-800/60 flex items-center justify-between shrink-0"},Tr={class:"text-[10px] font-extrabold uppercase tracking-wider text-slate-400"},Cr={class:"flex-1 overflow-y-auto p-2 space-y-1.5 custom-scrollbar"},Ar={key:0,class:"p-2 rounded-xl bg-purple-500/15 border border-purple-500/40 text-purple-200 flex items-center justify-between gap-1 shadow-sm text-xs mb-1"},Or={class:"truncate text-[10px]"},Nr={class:"text-purple-100 font-semibold truncate"},Ir={key:1,class:"text-center py-8 text-slate-500 text-[11px] leading-relaxed"},Mr=["onClick"],$r={class:"flex-1 min-w-0 pr-1"},Dr={class:"flex items-center gap-1 mb-0.5"},jr={class:"px-1.5 py-0.2 rounded text-[8px] font-bold uppercase bg-purple-500/20 text-purple-300 border border-purple-500/30"},Er={class:"text-[9px] text-slate-400 font-semibold truncate"},Rr={key:0,class:"text-[8px] text-slate-500 font-mono ml-auto"},Pr={class:"font-bold text-[11px] truncate text-slate-100"},Lr=["onClick"],Vr={class:"w-[460px] xl:w-[500px] bg-slate-950 border-r border-slate-800/80 flex flex-col shrink-0 overflow-hidden"},Br={class:"px-3.5 py-2.5 bg-slate-900/70 border-b border-slate-800 flex items-center justify-between shrink-0"},Jr={class:"flex items-center gap-2"},Fr={class:"text-[10px] px-2 py-0.5 rounded-full bg-slate-800 text-sky-300 font-semibold truncate max-w-[150px]"},Hr={class:"flex items-center gap-1"},Zr={class:"flex-1 overflow-y-auto p-3 space-y-3.5 custom-scrollbar"},Ur={class:"p-3 bg-slate-900/80 border border-slate-800 rounded-2xl space-y-2.5 shadow-sm"},zr={class:"flex items-center justify-between"},Gr={class:"text-[10px] font-bold text-sky-400 truncate max-w-[170px]"},Kr={class:"grid grid-cols-5 gap-1.5"},Wr=["onClick","title"],qr={class:"pt-2 border-t border-slate-800 flex items-center justify-between gap-2"},Yr={class:"flex items-center gap-2"},Xr=["value"],Qr={class:"flex items-center gap-1.5"},ed=["value"],td={class:"grid grid-cols-3 gap-2"},ad={class:"col-span-1 space-y-1"},sd=["value"],nd={class:"col-span-2 space-y-1"},od=["value"],id={class:"p-3 bg-slate-900/80 border border-slate-800 rounded-2xl space-y-2 shadow-sm"},ld={class:"flex items-center justify-between"},rd={class:"text-[10px] font-black uppercase tracking-wider text-slate-400 flex items-center gap-1.5"},dd={key:0,class:"inline-flex items-center gap-0.5 px-2 py-0.5 rounded-full text-[9px] font-semibold bg-emerald-500/20 text-emerald-400 border border-emerald-500/30"},ud={key:1,class:"inline-flex items-center gap-0.5 px-2 py-0.5 rounded-full text-[9px] font-semibold bg-rose-500/20 text-rose-400 border border-rose-500/30"},cd={key:0},pd={key:1},fd={class:"flex items-center gap-1.5"},md=["value"],xd={key:1,class:"text-[10px] text-rose-400 mt-1 px-1"},hd={class:"p-3 bg-slate-900/80 border border-slate-800 rounded-2xl flex flex-col gap-2.5 shadow-sm text-xs"},bd={class:"flex flex-col gap-1.5"},gd={class:"flex items-center justify-between gap-2"},vd={class:"font-bold text-slate-300 flex items-center gap-1.5 text-[11px]"},yd={class:"flex items-center gap-1.5"},kd=["value"],wd=["value"],_d=["disabled"],Sd={class:"hidden sm:inline"},Td={class:"flex items-center justify-between pl-5 pr-1 text-[10px] text-slate-400"},Cd={class:"flex items-center gap-1 text-sky-300 font-mono"},Ad=["max","value"],Od={class:"flex flex-col gap-1.5 pt-1.5 border-t border-slate-800"},Nd={class:"flex items-center justify-between gap-2"},Id={class:"font-bold text-slate-300 flex items-center gap-1.5 text-[11px]"},Md={class:"flex items-center gap-1.5"},$d=["value"],Dd=["value"],jd=["disabled"],Ed={class:"hidden sm:inline"},Rd={class:"flex items-center justify-between pl-5 pr-1 text-[10px] text-slate-400"},Pd={class:"flex items-center gap-1 text-purple-300 font-mono"},Ld=["max","value"],Vd={class:"flex items-center justify-between pt-1.5 border-t border-slate-800"},Bd={class:"font-bold text-slate-300 flex items-center gap-1.5 text-[11px]"},Jd={class:"flex items-center gap-1.5 flex-wrap justify-end"},Fd=["onClick"],Hd={class:"grid grid-cols-3 gap-2 pt-1.5 border-t border-slate-800"},Zd=["checked"],Ud=["checked"],zd=["checked"],Gd={class:"p-3 bg-slate-900/90 border-t border-slate-800 shrink-0"},Kd=["disabled"],Wd=fa({__name:"DashboardControls",props:{modelValue:{},options:{},isValid:{type:Boolean},validationError:{},isGenerating:{type:Boolean},generateStage:{},isAutoTopicLoading:{type:Boolean},drafts:{},activeDraftIndex:{},history:{},activeHistoryIndex:{},unsavedStash:{}},emits:["update:modelValue","update:options","generate","autoTopic","selectDraft","deleteDraft","saveDraft","selectHistory","deleteHistory","clearAllHistory","restoreStash","clearStash","toast"],setup(n,{emit:e}){const s=n,i=e,l=S(""),d=S(s.modelValue?.templateId||s.modelValue?.layoutType||"table"),f=S(!0),c=S(""),C=S(""),w=S("gemini-3.8-flash"),M=S("editor");function ee(){i("restoreStash"),M.value="editor"}const pe=S([]),W=S("tech"),V=S(!1),D=S(null),J=S({id:"",name:"",theme:"blue-tech",description:""});async function fe(){try{const u=await $fetch("/api/niches");u?.niches&&u.niches.length>0&&(pe.value=u.niches,pe.value.some(a=>a.id===W.value)||(W.value=pe.value[0].id))}catch(u){console.error("Failed to load niches:",u)}}function Ce(){D.value=null,J.value={id:"",name:"",theme:s.modelValue.theme||"blue-tech",description:""},V.value=!0}function $e(u){D.value=u.id,J.value={id:u.id,name:u.name,theme:u.theme||"blue-tech",description:u.description}}async function ve(){if(!J.value.name.trim()){alert("Nama Niche wajib diisi");return}const a={id:D.value||J.value.name.toLowerCase().replace(/[^a-z0-9_-]/g,"_"),name:J.value.name.trim(),theme:J.value.theme,description:J.value.description.trim()||`Fokus pada topik ${J.value.name.trim()}`};try{const r=await $fetch("/api/niches",{method:"POST",body:a});r?.niches&&(pe.value=r.niches,W.value=a.id,D.value=null,J.value={id:"",name:"",theme:"blue-tech",description:""})}catch(r){alert("Gagal menyimpan niche: "+(r.data?.statusMessage||r.message))}}async function Y(u){if(pe.value.length<=1){alert("Minimal harus ada 1 niche tersisa.");return}if(confirm("Hapus niche ini?"))try{const a=await $fetch(`/api/niches?id=${u}`,{method:"DELETE"});a?.niches&&(pe.value=a.niches,W.value===u&&(W.value=a.niches[0].id),D.value===u&&(D.value=null))}catch(a){alert("Gagal menghapus niche: "+(a.data?.statusMessage||a.message))}}const G=S("id"),q=S([{id:"table",name:"📊 Comparison Table",category:"Perbandingan",description:"Tabel komparasi 2 entitas",icon:"Table",layoutType:"table",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"versus",name:"⚔️ Versus Showdown Arena",category:"Perbandingan",description:"Duel head-to-head dua kubu",icon:"Swords",layoutType:"versus",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"receipt",name:"🧾 Monthly Living Invoice",category:"Finansial",description:"Format slip gaji pengeluaran bulanan",icon:"Receipt",layoutType:"receipt",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"news",name:"📰 Special Report Pamphlet",category:"Jurnalisme",description:"Pamflet investigasi dengan 3 poin kunci",icon:"Newspaper",layoutType:"news",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"stat",name:"🎯 Big Shocking Number",category:"Analisis",description:"Fokus pada satu angka kontras raksasa",icon:"Target",layoutType:"stat",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"timeline",name:"⏳ 10-Year Shift (Then vs Now)",category:"Tren",description:"Pergeseran tren 10 tahun lalu vs sekarang",icon:"Clock",layoutType:"timeline",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"barchart",name:"📈 Income Allocation Bars",category:"Finansial",description:"Distribusi alokasi dana dengan bar chart",icon:"BarChart3",layoutType:"barchart",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"list",name:"🏆 Top 5 Ranked List",category:"Peringkat",description:"Ranking 5 teratas dengan kartu metrik",icon:"ListOrdered",layoutType:"list",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"quote",name:"💬 Hot Take / Quote Debate",category:"Opini",description:"Kutipan tajam memicu perdebatan",icon:"Quote",layoutType:"quote",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"leaderboard",name:"🥇 Multi-Country Leaderboard (Top 10)",category:"Peringkat",description:"Peringkat 5-10 negara dengan horizontal bar chart",icon:"Trophy",layoutType:"leaderboard",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"editorial",name:"📰 Editorial Storytelling Deep Dive",category:"Jurnalisme",description:"Format narasi editorial 3 kartu bertahap",icon:"BookOpen",layoutType:"editorial",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"matrix",name:"📊 Multi-Column Matrix (3-4 Negara)",category:"Perbandingan",description:"Tabel matriks komparasi 3-4 negara sekaligus",icon:"Grid",layoutType:"matrix",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"debate",name:"⚡ Debate Arena (Pro vs Kontra)",category:"Interaktif",description:"Arena debat dua kubu dengan skor komunitas",icon:"Flame",layoutType:"debate",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"tierlist",name:"🎖️ Tier List Ranking (S, A, B, C)",category:"Peringkat",description:"Hierarki tingkatan Tier S, A, B, C",icon:"Layers",layoutType:"tierlist",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"breaking-notifications",name:"📱 Breaking Alert Notification Stack",category:"Berita Viral",description:"Tumpukan 3 kartu notifikasi darurat kaca iOS/Android",icon:"Bell",layoutType:"custom",isBuiltin:!0,sampleData:{},promptDirective:""}]),we=S(!1),oe=S("list"),X=S(null),te=S(""),U=S(""),ge=S(!1),ae=S(!1),_e=S(!1),se=S(""),N=S({id:"",name:"",category:"Kustom",description:"",layoutType:"custom",customHtml:"",customCss:"",promptDirective:"",sampleJsonText:""});async function Ge(){try{const u=await $fetch("/api/templates");u?.templates&&u.templates.length>0&&(q.value=u.templates)}catch(u){console.error("Failed to load templates:",u)}}function $(u="list"){oe.value=u,U.value="",u==="form"&&B(),we.value=!0}function h(){B(),U.value="",oe.value="form",we.value=!0}function Q(){B(),U.value="",oe.value="list"}function Me(){we.value=!1,B(),U.value="",oe.value="list"}function B(){X.value=null,N.value={id:"",name:"",category:"Kustom",description:"",layoutType:"custom",customHtml:`<div class="p-6 rounded-2xl bg-slate-900/90 border border-slate-700/80 text-center shadow-xl">
2
+ <span class="px-3 py-1 rounded-full text-xs font-black uppercase tracking-wider bg-sky-500/20 text-sky-400 border border-sky-500/30 mb-3 inline-block">{{ data.category }}</span>
3
+ <h2 class="text-3xl font-black text-white mb-2 leading-tight">{{ data.title }}</h2>
4
+ <p class="text-lg text-sky-300 font-bold mb-4">{{ data.subtitle }}</p>
5
+ </div>`,customCss:".custom-card-glow { box-shadow: 0 10px 30px -5px rgba(14, 165, 233, 0.3); }",promptDirective:"Instruksi khusus untuk AI saat generate format ini...",sampleJsonText:JSON.stringify({title:"JUDUL KONTEN MENARIK 2026",subtitle:"Subjudul penjelas berbasis fakta data",category:"KUSTOM VIRAL",watermark:"@SocialGen"},null,2)}}function Je(u){if(N.value.layoutType=u,u==="custom"){N.value.customHtml||(N.value.customHtml=`<div class="p-6 rounded-2xl bg-slate-900/90 border border-slate-700/80 text-center shadow-xl">
6
+ <span class="px-3 py-1 rounded-full text-xs font-black uppercase tracking-wider bg-sky-500/20 text-sky-400 border border-sky-500/30 mb-3 inline-block">{{ data.category }}</span>
7
+ <h2 class="text-3xl font-black text-white mb-2 leading-tight">{{ data.title }}</h2>
8
+ <p class="text-lg text-sky-300 font-bold mb-4">{{ data.subtitle }}</p>
9
+ </div>`);return}const a=q.value.find(r=>r.id===u||r.layoutType===u);a&&(N.value.promptDirective=a.promptDirective,N.value.sampleJsonText=JSON.stringify(a.sampleData,null,2),N.value.customHtml=a.customHtml||"",N.value.customCss=a.customCss||"")}function Lt(u){X.value=u.id,N.value={id:u.id,name:u.name,category:u.category,description:u.description,layoutType:u.layoutType,customHtml:u.customHtml||"",customCss:u.customCss||"",promptDirective:u.promptDirective,sampleJsonText:JSON.stringify(u.sampleData,null,2)},oe.value="form"}function Xe(u){X.value=null,N.value={id:`${u.id}-custom-${Date.now().toString().slice(-4)}`,name:`${u.name} (Kustom)`,category:u.category||"Kustom",description:u.description,layoutType:u.layoutType,customHtml:u.customHtml||"",customCss:u.customCss||"",promptDirective:u.promptDirective,sampleJsonText:JSON.stringify(u.sampleData,null,2)},oe.value="form"}const pt=re(()=>`Bertindaklah sebagai Lead Design Technologist & Senior Frontend Engineer untuk SocialGen (Dynamic Visual Engine for High-CPM Meta Monetization).
10
+
11
+ Saya melampirkan screenshot / gambar desain kartu visual media sosial.
12
+
13
+ Tugas Anda:
14
+ Analisis tata letak visual, dekorasi, tipografi, palet warna HEX, bingkai, dan struktur konten pada gambar ini, lalu ubah menjadi template visual kustom SocialGen dalam format 1 objek JSON valid persis seperti ini:
15
+
16
+ {
17
+ "id": "slug-unik-kebab-case",
18
+ "name": "Nama Template Unik (Awali dengan Emoji, misal: 📰 Orange Pill Hero & News Tablet)",
19
+ "category": "Kategori Template (misal: Edukasi, Finansial, Berita Viral, Ranking, Perbandingan)",
20
+ "description": "Deskripsi singkat 1-2 kalimat mengenai gaya visual dan kegunaan template ini.",
21
+ "layoutType": "custom",
22
+ "customHtml": "<div class=\\"my-container\\">\\n <!-- Header / Hero Section -->\\n <div class=\\"my-hero\\">\\n <div class=\\"my-subtitle\\">{{ data.subtitle }}</div>\\n <div class=\\"my-title-box\\">\\n <h1 class=\\"my-title\\">{{ data.title }}</h1>\\n </div>\\n </div>\\n\\n <!-- Body / Main Content Visual Structure (Tablet / Frame / Pill Cards) -->\\n <div class=\\"my-frame-box\\">\\n {{#each data.items}}\\n <div class=\\"my-item-card\\">\\n <div class=\\"my-item-dot\\"></div>\\n <div class=\\"my-item-text\\">{{ text }}</div>\\n </div>\\n {{/each}}\\n </div>\\n\\n <!-- Footer / Source Attribution -->\\n <div class=\\"my-footer\\">\\n <span class=\\"my-source\\">{{ data.footerNote }}</span>\\n </div>\\n</div>",
23
+ "customCss": ".my-container { width: 100%; max-width: 960px; margin: 0 auto; display: flex; flex-direction: column; gap: 28px; box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; } .my-hero { display: flex; flex-direction: column; gap: 12px; } .my-subtitle { font-size: 24px; font-weight: 800; color: #ffffff; text-shadow: 0 2px 8px rgba(0,0,0,0.4); } .my-title-box { background: #ffffff; border-radius: 24px; padding: 22px 32px; box-shadow: 0 12px 28px rgba(0,0,0,0.25); } .my-title { margin: 0; font-size: 56px; font-weight: 900; line-height: 1.1; color: #d84e1f; text-transform: uppercase; } .my-frame-box { display: flex; flex-direction: column; gap: 16px; background: rgba(30, 41, 59, 0.9); border-radius: 32px; padding: 26px; border: 2px solid rgba(255,255,255,0.15); box-shadow: 0 20px 40px rgba(0,0,0,0.35); } .my-item-card { display: flex; align-items: flex-start; gap: 16px; background: #ffffff; border-radius: 18px; padding: 20px 24px; border-left: 8px solid #eb6a37; box-shadow: 0 4px 12px rgba(0,0,0,0.06); } .my-item-dot { width: 14px; height: 14px; min-width: 14px; border-radius: 50%; background: #f5b027; margin-top: 6px; } .my-item-text { font-size: 22px; font-weight: 700; line-height: 1.45; color: #1e293b; margin: 0; } .my-footer { display: flex; justify-content: center; } .my-source { font-size: 17px; font-weight: 700; color: rgba(255,255,255,0.9); background: rgba(15,23,42,0.6); padding: 10px 22px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.2); text-shadow: 0 1px 3px rgba(0,0,0,0.4); }",
24
+ "sampleData": {
25
+ "templateId": "slug-unik-kebab-case",
26
+ "layoutType": "custom",
27
+ "title": "CONTOH JUDUL BESAR KAPITAL SESUAI GAMBAR",
28
+ "subtitle": "Contoh subjudul pengantar informatif sesuai konteks gambar",
29
+ "category": "KATEGORI KONTEN",
30
+ "watermark": "@SocialGen",
31
+ "theme": "sunset-orange",
32
+ "accentColor": "#eb6a37",
33
+ "footerNote": "Sumber: Lembaga Riset / Instansi Resmi (domain.go.id / .org) 2026",
34
+ "methodologyBadge": "Metodologi Riset Resmi 2026",
35
+ "disclaimer": "Ringkasan data edukasi • Bukan nasihat resmi",
36
+ "sourceUrl": "https://domain-resmi.org",
37
+ "reelsDuration": 30,
38
+ "caption": "Pertanyaan pemantik interaksi netizen? Tulis pendapatmu di bawah! 👇 #hashtags",
39
+ "items": [
40
+ { "text": "Poin penjelasan pertama yang ringkas dan padat (maksimal 20 kata per poin)..." },
41
+ { "text": "Poin penjelasan kedua yang mereplikasi isi kartu pada gambar..." },
42
+ { "text": "Poin penjelasan ketiga yang melengkapi data infografis..." }
43
+ ]
44
+ },
45
+ "promptDirective": "FORMAT STRUKTUR JSON:\\n- 'templateId': Wajib cantumkan 'slug-unik-kebab-case'.\\n- 'layoutType': Wajib 'custom'.\\n- 'title': Judul utama singkat, padat, kapital (2-4 kata) yang menonjol.\\n- 'subtitle': Subjudul informatif 1 baris (6-10 kata) sebagai pengantar.\\n- 'footerNote': WAJIB cantumkan nama lembaga/sumber data riset resmi & tahun data.\\n- 'items': Array berisi 3 hingga 5 objek dengan properti 'text' (1-2 kalimat ringkas padat)."
46
+ }
47
+
48
+ =======================================================
49
+ PANDUAN STANDAR WAJIB ARSITEKTUR TEMPLATE SOCIALGEN:
50
+
51
+ 1. ATURAN KRUSIAL KODE HTML & HANDLEBARS TAGS:
52
+ - Kolom \\"customHtml\\" WAJIB berupa string HTML utuh dengan seluruh tag pembuka & penutup <div>, <h1>, <p>, <span>.
53
+ - Tag Handlebars yang didukung:
54
+ * {{ data.title }} untuk judul utama
55
+ * {{ data.subtitle }} untuk subjudul/kicker
56
+ * {{ data.footerNote }} untuk sumber/keterangan bawah
57
+ * {{#each data.items}} ... {{ text }} ... {{/each}} untuk list/grid poin
58
+ - DILARANG KERAS menulis variabel raw tanpa pembungkus elemen HTML dan class CSS!
59
+ - Semua tanda kutip dua atribut di dalam JSON wajib di-escape (misal: class=\\"my-card\\").
60
+
61
+ 2. KESERASIAN ID TEMPLATE (ID MATCHING):
62
+ - Field root \\"id\\" dan field \\"sampleData.templateId\\" HARUS BERNILAI SAMA PERSIS (contoh: \\"orange-pill-hero\\").
63
+ - Jangan menggunakan ID yang berbeda antara root dan sampleData karena sistem SocialGen auto-switch menggunakan ID ini.
64
+
65
+ 3. EKSTRAKSI WARNA AKURAT & ACCENT COLOR:
66
+ - Nilai \\"theme\\" dapat berupa salah satu preset SocialGen:
67
+ ('blue-tech' | 'emerald-finance' | 'slate-education' | 'dark-contrast' | 'crimson-alert' | 'amber-gold' | 'cyber-violet' | 'sunset-orange' | 'nordic-frost' | 'monochrome-luxe')
68
+ ATAU identifier tema kustom (misal: 'navy-gold', 'crimson-dark', 'sepia-vintage').
69
+ - Sertakan field \\"accentColor\\" dengan kode HEX dominan yang diekstrak langsung dari gambar screenshot (contoh: \\"#eb6a37\\", \\"#d4af37\\", \\"#38bdf8\\").
70
+ - Dalam \\"customCss\\", Anda dapat menggunakan warna HEX langsung atau variabel CSS var(--accent-color, #eb6a37).
71
+
72
+ 4. JAMINAN KONTRAS TINGGI (HIGH CONTRAST & READABILITY):
73
+ - Pastikan teks selalu sangat kontras dan mudah dibaca:
74
+ * Latar belakang gelap -> Gunakan teks putih (#ffffff) atau teks aksen terang (#fde047, #38bdf8).
75
+ * Kotak/Kartu terang/putih -> Gunakan teks gelap (#0f172a, #1e293b, #334155). JANGAN PERNAH gunakan teks putih di atas kartu putih!
76
+ * Tambahkan drop-shadow (text-shadow: 0 2px 8px rgba(0,0,0,0.5);) pada teks yang berada langsung di atas foto/background kanvas.
77
+
78
+ 5. KANVAS RESPONSIVE MULTI-FORMAT (FEED 4:5 & REELS 9:16):
79
+ - SocialGen mengekspor konten ke Feed 4:5 (1080x1350) dan Story/Reels 9:16 (1080x1920).
80
+ - JANGAN PERNAH memberi tinggi mati (height: 1350px) pada kontainer utama!
81
+ - Kontainer terluar WAJIB menggunakan:
82
+ width: 100%; max-width: 960px; margin: 0 auto; display: flex; flex-direction: column;
83
+ - Dengan aturan ini, kartu akan selalu berada tepat di tengah (center) dan berada di dalam Safe Zone baik pada format Feed maupun Reels.
84
+
85
+ 6. JANGAN DUPLIKASI HEADER & FOOTER GLOBAL SOCIALGEN:
86
+ - SocialGen SUDAH otomatis merender Top Metadata Bar (Category Badge & Watermark @SocialGen) di bagian paling atas kanvas.
87
+ - SocialGen SUDAH otomatis merender Bottom Callout (\\"💬 Drop your opinion below • Share to your feed ↗\\" & Disclaimer) di bagian paling bawah.
88
+ - Oleh karena itu, customHtml HANYA fokus mendesain kartu konten di bagian tengah:
89
+ * Header kartu (Subtitle + Judul Besar)
90
+ * Badan kartu (mockup tablet, framed box, kartu list pil/bubble)
91
+ * Sumber data (footerNote) di bagian bawah kartu
92
+
93
+ 7. TIPOGRAFI STANDAR 1080px (READABILITY V2.4):
94
+ - Kanvas beresolusi 1080px lebar. Agar terbaca jelas di HP tanpa zoom:
95
+ * Judul Utama (title): font-size: 52px – 64px (font-weight: 900, line-height: 1.08 - 1.15)
96
+ * Subjudul (subtitle): font-size: 22px – 26px (font-weight: 700-800)
97
+ * Teks Kartu Poin (items): font-size: 20px – 24px (font-weight: 700, line-height: 1.45)
98
+ * Sumber Data (footerNote): font-size: 16px – 18px (font-weight: 600-700)
99
+
100
+ 8. MURNI CSS EKSPLISIT DI 'customCss':
101
+ - Karena aplikasi sudah di-compile, jangan mengandalkan arbitrary Tailwind baru (seperti text-[55px] atau bg-[#123456]).
102
+ - Semua warna, background, border, radius, bayangan, font-size, dan flexbox WAJIB ditulis lengkap dan eksplisit di \\"customCss\\".
103
+
104
+ 9. KREDIBILITAS TIER 1 (META CPM MONETIZATION):
105
+ - Selalu sertakan field \\"methodologyBadge\\", \\"disclaimer\\", dan \\"sourceUrl\\" di sampleData untuk lolos verifikasi transparansi data audiens Tier 1.
106
+
107
+ Keluarkan HANYA 1 objek JSON valid tanpa markdown formatting (\`\`\`json) agar bisa langsung diimpor otomatis ke aplikasi SocialGen.`);async function Qe(){await bt(pt.value)&&(ge.value=!0,setTimeout(()=>{ge.value=!1},3e3))}function Vt(){if(U.value="",!!se.value.trim())try{let u=se.value.trim();u=u.replace(/^```json\s*/i,"").replace(/```$/i,"").trim();const a=JSON.parse(u),r=(a.id||a.sampleData?.templateId||a.name||"").toLowerCase().replace(/[^a-z0-9_-]/g,"-").replace(/^-+|-+$/g,"");if(r&&(N.value.id=r),a.name&&(N.value.name=a.name),a.category&&(N.value.category=a.category),a.description&&(N.value.description=a.description),N.value.layoutType=a.layoutType||"custom",a.customHtml){const y=a.customHtml.trim();N.value.customHtml=y,/<[a-z][\s\S]*>/i.test(y)||(U.value="⚠️ Perhatian: customHtml tidak mendeteksi tag HTML (seperti <div>, <p>). Pastikan AI menyertakan elemen HTML pembungkus class CSS.")}if(a.customCss&&(N.value.customCss=a.customCss),a.promptDirective&&(N.value.promptDirective=a.promptDirective),a.sampleData){const y={...a.sampleData};N.value.id&&(y.templateId=N.value.id,y.layoutType="custom"),y.id||(y.id="sample-"+(N.value.id||Date.now())),N.value.sampleJsonText=JSON.stringify(y,null,2)}ae.value=!1,se.value=""}catch(u){U.value="Gagal membaca JSON dari AI: "+u.message}}async function Bt(){if(U.value="",!N.value.name.trim()){U.value="Nama template wajib diisi";return}const u=X.value||N.value.id.trim()||N.value.name.toLowerCase().replace(/[^a-z0-9_-]/g,"-");let a=null;try{a=JSON.parse(N.value.sampleJsonText),a.id||(a.id=u)}catch(r){U.value="JSON Sampel Data tidak valid: "+r.message;return}try{const r=await $fetch("/api/templates",{method:"POST",body:{id:u,name:N.value.name.trim(),category:N.value.category.trim()||"Kustom",description:N.value.description.trim(),layoutType:N.value.layoutType,customHtml:N.value.customHtml?.trim()||void 0,customCss:N.value.customCss?.trim()||void 0,sampleData:a,promptDirective:N.value.promptDirective.trim(),isBuiltin:!!(X.value&&q.value.find(y=>y.id===X.value)?.isBuiltin)}});r?.templates&&(q.value=r.templates),oe.value="list",X.value=null}catch(r){U.value=r.data?.statusMessage||r.message||"Gagal menyimpan template"}}async function wt(u){if(confirm("Yakin ingin menghapus template kustom ini?"))try{const a=await $fetch(`/api/templates?id=${u}`,{method:"DELETE"});a?.templates&&(q.value=a.templates)}catch(a){alert(a.data?.statusMessage||a.message||"Gagal menghapus template")}}function Jt(u){et(u.layoutType==="custom"?u.id:u.layoutType||u.id),we.value=!1}const T=re(()=>{if(!te.value.trim())return q.value;const u=te.value.toLowerCase();return q.value.filter(a=>a.name.toLowerCase().includes(u)||a.category.toLowerCase().includes(u)||a.description.toLowerCase().includes(u)||a.layoutType.toLowerCase().includes(u))}),b=S(!1),ye=S(""),le=S({}),ha=S(!1),_t=S(!1),Ft=S(["cyber_blue.mp4","emerald_flow.mp4","default_bg.mp4"]),Ht=S(["synthwave_pulse.mp3","lofi_chill.mp3","default_ambient.mp3"]),De=S({"neon_cyber_grid.mp4":8,"financial_pulse_flow.mp4":8,"dark_luxury_particles.mp4":8,"cyber_matrix_stream.mp4":10,"cyber_blue.mp4":15,"default_bg.mp4":15,"emerald_flow.mp4":15,"cyber_pulse.mp4":15,"cyber_future_tech.mp3":15,"dark_phonk_pulse.mp3":15,"deep_finance_groove.mp3":15,"synthwave_pulse.mp3":15,"lofi_chill.mp3":15,"default_ambient.mp3":15,"motivation_cinematic.mp3":110,"lofi_viral_study.mp3":147}),Zt=re(()=>{const u=s.options.backgroundSource||"";return De.value[u]||15}),Ke=re(()=>Math.max(1,Zt.value-1)),Ut=re(()=>{const u=s.options.musicFile||"";return De.value[u]||30}),We=re(()=>Math.max(1,Ut.value-1));function ba(u,a){if(!u||u==="random"||typeof window>"u")return;const r=a==="video"?`/api/stream/videos/${encodeURIComponent(u)}`:`/api/stream/musics/${encodeURIComponent(u)}`;if(a==="audio"){const y=new Audio;y.preload="metadata",y.src=r,y.onloadedmetadata=()=>{if(y.duration&&!isNaN(y.duration)&&isFinite(y.duration)){const P=Math.round(y.duration);P>0&&P!==De.value[u]&&(De.value={...De.value,[u]:P})}}}else{const y=document.createElement("video");y.preload="metadata",y.src=r,y.onloadedmetadata=()=>{if(y.duration&&!isNaN(y.duration)&&isFinite(y.duration)){const P=Math.round(y.duration);P>0&&P!==De.value[u]&&(De.value={...De.value,[u]:P})}}}}ke(()=>s.options.backgroundSource,(u,a)=>{if(u&&ba(u,"video"),a!==void 0&&u!==a)je("videoStartOffset",0);else{const r=Ke.value;(s.options.videoStartOffset||0)>r&&je("videoStartOffset",r)}},{immediate:!0}),ke(()=>s.options.musicFile,(u,a)=>{if(u&&ba(u,"audio"),a!==void 0&&u!==a)je("audioStartOffset",0);else{const r=We.value;(s.options.audioStartOffset||0)>r&&je("audioStartOffset",r)}},{immediate:!0});const Fe=S(!1),zt=S(null),Gt=S(null);async function ga(){try{const u=await $fetch("/api/media");u?.videos?.length&&(Ft.value=u.videos),u?.audio?.length&&(Ht.value=u.audio),u?.durations&&(De.value={...De.value,...u.durations})}catch(u){console.error("Failed to fetch media list:",u)}}ma(()=>{try{const u=localStorage.getItem("sg_selected_language");u&&(G.value=u)}catch{}ga(),fe(),Ge()}),ke(G,u=>{try{localStorage.setItem("sg_selected_language",u)}catch{}});async function va(u,a){const r=u.target,y=r.files?.[0];if(y){Fe.value=!0;try{const P=new FormData;P.append("file",y);const Ae=await $fetch("/api/upload-media",{method:"POST",body:P});Ae?.success&&(await ga(),Ae.type==="video"?i("update:options",{...s.options,backgroundSource:Ae.filename,videoStartOffset:0}):i("update:options",{...s.options,musicFile:Ae.filename,audioStartOffset:0}))}catch(P){alert("Upload gagal: "+(P.data?.statusMessage||P.message))}finally{Fe.value=!1,r.value=""}}}const ue=re(()=>{const u=(d.value||"table").trim().toLowerCase();return q.value.find(a=>a.id.toLowerCase()===u||a.layoutType&&a.layoutType.toLowerCase()===u)||q.value[0]}),me=re(()=>{const u=l.value.trim();if(!u)return null;try{return JSON.parse(u)}catch{return null}}),K=re(()=>{if(!l.value.trim()||!me.value)return null;const u=(me.value.templateId||me.value.layoutType||(q.value.some(P=>P.id===me.value?.id)?me.value?.id:"")||"").trim().toLowerCase();if(!u)return null;const a=(d.value||"").trim().toLowerCase(),r=(ue.value?.layoutType||"").trim().toLowerCase();if(u===a||u===r)return null;const y=q.value.find(P=>P.id.toLowerCase()===u||P.layoutType&&P.layoutType.toLowerCase()===u);return{jsonTemplateId:me.value.templateId||me.value.layoutType||me.value.id,matchedTarget:y||null,isKnown:!!y}}),Le=re(()=>{if(!l.value.trim()){const u=ue.value?.sampleData?JSON.parse(JSON.stringify(ue.value.sampleData)):{},a=ue.value?.id||"table",r=ue.value?.layoutType==="custom"?a:ue.value?.layoutType||a;return{...u,id:u.id||a,templateId:a,layoutType:r,customHtml:ue.value?.customHtml||void 0,customCss:ue.value?.customCss||void 0}}if(me.value){const u=ue.value?.id||me.value.templateId||"table",a=ue.value?.layoutType==="custom"?u:ue.value?.layoutType||u;return{...me.value,templateId:u,layoutType:a,customHtml:ue.value?.customHtml||me.value.customHtml||void 0,customCss:ue.value?.customCss||me.value.customCss||void 0}}return s.modelValue});ke(()=>Le.value,u=>{i("update:modelValue",u),u.theme&&u.theme!==s.options.theme&&i("update:options",{...s.options,theme:u.theme})},{immediate:!0,deep:!0}),ke(()=>s.modelValue,u=>{if(!u)return;const a=JSON.stringify(Le.value),r=JSON.stringify(u);if(a!==r){const y=u.templateId||u.layoutType;if(y){const P=q.value.find(Ae=>Ae.id.toLowerCase()===y.toLowerCase()||Ae.layoutType&&Ae.layoutType.toLowerCase()===y.toLowerCase());P&&(d.value=P.id)}l.value=JSON.stringify(u,null,2)}},{deep:!0}),ke(()=>s.unsavedStash,(u,a)=>{a&&!u&&(M.value="editor")});function ya(u){const a=u.target;if(l.value=a.value,!a.value.trim()){c.value="";return}try{const r=JSON.parse(a.value);if(c.value="",f.value){const y=(r.templateId||r.layoutType||(q.value.some(P=>P.id===r.id)?r.id:"")||"").trim().toLowerCase();if(y){const P=q.value.find(Ae=>Ae.id.toLowerCase()===y||Ae.layoutType&&Ae.layoutType.toLowerCase()===y);P?P.id.toLowerCase()!==d.value.toLowerCase()?(d.value=P.id,i("toast",`✓ JSON terdeteksi: Otomatis beralih ke template ${P.name}`,"success")):i("toast",`✓ JSON cocok dengan template ${P.name}`,"success"):i("toast",`⚠️ Format JSON: Template ID "${y}" tidak terdaftar di sistem`,"error")}else i("toast",`JSON valid dimasukkan untuk template ${ue.value?.name}`,"success")}}catch(r){c.value="Format JSON tidak valid: "+r.message}}function Kt(){l.value="",c.value="",i("toast",`Format direset ke sampel template ${ue.value?.name||""}`,"success")}function Wt(){l.value="",c.value="",i("toast",`Format disesuaikan ke data sampel ${ue.value?.name||""}`,"success")}function ka(){if(l.value.trim())try{const u=JSON.parse(l.value);l.value=JSON.stringify(u,null,2),c.value="",i("toast","JSON berhasil dirapikan","success")}catch{c.value="Format JSON tidak valid, periksa kembali kurung/tanda petik"}}function et(u){d.value=u;const a=q.value.find(y=>y.id===u),r=a?.name||u;if(l.value.trim()&&me.value){const y=(me.value.templateId||me.value.layoutType||(q.value.some(cs=>cs.id===me.value?.id)?me.value?.id:"")||"").trim().toLowerCase(),P=u.trim().toLowerCase(),Ae=(a?.layoutType||"").trim().toLowerCase();y&&y!==P&&y!==Ae?i("toast",`Beralih ke template ${r}. Format JSON berbeda, klik 'Pakai Sampel' untuk menyesuaikan.`,"info"):i("toast",`Template diubah ke ${r}`,"success")}else i("toast",`Template diubah ke ${r}`,"success")}function wa(u){try{const a=l.value.trim()?JSON.parse(l.value):{...Le.value};a.title=u,l.value=JSON.stringify(a,null,2)}catch{}}function _a(u){try{const a=l.value.trim()?JSON.parse(l.value):{...Le.value};a.watermark=u,l.value=JSON.stringify(a,null,2)}catch{}}function ss(u){try{const a=l.value.trim()?JSON.parse(l.value):{...Le.value};a.subtitle=u,l.value=JSON.stringify(a,null,2)}catch{}}function ns(u){try{const a=l.value.trim()?JSON.parse(l.value):{...Le.value};a.footerNote=u,l.value=JSON.stringify(a,null,2)}catch{}}function os(u){try{const a=l.value.trim()?JSON.parse(l.value):{...Le.value};a.caption=u,l.value=JSON.stringify(a,null,2)}catch{}}const Se=S("content"),ft=S(!1),is=[{id:"blue-tech",name:"Blue Tech",color:"#0284c7"},{id:"emerald-finance",name:"Emerald Finance",color:"#059669"},{id:"slate-education",name:"Slate Education",color:"#64748b"},{id:"dark-contrast",name:"Dark Contrast",color:"#1e293b"},{id:"crimson-alert",name:"Crimson Alert",color:"#e11d48"},{id:"amber-gold",name:"Amber Gold",color:"#d97706"},{id:"cyber-violet",name:"Cyber Violet",color:"#7c3aed"},{id:"sunset-orange",name:"Sunset Orange",color:"#ea580c"},{id:"nordic-frost",name:"Nordic Frost",color:"#0891b2"},{id:"monochrome-luxe",name:"Monochrome Luxe",color:"#475569"}],St={"blue-tech":"#0284c7","emerald-finance":"#059669","slate-education":"#64748b","dark-contrast":"#1e293b","crimson-alert":"#e11d48","amber-gold":"#d97706","cyber-violet":"#7c3aed","sunset-orange":"#ea580c","nordic-frost":"#0891b2","monochrome-luxe":"#475569"},tt=re(()=>{if(s.modelValue?.accentColor)return s.modelValue.accentColor;const u=s.modelValue?.theme||s.options?.theme||"blue-tech";return St[u]||(u.startsWith("#")?u:"#0284c7")});function Tt(u){if(u){try{const a=l.value.trim()?JSON.parse(l.value):{...Le.value};a.accentColor=u,l.value=JSON.stringify(a,null,2)}catch{}i("update:options",{...s.options,accentColor:u})}}function ls(u,a){const r=(a||u||"").toLowerCase();return r.includes("orange")||r.includes("news")?"📰":r.includes("edu")||r.includes("infografis")?"📜":r.includes("breaking")||r.includes("alert")?"🚨":r.includes("stat")?"🎯":r.includes("table")||r.includes("matrix")?"📊":r.includes("versus")||r.includes("debate")?"⚔️":r.includes("receipt")?"🧾":r.includes("tierlist")?"🎖️":r.includes("leaderboard")||r.includes("list")?"🏆":r.includes("quote")?"💬":r.includes("timeline")?"⏳":r.includes("barchart")?"📈":"🎨"}function Sa(u){try{const a=l.value.trim()?JSON.parse(l.value):{...Le.value};a.theme=u,St[u]&&(a.accentColor=St[u]),l.value=JSON.stringify(a,null,2)}catch{}i("update:options",{...s.options,theme:u,accentColor:St[u]||s.options.accentColor})}const Ta=[{id:"dark-contrast",name:"Dark Contrast (Universal Bold)",bgClass:"bg-slate-950 border-slate-700"},{id:"blue-tech",name:"Blue Tech (AI & Software)",bgClass:"bg-blue-900 border-blue-600"},{id:"emerald-finance",name:"Emerald Finance (Salaries & Living)",bgClass:"bg-emerald-900 border-emerald-600"},{id:"amber-gold",name:"Amber Gold (Luxury & Executive)",bgClass:"bg-amber-900 border-amber-600"},{id:"slate-education",name:"Slate Education (Education & Career)",bgClass:"bg-indigo-900 border-indigo-600"},{id:"crimson-alert",name:"Crimson Alert (Breaking Shock)",bgClass:"bg-rose-900 border-rose-600"},{id:"cyber-violet",name:"Cyber Violet (Synthwave & Neon)",bgClass:"bg-purple-900 border-purple-600"},{id:"sunset-orange",name:"Sunset Orange (Warm Energy)",bgClass:"bg-orange-900 border-orange-600"},{id:"nordic-frost",name:"Nordic Frost (Polar Cyan Clean)",bgClass:"bg-cyan-900 border-cyan-600"},{id:"monochrome-luxe",name:"Monochrome Luxe (Minimalist)",bgClass:"bg-zinc-800 border-zinc-500"}],rs=re(()=>q.value.find(a=>a.id===d.value)?.name||d.value||"Custom");function Ca(u){const a={...s.modelValue,reelsDuration:u};i("update:modelValue",a)}function je(u,a){i("update:options",{...s.options,[u]:a})}function at(u,a){const r=s.options.outputs||{feed:!0,story:!0,reels:!0};i("update:options",{...s.options,outputs:{...r,[u]:a}})}function Aa(u,a){i("autoTopic",W.value,C.value||void 0,w.value,G.value)}async function qt(){b.value=!0,ha.value=!0;try{const u=await $fetch("/api/copy-prompt",{query:{niche:W.value,layout:s.modelValue.layoutType||"table",language:G.value}});ye.value=u.prompt,le.value={topic:u.topic,pair:u.pair,niche:u.niche,template:u.template,usedCount:u.usedCount,language:u.language||G.value}}catch(u){console.error("Failed to get manual prompt:",u)}finally{ha.value=!1}}async function ds(){if(!ye.value)return;await bt(ye.value)&&(_t.value=!0,setTimeout(()=>{_t.value=!1},2500))}const Ct=S(!1),At=S(!1);async function us(){Ct.value=!0;try{const u=await $fetch("/api/copy-prompt",{query:{niche:W.value,layout:s.modelValue.layoutType||"table",language:G.value}});ye.value=u.prompt,le.value={topic:u.topic,pair:u.pair,niche:u.niche,template:u.template,usedCount:u.usedCount,language:u.language||G.value},await bt(u.prompt)&&(At.value=!0,setTimeout(()=>{At.value=!1},2500))}catch(u){console.error("Failed to copy topic prompt:",u)}finally{Ct.value=!1}}function Oa(){s.history.length!==0&&confirm(`Bersihkan semua ${s.history.length} riwayat generate otomatis?`)&&i("clearAllHistory")}function Na(u){if(!u)return"";try{return new Date(u).toLocaleDateString("id-ID",{day:"numeric",month:"short",hour:"2-digit",minute:"2-digit"})}catch{return""}}return(u,a)=>(p(),m("div",Os,[o(V)?(p(),m("div",Ns,[t("div",Is,[t("div",Ms,[t("div",null,[t("h3",$s,[k(o(Ea),{class:"w-4 h-4 text-sky-400"}),a[85]||(a[85]=z(" Kelola & Buat Niche Baru ",-1))]),a[86]||(a[86]=t("p",{class:"text-[11px] text-slate-400 mt-0.5"}," Simpan niche favoritmu. AI dan Prompt Generator akan otomatis menggunakannya. ",-1))]),t("button",{onClick:a[0]||(a[0]=r=>V.value=!1),class:"p-1 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800"},[k(o(ta),{class:"w-4 h-4"})])]),t("div",Ds,[t("div",js,[t("span",null,x(o(D)?"✏️ Edit Niche":"➕ Tambah Niche Baru"),1),o(D)?(p(),m("button",{key:0,onClick:a[1]||(a[1]=r=>{D.value=null,J.value={id:"",name:"",theme:"blue-tech",description:""}}),class:"text-[10px] text-slate-400 hover:text-white"}," Batal Edit ")):I("",!0)]),t("div",Es,[t("div",null,[a[87]||(a[87]=t("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Nama Niche",-1)),ce(t("input",{"onUpdate:modelValue":a[2]||(a[2]=r=>o(J).name=r),type:"text",placeholder:"Contoh: Kuliner & Restoran, Otomotif EV",class:"w-full bg-slate-900 border border-slate-800 rounded-xl px-2.5 py-1.5 text-xs text-white focus:outline-none focus:border-sky-500"},null,512),[[Oe,o(J).name]])]),t("div",null,[a[89]||(a[89]=t("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Tema Default",-1)),ce(t("select",{"onUpdate:modelValue":a[3]||(a[3]=r=>o(J).theme=r),class:"w-full bg-slate-900 border border-slate-800 rounded-xl px-2.5 py-1.5 text-xs text-white focus:outline-none focus:border-sky-500"},[...a[88]||(a[88]=[Ot('<option value="blue-tech">🔵 Blue Tech</option><option value="emerald-finance">🟢 Emerald Finance</option><option value="slate-education">🟣 Slate Education</option><option value="dark-contrast">⚫ Dark Contrast</option><option value="crimson-alert">🔴 Crimson Alert</option><option value="amber-gold">🟡 Amber Gold</option><option value="cyber-violet">🟪 Cyber Violet</option><option value="sunset-orange">🟠 Sunset Orange</option><option value="nordic-frost">❄️ Nordic Frost</option><option value="monochrome-luxe">⚪ Monochrome Luxe</option>',10)])],512),[[st,o(J).theme]])])]),t("div",null,[a[90]||(a[90]=t("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Fokus Topik & Instruksi Prompt",-1)),ce(t("textarea",{"onUpdate:modelValue":a[4]||(a[4]=r=>o(J).description=r),rows:"2",placeholder:"Jelaskan topik yang ingin disorot AI (misal: perbandingan harga kopi, biaya buka gerai, margin laba kuliner...)",class:"w-full bg-slate-900 border border-slate-800 rounded-xl p-2 text-xs text-slate-200 focus:outline-none focus:border-sky-500 resize-none leading-relaxed"},null,512),[[Oe,o(J).description]])]),t("button",{onClick:ve,class:"self-end px-4 py-1.5 rounded-xl bg-sky-600 hover:bg-sky-500 text-white font-bold text-xs transition flex items-center gap-1.5 shadow"},[k(o(qe),{class:"w-3.5 h-3.5"}),t("span",null,x(o(D)?"Perbarui Niche":"Simpan Niche"),1)])]),t("div",Rs,[t("div",Ps," Daftar Niche Tersimpan ("+x(o(pe).length)+") ",1),t("div",Ls,[(p(!0),m(xe,null,he(o(pe),r=>(p(),m("div",{key:r.id,class:"p-2.5 rounded-xl border bg-slate-950 border-slate-800 flex items-start justify-between gap-2"},[t("div",Vs,[t("div",Bs,[t("span",Js,x(r.name),1),t("span",Fs,x(r.theme||"blue-tech"),1)]),t("p",Hs,x(r.description),1)]),t("div",Zs,[t("button",{onClick:y=>$e(r),class:"p-1.5 rounded-lg text-slate-400 hover:text-sky-300 hover:bg-slate-800 transition",title:"Edit Niche"},[k(o(It),{class:"w-3.5 h-3.5"})],8,Us),t("button",{onClick:y=>Y(r.id),class:"p-1.5 rounded-lg text-slate-400 hover:text-rose-400 hover:bg-slate-800 transition",title:"Hapus Niche"},[k(o(nt),{class:"w-3.5 h-3.5"})],8,zs)])]))),128))])])])])):I("",!0),o(b)?(p(),m("div",Gs,[t("div",Ks,[t("div",Ws,[t("div",null,[t("h3",qs,[k(o(ea),{class:"w-4 h-4 text-purple-400"}),a[91]||(a[91]=z(" Master Prompt AI (Dynamic Research & Zero-Collision) ",-1))]),a[92]||(a[92]=t("p",{class:"text-[11px] text-slate-400 mt-0.5"}," Salin prompt ini ke ChatGPT / Gemini / Claude / DeepSeek untuk mencari topik terbaru. ",-1))]),t("button",{onClick:a[5]||(a[5]=r=>b.value=!1),class:"p-1 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800"},[k(o(ta),{class:"w-4 h-4"})])]),t("div",Ys,[a[93]||(a[93]=t("span",{class:"font-bold text-sky-400"},"Niche Aktif:",-1)),t("span",Xs,x(o(pe).find(r=>r.id===o(W))?.name||"Default"),1),a[94]||(a[94]=t("span",{class:"text-slate-500"},"•",-1)),a[95]||(a[95]=t("span",{class:"font-bold text-amber-400"},"Template:",-1)),t("span",Qs,x(o(le).template||"Otomatis"),1),a[96]||(a[96]=t("span",{class:"text-slate-500"},"•",-1)),a[97]||(a[97]=t("span",{class:"font-bold text-emerald-400"},"Bahasa:",-1)),t("span",en,x(o(le).language||"Bahasa Indonesia 🇮🇩"),1),a[98]||(a[98]=t("span",{class:"text-slate-500"},"•",-1)),t("span",tn,x(o(le).usedCount||0)+" Topik Riwayat Dikecualikan",1)]),t("div",an,[t("textarea",{value:o(ye),readonly:"",rows:"12",class:"w-full h-full bg-slate-950 text-slate-300 font-mono text-[11px] p-3 rounded-xl border border-slate-800 focus:outline-none resize-none leading-relaxed select-all"},null,8,sn)]),t("div",nn,[a[99]||(a[99]=t("span",{class:"text-[11px] text-slate-400"},[z(" Paste hasil JSON yang kamu buat ke kolom "),t("b",null,"RAW JSON"),z(" SocialGen. ")],-1)),t("button",{onClick:ds,class:"px-5 py-2.5 rounded-xl font-bold bg-gradient-to-r from-purple-600 to-indigo-600 hover:from-purple-500 hover:to-indigo-500 text-white shadow-lg flex items-center gap-2 transition"},[o(_t)?(p(),Ne(o(qe),{key:0,class:"w-4 h-4 text-emerald-400"})):(p(),Ne(o(He),{key:1,class:"w-4 h-4"})),t("span",null,x(o(_t)?"Prompt Berhasil Disalin!":"Copy Master Prompt"),1)])])])])):I("",!0),o(we)?(p(),m("div",{key:2,onClick:mt(Me,["self"]),class:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm flex items-center justify-center p-4"},[t("div",on,[t("div",ln,[t("div",null,[t("h3",rn,[k(o(Da),{class:"w-4 h-4 text-sky-400"}),a[100]||(a[100]=z(" Kelola Template Visual (Dynamic Template System) ",-1))]),a[101]||(a[101]=t("p",{class:"text-[11px] text-slate-400 mt-0.5"}," Buat format baru, edit sampel tampilan, dan atur prompt AI spesifik per template. ",-1))]),t("button",{onClick:Me,class:"p-1 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800"},[k(o(ta),{class:"w-4 h-4"})])]),t("div",dn,[t("div",un,[t("button",{onClick:Q,class:j(["px-3 py-1 rounded-lg transition font-bold text-xs",o(oe)==="list"?"bg-slate-800 text-sky-400 shadow":"text-slate-400 hover:text-white"])}," Daftar Template ("+x(o(q).length)+") ",3),t("button",{onClick:h,class:j(["px-3 py-1 rounded-lg transition font-bold text-xs flex items-center gap-1",o(oe)==="form"&&!o(X)?"bg-slate-800 text-emerald-400 shadow":"text-slate-400 hover:text-white"])},[k(o(xt),{class:"w-3.5 h-3.5"}),a[102]||(a[102]=t("span",null,"Buat Template Baru",-1))],2),o(X)&&o(oe)==="form"?(p(),m("span",cn,[k(o(It),{class:"w-3 h-3"}),a[103]||(a[103]=t("span",null,"Sedang Edit Template",-1))])):I("",!0)]),o(oe)==="list"?ce((p(),m("input",{key:0,"onUpdate:modelValue":a[6]||(a[6]=r=>Ee(te)?te.value=r:null),type:"text",placeholder:"Cari template...",class:"bg-slate-900 border border-slate-800 rounded-lg px-2 py-0.5 text-[11px] text-white focus:outline-none focus:border-sky-500 w-36"},null,512)),[[Oe,o(te)]]):I("",!0)]),o(oe)==="list"?(p(),m("div",pn,[o(T).length===0?(p(),m("div",fn,' Tidak ada template yang cocok dengan pencarian "'+x(o(te))+'". ',1)):I("",!0),(p(!0),m(xe,null,he(o(T),r=>(p(),m("div",{key:r.id,class:"p-3 rounded-2xl border bg-slate-950 border-slate-800/80 hover:border-slate-700 transition flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 group"},[t("div",mn,[t("div",xn,[t("span",hn,x(r.name),1),t("span",bn,x(r.category),1),t("span",{class:j(["px-1.5 py-0.2 rounded text-[8px] font-bold uppercase tracking-wider",r.isBuiltin?"bg-slate-800 text-slate-400 border border-slate-700":"bg-purple-950 text-purple-300 border border-purple-800"])},x(r.isBuiltin?"Bawaan":"⭐ Kustom"),3),t("span",gn," layout: "+x(r.layoutType),1)]),t("p",vn,x(r.description||"Tidak ada deskripsi."),1)]),t("div",yn,[t("button",{onClick:y=>Jt(r),class:"px-2.5 py-1 rounded-xl bg-sky-600/20 hover:bg-sky-600/40 text-sky-300 border border-sky-500/40 font-bold text-[10px] transition flex items-center gap-1",title:"Pilih dan gunakan format template ini"},[k(o(qe),{class:"w-3 h-3"}),a[104]||(a[104]=t("span",null,"Pilih Format",-1))],8,kn),t("button",{onClick:y=>Xe(r),class:"p-1.5 rounded-lg text-slate-400 hover:text-sky-300 hover:bg-slate-800 transition",title:"Duplikasi sebagai template kustom baru"},[k(o(He),{class:"w-3.5 h-3.5"})],8,wn),r.isBuiltin?I("",!0):(p(),m("button",{key:0,onClick:y=>Lt(r),class:"p-1.5 rounded-lg text-slate-400 hover:text-amber-300 hover:bg-slate-800 transition",title:"Edit template kustom"},[k(o(It),{class:"w-3.5 h-3.5"})],8,_n)),r.isBuiltin?I("",!0):(p(),m("button",{key:1,onClick:y=>wt(r.id),class:"p-1.5 rounded-lg text-slate-400 hover:text-rose-400 hover:bg-slate-800 transition",title:"Hapus template kustom"},[k(o(nt),{class:"w-3.5 h-3.5"})],8,Sn))])]))),128))])):(p(),m("div",Tn,[o(U)?(p(),m("div",Cn,x(o(U)),1)):I("",!0),o(X)?(p(),m("div",An,[t("div",On,[t("div",Nn,[k(o(It),{class:"w-4 h-4"})]),t("div",In,[t("div",Mn,[a[105]||(a[105]=t("span",null,"Sedang Mengedit:",-1)),t("span",$n,x(o(N).name),1)]),t("div",Dn,"ID: "+x(o(N).id)+" • Perubahan akan memperbarui template yang tersimpan",1)])]),t("button",{onClick:h,type:"button",class:"px-2.5 py-1 rounded-xl bg-slate-900 hover:bg-slate-800 text-slate-200 border border-slate-700 text-[10px] font-bold transition flex items-center gap-1 shrink-0 ml-2"},[k(o(xt),{class:"w-3 h-3"}),a[106]||(a[106]=t("span",null,"Beralih ke Buat Baru",-1))])])):I("",!0),t("div",jn,[t("div",En,[a[108]||(a[108]=t("div",{class:"flex items-center gap-2"},[t("span",{class:"text-xl"},"🤖"),t("div",null,[t("h4",{class:"text-xs font-black text-white"},"Buat Template Otomatis dari Screenshot / Gambar"),t("p",{class:"text-[10px] text-slate-400"},"Punya referensi gambar desain? Salin prompt AI dan kirim bersama screenshot ke ChatGPT / Claude / Gemini.")])],-1)),t("div",Rn,[t("button",{onClick:Qe,type:"button",class:j(["px-2.5 py-1.5 rounded-xl text-xs font-bold transition flex items-center gap-1.5 shadow",o(ge)?"bg-emerald-600 text-white":"bg-sky-600 hover:bg-sky-500 text-white"])},[k(o(He),{class:"w-3.5 h-3.5"}),t("span",null,x(o(ge)?"✓ Prompt Tersalin!":"Salin Prompt Bantuan AI"),1)],2),t("button",{onClick:a[7]||(a[7]=r=>_e.value=!o(_e)),type:"button",class:"px-2 py-1.5 rounded-xl bg-slate-800 hover:bg-slate-700 text-slate-200 text-xs font-bold transition flex items-center gap-1",title:o(_e)?"Sembunyikan teks prompt":"Lihat / salin teks prompt manual di HP"},[t("span",null,x(o(_e)?"Tutup Teks":"👁️ Lihat Teks Prompt"),1)],8,Pn),t("button",{onClick:a[8]||(a[8]=r=>ae.value=!o(ae)),type:"button",class:"px-2.5 py-1.5 rounded-xl bg-slate-800 hover:bg-slate-700 text-slate-200 text-xs font-bold transition flex items-center gap-1"},[...a[107]||(a[107]=[t("span",null,"📥 Tempel JSON",-1)])])])]),o(_e)?(p(),m("div",Ln,[t("div",Vn,[a[109]||(a[109]=t("label",{class:"text-[10px] font-bold text-sky-400"},"Teks Lengkap Prompt Bantuan AI (Bisa ditandai/disalin manual di HP):",-1)),t("button",{onClick:a[9]||(a[9]=r=>_e.value=!1),class:"text-[10px] text-slate-400 hover:text-white"},"✕ Tutup")]),t("textarea",{value:o(pt),readonly:"",rows:"6",class:"w-full bg-slate-900 border border-slate-700 rounded-lg p-2 text-[11px] text-sky-200 font-mono select-all focus:outline-none focus:border-sky-500 custom-scrollbar"},null,8,Bn)])):I("",!0),o(ae)?(p(),m("div",Jn,[a[110]||(a[110]=t("label",{class:"text-[10px] font-bold text-sky-400"},"Tempelkan respon JSON dari AI di sini:",-1)),ce(t("textarea",{"onUpdate:modelValue":a[10]||(a[10]=r=>Ee(se)?se.value=r:null),rows:"4",placeholder:'Tempelkan respon JSON dari AI di sini (contoh: { "name": "...", "layoutType": "custom", "customHtml": "...", "sampleData": {...} })...',class:"w-full bg-slate-900 border border-slate-700 rounded-lg p-2 text-xs text-sky-200 font-mono focus:outline-none focus:border-sky-500"},null,512),[[Oe,o(se)]]),t("div",Fn,[t("button",{onClick:a[11]||(a[11]=r=>ae.value=!1),type:"button",class:"px-2.5 py-1 rounded-lg text-[10px] font-bold text-slate-400 hover:text-white"}," Tutup "),t("button",{onClick:Vt,type:"button",class:"px-3 py-1 rounded-lg bg-emerald-600 hover:bg-emerald-500 text-white text-[10px] font-bold shadow"}," Terapkan ke Form Otomatis ")])])):I("",!0)]),t("div",Hn,[t("div",null,[a[111]||(a[111]=t("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"ID Template (Slug Unik)",-1)),ce(t("input",{"onUpdate:modelValue":a[12]||(a[12]=r=>o(N).id=r),disabled:!!o(X),type:"text",placeholder:"misal: tech-radar, crypto-card",class:"w-full bg-slate-950 border border-slate-800 rounded-xl px-2.5 py-1.5 text-xs text-white focus:outline-none focus:border-sky-500 disabled:opacity-50"},null,8,Zn),[[Oe,o(N).id]])]),t("div",null,[a[112]||(a[112]=t("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Nama Template",-1)),ce(t("input",{"onUpdate:modelValue":a[13]||(a[13]=r=>o(N).name=r),type:"text",placeholder:"misal: ⚡ Tech Radar 2026",class:"w-full bg-slate-950 border border-slate-800 rounded-xl px-2.5 py-1.5 text-xs text-white focus:outline-none focus:border-sky-500"},null,512),[[Oe,o(N).name]])]),t("div",null,[a[113]||(a[113]=t("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Kategori",-1)),ce(t("input",{"onUpdate:modelValue":a[14]||(a[14]=r=>o(N).category=r),type:"text",placeholder:"misal: Perbandingan, Peringkat, Finansial",class:"w-full bg-slate-950 border border-slate-800 rounded-xl px-2.5 py-1.5 text-xs text-white focus:outline-none focus:border-sky-500"},null,512),[[Oe,o(N).category]])])]),t("div",Un,[t("div",null,[a[115]||(a[115]=t("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Base Layout Visual Engine",-1)),t("select",{value:o(N).layoutType,onChange:a[15]||(a[15]=r=>Je(r.target.value)),class:"w-full bg-slate-950 border border-slate-800 rounded-xl px-2.5 py-1.5 text-xs text-sky-300 font-semibold focus:outline-none focus:border-sky-500"},[...a[114]||(a[114]=[Ot('<option value="custom">🎨 Custom HTML &amp; CSS (Bebas / Desain Sendiri)</option><option value="table">📊 Comparison Table</option><option value="versus">⚔️ Versus Showdown Arena</option><option value="receipt">🧾 Monthly Living Invoice</option><option value="news">📰 Special Report Pamphlet</option><option value="stat">🎯 Big Shocking Number</option><option value="timeline">⏳ 10-Year Shift (Then vs Now)</option><option value="barchart">📈 Income Allocation Bars</option><option value="list">🏆 Top 5 Ranked List</option><option value="quote">💬 Hot Take / Quote Debate</option><option value="leaderboard">🥇 Multi-Country Leaderboard (Top 10)</option><option value="editorial">📰 Editorial Storytelling Deep Dive</option><option value="matrix">📊 Multi-Column Matrix (3-4 Negara)</option><option value="debate">⚡ Debate Arena (Pro vs Kontra)</option><option value="tierlist">🎖️ Tier List Ranking (S, A, B, C)</option>',15)])],40,zn)]),t("div",null,[a[116]||(a[116]=t("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Deskripsi Ringkas",-1)),ce(t("input",{"onUpdate:modelValue":a[16]||(a[16]=r=>o(N).description=r),type:"text",placeholder:"Jelaskan kegunaan format tampilan template ini...",class:"w-full bg-slate-950 border border-slate-800 rounded-xl px-2.5 py-1.5 text-xs text-white focus:outline-none focus:border-sky-500"},null,512),[[Oe,o(N).description]])])]),o(N).layoutType==="custom"?(p(),m("div",Gn,[t("div",Kn,[t("span",Wn,[k(o(Qt),{class:"w-3.5 h-3.5"}),a[117]||(a[117]=z(" Template Engine HTML & Styling CSS ",-1))]),a[118]||(a[118]=t("span",{class:"text-[10px] text-slate-400 font-mono"},"Gunakan {{ data.title }} & {{#each data.items}}",-1))]),t("div",null,[a[119]||(a[119]=t("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"HTML Template (Tailwind utility classes didukung penuh)",-1)),ce(t("textarea",{"onUpdate:modelValue":a[17]||(a[17]=r=>o(N).customHtml=r),rows:"6",placeholder:`<div class="p-6 rounded-2xl bg-slate-900/90 border border-slate-700 text-center">
108
+ <h2 class="text-3xl font-black text-white">{{ data.title }}</h2>
109
+ <p class="text-slate-300">{{ data.subtitle }}</p>
110
+ </div>`,class:"w-full bg-slate-900 border border-slate-800 rounded-xl p-2.5 text-xs text-sky-300 font-mono leading-relaxed focus:outline-none focus:border-sky-500"},null,512),[[Oe,o(N).customHtml]])]),t("div",null,[a[120]||(a[120]=t("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Custom CSS (Opsional - animasi, gradien unik, glassmorphism)",-1)),ce(t("textarea",{"onUpdate:modelValue":a[18]||(a[18]=r=>o(N).customCss=r),rows:"3",placeholder:".my-custom-card { backdrop-filter: blur(16px); }",class:"w-full bg-slate-900 border border-slate-800 rounded-xl p-2.5 text-xs text-emerald-300 font-mono leading-relaxed focus:outline-none focus:border-emerald-500"},null,512),[[Oe,o(N).customCss]])])])):I("",!0),t("div",null,[a[121]||(a[121]=t("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"AI Prompt Directive (Aturan Khusus Generator)",-1)),ce(t("textarea",{"onUpdate:modelValue":a[19]||(a[19]=r=>o(N).promptDirective=r),rows:"3",placeholder:"Instruksi spesifik untuk AI Gemini / ChatGPT saat meriset konten dengan template ini...",class:"w-full bg-slate-950 border border-slate-800 rounded-xl p-2.5 text-xs text-slate-200 focus:outline-none focus:border-sky-500 font-mono leading-relaxed"},null,512),[[Oe,o(N).promptDirective]])]),t("div",null,[a[122]||(a[122]=t("div",{class:"flex items-center justify-between mb-1"},[t("label",{class:"text-[10px] font-bold text-slate-400"},"Sampel Data JSON (Pristine Default Tampilan)"),t("span",{class:"text-[10px] text-slate-500"},"Akan langsung ditampilkan di Live Preview")],-1)),ce(t("textarea",{"onUpdate:modelValue":a[20]||(a[20]=r=>o(N).sampleJsonText=r),rows:"7",class:"w-full bg-slate-950 border border-slate-800 rounded-xl p-2.5 text-xs text-sky-200 focus:outline-none focus:border-sky-500 font-mono leading-relaxed select-all"},null,512),[[Oe,o(N).sampleJsonText]])]),t("div",qn,[t("button",{onClick:Q,class:"px-3.5 py-1.5 rounded-xl bg-slate-800 hover:bg-slate-700 text-slate-300 font-bold text-xs transition"}," Batal "),t("button",{onClick:Bt,class:"px-5 py-1.5 rounded-xl bg-gradient-to-r from-emerald-600 to-teal-600 hover:from-emerald-500 hover:to-teal-500 text-white font-bold text-xs shadow-lg transition flex items-center gap-1.5"},[k(o(qe),{class:"w-3.5 h-3.5"}),t("span",null,x(o(X)?"Perbarui Template":"Simpan Template"),1)])])]))])])):I("",!0),t("div",Yn,[t("div",Xn,[t("div",Qn,[t("button",{onClick:a[21]||(a[21]=r=>Se.value="content"),type:"button",class:j(["px-2.5 py-1.5 rounded-xl text-xs font-bold flex items-center gap-1 shrink-0 transition",o(Se)==="content"?"bg-sky-500 text-white shadow font-black":"text-slate-400 hover:text-white"])},[...a[123]||(a[123]=[t("span",null,"📝 Konten",-1)])],2),t("button",{onClick:a[22]||(a[22]=r=>Se.value="design"),type:"button",class:j(["px-2.5 py-1.5 rounded-xl text-xs font-bold flex items-center gap-1 shrink-0 transition",o(Se)==="design"?"bg-sky-500 text-white shadow font-black":"text-slate-400 hover:text-white"])},[...a[124]||(a[124]=[t("span",null,"🎨 Template",-1)])],2),t("button",{onClick:a[23]||(a[23]=r=>Se.value="media"),type:"button",class:j(["px-2.5 py-1.5 rounded-xl text-xs font-bold flex items-center gap-1 shrink-0 transition",o(Se)==="media"?"bg-sky-500 text-white shadow font-black":"text-slate-400 hover:text-white"])},[...a[125]||(a[125]=[t("span",null,"🎬 Media",-1)])],2),t("button",{onClick:a[24]||(a[24]=r=>Se.value="ai"),type:"button",class:j(["px-2.5 py-1.5 rounded-xl text-xs font-bold flex items-center gap-1 shrink-0 transition",o(Se)==="ai"?"bg-sky-500 text-white shadow font-black":"text-slate-400 hover:text-white"])},[...a[126]||(a[126]=[t("span",null,"⚡ AI Topic",-1)])],2),t("button",{onClick:a[25]||(a[25]=r=>Se.value="history"),type:"button",class:j(["px-2.5 py-1.5 rounded-xl text-xs font-bold flex items-center gap-1 shrink-0 transition",o(Se)==="history"?"bg-sky-500 text-white shadow font-black":"text-slate-400 hover:text-white"])},[...a[127]||(a[127]=[t("span",null,"💾 Draft",-1)])],2)]),t("button",{onClick:a[26]||(a[26]=r=>ft.value=!0),type:"button",class:"px-2 py-1.5 rounded-xl bg-slate-800 hover:bg-slate-700 text-[10px] font-mono font-bold text-sky-300 border border-slate-700 flex items-center gap-0.5 shrink-0 ml-1",title:"Buka RAW JSON Editor"},[...a[128]||(a[128]=[t("span",null,"</> JSON",-1)])])]),o(Se)==="content"?(p(),m("div",eo,[o(c)||n.validationError||o(K)?(p(),m("div",{key:0,class:j(["p-3.5 rounded-2xl border text-xs shadow-lg space-y-2.5 animate-in fade-in",o(c)||n.validationError?"bg-rose-950/80 border-rose-500/60 text-rose-200":"bg-amber-950/80 border-amber-500/60 text-amber-200"])},[t("div",to,[k(o(Ma),{class:j(["w-4 h-4 shrink-0 mt-0.5",o(c)||n.validationError?"text-rose-400":"text-amber-400"])},null,8,["class"]),t("div",ao,[t("div",so,x(o(c)?"Sintaks JSON Tidak Valid":o(K)?"Perbedaan Format Template":"Data Belum Sesuai Template"),1),t("p",no,[o(c)?(p(),m("span",oo,x(o(c)),1)):o(K)?(p(),m("span",io,[a[129]||(a[129]=z(" Data JSON saat ini dibuat untuk template ",-1)),t("b",lo,x(o(K).matchedTarget?.name||o(K).jsonTemplateId),1),a[130]||(a[130]=z(", sedangkan template aktif saat ini adalah ",-1)),t("b",ro,x(o(ue).name),1),a[131]||(a[131]=z(". ",-1))])):(p(),m("span",uo,x(n.validationError),1))])])]),t("div",co,[t("button",{onClick:Wt,type:"button",class:"px-3 py-1.5 rounded-xl bg-white text-slate-950 text-xs font-black shadow transition active:scale-95 flex items-center gap-1.5"},[k(o(ja),{class:"w-3.5 h-3.5"}),t("span",null,"Pakai Sampel "+x(o(ue).name),1)]),o(K)?.isKnown&&o(K).matchedTarget?(p(),m("button",{key:0,onClick:a[27]||(a[27]=r=>et(o(K).matchedTarget.id)),type:"button",class:"px-2.5 py-1.5 rounded-xl bg-amber-500/20 hover:bg-amber-500/40 text-amber-300 border border-amber-500/40 text-xs font-bold transition flex items-center gap-1 active:scale-95"},[t("span",null,"Beralih ke "+x(o(K).matchedTarget.name),1)])):I("",!0),t("button",{onClick:a[28]||(a[28]=r=>ft.value=!0),type:"button",class:"px-2.5 py-1.5 rounded-xl bg-slate-800 text-slate-200 text-xs font-bold border border-slate-700 transition ml-auto active:scale-95"},[...a[132]||(a[132]=[t("span",null,"</> Buka JSON",-1)])])])],2)):(p(),m("div",po,[t("div",fo,[a[133]||(a[133]=t("span",{class:"w-2 h-2 rounded-full bg-emerald-400 shrink-0"},null,-1)),a[134]||(a[134]=t("span",{class:"text-slate-400"},"Template Aktif:",-1)),t("span",mo,x(o(ue).name),1)]),t("button",{onClick:Wt,type:"button",class:"text-[10px] text-sky-400 hover:text-sky-300 font-bold shrink-0 ml-2 transition",title:"Muat ulang sampel data template aktif"}," Reset ke Sampel ")])),t("div",xo,[a[135]||(a[135]=t("div",{class:"flex items-center justify-between"},[t("label",{class:"text-xs font-extrabold text-white flex items-center gap-1.5"},[t("span",null,"Judul Utama (Title)")]),t("span",{class:"text-[9px] text-sky-400 font-bold uppercase tracking-wider"},"Wajib")],-1)),t("input",{type:"text",value:n.modelValue.title,onInput:a[29]||(a[29]=r=>wa(r.target.value)),placeholder:"Judul Utama Konten...",class:"w-full bg-slate-950 border border-slate-800 rounded-xl px-3 py-2 text-xs text-white font-bold focus:outline-none focus:border-sky-500 transition"},null,40,ho)]),t("div",bo,[a[136]||(a[136]=t("label",{class:"text-xs font-bold text-slate-300"},"Subtitle / Penjelasan Ringkas",-1)),t("textarea",{value:n.modelValue.subtitle||"",onInput:a[30]||(a[30]=r=>ss(r.target.value)),rows:"2",placeholder:"Ringkasan atau penjelas judul...",class:"w-full bg-slate-950 border border-slate-800 rounded-xl p-2.5 text-xs text-slate-200 focus:outline-none focus:border-sky-500 transition resize-none leading-relaxed"},null,40,go)]),t("div",vo,[t("div",yo,[a[137]||(a[137]=t("label",{class:"text-[11px] font-bold text-slate-400"},"Watermark Handle",-1)),t("input",{type:"text",value:n.modelValue.watermark||"@SocialGen",onInput:a[31]||(a[31]=r=>_a(r.target.value)),placeholder:"@NamaAkun",class:"w-full bg-slate-950 border border-slate-800 rounded-xl px-2.5 py-1.5 text-sky-400 font-bold text-xs focus:outline-none focus:border-sky-500"},null,40,ko)]),t("div",wo,[a[138]||(a[138]=t("label",{class:"text-[11px] font-bold text-slate-400"},"Sumber (Footer Note)",-1)),t("input",{type:"text",value:n.modelValue.footerNote||"",onInput:a[32]||(a[32]=r=>ns(r.target.value)),placeholder:"Source: Data Wire 2026...",class:"w-full bg-slate-950 border border-slate-800 rounded-xl px-2.5 py-1.5 text-slate-300 text-xs focus:outline-none focus:border-sky-500"},null,40,_o)])]),t("div",So,[t("div",To,[a[140]||(a[140]=t("span",{class:"text-xs font-bold text-slate-300"},"Viral Caption & Hashtags",-1)),t("button",{onClick:a[33]||(a[33]=async()=>{n.modelValue.caption&&(await o(bt)(n.modelValue.caption),i("toast","Caption berhasil disalin!","success"))}),type:"button",class:"text-[11px] font-bold text-sky-400 hover:text-sky-300 flex items-center gap-1 active:scale-95 transition"},[k(o(He),{class:"w-3 h-3"}),a[139]||(a[139]=t("span",null,"Salin Caption",-1))])]),t("textarea",{value:n.modelValue.caption||"",onInput:a[34]||(a[34]=r=>os(r.target.value)),rows:"3",placeholder:"Tulis caption reels / post di sini...",class:"w-full bg-slate-950 border border-slate-800 rounded-xl p-2.5 text-xs text-slate-200 focus:outline-none focus:border-sky-500 leading-relaxed resize-none"},null,40,Co)])])):o(Se)==="design"?(p(),m("div",Ao,[t("div",Oo,[t("div",No,[t("div",null,[t("span",Io,"Pilih Format Template ("+x(o(q).length)+")",1),a[141]||(a[141]=t("p",{class:"text-[10px] text-slate-400"},"Geser ke kanan untuk melihat semua format",-1))]),t("button",{onClick:a[35]||(a[35]=r=>$("list")),type:"button",class:"text-[10px] font-bold text-sky-400 hover:text-sky-300 flex items-center gap-1 bg-slate-800 px-2 py-1 rounded-lg border border-slate-700"},[k(o(Ea),{class:"w-3 h-3"}),a[142]||(a[142]=t("span",null,"Kelola",-1))])]),o(K)||n.validationError||o(c)?(p(),m("div",Mo,[t("div",$o,[a[144]||(a[144]=t("span",{class:"text-sm"},"⚠️",-1)),t("span",Do,[o(K)?(p(),m("span",jo,[a[143]||(a[143]=z("Format JSON milik: ",-1)),t("b",null,x(o(K).matchedTarget?.name||o(K).jsonTemplateId),1)])):o(c)?(p(),m("span",Eo,"Sintaks JSON tidak valid")):(p(),m("span",Ro,x(n.validationError),1))])]),t("button",{onClick:Wt,type:"button",class:"px-2.5 py-1 rounded-lg bg-amber-500 text-slate-950 font-black text-[10px] shrink-0 active:scale-95 shadow ml-2"}," Pakai Sampel ")])):I("",!0),t("div",Po,[(p(!0),m(xe,null,he(o(q),r=>(p(),m("button",{key:r.id,onClick:y=>et(r.id),type:"button",class:j(["shrink-0 w-28 p-2.5 rounded-2xl border text-center flex flex-col items-center gap-1.5 transition active:scale-95",o(d)===r.id?"bg-slate-950 border-sky-500 shadow-lg shadow-sky-500/20":"bg-slate-950/70 border-slate-800 hover:border-slate-700"])},[t("div",Vo,x(ls(r.layoutType,r.id)),1),t("span",Bo,x(r.name),1),t("span",{class:j(["text-[8px] font-bold px-1.5 py-0.2 rounded uppercase tracking-wider",r.isBuiltin?"bg-slate-800 text-slate-400":"bg-purple-950 text-purple-300 border border-purple-800"])},x(r.isBuiltin?r.category:"⭐ Kustom"),3)],10,Lo))),128))])]),t("div",Jo,[t("div",Fo,[a[145]||(a[145]=t("span",{class:"text-xs font-extrabold text-white"},"Tema Warna (Visual Swatches)",-1)),t("span",Ho,x(n.modelValue.theme||"blue-tech"),1)]),t("div",Zo,[(p(),m(xe,null,he(is,r=>t("button",{key:r.id,onClick:y=>Sa(r.id),type:"button",class:"flex flex-col items-center gap-1 p-1 rounded-xl transition",title:r.name},[t("div",{class:j(["w-8 h-8 rounded-full border-2 transition transform active:scale-90",n.modelValue.theme===r.id?"ring-2 ring-white ring-offset-2 ring-offset-slate-950 scale-105":"border-white/10 hover:border-white/40"]),style:vt({backgroundColor:r.color})},null,6),t("span",zo,x(r.name.split(" ")[0]),1)],8,Uo)),64))]),t("div",Go,[t("div",Ko,[t("div",{class:"relative w-7 h-7 rounded-lg overflow-hidden border border-white/20 shadow-inner flex items-center justify-center cursor-pointer",style:vt({backgroundColor:o(tt)})},[t("input",{type:"color",value:o(tt),onInput:a[36]||(a[36]=r=>Tt(r.target.value)),class:"absolute inset-0 opacity-0 w-full h-full cursor-pointer",title:"Pilih warna aksen kustom"},null,40,Wo)],4),a[146]||(a[146]=t("div",{class:"flex flex-col"},[t("span",{class:"text-[11px] font-bold text-slate-200"},"Warna Aksen Kustom"),t("span",{class:"text-[9px] text-slate-400"},"Color picker kanvas dinamis")],-1))]),t("div",qo,[a[147]||(a[147]=t("span",{class:"text-[10px] font-mono text-slate-400"},"HEX",-1)),t("input",{type:"text",value:o(tt),onInput:a[37]||(a[37]=r=>Tt(r.target.value)),class:"w-20 bg-slate-950 border border-slate-800 rounded-lg px-2 py-1 text-center font-mono text-[11px] text-sky-400 font-bold focus:outline-none focus:border-sky-500 uppercase",placeholder:"#0284C7"},null,40,Yo)])])]),t("div",Xo,[t("div",Qo,[a[149]||(a[149]=t("div",{class:"flex flex-col"},[t("span",{class:"text-xs font-bold text-white"},"Buat Template Kustom"),t("span",{class:"text-[10px] text-slate-400"},"Punya referensi kartu baru? Tambahkan ke sistem.")],-1)),t("button",{onClick:h,type:"button",class:"px-3 py-1.5 rounded-xl bg-gradient-to-r from-sky-600 to-indigo-600 hover:from-sky-500 text-white text-xs font-bold shadow flex items-center gap-1.5 active:scale-95 transition"},[k(o(xt),{class:"w-3.5 h-3.5"}),a[148]||(a[148]=t("span",null,"+ Buat Template",-1))])]),t("div",ei,[a[150]||(a[150]=t("span",{class:"text-[10px] text-slate-400 flex items-center gap-1"},[t("span",null,"🤖 Prompt AI Buat Template")],-1)),t("div",ti,[t("button",{onClick:Qe,type:"button",class:"px-2.5 py-1 rounded-lg bg-sky-600/20 hover:bg-sky-600/40 text-sky-300 text-[10px] font-bold border border-sky-500/30 flex items-center gap-1 transition active:scale-95"},[k(o(He),{class:"w-3 h-3"}),t("span",null,x(o(ge)?"✓ Tersalin":"Salin Prompt"),1)]),t("button",{onClick:a[38]||(a[38]=r=>_e.value=!o(_e)),type:"button",class:"px-2 py-1 rounded-lg bg-slate-800 text-slate-300 text-[10px] font-bold border border-slate-700"},[t("span",null,x(o(_e)?"Tutup":"Lihat"),1)])])]),o(_e)?(p(),m("div",ai,[a[151]||(a[151]=t("p",{class:"text-[9px] text-slate-400 mb-1"},"Kirim prompt ini bersama screenshot kartu ke ChatGPT / Gemini / Claude untuk menghasilkan HTML & CSS template:",-1)),t("textarea",{value:o(pt),readonly:"",rows:"5",class:"w-full bg-slate-900 border border-slate-700 rounded-lg p-2 text-[10px] text-sky-200 font-mono select-all focus:outline-none custom-scrollbar"},null,8,si)])):I("",!0)])])):o(Se)==="media"?(p(),m("div",ni,[t("div",oi,[t("div",ii,[t("label",li,[k(o(na),{class:"w-4 h-4"}),a[152]||(a[152]=t("span",null,"Background Video",-1))]),t("button",{onClick:a[39]||(a[39]=r=>o(zt)?.click()),disabled:o(Fe),type:"button",class:"px-2.5 py-1 rounded-xl bg-sky-950/60 border border-sky-500/40 text-sky-300 text-[10px] font-bold flex items-center gap-1"},[k(o(Mt),{class:"w-3 h-3"}),a[153]||(a[153]=t("span",null,"Upload MP4",-1))],8,ri)]),t("select",{value:n.options.backgroundSource||"random",onChange:a[40]||(a[40]=r=>{const y=r.target.value;i("update:options",{...n.options,backgroundSource:y,videoStartOffset:0})}),class:"w-full bg-slate-950 border border-slate-800 rounded-xl px-3 py-2 text-slate-200 text-xs font-semibold focus:outline-none focus:border-sky-500"},[a[154]||(a[154]=t("option",{value:"random"},"🔀 Acak Video",-1)),(p(!0),m(xe,null,he(o(Ft),r=>(p(),m("option",{key:r,value:r},x(r.replace(".mp4","").replace(/_/g," ")),9,ui))),128)),a[155]||(a[155]=t("option",{value:"pexels"},"🌐 Pexels API (Auto HD)",-1))],40,di),t("div",ci,[t("div",pi,[t("span",fi,[a[156]||(a[156]=z(" ✂️ Mulai Detik: ",-1)),t("strong",mi,x(Math.min(n.options.videoStartOffset||0,o(Ke)))+"s",1),z(" / "+x(o(Zt))+"s ",1)]),t("button",{onClick:a[41]||(a[41]=r=>je("videoStartOffset",0)),type:"button",class:"text-[10px] text-sky-400 hover:text-white"}," Reset 0s ")]),t("input",{type:"range",min:"0",max:o(Ke),step:"1",value:Math.min(n.options.videoStartOffset||0,o(Ke)),onInput:a[42]||(a[42]=r=>je("videoStartOffset",Number(r.target.value))),class:"w-full h-1.5 bg-slate-950 rounded appearance-none cursor-pointer accent-sky-400"},null,40,xi)])]),t("div",hi,[t("div",bi,[t("label",gi,[k(o(oa),{class:"w-4 h-4"}),a[157]||(a[157]=t("span",null,"Musik Reels",-1))]),t("button",{onClick:a[43]||(a[43]=r=>o(Gt)?.click()),disabled:o(Fe),type:"button",class:"px-2.5 py-1 rounded-xl bg-purple-950/60 border border-purple-500/40 text-purple-300 text-[10px] font-bold flex items-center gap-1"},[k(o(Mt),{class:"w-3 h-3"}),a[158]||(a[158]=t("span",null,"Upload MP3",-1))],8,vi)]),t("select",{value:n.options.musicFile||"random",onChange:a[44]||(a[44]=r=>{const y=r.target.value;i("update:options",{...n.options,musicFile:y,audioStartOffset:0})}),class:"w-full bg-slate-950 border border-slate-800 rounded-xl px-3 py-2 text-slate-200 text-xs font-semibold focus:outline-none focus:border-purple-500"},[a[159]||(a[159]=t("option",{value:"random"},"🔀 Acak Musik",-1)),(p(!0),m(xe,null,he(o(Ht),r=>(p(),m("option",{key:r,value:r},x(r.replace(".mp3","").replace(/_/g," ")),9,ki))),128))],40,yi),t("div",wi,[t("div",_i,[t("span",Si,[a[160]||(a[160]=z(" ✂️ Mulai Intro: ",-1)),t("strong",Ti,x(Math.min(n.options.audioStartOffset||0,o(We)))+"s",1),z(" / "+x(o(Ut))+"s ",1)]),t("button",{onClick:a[45]||(a[45]=r=>je("audioStartOffset",0)),type:"button",class:"text-[10px] text-purple-400 hover:text-white"}," Reset 0s ")]),t("input",{type:"range",min:"0",max:o(We),step:"1",value:Math.min(n.options.audioStartOffset||0,o(We)),onInput:a[46]||(a[46]=r=>je("audioStartOffset",Number(r.target.value))),class:"w-full h-1.5 bg-slate-950 rounded appearance-none cursor-pointer accent-purple-400"},null,40,Ci)])]),t("div",Ai,[t("label",Oi,[k(o(Xt),{class:"w-3.5 h-3.5 text-emerald-400"}),a[161]||(a[161]=t("span",null,"Durasi Reels:",-1))]),t("div",Ni,[(p(),m(xe,null,he([7,10,15,30,60],r=>t("button",{key:r,onClick:y=>Ca(r),type:"button",class:j(["px-2.5 py-1 rounded-xl text-xs font-bold transition",n.modelValue.reelsDuration===r?"bg-emerald-500 text-white shadow":"bg-slate-950 text-slate-400 border border-slate-800"])},x(r)+"s ",11,Ii)),64))])]),t("div",Mi,[a[165]||(a[165]=t("span",{class:"text-[11px] font-bold text-slate-400 uppercase tracking-wider block"},"Format Output Aktif",-1)),t("div",$i,[t("label",{class:j(["flex items-center gap-1.5 p-2 rounded-xl border text-xs cursor-pointer select-none",n.options.outputs?.feed!==!1?"bg-sky-500/10 border-sky-500/40 text-sky-200":"bg-slate-950 border-slate-800 text-slate-500"])},[t("input",{type:"checkbox",checked:n.options.outputs?.feed!==!1,onChange:a[47]||(a[47]=r=>at("feed",r.target.checked)),class:"rounded text-sky-500"},null,40,Di),a[162]||(a[162]=t("span",{class:"font-bold"},"Feed 4:5",-1))],2),t("label",{class:j(["flex items-center gap-1.5 p-2 rounded-xl border text-xs cursor-pointer select-none",n.options.outputs?.story!==!1?"bg-indigo-500/10 border-indigo-500/40 text-indigo-200":"bg-slate-950 border-slate-800 text-slate-500"])},[t("input",{type:"checkbox",checked:n.options.outputs?.story!==!1,onChange:a[48]||(a[48]=r=>at("story",r.target.checked)),class:"rounded text-indigo-500"},null,40,ji),a[163]||(a[163]=t("span",{class:"font-bold"},"Story 9:16",-1))],2),t("label",{class:j(["flex items-center gap-1.5 p-2 rounded-xl border text-xs cursor-pointer select-none",n.options.outputs?.reels!==!1?"bg-emerald-500/10 border-emerald-500/40 text-emerald-200":"bg-slate-950 border-slate-800 text-slate-500"])},[t("input",{type:"checkbox",checked:n.options.outputs?.reels!==!1,onChange:a[49]||(a[49]=r=>at("reels",r.target.checked)),class:"rounded text-emerald-500"},null,40,Ei),a[164]||(a[164]=t("span",{class:"font-bold"},"Reels MP4",-1))],2)])])])):o(Se)==="ai"?(p(),m("div",Ri,[t("div",Pi,[t("div",Li,[t("span",Vi,[k(o(ot),{class:"w-4 h-4 text-sky-400"}),a[166]||(a[166]=z(" Auto-Topic AI Generator ",-1))]),t("span",Bi,x(o(w)),1)]),t("div",Ji,[t("div",Fi,[a[167]||(a[167]=t("label",{class:"text-[10px] font-bold text-slate-400"},"Pilih Niche",-1)),ce(t("select",{"onUpdate:modelValue":a[50]||(a[50]=r=>Ee(W)?W.value=r:null),class:"w-full bg-slate-950 border border-slate-800 rounded-xl px-2.5 py-2 text-xs text-white font-bold focus:outline-none"},[(p(!0),m(xe,null,he(o(pe),r=>(p(),m("option",{key:r.id,value:r.id},x(r.name),9,Hi))),128))],512),[[st,o(W)]])]),t("div",Zi,[a[169]||(a[169]=t("label",{class:"text-[10px] font-bold text-slate-400"},"Bahasa Konten",-1)),ce(t("select",{"onUpdate:modelValue":a[51]||(a[51]=r=>Ee(G)?G.value=r:null),class:"w-full bg-slate-950 border border-slate-800 rounded-xl px-2.5 py-2 text-xs text-emerald-300 font-bold focus:outline-none"},[...a[168]||(a[168]=[Ot('<option value="id">🇮🇩 Indonesia</option><option value="en">🇺🇸 English</option><option value="es">🇪🇸 Español</option><option value="ja">🇯🇵 日本語</option><option value="de">🇩🇪 Deutsch</option>',5)])],512),[[st,o(G)]])])]),t("button",{onClick:a[52]||(a[52]=r=>Aa()),disabled:n.isGenerating||n.isAutoTopicLoading,type:"button",class:"w-full py-3 rounded-2xl bg-gradient-to-r from-sky-500 via-indigo-600 to-purple-600 text-white font-black text-xs shadow-xl shadow-sky-500/25 flex items-center justify-center gap-2 active:scale-98 transition disabled:opacity-50"},[k(o(ot),{class:j(["w-4 h-4",{"animate-spin":n.isAutoTopicLoading}])},null,8,["class"]),t("span",null,x(n.isAutoTopicLoading?"Meriset Data Viral...":"✨ Auto-Topic Viral Baru"),1)],8,Ui)]),t("div",zi,[t("div",Gi,[t("div",Ki,[k(o(ea),{class:"w-4 h-4 text-purple-400"}),a[170]||(a[170]=t("span",{class:"text-xs font-black text-white"},"Master Prompt Riset Topik AI",-1))]),t("button",{onClick:qt,type:"button",class:"px-2 py-0.5 rounded-lg bg-purple-950/60 border border-purple-500/40 text-purple-300 text-[10px] font-bold flex items-center gap-1 hover:text-white"},[k(o($a),{class:"w-3 h-3"}),a[171]||(a[171]=t("span",null,"Buka Detail",-1))])]),a[172]||(a[172]=t("p",{class:"text-[11px] text-slate-400 leading-relaxed"},[z(" Salin prompt riset cerdas ini ke "),t("b",null,"ChatGPT / Gemini / Claude"),z(" untuk riset topik konten viral terbaru sesuai niche & template yang aktif (bebas bentrok riwayat): ")],-1)),t("div",Wi,[t("button",{onClick:us,disabled:o(Ct),type:"button",class:"flex-1 px-3 py-2.5 rounded-xl bg-gradient-to-r from-purple-600 to-indigo-600 hover:from-purple-500 text-white text-xs font-bold shadow-lg transition flex items-center justify-center gap-1.5 active:scale-95 disabled:opacity-50"},[o(At)?(p(),Ne(o(qe),{key:0,class:"w-3.5 h-3.5 text-emerald-300"})):(p(),Ne(o(He),{key:1,class:"w-3.5 h-3.5"})),t("span",null,x(o(Ct)?"Menyiapkan Prompt...":o(At)?"✓ Master Prompt Tersalin!":"Salin Master Prompt Topik"),1)],8,qi),t("button",{onClick:qt,type:"button",title:"Lihat teks prompt manual lengkap",class:"px-3 py-2.5 rounded-xl bg-slate-800 text-slate-300 text-xs font-bold border border-slate-700 hover:bg-slate-700 transition"},[k(o($a),{class:"w-3.5 h-3.5"})])])])])):o(Se)==="history"?(p(),m("div",Yi,[t("div",Xi,[t("button",{onClick:a[53]||(a[53]=r=>M.value="drafts"),type:"button",class:j(["flex-1 py-1.5 px-3 rounded-xl transition text-center",o(M)==="drafts"?"bg-amber-500 text-slate-950 font-black shadow":"text-slate-400 hover:text-white"])},[t("span",null,"Drafts ("+x(n.drafts.length)+")",1)],2),t("button",{onClick:a[54]||(a[54]=r=>M.value="history"),type:"button",class:j(["flex-1 py-1.5 px-3 rounded-xl transition text-center",o(M)==="history"?"bg-purple-600 text-white font-black shadow":"text-slate-400 hover:text-white"])},[t("span",null,"Riwayat ("+x(n.history.length)+")",1)],2)]),o(M)==="drafts"?(p(),m("div",Qi,[t("div",el,[a[174]||(a[174]=t("span",{class:"text-[11px] font-bold text-slate-400 uppercase tracking-wider"},"Daftar Draft Tersimpan",-1)),t("button",{onClick:a[55]||(a[55]=r=>i("saveDraft")),type:"button",class:"text-[11px] font-bold text-amber-400 hover:text-amber-300 flex items-center gap-1"},[k(o(Yt),{class:"w-3 h-3"}),a[173]||(a[173]=t("span",null,"+ Simpan Draft",-1))])]),n.drafts.length===0?(p(),m("div",tl," Belum ada draft tersimpan. ")):I("",!0),(p(!0),m(xe,null,he(n.drafts,(r,y)=>(p(),m("div",{key:y,onClick:P=>i("selectDraft",y),class:"p-3 rounded-2xl border bg-slate-900/80 border-slate-800 hover:border-amber-500/40 flex items-center justify-between cursor-pointer active:scale-98 transition shadow"},[t("div",sl,[t("div",nl,x(r.title||"Tanpa Judul"),1),t("div",ol,x(r.category||"Draft"),1)]),t("button",{onClick:mt(P=>i("deleteDraft",y),["stop"]),type:"button",class:"p-1.5 text-slate-400 hover:text-rose-400 rounded-lg transition"},[k(o(nt),{class:"w-3.5 h-3.5"})],8,il)],8,al))),128))])):(p(),m("div",ll,[t("div",rl,[a[175]||(a[175]=t("span",{class:"text-[11px] font-bold text-slate-400 uppercase tracking-wider"},"Riwayat Generasi Terakhir",-1)),n.history.length>0?(p(),m("button",{key:0,onClick:Oa,type:"button",class:"text-[10px] font-bold text-rose-400 hover:text-rose-300"}," Hapus Semua ")):I("",!0)]),n.history.length===0?(p(),m("div",dl," Belum ada riwayat pembuatan. ")):I("",!0),(p(!0),m(xe,null,he(n.history,(r,y)=>(p(),m("div",{key:y,onClick:P=>i("selectHistory",y),class:"p-3 rounded-2xl border bg-slate-900/80 border-slate-800 hover:border-purple-500/40 flex items-center justify-between cursor-pointer active:scale-98 transition shadow"},[t("div",cl,[t("div",pl,x(r.title),1),t("div",fl,x(r.category)+" • "+x(Na(r.generatedAt)),1)]),t("button",{onClick:mt(P=>i("deleteHistory",y),["stop"]),type:"button",class:"p-1.5 text-slate-400 hover:text-rose-400 rounded-lg transition"},[k(o(nt),{class:"w-3.5 h-3.5"})],8,ml)],8,ul))),128))]))])):I("",!0),o(ft)?(p(),m("div",xl,[t("div",hl,[t("div",bl,[a[176]||(a[176]=t("div",{class:"flex items-center gap-2"},[t("span",{class:"text-xs font-bold text-white font-mono"},"</> RAW JSON SocialGen"),t("span",{class:"text-[9px] px-1.5 py-0.2 rounded-full bg-sky-500/20 text-sky-300 font-mono"},"Format V2")],-1)),t("button",{onClick:a[56]||(a[56]=r=>ft.value=!1),type:"button",class:"w-7 h-7 rounded-full bg-slate-800 flex items-center justify-center text-xs text-slate-400 hover:text-white"}," ✕ ")]),o(K)||o(c)||n.validationError?(p(),m("div",{key:0,class:j(["p-2.5 rounded-xl border text-[11px] flex items-center justify-between gap-2 shadow",o(c)||n.validationError?"bg-rose-950/80 border-rose-500/50 text-rose-200":"bg-amber-950/80 border-amber-500/50 text-amber-200"])},[t("div",gl,[a[178]||(a[178]=t("span",null,"⚠️",-1)),t("span",vl,[o(c)?(p(),m("span",yl,x(o(c)),1)):o(K)?(p(),m("span",kl,[a[177]||(a[177]=z("JSON untuk template: ",-1)),t("b",null,x(o(K).matchedTarget?.name||o(K).jsonTemplateId),1)])):(p(),m("span",wl,x(n.validationError),1))])]),o(K)?.isKnown&&o(K).matchedTarget?(p(),m("button",{key:0,onClick:a[57]||(a[57]=r=>et(o(K).matchedTarget.id)),type:"button",class:"px-2 py-0.5 rounded-lg bg-amber-500 text-slate-950 font-bold text-[10px] shrink-0 active:scale-95 shadow"}," Ganti Template ")):I("",!0)],2)):I("",!0),t("textarea",{value:o(l),onInput:ya,rows:"8",spellcheck:"false",class:"w-full bg-slate-950 text-sky-200 text-xs font-mono p-3 rounded-xl border border-slate-800 focus:outline-none focus:border-sky-500/50 resize-y leading-relaxed",placeholder:"Paste Content JSON here..."},null,40,_l),t("div",Sl,[t("button",{onClick:Kt,type:"button",class:"px-3 py-2 rounded-xl bg-slate-800 hover:bg-slate-700 text-xs font-bold text-amber-400"}," Pakai Sample "),t("button",{onClick:ka,type:"button",class:"px-3 py-2 rounded-xl bg-slate-800 hover:bg-slate-700 text-xs font-bold text-sky-400"}," Format JSON "),t("button",{onClick:a[58]||(a[58]=r=>ft.value=!1),type:"button",class:"px-4 py-2 rounded-xl bg-sky-500 hover:bg-sky-400 text-xs font-bold text-white shadow-lg"}," Selesai ")])])])):I("",!0)]),t("div",Tl,[t("div",Cl,[t("div",Al,[t("div",Ol,[k(o(Ts),{class:"w-3.5 h-3.5 text-sky-400"}),a[179]||(a[179]=t("span",{class:"text-xs font-black text-white"},"Content Studio",-1))]),t("div",Nl,[k(o(vs),{class:"w-3.5 h-3.5 text-sky-400"}),a[181]||(a[181]=t("span",{class:"text-[11px] font-bold text-slate-400"},"Niche:",-1)),ce(t("select",{"onUpdate:modelValue":a[59]||(a[59]=r=>Ee(W)?W.value=r:null),class:"bg-transparent text-[11px] font-black text-white focus:outline-none cursor-pointer max-w-[130px] truncate",title:"Pilih Niche Konten"},[(p(!0),m(xe,null,he(o(pe),r=>(p(),m("option",{key:r.id,value:r.id,class:"bg-slate-900 text-white"},x(r.name),9,Il))),128))],512),[[st,o(W)]]),t("button",{onClick:Ce,class:"p-0.5 px-1 rounded bg-slate-800 hover:bg-slate-700 text-sky-400 text-[10px] font-bold transition flex items-center gap-0.5",title:"Kelola & Buat Niche Baru"},[k(o(xt),{class:"w-3 h-3"}),a[180]||(a[180]=t("span",null,"Niche",-1))])]),t("div",Ml,[k(o(gs),{class:"w-3.5 h-3.5 text-emerald-400"}),ce(t("select",{"onUpdate:modelValue":a[60]||(a[60]=r=>Ee(G)?G.value=r:null),class:"bg-transparent text-[11px] font-bold text-emerald-300 focus:outline-none cursor-pointer"},[...a[182]||(a[182]=[Ot('<option value="id" class="bg-slate-900 text-white">🇮🇩 Indonesia</option><option value="en" class="bg-slate-900 text-white">🇺🇸 English</option><option value="es" class="bg-slate-900 text-white">🇪🇸 Español</option><option value="ja" class="bg-slate-900 text-white">🇯🇵 日本語</option><option value="de" class="bg-slate-900 text-white">🇩🇪 Deutsch</option>',5)])],512),[[st,o(G)]])])]),t("div",$l,[t("button",{onClick:qt,title:"Buat prompt manual bebas bentrok untuk ChatGPT / Gemini Web",class:"px-2.5 py-1.5 rounded-xl bg-purple-950/40 hover:bg-purple-900/50 border border-purple-500/30 text-purple-300 text-xs font-bold transition flex items-center gap-1.5 shadow-sm active:scale-95"},[k(o(ea),{class:"w-3.5 h-3.5 text-purple-400"}),a[183]||(a[183]=t("span",null,"Prompt Manual",-1))]),t("button",{onClick:a[61]||(a[61]=r=>Aa()),disabled:n.isGenerating||n.isAutoTopicLoading,class:"px-3 py-1.5 rounded-xl bg-gradient-to-r from-sky-500 via-indigo-600 to-purple-600 hover:opacity-90 text-white text-xs font-bold transition flex items-center gap-1.5 shadow-md shadow-indigo-500/20 active:scale-95 disabled:opacity-50"},[k(o(ot),{class:j(["w-3.5 h-3.5 text-amber-300",{"animate-spin":n.isAutoTopicLoading}])},null,8,["class"]),t("span",null,x(n.isAutoTopicLoading?"Meriset Data...":"✨ Auto-Topic"),1)],8,Dl),t("div",jl,[a[186]||(a[186]=t("button",{class:"px-2 py-1.5 text-xs font-bold text-slate-300 bg-slate-800 hover:bg-slate-700 border border-slate-700 rounded-xl"}," ▾ ",-1)),t("div",El,[a[185]||(a[185]=t("div",{class:"px-3 py-1 text-[10px] font-bold text-slate-500 uppercase"},"Model AI Engine",-1)),t("div",Rl,[ce(t("select",{"onUpdate:modelValue":a[62]||(a[62]=r=>Ee(w)?w.value=r:null),class:"w-full bg-slate-950 border border-slate-700 rounded-lg p-1.5 text-xs text-sky-300 focus:outline-none"},[...a[184]||(a[184]=[t("option",{value:"gemini-3.8-flash"},"⚡ Gemini 3.8 Flash",-1),t("option",{value:"gemini-3.5-flash"},"⚡ Gemini 3.5 Flash",-1),t("option",{value:"gemini-2.5-pro"},"💎 Gemini 2.5 Pro",-1),t("option",{value:"gemini-1.5-pro"},"💎 Gemini 1.5 Pro",-1)])],512),[[st,o(w)]])])])])])]),n.isAutoTopicLoading?(p(),m("div",Pl,[t("div",Ll,[k(o(ot),{class:"w-3 h-3 text-sky-400 animate-spin"})]),t("div",Vl,[a[187]||(a[187]=t("span",{class:"font-bold text-white"},"AI Research Engine Sedang Bekerja...",-1)),t("span",Bl,x(o(w)),1),a[188]||(a[188]=t("span",{class:"text-[10px] text-slate-300"},"Meriset data perbandingan terbaru & copywriting viral.",-1))])])):I("",!0),t("div",Jl,[t("aside",Fl,[t("div",Hl,[t("div",Zl,[t("button",{onClick:a[63]||(a[63]=r=>M.value="editor"),class:j(["flex-1 py-1.5 px-2 rounded-lg text-[11px] transition flex items-center justify-center gap-1 font-bold whitespace-nowrap",o(M)==="editor"?"bg-slate-800 text-sky-400 shadow":"text-slate-400 hover:text-white"])},[k(o(Da),{class:"w-3.5 h-3.5 shrink-0"}),a[189]||(a[189]=t("span",null,"Template",-1))],2),t("button",{onClick:a[64]||(a[64]=r=>M.value="drafts"),class:j(["flex-1 py-1.5 px-2 rounded-lg text-[11px] transition flex items-center justify-center gap-1 font-bold whitespace-nowrap",o(M)==="drafts"?"bg-slate-800 text-amber-400 shadow":"text-slate-400 hover:text-white"])},[k(o(Yt),{class:"w-3.5 h-3.5 shrink-0"}),t("span",null,"Drafts ("+x(n.drafts.length)+")",1)],2),t("button",{onClick:a[65]||(a[65]=r=>M.value="history"),class:j(["flex-1 py-1.5 px-2 rounded-lg text-[11px] transition flex items-center justify-center gap-1 font-bold whitespace-nowrap",o(M)==="history"?"bg-slate-800 text-purple-400 shadow":"text-slate-400 hover:text-white"])},[k(o(Xt),{class:"w-3.5 h-3.5 shrink-0"}),t("span",null,"Riwayat ("+x(n.history.length)+")",1)],2)])]),o(M)==="editor"?(p(),m("div",Ul,[t("div",zl,[t("div",Gl,[t("span",Kl,"Library ("+x(o(q).length)+" Template)",1),t("button",{onClick:h,type:"button",class:"px-2 py-0.5 rounded-lg bg-sky-500/20 text-sky-300 border border-sky-500/30 text-[10px] font-bold hover:bg-sky-500/30 flex items-center gap-1 transition active:scale-95"},[k(o(xt),{class:"w-3 h-3"}),a[190]||(a[190]=t("span",null,"+ Buat Template",-1))])]),t("div",Wl,[ce(t("input",{"onUpdate:modelValue":a[66]||(a[66]=r=>Ee(te)?te.value=r:null),type:"text",placeholder:"Cari template...",class:"w-full bg-slate-950 border border-slate-800 rounded-xl px-2.5 py-1.5 text-xs text-white placeholder-slate-500 focus:outline-none focus:border-sky-500"},null,512),[[Oe,o(te)]])])]),t("div",ql,[(p(!0),m(xe,null,he(o(T),r=>(p(),m("div",{key:r.id,onClick:y=>et(r.layoutType==="custom"?r.id:r.layoutType||r.id),class:j(["p-2.5 rounded-xl border cursor-pointer transition flex flex-col gap-1 group text-left",o(d)===r.id?"bg-sky-950/40 border-sky-500/50 shadow-sm":"bg-slate-950/60 border-slate-800/80 hover:border-slate-700"])},[t("div",Xl,[t("span",Ql,x(r.name),1),o(d)===r.id?(p(),m("span",er)):r.isBuiltin?I("",!0):(p(),m("span",tr,"⭐ Kustom"))]),t("span",ar,x(r.description||"Format kartu visual studio"),1),t("div",sr,[t("span",nr,x(r.category||"UMUM"),1),r.isBuiltin?(p(),m("span",or," BAWAAN ")):I("",!0)])],10,Yl))),128))]),t("div",ir,[t("span",lr,[k(o(ot),{class:"w-3 h-3 text-purple-400"}),a[191]||(a[191]=t("span",null,"AI Vision Template",-1))]),t("button",{onClick:Qe,class:"px-2 py-1 rounded-lg bg-slate-800 hover:bg-slate-700 text-slate-300 hover:text-white text-[10px] font-bold transition flex items-center gap-1"},[k(o(He),{class:"w-2.5 h-2.5"}),t("span",null,x(o(ge)?"✓ Tersalin":"Salin Prompt"),1)])])])):o(M)==="drafts"?(p(),m("div",rr,[t("div",dr,[t("span",ur,"Tersimpan ("+x(n.drafts.length)+")",1),t("button",{onClick:a[67]||(a[67]=r=>i("saveDraft")),class:"text-[10px] text-amber-400 hover:text-amber-300 transition font-bold flex items-center gap-1",title:"Simpan konten saat ini ke Drafts"},[k(o(Yt),{class:"w-3 h-3"}),a[192]||(a[192]=t("span",null,"+ Simpan ke Draft",-1))])]),t("div",cr,[n.unsavedStash?(p(),m("div",pr,[t("div",fr,[a[193]||(a[193]=t("span",{class:"font-bold text-amber-300"},"Editan aktif: ",-1)),t("span",mr,x(n.unsavedStash.title||"Tanpa Judul"),1)]),t("button",{onClick:ee,class:"px-1.5 py-0.5 bg-amber-500 text-slate-950 font-bold rounded text-[9px] shrink-0"}," Kembali ")])):I("",!0),n.drafts.length===0?(p(),m("div",xr,[...a[194]||(a[194]=[z(" Belum ada draft tersimpan.",-1),t("br",null,null,-1),z(" Klik ",-1),t("b",null,"+ Simpan ke Draft",-1),z(" di atas untuk menyimpan konten ini! ",-1)])])):I("",!0),(p(!0),m(xe,null,he(n.drafts,(r,y)=>(p(),m("div",{key:y,onClick:P=>i("selectDraft",y),"data-draft-item":"",class:j(["p-2 rounded-xl border cursor-pointer transition flex items-center justify-between text-xs group",n.activeDraftIndex===y?"bg-amber-500/15 border-amber-500/50 text-white":"bg-slate-950/60 border-slate-800 text-slate-300 hover:border-slate-700"])},[t("div",br,[t("div",gr,[t("span",vr,x(r.layoutType||"table"),1),t("span",yr,x(r.category),1)]),t("div",kr,x(r.title),1)]),t("button",{onClick:mt(P=>i("deleteDraft",y),["stop"]),class:"opacity-0 group-hover:opacity-100 p-1 text-slate-400 hover:text-rose-400 transition rounded shrink-0",title:"Hapus draft ini"},[k(o(nt),{class:"w-3.5 h-3.5"})],8,wr)],10,hr))),128))])])):o(M)==="history"?(p(),m("div",_r,[t("div",Sr,[t("span",Tr,"Riwayat ("+x(n.history.length)+")",1),n.history.length>0?(p(),m("button",{key:0,onClick:Oa,class:"text-[10px] text-rose-400 hover:text-rose-300 transition font-bold"}," Bersihkan Riwayat ")):I("",!0)]),t("div",Cr,[n.unsavedStash?(p(),m("div",Ar,[t("div",Or,[a[195]||(a[195]=t("span",{class:"font-bold text-purple-300"},"Editan aktif: ",-1)),t("span",Nr,x(n.unsavedStash.title||"Tanpa Judul"),1)]),t("button",{onClick:ee,class:"px-1.5 py-0.5 bg-purple-500 text-white font-bold rounded text-[9px] shrink-0"}," Kembali ")])):I("",!0),n.history.length===0?(p(),m("div",Ir,[...a[196]||(a[196]=[z(" Belum ada riwayat pembuatan.",-1),t("br",null,null,-1),z(" Hasil generate akan otomatis tercatat di sini! ",-1)])])):I("",!0),(p(!0),m(xe,null,he(n.history,(r,y)=>(p(),m("div",{key:y,onClick:P=>i("selectHistory",y),"data-history-item":"",class:j(["p-2 rounded-xl border cursor-pointer transition flex items-center justify-between text-xs group",n.activeHistoryIndex===y?"bg-purple-500/15 border-purple-500/50 text-white":"bg-slate-950/60 border-slate-800 text-slate-300 hover:border-slate-700"])},[t("div",$r,[t("div",Dr,[t("span",jr,x(r.layoutType||"reels"),1),t("span",Er,x(r.category),1),r.generatedAt?(p(),m("span",Rr,x(Na(r.generatedAt)),1)):I("",!0)]),t("div",Pr,x(r.title),1)]),t("button",{onClick:mt(P=>i("deleteHistory",y),["stop"]),class:"opacity-0 group-hover:opacity-100 p-1 text-slate-400 hover:text-rose-400 transition rounded shrink-0",title:"Hapus riwayat ini"},[k(o(nt),{class:"w-3.5 h-3.5"})],8,Lr)],10,Mr))),128))])])):I("",!0)]),t("section",Vr,[t("div",Br,[t("div",Jr,[k(o(ws),{class:"w-3.5 h-3.5 text-sky-400"}),a[197]||(a[197]=t("span",{class:"text-xs font-black text-white"},"Studio Inspector",-1)),t("span",Fr,x(o(rs)),1)]),t("div",Hr,[t("button",{onClick:ka,class:"px-2 py-1 rounded-lg bg-slate-800 hover:bg-slate-700 text-slate-300 text-[10px] font-bold transition flex items-center gap-1",title:"Format JSON"},[k(o(Qt),{class:"w-2.5 h-2.5"}),a[198]||(a[198]=t("span",null,"Format",-1))]),t("button",{onClick:Kt,class:"px-2 py-1 rounded-lg bg-sky-950/60 border border-sky-500/40 text-sky-300 text-[10px] font-bold hover:bg-sky-900/50 transition flex items-center gap-1",title:"Clear / Pakai Sample"},[k(o(Qa),{class:"w-2.5 h-2.5"}),a[199]||(a[199]=t("span",null,"Sample",-1))])])]),t("div",Zr,[t("div",Ur,[t("div",zr,[a[200]||(a[200]=t("label",{class:"text-[10px] font-black uppercase tracking-wider text-slate-400"},"Palette Tema & Aksen",-1)),t("span",Gr,x(Ta.find(r=>r.id===(n.modelValue.theme||"blue-tech"))?.name||n.modelValue.theme||"Blue Tech"),1)]),t("div",Kr,[(p(),m(xe,null,he(Ta,r=>t("button",{key:r.id,onClick:y=>Sa(r.id),type:"button",class:j(["h-6 rounded-lg transition border flex items-center justify-center shadow",[r.bgClass,(n.modelValue.theme||"blue-tech")===r.id?"border-2 border-sky-400 ring-2 ring-sky-400/30 scale-105":"border-slate-800 hover:border-slate-600"]]),title:r.name},[(n.modelValue.theme||"blue-tech")===r.id?(p(),Ne(o(qe),{key:0,class:"w-3 h-3 text-white"})):I("",!0)],10,Wr)),64))]),t("div",qr,[t("div",Yr,[t("div",{class:"relative w-6 h-6 rounded-lg overflow-hidden border border-white/20 shadow-inner flex items-center justify-center cursor-pointer",style:vt({backgroundColor:o(tt)})},[t("input",{type:"color",value:o(tt),onInput:a[68]||(a[68]=r=>Tt(r.target.value)),class:"absolute inset-0 opacity-0 w-full h-full cursor-pointer",title:"Pilih warna aksen kanvas"},null,40,Xr)],4),a[201]||(a[201]=t("div",{class:"flex flex-col"},[t("span",{class:"text-[10px] font-bold text-slate-200"},"Aksen Dinamis"),t("span",{class:"text-[8px] text-slate-400"},"Color picker kanvas kustom")],-1))]),t("div",Qr,[a[202]||(a[202]=t("span",{class:"text-[10px] font-mono text-slate-400"},"HEX",-1)),t("input",{type:"text",value:o(tt),onInput:a[69]||(a[69]=r=>Tt(r.target.value)),class:"w-20 bg-slate-950 border border-slate-800 rounded-lg px-2 py-1 text-center font-mono text-[11px] text-sky-400 font-bold focus:outline-none focus:border-sky-500 uppercase",placeholder:"#0284C7"},null,40,ed)])])]),t("div",td,[t("div",ad,[a[203]||(a[203]=t("label",{class:"text-[10px] font-black uppercase tracking-wider text-slate-400"},"Watermark",-1)),t("input",{type:"text",value:n.modelValue.watermark||"@SocialGen",onInput:a[70]||(a[70]=r=>_a(r.target.value)),class:"w-full bg-slate-900 border border-slate-800 rounded-xl px-2.5 py-1.5 text-xs text-sky-400 font-semibold focus:outline-none focus:border-sky-500"},null,40,sd)]),t("div",nd,[a[204]||(a[204]=t("label",{class:"text-[10px] font-black uppercase tracking-wider text-slate-400"},"Judul Konten (Title)",-1)),t("input",{type:"text",value:n.modelValue.title,onInput:a[71]||(a[71]=r=>wa(r.target.value)),placeholder:"Judul Utama Konten...",class:"w-full bg-slate-900 border border-slate-800 rounded-xl px-2.5 py-1.5 text-xs text-slate-100 font-semibold focus:outline-none focus:border-sky-500"},null,40,od)])]),t("div",id,[t("div",ld,[t("label",rd,[k(o(Qt),{class:"w-3.5 h-3.5 text-sky-400"}),a[205]||(a[205]=t("span",null,"RAW JSON Content",-1))]),o(c)?(p(),m("span",ud,[k(o(Ma),{class:"w-2.5 h-2.5"}),a[206]||(a[206]=z(" Invalid ",-1))])):(p(),m("span",dd,[k(o(bs),{class:"w-2.5 h-2.5"}),z(" "+x(o(l).trim()?"Valid":"Sample Mode"),1)]))]),o(K)?(p(),m("div",{key:0,class:j(["p-2 rounded-xl border text-xs transition-all shadow-md flex flex-col gap-1.5",o(K).isKnown?"bg-amber-500/10 border-amber-500/30":"bg-rose-500/10 border-rose-500/30"])},[t("div",{class:j(["flex items-center gap-1.5 text-[11px]",o(K).isKnown?"text-amber-300":"text-rose-300"])},[a[208]||(a[208]=t("span",null,"⚠️",-1)),o(K).isKnown?(p(),m("span",cd,[a[207]||(a[207]=z(" Format milik: ",-1)),t("b",null,x(o(K).matchedTarget?.name),1)])):(p(),m("span",pd,' Template "'+x(o(K).jsonTemplateId)+'" tidak ditemukan. ',1))],2),t("div",fd,[o(K).isKnown&&o(K).matchedTarget?(p(),m("button",{key:0,onClick:a[72]||(a[72]=r=>et(o(K).matchedTarget.id)),class:"px-2 py-0.5 rounded-lg bg-amber-500/20 hover:bg-amber-500/30 text-amber-200 border border-amber-500/40 text-[10px] font-bold transition"}," Pindah Template ")):I("",!0),t("button",{onClick:Kt,class:"px-2 py-0.5 rounded-lg bg-slate-800 hover:bg-slate-700 text-slate-300 text-[10px] font-semibold transition"}," Pakai Sampel ")])],2)):I("",!0),t("textarea",{value:o(l),onInput:ya,rows:"7",spellcheck:"false",class:"w-full bg-slate-950 text-sky-200 text-[11px] font-mono p-2.5 rounded-xl border border-slate-800 focus:outline-none focus:border-sky-500/50 resize-y leading-relaxed select-text custom-scrollbar",placeholder:"Paste Content JSON here... (kosong = otomatis menggunakan data sampel template aktif)"},null,40,md),o(c)||n.validationError?(p(),m("p",xd," ⚠️ "+x(o(c)||n.validationError),1)):I("",!0)]),t("input",{type:"file",ref_key:"videoInputRef",ref:zt,accept:"video/mp4,video/webm",class:"hidden",onChange:a[73]||(a[73]=r=>va(r))},null,544),t("input",{type:"file",ref_key:"audioInputRef",ref:Gt,accept:"audio/mp3,audio/mpeg,audio/wav",class:"hidden",onChange:a[74]||(a[74]=r=>va(r))},null,544),t("div",hd,[t("div",bd,[t("div",gd,[t("label",vd,[k(o(na),{class:"w-3.5 h-3.5 text-sky-400"}),a[209]||(a[209]=t("span",null,"Background Video",-1))]),t("div",yd,[t("select",{value:n.options.backgroundSource||"random",onChange:a[75]||(a[75]=r=>{const y=r.target.value;i("update:options",{...n.options,backgroundSource:y,videoStartOffset:0})}),class:"bg-slate-950 border border-slate-800 rounded-lg px-2 py-1 text-slate-300 text-[11px] focus:outline-none max-w-[150px] truncate"},[a[210]||(a[210]=t("option",{value:"random"},"🔀 Acak Video",-1)),(p(!0),m(xe,null,he(o(Ft),r=>(p(),m("option",{key:r,value:r},x(r.replace(".mp4","").replace(/_/g," ")),9,wd))),128)),a[211]||(a[211]=t("option",{value:"pexels"},"🌐 Pexels API (Auto HD)",-1))],40,kd),t("button",{onClick:a[76]||(a[76]=r=>o(zt)?.click()),disabled:o(Fe),title:"Upload Video MP4 Sendiri",class:"p-1 px-2 rounded-lg border border-sky-500/30 text-sky-300 bg-sky-950/40 hover:bg-sky-900/60 text-[10px] flex items-center gap-1 font-bold transition disabled:opacity-50"},[k(o(Mt),{class:"w-3 h-3"}),t("span",Sd,x(o(Fe)?"...":"Upload"),1)],8,_d)])]),t("div",Td,[t("span",Cd,[k(o(ia),{class:"w-2.5 h-2.5"}),z(" Mulai: "+x(Math.min(n.options.videoStartOffset||0,o(Ke)))+"s / "+x(o(Zt))+"s ",1)]),t("input",{type:"range",min:"0",max:o(Ke),step:"1",value:Math.min(n.options.videoStartOffset||0,o(Ke)),onInput:a[77]||(a[77]=r=>je("videoStartOffset",Number(r.target.value))),class:"w-28 h-1 bg-slate-950 rounded appearance-none cursor-pointer accent-sky-400"},null,40,Ad)])]),t("div",Od,[t("div",Nd,[t("label",Id,[k(o(oa),{class:"w-3.5 h-3.5 text-purple-400"}),a[212]||(a[212]=t("span",null,"Musik Reels",-1))]),t("div",Md,[t("select",{value:n.options.musicFile||"random",onChange:a[78]||(a[78]=r=>{const y=r.target.value;i("update:options",{...n.options,musicFile:y,audioStartOffset:0})}),class:"bg-slate-950 border border-slate-800 rounded-lg px-2 py-1 text-slate-300 text-[11px] focus:outline-none max-w-[150px] truncate"},[a[213]||(a[213]=t("option",{value:"random"},"🔀 Acak Musik",-1)),(p(!0),m(xe,null,he(o(Ht),r=>(p(),m("option",{key:r,value:r},x(r.replace(".mp3","").replace(/_/g," ")),9,Dd))),128))],40,$d),t("button",{onClick:a[79]||(a[79]=r=>o(Gt)?.click()),disabled:o(Fe),title:"Upload Musik MP3 Sendiri",class:"p-1 px-2 rounded-lg border border-purple-500/30 text-purple-300 bg-purple-950/40 hover:bg-purple-900/60 text-[10px] flex items-center gap-1 font-bold transition disabled:opacity-50"},[k(o(Mt),{class:"w-3 h-3"}),t("span",Ed,x(o(Fe)?"...":"Upload"),1)],8,jd)])]),t("div",Rd,[t("span",Pd,[k(o(ia),{class:"w-2.5 h-2.5"}),z(" Mulai: "+x(Math.min(n.options.audioStartOffset||0,o(We)))+"s / "+x(o(Ut))+"s ",1)]),t("input",{type:"range",min:"0",max:o(We),step:"1",value:Math.min(n.options.audioStartOffset||0,o(We)),onInput:a[80]||(a[80]=r=>je("audioStartOffset",Number(r.target.value))),class:"w-28 h-1 bg-slate-950 rounded appearance-none cursor-pointer accent-purple-400"},null,40,Ld)])]),t("div",Vd,[t("label",Bd,[k(o(Xt),{class:"w-3.5 h-3.5 text-emerald-400"}),a[214]||(a[214]=t("span",null,"Durasi Reels:",-1))]),t("div",Jd,[(p(),m(xe,null,he([7,10,15,30,60],r=>t("button",{key:r,onClick:y=>Ca(r),class:j(["px-2 py-0.5 text-[10px] font-bold rounded-lg border transition",(n.modelValue.reelsDuration||30)===r?"bg-emerald-500/20 border-emerald-500/60 text-emerald-300":"bg-slate-950 border-slate-800 text-slate-400 hover:text-white"])},x(r===60?"1m":r+"s"),11,Fd)),64))])]),t("div",Hd,[t("label",{class:j(["flex items-center gap-1.5 p-1.5 rounded-xl border text-[11px] cursor-pointer transition select-none",n.options.outputs?.feed!==!1?"bg-sky-500/10 border-sky-500/40 text-sky-200":"bg-slate-950/50 border-slate-800 text-slate-500"])},[t("input",{type:"checkbox",checked:n.options.outputs?.feed!==!1,onChange:a[81]||(a[81]=r=>at("feed",r.target.checked)),class:"rounded text-sky-500 focus:ring-0 bg-slate-900 border-slate-700 w-3 h-3"},null,40,Zd),a[215]||(a[215]=t("span",{class:"font-bold"},"Feed 4:5",-1))],2),t("label",{class:j(["flex items-center gap-1.5 p-1.5 rounded-xl border text-[11px] cursor-pointer transition select-none",n.options.outputs?.story!==!1?"bg-indigo-500/10 border-indigo-500/40 text-indigo-200":"bg-slate-950/50 border-slate-800 text-slate-500"])},[t("input",{type:"checkbox",checked:n.options.outputs?.story!==!1,onChange:a[82]||(a[82]=r=>at("story",r.target.checked)),class:"rounded text-indigo-500 focus:ring-0 bg-slate-900 border-slate-700 w-3 h-3"},null,40,Ud),a[216]||(a[216]=t("span",{class:"font-bold"},"Story 9:16",-1))],2),t("label",{class:j(["flex items-center gap-1.5 p-1.5 rounded-xl border text-[11px] cursor-pointer transition select-none",n.options.outputs?.reels!==!1?"bg-emerald-500/10 border-emerald-500/40 text-emerald-200":"bg-slate-950/50 border-slate-800 text-slate-500"])},[t("input",{type:"checkbox",checked:n.options.outputs?.reels!==!1,onChange:a[83]||(a[83]=r=>at("reels",r.target.checked)),class:"rounded text-emerald-500 focus:ring-0 bg-slate-900 border-slate-700 w-3 h-3"},null,40,zd),a[217]||(a[217]=t("span",{class:"font-bold"},"Reels MP4",-1))],2)])])]),t("div",Gd,[t("button",{onClick:a[84]||(a[84]=r=>i("generate")),disabled:!n.isValid||n.isGenerating||!!o(c),class:j(["w-full py-3 px-4 rounded-xl font-black text-xs tracking-wide shadow-xl transition flex items-center justify-center gap-2",[!n.isValid||n.isGenerating||o(c)?"bg-slate-800 text-slate-500 cursor-not-allowed border border-slate-700":"bg-gradient-to-r from-sky-500 via-indigo-600 to-purple-600 hover:from-sky-400 hover:to-indigo-500 text-white shadow-sky-500/25 active:scale-[0.99]"]])},[n.isGenerating?(p(),Ne(o(ja),{key:0,class:"w-3.5 h-3.5 animate-spin"})):(p(),Ne(o(Xa),{key:1,class:"w-3.5 h-3.5 fill-current"})),t("span",null,x(n.isGenerating?n.generateStage||"Rendering Content...":"GENERATE CONTENT SEKARANG"),1)],10,Kd)])])])])]))}}),qd={class:"flex flex-col gap-2.5 h-full text-slate-100 min-h-0 justify-between relative"},Yd={key:0,class:"absolute inset-0 z-50 bg-slate-950/85 backdrop-blur-md rounded-2xl flex flex-col items-center justify-center p-6 text-center animate-in fade-in duration-200"},Xd={class:"relative flex items-center justify-center mb-5"},Qd={class:"absolute inset-0 flex items-center justify-center"},eu={class:"text-xs text-sky-300 font-bold mb-4 flex items-center gap-2"},tu={class:"flex flex-wrap items-center justify-between gap-2 p-2.5 bg-slate-900/90 border border-slate-800 rounded-2xl shadow-lg flex-shrink-0"},au={class:"flex items-center gap-1 bg-slate-950 p-1 rounded-xl border border-slate-800 text-xs font-bold"},su={key:0,class:"w-1.5 h-1.5 rounded-full bg-white animate-pulse"},nu={class:"flex items-center gap-2 text-xs"},ou={class:"flex items-center gap-1 bg-slate-950 p-1 rounded-xl border border-slate-800 text-xs shadow-inner"},iu={key:0,class:"relative shadow-2xl rounded-2xl overflow-hidden border border-slate-700/80 flex-shrink-0",style:{width:"360px",height:"450px"}},lu={style:{width:"1080px",height:"1350px",transform:"scale(0.333333)","transform-origin":"top left"}},ru={key:1,class:"relative shadow-2xl rounded-2xl overflow-hidden border border-slate-700/80 flex-shrink-0",style:{width:"300px",height:"533.33px"}},du={key:0,class:"absolute inset-0 z-0 bg-slate-950 overflow-hidden"},uu=["src"],cu=["src","muted"],pu={class:"relative z-10 pointer-events-none",style:{width:"1080px",height:"1920px",transform:"scale(0.277778)","transform-origin":"top left"}},fu={key:1,class:"absolute inset-0 z-20 pointer-events-none flex flex-col justify-between"},mu={class:"flex-1 flex justify-end p-2"},xu={key:0,class:"w-10 bg-red-500/20 border-l border-dashed border-red-500/60 rounded flex flex-col items-center justify-center gap-3 text-[8px] text-red-200 py-3 text-center px-0.5 font-bold"},hu={key:1,class:"flex flex-col bg-slate-900/95 border border-slate-800 rounded-2xl p-2.5 gap-2 shadow-xl flex-shrink-0 text-xs"},bu={class:"flex items-center justify-between gap-3"},gu=["title"],vu={class:"text-[11px] hidden sm:inline"},yu={class:"flex-1 flex items-center gap-2"},ku=["max","value"],wu={class:"font-mono text-[11px] font-bold text-slate-300 min-w-[75px] text-right"},_u=["title"],Su={key:0,class:"grid grid-cols-1 sm:grid-cols-2 gap-3 p-2.5 bg-slate-950/80 rounded-xl border border-slate-800/80 animate-fadeIn"},Tu={class:"flex flex-col gap-1.5"},Cu={class:"flex items-center justify-between text-[11px]"},Au={class:"font-bold text-sky-300 flex items-center gap-1"},Ou=["max","value"],Nu={class:"text-[9px] text-slate-500"},Iu={class:"flex flex-col gap-1.5"},Mu={class:"flex items-center justify-between text-[11px]"},$u={class:"font-bold text-purple-300 flex items-center gap-1"},Du=["max","value"],ju={class:"text-[9px] text-slate-500"},Eu={class:"flex flex-col bg-slate-900/90 border border-slate-800 rounded-2xl p-2.5 gap-1.5 shadow-lg flex-shrink-0"},Ru={class:"flex items-center justify-between text-xs"},Pu=["value"],Lu=fa({__name:"LivePreview",props:{data:{},selectedVideo:{},selectedMusic:{},videoStartOffset:{default:0},audioStartOffset:{default:0},isGenerating:{type:Boolean,default:!1},generateStage:{default:""},generatedResult:{}},emits:["update:videoStartOffset","update:audioStartOffset"],setup(n,{emit:e}){const s=n,i=e,l={"neon_cyber_grid.mp4":8,"financial_pulse_flow.mp4":8,"dark_luxury_particles.mp4":8,"cyber_matrix_stream.mp4":10,"cyber_blue.mp4":15,"default_bg.mp4":15,"emerald_flow.mp4":15,"cyber_pulse.mp4":15,"cyber_future_tech.mp3":15,"dark_phonk_pulse.mp3":15,"deep_finance_groove.mp3":15,"synthwave_pulse.mp3":15,"lofi_chill.mp3":15,"default_ambient.mp3":15,"motivation_cinematic.mp3":110,"lofi_viral_study.mp3":147},d=re(()=>s.selectedVideo&&s.selectedVideo!=="pexels"&&s.selectedVideo!=="random"?`/api/stream/videos/${s.selectedVideo}`:"/api/stream/videos/default_bg.mp4"),f=re(()=>s.selectedMusic&&s.selectedMusic!=="random"?`/api/stream/audio/${s.selectedMusic}`:"/api/stream/audio/lofi_viral_study.mp3"),c=S("feed"),C=S(!1),w=S(!1),M=S(!1),ee=S(1),pe=re(()=>c.value==="feed"?360:300),W=re(()=>c.value==="feed"?450:533.33),V=S(null),D=S(null),J=S(!0),fe=S(!1),Ce=S(0),$e=re(()=>s.data.reelsDuration||30),ve=S(l[s.selectedVideo||""]||8),Y=S(l[s.selectedMusic||""]||30),G=re(()=>Math.max(1,Math.floor(ve.value-1))),ie=re(()=>Math.max(1,Math.floor(Y.value-1)));function q(){ee.value<2.5&&(ee.value=Math.min(2.5,+(ee.value+.15).toFixed(2)))}function we(){ee.value>.5&&(ee.value=Math.max(.5,+(ee.value-.15).toFixed(2)))}function oe(){ee.value=1}function X(T){(T.ctrlKey||T.metaKey)&&(T.preventDefault(),T.deltaY<0?q():we())}let te=0,U=null;function ge(T){if(J.value){if(te>0){const b=(T-te)/1e3;b>0&&b<1&&(Ce.value+=b,Ce.value>=$e.value&&(Ce.value=0,Xe(0)))}te=T,U=requestAnimationFrame(ge)}}const ae=S({});async function _e(){try{const T=await $fetch("/api/media");if(T?.durations){ae.value=T.durations;const b=s.selectedVideo||"";ae.value[b]&&(ve.value=ae.value[b]);const ye=s.selectedMusic||"";ae.value[ye]&&(Y.value=ae.value[ye])}}catch{}}ma(()=>{_e(),J.value&&(te=performance.now(),U&&cancelAnimationFrame(U),U=requestAnimationFrame(ge))}),ps(()=>{U&&(cancelAnimationFrame(U),U=null)}),ke($e,T=>{Ce.value>T&&(Ce.value=0,Xe(0))});function se(){J.value?Ge():N()}function N(){J.value=!0,te=performance.now(),U&&cancelAnimationFrame(U),U=requestAnimationFrame(ge),V.value&&V.value.play().catch(()=>{}),D.value&&(D.value.muted=fe.value,D.value.volume=.85,D.value.play().catch(()=>{}))}function Ge(){J.value=!1,te=0,U&&(cancelAnimationFrame(U),U=null),V.value&&V.value.pause(),D.value&&D.value.pause()}function $(){if(fe.value=!fe.value,D.value)if(D.value.muted=fe.value,D.value.volume=.85,!fe.value&&J.value){const T=s.audioStartOffset||0;D.value.currentTime=T+Ce.value%Math.max(1,Y.value-T),D.value.play().catch(()=>{})}else D.value.pause()}function h(T){const b=T.target;b&&b.duration&&!isNaN(b.duration)&&isFinite(b.duration)&&(ve.value=Math.max(1,Math.floor(b.duration)),s.videoStartOffset&&s.videoStartOffset>=ve.value&&i("update:videoStartOffset",Math.max(0,ve.value-2))),V.value&&(V.value.currentTime=Math.min(s.videoStartOffset||0,G.value),J.value&&V.value.play().catch(()=>{}))}function Q(T){const b=T.target;b&&b.duration&&!isNaN(b.duration)&&isFinite(b.duration)&&(Y.value=Math.max(1,Math.floor(b.duration)),s.audioStartOffset&&s.audioStartOffset>=Y.value&&i("update:audioStartOffset",Math.max(0,Y.value-2))),D.value&&(D.value.muted=fe.value,D.value.volume=.85,D.value.currentTime=Math.min(s.audioStartOffset||0,ie.value),J.value&&!fe.value&&D.value.play().catch(()=>{}))}function Me(){if(!V.value)return;const T=Math.min(s.videoStartOffset||0,G.value);V.value.currentTime=T,J.value&&V.value.play().catch(()=>{})}function B(){if(!D.value)return;const T=Math.min(s.audioStartOffset||0,ie.value);D.value.currentTime=T,J.value&&!fe.value&&D.value.play().catch(()=>{})}function Je(){if(!V.value)return;const T=Math.min(s.videoStartOffset||0,G.value),b=ve.value;V.value.currentTime>=b-.25&&(V.value.currentTime=T,J.value&&V.value.play().catch(()=>{}))}function Lt(){if(!D.value)return;const T=Math.min(s.audioStartOffset||0,ie.value),b=Y.value;D.value.currentTime>=b-.25&&(D.value.currentTime=T,J.value&&!fe.value&&D.value.play().catch(()=>{}))}function Xe(T){Ce.value=Math.min(Math.max(0,T),$e.value),te=performance.now();const b=Math.min(s.videoStartOffset||0,G.value),ye=Math.min(s.audioStartOffset||0,ie.value);if(V.value){const le=b+T%Math.max(1,ve.value-b);V.value.currentTime=Math.min(le,ve.value-.1)}if(D.value){const le=ye+T%Math.max(1,Y.value-ye);D.value.currentTime=Math.min(le,Y.value-.1)}}function pt(T){const b=Number(T.target.value);Xe(b)}ke(()=>s.selectedVideo,(T,b)=>{b!==void 0&&T!==b&&(i("update:videoStartOffset",0),Ce.value=0,V.value&&(V.value.currentTime=0))}),ke(()=>s.selectedMusic,(T,b)=>{b!==void 0&&T!==b&&(i("update:audioStartOffset",0),D.value&&(D.value.currentTime=0))}),ke(()=>s.videoStartOffset,T=>{const b=Math.min(T||0,G.value);V.value&&(V.value.currentTime=b)}),ke(()=>s.audioStartOffset,T=>{const b=Math.min(T||0,ie.value);D.value&&(D.value.currentTime=b)});function Qe(T){const b=Math.min(T,G.value);i("update:videoStartOffset",b),V.value&&(V.value.currentTime=b)}function Vt(T){const b=Math.min(T,ie.value);i("update:audioStartOffset",b),D.value&&(D.value.currentTime=b)}function Bt(){if(V.value){const T=Math.min(Math.floor(V.value.currentTime),G.value);Qe(T)}}function wt(T){const b=Math.floor(T/60),ye=Math.floor(T%60);return`${b.toString().padStart(2,"0")}:${ye.toString().padStart(2,"0")}`}async function Jt(){if(!s.data.caption)return;await bt(s.data.caption)&&(M.value=!0,setTimeout(()=>{M.value=!1},2e3))}return ke(()=>d.value,()=>{const T=s.selectedVideo||"";(ae.value[T]||l[T])&&(ve.value=ae.value[T]||l[T]),Ia(()=>{Xe(0)})}),ke(()=>f.value,()=>{const T=s.selectedMusic||"";(ae.value[T]||l[T])&&(Y.value=ae.value[T]||l[T])}),ke(()=>c.value,T=>{T==="reels"?Ia(()=>{J.value&&N()}):D.value&&D.value.pause()}),(T,b)=>{const ye=ms;return p(),m("div",qd,[n.isGenerating?(p(),m("div",Yd,[t("div",Xd,[b[8]||(b[8]=t("div",{class:"w-20 h-20 rounded-full border-4 border-sky-500/20 border-t-sky-400 border-r-indigo-500 animate-spin"},null,-1)),t("div",Qd,[k(o(ot),{class:"w-8 h-8 text-sky-400 animate-pulse"})])]),b[10]||(b[10]=t("h3",{class:"text-base font-black text-white tracking-wide mb-1.5"}," Sedang Men-generate Konten... ",-1)),t("p",eu,[b[9]||(b[9]=t("span",{class:"w-2 h-2 rounded-full bg-sky-400 animate-ping"},null,-1)),t("span",null,x(n.generateStage||"Merender Gambar & Video Reels..."),1)]),b[11]||(b[11]=t("div",{class:"w-64 max-w-full bg-slate-900 border border-slate-800 rounded-full h-2.5 overflow-hidden shadow-inner mb-3"},[t("div",{class:"h-full bg-gradient-to-r from-sky-500 via-indigo-500 to-purple-500 rounded-full animate-pulse w-full"})],-1)),b[12]||(b[12]=t("span",{class:"text-[10px] text-slate-400 font-mono tracking-wider uppercase"}," Multi-Format Studio Engine • Mohon Tunggu Sebentar ",-1))])):I("",!0),t("div",tu,[t("div",au,[t("button",{onClick:b[0]||(b[0]=le=>c.value="feed"),class:j(["px-3 py-1.5 rounded-lg transition",o(c)==="feed"?"bg-sky-500 text-white shadow-md":"text-slate-400 hover:text-white"])}," Feed 4:5 ",2),t("button",{onClick:b[1]||(b[1]=le=>c.value="story"),class:j(["px-3 py-1.5 rounded-lg transition",o(c)==="story"?"bg-indigo-500 text-white shadow-md":"text-slate-400 hover:text-white"])}," Story 9:16 ",2),t("button",{onClick:b[2]||(b[2]=le=>c.value="reels"),class:j(["px-3 py-1.5 rounded-lg transition flex items-center gap-1.5",o(c)==="reels"?"bg-emerald-500 text-white shadow-md":"text-slate-400 hover:text-white"])},[b[13]||(b[13]=t("span",null,"Reels 9:16 (Video)",-1)),o(c)==="reels"&&o(J)?(p(),m("span",su)):I("",!0)],2)]),t("div",nu,[t("div",ou,[t("button",{onClick:we,title:"Zoom Out (-15%)",class:"p-1.5 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800 transition"},[k(o(As),{class:"w-3.5 h-3.5"})]),t("button",{onClick:oe,title:"Klik untuk Reset Zoom (100% Fit)",class:"px-2 py-0.5 rounded-lg text-[11px] font-bold text-sky-400 hover:bg-slate-800 hover:text-sky-300 transition font-mono min-w-[42px] text-center"},x(Math.round(o(ee)*100))+"% ",1),t("button",{onClick:q,title:"Zoom In (+15%)",class:"p-1.5 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800 transition"},[k(o(Cs),{class:"w-3.5 h-3.5"})]),o(ee)!==1?(p(),m("button",{key:0,onClick:oe,title:"Reset ke Ukuran Pas",class:"p-1.5 rounded-lg text-amber-400 hover:bg-slate-800 transition"},[k(o(Qa),{class:"w-3.5 h-3.5"})])):I("",!0)]),o(c)!=="feed"?(p(),m("button",{key:0,onClick:b[3]||(b[3]=le=>C.value=!o(C)),class:j(["inline-flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border text-xs font-bold transition",o(C)?"bg-amber-500/20 text-amber-300 border-amber-500/50":"bg-slate-950 text-slate-400 border-slate-800"])},[k(o(ks),{class:"w-3.5 h-3.5"}),b[14]||(b[14]=t("span",{class:"hidden sm:inline"},"Safe Zones",-1))],2)):I("",!0)])]),t("div",{onWheel:X,class:"relative flex-1 min-h-0 bg-slate-950/80 canvas-dot-bg border border-slate-800/80 rounded-2xl flex p-4 overflow-auto shadow-inner custom-scrollbar"},[t("div",{class:"m-auto flex-shrink-0 relative transition-all duration-200 ease-out",style:vt({width:`${Math.round(o(pe)*o(ee))}px`,height:`${Math.round(o(W)*o(ee))}px`})},[t("div",{class:"origin-top-left transition-transform duration-200 ease-out absolute top-0 left-0",style:vt({width:`${o(pe)}px`,height:`${o(W)}px`,transform:`scale(${o(ee)})`})},[o(c)==="feed"?(p(),m("div",iu,[t("div",lu,[k(ye,{data:n.data,mode:"feed","is-render":!0},null,8,["data"])])])):(p(),m("div",ru,[o(c)==="reels"?(p(),m("div",du,[(p(),m("video",{ref_key:"videoElement",ref:V,key:o(d),autoplay:"",muted:"",playsinline:"",class:"w-full h-full object-cover brightness-90 contrast-105",src:o(d),onLoadedmetadata:h,onTimeupdate:Je,onEnded:Me},null,40,uu)),b[15]||(b[15]=t("div",{class:"absolute inset-0 bg-slate-950/30 backdrop-blur-[0.5px]"},null,-1)),(p(),m("audio",{ref_key:"audioElement",ref:D,key:o(f),src:o(f),muted:o(fe),onLoadedmetadata:Q,onTimeupdate:Lt,onEnded:B},null,40,cu))])):I("",!0),t("div",pu,[k(ye,{data:n.data,mode:o(c)==="reels"?"overlay":"story","is-render":!0},null,8,["data","mode"])]),o(C)?(p(),m("div",fu,[b[17]||(b[17]=t("div",{class:"h-14 bg-red-500/20 border-b border-dashed border-red-500/60 flex items-center justify-center text-[9px] text-red-200 font-bold tracking-wider"}," TOP SAFE ZONE (Profile & Status) ",-1)),t("div",mu,[o(c)==="reels"?(p(),m("div",xu,[...b[16]||(b[16]=[t("span",null,"❤️ Like",-1),t("span",null,"💬 Comm",-1),t("span",null,"↗️ Share",-1)])])):I("",!0)]),b[18]||(b[18]=t("div",{class:"h-20 bg-red-500/20 border-t border-dashed border-red-500/60 flex items-center justify-center text-[9px] text-red-200 font-bold tracking-wider"}," BOTTOM SAFE ZONE (Caption & Audio) ",-1))])):I("",!0)]))],4)],4)],32),o(c)==="reels"?(p(),m("div",hu,[t("div",bu,[t("button",{onClick:se,class:"p-2 rounded-xl bg-emerald-600 hover:bg-emerald-500 text-white font-bold transition flex items-center gap-1.5 shadow-md",title:o(J)?"Pause Preview":"Putar Preview"},[o(J)?(p(),Ne(o(ys),{key:0,class:"w-3.5 h-3.5 fill-current"})):(p(),Ne(o(Xa),{key:1,class:"w-3.5 h-3.5 fill-current"})),t("span",vu,x(o(J)?"Pause":"Play"),1)],8,gu),t("div",yu,[t("input",{type:"range",min:"0",max:o($e),step:"0.1",value:o(Ce),onInput:pt,class:"flex-1 h-1.5 bg-slate-950 rounded-lg appearance-none cursor-pointer accent-emerald-500 hover:accent-emerald-400"},null,40,ku),t("span",wu,x(wt(o(Ce)))+" / "+x(wt(o($e))),1)]),t("button",{onClick:$,class:j(["px-2.5 py-2 rounded-xl border transition flex items-center gap-1.5 font-bold text-[11px]",o(fe)?"bg-slate-950 text-slate-400 border-slate-800 hover:text-white":"bg-purple-600/40 text-purple-200 border-purple-500/60 shadow-md ring-1 ring-purple-500/40"]),title:o(fe)?"Aktifkan Suara Musik (Unmute)":"Matikan Suara Musik (Mute)"},[o(fe)?(p(),Ne(o(Ss),{key:1,class:"w-3.5 h-3.5"})):(p(),Ne(o(_s),{key:0,class:"w-3.5 h-3.5 text-purple-300 animate-pulse"})),t("span",null,x(o(fe)?"Muted":"Audio ON"),1)],10,_u),t("button",{onClick:b[4]||(b[4]=le=>w.value=!o(w)),class:j(["px-2.5 py-2 rounded-xl border text-[11px] font-bold flex items-center gap-1.5 transition",o(w)?"bg-sky-500/20 text-sky-300 border-sky-500/50":"bg-slate-950 text-slate-400 border-slate-800 hover:text-white"]),title:"Atur Detik Awal Video & Musik"},[k(o(ia),{class:"w-3.5 h-3.5 text-sky-400"}),b[19]||(b[19]=t("span",{class:"hidden sm:inline"},"Trim Offset",-1))],2)]),o(w)?(p(),m("div",Su,[t("div",Tu,[t("div",Cu,[t("span",Au,[k(o(na),{class:"w-3 h-3"}),z(" Mulai Video: "+x(Math.min(n.videoStartOffset||0,o(G)))+"s / "+x(o(ve))+"s ",1)]),t("button",{onClick:Bt,class:"text-[9px] px-1.5 py-0.5 rounded bg-slate-800 hover:bg-slate-700 text-sky-300 border border-slate-700 transition",title:"Gunakan posisi video saat ini sebagai detik mulai"}," Set Detik Ini ")]),t("input",{type:"range",min:"0",max:o(G),step:"1",value:Math.min(n.videoStartOffset||0,o(G)),onInput:b[5]||(b[5]=le=>Qe(Number(le.target.value))),class:"w-full h-1 bg-slate-900 rounded appearance-none cursor-pointer accent-sky-400"},null,40,Ou),t("div",Nu," Maksimal offset: "+x(o(G))+" detik (panjang asli video: "+x(o(ve))+"s) ",1)]),t("div",Iu,[t("div",Mu,[t("span",$u,[k(o(oa),{class:"w-3 h-3"}),z(" Mulai Musik: "+x(Math.min(n.audioStartOffset||0,o(ie)))+"s / "+x(o(Y))+"s ",1)]),b[20]||(b[20]=t("span",{class:"text-[10px] text-slate-500 font-mono"}," (Skip intro) ",-1))]),t("input",{type:"range",min:"0",max:o(ie),step:"1",value:Math.min(n.audioStartOffset||0,o(ie)),onInput:b[6]||(b[6]=le=>Vt(Number(le.target.value))),class:"w-full h-1 bg-slate-900 rounded appearance-none cursor-pointer accent-purple-400"},null,40,Du),t("div",ju," Maksimal offset: "+x(o(ie))+" detik (panjang asli musik: "+x(o(Y))+"s) ",1)])])):I("",!0)])):I("",!0),t("div",Eu,[t("div",Ru,[b[21]||(b[21]=t("span",{class:"font-extrabold text-slate-300 text-[11px]"},"VIRAL CAPTION & HASHTAGS",-1)),t("button",{onClick:Jt,class:"inline-flex items-center gap-1.5 px-3 py-1 bg-slate-800 hover:bg-slate-700 text-sky-300 border border-slate-700 rounded-lg transition text-[11px] font-bold"},[o(M)?(p(),Ne(o(qe),{key:0,class:"w-3.5 h-3.5 text-emerald-400"})):(p(),Ne(o(He),{key:1,class:"w-3.5 h-3.5"})),t("span",null,x(o(M)?"Tersalin!":"Copy Caption"),1)])]),t("textarea",{value:n.data.caption,onInput:b[7]||(b[7]=le=>n.data.caption=le.target.value),rows:"2",class:"w-full bg-slate-950 text-slate-200 text-xs p-2 rounded-xl border border-slate-800 focus:outline-none focus:border-sky-500/50 resize-none leading-relaxed font-sans",placeholder:"Caption will appear here..."},null,40,Pu)])])}}}),Vu=fs(Lu,[["__scopeId","data-v-8f29de3b"]]);var Z;(function(n){n.assertEqual=l=>{};function e(l){}n.assertIs=e;function s(l){throw new Error}n.assertNever=s,n.arrayToEnum=l=>{const d={};for(const f of l)d[f]=f;return d},n.getValidEnumValues=l=>{const d=n.objectKeys(l).filter(c=>typeof l[l[c]]!="number"),f={};for(const c of d)f[c]=l[c];return n.objectValues(f)},n.objectValues=l=>n.objectKeys(l).map(function(d){return l[d]}),n.objectKeys=typeof Object.keys=="function"?l=>Object.keys(l):l=>{const d=[];for(const f in l)Object.prototype.hasOwnProperty.call(l,f)&&d.push(f);return d},n.find=(l,d)=>{for(const f of l)if(d(f))return f},n.isInteger=typeof Number.isInteger=="function"?l=>Number.isInteger(l):l=>typeof l=="number"&&Number.isFinite(l)&&Math.floor(l)===l;function i(l,d=" | "){return l.map(f=>typeof f=="string"?`'${f}'`:f).join(d)}n.joinValues=i,n.jsonStringifyReplacer=(l,d)=>typeof d=="bigint"?d.toString():d})(Z||(Z={}));var Ra;(function(n){n.mergeShapes=(e,s)=>({...e,...s})})(Ra||(Ra={}));const A=Z.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ze=n=>{switch(typeof n){case"undefined":return A.undefined;case"string":return A.string;case"number":return Number.isNaN(n)?A.nan:A.number;case"boolean":return A.boolean;case"function":return A.function;case"bigint":return A.bigint;case"symbol":return A.symbol;case"object":return Array.isArray(n)?A.array:n===null?A.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?A.promise:typeof Map<"u"&&n instanceof Map?A.map:typeof Set<"u"&&n instanceof Set?A.set:typeof Date<"u"&&n instanceof Date?A.date:A.object;default:return A.unknown}},g=Z.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Be extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=i=>{this.issues=[...this.issues,i]},this.addIssues=(i=[])=>{this.issues=[...this.issues,...i]};const s=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,s):this.__proto__=s,this.name="ZodError",this.issues=e}format(e){const s=e||function(d){return d.message},i={_errors:[]},l=d=>{for(const f of d.issues)if(f.code==="invalid_union")f.unionErrors.map(l);else if(f.code==="invalid_return_type")l(f.returnTypeError);else if(f.code==="invalid_arguments")l(f.argumentsError);else if(f.path.length===0)i._errors.push(s(f));else{let c=i,C=0;for(;C<f.path.length;){const w=f.path[C];C===f.path.length-1?(c[w]=c[w]||{_errors:[]},c[w]._errors.push(s(f))):c[w]=c[w]||{_errors:[]},c=c[w],C++}}};return l(this),i}static assert(e){if(!(e instanceof Be))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Z.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=s=>s.message){const s={},i=[];for(const l of this.issues)if(l.path.length>0){const d=l.path[0];s[d]=s[d]||[],s[d].push(e(l))}else i.push(e(l));return{formErrors:i,fieldErrors:s}}get formErrors(){return this.flatten()}}Be.create=n=>new Be(n);const la=(n,e)=>{let s;switch(n.code){case g.invalid_type:n.received===A.undefined?s="Required":s=`Expected ${n.expected}, received ${n.received}`;break;case g.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(n.expected,Z.jsonStringifyReplacer)}`;break;case g.unrecognized_keys:s=`Unrecognized key(s) in object: ${Z.joinValues(n.keys,", ")}`;break;case g.invalid_union:s="Invalid input";break;case g.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${Z.joinValues(n.options)}`;break;case g.invalid_enum_value:s=`Invalid enum value. Expected ${Z.joinValues(n.options)}, received '${n.received}'`;break;case g.invalid_arguments:s="Invalid function arguments";break;case g.invalid_return_type:s="Invalid function return type";break;case g.invalid_date:s="Invalid date";break;case g.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(s=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(s=`${s} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?s=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?s=`Invalid input: must end with "${n.validation.endsWith}"`:Z.assertNever(n.validation):n.validation!=="regex"?s=`Invalid ${n.validation}`:s="Invalid";break;case g.too_small:n.type==="array"?s=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?s=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?s=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="bigint"?s=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?s=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:s="Invalid input";break;case g.too_big:n.type==="array"?s=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?s=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?s=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?s=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?s=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:s="Invalid input";break;case g.custom:s="Invalid input";break;case g.invalid_intersection_types:s="Intersection results could not be merged";break;case g.not_multiple_of:s=`Number must be a multiple of ${n.multipleOf}`;break;case g.not_finite:s="Number must be finite";break;default:s=e.defaultError,Z.assertNever(n)}return{message:s}};let Bu=la;function Ju(){return Bu}const Fu=n=>{const{data:e,path:s,errorMaps:i,issueData:l}=n,d=[...s,...l.path||[]],f={...l,path:d};if(l.message!==void 0)return{...l,path:d,message:l.message};let c="";const C=i.filter(w=>!!w).slice().reverse();for(const w of C)c=w(f,{data:e,defaultError:c}).message;return{...l,path:d,message:c}};function _(n,e){const s=Ju(),i=Fu({issueData:e,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,s,s===la?void 0:la].filter(l=>!!l)});n.common.issues.push(i)}class Te{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,s){const i=[];for(const l of s){if(l.status==="aborted")return R;l.status==="dirty"&&e.dirty(),i.push(l.value)}return{status:e.value,value:i}}static async mergeObjectAsync(e,s){const i=[];for(const l of s){const d=await l.key,f=await l.value;i.push({key:d,value:f})}return Te.mergeObjectSync(e,i)}static mergeObjectSync(e,s){const i={};for(const l of s){const{key:d,value:f}=l;if(d.status==="aborted"||f.status==="aborted")return R;d.status==="dirty"&&e.dirty(),f.status==="dirty"&&e.dirty(),d.value!=="__proto__"&&(typeof f.value<"u"||l.alwaysSet)&&(i[d.value]=f.value)}return{status:e.value,value:i}}}const R=Object.freeze({status:"aborted"}),gt=n=>({status:"dirty",value:n}),Ie=n=>({status:"valid",value:n}),Pa=n=>n.status==="aborted",La=n=>n.status==="dirty",lt=n=>n.status==="valid",$t=n=>typeof Promise<"u"&&n instanceof Promise;var O;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e?.message})(O||(O={}));class Pe{constructor(e,s,i,l){this._cachedPath=[],this.parent=e,this.data=s,this._path=i,this._key=l}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Va=(n,e)=>{if(lt(e))return{success:!0,data:e.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const s=new Be(n.common.issues);return this._error=s,this._error}}};function L(n){if(!n)return{};const{errorMap:e,invalid_type_error:s,required_error:i,description:l}=n;if(e&&(s||i))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:l}:{errorMap:(f,c)=>{const{message:C}=n;return f.code==="invalid_enum_value"?{message:C??c.defaultError}:typeof c.data>"u"?{message:C??i??c.defaultError}:f.code!=="invalid_type"?{message:c.defaultError}:{message:C??s??c.defaultError}},description:l}}class F{get description(){return this._def.description}_getType(e){return Ze(e.data)}_getOrReturnCtx(e,s){return s||{common:e.parent.common,data:e.data,parsedType:Ze(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Te,ctx:{common:e.parent.common,data:e.data,parsedType:Ze(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const s=this._parse(e);if($t(s))throw new Error("Synchronous parse encountered promise.");return s}_parseAsync(e){const s=this._parse(e);return Promise.resolve(s)}parse(e,s){const i=this.safeParse(e,s);if(i.success)return i.data;throw i.error}safeParse(e,s){const i={common:{issues:[],async:s?.async??!1,contextualErrorMap:s?.errorMap},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ze(e)},l=this._parseSync({data:e,path:i.path,parent:i});return Va(i,l)}"~validate"(e){const s={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ze(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:s});return lt(i)?{value:i.value}:{issues:s.common.issues}}catch(i){i?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),s.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:s}).then(i=>lt(i)?{value:i.value}:{issues:s.common.issues})}async parseAsync(e,s){const i=await this.safeParseAsync(e,s);if(i.success)return i.data;throw i.error}async safeParseAsync(e,s){const i={common:{issues:[],contextualErrorMap:s?.errorMap,async:!0},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Ze(e)},l=this._parse({data:e,path:i.path,parent:i}),d=await($t(l)?l:Promise.resolve(l));return Va(i,d)}refine(e,s){const i=l=>typeof s=="string"||typeof s>"u"?{message:s}:typeof s=="function"?s(l):s;return this._refinement((l,d)=>{const f=e(l),c=()=>d.addIssue({code:g.custom,...i(l)});return typeof Promise<"u"&&f instanceof Promise?f.then(C=>C?!0:(c(),!1)):f?!0:(c(),!1)})}refinement(e,s){return this._refinement((i,l)=>e(i)?!0:(l.addIssue(typeof s=="function"?s(i,l):s),!1))}_refinement(e){return new ut({schema:this,typeName:E.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:s=>this["~validate"](s)}}optional(){return Ue.create(this,this._def)}nullable(){return ct.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Re.create(this)}promise(){return Pt.create(this,this._def)}or(e){return jt.create([this,e],this._def)}and(e){return Et.create(this,e,this._def)}transform(e){return new ut({...L(this._def),schema:this,typeName:E.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const s=typeof e=="function"?e:()=>e;return new ua({...L(this._def),innerType:this,defaultValue:s,typeName:E.ZodDefault})}brand(){return new cc({typeName:E.ZodBranded,type:this,...L(this._def)})}catch(e){const s=typeof e=="function"?e:()=>e;return new ca({...L(this._def),innerType:this,catchValue:s,typeName:E.ZodCatch})}describe(e){const s=this.constructor;return new s({...this._def,description:e})}pipe(e){return xa.create(this,e)}readonly(){return pa.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Hu=/^c[^\s-]{8,}$/i,Zu=/^[0-9a-z]+$/,Uu=/^[0-9A-HJKMNP-TV-Z]{26}$/i,zu=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Gu=/^[a-z0-9_-]{21}$/i,Ku=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Wu=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,qu=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Yu="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let aa;const Xu=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Qu=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ec=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,tc=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ac=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,sc=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,es="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",nc=new RegExp(`^${es}$`);function ts(n){let e="[0-5]\\d";n.precision?e=`${e}\\.\\d{${n.precision}}`:n.precision==null&&(e=`${e}(\\.\\d+)?`);const s=n.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${s}`}function oc(n){return new RegExp(`^${ts(n)}$`)}function ic(n){let e=`${es}T${ts(n)}`;const s=[];return s.push(n.local?"Z?":"Z"),n.offset&&s.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${s.join("|")})`,new RegExp(`^${e}$`)}function lc(n,e){return!!((e==="v4"||!e)&&Xu.test(n)||(e==="v6"||!e)&&ec.test(n))}function rc(n,e){if(!Ku.test(n))return!1;try{const[s]=n.split(".");if(!s)return!1;const i=s.replace(/-/g,"+").replace(/_/g,"/").padEnd(s.length+(4-s.length%4)%4,"="),l=JSON.parse(atob(i));return!(typeof l!="object"||l===null||"typ"in l&&l?.typ!=="JWT"||!l.alg||e&&l.alg!==e)}catch{return!1}}function dc(n,e){return!!((e==="v4"||!e)&&Qu.test(n)||(e==="v6"||!e)&&tc.test(n))}class Ve extends F{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==A.string){const d=this._getOrReturnCtx(e);return _(d,{code:g.invalid_type,expected:A.string,received:d.parsedType}),R}const i=new Te;let l;for(const d of this._def.checks)if(d.kind==="min")e.data.length<d.value&&(l=this._getOrReturnCtx(e,l),_(l,{code:g.too_small,minimum:d.value,type:"string",inclusive:!0,exact:!1,message:d.message}),i.dirty());else if(d.kind==="max")e.data.length>d.value&&(l=this._getOrReturnCtx(e,l),_(l,{code:g.too_big,maximum:d.value,type:"string",inclusive:!0,exact:!1,message:d.message}),i.dirty());else if(d.kind==="length"){const f=e.data.length>d.value,c=e.data.length<d.value;(f||c)&&(l=this._getOrReturnCtx(e,l),f?_(l,{code:g.too_big,maximum:d.value,type:"string",inclusive:!0,exact:!0,message:d.message}):c&&_(l,{code:g.too_small,minimum:d.value,type:"string",inclusive:!0,exact:!0,message:d.message}),i.dirty())}else if(d.kind==="email")qu.test(e.data)||(l=this._getOrReturnCtx(e,l),_(l,{validation:"email",code:g.invalid_string,message:d.message}),i.dirty());else if(d.kind==="emoji")aa||(aa=new RegExp(Yu,"u")),aa.test(e.data)||(l=this._getOrReturnCtx(e,l),_(l,{validation:"emoji",code:g.invalid_string,message:d.message}),i.dirty());else if(d.kind==="uuid")zu.test(e.data)||(l=this._getOrReturnCtx(e,l),_(l,{validation:"uuid",code:g.invalid_string,message:d.message}),i.dirty());else if(d.kind==="nanoid")Gu.test(e.data)||(l=this._getOrReturnCtx(e,l),_(l,{validation:"nanoid",code:g.invalid_string,message:d.message}),i.dirty());else if(d.kind==="cuid")Hu.test(e.data)||(l=this._getOrReturnCtx(e,l),_(l,{validation:"cuid",code:g.invalid_string,message:d.message}),i.dirty());else if(d.kind==="cuid2")Zu.test(e.data)||(l=this._getOrReturnCtx(e,l),_(l,{validation:"cuid2",code:g.invalid_string,message:d.message}),i.dirty());else if(d.kind==="ulid")Uu.test(e.data)||(l=this._getOrReturnCtx(e,l),_(l,{validation:"ulid",code:g.invalid_string,message:d.message}),i.dirty());else if(d.kind==="url")try{new URL(e.data)}catch{l=this._getOrReturnCtx(e,l),_(l,{validation:"url",code:g.invalid_string,message:d.message}),i.dirty()}else d.kind==="regex"?(d.regex.lastIndex=0,d.regex.test(e.data)||(l=this._getOrReturnCtx(e,l),_(l,{validation:"regex",code:g.invalid_string,message:d.message}),i.dirty())):d.kind==="trim"?e.data=e.data.trim():d.kind==="includes"?e.data.includes(d.value,d.position)||(l=this._getOrReturnCtx(e,l),_(l,{code:g.invalid_string,validation:{includes:d.value,position:d.position},message:d.message}),i.dirty()):d.kind==="toLowerCase"?e.data=e.data.toLowerCase():d.kind==="toUpperCase"?e.data=e.data.toUpperCase():d.kind==="startsWith"?e.data.startsWith(d.value)||(l=this._getOrReturnCtx(e,l),_(l,{code:g.invalid_string,validation:{startsWith:d.value},message:d.message}),i.dirty()):d.kind==="endsWith"?e.data.endsWith(d.value)||(l=this._getOrReturnCtx(e,l),_(l,{code:g.invalid_string,validation:{endsWith:d.value},message:d.message}),i.dirty()):d.kind==="datetime"?ic(d).test(e.data)||(l=this._getOrReturnCtx(e,l),_(l,{code:g.invalid_string,validation:"datetime",message:d.message}),i.dirty()):d.kind==="date"?nc.test(e.data)||(l=this._getOrReturnCtx(e,l),_(l,{code:g.invalid_string,validation:"date",message:d.message}),i.dirty()):d.kind==="time"?oc(d).test(e.data)||(l=this._getOrReturnCtx(e,l),_(l,{code:g.invalid_string,validation:"time",message:d.message}),i.dirty()):d.kind==="duration"?Wu.test(e.data)||(l=this._getOrReturnCtx(e,l),_(l,{validation:"duration",code:g.invalid_string,message:d.message}),i.dirty()):d.kind==="ip"?lc(e.data,d.version)||(l=this._getOrReturnCtx(e,l),_(l,{validation:"ip",code:g.invalid_string,message:d.message}),i.dirty()):d.kind==="jwt"?rc(e.data,d.alg)||(l=this._getOrReturnCtx(e,l),_(l,{validation:"jwt",code:g.invalid_string,message:d.message}),i.dirty()):d.kind==="cidr"?dc(e.data,d.version)||(l=this._getOrReturnCtx(e,l),_(l,{validation:"cidr",code:g.invalid_string,message:d.message}),i.dirty()):d.kind==="base64"?ac.test(e.data)||(l=this._getOrReturnCtx(e,l),_(l,{validation:"base64",code:g.invalid_string,message:d.message}),i.dirty()):d.kind==="base64url"?sc.test(e.data)||(l=this._getOrReturnCtx(e,l),_(l,{validation:"base64url",code:g.invalid_string,message:d.message}),i.dirty()):Z.assertNever(d);return{status:i.value,value:e.data}}_regex(e,s,i){return this.refinement(l=>e.test(l),{validation:s,code:g.invalid_string,...O.errToObj(i)})}_addCheck(e){return new Ve({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...O.errToObj(e)})}url(e){return this._addCheck({kind:"url",...O.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...O.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...O.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...O.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...O.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...O.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...O.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...O.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...O.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...O.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...O.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...O.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...O.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...O.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...O.errToObj(e)})}regex(e,s){return this._addCheck({kind:"regex",regex:e,...O.errToObj(s)})}includes(e,s){return this._addCheck({kind:"includes",value:e,position:s?.position,...O.errToObj(s?.message)})}startsWith(e,s){return this._addCheck({kind:"startsWith",value:e,...O.errToObj(s)})}endsWith(e,s){return this._addCheck({kind:"endsWith",value:e,...O.errToObj(s)})}min(e,s){return this._addCheck({kind:"min",value:e,...O.errToObj(s)})}max(e,s){return this._addCheck({kind:"max",value:e,...O.errToObj(s)})}length(e,s){return this._addCheck({kind:"length",value:e,...O.errToObj(s)})}nonempty(e){return this.min(1,O.errToObj(e))}trim(){return new Ve({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ve({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ve({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e}get maxLength(){let e=null;for(const s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e}}Ve.create=n=>new Ve({checks:[],typeName:E.ZodString,coerce:n?.coerce??!1,...L(n)});function uc(n,e){const s=(n.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,l=s>i?s:i,d=Number.parseInt(n.toFixed(l).replace(".","")),f=Number.parseInt(e.toFixed(l).replace(".",""));return d%f/10**l}class rt extends F{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==A.number){const d=this._getOrReturnCtx(e);return _(d,{code:g.invalid_type,expected:A.number,received:d.parsedType}),R}let i;const l=new Te;for(const d of this._def.checks)d.kind==="int"?Z.isInteger(e.data)||(i=this._getOrReturnCtx(e,i),_(i,{code:g.invalid_type,expected:"integer",received:"float",message:d.message}),l.dirty()):d.kind==="min"?(d.inclusive?e.data<d.value:e.data<=d.value)&&(i=this._getOrReturnCtx(e,i),_(i,{code:g.too_small,minimum:d.value,type:"number",inclusive:d.inclusive,exact:!1,message:d.message}),l.dirty()):d.kind==="max"?(d.inclusive?e.data>d.value:e.data>=d.value)&&(i=this._getOrReturnCtx(e,i),_(i,{code:g.too_big,maximum:d.value,type:"number",inclusive:d.inclusive,exact:!1,message:d.message}),l.dirty()):d.kind==="multipleOf"?uc(e.data,d.value)!==0&&(i=this._getOrReturnCtx(e,i),_(i,{code:g.not_multiple_of,multipleOf:d.value,message:d.message}),l.dirty()):d.kind==="finite"?Number.isFinite(e.data)||(i=this._getOrReturnCtx(e,i),_(i,{code:g.not_finite,message:d.message}),l.dirty()):Z.assertNever(d);return{status:l.value,value:e.data}}gte(e,s){return this.setLimit("min",e,!0,O.toString(s))}gt(e,s){return this.setLimit("min",e,!1,O.toString(s))}lte(e,s){return this.setLimit("max",e,!0,O.toString(s))}lt(e,s){return this.setLimit("max",e,!1,O.toString(s))}setLimit(e,s,i,l){return new rt({...this._def,checks:[...this._def.checks,{kind:e,value:s,inclusive:i,message:O.toString(l)}]})}_addCheck(e){return new rt({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:O.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:O.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:O.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:O.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:O.toString(e)})}multipleOf(e,s){return this._addCheck({kind:"multipleOf",value:e,message:O.toString(s)})}finite(e){return this._addCheck({kind:"finite",message:O.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:O.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:O.toString(e)})}get minValue(){let e=null;for(const s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e}get maxValue(){let e=null;for(const s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Z.isInteger(e.value))}get isFinite(){let e=null,s=null;for(const i of this._def.checks){if(i.kind==="finite"||i.kind==="int"||i.kind==="multipleOf")return!0;i.kind==="min"?(s===null||i.value>s)&&(s=i.value):i.kind==="max"&&(e===null||i.value<e)&&(e=i.value)}return Number.isFinite(s)&&Number.isFinite(e)}}rt.create=n=>new rt({checks:[],typeName:E.ZodNumber,coerce:n?.coerce||!1,...L(n)});class yt extends F{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==A.bigint)return this._getInvalidInput(e);let i;const l=new Te;for(const d of this._def.checks)d.kind==="min"?(d.inclusive?e.data<d.value:e.data<=d.value)&&(i=this._getOrReturnCtx(e,i),_(i,{code:g.too_small,type:"bigint",minimum:d.value,inclusive:d.inclusive,message:d.message}),l.dirty()):d.kind==="max"?(d.inclusive?e.data>d.value:e.data>=d.value)&&(i=this._getOrReturnCtx(e,i),_(i,{code:g.too_big,type:"bigint",maximum:d.value,inclusive:d.inclusive,message:d.message}),l.dirty()):d.kind==="multipleOf"?e.data%d.value!==BigInt(0)&&(i=this._getOrReturnCtx(e,i),_(i,{code:g.not_multiple_of,multipleOf:d.value,message:d.message}),l.dirty()):Z.assertNever(d);return{status:l.value,value:e.data}}_getInvalidInput(e){const s=this._getOrReturnCtx(e);return _(s,{code:g.invalid_type,expected:A.bigint,received:s.parsedType}),R}gte(e,s){return this.setLimit("min",e,!0,O.toString(s))}gt(e,s){return this.setLimit("min",e,!1,O.toString(s))}lte(e,s){return this.setLimit("max",e,!0,O.toString(s))}lt(e,s){return this.setLimit("max",e,!1,O.toString(s))}setLimit(e,s,i,l){return new yt({...this._def,checks:[...this._def.checks,{kind:e,value:s,inclusive:i,message:O.toString(l)}]})}_addCheck(e){return new yt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:O.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:O.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:O.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:O.toString(e)})}multipleOf(e,s){return this._addCheck({kind:"multipleOf",value:e,message:O.toString(s)})}get minValue(){let e=null;for(const s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e}get maxValue(){let e=null;for(const s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e}}yt.create=n=>new yt({checks:[],typeName:E.ZodBigInt,coerce:n?.coerce??!1,...L(n)});class Ba extends F{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==A.boolean){const i=this._getOrReturnCtx(e);return _(i,{code:g.invalid_type,expected:A.boolean,received:i.parsedType}),R}return Ie(e.data)}}Ba.create=n=>new Ba({typeName:E.ZodBoolean,coerce:n?.coerce||!1,...L(n)});class Dt extends F{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==A.date){const d=this._getOrReturnCtx(e);return _(d,{code:g.invalid_type,expected:A.date,received:d.parsedType}),R}if(Number.isNaN(e.data.getTime())){const d=this._getOrReturnCtx(e);return _(d,{code:g.invalid_date}),R}const i=new Te;let l;for(const d of this._def.checks)d.kind==="min"?e.data.getTime()<d.value&&(l=this._getOrReturnCtx(e,l),_(l,{code:g.too_small,message:d.message,inclusive:!0,exact:!1,minimum:d.value,type:"date"}),i.dirty()):d.kind==="max"?e.data.getTime()>d.value&&(l=this._getOrReturnCtx(e,l),_(l,{code:g.too_big,message:d.message,inclusive:!0,exact:!1,maximum:d.value,type:"date"}),i.dirty()):Z.assertNever(d);return{status:i.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Dt({...this._def,checks:[...this._def.checks,e]})}min(e,s){return this._addCheck({kind:"min",value:e.getTime(),message:O.toString(s)})}max(e,s){return this._addCheck({kind:"max",value:e.getTime(),message:O.toString(s)})}get minDate(){let e=null;for(const s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e!=null?new Date(e):null}}Dt.create=n=>new Dt({checks:[],coerce:n?.coerce||!1,typeName:E.ZodDate,...L(n)});class Ja extends F{_parse(e){if(this._getType(e)!==A.symbol){const i=this._getOrReturnCtx(e);return _(i,{code:g.invalid_type,expected:A.symbol,received:i.parsedType}),R}return Ie(e.data)}}Ja.create=n=>new Ja({typeName:E.ZodSymbol,...L(n)});class Fa extends F{_parse(e){if(this._getType(e)!==A.undefined){const i=this._getOrReturnCtx(e);return _(i,{code:g.invalid_type,expected:A.undefined,received:i.parsedType}),R}return Ie(e.data)}}Fa.create=n=>new Fa({typeName:E.ZodUndefined,...L(n)});class Ha extends F{_parse(e){if(this._getType(e)!==A.null){const i=this._getOrReturnCtx(e);return _(i,{code:g.invalid_type,expected:A.null,received:i.parsedType}),R}return Ie(e.data)}}Ha.create=n=>new Ha({typeName:E.ZodNull,...L(n)});class ra extends F{constructor(){super(...arguments),this._any=!0}_parse(e){return Ie(e.data)}}ra.create=n=>new ra({typeName:E.ZodAny,...L(n)});class Za extends F{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ie(e.data)}}Za.create=n=>new Za({typeName:E.ZodUnknown,...L(n)});class ze extends F{_parse(e){const s=this._getOrReturnCtx(e);return _(s,{code:g.invalid_type,expected:A.never,received:s.parsedType}),R}}ze.create=n=>new ze({typeName:E.ZodNever,...L(n)});class Ua extends F{_parse(e){if(this._getType(e)!==A.undefined){const i=this._getOrReturnCtx(e);return _(i,{code:g.invalid_type,expected:A.void,received:i.parsedType}),R}return Ie(e.data)}}Ua.create=n=>new Ua({typeName:E.ZodVoid,...L(n)});class Re extends F{_parse(e){const{ctx:s,status:i}=this._processInputParams(e),l=this._def;if(s.parsedType!==A.array)return _(s,{code:g.invalid_type,expected:A.array,received:s.parsedType}),R;if(l.exactLength!==null){const f=s.data.length>l.exactLength.value,c=s.data.length<l.exactLength.value;(f||c)&&(_(s,{code:f?g.too_big:g.too_small,minimum:c?l.exactLength.value:void 0,maximum:f?l.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:l.exactLength.message}),i.dirty())}if(l.minLength!==null&&s.data.length<l.minLength.value&&(_(s,{code:g.too_small,minimum:l.minLength.value,type:"array",inclusive:!0,exact:!1,message:l.minLength.message}),i.dirty()),l.maxLength!==null&&s.data.length>l.maxLength.value&&(_(s,{code:g.too_big,maximum:l.maxLength.value,type:"array",inclusive:!0,exact:!1,message:l.maxLength.message}),i.dirty()),s.common.async)return Promise.all([...s.data].map((f,c)=>l.type._parseAsync(new Pe(s,f,s.path,c)))).then(f=>Te.mergeArray(i,f));const d=[...s.data].map((f,c)=>l.type._parseSync(new Pe(s,f,s.path,c)));return Te.mergeArray(i,d)}get element(){return this._def.type}min(e,s){return new Re({...this._def,minLength:{value:e,message:O.toString(s)}})}max(e,s){return new Re({...this._def,maxLength:{value:e,message:O.toString(s)}})}length(e,s){return new Re({...this._def,exactLength:{value:e,message:O.toString(s)}})}nonempty(e){return this.min(1,e)}}Re.create=(n,e)=>new Re({type:n,minLength:null,maxLength:null,exactLength:null,typeName:E.ZodArray,...L(e)});function it(n){if(n instanceof de){const e={};for(const s in n.shape){const i=n.shape[s];e[s]=Ue.create(it(i))}return new de({...n._def,shape:()=>e})}else return n instanceof Re?new Re({...n._def,type:it(n.element)}):n instanceof Ue?Ue.create(it(n.unwrap())):n instanceof ct?ct.create(it(n.unwrap())):n instanceof Ye?Ye.create(n.items.map(e=>it(e))):n}class de extends F{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),s=Z.objectKeys(e);return this._cached={shape:e,keys:s},this._cached}_parse(e){if(this._getType(e)!==A.object){const w=this._getOrReturnCtx(e);return _(w,{code:g.invalid_type,expected:A.object,received:w.parsedType}),R}const{status:i,ctx:l}=this._processInputParams(e),{shape:d,keys:f}=this._getCached(),c=[];if(!(this._def.catchall instanceof ze&&this._def.unknownKeys==="strip"))for(const w in l.data)f.includes(w)||c.push(w);const C=[];for(const w of f){const M=d[w],ee=l.data[w];C.push({key:{status:"valid",value:w},value:M._parse(new Pe(l,ee,l.path,w)),alwaysSet:w in l.data})}if(this._def.catchall instanceof ze){const w=this._def.unknownKeys;if(w==="passthrough")for(const M of c)C.push({key:{status:"valid",value:M},value:{status:"valid",value:l.data[M]}});else if(w==="strict")c.length>0&&(_(l,{code:g.unrecognized_keys,keys:c}),i.dirty());else if(w!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const w=this._def.catchall;for(const M of c){const ee=l.data[M];C.push({key:{status:"valid",value:M},value:w._parse(new Pe(l,ee,l.path,M)),alwaysSet:M in l.data})}}return l.common.async?Promise.resolve().then(async()=>{const w=[];for(const M of C){const ee=await M.key,pe=await M.value;w.push({key:ee,value:pe,alwaysSet:M.alwaysSet})}return w}).then(w=>Te.mergeObjectSync(i,w)):Te.mergeObjectSync(i,C)}get shape(){return this._def.shape()}strict(e){return O.errToObj,new de({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(s,i)=>{const l=this._def.errorMap?.(s,i).message??i.defaultError;return s.code==="unrecognized_keys"?{message:O.errToObj(e).message??l}:{message:l}}}:{}})}strip(){return new de({...this._def,unknownKeys:"strip"})}passthrough(){return new de({...this._def,unknownKeys:"passthrough"})}extend(e){return new de({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new de({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:E.ZodObject})}setKey(e,s){return this.augment({[e]:s})}catchall(e){return new de({...this._def,catchall:e})}pick(e){const s={};for(const i of Z.objectKeys(e))e[i]&&this.shape[i]&&(s[i]=this.shape[i]);return new de({...this._def,shape:()=>s})}omit(e){const s={};for(const i of Z.objectKeys(this.shape))e[i]||(s[i]=this.shape[i]);return new de({...this._def,shape:()=>s})}deepPartial(){return it(this)}partial(e){const s={};for(const i of Z.objectKeys(this.shape)){const l=this.shape[i];e&&!e[i]?s[i]=l:s[i]=l.optional()}return new de({...this._def,shape:()=>s})}required(e){const s={};for(const i of Z.objectKeys(this.shape))if(e&&!e[i])s[i]=this.shape[i];else{let d=this.shape[i];for(;d instanceof Ue;)d=d._def.innerType;s[i]=d}return new de({...this._def,shape:()=>s})}keyof(){return as(Z.objectKeys(this.shape))}}de.create=(n,e)=>new de({shape:()=>n,unknownKeys:"strip",catchall:ze.create(),typeName:E.ZodObject,...L(e)});de.strictCreate=(n,e)=>new de({shape:()=>n,unknownKeys:"strict",catchall:ze.create(),typeName:E.ZodObject,...L(e)});de.lazycreate=(n,e)=>new de({shape:n,unknownKeys:"strip",catchall:ze.create(),typeName:E.ZodObject,...L(e)});class jt extends F{_parse(e){const{ctx:s}=this._processInputParams(e),i=this._def.options;function l(d){for(const c of d)if(c.result.status==="valid")return c.result;for(const c of d)if(c.result.status==="dirty")return s.common.issues.push(...c.ctx.common.issues),c.result;const f=d.map(c=>new Be(c.ctx.common.issues));return _(s,{code:g.invalid_union,unionErrors:f}),R}if(s.common.async)return Promise.all(i.map(async d=>{const f={...s,common:{...s.common,issues:[]},parent:null};return{result:await d._parseAsync({data:s.data,path:s.path,parent:f}),ctx:f}})).then(l);{let d;const f=[];for(const C of i){const w={...s,common:{...s.common,issues:[]},parent:null},M=C._parseSync({data:s.data,path:s.path,parent:w});if(M.status==="valid")return M;M.status==="dirty"&&!d&&(d={result:M,ctx:w}),w.common.issues.length&&f.push(w.common.issues)}if(d)return s.common.issues.push(...d.ctx.common.issues),d.result;const c=f.map(C=>new Be(C));return _(s,{code:g.invalid_union,unionErrors:c}),R}}get options(){return this._def.options}}jt.create=(n,e)=>new jt({options:n,typeName:E.ZodUnion,...L(e)});function da(n,e){const s=Ze(n),i=Ze(e);if(n===e)return{valid:!0,data:n};if(s===A.object&&i===A.object){const l=Z.objectKeys(e),d=Z.objectKeys(n).filter(c=>l.indexOf(c)!==-1),f={...n,...e};for(const c of d){const C=da(n[c],e[c]);if(!C.valid)return{valid:!1};f[c]=C.data}return{valid:!0,data:f}}else if(s===A.array&&i===A.array){if(n.length!==e.length)return{valid:!1};const l=[];for(let d=0;d<n.length;d++){const f=n[d],c=e[d],C=da(f,c);if(!C.valid)return{valid:!1};l.push(C.data)}return{valid:!0,data:l}}else return s===A.date&&i===A.date&&+n==+e?{valid:!0,data:n}:{valid:!1}}class Et extends F{_parse(e){const{status:s,ctx:i}=this._processInputParams(e),l=(d,f)=>{if(Pa(d)||Pa(f))return R;const c=da(d.value,f.value);return c.valid?((La(d)||La(f))&&s.dirty(),{status:s.value,value:c.data}):(_(i,{code:g.invalid_intersection_types}),R)};return i.common.async?Promise.all([this._def.left._parseAsync({data:i.data,path:i.path,parent:i}),this._def.right._parseAsync({data:i.data,path:i.path,parent:i})]).then(([d,f])=>l(d,f)):l(this._def.left._parseSync({data:i.data,path:i.path,parent:i}),this._def.right._parseSync({data:i.data,path:i.path,parent:i}))}}Et.create=(n,e,s)=>new Et({left:n,right:e,typeName:E.ZodIntersection,...L(s)});class Ye extends F{_parse(e){const{status:s,ctx:i}=this._processInputParams(e);if(i.parsedType!==A.array)return _(i,{code:g.invalid_type,expected:A.array,received:i.parsedType}),R;if(i.data.length<this._def.items.length)return _(i,{code:g.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),R;!this._def.rest&&i.data.length>this._def.items.length&&(_(i,{code:g.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),s.dirty());const d=[...i.data].map((f,c)=>{const C=this._def.items[c]||this._def.rest;return C?C._parse(new Pe(i,f,i.path,c)):null}).filter(f=>!!f);return i.common.async?Promise.all(d).then(f=>Te.mergeArray(s,f)):Te.mergeArray(s,d)}get items(){return this._def.items}rest(e){return new Ye({...this._def,rest:e})}}Ye.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ye({items:n,typeName:E.ZodTuple,rest:null,...L(e)})};class Rt extends F{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:s,ctx:i}=this._processInputParams(e);if(i.parsedType!==A.object)return _(i,{code:g.invalid_type,expected:A.object,received:i.parsedType}),R;const l=[],d=this._def.keyType,f=this._def.valueType;for(const c in i.data)l.push({key:d._parse(new Pe(i,c,i.path,c)),value:f._parse(new Pe(i,i.data[c],i.path,c)),alwaysSet:c in i.data});return i.common.async?Te.mergeObjectAsync(s,l):Te.mergeObjectSync(s,l)}get element(){return this._def.valueType}static create(e,s,i){return s instanceof F?new Rt({keyType:e,valueType:s,typeName:E.ZodRecord,...L(i)}):new Rt({keyType:Ve.create(),valueType:e,typeName:E.ZodRecord,...L(s)})}}class za extends F{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:s,ctx:i}=this._processInputParams(e);if(i.parsedType!==A.map)return _(i,{code:g.invalid_type,expected:A.map,received:i.parsedType}),R;const l=this._def.keyType,d=this._def.valueType,f=[...i.data.entries()].map(([c,C],w)=>({key:l._parse(new Pe(i,c,i.path,[w,"key"])),value:d._parse(new Pe(i,C,i.path,[w,"value"]))}));if(i.common.async){const c=new Map;return Promise.resolve().then(async()=>{for(const C of f){const w=await C.key,M=await C.value;if(w.status==="aborted"||M.status==="aborted")return R;(w.status==="dirty"||M.status==="dirty")&&s.dirty(),c.set(w.value,M.value)}return{status:s.value,value:c}})}else{const c=new Map;for(const C of f){const w=C.key,M=C.value;if(w.status==="aborted"||M.status==="aborted")return R;(w.status==="dirty"||M.status==="dirty")&&s.dirty(),c.set(w.value,M.value)}return{status:s.value,value:c}}}}za.create=(n,e,s)=>new za({valueType:e,keyType:n,typeName:E.ZodMap,...L(s)});class kt extends F{_parse(e){const{status:s,ctx:i}=this._processInputParams(e);if(i.parsedType!==A.set)return _(i,{code:g.invalid_type,expected:A.set,received:i.parsedType}),R;const l=this._def;l.minSize!==null&&i.data.size<l.minSize.value&&(_(i,{code:g.too_small,minimum:l.minSize.value,type:"set",inclusive:!0,exact:!1,message:l.minSize.message}),s.dirty()),l.maxSize!==null&&i.data.size>l.maxSize.value&&(_(i,{code:g.too_big,maximum:l.maxSize.value,type:"set",inclusive:!0,exact:!1,message:l.maxSize.message}),s.dirty());const d=this._def.valueType;function f(C){const w=new Set;for(const M of C){if(M.status==="aborted")return R;M.status==="dirty"&&s.dirty(),w.add(M.value)}return{status:s.value,value:w}}const c=[...i.data.values()].map((C,w)=>d._parse(new Pe(i,C,i.path,w)));return i.common.async?Promise.all(c).then(C=>f(C)):f(c)}min(e,s){return new kt({...this._def,minSize:{value:e,message:O.toString(s)}})}max(e,s){return new kt({...this._def,maxSize:{value:e,message:O.toString(s)}})}size(e,s){return this.min(e,s).max(e,s)}nonempty(e){return this.min(1,e)}}kt.create=(n,e)=>new kt({valueType:n,minSize:null,maxSize:null,typeName:E.ZodSet,...L(e)});class Ga extends F{get schema(){return this._def.getter()}_parse(e){const{ctx:s}=this._processInputParams(e);return this._def.getter()._parse({data:s.data,path:s.path,parent:s})}}Ga.create=(n,e)=>new Ga({getter:n,typeName:E.ZodLazy,...L(e)});class Ka extends F{_parse(e){if(e.data!==this._def.value){const s=this._getOrReturnCtx(e);return _(s,{received:s.data,code:g.invalid_literal,expected:this._def.value}),R}return{status:"valid",value:e.data}}get value(){return this._def.value}}Ka.create=(n,e)=>new Ka({value:n,typeName:E.ZodLiteral,...L(e)});function as(n,e){return new dt({values:n,typeName:E.ZodEnum,...L(e)})}class dt extends F{_parse(e){if(typeof e.data!="string"){const s=this._getOrReturnCtx(e),i=this._def.values;return _(s,{expected:Z.joinValues(i),received:s.parsedType,code:g.invalid_type}),R}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const s=this._getOrReturnCtx(e),i=this._def.values;return _(s,{received:s.data,code:g.invalid_enum_value,options:i}),R}return Ie(e.data)}get options(){return this._def.values}get enum(){const e={};for(const s of this._def.values)e[s]=s;return e}get Values(){const e={};for(const s of this._def.values)e[s]=s;return e}get Enum(){const e={};for(const s of this._def.values)e[s]=s;return e}extract(e,s=this._def){return dt.create(e,{...this._def,...s})}exclude(e,s=this._def){return dt.create(this.options.filter(i=>!e.includes(i)),{...this._def,...s})}}dt.create=as;class Wa extends F{_parse(e){const s=Z.getValidEnumValues(this._def.values),i=this._getOrReturnCtx(e);if(i.parsedType!==A.string&&i.parsedType!==A.number){const l=Z.objectValues(s);return _(i,{expected:Z.joinValues(l),received:i.parsedType,code:g.invalid_type}),R}if(this._cache||(this._cache=new Set(Z.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const l=Z.objectValues(s);return _(i,{received:i.data,code:g.invalid_enum_value,options:l}),R}return Ie(e.data)}get enum(){return this._def.values}}Wa.create=(n,e)=>new Wa({values:n,typeName:E.ZodNativeEnum,...L(e)});class Pt extends F{unwrap(){return this._def.type}_parse(e){const{ctx:s}=this._processInputParams(e);if(s.parsedType!==A.promise&&s.common.async===!1)return _(s,{code:g.invalid_type,expected:A.promise,received:s.parsedType}),R;const i=s.parsedType===A.promise?s.data:Promise.resolve(s.data);return Ie(i.then(l=>this._def.type.parseAsync(l,{path:s.path,errorMap:s.common.contextualErrorMap})))}}Pt.create=(n,e)=>new Pt({type:n,typeName:E.ZodPromise,...L(e)});class ut extends F{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===E.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:s,ctx:i}=this._processInputParams(e),l=this._def.effect||null,d={addIssue:f=>{_(i,f),f.fatal?s.abort():s.dirty()},get path(){return i.path}};if(d.addIssue=d.addIssue.bind(d),l.type==="preprocess"){const f=l.transform(i.data,d);if(i.common.async)return Promise.resolve(f).then(async c=>{if(s.value==="aborted")return R;const C=await this._def.schema._parseAsync({data:c,path:i.path,parent:i});return C.status==="aborted"?R:C.status==="dirty"||s.value==="dirty"?gt(C.value):C});{if(s.value==="aborted")return R;const c=this._def.schema._parseSync({data:f,path:i.path,parent:i});return c.status==="aborted"?R:c.status==="dirty"||s.value==="dirty"?gt(c.value):c}}if(l.type==="refinement"){const f=c=>{const C=l.refinement(c,d);if(i.common.async)return Promise.resolve(C);if(C instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(i.common.async===!1){const c=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});return c.status==="aborted"?R:(c.status==="dirty"&&s.dirty(),f(c.value),{status:s.value,value:c.value})}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(c=>c.status==="aborted"?R:(c.status==="dirty"&&s.dirty(),f(c.value).then(()=>({status:s.value,value:c.value}))))}if(l.type==="transform")if(i.common.async===!1){const f=this._def.schema._parseSync({data:i.data,path:i.path,parent:i});if(!lt(f))return R;const c=l.transform(f.value,d);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:s.value,value:c}}else return this._def.schema._parseAsync({data:i.data,path:i.path,parent:i}).then(f=>lt(f)?Promise.resolve(l.transform(f.value,d)).then(c=>({status:s.value,value:c})):R);Z.assertNever(l)}}ut.create=(n,e,s)=>new ut({schema:n,typeName:E.ZodEffects,effect:e,...L(s)});ut.createWithPreprocess=(n,e,s)=>new ut({schema:e,effect:{type:"preprocess",transform:n},typeName:E.ZodEffects,...L(s)});class Ue extends F{_parse(e){return this._getType(e)===A.undefined?Ie(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ue.create=(n,e)=>new Ue({innerType:n,typeName:E.ZodOptional,...L(e)});class ct extends F{_parse(e){return this._getType(e)===A.null?Ie(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ct.create=(n,e)=>new ct({innerType:n,typeName:E.ZodNullable,...L(e)});class ua extends F{_parse(e){const{ctx:s}=this._processInputParams(e);let i=s.data;return s.parsedType===A.undefined&&(i=this._def.defaultValue()),this._def.innerType._parse({data:i,path:s.path,parent:s})}removeDefault(){return this._def.innerType}}ua.create=(n,e)=>new ua({innerType:n,typeName:E.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...L(e)});class ca extends F{_parse(e){const{ctx:s}=this._processInputParams(e),i={...s,common:{...s.common,issues:[]}},l=this._def.innerType._parse({data:i.data,path:i.path,parent:{...i}});return $t(l)?l.then(d=>({status:"valid",value:d.status==="valid"?d.value:this._def.catchValue({get error(){return new Be(i.common.issues)},input:i.data})})):{status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new Be(i.common.issues)},input:i.data})}}removeCatch(){return this._def.innerType}}ca.create=(n,e)=>new ca({innerType:n,typeName:E.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...L(e)});class qa extends F{_parse(e){if(this._getType(e)!==A.nan){const i=this._getOrReturnCtx(e);return _(i,{code:g.invalid_type,expected:A.nan,received:i.parsedType}),R}return{status:"valid",value:e.data}}}qa.create=n=>new qa({typeName:E.ZodNaN,...L(n)});class cc extends F{_parse(e){const{ctx:s}=this._processInputParams(e),i=s.data;return this._def.type._parse({data:i,path:s.path,parent:s})}unwrap(){return this._def.type}}class xa extends F{_parse(e){const{status:s,ctx:i}=this._processInputParams(e);if(i.common.async)return(async()=>{const d=await this._def.in._parseAsync({data:i.data,path:i.path,parent:i});return d.status==="aborted"?R:d.status==="dirty"?(s.dirty(),gt(d.value)):this._def.out._parseAsync({data:d.value,path:i.path,parent:i})})();{const l=this._def.in._parseSync({data:i.data,path:i.path,parent:i});return l.status==="aborted"?R:l.status==="dirty"?(s.dirty(),{status:"dirty",value:l.value}):this._def.out._parseSync({data:l.value,path:i.path,parent:i})}}static create(e,s){return new xa({in:e,out:s,typeName:E.ZodPipeline})}}class pa extends F{_parse(e){const s=this._def.innerType._parse(e),i=l=>(lt(l)&&(l.value=Object.freeze(l.value)),l);return $t(s)?s.then(l=>i(l)):i(s)}unwrap(){return this._def.innerType}}pa.create=(n,e)=>new pa({innerType:n,typeName:E.ZodReadonly,...L(e)});var E;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(E||(E={}));const v=Ve.create,ht=rt.create,Ya=ra.create;ze.create;const be=Re.create,ne=de.create;jt.create;Et.create;Ye.create;const pc=Rt.create;dt.create;Pt.create;Ue.create;ct.create;const fc=ne({label:v().min(1).max(40),left:v().min(1).max(35),right:v().min(1).max(35)}),mc=ne({id:v().optional().default(()=>`post-${Date.now()}`).transform(n=>n||`post-${Date.now()}`),templateId:v().optional(),category:v().optional().default("TECH"),theme:v().optional().default("blue-tech"),accentColor:v().optional(),layoutType:v().default("table"),title:v().min(1).max(120),subtitle:v().min(1).max(250),leftHeader:v().optional().default("USA 🇺🇸"),rightHeader:v().optional().default("UK 🇬🇧"),rows:be(fc).optional().default([]),bullets:be(ne({highlight:v().optional().default(""),text:v().min(1)})).optional().default([]),bigStat:ne({number:v().default("$165,000"),label:v().default("Average Compensation"),subtext:v().optional().default(""),secondaryNumber:v().optional().default(""),secondaryLabel:v().optional().default("")}).optional(),listItems:be(ne({rank:ht(),title:v(),value:v(),tag:v().optional().default("")})).optional().default([]),quoteData:ne({quote:v(),highlight:v().optional().default(""),source:v().default("Industry Insider")}).optional(),versusData:ne({leftEntity:v().optional(),leftStats:be(ne({label:v(),value:v()})).optional(),leftPerk:v().optional(),rightEntity:v().optional(),rightStats:be(ne({label:v(),value:v()})).optional(),rightPerk:v().optional(),verdict:v().optional()}).optional(),receiptData:ne({grossMonthly:v().optional(),items:be(ne({label:v(),amount:v(),note:v().optional()})).optional(),totalDeductions:v().optional(),netRemaining:v().optional()}).optional(),timelineData:ne({pastYear:v().optional().default("2016"),presentYear:v().optional().default("2026"),items:be(ne({label:v(),pastValue:v(),presentValue:v(),changeBadge:v().optional()})).optional(),bottomInsight:v().optional()}).optional(),barchartData:be(ne({label:v(),percentage:ht().min(0).max(100),amount:v().optional(),tag:v().optional()})).optional().default([]),leaderboardData:ne({calloutNote:v().optional().default("*Asumsi kurs : Rp15.500/US$"),items:be(ne({rank:ht(),name:v(),flag:v().optional().default("🌐"),value:v(),percentage:ht().min(0).max(100).optional()})).optional()}).optional(),editorialData:ne({badge:v().optional().default("INVESTIGASI KHUSUS"),highlightPhrase:v().optional(),cards:be(ne({step:v().optional(),title:v(),text:v(),stat:v().optional()})).optional(),keyTakeaway:v().optional()}).optional(),matrixData:ne({headers:be(v()).optional().default(["Indikator","🇮🇩 IDN","🇲🇾 MYS","🇸🇬 SGP"]),rows:be(ne({label:v(),values:be(v())})).optional()}).optional(),debateData:ne({proTitle:v().optional().default("SISI PRO / BENEFIT"),proScore:v().optional().default("65%"),proPoints:be(v()).optional(),conTitle:v().optional().default("SISI KONTRA / RISIKO"),conScore:v().optional().default("35%"),conPoints:be(v()).optional(),callToAction:v().optional().default("Kalian di tim mana? Tulis pendapatmu di bawah! 👇")}).optional(),tierlistData:be(ne({tier:v(),tierColor:v().optional(),items:be(ne({name:v(),badge:v().optional(),desc:v().optional()}))})).optional().default([]),customHtml:v().optional(),customCss:v().optional(),customFields:pc(Ya()).optional(),items:be(Ya()).optional(),footerNote:v().optional().default("Industry Benchmark 2026"),sourceUrl:v().optional(),methodologyBadge:v().optional(),disclaimer:v().optional(),watermark:v().optional().default("@SocialGen"),bgKeyword:v().optional().default("modern office coding night"),reelsDuration:ht().min(5).max(90).default(30),caption:v().optional().default("Bagikan pendapat Anda di kolom komentar! #infografis #edukasi")}),xc={class:"h-screen w-screen bg-slate-950 text-slate-100 flex flex-col font-sans selection:bg-sky-500 selection:text-white overflow-hidden"},hc={class:"h-14 flex-shrink-0 border-b border-slate-800/80 bg-slate-900/60 backdrop-blur sticky top-0 z-30 px-3 sm:px-6 flex items-center justify-between"},bc={class:"flex items-center gap-2.5 sm:gap-3"},gc={class:"text-sm font-extrabold tracking-tight text-white flex items-center gap-1.5 sm:gap-2"},vc={class:"text-[9px] sm:text-[10px] font-bold px-2 py-0.5 rounded-full bg-slate-800 text-sky-400 border border-slate-700"},yc={class:"flex items-center gap-2 sm:gap-3 text-xs"},kc={key:0,class:"px-2.5 py-0.5 sm:py-1 rounded-full bg-emerald-500/10 text-emerald-400 border border-emerald-500/20 font-semibold text-[10px] sm:text-[11px]"},wc={key:1,class:"px-2.5 py-0.5 sm:py-1 rounded-full bg-slate-800 text-slate-400 border border-slate-700 font-semibold text-[10px] sm:text-[11px]"},_c={class:"lg:hidden flex items-center justify-center px-3 py-2 bg-slate-900/90 border-b border-slate-800 flex-shrink-0"},Sc={class:"grid grid-cols-2 w-full max-w-sm bg-slate-950 p-1 rounded-xl border border-slate-800 text-xs font-bold shadow-inner"},Tc={key:0,class:"w-2 h-2 rounded-full bg-emerald-400 animate-ping"},Cc={class:"flex items-center gap-2"},Ac={key:0,class:"text-emerald-400"},Oc={key:1,class:"text-sky-400"},Nc={key:2,class:"text-rose-400"},Ic={class:"flex-1 w-full flex flex-col lg:flex-row overflow-hidden min-h-0"},Mc={key:2,class:"lg:hidden fixed bottom-0 left-0 right-0 z-30 h-16 px-4 bg-slate-900/95 backdrop-blur-lg border-t border-slate-800 flex items-center justify-between gap-3 shadow-2xl"},$c={class:"flex flex-col"},Dc={class:"flex items-center gap-1 text-[10px] font-bold text-sky-400"},jc={key:0},Ec={key:1},Rc={key:2},Pc=["disabled"],Lc={key:0,class:"animate-spin"},Vc={key:1},Bc={key:3,class:"lg:hidden fixed inset-0 z-50 bg-slate-950 flex flex-col justify-between overflow-hidden animate-in slide-in-from-bottom"},Jc={class:"h-14 px-4 bg-slate-900/95 border-b border-slate-800 flex items-center justify-between shrink-0 shadow-md"},Fc={class:"flex-1 overflow-hidden p-2 flex flex-col min-h-0"},Hc={class:"h-16 px-4 bg-slate-900/95 border-t border-slate-800 flex items-center justify-between gap-2 shrink-0"},Zc=["disabled"],Gc=fa({__name:"index",setup(n){const e=S({id:"news-us-germany-salary-divide-2026",category:"TECH REPORT",theme:"blue-tech",layoutType:"news",title:"THE $90,000 TRANSATLANTIC TECH DIVIDE",subtitle:"United States 🇺🇸 vs Germany 🇩🇪 (2026 Real Purchasing Power)",leftHeader:"USA 🇺🇸",rightHeader:"Germany 🇩🇪",rows:[{label:"Junior Dev",left:"$88,000/yr",right:"$52,000/yr"},{label:"Mid-Level",left:"$135,000/yr",right:"$75,000/yr"},{label:"Senior Lead",left:"$180,000/yr",right:"$98,000/yr"},{label:"Effective Tax",left:"24%",right:"42%"},{label:"Paid Vacation",left:"15 Days",right:"30 Days"}],bullets:[{highlight:"Gross Salary Lead",text:"American engineers take home up to 84% higher base compensation."},{highlight:"Work-Life Balance",text:"German labor laws guarantee 30 paid days off with zero expectation of after-hours Slack."},{highlight:"Healthcare Drag",text:"US health insurance deductibles and out-of-pocket costs eat up to $14,000/yr per family."}],bigStat:{number:"$180,000",label:"Senior Tech Base in California",secondaryNumber:"$98,000",secondaryLabel:"Munich Hub",subtext:"The gap widens at senior level, but so does cost of childcare and housing inflation."},listItems:[{rank:1,title:"Switzerland 🇨🇭",value:"$145,000/yr",tag:"Top Net Pay"},{rank:2,title:"United States 🇺🇸",value:"$135,000/yr",tag:"Fast Growth"},{rank:3,title:"Australia 🇦🇺",value:"$98,000/yr",tag:"High Super"},{rank:4,title:"Germany 🇩🇪",value:"$84,000/yr",tag:"Pension Safety"},{rank:5,title:"United Kingdom 🇬🇧",value:"$72,000/yr",tag:"Flexible"}],quoteData:{quote:"Chasing the American gross salary without calculating healthcare deductibles and 50-hour workweeks is the most common financial illusion in global tech.",highlight:"most common financial illusion",source:"Principal Tech Recruiter"},footerNote:"Source: Verified Industry Compensation Survey 2026",watermark:"@SocialGen",bgKeyword:"modern office coding night technology",reelsDuration:30,caption:"Higher gross salary in the US or guaranteed 30 days off in Germany? Which lifestyle would you choose? Drop your vote below! 👇 #techcareers #salary #softwareengineer #worklife"}),s=S({theme:"blue-tech",backgroundSource:"pexels",musicFile:"random",videoStartOffset:0,audioStartOffset:0,outputs:{feed:!0,story:!0,reels:!0}}),i=S([]),l=S(-1),d=S(null);function f($){if(!e.value||!e.value.title||d.value)return;const h=JSON.stringify(e.value),Q=$?JSON.stringify($):"";if(h!==Q){d.value=JSON.parse(h);try{localStorage.setItem("sg_unsaved_stash",h)}catch{}}}function c(){if(!d.value)return;const $=d.value.title||"Editan Anda";e.value=JSON.parse(JSON.stringify(d.value)),d.value.theme&&(s.value.theme=d.value.theme),d.value=null,l.value=-1,V.value=-1;try{localStorage.removeItem("sg_unsaved_stash")}catch{}se(`Editan sebelumnya ("${$.slice(0,24)}...") berhasil dikembalikan! ↩️`,"success")}function C(){d.value=null;try{localStorage.removeItem("sg_unsaved_stash")}catch{}}function w(){try{localStorage.setItem("sg_drafts",JSON.stringify(i.value))}catch{}$fetch("/api/drafts",{method:"POST",body:{drafts:i.value}}).catch(()=>{})}function M(){i.value.unshift(JSON.parse(JSON.stringify(e.value))),l.value=0,V.value=-1,w(),se("Draft berhasil disimpan!")}function ee($){const h=i.value[$];if(h){f(h),e.value=JSON.parse(JSON.stringify(h)),h.theme&&(s.value.theme=h.theme),l.value=$,V.value=-1;const Q=!!d.value;se(`Memuat draft #${$+1}: "${(h.title||"Untitled").slice(0,20)}..."`,"success",Q?{label:"↩️ Kembalikan Editan",onClick:c}:void 0)}}function pe($){i.value.splice($,1),l.value===$&&(l.value=-1),w(),se("Draft dihapus")}const W=S([]),V=S(-1);function D(){try{localStorage.setItem("sg_gen_history",JSON.stringify(W.value))}catch{}$fetch("/api/generation-history",{method:"POST",body:{history:W.value}}).catch(()=>{})}function J($){const h=W.value[$];if(h){const Q=h.contentData||h;f(Q),e.value=JSON.parse(JSON.stringify(Q)),h.options&&(s.value={...s.value,...h.options}),V.value=$,l.value=-1;const Me=!!d.value;se(`Memuat riwayat: "${(h.title||"Untitled").slice(0,24)}..."`,"success",Me?{label:"↩️ Kembalikan Editan",onClick:c}:void 0)}}function fe($){W.value.splice($,1),V.value===$&&(V.value=-1),D(),se("Item riwayat dihapus")}function Ce(){W.value=[],V.value=-1,D(),se("Seluruh riwayat generate berhasil dibersihkan!")}let $e=null;function ve(){try{localStorage.setItem("sg_active_content",JSON.stringify(e.value)),localStorage.setItem("sg_active_options",JSON.stringify(s.value))}catch{}clearTimeout($e),$e=setTimeout(()=>{$fetch("/api/last-session",{method:"POST",body:{content:e.value,options:s.value}}).catch(()=>{})},1e3)}ke(()=>e.value,ve,{deep:!0}),ke(()=>s.value,ve,{deep:!0});const Y=S(!1),G=S(!1),ie=S(""),q=S(null),we=S(""),oe=S("success"),X=S("editor"),te=S(!1),U=S(null);ma(async()=>{try{const $=localStorage.getItem("sg_active_content");if($){const h=JSON.parse($);h&&h.title&&(e.value=h)}else{const h=await $fetch("/api/last-session");h?.session?.content&&(e.value=h.session.content,h.session.options&&(s.value={...s.value,...h.session.options}))}}catch{}try{const $=localStorage.getItem("sg_active_options");if($){const h=JSON.parse($);h&&(s.value={...s.value,...h})}}catch{}try{const $=await $fetch("/api/drafts");if($?.drafts&&Array.isArray($.drafts)&&$.drafts.length>0)i.value=$.drafts;else{const h=localStorage.getItem("sg_drafts");if(h){const Q=JSON.parse(h);Array.isArray(Q)&&Q.length>0&&(i.value=Q,$fetch("/api/drafts",{method:"POST",body:{drafts:Q}}).catch(()=>{}))}}}catch{const $=localStorage.getItem("sg_drafts");if($)try{i.value=JSON.parse($)}catch{}}try{const $=await $fetch("/api/generation-history");if($?.history&&Array.isArray($.history)&&$.history.length>0)W.value=$.history;else{const h=localStorage.getItem("sg_gen_history");h&&(W.value=JSON.parse(h))}}catch{}try{const $=await $fetch("/api/status");U.value=$}catch{}try{const $=localStorage.getItem("sg_unsaved_stash");$&&(d.value=JSON.parse($))}catch{}});const ge=re(()=>{const $=mc.safeParse(e.value);if($.success)return{isValid:!0,error:""};{const h=$.error.errors[0];return{isValid:!1,error:`${h.path.join(".")}: ${h.message}`}}}),ae=S(null);let _e=null;function se($,h="success",Q){clearTimeout(_e),we.value=$,oe.value=h,ae.value=Q||null,_e=setTimeout(()=>{we.value="",ae.value=null},Q?7e3:4e3)}async function N($,h,Q,Me){G.value=!0,ie.value=`AI Research (${Q||"Gemini"})...`;try{const B=await $fetch("/api/auto-topic",{method:"POST",body:{niche:$,layoutType:h,model:Q,language:Me}});if(B?.dataset){f(B.dataset),e.value=B.dataset,s.value.theme=B.dataset.theme,i.value.unshift(B.dataset),l.value=0,w();const Je=!!d.value;B.source==="gemini"?se(`✨ [${B.modelUsed||"Gemini"}] Berhasil meriset: "${B.dataset.title.slice(0,32)}..."`,"success",Je?{label:"↩️ Kembalikan Editan",onClick:c}:void 0):se(`ℹ️ [Curated Data] Topik siap: "${B.dataset.title.slice(0,32)}..."`,"success",Je?{label:"↩️ Kembalikan Editan",onClick:c}:void 0)}}catch(B){se("Gagal auto-topic: "+(B.data?.statusMessage||B.message),"error")}finally{G.value=!1,ie.value=""}}async function Ge(){if(!ge.value.isValid){se("Data tidak valid: "+ge.value.error,"error");return}Y.value=!0,ie.value="Rendering Images & Reels...",q.value=null;const $={id:e.value.id||String(Date.now()),title:e.value.title||"Untitled Creation",layoutType:e.value.layoutType||"table",category:e.value.category||"GENERAL",theme:e.value.theme||"blue-tech",generatedAt:new Date().toISOString(),contentData:JSON.parse(JSON.stringify(e.value)),options:JSON.parse(JSON.stringify(s.value))};W.value.unshift($),V.value=0,D(),X.value="preview";try{const h=await $fetch("/api/generate",{method:"POST",body:{data:e.value,options:s.value}});h?.success&&(q.value=h,se(`✅ Generate selesai! Berhasil dirender dalam ${(h.durationMs/1e3).toFixed(1)} detik.`,"success"))}catch(h){se("Gagal render: "+(h.data?.statusMessage||h.message),"error")}finally{Y.value=!1,ie.value=""}}return($,h)=>{const Q=Wd,Me=Vu;return p(),m("div",xc,[t("header",hc,[t("div",bc,[h[16]||(h[16]=t("div",{class:"w-8 h-8 rounded-xl bg-gradient-to-tr from-sky-500 via-indigo-600 to-purple-600 flex items-center justify-center font-black text-white shadow-md shadow-sky-500/20 text-xs"}," SG ",-1)),t("div",null,[t("h1",gc,[h[15]||(h[15]=z(" SocialGen ",-1)),t("span",vc," v"+x(o(U)?.version||"2.4.1 Studio"),1)])])]),t("div",yc,[o(U)?.geminiActive?(p(),m("span",kc," ● AI Connected ")):(p(),m("span",wc," ● Local Engine "))])]),t("div",_c,[t("div",Sc,[t("button",{onClick:h[0]||(h[0]=B=>X.value="editor"),class:j(["py-1.5 px-3 rounded-lg transition flex items-center justify-center gap-1.5",o(X)==="editor"?"bg-sky-500 text-white shadow-md font-black":"text-slate-400 hover:text-slate-200"])},[...h[17]||(h[17]=[t("span",null,"⚙️ Studio & Editor",-1)])],2),t("button",{onClick:h[1]||(h[1]=B=>X.value="preview"),class:j(["py-1.5 px-3 rounded-lg transition flex items-center justify-center gap-1.5",o(X)==="preview"?"bg-indigo-600 text-white shadow-md font-black":"text-slate-400 hover:text-slate-200"])},[h[18]||(h[18]=t("span",null,"👁️ Live Preview",-1)),o(q)?(p(),m("span",Tc)):I("",!0)],2)])]),o(we)?(p(),m("div",{key:0,class:j(["fixed bottom-20 lg:bottom-6 right-4 lg:right-6 z-50 flex items-center gap-3 px-4 py-3 rounded-2xl shadow-2xl text-xs font-bold border transition-all max-w-[90vw]",o(oe)==="success"?"bg-slate-900 text-slate-100 border-sky-500/50 shadow-sky-950/50":o(oe)==="info"?"bg-slate-900 text-sky-200 border-indigo-500/50 shadow-indigo-950/50":"bg-rose-950 text-rose-200 border-rose-500/50"])},[t("div",Cc,[o(oe)==="success"?(p(),m("span",Ac,"●")):o(oe)==="info"?(p(),m("span",Oc,"ℹ️")):(p(),m("span",Nc,"⚠️")),t("span",null,x(o(we)),1)]),o(ae)?(p(),m("button",{key:0,onClick:h[2]||(h[2]=()=>{o(ae)?.onClick(),we.value="",ae.value=null}),class:"px-2.5 py-1 bg-sky-500 hover:bg-sky-400 text-white font-extrabold rounded-lg shadow transition text-[11px] flex items-center gap-1 active:scale-95"},x(o(ae).label),1)):I("",!0),t("button",{onClick:h[3]||(h[3]=B=>{we.value="",ae.value=null}),class:"text-slate-400 hover:text-white transition ml-1 text-xs"}," ✕ ")],2)):I("",!0),t("main",Ic,[t("section",{class:j(["h-full shrink-0",o(X)==="editor"?"flex flex-col w-full lg:w-auto lg:flex-row lg:overflow-hidden p-2 lg:p-0":"hidden lg:flex lg:flex-row lg:overflow-hidden"])},[k(Q,{modelValue:o(e),"onUpdate:modelValue":h[4]||(h[4]=B=>Ee(e)?e.value=B:null),options:o(s),"onUpdate:options":h[5]||(h[5]=B=>Ee(s)?s.value=B:null),"is-valid":o(ge).isValid,"validation-error":o(ge).error,"is-generating":o(Y),"generate-stage":o(ie),"is-auto-topic-loading":o(G),drafts:o(i),"active-draft-index":o(l),history:o(W),"active-history-index":o(V),"unsaved-stash":o(d),onGenerate:Ge,onAutoTopic:N,onSelectDraft:ee,onDeleteDraft:pe,onSaveDraft:M,onSelectHistory:J,onDeleteHistory:fe,onClearAllHistory:Ce,onRestoreStash:c,onClearStash:C,onToast:h[6]||(h[6]=(B,Je)=>se(B,Je))},null,8,["modelValue","options","is-valid","validation-error","is-generating","generate-stage","is-auto-topic-loading","drafts","active-draft-index","history","active-history-index","unsaved-stash"])],2),t("section",{class:j(["h-full min-w-0 flex-col justify-between overflow-hidden",o(X)==="preview"?"flex w-full p-2":"hidden lg:flex lg:flex-1 lg:p-3"])},[k(Me,{data:o(e),"selected-video":o(s).backgroundSource,"selected-music":o(s).musicFile,"video-start-offset":o(s).videoStartOffset,"onUpdate:videoStartOffset":h[7]||(h[7]=B=>o(s).videoStartOffset=B),"audio-start-offset":o(s).audioStartOffset,"onUpdate:audioStartOffset":h[8]||(h[8]=B=>o(s).audioStartOffset=B),"is-generating":o(Y),"generate-stage":o(ie)},null,8,["data","selected-video","selected-music","video-start-offset","audio-start-offset","is-generating","generate-stage"])],2)]),o(X)==="editor"?(p(),m("button",{key:1,onClick:h[9]||(h[9]=B=>te.value=!0),type:"button",class:"lg:hidden fixed bottom-20 right-4 z-40 px-4 py-2.5 rounded-full bg-gradient-to-r from-sky-500 to-indigo-600 hover:from-sky-400 hover:to-indigo-500 text-white font-black text-xs shadow-2xl border border-sky-400/40 flex items-center gap-1.5 active:scale-95 transition"},[...h[19]||(h[19]=[t("span",{class:"text-sm"},"👁️",-1),t("span",null,"Intip Canvas",-1)])])):I("",!0),o(X)==="editor"?(p(),m("div",Mc,[t("div",$c,[h[20]||(h[20]=t("span",{class:"text-[9px] font-bold text-slate-400 uppercase tracking-wider"},"Output",-1)),t("div",Dc,[o(s).outputs?.feed!==!1?(p(),m("span",jc,"Feed")):I("",!0),o(s).outputs?.feed!==!1&&o(s).outputs?.reels!==!1?(p(),m("span",Ec,"•")):I("",!0),o(s).outputs?.reels!==!1?(p(),m("span",Rc,"Reels")):I("",!0)])]),t("button",{onClick:Ge,disabled:o(Y)||!o(ge).isValid,type:"button",class:"flex-1 py-3 px-4 rounded-2xl bg-gradient-to-r from-sky-500 to-indigo-600 hover:from-sky-400 hover:to-indigo-500 text-white font-black text-xs tracking-wide shadow-xl shadow-sky-500/25 flex items-center justify-center gap-2 active:scale-95 transition disabled:opacity-50"},[o(Y)?(p(),m("span",Lc,"🔄")):(p(),m("span",Vc,"🚀")),t("span",null,x(o(Y)?o(ie)||"Rendering Content...":"GENERATE SEKARANG"),1)],8,Pc)])):I("",!0),o(te)?(p(),m("div",Bc,[t("div",Jc,[h[22]||(h[22]=t("div",{class:"flex items-center gap-2"},[t("span",{class:"w-2 h-2 rounded-full bg-emerald-400 animate-ping"}),t("span",{class:"text-xs font-black text-white"},"Preview Canvas Penuh")],-1)),t("button",{onClick:h[10]||(h[10]=B=>te.value=!1),type:"button",class:"px-3 py-1.5 rounded-xl bg-slate-800 hover:bg-slate-700 text-xs font-bold text-slate-200 border border-slate-700 flex items-center gap-1 active:scale-95 transition"},[...h[21]||(h[21]=[t("span",null,"✕ Tutup Preview",-1)])])]),t("div",Fc,[k(Me,{data:o(e),"selected-video":o(s).backgroundSource,"selected-music":o(s).musicFile,"video-start-offset":o(s).videoStartOffset,"onUpdate:videoStartOffset":h[11]||(h[11]=B=>o(s).videoStartOffset=B),"audio-start-offset":o(s).audioStartOffset,"onUpdate:audioStartOffset":h[12]||(h[12]=B=>o(s).audioStartOffset=B),"is-generating":o(Y),"generate-stage":o(ie)},null,8,["data","selected-video","selected-music","video-start-offset","audio-start-offset","is-generating","generate-stage"])]),t("div",Hc,[t("button",{onClick:h[13]||(h[13]=B=>te.value=!1),type:"button",class:"flex-1 py-2.5 rounded-xl bg-slate-800 hover:bg-slate-700 text-xs font-bold text-slate-200 active:scale-95 transition"}," ✏️ Lanjut Edit Form "),t("button",{onClick:h[14]||(h[14]=()=>{te.value=!1,Ge()}),disabled:o(Y)||!o(ge).isValid,type:"button",class:"flex-1 py-2.5 rounded-xl bg-gradient-to-r from-sky-500 to-indigo-600 text-xs font-bold text-white shadow-lg active:scale-95 transition disabled:opacity-50"}," 🚀 Langsung Render ",8,Zc)])])):I("",!0)])}}});export{Gc as default};