@socialgen_user/socialgen 2.5.0 → 2.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/nitro.json +1 -1
- package/.output/public/_nuxt/{uELeli_8.js → 4OV7a3GF.js} +1 -1
- package/.output/public/_nuxt/{qcjs3SKg.js → BWTcUa3O.js} +1 -1
- package/.output/public/_nuxt/{DXQyqDUm.js → BmiTz0Bj.js} +1 -1
- package/.output/public/_nuxt/{CqNFF8Vb.js → BwBAVlrf.js} +1 -1
- package/.output/public/_nuxt/{v33suYXp.js → DF2JzMIr.js} +2 -2
- package/.output/public/_nuxt/{Cqodgy4B.js → DFkoTwsH.js} +1 -1
- package/.output/public/_nuxt/DqCMQ7mU.js +111 -0
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/5a2b79fd-fbdb-482c-97eb-c377dcd65f19.json +1 -0
- package/.output/public/_nuxt/{pages.BNNMR0bP.css → pages.CurYQ93c.css} +1 -1
- package/.output/server/chunks/_/nitro.mjs +123 -123
- package/.output/server/chunks/build/LivePreview-styles.BAXzj6mF.mjs +8 -0
- package/.output/server/chunks/build/LivePreview-styles.BAXzj6mF.mjs.map +1 -0
- package/.output/server/chunks/build/client.precomputed.mjs +1 -1
- package/.output/server/chunks/build/client.precomputed.mjs.map +1 -1
- package/.output/server/chunks/build/entry-styles.DlYZJ_Pu.mjs +8 -0
- package/.output/server/chunks/build/entry-styles.DlYZJ_Pu.mjs.map +1 -0
- package/.output/server/chunks/build/index-styles-1.mjs-BYkUF4b0.mjs +4 -0
- package/.output/server/chunks/build/index-styles-1.mjs-BYkUF4b0.mjs.map +1 -0
- package/.output/server/chunks/build/{index-styles.B8HyMUMp.mjs → index-styles.CThHhoy-.mjs} +5 -5
- package/.output/server/chunks/build/index-styles.CThHhoy-.mjs.map +1 -0
- package/.output/server/chunks/build/{pages-DS-xmAq6.mjs → pages-BB0Bky-X.mjs} +50 -33
- package/.output/server/chunks/build/{pages-DS-xmAq6.mjs.map → pages-BB0Bky-X.mjs.map} +1 -1
- package/.output/server/chunks/build/server.mjs +1 -1
- package/.output/server/chunks/build/styles.mjs +5 -5
- package/.output/server/package.json +1 -1
- package/data/last_session.json +3 -17
- package/data/templates.json +5 -5
- package/package.json +1 -1
- package/.output/public/_nuxt/N-k_7ft4.js +0 -111
- package/.output/public/_nuxt/builds/meta/12d907e1-63ed-4300-be2b-91cf47d07600.json +0 -1
- package/.output/server/chunks/build/LivePreview-styles.BbGT7KVf.mjs +0 -8
- package/.output/server/chunks/build/LivePreview-styles.BbGT7KVf.mjs.map +0 -1
- package/.output/server/chunks/build/entry-styles.DH5fRIfL.mjs +0 -8
- package/.output/server/chunks/build/entry-styles.DH5fRIfL.mjs.map +0 -1
- package/.output/server/chunks/build/index-styles-1.mjs-CBmp9qkk.mjs +0 -4
- package/.output/server/chunks/build/index-styles-1.mjs-CBmp9qkk.mjs.map +0 -1
- package/.output/server/chunks/build/index-styles.B8HyMUMp.mjs.map +0 -1
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import{h as da,d as ga,i as S,M as Te,o as ya,A as p,B as f,l as n,C as t,E as y,G as Z,D as x,N as M,O as X,P as de,Q as it,R as ft,S as ue,T as be,U as De,V as dt,W as Ie,X as E,Y as Be,m as fe,Z as As,c as Os,$ as La,_ as Ns}from"./DF2JzMIr.js";import{_ as Is}from"./4OV7a3GF.js";async function St(o){if(!o)return!1;if(typeof window<"u"&&window.isSecureContext&&navigator?.clipboard?.writeText)try{return await navigator.clipboard.writeText(o),!0}catch(e){console.warn("[SocialGen Clipboard] navigator.clipboard.writeText failed, falling back to execCommand:",e)}if(typeof document<"u")try{const e=document.createElement("textarea");if(e.value=o,e.style.position="fixed",e.style.left="-9999px",e.style.top=(window.pageYOffset||document.documentElement.scrollTop||0)+"px",e.style.width="2em",e.style.height="2em",e.style.padding="0",e.style.border="none",e.style.outline="none",e.style.boxShadow="none",e.style.background="transparent",e.style.fontSize="16px",document.body.appendChild(e),typeof navigator<"u"&&/ipad|iphone|ipod/i.test(navigator.userAgent)){e.contentEditable="true",e.readOnly=!1;const i=document.createRange();i.selectNodeContents(e);const d=window.getSelection();d&&(d.removeAllRanges(),d.addRange(i)),e.setSelectionRange(0,999999)}else e.focus(),e.select();let l=!1;try{l=document.execCommand("copy")}catch(i){console.warn("[SocialGen Clipboard] execCommand call threw error:",i)}if(document.body.removeChild(e),l)return!0}catch(e){console.warn("[SocialGen Clipboard] DOM fallback failed:",e)}return!1}const Ms=o=>o.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var Dt={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 $s=({size:o,strokeWidth:e=2,absoluteStrokeWidth:s,color:l,iconNode:i,name:d,class:m,...c},{slots:C})=>da("svg",{...Dt,width:o||Dt.width,height:o||Dt.height,stroke:l||Dt.stroke,"stroke-width":s?Number(e)*24/Number(o):e,class:["lucide",`lucide-${Ms(d??"icon")}`],...c},[...i.map(w=>da(...w)),...C.default?[C.default()]:[]]);const U=(o,e)=>(s,{slots:l})=>da($s,{...s,iconNode:e,name:o},l);const na=U("BookmarkIcon",[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]]);const Ds=U("CameraIcon",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);const tt=U("CheckIcon",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const Ba=U("CircleAlertIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);const js=U("CircleCheckIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);const oa=U("ClockIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const la=U("CodeIcon",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const Ke=U("CopyIcon",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const Es=U("EllipsisVerticalIcon",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);const Ha=U("EyeIcon",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const ra=U("FileTextIcon",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const ua=U("FilmIcon",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M3 7.5h4",key:"zfgn84"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 16.5h4",key:"1230mu"}],["path",{d:"M17 3v18",key:"in4fa5"}],["path",{d:"M17 7.5h4",key:"myr1c1"}],["path",{d:"M17 16.5h4",key:"go4c1d"}]]);const Rs=U("GlobeIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);const Ua=U("HeartIcon",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]]);const Ps=U("LayersIcon",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]);const Ja=U("LayoutTemplateIcon",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]]);const Vs=U("MessageCircleIcon",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);const Ct=U("MusicIcon",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]);const Ls=U("PauseIcon",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);const jt=U("PenIcon",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]);const ds=U("PlayIcon",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);const wt=U("PlusIcon",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const Fa=U("RefreshCwIcon",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);const us=U("RotateCcwIcon",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);const ca=U("ScissorsIcon",[["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M8.12 8.12 12 12",key:"1alkpv"}],["path",{d:"M20 4 8.12 15.88",key:"xgtan2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M14.8 14.8 20 20",key:"ptml3r"}]]);const Bs=U("SearchIcon",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);const Za=U("SettingsIcon",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const za=U("Share2Icon",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);const Hs=U("ShieldAlertIcon",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);const Us=U("SlidersVerticalIcon",[["line",{x1:"4",x2:"4",y1:"21",y2:"14",key:"1p332r"}],["line",{x1:"4",x2:"4",y1:"10",y2:"3",key:"gb41h5"}],["line",{x1:"12",x2:"12",y1:"21",y2:"12",key:"hf2csr"}],["line",{x1:"12",x2:"12",y1:"8",y2:"3",key:"1kfi7u"}],["line",{x1:"20",x2:"20",y1:"21",y2:"16",key:"1lhrwl"}],["line",{x1:"20",x2:"20",y1:"12",y2:"3",key:"16vvfq"}],["line",{x1:"2",x2:"6",y1:"14",y2:"14",key:"1uebub"}],["line",{x1:"10",x2:"14",y1:"8",y2:"8",key:"1yglbp"}],["line",{x1:"18",x2:"22",y1:"16",y2:"16",key:"1jxqpz"}]]);const ct=U("SparklesIcon",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);const ut=U("Trash2Icon",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);const Et=U("UploadIcon",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);const Js=U("Volume2Icon",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);const Fs=U("VolumeXIcon",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);const Zs=U("WandSparklesIcon",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);const Rt=U("XIcon",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);const zs=U("ZoomInIcon",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);const Gs=U("ZoomOutIcon",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]),Ks={class:"flex flex-col gap-3 text-slate-100"},Ws={key:0,class:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm flex items-center justify-center p-4"},qs={class:"bg-slate-900 border border-slate-700 rounded-3xl max-w-xl w-full p-5 shadow-2xl flex flex-col gap-4 text-xs max-h-[90vh] overflow-y-auto custom-scrollbar"},Ys={class:"flex items-center justify-between pb-3 border-b border-slate-800"},Xs={class:"text-sm font-black text-white flex items-center gap-2"},Qs={class:"p-3.5 bg-slate-950 rounded-2xl border border-slate-800 flex flex-col gap-2.5"},en={class:"font-bold text-sky-400 flex items-center justify-between"},tn={class:"grid grid-cols-1 sm:grid-cols-2 gap-2"},an={class:"flex flex-col gap-2"},sn={class:"text-[11px] font-bold text-slate-400 uppercase tracking-wider"},nn={class:"flex flex-col gap-2 max-h-[220px] overflow-y-auto pr-1 custom-scrollbar"},on={class:"flex-1"},ln={class:"flex items-center gap-2 mb-1"},rn={class:"font-extrabold text-white text-xs"},dn={class:"px-1.5 py-0.2 rounded text-[9px] font-bold bg-slate-800 text-slate-300 border border-slate-700"},un={class:"text-[11px] text-slate-400 leading-snug"},cn={class:"flex items-center gap-1"},pn=["onClick"],fn=["onClick"],mn={key:1,class:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm flex items-center justify-center p-4"},xn={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]"},bn={class:"flex items-center justify-between pb-3 border-b border-slate-800"},hn={class:"text-sm font-black text-white flex items-center gap-2"},gn={class:"flex items-center gap-2 bg-slate-950 p-2.5 rounded-xl border border-slate-800 text-[11px] flex-wrap"},yn={class:"text-white font-semibold"},vn={class:"text-white font-semibold"},kn={class:"text-white font-semibold"},wn={class:"text-purple-400 font-bold"},_n={class:"relative flex-1 min-h-[220px]"},Sn=["value"],Tn={class:"flex items-center justify-between pt-2 border-t border-slate-800"},Cn={class:"bg-slate-900 border border-slate-700/80 rounded-3xl max-w-lg w-full p-6 shadow-2xl flex flex-col gap-4 text-xs max-h-[92vh] overflow-y-auto"},An={class:"flex items-center justify-between pb-3 border-b border-slate-800"},On={class:"grid grid-cols-2 gap-3"},Nn={class:"p-3 bg-slate-950/60 border border-slate-800 rounded-2xl flex flex-col gap-2"},In={class:"flex items-center gap-2.5"},Mn={class:"p-3 bg-slate-950/60 border border-slate-800 rounded-2xl flex flex-col gap-2"},$n={class:"flex items-center gap-2.5"},Dn={class:"p-3 bg-slate-950/60 border border-slate-800 rounded-2xl flex flex-col gap-2"},jn={class:"flex items-center gap-2.5"},En={class:"p-3 bg-slate-950/60 border border-slate-800 rounded-2xl flex flex-col gap-2"},Rn={class:"flex items-center gap-2.5"},Pn={class:"flex flex-col gap-2"},Vn={class:"flex flex-wrap gap-1.5"},Ln=["onClick"],Bn={class:"flex items-center -space-x-1"},Hn={class:"flex items-center justify-between mb-2"},Un={class:"flex items-center justify-end gap-2.5 pt-3 border-t border-slate-800"},Jn={class:"bg-slate-900 border border-slate-700 rounded-3xl max-w-2xl w-full p-5 shadow-2xl flex flex-col gap-4 text-xs max-h-[92vh] overflow-hidden"},Fn={class:"flex items-center justify-between pb-3 border-b border-slate-800"},Zn={class:"text-sm font-black text-white flex items-center gap-2"},zn={class:"flex items-center justify-between bg-slate-950 p-1 rounded-xl border border-slate-800"},Gn={class:"flex items-center gap-1"},Kn={key:0,class:"px-2.5 py-0.5 rounded-lg bg-amber-500/20 text-amber-300 border border-amber-500/40 text-[10px] font-bold flex items-center gap-1"},Wn={key:0,class:"flex-1 overflow-y-auto pr-1 flex flex-col gap-2.5 custom-scrollbar min-h-[300px]"},qn={key:0,class:"text-center py-12 text-slate-500 text-xs"},Yn={class:"flex-1 min-w-0"},Xn={class:"flex items-center gap-2 mb-1 flex-wrap"},Qn={class:"font-extrabold text-white text-xs"},eo={class:"px-1.5 py-0.2 rounded text-[9px] font-bold bg-sky-950 text-sky-300 border border-sky-800"},to={class:"text-[9px] text-slate-500 font-mono"},ao={class:"text-[11px] text-slate-400 leading-snug line-clamp-2"},so={class:"flex items-center gap-1.5 flex-shrink-0 self-end sm:self-center"},no=["onClick"],oo=["onClick"],lo=["onClick"],ro=["onClick"],io={key:1,class:"flex-1 overflow-y-auto pr-1 flex flex-col gap-3 custom-scrollbar min-h-[350px]"},uo={key:0,class:"p-2 rounded-xl bg-rose-950/60 border border-rose-500/50 text-rose-300 text-[11px] font-semibold"},co={key:1,class:"p-2.5 rounded-2xl bg-amber-950/60 border border-amber-500/50 text-amber-200 text-xs flex items-center justify-between shadow-lg"},po={class:"flex items-center gap-2 min-w-0"},fo={class:"p-1 rounded-lg bg-amber-500/20 text-amber-400 shrink-0"},mo={class:"min-w-0"},xo={class:"font-extrabold text-white text-xs flex items-center gap-1.5 truncate"},bo={class:"text-amber-300 truncate"},ho={class:"text-[10px] text-amber-400/80"},go={class:"p-3 rounded-2xl bg-gradient-to-r from-sky-950/60 via-indigo-950/40 to-slate-900 border border-sky-500/30 flex flex-col gap-2.5"},yo={class:"flex flex-col sm:flex-row sm:items-center justify-between gap-2"},vo={class:"flex items-center gap-1.5 shrink-0 flex-wrap"},ko=["title"],wo={key:0,class:"mt-1 flex flex-col gap-2 p-2.5 rounded-xl bg-slate-950/90 border border-sky-500/40"},_o={class:"flex items-center justify-between"},So=["value"],To={key:1,class:"mt-1 flex flex-col gap-2 p-2.5 rounded-xl bg-slate-950/90 border border-sky-500/40"},Co={class:"flex justify-end gap-2"},Ao={class:"grid grid-cols-1 sm:grid-cols-3 gap-2.5"},Oo=["disabled"],No={class:"grid grid-cols-1 sm:grid-cols-2 gap-2.5"},Io=["value"],Mo={key:2,class:"flex flex-col gap-2.5 p-3 rounded-2xl bg-slate-950/80 border border-sky-500/30"},$o={class:"flex items-center justify-between"},Do={class:"text-[11px] font-black text-sky-400 flex items-center gap-1"},jo={class:"flex items-center justify-end gap-2 pt-2 border-t border-slate-800"},Eo={class:"flex lg:hidden flex-col gap-3 pb-24"},Ro={class:"flex items-center justify-between gap-1 p-1 bg-slate-900/95 border border-slate-800 rounded-2xl shadow-lg sticky top-0 z-20 backdrop-blur-md"},Po={class:"flex items-center gap-1 overflow-x-auto no-scrollbar flex-1 py-0.5"},Vo={key:0,class:"flex flex-col gap-3"},Lo={class:"flex items-start gap-2.5"},Bo={class:"min-w-0 flex-1"},Ho={class:"font-black text-white text-xs"},Uo={class:"text-[11px] mt-0.5 leading-relaxed opacity-90"},Jo={key:0},Fo={key:1},Zo={class:"underline text-white"},zo={class:"underline text-white"},Go={key:2},Ko={class:"flex items-center gap-2 pt-1 border-t border-white/10 flex-wrap"},Wo={key:1,class:"p-2.5 rounded-xl bg-slate-900/60 border border-slate-800 flex items-center justify-between text-[11px] shadow-sm"},qo={class:"flex items-center gap-2 text-slate-300 truncate"},Yo={class:"font-extrabold text-white truncate"},Xo={class:"p-3.5 bg-slate-900/90 border border-slate-800 rounded-2xl space-y-1.5 shadow-md"},Qo=["value"],el={class:"p-3.5 bg-slate-900/90 border border-slate-800 rounded-2xl space-y-1.5 shadow-md"},tl=["value"],al={class:"grid grid-cols-1 sm:grid-cols-2 gap-2.5"},sl={class:"p-3 bg-slate-900/90 border border-slate-800 rounded-2xl space-y-1 shadow-md"},nl=["value"],ol={class:"p-3 bg-slate-900/90 border border-slate-800 rounded-2xl space-y-1 shadow-md"},ll=["value"],rl={class:"p-3.5 bg-slate-900/90 border border-slate-800 rounded-2xl space-y-2 shadow-md"},il={class:"flex items-center justify-between"},dl=["value"],ul={key:1,class:"flex flex-col gap-3"},cl={class:"p-3.5 bg-slate-900/90 border border-slate-800 rounded-2xl space-y-2.5 shadow-md"},pl={class:"flex items-center justify-between"},fl={class:"text-xs font-extrabold text-white"},ml={key:0,class:"p-2.5 rounded-xl bg-amber-950/70 border border-amber-500/40 text-amber-200 text-xs flex items-center justify-between shadow"},xl={class:"flex items-center gap-1.5 truncate"},bl={class:"text-[11px] truncate"},hl={key:0},gl={key:1},yl={key:2},vl={class:"flex gap-2 overflow-x-auto no-scrollbar py-1"},kl=["onClick"],wl={class:"w-8 h-8 rounded-xl bg-slate-800 flex items-center justify-center text-sm shadow"},_l={class:"text-[10px] font-black text-white leading-tight truncate w-full"},Sl={class:"p-3.5 bg-slate-900/90 border border-slate-800 rounded-2xl space-y-2.5 shadow-md"},Tl={class:"flex items-center justify-between"},Cl={class:"text-[10px] text-sky-400 font-bold truncate max-w-[150px]"},Al={class:"grid grid-cols-6 gap-2 py-1"},Ol=["onClick","title"],Nl={key:0,class:"drop-shadow"},Il={class:"text-[8px] text-slate-400 truncate w-full text-center"},Ml={class:"p-3.5 bg-slate-900/90 border border-slate-800 rounded-2xl flex flex-col gap-3 shadow-md"},$l={class:"flex items-center justify-between"},Dl={class:"pt-2.5 border-t border-slate-800/80 flex items-center justify-between gap-2"},jl={class:"flex items-center gap-1.5"},El={key:0,class:"p-2 rounded-xl bg-slate-950 border border-sky-500/40"},Rl=["value"],Pl={key:2,class:"flex flex-col gap-3"},Vl={class:"p-3.5 bg-slate-900/90 border border-slate-800 rounded-2xl space-y-2.5 shadow-md"},Ll={class:"flex items-center justify-between"},Bl={class:"text-xs font-extrabold text-sky-400 flex items-center gap-1.5"},Hl=["disabled"],Ul=["value"],Jl=["value"],Fl={class:"pt-1 space-y-1"},Zl={class:"flex items-center justify-between text-[11px]"},zl={class:"text-slate-400 font-mono"},Gl={class:"text-sky-300 font-bold"},Kl=["max","value"],Wl={class:"p-3.5 bg-slate-900/90 border border-slate-800 rounded-2xl space-y-2.5 shadow-md"},ql={class:"flex items-center justify-between"},Yl={class:"text-xs font-extrabold text-purple-400 flex items-center gap-1.5"},Xl=["disabled"],Ql=["value"],er=["value"],tr={class:"pt-1 space-y-1"},ar={class:"flex items-center justify-between text-[11px]"},sr={class:"text-slate-400 font-mono"},nr={class:"text-purple-300 font-bold"},or=["max","value"],lr={class:"p-3.5 bg-slate-900/90 border border-slate-800 rounded-2xl flex items-center justify-between shadow-md"},rr={class:"text-xs font-bold text-slate-300 flex items-center gap-1.5"},ir={class:"flex items-center gap-1.5"},dr=["onClick"],ur={class:"p-3 bg-slate-900/90 border border-slate-800 rounded-2xl space-y-1.5 shadow-md"},cr={class:"grid grid-cols-3 gap-2"},pr=["checked"],fr=["checked"],mr=["checked"],xr={key:3,class:"flex flex-col gap-3"},br={class:"p-4 rounded-3xl bg-gradient-to-br from-indigo-950/80 via-slate-900 to-sky-950/80 border border-sky-500/30 space-y-3 shadow-xl"},hr={class:"flex items-center justify-between"},gr={class:"text-xs font-black text-sky-300 uppercase tracking-wider flex items-center gap-1.5"},yr={class:"text-[9px] px-2 py-0.5 rounded-full bg-emerald-500/20 text-emerald-400 font-bold border border-emerald-500/30"},vr={class:"grid grid-cols-2 gap-2"},kr={class:"space-y-1"},wr=["value"],_r={class:"space-y-1"},Sr=["disabled"],Tr={class:"p-3.5 bg-slate-900/90 border border-purple-500/30 rounded-2xl space-y-2.5 shadow-md"},Cr={class:"flex items-center justify-between"},Ar={class:"flex items-center gap-1.5"},Or={class:"flex items-center gap-2"},Nr=["disabled"],Ir={key:4,class:"flex flex-col gap-3"},Mr={class:"flex items-center justify-between bg-slate-900/90 p-1 rounded-2xl border border-slate-800 text-xs font-bold shadow-md"},$r={key:0,class:"flex flex-col gap-2"},Dr={class:"flex items-center justify-between px-1"},jr={key:0,class:"text-center py-10 text-slate-500 text-xs bg-slate-900/50 rounded-2xl border border-slate-800"},Er=["onClick"],Rr={class:"flex-1 pr-2 truncate"},Pr={class:"font-extrabold text-xs text-white truncate"},Vr={class:"text-[10px] text-slate-400 font-mono"},Lr=["onClick"],Br={key:1,class:"flex flex-col gap-2"},Hr={class:"flex items-center justify-between px-1"},Ur={key:0,class:"text-center py-10 text-slate-500 text-xs bg-slate-900/50 rounded-2xl border border-slate-800"},Jr=["onClick"],Fr={class:"flex-1 pr-2 truncate"},Zr={class:"font-extrabold text-xs text-white truncate"},zr={class:"text-[10px] text-slate-400 font-mono"},Gr=["onClick"],Kr={key:5,class:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm flex flex-col justify-end"},Wr={class:"w-full max-h-[80vh] bg-slate-900 border-t border-slate-700 rounded-t-3xl p-4 flex flex-col gap-3 shadow-2xl animate-in slide-in-from-bottom"},qr={class:"flex items-center justify-between pb-2 border-b border-slate-800"},Yr={class:"flex items-center gap-1.5 truncate"},Xr={class:"truncate"},Qr={key:0},ei={key:1},ti={key:2},ai=["value"],si={class:"flex items-center justify-between gap-2"},ni={class:"hidden lg:flex flex-col h-full overflow-hidden w-full"},oi={class:"h-12 px-3 bg-slate-900/90 border-b border-slate-800/80 flex items-center justify-between shrink-0 shadow-sm z-20"},li={class:"flex items-center gap-2"},ri={class:"flex items-center gap-1.5 mr-1"},ii={class:"flex items-center gap-1 bg-slate-950 px-2 py-1 rounded-xl border border-slate-800 shadow-inner"},di=["value"],ui={class:"flex items-center gap-1 bg-slate-950 px-2 py-1 rounded-xl border border-slate-800 shadow-inner"},ci={class:"flex items-center gap-2"},pi=["disabled"],fi={class:"relative group"},mi={class:"absolute right-0 mt-1 hidden group-hover:flex flex-col bg-slate-900 border border-slate-800 rounded-xl shadow-2xl py-2 z-30 w-56 text-xs"},xi={class:"px-3 py-1.5"},bi={key:0,class:"p-2.5 bg-gradient-to-r from-sky-950 via-indigo-950 to-purple-950 border-b border-sky-500/50 flex items-center gap-3 animate-pulse shadow-md shrink-0"},hi={class:"w-5 h-5 rounded-lg bg-sky-500/20 border border-sky-400/40 flex items-center justify-center flex-shrink-0"},gi={class:"text-[11px] flex items-center gap-2"},yi={class:"text-[9px] px-1.5 py-0.2 rounded bg-sky-500/30 text-sky-200 border border-sky-400/30"},vi={class:"flex-1 flex flex-row overflow-hidden min-h-0"},ki={class:"w-80 xl:w-96 bg-slate-900/80 border-r border-slate-800/80 flex flex-col shrink-0 overflow-hidden"},wi={class:"p-2 border-b border-slate-800/80 bg-slate-950/70 flex items-center justify-between shrink-0"},_i={class:"flex items-center gap-1.5 w-full"},Si={key:0,class:"flex-1 flex flex-col overflow-hidden min-h-0"},Ti={class:"p-2.5 border-b border-slate-800/60 flex flex-col gap-2 shrink-0"},Ci={class:"flex items-center justify-between"},Ai={class:"text-[10px] font-extrabold uppercase tracking-wider text-slate-400"},Oi={class:"relative"},Ni={class:"flex-1 overflow-y-auto p-2 space-y-1.5 custom-scrollbar"},Ii=["onClick"],Mi={class:"flex items-center justify-between"},$i={class:"text-xs font-black truncate text-white group-hover:text-sky-300 transition"},Di={key:0,class:"w-2 h-2 rounded-full bg-sky-400 shrink-0"},ji={key:1,class:"text-[9px] text-amber-400 font-bold shrink-0"},Ei={class:"text-[10px] text-slate-400 line-clamp-1 leading-snug"},Ri={class:"flex items-center gap-1 mt-0.5 flex-wrap"},Pi={class:"px-1.5 py-0.2 rounded text-[8px] font-bold bg-sky-900/60 text-sky-300 border border-sky-700/50 uppercase"},Vi={key:0,class:"px-1.5 py-0.2 rounded text-[8px] font-bold bg-slate-800 text-slate-400 uppercase"},Li={class:"p-2.5 border-t border-slate-800/80 bg-slate-950/80 flex items-center justify-between shrink-0"},Bi={class:"text-[10px] font-bold text-slate-400 flex items-center gap-1"},Hi={key:1,class:"flex-1 flex flex-col overflow-hidden min-h-0"},Ui={class:"p-2.5 border-b border-slate-800/60 flex items-center justify-between shrink-0"},Ji={class:"text-[10px] font-extrabold uppercase tracking-wider text-slate-400"},Fi={class:"flex-1 overflow-y-auto p-2 space-y-1.5 custom-scrollbar"},Zi={key:0,class:"p-2 rounded-xl bg-amber-500/15 border border-amber-500/40 text-amber-200 flex items-center justify-between gap-1 shadow-sm text-xs mb-1"},zi={class:"truncate text-[10px]"},Gi={class:"text-amber-100 font-semibold truncate"},Ki={key:1,class:"text-center py-8 text-slate-500 text-[11px] leading-relaxed"},Wi=["onClick"],qi={class:"flex-1 min-w-0 pr-1"},Yi={class:"flex items-center gap-1 mb-0.5"},Xi={class:"px-1.5 py-0.2 rounded text-[8px] font-bold uppercase bg-amber-500/20 text-amber-300 border border-amber-500/30"},Qi={class:"text-[9px] text-slate-400 font-semibold truncate"},ed={class:"font-bold text-[11px] truncate text-slate-100"},td=["onClick"],ad={key:2,class:"flex-1 flex flex-col overflow-hidden min-h-0"},sd={class:"p-2.5 border-b border-slate-800/60 flex items-center justify-between shrink-0"},nd={class:"text-[10px] font-extrabold uppercase tracking-wider text-slate-400"},od={class:"flex-1 overflow-y-auto p-2 space-y-1.5 custom-scrollbar"},ld={key:0,class:"p-2 rounded-xl bg-purple-500/15 border border-purple-500/40 text-purple-200 flex items-center justify-between gap-1 shadow-sm text-xs mb-1"},rd={class:"truncate text-[10px]"},id={class:"text-purple-100 font-semibold truncate"},dd={key:1,class:"text-center py-8 text-slate-500 text-[11px] leading-relaxed"},ud=["onClick"],cd={class:"flex-1 min-w-0 pr-1"},pd={class:"flex items-center gap-1 mb-0.5"},fd={class:"px-1.5 py-0.2 rounded text-[8px] font-bold uppercase bg-purple-500/20 text-purple-300 border border-purple-500/30"},md={class:"text-[9px] text-slate-400 font-semibold truncate"},xd={key:0,class:"text-[8px] text-slate-500 font-mono ml-auto"},bd={class:"font-bold text-[11px] truncate text-slate-100"},hd=["onClick"],gd={class:"w-[460px] xl:w-[500px] bg-slate-950 border-r border-slate-800/80 flex flex-col shrink-0 overflow-hidden"},yd={class:"px-3.5 py-2.5 bg-slate-900/70 border-b border-slate-800 flex items-center justify-between shrink-0"},vd={class:"flex items-center gap-2"},kd={class:"text-[10px] px-2 py-0.5 rounded-full bg-slate-800 text-sky-300 font-semibold truncate max-w-[150px]"},wd={class:"flex items-center gap-1"},_d={class:"flex-1 overflow-y-auto p-3 space-y-3.5 custom-scrollbar"},Sd={class:"p-3 bg-slate-900/80 border border-slate-800 rounded-2xl space-y-2.5 shadow-sm"},Td={class:"flex items-center justify-between"},Cd={class:"text-[10px] font-bold text-sky-400 truncate max-w-[170px]"},Ad={class:"grid grid-cols-6 gap-1.5"},Od=["onClick","title"],Nd={class:"grid grid-cols-3 gap-2"},Id={class:"col-span-1 space-y-1"},Md=["value"],$d={class:"col-span-2 space-y-1"},Dd=["value"],jd={class:"p-3 bg-slate-900/80 border border-slate-800 rounded-2xl space-y-2 shadow-sm"},Ed={class:"flex items-center justify-between"},Rd={class:"text-[10px] font-black uppercase tracking-wider text-slate-400 flex items-center gap-1.5"},Pd={key:0,class:"inline-flex items-center gap-0.5 px-2 py-0.5 rounded-full text-[9px] font-semibold bg-emerald-500/20 text-emerald-400 border border-emerald-500/30"},Vd={key:1,class:"inline-flex items-center gap-0.5 px-2 py-0.5 rounded-full text-[9px] font-semibold bg-rose-500/20 text-rose-400 border border-rose-500/30"},Ld={key:0},Bd={key:1},Hd={class:"flex items-center gap-1.5"},Ud=["value"],Jd={key:1,class:"text-[10px] text-rose-400 mt-1 px-1"},Fd={class:"p-3 bg-slate-900/80 border border-slate-800 rounded-2xl flex flex-col gap-2.5 shadow-sm text-xs"},Zd={class:"flex flex-col gap-1.5"},zd={class:"flex items-center justify-between gap-2"},Gd={class:"font-bold text-slate-300 flex items-center gap-1.5 text-[11px]"},Kd={class:"flex items-center gap-1.5"},Wd=["value"],qd=["value"],Yd=["disabled"],Xd={class:"hidden sm:inline"},Qd={class:"flex items-center justify-between pl-5 pr-1 text-[10px] text-slate-400"},eu={class:"flex items-center gap-1 text-sky-300 font-mono"},tu=["max","value"],au={class:"flex flex-col gap-1.5 pt-1.5 border-t border-slate-800"},su={class:"flex items-center justify-between gap-2"},nu={class:"font-bold text-slate-300 flex items-center gap-1.5 text-[11px]"},ou={class:"flex items-center gap-1.5"},lu=["value"],ru=["value"],iu=["disabled"],du={class:"hidden sm:inline"},uu={class:"flex items-center justify-between pl-5 pr-1 text-[10px] text-slate-400"},cu={class:"flex items-center gap-1 text-purple-300 font-mono"},pu=["max","value"],fu={class:"flex items-center justify-between pt-1.5 border-t border-slate-800"},mu={class:"font-bold text-slate-300 flex items-center gap-1.5 text-[11px]"},xu={class:"flex items-center gap-1.5 flex-wrap justify-end"},bu=["onClick"],hu={class:"grid grid-cols-3 gap-2 pt-1.5 border-t border-slate-800"},gu=["checked"],yu=["checked"],vu=["checked"],ku={class:"p-3 bg-slate-900/90 border-t border-slate-800 shrink-0"},wu=["disabled"],_u=ga({__name:"DashboardControls",props:{modelValue:{},options:{},isValid:{type:Boolean},validationError:{},isGenerating:{type:Boolean},generateStage:{},isAutoTopicLoading:{type:Boolean},drafts:{},activeDraftIndex:{},history:{},activeHistoryIndex:{},unsavedStash:{}},emits:["update:modelValue","update:options","generate","autoTopic","selectDraft","deleteDraft","saveDraft","selectHistory","deleteHistory","clearAllHistory","restoreStash","clearStash","toast"],setup(o,{emit:e}){const s=o,l=e,i=S(""),d=S(s.modelValue?.templateId||s.modelValue?.layoutType||"table"),m=S(!0),c=S(""),C=S(""),w=S("gemini-3.8-flash"),$=S("editor");function ne(){l("restoreStash"),$.value="editor"}const he=S([]),q=S("tech"),B=S(!1),j=S(null),J=S({id:"",name:"",theme:"blue-tech",description:""});async function ge(){try{const u=await $fetch("/api/niches");u?.niches&&u.niches.length>0&&(he.value=u.niches,he.value.some(a=>a.id===q.value)||(q.value=he.value[0].id))}catch(u){console.error("Failed to load niches:",u)}}function $e(){j.value=null,J.value={id:"",name:"",theme:s.modelValue.theme||"blue-tech",description:""},B.value=!0}function Pe(u){j.value=u.id,J.value={id:u.id,name:u.name,theme:u.theme||"blue-tech",description:u.description}}async function we(){if(!J.value.name.trim()){alert("Nama Niche wajib diisi");return}const a={id:j.value||J.value.name.toLowerCase().replace(/[^a-z0-9_-]/g,"_"),name:J.value.name.trim(),theme:J.value.theme,description:J.value.description.trim()||`Fokus pada topik ${J.value.name.trim()}`};try{const r=await $fetch("/api/niches",{method:"POST",body:a});r?.niches&&(he.value=r.niches,q.value=a.id,j.value=null,J.value={id:"",name:"",theme:"blue-tech",description:""})}catch(r){alert("Gagal menyimpan niche: "+(r.data?.statusMessage||r.message))}}async function ee(u){if(he.value.length<=1){alert("Minimal harus ada 1 niche tersisa.");return}if(confirm("Hapus niche ini?"))try{const a=await $fetch(`/api/niches?id=${u}`,{method:"DELETE"});a?.niches&&(he.value=a.niches,q.value===u&&(q.value=a.niches[0].id),j.value===u&&(j.value=null))}catch(a){alert("Gagal menghapus niche: "+(a.data?.statusMessage||a.message))}}const K=S("id"),Y=S([{id:"table",name:"📊 Comparison Table",category:"Perbandingan",description:"Tabel komparasi 2 entitas",icon:"Table",layoutType:"table",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"versus",name:"⚔️ Versus Showdown Arena",category:"Perbandingan",description:"Duel head-to-head dua kubu",icon:"Swords",layoutType:"versus",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"receipt",name:"🧾 Monthly Living Invoice",category:"Finansial",description:"Format slip gaji pengeluaran bulanan",icon:"Receipt",layoutType:"receipt",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"news",name:"📰 Special Report Pamphlet",category:"Jurnalisme",description:"Pamflet investigasi dengan 3 poin kunci",icon:"Newspaper",layoutType:"news",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"stat",name:"🎯 Big Shocking Number",category:"Analisis",description:"Fokus pada satu angka kontras raksasa",icon:"Target",layoutType:"stat",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"timeline",name:"⏳ 10-Year Shift (Then vs Now)",category:"Tren",description:"Pergeseran tren 10 tahun lalu vs sekarang",icon:"Clock",layoutType:"timeline",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"barchart",name:"📈 Income Allocation Bars",category:"Finansial",description:"Distribusi alokasi dana dengan bar chart",icon:"BarChart3",layoutType:"barchart",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"list",name:"🏆 Top 5 Ranked List",category:"Peringkat",description:"Ranking 5 teratas dengan kartu metrik",icon:"ListOrdered",layoutType:"list",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"quote",name:"💬 Hot Take / Quote Debate",category:"Opini",description:"Kutipan tajam memicu perdebatan",icon:"Quote",layoutType:"quote",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"leaderboard",name:"🥇 Multi-Country Leaderboard (Top 10)",category:"Peringkat",description:"Peringkat 5-10 negara dengan horizontal bar chart",icon:"Trophy",layoutType:"leaderboard",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"editorial",name:"📰 Editorial Storytelling Deep Dive",category:"Jurnalisme",description:"Format narasi editorial 3 kartu bertahap",icon:"BookOpen",layoutType:"editorial",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"matrix",name:"📊 Multi-Column Matrix (3-4 Negara)",category:"Perbandingan",description:"Tabel matriks komparasi 3-4 negara sekaligus",icon:"Grid",layoutType:"matrix",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"debate",name:"⚡ Debate Arena (Pro vs Kontra)",category:"Interaktif",description:"Arena debat dua kubu dengan skor komunitas",icon:"Flame",layoutType:"debate",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"tierlist",name:"🎖️ Tier List Ranking (S, A, B, C)",category:"Peringkat",description:"Hierarki tingkatan Tier S, A, B, C",icon:"Layers",layoutType:"tierlist",isBuiltin:!0,sampleData:{},promptDirective:""},{id:"breaking-notifications",name:"📱 Breaking Alert Notification Stack",category:"Berita Viral",description:"Tumpukan 3 kartu notifikasi darurat kaca iOS/Android",icon:"Bell",layoutType:"custom",isBuiltin:!0,sampleData:{},promptDirective:""}]),Ce=S(!1),ie=S("list"),te=S(null),oe=S(""),G=S(""),ke=S(!1),le=S(!1),Ae=S(!1),re=S(""),N=S({id:"",name:"",category:"Kustom",description:"",layoutType:"custom",customHtml:"",customCss:"",promptDirective:"",sampleJsonText:""});async function Xe(){try{const u=await $fetch("/api/templates");u?.templates&&u.templates.length>0&&(Y.value=u.templates)}catch(u){console.error("Failed to load templates:",u)}}function D(u="list"){ie.value=u,G.value="",u==="form"&&H(),Ce.value=!0}function g(){H(),G.value="",ie.value="form",Ce.value=!0}function ae(){H(),G.value="",ie.value="list"}function Re(){Ce.value=!1,H(),G.value="",ie.value="list"}function H(){te.value=null,N.value={id:"",name:"",category:"Kustom",description:"",layoutType:"custom",customHtml:`<div class="p-6 rounded-2xl bg-slate-900/90 border border-slate-700/80 text-center shadow-xl">
|
|
2
|
+
<span class="px-3 py-1 rounded-full text-xs font-black uppercase tracking-wider bg-sky-500/20 text-sky-400 border border-sky-500/30 mb-3 inline-block">{{ data.category }}</span>
|
|
3
|
+
<h2 class="text-3xl font-black text-white mb-2 leading-tight">{{ data.title }}</h2>
|
|
4
|
+
<p class="text-lg text-sky-300 font-bold mb-4">{{ data.subtitle }}</p>
|
|
5
|
+
</div>`,customCss:".custom-card-glow { box-shadow: 0 10px 30px -5px rgba(14, 165, 233, 0.3); }",promptDirective:"Instruksi khusus untuk AI saat generate format ini...",sampleJsonText:JSON.stringify({title:"JUDUL KONTEN MENARIK 2026",subtitle:"Subjudul penjelas berbasis fakta data",category:"KUSTOM VIRAL",watermark:"@SocialGen"},null,2)}}function ze(u){if(N.value.layoutType=u,u==="custom"){N.value.customHtml||(N.value.customHtml=`<div class="p-6 rounded-2xl bg-slate-900/90 border border-slate-700/80 text-center shadow-xl">
|
|
6
|
+
<span class="px-3 py-1 rounded-full text-xs font-black uppercase tracking-wider bg-sky-500/20 text-sky-400 border border-sky-500/30 mb-3 inline-block">{{ data.category }}</span>
|
|
7
|
+
<h2 class="text-3xl font-black text-white mb-2 leading-tight">{{ data.title }}</h2>
|
|
8
|
+
<p class="text-lg text-sky-300 font-bold mb-4">{{ data.subtitle }}</p>
|
|
9
|
+
</div>`);return}const a=Y.value.find(r=>r.id===u||r.layoutType===u);a&&(N.value.promptDirective=a.promptDirective,N.value.sampleJsonText=JSON.stringify(a.sampleData,null,2),N.value.customHtml=a.customHtml||"",N.value.customCss=a.customCss||"")}function Jt(u){te.value=u.id,N.value={id:u.id,name:u.name,category:u.category,description:u.description,layoutType:u.layoutType,customHtml:u.customHtml||"",customCss:u.customCss||"",promptDirective:u.promptDirective,sampleJsonText:JSON.stringify(u.sampleData,null,2)},ie.value="form"}function st(u){te.value=null,N.value={id:`${u.id}-custom-${Date.now().toString().slice(-4)}`,name:`${u.name} (Kustom)`,category:u.category||"Kustom",description:u.description,layoutType:u.layoutType,customHtml:u.customHtml||"",customCss:u.customCss||"",promptDirective:u.promptDirective,sampleJsonText:JSON.stringify(u.sampleData,null,2)},ie.value="form"}const yt=fe(()=>`Bertindaklah sebagai Lead Design Technologist & Senior Frontend Engineer untuk SocialGen (Dynamic Visual Engine for High-CPM Meta Monetization).
|
|
10
|
+
|
|
11
|
+
Saya melampirkan screenshot / gambar desain kartu visual media sosial.
|
|
12
|
+
|
|
13
|
+
Tugas Anda:
|
|
14
|
+
Analisis tata letak visual, dekorasi, tipografi, palet warna HEX, bingkai, dan struktur konten pada gambar ini, lalu ubah menjadi template visual kustom SocialGen dalam format 1 objek JSON valid persis seperti ini:
|
|
15
|
+
|
|
16
|
+
{
|
|
17
|
+
"id": "slug-unik-kebab-case",
|
|
18
|
+
"name": "Nama Template Unik (Awali dengan Emoji, misal: 📰 Orange Pill Hero & News Tablet)",
|
|
19
|
+
"category": "Kategori Template (misal: Edukasi, Finansial, Berita Viral, Ranking, Perbandingan)",
|
|
20
|
+
"description": "Deskripsi singkat 1-2 kalimat mengenai gaya visual dan kegunaan template ini.",
|
|
21
|
+
"layoutType": "custom",
|
|
22
|
+
"customHtml": "<div class=\\"my-container\\">\\n <!-- Header / Hero Section -->\\n <div class=\\"my-hero\\">\\n <div class=\\"my-subtitle\\">{{ data.subtitle }}</div>\\n <div class=\\"my-title-box\\">\\n <h1 class=\\"my-title\\">{{ data.title }}</h1>\\n </div>\\n </div>\\n\\n <!-- Body / Main Content Visual Structure (Tablet / Frame / Pill Cards) -->\\n <div class=\\"my-frame-box\\">\\n {{#each data.items}}\\n <div class=\\"my-item-card\\">\\n <div class=\\"my-item-dot\\"></div>\\n <div class=\\"my-item-text\\">{{ text }}</div>\\n </div>\\n {{/each}}\\n </div>\\n\\n <!-- Footer / Source Attribution -->\\n <div class=\\"my-footer\\">\\n <span class=\\"my-source\\">{{ data.footerNote }}</span>\\n </div>\\n</div>",
|
|
23
|
+
"customCss": ".my-container { width: 100%; max-width: 960px; margin: 0 auto; display: flex; flex-direction: column; gap: 28px; box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; } .my-hero { display: flex; flex-direction: column; gap: 12px; } .my-subtitle { font-size: 24px; font-weight: 800; color: #ffffff; text-shadow: 0 2px 8px rgba(0,0,0,0.4); } .my-title-box { background: #ffffff; border-radius: 24px; padding: 22px 32px; box-shadow: 0 12px 28px rgba(0,0,0,0.25); } .my-title { margin: 0; font-size: 56px; font-weight: 900; line-height: 1.1; color: #d84e1f; text-transform: uppercase; } .my-frame-box { display: flex; flex-direction: column; gap: 16px; background: rgba(30, 41, 59, 0.9); border-radius: 32px; padding: 26px; border: 2px solid rgba(255,255,255,0.15); box-shadow: 0 20px 40px rgba(0,0,0,0.35); } .my-item-card { display: flex; align-items: flex-start; gap: 16px; background: #ffffff; border-radius: 18px; padding: 20px 24px; border-left: 8px solid #eb6a37; box-shadow: 0 4px 12px rgba(0,0,0,0.06); } .my-item-dot { width: 14px; height: 14px; min-width: 14px; border-radius: 50%; background: #f5b027; margin-top: 6px; } .my-item-text { font-size: 22px; font-weight: 700; line-height: 1.45; color: #1e293b; margin: 0; } .my-footer { display: flex; justify-content: center; } .my-source { font-size: 17px; font-weight: 700; color: rgba(255,255,255,0.9); background: rgba(15,23,42,0.6); padding: 10px 22px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.2); text-shadow: 0 1px 3px rgba(0,0,0,0.4); }",
|
|
24
|
+
"sampleData": {
|
|
25
|
+
"templateId": "slug-unik-kebab-case",
|
|
26
|
+
"layoutType": "custom",
|
|
27
|
+
"title": "CONTOH JUDUL BESAR KAPITAL SESUAI GAMBAR",
|
|
28
|
+
"subtitle": "Contoh subjudul pengantar informatif sesuai konteks gambar",
|
|
29
|
+
"category": "KATEGORI KONTEN",
|
|
30
|
+
"watermark": "@SocialGen",
|
|
31
|
+
"theme": "sunset-orange",
|
|
32
|
+
"accentColor": "#eb6a37",
|
|
33
|
+
"footerNote": "Sumber: Lembaga Riset / Instansi Resmi (domain.go.id / .org) 2026",
|
|
34
|
+
"methodologyBadge": "Metodologi Riset Resmi 2026",
|
|
35
|
+
"disclaimer": "Ringkasan data edukasi • Bukan nasihat resmi",
|
|
36
|
+
"sourceUrl": "https://domain-resmi.org",
|
|
37
|
+
"reelsDuration": 30,
|
|
38
|
+
"caption": "Pertanyaan pemantik interaksi netizen? Tulis pendapatmu di bawah! 👇 #hashtags",
|
|
39
|
+
"items": [
|
|
40
|
+
{ "text": "Poin penjelasan pertama yang ringkas dan padat (maksimal 20 kata per poin)..." },
|
|
41
|
+
{ "text": "Poin penjelasan kedua yang mereplikasi isi kartu pada gambar..." },
|
|
42
|
+
{ "text": "Poin penjelasan ketiga yang melengkapi data infografis..." }
|
|
43
|
+
]
|
|
44
|
+
},
|
|
45
|
+
"promptDirective": "FORMAT STRUKTUR JSON:\\n- 'templateId': Wajib cantumkan 'slug-unik-kebab-case'.\\n- 'layoutType': Wajib 'custom'.\\n- 'title': Judul utama singkat, padat, kapital (2-4 kata) yang menonjol.\\n- 'subtitle': Subjudul informatif 1 baris (6-10 kata) sebagai pengantar.\\n- 'footerNote': WAJIB cantumkan nama lembaga/sumber data riset resmi & tahun data.\\n- 'items': Array berisi 3 hingga 5 objek dengan properti 'text' (1-2 kalimat ringkas padat)."
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
=======================================================
|
|
49
|
+
PANDUAN STANDAR WAJIB ARSITEKTUR TEMPLATE SOCIALGEN:
|
|
50
|
+
|
|
51
|
+
1. ATURAN KRUSIAL KODE HTML & HANDLEBARS TAGS:
|
|
52
|
+
- Kolom \\"customHtml\\" WAJIB berupa string HTML utuh dengan seluruh tag pembuka & penutup <div>, <h1>, <p>, <span>.
|
|
53
|
+
- Tag Handlebars yang didukung:
|
|
54
|
+
* {{ data.title }} untuk judul utama
|
|
55
|
+
* {{ data.subtitle }} untuk subjudul/kicker
|
|
56
|
+
* {{ data.footerNote }} untuk sumber/keterangan bawah
|
|
57
|
+
* {{#each data.items}} ... {{ text }} ... {{/each}} untuk list/grid poin
|
|
58
|
+
- DILARANG KERAS menulis variabel raw tanpa pembungkus elemen HTML dan class CSS!
|
|
59
|
+
- Semua tanda kutip dua atribut di dalam JSON wajib di-escape (misal: class=\\"my-card\\").
|
|
60
|
+
|
|
61
|
+
2. KESERASIAN ID TEMPLATE (ID MATCHING):
|
|
62
|
+
- Field root \\"id\\" dan field \\"sampleData.templateId\\" HARUS BERNILAI SAMA PERSIS (contoh: \\"orange-pill-hero\\").
|
|
63
|
+
- Jangan menggunakan ID yang berbeda antara root dan sampleData karena sistem SocialGen auto-switch menggunakan ID ini.
|
|
64
|
+
|
|
65
|
+
3. EKSTRAKSI WARNA AKURAT & ACCENT COLOR:
|
|
66
|
+
- Nilai \\"theme\\" dapat berupa salah satu preset SocialGen:
|
|
67
|
+
('blue-tech' | 'emerald-finance' | 'slate-education' | 'dark-contrast' | 'crimson-alert' | 'amber-gold' | 'cyber-violet' | 'sunset-orange' | 'nordic-frost' | 'monochrome-luxe')
|
|
68
|
+
ATAU identifier tema kustom (misal: 'navy-gold', 'crimson-dark', 'sepia-vintage').
|
|
69
|
+
- Sertakan field \\"accentColor\\" dengan kode HEX dominan yang diekstrak langsung dari gambar screenshot (contoh: \\"#eb6a37\\", \\"#d4af37\\", \\"#38bdf8\\").
|
|
70
|
+
- Dalam \\"customCss\\", Anda dapat menggunakan warna HEX langsung atau variabel CSS var(--accent-color, #eb6a37).
|
|
71
|
+
|
|
72
|
+
4. JAMINAN KONTRAS TINGGI (HIGH CONTRAST & READABILITY):
|
|
73
|
+
- Pastikan teks selalu sangat kontras dan mudah dibaca:
|
|
74
|
+
* Latar belakang gelap -> Gunakan teks putih (#ffffff) atau teks aksen terang (#fde047, #38bdf8).
|
|
75
|
+
* Kotak/Kartu terang/putih -> Gunakan teks gelap (#0f172a, #1e293b, #334155). JANGAN PERNAH gunakan teks putih di atas kartu putih!
|
|
76
|
+
* Tambahkan drop-shadow (text-shadow: 0 2px 8px rgba(0,0,0,0.5);) pada teks yang berada langsung di atas foto/background kanvas.
|
|
77
|
+
|
|
78
|
+
5. KANVAS RESPONSIVE MULTI-FORMAT (FEED 4:5 & REELS 9:16):
|
|
79
|
+
- SocialGen mengekspor konten ke Feed 4:5 (1080x1350) dan Story/Reels 9:16 (1080x1920).
|
|
80
|
+
- JANGAN PERNAH memberi tinggi mati (height: 1350px) pada kontainer utama!
|
|
81
|
+
- Kontainer terluar WAJIB menggunakan:
|
|
82
|
+
width: 100%; max-width: 960px; margin: 0 auto; display: flex; flex-direction: column;
|
|
83
|
+
- Dengan aturan ini, kartu akan selalu berada tepat di tengah (center) dan berada di dalam Safe Zone baik pada format Feed maupun Reels.
|
|
84
|
+
|
|
85
|
+
6. JANGAN DUPLIKASI HEADER & FOOTER GLOBAL SOCIALGEN:
|
|
86
|
+
- SocialGen SUDAH otomatis merender Top Metadata Bar (Category Badge & Watermark @SocialGen) di bagian paling atas kanvas.
|
|
87
|
+
- SocialGen SUDAH otomatis merender Bottom Callout (\\"💬 Drop your opinion below • Share to your feed ↗\\" & Disclaimer) di bagian paling bawah.
|
|
88
|
+
- Oleh karena itu, customHtml HANYA fokus mendesain kartu konten di bagian tengah:
|
|
89
|
+
* Header kartu (Subtitle + Judul Besar)
|
|
90
|
+
* Badan kartu (mockup tablet, framed box, kartu list pil/bubble)
|
|
91
|
+
* Sumber data (footerNote) di bagian bawah kartu
|
|
92
|
+
|
|
93
|
+
7. TIPOGRAFI STANDAR 1080px (READABILITY V2.5 & FACEBOOK REELS SAFE):
|
|
94
|
+
- Kanvas beresolusi 1080px lebar. Teks HARUS besar dan langsung terbaca di layar HP tanpa zoom:
|
|
95
|
+
* Judul Utama (title): font-size: 56px – 68px (font-weight: 900, line-height: 1.08 - 1.15)
|
|
96
|
+
* Subjudul (subtitle): font-size: 28px – 32px (font-weight: 700-800)
|
|
97
|
+
* Teks Kartu Poin (items): font-size: 25px – 28px (font-weight: 700, line-height: 1.45)
|
|
98
|
+
* Sumber Data (footerNote): font-size: 21px – 22px (font-weight: 600-700)
|
|
99
|
+
* Disclaimer & Callout: font-size: 19px – 20px (font-weight: 600-700)
|
|
100
|
+
|
|
101
|
+
8. MURNI CSS EKSPLISIT DI 'customCss':
|
|
102
|
+
- Karena aplikasi sudah di-compile, jangan mengandalkan arbitrary Tailwind baru (seperti text-[55px] atau bg-[#123456]).
|
|
103
|
+
- Semua warna, background, border, radius, bayangan, font-size, dan flexbox WAJIB ditulis lengkap dan eksplisit di \\"customCss\\".
|
|
104
|
+
|
|
105
|
+
9. KREDIBILITAS TIER 1 (META CPM MONETIZATION):
|
|
106
|
+
- Selalu sertakan field \\"methodologyBadge\\", \\"disclaimer\\", dan \\"sourceUrl\\" di sampleData untuk lolos verifikasi transparansi data audiens Tier 1.
|
|
107
|
+
|
|
108
|
+
Keluarkan HANYA 1 objek JSON valid tanpa markdown formatting (\`\`\`json) agar bisa langsung diimpor otomatis ke aplikasi SocialGen.`);async function nt(){await St(yt.value)&&(ke.value=!0,setTimeout(()=>{ke.value=!1},3e3))}function Ft(){if(G.value="",!!re.value.trim())try{let u=re.value.trim();u=u.replace(/^```json\s*/i,"").replace(/```$/i,"").trim();const a=JSON.parse(u),r=(a.id||a.sampleData?.templateId||a.name||"").toLowerCase().replace(/[^a-z0-9_-]/g,"-").replace(/^-+|-+$/g,"");if(r&&(N.value.id=r),a.name&&(N.value.name=a.name),a.category&&(N.value.category=a.category),a.description&&(N.value.description=a.description),N.value.layoutType=a.layoutType||"custom",a.customHtml){const b=a.customHtml.trim();N.value.customHtml=b,/<[a-z][\s\S]*>/i.test(b)||(G.value="⚠️ Perhatian: customHtml tidak mendeteksi tag HTML (seperti <div>, <p>). Pastikan AI menyertakan elemen HTML pembungkus class CSS.")}if(a.customCss&&(N.value.customCss=a.customCss),a.promptDirective&&(N.value.promptDirective=a.promptDirective),a.sampleData){const b={...a.sampleData};N.value.id&&(b.templateId=N.value.id,b.layoutType="custom"),b.id||(b.id="sample-"+(N.value.id||Date.now())),N.value.sampleJsonText=JSON.stringify(b,null,2)}le.value=!1,re.value=""}catch(u){G.value="Gagal membaca JSON dari AI: "+u.message}}async function Zt(){if(G.value="",!N.value.name.trim()){G.value="Nama template wajib diisi";return}const u=te.value||N.value.id.trim()||N.value.name.toLowerCase().replace(/[^a-z0-9_-]/g,"-");let a=null;try{a=JSON.parse(N.value.sampleJsonText),a.id||(a.id=u)}catch(r){G.value="JSON Sampel Data tidak valid: "+r.message;return}try{const r=await $fetch("/api/templates",{method:"POST",body:{id:u,name:N.value.name.trim(),category:N.value.category.trim()||"Kustom",description:N.value.description.trim(),layoutType:N.value.layoutType,customHtml:N.value.customHtml?.trim()||void 0,customCss:N.value.customCss?.trim()||void 0,sampleData:a,promptDirective:N.value.promptDirective.trim(),isBuiltin:!!(te.value&&Y.value.find(b=>b.id===te.value)?.isBuiltin)}});r?.templates&&(Y.value=r.templates),ie.value="list",te.value=null}catch(r){G.value=r.data?.statusMessage||r.message||"Gagal menyimpan template"}}async function Nt(u){if(confirm("Yakin ingin menghapus template kustom ini?"))try{const a=await $fetch(`/api/templates?id=${u}`,{method:"DELETE"});a?.templates&&(Y.value=a.templates)}catch(a){alert(a.data?.statusMessage||a.message||"Gagal menghapus template")}}function zt(u){ot(u.layoutType==="custom"?u.id:u.layoutType||u.id),Ce.value=!1}const T=fe(()=>{if(!oe.value.trim())return Y.value;const u=oe.value.toLowerCase();return Y.value.filter(a=>a.name.toLowerCase().includes(u)||a.category.toLowerCase().includes(u)||a.description.toLowerCase().includes(u)||a.layoutType.toLowerCase().includes(u))}),h=S(!1),_e=S(""),pe=S({}),ka=S(!1),It=S(!1),Gt=S(["cyber_blue.mp4","emerald_flow.mp4","default_bg.mp4"]),Kt=S(["synthwave_pulse.mp3","lofi_chill.mp3","default_ambient.mp3"]),Ve=S({"neon_cyber_grid.mp4":8,"financial_pulse_flow.mp4":8,"dark_luxury_particles.mp4":8,"cyber_matrix_stream.mp4":10,"cyber_blue.mp4":15,"default_bg.mp4":15,"emerald_flow.mp4":15,"cyber_pulse.mp4":15,"cyber_future_tech.mp3":15,"dark_phonk_pulse.mp3":15,"deep_finance_groove.mp3":15,"synthwave_pulse.mp3":15,"lofi_chill.mp3":15,"default_ambient.mp3":15,"motivation_cinematic.mp3":110,"lofi_viral_study.mp3":147}),Wt=fe(()=>{const u=s.options.backgroundSource||"";return Ve.value[u]||15}),Qe=fe(()=>Math.max(1,Wt.value-1)),qt=fe(()=>{const u=s.options.musicFile||"";return Ve.value[u]||30}),et=fe(()=>Math.max(1,qt.value-1));function wa(u,a){if(!u||u==="random"||typeof window>"u")return;const r=a==="video"?`/api/stream/videos/${encodeURIComponent(u)}`:`/api/stream/musics/${encodeURIComponent(u)}`;if(a==="audio"){const b=new Audio;b.preload="metadata",b.src=r,b.onloadedmetadata=()=>{if(b.duration&&!isNaN(b.duration)&&isFinite(b.duration)){const I=Math.round(b.duration);I>0&&I!==Ve.value[u]&&(Ve.value={...Ve.value,[u]:I})}}}else{const b=document.createElement("video");b.preload="metadata",b.src=r,b.onloadedmetadata=()=>{if(b.duration&&!isNaN(b.duration)&&isFinite(b.duration)){const I=Math.round(b.duration);I>0&&I!==Ve.value[u]&&(Ve.value={...Ve.value,[u]:I})}}}}Te(()=>s.options.backgroundSource,(u,a)=>{if(u&&wa(u,"video"),a!==void 0&&u!==a)Le("videoStartOffset",0);else{const r=Qe.value;(s.options.videoStartOffset||0)>r&&Le("videoStartOffset",r)}},{immediate:!0}),Te(()=>s.options.musicFile,(u,a)=>{if(u&&wa(u,"audio"),a!==void 0&&u!==a)Le("audioStartOffset",0);else{const r=et.value;(s.options.audioStartOffset||0)>r&&Le("audioStartOffset",r)}},{immediate:!0});const Ge=S(!1),Yt=S(null),Xt=S(null);async function _a(){try{const u=await $fetch("/api/media");u?.videos?.length&&(Gt.value=u.videos),u?.audio?.length&&(Kt.value=u.audio),u?.durations&&(Ve.value={...Ve.value,...u.durations})}catch(u){console.error("Failed to fetch media list:",u)}}ya(()=>{try{const u=localStorage.getItem("sg_selected_language");u&&(K.value=u)}catch{}_a(),ge(),Xe()}),Te(K,u=>{try{localStorage.setItem("sg_selected_language",u)}catch{}});async function Sa(u,a){const r=u.target,b=r.files?.[0];if(b){Ge.value=!0;try{const I=new FormData;I.append("file",b);const Q=await $fetch("/api/upload-media",{method:"POST",body:I});Q?.success&&(await _a(),Q.type==="video"?l("update:options",{...s.options,backgroundSource:Q.filename,videoStartOffset:0}):l("update:options",{...s.options,musicFile:Q.filename,audioStartOffset:0}))}catch(I){alert("Upload gagal: "+(I.data?.statusMessage||I.message))}finally{Ge.value=!1,r.value=""}}}const xe=fe(()=>{const u=(d.value||"table").trim().toLowerCase();return Y.value.find(a=>a.id.toLowerCase()===u||a.layoutType&&a.layoutType.toLowerCase()===u)||Y.value[0]}),ye=fe(()=>{const u=i.value.trim();if(!u)return null;try{return JSON.parse(u)}catch{return null}}),W=fe(()=>{if(!i.value.trim()||!ye.value)return null;const u=(ye.value.templateId||ye.value.layoutType||(Y.value.some(I=>I.id===ye.value?.id)?ye.value?.id:"")||"").trim().toLowerCase();if(!u)return null;const a=(d.value||"").trim().toLowerCase(),r=(xe.value?.layoutType||"").trim().toLowerCase();if(u===a||u===r)return null;const b=Y.value.find(I=>I.id.toLowerCase()===u||I.layoutType&&I.layoutType.toLowerCase()===u);return{jsonTemplateId:ye.value.templateId||ye.value.layoutType||ye.value.id,matchedTarget:b||null,isKnown:!!b}}),Je=fe(()=>{if(!i.value.trim()){const u=xe.value?.sampleData?JSON.parse(JSON.stringify(xe.value.sampleData)):{},a=xe.value?.id||"table",r=xe.value?.layoutType==="custom"?a:xe.value?.layoutType||a;return{...u,id:u.id||a,templateId:a,layoutType:r,customHtml:xe.value?.customHtml||void 0,customCss:xe.value?.customCss||void 0}}if(ye.value){const u=xe.value?.id||ye.value.templateId||"table",a=xe.value?.layoutType==="custom"?u:xe.value?.layoutType||u;return{...ye.value,templateId:u,layoutType:a,customHtml:xe.value?.customHtml||ye.value.customHtml||void 0,customCss:xe.value?.customCss||ye.value.customCss||void 0}}return s.modelValue});Te(()=>Je.value,u=>{l("update:modelValue",u),u.theme&&u.theme!==s.options.theme&&l("update:options",{...s.options,theme:u.theme})},{immediate:!0,deep:!0}),Te(()=>s.modelValue,u=>{if(!u)return;const a=JSON.stringify(Je.value),r=JSON.stringify(u);if(a!==r){const b=u.templateId||u.layoutType;if(b){const I=Y.value.find(Q=>Q.id.toLowerCase()===b.toLowerCase()||Q.layoutType&&Q.layoutType.toLowerCase()===b.toLowerCase());I&&(d.value=I.id)}i.value=JSON.stringify(u,null,2)}},{deep:!0}),Te(()=>s.unsavedStash,(u,a)=>{a&&!u&&($.value="editor")});function Ta(u){const a=u.target;if(i.value=a.value,!a.value.trim()){c.value="";return}try{const r=JSON.parse(a.value);if(c.value="",m.value){const b=(r.templateId||r.layoutType||(Y.value.some(I=>I.id===r.id)?r.id:"")||"").trim().toLowerCase();if(b){const I=Y.value.find(Q=>Q.id.toLowerCase()===b||Q.layoutType&&Q.layoutType.toLowerCase()===b);I?I.id.toLowerCase()!==d.value.toLowerCase()?(d.value=I.id,l("toast",`✓ JSON terdeteksi: Otomatis beralih ke template ${I.name}`,"success")):l("toast",`✓ JSON cocok dengan template ${I.name}`,"success"):l("toast",`⚠️ Format JSON: Template ID "${b}" tidak terdaftar di sistem`,"error")}else l("toast",`JSON valid dimasukkan untuk template ${xe.value?.name}`,"success")}}catch(r){c.value="Format JSON tidak valid: "+r.message}}function Qt(){i.value="",c.value="",l("toast",`Format direset ke sampel template ${xe.value?.name||""}`,"success")}function ea(){i.value="",c.value="",l("toast",`Format disesuaikan ke data sampel ${xe.value?.name||""}`,"success")}function Ca(){if(i.value.trim())try{const u=JSON.parse(i.value);i.value=JSON.stringify(u,null,2),c.value="",l("toast","JSON berhasil dirapikan","success")}catch{c.value="Format JSON tidak valid, periksa kembali kurung/tanda petik"}}function ot(u){d.value=u;const a=Y.value.find(b=>b.id===u),r=a?.name||u;if(i.value.trim()&&ye.value){const b=(ye.value.templateId||ye.value.layoutType||(Y.value.some(Se=>Se.id===ye.value?.id)?ye.value?.id:"")||"").trim().toLowerCase(),I=u.trim().toLowerCase(),Q=(a?.layoutType||"").trim().toLowerCase();b&&b!==I&&b!==Q?l("toast",`Beralih ke template ${r}. Format JSON berbeda, klik 'Pakai Sampel' untuk menyesuaikan.`,"info"):l("toast",`Template diubah ke ${r}`,"success")}else l("toast",`Template diubah ke ${r}`,"success")}function Aa(u){try{const a=i.value.trim()?JSON.parse(i.value):{...Je.value};a.title=u,i.value=JSON.stringify(a,null,2)}catch{}}function Oa(u){try{const a=i.value.trim()?JSON.parse(i.value):{...Je.value};a.watermark=u,i.value=JSON.stringify(a,null,2)}catch{}}function ms(u){try{const a=i.value.trim()?JSON.parse(i.value):{...Je.value};a.subtitle=u,i.value=JSON.stringify(a,null,2)}catch{}}function xs(u){try{const a=i.value.trim()?JSON.parse(i.value):{...Je.value};a.footerNote=u,i.value=JSON.stringify(a,null,2)}catch{}}function bs(u){try{const a=i.value.trim()?JSON.parse(i.value):{...Je.value};a.caption=u,i.value=JSON.stringify(a,null,2)}catch{}}const Oe=S("content"),vt=S(!1),Na=[{id:"custom-palette",name:"🎨 Kustom",color:"#8b5cf6"},{id:"blue-tech",name:"Blue Tech",color:"#0284c7"},{id:"emerald-finance",name:"Emerald Finance",color:"#059669"},{id:"slate-education",name:"Slate Education",color:"#64748b"},{id:"dark-contrast",name:"Dark Contrast",color:"#1e293b"},{id:"crimson-alert",name:"Crimson Alert",color:"#e11d48"},{id:"amber-gold",name:"Amber Gold",color:"#d97706"},{id:"cyber-violet",name:"Cyber Violet",color:"#7c3aed"},{id:"sunset-orange",name:"Sunset Orange",color:"#ea580c"},{id:"nordic-frost",name:"Nordic Frost",color:"#0891b2"},{id:"monochrome-luxe",name:"Monochrome Luxe",color:"#475569"}],Ia={"blue-tech":"#0284c7","emerald-finance":"#059669","slate-education":"#64748b","dark-contrast":"#1e293b","crimson-alert":"#e11d48","amber-gold":"#d97706","cyber-violet":"#7c3aed","sunset-orange":"#ea580c","nordic-frost":"#0891b2","monochrome-luxe":"#475569","custom-palette":"#8b5cf6"},hs={"blue-tech":{primary:"#38bdf8",secondary:"#818cf8",surface:"#0f172a",bg:"#020617"},"emerald-finance":{primary:"#10b981",secondary:"#34d399",surface:"#064e3b",bg:"#022c22"},"slate-education":{primary:"#60a5fa",secondary:"#a78bfa",surface:"#1e1b4b",bg:"#0f172a"},"dark-contrast":{primary:"#f8fafc",secondary:"#94a3b8",surface:"#18181b",bg:"#09090b"},"crimson-alert":{primary:"#f43f5e",secondary:"#fb7185",surface:"#4c0519",bg:"#1c0309"},"amber-gold":{primary:"#f59e0b",secondary:"#fbbf24",surface:"#451a03",bg:"#1a0802"},"cyber-violet":{primary:"#a855f7",secondary:"#ec4899",surface:"#3b0764",bg:"#18022a"},"sunset-orange":{primary:"#f97316",secondary:"#fb923c",surface:"#431407",bg:"#1c0602"},"nordic-frost":{primary:"#06b6d4",secondary:"#38bdf8",surface:"#083344",bg:"#031926"},"monochrome-luxe":{primary:"#e2e8f0",secondary:"#cbd5e1",surface:"#27272a",bg:"#18181b"}},lt=S(!1),R=As({primary:"#8b5cf6",secondary:"#ec4899",surface:"#1e1145",bg:"#0c061d"});function gs(u){let a=u.replace("#","").trim();a.length===3&&(a=a.split("").map(b=>b+b).join(""));const r=parseInt(a,16);return{r:r>>16&255,g:r>>8&255,b:r&255}}function ys(u,a,r){u/=255,a/=255,r/=255;const b=Math.max(u,a,r),I=Math.min(u,a,r);let Q=0,Se=0,je=(b+I)/2;if(b!==I){const Ne=b-I;switch(Se=je>.5?Ne/(2-b-I):Ne/(b+I),b){case u:Q=((a-r)/Ne+(a<r?6:0))/6;break;case a:Q=((r-u)/Ne+2)/6;break;case r:Q=((u-a)/Ne+4)/6;break}}return{h:Math.round(Q*360),s:Math.round(Se*100),l:Math.round(je*100)}}function ta(u,a,r){u=(u%360+360)%360,a=Math.max(0,Math.min(100,a))/100,r=Math.max(0,Math.min(100,r))/100;const b=(1-Math.abs(2*r-1))*a,I=b*(1-Math.abs(u/60%2-1)),Q=r-b/2;let Se=0,je=0,Ne=0;0<=u&&u<60?(Se=b,je=I,Ne=0):60<=u&&u<120?(Se=I,je=b,Ne=0):120<=u&&u<180?(Se=0,je=b,Ne=I):180<=u&&u<240?(Se=0,je=I,Ne=b):240<=u&&u<300?(Se=I,je=0,Ne=b):300<=u&&u<360&&(Se=b,je=0,Ne=I);const kt=sa=>Math.round((sa+Q)*255).toString(16).padStart(2,"0");return`#${kt(Se)}${kt(je)}${kt(Ne)}`}function Ma(u){const a=u||R.primary||"#8b5cf6";try{const{r,g:b,b:I}=gs(a),{h:Q,s:Se,l:je}=ys(r,b,I),Ne=ta((Q+35)%360,Math.max(Se,70),Math.max(je,55)),kt=ta(Q,Math.min(Se,35),12),sa=ta(Q,Math.min(Se,25),6);R.primary=a,R.secondary=Ne,R.surface=kt,R.bg=sa}catch(r){console.error("Auto-harmony calculation error:",r)}}function $a(){const u=s.modelValue?.palette;if(u&&u.primary)R.primary=u.primary,R.secondary=u.secondary||"#38bdf8",R.surface=u.surface||"#0f172a",R.bg=u.bg||"#020617";else{const a=ws.value||"#8b5cf6";Ma(a)}lt.value=!0}function vs(){const u={primary:R.primary,secondary:R.secondary,surface:R.surface,bg:R.bg};try{const a=i.value.trim()?JSON.parse(i.value):{...Je.value};a.theme="custom-palette",a.accentColor=u.primary,a.palette=u,i.value=JSON.stringify(a,null,2);const r={...s.modelValue,...a,theme:"custom-palette",accentColor:u.primary,palette:u};l("update:modelValue",r)}catch{}l("update:options",{...s.options,theme:"custom-palette",accentColor:u.primary,palette:u}),lt.value=!1}function ks(u){R.primary=u.primary,R.secondary=u.secondary,R.surface=u.surface,R.bg=u.bg}const ws=fe(()=>{if(s.modelValue?.palette?.primary)return s.modelValue.palette.primary;if(s.modelValue?.accentColor)return s.modelValue.accentColor;const u=s.modelValue?.theme||s.options?.theme||"blue-tech";return Ia[u]||(u.startsWith("#")?u:"#0284c7")});function _s(u,a){const r=(a||u||"").toLowerCase();return r.includes("orange")||r.includes("news")?"📰":r.includes("edu")||r.includes("infografis")?"📜":r.includes("breaking")||r.includes("alert")?"🚨":r.includes("stat")?"🎯":r.includes("table")||r.includes("matrix")?"📊":r.includes("versus")||r.includes("debate")?"⚔️":r.includes("receipt")?"🧾":r.includes("tierlist")?"🎖️":r.includes("leaderboard")||r.includes("list")?"🏆":r.includes("quote")?"💬":r.includes("timeline")?"⏳":r.includes("barchart")?"📈":"🎨"}function Da(u){if(u==="custom-palette"){$a();return}const a=Ia[u]||"#0284c7",r=hs[u]||{primary:a,secondary:"#38bdf8",surface:"#0f172a",bg:"#020617"};try{const b=i.value.trim()?JSON.parse(i.value):{...Je.value};b.theme=u,b.accentColor=a,b.palette=r,i.value=JSON.stringify(b,null,2);const I={...s.modelValue,...b,theme:u,accentColor:a,palette:r};l("update:modelValue",I)}catch{}l("update:options",{...s.options,theme:u,accentColor:a,palette:r})}const ja=[{id:"custom-palette",name:"🎨 Kustom (Palette Manager)",bgClass:"bg-gradient-to-tr from-violet-600 via-fuchsia-600 to-amber-500 border-violet-400"},{id:"dark-contrast",name:"Dark Contrast (Universal Bold)",bgClass:"bg-slate-950 border-slate-700"},{id:"blue-tech",name:"Blue Tech (AI & Software)",bgClass:"bg-blue-900 border-blue-600"},{id:"emerald-finance",name:"Emerald Finance (Salaries & Living)",bgClass:"bg-emerald-900 border-emerald-600"},{id:"amber-gold",name:"Amber Gold (Luxury & Executive)",bgClass:"bg-amber-900 border-amber-600"},{id:"slate-education",name:"Slate Education (Education & Career)",bgClass:"bg-indigo-900 border-indigo-600"},{id:"crimson-alert",name:"Crimson Alert (Breaking Shock)",bgClass:"bg-rose-900 border-rose-600"},{id:"cyber-violet",name:"Cyber Violet (Synthwave & Neon)",bgClass:"bg-purple-900 border-purple-600"},{id:"sunset-orange",name:"Sunset Orange (Warm Energy)",bgClass:"bg-orange-900 border-orange-600"},{id:"nordic-frost",name:"Nordic Frost (Polar Cyan Clean)",bgClass:"bg-cyan-900 border-cyan-600"},{id:"monochrome-luxe",name:"Monochrome Luxe (Minimalist)",bgClass:"bg-zinc-800 border-zinc-500"}],Ss=fe(()=>Y.value.find(a=>a.id===d.value)?.name||d.value||"Custom");function Ea(u){const a={...s.modelValue,reelsDuration:u};l("update:modelValue",a)}function Le(u,a){l("update:options",{...s.options,[u]:a})}function rt(u,a){const r=s.options.outputs||{feed:!0,story:!0,reels:!0};l("update:options",{...s.options,outputs:{...r,[u]:a}})}function Ra(u,a){l("autoTopic",q.value,C.value||void 0,w.value,K.value)}async function aa(){h.value=!0,ka.value=!0;try{const u=await $fetch("/api/copy-prompt",{query:{niche:q.value,layout:s.modelValue.layoutType||"table",language:K.value}});_e.value=u.prompt,pe.value={topic:u.topic,pair:u.pair,niche:u.niche,template:u.template,usedCount:u.usedCount,language:u.language||K.value}}catch(u){console.error("Failed to get manual prompt:",u)}finally{ka.value=!1}}async function Ts(){if(!_e.value)return;await St(_e.value)&&(It.value=!0,setTimeout(()=>{It.value=!1},2500))}const Mt=S(!1),$t=S(!1);async function Cs(){Mt.value=!0;try{const u=await $fetch("/api/copy-prompt",{query:{niche:q.value,layout:s.modelValue.layoutType||"table",language:K.value}});_e.value=u.prompt,pe.value={topic:u.topic,pair:u.pair,niche:u.niche,template:u.template,usedCount:u.usedCount,language:u.language||K.value},await St(u.prompt)&&($t.value=!0,setTimeout(()=>{$t.value=!1},2500))}catch(u){console.error("Failed to copy topic prompt:",u)}finally{Mt.value=!1}}function Pa(){s.history.length!==0&&confirm(`Bersihkan semua ${s.history.length} riwayat generate otomatis?`)&&l("clearAllHistory")}function Va(u){if(!u)return"";try{return new Date(u).toLocaleDateString("id-ID",{day:"numeric",month:"short",hour:"2-digit",minute:"2-digit"})}catch{return""}}return(u,a)=>(p(),f("div",Ks,[n(B)?(p(),f("div",Ws,[t("div",qs,[t("div",Ys,[t("div",null,[t("h3",Xs,[y(n(Za),{class:"w-4 h-4 text-sky-400"}),a[93]||(a[93]=Z(" Kelola & Buat Niche Baru ",-1))]),a[94]||(a[94]=t("p",{class:"text-[11px] text-slate-400 mt-0.5"}," Simpan niche favoritmu. AI dan Prompt Generator akan otomatis menggunakannya. ",-1))]),t("button",{onClick:a[0]||(a[0]=r=>B.value=!1),class:"p-1 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800"},[y(n(Rt),{class:"w-4 h-4"})])]),t("div",Qs,[t("div",en,[t("span",null,x(n(j)?"✏️ Edit Niche":"➕ Tambah Niche Baru"),1),n(j)?(p(),f("button",{key:0,onClick:a[1]||(a[1]=r=>{j.value=null,J.value={id:"",name:"",theme:"blue-tech",description:""}}),class:"text-[10px] text-slate-400 hover:text-white"}," Batal Edit ")):M("",!0)]),t("div",tn,[t("div",null,[a[95]||(a[95]=t("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Nama Niche",-1)),X(t("input",{"onUpdate:modelValue":a[2]||(a[2]=r=>n(J).name=r),type:"text",placeholder:"Contoh: Kuliner & Restoran, Otomotif EV",class:"w-full bg-slate-900 border border-slate-800 rounded-xl px-2.5 py-1.5 text-xs text-white focus:outline-none focus:border-sky-500"},null,512),[[de,n(J).name]])]),t("div",null,[a[97]||(a[97]=t("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Tema Default",-1)),X(t("select",{"onUpdate:modelValue":a[3]||(a[3]=r=>n(J).theme=r),class:"w-full bg-slate-900 border border-slate-800 rounded-xl px-2.5 py-1.5 text-xs text-white focus:outline-none focus:border-sky-500"},[...a[96]||(a[96]=[ft('<option value="blue-tech">🔵 Blue Tech</option><option value="emerald-finance">🟢 Emerald Finance</option><option value="slate-education">🟣 Slate Education</option><option value="dark-contrast">⚫ Dark Contrast</option><option value="crimson-alert">🔴 Crimson Alert</option><option value="amber-gold">🟡 Amber Gold</option><option value="cyber-violet">🟪 Cyber Violet</option><option value="sunset-orange">🟠 Sunset Orange</option><option value="nordic-frost">❄️ Nordic Frost</option><option value="monochrome-luxe">⚪ Monochrome Luxe</option>',10)])],512),[[it,n(J).theme]])])]),t("div",null,[a[98]||(a[98]=t("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Fokus Topik & Instruksi Prompt",-1)),X(t("textarea",{"onUpdate:modelValue":a[4]||(a[4]=r=>n(J).description=r),rows:"2",placeholder:"Jelaskan topik yang ingin disorot AI (misal: perbandingan harga kopi, biaya buka gerai, margin laba kuliner...)",class:"w-full bg-slate-900 border border-slate-800 rounded-xl p-2 text-xs text-slate-200 focus:outline-none focus:border-sky-500 resize-none leading-relaxed"},null,512),[[de,n(J).description]])]),t("button",{onClick:we,class:"self-end px-4 py-1.5 rounded-xl bg-sky-600 hover:bg-sky-500 text-white font-bold text-xs transition flex items-center gap-1.5 shadow"},[y(n(tt),{class:"w-3.5 h-3.5"}),t("span",null,x(n(j)?"Perbarui Niche":"Simpan Niche"),1)])]),t("div",an,[t("div",sn," Daftar Niche Tersimpan ("+x(n(he).length)+") ",1),t("div",nn,[(p(!0),f(ue,null,be(n(he),r=>(p(),f("div",{key:r.id,class:"p-2.5 rounded-xl border bg-slate-950 border-slate-800 flex items-start justify-between gap-2"},[t("div",on,[t("div",ln,[t("span",rn,x(r.name),1),t("span",dn,x(r.theme||"blue-tech"),1)]),t("p",un,x(r.description),1)]),t("div",cn,[t("button",{onClick:b=>Pe(r),class:"p-1.5 rounded-lg text-slate-400 hover:text-sky-300 hover:bg-slate-800 transition",title:"Edit Niche"},[y(n(jt),{class:"w-3.5 h-3.5"})],8,pn),t("button",{onClick:b=>ee(r.id),class:"p-1.5 rounded-lg text-slate-400 hover:text-rose-400 hover:bg-slate-800 transition",title:"Hapus Niche"},[y(n(ut),{class:"w-3.5 h-3.5"})],8,fn)])]))),128))])])])])):M("",!0),n(h)?(p(),f("div",mn,[t("div",xn,[t("div",bn,[t("div",null,[t("h3",hn,[y(n(ra),{class:"w-4 h-4 text-purple-400"}),a[99]||(a[99]=Z(" Master Prompt AI (Dynamic Research & Zero-Collision) ",-1))]),a[100]||(a[100]=t("p",{class:"text-[11px] text-slate-400 mt-0.5"}," Salin prompt ini ke ChatGPT / Gemini / Claude / DeepSeek untuk mencari topik terbaru. ",-1))]),t("button",{onClick:a[5]||(a[5]=r=>h.value=!1),class:"p-1 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800"},[y(n(Rt),{class:"w-4 h-4"})])]),t("div",gn,[a[101]||(a[101]=t("span",{class:"font-bold text-sky-400"},"Niche Aktif:",-1)),t("span",yn,x(n(he).find(r=>r.id===n(q))?.name||"Default"),1),a[102]||(a[102]=t("span",{class:"text-slate-500"},"•",-1)),a[103]||(a[103]=t("span",{class:"font-bold text-amber-400"},"Template:",-1)),t("span",vn,x(n(pe).template||"Otomatis"),1),a[104]||(a[104]=t("span",{class:"text-slate-500"},"•",-1)),a[105]||(a[105]=t("span",{class:"font-bold text-emerald-400"},"Bahasa:",-1)),t("span",kn,x(n(pe).language||"Bahasa Indonesia 🇮🇩"),1),a[106]||(a[106]=t("span",{class:"text-slate-500"},"•",-1)),t("span",wn,x(n(pe).usedCount||0)+" Topik Riwayat Dikecualikan",1)]),t("div",_n,[t("textarea",{value:n(_e),readonly:"",rows:"12",class:"w-full h-full bg-slate-950 text-slate-300 font-mono text-[11px] p-3 rounded-xl border border-slate-800 focus:outline-none resize-none leading-relaxed select-all"},null,8,Sn)]),t("div",Tn,[a[107]||(a[107]=t("span",{class:"text-[11px] text-slate-400"},[Z(" Paste hasil JSON yang kamu buat ke kolom "),t("b",null,"RAW JSON"),Z(" SocialGen. ")],-1)),t("button",{onClick:Ts,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"},[n(It)?(p(),De(n(tt),{key:0,class:"w-4 h-4 text-emerald-400"})):(p(),De(n(Ke),{key:1,class:"w-4 h-4"})),t("span",null,x(n(It)?"Prompt Berhasil Disalin!":"Copy Master Prompt"),1)])])])])):M("",!0),n(lt)?(p(),f("div",{key:2,onClick:a[17]||(a[17]=dt(r=>lt.value=!1,["self"])),class:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm flex items-center justify-center p-4"},[t("div",Cn,[t("div",An,[a[108]||(a[108]=t("div",null,[t("h3",{class:"text-base font-black text-white flex items-center gap-2"},[t("span",{class:"text-lg"},"🎨"),Z(" Palette Manager & Custom Colors ")]),t("p",{class:"text-[11px] text-slate-400 mt-0.5"}," Kelola paduan warna utama, kontras sekunder, permukaan kartu, dan atmosfer kanvas. ")],-1)),t("button",{onClick:a[6]||(a[6]=r=>lt.value=!1),class:"text-slate-400 hover:text-white p-1 rounded-lg hover:bg-slate-800 transition"},[y(n(Rt),{class:"w-5 h-5"})])]),t("div",On,[t("div",Nn,[a[109]||(a[109]=t("div",{class:"flex items-center justify-between"},[t("span",{class:"text-[10px] font-black uppercase text-slate-400"},"1. Warna Utama (Primary)"),t("span",{class:"text-[9px] text-sky-400 font-bold"},"Subtitle & Badge")],-1)),t("div",In,[t("label",{class:"relative flex items-center justify-center w-10 h-10 rounded-xl border-2 border-slate-700 hover:border-sky-400 cursor-pointer shadow-md transition overflow-hidden shrink-0",style:Ie({backgroundColor:n(R).primary}),title:"Pilih Warna Utama"},[X(t("input",{type:"color","onUpdate:modelValue":a[7]||(a[7]=r=>n(R).primary=r),class:"absolute inset-0 opacity-0 w-full h-full cursor-pointer"},null,512),[[de,n(R).primary]])],4),X(t("input",{type:"text","onUpdate:modelValue":a[8]||(a[8]=r=>n(R).primary=r),class:"w-full bg-slate-900 border border-slate-800 rounded-xl px-2.5 py-1.5 font-mono text-xs text-white font-bold focus:outline-none focus:border-sky-500 uppercase",placeholder:"#8B5CF6",maxlength:"7"},null,512),[[de,n(R).primary]])])]),t("div",Mn,[a[110]||(a[110]=t("div",{class:"flex items-center justify-between"},[t("span",{class:"text-[10px] font-black uppercase text-slate-400"},"2. Warna Sekunder (Kontras)"),t("span",{class:"text-[9px] text-fuchsia-400 font-bold"},"Kolom Kanan / VS")],-1)),t("div",$n,[t("label",{class:"relative flex items-center justify-center w-10 h-10 rounded-xl border-2 border-slate-700 hover:border-sky-400 cursor-pointer shadow-md transition overflow-hidden shrink-0",style:Ie({backgroundColor:n(R).secondary}),title:"Pilih Warna Sekunder"},[X(t("input",{type:"color","onUpdate:modelValue":a[9]||(a[9]=r=>n(R).secondary=r),class:"absolute inset-0 opacity-0 w-full h-full cursor-pointer"},null,512),[[de,n(R).secondary]])],4),X(t("input",{type:"text","onUpdate:modelValue":a[10]||(a[10]=r=>n(R).secondary=r),class:"w-full bg-slate-900 border border-slate-800 rounded-xl px-2.5 py-1.5 font-mono text-xs text-white font-bold focus:outline-none focus:border-sky-500 uppercase",placeholder:"#EC4899",maxlength:"7"},null,512),[[de,n(R).secondary]])])]),t("div",Dn,[a[111]||(a[111]=t("div",{class:"flex items-center justify-between"},[t("span",{class:"text-[10px] font-black uppercase text-slate-400"},"3. Kartu (Surface Tint)"),t("span",{class:"text-[9px] text-indigo-400 font-bold"},"Latar Kotak")],-1)),t("div",jn,[t("label",{class:"relative flex items-center justify-center w-10 h-10 rounded-xl border-2 border-slate-700 hover:border-sky-400 cursor-pointer shadow-md transition overflow-hidden shrink-0",style:Ie({backgroundColor:n(R).surface}),title:"Pilih Warna Kartu"},[X(t("input",{type:"color","onUpdate:modelValue":a[11]||(a[11]=r=>n(R).surface=r),class:"absolute inset-0 opacity-0 w-full h-full cursor-pointer"},null,512),[[de,n(R).surface]])],4),X(t("input",{type:"text","onUpdate:modelValue":a[12]||(a[12]=r=>n(R).surface=r),class:"w-full bg-slate-900 border border-slate-800 rounded-xl px-2.5 py-1.5 font-mono text-xs text-white font-bold focus:outline-none focus:border-sky-500 uppercase",placeholder:"#1E1145",maxlength:"7"},null,512),[[de,n(R).surface]])])]),t("div",En,[a[112]||(a[112]=t("div",{class:"flex items-center justify-between"},[t("span",{class:"text-[10px] font-black uppercase text-slate-400"},"4. Atmosfer Kanvas (Bg)"),t("span",{class:"text-[9px] text-slate-400 font-bold"},"Gradasi Gelap")],-1)),t("div",Rn,[t("label",{class:"relative flex items-center justify-center w-10 h-10 rounded-xl border-2 border-slate-700 hover:border-sky-400 cursor-pointer shadow-md transition overflow-hidden shrink-0",style:Ie({backgroundColor:n(R).bg}),title:"Pilih Warna Latar Kanvas"},[X(t("input",{type:"color","onUpdate:modelValue":a[13]||(a[13]=r=>n(R).bg=r),class:"absolute inset-0 opacity-0 w-full h-full cursor-pointer"},null,512),[[de,n(R).bg]])],4),X(t("input",{type:"text","onUpdate:modelValue":a[14]||(a[14]=r=>n(R).bg=r),class:"w-full bg-slate-900 border border-slate-800 rounded-xl px-2.5 py-1.5 font-mono text-xs text-white font-bold focus:outline-none focus:border-sky-500 uppercase",placeholder:"#0C061D",maxlength:"7"},null,512),[[de,n(R).bg]])])])]),t("button",{onClick:a[15]||(a[15]=r=>Ma(n(R).primary)),type:"button",class:"w-full py-2 px-3 rounded-2xl bg-gradient-to-r from-violet-600/30 via-fuchsia-600/30 to-amber-500/30 border border-violet-500/40 hover:border-violet-400 text-violet-200 font-bold text-xs flex items-center justify-center gap-2 transition hover:scale-[1.01] active:scale-[0.99] shadow-md"},[...a[113]||(a[113]=[t("span",null,"⚡ Auto-Harmonize dari Warna Utama",-1)])]),t("div",Pn,[a[114]||(a[114]=t("span",{class:"text-[10px] font-black uppercase tracking-wider text-slate-400"},"Inspirasi Komposisi Warna:",-1)),t("div",Vn,[(p(),f(ue,null,be([{name:"Cyber Neon",primary:"#00f5d4",secondary:"#f72585",surface:"#131127",bg:"#080711"},{name:"Royal Gold",primary:"#fbbf24",secondary:"#38bdf8",surface:"#20180a",bg:"#0a0803"},{name:"Synthwave",primary:"#c084fc",secondary:"#f43f5e",surface:"#1e1145",bg:"#0b051b"},{name:"Emerald Luxe",primary:"#10b981",secondary:"#fbbf24",surface:"#052e25",bg:"#021410"},{name:"Crimson Shock",primary:"#f43f5e",secondary:"#fb923c",surface:"#300713",bg:"#130206"}],r=>t("button",{key:r.name,onClick:b=>ks(r),type:"button",class:"px-2.5 py-1.5 rounded-xl border border-slate-800 hover:border-slate-600 bg-slate-950 flex items-center gap-2 text-[11px] font-semibold text-slate-300 transition hover:bg-slate-800"},[t("div",Bn,[t("span",{class:"w-3 h-3 rounded-full border border-black/40",style:Ie({backgroundColor:r.primary})},null,4),t("span",{class:"w-3 h-3 rounded-full border border-black/40",style:Ie({backgroundColor:r.secondary})},null,4),t("span",{class:"w-3 h-3 rounded-full border border-black/40",style:Ie({backgroundColor:r.surface})},null,4)]),t("span",null,x(r.name),1)],8,Ln)),64))])]),t("div",{class:"p-3.5 rounded-2xl border transition shadow-inner relative overflow-hidden",style:Ie({background:`radial-gradient(circle at 50% 20%, ${n(R).surface} 0%, ${n(R).bg} 100%)`,borderColor:`${n(R).primary}44`})},[t("div",Hn,[t("span",{class:"text-[9px] font-black uppercase px-2 py-0.5 rounded-full border",style:Ie({backgroundColor:`${n(R).primary}22`,borderColor:`${n(R).primary}66`,color:n(R).primary})}," PREVIEW PALETTE ",4),t("span",{class:"text-[9px] font-bold",style:Ie({color:n(R).secondary})}," KOLOM KANAN ★ ",4)]),t("div",{class:"p-2.5 rounded-xl border",style:Ie({backgroundColor:`${n(R).surface}ee`,borderColor:`${n(R).primary}55`})},[a[115]||(a[115]=t("h4",{class:"text-xs font-black text-white"},"Pratinjau Judul Konten",-1)),t("p",{class:"text-[10px] font-bold mt-0.5",style:Ie({color:n(R).primary})}," Subjudul mengikuti Warna Utama ",4)],4)],4),t("div",Un,[t("button",{onClick:a[16]||(a[16]=r=>lt.value=!1),type:"button",class:"px-4 py-2 rounded-xl text-slate-400 hover:text-white font-bold text-xs hover:bg-slate-800 transition"}," Batal "),t("button",{onClick:vs,type:"button",class:"px-5 py-2.5 rounded-xl bg-gradient-to-r from-sky-500 via-indigo-600 to-purple-600 hover:from-sky-400 hover:to-indigo-500 text-white font-black text-xs shadow-lg transition hover:scale-[1.02] active:scale-[0.98]"}," Terapkan Palette Ini ")])])])):M("",!0),n(Ce)?(p(),f("div",{key:3,onClick:dt(Re,["self"]),class:"fixed inset-0 z-50 bg-black/80 backdrop-blur-sm flex items-center justify-center p-4"},[t("div",Jn,[t("div",Fn,[t("div",null,[t("h3",Zn,[y(n(Ja),{class:"w-4 h-4 text-sky-400"}),a[116]||(a[116]=Z(" Kelola Template Visual (Dynamic Template System) ",-1))]),a[117]||(a[117]=t("p",{class:"text-[11px] text-slate-400 mt-0.5"}," Buat format baru, edit sampel tampilan, dan atur prompt AI spesifik per template. ",-1))]),t("button",{onClick:Re,class:"p-1 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800"},[y(n(Rt),{class:"w-4 h-4"})])]),t("div",zn,[t("div",Gn,[t("button",{onClick:ae,class:E(["px-3 py-1 rounded-lg transition font-bold text-xs",n(ie)==="list"?"bg-slate-800 text-sky-400 shadow":"text-slate-400 hover:text-white"])}," Daftar Template ("+x(n(Y).length)+") ",3),t("button",{onClick:g,class:E(["px-3 py-1 rounded-lg transition font-bold text-xs flex items-center gap-1",n(ie)==="form"&&!n(te)?"bg-slate-800 text-emerald-400 shadow":"text-slate-400 hover:text-white"])},[y(n(wt),{class:"w-3.5 h-3.5"}),a[118]||(a[118]=t("span",null,"Buat Template Baru",-1))],2),n(te)&&n(ie)==="form"?(p(),f("span",Kn,[y(n(jt),{class:"w-3 h-3"}),a[119]||(a[119]=t("span",null,"Sedang Edit Template",-1))])):M("",!0)]),n(ie)==="list"?X((p(),f("input",{key:0,"onUpdate:modelValue":a[18]||(a[18]=r=>Be(oe)?oe.value=r:null),type:"text",placeholder:"Cari template...",class:"bg-slate-900 border border-slate-800 rounded-lg px-2 py-0.5 text-[11px] text-white focus:outline-none focus:border-sky-500 w-36"},null,512)),[[de,n(oe)]]):M("",!0)]),n(ie)==="list"?(p(),f("div",Wn,[n(T).length===0?(p(),f("div",qn,' Tidak ada template yang cocok dengan pencarian "'+x(n(oe))+'". ',1)):M("",!0),(p(!0),f(ue,null,be(n(T),r=>(p(),f("div",{key:r.id,class:"p-3 rounded-2xl border bg-slate-950 border-slate-800/80 hover:border-slate-700 transition flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 group"},[t("div",Yn,[t("div",Xn,[t("span",Qn,x(r.name),1),t("span",eo,x(r.category),1),t("span",{class:E(["px-1.5 py-0.2 rounded text-[8px] font-bold uppercase tracking-wider",r.isBuiltin?"bg-slate-800 text-slate-400 border border-slate-700":"bg-purple-950 text-purple-300 border border-purple-800"])},x(r.isBuiltin?"Bawaan":"⭐ Kustom"),3),t("span",to," layout: "+x(r.layoutType),1)]),t("p",ao,x(r.description||"Tidak ada deskripsi."),1)]),t("div",so,[t("button",{onClick:b=>zt(r),class:"px-2.5 py-1 rounded-xl bg-sky-600/20 hover:bg-sky-600/40 text-sky-300 border border-sky-500/40 font-bold text-[10px] transition flex items-center gap-1",title:"Pilih dan gunakan format template ini"},[y(n(tt),{class:"w-3 h-3"}),a[120]||(a[120]=t("span",null,"Pilih Format",-1))],8,no),t("button",{onClick:b=>st(r),class:"p-1.5 rounded-lg text-slate-400 hover:text-sky-300 hover:bg-slate-800 transition",title:"Duplikasi sebagai template kustom baru"},[y(n(Ke),{class:"w-3.5 h-3.5"})],8,oo),r.isBuiltin?M("",!0):(p(),f("button",{key:0,onClick:b=>Jt(r),class:"p-1.5 rounded-lg text-slate-400 hover:text-amber-300 hover:bg-slate-800 transition",title:"Edit template kustom"},[y(n(jt),{class:"w-3.5 h-3.5"})],8,lo)),r.isBuiltin?M("",!0):(p(),f("button",{key:1,onClick:b=>Nt(r.id),class:"p-1.5 rounded-lg text-slate-400 hover:text-rose-400 hover:bg-slate-800 transition",title:"Hapus template kustom"},[y(n(ut),{class:"w-3.5 h-3.5"})],8,ro))])]))),128))])):(p(),f("div",io,[n(G)?(p(),f("div",uo,x(n(G)),1)):M("",!0),n(te)?(p(),f("div",co,[t("div",po,[t("div",fo,[y(n(jt),{class:"w-4 h-4"})]),t("div",mo,[t("div",xo,[a[121]||(a[121]=t("span",null,"Sedang Mengedit:",-1)),t("span",bo,x(n(N).name),1)]),t("div",ho,"ID: "+x(n(N).id)+" • Perubahan akan memperbarui template yang tersimpan",1)])]),t("button",{onClick:g,type:"button",class:"px-2.5 py-1 rounded-xl bg-slate-900 hover:bg-slate-800 text-slate-200 border border-slate-700 text-[10px] font-bold transition flex items-center gap-1 shrink-0 ml-2"},[y(n(wt),{class:"w-3 h-3"}),a[122]||(a[122]=t("span",null,"Beralih ke Buat Baru",-1))])])):M("",!0),t("div",go,[t("div",yo,[a[124]||(a[124]=t("div",{class:"flex items-center gap-2"},[t("span",{class:"text-xl"},"🤖"),t("div",null,[t("h4",{class:"text-xs font-black text-white"},"Buat Template Otomatis dari Screenshot / Gambar"),t("p",{class:"text-[10px] text-slate-400"},"Punya referensi gambar desain? Salin prompt AI dan kirim bersama screenshot ke ChatGPT / Claude / Gemini.")])],-1)),t("div",vo,[t("button",{onClick:nt,type:"button",class:E(["px-2.5 py-1.5 rounded-xl text-xs font-bold transition flex items-center gap-1.5 shadow",n(ke)?"bg-emerald-600 text-white":"bg-sky-600 hover:bg-sky-500 text-white"])},[y(n(Ke),{class:"w-3.5 h-3.5"}),t("span",null,x(n(ke)?"✓ Prompt Tersalin!":"Salin Prompt Bantuan AI"),1)],2),t("button",{onClick:a[19]||(a[19]=r=>Ae.value=!n(Ae)),type:"button",class:"px-2 py-1.5 rounded-xl bg-slate-800 hover:bg-slate-700 text-slate-200 text-xs font-bold transition flex items-center gap-1",title:n(Ae)?"Sembunyikan teks prompt":"Lihat / salin teks prompt manual di HP"},[t("span",null,x(n(Ae)?"Tutup Teks":"👁️ Lihat Teks Prompt"),1)],8,ko),t("button",{onClick:a[20]||(a[20]=r=>le.value=!n(le)),type:"button",class:"px-2.5 py-1.5 rounded-xl bg-slate-800 hover:bg-slate-700 text-slate-200 text-xs font-bold transition flex items-center gap-1"},[...a[123]||(a[123]=[t("span",null,"📥 Tempel JSON",-1)])])])]),n(Ae)?(p(),f("div",wo,[t("div",_o,[a[125]||(a[125]=t("label",{class:"text-[10px] font-bold text-sky-400"},"Teks Lengkap Prompt Bantuan AI (Bisa ditandai/disalin manual di HP):",-1)),t("button",{onClick:a[21]||(a[21]=r=>Ae.value=!1),class:"text-[10px] text-slate-400 hover:text-white"},"✕ Tutup")]),t("textarea",{value:n(yt),readonly:"",rows:"6",class:"w-full bg-slate-900 border border-slate-700 rounded-lg p-2 text-[11px] text-sky-200 font-mono select-all focus:outline-none focus:border-sky-500 custom-scrollbar"},null,8,So)])):M("",!0),n(le)?(p(),f("div",To,[a[126]||(a[126]=t("label",{class:"text-[10px] font-bold text-sky-400"},"Tempelkan respon JSON dari AI di sini:",-1)),X(t("textarea",{"onUpdate:modelValue":a[22]||(a[22]=r=>Be(re)?re.value=r:null),rows:"4",placeholder:'Tempelkan respon JSON dari AI di sini (contoh: { "name": "...", "layoutType": "custom", "customHtml": "...", "sampleData": {...} })...',class:"w-full bg-slate-900 border border-slate-700 rounded-lg p-2 text-xs text-sky-200 font-mono focus:outline-none focus:border-sky-500"},null,512),[[de,n(re)]]),t("div",Co,[t("button",{onClick:a[23]||(a[23]=r=>le.value=!1),type:"button",class:"px-2.5 py-1 rounded-lg text-[10px] font-bold text-slate-400 hover:text-white"}," Tutup "),t("button",{onClick:Ft,type:"button",class:"px-3 py-1 rounded-lg bg-emerald-600 hover:bg-emerald-500 text-white text-[10px] font-bold shadow"}," Terapkan ke Form Otomatis ")])])):M("",!0)]),t("div",Ao,[t("div",null,[a[127]||(a[127]=t("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"ID Template (Slug Unik)",-1)),X(t("input",{"onUpdate:modelValue":a[24]||(a[24]=r=>n(N).id=r),disabled:!!n(te),type:"text",placeholder:"misal: tech-radar, crypto-card",class:"w-full bg-slate-950 border border-slate-800 rounded-xl px-2.5 py-1.5 text-xs text-white focus:outline-none focus:border-sky-500 disabled:opacity-50"},null,8,Oo),[[de,n(N).id]])]),t("div",null,[a[128]||(a[128]=t("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Nama Template",-1)),X(t("input",{"onUpdate:modelValue":a[25]||(a[25]=r=>n(N).name=r),type:"text",placeholder:"misal: ⚡ Tech Radar 2026",class:"w-full bg-slate-950 border border-slate-800 rounded-xl px-2.5 py-1.5 text-xs text-white focus:outline-none focus:border-sky-500"},null,512),[[de,n(N).name]])]),t("div",null,[a[129]||(a[129]=t("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Kategori",-1)),X(t("input",{"onUpdate:modelValue":a[26]||(a[26]=r=>n(N).category=r),type:"text",placeholder:"misal: Perbandingan, Peringkat, Finansial",class:"w-full bg-slate-950 border border-slate-800 rounded-xl px-2.5 py-1.5 text-xs text-white focus:outline-none focus:border-sky-500"},null,512),[[de,n(N).category]])])]),t("div",No,[t("div",null,[a[131]||(a[131]=t("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Base Layout Visual Engine",-1)),t("select",{value:n(N).layoutType,onChange:a[27]||(a[27]=r=>ze(r.target.value)),class:"w-full bg-slate-950 border border-slate-800 rounded-xl px-2.5 py-1.5 text-xs text-sky-300 font-semibold focus:outline-none focus:border-sky-500"},[...a[130]||(a[130]=[ft('<option value="custom">🎨 Custom HTML & CSS (Bebas / Desain Sendiri)</option><option value="table">📊 Comparison Table</option><option value="versus">⚔️ Versus Showdown Arena</option><option value="receipt">🧾 Monthly Living Invoice</option><option value="news">📰 Special Report Pamphlet</option><option value="stat">🎯 Big Shocking Number</option><option value="timeline">⏳ 10-Year Shift (Then vs Now)</option><option value="barchart">📈 Income Allocation Bars</option><option value="list">🏆 Top 5 Ranked List</option><option value="quote">💬 Hot Take / Quote Debate</option><option value="leaderboard">🥇 Multi-Country Leaderboard (Top 10)</option><option value="editorial">📰 Editorial Storytelling Deep Dive</option><option value="matrix">📊 Multi-Column Matrix (3-4 Negara)</option><option value="debate">⚡ Debate Arena (Pro vs Kontra)</option><option value="tierlist">🎖️ Tier List Ranking (S, A, B, C)</option>',15)])],40,Io)]),t("div",null,[a[132]||(a[132]=t("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Deskripsi Ringkas",-1)),X(t("input",{"onUpdate:modelValue":a[28]||(a[28]=r=>n(N).description=r),type:"text",placeholder:"Jelaskan kegunaan format tampilan template ini...",class:"w-full bg-slate-950 border border-slate-800 rounded-xl px-2.5 py-1.5 text-xs text-white focus:outline-none focus:border-sky-500"},null,512),[[de,n(N).description]])])]),n(N).layoutType==="custom"?(p(),f("div",Mo,[t("div",$o,[t("span",Do,[y(n(la),{class:"w-3.5 h-3.5"}),a[133]||(a[133]=Z(" Template Engine HTML & Styling CSS ",-1))]),a[134]||(a[134]=t("span",{class:"text-[10px] text-slate-400 font-mono"},"Gunakan {{ data.title }} & {{#each data.items}}",-1))]),t("div",null,[a[135]||(a[135]=t("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"HTML Template (Tailwind utility classes didukung penuh)",-1)),X(t("textarea",{"onUpdate:modelValue":a[29]||(a[29]=r=>n(N).customHtml=r),rows:"6",placeholder:`<div class="p-6 rounded-2xl bg-slate-900/90 border border-slate-700 text-center">
|
|
109
|
+
<h2 class="text-3xl font-black text-white">{{ data.title }}</h2>
|
|
110
|
+
<p class="text-slate-300">{{ data.subtitle }}</p>
|
|
111
|
+
</div>`,class:"w-full bg-slate-900 border border-slate-800 rounded-xl p-2.5 text-xs text-sky-300 font-mono leading-relaxed focus:outline-none focus:border-sky-500"},null,512),[[de,n(N).customHtml]])]),t("div",null,[a[136]||(a[136]=t("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"Custom CSS (Opsional - animasi, gradien unik, glassmorphism)",-1)),X(t("textarea",{"onUpdate:modelValue":a[30]||(a[30]=r=>n(N).customCss=r),rows:"3",placeholder:".my-custom-card { backdrop-filter: blur(16px); }",class:"w-full bg-slate-900 border border-slate-800 rounded-xl p-2.5 text-xs text-emerald-300 font-mono leading-relaxed focus:outline-none focus:border-emerald-500"},null,512),[[de,n(N).customCss]])])])):M("",!0),t("div",null,[a[137]||(a[137]=t("label",{class:"block text-[10px] font-bold text-slate-400 mb-1"},"AI Prompt Directive (Aturan Khusus Generator)",-1)),X(t("textarea",{"onUpdate:modelValue":a[31]||(a[31]=r=>n(N).promptDirective=r),rows:"3",placeholder:"Instruksi spesifik untuk AI Gemini / ChatGPT saat meriset konten dengan template ini...",class:"w-full bg-slate-950 border border-slate-800 rounded-xl p-2.5 text-xs text-slate-200 focus:outline-none focus:border-sky-500 font-mono leading-relaxed"},null,512),[[de,n(N).promptDirective]])]),t("div",null,[a[138]||(a[138]=t("div",{class:"flex items-center justify-between mb-1"},[t("label",{class:"text-[10px] font-bold text-slate-400"},"Sampel Data JSON (Pristine Default Tampilan)"),t("span",{class:"text-[10px] text-slate-500"},"Akan langsung ditampilkan di Live Preview")],-1)),X(t("textarea",{"onUpdate:modelValue":a[32]||(a[32]=r=>n(N).sampleJsonText=r),rows:"7",class:"w-full bg-slate-950 border border-slate-800 rounded-xl p-2.5 text-xs text-sky-200 focus:outline-none focus:border-sky-500 font-mono leading-relaxed select-all"},null,512),[[de,n(N).sampleJsonText]])]),t("div",jo,[t("button",{onClick:ae,class:"px-3.5 py-1.5 rounded-xl bg-slate-800 hover:bg-slate-700 text-slate-300 font-bold text-xs transition"}," Batal "),t("button",{onClick:Zt,class:"px-5 py-1.5 rounded-xl bg-gradient-to-r from-emerald-600 to-teal-600 hover:from-emerald-500 hover:to-teal-500 text-white font-bold text-xs shadow-lg transition flex items-center gap-1.5"},[y(n(tt),{class:"w-3.5 h-3.5"}),t("span",null,x(n(te)?"Perbarui Template":"Simpan Template"),1)])])]))])])):M("",!0),t("div",Eo,[t("div",Ro,[t("div",Po,[t("button",{onClick:a[33]||(a[33]=r=>Oe.value="content"),type:"button",class:E(["px-2.5 py-1.5 rounded-xl text-xs font-bold flex items-center gap-1 shrink-0 transition",n(Oe)==="content"?"bg-sky-500 text-white shadow font-black":"text-slate-400 hover:text-white"])},[...a[139]||(a[139]=[t("span",null,"📝 Konten",-1)])],2),t("button",{onClick:a[34]||(a[34]=r=>Oe.value="design"),type:"button",class:E(["px-2.5 py-1.5 rounded-xl text-xs font-bold flex items-center gap-1 shrink-0 transition",n(Oe)==="design"?"bg-sky-500 text-white shadow font-black":"text-slate-400 hover:text-white"])},[...a[140]||(a[140]=[t("span",null,"🎨 Template",-1)])],2),t("button",{onClick:a[35]||(a[35]=r=>Oe.value="media"),type:"button",class:E(["px-2.5 py-1.5 rounded-xl text-xs font-bold flex items-center gap-1 shrink-0 transition",n(Oe)==="media"?"bg-sky-500 text-white shadow font-black":"text-slate-400 hover:text-white"])},[...a[141]||(a[141]=[t("span",null,"🎬 Media",-1)])],2),t("button",{onClick:a[36]||(a[36]=r=>Oe.value="ai"),type:"button",class:E(["px-2.5 py-1.5 rounded-xl text-xs font-bold flex items-center gap-1 shrink-0 transition",n(Oe)==="ai"?"bg-sky-500 text-white shadow font-black":"text-slate-400 hover:text-white"])},[...a[142]||(a[142]=[t("span",null,"⚡ AI Topic",-1)])],2),t("button",{onClick:a[37]||(a[37]=r=>Oe.value="history"),type:"button",class:E(["px-2.5 py-1.5 rounded-xl text-xs font-bold flex items-center gap-1 shrink-0 transition",n(Oe)==="history"?"bg-sky-500 text-white shadow font-black":"text-slate-400 hover:text-white"])},[...a[143]||(a[143]=[t("span",null,"💾 Draft",-1)])],2)]),t("button",{onClick:a[38]||(a[38]=r=>vt.value=!0),type:"button",class:"px-2 py-1.5 rounded-xl bg-slate-800 hover:bg-slate-700 text-[10px] font-mono font-bold text-sky-300 border border-slate-700 flex items-center gap-0.5 shrink-0 ml-1",title:"Buka RAW JSON Editor"},[...a[144]||(a[144]=[t("span",null,"</> JSON",-1)])])]),n(Oe)==="content"?(p(),f("div",Vo,[n(c)||o.validationError||n(W)?(p(),f("div",{key:0,class:E(["p-3.5 rounded-2xl border text-xs shadow-lg space-y-2.5 animate-in fade-in",n(c)||o.validationError?"bg-rose-950/80 border-rose-500/60 text-rose-200":"bg-amber-950/80 border-amber-500/60 text-amber-200"])},[t("div",Lo,[y(n(Ba),{class:E(["w-4 h-4 shrink-0 mt-0.5",n(c)||o.validationError?"text-rose-400":"text-amber-400"])},null,8,["class"]),t("div",Bo,[t("div",Ho,x(n(c)?"Sintaks JSON Tidak Valid":n(W)?"Perbedaan Format Template":"Data Belum Sesuai Template"),1),t("p",Uo,[n(c)?(p(),f("span",Jo,x(n(c)),1)):n(W)?(p(),f("span",Fo,[a[145]||(a[145]=Z(" Data JSON saat ini dibuat untuk template ",-1)),t("b",Zo,x(n(W).matchedTarget?.name||n(W).jsonTemplateId),1),a[146]||(a[146]=Z(", sedangkan template aktif saat ini adalah ",-1)),t("b",zo,x(n(xe).name),1),a[147]||(a[147]=Z(". ",-1))])):(p(),f("span",Go,x(o.validationError),1))])])]),t("div",Ko,[t("button",{onClick:ea,type:"button",class:"px-3 py-1.5 rounded-xl bg-white text-slate-950 text-xs font-black shadow transition active:scale-95 flex items-center gap-1.5"},[y(n(Fa),{class:"w-3.5 h-3.5"}),t("span",null,"Pakai Sampel "+x(n(xe).name),1)]),n(W)?.isKnown&&n(W).matchedTarget?(p(),f("button",{key:0,onClick:a[39]||(a[39]=r=>ot(n(W).matchedTarget.id)),type:"button",class:"px-2.5 py-1.5 rounded-xl bg-amber-500/20 hover:bg-amber-500/40 text-amber-300 border border-amber-500/40 text-xs font-bold transition flex items-center gap-1 active:scale-95"},[t("span",null,"Beralih ke "+x(n(W).matchedTarget.name),1)])):M("",!0),t("button",{onClick:a[40]||(a[40]=r=>vt.value=!0),type:"button",class:"px-2.5 py-1.5 rounded-xl bg-slate-800 text-slate-200 text-xs font-bold border border-slate-700 transition ml-auto active:scale-95"},[...a[148]||(a[148]=[t("span",null,"</> Buka JSON",-1)])])])],2)):(p(),f("div",Wo,[t("div",qo,[a[149]||(a[149]=t("span",{class:"w-2 h-2 rounded-full bg-emerald-400 shrink-0"},null,-1)),a[150]||(a[150]=t("span",{class:"text-slate-400"},"Template Aktif:",-1)),t("span",Yo,x(n(xe).name),1)]),t("button",{onClick:ea,type:"button",class:"text-[10px] text-sky-400 hover:text-sky-300 font-bold shrink-0 ml-2 transition",title:"Muat ulang sampel data template aktif"}," Reset ke Sampel ")])),t("div",Xo,[a[151]||(a[151]=t("div",{class:"flex items-center justify-between"},[t("label",{class:"text-xs font-extrabold text-white flex items-center gap-1.5"},[t("span",null,"Judul Utama (Title)")]),t("span",{class:"text-[9px] text-sky-400 font-bold uppercase tracking-wider"},"Wajib")],-1)),t("input",{type:"text",value:o.modelValue.title,onInput:a[41]||(a[41]=r=>Aa(r.target.value)),placeholder:"Judul Utama Konten...",class:"w-full bg-slate-950 border border-slate-800 rounded-xl px-3 py-2 text-xs text-white font-bold focus:outline-none focus:border-sky-500 transition"},null,40,Qo)]),t("div",el,[a[152]||(a[152]=t("label",{class:"text-xs font-bold text-slate-300"},"Subtitle / Penjelasan Ringkas",-1)),t("textarea",{value:o.modelValue.subtitle||"",onInput:a[42]||(a[42]=r=>ms(r.target.value)),rows:"2",placeholder:"Ringkasan atau penjelas judul...",class:"w-full bg-slate-950 border border-slate-800 rounded-xl p-2.5 text-xs text-slate-200 focus:outline-none focus:border-sky-500 transition resize-none leading-relaxed"},null,40,tl)]),t("div",al,[t("div",sl,[a[153]||(a[153]=t("label",{class:"text-[11px] font-bold text-slate-400"},"Watermark Handle",-1)),t("input",{type:"text",value:o.modelValue.watermark||"@SocialGen",onInput:a[43]||(a[43]=r=>Oa(r.target.value)),placeholder:"@NamaAkun",class:"w-full bg-slate-950 border border-slate-800 rounded-xl px-2.5 py-1.5 text-sky-400 font-bold text-xs focus:outline-none focus:border-sky-500"},null,40,nl)]),t("div",ol,[a[154]||(a[154]=t("label",{class:"text-[11px] font-bold text-slate-400"},"Sumber (Footer Note)",-1)),t("input",{type:"text",value:o.modelValue.footerNote||"",onInput:a[44]||(a[44]=r=>xs(r.target.value)),placeholder:"Source: Data Wire 2026...",class:"w-full bg-slate-950 border border-slate-800 rounded-xl px-2.5 py-1.5 text-slate-300 text-xs focus:outline-none focus:border-sky-500"},null,40,ll)])]),t("div",rl,[t("div",il,[a[156]||(a[156]=t("span",{class:"text-xs font-bold text-slate-300"},"Viral Caption & Hashtags",-1)),t("button",{onClick:a[45]||(a[45]=async()=>{o.modelValue.caption&&(await n(St)(o.modelValue.caption),l("toast","Caption berhasil disalin!","success"))}),type:"button",class:"text-[11px] font-bold text-sky-400 hover:text-sky-300 flex items-center gap-1 active:scale-95 transition"},[y(n(Ke),{class:"w-3 h-3"}),a[155]||(a[155]=t("span",null,"Salin Caption",-1))])]),t("textarea",{value:o.modelValue.caption||"",onInput:a[46]||(a[46]=r=>bs(r.target.value)),rows:"3",placeholder:"Tulis caption reels / post di sini...",class:"w-full bg-slate-950 border border-slate-800 rounded-xl p-2.5 text-xs text-slate-200 focus:outline-none focus:border-sky-500 leading-relaxed resize-none"},null,40,dl)])])):n(Oe)==="design"?(p(),f("div",ul,[t("div",cl,[t("div",pl,[t("div",null,[t("span",fl,"Pilih Format Template ("+x(n(Y).length)+")",1),a[157]||(a[157]=t("p",{class:"text-[10px] text-slate-400"},"Geser ke kanan untuk melihat semua format",-1))]),t("button",{onClick:a[47]||(a[47]=r=>D("list")),type:"button",class:"text-[10px] font-bold text-sky-400 hover:text-sky-300 flex items-center gap-1 bg-slate-800 px-2 py-1 rounded-lg border border-slate-700"},[y(n(Za),{class:"w-3 h-3"}),a[158]||(a[158]=t("span",null,"Kelola",-1))])]),n(W)||o.validationError||n(c)?(p(),f("div",ml,[t("div",xl,[a[160]||(a[160]=t("span",{class:"text-sm"},"⚠️",-1)),t("span",bl,[n(W)?(p(),f("span",hl,[a[159]||(a[159]=Z("Format JSON milik: ",-1)),t("b",null,x(n(W).matchedTarget?.name||n(W).jsonTemplateId),1)])):n(c)?(p(),f("span",gl,"Sintaks JSON tidak valid")):(p(),f("span",yl,x(o.validationError),1))])]),t("button",{onClick:ea,type:"button",class:"px-2.5 py-1 rounded-lg bg-amber-500 text-slate-950 font-black text-[10px] shrink-0 active:scale-95 shadow ml-2"}," Pakai Sampel ")])):M("",!0),t("div",vl,[(p(!0),f(ue,null,be(n(Y),r=>(p(),f("button",{key:r.id,onClick:b=>ot(r.id),type:"button",class:E(["shrink-0 w-28 p-2.5 rounded-2xl border text-center flex flex-col items-center gap-1.5 transition active:scale-95",n(d)===r.id?"bg-slate-950 border-sky-500 shadow-lg shadow-sky-500/20":"bg-slate-950/70 border-slate-800 hover:border-slate-700"])},[t("div",wl,x(_s(r.layoutType,r.id)),1),t("span",_l,x(r.name),1),t("span",{class:E(["text-[8px] font-bold px-1.5 py-0.2 rounded uppercase tracking-wider",r.isBuiltin?"bg-slate-800 text-slate-400":"bg-purple-950 text-purple-300 border border-purple-800"])},x(r.isBuiltin?r.category:"⭐ Kustom"),3)],10,kl))),128))])]),t("div",Sl,[t("div",Tl,[a[161]||(a[161]=t("span",{class:"text-xs font-extrabold text-white"},"Tema & Palette Warna",-1)),t("span",Cl,x(o.modelValue.theme==="custom-palette"?"🎨 Kustom":Na.find(r=>r.id===(o.modelValue.theme||"blue-tech"))?.name||o.modelValue.theme||"Blue Tech"),1)]),t("div",Al,[(p(),f(ue,null,be(Na,r=>t("button",{key:r.id,onClick:b=>Da(r.id),type:"button",class:"flex flex-col items-center gap-1 p-1 rounded-xl transition",title:r.name},[t("div",{class:E(["w-7 h-7 rounded-full border-2 transition transform active:scale-90 flex items-center justify-center text-[11px]",[r.id==="custom-palette"?"bg-gradient-to-tr from-violet-600 via-fuchsia-600 to-amber-500":"",o.modelValue.theme===r.id?"ring-2 ring-white ring-offset-2 ring-offset-slate-950 scale-105":"border-white/10 hover:border-white/40"]]),style:Ie(r.id!=="custom-palette"?{backgroundColor:r.color}:{})},[r.id==="custom-palette"?(p(),f("span",Nl,"🎨")):M("",!0)],6),t("span",Il,x(r.name.split(" ")[0]),1)],8,Ol)),64))])]),t("div",Ml,[t("div",$l,[a[163]||(a[163]=t("div",{class:"flex flex-col"},[t("span",{class:"text-xs font-bold text-white"},"Buat Template Kustom"),t("span",{class:"text-[10px] text-slate-400"},"Punya referensi kartu baru? Tambahkan ke sistem.")],-1)),t("button",{onClick:g,type:"button",class:"px-3 py-1.5 rounded-xl bg-gradient-to-r from-sky-600 to-indigo-600 hover:from-sky-500 text-white text-xs font-bold shadow flex items-center gap-1.5 active:scale-95 transition"},[y(n(wt),{class:"w-3.5 h-3.5"}),a[162]||(a[162]=t("span",null,"+ Buat Template",-1))])]),t("div",Dl,[a[164]||(a[164]=t("span",{class:"text-[10px] text-slate-400 flex items-center gap-1"},[t("span",null,"🤖 Prompt AI Buat Template")],-1)),t("div",jl,[t("button",{onClick:nt,type:"button",class:"px-2.5 py-1 rounded-lg bg-sky-600/20 hover:bg-sky-600/40 text-sky-300 text-[10px] font-bold border border-sky-500/30 flex items-center gap-1 transition active:scale-95"},[y(n(Ke),{class:"w-3 h-3"}),t("span",null,x(n(ke)?"✓ Tersalin":"Salin Prompt"),1)]),t("button",{onClick:a[48]||(a[48]=r=>Ae.value=!n(Ae)),type:"button",class:"px-2 py-1 rounded-lg bg-slate-800 text-slate-300 text-[10px] font-bold border border-slate-700"},[t("span",null,x(n(Ae)?"Tutup":"Lihat"),1)])])]),n(Ae)?(p(),f("div",El,[a[165]||(a[165]=t("p",{class:"text-[9px] text-slate-400 mb-1"},"Kirim prompt ini bersama screenshot kartu ke ChatGPT / Gemini / Claude untuk menghasilkan HTML & CSS template:",-1)),t("textarea",{value:n(yt),readonly:"",rows:"5",class:"w-full bg-slate-900 border border-slate-700 rounded-lg p-2 text-[10px] text-sky-200 font-mono select-all focus:outline-none custom-scrollbar"},null,8,Rl)])):M("",!0)])])):n(Oe)==="media"?(p(),f("div",Pl,[t("div",Vl,[t("div",Ll,[t("label",Bl,[y(n(ua),{class:"w-4 h-4"}),a[166]||(a[166]=t("span",null,"Background Video",-1))]),t("button",{onClick:a[49]||(a[49]=r=>n(Yt)?.click()),disabled:n(Ge),type:"button",class:"px-2.5 py-1 rounded-xl bg-sky-950/60 border border-sky-500/40 text-sky-300 text-[10px] font-bold flex items-center gap-1"},[y(n(Et),{class:"w-3 h-3"}),a[167]||(a[167]=t("span",null,"Upload MP4",-1))],8,Hl)]),t("select",{value:o.options.backgroundSource||"random",onChange:a[50]||(a[50]=r=>{const b=r.target.value;l("update:options",{...o.options,backgroundSource:b,videoStartOffset:0})}),class:"w-full bg-slate-950 border border-slate-800 rounded-xl px-3 py-2 text-slate-200 text-xs font-semibold focus:outline-none focus:border-sky-500"},[a[168]||(a[168]=t("option",{value:"random"},"🔀 Acak Video",-1)),(p(!0),f(ue,null,be(n(Gt),r=>(p(),f("option",{key:r,value:r},x(r.replace(".mp4","").replace(/_/g," ")),9,Jl))),128)),a[169]||(a[169]=t("option",{value:"pexels"},"🌐 Pexels API (Auto HD)",-1))],40,Ul),t("div",Fl,[t("div",Zl,[t("span",zl,[a[170]||(a[170]=Z(" ✂️ Mulai Detik: ",-1)),t("strong",Gl,x(Math.min(o.options.videoStartOffset||0,n(Qe)))+"s",1),Z(" / "+x(n(Wt))+"s ",1)]),t("button",{onClick:a[51]||(a[51]=r=>Le("videoStartOffset",0)),type:"button",class:"text-[10px] text-sky-400 hover:text-white"}," Reset 0s ")]),t("input",{type:"range",min:"0",max:n(Qe),step:"1",value:Math.min(o.options.videoStartOffset||0,n(Qe)),onInput:a[52]||(a[52]=r=>Le("videoStartOffset",Number(r.target.value))),class:"w-full h-1.5 bg-slate-950 rounded appearance-none cursor-pointer accent-sky-400"},null,40,Kl)])]),t("div",Wl,[t("div",ql,[t("label",Yl,[y(n(Ct),{class:"w-4 h-4"}),a[171]||(a[171]=t("span",null,"Musik Reels",-1))]),t("button",{onClick:a[53]||(a[53]=r=>n(Xt)?.click()),disabled:n(Ge),type:"button",class:"px-2.5 py-1 rounded-xl bg-purple-950/60 border border-purple-500/40 text-purple-300 text-[10px] font-bold flex items-center gap-1"},[y(n(Et),{class:"w-3 h-3"}),a[172]||(a[172]=t("span",null,"Upload MP3",-1))],8,Xl)]),t("select",{value:o.options.musicFile||"random",onChange:a[54]||(a[54]=r=>{const b=r.target.value;l("update:options",{...o.options,musicFile:b,audioStartOffset:0})}),class:"w-full bg-slate-950 border border-slate-800 rounded-xl px-3 py-2 text-slate-200 text-xs font-semibold focus:outline-none focus:border-purple-500"},[a[173]||(a[173]=t("option",{value:"random"},"🔀 Acak Musik",-1)),(p(!0),f(ue,null,be(n(Kt),r=>(p(),f("option",{key:r,value:r},x(r.replace(".mp3","").replace(/_/g," ")),9,er))),128))],40,Ql),t("div",tr,[t("div",ar,[t("span",sr,[a[174]||(a[174]=Z(" ✂️ Mulai Intro: ",-1)),t("strong",nr,x(Math.min(o.options.audioStartOffset||0,n(et)))+"s",1),Z(" / "+x(n(qt))+"s ",1)]),t("button",{onClick:a[55]||(a[55]=r=>Le("audioStartOffset",0)),type:"button",class:"text-[10px] text-purple-400 hover:text-white"}," Reset 0s ")]),t("input",{type:"range",min:"0",max:n(et),step:"1",value:Math.min(o.options.audioStartOffset||0,n(et)),onInput:a[56]||(a[56]=r=>Le("audioStartOffset",Number(r.target.value))),class:"w-full h-1.5 bg-slate-950 rounded appearance-none cursor-pointer accent-purple-400"},null,40,or)])]),t("div",lr,[t("label",rr,[y(n(oa),{class:"w-3.5 h-3.5 text-emerald-400"}),a[175]||(a[175]=t("span",null,"Durasi Reels:",-1))]),t("div",ir,[(p(),f(ue,null,be([7,10,15,30,60],r=>t("button",{key:r,onClick:b=>Ea(r),type:"button",class:E(["px-2.5 py-1 rounded-xl text-xs font-bold transition",o.modelValue.reelsDuration===r?"bg-emerald-500 text-white shadow":"bg-slate-950 text-slate-400 border border-slate-800"])},x(r)+"s ",11,dr)),64))])]),t("div",ur,[a[179]||(a[179]=t("span",{class:"text-[11px] font-bold text-slate-400 uppercase tracking-wider block"},"Format Output Aktif",-1)),t("div",cr,[t("label",{class:E(["flex items-center gap-1.5 p-2 rounded-xl border text-xs cursor-pointer select-none",o.options.outputs?.feed!==!1?"bg-sky-500/10 border-sky-500/40 text-sky-200":"bg-slate-950 border-slate-800 text-slate-500"])},[t("input",{type:"checkbox",checked:o.options.outputs?.feed!==!1,onChange:a[57]||(a[57]=r=>rt("feed",r.target.checked)),class:"rounded text-sky-500"},null,40,pr),a[176]||(a[176]=t("span",{class:"font-bold"},"Feed 4:5",-1))],2),t("label",{class:E(["flex items-center gap-1.5 p-2 rounded-xl border text-xs cursor-pointer select-none",o.options.outputs?.story!==!1?"bg-indigo-500/10 border-indigo-500/40 text-indigo-200":"bg-slate-950 border-slate-800 text-slate-500"])},[t("input",{type:"checkbox",checked:o.options.outputs?.story!==!1,onChange:a[58]||(a[58]=r=>rt("story",r.target.checked)),class:"rounded text-indigo-500"},null,40,fr),a[177]||(a[177]=t("span",{class:"font-bold"},"Story 9:16",-1))],2),t("label",{class:E(["flex items-center gap-1.5 p-2 rounded-xl border text-xs cursor-pointer select-none",o.options.outputs?.reels!==!1?"bg-emerald-500/10 border-emerald-500/40 text-emerald-200":"bg-slate-950 border-slate-800 text-slate-500"])},[t("input",{type:"checkbox",checked:o.options.outputs?.reels!==!1,onChange:a[59]||(a[59]=r=>rt("reels",r.target.checked)),class:"rounded text-emerald-500"},null,40,mr),a[178]||(a[178]=t("span",{class:"font-bold"},"Reels MP4",-1))],2)])])])):n(Oe)==="ai"?(p(),f("div",xr,[t("div",br,[t("div",hr,[t("span",gr,[y(n(ct),{class:"w-4 h-4 text-sky-400"}),a[180]||(a[180]=Z(" Auto-Topic AI Generator ",-1))]),t("span",yr,x(n(w)),1)]),t("div",vr,[t("div",kr,[a[181]||(a[181]=t("label",{class:"text-[10px] font-bold text-slate-400"},"Pilih Niche",-1)),X(t("select",{"onUpdate:modelValue":a[60]||(a[60]=r=>Be(q)?q.value=r:null),class:"w-full bg-slate-950 border border-slate-800 rounded-xl px-2.5 py-2 text-xs text-white font-bold focus:outline-none"},[(p(!0),f(ue,null,be(n(he),r=>(p(),f("option",{key:r.id,value:r.id},x(r.name),9,wr))),128))],512),[[it,n(q)]])]),t("div",_r,[a[183]||(a[183]=t("label",{class:"text-[10px] font-bold text-slate-400"},"Bahasa Konten",-1)),X(t("select",{"onUpdate:modelValue":a[61]||(a[61]=r=>Be(K)?K.value=r:null),class:"w-full bg-slate-950 border border-slate-800 rounded-xl px-2.5 py-2 text-xs text-emerald-300 font-bold focus:outline-none"},[...a[182]||(a[182]=[ft('<option value="id">🇮🇩 Indonesia</option><option value="en">🇺🇸 English</option><option value="es">🇪🇸 Español</option><option value="ja">🇯🇵 日本語</option><option value="de">🇩🇪 Deutsch</option>',5)])],512),[[it,n(K)]])])]),t("button",{onClick:a[62]||(a[62]=r=>Ra()),disabled:o.isGenerating||o.isAutoTopicLoading,type:"button",class:"w-full py-3 rounded-2xl bg-gradient-to-r from-sky-500 via-indigo-600 to-purple-600 text-white font-black text-xs shadow-xl shadow-sky-500/25 flex items-center justify-center gap-2 active:scale-98 transition disabled:opacity-50"},[y(n(ct),{class:E(["w-4 h-4",{"animate-spin":o.isAutoTopicLoading}])},null,8,["class"]),t("span",null,x(o.isAutoTopicLoading?"Meriset Data Viral...":"✨ Auto-Topic Viral Baru"),1)],8,Sr)]),t("div",Tr,[t("div",Cr,[t("div",Ar,[y(n(ra),{class:"w-4 h-4 text-purple-400"}),a[184]||(a[184]=t("span",{class:"text-xs font-black text-white"},"Master Prompt Riset Topik AI",-1))]),t("button",{onClick:aa,type:"button",class:"px-2 py-0.5 rounded-lg bg-purple-950/60 border border-purple-500/40 text-purple-300 text-[10px] font-bold flex items-center gap-1 hover:text-white"},[y(n(Ha),{class:"w-3 h-3"}),a[185]||(a[185]=t("span",null,"Buka Detail",-1))])]),a[186]||(a[186]=t("p",{class:"text-[11px] text-slate-400 leading-relaxed"},[Z(" Salin prompt riset cerdas ini ke "),t("b",null,"ChatGPT / Gemini / Claude"),Z(" untuk riset topik konten viral terbaru sesuai niche & template yang aktif (bebas bentrok riwayat): ")],-1)),t("div",Or,[t("button",{onClick:Cs,disabled:n(Mt),type:"button",class:"flex-1 px-3 py-2.5 rounded-xl bg-gradient-to-r from-purple-600 to-indigo-600 hover:from-purple-500 text-white text-xs font-bold shadow-lg transition flex items-center justify-center gap-1.5 active:scale-95 disabled:opacity-50"},[n($t)?(p(),De(n(tt),{key:0,class:"w-3.5 h-3.5 text-emerald-300"})):(p(),De(n(Ke),{key:1,class:"w-3.5 h-3.5"})),t("span",null,x(n(Mt)?"Menyiapkan Prompt...":n($t)?"✓ Master Prompt Tersalin!":"Salin Master Prompt Topik"),1)],8,Nr),t("button",{onClick:aa,type:"button",title:"Lihat teks prompt manual lengkap",class:"px-3 py-2.5 rounded-xl bg-slate-800 text-slate-300 text-xs font-bold border border-slate-700 hover:bg-slate-700 transition"},[y(n(Ha),{class:"w-3.5 h-3.5"})])])])])):n(Oe)==="history"?(p(),f("div",Ir,[t("div",Mr,[t("button",{onClick:a[63]||(a[63]=r=>$.value="drafts"),type:"button",class:E(["flex-1 py-1.5 px-3 rounded-xl transition text-center",n($)==="drafts"?"bg-amber-500 text-slate-950 font-black shadow":"text-slate-400 hover:text-white"])},[t("span",null,"Drafts ("+x(o.drafts.length)+")",1)],2),t("button",{onClick:a[64]||(a[64]=r=>$.value="history"),type:"button",class:E(["flex-1 py-1.5 px-3 rounded-xl transition text-center",n($)==="history"?"bg-purple-600 text-white font-black shadow":"text-slate-400 hover:text-white"])},[t("span",null,"Riwayat ("+x(o.history.length)+")",1)],2)]),n($)==="drafts"?(p(),f("div",$r,[t("div",Dr,[a[188]||(a[188]=t("span",{class:"text-[11px] font-bold text-slate-400 uppercase tracking-wider"},"Daftar Draft Tersimpan",-1)),t("button",{onClick:a[65]||(a[65]=r=>l("saveDraft")),type:"button",class:"text-[11px] font-bold text-amber-400 hover:text-amber-300 flex items-center gap-1"},[y(n(na),{class:"w-3 h-3"}),a[187]||(a[187]=t("span",null,"+ Simpan Draft",-1))])]),o.drafts.length===0?(p(),f("div",jr," Belum ada draft tersimpan. ")):M("",!0),(p(!0),f(ue,null,be(o.drafts,(r,b)=>(p(),f("div",{key:b,onClick:I=>l("selectDraft",b),class:"p-3 rounded-2xl border bg-slate-900/80 border-slate-800 hover:border-amber-500/40 flex items-center justify-between cursor-pointer active:scale-98 transition shadow"},[t("div",Rr,[t("div",Pr,x(r.title||"Tanpa Judul"),1),t("div",Vr,x(r.category||"Draft"),1)]),t("button",{onClick:dt(I=>l("deleteDraft",b),["stop"]),type:"button",class:"p-1.5 text-slate-400 hover:text-rose-400 rounded-lg transition"},[y(n(ut),{class:"w-3.5 h-3.5"})],8,Lr)],8,Er))),128))])):(p(),f("div",Br,[t("div",Hr,[a[189]||(a[189]=t("span",{class:"text-[11px] font-bold text-slate-400 uppercase tracking-wider"},"Riwayat Generasi Terakhir",-1)),o.history.length>0?(p(),f("button",{key:0,onClick:Pa,type:"button",class:"text-[10px] font-bold text-rose-400 hover:text-rose-300"}," Hapus Semua ")):M("",!0)]),o.history.length===0?(p(),f("div",Ur," Belum ada riwayat pembuatan. ")):M("",!0),(p(!0),f(ue,null,be(o.history,(r,b)=>(p(),f("div",{key:b,onClick:I=>l("selectHistory",b),class:"p-3 rounded-2xl border bg-slate-900/80 border-slate-800 hover:border-purple-500/40 flex items-center justify-between cursor-pointer active:scale-98 transition shadow"},[t("div",Fr,[t("div",Zr,x(r.title),1),t("div",zr,x(r.category)+" • "+x(Va(r.generatedAt)),1)]),t("button",{onClick:dt(I=>l("deleteHistory",b),["stop"]),type:"button",class:"p-1.5 text-slate-400 hover:text-rose-400 rounded-lg transition"},[y(n(ut),{class:"w-3.5 h-3.5"})],8,Gr)],8,Jr))),128))]))])):M("",!0),n(vt)?(p(),f("div",Kr,[t("div",Wr,[t("div",qr,[a[190]||(a[190]=t("div",{class:"flex items-center gap-2"},[t("span",{class:"text-xs font-bold text-white font-mono"},"</> RAW JSON SocialGen"),t("span",{class:"text-[9px] px-1.5 py-0.2 rounded-full bg-sky-500/20 text-sky-300 font-mono"},"Format V2")],-1)),t("button",{onClick:a[66]||(a[66]=r=>vt.value=!1),type:"button",class:"w-7 h-7 rounded-full bg-slate-800 flex items-center justify-center text-xs text-slate-400 hover:text-white"}," ✕ ")]),n(W)||n(c)||o.validationError?(p(),f("div",{key:0,class:E(["p-2.5 rounded-xl border text-[11px] flex items-center justify-between gap-2 shadow",n(c)||o.validationError?"bg-rose-950/80 border-rose-500/50 text-rose-200":"bg-amber-950/80 border-amber-500/50 text-amber-200"])},[t("div",Yr,[a[192]||(a[192]=t("span",null,"⚠️",-1)),t("span",Xr,[n(c)?(p(),f("span",Qr,x(n(c)),1)):n(W)?(p(),f("span",ei,[a[191]||(a[191]=Z("JSON untuk template: ",-1)),t("b",null,x(n(W).matchedTarget?.name||n(W).jsonTemplateId),1)])):(p(),f("span",ti,x(o.validationError),1))])]),n(W)?.isKnown&&n(W).matchedTarget?(p(),f("button",{key:0,onClick:a[67]||(a[67]=r=>ot(n(W).matchedTarget.id)),type:"button",class:"px-2 py-0.5 rounded-lg bg-amber-500 text-slate-950 font-bold text-[10px] shrink-0 active:scale-95 shadow"}," Ganti Template ")):M("",!0)],2)):M("",!0),t("textarea",{value:n(i),onInput:Ta,rows:"8",spellcheck:"false",class:"w-full bg-slate-950 text-sky-200 text-xs font-mono p-3 rounded-xl border border-slate-800 focus:outline-none focus:border-sky-500/50 resize-y leading-relaxed",placeholder:"Paste Content JSON here..."},null,40,ai),t("div",si,[t("button",{onClick:Qt,type:"button",class:"px-3 py-2 rounded-xl bg-slate-800 hover:bg-slate-700 text-xs font-bold text-amber-400"}," Pakai Sample "),t("button",{onClick:Ca,type:"button",class:"px-3 py-2 rounded-xl bg-slate-800 hover:bg-slate-700 text-xs font-bold text-sky-400"}," Format JSON "),t("button",{onClick:a[68]||(a[68]=r=>vt.value=!1),type:"button",class:"px-4 py-2 rounded-xl bg-sky-500 hover:bg-sky-400 text-xs font-bold text-white shadow-lg"}," Selesai ")])])])):M("",!0)]),t("div",ni,[t("div",oi,[t("div",li,[t("div",ri,[y(n(Zs),{class:"w-3.5 h-3.5 text-sky-400"}),a[193]||(a[193]=t("span",{class:"text-xs font-black text-white"},"Content Studio",-1))]),t("div",ii,[y(n(Ps),{class:"w-3.5 h-3.5 text-sky-400"}),a[195]||(a[195]=t("span",{class:"text-[11px] font-bold text-slate-400"},"Niche:",-1)),X(t("select",{"onUpdate:modelValue":a[69]||(a[69]=r=>Be(q)?q.value=r:null),class:"bg-transparent text-[11px] font-black text-white focus:outline-none cursor-pointer max-w-[130px] truncate",title:"Pilih Niche Konten"},[(p(!0),f(ue,null,be(n(he),r=>(p(),f("option",{key:r.id,value:r.id,class:"bg-slate-900 text-white"},x(r.name),9,di))),128))],512),[[it,n(q)]]),t("button",{onClick:$e,class:"p-0.5 px-1 rounded bg-slate-800 hover:bg-slate-700 text-sky-400 text-[10px] font-bold transition flex items-center gap-0.5",title:"Kelola & Buat Niche Baru"},[y(n(wt),{class:"w-3 h-3"}),a[194]||(a[194]=t("span",null,"Niche",-1))])]),t("div",ui,[y(n(Rs),{class:"w-3.5 h-3.5 text-emerald-400"}),X(t("select",{"onUpdate:modelValue":a[70]||(a[70]=r=>Be(K)?K.value=r:null),class:"bg-transparent text-[11px] font-bold text-emerald-300 focus:outline-none cursor-pointer"},[...a[196]||(a[196]=[ft('<option value="id" class="bg-slate-900 text-white">🇮🇩 Indonesia</option><option value="en" class="bg-slate-900 text-white">🇺🇸 English</option><option value="es" class="bg-slate-900 text-white">🇪🇸 Español</option><option value="ja" class="bg-slate-900 text-white">🇯🇵 日本語</option><option value="de" class="bg-slate-900 text-white">🇩🇪 Deutsch</option>',5)])],512),[[it,n(K)]])])]),t("div",ci,[t("button",{onClick:aa,title:"Buat prompt manual bebas bentrok untuk ChatGPT / Gemini Web",class:"px-2.5 py-1.5 rounded-xl bg-purple-950/40 hover:bg-purple-900/50 border border-purple-500/30 text-purple-300 text-xs font-bold transition flex items-center gap-1.5 shadow-sm active:scale-95"},[y(n(ra),{class:"w-3.5 h-3.5 text-purple-400"}),a[197]||(a[197]=t("span",null,"Prompt Manual",-1))]),t("button",{onClick:a[71]||(a[71]=r=>Ra()),disabled:o.isGenerating||o.isAutoTopicLoading,class:"px-3 py-1.5 rounded-xl bg-gradient-to-r from-sky-500 via-indigo-600 to-purple-600 hover:opacity-90 text-white text-xs font-bold transition flex items-center gap-1.5 shadow-md shadow-indigo-500/20 active:scale-95 disabled:opacity-50"},[y(n(ct),{class:E(["w-3.5 h-3.5 text-amber-300",{"animate-spin":o.isAutoTopicLoading}])},null,8,["class"]),t("span",null,x(o.isAutoTopicLoading?"Meriset Data...":"✨ Auto-Topic"),1)],8,pi),t("div",fi,[a[200]||(a[200]=t("button",{class:"px-2 py-1.5 text-xs font-bold text-slate-300 bg-slate-800 hover:bg-slate-700 border border-slate-700 rounded-xl"}," ▾ ",-1)),t("div",mi,[a[199]||(a[199]=t("div",{class:"px-3 py-1 text-[10px] font-bold text-slate-500 uppercase"},"Model AI Engine",-1)),t("div",xi,[X(t("select",{"onUpdate:modelValue":a[72]||(a[72]=r=>Be(w)?w.value=r:null),class:"w-full bg-slate-950 border border-slate-700 rounded-lg p-1.5 text-xs text-sky-300 focus:outline-none"},[...a[198]||(a[198]=[t("option",{value:"gemini-3.8-flash"},"⚡ Gemini 3.8 Flash",-1),t("option",{value:"gemini-3.5-flash"},"⚡ Gemini 3.5 Flash",-1),t("option",{value:"gemini-2.5-pro"},"💎 Gemini 2.5 Pro",-1),t("option",{value:"gemini-1.5-pro"},"💎 Gemini 1.5 Pro",-1)])],512),[[it,n(w)]])])])])])]),o.isAutoTopicLoading?(p(),f("div",bi,[t("div",hi,[y(n(ct),{class:"w-3 h-3 text-sky-400 animate-spin"})]),t("div",gi,[a[201]||(a[201]=t("span",{class:"font-bold text-white"},"AI Research Engine Sedang Bekerja...",-1)),t("span",yi,x(n(w)),1),a[202]||(a[202]=t("span",{class:"text-[10px] text-slate-300"},"Meriset data perbandingan terbaru & copywriting viral.",-1))])])):M("",!0),t("div",vi,[t("aside",ki,[t("div",wi,[t("div",_i,[t("button",{onClick:a[73]||(a[73]=r=>$.value="editor"),class:E(["flex-1 py-1.5 px-2 rounded-lg text-[11px] transition flex items-center justify-center gap-1 font-bold whitespace-nowrap",n($)==="editor"?"bg-slate-800 text-sky-400 shadow":"text-slate-400 hover:text-white"])},[y(n(Ja),{class:"w-3.5 h-3.5 shrink-0"}),a[203]||(a[203]=t("span",null,"Template",-1))],2),t("button",{onClick:a[74]||(a[74]=r=>$.value="drafts"),class:E(["flex-1 py-1.5 px-2 rounded-lg text-[11px] transition flex items-center justify-center gap-1 font-bold whitespace-nowrap",n($)==="drafts"?"bg-slate-800 text-amber-400 shadow":"text-slate-400 hover:text-white"])},[y(n(na),{class:"w-3.5 h-3.5 shrink-0"}),t("span",null,"Drafts ("+x(o.drafts.length)+")",1)],2),t("button",{onClick:a[75]||(a[75]=r=>$.value="history"),class:E(["flex-1 py-1.5 px-2 rounded-lg text-[11px] transition flex items-center justify-center gap-1 font-bold whitespace-nowrap",n($)==="history"?"bg-slate-800 text-purple-400 shadow":"text-slate-400 hover:text-white"])},[y(n(oa),{class:"w-3.5 h-3.5 shrink-0"}),t("span",null,"Riwayat ("+x(o.history.length)+")",1)],2)])]),n($)==="editor"?(p(),f("div",Si,[t("div",Ti,[t("div",Ci,[t("span",Ai,"Library ("+x(n(Y).length)+" Template)",1),t("button",{onClick:g,type:"button",class:"px-2 py-0.5 rounded-lg bg-sky-500/20 text-sky-300 border border-sky-500/30 text-[10px] font-bold hover:bg-sky-500/30 flex items-center gap-1 transition active:scale-95"},[y(n(wt),{class:"w-3 h-3"}),a[204]||(a[204]=t("span",null,"+ Buat Template",-1))])]),t("div",Oi,[X(t("input",{"onUpdate:modelValue":a[76]||(a[76]=r=>Be(oe)?oe.value=r:null),type:"text",placeholder:"Cari template...",class:"w-full bg-slate-950 border border-slate-800 rounded-xl px-2.5 py-1.5 text-xs text-white placeholder-slate-500 focus:outline-none focus:border-sky-500"},null,512),[[de,n(oe)]])])]),t("div",Ni,[(p(!0),f(ue,null,be(n(T),r=>(p(),f("div",{key:r.id,onClick:b=>ot(r.layoutType==="custom"?r.id:r.layoutType||r.id),class:E(["p-2.5 rounded-xl border cursor-pointer transition flex flex-col gap-1 group text-left",n(d)===r.id?"bg-sky-950/40 border-sky-500/50 shadow-sm":"bg-slate-950/60 border-slate-800/80 hover:border-slate-700"])},[t("div",Mi,[t("span",$i,x(r.name),1),n(d)===r.id?(p(),f("span",Di)):r.isBuiltin?M("",!0):(p(),f("span",ji,"⭐ Kustom"))]),t("span",Ei,x(r.description||"Format kartu visual studio"),1),t("div",Ri,[t("span",Pi,x(r.category||"UMUM"),1),r.isBuiltin?(p(),f("span",Vi," BAWAAN ")):M("",!0)])],10,Ii))),128))]),t("div",Li,[t("span",Bi,[y(n(ct),{class:"w-3 h-3 text-purple-400"}),a[205]||(a[205]=t("span",null,"AI Vision Template",-1))]),t("button",{onClick:nt,class:"px-2 py-1 rounded-lg bg-slate-800 hover:bg-slate-700 text-slate-300 hover:text-white text-[10px] font-bold transition flex items-center gap-1"},[y(n(Ke),{class:"w-2.5 h-2.5"}),t("span",null,x(n(ke)?"✓ Tersalin":"Salin Prompt"),1)])])])):n($)==="drafts"?(p(),f("div",Hi,[t("div",Ui,[t("span",Ji,"Tersimpan ("+x(o.drafts.length)+")",1),t("button",{onClick:a[77]||(a[77]=r=>l("saveDraft")),class:"text-[10px] text-amber-400 hover:text-amber-300 transition font-bold flex items-center gap-1",title:"Simpan konten saat ini ke Drafts"},[y(n(na),{class:"w-3 h-3"}),a[206]||(a[206]=t("span",null,"+ Simpan ke Draft",-1))])]),t("div",Fi,[o.unsavedStash?(p(),f("div",Zi,[t("div",zi,[a[207]||(a[207]=t("span",{class:"font-bold text-amber-300"},"Editan aktif: ",-1)),t("span",Gi,x(o.unsavedStash.title||"Tanpa Judul"),1)]),t("button",{onClick:ne,class:"px-1.5 py-0.5 bg-amber-500 text-slate-950 font-bold rounded text-[9px] shrink-0"}," Kembali ")])):M("",!0),o.drafts.length===0?(p(),f("div",Ki,[...a[208]||(a[208]=[Z(" Belum ada draft tersimpan.",-1),t("br",null,null,-1),Z(" Klik ",-1),t("b",null,"+ Simpan ke Draft",-1),Z(" di atas untuk menyimpan konten ini! ",-1)])])):M("",!0),(p(!0),f(ue,null,be(o.drafts,(r,b)=>(p(),f("div",{key:b,onClick:I=>l("selectDraft",b),"data-draft-item":"",class:E(["p-2 rounded-xl border cursor-pointer transition flex items-center justify-between text-xs group",o.activeDraftIndex===b?"bg-amber-500/15 border-amber-500/50 text-white":"bg-slate-950/60 border-slate-800 text-slate-300 hover:border-slate-700"])},[t("div",qi,[t("div",Yi,[t("span",Xi,x(r.layoutType||"table"),1),t("span",Qi,x(r.category),1)]),t("div",ed,x(r.title),1)]),t("button",{onClick:dt(I=>l("deleteDraft",b),["stop"]),class:"opacity-0 group-hover:opacity-100 p-1 text-slate-400 hover:text-rose-400 transition rounded shrink-0",title:"Hapus draft ini"},[y(n(ut),{class:"w-3.5 h-3.5"})],8,td)],10,Wi))),128))])])):n($)==="history"?(p(),f("div",ad,[t("div",sd,[t("span",nd,"Riwayat ("+x(o.history.length)+")",1),o.history.length>0?(p(),f("button",{key:0,onClick:Pa,class:"text-[10px] text-rose-400 hover:text-rose-300 transition font-bold"}," Bersihkan Riwayat ")):M("",!0)]),t("div",od,[o.unsavedStash?(p(),f("div",ld,[t("div",rd,[a[209]||(a[209]=t("span",{class:"font-bold text-purple-300"},"Editan aktif: ",-1)),t("span",id,x(o.unsavedStash.title||"Tanpa Judul"),1)]),t("button",{onClick:ne,class:"px-1.5 py-0.5 bg-purple-500 text-white font-bold rounded text-[9px] shrink-0"}," Kembali ")])):M("",!0),o.history.length===0?(p(),f("div",dd,[...a[210]||(a[210]=[Z(" Belum ada riwayat pembuatan.",-1),t("br",null,null,-1),Z(" Hasil generate akan otomatis tercatat di sini! ",-1)])])):M("",!0),(p(!0),f(ue,null,be(o.history,(r,b)=>(p(),f("div",{key:b,onClick:I=>l("selectHistory",b),"data-history-item":"",class:E(["p-2 rounded-xl border cursor-pointer transition flex items-center justify-between text-xs group",o.activeHistoryIndex===b?"bg-purple-500/15 border-purple-500/50 text-white":"bg-slate-950/60 border-slate-800 text-slate-300 hover:border-slate-700"])},[t("div",cd,[t("div",pd,[t("span",fd,x(r.layoutType||"reels"),1),t("span",md,x(r.category),1),r.generatedAt?(p(),f("span",xd,x(Va(r.generatedAt)),1)):M("",!0)]),t("div",bd,x(r.title),1)]),t("button",{onClick:dt(I=>l("deleteHistory",b),["stop"]),class:"opacity-0 group-hover:opacity-100 p-1 text-slate-400 hover:text-rose-400 transition rounded shrink-0",title:"Hapus riwayat ini"},[y(n(ut),{class:"w-3.5 h-3.5"})],8,hd)],10,ud))),128))])])):M("",!0)]),t("section",gd,[t("div",yd,[t("div",vd,[y(n(Us),{class:"w-3.5 h-3.5 text-sky-400"}),a[211]||(a[211]=t("span",{class:"text-xs font-black text-white"},"Studio Inspector",-1)),t("span",kd,x(n(Ss)),1)]),t("div",wd,[t("button",{onClick:Ca,class:"px-2 py-1 rounded-lg bg-slate-800 hover:bg-slate-700 text-slate-300 text-[10px] font-bold transition flex items-center gap-1",title:"Format JSON"},[y(n(la),{class:"w-2.5 h-2.5"}),a[212]||(a[212]=t("span",null,"Format",-1))]),t("button",{onClick:Qt,class:"px-2 py-1 rounded-lg bg-sky-950/60 border border-sky-500/40 text-sky-300 text-[10px] font-bold hover:bg-sky-900/50 transition flex items-center gap-1",title:"Clear / Pakai Sample"},[y(n(us),{class:"w-2.5 h-2.5"}),a[213]||(a[213]=t("span",null,"Sample",-1))])])]),t("div",_d,[t("div",Sd,[t("div",Td,[a[214]||(a[214]=t("label",{class:"text-[10px] font-black uppercase tracking-wider text-slate-400"},"Palette Tema & Aksen",-1)),t("span",Cd,x(o.modelValue.theme==="custom-palette"?"🎨 Kustom Palette":ja.find(r=>r.id===(o.modelValue.theme||"blue-tech"))?.name||o.modelValue.theme||"Blue Tech"),1)]),t("div",Ad,[t("button",{onClick:$a,type:"button",class:E(["h-7 rounded-lg transition border flex items-center justify-center shadow font-bold text-xs group relative overflow-hidden",o.modelValue.theme==="custom-palette"?"border-2 border-violet-400 ring-2 ring-violet-400/40 scale-105 bg-gradient-to-tr from-violet-600 via-fuchsia-600 to-amber-500 text-white":"border-slate-700 bg-slate-800 hover:border-violet-400 text-violet-300"]),title:"🎨 Buka Palette Manager Kustom"},[...a[215]||(a[215]=[t("span",{class:"drop-shadow"},"🎨",-1)])],2),(p(!0),f(ue,null,be(ja.filter(r=>r.id!=="custom-palette"),r=>(p(),f("button",{key:r.id,onClick:b=>Da(r.id),type:"button",class:E(["h-7 rounded-lg transition border flex items-center justify-center shadow",[r.bgClass,(o.modelValue.theme||"blue-tech")===r.id?"border-2 border-sky-400 ring-2 ring-sky-400/30 scale-105":"border-slate-800 hover:border-slate-600"]]),title:r.name},[(o.modelValue.theme||"blue-tech")===r.id?(p(),De(n(tt),{key:0,class:"w-3 h-3 text-white"})):M("",!0)],10,Od))),128))])]),t("div",Nd,[t("div",Id,[a[216]||(a[216]=t("label",{class:"text-[10px] font-black uppercase tracking-wider text-slate-400"},"Watermark",-1)),t("input",{type:"text",value:o.modelValue.watermark||"@SocialGen",onInput:a[78]||(a[78]=r=>Oa(r.target.value)),class:"w-full bg-slate-900 border border-slate-800 rounded-xl px-2.5 py-1.5 text-xs text-sky-400 font-semibold focus:outline-none focus:border-sky-500"},null,40,Md)]),t("div",$d,[a[217]||(a[217]=t("label",{class:"text-[10px] font-black uppercase tracking-wider text-slate-400"},"Judul Konten (Title)",-1)),t("input",{type:"text",value:o.modelValue.title,onInput:a[79]||(a[79]=r=>Aa(r.target.value)),placeholder:"Judul Utama Konten...",class:"w-full bg-slate-900 border border-slate-800 rounded-xl px-2.5 py-1.5 text-xs text-slate-100 font-semibold focus:outline-none focus:border-sky-500"},null,40,Dd)])]),t("div",jd,[t("div",Ed,[t("label",Rd,[y(n(la),{class:"w-3.5 h-3.5 text-sky-400"}),a[218]||(a[218]=t("span",null,"RAW JSON Content",-1))]),n(c)?(p(),f("span",Vd,[y(n(Ba),{class:"w-2.5 h-2.5"}),a[219]||(a[219]=Z(" Invalid ",-1))])):(p(),f("span",Pd,[y(n(js),{class:"w-2.5 h-2.5"}),Z(" "+x(n(i).trim()?"Valid":"Sample Mode"),1)]))]),n(W)?(p(),f("div",{key:0,class:E(["p-2 rounded-xl border text-xs transition-all shadow-md flex flex-col gap-1.5",n(W).isKnown?"bg-amber-500/10 border-amber-500/30":"bg-rose-500/10 border-rose-500/30"])},[t("div",{class:E(["flex items-center gap-1.5 text-[11px]",n(W).isKnown?"text-amber-300":"text-rose-300"])},[a[221]||(a[221]=t("span",null,"⚠️",-1)),n(W).isKnown?(p(),f("span",Ld,[a[220]||(a[220]=Z(" Format milik: ",-1)),t("b",null,x(n(W).matchedTarget?.name),1)])):(p(),f("span",Bd,' Template "'+x(n(W).jsonTemplateId)+'" tidak ditemukan. ',1))],2),t("div",Hd,[n(W).isKnown&&n(W).matchedTarget?(p(),f("button",{key:0,onClick:a[80]||(a[80]=r=>ot(n(W).matchedTarget.id)),class:"px-2 py-0.5 rounded-lg bg-amber-500/20 hover:bg-amber-500/30 text-amber-200 border border-amber-500/40 text-[10px] font-bold transition"}," Pindah Template ")):M("",!0),t("button",{onClick:Qt,class:"px-2 py-0.5 rounded-lg bg-slate-800 hover:bg-slate-700 text-slate-300 text-[10px] font-semibold transition"}," Pakai Sampel ")])],2)):M("",!0),t("textarea",{value:n(i),onInput:Ta,rows:"7",spellcheck:"false",class:"w-full bg-slate-950 text-sky-200 text-[11px] font-mono p-2.5 rounded-xl border border-slate-800 focus:outline-none focus:border-sky-500/50 resize-y leading-relaxed select-text custom-scrollbar",placeholder:"Paste Content JSON here... (kosong = otomatis menggunakan data sampel template aktif)"},null,40,Ud),n(c)||o.validationError?(p(),f("p",Jd," ⚠️ "+x(n(c)||o.validationError),1)):M("",!0)]),t("input",{type:"file",ref_key:"videoInputRef",ref:Yt,accept:"video/mp4,video/webm",class:"hidden",onChange:a[81]||(a[81]=r=>Sa(r))},null,544),t("input",{type:"file",ref_key:"audioInputRef",ref:Xt,accept:"audio/mp3,audio/mpeg,audio/wav",class:"hidden",onChange:a[82]||(a[82]=r=>Sa(r))},null,544),t("div",Fd,[t("div",Zd,[t("div",zd,[t("label",Gd,[y(n(ua),{class:"w-3.5 h-3.5 text-sky-400"}),a[222]||(a[222]=t("span",null,"Background Video",-1))]),t("div",Kd,[t("select",{value:o.options.backgroundSource||"random",onChange:a[83]||(a[83]=r=>{const b=r.target.value;l("update:options",{...o.options,backgroundSource:b,videoStartOffset:0})}),class:"bg-slate-950 border border-slate-800 rounded-lg px-2 py-1 text-slate-300 text-[11px] focus:outline-none max-w-[150px] truncate"},[a[223]||(a[223]=t("option",{value:"random"},"🔀 Acak Video",-1)),(p(!0),f(ue,null,be(n(Gt),r=>(p(),f("option",{key:r,value:r},x(r.replace(".mp4","").replace(/_/g," ")),9,qd))),128)),a[224]||(a[224]=t("option",{value:"pexels"},"🌐 Pexels API (Auto HD)",-1))],40,Wd),t("button",{onClick:a[84]||(a[84]=r=>n(Yt)?.click()),disabled:n(Ge),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"},[y(n(Et),{class:"w-3 h-3"}),t("span",Xd,x(n(Ge)?"...":"Upload"),1)],8,Yd)])]),t("div",Qd,[t("span",eu,[y(n(ca),{class:"w-2.5 h-2.5"}),Z(" Mulai: "+x(Math.min(o.options.videoStartOffset||0,n(Qe)))+"s / "+x(n(Wt))+"s ",1)]),t("input",{type:"range",min:"0",max:n(Qe),step:"1",value:Math.min(o.options.videoStartOffset||0,n(Qe)),onInput:a[85]||(a[85]=r=>Le("videoStartOffset",Number(r.target.value))),class:"w-28 h-1 bg-slate-950 rounded appearance-none cursor-pointer accent-sky-400"},null,40,tu)])]),t("div",au,[t("div",su,[t("label",nu,[y(n(Ct),{class:"w-3.5 h-3.5 text-purple-400"}),a[225]||(a[225]=t("span",null,"Musik Reels",-1))]),t("div",ou,[t("select",{value:o.options.musicFile||"random",onChange:a[86]||(a[86]=r=>{const b=r.target.value;l("update:options",{...o.options,musicFile:b,audioStartOffset:0})}),class:"bg-slate-950 border border-slate-800 rounded-lg px-2 py-1 text-slate-300 text-[11px] focus:outline-none max-w-[150px] truncate"},[a[226]||(a[226]=t("option",{value:"random"},"🔀 Acak Musik",-1)),(p(!0),f(ue,null,be(n(Kt),r=>(p(),f("option",{key:r,value:r},x(r.replace(".mp3","").replace(/_/g," ")),9,ru))),128))],40,lu),t("button",{onClick:a[87]||(a[87]=r=>n(Xt)?.click()),disabled:n(Ge),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"},[y(n(Et),{class:"w-3 h-3"}),t("span",du,x(n(Ge)?"...":"Upload"),1)],8,iu)])]),t("div",uu,[t("span",cu,[y(n(ca),{class:"w-2.5 h-2.5"}),Z(" Mulai: "+x(Math.min(o.options.audioStartOffset||0,n(et)))+"s / "+x(n(qt))+"s ",1)]),t("input",{type:"range",min:"0",max:n(et),step:"1",value:Math.min(o.options.audioStartOffset||0,n(et)),onInput:a[88]||(a[88]=r=>Le("audioStartOffset",Number(r.target.value))),class:"w-28 h-1 bg-slate-950 rounded appearance-none cursor-pointer accent-purple-400"},null,40,pu)])]),t("div",fu,[t("label",mu,[y(n(oa),{class:"w-3.5 h-3.5 text-emerald-400"}),a[227]||(a[227]=t("span",null,"Durasi Reels:",-1))]),t("div",xu,[(p(),f(ue,null,be([7,10,15,30,60],r=>t("button",{key:r,onClick:b=>Ea(r),class:E(["px-2 py-0.5 text-[10px] font-bold rounded-lg border transition",(o.modelValue.reelsDuration||30)===r?"bg-emerald-500/20 border-emerald-500/60 text-emerald-300":"bg-slate-950 border-slate-800 text-slate-400 hover:text-white"])},x(r===60?"1m":r+"s"),11,bu)),64))])]),t("div",hu,[t("label",{class:E(["flex items-center gap-1.5 p-1.5 rounded-xl border text-[11px] cursor-pointer transition select-none",o.options.outputs?.feed!==!1?"bg-sky-500/10 border-sky-500/40 text-sky-200":"bg-slate-950/50 border-slate-800 text-slate-500"])},[t("input",{type:"checkbox",checked:o.options.outputs?.feed!==!1,onChange:a[89]||(a[89]=r=>rt("feed",r.target.checked)),class:"rounded text-sky-500 focus:ring-0 bg-slate-900 border-slate-700 w-3 h-3"},null,40,gu),a[228]||(a[228]=t("span",{class:"font-bold"},"Feed 4:5",-1))],2),t("label",{class:E(["flex items-center gap-1.5 p-1.5 rounded-xl border text-[11px] cursor-pointer transition select-none",o.options.outputs?.story!==!1?"bg-indigo-500/10 border-indigo-500/40 text-indigo-200":"bg-slate-950/50 border-slate-800 text-slate-500"])},[t("input",{type:"checkbox",checked:o.options.outputs?.story!==!1,onChange:a[90]||(a[90]=r=>rt("story",r.target.checked)),class:"rounded text-indigo-500 focus:ring-0 bg-slate-900 border-slate-700 w-3 h-3"},null,40,yu),a[229]||(a[229]=t("span",{class:"font-bold"},"Story 9:16",-1))],2),t("label",{class:E(["flex items-center gap-1.5 p-1.5 rounded-xl border text-[11px] cursor-pointer transition select-none",o.options.outputs?.reels!==!1?"bg-emerald-500/10 border-emerald-500/40 text-emerald-200":"bg-slate-950/50 border-slate-800 text-slate-500"])},[t("input",{type:"checkbox",checked:o.options.outputs?.reels!==!1,onChange:a[91]||(a[91]=r=>rt("reels",r.target.checked)),class:"rounded text-emerald-500 focus:ring-0 bg-slate-900 border-slate-700 w-3 h-3"},null,40,vu),a[230]||(a[230]=t("span",{class:"font-bold"},"Reels MP4",-1))],2)])])]),t("div",ku,[t("button",{onClick:a[92]||(a[92]=r=>l("generate")),disabled:!o.isValid||o.isGenerating||!!n(c),class:E(["w-full py-3 px-4 rounded-xl font-black text-xs tracking-wide shadow-xl transition flex items-center justify-center gap-2",[!o.isValid||o.isGenerating||n(c)?"bg-slate-800 text-slate-500 cursor-not-allowed border border-slate-700":"bg-gradient-to-r from-sky-500 via-indigo-600 to-purple-600 hover:from-sky-400 hover:to-indigo-500 text-white shadow-sky-500/25 active:scale-[0.99]"]])},[o.isGenerating?(p(),De(n(Fa),{key:0,class:"w-3.5 h-3.5 animate-spin"})):(p(),De(n(ds),{key:1,class:"w-3.5 h-3.5 fill-current"})),t("span",null,x(o.isGenerating?o.generateStage||"Rendering Content...":"GENERATE CONTENT SEKARANG"),1)],10,wu)])])])])]))}}),Su={class:"flex flex-col gap-2.5 h-full text-slate-100 min-h-0 justify-between relative"},Tu={key:0,class:"absolute inset-0 z-50 bg-slate-950/85 backdrop-blur-md rounded-2xl flex flex-col items-center justify-center p-6 text-center animate-in fade-in duration-200"},Cu={class:"relative flex items-center justify-center mb-5"},Au={class:"absolute inset-0 flex items-center justify-center"},Ou={class:"text-xs text-sky-300 font-bold mb-4 flex items-center gap-2"},Nu={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"},Iu={class:"flex items-center gap-1 bg-slate-950 p-1 rounded-xl border border-slate-800 text-xs font-bold"},Mu={key:0,class:"w-1.5 h-1.5 rounded-full bg-white animate-pulse"},$u={class:"flex items-center gap-2 text-xs"},Du={class:"flex items-center gap-1 bg-slate-950 p-1 rounded-xl border border-slate-800 text-xs shadow-inner"},ju={key:0,class:"relative shadow-2xl rounded-2xl overflow-hidden border border-slate-700/80 flex-shrink-0",style:{width:"360px",height:"450px"}},Eu={style:{width:"1080px",height:"1350px",transform:"scale(0.333333)","transform-origin":"top left"}},Ru={key:1,class:"relative shadow-2xl rounded-2xl overflow-hidden border border-slate-700/80 flex-shrink-0",style:{width:"300px",height:"533.33px"}},Pu={key:0,class:"absolute inset-0 z-0 bg-slate-950 overflow-hidden"},Vu=["src"],Lu=["src","muted"],Bu={class:"relative z-10 pointer-events-none",style:{width:"1080px",height:"1920px",transform:"scale(0.277778)","transform-origin":"top left"}},Hu={key:1,class:"absolute inset-0 z-30 pointer-events-none flex flex-col justify-between overflow-hidden select-none"},Uu={class:"h-[52px] bg-gradient-to-b from-black/85 via-black/40 to-transparent px-3 pt-2.5 flex items-center justify-between text-white/90 border-b border-dashed border-red-500/40"},Ju={class:"flex items-center gap-3 text-white/80"},Fu={class:"absolute right-2 bottom-[130px] flex flex-col items-center gap-3 z-10"},Zu={class:"flex flex-col items-center gap-0.5"},zu={class:"w-7 h-7 rounded-full bg-black/40 backdrop-blur-sm flex items-center justify-center text-white border border-white/10 shadow"},Gu={class:"flex flex-col items-center gap-0.5"},Ku={class:"w-7 h-7 rounded-full bg-black/40 backdrop-blur-sm flex items-center justify-center text-white border border-white/10 shadow"},Wu={class:"flex flex-col items-center gap-0.5"},qu={class:"w-7 h-7 rounded-full bg-black/40 backdrop-blur-sm flex items-center justify-center text-white border border-white/10 shadow"},Yu={class:"w-7 h-7 rounded-full bg-slate-900 border border-slate-700/80 p-1 flex items-center justify-center animate-spin",style:{"animation-duration":"4s"}},Xu={class:"h-[122px] bg-gradient-to-t from-black/95 via-black/85 to-transparent px-3 pb-2 pt-4 flex flex-col justify-end gap-1.5 border-t border-dashed border-red-500/50 relative"},Qu={class:"flex items-center gap-1.5 text-[8px] text-white/80 pr-10"},ec={class:"h-[56px] bg-gradient-to-t from-black/80 to-transparent px-3 pb-2 flex items-center justify-between gap-2 border-t border-dashed border-red-500/50 relative"},tc={key:1,class:"flex flex-col bg-slate-900/95 border border-slate-800 rounded-2xl p-2.5 gap-2 shadow-xl flex-shrink-0 text-xs"},ac={class:"flex items-center justify-between gap-3"},sc=["title"],nc={class:"text-[11px] hidden sm:inline"},oc={class:"flex-1 flex items-center gap-2"},lc=["max","value"],rc={class:"font-mono text-[11px] font-bold text-slate-300 min-w-[75px] text-right"},ic=["title"],dc={key:0,class:"grid grid-cols-1 sm:grid-cols-2 gap-3 p-2.5 bg-slate-950/80 rounded-xl border border-slate-800/80 animate-fadeIn"},uc={class:"flex flex-col gap-1.5"},cc={class:"flex items-center justify-between text-[11px]"},pc={class:"font-bold text-sky-300 flex items-center gap-1"},fc=["max","value"],mc={class:"text-[9px] text-slate-500"},xc={class:"flex flex-col gap-1.5"},bc={class:"flex items-center justify-between text-[11px]"},hc={class:"font-bold text-purple-300 flex items-center gap-1"},gc=["max","value"],yc={class:"text-[9px] text-slate-500"},vc={class:"flex flex-col bg-slate-900/90 border border-slate-800 rounded-2xl p-2.5 gap-1.5 shadow-lg flex-shrink-0"},kc={class:"flex items-center justify-between text-xs"},wc=["value"],_c=ga({__name:"LivePreview",props:{data:{},selectedVideo:{},selectedMusic:{},videoStartOffset:{default:0},audioStartOffset:{default:0},isGenerating:{type:Boolean,default:!1},generateStage:{default:""},generatedResult:{}},emits:["update:videoStartOffset","update:audioStartOffset"],setup(o,{emit:e}){const s=o,l=e,i={"neon_cyber_grid.mp4":8,"financial_pulse_flow.mp4":8,"dark_luxury_particles.mp4":8,"cyber_matrix_stream.mp4":10,"cyber_blue.mp4":15,"default_bg.mp4":15,"emerald_flow.mp4":15,"cyber_pulse.mp4":15,"cyber_future_tech.mp3":15,"dark_phonk_pulse.mp3":15,"deep_finance_groove.mp3":15,"synthwave_pulse.mp3":15,"lofi_chill.mp3":15,"default_ambient.mp3":15,"motivation_cinematic.mp3":110,"lofi_viral_study.mp3":147},d=fe(()=>s.selectedVideo&&s.selectedVideo!=="pexels"&&s.selectedVideo!=="random"?`/api/stream/videos/${s.selectedVideo}`:"/api/stream/videos/default_bg.mp4"),m=fe(()=>s.selectedMusic&&s.selectedMusic!=="random"?`/api/stream/audio/${s.selectedMusic}`:"/api/stream/audio/lofi_viral_study.mp3"),c=S("feed"),C=S(!1),w=S(!1),$=S(!1),ne=S(1),he=fe(()=>c.value==="feed"?360:300),q=fe(()=>c.value==="feed"?450:533.33),B=S(null),j=S(null),J=S(!0),ge=S(!1),$e=S(0),Pe=fe(()=>s.data.reelsDuration||30),we=S(i[s.selectedVideo||""]||8),ee=S(i[s.selectedMusic||""]||30),K=fe(()=>Math.max(1,Math.floor(we.value-1))),ce=fe(()=>Math.max(1,Math.floor(ee.value-1)));function Y(){ne.value<2.5&&(ne.value=Math.min(2.5,+(ne.value+.15).toFixed(2)))}function Ce(){ne.value>.5&&(ne.value=Math.max(.5,+(ne.value-.15).toFixed(2)))}function ie(){ne.value=1}function te(T){(T.ctrlKey||T.metaKey)&&(T.preventDefault(),T.deltaY<0?Y():Ce())}let oe=0,G=null;function ke(T){if(J.value){if(oe>0){const h=(T-oe)/1e3;h>0&&h<1&&($e.value+=h,$e.value>=Pe.value&&($e.value=0,st(0)))}oe=T,G=requestAnimationFrame(ke)}}const le=S({});async function Ae(){try{const T=await $fetch("/api/media");if(T?.durations){le.value=T.durations;const h=s.selectedVideo||"";le.value[h]&&(we.value=le.value[h]);const _e=s.selectedMusic||"";le.value[_e]&&(ee.value=le.value[_e])}}catch{}}ya(()=>{Ae(),J.value&&(oe=performance.now(),G&&cancelAnimationFrame(G),G=requestAnimationFrame(ke))}),Os(()=>{G&&(cancelAnimationFrame(G),G=null)}),Te(Pe,T=>{$e.value>T&&($e.value=0,st(0))});function re(){J.value?Xe():N()}function N(){J.value=!0,oe=performance.now(),G&&cancelAnimationFrame(G),G=requestAnimationFrame(ke),B.value&&B.value.play().catch(()=>{}),j.value&&(j.value.muted=ge.value,j.value.volume=.85,j.value.play().catch(()=>{}))}function Xe(){J.value=!1,oe=0,G&&(cancelAnimationFrame(G),G=null),B.value&&B.value.pause(),j.value&&j.value.pause()}function D(){if(ge.value=!ge.value,j.value)if(j.value.muted=ge.value,j.value.volume=.85,!ge.value&&J.value){const T=s.audioStartOffset||0;j.value.currentTime=T+$e.value%Math.max(1,ee.value-T),j.value.play().catch(()=>{})}else j.value.pause()}function g(T){const h=T.target;h&&h.duration&&!isNaN(h.duration)&&isFinite(h.duration)&&(we.value=Math.max(1,Math.floor(h.duration)),s.videoStartOffset&&s.videoStartOffset>=we.value&&l("update:videoStartOffset",Math.max(0,we.value-2))),B.value&&(B.value.currentTime=Math.min(s.videoStartOffset||0,K.value),J.value&&B.value.play().catch(()=>{}))}function ae(T){const h=T.target;h&&h.duration&&!isNaN(h.duration)&&isFinite(h.duration)&&(ee.value=Math.max(1,Math.floor(h.duration)),s.audioStartOffset&&s.audioStartOffset>=ee.value&&l("update:audioStartOffset",Math.max(0,ee.value-2))),j.value&&(j.value.muted=ge.value,j.value.volume=.85,j.value.currentTime=Math.min(s.audioStartOffset||0,ce.value),J.value&&!ge.value&&j.value.play().catch(()=>{}))}function Re(){if(!B.value)return;const T=Math.min(s.videoStartOffset||0,K.value);B.value.currentTime=T,J.value&&B.value.play().catch(()=>{})}function H(){if(!j.value)return;const T=Math.min(s.audioStartOffset||0,ce.value);j.value.currentTime=T,J.value&&!ge.value&&j.value.play().catch(()=>{})}function ze(){if(!B.value)return;const T=Math.min(s.videoStartOffset||0,K.value),h=we.value;B.value.currentTime>=h-.25&&(B.value.currentTime=T,J.value&&B.value.play().catch(()=>{}))}function Jt(){if(!j.value)return;const T=Math.min(s.audioStartOffset||0,ce.value),h=ee.value;j.value.currentTime>=h-.25&&(j.value.currentTime=T,J.value&&!ge.value&&j.value.play().catch(()=>{}))}function st(T){$e.value=Math.min(Math.max(0,T),Pe.value),oe=performance.now();const h=Math.min(s.videoStartOffset||0,K.value),_e=Math.min(s.audioStartOffset||0,ce.value);if(B.value){const pe=h+T%Math.max(1,we.value-h);B.value.currentTime=Math.min(pe,we.value-.1)}if(j.value){const pe=_e+T%Math.max(1,ee.value-_e);j.value.currentTime=Math.min(pe,ee.value-.1)}}function yt(T){const h=Number(T.target.value);st(h)}Te(()=>s.selectedVideo,(T,h)=>{h!==void 0&&T!==h&&(l("update:videoStartOffset",0),$e.value=0,B.value&&(B.value.currentTime=0))}),Te(()=>s.selectedMusic,(T,h)=>{h!==void 0&&T!==h&&(l("update:audioStartOffset",0),j.value&&(j.value.currentTime=0))}),Te(()=>s.videoStartOffset,T=>{const h=Math.min(T||0,K.value);B.value&&(B.value.currentTime=h)}),Te(()=>s.audioStartOffset,T=>{const h=Math.min(T||0,ce.value);j.value&&(j.value.currentTime=h)});function nt(T){const h=Math.min(T,K.value);l("update:videoStartOffset",h),B.value&&(B.value.currentTime=h)}function Ft(T){const h=Math.min(T,ce.value);l("update:audioStartOffset",h),j.value&&(j.value.currentTime=h)}function Zt(){if(B.value){const T=Math.min(Math.floor(B.value.currentTime),K.value);nt(T)}}function Nt(T){const h=Math.floor(T/60),_e=Math.floor(T%60);return`${h.toString().padStart(2,"0")}:${_e.toString().padStart(2,"0")}`}async function zt(){if(!s.data.caption)return;await St(s.data.caption)&&($.value=!0,setTimeout(()=>{$.value=!1},2e3))}return Te(()=>d.value,()=>{const T=s.selectedVideo||"";(le.value[T]||i[T])&&(we.value=le.value[T]||i[T]),La(()=>{st(0)})}),Te(()=>m.value,()=>{const T=s.selectedMusic||"";(le.value[T]||i[T])&&(ee.value=le.value[T]||i[T])}),Te(()=>c.value,T=>{T==="reels"?La(()=>{J.value&&N()}):j.value&&j.value.pause()}),(T,h)=>{const _e=Is;return p(),f("div",Su,[o.isGenerating?(p(),f("div",Tu,[t("div",Cu,[h[8]||(h[8]=t("div",{class:"w-20 h-20 rounded-full border-4 border-sky-500/20 border-t-sky-400 border-r-indigo-500 animate-spin"},null,-1)),t("div",Au,[y(n(ct),{class:"w-8 h-8 text-sky-400 animate-pulse"})])]),h[10]||(h[10]=t("h3",{class:"text-base font-black text-white tracking-wide mb-1.5"}," Sedang Men-generate Konten... ",-1)),t("p",Ou,[h[9]||(h[9]=t("span",{class:"w-2 h-2 rounded-full bg-sky-400 animate-ping"},null,-1)),t("span",null,x(o.generateStage||"Merender Gambar & Video Reels..."),1)]),h[11]||(h[11]=t("div",{class:"w-64 max-w-full bg-slate-900 border border-slate-800 rounded-full h-2.5 overflow-hidden shadow-inner mb-3"},[t("div",{class:"h-full bg-gradient-to-r from-sky-500 via-indigo-500 to-purple-500 rounded-full animate-pulse w-full"})],-1)),h[12]||(h[12]=t("span",{class:"text-[10px] text-slate-400 font-mono tracking-wider uppercase"}," Multi-Format Studio Engine • Mohon Tunggu Sebentar ",-1))])):M("",!0),t("div",Nu,[t("div",Iu,[t("button",{onClick:h[0]||(h[0]=pe=>c.value="feed"),class:E(["px-3 py-1.5 rounded-lg transition",n(c)==="feed"?"bg-sky-500 text-white shadow-md":"text-slate-400 hover:text-white"])}," Feed 4:5 ",2),t("button",{onClick:h[1]||(h[1]=pe=>c.value="story"),class:E(["px-3 py-1.5 rounded-lg transition",n(c)==="story"?"bg-indigo-500 text-white shadow-md":"text-slate-400 hover:text-white"])}," Story 9:16 ",2),t("button",{onClick:h[2]||(h[2]=pe=>c.value="reels"),class:E(["px-3 py-1.5 rounded-lg transition flex items-center gap-1.5",n(c)==="reels"?"bg-emerald-500 text-white shadow-md":"text-slate-400 hover:text-white"])},[h[13]||(h[13]=t("span",null,"Reels 9:16 (Video)",-1)),n(c)==="reels"&&n(J)?(p(),f("span",Mu)):M("",!0)],2)]),t("div",$u,[t("div",Du,[t("button",{onClick:Ce,title:"Zoom Out (-15%)",class:"p-1.5 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800 transition"},[y(n(Gs),{class:"w-3.5 h-3.5"})]),t("button",{onClick:ie,title:"Klik untuk Reset Zoom (100% Fit)",class:"px-2 py-0.5 rounded-lg text-[11px] font-bold text-sky-400 hover:bg-slate-800 hover:text-sky-300 transition font-mono min-w-[42px] text-center"},x(Math.round(n(ne)*100))+"% ",1),t("button",{onClick:Y,title:"Zoom In (+15%)",class:"p-1.5 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800 transition"},[y(n(zs),{class:"w-3.5 h-3.5"})]),n(ne)!==1?(p(),f("button",{key:0,onClick:ie,title:"Reset ke Ukuran Pas",class:"p-1.5 rounded-lg text-amber-400 hover:bg-slate-800 transition"},[y(n(us),{class:"w-3.5 h-3.5"})])):M("",!0)]),n(c)!=="feed"?(p(),f("button",{key:0,onClick:h[3]||(h[3]=pe=>C.value=!n(C)),class:E(["inline-flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border text-xs font-bold transition",n(C)?"bg-amber-500/20 text-amber-300 border-amber-500/50":"bg-slate-950 text-slate-400 border-slate-800"])},[y(n(Hs),{class:"w-3.5 h-3.5"}),h[14]||(h[14]=t("span",{class:"hidden sm:inline"},"Safe Zones",-1))],2)):M("",!0)])]),t("div",{onWheel:te,class:"relative flex-1 min-h-0 bg-slate-950/80 canvas-dot-bg border border-slate-800/80 rounded-2xl flex p-4 overflow-auto shadow-inner custom-scrollbar"},[t("div",{class:"m-auto flex-shrink-0 relative transition-all duration-200 ease-out",style:Ie({width:`${Math.round(n(he)*n(ne))}px`,height:`${Math.round(n(q)*n(ne))}px`})},[t("div",{class:"origin-top-left transition-transform duration-200 ease-out absolute top-0 left-0",style:Ie({width:`${n(he)}px`,height:`${n(q)}px`,transform:`scale(${n(ne)})`})},[n(c)==="feed"?(p(),f("div",ju,[t("div",Eu,[y(_e,{data:o.data,mode:"feed","is-render":!0},null,8,["data"])])])):(p(),f("div",Ru,[n(c)==="reels"?(p(),f("div",Pu,[(p(),f("video",{ref_key:"videoElement",ref:B,key:n(d),autoplay:"",muted:"",playsinline:"",class:"w-full h-full object-cover brightness-90 contrast-105",src:n(d),onLoadedmetadata:g,onTimeupdate:ze,onEnded:Re},null,40,Vu)),h[15]||(h[15]=t("div",{class:"absolute inset-0 bg-slate-950/30 backdrop-blur-[0.5px]"},null,-1)),(p(),f("audio",{ref_key:"audioElement",ref:j,key:n(m),src:n(m),muted:n(ge),onLoadedmetadata:ae,onTimeupdate:Jt,onEnded:H},null,40,Lu))])):M("",!0),t("div",Bu,[y(_e,{data:o.data,mode:n(c)==="reels"?"overlay":"story","is-render":!0},null,8,["data","mode"])]),n(C)?(p(),f("div",Hu,[n(c)==="reels"?(p(),f(ue,{key:0},[t("div",Uu,[h[16]||(h[16]=t("div",{class:"flex items-center gap-2"},[t("span",{class:"text-xs font-bold tracking-tight"},"Reels"),t("span",{class:"text-[9px] px-1.5 py-0.5 rounded bg-red-500/80 text-white font-mono uppercase tracking-wider font-extrabold"},"Top 180px UI")],-1)),t("div",Ju,[y(n(Ds),{class:"w-3.5 h-3.5"}),y(n(Bs),{class:"w-3.5 h-3.5"}),y(n(Es),{class:"w-3.5 h-3.5"})])]),t("div",Fu,[t("div",Zu,[t("div",zu,[y(n(Ua),{class:"w-3.5 h-3.5 text-white fill-white/20"})]),h[17]||(h[17]=t("span",{class:"text-[9px] font-bold text-white drop-shadow"},"142K",-1))]),t("div",Gu,[t("div",Ku,[y(n(Vs),{class:"w-3.5 h-3.5 text-white"})]),h[18]||(h[18]=t("span",{class:"text-[9px] font-bold text-white drop-shadow"},"1.4K",-1))]),t("div",Wu,[t("div",qu,[y(n(za),{class:"w-3.5 h-3.5 text-white"})]),h[19]||(h[19]=t("span",{class:"text-[9px] font-bold text-white drop-shadow"},"8.9K",-1))]),t("div",Yu,[y(n(Ct),{class:"w-3 h-3 text-pink-400"})])]),t("div",Xu,[h[21]||(h[21]=ft('<div class="absolute -top-3 left-3 bg-red-500 text-white font-mono text-[8px] font-extrabold px-1.5 py-0.5 rounded shadow" data-v-efc9bb3a> FB REELS UI ZONE (Bottom 440px) </div><div class="flex items-center gap-2" data-v-efc9bb3a><div class="w-5 h-5 rounded-full bg-blue-600 border border-white/40 flex items-center justify-center text-[9px] font-black text-white flex-shrink-0" data-v-efc9bb3a> SG </div><span class="text-[10px] font-bold text-white truncate max-w-[140px] drop-shadow" data-v-efc9bb3a>@creator_account</span><span class="text-[9px] px-1.5 py-0.2 rounded-full border border-white/40 text-white font-bold bg-white/10" data-v-efc9bb3a>Ikuti</span></div><p class="text-[9px] text-white/90 line-clamp-2 leading-tight drop-shadow pr-10" data-v-efc9bb3a> Informasi terpercaya hari ini! Simak detail lengkapnya pada visual di atas... <span class="text-white/60 font-semibold cursor-pointer" data-v-efc9bb3a>Lainnya</span></p>',3)),t("div",Qu,[y(n(Ct),{class:"w-2.5 h-2.5 flex-shrink-0 text-pink-300"}),h[20]||(h[20]=t("span",{class:"truncate"},"Suara Asli • Tren Terpopuler Hari Ini",-1))]),h[22]||(h[22]=t("div",{class:"w-full h-0.5 bg-white/30 rounded-full mt-1 overflow-hidden"},[t("div",{class:"h-full bg-white rounded-full w-2/5"})],-1))])],64)):(p(),f(ue,{key:1},[h[25]||(h[25]=ft('<div class="h-[52px] bg-gradient-to-b from-black/75 to-transparent px-3 pt-2 flex flex-col justify-between border-b border-dashed border-red-500/40" data-v-efc9bb3a><div class="flex gap-1 w-full" data-v-efc9bb3a><div class="h-0.5 flex-1 bg-white rounded-full" data-v-efc9bb3a></div><div class="h-0.5 flex-1 bg-white/40 rounded-full" data-v-efc9bb3a></div><div class="h-0.5 flex-1 bg-white/40 rounded-full" data-v-efc9bb3a></div></div><div class="flex items-center justify-between text-white pb-1" data-v-efc9bb3a><div class="flex items-center gap-1.5" data-v-efc9bb3a><div class="w-4 h-4 rounded-full bg-gradient-to-tr from-amber-500 to-rose-500 p-0.5" data-v-efc9bb3a><div class="w-full h-full bg-black rounded-full" data-v-efc9bb3a></div></div><span class="text-[9px] font-bold" data-v-efc9bb3a>akunkreator</span><span class="text-[8px] text-white/60" data-v-efc9bb3a>2j</span></div><span class="text-[9px] px-1.5 py-0.5 rounded bg-red-500/80 text-white font-mono uppercase tracking-wider font-extrabold" data-v-efc9bb3a>Top Safe Zone</span></div></div>',1)),t("div",ec,[h[23]||(h[23]=t("div",{class:"absolute -top-3 left-3 bg-red-500 text-white font-mono text-[8px] font-extrabold px-1.5 py-0.5 rounded shadow"}," STORY REPLY ZONE ",-1)),h[24]||(h[24]=t("div",{class:"flex-1 h-7 rounded-full border border-white/30 bg-black/20 px-3 flex items-center text-[9px] text-white/50"}," Kirim pesan... ",-1)),y(n(Ua),{class:"w-4 h-4 text-white/80"}),y(n(za),{class:"w-4 h-4 text-white/80"})])],64))])):M("",!0)]))],4)],4)],32),n(c)==="reels"?(p(),f("div",tc,[t("div",ac,[t("button",{onClick:re,class:"p-2 rounded-xl bg-emerald-600 hover:bg-emerald-500 text-white font-bold transition flex items-center gap-1.5 shadow-md",title:n(J)?"Pause Preview":"Putar Preview"},[n(J)?(p(),De(n(Ls),{key:0,class:"w-3.5 h-3.5 fill-current"})):(p(),De(n(ds),{key:1,class:"w-3.5 h-3.5 fill-current"})),t("span",nc,x(n(J)?"Pause":"Play"),1)],8,sc),t("div",oc,[t("input",{type:"range",min:"0",max:n(Pe),step:"0.1",value:n($e),onInput:yt,class:"flex-1 h-1.5 bg-slate-950 rounded-lg appearance-none cursor-pointer accent-emerald-500 hover:accent-emerald-400"},null,40,lc),t("span",rc,x(Nt(n($e)))+" / "+x(Nt(n(Pe))),1)]),t("button",{onClick:D,class:E(["px-2.5 py-2 rounded-xl border transition flex items-center gap-1.5 font-bold text-[11px]",n(ge)?"bg-slate-950 text-slate-400 border-slate-800 hover:text-white":"bg-purple-600/40 text-purple-200 border-purple-500/60 shadow-md ring-1 ring-purple-500/40"]),title:n(ge)?"Aktifkan Suara Musik (Unmute)":"Matikan Suara Musik (Mute)"},[n(ge)?(p(),De(n(Fs),{key:1,class:"w-3.5 h-3.5"})):(p(),De(n(Js),{key:0,class:"w-3.5 h-3.5 text-purple-300 animate-pulse"})),t("span",null,x(n(ge)?"Muted":"Audio ON"),1)],10,ic),t("button",{onClick:h[4]||(h[4]=pe=>w.value=!n(w)),class:E(["px-2.5 py-2 rounded-xl border text-[11px] font-bold flex items-center gap-1.5 transition",n(w)?"bg-sky-500/20 text-sky-300 border-sky-500/50":"bg-slate-950 text-slate-400 border-slate-800 hover:text-white"]),title:"Atur Detik Awal Video & Musik"},[y(n(ca),{class:"w-3.5 h-3.5 text-sky-400"}),h[26]||(h[26]=t("span",{class:"hidden sm:inline"},"Trim Offset",-1))],2)]),n(w)?(p(),f("div",dc,[t("div",uc,[t("div",cc,[t("span",pc,[y(n(ua),{class:"w-3 h-3"}),Z(" Mulai Video: "+x(Math.min(o.videoStartOffset||0,n(K)))+"s / "+x(n(we))+"s ",1)]),t("button",{onClick:Zt,class:"text-[9px] px-1.5 py-0.5 rounded bg-slate-800 hover:bg-slate-700 text-sky-300 border border-slate-700 transition",title:"Gunakan posisi video saat ini sebagai detik mulai"}," Set Detik Ini ")]),t("input",{type:"range",min:"0",max:n(K),step:"1",value:Math.min(o.videoStartOffset||0,n(K)),onInput:h[5]||(h[5]=pe=>nt(Number(pe.target.value))),class:"w-full h-1 bg-slate-900 rounded appearance-none cursor-pointer accent-sky-400"},null,40,fc),t("div",mc," Maksimal offset: "+x(n(K))+" detik (panjang asli video: "+x(n(we))+"s) ",1)]),t("div",xc,[t("div",bc,[t("span",hc,[y(n(Ct),{class:"w-3 h-3"}),Z(" Mulai Musik: "+x(Math.min(o.audioStartOffset||0,n(ce)))+"s / "+x(n(ee))+"s ",1)]),h[27]||(h[27]=t("span",{class:"text-[10px] text-slate-500 font-mono"}," (Skip intro) ",-1))]),t("input",{type:"range",min:"0",max:n(ce),step:"1",value:Math.min(o.audioStartOffset||0,n(ce)),onInput:h[6]||(h[6]=pe=>Ft(Number(pe.target.value))),class:"w-full h-1 bg-slate-900 rounded appearance-none cursor-pointer accent-purple-400"},null,40,gc),t("div",yc," Maksimal offset: "+x(n(ce))+" detik (panjang asli musik: "+x(n(ee))+"s) ",1)])])):M("",!0)])):M("",!0),t("div",vc,[t("div",kc,[h[28]||(h[28]=t("span",{class:"font-extrabold text-slate-300 text-[11px]"},"VIRAL CAPTION & HASHTAGS",-1)),t("button",{onClick:zt,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"},[n($)?(p(),De(n(tt),{key:0,class:"w-3.5 h-3.5 text-emerald-400"})):(p(),De(n(Ke),{key:1,class:"w-3.5 h-3.5"})),t("span",null,x(n($)?"Tersalin!":"Copy Caption"),1)])]),t("textarea",{value:o.data.caption,onInput:h[7]||(h[7]=pe=>o.data.caption=pe.target.value),rows:"2",class:"w-full bg-slate-950 text-slate-200 text-xs p-2 rounded-xl border border-slate-800 focus:outline-none focus:border-sky-500/50 resize-none leading-relaxed font-sans",placeholder:"Caption will appear here..."},null,40,wc)])])}}}),Sc=Ns(_c,[["__scopeId","data-v-efc9bb3a"]]);var z;(function(o){o.assertEqual=i=>{};function e(i){}o.assertIs=e;function s(i){throw new Error}o.assertNever=s,o.arrayToEnum=i=>{const d={};for(const m of i)d[m]=m;return d},o.getValidEnumValues=i=>{const d=o.objectKeys(i).filter(c=>typeof i[i[c]]!="number"),m={};for(const c of d)m[c]=i[c];return o.objectValues(m)},o.objectValues=i=>o.objectKeys(i).map(function(d){return i[d]}),o.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const d=[];for(const m in i)Object.prototype.hasOwnProperty.call(i,m)&&d.push(m);return d},o.find=(i,d)=>{for(const m of i)if(d(m))return m},o.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function l(i,d=" | "){return i.map(m=>typeof m=="string"?`'${m}'`:m).join(d)}o.joinValues=l,o.jsonStringifyReplacer=(i,d)=>typeof d=="bigint"?d.toString():d})(z||(z={}));var Ga;(function(o){o.mergeShapes=(e,s)=>({...e,...s})})(Ga||(Ga={}));const A=z.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),We=o=>{switch(typeof o){case"undefined":return A.undefined;case"string":return A.string;case"number":return Number.isNaN(o)?A.nan:A.number;case"boolean":return A.boolean;case"function":return A.function;case"bigint":return A.bigint;case"symbol":return A.symbol;case"object":return Array.isArray(o)?A.array:o===null?A.null:o.then&&typeof o.then=="function"&&o.catch&&typeof o.catch=="function"?A.promise:typeof Map<"u"&&o instanceof Map?A.map:typeof Set<"u"&&o instanceof Set?A.set:typeof Date<"u"&&o instanceof Date?A.date:A.object;default:return A.unknown}},k=z.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Ze extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=l=>{this.issues=[...this.issues,l]},this.addIssues=(l=[])=>{this.issues=[...this.issues,...l]};const s=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,s):this.__proto__=s,this.name="ZodError",this.issues=e}format(e){const s=e||function(d){return d.message},l={_errors:[]},i=d=>{for(const m of d.issues)if(m.code==="invalid_union")m.unionErrors.map(i);else if(m.code==="invalid_return_type")i(m.returnTypeError);else if(m.code==="invalid_arguments")i(m.argumentsError);else if(m.path.length===0)l._errors.push(s(m));else{let c=l,C=0;for(;C<m.path.length;){const w=m.path[C];C===m.path.length-1?(c[w]=c[w]||{_errors:[]},c[w]._errors.push(s(m))):c[w]=c[w]||{_errors:[]},c=c[w],C++}}};return i(this),l}static assert(e){if(!(e instanceof Ze))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,z.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=s=>s.message){const s={},l=[];for(const i of this.issues)if(i.path.length>0){const d=i.path[0];s[d]=s[d]||[],s[d].push(e(i))}else l.push(e(i));return{formErrors:l,fieldErrors:s}}get formErrors(){return this.flatten()}}Ze.create=o=>new Ze(o);const pa=(o,e)=>{let s;switch(o.code){case k.invalid_type:o.received===A.undefined?s="Required":s=`Expected ${o.expected}, received ${o.received}`;break;case k.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(o.expected,z.jsonStringifyReplacer)}`;break;case k.unrecognized_keys:s=`Unrecognized key(s) in object: ${z.joinValues(o.keys,", ")}`;break;case k.invalid_union:s="Invalid input";break;case k.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${z.joinValues(o.options)}`;break;case k.invalid_enum_value:s=`Invalid enum value. Expected ${z.joinValues(o.options)}, received '${o.received}'`;break;case k.invalid_arguments:s="Invalid function arguments";break;case k.invalid_return_type:s="Invalid function return type";break;case k.invalid_date:s="Invalid date";break;case k.invalid_string:typeof o.validation=="object"?"includes"in o.validation?(s=`Invalid input: must include "${o.validation.includes}"`,typeof o.validation.position=="number"&&(s=`${s} at one or more positions greater than or equal to ${o.validation.position}`)):"startsWith"in o.validation?s=`Invalid input: must start with "${o.validation.startsWith}"`:"endsWith"in o.validation?s=`Invalid input: must end with "${o.validation.endsWith}"`:z.assertNever(o.validation):o.validation!=="regex"?s=`Invalid ${o.validation}`:s="Invalid";break;case k.too_small:o.type==="array"?s=`Array must contain ${o.exact?"exactly":o.inclusive?"at least":"more than"} ${o.minimum} element(s)`:o.type==="string"?s=`String must contain ${o.exact?"exactly":o.inclusive?"at least":"over"} ${o.minimum} character(s)`:o.type==="number"?s=`Number must be ${o.exact?"exactly equal to ":o.inclusive?"greater than or equal to ":"greater than "}${o.minimum}`:o.type==="bigint"?s=`Number must be ${o.exact?"exactly equal to ":o.inclusive?"greater than or equal to ":"greater than "}${o.minimum}`:o.type==="date"?s=`Date must be ${o.exact?"exactly equal to ":o.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(o.minimum))}`:s="Invalid input";break;case k.too_big:o.type==="array"?s=`Array must contain ${o.exact?"exactly":o.inclusive?"at most":"less than"} ${o.maximum} element(s)`:o.type==="string"?s=`String must contain ${o.exact?"exactly":o.inclusive?"at most":"under"} ${o.maximum} character(s)`:o.type==="number"?s=`Number must be ${o.exact?"exactly":o.inclusive?"less than or equal to":"less than"} ${o.maximum}`:o.type==="bigint"?s=`BigInt must be ${o.exact?"exactly":o.inclusive?"less than or equal to":"less than"} ${o.maximum}`:o.type==="date"?s=`Date must be ${o.exact?"exactly":o.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(o.maximum))}`:s="Invalid input";break;case k.custom:s="Invalid input";break;case k.invalid_intersection_types:s="Intersection results could not be merged";break;case k.not_multiple_of:s=`Number must be a multiple of ${o.multipleOf}`;break;case k.not_finite:s="Number must be finite";break;default:s=e.defaultError,z.assertNever(o)}return{message:s}};let Tc=pa;function Cc(){return Tc}const Ac=o=>{const{data:e,path:s,errorMaps:l,issueData:i}=o,d=[...s,...i.path||[]],m={...i,path:d};if(i.message!==void 0)return{...i,path:d,message:i.message};let c="";const C=l.filter(w=>!!w).slice().reverse();for(const w of C)c=w(m,{data:e,defaultError:c}).message;return{...i,path:d,message:c}};function _(o,e){const s=Cc(),l=Ac({issueData:e,data:o.data,path:o.path,errorMaps:[o.common.contextualErrorMap,o.schemaErrorMap,s,s===pa?void 0:pa].filter(i=>!!i)});o.common.issues.push(l)}class Me{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,s){const l=[];for(const i of s){if(i.status==="aborted")return V;i.status==="dirty"&&e.dirty(),l.push(i.value)}return{status:e.value,value:l}}static async mergeObjectAsync(e,s){const l=[];for(const i of s){const d=await i.key,m=await i.value;l.push({key:d,value:m})}return Me.mergeObjectSync(e,l)}static mergeObjectSync(e,s){const l={};for(const i of s){const{key:d,value:m}=i;if(d.status==="aborted"||m.status==="aborted")return V;d.status==="dirty"&&e.dirty(),m.status==="dirty"&&e.dirty(),d.value!=="__proto__"&&(typeof m.value<"u"||i.alwaysSet)&&(l[d.value]=m.value)}return{status:e.value,value:l}}}const V=Object.freeze({status:"aborted"}),Tt=o=>({status:"dirty",value:o}),Ee=o=>({status:"valid",value:o}),Ka=o=>o.status==="aborted",Wa=o=>o.status==="dirty",mt=o=>o.status==="valid",Pt=o=>typeof Promise<"u"&&o instanceof Promise;var O;(function(o){o.errToObj=e=>typeof e=="string"?{message:e}:e||{},o.toString=e=>typeof e=="string"?e:e?.message})(O||(O={}));class Ue{constructor(e,s,l,i){this._cachedPath=[],this.parent=e,this.data=s,this._path=l,this._key=i}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 qa=(o,e)=>{if(mt(e))return{success:!0,data:e.value};if(!o.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const s=new Ze(o.common.issues);return this._error=s,this._error}}};function L(o){if(!o)return{};const{errorMap:e,invalid_type_error:s,required_error:l,description:i}=o;if(e&&(s||l))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(m,c)=>{const{message:C}=o;return m.code==="invalid_enum_value"?{message:C??c.defaultError}:typeof c.data>"u"?{message:C??l??c.defaultError}:m.code!=="invalid_type"?{message:c.defaultError}:{message:C??s??c.defaultError}},description:i}}class F{get description(){return this._def.description}_getType(e){return We(e.data)}_getOrReturnCtx(e,s){return s||{common:e.parent.common,data:e.data,parsedType:We(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Me,ctx:{common:e.parent.common,data:e.data,parsedType:We(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const s=this._parse(e);if(Pt(s))throw new Error("Synchronous parse encountered promise.");return s}_parseAsync(e){const s=this._parse(e);return Promise.resolve(s)}parse(e,s){const l=this.safeParse(e,s);if(l.success)return l.data;throw l.error}safeParse(e,s){const l={common:{issues:[],async:s?.async??!1,contextualErrorMap:s?.errorMap},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:We(e)},i=this._parseSync({data:e,path:l.path,parent:l});return qa(l,i)}"~validate"(e){const s={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:We(e)};if(!this["~standard"].async)try{const l=this._parseSync({data:e,path:[],parent:s});return mt(l)?{value:l.value}:{issues:s.common.issues}}catch(l){l?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),s.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:s}).then(l=>mt(l)?{value:l.value}:{issues:s.common.issues})}async parseAsync(e,s){const l=await this.safeParseAsync(e,s);if(l.success)return l.data;throw l.error}async safeParseAsync(e,s){const l={common:{issues:[],contextualErrorMap:s?.errorMap,async:!0},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:We(e)},i=this._parse({data:e,path:l.path,parent:l}),d=await(Pt(i)?i:Promise.resolve(i));return qa(l,d)}refine(e,s){const l=i=>typeof s=="string"||typeof s>"u"?{message:s}:typeof s=="function"?s(i):s;return this._refinement((i,d)=>{const m=e(i),c=()=>d.addIssue({code:k.custom,...l(i)});return typeof Promise<"u"&&m instanceof Promise?m.then(C=>C?!0:(c(),!1)):m?!0:(c(),!1)})}refinement(e,s){return this._refinement((l,i)=>e(l)?!0:(i.addIssue(typeof s=="function"?s(l,i):s),!1))}_refinement(e){return new ht({schema:this,typeName:P.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:s=>this["~validate"](s)}}optional(){return qe.create(this,this._def)}nullable(){return gt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return He.create(this)}promise(){return Ut.create(this,this._def)}or(e){return Lt.create([this,e],this._def)}and(e){return Bt.create(this,e,this._def)}transform(e){return new ht({...L(this._def),schema:this,typeName:P.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const s=typeof e=="function"?e:()=>e;return new xa({...L(this._def),innerType:this,defaultValue:s,typeName:P.ZodDefault})}brand(){return new qc({typeName:P.ZodBranded,type:this,...L(this._def)})}catch(e){const s=typeof e=="function"?e:()=>e;return new ba({...L(this._def),innerType:this,catchValue:s,typeName:P.ZodCatch})}describe(e){const s=this.constructor;return new s({...this._def,description:e})}pipe(e){return va.create(this,e)}readonly(){return ha.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Oc=/^c[^\s-]{8,}$/i,Nc=/^[0-9a-z]+$/,Ic=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Mc=/^[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,$c=/^[a-z0-9_-]{21}$/i,Dc=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,jc=/^[-+]?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)?)??$/,Ec=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Rc="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ia;const Pc=/^(?:(?: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])$/,Vc=/^(?:(?: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])$/,Lc=/^(([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]))$/,Bc=/^(([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])$/,Hc=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Uc=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,cs="((\\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])))",Jc=new RegExp(`^${cs}$`);function ps(o){let e="[0-5]\\d";o.precision?e=`${e}\\.\\d{${o.precision}}`:o.precision==null&&(e=`${e}(\\.\\d+)?`);const s=o.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${s}`}function Fc(o){return new RegExp(`^${ps(o)}$`)}function Zc(o){let e=`${cs}T${ps(o)}`;const s=[];return s.push(o.local?"Z?":"Z"),o.offset&&s.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${s.join("|")})`,new RegExp(`^${e}$`)}function zc(o,e){return!!((e==="v4"||!e)&&Pc.test(o)||(e==="v6"||!e)&&Lc.test(o))}function Gc(o,e){if(!Dc.test(o))return!1;try{const[s]=o.split(".");if(!s)return!1;const l=s.replace(/-/g,"+").replace(/_/g,"/").padEnd(s.length+(4-s.length%4)%4,"="),i=JSON.parse(atob(l));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function Kc(o,e){return!!((e==="v4"||!e)&&Vc.test(o)||(e==="v6"||!e)&&Bc.test(o))}class Fe extends F{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==A.string){const d=this._getOrReturnCtx(e);return _(d,{code:k.invalid_type,expected:A.string,received:d.parsedType}),V}const l=new Me;let i;for(const d of this._def.checks)if(d.kind==="min")e.data.length<d.value&&(i=this._getOrReturnCtx(e,i),_(i,{code:k.too_small,minimum:d.value,type:"string",inclusive:!0,exact:!1,message:d.message}),l.dirty());else if(d.kind==="max")e.data.length>d.value&&(i=this._getOrReturnCtx(e,i),_(i,{code:k.too_big,maximum:d.value,type:"string",inclusive:!0,exact:!1,message:d.message}),l.dirty());else if(d.kind==="length"){const m=e.data.length>d.value,c=e.data.length<d.value;(m||c)&&(i=this._getOrReturnCtx(e,i),m?_(i,{code:k.too_big,maximum:d.value,type:"string",inclusive:!0,exact:!0,message:d.message}):c&&_(i,{code:k.too_small,minimum:d.value,type:"string",inclusive:!0,exact:!0,message:d.message}),l.dirty())}else if(d.kind==="email")Ec.test(e.data)||(i=this._getOrReturnCtx(e,i),_(i,{validation:"email",code:k.invalid_string,message:d.message}),l.dirty());else if(d.kind==="emoji")ia||(ia=new RegExp(Rc,"u")),ia.test(e.data)||(i=this._getOrReturnCtx(e,i),_(i,{validation:"emoji",code:k.invalid_string,message:d.message}),l.dirty());else if(d.kind==="uuid")Mc.test(e.data)||(i=this._getOrReturnCtx(e,i),_(i,{validation:"uuid",code:k.invalid_string,message:d.message}),l.dirty());else if(d.kind==="nanoid")$c.test(e.data)||(i=this._getOrReturnCtx(e,i),_(i,{validation:"nanoid",code:k.invalid_string,message:d.message}),l.dirty());else if(d.kind==="cuid")Oc.test(e.data)||(i=this._getOrReturnCtx(e,i),_(i,{validation:"cuid",code:k.invalid_string,message:d.message}),l.dirty());else if(d.kind==="cuid2")Nc.test(e.data)||(i=this._getOrReturnCtx(e,i),_(i,{validation:"cuid2",code:k.invalid_string,message:d.message}),l.dirty());else if(d.kind==="ulid")Ic.test(e.data)||(i=this._getOrReturnCtx(e,i),_(i,{validation:"ulid",code:k.invalid_string,message:d.message}),l.dirty());else if(d.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),_(i,{validation:"url",code:k.invalid_string,message:d.message}),l.dirty()}else d.kind==="regex"?(d.regex.lastIndex=0,d.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),_(i,{validation:"regex",code:k.invalid_string,message:d.message}),l.dirty())):d.kind==="trim"?e.data=e.data.trim():d.kind==="includes"?e.data.includes(d.value,d.position)||(i=this._getOrReturnCtx(e,i),_(i,{code:k.invalid_string,validation:{includes:d.value,position:d.position},message:d.message}),l.dirty()):d.kind==="toLowerCase"?e.data=e.data.toLowerCase():d.kind==="toUpperCase"?e.data=e.data.toUpperCase():d.kind==="startsWith"?e.data.startsWith(d.value)||(i=this._getOrReturnCtx(e,i),_(i,{code:k.invalid_string,validation:{startsWith:d.value},message:d.message}),l.dirty()):d.kind==="endsWith"?e.data.endsWith(d.value)||(i=this._getOrReturnCtx(e,i),_(i,{code:k.invalid_string,validation:{endsWith:d.value},message:d.message}),l.dirty()):d.kind==="datetime"?Zc(d).test(e.data)||(i=this._getOrReturnCtx(e,i),_(i,{code:k.invalid_string,validation:"datetime",message:d.message}),l.dirty()):d.kind==="date"?Jc.test(e.data)||(i=this._getOrReturnCtx(e,i),_(i,{code:k.invalid_string,validation:"date",message:d.message}),l.dirty()):d.kind==="time"?Fc(d).test(e.data)||(i=this._getOrReturnCtx(e,i),_(i,{code:k.invalid_string,validation:"time",message:d.message}),l.dirty()):d.kind==="duration"?jc.test(e.data)||(i=this._getOrReturnCtx(e,i),_(i,{validation:"duration",code:k.invalid_string,message:d.message}),l.dirty()):d.kind==="ip"?zc(e.data,d.version)||(i=this._getOrReturnCtx(e,i),_(i,{validation:"ip",code:k.invalid_string,message:d.message}),l.dirty()):d.kind==="jwt"?Gc(e.data,d.alg)||(i=this._getOrReturnCtx(e,i),_(i,{validation:"jwt",code:k.invalid_string,message:d.message}),l.dirty()):d.kind==="cidr"?Kc(e.data,d.version)||(i=this._getOrReturnCtx(e,i),_(i,{validation:"cidr",code:k.invalid_string,message:d.message}),l.dirty()):d.kind==="base64"?Hc.test(e.data)||(i=this._getOrReturnCtx(e,i),_(i,{validation:"base64",code:k.invalid_string,message:d.message}),l.dirty()):d.kind==="base64url"?Uc.test(e.data)||(i=this._getOrReturnCtx(e,i),_(i,{validation:"base64url",code:k.invalid_string,message:d.message}),l.dirty()):z.assertNever(d);return{status:l.value,value:e.data}}_regex(e,s,l){return this.refinement(i=>e.test(i),{validation:s,code:k.invalid_string,...O.errToObj(l)})}_addCheck(e){return new Fe({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...O.errToObj(e)})}url(e){return this._addCheck({kind:"url",...O.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...O.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...O.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...O.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...O.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...O.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...O.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...O.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...O.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...O.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...O.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...O.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...O.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...O.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...O.errToObj(e)})}regex(e,s){return this._addCheck({kind:"regex",regex:e,...O.errToObj(s)})}includes(e,s){return this._addCheck({kind:"includes",value:e,position:s?.position,...O.errToObj(s?.message)})}startsWith(e,s){return this._addCheck({kind:"startsWith",value:e,...O.errToObj(s)})}endsWith(e,s){return this._addCheck({kind:"endsWith",value:e,...O.errToObj(s)})}min(e,s){return this._addCheck({kind:"min",value:e,...O.errToObj(s)})}max(e,s){return this._addCheck({kind:"max",value:e,...O.errToObj(s)})}length(e,s){return this._addCheck({kind:"length",value:e,...O.errToObj(s)})}nonempty(e){return this.min(1,O.errToObj(e))}trim(){return new Fe({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Fe({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Fe({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e}get maxLength(){let e=null;for(const s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e}}Fe.create=o=>new Fe({checks:[],typeName:P.ZodString,coerce:o?.coerce??!1,...L(o)});function Wc(o,e){const s=(o.toString().split(".")[1]||"").length,l=(e.toString().split(".")[1]||"").length,i=s>l?s:l,d=Number.parseInt(o.toFixed(i).replace(".","")),m=Number.parseInt(e.toFixed(i).replace(".",""));return d%m/10**i}class xt extends F{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==A.number){const d=this._getOrReturnCtx(e);return _(d,{code:k.invalid_type,expected:A.number,received:d.parsedType}),V}let l;const i=new Me;for(const d of this._def.checks)d.kind==="int"?z.isInteger(e.data)||(l=this._getOrReturnCtx(e,l),_(l,{code:k.invalid_type,expected:"integer",received:"float",message:d.message}),i.dirty()):d.kind==="min"?(d.inclusive?e.data<d.value:e.data<=d.value)&&(l=this._getOrReturnCtx(e,l),_(l,{code:k.too_small,minimum:d.value,type:"number",inclusive:d.inclusive,exact:!1,message:d.message}),i.dirty()):d.kind==="max"?(d.inclusive?e.data>d.value:e.data>=d.value)&&(l=this._getOrReturnCtx(e,l),_(l,{code:k.too_big,maximum:d.value,type:"number",inclusive:d.inclusive,exact:!1,message:d.message}),i.dirty()):d.kind==="multipleOf"?Wc(e.data,d.value)!==0&&(l=this._getOrReturnCtx(e,l),_(l,{code:k.not_multiple_of,multipleOf:d.value,message:d.message}),i.dirty()):d.kind==="finite"?Number.isFinite(e.data)||(l=this._getOrReturnCtx(e,l),_(l,{code:k.not_finite,message:d.message}),i.dirty()):z.assertNever(d);return{status:i.value,value:e.data}}gte(e,s){return this.setLimit("min",e,!0,O.toString(s))}gt(e,s){return this.setLimit("min",e,!1,O.toString(s))}lte(e,s){return this.setLimit("max",e,!0,O.toString(s))}lt(e,s){return this.setLimit("max",e,!1,O.toString(s))}setLimit(e,s,l,i){return new xt({...this._def,checks:[...this._def.checks,{kind:e,value:s,inclusive:l,message:O.toString(i)}]})}_addCheck(e){return new xt({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:O.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:O.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:O.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:O.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:O.toString(e)})}multipleOf(e,s){return this._addCheck({kind:"multipleOf",value:e,message:O.toString(s)})}finite(e){return this._addCheck({kind:"finite",message:O.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:O.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:O.toString(e)})}get minValue(){let e=null;for(const s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e}get maxValue(){let e=null;for(const s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&z.isInteger(e.value))}get isFinite(){let e=null,s=null;for(const l of this._def.checks){if(l.kind==="finite"||l.kind==="int"||l.kind==="multipleOf")return!0;l.kind==="min"?(s===null||l.value>s)&&(s=l.value):l.kind==="max"&&(e===null||l.value<e)&&(e=l.value)}return Number.isFinite(s)&&Number.isFinite(e)}}xt.create=o=>new xt({checks:[],typeName:P.ZodNumber,coerce:o?.coerce||!1,...L(o)});class At extends F{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==A.bigint)return this._getInvalidInput(e);let l;const i=new Me;for(const d of this._def.checks)d.kind==="min"?(d.inclusive?e.data<d.value:e.data<=d.value)&&(l=this._getOrReturnCtx(e,l),_(l,{code:k.too_small,type:"bigint",minimum:d.value,inclusive:d.inclusive,message:d.message}),i.dirty()):d.kind==="max"?(d.inclusive?e.data>d.value:e.data>=d.value)&&(l=this._getOrReturnCtx(e,l),_(l,{code:k.too_big,type:"bigint",maximum:d.value,inclusive:d.inclusive,message:d.message}),i.dirty()):d.kind==="multipleOf"?e.data%d.value!==BigInt(0)&&(l=this._getOrReturnCtx(e,l),_(l,{code:k.not_multiple_of,multipleOf:d.value,message:d.message}),i.dirty()):z.assertNever(d);return{status:i.value,value:e.data}}_getInvalidInput(e){const s=this._getOrReturnCtx(e);return _(s,{code:k.invalid_type,expected:A.bigint,received:s.parsedType}),V}gte(e,s){return this.setLimit("min",e,!0,O.toString(s))}gt(e,s){return this.setLimit("min",e,!1,O.toString(s))}lte(e,s){return this.setLimit("max",e,!0,O.toString(s))}lt(e,s){return this.setLimit("max",e,!1,O.toString(s))}setLimit(e,s,l,i){return new At({...this._def,checks:[...this._def.checks,{kind:e,value:s,inclusive:l,message:O.toString(i)}]})}_addCheck(e){return new At({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:O.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:O.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:O.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:O.toString(e)})}multipleOf(e,s){return this._addCheck({kind:"multipleOf",value:e,message:O.toString(s)})}get minValue(){let e=null;for(const s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e}get maxValue(){let e=null;for(const s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e}}At.create=o=>new At({checks:[],typeName:P.ZodBigInt,coerce:o?.coerce??!1,...L(o)});class Ya extends F{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==A.boolean){const l=this._getOrReturnCtx(e);return _(l,{code:k.invalid_type,expected:A.boolean,received:l.parsedType}),V}return Ee(e.data)}}Ya.create=o=>new Ya({typeName:P.ZodBoolean,coerce:o?.coerce||!1,...L(o)});class Vt extends F{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==A.date){const d=this._getOrReturnCtx(e);return _(d,{code:k.invalid_type,expected:A.date,received:d.parsedType}),V}if(Number.isNaN(e.data.getTime())){const d=this._getOrReturnCtx(e);return _(d,{code:k.invalid_date}),V}const l=new Me;let i;for(const d of this._def.checks)d.kind==="min"?e.data.getTime()<d.value&&(i=this._getOrReturnCtx(e,i),_(i,{code:k.too_small,message:d.message,inclusive:!0,exact:!1,minimum:d.value,type:"date"}),l.dirty()):d.kind==="max"?e.data.getTime()>d.value&&(i=this._getOrReturnCtx(e,i),_(i,{code:k.too_big,message:d.message,inclusive:!0,exact:!1,maximum:d.value,type:"date"}),l.dirty()):z.assertNever(d);return{status:l.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Vt({...this._def,checks:[...this._def.checks,e]})}min(e,s){return this._addCheck({kind:"min",value:e.getTime(),message:O.toString(s)})}max(e,s){return this._addCheck({kind:"max",value:e.getTime(),message:O.toString(s)})}get minDate(){let e=null;for(const s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e!=null?new Date(e):null}}Vt.create=o=>new Vt({checks:[],coerce:o?.coerce||!1,typeName:P.ZodDate,...L(o)});class Xa extends F{_parse(e){if(this._getType(e)!==A.symbol){const l=this._getOrReturnCtx(e);return _(l,{code:k.invalid_type,expected:A.symbol,received:l.parsedType}),V}return Ee(e.data)}}Xa.create=o=>new Xa({typeName:P.ZodSymbol,...L(o)});class Qa extends F{_parse(e){if(this._getType(e)!==A.undefined){const l=this._getOrReturnCtx(e);return _(l,{code:k.invalid_type,expected:A.undefined,received:l.parsedType}),V}return Ee(e.data)}}Qa.create=o=>new Qa({typeName:P.ZodUndefined,...L(o)});class es extends F{_parse(e){if(this._getType(e)!==A.null){const l=this._getOrReturnCtx(e);return _(l,{code:k.invalid_type,expected:A.null,received:l.parsedType}),V}return Ee(e.data)}}es.create=o=>new es({typeName:P.ZodNull,...L(o)});class fa extends F{constructor(){super(...arguments),this._any=!0}_parse(e){return Ee(e.data)}}fa.create=o=>new fa({typeName:P.ZodAny,...L(o)});class ts extends F{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Ee(e.data)}}ts.create=o=>new ts({typeName:P.ZodUnknown,...L(o)});class Ye extends F{_parse(e){const s=this._getOrReturnCtx(e);return _(s,{code:k.invalid_type,expected:A.never,received:s.parsedType}),V}}Ye.create=o=>new Ye({typeName:P.ZodNever,...L(o)});class as extends F{_parse(e){if(this._getType(e)!==A.undefined){const l=this._getOrReturnCtx(e);return _(l,{code:k.invalid_type,expected:A.void,received:l.parsedType}),V}return Ee(e.data)}}as.create=o=>new as({typeName:P.ZodVoid,...L(o)});class He extends F{_parse(e){const{ctx:s,status:l}=this._processInputParams(e),i=this._def;if(s.parsedType!==A.array)return _(s,{code:k.invalid_type,expected:A.array,received:s.parsedType}),V;if(i.exactLength!==null){const m=s.data.length>i.exactLength.value,c=s.data.length<i.exactLength.value;(m||c)&&(_(s,{code:m?k.too_big:k.too_small,minimum:c?i.exactLength.value:void 0,maximum:m?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),l.dirty())}if(i.minLength!==null&&s.data.length<i.minLength.value&&(_(s,{code:k.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),l.dirty()),i.maxLength!==null&&s.data.length>i.maxLength.value&&(_(s,{code:k.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),l.dirty()),s.common.async)return Promise.all([...s.data].map((m,c)=>i.type._parseAsync(new Ue(s,m,s.path,c)))).then(m=>Me.mergeArray(l,m));const d=[...s.data].map((m,c)=>i.type._parseSync(new Ue(s,m,s.path,c)));return Me.mergeArray(l,d)}get element(){return this._def.type}min(e,s){return new He({...this._def,minLength:{value:e,message:O.toString(s)}})}max(e,s){return new He({...this._def,maxLength:{value:e,message:O.toString(s)}})}length(e,s){return new He({...this._def,exactLength:{value:e,message:O.toString(s)}})}nonempty(e){return this.min(1,e)}}He.create=(o,e)=>new He({type:o,minLength:null,maxLength:null,exactLength:null,typeName:P.ZodArray,...L(e)});function pt(o){if(o instanceof me){const e={};for(const s in o.shape){const l=o.shape[s];e[s]=qe.create(pt(l))}return new me({...o._def,shape:()=>e})}else return o instanceof He?new He({...o._def,type:pt(o.element)}):o instanceof qe?qe.create(pt(o.unwrap())):o instanceof gt?gt.create(pt(o.unwrap())):o instanceof at?at.create(o.items.map(e=>pt(e))):o}class me extends F{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),s=z.objectKeys(e);return this._cached={shape:e,keys:s},this._cached}_parse(e){if(this._getType(e)!==A.object){const w=this._getOrReturnCtx(e);return _(w,{code:k.invalid_type,expected:A.object,received:w.parsedType}),V}const{status:l,ctx:i}=this._processInputParams(e),{shape:d,keys:m}=this._getCached(),c=[];if(!(this._def.catchall instanceof Ye&&this._def.unknownKeys==="strip"))for(const w in i.data)m.includes(w)||c.push(w);const C=[];for(const w of m){const $=d[w],ne=i.data[w];C.push({key:{status:"valid",value:w},value:$._parse(new Ue(i,ne,i.path,w)),alwaysSet:w in i.data})}if(this._def.catchall instanceof Ye){const w=this._def.unknownKeys;if(w==="passthrough")for(const $ of c)C.push({key:{status:"valid",value:$},value:{status:"valid",value:i.data[$]}});else if(w==="strict")c.length>0&&(_(i,{code:k.unrecognized_keys,keys:c}),l.dirty());else if(w!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const w=this._def.catchall;for(const $ of c){const ne=i.data[$];C.push({key:{status:"valid",value:$},value:w._parse(new Ue(i,ne,i.path,$)),alwaysSet:$ in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const w=[];for(const $ of C){const ne=await $.key,he=await $.value;w.push({key:ne,value:he,alwaysSet:$.alwaysSet})}return w}).then(w=>Me.mergeObjectSync(l,w)):Me.mergeObjectSync(l,C)}get shape(){return this._def.shape()}strict(e){return O.errToObj,new me({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(s,l)=>{const i=this._def.errorMap?.(s,l).message??l.defaultError;return s.code==="unrecognized_keys"?{message:O.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new me({...this._def,unknownKeys:"strip"})}passthrough(){return new me({...this._def,unknownKeys:"passthrough"})}extend(e){return new me({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new me({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:P.ZodObject})}setKey(e,s){return this.augment({[e]:s})}catchall(e){return new me({...this._def,catchall:e})}pick(e){const s={};for(const l of z.objectKeys(e))e[l]&&this.shape[l]&&(s[l]=this.shape[l]);return new me({...this._def,shape:()=>s})}omit(e){const s={};for(const l of z.objectKeys(this.shape))e[l]||(s[l]=this.shape[l]);return new me({...this._def,shape:()=>s})}deepPartial(){return pt(this)}partial(e){const s={};for(const l of z.objectKeys(this.shape)){const i=this.shape[l];e&&!e[l]?s[l]=i:s[l]=i.optional()}return new me({...this._def,shape:()=>s})}required(e){const s={};for(const l of z.objectKeys(this.shape))if(e&&!e[l])s[l]=this.shape[l];else{let d=this.shape[l];for(;d instanceof qe;)d=d._def.innerType;s[l]=d}return new me({...this._def,shape:()=>s})}keyof(){return fs(z.objectKeys(this.shape))}}me.create=(o,e)=>new me({shape:()=>o,unknownKeys:"strip",catchall:Ye.create(),typeName:P.ZodObject,...L(e)});me.strictCreate=(o,e)=>new me({shape:()=>o,unknownKeys:"strict",catchall:Ye.create(),typeName:P.ZodObject,...L(e)});me.lazycreate=(o,e)=>new me({shape:o,unknownKeys:"strip",catchall:Ye.create(),typeName:P.ZodObject,...L(e)});class Lt extends F{_parse(e){const{ctx:s}=this._processInputParams(e),l=this._def.options;function i(d){for(const c of d)if(c.result.status==="valid")return c.result;for(const c of d)if(c.result.status==="dirty")return s.common.issues.push(...c.ctx.common.issues),c.result;const m=d.map(c=>new Ze(c.ctx.common.issues));return _(s,{code:k.invalid_union,unionErrors:m}),V}if(s.common.async)return Promise.all(l.map(async d=>{const m={...s,common:{...s.common,issues:[]},parent:null};return{result:await d._parseAsync({data:s.data,path:s.path,parent:m}),ctx:m}})).then(i);{let d;const m=[];for(const C of l){const w={...s,common:{...s.common,issues:[]},parent:null},$=C._parseSync({data:s.data,path:s.path,parent:w});if($.status==="valid")return $;$.status==="dirty"&&!d&&(d={result:$,ctx:w}),w.common.issues.length&&m.push(w.common.issues)}if(d)return s.common.issues.push(...d.ctx.common.issues),d.result;const c=m.map(C=>new Ze(C));return _(s,{code:k.invalid_union,unionErrors:c}),V}}get options(){return this._def.options}}Lt.create=(o,e)=>new Lt({options:o,typeName:P.ZodUnion,...L(e)});function ma(o,e){const s=We(o),l=We(e);if(o===e)return{valid:!0,data:o};if(s===A.object&&l===A.object){const i=z.objectKeys(e),d=z.objectKeys(o).filter(c=>i.indexOf(c)!==-1),m={...o,...e};for(const c of d){const C=ma(o[c],e[c]);if(!C.valid)return{valid:!1};m[c]=C.data}return{valid:!0,data:m}}else if(s===A.array&&l===A.array){if(o.length!==e.length)return{valid:!1};const i=[];for(let d=0;d<o.length;d++){const m=o[d],c=e[d],C=ma(m,c);if(!C.valid)return{valid:!1};i.push(C.data)}return{valid:!0,data:i}}else return s===A.date&&l===A.date&&+o==+e?{valid:!0,data:o}:{valid:!1}}class Bt extends F{_parse(e){const{status:s,ctx:l}=this._processInputParams(e),i=(d,m)=>{if(Ka(d)||Ka(m))return V;const c=ma(d.value,m.value);return c.valid?((Wa(d)||Wa(m))&&s.dirty(),{status:s.value,value:c.data}):(_(l,{code:k.invalid_intersection_types}),V)};return l.common.async?Promise.all([this._def.left._parseAsync({data:l.data,path:l.path,parent:l}),this._def.right._parseAsync({data:l.data,path:l.path,parent:l})]).then(([d,m])=>i(d,m)):i(this._def.left._parseSync({data:l.data,path:l.path,parent:l}),this._def.right._parseSync({data:l.data,path:l.path,parent:l}))}}Bt.create=(o,e,s)=>new Bt({left:o,right:e,typeName:P.ZodIntersection,...L(s)});class at extends F{_parse(e){const{status:s,ctx:l}=this._processInputParams(e);if(l.parsedType!==A.array)return _(l,{code:k.invalid_type,expected:A.array,received:l.parsedType}),V;if(l.data.length<this._def.items.length)return _(l,{code:k.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),V;!this._def.rest&&l.data.length>this._def.items.length&&(_(l,{code:k.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),s.dirty());const d=[...l.data].map((m,c)=>{const C=this._def.items[c]||this._def.rest;return C?C._parse(new Ue(l,m,l.path,c)):null}).filter(m=>!!m);return l.common.async?Promise.all(d).then(m=>Me.mergeArray(s,m)):Me.mergeArray(s,d)}get items(){return this._def.items}rest(e){return new at({...this._def,rest:e})}}at.create=(o,e)=>{if(!Array.isArray(o))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new at({items:o,typeName:P.ZodTuple,rest:null,...L(e)})};class Ht extends F{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:s,ctx:l}=this._processInputParams(e);if(l.parsedType!==A.object)return _(l,{code:k.invalid_type,expected:A.object,received:l.parsedType}),V;const i=[],d=this._def.keyType,m=this._def.valueType;for(const c in l.data)i.push({key:d._parse(new Ue(l,c,l.path,c)),value:m._parse(new Ue(l,l.data[c],l.path,c)),alwaysSet:c in l.data});return l.common.async?Me.mergeObjectAsync(s,i):Me.mergeObjectSync(s,i)}get element(){return this._def.valueType}static create(e,s,l){return s instanceof F?new Ht({keyType:e,valueType:s,typeName:P.ZodRecord,...L(l)}):new Ht({keyType:Fe.create(),valueType:e,typeName:P.ZodRecord,...L(s)})}}class ss extends F{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:s,ctx:l}=this._processInputParams(e);if(l.parsedType!==A.map)return _(l,{code:k.invalid_type,expected:A.map,received:l.parsedType}),V;const i=this._def.keyType,d=this._def.valueType,m=[...l.data.entries()].map(([c,C],w)=>({key:i._parse(new Ue(l,c,l.path,[w,"key"])),value:d._parse(new Ue(l,C,l.path,[w,"value"]))}));if(l.common.async){const c=new Map;return Promise.resolve().then(async()=>{for(const C of m){const w=await C.key,$=await C.value;if(w.status==="aborted"||$.status==="aborted")return V;(w.status==="dirty"||$.status==="dirty")&&s.dirty(),c.set(w.value,$.value)}return{status:s.value,value:c}})}else{const c=new Map;for(const C of m){const w=C.key,$=C.value;if(w.status==="aborted"||$.status==="aborted")return V;(w.status==="dirty"||$.status==="dirty")&&s.dirty(),c.set(w.value,$.value)}return{status:s.value,value:c}}}}ss.create=(o,e,s)=>new ss({valueType:e,keyType:o,typeName:P.ZodMap,...L(s)});class Ot extends F{_parse(e){const{status:s,ctx:l}=this._processInputParams(e);if(l.parsedType!==A.set)return _(l,{code:k.invalid_type,expected:A.set,received:l.parsedType}),V;const i=this._def;i.minSize!==null&&l.data.size<i.minSize.value&&(_(l,{code:k.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),s.dirty()),i.maxSize!==null&&l.data.size>i.maxSize.value&&(_(l,{code:k.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),s.dirty());const d=this._def.valueType;function m(C){const w=new Set;for(const $ of C){if($.status==="aborted")return V;$.status==="dirty"&&s.dirty(),w.add($.value)}return{status:s.value,value:w}}const c=[...l.data.values()].map((C,w)=>d._parse(new Ue(l,C,l.path,w)));return l.common.async?Promise.all(c).then(C=>m(C)):m(c)}min(e,s){return new Ot({...this._def,minSize:{value:e,message:O.toString(s)}})}max(e,s){return new Ot({...this._def,maxSize:{value:e,message:O.toString(s)}})}size(e,s){return this.min(e,s).max(e,s)}nonempty(e){return this.min(1,e)}}Ot.create=(o,e)=>new Ot({valueType:o,minSize:null,maxSize:null,typeName:P.ZodSet,...L(e)});class ns extends F{get schema(){return this._def.getter()}_parse(e){const{ctx:s}=this._processInputParams(e);return this._def.getter()._parse({data:s.data,path:s.path,parent:s})}}ns.create=(o,e)=>new ns({getter:o,typeName:P.ZodLazy,...L(e)});class os extends F{_parse(e){if(e.data!==this._def.value){const s=this._getOrReturnCtx(e);return _(s,{received:s.data,code:k.invalid_literal,expected:this._def.value}),V}return{status:"valid",value:e.data}}get value(){return this._def.value}}os.create=(o,e)=>new os({value:o,typeName:P.ZodLiteral,...L(e)});function fs(o,e){return new bt({values:o,typeName:P.ZodEnum,...L(e)})}class bt extends F{_parse(e){if(typeof e.data!="string"){const s=this._getOrReturnCtx(e),l=this._def.values;return _(s,{expected:z.joinValues(l),received:s.parsedType,code:k.invalid_type}),V}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const s=this._getOrReturnCtx(e),l=this._def.values;return _(s,{received:s.data,code:k.invalid_enum_value,options:l}),V}return Ee(e.data)}get options(){return this._def.values}get enum(){const e={};for(const s of this._def.values)e[s]=s;return e}get Values(){const e={};for(const s of this._def.values)e[s]=s;return e}get Enum(){const e={};for(const s of this._def.values)e[s]=s;return e}extract(e,s=this._def){return bt.create(e,{...this._def,...s})}exclude(e,s=this._def){return bt.create(this.options.filter(l=>!e.includes(l)),{...this._def,...s})}}bt.create=fs;class ls extends F{_parse(e){const s=z.getValidEnumValues(this._def.values),l=this._getOrReturnCtx(e);if(l.parsedType!==A.string&&l.parsedType!==A.number){const i=z.objectValues(s);return _(l,{expected:z.joinValues(i),received:l.parsedType,code:k.invalid_type}),V}if(this._cache||(this._cache=new Set(z.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const i=z.objectValues(s);return _(l,{received:l.data,code:k.invalid_enum_value,options:i}),V}return Ee(e.data)}get enum(){return this._def.values}}ls.create=(o,e)=>new ls({values:o,typeName:P.ZodNativeEnum,...L(e)});class Ut extends F{unwrap(){return this._def.type}_parse(e){const{ctx:s}=this._processInputParams(e);if(s.parsedType!==A.promise&&s.common.async===!1)return _(s,{code:k.invalid_type,expected:A.promise,received:s.parsedType}),V;const l=s.parsedType===A.promise?s.data:Promise.resolve(s.data);return Ee(l.then(i=>this._def.type.parseAsync(i,{path:s.path,errorMap:s.common.contextualErrorMap})))}}Ut.create=(o,e)=>new Ut({type:o,typeName:P.ZodPromise,...L(e)});class ht extends F{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===P.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:s,ctx:l}=this._processInputParams(e),i=this._def.effect||null,d={addIssue:m=>{_(l,m),m.fatal?s.abort():s.dirty()},get path(){return l.path}};if(d.addIssue=d.addIssue.bind(d),i.type==="preprocess"){const m=i.transform(l.data,d);if(l.common.async)return Promise.resolve(m).then(async c=>{if(s.value==="aborted")return V;const C=await this._def.schema._parseAsync({data:c,path:l.path,parent:l});return C.status==="aborted"?V:C.status==="dirty"||s.value==="dirty"?Tt(C.value):C});{if(s.value==="aborted")return V;const c=this._def.schema._parseSync({data:m,path:l.path,parent:l});return c.status==="aborted"?V:c.status==="dirty"||s.value==="dirty"?Tt(c.value):c}}if(i.type==="refinement"){const m=c=>{const C=i.refinement(c,d);if(l.common.async)return Promise.resolve(C);if(C instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(l.common.async===!1){const c=this._def.schema._parseSync({data:l.data,path:l.path,parent:l});return c.status==="aborted"?V:(c.status==="dirty"&&s.dirty(),m(c.value),{status:s.value,value:c.value})}else return this._def.schema._parseAsync({data:l.data,path:l.path,parent:l}).then(c=>c.status==="aborted"?V:(c.status==="dirty"&&s.dirty(),m(c.value).then(()=>({status:s.value,value:c.value}))))}if(i.type==="transform")if(l.common.async===!1){const m=this._def.schema._parseSync({data:l.data,path:l.path,parent:l});if(!mt(m))return V;const c=i.transform(m.value,d);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:s.value,value:c}}else return this._def.schema._parseAsync({data:l.data,path:l.path,parent:l}).then(m=>mt(m)?Promise.resolve(i.transform(m.value,d)).then(c=>({status:s.value,value:c})):V);z.assertNever(i)}}ht.create=(o,e,s)=>new ht({schema:o,typeName:P.ZodEffects,effect:e,...L(s)});ht.createWithPreprocess=(o,e,s)=>new ht({schema:e,effect:{type:"preprocess",transform:o},typeName:P.ZodEffects,...L(s)});class qe extends F{_parse(e){return this._getType(e)===A.undefined?Ee(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}qe.create=(o,e)=>new qe({innerType:o,typeName:P.ZodOptional,...L(e)});class gt extends F{_parse(e){return this._getType(e)===A.null?Ee(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}gt.create=(o,e)=>new gt({innerType:o,typeName:P.ZodNullable,...L(e)});class xa extends F{_parse(e){const{ctx:s}=this._processInputParams(e);let l=s.data;return s.parsedType===A.undefined&&(l=this._def.defaultValue()),this._def.innerType._parse({data:l,path:s.path,parent:s})}removeDefault(){return this._def.innerType}}xa.create=(o,e)=>new xa({innerType:o,typeName:P.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...L(e)});class ba extends F{_parse(e){const{ctx:s}=this._processInputParams(e),l={...s,common:{...s.common,issues:[]}},i=this._def.innerType._parse({data:l.data,path:l.path,parent:{...l}});return Pt(i)?i.then(d=>({status:"valid",value:d.status==="valid"?d.value:this._def.catchValue({get error(){return new Ze(l.common.issues)},input:l.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ze(l.common.issues)},input:l.data})}}removeCatch(){return this._def.innerType}}ba.create=(o,e)=>new ba({innerType:o,typeName:P.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...L(e)});class rs extends F{_parse(e){if(this._getType(e)!==A.nan){const l=this._getOrReturnCtx(e);return _(l,{code:k.invalid_type,expected:A.nan,received:l.parsedType}),V}return{status:"valid",value:e.data}}}rs.create=o=>new rs({typeName:P.ZodNaN,...L(o)});class qc extends F{_parse(e){const{ctx:s}=this._processInputParams(e),l=s.data;return this._def.type._parse({data:l,path:s.path,parent:s})}unwrap(){return this._def.type}}class va extends F{_parse(e){const{status:s,ctx:l}=this._processInputParams(e);if(l.common.async)return(async()=>{const d=await this._def.in._parseAsync({data:l.data,path:l.path,parent:l});return d.status==="aborted"?V:d.status==="dirty"?(s.dirty(),Tt(d.value)):this._def.out._parseAsync({data:d.value,path:l.path,parent:l})})();{const i=this._def.in._parseSync({data:l.data,path:l.path,parent:l});return i.status==="aborted"?V:i.status==="dirty"?(s.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:l.path,parent:l})}}static create(e,s){return new va({in:e,out:s,typeName:P.ZodPipeline})}}class ha extends F{_parse(e){const s=this._def.innerType._parse(e),l=i=>(mt(i)&&(i.value=Object.freeze(i.value)),i);return Pt(s)?s.then(i=>l(i)):l(s)}unwrap(){return this._def.innerType}}ha.create=(o,e)=>new ha({innerType:o,typeName:P.ZodReadonly,...L(e)});var P;(function(o){o.ZodString="ZodString",o.ZodNumber="ZodNumber",o.ZodNaN="ZodNaN",o.ZodBigInt="ZodBigInt",o.ZodBoolean="ZodBoolean",o.ZodDate="ZodDate",o.ZodSymbol="ZodSymbol",o.ZodUndefined="ZodUndefined",o.ZodNull="ZodNull",o.ZodAny="ZodAny",o.ZodUnknown="ZodUnknown",o.ZodNever="ZodNever",o.ZodVoid="ZodVoid",o.ZodArray="ZodArray",o.ZodObject="ZodObject",o.ZodUnion="ZodUnion",o.ZodDiscriminatedUnion="ZodDiscriminatedUnion",o.ZodIntersection="ZodIntersection",o.ZodTuple="ZodTuple",o.ZodRecord="ZodRecord",o.ZodMap="ZodMap",o.ZodSet="ZodSet",o.ZodFunction="ZodFunction",o.ZodLazy="ZodLazy",o.ZodLiteral="ZodLiteral",o.ZodEnum="ZodEnum",o.ZodEffects="ZodEffects",o.ZodNativeEnum="ZodNativeEnum",o.ZodOptional="ZodOptional",o.ZodNullable="ZodNullable",o.ZodDefault="ZodDefault",o.ZodCatch="ZodCatch",o.ZodPromise="ZodPromise",o.ZodBranded="ZodBranded",o.ZodPipeline="ZodPipeline",o.ZodReadonly="ZodReadonly"})(P||(P={}));const v=Fe.create,_t=xt.create,is=fa.create;Ye.create;const ve=He.create,se=me.create;Lt.create;Bt.create;at.create;const Yc=Ht.create;bt.create;Ut.create;qe.create;gt.create;const Xc=se({label:v().min(1).max(40),left:v().min(1).max(35),right:v().min(1).max(35)}),Qc=se({primary:v().optional(),secondary:v().optional(),surface:v().optional(),bg:v().optional()}).optional(),e0=se({id:v().optional().default(()=>`post-${Date.now()}`).transform(o=>o||`post-${Date.now()}`),templateId:v().optional(),category:v().optional().default("TECH"),theme:v().optional().default("blue-tech"),accentColor:v().optional(),palette:Qc,layoutType:v().default("table"),title:v().min(1).max(120),subtitle:v().min(1).max(250),leftHeader:v().optional().default("USA 🇺🇸"),rightHeader:v().optional().default("UK 🇬🇧"),rows:ve(Xc).optional().default([]),bullets:ve(se({highlight:v().optional().default(""),text:v().min(1)})).optional().default([]),bigStat:se({number:v().default("$165,000"),label:v().default("Average Compensation"),subtext:v().optional().default(""),secondaryNumber:v().optional().default(""),secondaryLabel:v().optional().default("")}).optional(),listItems:ve(se({rank:_t(),title:v(),value:v(),tag:v().optional().default("")})).optional().default([]),quoteData:se({quote:v(),highlight:v().optional().default(""),source:v().default("Industry Insider")}).optional(),versusData:se({leftEntity:v().optional(),leftStats:ve(se({label:v(),value:v()})).optional(),leftPerk:v().optional(),rightEntity:v().optional(),rightStats:ve(se({label:v(),value:v()})).optional(),rightPerk:v().optional(),verdict:v().optional()}).optional(),receiptData:se({grossMonthly:v().optional(),items:ve(se({label:v(),amount:v(),note:v().optional()})).optional(),totalDeductions:v().optional(),netRemaining:v().optional()}).optional(),timelineData:se({pastYear:v().optional().default("2016"),presentYear:v().optional().default("2026"),items:ve(se({label:v(),pastValue:v(),presentValue:v(),changeBadge:v().optional()})).optional(),bottomInsight:v().optional()}).optional(),barchartData:ve(se({label:v(),percentage:_t().min(0).max(100),amount:v().optional(),tag:v().optional()})).optional().default([]),leaderboardData:se({calloutNote:v().optional().default("*Asumsi kurs : Rp15.500/US$"),items:ve(se({rank:_t(),name:v(),flag:v().optional().default("🌐"),value:v(),percentage:_t().min(0).max(100).optional()})).optional()}).optional(),editorialData:se({badge:v().optional().default("INVESTIGASI KHUSUS"),highlightPhrase:v().optional(),cards:ve(se({step:v().optional(),title:v(),text:v(),stat:v().optional()})).optional(),keyTakeaway:v().optional()}).optional(),matrixData:se({headers:ve(v()).optional().default(["Indikator","🇮🇩 IDN","🇲🇾 MYS","🇸🇬 SGP"]),rows:ve(se({label:v(),values:ve(v())})).optional()}).optional(),debateData:se({proTitle:v().optional().default("SISI PRO / BENEFIT"),proScore:v().optional().default("65%"),proPoints:ve(v()).optional(),conTitle:v().optional().default("SISI KONTRA / RISIKO"),conScore:v().optional().default("35%"),conPoints:ve(v()).optional(),callToAction:v().optional().default("Kalian di tim mana? Tulis pendapatmu di bawah! 👇")}).optional(),tierlistData:ve(se({tier:v(),tierColor:v().optional(),items:ve(se({name:v(),badge:v().optional(),desc:v().optional()}))})).optional().default([]),customHtml:v().optional(),customCss:v().optional(),customFields:Yc(is()).optional(),items:ve(is()).optional(),footerNote:v().optional().default("Industry Benchmark 2026"),sourceUrl:v().optional(),methodologyBadge:v().optional(),disclaimer:v().optional(),watermark:v().optional().default("@SocialGen"),bgKeyword:v().optional().default("modern office coding night"),reelsDuration:_t().min(5).max(90).default(30),caption:v().optional().default("Bagikan pendapat Anda di kolom komentar! #infografis #edukasi")}),t0={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"},a0={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"},s0={class:"flex items-center gap-2.5 sm:gap-3"},n0={class:"text-sm font-extrabold tracking-tight text-white flex items-center gap-1.5 sm:gap-2"},o0={class:"text-[9px] sm:text-[10px] font-bold px-2 py-0.5 rounded-full bg-slate-800 text-sky-400 border border-slate-700"},l0={class:"flex items-center gap-2 sm:gap-3 text-xs"},r0={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]"},i0={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]"},d0={class:"lg:hidden flex items-center justify-center px-3 py-2 bg-slate-900/90 border-b border-slate-800 flex-shrink-0"},u0={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"},c0={key:0,class:"w-2 h-2 rounded-full bg-emerald-400 animate-ping"},p0={class:"flex items-center gap-2"},f0={key:0,class:"text-emerald-400"},m0={key:1,class:"text-sky-400"},x0={key:2,class:"text-rose-400"},b0={class:"flex-1 w-full flex flex-col lg:flex-row overflow-hidden min-h-0"},h0={key:2,class:"lg:hidden fixed bottom-0 left-0 right-0 z-30 h-16 px-4 bg-slate-900/95 backdrop-blur-lg border-t border-slate-800 flex items-center justify-between gap-3 shadow-2xl"},g0={class:"flex flex-col"},y0={class:"flex items-center gap-1 text-[10px] font-bold text-sky-400"},v0={key:0},k0={key:1},w0={key:2},_0=["disabled"],S0={key:0,class:"animate-spin"},T0={key:1},C0={key:3,class:"lg:hidden fixed inset-0 z-50 bg-slate-950 flex flex-col justify-between overflow-hidden animate-in slide-in-from-bottom"},A0={class:"h-14 px-4 bg-slate-900/95 border-b border-slate-800 flex items-center justify-between shrink-0 shadow-md"},O0={class:"flex-1 overflow-hidden p-2 flex flex-col min-h-0"},N0={class:"h-16 px-4 bg-slate-900/95 border-t border-slate-800 flex items-center justify-between gap-2 shrink-0"},I0=["disabled"],D0=ga({__name:"index",setup(o){const e=S({id:"news-us-germany-salary-divide-2026",category:"TECH REPORT",theme:"blue-tech",layoutType:"news",title:"THE $90,000 TRANSATLANTIC TECH DIVIDE",subtitle:"United States 🇺🇸 vs Germany 🇩🇪 (2026 Real Purchasing Power)",leftHeader:"USA 🇺🇸",rightHeader:"Germany 🇩🇪",rows:[{label:"Junior Dev",left:"$88,000/yr",right:"$52,000/yr"},{label:"Mid-Level",left:"$135,000/yr",right:"$75,000/yr"},{label:"Senior Lead",left:"$180,000/yr",right:"$98,000/yr"},{label:"Effective Tax",left:"24%",right:"42%"},{label:"Paid Vacation",left:"15 Days",right:"30 Days"}],bullets:[{highlight:"Gross Salary Lead",text:"American engineers take home up to 84% higher base compensation."},{highlight:"Work-Life Balance",text:"German labor laws guarantee 30 paid days off with zero expectation of after-hours Slack."},{highlight:"Healthcare Drag",text:"US health insurance deductibles and out-of-pocket costs eat up to $14,000/yr per family."}],bigStat:{number:"$180,000",label:"Senior Tech Base in California",secondaryNumber:"$98,000",secondaryLabel:"Munich Hub",subtext:"The gap widens at senior level, but so does cost of childcare and housing inflation."},listItems:[{rank:1,title:"Switzerland 🇨🇭",value:"$145,000/yr",tag:"Top Net Pay"},{rank:2,title:"United States 🇺🇸",value:"$135,000/yr",tag:"Fast Growth"},{rank:3,title:"Australia 🇦🇺",value:"$98,000/yr",tag:"High Super"},{rank:4,title:"Germany 🇩🇪",value:"$84,000/yr",tag:"Pension Safety"},{rank:5,title:"United Kingdom 🇬🇧",value:"$72,000/yr",tag:"Flexible"}],quoteData:{quote:"Chasing the American gross salary without calculating healthcare deductibles and 50-hour workweeks is the most common financial illusion in global tech.",highlight:"most common financial illusion",source:"Principal Tech Recruiter"},footerNote:"Source: Verified Industry Compensation Survey 2026",watermark:"@SocialGen",bgKeyword:"modern office coding night technology",reelsDuration:30,caption:"Higher gross salary in the US or guaranteed 30 days off in Germany? Which lifestyle would you choose? Drop your vote below! 👇 #techcareers #salary #softwareengineer #worklife"}),s=S({theme:"blue-tech",backgroundSource:"pexels",musicFile:"random",videoStartOffset:0,audioStartOffset:0,outputs:{feed:!0,story:!0,reels:!0}}),l=S([]),i=S(-1),d=S(null);function m(D){if(!e.value||!e.value.title||d.value)return;const g=JSON.stringify(e.value),ae=D?JSON.stringify(D):"";if(g!==ae){d.value=JSON.parse(g);try{localStorage.setItem("sg_unsaved_stash",g)}catch{}}}function c(){if(!d.value)return;const D=d.value.title||"Editan Anda";e.value=JSON.parse(JSON.stringify(d.value)),d.value.theme&&(s.value.theme=d.value.theme),d.value=null,i.value=-1,B.value=-1;try{localStorage.removeItem("sg_unsaved_stash")}catch{}re(`Editan sebelumnya ("${D.slice(0,24)}...") berhasil dikembalikan! ↩️`,"success")}function C(){d.value=null;try{localStorage.removeItem("sg_unsaved_stash")}catch{}}function w(){try{localStorage.setItem("sg_drafts",JSON.stringify(l.value))}catch{}$fetch("/api/drafts",{method:"POST",body:{drafts:l.value}}).catch(()=>{})}function $(){l.value.unshift(JSON.parse(JSON.stringify(e.value))),i.value=0,B.value=-1,w(),re("Draft berhasil disimpan!")}function ne(D){const g=l.value[D];if(g){m(g),e.value=JSON.parse(JSON.stringify(g)),g.theme&&(s.value.theme=g.theme),i.value=D,B.value=-1;const ae=!!d.value;re(`Memuat draft #${D+1}: "${(g.title||"Untitled").slice(0,20)}..."`,"success",ae?{label:"↩️ Kembalikan Editan",onClick:c}:void 0)}}function he(D){l.value.splice(D,1),i.value===D&&(i.value=-1),w(),re("Draft dihapus")}const q=S([]),B=S(-1);function j(){try{localStorage.setItem("sg_gen_history",JSON.stringify(q.value))}catch{}$fetch("/api/generation-history",{method:"POST",body:{history:q.value}}).catch(()=>{})}function J(D){const g=q.value[D];if(g){const ae=g.contentData||g;m(ae),e.value=JSON.parse(JSON.stringify(ae)),g.options&&(s.value={...s.value,...g.options}),B.value=D,i.value=-1;const Re=!!d.value;re(`Memuat riwayat: "${(g.title||"Untitled").slice(0,24)}..."`,"success",Re?{label:"↩️ Kembalikan Editan",onClick:c}:void 0)}}function ge(D){q.value.splice(D,1),B.value===D&&(B.value=-1),j(),re("Item riwayat dihapus")}function $e(){q.value=[],B.value=-1,j(),re("Seluruh riwayat generate berhasil dibersihkan!")}let Pe=null;function we(){try{localStorage.setItem("sg_active_content",JSON.stringify(e.value)),localStorage.setItem("sg_active_options",JSON.stringify(s.value))}catch{}clearTimeout(Pe),Pe=setTimeout(()=>{$fetch("/api/last-session",{method:"POST",body:{content:e.value,options:s.value}}).catch(()=>{})},1e3)}Te(()=>e.value,we,{deep:!0}),Te(()=>s.value,we,{deep:!0});const ee=S(!1),K=S(!1),ce=S(""),Y=S(null),Ce=S(""),ie=S("success"),te=S("editor"),oe=S(!1),G=S(null);ya(async()=>{try{const D=localStorage.getItem("sg_active_content");if(D){const g=JSON.parse(D);g&&g.title&&(e.value=g)}else{const g=await $fetch("/api/last-session");g?.session?.content&&(e.value=g.session.content,g.session.options&&(s.value={...s.value,...g.session.options}))}}catch{}try{const D=localStorage.getItem("sg_active_options");if(D){const g=JSON.parse(D);g&&(s.value={...s.value,...g})}}catch{}try{const D=await $fetch("/api/drafts");if(D?.drafts&&Array.isArray(D.drafts)&&D.drafts.length>0)l.value=D.drafts;else{const g=localStorage.getItem("sg_drafts");if(g){const ae=JSON.parse(g);Array.isArray(ae)&&ae.length>0&&(l.value=ae,$fetch("/api/drafts",{method:"POST",body:{drafts:ae}}).catch(()=>{}))}}}catch{const D=localStorage.getItem("sg_drafts");if(D)try{l.value=JSON.parse(D)}catch{}}try{const D=await $fetch("/api/generation-history");if(D?.history&&Array.isArray(D.history)&&D.history.length>0)q.value=D.history;else{const g=localStorage.getItem("sg_gen_history");g&&(q.value=JSON.parse(g))}}catch{}try{const D=await $fetch("/api/status");G.value=D}catch{}try{const D=localStorage.getItem("sg_unsaved_stash");D&&(d.value=JSON.parse(D))}catch{}});const ke=fe(()=>{const D=e0.safeParse(e.value);if(D.success)return{isValid:!0,error:""};{const g=D.error.errors[0];return{isValid:!1,error:`${g.path.join(".")}: ${g.message}`}}}),le=S(null);let Ae=null;function re(D,g="success",ae){clearTimeout(Ae),Ce.value=D,ie.value=g,le.value=ae||null,Ae=setTimeout(()=>{Ce.value="",le.value=null},ae?7e3:4e3)}async function N(D,g,ae,Re){K.value=!0,ce.value=`AI Research (${ae||"Gemini"})...`;try{const H=await $fetch("/api/auto-topic",{method:"POST",body:{niche:D,layoutType:g,model:ae,language:Re}});if(H?.dataset){m(H.dataset),e.value=H.dataset,s.value.theme=H.dataset.theme,l.value.unshift(H.dataset),i.value=0,w();const ze=!!d.value;H.source==="gemini"?re(`✨ [${H.modelUsed||"Gemini"}] Berhasil meriset: "${H.dataset.title.slice(0,32)}..."`,"success",ze?{label:"↩️ Kembalikan Editan",onClick:c}:void 0):re(`ℹ️ [Curated Data] Topik siap: "${H.dataset.title.slice(0,32)}..."`,"success",ze?{label:"↩️ Kembalikan Editan",onClick:c}:void 0)}}catch(H){re("Gagal auto-topic: "+(H.data?.statusMessage||H.message),"error")}finally{K.value=!1,ce.value=""}}async function Xe(){if(!ke.value.isValid){re("Data tidak valid: "+ke.value.error,"error");return}ee.value=!0,ce.value="Rendering Images & Reels...",Y.value=null;const D={id:e.value.id||String(Date.now()),title:e.value.title||"Untitled Creation",layoutType:e.value.layoutType||"table",category:e.value.category||"GENERAL",theme:e.value.theme||"blue-tech",generatedAt:new Date().toISOString(),contentData:JSON.parse(JSON.stringify(e.value)),options:JSON.parse(JSON.stringify(s.value))};q.value.unshift(D),B.value=0,j(),te.value="preview";try{const g=await $fetch("/api/generate",{method:"POST",body:{data:e.value,options:s.value}});g?.success&&(Y.value=g,re(`✅ Generate selesai! Berhasil dirender dalam ${(g.durationMs/1e3).toFixed(1)} detik.`,"success"))}catch(g){re("Gagal render: "+(g.data?.statusMessage||g.message),"error")}finally{ee.value=!1,ce.value=""}}return(D,g)=>{const ae=_u,Re=Sc;return p(),f("div",t0,[t("header",a0,[t("div",s0,[g[16]||(g[16]=t("div",{class:"w-8 h-8 rounded-xl bg-gradient-to-tr from-sky-500 via-indigo-600 to-purple-600 flex items-center justify-center font-black text-white shadow-md shadow-sky-500/20 text-xs"}," SG ",-1)),t("div",null,[t("h1",n0,[g[15]||(g[15]=Z(" SocialGen ",-1)),t("span",o0," v"+x(n(G)?.version||"2.4.2 Studio"),1)])])]),t("div",l0,[n(G)?.geminiActive?(p(),f("span",r0," ● AI Connected ")):(p(),f("span",i0," ● Local Engine "))])]),t("div",d0,[t("div",u0,[t("button",{onClick:g[0]||(g[0]=H=>te.value="editor"),class:E(["py-1.5 px-3 rounded-lg transition flex items-center justify-center gap-1.5",n(te)==="editor"?"bg-sky-500 text-white shadow-md font-black":"text-slate-400 hover:text-slate-200"])},[...g[17]||(g[17]=[t("span",null,"⚙️ Studio & Editor",-1)])],2),t("button",{onClick:g[1]||(g[1]=H=>te.value="preview"),class:E(["py-1.5 px-3 rounded-lg transition flex items-center justify-center gap-1.5",n(te)==="preview"?"bg-indigo-600 text-white shadow-md font-black":"text-slate-400 hover:text-slate-200"])},[g[18]||(g[18]=t("span",null,"👁️ Live Preview",-1)),n(Y)?(p(),f("span",c0)):M("",!0)],2)])]),n(Ce)?(p(),f("div",{key:0,class:E(["fixed bottom-20 lg:bottom-6 right-4 lg:right-6 z-50 flex items-center gap-3 px-4 py-3 rounded-2xl shadow-2xl text-xs font-bold border transition-all max-w-[90vw]",n(ie)==="success"?"bg-slate-900 text-slate-100 border-sky-500/50 shadow-sky-950/50":n(ie)==="info"?"bg-slate-900 text-sky-200 border-indigo-500/50 shadow-indigo-950/50":"bg-rose-950 text-rose-200 border-rose-500/50"])},[t("div",p0,[n(ie)==="success"?(p(),f("span",f0,"●")):n(ie)==="info"?(p(),f("span",m0,"ℹ️")):(p(),f("span",x0,"⚠️")),t("span",null,x(n(Ce)),1)]),n(le)?(p(),f("button",{key:0,onClick:g[2]||(g[2]=()=>{n(le)?.onClick(),Ce.value="",le.value=null}),class:"px-2.5 py-1 bg-sky-500 hover:bg-sky-400 text-white font-extrabold rounded-lg shadow transition text-[11px] flex items-center gap-1 active:scale-95"},x(n(le).label),1)):M("",!0),t("button",{onClick:g[3]||(g[3]=H=>{Ce.value="",le.value=null}),class:"text-slate-400 hover:text-white transition ml-1 text-xs"}," ✕ ")],2)):M("",!0),t("main",b0,[t("section",{class:E(["h-full shrink-0",n(te)==="editor"?"flex flex-col w-full lg:w-auto lg:flex-row lg:overflow-hidden p-2 lg:p-0":"hidden lg:flex lg:flex-row lg:overflow-hidden"])},[y(ae,{modelValue:n(e),"onUpdate:modelValue":g[4]||(g[4]=H=>Be(e)?e.value=H:null),options:n(s),"onUpdate:options":g[5]||(g[5]=H=>Be(s)?s.value=H:null),"is-valid":n(ke).isValid,"validation-error":n(ke).error,"is-generating":n(ee),"generate-stage":n(ce),"is-auto-topic-loading":n(K),drafts:n(l),"active-draft-index":n(i),history:n(q),"active-history-index":n(B),"unsaved-stash":n(d),onGenerate:Xe,onAutoTopic:N,onSelectDraft:ne,onDeleteDraft:he,onSaveDraft:$,onSelectHistory:J,onDeleteHistory:ge,onClearAllHistory:$e,onRestoreStash:c,onClearStash:C,onToast:g[6]||(g[6]=(H,ze)=>re(H,ze))},null,8,["modelValue","options","is-valid","validation-error","is-generating","generate-stage","is-auto-topic-loading","drafts","active-draft-index","history","active-history-index","unsaved-stash"])],2),t("section",{class:E(["h-full min-w-0 flex-col justify-between overflow-hidden",n(te)==="preview"?"flex w-full p-2":"hidden lg:flex lg:flex-1 lg:p-3"])},[y(Re,{data:n(e),"selected-video":n(s).backgroundSource,"selected-music":n(s).musicFile,"video-start-offset":n(s).videoStartOffset,"onUpdate:videoStartOffset":g[7]||(g[7]=H=>n(s).videoStartOffset=H),"audio-start-offset":n(s).audioStartOffset,"onUpdate:audioStartOffset":g[8]||(g[8]=H=>n(s).audioStartOffset=H),"is-generating":n(ee),"generate-stage":n(ce)},null,8,["data","selected-video","selected-music","video-start-offset","audio-start-offset","is-generating","generate-stage"])],2)]),n(te)==="editor"?(p(),f("button",{key:1,onClick:g[9]||(g[9]=H=>oe.value=!0),type:"button",class:"lg:hidden fixed bottom-20 right-4 z-40 px-4 py-2.5 rounded-full bg-gradient-to-r from-sky-500 to-indigo-600 hover:from-sky-400 hover:to-indigo-500 text-white font-black text-xs shadow-2xl border border-sky-400/40 flex items-center gap-1.5 active:scale-95 transition"},[...g[19]||(g[19]=[t("span",{class:"text-sm"},"👁️",-1),t("span",null,"Intip Canvas",-1)])])):M("",!0),n(te)==="editor"?(p(),f("div",h0,[t("div",g0,[g[20]||(g[20]=t("span",{class:"text-[9px] font-bold text-slate-400 uppercase tracking-wider"},"Output",-1)),t("div",y0,[n(s).outputs?.feed!==!1?(p(),f("span",v0,"Feed")):M("",!0),n(s).outputs?.feed!==!1&&n(s).outputs?.reels!==!1?(p(),f("span",k0,"•")):M("",!0),n(s).outputs?.reels!==!1?(p(),f("span",w0,"Reels")):M("",!0)])]),t("button",{onClick:Xe,disabled:n(ee)||!n(ke).isValid,type:"button",class:"flex-1 py-3 px-4 rounded-2xl bg-gradient-to-r from-sky-500 to-indigo-600 hover:from-sky-400 hover:to-indigo-500 text-white font-black text-xs tracking-wide shadow-xl shadow-sky-500/25 flex items-center justify-center gap-2 active:scale-95 transition disabled:opacity-50"},[n(ee)?(p(),f("span",S0,"🔄")):(p(),f("span",T0,"🚀")),t("span",null,x(n(ee)?n(ce)||"Rendering Content...":"GENERATE SEKARANG"),1)],8,_0)])):M("",!0),n(oe)?(p(),f("div",C0,[t("div",A0,[g[22]||(g[22]=t("div",{class:"flex items-center gap-2"},[t("span",{class:"w-2 h-2 rounded-full bg-emerald-400 animate-ping"}),t("span",{class:"text-xs font-black text-white"},"Preview Canvas Penuh")],-1)),t("button",{onClick:g[10]||(g[10]=H=>oe.value=!1),type:"button",class:"px-3 py-1.5 rounded-xl bg-slate-800 hover:bg-slate-700 text-xs font-bold text-slate-200 border border-slate-700 flex items-center gap-1 active:scale-95 transition"},[...g[21]||(g[21]=[t("span",null,"✕ Tutup Preview",-1)])])]),t("div",O0,[y(Re,{data:n(e),"selected-video":n(s).backgroundSource,"selected-music":n(s).musicFile,"video-start-offset":n(s).videoStartOffset,"onUpdate:videoStartOffset":g[11]||(g[11]=H=>n(s).videoStartOffset=H),"audio-start-offset":n(s).audioStartOffset,"onUpdate:audioStartOffset":g[12]||(g[12]=H=>n(s).audioStartOffset=H),"is-generating":n(ee),"generate-stage":n(ce)},null,8,["data","selected-video","selected-music","video-start-offset","audio-start-offset","is-generating","generate-stage"])]),t("div",N0,[t("button",{onClick:g[13]||(g[13]=H=>oe.value=!1),type:"button",class:"flex-1 py-2.5 rounded-xl bg-slate-800 hover:bg-slate-700 text-xs font-bold text-slate-200 active:scale-95 transition"}," ✏️ Lanjut Edit Form "),t("button",{onClick:g[14]||(g[14]=()=>{oe.value=!1,Xe()}),disabled:n(ee)||!n(ke).isValid,type:"button",class:"flex-1 py-2.5 rounded-xl bg-gradient-to-r from-sky-500 to-indigo-600 text-xs font-bold text-white shadow-lg active:scale-95 transition disabled:opacity-50"}," 🚀 Langsung Render ",8,I0)])])):M("",!0)])}}});export{D0 as default};
|