@payloadcms/ui 4.0.0-internal.e55ccef → 4.0.0-internal.f851106

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 (47) hide show
  1. package/dist/elements/ArrayAction/index.d.ts +2 -0
  2. package/dist/elements/ArrayAction/index.d.ts.map +1 -1
  3. package/dist/elements/ArrayAction/index.js +65 -24
  4. package/dist/elements/ArrayAction/index.js.map +1 -1
  5. package/dist/elements/ClipboardAction/clipboardUtilities.d.ts +8 -1
  6. package/dist/elements/ClipboardAction/clipboardUtilities.d.ts.map +1 -1
  7. package/dist/elements/ClipboardAction/clipboardUtilities.js +40 -8
  8. package/dist/elements/ClipboardAction/clipboardUtilities.js.map +1 -1
  9. package/dist/elements/ClipboardAction/clipboardUtilities.spec.js +120 -0
  10. package/dist/elements/ClipboardAction/clipboardUtilities.spec.js.map +1 -0
  11. package/dist/elements/ClipboardAction/index.d.ts.map +1 -1
  12. package/dist/elements/ClipboardAction/index.js +17 -1
  13. package/dist/elements/ClipboardAction/index.js.map +1 -1
  14. package/dist/elements/ClipboardAction/isClipboardDataValid.spec.js +144 -0
  15. package/dist/elements/ClipboardAction/isClipboardDataValid.spec.js.map +1 -0
  16. package/dist/elements/ClipboardAction/types.d.ts +3 -0
  17. package/dist/elements/ClipboardAction/types.d.ts.map +1 -1
  18. package/dist/elements/ClipboardAction/types.js.map +1 -1
  19. package/dist/elements/ClipboardAction/useCanPasteClipboard.d.ts +10 -0
  20. package/dist/elements/ClipboardAction/useCanPasteClipboard.d.ts.map +1 -0
  21. package/dist/elements/ClipboardAction/useCanPasteClipboard.js +21 -0
  22. package/dist/elements/ClipboardAction/useCanPasteClipboard.js.map +1 -0
  23. package/dist/exports/layouts.d.ts +0 -1
  24. package/dist/exports/layouts.d.ts.map +1 -1
  25. package/dist/exports/layouts.js +0 -1
  26. package/dist/exports/layouts.js.map +1 -1
  27. package/dist/exports/shared/index.d.ts +0 -1
  28. package/dist/exports/shared/index.d.ts.map +1 -1
  29. package/dist/exports/shared/index.js +2 -2
  30. package/dist/exports/shared/index.js.map +4 -4
  31. package/dist/fields/Array/ArrayRow.d.ts.map +1 -1
  32. package/dist/fields/Array/ArrayRow.js +97 -160
  33. package/dist/fields/Array/ArrayRow.js.map +1 -1
  34. package/dist/fields/Blocks/BlockRow.d.ts.map +1 -1
  35. package/dist/fields/Blocks/BlockRow.js +134 -195
  36. package/dist/fields/Blocks/BlockRow.js.map +1 -1
  37. package/dist/fields/Blocks/RowActions.d.ts +2 -0
  38. package/dist/fields/Blocks/RowActions.d.ts.map +1 -1
  39. package/dist/fields/Blocks/RowActions.js +23 -20
  40. package/dist/fields/Blocks/RowActions.js.map +1 -1
  41. package/dist/forms/RenderFields/index.css +16 -2
  42. package/dist/layouts/Root/viewport.d.ts +0 -1
  43. package/dist/layouts/Root/viewport.d.ts.map +1 -1
  44. package/dist/layouts/Root/viewport.js +1 -4
  45. package/dist/layouts/Root/viewport.js.map +1 -1
  46. package/dist/styles.css +1 -1
  47. package/package.json +5 -5
@@ -0,0 +1,144 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { isClipboardDataValid } from './isClipboardDataValid.js';
3
+ const textField = {
4
+ name: 'text',
5
+ type: 'text'
6
+ };
7
+ const numberField = {
8
+ name: 'num',
9
+ type: 'number'
10
+ };
11
+ const renamedTextField = {
12
+ name: 'title',
13
+ type: 'text'
14
+ };
15
+ const subArrayField = {
16
+ name: 'sub',
17
+ type: 'array',
18
+ fields: [textField]
19
+ };
20
+ const subArrayFieldMismatch = {
21
+ name: 'sub',
22
+ type: 'array',
23
+ fields: [numberField]
24
+ };
25
+ const ctaBlock = {
26
+ slug: 'cta',
27
+ fields: [textField]
28
+ };
29
+ const otherBlock = {
30
+ slug: 'other',
31
+ fields: [numberField]
32
+ };
33
+ const baseData = {
34
+ 'items.0.text': {
35
+ valid: true,
36
+ value: 'hi'
37
+ }
38
+ };
39
+ const buildArrayArgs = ({
40
+ fields,
41
+ schemaFields,
42
+ ...overrides
43
+ }) => ({
44
+ type: 'array',
45
+ data: baseData,
46
+ fieldPath: 'items',
47
+ fields,
48
+ path: 'items',
49
+ rowIndex: 0,
50
+ schemaFields,
51
+ ...overrides
52
+ });
53
+ const buildBlocksArgs = ({
54
+ blocks,
55
+ schemaBlocks
56
+ }) => ({
57
+ type: 'blocks',
58
+ blocks,
59
+ data: {
60
+ 'layout.0.blockType': {
61
+ valid: true,
62
+ value: 'cta'
63
+ }
64
+ },
65
+ fieldPath: 'layout',
66
+ path: 'layout',
67
+ rowIndex: 0,
68
+ schemaBlocks
69
+ });
70
+ describe('isClipboardDataValid', () => {
71
+ it('should return false when data is undefined', () => {
72
+ expect(isClipboardDataValid(buildArrayArgs({
73
+ data: undefined,
74
+ fields: [textField],
75
+ schemaFields: [textField]
76
+ }))).toBe(false);
77
+ });
78
+ it('should return false when path is missing', () => {
79
+ expect(isClipboardDataValid(buildArrayArgs({
80
+ fields: [textField],
81
+ path: '',
82
+ schemaFields: [textField]
83
+ }))).toBe(false);
84
+ });
85
+ describe('array fields', () => {
86
+ it('should return true for a matching schema', () => {
87
+ expect(isClipboardDataValid(buildArrayArgs({
88
+ fields: [textField],
89
+ schemaFields: [textField]
90
+ }))).toBe(true);
91
+ });
92
+ it('should return false when field types differ', () => {
93
+ expect(isClipboardDataValid(buildArrayArgs({
94
+ fields: [textField],
95
+ schemaFields: [numberField]
96
+ }))).toBe(false);
97
+ });
98
+ it('should return false when field names differ', () => {
99
+ expect(isClipboardDataValid(buildArrayArgs({
100
+ fields: [textField],
101
+ schemaFields: [renamedTextField]
102
+ }))).toBe(false);
103
+ });
104
+ it('should return false when field counts differ', () => {
105
+ expect(isClipboardDataValid(buildArrayArgs({
106
+ fields: [textField],
107
+ schemaFields: [textField, numberField]
108
+ }))).toBe(false);
109
+ });
110
+ it('should return true for matching nested sub-fields', () => {
111
+ expect(isClipboardDataValid(buildArrayArgs({
112
+ fields: [subArrayField],
113
+ schemaFields: [subArrayField]
114
+ }))).toBe(true);
115
+ });
116
+ it('should return false for mismatching nested sub-fields', () => {
117
+ expect(isClipboardDataValid(buildArrayArgs({
118
+ fields: [subArrayField],
119
+ schemaFields: [subArrayFieldMismatch]
120
+ }))).toBe(false);
121
+ });
122
+ });
123
+ describe('blocks fields', () => {
124
+ it('should return true for a matching block schema', () => {
125
+ expect(isClipboardDataValid(buildBlocksArgs({
126
+ blocks: [ctaBlock],
127
+ schemaBlocks: [ctaBlock]
128
+ }))).toBe(true);
129
+ });
130
+ it('should return false when a copied block slug is not in the target config', () => {
131
+ expect(isClipboardDataValid(buildBlocksArgs({
132
+ blocks: [ctaBlock],
133
+ schemaBlocks: [otherBlock]
134
+ }))).toBe(false);
135
+ });
136
+ it('should return false when the target has no blocks configured', () => {
137
+ expect(isClipboardDataValid(buildBlocksArgs({
138
+ blocks: [ctaBlock],
139
+ schemaBlocks: []
140
+ }))).toBe(false);
141
+ });
142
+ });
143
+ });
144
+ //# sourceMappingURL=isClipboardDataValid.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isClipboardDataValid.spec.js","names":["describe","expect","it","isClipboardDataValid","textField","name","type","numberField","renamedTextField","subArrayField","fields","subArrayFieldMismatch","ctaBlock","slug","otherBlock","baseData","valid","value","buildArrayArgs","schemaFields","overrides","data","fieldPath","path","rowIndex","buildBlocksArgs","blocks","schemaBlocks","undefined","toBe"],"sources":["../../../src/elements/ClipboardAction/isClipboardDataValid.spec.ts"],"sourcesContent":["import type { ClientBlock, ClientField } from 'payload'\n\nimport { describe, expect, it } from 'vitest'\n\nimport type { ClipboardPasteActionValidateArgs, ClipboardPasteData } from './types.js'\n\nimport { isClipboardDataValid } from './isClipboardDataValid.js'\n\nconst textField = { name: 'text', type: 'text' } as ClientField\nconst numberField = { name: 'num', type: 'number' } as ClientField\nconst renamedTextField = { name: 'title', type: 'text' } as ClientField\n\nconst subArrayField = { name: 'sub', type: 'array', fields: [textField] } as ClientField\nconst subArrayFieldMismatch = { name: 'sub', type: 'array', fields: [numberField] } as ClientField\n\nconst ctaBlock = { slug: 'cta', fields: [textField] } as ClientBlock\nconst otherBlock = { slug: 'other', fields: [numberField] } as ClientBlock\n\nconst baseData: ClipboardPasteData['data'] = { 'items.0.text': { valid: true, value: 'hi' } }\n\nconst buildArrayArgs = ({\n fields,\n schemaFields,\n ...overrides\n}: {\n fields: ClientField[]\n schemaFields: ClientField[]\n} & Partial<ClipboardPasteActionValidateArgs>): ClipboardPasteActionValidateArgs =>\n ({\n type: 'array',\n data: baseData,\n fieldPath: 'items',\n fields,\n path: 'items',\n rowIndex: 0,\n schemaFields,\n ...overrides,\n }) as ClipboardPasteActionValidateArgs\n\nconst buildBlocksArgs = ({\n blocks,\n schemaBlocks,\n}: {\n blocks: ClientBlock[]\n schemaBlocks: ClientBlock[]\n}): ClipboardPasteActionValidateArgs =>\n ({\n type: 'blocks',\n blocks,\n data: { 'layout.0.blockType': { valid: true, value: 'cta' } },\n fieldPath: 'layout',\n path: 'layout',\n rowIndex: 0,\n schemaBlocks,\n }) as ClipboardPasteActionValidateArgs\n\ndescribe('isClipboardDataValid', () => {\n it('should return false when data is undefined', () => {\n expect(\n isClipboardDataValid(\n buildArrayArgs({ data: undefined, fields: [textField], schemaFields: [textField] }),\n ),\n ).toBe(false)\n })\n\n it('should return false when path is missing', () => {\n expect(\n isClipboardDataValid(\n buildArrayArgs({ fields: [textField], path: '', schemaFields: [textField] }),\n ),\n ).toBe(false)\n })\n\n describe('array fields', () => {\n it('should return true for a matching schema', () => {\n expect(\n isClipboardDataValid(buildArrayArgs({ fields: [textField], schemaFields: [textField] })),\n ).toBe(true)\n })\n\n it('should return false when field types differ', () => {\n expect(\n isClipboardDataValid(buildArrayArgs({ fields: [textField], schemaFields: [numberField] })),\n ).toBe(false)\n })\n\n it('should return false when field names differ', () => {\n expect(\n isClipboardDataValid(\n buildArrayArgs({ fields: [textField], schemaFields: [renamedTextField] }),\n ),\n ).toBe(false)\n })\n\n it('should return false when field counts differ', () => {\n expect(\n isClipboardDataValid(\n buildArrayArgs({ fields: [textField], schemaFields: [textField, numberField] }),\n ),\n ).toBe(false)\n })\n\n it('should return true for matching nested sub-fields', () => {\n expect(\n isClipboardDataValid(\n buildArrayArgs({ fields: [subArrayField], schemaFields: [subArrayField] }),\n ),\n ).toBe(true)\n })\n\n it('should return false for mismatching nested sub-fields', () => {\n expect(\n isClipboardDataValid(\n buildArrayArgs({ fields: [subArrayField], schemaFields: [subArrayFieldMismatch] }),\n ),\n ).toBe(false)\n })\n })\n\n describe('blocks fields', () => {\n it('should return true for a matching block schema', () => {\n expect(\n isClipboardDataValid(buildBlocksArgs({ blocks: [ctaBlock], schemaBlocks: [ctaBlock] })),\n ).toBe(true)\n })\n\n it('should return false when a copied block slug is not in the target config', () => {\n expect(\n isClipboardDataValid(buildBlocksArgs({ blocks: [ctaBlock], schemaBlocks: [otherBlock] })),\n ).toBe(false)\n })\n\n it('should return false when the target has no blocks configured', () => {\n expect(isClipboardDataValid(buildBlocksArgs({ blocks: [ctaBlock], schemaBlocks: [] }))).toBe(\n false,\n )\n })\n })\n})\n"],"mappings":"AAEA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,EAAE,QAAQ;AAIrC,SAASC,oBAAoB,QAAQ;AAErC,MAAMC,SAAA,GAAY;EAAEC,IAAA,EAAM;EAAQC,IAAA,EAAM;AAAO;AAC/C,MAAMC,WAAA,GAAc;EAAEF,IAAA,EAAM;EAAOC,IAAA,EAAM;AAAS;AAClD,MAAME,gBAAA,GAAmB;EAAEH,IAAA,EAAM;EAASC,IAAA,EAAM;AAAO;AAEvD,MAAMG,aAAA,GAAgB;EAAEJ,IAAA,EAAM;EAAOC,IAAA,EAAM;EAASI,MAAA,EAAQ,CAACN,SAAA;AAAW;AACxE,MAAMO,qBAAA,GAAwB;EAAEN,IAAA,EAAM;EAAOC,IAAA,EAAM;EAASI,MAAA,EAAQ,CAACH,WAAA;AAAa;AAElF,MAAMK,QAAA,GAAW;EAAEC,IAAA,EAAM;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4E;MAC7ED,MAAA,CACEE,oBAAA,CAAqBsB,eAAA,CAAgB;QAAEC,MAAA,EAAQ,CAACd,QAAA,CAAS;QAAEe,YAAA,EAAc,CAACb,UAAA;MAAY,KACtFe,IAAI,CAAC;IACT;IAEA3B,EAAA,CAAG,gEAAgE;MACjED,MAAA,CAAOE,oBAAA,CAAqBsB,eAAA,CAAgB;QAAEC,MAAA,EAAQ,CAACd,QAAA,CAAS;QAAEe,YAAA,EAAc;MAAG,KAAKE,IAAI,CAC1F;IAEJ;EACF;AACF","ignoreList":[]}
@@ -42,4 +42,7 @@ export type ClipboardPasteActionValidateArgs = {
42
42
  schemaFields: ClientField[];
43
43
  type: 'array';
44
44
  }) & ClipboardPasteData;
45
+ export type ClipboardPasteEligibilityArgs = {
46
+ path: string;
47
+ } & (ClipboardCopyBlocksSchema | ClipboardCopyFieldsSchema);
45
48
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/elements/ClipboardAction/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAA;AAEnF,MAAM,MAAM,yBAAyB,GAAG;IACtC,YAAY,EAAE,WAAW,EAAE,CAAA;CAC5B,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,MAAM,EAAE,WAAW,EAAE,CAAA;IACrB,IAAI,EAAE,QAAQ,CAAA;CACf,CAAA;AAED,MAAM,MAAM,yBAAyB,GAAG;IACtC,YAAY,EAAE,WAAW,EAAE,CAAA;CAC5B,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,MAAM,EAAE,WAAW,EAAE,CAAA;IACrB,IAAI,EAAE,OAAO,CAAA;CACd,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,M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AAA;CACd,CACJ,GACC,kBAAkB,CAAA;AAEpB,MAAM,MAAM,6BAA6B,GAAG;IAC1C,IAAI,EAAE,MAAM,CAAA;CACb,GAAG,CAAC,yBAAyB,GAAG,yBAAyB,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../../src/elements/ClipboardAction/types.ts"],"sourcesContent":["import type { TFunction } from '@payloadcms/translations'\nimport type { ClientBlock, ClientField, FormStateWithoutComponents } from 'payload'\n\nexport type ClipboardCopyBlocksSchema = {\n schemaBlocks: ClientBlock[]\n}\n\nexport type ClipboardCopyBlocksData = {\n blocks: ClientBlock[]\n type: 'blocks'\n}\n\nexport type ClipboardCopyFieldsSchema = {\n schemaFields: ClientField[]\n}\n\nexport type ClipboardCopyFieldsData = {\n fields: ClientField[]\n type: 'array'\n}\n\nexport type ClipboardCopyData = {\n path: string\n rowIndex?: number\n} & (ClipboardCopyBlocksData | ClipboardCopyFieldsData)\n\nexport type ClipboardCopyActionArgs = {\n getDataToCopy: () => FormStateWithoutComponents\n t: TFunction\n} & ClipboardCopyData\n\nexport type ClipboardPasteData = {\n data: FormStateWithoutComponents\n path: string\n rowIndex?: number\n} & (ClipboardCopyBlocksData | ClipboardCopyFieldsData)\n\nexport type OnPasteFn = (data: ClipboardPasteData) => void\n\nexport type ClipboardPasteActionArgs = {\n onPaste: OnPasteFn\n path: string\n t: TFunction\n} & (ClipboardCopyBlocksSchema | ClipboardCopyFieldsSchema)\n\nexport type ClipboardPasteActionValidateArgs = {\n fieldPath: string\n} & (\n | {\n schemaBlocks: ClientBlock[]\n type: 'blocks'\n }\n | {\n schemaFields: ClientField[]\n type: 'array'\n }\n) &\n ClipboardPasteData\n"],"mappings":"AA6CA","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../src/elements/ClipboardAction/types.ts"],"sourcesContent":["import type { TFunction } from '@payloadcms/translations'\nimport type { ClientBlock, ClientField, FormStateWithoutComponents } from 'payload'\n\nexport type ClipboardCopyBlocksSchema = {\n schemaBlocks: ClientBlock[]\n}\n\nexport type ClipboardCopyBlocksData = {\n blocks: ClientBlock[]\n type: 'blocks'\n}\n\nexport type ClipboardCopyFieldsSchema = {\n schemaFields: ClientField[]\n}\n\nexport type ClipboardCopyFieldsData = {\n fields: ClientField[]\n type: 'array'\n}\n\nexport type ClipboardCopyData = {\n path: string\n rowIndex?: number\n} & (ClipboardCopyBlocksData | ClipboardCopyFieldsData)\n\nexport type ClipboardCopyActionArgs = {\n getDataToCopy: () => FormStateWithoutComponents\n t: TFunction\n} & ClipboardCopyData\n\nexport type ClipboardPasteData = {\n data: FormStateWithoutComponents\n path: string\n rowIndex?: number\n} & (ClipboardCopyBlocksData | ClipboardCopyFieldsData)\n\nexport type OnPasteFn = (data: ClipboardPasteData) => void\n\nexport type ClipboardPasteActionArgs = {\n onPaste: OnPasteFn\n path: string\n t: TFunction\n} & (ClipboardCopyBlocksSchema | ClipboardCopyFieldsSchema)\n\nexport type ClipboardPasteActionValidateArgs = {\n fieldPath: string\n} & (\n | {\n schemaBlocks: ClientBlock[]\n type: 'blocks'\n }\n | {\n schemaFields: ClientField[]\n type: 'array'\n }\n) &\n ClipboardPasteData\n\nexport type ClipboardPasteEligibilityArgs = {\n path: string\n} & (ClipboardCopyBlocksSchema | ClipboardCopyFieldsSchema)\n"],"mappings":"AA2DA","ignoreList":[]}
@@ -0,0 +1,10 @@
1
+ import type { ClipboardPasteEligibilityArgs } from './types.js';
2
+ /**
3
+ * Tracks whether the clipboard contents can be pasted into the target field.
4
+ * Call `refresh` when a paste menu opens to re-check against the field's schema.
5
+ */
6
+ export declare function useCanPasteClipboard(args: ClipboardPasteEligibilityArgs): {
7
+ canPaste: boolean;
8
+ refresh: () => void;
9
+ };
10
+ //# sourceMappingURL=useCanPasteClipboard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCanPasteClipboard.d.ts","sourceRoot":"","sources":["../../../src/elements/ClipboardAction/useCanPasteClipboard.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAA;AAI/D;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,6BAA6B,GAAG;IACzE,QAAQ,EAAE,OAAO,CAAA;IACjB,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB,CAWA"}
@@ -0,0 +1,21 @@
1
+ 'use client';
2
+
3
+ import { useCallback, useRef, useState } from 'react';
4
+ import { canPasteClipboardData } from './clipboardUtilities.js';
5
+ /**
6
+ * Tracks whether the clipboard contents can be pasted into the target field.
7
+ * Call `refresh` when a paste menu opens to re-check against the field's schema.
8
+ */
9
+ export function useCanPasteClipboard(args) {
10
+ const [canPaste, setCanPaste] = useState(false);
11
+ const argsRef = useRef(args);
12
+ argsRef.current = args;
13
+ const refresh = useCallback(() => {
14
+ setCanPaste(canPasteClipboardData(argsRef.current));
15
+ }, []);
16
+ return {
17
+ canPaste,
18
+ refresh
19
+ };
20
+ }
21
+ //# sourceMappingURL=useCanPasteClipboard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useCanPasteClipboard.js","names":["useCallback","useRef","useState","canPasteClipboardData","useCanPasteClipboard","args","canPaste","setCanPaste","argsRef","current","refresh"],"sources":["../../../src/elements/ClipboardAction/useCanPasteClipboard.ts"],"sourcesContent":["'use client'\nimport { useCallback, useRef, useState } from 'react'\n\nimport type { ClipboardPasteEligibilityArgs } from './types.js'\n\nimport { canPasteClipboardData } from './clipboardUtilities.js'\n\n/**\n * Tracks whether the clipboard contents can be pasted into the target field.\n * Call `refresh` when a paste menu opens to re-check against the field's schema.\n */\nexport function useCanPasteClipboard(args: ClipboardPasteEligibilityArgs): {\n canPaste: boolean\n refresh: () => void\n} {\n const [canPaste, setCanPaste] = useState<boolean>(false)\n\n const argsRef = useRef(args)\n argsRef.current = args\n\n const refresh = useCallback(() => {\n setCanPaste(canPasteClipboardData(argsRef.current))\n }, [])\n\n return { canPaste, refresh }\n}\n"],"mappings":"AAAA;;AACA,SAASA,WAAW,EAAEC,MAAM,EAAEC,QAAQ,QAAQ;AAI9C,SAASC,qBAAqB,QAAQ;AAEtC;;;;AAIA,OAAO,SAASC,qBAAqBC,IAAmC;EAItE,MAAM,CAACC,QAAA,EAAUC,WAAA,CAAY,GAAGL,QAAA,CAAkB;EAElD,MAAMM,OAAA,GAAUP,MAAA,CAAOI,IAAA;EACvBG,OAAA,CAAQC,OAAO,GAAGJ,IAAA;EAElB,MAAMK,OAAA,GAAUV,WAAA,CAAY;IAC1BO,WAAA,CAAYJ,qBAAA,CAAsBK,OAAA,CAAQC,OAAO;EACnD,GAAG,EAAE;EAEL,OAAO;IAAEH,QAAA;IAAUI;EAAQ;AAC7B","ignoreList":[]}
@@ -1,3 +1,2 @@
1
1
  export { metadata, RootLayout } from '../layouts/Root/index.js';
2
- export { getViewportContent, getViewportMeta, isIPhoneUserAgent } from '../layouts/Root/viewport.js';
3
2
  //# sourceMappingURL=layouts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"layouts.d.ts","sourceRoot":"","sources":["../../src/exports/layouts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAC/D,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA"}
1
+ {"version":3,"file":"layouts.d.ts","sourceRoot":"","sources":["../../src/exports/layouts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA"}
@@ -1,3 +1,2 @@
1
1
  export { metadata, RootLayout } from '../layouts/Root/index.js';
2
- export { getViewportContent, getViewportMeta, isIPhoneUserAgent } from '../layouts/Root/viewport.js';
3
2
  //# sourceMappingURL=layouts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"layouts.js","names":["metadata","RootLayout","getViewportContent","getViewportMeta","isIPhoneUserAgent"],"sources":["../../src/exports/layouts.ts"],"sourcesContent":["export { metadata, RootLayout } from '../layouts/Root/index.js'\nexport { getViewportContent, getViewportMeta, isIPhoneUserAgent } from '../layouts/Root/viewport.js'\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,UAAU,QAAQ;AACrC,SAASC,kBAAkB,EAAEC,eAAe,EAAEC,iBAAiB,QAAQ","ignoreList":[]}
1
+ {"version":3,"file":"layouts.js","names":["metadata","RootLayout"],"sources":["../../src/exports/layouts.ts"],"sourcesContent":["export { metadata, RootLayout } from '../layouts/Root/index.js'\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,UAAU,QAAQ","ignoreList":[]}
@@ -5,7 +5,6 @@ export { mergeFieldStyles } from '../../fields/mergeFieldStyles.js';
5
5
  export { reduceToSerializableFields } from '../../forms/Form/reduceToSerializableFields.js';
6
6
  export { PayloadIcon } from '../../graphics/Icon/index.js';
7
7
  export { PayloadLogo } from '../../graphics/Logo/index.js';
8
- export { getViewportContent, getViewportMeta, isIPhoneUserAgent, } from '../../layouts/Root/viewport.js';
9
8
  export { filterFields } from '../../providers/TableColumns/buildColumnState/filterFields.js';
10
9
  export { getInitialColumns } from '../../providers/TableColumns/getInitialColumns.js';
11
10
  export { abortAndIgnore, handleAbortRef } from '../../utilities/abortAndIgnore.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exports/shared/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAA;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAA;AACzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAA;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AACnE,OAAO,EAAE,0BAA0B,EAAE,MAAM,gDAAgD,CAAA;AAC3F,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAC1D,OAAO,EAAE,WAAW,EAA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O,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAC1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,+CAA+C,CAAA"}
@@ -1,6 +1,6 @@
1
- import{jsx as g}from"react/jsx-runtime";import"react";var v=({elements:e,translationString:t})=>{let r=/(<[^>]+>.*?<\/[^>]+>)/g,o=t.split(r);return g("span",{children:o.map((n,s)=>{if(e&&n.startsWith("<")&&n.endsWith(">")){let i=n[1],a=e[i];if(a){let l=new RegExp(`<${i}>(.*?)</${i}>`,"g"),p=n.replace(l,(u,f)=>f);return g(a,{children:g(v,{translationString:p})},s)}}return n})})},$=({elements:e,i18nKey:t,t:r,variables:o})=>{let n=r(t,o||{});return e?g(v,{elements:e,translationString:n}):n};import{jsx as W}from"react/jsx-runtime";import{isReactServerComponentOrFunction as G,serverProps as K}from"payload/shared";import"react";function Y({Component:e,sanitizeServerOnlyProps:t,toMergeIntoProps:r}){return t===void 0&&(t=!G(e)),n=>{let s=q(n,r);return t&&K.forEach(i=>{delete s[i]}),W(e,{...s})}}function q(e,t){return{...e,...t}}import{jsx as Q}from"react/jsx-runtime";import{isReactServerComponentOrFunction as J}from"payload/shared";import"react";var X=({Component:e,serverOnlyProps:t,...r})=>e?(n=>{let s={...n,...J(e)?t??{}:{}};return Q(e,{...s})})(r):null;var ee=e=>({...e?.admin?.style||{},...e?.admin?.width?{"--field-width":e.admin.width}:{flex:"1 1 0%"},...e?.admin?.style?.flex?{flex:e.admin.style.flex}:{}});var te=["validate","customComponents"],re=e=>{let t={...e};for(let r of te)delete t[r];return t},oe=e=>{let t={};for(let r in e)t[r]=re(e[r]);return t};import{jsx as H,jsxs as ne}from"react/jsx-runtime";import"react";var se=({fill:e})=>{let t=e||"var(--color-icon)";return ne("svg",{className:"graphic-icon",height:"100%",viewBox:"0 0 25 25",width:"100%",xmlns:"http://www.w3.org/2000/svg",children:[H("path",{d:"M11.8673 21.2336L4.40922 16.9845C4.31871 16.9309 4.25837 16.8355 4.25837 16.7282V10.1609C4.25837 10.0477 4.38508 9.97616 4.48162 10.0298L13.1404 14.9642C13.2611 15.0358 13.412 14.9464 13.412 14.8093V11.6091C13.412 11.4839 13.3456 11.3647 13.2309 11.2992L2.81624 5.36353C2.72573 5.30989 2.60505 5.30989 2.51454 5.36353L1.15085 6.14422C1.06034 6.19786 1 6.29321 1 6.40048V18.5995C1 18.7068 1.06034 18.8021 1.15085 18.8558L11.8491 24.9583C11.9397 25.0119 12.0603 25.0119 12.1509 24.9583L21.1355 19.8331C21.2562 19.7616 21.2562 19.5948 21.1355 19.5232L18.3357 17.9261C18.2211 17.8605 18.0883 17.8605 17.9737 17.9261L12.175 21.2336C12.0845 21.2872 11.9638 21.2872 11.8733 21.2336H11.8673Z",fill:t}),H("path",{d:"M22.8491 6.13827L12.1508 0.0417218C12.0603 -0.0119135 11.9397 -0.0119135 11.8491 0.0417218L6.19528 3.2658C6.0746 3.33731 6.0746 3.50418 6.19528 3.57569L8.97092 5.16091C9.08557 5.22647 9.21832 5.22647 9.33296 5.16091L11.8672 3.71872C11.9578 3.66508 12.0784 3.66508 12.1689 3.71872L19.627 7.96782C19.7175 8.02146 19.7778 8.11681 19.7778 8.22408V14.8212C19.7778 14.9464 19.8442 15.0656 19.9589 15.1311L22.7345 16.7104C22.8552 16.7819 23.006 16.6925 23.006 16.5554V6.40048C23.006 6.29321 22.9457 6.19786 22.8552 6.14423L22.8491 6.13827Z",fill:t})]})};import{jsx as c,jsxs as F}from"react/jsx-runtime";import"react";var ie=`
1
+ import{jsx as g}from"react/jsx-runtime";import"react";var v=({elements:e,translationString:t})=>{let r=/(<[^>]+>.*?<\/[^>]+>)/g,o=t.split(r);return g("span",{children:o.map((n,s)=>{if(e&&n.startsWith("<")&&n.endsWith(">")){let i=n[1],l=e[i];if(l){let a=new RegExp(`<${i}>(.*?)</${i}>`,"g"),p=n.replace(a,(u,f)=>f);return g(l,{children:g(v,{translationString:p})},s)}}return n})})},I=({elements:e,i18nKey:t,t:r,variables:o})=>{let n=r(t,o||{});return e?g(v,{elements:e,translationString:n}):n};import{jsx as B}from"react/jsx-runtime";import{isReactServerComponentOrFunction as _,serverProps as $}from"payload/shared";import"react";function W({Component:e,sanitizeServerOnlyProps:t,toMergeIntoProps:r}){return t===void 0&&(t=!_(e)),n=>{let s=G(n,r);return t&&$.forEach(i=>{delete s[i]}),B(e,{...s})}}function G(e,t){return{...e,...t}}import{jsx as K}from"react/jsx-runtime";import{isReactServerComponentOrFunction as Y}from"payload/shared";import"react";var q=({Component:e,serverOnlyProps:t,...r})=>e?(n=>{let s={...n,...Y(e)?t??{}:{}};return K(e,{...s})})(r):null;var Q=e=>({...e?.admin?.style||{},...e?.admin?.width?{"--field-width":e.admin.width}:{flex:"1 1 0%"},...e?.admin?.style?.flex?{flex:e.admin.style.flex}:{}});var J=["validate","customComponents"],X=e=>{let t={...e};for(let r of J)delete t[r];return t},ee=e=>{let t={};for(let r in e)t[r]=X(e[r]);return t};import{jsx as H,jsxs as te}from"react/jsx-runtime";import"react";var re=({fill:e})=>{let t=e||"var(--color-icon)";return te("svg",{className:"graphic-icon",height:"100%",viewBox:"0 0 25 25",width:"100%",xmlns:"http://www.w3.org/2000/svg",children:[H("path",{d:"M11.8673 21.2336L4.40922 16.9845C4.31871 16.9309 4.25837 16.8355 4.25837 16.7282V10.1609C4.25837 10.0477 4.38508 9.97616 4.48162 10.0298L13.1404 14.9642C13.2611 15.0358 13.412 14.9464 13.412 14.8093V11.6091C13.412 11.4839 13.3456 11.3647 13.2309 11.2992L2.81624 5.36353C2.72573 5.30989 2.60505 5.30989 2.51454 5.36353L1.15085 6.14422C1.06034 6.19786 1 6.29321 1 6.40048V18.5995C1 18.7068 1.06034 18.8021 1.15085 18.8558L11.8491 24.9583C11.9397 25.0119 12.0603 25.0119 12.1509 24.9583L21.1355 19.8331C21.2562 19.7616 21.2562 19.5948 21.1355 19.5232L18.3357 17.9261C18.2211 17.8605 18.0883 17.8605 17.9737 17.9261L12.175 21.2336C12.0845 21.2872 11.9638 21.2872 11.8733 21.2336H11.8673Z",fill:t}),H("path",{d:"M22.8491 6.13827L12.1508 0.0417218C12.0603 -0.0119135 11.9397 -0.0119135 11.8491 0.0417218L6.19528 3.2658C6.0746 3.33731 6.0746 3.50418 6.19528 3.57569L8.97092 5.16091C9.08557 5.22647 9.21832 5.22647 9.33296 5.16091L11.8672 3.71872C11.9578 3.66508 12.0784 3.66508 12.1689 3.71872L19.627 7.96782C19.7175 8.02146 19.7778 8.11681 19.7778 8.22408V14.8212C19.7778 14.9464 19.8442 15.0656 19.9589 15.1311L22.7345 16.7104C22.8552 16.7819 23.006 16.6925 23.006 16.5554V6.40048C23.006 6.29321 22.9457 6.19786 22.8552 6.14423L22.8491 6.13827Z",fill:t})]})};import{jsx as c,jsxs as F}from"react/jsx-runtime";import"react";var oe=`
2
2
  .graphic-logo path {
3
3
  fill: var(--color-text);
4
4
  }
5
- `,ae=()=>F("svg",{className:"graphic-logo",fill:"none",height:"32",viewBox:"0 0 143 32",width:"143",xmlns:"http://www.w3.org/2000/svg",children:[c("style",{children:ie}),F("g",{clipPath:"url(#payload-logo-clip)",children:[c("path",{d:"M13.2487 26.2108L4.15632 20.9658C4.04598 20.8996 3.97241 20.7819 3.97241 20.6494V12.5428C3.97241 12.403 4.1269 12.3147 4.2446 12.3809L14.8009 18.472C14.948 18.5603 15.132 18.4499 15.132 18.2807V14.3304C15.132 14.1759 15.051 14.0288 14.9113 13.9478L2.21425 6.62094C2.10391 6.55474 1.95678 6.55474 1.84644 6.62094L0.183908 7.58462C0.0735632 7.65083 0 7.76853 0 7.90094V22.9593C0 23.0917 0.0735632 23.2094 0.183908 23.2757L13.2267 30.8085C13.337 30.8747 13.4841 30.8747 13.5945 30.8085L24.548 24.4821C24.6952 24.3938 24.6952 24.1878 24.548 24.0996L21.1347 22.1281C20.9949 22.0472 20.8331 22.0472 20.6933 22.1281L13.6239 26.2108C13.5136 26.277 13.3664 26.277 13.2561 26.2108H13.2487Z"}),c("path",{d:"M26.6372 7.57713L13.5945 0.0516083C13.4841 -0.0145986 13.337 -0.0145986 13.2267 0.0516083L6.33379 4.03138C6.18667 4.11965 6.18667 4.32563 6.33379 4.41391L9.7177 6.37069C9.85747 6.45161 10.0193 6.45161 10.1591 6.37069L13.2487 4.59046C13.3591 4.52425 13.5062 4.52425 13.6166 4.59046L22.709 9.83552C22.8193 9.90172 22.8929 10.0194 22.8929 10.1518V18.2953C22.8929 18.4498 22.9738 18.5969 23.1136 18.6778L26.4975 20.6272C26.6446 20.7155 26.8285 20.6052 26.8285 20.436V7.9008C26.8285 7.76839 26.7549 7.65069 26.6446 7.58448L26.6372 7.57713Z"}),c("path",{d:"M142.257 6.96619C142.257 8.39332 141.168 9.40849 139.829 9.40849C138.49 9.40849 137.394 8.38596 137.394 6.96619C137.394 5.54642 138.49 4.53125 139.829 4.53125C141.168 4.53125 142.257 5.55378 142.257 6.96619ZM141.918 6.96619C141.918 5.73033 140.991 4.84757 139.829 4.84757C138.667 4.84757 137.74 5.73033 137.74 6.96619C137.74 8.20205 138.667 9.09217 139.829 9.09217C140.991 9.09217 141.918 8.20941 141.918 6.96619ZM138.806 8.21677V5.6347H139.991C140.616 5.6347 140.984 5.9216 140.984 6.48068C140.984 6.87056 140.763 7.11332 140.491 7.23102L141.072 8.22412H140.417L139.888 7.32665H139.417V8.22412H138.814L138.806 8.21677ZM139.903 6.84849C140.241 6.84849 140.373 6.73079 140.373 6.48068C140.373 6.23056 140.234 6.12022 139.903 6.12022H139.41V6.84849H139.903Z"}),c("path",{d:"M40.2538 18.2731V26.3135H36.2814V4.4873H45.3002C50.4644 4.4873 53.4657 6.84133 53.4657 11.3949C53.4657 15.9485 50.4717 18.2731 45.3296 18.2731H40.2538ZM44.9618 15.0951C47.9559 15.0951 49.4565 13.874 49.4565 11.3949C49.4565 8.91581 47.9559 7.69466 44.9618 7.69466H40.2538V15.0951H44.9618Z"}),c("path",{d:"M63.2202 23.8712C62.4846 25.6441 60.5278 26.6519 58.0561 26.6519C55.0326 26.6519 52.8257 24.9673 52.8257 22.1572C52.8257 19.0381 55.268 17.7581 58.4239 17.3903L63.0731 16.868V16.1324C63.0731 14.2344 61.9108 13.3223 60.1379 13.3223C58.3651 13.3223 57.3867 14.2712 57.2616 15.7057H53.5025C53.8409 12.3733 56.4377 10.4165 60.2556 10.4165C64.4782 10.4165 66.891 12.4027 66.891 16.4413V22.4367C66.891 23.8712 66.9499 25.0703 67.2 26.3209H63.4409C63.2864 25.4675 63.2276 24.6363 63.2276 23.8786L63.2202 23.8712ZM63.0658 20.2887V19.3397L59.6083 19.737C57.9605 19.9503 56.7025 20.3181 56.7025 21.9365C56.7025 23.1577 57.5559 23.9227 59.1154 23.9227C61.131 23.9227 63.0584 22.731 63.0584 20.2813L63.0658 20.2887Z"}),c("path",{d:"M66.4938 10.7842H70.4662L74.777 22.4954H74.8358L78.9333 10.7842H82.8175L76.7632 26.5929C75.2919 30.4771 73.4896 31.9777 70.2234 32.0072C69.7011 32.0072 68.9729 31.9483 68.4211 31.8527V28.8881C68.8772 28.9837 69.1273 28.9837 69.4584 28.9837C71.0473 28.9837 71.7168 28.432 72.548 26.2913L66.4938 10.7915V10.7842Z"}),c("path",{d:"M83.4648 26.3135V4.4873H87.3784V26.3135H83.4648Z"}),c("path",{d:"M96.2133 26.6813C91.6303 26.6813 88.3568 23.5916 88.3568 18.5526C88.3568 13.5135 91.6303 10.4238 96.2133 10.4238C100.796 10.4238 104.07 13.5429 104.07 18.5526C104.07 23.5622 100.796 26.6813 96.2133 26.6813ZM96.2133 23.7756C98.7218 23.7756 100.156 21.8188 100.156 18.5452C100.156 15.2716 98.7218 13.3149 96.2133 13.3149C93.7048 13.3149 92.2703 15.3011 92.2703 18.5452C92.2703 21.7893 93.6754 23.7756 96.2133 23.7756Z"}),c("path",{d:"M114.898 23.8712C114.163 25.6441 112.206 26.6519 109.734 26.6519C106.711 26.6519 104.504 24.9673 104.504 22.1572C104.504 19.0381 106.946 17.7581 110.102 17.3903L114.751 16.868V16.1324C114.751 14.2344 113.589 13.3223 111.816 13.3223C110.043 13.3223 109.065 14.2712 108.94 15.7057H105.181C105.519 12.3733 108.116 10.4165 111.941 10.4165C116.164 10.4165 118.577 12.4027 118.577 16.4413V22.4367C118.577 23.8712 118.635 25.0703 118.886 26.3209H115.126C114.972 25.4675 114.913 24.6363 114.913 23.8786L114.898 23.8712ZM114.744 20.2887V19.3397L111.286 19.737C109.639 19.9503 108.381 20.3181 108.381 21.9365C108.381 23.1577 109.234 23.9227 110.794 23.9227C112.809 23.9227 114.737 22.731 114.737 20.2813L114.744 20.2887Z"}),c("path",{d:"M131.31 23.8418C130.545 25.4013 128.677 26.6887 126.323 26.6887C122.255 26.6887 119.474 23.3857 119.474 18.5599C119.474 13.7342 122.255 10.4312 126.323 10.4312C128.736 10.4312 130.509 11.7774 131.244 13.337V4.4873H135.158V26.3135H131.303V23.8344L131.31 23.8418ZM131.347 18.2731C131.347 15.2496 129.913 13.2855 127.434 13.2855C124.954 13.2855 123.424 15.3673 123.424 18.5452C123.424 21.7232 124.896 23.805 127.434 23.805C129.971 23.805 131.347 21.8482 131.347 18.8174V18.2657V18.2731Z"})]}),c("defs",{children:c("clipPath",{id:"payload-logo-clip",children:c("rect",{fill:"white",height:"32",width:"142.257"})})})]});import{jsx as le}from"react/jsx-runtime";import"react";var U=e=>/\biPhone\b/.test(e??""),k="width=device-width, initial-scale=1",O=e=>U(e)?`${k}, maximum-scale=1`:k,ce=e=>{let t=O(e);return le("meta",{content:t,name:"viewport"})};import{fieldIsHiddenOrDisabled as fe,fieldIsID as ue,isFieldDisabled as pe}from"payload/shared";var D=e=>{let t=r=>r.type!=="ui"&&fe(r)&&!ue(r)||pe(r,"column");return(e??[]).reduce((r,o)=>{if(t(o))return r;if(o.type==="tabs"&&"tabs"in o){let n={...o,tabs:o.tabs.map(s=>({...s,fields:D(s.fields)}))};return r.push(n),r}if("fields"in o&&Array.isArray(o.fields)){let n={...o,fields:D(o.fields)};return r.push(n),r}return r.push(o),r},[])};import{fieldAffectsData as j}from"payload/shared";var b=(e,t)=>e?.reduce((r,o)=>j(o)&&o.name===t?r:!j(o)&&"fields"in o?[...r,...b(o.fields,t)]:o.type==="tabs"&&"tabs"in o?[...r,...o.tabs.reduce((n,s)=>[...n,..."name"in s?[s.name]:b(s.fields,t)],[])]:[...r,o.name],[]),me=(e,t,r)=>{let o=[];if(Array.isArray(r)&&r.length>=1)o=r;else{t&&o.push(t);let n=b(e,t);o=o.concat(n),o=o.slice(0,4)}return o.map(n=>({accessor:n,active:!0}))};function de(e){if(e)try{e.abort()}catch{}}function he(e){let t=new AbortController;if(e.current)try{e.current.abort()}catch{}return e.current=t,t}import*as N from"qs-esm";var ge={delete:(e,t={headers:{}})=>{let r=t&&t.headers?{...t.headers}:{},o={...t,credentials:"include",headers:{...r},method:"delete"};return fetch(e,o)},get:(e,t={headers:{}})=>{let r="";return t.params&&(r=N.stringify(t.params,{addQueryPrefix:!0})),fetch(`${e}${r}`,{credentials:"include",...t})},patch:(e,t={headers:{}})=>{let r=t&&t.headers?{...t.headers}:{},o={...t,credentials:"include",headers:{...r},method:"PATCH"};return fetch(e,o)},post:(e,t={headers:{}})=>{let r=t&&t.headers?{...t.headers}:{},o={...t,credentials:"include",headers:{...r},method:"post"};return fetch(`${e}`,o)},put:(e,t={headers:{}})=>{let r=t&&t.headers?{...t.headers}:{},o={...t,credentials:"include",headers:{...r},method:"put"};return fetch(e,o)}};var Ce=(e,t)=>!e?.locales||e.locales.length===0?null:e.locales.find(r=>r?.code===t);var ye={},h={};function d(e,t){try{let o=(ye[e]||=new Intl.DateTimeFormat("en-GB",{timeZone:e,hour:"numeric",timeZoneName:"longOffset"}).format)(t).split("GMT")[1]||"";return o in h?h[o]:Z(o,o.split(":"))}catch{if(e in h)return h[e];let r=e?.match(xe);return r?Z(e,r.slice(1)):NaN}}var xe=/([+-]\d\d):?(\d\d)?/;function Z(e,t){let r=+t[0],o=+(t[1]||0);return h[e]=r>0?r*60+o:r*60-o}var m=class e extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(d(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),A(this,NaN),L(this)):this.setTime(Date.now())}static tz(t,...r){return r.length?new e(...r,t):new e(Date.now(),t)}withTimeZone(t){return new e(+this,t)}getTimezoneOffset(){return-d(this.timeZone,this)}setTime(t){return Date.prototype.setTime.apply(this,arguments),L(this),+this}[Symbol.for("constructDateFrom")](t){return new e(+new Date(t),this.timeZone)}},P=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!P.test(e))return;let t=e.replace(P,"$1UTC");m.prototype[t]&&(e.startsWith("get")?m.prototype[e]=function(){return this.internal[t]()}:(m.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),De(this),+this},m.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),L(this),+this}))});function L(e){e.internal.setTime(+e),e.internal.setUTCMinutes(e.internal.getUTCMinutes()-e.getTimezoneOffset())}function De(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),A(e)}function A(e){let t=d(e.timeZone,e),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);let o=-new Date(+e).getTimezoneOffset(),n=-new Date(+r).getTimezoneOffset(),s=o-n,i=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();s&&i&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+s);let a=o-t;a&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+a);let l=d(e.timeZone,e),u=-new Date(+e).getTimezoneOffset()-l,f=l!==t,V=u-a;if(f&&V){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+V);let _=d(e.timeZone,e),x=l-_;x&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+x),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+x))}}import{format as R,formatDistanceToNow as bt,transpose as be}from"date-fns";var w=({date:e,i18n:t,pattern:r,timezone:o})=>{let n=new m(new Date(e));if(o){let s=m.tz(o),i=n.withTimeZone(o),a=be(i,s);return t.dateFNS?R(a,r,{locale:t.dateFNS}):`${t.t("general:loading")}...`}return t.dateFNS?R(n,r,{locale:t.dateFNS}):`${t.t("general:loading")}...`};import{getTranslation as Le}from"@payloadcms/translations";function T(e){return typeof e=="object"&&"root"in e}function C(e,t){for(let r of e)"text"in r&&r.text?t+=r.text:"children"in r||(t+=`[${r.type}]`),"children"in r&&r.children&&(t+=C(r.children,t));return t}var E=e=>Array.isArray(e)?e.map(t=>typeof t=="object"&&t!==null?t.id:String(t)).filter(Boolean).join(", "):typeof e=="object"&&e!==null?e.id||"":String(e);var we=({collectionConfig:e,data:t,dateFormat:r,fallback:o,globalConfig:n,i18n:s})=>{let i;if(e){let a=e?.admin?.useAsTitle;if(a&&(i=t?.[a],i)){let l=e.fields.find(f=>"name"in f&&f.name===a),p=l?.type==="date",u=l?.type==="relationship";if(p){let f="date"in l.admin&&l?.admin?.date?.displayFormat||r;i=w({date:i,i18n:s,pattern:f})||i}u&&(i=E(t[a]))}}return n&&(i=Le(n?.label,s)||n?.slug),i&&T(i)&&(i=C(i.root.children?.[0]?.children||[],"")),!i&&T(o)&&(i=C(o.root.children?.[0]?.children||[],"")),i||(i=typeof o=="string"?o:s.t("general:untitled")),i};async function Te(e){let{payload:{config:t},payload:r}=e,o=[];if(t.globals.length>0)if(r.collections?.["payload-locked-documents"]){let n=await r.find({collection:"payload-locked-documents",depth:1,overrideAccess:!1,pagination:!1,req:e,select:{globalSlug:!0,updatedAt:!0,user:!0},where:{globalSlug:{exists:!0}}});o=t.globals.map(s=>{let i=typeof s.lockDocuments=="object"?s.lockDocuments.duration:300,a=n.docs.find(l=>l.globalSlug===s.slug);return{slug:s.slug,data:{_isLocked:!!a,_lastEditedAt:a?.updatedAt??null,_userEditing:a?.user?.value??null},lockDuration:i}})}else o=t.globals.map(n=>{let s=typeof n.lockDocuments=="object"?n.lockDocuments.duration:300;return{slug:n.slug,data:{_isLocked:!1,_lastEditedAt:null,_userEditing:null},lockDuration:s}});return o}import{EntityType as z}from"payload";import{getTranslation as M}from"@payloadcms/translations";function I({adminGroup:e,entityPermissions:t}){return e===!1?!1:!!t?.read}function S(e,t,r){return e.reduce((n,s)=>{if(I({adminGroup:s.entity?.admin?.group,entityPermissions:t?.[s.type.toLowerCase()]?.[s.entity.slug]})){let i="labels"in s.entity?s.entity.labels.plural:s.entity.label,a=typeof i=="function"?i({i18n:r,t:r.t}):i;if(s.entity.admin.group){let l=M(s.entity.admin.group,r),p=n.find(f=>M(f.label,r)===l),u=p;p||(u={entities:[],label:l},n.push(u)),u.entities.push({slug:s.entity.slug,type:s.type,label:a})}else n.find(p=>M(p.label,r)===r.t(`general:${s.type}`)).entities.push({slug:s.entity.slug,type:s.type,label:a})}return n},[{entities:[],label:r.t("general:collections")},{entities:[],label:r.t("general:globals")}]).filter(n=>n.entities.length>0)}function Me(e,t,r,o){let n=r.collections.filter(a=>e?.collections?.[a.slug]?.read&&t.collections.includes(a.slug)),s=r.globals.filter(a=>e?.globals?.[a.slug]?.read&&t.globals.includes(a.slug));return S([...n.map(a=>({type:z.collection,entity:a}))??[],...s.map(a=>({type:z.global,entity:a}))??[]],e,o)}function B(e,t){if(typeof e=="function")try{return e({user:t})}catch{return!0}return!!e}function Se({req:e}){return{collections:e.payload.config.collections.map(({slug:t,admin:{hidden:r}})=>B(r,e.user)?null:t).filter(Boolean),globals:e.payload.config.globals.map(({slug:t,admin:{hidden:r}})=>B(r,e.user)?null:t).filter(Boolean)}}import{formatAdminURL as Ve}from"payload/shared";var ve=({adminRoute:e,router:t,serverURL:r})=>{let o=Ve({adminRoute:e,path:"",serverURL:r});t.push(o)};import{formatAdminURL as He}from"payload/shared";var Fe=({adminRoute:e,collectionSlug:t,router:r,serverURL:o})=>{let n=He({adminRoute:e,path:t?`/collections/${t}`:"/"});r.push(n)};var ke=async({id:e,clearRouteCache:t,collectionSlug:r,documentLockStateRef:o,globalSlug:n,isLockingEnabled:s,isWithinDoc:i,setCurrentEditor:a,setIsReadOnlyForIncomingUser:l,updateDocumentEditor:p,user:u})=>{if(s)try{await p(e,r??n,u),i||(o.current.hasShownLockedModal=!0),o.current={hasShownLockedModal:o.current?.hasShownLockedModal,isLocked:!0,user:u},a(u),i&&l&&l(!1),t&&t()}catch(f){console.error("Error during document takeover:",f)}};var Ue=e=>{let{collectionSlug:t,docPermissions:r,globalSlug:o,isEditing:n}=e;return t?!!(n&&r?.update||!n&&r?.create):o?!!r?.update:!1};var Oe=e=>e&&typeof e=="object";var je=({id:e,collectionSlug:t,globalSlug:r})=>!!(r||t&&e);function Ne(e){return e===void 0||typeof e=="number"?e:decodeURIComponent(e)}var y=e=>{for(let t of e){if("localized"in t&&t.localized)return!0;switch(t.type){case"array":case"collapsible":case"group":case"row":if(t.fields&&y(t.fields))return!0;break;case"blocks":if(t.blocks){for(let r of t.blocks)if(typeof r!="string"&&r.fields&&y(r.fields))return!0}break;case"tabs":if(t.tabs){for(let r of t.tabs)if("localized"in r&&r.localized||"fields"in r&&r.fields&&y(r.fields))return!0}break}}return!1};export{se as PayloadIcon,ae as PayloadLogo,$ as Translation,X as WithServerSideProps,de as abortAndIgnore,D as filterFields,Ce as findLocaleFromCode,w as formatDate,we as formatDocTitle,Te as getGlobalData,me as getInitialColumns,Me as getNavGroups,O as getViewportContent,ce as getViewportMeta,Se as getVisibleEntities,S as groupNavItems,he as handleAbortRef,ve as handleBackToDashboard,Fe as handleGoBack,ke as handleTakeOver,Ue as hasSavePermission,Oe as isClientUserObject,je as isEditing,U as isIPhoneUserAgent,ee as mergeFieldStyles,oe as reduceToSerializableFields,ge as requests,Ne as sanitizeID,y as traverseForLocalizedFields,Y as withMergedProps};
5
+ `,ne=()=>F("svg",{className:"graphic-logo",fill:"none",height:"32",viewBox:"0 0 143 32",width:"143",xmlns:"http://www.w3.org/2000/svg",children:[c("style",{children:oe}),F("g",{clipPath:"url(#payload-logo-clip)",children:[c("path",{d:"M13.2487 26.2108L4.15632 20.9658C4.04598 20.8996 3.97241 20.7819 3.97241 20.6494V12.5428C3.97241 12.403 4.1269 12.3147 4.2446 12.3809L14.8009 18.472C14.948 18.5603 15.132 18.4499 15.132 18.2807V14.3304C15.132 14.1759 15.051 14.0288 14.9113 13.9478L2.21425 6.62094C2.10391 6.55474 1.95678 6.55474 1.84644 6.62094L0.183908 7.58462C0.0735632 7.65083 0 7.76853 0 7.90094V22.9593C0 23.0917 0.0735632 23.2094 0.183908 23.2757L13.2267 30.8085C13.337 30.8747 13.4841 30.8747 13.5945 30.8085L24.548 24.4821C24.6952 24.3938 24.6952 24.1878 24.548 24.0996L21.1347 22.1281C20.9949 22.0472 20.8331 22.0472 20.6933 22.1281L13.6239 26.2108C13.5136 26.277 13.3664 26.277 13.2561 26.2108H13.2487Z"}),c("path",{d:"M26.6372 7.57713L13.5945 0.0516083C13.4841 -0.0145986 13.337 -0.0145986 13.2267 0.0516083L6.33379 4.03138C6.18667 4.11965 6.18667 4.32563 6.33379 4.41391L9.7177 6.37069C9.85747 6.45161 10.0193 6.45161 10.1591 6.37069L13.2487 4.59046C13.3591 4.52425 13.5062 4.52425 13.6166 4.59046L22.709 9.83552C22.8193 9.90172 22.8929 10.0194 22.8929 10.1518V18.2953C22.8929 18.4498 22.9738 18.5969 23.1136 18.6778L26.4975 20.6272C26.6446 20.7155 26.8285 20.6052 26.8285 20.436V7.9008C26.8285 7.76839 26.7549 7.65069 26.6446 7.58448L26.6372 7.57713Z"}),c("path",{d:"M142.257 6.96619C142.257 8.39332 141.168 9.40849 139.829 9.40849C138.49 9.40849 137.394 8.38596 137.394 6.96619C137.394 5.54642 138.49 4.53125 139.829 4.53125C141.168 4.53125 142.257 5.55378 142.257 6.96619ZM141.918 6.96619C141.918 5.73033 140.991 4.84757 139.829 4.84757C138.667 4.84757 137.74 5.73033 137.74 6.96619C137.74 8.20205 138.667 9.09217 139.829 9.09217C140.991 9.09217 141.918 8.20941 141.918 6.96619ZM138.806 8.21677V5.6347H139.991C140.616 5.6347 140.984 5.9216 140.984 6.48068C140.984 6.87056 140.763 7.11332 140.491 7.23102L141.072 8.22412H140.417L139.888 7.32665H139.417V8.22412H138.814L138.806 8.21677ZM139.903 6.84849C140.241 6.84849 140.373 6.73079 140.373 6.48068C140.373 6.23056 140.234 6.12022 139.903 6.12022H139.41V6.84849H139.903Z"}),c("path",{d:"M40.2538 18.2731V26.3135H36.2814V4.4873H45.3002C50.4644 4.4873 53.4657 6.84133 53.4657 11.3949C53.4657 15.9485 50.4717 18.2731 45.3296 18.2731H40.2538ZM44.9618 15.0951C47.9559 15.0951 49.4565 13.874 49.4565 11.3949C49.4565 8.91581 47.9559 7.69466 44.9618 7.69466H40.2538V15.0951H44.9618Z"}),c("path",{d:"M63.2202 23.8712C62.4846 25.6441 60.5278 26.6519 58.0561 26.6519C55.0326 26.6519 52.8257 24.9673 52.8257 22.1572C52.8257 19.0381 55.268 17.7581 58.4239 17.3903L63.0731 16.868V16.1324C63.0731 14.2344 61.9108 13.3223 60.1379 13.3223C58.3651 13.3223 57.3867 14.2712 57.2616 15.7057H53.5025C53.8409 12.3733 56.4377 10.4165 60.2556 10.4165C64.4782 10.4165 66.891 12.4027 66.891 16.4413V22.4367C66.891 23.8712 66.9499 25.0703 67.2 26.3209H63.4409C63.2864 25.4675 63.2276 24.6363 63.2276 23.8786L63.2202 23.8712ZM63.0658 20.2887V19.3397L59.6083 19.737C57.9605 19.9503 56.7025 20.3181 56.7025 21.9365C56.7025 23.1577 57.5559 23.9227 59.1154 23.9227C61.131 23.9227 63.0584 22.731 63.0584 20.2813L63.0658 20.2887Z"}),c("path",{d:"M66.4938 10.7842H70.4662L74.777 22.4954H74.8358L78.9333 10.7842H82.8175L76.7632 26.5929C75.2919 30.4771 73.4896 31.9777 70.2234 32.0072C69.7011 32.0072 68.9729 31.9483 68.4211 31.8527V28.8881C68.8772 28.9837 69.1273 28.9837 69.4584 28.9837C71.0473 28.9837 71.7168 28.432 72.548 26.2913L66.4938 10.7915V10.7842Z"}),c("path",{d:"M83.4648 26.3135V4.4873H87.3784V26.3135H83.4648Z"}),c("path",{d:"M96.2133 26.6813C91.6303 26.6813 88.3568 23.5916 88.3568 18.5526C88.3568 13.5135 91.6303 10.4238 96.2133 10.4238C100.796 10.4238 104.07 13.5429 104.07 18.5526C104.07 23.5622 100.796 26.6813 96.2133 26.6813ZM96.2133 23.7756C98.7218 23.7756 100.156 21.8188 100.156 18.5452C100.156 15.2716 98.7218 13.3149 96.2133 13.3149C93.7048 13.3149 92.2703 15.3011 92.2703 18.5452C92.2703 21.7893 93.6754 23.7756 96.2133 23.7756Z"}),c("path",{d:"M114.898 23.8712C114.163 25.6441 112.206 26.6519 109.734 26.6519C106.711 26.6519 104.504 24.9673 104.504 22.1572C104.504 19.0381 106.946 17.7581 110.102 17.3903L114.751 16.868V16.1324C114.751 14.2344 113.589 13.3223 111.816 13.3223C110.043 13.3223 109.065 14.2712 108.94 15.7057H105.181C105.519 12.3733 108.116 10.4165 111.941 10.4165C116.164 10.4165 118.577 12.4027 118.577 16.4413V22.4367C118.577 23.8712 118.635 25.0703 118.886 26.3209H115.126C114.972 25.4675 114.913 24.6363 114.913 23.8786L114.898 23.8712ZM114.744 20.2887V19.3397L111.286 19.737C109.639 19.9503 108.381 20.3181 108.381 21.9365C108.381 23.1577 109.234 23.9227 110.794 23.9227C112.809 23.9227 114.737 22.731 114.737 20.2813L114.744 20.2887Z"}),c("path",{d:"M131.31 23.8418C130.545 25.4013 128.677 26.6887 126.323 26.6887C122.255 26.6887 119.474 23.3857 119.474 18.5599C119.474 13.7342 122.255 10.4312 126.323 10.4312C128.736 10.4312 130.509 11.7774 131.244 13.337V4.4873H135.158V26.3135H131.303V23.8344L131.31 23.8418ZM131.347 18.2731C131.347 15.2496 129.913 13.2855 127.434 13.2855C124.954 13.2855 123.424 15.3673 123.424 18.5452C123.424 21.7232 124.896 23.805 127.434 23.805C129.971 23.805 131.347 21.8482 131.347 18.8174V18.2657V18.2731Z"})]}),c("defs",{children:c("clipPath",{id:"payload-logo-clip",children:c("rect",{fill:"white",height:"32",width:"142.257"})})})]});import{fieldIsHiddenOrDisabled as se,fieldIsID as ie,isFieldDisabled as le}from"payload/shared";var D=e=>{let t=r=>r.type!=="ui"&&se(r)&&!ie(r)||le(r,"column");return(e??[]).reduce((r,o)=>{if(t(o))return r;if(o.type==="tabs"&&"tabs"in o){let n={...o,tabs:o.tabs.map(s=>({...s,fields:D(s.fields)}))};return r.push(n),r}if("fields"in o&&Array.isArray(o.fields)){let n={...o,fields:D(o.fields)};return r.push(n),r}return r.push(o),r},[])};import{fieldAffectsData as k}from"payload/shared";var L=(e,t)=>e?.reduce((r,o)=>k(o)&&o.name===t?r:!k(o)&&"fields"in o?[...r,...L(o.fields,t)]:o.type==="tabs"&&"tabs"in o?[...r,...o.tabs.reduce((n,s)=>[...n,..."name"in s?[s.name]:L(s.fields,t)],[])]:[...r,o.name],[]),ae=(e,t,r)=>{let o=[];if(Array.isArray(r)&&r.length>=1)o=r;else{t&&o.push(t);let n=L(e,t);o=o.concat(n),o=o.slice(0,4)}return o.map(n=>({accessor:n,active:!0}))};function ce(e){if(e)try{e.abort()}catch{}}function fe(e){let t=new AbortController;if(e.current)try{e.current.abort()}catch{}return e.current=t,t}import*as O from"qs-esm";var ue={delete:(e,t={headers:{}})=>{let r=t&&t.headers?{...t.headers}:{},o={...t,credentials:"include",headers:{...r},method:"delete"};return fetch(e,o)},get:(e,t={headers:{}})=>{let r="";return t.params&&(r=O.stringify(t.params,{addQueryPrefix:!0})),fetch(`${e}${r}`,{credentials:"include",...t})},patch:(e,t={headers:{}})=>{let r=t&&t.headers?{...t.headers}:{},o={...t,credentials:"include",headers:{...r},method:"PATCH"};return fetch(e,o)},post:(e,t={headers:{}})=>{let r=t&&t.headers?{...t.headers}:{},o={...t,credentials:"include",headers:{...r},method:"post"};return fetch(`${e}`,o)},put:(e,t={headers:{}})=>{let r=t&&t.headers?{...t.headers}:{},o={...t,credentials:"include",headers:{...r},method:"put"};return fetch(e,o)}};var pe=(e,t)=>!e?.locales||e.locales.length===0?null:e.locales.find(r=>r?.code===t);var de={},h={};function m(e,t){try{let o=(de[e]||=new Intl.DateTimeFormat("en-GB",{timeZone:e,hour:"numeric",timeZoneName:"longOffset"}).format)(t).split("GMT")[1]||"";return o in h?h[o]:U(o,o.split(":"))}catch{if(e in h)return h[e];let r=e?.match(me);return r?U(e,r.slice(1)):NaN}}var me=/([+-]\d\d):?(\d\d)?/;function U(e,t){let r=+t[0],o=+(t[1]||0);return h[e]=r>0?r*60+o:r*60-o}var d=class e extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(m(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),Z(this,NaN),b(this)):this.setTime(Date.now())}static tz(t,...r){return r.length?new e(...r,t):new e(Date.now(),t)}withTimeZone(t){return new e(+this,t)}getTimezoneOffset(){return-m(this.timeZone,this)}setTime(t){return Date.prototype.setTime.apply(this,arguments),b(this),+this}[Symbol.for("constructDateFrom")](t){return new e(+new Date(t),this.timeZone)}},N=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!N.test(e))return;let t=e.replace(N,"$1UTC");d.prototype[t]&&(e.startsWith("get")?d.prototype[e]=function(){return this.internal[t]()}:(d.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),he(this),+this},d.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),b(this),+this}))});function b(e){e.internal.setTime(+e),e.internal.setUTCMinutes(e.internal.getUTCMinutes()-e.getTimezoneOffset())}function he(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),Z(e)}function Z(e){let t=m(e.timeZone,e),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);let o=-new Date(+e).getTimezoneOffset(),n=-new Date(+r).getTimezoneOffset(),s=o-n,i=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();s&&i&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+s);let l=o-t;l&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+l);let a=m(e.timeZone,e),u=-new Date(+e).getTimezoneOffset()-a,f=a!==t,V=u-l;if(f&&V){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+V);let z=m(e.timeZone,e),x=a-z;x&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+x),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+x))}}import{format as j,formatDistanceToNow as pt,transpose as ge}from"date-fns";var T=({date:e,i18n:t,pattern:r,timezone:o})=>{let n=new d(new Date(e));if(o){let s=d.tz(o),i=n.withTimeZone(o),l=ge(i,s);return t.dateFNS?j(l,r,{locale:t.dateFNS}):`${t.t("general:loading")}...`}return t.dateFNS?j(n,r,{locale:t.dateFNS}):`${t.t("general:loading")}...`};import{getTranslation as Ce}from"@payloadcms/translations";function w(e){return typeof e=="object"&&"root"in e}function C(e,t){for(let r of e)"text"in r&&r.text?t+=r.text:"children"in r||(t+=`[${r.type}]`),"children"in r&&r.children&&(t+=C(r.children,t));return t}var P=e=>Array.isArray(e)?e.map(t=>typeof t=="object"&&t!==null?t.id:String(t)).filter(Boolean).join(", "):typeof e=="object"&&e!==null?e.id||"":String(e);var ye=({collectionConfig:e,data:t,dateFormat:r,fallback:o,globalConfig:n,i18n:s})=>{let i;if(e){let l=e?.admin?.useAsTitle;if(l&&(i=t?.[l],i)){let a=e.fields.find(f=>"name"in f&&f.name===l),p=a?.type==="date",u=a?.type==="relationship";if(p){let f="date"in a.admin&&a?.admin?.date?.displayFormat||r;i=T({date:i,i18n:s,pattern:f})||i}u&&(i=P(t[l]))}}return n&&(i=Ce(n?.label,s)||n?.slug),i&&w(i)&&(i=C(i.root.children?.[0]?.children||[],"")),!i&&w(o)&&(i=C(o.root.children?.[0]?.children||[],"")),i||(i=typeof o=="string"?o:s.t("general:untitled")),i};async function xe(e){let{payload:{config:t},payload:r}=e,o=[];if(t.globals.length>0)if(r.collections?.["payload-locked-documents"]){let n=await r.find({collection:"payload-locked-documents",depth:1,overrideAccess:!1,pagination:!1,req:e,select:{globalSlug:!0,updatedAt:!0,user:!0},where:{globalSlug:{exists:!0}}});o=t.globals.map(s=>{let i=typeof s.lockDocuments=="object"?s.lockDocuments.duration:300,l=n.docs.find(a=>a.globalSlug===s.slug);return{slug:s.slug,data:{_isLocked:!!l,_lastEditedAt:l?.updatedAt??null,_userEditing:l?.user?.value??null},lockDuration:i}})}else o=t.globals.map(n=>{let s=typeof n.lockDocuments=="object"?n.lockDocuments.duration:300;return{slug:n.slug,data:{_isLocked:!1,_lastEditedAt:null,_userEditing:null},lockDuration:s}});return o}import{EntityType as E}from"payload";import{getTranslation as M}from"@payloadcms/translations";function A({adminGroup:e,entityPermissions:t}){return e===!1?!1:!!t?.read}function S(e,t,r){return e.reduce((n,s)=>{if(A({adminGroup:s.entity?.admin?.group,entityPermissions:t?.[s.type.toLowerCase()]?.[s.entity.slug]})){let i="labels"in s.entity?s.entity.labels.plural:s.entity.label,l=typeof i=="function"?i({i18n:r,t:r.t}):i;if(s.entity.admin.group){let a=M(s.entity.admin.group,r),p=n.find(f=>M(f.label,r)===a),u=p;p||(u={entities:[],label:a},n.push(u)),u.entities.push({slug:s.entity.slug,type:s.type,label:l})}else n.find(p=>M(p.label,r)===r.t(`general:${s.type}`)).entities.push({slug:s.entity.slug,type:s.type,label:l})}return n},[{entities:[],label:r.t("general:collections")},{entities:[],label:r.t("general:globals")}]).filter(n=>n.entities.length>0)}function De(e,t,r,o){let n=r.collections.filter(l=>e?.collections?.[l.slug]?.read&&t.collections.includes(l.slug)),s=r.globals.filter(l=>e?.globals?.[l.slug]?.read&&t.globals.includes(l.slug));return S([...n.map(l=>({type:E.collection,entity:l}))??[],...s.map(l=>({type:E.global,entity:l}))??[]],e,o)}function R(e,t){if(typeof e=="function")try{return e({user:t})}catch{return!0}return!!e}function Le({req:e}){return{collections:e.payload.config.collections.map(({slug:t,admin:{hidden:r}})=>R(r,e.user)?null:t).filter(Boolean),globals:e.payload.config.globals.map(({slug:t,admin:{hidden:r}})=>R(r,e.user)?null:t).filter(Boolean)}}import{formatAdminURL as be}from"payload/shared";var Te=({adminRoute:e,router:t,serverURL:r})=>{let o=be({adminRoute:e,path:"",serverURL:r});t.push(o)};import{formatAdminURL as we}from"payload/shared";var Me=({adminRoute:e,collectionSlug:t,router:r,serverURL:o})=>{let n=we({adminRoute:e,path:t?`/collections/${t}`:"/"});r.push(n)};var Se=async({id:e,clearRouteCache:t,collectionSlug:r,documentLockStateRef:o,globalSlug:n,isLockingEnabled:s,isWithinDoc:i,setCurrentEditor:l,setIsReadOnlyForIncomingUser:a,updateDocumentEditor:p,user:u})=>{if(s)try{await p(e,r??n,u),i||(o.current.hasShownLockedModal=!0),o.current={hasShownLockedModal:o.current?.hasShownLockedModal,isLocked:!0,user:u},l(u),i&&a&&a(!1),t&&t()}catch(f){console.error("Error during document takeover:",f)}};var Ve=e=>{let{collectionSlug:t,docPermissions:r,globalSlug:o,isEditing:n}=e;return t?!!(n&&r?.update||!n&&r?.create):o?!!r?.update:!1};var ve=e=>e&&typeof e=="object";var He=({id:e,collectionSlug:t,globalSlug:r})=>!!(r||t&&e);function Fe(e){return e===void 0||typeof e=="number"?e:decodeURIComponent(e)}var y=e=>{for(let t of e){if("localized"in t&&t.localized)return!0;switch(t.type){case"array":case"collapsible":case"group":case"row":if(t.fields&&y(t.fields))return!0;break;case"blocks":if(t.blocks){for(let r of t.blocks)if(typeof r!="string"&&r.fields&&y(r.fields))return!0}break;case"tabs":if(t.tabs){for(let r of t.tabs)if("localized"in r&&r.localized||"fields"in r&&r.fields&&y(r.fields))return!0}break}}return!1};export{re as PayloadIcon,ne as PayloadLogo,I as Translation,q as WithServerSideProps,ce as abortAndIgnore,D as filterFields,pe as findLocaleFromCode,T as formatDate,ye as formatDocTitle,xe as getGlobalData,ae as getInitialColumns,De as getNavGroups,Le as getVisibleEntities,S as groupNavItems,fe as handleAbortRef,Te as handleBackToDashboard,Me as handleGoBack,Se as handleTakeOver,Ve as hasSavePermission,ve as isClientUserObject,He as isEditing,Q as mergeFieldStyles,ee as reduceToSerializableFields,ue as requests,Fe as sanitizeID,y as traverseForLocalizedFields,W as withMergedProps};
6
6
  //# sourceMappingURL=index.js.map