@localazy/strapi-plugin 1.0.4 → 1.0.9

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 (61) hide show
  1. package/dist/_chunks/FetchIdentity-4kkW9N7Y.js +981 -0
  2. package/dist/_chunks/FetchIdentity-BWSQAXt-.mjs +983 -0
  3. package/dist/_chunks/{LanguagesSelector-CeB7tVcb.mjs → LanguagesSelector-DwAGgpcR.mjs} +4 -2
  4. package/dist/_chunks/{LanguagesSelector-Bd8VFHib.js → LanguagesSelector-yWC_Yb_S.js} +12 -10
  5. package/dist/_chunks/{App-NRmSxuW3.js → LocalazyApp-DnaA768k.js} +136 -117
  6. package/dist/_chunks/{App-CtS6CrNn.mjs → LocalazyApp-zySanVTu.mjs} +32 -13
  7. package/dist/_chunks/{ContentTransferSetup-CeKXlzw_.mjs → LocalazyContentTransferSetup-C7qVIeix.mjs} +49 -456
  8. package/dist/_chunks/{ContentTransferSetup-DGs8MZPj.js → LocalazyContentTransferSetup-CeOM6bYA.js} +113 -520
  9. package/dist/_chunks/{GlobalSettings-rOwd0Y0E.mjs → LocalazyGlobalSettings-QvuLdsLe.mjs} +17 -8
  10. package/dist/_chunks/{GlobalSettings-CRMPRA3Y.js → LocalazyGlobalSettings-ewETL3oG.js} +61 -52
  11. package/dist/_chunks/LocalazyPanel-BXVLvFgD.js +83 -0
  12. package/dist/_chunks/LocalazyPanel-BotUsX-y.mjs +83 -0
  13. package/dist/_chunks/LocalazyStatusColumn-C81HewMg.mjs +51 -0
  14. package/dist/_chunks/LocalazyStatusColumn-Dt96YcGQ.js +51 -0
  15. package/dist/_chunks/{isEqual-CC-cEPwY.mjs → RequireLocalazyAuth-CDuyGCrT.mjs} +22 -1
  16. package/dist/_chunks/{isEqual-0M0aSdTT.js → RequireLocalazyAuth-CWBWETzC.js} +50 -29
  17. package/dist/_chunks/_commonjsHelpers-Bc2YnDe1.js +7 -0
  18. package/dist/_chunks/_commonjsHelpers-DWwsNxpa.mjs +8 -0
  19. package/dist/_chunks/en-CMWcM0nM.js +10 -0
  20. package/dist/_chunks/en-RX915msK.mjs +10 -0
  21. package/dist/_chunks/entry-exclusion-service-BVPICve2.mjs +60 -0
  22. package/dist/_chunks/entry-exclusion-service-CGV6iOkB.js +60 -0
  23. package/dist/_chunks/{has-model-changed-gNSOSMBa.js → has-model-changed-DVYRxVhM.js} +33 -32
  24. package/dist/_chunks/{has-model-changed-DViUIQHk.mjs → has-model-changed-DZL36gWh.mjs} +3 -2
  25. package/dist/_chunks/i18n-0dV2P-Hm.js +2378 -0
  26. package/dist/_chunks/i18n-RoETLXdU.mjs +2378 -0
  27. package/dist/_chunks/index-1he9s_bs.js +430 -0
  28. package/dist/_chunks/index-BIbKC7-V.mjs +432 -0
  29. package/dist/_chunks/index-CCxXsn7Z.js +254 -0
  30. package/dist/_chunks/{set-Cbi1yYuW.js → index-CaY3BYnQ.js} +878 -4379
  31. package/dist/_chunks/{set-Dnhh_SyE.mjs → index-CgI_aKe_.mjs} +906 -4408
  32. package/dist/_chunks/index-DsrYI6aB.mjs +231 -0
  33. package/dist/_chunks/initReactI18next-B0H8_DlW.js +60 -0
  34. package/dist/_chunks/initReactI18next-MHHxeg_9.mjs +61 -0
  35. package/dist/_chunks/{index-Dj68Ixl2.mjs → strapi-api-base-BE8VMlaA.js} +7 -234
  36. package/dist/_chunks/{index-Bbwk3kp3.js → strapi-api-base-DjeKGUw7.mjs} +15 -242
  37. package/dist/_chunks/useTranslation-BdIl-aLe.js +188 -0
  38. package/dist/_chunks/useTranslation-CZQ4lU1m.mjs +189 -0
  39. package/dist/admin/index.js +1 -1
  40. package/dist/admin/index.mjs +1 -1
  41. package/dist/admin/src/components/LocalazyPanel.d.ts +4 -0
  42. package/dist/admin/src/components/LocalazyStatusColumn.d.ts +3 -0
  43. package/dist/admin/src/components/RequireLocalazyAuth.d.ts +6 -0
  44. package/dist/admin/src/index.d.ts +1 -0
  45. package/dist/admin/src/modules/entry-exclusion/services/entry-exclusion-service.d.ts +18 -0
  46. package/dist/admin/src/modules/plugin-settings/locale/en.d.ts +8 -0
  47. package/dist/admin/src/pages/LocalazyApp.d.ts +2 -0
  48. package/dist/admin/src/pages/LocalazyContentTransferSetup.d.ts +2 -0
  49. package/dist/admin/src/pages/LocalazyGlobalSettings.d.ts +2 -0
  50. package/dist/server/index.js +202 -35
  51. package/dist/server/index.mjs +202 -35
  52. package/dist/server/src/controllers/entry-exclusion-controller.d.ts +21 -0
  53. package/dist/server/src/controllers/index.d.ts +7 -0
  54. package/dist/server/src/core/index.d.ts +6 -0
  55. package/dist/server/src/index.d.ts +15 -0
  56. package/dist/server/src/routes/entry-exclusion-routes.d.ts +9 -0
  57. package/dist/server/src/services/entry-exclusion-service.d.ts +23 -0
  58. package/dist/server/src/services/index.d.ts +8 -0
  59. package/package.json +2 -2
  60. package/dist/_chunks/en-BTf8goGM.mjs +0 -8
  61. package/dist/_chunks/en-CRtsEFtl.js +0 -8
@@ -1,425 +1,14 @@
1
- import { jsxs, jsx, Fragment as Fragment$1 } from "react/jsx-runtime";
2
- import { createElement, isValidElement, cloneElement, Children, Fragment, useContext, forwardRef, useState, useEffect } from "react";
3
- import { i as isEqual } from "./isEqual-CC-cEPwY.mjs";
4
- import { g as getDefaultExportFromCjs, x as warnOnce, y as getI18n, z as getDefaults, C as isString, E as warn, H as isObject, I as I18nContext, s as set, J as CheckboxImpl, K as keys, N as isArrayLike, O as arrayEach, Q as isArray, R as isObject$1, u as useTranslation, d as Box, U as Accordion, c as Flex, V as SwitchImpl, T as Typography, B as Button, p as ForwardRef$4z, A as Alert, D as Divider, P as PluginSettingsService, n as cloneDeep } from "./set-Dnhh_SyE.mjs";
1
+ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
+ import { forwardRef, useState, useEffect } from "react";
3
+ import { i as isEqual, R as RequireLocalazyAuth } from "./RequireLocalazyAuth-CDuyGCrT.mjs";
4
+ import { s as set, m as keys, n as isArrayLike, o as arrayEach, k as isArray, p as isObject, P as PluginSettingsService, c as cloneDeep, L as LocalazyIdentityProvider, F as FetchIdentity } from "./FetchIdentity-BWSQAXt-.mjs";
5
5
  import { Layouts } from "@strapi/strapi/admin";
6
- import { S as SUPPORTED_CONTENT_TYPE_FIELDS, a as SUPPORTED_CUSTOM_FIELD_PLUGINS, g as getContentTransferSetupKeysSets, b as get, f as findModelValueByKey, c as StrapiModelService, d as getModelsTree, h as hasModelChanged } from "./has-model-changed-DViUIQHk.mjs";
6
+ import { C as CheckboxImpl, e as Box, g as Accordion, c as Flex, h as SwitchImpl, T as Typography, B as Button, d as ForwardRef$4z, A as Alert, D as Divider } from "./index-CgI_aKe_.mjs";
7
+ import { S as SUPPORTED_CONTENT_TYPE_FIELDS, a as SUPPORTED_CUSTOM_FIELD_PLUGINS, g as getContentTransferSetupKeysSets, b as get, f as findModelValueByKey, c as StrapiModelService, d as getModelsTree, h as hasModelChanged } from "./has-model-changed-DZL36gWh.mjs";
8
+ import { u as useTranslation } from "./useTranslation-CZQ4lU1m.mjs";
7
9
  import styled from "styled-components";
8
- var voidElements = {
9
- "area": true,
10
- "base": true,
11
- "br": true,
12
- "col": true,
13
- "embed": true,
14
- "hr": true,
15
- "img": true,
16
- "input": true,
17
- "link": true,
18
- "meta": true,
19
- "param": true,
20
- "source": true,
21
- "track": true,
22
- "wbr": true
23
- };
24
- const e = /* @__PURE__ */ getDefaultExportFromCjs(voidElements);
25
- var t = /\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;
26
- function n(n2) {
27
- var r2 = { type: "tag", name: "", voidElement: false, attrs: {}, children: [] }, i2 = n2.match(/<\/?([^\s]+?)[/\s>]/);
28
- if (i2 && (r2.name = i2[1], (e[i2[1]] || "/" === n2.charAt(n2.length - 2)) && (r2.voidElement = true), r2.name.startsWith("!--"))) {
29
- var s2 = n2.indexOf("-->");
30
- return { type: "comment", comment: -1 !== s2 ? n2.slice(4, s2) : "" };
31
- }
32
- for (var a2 = new RegExp(t), c2 = null; null !== (c2 = a2.exec(n2)); ) if (c2[0].trim()) if (c2[1]) {
33
- var o = c2[1].trim(), l = [o, ""];
34
- o.indexOf("=") > -1 && (l = o.split("=")), r2.attrs[l[0]] = l[1], a2.lastIndex--;
35
- } else c2[2] && (r2.attrs[c2[2]] = c2[3].trim().substring(1, c2[3].length - 1));
36
- return r2;
37
- }
38
- var r = /<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g, i = /^\s*$/, s = /* @__PURE__ */ Object.create(null);
39
- function a(e2, t2) {
40
- switch (t2.type) {
41
- case "text":
42
- return e2 + t2.content;
43
- case "tag":
44
- return e2 += "<" + t2.name + (t2.attrs ? function(e3) {
45
- var t3 = [];
46
- for (var n2 in e3) t3.push(n2 + '="' + e3[n2] + '"');
47
- return t3.length ? " " + t3.join(" ") : "";
48
- }(t2.attrs) : "") + (t2.voidElement ? "/>" : ">"), t2.voidElement ? e2 : e2 + t2.children.reduce(a, "") + "</" + t2.name + ">";
49
- case "comment":
50
- return e2 + "<!--" + t2.comment + "-->";
51
- }
52
- }
53
- var c = { parse: function(e2, t2) {
54
- t2 || (t2 = {}), t2.components || (t2.components = s);
55
- var a2, c2 = [], o = [], l = -1, m = false;
56
- if (0 !== e2.indexOf("<")) {
57
- var u = e2.indexOf("<");
58
- c2.push({ type: "text", content: -1 === u ? e2 : e2.substring(0, u) });
59
- }
60
- return e2.replace(r, function(r2, s2) {
61
- if (m) {
62
- if (r2 !== "</" + a2.name + ">") return;
63
- m = false;
64
- }
65
- var u2, f = "/" !== r2.charAt(1), h = r2.startsWith("<!--"), p = s2 + r2.length, d = e2.charAt(p);
66
- if (h) {
67
- var v = n(r2);
68
- return l < 0 ? (c2.push(v), c2) : ((u2 = o[l]).children.push(v), c2);
69
- }
70
- if (f && (l++, "tag" === (a2 = n(r2)).type && t2.components[a2.name] && (a2.type = "component", m = true), a2.voidElement || m || !d || "<" === d || a2.children.push({ type: "text", content: e2.slice(p, e2.indexOf("<", p)) }), 0 === l && c2.push(a2), (u2 = o[l - 1]) && u2.children.push(a2), o[l] = a2), (!f || a2.voidElement) && (l > -1 && (a2.voidElement || a2.name === r2.slice(2, -1)) && (l--, a2 = -1 === l ? c2 : o[l]), !m && "<" !== d && d)) {
71
- u2 = -1 === l ? c2 : o[l].children;
72
- var x = e2.indexOf("<", p), g = e2.slice(p, -1 === x ? void 0 : x);
73
- i.test(g) && (g = " "), (x > -1 && l + u2.length >= 0 || " " !== g) && u2.push({ type: "text", content: g });
74
- }
75
- }), c2;
76
- }, stringify: function(e2) {
77
- return e2.reduce(function(e3, t2) {
78
- return e3 + a("", t2);
79
- }, "");
80
- } };
81
- const hasChildren = (node, checkLength) => {
82
- if (!node) return false;
83
- const base = node.props?.children ?? node.children;
84
- if (checkLength) return base.length > 0;
85
- return !!base;
86
- };
87
- const getChildren = (node) => {
88
- if (!node) return [];
89
- const children = node.props?.children ?? node.children;
90
- return node.props?.i18nIsDynamicList ? getAsArray(children) : children;
91
- };
92
- const hasValidReactChildren = (children) => Array.isArray(children) && children.every(isValidElement);
93
- const getAsArray = (data) => Array.isArray(data) ? data : [data];
94
- const mergeProps = (source, target) => {
95
- const newTarget = {
96
- ...target
97
- };
98
- newTarget.props = Object.assign(source.props, target.props);
99
- return newTarget;
100
- };
101
- const nodesToString = (children, i18nOptions, i18n, i18nKey) => {
102
- if (!children) return "";
103
- let stringNode = "";
104
- const childrenArray = getAsArray(children);
105
- const keepArray = i18nOptions?.transSupportBasicHtmlNodes ? i18nOptions.transKeepBasicHtmlNodesFor ?? [] : [];
106
- childrenArray.forEach((child, childIndex) => {
107
- if (isString(child)) {
108
- stringNode += `${child}`;
109
- return;
110
- }
111
- if (isValidElement(child)) {
112
- const {
113
- props,
114
- type
115
- } = child;
116
- const childPropsCount = Object.keys(props).length;
117
- const shouldKeepChild = keepArray.indexOf(type) > -1;
118
- const childChildren = props.children;
119
- if (!childChildren && shouldKeepChild && !childPropsCount) {
120
- stringNode += `<${type}/>`;
121
- return;
122
- }
123
- if (!childChildren && (!shouldKeepChild || childPropsCount) || props.i18nIsDynamicList) {
124
- stringNode += `<${childIndex}></${childIndex}>`;
125
- return;
126
- }
127
- if (shouldKeepChild && childPropsCount === 1 && isString(childChildren)) {
128
- stringNode += `<${type}>${childChildren}</${type}>`;
129
- return;
130
- }
131
- const content = nodesToString(childChildren, i18nOptions, i18n, i18nKey);
132
- stringNode += `<${childIndex}>${content}</${childIndex}>`;
133
- return;
134
- }
135
- if (child === null) {
136
- warn(i18n, "TRANS_NULL_VALUE", `Passed in a null value as child`, {
137
- i18nKey
138
- });
139
- return;
140
- }
141
- if (isObject(child)) {
142
- const {
143
- format,
144
- ...clone
145
- } = child;
146
- const keys2 = Object.keys(clone);
147
- if (keys2.length === 1) {
148
- const value = format ? `${keys2[0]}, ${format}` : keys2[0];
149
- stringNode += `{{${value}}}`;
150
- return;
151
- }
152
- warn(i18n, "TRANS_INVALID_OBJ", `Invalid child - Object should only have keys {{ value, format }} (format is optional).`, {
153
- i18nKey,
154
- child
155
- });
156
- return;
157
- }
158
- warn(i18n, "TRANS_INVALID_VAR", `Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.`, {
159
- i18nKey,
160
- child
161
- });
162
- });
163
- return stringNode;
164
- };
165
- const renderNodes = (children, targetString, i18n, i18nOptions, combinedTOpts, shouldUnescape) => {
166
- if (targetString === "") return [];
167
- const keepArray = i18nOptions.transKeepBasicHtmlNodesFor || [];
168
- const emptyChildrenButNeedsHandling = targetString && new RegExp(keepArray.map((keep) => `<${keep}`).join("|")).test(targetString);
169
- if (!children && !emptyChildrenButNeedsHandling && !shouldUnescape) return [targetString];
170
- const data = {};
171
- const getData = (childs) => {
172
- const childrenArray = getAsArray(childs);
173
- childrenArray.forEach((child) => {
174
- if (isString(child)) return;
175
- if (hasChildren(child)) getData(getChildren(child));
176
- else if (isObject(child) && !isValidElement(child)) Object.assign(data, child);
177
- });
178
- };
179
- getData(children);
180
- const ast = c.parse(`<0>${targetString}</0>`);
181
- const opts = {
182
- ...data,
183
- ...combinedTOpts
184
- };
185
- const renderInner = (child, node, rootReactNode) => {
186
- const childs = getChildren(child);
187
- const mappedChildren = mapAST(childs, node.children, rootReactNode);
188
- return hasValidReactChildren(childs) && mappedChildren.length === 0 || child.props?.i18nIsDynamicList ? childs : mappedChildren;
189
- };
190
- const pushTranslatedJSX = (child, inner, mem, i2, isVoid) => {
191
- if (child.dummy) {
192
- child.children = inner;
193
- mem.push(cloneElement(child, {
194
- key: i2
195
- }, isVoid ? void 0 : inner));
196
- } else {
197
- mem.push(...Children.map([child], (c2) => {
198
- const props = {
199
- ...c2.props
200
- };
201
- delete props.i18nIsDynamicList;
202
- return createElement(c2.type, {
203
- ...props,
204
- key: i2,
205
- ref: c2.ref
206
- }, isVoid ? null : inner);
207
- }));
208
- }
209
- };
210
- const mapAST = (reactNode, astNode, rootReactNode) => {
211
- const reactNodes = getAsArray(reactNode);
212
- const astNodes = getAsArray(astNode);
213
- return astNodes.reduce((mem, node, i2) => {
214
- const translationContent = node.children?.[0]?.content && i18n.services.interpolator.interpolate(node.children[0].content, opts, i18n.language);
215
- if (node.type === "tag") {
216
- let tmp = reactNodes[parseInt(node.name, 10)];
217
- if (rootReactNode.length === 1 && !tmp) tmp = rootReactNode[0][node.name];
218
- if (!tmp) tmp = {};
219
- const child = Object.keys(node.attrs).length !== 0 ? mergeProps({
220
- props: node.attrs
221
- }, tmp) : tmp;
222
- const isElement = isValidElement(child);
223
- const isValidTranslationWithChildren = isElement && hasChildren(node, true) && !node.voidElement;
224
- const isEmptyTransWithHTML = emptyChildrenButNeedsHandling && isObject(child) && child.dummy && !isElement;
225
- const isKnownComponent = isObject(children) && Object.hasOwnProperty.call(children, node.name);
226
- if (isString(child)) {
227
- const value = i18n.services.interpolator.interpolate(child, opts, i18n.language);
228
- mem.push(value);
229
- } else if (hasChildren(child) || isValidTranslationWithChildren) {
230
- const inner = renderInner(child, node, rootReactNode);
231
- pushTranslatedJSX(child, inner, mem, i2);
232
- } else if (isEmptyTransWithHTML) {
233
- const inner = mapAST(reactNodes, node.children, rootReactNode);
234
- pushTranslatedJSX(child, inner, mem, i2);
235
- } else if (Number.isNaN(parseFloat(node.name))) {
236
- if (isKnownComponent) {
237
- const inner = renderInner(child, node, rootReactNode);
238
- pushTranslatedJSX(child, inner, mem, i2, node.voidElement);
239
- } else if (i18nOptions.transSupportBasicHtmlNodes && keepArray.indexOf(node.name) > -1) {
240
- if (node.voidElement) {
241
- mem.push(createElement(node.name, {
242
- key: `${node.name}-${i2}`
243
- }));
244
- } else {
245
- const inner = mapAST(reactNodes, node.children, rootReactNode);
246
- mem.push(createElement(node.name, {
247
- key: `${node.name}-${i2}`
248
- }, inner));
249
- }
250
- } else if (node.voidElement) {
251
- mem.push(`<${node.name} />`);
252
- } else {
253
- const inner = mapAST(reactNodes, node.children, rootReactNode);
254
- mem.push(`<${node.name}>${inner}</${node.name}>`);
255
- }
256
- } else if (isObject(child) && !isElement) {
257
- const content = node.children[0] ? translationContent : null;
258
- if (content) mem.push(content);
259
- } else {
260
- pushTranslatedJSX(child, translationContent, mem, i2, node.children.length !== 1 || !translationContent);
261
- }
262
- } else if (node.type === "text") {
263
- const wrapTextNodes = i18nOptions.transWrapTextNodes;
264
- const content = shouldUnescape ? i18nOptions.unescape(i18n.services.interpolator.interpolate(node.content, opts, i18n.language)) : i18n.services.interpolator.interpolate(node.content, opts, i18n.language);
265
- if (wrapTextNodes) {
266
- mem.push(createElement(wrapTextNodes, {
267
- key: `${node.name}-${i2}`
268
- }, content));
269
- } else {
270
- mem.push(content);
271
- }
272
- }
273
- return mem;
274
- }, []);
275
- };
276
- const result = mapAST([{
277
- dummy: true,
278
- children: children || []
279
- }], ast, getAsArray(children || []));
280
- return getChildren(result[0]);
281
- };
282
- const fixComponentProps = (component, index, translation) => {
283
- const componentKey = component.key || index;
284
- const comp = cloneElement(component, {
285
- key: componentKey
286
- });
287
- if (!comp.props || !comp.props.children || translation.indexOf(`${index}/>`) < 0 && translation.indexOf(`${index} />`) < 0) {
288
- return comp;
289
- }
290
- function Componentized() {
291
- return createElement(Fragment, null, comp);
292
- }
293
- return createElement(Componentized);
294
- };
295
- const generateArrayComponents = (components, translation) => components.map((c2, index) => fixComponentProps(c2, index, translation));
296
- const generateObjectComponents = (components, translation) => {
297
- const componentMap = {};
298
- Object.keys(components).forEach((c2) => {
299
- Object.assign(componentMap, {
300
- [c2]: fixComponentProps(components[c2], c2, translation)
301
- });
302
- });
303
- return componentMap;
304
- };
305
- const generateComponents = (components, translation, i18n, i18nKey) => {
306
- if (!components) return null;
307
- if (Array.isArray(components)) {
308
- return generateArrayComponents(components, translation);
309
- }
310
- if (isObject(components)) {
311
- return generateObjectComponents(components, translation);
312
- }
313
- warnOnce(i18n, "TRANS_INVALID_COMPONENTS", `<Trans /> "components" prop expects an object or array`, {
314
- i18nKey
315
- });
316
- return null;
317
- };
318
- function Trans$1({
319
- children,
320
- count,
321
- parent,
322
- i18nKey,
323
- context,
324
- tOptions = {},
325
- values,
326
- defaults,
327
- components,
328
- ns,
329
- i18n: i18nFromProps,
330
- t: tFromProps,
331
- shouldUnescape,
332
- ...additionalProps
333
- }) {
334
- const i18n = i18nFromProps || getI18n();
335
- if (!i18n) {
336
- warnOnce(i18n, "NO_I18NEXT_INSTANCE", `Trans: You need to pass in an i18next instance using i18nextReactModule`, {
337
- i18nKey
338
- });
339
- return children;
340
- }
341
- const t2 = tFromProps || i18n.t.bind(i18n) || ((k) => k);
342
- const reactI18nextOptions = {
343
- ...getDefaults(),
344
- ...i18n.options?.react
345
- };
346
- let namespaces = ns || t2.ns || i18n.options?.defaultNS;
347
- namespaces = isString(namespaces) ? [namespaces] : namespaces || ["translation"];
348
- const nodeAsString = nodesToString(children, reactI18nextOptions, i18n, i18nKey);
349
- const defaultValue = defaults || nodeAsString || reactI18nextOptions.transEmptyNodeValue || i18nKey;
350
- const {
351
- hashTransKey
352
- } = reactI18nextOptions;
353
- const key = i18nKey || (hashTransKey ? hashTransKey(nodeAsString || defaultValue) : nodeAsString || defaultValue);
354
- if (i18n.options?.interpolation?.defaultVariables) {
355
- values = values && Object.keys(values).length > 0 ? {
356
- ...values,
357
- ...i18n.options.interpolation.defaultVariables
358
- } : {
359
- ...i18n.options.interpolation.defaultVariables
360
- };
361
- }
362
- const interpolationOverride = values || count !== void 0 && !i18n.options?.interpolation?.alwaysFormat || !children ? tOptions.interpolation : {
363
- interpolation: {
364
- ...tOptions.interpolation,
365
- prefix: "#$?",
366
- suffix: "?$#"
367
- }
368
- };
369
- const combinedTOpts = {
370
- ...tOptions,
371
- context: context || tOptions.context,
372
- count,
373
- ...values,
374
- ...interpolationOverride,
375
- defaultValue,
376
- ns: namespaces
377
- };
378
- const translation = key ? t2(key, combinedTOpts) : defaultValue;
379
- const generatedComponents = generateComponents(components, translation, i18n, i18nKey);
380
- const content = renderNodes(generatedComponents || children, translation, i18n, reactI18nextOptions, combinedTOpts, shouldUnescape);
381
- const useAsParent = parent ?? reactI18nextOptions.defaultTransParent;
382
- return useAsParent ? createElement(useAsParent, additionalProps, content) : content;
383
- }
384
- function Trans({
385
- children,
386
- count,
387
- parent,
388
- i18nKey,
389
- context,
390
- tOptions = {},
391
- values,
392
- defaults,
393
- components,
394
- ns,
395
- i18n: i18nFromProps,
396
- t: tFromProps,
397
- shouldUnescape,
398
- ...additionalProps
399
- }) {
400
- const {
401
- i18n: i18nFromContext,
402
- defaultNS: defaultNSFromContext
403
- } = useContext(I18nContext) || {};
404
- const i18n = i18nFromProps || i18nFromContext || getI18n();
405
- const t2 = tFromProps || i18n?.t.bind(i18n);
406
- return Trans$1({
407
- children,
408
- count,
409
- parent,
410
- i18nKey,
411
- context,
412
- tOptions,
413
- values,
414
- defaults,
415
- components,
416
- ns: ns || t2?.ns || defaultNSFromContext || i18n?.options?.defaultNS,
417
- i18n,
418
- t: tFromProps,
419
- shouldUnescape,
420
- ...additionalProps
421
- });
422
- }
10
+ import { Trans } from "./index-BIbKC7-V.mjs";
11
+ import "./i18n-RoETLXdU.mjs";
423
12
  const getFilteredModelsSchemas = (models) => {
424
13
  if (!models) {
425
14
  return [];
@@ -461,9 +50,9 @@ const buildContentTransferSetupSchema = (localizableTree = [], storedSetupSchema
461
50
  set(destinationObject, key, get(oLocalizableTree, key));
462
51
  });
463
52
  const destinationArray = [];
464
- const sortedDestinationObjectKeys = Object.keys(destinationObject).sort((a2, b) => {
465
- if (a2 < b) return -1;
466
- if (a2 > b) return 1;
53
+ const sortedDestinationObjectKeys = Object.keys(destinationObject).sort((a, b) => {
54
+ if (a < b) return -1;
55
+ if (a > b) return 1;
467
56
  return 0;
468
57
  });
469
58
  for (const key of sortedDestinationObjectKeys) {
@@ -1178,7 +767,7 @@ const TreeItem = ({ label, value, children, passedKey = "", onTreeItemClick }) =
1178
767
  const onChange = (key, currentValue) => {
1179
768
  onTreeItemClick(key, currentValue);
1180
769
  };
1181
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [
770
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1182
771
  typeof value === "boolean" && /* @__PURE__ */ jsx(CheckboxImpl, { checked: value, onCheckedChange: () => onChange([passedKey], value), children: label || "-" }),
1183
772
  value === null && /* @__PURE__ */ jsx(CheckboxImpl, { checked: false, disabled: true, children: label || "-" }),
1184
773
  children && /* @__PURE__ */ jsx("div", { children }, passedKey)
@@ -1231,7 +820,7 @@ function forEach(collection, iteratee) {
1231
820
  function flattenObject(obj, delimiter = ".") {
1232
821
  const nobj = {};
1233
822
  forEach(obj, (val, key) => {
1234
- if (isObject$1(val) && !isArray(val)) {
823
+ if (isObject(val) && !isArray(val)) {
1235
824
  const strip = flattenObject(val, delimiter);
1236
825
  forEach(strip, (v, k) => {
1237
826
  nobj[key + delimiter + k] = v;
@@ -1243,7 +832,7 @@ function flattenObject(obj, delimiter = ".") {
1243
832
  return nobj;
1244
833
  }
1245
834
  const Tree = ({ objects, onTreeItemClick, initiallyExpanded = false }) => {
1246
- const { t: t2 } = useTranslation();
835
+ const { t } = useTranslation();
1247
836
  const [, setIsExpanded] = useState(initiallyExpanded);
1248
837
  useEffect(() => {
1249
838
  setIsExpanded(initiallyExpanded);
@@ -1278,7 +867,7 @@ const Tree = ({ objects, onTreeItemClick, initiallyExpanded = false }) => {
1278
867
  const createTree = (name, branch, path = "") => {
1279
868
  const isBranchObject = typeof branch === "object" && branch !== null;
1280
869
  if (isBranchObject) {
1281
- return /* @__PURE__ */ jsx(Fragment$1, { children: Object.entries(branch).map(([key, value]) => {
870
+ return /* @__PURE__ */ jsx(Fragment, { children: Object.entries(branch).map(([key, value]) => {
1282
871
  const isSubbranchObject = typeof value === "object" && value !== null;
1283
872
  let flattened = flattenObject(value);
1284
873
  flattened = Object.fromEntries(Object.entries(flattened).filter(([key2]) => !key2.includes("__component__")));
@@ -1316,7 +905,7 @@ const Tree = ({ objects, onTreeItemClick, initiallyExpanded = false }) => {
1316
905
  /* @__PURE__ */ jsx(Accordion.Header, { style: { flex: 1 }, children: /* @__PURE__ */ jsxs(Accordion.Trigger, { description: key, children: [
1317
906
  key,
1318
907
  " ",
1319
- t2("plugin_settings.tree_item_count", { count: getCheckedStateCount(value) })
908
+ t("plugin_settings.tree_item_count", { count: getCheckedStateCount(value) })
1320
909
  ] }) }),
1321
910
  /* @__PURE__ */ jsx(
1322
911
  SwitchImpl,
@@ -1340,12 +929,12 @@ const CustomBullet = styled.div`
1340
929
  border-radius: 50%;
1341
930
  `;
1342
931
  function ContentTransferSetupEmpty() {
1343
- const { t: t2 } = useTranslation();
932
+ const { t } = useTranslation();
1344
933
  return /* @__PURE__ */ jsxs("div", { children: [
1345
- /* @__PURE__ */ jsx(Typography, { textColor: "neutral600", variant: "beta", children: t2("plugin_settings.there_is_nothing_to_transfer") }),
934
+ /* @__PURE__ */ jsx(Typography, { textColor: "neutral600", variant: "beta", children: t("plugin_settings.there_is_nothing_to_transfer") }),
1346
935
  /* @__PURE__ */ jsx("br", {}),
1347
936
  /* @__PURE__ */ jsx("br", {}),
1348
- /* @__PURE__ */ jsx(Typography, { textColor: "neutral600", variant: "omega", children: t2("plugin_settings.please_check_that_you_have_entered_a_valid_collection") }),
937
+ /* @__PURE__ */ jsx(Typography, { textColor: "neutral600", variant: "omega", children: t("plugin_settings.please_check_that_you_have_entered_a_valid_collection") }),
1349
938
  /* @__PURE__ */ jsx("br", {}),
1350
939
  /* @__PURE__ */ jsxs(Flex, { marginTop: 1, alignItems: "center", children: [
1351
940
  /* @__PURE__ */ jsx(CustomBullet, {}),
@@ -1400,17 +989,17 @@ function ContentTransferSetupEmpty() {
1400
989
  ] });
1401
990
  }
1402
991
  const ContentTransferSetup = () => {
1403
- const { t: t2 } = useTranslation();
992
+ const { t } = useTranslation();
1404
993
  const [isLoading, setIsLoading] = useState(true);
1405
994
  const [showAlert, setShowAlert] = useState(false);
1406
995
  const [showModalChangedAlert, setShowModalChangedAlert] = useState(false);
1407
996
  const [, setItemsExpandedModel] = useState([]);
1408
997
  const buildItemsExpandedModel = (models) => {
1409
- const r2 = {};
998
+ const r = {};
1410
999
  getFilteredModelsSchemas(models).forEach((model, index) => {
1411
- r2[model.modelUid] = index === 0;
1000
+ r[model.modelUid] = index === 0;
1412
1001
  });
1413
- return r2;
1002
+ return r;
1414
1003
  };
1415
1004
  const [, setTreeModelsSchemas] = useState([]);
1416
1005
  const [originalFormModel, setOriginalFormModel] = useState([]);
@@ -1427,8 +1016,8 @@ const ContentTransferSetup = () => {
1427
1016
  setHasUnsavedChanges(false);
1428
1017
  setShowAlert(true);
1429
1018
  setShowModalChangedAlert(false);
1430
- } catch (e2) {
1431
- throw e2.data;
1019
+ } catch (e) {
1020
+ throw e.data;
1432
1021
  }
1433
1022
  };
1434
1023
  const onTreeItemClick = (keys2, currentValue) => {
@@ -1467,11 +1056,11 @@ const ContentTransferSetup = () => {
1467
1056
  useEffect(() => {
1468
1057
  async function fetchData() {
1469
1058
  setIsLoading(true);
1470
- const [models, localizableModels] = await Promise.all([
1059
+ const [models, localizableModels, storedContentTransferSetup] = await Promise.all([
1471
1060
  StrapiModelService.getModels(),
1472
- StrapiModelService.getLocalizableModels()
1061
+ StrapiModelService.getLocalizableModels(),
1062
+ PluginSettingsService.getContentTransferSetup()
1473
1063
  ]);
1474
- const storedContentTransferSetup = await PluginSettingsService.getContentTransferSetup();
1475
1064
  const itemsExpandedModel = buildItemsExpandedModel(localizableModels);
1476
1065
  setItemsExpandedModel(itemsExpandedModel);
1477
1066
  const allModelsTree = getModelsTree(models, models);
@@ -1491,14 +1080,14 @@ const ContentTransferSetup = () => {
1491
1080
  }
1492
1081
  fetchData();
1493
1082
  }, []);
1494
- return /* @__PURE__ */ jsxs(Fragment$1, { children: [
1083
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1495
1084
  /* @__PURE__ */ jsx(
1496
1085
  Layouts.Header,
1497
1086
  {
1498
- title: t2("plugin_settings.content_transfer_setup"),
1499
- subtitle: t2("plugin_settings.content_transfer_setup_description"),
1087
+ title: t("plugin_settings.content_transfer_setup"),
1088
+ subtitle: t("plugin_settings.content_transfer_setup_description"),
1500
1089
  primaryAction: /* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
1501
- /* @__PURE__ */ jsx(Button, { variant: "secondary", disabled: !hasUnsavedChanges, onClick: onCancelClick, children: t2("plugin_settings.cancel") }),
1090
+ /* @__PURE__ */ jsx(Button, { variant: "secondary", disabled: !hasUnsavedChanges, onClick: onCancelClick, children: t("plugin_settings.cancel") }),
1502
1091
  /* @__PURE__ */ jsx(
1503
1092
  Button,
1504
1093
  {
@@ -1507,7 +1096,7 @@ const ContentTransferSetup = () => {
1507
1096
  onClick: () => {
1508
1097
  saveContentTransferSetup(formModel);
1509
1098
  },
1510
- children: t2("plugin_settings.save")
1099
+ children: t("plugin_settings.save")
1511
1100
  }
1512
1101
  )
1513
1102
  ] }),
@@ -1519,20 +1108,20 @@ const ContentTransferSetup = () => {
1519
1108
  Alert,
1520
1109
  {
1521
1110
  onClose: () => setShowAlert(false),
1522
- closeLabel: t2("plugin_settings.close"),
1523
- title: t2("plugin_settings.content_transfer_setup_saved"),
1111
+ closeLabel: t("plugin_settings.close"),
1112
+ title: t("plugin_settings.content_transfer_setup_saved"),
1524
1113
  variant: "success",
1525
- children: t2("plugin_settings.content_transfer_setup_saved_successfully")
1114
+ children: t("plugin_settings.content_transfer_setup_saved_successfully")
1526
1115
  }
1527
1116
  ) }),
1528
1117
  !isLoading && showModalChangedAlert && /* @__PURE__ */ jsx(Box, { marginBottom: 8, children: /* @__PURE__ */ jsx(
1529
1118
  Alert,
1530
1119
  {
1531
1120
  onClose: () => setShowModalChangedAlert(false),
1532
- closeLabel: t2("plugin_settings.close"),
1533
- title: t2("plugin_settings.content_types_model_changed"),
1121
+ closeLabel: t("plugin_settings.close"),
1122
+ title: t("plugin_settings.content_types_model_changed"),
1534
1123
  variant: "default",
1535
- children: t2("plugin_settings.please_update_your_content")
1124
+ children: t("plugin_settings.please_update_your_content")
1536
1125
  }
1537
1126
  ) }),
1538
1127
  !isLoading && /* @__PURE__ */ jsxs(Box, { background: "neutral0", padding: 7, paddingTop: 6, shadow: "tableShadow", hasRadius: true, children: [
@@ -1543,11 +1132,11 @@ const ContentTransferSetup = () => {
1543
1132
  }),
1544
1133
  !!formModel.length && /* @__PURE__ */ jsxs(Box, { children: [
1545
1134
  /* @__PURE__ */ jsx(Box, { paddingTop: 6, paddingBottom: 6, children: /* @__PURE__ */ jsx(Divider, {}) }),
1546
- /* @__PURE__ */ jsx(Typography, { variant: "omega", children: t2("plugin_settings.you_can_upload_download") }),
1547
- /* @__PURE__ */ jsx(Typography, { variant: "omega", fontWeight: "semiBold", children: t2("plugin_settings.only_text_based_content") }),
1135
+ /* @__PURE__ */ jsx(Typography, { variant: "omega", children: t("plugin_settings.you_can_upload_download") }),
1136
+ /* @__PURE__ */ jsx(Typography, { variant: "omega", fontWeight: "semiBold", children: t("plugin_settings.only_text_based_content") }),
1548
1137
  /* @__PURE__ */ jsx("br", {}),
1549
1138
  /* @__PURE__ */ jsx("br", {}),
1550
- /* @__PURE__ */ jsx(Typography, { variant: "omega", children: t2("plugin_settings.learn_more_in_docs_message_a") }),
1139
+ /* @__PURE__ */ jsx(Typography, { variant: "omega", children: t("plugin_settings.learn_more_in_docs_message_a") }),
1551
1140
  /* @__PURE__ */ jsx(
1552
1141
  Typography,
1553
1142
  {
@@ -1556,7 +1145,7 @@ const ContentTransferSetup = () => {
1556
1145
  fontWeight: "semiBold",
1557
1146
  textColor: "primary600",
1558
1147
  style: { cursor: "pointer" },
1559
- children: t2("plugin_settings.learn_more_in_docs_message_b")
1148
+ children: t("plugin_settings.learn_more_in_docs_message_b")
1560
1149
  }
1561
1150
  )
1562
1151
  ] })
@@ -1564,6 +1153,10 @@ const ContentTransferSetup = () => {
1564
1153
  ] })
1565
1154
  ] });
1566
1155
  };
1156
+ const LocalazyContentTransferSetup = () => /* @__PURE__ */ jsxs(LocalazyIdentityProvider, { children: [
1157
+ /* @__PURE__ */ jsx(FetchIdentity, {}),
1158
+ /* @__PURE__ */ jsx(RequireLocalazyAuth, { children: /* @__PURE__ */ jsx(ContentTransferSetup, {}) })
1159
+ ] });
1567
1160
  export {
1568
- ContentTransferSetup
1161
+ LocalazyContentTransferSetup as default
1569
1162
  };