@socialgen_user/socialgen 2.1.2 → 2.2.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.
Files changed (67) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_nuxt/69MjyYNQ.js +1 -0
  3. package/.output/public/_nuxt/{B3JL5g55.js → CY8lB25s.js} +1 -1
  4. package/.output/public/_nuxt/{D0l_IRiq.js → Dd2SfSxO.js} +1 -1
  5. package/.output/public/_nuxt/DllK7aKd.js +5 -0
  6. package/.output/public/_nuxt/builds/latest.json +1 -1
  7. package/.output/public/_nuxt/builds/meta/f31c3c51-3958-4f02-b948-c5b86f8639fe.json +1 -0
  8. package/.output/public/_nuxt/{D1xXB6TU.js → coG5Mux2.js} +1 -1
  9. package/.output/public/_nuxt/fBE6Av56.js +1 -0
  10. package/.output/public/_nuxt/{57MFxFz4.js → uujB4xLH.js} +1 -1
  11. package/.output/server/chunks/_/niches.mjs +142 -0
  12. package/.output/server/chunks/_/niches.mjs.map +1 -0
  13. package/.output/server/chunks/_/nitro.mjs +88 -72
  14. package/.output/server/chunks/_/storage.mjs +7 -1
  15. package/.output/server/chunks/_/storage.mjs.map +1 -1
  16. package/.output/server/chunks/_/topicMatrix.mjs +33 -65
  17. package/.output/server/chunks/_/topicMatrix.mjs.map +1 -1
  18. package/.output/server/chunks/build/{TableCard-C_ouH7xZ.mjs → TableCard-DK13vKzs.mjs} +61 -1
  19. package/.output/server/chunks/build/TableCard-DK13vKzs.mjs.map +1 -0
  20. package/.output/server/chunks/build/{_mode_-Bqv8WY_m.mjs → _mode_-CQcOaIv6.mjs} +2 -2
  21. package/.output/server/chunks/build/{_mode_-Bqv8WY_m.mjs.map → _mode_-CQcOaIv6.mjs.map} +1 -1
  22. package/.output/server/chunks/build/client.precomputed.mjs +1 -1
  23. package/.output/server/chunks/build/client.precomputed.mjs.map +1 -1
  24. package/.output/server/chunks/build/entry-styles.CgKViqen.mjs +8 -0
  25. package/.output/server/chunks/build/entry-styles.CgKViqen.mjs.map +1 -0
  26. package/.output/server/chunks/build/{pages-2auDORIM.mjs → pages-9EP79wh-.mjs} +300 -40
  27. package/.output/server/chunks/build/pages-9EP79wh-.mjs.map +1 -0
  28. package/.output/server/chunks/build/server.mjs +2 -2
  29. package/.output/server/chunks/build/styles.mjs +2 -2
  30. package/.output/server/chunks/build/styles.mjs.map +1 -1
  31. package/.output/server/chunks/routes/api/auto-topic.post.mjs +3 -2
  32. package/.output/server/chunks/routes/api/auto-topic.post.mjs.map +1 -1
  33. package/.output/server/chunks/routes/api/copy-prompt.get.mjs +12 -13
  34. package/.output/server/chunks/routes/api/copy-prompt.get.mjs.map +1 -1
  35. package/.output/server/chunks/routes/api/generate.post.mjs +32 -19
  36. package/.output/server/chunks/routes/api/generate.post.mjs.map +1 -1
  37. package/.output/server/chunks/routes/api/generation-history.delete.mjs +51 -0
  38. package/.output/server/chunks/routes/api/generation-history.delete.mjs.map +1 -0
  39. package/.output/server/chunks/routes/api/generation-history.get.mjs +41 -0
  40. package/.output/server/chunks/routes/api/generation-history.get.mjs.map +1 -0
  41. package/.output/server/chunks/routes/api/generation-history.post.mjs +42 -0
  42. package/.output/server/chunks/routes/api/generation-history.post.mjs.map +1 -0
  43. package/.output/server/chunks/routes/api/last-session.get.mjs +35 -0
  44. package/.output/server/chunks/routes/api/last-session.get.mjs.map +1 -0
  45. package/.output/server/chunks/routes/api/last-session.post.mjs +36 -0
  46. package/.output/server/chunks/routes/api/last-session.post.mjs.map +1 -0
  47. package/.output/server/chunks/routes/api/niches.delete.mjs +32 -0
  48. package/.output/server/chunks/routes/api/niches.delete.mjs.map +1 -0
  49. package/.output/server/chunks/routes/api/niches.get.mjs +24 -0
  50. package/.output/server/chunks/routes/api/niches.get.mjs.map +1 -0
  51. package/.output/server/chunks/routes/api/niches.post.mjs +56 -0
  52. package/.output/server/chunks/routes/api/niches.post.mjs.map +1 -0
  53. package/.output/server/chunks/routes/api/status.get.mjs +1 -1
  54. package/.output/server/package.json +1 -1
  55. package/bin/cli.js +1 -1
  56. package/data/drafts.json +102 -1
  57. package/data/history.json +5 -42
  58. package/data/niches.json +100 -0
  59. package/package.json +1 -1
  60. package/.output/public/_nuxt/CYkJs9Gy.js +0 -1
  61. package/.output/public/_nuxt/CfUuIQFh.js +0 -1
  62. package/.output/public/_nuxt/builds/meta/9d6279d2-3847-446f-8904-5500f3fb69a2.json +0 -1
  63. package/.output/public/_nuxt/gKE2LypS.js +0 -4
  64. package/.output/server/chunks/build/TableCard-C_ouH7xZ.mjs.map +0 -1
  65. package/.output/server/chunks/build/entry-styles.C2d8MIct.mjs +0 -8
  66. package/.output/server/chunks/build/entry-styles.C2d8MIct.mjs.map +0 -1
  67. package/.output/server/chunks/build/pages-2auDORIM.mjs.map +0 -1
@@ -1,7 +1,7 @@
1
- import { defineComponent, ref, computed, mergeProps, unref, isRef, watch, useSSRContext } from 'vue';
2
- import { ssrRenderAttrs, ssrInterpolate, ssrRenderClass, ssrRenderComponent, ssrIncludeBooleanAttr, ssrLooseContain, ssrLooseEqual, ssrRenderList, ssrRenderAttr, ssrRenderStyle } from 'vue/server-renderer';
3
- import { FileText, X, Check, Copy, Wand2, Sparkles, Bookmark, Trash2, LayoutTemplate, CheckCircle2, AlertCircle, Film, Upload, Music, Clock, RefreshCw, Play, ZoomOut, ZoomIn, RotateCcw, ShieldAlert, Download, FolderOpen } from 'lucide-vue-next';
4
- import { _ as _sfc_main$3 } from './TableCard-C_ouH7xZ.mjs';
1
+ import { defineComponent, ref, watch, computed, mergeProps, unref, isRef, nextTick, useSSRContext } from 'vue';
2
+ import { ssrRenderAttrs, ssrInterpolate, ssrRenderClass, ssrRenderComponent, ssrRenderAttr, ssrIncludeBooleanAttr, ssrLooseContain, ssrLooseEqual, ssrRenderList, ssrRenderStyle } from 'vue/server-renderer';
3
+ import { Settings, X, Check, Edit2, Trash2, FileText, Copy, Wand2, Plus, Sparkles, Bookmark, Clock, LayoutTemplate, CheckCircle2, AlertCircle, Film, Upload, Scissors, Music, RefreshCw, Play, ZoomOut, ZoomIn, RotateCcw, ShieldAlert, Pause, Volume2, VolumeX, Download, FolderOpen } from 'lucide-vue-next';
4
+ import { _ as _sfc_main$3 } from './TableCard-DK13vKzs.mjs';
5
5
  import { z } from 'zod';
6
6
 
7
7
  const _sfc_main$2 = /* @__PURE__ */ defineComponent({
@@ -16,9 +16,11 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
16
16
  generateStage: {},
17
17
  isAutoTopicLoading: { type: Boolean },
18
18
  drafts: {},
19
- activeDraftIndex: {}
19
+ activeDraftIndex: {},
20
+ history: {},
21
+ activeHistoryIndex: {}
20
22
  },
21
- emits: ["update:modelValue", "update:options", "generate", "autoTopic", "selectDraft", "deleteDraft", "saveDraft"],
23
+ emits: ["update:modelValue", "update:options", "generate", "autoTopic", "selectDraft", "deleteDraft", "saveDraft", "selectHistory", "deleteHistory", "clearAllHistory"],
22
24
  setup(__props, { emit: __emit }) {
23
25
  const props = __props;
24
26
  const jsonText = ref("");
@@ -26,6 +28,16 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
26
28
  ref("");
27
29
  const selectedModel = ref("gemini-3.8-flash");
28
30
  const activeTab = ref("editor");
31
+ const nichesList = ref([]);
32
+ const selectedNicheId = ref("tech");
33
+ const showNicheModal = ref(false);
34
+ const editingNicheId = ref(null);
35
+ const nicheForm = ref({
36
+ id: "",
37
+ name: "",
38
+ theme: "blue-tech",
39
+ description: ""
40
+ });
29
41
  const showPromptModal = ref(false);
30
42
  const manualPromptText = ref("");
31
43
  const manualPromptMeta = ref({});
@@ -50,16 +62,49 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
50
62
  },
51
63
  { immediate: true, deep: true }
52
64
  );
53
- ref({ audio: [], videos: [] });
65
+ function formatDate(isoStr) {
66
+ if (!isoStr) return "";
67
+ try {
68
+ const d = new Date(isoStr);
69
+ return d.toLocaleDateString("id-ID", { day: "numeric", month: "short", hour: "2-digit", minute: "2-digit" });
70
+ } catch {
71
+ return "";
72
+ }
73
+ }
54
74
  return (_ctx, _push, _parent, _attrs) => {
55
- var _a, _b, _c, _d, _e, _f;
75
+ var _a, _b, _c, _d, _e, _f, _g;
56
76
  _push(`<div${ssrRenderAttrs(mergeProps({ class: "flex flex-col gap-3 text-slate-100" }, _attrs))}>`);
77
+ if (unref(showNicheModal)) {
78
+ _push(`<div class="fixed inset-0 z-50 bg-black/80 backdrop-blur-sm flex items-center justify-center p-4"><div 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"><div class="flex items-center justify-between pb-3 border-b border-slate-800"><div><h3 class="text-sm font-black text-white flex items-center gap-2">`);
79
+ _push(ssrRenderComponent(unref(Settings), { class: "w-4 h-4 text-sky-400" }, null, _parent));
80
+ _push(` Kelola &amp; Buat Niche Baru </h3><p class="text-[11px] text-slate-400 mt-0.5"> Simpan niche favoritmu. AI dan Prompt Generator akan otomatis menggunakannya. </p></div><button class="p-1 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800">`);
81
+ _push(ssrRenderComponent(unref(X), { class: "w-4 h-4" }, null, _parent));
82
+ _push(`</button></div><div class="p-3.5 bg-slate-950 rounded-2xl border border-slate-800 flex flex-col gap-2.5"><div class="font-bold text-sky-400 flex items-center justify-between"><span>${ssrInterpolate(unref(editingNicheId) ? "\u270F\uFE0F Edit Niche" : "\u2795 Tambah Niche Baru")}</span>`);
83
+ if (unref(editingNicheId)) {
84
+ _push(`<button class="text-[10px] text-slate-400 hover:text-white"> Batal Edit </button>`);
85
+ } else {
86
+ _push(`<!---->`);
87
+ }
88
+ _push(`</div><div class="grid grid-cols-1 sm:grid-cols-2 gap-2"><div><label class="block text-[10px] font-bold text-slate-400 mb-1">Nama Niche</label><input${ssrRenderAttr("value", unref(nicheForm).name)} type="text" placeholder="Contoh: Kuliner &amp; 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"></div><div><label class="block text-[10px] font-bold text-slate-400 mb-1">Tema Default</label><select 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"><option value="blue-tech"${ssrIncludeBooleanAttr(Array.isArray(unref(nicheForm).theme) ? ssrLooseContain(unref(nicheForm).theme, "blue-tech") : ssrLooseEqual(unref(nicheForm).theme, "blue-tech")) ? " selected" : ""}>\u{1F535} Blue Tech</option><option value="emerald-finance"${ssrIncludeBooleanAttr(Array.isArray(unref(nicheForm).theme) ? ssrLooseContain(unref(nicheForm).theme, "emerald-finance") : ssrLooseEqual(unref(nicheForm).theme, "emerald-finance")) ? " selected" : ""}>\u{1F7E2} Emerald Finance</option><option value="slate-education"${ssrIncludeBooleanAttr(Array.isArray(unref(nicheForm).theme) ? ssrLooseContain(unref(nicheForm).theme, "slate-education") : ssrLooseEqual(unref(nicheForm).theme, "slate-education")) ? " selected" : ""}>\u{1F7E3} Slate Education</option><option value="dark-contrast"${ssrIncludeBooleanAttr(Array.isArray(unref(nicheForm).theme) ? ssrLooseContain(unref(nicheForm).theme, "dark-contrast") : ssrLooseEqual(unref(nicheForm).theme, "dark-contrast")) ? " selected" : ""}>\u26AB Dark Contrast</option><option value="crimson-alert"${ssrIncludeBooleanAttr(Array.isArray(unref(nicheForm).theme) ? ssrLooseContain(unref(nicheForm).theme, "crimson-alert") : ssrLooseEqual(unref(nicheForm).theme, "crimson-alert")) ? " selected" : ""}>\u{1F534} Crimson Alert</option><option value="amber-gold"${ssrIncludeBooleanAttr(Array.isArray(unref(nicheForm).theme) ? ssrLooseContain(unref(nicheForm).theme, "amber-gold") : ssrLooseEqual(unref(nicheForm).theme, "amber-gold")) ? " selected" : ""}>\u{1F7E1} Amber Gold</option><option value="cyber-violet"${ssrIncludeBooleanAttr(Array.isArray(unref(nicheForm).theme) ? ssrLooseContain(unref(nicheForm).theme, "cyber-violet") : ssrLooseEqual(unref(nicheForm).theme, "cyber-violet")) ? " selected" : ""}>\u{1F7EA} Cyber Violet</option><option value="sunset-orange"${ssrIncludeBooleanAttr(Array.isArray(unref(nicheForm).theme) ? ssrLooseContain(unref(nicheForm).theme, "sunset-orange") : ssrLooseEqual(unref(nicheForm).theme, "sunset-orange")) ? " selected" : ""}>\u{1F7E0} Sunset Orange</option><option value="nordic-frost"${ssrIncludeBooleanAttr(Array.isArray(unref(nicheForm).theme) ? ssrLooseContain(unref(nicheForm).theme, "nordic-frost") : ssrLooseEqual(unref(nicheForm).theme, "nordic-frost")) ? " selected" : ""}>\u2744\uFE0F Nordic Frost</option><option value="monochrome-luxe"${ssrIncludeBooleanAttr(Array.isArray(unref(nicheForm).theme) ? ssrLooseContain(unref(nicheForm).theme, "monochrome-luxe") : ssrLooseEqual(unref(nicheForm).theme, "monochrome-luxe")) ? " selected" : ""}>\u26AA Monochrome Luxe</option></select></div></div><div><label class="block text-[10px] font-bold text-slate-400 mb-1">Fokus Topik &amp; Instruksi Prompt</label><textarea 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">${ssrInterpolate(unref(nicheForm).description)}</textarea></div><button 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">`);
89
+ _push(ssrRenderComponent(unref(Check), { class: "w-3.5 h-3.5" }, null, _parent));
90
+ _push(`<span>${ssrInterpolate(unref(editingNicheId) ? "Perbarui Niche" : "Simpan Niche")}</span></button></div><div class="flex flex-col gap-2"><div class="text-[11px] font-bold text-slate-400 uppercase tracking-wider"> Daftar Niche Tersimpan (${ssrInterpolate(unref(nichesList).length)}) </div><div class="flex flex-col gap-2 max-h-[220px] overflow-y-auto pr-1 custom-scrollbar"><!--[-->`);
91
+ ssrRenderList(unref(nichesList), (n) => {
92
+ _push(`<div class="p-2.5 rounded-xl border bg-slate-950 border-slate-800 flex items-start justify-between gap-2"><div class="flex-1"><div class="flex items-center gap-2 mb-1"><span class="font-extrabold text-white text-xs">${ssrInterpolate(n.name)}</span><span class="px-1.5 py-0.2 rounded text-[9px] font-bold bg-slate-800 text-slate-300 border border-slate-700">${ssrInterpolate(n.theme || "blue-tech")}</span></div><p class="text-[11px] text-slate-400 leading-snug">${ssrInterpolate(n.description)}</p></div><div class="flex items-center gap-1"><button class="p-1.5 rounded-lg text-slate-400 hover:text-sky-300 hover:bg-slate-800 transition" title="Edit Niche">`);
93
+ _push(ssrRenderComponent(unref(Edit2), { class: "w-3.5 h-3.5" }, null, _parent));
94
+ _push(`</button><button class="p-1.5 rounded-lg text-slate-400 hover:text-rose-400 hover:bg-slate-800 transition" title="Hapus Niche">`);
95
+ _push(ssrRenderComponent(unref(Trash2), { class: "w-3.5 h-3.5" }, null, _parent));
96
+ _push(`</button></div></div>`);
97
+ });
98
+ _push(`<!--]--></div></div></div></div>`);
99
+ } else {
100
+ _push(`<!---->`);
101
+ }
57
102
  if (unref(showPromptModal)) {
58
103
  _push(`<div class="fixed inset-0 z-50 bg-black/80 backdrop-blur-sm flex items-center justify-center p-4"><div 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]"><div class="flex items-center justify-between pb-3 border-b border-slate-800"><div><h3 class="text-sm font-black text-white flex items-center gap-2">`);
59
104
  _push(ssrRenderComponent(unref(FileText), { class: "w-4 h-4 text-purple-400" }, null, _parent));
60
105
  _push(` Master Prompt AI (Dynamic Research &amp; Zero-Collision) </h3><p class="text-[11px] text-slate-400 mt-0.5"> Salin prompt ini ke ChatGPT / Gemini / Claude / DeepSeek untuk mencari topik terbaru. </p></div><button class="p-1 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800">`);
61
106
  _push(ssrRenderComponent(unref(X), { class: "w-4 h-4" }, null, _parent));
62
- _push(`</button></div><div class="flex items-center gap-2 bg-slate-950 p-2.5 rounded-xl border border-slate-800 text-[11px]"><span class="font-bold text-sky-400">Mode:</span><span class="text-white font-semibold">Dynamic Discovery (Trending \u2022 Then vs Now \u2022 Future Horizon)</span><span class="text-slate-500">\u2022</span><span class="text-purple-400 font-bold">${ssrInterpolate(unref(manualPromptMeta).usedCount || 0)} Topik Riwayat Dikecualikan</span></div><div class="relative flex-1 min-h-[220px]"><textarea 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">${ssrInterpolate(unref(manualPromptText))}</textarea></div><div class="flex items-center justify-between pt-2 border-t border-slate-800"><span class="text-[11px] text-slate-400"> Paste hasil JSON dari ChatGPT/Gemini ke kolom <b>RAW JSON</b> SocialGen. </span><button 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">`);
107
+ _push(`</button></div><div class="flex items-center gap-2 bg-slate-950 p-2.5 rounded-xl border border-slate-800 text-[11px] flex-wrap"><span class="font-bold text-sky-400">Niche Aktif:</span><span class="text-white font-semibold">${ssrInterpolate(((_a = unref(nichesList).find((n) => n.id === unref(selectedNicheId))) == null ? void 0 : _a.name) || "Default")}</span><span class="text-slate-500">\u2022</span><span class="text-purple-400 font-bold">${ssrInterpolate(unref(manualPromptMeta).usedCount || 0)} Topik Riwayat Dikecualikan</span></div><div class="relative flex-1 min-h-[220px]"><textarea 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">${ssrInterpolate(unref(manualPromptText))}</textarea></div><div class="flex items-center justify-between pt-2 border-t border-slate-800"><span class="text-[11px] text-slate-400"> Paste hasil JSON yang kamu buat ke kolom <b>RAW JSON</b> SocialGen. </span><button 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">`);
63
108
  if (unref(promptCopied)) {
64
109
  _push(ssrRenderComponent(unref(Check), { class: "w-4 h-4 text-emerald-400" }, null, _parent));
65
110
  } else {
@@ -71,13 +116,19 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
71
116
  }
72
117
  _push(`<div class="flex flex-wrap items-center justify-between gap-2.5 p-3.5 bg-slate-900/90 border border-slate-800 rounded-2xl shadow-lg"><div><h2 class="text-xs font-black text-white flex items-center gap-2">`);
73
118
  _push(ssrRenderComponent(unref(Wand2), { class: "w-3.5 h-3.5 text-sky-400" }, null, _parent));
74
- _push(` Content Studio </h2><p class="text-[10px] text-slate-400">Multi-Format Studio</p></div><div class="flex items-center gap-1.5"><button title="Buat prompt manual bebas bentrok untuk ChatGPT / Gemini Web" class="inline-flex items-center gap-1 px-2.5 py-1.5 text-[11px] font-bold text-purple-300 bg-purple-950/40 hover:bg-purple-900/50 border border-purple-500/30 rounded-xl transition shadow-sm">`);
119
+ _push(` Content Studio </h2><p class="text-[10px] text-slate-400">Multi-Format Studio</p></div><div class="flex items-center gap-1.5 flex-wrap"><div class="flex items-center gap-1 bg-slate-950 p-1 rounded-xl border border-slate-800 mr-1.5 shadow-inner"><select class="bg-transparent text-[11px] font-bold text-sky-300 focus:outline-none px-2 py-0.5 cursor-pointer max-w-[130px] truncate" title="Pilih Niche Konten"><!--[-->`);
120
+ ssrRenderList(unref(nichesList), (n) => {
121
+ _push(`<option${ssrRenderAttr("value", n.id)} class="bg-slate-900 text-white"${ssrIncludeBooleanAttr(Array.isArray(unref(selectedNicheId)) ? ssrLooseContain(unref(selectedNicheId), n.id) : ssrLooseEqual(unref(selectedNicheId), n.id)) ? " selected" : ""}>${ssrInterpolate(n.name)}</option>`);
122
+ });
123
+ _push(`<!--]--></select><button class="p-1 px-1.5 rounded-lg bg-slate-800 hover:bg-slate-700 text-sky-400 hover:text-sky-300 border border-slate-700 text-[10px] font-bold transition flex items-center gap-1" title="Kelola &amp; Buat Niche Baru">`);
124
+ _push(ssrRenderComponent(unref(Plus), { class: "w-3 h-3" }, null, _parent));
125
+ _push(`<span class="hidden sm:inline">Niche</span></button></div><button title="Buat prompt manual bebas bentrok untuk ChatGPT / Gemini Web" class="inline-flex items-center gap-1 px-2.5 py-1.5 text-[11px] font-bold text-purple-300 bg-purple-950/40 hover:bg-purple-900/50 border border-purple-500/30 rounded-xl transition shadow-sm">`);
75
126
  _push(ssrRenderComponent(unref(FileText), { class: "w-3 h-3" }, null, _parent));
76
127
  _push(`<span class="hidden sm:inline">Prompt Manual</span></button><button${ssrIncludeBooleanAttr(__props.isGenerating || __props.isAutoTopicLoading) ? " disabled" : ""} class="inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-bold text-white bg-gradient-to-r from-sky-500 via-indigo-600 to-purple-600 hover:from-sky-400 hover:to-indigo-500 rounded-xl shadow-md transition disabled:opacity-50">`);
77
128
  _push(ssrRenderComponent(unref(Sparkles), {
78
129
  class: ["w-3.5 h-3.5", { "animate-spin": __props.isAutoTopicLoading }]
79
130
  }, null, _parent));
80
- _push(`<span>${ssrInterpolate(__props.isAutoTopicLoading ? "Meriset Data..." : "\u2728 Auto-Topic")}</span></button><div class="relative group"><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"> \u25BE </button><div class="absolute right-0 mt-1 hidden group-hover:flex flex-col bg-slate-900 border border-slate-800 rounded-xl shadow-2xl py-2 z-20 w-56 text-xs"><div class="px-3 py-1 text-[10px] font-bold text-slate-500 uppercase">Model AI Engine</div><div class="px-3 py-1.5"><select class="w-full bg-slate-950 border border-slate-700 rounded-lg p-1.5 text-xs text-sky-300 focus:outline-none"><option value="gemini-3.5-flash"${ssrIncludeBooleanAttr(Array.isArray(unref(selectedModel)) ? ssrLooseContain(unref(selectedModel), "gemini-3.5-flash") : ssrLooseEqual(unref(selectedModel), "gemini-3.5-flash")) ? " selected" : ""}>\u26A1 Gemini 3.5 Flash (Aktif)</option><option value="gemini-2.5-pro"${ssrIncludeBooleanAttr(Array.isArray(unref(selectedModel)) ? ssrLooseContain(unref(selectedModel), "gemini-2.5-pro") : ssrLooseEqual(unref(selectedModel), "gemini-2.5-pro")) ? " selected" : ""}>\u{1F48E} Gemini 2.5 Pro (Billing)</option><option value="gemini-3.8-flash"${ssrIncludeBooleanAttr(Array.isArray(unref(selectedModel)) ? ssrLooseContain(unref(selectedModel), "gemini-3.8-flash") : ssrLooseEqual(unref(selectedModel), "gemini-3.8-flash")) ? " selected" : ""}>\u26A1 Gemini 3.8 Flash</option><option value="gemini-1.5-pro"${ssrIncludeBooleanAttr(Array.isArray(unref(selectedModel)) ? ssrLooseContain(unref(selectedModel), "gemini-1.5-pro") : ssrLooseEqual(unref(selectedModel), "gemini-1.5-pro")) ? " selected" : ""}>\u{1F48E} Gemini 1.5 Pro</option></select></div><div class="border-t border-slate-800 my-1"></div><div class="px-3 py-1 text-[10px] font-bold text-slate-500 uppercase">Pilih Format Khusus</div><button class="px-3 py-1.5 text-left text-sky-300 hover:bg-slate-800"> \u{1F4CA} Classic Comparison Table </button><button class="px-3 py-1.5 text-left text-orange-300 hover:bg-slate-800"> \u2694\uFE0F Versus Showdown Arena </button><button class="px-3 py-1.5 text-left text-teal-300 hover:bg-slate-800"> \u{1F9FE} Monthly Living Invoice </button><button class="px-3 py-1.5 text-left text-rose-300 hover:bg-slate-800"> \u{1F4F0} Breaking News / Pamphlet </button><button class="px-3 py-1.5 text-left text-amber-300 hover:bg-slate-800"> \u{1F3AF} Big Shocking Number </button><button class="px-3 py-1.5 text-left text-yellow-300 hover:bg-slate-800"> \u23F3 10-Year Shift (Then vs Now) </button><button class="px-3 py-1.5 text-left text-cyan-300 hover:bg-slate-800"> \u{1F4C8} Income Allocation Bars </button><button class="px-3 py-1.5 text-left text-emerald-300 hover:bg-slate-800"> \u{1F3C6} Top 5 Ranked Countdown </button><button class="px-3 py-1.5 text-left text-purple-300 hover:bg-slate-800"> \u{1F4AC} Hot Take / Quote Debate </button><button class="px-3 py-1.5 text-left text-yellow-400 hover:bg-slate-800 font-bold"> \u{1F947} Multi-Country Leaderboard (Top 10) </button><button class="px-3 py-1.5 text-left text-sky-400 hover:bg-slate-800 font-bold"> \u{1F4F0} Editorial Storytelling Deep Dive </button><button class="px-3 py-1.5 text-left text-teal-300 hover:bg-slate-800 font-bold"> \u{1F4CA} Multi-Column Matrix (3-4 Negara) </button><button class="px-3 py-1.5 text-left text-rose-400 hover:bg-slate-800 font-bold"> \u26A1 Debate Arena (Pro vs Kontra) </button><button class="px-3 py-1.5 text-left text-amber-300 hover:bg-slate-800 font-bold"> \u{1F396}\uFE0F Tier List Ranking (S, A, B, C) </button></div></div></div></div>`);
131
+ _push(`<span>${ssrInterpolate(__props.isAutoTopicLoading ? "Meriset Data..." : "\u2728 Auto-Topic")}</span></button><div class="relative group"><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"> \u25BE </button><div class="absolute right-0 mt-1 hidden group-hover:flex flex-col bg-slate-900 border border-slate-800 rounded-xl shadow-2xl py-2 z-20 w-56 text-xs"><div class="px-3 py-1 text-[10px] font-bold text-slate-500 uppercase">Model AI Engine</div><div class="px-3 py-1.5"><select class="w-full bg-slate-950 border border-slate-700 rounded-lg p-1.5 text-xs text-sky-300 focus:outline-none"><option value="gemini-3.8-flash"${ssrIncludeBooleanAttr(Array.isArray(unref(selectedModel)) ? ssrLooseContain(unref(selectedModel), "gemini-3.8-flash") : ssrLooseEqual(unref(selectedModel), "gemini-3.8-flash")) ? " selected" : ""}>\u26A1 Gemini 3.8 Flash</option><option value="gemini-3.5-flash"${ssrIncludeBooleanAttr(Array.isArray(unref(selectedModel)) ? ssrLooseContain(unref(selectedModel), "gemini-3.5-flash") : ssrLooseEqual(unref(selectedModel), "gemini-3.5-flash")) ? " selected" : ""}>\u26A1 Gemini 3.5 Flash</option><option value="gemini-2.5-pro"${ssrIncludeBooleanAttr(Array.isArray(unref(selectedModel)) ? ssrLooseContain(unref(selectedModel), "gemini-2.5-pro") : ssrLooseEqual(unref(selectedModel), "gemini-2.5-pro")) ? " selected" : ""}>\u{1F48E} Gemini 2.5 Pro</option><option value="gemini-1.5-pro"${ssrIncludeBooleanAttr(Array.isArray(unref(selectedModel)) ? ssrLooseContain(unref(selectedModel), "gemini-1.5-pro") : ssrLooseEqual(unref(selectedModel), "gemini-1.5-pro")) ? " selected" : ""}>\u{1F48E} Gemini 1.5 Pro</option></select></div><div class="border-t border-slate-800 my-1"></div><div class="px-3 py-1 text-[10px] font-bold text-slate-500 uppercase">Pilih Format Khusus</div><button class="px-3 py-1.5 text-left text-sky-300 hover:bg-slate-800"> \u{1F4CA} Classic Comparison Table </button><button class="px-3 py-1.5 text-left text-orange-300 hover:bg-slate-800"> \u2694\uFE0F Versus Showdown Arena </button><button class="px-3 py-1.5 text-left text-teal-300 hover:bg-slate-800"> \u{1F9FE} Monthly Living Invoice </button><button class="px-3 py-1.5 text-left text-rose-300 hover:bg-slate-800"> \u{1F4F0} Breaking News / Pamphlet </button><button class="px-3 py-1.5 text-left text-amber-300 hover:bg-slate-800"> \u{1F3AF} Big Shocking Number </button><button class="px-3 py-1.5 text-left text-yellow-300 hover:bg-slate-800"> \u23F3 10-Year Shift (Then vs Now) </button><button class="px-3 py-1.5 text-left text-cyan-300 hover:bg-slate-800"> \u{1F4C8} Income Allocation Bars </button><button class="px-3 py-1.5 text-left text-emerald-300 hover:bg-slate-800"> \u{1F3C6} Top 5 Ranked Countdown </button><button class="px-3 py-1.5 text-left text-purple-300 hover:bg-slate-800"> \u{1F4AC} Hot Take / Quote Debate </button><button class="px-3 py-1.5 text-left text-yellow-400 hover:bg-slate-800 font-bold"> \u{1F947} Multi-Country Leaderboard (Top 10) </button><button class="px-3 py-1.5 text-left text-sky-400 hover:bg-slate-800 font-bold"> \u{1F4F0} Editorial Storytelling Deep Dive </button><button class="px-3 py-1.5 text-left text-teal-300 hover:bg-slate-800 font-bold"> \u{1F4CA} Multi-Column Matrix (3-4 Negara) </button><button class="px-3 py-1.5 text-left text-rose-400 hover:bg-slate-800 font-bold"> \u26A1 Debate Arena (Pro vs Kontra) </button><button class="px-3 py-1.5 text-left text-amber-300 hover:bg-slate-800 font-bold"> \u{1F396}\uFE0F Tier List Ranking (S, A, B, C) </button></div></div></div></div>`);
81
132
  if (__props.isAutoTopicLoading) {
82
133
  _push(`<div class="p-3 bg-gradient-to-r from-sky-950 via-indigo-950 to-purple-950 border border-sky-500/50 rounded-2xl flex items-center gap-3 animate-pulse shadow-lg shadow-sky-500/10"><div class="w-6 h-6 rounded-lg bg-sky-500/20 border border-sky-400/40 flex items-center justify-center flex-shrink-0">`);
83
134
  _push(ssrRenderComponent(unref(Sparkles), { class: "w-3.5 h-3.5 text-sky-400 animate-spin" }, null, _parent));
@@ -85,27 +136,57 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
85
136
  } else {
86
137
  _push(`<!---->`);
87
138
  }
88
- _push(`<div class="flex items-center justify-between bg-slate-950 p-1 rounded-xl border border-slate-800 text-xs font-semibold"><div class="flex items-center gap-1"><button class="${ssrRenderClass([unref(activeTab) === "editor" ? "bg-slate-800 text-sky-400 shadow" : "text-slate-400 hover:text-white", "px-3 py-1 rounded-lg transition text-[11px]"])}"> JSON Editor </button><button class="${ssrRenderClass([unref(activeTab) === "drafts" ? "bg-slate-800 text-purple-400 shadow" : "text-slate-400 hover:text-white", "px-3 py-1 rounded-lg transition flex items-center gap-1.5 text-[11px]"])}">`);
139
+ _push(`<div class="flex items-center justify-between bg-slate-950 p-1 rounded-xl border border-slate-800 text-xs font-semibold"><div class="flex items-center gap-1"><button class="${ssrRenderClass([unref(activeTab) === "editor" ? "bg-slate-800 text-sky-400 shadow font-bold" : "text-slate-400 hover:text-white", "px-2.5 py-1 rounded-lg transition text-[11px]"])}"> JSON Editor </button><button class="${ssrRenderClass([unref(activeTab) === "drafts" ? "bg-slate-800 text-amber-400 shadow font-bold" : "text-slate-400 hover:text-white", "px-2.5 py-1 rounded-lg transition flex items-center gap-1 text-[11px]"])}" title="Draft yang kamu simpan manual untuk dipakai nanti">`);
89
140
  _push(ssrRenderComponent(unref(Bookmark), { class: "w-3 h-3" }, null, _parent));
90
- _push(`<span>Drafts Deck (${ssrInterpolate(__props.drafts.length)})</span></button></div><button class="text-[10px] text-slate-400 hover:text-sky-400 transition pr-2 font-bold"> + Save to Drafts </button></div>`);
141
+ _push(`<span>Drafts (${ssrInterpolate(__props.drafts.length)})</span></button><button class="${ssrRenderClass([unref(activeTab) === "history" ? "bg-slate-800 text-purple-400 shadow font-bold" : "text-slate-400 hover:text-white", "px-2.5 py-1 rounded-lg transition flex items-center gap-1 text-[11px]"])}" title="Riwayat otomatis setiap kali generate">`);
142
+ _push(ssrRenderComponent(unref(Clock), { class: "w-3 h-3" }, null, _parent));
143
+ _push(`<span>Riwayat (${ssrInterpolate(__props.history.length)})</span></button></div><div class="flex items-center gap-1.5">`);
144
+ if (unref(activeTab) === "history" && __props.history.length > 0) {
145
+ _push(`<button class="text-[10px] text-rose-400 hover:text-rose-300 transition font-bold pr-1" title="Bersihkan semua riwayat generate"> Bersihkan Riwayat </button>`);
146
+ } else {
147
+ _push(`<!---->`);
148
+ }
149
+ _push(`<button class="text-[10px] text-amber-400 hover:text-amber-300 transition pr-2 font-bold flex items-center gap-1" title="Simpan data saat ini ke Drafts untuk digunakan nanti">`);
150
+ _push(ssrRenderComponent(unref(Bookmark), { class: "w-3 h-3" }, null, _parent));
151
+ _push(`<span>+ Simpan ke Draft</span></button></div></div>`);
91
152
  if (unref(activeTab) === "drafts") {
92
- _push(`<div class="flex flex-col gap-1.5 p-2.5 bg-slate-900/90 border border-slate-800 rounded-2xl max-h-[300px] overflow-y-auto">`);
153
+ _push(`<div class="flex flex-col gap-1.5 p-2.5 bg-slate-900/90 border border-slate-800 rounded-2xl max-h-[300px] overflow-y-auto custom-scrollbar">`);
93
154
  if (__props.drafts.length === 0) {
94
- _push(`<div class="text-center py-8 text-slate-500 text-[11px]"> Belum ada draft tersimpan. Klik &quot;Auto-Topic&quot; untuk mengumpulkan berbagai ide! </div>`);
155
+ _push(`<div class="text-center py-8 text-slate-500 text-[11px] leading-relaxed"> Belum ada draft tersimpan.<br> Klik <b class="text-amber-400">+ Simpan ke Draft</b> di atas untuk menyimpan konten ini agar bisa diedit/digenerate nanti! </div>`);
95
156
  } else {
96
157
  _push(`<!---->`);
97
158
  }
98
159
  _push(`<!--[-->`);
99
160
  ssrRenderList(__props.drafts, (draft, dIdx) => {
100
- _push(`<div class="${ssrRenderClass([__props.activeDraftIndex === dIdx ? "bg-sky-500/15 border-sky-500/50 text-white" : "bg-slate-950/60 border-slate-800 text-slate-300 hover:border-slate-700", "p-2 rounded-xl border cursor-pointer transition flex items-center justify-between text-xs group"])}"><div class="flex-1 pr-2"><div class="flex items-center gap-1.5 mb-0.5"><span class="${ssrRenderClass([draft.layoutType === "news" ? "bg-rose-500/20 text-rose-300 border border-rose-500/30" : draft.layoutType === "versus" ? "bg-orange-500/20 text-orange-300 border border-orange-500/30" : draft.layoutType === "receipt" ? "bg-teal-500/20 text-teal-300 border border-teal-500/30" : draft.layoutType === "stat" ? "bg-amber-500/20 text-amber-300 border border-amber-500/30" : draft.layoutType === "timeline" ? "bg-yellow-500/20 text-yellow-300 border border-yellow-500/30" : draft.layoutType === "barchart" ? "bg-cyan-500/20 text-cyan-300 border border-cyan-500/30" : draft.layoutType === "list" ? "bg-emerald-500/20 text-emerald-300 border border-emerald-500/30" : draft.layoutType === "quote" ? "bg-purple-500/20 text-purple-300 border border-purple-500/30" : "bg-sky-500/20 text-sky-300 border border-sky-500/30", "px-1.5 py-0.2 rounded text-[8px] font-bold uppercase"])}">${ssrInterpolate(draft.layoutType || "table")}</span><span class="text-[9px] text-slate-400 font-semibold">${ssrInterpolate(draft.category)}</span></div><div class="font-bold text-[11px] truncate">${ssrInterpolate(draft.title)}</div></div><button class="opacity-0 group-hover:opacity-100 p-1 text-slate-400 hover:text-rose-400 transition rounded">`);
101
- _push(ssrRenderComponent(unref(Trash2), { class: "w-3 h-3" }, null, _parent));
161
+ _push(`<div class="${ssrRenderClass([__props.activeDraftIndex === dIdx ? "bg-amber-500/15 border-amber-500/50 text-white" : "bg-slate-950/60 border-slate-800 text-slate-300 hover:border-slate-700", "p-2 rounded-xl border cursor-pointer transition flex items-center justify-between text-xs group"])}"><div class="flex-1 pr-2"><div class="flex items-center gap-1.5 mb-0.5"><span 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">${ssrInterpolate(draft.layoutType || "table")}</span><span class="text-[9px] text-slate-400 font-semibold">${ssrInterpolate(draft.category)}</span></div><div class="font-bold text-[11px] truncate text-slate-100">${ssrInterpolate(draft.title)}</div></div><button class="opacity-0 group-hover:opacity-100 p-1 text-slate-400 hover:text-rose-400 transition rounded" title="Hapus draft ini">`);
162
+ _push(ssrRenderComponent(unref(Trash2), { class: "w-3.5 h-3.5" }, null, _parent));
163
+ _push(`</button></div>`);
164
+ });
165
+ _push(`<!--]--></div>`);
166
+ } else if (unref(activeTab) === "history") {
167
+ _push(`<div class="flex flex-col gap-1.5 p-2.5 bg-slate-900/90 border border-slate-800 rounded-2xl max-h-[300px] overflow-y-auto custom-scrollbar">`);
168
+ if (__props.history.length === 0) {
169
+ _push(`<div class="text-center py-8 text-slate-500 text-[11px] leading-relaxed"> Belum ada riwayat pembuatan.<br> Setiap kali kamu klik <b class="text-sky-400">GENERATE CONTENT</b>, hasil pembuatan akan otomatis tercatat di sini! </div>`);
170
+ } else {
171
+ _push(`<!---->`);
172
+ }
173
+ _push(`<!--[-->`);
174
+ ssrRenderList(__props.history, (item, hIdx) => {
175
+ _push(`<div class="${ssrRenderClass([__props.activeHistoryIndex === hIdx ? "bg-purple-500/15 border-purple-500/50 text-white" : "bg-slate-950/60 border-slate-800 text-slate-300 hover:border-slate-700", "p-2 rounded-xl border cursor-pointer transition flex items-center justify-between text-xs group"])}"><div class="flex-1 pr-2"><div class="flex items-center gap-1.5 mb-0.5"><span 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">${ssrInterpolate(item.layoutType || "reels")}</span><span class="text-[9px] text-slate-400 font-semibold">${ssrInterpolate(item.category)}</span>`);
176
+ if (item.generatedAt) {
177
+ _push(`<span class="text-[9px] text-slate-500 font-mono ml-auto">${ssrInterpolate(formatDate(item.generatedAt))}</span>`);
178
+ } else {
179
+ _push(`<!---->`);
180
+ }
181
+ _push(`</div><div class="font-bold text-[11px] truncate text-slate-100">${ssrInterpolate(item.title)}</div></div><button class="opacity-0 group-hover:opacity-100 p-1 text-slate-400 hover:text-rose-400 transition rounded" title="Hapus riwayat ini">`);
182
+ _push(ssrRenderComponent(unref(Trash2), { class: "w-3.5 h-3.5" }, null, _parent));
102
183
  _push(`</button></div>`);
103
184
  });
104
185
  _push(`<!--]--></div>`);
105
186
  } else {
106
187
  _push(`<div class="flex flex-col bg-slate-900/90 border border-slate-800 rounded-2xl overflow-hidden shadow-lg"><div class="grid grid-cols-2 gap-2 p-2.5 bg-slate-950/70 border-b border-slate-800 text-xs"><div><label class="block text-[10px] font-bold text-slate-300 mb-1 flex items-center gap-1">`);
107
188
  _push(ssrRenderComponent(unref(LayoutTemplate), { class: "w-3 h-3 text-sky-400" }, null, _parent));
108
- _push(` Format Template </label><select${ssrRenderAttr("value", __props.modelValue.layoutType || "table")} class="w-full bg-slate-900 border border-slate-800 rounded-lg p-1.5 text-slate-200 focus:outline-none focus:border-sky-500 font-semibold text-[11px]"><option value="table">\u{1F4CA} Comparison Table</option><option value="versus">\u2694\uFE0F Versus Showdown Arena</option><option value="receipt">\u{1F9FE} Monthly Living Invoice</option><option value="news">\u{1F4F0} Special Report Pamphlet</option><option value="stat">\u{1F3AF} Big Shocking Number</option><option value="timeline">\u23F3 10-Year Shift (Then vs Now)</option><option value="barchart">\u{1F4C8} Income Allocation Bars</option><option value="list">\u{1F3C6} Top 5 Ranked List</option><option value="quote">\u{1F4AC} Hot Take / Quote Debate</option><option value="leaderboard">\u{1F947} Multi-Country Leaderboard (Top 10)</option><option value="editorial">\u{1F4F0} Editorial Storytelling Deep Dive</option><option value="matrix">\u{1F4CA} Multi-Column Matrix (3-4 Negara)</option><option value="debate">\u26A1 Debate Arena (Pro vs Kontra)</option><option value="tierlist">\u{1F396}\uFE0F Tier List Ranking (S, A, B, C)</option></select></div><div><label class="block text-[10px] font-bold text-slate-300 mb-1"> Theme Color </label><select${ssrRenderAttr("value", __props.modelValue.theme || "blue-tech")} class="w-full bg-slate-900 border border-slate-800 rounded-lg p-1.5 text-slate-200 focus:outline-none focus:border-sky-500 font-semibold text-[11px]"><option value="blue-tech">\u{1F535} Blue Tech (Software / AI)</option><option value="emerald-finance">\u{1F7E2} Emerald Finance (Salaries / Living)</option><option value="slate-education">\u{1F7E3} Slate Education (Schools / Public)</option><option value="dark-contrast">\u26AB Dark Contrast (Universal / Bold)</option><option value="crimson-alert">\u{1F534} Crimson Alert (Breaking / Shock)</option></select></div><div class="col-span-2 grid grid-cols-3 gap-2 pt-1 border-t border-slate-800/60 mt-1"><div class="col-span-1"><label class="block text-[10px] font-bold text-slate-400 mb-1"> Watermark Handle </label><input type="text"${ssrRenderAttr("value", __props.modelValue.watermark || "@SocialGen")} placeholder="@NamaAkun" class="w-full bg-slate-900 border border-slate-800 rounded-lg px-2.5 py-1.5 text-sky-400 font-semibold text-[11px] focus:outline-none focus:border-sky-500 transition"></div><div class="col-span-2"><label class="block text-[10px] font-bold text-slate-400 mb-1"> Judul Konten (Title) </label><input type="text"${ssrRenderAttr("value", __props.modelValue.title)} placeholder="Judul Utama Konten..." class="w-full bg-slate-900 border border-slate-800 rounded-lg px-2.5 py-1.5 text-slate-100 font-semibold text-[11px] focus:outline-none focus:border-sky-500 transition"></div></div></div><div class="flex items-center justify-between px-3 py-1.5 bg-slate-950/50 border-b border-slate-800"><div class="flex items-center gap-2 text-xs"><span class="font-bold text-slate-300 text-[10px]">RAW JSON</span>`);
189
+ _push(` Format Template </label><select${ssrRenderAttr("value", __props.modelValue.layoutType || "table")} class="w-full bg-slate-900 border border-slate-800 rounded-lg p-1.5 text-slate-200 focus:outline-none focus:border-sky-500 font-semibold text-[11px]"><option value="table">\u{1F4CA} Comparison Table</option><option value="versus">\u2694\uFE0F Versus Showdown Arena</option><option value="receipt">\u{1F9FE} Monthly Living Invoice</option><option value="news">\u{1F4F0} Special Report Pamphlet</option><option value="stat">\u{1F3AF} Big Shocking Number</option><option value="timeline">\u23F3 10-Year Shift (Then vs Now)</option><option value="barchart">\u{1F4C8} Income Allocation Bars</option><option value="list">\u{1F3C6} Top 5 Ranked List</option><option value="quote">\u{1F4AC} Hot Take / Quote Debate</option><option value="leaderboard">\u{1F947} Multi-Country Leaderboard (Top 10)</option><option value="editorial">\u{1F4F0} Editorial Storytelling Deep Dive</option><option value="matrix">\u{1F4CA} Multi-Column Matrix (3-4 Negara)</option><option value="debate">\u26A1 Debate Arena (Pro vs Kontra)</option><option value="tierlist">\u{1F396}\uFE0F Tier List Ranking (S, A, B, C)</option></select></div><div><label class="block text-[10px] font-bold text-slate-300 mb-1"> Theme Color (10 Pilihan) </label><select${ssrRenderAttr("value", __props.modelValue.theme || "blue-tech")} class="w-full bg-slate-900 border border-slate-800 rounded-lg p-1.5 text-slate-200 focus:outline-none focus:border-sky-500 font-semibold text-[11px]"><option value="blue-tech">\u{1F535} Blue Tech (AI &amp; Software)</option><option value="emerald-finance">\u{1F7E2} Emerald Finance (Salaries &amp; Living)</option><option value="slate-education">\u{1F7E3} Slate Education (Education &amp; Career)</option><option value="dark-contrast">\u26AB Dark Contrast (Universal Bold)</option><option value="crimson-alert">\u{1F534} Crimson Alert (Breaking Shock)</option><option value="amber-gold">\u{1F7E1} Amber Gold (Luxury &amp; Executive)</option><option value="cyber-violet">\u{1F7EA} Cyber Violet (Synthwave &amp; Neon)</option><option value="sunset-orange">\u{1F7E0} Sunset Orange (Warm Energy)</option><option value="nordic-frost">\u2744\uFE0F Nordic Frost (Polar Cyan Clean)</option><option value="monochrome-luxe">\u26AA Monochrome Luxe (Minimalist)</option></select></div><div class="col-span-2 grid grid-cols-3 gap-2 pt-1 border-t border-slate-800/60 mt-1"><div class="col-span-1"><label class="block text-[10px] font-bold text-slate-400 mb-1"> Watermark Handle </label><input type="text"${ssrRenderAttr("value", __props.modelValue.watermark || "@SocialGen")} placeholder="@NamaAkun" class="w-full bg-slate-900 border border-slate-800 rounded-lg px-2.5 py-1.5 text-sky-400 font-semibold text-[11px] focus:outline-none focus:border-sky-500 transition"></div><div class="col-span-2"><label class="block text-[10px] font-bold text-slate-400 mb-1"> Judul Konten (Title) </label><input type="text"${ssrRenderAttr("value", __props.modelValue.title)} placeholder="Judul Utama Konten..." class="w-full bg-slate-900 border border-slate-800 rounded-lg px-2.5 py-1.5 text-slate-100 font-semibold text-[11px] focus:outline-none focus:border-sky-500 transition"></div></div></div><div class="flex items-center justify-between px-3 py-1.5 bg-slate-950/50 border-b border-slate-800"><div class="flex items-center gap-2 text-xs"><span class="font-bold text-slate-300 text-[10px]">RAW JSON SocialGen</span>`);
109
190
  if (__props.isValid && !unref(jsonFormatError)) {
110
191
  _push(`<span class="inline-flex items-center gap-0.5 px-1.5 py-0.2 rounded-full text-[9px] font-semibold bg-emerald-500/20 text-emerald-400 border border-emerald-500/30">`);
111
192
  _push(ssrRenderComponent(unref(CheckCircle2), { class: "w-2.5 h-2.5" }, null, _parent));
@@ -123,7 +204,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
123
204
  }
124
205
  _push(`</div></div>`);
125
206
  }
126
- _push(`<input type="file" accept="video/mp4,video/webm" class="hidden"><input type="file" accept="audio/mp3,audio/mpeg,audio/wav" class="hidden"><div class="p-3 bg-slate-900/90 border border-slate-800 rounded-2xl flex flex-col gap-2.5 shadow-lg text-xs"><div class="flex items-center justify-between gap-2"><label class="font-bold text-slate-300 flex items-center gap-1.5 text-[11px]">`);
207
+ _push(`<input type="file" accept="video/mp4,video/webm" class="hidden"><input type="file" accept="audio/mp3,audio/mpeg,audio/wav" class="hidden"><div class="p-3 bg-slate-900/90 border border-slate-800 rounded-2xl flex flex-col gap-2.5 shadow-lg text-xs"><div class="flex flex-col gap-1.5"><div class="flex items-center justify-between gap-2"><label class="font-bold text-slate-300 flex items-center gap-1.5 text-[11px]">`);
127
208
  _push(ssrRenderComponent(unref(Film), { class: "w-3.5 h-3.5 text-sky-400" }, null, _parent));
128
209
  _push(`<span>Background</span></label><div class="flex items-center gap-1.5"><select${ssrRenderAttr("value", __props.options.backgroundSource || "random")} class="bg-slate-950 border border-slate-800 rounded-lg px-2 py-1 text-slate-300 text-[11px] focus:outline-none max-w-[170px]"><option value="random">\u{1F500} Acak Video</option><!--[-->`);
129
210
  ssrRenderList(unref(availableVideos), (v) => {
@@ -131,7 +212,9 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
131
212
  });
132
213
  _push(`<!--]--><option value="pexels">\u{1F310} Pexels API (Auto HD)</option></select><button${ssrIncludeBooleanAttr(unref(isUploading)) ? " disabled" : ""} 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">`);
133
214
  _push(ssrRenderComponent(unref(Upload), { class: "w-3 h-3" }, null, _parent));
134
- _push(`<span class="hidden sm:inline">${ssrInterpolate(unref(isUploading) ? "..." : "Upload")}</span></button></div></div><div class="flex items-center justify-between gap-2 pt-1.5 border-t border-slate-800"><label class="font-bold text-slate-300 flex items-center gap-1.5 text-[11px]">`);
215
+ _push(`<span class="hidden sm:inline">${ssrInterpolate(unref(isUploading) ? "..." : "Upload")}</span></button></div></div><div class="flex items-center justify-between pl-5 pr-1 text-[10px] text-slate-400"><span class="flex items-center gap-1 text-sky-300">`);
216
+ _push(ssrRenderComponent(unref(Scissors), { class: "w-2.5 h-2.5" }, null, _parent));
217
+ _push(` Mulai Video: ${ssrInterpolate(__props.options.videoStartOffset || 0)}s </span><input type="range" min="0" max="60" step="1"${ssrRenderAttr("value", __props.options.videoStartOffset || 0)} class="w-32 h-1 bg-slate-950 rounded appearance-none cursor-pointer accent-sky-400"></div></div><div class="flex flex-col gap-1.5 pt-1.5 border-t border-slate-800"><div class="flex items-center justify-between gap-2"><label class="font-bold text-slate-300 flex items-center gap-1.5 text-[11px]">`);
135
218
  _push(ssrRenderComponent(unref(Music), { class: "w-3.5 h-3.5 text-purple-400" }, null, _parent));
136
219
  _push(`<span>Musik Reels</span></label><div class="flex items-center gap-1.5"><select${ssrRenderAttr("value", __props.options.musicFile || "random")} class="bg-slate-950 border border-slate-800 rounded-lg px-2 py-1 text-slate-300 text-[11px] focus:outline-none max-w-[170px]"><option value="random">\u{1F500} Acak Musik</option><!--[-->`);
137
220
  ssrRenderList(unref(availableAudio), (a) => {
@@ -139,13 +222,15 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
139
222
  });
140
223
  _push(`<!--]--></select><button${ssrIncludeBooleanAttr(unref(isUploading)) ? " disabled" : ""} 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">`);
141
224
  _push(ssrRenderComponent(unref(Upload), { class: "w-3 h-3" }, null, _parent));
142
- _push(`<span class="hidden sm:inline">${ssrInterpolate(unref(isUploading) ? "..." : "Upload")}</span></button></div></div><div class="flex items-center justify-between pt-1.5 border-t border-slate-800"><label class="font-bold text-slate-300 flex items-center gap-1.5 text-[11px]">`);
225
+ _push(`<span class="hidden sm:inline">${ssrInterpolate(unref(isUploading) ? "..." : "Upload")}</span></button></div></div><div class="flex items-center justify-between pl-5 pr-1 text-[10px] text-slate-400"><span class="flex items-center gap-1 text-purple-300">`);
226
+ _push(ssrRenderComponent(unref(Scissors), { class: "w-2.5 h-2.5" }, null, _parent));
227
+ _push(` Mulai Musik: ${ssrInterpolate(__props.options.audioStartOffset || 0)}s </span><input type="range" min="0" max="120" step="1"${ssrRenderAttr("value", __props.options.audioStartOffset || 0)} class="w-32 h-1 bg-slate-950 rounded appearance-none cursor-pointer accent-purple-400"></div></div><div class="flex items-center justify-between pt-1.5 border-t border-slate-800"><label class="font-bold text-slate-300 flex items-center gap-1.5 text-[11px]">`);
143
228
  _push(ssrRenderComponent(unref(Clock), { class: "w-3.5 h-3.5 text-emerald-400" }, null, _parent));
144
229
  _push(`<span>Durasi Reels:</span></label><div class="flex items-center gap-1.5 flex-wrap justify-end"><!--[-->`);
145
230
  ssrRenderList([7, 10, 15, 30, 60], (d) => {
146
- _push(`<button class="${ssrRenderClass([(__props.modelValue.reelsDuration || 10) === d ? "bg-emerald-500/20 border-emerald-500/60 text-emerald-300" : "bg-slate-950 border-slate-800 text-slate-400 hover:text-white", "px-2 py-0.5 text-[10px] font-bold rounded-lg border transition"])}">${ssrInterpolate(d === 60 ? "1m" : d + "s")}</button>`);
231
+ _push(`<button class="${ssrRenderClass([(__props.modelValue.reelsDuration || 30) === d ? "bg-emerald-500/20 border-emerald-500/60 text-emerald-300" : "bg-slate-950 border-slate-800 text-slate-400 hover:text-white", "px-2 py-0.5 text-[10px] font-bold rounded-lg border transition"])}">${ssrInterpolate(d === 60 ? "1m" : d + "s")}</button>`);
147
232
  });
148
- _push(`<!--]--></div></div><div class="grid grid-cols-3 gap-2 pt-1.5 border-t border-slate-800"><label class="${ssrRenderClass([((_a = __props.options.outputs) == null ? void 0 : _a.feed) !== false ? "bg-sky-500/10 border-sky-500/40 text-sky-200" : "bg-slate-950/50 border-slate-800 text-slate-500", "flex items-center gap-1.5 p-1.5 rounded-xl border text-[11px] cursor-pointer transition select-none"])}"><input type="checkbox"${ssrIncludeBooleanAttr(((_b = __props.options.outputs) == null ? void 0 : _b.feed) !== false) ? " checked" : ""} class="rounded text-sky-500 focus:ring-0 bg-slate-900 border-slate-700 w-3 h-3"><span class="font-bold">Feed 4:5</span></label><label class="${ssrRenderClass([((_c = __props.options.outputs) == null ? void 0 : _c.story) !== false ? "bg-indigo-500/10 border-indigo-500/40 text-indigo-200" : "bg-slate-950/50 border-slate-800 text-slate-500", "flex items-center gap-1.5 p-1.5 rounded-xl border text-[11px] cursor-pointer transition select-none"])}"><input type="checkbox"${ssrIncludeBooleanAttr(((_d = __props.options.outputs) == null ? void 0 : _d.story) !== false) ? " checked" : ""} class="rounded text-indigo-500 focus:ring-0 bg-slate-900 border-slate-700 w-3 h-3"><span class="font-bold">Story 9:16</span></label><label class="${ssrRenderClass([((_e = __props.options.outputs) == null ? void 0 : _e.reels) !== false ? "bg-emerald-500/10 border-emerald-500/40 text-emerald-200" : "bg-slate-950/50 border-slate-800 text-slate-500", "flex items-center gap-1.5 p-1.5 rounded-xl border text-[11px] cursor-pointer transition select-none"])}"><input type="checkbox"${ssrIncludeBooleanAttr(((_f = __props.options.outputs) == null ? void 0 : _f.reels) !== false) ? " checked" : ""} class="rounded text-emerald-500 focus:ring-0 bg-slate-900 border-slate-700 w-3 h-3"><span class="font-bold">Reels MP4</span></label></div></div><button${ssrIncludeBooleanAttr(!__props.isValid || __props.isGenerating || !!unref(jsonFormatError)) ? " disabled" : ""} class="${ssrRenderClass([[
233
+ _push(`<!--]--></div></div><div class="grid grid-cols-3 gap-2 pt-1.5 border-t border-slate-800"><label class="${ssrRenderClass([((_b = __props.options.outputs) == null ? void 0 : _b.feed) !== false ? "bg-sky-500/10 border-sky-500/40 text-sky-200" : "bg-slate-950/50 border-slate-800 text-slate-500", "flex items-center gap-1.5 p-1.5 rounded-xl border text-[11px] cursor-pointer transition select-none"])}"><input type="checkbox"${ssrIncludeBooleanAttr(((_c = __props.options.outputs) == null ? void 0 : _c.feed) !== false) ? " checked" : ""} class="rounded text-sky-500 focus:ring-0 bg-slate-900 border-slate-700 w-3 h-3"><span class="font-bold">Feed 4:5</span></label><label class="${ssrRenderClass([((_d = __props.options.outputs) == null ? void 0 : _d.story) !== false ? "bg-indigo-500/10 border-indigo-500/40 text-indigo-200" : "bg-slate-950/50 border-slate-800 text-slate-500", "flex items-center gap-1.5 p-1.5 rounded-xl border text-[11px] cursor-pointer transition select-none"])}"><input type="checkbox"${ssrIncludeBooleanAttr(((_e = __props.options.outputs) == null ? void 0 : _e.story) !== false) ? " checked" : ""} class="rounded text-indigo-500 focus:ring-0 bg-slate-900 border-slate-700 w-3 h-3"><span class="font-bold">Story 9:16</span></label><label class="${ssrRenderClass([((_f = __props.options.outputs) == null ? void 0 : _f.reels) !== false ? "bg-emerald-500/10 border-emerald-500/40 text-emerald-200" : "bg-slate-950/50 border-slate-800 text-slate-500", "flex items-center gap-1.5 p-1.5 rounded-xl border text-[11px] cursor-pointer transition select-none"])}"><input type="checkbox"${ssrIncludeBooleanAttr(((_g = __props.options.outputs) == null ? void 0 : _g.reels) !== false) ? " checked" : ""} class="rounded text-emerald-500 focus:ring-0 bg-slate-900 border-slate-700 w-3 h-3"><span class="font-bold">Reels MP4</span></label></div></div><button${ssrIncludeBooleanAttr(!__props.isValid || __props.isGenerating || !!unref(jsonFormatError)) ? " disabled" : ""} class="${ssrRenderClass([[
149
234
  !__props.isValid || __props.isGenerating || !!unref(jsonFormatError) ? "bg-slate-800 text-slate-500 cursor-not-allowed border border-slate-700" : "bg-gradient-to-r from-sky-500 via-blue-600 to-indigo-600 text-white hover:from-sky-400 hover:to-indigo-500 shadow-sky-500/25 active:scale-[0.99]"
150
235
  ], "w-full py-3 px-4 rounded-xl font-black text-xs tracking-wide shadow-xl transition flex items-center justify-center gap-2"])}">`);
151
236
  if (__props.isGenerating) {
@@ -169,24 +254,71 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
169
254
  props: {
170
255
  data: {},
171
256
  selectedVideo: {},
257
+ selectedMusic: {},
258
+ videoStartOffset: { default: 0 },
259
+ audioStartOffset: { default: 0 },
172
260
  generatedResult: {}
173
261
  },
174
- setup(__props) {
262
+ emits: ["update:videoStartOffset", "update:audioStartOffset"],
263
+ setup(__props, { emit: __emit }) {
175
264
  const props = __props;
176
265
  const activeVideoSrc = computed(() => {
177
- if (props.selectedVideo && props.selectedVideo !== "pexels") {
266
+ if (props.selectedVideo && props.selectedVideo !== "pexels" && props.selectedVideo !== "random") {
178
267
  return `/videos/${props.selectedVideo}`;
179
268
  }
180
269
  return "/videos/default_bg.mp4";
181
270
  });
271
+ const activeAudioSrc = computed(() => {
272
+ if (props.selectedMusic && props.selectedMusic !== "random") {
273
+ return `/musics/${props.selectedMusic}`;
274
+ }
275
+ return "/musics/synthwave_pulse.mp3";
276
+ });
182
277
  const activeTab = ref("feed");
183
278
  const showSafeZones = ref(false);
279
+ const showOffsetEditor = ref(false);
184
280
  const copied = ref(false);
185
281
  const isOpeningFolder = ref(false);
186
282
  const zoomScale = ref(1);
283
+ const videoElement = ref(null);
284
+ const audioElement = ref(null);
285
+ const isPlaying = ref(true);
286
+ const isMuted = ref(true);
287
+ const currentTime = ref(0);
288
+ const totalDuration = computed(() => props.data.reelsDuration || 30);
289
+ function seekToRelative(relSec) {
290
+ currentTime.value = relSec;
291
+ const vOffset = props.videoStartOffset || 0;
292
+ const aOffset = props.audioStartOffset || 0;
293
+ if (videoElement.value) {
294
+ videoElement.value.currentTime = vOffset + relSec;
295
+ }
296
+ if (audioElement.value) {
297
+ audioElement.value.currentTime = aOffset + relSec;
298
+ }
299
+ }
300
+ function formatTime(sec) {
301
+ const m = Math.floor(sec / 60);
302
+ const s = Math.floor(sec % 60);
303
+ return `${m.toString().padStart(2, "0")}:${s.toString().padStart(2, "0")}`;
304
+ }
305
+ watch(
306
+ () => activeVideoSrc.value,
307
+ () => {
308
+ nextTick(() => {
309
+ seekToRelative(0);
310
+ });
311
+ }
312
+ );
187
313
  return (_ctx, _push, _parent, _attrs) => {
188
314
  const _component_TableCard = _sfc_main$3;
189
- _push(`<div${ssrRenderAttrs(mergeProps({ class: "flex flex-col gap-3 h-full text-slate-100 min-h-0 justify-between" }, _attrs))}><div 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"><div class="flex items-center gap-1 bg-slate-950 p-1 rounded-xl border border-slate-800 text-xs font-bold"><button class="${ssrRenderClass([unref(activeTab) === "feed" ? "bg-sky-500 text-white shadow-md" : "text-slate-400 hover:text-white", "px-3 py-1.5 rounded-lg transition"])}"> Feed 4:5 </button><button class="${ssrRenderClass([unref(activeTab) === "story" ? "bg-indigo-500 text-white shadow-md" : "text-slate-400 hover:text-white", "px-3 py-1.5 rounded-lg transition"])}"> Story 9:16 </button><button class="${ssrRenderClass([unref(activeTab) === "reels" ? "bg-emerald-500 text-white shadow-md" : "text-slate-400 hover:text-white", "px-3 py-1.5 rounded-lg transition"])}"> Reels 9:16 (Video) </button></div><div class="flex items-center gap-2 text-xs"><div class="flex items-center gap-1 bg-slate-950 p-1 rounded-xl border border-slate-800 text-xs shadow-inner"><button title="Zoom Out (-15%)" class="p-1.5 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800 transition">`);
315
+ _push(`<div${ssrRenderAttrs(mergeProps({ class: "flex flex-col gap-2.5 h-full text-slate-100 min-h-0 justify-between" }, _attrs))}><div 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"><div class="flex items-center gap-1 bg-slate-950 p-1 rounded-xl border border-slate-800 text-xs font-bold"><button class="${ssrRenderClass([unref(activeTab) === "feed" ? "bg-sky-500 text-white shadow-md" : "text-slate-400 hover:text-white", "px-3 py-1.5 rounded-lg transition"])}"> Feed 4:5 </button><button class="${ssrRenderClass([unref(activeTab) === "story" ? "bg-indigo-500 text-white shadow-md" : "text-slate-400 hover:text-white", "px-3 py-1.5 rounded-lg transition"])}"> Story 9:16 </button><button class="${ssrRenderClass([unref(activeTab) === "reels" ? "bg-emerald-500 text-white shadow-md" : "text-slate-400 hover:text-white", "px-3 py-1.5 rounded-lg transition flex items-center gap-1.5"])}"><span>Reels 9:16 (Video)</span>`);
316
+ if (unref(activeTab) === "reels" && unref(isPlaying)) {
317
+ _push(`<span class="w-1.5 h-1.5 rounded-full bg-white animate-pulse"></span>`);
318
+ } else {
319
+ _push(`<!---->`);
320
+ }
321
+ _push(`</button></div><div class="flex items-center gap-2 text-xs"><div class="flex items-center gap-1 bg-slate-950 p-1 rounded-xl border border-slate-800 text-xs shadow-inner"><button title="Zoom Out (-15%)" class="p-1.5 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800 transition">`);
190
322
  _push(ssrRenderComponent(unref(ZoomOut), { class: "w-3.5 h-3.5" }, null, _parent));
191
323
  _push(`</button><button 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">${ssrInterpolate(Math.round(unref(zoomScale) * 100))}% </button><button title="Zoom In (+15%)" class="p-1.5 rounded-lg text-slate-400 hover:text-white hover:bg-slate-800 transition">`);
192
324
  _push(ssrRenderComponent(unref(ZoomIn), { class: "w-3.5 h-3.5" }, null, _parent));
@@ -202,11 +334,11 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
202
334
  if (unref(activeTab) !== "feed") {
203
335
  _push(`<button class="${ssrRenderClass([unref(showSafeZones) ? "bg-amber-500/20 text-amber-300 border-amber-500/50" : "bg-slate-950 text-slate-400 border-slate-800", "inline-flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border text-xs font-bold transition"])}">`);
204
336
  _push(ssrRenderComponent(unref(ShieldAlert), { class: "w-3.5 h-3.5" }, null, _parent));
205
- _push(`<span>Safe Zones</span></button>`);
337
+ _push(`<span class="hidden sm:inline">Safe Zones</span></button>`);
206
338
  } else {
207
339
  _push(`<!---->`);
208
340
  }
209
- _push(`</div></div><div class="relative flex-1 min-h-0 bg-slate-950/80 border border-slate-800/80 rounded-2xl flex items-center justify-center p-4 overflow-auto shadow-inner custom-scrollbar"><div class="transition-transform duration-200 ease-out origin-center flex-shrink-0" style="${ssrRenderStyle({ transform: `scale(${unref(zoomScale)})` })}">`);
341
+ _push(`</div></div><div class="relative flex-1 min-h-0 bg-slate-950/80 border border-slate-800/80 rounded-2xl flex items-center justify-center p-3 overflow-auto shadow-inner custom-scrollbar"><div class="transition-transform duration-200 ease-out origin-center flex-shrink-0" style="${ssrRenderStyle({ transform: `scale(${unref(zoomScale)})` })}">`);
210
342
  if (unref(activeTab) === "feed") {
211
343
  _push(`<div class="relative shadow-2xl rounded-2xl overflow-hidden border border-slate-700/80 flex-shrink-0" style="width:360px;height:450px;"><div style="width:1080px;height:1350px;transform:scale(0.333333);transform-origin:top left;">`);
212
344
  _push(ssrRenderComponent(_component_TableCard, {
@@ -218,11 +350,11 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
218
350
  } else {
219
351
  _push(`<div class="relative shadow-2xl rounded-2xl overflow-hidden border border-slate-700/80 flex-shrink-0" style="width:300px;height:533.33px;">`);
220
352
  if (unref(activeTab) === "reels") {
221
- _push(`<div class="absolute inset-0 z-0 bg-slate-950 overflow-hidden"><video autoplay loop muted playsinline class="w-full h-full object-cover brightness-90 contrast-105"${ssrRenderAttr("src", unref(activeVideoSrc))}></video><div class="absolute inset-0 bg-slate-950/30 backdrop-blur-[0.5px]"></div></div>`);
353
+ _push(`<div class="absolute inset-0 z-0 bg-slate-950 overflow-hidden"><video autoplay loop muted playsinline class="w-full h-full object-cover brightness-90 contrast-105"${ssrRenderAttr("src", unref(activeVideoSrc))}></video><div class="absolute inset-0 bg-slate-950/30 backdrop-blur-[0.5px]"></div><audio${ssrRenderAttr("src", unref(activeAudioSrc))}${ssrIncludeBooleanAttr(unref(isMuted)) ? " muted" : ""} loop></audio></div>`);
222
354
  } else {
223
355
  _push(`<!---->`);
224
356
  }
225
- _push(`<div class="relative z-10" style="width:1080px;height:1920px;transform:scale(0.277778);transform-origin:top left;">`);
357
+ _push(`<div class="relative z-10 pointer-events-none" style="width:1080px;height:1920px;transform:scale(0.277778);transform-origin:top left;">`);
226
358
  _push(ssrRenderComponent(_component_TableCard, {
227
359
  data: __props.data,
228
360
  mode: unref(activeTab) === "reels" ? "overlay" : "story",
@@ -242,13 +374,43 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
242
374
  }
243
375
  _push(`</div>`);
244
376
  }
245
- _push(`</div></div><div class="flex flex-col bg-slate-900/90 border border-slate-800 rounded-2xl p-3 gap-1.5 shadow-lg flex-shrink-0"><div class="flex items-center justify-between text-xs"><span class="font-extrabold text-slate-300 text-[11px]">VIRAL CAPTION &amp; HASHTAGS</span><button 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">`);
377
+ _push(`</div></div>`);
378
+ if (unref(activeTab) === "reels") {
379
+ _push(`<div 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"><div class="flex items-center justify-between gap-3"><button 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"${ssrRenderAttr("title", unref(isPlaying) ? "Pause Preview" : "Putar Preview")}>`);
380
+ if (unref(isPlaying)) {
381
+ _push(ssrRenderComponent(unref(Pause), { class: "w-3.5 h-3.5 fill-current" }, null, _parent));
382
+ } else {
383
+ _push(ssrRenderComponent(unref(Play), { class: "w-3.5 h-3.5 fill-current" }, null, _parent));
384
+ }
385
+ _push(`<span class="text-[11px] hidden sm:inline">${ssrInterpolate(unref(isPlaying) ? "Pause" : "Play")}</span></button><div class="flex-1 flex items-center gap-2"><input type="range" min="0"${ssrRenderAttr("max", unref(totalDuration))} step="0.1"${ssrRenderAttr("value", unref(currentTime))} class="flex-1 h-1.5 bg-slate-950 rounded-lg appearance-none cursor-pointer accent-emerald-500 hover:accent-emerald-400"><span class="font-mono text-[11px] font-bold text-slate-300 min-w-[75px] text-right">${ssrInterpolate(formatTime(unref(currentTime)))} / ${ssrInterpolate(formatTime(unref(totalDuration)))}</span></div><button class="${ssrRenderClass([!unref(isMuted) ? "bg-purple-600/30 text-purple-300 border-purple-500/50" : "bg-slate-950 text-slate-400 border-slate-800 hover:text-white", "p-2 rounded-xl border transition flex items-center gap-1"])}"${ssrRenderAttr("title", unref(isMuted) ? "Aktifkan Suara Musik" : "Mute Musik")}>`);
386
+ if (!unref(isMuted)) {
387
+ _push(ssrRenderComponent(unref(Volume2), { class: "w-3.5 h-3.5 text-purple-400" }, null, _parent));
388
+ } else {
389
+ _push(ssrRenderComponent(unref(VolumeX), { class: "w-3.5 h-3.5" }, null, _parent));
390
+ }
391
+ _push(`<span class="text-[10px] font-bold hidden sm:inline">${ssrInterpolate(!unref(isMuted) ? "Audio ON" : "Muted")}</span></button><button class="${ssrRenderClass([unref(showOffsetEditor) ? "bg-sky-500/20 text-sky-300 border-sky-500/50" : "bg-slate-950 text-slate-400 border-slate-800 hover:text-white", "px-2.5 py-2 rounded-xl border text-[11px] font-bold flex items-center gap-1.5 transition"])}" title="Atur Detik Awal Video &amp; Musik">`);
392
+ _push(ssrRenderComponent(unref(Scissors), { class: "w-3.5 h-3.5 text-sky-400" }, null, _parent));
393
+ _push(`<span class="hidden sm:inline">Trim Offset</span></button></div>`);
394
+ if (unref(showOffsetEditor)) {
395
+ _push(`<div 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"><div class="flex flex-col gap-1.5"><div class="flex items-center justify-between text-[11px]"><span class="font-bold text-sky-300 flex items-center gap-1">`);
396
+ _push(ssrRenderComponent(unref(Film), { class: "w-3 h-3" }, null, _parent));
397
+ _push(` Start Video: ${ssrInterpolate(__props.videoStartOffset || 0)}s </span><button 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 </button></div><input type="range" min="0" max="60" step="1"${ssrRenderAttr("value", __props.videoStartOffset || 0)} class="w-full h-1 bg-slate-900 rounded appearance-none cursor-pointer accent-sky-400"></div><div class="flex flex-col gap-1.5"><div class="flex items-center justify-between text-[11px]"><span class="font-bold text-purple-300 flex items-center gap-1">`);
398
+ _push(ssrRenderComponent(unref(Music), { class: "w-3 h-3" }, null, _parent));
399
+ _push(` Start Musik: ${ssrInterpolate(__props.audioStartOffset || 0)}s </span><span class="text-[10px] text-slate-500 font-mono"> (Skip intro ke beat) </span></div><input type="range" min="0" max="120" step="1"${ssrRenderAttr("value", __props.audioStartOffset || 0)} class="w-full h-1 bg-slate-900 rounded appearance-none cursor-pointer accent-purple-400"></div></div>`);
400
+ } else {
401
+ _push(`<!---->`);
402
+ }
403
+ _push(`</div>`);
404
+ } else {
405
+ _push(`<!---->`);
406
+ }
407
+ _push(`<div 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"><div class="flex items-center justify-between text-xs"><span class="font-extrabold text-slate-300 text-[11px]">VIRAL CAPTION &amp; HASHTAGS</span><button 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">`);
246
408
  if (unref(copied)) {
247
409
  _push(ssrRenderComponent(unref(Check), { class: "w-3.5 h-3.5 text-emerald-400" }, null, _parent));
248
410
  } else {
249
411
  _push(ssrRenderComponent(unref(Copy), { class: "w-3.5 h-3.5" }, null, _parent));
250
412
  }
251
- _push(`<span>${ssrInterpolate(unref(copied) ? "Tersalin!" : "Copy Caption")}</span></button></div><textarea rows="2" class="w-full bg-slate-950 text-slate-200 text-xs p-2.5 rounded-xl border border-slate-800 focus:outline-none focus:border-sky-500/50 resize-none leading-relaxed font-sans" placeholder="Caption will appear here...">${ssrInterpolate(__props.data.caption)}</textarea></div>`);
413
+ _push(`<span>${ssrInterpolate(unref(copied) ? "Tersalin!" : "Copy Caption")}</span></button></div><textarea 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...">${ssrInterpolate(__props.data.caption)}</textarea></div>`);
252
414
  if (__props.generatedResult) {
253
415
  _push(`<div class="flex flex-wrap items-center justify-between gap-2 p-3 bg-emerald-950/40 border border-emerald-500/40 rounded-2xl shadow-xl flex-shrink-0"><div><div class="flex items-center gap-2 text-xs font-black text-emerald-300">`);
254
416
  _push(ssrRenderComponent(unref(Check), { class: "w-4 h-4 text-emerald-400" }, null, _parent));
@@ -278,7 +440,18 @@ const ComparisonRowSchema = z.object({
278
440
  const ContentDataSchema = z.object({
279
441
  id: z.string().min(1),
280
442
  category: z.string().optional().default("TECH"),
281
- theme: z.enum(["blue-tech", "emerald-finance", "slate-education", "dark-contrast", "crimson-alert"]).default("blue-tech"),
443
+ theme: z.enum([
444
+ "blue-tech",
445
+ "emerald-finance",
446
+ "slate-education",
447
+ "dark-contrast",
448
+ "crimson-alert",
449
+ "amber-gold",
450
+ "cyber-violet",
451
+ "sunset-orange",
452
+ "nordic-frost",
453
+ "monochrome-luxe"
454
+ ]).default("blue-tech"),
282
455
  layoutType: z.enum([
283
456
  "table",
284
457
  "news",
@@ -421,7 +594,7 @@ const ContentDataSchema = z.object({
421
594
  footerNote: z.string().optional().default("Industry Benchmark 2026"),
422
595
  watermark: z.string().optional().default("@SocialGen"),
423
596
  bgKeyword: z.string().optional().default("modern office coding night"),
424
- reelsDuration: z.number().min(5).max(90).default(10),
597
+ reelsDuration: z.number().min(5).max(90).default(30),
425
598
  caption: z.string().optional().default("Bagikan pendapat Anda di kolom komentar! #infografis #edukasi")
426
599
  });
427
600
  const _sfc_main = /* @__PURE__ */ defineComponent({
@@ -471,13 +644,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
471
644
  footerNote: "Source: Verified Industry Compensation Survey 2026",
472
645
  watermark: "@SocialGen",
473
646
  bgKeyword: "modern office coding night technology",
474
- reelsDuration: 10,
647
+ reelsDuration: 30,
475
648
  caption: "Higher gross salary in the US or guaranteed 30 days off in Germany? Which lifestyle would you choose? Drop your vote below! \u{1F447} #techcareers #salary #softwareengineer #worklife"
476
649
  });
477
650
  const options = ref({
478
651
  theme: "blue-tech",
479
652
  backgroundSource: "pexels",
480
653
  musicFile: "random",
654
+ videoStartOffset: 0,
655
+ audioStartOffset: 0,
481
656
  outputs: {
482
657
  feed: true,
483
658
  story: true,
@@ -494,21 +669,22 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
494
669
  $fetch("/api/drafts", {
495
670
  method: "POST",
496
671
  body: { drafts: drafts.value }
497
- }).catch((err) => {
498
- console.warn("Failed to sync drafts to server:", err);
672
+ }).catch(() => {
499
673
  });
500
674
  }
501
675
  function handleSaveCurrentDraft() {
502
676
  drafts.value.unshift(JSON.parse(JSON.stringify(contentData.value)));
503
677
  activeDraftIndex.value = 0;
678
+ activeHistoryIndex.value = -1;
504
679
  saveDraftsToStorage();
505
- showToast("Draft berhasil disimpan permanen!");
680
+ showToast("Draft berhasil disimpan!");
506
681
  }
507
682
  function handleSelectDraft(index) {
508
683
  if (drafts.value[index]) {
509
684
  contentData.value = JSON.parse(JSON.stringify(drafts.value[index]));
510
685
  options.value.theme = contentData.value.theme;
511
686
  activeDraftIndex.value = index;
687
+ activeHistoryIndex.value = -1;
512
688
  showToast(`Memuat draft #${index + 1}`);
513
689
  }
514
690
  }
@@ -518,7 +694,68 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
518
694
  activeDraftIndex.value = -1;
519
695
  }
520
696
  saveDraftsToStorage();
697
+ showToast("Draft dihapus");
698
+ }
699
+ const generationHistory = ref([]);
700
+ const activeHistoryIndex = ref(-1);
701
+ function saveHistoryToStorage() {
702
+ try {
703
+ localStorage.setItem("sg_gen_history", JSON.stringify(generationHistory.value));
704
+ } catch {
705
+ }
706
+ $fetch("/api/generation-history", {
707
+ method: "POST",
708
+ body: { history: generationHistory.value }
709
+ }).catch(() => {
710
+ });
711
+ }
712
+ function handleSelectHistory(index) {
713
+ const item = generationHistory.value[index];
714
+ if (item) {
715
+ contentData.value = JSON.parse(JSON.stringify(item.contentData || item));
716
+ if (item.options) {
717
+ options.value = { ...options.value, ...item.options };
718
+ }
719
+ activeHistoryIndex.value = index;
720
+ activeDraftIndex.value = -1;
721
+ showToast(`Memuat riwayat: "${item.title.slice(0, 24)}..."`);
722
+ }
723
+ }
724
+ function handleDeleteHistory(index) {
725
+ generationHistory.value.splice(index, 1);
726
+ if (activeHistoryIndex.value === index) {
727
+ activeHistoryIndex.value = -1;
728
+ }
729
+ saveHistoryToStorage();
730
+ showToast("Item riwayat dihapus");
731
+ }
732
+ function handleClearAllHistory() {
733
+ generationHistory.value = [];
734
+ activeHistoryIndex.value = -1;
735
+ saveHistoryToStorage();
736
+ showToast("Seluruh riwayat generate berhasil dibersihkan!");
737
+ }
738
+ let saveSessionTimeout = null;
739
+ function persistActiveSession() {
740
+ try {
741
+ localStorage.setItem("sg_active_content", JSON.stringify(contentData.value));
742
+ localStorage.setItem("sg_active_options", JSON.stringify(options.value));
743
+ } catch {
744
+ }
745
+ clearTimeout(saveSessionTimeout);
746
+ saveSessionTimeout = setTimeout(() => {
747
+ $fetch("/api/last-session", {
748
+ method: "POST",
749
+ body: {
750
+ content: contentData.value,
751
+ options: options.value
752
+ }
753
+ }).catch(() => {
754
+ });
755
+ }, 1e3);
521
756
  }
757
+ watch(() => contentData.value, persistActiveSession, { deep: true });
758
+ watch(() => options.value, persistActiveSession, { deep: true });
522
759
  const isGenerating = ref(false);
523
760
  const isAutoTopicLoading = ref(false);
524
761
  const generateStage = ref("");
@@ -583,6 +820,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
583
820
  isGenerating.value = true;
584
821
  generateStage.value = "Rendering Images & Reels...";
585
822
  generatedResult.value = null;
823
+ const historyItem = {
824
+ id: contentData.value.id || String(Date.now()),
825
+ title: contentData.value.title || "Untitled Creation",
826
+ layoutType: contentData.value.layoutType || "table",
827
+ category: contentData.value.category || "GENERAL",
828
+ theme: contentData.value.theme || "blue-tech",
829
+ generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
830
+ contentData: JSON.parse(JSON.stringify(contentData.value)),
831
+ options: JSON.parse(JSON.stringify(options.value))
832
+ };
833
+ generationHistory.value.unshift(historyItem);
834
+ activeHistoryIndex.value = 0;
835
+ saveHistoryToStorage();
586
836
  mobileTab.value = "preview";
587
837
  try {
588
838
  const res = await $fetch("/api/generate", {
@@ -638,16 +888,26 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
638
888
  "is-auto-topic-loading": unref(isAutoTopicLoading),
639
889
  drafts: unref(drafts),
640
890
  "active-draft-index": unref(activeDraftIndex),
891
+ history: unref(generationHistory),
892
+ "active-history-index": unref(activeHistoryIndex),
641
893
  onGenerate: handleGenerate,
642
894
  onAutoTopic: handleAutoTopic,
643
895
  onSelectDraft: handleSelectDraft,
644
896
  onDeleteDraft: handleDeleteDraft,
645
- onSaveDraft: handleSaveCurrentDraft
897
+ onSaveDraft: handleSaveCurrentDraft,
898
+ onSelectHistory: handleSelectHistory,
899
+ onDeleteHistory: handleDeleteHistory,
900
+ onClearAllHistory: handleClearAllHistory
646
901
  }, null, _parent));
647
902
  _push(`</section><section class="${ssrRenderClass([unref(mobileTab) === "preview" ? "flex" : "hidden lg:flex", "lg:col-span-7 h-full flex-col gap-3 overflow-hidden justify-between min-h-0"])}">`);
648
903
  _push(ssrRenderComponent(_component_LivePreview, {
649
904
  data: unref(contentData),
650
905
  "selected-video": unref(options).backgroundSource,
906
+ "selected-music": unref(options).musicFile,
907
+ "video-start-offset": unref(options).videoStartOffset,
908
+ "onUpdate:videoStartOffset": ($event) => unref(options).videoStartOffset = $event,
909
+ "audio-start-offset": unref(options).audioStartOffset,
910
+ "onUpdate:audioStartOffset": ($event) => unref(options).audioStartOffset = $event,
651
911
  "generated-result": unref(generatedResult)
652
912
  }, null, _parent));
653
913
  _push(`</section></main>`);
@@ -668,4 +928,4 @@ _sfc_main.setup = (props, ctx) => {
668
928
  };
669
929
 
670
930
  export { _sfc_main as default };
671
- //# sourceMappingURL=pages-2auDORIM.mjs.map
931
+ //# sourceMappingURL=pages-9EP79wh-.mjs.map