@chaibuilder/sdk 4.0.0-beta.49 → 4.0.0-beta.51

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 (156) hide show
  1. package/README.md +35 -52
  2. package/dist/{2SSKDMRQ-CjvuNdPo.cjs → 2SSKDMRQ-BSYe_xPq.cjs} +1 -1
  3. package/dist/{2SSKDMRQ-Dvf9zadl.js → 2SSKDMRQ-Dv-C_YAA.js} +3 -3
  4. package/dist/{AP7HFJJL-DYFttFoI.cjs → AP7HFJJL-BJolKJBt.cjs} +1 -1
  5. package/dist/{AP7HFJJL-q4dJdyFs.js → AP7HFJJL-DhdVstVC.js} +1 -1
  6. package/dist/{IconPicker-Bf163F7t.js → IconPicker-BBkl0T8b.js} +13 -13
  7. package/dist/{IconPicker-JWhYq2Gp.cjs → IconPicker-C0WWlb8t.cjs} +1 -1
  8. package/dist/{WDYDFRGG-O9GIrtX0.js → WDYDFRGG-CJs2MxSq.js} +4 -4
  9. package/dist/{WDYDFRGG-BEksfGMC.cjs → WDYDFRGG-DRt6Zg7Q.cjs} +1 -1
  10. package/dist/{actions-registery-BHbZHkE3.cjs → actions-registery-CLL3KrNv.cjs} +2 -2
  11. package/dist/{actions-registery-gJb_wq2F.js → actions-registery-CrGIlqUX.js} +88 -88
  12. package/dist/actions.cjs +1 -1
  13. package/dist/actions.js +2 -2
  14. package/dist/{add-new-language-page-BfUp5Ua2.cjs → add-new-language-page-ByMSfRcN.cjs} +1 -1
  15. package/dist/{add-new-language-page-CRR93tLq.js → add-new-language-page-DtVoDNfI.js} +35 -35
  16. package/dist/{add-new-page-B8NGK6WS.cjs → add-new-page-CnuChfJz.cjs} +1 -1
  17. package/dist/add-new-page-DanzzvYo.js +31 -0
  18. package/dist/{ai-panel-default-lang-BXYQye3N.js → ai-panel-default-lang-BaPz2d_6.js} +35 -35
  19. package/dist/{ai-panel-default-lang-VhgmHFoQ.cjs → ai-panel-default-lang-CoIQSz_Y.cjs} +2 -2
  20. package/dist/{ai-panel-other-lang-DaCf-cq4.js → ai-panel-other-lang--i-5z4e2.js} +22 -22
  21. package/dist/{ai-panel-other-lang-Ds0EXeUC.cjs → ai-panel-other-lang-ChlMVodg.cjs} +1 -1
  22. package/dist/{ai-prompt-input-7iWk72w5.js → ai-prompt-input-BQi0VDJC.js} +77 -77
  23. package/dist/{ai-prompt-input-nZ5_Dm7X.cjs → ai-prompt-input-BT5426AB.cjs} +1 -1
  24. package/dist/{ai-translation-prompt-1OUs1P7n.js → ai-translation-prompt-BN78s33t.js} +8 -8
  25. package/dist/{ai-translation-prompt-B16cK-1Q.cjs → ai-translation-prompt-BQPaekp3.cjs} +1 -1
  26. package/dist/{apply-binding-CBSjMYSk.cjs → apply-binding-Cjh1kqMO.cjs} +1 -1
  27. package/dist/{apply-binding-vAuN-TGV.js → apply-binding-v_W4uR3U.js} +28 -28
  28. package/dist/{plugin-BSjgGgwo.js → chai-theme-helpers-BEf2rwE4.js} +83 -83
  29. package/dist/chai-theme-helpers-q3nwoNht.cjs +22 -0
  30. package/dist/{change-password-modal-D5eXjiYq.cjs → change-password-modal-DHUrrKw7.cjs} +1 -1
  31. package/dist/{change-password-modal-CdvJR1Ln.js → change-password-modal-pEp-nMNb.js} +30 -30
  32. package/dist/{code-display-DdWcOQ_i.js → code-display-BaLKScgW.js} +5 -5
  33. package/dist/{code-display-BR-gij5j.cjs → code-display-i7jb2kmw.cjs} +1 -1
  34. package/dist/{code-editor-CyLjDiEp.js → code-editor-CRoniyP0.js} +12 -12
  35. package/dist/{code-editor-SWbfFj1E.cjs → code-editor-gwFRjQ2_.cjs} +1 -1
  36. package/dist/core.cjs +1 -1
  37. package/dist/core.d.ts +0 -5
  38. package/dist/core.js +49 -49
  39. package/dist/{css-import-modal-Be47CBJn.js → css-import-modal-B3qxX9Iv.js} +14 -14
  40. package/dist/{css-import-modal-Bdwgd05S.cjs → css-import-modal-nAB5FSwn.cjs} +2 -2
  41. package/dist/{delete-page-C99K2qzS.js → delete-page-DbawNFf7.js} +13 -13
  42. package/dist/{delete-page-DLohaU-U.cjs → delete-page-YP1HEAoD.cjs} +1 -1
  43. package/dist/{digital-asset-manager-BZMb6sC7.js → digital-asset-manager-DTD5mf24.js} +388 -357
  44. package/dist/digital-asset-manager-kJnuMqpw.cjs +1 -0
  45. package/dist/{duplicate-page-D5Gtvqdv.cjs → duplicate-page-CxqW_EO7.cjs} +1 -1
  46. package/dist/{duplicate-page-CDc2X0eW.js → duplicate-page-DnRb1y6K.js} +19 -19
  47. package/dist/{dynamic-page-selector-DZHhX008.cjs → dynamic-page-selector-2EqJhUrB.cjs} +1 -1
  48. package/dist/{dynamic-page-selector-DvNBXo6o.js → dynamic-page-selector-D6VLDIN9.js} +17 -17
  49. package/dist/{get-chai-builder-tailwind-config-7CxFxEYL.cjs → get-chai-builder-tailwind-config-DNp8Vhme.cjs} +1 -1
  50. package/dist/{get-chai-builder-tailwind-config-DC4sDOYK.js → get-chai-builder-tailwind-config-k8l5sdcw.js} +3 -3
  51. package/dist/{get-chai-builder-theme-BpuwSLeS.js → get-chai-builder-theme-DLpviqPJ.js} +1 -1
  52. package/dist/get-chai-builder-theme-Du4ARJlw.cjs +1 -0
  53. package/dist/{image-editor-DwhTYkVR.cjs → image-editor-BQcOGsli.cjs} +1 -1
  54. package/dist/{image-editor-BBvvi9Vm.js → image-editor-CMf731xL.js} +15 -15
  55. package/dist/index-BYrRPW_c.cjs +5 -0
  56. package/dist/index-D-r_K4yA.cjs +160 -0
  57. package/dist/{index-OuHV9Ann.js → index-DPV6NiJ-.js} +5894 -6049
  58. package/dist/index-DqzFD1CG.js +4861 -0
  59. package/dist/{mark-as-template-CP_F9ZQ4.js → mark-as-template-D7jqSCXw.js} +28 -28
  60. package/dist/{mark-as-template-B9yLcasI.cjs → mark-as-template-DyB56HzI.cjs} +1 -1
  61. package/dist/{nested-path-selector-content-DmtCI3q9.js → nested-path-selector-content-dwSikrsV.js} +2 -2
  62. package/dist/{nested-path-selector-content-aTdu-o0e.cjs → nested-path-selector-content-g9_Tq_sR.cjs} +1 -1
  63. package/dist/no-language-page-content-BRITuyfN.js +43 -0
  64. package/dist/{no-language-page-content-C-MCdPXt.cjs → no-language-page-content-ZvMNVY-Y.cjs} +1 -1
  65. package/dist/{no-language-page-dialog-D4QIAHnE.cjs → no-language-page-dialog-Cndq8xRP.cjs} +1 -1
  66. package/dist/no-language-page-dialog-D7L9nVb9.js +10 -0
  67. package/dist/page-creator-BAIbU14q.js +652 -0
  68. package/dist/page-creator-qL3-M8g3.cjs +1 -0
  69. package/dist/{page-manager-new-ah6QYar2.cjs → page-manager-new-By3eGO3i.cjs} +1 -1
  70. package/dist/{page-manager-new-ttsrxdW9.js → page-manager-new-YRG89y4f.js} +63 -63
  71. package/dist/page-manager-search-and-filter-BbdgOU9V.cjs +1 -0
  72. package/dist/page-manager-search-and-filter-Cllju4CV.js +184 -0
  73. package/dist/pages.cjs +1 -1
  74. package/dist/pages.d.ts +0 -15
  75. package/dist/pages.js +20 -21
  76. package/dist/{publish-pages-content-KZVMHT6V.js → publish-pages-content-CG5LBUnY.js} +48 -48
  77. package/dist/{publish-pages-content-BrajJUcP.cjs → publish-pages-content-DxMiBxNU.cjs} +1 -1
  78. package/dist/{register-chai-top-bar-DyW9GPzV.cjs → register-chai-top-bar-CCssW5dL.cjs} +1 -1
  79. package/dist/{register-chai-top-bar-D6GjnauV.js → register-chai-top-bar-DWmJ2efT.js} +11 -11
  80. package/dist/render.cjs +1 -1
  81. package/dist/render.js +54 -54
  82. package/dist/{rte-widget-modal-CiTwsXTr.cjs → rte-widget-modal-CsTqFJc_.cjs} +1 -1
  83. package/dist/{rte-widget-modal-IU8JzPuZ.js → rte-widget-modal-DoeTMRtX.js} +2 -2
  84. package/dist/runtime-client.cjs +1 -1
  85. package/dist/runtime-client.js +1 -1
  86. package/dist/runtime.cjs +1 -1
  87. package/dist/runtime.js +1 -1
  88. package/dist/sdk.css +1 -1
  89. package/dist/{selected-block-display-CidmQ-wz.js → selected-block-display-Ck1kkNEi.js} +17 -28
  90. package/dist/{selected-block-display-CAFEOrLV.cjs → selected-block-display-DSow6N4b.cjs} +1 -1
  91. package/dist/seo-panel---mYZmLD.js +559 -0
  92. package/dist/seo-panel-mfX63fua.cjs +1 -0
  93. package/dist/{shared-json-ld-uvMmwCYp.js → shared-json-ld-B3I_RLE2.js} +46 -46
  94. package/dist/{shared-json-ld-CMH-eRUq.cjs → shared-json-ld-CGgwUOlW.cjs} +1 -1
  95. package/dist/{slug-input-DLWTMTsO.js → slug-input-DQ4t3-Tt.js} +5 -5
  96. package/dist/{slug-input-CiHC5l3r.cjs → slug-input-DaNbl597.cjs} +1 -1
  97. package/dist/supabase-actions.cjs +1 -1
  98. package/dist/supabase-actions.js +2 -2
  99. package/dist/types.d.ts +0 -96
  100. package/dist/{unmark-as-template-F7TdgWjI.cjs → unmark-as-template-CZ65AE4v.cjs} +1 -1
  101. package/dist/{unmark-as-template-C5ovsEBP.js → unmark-as-template-DvmoTbVu.js} +11 -11
  102. package/dist/unpublish-page-3--vO5b0.js +28 -0
  103. package/dist/{unpublish-page-CUr8Xub6.cjs → unpublish-page-B46TiWlU.cjs} +1 -1
  104. package/dist/{unpublished-partials-modal-BhNAub_z.js → unpublished-partials-modal-DVMz3q83.js} +18 -15
  105. package/dist/{unpublished-partials-modal-Cv5R9-hi.cjs → unpublished-partials-modal-U5lKBOSR.cjs} +1 -1
  106. package/dist/utils.cjs +1 -1
  107. package/dist/utils.js +2 -2
  108. package/dist/web-blocks.cjs +1 -1
  109. package/dist/web-blocks.js +2 -2
  110. package/dist/{web-preview-D9pXonAv.js → web-preview-D5o5XQo0.js} +2 -2
  111. package/dist/{web-preview-CuMYekVJ.cjs → web-preview-Da3RhcjQ.cjs} +1 -1
  112. package/package.json +1 -1
  113. package/dist/active-in-another-tab-B4Ur0JP7.js +0 -35
  114. package/dist/active-in-another-tab-BPdx4lWh.cjs +0 -1
  115. package/dist/add-new-page-Ppy5-y5j.js +0 -31
  116. package/dist/continue-editing-in-this-client-BrSvK-Ay.js +0 -25
  117. package/dist/continue-editing-in-this-client-Cmi-GkYZ.cjs +0 -1
  118. package/dist/design-token-usage-D1lWCJ3L.js +0 -114
  119. package/dist/design-token-usage-eY2wQ0l3.cjs +0 -1
  120. package/dist/digital-asset-manager-Z5aJxkq0.cjs +0 -1
  121. package/dist/get-chai-builder-theme-B5RkBTsB.cjs +0 -1
  122. package/dist/image-compression-DPFITwOL.js +0 -37
  123. package/dist/image-compression-UaU7Bwqe.cjs +0 -1
  124. package/dist/index-BVwFJWDq.cjs +0 -5
  125. package/dist/index-DCJDQs1a.cjs +0 -160
  126. package/dist/index-LBTm1Jmk.js +0 -5199
  127. package/dist/json-diff-viewer-Cb1CmRqP.cjs +0 -8
  128. package/dist/json-diff-viewer-DG6qMOBS.js +0 -261
  129. package/dist/lang-panel-B3USOxGq.js +0 -216
  130. package/dist/lang-panel-DxoJ0v4y.cjs +0 -1
  131. package/dist/manage-design-tokens-6YGIctip.js +0 -446
  132. package/dist/manage-design-tokens-modal-BSSCXH8Y.cjs +0 -1
  133. package/dist/manage-design-tokens-modal-CzsnN49F.js +0 -161
  134. package/dist/manage-design-tokens-udLBvkHA.cjs +0 -1
  135. package/dist/no-language-page-content-D8t5dfgh.js +0 -43
  136. package/dist/no-language-page-dialog-C_fHI2zI.js +0 -10
  137. package/dist/page-creator-Cz_ah-qE.cjs +0 -1
  138. package/dist/page-creator-DKEkuGCO.js +0 -796
  139. package/dist/page-lock-CwZKJ4IE.js +0 -30
  140. package/dist/page-lock-DdCvtA-I.cjs +0 -1
  141. package/dist/page-locked-dialog-CrTDBoC4.cjs +0 -1
  142. package/dist/page-locked-dialog-DqLlooUz.js +0 -136
  143. package/dist/page-manager-search-and-filter-D7AupT6_.cjs +0 -1
  144. package/dist/page-manager-search-and-filter-bsqZ6wnI.js +0 -210
  145. package/dist/page-revisions-content-B6hsIla7.cjs +0 -1
  146. package/dist/page-revisions-content-C5O8_Fms.js +0 -459
  147. package/dist/plugin-DHpuZZXz.cjs +0 -22
  148. package/dist/save-to-lib-DMnv7ENo.js +0 -429
  149. package/dist/save-to-lib-Dc700Aop.cjs +0 -1
  150. package/dist/seo-panel-Br8gxDxu.js +0 -789
  151. package/dist/seo-panel-CMY-adM-.cjs +0 -2
  152. package/dist/take-over-request-IRLgF1dG.cjs +0 -1
  153. package/dist/take-over-request-KdR1_h_K.js +0 -64
  154. package/dist/translation-warning-modal-CLZ9tC1F.cjs +0 -1
  155. package/dist/translation-warning-modal-CzNt6LDO.js +0 -27
  156. package/dist/unpublish-page-0fR1o0b7.js +0 -28
@@ -1,789 +0,0 @@
1
- import { jsx as s, jsxs as o } from "react/jsx-runtime";
2
- import { j as ve, ar as xe, aq as Ne, A as we, L as ee, av as Se, aL as De, aM as Oe, g as be, ax as je, aN as Le, aO as Ie, aP as T, aQ as Ee, aF as se } from "./index-LBTm1Jmk.js";
3
- import { d as z, D as ke, e as Te, f as Ce, g as Fe, o as Ae, n as Je, ax as Pe, ay as Re, az as qe, aA as $, p as S, T as te } from "./index-OuHV9Ann.js";
4
- import { find as Be, get as g, isEqual as ne, isEmpty as Ue } from "lodash-es";
5
- import { useMemo as _e, useRef as ae, useState as F, useEffect as oe } from "react";
6
- import { B as J, D as Ve, F as Ge, z as A } from "./register-chai-top-bar-D6GjnauV.js";
7
- import { useTranslation as Me } from "react-i18next";
8
- import { toast as b } from "sonner";
9
- import { useMutation as He } from "@tanstack/react-query";
10
- import { Loader as $e, Wand2Icon as We } from "lucide-react";
11
- import { g as W } from "./get-seo-defaults-9zHebckY.js";
12
- const ze = () => {
13
- const { selectedLang: e } = z(), { data: l, isFetching: r } = ve();
14
- return { data: _e(() => Be(l, { lang: e || "" }) || {}, [l, e]), isFetching: r };
15
- }, Ke = () => {
16
- var y;
17
- const l = (y = document.getElementById("canvas-iframe").contentDocument) == null ? void 0 : y.body.innerHTML;
18
- if (!l) return null;
19
- const a = new DOMParser().parseFromString(l, "text/html");
20
- a.querySelectorAll("style, script, link, svg, [data-block-type='PartialBlock']").forEach((m) => m.remove()), a.querySelectorAll("*").forEach((m) => {
21
- Array.from(m.attributes).forEach((p) => m.removeAttribute(p.name));
22
- });
23
- const n = a.querySelectorAll("h1, h2, h3, h4, h5, h6, p");
24
- return Array.from(n).map((m) => `<${m.tagName.toLowerCase()}>${m.innerHTML}</${m.tagName.toLowerCase()}>`).join(" ").replace(/<p>Partial block. Double click to edit.<\/p>/, "");
25
- }, B = ({
26
- keyword: e,
27
- onComplete: l,
28
- field: r
29
- }) => {
30
- const a = xe(), n = Ne(), { selectedLang: c, fallbackLang: y } = z(), { mutate: m, isPending: p } = He({
31
- mutationFn: async () => {
32
- const j = Ke();
33
- return await a(n, {
34
- action: we.GENERATE_SEO_FIELD,
35
- data: {
36
- pageContext: "",
37
- dynamic: !1,
38
- field: r,
39
- lang: c || y,
40
- pageContent: j,
41
- keyword: e
42
- }
43
- });
44
- },
45
- onSuccess: (j) => {
46
- l({ fieldValue: j.field });
47
- },
48
- onError: (j) => {
49
- l({ fieldValue: null, error: j.message });
50
- }
51
- });
52
- return /* @__PURE__ */ s(
53
- J,
54
- {
55
- disabled: p,
56
- type: "button",
57
- className: "h-5 w-5",
58
- variant: "ghost",
59
- size: "sm",
60
- onClick: () => m(),
61
- children: p ? /* @__PURE__ */ s($e, { className: "h-3 w-3 animate-spin text-yellow-500" }) : /* @__PURE__ */ s(We, { className: "text-yellow-500" })
62
- }
63
- );
64
- }, h = (e, l) => {
65
- if (!e)
66
- return { success: !1, error: "Empty response from AI" };
67
- try {
68
- let r = e;
69
- if (typeof r == "string" && (/^".*"$/.test(r) && (r = r.replace(/^"(.*)"$/, "$1"), r = r.replace(/\\\\/g, "___DOUBLE_BACKSLASH___").replace(/\\n/g, `
70
- `).replace(/\\"/g, '"').replace(/___DOUBLE_BACKSLASH___/g, "\\")), l === "jsonLD" || l === "metaOther")) {
71
- r.includes("```") && (r = r.replace(/^```json\s*/i, "").replace(/^```\s*/, "").replace(/\s*```$/m, "")), r = r.trim();
72
- try {
73
- JSON.parse(r);
74
- } catch {
75
- return {
76
- success: !1,
77
- error: "The AI response is not valid JSON. Please try again or edit manually."
78
- };
79
- }
80
- }
81
- return { success: !0, value: r };
82
- } catch (r) {
83
- return {
84
- success: !1,
85
- error: r instanceof Error ? r.message : "Unknown error occurred"
86
- };
87
- }
88
- };
89
- if (import.meta.vitest) {
90
- const { it: e, expect: l, describe: r } = import.meta.vitest;
91
- r("processAiSeoResponse", () => {
92
- r("Regular text fields (title, description, etc.)", () => {
93
- e("should handle plain text responses", () => {
94
- const a = h("SEO Title Here", "title");
95
- l(a).toEqual({ success: !0, value: "SEO Title Here" });
96
- }), e("should remove surrounding quotes from text fields", () => {
97
- const a = h('"SEO Title Here"', "title");
98
- l(a).toEqual({ success: !0, value: "SEO Title Here" });
99
- }), e("should handle empty string", () => {
100
- const a = h("", "title");
101
- l(a).toEqual({ success: !1, error: "Empty response from AI" });
102
- }), e("should handle null value", () => {
103
- const a = h(null, "title");
104
- l(a).toEqual({ success: !1, error: "Empty response from AI" });
105
- });
106
- }), r("JSON fields (jsonLD, metaOther)", () => {
107
- e("should handle valid JSON without code blocks", () => {
108
- const a = '{"@context": "https://schema.org", "@type": "WebPage"}', n = h(a, "jsonLD");
109
- l(n).toEqual({ success: !0, value: a });
110
- }), e("should remove ```json code blocks and validate JSON", () => {
111
- const a = '```json\n{"@context": "https://schema.org", "@type": "WebPage"}\n```', n = '{"@context": "https://schema.org", "@type": "WebPage"}', c = h(a, "jsonLD");
112
- l(c).toEqual({ success: !0, value: n });
113
- }), e("should remove ``` code blocks (without json keyword) and validate JSON", () => {
114
- const a = '```\n{"@context": "https://schema.org", "@type": "WebPage"}\n```', n = '{"@context": "https://schema.org", "@type": "WebPage"}', c = h(a, "jsonLD");
115
- l(c).toEqual({ success: !0, value: n });
116
- }), e("should handle ```JSON (uppercase) code blocks", () => {
117
- const a = '```JSON\n{"@context": "https://schema.org"}\n```', n = '{"@context": "https://schema.org"}', c = h(a, "jsonLD");
118
- l(c).toEqual({ success: !0, value: n });
119
- }), e("should handle code blocks with extra whitespace", () => {
120
- const a = '```json \n {"@context": "https://schema.org"} \n ```', n = '{"@context": "https://schema.org"}', c = h(a, "jsonLD");
121
- l(c).toEqual({ success: !0, value: n });
122
- }), e("should reject invalid JSON after removing code blocks", () => {
123
- const n = h("```json\n{invalid json here}\n```", "jsonLD");
124
- l(n).toEqual({
125
- success: !1,
126
- error: "The AI response is not valid JSON. Please try again or edit manually."
127
- });
128
- }), e("should reject invalid JSON without code blocks", () => {
129
- const n = h("{invalid json}", "jsonLD");
130
- l(n).toEqual({
131
- success: !1,
132
- error: "The AI response is not valid JSON. Please try again or edit manually."
133
- });
134
- }), e("should handle complex nested JSON with code blocks", () => {
135
- const n = h(`\`\`\`json
136
- {
137
- "@context": "https://schema.org",
138
- "@type": "Article",
139
- "author": {
140
- "@type": "Person",
141
- "name": "John Doe"
142
- },
143
- "datePublished": "2024-01-01"
144
- }
145
- \`\`\``, "jsonLD");
146
- if (l(n.success).toBe(!0), n.success) {
147
- const c = JSON.parse(n.value);
148
- l(c["@type"]).toBe("Article"), l(c.author.name).toBe("John Doe");
149
- }
150
- }), e("should handle metaOther field with JSON", () => {
151
- const a = '```json\n{"og:type": "website", "twitter:card": "summary"}\n```', n = '{"og:type": "website", "twitter:card": "summary"}', c = h(a, "metaOther");
152
- l(c).toEqual({ success: !0, value: n });
153
- }), e("should handle JSON arrays", () => {
154
- const a = '```json\n[{"@type": "BreadcrumbList"}]\n```', n = '[{"@type": "BreadcrumbList"}]', c = h(a, "jsonLD");
155
- l(c).toEqual({ success: !0, value: n });
156
- }), e("should handle empty JSON object", () => {
157
- const c = h("```json\n{}\n```", "jsonLD");
158
- l(c).toEqual({ success: !0, value: "{}" });
159
- }), e("should handle JSON with special characters and escaping", () => {
160
- const a = '```json\n{"description": "A \\"quoted\\" string with\\nnewlines"}\n```', n = '{"description": "A \\"quoted\\" string with\\nnewlines"}', c = h(a, "jsonLD");
161
- l(c).toEqual({ success: !0, value: n });
162
- });
163
- }), r("Edge cases", () => {
164
- e("should handle response with only code block markers", () => {
165
- const n = h("```json\n```", "jsonLD");
166
- l(n.success).toBe(!1);
167
- }), e("should handle malformed code blocks (missing closing)", () => {
168
- const n = h('```json\n{"@context": "https://schema.org"}', "jsonLD");
169
- if (l(n.success).toBe(!0), n.success) {
170
- const c = JSON.parse(n.value);
171
- l(c["@context"]).toBe("https://schema.org");
172
- }
173
- }), e("should handle response with double-quoted JSON", () => {
174
- const n = h('{"@type": "WebPage", "name": "Test"}', "jsonLD");
175
- if (l(n.success).toBe(!0), n.success) {
176
- const c = JSON.parse(n.value);
177
- l(c["@type"]).toBe("WebPage");
178
- }
179
- });
180
- });
181
- });
182
- }
183
- const Qe = ({
184
- isOpen: e,
185
- onClose: l,
186
- onSave: r,
187
- onDiscard: a,
188
- isSaving: n = !1,
189
- fromLanguage: c,
190
- toLanguage: y
191
- }) => {
192
- const m = ee[c] || c, p = ee[y] || y;
193
- return /* @__PURE__ */ s(ke, { open: e, onOpenChange: l, children: /* @__PURE__ */ o(Te, { className: "sm:max-w-[425px]", children: [
194
- /* @__PURE__ */ o(Ce, { children: [
195
- /* @__PURE__ */ s(Fe, { children: "Unsaved SEO Changes" }),
196
- /* @__PURE__ */ o(Ae, { children: [
197
- 'You have unsaved changes in the SEO for "',
198
- m,
199
- '" version. Do you want to save these changes before switching to "',
200
- p,
201
- '" version?'
202
- ] })
203
- ] }),
204
- /* @__PURE__ */ o("div", { className: "flex justify-end gap-3 pt-4", children: [
205
- /* @__PURE__ */ s(J, { variant: "outline", onClick: a, disabled: n, children: "Discard Changes" }),
206
- /* @__PURE__ */ s(J, { onClick: r, disabled: n, children: n ? "Saving..." : "Save & Switch" })
207
- ] })
208
- ] }) });
209
- }, Ye = (e) => {
210
- if (!e) return !0;
211
- try {
212
- return JSON.parse(e), !0;
213
- } catch {
214
- return !1;
215
- }
216
- }, Xe = (e, l) => {
217
- const r = e.selectionStart || 0, a = e.selectionEnd || 0, n = e.value, c = n.substring(0, r), y = n.substring(a), m = `{{${l}}}`, p = c + "" + m + y, j = r + 0 + // Account for space before if added
218
- m.length;
219
- return {
220
- value: p,
221
- newCursorPos: j
222
- };
223
- }, Ze = () => {
224
- const { t: e } = Me(), [, l] = Je(), { data: r } = Se(), { data: a } = De(), { data: n, isFetching: c } = ze(), y = n == null ? void 0 : n.seo, m = ae(null), [p, j] = F("seo"), P = r == null ? void 0 : r.id, le = r == null ? void 0 : r.pageType, I = Oe(le), { selectedLang: K, fallbackLang: re } = z(), f = K || re, [Q, U] = F(!1), [ce, Y] = F(!1), [ie, _] = F(!1), [D, V] = F(null), [i, O] = F({
225
- keyword: "",
226
- title: "",
227
- description: "",
228
- cononicalUrl: "",
229
- noIndex: !1,
230
- noFollow: "",
231
- ogTitle: "",
232
- ogDescription: "",
233
- ogImage: "",
234
- ogImageId: "",
235
- searchTitle: "",
236
- searchDescription: "",
237
- jsonLD: "{}",
238
- metaOther: "{}",
239
- ...y
240
- }), C = ae({}), { mutate: de, isPending: G } = be(), x = G || Q || ce, { hasPermission: ue } = Pe(), d = ue(je.EDIT_SEO), [he] = Le(), me = g(he, "flags.resetSeoToDefault", !1), X = !K || i.jsonLD !== "{}";
241
- oe(() => {
242
- if (!c && y && P) {
243
- const t = {
244
- keyword: "",
245
- title: "",
246
- description: "",
247
- cononicalUrl: "",
248
- noIndex: !1,
249
- noFollow: "",
250
- ogTitle: "",
251
- ogDescription: "",
252
- ogImage: "",
253
- ogImageId: "",
254
- searchTitle: "",
255
- searchDescription: "",
256
- jsonLD: "",
257
- metaOther: "",
258
- ...y
259
- };
260
- O(t), C.current[f] = t;
261
- }
262
- }, [c, y, f, P]), oe(() => {
263
- const t = (u) => {
264
- const { fromLang: v, toLang: q, switchHandler: w } = u.detail, M = C.current[f];
265
- (M ? !ne(M, i) : !1) ? (V({ fromLang: v, toLang: q, switchHandler: w }), _(!0)) : w();
266
- };
267
- return window.addEventListener("seo-language-switch-check", t), () => {
268
- window.removeEventListener("seo-language-switch-check", t);
269
- };
270
- }, [P, i, f]);
271
- const pe = async () => {
272
- if (!(!I || !f))
273
- try {
274
- U(!0);
275
- const t = W(I, f), u = {
276
- ...i,
277
- keyword: g(t, "seo.keyword", ""),
278
- title: g(t, "seo.title", ""),
279
- description: g(t, "seo.description", ""),
280
- cononicalUrl: g(t, "seo.canonicalUrl", ""),
281
- noIndex: g(t, "seo.noIndex", !1),
282
- noFollow: g(t, "seo.noFollow", !1),
283
- ogTitle: g(t, "seo.ogTitle", ""),
284
- ogDescription: g(t, "seo.ogDescription", "")
285
- // Keep jsonLD as is
286
- };
287
- O(u), b.success(e("SEO fields reset to defaults"));
288
- } catch (t) {
289
- b.error(e("Failed to reset SEO fields")), console.error("Reset SEO error:", t);
290
- } finally {
291
- U(!1);
292
- }
293
- }, ge = async () => {
294
- if (!(!I || !f))
295
- try {
296
- Y(!0);
297
- const t = W(I, f), u = {
298
- ...i,
299
- jsonLD: g(t, "seo.jsonLD", "")
300
- };
301
- O(u), b.success(e("JSON-LD reset to default"));
302
- } catch (t) {
303
- b.error(e("Failed to reset JSON-LD")), console.error("Reset JSON-LD error:", t);
304
- } finally {
305
- Y(!1);
306
- }
307
- }, fe = async () => {
308
- if (!(!I || !f))
309
- try {
310
- U(!0);
311
- const t = W(I, f), u = {
312
- ...i,
313
- ogTitle: g(t, "seo.ogTitle", ""),
314
- ogDescription: g(t, "seo.ogDescription", ""),
315
- ogImage: g(t, "seo.ogImage", ""),
316
- ogImageId: g(t, "seo.ogImageId", ""),
317
- metaOther: g(t, "seo.metaOther", "{}")
318
- };
319
- O(u), b.success(e("Meta Tag fields reset to defaults"));
320
- } catch (t) {
321
- b.error(e("Failed to reset Meta Tag fields")), console.error("Reset Meta Tag error:", t);
322
- } finally {
323
- U(!1);
324
- }
325
- }, Z = async () => {
326
- de(
327
- { id: n == null ? void 0 : n.id, seo: i, primaryPage: P },
328
- {
329
- onSuccess: () => {
330
- console.log("SEO & JSON-LD updated successfully", i), C.current[f] = i, b.success("SEO & JSON-LD updated successfully");
331
- }
332
- }
333
- );
334
- }, L = (t, u) => {
335
- const v = document.getElementById(u);
336
- if (v) {
337
- const { value: q, newCursorPos: w } = Xe(v, t);
338
- m.current = {
339
- id: u,
340
- position: w
341
- }, v.tagName.toLowerCase() === "input" ? (v.value = q, O((k) => ({
342
- ...k,
343
- [v.name]: q
344
- })), v.focus(), v.setSelectionRange(w, w), [0, 10, 50, 100, 200].forEach((k) => {
345
- setTimeout(() => {
346
- const H = document.getElementById(u);
347
- H && (H.focus(), H.setSelectionRange(w, w));
348
- }, k);
349
- })) : (O((E) => ({
350
- ...E,
351
- [v.name]: q
352
- })), requestAnimationFrame(() => {
353
- const E = document.getElementById(u);
354
- E && (E.focus(), E.setSelectionRange(w, w), setTimeout(() => {
355
- const k = document.getElementById(u);
356
- k && (k.focus(), k.setSelectionRange(w, w));
357
- }, 50));
358
- }));
359
- }
360
- }, N = (t) => {
361
- const u = {
362
- ...i,
363
- [t.target.name]: t.target.name === "noIndex" || t.target.name === "noFollow" ? t.target.checked : t.target.value
364
- };
365
- O(u);
366
- }, R = (t) => (u) => {
367
- if (!Ue(u.fieldValue)) {
368
- const v = h(
369
- u.fieldValue,
370
- t
371
- );
372
- v.success ? N({
373
- target: {
374
- name: t,
375
- value: v.value
376
- }
377
- }) : b.error(
378
- /* @__PURE__ */ o("div", { children: [
379
- /* @__PURE__ */ s("h2", { children: "Failed to process AI response:" }),
380
- /* @__PURE__ */ s("p", { children: v.error })
381
- ] })
382
- );
383
- }
384
- u.error && b.error(
385
- /* @__PURE__ */ o("div", { children: [
386
- /* @__PURE__ */ s("h2", { children: "Failed to generate:" }),
387
- /* @__PURE__ */ s("p", { children: u.error })
388
- ] })
389
- );
390
- }, ye = () => {
391
- const t = g(r, "seo.jsonLD", "{}");
392
- if ((t == null ? void 0 : t.trim()) === "{}") {
393
- b.error("Default page JSON-LD is empty");
394
- return;
395
- }
396
- N({ target: { name: "jsonLD", value: t } });
397
- };
398
- return /* @__PURE__ */ o("div", { className: "relative flex h-full flex-col", "data-panel-id": "seo", children: [
399
- !d && /* @__PURE__ */ s("div", { className: "absolute inset-0 z-10 flex items-center justify-center backdrop-blur-sm", children: /* @__PURE__ */ s(Ve, { variant: "default", className: "w-[80%] max-w-md text-xs", children: /* @__PURE__ */ s(Ge, { children: e("You don't have permission to edit SEO settings. Contact your administrator for access.") }) }) }),
400
- /* @__PURE__ */ o("div", { className: "no-scrollbar flex-grow overflow-y-auto px-2 pb-20", children: [
401
- /* @__PURE__ */ o("div", { className: "mb-4 flex w-full items-center justify-between rounded-md bg-gray-100 px-2 py-1 text-left text-sm", children: [
402
- /* @__PURE__ */ o("span", { children: [
403
- /* @__PURE__ */ s("div", { className: "font-medium", children: n == null ? void 0 : n.name }),
404
- /* @__PURE__ */ s("span", { className: "font-mono text-xs leading-tight text-gray-500", children: n == null ? void 0 : n.slug })
405
- ] }),
406
- /* @__PURE__ */ s(Ie, { showAdd: !1 })
407
- ] }),
408
- /* @__PURE__ */ s("form", { className: "space-y-8", children: /* @__PURE__ */ o(Re, { value: p, onValueChange: j, className: "w-full", children: [
409
- /* @__PURE__ */ o(qe, { className: "mb-4 grid w-full grid-cols-3", children: [
410
- /* @__PURE__ */ s($, { value: "seo", children: e("SEO") }),
411
- /* @__PURE__ */ s($, { value: "opengraph", children: e("Meta Tags") }),
412
- /* @__PURE__ */ s($, { value: "jsonld", children: e("JSON-LD") })
413
- ] }),
414
- /* @__PURE__ */ s("div", { className: p === "seo" ? "" : "sr-only", children: /* @__PURE__ */ o("div", { className: "space-y-4", children: [
415
- /* @__PURE__ */ o("div", { className: "space-y-1", children: [
416
- /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
417
- /* @__PURE__ */ s(S, { className: "text-xs", htmlFor: "keyword", children: e("Keyword") }),
418
- d && /* @__PURE__ */ s(
419
- T,
420
- {
421
- dataType: "value",
422
- data: a ?? {},
423
- onSelect: (t) => L(t, "keyword")
424
- }
425
- )
426
- ] }),
427
- /* @__PURE__ */ s(
428
- A,
429
- {
430
- type: "text",
431
- id: "keyword",
432
- name: "keyword",
433
- value: i.keyword,
434
- onChange: N,
435
- disabled: x || !d,
436
- placeholder: e("Enter keyword"),
437
- readOnly: !d
438
- }
439
- )
440
- ] }),
441
- /* @__PURE__ */ o("div", { className: "space-y-1", children: [
442
- /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
443
- /* @__PURE__ */ s(S, { className: "text-xs", htmlFor: "title", children: e("SEO Title") }),
444
- /* @__PURE__ */ o("div", { className: "flex items-center justify-end gap-2", children: [
445
- /* @__PURE__ */ s(B, { keyword: i.keyword, onComplete: R("title"), field: "title" }),
446
- d && /* @__PURE__ */ s(
447
- T,
448
- {
449
- dataType: "value",
450
- data: a ?? {},
451
- onSelect: (t) => L(t, "title")
452
- }
453
- )
454
- ] })
455
- ] }),
456
- /* @__PURE__ */ s(
457
- A,
458
- {
459
- type: "text",
460
- id: "title",
461
- name: "title",
462
- value: i.title,
463
- onChange: N,
464
- disabled: x || !d,
465
- placeholder: e("Enter SEO title"),
466
- readOnly: !d
467
- }
468
- )
469
- ] }),
470
- /* @__PURE__ */ o("div", { className: "space-y-1", children: [
471
- /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
472
- /* @__PURE__ */ s(S, { className: "text-xs", htmlFor: "description", children: e("SEO Description") }),
473
- /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
474
- /* @__PURE__ */ s(
475
- B,
476
- {
477
- keyword: i.keyword,
478
- onComplete: R("description"),
479
- field: "description"
480
- }
481
- ),
482
- d && /* @__PURE__ */ s(
483
- T,
484
- {
485
- data: a ?? {},
486
- onSelect: (t) => L(t, "description")
487
- }
488
- )
489
- ] })
490
- ] }),
491
- /* @__PURE__ */ s(
492
- te,
493
- {
494
- id: "description",
495
- name: "description",
496
- rows: 5,
497
- value: i.description,
498
- onChange: N,
499
- disabled: x || !d,
500
- placeholder: e("Enter SEO description"),
501
- readOnly: !d
502
- }
503
- )
504
- ] }),
505
- /* @__PURE__ */ o("div", { className: "space-y-1", children: [
506
- /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
507
- /* @__PURE__ */ s(S, { className: "text-xs", htmlFor: "title", children: e("Canonical URL") }),
508
- d && /* @__PURE__ */ s(
509
- T,
510
- {
511
- dataType: "value",
512
- data: a ?? {},
513
- onSelect: (t) => L(t, "canonicalUrl")
514
- }
515
- )
516
- ] }),
517
- /* @__PURE__ */ s(
518
- A,
519
- {
520
- type: "text",
521
- id: "canonicalUrl",
522
- name: "canonicalUrl",
523
- value: i.canonicalUrl,
524
- onChange: N,
525
- disabled: x || !d,
526
- placeholder: e("Enter Canonical URL"),
527
- readOnly: !d
528
- }
529
- )
530
- ] }),
531
- /* @__PURE__ */ o("div", { className: "", children: [
532
- /* @__PURE__ */ o("div", { className: "flex items-center gap-x-2", children: [
533
- /* @__PURE__ */ s(
534
- A,
535
- {
536
- type: "checkbox",
537
- id: "noIndex",
538
- name: "noIndex",
539
- checked: i.noIndex,
540
- onChange: N,
541
- disabled: x || !d,
542
- className: "h-4 w-4"
543
- }
544
- ),
545
- /* @__PURE__ */ s(S, { className: "pb-1 text-xs", htmlFor: "noIndex", children: e("No Index") })
546
- ] }),
547
- /* @__PURE__ */ s("p", { className: "mt-0 text-[10px] font-light leading-4 text-gray-400", children: e("Check this if you don't want search engines to index this page.") })
548
- ] }),
549
- /* @__PURE__ */ o("div", { className: "", children: [
550
- /* @__PURE__ */ o("div", { className: "flex items-center gap-x-2", children: [
551
- /* @__PURE__ */ s(
552
- A,
553
- {
554
- type: "checkbox",
555
- id: "noFollow",
556
- name: "noFollow",
557
- checked: i.noFollow,
558
- onChange: N,
559
- disabled: x || !d,
560
- className: "h-4 w-4"
561
- }
562
- ),
563
- /* @__PURE__ */ s(S, { className: "pb-1 text-xs", htmlFor: "noIndex", children: e("No Follow") })
564
- ] }),
565
- /* @__PURE__ */ s("p", { className: "text-[10px] font-light leading-4 text-gray-400", children: e("Check this if you don't want search engines to follow links on this page.") })
566
- ] })
567
- ] }) }),
568
- /* @__PURE__ */ s("div", { className: p === "opengraph" ? "" : "sr-only", children: /* @__PURE__ */ s("div", { className: "space-y-4", children: /* @__PURE__ */ o("div", { children: [
569
- /* @__PURE__ */ s("h3", { className: "mb-4 font-semibold text-slate-700", children: e("Open Graph") }),
570
- /* @__PURE__ */ o("div", { className: "space-y-4", children: [
571
- /* @__PURE__ */ o("div", { className: "space-y-1", children: [
572
- /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
573
- /* @__PURE__ */ s(S, { className: "text-xs", htmlFor: "ogTitle", children: e("OG Title") }),
574
- /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
575
- /* @__PURE__ */ s(
576
- B,
577
- {
578
- keyword: i.keyword,
579
- onComplete: R("ogTitle"),
580
- field: "ogTitle"
581
- }
582
- ),
583
- d && /* @__PURE__ */ s(
584
- T,
585
- {
586
- dataType: "value",
587
- data: a ?? {},
588
- onSelect: (t) => L(t, "ogTitle")
589
- }
590
- )
591
- ] })
592
- ] }),
593
- /* @__PURE__ */ s(
594
- A,
595
- {
596
- type: "text",
597
- id: "ogTitle",
598
- name: "ogTitle",
599
- value: i.ogTitle,
600
- onChange: N,
601
- disabled: x || !d,
602
- placeholder: e("Enter OG title"),
603
- readOnly: !d
604
- }
605
- )
606
- ] }),
607
- /* @__PURE__ */ o("div", { className: "space-y-1", children: [
608
- /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
609
- /* @__PURE__ */ s(S, { className: "text-xs", htmlFor: "ogDescription", children: e("OG Description") }),
610
- /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
611
- /* @__PURE__ */ s(
612
- B,
613
- {
614
- keyword: i.keyword,
615
- onComplete: R("ogDescription"),
616
- field: "ogDescription"
617
- }
618
- ),
619
- d && /* @__PURE__ */ s(
620
- T,
621
- {
622
- dataType: "value",
623
- data: a ?? {},
624
- onSelect: (t) => L(t, "ogDescription")
625
- }
626
- )
627
- ] })
628
- ] }),
629
- /* @__PURE__ */ s(
630
- te,
631
- {
632
- id: "ogDescription",
633
- name: "ogDescription",
634
- rows: 5,
635
- value: i.ogDescription,
636
- onChange: N,
637
- disabled: x || !d,
638
- placeholder: e("Enter OG description"),
639
- readOnly: !d
640
- }
641
- )
642
- ] }),
643
- /* @__PURE__ */ o("div", { className: "space-y-1", children: [
644
- /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
645
- /* @__PURE__ */ s(S, { className: "text-xs", htmlFor: "ogImage", children: e("OG Image") }),
646
- d && /* @__PURE__ */ s(
647
- T,
648
- {
649
- dataType: "value",
650
- data: a ?? {},
651
- onSelect: (t) => {
652
- O({
653
- ...i,
654
- ogImage: `{{${t}}}`,
655
- ogImageId: ""
656
- });
657
- }
658
- }
659
- )
660
- ] }),
661
- /* @__PURE__ */ s(
662
- Ee,
663
- {
664
- assetId: i.ogImageId,
665
- assetUrl: i.ogImage,
666
- onChange: (t) => {
667
- O({
668
- ...i,
669
- ogImage: t.url,
670
- ogImageId: t.id
671
- });
672
- },
673
- disabled: x || !d,
674
- placeholder: e("Select OG image"),
675
- className: "mb-2"
676
- }
677
- )
678
- ] }),
679
- /* @__PURE__ */ o("div", { className: "space-y-1", children: [
680
- /* @__PURE__ */ s("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ s(S, { className: "text-xs", htmlFor: "metaOther", children: e("Meta Tags") }) }),
681
- /* @__PURE__ */ s(
682
- se,
683
- {
684
- id: "metaOther",
685
- value: i.metaOther,
686
- onChange: (t) => {
687
- N({
688
- target: { name: "metaOther", value: t }
689
- });
690
- },
691
- placeholder: e("Enter Meta Tags JSON"),
692
- disabled: x || !d,
693
- readOnly: !d,
694
- pageData: a || {},
695
- rows: 8,
696
- handleFieldInsert: L
697
- }
698
- )
699
- ] })
700
- ] })
701
- ] }) }) }),
702
- /* @__PURE__ */ s("div", { className: p === "jsonld" ? "" : "sr-only", children: /* @__PURE__ */ s("div", { className: "space-y-4", children: /* @__PURE__ */ o("div", { className: "space-y-1", children: [
703
- /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
704
- /* @__PURE__ */ s(S, { className: "text-xs", htmlFor: "jsonLD", children: e("JSON-LD") }),
705
- X && /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ s(B, { keyword: i.keyword, onComplete: R("jsonLD"), field: "jsonLD" }) })
706
- ] }),
707
- /* @__PURE__ */ s("div", { className: "hidden", children: JSON.stringify(a) }),
708
- /* @__PURE__ */ s(
709
- se,
710
- {
711
- id: "jsonLD",
712
- value: i.jsonLD,
713
- onChange: (t) => {
714
- N({ target: { name: "jsonLD", value: t } });
715
- },
716
- placeholder: e("Enter JSON-LD"),
717
- disabled: x || !d,
718
- readOnly: !d,
719
- pageData: a || {},
720
- rows: 12,
721
- handleFieldInsert: L,
722
- hasJsonLdForSelectedLang: X,
723
- copyJsonLDFromDefaultPage: ye
724
- }
725
- )
726
- ] }) }) })
727
- ] }) })
728
- ] }),
729
- d && /* @__PURE__ */ o("div", { className: "fixed bottom-0 left-0 right-0 flex w-full flex-shrink-0 items-center justify-between border-t bg-background p-4", children: [
730
- me ? /* @__PURE__ */ s(
731
- J,
732
- {
733
- type: "button",
734
- variant: "ghost",
735
- size: "sm",
736
- onClick: () => {
737
- p === "jsonld" ? ge() : p === "opengraph" ? fe() : pe();
738
- },
739
- disabled: x || !d || !I,
740
- children: e(Q ? "Resetting..." : `Reset to ${p === "jsonld" ? "Default JSON-LD" : p === "opengraph" ? "Default Open Graph" : "Default SEO"}`)
741
- }
742
- ) : /* @__PURE__ */ s("div", {}),
743
- /* @__PURE__ */ o("div", { className: "flex items-center gap-4", children: [
744
- /* @__PURE__ */ s(
745
- J,
746
- {
747
- onClick: Z,
748
- disabled: !Ye(i == null ? void 0 : i.jsonLD) || (C.current[f] ? ne(C.current[f], i) : !1) || x || !d,
749
- children: e(G ? "Saving..." : "Save")
750
- }
751
- ),
752
- /* @__PURE__ */ s(
753
- J,
754
- {
755
- variant: "link",
756
- className: "text-gray-500 hover:text-gray-700",
757
- onClick: () => l("outline"),
758
- children: e("Cancel")
759
- }
760
- )
761
- ] })
762
- ] }),
763
- /* @__PURE__ */ s(
764
- Qe,
765
- {
766
- isOpen: ie,
767
- onClose: () => {
768
- _(!1), V(null);
769
- },
770
- onSave: async () => {
771
- D && (await Z(), D.switchHandler(), _(!1), V(null));
772
- },
773
- onDiscard: () => {
774
- if (D) {
775
- const t = C.current[f];
776
- t && O(t), D.switchHandler(), _(!1), V(null);
777
- }
778
- },
779
- isSaving: G,
780
- fromLanguage: (D == null ? void 0 : D.fromLang) || f,
781
- toLanguage: (D == null ? void 0 : D.toLang) || ""
782
- }
783
- )
784
- ] });
785
- };
786
- Ze.displayName = "SeoPanel";
787
- export {
788
- Ze as default
789
- };