@socialgen_user/socialgen 2.3.0 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/nitro.json +1 -1
- package/.output/public/_nuxt/{yolJVDpu.js → 36q1RoOo.js} +1 -1
- package/.output/public/_nuxt/{B_QCHj7R.js → 5UyJYm2u.js} +1 -1
- package/.output/public/_nuxt/BGOOoCGy.js +70 -0
- package/.output/public/_nuxt/{CsBHQ8e0.js → COzowdI6.js} +1 -1
- package/.output/public/_nuxt/{C9NnnsYM.js → CRHf65vs.js} +1 -1
- package/.output/public/_nuxt/{BS_lCwJp.js → DdHVfCgc.js} +1 -1
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/c2793992-2411-4906-a7f5-4196bbda17bb.json +1 -0
- package/.output/public/_nuxt/{DZWn8suN.js → j8CSQl54.js} +2 -2
- package/.output/server/chunks/_/nitro.mjs +123 -123
- package/.output/server/chunks/build/client.precomputed.mjs +1 -1
- package/.output/server/chunks/build/{pages-n3DzfaMn.mjs → pages-DAXSRPZR.mjs} +30 -3
- package/.output/server/chunks/build/{pages-n3DzfaMn.mjs.map → pages-DAXSRPZR.mjs.map} +1 -1
- package/.output/server/chunks/build/server.mjs +1 -1
- package/.output/server/chunks/build/styles.mjs +1 -1
- package/.output/server/chunks/build/styles.mjs.map +1 -1
- package/.output/server/package.json +1 -1
- package/data/last_session.json +21 -19
- package/package.json +1 -1
- package/.output/public/_nuxt/C8kqmepy.js +0 -70
- package/.output/public/_nuxt/builds/meta/fe5a0dcc-cf6c-47e8-9979-1ac007f760a2.json +0 -1
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import{h as Mt,d as Vt,i as S,M as ve,o as wa,A as f,B as v,l,C as a,E as C,G as F,D as g,N as E,O as oe,P as be,Q as dt,R as ut,S as Te,T as Ce,U as Ae,V as At,W as H,X as Be,m as ue,Y as Ba,Z as Xt}from"./DZWn8suN.js";import{_ as Za}from"./B_QCHj7R.js";const Ua=s=>s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var ct={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 Ja=({size:s,strokeWidth:e=2,absoluteStrokeWidth:t,color:n,iconNode:r,name:o,class:p,...c},{slots:w})=>Mt("svg",{...ct,width:s||ct.width,height:s||ct.height,stroke:n||ct.stroke,"stroke-width":t?Number(e)*24/Number(s):e,class:["lucide",`lucide-${Ua(o??"icon")}`],...c},[...r.map(b=>Mt(...b)),...w.default?[w.default()]:[]]);const U=(s,e)=>(t,{slots:n})=>Mt(Ja,{...t,iconNode:e,name:s},n);const Qt=U("BookmarkIcon",[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]]);const He=U("CheckIcon",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const Ha=U("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 Fa=U("CircleCheckIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const ea=U("ClockIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const za=U("CodeIcon",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const ft=U("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 Ga=U("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 ta=U("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 _a=U("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 Ka=U("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 Wa=U("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 aa=U("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 Sa=U("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 qa=U("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 pt=U("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 Ta=U("PlayIcon",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);const Nt=U("PlusIcon",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const Ya=U("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 Ca=U("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 Dt=U("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 sa=U("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 Xa=U("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 na=U("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 mt=U("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 ia=U("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 Qa=U("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 es=U("VolumeXIcon",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);const ts=U("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 It=U("XIcon",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);const as=U("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 ss=U("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"}]]),ns={class:"flex flex-col gap-3 text-slate-100"},is={key:0,class:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm flex items-center justify-center p-4"},rs={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"},os={class:"flex items-center justify-between pb-3 border-b border-slate-800"},ls={class:"text-sm font-black text-white flex items-center gap-2"},ds={class:"p-3.5 bg-slate-950 rounded-2xl border border-slate-800 flex flex-col gap-2.5"},us={class:"font-bold text-sky-400 flex items-center justify-between"},cs={class:"grid grid-cols-1 sm:grid-cols-2 gap-2"},ps={class:"flex flex-col gap-2"},ms={class:"text-[11px] font-bold text-slate-400 uppercase tracking-wider"},fs={class:"flex flex-col gap-2 max-h-[220px] overflow-y-auto pr-1 custom-scrollbar"},hs={class:"flex-1"},xs={class:"flex items-center gap-2 mb-1"},vs={class:"font-extrabold text-white text-xs"},gs={class:"px-1.5 py-0.2 rounded text-[9px] font-bold bg-slate-800 text-slate-300 border border-slate-700"},ys={class:"text-[11px] text-slate-400 leading-snug"},bs={class:"flex items-center gap-1"},ks=["onClick"],ws=["onClick"],_s={key:1,class:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm flex items-center justify-center p-4"},Ss={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]"},Ts={class:"flex items-center justify-between pb-3 border-b border-slate-800"},Cs={class:"text-sm font-black text-white flex items-center gap-2"},As={class:"flex items-center gap-2 bg-slate-950 p-2.5 rounded-xl border border-slate-800 text-[11px] flex-wrap"},Ns={class:"text-white font-semibold"},Is={class:"text-white font-semibold"},Os={class:"text-white font-semibold"},Ms={class:"text-purple-400 font-bold"},Ds={class:"relative flex-1 min-h-[220px]"},$s=["value"],js={class:"flex items-center justify-between pt-2 border-t border-slate-800"},Rs={class:"bg-slate-900 border border-slate-700 rounded-3xl max-w-2xl w-full p-5 shadow-2xl flex flex-col gap-4 text-xs max-h-[92vh] overflow-hidden"},Es={class:"flex items-center justify-between pb-3 border-b border-slate-800"},Ls={class:"text-sm font-black text-white flex items-center gap-2"},Ps={class:"flex items-center justify-between bg-slate-950 p-1 rounded-xl border border-slate-800"},Vs={class:"flex items-center gap-1"},Bs={key:0,class:"px-2.5 py-0.5 rounded-lg bg-amber-500/20 text-amber-300 border border-amber-500/40 text-[10px] font-bold flex items-center gap-1"},Zs={key:0,class:"flex-1 overflow-y-auto pr-1 flex flex-col gap-2.5 custom-scrollbar min-h-[300px]"},Us={key:0,class:"text-center py-12 text-slate-500 text-xs"},Js={class:"flex-1 min-w-0"},Hs={class:"flex items-center gap-2 mb-1 flex-wrap"},Fs={class:"font-extrabold text-white text-xs"},zs={class:"px-1.5 py-0.2 rounded text-[9px] font-bold bg-sky-950 text-sky-300 border border-sky-800"},Gs={class:"text-[9px] text-slate-500 font-mono"},Ks={class:"text-[11px] text-slate-400 leading-snug line-clamp-2"},Ws={class:"flex items-center gap-1.5 flex-shrink-0 self-end sm:self-center"},qs=["onClick"],Ys=["onClick"],Xs=["onClick"],Qs=["onClick"],en={key:1,class:"flex-1 overflow-y-auto pr-1 flex flex-col gap-3 custom-scrollbar min-h-[350px]"},tn={key:0,class:"p-2 rounded-xl bg-rose-950/60 border border-rose-500/50 text-rose-300 text-[11px] font-semibold"},an={key:1,class:"p-2.5 rounded-2xl bg-amber-950/60 border border-amber-500/50 text-amber-200 text-xs flex items-center justify-between shadow-lg"},sn={class:"flex items-center gap-2 min-w-0"},nn={class:"p-1 rounded-lg bg-amber-500/20 text-amber-400 shrink-0"},rn={class:"min-w-0"},on={class:"font-extrabold text-white text-xs flex items-center gap-1.5 truncate"},ln={class:"text-amber-300 truncate"},dn={class:"text-[10px] text-amber-400/80"},un={class:"p-3 rounded-2xl bg-gradient-to-r from-sky-950/60 via-indigo-950/40 to-slate-900 border border-sky-500/30 flex flex-col gap-2.5"},cn={class:"flex flex-col sm:flex-row sm:items-center justify-between gap-2"},pn={class:"flex items-center gap-1.5 shrink-0"},mn={key:0,class:"mt-1 flex flex-col gap-2 p-2.5 rounded-xl bg-slate-950/90 border border-sky-500/40"},fn={class:"flex justify-end gap-2"},hn={class:"grid grid-cols-1 sm:grid-cols-3 gap-2.5"},xn=["disabled"],vn={class:"grid grid-cols-1 sm:grid-cols-2 gap-2.5"},gn=["value"],yn={key:2,class:"flex flex-col gap-2.5 p-3 rounded-2xl bg-slate-950/80 border border-sky-500/30"},bn={class:"flex items-center justify-between"},kn={class:"text-[11px] font-black text-sky-400 flex items-center gap-1"},wn={class:"flex items-center justify-end gap-2 pt-2 border-t border-slate-800"},_n={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"},Sn={class:"text-xs font-black text-white flex items-center gap-2"},Tn={class:"flex items-center gap-1.5 flex-wrap"},Cn={class:"flex items-center gap-1 bg-slate-950 p-1 rounded-xl border border-slate-800 mr-1.5 shadow-inner"},An=["value"],Nn={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"},In=["disabled"],On={class:"relative group"},Mn={class:"absolute right-0 mt-1 hidden group-hover:flex flex-col bg-slate-900 border border-slate-800 rounded-xl shadow-2xl py-2 z-20 w-60 text-xs"},Dn={class:"px-3 py-1.5"},$n={class:"px-3 py-1 text-[10px] font-bold text-slate-500 uppercase flex items-center justify-between"},jn={class:"text-[9px] text-sky-400"},Rn={class:"max-h-60 overflow-y-auto custom-scrollbar flex flex-col"},En=["onClick"],Ln={class:"truncate"},Pn={key:0,class:"text-[8px] px-1 py-0.2 rounded bg-purple-500/20 text-purple-300 ml-1"},Vn={key:3,class:"p-3 bg-gradient-to-r from-sky-950 via-indigo-950 to-purple-950 border border-sky-500/50 rounded-2xl flex items-center gap-3 animate-pulse shadow-lg shadow-sky-500/10"},Bn={class:"w-6 h-6 rounded-lg bg-sky-500/20 border border-sky-400/40 flex items-center justify-center flex-shrink-0"},Zn={class:"text-[11px]"},Un={class:"font-extrabold text-white flex items-center gap-2"},Jn={class:"text-[9px] px-1.5 py-0.2 rounded bg-sky-500/30 text-sky-200 border border-sky-400/30"},Hn={class:"flex items-center justify-between bg-slate-950 p-1 rounded-xl border border-slate-800 text-xs font-semibold"},Fn={class:"flex items-center gap-1"},zn={class:"flex items-center gap-1.5"},Gn={key:4,class:"flex flex-col gap-1.5 p-2.5 bg-slate-900/90 border border-slate-800 rounded-2xl max-h-[320px] overflow-y-auto custom-scrollbar"},Kn={key:0,class:"p-2 rounded-xl bg-amber-500/15 border border-amber-500/40 text-amber-200 flex items-center justify-between gap-2 shadow-sm text-xs sticky top-0 z-10 backdrop-blur-md"},Wn={class:"flex items-center gap-2 min-w-0"},qn={class:"truncate"},Yn={class:"text-[11px] text-amber-100 font-semibold truncate block"},Xn={class:"flex items-center gap-1.5 flex-shrink-0"},Qn={key:1,class:"text-center py-8 text-slate-500 text-[11px] leading-relaxed"},ei=["onClick"],ti={class:"flex-1 pr-2"},ai={class:"flex items-center gap-1.5 mb-0.5"},si={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"},ni={class:"text-[9px] text-slate-400 font-semibold"},ii={class:"font-bold text-[11px] truncate text-slate-100"},ri=["onClick"],oi={key:5,class:"flex flex-col gap-1.5 p-2.5 bg-slate-900/90 border border-slate-800 rounded-2xl max-h-[320px] overflow-y-auto custom-scrollbar"},li={key:0,class:"p-2 rounded-xl bg-purple-500/15 border border-purple-500/40 text-purple-200 flex items-center justify-between gap-2 shadow-sm text-xs sticky top-0 z-10 backdrop-blur-md"},di={class:"flex items-center gap-2 min-w-0"},ui={class:"truncate"},ci={class:"text-[11px] text-purple-100 font-semibold truncate block"},pi={class:"flex items-center gap-1.5 flex-shrink-0"},mi={key:1,class:"text-center py-8 text-slate-500 text-[11px] leading-relaxed"},fi=["onClick"],hi={class:"flex-1 pr-2"},xi={class:"flex items-center gap-1.5 mb-0.5"},vi={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"},gi={class:"text-[9px] text-slate-400 font-semibold"},yi={key:0,class:"text-[9px] text-slate-500 font-mono ml-auto"},bi={class:"font-bold text-[11px] truncate text-slate-100"},ki=["onClick"],wi={key:6,class:"flex flex-col bg-slate-900/90 border border-slate-800 rounded-2xl overflow-hidden shadow-lg"},_i={class:"grid grid-cols-2 gap-2 p-2.5 bg-slate-950/70 border-b border-slate-800 text-xs"},Si={class:"flex items-center justify-between mb-1"},Ti={class:"text-[10px] font-bold text-slate-300 flex items-center gap-1"},Ci=["value"],Ai=["value"],Ni=["value"],Ii={class:"col-span-2 grid grid-cols-3 gap-2 pt-1 border-t border-slate-800/60 mt-1"},Oi={class:"col-span-1"},Mi=["value"],Di={class:"col-span-2"},$i=["value"],ji={class:"flex items-center justify-between px-3 py-1.5 bg-slate-950/50 border-b border-slate-800"},Ri={class:"flex items-center gap-2 text-xs"},Ei={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"},Li={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"},Pi={class:"flex items-center gap-2"},Vi={key:0},Bi={class:"underline"},Zi={class:"font-mono text-[10px]"},Ui={key:1},Ji={class:"font-mono text-[10px]"},Hi={class:"flex items-center gap-1.5 shrink-0"},Fi={class:"relative p-2"},zi=["value"],Gi={key:0,class:"text-[10px] text-rose-400 mt-1 px-1"},Ki={class:"p-3 bg-slate-900/90 border border-slate-800 rounded-2xl flex flex-col gap-2.5 shadow-lg text-xs"},Wi={class:"flex flex-col gap-1.5"},qi={class:"flex items-center justify-between gap-2"},Yi={class:"font-bold text-slate-300 flex items-center gap-1.5 text-[11px]"},Xi={class:"flex items-center gap-1.5"},Qi=["value"],er=["value"],tr=["disabled"],ar={class:"hidden sm:inline"},sr={class:"flex items-center justify-between pl-5 pr-1 text-[10px] text-slate-400"},nr={class:"flex items-center gap-1 text-sky-300 font-mono"},ir=["max","value"],rr={class:"flex flex-col gap-1.5 pt-1.5 border-t border-slate-800"},or={class:"flex items-center justify-between gap-2"},lr={class:"font-bold text-slate-300 flex items-center gap-1.5 text-[11px]"},dr={class:"flex items-center gap-1.5"},ur=["value"],cr=["value"],pr=["disabled"],mr={class:"hidden sm:inline"},fr={class:"flex items-center justify-between pl-5 pr-1 text-[10px] text-slate-400"},hr={class:"flex items-center gap-1 text-purple-300 font-mono"},xr=["max","value"],vr={class:"flex items-center justify-between pt-1.5 border-t border-slate-800"},gr={class:"font-bold text-slate-300 flex items-center gap-1.5 text-[11px]"},yr={class:"flex items-center gap-1.5 flex-wrap justify-end"},br=["onClick"],kr={class:"grid grid-cols-3 gap-2 pt-1.5 border-t border-slate-800"},wr=["checked"],_r=["checked"],Sr=["checked"],Tr=["disabled"],Cr=Vt({__name:"DashboardControls",props:{modelValue:{},options:{},isValid:{type:Boolean},validationError:{},isGenerating:{type:Boolean},generateStage:{},isAutoTopicLoading:{type:Boolean},drafts:{},activeDraftIndex:{},history:{},activeHistoryIndex:{},unsavedStash:{}},emits:["update:modelValue","update:options","generate","autoTopic","selectDraft","deleteDraft","saveDraft","selectHistory","deleteHistory","clearAllHistory","restoreStash","clearStash","toast"],setup(s,{emit:e}){const t=s,n=e,r=S(""),o=S(t.modelValue?.templateId||t.modelValue?.layoutType||"table"),p=S(!0),c=S(""),w=S(""),b=S("gemini-3.8-flash"),O=S("editor");function le(){n("restoreStash"),O.value="editor"}const G=S([]),$=S("tech"),M=S(!1),J=S(null),V=S({id:"",name:"",theme:"blue-tech",description:""});async function ge(){try{const u=await $fetch("/api/niches");u?.niches&&u.niches.length>0&&(G.value=u.niches,G.value.some(i=>i.id===$.value)||($.value=G.value[0].id))}catch(u){console.error("Failed to load niches:",u)}}function je(){J.value=null,V.value={id:"",name:"",theme:t.modelValue.theme||"blue-tech",description:""},M.value=!0}function de(u){J.value=u.id,V.value={id:u.id,name:u.name,theme:u.theme||"blue-tech",description:u.description}}async function re(){if(!V.value.name.trim()){alert("Nama Niche wajib diisi");return}const i={id:J.value||V.value.name.toLowerCase().replace(/[^a-z0-9_-]/g,"_"),name:V.value.name.trim(),theme:V.value.theme,description:V.value.description.trim()||`Fokus pada topik ${V.value.name.trim()}`};try{const d=await $fetch("/api/niches",{method:"POST",body:i});d?.niches&&(G.value=d.niches,$.value=i.id,J.value=null,V.value={id:"",name:"",theme:"blue-tech",description:""})}catch(d){alert("Gagal menyimpan niche: "+(d.data?.statusMessage||d.message))}}async function ne(u){if(G.value.length<=1){alert("Minimal harus ada 1 niche tersisa.");return}if(confirm("Hapus niche ini?"))try{const i=await $fetch(`/api/niches?id=${u}`,{method:"DELETE"});i?.niches&&(G.value=i.niches,$.value===u&&($.value=i.niches[0].id),J.value===u&&(J.value=null))}catch(i){alert("Gagal menghapus niche: "+(i.data?.statusMessage||i.message))}}const Y=S("id"),z=S([{id:"table",name:"📊 Comparison Table",category:"Perbandingan",description:"Tabel komparasi 2 entitas",icon:"Table",layoutType:"table",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"versus",name:"⚔️ Versus Showdown Arena",category:"Perbandingan",description:"Duel head-to-head dua kubu",icon:"Swords",layoutType:"versus",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"receipt",name:"🧾 Monthly Living Invoice",category:"Finansial",description:"Format slip gaji pengeluaran bulanan",icon:"Receipt",layoutType:"receipt",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"news",name:"📰 Special Report Pamphlet",category:"Jurnalisme",description:"Pamflet investigasi dengan 3 poin kunci",icon:"Newspaper",layoutType:"news",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"stat",name:"🎯 Big Shocking Number",category:"Analisis",description:"Fokus pada satu angka kontras raksasa",icon:"Target",layoutType:"stat",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"timeline",name:"⏳ 10-Year Shift (Then vs Now)",category:"Tren",description:"Pergeseran tren 10 tahun lalu vs sekarang",icon:"Clock",layoutType:"timeline",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"barchart",name:"📈 Income Allocation Bars",category:"Finansial",description:"Distribusi alokasi dana dengan bar chart",icon:"BarChart3",layoutType:"barchart",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"list",name:"🏆 Top 5 Ranked List",category:"Peringkat",description:"Ranking 5 teratas dengan kartu metrik",icon:"ListOrdered",layoutType:"list",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"quote",name:"💬 Hot Take / Quote Debate",category:"Opini",description:"Kutipan tajam memicu perdebatan",icon:"Quote",layoutType:"quote",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"leaderboard",name:"🥇 Multi-Country Leaderboard (Top 10)",category:"Peringkat",description:"Peringkat 5-10 negara dengan horizontal bar chart",icon:"Trophy",layoutType:"leaderboard",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"editorial",name:"📰 Editorial Storytelling Deep Dive",category:"Jurnalisme",description:"Format narasi editorial 3 kartu bertahap",icon:"BookOpen",layoutType:"editorial",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"matrix",name:"📊 Multi-Column Matrix (3-4 Negara)",category:"Perbandingan",description:"Tabel matriks komparasi 3-4 negara sekaligus",icon:"Grid",layoutType:"matrix",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"debate",name:"⚡ Debate Arena (Pro vs Kontra)",category:"Interaktif",description:"Arena debat dua kubu dengan skor komunitas",icon:"Flame",layoutType:"debate",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"tierlist",name:"🎖️ Tier List Ranking (S, A, B, C)",category:"Peringkat",description:"Hierarki tingkatan Tier S, A, B, C",icon:"Layers",layoutType:"tierlist",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"breaking-notifications",name:"📱 Breaking Alert Notification Stack",category:"Berita Viral",description:"Tumpukan 3 kartu notifikasi darurat kaca iOS/Android",icon:"Bell",layoutType:"custom",isBuiltin:!0,sampleData:{},promptDirective:""}]),pe=S(!1),ae=S("list"),q=S(null),he=S(""),te=S(""),me=S(!1),we=S(!1),X=S(""),N=S({id:"",name:"",category:"Kustom",description:"",layoutType:"custom",customHtml:"",customCss:"",promptDirective:"",sampleJsonText:""});async function qe(){try{const u=await $fetch("/api/templates");u?.templates&&u.templates.length>0&&(z.value=u.templates)}catch(u){console.error("Failed to load templates:",u)}}function A(u="list"){ae.value=u,te.value="",u==="form"&&P(),pe.value=!0}function h(){P(),te.value="",ae.value="form"}function K(){P(),te.value="",ae.value="list"}function _e(){pe.value=!1,P(),te.value="",ae.value="list"}function P(){q.value=null,N.value={id:"",name:"",category:"Kustom",description:"",layoutType:"custom",customHtml:`<div class="p-6 rounded-2xl bg-slate-900/90 border border-slate-700/80 text-center shadow-xl">
|
|
2
|
-
<span class="px-3 py-1 rounded-full text-xs font-black uppercase tracking-wider bg-sky-500/20 text-sky-400 border border-sky-500/30 mb-3 inline-block">{{ data.category }}</span>
|
|
3
|
-
<h2 class="text-3xl font-black text-white mb-2 leading-tight">{{ data.title }}</h2>
|
|
4
|
-
<p class="text-lg text-sky-300 font-bold mb-4">{{ data.subtitle }}</p>
|
|
5
|
-
</div>`,customCss:".custom-card-glow { box-shadow: 0 10px 30px -5px rgba(14, 165, 233, 0.3); }",promptDirective:"Instruksi khusus untuk AI saat generate format ini...",sampleJsonText:JSON.stringify({title:"JUDUL KONTEN MENARIK 2026",subtitle:"Subjudul penjelas berbasis fakta data",category:"KUSTOM VIRAL",watermark:"@SocialGen"},null,2)}}function Re(u){if(N.value.layoutType=u,u==="custom"){N.value.customHtml||(N.value.customHtml=`<div class="p-6 rounded-2xl bg-slate-900/90 border border-slate-700/80 text-center shadow-xl">
|
|
6
|
-
<span class="px-3 py-1 rounded-full text-xs font-black uppercase tracking-wider bg-sky-500/20 text-sky-400 border border-sky-500/30 mb-3 inline-block">{{ data.category }}</span>
|
|
7
|
-
<h2 class="text-3xl font-black text-white mb-2 leading-tight">{{ data.title }}</h2>
|
|
8
|
-
<p class="text-lg text-sky-300 font-bold mb-4">{{ data.subtitle }}</p>
|
|
9
|
-
</div>`);return}const i=z.value.find(d=>d.id===u||d.layoutType===u);i&&(N.value.promptDirective=i.promptDirective,N.value.sampleJsonText=JSON.stringify(i.sampleData,null,2),N.value.customHtml=i.customHtml||"",N.value.customCss=i.customCss||"")}function kt(u){q.value=u.id,N.value={id:u.id,name:u.name,category:u.category,description:u.description,layoutType:u.layoutType,customHtml:u.customHtml||"",customCss:u.customCss||"",promptDirective:u.promptDirective,sampleJsonText:JSON.stringify(u.sampleData,null,2)},ae.value="form"}function at(u){q.value=null,N.value={id:`${u.id}-custom-${Date.now().toString().slice(-4)}`,name:`${u.name} (Kustom)`,category:u.category||"Kustom",description:u.description,layoutType:u.layoutType,customHtml:u.customHtml||"",customCss:u.customCss||"",promptDirective:u.promptDirective,sampleJsonText:JSON.stringify(u.sampleData,null,2)},ae.value="form"}function wt(){navigator.clipboard.writeText(`Bertindaklah sebagai Senior Frontend UI/UX Designer dan Data Visual Strategist untuk SocialGen.
|
|
10
|
-
|
|
11
|
-
Saya melampirkan screenshot / gambar desain kartu visual media sosial.
|
|
12
|
-
|
|
13
|
-
Tugas Anda:
|
|
14
|
-
Analisis tata letak visual, bentuk dekorasi, tipografi, warna, dan komponen data pada gambar ini, lalu ubah menjadi template dinamis SocialGen dalam format 1 objek JSON valid persis seperti ini:
|
|
15
|
-
|
|
16
|
-
{
|
|
17
|
-
"name": "Nama Template Unik (Awali dengan Emoji, misal: 📜 Edukasi Banner & Pill Frame)",
|
|
18
|
-
"category": "Kategori Template (misal: Berita Viral, Edukasi, Finansial, Ranking, Sosmed, dsb)",
|
|
19
|
-
"description": "Deskripsi singkat 1-2 kalimat fungsi dan gaya visual template ini",
|
|
20
|
-
"layoutType": "custom",
|
|
21
|
-
"customHtml": "Kode HTML lengkap terstruktur rapi. BUKAN HANYA MENULISKAN TEKS PLACEHOLDER, tetapi WAJIB membuat elemen HTML pendukung yang mereplikasi bentuk visual pada gambar secara nyata (seperti div banner judul, kotak bingkai outline, kartu-kartu bentuk pil/bubble, badge, aksen silinder/3D, dsb). Berikan nama class CSS yang deskriptif pada setiap elemen (misal: class=\\"my-banner\\", class=\\"my-frame-box\\", class=\\"my-pill-item\\"). Gunakan variabel Handlebars: {{ data.title }}, {{ data.subtitle }}, looping {{#each data.items}} ... {{ text }} ... {{/each}}, dan WAJIB menyertakan elemen footer sumber data di bagian bawah: <div class=\\"my-footer\\"><span class=\\"my-source\\">{{ data.footerNote }}</span></div>",
|
|
22
|
-
"customCss": "KODE CSS MURNI LENGKAP (tanpa tag <style>) untuk mengatur tata letak, warna, bentuk, dan tipografi dari class-class yang Anda buat di customHtml di atas. JANGAN MENGANDALKAN ARBITRARY CLASS TAILWIND KARENA TAILWIND RUNTIME TIDAK AKAN MENGOMPILASINYA! Tuliskan styling eksplisit di CSS ini: font-size, background, border, border-radius, box-shadow, padding, margin, flexbox dsb.",
|
|
23
|
-
"sampleData": {
|
|
24
|
-
"templateId": "id-template-ini",
|
|
25
|
-
"title": "CONTOH JUDUL REALISTIS SESUAI GAMBAR",
|
|
26
|
-
"subtitle": "CONTOH SUBJUDUL SESUAI GAMBAR",
|
|
27
|
-
"category": "KATEGORI KONTEN",
|
|
28
|
-
"watermark": "@SocialGen",
|
|
29
|
-
"theme": "sunset-orange",
|
|
30
|
-
"footerNote": "Sumber: Lembaga Riset Terpercaya / Instansi Resmi (domain.go.id / .org) 2026",
|
|
31
|
-
"reelsDuration": 30,
|
|
32
|
-
"caption": "Pertanyaan pemantik interaksi dan komentar netizen? 👇 #hashtags",
|
|
33
|
-
"items": [
|
|
34
|
-
{ "text": "Poin penjelasan pertama sesuai kartu di gambar referensi..." },
|
|
35
|
-
{ "text": "Poin penjelasan kedua sesuai kartu di gambar referensi..." }
|
|
36
|
-
]
|
|
37
|
-
},
|
|
38
|
-
"promptDirective": "FORMAT STRUKTUR JSON:\\n- 'templateId': Wajib cantumkan ID template ini.\\n- 'title': Judul tajam kapital singkat.\\n- 'subtitle': Subjudul informatif.\\n- 'footerNote': WAJIB cantumkan nama lembaga/sumber data riset resmi & tahun data.\\n- 'items': Array objek berisi poin-poin penjelasan singkat padat sesuai struktur template."
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
=======================================================
|
|
42
|
-
PANDUAN KRUSIAL PEMBUATAN TEMPLATE VISUAL SOCIALGEN:
|
|
43
|
-
1. REPLIKASI BENTUK VISUAL NYATA (WAJIB):
|
|
44
|
-
- Amati layout gambar secara teliti: Posisi judul (di kiri atas, tengah, atau kanan?), bentuk banner/badge pembungkus judul, kotak outline bingkai pembungkus, bentuk kartu konten (apakah lonjong seperti pil, kotak rounded, atau list bertingkat?).
|
|
45
|
-
- Anda WAJIB membuat tag HTML <div> dengan class CSS untuk setiap elemen tersebut, JANGAN hanya menuliskan {{ data.title }} {{ data.items }} tanpa tag dan styling!
|
|
46
|
-
|
|
47
|
-
2. WAJIB TULIS STYLING DI 'customCss' (BUKAN TAILWIND ARBITRARY):
|
|
48
|
-
- Karena aplikasi sudah di-compile, class Tailwind baru seperti text-[64px] atau bg-[#fdedd8] TIDAK AKAN aktif.
|
|
49
|
-
- SEMUA warna spesifik, border, border-radius, efek 3D/bayangan, dan ukuran teks WAJIB didefinisikan di dalam field \\"customCss\\".
|
|
50
|
-
|
|
51
|
-
3. SKALA UKURAN KANVAS RESOLUSI TINGGI (1080x1350 px):
|
|
52
|
-
- Kanvas SocialGen berukuran 1080px. Gunakan ukuran font besar agar terbaca jelas:
|
|
53
|
-
* Judul Utama (title): 60px – 76px (font-weight: 900/bold)
|
|
54
|
-
* Subjudul (subtitle): 24px – 28px
|
|
55
|
-
* Teks Kartu / Pil (items): 22px – 26px
|
|
56
|
-
* Teks Sumber (footerNote): 16px – 18px
|
|
57
|
-
|
|
58
|
-
4. ATURAN WAJIB SUMBER DATA (SOURCE ATTRIBUTION):
|
|
59
|
-
- Setiap tampilan konten WAJIB menampilkan informasi sumber data (footerNote) di bagian bawah agar konten kredibel dan terpercaya.
|
|
60
|
-
- Di dalam customHtml WAJIB ada elemen yang menampilkan: {{ data.footerNote }}.
|
|
61
|
-
- Di dalam promptDirective WAJIB diinstruksikan agar AI generator konten selalu mengisi field 'footerNote' dengan referensi riset nyata.
|
|
62
|
-
|
|
63
|
-
5. PANDUAN SINTAKS DATA SOCIALGEN:
|
|
64
|
-
- Interpolasi data teks: gunakan {{ data.namaField }} atau {{ namaField }}.
|
|
65
|
-
- Looping data list/array: gunakan {{#each data.namaArray}} ... {{ propertiItem }} ... {{/each}}.
|
|
66
|
-
|
|
67
|
-
Keluarkan HANYA 1 objek JSON valid tanpa markdown formatting (\`\`\`json) agar bisa langsung diimpor otomatis ke aplikasi SocialGen.`),me.value=!0,setTimeout(()=>{me.value=!1},3e3)}function _t(){if(te.value="",!!X.value.trim())try{let u=X.value.trim();u=u.replace(/^```json\s*/i,"").replace(/```$/i,"").trim();const i=JSON.parse(u);i.name&&(N.value.name=i.name),i.category&&(N.value.category=i.category),i.description&&(N.value.description=i.description),N.value.layoutType=i.layoutType||"custom",i.customHtml&&(N.value.customHtml=i.customHtml),i.customCss&&(N.value.customCss=i.customCss),i.promptDirective&&(N.value.promptDirective=i.promptDirective),i.sampleData&&(i.sampleData.id||(i.sampleData.id=i.id||N.value.id||"sample-"+Date.now()),N.value.sampleJsonText=JSON.stringify(i.sampleData,null,2)),we.value=!1,X.value=""}catch(u){te.value="Gagal membaca JSON dari AI: "+u.message}}async function I(){if(te.value="",!N.value.name.trim()){te.value="Nama template wajib diisi";return}const u=q.value||N.value.id.trim()||N.value.name.toLowerCase().replace(/[^a-z0-9_-]/g,"-");let i=null;try{i=JSON.parse(N.value.sampleJsonText),i.id||(i.id=u)}catch(d){te.value="JSON Sampel Data tidak valid: "+d.message;return}try{const d=await $fetch("/api/templates",{method:"POST",body:{id:u,name:N.value.name.trim(),category:N.value.category.trim()||"Kustom",description:N.value.description.trim(),layoutType:N.value.layoutType,customHtml:N.value.customHtml?.trim()||void 0,customCss:N.value.customCss?.trim()||void 0,sampleData:i,promptDirective:N.value.promptDirective.trim(),isBuiltin:!!(q.value&&z.value.find(B=>B.id===q.value)?.isBuiltin)}});d?.templates&&(z.value=d.templates),ae.value="list",q.value=null}catch(d){te.value=d.data?.statusMessage||d.message||"Gagal menyimpan template"}}async function y(u){if(confirm("Yakin ingin menghapus template kustom ini?"))try{const i=await $fetch(`/api/templates?id=${u}`,{method:"DELETE"});i?.templates&&(z.value=i.templates)}catch(i){alert(i.data?.statusMessage||i.message||"Gagal menghapus template")}}function Me(u){Tt(u.layoutType==="custom"?u.id:u.layoutType||u.id),pe.value=!1}const ie=ue(()=>{if(!he.value.trim())return z.value;const u=he.value.toLowerCase();return z.value.filter(i=>i.name.toLowerCase().includes(u)||i.category.toLowerCase().includes(u)||i.description.toLowerCase().includes(u)||i.layoutType.toLowerCase().includes(u))}),St=S(!1),st=S(""),nt=S({}),Zt=S(!1),it=S(!1),Ut=S(["cyber_blue.mp4","emerald_flow.mp4","default_bg.mp4"]),Jt=S(["synthwave_pulse.mp3","lofi_chill.mp3","default_ambient.mp3"]),rt=S({"neon_cyber_grid.mp4":8,"financial_pulse_flow.mp4":8,"dark_luxury_particles.mp4":8,"cyber_matrix_stream.mp4":10,"cyber_blue.mp4":15,"default_bg.mp4":15,"emerald_flow.mp4":15,"cyber_pulse.mp4":15,"cyber_future_tech.mp3":15,"dark_phonk_pulse.mp3":15,"deep_finance_groove.mp3":15,"synthwave_pulse.mp3":15,"lofi_chill.mp3":15,"default_ambient.mp3":15,"motivation_cinematic.mp3":110,"lofi_viral_study.mp3":147}),Ht=ue(()=>{const u=t.options.backgroundSource||"";return rt.value[u]||15}),ot=ue(()=>Math.max(1,Ht.value-1)),Ft=ue(()=>{const u=t.options.musicFile||"";return rt.value[u]||30}),lt=ue(()=>Math.max(1,Ft.value-1));ve(()=>t.options.backgroundSource,()=>{const u=ot.value;(t.options.videoStartOffset||0)>u&&Ee("videoStartOffset",u)}),ve(()=>t.options.musicFile,()=>{const u=lt.value;(t.options.audioStartOffset||0)>u&&Ee("audioStartOffset",u)});const Ue=S(!1),zt=S(null),Gt=S(null);async function Kt(){try{const u=await $fetch("/api/media");u?.videos?.length&&(Ut.value=u.videos),u?.audio?.length&&(Jt.value=u.audio),u?.durations&&(rt.value={...rt.value,...u.durations})}catch(u){console.error("Failed to fetch media list:",u)}}wa(()=>{try{const u=localStorage.getItem("sg_selected_language");u&&(Y.value=u)}catch{}Kt(),ge(),qe()}),ve(Y,u=>{try{localStorage.setItem("sg_selected_language",u)}catch{}});async function Wt(u,i){const d=u.target,B=d.files?.[0];if(B){Ue.value=!0;try{const W=new FormData;W.append("file",B);const ye=await $fetch("/api/upload-media",{method:"POST",body:W});ye?.success&&(await Kt(),ye.type==="video"?Ee("backgroundSource",ye.filename):Ee("musicFile",ye.filename))}catch(W){alert("Upload gagal: "+(W.data?.statusMessage||W.message))}finally{Ue.value=!1,d.value=""}}}const fe=ue(()=>{const u=(o.value||"table").trim().toLowerCase();return z.value.find(i=>i.id.toLowerCase()===u||i.layoutType&&i.layoutType.toLowerCase()===u)||z.value[0]}),xe=ue(()=>{const u=r.value.trim();if(!u)return null;try{return JSON.parse(u)}catch{return null}}),Se=ue(()=>{if(!r.value.trim()||!xe.value)return null;const u=(xe.value.templateId||xe.value.layoutType||(z.value.some(W=>W.id===xe.value?.id)?xe.value?.id:"")||"").trim().toLowerCase();if(!u)return null;const i=(o.value||"").trim().toLowerCase(),d=(fe.value?.layoutType||"").trim().toLowerCase();if(u===i||u===d)return null;const B=z.value.find(W=>W.id.toLowerCase()===u||W.layoutType&&W.layoutType.toLowerCase()===u);return{jsonTemplateId:xe.value.templateId||xe.value.layoutType||xe.value.id,matchedTarget:B||null,isKnown:!!B}}),Ye=ue(()=>{if(!r.value.trim()){const u=fe.value?.sampleData?JSON.parse(JSON.stringify(fe.value.sampleData)):{},i=fe.value?.id||"table",d=fe.value?.layoutType==="custom"?i:fe.value?.layoutType||i;return{...u,id:u.id||i,templateId:i,layoutType:d,customHtml:fe.value?.customHtml||void 0,customCss:fe.value?.customCss||void 0}}if(xe.value){const u=fe.value?.id||xe.value.templateId||"table",i=fe.value?.layoutType==="custom"?u:fe.value?.layoutType||u;return{...xe.value,templateId:u,layoutType:i,customHtml:fe.value?.customHtml||xe.value.customHtml||void 0,customCss:fe.value?.customCss||xe.value.customCss||void 0}}return t.modelValue});ve(()=>Ye.value,u=>{n("update:modelValue",u),u.theme&&u.theme!==t.options.theme&&n("update:options",{...t.options,theme:u.theme})},{immediate:!0,deep:!0}),ve(()=>t.modelValue,u=>{if(!u)return;const i=JSON.stringify(Ye.value),d=JSON.stringify(u);if(i!==d){const B=u.templateId||u.layoutType;if(B){const W=z.value.find(ye=>ye.id.toLowerCase()===B.toLowerCase()||ye.layoutType&&ye.layoutType.toLowerCase()===B.toLowerCase());W&&(o.value=W.id)}r.value=JSON.stringify(u,null,2)}},{deep:!0}),ve(()=>t.unsavedStash,(u,i)=>{i&&!u&&(O.value="editor")});function Oa(u){const i=u.target;if(r.value=i.value,!i.value.trim()){c.value="";return}try{const d=JSON.parse(i.value);if(c.value="",p.value){const B=(d.templateId||d.layoutType||(z.value.some(W=>W.id===d.id)?d.id:"")||"").trim().toLowerCase();if(B){const W=z.value.find(ye=>ye.id.toLowerCase()===B||ye.layoutType&&ye.layoutType.toLowerCase()===B);W&&W.id.toLowerCase()!==o.value.toLowerCase()&&(o.value=W.id,n("toast",`Otomatis pindah ke template ${W.name}`,"success"))}}}catch(d){c.value="Invalid JSON: "+d.message}}function qt(){r.value="",c.value="",n("toast",`Menggunakan data sampel template ${fe.value?.name||""}`,"success")}function Ma(){if(r.value.trim())try{const u=JSON.parse(r.value);r.value=JSON.stringify(u,null,2),c.value=""}catch{c.value="Cannot format invalid JSON"}}function Tt(u){o.value=u}function Da(u){try{const i=r.value.trim()?JSON.parse(r.value):{...Ye.value};i.title=u,r.value=JSON.stringify(i,null,2)}catch{}}function $a(u){try{const i=r.value.trim()?JSON.parse(r.value):{...Ye.value};i.watermark=u,r.value=JSON.stringify(i,null,2)}catch{}}function ja(u){try{const i=r.value.trim()?JSON.parse(r.value):{...Ye.value};i.theme=u,r.value=JSON.stringify(i,null,2)}catch{}n("update:options",{...t.options,theme:u})}function Ra(u){const i={...t.modelValue,reelsDuration:u};n("update:modelValue",i)}function Ee(u,i){n("update:options",{...t.options,[u]:i})}function Ct(u,i){const d=t.options.outputs||{feed:!0,story:!0,reels:!0};n("update:options",{...t.options,outputs:{...d,[u]:i}})}function Yt(u,i){n("autoTopic",$.value,i||w.value||void 0,b.value,Y.value)}async function Ea(){St.value=!0,Zt.value=!0;try{const u=await $fetch("/api/copy-prompt",{query:{niche:$.value,layout:t.modelValue.layoutType||"table",language:Y.value}});st.value=u.prompt,nt.value={topic:u.topic,pair:u.pair,niche:u.niche,template:u.template,usedCount:u.usedCount,language:u.language||Y.value}}catch(u){console.error("Failed to get manual prompt:",u)}finally{Zt.value=!1}}function La(){st.value&&(navigator.clipboard.writeText(st.value),it.value=!0,setTimeout(()=>{it.value=!1},2500))}function Pa(){t.history.length!==0&&confirm(`Bersihkan semua ${t.history.length} riwayat generate otomatis?`)&&n("clearAllHistory")}function Va(u){if(!u)return"";try{return new Date(u).toLocaleDateString("id-ID",{day:"numeric",month:"short",hour:"2-digit",minute:"2-digit"})}catch{return""}}return(u,i)=>(f(),v("div",ns,[l(M)?(f(),v("div",is,[a("div",rs,[a("div",os,[a("div",null,[a("h3",ls,[C(l(sa),{class:"w-4 h-4 text-sky-400"}),i[47]||(i[47]=F(" Kelola & Buat Niche Baru ",-1))]),i[48]||(i[48]=a("p",{class:"text-[11px] text-slate-400 mt-0.5"}," Simpan niche favoritmu. AI dan Prompt Generator akan otomatis menggunakannya. ",-1))]),a("button",{onClick:i[0]||(i[0]=d=>M.value=!1),class:"p-1 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800"},[C(l(It),{class:"w-4 h-4"})])]),a("div",ds,[a("div",us,[a("span",null,g(l(J)?"✏️ Edit Niche":"➕ Tambah Niche Baru"),1),l(J)?(f(),v("button",{key:0,onClick:i[1]||(i[1]=d=>{J.value=null,V.value={id:"",name:"",theme:"blue-tech",description:""}}),class:"text-[10px] text-slate-400 hover:text-white"}," Batal Edit ")):E("",!0)]),a("div",cs,[a("div",null,[i[49]||(i[49]=a("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Nama Niche",-1)),oe(a("input",{"onUpdate:modelValue":i[2]||(i[2]=d=>l(V).name=d),type:"text",placeholder:"Contoh: Kuliner & Restoran, Otomotif EV",class:"w-full bg-slate-900 border border-slate-800 rounded-xl px-2.5 py-1.5 text-xs text-white focus:outline-none focus:border-sky-500"},null,512),[[be,l(V).name]])]),a("div",null,[i[51]||(i[51]=a("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Tema Default",-1)),oe(a("select",{"onUpdate:modelValue":i[3]||(i[3]=d=>l(V).theme=d),class:"w-full bg-slate-900 border border-slate-800 rounded-xl px-2.5 py-1.5 text-xs text-white focus:outline-none focus:border-sky-500"},[...i[50]||(i[50]=[ut('<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),[[dt,l(V).theme]])])]),a("div",null,[i[52]||(i[52]=a("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Fokus Topik & Instruksi Prompt",-1)),oe(a("textarea",{"onUpdate:modelValue":i[4]||(i[4]=d=>l(V).description=d),rows:"2",placeholder:"Jelaskan topik yang ingin disorot AI (misal: perbandingan harga kopi, biaya buka gerai, margin laba kuliner...)",class:"w-full bg-slate-900 border border-slate-800 rounded-xl p-2 text-xs text-slate-200 focus:outline-none focus:border-sky-500 resize-none leading-relaxed"},null,512),[[be,l(V).description]])]),a("button",{onClick:re,class:"self-end px-4 py-1.5 rounded-xl bg-sky-600 hover:bg-sky-500 text-white font-bold text-xs transition flex items-center gap-1.5 shadow"},[C(l(He),{class:"w-3.5 h-3.5"}),a("span",null,g(l(J)?"Perbarui Niche":"Simpan Niche"),1)])]),a("div",ps,[a("div",ms," Daftar Niche Tersimpan ("+g(l(G).length)+") ",1),a("div",fs,[(f(!0),v(Te,null,Ce(l(G),d=>(f(),v("div",{key:d.id,class:"p-2.5 rounded-xl border bg-slate-950 border-slate-800 flex items-start justify-between gap-2"},[a("div",hs,[a("div",xs,[a("span",vs,g(d.name),1),a("span",gs,g(d.theme||"blue-tech"),1)]),a("p",ys,g(d.description),1)]),a("div",bs,[a("button",{onClick:B=>de(d),class:"p-1.5 rounded-lg text-slate-400 hover:text-sky-300 hover:bg-slate-800 transition",title:"Edit Niche"},[C(l(pt),{class:"w-3.5 h-3.5"})],8,ks),a("button",{onClick:B=>ne(d.id),class:"p-1.5 rounded-lg text-slate-400 hover:text-rose-400 hover:bg-slate-800 transition",title:"Hapus Niche"},[C(l(mt),{class:"w-3.5 h-3.5"})],8,ws)])]))),128))])])])])):E("",!0),l(St)?(f(),v("div",_s,[a("div",Ss,[a("div",Ts,[a("div",null,[a("h3",Cs,[C(l(ta),{class:"w-4 h-4 text-purple-400"}),i[53]||(i[53]=F(" Master Prompt AI (Dynamic Research & Zero-Collision) ",-1))]),i[54]||(i[54]=a("p",{class:"text-[11px] text-slate-400 mt-0.5"}," Salin prompt ini ke ChatGPT / Gemini / Claude / DeepSeek untuk mencari topik terbaru. ",-1))]),a("button",{onClick:i[5]||(i[5]=d=>St.value=!1),class:"p-1 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800"},[C(l(It),{class:"w-4 h-4"})])]),a("div",As,[i[55]||(i[55]=a("span",{class:"font-bold text-sky-400"},"Niche Aktif:",-1)),a("span",Ns,g(l(G).find(d=>d.id===l($))?.name||"Default"),1),i[56]||(i[56]=a("span",{class:"text-slate-500"},"•",-1)),i[57]||(i[57]=a("span",{class:"font-bold text-amber-400"},"Template:",-1)),a("span",Is,g(l(nt).template||"Otomatis"),1),i[58]||(i[58]=a("span",{class:"text-slate-500"},"•",-1)),i[59]||(i[59]=a("span",{class:"font-bold text-emerald-400"},"Bahasa:",-1)),a("span",Os,g(l(nt).language||"Bahasa Indonesia 🇮🇩"),1),i[60]||(i[60]=a("span",{class:"text-slate-500"},"•",-1)),a("span",Ms,g(l(nt).usedCount||0)+" Topik Riwayat Dikecualikan",1)]),a("div",Ds,[a("textarea",{value:l(st),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,$s)]),a("div",js,[i[61]||(i[61]=a("span",{class:"text-[11px] text-slate-400"},[F(" Paste hasil JSON yang kamu buat ke kolom "),a("b",null,"RAW JSON"),F(" SocialGen. ")],-1)),a("button",{onClick:La,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(it)?(f(),Ae(l(He),{key:0,class:"w-4 h-4 text-emerald-400"})):(f(),Ae(l(ft),{key:1,class:"w-4 h-4"})),a("span",null,g(l(it)?"Prompt Berhasil Disalin!":"Copy Master Prompt"),1)])])])])):E("",!0),l(pe)?(f(),v("div",{key:2,onClick:At(_e,["self"]),class:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm flex items-center justify-center p-4"},[a("div",Rs,[a("div",Es,[a("div",null,[a("h3",Ls,[C(l(aa),{class:"w-4 h-4 text-sky-400"}),i[62]||(i[62]=F(" Kelola Template Visual (Dynamic Template System) ",-1))]),i[63]||(i[63]=a("p",{class:"text-[11px] text-slate-400 mt-0.5"}," Buat format baru, edit sampel tampilan, dan atur prompt AI spesifik per template. ",-1))]),a("button",{onClick:_e,class:"p-1 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800"},[C(l(It),{class:"w-4 h-4"})])]),a("div",Ps,[a("div",Vs,[a("button",{onClick:K,class:H(["px-3 py-1 rounded-lg transition font-bold text-xs",l(ae)==="list"?"bg-slate-800 text-sky-400 shadow":"text-slate-400 hover:text-white"])}," Daftar Template ("+g(l(z).length)+") ",3),a("button",{onClick:h,class:H(["px-3 py-1 rounded-lg transition font-bold text-xs flex items-center gap-1",l(ae)==="form"&&!l(q)?"bg-slate-800 text-emerald-400 shadow":"text-slate-400 hover:text-white"])},[C(l(Nt),{class:"w-3.5 h-3.5"}),i[64]||(i[64]=a("span",null,"Buat Template Baru",-1))],2),l(q)&&l(ae)==="form"?(f(),v("span",Bs,[C(l(pt),{class:"w-3 h-3"}),i[65]||(i[65]=a("span",null,"Sedang Edit Template",-1))])):E("",!0)]),l(ae)==="list"?oe((f(),v("input",{key:0,"onUpdate:modelValue":i[6]||(i[6]=d=>Be(he)?he.value=d:null),type:"text",placeholder:"Cari template...",class:"bg-slate-900 border border-slate-800 rounded-lg px-2 py-0.5 text-[11px] text-white focus:outline-none focus:border-sky-500 w-36"},null,512)),[[be,l(he)]]):E("",!0)]),l(ae)==="list"?(f(),v("div",Zs,[l(ie).length===0?(f(),v("div",Us,' Tidak ada template yang cocok dengan pencarian "'+g(l(he))+'". ',1)):E("",!0),(f(!0),v(Te,null,Ce(l(ie),d=>(f(),v("div",{key:d.id,class:"p-3 rounded-2xl border bg-slate-950 border-slate-800/80 hover:border-slate-700 transition flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 group"},[a("div",Js,[a("div",Hs,[a("span",Fs,g(d.name),1),a("span",zs,g(d.category),1),a("span",{class:H(["px-1.5 py-0.2 rounded text-[8px] font-bold uppercase tracking-wider",d.isBuiltin?"bg-slate-800 text-slate-400 border border-slate-700":"bg-purple-950 text-purple-300 border border-purple-800"])},g(d.isBuiltin?"Bawaan":"⭐ Kustom"),3),a("span",Gs," layout: "+g(d.layoutType),1)]),a("p",Ks,g(d.description||"Tidak ada deskripsi."),1)]),a("div",Ws,[a("button",{onClick:B=>Me(d),class:"px-2.5 py-1 rounded-xl bg-sky-600/20 hover:bg-sky-600/40 text-sky-300 border border-sky-500/40 font-bold text-[10px] transition flex items-center gap-1",title:"Pilih dan gunakan format template ini"},[C(l(He),{class:"w-3 h-3"}),i[66]||(i[66]=a("span",null,"Pilih Format",-1))],8,qs),a("button",{onClick:B=>at(d),class:"p-1.5 rounded-lg text-slate-400 hover:text-sky-300 hover:bg-slate-800 transition",title:"Duplikasi sebagai template kustom baru"},[C(l(ft),{class:"w-3.5 h-3.5"})],8,Ys),d.isBuiltin?E("",!0):(f(),v("button",{key:0,onClick:B=>kt(d),class:"p-1.5 rounded-lg text-slate-400 hover:text-amber-300 hover:bg-slate-800 transition",title:"Edit template kustom"},[C(l(pt),{class:"w-3.5 h-3.5"})],8,Xs)),d.isBuiltin?E("",!0):(f(),v("button",{key:1,onClick:B=>y(d.id),class:"p-1.5 rounded-lg text-slate-400 hover:text-rose-400 hover:bg-slate-800 transition",title:"Hapus template kustom"},[C(l(mt),{class:"w-3.5 h-3.5"})],8,Qs))])]))),128))])):(f(),v("div",en,[l(te)?(f(),v("div",tn,g(l(te)),1)):E("",!0),l(q)?(f(),v("div",an,[a("div",sn,[a("div",nn,[C(l(pt),{class:"w-4 h-4"})]),a("div",rn,[a("div",on,[i[67]||(i[67]=a("span",null,"Sedang Mengedit:",-1)),a("span",ln,g(l(N).name),1)]),a("div",dn,"ID: "+g(l(N).id)+" • Perubahan akan memperbarui template yang tersimpan",1)])]),a("button",{onClick:h,type:"button",class:"px-2.5 py-1 rounded-xl bg-slate-900 hover:bg-slate-800 text-slate-200 border border-slate-700 text-[10px] font-bold transition flex items-center gap-1 shrink-0 ml-2"},[C(l(Nt),{class:"w-3 h-3"}),i[68]||(i[68]=a("span",null,"Beralih ke Buat Baru",-1))])])):E("",!0),a("div",un,[a("div",cn,[i[70]||(i[70]=a("div",{class:"flex items-center gap-2"},[a("span",{class:"text-xl"},"🤖"),a("div",null,[a("h4",{class:"text-xs font-black text-white"},"Buat Template Otomatis dari Screenshot / Gambar"),a("p",{class:"text-[10px] text-slate-400"},"Punya referensi gambar desain? Salin prompt AI dan kirim bersama screenshot ke ChatGPT / Claude / Gemini.")])],-1)),a("div",pn,[a("button",{onClick:wt,type:"button",class:H(["px-2.5 py-1.5 rounded-xl text-xs font-bold transition flex items-center gap-1.5 shadow",l(me)?"bg-emerald-600 text-white":"bg-sky-600 hover:bg-sky-500 text-white"])},[C(l(ft),{class:"w-3.5 h-3.5"}),a("span",null,g(l(me)?"✓ Prompt Tersalin!":"Salin Prompt Bantuan AI"),1)],2),a("button",{onClick:i[7]||(i[7]=d=>we.value=!l(we)),type:"button",class:"px-2.5 py-1.5 rounded-xl bg-slate-800 hover:bg-slate-700 text-slate-200 text-xs font-bold transition flex items-center gap-1"},[...i[69]||(i[69]=[a("span",null,"📥 Tempel JSON dari AI",-1)])])])]),l(we)?(f(),v("div",mn,[i[71]||(i[71]=a("label",{class:"text-[10px] font-bold text-sky-400"},"Tempelkan respon JSON dari AI di sini:",-1)),oe(a("textarea",{"onUpdate:modelValue":i[8]||(i[8]=d=>Be(X)?X.value=d:null),rows:"4",placeholder:'Tempelkan respon JSON dari AI di sini (contoh: { "name": "...", "layoutType": "custom", "customHtml": "...", "sampleData": {...} })...',class:"w-full bg-slate-900 border border-slate-700 rounded-lg p-2 text-xs text-sky-200 font-mono focus:outline-none focus:border-sky-500"},null,512),[[be,l(X)]]),a("div",fn,[a("button",{onClick:i[9]||(i[9]=d=>we.value=!1),type:"button",class:"px-2.5 py-1 rounded-lg text-[10px] font-bold text-slate-400 hover:text-white"}," Tutup "),a("button",{onClick:_t,type:"button",class:"px-3 py-1 rounded-lg bg-emerald-600 hover:bg-emerald-500 text-white text-[10px] font-bold shadow"}," Terapkan ke Form Otomatis ")])])):E("",!0)]),a("div",hn,[a("div",null,[i[72]||(i[72]=a("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"ID Template (Slug Unik)",-1)),oe(a("input",{"onUpdate:modelValue":i[10]||(i[10]=d=>l(N).id=d),disabled:!!l(q),type:"text",placeholder:"misal: tech-radar, crypto-card",class:"w-full bg-slate-950 border border-slate-800 rounded-xl px-2.5 py-1.5 text-xs text-white focus:outline-none focus:border-sky-500 disabled:opacity-50"},null,8,xn),[[be,l(N).id]])]),a("div",null,[i[73]||(i[73]=a("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Nama Template",-1)),oe(a("input",{"onUpdate:modelValue":i[11]||(i[11]=d=>l(N).name=d),type:"text",placeholder:"misal: ⚡ Tech Radar 2026",class:"w-full bg-slate-950 border border-slate-800 rounded-xl px-2.5 py-1.5 text-xs text-white focus:outline-none focus:border-sky-500"},null,512),[[be,l(N).name]])]),a("div",null,[i[74]||(i[74]=a("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Kategori",-1)),oe(a("input",{"onUpdate:modelValue":i[12]||(i[12]=d=>l(N).category=d),type:"text",placeholder:"misal: Perbandingan, Peringkat, Finansial",class:"w-full bg-slate-950 border border-slate-800 rounded-xl px-2.5 py-1.5 text-xs text-white focus:outline-none focus:border-sky-500"},null,512),[[be,l(N).category]])])]),a("div",vn,[a("div",null,[i[76]||(i[76]=a("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Base Layout Visual Engine",-1)),a("select",{value:l(N).layoutType,onChange:i[13]||(i[13]=d=>Re(d.target.value)),class:"w-full bg-slate-950 border border-slate-800 rounded-xl px-2.5 py-1.5 text-xs text-sky-300 font-semibold focus:outline-none focus:border-sky-500"},[...i[75]||(i[75]=[ut('<option value="custom">🎨 Custom HTML & CSS (Bebas / Desain Sendiri)</option><option value="table">📊 Comparison Table</option><option value="versus">⚔️ Versus Showdown Arena</option><option value="receipt">🧾 Monthly Living Invoice</option><option value="news">📰 Special Report Pamphlet</option><option value="stat">🎯 Big Shocking Number</option><option value="timeline">⏳ 10-Year Shift (Then vs Now)</option><option value="barchart">📈 Income Allocation Bars</option><option value="list">🏆 Top 5 Ranked List</option><option value="quote">💬 Hot Take / Quote Debate</option><option value="leaderboard">🥇 Multi-Country Leaderboard (Top 10)</option><option value="editorial">📰 Editorial Storytelling Deep Dive</option><option value="matrix">📊 Multi-Column Matrix (3-4 Negara)</option><option value="debate">⚡ Debate Arena (Pro vs Kontra)</option><option value="tierlist">🎖️ Tier List Ranking (S, A, B, C)</option>',15)])],40,gn)]),a("div",null,[i[77]||(i[77]=a("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Deskripsi Ringkas",-1)),oe(a("input",{"onUpdate:modelValue":i[14]||(i[14]=d=>l(N).description=d),type:"text",placeholder:"Jelaskan kegunaan format tampilan template ini...",class:"w-full bg-slate-950 border border-slate-800 rounded-xl px-2.5 py-1.5 text-xs text-white focus:outline-none focus:border-sky-500"},null,512),[[be,l(N).description]])])]),l(N).layoutType==="custom"?(f(),v("div",yn,[a("div",bn,[a("span",kn,[C(l(za),{class:"w-3.5 h-3.5"}),i[78]||(i[78]=F(" Template Engine HTML & Styling CSS ",-1))]),i[79]||(i[79]=a("span",{class:"text-[10px] text-slate-400 font-mono"},"Gunakan {{ data.title }} & {{#each data.items}}",-1))]),a("div",null,[i[80]||(i[80]=a("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"HTML Template (Tailwind utility classes didukung penuh)",-1)),oe(a("textarea",{"onUpdate:modelValue":i[15]||(i[15]=d=>l(N).customHtml=d),rows:"6",placeholder:`<div class="p-6 rounded-2xl bg-slate-900/90 border border-slate-700 text-center">
|
|
68
|
-
<h2 class="text-3xl font-black text-white">{{ data.title }}</h2>
|
|
69
|
-
<p class="text-slate-300">{{ data.subtitle }}</p>
|
|
70
|
-
</div>`,class:"w-full bg-slate-900 border border-slate-800 rounded-xl p-2.5 text-xs text-sky-300 font-mono leading-relaxed focus:outline-none focus:border-sky-500"},null,512),[[be,l(N).customHtml]])]),a("div",null,[i[81]||(i[81]=a("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Custom CSS (Opsional - animasi, gradien unik, glassmorphism)",-1)),oe(a("textarea",{"onUpdate:modelValue":i[16]||(i[16]=d=>l(N).customCss=d),rows:"3",placeholder:".my-custom-card { backdrop-filter: blur(16px); }",class:"w-full bg-slate-900 border border-slate-800 rounded-xl p-2.5 text-xs text-emerald-300 font-mono leading-relaxed focus:outline-none focus:border-emerald-500"},null,512),[[be,l(N).customCss]])])])):E("",!0),a("div",null,[i[82]||(i[82]=a("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"AI Prompt Directive (Aturan Khusus Generator)",-1)),oe(a("textarea",{"onUpdate:modelValue":i[17]||(i[17]=d=>l(N).promptDirective=d),rows:"3",placeholder:"Instruksi spesifik untuk AI Gemini / ChatGPT saat meriset konten dengan template ini...",class:"w-full bg-slate-950 border border-slate-800 rounded-xl p-2.5 text-xs text-slate-200 focus:outline-none focus:border-sky-500 font-mono leading-relaxed"},null,512),[[be,l(N).promptDirective]])]),a("div",null,[i[83]||(i[83]=a("div",{class:"flex items-center justify-between mb-1"},[a("label",{class:"text-[10px] font-bold text-slate-400"},"Sampel Data JSON (Pristine Default Tampilan)"),a("span",{class:"text-[10px] text-slate-500"},"Akan langsung ditampilkan di Live Preview")],-1)),oe(a("textarea",{"onUpdate:modelValue":i[18]||(i[18]=d=>l(N).sampleJsonText=d),rows:"7",class:"w-full bg-slate-950 border border-slate-800 rounded-xl p-2.5 text-xs text-sky-200 focus:outline-none focus:border-sky-500 font-mono leading-relaxed select-all"},null,512),[[be,l(N).sampleJsonText]])]),a("div",wn,[a("button",{onClick:K,class:"px-3.5 py-1.5 rounded-xl bg-slate-800 hover:bg-slate-700 text-slate-300 font-bold text-xs transition"}," Batal "),a("button",{onClick:I,class:"px-5 py-1.5 rounded-xl bg-gradient-to-r from-emerald-600 to-teal-600 hover:from-emerald-500 hover:to-teal-500 text-white font-bold text-xs shadow-lg transition flex items-center gap-1.5"},[C(l(He),{class:"w-3.5 h-3.5"}),a("span",null,g(l(q)?"Perbarui Template":"Simpan Template"),1)])])]))])])):E("",!0),a("div",_n,[a("div",null,[a("h2",Sn,[C(l(ts),{class:"w-3.5 h-3.5 text-sky-400"}),i[84]||(i[84]=F(" Content Studio ",-1))]),i[85]||(i[85]=a("p",{class:"text-[10px] text-slate-400"},"Multi-Format Studio",-1))]),a("div",Tn,[a("div",Cn,[oe(a("select",{"onUpdate:modelValue":i[19]||(i[19]=d=>Be($)?$.value=d:null),class:"bg-transparent text-[11px] font-bold text-sky-300 focus:outline-none px-2 py-0.5 cursor-pointer max-w-[130px] truncate",title:"Pilih Niche Konten"},[(f(!0),v(Te,null,Ce(l(G),d=>(f(),v("option",{key:d.id,value:d.id,class:"bg-slate-900 text-white"},g(d.name),9,An))),128))],512),[[dt,l($)]]),a("button",{onClick:je,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"},[C(l(Nt),{class:"w-3 h-3"}),i[86]||(i[86]=a("span",{class:"hidden sm:inline"},"Niche",-1))])]),a("div",Nn,[C(l(Wa),{class:"w-3 h-3 text-emerald-400 ml-1 flex-shrink-0"}),oe(a("select",{"onUpdate:modelValue":i[20]||(i[20]=d=>Be(Y)?Y.value=d:null),class:"bg-transparent text-[11px] font-bold text-emerald-300 focus:outline-none px-1.5 py-0.5 cursor-pointer max-w-[130px] truncate"},[...i[87]||(i[87]=[ut('<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),[[dt,l(Y)]])]),a("button",{onClick:Ea,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"},[C(l(ta),{class:"w-3 h-3"}),i[88]||(i[88]=a("span",{class:"hidden sm:inline"},"Prompt Manual",-1))]),a("button",{onClick:i[21]||(i[21]=d=>Yt()),disabled:s.isGenerating||s.isAutoTopicLoading,class:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-bold text-white bg-gradient-to-r from-sky-500 via-indigo-600 to-purple-600 hover:from-sky-400 hover:to-indigo-500 rounded-xl shadow-md transition disabled:opacity-50"},[C(l(na),{class:H(["w-3.5 h-3.5",{"animate-spin":s.isAutoTopicLoading}])},null,8,["class"]),a("span",null,g(s.isAutoTopicLoading?"Meriset Data...":"✨ Auto-Topic"),1)],8,In),a("div",On,[i[93]||(i[93]=a("button",{class:"px-2 py-1.5 text-xs font-bold text-slate-300 bg-slate-800 hover:bg-slate-700 border border-slate-700 rounded-xl"}," ▾ ",-1)),a("div",Mn,[i[91]||(i[91]=a("div",{class:"px-3 py-1 text-[10px] font-bold text-slate-500 uppercase"},"Model AI Engine",-1)),a("div",Dn,[oe(a("select",{"onUpdate:modelValue":i[22]||(i[22]=d=>Be(b)?b.value=d:null),class:"w-full bg-slate-950 border border-slate-700 rounded-lg p-1.5 text-xs text-sky-300 focus:outline-none"},[...i[89]||(i[89]=[a("option",{value:"gemini-3.8-flash"},"⚡ Gemini 3.8 Flash",-1),a("option",{value:"gemini-3.5-flash"},"⚡ Gemini 3.5 Flash",-1),a("option",{value:"gemini-2.5-pro"},"💎 Gemini 2.5 Pro",-1),a("option",{value:"gemini-1.5-pro"},"💎 Gemini 1.5 Pro",-1)])],512),[[dt,l(b)]])]),i[92]||(i[92]=a("div",{class:"border-t border-slate-800 my-1"},null,-1)),a("div",$n,[i[90]||(i[90]=a("span",null,"Pilih Format Template",-1)),a("span",jn,g(l(z).length)+" opsi",1)]),a("div",Rn,[(f(!0),v(Te,null,Ce(l(z),d=>(f(),v("button",{key:d.id,onClick:B=>Yt(void 0,d.id),class:"px-3 py-1.5 text-left text-slate-200 hover:bg-slate-800 text-[11px] flex items-center justify-between group/item"},[a("span",Ln,g(d.name),1),d.isBuiltin?E("",!0):(f(),v("span",Pn,"Kustom"))],8,En))),128))])])])])]),s.isAutoTopicLoading?(f(),v("div",Vn,[a("div",Bn,[C(l(na),{class:"w-3.5 h-3.5 text-sky-400 animate-spin"})]),a("div",Zn,[a("div",Un,[i[94]||(i[94]=a("span",null,"AI Research Engine Sedang Bekerja...",-1)),a("span",Jn,g(l(b)),1)]),i[95]||(i[95]=a("p",{class:"text-[10px] text-slate-300 mt-0.5"},"Menganalisis angka perbandingan 2026 & meracik copywriting viral.",-1))])])):E("",!0),a("div",Hn,[a("div",Fn,[a("button",{onClick:i[23]||(i[23]=d=>O.value="editor"),class:H(["px-2.5 py-1 rounded-lg transition text-[11px]",l(O)==="editor"?"bg-slate-800 text-sky-400 shadow font-bold":"text-slate-400 hover:text-white"])}," JSON Editor ",2),a("button",{onClick:i[24]||(i[24]=d=>O.value="drafts"),class:H(["px-2.5 py-1 rounded-lg transition flex items-center gap-1 text-[11px]",l(O)==="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"},[C(l(Qt),{class:"w-3 h-3"}),a("span",null,"Drafts ("+g(s.drafts.length)+")",1)],2),a("button",{onClick:i[25]||(i[25]=d=>O.value="history"),class:H(["px-2.5 py-1 rounded-lg transition flex items-center gap-1 text-[11px]",l(O)==="history"?"bg-slate-800 text-purple-400 shadow font-bold":"text-slate-400 hover:text-white"]),title:"Riwayat otomatis setiap kali generate"},[C(l(ea),{class:"w-3 h-3"}),a("span",null,"Riwayat ("+g(s.history.length)+")",1)],2)]),a("div",zn,[s.unsavedStash?(f(),v("button",{key:0,onClick:le,class:"text-[10px] text-amber-400 hover:text-amber-300 transition font-bold px-2 py-0.5 rounded-lg border border-amber-500/30 bg-amber-500/10 flex items-center gap-1",title:"Kembalikan editan aktif sebelum memilih draft/riwayat"},[...i[96]||(i[96]=[a("span",null,"↩️ Kembali ke Editan",-1)])])):E("",!0),l(O)==="history"&&s.history.length>0?(f(),v("button",{key:1,onClick:Pa,class:"text-[10px] text-rose-400 hover:text-rose-300 transition font-bold pr-1",title:"Bersihkan semua riwayat generate"}," Bersihkan Riwayat ")):E("",!0),a("button",{onClick:i[26]||(i[26]=d=>n("saveDraft")),class:"text-[10px] text-amber-400 hover:text-amber-300 transition pr-2 font-bold flex items-center gap-1",title:"Simpan data saat ini ke Drafts untuk digunakan nanti"},[C(l(Qt),{class:"w-3 h-3"}),i[97]||(i[97]=a("span",null,"+ Simpan ke Draft",-1))])])]),l(O)==="drafts"?(f(),v("div",Gn,[s.unsavedStash?(f(),v("div",Kn,[a("div",Wn,[i[99]||(i[99]=a("span",{class:"text-sm"},"✏️",-1)),a("div",qn,[i[98]||(i[98]=a("span",{class:"font-bold text-[10px] block text-amber-300"},"Ada editan aktif sebelumnya:",-1)),a("span",Yn,'"'+g(s.unsavedStash.title||"Tanpa Judul")+'"',1)])]),a("div",Xn,[a("button",{onClick:le,class:"px-2 py-1 bg-amber-500 hover:bg-amber-400 text-slate-950 font-bold rounded-lg text-[10px] transition shadow flex items-center gap-1 active:scale-95",title:"Kembalikan editan aktif sebelum membuka draft ini"},[...i[100]||(i[100]=[a("span",null,"↩️ Kembali ke Editan",-1)])]),a("button",{onClick:i[27]||(i[27]=d=>n("clearStash")),class:"p-1 hover:text-white text-amber-400/70 transition text-xs",title:"Abaikan & buang simpanan editan ini"}," ✕ ")])])):E("",!0),s.drafts.length===0?(f(),v("div",Qn,[...i[101]||(i[101]=[F(" Belum ada draft tersimpan.",-1),a("br",null,null,-1),F(" Klik ",-1),a("b",{class:"text-amber-400"},"+ Simpan ke Draft",-1),F(" di atas untuk menyimpan konten ini agar bisa diedit/digenerate nanti! ",-1)])])):E("",!0),(f(!0),v(Te,null,Ce(s.drafts,(d,B)=>(f(),v("div",{key:B,onClick:W=>n("selectDraft",B),"data-draft-item":"",class:H(["p-2 rounded-xl border cursor-pointer transition flex items-center justify-between text-xs group",s.activeDraftIndex===B?"bg-amber-500/15 border-amber-500/50 text-white":"bg-slate-950/60 border-slate-800 text-slate-300 hover:border-slate-700"])},[a("div",ti,[a("div",ai,[a("span",si,g(d.layoutType||"table"),1),a("span",ni,g(d.category),1)]),a("div",ii,g(d.title),1)]),a("button",{onClick:At(W=>n("deleteDraft",B),["stop"]),class:"opacity-0 group-hover:opacity-100 p-1 text-slate-400 hover:text-rose-400 transition rounded",title:"Hapus draft ini"},[C(l(mt),{class:"w-3.5 h-3.5"})],8,ri)],10,ei))),128))])):l(O)==="history"?(f(),v("div",oi,[s.unsavedStash?(f(),v("div",li,[a("div",di,[i[103]||(i[103]=a("span",{class:"text-sm"},"✏️",-1)),a("div",ui,[i[102]||(i[102]=a("span",{class:"font-bold text-[10px] block text-purple-300"},"Ada editan aktif sebelumnya:",-1)),a("span",ci,'"'+g(s.unsavedStash.title||"Tanpa Judul")+'"',1)])]),a("div",pi,[a("button",{onClick:le,class:"px-2 py-1 bg-purple-500 hover:bg-purple-400 text-white font-bold rounded-lg text-[10px] transition shadow flex items-center gap-1 active:scale-95",title:"Kembalikan editan aktif sebelum membuka riwayat ini"},[...i[104]||(i[104]=[a("span",null,"↩️ Kembali ke Editan",-1)])]),a("button",{onClick:i[28]||(i[28]=d=>n("clearStash")),class:"p-1 hover:text-white text-purple-400/70 transition text-xs",title:"Abaikan & buang simpanan editan ini"}," ✕ ")])])):E("",!0),s.history.length===0?(f(),v("div",mi,[...i[105]||(i[105]=[F(" Belum ada riwayat pembuatan.",-1),a("br",null,null,-1),F(" Setiap kali kamu klik ",-1),a("b",{class:"text-sky-400"},"GENERATE CONTENT",-1),F(", hasil pembuatan akan otomatis tercatat di sini! ",-1)])])):E("",!0),(f(!0),v(Te,null,Ce(s.history,(d,B)=>(f(),v("div",{key:B,onClick:W=>n("selectHistory",B),"data-history-item":"",class:H(["p-2 rounded-xl border cursor-pointer transition flex items-center justify-between text-xs group",s.activeHistoryIndex===B?"bg-purple-500/15 border-purple-500/50 text-white":"bg-slate-950/60 border-slate-800 text-slate-300 hover:border-slate-700"])},[a("div",hi,[a("div",xi,[a("span",vi,g(d.layoutType||"reels"),1),a("span",gi,g(d.category),1),d.generatedAt?(f(),v("span",yi,g(Va(d.generatedAt)),1)):E("",!0)]),a("div",bi,g(d.title),1)]),a("button",{onClick:At(W=>n("deleteHistory",B),["stop"]),class:"opacity-0 group-hover:opacity-100 p-1 text-slate-400 hover:text-rose-400 transition rounded",title:"Hapus riwayat ini"},[C(l(mt),{class:"w-3.5 h-3.5"})],8,ki)],10,fi))),128))])):(f(),v("div",wi,[a("div",_i,[a("div",null,[a("div",Si,[a("label",Ti,[C(l(aa),{class:"w-3 h-3 text-sky-400"}),i[106]||(i[106]=F(" Format Template ",-1))]),a("button",{onClick:i[29]||(i[29]=d=>A("list")),class:"text-[10px] font-bold text-sky-400 hover:text-sky-300 flex items-center gap-0.5 transition",title:"Kelola & buat template kustom baru"},[C(l(sa),{class:"w-3 h-3"}),i[107]||(i[107]=a("span",null,"Kelola",-1))])]),a("select",{value:l(o),onChange:i[30]||(i[30]=d=>Tt(d.target.value)),class:"w-full bg-slate-900 border border-slate-800 rounded-lg p-1.5 text-slate-200 focus:outline-none focus:border-sky-500 font-semibold text-[11px]"},[(f(!0),v(Te,null,Ce(l(z),d=>(f(),v("option",{key:d.id,value:d.id},g(d.name)+" "+g(d.isBuiltin?"":"⭐ (Kustom)"),9,Ai))),128))],40,Ci)]),a("div",null,[i[109]||(i[109]=a("label",{class:"block text-[10px] font-bold text-slate-300 mb-1"}," Theme Color (10 Pilihan) ",-1)),a("select",{value:s.modelValue.theme||"blue-tech",onChange:i[31]||(i[31]=d=>ja(d.target.value)),class:"w-full bg-slate-900 border border-slate-800 rounded-lg p-1.5 text-slate-200 focus:outline-none focus:border-sky-500 font-semibold text-[11px]"},[...i[108]||(i[108]=[ut('<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,Ni)]),a("div",Ii,[a("div",Oi,[i[110]||(i[110]=a("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"}," Watermark Handle ",-1)),a("input",{type:"text",value:s.modelValue.watermark||"@SocialGen",onInput:i[32]||(i[32]=d=>$a(d.target.value)),placeholder:"@NamaAkun",class:"w-full bg-slate-900 border border-slate-800 rounded-lg px-2.5 py-1.5 text-sky-400 font-semibold text-[11px] focus:outline-none focus:border-sky-500 transition"},null,40,Mi)]),a("div",Di,[i[111]||(i[111]=a("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"}," Judul Konten (Title) ",-1)),a("input",{type:"text",value:s.modelValue.title,onInput:i[33]||(i[33]=d=>Da(d.target.value)),placeholder:"Judul Utama Konten...",class:"w-full bg-slate-900 border border-slate-800 rounded-lg px-2.5 py-1.5 text-slate-100 font-semibold text-[11px] focus:outline-none focus:border-sky-500 transition"},null,40,$i)])])]),a("div",ji,[a("div",Ri,[i[113]||(i[113]=a("span",{class:"font-bold text-slate-300 text-[10px]"},"RAW JSON SocialGen",-1)),l(c)?(f(),v("span",Li,[C(l(Ha),{class:"w-2.5 h-2.5"}),i[112]||(i[112]=F(" Invalid ",-1))])):(f(),v("span",Ei,[C(l(Fa),{class:"w-2.5 h-2.5"}),F(" "+g(l(r).trim()?"Valid":"Sample Mode"),1)]))]),a("div",Pi,[a("button",{onClick:qt,class:"text-[10px] text-slate-400 hover:text-amber-400 transition flex items-center gap-1",title:"Kosongkan JSON dan gunakan data sampel bawaan template aktif"},[C(l(Ca),{class:"w-2.5 h-2.5"}),i[114]||(i[114]=a("span",null,"Clear / Pakai Sample",-1))]),i[115]||(i[115]=a("span",{class:"text-slate-700"},"|",-1)),a("button",{onClick:Ma,class:"text-[10px] text-slate-400 hover:text-sky-400 transition"}," Format JSON ")])]),l(Se)?(f(),v("div",{key:0,class:H(["mx-2.5 mt-2.5 p-2 rounded-xl border text-xs transition-all shadow-md flex flex-col sm:flex-row sm:items-center justify-between gap-2",l(Se).isKnown?"bg-amber-500/10 border-amber-500/30":"bg-rose-500/10 border-rose-500/30"])},[a("div",{class:H(["flex items-center gap-1.5 text-[11px]",l(Se).isKnown?"text-amber-300":"text-rose-300"])},[i[121]||(i[121]=a("span",{class:"text-sm"},"⚠️",-1)),l(Se).isKnown?(f(),v("span",Vi,[i[116]||(i[116]=F(" JSON ini dibuat untuk template ",-1)),a("b",Bi,g(l(Se).matchedTarget?.name),1),i[117]||(i[117]=F(" (",-1)),a("span",Zi,g(l(Se).jsonTemplateId),1),i[118]||(i[118]=F(") ",-1))])):(f(),v("span",Ui,[i[119]||(i[119]=F(' Template dengan ID "',-1)),a("span",Ji,g(l(Se).jsonTemplateId),1),i[120]||(i[120]=F('" tidak ditemukan di sistem. ',-1))]))],2),a("div",Hi,[l(Se).isKnown&&l(Se).matchedTarget?(f(),v("button",{key:0,onClick:i[34]||(i[34]=d=>Tt(l(Se).matchedTarget.id)),class:"px-2 py-0.5 rounded-lg bg-amber-500/20 hover:bg-amber-500/30 text-amber-200 border border-amber-500/40 text-[10px] font-bold transition flex items-center gap-1"}," Pindah ke Template Ini ")):E("",!0),a("button",{onClick:qt,class:"px-2 py-0.5 rounded-lg bg-slate-800 hover:bg-slate-700 text-slate-300 text-[10px] font-semibold transition"}," Hapus JSON (Pakai Sample) ")])],2)):E("",!0),a("div",Fi,[a("textarea",{value:l(r),onInput:Oa,rows:"7",spellcheck:"false",class:"w-full bg-slate-950 text-sky-200 text-[11px] font-mono p-2.5 rounded-xl border border-slate-800 focus:outline-none focus:border-sky-500/50 resize-y leading-relaxed",placeholder:"Paste Content JSON here... (kosong = otomatis menggunakan data sampel template aktif)"},null,40,zi),l(c)||s.validationError?(f(),v("p",Gi," ⚠️ "+g(l(c)||s.validationError),1)):E("",!0)])])),a("input",{type:"file",ref_key:"videoInputRef",ref:zt,accept:"video/mp4,video/webm",class:"hidden",onChange:i[35]||(i[35]=d=>Wt(d))},null,544),a("input",{type:"file",ref_key:"audioInputRef",ref:Gt,accept:"audio/mp3,audio/mpeg,audio/wav",class:"hidden",onChange:i[36]||(i[36]=d=>Wt(d))},null,544),a("div",Ki,[a("div",Wi,[a("div",qi,[a("label",Yi,[C(l(_a),{class:"w-3.5 h-3.5 text-sky-400"}),i[122]||(i[122]=a("span",null,"Background",-1))]),a("div",Xi,[a("select",{value:s.options.backgroundSource||"random",onChange:i[37]||(i[37]=d=>Ee("backgroundSource",d.target.value)),class:"bg-slate-950 border border-slate-800 rounded-lg px-2 py-1 text-slate-300 text-[11px] focus:outline-none max-w-[170px]"},[i[123]||(i[123]=a("option",{value:"random"},"🔀 Acak Video",-1)),(f(!0),v(Te,null,Ce(l(Ut),d=>(f(),v("option",{key:d,value:d},g(d.replace(".mp4","").replace(/_/g," ")),9,er))),128)),i[124]||(i[124]=a("option",{value:"pexels"},"🌐 Pexels API (Auto HD)",-1))],40,Qi),a("button",{onClick:i[38]||(i[38]=d=>l(zt)?.click()),disabled:l(Ue),title:"Upload Video MP4 Sendiri",class:"p-1 px-2 rounded-lg border border-sky-500/30 text-sky-300 bg-sky-950/40 hover:bg-sky-900/60 text-[10px] flex items-center gap-1 font-bold transition disabled:opacity-50"},[C(l(ia),{class:"w-3 h-3"}),a("span",ar,g(l(Ue)?"...":"Upload"),1)],8,tr)])]),a("div",sr,[a("span",nr,[C(l(Dt),{class:"w-2.5 h-2.5"}),F(" Mulai: "+g(Math.min(s.options.videoStartOffset||0,l(ot)))+"s / "+g(l(Ht))+"s ",1)]),a("input",{type:"range",min:"0",max:l(ot),step:"1",value:Math.min(s.options.videoStartOffset||0,l(ot)),onInput:i[39]||(i[39]=d=>Ee("videoStartOffset",Number(d.target.value))),class:"w-32 h-1 bg-slate-950 rounded appearance-none cursor-pointer accent-sky-400"},null,40,ir)])]),a("div",rr,[a("div",or,[a("label",lr,[C(l(Sa),{class:"w-3.5 h-3.5 text-purple-400"}),i[125]||(i[125]=a("span",null,"Musik Reels",-1))]),a("div",dr,[a("select",{value:s.options.musicFile||"random",onChange:i[40]||(i[40]=d=>Ee("musicFile",d.target.value)),class:"bg-slate-950 border border-slate-800 rounded-lg px-2 py-1 text-slate-300 text-[11px] focus:outline-none max-w-[170px]"},[i[126]||(i[126]=a("option",{value:"random"},"🔀 Acak Musik",-1)),(f(!0),v(Te,null,Ce(l(Jt),d=>(f(),v("option",{key:d,value:d},g(d.replace(".mp3","").replace(/_/g," ")),9,cr))),128))],40,ur),a("button",{onClick:i[41]||(i[41]=d=>l(Gt)?.click()),disabled:l(Ue),title:"Upload Musik MP3 Sendiri",class:"p-1 px-2 rounded-lg border border-purple-500/30 text-purple-300 bg-purple-950/40 hover:bg-purple-900/60 text-[10px] flex items-center gap-1 font-bold transition disabled:opacity-50"},[C(l(ia),{class:"w-3 h-3"}),a("span",mr,g(l(Ue)?"...":"Upload"),1)],8,pr)])]),a("div",fr,[a("span",hr,[C(l(Dt),{class:"w-2.5 h-2.5"}),F(" Mulai: "+g(Math.min(s.options.audioStartOffset||0,l(lt)))+"s / "+g(l(Ft))+"s ",1)]),a("input",{type:"range",min:"0",max:l(lt),step:"1",value:Math.min(s.options.audioStartOffset||0,l(lt)),onInput:i[42]||(i[42]=d=>Ee("audioStartOffset",Number(d.target.value))),class:"w-32 h-1 bg-slate-950 rounded appearance-none cursor-pointer accent-purple-400"},null,40,xr)])]),a("div",vr,[a("label",gr,[C(l(ea),{class:"w-3.5 h-3.5 text-emerald-400"}),i[127]||(i[127]=a("span",null,"Durasi Reels:",-1))]),a("div",yr,[(f(),v(Te,null,Ce([7,10,15,30,60],d=>a("button",{key:d,onClick:B=>Ra(d),class:H(["px-2 py-0.5 text-[10px] font-bold rounded-lg border transition",(s.modelValue.reelsDuration||30)===d?"bg-emerald-500/20 border-emerald-500/60 text-emerald-300":"bg-slate-950 border-slate-800 text-slate-400 hover:text-white"])},g(d===60?"1m":d+"s"),11,br)),64))])]),a("div",kr,[a("label",{class:H(["flex items-center gap-1.5 p-1.5 rounded-xl border text-[11px] cursor-pointer transition select-none",s.options.outputs?.feed!==!1?"bg-sky-500/10 border-sky-500/40 text-sky-200":"bg-slate-950/50 border-slate-800 text-slate-500"])},[a("input",{type:"checkbox",checked:s.options.outputs?.feed!==!1,onChange:i[43]||(i[43]=d=>Ct("feed",d.target.checked)),class:"rounded text-sky-500 focus:ring-0 bg-slate-900 border-slate-700 w-3 h-3"},null,40,wr),i[128]||(i[128]=a("span",{class:"font-bold"},"Feed 4:5",-1))],2),a("label",{class:H(["flex items-center gap-1.5 p-1.5 rounded-xl border text-[11px] cursor-pointer transition select-none",s.options.outputs?.story!==!1?"bg-indigo-500/10 border-indigo-500/40 text-indigo-200":"bg-slate-950/50 border-slate-800 text-slate-500"])},[a("input",{type:"checkbox",checked:s.options.outputs?.story!==!1,onChange:i[44]||(i[44]=d=>Ct("story",d.target.checked)),class:"rounded text-indigo-500 focus:ring-0 bg-slate-900 border-slate-700 w-3 h-3"},null,40,_r),i[129]||(i[129]=a("span",{class:"font-bold"},"Story 9:16",-1))],2),a("label",{class:H(["flex items-center gap-1.5 p-1.5 rounded-xl border text-[11px] cursor-pointer transition select-none",s.options.outputs?.reels!==!1?"bg-emerald-500/10 border-emerald-500/40 text-emerald-200":"bg-slate-950/50 border-slate-800 text-slate-500"])},[a("input",{type:"checkbox",checked:s.options.outputs?.reels!==!1,onChange:i[45]||(i[45]=d=>Ct("reels",d.target.checked)),class:"rounded text-emerald-500 focus:ring-0 bg-slate-900 border-slate-700 w-3 h-3"},null,40,Sr),i[130]||(i[130]=a("span",{class:"font-bold"},"Reels MP4",-1))],2)])]),a("button",{onClick:i[46]||(i[46]=d=>n("generate")),disabled:!s.isValid||s.isGenerating||!!l(c),class:H(["w-full py-3 px-4 rounded-xl font-black text-xs tracking-wide shadow-xl transition flex items-center justify-center gap-2",[!s.isValid||s.isGenerating||l(c)?"bg-slate-800 text-slate-500 cursor-not-allowed border border-slate-700":"bg-gradient-to-r from-sky-500 via-blue-600 to-indigo-600 text-white hover:from-sky-400 hover:to-indigo-500 shadow-sky-500/25 active:scale-[0.99]"]])},[s.isGenerating?(f(),Ae(l(Ya),{key:0,class:"w-3.5 h-3.5 animate-spin"})):(f(),Ae(l(Ta),{key:1,class:"w-3.5 h-3.5 fill-current"})),a("span",null,g(s.isGenerating?s.generateStage||"Rendering Content...":"GENERATE CONTENT"),1)],10,Tr)]))}}),Ar={class:"flex flex-col gap-2.5 h-full text-slate-100 min-h-0 justify-between"},Nr={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"},Ir={class:"flex items-center gap-1 bg-slate-950 p-1 rounded-xl border border-slate-800 text-xs font-bold"},Or={key:0,class:"w-1.5 h-1.5 rounded-full bg-white animate-pulse"},Mr={class:"flex items-center gap-2 text-xs"},Dr={class:"flex items-center gap-1 bg-slate-950 p-1 rounded-xl border border-slate-800 text-xs shadow-inner"},$r={key:0,class:"relative shadow-2xl rounded-2xl overflow-hidden border border-slate-700/80 flex-shrink-0",style:{width:"360px",height:"450px"}},jr={style:{width:"1080px",height:"1350px",transform:"scale(0.333333)","transform-origin":"top left"}},Rr={key:1,class:"relative shadow-2xl rounded-2xl overflow-hidden border border-slate-700/80 flex-shrink-0",style:{width:"300px",height:"533.33px"}},Er={key:0,class:"absolute inset-0 z-0 bg-slate-950 overflow-hidden"},Lr=["src"],Pr=["src","muted"],Vr={class:"relative z-10 pointer-events-none",style:{width:"1080px",height:"1920px",transform:"scale(0.277778)","transform-origin":"top left"}},Br={key:1,class:"absolute inset-0 z-20 pointer-events-none flex flex-col justify-between"},Zr={class:"flex-1 flex justify-end p-2"},Ur={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"},Jr={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"},Hr={class:"flex items-center justify-between gap-3"},Fr=["title"],zr={class:"text-[11px] hidden sm:inline"},Gr={class:"flex-1 flex items-center gap-2"},Kr=["max","value"],Wr={class:"font-mono text-[11px] font-bold text-slate-300 min-w-[75px] text-right"},qr=["title"],Yr={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"},Xr={class:"flex flex-col gap-1.5"},Qr={class:"flex items-center justify-between text-[11px]"},eo={class:"font-bold text-sky-300 flex items-center gap-1"},to=["max","value"],ao={class:"text-[9px] text-slate-500"},so={class:"flex flex-col gap-1.5"},no={class:"flex items-center justify-between text-[11px]"},io={class:"font-bold text-purple-300 flex items-center gap-1"},ro=["max","value"],oo={class:"text-[9px] text-slate-500"},lo={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"},uo={class:"flex items-center justify-between text-xs"},co=["value"],po={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"},mo={class:"flex items-center gap-2 text-xs font-black text-emerald-300"},fo={class:"text-[11px] text-slate-400 font-mono mt-0.5"},ho={class:"flex items-center gap-2"},xo=["href"],vo=["disabled"],go=Vt({__name:"LivePreview",props:{data:{},selectedVideo:{},selectedMusic:{},videoStartOffset:{default:0},audioStartOffset:{default:0},generatedResult:{}},emits:["update:videoStartOffset","update:audioStartOffset"],setup(s,{emit:e}){const t=s,n=e,r={"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},o=ue(()=>t.selectedVideo&&t.selectedVideo!=="pexels"&&t.selectedVideo!=="random"?`/api/stream/videos/${t.selectedVideo}`:"/api/stream/videos/default_bg.mp4"),p=ue(()=>t.selectedMusic&&t.selectedMusic!=="random"?`/api/stream/audio/${t.selectedMusic}`:"/api/stream/audio/lofi_viral_study.mp3"),c=S("feed"),w=S(!1),b=S(!1),O=S(!1),le=S(!1),G=S(1),$=S(null),M=S(null),J=S(!0),V=S(!1),ge=S(0),je=ue(()=>t.data.reelsDuration||30),de=S(r[t.selectedVideo||""]||8),re=S(r[t.selectedMusic||""]||30),ne=ue(()=>Math.max(1,Math.floor(de.value-1))),Y=ue(()=>Math.max(1,Math.floor(re.value-1)));function Oe(){G.value<2.5&&(G.value=Math.min(2.5,+(G.value+.15).toFixed(2)))}function z(){G.value>.5&&(G.value=Math.max(.5,+(G.value-.15).toFixed(2)))}function pe(){G.value=1}function ae(I){(I.ctrlKey||I.metaKey)&&(I.preventDefault(),I.deltaY<0?Oe():z())}function q(){J.value?te():he()}function he(){J.value=!0,$.value&&$.value.play().catch(()=>{}),M.value&&(M.value.muted=V.value,M.value.volume=.85,M.value.play().catch(()=>{}))}function te(){J.value=!1,$.value&&$.value.pause(),M.value&&M.value.pause()}function me(){if(V.value=!V.value,M.value)if(M.value.muted=V.value,M.value.volume=.85,!V.value&&J.value){const I=t.audioStartOffset||0;M.value.currentTime=I+ge.value%Math.max(1,re.value-I),M.value.play().catch(()=>{})}else M.value.pause()}function we(I){const y=I.target;y&&y.duration&&!isNaN(y.duration)&&isFinite(y.duration)&&(de.value=Math.max(1,Math.floor(y.duration)),t.videoStartOffset&&t.videoStartOffset>=de.value&&n("update:videoStartOffset",Math.max(0,de.value-2))),$.value&&($.value.currentTime=Math.min(t.videoStartOffset||0,ne.value),J.value&&$.value.play().catch(()=>{}))}function X(I){const y=I.target;y&&y.duration&&!isNaN(y.duration)&&isFinite(y.duration)&&(re.value=Math.max(1,Math.floor(y.duration)),t.audioStartOffset&&t.audioStartOffset>=re.value&&n("update:audioStartOffset",Math.max(0,re.value-2))),M.value&&(M.value.muted=V.value,M.value.volume=.85,M.value.currentTime=Math.min(t.audioStartOffset||0,Y.value),J.value&&!V.value&&M.value.play().catch(()=>{}))}function N(){if(!$.value)return;const I=Math.min(t.videoStartOffset||0,ne.value);$.value.currentTime=I,J.value&&$.value.play().catch(()=>{})}function qe(){if(!M.value)return;const I=Math.min(t.audioStartOffset||0,Y.value);M.value.currentTime=I,J.value&&!V.value&&M.value.play().catch(()=>{})}function A(){if(!$.value)return;const I=Math.min(t.videoStartOffset||0,ne.value),y=de.value;$.value.currentTime>=y-.25&&($.value.currentTime=I,J.value&&$.value.play().catch(()=>{})),ge.value=Math.min(ge.value+.1,je.value),ge.value>=je.value&&(ge.value=0)}function h(){if(!M.value)return;const I=Math.min(t.audioStartOffset||0,Y.value),y=re.value;M.value.currentTime>=y-.25&&(M.value.currentTime=I,J.value&&!V.value&&M.value.play().catch(()=>{}))}function K(I){ge.value=I;const y=Math.min(t.videoStartOffset||0,ne.value),Me=Math.min(t.audioStartOffset||0,Y.value);if($.value){const ie=y+I%Math.max(1,de.value-y);$.value.currentTime=Math.min(ie,de.value-.1)}if(M.value){const ie=Me+I%Math.max(1,re.value-Me);M.value.currentTime=Math.min(ie,re.value-.1)}}function _e(I){const y=Number(I.target.value);K(y)}ve(()=>t.videoStartOffset,I=>{const y=Math.min(I||0,ne.value);$.value&&($.value.currentTime=y)}),ve(()=>t.audioStartOffset,I=>{const y=Math.min(I||0,Y.value);M.value&&(M.value.currentTime=y)});function P(I){const y=Math.min(I,ne.value);n("update:videoStartOffset",y),$.value&&($.value.currentTime=y)}function Re(I){const y=Math.min(I,Y.value);n("update:audioStartOffset",y),M.value&&(M.value.currentTime=y)}function kt(){if($.value){const I=Math.min(Math.floor($.value.currentTime),ne.value);P(I)}}function at(I){const y=Math.floor(I/60),Me=Math.floor(I%60);return`${y.toString().padStart(2,"0")}:${Me.toString().padStart(2,"0")}`}function wt(){t.data.caption&&(navigator.clipboard.writeText(t.data.caption),O.value=!0,setTimeout(()=>{O.value=!1},2e3))}async function _t(){if(t.generatedResult){le.value=!0;try{await $fetch("/api/open-folder",{method:"POST",body:{jobId:t.generatedResult.jobId,resultDir:t.generatedResult.resultDir}})}catch(I){console.error("Failed to open folder:",I)}finally{le.value=!1}}}return ve(()=>o.value,()=>{const I=t.selectedVideo||"";r[I]&&(de.value=r[I]),Xt(()=>{K(0)})}),ve(()=>p.value,()=>{const I=t.selectedMusic||"";r[I]&&(re.value=r[I])}),ve(()=>c.value,I=>{I==="reels"?Xt(()=>{J.value&&he()}):M.value&&M.value.pause()}),(I,y)=>{const Me=Za;return f(),v("div",Ar,[a("div",Nr,[a("div",Ir,[a("button",{onClick:y[0]||(y[0]=ie=>c.value="feed"),class:H(["px-3 py-1.5 rounded-lg transition",l(c)==="feed"?"bg-sky-500 text-white shadow-md":"text-slate-400 hover:text-white"])}," Feed 4:5 ",2),a("button",{onClick:y[1]||(y[1]=ie=>c.value="story"),class:H(["px-3 py-1.5 rounded-lg transition",l(c)==="story"?"bg-indigo-500 text-white shadow-md":"text-slate-400 hover:text-white"])}," Story 9:16 ",2),a("button",{onClick:y[2]||(y[2]=ie=>c.value="reels"),class:H(["px-3 py-1.5 rounded-lg transition flex items-center gap-1.5",l(c)==="reels"?"bg-emerald-500 text-white shadow-md":"text-slate-400 hover:text-white"])},[y[8]||(y[8]=a("span",null,"Reels 9:16 (Video)",-1)),l(c)==="reels"&&l(J)?(f(),v("span",Or)):E("",!0)],2)]),a("div",Mr,[a("div",Dr,[a("button",{onClick:z,title:"Zoom Out (-15%)",class:"p-1.5 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800 transition"},[C(l(ss),{class:"w-3.5 h-3.5"})]),a("button",{onClick:pe,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"},g(Math.round(l(G)*100))+"% ",1),a("button",{onClick:Oe,title:"Zoom In (+15%)",class:"p-1.5 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800 transition"},[C(l(as),{class:"w-3.5 h-3.5"})]),l(G)!==1?(f(),v("button",{key:0,onClick:pe,title:"Reset ke Ukuran Pas",class:"p-1.5 rounded-lg text-amber-400 hover:bg-slate-800 transition"},[C(l(Ca),{class:"w-3.5 h-3.5"})])):E("",!0)]),l(c)!=="feed"?(f(),v("button",{key:0,onClick:y[3]||(y[3]=ie=>w.value=!l(w)),class:H(["inline-flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border text-xs font-bold transition",l(w)?"bg-amber-500/20 text-amber-300 border-amber-500/50":"bg-slate-950 text-slate-400 border-slate-800"])},[C(l(Xa),{class:"w-3.5 h-3.5"}),y[9]||(y[9]=a("span",{class:"hidden sm:inline"},"Safe Zones",-1))],2)):E("",!0)])]),a("div",{onWheel:ae,class:"relative flex-1 min-h-0 bg-slate-950/80 border border-slate-800/80 rounded-2xl flex items-center justify-center p-3 overflow-auto shadow-inner custom-scrollbar"},[a("div",{class:"transition-transform duration-200 ease-out origin-center flex-shrink-0",style:Ba({transform:`scale(${l(G)})`})},[l(c)==="feed"?(f(),v("div",$r,[a("div",jr,[C(Me,{data:s.data,mode:"feed","is-render":!0},null,8,["data"])])])):(f(),v("div",Rr,[l(c)==="reels"?(f(),v("div",Er,[(f(),v("video",{ref_key:"videoElement",ref:$,key:l(o),autoplay:"",muted:"",playsinline:"",class:"w-full h-full object-cover brightness-90 contrast-105",src:l(o),onLoadedmetadata:we,onTimeupdate:A,onEnded:N},null,40,Lr)),y[10]||(y[10]=a("div",{class:"absolute inset-0 bg-slate-950/30 backdrop-blur-[0.5px]"},null,-1)),(f(),v("audio",{ref_key:"audioElement",ref:M,key:l(p),src:l(p),muted:l(V),onLoadedmetadata:X,onTimeupdate:h,onEnded:qe},null,40,Pr))])):E("",!0),a("div",Vr,[C(Me,{data:s.data,mode:l(c)==="reels"?"overlay":"story","is-render":!0},null,8,["data","mode"])]),l(w)?(f(),v("div",Br,[y[12]||(y[12]=a("div",{class:"h-14 bg-red-500/20 border-b border-dashed border-red-500/60 flex items-center justify-center text-[9px] text-red-200 font-bold tracking-wider"}," TOP SAFE ZONE (Profile & Status) ",-1)),a("div",Zr,[l(c)==="reels"?(f(),v("div",Ur,[...y[11]||(y[11]=[a("span",null,"❤️ Like",-1),a("span",null,"💬 Comm",-1),a("span",null,"↗️ Share",-1)])])):E("",!0)]),y[13]||(y[13]=a("div",{class:"h-20 bg-red-500/20 border-t border-dashed border-red-500/60 flex items-center justify-center text-[9px] text-red-200 font-bold tracking-wider"}," BOTTOM SAFE ZONE (Caption & Audio) ",-1))])):E("",!0)]))],4)],32),l(c)==="reels"?(f(),v("div",Jr,[a("div",Hr,[a("button",{onClick:q,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(J)?"Pause Preview":"Putar Preview"},[l(J)?(f(),Ae(l(qa),{key:0,class:"w-3.5 h-3.5 fill-current"})):(f(),Ae(l(Ta),{key:1,class:"w-3.5 h-3.5 fill-current"})),a("span",zr,g(l(J)?"Pause":"Play"),1)],8,Fr),a("div",Gr,[a("input",{type:"range",min:"0",max:l(je),step:"0.1",value:l(ge),onInput:_e,class:"flex-1 h-1.5 bg-slate-950 rounded-lg appearance-none cursor-pointer accent-emerald-500 hover:accent-emerald-400"},null,40,Kr),a("span",Wr,g(at(l(ge)))+" / "+g(at(l(je))),1)]),a("button",{onClick:me,class:H(["px-2.5 py-2 rounded-xl border transition flex items-center gap-1.5 font-bold text-[11px]",l(V)?"bg-slate-950 text-slate-400 border-slate-800 hover:text-white":"bg-purple-600/40 text-purple-200 border-purple-500/60 shadow-md ring-1 ring-purple-500/40"]),title:l(V)?"Aktifkan Suara Musik (Unmute)":"Matikan Suara Musik (Mute)"},[l(V)?(f(),Ae(l(es),{key:1,class:"w-3.5 h-3.5"})):(f(),Ae(l(Qa),{key:0,class:"w-3.5 h-3.5 text-purple-300 animate-pulse"})),a("span",null,g(l(V)?"Muted":"Audio ON"),1)],10,qr),a("button",{onClick:y[4]||(y[4]=ie=>b.value=!l(b)),class:H(["px-2.5 py-2 rounded-xl border text-[11px] font-bold flex items-center gap-1.5 transition",l(b)?"bg-sky-500/20 text-sky-300 border-sky-500/50":"bg-slate-950 text-slate-400 border-slate-800 hover:text-white"]),title:"Atur Detik Awal Video & Musik"},[C(l(Dt),{class:"w-3.5 h-3.5 text-sky-400"}),y[14]||(y[14]=a("span",{class:"hidden sm:inline"},"Trim Offset",-1))],2)]),l(b)?(f(),v("div",Yr,[a("div",Xr,[a("div",Qr,[a("span",eo,[C(l(_a),{class:"w-3 h-3"}),F(" Mulai Video: "+g(Math.min(s.videoStartOffset||0,l(ne)))+"s / "+g(l(de))+"s ",1)]),a("button",{onClick:kt,class:"text-[9px] px-1.5 py-0.5 rounded bg-slate-800 hover:bg-slate-700 text-sky-300 border border-slate-700 transition",title:"Gunakan posisi video saat ini sebagai detik mulai"}," Set Detik Ini ")]),a("input",{type:"range",min:"0",max:l(ne),step:"1",value:Math.min(s.videoStartOffset||0,l(ne)),onInput:y[5]||(y[5]=ie=>P(Number(ie.target.value))),class:"w-full h-1 bg-slate-900 rounded appearance-none cursor-pointer accent-sky-400"},null,40,to),a("div",ao," Maksimal offset: "+g(l(ne))+" detik (panjang asli video: "+g(l(de))+"s) ",1)]),a("div",so,[a("div",no,[a("span",io,[C(l(Sa),{class:"w-3 h-3"}),F(" Mulai Musik: "+g(Math.min(s.audioStartOffset||0,l(Y)))+"s / "+g(l(re))+"s ",1)]),y[15]||(y[15]=a("span",{class:"text-[10px] text-slate-500 font-mono"}," (Skip intro) ",-1))]),a("input",{type:"range",min:"0",max:l(Y),step:"1",value:Math.min(s.audioStartOffset||0,l(Y)),onInput:y[6]||(y[6]=ie=>Re(Number(ie.target.value))),class:"w-full h-1 bg-slate-900 rounded appearance-none cursor-pointer accent-purple-400"},null,40,ro),a("div",oo," Maksimal offset: "+g(l(Y))+" detik (panjang asli musik: "+g(l(re))+"s) ",1)])])):E("",!0)])):E("",!0),a("div",lo,[a("div",uo,[y[16]||(y[16]=a("span",{class:"font-extrabold text-slate-300 text-[11px]"},"VIRAL CAPTION & HASHTAGS",-1)),a("button",{onClick:wt,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(O)?(f(),Ae(l(He),{key:0,class:"w-3.5 h-3.5 text-emerald-400"})):(f(),Ae(l(ft),{key:1,class:"w-3.5 h-3.5"})),a("span",null,g(l(O)?"Tersalin!":"Copy Caption"),1)])]),a("textarea",{value:s.data.caption,onInput:y[7]||(y[7]=ie=>s.data.caption=ie.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,co)]),s.generatedResult?(f(),v("div",po,[a("div",null,[a("div",mo,[C(l(He),{class:"w-4 h-4 text-emerald-400"}),F(" Render Selesai ("+g((s.generatedResult.durationMs/1e3).toFixed(1))+"s) ",1)]),a("div",fo,g(s.generatedResult.jobId),1)]),a("div",ho,[a("a",{href:`/api/download?jobId=${s.generatedResult.jobId}`,download:"",class:"inline-flex items-center gap-1.5 px-4 py-2 bg-emerald-600 hover:bg-emerald-500 text-white rounded-xl text-xs font-black shadow-lg transition"},[C(l(Ga),{class:"w-3.5 h-3.5"}),y[17]||(y[17]=a("span",null,"Download ZIP",-1))],8,xo),a("button",{onClick:_t,disabled:l(le),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"},[C(l(Ka),{class:"w-3.5 h-3.5 text-amber-400"}),y[18]||(y[18]=a("span",null,"Open Folder",-1))],8,vo)])])):E("",!0)])}}});var Z;(function(s){s.assertEqual=r=>{};function e(r){}s.assertIs=e;function t(r){throw new Error}s.assertNever=t,s.arrayToEnum=r=>{const o={};for(const p of r)o[p]=p;return o},s.getValidEnumValues=r=>{const o=s.objectKeys(r).filter(c=>typeof r[r[c]]!="number"),p={};for(const c of o)p[c]=r[c];return s.objectValues(p)},s.objectValues=r=>s.objectKeys(r).map(function(o){return r[o]}),s.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{const o=[];for(const p in r)Object.prototype.hasOwnProperty.call(r,p)&&o.push(p);return o},s.find=(r,o)=>{for(const p of r)if(o(p))return p},s.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&Number.isFinite(r)&&Math.floor(r)===r;function n(r,o=" | "){return r.map(p=>typeof p=="string"?`'${p}'`:p).join(o)}s.joinValues=n,s.jsonStringifyReplacer=(r,o)=>typeof o=="bigint"?o.toString():o})(Z||(Z={}));var ra;(function(s){s.mergeShapes=(e,t)=>({...e,...t})})(ra||(ra={}));const _=Z.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Le=s=>{switch(typeof s){case"undefined":return _.undefined;case"string":return _.string;case"number":return Number.isNaN(s)?_.nan:_.number;case"boolean":return _.boolean;case"function":return _.function;case"bigint":return _.bigint;case"symbol":return _.symbol;case"object":return Array.isArray(s)?_.array:s===null?_.null:s.then&&typeof s.then=="function"&&s.catch&&typeof s.catch=="function"?_.promise:typeof Map<"u"&&s instanceof Map?_.map:typeof Set<"u"&&s instanceof Set?_.set:typeof Date<"u"&&s instanceof Date?_.date:_.object;default:return _.unknown}},m=Z.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class $e extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(o){return o.message},n={_errors:[]},r=o=>{for(const p of o.issues)if(p.code==="invalid_union")p.unionErrors.map(r);else if(p.code==="invalid_return_type")r(p.returnTypeError);else if(p.code==="invalid_arguments")r(p.argumentsError);else if(p.path.length===0)n._errors.push(t(p));else{let c=n,w=0;for(;w<p.path.length;){const b=p.path[w];w===p.path.length-1?(c[b]=c[b]||{_errors:[]},c[b]._errors.push(t(p))):c[b]=c[b]||{_errors:[]},c=c[b],w++}}};return r(this),n}static assert(e){if(!(e instanceof $e))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Z.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},n=[];for(const r of this.issues)if(r.path.length>0){const o=r.path[0];t[o]=t[o]||[],t[o].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}$e.create=s=>new $e(s);const $t=(s,e)=>{let t;switch(s.code){case m.invalid_type:s.received===_.undefined?t="Required":t=`Expected ${s.expected}, received ${s.received}`;break;case m.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(s.expected,Z.jsonStringifyReplacer)}`;break;case m.unrecognized_keys:t=`Unrecognized key(s) in object: ${Z.joinValues(s.keys,", ")}`;break;case m.invalid_union:t="Invalid input";break;case m.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${Z.joinValues(s.options)}`;break;case m.invalid_enum_value:t=`Invalid enum value. Expected ${Z.joinValues(s.options)}, received '${s.received}'`;break;case m.invalid_arguments:t="Invalid function arguments";break;case m.invalid_return_type:t="Invalid function return type";break;case m.invalid_date:t="Invalid date";break;case m.invalid_string:typeof s.validation=="object"?"includes"in s.validation?(t=`Invalid input: must include "${s.validation.includes}"`,typeof s.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${s.validation.position}`)):"startsWith"in s.validation?t=`Invalid input: must start with "${s.validation.startsWith}"`:"endsWith"in s.validation?t=`Invalid input: must end with "${s.validation.endsWith}"`:Z.assertNever(s.validation):s.validation!=="regex"?t=`Invalid ${s.validation}`:t="Invalid";break;case m.too_small:s.type==="array"?t=`Array must contain ${s.exact?"exactly":s.inclusive?"at least":"more than"} ${s.minimum} element(s)`:s.type==="string"?t=`String must contain ${s.exact?"exactly":s.inclusive?"at least":"over"} ${s.minimum} character(s)`:s.type==="number"?t=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="bigint"?t=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="date"?t=`Date must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(s.minimum))}`:t="Invalid input";break;case m.too_big:s.type==="array"?t=`Array must contain ${s.exact?"exactly":s.inclusive?"at most":"less than"} ${s.maximum} element(s)`:s.type==="string"?t=`String must contain ${s.exact?"exactly":s.inclusive?"at most":"under"} ${s.maximum} character(s)`:s.type==="number"?t=`Number must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="bigint"?t=`BigInt must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="date"?t=`Date must be ${s.exact?"exactly":s.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(s.maximum))}`:t="Invalid input";break;case m.custom:t="Invalid input";break;case m.invalid_intersection_types:t="Intersection results could not be merged";break;case m.not_multiple_of:t=`Number must be a multiple of ${s.multipleOf}`;break;case m.not_finite:t="Number must be finite";break;default:t=e.defaultError,Z.assertNever(s)}return{message:t}};let yo=$t;function bo(){return yo}const ko=s=>{const{data:e,path:t,errorMaps:n,issueData:r}=s,o=[...t,...r.path||[]],p={...r,path:o};if(r.message!==void 0)return{...r,path:o,message:r.message};let c="";const w=n.filter(b=>!!b).slice().reverse();for(const b of w)c=b(p,{data:e,defaultError:c}).message;return{...r,path:o,message:c}};function k(s,e){const t=bo(),n=ko({issueData:e,data:s.data,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,t,t===$t?void 0:$t].filter(r=>!!r)});s.common.issues.push(n)}class ce{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const r of t){if(r.status==="aborted")return j;r.status==="dirty"&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const r of t){const o=await r.key,p=await r.value;n.push({key:o,value:p})}return ce.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const r of t){const{key:o,value:p}=r;if(o.status==="aborted"||p.status==="aborted")return j;o.status==="dirty"&&e.dirty(),p.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof p.value<"u"||r.alwaysSet)&&(n[o.value]=p.value)}return{status:e.value,value:n}}}const j=Object.freeze({status:"aborted"}),Qe=s=>({status:"dirty",value:s}),ke=s=>({status:"valid",value:s}),oa=s=>s.status==="aborted",la=s=>s.status==="dirty",Fe=s=>s.status==="valid",ht=s=>typeof Promise<"u"&&s instanceof Promise;var T;(function(s){s.errToObj=e=>typeof e=="string"?{message:e}:e||{},s.toString=e=>typeof e=="string"?e:e?.message})(T||(T={}));class Ie{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}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 da=(s,e)=>{if(Fe(e))return{success:!0,data:e.value};if(!s.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new $e(s.common.issues);return this._error=t,this._error}}};function R(s){if(!s)return{};const{errorMap:e,invalid_type_error:t,required_error:n,description:r}=s;if(e&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(p,c)=>{const{message:w}=s;return p.code==="invalid_enum_value"?{message:w??c.defaultError}:typeof c.data>"u"?{message:w??n??c.defaultError}:p.code!=="invalid_type"?{message:c.defaultError}:{message:w??t??c.defaultError}},description:r}}class L{get description(){return this._def.description}_getType(e){return Le(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Le(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ce,ctx:{common:e.parent.common,data:e.data,parsedType:Le(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(ht(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){const n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Le(e)},r=this._parseSync({data:e,path:n.path,parent:n});return da(n,r)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Le(e)};if(!this["~standard"].async)try{const n=this._parseSync({data:e,path:[],parent:t});return Fe(n)?{value:n.value}:{issues:t.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(n=>Fe(n)?{value:n.value}:{issues:t.common.issues})}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Le(e)},r=this._parse({data:e,path:n.path,parent:n}),o=await(ht(r)?r:Promise.resolve(r));return da(n,o)}refine(e,t){const n=r=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(r):t;return this._refinement((r,o)=>{const p=e(r),c=()=>o.addIssue({code:m.custom,...n(r)});return typeof Promise<"u"&&p instanceof Promise?p.then(w=>w?!0:(c(),!1)):p?!0:(c(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t=="function"?t(n,r):t),!1))}_refinement(e){return new Ke({schema:this,typeName:D.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return Pe.create(this,this._def)}nullable(){return We.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ne.create(this)}promise(){return bt.create(this,this._def)}or(e){return vt.create([this,e],this._def)}and(e){return gt.create(this,e,this._def)}transform(e){return new Ke({...R(this._def),schema:this,typeName:D.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new Et({...R(this._def),innerType:this,defaultValue:t,typeName:D.ZodDefault})}brand(){return new Ho({typeName:D.ZodBranded,type:this,...R(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new Lt({...R(this._def),innerType:this,catchValue:t,typeName:D.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Bt.create(this,e)}readonly(){return Pt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const wo=/^c[^\s-]{8,}$/i,_o=/^[0-9a-z]+$/,So=/^[0-9A-HJKMNP-TV-Z]{26}$/i,To=/^[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,Co=/^[a-z0-9_-]{21}$/i,Ao=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,No=/^[-+]?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)?)??$/,Io=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Oo="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ot;const Mo=/^(?:(?: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])$/,Do=/^(?:(?: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])$/,$o=/^(([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]))$/,jo=/^(([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])$/,Ro=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Eo=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Aa="((\\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])))",Lo=new RegExp(`^${Aa}$`);function Na(s){let e="[0-5]\\d";s.precision?e=`${e}\\.\\d{${s.precision}}`:s.precision==null&&(e=`${e}(\\.\\d+)?`);const t=s.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function Po(s){return new RegExp(`^${Na(s)}$`)}function Vo(s){let e=`${Aa}T${Na(s)}`;const t=[];return t.push(s.local?"Z?":"Z"),s.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function Bo(s,e){return!!((e==="v4"||!e)&&Mo.test(s)||(e==="v6"||!e)&&$o.test(s))}function Zo(s,e){if(!Ao.test(s))return!1;try{const[t]=s.split(".");if(!t)return!1;const n=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),r=JSON.parse(atob(n));return!(typeof r!="object"||r===null||"typ"in r&&r?.typ!=="JWT"||!r.alg||e&&r.alg!==e)}catch{return!1}}function Uo(s,e){return!!((e==="v4"||!e)&&Do.test(s)||(e==="v6"||!e)&&jo.test(s))}class De extends L{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==_.string){const o=this._getOrReturnCtx(e);return k(o,{code:m.invalid_type,expected:_.string,received:o.parsedType}),j}const n=new ce;let r;for(const o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(r=this._getOrReturnCtx(e,r),k(r,{code:m.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")e.data.length>o.value&&(r=this._getOrReturnCtx(e,r),k(r,{code:m.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){const p=e.data.length>o.value,c=e.data.length<o.value;(p||c)&&(r=this._getOrReturnCtx(e,r),p?k(r,{code:m.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):c&&k(r,{code:m.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")Io.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"email",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")Ot||(Ot=new RegExp(Oo,"u")),Ot.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"emoji",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")To.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"uuid",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")Co.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"nanoid",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")wo.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"cuid",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")_o.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"cuid2",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")So.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"ulid",code:m.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),k(r,{validation:"url",code:m.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"regex",code:m.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(r=this._getOrReturnCtx(e,r),k(r,{code:m.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(r=this._getOrReturnCtx(e,r),k(r,{code:m.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(r=this._getOrReturnCtx(e,r),k(r,{code:m.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?Vo(o).test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{code:m.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?Lo.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{code:m.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?Po(o).test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{code:m.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?No.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"duration",code:m.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?Bo(e.data,o.version)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"ip",code:m.invalid_string,message:o.message}),n.dirty()):o.kind==="jwt"?Zo(e.data,o.alg)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"jwt",code:m.invalid_string,message:o.message}),n.dirty()):o.kind==="cidr"?Uo(e.data,o.version)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"cidr",code:m.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?Ro.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"base64",code:m.invalid_string,message:o.message}),n.dirty()):o.kind==="base64url"?Eo.test(e.data)||(r=this._getOrReturnCtx(e,r),k(r,{validation:"base64url",code:m.invalid_string,message:o.message}),n.dirty()):Z.assertNever(o);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(r=>e.test(r),{validation:t,code:m.invalid_string,...T.errToObj(n)})}_addCheck(e){return new De({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...T.errToObj(e)})}url(e){return this._addCheck({kind:"url",...T.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...T.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...T.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...T.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...T.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...T.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...T.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...T.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...T.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...T.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...T.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...T.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...T.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...T.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...T.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...T.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...T.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...T.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...T.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...T.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...T.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...T.errToObj(t)})}nonempty(e){return this.min(1,T.errToObj(e))}trim(){return new De({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new De({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new De({...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}}De.create=s=>new De({checks:[],typeName:D.ZodString,coerce:s?.coerce??!1,...R(s)});function Jo(s,e){const t=(s.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,r=t>n?t:n,o=Number.parseInt(s.toFixed(r).replace(".","")),p=Number.parseInt(e.toFixed(r).replace(".",""));return o%p/10**r}class ze extends L{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==_.number){const o=this._getOrReturnCtx(e);return k(o,{code:m.invalid_type,expected:_.number,received:o.parsedType}),j}let n;const r=new ce;for(const o of this._def.checks)o.kind==="int"?Z.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),k(n,{code:m.invalid_type,expected:"integer",received:"float",message:o.message}),r.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),k(n,{code:m.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),k(n,{code:m.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()):o.kind==="multipleOf"?Jo(e.data,o.value)!==0&&(n=this._getOrReturnCtx(e,n),k(n,{code:m.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),k(n,{code:m.not_finite,message:o.message}),r.dirty()):Z.assertNever(o);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,T.toString(t))}gt(e,t){return this.setLimit("min",e,!1,T.toString(t))}lte(e,t){return this.setLimit("max",e,!0,T.toString(t))}lt(e,t){return this.setLimit("max",e,!1,T.toString(t))}setLimit(e,t,n,r){return new ze({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:T.toString(r)}]})}_addCheck(e){return new ze({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:T.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:T.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:T.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:T.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:T.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:T.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:T.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:T.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:T.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Z.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}ze.create=s=>new ze({checks:[],typeName:D.ZodNumber,coerce:s?.coerce||!1,...R(s)});class et extends L{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==_.bigint)return this._getInvalidInput(e);let n;const r=new ce;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),k(n,{code:m.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),k(n,{code:m.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),k(n,{code:m.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()):Z.assertNever(o);return{status:r.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return k(t,{code:m.invalid_type,expected:_.bigint,received:t.parsedType}),j}gte(e,t){return this.setLimit("min",e,!0,T.toString(t))}gt(e,t){return this.setLimit("min",e,!1,T.toString(t))}lte(e,t){return this.setLimit("max",e,!0,T.toString(t))}lt(e,t){return this.setLimit("max",e,!1,T.toString(t))}setLimit(e,t,n,r){return new et({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:T.toString(r)}]})}_addCheck(e){return new et({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:T.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:T.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:T.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:T.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:T.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}et.create=s=>new et({checks:[],typeName:D.ZodBigInt,coerce:s?.coerce??!1,...R(s)});class ua extends L{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==_.boolean){const n=this._getOrReturnCtx(e);return k(n,{code:m.invalid_type,expected:_.boolean,received:n.parsedType}),j}return ke(e.data)}}ua.create=s=>new ua({typeName:D.ZodBoolean,coerce:s?.coerce||!1,...R(s)});class xt extends L{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==_.date){const o=this._getOrReturnCtx(e);return k(o,{code:m.invalid_type,expected:_.date,received:o.parsedType}),j}if(Number.isNaN(e.data.getTime())){const o=this._getOrReturnCtx(e);return k(o,{code:m.invalid_date}),j}const n=new ce;let r;for(const o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(r=this._getOrReturnCtx(e,r),k(r,{code:m.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(r=this._getOrReturnCtx(e,r),k(r,{code:m.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):Z.assertNever(o);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new xt({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:T.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:T.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}xt.create=s=>new xt({checks:[],coerce:s?.coerce||!1,typeName:D.ZodDate,...R(s)});class ca extends L{_parse(e){if(this._getType(e)!==_.symbol){const n=this._getOrReturnCtx(e);return k(n,{code:m.invalid_type,expected:_.symbol,received:n.parsedType}),j}return ke(e.data)}}ca.create=s=>new ca({typeName:D.ZodSymbol,...R(s)});class pa extends L{_parse(e){if(this._getType(e)!==_.undefined){const n=this._getOrReturnCtx(e);return k(n,{code:m.invalid_type,expected:_.undefined,received:n.parsedType}),j}return ke(e.data)}}pa.create=s=>new pa({typeName:D.ZodUndefined,...R(s)});class ma extends L{_parse(e){if(this._getType(e)!==_.null){const n=this._getOrReturnCtx(e);return k(n,{code:m.invalid_type,expected:_.null,received:n.parsedType}),j}return ke(e.data)}}ma.create=s=>new ma({typeName:D.ZodNull,...R(s)});class jt extends L{constructor(){super(...arguments),this._any=!0}_parse(e){return ke(e.data)}}jt.create=s=>new jt({typeName:D.ZodAny,...R(s)});class fa extends L{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ke(e.data)}}fa.create=s=>new fa({typeName:D.ZodUnknown,...R(s)});class Ve extends L{_parse(e){const t=this._getOrReturnCtx(e);return k(t,{code:m.invalid_type,expected:_.never,received:t.parsedType}),j}}Ve.create=s=>new Ve({typeName:D.ZodNever,...R(s)});class ha extends L{_parse(e){if(this._getType(e)!==_.undefined){const n=this._getOrReturnCtx(e);return k(n,{code:m.invalid_type,expected:_.void,received:n.parsedType}),j}return ke(e.data)}}ha.create=s=>new ha({typeName:D.ZodVoid,...R(s)});class Ne extends L{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==_.array)return k(t,{code:m.invalid_type,expected:_.array,received:t.parsedType}),j;if(r.exactLength!==null){const p=t.data.length>r.exactLength.value,c=t.data.length<r.exactLength.value;(p||c)&&(k(t,{code:p?m.too_big:m.too_small,minimum:c?r.exactLength.value:void 0,maximum:p?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(k(t,{code:m.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(k(t,{code:m.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((p,c)=>r.type._parseAsync(new Ie(t,p,t.path,c)))).then(p=>ce.mergeArray(n,p));const o=[...t.data].map((p,c)=>r.type._parseSync(new Ie(t,p,t.path,c)));return ce.mergeArray(n,o)}get element(){return this._def.type}min(e,t){return new Ne({...this._def,minLength:{value:e,message:T.toString(t)}})}max(e,t){return new Ne({...this._def,maxLength:{value:e,message:T.toString(t)}})}length(e,t){return new Ne({...this._def,exactLength:{value:e,message:T.toString(t)}})}nonempty(e){return this.min(1,e)}}Ne.create=(s,e)=>new Ne({type:s,minLength:null,maxLength:null,exactLength:null,typeName:D.ZodArray,...R(e)});function Je(s){if(s instanceof ee){const e={};for(const t in s.shape){const n=s.shape[t];e[t]=Pe.create(Je(n))}return new ee({...s._def,shape:()=>e})}else return s instanceof Ne?new Ne({...s._def,type:Je(s.element)}):s instanceof Pe?Pe.create(Je(s.unwrap())):s instanceof We?We.create(Je(s.unwrap())):s instanceof Ze?Ze.create(s.items.map(e=>Je(e))):s}class ee extends L{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=Z.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==_.object){const b=this._getOrReturnCtx(e);return k(b,{code:m.invalid_type,expected:_.object,received:b.parsedType}),j}const{status:n,ctx:r}=this._processInputParams(e),{shape:o,keys:p}=this._getCached(),c=[];if(!(this._def.catchall instanceof Ve&&this._def.unknownKeys==="strip"))for(const b in r.data)p.includes(b)||c.push(b);const w=[];for(const b of p){const O=o[b],le=r.data[b];w.push({key:{status:"valid",value:b},value:O._parse(new Ie(r,le,r.path,b)),alwaysSet:b in r.data})}if(this._def.catchall instanceof Ve){const b=this._def.unknownKeys;if(b==="passthrough")for(const O of c)w.push({key:{status:"valid",value:O},value:{status:"valid",value:r.data[O]}});else if(b==="strict")c.length>0&&(k(r,{code:m.unrecognized_keys,keys:c}),n.dirty());else if(b!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const b=this._def.catchall;for(const O of c){const le=r.data[O];w.push({key:{status:"valid",value:O},value:b._parse(new Ie(r,le,r.path,O)),alwaysSet:O in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const b=[];for(const O of w){const le=await O.key,G=await O.value;b.push({key:le,value:G,alwaysSet:O.alwaysSet})}return b}).then(b=>ce.mergeObjectSync(n,b)):ce.mergeObjectSync(n,w)}get shape(){return this._def.shape()}strict(e){return T.errToObj,new ee({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{const r=this._def.errorMap?.(t,n).message??n.defaultError;return t.code==="unrecognized_keys"?{message:T.errToObj(e).message??r}:{message:r}}}:{}})}strip(){return new ee({...this._def,unknownKeys:"strip"})}passthrough(){return new ee({...this._def,unknownKeys:"passthrough"})}extend(e){return new ee({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ee({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:D.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ee({...this._def,catchall:e})}pick(e){const t={};for(const n of Z.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new ee({...this._def,shape:()=>t})}omit(e){const t={};for(const n of Z.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new ee({...this._def,shape:()=>t})}deepPartial(){return Je(this)}partial(e){const t={};for(const n of Z.objectKeys(this.shape)){const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()}return new ee({...this._def,shape:()=>t})}required(e){const t={};for(const n of Z.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof Pe;)o=o._def.innerType;t[n]=o}return new ee({...this._def,shape:()=>t})}keyof(){return Ia(Z.objectKeys(this.shape))}}ee.create=(s,e)=>new ee({shape:()=>s,unknownKeys:"strip",catchall:Ve.create(),typeName:D.ZodObject,...R(e)});ee.strictCreate=(s,e)=>new ee({shape:()=>s,unknownKeys:"strict",catchall:Ve.create(),typeName:D.ZodObject,...R(e)});ee.lazycreate=(s,e)=>new ee({shape:s,unknownKeys:"strip",catchall:Ve.create(),typeName:D.ZodObject,...R(e)});class vt extends L{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;function r(o){for(const c of o)if(c.result.status==="valid")return c.result;for(const c of o)if(c.result.status==="dirty")return t.common.issues.push(...c.ctx.common.issues),c.result;const p=o.map(c=>new $e(c.ctx.common.issues));return k(t,{code:m.invalid_union,unionErrors:p}),j}if(t.common.async)return Promise.all(n.map(async o=>{const p={...t,common:{...t.common,issues:[]},parent:null};return{result:await o._parseAsync({data:t.data,path:t.path,parent:p}),ctx:p}})).then(r);{let o;const p=[];for(const w of n){const b={...t,common:{...t.common,issues:[]},parent:null},O=w._parseSync({data:t.data,path:t.path,parent:b});if(O.status==="valid")return O;O.status==="dirty"&&!o&&(o={result:O,ctx:b}),b.common.issues.length&&p.push(b.common.issues)}if(o)return t.common.issues.push(...o.ctx.common.issues),o.result;const c=p.map(w=>new $e(w));return k(t,{code:m.invalid_union,unionErrors:c}),j}}get options(){return this._def.options}}vt.create=(s,e)=>new vt({options:s,typeName:D.ZodUnion,...R(e)});function Rt(s,e){const t=Le(s),n=Le(e);if(s===e)return{valid:!0,data:s};if(t===_.object&&n===_.object){const r=Z.objectKeys(e),o=Z.objectKeys(s).filter(c=>r.indexOf(c)!==-1),p={...s,...e};for(const c of o){const w=Rt(s[c],e[c]);if(!w.valid)return{valid:!1};p[c]=w.data}return{valid:!0,data:p}}else if(t===_.array&&n===_.array){if(s.length!==e.length)return{valid:!1};const r=[];for(let o=0;o<s.length;o++){const p=s[o],c=e[o],w=Rt(p,c);if(!w.valid)return{valid:!1};r.push(w.data)}return{valid:!0,data:r}}else return t===_.date&&n===_.date&&+s==+e?{valid:!0,data:s}:{valid:!1}}class gt extends L{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(o,p)=>{if(oa(o)||oa(p))return j;const c=Rt(o.value,p.value);return c.valid?((la(o)||la(p))&&t.dirty(),{status:t.value,value:c.data}):(k(n,{code:m.invalid_intersection_types}),j)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,p])=>r(o,p)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}gt.create=(s,e,t)=>new gt({left:s,right:e,typeName:D.ZodIntersection,...R(t)});class Ze extends L{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==_.array)return k(n,{code:m.invalid_type,expected:_.array,received:n.parsedType}),j;if(n.data.length<this._def.items.length)return k(n,{code:m.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),j;!this._def.rest&&n.data.length>this._def.items.length&&(k(n,{code:m.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const o=[...n.data].map((p,c)=>{const w=this._def.items[c]||this._def.rest;return w?w._parse(new Ie(n,p,n.path,c)):null}).filter(p=>!!p);return n.common.async?Promise.all(o).then(p=>ce.mergeArray(t,p)):ce.mergeArray(t,o)}get items(){return this._def.items}rest(e){return new Ze({...this._def,rest:e})}}Ze.create=(s,e)=>{if(!Array.isArray(s))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ze({items:s,typeName:D.ZodTuple,rest:null,...R(e)})};class yt extends L{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==_.object)return k(n,{code:m.invalid_type,expected:_.object,received:n.parsedType}),j;const r=[],o=this._def.keyType,p=this._def.valueType;for(const c in n.data)r.push({key:o._parse(new Ie(n,c,n.path,c)),value:p._parse(new Ie(n,n.data[c],n.path,c)),alwaysSet:c in n.data});return n.common.async?ce.mergeObjectAsync(t,r):ce.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof L?new yt({keyType:e,valueType:t,typeName:D.ZodRecord,...R(n)}):new yt({keyType:De.create(),valueType:e,typeName:D.ZodRecord,...R(t)})}}class xa extends L{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==_.map)return k(n,{code:m.invalid_type,expected:_.map,received:n.parsedType}),j;const r=this._def.keyType,o=this._def.valueType,p=[...n.data.entries()].map(([c,w],b)=>({key:r._parse(new Ie(n,c,n.path,[b,"key"])),value:o._parse(new Ie(n,w,n.path,[b,"value"]))}));if(n.common.async){const c=new Map;return Promise.resolve().then(async()=>{for(const w of p){const b=await w.key,O=await w.value;if(b.status==="aborted"||O.status==="aborted")return j;(b.status==="dirty"||O.status==="dirty")&&t.dirty(),c.set(b.value,O.value)}return{status:t.value,value:c}})}else{const c=new Map;for(const w of p){const b=w.key,O=w.value;if(b.status==="aborted"||O.status==="aborted")return j;(b.status==="dirty"||O.status==="dirty")&&t.dirty(),c.set(b.value,O.value)}return{status:t.value,value:c}}}}xa.create=(s,e,t)=>new xa({valueType:e,keyType:s,typeName:D.ZodMap,...R(t)});class tt extends L{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==_.set)return k(n,{code:m.invalid_type,expected:_.set,received:n.parsedType}),j;const r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(k(n,{code:m.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(k(n,{code:m.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const o=this._def.valueType;function p(w){const b=new Set;for(const O of w){if(O.status==="aborted")return j;O.status==="dirty"&&t.dirty(),b.add(O.value)}return{status:t.value,value:b}}const c=[...n.data.values()].map((w,b)=>o._parse(new Ie(n,w,n.path,b)));return n.common.async?Promise.all(c).then(w=>p(w)):p(c)}min(e,t){return new tt({...this._def,minSize:{value:e,message:T.toString(t)}})}max(e,t){return new tt({...this._def,maxSize:{value:e,message:T.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}tt.create=(s,e)=>new tt({valueType:s,minSize:null,maxSize:null,typeName:D.ZodSet,...R(e)});class va extends L{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}va.create=(s,e)=>new va({getter:s,typeName:D.ZodLazy,...R(e)});class ga extends L{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return k(t,{received:t.data,code:m.invalid_literal,expected:this._def.value}),j}return{status:"valid",value:e.data}}get value(){return this._def.value}}ga.create=(s,e)=>new ga({value:s,typeName:D.ZodLiteral,...R(e)});function Ia(s,e){return new Ge({values:s,typeName:D.ZodEnum,...R(e)})}class Ge extends L{_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),n=this._def.values;return k(t,{expected:Z.joinValues(n),received:t.parsedType,code:m.invalid_type}),j}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return k(t,{received:t.data,code:m.invalid_enum_value,options:n}),j}return ke(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 Ge.create(e,{...this._def,...t})}exclude(e,t=this._def){return Ge.create(this.options.filter(n=>!e.includes(n)),{...this._def,...t})}}Ge.create=Ia;class ya extends L{_parse(e){const t=Z.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==_.string&&n.parsedType!==_.number){const r=Z.objectValues(t);return k(n,{expected:Z.joinValues(r),received:n.parsedType,code:m.invalid_type}),j}if(this._cache||(this._cache=new Set(Z.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const r=Z.objectValues(t);return k(n,{received:n.data,code:m.invalid_enum_value,options:r}),j}return ke(e.data)}get enum(){return this._def.values}}ya.create=(s,e)=>new ya({values:s,typeName:D.ZodNativeEnum,...R(e)});class bt extends L{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==_.promise&&t.common.async===!1)return k(t,{code:m.invalid_type,expected:_.promise,received:t.parsedType}),j;const n=t.parsedType===_.promise?t.data:Promise.resolve(t.data);return ke(n.then(r=>this._def.type.parseAsync(r,{path:t.path,errorMap:t.common.contextualErrorMap})))}}bt.create=(s,e)=>new bt({type:s,typeName:D.ZodPromise,...R(e)});class Ke extends L{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===D.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,o={addIssue:p=>{k(n,p),p.fatal?t.abort():t.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),r.type==="preprocess"){const p=r.transform(n.data,o);if(n.common.async)return Promise.resolve(p).then(async c=>{if(t.value==="aborted")return j;const w=await this._def.schema._parseAsync({data:c,path:n.path,parent:n});return w.status==="aborted"?j:w.status==="dirty"||t.value==="dirty"?Qe(w.value):w});{if(t.value==="aborted")return j;const c=this._def.schema._parseSync({data:p,path:n.path,parent:n});return c.status==="aborted"?j:c.status==="dirty"||t.value==="dirty"?Qe(c.value):c}}if(r.type==="refinement"){const p=c=>{const w=r.refinement(c,o);if(n.common.async)return Promise.resolve(w);if(w instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(n.common.async===!1){const c=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return c.status==="aborted"?j:(c.status==="dirty"&&t.dirty(),p(c.value),{status:t.value,value:c.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(c=>c.status==="aborted"?j:(c.status==="dirty"&&t.dirty(),p(c.value).then(()=>({status:t.value,value:c.value}))))}if(r.type==="transform")if(n.common.async===!1){const p=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Fe(p))return j;const c=r.transform(p.value,o);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:c}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(p=>Fe(p)?Promise.resolve(r.transform(p.value,o)).then(c=>({status:t.value,value:c})):j);Z.assertNever(r)}}Ke.create=(s,e,t)=>new Ke({schema:s,typeName:D.ZodEffects,effect:e,...R(t)});Ke.createWithPreprocess=(s,e,t)=>new Ke({schema:e,effect:{type:"preprocess",transform:s},typeName:D.ZodEffects,...R(t)});class Pe extends L{_parse(e){return this._getType(e)===_.undefined?ke(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Pe.create=(s,e)=>new Pe({innerType:s,typeName:D.ZodOptional,...R(e)});class We extends L{_parse(e){return this._getType(e)===_.null?ke(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}We.create=(s,e)=>new We({innerType:s,typeName:D.ZodNullable,...R(e)});class Et extends L{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===_.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Et.create=(s,e)=>new Et({innerType:s,typeName:D.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...R(e)});class Lt extends L{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return ht(r)?r.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new $e(n.common.issues)},input:n.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new $e(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Lt.create=(s,e)=>new Lt({innerType:s,typeName:D.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...R(e)});class ba extends L{_parse(e){if(this._getType(e)!==_.nan){const n=this._getOrReturnCtx(e);return k(n,{code:m.invalid_type,expected:_.nan,received:n.parsedType}),j}return{status:"valid",value:e.data}}}ba.create=s=>new ba({typeName:D.ZodNaN,...R(s)});class Ho extends L{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class Bt extends L{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?j:o.status==="dirty"?(t.dirty(),Qe(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{const r=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return r.status==="aborted"?j:r.status==="dirty"?(t.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:n.path,parent:n})}}static create(e,t){return new Bt({in:e,out:t,typeName:D.ZodPipeline})}}class Pt extends L{_parse(e){const t=this._def.innerType._parse(e),n=r=>(Fe(r)&&(r.value=Object.freeze(r.value)),r);return ht(t)?t.then(r=>n(r)):n(t)}unwrap(){return this._def.innerType}}Pt.create=(s,e)=>new Pt({innerType:s,typeName:D.ZodReadonly,...R(e)});var D;(function(s){s.ZodString="ZodString",s.ZodNumber="ZodNumber",s.ZodNaN="ZodNaN",s.ZodBigInt="ZodBigInt",s.ZodBoolean="ZodBoolean",s.ZodDate="ZodDate",s.ZodSymbol="ZodSymbol",s.ZodUndefined="ZodUndefined",s.ZodNull="ZodNull",s.ZodAny="ZodAny",s.ZodUnknown="ZodUnknown",s.ZodNever="ZodNever",s.ZodVoid="ZodVoid",s.ZodArray="ZodArray",s.ZodObject="ZodObject",s.ZodUnion="ZodUnion",s.ZodDiscriminatedUnion="ZodDiscriminatedUnion",s.ZodIntersection="ZodIntersection",s.ZodTuple="ZodTuple",s.ZodRecord="ZodRecord",s.ZodMap="ZodMap",s.ZodSet="ZodSet",s.ZodFunction="ZodFunction",s.ZodLazy="ZodLazy",s.ZodLiteral="ZodLiteral",s.ZodEnum="ZodEnum",s.ZodEffects="ZodEffects",s.ZodNativeEnum="ZodNativeEnum",s.ZodOptional="ZodOptional",s.ZodNullable="ZodNullable",s.ZodDefault="ZodDefault",s.ZodCatch="ZodCatch",s.ZodPromise="ZodPromise",s.ZodBranded="ZodBranded",s.ZodPipeline="ZodPipeline",s.ZodReadonly="ZodReadonly"})(D||(D={}));const x=De.create,Xe=ze.create,ka=jt.create;Ve.create;const se=Ne.create,Q=ee.create;vt.create;gt.create;Ze.create;const Fo=yt.create,zo=Ge.create;bt.create;Pe.create;We.create;const Go=Q({label:x().min(1).max(40),left:x().min(1).max(35),right:x().min(1).max(35)}),Ko=Q({id:x().optional().default(()=>`post-${Date.now()}`).transform(s=>s||`post-${Date.now()}`),templateId:x().optional(),category:x().optional().default("TECH"),theme:zo(["blue-tech","emerald-finance","slate-education","dark-contrast","crimson-alert","amber-gold","cyber-violet","sunset-orange","nordic-frost","monochrome-luxe"]).default("blue-tech"),layoutType:x().default("table"),title:x().min(1).max(120),subtitle:x().min(1).max(250),leftHeader:x().optional().default("USA 🇺🇸"),rightHeader:x().optional().default("UK 🇬🇧"),rows:se(Go).optional().default([]),bullets:se(Q({highlight:x().optional().default(""),text:x().min(1)})).optional().default([]),bigStat:Q({number:x().default("$165,000"),label:x().default("Average Compensation"),subtext:x().optional().default(""),secondaryNumber:x().optional().default(""),secondaryLabel:x().optional().default("")}).optional(),listItems:se(Q({rank:Xe(),title:x(),value:x(),tag:x().optional().default("")})).optional().default([]),quoteData:Q({quote:x(),highlight:x().optional().default(""),source:x().default("Industry Insider")}).optional(),versusData:Q({leftEntity:x().optional(),leftStats:se(Q({label:x(),value:x()})).optional(),leftPerk:x().optional(),rightEntity:x().optional(),rightStats:se(Q({label:x(),value:x()})).optional(),rightPerk:x().optional(),verdict:x().optional()}).optional(),receiptData:Q({grossMonthly:x().optional(),items:se(Q({label:x(),amount:x(),note:x().optional()})).optional(),totalDeductions:x().optional(),netRemaining:x().optional()}).optional(),timelineData:Q({pastYear:x().optional().default("2016"),presentYear:x().optional().default("2026"),items:se(Q({label:x(),pastValue:x(),presentValue:x(),changeBadge:x().optional()})).optional(),bottomInsight:x().optional()}).optional(),barchartData:se(Q({label:x(),percentage:Xe().min(0).max(100),amount:x().optional(),tag:x().optional()})).optional().default([]),leaderboardData:Q({calloutNote:x().optional().default("*Asumsi kurs : Rp15.500/US$"),items:se(Q({rank:Xe(),name:x(),flag:x().optional().default("🌐"),value:x(),percentage:Xe().min(0).max(100).optional()})).optional()}).optional(),editorialData:Q({badge:x().optional().default("INVESTIGASI KHUSUS"),highlightPhrase:x().optional(),cards:se(Q({step:x().optional(),title:x(),text:x(),stat:x().optional()})).optional(),keyTakeaway:x().optional()}).optional(),matrixData:Q({headers:se(x()).optional().default(["Indikator","🇮🇩 IDN","🇲🇾 MYS","🇸🇬 SGP"]),rows:se(Q({label:x(),values:se(x())})).optional()}).optional(),debateData:Q({proTitle:x().optional().default("SISI PRO / BENEFIT"),proScore:x().optional().default("65%"),proPoints:se(x()).optional(),conTitle:x().optional().default("SISI KONTRA / RISIKO"),conScore:x().optional().default("35%"),conPoints:se(x()).optional(),callToAction:x().optional().default("Kalian di tim mana? Tulis pendapatmu di bawah! 👇")}).optional(),tierlistData:se(Q({tier:x(),tierColor:x().optional(),items:se(Q({name:x(),badge:x().optional(),desc:x().optional()}))})).optional().default([]),customHtml:x().optional(),customCss:x().optional(),customFields:Fo(ka()).optional(),items:se(ka()).optional(),footerNote:x().optional().default("Industry Benchmark 2026"),watermark:x().optional().default("@SocialGen"),bgKeyword:x().optional().default("modern office coding night"),reelsDuration:Xe().min(5).max(90).default(30),caption:x().optional().default("Bagikan pendapat Anda di kolom komentar! #infografis #edukasi")}),Wo={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"},qo={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"},Yo={class:"flex items-center gap-2.5 sm:gap-3"},Xo={class:"text-sm font-extrabold tracking-tight text-white flex items-center gap-1.5 sm:gap-2"},Qo={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"},el={class:"flex items-center gap-2 sm:gap-3 text-xs"},tl={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]"},al={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]"},sl={class:"lg:hidden flex items-center justify-center px-3 py-2 bg-slate-900/90 border-b border-slate-800 flex-shrink-0"},nl={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"},il={key:0,class:"w-2 h-2 rounded-full bg-emerald-400 animate-ping"},rl={class:"flex items-center gap-2"},ol={key:0,class:"text-emerald-400"},ll={key:1,class:"text-rose-400"},dl={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"},pl=Vt({__name:"index",setup(s){const e=S({id:"news-us-germany-salary-divide-2026",category:"TECH REPORT",theme:"blue-tech",layoutType:"news",title:"THE $90,000 TRANSATLANTIC TECH DIVIDE",subtitle:"United States 🇺🇸 vs Germany 🇩🇪 (2026 Real Purchasing Power)",leftHeader:"USA 🇺🇸",rightHeader:"Germany 🇩🇪",rows:[{label:"Junior Dev",left:"$88,000/yr",right:"$52,000/yr"},{label:"Mid-Level",left:"$135,000/yr",right:"$75,000/yr"},{label:"Senior Lead",left:"$180,000/yr",right:"$98,000/yr"},{label:"Effective Tax",left:"24%",right:"42%"},{label:"Paid Vacation",left:"15 Days",right:"30 Days"}],bullets:[{highlight:"Gross Salary Lead",text:"American engineers take home up to 84% higher base compensation."},{highlight:"Work-Life Balance",text:"German labor laws guarantee 30 paid days off with zero expectation of after-hours Slack."},{highlight:"Healthcare Drag",text:"US health insurance deductibles and out-of-pocket costs eat up to $14,000/yr per family."}],bigStat:{number:"$180,000",label:"Senior Tech Base in California",secondaryNumber:"$98,000",secondaryLabel:"Munich Hub",subtext:"The gap widens at senior level, but so does cost of childcare and housing inflation."},listItems:[{rank:1,title:"Switzerland 🇨🇭",value:"$145,000/yr",tag:"Top Net Pay"},{rank:2,title:"United States 🇺🇸",value:"$135,000/yr",tag:"Fast Growth"},{rank:3,title:"Australia 🇦🇺",value:"$98,000/yr",tag:"High Super"},{rank:4,title:"Germany 🇩🇪",value:"$84,000/yr",tag:"Pension Safety"},{rank:5,title:"United Kingdom 🇬🇧",value:"$72,000/yr",tag:"Flexible"}],quoteData:{quote:"Chasing the American gross salary without calculating healthcare deductibles and 50-hour workweeks is the most common financial illusion in global tech.",highlight:"most common financial illusion",source:"Principal Tech Recruiter"},footerNote:"Source: Verified Industry Compensation Survey 2026",watermark:"@SocialGen",bgKeyword:"modern office coding night technology",reelsDuration:30,caption:"Higher gross salary in the US or guaranteed 30 days off in Germany? Which lifestyle would you choose? Drop your vote below! 👇 #techcareers #salary #softwareengineer #worklife"}),t=S({theme:"blue-tech",backgroundSource:"pexels",musicFile:"random",videoStartOffset:0,audioStartOffset:0,outputs:{feed:!0,story:!0,reels:!0}}),n=S([]),r=S(-1),o=S(null);function p(A){if(!e.value||!e.value.title||o.value)return;const h=JSON.stringify(e.value),K=A?JSON.stringify(A):"";if(h!==K){o.value=JSON.parse(h);try{localStorage.setItem("sg_unsaved_stash",h)}catch{}}}function c(){if(!o.value)return;const A=o.value.title||"Editan Anda";e.value=JSON.parse(JSON.stringify(o.value)),o.value.theme&&(t.value.theme=o.value.theme),o.value=null,r.value=-1,M.value=-1;try{localStorage.removeItem("sg_unsaved_stash")}catch{}X(`Editan sebelumnya ("${A.slice(0,24)}...") berhasil dikembalikan! ↩️`,"success")}function w(){o.value=null;try{localStorage.removeItem("sg_unsaved_stash")}catch{}}function b(){try{localStorage.setItem("sg_drafts",JSON.stringify(n.value))}catch{}$fetch("/api/drafts",{method:"POST",body:{drafts:n.value}}).catch(()=>{})}function O(){n.value.unshift(JSON.parse(JSON.stringify(e.value))),r.value=0,M.value=-1,b(),X("Draft berhasil disimpan!")}function le(A){const h=n.value[A];if(h){p(h),e.value=JSON.parse(JSON.stringify(h)),h.theme&&(t.value.theme=h.theme),r.value=A,M.value=-1;const K=!!o.value;X(`Memuat draft #${A+1}: "${(h.title||"Untitled").slice(0,20)}..."`,"success",K?{label:"↩️ Kembalikan Editan",onClick:c}:void 0)}}function G(A){n.value.splice(A,1),r.value===A&&(r.value=-1),b(),X("Draft dihapus")}const $=S([]),M=S(-1);function J(){try{localStorage.setItem("sg_gen_history",JSON.stringify($.value))}catch{}$fetch("/api/generation-history",{method:"POST",body:{history:$.value}}).catch(()=>{})}function V(A){const h=$.value[A];if(h){const K=h.contentData||h;p(K),e.value=JSON.parse(JSON.stringify(K)),h.options&&(t.value={...t.value,...h.options}),M.value=A,r.value=-1;const _e=!!o.value;X(`Memuat riwayat: "${(h.title||"Untitled").slice(0,24)}..."`,"success",_e?{label:"↩️ Kembalikan Editan",onClick:c}:void 0)}}function ge(A){$.value.splice(A,1),M.value===A&&(M.value=-1),J(),X("Item riwayat dihapus")}function je(){$.value=[],M.value=-1,J(),X("Seluruh riwayat generate berhasil dibersihkan!")}let de=null;function re(){try{localStorage.setItem("sg_active_content",JSON.stringify(e.value)),localStorage.setItem("sg_active_options",JSON.stringify(t.value))}catch{}clearTimeout(de),de=setTimeout(()=>{$fetch("/api/last-session",{method:"POST",body:{content:e.value,options:t.value}}).catch(()=>{})},1e3)}ve(()=>e.value,re,{deep:!0}),ve(()=>t.value,re,{deep:!0});const ne=S(!1),Y=S(!1),Oe=S(""),z=S(null),pe=S(""),ae=S("success"),q=S("editor"),he=S(null);wa(async()=>{try{const A=localStorage.getItem("sg_active_content");if(A){const h=JSON.parse(A);h&&h.title&&(e.value=h)}else{const h=await $fetch("/api/last-session");h?.session?.content&&(e.value=h.session.content,h.session.options&&(t.value={...t.value,...h.session.options}))}}catch{}try{const A=localStorage.getItem("sg_active_options");if(A){const h=JSON.parse(A);h&&(t.value={...t.value,...h})}}catch{}try{const A=await $fetch("/api/drafts");if(A?.drafts&&Array.isArray(A.drafts)&&A.drafts.length>0)n.value=A.drafts;else{const h=localStorage.getItem("sg_drafts");if(h){const K=JSON.parse(h);Array.isArray(K)&&K.length>0&&(n.value=K,$fetch("/api/drafts",{method:"POST",body:{drafts:K}}).catch(()=>{}))}}}catch{const A=localStorage.getItem("sg_drafts");if(A)try{n.value=JSON.parse(A)}catch{}}try{const A=await $fetch("/api/generation-history");if(A?.history&&Array.isArray(A.history)&&A.history.length>0)$.value=A.history;else{const h=localStorage.getItem("sg_gen_history");h&&($.value=JSON.parse(h))}}catch{}try{const A=await $fetch("/api/status");he.value=A}catch{}try{const A=localStorage.getItem("sg_unsaved_stash");A&&(o.value=JSON.parse(A))}catch{}});const te=ue(()=>{const A=Ko.safeParse(e.value);if(A.success)return{isValid:!0,error:""};{const h=A.error.errors[0];return{isValid:!1,error:`${h.path.join(".")}: ${h.message}`}}}),me=S(null);let we=null;function X(A,h="success",K){clearTimeout(we),pe.value=A,ae.value=h,me.value=K||null,we=setTimeout(()=>{pe.value="",me.value=null},K?7e3:4e3)}async function N(A,h,K,_e){Y.value=!0,Oe.value=`AI Research (${K||"Gemini"})...`;try{const P=await $fetch("/api/auto-topic",{method:"POST",body:{niche:A,layoutType:h,model:K,language:_e}});if(P?.dataset){p(P.dataset),e.value=P.dataset,t.value.theme=P.dataset.theme,n.value.unshift(P.dataset),r.value=0,b();const Re=!!o.value;P.source==="gemini"?X(`✨ [${P.modelUsed||"Gemini"}] Berhasil meriset: "${P.dataset.title.slice(0,32)}..."`,"success",Re?{label:"↩️ Kembalikan Editan",onClick:c}:void 0):X(`ℹ️ [Curated Data] Topik siap: "${P.dataset.title.slice(0,32)}..."`,"success",Re?{label:"↩️ Kembalikan Editan",onClick:c}:void 0)}}catch(P){X("Gagal auto-topic: "+(P.data?.statusMessage||P.message),"error")}finally{Y.value=!1,Oe.value=""}}async function qe(){if(!te.value.isValid){X("Data tidak valid: "+te.value.error,"error");return}ne.value=!0,Oe.value="Rendering Images & Reels...",z.value=null;const A={id:e.value.id||String(Date.now()),title:e.value.title||"Untitled Creation",layoutType:e.value.layoutType||"table",category:e.value.category||"GENERAL",theme:e.value.theme||"blue-tech",generatedAt:new Date().toISOString(),contentData:JSON.parse(JSON.stringify(e.value)),options:JSON.parse(JSON.stringify(t.value))};$.value.unshift(A),M.value=0,J(),q.value="preview";try{const h=await $fetch("/api/generate",{method:"POST",body:{data:e.value,options:t.value}});h?.success&&(z.value=h,X(`Sukses dirender dalam ${(h.durationMs/1e3).toFixed(1)} detik!`))}catch(h){X("Gagal render: "+(h.data?.statusMessage||h.message),"error")}finally{ne.value=!1,Oe.value=""}}return(A,h)=>{const K=Cr,_e=go;return f(),v("div",Wo,[a("header",qo,[a("div",Yo,[h[11]||(h[11]=a("div",{class:"w-8 h-8 rounded-xl bg-gradient-to-tr from-sky-500 via-indigo-600 to-purple-600 flex items-center justify-center font-black text-white shadow-md shadow-sky-500/20 text-xs"}," SG ",-1)),a("div",null,[a("h1",Xo,[h[10]||(h[10]=F(" SocialGen ",-1)),a("span",Qo," v"+g(l(he)?.version||"2.3.0"),1)])])]),a("div",el,[l(he)?.geminiActive?(f(),v("span",tl," ● AI Connected ")):(f(),v("span",al," ● Local Engine "))])]),a("div",sl,[a("div",nl,[a("button",{onClick:h[0]||(h[0]=P=>q.value="editor"),class:H(["py-1.5 px-3 rounded-lg transition flex items-center justify-center gap-1.5",l(q)==="editor"?"bg-sky-500 text-white shadow-md font-black":"text-slate-400 hover:text-slate-200"])},[...h[12]||(h[12]=[a("span",null,"⚙️ Studio & Editor",-1)])],2),a("button",{onClick:h[1]||(h[1]=P=>q.value="preview"),class:H(["py-1.5 px-3 rounded-lg transition flex items-center justify-center gap-1.5",l(q)==="preview"?"bg-indigo-600 text-white shadow-md font-black":"text-slate-400 hover:text-slate-200"])},[h[13]||(h[13]=a("span",null,"👁️ Live Preview",-1)),l(z)?(f(),v("span",il)):E("",!0)],2)])]),l(pe)?(f(),v("div",{key:0,class:H(["fixed bottom-6 right-6 z-50 flex items-center gap-3 px-4 py-3 rounded-2xl shadow-2xl text-xs font-bold border transition-all",l(ae)==="success"?"bg-slate-900 text-slate-100 border-sky-500/50 shadow-sky-950/50":"bg-rose-950 text-rose-200 border-rose-500/50"])},[a("div",rl,[l(ae)==="success"?(f(),v("span",ol,"●")):(f(),v("span",ll,"⚠️")),a("span",null,g(l(pe)),1)]),l(me)?(f(),v("button",{key:0,onClick:h[2]||(h[2]=()=>{l(me)?.onClick(),pe.value="",me.value=null}),class:"px-2.5 py-1 bg-sky-500 hover:bg-sky-400 text-white font-extrabold rounded-lg shadow transition text-[11px] flex items-center gap-1 active:scale-95"},g(l(me).label),1)):E("",!0),a("button",{onClick:h[3]||(h[3]=P=>{pe.value="",me.value=null}),class:"text-slate-400 hover:text-white transition ml-1 text-xs"}," ✕ ")],2)):E("",!0),a("main",dl,[a("section",{class:H(["lg:col-span-5 h-full overflow-y-auto pr-1 flex-col gap-3 custom-scrollbar",l(q)==="editor"?"flex":"hidden lg:flex"])},[C(K,{modelValue:l(e),"onUpdate:modelValue":h[4]||(h[4]=P=>Be(e)?e.value=P:null),options:l(t),"onUpdate:options":h[5]||(h[5]=P=>Be(t)?t.value=P:null),"is-valid":l(te).isValid,"validation-error":l(te).error,"is-generating":l(ne),"generate-stage":l(Oe),"is-auto-topic-loading":l(Y),drafts:l(n),"active-draft-index":l(r),history:l($),"active-history-index":l(M),"unsaved-stash":l(o),onGenerate:qe,onAutoTopic:N,onSelectDraft:le,onDeleteDraft:G,onSaveDraft:O,onSelectHistory:V,onDeleteHistory:ge,onClearAllHistory:je,onRestoreStash:c,onClearStash:w,onToast:h[6]||(h[6]=(P,Re)=>X(P,Re))},null,8,["modelValue","options","is-valid","validation-error","is-generating","generate-stage","is-auto-topic-loading","drafts","active-draft-index","history","active-history-index","unsaved-stash"])],2),a("section",{class:H(["lg:col-span-7 h-full flex-col gap-3 overflow-hidden justify-between min-h-0",l(q)==="preview"?"flex":"hidden lg:flex"])},[C(_e,{data:l(e),"selected-video":l(t).backgroundSource,"selected-music":l(t).musicFile,"video-start-offset":l(t).videoStartOffset,"onUpdate:videoStartOffset":h[7]||(h[7]=P=>l(t).videoStartOffset=P),"audio-start-offset":l(t).audioStartOffset,"onUpdate:audioStartOffset":h[8]||(h[8]=P=>l(t).audioStartOffset=P),"generated-result":l(z)},null,8,["data","selected-video","selected-music","video-start-offset","audio-start-offset","generated-result"])],2)]),l(q)==="editor"?(f(),v("button",{key:1,onClick:h[9]||(h[9]=P=>q.value="preview"),class:"lg:hidden fixed bottom-5 left-1/2 -translate-x-1/2 z-40 px-5 py-2.5 rounded-full bg-gradient-to-r from-sky-500 to-indigo-600 text-white font-extrabold text-xs shadow-2xl border border-sky-400/40 flex items-center gap-2 hover:opacity-95"},[...h[14]||(h[14]=[a("span",null,"👁️ Lihat Preview Canvas",-1)])])):E("",!0)])}}});export{pl as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"id":"fe5a0dcc-cf6c-47e8-9979-1ac007f760a2","timestamp":1795311959831,"prerendered":[]}
|