@socialgen_user/socialgen 2.2.3 → 2.2.4
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.
- package/.output/nitro.json +1 -1
- package/.output/public/_nuxt/{BWknYprK.js → 9dBA-jTk.js} +1 -1
- package/.output/public/_nuxt/{Kv2_MwzP.js → B1LS7GXR.js} +2 -2
- package/.output/public/_nuxt/{Dox8APzp.js → BDwg7tOM.js} +1 -1
- package/.output/public/_nuxt/{B2XY1Y3e.js → BZDP1a1i.js} +1 -1
- package/.output/public/_nuxt/{WKMfZGq4.js → BgVraQcx.js} +1 -1
- package/.output/public/_nuxt/{DSqU0yO4.js → D5l4i5hW.js} +1 -1
- package/.output/public/_nuxt/{DyZhC2-k.js → DGwEN7My.js} +1 -1
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/72a36345-9886-4777-b1aa-6b550cf00335.json +1 -0
- package/.output/server/chunks/_/nitro.mjs +124 -124
- package/.output/server/chunks/build/client.precomputed.mjs +1 -1
- package/.output/server/chunks/build/client.precomputed.mjs.map +1 -1
- package/.output/server/chunks/build/{pages-CrBJjQOS.mjs → pages-Da2L_9Pb.mjs} +2 -2
- package/.output/server/chunks/build/{pages-CrBJjQOS.mjs.map → pages-Da2L_9Pb.mjs.map} +1 -1
- package/.output/server/chunks/build/server.mjs +1 -1
- package/.output/server/chunks/build/styles.mjs +2 -2
- package/.output/server/chunks/routes/api/status.get.mjs +12 -3
- package/.output/server/chunks/routes/api/status.get.mjs.map +1 -1
- package/.output/server/package.json +1 -1
- package/package.json +1 -1
- package/.output/public/_nuxt/builds/meta/13e4bb16-9265-4df8-ab2e-2de31ffabf71.json +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as dt,d as vt,M as de,o as Ut,A as _,B as M,l,C as r,E as I,G as J,D as T,N as U,O as Ne,P as xt,Q as qe,R as We,S as Te,T as Oe,U as pe,V as Pe,W as F,X as yt,i as O,m as he,Y as ea,Z as bt}from"./Kv2_MwzP.js";import{_ as ta}from"./DyZhC2-k.js";const aa=a=>a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var Ke={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 sa=({size:a,strokeWidth:e=2,absoluteStrokeWidth:t,color:s,iconNode:n,name:i,class:u,...d},{slots:g})=>dt("svg",{...Ke,width:a||Ke.width,height:a||Ke.height,stroke:s||Ke.stroke,"stroke-width":t?Number(e)*24/Number(a):e,class:["lucide",`lucide-${aa(i??"icon")}`],...d},[...n.map(h=>dt(...h)),...g.default?[g.default()]:[]]);const D=(a,e)=>(t,{slots:s})=>dt(sa,{...t,iconNode:e,name:a},s);const kt=D("BookmarkIcon",[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]]);const Ye=D("CheckIcon",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const na=D("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 ra=D("CircleCheckIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const _t=D("ClockIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const Ht=D("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 ia=D("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 wt=D("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 Gt=D("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 oa=D("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 la=D("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 da=D("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 Jt=D("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 ua=D("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 ca=D("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 qt=D("PlayIcon",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);const fa=D("PlusIcon",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const pa=D("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 ha=D("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 ut=D("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 ma=D("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 va=D("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 St=D("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 ot=D("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 Ct=D("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 ga=D("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 xa=D("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 ya=D("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 Tt=D("XIcon",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);const ba=D("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 ka=D("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"}]]),_a={class:"flex flex-col gap-3 text-slate-100"},wa={key:0,class:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm flex items-center justify-center p-4"},Sa={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"},Ca={class:"flex items-center justify-between pb-3 border-b border-slate-800"},Ta={class:"text-sm font-black text-white flex items-center gap-2"},Oa={class:"p-3.5 bg-slate-950 rounded-2xl border border-slate-800 flex flex-col gap-2.5"},Ma={class:"font-bold text-sky-400 flex items-center justify-between"},Na={class:"grid grid-cols-1 sm:grid-cols-2 gap-2"},$a={class:"flex flex-col gap-2"},Aa={class:"text-[11px] font-bold text-slate-400 uppercase tracking-wider"},Ia={class:"flex flex-col gap-2 max-h-[220px] overflow-y-auto pr-1 custom-scrollbar"},Ra={class:"flex-1"},ja={class:"flex items-center gap-2 mb-1"},Va={class:"font-extrabold text-white text-xs"},Ea={class:"px-1.5 py-0.2 rounded text-[9px] font-bold bg-slate-800 text-slate-300 border border-slate-700"},Da={class:"text-[11px] text-slate-400 leading-snug"},Pa={class:"flex items-center gap-1"},Za=["onClick"],La=["onClick"],za={key:1,class:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm flex items-center justify-center p-4"},Fa={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]"},Ba={class:"flex items-center justify-between pb-3 border-b border-slate-800"},Ua={class:"text-sm font-black text-white flex items-center gap-2"},Ha={class:"flex items-center gap-2 bg-slate-950 p-2.5 rounded-xl border border-slate-800 text-[11px] flex-wrap"},Ga={class:"text-white font-semibold"},Ja={class:"text-white font-semibold"},qa={class:"text-purple-400 font-bold"},Wa={class:"relative flex-1 min-h-[220px]"},Ka=["value"],Ya={class:"flex items-center justify-between pt-2 border-t border-slate-800"},Xa={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"},Qa={class:"text-xs font-black text-white flex items-center gap-2"},es={class:"flex items-center gap-1.5 flex-wrap"},ts={class:"flex items-center gap-1 bg-slate-950 p-1 rounded-xl border border-slate-800 mr-1.5 shadow-inner"},as=["value"],ss={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"},ns=["disabled"],rs={class:"relative group"},is={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-56 text-xs"},os={class:"px-3 py-1.5"},ls={key:2,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"},ds={class:"w-6 h-6 rounded-lg bg-sky-500/20 border border-sky-400/40 flex items-center justify-center flex-shrink-0"},us={class:"text-[11px]"},cs={class:"font-extrabold text-white flex items-center gap-2"},fs={class:"text-[9px] px-1.5 py-0.2 rounded bg-sky-500/30 text-sky-200 border border-sky-400/30"},ps={class:"flex items-center justify-between bg-slate-950 p-1 rounded-xl border border-slate-800 text-xs font-semibold"},hs={class:"flex items-center gap-1"},ms={class:"flex items-center gap-1.5"},vs={key:3,class:"flex flex-col gap-1.5 p-2.5 bg-slate-900/90 border border-slate-800 rounded-2xl max-h-[300px] overflow-y-auto custom-scrollbar"},gs={key:0,class:"text-center py-8 text-slate-500 text-[11px] leading-relaxed"},xs=["onClick"],ys={class:"flex-1 pr-2"},bs={class:"flex items-center gap-1.5 mb-0.5"},ks={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"},_s={class:"text-[9px] text-slate-400 font-semibold"},ws={class:"font-bold text-[11px] truncate text-slate-100"},Ss=["onClick"],Cs={key:4,class:"flex flex-col gap-1.5 p-2.5 bg-slate-900/90 border border-slate-800 rounded-2xl max-h-[300px] overflow-y-auto custom-scrollbar"},Ts={key:0,class:"text-center py-8 text-slate-500 text-[11px] leading-relaxed"},Os=["onClick"],Ms={class:"flex-1 pr-2"},Ns={class:"flex items-center gap-1.5 mb-0.5"},$s={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"},As={class:"text-[9px] text-slate-400 font-semibold"},Is={key:0,class:"text-[9px] text-slate-500 font-mono ml-auto"},Rs={class:"font-bold text-[11px] truncate text-slate-100"},js=["onClick"],Vs={key:5,class:"flex flex-col bg-slate-900/90 border border-slate-800 rounded-2xl overflow-hidden shadow-lg"},Es={class:"grid grid-cols-2 gap-2 p-2.5 bg-slate-950/70 border-b border-slate-800 text-xs"},Ds={class:"block text-[10px] font-bold text-slate-300 mb-1 flex items-center gap-1"},Ps=["value"],Zs=["value"],Ls={class:"col-span-2 grid grid-cols-3 gap-2 pt-1 border-t border-slate-800/60 mt-1"},zs={class:"col-span-1"},Fs=["value"],Bs={class:"col-span-2"},Us=["value"],Hs={class:"flex items-center justify-between px-3 py-1.5 bg-slate-950/50 border-b border-slate-800"},Gs={class:"flex items-center gap-2 text-xs"},Js={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"},qs={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"},Ws={class:"relative p-2"},Ks=["value"],Ys={key:0,class:"text-[10px] text-rose-400 mt-1 px-1"},Xs={class:"p-3 bg-slate-900/90 border border-slate-800 rounded-2xl flex flex-col gap-2.5 shadow-lg text-xs"},Qs={class:"flex flex-col gap-1.5"},en={class:"flex items-center justify-between gap-2"},tn={class:"font-bold text-slate-300 flex items-center gap-1.5 text-[11px]"},an={class:"flex items-center gap-1.5"},sn=["value"],nn=["value"],rn=["disabled"],on={class:"hidden sm:inline"},ln={class:"flex items-center justify-between pl-5 pr-1 text-[10px] text-slate-400"},dn={class:"flex items-center gap-1 text-sky-300 font-mono"},un=["max","value"],cn={class:"flex flex-col gap-1.5 pt-1.5 border-t border-slate-800"},fn={class:"flex items-center justify-between gap-2"},pn={class:"font-bold text-slate-300 flex items-center gap-1.5 text-[11px]"},hn={class:"flex items-center gap-1.5"},mn=["value"],vn=["value"],gn=["disabled"],xn={class:"hidden sm:inline"},yn={class:"flex items-center justify-between pl-5 pr-1 text-[10px] text-slate-400"},bn={class:"flex items-center gap-1 text-purple-300 font-mono"},kn=["max","value"],_n={class:"flex items-center justify-between pt-1.5 border-t border-slate-800"},wn={class:"font-bold text-slate-300 flex items-center gap-1.5 text-[11px]"},Sn={class:"flex items-center gap-1.5 flex-wrap justify-end"},Cn=["onClick"],Tn={class:"grid grid-cols-3 gap-2 pt-1.5 border-t border-slate-800"},On=["checked"],Mn=["checked"],Nn=["checked"],$n=["disabled"],An=vt({__name:"DashboardControls",props:{modelValue:{},options:{},isValid:{type:Boolean},validationError:{},isGenerating:{type:Boolean},generateStage:{},isAutoTopicLoading:{type:Boolean},drafts:{},activeDraftIndex:{},history:{},activeHistoryIndex:{}},emits:["update:modelValue","update:options","generate","autoTopic","selectDraft","deleteDraft","saveDraft","selectHistory","deleteHistory","clearAllHistory"],setup(a,{emit:e}){const t=a,s=e,n=O(""),i=O(""),u=O(""),d=O("gemini-3.8-flash"),g=O("editor"),h=O([]),w=O("tech"),K=O(!1),Z=O(null),A=O({id:"",name:"",theme:"blue-tech",description:""});async function j(){try{const m=await $fetch("/api/niches");m?.niches&&m.niches.length>0&&(h.value=m.niches,h.value.some(o=>o.id===w.value)||(w.value=h.value[0].id))}catch(m){console.error("Failed to load niches:",m)}}function H(){Z.value=null,A.value={id:"",name:"",theme:t.modelValue.theme||"blue-tech",description:""},K.value=!0}function W(m){Z.value=m.id,A.value={id:m.id,name:m.name,theme:m.theme||"blue-tech",description:m.description}}async function ne(){if(!A.value.name.trim()){alert("Nama Niche wajib diisi");return}const o={id:Z.value||A.value.name.toLowerCase().replace(/[^a-z0-9_-]/g,"_"),name:A.value.name.trim(),theme:A.value.theme,description:A.value.description.trim()||`Fokus pada topik ${A.value.name.trim()}`};try{const c=await $fetch("/api/niches",{method:"POST",body:o});c?.niches&&(h.value=c.niches,w.value=o.id,Z.value=null,A.value={id:"",name:"",theme:"blue-tech",description:""})}catch(c){alert("Gagal menyimpan niche: "+(c.data?.statusMessage||c.message))}}async function ue(m){if(h.value.length<=1){alert("Minimal harus ada 1 niche tersisa.");return}if(confirm("Hapus niche ini?"))try{const o=await $fetch(`/api/niches?id=${m}`,{method:"DELETE"});o?.niches&&(h.value=o.niches,w.value===m&&(w.value=o.niches[0].id),Z.value===m&&(Z.value=null))}catch(o){alert("Gagal menghapus niche: "+(o.data?.statusMessage||o.message))}}const L=O("id"),G=O(!1),B=O(""),Y=O({}),ae=O(!1),le=O(!1),ce=O(["cyber_blue.mp4","emerald_flow.mp4","default_bg.mp4"]),X=O(["synthwave_pulse.mp3","lofi_chill.mp3","default_ambient.mp3"]),ye=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}),Ce=he(()=>{const m=t.options.backgroundSource||"";return ye.value[m]||15}),C=he(()=>Math.max(1,Ce.value-1)),y=he(()=>{const m=t.options.musicFile||"";return ye.value[m]||30}),ee=he(()=>Math.max(1,y.value-1));de(()=>t.options.backgroundSource,()=>{const m=C.value;(t.options.videoStartOffset||0)>m&&fe("videoStartOffset",m)}),de(()=>t.options.musicFile,()=>{const m=ee.value;(t.options.audioStartOffset||0)>m&&fe("audioStartOffset",m)});const ie=O(!1),P=O(null),ze=O(null);async function Fe(){try{const m=await $fetch("/api/media");m?.videos?.length&&(ce.value=m.videos),m?.audio?.length&&(X.value=m.audio),m?.durations&&(ye.value={...ye.value,...m.durations})}catch(m){console.error("Failed to fetch media list:",m)}}Ut(()=>{try{const m=localStorage.getItem("sg_selected_language");m&&(L.value=m)}catch{}Fe(),j()}),de(L,m=>{try{localStorage.setItem("sg_selected_language",m)}catch{}});async function Be(m,o){const c=m.target,se=c.files?.[0];if(se){ie.value=!0;try{const ge=new FormData;ge.append("file",se);const Je=await $fetch("/api/upload-media",{method:"POST",body:ge});Je?.success&&(await Fe(),Je.type==="video"?fe("backgroundSource",Je.filename):fe("musicFile",Je.filename))}catch(ge){alert("Upload gagal: "+(ge.data?.statusMessage||ge.message))}finally{ie.value=!1,c.value=""}}}de(()=>t.modelValue,m=>{try{const o=JSON.parse(n.value||"{}");JSON.stringify(o)!==JSON.stringify(m)&&(n.value=JSON.stringify(m,null,2))}catch{n.value=JSON.stringify(m,null,2)}},{immediate:!0,deep:!0});function Ue(m){const o=m.target;n.value=o.value;try{const c=JSON.parse(o.value);i.value="",s("update:modelValue",c)}catch(c){i.value="Invalid JSON: "+c.message}}function st(){try{const m=JSON.parse(n.value);n.value=JSON.stringify(m,null,2),i.value="",s("update:modelValue",m)}catch{i.value="Cannot format invalid JSON"}}function He(m){const o={...t.modelValue,layoutType:m};s("update:modelValue",o)}function nt(m){const o={...t.modelValue,watermark:m};s("update:modelValue",o)}function rt(m){const o={...t.modelValue,title:m};s("update:modelValue",o)}function Ge(m){const o={...t.modelValue,theme:m};s("update:modelValue",o),s("update:options",{...t.options,theme:m})}function it(m){const o={...t.modelValue,reelsDuration:m};s("update:modelValue",o)}function fe(m,o){s("update:options",{...t.options,[m]:o})}function S(m,o){const c=t.options.outputs||{feed:!0,story:!0,reels:!0};s("update:options",{...t.options,outputs:{...c,[m]:o}})}function p(m,o){s("autoTopic",w.value,o||u.value||void 0,d.value,L.value)}async function ve(){G.value=!0,ae.value=!0;try{const m=await $fetch("/api/copy-prompt",{query:{niche:w.value,layout:t.modelValue.layoutType||"news",language:L.value}});B.value=m.prompt,Y.value={topic:m.topic,pair:m.pair,niche:m.niche,usedCount:m.usedCount,language:m.language||L.value}}catch(m){console.error("Failed to get manual prompt:",m)}finally{ae.value=!1}}function te(){B.value&&(navigator.clipboard.writeText(B.value),le.value=!0,setTimeout(()=>{le.value=!1},2500))}function Xt(){t.history.length!==0&&confirm(`Bersihkan semua ${t.history.length} riwayat generate otomatis?`)&&s("clearAllHistory")}function Qt(m){if(!m)return"";try{return new Date(m).toLocaleDateString("id-ID",{day:"numeric",month:"short",hour:"2-digit",minute:"2-digit"})}catch{return""}}return(m,o)=>(_(),M("div",_a,[l(K)?(_(),M("div",wa,[r("div",Sa,[r("div",Ca,[r("div",null,[r("h3",Ta,[I(l(ma),{class:"w-4 h-4 text-sky-400"}),o[44]||(o[44]=J(" Kelola & Buat Niche Baru ",-1))]),o[45]||(o[45]=r("p",{class:"text-[11px] text-slate-400 mt-0.5"}," Simpan niche favoritmu. AI dan Prompt Generator akan otomatis menggunakannya. ",-1))]),r("button",{onClick:o[0]||(o[0]=c=>K.value=!1),class:"p-1 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800"},[I(l(Tt),{class:"w-4 h-4"})])]),r("div",Oa,[r("div",Ma,[r("span",null,T(l(Z)?"✏️ Edit Niche":"➕ Tambah Niche Baru"),1),l(Z)?(_(),M("button",{key:0,onClick:o[1]||(o[1]=c=>{Z.value=null,A.value={id:"",name:"",theme:"blue-tech",description:""}}),class:"text-[10px] text-slate-400 hover:text-white"}," Batal Edit ")):U("",!0)]),r("div",Na,[r("div",null,[o[46]||(o[46]=r("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Nama Niche",-1)),Ne(r("input",{"onUpdate:modelValue":o[2]||(o[2]=c=>l(A).name=c),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),[[xt,l(A).name]])]),r("div",null,[o[48]||(o[48]=r("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Tema Default",-1)),Ne(r("select",{"onUpdate:modelValue":o[3]||(o[3]=c=>l(A).theme=c),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"},[...o[47]||(o[47]=[We('<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),[[qe,l(A).theme]])])]),r("div",null,[o[49]||(o[49]=r("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Fokus Topik & Instruksi Prompt",-1)),Ne(r("textarea",{"onUpdate:modelValue":o[4]||(o[4]=c=>l(A).description=c),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),[[xt,l(A).description]])]),r("button",{onClick:ne,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"},[I(l(Ye),{class:"w-3.5 h-3.5"}),r("span",null,T(l(Z)?"Perbarui Niche":"Simpan Niche"),1)])]),r("div",$a,[r("div",Aa," Daftar Niche Tersimpan ("+T(l(h).length)+") ",1),r("div",Ia,[(_(!0),M(Te,null,Oe(l(h),c=>(_(),M("div",{key:c.id,class:"p-2.5 rounded-xl border bg-slate-950 border-slate-800 flex items-start justify-between gap-2"},[r("div",Ra,[r("div",ja,[r("span",Va,T(c.name),1),r("span",Ea,T(c.theme||"blue-tech"),1)]),r("p",Da,T(c.description),1)]),r("div",Pa,[r("button",{onClick:se=>W(c),class:"p-1.5 rounded-lg text-slate-400 hover:text-sky-300 hover:bg-slate-800 transition",title:"Edit Niche"},[I(l(ca),{class:"w-3.5 h-3.5"})],8,Za),r("button",{onClick:se=>ue(c.id),class:"p-1.5 rounded-lg text-slate-400 hover:text-rose-400 hover:bg-slate-800 transition",title:"Hapus Niche"},[I(l(ot),{class:"w-3.5 h-3.5"})],8,La)])]))),128))])])])])):U("",!0),l(G)?(_(),M("div",za,[r("div",Fa,[r("div",Ba,[r("div",null,[r("h3",Ua,[I(l(wt),{class:"w-4 h-4 text-purple-400"}),o[50]||(o[50]=J(" Master Prompt AI (Dynamic Research & Zero-Collision) ",-1))]),o[51]||(o[51]=r("p",{class:"text-[11px] text-slate-400 mt-0.5"}," Salin prompt ini ke ChatGPT / Gemini / Claude / DeepSeek untuk mencari topik terbaru. ",-1))]),r("button",{onClick:o[5]||(o[5]=c=>G.value=!1),class:"p-1 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800"},[I(l(Tt),{class:"w-4 h-4"})])]),r("div",Ha,[o[52]||(o[52]=r("span",{class:"font-bold text-sky-400"},"Niche Aktif:",-1)),r("span",Ga,T(l(h).find(c=>c.id===l(w))?.name||"Default"),1),o[53]||(o[53]=r("span",{class:"text-slate-500"},"•",-1)),o[54]||(o[54]=r("span",{class:"font-bold text-emerald-400"},"Bahasa:",-1)),r("span",Ja,T(l(Y).language||"Bahasa Indonesia 🇮🇩"),1),o[55]||(o[55]=r("span",{class:"text-slate-500"},"•",-1)),r("span",qa,T(l(Y).usedCount||0)+" Topik Riwayat Dikecualikan",1)]),r("div",Wa,[r("textarea",{value:l(B),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,Ka)]),r("div",Ya,[o[56]||(o[56]=r("span",{class:"text-[11px] text-slate-400"},[J(" Paste hasil JSON yang kamu buat ke kolom "),r("b",null,"RAW JSON"),J(" SocialGen. ")],-1)),r("button",{onClick:te,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(le)?(_(),pe(l(Ye),{key:0,class:"w-4 h-4 text-emerald-400"})):(_(),pe(l(Ht),{key:1,class:"w-4 h-4"})),r("span",null,T(l(le)?"Prompt Berhasil Disalin!":"Copy Master Prompt"),1)])])])])):U("",!0),r("div",Xa,[r("div",null,[r("h2",Qa,[I(l(ya),{class:"w-3.5 h-3.5 text-sky-400"}),o[57]||(o[57]=J(" Content Studio ",-1))]),o[58]||(o[58]=r("p",{class:"text-[10px] text-slate-400"},"Multi-Format Studio",-1))]),r("div",es,[r("div",ts,[Ne(r("select",{"onUpdate:modelValue":o[6]||(o[6]=c=>Pe(w)?w.value=c: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"},[(_(!0),M(Te,null,Oe(l(h),c=>(_(),M("option",{key:c.id,value:c.id,class:"bg-slate-900 text-white"},T(c.name),9,as))),128))],512),[[qe,l(w)]]),r("button",{onClick:H,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"},[I(l(fa),{class:"w-3 h-3"}),o[59]||(o[59]=r("span",{class:"hidden sm:inline"},"Niche",-1))])]),r("div",ss,[I(l(la),{class:"w-3 h-3 text-emerald-400 ml-1 flex-shrink-0"}),Ne(r("select",{"onUpdate:modelValue":o[7]||(o[7]=c=>Pe(L)?L.value=c: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"},[...o[60]||(o[60]=[We('<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),[[qe,l(L)]])]),r("button",{onClick:ve,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"},[I(l(wt),{class:"w-3 h-3"}),o[61]||(o[61]=r("span",{class:"hidden sm:inline"},"Prompt Manual",-1))]),r("button",{onClick:o[8]||(o[8]=c=>p()),disabled:a.isGenerating||a.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"},[I(l(St),{class:F(["w-3.5 h-3.5",{"animate-spin":a.isAutoTopicLoading}])},null,8,["class"]),r("span",null,T(a.isAutoTopicLoading?"Meriset Data...":"✨ Auto-Topic"),1)],8,ns),r("div",rs,[o[66]||(o[66]=r("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)),r("div",is,[o[63]||(o[63]=r("div",{class:"px-3 py-1 text-[10px] font-bold text-slate-500 uppercase"},"Model AI Engine",-1)),r("div",os,[Ne(r("select",{"onUpdate:modelValue":o[9]||(o[9]=c=>Pe(d)?d.value=c:null),class:"w-full bg-slate-950 border border-slate-700 rounded-lg p-1.5 text-xs text-sky-300 focus:outline-none"},[...o[62]||(o[62]=[r("option",{value:"gemini-3.8-flash"},"⚡ Gemini 3.8 Flash",-1),r("option",{value:"gemini-3.5-flash"},"⚡ Gemini 3.5 Flash",-1),r("option",{value:"gemini-2.5-pro"},"💎 Gemini 2.5 Pro",-1),r("option",{value:"gemini-1.5-pro"},"💎 Gemini 1.5 Pro",-1)])],512),[[qe,l(d)]])]),o[64]||(o[64]=r("div",{class:"border-t border-slate-800 my-1"},null,-1)),o[65]||(o[65]=r("div",{class:"px-3 py-1 text-[10px] font-bold text-slate-500 uppercase"},"Pilih Format Khusus",-1)),r("button",{onClick:o[10]||(o[10]=c=>p(void 0,"table")),class:"px-3 py-1.5 text-left text-sky-300 hover:bg-slate-800"}," 📊 Classic Comparison Table "),r("button",{onClick:o[11]||(o[11]=c=>p(void 0,"versus")),class:"px-3 py-1.5 text-left text-orange-300 hover:bg-slate-800"}," ⚔️ Versus Showdown Arena "),r("button",{onClick:o[12]||(o[12]=c=>p(void 0,"receipt")),class:"px-3 py-1.5 text-left text-teal-300 hover:bg-slate-800"}," 🧾 Monthly Living Invoice "),r("button",{onClick:o[13]||(o[13]=c=>p(void 0,"news")),class:"px-3 py-1.5 text-left text-rose-300 hover:bg-slate-800"}," 📰 Breaking News / Pamphlet "),r("button",{onClick:o[14]||(o[14]=c=>p(void 0,"stat")),class:"px-3 py-1.5 text-left text-amber-300 hover:bg-slate-800"}," 🎯 Big Shocking Number "),r("button",{onClick:o[15]||(o[15]=c=>p(void 0,"timeline")),class:"px-3 py-1.5 text-left text-yellow-300 hover:bg-slate-800"}," ⏳ 10-Year Shift (Then vs Now) "),r("button",{onClick:o[16]||(o[16]=c=>p(void 0,"barchart")),class:"px-3 py-1.5 text-left text-cyan-300 hover:bg-slate-800"}," 📈 Income Allocation Bars "),r("button",{onClick:o[17]||(o[17]=c=>p(void 0,"list")),class:"px-3 py-1.5 text-left text-emerald-300 hover:bg-slate-800"}," 🏆 Top 5 Ranked Countdown "),r("button",{onClick:o[18]||(o[18]=c=>p(void 0,"quote")),class:"px-3 py-1.5 text-left text-purple-300 hover:bg-slate-800"}," 💬 Hot Take / Quote Debate "),r("button",{onClick:o[19]||(o[19]=c=>p(void 0,"leaderboard")),class:"px-3 py-1.5 text-left text-yellow-400 hover:bg-slate-800 font-bold"}," 🥇 Multi-Country Leaderboard (Top 10) "),r("button",{onClick:o[20]||(o[20]=c=>p(void 0,"editorial")),class:"px-3 py-1.5 text-left text-sky-400 hover:bg-slate-800 font-bold"}," 📰 Editorial Storytelling Deep Dive "),r("button",{onClick:o[21]||(o[21]=c=>p(void 0,"matrix")),class:"px-3 py-1.5 text-left text-teal-300 hover:bg-slate-800 font-bold"}," 📊 Multi-Column Matrix (3-4 Negara) "),r("button",{onClick:o[22]||(o[22]=c=>p(void 0,"debate")),class:"px-3 py-1.5 text-left text-rose-400 hover:bg-slate-800 font-bold"}," ⚡ Debate Arena (Pro vs Kontra) "),r("button",{onClick:o[23]||(o[23]=c=>p(void 0,"tierlist")),class:"px-3 py-1.5 text-left text-amber-300 hover:bg-slate-800 font-bold"}," 🎖️ Tier List Ranking (S, A, B, C) ")])])])]),a.isAutoTopicLoading?(_(),M("div",ls,[r("div",ds,[I(l(St),{class:"w-3.5 h-3.5 text-sky-400 animate-spin"})]),r("div",us,[r("div",cs,[o[67]||(o[67]=r("span",null,"AI Research Engine Sedang Bekerja...",-1)),r("span",fs,T(l(d)),1)]),o[68]||(o[68]=r("p",{class:"text-[10px] text-slate-300 mt-0.5"},"Menganalisis angka perbandingan 2026 & meracik copywriting viral.",-1))])])):U("",!0),r("div",ps,[r("div",hs,[r("button",{onClick:o[24]||(o[24]=c=>g.value="editor"),class:F(["px-2.5 py-1 rounded-lg transition text-[11px]",l(g)==="editor"?"bg-slate-800 text-sky-400 shadow font-bold":"text-slate-400 hover:text-white"])}," JSON Editor ",2),r("button",{onClick:o[25]||(o[25]=c=>g.value="drafts"),class:F(["px-2.5 py-1 rounded-lg transition flex items-center gap-1 text-[11px]",l(g)==="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"},[I(l(kt),{class:"w-3 h-3"}),r("span",null,"Drafts ("+T(a.drafts.length)+")",1)],2),r("button",{onClick:o[26]||(o[26]=c=>g.value="history"),class:F(["px-2.5 py-1 rounded-lg transition flex items-center gap-1 text-[11px]",l(g)==="history"?"bg-slate-800 text-purple-400 shadow font-bold":"text-slate-400 hover:text-white"]),title:"Riwayat otomatis setiap kali generate"},[I(l(_t),{class:"w-3 h-3"}),r("span",null,"Riwayat ("+T(a.history.length)+")",1)],2)]),r("div",ms,[l(g)==="history"&&a.history.length>0?(_(),M("button",{key:0,onClick:Xt,class:"text-[10px] text-rose-400 hover:text-rose-300 transition font-bold pr-1",title:"Bersihkan semua riwayat generate"}," Bersihkan Riwayat ")):U("",!0),r("button",{onClick:o[27]||(o[27]=c=>s("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"},[I(l(kt),{class:"w-3 h-3"}),o[69]||(o[69]=r("span",null,"+ Simpan ke Draft",-1))])])]),l(g)==="drafts"?(_(),M("div",vs,[a.drafts.length===0?(_(),M("div",gs,[...o[70]||(o[70]=[J(" Belum ada draft tersimpan.",-1),r("br",null,null,-1),J(" Klik ",-1),r("b",{class:"text-amber-400"},"+ Simpan ke Draft",-1),J(" di atas untuk menyimpan konten ini agar bisa diedit/digenerate nanti! ",-1)])])):U("",!0),(_(!0),M(Te,null,Oe(a.drafts,(c,se)=>(_(),M("div",{key:se,onClick:ge=>s("selectDraft",se),class:F(["p-2 rounded-xl border cursor-pointer transition flex items-center justify-between text-xs group",a.activeDraftIndex===se?"bg-amber-500/15 border-amber-500/50 text-white":"bg-slate-950/60 border-slate-800 text-slate-300 hover:border-slate-700"])},[r("div",ys,[r("div",bs,[r("span",ks,T(c.layoutType||"table"),1),r("span",_s,T(c.category),1)]),r("div",ws,T(c.title),1)]),r("button",{onClick:yt(ge=>s("deleteDraft",se),["stop"]),class:"opacity-0 group-hover:opacity-100 p-1 text-slate-400 hover:text-rose-400 transition rounded",title:"Hapus draft ini"},[I(l(ot),{class:"w-3.5 h-3.5"})],8,Ss)],10,xs))),128))])):l(g)==="history"?(_(),M("div",Cs,[a.history.length===0?(_(),M("div",Ts,[...o[71]||(o[71]=[J(" Belum ada riwayat pembuatan.",-1),r("br",null,null,-1),J(" Setiap kali kamu klik ",-1),r("b",{class:"text-sky-400"},"GENERATE CONTENT",-1),J(", hasil pembuatan akan otomatis tercatat di sini! ",-1)])])):U("",!0),(_(!0),M(Te,null,Oe(a.history,(c,se)=>(_(),M("div",{key:se,onClick:ge=>s("selectHistory",se),class:F(["p-2 rounded-xl border cursor-pointer transition flex items-center justify-between text-xs group",a.activeHistoryIndex===se?"bg-purple-500/15 border-purple-500/50 text-white":"bg-slate-950/60 border-slate-800 text-slate-300 hover:border-slate-700"])},[r("div",Ms,[r("div",Ns,[r("span",$s,T(c.layoutType||"reels"),1),r("span",As,T(c.category),1),c.generatedAt?(_(),M("span",Is,T(Qt(c.generatedAt)),1)):U("",!0)]),r("div",Rs,T(c.title),1)]),r("button",{onClick:yt(ge=>s("deleteHistory",se),["stop"]),class:"opacity-0 group-hover:opacity-100 p-1 text-slate-400 hover:text-rose-400 transition rounded",title:"Hapus riwayat ini"},[I(l(ot),{class:"w-3.5 h-3.5"})],8,js)],10,Os))),128))])):(_(),M("div",Vs,[r("div",Es,[r("div",null,[r("label",Ds,[I(l(da),{class:"w-3 h-3 text-sky-400"}),o[72]||(o[72]=J(" Format Template ",-1))]),r("select",{value:a.modelValue.layoutType||"table",onChange:o[28]||(o[28]=c=>He(c.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]"},[...o[73]||(o[73]=[We('<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>',14)])],40,Ps)]),r("div",null,[o[75]||(o[75]=r("label",{class:"block text-[10px] font-bold text-slate-300 mb-1"}," Theme Color (10 Pilihan) ",-1)),r("select",{value:a.modelValue.theme||"blue-tech",onChange:o[29]||(o[29]=c=>Ge(c.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]"},[...o[74]||(o[74]=[We('<option value="blue-tech">🔵 Blue Tech (AI & Software)</option><option value="emerald-finance">🟢 Emerald Finance (Salaries & Living)</option><option value="slate-education">🟣 Slate Education (Education & 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 & Executive)</option><option value="cyber-violet">🟪 Cyber Violet (Synthwave & 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,Zs)]),r("div",Ls,[r("div",zs,[o[76]||(o[76]=r("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"}," Watermark Handle ",-1)),r("input",{type:"text",value:a.modelValue.watermark||"@SocialGen",onInput:o[30]||(o[30]=c=>nt(c.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,Fs)]),r("div",Bs,[o[77]||(o[77]=r("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"}," Judul Konten (Title) ",-1)),r("input",{type:"text",value:a.modelValue.title,onInput:o[31]||(o[31]=c=>rt(c.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,Us)])])]),r("div",Hs,[r("div",Gs,[o[80]||(o[80]=r("span",{class:"font-bold text-slate-300 text-[10px]"},"RAW JSON SocialGen",-1)),a.isValid&&!l(i)?(_(),M("span",Js,[I(l(ra),{class:"w-2.5 h-2.5"}),o[78]||(o[78]=J(" Valid ",-1))])):(_(),M("span",qs,[I(l(na),{class:"w-2.5 h-2.5"}),o[79]||(o[79]=J(" Invalid ",-1))]))]),r("button",{onClick:st,class:"text-[10px] text-slate-400 hover:text-sky-400 transition"}," Format JSON ")]),r("div",Ws,[r("textarea",{value:l(n),onInput:Ue,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..."},null,40,Ks),l(i)||a.validationError?(_(),M("p",Ys," ⚠️ "+T(l(i)||a.validationError),1)):U("",!0)])])),r("input",{type:"file",ref_key:"videoInputRef",ref:P,accept:"video/mp4,video/webm",class:"hidden",onChange:o[32]||(o[32]=c=>Be(c))},null,544),r("input",{type:"file",ref_key:"audioInputRef",ref:ze,accept:"audio/mp3,audio/mpeg,audio/wav",class:"hidden",onChange:o[33]||(o[33]=c=>Be(c))},null,544),r("div",Xs,[r("div",Qs,[r("div",en,[r("label",tn,[I(l(Gt),{class:"w-3.5 h-3.5 text-sky-400"}),o[81]||(o[81]=r("span",null,"Background",-1))]),r("div",an,[r("select",{value:a.options.backgroundSource||"random",onChange:o[34]||(o[34]=c=>fe("backgroundSource",c.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]"},[o[82]||(o[82]=r("option",{value:"random"},"🔀 Acak Video",-1)),(_(!0),M(Te,null,Oe(l(ce),c=>(_(),M("option",{key:c,value:c},T(c.replace(".mp4","").replace(/_/g," ")),9,nn))),128)),o[83]||(o[83]=r("option",{value:"pexels"},"🌐 Pexels API (Auto HD)",-1))],40,sn),r("button",{onClick:o[35]||(o[35]=c=>l(P)?.click()),disabled:l(ie),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"},[I(l(Ct),{class:"w-3 h-3"}),r("span",on,T(l(ie)?"...":"Upload"),1)],8,rn)])]),r("div",ln,[r("span",dn,[I(l(ut),{class:"w-2.5 h-2.5"}),J(" Mulai: "+T(Math.min(a.options.videoStartOffset||0,l(C)))+"s / "+T(l(Ce))+"s ",1)]),r("input",{type:"range",min:"0",max:l(C),step:"1",value:Math.min(a.options.videoStartOffset||0,l(C)),onInput:o[36]||(o[36]=c=>fe("videoStartOffset",Number(c.target.value))),class:"w-32 h-1 bg-slate-950 rounded appearance-none cursor-pointer accent-sky-400"},null,40,un)])]),r("div",cn,[r("div",fn,[r("label",pn,[I(l(Jt),{class:"w-3.5 h-3.5 text-purple-400"}),o[84]||(o[84]=r("span",null,"Musik Reels",-1))]),r("div",hn,[r("select",{value:a.options.musicFile||"random",onChange:o[37]||(o[37]=c=>fe("musicFile",c.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]"},[o[85]||(o[85]=r("option",{value:"random"},"🔀 Acak Musik",-1)),(_(!0),M(Te,null,Oe(l(X),c=>(_(),M("option",{key:c,value:c},T(c.replace(".mp3","").replace(/_/g," ")),9,vn))),128))],40,mn),r("button",{onClick:o[38]||(o[38]=c=>l(ze)?.click()),disabled:l(ie),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"},[I(l(Ct),{class:"w-3 h-3"}),r("span",xn,T(l(ie)?"...":"Upload"),1)],8,gn)])]),r("div",yn,[r("span",bn,[I(l(ut),{class:"w-2.5 h-2.5"}),J(" Mulai: "+T(Math.min(a.options.audioStartOffset||0,l(ee)))+"s / "+T(l(y))+"s ",1)]),r("input",{type:"range",min:"0",max:l(ee),step:"1",value:Math.min(a.options.audioStartOffset||0,l(ee)),onInput:o[39]||(o[39]=c=>fe("audioStartOffset",Number(c.target.value))),class:"w-32 h-1 bg-slate-950 rounded appearance-none cursor-pointer accent-purple-400"},null,40,kn)])]),r("div",_n,[r("label",wn,[I(l(_t),{class:"w-3.5 h-3.5 text-emerald-400"}),o[86]||(o[86]=r("span",null,"Durasi Reels:",-1))]),r("div",Sn,[(_(),M(Te,null,Oe([7,10,15,30,60],c=>r("button",{key:c,onClick:se=>it(c),class:F(["px-2 py-0.5 text-[10px] font-bold rounded-lg border transition",(a.modelValue.reelsDuration||30)===c?"bg-emerald-500/20 border-emerald-500/60 text-emerald-300":"bg-slate-950 border-slate-800 text-slate-400 hover:text-white"])},T(c===60?"1m":c+"s"),11,Cn)),64))])]),r("div",Tn,[r("label",{class:F(["flex items-center gap-1.5 p-1.5 rounded-xl border text-[11px] cursor-pointer transition select-none",a.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"])},[r("input",{type:"checkbox",checked:a.options.outputs?.feed!==!1,onChange:o[40]||(o[40]=c=>S("feed",c.target.checked)),class:"rounded text-sky-500 focus:ring-0 bg-slate-900 border-slate-700 w-3 h-3"},null,40,On),o[87]||(o[87]=r("span",{class:"font-bold"},"Feed 4:5",-1))],2),r("label",{class:F(["flex items-center gap-1.5 p-1.5 rounded-xl border text-[11px] cursor-pointer transition select-none",a.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"])},[r("input",{type:"checkbox",checked:a.options.outputs?.story!==!1,onChange:o[41]||(o[41]=c=>S("story",c.target.checked)),class:"rounded text-indigo-500 focus:ring-0 bg-slate-900 border-slate-700 w-3 h-3"},null,40,Mn),o[88]||(o[88]=r("span",{class:"font-bold"},"Story 9:16",-1))],2),r("label",{class:F(["flex items-center gap-1.5 p-1.5 rounded-xl border text-[11px] cursor-pointer transition select-none",a.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"])},[r("input",{type:"checkbox",checked:a.options.outputs?.reels!==!1,onChange:o[42]||(o[42]=c=>S("reels",c.target.checked)),class:"rounded text-emerald-500 focus:ring-0 bg-slate-900 border-slate-700 w-3 h-3"},null,40,Nn),o[89]||(o[89]=r("span",{class:"font-bold"},"Reels MP4",-1))],2)])]),r("button",{onClick:o[43]||(o[43]=c=>s("generate")),disabled:!a.isValid||a.isGenerating||!!l(i),class:F(["w-full py-3 px-4 rounded-xl font-black text-xs tracking-wide shadow-xl transition flex items-center justify-center gap-2",[!a.isValid||a.isGenerating||l(i)?"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]"]])},[a.isGenerating?(_(),pe(l(pa),{key:0,class:"w-3.5 h-3.5 animate-spin"})):(_(),pe(l(qt),{key:1,class:"w-3.5 h-3.5 fill-current"})),r("span",null,T(a.isGenerating?a.generateStage||"Rendering Content...":"GENERATE CONTENT"),1)],10,$n)]))}}),In={class:"flex flex-col gap-2.5 h-full text-slate-100 min-h-0 justify-between"},Rn={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"},jn={class:"flex items-center gap-1 bg-slate-950 p-1 rounded-xl border border-slate-800 text-xs font-bold"},Vn={key:0,class:"w-1.5 h-1.5 rounded-full bg-white animate-pulse"},En={class:"flex items-center gap-2 text-xs"},Dn={class:"flex items-center gap-1 bg-slate-950 p-1 rounded-xl border border-slate-800 text-xs shadow-inner"},Pn={key:0,class:"relative shadow-2xl rounded-2xl overflow-hidden border border-slate-700/80 flex-shrink-0",style:{width:"360px",height:"450px"}},Zn={style:{width:"1080px",height:"1350px",transform:"scale(0.333333)","transform-origin":"top left"}},Ln={key:1,class:"relative shadow-2xl rounded-2xl overflow-hidden border border-slate-700/80 flex-shrink-0",style:{width:"300px",height:"533.33px"}},zn={key:0,class:"absolute inset-0 z-0 bg-slate-950 overflow-hidden"},Fn=["src"],Bn=["src","muted"],Un={class:"relative z-10 pointer-events-none",style:{width:"1080px",height:"1920px",transform:"scale(0.277778)","transform-origin":"top left"}},Hn={key:1,class:"absolute inset-0 z-20 pointer-events-none flex flex-col justify-between"},Gn={class:"flex-1 flex justify-end p-2"},Jn={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"},qn={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"},Wn={class:"flex items-center justify-between gap-3"},Kn=["title"],Yn={class:"text-[11px] hidden sm:inline"},Xn={class:"flex-1 flex items-center gap-2"},Qn=["max","value"],er={class:"font-mono text-[11px] font-bold text-slate-300 min-w-[75px] text-right"},tr=["title"],ar={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"},sr={class:"flex flex-col gap-1.5"},nr={class:"flex items-center justify-between text-[11px]"},rr={class:"font-bold text-sky-300 flex items-center gap-1"},ir=["max","value"],or={class:"text-[9px] text-slate-500"},lr={class:"flex flex-col gap-1.5"},dr={class:"flex items-center justify-between text-[11px]"},ur={class:"font-bold text-purple-300 flex items-center gap-1"},cr=["max","value"],fr={class:"text-[9px] text-slate-500"},pr={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"},hr={class:"flex items-center justify-between text-xs"},mr=["value"],vr={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"},gr={class:"flex items-center gap-2 text-xs font-black text-emerald-300"},xr={class:"text-[11px] text-slate-400 font-mono mt-0.5"},yr={class:"flex items-center gap-2"},br=["href"],kr=["disabled"],_r=vt({__name:"LivePreview",props:{data:{},selectedVideo:{},selectedMusic:{},videoStartOffset:{default:0},audioStartOffset:{default:0},generatedResult:{}},emits:["update:videoStartOffset","update:audioStartOffset"],setup(a,{emit:e}){const t=a,s=e,n={"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},i=he(()=>t.selectedVideo&&t.selectedVideo!=="pexels"&&t.selectedVideo!=="random"?`/api/stream/videos/${t.selectedVideo}`:"/api/stream/videos/default_bg.mp4"),u=he(()=>t.selectedMusic&&t.selectedMusic!=="random"?`/api/stream/audio/${t.selectedMusic}`:"/api/stream/audio/lofi_viral_study.mp3"),d=O("feed"),g=O(!1),h=O(!1),w=O(!1),K=O(!1),Z=O(1),A=O(null),j=O(null),H=O(!0),W=O(!1),ne=O(0),ue=he(()=>t.data.reelsDuration||30),L=O(n[t.selectedVideo||""]||8),G=O(n[t.selectedMusic||""]||30),B=he(()=>Math.max(1,Math.floor(L.value-1))),Y=he(()=>Math.max(1,Math.floor(G.value-1)));function ae(){Z.value<2.5&&(Z.value=Math.min(2.5,+(Z.value+.15).toFixed(2)))}function le(){Z.value>.5&&(Z.value=Math.max(.5,+(Z.value-.15).toFixed(2)))}function ce(){Z.value=1}function X(S){(S.ctrlKey||S.metaKey)&&(S.preventDefault(),S.deltaY<0?ae():le())}function ye(){H.value?C():Ce()}function Ce(){H.value=!0,A.value&&A.value.play().catch(()=>{}),j.value&&(j.value.muted=W.value,j.value.volume=.85,j.value.play().catch(()=>{}))}function C(){H.value=!1,A.value&&A.value.pause(),j.value&&j.value.pause()}function y(){if(W.value=!W.value,j.value)if(j.value.muted=W.value,j.value.volume=.85,!W.value&&H.value){const S=t.audioStartOffset||0;j.value.currentTime=S+ne.value%Math.max(1,G.value-S),j.value.play().catch(()=>{})}else j.value.pause()}function ee(S){const p=S.target;p&&p.duration&&!isNaN(p.duration)&&isFinite(p.duration)&&(L.value=Math.max(1,Math.floor(p.duration)),t.videoStartOffset&&t.videoStartOffset>=L.value&&s("update:videoStartOffset",Math.max(0,L.value-2))),A.value&&(A.value.currentTime=Math.min(t.videoStartOffset||0,B.value),H.value&&A.value.play().catch(()=>{}))}function ie(S){const p=S.target;p&&p.duration&&!isNaN(p.duration)&&isFinite(p.duration)&&(G.value=Math.max(1,Math.floor(p.duration)),t.audioStartOffset&&t.audioStartOffset>=G.value&&s("update:audioStartOffset",Math.max(0,G.value-2))),j.value&&(j.value.muted=W.value,j.value.volume=.85,j.value.currentTime=Math.min(t.audioStartOffset||0,Y.value),H.value&&!W.value&&j.value.play().catch(()=>{}))}function P(){if(!A.value)return;const S=Math.min(t.videoStartOffset||0,B.value);A.value.currentTime=S,H.value&&A.value.play().catch(()=>{})}function ze(){if(!j.value)return;const S=Math.min(t.audioStartOffset||0,Y.value);j.value.currentTime=S,H.value&&!W.value&&j.value.play().catch(()=>{})}function Fe(){if(!A.value)return;const S=Math.min(t.videoStartOffset||0,B.value),p=L.value;A.value.currentTime>=p-.25&&(A.value.currentTime=S,H.value&&A.value.play().catch(()=>{})),ne.value=Math.min(ne.value+.1,ue.value),ne.value>=ue.value&&(ne.value=0)}function Be(){if(!j.value)return;const S=Math.min(t.audioStartOffset||0,Y.value),p=G.value;j.value.currentTime>=p-.25&&(j.value.currentTime=S,H.value&&!W.value&&j.value.play().catch(()=>{}))}function Ue(S){ne.value=S;const p=Math.min(t.videoStartOffset||0,B.value),ve=Math.min(t.audioStartOffset||0,Y.value);if(A.value){const te=p+S%Math.max(1,L.value-p);A.value.currentTime=Math.min(te,L.value-.1)}if(j.value){const te=ve+S%Math.max(1,G.value-ve);j.value.currentTime=Math.min(te,G.value-.1)}}function st(S){const p=Number(S.target.value);Ue(p)}de(()=>t.videoStartOffset,S=>{const p=Math.min(S||0,B.value);A.value&&(A.value.currentTime=p)}),de(()=>t.audioStartOffset,S=>{const p=Math.min(S||0,Y.value);j.value&&(j.value.currentTime=p)});function He(S){const p=Math.min(S,B.value);s("update:videoStartOffset",p),A.value&&(A.value.currentTime=p)}function nt(S){const p=Math.min(S,Y.value);s("update:audioStartOffset",p),j.value&&(j.value.currentTime=p)}function rt(){if(A.value){const S=Math.min(Math.floor(A.value.currentTime),B.value);He(S)}}function Ge(S){const p=Math.floor(S/60),ve=Math.floor(S%60);return`${p.toString().padStart(2,"0")}:${ve.toString().padStart(2,"0")}`}function it(){t.data.caption&&(navigator.clipboard.writeText(t.data.caption),w.value=!0,setTimeout(()=>{w.value=!1},2e3))}async function fe(){if(t.generatedResult){K.value=!0;try{await $fetch("/api/open-folder",{method:"POST",body:{jobId:t.generatedResult.jobId,resultDir:t.generatedResult.resultDir}})}catch(S){console.error("Failed to open folder:",S)}finally{K.value=!1}}}return de(()=>i.value,()=>{const S=t.selectedVideo||"";n[S]&&(L.value=n[S]),bt(()=>{Ue(0)})}),de(()=>u.value,()=>{const S=t.selectedMusic||"";n[S]&&(G.value=n[S])}),de(()=>d.value,S=>{S==="reels"?bt(()=>{H.value&&Ce()}):j.value&&j.value.pause()}),(S,p)=>{const ve=ta;return _(),M("div",In,[r("div",Rn,[r("div",jn,[r("button",{onClick:p[0]||(p[0]=te=>d.value="feed"),class:F(["px-3 py-1.5 rounded-lg transition",l(d)==="feed"?"bg-sky-500 text-white shadow-md":"text-slate-400 hover:text-white"])}," Feed 4:5 ",2),r("button",{onClick:p[1]||(p[1]=te=>d.value="story"),class:F(["px-3 py-1.5 rounded-lg transition",l(d)==="story"?"bg-indigo-500 text-white shadow-md":"text-slate-400 hover:text-white"])}," Story 9:16 ",2),r("button",{onClick:p[2]||(p[2]=te=>d.value="reels"),class:F(["px-3 py-1.5 rounded-lg transition flex items-center gap-1.5",l(d)==="reels"?"bg-emerald-500 text-white shadow-md":"text-slate-400 hover:text-white"])},[p[8]||(p[8]=r("span",null,"Reels 9:16 (Video)",-1)),l(d)==="reels"&&l(H)?(_(),M("span",Vn)):U("",!0)],2)]),r("div",En,[r("div",Dn,[r("button",{onClick:le,title:"Zoom Out (-15%)",class:"p-1.5 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800 transition"},[I(l(ka),{class:"w-3.5 h-3.5"})]),r("button",{onClick:ce,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"},T(Math.round(l(Z)*100))+"% ",1),r("button",{onClick:ae,title:"Zoom In (+15%)",class:"p-1.5 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800 transition"},[I(l(ba),{class:"w-3.5 h-3.5"})]),l(Z)!==1?(_(),M("button",{key:0,onClick:ce,title:"Reset ke Ukuran Pas",class:"p-1.5 rounded-lg text-amber-400 hover:bg-slate-800 transition"},[I(l(ha),{class:"w-3.5 h-3.5"})])):U("",!0)]),l(d)!=="feed"?(_(),M("button",{key:0,onClick:p[3]||(p[3]=te=>g.value=!l(g)),class:F(["inline-flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border text-xs font-bold transition",l(g)?"bg-amber-500/20 text-amber-300 border-amber-500/50":"bg-slate-950 text-slate-400 border-slate-800"])},[I(l(va),{class:"w-3.5 h-3.5"}),p[9]||(p[9]=r("span",{class:"hidden sm:inline"},"Safe Zones",-1))],2)):U("",!0)])]),r("div",{onWheel:X,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"},[r("div",{class:"transition-transform duration-200 ease-out origin-center flex-shrink-0",style:ea({transform:`scale(${l(Z)})`})},[l(d)==="feed"?(_(),M("div",Pn,[r("div",Zn,[I(ve,{data:a.data,mode:"feed","is-render":!0},null,8,["data"])])])):(_(),M("div",Ln,[l(d)==="reels"?(_(),M("div",zn,[(_(),M("video",{ref_key:"videoElement",ref:A,key:l(i),autoplay:"",muted:"",playsinline:"",class:"w-full h-full object-cover brightness-90 contrast-105",src:l(i),onLoadedmetadata:ee,onTimeupdate:Fe,onEnded:P},null,40,Fn)),p[10]||(p[10]=r("div",{class:"absolute inset-0 bg-slate-950/30 backdrop-blur-[0.5px]"},null,-1)),(_(),M("audio",{ref_key:"audioElement",ref:j,key:l(u),src:l(u),muted:l(W),onLoadedmetadata:ie,onTimeupdate:Be,onEnded:ze},null,40,Bn))])):U("",!0),r("div",Un,[I(ve,{data:a.data,mode:l(d)==="reels"?"overlay":"story","is-render":!0},null,8,["data","mode"])]),l(g)?(_(),M("div",Hn,[p[12]||(p[12]=r("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)),r("div",Gn,[l(d)==="reels"?(_(),M("div",Jn,[...p[11]||(p[11]=[r("span",null,"❤️ Like",-1),r("span",null,"💬 Comm",-1),r("span",null,"↗️ Share",-1)])])):U("",!0)]),p[13]||(p[13]=r("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))])):U("",!0)]))],4)],32),l(d)==="reels"?(_(),M("div",qn,[r("div",Wn,[r("button",{onClick:ye,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(H)?"Pause Preview":"Putar Preview"},[l(H)?(_(),pe(l(ua),{key:0,class:"w-3.5 h-3.5 fill-current"})):(_(),pe(l(qt),{key:1,class:"w-3.5 h-3.5 fill-current"})),r("span",Yn,T(l(H)?"Pause":"Play"),1)],8,Kn),r("div",Xn,[r("input",{type:"range",min:"0",max:l(ue),step:"0.1",value:l(ne),onInput:st,class:"flex-1 h-1.5 bg-slate-950 rounded-lg appearance-none cursor-pointer accent-emerald-500 hover:accent-emerald-400"},null,40,Qn),r("span",er,T(Ge(l(ne)))+" / "+T(Ge(l(ue))),1)]),r("button",{onClick:y,class:F(["px-2.5 py-2 rounded-xl border transition flex items-center gap-1.5 font-bold text-[11px]",l(W)?"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(W)?"Aktifkan Suara Musik (Unmute)":"Matikan Suara Musik (Mute)"},[l(W)?(_(),pe(l(xa),{key:1,class:"w-3.5 h-3.5"})):(_(),pe(l(ga),{key:0,class:"w-3.5 h-3.5 text-purple-300 animate-pulse"})),r("span",null,T(l(W)?"Muted":"Audio ON"),1)],10,tr),r("button",{onClick:p[4]||(p[4]=te=>h.value=!l(h)),class:F(["px-2.5 py-2 rounded-xl border text-[11px] font-bold flex items-center gap-1.5 transition",l(h)?"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"},[I(l(ut),{class:"w-3.5 h-3.5 text-sky-400"}),p[14]||(p[14]=r("span",{class:"hidden sm:inline"},"Trim Offset",-1))],2)]),l(h)?(_(),M("div",ar,[r("div",sr,[r("div",nr,[r("span",rr,[I(l(Gt),{class:"w-3 h-3"}),J(" Mulai Video: "+T(Math.min(a.videoStartOffset||0,l(B)))+"s / "+T(l(L))+"s ",1)]),r("button",{onClick:rt,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 ")]),r("input",{type:"range",min:"0",max:l(B),step:"1",value:Math.min(a.videoStartOffset||0,l(B)),onInput:p[5]||(p[5]=te=>He(Number(te.target.value))),class:"w-full h-1 bg-slate-900 rounded appearance-none cursor-pointer accent-sky-400"},null,40,ir),r("div",or," Maksimal offset: "+T(l(B))+" detik (panjang asli video: "+T(l(L))+"s) ",1)]),r("div",lr,[r("div",dr,[r("span",ur,[I(l(Jt),{class:"w-3 h-3"}),J(" Mulai Musik: "+T(Math.min(a.audioStartOffset||0,l(Y)))+"s / "+T(l(G))+"s ",1)]),p[15]||(p[15]=r("span",{class:"text-[10px] text-slate-500 font-mono"}," (Skip intro) ",-1))]),r("input",{type:"range",min:"0",max:l(Y),step:"1",value:Math.min(a.audioStartOffset||0,l(Y)),onInput:p[6]||(p[6]=te=>nt(Number(te.target.value))),class:"w-full h-1 bg-slate-900 rounded appearance-none cursor-pointer accent-purple-400"},null,40,cr),r("div",fr," Maksimal offset: "+T(l(Y))+" detik (panjang asli musik: "+T(l(G))+"s) ",1)])])):U("",!0)])):U("",!0),r("div",pr,[r("div",hr,[p[16]||(p[16]=r("span",{class:"font-extrabold text-slate-300 text-[11px]"},"VIRAL CAPTION & HASHTAGS",-1)),r("button",{onClick:it,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(w)?(_(),pe(l(Ye),{key:0,class:"w-3.5 h-3.5 text-emerald-400"})):(_(),pe(l(Ht),{key:1,class:"w-3.5 h-3.5"})),r("span",null,T(l(w)?"Tersalin!":"Copy Caption"),1)])]),r("textarea",{value:a.data.caption,onInput:p[7]||(p[7]=te=>a.data.caption=te.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,mr)]),a.generatedResult?(_(),M("div",vr,[r("div",null,[r("div",gr,[I(l(Ye),{class:"w-4 h-4 text-emerald-400"}),J(" Render Selesai ("+T((a.generatedResult.durationMs/1e3).toFixed(1))+"s) ",1)]),r("div",xr,T(a.generatedResult.jobId),1)]),r("div",yr,[r("a",{href:`/api/download?jobId=${a.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"},[I(l(ia),{class:"w-3.5 h-3.5"}),p[17]||(p[17]=r("span",null,"Download ZIP",-1))],8,br),r("button",{onClick:fe,disabled:l(K),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"},[I(l(oa),{class:"w-3.5 h-3.5 text-amber-400"}),p[18]||(p[18]=r("span",null,"Open Folder",-1))],8,kr)])])):U("",!0)])}}});var E;(function(a){a.assertEqual=n=>{};function e(n){}a.assertIs=e;function t(n){throw new Error}a.assertNever=t,a.arrayToEnum=n=>{const i={};for(const u of n)i[u]=u;return i},a.getValidEnumValues=n=>{const i=a.objectKeys(n).filter(d=>typeof n[n[d]]!="number"),u={};for(const d of i)u[d]=n[d];return a.objectValues(u)},a.objectValues=n=>a.objectKeys(n).map(function(i){return n[i]}),a.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const i=[];for(const u in n)Object.prototype.hasOwnProperty.call(n,u)&&i.push(u);return i},a.find=(n,i)=>{for(const u of n)if(i(u))return u},a.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function s(n,i=" | "){return n.map(u=>typeof u=="string"?`'${u}'`:u).join(i)}a.joinValues=s,a.jsonStringifyReplacer=(n,i)=>typeof i=="bigint"?i.toString():i})(E||(E={}));var Ot;(function(a){a.mergeShapes=(e,t)=>({...e,...t})})(Ot||(Ot={}));const b=E.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),be=a=>{switch(typeof a){case"undefined":return b.undefined;case"string":return b.string;case"number":return Number.isNaN(a)?b.nan:b.number;case"boolean":return b.boolean;case"function":return b.function;case"bigint":return b.bigint;case"symbol":return b.symbol;case"object":return Array.isArray(a)?b.array:a===null?b.null:a.then&&typeof a.then=="function"&&a.catch&&typeof a.catch=="function"?b.promise:typeof Map<"u"&&a instanceof Map?b.map:typeof Set<"u"&&a instanceof Set?b.set:typeof Date<"u"&&a instanceof Date?b.date:b.object;default:return b.unknown}},f=E.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 xe extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};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(i){return i.message},s={_errors:[]},n=i=>{for(const u of i.issues)if(u.code==="invalid_union")u.unionErrors.map(n);else if(u.code==="invalid_return_type")n(u.returnTypeError);else if(u.code==="invalid_arguments")n(u.argumentsError);else if(u.path.length===0)s._errors.push(t(u));else{let d=s,g=0;for(;g<u.path.length;){const h=u.path[g];g===u.path.length-1?(d[h]=d[h]||{_errors:[]},d[h]._errors.push(t(u))):d[h]=d[h]||{_errors:[]},d=d[h],g++}}};return n(this),s}static assert(e){if(!(e instanceof xe))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,E.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},s=[];for(const n of this.issues)if(n.path.length>0){const i=n.path[0];t[i]=t[i]||[],t[i].push(e(n))}else s.push(e(n));return{formErrors:s,fieldErrors:t}}get formErrors(){return this.flatten()}}xe.create=a=>new xe(a);const ct=(a,e)=>{let t;switch(a.code){case f.invalid_type:a.received===b.undefined?t="Required":t=`Expected ${a.expected}, received ${a.received}`;break;case f.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(a.expected,E.jsonStringifyReplacer)}`;break;case f.unrecognized_keys:t=`Unrecognized key(s) in object: ${E.joinValues(a.keys,", ")}`;break;case f.invalid_union:t="Invalid input";break;case f.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${E.joinValues(a.options)}`;break;case f.invalid_enum_value:t=`Invalid enum value. Expected ${E.joinValues(a.options)}, received '${a.received}'`;break;case f.invalid_arguments:t="Invalid function arguments";break;case f.invalid_return_type:t="Invalid function return type";break;case f.invalid_date:t="Invalid date";break;case f.invalid_string:typeof a.validation=="object"?"includes"in a.validation?(t=`Invalid input: must include "${a.validation.includes}"`,typeof a.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${a.validation.position}`)):"startsWith"in a.validation?t=`Invalid input: must start with "${a.validation.startsWith}"`:"endsWith"in a.validation?t=`Invalid input: must end with "${a.validation.endsWith}"`:E.assertNever(a.validation):a.validation!=="regex"?t=`Invalid ${a.validation}`:t="Invalid";break;case f.too_small:a.type==="array"?t=`Array must contain ${a.exact?"exactly":a.inclusive?"at least":"more than"} ${a.minimum} element(s)`:a.type==="string"?t=`String must contain ${a.exact?"exactly":a.inclusive?"at least":"over"} ${a.minimum} character(s)`:a.type==="number"?t=`Number must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${a.minimum}`:a.type==="bigint"?t=`Number must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${a.minimum}`:a.type==="date"?t=`Date must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(a.minimum))}`:t="Invalid input";break;case f.too_big:a.type==="array"?t=`Array must contain ${a.exact?"exactly":a.inclusive?"at most":"less than"} ${a.maximum} element(s)`:a.type==="string"?t=`String must contain ${a.exact?"exactly":a.inclusive?"at most":"under"} ${a.maximum} character(s)`:a.type==="number"?t=`Number must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:a.type==="bigint"?t=`BigInt must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:a.type==="date"?t=`Date must be ${a.exact?"exactly":a.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(a.maximum))}`:t="Invalid input";break;case f.custom:t="Invalid input";break;case f.invalid_intersection_types:t="Intersection results could not be merged";break;case f.not_multiple_of:t=`Number must be a multiple of ${a.multipleOf}`;break;case f.not_finite:t="Number must be finite";break;default:t=e.defaultError,E.assertNever(a)}return{message:t}};let wr=ct;function Sr(){return wr}const Cr=a=>{const{data:e,path:t,errorMaps:s,issueData:n}=a,i=[...t,...n.path||[]],u={...n,path:i};if(n.message!==void 0)return{...n,path:i,message:n.message};let d="";const g=s.filter(h=>!!h).slice().reverse();for(const h of g)d=h(u,{data:e,defaultError:d}).message;return{...n,path:i,message:d}};function x(a,e){const t=Sr(),s=Cr({issueData:e,data:a.data,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,t,t===ct?void 0:ct].filter(n=>!!n)});a.common.issues.push(s)}class re{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const s=[];for(const n of t){if(n.status==="aborted")return N;n.status==="dirty"&&e.dirty(),s.push(n.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,t){const s=[];for(const n of t){const i=await n.key,u=await n.value;s.push({key:i,value:u})}return re.mergeObjectSync(e,s)}static mergeObjectSync(e,t){const s={};for(const n of t){const{key:i,value:u}=n;if(i.status==="aborted"||u.status==="aborted")return N;i.status==="dirty"&&e.dirty(),u.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof u.value<"u"||n.alwaysSet)&&(s[i.value]=u.value)}return{status:e.value,value:s}}}const N=Object.freeze({status:"aborted"}),De=a=>({status:"dirty",value:a}),oe=a=>({status:"valid",value:a}),Mt=a=>a.status==="aborted",Nt=a=>a.status==="dirty",Ae=a=>a.status==="valid",Xe=a=>typeof Promise<"u"&&a instanceof Promise;var k;(function(a){a.errToObj=e=>typeof e=="string"?{message:e}:e||{},a.toString=e=>typeof e=="string"?e:e?.message})(k||(k={}));class we{constructor(e,t,s,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=n}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 $t=(a,e)=>{if(Ae(e))return{success:!0,data:e.value};if(!a.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 xe(a.common.issues);return this._error=t,this._error}}};function R(a){if(!a)return{};const{errorMap:e,invalid_type_error:t,required_error:s,description:n}=a;if(e&&(t||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(u,d)=>{const{message:g}=a;return u.code==="invalid_enum_value"?{message:g??d.defaultError}:typeof d.data>"u"?{message:g??s??d.defaultError}:u.code!=="invalid_type"?{message:d.defaultError}:{message:g??t??d.defaultError}},description:n}}class V{get description(){return this._def.description}_getType(e){return be(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:be(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new re,ctx:{common:e.parent.common,data:e.data,parsedType:be(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Xe(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 s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){const s={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:be(e)},n=this._parseSync({data:e,path:s.path,parent:s});return $t(s,n)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:be(e)};if(!this["~standard"].async)try{const s=this._parseSync({data:e,path:[],parent:t});return Ae(s)?{value:s.value}:{issues:t.common.issues}}catch(s){s?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(s=>Ae(s)?{value:s.value}:{issues:t.common.issues})}async parseAsync(e,t){const s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){const s={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:be(e)},n=this._parse({data:e,path:s.path,parent:s}),i=await(Xe(n)?n:Promise.resolve(n));return $t(s,i)}refine(e,t){const s=n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t;return this._refinement((n,i)=>{const u=e(n),d=()=>i.addIssue({code:f.custom,...s(n)});return typeof Promise<"u"&&u instanceof Promise?u.then(g=>g?!0:(d(),!1)):u?!0:(d(),!1)})}refinement(e,t){return this._refinement((s,n)=>e(s)?!0:(n.addIssue(typeof t=="function"?t(s,n):t),!1))}_refinement(e){return new je({schema:this,typeName:$.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 _e.create(this,this._def)}nullable(){return Ve.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return me.create(this)}promise(){return at.create(this,this._def)}or(e){return et.create([this,e],this._def)}and(e){return tt.create(this,e,this._def)}transform(e){return new je({...R(this._def),schema:this,typeName:$.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new pt({...R(this._def),innerType:this,defaultValue:t,typeName:$.ZodDefault})}brand(){return new qr({typeName:$.ZodBranded,type:this,...R(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new ht({...R(this._def),innerType:this,catchValue:t,typeName:$.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return gt.create(this,e)}readonly(){return mt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Tr=/^c[^\s-]{8,}$/i,Or=/^[0-9a-z]+$/,Mr=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Nr=/^[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,$r=/^[a-z0-9_-]{21}$/i,Ar=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Ir=/^[-+]?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)?)??$/,Rr=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,jr="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let lt;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])$/,Er=/^(?:(?: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])$/,Dr=/^(([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]))$/,Pr=/^(([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])$/,Zr=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Lr=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Wt="((\\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])))",zr=new RegExp(`^${Wt}$`);function Kt(a){let e="[0-5]\\d";a.precision?e=`${e}\\.\\d{${a.precision}}`:a.precision==null&&(e=`${e}(\\.\\d+)?`);const t=a.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function Fr(a){return new RegExp(`^${Kt(a)}$`)}function Br(a){let e=`${Wt}T${Kt(a)}`;const t=[];return t.push(a.local?"Z?":"Z"),a.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function Ur(a,e){return!!((e==="v4"||!e)&&Vr.test(a)||(e==="v6"||!e)&&Dr.test(a))}function Hr(a,e){if(!Ar.test(a))return!1;try{const[t]=a.split(".");if(!t)return!1;const s=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),n=JSON.parse(atob(s));return!(typeof n!="object"||n===null||"typ"in n&&n?.typ!=="JWT"||!n.alg||e&&n.alg!==e)}catch{return!1}}function Gr(a,e){return!!((e==="v4"||!e)&&Er.test(a)||(e==="v6"||!e)&&Pr.test(a))}class ke extends V{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==b.string){const i=this._getOrReturnCtx(e);return x(i,{code:f.invalid_type,expected:b.string,received:i.parsedType}),N}const s=new re;let n;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(n=this._getOrReturnCtx(e,n),x(n,{code:f.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),s.dirty());else if(i.kind==="max")e.data.length>i.value&&(n=this._getOrReturnCtx(e,n),x(n,{code:f.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),s.dirty());else if(i.kind==="length"){const u=e.data.length>i.value,d=e.data.length<i.value;(u||d)&&(n=this._getOrReturnCtx(e,n),u?x(n,{code:f.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):d&&x(n,{code:f.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),s.dirty())}else if(i.kind==="email")Rr.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"email",code:f.invalid_string,message:i.message}),s.dirty());else if(i.kind==="emoji")lt||(lt=new RegExp(jr,"u")),lt.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"emoji",code:f.invalid_string,message:i.message}),s.dirty());else if(i.kind==="uuid")Nr.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"uuid",code:f.invalid_string,message:i.message}),s.dirty());else if(i.kind==="nanoid")$r.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"nanoid",code:f.invalid_string,message:i.message}),s.dirty());else if(i.kind==="cuid")Tr.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"cuid",code:f.invalid_string,message:i.message}),s.dirty());else if(i.kind==="cuid2")Or.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"cuid2",code:f.invalid_string,message:i.message}),s.dirty());else if(i.kind==="ulid")Mr.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"ulid",code:f.invalid_string,message:i.message}),s.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),x(n,{validation:"url",code:f.invalid_string,message:i.message}),s.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"regex",code:f.invalid_string,message:i.message}),s.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(n=this._getOrReturnCtx(e,n),x(n,{code:f.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),s.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(n=this._getOrReturnCtx(e,n),x(n,{code:f.invalid_string,validation:{startsWith:i.value},message:i.message}),s.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(n=this._getOrReturnCtx(e,n),x(n,{code:f.invalid_string,validation:{endsWith:i.value},message:i.message}),s.dirty()):i.kind==="datetime"?Br(i).test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{code:f.invalid_string,validation:"datetime",message:i.message}),s.dirty()):i.kind==="date"?zr.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{code:f.invalid_string,validation:"date",message:i.message}),s.dirty()):i.kind==="time"?Fr(i).test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{code:f.invalid_string,validation:"time",message:i.message}),s.dirty()):i.kind==="duration"?Ir.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"duration",code:f.invalid_string,message:i.message}),s.dirty()):i.kind==="ip"?Ur(e.data,i.version)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"ip",code:f.invalid_string,message:i.message}),s.dirty()):i.kind==="jwt"?Hr(e.data,i.alg)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"jwt",code:f.invalid_string,message:i.message}),s.dirty()):i.kind==="cidr"?Gr(e.data,i.version)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"cidr",code:f.invalid_string,message:i.message}),s.dirty()):i.kind==="base64"?Zr.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"base64",code:f.invalid_string,message:i.message}),s.dirty()):i.kind==="base64url"?Lr.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"base64url",code:f.invalid_string,message:i.message}),s.dirty()):E.assertNever(i);return{status:s.value,value:e.data}}_regex(e,t,s){return this.refinement(n=>e.test(n),{validation:t,code:f.invalid_string,...k.errToObj(s)})}_addCheck(e){return new ke({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...k.errToObj(e)})}url(e){return this._addCheck({kind:"url",...k.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...k.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...k.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...k.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...k.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...k.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...k.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...k.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...k.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...k.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...k.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...k.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,...k.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,...k.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...k.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...k.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...k.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...k.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...k.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...k.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...k.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...k.errToObj(t)})}nonempty(e){return this.min(1,k.errToObj(e))}trim(){return new ke({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ke({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ke({...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}}ke.create=a=>new ke({checks:[],typeName:$.ZodString,coerce:a?.coerce??!1,...R(a)});function Jr(a,e){const t=(a.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,n=t>s?t:s,i=Number.parseInt(a.toFixed(n).replace(".","")),u=Number.parseInt(e.toFixed(n).replace(".",""));return i%u/10**n}class Ie extends V{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)!==b.number){const i=this._getOrReturnCtx(e);return x(i,{code:f.invalid_type,expected:b.number,received:i.parsedType}),N}let s;const n=new re;for(const i of this._def.checks)i.kind==="int"?E.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),x(s,{code:f.invalid_type,expected:"integer",received:"float",message:i.message}),n.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(s=this._getOrReturnCtx(e,s),x(s,{code:f.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),n.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(s=this._getOrReturnCtx(e,s),x(s,{code:f.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),n.dirty()):i.kind==="multipleOf"?Jr(e.data,i.value)!==0&&(s=this._getOrReturnCtx(e,s),x(s,{code:f.not_multiple_of,multipleOf:i.value,message:i.message}),n.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),x(s,{code:f.not_finite,message:i.message}),n.dirty()):E.assertNever(i);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,k.toString(t))}gt(e,t){return this.setLimit("min",e,!1,k.toString(t))}lte(e,t){return this.setLimit("max",e,!0,k.toString(t))}lt(e,t){return this.setLimit("max",e,!1,k.toString(t))}setLimit(e,t,s,n){return new Ie({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:k.toString(n)}]})}_addCheck(e){return new Ie({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:k.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:k.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:k.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:k.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:k.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:k.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:k.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:k.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:k.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"&&E.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(t===null||s.value>t)&&(t=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(t)&&Number.isFinite(e)}}Ie.create=a=>new Ie({checks:[],typeName:$.ZodNumber,coerce:a?.coerce||!1,...R(a)});class Ze extends V{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)!==b.bigint)return this._getInvalidInput(e);let s;const n=new re;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(s=this._getOrReturnCtx(e,s),x(s,{code:f.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),n.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(s=this._getOrReturnCtx(e,s),x(s,{code:f.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),n.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),x(s,{code:f.not_multiple_of,multipleOf:i.value,message:i.message}),n.dirty()):E.assertNever(i);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return x(t,{code:f.invalid_type,expected:b.bigint,received:t.parsedType}),N}gte(e,t){return this.setLimit("min",e,!0,k.toString(t))}gt(e,t){return this.setLimit("min",e,!1,k.toString(t))}lte(e,t){return this.setLimit("max",e,!0,k.toString(t))}lt(e,t){return this.setLimit("max",e,!1,k.toString(t))}setLimit(e,t,s,n){return new Ze({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:k.toString(n)}]})}_addCheck(e){return new Ze({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:k.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:k.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:k.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:k.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:k.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}}Ze.create=a=>new Ze({checks:[],typeName:$.ZodBigInt,coerce:a?.coerce??!1,...R(a)});class At extends V{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==b.boolean){const s=this._getOrReturnCtx(e);return x(s,{code:f.invalid_type,expected:b.boolean,received:s.parsedType}),N}return oe(e.data)}}At.create=a=>new At({typeName:$.ZodBoolean,coerce:a?.coerce||!1,...R(a)});class Qe extends V{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==b.date){const i=this._getOrReturnCtx(e);return x(i,{code:f.invalid_type,expected:b.date,received:i.parsedType}),N}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return x(i,{code:f.invalid_date}),N}const s=new re;let n;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(n=this._getOrReturnCtx(e,n),x(n,{code:f.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),s.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(n=this._getOrReturnCtx(e,n),x(n,{code:f.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),s.dirty()):E.assertNever(i);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Qe({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:k.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:k.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}}Qe.create=a=>new Qe({checks:[],coerce:a?.coerce||!1,typeName:$.ZodDate,...R(a)});class It extends V{_parse(e){if(this._getType(e)!==b.symbol){const s=this._getOrReturnCtx(e);return x(s,{code:f.invalid_type,expected:b.symbol,received:s.parsedType}),N}return oe(e.data)}}It.create=a=>new It({typeName:$.ZodSymbol,...R(a)});class Rt extends V{_parse(e){if(this._getType(e)!==b.undefined){const s=this._getOrReturnCtx(e);return x(s,{code:f.invalid_type,expected:b.undefined,received:s.parsedType}),N}return oe(e.data)}}Rt.create=a=>new Rt({typeName:$.ZodUndefined,...R(a)});class jt extends V{_parse(e){if(this._getType(e)!==b.null){const s=this._getOrReturnCtx(e);return x(s,{code:f.invalid_type,expected:b.null,received:s.parsedType}),N}return oe(e.data)}}jt.create=a=>new jt({typeName:$.ZodNull,...R(a)});class Vt extends V{constructor(){super(...arguments),this._any=!0}_parse(e){return oe(e.data)}}Vt.create=a=>new Vt({typeName:$.ZodAny,...R(a)});class Et extends V{constructor(){super(...arguments),this._unknown=!0}_parse(e){return oe(e.data)}}Et.create=a=>new Et({typeName:$.ZodUnknown,...R(a)});class Se extends V{_parse(e){const t=this._getOrReturnCtx(e);return x(t,{code:f.invalid_type,expected:b.never,received:t.parsedType}),N}}Se.create=a=>new Se({typeName:$.ZodNever,...R(a)});class Dt extends V{_parse(e){if(this._getType(e)!==b.undefined){const s=this._getOrReturnCtx(e);return x(s,{code:f.invalid_type,expected:b.void,received:s.parsedType}),N}return oe(e.data)}}Dt.create=a=>new Dt({typeName:$.ZodVoid,...R(a)});class me extends V{_parse(e){const{ctx:t,status:s}=this._processInputParams(e),n=this._def;if(t.parsedType!==b.array)return x(t,{code:f.invalid_type,expected:b.array,received:t.parsedType}),N;if(n.exactLength!==null){const u=t.data.length>n.exactLength.value,d=t.data.length<n.exactLength.value;(u||d)&&(x(t,{code:u?f.too_big:f.too_small,minimum:d?n.exactLength.value:void 0,maximum:u?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),s.dirty())}if(n.minLength!==null&&t.data.length<n.minLength.value&&(x(t,{code:f.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),s.dirty()),n.maxLength!==null&&t.data.length>n.maxLength.value&&(x(t,{code:f.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map((u,d)=>n.type._parseAsync(new we(t,u,t.path,d)))).then(u=>re.mergeArray(s,u));const i=[...t.data].map((u,d)=>n.type._parseSync(new we(t,u,t.path,d)));return re.mergeArray(s,i)}get element(){return this._def.type}min(e,t){return new me({...this._def,minLength:{value:e,message:k.toString(t)}})}max(e,t){return new me({...this._def,maxLength:{value:e,message:k.toString(t)}})}length(e,t){return new me({...this._def,exactLength:{value:e,message:k.toString(t)}})}nonempty(e){return this.min(1,e)}}me.create=(a,e)=>new me({type:a,minLength:null,maxLength:null,exactLength:null,typeName:$.ZodArray,...R(e)});function $e(a){if(a instanceof q){const e={};for(const t in a.shape){const s=a.shape[t];e[t]=_e.create($e(s))}return new q({...a._def,shape:()=>e})}else return a instanceof me?new me({...a._def,type:$e(a.element)}):a instanceof _e?_e.create($e(a.unwrap())):a instanceof Ve?Ve.create($e(a.unwrap())):a instanceof Me?Me.create(a.items.map(e=>$e(e))):a}class q extends V{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=E.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==b.object){const h=this._getOrReturnCtx(e);return x(h,{code:f.invalid_type,expected:b.object,received:h.parsedType}),N}const{status:s,ctx:n}=this._processInputParams(e),{shape:i,keys:u}=this._getCached(),d=[];if(!(this._def.catchall instanceof Se&&this._def.unknownKeys==="strip"))for(const h in n.data)u.includes(h)||d.push(h);const g=[];for(const h of u){const w=i[h],K=n.data[h];g.push({key:{status:"valid",value:h},value:w._parse(new we(n,K,n.path,h)),alwaysSet:h in n.data})}if(this._def.catchall instanceof Se){const h=this._def.unknownKeys;if(h==="passthrough")for(const w of d)g.push({key:{status:"valid",value:w},value:{status:"valid",value:n.data[w]}});else if(h==="strict")d.length>0&&(x(n,{code:f.unrecognized_keys,keys:d}),s.dirty());else if(h!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const h=this._def.catchall;for(const w of d){const K=n.data[w];g.push({key:{status:"valid",value:w},value:h._parse(new we(n,K,n.path,w)),alwaysSet:w in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const h=[];for(const w of g){const K=await w.key,Z=await w.value;h.push({key:K,value:Z,alwaysSet:w.alwaysSet})}return h}).then(h=>re.mergeObjectSync(s,h)):re.mergeObjectSync(s,g)}get shape(){return this._def.shape()}strict(e){return k.errToObj,new q({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,s)=>{const n=this._def.errorMap?.(t,s).message??s.defaultError;return t.code==="unrecognized_keys"?{message:k.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new q({...this._def,unknownKeys:"strip"})}passthrough(){return new q({...this._def,unknownKeys:"passthrough"})}extend(e){return new q({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new q({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:$.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new q({...this._def,catchall:e})}pick(e){const t={};for(const s of E.objectKeys(e))e[s]&&this.shape[s]&&(t[s]=this.shape[s]);return new q({...this._def,shape:()=>t})}omit(e){const t={};for(const s of E.objectKeys(this.shape))e[s]||(t[s]=this.shape[s]);return new q({...this._def,shape:()=>t})}deepPartial(){return $e(this)}partial(e){const t={};for(const s of E.objectKeys(this.shape)){const n=this.shape[s];e&&!e[s]?t[s]=n:t[s]=n.optional()}return new q({...this._def,shape:()=>t})}required(e){const t={};for(const s of E.objectKeys(this.shape))if(e&&!e[s])t[s]=this.shape[s];else{let i=this.shape[s];for(;i instanceof _e;)i=i._def.innerType;t[s]=i}return new q({...this._def,shape:()=>t})}keyof(){return Yt(E.objectKeys(this.shape))}}q.create=(a,e)=>new q({shape:()=>a,unknownKeys:"strip",catchall:Se.create(),typeName:$.ZodObject,...R(e)});q.strictCreate=(a,e)=>new q({shape:()=>a,unknownKeys:"strict",catchall:Se.create(),typeName:$.ZodObject,...R(e)});q.lazycreate=(a,e)=>new q({shape:a,unknownKeys:"strip",catchall:Se.create(),typeName:$.ZodObject,...R(e)});class et extends V{_parse(e){const{ctx:t}=this._processInputParams(e),s=this._def.options;function n(i){for(const d of i)if(d.result.status==="valid")return d.result;for(const d of i)if(d.result.status==="dirty")return t.common.issues.push(...d.ctx.common.issues),d.result;const u=i.map(d=>new xe(d.ctx.common.issues));return x(t,{code:f.invalid_union,unionErrors:u}),N}if(t.common.async)return Promise.all(s.map(async i=>{const u={...t,common:{...t.common,issues:[]},parent:null};return{result:await i._parseAsync({data:t.data,path:t.path,parent:u}),ctx:u}})).then(n);{let i;const u=[];for(const g of s){const h={...t,common:{...t.common,issues:[]},parent:null},w=g._parseSync({data:t.data,path:t.path,parent:h});if(w.status==="valid")return w;w.status==="dirty"&&!i&&(i={result:w,ctx:h}),h.common.issues.length&&u.push(h.common.issues)}if(i)return t.common.issues.push(...i.ctx.common.issues),i.result;const d=u.map(g=>new xe(g));return x(t,{code:f.invalid_union,unionErrors:d}),N}}get options(){return this._def.options}}et.create=(a,e)=>new et({options:a,typeName:$.ZodUnion,...R(e)});function ft(a,e){const t=be(a),s=be(e);if(a===e)return{valid:!0,data:a};if(t===b.object&&s===b.object){const n=E.objectKeys(e),i=E.objectKeys(a).filter(d=>n.indexOf(d)!==-1),u={...a,...e};for(const d of i){const g=ft(a[d],e[d]);if(!g.valid)return{valid:!1};u[d]=g.data}return{valid:!0,data:u}}else if(t===b.array&&s===b.array){if(a.length!==e.length)return{valid:!1};const n=[];for(let i=0;i<a.length;i++){const u=a[i],d=e[i],g=ft(u,d);if(!g.valid)return{valid:!1};n.push(g.data)}return{valid:!0,data:n}}else return t===b.date&&s===b.date&&+a==+e?{valid:!0,data:a}:{valid:!1}}class tt extends V{_parse(e){const{status:t,ctx:s}=this._processInputParams(e),n=(i,u)=>{if(Mt(i)||Mt(u))return N;const d=ft(i.value,u.value);return d.valid?((Nt(i)||Nt(u))&&t.dirty(),{status:t.value,value:d.data}):(x(s,{code:f.invalid_intersection_types}),N)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([i,u])=>n(i,u)):n(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}tt.create=(a,e,t)=>new tt({left:a,right:e,typeName:$.ZodIntersection,...R(t)});class Me extends V{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==b.array)return x(s,{code:f.invalid_type,expected:b.array,received:s.parsedType}),N;if(s.data.length<this._def.items.length)return x(s,{code:f.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),N;!this._def.rest&&s.data.length>this._def.items.length&&(x(s,{code:f.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const i=[...s.data].map((u,d)=>{const g=this._def.items[d]||this._def.rest;return g?g._parse(new we(s,u,s.path,d)):null}).filter(u=>!!u);return s.common.async?Promise.all(i).then(u=>re.mergeArray(t,u)):re.mergeArray(t,i)}get items(){return this._def.items}rest(e){return new Me({...this._def,rest:e})}}Me.create=(a,e)=>{if(!Array.isArray(a))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Me({items:a,typeName:$.ZodTuple,rest:null,...R(e)})};class Pt extends V{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==b.map)return x(s,{code:f.invalid_type,expected:b.map,received:s.parsedType}),N;const n=this._def.keyType,i=this._def.valueType,u=[...s.data.entries()].map(([d,g],h)=>({key:n._parse(new we(s,d,s.path,[h,"key"])),value:i._parse(new we(s,g,s.path,[h,"value"]))}));if(s.common.async){const d=new Map;return Promise.resolve().then(async()=>{for(const g of u){const h=await g.key,w=await g.value;if(h.status==="aborted"||w.status==="aborted")return N;(h.status==="dirty"||w.status==="dirty")&&t.dirty(),d.set(h.value,w.value)}return{status:t.value,value:d}})}else{const d=new Map;for(const g of u){const h=g.key,w=g.value;if(h.status==="aborted"||w.status==="aborted")return N;(h.status==="dirty"||w.status==="dirty")&&t.dirty(),d.set(h.value,w.value)}return{status:t.value,value:d}}}}Pt.create=(a,e,t)=>new Pt({valueType:e,keyType:a,typeName:$.ZodMap,...R(t)});class Le extends V{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==b.set)return x(s,{code:f.invalid_type,expected:b.set,received:s.parsedType}),N;const n=this._def;n.minSize!==null&&s.data.size<n.minSize.value&&(x(s,{code:f.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),n.maxSize!==null&&s.data.size>n.maxSize.value&&(x(s,{code:f.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const i=this._def.valueType;function u(g){const h=new Set;for(const w of g){if(w.status==="aborted")return N;w.status==="dirty"&&t.dirty(),h.add(w.value)}return{status:t.value,value:h}}const d=[...s.data.values()].map((g,h)=>i._parse(new we(s,g,s.path,h)));return s.common.async?Promise.all(d).then(g=>u(g)):u(d)}min(e,t){return new Le({...this._def,minSize:{value:e,message:k.toString(t)}})}max(e,t){return new Le({...this._def,maxSize:{value:e,message:k.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Le.create=(a,e)=>new Le({valueType:a,minSize:null,maxSize:null,typeName:$.ZodSet,...R(e)});class Zt extends V{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})}}Zt.create=(a,e)=>new Zt({getter:a,typeName:$.ZodLazy,...R(e)});class Lt extends V{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return x(t,{received:t.data,code:f.invalid_literal,expected:this._def.value}),N}return{status:"valid",value:e.data}}get value(){return this._def.value}}Lt.create=(a,e)=>new Lt({value:a,typeName:$.ZodLiteral,...R(e)});function Yt(a,e){return new Re({values:a,typeName:$.ZodEnum,...R(e)})}class Re extends V{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),s=this._def.values;return x(t,{expected:E.joinValues(s),received:t.parsedType,code:f.invalid_type}),N}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),s=this._def.values;return x(t,{received:t.data,code:f.invalid_enum_value,options:s}),N}return oe(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 Re.create(e,{...this._def,...t})}exclude(e,t=this._def){return Re.create(this.options.filter(s=>!e.includes(s)),{...this._def,...t})}}Re.create=Yt;class zt extends V{_parse(e){const t=E.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==b.string&&s.parsedType!==b.number){const n=E.objectValues(t);return x(s,{expected:E.joinValues(n),received:s.parsedType,code:f.invalid_type}),N}if(this._cache||(this._cache=new Set(E.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const n=E.objectValues(t);return x(s,{received:s.data,code:f.invalid_enum_value,options:n}),N}return oe(e.data)}get enum(){return this._def.values}}zt.create=(a,e)=>new zt({values:a,typeName:$.ZodNativeEnum,...R(e)});class at extends V{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==b.promise&&t.common.async===!1)return x(t,{code:f.invalid_type,expected:b.promise,received:t.parsedType}),N;const s=t.parsedType===b.promise?t.data:Promise.resolve(t.data);return oe(s.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}}at.create=(a,e)=>new at({type:a,typeName:$.ZodPromise,...R(e)});class je extends V{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===$.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:s}=this._processInputParams(e),n=this._def.effect||null,i={addIssue:u=>{x(s,u),u.fatal?t.abort():t.dirty()},get path(){return s.path}};if(i.addIssue=i.addIssue.bind(i),n.type==="preprocess"){const u=n.transform(s.data,i);if(s.common.async)return Promise.resolve(u).then(async d=>{if(t.value==="aborted")return N;const g=await this._def.schema._parseAsync({data:d,path:s.path,parent:s});return g.status==="aborted"?N:g.status==="dirty"||t.value==="dirty"?De(g.value):g});{if(t.value==="aborted")return N;const d=this._def.schema._parseSync({data:u,path:s.path,parent:s});return d.status==="aborted"?N:d.status==="dirty"||t.value==="dirty"?De(d.value):d}}if(n.type==="refinement"){const u=d=>{const g=n.refinement(d,i);if(s.common.async)return Promise.resolve(g);if(g instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return d};if(s.common.async===!1){const d=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return d.status==="aborted"?N:(d.status==="dirty"&&t.dirty(),u(d.value),{status:t.value,value:d.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(d=>d.status==="aborted"?N:(d.status==="dirty"&&t.dirty(),u(d.value).then(()=>({status:t.value,value:d.value}))))}if(n.type==="transform")if(s.common.async===!1){const u=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!Ae(u))return N;const d=n.transform(u.value,i);if(d instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:d}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(u=>Ae(u)?Promise.resolve(n.transform(u.value,i)).then(d=>({status:t.value,value:d})):N);E.assertNever(n)}}je.create=(a,e,t)=>new je({schema:a,typeName:$.ZodEffects,effect:e,...R(t)});je.createWithPreprocess=(a,e,t)=>new je({schema:e,effect:{type:"preprocess",transform:a},typeName:$.ZodEffects,...R(t)});class _e extends V{_parse(e){return this._getType(e)===b.undefined?oe(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}_e.create=(a,e)=>new _e({innerType:a,typeName:$.ZodOptional,...R(e)});class Ve extends V{_parse(e){return this._getType(e)===b.null?oe(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ve.create=(a,e)=>new Ve({innerType:a,typeName:$.ZodNullable,...R(e)});class pt extends V{_parse(e){const{ctx:t}=this._processInputParams(e);let s=t.data;return t.parsedType===b.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}pt.create=(a,e)=>new pt({innerType:a,typeName:$.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...R(e)});class ht extends V{_parse(e){const{ctx:t}=this._processInputParams(e),s={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return Xe(n)?n.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new xe(s.common.issues)},input:s.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new xe(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}ht.create=(a,e)=>new ht({innerType:a,typeName:$.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...R(e)});class Ft extends V{_parse(e){if(this._getType(e)!==b.nan){const s=this._getOrReturnCtx(e);return x(s,{code:f.invalid_type,expected:b.nan,received:s.parsedType}),N}return{status:"valid",value:e.data}}}Ft.create=a=>new Ft({typeName:$.ZodNaN,...R(a)});class qr extends V{_parse(e){const{ctx:t}=this._processInputParams(e),s=t.data;return this._def.type._parse({data:s,path:t.path,parent:t})}unwrap(){return this._def.type}}class gt extends V{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return i.status==="aborted"?N:i.status==="dirty"?(t.dirty(),De(i.value)):this._def.out._parseAsync({data:i.value,path:s.path,parent:s})})();{const n=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?N:n.status==="dirty"?(t.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:s.path,parent:s})}}static create(e,t){return new gt({in:e,out:t,typeName:$.ZodPipeline})}}class mt extends V{_parse(e){const t=this._def.innerType._parse(e),s=n=>(Ae(n)&&(n.value=Object.freeze(n.value)),n);return Xe(t)?t.then(n=>s(n)):s(t)}unwrap(){return this._def.innerType}}mt.create=(a,e)=>new mt({innerType:a,typeName:$.ZodReadonly,...R(e)});var $;(function(a){a.ZodString="ZodString",a.ZodNumber="ZodNumber",a.ZodNaN="ZodNaN",a.ZodBigInt="ZodBigInt",a.ZodBoolean="ZodBoolean",a.ZodDate="ZodDate",a.ZodSymbol="ZodSymbol",a.ZodUndefined="ZodUndefined",a.ZodNull="ZodNull",a.ZodAny="ZodAny",a.ZodUnknown="ZodUnknown",a.ZodNever="ZodNever",a.ZodVoid="ZodVoid",a.ZodArray="ZodArray",a.ZodObject="ZodObject",a.ZodUnion="ZodUnion",a.ZodDiscriminatedUnion="ZodDiscriminatedUnion",a.ZodIntersection="ZodIntersection",a.ZodTuple="ZodTuple",a.ZodRecord="ZodRecord",a.ZodMap="ZodMap",a.ZodSet="ZodSet",a.ZodFunction="ZodFunction",a.ZodLazy="ZodLazy",a.ZodLiteral="ZodLiteral",a.ZodEnum="ZodEnum",a.ZodEffects="ZodEffects",a.ZodNativeEnum="ZodNativeEnum",a.ZodOptional="ZodOptional",a.ZodNullable="ZodNullable",a.ZodDefault="ZodDefault",a.ZodCatch="ZodCatch",a.ZodPromise="ZodPromise",a.ZodBranded="ZodBranded",a.ZodPipeline="ZodPipeline",a.ZodReadonly="ZodReadonly"})($||($={}));const v=ke.create,Ee=Ie.create;Se.create;const Q=me.create,z=q.create;et.create;tt.create;Me.create;const Bt=Re.create;at.create;_e.create;Ve.create;const Wr=z({label:v().min(1).max(40),left:v().min(1).max(35),right:v().min(1).max(35)}),Kr=z({id:v().min(1),category:v().optional().default("TECH"),theme:Bt(["blue-tech","emerald-finance","slate-education","dark-contrast","crimson-alert","amber-gold","cyber-violet","sunset-orange","nordic-frost","monochrome-luxe"]).default("blue-tech"),layoutType:Bt(["table","news","stat","list","quote","versus","receipt","timeline","barchart","leaderboard","editorial","matrix","debate","tierlist"]).default("table"),title:v().min(1).max(120),subtitle:v().min(1).max(250),leftHeader:v().optional().default("USA 🇺🇸"),rightHeader:v().optional().default("UK 🇬🇧"),rows:Q(Wr).optional().default([]),bullets:Q(z({highlight:v().optional().default(""),text:v().min(1)})).optional().default([]),bigStat:z({number:v().default("$165,000"),label:v().default("Average Compensation"),subtext:v().optional().default(""),secondaryNumber:v().optional().default(""),secondaryLabel:v().optional().default("")}).optional(),listItems:Q(z({rank:Ee(),title:v(),value:v(),tag:v().optional().default("")})).optional().default([]),quoteData:z({quote:v(),highlight:v().optional().default(""),source:v().default("Industry Insider")}).optional(),versusData:z({leftEntity:v().optional(),leftStats:Q(z({label:v(),value:v()})).optional(),leftPerk:v().optional(),rightEntity:v().optional(),rightStats:Q(z({label:v(),value:v()})).optional(),rightPerk:v().optional(),verdict:v().optional()}).optional(),receiptData:z({grossMonthly:v().optional(),items:Q(z({label:v(),amount:v(),note:v().optional()})).optional(),totalDeductions:v().optional(),netRemaining:v().optional()}).optional(),timelineData:z({pastYear:v().optional().default("2016"),presentYear:v().optional().default("2026"),items:Q(z({label:v(),pastValue:v(),presentValue:v(),changeBadge:v().optional()})).optional(),bottomInsight:v().optional()}).optional(),barchartData:Q(z({label:v(),percentage:Ee().min(0).max(100),amount:v().optional(),tag:v().optional()})).optional().default([]),leaderboardData:z({calloutNote:v().optional().default("*Asumsi kurs : Rp15.500/US$"),items:Q(z({rank:Ee(),name:v(),flag:v().optional().default("🌐"),value:v(),percentage:Ee().min(0).max(100).optional()})).optional()}).optional(),editorialData:z({badge:v().optional().default("INVESTIGASI KHUSUS"),highlightPhrase:v().optional(),cards:Q(z({step:v().optional(),title:v(),text:v(),stat:v().optional()})).optional(),keyTakeaway:v().optional()}).optional(),matrixData:z({headers:Q(v()).optional().default(["Indikator","🇮🇩 IDN","🇲🇾 MYS","🇸🇬 SGP"]),rows:Q(z({label:v(),values:Q(v())})).optional()}).optional(),debateData:z({proTitle:v().optional().default("SISI PRO / BENEFIT"),proScore:v().optional().default("65%"),proPoints:Q(v()).optional(),conTitle:v().optional().default("SISI KONTRA / RISIKO"),conScore:v().optional().default("35%"),conPoints:Q(v()).optional(),callToAction:v().optional().default("Kalian di tim mana? Tulis pendapatmu di bawah! 👇")}).optional(),tierlistData:Q(z({tier:v(),tierColor:v().optional(),items:Q(z({name:v(),badge:v().optional(),desc:v().optional()}))})).optional().default([]),footerNote:v().optional().default("Industry Benchmark 2026"),watermark:v().optional().default("@SocialGen"),bgKeyword:v().optional().default("modern office coding night"),reelsDuration:Ee().min(5).max(90).default(30),caption:v().optional().default("Bagikan pendapat Anda di kolom komentar! #infografis #edukasi")}),Yr={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"},Xr={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"},Qr={class:"flex items-center gap-2.5 sm:gap-3"},ei={class:"text-sm font-extrabold tracking-tight text-white flex items-center gap-1.5 sm:gap-2"},ti={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"},ai={class:"flex items-center gap-2 sm:gap-3 text-xs"},si={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]"},ni={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]"},ri={class:"lg:hidden flex items-center justify-center px-3 py-2 bg-slate-900/90 border-b border-slate-800 flex-shrink-0"},ii={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"},oi={key:0,class:"w-2 h-2 rounded-full bg-emerald-400 animate-ping"},li={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"},ci=vt({__name:"index",setup(a){const e=O({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=O({theme:"blue-tech",backgroundSource:"pexels",musicFile:"random",videoStartOffset:0,audioStartOffset:0,outputs:{feed:!0,story:!0,reels:!0}}),s=O([]),n=O(-1);function i(){try{localStorage.setItem("sg_drafts",JSON.stringify(s.value))}catch{}$fetch("/api/drafts",{method:"POST",body:{drafts:s.value}}).catch(()=>{})}function u(){s.value.unshift(JSON.parse(JSON.stringify(e.value))),n.value=0,w.value=-1,i(),X("Draft berhasil disimpan!")}function d(C){s.value[C]&&(e.value=JSON.parse(JSON.stringify(s.value[C])),t.value.theme=e.value.theme,n.value=C,w.value=-1,X(`Memuat draft #${C+1}`))}function g(C){s.value.splice(C,1),n.value===C&&(n.value=-1),i(),X("Draft dihapus")}const h=O([]),w=O(-1);function K(){try{localStorage.setItem("sg_gen_history",JSON.stringify(h.value))}catch{}$fetch("/api/generation-history",{method:"POST",body:{history:h.value}}).catch(()=>{})}function Z(C){const y=h.value[C];y&&(e.value=JSON.parse(JSON.stringify(y.contentData||y)),y.options&&(t.value={...t.value,...y.options}),w.value=C,n.value=-1,X(`Memuat riwayat: "${y.title.slice(0,24)}..."`))}function A(C){h.value.splice(C,1),w.value===C&&(w.value=-1),K(),X("Item riwayat dihapus")}function j(){h.value=[],w.value=-1,K(),X("Seluruh riwayat generate berhasil dibersihkan!")}let H=null;function W(){try{localStorage.setItem("sg_active_content",JSON.stringify(e.value)),localStorage.setItem("sg_active_options",JSON.stringify(t.value))}catch{}clearTimeout(H),H=setTimeout(()=>{$fetch("/api/last-session",{method:"POST",body:{content:e.value,options:t.value}}).catch(()=>{})},1e3)}de(()=>e.value,W,{deep:!0}),de(()=>t.value,W,{deep:!0});const ne=O(!1),ue=O(!1),L=O(""),G=O(null),B=O(""),Y=O("success"),ae=O("editor"),le=O(null);Ut(async()=>{try{const C=localStorage.getItem("sg_active_content");if(C){const y=JSON.parse(C);y&&y.title&&(e.value=y)}else{const y=await $fetch("/api/last-session");y?.session?.content&&(e.value=y.session.content,y.session.options&&(t.value={...t.value,...y.session.options}))}}catch{}try{const C=localStorage.getItem("sg_active_options");if(C){const y=JSON.parse(C);y&&(t.value={...t.value,...y})}}catch{}try{const C=await $fetch("/api/drafts");if(C?.drafts&&Array.isArray(C.drafts)&&C.drafts.length>0)s.value=C.drafts;else{const y=localStorage.getItem("sg_drafts");if(y){const ee=JSON.parse(y);Array.isArray(ee)&&ee.length>0&&(s.value=ee,$fetch("/api/drafts",{method:"POST",body:{drafts:ee}}).catch(()=>{}))}}}catch{const C=localStorage.getItem("sg_drafts");if(C)try{s.value=JSON.parse(C)}catch{}}try{const C=await $fetch("/api/generation-history");if(C?.history&&Array.isArray(C.history)&&C.history.length>0)h.value=C.history;else{const y=localStorage.getItem("sg_gen_history");y&&(h.value=JSON.parse(y))}}catch{}try{const C=await $fetch("/api/status");le.value=C}catch{}});const ce=he(()=>{const C=Kr.safeParse(e.value);if(C.success)return{isValid:!0,error:""};{const y=C.error.errors[0];return{isValid:!1,error:`${y.path.join(".")}: ${y.message}`}}});function X(C,y="success"){B.value=C,Y.value=y,setTimeout(()=>{B.value=""},4e3)}async function ye(C,y,ee,ie){ue.value=!0,L.value=`AI Research (${ee||"Gemini"})...`;try{const P=await $fetch("/api/auto-topic",{method:"POST",body:{niche:C,layoutType:y,model:ee,language:ie}});P?.dataset&&(e.value=P.dataset,t.value.theme=P.dataset.theme,s.value.unshift(P.dataset),n.value=0,i(),P.source==="gemini"?X(`✨ [${P.modelUsed||"Gemini"}] Berhasil meriset: "${P.dataset.title.slice(0,32)}..."`,"success"):X(`ℹ️ [Curated Data] Topik siap: "${P.dataset.title.slice(0,32)}..."`,"success"))}catch(P){X("Gagal auto-topic: "+(P.data?.statusMessage||P.message),"error")}finally{ue.value=!1,L.value=""}}async function Ce(){if(!ce.value.isValid){X("Data tidak valid: "+ce.value.error,"error");return}ne.value=!0,L.value="Rendering Images & Reels...",G.value=null;const C={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))};h.value.unshift(C),w.value=0,K(),ae.value="preview";try{const y=await $fetch("/api/generate",{method:"POST",body:{data:e.value,options:t.value}});y?.success&&(G.value=y,X(`Sukses dirender dalam ${(y.durationMs/1e3).toFixed(1)} detik!`))}catch(y){X("Gagal render: "+(y.data?.statusMessage||y.message),"error")}finally{ne.value=!1,L.value=""}}return(C,y)=>{const ee=An,ie=_r;return _(),M("div",Yr,[r("header",Xr,[r("div",Qr,[y[8]||(y[8]=r("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)),r("div",null,[r("h1",ei,[y[7]||(y[7]=J(" SocialGen ",-1)),r("span",ti," v"+T(l(le)?.version||"2.1.1"),1)])])]),r("div",ai,[l(le)?.geminiActive?(_(),M("span",si," ● AI Connected ")):(_(),M("span",ni," ● Local Engine "))])]),r("div",ri,[r("div",ii,[r("button",{onClick:y[0]||(y[0]=P=>ae.value="editor"),class:F(["py-1.5 px-3 rounded-lg transition flex items-center justify-center gap-1.5",l(ae)==="editor"?"bg-sky-500 text-white shadow-md font-black":"text-slate-400 hover:text-slate-200"])},[...y[9]||(y[9]=[r("span",null,"⚙️ Studio & Editor",-1)])],2),r("button",{onClick:y[1]||(y[1]=P=>ae.value="preview"),class:F(["py-1.5 px-3 rounded-lg transition flex items-center justify-center gap-1.5",l(ae)==="preview"?"bg-indigo-600 text-white shadow-md font-black":"text-slate-400 hover:text-slate-200"])},[y[10]||(y[10]=r("span",null,"👁️ Live Preview",-1)),l(G)?(_(),M("span",oi)):U("",!0)],2)])]),l(B)?(_(),M("div",{key:0,class:F(["fixed bottom-6 right-6 z-50 flex items-center gap-2 px-4 py-3 rounded-2xl shadow-2xl text-xs font-bold border transition-all animate-bounce",l(Y)==="success"?"bg-emerald-950 text-emerald-200 border-emerald-500/50":"bg-rose-950 text-rose-200 border-rose-500/50"])},[r("span",null,T(l(B)),1)],2)):U("",!0),r("main",li,[r("section",{class:F(["lg:col-span-5 h-full overflow-y-auto pr-1 flex-col gap-3 custom-scrollbar",l(ae)==="editor"?"flex":"hidden lg:flex"])},[I(ee,{modelValue:l(e),"onUpdate:modelValue":y[2]||(y[2]=P=>Pe(e)?e.value=P:null),options:l(t),"onUpdate:options":y[3]||(y[3]=P=>Pe(t)?t.value=P:null),"is-valid":l(ce).isValid,"validation-error":l(ce).error,"is-generating":l(ne),"generate-stage":l(L),"is-auto-topic-loading":l(ue),drafts:l(s),"active-draft-index":l(n),history:l(h),"active-history-index":l(w),onGenerate:Ce,onAutoTopic:ye,onSelectDraft:d,onDeleteDraft:g,onSaveDraft:u,onSelectHistory:Z,onDeleteHistory:A,onClearAllHistory:j},null,8,["modelValue","options","is-valid","validation-error","is-generating","generate-stage","is-auto-topic-loading","drafts","active-draft-index","history","active-history-index"])],2),r("section",{class:F(["lg:col-span-7 h-full flex-col gap-3 overflow-hidden justify-between min-h-0",l(ae)==="preview"?"flex":"hidden lg:flex"])},[I(ie,{data:l(e),"selected-video":l(t).backgroundSource,"selected-music":l(t).musicFile,"video-start-offset":l(t).videoStartOffset,"onUpdate:videoStartOffset":y[4]||(y[4]=P=>l(t).videoStartOffset=P),"audio-start-offset":l(t).audioStartOffset,"onUpdate:audioStartOffset":y[5]||(y[5]=P=>l(t).audioStartOffset=P),"generated-result":l(G)},null,8,["data","selected-video","selected-music","video-start-offset","audio-start-offset","generated-result"])],2)]),l(ae)==="editor"?(_(),M("button",{key:1,onClick:y[6]||(y[6]=P=>ae.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"},[...y[11]||(y[11]=[r("span",null,"👁️ Lihat Preview Canvas",-1)])])):U("",!0)])}}});export{ci as default};
|
|
1
|
+
import{h as dt,d as vt,M as de,o as Ut,A as _,B as M,l,C as r,E as I,G as J,D as T,N as U,O as Ne,P as xt,Q as qe,R as We,S as Te,T as Oe,U as pe,V as Pe,W as F,X as yt,i as O,m as he,Y as ea,Z as bt}from"./B1LS7GXR.js";import{_ as ta}from"./DGwEN7My.js";const aa=a=>a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var Ke={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 sa=({size:a,strokeWidth:e=2,absoluteStrokeWidth:t,color:s,iconNode:n,name:i,class:u,...d},{slots:g})=>dt("svg",{...Ke,width:a||Ke.width,height:a||Ke.height,stroke:s||Ke.stroke,"stroke-width":t?Number(e)*24/Number(a):e,class:["lucide",`lucide-${aa(i??"icon")}`],...d},[...n.map(h=>dt(...h)),...g.default?[g.default()]:[]]);const D=(a,e)=>(t,{slots:s})=>dt(sa,{...t,iconNode:e,name:a},s);const kt=D("BookmarkIcon",[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]]);const Ye=D("CheckIcon",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const na=D("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 ra=D("CircleCheckIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const _t=D("ClockIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const Ht=D("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 ia=D("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 wt=D("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 Gt=D("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 oa=D("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 la=D("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 da=D("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 Jt=D("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 ua=D("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 ca=D("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 qt=D("PlayIcon",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);const fa=D("PlusIcon",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const pa=D("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 ha=D("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 ut=D("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 ma=D("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 va=D("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 St=D("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 ot=D("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 Ct=D("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 ga=D("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 xa=D("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 ya=D("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 Tt=D("XIcon",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);const ba=D("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 ka=D("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"}]]),_a={class:"flex flex-col gap-3 text-slate-100"},wa={key:0,class:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm flex items-center justify-center p-4"},Sa={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"},Ca={class:"flex items-center justify-between pb-3 border-b border-slate-800"},Ta={class:"text-sm font-black text-white flex items-center gap-2"},Oa={class:"p-3.5 bg-slate-950 rounded-2xl border border-slate-800 flex flex-col gap-2.5"},Ma={class:"font-bold text-sky-400 flex items-center justify-between"},Na={class:"grid grid-cols-1 sm:grid-cols-2 gap-2"},$a={class:"flex flex-col gap-2"},Aa={class:"text-[11px] font-bold text-slate-400 uppercase tracking-wider"},Ia={class:"flex flex-col gap-2 max-h-[220px] overflow-y-auto pr-1 custom-scrollbar"},Ra={class:"flex-1"},ja={class:"flex items-center gap-2 mb-1"},Va={class:"font-extrabold text-white text-xs"},Ea={class:"px-1.5 py-0.2 rounded text-[9px] font-bold bg-slate-800 text-slate-300 border border-slate-700"},Da={class:"text-[11px] text-slate-400 leading-snug"},Pa={class:"flex items-center gap-1"},Za=["onClick"],La=["onClick"],za={key:1,class:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm flex items-center justify-center p-4"},Fa={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]"},Ba={class:"flex items-center justify-between pb-3 border-b border-slate-800"},Ua={class:"text-sm font-black text-white flex items-center gap-2"},Ha={class:"flex items-center gap-2 bg-slate-950 p-2.5 rounded-xl border border-slate-800 text-[11px] flex-wrap"},Ga={class:"text-white font-semibold"},Ja={class:"text-white font-semibold"},qa={class:"text-purple-400 font-bold"},Wa={class:"relative flex-1 min-h-[220px]"},Ka=["value"],Ya={class:"flex items-center justify-between pt-2 border-t border-slate-800"},Xa={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"},Qa={class:"text-xs font-black text-white flex items-center gap-2"},es={class:"flex items-center gap-1.5 flex-wrap"},ts={class:"flex items-center gap-1 bg-slate-950 p-1 rounded-xl border border-slate-800 mr-1.5 shadow-inner"},as=["value"],ss={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"},ns=["disabled"],rs={class:"relative group"},is={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-56 text-xs"},os={class:"px-3 py-1.5"},ls={key:2,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"},ds={class:"w-6 h-6 rounded-lg bg-sky-500/20 border border-sky-400/40 flex items-center justify-center flex-shrink-0"},us={class:"text-[11px]"},cs={class:"font-extrabold text-white flex items-center gap-2"},fs={class:"text-[9px] px-1.5 py-0.2 rounded bg-sky-500/30 text-sky-200 border border-sky-400/30"},ps={class:"flex items-center justify-between bg-slate-950 p-1 rounded-xl border border-slate-800 text-xs font-semibold"},hs={class:"flex items-center gap-1"},ms={class:"flex items-center gap-1.5"},vs={key:3,class:"flex flex-col gap-1.5 p-2.5 bg-slate-900/90 border border-slate-800 rounded-2xl max-h-[300px] overflow-y-auto custom-scrollbar"},gs={key:0,class:"text-center py-8 text-slate-500 text-[11px] leading-relaxed"},xs=["onClick"],ys={class:"flex-1 pr-2"},bs={class:"flex items-center gap-1.5 mb-0.5"},ks={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"},_s={class:"text-[9px] text-slate-400 font-semibold"},ws={class:"font-bold text-[11px] truncate text-slate-100"},Ss=["onClick"],Cs={key:4,class:"flex flex-col gap-1.5 p-2.5 bg-slate-900/90 border border-slate-800 rounded-2xl max-h-[300px] overflow-y-auto custom-scrollbar"},Ts={key:0,class:"text-center py-8 text-slate-500 text-[11px] leading-relaxed"},Os=["onClick"],Ms={class:"flex-1 pr-2"},Ns={class:"flex items-center gap-1.5 mb-0.5"},$s={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"},As={class:"text-[9px] text-slate-400 font-semibold"},Is={key:0,class:"text-[9px] text-slate-500 font-mono ml-auto"},Rs={class:"font-bold text-[11px] truncate text-slate-100"},js=["onClick"],Vs={key:5,class:"flex flex-col bg-slate-900/90 border border-slate-800 rounded-2xl overflow-hidden shadow-lg"},Es={class:"grid grid-cols-2 gap-2 p-2.5 bg-slate-950/70 border-b border-slate-800 text-xs"},Ds={class:"block text-[10px] font-bold text-slate-300 mb-1 flex items-center gap-1"},Ps=["value"],Zs=["value"],Ls={class:"col-span-2 grid grid-cols-3 gap-2 pt-1 border-t border-slate-800/60 mt-1"},zs={class:"col-span-1"},Fs=["value"],Bs={class:"col-span-2"},Us=["value"],Hs={class:"flex items-center justify-between px-3 py-1.5 bg-slate-950/50 border-b border-slate-800"},Gs={class:"flex items-center gap-2 text-xs"},Js={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"},qs={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"},Ws={class:"relative p-2"},Ks=["value"],Ys={key:0,class:"text-[10px] text-rose-400 mt-1 px-1"},Xs={class:"p-3 bg-slate-900/90 border border-slate-800 rounded-2xl flex flex-col gap-2.5 shadow-lg text-xs"},Qs={class:"flex flex-col gap-1.5"},en={class:"flex items-center justify-between gap-2"},tn={class:"font-bold text-slate-300 flex items-center gap-1.5 text-[11px]"},an={class:"flex items-center gap-1.5"},sn=["value"],nn=["value"],rn=["disabled"],on={class:"hidden sm:inline"},ln={class:"flex items-center justify-between pl-5 pr-1 text-[10px] text-slate-400"},dn={class:"flex items-center gap-1 text-sky-300 font-mono"},un=["max","value"],cn={class:"flex flex-col gap-1.5 pt-1.5 border-t border-slate-800"},fn={class:"flex items-center justify-between gap-2"},pn={class:"font-bold text-slate-300 flex items-center gap-1.5 text-[11px]"},hn={class:"flex items-center gap-1.5"},mn=["value"],vn=["value"],gn=["disabled"],xn={class:"hidden sm:inline"},yn={class:"flex items-center justify-between pl-5 pr-1 text-[10px] text-slate-400"},bn={class:"flex items-center gap-1 text-purple-300 font-mono"},kn=["max","value"],_n={class:"flex items-center justify-between pt-1.5 border-t border-slate-800"},wn={class:"font-bold text-slate-300 flex items-center gap-1.5 text-[11px]"},Sn={class:"flex items-center gap-1.5 flex-wrap justify-end"},Cn=["onClick"],Tn={class:"grid grid-cols-3 gap-2 pt-1.5 border-t border-slate-800"},On=["checked"],Mn=["checked"],Nn=["checked"],$n=["disabled"],An=vt({__name:"DashboardControls",props:{modelValue:{},options:{},isValid:{type:Boolean},validationError:{},isGenerating:{type:Boolean},generateStage:{},isAutoTopicLoading:{type:Boolean},drafts:{},activeDraftIndex:{},history:{},activeHistoryIndex:{}},emits:["update:modelValue","update:options","generate","autoTopic","selectDraft","deleteDraft","saveDraft","selectHistory","deleteHistory","clearAllHistory"],setup(a,{emit:e}){const t=a,s=e,n=O(""),i=O(""),u=O(""),d=O("gemini-3.8-flash"),g=O("editor"),h=O([]),w=O("tech"),K=O(!1),Z=O(null),A=O({id:"",name:"",theme:"blue-tech",description:""});async function j(){try{const m=await $fetch("/api/niches");m?.niches&&m.niches.length>0&&(h.value=m.niches,h.value.some(o=>o.id===w.value)||(w.value=h.value[0].id))}catch(m){console.error("Failed to load niches:",m)}}function H(){Z.value=null,A.value={id:"",name:"",theme:t.modelValue.theme||"blue-tech",description:""},K.value=!0}function W(m){Z.value=m.id,A.value={id:m.id,name:m.name,theme:m.theme||"blue-tech",description:m.description}}async function ne(){if(!A.value.name.trim()){alert("Nama Niche wajib diisi");return}const o={id:Z.value||A.value.name.toLowerCase().replace(/[^a-z0-9_-]/g,"_"),name:A.value.name.trim(),theme:A.value.theme,description:A.value.description.trim()||`Fokus pada topik ${A.value.name.trim()}`};try{const c=await $fetch("/api/niches",{method:"POST",body:o});c?.niches&&(h.value=c.niches,w.value=o.id,Z.value=null,A.value={id:"",name:"",theme:"blue-tech",description:""})}catch(c){alert("Gagal menyimpan niche: "+(c.data?.statusMessage||c.message))}}async function ue(m){if(h.value.length<=1){alert("Minimal harus ada 1 niche tersisa.");return}if(confirm("Hapus niche ini?"))try{const o=await $fetch(`/api/niches?id=${m}`,{method:"DELETE"});o?.niches&&(h.value=o.niches,w.value===m&&(w.value=o.niches[0].id),Z.value===m&&(Z.value=null))}catch(o){alert("Gagal menghapus niche: "+(o.data?.statusMessage||o.message))}}const L=O("id"),G=O(!1),B=O(""),Y=O({}),ae=O(!1),le=O(!1),ce=O(["cyber_blue.mp4","emerald_flow.mp4","default_bg.mp4"]),X=O(["synthwave_pulse.mp3","lofi_chill.mp3","default_ambient.mp3"]),ye=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}),Ce=he(()=>{const m=t.options.backgroundSource||"";return ye.value[m]||15}),C=he(()=>Math.max(1,Ce.value-1)),y=he(()=>{const m=t.options.musicFile||"";return ye.value[m]||30}),ee=he(()=>Math.max(1,y.value-1));de(()=>t.options.backgroundSource,()=>{const m=C.value;(t.options.videoStartOffset||0)>m&&fe("videoStartOffset",m)}),de(()=>t.options.musicFile,()=>{const m=ee.value;(t.options.audioStartOffset||0)>m&&fe("audioStartOffset",m)});const ie=O(!1),P=O(null),ze=O(null);async function Fe(){try{const m=await $fetch("/api/media");m?.videos?.length&&(ce.value=m.videos),m?.audio?.length&&(X.value=m.audio),m?.durations&&(ye.value={...ye.value,...m.durations})}catch(m){console.error("Failed to fetch media list:",m)}}Ut(()=>{try{const m=localStorage.getItem("sg_selected_language");m&&(L.value=m)}catch{}Fe(),j()}),de(L,m=>{try{localStorage.setItem("sg_selected_language",m)}catch{}});async function Be(m,o){const c=m.target,se=c.files?.[0];if(se){ie.value=!0;try{const ge=new FormData;ge.append("file",se);const Je=await $fetch("/api/upload-media",{method:"POST",body:ge});Je?.success&&(await Fe(),Je.type==="video"?fe("backgroundSource",Je.filename):fe("musicFile",Je.filename))}catch(ge){alert("Upload gagal: "+(ge.data?.statusMessage||ge.message))}finally{ie.value=!1,c.value=""}}}de(()=>t.modelValue,m=>{try{const o=JSON.parse(n.value||"{}");JSON.stringify(o)!==JSON.stringify(m)&&(n.value=JSON.stringify(m,null,2))}catch{n.value=JSON.stringify(m,null,2)}},{immediate:!0,deep:!0});function Ue(m){const o=m.target;n.value=o.value;try{const c=JSON.parse(o.value);i.value="",s("update:modelValue",c)}catch(c){i.value="Invalid JSON: "+c.message}}function st(){try{const m=JSON.parse(n.value);n.value=JSON.stringify(m,null,2),i.value="",s("update:modelValue",m)}catch{i.value="Cannot format invalid JSON"}}function He(m){const o={...t.modelValue,layoutType:m};s("update:modelValue",o)}function nt(m){const o={...t.modelValue,watermark:m};s("update:modelValue",o)}function rt(m){const o={...t.modelValue,title:m};s("update:modelValue",o)}function Ge(m){const o={...t.modelValue,theme:m};s("update:modelValue",o),s("update:options",{...t.options,theme:m})}function it(m){const o={...t.modelValue,reelsDuration:m};s("update:modelValue",o)}function fe(m,o){s("update:options",{...t.options,[m]:o})}function S(m,o){const c=t.options.outputs||{feed:!0,story:!0,reels:!0};s("update:options",{...t.options,outputs:{...c,[m]:o}})}function p(m,o){s("autoTopic",w.value,o||u.value||void 0,d.value,L.value)}async function ve(){G.value=!0,ae.value=!0;try{const m=await $fetch("/api/copy-prompt",{query:{niche:w.value,layout:t.modelValue.layoutType||"news",language:L.value}});B.value=m.prompt,Y.value={topic:m.topic,pair:m.pair,niche:m.niche,usedCount:m.usedCount,language:m.language||L.value}}catch(m){console.error("Failed to get manual prompt:",m)}finally{ae.value=!1}}function te(){B.value&&(navigator.clipboard.writeText(B.value),le.value=!0,setTimeout(()=>{le.value=!1},2500))}function Xt(){t.history.length!==0&&confirm(`Bersihkan semua ${t.history.length} riwayat generate otomatis?`)&&s("clearAllHistory")}function Qt(m){if(!m)return"";try{return new Date(m).toLocaleDateString("id-ID",{day:"numeric",month:"short",hour:"2-digit",minute:"2-digit"})}catch{return""}}return(m,o)=>(_(),M("div",_a,[l(K)?(_(),M("div",wa,[r("div",Sa,[r("div",Ca,[r("div",null,[r("h3",Ta,[I(l(ma),{class:"w-4 h-4 text-sky-400"}),o[44]||(o[44]=J(" Kelola & Buat Niche Baru ",-1))]),o[45]||(o[45]=r("p",{class:"text-[11px] text-slate-400 mt-0.5"}," Simpan niche favoritmu. AI dan Prompt Generator akan otomatis menggunakannya. ",-1))]),r("button",{onClick:o[0]||(o[0]=c=>K.value=!1),class:"p-1 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800"},[I(l(Tt),{class:"w-4 h-4"})])]),r("div",Oa,[r("div",Ma,[r("span",null,T(l(Z)?"✏️ Edit Niche":"➕ Tambah Niche Baru"),1),l(Z)?(_(),M("button",{key:0,onClick:o[1]||(o[1]=c=>{Z.value=null,A.value={id:"",name:"",theme:"blue-tech",description:""}}),class:"text-[10px] text-slate-400 hover:text-white"}," Batal Edit ")):U("",!0)]),r("div",Na,[r("div",null,[o[46]||(o[46]=r("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Nama Niche",-1)),Ne(r("input",{"onUpdate:modelValue":o[2]||(o[2]=c=>l(A).name=c),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),[[xt,l(A).name]])]),r("div",null,[o[48]||(o[48]=r("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Tema Default",-1)),Ne(r("select",{"onUpdate:modelValue":o[3]||(o[3]=c=>l(A).theme=c),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"},[...o[47]||(o[47]=[We('<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),[[qe,l(A).theme]])])]),r("div",null,[o[49]||(o[49]=r("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Fokus Topik & Instruksi Prompt",-1)),Ne(r("textarea",{"onUpdate:modelValue":o[4]||(o[4]=c=>l(A).description=c),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),[[xt,l(A).description]])]),r("button",{onClick:ne,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"},[I(l(Ye),{class:"w-3.5 h-3.5"}),r("span",null,T(l(Z)?"Perbarui Niche":"Simpan Niche"),1)])]),r("div",$a,[r("div",Aa," Daftar Niche Tersimpan ("+T(l(h).length)+") ",1),r("div",Ia,[(_(!0),M(Te,null,Oe(l(h),c=>(_(),M("div",{key:c.id,class:"p-2.5 rounded-xl border bg-slate-950 border-slate-800 flex items-start justify-between gap-2"},[r("div",Ra,[r("div",ja,[r("span",Va,T(c.name),1),r("span",Ea,T(c.theme||"blue-tech"),1)]),r("p",Da,T(c.description),1)]),r("div",Pa,[r("button",{onClick:se=>W(c),class:"p-1.5 rounded-lg text-slate-400 hover:text-sky-300 hover:bg-slate-800 transition",title:"Edit Niche"},[I(l(ca),{class:"w-3.5 h-3.5"})],8,Za),r("button",{onClick:se=>ue(c.id),class:"p-1.5 rounded-lg text-slate-400 hover:text-rose-400 hover:bg-slate-800 transition",title:"Hapus Niche"},[I(l(ot),{class:"w-3.5 h-3.5"})],8,La)])]))),128))])])])])):U("",!0),l(G)?(_(),M("div",za,[r("div",Fa,[r("div",Ba,[r("div",null,[r("h3",Ua,[I(l(wt),{class:"w-4 h-4 text-purple-400"}),o[50]||(o[50]=J(" Master Prompt AI (Dynamic Research & Zero-Collision) ",-1))]),o[51]||(o[51]=r("p",{class:"text-[11px] text-slate-400 mt-0.5"}," Salin prompt ini ke ChatGPT / Gemini / Claude / DeepSeek untuk mencari topik terbaru. ",-1))]),r("button",{onClick:o[5]||(o[5]=c=>G.value=!1),class:"p-1 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800"},[I(l(Tt),{class:"w-4 h-4"})])]),r("div",Ha,[o[52]||(o[52]=r("span",{class:"font-bold text-sky-400"},"Niche Aktif:",-1)),r("span",Ga,T(l(h).find(c=>c.id===l(w))?.name||"Default"),1),o[53]||(o[53]=r("span",{class:"text-slate-500"},"•",-1)),o[54]||(o[54]=r("span",{class:"font-bold text-emerald-400"},"Bahasa:",-1)),r("span",Ja,T(l(Y).language||"Bahasa Indonesia 🇮🇩"),1),o[55]||(o[55]=r("span",{class:"text-slate-500"},"•",-1)),r("span",qa,T(l(Y).usedCount||0)+" Topik Riwayat Dikecualikan",1)]),r("div",Wa,[r("textarea",{value:l(B),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,Ka)]),r("div",Ya,[o[56]||(o[56]=r("span",{class:"text-[11px] text-slate-400"},[J(" Paste hasil JSON yang kamu buat ke kolom "),r("b",null,"RAW JSON"),J(" SocialGen. ")],-1)),r("button",{onClick:te,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(le)?(_(),pe(l(Ye),{key:0,class:"w-4 h-4 text-emerald-400"})):(_(),pe(l(Ht),{key:1,class:"w-4 h-4"})),r("span",null,T(l(le)?"Prompt Berhasil Disalin!":"Copy Master Prompt"),1)])])])])):U("",!0),r("div",Xa,[r("div",null,[r("h2",Qa,[I(l(ya),{class:"w-3.5 h-3.5 text-sky-400"}),o[57]||(o[57]=J(" Content Studio ",-1))]),o[58]||(o[58]=r("p",{class:"text-[10px] text-slate-400"},"Multi-Format Studio",-1))]),r("div",es,[r("div",ts,[Ne(r("select",{"onUpdate:modelValue":o[6]||(o[6]=c=>Pe(w)?w.value=c: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"},[(_(!0),M(Te,null,Oe(l(h),c=>(_(),M("option",{key:c.id,value:c.id,class:"bg-slate-900 text-white"},T(c.name),9,as))),128))],512),[[qe,l(w)]]),r("button",{onClick:H,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"},[I(l(fa),{class:"w-3 h-3"}),o[59]||(o[59]=r("span",{class:"hidden sm:inline"},"Niche",-1))])]),r("div",ss,[I(l(la),{class:"w-3 h-3 text-emerald-400 ml-1 flex-shrink-0"}),Ne(r("select",{"onUpdate:modelValue":o[7]||(o[7]=c=>Pe(L)?L.value=c: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"},[...o[60]||(o[60]=[We('<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),[[qe,l(L)]])]),r("button",{onClick:ve,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"},[I(l(wt),{class:"w-3 h-3"}),o[61]||(o[61]=r("span",{class:"hidden sm:inline"},"Prompt Manual",-1))]),r("button",{onClick:o[8]||(o[8]=c=>p()),disabled:a.isGenerating||a.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"},[I(l(St),{class:F(["w-3.5 h-3.5",{"animate-spin":a.isAutoTopicLoading}])},null,8,["class"]),r("span",null,T(a.isAutoTopicLoading?"Meriset Data...":"✨ Auto-Topic"),1)],8,ns),r("div",rs,[o[66]||(o[66]=r("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)),r("div",is,[o[63]||(o[63]=r("div",{class:"px-3 py-1 text-[10px] font-bold text-slate-500 uppercase"},"Model AI Engine",-1)),r("div",os,[Ne(r("select",{"onUpdate:modelValue":o[9]||(o[9]=c=>Pe(d)?d.value=c:null),class:"w-full bg-slate-950 border border-slate-700 rounded-lg p-1.5 text-xs text-sky-300 focus:outline-none"},[...o[62]||(o[62]=[r("option",{value:"gemini-3.8-flash"},"⚡ Gemini 3.8 Flash",-1),r("option",{value:"gemini-3.5-flash"},"⚡ Gemini 3.5 Flash",-1),r("option",{value:"gemini-2.5-pro"},"💎 Gemini 2.5 Pro",-1),r("option",{value:"gemini-1.5-pro"},"💎 Gemini 1.5 Pro",-1)])],512),[[qe,l(d)]])]),o[64]||(o[64]=r("div",{class:"border-t border-slate-800 my-1"},null,-1)),o[65]||(o[65]=r("div",{class:"px-3 py-1 text-[10px] font-bold text-slate-500 uppercase"},"Pilih Format Khusus",-1)),r("button",{onClick:o[10]||(o[10]=c=>p(void 0,"table")),class:"px-3 py-1.5 text-left text-sky-300 hover:bg-slate-800"}," 📊 Classic Comparison Table "),r("button",{onClick:o[11]||(o[11]=c=>p(void 0,"versus")),class:"px-3 py-1.5 text-left text-orange-300 hover:bg-slate-800"}," ⚔️ Versus Showdown Arena "),r("button",{onClick:o[12]||(o[12]=c=>p(void 0,"receipt")),class:"px-3 py-1.5 text-left text-teal-300 hover:bg-slate-800"}," 🧾 Monthly Living Invoice "),r("button",{onClick:o[13]||(o[13]=c=>p(void 0,"news")),class:"px-3 py-1.5 text-left text-rose-300 hover:bg-slate-800"}," 📰 Breaking News / Pamphlet "),r("button",{onClick:o[14]||(o[14]=c=>p(void 0,"stat")),class:"px-3 py-1.5 text-left text-amber-300 hover:bg-slate-800"}," 🎯 Big Shocking Number "),r("button",{onClick:o[15]||(o[15]=c=>p(void 0,"timeline")),class:"px-3 py-1.5 text-left text-yellow-300 hover:bg-slate-800"}," ⏳ 10-Year Shift (Then vs Now) "),r("button",{onClick:o[16]||(o[16]=c=>p(void 0,"barchart")),class:"px-3 py-1.5 text-left text-cyan-300 hover:bg-slate-800"}," 📈 Income Allocation Bars "),r("button",{onClick:o[17]||(o[17]=c=>p(void 0,"list")),class:"px-3 py-1.5 text-left text-emerald-300 hover:bg-slate-800"}," 🏆 Top 5 Ranked Countdown "),r("button",{onClick:o[18]||(o[18]=c=>p(void 0,"quote")),class:"px-3 py-1.5 text-left text-purple-300 hover:bg-slate-800"}," 💬 Hot Take / Quote Debate "),r("button",{onClick:o[19]||(o[19]=c=>p(void 0,"leaderboard")),class:"px-3 py-1.5 text-left text-yellow-400 hover:bg-slate-800 font-bold"}," 🥇 Multi-Country Leaderboard (Top 10) "),r("button",{onClick:o[20]||(o[20]=c=>p(void 0,"editorial")),class:"px-3 py-1.5 text-left text-sky-400 hover:bg-slate-800 font-bold"}," 📰 Editorial Storytelling Deep Dive "),r("button",{onClick:o[21]||(o[21]=c=>p(void 0,"matrix")),class:"px-3 py-1.5 text-left text-teal-300 hover:bg-slate-800 font-bold"}," 📊 Multi-Column Matrix (3-4 Negara) "),r("button",{onClick:o[22]||(o[22]=c=>p(void 0,"debate")),class:"px-3 py-1.5 text-left text-rose-400 hover:bg-slate-800 font-bold"}," ⚡ Debate Arena (Pro vs Kontra) "),r("button",{onClick:o[23]||(o[23]=c=>p(void 0,"tierlist")),class:"px-3 py-1.5 text-left text-amber-300 hover:bg-slate-800 font-bold"}," 🎖️ Tier List Ranking (S, A, B, C) ")])])])]),a.isAutoTopicLoading?(_(),M("div",ls,[r("div",ds,[I(l(St),{class:"w-3.5 h-3.5 text-sky-400 animate-spin"})]),r("div",us,[r("div",cs,[o[67]||(o[67]=r("span",null,"AI Research Engine Sedang Bekerja...",-1)),r("span",fs,T(l(d)),1)]),o[68]||(o[68]=r("p",{class:"text-[10px] text-slate-300 mt-0.5"},"Menganalisis angka perbandingan 2026 & meracik copywriting viral.",-1))])])):U("",!0),r("div",ps,[r("div",hs,[r("button",{onClick:o[24]||(o[24]=c=>g.value="editor"),class:F(["px-2.5 py-1 rounded-lg transition text-[11px]",l(g)==="editor"?"bg-slate-800 text-sky-400 shadow font-bold":"text-slate-400 hover:text-white"])}," JSON Editor ",2),r("button",{onClick:o[25]||(o[25]=c=>g.value="drafts"),class:F(["px-2.5 py-1 rounded-lg transition flex items-center gap-1 text-[11px]",l(g)==="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"},[I(l(kt),{class:"w-3 h-3"}),r("span",null,"Drafts ("+T(a.drafts.length)+")",1)],2),r("button",{onClick:o[26]||(o[26]=c=>g.value="history"),class:F(["px-2.5 py-1 rounded-lg transition flex items-center gap-1 text-[11px]",l(g)==="history"?"bg-slate-800 text-purple-400 shadow font-bold":"text-slate-400 hover:text-white"]),title:"Riwayat otomatis setiap kali generate"},[I(l(_t),{class:"w-3 h-3"}),r("span",null,"Riwayat ("+T(a.history.length)+")",1)],2)]),r("div",ms,[l(g)==="history"&&a.history.length>0?(_(),M("button",{key:0,onClick:Xt,class:"text-[10px] text-rose-400 hover:text-rose-300 transition font-bold pr-1",title:"Bersihkan semua riwayat generate"}," Bersihkan Riwayat ")):U("",!0),r("button",{onClick:o[27]||(o[27]=c=>s("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"},[I(l(kt),{class:"w-3 h-3"}),o[69]||(o[69]=r("span",null,"+ Simpan ke Draft",-1))])])]),l(g)==="drafts"?(_(),M("div",vs,[a.drafts.length===0?(_(),M("div",gs,[...o[70]||(o[70]=[J(" Belum ada draft tersimpan.",-1),r("br",null,null,-1),J(" Klik ",-1),r("b",{class:"text-amber-400"},"+ Simpan ke Draft",-1),J(" di atas untuk menyimpan konten ini agar bisa diedit/digenerate nanti! ",-1)])])):U("",!0),(_(!0),M(Te,null,Oe(a.drafts,(c,se)=>(_(),M("div",{key:se,onClick:ge=>s("selectDraft",se),class:F(["p-2 rounded-xl border cursor-pointer transition flex items-center justify-between text-xs group",a.activeDraftIndex===se?"bg-amber-500/15 border-amber-500/50 text-white":"bg-slate-950/60 border-slate-800 text-slate-300 hover:border-slate-700"])},[r("div",ys,[r("div",bs,[r("span",ks,T(c.layoutType||"table"),1),r("span",_s,T(c.category),1)]),r("div",ws,T(c.title),1)]),r("button",{onClick:yt(ge=>s("deleteDraft",se),["stop"]),class:"opacity-0 group-hover:opacity-100 p-1 text-slate-400 hover:text-rose-400 transition rounded",title:"Hapus draft ini"},[I(l(ot),{class:"w-3.5 h-3.5"})],8,Ss)],10,xs))),128))])):l(g)==="history"?(_(),M("div",Cs,[a.history.length===0?(_(),M("div",Ts,[...o[71]||(o[71]=[J(" Belum ada riwayat pembuatan.",-1),r("br",null,null,-1),J(" Setiap kali kamu klik ",-1),r("b",{class:"text-sky-400"},"GENERATE CONTENT",-1),J(", hasil pembuatan akan otomatis tercatat di sini! ",-1)])])):U("",!0),(_(!0),M(Te,null,Oe(a.history,(c,se)=>(_(),M("div",{key:se,onClick:ge=>s("selectHistory",se),class:F(["p-2 rounded-xl border cursor-pointer transition flex items-center justify-between text-xs group",a.activeHistoryIndex===se?"bg-purple-500/15 border-purple-500/50 text-white":"bg-slate-950/60 border-slate-800 text-slate-300 hover:border-slate-700"])},[r("div",Ms,[r("div",Ns,[r("span",$s,T(c.layoutType||"reels"),1),r("span",As,T(c.category),1),c.generatedAt?(_(),M("span",Is,T(Qt(c.generatedAt)),1)):U("",!0)]),r("div",Rs,T(c.title),1)]),r("button",{onClick:yt(ge=>s("deleteHistory",se),["stop"]),class:"opacity-0 group-hover:opacity-100 p-1 text-slate-400 hover:text-rose-400 transition rounded",title:"Hapus riwayat ini"},[I(l(ot),{class:"w-3.5 h-3.5"})],8,js)],10,Os))),128))])):(_(),M("div",Vs,[r("div",Es,[r("div",null,[r("label",Ds,[I(l(da),{class:"w-3 h-3 text-sky-400"}),o[72]||(o[72]=J(" Format Template ",-1))]),r("select",{value:a.modelValue.layoutType||"table",onChange:o[28]||(o[28]=c=>He(c.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]"},[...o[73]||(o[73]=[We('<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>',14)])],40,Ps)]),r("div",null,[o[75]||(o[75]=r("label",{class:"block text-[10px] font-bold text-slate-300 mb-1"}," Theme Color (10 Pilihan) ",-1)),r("select",{value:a.modelValue.theme||"blue-tech",onChange:o[29]||(o[29]=c=>Ge(c.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]"},[...o[74]||(o[74]=[We('<option value="blue-tech">🔵 Blue Tech (AI & Software)</option><option value="emerald-finance">🟢 Emerald Finance (Salaries & Living)</option><option value="slate-education">🟣 Slate Education (Education & 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 & Executive)</option><option value="cyber-violet">🟪 Cyber Violet (Synthwave & 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,Zs)]),r("div",Ls,[r("div",zs,[o[76]||(o[76]=r("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"}," Watermark Handle ",-1)),r("input",{type:"text",value:a.modelValue.watermark||"@SocialGen",onInput:o[30]||(o[30]=c=>nt(c.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,Fs)]),r("div",Bs,[o[77]||(o[77]=r("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"}," Judul Konten (Title) ",-1)),r("input",{type:"text",value:a.modelValue.title,onInput:o[31]||(o[31]=c=>rt(c.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,Us)])])]),r("div",Hs,[r("div",Gs,[o[80]||(o[80]=r("span",{class:"font-bold text-slate-300 text-[10px]"},"RAW JSON SocialGen",-1)),a.isValid&&!l(i)?(_(),M("span",Js,[I(l(ra),{class:"w-2.5 h-2.5"}),o[78]||(o[78]=J(" Valid ",-1))])):(_(),M("span",qs,[I(l(na),{class:"w-2.5 h-2.5"}),o[79]||(o[79]=J(" Invalid ",-1))]))]),r("button",{onClick:st,class:"text-[10px] text-slate-400 hover:text-sky-400 transition"}," Format JSON ")]),r("div",Ws,[r("textarea",{value:l(n),onInput:Ue,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..."},null,40,Ks),l(i)||a.validationError?(_(),M("p",Ys," ⚠️ "+T(l(i)||a.validationError),1)):U("",!0)])])),r("input",{type:"file",ref_key:"videoInputRef",ref:P,accept:"video/mp4,video/webm",class:"hidden",onChange:o[32]||(o[32]=c=>Be(c))},null,544),r("input",{type:"file",ref_key:"audioInputRef",ref:ze,accept:"audio/mp3,audio/mpeg,audio/wav",class:"hidden",onChange:o[33]||(o[33]=c=>Be(c))},null,544),r("div",Xs,[r("div",Qs,[r("div",en,[r("label",tn,[I(l(Gt),{class:"w-3.5 h-3.5 text-sky-400"}),o[81]||(o[81]=r("span",null,"Background",-1))]),r("div",an,[r("select",{value:a.options.backgroundSource||"random",onChange:o[34]||(o[34]=c=>fe("backgroundSource",c.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]"},[o[82]||(o[82]=r("option",{value:"random"},"🔀 Acak Video",-1)),(_(!0),M(Te,null,Oe(l(ce),c=>(_(),M("option",{key:c,value:c},T(c.replace(".mp4","").replace(/_/g," ")),9,nn))),128)),o[83]||(o[83]=r("option",{value:"pexels"},"🌐 Pexels API (Auto HD)",-1))],40,sn),r("button",{onClick:o[35]||(o[35]=c=>l(P)?.click()),disabled:l(ie),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"},[I(l(Ct),{class:"w-3 h-3"}),r("span",on,T(l(ie)?"...":"Upload"),1)],8,rn)])]),r("div",ln,[r("span",dn,[I(l(ut),{class:"w-2.5 h-2.5"}),J(" Mulai: "+T(Math.min(a.options.videoStartOffset||0,l(C)))+"s / "+T(l(Ce))+"s ",1)]),r("input",{type:"range",min:"0",max:l(C),step:"1",value:Math.min(a.options.videoStartOffset||0,l(C)),onInput:o[36]||(o[36]=c=>fe("videoStartOffset",Number(c.target.value))),class:"w-32 h-1 bg-slate-950 rounded appearance-none cursor-pointer accent-sky-400"},null,40,un)])]),r("div",cn,[r("div",fn,[r("label",pn,[I(l(Jt),{class:"w-3.5 h-3.5 text-purple-400"}),o[84]||(o[84]=r("span",null,"Musik Reels",-1))]),r("div",hn,[r("select",{value:a.options.musicFile||"random",onChange:o[37]||(o[37]=c=>fe("musicFile",c.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]"},[o[85]||(o[85]=r("option",{value:"random"},"🔀 Acak Musik",-1)),(_(!0),M(Te,null,Oe(l(X),c=>(_(),M("option",{key:c,value:c},T(c.replace(".mp3","").replace(/_/g," ")),9,vn))),128))],40,mn),r("button",{onClick:o[38]||(o[38]=c=>l(ze)?.click()),disabled:l(ie),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"},[I(l(Ct),{class:"w-3 h-3"}),r("span",xn,T(l(ie)?"...":"Upload"),1)],8,gn)])]),r("div",yn,[r("span",bn,[I(l(ut),{class:"w-2.5 h-2.5"}),J(" Mulai: "+T(Math.min(a.options.audioStartOffset||0,l(ee)))+"s / "+T(l(y))+"s ",1)]),r("input",{type:"range",min:"0",max:l(ee),step:"1",value:Math.min(a.options.audioStartOffset||0,l(ee)),onInput:o[39]||(o[39]=c=>fe("audioStartOffset",Number(c.target.value))),class:"w-32 h-1 bg-slate-950 rounded appearance-none cursor-pointer accent-purple-400"},null,40,kn)])]),r("div",_n,[r("label",wn,[I(l(_t),{class:"w-3.5 h-3.5 text-emerald-400"}),o[86]||(o[86]=r("span",null,"Durasi Reels:",-1))]),r("div",Sn,[(_(),M(Te,null,Oe([7,10,15,30,60],c=>r("button",{key:c,onClick:se=>it(c),class:F(["px-2 py-0.5 text-[10px] font-bold rounded-lg border transition",(a.modelValue.reelsDuration||30)===c?"bg-emerald-500/20 border-emerald-500/60 text-emerald-300":"bg-slate-950 border-slate-800 text-slate-400 hover:text-white"])},T(c===60?"1m":c+"s"),11,Cn)),64))])]),r("div",Tn,[r("label",{class:F(["flex items-center gap-1.5 p-1.5 rounded-xl border text-[11px] cursor-pointer transition select-none",a.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"])},[r("input",{type:"checkbox",checked:a.options.outputs?.feed!==!1,onChange:o[40]||(o[40]=c=>S("feed",c.target.checked)),class:"rounded text-sky-500 focus:ring-0 bg-slate-900 border-slate-700 w-3 h-3"},null,40,On),o[87]||(o[87]=r("span",{class:"font-bold"},"Feed 4:5",-1))],2),r("label",{class:F(["flex items-center gap-1.5 p-1.5 rounded-xl border text-[11px] cursor-pointer transition select-none",a.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"])},[r("input",{type:"checkbox",checked:a.options.outputs?.story!==!1,onChange:o[41]||(o[41]=c=>S("story",c.target.checked)),class:"rounded text-indigo-500 focus:ring-0 bg-slate-900 border-slate-700 w-3 h-3"},null,40,Mn),o[88]||(o[88]=r("span",{class:"font-bold"},"Story 9:16",-1))],2),r("label",{class:F(["flex items-center gap-1.5 p-1.5 rounded-xl border text-[11px] cursor-pointer transition select-none",a.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"])},[r("input",{type:"checkbox",checked:a.options.outputs?.reels!==!1,onChange:o[42]||(o[42]=c=>S("reels",c.target.checked)),class:"rounded text-emerald-500 focus:ring-0 bg-slate-900 border-slate-700 w-3 h-3"},null,40,Nn),o[89]||(o[89]=r("span",{class:"font-bold"},"Reels MP4",-1))],2)])]),r("button",{onClick:o[43]||(o[43]=c=>s("generate")),disabled:!a.isValid||a.isGenerating||!!l(i),class:F(["w-full py-3 px-4 rounded-xl font-black text-xs tracking-wide shadow-xl transition flex items-center justify-center gap-2",[!a.isValid||a.isGenerating||l(i)?"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]"]])},[a.isGenerating?(_(),pe(l(pa),{key:0,class:"w-3.5 h-3.5 animate-spin"})):(_(),pe(l(qt),{key:1,class:"w-3.5 h-3.5 fill-current"})),r("span",null,T(a.isGenerating?a.generateStage||"Rendering Content...":"GENERATE CONTENT"),1)],10,$n)]))}}),In={class:"flex flex-col gap-2.5 h-full text-slate-100 min-h-0 justify-between"},Rn={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"},jn={class:"flex items-center gap-1 bg-slate-950 p-1 rounded-xl border border-slate-800 text-xs font-bold"},Vn={key:0,class:"w-1.5 h-1.5 rounded-full bg-white animate-pulse"},En={class:"flex items-center gap-2 text-xs"},Dn={class:"flex items-center gap-1 bg-slate-950 p-1 rounded-xl border border-slate-800 text-xs shadow-inner"},Pn={key:0,class:"relative shadow-2xl rounded-2xl overflow-hidden border border-slate-700/80 flex-shrink-0",style:{width:"360px",height:"450px"}},Zn={style:{width:"1080px",height:"1350px",transform:"scale(0.333333)","transform-origin":"top left"}},Ln={key:1,class:"relative shadow-2xl rounded-2xl overflow-hidden border border-slate-700/80 flex-shrink-0",style:{width:"300px",height:"533.33px"}},zn={key:0,class:"absolute inset-0 z-0 bg-slate-950 overflow-hidden"},Fn=["src"],Bn=["src","muted"],Un={class:"relative z-10 pointer-events-none",style:{width:"1080px",height:"1920px",transform:"scale(0.277778)","transform-origin":"top left"}},Hn={key:1,class:"absolute inset-0 z-20 pointer-events-none flex flex-col justify-between"},Gn={class:"flex-1 flex justify-end p-2"},Jn={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"},qn={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"},Wn={class:"flex items-center justify-between gap-3"},Kn=["title"],Yn={class:"text-[11px] hidden sm:inline"},Xn={class:"flex-1 flex items-center gap-2"},Qn=["max","value"],er={class:"font-mono text-[11px] font-bold text-slate-300 min-w-[75px] text-right"},tr=["title"],ar={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"},sr={class:"flex flex-col gap-1.5"},nr={class:"flex items-center justify-between text-[11px]"},rr={class:"font-bold text-sky-300 flex items-center gap-1"},ir=["max","value"],or={class:"text-[9px] text-slate-500"},lr={class:"flex flex-col gap-1.5"},dr={class:"flex items-center justify-between text-[11px]"},ur={class:"font-bold text-purple-300 flex items-center gap-1"},cr=["max","value"],fr={class:"text-[9px] text-slate-500"},pr={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"},hr={class:"flex items-center justify-between text-xs"},mr=["value"],vr={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"},gr={class:"flex items-center gap-2 text-xs font-black text-emerald-300"},xr={class:"text-[11px] text-slate-400 font-mono mt-0.5"},yr={class:"flex items-center gap-2"},br=["href"],kr=["disabled"],_r=vt({__name:"LivePreview",props:{data:{},selectedVideo:{},selectedMusic:{},videoStartOffset:{default:0},audioStartOffset:{default:0},generatedResult:{}},emits:["update:videoStartOffset","update:audioStartOffset"],setup(a,{emit:e}){const t=a,s=e,n={"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},i=he(()=>t.selectedVideo&&t.selectedVideo!=="pexels"&&t.selectedVideo!=="random"?`/api/stream/videos/${t.selectedVideo}`:"/api/stream/videos/default_bg.mp4"),u=he(()=>t.selectedMusic&&t.selectedMusic!=="random"?`/api/stream/audio/${t.selectedMusic}`:"/api/stream/audio/lofi_viral_study.mp3"),d=O("feed"),g=O(!1),h=O(!1),w=O(!1),K=O(!1),Z=O(1),A=O(null),j=O(null),H=O(!0),W=O(!1),ne=O(0),ue=he(()=>t.data.reelsDuration||30),L=O(n[t.selectedVideo||""]||8),G=O(n[t.selectedMusic||""]||30),B=he(()=>Math.max(1,Math.floor(L.value-1))),Y=he(()=>Math.max(1,Math.floor(G.value-1)));function ae(){Z.value<2.5&&(Z.value=Math.min(2.5,+(Z.value+.15).toFixed(2)))}function le(){Z.value>.5&&(Z.value=Math.max(.5,+(Z.value-.15).toFixed(2)))}function ce(){Z.value=1}function X(S){(S.ctrlKey||S.metaKey)&&(S.preventDefault(),S.deltaY<0?ae():le())}function ye(){H.value?C():Ce()}function Ce(){H.value=!0,A.value&&A.value.play().catch(()=>{}),j.value&&(j.value.muted=W.value,j.value.volume=.85,j.value.play().catch(()=>{}))}function C(){H.value=!1,A.value&&A.value.pause(),j.value&&j.value.pause()}function y(){if(W.value=!W.value,j.value)if(j.value.muted=W.value,j.value.volume=.85,!W.value&&H.value){const S=t.audioStartOffset||0;j.value.currentTime=S+ne.value%Math.max(1,G.value-S),j.value.play().catch(()=>{})}else j.value.pause()}function ee(S){const p=S.target;p&&p.duration&&!isNaN(p.duration)&&isFinite(p.duration)&&(L.value=Math.max(1,Math.floor(p.duration)),t.videoStartOffset&&t.videoStartOffset>=L.value&&s("update:videoStartOffset",Math.max(0,L.value-2))),A.value&&(A.value.currentTime=Math.min(t.videoStartOffset||0,B.value),H.value&&A.value.play().catch(()=>{}))}function ie(S){const p=S.target;p&&p.duration&&!isNaN(p.duration)&&isFinite(p.duration)&&(G.value=Math.max(1,Math.floor(p.duration)),t.audioStartOffset&&t.audioStartOffset>=G.value&&s("update:audioStartOffset",Math.max(0,G.value-2))),j.value&&(j.value.muted=W.value,j.value.volume=.85,j.value.currentTime=Math.min(t.audioStartOffset||0,Y.value),H.value&&!W.value&&j.value.play().catch(()=>{}))}function P(){if(!A.value)return;const S=Math.min(t.videoStartOffset||0,B.value);A.value.currentTime=S,H.value&&A.value.play().catch(()=>{})}function ze(){if(!j.value)return;const S=Math.min(t.audioStartOffset||0,Y.value);j.value.currentTime=S,H.value&&!W.value&&j.value.play().catch(()=>{})}function Fe(){if(!A.value)return;const S=Math.min(t.videoStartOffset||0,B.value),p=L.value;A.value.currentTime>=p-.25&&(A.value.currentTime=S,H.value&&A.value.play().catch(()=>{})),ne.value=Math.min(ne.value+.1,ue.value),ne.value>=ue.value&&(ne.value=0)}function Be(){if(!j.value)return;const S=Math.min(t.audioStartOffset||0,Y.value),p=G.value;j.value.currentTime>=p-.25&&(j.value.currentTime=S,H.value&&!W.value&&j.value.play().catch(()=>{}))}function Ue(S){ne.value=S;const p=Math.min(t.videoStartOffset||0,B.value),ve=Math.min(t.audioStartOffset||0,Y.value);if(A.value){const te=p+S%Math.max(1,L.value-p);A.value.currentTime=Math.min(te,L.value-.1)}if(j.value){const te=ve+S%Math.max(1,G.value-ve);j.value.currentTime=Math.min(te,G.value-.1)}}function st(S){const p=Number(S.target.value);Ue(p)}de(()=>t.videoStartOffset,S=>{const p=Math.min(S||0,B.value);A.value&&(A.value.currentTime=p)}),de(()=>t.audioStartOffset,S=>{const p=Math.min(S||0,Y.value);j.value&&(j.value.currentTime=p)});function He(S){const p=Math.min(S,B.value);s("update:videoStartOffset",p),A.value&&(A.value.currentTime=p)}function nt(S){const p=Math.min(S,Y.value);s("update:audioStartOffset",p),j.value&&(j.value.currentTime=p)}function rt(){if(A.value){const S=Math.min(Math.floor(A.value.currentTime),B.value);He(S)}}function Ge(S){const p=Math.floor(S/60),ve=Math.floor(S%60);return`${p.toString().padStart(2,"0")}:${ve.toString().padStart(2,"0")}`}function it(){t.data.caption&&(navigator.clipboard.writeText(t.data.caption),w.value=!0,setTimeout(()=>{w.value=!1},2e3))}async function fe(){if(t.generatedResult){K.value=!0;try{await $fetch("/api/open-folder",{method:"POST",body:{jobId:t.generatedResult.jobId,resultDir:t.generatedResult.resultDir}})}catch(S){console.error("Failed to open folder:",S)}finally{K.value=!1}}}return de(()=>i.value,()=>{const S=t.selectedVideo||"";n[S]&&(L.value=n[S]),bt(()=>{Ue(0)})}),de(()=>u.value,()=>{const S=t.selectedMusic||"";n[S]&&(G.value=n[S])}),de(()=>d.value,S=>{S==="reels"?bt(()=>{H.value&&Ce()}):j.value&&j.value.pause()}),(S,p)=>{const ve=ta;return _(),M("div",In,[r("div",Rn,[r("div",jn,[r("button",{onClick:p[0]||(p[0]=te=>d.value="feed"),class:F(["px-3 py-1.5 rounded-lg transition",l(d)==="feed"?"bg-sky-500 text-white shadow-md":"text-slate-400 hover:text-white"])}," Feed 4:5 ",2),r("button",{onClick:p[1]||(p[1]=te=>d.value="story"),class:F(["px-3 py-1.5 rounded-lg transition",l(d)==="story"?"bg-indigo-500 text-white shadow-md":"text-slate-400 hover:text-white"])}," Story 9:16 ",2),r("button",{onClick:p[2]||(p[2]=te=>d.value="reels"),class:F(["px-3 py-1.5 rounded-lg transition flex items-center gap-1.5",l(d)==="reels"?"bg-emerald-500 text-white shadow-md":"text-slate-400 hover:text-white"])},[p[8]||(p[8]=r("span",null,"Reels 9:16 (Video)",-1)),l(d)==="reels"&&l(H)?(_(),M("span",Vn)):U("",!0)],2)]),r("div",En,[r("div",Dn,[r("button",{onClick:le,title:"Zoom Out (-15%)",class:"p-1.5 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800 transition"},[I(l(ka),{class:"w-3.5 h-3.5"})]),r("button",{onClick:ce,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"},T(Math.round(l(Z)*100))+"% ",1),r("button",{onClick:ae,title:"Zoom In (+15%)",class:"p-1.5 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800 transition"},[I(l(ba),{class:"w-3.5 h-3.5"})]),l(Z)!==1?(_(),M("button",{key:0,onClick:ce,title:"Reset ke Ukuran Pas",class:"p-1.5 rounded-lg text-amber-400 hover:bg-slate-800 transition"},[I(l(ha),{class:"w-3.5 h-3.5"})])):U("",!0)]),l(d)!=="feed"?(_(),M("button",{key:0,onClick:p[3]||(p[3]=te=>g.value=!l(g)),class:F(["inline-flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border text-xs font-bold transition",l(g)?"bg-amber-500/20 text-amber-300 border-amber-500/50":"bg-slate-950 text-slate-400 border-slate-800"])},[I(l(va),{class:"w-3.5 h-3.5"}),p[9]||(p[9]=r("span",{class:"hidden sm:inline"},"Safe Zones",-1))],2)):U("",!0)])]),r("div",{onWheel:X,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"},[r("div",{class:"transition-transform duration-200 ease-out origin-center flex-shrink-0",style:ea({transform:`scale(${l(Z)})`})},[l(d)==="feed"?(_(),M("div",Pn,[r("div",Zn,[I(ve,{data:a.data,mode:"feed","is-render":!0},null,8,["data"])])])):(_(),M("div",Ln,[l(d)==="reels"?(_(),M("div",zn,[(_(),M("video",{ref_key:"videoElement",ref:A,key:l(i),autoplay:"",muted:"",playsinline:"",class:"w-full h-full object-cover brightness-90 contrast-105",src:l(i),onLoadedmetadata:ee,onTimeupdate:Fe,onEnded:P},null,40,Fn)),p[10]||(p[10]=r("div",{class:"absolute inset-0 bg-slate-950/30 backdrop-blur-[0.5px]"},null,-1)),(_(),M("audio",{ref_key:"audioElement",ref:j,key:l(u),src:l(u),muted:l(W),onLoadedmetadata:ie,onTimeupdate:Be,onEnded:ze},null,40,Bn))])):U("",!0),r("div",Un,[I(ve,{data:a.data,mode:l(d)==="reels"?"overlay":"story","is-render":!0},null,8,["data","mode"])]),l(g)?(_(),M("div",Hn,[p[12]||(p[12]=r("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)),r("div",Gn,[l(d)==="reels"?(_(),M("div",Jn,[...p[11]||(p[11]=[r("span",null,"❤️ Like",-1),r("span",null,"💬 Comm",-1),r("span",null,"↗️ Share",-1)])])):U("",!0)]),p[13]||(p[13]=r("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))])):U("",!0)]))],4)],32),l(d)==="reels"?(_(),M("div",qn,[r("div",Wn,[r("button",{onClick:ye,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(H)?"Pause Preview":"Putar Preview"},[l(H)?(_(),pe(l(ua),{key:0,class:"w-3.5 h-3.5 fill-current"})):(_(),pe(l(qt),{key:1,class:"w-3.5 h-3.5 fill-current"})),r("span",Yn,T(l(H)?"Pause":"Play"),1)],8,Kn),r("div",Xn,[r("input",{type:"range",min:"0",max:l(ue),step:"0.1",value:l(ne),onInput:st,class:"flex-1 h-1.5 bg-slate-950 rounded-lg appearance-none cursor-pointer accent-emerald-500 hover:accent-emerald-400"},null,40,Qn),r("span",er,T(Ge(l(ne)))+" / "+T(Ge(l(ue))),1)]),r("button",{onClick:y,class:F(["px-2.5 py-2 rounded-xl border transition flex items-center gap-1.5 font-bold text-[11px]",l(W)?"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(W)?"Aktifkan Suara Musik (Unmute)":"Matikan Suara Musik (Mute)"},[l(W)?(_(),pe(l(xa),{key:1,class:"w-3.5 h-3.5"})):(_(),pe(l(ga),{key:0,class:"w-3.5 h-3.5 text-purple-300 animate-pulse"})),r("span",null,T(l(W)?"Muted":"Audio ON"),1)],10,tr),r("button",{onClick:p[4]||(p[4]=te=>h.value=!l(h)),class:F(["px-2.5 py-2 rounded-xl border text-[11px] font-bold flex items-center gap-1.5 transition",l(h)?"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"},[I(l(ut),{class:"w-3.5 h-3.5 text-sky-400"}),p[14]||(p[14]=r("span",{class:"hidden sm:inline"},"Trim Offset",-1))],2)]),l(h)?(_(),M("div",ar,[r("div",sr,[r("div",nr,[r("span",rr,[I(l(Gt),{class:"w-3 h-3"}),J(" Mulai Video: "+T(Math.min(a.videoStartOffset||0,l(B)))+"s / "+T(l(L))+"s ",1)]),r("button",{onClick:rt,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 ")]),r("input",{type:"range",min:"0",max:l(B),step:"1",value:Math.min(a.videoStartOffset||0,l(B)),onInput:p[5]||(p[5]=te=>He(Number(te.target.value))),class:"w-full h-1 bg-slate-900 rounded appearance-none cursor-pointer accent-sky-400"},null,40,ir),r("div",or," Maksimal offset: "+T(l(B))+" detik (panjang asli video: "+T(l(L))+"s) ",1)]),r("div",lr,[r("div",dr,[r("span",ur,[I(l(Jt),{class:"w-3 h-3"}),J(" Mulai Musik: "+T(Math.min(a.audioStartOffset||0,l(Y)))+"s / "+T(l(G))+"s ",1)]),p[15]||(p[15]=r("span",{class:"text-[10px] text-slate-500 font-mono"}," (Skip intro) ",-1))]),r("input",{type:"range",min:"0",max:l(Y),step:"1",value:Math.min(a.audioStartOffset||0,l(Y)),onInput:p[6]||(p[6]=te=>nt(Number(te.target.value))),class:"w-full h-1 bg-slate-900 rounded appearance-none cursor-pointer accent-purple-400"},null,40,cr),r("div",fr," Maksimal offset: "+T(l(Y))+" detik (panjang asli musik: "+T(l(G))+"s) ",1)])])):U("",!0)])):U("",!0),r("div",pr,[r("div",hr,[p[16]||(p[16]=r("span",{class:"font-extrabold text-slate-300 text-[11px]"},"VIRAL CAPTION & HASHTAGS",-1)),r("button",{onClick:it,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(w)?(_(),pe(l(Ye),{key:0,class:"w-3.5 h-3.5 text-emerald-400"})):(_(),pe(l(Ht),{key:1,class:"w-3.5 h-3.5"})),r("span",null,T(l(w)?"Tersalin!":"Copy Caption"),1)])]),r("textarea",{value:a.data.caption,onInput:p[7]||(p[7]=te=>a.data.caption=te.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,mr)]),a.generatedResult?(_(),M("div",vr,[r("div",null,[r("div",gr,[I(l(Ye),{class:"w-4 h-4 text-emerald-400"}),J(" Render Selesai ("+T((a.generatedResult.durationMs/1e3).toFixed(1))+"s) ",1)]),r("div",xr,T(a.generatedResult.jobId),1)]),r("div",yr,[r("a",{href:`/api/download?jobId=${a.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"},[I(l(ia),{class:"w-3.5 h-3.5"}),p[17]||(p[17]=r("span",null,"Download ZIP",-1))],8,br),r("button",{onClick:fe,disabled:l(K),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"},[I(l(oa),{class:"w-3.5 h-3.5 text-amber-400"}),p[18]||(p[18]=r("span",null,"Open Folder",-1))],8,kr)])])):U("",!0)])}}});var E;(function(a){a.assertEqual=n=>{};function e(n){}a.assertIs=e;function t(n){throw new Error}a.assertNever=t,a.arrayToEnum=n=>{const i={};for(const u of n)i[u]=u;return i},a.getValidEnumValues=n=>{const i=a.objectKeys(n).filter(d=>typeof n[n[d]]!="number"),u={};for(const d of i)u[d]=n[d];return a.objectValues(u)},a.objectValues=n=>a.objectKeys(n).map(function(i){return n[i]}),a.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const i=[];for(const u in n)Object.prototype.hasOwnProperty.call(n,u)&&i.push(u);return i},a.find=(n,i)=>{for(const u of n)if(i(u))return u},a.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function s(n,i=" | "){return n.map(u=>typeof u=="string"?`'${u}'`:u).join(i)}a.joinValues=s,a.jsonStringifyReplacer=(n,i)=>typeof i=="bigint"?i.toString():i})(E||(E={}));var Ot;(function(a){a.mergeShapes=(e,t)=>({...e,...t})})(Ot||(Ot={}));const b=E.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),be=a=>{switch(typeof a){case"undefined":return b.undefined;case"string":return b.string;case"number":return Number.isNaN(a)?b.nan:b.number;case"boolean":return b.boolean;case"function":return b.function;case"bigint":return b.bigint;case"symbol":return b.symbol;case"object":return Array.isArray(a)?b.array:a===null?b.null:a.then&&typeof a.then=="function"&&a.catch&&typeof a.catch=="function"?b.promise:typeof Map<"u"&&a instanceof Map?b.map:typeof Set<"u"&&a instanceof Set?b.set:typeof Date<"u"&&a instanceof Date?b.date:b.object;default:return b.unknown}},f=E.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 xe extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};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(i){return i.message},s={_errors:[]},n=i=>{for(const u of i.issues)if(u.code==="invalid_union")u.unionErrors.map(n);else if(u.code==="invalid_return_type")n(u.returnTypeError);else if(u.code==="invalid_arguments")n(u.argumentsError);else if(u.path.length===0)s._errors.push(t(u));else{let d=s,g=0;for(;g<u.path.length;){const h=u.path[g];g===u.path.length-1?(d[h]=d[h]||{_errors:[]},d[h]._errors.push(t(u))):d[h]=d[h]||{_errors:[]},d=d[h],g++}}};return n(this),s}static assert(e){if(!(e instanceof xe))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,E.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},s=[];for(const n of this.issues)if(n.path.length>0){const i=n.path[0];t[i]=t[i]||[],t[i].push(e(n))}else s.push(e(n));return{formErrors:s,fieldErrors:t}}get formErrors(){return this.flatten()}}xe.create=a=>new xe(a);const ct=(a,e)=>{let t;switch(a.code){case f.invalid_type:a.received===b.undefined?t="Required":t=`Expected ${a.expected}, received ${a.received}`;break;case f.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(a.expected,E.jsonStringifyReplacer)}`;break;case f.unrecognized_keys:t=`Unrecognized key(s) in object: ${E.joinValues(a.keys,", ")}`;break;case f.invalid_union:t="Invalid input";break;case f.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${E.joinValues(a.options)}`;break;case f.invalid_enum_value:t=`Invalid enum value. Expected ${E.joinValues(a.options)}, received '${a.received}'`;break;case f.invalid_arguments:t="Invalid function arguments";break;case f.invalid_return_type:t="Invalid function return type";break;case f.invalid_date:t="Invalid date";break;case f.invalid_string:typeof a.validation=="object"?"includes"in a.validation?(t=`Invalid input: must include "${a.validation.includes}"`,typeof a.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${a.validation.position}`)):"startsWith"in a.validation?t=`Invalid input: must start with "${a.validation.startsWith}"`:"endsWith"in a.validation?t=`Invalid input: must end with "${a.validation.endsWith}"`:E.assertNever(a.validation):a.validation!=="regex"?t=`Invalid ${a.validation}`:t="Invalid";break;case f.too_small:a.type==="array"?t=`Array must contain ${a.exact?"exactly":a.inclusive?"at least":"more than"} ${a.minimum} element(s)`:a.type==="string"?t=`String must contain ${a.exact?"exactly":a.inclusive?"at least":"over"} ${a.minimum} character(s)`:a.type==="number"?t=`Number must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${a.minimum}`:a.type==="bigint"?t=`Number must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${a.minimum}`:a.type==="date"?t=`Date must be ${a.exact?"exactly equal to ":a.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(a.minimum))}`:t="Invalid input";break;case f.too_big:a.type==="array"?t=`Array must contain ${a.exact?"exactly":a.inclusive?"at most":"less than"} ${a.maximum} element(s)`:a.type==="string"?t=`String must contain ${a.exact?"exactly":a.inclusive?"at most":"under"} ${a.maximum} character(s)`:a.type==="number"?t=`Number must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:a.type==="bigint"?t=`BigInt must be ${a.exact?"exactly":a.inclusive?"less than or equal to":"less than"} ${a.maximum}`:a.type==="date"?t=`Date must be ${a.exact?"exactly":a.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(a.maximum))}`:t="Invalid input";break;case f.custom:t="Invalid input";break;case f.invalid_intersection_types:t="Intersection results could not be merged";break;case f.not_multiple_of:t=`Number must be a multiple of ${a.multipleOf}`;break;case f.not_finite:t="Number must be finite";break;default:t=e.defaultError,E.assertNever(a)}return{message:t}};let wr=ct;function Sr(){return wr}const Cr=a=>{const{data:e,path:t,errorMaps:s,issueData:n}=a,i=[...t,...n.path||[]],u={...n,path:i};if(n.message!==void 0)return{...n,path:i,message:n.message};let d="";const g=s.filter(h=>!!h).slice().reverse();for(const h of g)d=h(u,{data:e,defaultError:d}).message;return{...n,path:i,message:d}};function x(a,e){const t=Sr(),s=Cr({issueData:e,data:a.data,path:a.path,errorMaps:[a.common.contextualErrorMap,a.schemaErrorMap,t,t===ct?void 0:ct].filter(n=>!!n)});a.common.issues.push(s)}class re{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const s=[];for(const n of t){if(n.status==="aborted")return N;n.status==="dirty"&&e.dirty(),s.push(n.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,t){const s=[];for(const n of t){const i=await n.key,u=await n.value;s.push({key:i,value:u})}return re.mergeObjectSync(e,s)}static mergeObjectSync(e,t){const s={};for(const n of t){const{key:i,value:u}=n;if(i.status==="aborted"||u.status==="aborted")return N;i.status==="dirty"&&e.dirty(),u.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof u.value<"u"||n.alwaysSet)&&(s[i.value]=u.value)}return{status:e.value,value:s}}}const N=Object.freeze({status:"aborted"}),De=a=>({status:"dirty",value:a}),oe=a=>({status:"valid",value:a}),Mt=a=>a.status==="aborted",Nt=a=>a.status==="dirty",Ae=a=>a.status==="valid",Xe=a=>typeof Promise<"u"&&a instanceof Promise;var k;(function(a){a.errToObj=e=>typeof e=="string"?{message:e}:e||{},a.toString=e=>typeof e=="string"?e:e?.message})(k||(k={}));class we{constructor(e,t,s,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=n}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 $t=(a,e)=>{if(Ae(e))return{success:!0,data:e.value};if(!a.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 xe(a.common.issues);return this._error=t,this._error}}};function R(a){if(!a)return{};const{errorMap:e,invalid_type_error:t,required_error:s,description:n}=a;if(e&&(t||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(u,d)=>{const{message:g}=a;return u.code==="invalid_enum_value"?{message:g??d.defaultError}:typeof d.data>"u"?{message:g??s??d.defaultError}:u.code!=="invalid_type"?{message:d.defaultError}:{message:g??t??d.defaultError}},description:n}}class V{get description(){return this._def.description}_getType(e){return be(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:be(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new re,ctx:{common:e.parent.common,data:e.data,parsedType:be(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Xe(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 s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){const s={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:be(e)},n=this._parseSync({data:e,path:s.path,parent:s});return $t(s,n)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:be(e)};if(!this["~standard"].async)try{const s=this._parseSync({data:e,path:[],parent:t});return Ae(s)?{value:s.value}:{issues:t.common.issues}}catch(s){s?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(s=>Ae(s)?{value:s.value}:{issues:t.common.issues})}async parseAsync(e,t){const s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){const s={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:be(e)},n=this._parse({data:e,path:s.path,parent:s}),i=await(Xe(n)?n:Promise.resolve(n));return $t(s,i)}refine(e,t){const s=n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t;return this._refinement((n,i)=>{const u=e(n),d=()=>i.addIssue({code:f.custom,...s(n)});return typeof Promise<"u"&&u instanceof Promise?u.then(g=>g?!0:(d(),!1)):u?!0:(d(),!1)})}refinement(e,t){return this._refinement((s,n)=>e(s)?!0:(n.addIssue(typeof t=="function"?t(s,n):t),!1))}_refinement(e){return new je({schema:this,typeName:$.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 _e.create(this,this._def)}nullable(){return Ve.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return me.create(this)}promise(){return at.create(this,this._def)}or(e){return et.create([this,e],this._def)}and(e){return tt.create(this,e,this._def)}transform(e){return new je({...R(this._def),schema:this,typeName:$.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new pt({...R(this._def),innerType:this,defaultValue:t,typeName:$.ZodDefault})}brand(){return new qr({typeName:$.ZodBranded,type:this,...R(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new ht({...R(this._def),innerType:this,catchValue:t,typeName:$.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return gt.create(this,e)}readonly(){return mt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Tr=/^c[^\s-]{8,}$/i,Or=/^[0-9a-z]+$/,Mr=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Nr=/^[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,$r=/^[a-z0-9_-]{21}$/i,Ar=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Ir=/^[-+]?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)?)??$/,Rr=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,jr="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let lt;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])$/,Er=/^(?:(?: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])$/,Dr=/^(([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]))$/,Pr=/^(([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])$/,Zr=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Lr=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Wt="((\\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])))",zr=new RegExp(`^${Wt}$`);function Kt(a){let e="[0-5]\\d";a.precision?e=`${e}\\.\\d{${a.precision}}`:a.precision==null&&(e=`${e}(\\.\\d+)?`);const t=a.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function Fr(a){return new RegExp(`^${Kt(a)}$`)}function Br(a){let e=`${Wt}T${Kt(a)}`;const t=[];return t.push(a.local?"Z?":"Z"),a.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function Ur(a,e){return!!((e==="v4"||!e)&&Vr.test(a)||(e==="v6"||!e)&&Dr.test(a))}function Hr(a,e){if(!Ar.test(a))return!1;try{const[t]=a.split(".");if(!t)return!1;const s=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),n=JSON.parse(atob(s));return!(typeof n!="object"||n===null||"typ"in n&&n?.typ!=="JWT"||!n.alg||e&&n.alg!==e)}catch{return!1}}function Gr(a,e){return!!((e==="v4"||!e)&&Er.test(a)||(e==="v6"||!e)&&Pr.test(a))}class ke extends V{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==b.string){const i=this._getOrReturnCtx(e);return x(i,{code:f.invalid_type,expected:b.string,received:i.parsedType}),N}const s=new re;let n;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(n=this._getOrReturnCtx(e,n),x(n,{code:f.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),s.dirty());else if(i.kind==="max")e.data.length>i.value&&(n=this._getOrReturnCtx(e,n),x(n,{code:f.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),s.dirty());else if(i.kind==="length"){const u=e.data.length>i.value,d=e.data.length<i.value;(u||d)&&(n=this._getOrReturnCtx(e,n),u?x(n,{code:f.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):d&&x(n,{code:f.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),s.dirty())}else if(i.kind==="email")Rr.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"email",code:f.invalid_string,message:i.message}),s.dirty());else if(i.kind==="emoji")lt||(lt=new RegExp(jr,"u")),lt.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"emoji",code:f.invalid_string,message:i.message}),s.dirty());else if(i.kind==="uuid")Nr.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"uuid",code:f.invalid_string,message:i.message}),s.dirty());else if(i.kind==="nanoid")$r.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"nanoid",code:f.invalid_string,message:i.message}),s.dirty());else if(i.kind==="cuid")Tr.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"cuid",code:f.invalid_string,message:i.message}),s.dirty());else if(i.kind==="cuid2")Or.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"cuid2",code:f.invalid_string,message:i.message}),s.dirty());else if(i.kind==="ulid")Mr.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"ulid",code:f.invalid_string,message:i.message}),s.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),x(n,{validation:"url",code:f.invalid_string,message:i.message}),s.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"regex",code:f.invalid_string,message:i.message}),s.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(n=this._getOrReturnCtx(e,n),x(n,{code:f.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),s.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(n=this._getOrReturnCtx(e,n),x(n,{code:f.invalid_string,validation:{startsWith:i.value},message:i.message}),s.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(n=this._getOrReturnCtx(e,n),x(n,{code:f.invalid_string,validation:{endsWith:i.value},message:i.message}),s.dirty()):i.kind==="datetime"?Br(i).test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{code:f.invalid_string,validation:"datetime",message:i.message}),s.dirty()):i.kind==="date"?zr.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{code:f.invalid_string,validation:"date",message:i.message}),s.dirty()):i.kind==="time"?Fr(i).test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{code:f.invalid_string,validation:"time",message:i.message}),s.dirty()):i.kind==="duration"?Ir.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"duration",code:f.invalid_string,message:i.message}),s.dirty()):i.kind==="ip"?Ur(e.data,i.version)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"ip",code:f.invalid_string,message:i.message}),s.dirty()):i.kind==="jwt"?Hr(e.data,i.alg)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"jwt",code:f.invalid_string,message:i.message}),s.dirty()):i.kind==="cidr"?Gr(e.data,i.version)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"cidr",code:f.invalid_string,message:i.message}),s.dirty()):i.kind==="base64"?Zr.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"base64",code:f.invalid_string,message:i.message}),s.dirty()):i.kind==="base64url"?Lr.test(e.data)||(n=this._getOrReturnCtx(e,n),x(n,{validation:"base64url",code:f.invalid_string,message:i.message}),s.dirty()):E.assertNever(i);return{status:s.value,value:e.data}}_regex(e,t,s){return this.refinement(n=>e.test(n),{validation:t,code:f.invalid_string,...k.errToObj(s)})}_addCheck(e){return new ke({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...k.errToObj(e)})}url(e){return this._addCheck({kind:"url",...k.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...k.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...k.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...k.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...k.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...k.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...k.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...k.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...k.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...k.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...k.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...k.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,...k.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,...k.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...k.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...k.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...k.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...k.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...k.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...k.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...k.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...k.errToObj(t)})}nonempty(e){return this.min(1,k.errToObj(e))}trim(){return new ke({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ke({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ke({...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}}ke.create=a=>new ke({checks:[],typeName:$.ZodString,coerce:a?.coerce??!1,...R(a)});function Jr(a,e){const t=(a.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,n=t>s?t:s,i=Number.parseInt(a.toFixed(n).replace(".","")),u=Number.parseInt(e.toFixed(n).replace(".",""));return i%u/10**n}class Ie extends V{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)!==b.number){const i=this._getOrReturnCtx(e);return x(i,{code:f.invalid_type,expected:b.number,received:i.parsedType}),N}let s;const n=new re;for(const i of this._def.checks)i.kind==="int"?E.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),x(s,{code:f.invalid_type,expected:"integer",received:"float",message:i.message}),n.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(s=this._getOrReturnCtx(e,s),x(s,{code:f.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),n.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(s=this._getOrReturnCtx(e,s),x(s,{code:f.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),n.dirty()):i.kind==="multipleOf"?Jr(e.data,i.value)!==0&&(s=this._getOrReturnCtx(e,s),x(s,{code:f.not_multiple_of,multipleOf:i.value,message:i.message}),n.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),x(s,{code:f.not_finite,message:i.message}),n.dirty()):E.assertNever(i);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,k.toString(t))}gt(e,t){return this.setLimit("min",e,!1,k.toString(t))}lte(e,t){return this.setLimit("max",e,!0,k.toString(t))}lt(e,t){return this.setLimit("max",e,!1,k.toString(t))}setLimit(e,t,s,n){return new Ie({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:k.toString(n)}]})}_addCheck(e){return new Ie({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:k.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:k.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:k.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:k.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:k.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:k.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:k.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:k.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:k.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"&&E.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(t===null||s.value>t)&&(t=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(t)&&Number.isFinite(e)}}Ie.create=a=>new Ie({checks:[],typeName:$.ZodNumber,coerce:a?.coerce||!1,...R(a)});class Ze extends V{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)!==b.bigint)return this._getInvalidInput(e);let s;const n=new re;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(s=this._getOrReturnCtx(e,s),x(s,{code:f.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),n.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(s=this._getOrReturnCtx(e,s),x(s,{code:f.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),n.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),x(s,{code:f.not_multiple_of,multipleOf:i.value,message:i.message}),n.dirty()):E.assertNever(i);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return x(t,{code:f.invalid_type,expected:b.bigint,received:t.parsedType}),N}gte(e,t){return this.setLimit("min",e,!0,k.toString(t))}gt(e,t){return this.setLimit("min",e,!1,k.toString(t))}lte(e,t){return this.setLimit("max",e,!0,k.toString(t))}lt(e,t){return this.setLimit("max",e,!1,k.toString(t))}setLimit(e,t,s,n){return new Ze({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:k.toString(n)}]})}_addCheck(e){return new Ze({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:k.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:k.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:k.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:k.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:k.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}}Ze.create=a=>new Ze({checks:[],typeName:$.ZodBigInt,coerce:a?.coerce??!1,...R(a)});class At extends V{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==b.boolean){const s=this._getOrReturnCtx(e);return x(s,{code:f.invalid_type,expected:b.boolean,received:s.parsedType}),N}return oe(e.data)}}At.create=a=>new At({typeName:$.ZodBoolean,coerce:a?.coerce||!1,...R(a)});class Qe extends V{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==b.date){const i=this._getOrReturnCtx(e);return x(i,{code:f.invalid_type,expected:b.date,received:i.parsedType}),N}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return x(i,{code:f.invalid_date}),N}const s=new re;let n;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(n=this._getOrReturnCtx(e,n),x(n,{code:f.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),s.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(n=this._getOrReturnCtx(e,n),x(n,{code:f.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),s.dirty()):E.assertNever(i);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Qe({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:k.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:k.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}}Qe.create=a=>new Qe({checks:[],coerce:a?.coerce||!1,typeName:$.ZodDate,...R(a)});class It extends V{_parse(e){if(this._getType(e)!==b.symbol){const s=this._getOrReturnCtx(e);return x(s,{code:f.invalid_type,expected:b.symbol,received:s.parsedType}),N}return oe(e.data)}}It.create=a=>new It({typeName:$.ZodSymbol,...R(a)});class Rt extends V{_parse(e){if(this._getType(e)!==b.undefined){const s=this._getOrReturnCtx(e);return x(s,{code:f.invalid_type,expected:b.undefined,received:s.parsedType}),N}return oe(e.data)}}Rt.create=a=>new Rt({typeName:$.ZodUndefined,...R(a)});class jt extends V{_parse(e){if(this._getType(e)!==b.null){const s=this._getOrReturnCtx(e);return x(s,{code:f.invalid_type,expected:b.null,received:s.parsedType}),N}return oe(e.data)}}jt.create=a=>new jt({typeName:$.ZodNull,...R(a)});class Vt extends V{constructor(){super(...arguments),this._any=!0}_parse(e){return oe(e.data)}}Vt.create=a=>new Vt({typeName:$.ZodAny,...R(a)});class Et extends V{constructor(){super(...arguments),this._unknown=!0}_parse(e){return oe(e.data)}}Et.create=a=>new Et({typeName:$.ZodUnknown,...R(a)});class Se extends V{_parse(e){const t=this._getOrReturnCtx(e);return x(t,{code:f.invalid_type,expected:b.never,received:t.parsedType}),N}}Se.create=a=>new Se({typeName:$.ZodNever,...R(a)});class Dt extends V{_parse(e){if(this._getType(e)!==b.undefined){const s=this._getOrReturnCtx(e);return x(s,{code:f.invalid_type,expected:b.void,received:s.parsedType}),N}return oe(e.data)}}Dt.create=a=>new Dt({typeName:$.ZodVoid,...R(a)});class me extends V{_parse(e){const{ctx:t,status:s}=this._processInputParams(e),n=this._def;if(t.parsedType!==b.array)return x(t,{code:f.invalid_type,expected:b.array,received:t.parsedType}),N;if(n.exactLength!==null){const u=t.data.length>n.exactLength.value,d=t.data.length<n.exactLength.value;(u||d)&&(x(t,{code:u?f.too_big:f.too_small,minimum:d?n.exactLength.value:void 0,maximum:u?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),s.dirty())}if(n.minLength!==null&&t.data.length<n.minLength.value&&(x(t,{code:f.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),s.dirty()),n.maxLength!==null&&t.data.length>n.maxLength.value&&(x(t,{code:f.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map((u,d)=>n.type._parseAsync(new we(t,u,t.path,d)))).then(u=>re.mergeArray(s,u));const i=[...t.data].map((u,d)=>n.type._parseSync(new we(t,u,t.path,d)));return re.mergeArray(s,i)}get element(){return this._def.type}min(e,t){return new me({...this._def,minLength:{value:e,message:k.toString(t)}})}max(e,t){return new me({...this._def,maxLength:{value:e,message:k.toString(t)}})}length(e,t){return new me({...this._def,exactLength:{value:e,message:k.toString(t)}})}nonempty(e){return this.min(1,e)}}me.create=(a,e)=>new me({type:a,minLength:null,maxLength:null,exactLength:null,typeName:$.ZodArray,...R(e)});function $e(a){if(a instanceof q){const e={};for(const t in a.shape){const s=a.shape[t];e[t]=_e.create($e(s))}return new q({...a._def,shape:()=>e})}else return a instanceof me?new me({...a._def,type:$e(a.element)}):a instanceof _e?_e.create($e(a.unwrap())):a instanceof Ve?Ve.create($e(a.unwrap())):a instanceof Me?Me.create(a.items.map(e=>$e(e))):a}class q extends V{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=E.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==b.object){const h=this._getOrReturnCtx(e);return x(h,{code:f.invalid_type,expected:b.object,received:h.parsedType}),N}const{status:s,ctx:n}=this._processInputParams(e),{shape:i,keys:u}=this._getCached(),d=[];if(!(this._def.catchall instanceof Se&&this._def.unknownKeys==="strip"))for(const h in n.data)u.includes(h)||d.push(h);const g=[];for(const h of u){const w=i[h],K=n.data[h];g.push({key:{status:"valid",value:h},value:w._parse(new we(n,K,n.path,h)),alwaysSet:h in n.data})}if(this._def.catchall instanceof Se){const h=this._def.unknownKeys;if(h==="passthrough")for(const w of d)g.push({key:{status:"valid",value:w},value:{status:"valid",value:n.data[w]}});else if(h==="strict")d.length>0&&(x(n,{code:f.unrecognized_keys,keys:d}),s.dirty());else if(h!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const h=this._def.catchall;for(const w of d){const K=n.data[w];g.push({key:{status:"valid",value:w},value:h._parse(new we(n,K,n.path,w)),alwaysSet:w in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const h=[];for(const w of g){const K=await w.key,Z=await w.value;h.push({key:K,value:Z,alwaysSet:w.alwaysSet})}return h}).then(h=>re.mergeObjectSync(s,h)):re.mergeObjectSync(s,g)}get shape(){return this._def.shape()}strict(e){return k.errToObj,new q({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,s)=>{const n=this._def.errorMap?.(t,s).message??s.defaultError;return t.code==="unrecognized_keys"?{message:k.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new q({...this._def,unknownKeys:"strip"})}passthrough(){return new q({...this._def,unknownKeys:"passthrough"})}extend(e){return new q({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new q({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:$.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new q({...this._def,catchall:e})}pick(e){const t={};for(const s of E.objectKeys(e))e[s]&&this.shape[s]&&(t[s]=this.shape[s]);return new q({...this._def,shape:()=>t})}omit(e){const t={};for(const s of E.objectKeys(this.shape))e[s]||(t[s]=this.shape[s]);return new q({...this._def,shape:()=>t})}deepPartial(){return $e(this)}partial(e){const t={};for(const s of E.objectKeys(this.shape)){const n=this.shape[s];e&&!e[s]?t[s]=n:t[s]=n.optional()}return new q({...this._def,shape:()=>t})}required(e){const t={};for(const s of E.objectKeys(this.shape))if(e&&!e[s])t[s]=this.shape[s];else{let i=this.shape[s];for(;i instanceof _e;)i=i._def.innerType;t[s]=i}return new q({...this._def,shape:()=>t})}keyof(){return Yt(E.objectKeys(this.shape))}}q.create=(a,e)=>new q({shape:()=>a,unknownKeys:"strip",catchall:Se.create(),typeName:$.ZodObject,...R(e)});q.strictCreate=(a,e)=>new q({shape:()=>a,unknownKeys:"strict",catchall:Se.create(),typeName:$.ZodObject,...R(e)});q.lazycreate=(a,e)=>new q({shape:a,unknownKeys:"strip",catchall:Se.create(),typeName:$.ZodObject,...R(e)});class et extends V{_parse(e){const{ctx:t}=this._processInputParams(e),s=this._def.options;function n(i){for(const d of i)if(d.result.status==="valid")return d.result;for(const d of i)if(d.result.status==="dirty")return t.common.issues.push(...d.ctx.common.issues),d.result;const u=i.map(d=>new xe(d.ctx.common.issues));return x(t,{code:f.invalid_union,unionErrors:u}),N}if(t.common.async)return Promise.all(s.map(async i=>{const u={...t,common:{...t.common,issues:[]},parent:null};return{result:await i._parseAsync({data:t.data,path:t.path,parent:u}),ctx:u}})).then(n);{let i;const u=[];for(const g of s){const h={...t,common:{...t.common,issues:[]},parent:null},w=g._parseSync({data:t.data,path:t.path,parent:h});if(w.status==="valid")return w;w.status==="dirty"&&!i&&(i={result:w,ctx:h}),h.common.issues.length&&u.push(h.common.issues)}if(i)return t.common.issues.push(...i.ctx.common.issues),i.result;const d=u.map(g=>new xe(g));return x(t,{code:f.invalid_union,unionErrors:d}),N}}get options(){return this._def.options}}et.create=(a,e)=>new et({options:a,typeName:$.ZodUnion,...R(e)});function ft(a,e){const t=be(a),s=be(e);if(a===e)return{valid:!0,data:a};if(t===b.object&&s===b.object){const n=E.objectKeys(e),i=E.objectKeys(a).filter(d=>n.indexOf(d)!==-1),u={...a,...e};for(const d of i){const g=ft(a[d],e[d]);if(!g.valid)return{valid:!1};u[d]=g.data}return{valid:!0,data:u}}else if(t===b.array&&s===b.array){if(a.length!==e.length)return{valid:!1};const n=[];for(let i=0;i<a.length;i++){const u=a[i],d=e[i],g=ft(u,d);if(!g.valid)return{valid:!1};n.push(g.data)}return{valid:!0,data:n}}else return t===b.date&&s===b.date&&+a==+e?{valid:!0,data:a}:{valid:!1}}class tt extends V{_parse(e){const{status:t,ctx:s}=this._processInputParams(e),n=(i,u)=>{if(Mt(i)||Mt(u))return N;const d=ft(i.value,u.value);return d.valid?((Nt(i)||Nt(u))&&t.dirty(),{status:t.value,value:d.data}):(x(s,{code:f.invalid_intersection_types}),N)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([i,u])=>n(i,u)):n(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}tt.create=(a,e,t)=>new tt({left:a,right:e,typeName:$.ZodIntersection,...R(t)});class Me extends V{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==b.array)return x(s,{code:f.invalid_type,expected:b.array,received:s.parsedType}),N;if(s.data.length<this._def.items.length)return x(s,{code:f.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),N;!this._def.rest&&s.data.length>this._def.items.length&&(x(s,{code:f.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const i=[...s.data].map((u,d)=>{const g=this._def.items[d]||this._def.rest;return g?g._parse(new we(s,u,s.path,d)):null}).filter(u=>!!u);return s.common.async?Promise.all(i).then(u=>re.mergeArray(t,u)):re.mergeArray(t,i)}get items(){return this._def.items}rest(e){return new Me({...this._def,rest:e})}}Me.create=(a,e)=>{if(!Array.isArray(a))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Me({items:a,typeName:$.ZodTuple,rest:null,...R(e)})};class Pt extends V{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==b.map)return x(s,{code:f.invalid_type,expected:b.map,received:s.parsedType}),N;const n=this._def.keyType,i=this._def.valueType,u=[...s.data.entries()].map(([d,g],h)=>({key:n._parse(new we(s,d,s.path,[h,"key"])),value:i._parse(new we(s,g,s.path,[h,"value"]))}));if(s.common.async){const d=new Map;return Promise.resolve().then(async()=>{for(const g of u){const h=await g.key,w=await g.value;if(h.status==="aborted"||w.status==="aborted")return N;(h.status==="dirty"||w.status==="dirty")&&t.dirty(),d.set(h.value,w.value)}return{status:t.value,value:d}})}else{const d=new Map;for(const g of u){const h=g.key,w=g.value;if(h.status==="aborted"||w.status==="aborted")return N;(h.status==="dirty"||w.status==="dirty")&&t.dirty(),d.set(h.value,w.value)}return{status:t.value,value:d}}}}Pt.create=(a,e,t)=>new Pt({valueType:e,keyType:a,typeName:$.ZodMap,...R(t)});class Le extends V{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==b.set)return x(s,{code:f.invalid_type,expected:b.set,received:s.parsedType}),N;const n=this._def;n.minSize!==null&&s.data.size<n.minSize.value&&(x(s,{code:f.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),n.maxSize!==null&&s.data.size>n.maxSize.value&&(x(s,{code:f.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const i=this._def.valueType;function u(g){const h=new Set;for(const w of g){if(w.status==="aborted")return N;w.status==="dirty"&&t.dirty(),h.add(w.value)}return{status:t.value,value:h}}const d=[...s.data.values()].map((g,h)=>i._parse(new we(s,g,s.path,h)));return s.common.async?Promise.all(d).then(g=>u(g)):u(d)}min(e,t){return new Le({...this._def,minSize:{value:e,message:k.toString(t)}})}max(e,t){return new Le({...this._def,maxSize:{value:e,message:k.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Le.create=(a,e)=>new Le({valueType:a,minSize:null,maxSize:null,typeName:$.ZodSet,...R(e)});class Zt extends V{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})}}Zt.create=(a,e)=>new Zt({getter:a,typeName:$.ZodLazy,...R(e)});class Lt extends V{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return x(t,{received:t.data,code:f.invalid_literal,expected:this._def.value}),N}return{status:"valid",value:e.data}}get value(){return this._def.value}}Lt.create=(a,e)=>new Lt({value:a,typeName:$.ZodLiteral,...R(e)});function Yt(a,e){return new Re({values:a,typeName:$.ZodEnum,...R(e)})}class Re extends V{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),s=this._def.values;return x(t,{expected:E.joinValues(s),received:t.parsedType,code:f.invalid_type}),N}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),s=this._def.values;return x(t,{received:t.data,code:f.invalid_enum_value,options:s}),N}return oe(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 Re.create(e,{...this._def,...t})}exclude(e,t=this._def){return Re.create(this.options.filter(s=>!e.includes(s)),{...this._def,...t})}}Re.create=Yt;class zt extends V{_parse(e){const t=E.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==b.string&&s.parsedType!==b.number){const n=E.objectValues(t);return x(s,{expected:E.joinValues(n),received:s.parsedType,code:f.invalid_type}),N}if(this._cache||(this._cache=new Set(E.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const n=E.objectValues(t);return x(s,{received:s.data,code:f.invalid_enum_value,options:n}),N}return oe(e.data)}get enum(){return this._def.values}}zt.create=(a,e)=>new zt({values:a,typeName:$.ZodNativeEnum,...R(e)});class at extends V{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==b.promise&&t.common.async===!1)return x(t,{code:f.invalid_type,expected:b.promise,received:t.parsedType}),N;const s=t.parsedType===b.promise?t.data:Promise.resolve(t.data);return oe(s.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}}at.create=(a,e)=>new at({type:a,typeName:$.ZodPromise,...R(e)});class je extends V{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===$.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:s}=this._processInputParams(e),n=this._def.effect||null,i={addIssue:u=>{x(s,u),u.fatal?t.abort():t.dirty()},get path(){return s.path}};if(i.addIssue=i.addIssue.bind(i),n.type==="preprocess"){const u=n.transform(s.data,i);if(s.common.async)return Promise.resolve(u).then(async d=>{if(t.value==="aborted")return N;const g=await this._def.schema._parseAsync({data:d,path:s.path,parent:s});return g.status==="aborted"?N:g.status==="dirty"||t.value==="dirty"?De(g.value):g});{if(t.value==="aborted")return N;const d=this._def.schema._parseSync({data:u,path:s.path,parent:s});return d.status==="aborted"?N:d.status==="dirty"||t.value==="dirty"?De(d.value):d}}if(n.type==="refinement"){const u=d=>{const g=n.refinement(d,i);if(s.common.async)return Promise.resolve(g);if(g instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return d};if(s.common.async===!1){const d=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return d.status==="aborted"?N:(d.status==="dirty"&&t.dirty(),u(d.value),{status:t.value,value:d.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(d=>d.status==="aborted"?N:(d.status==="dirty"&&t.dirty(),u(d.value).then(()=>({status:t.value,value:d.value}))))}if(n.type==="transform")if(s.common.async===!1){const u=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!Ae(u))return N;const d=n.transform(u.value,i);if(d instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:d}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(u=>Ae(u)?Promise.resolve(n.transform(u.value,i)).then(d=>({status:t.value,value:d})):N);E.assertNever(n)}}je.create=(a,e,t)=>new je({schema:a,typeName:$.ZodEffects,effect:e,...R(t)});je.createWithPreprocess=(a,e,t)=>new je({schema:e,effect:{type:"preprocess",transform:a},typeName:$.ZodEffects,...R(t)});class _e extends V{_parse(e){return this._getType(e)===b.undefined?oe(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}_e.create=(a,e)=>new _e({innerType:a,typeName:$.ZodOptional,...R(e)});class Ve extends V{_parse(e){return this._getType(e)===b.null?oe(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ve.create=(a,e)=>new Ve({innerType:a,typeName:$.ZodNullable,...R(e)});class pt extends V{_parse(e){const{ctx:t}=this._processInputParams(e);let s=t.data;return t.parsedType===b.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}pt.create=(a,e)=>new pt({innerType:a,typeName:$.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...R(e)});class ht extends V{_parse(e){const{ctx:t}=this._processInputParams(e),s={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return Xe(n)?n.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new xe(s.common.issues)},input:s.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new xe(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}ht.create=(a,e)=>new ht({innerType:a,typeName:$.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...R(e)});class Ft extends V{_parse(e){if(this._getType(e)!==b.nan){const s=this._getOrReturnCtx(e);return x(s,{code:f.invalid_type,expected:b.nan,received:s.parsedType}),N}return{status:"valid",value:e.data}}}Ft.create=a=>new Ft({typeName:$.ZodNaN,...R(a)});class qr extends V{_parse(e){const{ctx:t}=this._processInputParams(e),s=t.data;return this._def.type._parse({data:s,path:t.path,parent:t})}unwrap(){return this._def.type}}class gt extends V{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return i.status==="aborted"?N:i.status==="dirty"?(t.dirty(),De(i.value)):this._def.out._parseAsync({data:i.value,path:s.path,parent:s})})();{const n=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?N:n.status==="dirty"?(t.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:s.path,parent:s})}}static create(e,t){return new gt({in:e,out:t,typeName:$.ZodPipeline})}}class mt extends V{_parse(e){const t=this._def.innerType._parse(e),s=n=>(Ae(n)&&(n.value=Object.freeze(n.value)),n);return Xe(t)?t.then(n=>s(n)):s(t)}unwrap(){return this._def.innerType}}mt.create=(a,e)=>new mt({innerType:a,typeName:$.ZodReadonly,...R(e)});var $;(function(a){a.ZodString="ZodString",a.ZodNumber="ZodNumber",a.ZodNaN="ZodNaN",a.ZodBigInt="ZodBigInt",a.ZodBoolean="ZodBoolean",a.ZodDate="ZodDate",a.ZodSymbol="ZodSymbol",a.ZodUndefined="ZodUndefined",a.ZodNull="ZodNull",a.ZodAny="ZodAny",a.ZodUnknown="ZodUnknown",a.ZodNever="ZodNever",a.ZodVoid="ZodVoid",a.ZodArray="ZodArray",a.ZodObject="ZodObject",a.ZodUnion="ZodUnion",a.ZodDiscriminatedUnion="ZodDiscriminatedUnion",a.ZodIntersection="ZodIntersection",a.ZodTuple="ZodTuple",a.ZodRecord="ZodRecord",a.ZodMap="ZodMap",a.ZodSet="ZodSet",a.ZodFunction="ZodFunction",a.ZodLazy="ZodLazy",a.ZodLiteral="ZodLiteral",a.ZodEnum="ZodEnum",a.ZodEffects="ZodEffects",a.ZodNativeEnum="ZodNativeEnum",a.ZodOptional="ZodOptional",a.ZodNullable="ZodNullable",a.ZodDefault="ZodDefault",a.ZodCatch="ZodCatch",a.ZodPromise="ZodPromise",a.ZodBranded="ZodBranded",a.ZodPipeline="ZodPipeline",a.ZodReadonly="ZodReadonly"})($||($={}));const v=ke.create,Ee=Ie.create;Se.create;const Q=me.create,z=q.create;et.create;tt.create;Me.create;const Bt=Re.create;at.create;_e.create;Ve.create;const Wr=z({label:v().min(1).max(40),left:v().min(1).max(35),right:v().min(1).max(35)}),Kr=z({id:v().min(1),category:v().optional().default("TECH"),theme:Bt(["blue-tech","emerald-finance","slate-education","dark-contrast","crimson-alert","amber-gold","cyber-violet","sunset-orange","nordic-frost","monochrome-luxe"]).default("blue-tech"),layoutType:Bt(["table","news","stat","list","quote","versus","receipt","timeline","barchart","leaderboard","editorial","matrix","debate","tierlist"]).default("table"),title:v().min(1).max(120),subtitle:v().min(1).max(250),leftHeader:v().optional().default("USA 🇺🇸"),rightHeader:v().optional().default("UK 🇬🇧"),rows:Q(Wr).optional().default([]),bullets:Q(z({highlight:v().optional().default(""),text:v().min(1)})).optional().default([]),bigStat:z({number:v().default("$165,000"),label:v().default("Average Compensation"),subtext:v().optional().default(""),secondaryNumber:v().optional().default(""),secondaryLabel:v().optional().default("")}).optional(),listItems:Q(z({rank:Ee(),title:v(),value:v(),tag:v().optional().default("")})).optional().default([]),quoteData:z({quote:v(),highlight:v().optional().default(""),source:v().default("Industry Insider")}).optional(),versusData:z({leftEntity:v().optional(),leftStats:Q(z({label:v(),value:v()})).optional(),leftPerk:v().optional(),rightEntity:v().optional(),rightStats:Q(z({label:v(),value:v()})).optional(),rightPerk:v().optional(),verdict:v().optional()}).optional(),receiptData:z({grossMonthly:v().optional(),items:Q(z({label:v(),amount:v(),note:v().optional()})).optional(),totalDeductions:v().optional(),netRemaining:v().optional()}).optional(),timelineData:z({pastYear:v().optional().default("2016"),presentYear:v().optional().default("2026"),items:Q(z({label:v(),pastValue:v(),presentValue:v(),changeBadge:v().optional()})).optional(),bottomInsight:v().optional()}).optional(),barchartData:Q(z({label:v(),percentage:Ee().min(0).max(100),amount:v().optional(),tag:v().optional()})).optional().default([]),leaderboardData:z({calloutNote:v().optional().default("*Asumsi kurs : Rp15.500/US$"),items:Q(z({rank:Ee(),name:v(),flag:v().optional().default("🌐"),value:v(),percentage:Ee().min(0).max(100).optional()})).optional()}).optional(),editorialData:z({badge:v().optional().default("INVESTIGASI KHUSUS"),highlightPhrase:v().optional(),cards:Q(z({step:v().optional(),title:v(),text:v(),stat:v().optional()})).optional(),keyTakeaway:v().optional()}).optional(),matrixData:z({headers:Q(v()).optional().default(["Indikator","🇮🇩 IDN","🇲🇾 MYS","🇸🇬 SGP"]),rows:Q(z({label:v(),values:Q(v())})).optional()}).optional(),debateData:z({proTitle:v().optional().default("SISI PRO / BENEFIT"),proScore:v().optional().default("65%"),proPoints:Q(v()).optional(),conTitle:v().optional().default("SISI KONTRA / RISIKO"),conScore:v().optional().default("35%"),conPoints:Q(v()).optional(),callToAction:v().optional().default("Kalian di tim mana? Tulis pendapatmu di bawah! 👇")}).optional(),tierlistData:Q(z({tier:v(),tierColor:v().optional(),items:Q(z({name:v(),badge:v().optional(),desc:v().optional()}))})).optional().default([]),footerNote:v().optional().default("Industry Benchmark 2026"),watermark:v().optional().default("@SocialGen"),bgKeyword:v().optional().default("modern office coding night"),reelsDuration:Ee().min(5).max(90).default(30),caption:v().optional().default("Bagikan pendapat Anda di kolom komentar! #infografis #edukasi")}),Yr={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"},Xr={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"},Qr={class:"flex items-center gap-2.5 sm:gap-3"},ei={class:"text-sm font-extrabold tracking-tight text-white flex items-center gap-1.5 sm:gap-2"},ti={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"},ai={class:"flex items-center gap-2 sm:gap-3 text-xs"},si={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]"},ni={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]"},ri={class:"lg:hidden flex items-center justify-center px-3 py-2 bg-slate-900/90 border-b border-slate-800 flex-shrink-0"},ii={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"},oi={key:0,class:"w-2 h-2 rounded-full bg-emerald-400 animate-ping"},li={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"},ci=vt({__name:"index",setup(a){const e=O({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=O({theme:"blue-tech",backgroundSource:"pexels",musicFile:"random",videoStartOffset:0,audioStartOffset:0,outputs:{feed:!0,story:!0,reels:!0}}),s=O([]),n=O(-1);function i(){try{localStorage.setItem("sg_drafts",JSON.stringify(s.value))}catch{}$fetch("/api/drafts",{method:"POST",body:{drafts:s.value}}).catch(()=>{})}function u(){s.value.unshift(JSON.parse(JSON.stringify(e.value))),n.value=0,w.value=-1,i(),X("Draft berhasil disimpan!")}function d(C){s.value[C]&&(e.value=JSON.parse(JSON.stringify(s.value[C])),t.value.theme=e.value.theme,n.value=C,w.value=-1,X(`Memuat draft #${C+1}`))}function g(C){s.value.splice(C,1),n.value===C&&(n.value=-1),i(),X("Draft dihapus")}const h=O([]),w=O(-1);function K(){try{localStorage.setItem("sg_gen_history",JSON.stringify(h.value))}catch{}$fetch("/api/generation-history",{method:"POST",body:{history:h.value}}).catch(()=>{})}function Z(C){const y=h.value[C];y&&(e.value=JSON.parse(JSON.stringify(y.contentData||y)),y.options&&(t.value={...t.value,...y.options}),w.value=C,n.value=-1,X(`Memuat riwayat: "${y.title.slice(0,24)}..."`))}function A(C){h.value.splice(C,1),w.value===C&&(w.value=-1),K(),X("Item riwayat dihapus")}function j(){h.value=[],w.value=-1,K(),X("Seluruh riwayat generate berhasil dibersihkan!")}let H=null;function W(){try{localStorage.setItem("sg_active_content",JSON.stringify(e.value)),localStorage.setItem("sg_active_options",JSON.stringify(t.value))}catch{}clearTimeout(H),H=setTimeout(()=>{$fetch("/api/last-session",{method:"POST",body:{content:e.value,options:t.value}}).catch(()=>{})},1e3)}de(()=>e.value,W,{deep:!0}),de(()=>t.value,W,{deep:!0});const ne=O(!1),ue=O(!1),L=O(""),G=O(null),B=O(""),Y=O("success"),ae=O("editor"),le=O(null);Ut(async()=>{try{const C=localStorage.getItem("sg_active_content");if(C){const y=JSON.parse(C);y&&y.title&&(e.value=y)}else{const y=await $fetch("/api/last-session");y?.session?.content&&(e.value=y.session.content,y.session.options&&(t.value={...t.value,...y.session.options}))}}catch{}try{const C=localStorage.getItem("sg_active_options");if(C){const y=JSON.parse(C);y&&(t.value={...t.value,...y})}}catch{}try{const C=await $fetch("/api/drafts");if(C?.drafts&&Array.isArray(C.drafts)&&C.drafts.length>0)s.value=C.drafts;else{const y=localStorage.getItem("sg_drafts");if(y){const ee=JSON.parse(y);Array.isArray(ee)&&ee.length>0&&(s.value=ee,$fetch("/api/drafts",{method:"POST",body:{drafts:ee}}).catch(()=>{}))}}}catch{const C=localStorage.getItem("sg_drafts");if(C)try{s.value=JSON.parse(C)}catch{}}try{const C=await $fetch("/api/generation-history");if(C?.history&&Array.isArray(C.history)&&C.history.length>0)h.value=C.history;else{const y=localStorage.getItem("sg_gen_history");y&&(h.value=JSON.parse(y))}}catch{}try{const C=await $fetch("/api/status");le.value=C}catch{}});const ce=he(()=>{const C=Kr.safeParse(e.value);if(C.success)return{isValid:!0,error:""};{const y=C.error.errors[0];return{isValid:!1,error:`${y.path.join(".")}: ${y.message}`}}});function X(C,y="success"){B.value=C,Y.value=y,setTimeout(()=>{B.value=""},4e3)}async function ye(C,y,ee,ie){ue.value=!0,L.value=`AI Research (${ee||"Gemini"})...`;try{const P=await $fetch("/api/auto-topic",{method:"POST",body:{niche:C,layoutType:y,model:ee,language:ie}});P?.dataset&&(e.value=P.dataset,t.value.theme=P.dataset.theme,s.value.unshift(P.dataset),n.value=0,i(),P.source==="gemini"?X(`✨ [${P.modelUsed||"Gemini"}] Berhasil meriset: "${P.dataset.title.slice(0,32)}..."`,"success"):X(`ℹ️ [Curated Data] Topik siap: "${P.dataset.title.slice(0,32)}..."`,"success"))}catch(P){X("Gagal auto-topic: "+(P.data?.statusMessage||P.message),"error")}finally{ue.value=!1,L.value=""}}async function Ce(){if(!ce.value.isValid){X("Data tidak valid: "+ce.value.error,"error");return}ne.value=!0,L.value="Rendering Images & Reels...",G.value=null;const C={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))};h.value.unshift(C),w.value=0,K(),ae.value="preview";try{const y=await $fetch("/api/generate",{method:"POST",body:{data:e.value,options:t.value}});y?.success&&(G.value=y,X(`Sukses dirender dalam ${(y.durationMs/1e3).toFixed(1)} detik!`))}catch(y){X("Gagal render: "+(y.data?.statusMessage||y.message),"error")}finally{ne.value=!1,L.value=""}}return(C,y)=>{const ee=An,ie=_r;return _(),M("div",Yr,[r("header",Xr,[r("div",Qr,[y[8]||(y[8]=r("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)),r("div",null,[r("h1",ei,[y[7]||(y[7]=J(" SocialGen ",-1)),r("span",ti," v"+T(l(le)?.version||"2.2.4"),1)])])]),r("div",ai,[l(le)?.geminiActive?(_(),M("span",si," ● AI Connected ")):(_(),M("span",ni," ● Local Engine "))])]),r("div",ri,[r("div",ii,[r("button",{onClick:y[0]||(y[0]=P=>ae.value="editor"),class:F(["py-1.5 px-3 rounded-lg transition flex items-center justify-center gap-1.5",l(ae)==="editor"?"bg-sky-500 text-white shadow-md font-black":"text-slate-400 hover:text-slate-200"])},[...y[9]||(y[9]=[r("span",null,"⚙️ Studio & Editor",-1)])],2),r("button",{onClick:y[1]||(y[1]=P=>ae.value="preview"),class:F(["py-1.5 px-3 rounded-lg transition flex items-center justify-center gap-1.5",l(ae)==="preview"?"bg-indigo-600 text-white shadow-md font-black":"text-slate-400 hover:text-slate-200"])},[y[10]||(y[10]=r("span",null,"👁️ Live Preview",-1)),l(G)?(_(),M("span",oi)):U("",!0)],2)])]),l(B)?(_(),M("div",{key:0,class:F(["fixed bottom-6 right-6 z-50 flex items-center gap-2 px-4 py-3 rounded-2xl shadow-2xl text-xs font-bold border transition-all animate-bounce",l(Y)==="success"?"bg-emerald-950 text-emerald-200 border-emerald-500/50":"bg-rose-950 text-rose-200 border-rose-500/50"])},[r("span",null,T(l(B)),1)],2)):U("",!0),r("main",li,[r("section",{class:F(["lg:col-span-5 h-full overflow-y-auto pr-1 flex-col gap-3 custom-scrollbar",l(ae)==="editor"?"flex":"hidden lg:flex"])},[I(ee,{modelValue:l(e),"onUpdate:modelValue":y[2]||(y[2]=P=>Pe(e)?e.value=P:null),options:l(t),"onUpdate:options":y[3]||(y[3]=P=>Pe(t)?t.value=P:null),"is-valid":l(ce).isValid,"validation-error":l(ce).error,"is-generating":l(ne),"generate-stage":l(L),"is-auto-topic-loading":l(ue),drafts:l(s),"active-draft-index":l(n),history:l(h),"active-history-index":l(w),onGenerate:Ce,onAutoTopic:ye,onSelectDraft:d,onDeleteDraft:g,onSaveDraft:u,onSelectHistory:Z,onDeleteHistory:A,onClearAllHistory:j},null,8,["modelValue","options","is-valid","validation-error","is-generating","generate-stage","is-auto-topic-loading","drafts","active-draft-index","history","active-history-index"])],2),r("section",{class:F(["lg:col-span-7 h-full flex-col gap-3 overflow-hidden justify-between min-h-0",l(ae)==="preview"?"flex":"hidden lg:flex"])},[I(ie,{data:l(e),"selected-video":l(t).backgroundSource,"selected-music":l(t).musicFile,"video-start-offset":l(t).videoStartOffset,"onUpdate:videoStartOffset":y[4]||(y[4]=P=>l(t).videoStartOffset=P),"audio-start-offset":l(t).audioStartOffset,"onUpdate:audioStartOffset":y[5]||(y[5]=P=>l(t).audioStartOffset=P),"generated-result":l(G)},null,8,["data","selected-video","selected-music","video-start-offset","audio-start-offset","generated-result"])],2)]),l(ae)==="editor"?(_(),M("button",{key:1,onClick:y[6]||(y[6]=P=>ae.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"},[...y[11]||(y[11]=[r("span",null,"👁️ Lihat Preview Canvas",-1)])])):U("",!0)])}}});export{ci as default};
|