@socialgen_user/socialgen 2.3.5 → 2.3.6

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 (29) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_nuxt/{BI1zNDAE.js → BkcabsD-.js} +1 -1
  3. package/.output/public/_nuxt/{DiCtzVeW.js → BnHqhu28.js} +1 -1
  4. package/.output/public/_nuxt/{CnfGkdc7.js → C5k0IulZ.js} +1 -1
  5. package/.output/public/_nuxt/CDdFfo0w.js +91 -0
  6. package/.output/public/_nuxt/{BBjanQfM.js → WNF4vvWg.js} +1 -1
  7. package/.output/public/_nuxt/{C5uDHZ0c.js → Yv0VQg56.js} +2 -2
  8. package/.output/public/_nuxt/builds/latest.json +1 -1
  9. package/.output/public/_nuxt/builds/meta/4b90bf55-5441-4724-8537-3192f91ec217.json +1 -0
  10. package/.output/public/_nuxt/{DPe4ptnz.js → ztWrJaao.js} +1 -1
  11. package/.output/server/chunks/_/nitro.mjs +100 -100
  12. package/.output/server/chunks/build/client.precomputed.mjs +1 -1
  13. package/.output/server/chunks/build/client.precomputed.mjs.map +1 -1
  14. package/.output/server/chunks/build/{entry-styles.CDUzpOBt.mjs → entry-styles.BPr_nTP3.mjs} +4 -4
  15. package/.output/server/chunks/build/entry-styles.BPr_nTP3.mjs.map +1 -0
  16. package/.output/server/chunks/build/{pages-N8VcQ5jK.mjs → pages-BsPKZpHw.mjs} +90 -4
  17. package/.output/server/chunks/build/pages-BsPKZpHw.mjs.map +1 -0
  18. package/.output/server/chunks/build/server.mjs +1 -1
  19. package/.output/server/chunks/build/styles.mjs +2 -2
  20. package/.output/server/chunks/build/styles.mjs.map +1 -1
  21. package/.output/server/package.json +1 -1
  22. package/data/history.json +9 -4
  23. package/data/history_generations.json +51 -0
  24. package/data/last_session.json +25 -26
  25. package/package.json +1 -1
  26. package/.output/public/_nuxt/CqJK17qQ.js +0 -91
  27. package/.output/public/_nuxt/builds/meta/899c178a-f247-4574-bc2b-c6f700198071.json +0 -1
  28. package/.output/server/chunks/build/entry-styles.CDUzpOBt.mjs.map +0 -1
  29. package/.output/server/chunks/build/pages-N8VcQ5jK.mjs.map +0 -1
@@ -0,0 +1,91 @@
1
+ import{h as $t,d as Ht,i as _,M as ge,o as Ut,A as f,B as g,l,C as a,E as O,G as z,D as y,N as P,O as le,P as ke,Q as ct,R as pt,S as Oe,T as Ie,U as Ne,V as It,W as J,X as Ze,m as de,c as Ua,Y as Fa,Z as aa}from"./Yv0VQg56.js";import{_ as Ja}from"./ztWrJaao.js";async function Rt(s){if(!s)return!1;if(typeof window<"u"&&window.isSecureContext&&navigator?.clipboard?.writeText)try{return await navigator.clipboard.writeText(s),!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=s,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 o=document.createRange();o.selectNodeContents(e);const r=window.getSelection();r&&(r.removeAllRanges(),r.addRange(o)),e.setSelectionRange(0,999999)}else e.focus(),e.select();let n=!1;try{n=document.execCommand("copy")}catch(o){console.warn("[SocialGen Clipboard] execCommand call threw error:",o)}if(document.body.removeChild(e),n)return!0}catch(e){console.warn("[SocialGen Clipboard] DOM fallback failed:",e)}return!1}const za=s=>s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var mt={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 Ga=({size:s,strokeWidth:e=2,absoluteStrokeWidth:t,color:n,iconNode:o,name:r,class:p,...c},{slots:w})=>$t("svg",{...mt,width:s||mt.width,height:s||mt.height,stroke:n||mt.stroke,"stroke-width":t?Number(e)*24/Number(s):e,class:["lucide",`lucide-${za(r??"icon")}`],...c},[...o.map(b=>$t(...b)),...w.default?[w.default()]:[]]);const H=(s,e)=>(t,{slots:n})=>$t(Ga,{...t,iconNode:e,name:s},n);const sa=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 Je=H("CheckIcon",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const Ka=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 qa=H("CircleCheckIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const na=H("ClockIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const Wa=H("CodeIcon",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const xt=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 Ya=H("DownloadIcon",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);const ia=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 Ca=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 Xa=H("FolderOpenIcon",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);const Qa=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 oa=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 Aa=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 es=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 ft=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 Oa=H("PlayIcon",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);const Nt=H("PlusIcon",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const ts=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 Ia=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 Et=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 ra=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 as=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 la=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 ht=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 da=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 ss=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 ns=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 is=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 Mt=H("XIcon",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);const os=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 rs=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"}]]),ls={class:"flex flex-col gap-3 text-slate-100"},ds={key:0,class:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm flex items-center justify-center p-4"},us={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"},cs={class:"flex items-center justify-between pb-3 border-b border-slate-800"},ps={class:"text-sm font-black text-white flex items-center gap-2"},ms={class:"p-3.5 bg-slate-950 rounded-2xl border border-slate-800 flex flex-col gap-2.5"},fs={class:"font-bold text-sky-400 flex items-center justify-between"},hs={class:"grid grid-cols-1 sm:grid-cols-2 gap-2"},xs={class:"flex flex-col gap-2"},gs={class:"text-[11px] font-bold text-slate-400 uppercase tracking-wider"},vs={class:"flex flex-col gap-2 max-h-[220px] overflow-y-auto pr-1 custom-scrollbar"},ys={class:"flex-1"},bs={class:"flex items-center gap-2 mb-1"},ks={class:"font-extrabold text-white text-xs"},ws={class:"px-1.5 py-0.2 rounded text-[9px] font-bold bg-slate-800 text-slate-300 border border-slate-700"},_s={class:"text-[11px] text-slate-400 leading-snug"},Ss={class:"flex items-center gap-1"},Ts=["onClick"],Cs=["onClick"],As={key:1,class:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm flex items-center justify-center p-4"},Os={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]"},Is={class:"flex items-center justify-between pb-3 border-b border-slate-800"},Ns={class:"text-sm font-black text-white flex items-center gap-2"},Ms={class:"flex items-center gap-2 bg-slate-950 p-2.5 rounded-xl border border-slate-800 text-[11px] flex-wrap"},Ds={class:"text-white font-semibold"},$s={class:"text-white font-semibold"},Rs={class:"text-white font-semibold"},Es={class:"text-purple-400 font-bold"},js={class:"relative flex-1 min-h-[220px]"},Ps=["value"],Ls={class:"flex items-center justify-between pt-2 border-t border-slate-800"},Vs={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"},Bs={class:"flex items-center justify-between pb-3 border-b border-slate-800"},Zs={class:"text-sm font-black text-white flex items-center gap-2"},Hs={class:"flex items-center justify-between bg-slate-950 p-1 rounded-xl border border-slate-800"},Us={class:"flex items-center gap-1"},Fs={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"},Js={key:0,class:"flex-1 overflow-y-auto pr-1 flex flex-col gap-2.5 custom-scrollbar min-h-[300px]"},zs={key:0,class:"text-center py-12 text-slate-500 text-xs"},Gs={class:"flex-1 min-w-0"},Ks={class:"flex items-center gap-2 mb-1 flex-wrap"},qs={class:"font-extrabold text-white text-xs"},Ws={class:"px-1.5 py-0.2 rounded text-[9px] font-bold bg-sky-950 text-sky-300 border border-sky-800"},Ys={class:"text-[9px] text-slate-500 font-mono"},Xs={class:"text-[11px] text-slate-400 leading-snug line-clamp-2"},Qs={class:"flex items-center gap-1.5 flex-shrink-0 self-end sm:self-center"},en=["onClick"],tn=["onClick"],an=["onClick"],sn=["onClick"],nn={key:1,class:"flex-1 overflow-y-auto pr-1 flex flex-col gap-3 custom-scrollbar min-h-[350px]"},on={key:0,class:"p-2 rounded-xl bg-rose-950/60 border border-rose-500/50 text-rose-300 text-[11px] font-semibold"},rn={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"},ln={class:"flex items-center gap-2 min-w-0"},dn={class:"p-1 rounded-lg bg-amber-500/20 text-amber-400 shrink-0"},un={class:"min-w-0"},cn={class:"font-extrabold text-white text-xs flex items-center gap-1.5 truncate"},pn={class:"text-amber-300 truncate"},mn={class:"text-[10px] text-amber-400/80"},fn={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"},hn={class:"flex flex-col sm:flex-row sm:items-center justify-between gap-2"},xn={class:"flex items-center gap-1.5 shrink-0 flex-wrap"},gn=["title"],vn={key:0,class:"mt-1 flex flex-col gap-2 p-2.5 rounded-xl bg-slate-950/90 border border-sky-500/40"},yn={class:"flex items-center justify-between"},bn=["value"],kn={key:1,class:"mt-1 flex flex-col gap-2 p-2.5 rounded-xl bg-slate-950/90 border border-sky-500/40"},wn={class:"flex justify-end gap-2"},_n={class:"grid grid-cols-1 sm:grid-cols-3 gap-2.5"},Sn=["disabled"],Tn={class:"grid grid-cols-1 sm:grid-cols-2 gap-2.5"},Cn=["value"],An={key:2,class:"flex flex-col gap-2.5 p-3 rounded-2xl bg-slate-950/80 border border-sky-500/30"},On={class:"flex items-center justify-between"},In={class:"text-[11px] font-black text-sky-400 flex items-center gap-1"},Nn={class:"flex items-center justify-end gap-2 pt-2 border-t border-slate-800"},Mn={class:"flex flex-wrap items-center justify-between gap-2.5 p-3.5 bg-slate-900/90 border border-slate-800 rounded-2xl shadow-lg"},Dn={class:"text-xs font-black text-white flex items-center gap-2"},$n={class:"flex items-center gap-1.5 flex-wrap"},Rn={class:"flex items-center gap-1 bg-slate-950 p-1 rounded-xl border border-slate-800 mr-1.5 shadow-inner"},En=["value"],jn={class:"flex items-center gap-1 bg-slate-950 p-1 rounded-xl border border-slate-800 mr-1.5 shadow-inner",title:"Pilih Bahasa Konten"},Pn=["disabled"],Ln={class:"relative group"},Vn={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-20 w-60 text-xs"},Bn={class:"px-3 py-1.5"},Zn={class:"px-3 py-1 text-[10px] font-bold text-slate-500 uppercase flex items-center justify-between"},Hn={class:"text-[9px] text-sky-400"},Un={class:"max-h-60 overflow-y-auto custom-scrollbar flex flex-col"},Fn=["onClick"],Jn={class:"truncate"},zn={key:0,class:"text-[8px] px-1 py-0.2 rounded bg-purple-500/20 text-purple-300 ml-1"},Gn={key:3,class:"p-3 bg-gradient-to-r from-sky-950 via-indigo-950 to-purple-950 border border-sky-500/50 rounded-2xl flex items-center gap-3 animate-pulse shadow-lg shadow-sky-500/10"},Kn={class:"w-6 h-6 rounded-lg bg-sky-500/20 border border-sky-400/40 flex items-center justify-center flex-shrink-0"},qn={class:"text-[11px]"},Wn={class:"font-extrabold text-white flex items-center gap-2"},Yn={class:"text-[9px] px-1.5 py-0.2 rounded bg-sky-500/30 text-sky-200 border border-sky-400/30"},Xn={class:"flex items-center justify-between bg-slate-950 p-1 rounded-xl border border-slate-800 text-xs font-semibold"},Qn={class:"flex items-center gap-1"},ei={class:"flex items-center gap-1.5"},ti={key:4,class:"flex flex-col gap-1.5 p-2.5 bg-slate-900/90 border border-slate-800 rounded-2xl max-h-[320px] overflow-y-auto custom-scrollbar"},ai={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-2 shadow-sm text-xs sticky top-0 z-10 backdrop-blur-md"},si={class:"flex items-center gap-2 min-w-0"},ni={class:"truncate"},ii={class:"text-[11px] text-amber-100 font-semibold truncate block"},oi={class:"flex items-center gap-1.5 flex-shrink-0"},ri={key:1,class:"text-center py-8 text-slate-500 text-[11px] leading-relaxed"},li=["onClick"],di={class:"flex-1 pr-2"},ui={class:"flex items-center gap-1.5 mb-0.5"},ci={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"},pi={class:"text-[9px] text-slate-400 font-semibold"},mi={class:"font-bold text-[11px] truncate text-slate-100"},fi=["onClick"],hi={key:5,class:"flex flex-col gap-1.5 p-2.5 bg-slate-900/90 border border-slate-800 rounded-2xl max-h-[320px] overflow-y-auto custom-scrollbar"},xi={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-2 shadow-sm text-xs sticky top-0 z-10 backdrop-blur-md"},gi={class:"flex items-center gap-2 min-w-0"},vi={class:"truncate"},yi={class:"text-[11px] text-purple-100 font-semibold truncate block"},bi={class:"flex items-center gap-1.5 flex-shrink-0"},ki={key:1,class:"text-center py-8 text-slate-500 text-[11px] leading-relaxed"},wi=["onClick"],_i={class:"flex-1 pr-2"},Si={class:"flex items-center gap-1.5 mb-0.5"},Ti={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"},Ci={class:"text-[9px] text-slate-400 font-semibold"},Ai={key:0,class:"text-[9px] text-slate-500 font-mono ml-auto"},Oi={class:"font-bold text-[11px] truncate text-slate-100"},Ii=["onClick"],Ni={key:6,class:"flex flex-col bg-slate-900/90 border border-slate-800 rounded-2xl overflow-hidden shadow-lg"},Mi={class:"grid grid-cols-2 gap-2 p-2.5 bg-slate-950/70 border-b border-slate-800 text-xs"},Di={class:"flex items-center justify-between mb-1"},$i={class:"text-[10px] font-bold text-slate-300 flex items-center gap-1"},Ri=["value"],Ei=["value"],ji=["value"],Pi={class:"col-span-2 grid grid-cols-3 gap-2 pt-1 border-t border-slate-800/60 mt-1"},Li={class:"col-span-1"},Vi=["value"],Bi={class:"col-span-2"},Zi=["value"],Hi={class:"flex items-center justify-between px-3 py-1.5 bg-slate-950/50 border-b border-slate-800"},Ui={class:"flex items-center gap-2 text-xs"},Fi={key:0,class:"inline-flex items-center gap-0.5 px-1.5 py-0.2 rounded-full text-[9px] font-semibold bg-emerald-500/20 text-emerald-400 border border-emerald-500/30"},Ji={key:1,class:"inline-flex items-center gap-0.5 px-1.5 py-0.2 rounded-full text-[9px] font-semibold bg-rose-500/20 text-rose-400 border border-rose-500/30"},zi={class:"flex items-center gap-2"},Gi={key:0},Ki={class:"underline"},qi={class:"font-mono text-[10px]"},Wi={key:1},Yi={class:"font-mono text-[10px]"},Xi={class:"flex items-center gap-1.5 shrink-0"},Qi={class:"relative p-2"},eo=["value"],to={key:0,class:"text-[10px] text-rose-400 mt-1 px-1"},ao={class:"p-3 bg-slate-900/90 border border-slate-800 rounded-2xl flex flex-col gap-2.5 shadow-lg text-xs"},so={class:"flex flex-col gap-1.5"},no={class:"flex items-center justify-between gap-2"},io={class:"font-bold text-slate-300 flex items-center gap-1.5 text-[11px]"},oo={class:"flex items-center gap-1.5"},ro=["value"],lo=["value"],uo=["disabled"],co={class:"hidden sm:inline"},po={class:"flex items-center justify-between pl-5 pr-1 text-[10px] text-slate-400"},mo={class:"flex items-center gap-1 text-sky-300 font-mono"},fo=["max","value"],ho={class:"flex flex-col gap-1.5 pt-1.5 border-t border-slate-800"},xo={class:"flex items-center justify-between gap-2"},go={class:"font-bold text-slate-300 flex items-center gap-1.5 text-[11px]"},vo={class:"flex items-center gap-1.5"},yo=["value"],bo=["value"],ko=["disabled"],wo={class:"hidden sm:inline"},_o={class:"flex items-center justify-between pl-5 pr-1 text-[10px] text-slate-400"},So={class:"flex items-center gap-1 text-purple-300 font-mono"},To=["max","value"],Co={class:"flex items-center justify-between pt-1.5 border-t border-slate-800"},Ao={class:"font-bold text-slate-300 flex items-center gap-1.5 text-[11px]"},Oo={class:"flex items-center gap-1.5 flex-wrap justify-end"},Io=["onClick"],No={class:"grid grid-cols-3 gap-2 pt-1.5 border-t border-slate-800"},Mo=["checked"],Do=["checked"],$o=["checked"],Ro=["disabled"],Eo=Ht({__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(s,{emit:e}){const t=s,n=e,o=_(""),r=_(t.modelValue?.templateId||t.modelValue?.layoutType||"table"),p=_(!0),c=_(""),w=_(""),b=_("gemini-3.8-flash"),N=_("editor");function ue(){n("restoreStash"),N.value="editor"}const K=_([]),$=_("tech"),M=_(!1),B=_(null),V=_({id:"",name:"",theme:"blue-tech",description:""});async function ve(){try{const u=await $fetch("/api/niches");u?.niches&&u.niches.length>0&&(K.value=u.niches,K.value.some(i=>i.id===$.value)||($.value=K.value[0].id))}catch(u){console.error("Failed to load niches:",u)}}function $e(){B.value=null,V.value={id:"",name:"",theme:t.modelValue.theme||"blue-tech",description:""},M.value=!0}function ce(u){B.value=u.id,V.value={id:u.id,name:u.name,theme:u.theme||"blue-tech",description:u.description}}async function re(){if(!V.value.name.trim()){alert("Nama Niche wajib diisi");return}const i={id:B.value||V.value.name.toLowerCase().replace(/[^a-z0-9_-]/g,"_"),name:V.value.name.trim(),theme:V.value.theme,description:V.value.description.trim()||`Fokus pada topik ${V.value.name.trim()}`};try{const d=await $fetch("/api/niches",{method:"POST",body:i});d?.niches&&(K.value=d.niches,$.value=i.id,B.value=null,V.value={id:"",name:"",theme:"blue-tech",description:""})}catch(d){alert("Gagal menyimpan niche: "+(d.data?.statusMessage||d.message))}}async function oe(u){if(K.value.length<=1){alert("Minimal harus ada 1 niche tersisa.");return}if(confirm("Hapus niche ini?"))try{const i=await $fetch(`/api/niches?id=${u}`,{method:"DELETE"});i?.niches&&(K.value=i.niches,$.value===u&&($.value=i.niches[0].id),B.value===u&&(B.value=null))}catch(i){alert("Gagal menghapus niche: "+(i.data?.statusMessage||i.message))}}const X=_("id"),G=_([{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:""}]),me=_(!1),se=_("list"),F=_(null),W=_(""),te=_(""),fe=_(!1),_e=_(!1),Q=_(!1),Se=_(""),C=_({id:"",name:"",category:"Kustom",description:"",layoutType:"custom",customHtml:"",customCss:"",promptDirective:"",sampleJsonText:""});async function I(){try{const u=await $fetch("/api/templates");u?.templates&&u.templates.length>0&&(G.value=u.templates)}catch(u){console.error("Failed to load templates:",u)}}function h(u="list"){se.value=u,te.value="",u==="form"&&he(),me.value=!0}function Y(){he(),te.value="",se.value="form"}function Te(){he(),te.value="",se.value="list"}function U(){me.value=!1,he(),te.value="",se.value="list"}function he(){F.value=null,C.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 _t(u){if(C.value.layoutType=u,u==="custom"){C.value.customHtml||(C.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 i=G.value.find(d=>d.id===u||d.layoutType===u);i&&(C.value.promptDirective=i.promptDirective,C.value.sampleJsonText=JSON.stringify(i.sampleData,null,2),C.value.customHtml=i.customHtml||"",C.value.customCss=i.customCss||"")}function at(u){F.value=u.id,C.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)},se.value="form"}function St(u){F.value=null,C.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)},se.value="form"}const st=de(()=>`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, warna, 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
+ "footerNote": "Sumber: Lembaga Riset / Instansi Resmi (domain.go.id / .org) 2026",
33
+ "methodologyBadge": "Metodologi Riset Resmi 2026",
34
+ "disclaimer": "Ringkasan data edukasi • Bukan nasihat resmi",
35
+ "sourceUrl": "https://domain-resmi.org",
36
+ "reelsDuration": 30,
37
+ "caption": "Pertanyaan pemantik interaksi netizen? Tulis pendapatmu di bawah! 👇 #hashtags",
38
+ "items": [
39
+ { "text": "Poin penjelasan pertama yang ringkas dan padat (maksimal 20 kata per poin)..." },
40
+ { "text": "Poin penjelasan kedua yang mereplikasi isi kartu pada gambar..." },
41
+ { "text": "Poin penjelasan ketiga yang melengkapi data infografis..." }
42
+ ]
43
+ },
44
+ "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)."
45
+ }
46
+
47
+ =======================================================
48
+ PANDUAN STANDAR WAJIB ARSITEKTUR TEMPLATE SOCIALGEN:
49
+
50
+ 1. ATURAN KRUSIAL KODE HTML (JANGAN PERNAH DIHAPUS):
51
+ - Kolom \\"customHtml\\" WAJIB berupa string HTML utuh dengan seluruh tag pembuka & penutup <div>, <h1>, <p>, <span>.
52
+ - DILARANG KERAS hanya menulis variabel {{ data.title }} {{ data.items }} tanpa tag pembungkus HTML dan class CSS!
53
+ - Semua tanda kutip dua atribut di dalam JSON wajib di-escape (misal: class=\\"my-card\\").
54
+
55
+ 2. KESERASIAN ID TEMPLATE (ID MATCHING):
56
+ - Field root \\"id\\" dan field \\"sampleData.templateId\\" HARUS BERNILAI SAMA PERSIS (contoh: \\"orange-pill-hero\\").
57
+ - Jangan menggunakan ID yang berbeda antara root dan sampleData karena sistem SocialGen auto-switch menggunakan ID ini.
58
+
59
+ 3. KANVAS RESPONSIVE MULTI-FORMAT (FEED 4:5 & REELS 9:16):
60
+ - SocialGen mengekspor konten ke Feed 4:5 (1080x1350) dan Story/Reels 9:16 (1080x1920).
61
+ - JANGAN PERNAH memberi tinggi mati (height: 1350px) pada kontainer utama!
62
+ - Kontainer terluar WAJIB menggunakan:
63
+ width: 100%; max-width: 960px; margin: 0 auto; display: flex; flex-direction: column;
64
+ - Dengan aturan ini, kartu akan selalu berada tepat di tengah (center) dan berada di dalam Safe Zone baik pada format Feed maupun Reels.
65
+
66
+ 4. JANGAN DUPLIKASI HEADER & FOOTER GLOBAL SOCIALGEN:
67
+ - SocialGen SUDAH otomatis merender Top Metadata Bar (Category Badge & Watermark @SocialGen) di bagian paling atas kanvas.
68
+ - SocialGen SUDAH otomatis merender Bottom Callout (\\"💬 Drop your opinion below • Share to your feed ↗\\" & Disclaimer) di bagian paling bawah.
69
+ - Oleh karena itu, customHtml HANYA fokus mendesain kartu konten di bagian tengah:
70
+ * Header kartu (Subtitle + Judul Besar)
71
+ * Badan kartu (mockup tablet, framed box, kartu list pil/bubble)
72
+ * Sumber data (footerNote) di bagian bawah kartu
73
+
74
+ 5. TIPOGRAFI STANDAR 1080px (READABILITY V2.3.4):
75
+ - Kanvas beresolusi 1080px lebar. Agar terbaca jelas di HP tanpa zoom:
76
+ * Judul Utama (title): font-size: 52px – 64px (font-weight: 900, line-height: 1.08 - 1.15)
77
+ * Subjudul (subtitle): font-size: 22px – 26px (font-weight: 700-800)
78
+ * Teks Kartu Poin (items): font-size: 20px – 24px (font-weight: 700, line-height: 1.45)
79
+ * Sumber Data (footerNote): font-size: 16px – 18px (font-weight: 600-700)
80
+
81
+ 6. MURNI CSS EKSPLISIT DI 'customCss':
82
+ - Karena aplikasi sudah di-compile, jangan mengandalkan arbitrary Tailwind baru (seperti text-[55px] atau bg-[#123456]).
83
+ - Semua warna, background, border, radius, bayangan, font-size, dan flexbox WAJIB ditulis lengkap dan eksplisit di \\"customCss\\".
84
+
85
+ 7. KREDIBILITAS TIER 1 (META CPM MONETIZATION):
86
+ - Selalu sertakan field \\"methodologyBadge\\", \\"disclaimer\\", dan \\"sourceUrl\\" di sampleData untuk lolos verifikasi transparansi data audiens Tier 1.
87
+
88
+ Keluarkan HANYA 1 objek JSON valid tanpa markdown formatting (\`\`\`json) agar bisa langsung diimpor otomatis ke aplikasi SocialGen.`);async function nt(){await Rt(st.value)&&(fe.value=!0,setTimeout(()=>{fe.value=!1},3e3))}function Tt(){if(te.value="",!!Se.value.trim())try{let u=Se.value.trim();u=u.replace(/^```json\s*/i,"").replace(/```$/i,"").trim();const i=JSON.parse(u),d=(i.id||i.sampleData?.templateId||i.name||"").toLowerCase().replace(/[^a-z0-9_-]/g,"-").replace(/^-+|-+$/g,"");if(d&&(C.value.id=d),i.name&&(C.value.name=i.name),i.category&&(C.value.category=i.category),i.description&&(C.value.description=i.description),C.value.layoutType=i.layoutType||"custom",i.customHtml){const E=i.customHtml.trim();C.value.customHtml=E,/<[a-z][\s\S]*>/i.test(E)||(te.value="⚠️ Perhatian: customHtml tidak mendeteksi tag HTML (seperti <div>, <p>). Pastikan AI menyertakan elemen HTML pembungkus class CSS.")}if(i.customCss&&(C.value.customCss=i.customCss),i.promptDirective&&(C.value.promptDirective=i.promptDirective),i.sampleData){const E={...i.sampleData};C.value.id&&(E.templateId=C.value.id,E.layoutType="custom"),E.id||(E.id="sample-"+(C.value.id||Date.now())),C.value.sampleJsonText=JSON.stringify(E,null,2)}_e.value=!1,Se.value=""}catch(u){te.value="Gagal membaca JSON dari AI: "+u.message}}async function Ct(){if(te.value="",!C.value.name.trim()){te.value="Nama template wajib diisi";return}const u=F.value||C.value.id.trim()||C.value.name.toLowerCase().replace(/[^a-z0-9_-]/g,"-");let i=null;try{i=JSON.parse(C.value.sampleJsonText),i.id||(i.id=u)}catch(d){te.value="JSON Sampel Data tidak valid: "+d.message;return}try{const d=await $fetch("/api/templates",{method:"POST",body:{id:u,name:C.value.name.trim(),category:C.value.category.trim()||"Kustom",description:C.value.description.trim(),layoutType:C.value.layoutType,customHtml:C.value.customHtml?.trim()||void 0,customCss:C.value.customCss?.trim()||void 0,sampleData:i,promptDirective:C.value.promptDirective.trim(),isBuiltin:!!(F.value&&G.value.find(E=>E.id===F.value)?.isBuiltin)}});d?.templates&&(G.value=d.templates),se.value="list",F.value=null}catch(d){te.value=d.data?.statusMessage||d.message||"Gagal menyimpan template"}}async function A(u){if(confirm("Yakin ingin menghapus template kustom ini?"))try{const i=await $fetch(`/api/templates?id=${u}`,{method:"DELETE"});i?.templates&&(G.value=i.templates)}catch(i){alert(i.data?.statusMessage||i.message||"Gagal menghapus template")}}function v(u){At(u.layoutType==="custom"?u.id:u.layoutType||u.id),me.value=!1}const Ce=de(()=>{if(!W.value.trim())return G.value;const u=W.value.toLowerCase();return G.value.filter(i=>i.name.toLowerCase().includes(u)||i.category.toLowerCase().includes(u)||i.description.toLowerCase().includes(u)||i.layoutType.toLowerCase().includes(u))}),ne=_(!1),it=_(""),ot=_({}),Jt=_(!1),rt=_(!1),zt=_(["cyber_blue.mp4","emerald_flow.mp4","default_bg.mp4"]),Gt=_(["synthwave_pulse.mp3","lofi_chill.mp3","default_ambient.mp3"]),lt=_({"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}),Kt=de(()=>{const u=t.options.backgroundSource||"";return lt.value[u]||15}),dt=de(()=>Math.max(1,Kt.value-1)),qt=de(()=>{const u=t.options.musicFile||"";return lt.value[u]||30}),ut=de(()=>Math.max(1,qt.value-1));ge(()=>t.options.backgroundSource,()=>{const u=dt.value;(t.options.videoStartOffset||0)>u&&Pe("videoStartOffset",u)}),ge(()=>t.options.musicFile,()=>{const u=ut.value;(t.options.audioStartOffset||0)>u&&Pe("audioStartOffset",u)});const Ue=_(!1),Wt=_(null),Yt=_(null);async function Xt(){try{const u=await $fetch("/api/media");u?.videos?.length&&(zt.value=u.videos),u?.audio?.length&&(Gt.value=u.audio),u?.durations&&(lt.value={...lt.value,...u.durations})}catch(u){console.error("Failed to fetch media list:",u)}}Ut(()=>{try{const u=localStorage.getItem("sg_selected_language");u&&(X.value=u)}catch{}Xt(),ve(),I()}),ge(X,u=>{try{localStorage.setItem("sg_selected_language",u)}catch{}});async function Qt(u,i){const d=u.target,E=d.files?.[0];if(E){Ue.value=!0;try{const q=new FormData;q.append("file",E);const be=await $fetch("/api/upload-media",{method:"POST",body:q});be?.success&&(await Xt(),be.type==="video"?Pe("backgroundSource",be.filename):Pe("musicFile",be.filename))}catch(q){alert("Upload gagal: "+(q.data?.statusMessage||q.message))}finally{Ue.value=!1,d.value=""}}}const xe=de(()=>{const u=(r.value||"table").trim().toLowerCase();return G.value.find(i=>i.id.toLowerCase()===u||i.layoutType&&i.layoutType.toLowerCase()===u)||G.value[0]}),ye=de(()=>{const u=o.value.trim();if(!u)return null;try{return JSON.parse(u)}catch{return null}}),Ae=de(()=>{if(!o.value.trim()||!ye.value)return null;const u=(ye.value.templateId||ye.value.layoutType||(G.value.some(q=>q.id===ye.value?.id)?ye.value?.id:"")||"").trim().toLowerCase();if(!u)return null;const i=(r.value||"").trim().toLowerCase(),d=(xe.value?.layoutType||"").trim().toLowerCase();if(u===i||u===d)return null;const E=G.value.find(q=>q.id.toLowerCase()===u||q.layoutType&&q.layoutType.toLowerCase()===u);return{jsonTemplateId:ye.value.templateId||ye.value.layoutType||ye.value.id,matchedTarget:E||null,isKnown:!!E}}),Ye=de(()=>{if(!o.value.trim()){const u=xe.value?.sampleData?JSON.parse(JSON.stringify(xe.value.sampleData)):{},i=xe.value?.id||"table",d=xe.value?.layoutType==="custom"?i:xe.value?.layoutType||i;return{...u,id:u.id||i,templateId:i,layoutType:d,customHtml:xe.value?.customHtml||void 0,customCss:xe.value?.customCss||void 0}}if(ye.value){const u=xe.value?.id||ye.value.templateId||"table",i=xe.value?.layoutType==="custom"?u:xe.value?.layoutType||u;return{...ye.value,templateId:u,layoutType:i,customHtml:xe.value?.customHtml||ye.value.customHtml||void 0,customCss:xe.value?.customCss||ye.value.customCss||void 0}}return t.modelValue});ge(()=>Ye.value,u=>{n("update:modelValue",u),u.theme&&u.theme!==t.options.theme&&n("update:options",{...t.options,theme:u.theme})},{immediate:!0,deep:!0}),ge(()=>t.modelValue,u=>{if(!u)return;const i=JSON.stringify(Ye.value),d=JSON.stringify(u);if(i!==d){const E=u.templateId||u.layoutType;if(E){const q=G.value.find(be=>be.id.toLowerCase()===E.toLowerCase()||be.layoutType&&be.layoutType.toLowerCase()===E.toLowerCase());q&&(r.value=q.id)}o.value=JSON.stringify(u,null,2)}},{deep:!0}),ge(()=>t.unsavedStash,(u,i)=>{i&&!u&&(N.value="editor")});function $a(u){const i=u.target;if(o.value=i.value,!i.value.trim()){c.value="";return}try{const d=JSON.parse(i.value);if(c.value="",p.value){const E=(d.templateId||d.layoutType||(G.value.some(q=>q.id===d.id)?d.id:"")||"").trim().toLowerCase();if(E){const q=G.value.find(be=>be.id.toLowerCase()===E||be.layoutType&&be.layoutType.toLowerCase()===E);q&&q.id.toLowerCase()!==r.value.toLowerCase()&&(r.value=q.id,n("toast",`Otomatis pindah ke template ${q.name}`,"success"))}}}catch(d){c.value="Invalid JSON: "+d.message}}function ea(){o.value="",c.value="",n("toast",`Menggunakan data sampel template ${xe.value?.name||""}`,"success")}function Ra(){if(o.value.trim())try{const u=JSON.parse(o.value);o.value=JSON.stringify(u,null,2),c.value=""}catch{c.value="Cannot format invalid JSON"}}function At(u){r.value=u}function Ea(u){try{const i=o.value.trim()?JSON.parse(o.value):{...Ye.value};i.title=u,o.value=JSON.stringify(i,null,2)}catch{}}function ja(u){try{const i=o.value.trim()?JSON.parse(o.value):{...Ye.value};i.watermark=u,o.value=JSON.stringify(i,null,2)}catch{}}function Pa(u){try{const i=o.value.trim()?JSON.parse(o.value):{...Ye.value};i.theme=u,o.value=JSON.stringify(i,null,2)}catch{}n("update:options",{...t.options,theme:u})}function La(u){const i={...t.modelValue,reelsDuration:u};n("update:modelValue",i)}function Pe(u,i){n("update:options",{...t.options,[u]:i})}function Ot(u,i){const d=t.options.outputs||{feed:!0,story:!0,reels:!0};n("update:options",{...t.options,outputs:{...d,[u]:i}})}function ta(u,i){n("autoTopic",$.value,i||w.value||void 0,b.value,X.value)}async function Va(){ne.value=!0,Jt.value=!0;try{const u=await $fetch("/api/copy-prompt",{query:{niche:$.value,layout:t.modelValue.layoutType||"table",language:X.value}});it.value=u.prompt,ot.value={topic:u.topic,pair:u.pair,niche:u.niche,template:u.template,usedCount:u.usedCount,language:u.language||X.value}}catch(u){console.error("Failed to get manual prompt:",u)}finally{Jt.value=!1}}async function Ba(){if(!it.value)return;await Rt(it.value)&&(rt.value=!0,setTimeout(()=>{rt.value=!1},2500))}function Za(){t.history.length!==0&&confirm(`Bersihkan semua ${t.history.length} riwayat generate otomatis?`)&&n("clearAllHistory")}function Ha(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,i)=>(f(),g("div",ls,[l(M)?(f(),g("div",ds,[a("div",us,[a("div",cs,[a("div",null,[a("h3",ps,[O(l(ra),{class:"w-4 h-4 text-sky-400"}),i[49]||(i[49]=z(" Kelola & Buat Niche Baru ",-1))]),i[50]||(i[50]=a("p",{class:"text-[11px] text-slate-400 mt-0.5"}," Simpan niche favoritmu. AI dan Prompt Generator akan otomatis menggunakannya. ",-1))]),a("button",{onClick:i[0]||(i[0]=d=>M.value=!1),class:"p-1 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800"},[O(l(Mt),{class:"w-4 h-4"})])]),a("div",ms,[a("div",fs,[a("span",null,y(l(B)?"✏️ Edit Niche":"➕ Tambah Niche Baru"),1),l(B)?(f(),g("button",{key:0,onClick:i[1]||(i[1]=d=>{B.value=null,V.value={id:"",name:"",theme:"blue-tech",description:""}}),class:"text-[10px] text-slate-400 hover:text-white"}," Batal Edit ")):P("",!0)]),a("div",hs,[a("div",null,[i[51]||(i[51]=a("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Nama Niche",-1)),le(a("input",{"onUpdate:modelValue":i[2]||(i[2]=d=>l(V).name=d),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),[[ke,l(V).name]])]),a("div",null,[i[53]||(i[53]=a("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Tema Default",-1)),le(a("select",{"onUpdate:modelValue":i[3]||(i[3]=d=>l(V).theme=d),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"},[...i[52]||(i[52]=[pt('<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),[[ct,l(V).theme]])])]),a("div",null,[i[54]||(i[54]=a("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Fokus Topik & Instruksi Prompt",-1)),le(a("textarea",{"onUpdate:modelValue":i[4]||(i[4]=d=>l(V).description=d),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),[[ke,l(V).description]])]),a("button",{onClick:re,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"},[O(l(Je),{class:"w-3.5 h-3.5"}),a("span",null,y(l(B)?"Perbarui Niche":"Simpan Niche"),1)])]),a("div",xs,[a("div",gs," Daftar Niche Tersimpan ("+y(l(K).length)+") ",1),a("div",vs,[(f(!0),g(Oe,null,Ie(l(K),d=>(f(),g("div",{key:d.id,class:"p-2.5 rounded-xl border bg-slate-950 border-slate-800 flex items-start justify-between gap-2"},[a("div",ys,[a("div",bs,[a("span",ks,y(d.name),1),a("span",ws,y(d.theme||"blue-tech"),1)]),a("p",_s,y(d.description),1)]),a("div",Ss,[a("button",{onClick:E=>ce(d),class:"p-1.5 rounded-lg text-slate-400 hover:text-sky-300 hover:bg-slate-800 transition",title:"Edit Niche"},[O(l(ft),{class:"w-3.5 h-3.5"})],8,Ts),a("button",{onClick:E=>oe(d.id),class:"p-1.5 rounded-lg text-slate-400 hover:text-rose-400 hover:bg-slate-800 transition",title:"Hapus Niche"},[O(l(ht),{class:"w-3.5 h-3.5"})],8,Cs)])]))),128))])])])])):P("",!0),l(ne)?(f(),g("div",As,[a("div",Os,[a("div",Is,[a("div",null,[a("h3",Ns,[O(l(ia),{class:"w-4 h-4 text-purple-400"}),i[55]||(i[55]=z(" Master Prompt AI (Dynamic Research & Zero-Collision) ",-1))]),i[56]||(i[56]=a("p",{class:"text-[11px] text-slate-400 mt-0.5"}," Salin prompt ini ke ChatGPT / Gemini / Claude / DeepSeek untuk mencari topik terbaru. ",-1))]),a("button",{onClick:i[5]||(i[5]=d=>ne.value=!1),class:"p-1 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800"},[O(l(Mt),{class:"w-4 h-4"})])]),a("div",Ms,[i[57]||(i[57]=a("span",{class:"font-bold text-sky-400"},"Niche Aktif:",-1)),a("span",Ds,y(l(K).find(d=>d.id===l($))?.name||"Default"),1),i[58]||(i[58]=a("span",{class:"text-slate-500"},"•",-1)),i[59]||(i[59]=a("span",{class:"font-bold text-amber-400"},"Template:",-1)),a("span",$s,y(l(ot).template||"Otomatis"),1),i[60]||(i[60]=a("span",{class:"text-slate-500"},"•",-1)),i[61]||(i[61]=a("span",{class:"font-bold text-emerald-400"},"Bahasa:",-1)),a("span",Rs,y(l(ot).language||"Bahasa Indonesia 🇮🇩"),1),i[62]||(i[62]=a("span",{class:"text-slate-500"},"•",-1)),a("span",Es,y(l(ot).usedCount||0)+" Topik Riwayat Dikecualikan",1)]),a("div",js,[a("textarea",{value:l(it),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,Ps)]),a("div",Ls,[i[63]||(i[63]=a("span",{class:"text-[11px] text-slate-400"},[z(" Paste hasil JSON yang kamu buat ke kolom "),a("b",null,"RAW JSON"),z(" SocialGen. ")],-1)),a("button",{onClick:Ba,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"},[l(rt)?(f(),Ne(l(Je),{key:0,class:"w-4 h-4 text-emerald-400"})):(f(),Ne(l(xt),{key:1,class:"w-4 h-4"})),a("span",null,y(l(rt)?"Prompt Berhasil Disalin!":"Copy Master Prompt"),1)])])])])):P("",!0),l(me)?(f(),g("div",{key:2,onClick:It(U,["self"]),class:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm flex items-center justify-center p-4"},[a("div",Vs,[a("div",Bs,[a("div",null,[a("h3",Zs,[O(l(oa),{class:"w-4 h-4 text-sky-400"}),i[64]||(i[64]=z(" Kelola Template Visual (Dynamic Template System) ",-1))]),i[65]||(i[65]=a("p",{class:"text-[11px] text-slate-400 mt-0.5"}," Buat format baru, edit sampel tampilan, dan atur prompt AI spesifik per template. ",-1))]),a("button",{onClick:U,class:"p-1 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800"},[O(l(Mt),{class:"w-4 h-4"})])]),a("div",Hs,[a("div",Us,[a("button",{onClick:Te,class:J(["px-3 py-1 rounded-lg transition font-bold text-xs",l(se)==="list"?"bg-slate-800 text-sky-400 shadow":"text-slate-400 hover:text-white"])}," Daftar Template ("+y(l(G).length)+") ",3),a("button",{onClick:Y,class:J(["px-3 py-1 rounded-lg transition font-bold text-xs flex items-center gap-1",l(se)==="form"&&!l(F)?"bg-slate-800 text-emerald-400 shadow":"text-slate-400 hover:text-white"])},[O(l(Nt),{class:"w-3.5 h-3.5"}),i[66]||(i[66]=a("span",null,"Buat Template Baru",-1))],2),l(F)&&l(se)==="form"?(f(),g("span",Fs,[O(l(ft),{class:"w-3 h-3"}),i[67]||(i[67]=a("span",null,"Sedang Edit Template",-1))])):P("",!0)]),l(se)==="list"?le((f(),g("input",{key:0,"onUpdate:modelValue":i[6]||(i[6]=d=>Ze(W)?W.value=d: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)),[[ke,l(W)]]):P("",!0)]),l(se)==="list"?(f(),g("div",Js,[l(Ce).length===0?(f(),g("div",zs,' Tidak ada template yang cocok dengan pencarian "'+y(l(W))+'". ',1)):P("",!0),(f(!0),g(Oe,null,Ie(l(Ce),d=>(f(),g("div",{key:d.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"},[a("div",Gs,[a("div",Ks,[a("span",qs,y(d.name),1),a("span",Ws,y(d.category),1),a("span",{class:J(["px-1.5 py-0.2 rounded text-[8px] font-bold uppercase tracking-wider",d.isBuiltin?"bg-slate-800 text-slate-400 border border-slate-700":"bg-purple-950 text-purple-300 border border-purple-800"])},y(d.isBuiltin?"Bawaan":"⭐ Kustom"),3),a("span",Ys," layout: "+y(d.layoutType),1)]),a("p",Xs,y(d.description||"Tidak ada deskripsi."),1)]),a("div",Qs,[a("button",{onClick:E=>v(d),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"},[O(l(Je),{class:"w-3 h-3"}),i[68]||(i[68]=a("span",null,"Pilih Format",-1))],8,en),a("button",{onClick:E=>St(d),class:"p-1.5 rounded-lg text-slate-400 hover:text-sky-300 hover:bg-slate-800 transition",title:"Duplikasi sebagai template kustom baru"},[O(l(xt),{class:"w-3.5 h-3.5"})],8,tn),d.isBuiltin?P("",!0):(f(),g("button",{key:0,onClick:E=>at(d),class:"p-1.5 rounded-lg text-slate-400 hover:text-amber-300 hover:bg-slate-800 transition",title:"Edit template kustom"},[O(l(ft),{class:"w-3.5 h-3.5"})],8,an)),d.isBuiltin?P("",!0):(f(),g("button",{key:1,onClick:E=>A(d.id),class:"p-1.5 rounded-lg text-slate-400 hover:text-rose-400 hover:bg-slate-800 transition",title:"Hapus template kustom"},[O(l(ht),{class:"w-3.5 h-3.5"})],8,sn))])]))),128))])):(f(),g("div",nn,[l(te)?(f(),g("div",on,y(l(te)),1)):P("",!0),l(F)?(f(),g("div",rn,[a("div",ln,[a("div",dn,[O(l(ft),{class:"w-4 h-4"})]),a("div",un,[a("div",cn,[i[69]||(i[69]=a("span",null,"Sedang Mengedit:",-1)),a("span",pn,y(l(C).name),1)]),a("div",mn,"ID: "+y(l(C).id)+" • Perubahan akan memperbarui template yang tersimpan",1)])]),a("button",{onClick:Y,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"},[O(l(Nt),{class:"w-3 h-3"}),i[70]||(i[70]=a("span",null,"Beralih ke Buat Baru",-1))])])):P("",!0),a("div",fn,[a("div",hn,[i[72]||(i[72]=a("div",{class:"flex items-center gap-2"},[a("span",{class:"text-xl"},"🤖"),a("div",null,[a("h4",{class:"text-xs font-black text-white"},"Buat Template Otomatis dari Screenshot / Gambar"),a("p",{class:"text-[10px] text-slate-400"},"Punya referensi gambar desain? Salin prompt AI dan kirim bersama screenshot ke ChatGPT / Claude / Gemini.")])],-1)),a("div",xn,[a("button",{onClick:nt,type:"button",class:J(["px-2.5 py-1.5 rounded-xl text-xs font-bold transition flex items-center gap-1.5 shadow",l(fe)?"bg-emerald-600 text-white":"bg-sky-600 hover:bg-sky-500 text-white"])},[O(l(xt),{class:"w-3.5 h-3.5"}),a("span",null,y(l(fe)?"✓ Prompt Tersalin!":"Salin Prompt Bantuan AI"),1)],2),a("button",{onClick:i[7]||(i[7]=d=>Q.value=!l(Q)),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:l(Q)?"Sembunyikan teks prompt":"Lihat / salin teks prompt manual di HP"},[a("span",null,y(l(Q)?"Tutup Teks":"👁️ Lihat Teks Prompt"),1)],8,gn),a("button",{onClick:i[8]||(i[8]=d=>_e.value=!l(_e)),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"},[...i[71]||(i[71]=[a("span",null,"📥 Tempel JSON",-1)])])])]),l(Q)?(f(),g("div",vn,[a("div",yn,[i[73]||(i[73]=a("label",{class:"text-[10px] font-bold text-sky-400"},"Teks Lengkap Prompt Bantuan AI (Bisa ditandai/disalin manual di HP):",-1)),a("button",{onClick:i[9]||(i[9]=d=>Q.value=!1),class:"text-[10px] text-slate-400 hover:text-white"},"✕ Tutup")]),a("textarea",{value:l(st),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)])):P("",!0),l(_e)?(f(),g("div",kn,[i[74]||(i[74]=a("label",{class:"text-[10px] font-bold text-sky-400"},"Tempelkan respon JSON dari AI di sini:",-1)),le(a("textarea",{"onUpdate:modelValue":i[10]||(i[10]=d=>Ze(Se)?Se.value=d: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),[[ke,l(Se)]]),a("div",wn,[a("button",{onClick:i[11]||(i[11]=d=>_e.value=!1),type:"button",class:"px-2.5 py-1 rounded-lg text-[10px] font-bold text-slate-400 hover:text-white"}," Tutup "),a("button",{onClick:Tt,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 ")])])):P("",!0)]),a("div",_n,[a("div",null,[i[75]||(i[75]=a("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"ID Template (Slug Unik)",-1)),le(a("input",{"onUpdate:modelValue":i[12]||(i[12]=d=>l(C).id=d),disabled:!!l(F),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,Sn),[[ke,l(C).id]])]),a("div",null,[i[76]||(i[76]=a("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Nama Template",-1)),le(a("input",{"onUpdate:modelValue":i[13]||(i[13]=d=>l(C).name=d),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),[[ke,l(C).name]])]),a("div",null,[i[77]||(i[77]=a("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Kategori",-1)),le(a("input",{"onUpdate:modelValue":i[14]||(i[14]=d=>l(C).category=d),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),[[ke,l(C).category]])])]),a("div",Tn,[a("div",null,[i[79]||(i[79]=a("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Base Layout Visual Engine",-1)),a("select",{value:l(C).layoutType,onChange:i[15]||(i[15]=d=>_t(d.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"},[...i[78]||(i[78]=[pt('<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,Cn)]),a("div",null,[i[80]||(i[80]=a("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Deskripsi Ringkas",-1)),le(a("input",{"onUpdate:modelValue":i[16]||(i[16]=d=>l(C).description=d),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),[[ke,l(C).description]])])]),l(C).layoutType==="custom"?(f(),g("div",An,[a("div",On,[a("span",In,[O(l(Wa),{class:"w-3.5 h-3.5"}),i[81]||(i[81]=z(" Template Engine HTML & Styling CSS ",-1))]),i[82]||(i[82]=a("span",{class:"text-[10px] text-slate-400 font-mono"},"Gunakan {{ data.title }} & {{#each data.items}}",-1))]),a("div",null,[i[83]||(i[83]=a("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"HTML Template (Tailwind utility classes didukung penuh)",-1)),le(a("textarea",{"onUpdate:modelValue":i[17]||(i[17]=d=>l(C).customHtml=d),rows:"6",placeholder:`<div class="p-6 rounded-2xl bg-slate-900/90 border border-slate-700 text-center">
89
+ <h2 class="text-3xl font-black text-white">{{ data.title }}</h2>
90
+ <p class="text-slate-300">{{ data.subtitle }}</p>
91
+ </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),[[ke,l(C).customHtml]])]),a("div",null,[i[84]||(i[84]=a("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Custom CSS (Opsional - animasi, gradien unik, glassmorphism)",-1)),le(a("textarea",{"onUpdate:modelValue":i[18]||(i[18]=d=>l(C).customCss=d),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),[[ke,l(C).customCss]])])])):P("",!0),a("div",null,[i[85]||(i[85]=a("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"AI Prompt Directive (Aturan Khusus Generator)",-1)),le(a("textarea",{"onUpdate:modelValue":i[19]||(i[19]=d=>l(C).promptDirective=d),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),[[ke,l(C).promptDirective]])]),a("div",null,[i[86]||(i[86]=a("div",{class:"flex items-center justify-between mb-1"},[a("label",{class:"text-[10px] font-bold text-slate-400"},"Sampel Data JSON (Pristine Default Tampilan)"),a("span",{class:"text-[10px] text-slate-500"},"Akan langsung ditampilkan di Live Preview")],-1)),le(a("textarea",{"onUpdate:modelValue":i[20]||(i[20]=d=>l(C).sampleJsonText=d),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),[[ke,l(C).sampleJsonText]])]),a("div",Nn,[a("button",{onClick:Te,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 "),a("button",{onClick:Ct,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"},[O(l(Je),{class:"w-3.5 h-3.5"}),a("span",null,y(l(F)?"Perbarui Template":"Simpan Template"),1)])])]))])])):P("",!0),a("div",Mn,[a("div",null,[a("h2",Dn,[O(l(is),{class:"w-3.5 h-3.5 text-sky-400"}),i[87]||(i[87]=z(" Content Studio ",-1))]),i[88]||(i[88]=a("p",{class:"text-[10px] text-slate-400"},"Multi-Format Studio",-1))]),a("div",$n,[a("div",Rn,[le(a("select",{"onUpdate:modelValue":i[21]||(i[21]=d=>Ze($)?$.value=d:null),class:"bg-transparent text-[11px] font-bold text-sky-300 focus:outline-none px-2 py-0.5 cursor-pointer max-w-[130px] truncate",title:"Pilih Niche Konten"},[(f(!0),g(Oe,null,Ie(l(K),d=>(f(),g("option",{key:d.id,value:d.id,class:"bg-slate-900 text-white"},y(d.name),9,En))),128))],512),[[ct,l($)]]),a("button",{onClick:$e,class:"p-1 px-1.5 rounded-lg bg-slate-800 hover:bg-slate-700 text-sky-400 hover:text-sky-300 border border-slate-700 text-[10px] font-bold transition flex items-center gap-1",title:"Kelola & Buat Niche Baru"},[O(l(Nt),{class:"w-3 h-3"}),i[89]||(i[89]=a("span",{class:"hidden sm:inline"},"Niche",-1))])]),a("div",jn,[O(l(Qa),{class:"w-3 h-3 text-emerald-400 ml-1 flex-shrink-0"}),le(a("select",{"onUpdate:modelValue":i[22]||(i[22]=d=>Ze(X)?X.value=d:null),class:"bg-transparent text-[11px] font-bold text-emerald-300 focus:outline-none px-1.5 py-0.5 cursor-pointer max-w-[130px] truncate"},[...i[90]||(i[90]=[pt('<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),[[ct,l(X)]])]),a("button",{onClick:Va,title:"Buat prompt manual bebas bentrok untuk ChatGPT / Gemini Web",class:"inline-flex items-center gap-1 px-2.5 py-1.5 text-[11px] font-bold text-purple-300 bg-purple-950/40 hover:bg-purple-900/50 border border-purple-500/30 rounded-xl transition shadow-sm"},[O(l(ia),{class:"w-3 h-3"}),i[91]||(i[91]=a("span",{class:"hidden sm:inline"},"Prompt Manual",-1))]),a("button",{onClick:i[23]||(i[23]=d=>ta()),disabled:s.isGenerating||s.isAutoTopicLoading,class:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-bold text-white bg-gradient-to-r from-sky-500 via-indigo-600 to-purple-600 hover:from-sky-400 hover:to-indigo-500 rounded-xl shadow-md transition disabled:opacity-50"},[O(l(la),{class:J(["w-3.5 h-3.5",{"animate-spin":s.isAutoTopicLoading}])},null,8,["class"]),a("span",null,y(s.isAutoTopicLoading?"Meriset Data...":"✨ Auto-Topic"),1)],8,Pn),a("div",Ln,[i[96]||(i[96]=a("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)),a("div",Vn,[i[94]||(i[94]=a("div",{class:"px-3 py-1 text-[10px] font-bold text-slate-500 uppercase"},"Model AI Engine",-1)),a("div",Bn,[le(a("select",{"onUpdate:modelValue":i[24]||(i[24]=d=>Ze(b)?b.value=d:null),class:"w-full bg-slate-950 border border-slate-700 rounded-lg p-1.5 text-xs text-sky-300 focus:outline-none"},[...i[92]||(i[92]=[a("option",{value:"gemini-3.8-flash"},"⚡ Gemini 3.8 Flash",-1),a("option",{value:"gemini-3.5-flash"},"⚡ Gemini 3.5 Flash",-1),a("option",{value:"gemini-2.5-pro"},"💎 Gemini 2.5 Pro",-1),a("option",{value:"gemini-1.5-pro"},"💎 Gemini 1.5 Pro",-1)])],512),[[ct,l(b)]])]),i[95]||(i[95]=a("div",{class:"border-t border-slate-800 my-1"},null,-1)),a("div",Zn,[i[93]||(i[93]=a("span",null,"Pilih Format Template",-1)),a("span",Hn,y(l(G).length)+" opsi",1)]),a("div",Un,[(f(!0),g(Oe,null,Ie(l(G),d=>(f(),g("button",{key:d.id,onClick:E=>ta(void 0,d.id),class:"px-3 py-1.5 text-left text-slate-200 hover:bg-slate-800 text-[11px] flex items-center justify-between group/item"},[a("span",Jn,y(d.name),1),d.isBuiltin?P("",!0):(f(),g("span",zn,"Kustom"))],8,Fn))),128))])])])])]),s.isAutoTopicLoading?(f(),g("div",Gn,[a("div",Kn,[O(l(la),{class:"w-3.5 h-3.5 text-sky-400 animate-spin"})]),a("div",qn,[a("div",Wn,[i[97]||(i[97]=a("span",null,"AI Research Engine Sedang Bekerja...",-1)),a("span",Yn,y(l(b)),1)]),i[98]||(i[98]=a("p",{class:"text-[10px] text-slate-300 mt-0.5"},"Menganalisis angka perbandingan 2026 & meracik copywriting viral.",-1))])])):P("",!0),a("div",Xn,[a("div",Qn,[a("button",{onClick:i[25]||(i[25]=d=>N.value="editor"),class:J(["px-2.5 py-1 rounded-lg transition text-[11px]",l(N)==="editor"?"bg-slate-800 text-sky-400 shadow font-bold":"text-slate-400 hover:text-white"])}," JSON Editor ",2),a("button",{onClick:i[26]||(i[26]=d=>N.value="drafts"),class:J(["px-2.5 py-1 rounded-lg transition flex items-center gap-1 text-[11px]",l(N)==="drafts"?"bg-slate-800 text-amber-400 shadow font-bold":"text-slate-400 hover:text-white"]),title:"Draft yang kamu simpan manual untuk dipakai nanti"},[O(l(sa),{class:"w-3 h-3"}),a("span",null,"Drafts ("+y(s.drafts.length)+")",1)],2),a("button",{onClick:i[27]||(i[27]=d=>N.value="history"),class:J(["px-2.5 py-1 rounded-lg transition flex items-center gap-1 text-[11px]",l(N)==="history"?"bg-slate-800 text-purple-400 shadow font-bold":"text-slate-400 hover:text-white"]),title:"Riwayat otomatis setiap kali generate"},[O(l(na),{class:"w-3 h-3"}),a("span",null,"Riwayat ("+y(s.history.length)+")",1)],2)]),a("div",ei,[s.unsavedStash?(f(),g("button",{key:0,onClick:ue,class:"text-[10px] text-amber-400 hover:text-amber-300 transition font-bold px-2 py-0.5 rounded-lg border border-amber-500/30 bg-amber-500/10 flex items-center gap-1",title:"Kembalikan editan aktif sebelum memilih draft/riwayat"},[...i[99]||(i[99]=[a("span",null,"↩️ Kembali ke Editan",-1)])])):P("",!0),l(N)==="history"&&s.history.length>0?(f(),g("button",{key:1,onClick:Za,class:"text-[10px] text-rose-400 hover:text-rose-300 transition font-bold pr-1",title:"Bersihkan semua riwayat generate"}," Bersihkan Riwayat ")):P("",!0),a("button",{onClick:i[28]||(i[28]=d=>n("saveDraft")),class:"text-[10px] text-amber-400 hover:text-amber-300 transition pr-2 font-bold flex items-center gap-1",title:"Simpan data saat ini ke Drafts untuk digunakan nanti"},[O(l(sa),{class:"w-3 h-3"}),i[100]||(i[100]=a("span",null,"+ Simpan ke Draft",-1))])])]),l(N)==="drafts"?(f(),g("div",ti,[s.unsavedStash?(f(),g("div",ai,[a("div",si,[i[102]||(i[102]=a("span",{class:"text-sm"},"✏️",-1)),a("div",ni,[i[101]||(i[101]=a("span",{class:"font-bold text-[10px] block text-amber-300"},"Ada editan aktif sebelumnya:",-1)),a("span",ii,'"'+y(s.unsavedStash.title||"Tanpa Judul")+'"',1)])]),a("div",oi,[a("button",{onClick:ue,class:"px-2 py-1 bg-amber-500 hover:bg-amber-400 text-slate-950 font-bold rounded-lg text-[10px] transition shadow flex items-center gap-1 active:scale-95",title:"Kembalikan editan aktif sebelum membuka draft ini"},[...i[103]||(i[103]=[a("span",null,"↩️ Kembali ke Editan",-1)])]),a("button",{onClick:i[29]||(i[29]=d=>n("clearStash")),class:"p-1 hover:text-white text-amber-400/70 transition text-xs",title:"Abaikan & buang simpanan editan ini"}," ✕ ")])])):P("",!0),s.drafts.length===0?(f(),g("div",ri,[...i[104]||(i[104]=[z(" Belum ada draft tersimpan.",-1),a("br",null,null,-1),z(" Klik ",-1),a("b",{class:"text-amber-400"},"+ Simpan ke Draft",-1),z(" di atas untuk menyimpan konten ini agar bisa diedit/digenerate nanti! ",-1)])])):P("",!0),(f(!0),g(Oe,null,Ie(s.drafts,(d,E)=>(f(),g("div",{key:E,onClick:q=>n("selectDraft",E),"data-draft-item":"",class:J(["p-2 rounded-xl border cursor-pointer transition flex items-center justify-between text-xs group",s.activeDraftIndex===E?"bg-amber-500/15 border-amber-500/50 text-white":"bg-slate-950/60 border-slate-800 text-slate-300 hover:border-slate-700"])},[a("div",di,[a("div",ui,[a("span",ci,y(d.layoutType||"table"),1),a("span",pi,y(d.category),1)]),a("div",mi,y(d.title),1)]),a("button",{onClick:It(q=>n("deleteDraft",E),["stop"]),class:"opacity-0 group-hover:opacity-100 p-1 text-slate-400 hover:text-rose-400 transition rounded",title:"Hapus draft ini"},[O(l(ht),{class:"w-3.5 h-3.5"})],8,fi)],10,li))),128))])):l(N)==="history"?(f(),g("div",hi,[s.unsavedStash?(f(),g("div",xi,[a("div",gi,[i[106]||(i[106]=a("span",{class:"text-sm"},"✏️",-1)),a("div",vi,[i[105]||(i[105]=a("span",{class:"font-bold text-[10px] block text-purple-300"},"Ada editan aktif sebelumnya:",-1)),a("span",yi,'"'+y(s.unsavedStash.title||"Tanpa Judul")+'"',1)])]),a("div",bi,[a("button",{onClick:ue,class:"px-2 py-1 bg-purple-500 hover:bg-purple-400 text-white font-bold rounded-lg text-[10px] transition shadow flex items-center gap-1 active:scale-95",title:"Kembalikan editan aktif sebelum membuka riwayat ini"},[...i[107]||(i[107]=[a("span",null,"↩️ Kembali ke Editan",-1)])]),a("button",{onClick:i[30]||(i[30]=d=>n("clearStash")),class:"p-1 hover:text-white text-purple-400/70 transition text-xs",title:"Abaikan & buang simpanan editan ini"}," ✕ ")])])):P("",!0),s.history.length===0?(f(),g("div",ki,[...i[108]||(i[108]=[z(" Belum ada riwayat pembuatan.",-1),a("br",null,null,-1),z(" Setiap kali kamu klik ",-1),a("b",{class:"text-sky-400"},"GENERATE CONTENT",-1),z(", hasil pembuatan akan otomatis tercatat di sini! ",-1)])])):P("",!0),(f(!0),g(Oe,null,Ie(s.history,(d,E)=>(f(),g("div",{key:E,onClick:q=>n("selectHistory",E),"data-history-item":"",class:J(["p-2 rounded-xl border cursor-pointer transition flex items-center justify-between text-xs group",s.activeHistoryIndex===E?"bg-purple-500/15 border-purple-500/50 text-white":"bg-slate-950/60 border-slate-800 text-slate-300 hover:border-slate-700"])},[a("div",_i,[a("div",Si,[a("span",Ti,y(d.layoutType||"reels"),1),a("span",Ci,y(d.category),1),d.generatedAt?(f(),g("span",Ai,y(Ha(d.generatedAt)),1)):P("",!0)]),a("div",Oi,y(d.title),1)]),a("button",{onClick:It(q=>n("deleteHistory",E),["stop"]),class:"opacity-0 group-hover:opacity-100 p-1 text-slate-400 hover:text-rose-400 transition rounded",title:"Hapus riwayat ini"},[O(l(ht),{class:"w-3.5 h-3.5"})],8,Ii)],10,wi))),128))])):(f(),g("div",Ni,[a("div",Mi,[a("div",null,[a("div",Di,[a("label",$i,[O(l(oa),{class:"w-3 h-3 text-sky-400"}),i[109]||(i[109]=z(" Format Template ",-1))]),a("button",{onClick:i[31]||(i[31]=d=>h("list")),class:"text-[10px] font-bold text-sky-400 hover:text-sky-300 flex items-center gap-0.5 transition",title:"Kelola & buat template kustom baru"},[O(l(ra),{class:"w-3 h-3"}),i[110]||(i[110]=a("span",null,"Kelola",-1))])]),a("select",{value:l(r),onChange:i[32]||(i[32]=d=>At(d.target.value)),class:"w-full bg-slate-900 border border-slate-800 rounded-lg p-1.5 text-slate-200 focus:outline-none focus:border-sky-500 font-semibold text-[11px]"},[(f(!0),g(Oe,null,Ie(l(G),d=>(f(),g("option",{key:d.id,value:d.id},y(d.name)+" "+y(d.isBuiltin?"":"⭐ (Kustom)"),9,Ei))),128))],40,Ri)]),a("div",null,[i[112]||(i[112]=a("label",{class:"block text-[10px] font-bold text-slate-300 mb-1"}," Theme Color (10 Pilihan) ",-1)),a("select",{value:s.modelValue.theme||"blue-tech",onChange:i[33]||(i[33]=d=>Pa(d.target.value)),class:"w-full bg-slate-900 border border-slate-800 rounded-lg p-1.5 text-slate-200 focus:outline-none focus:border-sky-500 font-semibold text-[11px]"},[...i[111]||(i[111]=[pt('<option value="blue-tech">🔵 Blue Tech (AI &amp; Software)</option><option value="emerald-finance">🟢 Emerald Finance (Salaries &amp; Living)</option><option value="slate-education">🟣 Slate Education (Education &amp; Career)</option><option value="dark-contrast">⚫ Dark Contrast (Universal Bold)</option><option value="crimson-alert">🔴 Crimson Alert (Breaking Shock)</option><option value="amber-gold">🟡 Amber Gold (Luxury &amp; Executive)</option><option value="cyber-violet">🟪 Cyber Violet (Synthwave &amp; Neon)</option><option value="sunset-orange">🟠 Sunset Orange (Warm Energy)</option><option value="nordic-frost">❄️ Nordic Frost (Polar Cyan Clean)</option><option value="monochrome-luxe">⚪ Monochrome Luxe (Minimalist)</option>',10)])],40,ji)]),a("div",Pi,[a("div",Li,[i[113]||(i[113]=a("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"}," Watermark Handle ",-1)),a("input",{type:"text",value:s.modelValue.watermark||"@SocialGen",onInput:i[34]||(i[34]=d=>ja(d.target.value)),placeholder:"@NamaAkun",class:"w-full bg-slate-900 border border-slate-800 rounded-lg px-2.5 py-1.5 text-sky-400 font-semibold text-[11px] focus:outline-none focus:border-sky-500 transition"},null,40,Vi)]),a("div",Bi,[i[114]||(i[114]=a("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"}," Judul Konten (Title) ",-1)),a("input",{type:"text",value:s.modelValue.title,onInput:i[35]||(i[35]=d=>Ea(d.target.value)),placeholder:"Judul Utama Konten...",class:"w-full bg-slate-900 border border-slate-800 rounded-lg px-2.5 py-1.5 text-slate-100 font-semibold text-[11px] focus:outline-none focus:border-sky-500 transition"},null,40,Zi)])])]),a("div",Hi,[a("div",Ui,[i[116]||(i[116]=a("span",{class:"font-bold text-slate-300 text-[10px]"},"RAW JSON SocialGen",-1)),l(c)?(f(),g("span",Ji,[O(l(Ka),{class:"w-2.5 h-2.5"}),i[115]||(i[115]=z(" Invalid ",-1))])):(f(),g("span",Fi,[O(l(qa),{class:"w-2.5 h-2.5"}),z(" "+y(l(o).trim()?"Valid":"Sample Mode"),1)]))]),a("div",zi,[a("button",{onClick:ea,class:"text-[10px] text-slate-400 hover:text-amber-400 transition flex items-center gap-1",title:"Kosongkan JSON dan gunakan data sampel bawaan template aktif"},[O(l(Ia),{class:"w-2.5 h-2.5"}),i[117]||(i[117]=a("span",null,"Clear / Pakai Sample",-1))]),i[118]||(i[118]=a("span",{class:"text-slate-700"},"|",-1)),a("button",{onClick:Ra,class:"text-[10px] text-slate-400 hover:text-sky-400 transition"}," Format JSON ")])]),l(Ae)?(f(),g("div",{key:0,class:J(["mx-2.5 mt-2.5 p-2 rounded-xl border text-xs transition-all shadow-md flex flex-col sm:flex-row sm:items-center justify-between gap-2",l(Ae).isKnown?"bg-amber-500/10 border-amber-500/30":"bg-rose-500/10 border-rose-500/30"])},[a("div",{class:J(["flex items-center gap-1.5 text-[11px]",l(Ae).isKnown?"text-amber-300":"text-rose-300"])},[i[124]||(i[124]=a("span",{class:"text-sm"},"⚠️",-1)),l(Ae).isKnown?(f(),g("span",Gi,[i[119]||(i[119]=z(" JSON ini dibuat untuk template ",-1)),a("b",Ki,y(l(Ae).matchedTarget?.name),1),i[120]||(i[120]=z(" (",-1)),a("span",qi,y(l(Ae).jsonTemplateId),1),i[121]||(i[121]=z(") ",-1))])):(f(),g("span",Wi,[i[122]||(i[122]=z(' Template dengan ID "',-1)),a("span",Yi,y(l(Ae).jsonTemplateId),1),i[123]||(i[123]=z('" tidak ditemukan di sistem. ',-1))]))],2),a("div",Xi,[l(Ae).isKnown&&l(Ae).matchedTarget?(f(),g("button",{key:0,onClick:i[36]||(i[36]=d=>At(l(Ae).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 flex items-center gap-1"}," Pindah ke Template Ini ")):P("",!0),a("button",{onClick:ea,class:"px-2 py-0.5 rounded-lg bg-slate-800 hover:bg-slate-700 text-slate-300 text-[10px] font-semibold transition"}," Hapus JSON (Pakai Sample) ")])],2)):P("",!0),a("div",Qi,[a("textarea",{value:l(o),onInput:$a,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",placeholder:"Paste Content JSON here... (kosong = otomatis menggunakan data sampel template aktif)"},null,40,eo),l(c)||s.validationError?(f(),g("p",to," ⚠️ "+y(l(c)||s.validationError),1)):P("",!0)])])),a("input",{type:"file",ref_key:"videoInputRef",ref:Wt,accept:"video/mp4,video/webm",class:"hidden",onChange:i[37]||(i[37]=d=>Qt(d))},null,544),a("input",{type:"file",ref_key:"audioInputRef",ref:Yt,accept:"audio/mp3,audio/mpeg,audio/wav",class:"hidden",onChange:i[38]||(i[38]=d=>Qt(d))},null,544),a("div",ao,[a("div",so,[a("div",no,[a("label",io,[O(l(Ca),{class:"w-3.5 h-3.5 text-sky-400"}),i[125]||(i[125]=a("span",null,"Background",-1))]),a("div",oo,[a("select",{value:s.options.backgroundSource||"random",onChange:i[39]||(i[39]=d=>Pe("backgroundSource",d.target.value)),class:"bg-slate-950 border border-slate-800 rounded-lg px-2 py-1 text-slate-300 text-[11px] focus:outline-none max-w-[170px]"},[i[126]||(i[126]=a("option",{value:"random"},"🔀 Acak Video",-1)),(f(!0),g(Oe,null,Ie(l(zt),d=>(f(),g("option",{key:d,value:d},y(d.replace(".mp4","").replace(/_/g," ")),9,lo))),128)),i[127]||(i[127]=a("option",{value:"pexels"},"🌐 Pexels API (Auto HD)",-1))],40,ro),a("button",{onClick:i[40]||(i[40]=d=>l(Wt)?.click()),disabled:l(Ue),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"},[O(l(da),{class:"w-3 h-3"}),a("span",co,y(l(Ue)?"...":"Upload"),1)],8,uo)])]),a("div",po,[a("span",mo,[O(l(Et),{class:"w-2.5 h-2.5"}),z(" Mulai: "+y(Math.min(s.options.videoStartOffset||0,l(dt)))+"s / "+y(l(Kt))+"s ",1)]),a("input",{type:"range",min:"0",max:l(dt),step:"1",value:Math.min(s.options.videoStartOffset||0,l(dt)),onInput:i[41]||(i[41]=d=>Pe("videoStartOffset",Number(d.target.value))),class:"w-32 h-1 bg-slate-950 rounded appearance-none cursor-pointer accent-sky-400"},null,40,fo)])]),a("div",ho,[a("div",xo,[a("label",go,[O(l(Aa),{class:"w-3.5 h-3.5 text-purple-400"}),i[128]||(i[128]=a("span",null,"Musik Reels",-1))]),a("div",vo,[a("select",{value:s.options.musicFile||"random",onChange:i[42]||(i[42]=d=>Pe("musicFile",d.target.value)),class:"bg-slate-950 border border-slate-800 rounded-lg px-2 py-1 text-slate-300 text-[11px] focus:outline-none max-w-[170px]"},[i[129]||(i[129]=a("option",{value:"random"},"🔀 Acak Musik",-1)),(f(!0),g(Oe,null,Ie(l(Gt),d=>(f(),g("option",{key:d,value:d},y(d.replace(".mp3","").replace(/_/g," ")),9,bo))),128))],40,yo),a("button",{onClick:i[43]||(i[43]=d=>l(Yt)?.click()),disabled:l(Ue),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"},[O(l(da),{class:"w-3 h-3"}),a("span",wo,y(l(Ue)?"...":"Upload"),1)],8,ko)])]),a("div",_o,[a("span",So,[O(l(Et),{class:"w-2.5 h-2.5"}),z(" Mulai: "+y(Math.min(s.options.audioStartOffset||0,l(ut)))+"s / "+y(l(qt))+"s ",1)]),a("input",{type:"range",min:"0",max:l(ut),step:"1",value:Math.min(s.options.audioStartOffset||0,l(ut)),onInput:i[44]||(i[44]=d=>Pe("audioStartOffset",Number(d.target.value))),class:"w-32 h-1 bg-slate-950 rounded appearance-none cursor-pointer accent-purple-400"},null,40,To)])]),a("div",Co,[a("label",Ao,[O(l(na),{class:"w-3.5 h-3.5 text-emerald-400"}),i[130]||(i[130]=a("span",null,"Durasi Reels:",-1))]),a("div",Oo,[(f(),g(Oe,null,Ie([7,10,15,30,60],d=>a("button",{key:d,onClick:E=>La(d),class:J(["px-2 py-0.5 text-[10px] font-bold rounded-lg border transition",(s.modelValue.reelsDuration||30)===d?"bg-emerald-500/20 border-emerald-500/60 text-emerald-300":"bg-slate-950 border-slate-800 text-slate-400 hover:text-white"])},y(d===60?"1m":d+"s"),11,Io)),64))])]),a("div",No,[a("label",{class:J(["flex items-center gap-1.5 p-1.5 rounded-xl border text-[11px] cursor-pointer transition select-none",s.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"])},[a("input",{type:"checkbox",checked:s.options.outputs?.feed!==!1,onChange:i[45]||(i[45]=d=>Ot("feed",d.target.checked)),class:"rounded text-sky-500 focus:ring-0 bg-slate-900 border-slate-700 w-3 h-3"},null,40,Mo),i[131]||(i[131]=a("span",{class:"font-bold"},"Feed 4:5",-1))],2),a("label",{class:J(["flex items-center gap-1.5 p-1.5 rounded-xl border text-[11px] cursor-pointer transition select-none",s.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"])},[a("input",{type:"checkbox",checked:s.options.outputs?.story!==!1,onChange:i[46]||(i[46]=d=>Ot("story",d.target.checked)),class:"rounded text-indigo-500 focus:ring-0 bg-slate-900 border-slate-700 w-3 h-3"},null,40,Do),i[132]||(i[132]=a("span",{class:"font-bold"},"Story 9:16",-1))],2),a("label",{class:J(["flex items-center gap-1.5 p-1.5 rounded-xl border text-[11px] cursor-pointer transition select-none",s.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"])},[a("input",{type:"checkbox",checked:s.options.outputs?.reels!==!1,onChange:i[47]||(i[47]=d=>Ot("reels",d.target.checked)),class:"rounded text-emerald-500 focus:ring-0 bg-slate-900 border-slate-700 w-3 h-3"},null,40,$o),i[133]||(i[133]=a("span",{class:"font-bold"},"Reels MP4",-1))],2)])]),a("button",{onClick:i[48]||(i[48]=d=>n("generate")),disabled:!s.isValid||s.isGenerating||!!l(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",[!s.isValid||s.isGenerating||l(c)?"bg-slate-800 text-slate-500 cursor-not-allowed border border-slate-700":"bg-gradient-to-r from-sky-500 via-blue-600 to-indigo-600 text-white hover:from-sky-400 hover:to-indigo-500 shadow-sky-500/25 active:scale-[0.99]"]])},[s.isGenerating?(f(),Ne(l(ts),{key:0,class:"w-3.5 h-3.5 animate-spin"})):(f(),Ne(l(Oa),{key:1,class:"w-3.5 h-3.5 fill-current"})),a("span",null,y(s.isGenerating?s.generateStage||"Rendering Content...":"GENERATE CONTENT"),1)],10,Ro)]))}}),jo={class:"flex flex-col gap-2.5 h-full text-slate-100 min-h-0 justify-between"},Po={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"},Lo={class:"flex items-center gap-1 bg-slate-950 p-1 rounded-xl border border-slate-800 text-xs font-bold"},Vo={key:0,class:"w-1.5 h-1.5 rounded-full bg-white animate-pulse"},Bo={class:"flex items-center gap-2 text-xs"},Zo={class:"flex items-center gap-1 bg-slate-950 p-1 rounded-xl border border-slate-800 text-xs shadow-inner"},Ho={key:0,class:"relative shadow-2xl rounded-2xl overflow-hidden border border-slate-700/80 flex-shrink-0",style:{width:"360px",height:"450px"}},Uo={style:{width:"1080px",height:"1350px",transform:"scale(0.333333)","transform-origin":"top left"}},Fo={key:1,class:"relative shadow-2xl rounded-2xl overflow-hidden border border-slate-700/80 flex-shrink-0",style:{width:"300px",height:"533.33px"}},Jo={key:0,class:"absolute inset-0 z-0 bg-slate-950 overflow-hidden"},zo=["src"],Go=["src","muted"],Ko={class:"relative z-10 pointer-events-none",style:{width:"1080px",height:"1920px",transform:"scale(0.277778)","transform-origin":"top left"}},qo={key:1,class:"absolute inset-0 z-20 pointer-events-none flex flex-col justify-between"},Wo={class:"flex-1 flex justify-end p-2"},Yo={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"},Xo={key:0,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"},Qo={class:"flex items-center justify-between gap-3"},er=["title"],tr={class:"text-[11px] hidden sm:inline"},ar={class:"flex-1 flex items-center gap-2"},sr=["max","value"],nr={class:"font-mono text-[11px] font-bold text-slate-300 min-w-[75px] text-right"},ir=["title"],or={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"},rr={class:"flex flex-col gap-1.5"},lr={class:"flex items-center justify-between text-[11px]"},dr={class:"font-bold text-sky-300 flex items-center gap-1"},ur=["max","value"],cr={class:"text-[9px] text-slate-500"},pr={class:"flex flex-col gap-1.5"},mr={class:"flex items-center justify-between text-[11px]"},fr={class:"font-bold text-purple-300 flex items-center gap-1"},hr=["max","value"],xr={class:"text-[9px] text-slate-500"},gr={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"},vr={class:"flex items-center justify-between text-xs"},yr=["value"],br={key:1,class:"flex flex-wrap items-center justify-between gap-2 p-3 bg-emerald-950/40 border border-emerald-500/40 rounded-2xl shadow-xl flex-shrink-0"},kr={class:"flex items-center gap-2 text-xs font-black text-emerald-300"},wr={class:"text-[11px] text-slate-400 font-mono mt-0.5"},_r={class:"flex items-center gap-2"},Sr=["href"],Tr=["disabled"],Cr=Ht({__name:"LivePreview",props:{data:{},selectedVideo:{},selectedMusic:{},videoStartOffset:{default:0},audioStartOffset:{default:0},generatedResult:{}},emits:["update:videoStartOffset","update:audioStartOffset"],setup(s,{emit:e}){const t=s,n=e,o={"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},r=de(()=>t.selectedVideo&&t.selectedVideo!=="pexels"&&t.selectedVideo!=="random"?`/api/stream/videos/${t.selectedVideo}`:"/api/stream/videos/default_bg.mp4"),p=de(()=>t.selectedMusic&&t.selectedMusic!=="random"?`/api/stream/audio/${t.selectedMusic}`:"/api/stream/audio/lofi_viral_study.mp3"),c=_("feed"),w=_(!1),b=_(!1),N=_(!1),ue=_(!1),K=_(1),$=_(null),M=_(null),B=_(!0),V=_(!1),ve=_(0),$e=de(()=>t.data.reelsDuration||30),ce=_(o[t.selectedVideo||""]||8),re=_(o[t.selectedMusic||""]||30),oe=de(()=>Math.max(1,Math.floor(ce.value-1))),X=de(()=>Math.max(1,Math.floor(re.value-1)));function Re(){K.value<2.5&&(K.value=Math.min(2.5,+(K.value+.15).toFixed(2)))}function G(){K.value>.5&&(K.value=Math.max(.5,+(K.value-.15).toFixed(2)))}function me(){K.value=1}function se(A){(A.ctrlKey||A.metaKey)&&(A.preventDefault(),A.deltaY<0?Re():G())}let F=0,W=null;function te(A){if(B.value){if(F>0){const v=(A-F)/1e3;v>0&&v<1&&(ve.value+=v,ve.value>=$e.value&&(ve.value=0,he(0)))}F=A,W=requestAnimationFrame(te)}}Ut(()=>{B.value&&(F=performance.now(),W&&cancelAnimationFrame(W),W=requestAnimationFrame(te))}),Ua(()=>{W&&(cancelAnimationFrame(W),W=null)}),ge($e,A=>{ve.value>A&&(ve.value=0,he(0))});function fe(){B.value?Q():_e()}function _e(){B.value=!0,F=performance.now(),W&&cancelAnimationFrame(W),W=requestAnimationFrame(te),$.value&&$.value.play().catch(()=>{}),M.value&&(M.value.muted=V.value,M.value.volume=.85,M.value.play().catch(()=>{}))}function Q(){B.value=!1,F=0,W&&(cancelAnimationFrame(W),W=null),$.value&&$.value.pause(),M.value&&M.value.pause()}function Se(){if(V.value=!V.value,M.value)if(M.value.muted=V.value,M.value.volume=.85,!V.value&&B.value){const A=t.audioStartOffset||0;M.value.currentTime=A+ve.value%Math.max(1,re.value-A),M.value.play().catch(()=>{})}else M.value.pause()}function C(A){const v=A.target;v&&v.duration&&!isNaN(v.duration)&&isFinite(v.duration)&&(ce.value=Math.max(1,Math.floor(v.duration)),t.videoStartOffset&&t.videoStartOffset>=ce.value&&n("update:videoStartOffset",Math.max(0,ce.value-2))),$.value&&($.value.currentTime=Math.min(t.videoStartOffset||0,oe.value),B.value&&$.value.play().catch(()=>{}))}function I(A){const v=A.target;v&&v.duration&&!isNaN(v.duration)&&isFinite(v.duration)&&(re.value=Math.max(1,Math.floor(v.duration)),t.audioStartOffset&&t.audioStartOffset>=re.value&&n("update:audioStartOffset",Math.max(0,re.value-2))),M.value&&(M.value.muted=V.value,M.value.volume=.85,M.value.currentTime=Math.min(t.audioStartOffset||0,X.value),B.value&&!V.value&&M.value.play().catch(()=>{}))}function h(){if(!$.value)return;const A=Math.min(t.videoStartOffset||0,oe.value);$.value.currentTime=A,B.value&&$.value.play().catch(()=>{})}function Y(){if(!M.value)return;const A=Math.min(t.audioStartOffset||0,X.value);M.value.currentTime=A,B.value&&!V.value&&M.value.play().catch(()=>{})}function Te(){if(!$.value)return;const A=Math.min(t.videoStartOffset||0,oe.value),v=ce.value;$.value.currentTime>=v-.25&&($.value.currentTime=A,B.value&&$.value.play().catch(()=>{}))}function U(){if(!M.value)return;const A=Math.min(t.audioStartOffset||0,X.value),v=re.value;M.value.currentTime>=v-.25&&(M.value.currentTime=A,B.value&&!V.value&&M.value.play().catch(()=>{}))}function he(A){ve.value=Math.min(Math.max(0,A),$e.value),F=performance.now();const v=Math.min(t.videoStartOffset||0,oe.value),Ce=Math.min(t.audioStartOffset||0,X.value);if($.value){const ne=v+A%Math.max(1,ce.value-v);$.value.currentTime=Math.min(ne,ce.value-.1)}if(M.value){const ne=Ce+A%Math.max(1,re.value-Ce);M.value.currentTime=Math.min(ne,re.value-.1)}}function _t(A){const v=Number(A.target.value);he(v)}ge(()=>t.videoStartOffset,A=>{const v=Math.min(A||0,oe.value);$.value&&($.value.currentTime=v)}),ge(()=>t.audioStartOffset,A=>{const v=Math.min(A||0,X.value);M.value&&(M.value.currentTime=v)});function at(A){const v=Math.min(A,oe.value);n("update:videoStartOffset",v),$.value&&($.value.currentTime=v)}function St(A){const v=Math.min(A,X.value);n("update:audioStartOffset",v),M.value&&(M.value.currentTime=v)}function st(){if($.value){const A=Math.min(Math.floor($.value.currentTime),oe.value);at(A)}}function nt(A){const v=Math.floor(A/60),Ce=Math.floor(A%60);return`${v.toString().padStart(2,"0")}:${Ce.toString().padStart(2,"0")}`}async function Tt(){if(!t.data.caption)return;await Rt(t.data.caption)&&(N.value=!0,setTimeout(()=>{N.value=!1},2e3))}async function Ct(){if(t.generatedResult){ue.value=!0;try{await $fetch("/api/open-folder",{method:"POST",body:{jobId:t.generatedResult.jobId,resultDir:t.generatedResult.resultDir}})}catch(A){console.error("Failed to open folder:",A)}finally{ue.value=!1}}}return ge(()=>r.value,()=>{const A=t.selectedVideo||"";o[A]&&(ce.value=o[A]),aa(()=>{he(0)})}),ge(()=>p.value,()=>{const A=t.selectedMusic||"";o[A]&&(re.value=o[A])}),ge(()=>c.value,A=>{A==="reels"?aa(()=>{B.value&&_e()}):M.value&&M.value.pause()}),(A,v)=>{const Ce=Ja;return f(),g("div",jo,[a("div",Po,[a("div",Lo,[a("button",{onClick:v[0]||(v[0]=ne=>c.value="feed"),class:J(["px-3 py-1.5 rounded-lg transition",l(c)==="feed"?"bg-sky-500 text-white shadow-md":"text-slate-400 hover:text-white"])}," Feed 4:5 ",2),a("button",{onClick:v[1]||(v[1]=ne=>c.value="story"),class:J(["px-3 py-1.5 rounded-lg transition",l(c)==="story"?"bg-indigo-500 text-white shadow-md":"text-slate-400 hover:text-white"])}," Story 9:16 ",2),a("button",{onClick:v[2]||(v[2]=ne=>c.value="reels"),class:J(["px-3 py-1.5 rounded-lg transition flex items-center gap-1.5",l(c)==="reels"?"bg-emerald-500 text-white shadow-md":"text-slate-400 hover:text-white"])},[v[8]||(v[8]=a("span",null,"Reels 9:16 (Video)",-1)),l(c)==="reels"&&l(B)?(f(),g("span",Vo)):P("",!0)],2)]),a("div",Bo,[a("div",Zo,[a("button",{onClick:G,title:"Zoom Out (-15%)",class:"p-1.5 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800 transition"},[O(l(rs),{class:"w-3.5 h-3.5"})]),a("button",{onClick:me,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"},y(Math.round(l(K)*100))+"% ",1),a("button",{onClick:Re,title:"Zoom In (+15%)",class:"p-1.5 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800 transition"},[O(l(os),{class:"w-3.5 h-3.5"})]),l(K)!==1?(f(),g("button",{key:0,onClick:me,title:"Reset ke Ukuran Pas",class:"p-1.5 rounded-lg text-amber-400 hover:bg-slate-800 transition"},[O(l(Ia),{class:"w-3.5 h-3.5"})])):P("",!0)]),l(c)!=="feed"?(f(),g("button",{key:0,onClick:v[3]||(v[3]=ne=>w.value=!l(w)),class:J(["inline-flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border text-xs font-bold transition",l(w)?"bg-amber-500/20 text-amber-300 border-amber-500/50":"bg-slate-950 text-slate-400 border-slate-800"])},[O(l(as),{class:"w-3.5 h-3.5"}),v[9]||(v[9]=a("span",{class:"hidden sm:inline"},"Safe Zones",-1))],2)):P("",!0)])]),a("div",{onWheel:se,class:"relative flex-1 min-h-0 bg-slate-950/80 border border-slate-800/80 rounded-2xl flex items-center justify-center p-3 overflow-auto shadow-inner custom-scrollbar"},[a("div",{class:"transition-transform duration-200 ease-out origin-center flex-shrink-0",style:Fa({transform:`scale(${l(K)})`})},[l(c)==="feed"?(f(),g("div",Ho,[a("div",Uo,[O(Ce,{data:s.data,mode:"feed","is-render":!0},null,8,["data"])])])):(f(),g("div",Fo,[l(c)==="reels"?(f(),g("div",Jo,[(f(),g("video",{ref_key:"videoElement",ref:$,key:l(r),autoplay:"",muted:"",playsinline:"",class:"w-full h-full object-cover brightness-90 contrast-105",src:l(r),onLoadedmetadata:C,onTimeupdate:Te,onEnded:h},null,40,zo)),v[10]||(v[10]=a("div",{class:"absolute inset-0 bg-slate-950/30 backdrop-blur-[0.5px]"},null,-1)),(f(),g("audio",{ref_key:"audioElement",ref:M,key:l(p),src:l(p),muted:l(V),onLoadedmetadata:I,onTimeupdate:U,onEnded:Y},null,40,Go))])):P("",!0),a("div",Ko,[O(Ce,{data:s.data,mode:l(c)==="reels"?"overlay":"story","is-render":!0},null,8,["data","mode"])]),l(w)?(f(),g("div",qo,[v[12]||(v[12]=a("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)),a("div",Wo,[l(c)==="reels"?(f(),g("div",Yo,[...v[11]||(v[11]=[a("span",null,"❤️ Like",-1),a("span",null,"💬 Comm",-1),a("span",null,"↗️ Share",-1)])])):P("",!0)]),v[13]||(v[13]=a("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))])):P("",!0)]))],4)],32),l(c)==="reels"?(f(),g("div",Xo,[a("div",Qo,[a("button",{onClick:fe,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:l(B)?"Pause Preview":"Putar Preview"},[l(B)?(f(),Ne(l(es),{key:0,class:"w-3.5 h-3.5 fill-current"})):(f(),Ne(l(Oa),{key:1,class:"w-3.5 h-3.5 fill-current"})),a("span",tr,y(l(B)?"Pause":"Play"),1)],8,er),a("div",ar,[a("input",{type:"range",min:"0",max:l($e),step:"0.1",value:l(ve),onInput:_t,class:"flex-1 h-1.5 bg-slate-950 rounded-lg appearance-none cursor-pointer accent-emerald-500 hover:accent-emerald-400"},null,40,sr),a("span",nr,y(nt(l(ve)))+" / "+y(nt(l($e))),1)]),a("button",{onClick:Se,class:J(["px-2.5 py-2 rounded-xl border transition flex items-center gap-1.5 font-bold text-[11px]",l(V)?"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:l(V)?"Aktifkan Suara Musik (Unmute)":"Matikan Suara Musik (Mute)"},[l(V)?(f(),Ne(l(ns),{key:1,class:"w-3.5 h-3.5"})):(f(),Ne(l(ss),{key:0,class:"w-3.5 h-3.5 text-purple-300 animate-pulse"})),a("span",null,y(l(V)?"Muted":"Audio ON"),1)],10,ir),a("button",{onClick:v[4]||(v[4]=ne=>b.value=!l(b)),class:J(["px-2.5 py-2 rounded-xl border text-[11px] font-bold flex items-center gap-1.5 transition",l(b)?"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"},[O(l(Et),{class:"w-3.5 h-3.5 text-sky-400"}),v[14]||(v[14]=a("span",{class:"hidden sm:inline"},"Trim Offset",-1))],2)]),l(b)?(f(),g("div",or,[a("div",rr,[a("div",lr,[a("span",dr,[O(l(Ca),{class:"w-3 h-3"}),z(" Mulai Video: "+y(Math.min(s.videoStartOffset||0,l(oe)))+"s / "+y(l(ce))+"s ",1)]),a("button",{onClick:st,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 ")]),a("input",{type:"range",min:"0",max:l(oe),step:"1",value:Math.min(s.videoStartOffset||0,l(oe)),onInput:v[5]||(v[5]=ne=>at(Number(ne.target.value))),class:"w-full h-1 bg-slate-900 rounded appearance-none cursor-pointer accent-sky-400"},null,40,ur),a("div",cr," Maksimal offset: "+y(l(oe))+" detik (panjang asli video: "+y(l(ce))+"s) ",1)]),a("div",pr,[a("div",mr,[a("span",fr,[O(l(Aa),{class:"w-3 h-3"}),z(" Mulai Musik: "+y(Math.min(s.audioStartOffset||0,l(X)))+"s / "+y(l(re))+"s ",1)]),v[15]||(v[15]=a("span",{class:"text-[10px] text-slate-500 font-mono"}," (Skip intro) ",-1))]),a("input",{type:"range",min:"0",max:l(X),step:"1",value:Math.min(s.audioStartOffset||0,l(X)),onInput:v[6]||(v[6]=ne=>St(Number(ne.target.value))),class:"w-full h-1 bg-slate-900 rounded appearance-none cursor-pointer accent-purple-400"},null,40,hr),a("div",xr," Maksimal offset: "+y(l(X))+" detik (panjang asli musik: "+y(l(re))+"s) ",1)])])):P("",!0)])):P("",!0),a("div",gr,[a("div",vr,[v[16]||(v[16]=a("span",{class:"font-extrabold text-slate-300 text-[11px]"},"VIRAL CAPTION & HASHTAGS",-1)),a("button",{onClick:Tt,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"},[l(N)?(f(),Ne(l(Je),{key:0,class:"w-3.5 h-3.5 text-emerald-400"})):(f(),Ne(l(xt),{key:1,class:"w-3.5 h-3.5"})),a("span",null,y(l(N)?"Tersalin!":"Copy Caption"),1)])]),a("textarea",{value:s.data.caption,onInput:v[7]||(v[7]=ne=>s.data.caption=ne.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,yr)]),s.generatedResult?(f(),g("div",br,[a("div",null,[a("div",kr,[O(l(Je),{class:"w-4 h-4 text-emerald-400"}),z(" Render Selesai ("+y((s.generatedResult.durationMs/1e3).toFixed(1))+"s) ",1)]),a("div",wr,y(s.generatedResult.jobId),1)]),a("div",_r,[a("a",{href:`/api/download?jobId=${s.generatedResult.jobId}`,download:"",class:"inline-flex items-center gap-1.5 px-4 py-2 bg-emerald-600 hover:bg-emerald-500 text-white rounded-xl text-xs font-black shadow-lg transition"},[O(l(Ya),{class:"w-3.5 h-3.5"}),v[17]||(v[17]=a("span",null,"Download ZIP",-1))],8,Sr),a("button",{onClick:Ct,disabled:l(ue),class:"inline-flex items-center gap-1.5 px-4 py-2 bg-slate-800 hover:bg-slate-700 text-slate-200 border border-slate-700 rounded-xl text-xs font-bold transition"},[O(l(Xa),{class:"w-3.5 h-3.5 text-amber-400"}),v[18]||(v[18]=a("span",null,"Open Folder",-1))],8,Tr)])])):P("",!0)])}}});var Z;(function(s){s.assertEqual=o=>{};function e(o){}s.assertIs=e;function t(o){throw new Error}s.assertNever=t,s.arrayToEnum=o=>{const r={};for(const p of o)r[p]=p;return r},s.getValidEnumValues=o=>{const r=s.objectKeys(o).filter(c=>typeof o[o[c]]!="number"),p={};for(const c of r)p[c]=o[c];return s.objectValues(p)},s.objectValues=o=>s.objectKeys(o).map(function(r){return o[r]}),s.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const r=[];for(const p in o)Object.prototype.hasOwnProperty.call(o,p)&&r.push(p);return r},s.find=(o,r)=>{for(const p of o)if(r(p))return p},s.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,r=" | "){return o.map(p=>typeof p=="string"?`'${p}'`:p).join(r)}s.joinValues=n,s.jsonStringifyReplacer=(o,r)=>typeof r=="bigint"?r.toString():r})(Z||(Z={}));var ua;(function(s){s.mergeShapes=(e,t)=>({...e,...t})})(ua||(ua={}));const S=Z.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Le=s=>{switch(typeof s){case"undefined":return S.undefined;case"string":return S.string;case"number":return Number.isNaN(s)?S.nan:S.number;case"boolean":return S.boolean;case"function":return S.function;case"bigint":return S.bigint;case"symbol":return S.symbol;case"object":return Array.isArray(s)?S.array:s===null?S.null:s.then&&typeof s.then=="function"&&s.catch&&typeof s.catch=="function"?S.promise:typeof Map<"u"&&s instanceof Map?S.map:typeof Set<"u"&&s instanceof Set?S.set:typeof Date<"u"&&s instanceof Date?S.date:S.object;default:return S.unknown}},m=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 je extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(r){return r.message},n={_errors:[]},o=r=>{for(const p of r.issues)if(p.code==="invalid_union")p.unionErrors.map(o);else if(p.code==="invalid_return_type")o(p.returnTypeError);else if(p.code==="invalid_arguments")o(p.argumentsError);else if(p.path.length===0)n._errors.push(t(p));else{let c=n,w=0;for(;w<p.path.length;){const b=p.path[w];w===p.path.length-1?(c[b]=c[b]||{_errors:[]},c[b]._errors.push(t(p))):c[b]=c[b]||{_errors:[]},c=c[b],w++}}};return o(this),n}static assert(e){if(!(e instanceof je))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=t=>t.message){const t={},n=[];for(const o of this.issues)if(o.path.length>0){const r=o.path[0];t[r]=t[r]||[],t[r].push(e(o))}else n.push(e(o));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}je.create=s=>new je(s);const jt=(s,e)=>{let t;switch(s.code){case m.invalid_type:s.received===S.undefined?t="Required":t=`Expected ${s.expected}, received ${s.received}`;break;case m.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(s.expected,Z.jsonStringifyReplacer)}`;break;case m.unrecognized_keys:t=`Unrecognized key(s) in object: ${Z.joinValues(s.keys,", ")}`;break;case m.invalid_union:t="Invalid input";break;case m.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${Z.joinValues(s.options)}`;break;case m.invalid_enum_value:t=`Invalid enum value. Expected ${Z.joinValues(s.options)}, received '${s.received}'`;break;case m.invalid_arguments:t="Invalid function arguments";break;case m.invalid_return_type:t="Invalid function return type";break;case m.invalid_date:t="Invalid date";break;case m.invalid_string:typeof s.validation=="object"?"includes"in s.validation?(t=`Invalid input: must include "${s.validation.includes}"`,typeof s.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${s.validation.position}`)):"startsWith"in s.validation?t=`Invalid input: must start with "${s.validation.startsWith}"`:"endsWith"in s.validation?t=`Invalid input: must end with "${s.validation.endsWith}"`:Z.assertNever(s.validation):s.validation!=="regex"?t=`Invalid ${s.validation}`:t="Invalid";break;case m.too_small:s.type==="array"?t=`Array must contain ${s.exact?"exactly":s.inclusive?"at least":"more than"} ${s.minimum} element(s)`:s.type==="string"?t=`String must contain ${s.exact?"exactly":s.inclusive?"at least":"over"} ${s.minimum} character(s)`:s.type==="number"?t=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="bigint"?t=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="date"?t=`Date must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(s.minimum))}`:t="Invalid input";break;case m.too_big:s.type==="array"?t=`Array must contain ${s.exact?"exactly":s.inclusive?"at most":"less than"} ${s.maximum} element(s)`:s.type==="string"?t=`String must contain ${s.exact?"exactly":s.inclusive?"at most":"under"} ${s.maximum} character(s)`:s.type==="number"?t=`Number must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="bigint"?t=`BigInt must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="date"?t=`Date must be ${s.exact?"exactly":s.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(s.maximum))}`:t="Invalid input";break;case m.custom:t="Invalid input";break;case m.invalid_intersection_types:t="Intersection results could not be merged";break;case m.not_multiple_of:t=`Number must be a multiple of ${s.multipleOf}`;break;case m.not_finite:t="Number must be finite";break;default:t=e.defaultError,Z.assertNever(s)}return{message:t}};let Ar=jt;function Or(){return Ar}const Ir=s=>{const{data:e,path:t,errorMaps:n,issueData:o}=s,r=[...t,...o.path||[]],p={...o,path:r};if(o.message!==void 0)return{...o,path:r,message:o.message};let c="";const w=n.filter(b=>!!b).slice().reverse();for(const b of w)c=b(p,{data:e,defaultError:c}).message;return{...o,path:r,message:c}};function k(s,e){const t=Or(),n=Ir({issueData:e,data:s.data,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,t,t===jt?void 0:jt].filter(o=>!!o)});s.common.issues.push(n)}class pe{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const o of t){if(o.status==="aborted")return R;o.status==="dirty"&&e.dirty(),n.push(o.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const o of t){const r=await o.key,p=await o.value;n.push({key:r,value:p})}return pe.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const o of t){const{key:r,value:p}=o;if(r.status==="aborted"||p.status==="aborted")return R;r.status==="dirty"&&e.dirty(),p.status==="dirty"&&e.dirty(),r.value!=="__proto__"&&(typeof p.value<"u"||o.alwaysSet)&&(n[r.value]=p.value)}return{status:e.value,value:n}}}const R=Object.freeze({status:"aborted"}),Qe=s=>({status:"dirty",value:s}),we=s=>({status:"valid",value:s}),ca=s=>s.status==="aborted",pa=s=>s.status==="dirty",ze=s=>s.status==="valid",gt=s=>typeof Promise<"u"&&s instanceof Promise;var T;(function(s){s.errToObj=e=>typeof e=="string"?{message:e}:e||{},s.toString=e=>typeof e=="string"?e:e?.message})(T||(T={}));class De{constructor(e,t,n,o){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=o}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 ma=(s,e)=>{if(ze(e))return{success:!0,data:e.value};if(!s.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new je(s.common.issues);return this._error=t,this._error}}};function j(s){if(!s)return{};const{errorMap:e,invalid_type_error:t,required_error:n,description:o}=s;if(e&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o}:{errorMap:(p,c)=>{const{message:w}=s;return p.code==="invalid_enum_value"?{message:w??c.defaultError}:typeof c.data>"u"?{message:w??n??c.defaultError}:p.code!=="invalid_type"?{message:c.defaultError}:{message:w??t??c.defaultError}},description:o}}class L{get description(){return this._def.description}_getType(e){return Le(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Le(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new pe,ctx:{common:e.parent.common,data:e.data,parsedType:Le(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(gt(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){const n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Le(e)},o=this._parseSync({data:e,path:n.path,parent:n});return ma(n,o)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Le(e)};if(!this["~standard"].async)try{const n=this._parseSync({data:e,path:[],parent:t});return ze(n)?{value:n.value}:{issues:t.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(n=>ze(n)?{value:n.value}:{issues:t.common.issues})}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Le(e)},o=this._parse({data:e,path:n.path,parent:n}),r=await(gt(o)?o:Promise.resolve(o));return ma(n,r)}refine(e,t){const n=o=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(o):t;return this._refinement((o,r)=>{const p=e(o),c=()=>r.addIssue({code:m.custom,...n(o)});return typeof Promise<"u"&&p instanceof Promise?p.then(w=>w?!0:(c(),!1)):p?!0:(c(),!1)})}refinement(e,t){return this._refinement((n,o)=>e(n)?!0:(o.addIssue(typeof t=="function"?t(n,o):t),!1))}_refinement(e){return new qe({schema:this,typeName:D.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:t=>this["~validate"](t)}}optional(){return Ve.create(this,this._def)}nullable(){return We.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Me.create(this)}promise(){return wt.create(this,this._def)}or(e){return yt.create([this,e],this._def)}and(e){return bt.create(this,e,this._def)}transform(e){return new qe({...j(this._def),schema:this,typeName:D.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new Vt({...j(this._def),innerType:this,defaultValue:t,typeName:D.ZodDefault})}brand(){return new Xr({typeName:D.ZodBranded,type:this,...j(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new Bt({...j(this._def),innerType:this,catchValue:t,typeName:D.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Ft.create(this,e)}readonly(){return Zt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Nr=/^c[^\s-]{8,}$/i,Mr=/^[0-9a-z]+$/,Dr=/^[0-9A-HJKMNP-TV-Z]{26}$/i,$r=/^[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,Rr=/^[a-z0-9_-]{21}$/i,Er=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,jr=/^[-+]?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)?)??$/,Pr=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Lr="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Dt;const Vr=/^(?:(?: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])$/,Br=/^(?:(?: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])$/,Zr=/^(([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]))$/,Hr=/^(([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])$/,Ur=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Fr=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Na="((\\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])))",Jr=new RegExp(`^${Na}$`);function Ma(s){let e="[0-5]\\d";s.precision?e=`${e}\\.\\d{${s.precision}}`:s.precision==null&&(e=`${e}(\\.\\d+)?`);const t=s.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function zr(s){return new RegExp(`^${Ma(s)}$`)}function Gr(s){let e=`${Na}T${Ma(s)}`;const t=[];return t.push(s.local?"Z?":"Z"),s.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function Kr(s,e){return!!((e==="v4"||!e)&&Vr.test(s)||(e==="v6"||!e)&&Zr.test(s))}function qr(s,e){if(!Er.test(s))return!1;try{const[t]=s.split(".");if(!t)return!1;const n=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),o=JSON.parse(atob(n));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||e&&o.alg!==e)}catch{return!1}}function Wr(s,e){return!!((e==="v4"||!e)&&Br.test(s)||(e==="v6"||!e)&&Hr.test(s))}class Ee extends L{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==S.string){const r=this._getOrReturnCtx(e);return k(r,{code:m.invalid_type,expected:S.string,received:r.parsedType}),R}const n=new pe;let o;for(const r of this._def.checks)if(r.kind==="min")e.data.length<r.value&&(o=this._getOrReturnCtx(e,o),k(o,{code:m.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),n.dirty());else if(r.kind==="max")e.data.length>r.value&&(o=this._getOrReturnCtx(e,o),k(o,{code:m.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),n.dirty());else if(r.kind==="length"){const p=e.data.length>r.value,c=e.data.length<r.value;(p||c)&&(o=this._getOrReturnCtx(e,o),p?k(o,{code:m.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}):c&&k(o,{code:m.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}),n.dirty())}else if(r.kind==="email")Pr.test(e.data)||(o=this._getOrReturnCtx(e,o),k(o,{validation:"email",code:m.invalid_string,message:r.message}),n.dirty());else if(r.kind==="emoji")Dt||(Dt=new RegExp(Lr,"u")),Dt.test(e.data)||(o=this._getOrReturnCtx(e,o),k(o,{validation:"emoji",code:m.invalid_string,message:r.message}),n.dirty());else if(r.kind==="uuid")$r.test(e.data)||(o=this._getOrReturnCtx(e,o),k(o,{validation:"uuid",code:m.invalid_string,message:r.message}),n.dirty());else if(r.kind==="nanoid")Rr.test(e.data)||(o=this._getOrReturnCtx(e,o),k(o,{validation:"nanoid",code:m.invalid_string,message:r.message}),n.dirty());else if(r.kind==="cuid")Nr.test(e.data)||(o=this._getOrReturnCtx(e,o),k(o,{validation:"cuid",code:m.invalid_string,message:r.message}),n.dirty());else if(r.kind==="cuid2")Mr.test(e.data)||(o=this._getOrReturnCtx(e,o),k(o,{validation:"cuid2",code:m.invalid_string,message:r.message}),n.dirty());else if(r.kind==="ulid")Dr.test(e.data)||(o=this._getOrReturnCtx(e,o),k(o,{validation:"ulid",code:m.invalid_string,message:r.message}),n.dirty());else if(r.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),k(o,{validation:"url",code:m.invalid_string,message:r.message}),n.dirty()}else r.kind==="regex"?(r.regex.lastIndex=0,r.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),k(o,{validation:"regex",code:m.invalid_string,message:r.message}),n.dirty())):r.kind==="trim"?e.data=e.data.trim():r.kind==="includes"?e.data.includes(r.value,r.position)||(o=this._getOrReturnCtx(e,o),k(o,{code:m.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),n.dirty()):r.kind==="toLowerCase"?e.data=e.data.toLowerCase():r.kind==="toUpperCase"?e.data=e.data.toUpperCase():r.kind==="startsWith"?e.data.startsWith(r.value)||(o=this._getOrReturnCtx(e,o),k(o,{code:m.invalid_string,validation:{startsWith:r.value},message:r.message}),n.dirty()):r.kind==="endsWith"?e.data.endsWith(r.value)||(o=this._getOrReturnCtx(e,o),k(o,{code:m.invalid_string,validation:{endsWith:r.value},message:r.message}),n.dirty()):r.kind==="datetime"?Gr(r).test(e.data)||(o=this._getOrReturnCtx(e,o),k(o,{code:m.invalid_string,validation:"datetime",message:r.message}),n.dirty()):r.kind==="date"?Jr.test(e.data)||(o=this._getOrReturnCtx(e,o),k(o,{code:m.invalid_string,validation:"date",message:r.message}),n.dirty()):r.kind==="time"?zr(r).test(e.data)||(o=this._getOrReturnCtx(e,o),k(o,{code:m.invalid_string,validation:"time",message:r.message}),n.dirty()):r.kind==="duration"?jr.test(e.data)||(o=this._getOrReturnCtx(e,o),k(o,{validation:"duration",code:m.invalid_string,message:r.message}),n.dirty()):r.kind==="ip"?Kr(e.data,r.version)||(o=this._getOrReturnCtx(e,o),k(o,{validation:"ip",code:m.invalid_string,message:r.message}),n.dirty()):r.kind==="jwt"?qr(e.data,r.alg)||(o=this._getOrReturnCtx(e,o),k(o,{validation:"jwt",code:m.invalid_string,message:r.message}),n.dirty()):r.kind==="cidr"?Wr(e.data,r.version)||(o=this._getOrReturnCtx(e,o),k(o,{validation:"cidr",code:m.invalid_string,message:r.message}),n.dirty()):r.kind==="base64"?Ur.test(e.data)||(o=this._getOrReturnCtx(e,o),k(o,{validation:"base64",code:m.invalid_string,message:r.message}),n.dirty()):r.kind==="base64url"?Fr.test(e.data)||(o=this._getOrReturnCtx(e,o),k(o,{validation:"base64url",code:m.invalid_string,message:r.message}),n.dirty()):Z.assertNever(r);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(o=>e.test(o),{validation:t,code:m.invalid_string,...T.errToObj(n)})}_addCheck(e){return new Ee({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...T.errToObj(e)})}url(e){return this._addCheck({kind:"url",...T.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...T.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...T.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...T.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...T.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...T.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...T.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...T.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...T.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...T.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...T.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...T.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,...T.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,...T.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...T.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...T.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...T.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...T.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...T.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...T.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...T.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...T.errToObj(t)})}nonempty(e){return this.min(1,T.errToObj(e))}trim(){return new Ee({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ee({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ee({...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 t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}Ee.create=s=>new Ee({checks:[],typeName:D.ZodString,coerce:s?.coerce??!1,...j(s)});function Yr(s,e){const t=(s.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,o=t>n?t:n,r=Number.parseInt(s.toFixed(o).replace(".","")),p=Number.parseInt(e.toFixed(o).replace(".",""));return r%p/10**o}class Ge extends L{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)!==S.number){const r=this._getOrReturnCtx(e);return k(r,{code:m.invalid_type,expected:S.number,received:r.parsedType}),R}let n;const o=new pe;for(const r of this._def.checks)r.kind==="int"?Z.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),k(n,{code:m.invalid_type,expected:"integer",received:"float",message:r.message}),o.dirty()):r.kind==="min"?(r.inclusive?e.data<r.value:e.data<=r.value)&&(n=this._getOrReturnCtx(e,n),k(n,{code:m.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),o.dirty()):r.kind==="max"?(r.inclusive?e.data>r.value:e.data>=r.value)&&(n=this._getOrReturnCtx(e,n),k(n,{code:m.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),o.dirty()):r.kind==="multipleOf"?Yr(e.data,r.value)!==0&&(n=this._getOrReturnCtx(e,n),k(n,{code:m.not_multiple_of,multipleOf:r.value,message:r.message}),o.dirty()):r.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),k(n,{code:m.not_finite,message:r.message}),o.dirty()):Z.assertNever(r);return{status:o.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,T.toString(t))}gt(e,t){return this.setLimit("min",e,!1,T.toString(t))}lte(e,t){return this.setLimit("max",e,!0,T.toString(t))}lt(e,t){return this.setLimit("max",e,!1,T.toString(t))}setLimit(e,t,n,o){return new Ge({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:T.toString(o)}]})}_addCheck(e){return new Ge({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:T.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:T.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:T.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:T.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:T.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:T.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:T.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:T.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:T.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.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,t=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}Ge.create=s=>new Ge({checks:[],typeName:D.ZodNumber,coerce:s?.coerce||!1,...j(s)});class et extends L{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)!==S.bigint)return this._getInvalidInput(e);let n;const o=new pe;for(const r of this._def.checks)r.kind==="min"?(r.inclusive?e.data<r.value:e.data<=r.value)&&(n=this._getOrReturnCtx(e,n),k(n,{code:m.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),o.dirty()):r.kind==="max"?(r.inclusive?e.data>r.value:e.data>=r.value)&&(n=this._getOrReturnCtx(e,n),k(n,{code:m.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),o.dirty()):r.kind==="multipleOf"?e.data%r.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),k(n,{code:m.not_multiple_of,multipleOf:r.value,message:r.message}),o.dirty()):Z.assertNever(r);return{status:o.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return k(t,{code:m.invalid_type,expected:S.bigint,received:t.parsedType}),R}gte(e,t){return this.setLimit("min",e,!0,T.toString(t))}gt(e,t){return this.setLimit("min",e,!1,T.toString(t))}lte(e,t){return this.setLimit("max",e,!0,T.toString(t))}lt(e,t){return this.setLimit("max",e,!1,T.toString(t))}setLimit(e,t,n,o){return new et({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:T.toString(o)}]})}_addCheck(e){return new et({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:T.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:T.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:T.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:T.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:T.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}et.create=s=>new et({checks:[],typeName:D.ZodBigInt,coerce:s?.coerce??!1,...j(s)});class fa extends L{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==S.boolean){const n=this._getOrReturnCtx(e);return k(n,{code:m.invalid_type,expected:S.boolean,received:n.parsedType}),R}return we(e.data)}}fa.create=s=>new fa({typeName:D.ZodBoolean,coerce:s?.coerce||!1,...j(s)});class vt extends L{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==S.date){const r=this._getOrReturnCtx(e);return k(r,{code:m.invalid_type,expected:S.date,received:r.parsedType}),R}if(Number.isNaN(e.data.getTime())){const r=this._getOrReturnCtx(e);return k(r,{code:m.invalid_date}),R}const n=new pe;let o;for(const r of this._def.checks)r.kind==="min"?e.data.getTime()<r.value&&(o=this._getOrReturnCtx(e,o),k(o,{code:m.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),n.dirty()):r.kind==="max"?e.data.getTime()>r.value&&(o=this._getOrReturnCtx(e,o),k(o,{code:m.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),n.dirty()):Z.assertNever(r);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new vt({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:T.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:T.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}vt.create=s=>new vt({checks:[],coerce:s?.coerce||!1,typeName:D.ZodDate,...j(s)});class ha extends L{_parse(e){if(this._getType(e)!==S.symbol){const n=this._getOrReturnCtx(e);return k(n,{code:m.invalid_type,expected:S.symbol,received:n.parsedType}),R}return we(e.data)}}ha.create=s=>new ha({typeName:D.ZodSymbol,...j(s)});class xa extends L{_parse(e){if(this._getType(e)!==S.undefined){const n=this._getOrReturnCtx(e);return k(n,{code:m.invalid_type,expected:S.undefined,received:n.parsedType}),R}return we(e.data)}}xa.create=s=>new xa({typeName:D.ZodUndefined,...j(s)});class ga extends L{_parse(e){if(this._getType(e)!==S.null){const n=this._getOrReturnCtx(e);return k(n,{code:m.invalid_type,expected:S.null,received:n.parsedType}),R}return we(e.data)}}ga.create=s=>new ga({typeName:D.ZodNull,...j(s)});class Pt extends L{constructor(){super(...arguments),this._any=!0}_parse(e){return we(e.data)}}Pt.create=s=>new Pt({typeName:D.ZodAny,...j(s)});class va extends L{constructor(){super(...arguments),this._unknown=!0}_parse(e){return we(e.data)}}va.create=s=>new va({typeName:D.ZodUnknown,...j(s)});class Be extends L{_parse(e){const t=this._getOrReturnCtx(e);return k(t,{code:m.invalid_type,expected:S.never,received:t.parsedType}),R}}Be.create=s=>new Be({typeName:D.ZodNever,...j(s)});class ya extends L{_parse(e){if(this._getType(e)!==S.undefined){const n=this._getOrReturnCtx(e);return k(n,{code:m.invalid_type,expected:S.void,received:n.parsedType}),R}return we(e.data)}}ya.create=s=>new ya({typeName:D.ZodVoid,...j(s)});class Me extends L{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),o=this._def;if(t.parsedType!==S.array)return k(t,{code:m.invalid_type,expected:S.array,received:t.parsedType}),R;if(o.exactLength!==null){const p=t.data.length>o.exactLength.value,c=t.data.length<o.exactLength.value;(p||c)&&(k(t,{code:p?m.too_big:m.too_small,minimum:c?o.exactLength.value:void 0,maximum:p?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),n.dirty())}if(o.minLength!==null&&t.data.length<o.minLength.value&&(k(t,{code:m.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),n.dirty()),o.maxLength!==null&&t.data.length>o.maxLength.value&&(k(t,{code:m.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((p,c)=>o.type._parseAsync(new De(t,p,t.path,c)))).then(p=>pe.mergeArray(n,p));const r=[...t.data].map((p,c)=>o.type._parseSync(new De(t,p,t.path,c)));return pe.mergeArray(n,r)}get element(){return this._def.type}min(e,t){return new Me({...this._def,minLength:{value:e,message:T.toString(t)}})}max(e,t){return new Me({...this._def,maxLength:{value:e,message:T.toString(t)}})}length(e,t){return new Me({...this._def,exactLength:{value:e,message:T.toString(t)}})}nonempty(e){return this.min(1,e)}}Me.create=(s,e)=>new Me({type:s,minLength:null,maxLength:null,exactLength:null,typeName:D.ZodArray,...j(e)});function Fe(s){if(s instanceof ae){const e={};for(const t in s.shape){const n=s.shape[t];e[t]=Ve.create(Fe(n))}return new ae({...s._def,shape:()=>e})}else return s instanceof Me?new Me({...s._def,type:Fe(s.element)}):s instanceof Ve?Ve.create(Fe(s.unwrap())):s instanceof We?We.create(Fe(s.unwrap())):s instanceof He?He.create(s.items.map(e=>Fe(e))):s}class ae extends L{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(),t=Z.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==S.object){const b=this._getOrReturnCtx(e);return k(b,{code:m.invalid_type,expected:S.object,received:b.parsedType}),R}const{status:n,ctx:o}=this._processInputParams(e),{shape:r,keys:p}=this._getCached(),c=[];if(!(this._def.catchall instanceof Be&&this._def.unknownKeys==="strip"))for(const b in o.data)p.includes(b)||c.push(b);const w=[];for(const b of p){const N=r[b],ue=o.data[b];w.push({key:{status:"valid",value:b},value:N._parse(new De(o,ue,o.path,b)),alwaysSet:b in o.data})}if(this._def.catchall instanceof Be){const b=this._def.unknownKeys;if(b==="passthrough")for(const N of c)w.push({key:{status:"valid",value:N},value:{status:"valid",value:o.data[N]}});else if(b==="strict")c.length>0&&(k(o,{code:m.unrecognized_keys,keys:c}),n.dirty());else if(b!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const b=this._def.catchall;for(const N of c){const ue=o.data[N];w.push({key:{status:"valid",value:N},value:b._parse(new De(o,ue,o.path,N)),alwaysSet:N in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const b=[];for(const N of w){const ue=await N.key,K=await N.value;b.push({key:ue,value:K,alwaysSet:N.alwaysSet})}return b}).then(b=>pe.mergeObjectSync(n,b)):pe.mergeObjectSync(n,w)}get shape(){return this._def.shape()}strict(e){return T.errToObj,new ae({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{const o=this._def.errorMap?.(t,n).message??n.defaultError;return t.code==="unrecognized_keys"?{message:T.errToObj(e).message??o}:{message:o}}}:{}})}strip(){return new ae({...this._def,unknownKeys:"strip"})}passthrough(){return new ae({...this._def,unknownKeys:"passthrough"})}extend(e){return new ae({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ae({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:D.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ae({...this._def,catchall:e})}pick(e){const t={};for(const n of Z.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new ae({...this._def,shape:()=>t})}omit(e){const t={};for(const n of Z.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new ae({...this._def,shape:()=>t})}deepPartial(){return Fe(this)}partial(e){const t={};for(const n of Z.objectKeys(this.shape)){const o=this.shape[n];e&&!e[n]?t[n]=o:t[n]=o.optional()}return new ae({...this._def,shape:()=>t})}required(e){const t={};for(const n of Z.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let r=this.shape[n];for(;r instanceof Ve;)r=r._def.innerType;t[n]=r}return new ae({...this._def,shape:()=>t})}keyof(){return Da(Z.objectKeys(this.shape))}}ae.create=(s,e)=>new ae({shape:()=>s,unknownKeys:"strip",catchall:Be.create(),typeName:D.ZodObject,...j(e)});ae.strictCreate=(s,e)=>new ae({shape:()=>s,unknownKeys:"strict",catchall:Be.create(),typeName:D.ZodObject,...j(e)});ae.lazycreate=(s,e)=>new ae({shape:s,unknownKeys:"strip",catchall:Be.create(),typeName:D.ZodObject,...j(e)});class yt extends L{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;function o(r){for(const c of r)if(c.result.status==="valid")return c.result;for(const c of r)if(c.result.status==="dirty")return t.common.issues.push(...c.ctx.common.issues),c.result;const p=r.map(c=>new je(c.ctx.common.issues));return k(t,{code:m.invalid_union,unionErrors:p}),R}if(t.common.async)return Promise.all(n.map(async r=>{const p={...t,common:{...t.common,issues:[]},parent:null};return{result:await r._parseAsync({data:t.data,path:t.path,parent:p}),ctx:p}})).then(o);{let r;const p=[];for(const w of n){const b={...t,common:{...t.common,issues:[]},parent:null},N=w._parseSync({data:t.data,path:t.path,parent:b});if(N.status==="valid")return N;N.status==="dirty"&&!r&&(r={result:N,ctx:b}),b.common.issues.length&&p.push(b.common.issues)}if(r)return t.common.issues.push(...r.ctx.common.issues),r.result;const c=p.map(w=>new je(w));return k(t,{code:m.invalid_union,unionErrors:c}),R}}get options(){return this._def.options}}yt.create=(s,e)=>new yt({options:s,typeName:D.ZodUnion,...j(e)});function Lt(s,e){const t=Le(s),n=Le(e);if(s===e)return{valid:!0,data:s};if(t===S.object&&n===S.object){const o=Z.objectKeys(e),r=Z.objectKeys(s).filter(c=>o.indexOf(c)!==-1),p={...s,...e};for(const c of r){const w=Lt(s[c],e[c]);if(!w.valid)return{valid:!1};p[c]=w.data}return{valid:!0,data:p}}else if(t===S.array&&n===S.array){if(s.length!==e.length)return{valid:!1};const o=[];for(let r=0;r<s.length;r++){const p=s[r],c=e[r],w=Lt(p,c);if(!w.valid)return{valid:!1};o.push(w.data)}return{valid:!0,data:o}}else return t===S.date&&n===S.date&&+s==+e?{valid:!0,data:s}:{valid:!1}}class bt extends L{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),o=(r,p)=>{if(ca(r)||ca(p))return R;const c=Lt(r.value,p.value);return c.valid?((pa(r)||pa(p))&&t.dirty(),{status:t.value,value:c.data}):(k(n,{code:m.invalid_intersection_types}),R)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([r,p])=>o(r,p)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}bt.create=(s,e,t)=>new bt({left:s,right:e,typeName:D.ZodIntersection,...j(t)});class He extends L{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==S.array)return k(n,{code:m.invalid_type,expected:S.array,received:n.parsedType}),R;if(n.data.length<this._def.items.length)return k(n,{code:m.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),R;!this._def.rest&&n.data.length>this._def.items.length&&(k(n,{code:m.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const r=[...n.data].map((p,c)=>{const w=this._def.items[c]||this._def.rest;return w?w._parse(new De(n,p,n.path,c)):null}).filter(p=>!!p);return n.common.async?Promise.all(r).then(p=>pe.mergeArray(t,p)):pe.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new He({...this._def,rest:e})}}He.create=(s,e)=>{if(!Array.isArray(s))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new He({items:s,typeName:D.ZodTuple,rest:null,...j(e)})};class kt extends L{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==S.object)return k(n,{code:m.invalid_type,expected:S.object,received:n.parsedType}),R;const o=[],r=this._def.keyType,p=this._def.valueType;for(const c in n.data)o.push({key:r._parse(new De(n,c,n.path,c)),value:p._parse(new De(n,n.data[c],n.path,c)),alwaysSet:c in n.data});return n.common.async?pe.mergeObjectAsync(t,o):pe.mergeObjectSync(t,o)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof L?new kt({keyType:e,valueType:t,typeName:D.ZodRecord,...j(n)}):new kt({keyType:Ee.create(),valueType:e,typeName:D.ZodRecord,...j(t)})}}class ba extends L{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==S.map)return k(n,{code:m.invalid_type,expected:S.map,received:n.parsedType}),R;const o=this._def.keyType,r=this._def.valueType,p=[...n.data.entries()].map(([c,w],b)=>({key:o._parse(new De(n,c,n.path,[b,"key"])),value:r._parse(new De(n,w,n.path,[b,"value"]))}));if(n.common.async){const c=new Map;return Promise.resolve().then(async()=>{for(const w of p){const b=await w.key,N=await w.value;if(b.status==="aborted"||N.status==="aborted")return R;(b.status==="dirty"||N.status==="dirty")&&t.dirty(),c.set(b.value,N.value)}return{status:t.value,value:c}})}else{const c=new Map;for(const w of p){const b=w.key,N=w.value;if(b.status==="aborted"||N.status==="aborted")return R;(b.status==="dirty"||N.status==="dirty")&&t.dirty(),c.set(b.value,N.value)}return{status:t.value,value:c}}}}ba.create=(s,e,t)=>new ba({valueType:e,keyType:s,typeName:D.ZodMap,...j(t)});class tt extends L{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==S.set)return k(n,{code:m.invalid_type,expected:S.set,received:n.parsedType}),R;const o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(k(n,{code:m.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),t.dirty()),o.maxSize!==null&&n.data.size>o.maxSize.value&&(k(n,{code:m.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),t.dirty());const r=this._def.valueType;function p(w){const b=new Set;for(const N of w){if(N.status==="aborted")return R;N.status==="dirty"&&t.dirty(),b.add(N.value)}return{status:t.value,value:b}}const c=[...n.data.values()].map((w,b)=>r._parse(new De(n,w,n.path,b)));return n.common.async?Promise.all(c).then(w=>p(w)):p(c)}min(e,t){return new tt({...this._def,minSize:{value:e,message:T.toString(t)}})}max(e,t){return new tt({...this._def,maxSize:{value:e,message:T.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}tt.create=(s,e)=>new tt({valueType:s,minSize:null,maxSize:null,typeName:D.ZodSet,...j(e)});class ka extends L{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ka.create=(s,e)=>new ka({getter:s,typeName:D.ZodLazy,...j(e)});class wa extends L{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return k(t,{received:t.data,code:m.invalid_literal,expected:this._def.value}),R}return{status:"valid",value:e.data}}get value(){return this._def.value}}wa.create=(s,e)=>new wa({value:s,typeName:D.ZodLiteral,...j(e)});function Da(s,e){return new Ke({values:s,typeName:D.ZodEnum,...j(e)})}class Ke extends L{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),n=this._def.values;return k(t,{expected:Z.joinValues(n),received:t.parsedType,code:m.invalid_type}),R}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return k(t,{received:t.data,code:m.invalid_enum_value,options:n}),R}return we(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Ke.create(e,{...this._def,...t})}exclude(e,t=this._def){return Ke.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}}Ke.create=Da;class _a extends L{_parse(e){const t=Z.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==S.string&&n.parsedType!==S.number){const o=Z.objectValues(t);return k(n,{expected:Z.joinValues(o),received:n.parsedType,code:m.invalid_type}),R}if(this._cache||(this._cache=new Set(Z.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const o=Z.objectValues(t);return k(n,{received:n.data,code:m.invalid_enum_value,options:o}),R}return we(e.data)}get enum(){return this._def.values}}_a.create=(s,e)=>new _a({values:s,typeName:D.ZodNativeEnum,...j(e)});class wt extends L{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==S.promise&&t.common.async===!1)return k(t,{code:m.invalid_type,expected:S.promise,received:t.parsedType}),R;const n=t.parsedType===S.promise?t.data:Promise.resolve(t.data);return we(n.then(o=>this._def.type.parseAsync(o,{path:t.path,errorMap:t.common.contextualErrorMap})))}}wt.create=(s,e)=>new wt({type:s,typeName:D.ZodPromise,...j(e)});class qe extends L{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===D.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),o=this._def.effect||null,r={addIssue:p=>{k(n,p),p.fatal?t.abort():t.dirty()},get path(){return n.path}};if(r.addIssue=r.addIssue.bind(r),o.type==="preprocess"){const p=o.transform(n.data,r);if(n.common.async)return Promise.resolve(p).then(async c=>{if(t.value==="aborted")return R;const w=await this._def.schema._parseAsync({data:c,path:n.path,parent:n});return w.status==="aborted"?R:w.status==="dirty"||t.value==="dirty"?Qe(w.value):w});{if(t.value==="aborted")return R;const c=this._def.schema._parseSync({data:p,path:n.path,parent:n});return c.status==="aborted"?R:c.status==="dirty"||t.value==="dirty"?Qe(c.value):c}}if(o.type==="refinement"){const p=c=>{const w=o.refinement(c,r);if(n.common.async)return Promise.resolve(w);if(w instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(n.common.async===!1){const c=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return c.status==="aborted"?R:(c.status==="dirty"&&t.dirty(),p(c.value),{status:t.value,value:c.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(c=>c.status==="aborted"?R:(c.status==="dirty"&&t.dirty(),p(c.value).then(()=>({status:t.value,value:c.value}))))}if(o.type==="transform")if(n.common.async===!1){const p=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!ze(p))return R;const c=o.transform(p.value,r);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:c}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(p=>ze(p)?Promise.resolve(o.transform(p.value,r)).then(c=>({status:t.value,value:c})):R);Z.assertNever(o)}}qe.create=(s,e,t)=>new qe({schema:s,typeName:D.ZodEffects,effect:e,...j(t)});qe.createWithPreprocess=(s,e,t)=>new qe({schema:e,effect:{type:"preprocess",transform:s},typeName:D.ZodEffects,...j(t)});class Ve extends L{_parse(e){return this._getType(e)===S.undefined?we(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ve.create=(s,e)=>new Ve({innerType:s,typeName:D.ZodOptional,...j(e)});class We extends L{_parse(e){return this._getType(e)===S.null?we(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}We.create=(s,e)=>new We({innerType:s,typeName:D.ZodNullable,...j(e)});class Vt extends L{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===S.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Vt.create=(s,e)=>new Vt({innerType:s,typeName:D.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...j(e)});class Bt extends L{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return gt(o)?o.then(r=>({status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new je(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new je(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Bt.create=(s,e)=>new Bt({innerType:s,typeName:D.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...j(e)});class Sa extends L{_parse(e){if(this._getType(e)!==S.nan){const n=this._getOrReturnCtx(e);return k(n,{code:m.invalid_type,expected:S.nan,received:n.parsedType}),R}return{status:"valid",value:e.data}}}Sa.create=s=>new Sa({typeName:D.ZodNaN,...j(s)});class Xr extends L{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class Ft extends L{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const r=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return r.status==="aborted"?R:r.status==="dirty"?(t.dirty(),Qe(r.value)):this._def.out._parseAsync({data:r.value,path:n.path,parent:n})})();{const o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?R:o.status==="dirty"?(t.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(e,t){return new Ft({in:e,out:t,typeName:D.ZodPipeline})}}class Zt extends L{_parse(e){const t=this._def.innerType._parse(e),n=o=>(ze(o)&&(o.value=Object.freeze(o.value)),o);return gt(t)?t.then(o=>n(o)):n(t)}unwrap(){return this._def.innerType}}Zt.create=(s,e)=>new Zt({innerType:s,typeName:D.ZodReadonly,...j(e)});var D;(function(s){s.ZodString="ZodString",s.ZodNumber="ZodNumber",s.ZodNaN="ZodNaN",s.ZodBigInt="ZodBigInt",s.ZodBoolean="ZodBoolean",s.ZodDate="ZodDate",s.ZodSymbol="ZodSymbol",s.ZodUndefined="ZodUndefined",s.ZodNull="ZodNull",s.ZodAny="ZodAny",s.ZodUnknown="ZodUnknown",s.ZodNever="ZodNever",s.ZodVoid="ZodVoid",s.ZodArray="ZodArray",s.ZodObject="ZodObject",s.ZodUnion="ZodUnion",s.ZodDiscriminatedUnion="ZodDiscriminatedUnion",s.ZodIntersection="ZodIntersection",s.ZodTuple="ZodTuple",s.ZodRecord="ZodRecord",s.ZodMap="ZodMap",s.ZodSet="ZodSet",s.ZodFunction="ZodFunction",s.ZodLazy="ZodLazy",s.ZodLiteral="ZodLiteral",s.ZodEnum="ZodEnum",s.ZodEffects="ZodEffects",s.ZodNativeEnum="ZodNativeEnum",s.ZodOptional="ZodOptional",s.ZodNullable="ZodNullable",s.ZodDefault="ZodDefault",s.ZodCatch="ZodCatch",s.ZodPromise="ZodPromise",s.ZodBranded="ZodBranded",s.ZodPipeline="ZodPipeline",s.ZodReadonly="ZodReadonly"})(D||(D={}));const x=Ee.create,Xe=Ge.create,Ta=Pt.create;Be.create;const ie=Me.create,ee=ae.create;yt.create;bt.create;He.create;const Qr=kt.create,el=Ke.create;wt.create;Ve.create;We.create;const tl=ee({label:x().min(1).max(40),left:x().min(1).max(35),right:x().min(1).max(35)}),al=ee({id:x().optional().default(()=>`post-${Date.now()}`).transform(s=>s||`post-${Date.now()}`),templateId:x().optional(),category:x().optional().default("TECH"),theme:el(["blue-tech","emerald-finance","slate-education","dark-contrast","crimson-alert","amber-gold","cyber-violet","sunset-orange","nordic-frost","monochrome-luxe"]).default("blue-tech"),layoutType:x().default("table"),title:x().min(1).max(120),subtitle:x().min(1).max(250),leftHeader:x().optional().default("USA 🇺🇸"),rightHeader:x().optional().default("UK 🇬🇧"),rows:ie(tl).optional().default([]),bullets:ie(ee({highlight:x().optional().default(""),text:x().min(1)})).optional().default([]),bigStat:ee({number:x().default("$165,000"),label:x().default("Average Compensation"),subtext:x().optional().default(""),secondaryNumber:x().optional().default(""),secondaryLabel:x().optional().default("")}).optional(),listItems:ie(ee({rank:Xe(),title:x(),value:x(),tag:x().optional().default("")})).optional().default([]),quoteData:ee({quote:x(),highlight:x().optional().default(""),source:x().default("Industry Insider")}).optional(),versusData:ee({leftEntity:x().optional(),leftStats:ie(ee({label:x(),value:x()})).optional(),leftPerk:x().optional(),rightEntity:x().optional(),rightStats:ie(ee({label:x(),value:x()})).optional(),rightPerk:x().optional(),verdict:x().optional()}).optional(),receiptData:ee({grossMonthly:x().optional(),items:ie(ee({label:x(),amount:x(),note:x().optional()})).optional(),totalDeductions:x().optional(),netRemaining:x().optional()}).optional(),timelineData:ee({pastYear:x().optional().default("2016"),presentYear:x().optional().default("2026"),items:ie(ee({label:x(),pastValue:x(),presentValue:x(),changeBadge:x().optional()})).optional(),bottomInsight:x().optional()}).optional(),barchartData:ie(ee({label:x(),percentage:Xe().min(0).max(100),amount:x().optional(),tag:x().optional()})).optional().default([]),leaderboardData:ee({calloutNote:x().optional().default("*Asumsi kurs : Rp15.500/US$"),items:ie(ee({rank:Xe(),name:x(),flag:x().optional().default("🌐"),value:x(),percentage:Xe().min(0).max(100).optional()})).optional()}).optional(),editorialData:ee({badge:x().optional().default("INVESTIGASI KHUSUS"),highlightPhrase:x().optional(),cards:ie(ee({step:x().optional(),title:x(),text:x(),stat:x().optional()})).optional(),keyTakeaway:x().optional()}).optional(),matrixData:ee({headers:ie(x()).optional().default(["Indikator","🇮🇩 IDN","🇲🇾 MYS","🇸🇬 SGP"]),rows:ie(ee({label:x(),values:ie(x())})).optional()}).optional(),debateData:ee({proTitle:x().optional().default("SISI PRO / BENEFIT"),proScore:x().optional().default("65%"),proPoints:ie(x()).optional(),conTitle:x().optional().default("SISI KONTRA / RISIKO"),conScore:x().optional().default("35%"),conPoints:ie(x()).optional(),callToAction:x().optional().default("Kalian di tim mana? Tulis pendapatmu di bawah! 👇")}).optional(),tierlistData:ie(ee({tier:x(),tierColor:x().optional(),items:ie(ee({name:x(),badge:x().optional(),desc:x().optional()}))})).optional().default([]),customHtml:x().optional(),customCss:x().optional(),customFields:Qr(Ta()).optional(),items:ie(Ta()).optional(),footerNote:x().optional().default("Industry Benchmark 2026"),sourceUrl:x().optional(),methodologyBadge:x().optional(),disclaimer:x().optional(),watermark:x().optional().default("@SocialGen"),bgKeyword:x().optional().default("modern office coding night"),reelsDuration:Xe().min(5).max(90).default(30),caption:x().optional().default("Bagikan pendapat Anda di kolom komentar! #infografis #edukasi")}),sl={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"},nl={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"},il={class:"flex items-center gap-2.5 sm:gap-3"},ol={class:"text-sm font-extrabold tracking-tight text-white flex items-center gap-1.5 sm:gap-2"},rl={class:"text-[9px] sm:text-[10px] font-bold px-2 py-0.5 rounded-full bg-slate-800 text-slate-300 border border-slate-700"},ll={class:"flex items-center gap-2 sm:gap-3 text-xs"},dl={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]"},ul={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]"},cl={class:"lg:hidden flex items-center justify-center px-3 py-2 bg-slate-900/90 border-b border-slate-800 flex-shrink-0"},pl={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"},ml={key:0,class:"w-2 h-2 rounded-full bg-emerald-400 animate-ping"},fl={class:"flex items-center gap-2"},hl={key:0,class:"text-emerald-400"},xl={key:1,class:"text-rose-400"},gl={class:"flex-1 w-full max-w-[1720px] mx-auto p-2 sm:p-4 grid grid-cols-1 lg:grid-cols-12 gap-4 overflow-hidden min-h-0"},bl=Ht({__name:"index",setup(s){const e=_({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"}),t=_({theme:"blue-tech",backgroundSource:"pexels",musicFile:"random",videoStartOffset:0,audioStartOffset:0,outputs:{feed:!0,story:!0,reels:!0}}),n=_([]),o=_(-1),r=_(null);function p(I){if(!e.value||!e.value.title||r.value)return;const h=JSON.stringify(e.value),Y=I?JSON.stringify(I):"";if(h!==Y){r.value=JSON.parse(h);try{localStorage.setItem("sg_unsaved_stash",h)}catch{}}}function c(){if(!r.value)return;const I=r.value.title||"Editan Anda";e.value=JSON.parse(JSON.stringify(r.value)),r.value.theme&&(t.value.theme=r.value.theme),r.value=null,o.value=-1,M.value=-1;try{localStorage.removeItem("sg_unsaved_stash")}catch{}Q(`Editan sebelumnya ("${I.slice(0,24)}...") berhasil dikembalikan! ↩️`,"success")}function w(){r.value=null;try{localStorage.removeItem("sg_unsaved_stash")}catch{}}function b(){try{localStorage.setItem("sg_drafts",JSON.stringify(n.value))}catch{}$fetch("/api/drafts",{method:"POST",body:{drafts:n.value}}).catch(()=>{})}function N(){n.value.unshift(JSON.parse(JSON.stringify(e.value))),o.value=0,M.value=-1,b(),Q("Draft berhasil disimpan!")}function ue(I){const h=n.value[I];if(h){p(h),e.value=JSON.parse(JSON.stringify(h)),h.theme&&(t.value.theme=h.theme),o.value=I,M.value=-1;const Y=!!r.value;Q(`Memuat draft #${I+1}: "${(h.title||"Untitled").slice(0,20)}..."`,"success",Y?{label:"↩️ Kembalikan Editan",onClick:c}:void 0)}}function K(I){n.value.splice(I,1),o.value===I&&(o.value=-1),b(),Q("Draft dihapus")}const $=_([]),M=_(-1);function B(){try{localStorage.setItem("sg_gen_history",JSON.stringify($.value))}catch{}$fetch("/api/generation-history",{method:"POST",body:{history:$.value}}).catch(()=>{})}function V(I){const h=$.value[I];if(h){const Y=h.contentData||h;p(Y),e.value=JSON.parse(JSON.stringify(Y)),h.options&&(t.value={...t.value,...h.options}),M.value=I,o.value=-1;const Te=!!r.value;Q(`Memuat riwayat: "${(h.title||"Untitled").slice(0,24)}..."`,"success",Te?{label:"↩️ Kembalikan Editan",onClick:c}:void 0)}}function ve(I){$.value.splice(I,1),M.value===I&&(M.value=-1),B(),Q("Item riwayat dihapus")}function $e(){$.value=[],M.value=-1,B(),Q("Seluruh riwayat generate berhasil dibersihkan!")}let ce=null;function re(){try{localStorage.setItem("sg_active_content",JSON.stringify(e.value)),localStorage.setItem("sg_active_options",JSON.stringify(t.value))}catch{}clearTimeout(ce),ce=setTimeout(()=>{$fetch("/api/last-session",{method:"POST",body:{content:e.value,options:t.value}}).catch(()=>{})},1e3)}ge(()=>e.value,re,{deep:!0}),ge(()=>t.value,re,{deep:!0});const oe=_(!1),X=_(!1),Re=_(""),G=_(null),me=_(""),se=_("success"),F=_("editor"),W=_(null);Ut(async()=>{try{const I=localStorage.getItem("sg_active_content");if(I){const h=JSON.parse(I);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&&(t.value={...t.value,...h.session.options}))}}catch{}try{const I=localStorage.getItem("sg_active_options");if(I){const h=JSON.parse(I);h&&(t.value={...t.value,...h})}}catch{}try{const I=await $fetch("/api/drafts");if(I?.drafts&&Array.isArray(I.drafts)&&I.drafts.length>0)n.value=I.drafts;else{const h=localStorage.getItem("sg_drafts");if(h){const Y=JSON.parse(h);Array.isArray(Y)&&Y.length>0&&(n.value=Y,$fetch("/api/drafts",{method:"POST",body:{drafts:Y}}).catch(()=>{}))}}}catch{const I=localStorage.getItem("sg_drafts");if(I)try{n.value=JSON.parse(I)}catch{}}try{const I=await $fetch("/api/generation-history");if(I?.history&&Array.isArray(I.history)&&I.history.length>0)$.value=I.history;else{const h=localStorage.getItem("sg_gen_history");h&&($.value=JSON.parse(h))}}catch{}try{const I=await $fetch("/api/status");W.value=I}catch{}try{const I=localStorage.getItem("sg_unsaved_stash");I&&(r.value=JSON.parse(I))}catch{}});const te=de(()=>{const I=al.safeParse(e.value);if(I.success)return{isValid:!0,error:""};{const h=I.error.errors[0];return{isValid:!1,error:`${h.path.join(".")}: ${h.message}`}}}),fe=_(null);let _e=null;function Q(I,h="success",Y){clearTimeout(_e),me.value=I,se.value=h,fe.value=Y||null,_e=setTimeout(()=>{me.value="",fe.value=null},Y?7e3:4e3)}async function Se(I,h,Y,Te){X.value=!0,Re.value=`AI Research (${Y||"Gemini"})...`;try{const U=await $fetch("/api/auto-topic",{method:"POST",body:{niche:I,layoutType:h,model:Y,language:Te}});if(U?.dataset){p(U.dataset),e.value=U.dataset,t.value.theme=U.dataset.theme,n.value.unshift(U.dataset),o.value=0,b();const he=!!r.value;U.source==="gemini"?Q(`✨ [${U.modelUsed||"Gemini"}] Berhasil meriset: "${U.dataset.title.slice(0,32)}..."`,"success",he?{label:"↩️ Kembalikan Editan",onClick:c}:void 0):Q(`ℹ️ [Curated Data] Topik siap: "${U.dataset.title.slice(0,32)}..."`,"success",he?{label:"↩️ Kembalikan Editan",onClick:c}:void 0)}}catch(U){Q("Gagal auto-topic: "+(U.data?.statusMessage||U.message),"error")}finally{X.value=!1,Re.value=""}}async function C(){if(!te.value.isValid){Q("Data tidak valid: "+te.value.error,"error");return}oe.value=!0,Re.value="Rendering Images & Reels...",G.value=null;const I={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(t.value))};$.value.unshift(I),M.value=0,B(),F.value="preview";try{const h=await $fetch("/api/generate",{method:"POST",body:{data:e.value,options:t.value}});h?.success&&(G.value=h,Q(`Sukses dirender dalam ${(h.durationMs/1e3).toFixed(1)} detik!`))}catch(h){Q("Gagal render: "+(h.data?.statusMessage||h.message),"error")}finally{oe.value=!1,Re.value=""}}return(I,h)=>{const Y=Eo,Te=Cr;return f(),g("div",sl,[a("header",nl,[a("div",il,[h[11]||(h[11]=a("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)),a("div",null,[a("h1",ol,[h[10]||(h[10]=z(" SocialGen ",-1)),a("span",rl," v"+y(l(W)?.version||"2.3.6"),1)])])]),a("div",ll,[l(W)?.geminiActive?(f(),g("span",dl," ● AI Connected ")):(f(),g("span",ul," ● Local Engine "))])]),a("div",cl,[a("div",pl,[a("button",{onClick:h[0]||(h[0]=U=>F.value="editor"),class:J(["py-1.5 px-3 rounded-lg transition flex items-center justify-center gap-1.5",l(F)==="editor"?"bg-sky-500 text-white shadow-md font-black":"text-slate-400 hover:text-slate-200"])},[...h[12]||(h[12]=[a("span",null,"⚙️ Studio & Editor",-1)])],2),a("button",{onClick:h[1]||(h[1]=U=>F.value="preview"),class:J(["py-1.5 px-3 rounded-lg transition flex items-center justify-center gap-1.5",l(F)==="preview"?"bg-indigo-600 text-white shadow-md font-black":"text-slate-400 hover:text-slate-200"])},[h[13]||(h[13]=a("span",null,"👁️ Live Preview",-1)),l(G)?(f(),g("span",ml)):P("",!0)],2)])]),l(me)?(f(),g("div",{key:0,class:J(["fixed bottom-6 right-6 z-50 flex items-center gap-3 px-4 py-3 rounded-2xl shadow-2xl text-xs font-bold border transition-all",l(se)==="success"?"bg-slate-900 text-slate-100 border-sky-500/50 shadow-sky-950/50":"bg-rose-950 text-rose-200 border-rose-500/50"])},[a("div",fl,[l(se)==="success"?(f(),g("span",hl,"●")):(f(),g("span",xl,"⚠️")),a("span",null,y(l(me)),1)]),l(fe)?(f(),g("button",{key:0,onClick:h[2]||(h[2]=()=>{l(fe)?.onClick(),me.value="",fe.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"},y(l(fe).label),1)):P("",!0),a("button",{onClick:h[3]||(h[3]=U=>{me.value="",fe.value=null}),class:"text-slate-400 hover:text-white transition ml-1 text-xs"}," ✕ ")],2)):P("",!0),a("main",gl,[a("section",{class:J(["lg:col-span-5 h-full overflow-y-auto pr-1 flex-col gap-3 custom-scrollbar",l(F)==="editor"?"flex":"hidden lg:flex"])},[O(Y,{modelValue:l(e),"onUpdate:modelValue":h[4]||(h[4]=U=>Ze(e)?e.value=U:null),options:l(t),"onUpdate:options":h[5]||(h[5]=U=>Ze(t)?t.value=U:null),"is-valid":l(te).isValid,"validation-error":l(te).error,"is-generating":l(oe),"generate-stage":l(Re),"is-auto-topic-loading":l(X),drafts:l(n),"active-draft-index":l(o),history:l($),"active-history-index":l(M),"unsaved-stash":l(r),onGenerate:C,onAutoTopic:Se,onSelectDraft:ue,onDeleteDraft:K,onSaveDraft:N,onSelectHistory:V,onDeleteHistory:ve,onClearAllHistory:$e,onRestoreStash:c,onClearStash:w,onToast:h[6]||(h[6]=(U,he)=>Q(U,he))},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),a("section",{class:J(["lg:col-span-7 h-full flex-col gap-3 overflow-hidden justify-between min-h-0",l(F)==="preview"?"flex":"hidden lg:flex"])},[O(Te,{data:l(e),"selected-video":l(t).backgroundSource,"selected-music":l(t).musicFile,"video-start-offset":l(t).videoStartOffset,"onUpdate:videoStartOffset":h[7]||(h[7]=U=>l(t).videoStartOffset=U),"audio-start-offset":l(t).audioStartOffset,"onUpdate:audioStartOffset":h[8]||(h[8]=U=>l(t).audioStartOffset=U),"generated-result":l(G)},null,8,["data","selected-video","selected-music","video-start-offset","audio-start-offset","generated-result"])],2)]),l(F)==="editor"?(f(),g("button",{key:1,onClick:h[9]||(h[9]=U=>F.value="preview"),class:"lg:hidden fixed bottom-5 left-1/2 -translate-x-1/2 z-40 px-5 py-2.5 rounded-full bg-gradient-to-r from-sky-500 to-indigo-600 text-white font-extrabold text-xs shadow-2xl border border-sky-400/40 flex items-center gap-2 hover:opacity-95"},[...h[14]||(h[14]=[a("span",null,"👁️ Lihat Preview Canvas",-1)])])):P("",!0)])}}});export{bl as default};
@@ -1 +1 @@
1
- import{_ as m}from"./DPe4ptnz.js";import{d as u,$ as y,o as f,B as s,l as o,D as p,E as b,N as g,W as v,A as n,m as _,i}from"./C5uDHZ0c.js";const h={key:0,class:"p-8 text-red-400 font-bold text-center"},S={key:1,id:"render-target",class:"inline-block"},C=u({__name:"[mode]",setup($){const l=y(),d=_(()=>{const e=l.params.mode;return e==="feed"||e==="story"||e==="overlay"?e:"feed"}),r=i(null),a=i("");return f(async()=>{const e=l.query;if(e.payload)try{const t=decodeURIComponent(atob(e.payload));r.value=JSON.parse(t);return}catch(t){console.error("Failed to parse query payload:",t)}if(e.jobId)try{const t=await $fetch(`/api/render-data?jobId=${e.jobId}`);r.value=t;return}catch(t){a.value="Failed to load render job data",console.error(t)}r.value={id:"demo-render",category:"TECH",theme:"blue-tech",title:"SOFTWARE SALARY 2026",subtitle:"USA vs UK (Annual Gross)",leftHeader:"USA 🇺🇸",rightHeader:"UK 🇬🇧",rows:[{label:"Junior Dev",left:"$85,000/yr",right:"$45,000/yr"},{label:"Mid-Level",left:"$125,000/yr",right:"$68,000/yr"},{label:"Senior Dev",left:"$165,000/yr",right:"$90,000/yr"},{label:"Avg Tax",left:"24%",right:"40%"},{label:"Paid Leave",left:"15 Days",right:"28 Days"}],footerNote:"Source: Industry Salary Survey 2026",watermark:"@FBProCreator",bgKeyword:"modern office coding night",reelsDuration:10,caption:"Demo caption"}}),(e,t)=>{const c=m;return n(),s("div",{class:v(["m-0 p-0 overflow-hidden",o(d)==="overlay"?"bg-transparent":"bg-slate-950"]),style:{"font-family":"system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Color Emoji', sans-serif"}},[o(a)?(n(),s("div",h,p(o(a)),1)):o(r)?(n(),s("div",S,[b(c,{data:o(r),mode:o(d),"is-render":!0},null,8,["data","mode"])])):g("",!0)],2)}}});export{C as default};
1
+ import{_ as m}from"./ztWrJaao.js";import{d as u,$ as y,o as f,B as s,l as o,D as p,E as b,N as g,W as v,A as n,m as _,i}from"./Yv0VQg56.js";const h={key:0,class:"p-8 text-red-400 font-bold text-center"},S={key:1,id:"render-target",class:"inline-block"},C=u({__name:"[mode]",setup($){const l=y(),d=_(()=>{const e=l.params.mode;return e==="feed"||e==="story"||e==="overlay"?e:"feed"}),r=i(null),a=i("");return f(async()=>{const e=l.query;if(e.payload)try{const t=decodeURIComponent(atob(e.payload));r.value=JSON.parse(t);return}catch(t){console.error("Failed to parse query payload:",t)}if(e.jobId)try{const t=await $fetch(`/api/render-data?jobId=${e.jobId}`);r.value=t;return}catch(t){a.value="Failed to load render job data",console.error(t)}r.value={id:"demo-render",category:"TECH",theme:"blue-tech",title:"SOFTWARE SALARY 2026",subtitle:"USA vs UK (Annual Gross)",leftHeader:"USA 🇺🇸",rightHeader:"UK 🇬🇧",rows:[{label:"Junior Dev",left:"$85,000/yr",right:"$45,000/yr"},{label:"Mid-Level",left:"$125,000/yr",right:"$68,000/yr"},{label:"Senior Dev",left:"$165,000/yr",right:"$90,000/yr"},{label:"Avg Tax",left:"24%",right:"40%"},{label:"Paid Leave",left:"15 Days",right:"28 Days"}],footerNote:"Source: Industry Salary Survey 2026",watermark:"@FBProCreator",bgKeyword:"modern office coding night",reelsDuration:10,caption:"Demo caption"}}),(e,t)=>{const c=m;return n(),s("div",{class:v(["m-0 p-0 overflow-hidden",o(d)==="overlay"?"bg-transparent":"bg-slate-950"]),style:{"font-family":"system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Color Emoji', sans-serif"}},[o(a)?(n(),s("div",h,p(o(a)),1)):o(r)?(n(),s("div",S,[b(c,{data:o(r),mode:o(d),"is-render":!0},null,8,["data","mode"])])):g("",!0)],2)}}});export{C as default};