@socialgen_user/socialgen 2.1.0 → 2.1.2
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/{0Br9Vc0s.js → 57MFxFz4.js} +1 -1
- package/.output/public/_nuxt/{BPLr5diI.js → B3JL5g55.js} +1 -1
- package/.output/public/_nuxt/{CElmFakF.js → CYkJs9Gy.js} +1 -1
- package/.output/public/_nuxt/{DQwlrwii.js → CfUuIQFh.js} +1 -1
- package/.output/public/_nuxt/{De9_qv1a.js → D0l_IRiq.js} +1 -1
- package/.output/public/_nuxt/{8VnlkoEA.js → D1xXB6TU.js} +1 -1
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/9d6279d2-3847-446f-8904-5500f3fb69a2.json +1 -0
- package/.output/public/_nuxt/{BUd27fqX.js → gKE2LypS.js} +2 -2
- package/.output/server/chunks/_/nitro.mjs +88 -88
- package/.output/server/chunks/build/client.precomputed.mjs +1 -1
- package/.output/server/chunks/build/{pages-BHQfewv9.mjs → pages-2auDORIM.mjs} +5 -5
- package/.output/server/chunks/build/{pages-BHQfewv9.mjs.map → pages-2auDORIM.mjs.map} +1 -1
- package/.output/server/chunks/build/server.mjs +1 -1
- package/.output/server/chunks/routes/api/status.get.mjs +1 -1
- package/.output/server/package.json +1 -1
- package/bin/cli.js +8 -2
- package/package.json +1 -1
- package/.output/public/_nuxt/builds/meta/fa4e5120-60d5-43d9-b50d-f9369f818427.json +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as Ze,d as Ue,o as Ee,M as wt,A as C,B as I,l as u,C as i,E as R,G as X,D as Z,N as ce,O as U,P as D,Q as Ct,R as St,S as De,T as Se,U as Te,V as Tt,W as He,i as A,X as At,m as ft}from"./BUd27fqX.js";import{_ as $t}from"./DQwlrwii.js";const It=s=>s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var Ae={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 Ot=({size:s,strokeWidth:e=2,absoluteStrokeWidth:t,color:a,iconNode:n,name:r,class:l,...d},{slots:m})=>Ze("svg",{...Ae,width:s||Ae.width,height:s||Ae.height,stroke:a||Ae.stroke,"stroke-width":t?Number(e)*24/Number(s):e,class:["lucide",`lucide-${It(r??"icon")}`],...d},[...n.map(g=>Ze(...g)),...m.default?[m.default()]:[]]);const j=(s,e)=>(t,{slots:a})=>Ze(Ot,{...t,iconNode:e,name:s},a);const Nt=j("BookmarkIcon",[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]]);const Ve=j("CheckIcon",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const Rt=j("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 Mt=j("CircleCheckIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const jt=j("ClockIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const ht=j("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 Zt=j("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 qe=j("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 Et=j("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 Dt=j("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 Vt=j("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 Pt=j("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 Lt=j("PlayIcon",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);const zt=j("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 Ft=j("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 Bt=j("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 Je=j("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 Ut=j("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 We=j("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 Gt=j("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 Ht=j("XIcon",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);const qt=j("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 Jt=j("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"}]]),Wt={class:"flex flex-col gap-3 text-slate-100"},Kt={key:0,class:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm flex items-center justify-center p-4"},Yt={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]"},Qt={class:"flex items-center justify-between pb-3 border-b border-slate-800"},Xt={class:"text-sm font-black text-white flex items-center gap-2"},es={class:"flex items-center gap-2 bg-slate-950 p-2.5 rounded-xl border border-slate-800 text-[11px]"},ts={class:"text-purple-400 font-bold"},ss={class:"relative flex-1 min-h-[220px]"},as=["value"],ns={class:"flex items-center justify-between pt-2 border-t border-slate-800"},rs={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"},is={class:"text-xs font-black text-white flex items-center gap-2"},os={class:"flex items-center gap-1.5"},ls=["disabled"],ds={class:"relative group"},us={class:"absolute right-0 mt-1 hidden group-hover:flex flex-col bg-slate-900 border border-slate-800 rounded-xl shadow-2xl py-2 z-20 w-56 text-xs"},cs={class:"px-3 py-1.5"},ps={key:1,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"},fs={class:"w-6 h-6 rounded-lg bg-sky-500/20 border border-sky-400/40 flex items-center justify-center flex-shrink-0"},hs={class:"text-[11px]"},ms={class:"font-extrabold text-white flex items-center gap-2"},gs={class:"text-[9px] px-1.5 py-0.2 rounded bg-sky-500/30 text-sky-200 border border-sky-400/30"},ys={class:"flex items-center justify-between bg-slate-950 p-1 rounded-xl border border-slate-800 text-xs font-semibold"},xs={class:"flex items-center gap-1"},vs={key:2,class:"flex flex-col gap-1.5 p-2.5 bg-slate-900/90 border border-slate-800 rounded-2xl max-h-[300px] overflow-y-auto"},bs={key:0,class:"text-center py-8 text-slate-500 text-[11px]"},ks=["onClick"],_s={class:"flex-1 pr-2"},ws={class:"flex items-center gap-1.5 mb-0.5"},Cs={class:"text-[9px] text-slate-400 font-semibold"},Ss={class:"font-bold text-[11px] truncate"},Ts=["onClick"],As={key:3,class:"flex flex-col bg-slate-900/90 border border-slate-800 rounded-2xl overflow-hidden shadow-lg"},$s={class:"grid grid-cols-2 gap-2 p-2.5 bg-slate-950/70 border-b border-slate-800 text-xs"},Is={class:"block text-[10px] font-bold text-slate-300 mb-1 flex items-center gap-1"},Os=["value"],Ns=["value"],Rs={class:"col-span-2 grid grid-cols-3 gap-2 pt-1 border-t border-slate-800/60 mt-1"},Ms={class:"col-span-1"},js=["value"],Zs={class:"col-span-2"},Es=["value"],Ds={class:"flex items-center justify-between px-3 py-1.5 bg-slate-950/50 border-b border-slate-800"},Vs={class:"flex items-center gap-2 text-xs"},Ps={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"},Ls={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"},zs={class:"relative p-2"},Fs=["value"],Bs={key:0,class:"text-[10px] text-rose-400 mt-1 px-1"},Us={class:"p-3 bg-slate-900/90 border border-slate-800 rounded-2xl flex flex-col gap-2.5 shadow-lg text-xs"},Gs={class:"flex items-center justify-between gap-2"},Hs={class:"font-bold text-slate-300 flex items-center gap-1.5 text-[11px]"},qs={class:"flex items-center gap-1.5"},Js=["value"],Ws=["value"],Ks=["disabled"],Ys={class:"hidden sm:inline"},Qs={class:"flex items-center justify-between gap-2 pt-1.5 border-t border-slate-800"},Xs={class:"font-bold text-slate-300 flex items-center gap-1.5 text-[11px]"},ea={class:"flex items-center gap-1.5"},ta=["value"],sa=["value"],aa=["disabled"],na={class:"hidden sm:inline"},ra={class:"flex items-center justify-between pt-1.5 border-t border-slate-800"},ia={class:"font-bold text-slate-300 flex items-center gap-1.5 text-[11px]"},oa={class:"flex items-center gap-1.5 flex-wrap justify-end"},la=["onClick"],da={class:"grid grid-cols-3 gap-2 pt-1.5 border-t border-slate-800"},ua=["checked"],ca=["checked"],pa=["checked"],fa=["disabled"],ha=Ue({__name:"DashboardControls",props:{modelValue:{},options:{},isValid:{type:Boolean},validationError:{},isGenerating:{type:Boolean},generateStage:{},isAutoTopicLoading:{type:Boolean},drafts:{},activeDraftIndex:{}},emits:["update:modelValue","update:options","generate","autoTopic","selectDraft","deleteDraft","saveDraft"],setup(s,{emit:e}){const t=s,a=e,n=A(""),r=A(""),l=A(""),d=A("gemini-3.8-flash"),m=A("editor"),g=A(!1),_=A(""),P=A({}),J=A(!1),W=A(!1),F=A(["cyber_blue.mp4","emerald_flow.mp4","default_bg.mp4"]),w=A(["synthwave_pulse.mp3","lofi_chill.mp3","default_ambient.mp3"]),H=A(!1),B=A(null),K=A(null);async function ke(){try{const v=await $fetch("/api/media");v?.videos?.length&&(F.value=v.videos),v?.audio?.length&&(w.value=v.audio)}catch(v){console.error("Failed to fetch media list:",v)}}Ee(()=>{ke()});async function _e(v,o){const p=v.target,se=p.files?.[0];if(se){H.value=!0;try{const le=new FormData;le.append("file",se);const Ce=await $fetch("/api/upload-media",{method:"POST",body:le});Ce?.success&&(await ke(),Ce.type==="video"?we("backgroundSource",Ce.filename):we("musicFile",Ce.filename))}catch(le){alert("Upload gagal: "+(le.data?.statusMessage||le.message))}finally{H.value=!1,p.value=""}}}wt(()=>t.modelValue,v=>{try{const o=JSON.parse(n.value||"{}");JSON.stringify(o)!==JSON.stringify(v)&&(n.value=JSON.stringify(v,null,2))}catch{n.value=JSON.stringify(v,null,2)}},{immediate:!0,deep:!0});function T(v){const o=v.target;n.value=o.value;try{const p=JSON.parse(o.value);r.value="",a("update:modelValue",p)}catch(p){r.value="Invalid JSON: "+p.message}}function N(){try{const v=JSON.parse(n.value);n.value=JSON.stringify(v,null,2),r.value="",a("update:modelValue",v)}catch{r.value="Cannot format invalid JSON"}}function Y(v){const o={...t.modelValue,layoutType:v};a("update:modelValue",o)}function L(v){const o={...t.modelValue,watermark:v};a("update:modelValue",o)}function te(v){const o={...t.modelValue,title:v};a("update:modelValue",o)}function xt(v){const o={...t.modelValue,theme:v};a("update:modelValue",o),a("update:options",{...t.options,theme:v})}function vt(v){const o={...t.modelValue,reelsDuration:v};a("update:modelValue",o)}function we(v,o){a("update:options",{...t.options,[v]:o})}function Me(v,o){const p=t.options.outputs||{feed:!0,story:!0,reels:!0};a("update:options",{...t.options,outputs:{...p,[v]:o}})}const bt=A({audio:[],videos:[]});Ee(async()=>{try{bt.value=await $fetch("/api/media")}catch{}});function z(v,o){a("autoTopic",v,o||l.value||void 0,d.value)}async function kt(){g.value=!0,J.value=!0;try{const v=await $fetch("/api/copy-prompt",{query:{niche:t.modelValue.category?.includes("TECH")?"TECH":"SOCIAL_ECONOMY",layout:t.modelValue.layoutType||"news"}});_.value=v.prompt,P.value={topic:v.topic,pair:v.pair,niche:v.niche,usedCount:v.usedCount}}catch(v){console.error("Failed to get manual prompt:",v)}finally{J.value=!1}}function _t(){_.value&&(navigator.clipboard.writeText(_.value),W.value=!0,setTimeout(()=>{W.value=!1},2500))}return(v,o)=>(C(),I("div",Wt,[u(g)?(C(),I("div",Kt,[i("div",Yt,[i("div",Qt,[i("div",null,[i("h3",Xt,[R(u(qe),{class:"w-4 h-4 text-purple-400"}),o[34]||(o[34]=X(" Master Prompt AI (Dynamic Research & Zero-Collision) ",-1))]),o[35]||(o[35]=i("p",{class:"text-[11px] text-slate-400 mt-0.5"}," Salin prompt ini ke ChatGPT / Gemini / Claude / DeepSeek untuk mencari topik terbaru. ",-1))]),i("button",{onClick:o[0]||(o[0]=p=>g.value=!1),class:"p-1 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800"},[R(u(Ht),{class:"w-4 h-4"})])]),i("div",es,[o[36]||(o[36]=i("span",{class:"font-bold text-sky-400"},"Mode:",-1)),o[37]||(o[37]=i("span",{class:"text-white font-semibold"},"Dynamic Discovery (Trending • Then vs Now • Future Horizon)",-1)),o[38]||(o[38]=i("span",{class:"text-slate-500"},"•",-1)),i("span",ts,Z(u(P).usedCount||0)+" Topik Riwayat Dikecualikan",1)]),i("div",ss,[i("textarea",{value:u(_),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,as)]),i("div",ns,[o[39]||(o[39]=i("span",{class:"text-[11px] text-slate-400"},[X(" Paste hasil JSON dari ChatGPT/Gemini ke kolom "),i("b",null,"RAW JSON"),X(" SocialGen. ")],-1)),i("button",{onClick:_t,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"},[u(W)?(C(),ce(u(Ve),{key:0,class:"w-4 h-4 text-emerald-400"})):(C(),ce(u(ht),{key:1,class:"w-4 h-4"})),i("span",null,Z(u(W)?"Prompt Berhasil Disalin!":"Copy Master Prompt"),1)])])])])):U("",!0),i("div",rs,[i("div",null,[i("h2",is,[R(u(Gt),{class:"w-3.5 h-3.5 text-sky-400"}),o[40]||(o[40]=X(" Content Studio ",-1))]),o[41]||(o[41]=i("p",{class:"text-[10px] text-slate-400"},"Multi-Format Studio",-1))]),i("div",os,[i("button",{onClick:kt,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"},[R(u(qe),{class:"w-3 h-3"}),o[42]||(o[42]=i("span",{class:"hidden sm:inline"},"Prompt Manual",-1))]),i("button",{onClick:o[1]||(o[1]=p=>z()),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"},[R(u(Je),{class:D(["w-3.5 h-3.5",{"animate-spin":s.isAutoTopicLoading}])},null,8,["class"]),i("span",null,Z(s.isAutoTopicLoading?"Meriset Data...":"✨ Auto-Topic"),1)],8,ls),i("div",ds,[o[47]||(o[47]=i("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)),i("div",us,[o[44]||(o[44]=i("div",{class:"px-3 py-1 text-[10px] font-bold text-slate-500 uppercase"},"Model AI Engine",-1)),i("div",cs,[Ct(i("select",{"onUpdate:modelValue":o[2]||(o[2]=p=>De(d)?d.value=p:null),class:"w-full bg-slate-950 border border-slate-700 rounded-lg p-1.5 text-xs text-sky-300 focus:outline-none"},[...o[43]||(o[43]=[i("option",{value:"gemini-3.5-flash"},"⚡ Gemini 3.5 Flash (Aktif)",-1),i("option",{value:"gemini-2.5-pro"},"💎 Gemini 2.5 Pro (Billing)",-1),i("option",{value:"gemini-3.8-flash"},"⚡ Gemini 3.8 Flash",-1),i("option",{value:"gemini-1.5-pro"},"💎 Gemini 1.5 Pro",-1)])],512),[[St,u(d)]])]),o[45]||(o[45]=i("div",{class:"border-t border-slate-800 my-1"},null,-1)),o[46]||(o[46]=i("div",{class:"px-3 py-1 text-[10px] font-bold text-slate-500 uppercase"},"Pilih Format Khusus",-1)),i("button",{onClick:o[3]||(o[3]=p=>z(void 0,"table")),class:"px-3 py-1.5 text-left text-sky-300 hover:bg-slate-800"}," 📊 Classic Comparison Table "),i("button",{onClick:o[4]||(o[4]=p=>z(void 0,"versus")),class:"px-3 py-1.5 text-left text-orange-300 hover:bg-slate-800"}," ⚔️ Versus Showdown Arena "),i("button",{onClick:o[5]||(o[5]=p=>z(void 0,"receipt")),class:"px-3 py-1.5 text-left text-teal-300 hover:bg-slate-800"}," 🧾 Monthly Living Invoice "),i("button",{onClick:o[6]||(o[6]=p=>z(void 0,"news")),class:"px-3 py-1.5 text-left text-rose-300 hover:bg-slate-800"}," 📰 Breaking News / Pamphlet "),i("button",{onClick:o[7]||(o[7]=p=>z(void 0,"stat")),class:"px-3 py-1.5 text-left text-amber-300 hover:bg-slate-800"}," 🎯 Big Shocking Number "),i("button",{onClick:o[8]||(o[8]=p=>z(void 0,"timeline")),class:"px-3 py-1.5 text-left text-yellow-300 hover:bg-slate-800"}," ⏳ 10-Year Shift (Then vs Now) "),i("button",{onClick:o[9]||(o[9]=p=>z(void 0,"barchart")),class:"px-3 py-1.5 text-left text-cyan-300 hover:bg-slate-800"}," 📈 Income Allocation Bars "),i("button",{onClick:o[10]||(o[10]=p=>z(void 0,"list")),class:"px-3 py-1.5 text-left text-emerald-300 hover:bg-slate-800"}," 🏆 Top 5 Ranked Countdown "),i("button",{onClick:o[11]||(o[11]=p=>z(void 0,"quote")),class:"px-3 py-1.5 text-left text-purple-300 hover:bg-slate-800"}," 💬 Hot Take / Quote Debate "),i("button",{onClick:o[12]||(o[12]=p=>z(void 0,"leaderboard")),class:"px-3 py-1.5 text-left text-yellow-400 hover:bg-slate-800 font-bold"}," 🥇 Multi-Country Leaderboard (Top 10) "),i("button",{onClick:o[13]||(o[13]=p=>z(void 0,"editorial")),class:"px-3 py-1.5 text-left text-sky-400 hover:bg-slate-800 font-bold"}," 📰 Editorial Storytelling Deep Dive "),i("button",{onClick:o[14]||(o[14]=p=>z(void 0,"matrix")),class:"px-3 py-1.5 text-left text-teal-300 hover:bg-slate-800 font-bold"}," 📊 Multi-Column Matrix (3-4 Negara) "),i("button",{onClick:o[15]||(o[15]=p=>z(void 0,"debate")),class:"px-3 py-1.5 text-left text-rose-400 hover:bg-slate-800 font-bold"}," ⚡ Debate Arena (Pro vs Kontra) "),i("button",{onClick:o[16]||(o[16]=p=>z(void 0,"tierlist")),class:"px-3 py-1.5 text-left text-amber-300 hover:bg-slate-800 font-bold"}," 🎖️ Tier List Ranking (S, A, B, C) ")])])])]),s.isAutoTopicLoading?(C(),I("div",ps,[i("div",fs,[R(u(Je),{class:"w-3.5 h-3.5 text-sky-400 animate-spin"})]),i("div",hs,[i("div",ms,[o[48]||(o[48]=i("span",null,"AI Research Engine Sedang Bekerja...",-1)),i("span",gs,Z(u(d)),1)]),o[49]||(o[49]=i("p",{class:"text-[10px] text-slate-300 mt-0.5"},"Menganalisis angka perbandingan 2026 & meracik copywriting viral.",-1))])])):U("",!0),i("div",ys,[i("div",xs,[i("button",{onClick:o[17]||(o[17]=p=>m.value="editor"),class:D(["px-3 py-1 rounded-lg transition text-[11px]",u(m)==="editor"?"bg-slate-800 text-sky-400 shadow":"text-slate-400 hover:text-white"])}," JSON Editor ",2),i("button",{onClick:o[18]||(o[18]=p=>m.value="drafts"),class:D(["px-3 py-1 rounded-lg transition flex items-center gap-1.5 text-[11px]",u(m)==="drafts"?"bg-slate-800 text-purple-400 shadow":"text-slate-400 hover:text-white"])},[R(u(Nt),{class:"w-3 h-3"}),i("span",null,"Drafts Deck ("+Z(s.drafts.length)+")",1)],2)]),i("button",{onClick:o[19]||(o[19]=p=>a("saveDraft")),class:"text-[10px] text-slate-400 hover:text-sky-400 transition pr-2 font-bold"}," + Save to Drafts ")]),u(m)==="drafts"?(C(),I("div",vs,[s.drafts.length===0?(C(),I("div",bs,' Belum ada draft tersimpan. Klik "Auto-Topic" untuk mengumpulkan berbagai ide! ')):U("",!0),(C(!0),I(Se,null,Te(s.drafts,(p,se)=>(C(),I("div",{key:se,onClick:le=>a("selectDraft",se),class:D(["p-2 rounded-xl border cursor-pointer transition flex items-center justify-between text-xs group",s.activeDraftIndex===se?"bg-sky-500/15 border-sky-500/50 text-white":"bg-slate-950/60 border-slate-800 text-slate-300 hover:border-slate-700"])},[i("div",_s,[i("div",ws,[i("span",{class:D(["px-1.5 py-0.2 rounded text-[8px] font-bold uppercase",p.layoutType==="news"?"bg-rose-500/20 text-rose-300 border border-rose-500/30":p.layoutType==="versus"?"bg-orange-500/20 text-orange-300 border border-orange-500/30":p.layoutType==="receipt"?"bg-teal-500/20 text-teal-300 border border-teal-500/30":p.layoutType==="stat"?"bg-amber-500/20 text-amber-300 border border-amber-500/30":p.layoutType==="timeline"?"bg-yellow-500/20 text-yellow-300 border border-yellow-500/30":p.layoutType==="barchart"?"bg-cyan-500/20 text-cyan-300 border border-cyan-500/30":p.layoutType==="list"?"bg-emerald-500/20 text-emerald-300 border border-emerald-500/30":p.layoutType==="quote"?"bg-purple-500/20 text-purple-300 border border-purple-500/30":"bg-sky-500/20 text-sky-300 border border-sky-500/30"])},Z(p.layoutType||"table"),3),i("span",Cs,Z(p.category),1)]),i("div",Ss,Z(p.title),1)]),i("button",{onClick:Tt(le=>a("deleteDraft",se),["stop"]),class:"opacity-0 group-hover:opacity-100 p-1 text-slate-400 hover:text-rose-400 transition rounded"},[R(u(Ut),{class:"w-3 h-3"})],8,Ts)],10,ks))),128))])):(C(),I("div",As,[i("div",$s,[i("div",null,[i("label",Is,[R(u(Vt),{class:"w-3 h-3 text-sky-400"}),o[50]||(o[50]=X(" Format Template ",-1))]),i("select",{value:s.modelValue.layoutType||"table",onChange:o[20]||(o[20]=p=>Y(p.target.value)),class:"w-full bg-slate-900 border border-slate-800 rounded-lg p-1.5 text-slate-200 focus:outline-none focus:border-sky-500 font-semibold text-[11px]"},[...o[51]||(o[51]=[He('<option value="table">📊 Comparison Table</option><option value="versus">⚔️ Versus Showdown Arena</option><option value="receipt">🧾 Monthly Living Invoice</option><option value="news">📰 Special Report Pamphlet</option><option value="stat">🎯 Big Shocking Number</option><option value="timeline">⏳ 10-Year Shift (Then vs Now)</option><option value="barchart">📈 Income Allocation Bars</option><option value="list">🏆 Top 5 Ranked List</option><option value="quote">💬 Hot Take / Quote Debate</option><option value="leaderboard">🥇 Multi-Country Leaderboard (Top 10)</option><option value="editorial">📰 Editorial Storytelling Deep Dive</option><option value="matrix">📊 Multi-Column Matrix (3-4 Negara)</option><option value="debate">⚡ Debate Arena (Pro vs Kontra)</option><option value="tierlist">🎖️ Tier List Ranking (S, A, B, C)</option>',14)])],40,Os)]),i("div",null,[o[53]||(o[53]=i("label",{class:"block text-[10px] font-bold text-slate-300 mb-1"}," Theme Color ",-1)),i("select",{value:s.modelValue.theme||"blue-tech",onChange:o[21]||(o[21]=p=>xt(p.target.value)),class:"w-full bg-slate-900 border border-slate-800 rounded-lg p-1.5 text-slate-200 focus:outline-none focus:border-sky-500 font-semibold text-[11px]"},[...o[52]||(o[52]=[He('<option value="blue-tech">🔵 Blue Tech (Software / AI)</option><option value="emerald-finance">🟢 Emerald Finance (Salaries / Living)</option><option value="slate-education">🟣 Slate Education (Schools / Public)</option><option value="dark-contrast">⚫ Dark Contrast (Universal / Bold)</option><option value="crimson-alert">🔴 Crimson Alert (Breaking / Shock)</option>',5)])],40,Ns)]),i("div",Rs,[i("div",Ms,[o[54]||(o[54]=i("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"}," Watermark Handle ",-1)),i("input",{type:"text",value:s.modelValue.watermark||"@SocialGen",onInput:o[22]||(o[22]=p=>L(p.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,js)]),i("div",Zs,[o[55]||(o[55]=i("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"}," Judul Konten (Title) ",-1)),i("input",{type:"text",value:s.modelValue.title,onInput:o[23]||(o[23]=p=>te(p.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,Es)])])]),i("div",Ds,[i("div",Vs,[o[58]||(o[58]=i("span",{class:"font-bold text-slate-300 text-[10px]"},"RAW JSON",-1)),s.isValid&&!u(r)?(C(),I("span",Ps,[R(u(Mt),{class:"w-2.5 h-2.5"}),o[56]||(o[56]=X(" Valid ",-1))])):(C(),I("span",Ls,[R(u(Rt),{class:"w-2.5 h-2.5"}),o[57]||(o[57]=X(" Invalid ",-1))]))]),i("button",{onClick:N,class:"text-[10px] text-slate-400 hover:text-sky-400 transition"}," Format JSON ")]),i("div",zs,[i("textarea",{value:u(n),onInput:T,rows:"7",spellcheck:"false",class:"w-full bg-slate-950 text-sky-200 text-[11px] font-mono p-2.5 rounded-xl border border-slate-800 focus:outline-none focus:border-sky-500/50 resize-y leading-relaxed",placeholder:"Paste Content JSON here..."},null,40,Fs),u(r)||s.validationError?(C(),I("p",Bs," ⚠️ "+Z(u(r)||s.validationError),1)):U("",!0)])])),i("input",{type:"file",ref_key:"videoInputRef",ref:B,accept:"video/mp4,video/webm",class:"hidden",onChange:o[24]||(o[24]=p=>_e(p))},null,544),i("input",{type:"file",ref_key:"audioInputRef",ref:K,accept:"audio/mp3,audio/mpeg,audio/wav",class:"hidden",onChange:o[25]||(o[25]=p=>_e(p))},null,544),i("div",Us,[i("div",Gs,[i("label",Hs,[R(u(Et),{class:"w-3.5 h-3.5 text-sky-400"}),o[59]||(o[59]=i("span",null,"Background",-1))]),i("div",qs,[i("select",{value:s.options.backgroundSource||"random",onChange:o[26]||(o[26]=p=>we("backgroundSource",p.target.value)),class:"bg-slate-950 border border-slate-800 rounded-lg px-2 py-1 text-slate-300 text-[11px] focus:outline-none max-w-[170px]"},[o[60]||(o[60]=i("option",{value:"random"},"🔀 Acak Video",-1)),(C(!0),I(Se,null,Te(u(F),p=>(C(),I("option",{key:p,value:p},Z(p.replace(".mp4","").replace(/_/g," ")),9,Ws))),128)),o[61]||(o[61]=i("option",{value:"pexels"},"🌐 Pexels API (Auto HD)",-1))],40,Js),i("button",{onClick:o[27]||(o[27]=p=>u(B)?.click()),disabled:u(H),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"},[R(u(We),{class:"w-3 h-3"}),i("span",Ys,Z(u(H)?"...":"Upload"),1)],8,Ks)])]),i("div",Qs,[i("label",Xs,[R(u(Pt),{class:"w-3.5 h-3.5 text-purple-400"}),o[62]||(o[62]=i("span",null,"Musik Reels",-1))]),i("div",ea,[i("select",{value:s.options.musicFile||"random",onChange:o[28]||(o[28]=p=>we("musicFile",p.target.value)),class:"bg-slate-950 border border-slate-800 rounded-lg px-2 py-1 text-slate-300 text-[11px] focus:outline-none max-w-[170px]"},[o[63]||(o[63]=i("option",{value:"random"},"🔀 Acak Musik",-1)),(C(!0),I(Se,null,Te(u(w),p=>(C(),I("option",{key:p,value:p},Z(p.replace(".mp3","").replace(/_/g," ")),9,sa))),128))],40,ta),i("button",{onClick:o[29]||(o[29]=p=>u(K)?.click()),disabled:u(H),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"},[R(u(We),{class:"w-3 h-3"}),i("span",na,Z(u(H)?"...":"Upload"),1)],8,aa)])]),i("div",ra,[i("label",ia,[R(u(jt),{class:"w-3.5 h-3.5 text-emerald-400"}),o[64]||(o[64]=i("span",null,"Durasi Reels:",-1))]),i("div",oa,[(C(),I(Se,null,Te([7,10,15,30,60],p=>i("button",{key:p,onClick:se=>vt(p),class:D(["px-2 py-0.5 text-[10px] font-bold rounded-lg border transition",(s.modelValue.reelsDuration||10)===p?"bg-emerald-500/20 border-emerald-500/60 text-emerald-300":"bg-slate-950 border-slate-800 text-slate-400 hover:text-white"])},Z(p===60?"1m":p+"s"),11,la)),64))])]),i("div",da,[i("label",{class:D(["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"])},[i("input",{type:"checkbox",checked:s.options.outputs?.feed!==!1,onChange:o[30]||(o[30]=p=>Me("feed",p.target.checked)),class:"rounded text-sky-500 focus:ring-0 bg-slate-900 border-slate-700 w-3 h-3"},null,40,ua),o[65]||(o[65]=i("span",{class:"font-bold"},"Feed 4:5",-1))],2),i("label",{class:D(["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"])},[i("input",{type:"checkbox",checked:s.options.outputs?.story!==!1,onChange:o[31]||(o[31]=p=>Me("story",p.target.checked)),class:"rounded text-indigo-500 focus:ring-0 bg-slate-900 border-slate-700 w-3 h-3"},null,40,ca),o[66]||(o[66]=i("span",{class:"font-bold"},"Story 9:16",-1))],2),i("label",{class:D(["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"])},[i("input",{type:"checkbox",checked:s.options.outputs?.reels!==!1,onChange:o[32]||(o[32]=p=>Me("reels",p.target.checked)),class:"rounded text-emerald-500 focus:ring-0 bg-slate-900 border-slate-700 w-3 h-3"},null,40,pa),o[67]||(o[67]=i("span",{class:"font-bold"},"Reels MP4",-1))],2)])]),i("button",{onClick:o[33]||(o[33]=p=>a("generate")),disabled:!s.isValid||s.isGenerating||!!u(r),class:D(["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||u(r)?"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?(C(),ce(u(zt),{key:0,class:"w-3.5 h-3.5 animate-spin"})):(C(),ce(u(Lt),{key:1,class:"w-3.5 h-3.5 fill-current"})),i("span",null,Z(s.isGenerating?s.generateStage||"Rendering Content...":"GENERATE CONTENT"),1)],10,fa)]))}}),ma={class:"flex flex-col gap-3 h-full text-slate-100 min-h-0 justify-between"},ga={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"},ya={class:"flex items-center gap-1 bg-slate-950 p-1 rounded-xl border border-slate-800 text-xs font-bold"},xa={class:"flex items-center gap-2 text-xs"},va={class:"flex items-center gap-1 bg-slate-950 p-1 rounded-xl border border-slate-800 text-xs shadow-inner"},ba={key:0,class:"relative shadow-2xl rounded-2xl overflow-hidden border border-slate-700/80 flex-shrink-0",style:{width:"360px",height:"450px"}},ka={style:{width:"1080px",height:"1350px",transform:"scale(0.333333)","transform-origin":"top left"}},_a={key:1,class:"relative shadow-2xl rounded-2xl overflow-hidden border border-slate-700/80 flex-shrink-0",style:{width:"300px",height:"533.33px"}},wa={key:0,class:"absolute inset-0 z-0 bg-slate-950 overflow-hidden"},Ca=["src"],Sa={class:"relative z-10",style:{width:"1080px",height:"1920px",transform:"scale(0.277778)","transform-origin":"top left"}},Ta={key:1,class:"absolute inset-0 z-20 pointer-events-none flex flex-col justify-between"},Aa={class:"flex-1 flex justify-end p-2"},$a={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"},Ia={class:"flex flex-col bg-slate-900/90 border border-slate-800 rounded-2xl p-3 gap-1.5 shadow-lg flex-shrink-0"},Oa={class:"flex items-center justify-between text-xs"},Na=["value"],Ra={key:0,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"},Ma={class:"flex items-center gap-2 text-xs font-black text-emerald-300"},ja={class:"text-[11px] text-slate-400 font-mono mt-0.5"},Za={class:"flex items-center gap-2"},Ea=["href"],Da=["disabled"],Va=Ue({__name:"LivePreview",props:{data:{},selectedVideo:{},generatedResult:{}},setup(s){const e=s,t=ft(()=>e.selectedVideo&&e.selectedVideo!=="pexels"?`/videos/${e.selectedVideo}`:"/videos/default_bg.mp4"),a=A("feed"),n=A(!1),r=A(!1),l=A(!1),d=A(1);function m(){d.value<2.5&&(d.value=Math.min(2.5,+(d.value+.15).toFixed(2)))}function g(){d.value>.5&&(d.value=Math.max(.5,+(d.value-.15).toFixed(2)))}function _(){d.value=1}function P(F){(F.ctrlKey||F.metaKey)&&(F.preventDefault(),F.deltaY<0?m():g())}function J(){e.data.caption&&(navigator.clipboard.writeText(e.data.caption),r.value=!0,setTimeout(()=>{r.value=!1},2e3))}async function W(){if(e.generatedResult){l.value=!0;try{await $fetch("/api/open-folder",{method:"POST",body:{jobId:e.generatedResult.jobId,resultDir:e.generatedResult.resultDir}})}catch(F){console.error("Failed to open folder:",F)}finally{l.value=!1}}}return(F,w)=>{const H=$t;return C(),I("div",ma,[i("div",ga,[i("div",ya,[i("button",{onClick:w[0]||(w[0]=B=>a.value="feed"),class:D(["px-3 py-1.5 rounded-lg transition",u(a)==="feed"?"bg-sky-500 text-white shadow-md":"text-slate-400 hover:text-white"])}," Feed 4:5 ",2),i("button",{onClick:w[1]||(w[1]=B=>a.value="story"),class:D(["px-3 py-1.5 rounded-lg transition",u(a)==="story"?"bg-indigo-500 text-white shadow-md":"text-slate-400 hover:text-white"])}," Story 9:16 ",2),i("button",{onClick:w[2]||(w[2]=B=>a.value="reels"),class:D(["px-3 py-1.5 rounded-lg transition",u(a)==="reels"?"bg-emerald-500 text-white shadow-md":"text-slate-400 hover:text-white"])}," Reels 9:16 (Video) ",2)]),i("div",xa,[i("div",va,[i("button",{onClick:g,title:"Zoom Out (-15%)",class:"p-1.5 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800 transition"},[R(u(Jt),{class:"w-3.5 h-3.5"})]),i("button",{onClick:_,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"},Z(Math.round(u(d)*100))+"% ",1),i("button",{onClick:m,title:"Zoom In (+15%)",class:"p-1.5 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800 transition"},[R(u(qt),{class:"w-3.5 h-3.5"})]),u(d)!==1?(C(),I("button",{key:0,onClick:_,title:"Reset ke Ukuran Pas",class:"p-1.5 rounded-lg text-amber-400 hover:bg-slate-800 transition"},[R(u(Ft),{class:"w-3.5 h-3.5"})])):U("",!0)]),u(a)!=="feed"?(C(),I("button",{key:0,onClick:w[3]||(w[3]=B=>n.value=!u(n)),class:D(["inline-flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border text-xs font-bold transition",u(n)?"bg-amber-500/20 text-amber-300 border-amber-500/50":"bg-slate-950 text-slate-400 border-slate-800"])},[R(u(Bt),{class:"w-3.5 h-3.5"}),w[5]||(w[5]=i("span",null,"Safe Zones",-1))],2)):U("",!0)])]),i("div",{onWheel:P,class:"relative flex-1 min-h-0 bg-slate-950/80 border border-slate-800/80 rounded-2xl flex items-center justify-center p-4 overflow-auto shadow-inner custom-scrollbar"},[i("div",{class:"transition-transform duration-200 ease-out origin-center flex-shrink-0",style:At({transform:`scale(${u(d)})`})},[u(a)==="feed"?(C(),I("div",ba,[i("div",ka,[R(H,{data:s.data,mode:"feed","is-render":!0},null,8,["data"])])])):(C(),I("div",_a,[u(a)==="reels"?(C(),I("div",wa,[(C(),I("video",{key:u(t),autoplay:"",loop:"",muted:"",playsinline:"",class:"w-full h-full object-cover brightness-90 contrast-105",src:u(t)},null,8,Ca)),w[6]||(w[6]=i("div",{class:"absolute inset-0 bg-slate-950/30 backdrop-blur-[0.5px]"},null,-1))])):U("",!0),i("div",Sa,[R(H,{data:s.data,mode:u(a)==="reels"?"overlay":"story","is-render":!0},null,8,["data","mode"])]),u(n)?(C(),I("div",Ta,[w[8]||(w[8]=i("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)),i("div",Aa,[u(a)==="reels"?(C(),I("div",$a,[...w[7]||(w[7]=[i("span",null,"❤️ Like",-1),i("span",null,"💬 Comm",-1),i("span",null,"↗️ Share",-1)])])):U("",!0)]),w[9]||(w[9]=i("div",{class:"h-20 bg-red-500/20 border-t border-dashed border-red-500/60 flex items-center justify-center text-[9px] text-red-200 font-bold tracking-wider"}," BOTTOM SAFE ZONE (Caption & Audio) ",-1))])):U("",!0)]))],4)],32),i("div",Ia,[i("div",Oa,[w[10]||(w[10]=i("span",{class:"font-extrabold text-slate-300 text-[11px]"},"VIRAL CAPTION & HASHTAGS",-1)),i("button",{onClick:J,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"},[u(r)?(C(),ce(u(Ve),{key:0,class:"w-3.5 h-3.5 text-emerald-400"})):(C(),ce(u(ht),{key:1,class:"w-3.5 h-3.5"})),i("span",null,Z(u(r)?"Tersalin!":"Copy Caption"),1)])]),i("textarea",{value:s.data.caption,onInput:w[4]||(w[4]=B=>s.data.caption=B.target.value),rows:"2",class:"w-full bg-slate-950 text-slate-200 text-xs p-2.5 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,Na)]),s.generatedResult?(C(),I("div",Ra,[i("div",null,[i("div",Ma,[R(u(Ve),{class:"w-4 h-4 text-emerald-400"}),X(" Render Selesai ("+Z((s.generatedResult.durationMs/1e3).toFixed(1))+"s) ",1)]),i("div",ja,Z(s.generatedResult.jobId),1)]),i("div",Za,[i("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"},[R(u(Zt),{class:"w-3.5 h-3.5"}),w[11]||(w[11]=i("span",null,"Download ZIP",-1))],8,Ea),i("button",{onClick:W,disabled:u(l),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"},[R(u(Dt),{class:"w-3.5 h-3.5 text-amber-400"}),w[12]||(w[12]=i("span",null,"Open Folder",-1))],8,Da)])])):U("",!0)])}}});var O;(function(s){s.assertEqual=n=>{};function e(n){}s.assertIs=e;function t(n){throw new Error}s.assertNever=t,s.arrayToEnum=n=>{const r={};for(const l of n)r[l]=l;return r},s.getValidEnumValues=n=>{const r=s.objectKeys(n).filter(d=>typeof n[n[d]]!="number"),l={};for(const d of r)l[d]=n[d];return s.objectValues(l)},s.objectValues=n=>s.objectKeys(n).map(function(r){return n[r]}),s.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const r=[];for(const l in n)Object.prototype.hasOwnProperty.call(n,l)&&r.push(l);return r},s.find=(n,r)=>{for(const l of n)if(r(l))return l},s.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function a(n,r=" | "){return n.map(l=>typeof l=="string"?`'${l}'`:l).join(r)}s.joinValues=a,s.jsonStringifyReplacer=(n,r)=>typeof r=="bigint"?r.toString():r})(O||(O={}));var Ke;(function(s){s.mergeShapes=(e,t)=>({...e,...t})})(Ke||(Ke={}));const y=O.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ae=s=>{switch(typeof s){case"undefined":return y.undefined;case"string":return y.string;case"number":return Number.isNaN(s)?y.nan:y.number;case"boolean":return y.boolean;case"function":return y.function;case"bigint":return y.bigint;case"symbol":return y.symbol;case"object":return Array.isArray(s)?y.array:s===null?y.null:s.then&&typeof s.then=="function"&&s.catch&&typeof s.catch=="function"?y.promise:typeof Map<"u"&&s instanceof Map?y.map:typeof Set<"u"&&s instanceof Set?y.set:typeof Date<"u"&&s instanceof Date?y.date:y.object;default:return y.unknown}},c=O.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 ee extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(r){return r.message},a={_errors:[]},n=r=>{for(const l of r.issues)if(l.code==="invalid_union")l.unionErrors.map(n);else if(l.code==="invalid_return_type")n(l.returnTypeError);else if(l.code==="invalid_arguments")n(l.argumentsError);else if(l.path.length===0)a._errors.push(t(l));else{let d=a,m=0;for(;m<l.path.length;){const g=l.path[m];m===l.path.length-1?(d[g]=d[g]||{_errors:[]},d[g]._errors.push(t(l))):d[g]=d[g]||{_errors:[]},d=d[g],m++}}};return n(this),a}static assert(e){if(!(e instanceof ee))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,O.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},a=[];for(const n of this.issues)if(n.path.length>0){const r=n.path[0];t[r]=t[r]||[],t[r].push(e(n))}else a.push(e(n));return{formErrors:a,fieldErrors:t}}get formErrors(){return this.flatten()}}ee.create=s=>new ee(s);const Pe=(s,e)=>{let t;switch(s.code){case c.invalid_type:s.received===y.undefined?t="Required":t=`Expected ${s.expected}, received ${s.received}`;break;case c.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(s.expected,O.jsonStringifyReplacer)}`;break;case c.unrecognized_keys:t=`Unrecognized key(s) in object: ${O.joinValues(s.keys,", ")}`;break;case c.invalid_union:t="Invalid input";break;case c.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${O.joinValues(s.options)}`;break;case c.invalid_enum_value:t=`Invalid enum value. Expected ${O.joinValues(s.options)}, received '${s.received}'`;break;case c.invalid_arguments:t="Invalid function arguments";break;case c.invalid_return_type:t="Invalid function return type";break;case c.invalid_date:t="Invalid date";break;case c.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}"`:O.assertNever(s.validation):s.validation!=="regex"?t=`Invalid ${s.validation}`:t="Invalid";break;case c.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 c.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 c.custom:t="Invalid input";break;case c.invalid_intersection_types:t="Intersection results could not be merged";break;case c.not_multiple_of:t=`Number must be a multiple of ${s.multipleOf}`;break;case c.not_finite:t="Number must be finite";break;default:t=e.defaultError,O.assertNever(s)}return{message:t}};let Pa=Pe;function La(){return Pa}const za=s=>{const{data:e,path:t,errorMaps:a,issueData:n}=s,r=[...t,...n.path||[]],l={...n,path:r};if(n.message!==void 0)return{...n,path:r,message:n.message};let d="";const m=a.filter(g=>!!g).slice().reverse();for(const g of m)d=g(l,{data:e,defaultError:d}).message;return{...n,path:r,message:d}};function h(s,e){const t=La(),a=za({issueData:e,data:s.data,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,t,t===Pe?void 0:Pe].filter(n=>!!n)});s.common.issues.push(a)}class G{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const a=[];for(const n of t){if(n.status==="aborted")return b;n.status==="dirty"&&e.dirty(),a.push(n.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,t){const a=[];for(const n of t){const r=await n.key,l=await n.value;a.push({key:r,value:l})}return G.mergeObjectSync(e,a)}static mergeObjectSync(e,t){const a={};for(const n of t){const{key:r,value:l}=n;if(r.status==="aborted"||l.status==="aborted")return b;r.status==="dirty"&&e.dirty(),l.status==="dirty"&&e.dirty(),r.value!=="__proto__"&&(typeof l.value<"u"||n.alwaysSet)&&(a[r.value]=l.value)}return{status:e.value,value:a}}}const b=Object.freeze({status:"aborted"}),xe=s=>({status:"dirty",value:s}),q=s=>({status:"valid",value:s}),Ye=s=>s.status==="aborted",Qe=s=>s.status==="dirty",pe=s=>s.status==="valid",$e=s=>typeof Promise<"u"&&s instanceof Promise;var x;(function(s){s.errToObj=e=>typeof e=="string"?{message:e}:e||{},s.toString=e=>typeof e=="string"?e:e?.message})(x||(x={}));class ie{constructor(e,t,a,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=a,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Xe=(s,e)=>{if(pe(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 ee(s.common.issues);return this._error=t,this._error}}};function S(s){if(!s)return{};const{errorMap:e,invalid_type_error:t,required_error:a,description:n}=s;if(e&&(t||a))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(l,d)=>{const{message:m}=s;return l.code==="invalid_enum_value"?{message:m??d.defaultError}:typeof d.data>"u"?{message:m??a??d.defaultError}:l.code!=="invalid_type"?{message:d.defaultError}:{message:m??t??d.defaultError}},description:n}}class ${get description(){return this._def.description}_getType(e){return ae(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:ae(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new G,ctx:{common:e.parent.common,data:e.data,parsedType:ae(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if($e(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 a=this.safeParse(e,t);if(a.success)return a.data;throw a.error}safeParse(e,t){const a={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ae(e)},n=this._parseSync({data:e,path:a.path,parent:a});return Xe(a,n)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ae(e)};if(!this["~standard"].async)try{const a=this._parseSync({data:e,path:[],parent:t});return pe(a)?{value:a.value}:{issues:t.common.issues}}catch(a){a?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(a=>pe(a)?{value:a.value}:{issues:t.common.issues})}async parseAsync(e,t){const a=await this.safeParseAsync(e,t);if(a.success)return a.data;throw a.error}async safeParseAsync(e,t){const a={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ae(e)},n=this._parse({data:e,path:a.path,parent:a}),r=await($e(n)?n:Promise.resolve(n));return Xe(a,r)}refine(e,t){const a=n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t;return this._refinement((n,r)=>{const l=e(n),d=()=>r.addIssue({code:c.custom,...a(n)});return typeof Promise<"u"&&l instanceof Promise?l.then(m=>m?!0:(d(),!1)):l?!0:(d(),!1)})}refinement(e,t){return this._refinement((a,n)=>e(a)?!0:(n.addIssue(typeof t=="function"?t(a,n):t),!1))}_refinement(e){return new me({schema:this,typeName:k.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 re.create(this,this._def)}nullable(){return ge.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Q.create(this)}promise(){return Re.create(this,this._def)}or(e){return Oe.create([this,e],this._def)}and(e){return Ne.create(this,e,this._def)}transform(e){return new me({...S(this._def),schema:this,typeName:k.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new ze({...S(this._def),innerType:this,defaultValue:t,typeName:k.ZodDefault})}brand(){return new cn({typeName:k.ZodBranded,type:this,...S(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new Fe({...S(this._def),innerType:this,catchValue:t,typeName:k.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Ge.create(this,e)}readonly(){return Be.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Fa=/^c[^\s-]{8,}$/i,Ba=/^[0-9a-z]+$/,Ua=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Ga=/^[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,Ha=/^[a-z0-9_-]{21}$/i,qa=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Ja=/^[-+]?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)?)??$/,Wa=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Ka="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let je;const Ya=/^(?:(?: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])$/,Qa=/^(?:(?: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])$/,Xa=/^(([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]))$/,en=/^(([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])$/,tn=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,sn=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,mt="((\\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])))",an=new RegExp(`^${mt}$`);function gt(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 nn(s){return new RegExp(`^${gt(s)}$`)}function rn(s){let e=`${mt}T${gt(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 on(s,e){return!!((e==="v4"||!e)&&Ya.test(s)||(e==="v6"||!e)&&Xa.test(s))}function ln(s,e){if(!qa.test(s))return!1;try{const[t]=s.split(".");if(!t)return!1;const a=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),n=JSON.parse(atob(a));return!(typeof n!="object"||n===null||"typ"in n&&n?.typ!=="JWT"||!n.alg||e&&n.alg!==e)}catch{return!1}}function dn(s,e){return!!((e==="v4"||!e)&&Qa.test(s)||(e==="v6"||!e)&&en.test(s))}class ne extends ${_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==y.string){const r=this._getOrReturnCtx(e);return h(r,{code:c.invalid_type,expected:y.string,received:r.parsedType}),b}const a=new G;let n;for(const r of this._def.checks)if(r.kind==="min")e.data.length<r.value&&(n=this._getOrReturnCtx(e,n),h(n,{code:c.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),a.dirty());else if(r.kind==="max")e.data.length>r.value&&(n=this._getOrReturnCtx(e,n),h(n,{code:c.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),a.dirty());else if(r.kind==="length"){const l=e.data.length>r.value,d=e.data.length<r.value;(l||d)&&(n=this._getOrReturnCtx(e,n),l?h(n,{code:c.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}):d&&h(n,{code:c.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}),a.dirty())}else if(r.kind==="email")Wa.test(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{validation:"email",code:c.invalid_string,message:r.message}),a.dirty());else if(r.kind==="emoji")je||(je=new RegExp(Ka,"u")),je.test(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{validation:"emoji",code:c.invalid_string,message:r.message}),a.dirty());else if(r.kind==="uuid")Ga.test(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{validation:"uuid",code:c.invalid_string,message:r.message}),a.dirty());else if(r.kind==="nanoid")Ha.test(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{validation:"nanoid",code:c.invalid_string,message:r.message}),a.dirty());else if(r.kind==="cuid")Fa.test(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{validation:"cuid",code:c.invalid_string,message:r.message}),a.dirty());else if(r.kind==="cuid2")Ba.test(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{validation:"cuid2",code:c.invalid_string,message:r.message}),a.dirty());else if(r.kind==="ulid")Ua.test(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{validation:"ulid",code:c.invalid_string,message:r.message}),a.dirty());else if(r.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),h(n,{validation:"url",code:c.invalid_string,message:r.message}),a.dirty()}else r.kind==="regex"?(r.regex.lastIndex=0,r.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{validation:"regex",code:c.invalid_string,message:r.message}),a.dirty())):r.kind==="trim"?e.data=e.data.trim():r.kind==="includes"?e.data.includes(r.value,r.position)||(n=this._getOrReturnCtx(e,n),h(n,{code:c.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),a.dirty()):r.kind==="toLowerCase"?e.data=e.data.toLowerCase():r.kind==="toUpperCase"?e.data=e.data.toUpperCase():r.kind==="startsWith"?e.data.startsWith(r.value)||(n=this._getOrReturnCtx(e,n),h(n,{code:c.invalid_string,validation:{startsWith:r.value},message:r.message}),a.dirty()):r.kind==="endsWith"?e.data.endsWith(r.value)||(n=this._getOrReturnCtx(e,n),h(n,{code:c.invalid_string,validation:{endsWith:r.value},message:r.message}),a.dirty()):r.kind==="datetime"?rn(r).test(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{code:c.invalid_string,validation:"datetime",message:r.message}),a.dirty()):r.kind==="date"?an.test(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{code:c.invalid_string,validation:"date",message:r.message}),a.dirty()):r.kind==="time"?nn(r).test(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{code:c.invalid_string,validation:"time",message:r.message}),a.dirty()):r.kind==="duration"?Ja.test(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{validation:"duration",code:c.invalid_string,message:r.message}),a.dirty()):r.kind==="ip"?on(e.data,r.version)||(n=this._getOrReturnCtx(e,n),h(n,{validation:"ip",code:c.invalid_string,message:r.message}),a.dirty()):r.kind==="jwt"?ln(e.data,r.alg)||(n=this._getOrReturnCtx(e,n),h(n,{validation:"jwt",code:c.invalid_string,message:r.message}),a.dirty()):r.kind==="cidr"?dn(e.data,r.version)||(n=this._getOrReturnCtx(e,n),h(n,{validation:"cidr",code:c.invalid_string,message:r.message}),a.dirty()):r.kind==="base64"?tn.test(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{validation:"base64",code:c.invalid_string,message:r.message}),a.dirty()):r.kind==="base64url"?sn.test(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{validation:"base64url",code:c.invalid_string,message:r.message}),a.dirty()):O.assertNever(r);return{status:a.value,value:e.data}}_regex(e,t,a){return this.refinement(n=>e.test(n),{validation:t,code:c.invalid_string,...x.errToObj(a)})}_addCheck(e){return new ne({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...x.errToObj(e)})}url(e){return this._addCheck({kind:"url",...x.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...x.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...x.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...x.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...x.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...x.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...x.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...x.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...x.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...x.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...x.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...x.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,...x.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,...x.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...x.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...x.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...x.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...x.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...x.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...x.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...x.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...x.errToObj(t)})}nonempty(e){return this.min(1,x.errToObj(e))}trim(){return new ne({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ne({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ne({...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}}ne.create=s=>new ne({checks:[],typeName:k.ZodString,coerce:s?.coerce??!1,...S(s)});function un(s,e){const t=(s.toString().split(".")[1]||"").length,a=(e.toString().split(".")[1]||"").length,n=t>a?t:a,r=Number.parseInt(s.toFixed(n).replace(".","")),l=Number.parseInt(e.toFixed(n).replace(".",""));return r%l/10**n}class fe extends ${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)!==y.number){const r=this._getOrReturnCtx(e);return h(r,{code:c.invalid_type,expected:y.number,received:r.parsedType}),b}let a;const n=new G;for(const r of this._def.checks)r.kind==="int"?O.isInteger(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{code:c.invalid_type,expected:"integer",received:"float",message:r.message}),n.dirty()):r.kind==="min"?(r.inclusive?e.data<r.value:e.data<=r.value)&&(a=this._getOrReturnCtx(e,a),h(a,{code:c.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind==="max"?(r.inclusive?e.data>r.value:e.data>=r.value)&&(a=this._getOrReturnCtx(e,a),h(a,{code:c.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind==="multipleOf"?un(e.data,r.value)!==0&&(a=this._getOrReturnCtx(e,a),h(a,{code:c.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind==="finite"?Number.isFinite(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{code:c.not_finite,message:r.message}),n.dirty()):O.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,x.toString(t))}gt(e,t){return this.setLimit("min",e,!1,x.toString(t))}lte(e,t){return this.setLimit("max",e,!0,x.toString(t))}lt(e,t){return this.setLimit("max",e,!1,x.toString(t))}setLimit(e,t,a,n){return new fe({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:x.toString(n)}]})}_addCheck(e){return new fe({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:x.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:x.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:x.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:x.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:x.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:x.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:x.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:x.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:x.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"&&O.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(t===null||a.value>t)&&(t=a.value):a.kind==="max"&&(e===null||a.value<e)&&(e=a.value)}return Number.isFinite(t)&&Number.isFinite(e)}}fe.create=s=>new fe({checks:[],typeName:k.ZodNumber,coerce:s?.coerce||!1,...S(s)});class ve extends ${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)!==y.bigint)return this._getInvalidInput(e);let a;const n=new G;for(const r of this._def.checks)r.kind==="min"?(r.inclusive?e.data<r.value:e.data<=r.value)&&(a=this._getOrReturnCtx(e,a),h(a,{code:c.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind==="max"?(r.inclusive?e.data>r.value:e.data>=r.value)&&(a=this._getOrReturnCtx(e,a),h(a,{code:c.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind==="multipleOf"?e.data%r.value!==BigInt(0)&&(a=this._getOrReturnCtx(e,a),h(a,{code:c.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):O.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return h(t,{code:c.invalid_type,expected:y.bigint,received:t.parsedType}),b}gte(e,t){return this.setLimit("min",e,!0,x.toString(t))}gt(e,t){return this.setLimit("min",e,!1,x.toString(t))}lte(e,t){return this.setLimit("max",e,!0,x.toString(t))}lt(e,t){return this.setLimit("max",e,!1,x.toString(t))}setLimit(e,t,a,n){return new ve({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:x.toString(n)}]})}_addCheck(e){return new ve({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:x.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:x.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:x.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:x.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:x.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}}ve.create=s=>new ve({checks:[],typeName:k.ZodBigInt,coerce:s?.coerce??!1,...S(s)});class et extends ${_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==y.boolean){const a=this._getOrReturnCtx(e);return h(a,{code:c.invalid_type,expected:y.boolean,received:a.parsedType}),b}return q(e.data)}}et.create=s=>new et({typeName:k.ZodBoolean,coerce:s?.coerce||!1,...S(s)});class Ie extends ${_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==y.date){const r=this._getOrReturnCtx(e);return h(r,{code:c.invalid_type,expected:y.date,received:r.parsedType}),b}if(Number.isNaN(e.data.getTime())){const r=this._getOrReturnCtx(e);return h(r,{code:c.invalid_date}),b}const a=new G;let n;for(const r of this._def.checks)r.kind==="min"?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),h(n,{code:c.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),a.dirty()):r.kind==="max"?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),h(n,{code:c.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),a.dirty()):O.assertNever(r);return{status:a.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Ie({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:x.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:x.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}}Ie.create=s=>new Ie({checks:[],coerce:s?.coerce||!1,typeName:k.ZodDate,...S(s)});class tt extends ${_parse(e){if(this._getType(e)!==y.symbol){const a=this._getOrReturnCtx(e);return h(a,{code:c.invalid_type,expected:y.symbol,received:a.parsedType}),b}return q(e.data)}}tt.create=s=>new tt({typeName:k.ZodSymbol,...S(s)});class st extends ${_parse(e){if(this._getType(e)!==y.undefined){const a=this._getOrReturnCtx(e);return h(a,{code:c.invalid_type,expected:y.undefined,received:a.parsedType}),b}return q(e.data)}}st.create=s=>new st({typeName:k.ZodUndefined,...S(s)});class at extends ${_parse(e){if(this._getType(e)!==y.null){const a=this._getOrReturnCtx(e);return h(a,{code:c.invalid_type,expected:y.null,received:a.parsedType}),b}return q(e.data)}}at.create=s=>new at({typeName:k.ZodNull,...S(s)});class nt extends ${constructor(){super(...arguments),this._any=!0}_parse(e){return q(e.data)}}nt.create=s=>new nt({typeName:k.ZodAny,...S(s)});class rt extends ${constructor(){super(...arguments),this._unknown=!0}_parse(e){return q(e.data)}}rt.create=s=>new rt({typeName:k.ZodUnknown,...S(s)});class oe extends ${_parse(e){const t=this._getOrReturnCtx(e);return h(t,{code:c.invalid_type,expected:y.never,received:t.parsedType}),b}}oe.create=s=>new oe({typeName:k.ZodNever,...S(s)});class it extends ${_parse(e){if(this._getType(e)!==y.undefined){const a=this._getOrReturnCtx(e);return h(a,{code:c.invalid_type,expected:y.void,received:a.parsedType}),b}return q(e.data)}}it.create=s=>new it({typeName:k.ZodVoid,...S(s)});class Q extends ${_parse(e){const{ctx:t,status:a}=this._processInputParams(e),n=this._def;if(t.parsedType!==y.array)return h(t,{code:c.invalid_type,expected:y.array,received:t.parsedType}),b;if(n.exactLength!==null){const l=t.data.length>n.exactLength.value,d=t.data.length<n.exactLength.value;(l||d)&&(h(t,{code:l?c.too_big:c.too_small,minimum:d?n.exactLength.value:void 0,maximum:l?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),a.dirty())}if(n.minLength!==null&&t.data.length<n.minLength.value&&(h(t,{code:c.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),a.dirty()),n.maxLength!==null&&t.data.length>n.maxLength.value&&(h(t,{code:c.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),a.dirty()),t.common.async)return Promise.all([...t.data].map((l,d)=>n.type._parseAsync(new ie(t,l,t.path,d)))).then(l=>G.mergeArray(a,l));const r=[...t.data].map((l,d)=>n.type._parseSync(new ie(t,l,t.path,d)));return G.mergeArray(a,r)}get element(){return this._def.type}min(e,t){return new Q({...this._def,minLength:{value:e,message:x.toString(t)}})}max(e,t){return new Q({...this._def,maxLength:{value:e,message:x.toString(t)}})}length(e,t){return new Q({...this._def,exactLength:{value:e,message:x.toString(t)}})}nonempty(e){return this.min(1,e)}}Q.create=(s,e)=>new Q({type:s,minLength:null,maxLength:null,exactLength:null,typeName:k.ZodArray,...S(e)});function ue(s){if(s instanceof E){const e={};for(const t in s.shape){const a=s.shape[t];e[t]=re.create(ue(a))}return new E({...s._def,shape:()=>e})}else return s instanceof Q?new Q({...s._def,type:ue(s.element)}):s instanceof re?re.create(ue(s.unwrap())):s instanceof ge?ge.create(ue(s.unwrap())):s instanceof de?de.create(s.items.map(e=>ue(e))):s}class E extends ${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=O.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==y.object){const g=this._getOrReturnCtx(e);return h(g,{code:c.invalid_type,expected:y.object,received:g.parsedType}),b}const{status:a,ctx:n}=this._processInputParams(e),{shape:r,keys:l}=this._getCached(),d=[];if(!(this._def.catchall instanceof oe&&this._def.unknownKeys==="strip"))for(const g in n.data)l.includes(g)||d.push(g);const m=[];for(const g of l){const _=r[g],P=n.data[g];m.push({key:{status:"valid",value:g},value:_._parse(new ie(n,P,n.path,g)),alwaysSet:g in n.data})}if(this._def.catchall instanceof oe){const g=this._def.unknownKeys;if(g==="passthrough")for(const _ of d)m.push({key:{status:"valid",value:_},value:{status:"valid",value:n.data[_]}});else if(g==="strict")d.length>0&&(h(n,{code:c.unrecognized_keys,keys:d}),a.dirty());else if(g!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const g=this._def.catchall;for(const _ of d){const P=n.data[_];m.push({key:{status:"valid",value:_},value:g._parse(new ie(n,P,n.path,_)),alwaysSet:_ in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const g=[];for(const _ of m){const P=await _.key,J=await _.value;g.push({key:P,value:J,alwaysSet:_.alwaysSet})}return g}).then(g=>G.mergeObjectSync(a,g)):G.mergeObjectSync(a,m)}get shape(){return this._def.shape()}strict(e){return x.errToObj,new E({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,a)=>{const n=this._def.errorMap?.(t,a).message??a.defaultError;return t.code==="unrecognized_keys"?{message:x.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new E({...this._def,unknownKeys:"strip"})}passthrough(){return new E({...this._def,unknownKeys:"passthrough"})}extend(e){return new E({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new E({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:k.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new E({...this._def,catchall:e})}pick(e){const t={};for(const a of O.objectKeys(e))e[a]&&this.shape[a]&&(t[a]=this.shape[a]);return new E({...this._def,shape:()=>t})}omit(e){const t={};for(const a of O.objectKeys(this.shape))e[a]||(t[a]=this.shape[a]);return new E({...this._def,shape:()=>t})}deepPartial(){return ue(this)}partial(e){const t={};for(const a of O.objectKeys(this.shape)){const n=this.shape[a];e&&!e[a]?t[a]=n:t[a]=n.optional()}return new E({...this._def,shape:()=>t})}required(e){const t={};for(const a of O.objectKeys(this.shape))if(e&&!e[a])t[a]=this.shape[a];else{let r=this.shape[a];for(;r instanceof re;)r=r._def.innerType;t[a]=r}return new E({...this._def,shape:()=>t})}keyof(){return yt(O.objectKeys(this.shape))}}E.create=(s,e)=>new E({shape:()=>s,unknownKeys:"strip",catchall:oe.create(),typeName:k.ZodObject,...S(e)});E.strictCreate=(s,e)=>new E({shape:()=>s,unknownKeys:"strict",catchall:oe.create(),typeName:k.ZodObject,...S(e)});E.lazycreate=(s,e)=>new E({shape:s,unknownKeys:"strip",catchall:oe.create(),typeName:k.ZodObject,...S(e)});class Oe extends ${_parse(e){const{ctx:t}=this._processInputParams(e),a=this._def.options;function n(r){for(const d of r)if(d.result.status==="valid")return d.result;for(const d of r)if(d.result.status==="dirty")return t.common.issues.push(...d.ctx.common.issues),d.result;const l=r.map(d=>new ee(d.ctx.common.issues));return h(t,{code:c.invalid_union,unionErrors:l}),b}if(t.common.async)return Promise.all(a.map(async r=>{const l={...t,common:{...t.common,issues:[]},parent:null};return{result:await r._parseAsync({data:t.data,path:t.path,parent:l}),ctx:l}})).then(n);{let r;const l=[];for(const m of a){const g={...t,common:{...t.common,issues:[]},parent:null},_=m._parseSync({data:t.data,path:t.path,parent:g});if(_.status==="valid")return _;_.status==="dirty"&&!r&&(r={result:_,ctx:g}),g.common.issues.length&&l.push(g.common.issues)}if(r)return t.common.issues.push(...r.ctx.common.issues),r.result;const d=l.map(m=>new ee(m));return h(t,{code:c.invalid_union,unionErrors:d}),b}}get options(){return this._def.options}}Oe.create=(s,e)=>new Oe({options:s,typeName:k.ZodUnion,...S(e)});function Le(s,e){const t=ae(s),a=ae(e);if(s===e)return{valid:!0,data:s};if(t===y.object&&a===y.object){const n=O.objectKeys(e),r=O.objectKeys(s).filter(d=>n.indexOf(d)!==-1),l={...s,...e};for(const d of r){const m=Le(s[d],e[d]);if(!m.valid)return{valid:!1};l[d]=m.data}return{valid:!0,data:l}}else if(t===y.array&&a===y.array){if(s.length!==e.length)return{valid:!1};const n=[];for(let r=0;r<s.length;r++){const l=s[r],d=e[r],m=Le(l,d);if(!m.valid)return{valid:!1};n.push(m.data)}return{valid:!0,data:n}}else return t===y.date&&a===y.date&&+s==+e?{valid:!0,data:s}:{valid:!1}}class Ne extends ${_parse(e){const{status:t,ctx:a}=this._processInputParams(e),n=(r,l)=>{if(Ye(r)||Ye(l))return b;const d=Le(r.value,l.value);return d.valid?((Qe(r)||Qe(l))&&t.dirty(),{status:t.value,value:d.data}):(h(a,{code:c.invalid_intersection_types}),b)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([r,l])=>n(r,l)):n(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}Ne.create=(s,e,t)=>new Ne({left:s,right:e,typeName:k.ZodIntersection,...S(t)});class de extends ${_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==y.array)return h(a,{code:c.invalid_type,expected:y.array,received:a.parsedType}),b;if(a.data.length<this._def.items.length)return h(a,{code:c.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),b;!this._def.rest&&a.data.length>this._def.items.length&&(h(a,{code:c.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const r=[...a.data].map((l,d)=>{const m=this._def.items[d]||this._def.rest;return m?m._parse(new ie(a,l,a.path,d)):null}).filter(l=>!!l);return a.common.async?Promise.all(r).then(l=>G.mergeArray(t,l)):G.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new de({...this._def,rest:e})}}de.create=(s,e)=>{if(!Array.isArray(s))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new de({items:s,typeName:k.ZodTuple,rest:null,...S(e)})};class ot extends ${get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==y.map)return h(a,{code:c.invalid_type,expected:y.map,received:a.parsedType}),b;const n=this._def.keyType,r=this._def.valueType,l=[...a.data.entries()].map(([d,m],g)=>({key:n._parse(new ie(a,d,a.path,[g,"key"])),value:r._parse(new ie(a,m,a.path,[g,"value"]))}));if(a.common.async){const d=new Map;return Promise.resolve().then(async()=>{for(const m of l){const g=await m.key,_=await m.value;if(g.status==="aborted"||_.status==="aborted")return b;(g.status==="dirty"||_.status==="dirty")&&t.dirty(),d.set(g.value,_.value)}return{status:t.value,value:d}})}else{const d=new Map;for(const m of l){const g=m.key,_=m.value;if(g.status==="aborted"||_.status==="aborted")return b;(g.status==="dirty"||_.status==="dirty")&&t.dirty(),d.set(g.value,_.value)}return{status:t.value,value:d}}}}ot.create=(s,e,t)=>new ot({valueType:e,keyType:s,typeName:k.ZodMap,...S(t)});class be extends ${_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==y.set)return h(a,{code:c.invalid_type,expected:y.set,received:a.parsedType}),b;const n=this._def;n.minSize!==null&&a.data.size<n.minSize.value&&(h(a,{code:c.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),n.maxSize!==null&&a.data.size>n.maxSize.value&&(h(a,{code:c.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const r=this._def.valueType;function l(m){const g=new Set;for(const _ of m){if(_.status==="aborted")return b;_.status==="dirty"&&t.dirty(),g.add(_.value)}return{status:t.value,value:g}}const d=[...a.data.values()].map((m,g)=>r._parse(new ie(a,m,a.path,g)));return a.common.async?Promise.all(d).then(m=>l(m)):l(d)}min(e,t){return new be({...this._def,minSize:{value:e,message:x.toString(t)}})}max(e,t){return new be({...this._def,maxSize:{value:e,message:x.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}be.create=(s,e)=>new be({valueType:s,minSize:null,maxSize:null,typeName:k.ZodSet,...S(e)});class lt extends ${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})}}lt.create=(s,e)=>new lt({getter:s,typeName:k.ZodLazy,...S(e)});class dt extends ${_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return h(t,{received:t.data,code:c.invalid_literal,expected:this._def.value}),b}return{status:"valid",value:e.data}}get value(){return this._def.value}}dt.create=(s,e)=>new dt({value:s,typeName:k.ZodLiteral,...S(e)});function yt(s,e){return new he({values:s,typeName:k.ZodEnum,...S(e)})}class he extends ${_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),a=this._def.values;return h(t,{expected:O.joinValues(a),received:t.parsedType,code:c.invalid_type}),b}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),a=this._def.values;return h(t,{received:t.data,code:c.invalid_enum_value,options:a}),b}return q(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 he.create(e,{...this._def,...t})}exclude(e,t=this._def){return he.create(this.options.filter(a=>!e.includes(a)),{...this._def,...t})}}he.create=yt;class ut extends ${_parse(e){const t=O.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==y.string&&a.parsedType!==y.number){const n=O.objectValues(t);return h(a,{expected:O.joinValues(n),received:a.parsedType,code:c.invalid_type}),b}if(this._cache||(this._cache=new Set(O.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const n=O.objectValues(t);return h(a,{received:a.data,code:c.invalid_enum_value,options:n}),b}return q(e.data)}get enum(){return this._def.values}}ut.create=(s,e)=>new ut({values:s,typeName:k.ZodNativeEnum,...S(e)});class Re extends ${unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==y.promise&&t.common.async===!1)return h(t,{code:c.invalid_type,expected:y.promise,received:t.parsedType}),b;const a=t.parsedType===y.promise?t.data:Promise.resolve(t.data);return q(a.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Re.create=(s,e)=>new Re({type:s,typeName:k.ZodPromise,...S(e)});class me extends ${innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===k.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:a}=this._processInputParams(e),n=this._def.effect||null,r={addIssue:l=>{h(a,l),l.fatal?t.abort():t.dirty()},get path(){return a.path}};if(r.addIssue=r.addIssue.bind(r),n.type==="preprocess"){const l=n.transform(a.data,r);if(a.common.async)return Promise.resolve(l).then(async d=>{if(t.value==="aborted")return b;const m=await this._def.schema._parseAsync({data:d,path:a.path,parent:a});return m.status==="aborted"?b:m.status==="dirty"||t.value==="dirty"?xe(m.value):m});{if(t.value==="aborted")return b;const d=this._def.schema._parseSync({data:l,path:a.path,parent:a});return d.status==="aborted"?b:d.status==="dirty"||t.value==="dirty"?xe(d.value):d}}if(n.type==="refinement"){const l=d=>{const m=n.refinement(d,r);if(a.common.async)return Promise.resolve(m);if(m instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return d};if(a.common.async===!1){const d=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return d.status==="aborted"?b:(d.status==="dirty"&&t.dirty(),l(d.value),{status:t.value,value:d.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(d=>d.status==="aborted"?b:(d.status==="dirty"&&t.dirty(),l(d.value).then(()=>({status:t.value,value:d.value}))))}if(n.type==="transform")if(a.common.async===!1){const l=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!pe(l))return b;const d=n.transform(l.value,r);if(d instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:d}}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(l=>pe(l)?Promise.resolve(n.transform(l.value,r)).then(d=>({status:t.value,value:d})):b);O.assertNever(n)}}me.create=(s,e,t)=>new me({schema:s,typeName:k.ZodEffects,effect:e,...S(t)});me.createWithPreprocess=(s,e,t)=>new me({schema:e,effect:{type:"preprocess",transform:s},typeName:k.ZodEffects,...S(t)});class re extends ${_parse(e){return this._getType(e)===y.undefined?q(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}re.create=(s,e)=>new re({innerType:s,typeName:k.ZodOptional,...S(e)});class ge extends ${_parse(e){return this._getType(e)===y.null?q(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ge.create=(s,e)=>new ge({innerType:s,typeName:k.ZodNullable,...S(e)});class ze extends ${_parse(e){const{ctx:t}=this._processInputParams(e);let a=t.data;return t.parsedType===y.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ze.create=(s,e)=>new ze({innerType:s,typeName:k.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...S(e)});class Fe extends ${_parse(e){const{ctx:t}=this._processInputParams(e),a={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return $e(n)?n.then(r=>({status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new ee(a.common.issues)},input:a.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new ee(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}Fe.create=(s,e)=>new Fe({innerType:s,typeName:k.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...S(e)});class ct extends ${_parse(e){if(this._getType(e)!==y.nan){const a=this._getOrReturnCtx(e);return h(a,{code:c.invalid_type,expected:y.nan,received:a.parsedType}),b}return{status:"valid",value:e.data}}}ct.create=s=>new ct({typeName:k.ZodNaN,...S(s)});class cn extends ${_parse(e){const{ctx:t}=this._processInputParams(e),a=t.data;return this._def.type._parse({data:a,path:t.path,parent:t})}unwrap(){return this._def.type}}class Ge extends ${_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.common.async)return(async()=>{const r=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return r.status==="aborted"?b:r.status==="dirty"?(t.dirty(),xe(r.value)):this._def.out._parseAsync({data:r.value,path:a.path,parent:a})})();{const n=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return n.status==="aborted"?b:n.status==="dirty"?(t.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:a.path,parent:a})}}static create(e,t){return new Ge({in:e,out:t,typeName:k.ZodPipeline})}}class Be extends ${_parse(e){const t=this._def.innerType._parse(e),a=n=>(pe(n)&&(n.value=Object.freeze(n.value)),n);return $e(t)?t.then(n=>a(n)):a(t)}unwrap(){return this._def.innerType}}Be.create=(s,e)=>new Be({innerType:s,typeName:k.ZodReadonly,...S(e)});var k;(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"})(k||(k={}));const f=ne.create,ye=fe.create;oe.create;const V=Q.create,M=E.create;Oe.create;Ne.create;de.create;const pt=he.create;Re.create;re.create;ge.create;const pn=M({label:f().min(1).max(40),left:f().min(1).max(35),right:f().min(1).max(35)}),fn=M({id:f().min(1),category:f().optional().default("TECH"),theme:pt(["blue-tech","emerald-finance","slate-education","dark-contrast","crimson-alert"]).default("blue-tech"),layoutType:pt(["table","news","stat","list","quote","versus","receipt","timeline","barchart","leaderboard","editorial","matrix","debate","tierlist"]).default("table"),title:f().min(1).max(120),subtitle:f().min(1).max(250),leftHeader:f().optional().default("USA 🇺🇸"),rightHeader:f().optional().default("UK 🇬🇧"),rows:V(pn).optional().default([]),bullets:V(M({highlight:f().optional().default(""),text:f().min(1)})).optional().default([]),bigStat:M({number:f().default("$165,000"),label:f().default("Average Compensation"),subtext:f().optional().default(""),secondaryNumber:f().optional().default(""),secondaryLabel:f().optional().default("")}).optional(),listItems:V(M({rank:ye(),title:f(),value:f(),tag:f().optional().default("")})).optional().default([]),quoteData:M({quote:f(),highlight:f().optional().default(""),source:f().default("Industry Insider")}).optional(),versusData:M({leftEntity:f().optional(),leftStats:V(M({label:f(),value:f()})).optional(),leftPerk:f().optional(),rightEntity:f().optional(),rightStats:V(M({label:f(),value:f()})).optional(),rightPerk:f().optional(),verdict:f().optional()}).optional(),receiptData:M({grossMonthly:f().optional(),items:V(M({label:f(),amount:f(),note:f().optional()})).optional(),totalDeductions:f().optional(),netRemaining:f().optional()}).optional(),timelineData:M({pastYear:f().optional().default("2016"),presentYear:f().optional().default("2026"),items:V(M({label:f(),pastValue:f(),presentValue:f(),changeBadge:f().optional()})).optional(),bottomInsight:f().optional()}).optional(),barchartData:V(M({label:f(),percentage:ye().min(0).max(100),amount:f().optional(),tag:f().optional()})).optional().default([]),leaderboardData:M({calloutNote:f().optional().default("*Asumsi kurs : Rp15.500/US$"),items:V(M({rank:ye(),name:f(),flag:f().optional().default("🌐"),value:f(),percentage:ye().min(0).max(100).optional()})).optional()}).optional(),editorialData:M({badge:f().optional().default("INVESTIGASI KHUSUS"),highlightPhrase:f().optional(),cards:V(M({step:f().optional(),title:f(),text:f(),stat:f().optional()})).optional(),keyTakeaway:f().optional()}).optional(),matrixData:M({headers:V(f()).optional().default(["Indikator","🇮🇩 IDN","🇲🇾 MYS","🇸🇬 SGP"]),rows:V(M({label:f(),values:V(f())})).optional()}).optional(),debateData:M({proTitle:f().optional().default("SISI PRO / BENEFIT"),proScore:f().optional().default("65%"),proPoints:V(f()).optional(),conTitle:f().optional().default("SISI KONTRA / RISIKO"),conScore:f().optional().default("35%"),conPoints:V(f()).optional(),callToAction:f().optional().default("Kalian di tim mana? Tulis pendapatmu di bawah! 👇")}).optional(),tierlistData:V(M({tier:f(),tierColor:f().optional(),items:V(M({name:f(),badge:f().optional(),desc:f().optional()}))})).optional().default([]),footerNote:f().optional().default("Industry Benchmark 2026"),watermark:f().optional().default("@SocialGen"),bgKeyword:f().optional().default("modern office coding night"),reelsDuration:ye().min(5).max(90).default(10),caption:f().optional().default("Bagikan pendapat Anda di kolom komentar! #infografis #edukasi")}),hn={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"},mn={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"},gn={class:"flex items-center gap-2 sm:gap-3 text-xs"},yn={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]"},xn={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]"},vn={class:"lg:hidden flex items-center justify-center px-3 py-2 bg-slate-900/90 border-b border-slate-800 flex-shrink-0"},bn={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"},kn={key:0,class:"w-2 h-2 rounded-full bg-emerald-400 animate-ping"},_n={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"},Sn=Ue({__name:"index",setup(s){const e=A({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:10,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=A({theme:"blue-tech",backgroundSource:"pexels",musicFile:"random",outputs:{feed:!0,story:!0,reels:!0}}),a=A([]),n=A(-1);function r(){try{localStorage.setItem("sg_drafts",JSON.stringify(a.value))}catch{}$fetch("/api/drafts",{method:"POST",body:{drafts:a.value}}).catch(T=>{console.warn("Failed to sync drafts to server:",T)})}function l(){a.value.unshift(JSON.parse(JSON.stringify(e.value))),n.value=0,r(),K("Draft berhasil disimpan permanen!")}function d(T){a.value[T]&&(e.value=JSON.parse(JSON.stringify(a.value[T])),t.value.theme=e.value.theme,n.value=T,K(`Memuat draft #${T+1}`))}function m(T){a.value.splice(T,1),n.value===T&&(n.value=-1),r()}const g=A(!1),_=A(!1),P=A(""),J=A(null),W=A(""),F=A("success"),w=A("editor"),H=A(null);Ee(async()=>{try{const T=await $fetch("/api/drafts");if(T?.drafts&&Array.isArray(T.drafts)&&T.drafts.length>0)a.value=T.drafts;else{const N=localStorage.getItem("sg_drafts");if(N){const Y=JSON.parse(N);Array.isArray(Y)&&Y.length>0&&(a.value=Y,$fetch("/api/drafts",{method:"POST",body:{drafts:Y}}).catch(()=>{}))}}}catch{const T=localStorage.getItem("sg_drafts");if(T)try{a.value=JSON.parse(T)}catch{}}try{const T=await $fetch("/api/status");H.value=T}catch{}});const B=ft(()=>{const T=fn.safeParse(e.value);if(T.success)return{isValid:!0,error:""};{const N=T.error.errors[0];return{isValid:!1,error:`${N.path.join(".")}: ${N.message}`}}});function K(T,N="success"){W.value=T,F.value=N,setTimeout(()=>{W.value=""},4e3)}async function ke(T,N,Y){_.value=!0,P.value=`AI Research (${Y||"Gemini"})...`;try{const L=await $fetch("/api/auto-topic",{method:"POST",body:{niche:T,layoutType:N,model:Y}});L?.dataset&&(e.value=L.dataset,t.value.theme=L.dataset.theme,a.value.unshift(L.dataset),n.value=0,r(),L.source==="gemini"?K(`✨ [${L.modelUsed||"Gemini"}] Berhasil meriset: "${L.dataset.title.slice(0,32)}..."`,"success"):K(`ℹ️ [Curated Data] Topik siap: "${L.dataset.title.slice(0,32)}..."`,"success"))}catch(L){K("Gagal auto-topic: "+(L.data?.statusMessage||L.message),"error")}finally{_.value=!1,P.value=""}}async function _e(){if(!B.value.isValid){K("Data tidak valid: "+B.value.error,"error");return}g.value=!0,P.value="Rendering Images & Reels...",J.value=null,w.value="preview";try{const T=await $fetch("/api/generate",{method:"POST",body:{data:e.value,options:t.value}});T?.success&&(J.value=T,K(`Sukses dirender dalam ${(T.durationMs/1e3).toFixed(1)} detik!`))}catch(T){K("Gagal render: "+(T.data?.statusMessage||T.message),"error")}finally{g.value=!1,P.value=""}}return(T,N)=>{const Y=ha,L=Va;return C(),I("div",hn,[i("header",mn,[N[5]||(N[5]=i("div",{class:"flex items-center gap-2.5 sm:gap-3"},[i("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 "),i("div",null,[i("h1",{class:"text-sm font-extrabold tracking-tight text-white flex items-center gap-1.5 sm:gap-2"},[X(" SocialGen "),i("span",{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"}," v2.0 ")])])],-1)),i("div",gn,[u(H)?.geminiActive?(C(),I("span",yn," ● AI Connected ")):(C(),I("span",xn," ● Local Engine "))])]),i("div",vn,[i("div",bn,[i("button",{onClick:N[0]||(N[0]=te=>w.value="editor"),class:D(["py-1.5 px-3 rounded-lg transition flex items-center justify-center gap-1.5",u(w)==="editor"?"bg-sky-500 text-white shadow-md font-black":"text-slate-400 hover:text-slate-200"])},[...N[6]||(N[6]=[i("span",null,"⚙️ Studio & Editor",-1)])],2),i("button",{onClick:N[1]||(N[1]=te=>w.value="preview"),class:D(["py-1.5 px-3 rounded-lg transition flex items-center justify-center gap-1.5",u(w)==="preview"?"bg-indigo-600 text-white shadow-md font-black":"text-slate-400 hover:text-slate-200"])},[N[7]||(N[7]=i("span",null,"👁️ Live Preview",-1)),u(J)?(C(),I("span",kn)):U("",!0)],2)])]),u(W)?(C(),I("div",{key:0,class:D(["fixed bottom-6 right-6 z-50 flex items-center gap-2 px-4 py-3 rounded-2xl shadow-2xl text-xs font-bold border transition-all animate-bounce",u(F)==="success"?"bg-emerald-950 text-emerald-200 border-emerald-500/50":"bg-rose-950 text-rose-200 border-rose-500/50"])},[i("span",null,Z(u(W)),1)],2)):U("",!0),i("main",_n,[i("section",{class:D(["lg:col-span-5 h-full overflow-y-auto pr-1 flex-col gap-3 custom-scrollbar",u(w)==="editor"?"flex":"hidden lg:flex"])},[R(Y,{modelValue:u(e),"onUpdate:modelValue":N[2]||(N[2]=te=>De(e)?e.value=te:null),options:u(t),"onUpdate:options":N[3]||(N[3]=te=>De(t)?t.value=te:null),"is-valid":u(B).isValid,"validation-error":u(B).error,"is-generating":u(g),"generate-stage":u(P),"is-auto-topic-loading":u(_),drafts:u(a),"active-draft-index":u(n),onGenerate:_e,onAutoTopic:ke,onSelectDraft:d,onDeleteDraft:m,onSaveDraft:l},null,8,["modelValue","options","is-valid","validation-error","is-generating","generate-stage","is-auto-topic-loading","drafts","active-draft-index"])],2),i("section",{class:D(["lg:col-span-7 h-full flex-col gap-3 overflow-hidden justify-between min-h-0",u(w)==="preview"?"flex":"hidden lg:flex"])},[R(L,{data:u(e),"selected-video":u(t).backgroundSource,"generated-result":u(J)},null,8,["data","selected-video","generated-result"])],2)]),u(w)==="editor"?(C(),I("button",{key:1,onClick:N[4]||(N[4]=te=>w.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"},[...N[8]||(N[8]=[i("span",null,"👁️ Lihat Preview Canvas",-1)])])):U("",!0)])}}});export{Sn as default};
|
|
1
|
+
import{h as Ze,d as Ue,o as Ee,M as wt,A as C,B as O,l as u,C as i,E as R,G as X,D as Z,N as ce,O as G,P as D,Q as Ct,R as St,S as De,T as Se,U as Te,V as Tt,W as He,i as A,X as At,m as ft}from"./gKE2LypS.js";import{_ as $t}from"./CfUuIQFh.js";const It=s=>s.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var Ae={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 Ot=({size:s,strokeWidth:e=2,absoluteStrokeWidth:t,color:a,iconNode:n,name:r,class:l,...d},{slots:m})=>Ze("svg",{...Ae,width:s||Ae.width,height:s||Ae.height,stroke:a||Ae.stroke,"stroke-width":t?Number(e)*24/Number(s):e,class:["lucide",`lucide-${It(r??"icon")}`],...d},[...n.map(g=>Ze(...g)),...m.default?[m.default()]:[]]);const j=(s,e)=>(t,{slots:a})=>Ze(Ot,{...t,iconNode:e,name:s},a);const Nt=j("BookmarkIcon",[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]]);const Ve=j("CheckIcon",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const Rt=j("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 Mt=j("CircleCheckIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const jt=j("ClockIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const ht=j("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 Zt=j("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 qe=j("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 Et=j("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 Dt=j("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 Vt=j("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 Pt=j("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 Lt=j("PlayIcon",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);const zt=j("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 Ft=j("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 Bt=j("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 Je=j("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 Ut=j("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 We=j("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 Gt=j("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 Ht=j("XIcon",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);const qt=j("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 Jt=j("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"}]]),Wt={class:"flex flex-col gap-3 text-slate-100"},Kt={key:0,class:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm flex items-center justify-center p-4"},Yt={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]"},Qt={class:"flex items-center justify-between pb-3 border-b border-slate-800"},Xt={class:"text-sm font-black text-white flex items-center gap-2"},es={class:"flex items-center gap-2 bg-slate-950 p-2.5 rounded-xl border border-slate-800 text-[11px]"},ts={class:"text-purple-400 font-bold"},ss={class:"relative flex-1 min-h-[220px]"},as=["value"],ns={class:"flex items-center justify-between pt-2 border-t border-slate-800"},rs={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"},is={class:"text-xs font-black text-white flex items-center gap-2"},os={class:"flex items-center gap-1.5"},ls=["disabled"],ds={class:"relative group"},us={class:"absolute right-0 mt-1 hidden group-hover:flex flex-col bg-slate-900 border border-slate-800 rounded-xl shadow-2xl py-2 z-20 w-56 text-xs"},cs={class:"px-3 py-1.5"},ps={key:1,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"},fs={class:"w-6 h-6 rounded-lg bg-sky-500/20 border border-sky-400/40 flex items-center justify-center flex-shrink-0"},hs={class:"text-[11px]"},ms={class:"font-extrabold text-white flex items-center gap-2"},gs={class:"text-[9px] px-1.5 py-0.2 rounded bg-sky-500/30 text-sky-200 border border-sky-400/30"},ys={class:"flex items-center justify-between bg-slate-950 p-1 rounded-xl border border-slate-800 text-xs font-semibold"},vs={class:"flex items-center gap-1"},xs={key:2,class:"flex flex-col gap-1.5 p-2.5 bg-slate-900/90 border border-slate-800 rounded-2xl max-h-[300px] overflow-y-auto"},bs={key:0,class:"text-center py-8 text-slate-500 text-[11px]"},ks=["onClick"],_s={class:"flex-1 pr-2"},ws={class:"flex items-center gap-1.5 mb-0.5"},Cs={class:"text-[9px] text-slate-400 font-semibold"},Ss={class:"font-bold text-[11px] truncate"},Ts=["onClick"],As={key:3,class:"flex flex-col bg-slate-900/90 border border-slate-800 rounded-2xl overflow-hidden shadow-lg"},$s={class:"grid grid-cols-2 gap-2 p-2.5 bg-slate-950/70 border-b border-slate-800 text-xs"},Is={class:"block text-[10px] font-bold text-slate-300 mb-1 flex items-center gap-1"},Os=["value"],Ns=["value"],Rs={class:"col-span-2 grid grid-cols-3 gap-2 pt-1 border-t border-slate-800/60 mt-1"},Ms={class:"col-span-1"},js=["value"],Zs={class:"col-span-2"},Es=["value"],Ds={class:"flex items-center justify-between px-3 py-1.5 bg-slate-950/50 border-b border-slate-800"},Vs={class:"flex items-center gap-2 text-xs"},Ps={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"},Ls={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"},zs={class:"relative p-2"},Fs=["value"],Bs={key:0,class:"text-[10px] text-rose-400 mt-1 px-1"},Us={class:"p-3 bg-slate-900/90 border border-slate-800 rounded-2xl flex flex-col gap-2.5 shadow-lg text-xs"},Gs={class:"flex items-center justify-between gap-2"},Hs={class:"font-bold text-slate-300 flex items-center gap-1.5 text-[11px]"},qs={class:"flex items-center gap-1.5"},Js=["value"],Ws=["value"],Ks=["disabled"],Ys={class:"hidden sm:inline"},Qs={class:"flex items-center justify-between gap-2 pt-1.5 border-t border-slate-800"},Xs={class:"font-bold text-slate-300 flex items-center gap-1.5 text-[11px]"},ea={class:"flex items-center gap-1.5"},ta=["value"],sa=["value"],aa=["disabled"],na={class:"hidden sm:inline"},ra={class:"flex items-center justify-between pt-1.5 border-t border-slate-800"},ia={class:"font-bold text-slate-300 flex items-center gap-1.5 text-[11px]"},oa={class:"flex items-center gap-1.5 flex-wrap justify-end"},la=["onClick"],da={class:"grid grid-cols-3 gap-2 pt-1.5 border-t border-slate-800"},ua=["checked"],ca=["checked"],pa=["checked"],fa=["disabled"],ha=Ue({__name:"DashboardControls",props:{modelValue:{},options:{},isValid:{type:Boolean},validationError:{},isGenerating:{type:Boolean},generateStage:{},isAutoTopicLoading:{type:Boolean},drafts:{},activeDraftIndex:{}},emits:["update:modelValue","update:options","generate","autoTopic","selectDraft","deleteDraft","saveDraft"],setup(s,{emit:e}){const t=s,a=e,n=A(""),r=A(""),l=A(""),d=A("gemini-3.8-flash"),m=A("editor"),g=A(!1),_=A(""),P=A({}),J=A(!1),W=A(!1),F=A(["cyber_blue.mp4","emerald_flow.mp4","default_bg.mp4"]),w=A(["synthwave_pulse.mp3","lofi_chill.mp3","default_ambient.mp3"]),B=A(!1),U=A(null),K=A(null);async function ke(){try{const x=await $fetch("/api/media");x?.videos?.length&&(F.value=x.videos),x?.audio?.length&&(w.value=x.audio)}catch(x){console.error("Failed to fetch media list:",x)}}Ee(()=>{ke()});async function _e(x,o){const p=x.target,se=p.files?.[0];if(se){B.value=!0;try{const le=new FormData;le.append("file",se);const Ce=await $fetch("/api/upload-media",{method:"POST",body:le});Ce?.success&&(await ke(),Ce.type==="video"?we("backgroundSource",Ce.filename):we("musicFile",Ce.filename))}catch(le){alert("Upload gagal: "+(le.data?.statusMessage||le.message))}finally{B.value=!1,p.value=""}}}wt(()=>t.modelValue,x=>{try{const o=JSON.parse(n.value||"{}");JSON.stringify(o)!==JSON.stringify(x)&&(n.value=JSON.stringify(x,null,2))}catch{n.value=JSON.stringify(x,null,2)}},{immediate:!0,deep:!0});function T(x){const o=x.target;n.value=o.value;try{const p=JSON.parse(o.value);r.value="",a("update:modelValue",p)}catch(p){r.value="Invalid JSON: "+p.message}}function I(){try{const x=JSON.parse(n.value);n.value=JSON.stringify(x,null,2),r.value="",a("update:modelValue",x)}catch{r.value="Cannot format invalid JSON"}}function Y(x){const o={...t.modelValue,layoutType:x};a("update:modelValue",o)}function L(x){const o={...t.modelValue,watermark:x};a("update:modelValue",o)}function te(x){const o={...t.modelValue,title:x};a("update:modelValue",o)}function vt(x){const o={...t.modelValue,theme:x};a("update:modelValue",o),a("update:options",{...t.options,theme:x})}function xt(x){const o={...t.modelValue,reelsDuration:x};a("update:modelValue",o)}function we(x,o){a("update:options",{...t.options,[x]:o})}function Me(x,o){const p=t.options.outputs||{feed:!0,story:!0,reels:!0};a("update:options",{...t.options,outputs:{...p,[x]:o}})}const bt=A({audio:[],videos:[]});Ee(async()=>{try{bt.value=await $fetch("/api/media")}catch{}});function z(x,o){a("autoTopic",x,o||l.value||void 0,d.value)}async function kt(){g.value=!0,J.value=!0;try{const x=await $fetch("/api/copy-prompt",{query:{niche:t.modelValue.category?.includes("TECH")?"TECH":"SOCIAL_ECONOMY",layout:t.modelValue.layoutType||"news"}});_.value=x.prompt,P.value={topic:x.topic,pair:x.pair,niche:x.niche,usedCount:x.usedCount}}catch(x){console.error("Failed to get manual prompt:",x)}finally{J.value=!1}}function _t(){_.value&&(navigator.clipboard.writeText(_.value),W.value=!0,setTimeout(()=>{W.value=!1},2500))}return(x,o)=>(C(),O("div",Wt,[u(g)?(C(),O("div",Kt,[i("div",Yt,[i("div",Qt,[i("div",null,[i("h3",Xt,[R(u(qe),{class:"w-4 h-4 text-purple-400"}),o[34]||(o[34]=X(" Master Prompt AI (Dynamic Research & Zero-Collision) ",-1))]),o[35]||(o[35]=i("p",{class:"text-[11px] text-slate-400 mt-0.5"}," Salin prompt ini ke ChatGPT / Gemini / Claude / DeepSeek untuk mencari topik terbaru. ",-1))]),i("button",{onClick:o[0]||(o[0]=p=>g.value=!1),class:"p-1 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800"},[R(u(Ht),{class:"w-4 h-4"})])]),i("div",es,[o[36]||(o[36]=i("span",{class:"font-bold text-sky-400"},"Mode:",-1)),o[37]||(o[37]=i("span",{class:"text-white font-semibold"},"Dynamic Discovery (Trending • Then vs Now • Future Horizon)",-1)),o[38]||(o[38]=i("span",{class:"text-slate-500"},"•",-1)),i("span",ts,Z(u(P).usedCount||0)+" Topik Riwayat Dikecualikan",1)]),i("div",ss,[i("textarea",{value:u(_),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,as)]),i("div",ns,[o[39]||(o[39]=i("span",{class:"text-[11px] text-slate-400"},[X(" Paste hasil JSON dari ChatGPT/Gemini ke kolom "),i("b",null,"RAW JSON"),X(" SocialGen. ")],-1)),i("button",{onClick:_t,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"},[u(W)?(C(),ce(u(Ve),{key:0,class:"w-4 h-4 text-emerald-400"})):(C(),ce(u(ht),{key:1,class:"w-4 h-4"})),i("span",null,Z(u(W)?"Prompt Berhasil Disalin!":"Copy Master Prompt"),1)])])])])):G("",!0),i("div",rs,[i("div",null,[i("h2",is,[R(u(Gt),{class:"w-3.5 h-3.5 text-sky-400"}),o[40]||(o[40]=X(" Content Studio ",-1))]),o[41]||(o[41]=i("p",{class:"text-[10px] text-slate-400"},"Multi-Format Studio",-1))]),i("div",os,[i("button",{onClick:kt,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"},[R(u(qe),{class:"w-3 h-3"}),o[42]||(o[42]=i("span",{class:"hidden sm:inline"},"Prompt Manual",-1))]),i("button",{onClick:o[1]||(o[1]=p=>z()),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"},[R(u(Je),{class:D(["w-3.5 h-3.5",{"animate-spin":s.isAutoTopicLoading}])},null,8,["class"]),i("span",null,Z(s.isAutoTopicLoading?"Meriset Data...":"✨ Auto-Topic"),1)],8,ls),i("div",ds,[o[47]||(o[47]=i("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)),i("div",us,[o[44]||(o[44]=i("div",{class:"px-3 py-1 text-[10px] font-bold text-slate-500 uppercase"},"Model AI Engine",-1)),i("div",cs,[Ct(i("select",{"onUpdate:modelValue":o[2]||(o[2]=p=>De(d)?d.value=p:null),class:"w-full bg-slate-950 border border-slate-700 rounded-lg p-1.5 text-xs text-sky-300 focus:outline-none"},[...o[43]||(o[43]=[i("option",{value:"gemini-3.5-flash"},"⚡ Gemini 3.5 Flash (Aktif)",-1),i("option",{value:"gemini-2.5-pro"},"💎 Gemini 2.5 Pro (Billing)",-1),i("option",{value:"gemini-3.8-flash"},"⚡ Gemini 3.8 Flash",-1),i("option",{value:"gemini-1.5-pro"},"💎 Gemini 1.5 Pro",-1)])],512),[[St,u(d)]])]),o[45]||(o[45]=i("div",{class:"border-t border-slate-800 my-1"},null,-1)),o[46]||(o[46]=i("div",{class:"px-3 py-1 text-[10px] font-bold text-slate-500 uppercase"},"Pilih Format Khusus",-1)),i("button",{onClick:o[3]||(o[3]=p=>z(void 0,"table")),class:"px-3 py-1.5 text-left text-sky-300 hover:bg-slate-800"}," 📊 Classic Comparison Table "),i("button",{onClick:o[4]||(o[4]=p=>z(void 0,"versus")),class:"px-3 py-1.5 text-left text-orange-300 hover:bg-slate-800"}," ⚔️ Versus Showdown Arena "),i("button",{onClick:o[5]||(o[5]=p=>z(void 0,"receipt")),class:"px-3 py-1.5 text-left text-teal-300 hover:bg-slate-800"}," 🧾 Monthly Living Invoice "),i("button",{onClick:o[6]||(o[6]=p=>z(void 0,"news")),class:"px-3 py-1.5 text-left text-rose-300 hover:bg-slate-800"}," 📰 Breaking News / Pamphlet "),i("button",{onClick:o[7]||(o[7]=p=>z(void 0,"stat")),class:"px-3 py-1.5 text-left text-amber-300 hover:bg-slate-800"}," 🎯 Big Shocking Number "),i("button",{onClick:o[8]||(o[8]=p=>z(void 0,"timeline")),class:"px-3 py-1.5 text-left text-yellow-300 hover:bg-slate-800"}," ⏳ 10-Year Shift (Then vs Now) "),i("button",{onClick:o[9]||(o[9]=p=>z(void 0,"barchart")),class:"px-3 py-1.5 text-left text-cyan-300 hover:bg-slate-800"}," 📈 Income Allocation Bars "),i("button",{onClick:o[10]||(o[10]=p=>z(void 0,"list")),class:"px-3 py-1.5 text-left text-emerald-300 hover:bg-slate-800"}," 🏆 Top 5 Ranked Countdown "),i("button",{onClick:o[11]||(o[11]=p=>z(void 0,"quote")),class:"px-3 py-1.5 text-left text-purple-300 hover:bg-slate-800"}," 💬 Hot Take / Quote Debate "),i("button",{onClick:o[12]||(o[12]=p=>z(void 0,"leaderboard")),class:"px-3 py-1.5 text-left text-yellow-400 hover:bg-slate-800 font-bold"}," 🥇 Multi-Country Leaderboard (Top 10) "),i("button",{onClick:o[13]||(o[13]=p=>z(void 0,"editorial")),class:"px-3 py-1.5 text-left text-sky-400 hover:bg-slate-800 font-bold"}," 📰 Editorial Storytelling Deep Dive "),i("button",{onClick:o[14]||(o[14]=p=>z(void 0,"matrix")),class:"px-3 py-1.5 text-left text-teal-300 hover:bg-slate-800 font-bold"}," 📊 Multi-Column Matrix (3-4 Negara) "),i("button",{onClick:o[15]||(o[15]=p=>z(void 0,"debate")),class:"px-3 py-1.5 text-left text-rose-400 hover:bg-slate-800 font-bold"}," ⚡ Debate Arena (Pro vs Kontra) "),i("button",{onClick:o[16]||(o[16]=p=>z(void 0,"tierlist")),class:"px-3 py-1.5 text-left text-amber-300 hover:bg-slate-800 font-bold"}," 🎖️ Tier List Ranking (S, A, B, C) ")])])])]),s.isAutoTopicLoading?(C(),O("div",ps,[i("div",fs,[R(u(Je),{class:"w-3.5 h-3.5 text-sky-400 animate-spin"})]),i("div",hs,[i("div",ms,[o[48]||(o[48]=i("span",null,"AI Research Engine Sedang Bekerja...",-1)),i("span",gs,Z(u(d)),1)]),o[49]||(o[49]=i("p",{class:"text-[10px] text-slate-300 mt-0.5"},"Menganalisis angka perbandingan 2026 & meracik copywriting viral.",-1))])])):G("",!0),i("div",ys,[i("div",vs,[i("button",{onClick:o[17]||(o[17]=p=>m.value="editor"),class:D(["px-3 py-1 rounded-lg transition text-[11px]",u(m)==="editor"?"bg-slate-800 text-sky-400 shadow":"text-slate-400 hover:text-white"])}," JSON Editor ",2),i("button",{onClick:o[18]||(o[18]=p=>m.value="drafts"),class:D(["px-3 py-1 rounded-lg transition flex items-center gap-1.5 text-[11px]",u(m)==="drafts"?"bg-slate-800 text-purple-400 shadow":"text-slate-400 hover:text-white"])},[R(u(Nt),{class:"w-3 h-3"}),i("span",null,"Drafts Deck ("+Z(s.drafts.length)+")",1)],2)]),i("button",{onClick:o[19]||(o[19]=p=>a("saveDraft")),class:"text-[10px] text-slate-400 hover:text-sky-400 transition pr-2 font-bold"}," + Save to Drafts ")]),u(m)==="drafts"?(C(),O("div",xs,[s.drafts.length===0?(C(),O("div",bs,' Belum ada draft tersimpan. Klik "Auto-Topic" untuk mengumpulkan berbagai ide! ')):G("",!0),(C(!0),O(Se,null,Te(s.drafts,(p,se)=>(C(),O("div",{key:se,onClick:le=>a("selectDraft",se),class:D(["p-2 rounded-xl border cursor-pointer transition flex items-center justify-between text-xs group",s.activeDraftIndex===se?"bg-sky-500/15 border-sky-500/50 text-white":"bg-slate-950/60 border-slate-800 text-slate-300 hover:border-slate-700"])},[i("div",_s,[i("div",ws,[i("span",{class:D(["px-1.5 py-0.2 rounded text-[8px] font-bold uppercase",p.layoutType==="news"?"bg-rose-500/20 text-rose-300 border border-rose-500/30":p.layoutType==="versus"?"bg-orange-500/20 text-orange-300 border border-orange-500/30":p.layoutType==="receipt"?"bg-teal-500/20 text-teal-300 border border-teal-500/30":p.layoutType==="stat"?"bg-amber-500/20 text-amber-300 border border-amber-500/30":p.layoutType==="timeline"?"bg-yellow-500/20 text-yellow-300 border border-yellow-500/30":p.layoutType==="barchart"?"bg-cyan-500/20 text-cyan-300 border border-cyan-500/30":p.layoutType==="list"?"bg-emerald-500/20 text-emerald-300 border border-emerald-500/30":p.layoutType==="quote"?"bg-purple-500/20 text-purple-300 border border-purple-500/30":"bg-sky-500/20 text-sky-300 border border-sky-500/30"])},Z(p.layoutType||"table"),3),i("span",Cs,Z(p.category),1)]),i("div",Ss,Z(p.title),1)]),i("button",{onClick:Tt(le=>a("deleteDraft",se),["stop"]),class:"opacity-0 group-hover:opacity-100 p-1 text-slate-400 hover:text-rose-400 transition rounded"},[R(u(Ut),{class:"w-3 h-3"})],8,Ts)],10,ks))),128))])):(C(),O("div",As,[i("div",$s,[i("div",null,[i("label",Is,[R(u(Vt),{class:"w-3 h-3 text-sky-400"}),o[50]||(o[50]=X(" Format Template ",-1))]),i("select",{value:s.modelValue.layoutType||"table",onChange:o[20]||(o[20]=p=>Y(p.target.value)),class:"w-full bg-slate-900 border border-slate-800 rounded-lg p-1.5 text-slate-200 focus:outline-none focus:border-sky-500 font-semibold text-[11px]"},[...o[51]||(o[51]=[He('<option value="table">📊 Comparison Table</option><option value="versus">⚔️ Versus Showdown Arena</option><option value="receipt">🧾 Monthly Living Invoice</option><option value="news">📰 Special Report Pamphlet</option><option value="stat">🎯 Big Shocking Number</option><option value="timeline">⏳ 10-Year Shift (Then vs Now)</option><option value="barchart">📈 Income Allocation Bars</option><option value="list">🏆 Top 5 Ranked List</option><option value="quote">💬 Hot Take / Quote Debate</option><option value="leaderboard">🥇 Multi-Country Leaderboard (Top 10)</option><option value="editorial">📰 Editorial Storytelling Deep Dive</option><option value="matrix">📊 Multi-Column Matrix (3-4 Negara)</option><option value="debate">⚡ Debate Arena (Pro vs Kontra)</option><option value="tierlist">🎖️ Tier List Ranking (S, A, B, C)</option>',14)])],40,Os)]),i("div",null,[o[53]||(o[53]=i("label",{class:"block text-[10px] font-bold text-slate-300 mb-1"}," Theme Color ",-1)),i("select",{value:s.modelValue.theme||"blue-tech",onChange:o[21]||(o[21]=p=>vt(p.target.value)),class:"w-full bg-slate-900 border border-slate-800 rounded-lg p-1.5 text-slate-200 focus:outline-none focus:border-sky-500 font-semibold text-[11px]"},[...o[52]||(o[52]=[He('<option value="blue-tech">🔵 Blue Tech (Software / AI)</option><option value="emerald-finance">🟢 Emerald Finance (Salaries / Living)</option><option value="slate-education">🟣 Slate Education (Schools / Public)</option><option value="dark-contrast">⚫ Dark Contrast (Universal / Bold)</option><option value="crimson-alert">🔴 Crimson Alert (Breaking / Shock)</option>',5)])],40,Ns)]),i("div",Rs,[i("div",Ms,[o[54]||(o[54]=i("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"}," Watermark Handle ",-1)),i("input",{type:"text",value:s.modelValue.watermark||"@SocialGen",onInput:o[22]||(o[22]=p=>L(p.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,js)]),i("div",Zs,[o[55]||(o[55]=i("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"}," Judul Konten (Title) ",-1)),i("input",{type:"text",value:s.modelValue.title,onInput:o[23]||(o[23]=p=>te(p.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,Es)])])]),i("div",Ds,[i("div",Vs,[o[58]||(o[58]=i("span",{class:"font-bold text-slate-300 text-[10px]"},"RAW JSON",-1)),s.isValid&&!u(r)?(C(),O("span",Ps,[R(u(Mt),{class:"w-2.5 h-2.5"}),o[56]||(o[56]=X(" Valid ",-1))])):(C(),O("span",Ls,[R(u(Rt),{class:"w-2.5 h-2.5"}),o[57]||(o[57]=X(" Invalid ",-1))]))]),i("button",{onClick:I,class:"text-[10px] text-slate-400 hover:text-sky-400 transition"}," Format JSON ")]),i("div",zs,[i("textarea",{value:u(n),onInput:T,rows:"7",spellcheck:"false",class:"w-full bg-slate-950 text-sky-200 text-[11px] font-mono p-2.5 rounded-xl border border-slate-800 focus:outline-none focus:border-sky-500/50 resize-y leading-relaxed",placeholder:"Paste Content JSON here..."},null,40,Fs),u(r)||s.validationError?(C(),O("p",Bs," ⚠️ "+Z(u(r)||s.validationError),1)):G("",!0)])])),i("input",{type:"file",ref_key:"videoInputRef",ref:U,accept:"video/mp4,video/webm",class:"hidden",onChange:o[24]||(o[24]=p=>_e(p))},null,544),i("input",{type:"file",ref_key:"audioInputRef",ref:K,accept:"audio/mp3,audio/mpeg,audio/wav",class:"hidden",onChange:o[25]||(o[25]=p=>_e(p))},null,544),i("div",Us,[i("div",Gs,[i("label",Hs,[R(u(Et),{class:"w-3.5 h-3.5 text-sky-400"}),o[59]||(o[59]=i("span",null,"Background",-1))]),i("div",qs,[i("select",{value:s.options.backgroundSource||"random",onChange:o[26]||(o[26]=p=>we("backgroundSource",p.target.value)),class:"bg-slate-950 border border-slate-800 rounded-lg px-2 py-1 text-slate-300 text-[11px] focus:outline-none max-w-[170px]"},[o[60]||(o[60]=i("option",{value:"random"},"🔀 Acak Video",-1)),(C(!0),O(Se,null,Te(u(F),p=>(C(),O("option",{key:p,value:p},Z(p.replace(".mp4","").replace(/_/g," ")),9,Ws))),128)),o[61]||(o[61]=i("option",{value:"pexels"},"🌐 Pexels API (Auto HD)",-1))],40,Js),i("button",{onClick:o[27]||(o[27]=p=>u(U)?.click()),disabled:u(B),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"},[R(u(We),{class:"w-3 h-3"}),i("span",Ys,Z(u(B)?"...":"Upload"),1)],8,Ks)])]),i("div",Qs,[i("label",Xs,[R(u(Pt),{class:"w-3.5 h-3.5 text-purple-400"}),o[62]||(o[62]=i("span",null,"Musik Reels",-1))]),i("div",ea,[i("select",{value:s.options.musicFile||"random",onChange:o[28]||(o[28]=p=>we("musicFile",p.target.value)),class:"bg-slate-950 border border-slate-800 rounded-lg px-2 py-1 text-slate-300 text-[11px] focus:outline-none max-w-[170px]"},[o[63]||(o[63]=i("option",{value:"random"},"🔀 Acak Musik",-1)),(C(!0),O(Se,null,Te(u(w),p=>(C(),O("option",{key:p,value:p},Z(p.replace(".mp3","").replace(/_/g," ")),9,sa))),128))],40,ta),i("button",{onClick:o[29]||(o[29]=p=>u(K)?.click()),disabled:u(B),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"},[R(u(We),{class:"w-3 h-3"}),i("span",na,Z(u(B)?"...":"Upload"),1)],8,aa)])]),i("div",ra,[i("label",ia,[R(u(jt),{class:"w-3.5 h-3.5 text-emerald-400"}),o[64]||(o[64]=i("span",null,"Durasi Reels:",-1))]),i("div",oa,[(C(),O(Se,null,Te([7,10,15,30,60],p=>i("button",{key:p,onClick:se=>xt(p),class:D(["px-2 py-0.5 text-[10px] font-bold rounded-lg border transition",(s.modelValue.reelsDuration||10)===p?"bg-emerald-500/20 border-emerald-500/60 text-emerald-300":"bg-slate-950 border-slate-800 text-slate-400 hover:text-white"])},Z(p===60?"1m":p+"s"),11,la)),64))])]),i("div",da,[i("label",{class:D(["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"])},[i("input",{type:"checkbox",checked:s.options.outputs?.feed!==!1,onChange:o[30]||(o[30]=p=>Me("feed",p.target.checked)),class:"rounded text-sky-500 focus:ring-0 bg-slate-900 border-slate-700 w-3 h-3"},null,40,ua),o[65]||(o[65]=i("span",{class:"font-bold"},"Feed 4:5",-1))],2),i("label",{class:D(["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"])},[i("input",{type:"checkbox",checked:s.options.outputs?.story!==!1,onChange:o[31]||(o[31]=p=>Me("story",p.target.checked)),class:"rounded text-indigo-500 focus:ring-0 bg-slate-900 border-slate-700 w-3 h-3"},null,40,ca),o[66]||(o[66]=i("span",{class:"font-bold"},"Story 9:16",-1))],2),i("label",{class:D(["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"])},[i("input",{type:"checkbox",checked:s.options.outputs?.reels!==!1,onChange:o[32]||(o[32]=p=>Me("reels",p.target.checked)),class:"rounded text-emerald-500 focus:ring-0 bg-slate-900 border-slate-700 w-3 h-3"},null,40,pa),o[67]||(o[67]=i("span",{class:"font-bold"},"Reels MP4",-1))],2)])]),i("button",{onClick:o[33]||(o[33]=p=>a("generate")),disabled:!s.isValid||s.isGenerating||!!u(r),class:D(["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||u(r)?"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?(C(),ce(u(zt),{key:0,class:"w-3.5 h-3.5 animate-spin"})):(C(),ce(u(Lt),{key:1,class:"w-3.5 h-3.5 fill-current"})),i("span",null,Z(s.isGenerating?s.generateStage||"Rendering Content...":"GENERATE CONTENT"),1)],10,fa)]))}}),ma={class:"flex flex-col gap-3 h-full text-slate-100 min-h-0 justify-between"},ga={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"},ya={class:"flex items-center gap-1 bg-slate-950 p-1 rounded-xl border border-slate-800 text-xs font-bold"},va={class:"flex items-center gap-2 text-xs"},xa={class:"flex items-center gap-1 bg-slate-950 p-1 rounded-xl border border-slate-800 text-xs shadow-inner"},ba={key:0,class:"relative shadow-2xl rounded-2xl overflow-hidden border border-slate-700/80 flex-shrink-0",style:{width:"360px",height:"450px"}},ka={style:{width:"1080px",height:"1350px",transform:"scale(0.333333)","transform-origin":"top left"}},_a={key:1,class:"relative shadow-2xl rounded-2xl overflow-hidden border border-slate-700/80 flex-shrink-0",style:{width:"300px",height:"533.33px"}},wa={key:0,class:"absolute inset-0 z-0 bg-slate-950 overflow-hidden"},Ca=["src"],Sa={class:"relative z-10",style:{width:"1080px",height:"1920px",transform:"scale(0.277778)","transform-origin":"top left"}},Ta={key:1,class:"absolute inset-0 z-20 pointer-events-none flex flex-col justify-between"},Aa={class:"flex-1 flex justify-end p-2"},$a={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"},Ia={class:"flex flex-col bg-slate-900/90 border border-slate-800 rounded-2xl p-3 gap-1.5 shadow-lg flex-shrink-0"},Oa={class:"flex items-center justify-between text-xs"},Na=["value"],Ra={key:0,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"},Ma={class:"flex items-center gap-2 text-xs font-black text-emerald-300"},ja={class:"text-[11px] text-slate-400 font-mono mt-0.5"},Za={class:"flex items-center gap-2"},Ea=["href"],Da=["disabled"],Va=Ue({__name:"LivePreview",props:{data:{},selectedVideo:{},generatedResult:{}},setup(s){const e=s,t=ft(()=>e.selectedVideo&&e.selectedVideo!=="pexels"?`/videos/${e.selectedVideo}`:"/videos/default_bg.mp4"),a=A("feed"),n=A(!1),r=A(!1),l=A(!1),d=A(1);function m(){d.value<2.5&&(d.value=Math.min(2.5,+(d.value+.15).toFixed(2)))}function g(){d.value>.5&&(d.value=Math.max(.5,+(d.value-.15).toFixed(2)))}function _(){d.value=1}function P(F){(F.ctrlKey||F.metaKey)&&(F.preventDefault(),F.deltaY<0?m():g())}function J(){e.data.caption&&(navigator.clipboard.writeText(e.data.caption),r.value=!0,setTimeout(()=>{r.value=!1},2e3))}async function W(){if(e.generatedResult){l.value=!0;try{await $fetch("/api/open-folder",{method:"POST",body:{jobId:e.generatedResult.jobId,resultDir:e.generatedResult.resultDir}})}catch(F){console.error("Failed to open folder:",F)}finally{l.value=!1}}}return(F,w)=>{const B=$t;return C(),O("div",ma,[i("div",ga,[i("div",ya,[i("button",{onClick:w[0]||(w[0]=U=>a.value="feed"),class:D(["px-3 py-1.5 rounded-lg transition",u(a)==="feed"?"bg-sky-500 text-white shadow-md":"text-slate-400 hover:text-white"])}," Feed 4:5 ",2),i("button",{onClick:w[1]||(w[1]=U=>a.value="story"),class:D(["px-3 py-1.5 rounded-lg transition",u(a)==="story"?"bg-indigo-500 text-white shadow-md":"text-slate-400 hover:text-white"])}," Story 9:16 ",2),i("button",{onClick:w[2]||(w[2]=U=>a.value="reels"),class:D(["px-3 py-1.5 rounded-lg transition",u(a)==="reels"?"bg-emerald-500 text-white shadow-md":"text-slate-400 hover:text-white"])}," Reels 9:16 (Video) ",2)]),i("div",va,[i("div",xa,[i("button",{onClick:g,title:"Zoom Out (-15%)",class:"p-1.5 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800 transition"},[R(u(Jt),{class:"w-3.5 h-3.5"})]),i("button",{onClick:_,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"},Z(Math.round(u(d)*100))+"% ",1),i("button",{onClick:m,title:"Zoom In (+15%)",class:"p-1.5 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800 transition"},[R(u(qt),{class:"w-3.5 h-3.5"})]),u(d)!==1?(C(),O("button",{key:0,onClick:_,title:"Reset ke Ukuran Pas",class:"p-1.5 rounded-lg text-amber-400 hover:bg-slate-800 transition"},[R(u(Ft),{class:"w-3.5 h-3.5"})])):G("",!0)]),u(a)!=="feed"?(C(),O("button",{key:0,onClick:w[3]||(w[3]=U=>n.value=!u(n)),class:D(["inline-flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border text-xs font-bold transition",u(n)?"bg-amber-500/20 text-amber-300 border-amber-500/50":"bg-slate-950 text-slate-400 border-slate-800"])},[R(u(Bt),{class:"w-3.5 h-3.5"}),w[5]||(w[5]=i("span",null,"Safe Zones",-1))],2)):G("",!0)])]),i("div",{onWheel:P,class:"relative flex-1 min-h-0 bg-slate-950/80 border border-slate-800/80 rounded-2xl flex items-center justify-center p-4 overflow-auto shadow-inner custom-scrollbar"},[i("div",{class:"transition-transform duration-200 ease-out origin-center flex-shrink-0",style:At({transform:`scale(${u(d)})`})},[u(a)==="feed"?(C(),O("div",ba,[i("div",ka,[R(B,{data:s.data,mode:"feed","is-render":!0},null,8,["data"])])])):(C(),O("div",_a,[u(a)==="reels"?(C(),O("div",wa,[(C(),O("video",{key:u(t),autoplay:"",loop:"",muted:"",playsinline:"",class:"w-full h-full object-cover brightness-90 contrast-105",src:u(t)},null,8,Ca)),w[6]||(w[6]=i("div",{class:"absolute inset-0 bg-slate-950/30 backdrop-blur-[0.5px]"},null,-1))])):G("",!0),i("div",Sa,[R(B,{data:s.data,mode:u(a)==="reels"?"overlay":"story","is-render":!0},null,8,["data","mode"])]),u(n)?(C(),O("div",Ta,[w[8]||(w[8]=i("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)),i("div",Aa,[u(a)==="reels"?(C(),O("div",$a,[...w[7]||(w[7]=[i("span",null,"❤️ Like",-1),i("span",null,"💬 Comm",-1),i("span",null,"↗️ Share",-1)])])):G("",!0)]),w[9]||(w[9]=i("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))])):G("",!0)]))],4)],32),i("div",Ia,[i("div",Oa,[w[10]||(w[10]=i("span",{class:"font-extrabold text-slate-300 text-[11px]"},"VIRAL CAPTION & HASHTAGS",-1)),i("button",{onClick:J,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"},[u(r)?(C(),ce(u(Ve),{key:0,class:"w-3.5 h-3.5 text-emerald-400"})):(C(),ce(u(ht),{key:1,class:"w-3.5 h-3.5"})),i("span",null,Z(u(r)?"Tersalin!":"Copy Caption"),1)])]),i("textarea",{value:s.data.caption,onInput:w[4]||(w[4]=U=>s.data.caption=U.target.value),rows:"2",class:"w-full bg-slate-950 text-slate-200 text-xs p-2.5 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,Na)]),s.generatedResult?(C(),O("div",Ra,[i("div",null,[i("div",Ma,[R(u(Ve),{class:"w-4 h-4 text-emerald-400"}),X(" Render Selesai ("+Z((s.generatedResult.durationMs/1e3).toFixed(1))+"s) ",1)]),i("div",ja,Z(s.generatedResult.jobId),1)]),i("div",Za,[i("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"},[R(u(Zt),{class:"w-3.5 h-3.5"}),w[11]||(w[11]=i("span",null,"Download ZIP",-1))],8,Ea),i("button",{onClick:W,disabled:u(l),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"},[R(u(Dt),{class:"w-3.5 h-3.5 text-amber-400"}),w[12]||(w[12]=i("span",null,"Open Folder",-1))],8,Da)])])):G("",!0)])}}});var N;(function(s){s.assertEqual=n=>{};function e(n){}s.assertIs=e;function t(n){throw new Error}s.assertNever=t,s.arrayToEnum=n=>{const r={};for(const l of n)r[l]=l;return r},s.getValidEnumValues=n=>{const r=s.objectKeys(n).filter(d=>typeof n[n[d]]!="number"),l={};for(const d of r)l[d]=n[d];return s.objectValues(l)},s.objectValues=n=>s.objectKeys(n).map(function(r){return n[r]}),s.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{const r=[];for(const l in n)Object.prototype.hasOwnProperty.call(n,l)&&r.push(l);return r},s.find=(n,r)=>{for(const l of n)if(r(l))return l},s.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&Number.isFinite(n)&&Math.floor(n)===n;function a(n,r=" | "){return n.map(l=>typeof l=="string"?`'${l}'`:l).join(r)}s.joinValues=a,s.jsonStringifyReplacer=(n,r)=>typeof r=="bigint"?r.toString():r})(N||(N={}));var Ke;(function(s){s.mergeShapes=(e,t)=>({...e,...t})})(Ke||(Ke={}));const y=N.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ae=s=>{switch(typeof s){case"undefined":return y.undefined;case"string":return y.string;case"number":return Number.isNaN(s)?y.nan:y.number;case"boolean":return y.boolean;case"function":return y.function;case"bigint":return y.bigint;case"symbol":return y.symbol;case"object":return Array.isArray(s)?y.array:s===null?y.null:s.then&&typeof s.then=="function"&&s.catch&&typeof s.catch=="function"?y.promise:typeof Map<"u"&&s instanceof Map?y.map:typeof Set<"u"&&s instanceof Set?y.set:typeof Date<"u"&&s instanceof Date?y.date:y.object;default:return y.unknown}},c=N.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 ee extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(r){return r.message},a={_errors:[]},n=r=>{for(const l of r.issues)if(l.code==="invalid_union")l.unionErrors.map(n);else if(l.code==="invalid_return_type")n(l.returnTypeError);else if(l.code==="invalid_arguments")n(l.argumentsError);else if(l.path.length===0)a._errors.push(t(l));else{let d=a,m=0;for(;m<l.path.length;){const g=l.path[m];m===l.path.length-1?(d[g]=d[g]||{_errors:[]},d[g]._errors.push(t(l))):d[g]=d[g]||{_errors:[]},d=d[g],m++}}};return n(this),a}static assert(e){if(!(e instanceof ee))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,N.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},a=[];for(const n of this.issues)if(n.path.length>0){const r=n.path[0];t[r]=t[r]||[],t[r].push(e(n))}else a.push(e(n));return{formErrors:a,fieldErrors:t}}get formErrors(){return this.flatten()}}ee.create=s=>new ee(s);const Pe=(s,e)=>{let t;switch(s.code){case c.invalid_type:s.received===y.undefined?t="Required":t=`Expected ${s.expected}, received ${s.received}`;break;case c.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(s.expected,N.jsonStringifyReplacer)}`;break;case c.unrecognized_keys:t=`Unrecognized key(s) in object: ${N.joinValues(s.keys,", ")}`;break;case c.invalid_union:t="Invalid input";break;case c.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${N.joinValues(s.options)}`;break;case c.invalid_enum_value:t=`Invalid enum value. Expected ${N.joinValues(s.options)}, received '${s.received}'`;break;case c.invalid_arguments:t="Invalid function arguments";break;case c.invalid_return_type:t="Invalid function return type";break;case c.invalid_date:t="Invalid date";break;case c.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}"`:N.assertNever(s.validation):s.validation!=="regex"?t=`Invalid ${s.validation}`:t="Invalid";break;case c.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 c.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 c.custom:t="Invalid input";break;case c.invalid_intersection_types:t="Intersection results could not be merged";break;case c.not_multiple_of:t=`Number must be a multiple of ${s.multipleOf}`;break;case c.not_finite:t="Number must be finite";break;default:t=e.defaultError,N.assertNever(s)}return{message:t}};let Pa=Pe;function La(){return Pa}const za=s=>{const{data:e,path:t,errorMaps:a,issueData:n}=s,r=[...t,...n.path||[]],l={...n,path:r};if(n.message!==void 0)return{...n,path:r,message:n.message};let d="";const m=a.filter(g=>!!g).slice().reverse();for(const g of m)d=g(l,{data:e,defaultError:d}).message;return{...n,path:r,message:d}};function h(s,e){const t=La(),a=za({issueData:e,data:s.data,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,t,t===Pe?void 0:Pe].filter(n=>!!n)});s.common.issues.push(a)}class H{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const a=[];for(const n of t){if(n.status==="aborted")return b;n.status==="dirty"&&e.dirty(),a.push(n.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,t){const a=[];for(const n of t){const r=await n.key,l=await n.value;a.push({key:r,value:l})}return H.mergeObjectSync(e,a)}static mergeObjectSync(e,t){const a={};for(const n of t){const{key:r,value:l}=n;if(r.status==="aborted"||l.status==="aborted")return b;r.status==="dirty"&&e.dirty(),l.status==="dirty"&&e.dirty(),r.value!=="__proto__"&&(typeof l.value<"u"||n.alwaysSet)&&(a[r.value]=l.value)}return{status:e.value,value:a}}}const b=Object.freeze({status:"aborted"}),ve=s=>({status:"dirty",value:s}),q=s=>({status:"valid",value:s}),Ye=s=>s.status==="aborted",Qe=s=>s.status==="dirty",pe=s=>s.status==="valid",$e=s=>typeof Promise<"u"&&s instanceof Promise;var v;(function(s){s.errToObj=e=>typeof e=="string"?{message:e}:e||{},s.toString=e=>typeof e=="string"?e:e?.message})(v||(v={}));class ie{constructor(e,t,a,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=a,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Xe=(s,e)=>{if(pe(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 ee(s.common.issues);return this._error=t,this._error}}};function S(s){if(!s)return{};const{errorMap:e,invalid_type_error:t,required_error:a,description:n}=s;if(e&&(t||a))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(l,d)=>{const{message:m}=s;return l.code==="invalid_enum_value"?{message:m??d.defaultError}:typeof d.data>"u"?{message:m??a??d.defaultError}:l.code!=="invalid_type"?{message:d.defaultError}:{message:m??t??d.defaultError}},description:n}}class ${get description(){return this._def.description}_getType(e){return ae(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:ae(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new H,ctx:{common:e.parent.common,data:e.data,parsedType:ae(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if($e(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 a=this.safeParse(e,t);if(a.success)return a.data;throw a.error}safeParse(e,t){const a={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ae(e)},n=this._parseSync({data:e,path:a.path,parent:a});return Xe(a,n)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ae(e)};if(!this["~standard"].async)try{const a=this._parseSync({data:e,path:[],parent:t});return pe(a)?{value:a.value}:{issues:t.common.issues}}catch(a){a?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(a=>pe(a)?{value:a.value}:{issues:t.common.issues})}async parseAsync(e,t){const a=await this.safeParseAsync(e,t);if(a.success)return a.data;throw a.error}async safeParseAsync(e,t){const a={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ae(e)},n=this._parse({data:e,path:a.path,parent:a}),r=await($e(n)?n:Promise.resolve(n));return Xe(a,r)}refine(e,t){const a=n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t;return this._refinement((n,r)=>{const l=e(n),d=()=>r.addIssue({code:c.custom,...a(n)});return typeof Promise<"u"&&l instanceof Promise?l.then(m=>m?!0:(d(),!1)):l?!0:(d(),!1)})}refinement(e,t){return this._refinement((a,n)=>e(a)?!0:(n.addIssue(typeof t=="function"?t(a,n):t),!1))}_refinement(e){return new me({schema:this,typeName:k.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 re.create(this,this._def)}nullable(){return ge.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Q.create(this)}promise(){return Re.create(this,this._def)}or(e){return Oe.create([this,e],this._def)}and(e){return Ne.create(this,e,this._def)}transform(e){return new me({...S(this._def),schema:this,typeName:k.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new ze({...S(this._def),innerType:this,defaultValue:t,typeName:k.ZodDefault})}brand(){return new cn({typeName:k.ZodBranded,type:this,...S(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new Fe({...S(this._def),innerType:this,catchValue:t,typeName:k.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Ge.create(this,e)}readonly(){return Be.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Fa=/^c[^\s-]{8,}$/i,Ba=/^[0-9a-z]+$/,Ua=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Ga=/^[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,Ha=/^[a-z0-9_-]{21}$/i,qa=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Ja=/^[-+]?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)?)??$/,Wa=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Ka="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let je;const Ya=/^(?:(?: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])$/,Qa=/^(?:(?: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])$/,Xa=/^(([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]))$/,en=/^(([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])$/,tn=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,sn=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,mt="((\\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])))",an=new RegExp(`^${mt}$`);function gt(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 nn(s){return new RegExp(`^${gt(s)}$`)}function rn(s){let e=`${mt}T${gt(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 on(s,e){return!!((e==="v4"||!e)&&Ya.test(s)||(e==="v6"||!e)&&Xa.test(s))}function ln(s,e){if(!qa.test(s))return!1;try{const[t]=s.split(".");if(!t)return!1;const a=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),n=JSON.parse(atob(a));return!(typeof n!="object"||n===null||"typ"in n&&n?.typ!=="JWT"||!n.alg||e&&n.alg!==e)}catch{return!1}}function dn(s,e){return!!((e==="v4"||!e)&&Qa.test(s)||(e==="v6"||!e)&&en.test(s))}class ne extends ${_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==y.string){const r=this._getOrReturnCtx(e);return h(r,{code:c.invalid_type,expected:y.string,received:r.parsedType}),b}const a=new H;let n;for(const r of this._def.checks)if(r.kind==="min")e.data.length<r.value&&(n=this._getOrReturnCtx(e,n),h(n,{code:c.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),a.dirty());else if(r.kind==="max")e.data.length>r.value&&(n=this._getOrReturnCtx(e,n),h(n,{code:c.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),a.dirty());else if(r.kind==="length"){const l=e.data.length>r.value,d=e.data.length<r.value;(l||d)&&(n=this._getOrReturnCtx(e,n),l?h(n,{code:c.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}):d&&h(n,{code:c.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}),a.dirty())}else if(r.kind==="email")Wa.test(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{validation:"email",code:c.invalid_string,message:r.message}),a.dirty());else if(r.kind==="emoji")je||(je=new RegExp(Ka,"u")),je.test(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{validation:"emoji",code:c.invalid_string,message:r.message}),a.dirty());else if(r.kind==="uuid")Ga.test(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{validation:"uuid",code:c.invalid_string,message:r.message}),a.dirty());else if(r.kind==="nanoid")Ha.test(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{validation:"nanoid",code:c.invalid_string,message:r.message}),a.dirty());else if(r.kind==="cuid")Fa.test(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{validation:"cuid",code:c.invalid_string,message:r.message}),a.dirty());else if(r.kind==="cuid2")Ba.test(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{validation:"cuid2",code:c.invalid_string,message:r.message}),a.dirty());else if(r.kind==="ulid")Ua.test(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{validation:"ulid",code:c.invalid_string,message:r.message}),a.dirty());else if(r.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),h(n,{validation:"url",code:c.invalid_string,message:r.message}),a.dirty()}else r.kind==="regex"?(r.regex.lastIndex=0,r.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{validation:"regex",code:c.invalid_string,message:r.message}),a.dirty())):r.kind==="trim"?e.data=e.data.trim():r.kind==="includes"?e.data.includes(r.value,r.position)||(n=this._getOrReturnCtx(e,n),h(n,{code:c.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),a.dirty()):r.kind==="toLowerCase"?e.data=e.data.toLowerCase():r.kind==="toUpperCase"?e.data=e.data.toUpperCase():r.kind==="startsWith"?e.data.startsWith(r.value)||(n=this._getOrReturnCtx(e,n),h(n,{code:c.invalid_string,validation:{startsWith:r.value},message:r.message}),a.dirty()):r.kind==="endsWith"?e.data.endsWith(r.value)||(n=this._getOrReturnCtx(e,n),h(n,{code:c.invalid_string,validation:{endsWith:r.value},message:r.message}),a.dirty()):r.kind==="datetime"?rn(r).test(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{code:c.invalid_string,validation:"datetime",message:r.message}),a.dirty()):r.kind==="date"?an.test(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{code:c.invalid_string,validation:"date",message:r.message}),a.dirty()):r.kind==="time"?nn(r).test(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{code:c.invalid_string,validation:"time",message:r.message}),a.dirty()):r.kind==="duration"?Ja.test(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{validation:"duration",code:c.invalid_string,message:r.message}),a.dirty()):r.kind==="ip"?on(e.data,r.version)||(n=this._getOrReturnCtx(e,n),h(n,{validation:"ip",code:c.invalid_string,message:r.message}),a.dirty()):r.kind==="jwt"?ln(e.data,r.alg)||(n=this._getOrReturnCtx(e,n),h(n,{validation:"jwt",code:c.invalid_string,message:r.message}),a.dirty()):r.kind==="cidr"?dn(e.data,r.version)||(n=this._getOrReturnCtx(e,n),h(n,{validation:"cidr",code:c.invalid_string,message:r.message}),a.dirty()):r.kind==="base64"?tn.test(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{validation:"base64",code:c.invalid_string,message:r.message}),a.dirty()):r.kind==="base64url"?sn.test(e.data)||(n=this._getOrReturnCtx(e,n),h(n,{validation:"base64url",code:c.invalid_string,message:r.message}),a.dirty()):N.assertNever(r);return{status:a.value,value:e.data}}_regex(e,t,a){return this.refinement(n=>e.test(n),{validation:t,code:c.invalid_string,...v.errToObj(a)})}_addCheck(e){return new ne({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...v.errToObj(e)})}url(e){return this._addCheck({kind:"url",...v.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...v.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...v.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...v.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...v.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...v.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...v.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...v.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...v.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...v.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...v.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...v.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,...v.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,...v.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...v.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...v.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...v.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...v.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...v.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...v.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...v.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...v.errToObj(t)})}nonempty(e){return this.min(1,v.errToObj(e))}trim(){return new ne({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ne({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ne({...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}}ne.create=s=>new ne({checks:[],typeName:k.ZodString,coerce:s?.coerce??!1,...S(s)});function un(s,e){const t=(s.toString().split(".")[1]||"").length,a=(e.toString().split(".")[1]||"").length,n=t>a?t:a,r=Number.parseInt(s.toFixed(n).replace(".","")),l=Number.parseInt(e.toFixed(n).replace(".",""));return r%l/10**n}class fe extends ${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)!==y.number){const r=this._getOrReturnCtx(e);return h(r,{code:c.invalid_type,expected:y.number,received:r.parsedType}),b}let a;const n=new H;for(const r of this._def.checks)r.kind==="int"?N.isInteger(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{code:c.invalid_type,expected:"integer",received:"float",message:r.message}),n.dirty()):r.kind==="min"?(r.inclusive?e.data<r.value:e.data<=r.value)&&(a=this._getOrReturnCtx(e,a),h(a,{code:c.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind==="max"?(r.inclusive?e.data>r.value:e.data>=r.value)&&(a=this._getOrReturnCtx(e,a),h(a,{code:c.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind==="multipleOf"?un(e.data,r.value)!==0&&(a=this._getOrReturnCtx(e,a),h(a,{code:c.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind==="finite"?Number.isFinite(e.data)||(a=this._getOrReturnCtx(e,a),h(a,{code:c.not_finite,message:r.message}),n.dirty()):N.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,v.toString(t))}gt(e,t){return this.setLimit("min",e,!1,v.toString(t))}lte(e,t){return this.setLimit("max",e,!0,v.toString(t))}lt(e,t){return this.setLimit("max",e,!1,v.toString(t))}setLimit(e,t,a,n){return new fe({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:v.toString(n)}]})}_addCheck(e){return new fe({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:v.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:v.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:v.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:v.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:v.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:v.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:v.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:v.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:v.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"&&N.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(t===null||a.value>t)&&(t=a.value):a.kind==="max"&&(e===null||a.value<e)&&(e=a.value)}return Number.isFinite(t)&&Number.isFinite(e)}}fe.create=s=>new fe({checks:[],typeName:k.ZodNumber,coerce:s?.coerce||!1,...S(s)});class xe extends ${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)!==y.bigint)return this._getInvalidInput(e);let a;const n=new H;for(const r of this._def.checks)r.kind==="min"?(r.inclusive?e.data<r.value:e.data<=r.value)&&(a=this._getOrReturnCtx(e,a),h(a,{code:c.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind==="max"?(r.inclusive?e.data>r.value:e.data>=r.value)&&(a=this._getOrReturnCtx(e,a),h(a,{code:c.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind==="multipleOf"?e.data%r.value!==BigInt(0)&&(a=this._getOrReturnCtx(e,a),h(a,{code:c.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):N.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return h(t,{code:c.invalid_type,expected:y.bigint,received:t.parsedType}),b}gte(e,t){return this.setLimit("min",e,!0,v.toString(t))}gt(e,t){return this.setLimit("min",e,!1,v.toString(t))}lte(e,t){return this.setLimit("max",e,!0,v.toString(t))}lt(e,t){return this.setLimit("max",e,!1,v.toString(t))}setLimit(e,t,a,n){return new xe({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:v.toString(n)}]})}_addCheck(e){return new xe({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:v.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:v.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:v.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:v.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:v.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}}xe.create=s=>new xe({checks:[],typeName:k.ZodBigInt,coerce:s?.coerce??!1,...S(s)});class et extends ${_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==y.boolean){const a=this._getOrReturnCtx(e);return h(a,{code:c.invalid_type,expected:y.boolean,received:a.parsedType}),b}return q(e.data)}}et.create=s=>new et({typeName:k.ZodBoolean,coerce:s?.coerce||!1,...S(s)});class Ie extends ${_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==y.date){const r=this._getOrReturnCtx(e);return h(r,{code:c.invalid_type,expected:y.date,received:r.parsedType}),b}if(Number.isNaN(e.data.getTime())){const r=this._getOrReturnCtx(e);return h(r,{code:c.invalid_date}),b}const a=new H;let n;for(const r of this._def.checks)r.kind==="min"?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),h(n,{code:c.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),a.dirty()):r.kind==="max"?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),h(n,{code:c.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),a.dirty()):N.assertNever(r);return{status:a.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Ie({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:v.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:v.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}}Ie.create=s=>new Ie({checks:[],coerce:s?.coerce||!1,typeName:k.ZodDate,...S(s)});class tt extends ${_parse(e){if(this._getType(e)!==y.symbol){const a=this._getOrReturnCtx(e);return h(a,{code:c.invalid_type,expected:y.symbol,received:a.parsedType}),b}return q(e.data)}}tt.create=s=>new tt({typeName:k.ZodSymbol,...S(s)});class st extends ${_parse(e){if(this._getType(e)!==y.undefined){const a=this._getOrReturnCtx(e);return h(a,{code:c.invalid_type,expected:y.undefined,received:a.parsedType}),b}return q(e.data)}}st.create=s=>new st({typeName:k.ZodUndefined,...S(s)});class at extends ${_parse(e){if(this._getType(e)!==y.null){const a=this._getOrReturnCtx(e);return h(a,{code:c.invalid_type,expected:y.null,received:a.parsedType}),b}return q(e.data)}}at.create=s=>new at({typeName:k.ZodNull,...S(s)});class nt extends ${constructor(){super(...arguments),this._any=!0}_parse(e){return q(e.data)}}nt.create=s=>new nt({typeName:k.ZodAny,...S(s)});class rt extends ${constructor(){super(...arguments),this._unknown=!0}_parse(e){return q(e.data)}}rt.create=s=>new rt({typeName:k.ZodUnknown,...S(s)});class oe extends ${_parse(e){const t=this._getOrReturnCtx(e);return h(t,{code:c.invalid_type,expected:y.never,received:t.parsedType}),b}}oe.create=s=>new oe({typeName:k.ZodNever,...S(s)});class it extends ${_parse(e){if(this._getType(e)!==y.undefined){const a=this._getOrReturnCtx(e);return h(a,{code:c.invalid_type,expected:y.void,received:a.parsedType}),b}return q(e.data)}}it.create=s=>new it({typeName:k.ZodVoid,...S(s)});class Q extends ${_parse(e){const{ctx:t,status:a}=this._processInputParams(e),n=this._def;if(t.parsedType!==y.array)return h(t,{code:c.invalid_type,expected:y.array,received:t.parsedType}),b;if(n.exactLength!==null){const l=t.data.length>n.exactLength.value,d=t.data.length<n.exactLength.value;(l||d)&&(h(t,{code:l?c.too_big:c.too_small,minimum:d?n.exactLength.value:void 0,maximum:l?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),a.dirty())}if(n.minLength!==null&&t.data.length<n.minLength.value&&(h(t,{code:c.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),a.dirty()),n.maxLength!==null&&t.data.length>n.maxLength.value&&(h(t,{code:c.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),a.dirty()),t.common.async)return Promise.all([...t.data].map((l,d)=>n.type._parseAsync(new ie(t,l,t.path,d)))).then(l=>H.mergeArray(a,l));const r=[...t.data].map((l,d)=>n.type._parseSync(new ie(t,l,t.path,d)));return H.mergeArray(a,r)}get element(){return this._def.type}min(e,t){return new Q({...this._def,minLength:{value:e,message:v.toString(t)}})}max(e,t){return new Q({...this._def,maxLength:{value:e,message:v.toString(t)}})}length(e,t){return new Q({...this._def,exactLength:{value:e,message:v.toString(t)}})}nonempty(e){return this.min(1,e)}}Q.create=(s,e)=>new Q({type:s,minLength:null,maxLength:null,exactLength:null,typeName:k.ZodArray,...S(e)});function ue(s){if(s instanceof E){const e={};for(const t in s.shape){const a=s.shape[t];e[t]=re.create(ue(a))}return new E({...s._def,shape:()=>e})}else return s instanceof Q?new Q({...s._def,type:ue(s.element)}):s instanceof re?re.create(ue(s.unwrap())):s instanceof ge?ge.create(ue(s.unwrap())):s instanceof de?de.create(s.items.map(e=>ue(e))):s}class E extends ${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=N.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==y.object){const g=this._getOrReturnCtx(e);return h(g,{code:c.invalid_type,expected:y.object,received:g.parsedType}),b}const{status:a,ctx:n}=this._processInputParams(e),{shape:r,keys:l}=this._getCached(),d=[];if(!(this._def.catchall instanceof oe&&this._def.unknownKeys==="strip"))for(const g in n.data)l.includes(g)||d.push(g);const m=[];for(const g of l){const _=r[g],P=n.data[g];m.push({key:{status:"valid",value:g},value:_._parse(new ie(n,P,n.path,g)),alwaysSet:g in n.data})}if(this._def.catchall instanceof oe){const g=this._def.unknownKeys;if(g==="passthrough")for(const _ of d)m.push({key:{status:"valid",value:_},value:{status:"valid",value:n.data[_]}});else if(g==="strict")d.length>0&&(h(n,{code:c.unrecognized_keys,keys:d}),a.dirty());else if(g!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const g=this._def.catchall;for(const _ of d){const P=n.data[_];m.push({key:{status:"valid",value:_},value:g._parse(new ie(n,P,n.path,_)),alwaysSet:_ in n.data})}}return n.common.async?Promise.resolve().then(async()=>{const g=[];for(const _ of m){const P=await _.key,J=await _.value;g.push({key:P,value:J,alwaysSet:_.alwaysSet})}return g}).then(g=>H.mergeObjectSync(a,g)):H.mergeObjectSync(a,m)}get shape(){return this._def.shape()}strict(e){return v.errToObj,new E({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,a)=>{const n=this._def.errorMap?.(t,a).message??a.defaultError;return t.code==="unrecognized_keys"?{message:v.errToObj(e).message??n}:{message:n}}}:{}})}strip(){return new E({...this._def,unknownKeys:"strip"})}passthrough(){return new E({...this._def,unknownKeys:"passthrough"})}extend(e){return new E({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new E({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:k.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new E({...this._def,catchall:e})}pick(e){const t={};for(const a of N.objectKeys(e))e[a]&&this.shape[a]&&(t[a]=this.shape[a]);return new E({...this._def,shape:()=>t})}omit(e){const t={};for(const a of N.objectKeys(this.shape))e[a]||(t[a]=this.shape[a]);return new E({...this._def,shape:()=>t})}deepPartial(){return ue(this)}partial(e){const t={};for(const a of N.objectKeys(this.shape)){const n=this.shape[a];e&&!e[a]?t[a]=n:t[a]=n.optional()}return new E({...this._def,shape:()=>t})}required(e){const t={};for(const a of N.objectKeys(this.shape))if(e&&!e[a])t[a]=this.shape[a];else{let r=this.shape[a];for(;r instanceof re;)r=r._def.innerType;t[a]=r}return new E({...this._def,shape:()=>t})}keyof(){return yt(N.objectKeys(this.shape))}}E.create=(s,e)=>new E({shape:()=>s,unknownKeys:"strip",catchall:oe.create(),typeName:k.ZodObject,...S(e)});E.strictCreate=(s,e)=>new E({shape:()=>s,unknownKeys:"strict",catchall:oe.create(),typeName:k.ZodObject,...S(e)});E.lazycreate=(s,e)=>new E({shape:s,unknownKeys:"strip",catchall:oe.create(),typeName:k.ZodObject,...S(e)});class Oe extends ${_parse(e){const{ctx:t}=this._processInputParams(e),a=this._def.options;function n(r){for(const d of r)if(d.result.status==="valid")return d.result;for(const d of r)if(d.result.status==="dirty")return t.common.issues.push(...d.ctx.common.issues),d.result;const l=r.map(d=>new ee(d.ctx.common.issues));return h(t,{code:c.invalid_union,unionErrors:l}),b}if(t.common.async)return Promise.all(a.map(async r=>{const l={...t,common:{...t.common,issues:[]},parent:null};return{result:await r._parseAsync({data:t.data,path:t.path,parent:l}),ctx:l}})).then(n);{let r;const l=[];for(const m of a){const g={...t,common:{...t.common,issues:[]},parent:null},_=m._parseSync({data:t.data,path:t.path,parent:g});if(_.status==="valid")return _;_.status==="dirty"&&!r&&(r={result:_,ctx:g}),g.common.issues.length&&l.push(g.common.issues)}if(r)return t.common.issues.push(...r.ctx.common.issues),r.result;const d=l.map(m=>new ee(m));return h(t,{code:c.invalid_union,unionErrors:d}),b}}get options(){return this._def.options}}Oe.create=(s,e)=>new Oe({options:s,typeName:k.ZodUnion,...S(e)});function Le(s,e){const t=ae(s),a=ae(e);if(s===e)return{valid:!0,data:s};if(t===y.object&&a===y.object){const n=N.objectKeys(e),r=N.objectKeys(s).filter(d=>n.indexOf(d)!==-1),l={...s,...e};for(const d of r){const m=Le(s[d],e[d]);if(!m.valid)return{valid:!1};l[d]=m.data}return{valid:!0,data:l}}else if(t===y.array&&a===y.array){if(s.length!==e.length)return{valid:!1};const n=[];for(let r=0;r<s.length;r++){const l=s[r],d=e[r],m=Le(l,d);if(!m.valid)return{valid:!1};n.push(m.data)}return{valid:!0,data:n}}else return t===y.date&&a===y.date&&+s==+e?{valid:!0,data:s}:{valid:!1}}class Ne extends ${_parse(e){const{status:t,ctx:a}=this._processInputParams(e),n=(r,l)=>{if(Ye(r)||Ye(l))return b;const d=Le(r.value,l.value);return d.valid?((Qe(r)||Qe(l))&&t.dirty(),{status:t.value,value:d.data}):(h(a,{code:c.invalid_intersection_types}),b)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([r,l])=>n(r,l)):n(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}Ne.create=(s,e,t)=>new Ne({left:s,right:e,typeName:k.ZodIntersection,...S(t)});class de extends ${_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==y.array)return h(a,{code:c.invalid_type,expected:y.array,received:a.parsedType}),b;if(a.data.length<this._def.items.length)return h(a,{code:c.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),b;!this._def.rest&&a.data.length>this._def.items.length&&(h(a,{code:c.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const r=[...a.data].map((l,d)=>{const m=this._def.items[d]||this._def.rest;return m?m._parse(new ie(a,l,a.path,d)):null}).filter(l=>!!l);return a.common.async?Promise.all(r).then(l=>H.mergeArray(t,l)):H.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new de({...this._def,rest:e})}}de.create=(s,e)=>{if(!Array.isArray(s))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new de({items:s,typeName:k.ZodTuple,rest:null,...S(e)})};class ot extends ${get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==y.map)return h(a,{code:c.invalid_type,expected:y.map,received:a.parsedType}),b;const n=this._def.keyType,r=this._def.valueType,l=[...a.data.entries()].map(([d,m],g)=>({key:n._parse(new ie(a,d,a.path,[g,"key"])),value:r._parse(new ie(a,m,a.path,[g,"value"]))}));if(a.common.async){const d=new Map;return Promise.resolve().then(async()=>{for(const m of l){const g=await m.key,_=await m.value;if(g.status==="aborted"||_.status==="aborted")return b;(g.status==="dirty"||_.status==="dirty")&&t.dirty(),d.set(g.value,_.value)}return{status:t.value,value:d}})}else{const d=new Map;for(const m of l){const g=m.key,_=m.value;if(g.status==="aborted"||_.status==="aborted")return b;(g.status==="dirty"||_.status==="dirty")&&t.dirty(),d.set(g.value,_.value)}return{status:t.value,value:d}}}}ot.create=(s,e,t)=>new ot({valueType:e,keyType:s,typeName:k.ZodMap,...S(t)});class be extends ${_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==y.set)return h(a,{code:c.invalid_type,expected:y.set,received:a.parsedType}),b;const n=this._def;n.minSize!==null&&a.data.size<n.minSize.value&&(h(a,{code:c.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),n.maxSize!==null&&a.data.size>n.maxSize.value&&(h(a,{code:c.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const r=this._def.valueType;function l(m){const g=new Set;for(const _ of m){if(_.status==="aborted")return b;_.status==="dirty"&&t.dirty(),g.add(_.value)}return{status:t.value,value:g}}const d=[...a.data.values()].map((m,g)=>r._parse(new ie(a,m,a.path,g)));return a.common.async?Promise.all(d).then(m=>l(m)):l(d)}min(e,t){return new be({...this._def,minSize:{value:e,message:v.toString(t)}})}max(e,t){return new be({...this._def,maxSize:{value:e,message:v.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}be.create=(s,e)=>new be({valueType:s,minSize:null,maxSize:null,typeName:k.ZodSet,...S(e)});class lt extends ${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})}}lt.create=(s,e)=>new lt({getter:s,typeName:k.ZodLazy,...S(e)});class dt extends ${_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return h(t,{received:t.data,code:c.invalid_literal,expected:this._def.value}),b}return{status:"valid",value:e.data}}get value(){return this._def.value}}dt.create=(s,e)=>new dt({value:s,typeName:k.ZodLiteral,...S(e)});function yt(s,e){return new he({values:s,typeName:k.ZodEnum,...S(e)})}class he extends ${_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),a=this._def.values;return h(t,{expected:N.joinValues(a),received:t.parsedType,code:c.invalid_type}),b}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),a=this._def.values;return h(t,{received:t.data,code:c.invalid_enum_value,options:a}),b}return q(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 he.create(e,{...this._def,...t})}exclude(e,t=this._def){return he.create(this.options.filter(a=>!e.includes(a)),{...this._def,...t})}}he.create=yt;class ut extends ${_parse(e){const t=N.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==y.string&&a.parsedType!==y.number){const n=N.objectValues(t);return h(a,{expected:N.joinValues(n),received:a.parsedType,code:c.invalid_type}),b}if(this._cache||(this._cache=new Set(N.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const n=N.objectValues(t);return h(a,{received:a.data,code:c.invalid_enum_value,options:n}),b}return q(e.data)}get enum(){return this._def.values}}ut.create=(s,e)=>new ut({values:s,typeName:k.ZodNativeEnum,...S(e)});class Re extends ${unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==y.promise&&t.common.async===!1)return h(t,{code:c.invalid_type,expected:y.promise,received:t.parsedType}),b;const a=t.parsedType===y.promise?t.data:Promise.resolve(t.data);return q(a.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Re.create=(s,e)=>new Re({type:s,typeName:k.ZodPromise,...S(e)});class me extends ${innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===k.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:a}=this._processInputParams(e),n=this._def.effect||null,r={addIssue:l=>{h(a,l),l.fatal?t.abort():t.dirty()},get path(){return a.path}};if(r.addIssue=r.addIssue.bind(r),n.type==="preprocess"){const l=n.transform(a.data,r);if(a.common.async)return Promise.resolve(l).then(async d=>{if(t.value==="aborted")return b;const m=await this._def.schema._parseAsync({data:d,path:a.path,parent:a});return m.status==="aborted"?b:m.status==="dirty"||t.value==="dirty"?ve(m.value):m});{if(t.value==="aborted")return b;const d=this._def.schema._parseSync({data:l,path:a.path,parent:a});return d.status==="aborted"?b:d.status==="dirty"||t.value==="dirty"?ve(d.value):d}}if(n.type==="refinement"){const l=d=>{const m=n.refinement(d,r);if(a.common.async)return Promise.resolve(m);if(m instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return d};if(a.common.async===!1){const d=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return d.status==="aborted"?b:(d.status==="dirty"&&t.dirty(),l(d.value),{status:t.value,value:d.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(d=>d.status==="aborted"?b:(d.status==="dirty"&&t.dirty(),l(d.value).then(()=>({status:t.value,value:d.value}))))}if(n.type==="transform")if(a.common.async===!1){const l=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!pe(l))return b;const d=n.transform(l.value,r);if(d instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:d}}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(l=>pe(l)?Promise.resolve(n.transform(l.value,r)).then(d=>({status:t.value,value:d})):b);N.assertNever(n)}}me.create=(s,e,t)=>new me({schema:s,typeName:k.ZodEffects,effect:e,...S(t)});me.createWithPreprocess=(s,e,t)=>new me({schema:e,effect:{type:"preprocess",transform:s},typeName:k.ZodEffects,...S(t)});class re extends ${_parse(e){return this._getType(e)===y.undefined?q(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}re.create=(s,e)=>new re({innerType:s,typeName:k.ZodOptional,...S(e)});class ge extends ${_parse(e){return this._getType(e)===y.null?q(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ge.create=(s,e)=>new ge({innerType:s,typeName:k.ZodNullable,...S(e)});class ze extends ${_parse(e){const{ctx:t}=this._processInputParams(e);let a=t.data;return t.parsedType===y.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ze.create=(s,e)=>new ze({innerType:s,typeName:k.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...S(e)});class Fe extends ${_parse(e){const{ctx:t}=this._processInputParams(e),a={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return $e(n)?n.then(r=>({status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new ee(a.common.issues)},input:a.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new ee(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}Fe.create=(s,e)=>new Fe({innerType:s,typeName:k.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...S(e)});class ct extends ${_parse(e){if(this._getType(e)!==y.nan){const a=this._getOrReturnCtx(e);return h(a,{code:c.invalid_type,expected:y.nan,received:a.parsedType}),b}return{status:"valid",value:e.data}}}ct.create=s=>new ct({typeName:k.ZodNaN,...S(s)});class cn extends ${_parse(e){const{ctx:t}=this._processInputParams(e),a=t.data;return this._def.type._parse({data:a,path:t.path,parent:t})}unwrap(){return this._def.type}}class Ge extends ${_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.common.async)return(async()=>{const r=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return r.status==="aborted"?b:r.status==="dirty"?(t.dirty(),ve(r.value)):this._def.out._parseAsync({data:r.value,path:a.path,parent:a})})();{const n=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return n.status==="aborted"?b:n.status==="dirty"?(t.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:a.path,parent:a})}}static create(e,t){return new Ge({in:e,out:t,typeName:k.ZodPipeline})}}class Be extends ${_parse(e){const t=this._def.innerType._parse(e),a=n=>(pe(n)&&(n.value=Object.freeze(n.value)),n);return $e(t)?t.then(n=>a(n)):a(t)}unwrap(){return this._def.innerType}}Be.create=(s,e)=>new Be({innerType:s,typeName:k.ZodReadonly,...S(e)});var k;(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"})(k||(k={}));const f=ne.create,ye=fe.create;oe.create;const V=Q.create,M=E.create;Oe.create;Ne.create;de.create;const pt=he.create;Re.create;re.create;ge.create;const pn=M({label:f().min(1).max(40),left:f().min(1).max(35),right:f().min(1).max(35)}),fn=M({id:f().min(1),category:f().optional().default("TECH"),theme:pt(["blue-tech","emerald-finance","slate-education","dark-contrast","crimson-alert"]).default("blue-tech"),layoutType:pt(["table","news","stat","list","quote","versus","receipt","timeline","barchart","leaderboard","editorial","matrix","debate","tierlist"]).default("table"),title:f().min(1).max(120),subtitle:f().min(1).max(250),leftHeader:f().optional().default("USA 🇺🇸"),rightHeader:f().optional().default("UK 🇬🇧"),rows:V(pn).optional().default([]),bullets:V(M({highlight:f().optional().default(""),text:f().min(1)})).optional().default([]),bigStat:M({number:f().default("$165,000"),label:f().default("Average Compensation"),subtext:f().optional().default(""),secondaryNumber:f().optional().default(""),secondaryLabel:f().optional().default("")}).optional(),listItems:V(M({rank:ye(),title:f(),value:f(),tag:f().optional().default("")})).optional().default([]),quoteData:M({quote:f(),highlight:f().optional().default(""),source:f().default("Industry Insider")}).optional(),versusData:M({leftEntity:f().optional(),leftStats:V(M({label:f(),value:f()})).optional(),leftPerk:f().optional(),rightEntity:f().optional(),rightStats:V(M({label:f(),value:f()})).optional(),rightPerk:f().optional(),verdict:f().optional()}).optional(),receiptData:M({grossMonthly:f().optional(),items:V(M({label:f(),amount:f(),note:f().optional()})).optional(),totalDeductions:f().optional(),netRemaining:f().optional()}).optional(),timelineData:M({pastYear:f().optional().default("2016"),presentYear:f().optional().default("2026"),items:V(M({label:f(),pastValue:f(),presentValue:f(),changeBadge:f().optional()})).optional(),bottomInsight:f().optional()}).optional(),barchartData:V(M({label:f(),percentage:ye().min(0).max(100),amount:f().optional(),tag:f().optional()})).optional().default([]),leaderboardData:M({calloutNote:f().optional().default("*Asumsi kurs : Rp15.500/US$"),items:V(M({rank:ye(),name:f(),flag:f().optional().default("🌐"),value:f(),percentage:ye().min(0).max(100).optional()})).optional()}).optional(),editorialData:M({badge:f().optional().default("INVESTIGASI KHUSUS"),highlightPhrase:f().optional(),cards:V(M({step:f().optional(),title:f(),text:f(),stat:f().optional()})).optional(),keyTakeaway:f().optional()}).optional(),matrixData:M({headers:V(f()).optional().default(["Indikator","🇮🇩 IDN","🇲🇾 MYS","🇸🇬 SGP"]),rows:V(M({label:f(),values:V(f())})).optional()}).optional(),debateData:M({proTitle:f().optional().default("SISI PRO / BENEFIT"),proScore:f().optional().default("65%"),proPoints:V(f()).optional(),conTitle:f().optional().default("SISI KONTRA / RISIKO"),conScore:f().optional().default("35%"),conPoints:V(f()).optional(),callToAction:f().optional().default("Kalian di tim mana? Tulis pendapatmu di bawah! 👇")}).optional(),tierlistData:V(M({tier:f(),tierColor:f().optional(),items:V(M({name:f(),badge:f().optional(),desc:f().optional()}))})).optional().default([]),footerNote:f().optional().default("Industry Benchmark 2026"),watermark:f().optional().default("@SocialGen"),bgKeyword:f().optional().default("modern office coding night"),reelsDuration:ye().min(5).max(90).default(10),caption:f().optional().default("Bagikan pendapat Anda di kolom komentar! #infografis #edukasi")}),hn={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"},mn={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"},gn={class:"flex items-center gap-2.5 sm:gap-3"},yn={class:"text-sm font-extrabold tracking-tight text-white flex items-center gap-1.5 sm:gap-2"},vn={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"},xn={class:"flex items-center gap-2 sm:gap-3 text-xs"},bn={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]"},kn={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]"},_n={class:"lg:hidden flex items-center justify-center px-3 py-2 bg-slate-900/90 border-b border-slate-800 flex-shrink-0"},wn={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"},Cn={key:0,class:"w-2 h-2 rounded-full bg-emerald-400 animate-ping"},Sn={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"},$n=Ue({__name:"index",setup(s){const e=A({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:10,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=A({theme:"blue-tech",backgroundSource:"pexels",musicFile:"random",outputs:{feed:!0,story:!0,reels:!0}}),a=A([]),n=A(-1);function r(){try{localStorage.setItem("sg_drafts",JSON.stringify(a.value))}catch{}$fetch("/api/drafts",{method:"POST",body:{drafts:a.value}}).catch(T=>{console.warn("Failed to sync drafts to server:",T)})}function l(){a.value.unshift(JSON.parse(JSON.stringify(e.value))),n.value=0,r(),K("Draft berhasil disimpan permanen!")}function d(T){a.value[T]&&(e.value=JSON.parse(JSON.stringify(a.value[T])),t.value.theme=e.value.theme,n.value=T,K(`Memuat draft #${T+1}`))}function m(T){a.value.splice(T,1),n.value===T&&(n.value=-1),r()}const g=A(!1),_=A(!1),P=A(""),J=A(null),W=A(""),F=A("success"),w=A("editor"),B=A(null);Ee(async()=>{try{const T=await $fetch("/api/drafts");if(T?.drafts&&Array.isArray(T.drafts)&&T.drafts.length>0)a.value=T.drafts;else{const I=localStorage.getItem("sg_drafts");if(I){const Y=JSON.parse(I);Array.isArray(Y)&&Y.length>0&&(a.value=Y,$fetch("/api/drafts",{method:"POST",body:{drafts:Y}}).catch(()=>{}))}}}catch{const T=localStorage.getItem("sg_drafts");if(T)try{a.value=JSON.parse(T)}catch{}}try{const T=await $fetch("/api/status");B.value=T}catch{}});const U=ft(()=>{const T=fn.safeParse(e.value);if(T.success)return{isValid:!0,error:""};{const I=T.error.errors[0];return{isValid:!1,error:`${I.path.join(".")}: ${I.message}`}}});function K(T,I="success"){W.value=T,F.value=I,setTimeout(()=>{W.value=""},4e3)}async function ke(T,I,Y){_.value=!0,P.value=`AI Research (${Y||"Gemini"})...`;try{const L=await $fetch("/api/auto-topic",{method:"POST",body:{niche:T,layoutType:I,model:Y}});L?.dataset&&(e.value=L.dataset,t.value.theme=L.dataset.theme,a.value.unshift(L.dataset),n.value=0,r(),L.source==="gemini"?K(`✨ [${L.modelUsed||"Gemini"}] Berhasil meriset: "${L.dataset.title.slice(0,32)}..."`,"success"):K(`ℹ️ [Curated Data] Topik siap: "${L.dataset.title.slice(0,32)}..."`,"success"))}catch(L){K("Gagal auto-topic: "+(L.data?.statusMessage||L.message),"error")}finally{_.value=!1,P.value=""}}async function _e(){if(!U.value.isValid){K("Data tidak valid: "+U.value.error,"error");return}g.value=!0,P.value="Rendering Images & Reels...",J.value=null,w.value="preview";try{const T=await $fetch("/api/generate",{method:"POST",body:{data:e.value,options:t.value}});T?.success&&(J.value=T,K(`Sukses dirender dalam ${(T.durationMs/1e3).toFixed(1)} detik!`))}catch(T){K("Gagal render: "+(T.data?.statusMessage||T.message),"error")}finally{g.value=!1,P.value=""}}return(T,I)=>{const Y=ha,L=Va;return C(),O("div",hn,[i("header",mn,[i("div",gn,[I[6]||(I[6]=i("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)),i("div",null,[i("h1",yn,[I[5]||(I[5]=X(" SocialGen ",-1)),i("span",vn," v"+Z(u(B)?.version||"2.1.1"),1)])])]),i("div",xn,[u(B)?.geminiActive?(C(),O("span",bn," ● AI Connected ")):(C(),O("span",kn," ● Local Engine "))])]),i("div",_n,[i("div",wn,[i("button",{onClick:I[0]||(I[0]=te=>w.value="editor"),class:D(["py-1.5 px-3 rounded-lg transition flex items-center justify-center gap-1.5",u(w)==="editor"?"bg-sky-500 text-white shadow-md font-black":"text-slate-400 hover:text-slate-200"])},[...I[7]||(I[7]=[i("span",null,"⚙️ Studio & Editor",-1)])],2),i("button",{onClick:I[1]||(I[1]=te=>w.value="preview"),class:D(["py-1.5 px-3 rounded-lg transition flex items-center justify-center gap-1.5",u(w)==="preview"?"bg-indigo-600 text-white shadow-md font-black":"text-slate-400 hover:text-slate-200"])},[I[8]||(I[8]=i("span",null,"👁️ Live Preview",-1)),u(J)?(C(),O("span",Cn)):G("",!0)],2)])]),u(W)?(C(),O("div",{key:0,class:D(["fixed bottom-6 right-6 z-50 flex items-center gap-2 px-4 py-3 rounded-2xl shadow-2xl text-xs font-bold border transition-all animate-bounce",u(F)==="success"?"bg-emerald-950 text-emerald-200 border-emerald-500/50":"bg-rose-950 text-rose-200 border-rose-500/50"])},[i("span",null,Z(u(W)),1)],2)):G("",!0),i("main",Sn,[i("section",{class:D(["lg:col-span-5 h-full overflow-y-auto pr-1 flex-col gap-3 custom-scrollbar",u(w)==="editor"?"flex":"hidden lg:flex"])},[R(Y,{modelValue:u(e),"onUpdate:modelValue":I[2]||(I[2]=te=>De(e)?e.value=te:null),options:u(t),"onUpdate:options":I[3]||(I[3]=te=>De(t)?t.value=te:null),"is-valid":u(U).isValid,"validation-error":u(U).error,"is-generating":u(g),"generate-stage":u(P),"is-auto-topic-loading":u(_),drafts:u(a),"active-draft-index":u(n),onGenerate:_e,onAutoTopic:ke,onSelectDraft:d,onDeleteDraft:m,onSaveDraft:l},null,8,["modelValue","options","is-valid","validation-error","is-generating","generate-stage","is-auto-topic-loading","drafts","active-draft-index"])],2),i("section",{class:D(["lg:col-span-7 h-full flex-col gap-3 overflow-hidden justify-between min-h-0",u(w)==="preview"?"flex":"hidden lg:flex"])},[R(L,{data:u(e),"selected-video":u(t).backgroundSource,"generated-result":u(J)},null,8,["data","selected-video","generated-result"])],2)]),u(w)==="editor"?(C(),O("button",{key:1,onClick:I[4]||(I[4]=te=>w.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"},[...I[9]||(I[9]=[i("span",null,"👁️ Lihat Preview Canvas",-1)])])):G("",!0)])}}});export{$n as default};
|