diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 00000000000..fdb425d35d5 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,8 @@ +{ + "recommendations": [ + "dbaeumer.vscode-eslint", + "esbenp.prettier-vscode", + "stylelint.vscode-stylelint", + "bradlc.vscode-tailwindcss" + ] +} \ No newline at end of file diff --git a/apps/seven/.plone/cmsui.css b/apps/seven/.plone/cmsui.css new file mode 100644 index 00000000000..ade169daf98 --- /dev/null +++ b/apps/seven/.plone/cmsui.css @@ -0,0 +1,12 @@ +/* + Don't change this file manually. + It is autogenerated by @plone/registry. + Add a ./styles/cmsui.css in your add-on to load your add-on styles in the app. + */ + +@import '@plone/plate/styles/cmsui.css'; +@source '/home/timo/Documents/Kitconcept/workspace/volto/packages/plate'; +@import '@plone/cmsui/styles/cmsui.css'; +@source '/home/timo/Documents/Kitconcept/workspace/volto/packages/cmsui'; +@import '@plone/contents/styles/cmsui.css'; +@source '/home/timo/Documents/Kitconcept/workspace/volto/packages/contents'; diff --git a/apps/seven/.plone/publicui.css b/apps/seven/.plone/publicui.css new file mode 100644 index 00000000000..b953e718f55 --- /dev/null +++ b/apps/seven/.plone/publicui.css @@ -0,0 +1,12 @@ +/* + Don't change this file manually. + It is autogenerated by @plone/registry. + Add a ./styles/publicui.css in your add-on to load your add-on styles in the app. + */ + +@import '@plone/plate/styles/publicui.css'; +@source '/home/timo/Documents/Kitconcept/workspace/volto/packages/plate'; +@import '@plone/layout/styles/publicui.css'; +@import '@plone/publicui/styles/publicui.css'; +@import '@plone/agave/styles/publicui.css'; +@source '/home/timo/Documents/Kitconcept/workspace/volto/packages/agave'; diff --git a/apps/seven/.plone/registry.addonsInfo.json b/apps/seven/.plone/registry.addonsInfo.json new file mode 100644 index 00000000000..5639b2a5e18 --- /dev/null +++ b/apps/seven/.plone/registry.addonsInfo.json @@ -0,0 +1,156 @@ +[ + { + "name": "@plone/theming", + "version": "1.0.0-alpha.5", + "isPublishedPackage": true, + "isRegisteredAddon": true, + "modulePath": "/home/timo/Documents/Kitconcept/workspace/volto/packages/theming", + "hasServerConfig": false, + "packageJson": "/home/timo/Documents/Kitconcept/workspace/volto/packages/theming/package.json", + "basePath": "/home/timo/Documents/Kitconcept/workspace/volto/packages/theming", + "tsConfigPaths": [ + "", + {} + ], + "addons": [] + }, + { + "name": "@plone/plate", + "version": "1.0.0-alpha.8", + "isPublishedPackage": true, + "isRegisteredAddon": true, + "modulePath": "/home/timo/Documents/Kitconcept/workspace/volto/packages/plate", + "hasServerConfig": false, + "packageJson": "/home/timo/Documents/Kitconcept/workspace/volto/packages/plate/package.json", + "basePath": "/home/timo/Documents/Kitconcept/workspace/volto/packages/plate", + "tsConfigPaths": [ + null, + { + "seven/*": [ + "../../apps/seven/*" + ], + "@plone/plate/*": [ + "./*" + ], + "@/*": [ + "./*" + ] + } + ], + "addons": [] + }, + { + "name": "@plone/blocks", + "version": "1.0.0-alpha.10", + "isPublishedPackage": true, + "isRegisteredAddon": true, + "modulePath": "/home/timo/Documents/Kitconcept/workspace/volto/packages/blocks", + "hasServerConfig": false, + "packageJson": "/home/timo/Documents/Kitconcept/workspace/volto/packages/blocks/package.json", + "basePath": "/home/timo/Documents/Kitconcept/workspace/volto/packages/blocks", + "tsConfigPaths": [ + null, + { + "seven/*": [ + "../../apps/seven/*" + ] + } + ], + "addons": [] + }, + { + "name": "@plone/layout", + "version": "1.0.0-alpha.8", + "isPublishedPackage": true, + "isRegisteredAddon": true, + "modulePath": "/home/timo/Documents/Kitconcept/workspace/volto/packages/layout", + "hasServerConfig": false, + "packageJson": "/home/timo/Documents/Kitconcept/workspace/volto/packages/layout/package.json", + "basePath": "/home/timo/Documents/Kitconcept/workspace/volto/packages/layout", + "tsConfigPaths": [ + null, + { + "seven/*": [ + "../../apps/seven/*" + ] + } + ], + "addons": [] + }, + { + "name": "@plone/cmsui", + "version": "1.0.0-alpha.3", + "isPublishedPackage": true, + "isRegisteredAddon": true, + "modulePath": "/home/timo/Documents/Kitconcept/workspace/volto/packages/cmsui", + "hasServerConfig": false, + "packageJson": "/home/timo/Documents/Kitconcept/workspace/volto/packages/cmsui/package.json", + "basePath": "/home/timo/Documents/Kitconcept/workspace/volto/packages/cmsui", + "tsConfigPaths": [ + null, + { + "seven/*": [ + "../../apps/seven/*" + ] + } + ], + "addons": [] + }, + { + "name": "@plone/publicui", + "version": "1.0.0-alpha.3", + "isPublishedPackage": true, + "isRegisteredAddon": true, + "modulePath": "/home/timo/Documents/Kitconcept/workspace/volto/packages/publicui", + "hasServerConfig": false, + "packageJson": "/home/timo/Documents/Kitconcept/workspace/volto/packages/publicui/package.json", + "basePath": "/home/timo/Documents/Kitconcept/workspace/volto/packages/publicui", + "tsConfigPaths": [ + null, + { + "seven/*": [ + "../../apps/seven/*" + ] + } + ], + "addons": [ + "@plone/theming", + "@plone/blocks", + "@plone/layout" + ] + }, + { + "name": "@plone/contents", + "version": "0.1.0", + "isPublishedPackage": true, + "isRegisteredAddon": true, + "modulePath": "/home/timo/Documents/Kitconcept/workspace/volto/packages/contents", + "hasServerConfig": false, + "packageJson": "/home/timo/Documents/Kitconcept/workspace/volto/packages/contents/package.json", + "basePath": "/home/timo/Documents/Kitconcept/workspace/volto/packages/contents", + "tsConfigPaths": [ + null, + { + "seven/*": [ + "../../apps/seven/*" + ] + } + ], + "addons": [] + }, + { + "name": "@plone/agave", + "version": "1.0.0-alpha.5", + "isPublishedPackage": true, + "isRegisteredAddon": true, + "modulePath": "/home/timo/Documents/Kitconcept/workspace/volto/packages/agave", + "hasServerConfig": false, + "packageJson": "/home/timo/Documents/Kitconcept/workspace/volto/packages/agave/package.json", + "basePath": "/home/timo/Documents/Kitconcept/workspace/volto/packages/agave", + "tsConfigPaths": [ + "", + {} + ], + "addons": [] + } +] \ No newline at end of file diff --git a/apps/seven/.plone/registry.loader.js b/apps/seven/.plone/registry.loader.js new file mode 100644 index 00000000000..2affe0f4c6d --- /dev/null +++ b/apps/seven/.plone/registry.loader.js @@ -0,0 +1,35 @@ +/* +Don't change this file manually. +It is autogenerated by @plone/registry. +Instead, change the "addons" registration in the app. +*/ +import plonetheming from '@plone/theming'; +import ploneplate from '@plone/plate'; +import ploneblocks from '@plone/blocks'; +import plonelayout from '@plone/layout'; +import plonecmsui from '@plone/cmsui'; +import plonepublicui from '@plone/publicui'; +import plonecontents from '@plone/contents'; +import ploneagave from '@plone/agave'; + +const addonsInfo = [{"name":"@plone/theming","version":"1.0.0-alpha.5","isPublishedPackage":true,"isRegisteredAddon":true,"modulePath":"/home/timo/Documents/Kitconcept/workspace/volto/packages/theming","hasServerConfig":false,"packageJson":"/home/timo/Documents/Kitconcept/workspace/volto/packages/theming/package.json","basePath":"/home/timo/Documents/Kitconcept/workspace/volto/packages/theming","tsConfigPaths":["",{}],"addons":[]},{"name":"@plone/plate","version":"1.0.0-alpha.8","isPublishedPackage":true,"isRegisteredAddon":true,"modulePath":"/home/timo/Documents/Kitconcept/workspace/volto/packages/plate","hasServerConfig":false,"packageJson":"/home/timo/Documents/Kitconcept/workspace/volto/packages/plate/package.json","basePath":"/home/timo/Documents/Kitconcept/workspace/volto/packages/plate","tsConfigPaths":[null,{"seven/*":["../../apps/seven/*"],"@plone/plate/*":["./*"],"@/*":["./*"]}],"addons":[]},{"name":"@plone/blocks","version":"1.0.0-alpha.10","isPublishedPackage":true,"isRegisteredAddon":true,"modulePath":"/home/timo/Documents/Kitconcept/workspace/volto/packages/blocks","hasServerConfig":false,"packageJson":"/home/timo/Documents/Kitconcept/workspace/volto/packages/blocks/package.json","basePath":"/home/timo/Documents/Kitconcept/workspace/volto/packages/blocks","tsConfigPaths":[null,{"seven/*":["../../apps/seven/*"]}],"addons":[]},{"name":"@plone/layout","version":"1.0.0-alpha.8","isPublishedPackage":true,"isRegisteredAddon":true,"modulePath":"/home/timo/Documents/Kitconcept/workspace/volto/packages/layout","hasServerConfig":false,"packageJson":"/home/timo/Documents/Kitconcept/workspace/volto/packages/layout/package.json","basePath":"/home/timo/Documents/Kitconcept/workspace/volto/packages/layout","tsConfigPaths":[null,{"seven/*":["../../apps/seven/*"]}],"addons":[]},{"name":"@plone/cmsui","version":"1.0.0-alpha.3","isPublishedPackage":true,"isRegisteredAddon":true,"modulePath":"/home/timo/Documents/Kitconcept/workspace/volto/packages/cmsui","hasServerConfig":false,"packageJson":"/home/timo/Documents/Kitconcept/workspace/volto/packages/cmsui/package.json","basePath":"/home/timo/Documents/Kitconcept/workspace/volto/packages/cmsui","tsConfigPaths":[null,{"seven/*":["../../apps/seven/*"]}],"addons":[]},{"name":"@plone/publicui","version":"1.0.0-alpha.3","isPublishedPackage":true,"isRegisteredAddon":true,"modulePath":"/home/timo/Documents/Kitconcept/workspace/volto/packages/publicui","hasServerConfig":false,"packageJson":"/home/timo/Documents/Kitconcept/workspace/volto/packages/publicui/package.json","basePath":"/home/timo/Documents/Kitconcept/workspace/volto/packages/publicui","tsConfigPaths":[null,{"seven/*":["../../apps/seven/*"]}],"addons":["@plone/theming","@plone/blocks","@plone/layout"]},{"name":"@plone/contents","version":"0.1.0","isPublishedPackage":true,"isRegisteredAddon":true,"modulePath":"/home/timo/Documents/Kitconcept/workspace/volto/packages/contents","hasServerConfig":false,"packageJson":"/home/timo/Documents/Kitconcept/workspace/volto/packages/contents/package.json","basePath":"/home/timo/Documents/Kitconcept/workspace/volto/packages/contents","tsConfigPaths":[null,{"seven/*":["../../apps/seven/*"]}],"addons":[]},{"name":"@plone/agave","version":"1.0.0-alpha.5","isPublishedPackage":true,"isRegisteredAddon":true,"modulePath":"/home/timo/Documents/Kitconcept/workspace/volto/packages/agave","hasServerConfig":false,"packageJson":"/home/timo/Documents/Kitconcept/workspace/volto/packages/agave/package.json","basePath":"/home/timo/Documents/Kitconcept/workspace/volto/packages/agave","tsConfigPaths":["",{}],"addons":[]}]; +export { addonsInfo }; + +const safeWrapper = (func) => (config) => { + const res = func(config); + if (typeof res === 'undefined') { + throw new Error("Configuration function doesn't return config"); + } + return res; +} + +const load = (config) => { + const addonLoaders = [plonetheming, ploneplate, ploneblocks, plonelayout, plonecmsui, plonepublicui, plonecontents, ploneagave]; + if(!addonLoaders.every((el) => typeof el === "function")) { + throw new TypeError( + 'Each addon has to provide a function applying its configuration to the projects configuration.', + ); + } + return addonLoaders.reduce((acc, apply) => safeWrapper(apply)(acc), config); +}; +export default load; diff --git a/apps/seven/.plone/registry.loader.server.js b/apps/seven/.plone/registry.loader.server.js new file mode 100644 index 00000000000..86fab942b58 --- /dev/null +++ b/apps/seven/.plone/registry.loader.server.js @@ -0,0 +1,24 @@ +/* +Don't change this file manually. +It is autogenerated by @plone/registry. +Instead, change the "addons" registration in the app. +*/ + +const safeWrapper = (func) => (config) => { + const res = func(config); + if (typeof res === 'undefined') { + throw new Error("Configuration function doesn't return config"); + } + return res; +}; + +const load = (config) => { + const addonLoaders = []; + if (!addonLoaders.every((el) => typeof el === 'function')) { + throw new TypeError( + 'Each addon has to provide a function applying its configuration to the projects configuration.', + ); + } + return addonLoaders.reduce((acc, apply) => safeWrapper(apply)(acc), config); +}; +export default load; diff --git a/apps/seven/.plone/registry.routes.json b/apps/seven/.plone/registry.routes.json new file mode 100644 index 00000000000..390ecbb7bf6 --- /dev/null +++ b/apps/seven/.plone/registry.routes.json @@ -0,0 +1,198 @@ +[ + { + "type": "layout", + "file": "@plone/cmsui/routes/layout.tsx", + "children": [ + { + "type": "prefix", + "path": "login", + "children": [ + { + "type": "route", + "path": "*", + "file": "@plone/cmsui/routes/auth/login.tsx" + } + ] + }, + { + "type": "prefix", + "path": "logout", + "children": [ + { + "type": "route", + "path": "*", + "file": "@plone/cmsui/routes/auth/logout.tsx" + } + ] + }, + { + "type": "prefix", + "path": "@@add", + "children": [ + { + "type": "route", + "path": "*", + "file": "@plone/cmsui/routes/add.tsx" + } + ] + }, + { + "type": "prefix", + "path": "@@edit", + "children": [ + { + "type": "route", + "path": "*", + "file": "@plone/cmsui/routes/edit.tsx" + } + ] + }, + { + "type": "prefix", + "path": "controlpanel", + "children": [ + { + "type": "index", + "file": "@plone/cmsui/routes/controlpanels.tsx", + "options": { + "id": "index-controlpanel" + } + }, + { + "type": "route", + "path": ":id", + "file": "@plone/cmsui/routes/controlpanel.tsx" + } + ] + }, + { + "type": "prefix", + "path": "test-layout", + "children": [ + { + "type": "route", + "path": "*", + "file": "@plone/cmsui/routes/test.tsx" + } + ] + } + ] + }, + { + "type": "prefix", + "path": "@search", + "children": [ + { + "type": "route", + "path": "*", + "file": "@plone/cmsui/routes/search.tsx" + } + ] + }, + { + "type": "prefix", + "path": "@breadcrumbs", + "children": [ + { + "type": "route", + "path": "*", + "file": "@plone/cmsui/routes/breadcrumbs.tsx" + } + ] + }, + { + "type": "prefix", + "path": "@objectBrowserWidget", + "children": [ + { + "type": "route", + "path": "*", + "file": "@plone/cmsui/routes/objectBrowserWidget.tsx" + } + ] + }, + { + "type": "prefix", + "path": "@createContent", + "children": [ + { + "type": "route", + "path": "*", + "file": "@plone/cmsui/routes/api/createContent.tsx" + } + ] + }, + { + "type": "layout", + "file": "@plone/publicui/routes/index.tsx", + "children": [ + { + "type": "index", + "file": "@plone/publicui/routes/content.tsx", + "options": { + "id": "content-index" + } + }, + { + "type": "route", + "path": "layers.css", + "file": "@plone/publicui/routes/layers.css.tsx" + }, + { + "type": "route", + "path": "sitemap", + "file": "@plone/publicui/routes/sitemap.tsx" + }, + { + "type": "route", + "path": "search", + "file": "@plone/publicui/routes/search.tsx" + }, + { + "type": "route", + "path": "*", + "file": "@plone/publicui/routes/content.tsx", + "options": { + "id": "content" + } + } + ] + }, + { + "type": "layout", + "file": "@plone/contents/routes/layout.tsx", + "children": [ + { + "type": "prefix", + "path": "@@contents", + "children": [ + { + "path": "@@delete/*", + "type": "route", + "file": "@plone/contents/routes/delete.tsx" + }, + { + "path": "@@upload/*", + "type": "route", + "file": "@plone/contents/routes/upload.tsx" + }, + { + "path": "@@order/*", + "type": "route", + "file": "@plone/contents/routes/order.tsx" + }, + { + "path": "@@paste/*", + "type": "route", + "file": "@plone/contents/routes/paste.tsx" + }, + { + "type": "route", + "path": "*", + "file": "@plone/contents/routes/contents.tsx" + } + ] + } + ] + } +] \ No newline at end of file diff --git a/apps/seven/.plone/vite.loader.js b/apps/seven/.plone/vite.loader.js new file mode 100644 index 00000000000..5d28d2a976c --- /dev/null +++ b/apps/seven/.plone/vite.loader.js @@ -0,0 +1,27 @@ +/* +Don't change this file manually. +It is autogenerated by @plone/registry. +Instead, change the "addons" registration in the app. +*/ + +const safeWrapper = (func) => (config, context) => { + const res = func(config, context); + if (typeof res === 'undefined') { + throw new Error("Vite extension function doesn't return config"); + } + return res; +}; + +const load = (config, context = {}) => { + const addonLoaders = []; + if (!addonLoaders.every((el) => typeof el === 'function')) { + throw new TypeError( + 'Each addon has to provide a function applying its Vite extension to the app configuration.', + ); + } + return addonLoaders.reduce( + (acc, apply) => safeWrapper(apply)(acc, context), + config, + ); +}; +export default load; diff --git a/apps/seven/.react-router/types/+future.ts b/apps/seven/.react-router/types/+future.ts new file mode 100644 index 00000000000..39f2b59d35d --- /dev/null +++ b/apps/seven/.react-router/types/+future.ts @@ -0,0 +1,9 @@ +// Generated by React Router + +import "react-router"; + +declare module "react-router" { + interface Future { + v8_middleware: true + } +} \ No newline at end of file diff --git a/apps/seven/.react-router/types/+routes.ts b/apps/seven/.react-router/types/+routes.ts new file mode 100644 index 00000000000..16699b5d68c --- /dev/null +++ b/apps/seven/.react-router/types/+routes.ts @@ -0,0 +1,255 @@ +// Generated by React Router + +import "react-router" + +declare module "react-router" { + interface Register { + pages: Pages + routeFiles: RouteFiles + routeModules: RouteModules + } +} + +type Pages = { + "/": { + params: {}; + }; + "/ok": { + params: {}; + }; + "/reset-fetcher": { + params: {}; + }; + "/login/*": { + params: { + "*": string; + }; + }; + "/logout/*": { + params: { + "*": string; + }; + }; + "/@@add/*": { + params: { + "*": string; + }; + }; + "/@@edit/*": { + params: { + "*": string; + }; + }; + "/controlpanel": { + params: {}; + }; + "/controlpanel/:id": { + params: { + "id": string; + }; + }; + "/test-layout/*": { + params: { + "*": string; + }; + }; + "/@search/*": { + params: { + "*": string; + }; + }; + "/@breadcrumbs/*": { + params: { + "*": string; + }; + }; + "/@objectBrowserWidget/*": { + params: { + "*": string; + }; + }; + "/@createContent/*": { + params: { + "*": string; + }; + }; + "/layers.css": { + params: {}; + }; + "/sitemap": { + params: {}; + }; + "/search": { + params: {}; + }; + "/*": { + params: { + "*": string; + }; + }; + "/@@contents/@@delete/*": { + params: { + "*": string; + }; + }; + "/@@contents/@@upload/*": { + params: { + "*": string; + }; + }; + "/@@contents/@@order/*": { + params: { + "*": string; + }; + }; + "/@@contents/@@paste/*": { + params: { + "*": string; + }; + }; + "/@@contents/*": { + params: { + "*": string; + }; + }; +}; + +type RouteFiles = { + "root.tsx": { + id: "root"; + page: "/" | "/ok" | "/reset-fetcher" | "/login/*" | "/logout/*" | "/@@add/*" | "/@@edit/*" | "/controlpanel" | "/controlpanel/:id" | "/test-layout/*" | "/@search/*" | "/@breadcrumbs/*" | "/@objectBrowserWidget/*" | "/@createContent/*" | "/layers.css" | "/sitemap" | "/search" | "/*" | "/@@contents/@@delete/*" | "/@@contents/@@upload/*" | "/@@contents/@@order/*" | "/@@contents/@@paste/*" | "/@@contents/*"; + }; + "okroute.tsx": { + id: "ok"; + page: "/ok"; + }; + "reset-fetcher.tsx": { + id: "reset-fetcher"; + page: "/reset-fetcher"; + }; + "../../../packages/cmsui/routes/layout.tsx": { + id: "/home/timo/Documents/Kitconcept/workspace/volto/packages/cmsui/routes/layout"; + page: "/login/*" | "/logout/*" | "/@@add/*" | "/@@edit/*" | "/controlpanel" | "/controlpanel/:id" | "/test-layout/*"; + }; + "../../../packages/cmsui/routes/auth/login.tsx": { + id: "/home/timo/Documents/Kitconcept/workspace/volto/packages/cmsui/routes/auth/login"; + page: "/login/*"; + }; + "../../../packages/cmsui/routes/auth/logout.tsx": { + id: "/home/timo/Documents/Kitconcept/workspace/volto/packages/cmsui/routes/auth/logout"; + page: "/logout/*"; + }; + "../../../packages/cmsui/routes/add.tsx": { + id: "/home/timo/Documents/Kitconcept/workspace/volto/packages/cmsui/routes/add"; + page: "/@@add/*"; + }; + "../../../packages/cmsui/routes/edit.tsx": { + id: "/home/timo/Documents/Kitconcept/workspace/volto/packages/cmsui/routes/edit"; + page: "/@@edit/*"; + }; + "../../../packages/cmsui/routes/controlpanels.tsx": { + id: "index-controlpanel"; + page: "/controlpanel"; + }; + "../../../packages/cmsui/routes/controlpanel.tsx": { + id: "/home/timo/Documents/Kitconcept/workspace/volto/packages/cmsui/routes/controlpanel"; + page: "/controlpanel/:id"; + }; + "../../../packages/cmsui/routes/test.tsx": { + id: "/home/timo/Documents/Kitconcept/workspace/volto/packages/cmsui/routes/test"; + page: "/test-layout/*"; + }; + "../../../packages/cmsui/routes/search.tsx": { + id: "/home/timo/Documents/Kitconcept/workspace/volto/packages/cmsui/routes/search"; + page: "/@search/*"; + }; + "../../../packages/cmsui/routes/breadcrumbs.tsx": { + id: "/home/timo/Documents/Kitconcept/workspace/volto/packages/cmsui/routes/breadcrumbs"; + page: "/@breadcrumbs/*"; + }; + "../../../packages/cmsui/routes/objectBrowserWidget.tsx": { + id: "/home/timo/Documents/Kitconcept/workspace/volto/packages/cmsui/routes/objectBrowserWidget"; + page: "/@objectBrowserWidget/*"; + }; + "../../../packages/cmsui/routes/api/createContent.tsx": { + id: "/home/timo/Documents/Kitconcept/workspace/volto/packages/cmsui/routes/api/createContent"; + page: "/@createContent/*"; + }; + "../../../packages/publicui/routes/index.tsx": { + id: "/home/timo/Documents/Kitconcept/workspace/volto/packages/publicui/routes/index"; + page: "/" | "/layers.css" | "/sitemap" | "/search" | "/*"; + }; + "../../../packages/publicui/routes/content.tsx": { + id: "content-index"; + page: "/"; + } | { + id: "content"; + page: "/*"; + }; + "../../../packages/publicui/routes/layers.css.tsx": { + id: "/home/timo/Documents/Kitconcept/workspace/volto/packages/publicui/routes/layers.css"; + page: "/layers.css"; + }; + "../../../packages/publicui/routes/sitemap.tsx": { + id: "/home/timo/Documents/Kitconcept/workspace/volto/packages/publicui/routes/sitemap"; + page: "/sitemap"; + }; + "../../../packages/publicui/routes/search.tsx": { + id: "/home/timo/Documents/Kitconcept/workspace/volto/packages/publicui/routes/search"; + page: "/search"; + }; + "../../../packages/contents/routes/layout.tsx": { + id: "/home/timo/Documents/Kitconcept/workspace/volto/packages/contents/routes/layout"; + page: "/@@contents/@@delete/*" | "/@@contents/@@upload/*" | "/@@contents/@@order/*" | "/@@contents/@@paste/*" | "/@@contents/*"; + }; + "../../../packages/contents/routes/delete.tsx": { + id: "/home/timo/Documents/Kitconcept/workspace/volto/packages/contents/routes/delete"; + page: "/@@contents/@@delete/*"; + }; + "../../../packages/contents/routes/upload.tsx": { + id: "/home/timo/Documents/Kitconcept/workspace/volto/packages/contents/routes/upload"; + page: "/@@contents/@@upload/*"; + }; + "../../../packages/contents/routes/order.tsx": { + id: "/home/timo/Documents/Kitconcept/workspace/volto/packages/contents/routes/order"; + page: "/@@contents/@@order/*"; + }; + "../../../packages/contents/routes/paste.tsx": { + id: "/home/timo/Documents/Kitconcept/workspace/volto/packages/contents/routes/paste"; + page: "/@@contents/@@paste/*"; + }; + "../../../packages/contents/routes/contents.tsx": { + id: "/home/timo/Documents/Kitconcept/workspace/volto/packages/contents/routes/contents"; + page: "/@@contents/*"; + }; +}; + +type RouteModules = { + "root": typeof import("./app/root.tsx"); + "ok": typeof import("./app/okroute.tsx"); + "reset-fetcher": typeof import("./app/reset-fetcher.tsx"); + "/home/timo/Documents/Kitconcept/workspace/volto/packages/cmsui/routes/layout": unknown; + "/home/timo/Documents/Kitconcept/workspace/volto/packages/cmsui/routes/auth/login": unknown; + "/home/timo/Documents/Kitconcept/workspace/volto/packages/cmsui/routes/auth/logout": unknown; + "/home/timo/Documents/Kitconcept/workspace/volto/packages/cmsui/routes/add": unknown; + "/home/timo/Documents/Kitconcept/workspace/volto/packages/cmsui/routes/edit": unknown; + "index-controlpanel": unknown; + "/home/timo/Documents/Kitconcept/workspace/volto/packages/cmsui/routes/controlpanel": unknown; + "/home/timo/Documents/Kitconcept/workspace/volto/packages/cmsui/routes/test": unknown; + "/home/timo/Documents/Kitconcept/workspace/volto/packages/cmsui/routes/search": unknown; + "/home/timo/Documents/Kitconcept/workspace/volto/packages/cmsui/routes/breadcrumbs": unknown; + "/home/timo/Documents/Kitconcept/workspace/volto/packages/cmsui/routes/objectBrowserWidget": unknown; + "/home/timo/Documents/Kitconcept/workspace/volto/packages/cmsui/routes/api/createContent": unknown; + "/home/timo/Documents/Kitconcept/workspace/volto/packages/publicui/routes/index": unknown; + "content-index": unknown; + "/home/timo/Documents/Kitconcept/workspace/volto/packages/publicui/routes/layers.css": unknown; + "/home/timo/Documents/Kitconcept/workspace/volto/packages/publicui/routes/sitemap": unknown; + "/home/timo/Documents/Kitconcept/workspace/volto/packages/publicui/routes/search": unknown; + "content": unknown; + "/home/timo/Documents/Kitconcept/workspace/volto/packages/contents/routes/layout": unknown; + "/home/timo/Documents/Kitconcept/workspace/volto/packages/contents/routes/delete": unknown; + "/home/timo/Documents/Kitconcept/workspace/volto/packages/contents/routes/upload": unknown; + "/home/timo/Documents/Kitconcept/workspace/volto/packages/contents/routes/order": unknown; + "/home/timo/Documents/Kitconcept/workspace/volto/packages/contents/routes/paste": unknown; + "/home/timo/Documents/Kitconcept/workspace/volto/packages/contents/routes/contents": unknown; +}; \ No newline at end of file diff --git a/apps/seven/.react-router/types/+server-build.d.ts b/apps/seven/.react-router/types/+server-build.d.ts new file mode 100644 index 00000000000..13792c13fdc --- /dev/null +++ b/apps/seven/.react-router/types/+server-build.d.ts @@ -0,0 +1,18 @@ +// Generated by React Router + +declare module "virtual:react-router/server-build" { + import { ServerBuild } from "react-router"; + export const assets: ServerBuild["assets"]; + export const assetsBuildDirectory: ServerBuild["assetsBuildDirectory"]; + export const basename: ServerBuild["basename"]; + export const entry: ServerBuild["entry"]; + export const future: ServerBuild["future"]; + export const isSpaMode: ServerBuild["isSpaMode"]; + export const prerender: ServerBuild["prerender"]; + export const publicPath: ServerBuild["publicPath"]; + export const routeDiscovery: ServerBuild["routeDiscovery"]; + export const routes: ServerBuild["routes"]; + export const ssr: ServerBuild["ssr"]; + export const allowedActionOrigins: ServerBuild["allowedActionOrigins"]; + export const unstable_getCriticalCss: ServerBuild["unstable_getCriticalCss"]; +} \ No newline at end of file diff --git a/apps/seven/.react-router/types/app/+types/okroute.ts b/apps/seven/.react-router/types/app/+types/okroute.ts new file mode 100644 index 00000000000..c986f26c90a --- /dev/null +++ b/apps/seven/.react-router/types/app/+types/okroute.ts @@ -0,0 +1,71 @@ +// Generated by React Router + +import type { GetInfo, GetAnnotations } from "react-router/internal"; + +type Module = typeof import("../okroute.js") + +type Info = GetInfo<{ + file: "okroute.tsx", + module: Module +}> + +type Matches = [{ + id: "root"; + module: typeof import("../root.js"); +}, { + id: "ok"; + module: typeof import("../okroute.js"); +}]; + +type Annotations = GetAnnotations; + +export namespace Route { + // links + export type LinkDescriptors = Annotations["LinkDescriptors"]; + export type LinksFunction = Annotations["LinksFunction"]; + + // meta + export type MetaArgs = Annotations["MetaArgs"]; + export type MetaDescriptors = Annotations["MetaDescriptors"]; + export type MetaFunction = Annotations["MetaFunction"]; + + // headers + export type HeadersArgs = Annotations["HeadersArgs"]; + export type HeadersFunction = Annotations["HeadersFunction"]; + + // middleware + export type MiddlewareFunction = Annotations["MiddlewareFunction"]; + + // clientMiddleware + export type ClientMiddlewareFunction = Annotations["ClientMiddlewareFunction"]; + + // loader + export type LoaderArgs = Annotations["LoaderArgs"]; + + // clientLoader + export type ClientLoaderArgs = Annotations["ClientLoaderArgs"]; + + // action + export type ActionArgs = Annotations["ActionArgs"]; + + // clientAction + export type ClientActionArgs = Annotations["ClientActionArgs"]; + + // HydrateFallback + export type HydrateFallbackProps = Annotations["HydrateFallbackProps"]; + + // ServerHydrateFallback + export type ServerHydrateFallbackProps = Annotations["ServerHydrateFallbackProps"]; + + // Component + export type ComponentProps = Annotations["ComponentProps"]; + + // ServerComponent + export type ServerComponentProps = Annotations["ServerComponentProps"]; + + // ErrorBoundary + export type ErrorBoundaryProps = Annotations["ErrorBoundaryProps"]; + + // ServerErrorBoundary + export type ServerErrorBoundaryProps = Annotations["ServerErrorBoundaryProps"]; +} \ No newline at end of file diff --git a/apps/seven/.react-router/types/app/+types/reset-fetcher.ts b/apps/seven/.react-router/types/app/+types/reset-fetcher.ts new file mode 100644 index 00000000000..b1d4126ceba --- /dev/null +++ b/apps/seven/.react-router/types/app/+types/reset-fetcher.ts @@ -0,0 +1,71 @@ +// Generated by React Router + +import type { GetInfo, GetAnnotations } from "react-router/internal"; + +type Module = typeof import("../reset-fetcher.js") + +type Info = GetInfo<{ + file: "reset-fetcher.tsx", + module: Module +}> + +type Matches = [{ + id: "root"; + module: typeof import("../root.js"); +}, { + id: "reset-fetcher"; + module: typeof import("../reset-fetcher.js"); +}]; + +type Annotations = GetAnnotations; + +export namespace Route { + // links + export type LinkDescriptors = Annotations["LinkDescriptors"]; + export type LinksFunction = Annotations["LinksFunction"]; + + // meta + export type MetaArgs = Annotations["MetaArgs"]; + export type MetaDescriptors = Annotations["MetaDescriptors"]; + export type MetaFunction = Annotations["MetaFunction"]; + + // headers + export type HeadersArgs = Annotations["HeadersArgs"]; + export type HeadersFunction = Annotations["HeadersFunction"]; + + // middleware + export type MiddlewareFunction = Annotations["MiddlewareFunction"]; + + // clientMiddleware + export type ClientMiddlewareFunction = Annotations["ClientMiddlewareFunction"]; + + // loader + export type LoaderArgs = Annotations["LoaderArgs"]; + + // clientLoader + export type ClientLoaderArgs = Annotations["ClientLoaderArgs"]; + + // action + export type ActionArgs = Annotations["ActionArgs"]; + + // clientAction + export type ClientActionArgs = Annotations["ClientActionArgs"]; + + // HydrateFallback + export type HydrateFallbackProps = Annotations["HydrateFallbackProps"]; + + // ServerHydrateFallback + export type ServerHydrateFallbackProps = Annotations["ServerHydrateFallbackProps"]; + + // Component + export type ComponentProps = Annotations["ComponentProps"]; + + // ServerComponent + export type ServerComponentProps = Annotations["ServerComponentProps"]; + + // ErrorBoundary + export type ErrorBoundaryProps = Annotations["ErrorBoundaryProps"]; + + // ServerErrorBoundary + export type ServerErrorBoundaryProps = Annotations["ServerErrorBoundaryProps"]; +} \ No newline at end of file diff --git a/apps/seven/.react-router/types/app/+types/root.ts b/apps/seven/.react-router/types/app/+types/root.ts new file mode 100644 index 00000000000..58af758100d --- /dev/null +++ b/apps/seven/.react-router/types/app/+types/root.ts @@ -0,0 +1,68 @@ +// Generated by React Router + +import type { GetInfo, GetAnnotations } from "react-router/internal"; + +type Module = typeof import("../root.js") + +type Info = GetInfo<{ + file: "root.tsx", + module: Module +}> + +type Matches = [{ + id: "root"; + module: typeof import("../root.js"); +}]; + +type Annotations = GetAnnotations; + +export namespace Route { + // links + export type LinkDescriptors = Annotations["LinkDescriptors"]; + export type LinksFunction = Annotations["LinksFunction"]; + + // meta + export type MetaArgs = Annotations["MetaArgs"]; + export type MetaDescriptors = Annotations["MetaDescriptors"]; + export type MetaFunction = Annotations["MetaFunction"]; + + // headers + export type HeadersArgs = Annotations["HeadersArgs"]; + export type HeadersFunction = Annotations["HeadersFunction"]; + + // middleware + export type MiddlewareFunction = Annotations["MiddlewareFunction"]; + + // clientMiddleware + export type ClientMiddlewareFunction = Annotations["ClientMiddlewareFunction"]; + + // loader + export type LoaderArgs = Annotations["LoaderArgs"]; + + // clientLoader + export type ClientLoaderArgs = Annotations["ClientLoaderArgs"]; + + // action + export type ActionArgs = Annotations["ActionArgs"]; + + // clientAction + export type ClientActionArgs = Annotations["ClientActionArgs"]; + + // HydrateFallback + export type HydrateFallbackProps = Annotations["HydrateFallbackProps"]; + + // ServerHydrateFallback + export type ServerHydrateFallbackProps = Annotations["ServerHydrateFallbackProps"]; + + // Component + export type ComponentProps = Annotations["ComponentProps"]; + + // ServerComponent + export type ServerComponentProps = Annotations["ServerComponentProps"]; + + // ErrorBoundary + export type ErrorBoundaryProps = Annotations["ErrorBoundaryProps"]; + + // ServerErrorBoundary + export type ServerErrorBoundaryProps = Annotations["ServerErrorBoundaryProps"]; +} \ No newline at end of file diff --git a/apps/seven/public/locales/de/common.json b/apps/seven/public/locales/de/common.json new file mode 100644 index 00000000000..b9bad75f56a --- /dev/null +++ b/apps/seven/public/locales/de/common.json @@ -0,0 +1,123 @@ +{ + "layout": { + "languageSwitcher": { + "switchTo": "Zu {{ lang }} wechseln" + }, + "contenttypes": { + "common": { + "size": "Größe:" + }, + "image": { + "download": "Klicke, um das Bild in voller Größe herunterzuladen" + }, + "file": { + "download": "Datei herunterladen" + } + }, + "toolbar": { + "label": "Werkzeugleiste" + }, + "views": { + "link": { + "linkLabel": "Die Linkadresse lautet:", + "externalLinkLabel": "Die externe Linkadresse lautet:" + }, + "event": { + "what": "Was", + "when": "Datum", + "time": { + "sameDayOpenEnd": "{{date}} ab {{fromTime}}", + "sameDayRange": "{{date}} von {{fromTime}} bis {{toTime}}", + "multiDayWholeDayOpen": "{{fromDate}}", + "multiDayWholeDay": "{{fromDate}} bis {{toDate}}", + "multiDayRangeOpen": "{{fromDate}} {{fromTime}}", + "multiDayRange": "{{fromDate}} {{fromTime}} bis {{toDate}} {{toTime}}" + }, + "allDates": "Alle Termine", + "where": "Ort", + "contact": { + "name": "Kontaktname", + "phone": "Kontakttelefon" + }, + "attendees": "Teilnehmer", + "website": "Webseite", + "visitWebsite": "Webseite besuchen", + "downloadEvent": "Event herunterladen" + } + } + }, + "cmsui": { + "add": "Hinzufügen", + "edit": "Bearbeiten", + "save": "Speichern", + "controlpanel": "Kontrollzentrum", + "objectbrowserwidget": { + "openDialog": "Inhalt auswählen", + "dialogTitle": "Inhalt auswählen", + "closeDialog": "Auswahl schließen", + "openSearch": "Inhalt suchen", + "closeSearch": "Suche schließen", + "searchPlaceholder": "Suche Inhalte...", + "loading": "Lade...", + "routeannouncer": "Aktueller Pfad: {{route}}", + "noResults": "Keine Inhalte gefunden", + "searchResults": "Suchergebnisse: {{count}} Inhalte", + "searchResultsFor": "Suchergebnisse für \"{{searchTerm}}\": {{count}} ", + "goback": "Zurück", + "changeViewMode": "Zur {{mode}} umschalten", + "currentItems": "Aktuelle Inhalte", + "home": "Startseite", + "item": "{{title}}", + "itemSelected": "ausgewählt", + "itemNotSelectable": "nicht auswählbar", + "itemNavigateTo": "Zu {{title}} navigieren", + "canNavigateTo": "Ordnerähnlicher Inhalt", + "workflowStates": { + "private": "Privat", + "pending": "Ausstehend", + "published": "Veröffentlicht" + }, + "viewModes": { + "list": "Listenansicht", + "grid": "Kachelansicht" + } + }, + "panelgroups": { + "general": "Allgemein", + "content": "Inhalt", + "security": "Sicherheit", + "users": "Benutzer", + "site": "Seitenkonfiguration", + "addons": "Erweiterungen", + "maintenance": "Wartung" + }, + "paneltitles": { + "addons": "Erweiterungen", + "database": "Datenbank", + "contentRules": "Inhaltsregeln", + "undo": "Rückgängig machen", + "urlmanagement": "URL Verwaltung", + "relations": "Relationen", + "moderatecomments": "Kommentare moderieren", + "users": "Benutzer", + "groupMembership": "Gruppenmitgliedschaft", + "groups": "Gruppen" + }, + "blocksEditor": { + "blocksTab": "Blöcke", + "contentTab": "Inhalt" + }, + "sidebar": { + "label": "Seitenleiste" + }, + "auth": { + "username": "Benutzername", + "password": "Passwort", + "signIn": "Anmelden", + "signUp": "Registrieren", + "signInTo": "Bei {{site}} anmelden", + "forgotPassword": "Passwort vergessen? Neues Passwort anfordern", + "returnToHome": "Zur Startseite zurückkehren" + } + } +} \ No newline at end of file diff --git a/apps/seven/public/locales/en/common.json b/apps/seven/public/locales/en/common.json new file mode 100644 index 00000000000..6d59765baa3 --- /dev/null +++ b/apps/seven/public/locales/en/common.json @@ -0,0 +1,234 @@ +{ + "plate": {}, + "blocks": { + "listing": { + "no-results": "No results." + } + }, + "layout": { + "languageSwitcher": { + "switchTo": "Switch to {{ lang }}" + }, + "contenttypes": { + "common": { + "size": "Size:" + }, + "image": { + "download": "Click to download full sized image" + }, + "file": { + "download": "Download file" + } + }, + "toolbar": { + "label": "Toolbar" + }, + "views": { + "link": { + "linkLabel": "The link address is:", + "externalLinkLabel": "The external link address is:" + }, + "event": { + "what": "What", + "when": "When", + "time": { + "sameDayOpenEnd": "{{date}} from {{fromTime}}", + "sameDayRange": "{{date}} from {{fromTime}} to {{toTime}}", + "multiDayWholeDayOpen": "{{fromDate}}", + "multiDayWholeDay": "{{fromDate}} to {{toDate}}", + "multiDayRangeOpen": "{{fromDate}} {{fromTime}}", + "multiDayRange": "{{fromDate}} {{fromTime}} to {{toDate}} {{toTime}}" + }, + "allDates": "All dates", + "where": "Where", + "contact": { + "name": "Contact Name", + "phone": "Contact Phone" + }, + "attendees": "Attendees", + "website": "Website", + "visitWebsite": "Visit website", + "downloadEvent": "Download event" + } + } + }, + "cmsui": { + "add": "Add", + "edit": "Edit", + "save": "Save", + "controlpanel": "Control Panel", + "objectbrowserwidget": { + "openDialog": "Select content", + "dialogTitle": "Select Content", + "closeDialog": "Close selection", + "openSearch": "Search content", + "closeSearch": "Close search", + "searchPlaceholder": "Search content...", + "loading": "Loading...", + "routeannouncer": "Current path: {{route}}", + "noResults": "No content found", + "searchResults": "Search results: {{count}} items", + "searchResultsFor": "Search results for \"{{searchTerm}}\": {{count}} ", + "goback": "Go back", + "changeViewMode": "Switch to {{mode}} view", + "currentItems": "Current content items", + "home": "Home", + "item": "{{title}}", + "itemSelected": "selected", + "itemNotSelectable": "not selectable", + "itemNavigateTo": "Navigate to {{title}}", + "canNavigateTo": "Folderish content", + "workflowStates": { + "private": "Private", + "pending": "Pending", + "published": "Published" + }, + "viewModes": { + "list": "list", + "grid": "grid" + } + }, + "panelgroups": { + "general": "General", + "content": "Content", + "security": "Security", + "users": "Users", + "site": "Site Setup", + "addons": "Add-ons", + "maintenance": "Maintenance" + }, + "paneltitles": { + "addons": "Add-ons", + "database": "Database", + "contentRules": "Content Rules", + "undo": "Undo", + "urlmanagement": "URL Management", + "relations": "Relations", + "moderatecomments": "Moderate Comments", + "users": "Users", + "groupMembership": "Group Membership", + "groups": "Groups" + }, + "blocksEditor": { + "blocksTab": "Blocks", + "contentTab": "Content" + }, + "sidebar": { + "label": "Sidebar" + }, + "auth": { + "username": "username", + "password": "password", + "signIn": "Sign in", + "signUp": "Sign up", + "signInTo": "Sign in to {{site}}", + "forgotPassword": "Forgot password? Request a new password", + "returnToHome": "Return to home page" + } + }, + "publicui": { + "sitemap": "Sitemap", + "search": { + "title": "Search results for", + "results": "Search results", + "placeholder": "Write here...", + "noResults": "No results found" + } + }, + "contents": { + "loading": "Loading...", + "results": { + "number": "{{count}} items", + "contents_of": "Contents of {{title}}", + "no_results": "No items found" + }, + "actions": { + "actions": "Actions", + "upload": "Upload", + "rename": "Rename", + "state": "Change state", + "tags": "Tags", + "properties": "Properties", + "cut": "Cut", + "cutted": "Content '{{title}}' successfully cutted", + "cutted_multiple": "{{number}} contents successfully cutted", + "copy": "Copy", + "copied": "Content '{{title}}' successfully copied", + "copied_multiple": "{{number}} contents successfully copied", + "paste": "Paste", + "pasted": "Content '{{title}}' successfully pasted", + "pasted_multiple": "{{number}} contents successfully pasted", + "delete": "Delete", + "deleted": "Content '{{title}}' successfully deleted", + "deleted_multiple": "{{number}} contents successfully deleted", + "filter": "Filter…", + "edit": "Edit", + "view": "View", + "add": "Add content", + "move_to_top_folder": "Move to top folder", + "move_to_bottom_folder": "Move to bottom folder", + "uploaded": "Content '{{title}}' successfully uploaded", + "uploaded_multiple": "{{number}} contents successfully uploaded" + }, + "item": { + "expired": "Expired", + "scheduled": "Scheduled", + "more_options": "More options" + }, + "indexes": { + "title": "Title", + "select_columns": "Select columns to show", + "boolean": { + "yes": "Yes", + "no": "No" + }, + "review_state": { + "published": "Published", + "private": "Private", + "pending": "Pending", + "intranet": "Intranet", + "draft": "Draft", + "none": "None", + "no_workflow_state": "—" + }, + "date": { + "none": "" + } + }, + "error": "Error", + "unknown_error": "Unknown error", + "rearrange": { + "error": "Error reordering items", + "by": "Rearrange items by…", + "asc": "Ascending", + "desc": "Descending", + "pickOrder": "Pick order for {{index}}" + }, + "modal": { + "close": "Close" + }, + "modal_upload": { + "title": "Upload to \"{{title}}\"", + "upload_more_files": "Upload more files", + "upload_files": "Upload files", + "dropzone_label": "Drag and drop or <1><0>Browse", + "confirm": "Upload", + "remove_file": "Remove file", + "columns": { + "name": "Name", + "size": "Size", + "last_modified": "Last modified" + } + }, + "modal_delete": { + "single": { + "title": "Delete \"{{item}}\"?" + }, + "multi": { + "title": "Delete {{n}} items?" + }, + "description": "This action cannot be undone.", + "confirm": "Delete" + } + } +} \ No newline at end of file diff --git a/apps/seven/public/locales/it/common.json b/apps/seven/public/locales/it/common.json new file mode 100644 index 00000000000..cdd82d4e64b --- /dev/null +++ b/apps/seven/public/locales/it/common.json @@ -0,0 +1,219 @@ +{ + "plate": {}, + "layout": { + "languageSwitcher": { + "switchTo": "Passa a {{ lang }}" + }, + "contenttypes": { + "common": { + "size": "Dimensione:" + }, + "image": { + "download": "Clicca per scaricare l'immagine a grandezza intera" + }, + "file": { + "download": "Clicca per scaricare il file" + } + }, + "toolbar": { + "label": "Barra degli strumenti" + }, + "views": { + "link": { + "linkLabel": "L'indirizzo del link è:", + "externalLinkLabel": "L'indirizzo del link esterno è:" + }, + "event": { + "what": "Cosa", + "when": "Quando", + "time": { + "sameDayOpenEnd": "{{date}} dalle {{fromTime}}", + "sameDayRange": "{{date}} dalle {{fromTime}} alle {{toTime}}", + "multiDayWholeDayOpen": "{{fromDate}}", + "multiDayWholeDay": "Dal {{fromDate}} al {{toDate}}", + "multiDayRangeOpen": "{{fromDate}} {{fromTime}}", + "multiDayRange": "Dal {{fromDate}} {{fromTime}} al {{toDate}} {{toTime}}" + }, + "allDates": "Tutte le date", + "where": "Dove", + "contact": { + "name": "Nome del contatto", + "phone": "Telefono del contatto" + }, + "attendees": "Partecipanti", + "website": "Sito web", + "visitWebsite": "Visita il sito web", + "downloadEvent": "Scarica evento" + } + } + }, + "cmsui": { + "add": "Aggiungi", + "edit": "Modifica", + "save": "Salva", + "controlpanel": "Pannello di controllo", + "objectbrowserwidget": { + "openDialog": "Seleziona contenuti", + "dialogTitle": "Seleziona Contenuti", + "closeDialog": "Chiudi selezione", + "openSearch": "Cerca contenuti", + "closeSearch": "Chiudi ricerca", + "searchPlaceholder": "Cerca contenuti...", + "loading": "Caricamento...", + "noResults": "Nessun contenuto trovato", + "goback": "Torna indietro", + "changeViewMode": "Passa alla vista {{mode}}", + "currentItems": "Elementi correnti", + "home": "Home", + "item": "{{title}}{{#selected}} (selezionato){{/selected}}", + "itemNotSelectable": "{{title}} (non selezionabile)", + "itemNavigateTo": "Naviga verso {{title}}", + "viewModes": { + "list": "elenco", + "grid": "griglia" + } + }, + "panelgroups": { + "general": "Generale", + "content": "Contenuto", + "security": "Sicurezza", + "users": "Utenti", + "site": "Sito", + "addons": "Configurazione prodotti aggiuntivi", + "maintenance": "Manutenzione" + }, + "paneltitles": { + "addons": "Prodotti aggiuntivi", + "database": "Database", + "contentRules": "Regole di contenuto", + "undo": "Annulla operazioni", + "urlmanagement": "Gestione URL", + "relations": "Relazioni", + "moderatecomments": "Moderazione dei commenti", + "users": "Utenti", + "groupMembership": "Appartenenza ai gruppi", + "groups": "Gruppi" + }, + "blocksEditor": { + "blocksTab": "Blocchi", + "contentTab": "Contenuto" + }, + "sidebar": { + "label": "Barra laterale destra" + }, + "auth": { + "username": "nome utente", + "password": "password", + "signIn": "Accedi", + "signUp": "Registrati", + "signInTo": "Accedi a {{site}}", + "forgotPassword": "Password dimenticata? Richiedi una nuova password", + "returnToHome": "Torna alla home page" + } + }, + "publicui": { + "sitemap": "Sitemap", + "search": { + "title": "Risultati della ricerca per", + "results": "Risultati della ricerca", + "placeholder": "Scrivi qui...", + "noResults": "Nessun risultato" + } + }, + "contents": { + "loading": "Caricamento...", + "results": { + "number": "{{count}} elementi", + "contents_of": "Contenuti di {title}", + "no_results": "Nessun elemento trovato" + }, + "actions": { + "actions": "Azioni", + "upload": "Carica", + "rename": "Rinomina", + "state": "Cambia stato", + "tags": "Etichette", + "properties": "Proprietà", + "cut": "Taglia", + "cutted": "Contenuto '{{title}}' tagliato con successo", + "cutted_multiple": "{{number}} contenuti tagliati con successo", + "copy": "Copia", + "copied": "Contenuto '{{title}}' copiato con successo", + "copied_multiple": "{{number}} contenuti copiato con successo", + "paste": "Incolla", + "pasted": "Contenuto '{{title}}' incollato con successo", + "pasted_multiple": "{{number}} contenuti incollati con successo", + "delete": "Elimina", + "deleted": "Contenuto '{{title}}' eliminato con successo", + "deleted_multiple": "{{number}} contenuti eliminati con successo", + "filter": "Filtra…", + "edit": "Modifica", + "view": "Vedi", + "add": "Aggiungi un contenuto", + "move_to_top_folder": "Sposta in cima alla cartella", + "move_to_bottom_folder": "Sposta in fondo alla cartella", + "uploaded": "Contenuto '{{title}}' caricato con successo", + "uploaded_multiple": "{{number}} contenuti caricati con successo" + }, + "item": { + "expired": "Scaduto", + "scheduled": "Pianificato", + "more_options": "Altre opzioni" + }, + "indexes": { + "title": "Titolo", + "select_columns": "Seleziona le colonne da visualizzare", + "boolean": { + "yes": "Sì", + "no": "No" + }, + "review_state": { + "published": "Pubblicato", + "private": "Privato", + "pending": "In attesa di revisione", + "intranet": "Intranet", + "draft": "In bozza", + "none": "Nessuno", + "no_workflow_state": "—" + }, + "date": { + "none": "" + } + }, + "error": "Errore", + "unknown_error": "Errore sconsciuto", + "rearrange": { + "error": "Errore durante la riposizione degli elementi", + "by": "Riordina gli elementi per…", + "asc": "Crescente", + "desc": "Decrescente", + "pickOrder": "Riposiziona {{index}}" + }, + "modal": { + "close": "Annulla" + }, + "modal_upload": { + "title": "Carica in \"{{title}}\"", + "upload_more_files": "Carica altri file", + "upload_files": "Carica file", + "dropzone_label": "Trascina i file qui, o clicca per <1><0>sfogliare", + "confirm": "Carica", + "remove_file": "Rimuovi file", + "columns": { + "name": "Nome", + "size": "Dimensione", + "last_modified": "Ultima modifica" + } + }, + "modal_delete": { + "single": { + "title": "Vuoi eliminare \"{{item}}\"?" + }, + "multi": { + "title": "Vuoi eliminare {{n}} elementi?" + }, + "description": "Questa azione non può essere annullata.", + "confirm": "Procedi con l'eliminazione" + } + } +} \ No newline at end of file diff --git a/packages/client/dist/index.cjs b/packages/client/dist/index.cjs new file mode 100644 index 00000000000..99fb1c9ae51 --- /dev/null +++ b/packages/client/dist/index.cjs @@ -0,0 +1,2278 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var index_exports = {}; +__export(index_exports, { + default: () => index_default +}); +module.exports = __toCommonJS(index_exports); + +// src/api.ts +var import_axios = __toESM(require("axios"), 1); +var import_query_string = __toESM(require("query-string"), 1); +var import_debug = __toESM(require("debug"), 1); +var debug = (0, import_debug.default)("axios"); +var APISUFFIX = "/++api++"; +function getBackendURL(apiPath, apiSuffix, path) { + if (path.startsWith("http://") || path.startsWith("https://")) return path; + const adjustedPath = path[0] !== "/" ? `/${path}` : path; + return `${apiPath}${apiSuffix ?? APISUFFIX}${adjustedPath}`; +} +var _handleResponse = (response) => response; +var _handleError = (config) => (error) => { + debug(error); + const status = error.status ?? 0; + return Promise.reject({ + status: error.status ?? error.code, + data: error.response?.data, + location: status >= 300 && status < 400 ? error.response?.headers.location.replaceAll( + `${config.apiPath}${config.apiSuffix ?? APISUFFIX}`, + "" + ).replace(/\?.*$/, "") : void 0 + }); +}; +function axiosConfigAdapter(method, path, options) { + const { + config, + params, + data, + maxRedirects, + headers = {} + } = options; + const axiosConfig = { + method, + url: getBackendURL(config.apiPath, config.apiSuffix, path), + params, + headers: { + Accept: "application/json", + ...headers + }, + data, + validateStatus: function(status) { + return status >= 200 && status < 300; + }, + paramsSerializer: function(params2) { + return import_query_string.default.stringify(params2, { arrayFormat: "colon-list-separator" }); + }, + maxRedirects + }; + if (config.token && axiosConfig.headers) { + axiosConfig.headers["Authorization"] = `Bearer ${config.token}`; + } + debug(axiosConfig); + return axiosConfig; +} +async function apiRequest(method, path, options) { + const instance = import_axios.default.create(); + if (options.raw) { + instance.interceptors.response.use(void 0, _handleError(options.config)); + } else { + instance.interceptors.response.use( + _handleResponse, + _handleError(options.config) + ); + } + return instance.request(axiosConfigAdapter(method, path, options)); +} + +// src/restapi/actions/get.ts +var import_zod = require("zod"); +var getActionsSchema = import_zod.z.object({ + path: import_zod.z.string() +}); +async function getActions({ path }) { + const validatedArgs = getActionsSchema.parse({ + path + }); + const options = { + config: this.config, + params: {} + }; + const actionsPath = `${validatedArgs.path}/@actions`; + return apiRequest("get", actionsPath, options); +} + +// src/restapi/addons/get_list.ts +async function getAddons() { + const options = { + config: this.config, + params: {} + }; + return apiRequest("get", "/@addons", options); +} + +// src/restapi/addons/get.ts +var import_zod2 = require("zod"); +var getAddonSchema = import_zod2.z.object({ + id: import_zod2.z.string() +}); +async function getAddon({ id }) { + const validatedArgs = getAddonSchema.parse({ + id + }); + const options = { + config: this.config, + params: {} + }; + const addonName = `@addons/${validatedArgs.id}`; + return apiRequest("get", addonName, options); +} + +// src/restapi/addons/install.ts +var import_zod3 = require("zod"); +var installAddonSchema = import_zod3.z.object({ + id: import_zod3.z.string() +}); +async function installAddon({ id }) { + const validatedArgs = installAddonSchema.parse({ + id + }); + const options = { + config: this.config, + params: {} + }; + const addonName = `@addons/${validatedArgs.id}/install`; + return apiRequest("post", addonName, options); +} + +// src/restapi/addons/uninstall.ts +var import_zod4 = require("zod"); +var uninstallAddonSchema = import_zod4.z.object({ + id: import_zod4.z.string() +}); +async function uninstallAddon({ id }) { + const validatedArgs = uninstallAddonSchema.parse({ + id + }); + const options = { + config: this.config, + params: {} + }; + const addonName = `@addons/${validatedArgs.id}/uninstall`; + return apiRequest("post", addonName, options); +} + +// src/restapi/addons/upgrade.ts +var import_zod5 = require("zod"); +var upgradeAddonSchema = import_zod5.z.object({ + id: import_zod5.z.string() +}); +async function upgradeAddon({ id }) { + const validatedArgs = upgradeAddonSchema.parse({ + id + }); + const options = { + config: this.config, + params: {} + }; + const addonName = `@addons/${validatedArgs.id}/upgrade`; + return apiRequest("post", addonName, options); +} + +// src/restapi/addons/install_profile.ts +var import_zod6 = require("zod"); +var installAddonProfileSchema = import_zod6.z.object({ + id: import_zod6.z.string(), + profile: import_zod6.z.string() +}); +async function installAddonProfile({ id, profile }) { + const validatedArgs = installAddonProfileSchema.parse({ + id, + profile + }); + const options = { + config: this.config, + params: {} + }; + const addonName = `@addons/${validatedArgs.id}/${profile}`; + return apiRequest("post", addonName, options); +} + +// src/restapi/aliases/get_all.ts +async function getAllAliases() { + const options = { + config: this.config, + params: {} + }; + return apiRequest("get", "/@aliases", options); +} + +// src/restapi/aliases/get.ts +var import_zod7 = require("zod"); +var getAliasesSchema = import_zod7.z.object({ + path: import_zod7.z.string() +}); +async function getAliases({ path }) { + const validatedArgs = getAliasesSchema.parse({ + path + }); + const options = { + config: this.config, + params: {} + }; + const aliasesPath = `${validatedArgs.path}/@aliases`; + return apiRequest("get", aliasesPath, options); +} + +// src/restapi/aliases/create.ts +var import_zod9 = require("zod"); + +// src/validation/aliases.ts +var import_zod8 = require("zod"); +var itemSchema = import_zod8.z.object({ + path: import_zod8.z.string() +}); +var createAliasDataSchema = import_zod8.z.object({ + items: import_zod8.z.array(itemSchema) +}); +var deleteAliasesDataSchema = import_zod8.z.object({ + items: import_zod8.z.array(itemSchema) +}); +var rootItemSchema = import_zod8.z.object({ + datetime: import_zod8.z.string().optional(), + path: import_zod8.z.string(), + "redirect-to": import_zod8.z.string() +}); +var createAliasesDataSchema = import_zod8.z.object({ + items: import_zod8.z.array(rootItemSchema) +}); + +// src/restapi/aliases/create.ts +var createAliasArgsSchema = import_zod9.z.object({ + path: import_zod9.z.string(), + data: createAliasDataSchema +}); +async function createAlias({ path, data }) { + const validatedArgs = createAliasArgsSchema.parse({ + path, + data + }); + const addAliasPath = `${validatedArgs.path}/@aliases`; + const options = { + data: validatedArgs.data, + config: this.config + }; + return apiRequest("post", addAliasPath, options); +} + +// src/restapi/aliases/create_multiple.ts +var import_zod10 = require("zod"); +var createAliasesArgsSchema = import_zod10.z.object({ + data: createAliasesDataSchema +}); +async function createAliases({ data }) { + const validatedArgs = createAliasesArgsSchema.parse({ + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + return apiRequest("post", "/@aliases", options); +} + +// src/restapi/aliases/delete.ts +var import_zod11 = require("zod"); +var deleteAliasesArgsSchema = import_zod11.z.object({ + path: import_zod11.z.string(), + data: deleteAliasesDataSchema +}); +async function deleteAliases({ path, data }) { + const validatedArgs = deleteAliasesArgsSchema.parse({ + path, + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + const aliasesPath = `${validatedArgs.path}/@aliases`; + return apiRequest("delete", aliasesPath, options); +} + +// src/restapi/breadcrumbs/get.ts +var import_zod12 = require("zod"); +var getBreadcrumbsSchema = import_zod12.z.object({ + path: import_zod12.z.string() +}); +async function getBreadcrumbs({ path }) { + const validatedArgs = getBreadcrumbsSchema.parse({ + path + }); + const options = { + config: this.config, + params: {} + }; + const breadcrumbsPath = `${validatedArgs.path}/@breadcrumbs`; + return apiRequest("get", breadcrumbsPath, options); +} + +// src/restapi/comments/get.ts +var import_zod13 = require("zod"); +var getCommentsSchema = import_zod13.z.object({ + path: import_zod13.z.string() +}); +async function getComments({ path }) { + const validatedArgs = getCommentsSchema.parse({ + path + }); + const options = { + config: this.config, + params: {} + }; + const commentsPath = `/${validatedArgs.path}/@comments`; + return apiRequest("get", commentsPath, options); +} + +// src/restapi/comments/create.ts +var import_zod15 = require("zod"); + +// src/validation/comments.ts +var import_zod14 = require("zod"); +var createCommentDataSchema = import_zod14.z.object({ + text: import_zod14.z.string() +}); + +// src/restapi/comments/create.ts +var createCommentArgsSchema = import_zod15.z.object({ + path: import_zod15.z.string(), + in_reply_to: import_zod15.z.string().optional(), + data: createCommentDataSchema +}); +async function createComment({ path, in_reply_to, data }) { + const validatedArgs = createCommentArgsSchema.parse({ + path, + in_reply_to, + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + const commentsPath = in_reply_to ? `/${validatedArgs.path}/@comments/${validatedArgs.in_reply_to}` : `/${validatedArgs.path}/@comments`; + return apiRequest("post", commentsPath, options); +} + +// src/restapi/comments/update.ts +var import_zod16 = require("zod"); +var updateCommentArgsSchema = import_zod16.z.object({ + path: import_zod16.z.string(), + comment_id: import_zod16.z.string(), + data: createCommentDataSchema +}); +async function updateComment({ path, comment_id, data }) { + const validatedArgs = updateCommentArgsSchema.parse({ + path, + comment_id, + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + const commentsPath = `${validatedArgs.path}/@comments/${validatedArgs.comment_id}`; + return apiRequest("patch", commentsPath, options); +} + +// src/restapi/comments/delete.ts +var import_zod17 = require("zod"); +var deleteCommentArgsSchema = import_zod17.z.object({ + path: import_zod17.z.string(), + comment_id: import_zod17.z.string() +}); +async function deleteComment({ path, comment_id }) { + const validatedArgs = deleteCommentArgsSchema.parse({ + path, + comment_id + }); + const options = { + config: this.config + }; + const commentsPath = `${validatedArgs.path}/@comments/${validatedArgs.comment_id}`; + return apiRequest("delete", commentsPath, options); +} + +// src/restapi/content/get.ts +var import_zod18 = require("zod"); +var getContentArgsSchema = import_zod18.z.object({ + path: import_zod18.z.string(), + version: import_zod18.z.string().optional(), + page: import_zod18.z.number().optional(), + fullObjects: import_zod18.z.boolean().optional(), + expand: import_zod18.z.string().array().optional() +}); +async function getContent({ path, version, page, fullObjects, expand }) { + const validatedArgs = getContentArgsSchema.parse({ + path, + version, + page, + fullObjects, + expand + }); + const options = { + config: this.config, + maxRedirects: 0, + params: { + ...validatedArgs.page && { page: validatedArgs.page }, + ...validatedArgs.version && { version: validatedArgs.version }, + ...validatedArgs.fullObjects && { + fullobjects: validatedArgs.fullObjects + } + } + }; + if (validatedArgs.version) { + return apiRequest( + "get", + `${path}/@history/${validatedArgs.version}`, + options + ); + } + if (validatedArgs.expand) { + options.params = { + ...options.params, + expand + }; + } + return apiRequest("get", path, options); +} + +// src/restapi/content/create.ts +var import_zod20 = require("zod"); + +// src/validation/content.ts +var import_zod19 = require("zod"); +var RelatedItemPayloadSchema = import_zod19.z.object({ + "@id": import_zod19.z.string(), + "@type": import_zod19.z.string(), + CreationDate: import_zod19.z.string(), + Creator: import_zod19.z.string(), + Date: import_zod19.z.string(), + Description: import_zod19.z.string(), + EffectiveDate: import_zod19.z.unknown(), + ExpirationDate: import_zod19.z.unknown(), + ModificationDate: import_zod19.z.string(), + Subject: import_zod19.z.array(import_zod19.z.unknown()), + Title: import_zod19.z.string(), + Type: import_zod19.z.string(), + UID: import_zod19.z.string(), + author_name: import_zod19.z.unknown(), + cmf_uid: import_zod19.z.unknown(), + commentators: import_zod19.z.array(import_zod19.z.unknown()), + created: import_zod19.z.string(), + description: import_zod19.z.string(), + effective: import_zod19.z.string(), + end: import_zod19.z.unknown(), + exclude_from_nav: import_zod19.z.boolean(), + expires: import_zod19.z.string(), + getIcon: import_zod19.z.unknown(), + getId: import_zod19.z.string(), + getObjSize: import_zod19.z.string(), + getPath: import_zod19.z.string(), + getRemoteUrl: import_zod19.z.unknown(), + getURL: import_zod19.z.string(), + hasPreviewImage: import_zod19.z.unknown(), + head_title: import_zod19.z.unknown(), + id: import_zod19.z.string(), + image_field: import_zod19.z.string().nullable(), + image_scales: import_zod19.z.unknown(), + in_response_to: import_zod19.z.unknown(), + is_folderish: import_zod19.z.boolean(), + last_comment_date: import_zod19.z.unknown(), + listCreators: import_zod19.z.array(import_zod19.z.string()), + location: import_zod19.z.unknown(), + mime_type: import_zod19.z.string(), + modified: import_zod19.z.string(), + nav_title: import_zod19.z.unknown(), + portal_type: import_zod19.z.string(), + review_state: import_zod19.z.string(), + start: import_zod19.z.unknown(), + sync_uid: import_zod19.z.unknown(), + title: import_zod19.z.string(), + total_comments: import_zod19.z.number() +}).partial().required({ + "@id": true, + title: true +}); +var createContentDataSchema = import_zod19.z.object({ + "@id": import_zod19.z.string().optional(), + "@static_behaviors": import_zod19.z.unknown().optional(), + "@type": import_zod19.z.string(), + allow_discussion: import_zod19.z.boolean().optional(), + blocks: import_zod19.z.unknown().optional(), + blocks_layout: import_zod19.z.object({ items: import_zod19.z.array(import_zod19.z.string()) }).optional(), + contributors: import_zod19.z.array(import_zod19.z.string()).optional(), + creators: import_zod19.z.array(import_zod19.z.string()).optional(), + description: import_zod19.z.string().optional(), + effective: import_zod19.z.string().nullable().optional(), + exclude_from_nav: import_zod19.z.boolean().optional(), + expires: import_zod19.z.string().nullable().optional(), + file: import_zod19.z.object({ + "content-type": import_zod19.z.string(), + data: import_zod19.z.string(), + encoding: import_zod19.z.string(), + filename: import_zod19.z.string() + }).optional(), + id: import_zod19.z.string().optional(), + image: import_zod19.z.object({ + "content-type": import_zod19.z.string(), + data: import_zod19.z.string(), + encoding: import_zod19.z.string(), + filename: import_zod19.z.string() + }).optional(), + language: import_zod19.z.string().optional(), + preview_caption: import_zod19.z.string().optional(), + preview_image: import_zod19.z.object({ + "content-type": import_zod19.z.string(), + data: import_zod19.z.string(), + encoding: import_zod19.z.string(), + filename: import_zod19.z.string() + }).optional(), + relatedItems: import_zod19.z.array(RelatedItemPayloadSchema).optional(), + rights: import_zod19.z.string().nullable().optional(), + title: import_zod19.z.string(), + versioning_enabled: import_zod19.z.boolean().optional() +}); +var updateContentDataSchema = import_zod19.z.object({ + allow_discussion: import_zod19.z.boolean().optional(), + blocks: import_zod19.z.unknown().optional(), + blocks_layout: import_zod19.z.object({ items: import_zod19.z.array(import_zod19.z.string()) }).optional(), + contributors: import_zod19.z.array(import_zod19.z.string()).optional(), + creators: import_zod19.z.array(import_zod19.z.string()).optional(), + description: import_zod19.z.string().optional(), + effective: import_zod19.z.string().nullable().optional(), + exclude_from_nav: import_zod19.z.boolean().optional(), + expires: import_zod19.z.string().nullable().optional(), + id: import_zod19.z.string().nullable().optional(), + ordering: import_zod19.z.object({ + obj_id: import_zod19.z.string(), + delta: import_zod19.z.union([import_zod19.z.number(), import_zod19.z.literal("bottom"), import_zod19.z.literal("top")]), + subset_ids: import_zod19.z.array(import_zod19.z.string()).optional() + }).optional(), + preview_caption: import_zod19.z.string().nullable().optional(), + preview_image: import_zod19.z.object({ + "content-type": import_zod19.z.string(), + data: import_zod19.z.string(), + encoding: import_zod19.z.string(), + filename: import_zod19.z.string() + }).nullable().optional(), + relatedItems: import_zod19.z.array(RelatedItemPayloadSchema).optional(), + rights: import_zod19.z.string().nullable().optional(), + table_of_contents: import_zod19.z.boolean().nullable().optional(), + title: import_zod19.z.string().optional(), + versioning_enabled: import_zod19.z.boolean().optional() +}).partial(); +var copyMoveContentDataSchema = import_zod19.z.object({ + path: import_zod19.z.string(), + data: import_zod19.z.object({ + source: import_zod19.z.union([import_zod19.z.string(), import_zod19.z.array(import_zod19.z.string())]) + }) +}); + +// src/restapi/content/create.ts +var createContentArgsSchema = import_zod20.z.object({ + path: import_zod20.z.string(), + data: createContentDataSchema +}); +async function createContent({ path, data }) { + const validatedArgs = createContentArgsSchema.parse({ + path, + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + return apiRequest("post", validatedArgs.path, options); +} + +// src/restapi/content/update.ts +var import_zod21 = require("zod"); +var updateContentArgsSchema = import_zod21.z.object({ + path: import_zod21.z.string(), + data: updateContentDataSchema +}); +async function updateContent({ path, data }) { + const validatedArgs = updateContentArgsSchema.parse({ + path, + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + return apiRequest("patch", validatedArgs.path, options); +} + +// src/restapi/content/delete.ts +var import_zod22 = require("zod"); +var deleteContentArgsSchema = import_zod22.z.object({ + path: import_zod22.z.string() +}); +async function deleteContent({ path }) { + const validatedArgs = deleteContentArgsSchema.parse({ + path + }); + const options = { + config: this.config + }; + return apiRequest("delete", validatedArgs.path, options); +} + +// src/restapi/content/copy.ts +var import_zod23 = require("zod"); +async function copyContent({ path, data }) { + const validatedArgs = copyMoveContentDataSchema.parse({ + path, + data + }); + const options = { + config: this.config, + data: validatedArgs.data + }; + const copyPath = `${validatedArgs.path}/@copy`; + return apiRequest("post", copyPath, options); +} + +// src/restapi/content/move.ts +var import_zod24 = require("zod"); +async function moveContent({ path, data }) { + const validatedArgs = copyMoveContentDataSchema.parse({ + path, + data + }); + const options = { + config: this.config, + data: validatedArgs.data + }; + const movePath = `${validatedArgs.path}/@move`; + return apiRequest("post", movePath, options); +} + +// src/restapi/contextnavigation/get.ts +var import_zod25 = require("zod"); +var getContextNavigationSchema = import_zod25.z.object({ + path: import_zod25.z.string() +}); +async function getContextNavigation({ path }) { + const validatedArgs = getContextNavigationSchema.parse({ + path + }); + const options = { + config: this.config, + params: {} + }; + const contextnavigationPath = `${validatedArgs.path}/@contextnavigation`; + return apiRequest("get", contextnavigationPath, options); +} + +// src/restapi/controlpanels/get_list.ts +async function getControlpanels() { + const options = { + config: this.config, + params: {} + }; + return apiRequest("get", "/@controlpanels", options); +} + +// src/restapi/controlpanels/get.ts +var import_zod26 = require("zod"); +var getControlpanelSchema = import_zod26.z.object({ + id: import_zod26.z.string() +}); +async function getControlpanel({ id }) { + const validatedArgs = getControlpanelSchema.parse({ + id + }); + const options = { + config: this.config, + params: {} + }; + const getControlpanelPath = `@controlpanels/${validatedArgs.id}`; + return apiRequest("get", getControlpanelPath, options); +} + +// src/restapi/controlpanels/create.ts +var import_zod27 = require("zod"); +var createControlpanelArgsSchema = import_zod27.z.object({ + path: import_zod27.z.string(), + data: import_zod27.z.any() +}); +async function createControlpanel({ path, data }) { + const validatedArgs = createControlpanelArgsSchema.parse({ + path, + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + const createControlpanelPath = `@controlpanels/${validatedArgs.path}`; + return apiRequest("post", createControlpanelPath, options); +} + +// src/restapi/controlpanels/update.ts +var import_zod28 = require("zod"); +var updateControlpanelArgsSchema = import_zod28.z.object({ + path: import_zod28.z.string(), + data: import_zod28.z.any() +}); +async function updateControlpanel({ path, data }) { + const validatedArgs = updateControlpanelArgsSchema.parse({ + path, + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + const updateControlpanelPath = `@controlpanels/${validatedArgs.path}`; + return apiRequest("patch", updateControlpanelPath, options); +} + +// src/restapi/controlpanels/delete.ts +var import_zod29 = require("zod"); +var deleteControlpanelArgsSchema = import_zod29.z.object({ + path: import_zod29.z.string(), + data: import_zod29.z.any() +}); +async function deleteControlpanel({ path, data }) { + const validatedArgs = deleteControlpanelArgsSchema.parse({ + path, + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + const deleteControlpanelPath = `@controlpanels/${validatedArgs.path}`; + return apiRequest("delete", deleteControlpanelPath, options); +} + +// src/restapi/database/get.ts +async function getDatabase() { + const options = { + config: this.config, + params: {} + }; + return apiRequest("get", "/@database", options); +} + +// src/restapi/email-notification/post.ts +var import_zod30 = require("zod"); +var emailNotificationDataSchema = import_zod30.z.object({ + name: import_zod30.z.string(), + from: import_zod30.z.string(), + subject: import_zod30.z.string(), + message: import_zod30.z.string() +}); +var emailNotificationArgsSchema = import_zod30.z.object({ + user: import_zod30.z.string().optional(), + data: emailNotificationDataSchema +}); +async function emailNotification({ user, data }) { + const validatedArgs = emailNotificationArgsSchema.parse({ + user, + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + const emailNotificationPath = user ? `/@users/${user}/@email-notification` : "/@email-notification"; + return apiRequest("post", emailNotificationPath, options); +} + +// src/restapi/email-send/post.ts +var import_zod31 = require("zod"); +var emailSendDataSchema = import_zod31.z.object({ + name: import_zod31.z.string(), + from: import_zod31.z.string(), + to: import_zod31.z.string(), + subject: import_zod31.z.string(), + message: import_zod31.z.string() +}); +var emailSendArgsSchema = import_zod31.z.object({ + data: emailSendDataSchema +}); +async function emailSend({ data }) { + const validatedArgs = emailSendArgsSchema.parse({ + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + return apiRequest("post", "/@email-send", options); +} + +// src/restapi/groups/get_list.ts +async function getGroups() { + const options = { + config: this.config, + params: {} + }; + return apiRequest("get", "/@groups", options); +} + +// src/restapi/groups/get.ts +var import_zod32 = require("zod"); +var getGroupSchema = import_zod32.z.object({ + id: import_zod32.z.string() +}); +async function getGroup({ id }) { + const validatedArgs = getGroupSchema.parse({ + id + }); + const options = { + config: this.config, + params: {} + }; + const groupName = `@groups/${validatedArgs.id}`; + return apiRequest("get", groupName, options); +} + +// src/restapi/groups/create.ts +var import_zod34 = require("zod"); + +// src/validation/groups.ts +var import_zod33 = require("zod"); +var createGroupDataSchema = import_zod33.z.object({ + description: import_zod33.z.string().optional(), + email: import_zod33.z.string().optional(), + groupname: import_zod33.z.string(), + groups: import_zod33.z.array(import_zod33.z.string()).optional(), + roles: import_zod33.z.array(import_zod33.z.string()).optional(), + title: import_zod33.z.string().optional(), + users: import_zod33.z.array(import_zod33.z.string()).optional() +}); +var updateGroupDataSchema = import_zod33.z.object({ + description: import_zod33.z.string().optional(), + email: import_zod33.z.string().optional(), + title: import_zod33.z.string().optional() +}); + +// src/restapi/groups/create.ts +var createGroupArgsSchema = import_zod34.z.object({ + data: createGroupDataSchema +}); +async function createGroup({ data }) { + const validatedArgs = createGroupArgsSchema.parse({ + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + return apiRequest("post", "/@groups", options); +} + +// src/restapi/groups/update.ts +var import_zod35 = require("zod"); +var updateGroupArgsSchema = import_zod35.z.object({ + id: import_zod35.z.string(), + data: updateGroupDataSchema +}); +async function updateGroup({ id, data }) { + const validatedArgs = updateGroupArgsSchema.parse({ + id, + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + const groupName = `/@groups/${validatedArgs.id}`; + return apiRequest("patch", groupName, options); +} + +// src/restapi/groups/delete.ts +var import_zod36 = require("zod"); +var deleteGroupArgsSchema = import_zod36.z.object({ + id: import_zod36.z.string() +}); +async function deleteGroup({ id }) { + const validatedArgs = deleteGroupArgsSchema.parse({ + id + }); + const options = { + config: this.config + }; + const groupName = `/@groups/${validatedArgs.id}`; + return apiRequest("delete", groupName, options); +} + +// src/restapi/history/get.ts +var import_zod37 = require("zod"); +var getHistorySchema = import_zod37.z.object({ + path: import_zod37.z.string() +}); +async function getHistory({ path }) { + const validatedArgs = getHistorySchema.parse({ + path + }); + const options = { + config: this.config, + params: {} + }; + const historyPath = `/${validatedArgs.path}/@history`; + return apiRequest("get", historyPath, options); +} + +// src/restapi/history/get_version.ts +var import_zod38 = require("zod"); +var getHistoryVersionSchema = import_zod38.z.object({ + path: import_zod38.z.string(), + version: import_zod38.z.number() +}); +async function getHistoryVersion({ path, version }) { + const validatedArgs = getHistoryVersionSchema.parse({ + path, + version + }); + const options = { + config: this.config, + params: {} + }; + const historyPath = `${validatedArgs.path}/@history/${validatedArgs.version}`; + return apiRequest("get", historyPath, options); +} + +// src/restapi/history/revert.ts +var import_zod40 = require("zod"); + +// src/validation/history.ts +var import_zod39 = require("zod"); +var revertHistoryDataSchema = import_zod39.z.object({ + version: import_zod39.z.number() +}); + +// src/restapi/history/revert.ts +var revertHistoryArgsSchema = import_zod40.z.object({ + path: import_zod40.z.string(), + data: revertHistoryDataSchema +}); +async function revertHistory({ path, data }) { + const validatedArgs = revertHistoryArgsSchema.parse({ + path, + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + const historyPath = `${validatedArgs.path}/@history`; + return apiRequest("patch", historyPath, options); +} + +// src/restapi/linkintegrity/get.ts +var import_zod41 = require("zod"); +var getLinkintegriyArgsSchema = import_zod41.z.object({ + uids: import_zod41.z.string() +}); +async function getLinkintegrity({ uids }) { + const validatedArgs = getLinkintegriyArgsSchema.parse({ + uids + }); + const options = { + config: this.config, + params: { + ...validatedArgs && { uids: validatedArgs.uids } + } + }; + return apiRequest("get", "/@linkintegrity", options); +} + +// src/restapi/lock/get.ts +var import_zod42 = require("zod"); +var getLockSchema = import_zod42.z.object({ + path: import_zod42.z.string() +}); +async function getLock({ path }) { + const validatedArgs = getLockSchema.parse({ + path + }); + const options = { + config: this.config, + params: {} + }; + const getLockPath = `/${validatedArgs.path}/@lock`; + return apiRequest("get", getLockPath, options); +} + +// src/restapi/lock/create.ts +var import_zod44 = require("zod"); + +// src/validation/lock.ts +var import_zod43 = require("zod"); +var createLockDataSchema = import_zod43.z.object({ + stealable: import_zod43.z.boolean().optional(), + timeout: import_zod43.z.number().optional() +}); +var deleteLockDataSchema = import_zod43.z.object({ + force: import_zod43.z.boolean().optional() +}); + +// src/restapi/lock/create.ts +var createLockArgsSchema = import_zod44.z.object({ + path: import_zod44.z.string(), + data: createLockDataSchema +}); +async function createLock({ path, data }) { + const validatedArgs = createLockArgsSchema.parse({ + path, + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + const addLockPath = `/${validatedArgs.path}/@lock`; + return apiRequest("post", addLockPath, options); +} + +// src/restapi/lock/update.ts +var import_zod45 = require("zod"); +var updateLockArgsSchema = import_zod45.z.object({ + path: import_zod45.z.string(), + locktoken: import_zod45.z.string() +}); +async function updateLock({ path, locktoken }) { + const validatedArgs = updateLockArgsSchema.parse({ + path, + locktoken + }); + const options = { + headers: { + "Lock-Token": validatedArgs.locktoken + }, + config: this.config + }; + return apiRequest("patch", validatedArgs.path, options); +} + +// src/restapi/lock/delete.ts +var import_zod46 = require("zod"); +var deleteLockArgsSchema = import_zod46.z.object({ + path: import_zod46.z.string(), + data: deleteLockDataSchema.optional() +}); +async function deleteLock({ path, data }) { + const validatedArgs = deleteLockArgsSchema.parse({ + path, + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + const deleteLockPath = `/${validatedArgs.path}/@lock`; + return apiRequest("delete", deleteLockPath, options); +} + +// src/restapi/login/post.ts +var import_zod47 = require("zod"); +var loginArgsSchema = import_zod47.z.object({ + data: import_zod47.z.object({ + login: import_zod47.z.string(), + password: import_zod47.z.string() + }) +}); +async function login({ data }) { + const validatedArgs = loginArgsSchema.parse({ data }); + const options = { + data: { + login: validatedArgs.data.login, + password: validatedArgs.data.password + }, + config: this.config + }; + return apiRequest("post", "/@login", options); +} + +// src/restapi/navigation/get.ts +var import_zod48 = require("zod"); +var getNavigationSchema = import_zod48.z.object({ + path: import_zod48.z.string(), + depth: import_zod48.z.number().optional() +}); +async function getNavigation({ path, depth }) { + const validatedArgs = getNavigationSchema.parse({ + path, + depth + }); + const options = { + config: this.config, + params: {} + }; + const navigationPath = `${validatedArgs.path}/@navigation`; + if (validatedArgs.depth) { + options.params["expand.navigation.depth"] = validatedArgs.depth; + } + return apiRequest("get", navigationPath, options); +} + +// src/restapi/navroot/get.ts +var import_zod49 = require("zod"); +var getNavrootSchema = import_zod49.z.object({ + path: import_zod49.z.string(), + language: import_zod49.z.string().optional() +}); +async function getNavroot({ path, language }) { + const validatedArgs = getNavrootSchema.parse({ + path, + language + }); + const options = { + config: this.config, + params: {} + }; + const navrootPath = language ? `/${validatedArgs.language}/${validatedArgs.path}/@navroot` : `/${validatedArgs.path}/@navroot`; + return apiRequest("get", navrootPath, options); +} + +// src/restapi/principals/get.ts +var import_zod50 = require("zod"); +var getPrincipalsSchema = import_zod50.z.object({ + search: import_zod50.z.string() +}); +async function getPrincipals({ search: search2 }) { + const validatedArgs = getPrincipalsSchema.parse({ + search: search2 + }); + const options = { + config: this.config, + params: {} + }; + const principalsPath = `/@principals?search=${validatedArgs.search}`; + return apiRequest("get", principalsPath, options); +} + +// src/restapi/querysources/get.ts +var import_zod51 = require("zod"); +var getQuerysourcesSchema = import_zod51.z.object({ + path: import_zod51.z.string(), + field: import_zod51.z.string(), + query: import_zod51.z.string() +}); +async function getQuerysources({ path, field, query: query2 }) { + const validatedArgs = getQuerysourcesSchema.parse({ + path, + field, + query: query2 + }); + const options = { + config: this.config, + params: { + ...validatedArgs.query && { query: validatedArgs.query } + } + }; + const querysourcePath = `/${validatedArgs.path}/@querysources/${field}`; + return apiRequest("get", querysourcePath, options); +} + +// src/restapi/querystring/get.ts +async function getQuerystring() { + const options = { + config: this.config, + params: {} + }; + return apiRequest("get", "/@querystring", options); +} + +// src/restapi/querystring-search/get.ts +var import_zod53 = require("zod"); + +// src/validation/querystring-search.ts +var import_zod52 = require("zod"); +var query = import_zod52.z.object({ + i: import_zod52.z.string(), + o: import_zod52.z.string(), + v: import_zod52.z.union([import_zod52.z.string(), import_zod52.z.array(import_zod52.z.string())]) +}); +var querystringSearchDataSchema = import_zod52.z.object({ + b_start: import_zod52.z.string().optional(), + b_size: import_zod52.z.string().optional(), + limit: import_zod52.z.string().optional(), + sort_on: import_zod52.z.string().optional(), + sort_order: import_zod52.z.string().optional(), + fullobjects: import_zod52.z.boolean().optional(), + query: import_zod52.z.array(query), + post: import_zod52.z.boolean().optional() +}); + +// src/restapi/querystring-search/get.ts +async function querystringSearch({ query: query2, post }) { + const validatedArgs = querystringSearchDataSchema.parse({ + query: query2 + }); + if (post) { + const options = { + data: { query: validatedArgs.query }, + config: this.config + }; + return apiRequest("post", "/@querystring-search", options); + } else { + const queryObject = { query: validatedArgs.query }; + const querystring = JSON.stringify(queryObject); + const encodedQuery = encodeURIComponent(querystring); + const options = { + config: this.config, + params: { + ...encodedQuery && { query: encodedQuery } + } + }; + return apiRequest("get", "/@querystring-search", options); + } +} + +// src/restapi/registry/get_list.ts +async function getRegistry() { + const options = { + config: this.config, + params: {} + }; + return apiRequest("get", "/@registry", options); +} + +// src/restapi/registry/get.ts +var import_zod54 = require("zod"); +var getRegistryRecordSchema = import_zod54.z.object({ + name: import_zod54.z.string() +}); +async function getRegistryRecord({ name }) { + const validatedArgs = getRegistryRecordSchema.parse({ + name + }); + const options = { + config: this.config, + params: {} + }; + const registryPath = `/@registry/${validatedArgs.name}`; + return apiRequest("get", registryPath, options); +} + +// src/restapi/registry/update.ts +var import_zod56 = require("zod"); + +// src/validation/registry.ts +var import_zod55 = require("zod"); +var updateRegistryDataSchema = import_zod55.z.record(import_zod55.z.any()); + +// src/restapi/registry/update.ts +var updateRegistryArgsSchema = import_zod56.z.object({ + data: updateRegistryDataSchema +}); +async function updateRegistry({ data }) { + const validatedArgs = updateRegistryArgsSchema.parse({ + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + return apiRequest("patch", "/@registry", options); +} + +// src/restapi/relations/get_list.ts +async function getAllRelations() { + const options = { + config: this.config, + params: {} + }; + return apiRequest("get", "/@relations", options); +} + +// src/restapi/relations/get.ts +var import_zod57 = require("zod"); +var getRelationsSchema = import_zod57.z.object({ + source: import_zod57.z.string().optional(), + relation: import_zod57.z.string().optional(), + onlyBroken: import_zod57.z.boolean().optional() +}).refine((data) => { + return data.source !== void 0 || data.relation !== void 0; +}); +async function getRelations({ source, relation, onlyBroken }) { + const validatedArgs = getRelationsSchema.parse({ + source, + relation, + onlyBroken + }); + const options = { + config: this.config, + params: { + ...validatedArgs.source && { source: validatedArgs.source }, + ...validatedArgs.relation && { relation: validatedArgs.relation }, + ...validatedArgs.onlyBroken && { relation: validatedArgs.onlyBroken } + } + }; + return apiRequest("get", "/@relations", options); +} + +// src/restapi/relations/create.ts +var import_zod59 = require("zod"); + +// src/validation/relations.ts +var import_zod58 = require("zod"); +var RelationDataSchema = import_zod58.z.object({ + relation: import_zod58.z.string(), + source: import_zod58.z.string(), + target: import_zod58.z.string() +}); +var createRelationsDataSchema = import_zod58.z.object({ + items: import_zod58.z.array(RelationDataSchema) +}); +var deleteRelationsDataSchema = import_zod58.z.object({ + items: import_zod58.z.array(RelationDataSchema).optional(), + relation: import_zod58.z.string().optional(), + source: import_zod58.z.string().optional(), + target: import_zod58.z.string().optional() +}); +var fixRelationsDataSchema = import_zod58.z.object({ + flush: import_zod58.z.number().optional() +}); + +// src/restapi/relations/create.ts +var createRelationsArgsSchema = import_zod59.z.object({ + data: createRelationsDataSchema +}); +async function createRelations({ data }) { + const validatedArgs = createRelationsArgsSchema.parse({ + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + return apiRequest("post", "/@relations", options); +} + +// src/restapi/relations/fix.ts +var import_zod60 = require("zod"); +var fixRelationsArgsSchema = import_zod60.z.object({ + data: fixRelationsDataSchema.optional() +}); +async function fixRelations({ data }) { + const validatedArgs = fixRelationsArgsSchema.parse({ + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + return apiRequest("post", "@relations/rebuild", options); +} + +// src/restapi/relations/delete.ts +var import_zod61 = require("zod"); +var deleteRelationsArgsSchema = import_zod61.z.object({ + data: deleteRelationsDataSchema +}); +async function deleteRelations({ data }) { + const validatedArgs = deleteRelationsArgsSchema.parse({ + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + return apiRequest("delete", "/@relations", options); +} + +// src/restapi/roles/get.ts +async function getRoles() { + const options = { + config: this.config, + params: {} + }; + return apiRequest("get", "/@roles", options); +} + +// src/restapi/rules/get.ts +async function getRules() { + const options = { + config: this.config, + params: {} + }; + return apiRequest("get", "/@content-rules", options); +} + +// src/restapi/rules/create.ts +var import_zod62 = require("zod"); +var createRuleArgsSchema = import_zod62.z.object({ + ruleId: import_zod62.z.string() +}); +async function createRule({ ruleId }) { + const validatedArgs = createRuleArgsSchema.parse({ + ruleId + }); + const options = { + config: this.config + }; + const addRulePath = `/@content-rules/${validatedArgs.ruleId}`; + return apiRequest("post", addRulePath, options); +} + +// src/restapi/rules/update.ts +var import_zod64 = require("zod"); + +// src/validation/rules.ts +var import_zod63 = require("zod"); +var updateRulesDataSchema = import_zod63.z.object({ + "form.button.Bubble": import_zod63.z.boolean().optional(), + "form.button.NoBubble": import_zod63.z.boolean().optional(), + "form.button.Enable": import_zod63.z.boolean().optional(), + "form.button.Disable": import_zod63.z.boolean().optional(), + rules_ids: import_zod63.z.array(import_zod63.z.string()).optional(), + operation: import_zod63.z.string().optional(), + rule_id: import_zod63.z.string().optional() +}); +var deleteRulesDataSchema = import_zod63.z.object({ + rules_ids: import_zod63.z.array(import_zod63.z.string()) +}); + +// src/restapi/rules/update.ts +var updateRulesArgsSchema = import_zod64.z.object({ + data: updateRulesDataSchema +}); +async function updateRules({ data }) { + const validatedArgs = updateRulesArgsSchema.parse({ + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + return apiRequest("patch", "/@content-rules", options); +} + +// src/restapi/rules/delete.ts +var import_zod65 = require("zod"); +var deleteRulesArgsSchema = import_zod65.z.object({ + data: deleteRulesDataSchema +}); +async function deleteRules({ data }) { + const validatedArgs = deleteRulesArgsSchema.parse({ + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + const deleteRulesPath = `/@content-rules`; + return apiRequest("delete", deleteRulesPath, options); +} + +// src/restapi/search/get.ts +var import_zod67 = require("zod"); + +// src/validation/search.ts +var import_zod66 = require("zod"); +var querySchema = import_zod66.z.object({ + path: import_zod66.z.object({ + query: import_zod66.z.union([import_zod66.z.string(), import_zod66.z.array(import_zod66.z.string())]), + depth: import_zod66.z.number().optional() + }).optional(), + sort_on: import_zod66.z.union([import_zod66.z.string(), import_zod66.z.array(import_zod66.z.string())]).optional(), + SearchableText: import_zod66.z.string().optional(), + metadata_fields: import_zod66.z.union([import_zod66.z.string(), import_zod66.z.array(import_zod66.z.string())]).optional(), + fullobjects: import_zod66.z.number().optional() +}).and(import_zod66.z.record(import_zod66.z.any())); +var searchSchema = import_zod66.z.object({ + query: querySchema +}); + +// src/restapi/search/get.ts +var flattenToDottedNotation = (obj, prefix = "") => { + const result = {}; + for (const key of Object.keys(obj)) { + const value = obj[key]; + const newKey = prefix ? `${prefix}.${key}` : key; + if (typeof value === "object" && !Array.isArray(value) && value !== null) { + Object.assign(result, flattenToDottedNotation(value, newKey)); + } else { + result[newKey] = value; + } + } + return result; +}; +async function search({ query: query2 }) { + const validatedArgs = searchSchema.parse({ + query: query2 + }); + const flattenedQuery = flattenToDottedNotation(validatedArgs.query); + const options = { + config: this.config, + params: { + ...flattenedQuery, + "path.query": void 0 + } + }; + return apiRequest("get", `${query2.path?.query ?? ""}/@search`, options); +} + +// src/restapi/site/get.ts +async function getSite() { + const options = { + config: this.config, + params: {} + }; + return apiRequest("get", "/@site", options); +} + +// src/restapi/sources/get.ts +var import_zod68 = require("zod"); +var getSourceSchema = import_zod68.z.object({ + path: import_zod68.z.string(), + field: import_zod68.z.string() +}); +async function getSource({ path, field }) { + const validatedArgs = getSourceSchema.parse({ + path, + field + }); + const options = { + config: this.config + }; + const sourcePath = `/${validatedArgs.path}/@sources/${field}`; + return apiRequest("get", sourcePath, options); +} + +// src/restapi/system/get.ts +async function getSystem() { + const options = { + config: this.config, + params: {} + }; + return apiRequest("get", "/@system", options); +} + +// src/restapi/transactions/get.ts +async function getTransactions() { + const options = { + config: this.config, + params: {} + }; + return apiRequest("get", "/@transactions", options); +} + +// src/restapi/transactions/revert.ts +var import_zod70 = require("zod"); + +// src/validation/transactions.ts +var import_zod69 = require("zod"); +var revertTransactionsDataSchema = import_zod69.z.object({ + transaction_ids: import_zod69.z.array(import_zod69.z.string()) +}); + +// src/restapi/transactions/revert.ts +var revertTransactionsArgsSchema = import_zod70.z.object({ + data: revertTransactionsDataSchema +}); +async function revertTransactions({ data }) { + const validatedArgs = revertTransactionsArgsSchema.parse({ + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + return apiRequest("patch", "/@transactions", options); +} + +// src/restapi/translations/get.ts +var import_zod71 = require("zod"); +var getTranslationSchema = import_zod71.z.object({ + path: import_zod71.z.string() +}); +async function getTranslation({ path }) { + const validatedArgs = getTranslationSchema.parse({ + path + }); + const options = { + config: this.config, + params: {} + }; + const translationsPath = `${validatedArgs.path}/@translations`; + return apiRequest("get", translationsPath, options); +} + +// src/restapi/translations/link.ts +var import_zod73 = require("zod"); + +// src/validation/translations.ts +var import_zod72 = require("zod"); +var linkTranslationDataSchema = import_zod72.z.object({ + id: import_zod72.z.string() +}); +var unlinkTranslationDataSchema = import_zod72.z.object({ + language: import_zod72.z.string() +}); + +// src/restapi/translations/link.ts +var linkTranslationArgsSchema = import_zod73.z.object({ + path: import_zod73.z.string(), + data: linkTranslationDataSchema +}); +async function linkTranslation({ path, data }) { + const validatedArgs = linkTranslationArgsSchema.parse({ + path, + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + const translationsPath = `${validatedArgs.path}/@translations`; + return apiRequest("post", translationsPath, options); +} + +// src/restapi/translations/unlink.ts +var import_zod74 = require("zod"); +var unlinkTranslationArgsSchema = import_zod74.z.object({ + path: import_zod74.z.string(), + data: unlinkTranslationDataSchema +}); +async function unlinkTranslation({ path, data }) { + const validatedArgs = unlinkTranslationArgsSchema.parse({ + path, + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + const translationsPath = `${validatedArgs.path}/@translations`; + return apiRequest("delete", translationsPath, options); +} + +// src/restapi/types/get_list.ts +async function getTypes() { + const options = { + config: this.config, + params: {} + }; + return apiRequest("get", "/@types", options); +} + +// src/restapi/types/get.ts +var import_zod75 = require("zod"); +var getTypeSchema = import_zod75.z.object({ + type: import_zod75.z.string() +}); +async function getType({ type }) { + const validatedArgs = getTypeSchema.parse({ + type + }); + const options = { + config: this.config, + params: {} + }; + const contentPathPath = `/@types/${validatedArgs.type}`; + return apiRequest("get", contentPathPath, options); +} + +// src/restapi/types/get_type_field.ts +var import_zod76 = require("zod"); +var getTypeFieldSchema = import_zod76.z.object({ + contentFieldPath: import_zod76.z.string() +}); +async function getTypeField({ contentFieldPath }) { + const validatedArgs = getTypeFieldSchema.parse({ + contentFieldPath + }); + const options = { + config: this.config, + params: {} + }; + const contentFieldPathPath = `/@types/${validatedArgs.contentFieldPath}`; + return apiRequest("get", contentFieldPathPath, options); +} + +// src/restapi/types/create_type_field.ts +var import_zod78 = require("zod"); + +// src/validation/types.ts +var import_zod77 = require("zod"); +var createTypeFieldDataSchema = import_zod77.z.object({ + description: import_zod77.z.string(), + factory: import_zod77.z.string(), + required: import_zod77.z.boolean().optional(), + title: import_zod77.z.string() +}); +var updateTypeFieldDataSchema = import_zod77.z.object({ + description: import_zod77.z.string().optional(), + maxLength: import_zod77.z.number().optional(), + minLength: import_zod77.z.number().optional(), + fields: import_zod77.z.array(import_zod77.z.string()).optional(), + required: import_zod77.z.boolean().optional(), + title: import_zod77.z.string().optional(), + properties: import_zod77.z.any().optional(), + fieldsets: import_zod77.z.array(import_zod77.z.any()).optional() +}); + +// src/restapi/types/create_type_field.ts +var createTypeFieldArgsSchema = import_zod78.z.object({ + contentPath: import_zod78.z.string(), + data: createTypeFieldDataSchema +}); +async function createTypeField({ contentPath, data }) { + const validatedArgs = createTypeFieldArgsSchema.parse({ + contentPath, + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + const addTypeFieldPath = `/@types/${validatedArgs.contentPath}`; + return apiRequest("post", addTypeFieldPath, options); +} + +// src/restapi/types/update_type_field.ts +var import_zod79 = require("zod"); +var updateTypeFieldArgsSchema = import_zod79.z.object({ + contentPath: import_zod79.z.string(), + data: updateTypeFieldDataSchema +}); +async function updateTypeField({ contentPath, data }) { + const validatedArgs = updateTypeFieldArgsSchema.parse({ + contentPath, + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + const updateTypeFieldPath = `/@types/${validatedArgs.contentPath}`; + return apiRequest("patch", updateTypeFieldPath, options); +} + +// src/restapi/upgrade/get.ts +async function getUpgrade() { + const options = { + config: this.config, + params: {} + }; + return apiRequest("get", "/@upgrade", options); +} + +// src/restapi/upgrade/run.ts +var import_zod81 = require("zod"); + +// src/validation/upgrade.ts +var import_zod80 = require("zod"); +var runUpgradeDataSchema = import_zod80.z.object({ + dry_run: import_zod80.z.boolean() +}); + +// src/restapi/upgrade/run.ts +var runUpgradeArgsSchema = import_zod81.z.object({ + data: runUpgradeDataSchema +}); +async function runUpgrade({ data }) { + const validatedArgs = runUpgradeArgsSchema.parse({ + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + return apiRequest("post", "/@upgrade", options); +} + +// src/restapi/users/get_list.ts +var import_zod82 = require("zod"); +var getUsersSchema = import_zod82.z.object({ + query: import_zod82.z.string().optional(), + groupsFilter: import_zod82.z.array(import_zod82.z.string()).optional(), + search: import_zod82.z.string().optional(), + limit: import_zod82.z.number().optional() +}); +async function getUsers({ query: query2, groupsFilter, search: search2, limit }) { + const validatedArgs = getUsersSchema.parse({ + query: query2, + groupsFilter, + search: search2, + limit + }); + const options = { + config: this.config, + params: { + ...validatedArgs.query && { query: validatedArgs.query }, + ...validatedArgs.groupsFilter && { + "groups-filter": validatedArgs.groupsFilter + }, + ...validatedArgs.limit && { limit: validatedArgs.limit }, + ...validatedArgs.search && { search: validatedArgs.search } + } + }; + return apiRequest("get", "/@users", options).then( + // Backwards compatibility for change in plone.restapi 10. + // The list of users is now inside the `items` property. + (response) => ({ ...response, data: response.data.items ?? response.data }) + ); +} + +// src/restapi/users/get.ts +var import_zod83 = require("zod"); +var getUserSchema = import_zod83.z.object({ + id: import_zod83.z.string() +}); +async function getUser({ id }) { + const validatedArgs = getUserSchema.parse({ + id + }); + const options = { + config: this.config, + params: {} + }; + const userName = `@users/${validatedArgs.id}`; + return apiRequest("get", userName, options); +} + +// src/restapi/users/create.ts +var import_zod85 = require("zod"); + +// src/validation/users.ts +var import_zod84 = require("zod"); +var createUserDataSchema = import_zod84.z.object({ + description: import_zod84.z.string().optional(), + email: import_zod84.z.string().email(), + fullname: import_zod84.z.string().optional(), + home_page: import_zod84.z.string().url().optional(), + location: import_zod84.z.string().optional(), + sendPasswordReset: import_zod84.z.boolean().optional(), + username: import_zod84.z.string(), + roles: import_zod84.z.array(import_zod84.z.string()).optional(), + password: import_zod84.z.string().optional() +}); +var portraitSchema = import_zod84.z.object({ + "content-type": import_zod84.z.string(), + data: import_zod84.z.string(), + encoding: import_zod84.z.string(), + filename: import_zod84.z.string(), + scale: import_zod84.z.boolean().optional() +}); +var updateUserDataSchema = import_zod84.z.object({ + description: import_zod84.z.string().optional(), + email: import_zod84.z.string().email().optional(), + fullname: import_zod84.z.string().optional(), + home_page: import_zod84.z.string().url().optional(), + location: import_zod84.z.string().optional(), + username: import_zod84.z.string().optional(), + portrait: portraitSchema.optional() +}); +var resetPasswordWithTokenDataSchema = import_zod84.z.object({ + reset_token: import_zod84.z.string(), + new_password: import_zod84.z.string() +}); +var updatePasswordDataSchema = import_zod84.z.object({ + new_password: import_zod84.z.string(), + old_password: import_zod84.z.string() +}); + +// src/restapi/users/create.ts +var createUserArgsSchema = import_zod85.z.object({ + data: createUserDataSchema +}); +async function createUser({ data }) { + const validatedArgs = createUserArgsSchema.parse({ + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + return apiRequest("post", "/@users", options); +} + +// src/restapi/users/update.ts +var import_zod86 = require("zod"); +var updateUserArgsSchema = import_zod86.z.object({ + id: import_zod86.z.string(), + data: updateUserDataSchema +}); +async function updateUser({ id, data }) { + const validatedArgs = updateUserArgsSchema.parse({ + id, + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + const userName = `/@users/${validatedArgs.id}`; + return apiRequest("patch", userName, options); +} + +// src/restapi/users/delete.ts +var import_zod87 = require("zod"); +var deleteUserArgsSchema = import_zod87.z.object({ + id: import_zod87.z.string() +}); +async function deleteUser({ id }) { + const validatedArgs = deleteUserArgsSchema.parse({ + id + }); + const options = { + config: this.config + }; + const userName = `/@users/${validatedArgs.id}`; + return apiRequest("delete", userName, options); +} + +// src/restapi/users/reset_password.ts +var import_zod88 = require("zod"); +var resetPasswordArgsSchema = import_zod88.z.object({ + id: import_zod88.z.string() +}); +async function resetPassword({ id }) { + const validatedArgs = resetPasswordArgsSchema.parse({ + id + }); + const options = { + config: this.config + }; + const userName = `@users/${validatedArgs.id}/reset-password`; + return apiRequest("post", userName, options); +} + +// src/restapi/users/reset_password_with_token.ts +var import_zod89 = require("zod"); +var resetPasswordWithTokenArgsSchema = import_zod89.z.object({ + id: import_zod89.z.string(), + data: resetPasswordWithTokenDataSchema +}); +async function resetPasswordWithToken({ id, data }) { + const validatedArgs = resetPasswordWithTokenArgsSchema.parse({ + id, + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + const userName = `@users/${validatedArgs.id}/reset-password`; + return apiRequest("post", userName, options); +} + +// src/restapi/users/update_password.ts +var import_zod90 = require("zod"); +var updatePasswordArgsSchema = import_zod90.z.object({ + id: import_zod90.z.string(), + data: updatePasswordDataSchema +}); +async function updatePassword({ id, data }) { + const validatedArgs = updatePasswordArgsSchema.parse({ + id, + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + const userName = `@users/${validatedArgs.id}/reset-password`; + return apiRequest("post", userName, options); +} + +// src/restapi/userschema/get.ts +async function getUserschema() { + const options = { + config: this.config, + params: {} + }; + return apiRequest("get", "/@userschema", options); +} + +// src/restapi/vocabularies/get_list.ts +async function getVocabularies() { + const options = { + config: this.config, + params: {} + }; + return apiRequest("get", "/@vocabularies", options); +} + +// src/restapi/vocabularies/get.ts +var import_zod91 = require("zod"); +var getVocabularySchema = import_zod91.z.object({ + path: import_zod91.z.string(), + title: import_zod91.z.string().optional(), + token: import_zod91.z.string().optional(), + tokens: import_zod91.z.array(import_zod91.z.string()).optional() +}); +async function getVocabulary({ path, title, token, tokens }) { + const validatedArgs = getVocabularySchema.parse({ + path, + title, + token, + tokens + }); + const options = { + config: this.config, + params: { + ...validatedArgs.title && { title: validatedArgs.title }, + ...validatedArgs.token && { token: validatedArgs.token }, + ...validatedArgs.tokens && { tokens: validatedArgs.tokens } + } + }; + const vocabulariesPath = `@vocabularies/${validatedArgs.path}`; + return apiRequest("get", vocabulariesPath, options); +} + +// src/restapi/workflow/get.ts +var import_zod92 = require("zod"); +var getWorkflowSchema = import_zod92.z.object({ + path: import_zod92.z.string() +}); +async function getWorkflow({ path }) { + const validatedArgs = getWorkflowSchema.parse({ + path + }); + const options = { + config: this.config, + params: {} + }; + const workflowPath = `${validatedArgs.path}/@workflow`; + return apiRequest("get", workflowPath, options); +} + +// src/restapi/workflow/create.ts +var import_zod94 = require("zod"); + +// src/validation/workflow.ts +var import_zod93 = require("zod"); +var createWorkflowDataSchema = import_zod93.z.object({ + comment: import_zod93.z.string().optional(), + effective: import_zod93.z.string().optional(), + expires: import_zod93.z.string().optional(), + include_children: import_zod93.z.boolean().optional() +}); + +// src/restapi/workflow/create.ts +var createWorkflowArgsSchema = import_zod94.z.object({ + path: import_zod94.z.string(), + data: createWorkflowDataSchema.optional() +}); +async function createWorkflow({ path, data }) { + const validatedArgs = createWorkflowArgsSchema.parse({ + path, + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + const workflowPath = `${validatedArgs.path}/@workflow/publish`; + return apiRequest("post", workflowPath, options); +} + +// src/restapi/workingcopy/get.ts +var import_zod95 = require("zod"); +var getWorkingcopySchema = import_zod95.z.object({ + path: import_zod95.z.string() +}); +async function getWorkingcopy({ path }) { + const validatedArgs = getWorkingcopySchema.parse({ + path + }); + const options = { + config: this.config, + params: {} + }; + const workingcopyPath = `/${validatedArgs.path}/@workingcopy`; + return apiRequest("get", workingcopyPath, options); +} + +// src/restapi/workingcopy/create.ts +var import_zod96 = require("zod"); +var createWorkingcopyArgsSchema = import_zod96.z.object({ + path: import_zod96.z.string() +}); +async function createWorkingcopy({ path }) { + const validatedArgs = createWorkingcopyArgsSchema.parse({ + path + }); + const options = { + config: this.config + }; + const createWorkingcopyPath = `/${validatedArgs.path}/@workingcopy`; + return apiRequest("post", createWorkingcopyPath, options); +} + +// src/restapi/workingcopy/check-in.ts +var import_zod97 = require("zod"); +var checkInWorkingcopyArgsSchema = import_zod97.z.object({ + path: import_zod97.z.string() +}); +async function checkInWorkingcopy({ path }) { + const validatedArgs = checkInWorkingcopyArgsSchema.parse({ + path + }); + const options = { + config: this.config + }; + const checkInWorkingcopyPath = `/${validatedArgs.path}/@workingcopy`; + return apiRequest("patch", checkInWorkingcopyPath, options); +} + +// src/restapi/workingcopy/delete.ts +var import_zod98 = require("zod"); +var deleteWorkingcopyArgsSchema = import_zod98.z.object({ + path: import_zod98.z.string() +}); +async function deleteWorkingcopy({ path }) { + const validatedArgs = deleteWorkingcopyArgsSchema.parse({ + path + }); + const options = { + config: this.config + }; + const deleteWorkingcopyPath = `/${validatedArgs.path}/@workingcopy`; + return apiRequest("delete", deleteWorkingcopyPath, options); +} + +// src/client.ts +var PLONECLIENT_DEFAULT_CONFIG = { + apiPath: "http://localhost:8080/Plone" +}; +var PloneClient = class _PloneClient { + config = PLONECLIENT_DEFAULT_CONFIG; + static initialize = (config) => new _PloneClient({ ...PLONECLIENT_DEFAULT_CONFIG, ...config }); + constructor(config) { + this.config = config; + Object.values(this).forEach((propertyValue) => { + if (propertyValue instanceof Function) { + propertyValue = propertyValue.bind(this); + } + }); + } + getActions = getActions; + getAddons = getAddons; + getAddon = getAddon; + installAddon = installAddon; + uninstallAddon = uninstallAddon; + upgradeAddon = upgradeAddon; + installAddonProfile = installAddonProfile; + getAllAliases = getAllAliases; + getAliases = getAliases; + createAlias = createAlias; + createAliases = createAliases; + deleteAliases = deleteAliases; + getBreadcrumbs = getBreadcrumbs; + getComments = getComments; + createComment = createComment; + updateComment = updateComment; + deleteComment = deleteComment; + getContent = getContent; + createContent = createContent; + updateContent = updateContent; + deleteContent = deleteContent; + copyContent = copyContent; + moveContent = moveContent; + getContextNavigation = getContextNavigation; + getControlpanels = getControlpanels; + getControlpanel = getControlpanel; + createControlpanel = createControlpanel; + updateControlpanel = updateControlpanel; + deleteControlpanel = deleteControlpanel; + getDatabase = getDatabase; + emailNotification = emailNotification; + emailSend = emailSend; + getGroups = getGroups; + getGroup = getGroup; + createGroup = createGroup; + updateGroup = updateGroup; + deleteGroup = deleteGroup; + getHistory = getHistory; + getHistoryVersion = getHistoryVersion; + revertHistory = revertHistory; + getLinkintegrity = getLinkintegrity; + getLock = getLock; + createLock = createLock; + updateLock = updateLock; + deleteLock = deleteLock; + login = login; + getNavigation = getNavigation; + getNavroot = getNavroot; + getPrincipals = getPrincipals; + getQuerysources = getQuerysources; + getQuerystring = getQuerystring; + querystringSearch = querystringSearch; + getRegistry = getRegistry; + getRegistryRecord = getRegistryRecord; + updateRegistry = updateRegistry; + getAllRelations = getAllRelations; + getRelations = getRelations; + createRelations = createRelations; + fixRelations = fixRelations; + deleteRelations = deleteRelations; + getRoles = getRoles; + getRules = getRules; + createRule = createRule; + updateRules = updateRules; + deleteRules = deleteRules; + search = search; + getSite = getSite; + getSource = getSource; + getSystem = getSystem; + getTransactions = getTransactions; + revertTransactions = revertTransactions; + getTranslation = getTranslation; + linkTranslation = linkTranslation; + unlinkTranslation = unlinkTranslation; + getTypes = getTypes; + getType = getType; + getTypeField = getTypeField; + createTypeField = createTypeField; + updateTypeField = updateTypeField; + getUpgrade = getUpgrade; + runUpgrade = runUpgrade; + getUsers = getUsers; + getUser = getUser; + createUser = createUser; + updateUser = updateUser; + deleteUser = deleteUser; + resetPassword = resetPassword; + resetPasswordWithToken = resetPasswordWithToken; + updatePassword = updatePassword; + getUserschema = getUserschema; + getVocabularies = getVocabularies; + getVocabulary = getVocabulary; + getWorkflow = getWorkflow; + createWorkflow = createWorkflow; + getWorkingcopy = getWorkingcopy; + createWorkingcopy = createWorkingcopy; + checkInWorkingcopy = checkInWorkingcopy; + deleteWorkingcopy = deleteWorkingcopy; +}; + +// src/index.ts +var index_default = PloneClient; diff --git a/packages/client/dist/index.d.cts b/packages/client/dist/index.d.cts new file mode 100644 index 00000000000..6d575324982 --- /dev/null +++ b/packages/client/dist/index.d.cts @@ -0,0 +1,3013 @@ +import { ActionsResponse, Addons, GetAddonResponse, GetAllAliasesResponse, GetAliasesResponse, BreadcrumbsResponse, GetCommentsResponse, Content, CreateContentResponse, UpdateContentResponse, CopyMoveContentResponse, ContextNavigationResponse, GetControlpanelsResponse, GetControlpanelResponse, DatabaseResponse, GetGroupsResponse, GetGroupResponse, CreateGroupResponse, GetHistoryResponse, LockInfo, CreateLockResponse, Login, NavigationResponse, GetNavrootResponse, GetPrincipalsResponse, GetQuerysourcesResponse, GetQuerystringResponse, QuerystringSearchResponse, GetRegistryResponse, GetAllRelationsResponse, GetRelationsResponse, GetRolesResponse, GetRulesResponse, RuleRespose, SearchResponse, GetSiteResponse, GetSourceResponse, GetSystemResponse, GetTransactionsResponse, RevertTransactionsResponse, GetTranslationResponse, GetTypesResponse, GetTypeResponse, GetTypeFieldResponse, CreateTypeFieldResponse, GetUpgradeResponse, RunUpgradeResponse, GetUsersResponse, User, GetUserschemaResponse, GetVocabulariesResponse, GetVocabularyResponse, WorkflowResponse, CreateWorkflowResponse, GetWorkingcopyResponse, CreateWorkingcopyResponse } from '@plone/types'; +import { z } from 'zod'; + +type RequestResponse = { + status: number; + data: T; +}; + +declare const getActionsSchema: z.ZodObject<{ + path: z.ZodString; +}, "strip", z.ZodTypeAny, { + path: string; +}, { + path: string; +}>; +type ActionsArgs = z.infer; +declare function getActions(this: PloneClient, { path }: ActionsArgs): Promise>; + +declare function getAddons(this: PloneClient): Promise>; + +declare const getAddonSchema: z.ZodObject<{ + id: z.ZodString; +}, "strip", z.ZodTypeAny, { + id: string; +}, { + id: string; +}>; +type AddonArgs = z.infer & {}; +declare function getAddon(this: PloneClient, { id }: AddonArgs): Promise>; + +declare const installAddonSchema: z.ZodObject<{ + id: z.ZodString; +}, "strip", z.ZodTypeAny, { + id: string; +}, { + id: string; +}>; +type InstallAddonArgs = z.infer; +declare function installAddon(this: PloneClient, { id }: InstallAddonArgs): Promise>; + +declare const uninstallAddonSchema: z.ZodObject<{ + id: z.ZodString; +}, "strip", z.ZodTypeAny, { + id: string; +}, { + id: string; +}>; +type UninstallAddonArgs = z.infer; +declare function uninstallAddon(this: PloneClient, { id }: UninstallAddonArgs): Promise>; + +declare const upgradeAddonSchema: z.ZodObject<{ + id: z.ZodString; +}, "strip", z.ZodTypeAny, { + id: string; +}, { + id: string; +}>; +type UpgradeAddonArgs = z.infer; +declare function upgradeAddon(this: PloneClient, { id }: UpgradeAddonArgs): Promise>; + +declare const installAddonProfileSchema: z.ZodObject<{ + id: z.ZodString; + profile: z.ZodString; +}, "strip", z.ZodTypeAny, { + id: string; + profile: string; +}, { + id: string; + profile: string; +}>; +type InstallAddonProfileArgs = z.infer; +declare function installAddonProfile(this: PloneClient, { id, profile }: InstallAddonProfileArgs): Promise>; + +declare function getAllAliases(this: PloneClient): Promise>; + +declare const getAliasesSchema: z.ZodObject<{ + path: z.ZodString; +}, "strip", z.ZodTypeAny, { + path: string; +}, { + path: string; +}>; +type AliasesArgs = z.infer; +declare function getAliases(this: PloneClient, { path }: AliasesArgs): Promise>; + +declare const createAliasArgsSchema: z.ZodObject<{ + path: z.ZodString; + data: z.ZodObject<{ + items: z.ZodArray, "many">; + }, "strip", z.ZodTypeAny, { + items: { + path: string; + }[]; + }, { + items: { + path: string; + }[]; + }>; +}, "strip", z.ZodTypeAny, { + path: string; + data: { + items: { + path: string; + }[]; + }; +}, { + path: string; + data: { + items: { + path: string; + }[]; + }; +}>; +type CreateAliasArgs = z.infer; +declare function createAlias(this: PloneClient, { path, data }: CreateAliasArgs): Promise>; + +declare const createAliasesArgsSchema: z.ZodObject<{ + data: z.ZodObject<{ + items: z.ZodArray; + path: z.ZodString; + 'redirect-to': z.ZodString; + }, "strip", z.ZodTypeAny, { + path: string; + 'redirect-to': string; + datetime?: string | undefined; + }, { + path: string; + 'redirect-to': string; + datetime?: string | undefined; + }>, "many">; + }, "strip", z.ZodTypeAny, { + items: { + path: string; + 'redirect-to': string; + datetime?: string | undefined; + }[]; + }, { + items: { + path: string; + 'redirect-to': string; + datetime?: string | undefined; + }[]; + }>; +}, "strip", z.ZodTypeAny, { + data: { + items: { + path: string; + 'redirect-to': string; + datetime?: string | undefined; + }[]; + }; +}, { + data: { + items: { + path: string; + 'redirect-to': string; + datetime?: string | undefined; + }[]; + }; +}>; +type CreateAliasesArgs = z.infer; +declare function createAliases(this: PloneClient, { data }: CreateAliasesArgs): Promise>; + +declare const deleteAliasesArgsSchema: z.ZodObject<{ + path: z.ZodString; + data: z.ZodObject<{ + items: z.ZodArray, "many">; + }, "strip", z.ZodTypeAny, { + items: { + path: string; + }[]; + }, { + items: { + path: string; + }[]; + }>; +}, "strip", z.ZodTypeAny, { + path: string; + data: { + items: { + path: string; + }[]; + }; +}, { + path: string; + data: { + items: { + path: string; + }[]; + }; +}>; +type DeleteAliasesArgs = z.infer; +declare function deleteAliases(this: PloneClient, { path, data }: DeleteAliasesArgs): Promise>; + +declare const getBreadcrumbsSchema: z.ZodObject<{ + path: z.ZodString; +}, "strip", z.ZodTypeAny, { + path: string; +}, { + path: string; +}>; +type BreadcrumbsArgs = z.infer; +declare function getBreadcrumbs(this: PloneClient, { path }: BreadcrumbsArgs): Promise>; + +declare const getCommentsSchema: z.ZodObject<{ + path: z.ZodString; +}, "strip", z.ZodTypeAny, { + path: string; +}, { + path: string; +}>; +type CommentsArgs = z.infer; +declare function getComments(this: PloneClient, { path }: CommentsArgs): Promise>; + +declare const createCommentArgsSchema: z.ZodObject<{ + path: z.ZodString; + in_reply_to: z.ZodOptional; + data: z.ZodObject<{ + text: z.ZodString; + }, "strip", z.ZodTypeAny, { + text: string; + }, { + text: string; + }>; +}, "strip", z.ZodTypeAny, { + path: string; + data: { + text: string; + }; + in_reply_to?: string | undefined; +}, { + path: string; + data: { + text: string; + }; + in_reply_to?: string | undefined; +}>; +type CreateCommentArgs = z.infer; +declare function createComment(this: PloneClient, { path, in_reply_to, data }: CreateCommentArgs): Promise>; + +declare const updateCommentArgsSchema: z.ZodObject<{ + path: z.ZodString; + comment_id: z.ZodString; + data: z.ZodObject<{ + text: z.ZodString; + }, "strip", z.ZodTypeAny, { + text: string; + }, { + text: string; + }>; +}, "strip", z.ZodTypeAny, { + path: string; + data: { + text: string; + }; + comment_id: string; +}, { + path: string; + data: { + text: string; + }; + comment_id: string; +}>; +type UpdateCommentArgs = z.infer; +declare function updateComment(this: PloneClient, { path, comment_id, data }: UpdateCommentArgs): Promise>; + +declare const deleteCommentArgsSchema: z.ZodObject<{ + path: z.ZodString; + comment_id: z.ZodString; +}, "strip", z.ZodTypeAny, { + path: string; + comment_id: string; +}, { + path: string; + comment_id: string; +}>; +type DeleteCommentArgs = z.infer; +declare function deleteComment(this: PloneClient, { path, comment_id }: DeleteCommentArgs): Promise>; + +declare const getContentArgsSchema: z.ZodObject<{ + path: z.ZodString; + version: z.ZodOptional; + page: z.ZodOptional; + fullObjects: z.ZodOptional; + expand: z.ZodOptional>; +}, "strip", z.ZodTypeAny, { + path: string; + version?: string | undefined; + page?: number | undefined; + fullObjects?: boolean | undefined; + expand?: string[] | undefined; +}, { + path: string; + version?: string | undefined; + page?: number | undefined; + fullObjects?: boolean | undefined; + expand?: string[] | undefined; +}>; +type GetContentArgs = z.infer; +declare function getContent(this: PloneClient, { path, version, page, fullObjects, expand }: GetContentArgs): Promise>; + +declare const createContentArgsSchema: z.ZodObject<{ + path: z.ZodString; + data: z.ZodObject<{ + '@id': z.ZodOptional; + '@static_behaviors': z.ZodOptional; + '@type': z.ZodString; + allow_discussion: z.ZodOptional; + blocks: z.ZodOptional; + blocks_layout: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + items: string[]; + }, { + items: string[]; + }>>; + contributors: z.ZodOptional>; + creators: z.ZodOptional>; + description: z.ZodOptional; + effective: z.ZodOptional>; + exclude_from_nav: z.ZodOptional; + expires: z.ZodOptional>; + file: z.ZodOptional>; + id: z.ZodOptional; + image: z.ZodOptional>; + language: z.ZodOptional; + preview_caption: z.ZodOptional; + preview_image: z.ZodOptional>; + relatedItems: z.ZodOptional; + id: z.ZodOptional; + "@id": z.ZodString; + "@type": z.ZodOptional; + CreationDate: z.ZodOptional; + Creator: z.ZodOptional; + Date: z.ZodOptional; + Description: z.ZodOptional; + EffectiveDate: z.ZodOptional; + ExpirationDate: z.ZodOptional; + ModificationDate: z.ZodOptional; + Subject: z.ZodOptional>; + Title: z.ZodOptional; + Type: z.ZodOptional; + UID: z.ZodOptional; + author_name: z.ZodOptional; + cmf_uid: z.ZodOptional; + commentators: z.ZodOptional>; + created: z.ZodOptional; + description: z.ZodOptional; + effective: z.ZodOptional; + end: z.ZodOptional; + exclude_from_nav: z.ZodOptional; + expires: z.ZodOptional; + getIcon: z.ZodOptional; + getId: z.ZodOptional; + getObjSize: z.ZodOptional; + getPath: z.ZodOptional; + getRemoteUrl: z.ZodOptional; + getURL: z.ZodOptional; + hasPreviewImage: z.ZodOptional; + head_title: z.ZodOptional; + image_field: z.ZodOptional>; + image_scales: z.ZodOptional; + in_response_to: z.ZodOptional; + is_folderish: z.ZodOptional; + last_comment_date: z.ZodOptional; + listCreators: z.ZodOptional>; + mime_type: z.ZodOptional; + modified: z.ZodOptional; + nav_title: z.ZodOptional; + portal_type: z.ZodOptional; + review_state: z.ZodOptional; + start: z.ZodOptional; + sync_uid: z.ZodOptional; + title: z.ZodString; + total_comments: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + "@id": string; + title: string; + location?: unknown; + id?: string | undefined; + "@type"?: string | undefined; + CreationDate?: string | undefined; + Creator?: string | undefined; + Date?: string | undefined; + Description?: string | undefined; + EffectiveDate?: unknown; + ExpirationDate?: unknown; + ModificationDate?: string | undefined; + Subject?: unknown[] | undefined; + Title?: string | undefined; + Type?: string | undefined; + UID?: string | undefined; + author_name?: unknown; + cmf_uid?: unknown; + commentators?: unknown[] | undefined; + created?: string | undefined; + description?: string | undefined; + effective?: string | undefined; + end?: unknown; + exclude_from_nav?: boolean | undefined; + expires?: string | undefined; + getIcon?: unknown; + getId?: string | undefined; + getObjSize?: string | undefined; + getPath?: string | undefined; + getRemoteUrl?: unknown; + getURL?: string | undefined; + hasPreviewImage?: unknown; + head_title?: unknown; + image_field?: string | null | undefined; + image_scales?: unknown; + in_response_to?: unknown; + is_folderish?: boolean | undefined; + last_comment_date?: unknown; + listCreators?: string[] | undefined; + mime_type?: string | undefined; + modified?: string | undefined; + nav_title?: unknown; + portal_type?: string | undefined; + review_state?: string | undefined; + start?: unknown; + sync_uid?: unknown; + total_comments?: number | undefined; + }, { + "@id": string; + title: string; + location?: unknown; + id?: string | undefined; + "@type"?: string | undefined; + CreationDate?: string | undefined; + Creator?: string | undefined; + Date?: string | undefined; + Description?: string | undefined; + EffectiveDate?: unknown; + ExpirationDate?: unknown; + ModificationDate?: string | undefined; + Subject?: unknown[] | undefined; + Title?: string | undefined; + Type?: string | undefined; + UID?: string | undefined; + author_name?: unknown; + cmf_uid?: unknown; + commentators?: unknown[] | undefined; + created?: string | undefined; + description?: string | undefined; + effective?: string | undefined; + end?: unknown; + exclude_from_nav?: boolean | undefined; + expires?: string | undefined; + getIcon?: unknown; + getId?: string | undefined; + getObjSize?: string | undefined; + getPath?: string | undefined; + getRemoteUrl?: unknown; + getURL?: string | undefined; + hasPreviewImage?: unknown; + head_title?: unknown; + image_field?: string | null | undefined; + image_scales?: unknown; + in_response_to?: unknown; + is_folderish?: boolean | undefined; + last_comment_date?: unknown; + listCreators?: string[] | undefined; + mime_type?: string | undefined; + modified?: string | undefined; + nav_title?: unknown; + portal_type?: string | undefined; + review_state?: string | undefined; + start?: unknown; + sync_uid?: unknown; + total_comments?: number | undefined; + }>, "many">>; + rights: z.ZodOptional>; + title: z.ZodString; + versioning_enabled: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + '@type': string; + title: string; + id?: string | undefined; + '@id'?: string | undefined; + description?: string | undefined; + effective?: string | null | undefined; + exclude_from_nav?: boolean | undefined; + expires?: string | null | undefined; + '@static_behaviors'?: unknown; + allow_discussion?: boolean | undefined; + blocks?: unknown; + blocks_layout?: { + items: string[]; + } | undefined; + contributors?: string[] | undefined; + creators?: string[] | undefined; + file?: { + data: string; + 'content-type': string; + encoding: string; + filename: string; + } | undefined; + image?: { + data: string; + 'content-type': string; + encoding: string; + filename: string; + } | undefined; + language?: string | undefined; + preview_caption?: string | undefined; + preview_image?: { + data: string; + 'content-type': string; + encoding: string; + filename: string; + } | undefined; + relatedItems?: { + "@id": string; + title: string; + location?: unknown; + id?: string | undefined; + "@type"?: string | undefined; + CreationDate?: string | undefined; + Creator?: string | undefined; + Date?: string | undefined; + Description?: string | undefined; + EffectiveDate?: unknown; + ExpirationDate?: unknown; + ModificationDate?: string | undefined; + Subject?: unknown[] | undefined; + Title?: string | undefined; + Type?: string | undefined; + UID?: string | undefined; + author_name?: unknown; + cmf_uid?: unknown; + commentators?: unknown[] | undefined; + created?: string | undefined; + description?: string | undefined; + effective?: string | undefined; + end?: unknown; + exclude_from_nav?: boolean | undefined; + expires?: string | undefined; + getIcon?: unknown; + getId?: string | undefined; + getObjSize?: string | undefined; + getPath?: string | undefined; + getRemoteUrl?: unknown; + getURL?: string | undefined; + hasPreviewImage?: unknown; + head_title?: unknown; + image_field?: string | null | undefined; + image_scales?: unknown; + in_response_to?: unknown; + is_folderish?: boolean | undefined; + last_comment_date?: unknown; + listCreators?: string[] | undefined; + mime_type?: string | undefined; + modified?: string | undefined; + nav_title?: unknown; + portal_type?: string | undefined; + review_state?: string | undefined; + start?: unknown; + sync_uid?: unknown; + total_comments?: number | undefined; + }[] | undefined; + rights?: string | null | undefined; + versioning_enabled?: boolean | undefined; + }, { + '@type': string; + title: string; + id?: string | undefined; + '@id'?: string | undefined; + description?: string | undefined; + effective?: string | null | undefined; + exclude_from_nav?: boolean | undefined; + expires?: string | null | undefined; + '@static_behaviors'?: unknown; + allow_discussion?: boolean | undefined; + blocks?: unknown; + blocks_layout?: { + items: string[]; + } | undefined; + contributors?: string[] | undefined; + creators?: string[] | undefined; + file?: { + data: string; + 'content-type': string; + encoding: string; + filename: string; + } | undefined; + image?: { + data: string; + 'content-type': string; + encoding: string; + filename: string; + } | undefined; + language?: string | undefined; + preview_caption?: string | undefined; + preview_image?: { + data: string; + 'content-type': string; + encoding: string; + filename: string; + } | undefined; + relatedItems?: { + "@id": string; + title: string; + location?: unknown; + id?: string | undefined; + "@type"?: string | undefined; + CreationDate?: string | undefined; + Creator?: string | undefined; + Date?: string | undefined; + Description?: string | undefined; + EffectiveDate?: unknown; + ExpirationDate?: unknown; + ModificationDate?: string | undefined; + Subject?: unknown[] | undefined; + Title?: string | undefined; + Type?: string | undefined; + UID?: string | undefined; + author_name?: unknown; + cmf_uid?: unknown; + commentators?: unknown[] | undefined; + created?: string | undefined; + description?: string | undefined; + effective?: string | undefined; + end?: unknown; + exclude_from_nav?: boolean | undefined; + expires?: string | undefined; + getIcon?: unknown; + getId?: string | undefined; + getObjSize?: string | undefined; + getPath?: string | undefined; + getRemoteUrl?: unknown; + getURL?: string | undefined; + hasPreviewImage?: unknown; + head_title?: unknown; + image_field?: string | null | undefined; + image_scales?: unknown; + in_response_to?: unknown; + is_folderish?: boolean | undefined; + last_comment_date?: unknown; + listCreators?: string[] | undefined; + mime_type?: string | undefined; + modified?: string | undefined; + nav_title?: unknown; + portal_type?: string | undefined; + review_state?: string | undefined; + start?: unknown; + sync_uid?: unknown; + total_comments?: number | undefined; + }[] | undefined; + rights?: string | null | undefined; + versioning_enabled?: boolean | undefined; + }>; +}, "strip", z.ZodTypeAny, { + path: string; + data: { + '@type': string; + title: string; + id?: string | undefined; + '@id'?: string | undefined; + description?: string | undefined; + effective?: string | null | undefined; + exclude_from_nav?: boolean | undefined; + expires?: string | null | undefined; + '@static_behaviors'?: unknown; + allow_discussion?: boolean | undefined; + blocks?: unknown; + blocks_layout?: { + items: string[]; + } | undefined; + contributors?: string[] | undefined; + creators?: string[] | undefined; + file?: { + data: string; + 'content-type': string; + encoding: string; + filename: string; + } | undefined; + image?: { + data: string; + 'content-type': string; + encoding: string; + filename: string; + } | undefined; + language?: string | undefined; + preview_caption?: string | undefined; + preview_image?: { + data: string; + 'content-type': string; + encoding: string; + filename: string; + } | undefined; + relatedItems?: { + "@id": string; + title: string; + location?: unknown; + id?: string | undefined; + "@type"?: string | undefined; + CreationDate?: string | undefined; + Creator?: string | undefined; + Date?: string | undefined; + Description?: string | undefined; + EffectiveDate?: unknown; + ExpirationDate?: unknown; + ModificationDate?: string | undefined; + Subject?: unknown[] | undefined; + Title?: string | undefined; + Type?: string | undefined; + UID?: string | undefined; + author_name?: unknown; + cmf_uid?: unknown; + commentators?: unknown[] | undefined; + created?: string | undefined; + description?: string | undefined; + effective?: string | undefined; + end?: unknown; + exclude_from_nav?: boolean | undefined; + expires?: string | undefined; + getIcon?: unknown; + getId?: string | undefined; + getObjSize?: string | undefined; + getPath?: string | undefined; + getRemoteUrl?: unknown; + getURL?: string | undefined; + hasPreviewImage?: unknown; + head_title?: unknown; + image_field?: string | null | undefined; + image_scales?: unknown; + in_response_to?: unknown; + is_folderish?: boolean | undefined; + last_comment_date?: unknown; + listCreators?: string[] | undefined; + mime_type?: string | undefined; + modified?: string | undefined; + nav_title?: unknown; + portal_type?: string | undefined; + review_state?: string | undefined; + start?: unknown; + sync_uid?: unknown; + total_comments?: number | undefined; + }[] | undefined; + rights?: string | null | undefined; + versioning_enabled?: boolean | undefined; + }; +}, { + path: string; + data: { + '@type': string; + title: string; + id?: string | undefined; + '@id'?: string | undefined; + description?: string | undefined; + effective?: string | null | undefined; + exclude_from_nav?: boolean | undefined; + expires?: string | null | undefined; + '@static_behaviors'?: unknown; + allow_discussion?: boolean | undefined; + blocks?: unknown; + blocks_layout?: { + items: string[]; + } | undefined; + contributors?: string[] | undefined; + creators?: string[] | undefined; + file?: { + data: string; + 'content-type': string; + encoding: string; + filename: string; + } | undefined; + image?: { + data: string; + 'content-type': string; + encoding: string; + filename: string; + } | undefined; + language?: string | undefined; + preview_caption?: string | undefined; + preview_image?: { + data: string; + 'content-type': string; + encoding: string; + filename: string; + } | undefined; + relatedItems?: { + "@id": string; + title: string; + location?: unknown; + id?: string | undefined; + "@type"?: string | undefined; + CreationDate?: string | undefined; + Creator?: string | undefined; + Date?: string | undefined; + Description?: string | undefined; + EffectiveDate?: unknown; + ExpirationDate?: unknown; + ModificationDate?: string | undefined; + Subject?: unknown[] | undefined; + Title?: string | undefined; + Type?: string | undefined; + UID?: string | undefined; + author_name?: unknown; + cmf_uid?: unknown; + commentators?: unknown[] | undefined; + created?: string | undefined; + description?: string | undefined; + effective?: string | undefined; + end?: unknown; + exclude_from_nav?: boolean | undefined; + expires?: string | undefined; + getIcon?: unknown; + getId?: string | undefined; + getObjSize?: string | undefined; + getPath?: string | undefined; + getRemoteUrl?: unknown; + getURL?: string | undefined; + hasPreviewImage?: unknown; + head_title?: unknown; + image_field?: string | null | undefined; + image_scales?: unknown; + in_response_to?: unknown; + is_folderish?: boolean | undefined; + last_comment_date?: unknown; + listCreators?: string[] | undefined; + mime_type?: string | undefined; + modified?: string | undefined; + nav_title?: unknown; + portal_type?: string | undefined; + review_state?: string | undefined; + start?: unknown; + sync_uid?: unknown; + total_comments?: number | undefined; + }[] | undefined; + rights?: string | null | undefined; + versioning_enabled?: boolean | undefined; + }; +}>; +type CreateContentArgs = z.infer; +declare function createContent(this: PloneClient, { path, data }: CreateContentArgs): Promise>; + +declare const updateContentArgsSchema: z.ZodObject<{ + path: z.ZodString; + data: z.ZodObject<{ + allow_discussion: z.ZodOptional>; + blocks: z.ZodOptional>; + blocks_layout: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + items: string[]; + }, { + items: string[]; + }>>>; + contributors: z.ZodOptional>>; + creators: z.ZodOptional>>; + description: z.ZodOptional>; + effective: z.ZodOptional>>; + exclude_from_nav: z.ZodOptional>; + expires: z.ZodOptional>>; + id: z.ZodOptional>>; + ordering: z.ZodOptional, z.ZodLiteral<"top">]>; + subset_ids: z.ZodOptional>; + }, "strip", z.ZodTypeAny, { + obj_id: string; + delta: number | "bottom" | "top"; + subset_ids?: string[] | undefined; + }, { + obj_id: string; + delta: number | "bottom" | "top"; + subset_ids?: string[] | undefined; + }>>>; + preview_caption: z.ZodOptional>>; + preview_image: z.ZodOptional>>>; + relatedItems: z.ZodOptional; + id: z.ZodOptional; + "@id": z.ZodString; + "@type": z.ZodOptional; + CreationDate: z.ZodOptional; + Creator: z.ZodOptional; + Date: z.ZodOptional; + Description: z.ZodOptional; + EffectiveDate: z.ZodOptional; + ExpirationDate: z.ZodOptional; + ModificationDate: z.ZodOptional; + Subject: z.ZodOptional>; + Title: z.ZodOptional; + Type: z.ZodOptional; + UID: z.ZodOptional; + author_name: z.ZodOptional; + cmf_uid: z.ZodOptional; + commentators: z.ZodOptional>; + created: z.ZodOptional; + description: z.ZodOptional; + effective: z.ZodOptional; + end: z.ZodOptional; + exclude_from_nav: z.ZodOptional; + expires: z.ZodOptional; + getIcon: z.ZodOptional; + getId: z.ZodOptional; + getObjSize: z.ZodOptional; + getPath: z.ZodOptional; + getRemoteUrl: z.ZodOptional; + getURL: z.ZodOptional; + hasPreviewImage: z.ZodOptional; + head_title: z.ZodOptional; + image_field: z.ZodOptional>; + image_scales: z.ZodOptional; + in_response_to: z.ZodOptional; + is_folderish: z.ZodOptional; + last_comment_date: z.ZodOptional; + listCreators: z.ZodOptional>; + mime_type: z.ZodOptional; + modified: z.ZodOptional; + nav_title: z.ZodOptional; + portal_type: z.ZodOptional; + review_state: z.ZodOptional; + start: z.ZodOptional; + sync_uid: z.ZodOptional; + title: z.ZodString; + total_comments: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + "@id": string; + title: string; + location?: unknown; + id?: string | undefined; + "@type"?: string | undefined; + CreationDate?: string | undefined; + Creator?: string | undefined; + Date?: string | undefined; + Description?: string | undefined; + EffectiveDate?: unknown; + ExpirationDate?: unknown; + ModificationDate?: string | undefined; + Subject?: unknown[] | undefined; + Title?: string | undefined; + Type?: string | undefined; + UID?: string | undefined; + author_name?: unknown; + cmf_uid?: unknown; + commentators?: unknown[] | undefined; + created?: string | undefined; + description?: string | undefined; + effective?: string | undefined; + end?: unknown; + exclude_from_nav?: boolean | undefined; + expires?: string | undefined; + getIcon?: unknown; + getId?: string | undefined; + getObjSize?: string | undefined; + getPath?: string | undefined; + getRemoteUrl?: unknown; + getURL?: string | undefined; + hasPreviewImage?: unknown; + head_title?: unknown; + image_field?: string | null | undefined; + image_scales?: unknown; + in_response_to?: unknown; + is_folderish?: boolean | undefined; + last_comment_date?: unknown; + listCreators?: string[] | undefined; + mime_type?: string | undefined; + modified?: string | undefined; + nav_title?: unknown; + portal_type?: string | undefined; + review_state?: string | undefined; + start?: unknown; + sync_uid?: unknown; + total_comments?: number | undefined; + }, { + "@id": string; + title: string; + location?: unknown; + id?: string | undefined; + "@type"?: string | undefined; + CreationDate?: string | undefined; + Creator?: string | undefined; + Date?: string | undefined; + Description?: string | undefined; + EffectiveDate?: unknown; + ExpirationDate?: unknown; + ModificationDate?: string | undefined; + Subject?: unknown[] | undefined; + Title?: string | undefined; + Type?: string | undefined; + UID?: string | undefined; + author_name?: unknown; + cmf_uid?: unknown; + commentators?: unknown[] | undefined; + created?: string | undefined; + description?: string | undefined; + effective?: string | undefined; + end?: unknown; + exclude_from_nav?: boolean | undefined; + expires?: string | undefined; + getIcon?: unknown; + getId?: string | undefined; + getObjSize?: string | undefined; + getPath?: string | undefined; + getRemoteUrl?: unknown; + getURL?: string | undefined; + hasPreviewImage?: unknown; + head_title?: unknown; + image_field?: string | null | undefined; + image_scales?: unknown; + in_response_to?: unknown; + is_folderish?: boolean | undefined; + last_comment_date?: unknown; + listCreators?: string[] | undefined; + mime_type?: string | undefined; + modified?: string | undefined; + nav_title?: unknown; + portal_type?: string | undefined; + review_state?: string | undefined; + start?: unknown; + sync_uid?: unknown; + total_comments?: number | undefined; + }>, "many">>>; + rights: z.ZodOptional>>; + table_of_contents: z.ZodOptional>>; + title: z.ZodOptional>; + versioning_enabled: z.ZodOptional>; + }, "strip", z.ZodTypeAny, { + id?: string | null | undefined; + description?: string | undefined; + effective?: string | null | undefined; + exclude_from_nav?: boolean | undefined; + expires?: string | null | undefined; + title?: string | undefined; + allow_discussion?: boolean | undefined; + blocks?: unknown; + blocks_layout?: { + items: string[]; + } | undefined; + contributors?: string[] | undefined; + creators?: string[] | undefined; + preview_caption?: string | null | undefined; + preview_image?: { + data: string; + 'content-type': string; + encoding: string; + filename: string; + } | null | undefined; + relatedItems?: { + "@id": string; + title: string; + location?: unknown; + id?: string | undefined; + "@type"?: string | undefined; + CreationDate?: string | undefined; + Creator?: string | undefined; + Date?: string | undefined; + Description?: string | undefined; + EffectiveDate?: unknown; + ExpirationDate?: unknown; + ModificationDate?: string | undefined; + Subject?: unknown[] | undefined; + Title?: string | undefined; + Type?: string | undefined; + UID?: string | undefined; + author_name?: unknown; + cmf_uid?: unknown; + commentators?: unknown[] | undefined; + created?: string | undefined; + description?: string | undefined; + effective?: string | undefined; + end?: unknown; + exclude_from_nav?: boolean | undefined; + expires?: string | undefined; + getIcon?: unknown; + getId?: string | undefined; + getObjSize?: string | undefined; + getPath?: string | undefined; + getRemoteUrl?: unknown; + getURL?: string | undefined; + hasPreviewImage?: unknown; + head_title?: unknown; + image_field?: string | null | undefined; + image_scales?: unknown; + in_response_to?: unknown; + is_folderish?: boolean | undefined; + last_comment_date?: unknown; + listCreators?: string[] | undefined; + mime_type?: string | undefined; + modified?: string | undefined; + nav_title?: unknown; + portal_type?: string | undefined; + review_state?: string | undefined; + start?: unknown; + sync_uid?: unknown; + total_comments?: number | undefined; + }[] | undefined; + rights?: string | null | undefined; + versioning_enabled?: boolean | undefined; + ordering?: { + obj_id: string; + delta: number | "bottom" | "top"; + subset_ids?: string[] | undefined; + } | undefined; + table_of_contents?: boolean | null | undefined; + }, { + id?: string | null | undefined; + description?: string | undefined; + effective?: string | null | undefined; + exclude_from_nav?: boolean | undefined; + expires?: string | null | undefined; + title?: string | undefined; + allow_discussion?: boolean | undefined; + blocks?: unknown; + blocks_layout?: { + items: string[]; + } | undefined; + contributors?: string[] | undefined; + creators?: string[] | undefined; + preview_caption?: string | null | undefined; + preview_image?: { + data: string; + 'content-type': string; + encoding: string; + filename: string; + } | null | undefined; + relatedItems?: { + "@id": string; + title: string; + location?: unknown; + id?: string | undefined; + "@type"?: string | undefined; + CreationDate?: string | undefined; + Creator?: string | undefined; + Date?: string | undefined; + Description?: string | undefined; + EffectiveDate?: unknown; + ExpirationDate?: unknown; + ModificationDate?: string | undefined; + Subject?: unknown[] | undefined; + Title?: string | undefined; + Type?: string | undefined; + UID?: string | undefined; + author_name?: unknown; + cmf_uid?: unknown; + commentators?: unknown[] | undefined; + created?: string | undefined; + description?: string | undefined; + effective?: string | undefined; + end?: unknown; + exclude_from_nav?: boolean | undefined; + expires?: string | undefined; + getIcon?: unknown; + getId?: string | undefined; + getObjSize?: string | undefined; + getPath?: string | undefined; + getRemoteUrl?: unknown; + getURL?: string | undefined; + hasPreviewImage?: unknown; + head_title?: unknown; + image_field?: string | null | undefined; + image_scales?: unknown; + in_response_to?: unknown; + is_folderish?: boolean | undefined; + last_comment_date?: unknown; + listCreators?: string[] | undefined; + mime_type?: string | undefined; + modified?: string | undefined; + nav_title?: unknown; + portal_type?: string | undefined; + review_state?: string | undefined; + start?: unknown; + sync_uid?: unknown; + total_comments?: number | undefined; + }[] | undefined; + rights?: string | null | undefined; + versioning_enabled?: boolean | undefined; + ordering?: { + obj_id: string; + delta: number | "bottom" | "top"; + subset_ids?: string[] | undefined; + } | undefined; + table_of_contents?: boolean | null | undefined; + }>; +}, "strip", z.ZodTypeAny, { + path: string; + data: { + id?: string | null | undefined; + description?: string | undefined; + effective?: string | null | undefined; + exclude_from_nav?: boolean | undefined; + expires?: string | null | undefined; + title?: string | undefined; + allow_discussion?: boolean | undefined; + blocks?: unknown; + blocks_layout?: { + items: string[]; + } | undefined; + contributors?: string[] | undefined; + creators?: string[] | undefined; + preview_caption?: string | null | undefined; + preview_image?: { + data: string; + 'content-type': string; + encoding: string; + filename: string; + } | null | undefined; + relatedItems?: { + "@id": string; + title: string; + location?: unknown; + id?: string | undefined; + "@type"?: string | undefined; + CreationDate?: string | undefined; + Creator?: string | undefined; + Date?: string | undefined; + Description?: string | undefined; + EffectiveDate?: unknown; + ExpirationDate?: unknown; + ModificationDate?: string | undefined; + Subject?: unknown[] | undefined; + Title?: string | undefined; + Type?: string | undefined; + UID?: string | undefined; + author_name?: unknown; + cmf_uid?: unknown; + commentators?: unknown[] | undefined; + created?: string | undefined; + description?: string | undefined; + effective?: string | undefined; + end?: unknown; + exclude_from_nav?: boolean | undefined; + expires?: string | undefined; + getIcon?: unknown; + getId?: string | undefined; + getObjSize?: string | undefined; + getPath?: string | undefined; + getRemoteUrl?: unknown; + getURL?: string | undefined; + hasPreviewImage?: unknown; + head_title?: unknown; + image_field?: string | null | undefined; + image_scales?: unknown; + in_response_to?: unknown; + is_folderish?: boolean | undefined; + last_comment_date?: unknown; + listCreators?: string[] | undefined; + mime_type?: string | undefined; + modified?: string | undefined; + nav_title?: unknown; + portal_type?: string | undefined; + review_state?: string | undefined; + start?: unknown; + sync_uid?: unknown; + total_comments?: number | undefined; + }[] | undefined; + rights?: string | null | undefined; + versioning_enabled?: boolean | undefined; + ordering?: { + obj_id: string; + delta: number | "bottom" | "top"; + subset_ids?: string[] | undefined; + } | undefined; + table_of_contents?: boolean | null | undefined; + }; +}, { + path: string; + data: { + id?: string | null | undefined; + description?: string | undefined; + effective?: string | null | undefined; + exclude_from_nav?: boolean | undefined; + expires?: string | null | undefined; + title?: string | undefined; + allow_discussion?: boolean | undefined; + blocks?: unknown; + blocks_layout?: { + items: string[]; + } | undefined; + contributors?: string[] | undefined; + creators?: string[] | undefined; + preview_caption?: string | null | undefined; + preview_image?: { + data: string; + 'content-type': string; + encoding: string; + filename: string; + } | null | undefined; + relatedItems?: { + "@id": string; + title: string; + location?: unknown; + id?: string | undefined; + "@type"?: string | undefined; + CreationDate?: string | undefined; + Creator?: string | undefined; + Date?: string | undefined; + Description?: string | undefined; + EffectiveDate?: unknown; + ExpirationDate?: unknown; + ModificationDate?: string | undefined; + Subject?: unknown[] | undefined; + Title?: string | undefined; + Type?: string | undefined; + UID?: string | undefined; + author_name?: unknown; + cmf_uid?: unknown; + commentators?: unknown[] | undefined; + created?: string | undefined; + description?: string | undefined; + effective?: string | undefined; + end?: unknown; + exclude_from_nav?: boolean | undefined; + expires?: string | undefined; + getIcon?: unknown; + getId?: string | undefined; + getObjSize?: string | undefined; + getPath?: string | undefined; + getRemoteUrl?: unknown; + getURL?: string | undefined; + hasPreviewImage?: unknown; + head_title?: unknown; + image_field?: string | null | undefined; + image_scales?: unknown; + in_response_to?: unknown; + is_folderish?: boolean | undefined; + last_comment_date?: unknown; + listCreators?: string[] | undefined; + mime_type?: string | undefined; + modified?: string | undefined; + nav_title?: unknown; + portal_type?: string | undefined; + review_state?: string | undefined; + start?: unknown; + sync_uid?: unknown; + total_comments?: number | undefined; + }[] | undefined; + rights?: string | null | undefined; + versioning_enabled?: boolean | undefined; + ordering?: { + obj_id: string; + delta: number | "bottom" | "top"; + subset_ids?: string[] | undefined; + } | undefined; + table_of_contents?: boolean | null | undefined; + }; +}>; +type UpdateContentArgs = z.infer; +declare function updateContent(this: PloneClient, { path, data }: UpdateContentArgs): Promise>; + +declare const deleteContentArgsSchema: z.ZodObject<{ + path: z.ZodString; +}, "strip", z.ZodTypeAny, { + path: string; +}, { + path: string; +}>; +type DeleteContentArgs = z.infer; +declare function deleteContent(this: PloneClient, { path }: DeleteContentArgs): Promise>; + +declare const copyMoveContentDataSchema: z.ZodObject<{ + path: z.ZodString; + data: z.ZodObject<{ + source: z.ZodUnion<[z.ZodString, z.ZodArray]>; + }, "strip", z.ZodTypeAny, { + source: string | string[]; + }, { + source: string | string[]; + }>; +}, "strip", z.ZodTypeAny, { + path: string; + data: { + source: string | string[]; + }; +}, { + path: string; + data: { + source: string | string[]; + }; +}>; + +type CopyArgs = z.infer; +declare function copyContent(this: PloneClient, { path, data }: CopyArgs): Promise>; + +type MoveArgs = z.infer; +declare function moveContent(this: PloneClient, { path, data }: MoveArgs): Promise>; + +declare const getContextNavigationSchema: z.ZodObject<{ + path: z.ZodString; +}, "strip", z.ZodTypeAny, { + path: string; +}, { + path: string; +}>; +type ContextNavigationArgs = z.infer; +declare function getContextNavigation(this: PloneClient, { path }: ContextNavigationArgs): Promise>; + +declare function getControlpanels(this: PloneClient): Promise>; + +declare const getControlpanelSchema: z.ZodObject<{ + id: z.ZodString; +}, "strip", z.ZodTypeAny, { + id: string; +}, { + id: string; +}>; +type ControlpanelArgs = z.infer; +declare function getControlpanel(this: PloneClient, { id }: ControlpanelArgs): Promise>; + +declare const createControlpanelArgsSchema: z.ZodObject<{ + path: z.ZodString; + data: z.ZodAny; +}, "strip", z.ZodTypeAny, { + path: string; + data?: any; +}, { + path: string; + data?: any; +}>; +type CreateControlpanelArgs = z.infer; +declare function createControlpanel(this: PloneClient, { path, data }: CreateControlpanelArgs): Promise>; + +declare const updateControlpanelArgsSchema: z.ZodObject<{ + path: z.ZodString; + data: z.ZodAny; +}, "strip", z.ZodTypeAny, { + path: string; + data?: any; +}, { + path: string; + data?: any; +}>; +type UpdateControlpanelArgs = z.infer; +declare function updateControlpanel(this: PloneClient, { path, data }: UpdateControlpanelArgs): Promise>; + +declare const deleteControlpanelArgsSchema: z.ZodObject<{ + path: z.ZodString; + data: z.ZodAny; +}, "strip", z.ZodTypeAny, { + path: string; + data?: any; +}, { + path: string; + data?: any; +}>; +type DeleteControlpanelArgs = z.infer; +declare function deleteControlpanel(this: PloneClient, { path, data }: DeleteControlpanelArgs): Promise>; + +declare function getDatabase(this: PloneClient): Promise>; + +declare const emailNotificationArgsSchema: z.ZodObject<{ + user: z.ZodOptional; + data: z.ZodObject<{ + name: z.ZodString; + from: z.ZodString; + subject: z.ZodString; + message: z.ZodString; + }, "strip", z.ZodTypeAny, { + message: string; + name: string; + from: string; + subject: string; + }, { + message: string; + name: string; + from: string; + subject: string; + }>; +}, "strip", z.ZodTypeAny, { + data: { + message: string; + name: string; + from: string; + subject: string; + }; + user?: string | undefined; +}, { + data: { + message: string; + name: string; + from: string; + subject: string; + }; + user?: string | undefined; +}>; +type EmailNotificationArgs = z.infer; +declare function emailNotification(this: PloneClient, { user, data }: EmailNotificationArgs): Promise>; + +declare const emailSendArgsSchema: z.ZodObject<{ + data: z.ZodObject<{ + name: z.ZodString; + from: z.ZodString; + to: z.ZodString; + subject: z.ZodString; + message: z.ZodString; + }, "strip", z.ZodTypeAny, { + message: string; + name: string; + from: string; + subject: string; + to: string; + }, { + message: string; + name: string; + from: string; + subject: string; + to: string; + }>; +}, "strip", z.ZodTypeAny, { + data: { + message: string; + name: string; + from: string; + subject: string; + to: string; + }; +}, { + data: { + message: string; + name: string; + from: string; + subject: string; + to: string; + }; +}>; +type EmailSendArgs = z.infer; +declare function emailSend(this: PloneClient, { data }: EmailSendArgs): Promise>; + +declare function getGroups(this: PloneClient): Promise>; + +declare const getGroupSchema: z.ZodObject<{ + id: z.ZodString; +}, "strip", z.ZodTypeAny, { + id: string; +}, { + id: string; +}>; +type GroupArgs = z.infer; +declare function getGroup(this: PloneClient, { id }: GroupArgs): Promise>; + +declare const createGroupArgsSchema: z.ZodObject<{ + data: z.ZodObject<{ + description: z.ZodOptional; + email: z.ZodOptional; + groupname: z.ZodString; + groups: z.ZodOptional>; + roles: z.ZodOptional>; + title: z.ZodOptional; + users: z.ZodOptional>; + }, "strip", z.ZodTypeAny, { + groupname: string; + description?: string | undefined; + title?: string | undefined; + email?: string | undefined; + groups?: string[] | undefined; + roles?: string[] | undefined; + users?: string[] | undefined; + }, { + groupname: string; + description?: string | undefined; + title?: string | undefined; + email?: string | undefined; + groups?: string[] | undefined; + roles?: string[] | undefined; + users?: string[] | undefined; + }>; +}, "strip", z.ZodTypeAny, { + data: { + groupname: string; + description?: string | undefined; + title?: string | undefined; + email?: string | undefined; + groups?: string[] | undefined; + roles?: string[] | undefined; + users?: string[] | undefined; + }; +}, { + data: { + groupname: string; + description?: string | undefined; + title?: string | undefined; + email?: string | undefined; + groups?: string[] | undefined; + roles?: string[] | undefined; + users?: string[] | undefined; + }; +}>; +type CreateGroupArgs = z.infer; +declare function createGroup(this: PloneClient, { data }: CreateGroupArgs): Promise>; + +declare const updateGroupArgsSchema: z.ZodObject<{ + id: z.ZodString; + data: z.ZodObject<{ + description: z.ZodOptional; + email: z.ZodOptional; + title: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + description?: string | undefined; + title?: string | undefined; + email?: string | undefined; + }, { + description?: string | undefined; + title?: string | undefined; + email?: string | undefined; + }>; +}, "strip", z.ZodTypeAny, { + data: { + description?: string | undefined; + title?: string | undefined; + email?: string | undefined; + }; + id: string; +}, { + data: { + description?: string | undefined; + title?: string | undefined; + email?: string | undefined; + }; + id: string; +}>; +type UpdateGroupArgs = z.infer; +declare function updateGroup(this: PloneClient, { id, data }: UpdateGroupArgs): Promise>; + +declare const deleteGroupArgsSchema: z.ZodObject<{ + id: z.ZodString; +}, "strip", z.ZodTypeAny, { + id: string; +}, { + id: string; +}>; +type DeleteGroupArgs = z.infer; +declare function deleteGroup(this: PloneClient, { id }: DeleteGroupArgs): Promise>; + +declare const getHistorySchema: z.ZodObject<{ + path: z.ZodString; +}, "strip", z.ZodTypeAny, { + path: string; +}, { + path: string; +}>; +type HistoryArgs = z.infer & {}; +declare function getHistory(this: PloneClient, { path }: HistoryArgs): Promise>; + +declare const getHistoryVersionSchema: z.ZodObject<{ + path: z.ZodString; + version: z.ZodNumber; +}, "strip", z.ZodTypeAny, { + path: string; + version: number; +}, { + path: string; + version: number; +}>; +type HistoryVersionArgs = z.infer; +declare function getHistoryVersion(this: PloneClient, { path, version }: HistoryVersionArgs): Promise>; + +declare const revertHistoryArgsSchema: z.ZodObject<{ + path: z.ZodString; + data: z.ZodObject<{ + version: z.ZodNumber; + }, "strip", z.ZodTypeAny, { + version: number; + }, { + version: number; + }>; +}, "strip", z.ZodTypeAny, { + path: string; + data: { + version: number; + }; +}, { + path: string; + data: { + version: number; + }; +}>; +type ReverHistoryArgs = z.infer; +declare function revertHistory(this: PloneClient, { path, data }: ReverHistoryArgs): Promise>; + +declare const getLinkintegriyArgsSchema: z.ZodObject<{ + uids: z.ZodString; +}, "strip", z.ZodTypeAny, { + uids: string; +}, { + uids: string; +}>; +type GetLinkintegrityArgs = z.infer; +declare function getLinkintegrity(this: PloneClient, { uids }: GetLinkintegrityArgs): Promise>; + +declare const getLockSchema: z.ZodObject<{ + path: z.ZodString; +}, "strip", z.ZodTypeAny, { + path: string; +}, { + path: string; +}>; +type LockArgs = z.infer; +declare function getLock(this: PloneClient, { path }: LockArgs): Promise>; + +declare const createLockArgsSchema: z.ZodObject<{ + path: z.ZodString; + data: z.ZodObject<{ + stealable: z.ZodOptional; + timeout: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + stealable?: boolean | undefined; + timeout?: number | undefined; + }, { + stealable?: boolean | undefined; + timeout?: number | undefined; + }>; +}, "strip", z.ZodTypeAny, { + path: string; + data: { + stealable?: boolean | undefined; + timeout?: number | undefined; + }; +}, { + path: string; + data: { + stealable?: boolean | undefined; + timeout?: number | undefined; + }; +}>; +type CreateLockArgs = z.infer; +declare function createLock(this: PloneClient, { path, data }: CreateLockArgs): Promise>; + +declare const updateLockArgsSchema: z.ZodObject<{ + path: z.ZodString; + locktoken: z.ZodString; +}, "strip", z.ZodTypeAny, { + path: string; + locktoken: string; +}, { + path: string; + locktoken: string; +}>; +type UpdateLockArgs = z.infer; +declare function updateLock(this: PloneClient, { path, locktoken }: UpdateLockArgs): Promise>; + +declare const deleteLockArgsSchema: z.ZodObject<{ + path: z.ZodString; + data: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + force?: boolean | undefined; + }, { + force?: boolean | undefined; + }>>; +}, "strip", z.ZodTypeAny, { + path: string; + data?: { + force?: boolean | undefined; + } | undefined; +}, { + path: string; + data?: { + force?: boolean | undefined; + } | undefined; +}>; +type DeleteLockArgs = z.infer; +declare function deleteLock(this: PloneClient, { path, data }: DeleteLockArgs): Promise>; + +declare const loginArgsSchema: z.ZodObject<{ + data: z.ZodObject<{ + login: z.ZodString; + password: z.ZodString; + }, "strip", z.ZodTypeAny, { + login: string; + password: string; + }, { + login: string; + password: string; + }>; +}, "strip", z.ZodTypeAny, { + data: { + login: string; + password: string; + }; +}, { + data: { + login: string; + password: string; + }; +}>; +type LoginArgs = z.infer; +declare function login(this: PloneClient, { data }: LoginArgs): Promise>; + +declare const getNavigationSchema: z.ZodObject<{ + path: z.ZodString; + depth: z.ZodOptional; +}, "strip", z.ZodTypeAny, { + path: string; + depth?: number | undefined; +}, { + path: string; + depth?: number | undefined; +}>; +type NavigationArgs = z.infer; +declare function getNavigation(this: PloneClient, { path, depth }: NavigationArgs): Promise>; + +declare const getNavrootSchema: z.ZodObject<{ + path: z.ZodString; + language: z.ZodOptional; +}, "strip", z.ZodTypeAny, { + path: string; + language?: string | undefined; +}, { + path: string; + language?: string | undefined; +}>; +type NavrootArgs = z.infer; +declare function getNavroot(this: PloneClient, { path, language }: NavrootArgs): Promise>; + +declare const getPrincipalsSchema: z.ZodObject<{ + search: z.ZodString; +}, "strip", z.ZodTypeAny, { + search: string; +}, { + search: string; +}>; +type PrincipalsArgs = z.infer; +declare function getPrincipals(this: PloneClient, { search }: PrincipalsArgs): Promise>; + +declare const getQuerysourcesSchema: z.ZodObject<{ + path: z.ZodString; + field: z.ZodString; + query: z.ZodString; +}, "strip", z.ZodTypeAny, { + path: string; + field: string; + query: string; +}, { + path: string; + field: string; + query: string; +}>; +type QuerysourcesArgs = z.infer; +declare function getQuerysources(this: PloneClient, { path, field, query }: QuerysourcesArgs): Promise>; + +declare function getQuerystring(this: PloneClient): Promise>; + +declare const querystringSearchDataSchema: z.ZodObject<{ + b_start: z.ZodOptional; + b_size: z.ZodOptional; + limit: z.ZodOptional; + sort_on: z.ZodOptional; + sort_order: z.ZodOptional; + fullobjects: z.ZodOptional; + query: z.ZodArray]>; + }, "strip", z.ZodTypeAny, { + i: string; + o: string; + v: string | string[]; + }, { + i: string; + o: string; + v: string | string[]; + }>, "many">; + post: z.ZodOptional; +}, "strip", z.ZodTypeAny, { + query: { + i: string; + o: string; + v: string | string[]; + }[]; + post?: boolean | undefined; + b_start?: string | undefined; + b_size?: string | undefined; + limit?: string | undefined; + sort_on?: string | undefined; + sort_order?: string | undefined; + fullobjects?: boolean | undefined; +}, { + query: { + i: string; + o: string; + v: string | string[]; + }[]; + post?: boolean | undefined; + b_start?: string | undefined; + b_size?: string | undefined; + limit?: string | undefined; + sort_on?: string | undefined; + sort_order?: string | undefined; + fullobjects?: boolean | undefined; +}>; + +type QuerystringSearchArgs = z.infer; +declare function querystringSearch(this: PloneClient, { query, post }: QuerystringSearchArgs): Promise>; + +declare function getRegistry(this: PloneClient): Promise>; + +declare const getRegistryRecordSchema: z.ZodObject<{ + name: z.ZodString; +}, "strip", z.ZodTypeAny, { + name: string; +}, { + name: string; +}>; +type GetRegistryArgs = z.infer; +declare function getRegistryRecord(this: PloneClient, { name }: GetRegistryArgs): Promise>; + +declare const updateRegistryArgsSchema: z.ZodObject<{ + data: z.ZodRecord; +}, "strip", z.ZodTypeAny, { + data: Record; +}, { + data: Record; +}>; +type UpdateRegistryArgs = z.infer; +declare function updateRegistry(this: PloneClient, { data }: UpdateRegistryArgs): Promise>; + +declare function getAllRelations(this: PloneClient): Promise>; + +declare const getRelationsSchema: z.ZodEffects; + relation: z.ZodOptional; + onlyBroken: z.ZodOptional; +}, "strip", z.ZodTypeAny, { + source?: string | undefined; + relation?: string | undefined; + onlyBroken?: boolean | undefined; +}, { + source?: string | undefined; + relation?: string | undefined; + onlyBroken?: boolean | undefined; +}>, { + source?: string | undefined; + relation?: string | undefined; + onlyBroken?: boolean | undefined; +}, { + source?: string | undefined; + relation?: string | undefined; + onlyBroken?: boolean | undefined; +}>; +type RelationsArgs = z.infer; +declare function getRelations(this: PloneClient, { source, relation, onlyBroken }: RelationsArgs): Promise>; + +declare const createRelationsArgsSchema: z.ZodObject<{ + data: z.ZodObject<{ + items: z.ZodArray, "many">; + }, "strip", z.ZodTypeAny, { + items: { + source: string; + relation: string; + target: string; + }[]; + }, { + items: { + source: string; + relation: string; + target: string; + }[]; + }>; +}, "strip", z.ZodTypeAny, { + data: { + items: { + source: string; + relation: string; + target: string; + }[]; + }; +}, { + data: { + items: { + source: string; + relation: string; + target: string; + }[]; + }; +}>; +type CreateRelationsArgs = z.infer; +declare function createRelations(this: PloneClient, { data }: CreateRelationsArgs): Promise>; + +declare const fixRelationsArgsSchema: z.ZodObject<{ + data: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + flush?: number | undefined; + }, { + flush?: number | undefined; + }>>; +}, "strip", z.ZodTypeAny, { + data?: { + flush?: number | undefined; + } | undefined; +}, { + data?: { + flush?: number | undefined; + } | undefined; +}>; +type FixRelationsArgs = z.infer; +declare function fixRelations(this: PloneClient, { data }: FixRelationsArgs): Promise>; + +declare const deleteRelationsArgsSchema: z.ZodObject<{ + data: z.ZodObject<{ + items: z.ZodOptional, "many">>; + relation: z.ZodOptional; + source: z.ZodOptional; + target: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + items?: { + source: string; + relation: string; + target: string; + }[] | undefined; + source?: string | undefined; + relation?: string | undefined; + target?: string | undefined; + }, { + items?: { + source: string; + relation: string; + target: string; + }[] | undefined; + source?: string | undefined; + relation?: string | undefined; + target?: string | undefined; + }>; +}, "strip", z.ZodTypeAny, { + data: { + items?: { + source: string; + relation: string; + target: string; + }[] | undefined; + source?: string | undefined; + relation?: string | undefined; + target?: string | undefined; + }; +}, { + data: { + items?: { + source: string; + relation: string; + target: string; + }[] | undefined; + source?: string | undefined; + relation?: string | undefined; + target?: string | undefined; + }; +}>; +type DeleteRelationsArgs = z.infer; +declare function deleteRelations(this: PloneClient, { data }: DeleteRelationsArgs): Promise>; + +declare function getRoles(this: PloneClient): Promise>; + +declare function getRules(this: PloneClient): Promise>; + +declare const createRuleArgsSchema: z.ZodObject<{ + ruleId: z.ZodString; +}, "strip", z.ZodTypeAny, { + ruleId: string; +}, { + ruleId: string; +}>; +type CreateRuleArgs = z.infer; +declare function createRule(this: PloneClient, { ruleId }: CreateRuleArgs): Promise>; + +declare const updateRulesArgsSchema: z.ZodObject<{ + data: z.ZodObject<{ + 'form.button.Bubble': z.ZodOptional; + 'form.button.NoBubble': z.ZodOptional; + 'form.button.Enable': z.ZodOptional; + 'form.button.Disable': z.ZodOptional; + rules_ids: z.ZodOptional>; + operation: z.ZodOptional; + rule_id: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + 'form.button.Bubble'?: boolean | undefined; + 'form.button.NoBubble'?: boolean | undefined; + 'form.button.Enable'?: boolean | undefined; + 'form.button.Disable'?: boolean | undefined; + rules_ids?: string[] | undefined; + operation?: string | undefined; + rule_id?: string | undefined; + }, { + 'form.button.Bubble'?: boolean | undefined; + 'form.button.NoBubble'?: boolean | undefined; + 'form.button.Enable'?: boolean | undefined; + 'form.button.Disable'?: boolean | undefined; + rules_ids?: string[] | undefined; + operation?: string | undefined; + rule_id?: string | undefined; + }>; +}, "strip", z.ZodTypeAny, { + data: { + 'form.button.Bubble'?: boolean | undefined; + 'form.button.NoBubble'?: boolean | undefined; + 'form.button.Enable'?: boolean | undefined; + 'form.button.Disable'?: boolean | undefined; + rules_ids?: string[] | undefined; + operation?: string | undefined; + rule_id?: string | undefined; + }; +}, { + data: { + 'form.button.Bubble'?: boolean | undefined; + 'form.button.NoBubble'?: boolean | undefined; + 'form.button.Enable'?: boolean | undefined; + 'form.button.Disable'?: boolean | undefined; + rules_ids?: string[] | undefined; + operation?: string | undefined; + rule_id?: string | undefined; + }; +}>; +type UpdateRulesArgs = z.infer; +declare function updateRules(this: PloneClient, { data }: UpdateRulesArgs): Promise>; + +declare const deleteRulesArgsSchema: z.ZodObject<{ + data: z.ZodObject<{ + rules_ids: z.ZodArray; + }, "strip", z.ZodTypeAny, { + rules_ids: string[]; + }, { + rules_ids: string[]; + }>; +}, "strip", z.ZodTypeAny, { + data: { + rules_ids: string[]; + }; +}, { + data: { + rules_ids: string[]; + }; +}>; +type DeleteRulesArgs = z.infer; +declare function deleteRules(this: PloneClient, { data }: DeleteRulesArgs): Promise>; + +declare const searchSchema: z.ZodObject<{ + query: z.ZodIntersection]>; + depth: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + query: string | string[]; + depth?: number | undefined; + }, { + query: string | string[]; + depth?: number | undefined; + }>>; + sort_on: z.ZodOptional]>>; + SearchableText: z.ZodOptional; + metadata_fields: z.ZodOptional]>>; + fullobjects: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + path?: { + query: string | string[]; + depth?: number | undefined; + } | undefined; + sort_on?: string | string[] | undefined; + fullobjects?: number | undefined; + SearchableText?: string | undefined; + metadata_fields?: string | string[] | undefined; + }, { + path?: { + query: string | string[]; + depth?: number | undefined; + } | undefined; + sort_on?: string | string[] | undefined; + fullobjects?: number | undefined; + SearchableText?: string | undefined; + metadata_fields?: string | string[] | undefined; + }>, z.ZodRecord>; +}, "strip", z.ZodTypeAny, { + query: { + path?: { + query: string | string[]; + depth?: number | undefined; + } | undefined; + sort_on?: string | string[] | undefined; + fullobjects?: number | undefined; + SearchableText?: string | undefined; + metadata_fields?: string | string[] | undefined; + } & Record; +}, { + query: { + path?: { + query: string | string[]; + depth?: number | undefined; + } | undefined; + sort_on?: string | string[] | undefined; + fullobjects?: number | undefined; + SearchableText?: string | undefined; + metadata_fields?: string | string[] | undefined; + } & Record; +}>; + +type SearchArgs = z.infer; +declare function search(this: PloneClient, { query }: SearchArgs): Promise>; + +declare function getSite(this: PloneClient): Promise>; + +declare const getSourceSchema: z.ZodObject<{ + path: z.ZodString; + field: z.ZodString; +}, "strip", z.ZodTypeAny, { + path: string; + field: string; +}, { + path: string; + field: string; +}>; +type SourceArgs = z.infer; +declare function getSource(this: PloneClient, { path, field }: SourceArgs): Promise>; + +declare function getSystem(this: PloneClient): Promise>; + +declare function getTransactions(this: PloneClient): Promise>; + +declare const revertTransactionsArgsSchema: z.ZodObject<{ + data: z.ZodObject<{ + transaction_ids: z.ZodArray; + }, "strip", z.ZodTypeAny, { + transaction_ids: string[]; + }, { + transaction_ids: string[]; + }>; +}, "strip", z.ZodTypeAny, { + data: { + transaction_ids: string[]; + }; +}, { + data: { + transaction_ids: string[]; + }; +}>; +type RevertTransactionsArgs = z.infer; +declare function revertTransactions(this: PloneClient, { data }: RevertTransactionsArgs): Promise>; + +declare const getTranslationSchema: z.ZodObject<{ + path: z.ZodString; +}, "strip", z.ZodTypeAny, { + path: string; +}, { + path: string; +}>; +type TranslationArgs = z.infer; +declare function getTranslation(this: PloneClient, { path }: TranslationArgs): Promise>; + +declare const linkTranslationArgsSchema: z.ZodObject<{ + path: z.ZodString; + data: z.ZodObject<{ + id: z.ZodString; + }, "strip", z.ZodTypeAny, { + id: string; + }, { + id: string; + }>; +}, "strip", z.ZodTypeAny, { + path: string; + data: { + id: string; + }; +}, { + path: string; + data: { + id: string; + }; +}>; +type LinkTranslationArgs = z.infer; +declare function linkTranslation(this: PloneClient, { path, data }: LinkTranslationArgs): Promise>; + +declare const unlinkTranslationArgsSchema: z.ZodObject<{ + path: z.ZodString; + data: z.ZodObject<{ + language: z.ZodString; + }, "strip", z.ZodTypeAny, { + language: string; + }, { + language: string; + }>; +}, "strip", z.ZodTypeAny, { + path: string; + data: { + language: string; + }; +}, { + path: string; + data: { + language: string; + }; +}>; +type UnlinkTranslationArgs = z.infer; +declare function unlinkTranslation(this: PloneClient, { path, data }: UnlinkTranslationArgs): Promise>; + +declare function getTypes(this: PloneClient): Promise>; + +declare const getTypeSchema: z.ZodObject<{ + type: z.ZodString; +}, "strip", z.ZodTypeAny, { + type: string; +}, { + type: string; +}>; +type GetTypeArgs = z.infer; +declare function getType(this: PloneClient, { type }: GetTypeArgs): Promise>; + +declare const getTypeFieldSchema: z.ZodObject<{ + contentFieldPath: z.ZodString; +}, "strip", z.ZodTypeAny, { + contentFieldPath: string; +}, { + contentFieldPath: string; +}>; +type GetTypeFieldArgs = z.infer & {}; +declare function getTypeField(this: PloneClient, { contentFieldPath }: GetTypeFieldArgs): Promise>; + +declare const createTypeFieldArgsSchema: z.ZodObject<{ + contentPath: z.ZodString; + data: z.ZodObject<{ + description: z.ZodString; + factory: z.ZodString; + required: z.ZodOptional; + title: z.ZodString; + }, "strip", z.ZodTypeAny, { + description: string; + title: string; + factory: string; + required?: boolean | undefined; + }, { + description: string; + title: string; + factory: string; + required?: boolean | undefined; + }>; +}, "strip", z.ZodTypeAny, { + data: { + description: string; + title: string; + factory: string; + required?: boolean | undefined; + }; + contentPath: string; +}, { + data: { + description: string; + title: string; + factory: string; + required?: boolean | undefined; + }; + contentPath: string; +}>; +type CreateTypeFieldArgs = z.infer; +declare function createTypeField(this: PloneClient, { contentPath, data }: CreateTypeFieldArgs): Promise>; + +declare const updateTypeFieldArgsSchema: z.ZodObject<{ + contentPath: z.ZodString; + data: z.ZodObject<{ + description: z.ZodOptional; + maxLength: z.ZodOptional; + minLength: z.ZodOptional; + fields: z.ZodOptional>; + required: z.ZodOptional; + title: z.ZodOptional; + properties: z.ZodOptional; + fieldsets: z.ZodOptional>; + }, "strip", z.ZodTypeAny, { + description?: string | undefined; + title?: string | undefined; + required?: boolean | undefined; + maxLength?: number | undefined; + minLength?: number | undefined; + fields?: string[] | undefined; + properties?: any; + fieldsets?: any[] | undefined; + }, { + description?: string | undefined; + title?: string | undefined; + required?: boolean | undefined; + maxLength?: number | undefined; + minLength?: number | undefined; + fields?: string[] | undefined; + properties?: any; + fieldsets?: any[] | undefined; + }>; +}, "strip", z.ZodTypeAny, { + data: { + description?: string | undefined; + title?: string | undefined; + required?: boolean | undefined; + maxLength?: number | undefined; + minLength?: number | undefined; + fields?: string[] | undefined; + properties?: any; + fieldsets?: any[] | undefined; + }; + contentPath: string; +}, { + data: { + description?: string | undefined; + title?: string | undefined; + required?: boolean | undefined; + maxLength?: number | undefined; + minLength?: number | undefined; + fields?: string[] | undefined; + properties?: any; + fieldsets?: any[] | undefined; + }; + contentPath: string; +}>; +type UpdateTypeFieldArgs = z.infer; +declare function updateTypeField(this: PloneClient, { contentPath, data }: UpdateTypeFieldArgs): Promise>; + +declare function getUpgrade(this: PloneClient): Promise>; + +declare const runUpgradeArgsSchema: z.ZodObject<{ + data: z.ZodObject<{ + dry_run: z.ZodBoolean; + }, "strip", z.ZodTypeAny, { + dry_run: boolean; + }, { + dry_run: boolean; + }>; +}, "strip", z.ZodTypeAny, { + data: { + dry_run: boolean; + }; +}, { + data: { + dry_run: boolean; + }; +}>; +type RunUpgradeArgs = z.infer; +declare function runUpgrade(this: PloneClient, { data }: RunUpgradeArgs): Promise>; + +declare const getUsersSchema: z.ZodObject<{ + query: z.ZodOptional; + groupsFilter: z.ZodOptional>; + search: z.ZodOptional; + limit: z.ZodOptional; +}, "strip", z.ZodTypeAny, { + search?: string | undefined; + query?: string | undefined; + limit?: number | undefined; + groupsFilter?: string[] | undefined; +}, { + search?: string | undefined; + query?: string | undefined; + limit?: number | undefined; + groupsFilter?: string[] | undefined; +}>; +type GetUsersArgs = z.infer; +declare function getUsers(this: PloneClient, { query, groupsFilter, search, limit }: GetUsersArgs): Promise>; + +declare const getUserSchema: z.ZodObject<{ + id: z.ZodString; +}, "strip", z.ZodTypeAny, { + id: string; +}, { + id: string; +}>; +type UserArgs = z.infer; +declare function getUser(this: PloneClient, { id }: UserArgs): Promise>; + +declare const createUserArgsSchema: z.ZodObject<{ + data: z.ZodObject<{ + description: z.ZodOptional; + email: z.ZodString; + fullname: z.ZodOptional; + home_page: z.ZodOptional; + location: z.ZodOptional; + sendPasswordReset: z.ZodOptional; + username: z.ZodString; + roles: z.ZodOptional>; + password: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + email: string; + username: string; + location?: string | undefined; + description?: string | undefined; + roles?: string[] | undefined; + password?: string | undefined; + fullname?: string | undefined; + home_page?: string | undefined; + sendPasswordReset?: boolean | undefined; + }, { + email: string; + username: string; + location?: string | undefined; + description?: string | undefined; + roles?: string[] | undefined; + password?: string | undefined; + fullname?: string | undefined; + home_page?: string | undefined; + sendPasswordReset?: boolean | undefined; + }>; +}, "strip", z.ZodTypeAny, { + data: { + email: string; + username: string; + location?: string | undefined; + description?: string | undefined; + roles?: string[] | undefined; + password?: string | undefined; + fullname?: string | undefined; + home_page?: string | undefined; + sendPasswordReset?: boolean | undefined; + }; +}, { + data: { + email: string; + username: string; + location?: string | undefined; + description?: string | undefined; + roles?: string[] | undefined; + password?: string | undefined; + fullname?: string | undefined; + home_page?: string | undefined; + sendPasswordReset?: boolean | undefined; + }; +}>; +type CreateUserArgs = z.infer; +declare function createUser(this: PloneClient, { data }: CreateUserArgs): Promise>; + +declare const updateUserArgsSchema: z.ZodObject<{ + id: z.ZodString; + data: z.ZodObject<{ + description: z.ZodOptional; + email: z.ZodOptional; + fullname: z.ZodOptional; + home_page: z.ZodOptional; + location: z.ZodOptional; + username: z.ZodOptional; + portrait: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + data: string; + 'content-type': string; + encoding: string; + filename: string; + scale?: boolean | undefined; + }, { + data: string; + 'content-type': string; + encoding: string; + filename: string; + scale?: boolean | undefined; + }>>; + }, "strip", z.ZodTypeAny, { + location?: string | undefined; + description?: string | undefined; + email?: string | undefined; + fullname?: string | undefined; + home_page?: string | undefined; + username?: string | undefined; + portrait?: { + data: string; + 'content-type': string; + encoding: string; + filename: string; + scale?: boolean | undefined; + } | undefined; + }, { + location?: string | undefined; + description?: string | undefined; + email?: string | undefined; + fullname?: string | undefined; + home_page?: string | undefined; + username?: string | undefined; + portrait?: { + data: string; + 'content-type': string; + encoding: string; + filename: string; + scale?: boolean | undefined; + } | undefined; + }>; +}, "strip", z.ZodTypeAny, { + data: { + location?: string | undefined; + description?: string | undefined; + email?: string | undefined; + fullname?: string | undefined; + home_page?: string | undefined; + username?: string | undefined; + portrait?: { + data: string; + 'content-type': string; + encoding: string; + filename: string; + scale?: boolean | undefined; + } | undefined; + }; + id: string; +}, { + data: { + location?: string | undefined; + description?: string | undefined; + email?: string | undefined; + fullname?: string | undefined; + home_page?: string | undefined; + username?: string | undefined; + portrait?: { + data: string; + 'content-type': string; + encoding: string; + filename: string; + scale?: boolean | undefined; + } | undefined; + }; + id: string; +}>; +type UpdateUserArgs = z.infer; +declare function updateUser(this: PloneClient, { id, data }: UpdateUserArgs): Promise>; + +declare const deleteUserArgsSchema: z.ZodObject<{ + id: z.ZodString; +}, "strip", z.ZodTypeAny, { + id: string; +}, { + id: string; +}>; +type DeleteUserArgs = z.infer; +declare function deleteUser(this: PloneClient, { id }: DeleteUserArgs): Promise>; + +declare const resetPasswordArgsSchema: z.ZodObject<{ + id: z.ZodString; +}, "strip", z.ZodTypeAny, { + id: string; +}, { + id: string; +}>; +type ResetUserArgs = z.infer; +declare function resetPassword(this: PloneClient, { id }: ResetUserArgs): Promise>; + +declare const resetPasswordWithTokenArgsSchema: z.ZodObject<{ + id: z.ZodString; + data: z.ZodObject<{ + reset_token: z.ZodString; + new_password: z.ZodString; + }, "strip", z.ZodTypeAny, { + reset_token: string; + new_password: string; + }, { + reset_token: string; + new_password: string; + }>; +}, "strip", z.ZodTypeAny, { + data: { + reset_token: string; + new_password: string; + }; + id: string; +}, { + data: { + reset_token: string; + new_password: string; + }; + id: string; +}>; +type ResetPasswordWithTokenUserArgs = z.infer; +declare function resetPasswordWithToken(this: PloneClient, { id, data }: ResetPasswordWithTokenUserArgs): Promise>; + +declare const updatePasswordArgsSchema: z.ZodObject<{ + id: z.ZodString; + data: z.ZodObject<{ + new_password: z.ZodString; + old_password: z.ZodString; + }, "strip", z.ZodTypeAny, { + new_password: string; + old_password: string; + }, { + new_password: string; + old_password: string; + }>; +}, "strip", z.ZodTypeAny, { + data: { + new_password: string; + old_password: string; + }; + id: string; +}, { + data: { + new_password: string; + old_password: string; + }; + id: string; +}>; +type UpdatePasswordArgs = z.infer; +declare function updatePassword(this: PloneClient, { id, data }: UpdatePasswordArgs): Promise>; + +declare function getUserschema(this: PloneClient): Promise>; + +declare function getVocabularies(this: PloneClient): Promise>; + +declare const getVocabularySchema: z.ZodObject<{ + path: z.ZodString; + title: z.ZodOptional; + token: z.ZodOptional; + tokens: z.ZodOptional>; +}, "strip", z.ZodTypeAny, { + path: string; + token?: string | undefined; + title?: string | undefined; + tokens?: string[] | undefined; +}, { + path: string; + token?: string | undefined; + title?: string | undefined; + tokens?: string[] | undefined; +}>; +type VocabulariesArgs = z.infer; +declare function getVocabulary(this: PloneClient, { path, title, token, tokens }: VocabulariesArgs): Promise>; + +declare const getWorkflowSchema: z.ZodObject<{ + path: z.ZodString; +}, "strip", z.ZodTypeAny, { + path: string; +}, { + path: string; +}>; +type WorkflowArgs = z.infer; +declare function getWorkflow(this: PloneClient, { path }: WorkflowArgs): Promise>; + +declare const createWorkflowArgsSchema: z.ZodObject<{ + path: z.ZodString; + data: z.ZodOptional; + effective: z.ZodOptional; + expires: z.ZodOptional; + include_children: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + effective?: string | undefined; + expires?: string | undefined; + comment?: string | undefined; + include_children?: boolean | undefined; + }, { + effective?: string | undefined; + expires?: string | undefined; + comment?: string | undefined; + include_children?: boolean | undefined; + }>>; +}, "strip", z.ZodTypeAny, { + path: string; + data?: { + effective?: string | undefined; + expires?: string | undefined; + comment?: string | undefined; + include_children?: boolean | undefined; + } | undefined; +}, { + path: string; + data?: { + effective?: string | undefined; + expires?: string | undefined; + comment?: string | undefined; + include_children?: boolean | undefined; + } | undefined; +}>; +type CreateWorkflowArgs = z.infer; +declare function createWorkflow(this: PloneClient, { path, data }: CreateWorkflowArgs): Promise>; + +declare const getWorkingcopySchema: z.ZodObject<{ + path: z.ZodString; +}, "strip", z.ZodTypeAny, { + path: string; +}, { + path: string; +}>; +type GetWorkingcopyArgs = z.infer; +declare function getWorkingcopy(this: PloneClient, { path }: GetWorkingcopyArgs): Promise>; + +declare const createWorkingcopyArgsSchema: z.ZodObject<{ + path: z.ZodString; +}, "strip", z.ZodTypeAny, { + path: string; +}, { + path: string; +}>; +type CreateWorkingcopyArgs = z.infer; +declare function createWorkingcopy(this: PloneClient, { path }: CreateWorkingcopyArgs): Promise>; + +declare const checkInWorkingcopyArgsSchema: z.ZodObject<{ + path: z.ZodString; +}, "strip", z.ZodTypeAny, { + path: string; +}, { + path: string; +}>; +type CheckInWorkingcopyArgs = z.infer; +declare function checkInWorkingcopy(this: PloneClient, { path }: CheckInWorkingcopyArgs): Promise>; + +declare const deleteWorkingcopyArgsSchema: z.ZodObject<{ + path: z.ZodString; +}, "strip", z.ZodTypeAny, { + path: string; +}, { + path: string; +}>; +type DeleteWorkingcopyArgs = z.infer; +declare function deleteWorkingcopy(this: PloneClient, { path }: DeleteWorkingcopyArgs): Promise>; + +declare const PloneClientConfigSchema: z.ZodObject<{ + apiPath: z.ZodString; + apiSuffix: z.ZodOptional; + token: z.ZodOptional; +}, "strip", z.ZodTypeAny, { + apiPath: string; + apiSuffix?: string | undefined; + token?: string | undefined; +}, { + apiPath: string; + apiSuffix?: string | undefined; + token?: string | undefined; +}>; +type PloneClientConfig = z.infer; + +declare class PloneClient { + config: PloneClientConfig; + static initialize: (config: PloneClientConfig) => InstanceType; + constructor(config: PloneClientConfig); + getActions: typeof getActions; + getAddons: typeof getAddons; + getAddon: typeof getAddon; + installAddon: typeof installAddon; + uninstallAddon: typeof uninstallAddon; + upgradeAddon: typeof upgradeAddon; + installAddonProfile: typeof installAddonProfile; + getAllAliases: typeof getAllAliases; + getAliases: typeof getAliases; + createAlias: typeof createAlias; + createAliases: typeof createAliases; + deleteAliases: typeof deleteAliases; + getBreadcrumbs: typeof getBreadcrumbs; + getComments: typeof getComments; + createComment: typeof createComment; + updateComment: typeof updateComment; + deleteComment: typeof deleteComment; + getContent: typeof getContent; + createContent: typeof createContent; + updateContent: typeof updateContent; + deleteContent: typeof deleteContent; + copyContent: typeof copyContent; + moveContent: typeof moveContent; + getContextNavigation: typeof getContextNavigation; + getControlpanels: typeof getControlpanels; + getControlpanel: typeof getControlpanel; + createControlpanel: typeof createControlpanel; + updateControlpanel: typeof updateControlpanel; + deleteControlpanel: typeof deleteControlpanel; + getDatabase: typeof getDatabase; + emailNotification: typeof emailNotification; + emailSend: typeof emailSend; + getGroups: typeof getGroups; + getGroup: typeof getGroup; + createGroup: typeof createGroup; + updateGroup: typeof updateGroup; + deleteGroup: typeof deleteGroup; + getHistory: typeof getHistory; + getHistoryVersion: typeof getHistoryVersion; + revertHistory: typeof revertHistory; + getLinkintegrity: typeof getLinkintegrity; + getLock: typeof getLock; + createLock: typeof createLock; + updateLock: typeof updateLock; + deleteLock: typeof deleteLock; + login: typeof login; + getNavigation: typeof getNavigation; + getNavroot: typeof getNavroot; + getPrincipals: typeof getPrincipals; + getQuerysources: typeof getQuerysources; + getQuerystring: typeof getQuerystring; + querystringSearch: typeof querystringSearch; + getRegistry: typeof getRegistry; + getRegistryRecord: typeof getRegistryRecord; + updateRegistry: typeof updateRegistry; + getAllRelations: typeof getAllRelations; + getRelations: typeof getRelations; + createRelations: typeof createRelations; + fixRelations: typeof fixRelations; + deleteRelations: typeof deleteRelations; + getRoles: typeof getRoles; + getRules: typeof getRules; + createRule: typeof createRule; + updateRules: typeof updateRules; + deleteRules: typeof deleteRules; + search: typeof search; + getSite: typeof getSite; + getSource: typeof getSource; + getSystem: typeof getSystem; + getTransactions: typeof getTransactions; + revertTransactions: typeof revertTransactions; + getTranslation: typeof getTranslation; + linkTranslation: typeof linkTranslation; + unlinkTranslation: typeof unlinkTranslation; + getTypes: typeof getTypes; + getType: typeof getType; + getTypeField: typeof getTypeField; + createTypeField: typeof createTypeField; + updateTypeField: typeof updateTypeField; + getUpgrade: typeof getUpgrade; + runUpgrade: typeof runUpgrade; + getUsers: typeof getUsers; + getUser: typeof getUser; + createUser: typeof createUser; + updateUser: typeof updateUser; + deleteUser: typeof deleteUser; + resetPassword: typeof resetPassword; + resetPasswordWithToken: typeof resetPasswordWithToken; + updatePassword: typeof updatePassword; + getUserschema: typeof getUserschema; + getVocabularies: typeof getVocabularies; + getVocabulary: typeof getVocabulary; + getWorkflow: typeof getWorkflow; + createWorkflow: typeof createWorkflow; + getWorkingcopy: typeof getWorkingcopy; + createWorkingcopy: typeof createWorkingcopy; + checkInWorkingcopy: typeof checkInWorkingcopy; + deleteWorkingcopy: typeof deleteWorkingcopy; +} + +export { PloneClient as default }; diff --git a/packages/client/dist/index.d.ts b/packages/client/dist/index.d.ts new file mode 100644 index 00000000000..6d575324982 --- /dev/null +++ b/packages/client/dist/index.d.ts @@ -0,0 +1,3013 @@ +import { ActionsResponse, Addons, GetAddonResponse, GetAllAliasesResponse, GetAliasesResponse, BreadcrumbsResponse, GetCommentsResponse, Content, CreateContentResponse, UpdateContentResponse, CopyMoveContentResponse, ContextNavigationResponse, GetControlpanelsResponse, GetControlpanelResponse, DatabaseResponse, GetGroupsResponse, GetGroupResponse, CreateGroupResponse, GetHistoryResponse, LockInfo, CreateLockResponse, Login, NavigationResponse, GetNavrootResponse, GetPrincipalsResponse, GetQuerysourcesResponse, GetQuerystringResponse, QuerystringSearchResponse, GetRegistryResponse, GetAllRelationsResponse, GetRelationsResponse, GetRolesResponse, GetRulesResponse, RuleRespose, SearchResponse, GetSiteResponse, GetSourceResponse, GetSystemResponse, GetTransactionsResponse, RevertTransactionsResponse, GetTranslationResponse, GetTypesResponse, GetTypeResponse, GetTypeFieldResponse, CreateTypeFieldResponse, GetUpgradeResponse, RunUpgradeResponse, GetUsersResponse, User, GetUserschemaResponse, GetVocabulariesResponse, GetVocabularyResponse, WorkflowResponse, CreateWorkflowResponse, GetWorkingcopyResponse, CreateWorkingcopyResponse } from '@plone/types'; +import { z } from 'zod'; + +type RequestResponse = { + status: number; + data: T; +}; + +declare const getActionsSchema: z.ZodObject<{ + path: z.ZodString; +}, "strip", z.ZodTypeAny, { + path: string; +}, { + path: string; +}>; +type ActionsArgs = z.infer; +declare function getActions(this: PloneClient, { path }: ActionsArgs): Promise>; + +declare function getAddons(this: PloneClient): Promise>; + +declare const getAddonSchema: z.ZodObject<{ + id: z.ZodString; +}, "strip", z.ZodTypeAny, { + id: string; +}, { + id: string; +}>; +type AddonArgs = z.infer & {}; +declare function getAddon(this: PloneClient, { id }: AddonArgs): Promise>; + +declare const installAddonSchema: z.ZodObject<{ + id: z.ZodString; +}, "strip", z.ZodTypeAny, { + id: string; +}, { + id: string; +}>; +type InstallAddonArgs = z.infer; +declare function installAddon(this: PloneClient, { id }: InstallAddonArgs): Promise>; + +declare const uninstallAddonSchema: z.ZodObject<{ + id: z.ZodString; +}, "strip", z.ZodTypeAny, { + id: string; +}, { + id: string; +}>; +type UninstallAddonArgs = z.infer; +declare function uninstallAddon(this: PloneClient, { id }: UninstallAddonArgs): Promise>; + +declare const upgradeAddonSchema: z.ZodObject<{ + id: z.ZodString; +}, "strip", z.ZodTypeAny, { + id: string; +}, { + id: string; +}>; +type UpgradeAddonArgs = z.infer; +declare function upgradeAddon(this: PloneClient, { id }: UpgradeAddonArgs): Promise>; + +declare const installAddonProfileSchema: z.ZodObject<{ + id: z.ZodString; + profile: z.ZodString; +}, "strip", z.ZodTypeAny, { + id: string; + profile: string; +}, { + id: string; + profile: string; +}>; +type InstallAddonProfileArgs = z.infer; +declare function installAddonProfile(this: PloneClient, { id, profile }: InstallAddonProfileArgs): Promise>; + +declare function getAllAliases(this: PloneClient): Promise>; + +declare const getAliasesSchema: z.ZodObject<{ + path: z.ZodString; +}, "strip", z.ZodTypeAny, { + path: string; +}, { + path: string; +}>; +type AliasesArgs = z.infer; +declare function getAliases(this: PloneClient, { path }: AliasesArgs): Promise>; + +declare const createAliasArgsSchema: z.ZodObject<{ + path: z.ZodString; + data: z.ZodObject<{ + items: z.ZodArray, "many">; + }, "strip", z.ZodTypeAny, { + items: { + path: string; + }[]; + }, { + items: { + path: string; + }[]; + }>; +}, "strip", z.ZodTypeAny, { + path: string; + data: { + items: { + path: string; + }[]; + }; +}, { + path: string; + data: { + items: { + path: string; + }[]; + }; +}>; +type CreateAliasArgs = z.infer; +declare function createAlias(this: PloneClient, { path, data }: CreateAliasArgs): Promise>; + +declare const createAliasesArgsSchema: z.ZodObject<{ + data: z.ZodObject<{ + items: z.ZodArray; + path: z.ZodString; + 'redirect-to': z.ZodString; + }, "strip", z.ZodTypeAny, { + path: string; + 'redirect-to': string; + datetime?: string | undefined; + }, { + path: string; + 'redirect-to': string; + datetime?: string | undefined; + }>, "many">; + }, "strip", z.ZodTypeAny, { + items: { + path: string; + 'redirect-to': string; + datetime?: string | undefined; + }[]; + }, { + items: { + path: string; + 'redirect-to': string; + datetime?: string | undefined; + }[]; + }>; +}, "strip", z.ZodTypeAny, { + data: { + items: { + path: string; + 'redirect-to': string; + datetime?: string | undefined; + }[]; + }; +}, { + data: { + items: { + path: string; + 'redirect-to': string; + datetime?: string | undefined; + }[]; + }; +}>; +type CreateAliasesArgs = z.infer; +declare function createAliases(this: PloneClient, { data }: CreateAliasesArgs): Promise>; + +declare const deleteAliasesArgsSchema: z.ZodObject<{ + path: z.ZodString; + data: z.ZodObject<{ + items: z.ZodArray, "many">; + }, "strip", z.ZodTypeAny, { + items: { + path: string; + }[]; + }, { + items: { + path: string; + }[]; + }>; +}, "strip", z.ZodTypeAny, { + path: string; + data: { + items: { + path: string; + }[]; + }; +}, { + path: string; + data: { + items: { + path: string; + }[]; + }; +}>; +type DeleteAliasesArgs = z.infer; +declare function deleteAliases(this: PloneClient, { path, data }: DeleteAliasesArgs): Promise>; + +declare const getBreadcrumbsSchema: z.ZodObject<{ + path: z.ZodString; +}, "strip", z.ZodTypeAny, { + path: string; +}, { + path: string; +}>; +type BreadcrumbsArgs = z.infer; +declare function getBreadcrumbs(this: PloneClient, { path }: BreadcrumbsArgs): Promise>; + +declare const getCommentsSchema: z.ZodObject<{ + path: z.ZodString; +}, "strip", z.ZodTypeAny, { + path: string; +}, { + path: string; +}>; +type CommentsArgs = z.infer; +declare function getComments(this: PloneClient, { path }: CommentsArgs): Promise>; + +declare const createCommentArgsSchema: z.ZodObject<{ + path: z.ZodString; + in_reply_to: z.ZodOptional; + data: z.ZodObject<{ + text: z.ZodString; + }, "strip", z.ZodTypeAny, { + text: string; + }, { + text: string; + }>; +}, "strip", z.ZodTypeAny, { + path: string; + data: { + text: string; + }; + in_reply_to?: string | undefined; +}, { + path: string; + data: { + text: string; + }; + in_reply_to?: string | undefined; +}>; +type CreateCommentArgs = z.infer; +declare function createComment(this: PloneClient, { path, in_reply_to, data }: CreateCommentArgs): Promise>; + +declare const updateCommentArgsSchema: z.ZodObject<{ + path: z.ZodString; + comment_id: z.ZodString; + data: z.ZodObject<{ + text: z.ZodString; + }, "strip", z.ZodTypeAny, { + text: string; + }, { + text: string; + }>; +}, "strip", z.ZodTypeAny, { + path: string; + data: { + text: string; + }; + comment_id: string; +}, { + path: string; + data: { + text: string; + }; + comment_id: string; +}>; +type UpdateCommentArgs = z.infer; +declare function updateComment(this: PloneClient, { path, comment_id, data }: UpdateCommentArgs): Promise>; + +declare const deleteCommentArgsSchema: z.ZodObject<{ + path: z.ZodString; + comment_id: z.ZodString; +}, "strip", z.ZodTypeAny, { + path: string; + comment_id: string; +}, { + path: string; + comment_id: string; +}>; +type DeleteCommentArgs = z.infer; +declare function deleteComment(this: PloneClient, { path, comment_id }: DeleteCommentArgs): Promise>; + +declare const getContentArgsSchema: z.ZodObject<{ + path: z.ZodString; + version: z.ZodOptional; + page: z.ZodOptional; + fullObjects: z.ZodOptional; + expand: z.ZodOptional>; +}, "strip", z.ZodTypeAny, { + path: string; + version?: string | undefined; + page?: number | undefined; + fullObjects?: boolean | undefined; + expand?: string[] | undefined; +}, { + path: string; + version?: string | undefined; + page?: number | undefined; + fullObjects?: boolean | undefined; + expand?: string[] | undefined; +}>; +type GetContentArgs = z.infer; +declare function getContent(this: PloneClient, { path, version, page, fullObjects, expand }: GetContentArgs): Promise>; + +declare const createContentArgsSchema: z.ZodObject<{ + path: z.ZodString; + data: z.ZodObject<{ + '@id': z.ZodOptional; + '@static_behaviors': z.ZodOptional; + '@type': z.ZodString; + allow_discussion: z.ZodOptional; + blocks: z.ZodOptional; + blocks_layout: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + items: string[]; + }, { + items: string[]; + }>>; + contributors: z.ZodOptional>; + creators: z.ZodOptional>; + description: z.ZodOptional; + effective: z.ZodOptional>; + exclude_from_nav: z.ZodOptional; + expires: z.ZodOptional>; + file: z.ZodOptional>; + id: z.ZodOptional; + image: z.ZodOptional>; + language: z.ZodOptional; + preview_caption: z.ZodOptional; + preview_image: z.ZodOptional>; + relatedItems: z.ZodOptional; + id: z.ZodOptional; + "@id": z.ZodString; + "@type": z.ZodOptional; + CreationDate: z.ZodOptional; + Creator: z.ZodOptional; + Date: z.ZodOptional; + Description: z.ZodOptional; + EffectiveDate: z.ZodOptional; + ExpirationDate: z.ZodOptional; + ModificationDate: z.ZodOptional; + Subject: z.ZodOptional>; + Title: z.ZodOptional; + Type: z.ZodOptional; + UID: z.ZodOptional; + author_name: z.ZodOptional; + cmf_uid: z.ZodOptional; + commentators: z.ZodOptional>; + created: z.ZodOptional; + description: z.ZodOptional; + effective: z.ZodOptional; + end: z.ZodOptional; + exclude_from_nav: z.ZodOptional; + expires: z.ZodOptional; + getIcon: z.ZodOptional; + getId: z.ZodOptional; + getObjSize: z.ZodOptional; + getPath: z.ZodOptional; + getRemoteUrl: z.ZodOptional; + getURL: z.ZodOptional; + hasPreviewImage: z.ZodOptional; + head_title: z.ZodOptional; + image_field: z.ZodOptional>; + image_scales: z.ZodOptional; + in_response_to: z.ZodOptional; + is_folderish: z.ZodOptional; + last_comment_date: z.ZodOptional; + listCreators: z.ZodOptional>; + mime_type: z.ZodOptional; + modified: z.ZodOptional; + nav_title: z.ZodOptional; + portal_type: z.ZodOptional; + review_state: z.ZodOptional; + start: z.ZodOptional; + sync_uid: z.ZodOptional; + title: z.ZodString; + total_comments: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + "@id": string; + title: string; + location?: unknown; + id?: string | undefined; + "@type"?: string | undefined; + CreationDate?: string | undefined; + Creator?: string | undefined; + Date?: string | undefined; + Description?: string | undefined; + EffectiveDate?: unknown; + ExpirationDate?: unknown; + ModificationDate?: string | undefined; + Subject?: unknown[] | undefined; + Title?: string | undefined; + Type?: string | undefined; + UID?: string | undefined; + author_name?: unknown; + cmf_uid?: unknown; + commentators?: unknown[] | undefined; + created?: string | undefined; + description?: string | undefined; + effective?: string | undefined; + end?: unknown; + exclude_from_nav?: boolean | undefined; + expires?: string | undefined; + getIcon?: unknown; + getId?: string | undefined; + getObjSize?: string | undefined; + getPath?: string | undefined; + getRemoteUrl?: unknown; + getURL?: string | undefined; + hasPreviewImage?: unknown; + head_title?: unknown; + image_field?: string | null | undefined; + image_scales?: unknown; + in_response_to?: unknown; + is_folderish?: boolean | undefined; + last_comment_date?: unknown; + listCreators?: string[] | undefined; + mime_type?: string | undefined; + modified?: string | undefined; + nav_title?: unknown; + portal_type?: string | undefined; + review_state?: string | undefined; + start?: unknown; + sync_uid?: unknown; + total_comments?: number | undefined; + }, { + "@id": string; + title: string; + location?: unknown; + id?: string | undefined; + "@type"?: string | undefined; + CreationDate?: string | undefined; + Creator?: string | undefined; + Date?: string | undefined; + Description?: string | undefined; + EffectiveDate?: unknown; + ExpirationDate?: unknown; + ModificationDate?: string | undefined; + Subject?: unknown[] | undefined; + Title?: string | undefined; + Type?: string | undefined; + UID?: string | undefined; + author_name?: unknown; + cmf_uid?: unknown; + commentators?: unknown[] | undefined; + created?: string | undefined; + description?: string | undefined; + effective?: string | undefined; + end?: unknown; + exclude_from_nav?: boolean | undefined; + expires?: string | undefined; + getIcon?: unknown; + getId?: string | undefined; + getObjSize?: string | undefined; + getPath?: string | undefined; + getRemoteUrl?: unknown; + getURL?: string | undefined; + hasPreviewImage?: unknown; + head_title?: unknown; + image_field?: string | null | undefined; + image_scales?: unknown; + in_response_to?: unknown; + is_folderish?: boolean | undefined; + last_comment_date?: unknown; + listCreators?: string[] | undefined; + mime_type?: string | undefined; + modified?: string | undefined; + nav_title?: unknown; + portal_type?: string | undefined; + review_state?: string | undefined; + start?: unknown; + sync_uid?: unknown; + total_comments?: number | undefined; + }>, "many">>; + rights: z.ZodOptional>; + title: z.ZodString; + versioning_enabled: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + '@type': string; + title: string; + id?: string | undefined; + '@id'?: string | undefined; + description?: string | undefined; + effective?: string | null | undefined; + exclude_from_nav?: boolean | undefined; + expires?: string | null | undefined; + '@static_behaviors'?: unknown; + allow_discussion?: boolean | undefined; + blocks?: unknown; + blocks_layout?: { + items: string[]; + } | undefined; + contributors?: string[] | undefined; + creators?: string[] | undefined; + file?: { + data: string; + 'content-type': string; + encoding: string; + filename: string; + } | undefined; + image?: { + data: string; + 'content-type': string; + encoding: string; + filename: string; + } | undefined; + language?: string | undefined; + preview_caption?: string | undefined; + preview_image?: { + data: string; + 'content-type': string; + encoding: string; + filename: string; + } | undefined; + relatedItems?: { + "@id": string; + title: string; + location?: unknown; + id?: string | undefined; + "@type"?: string | undefined; + CreationDate?: string | undefined; + Creator?: string | undefined; + Date?: string | undefined; + Description?: string | undefined; + EffectiveDate?: unknown; + ExpirationDate?: unknown; + ModificationDate?: string | undefined; + Subject?: unknown[] | undefined; + Title?: string | undefined; + Type?: string | undefined; + UID?: string | undefined; + author_name?: unknown; + cmf_uid?: unknown; + commentators?: unknown[] | undefined; + created?: string | undefined; + description?: string | undefined; + effective?: string | undefined; + end?: unknown; + exclude_from_nav?: boolean | undefined; + expires?: string | undefined; + getIcon?: unknown; + getId?: string | undefined; + getObjSize?: string | undefined; + getPath?: string | undefined; + getRemoteUrl?: unknown; + getURL?: string | undefined; + hasPreviewImage?: unknown; + head_title?: unknown; + image_field?: string | null | undefined; + image_scales?: unknown; + in_response_to?: unknown; + is_folderish?: boolean | undefined; + last_comment_date?: unknown; + listCreators?: string[] | undefined; + mime_type?: string | undefined; + modified?: string | undefined; + nav_title?: unknown; + portal_type?: string | undefined; + review_state?: string | undefined; + start?: unknown; + sync_uid?: unknown; + total_comments?: number | undefined; + }[] | undefined; + rights?: string | null | undefined; + versioning_enabled?: boolean | undefined; + }, { + '@type': string; + title: string; + id?: string | undefined; + '@id'?: string | undefined; + description?: string | undefined; + effective?: string | null | undefined; + exclude_from_nav?: boolean | undefined; + expires?: string | null | undefined; + '@static_behaviors'?: unknown; + allow_discussion?: boolean | undefined; + blocks?: unknown; + blocks_layout?: { + items: string[]; + } | undefined; + contributors?: string[] | undefined; + creators?: string[] | undefined; + file?: { + data: string; + 'content-type': string; + encoding: string; + filename: string; + } | undefined; + image?: { + data: string; + 'content-type': string; + encoding: string; + filename: string; + } | undefined; + language?: string | undefined; + preview_caption?: string | undefined; + preview_image?: { + data: string; + 'content-type': string; + encoding: string; + filename: string; + } | undefined; + relatedItems?: { + "@id": string; + title: string; + location?: unknown; + id?: string | undefined; + "@type"?: string | undefined; + CreationDate?: string | undefined; + Creator?: string | undefined; + Date?: string | undefined; + Description?: string | undefined; + EffectiveDate?: unknown; + ExpirationDate?: unknown; + ModificationDate?: string | undefined; + Subject?: unknown[] | undefined; + Title?: string | undefined; + Type?: string | undefined; + UID?: string | undefined; + author_name?: unknown; + cmf_uid?: unknown; + commentators?: unknown[] | undefined; + created?: string | undefined; + description?: string | undefined; + effective?: string | undefined; + end?: unknown; + exclude_from_nav?: boolean | undefined; + expires?: string | undefined; + getIcon?: unknown; + getId?: string | undefined; + getObjSize?: string | undefined; + getPath?: string | undefined; + getRemoteUrl?: unknown; + getURL?: string | undefined; + hasPreviewImage?: unknown; + head_title?: unknown; + image_field?: string | null | undefined; + image_scales?: unknown; + in_response_to?: unknown; + is_folderish?: boolean | undefined; + last_comment_date?: unknown; + listCreators?: string[] | undefined; + mime_type?: string | undefined; + modified?: string | undefined; + nav_title?: unknown; + portal_type?: string | undefined; + review_state?: string | undefined; + start?: unknown; + sync_uid?: unknown; + total_comments?: number | undefined; + }[] | undefined; + rights?: string | null | undefined; + versioning_enabled?: boolean | undefined; + }>; +}, "strip", z.ZodTypeAny, { + path: string; + data: { + '@type': string; + title: string; + id?: string | undefined; + '@id'?: string | undefined; + description?: string | undefined; + effective?: string | null | undefined; + exclude_from_nav?: boolean | undefined; + expires?: string | null | undefined; + '@static_behaviors'?: unknown; + allow_discussion?: boolean | undefined; + blocks?: unknown; + blocks_layout?: { + items: string[]; + } | undefined; + contributors?: string[] | undefined; + creators?: string[] | undefined; + file?: { + data: string; + 'content-type': string; + encoding: string; + filename: string; + } | undefined; + image?: { + data: string; + 'content-type': string; + encoding: string; + filename: string; + } | undefined; + language?: string | undefined; + preview_caption?: string | undefined; + preview_image?: { + data: string; + 'content-type': string; + encoding: string; + filename: string; + } | undefined; + relatedItems?: { + "@id": string; + title: string; + location?: unknown; + id?: string | undefined; + "@type"?: string | undefined; + CreationDate?: string | undefined; + Creator?: string | undefined; + Date?: string | undefined; + Description?: string | undefined; + EffectiveDate?: unknown; + ExpirationDate?: unknown; + ModificationDate?: string | undefined; + Subject?: unknown[] | undefined; + Title?: string | undefined; + Type?: string | undefined; + UID?: string | undefined; + author_name?: unknown; + cmf_uid?: unknown; + commentators?: unknown[] | undefined; + created?: string | undefined; + description?: string | undefined; + effective?: string | undefined; + end?: unknown; + exclude_from_nav?: boolean | undefined; + expires?: string | undefined; + getIcon?: unknown; + getId?: string | undefined; + getObjSize?: string | undefined; + getPath?: string | undefined; + getRemoteUrl?: unknown; + getURL?: string | undefined; + hasPreviewImage?: unknown; + head_title?: unknown; + image_field?: string | null | undefined; + image_scales?: unknown; + in_response_to?: unknown; + is_folderish?: boolean | undefined; + last_comment_date?: unknown; + listCreators?: string[] | undefined; + mime_type?: string | undefined; + modified?: string | undefined; + nav_title?: unknown; + portal_type?: string | undefined; + review_state?: string | undefined; + start?: unknown; + sync_uid?: unknown; + total_comments?: number | undefined; + }[] | undefined; + rights?: string | null | undefined; + versioning_enabled?: boolean | undefined; + }; +}, { + path: string; + data: { + '@type': string; + title: string; + id?: string | undefined; + '@id'?: string | undefined; + description?: string | undefined; + effective?: string | null | undefined; + exclude_from_nav?: boolean | undefined; + expires?: string | null | undefined; + '@static_behaviors'?: unknown; + allow_discussion?: boolean | undefined; + blocks?: unknown; + blocks_layout?: { + items: string[]; + } | undefined; + contributors?: string[] | undefined; + creators?: string[] | undefined; + file?: { + data: string; + 'content-type': string; + encoding: string; + filename: string; + } | undefined; + image?: { + data: string; + 'content-type': string; + encoding: string; + filename: string; + } | undefined; + language?: string | undefined; + preview_caption?: string | undefined; + preview_image?: { + data: string; + 'content-type': string; + encoding: string; + filename: string; + } | undefined; + relatedItems?: { + "@id": string; + title: string; + location?: unknown; + id?: string | undefined; + "@type"?: string | undefined; + CreationDate?: string | undefined; + Creator?: string | undefined; + Date?: string | undefined; + Description?: string | undefined; + EffectiveDate?: unknown; + ExpirationDate?: unknown; + ModificationDate?: string | undefined; + Subject?: unknown[] | undefined; + Title?: string | undefined; + Type?: string | undefined; + UID?: string | undefined; + author_name?: unknown; + cmf_uid?: unknown; + commentators?: unknown[] | undefined; + created?: string | undefined; + description?: string | undefined; + effective?: string | undefined; + end?: unknown; + exclude_from_nav?: boolean | undefined; + expires?: string | undefined; + getIcon?: unknown; + getId?: string | undefined; + getObjSize?: string | undefined; + getPath?: string | undefined; + getRemoteUrl?: unknown; + getURL?: string | undefined; + hasPreviewImage?: unknown; + head_title?: unknown; + image_field?: string | null | undefined; + image_scales?: unknown; + in_response_to?: unknown; + is_folderish?: boolean | undefined; + last_comment_date?: unknown; + listCreators?: string[] | undefined; + mime_type?: string | undefined; + modified?: string | undefined; + nav_title?: unknown; + portal_type?: string | undefined; + review_state?: string | undefined; + start?: unknown; + sync_uid?: unknown; + total_comments?: number | undefined; + }[] | undefined; + rights?: string | null | undefined; + versioning_enabled?: boolean | undefined; + }; +}>; +type CreateContentArgs = z.infer; +declare function createContent(this: PloneClient, { path, data }: CreateContentArgs): Promise>; + +declare const updateContentArgsSchema: z.ZodObject<{ + path: z.ZodString; + data: z.ZodObject<{ + allow_discussion: z.ZodOptional>; + blocks: z.ZodOptional>; + blocks_layout: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + items: string[]; + }, { + items: string[]; + }>>>; + contributors: z.ZodOptional>>; + creators: z.ZodOptional>>; + description: z.ZodOptional>; + effective: z.ZodOptional>>; + exclude_from_nav: z.ZodOptional>; + expires: z.ZodOptional>>; + id: z.ZodOptional>>; + ordering: z.ZodOptional, z.ZodLiteral<"top">]>; + subset_ids: z.ZodOptional>; + }, "strip", z.ZodTypeAny, { + obj_id: string; + delta: number | "bottom" | "top"; + subset_ids?: string[] | undefined; + }, { + obj_id: string; + delta: number | "bottom" | "top"; + subset_ids?: string[] | undefined; + }>>>; + preview_caption: z.ZodOptional>>; + preview_image: z.ZodOptional>>>; + relatedItems: z.ZodOptional; + id: z.ZodOptional; + "@id": z.ZodString; + "@type": z.ZodOptional; + CreationDate: z.ZodOptional; + Creator: z.ZodOptional; + Date: z.ZodOptional; + Description: z.ZodOptional; + EffectiveDate: z.ZodOptional; + ExpirationDate: z.ZodOptional; + ModificationDate: z.ZodOptional; + Subject: z.ZodOptional>; + Title: z.ZodOptional; + Type: z.ZodOptional; + UID: z.ZodOptional; + author_name: z.ZodOptional; + cmf_uid: z.ZodOptional; + commentators: z.ZodOptional>; + created: z.ZodOptional; + description: z.ZodOptional; + effective: z.ZodOptional; + end: z.ZodOptional; + exclude_from_nav: z.ZodOptional; + expires: z.ZodOptional; + getIcon: z.ZodOptional; + getId: z.ZodOptional; + getObjSize: z.ZodOptional; + getPath: z.ZodOptional; + getRemoteUrl: z.ZodOptional; + getURL: z.ZodOptional; + hasPreviewImage: z.ZodOptional; + head_title: z.ZodOptional; + image_field: z.ZodOptional>; + image_scales: z.ZodOptional; + in_response_to: z.ZodOptional; + is_folderish: z.ZodOptional; + last_comment_date: z.ZodOptional; + listCreators: z.ZodOptional>; + mime_type: z.ZodOptional; + modified: z.ZodOptional; + nav_title: z.ZodOptional; + portal_type: z.ZodOptional; + review_state: z.ZodOptional; + start: z.ZodOptional; + sync_uid: z.ZodOptional; + title: z.ZodString; + total_comments: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + "@id": string; + title: string; + location?: unknown; + id?: string | undefined; + "@type"?: string | undefined; + CreationDate?: string | undefined; + Creator?: string | undefined; + Date?: string | undefined; + Description?: string | undefined; + EffectiveDate?: unknown; + ExpirationDate?: unknown; + ModificationDate?: string | undefined; + Subject?: unknown[] | undefined; + Title?: string | undefined; + Type?: string | undefined; + UID?: string | undefined; + author_name?: unknown; + cmf_uid?: unknown; + commentators?: unknown[] | undefined; + created?: string | undefined; + description?: string | undefined; + effective?: string | undefined; + end?: unknown; + exclude_from_nav?: boolean | undefined; + expires?: string | undefined; + getIcon?: unknown; + getId?: string | undefined; + getObjSize?: string | undefined; + getPath?: string | undefined; + getRemoteUrl?: unknown; + getURL?: string | undefined; + hasPreviewImage?: unknown; + head_title?: unknown; + image_field?: string | null | undefined; + image_scales?: unknown; + in_response_to?: unknown; + is_folderish?: boolean | undefined; + last_comment_date?: unknown; + listCreators?: string[] | undefined; + mime_type?: string | undefined; + modified?: string | undefined; + nav_title?: unknown; + portal_type?: string | undefined; + review_state?: string | undefined; + start?: unknown; + sync_uid?: unknown; + total_comments?: number | undefined; + }, { + "@id": string; + title: string; + location?: unknown; + id?: string | undefined; + "@type"?: string | undefined; + CreationDate?: string | undefined; + Creator?: string | undefined; + Date?: string | undefined; + Description?: string | undefined; + EffectiveDate?: unknown; + ExpirationDate?: unknown; + ModificationDate?: string | undefined; + Subject?: unknown[] | undefined; + Title?: string | undefined; + Type?: string | undefined; + UID?: string | undefined; + author_name?: unknown; + cmf_uid?: unknown; + commentators?: unknown[] | undefined; + created?: string | undefined; + description?: string | undefined; + effective?: string | undefined; + end?: unknown; + exclude_from_nav?: boolean | undefined; + expires?: string | undefined; + getIcon?: unknown; + getId?: string | undefined; + getObjSize?: string | undefined; + getPath?: string | undefined; + getRemoteUrl?: unknown; + getURL?: string | undefined; + hasPreviewImage?: unknown; + head_title?: unknown; + image_field?: string | null | undefined; + image_scales?: unknown; + in_response_to?: unknown; + is_folderish?: boolean | undefined; + last_comment_date?: unknown; + listCreators?: string[] | undefined; + mime_type?: string | undefined; + modified?: string | undefined; + nav_title?: unknown; + portal_type?: string | undefined; + review_state?: string | undefined; + start?: unknown; + sync_uid?: unknown; + total_comments?: number | undefined; + }>, "many">>>; + rights: z.ZodOptional>>; + table_of_contents: z.ZodOptional>>; + title: z.ZodOptional>; + versioning_enabled: z.ZodOptional>; + }, "strip", z.ZodTypeAny, { + id?: string | null | undefined; + description?: string | undefined; + effective?: string | null | undefined; + exclude_from_nav?: boolean | undefined; + expires?: string | null | undefined; + title?: string | undefined; + allow_discussion?: boolean | undefined; + blocks?: unknown; + blocks_layout?: { + items: string[]; + } | undefined; + contributors?: string[] | undefined; + creators?: string[] | undefined; + preview_caption?: string | null | undefined; + preview_image?: { + data: string; + 'content-type': string; + encoding: string; + filename: string; + } | null | undefined; + relatedItems?: { + "@id": string; + title: string; + location?: unknown; + id?: string | undefined; + "@type"?: string | undefined; + CreationDate?: string | undefined; + Creator?: string | undefined; + Date?: string | undefined; + Description?: string | undefined; + EffectiveDate?: unknown; + ExpirationDate?: unknown; + ModificationDate?: string | undefined; + Subject?: unknown[] | undefined; + Title?: string | undefined; + Type?: string | undefined; + UID?: string | undefined; + author_name?: unknown; + cmf_uid?: unknown; + commentators?: unknown[] | undefined; + created?: string | undefined; + description?: string | undefined; + effective?: string | undefined; + end?: unknown; + exclude_from_nav?: boolean | undefined; + expires?: string | undefined; + getIcon?: unknown; + getId?: string | undefined; + getObjSize?: string | undefined; + getPath?: string | undefined; + getRemoteUrl?: unknown; + getURL?: string | undefined; + hasPreviewImage?: unknown; + head_title?: unknown; + image_field?: string | null | undefined; + image_scales?: unknown; + in_response_to?: unknown; + is_folderish?: boolean | undefined; + last_comment_date?: unknown; + listCreators?: string[] | undefined; + mime_type?: string | undefined; + modified?: string | undefined; + nav_title?: unknown; + portal_type?: string | undefined; + review_state?: string | undefined; + start?: unknown; + sync_uid?: unknown; + total_comments?: number | undefined; + }[] | undefined; + rights?: string | null | undefined; + versioning_enabled?: boolean | undefined; + ordering?: { + obj_id: string; + delta: number | "bottom" | "top"; + subset_ids?: string[] | undefined; + } | undefined; + table_of_contents?: boolean | null | undefined; + }, { + id?: string | null | undefined; + description?: string | undefined; + effective?: string | null | undefined; + exclude_from_nav?: boolean | undefined; + expires?: string | null | undefined; + title?: string | undefined; + allow_discussion?: boolean | undefined; + blocks?: unknown; + blocks_layout?: { + items: string[]; + } | undefined; + contributors?: string[] | undefined; + creators?: string[] | undefined; + preview_caption?: string | null | undefined; + preview_image?: { + data: string; + 'content-type': string; + encoding: string; + filename: string; + } | null | undefined; + relatedItems?: { + "@id": string; + title: string; + location?: unknown; + id?: string | undefined; + "@type"?: string | undefined; + CreationDate?: string | undefined; + Creator?: string | undefined; + Date?: string | undefined; + Description?: string | undefined; + EffectiveDate?: unknown; + ExpirationDate?: unknown; + ModificationDate?: string | undefined; + Subject?: unknown[] | undefined; + Title?: string | undefined; + Type?: string | undefined; + UID?: string | undefined; + author_name?: unknown; + cmf_uid?: unknown; + commentators?: unknown[] | undefined; + created?: string | undefined; + description?: string | undefined; + effective?: string | undefined; + end?: unknown; + exclude_from_nav?: boolean | undefined; + expires?: string | undefined; + getIcon?: unknown; + getId?: string | undefined; + getObjSize?: string | undefined; + getPath?: string | undefined; + getRemoteUrl?: unknown; + getURL?: string | undefined; + hasPreviewImage?: unknown; + head_title?: unknown; + image_field?: string | null | undefined; + image_scales?: unknown; + in_response_to?: unknown; + is_folderish?: boolean | undefined; + last_comment_date?: unknown; + listCreators?: string[] | undefined; + mime_type?: string | undefined; + modified?: string | undefined; + nav_title?: unknown; + portal_type?: string | undefined; + review_state?: string | undefined; + start?: unknown; + sync_uid?: unknown; + total_comments?: number | undefined; + }[] | undefined; + rights?: string | null | undefined; + versioning_enabled?: boolean | undefined; + ordering?: { + obj_id: string; + delta: number | "bottom" | "top"; + subset_ids?: string[] | undefined; + } | undefined; + table_of_contents?: boolean | null | undefined; + }>; +}, "strip", z.ZodTypeAny, { + path: string; + data: { + id?: string | null | undefined; + description?: string | undefined; + effective?: string | null | undefined; + exclude_from_nav?: boolean | undefined; + expires?: string | null | undefined; + title?: string | undefined; + allow_discussion?: boolean | undefined; + blocks?: unknown; + blocks_layout?: { + items: string[]; + } | undefined; + contributors?: string[] | undefined; + creators?: string[] | undefined; + preview_caption?: string | null | undefined; + preview_image?: { + data: string; + 'content-type': string; + encoding: string; + filename: string; + } | null | undefined; + relatedItems?: { + "@id": string; + title: string; + location?: unknown; + id?: string | undefined; + "@type"?: string | undefined; + CreationDate?: string | undefined; + Creator?: string | undefined; + Date?: string | undefined; + Description?: string | undefined; + EffectiveDate?: unknown; + ExpirationDate?: unknown; + ModificationDate?: string | undefined; + Subject?: unknown[] | undefined; + Title?: string | undefined; + Type?: string | undefined; + UID?: string | undefined; + author_name?: unknown; + cmf_uid?: unknown; + commentators?: unknown[] | undefined; + created?: string | undefined; + description?: string | undefined; + effective?: string | undefined; + end?: unknown; + exclude_from_nav?: boolean | undefined; + expires?: string | undefined; + getIcon?: unknown; + getId?: string | undefined; + getObjSize?: string | undefined; + getPath?: string | undefined; + getRemoteUrl?: unknown; + getURL?: string | undefined; + hasPreviewImage?: unknown; + head_title?: unknown; + image_field?: string | null | undefined; + image_scales?: unknown; + in_response_to?: unknown; + is_folderish?: boolean | undefined; + last_comment_date?: unknown; + listCreators?: string[] | undefined; + mime_type?: string | undefined; + modified?: string | undefined; + nav_title?: unknown; + portal_type?: string | undefined; + review_state?: string | undefined; + start?: unknown; + sync_uid?: unknown; + total_comments?: number | undefined; + }[] | undefined; + rights?: string | null | undefined; + versioning_enabled?: boolean | undefined; + ordering?: { + obj_id: string; + delta: number | "bottom" | "top"; + subset_ids?: string[] | undefined; + } | undefined; + table_of_contents?: boolean | null | undefined; + }; +}, { + path: string; + data: { + id?: string | null | undefined; + description?: string | undefined; + effective?: string | null | undefined; + exclude_from_nav?: boolean | undefined; + expires?: string | null | undefined; + title?: string | undefined; + allow_discussion?: boolean | undefined; + blocks?: unknown; + blocks_layout?: { + items: string[]; + } | undefined; + contributors?: string[] | undefined; + creators?: string[] | undefined; + preview_caption?: string | null | undefined; + preview_image?: { + data: string; + 'content-type': string; + encoding: string; + filename: string; + } | null | undefined; + relatedItems?: { + "@id": string; + title: string; + location?: unknown; + id?: string | undefined; + "@type"?: string | undefined; + CreationDate?: string | undefined; + Creator?: string | undefined; + Date?: string | undefined; + Description?: string | undefined; + EffectiveDate?: unknown; + ExpirationDate?: unknown; + ModificationDate?: string | undefined; + Subject?: unknown[] | undefined; + Title?: string | undefined; + Type?: string | undefined; + UID?: string | undefined; + author_name?: unknown; + cmf_uid?: unknown; + commentators?: unknown[] | undefined; + created?: string | undefined; + description?: string | undefined; + effective?: string | undefined; + end?: unknown; + exclude_from_nav?: boolean | undefined; + expires?: string | undefined; + getIcon?: unknown; + getId?: string | undefined; + getObjSize?: string | undefined; + getPath?: string | undefined; + getRemoteUrl?: unknown; + getURL?: string | undefined; + hasPreviewImage?: unknown; + head_title?: unknown; + image_field?: string | null | undefined; + image_scales?: unknown; + in_response_to?: unknown; + is_folderish?: boolean | undefined; + last_comment_date?: unknown; + listCreators?: string[] | undefined; + mime_type?: string | undefined; + modified?: string | undefined; + nav_title?: unknown; + portal_type?: string | undefined; + review_state?: string | undefined; + start?: unknown; + sync_uid?: unknown; + total_comments?: number | undefined; + }[] | undefined; + rights?: string | null | undefined; + versioning_enabled?: boolean | undefined; + ordering?: { + obj_id: string; + delta: number | "bottom" | "top"; + subset_ids?: string[] | undefined; + } | undefined; + table_of_contents?: boolean | null | undefined; + }; +}>; +type UpdateContentArgs = z.infer; +declare function updateContent(this: PloneClient, { path, data }: UpdateContentArgs): Promise>; + +declare const deleteContentArgsSchema: z.ZodObject<{ + path: z.ZodString; +}, "strip", z.ZodTypeAny, { + path: string; +}, { + path: string; +}>; +type DeleteContentArgs = z.infer; +declare function deleteContent(this: PloneClient, { path }: DeleteContentArgs): Promise>; + +declare const copyMoveContentDataSchema: z.ZodObject<{ + path: z.ZodString; + data: z.ZodObject<{ + source: z.ZodUnion<[z.ZodString, z.ZodArray]>; + }, "strip", z.ZodTypeAny, { + source: string | string[]; + }, { + source: string | string[]; + }>; +}, "strip", z.ZodTypeAny, { + path: string; + data: { + source: string | string[]; + }; +}, { + path: string; + data: { + source: string | string[]; + }; +}>; + +type CopyArgs = z.infer; +declare function copyContent(this: PloneClient, { path, data }: CopyArgs): Promise>; + +type MoveArgs = z.infer; +declare function moveContent(this: PloneClient, { path, data }: MoveArgs): Promise>; + +declare const getContextNavigationSchema: z.ZodObject<{ + path: z.ZodString; +}, "strip", z.ZodTypeAny, { + path: string; +}, { + path: string; +}>; +type ContextNavigationArgs = z.infer; +declare function getContextNavigation(this: PloneClient, { path }: ContextNavigationArgs): Promise>; + +declare function getControlpanels(this: PloneClient): Promise>; + +declare const getControlpanelSchema: z.ZodObject<{ + id: z.ZodString; +}, "strip", z.ZodTypeAny, { + id: string; +}, { + id: string; +}>; +type ControlpanelArgs = z.infer; +declare function getControlpanel(this: PloneClient, { id }: ControlpanelArgs): Promise>; + +declare const createControlpanelArgsSchema: z.ZodObject<{ + path: z.ZodString; + data: z.ZodAny; +}, "strip", z.ZodTypeAny, { + path: string; + data?: any; +}, { + path: string; + data?: any; +}>; +type CreateControlpanelArgs = z.infer; +declare function createControlpanel(this: PloneClient, { path, data }: CreateControlpanelArgs): Promise>; + +declare const updateControlpanelArgsSchema: z.ZodObject<{ + path: z.ZodString; + data: z.ZodAny; +}, "strip", z.ZodTypeAny, { + path: string; + data?: any; +}, { + path: string; + data?: any; +}>; +type UpdateControlpanelArgs = z.infer; +declare function updateControlpanel(this: PloneClient, { path, data }: UpdateControlpanelArgs): Promise>; + +declare const deleteControlpanelArgsSchema: z.ZodObject<{ + path: z.ZodString; + data: z.ZodAny; +}, "strip", z.ZodTypeAny, { + path: string; + data?: any; +}, { + path: string; + data?: any; +}>; +type DeleteControlpanelArgs = z.infer; +declare function deleteControlpanel(this: PloneClient, { path, data }: DeleteControlpanelArgs): Promise>; + +declare function getDatabase(this: PloneClient): Promise>; + +declare const emailNotificationArgsSchema: z.ZodObject<{ + user: z.ZodOptional; + data: z.ZodObject<{ + name: z.ZodString; + from: z.ZodString; + subject: z.ZodString; + message: z.ZodString; + }, "strip", z.ZodTypeAny, { + message: string; + name: string; + from: string; + subject: string; + }, { + message: string; + name: string; + from: string; + subject: string; + }>; +}, "strip", z.ZodTypeAny, { + data: { + message: string; + name: string; + from: string; + subject: string; + }; + user?: string | undefined; +}, { + data: { + message: string; + name: string; + from: string; + subject: string; + }; + user?: string | undefined; +}>; +type EmailNotificationArgs = z.infer; +declare function emailNotification(this: PloneClient, { user, data }: EmailNotificationArgs): Promise>; + +declare const emailSendArgsSchema: z.ZodObject<{ + data: z.ZodObject<{ + name: z.ZodString; + from: z.ZodString; + to: z.ZodString; + subject: z.ZodString; + message: z.ZodString; + }, "strip", z.ZodTypeAny, { + message: string; + name: string; + from: string; + subject: string; + to: string; + }, { + message: string; + name: string; + from: string; + subject: string; + to: string; + }>; +}, "strip", z.ZodTypeAny, { + data: { + message: string; + name: string; + from: string; + subject: string; + to: string; + }; +}, { + data: { + message: string; + name: string; + from: string; + subject: string; + to: string; + }; +}>; +type EmailSendArgs = z.infer; +declare function emailSend(this: PloneClient, { data }: EmailSendArgs): Promise>; + +declare function getGroups(this: PloneClient): Promise>; + +declare const getGroupSchema: z.ZodObject<{ + id: z.ZodString; +}, "strip", z.ZodTypeAny, { + id: string; +}, { + id: string; +}>; +type GroupArgs = z.infer; +declare function getGroup(this: PloneClient, { id }: GroupArgs): Promise>; + +declare const createGroupArgsSchema: z.ZodObject<{ + data: z.ZodObject<{ + description: z.ZodOptional; + email: z.ZodOptional; + groupname: z.ZodString; + groups: z.ZodOptional>; + roles: z.ZodOptional>; + title: z.ZodOptional; + users: z.ZodOptional>; + }, "strip", z.ZodTypeAny, { + groupname: string; + description?: string | undefined; + title?: string | undefined; + email?: string | undefined; + groups?: string[] | undefined; + roles?: string[] | undefined; + users?: string[] | undefined; + }, { + groupname: string; + description?: string | undefined; + title?: string | undefined; + email?: string | undefined; + groups?: string[] | undefined; + roles?: string[] | undefined; + users?: string[] | undefined; + }>; +}, "strip", z.ZodTypeAny, { + data: { + groupname: string; + description?: string | undefined; + title?: string | undefined; + email?: string | undefined; + groups?: string[] | undefined; + roles?: string[] | undefined; + users?: string[] | undefined; + }; +}, { + data: { + groupname: string; + description?: string | undefined; + title?: string | undefined; + email?: string | undefined; + groups?: string[] | undefined; + roles?: string[] | undefined; + users?: string[] | undefined; + }; +}>; +type CreateGroupArgs = z.infer; +declare function createGroup(this: PloneClient, { data }: CreateGroupArgs): Promise>; + +declare const updateGroupArgsSchema: z.ZodObject<{ + id: z.ZodString; + data: z.ZodObject<{ + description: z.ZodOptional; + email: z.ZodOptional; + title: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + description?: string | undefined; + title?: string | undefined; + email?: string | undefined; + }, { + description?: string | undefined; + title?: string | undefined; + email?: string | undefined; + }>; +}, "strip", z.ZodTypeAny, { + data: { + description?: string | undefined; + title?: string | undefined; + email?: string | undefined; + }; + id: string; +}, { + data: { + description?: string | undefined; + title?: string | undefined; + email?: string | undefined; + }; + id: string; +}>; +type UpdateGroupArgs = z.infer; +declare function updateGroup(this: PloneClient, { id, data }: UpdateGroupArgs): Promise>; + +declare const deleteGroupArgsSchema: z.ZodObject<{ + id: z.ZodString; +}, "strip", z.ZodTypeAny, { + id: string; +}, { + id: string; +}>; +type DeleteGroupArgs = z.infer; +declare function deleteGroup(this: PloneClient, { id }: DeleteGroupArgs): Promise>; + +declare const getHistorySchema: z.ZodObject<{ + path: z.ZodString; +}, "strip", z.ZodTypeAny, { + path: string; +}, { + path: string; +}>; +type HistoryArgs = z.infer & {}; +declare function getHistory(this: PloneClient, { path }: HistoryArgs): Promise>; + +declare const getHistoryVersionSchema: z.ZodObject<{ + path: z.ZodString; + version: z.ZodNumber; +}, "strip", z.ZodTypeAny, { + path: string; + version: number; +}, { + path: string; + version: number; +}>; +type HistoryVersionArgs = z.infer; +declare function getHistoryVersion(this: PloneClient, { path, version }: HistoryVersionArgs): Promise>; + +declare const revertHistoryArgsSchema: z.ZodObject<{ + path: z.ZodString; + data: z.ZodObject<{ + version: z.ZodNumber; + }, "strip", z.ZodTypeAny, { + version: number; + }, { + version: number; + }>; +}, "strip", z.ZodTypeAny, { + path: string; + data: { + version: number; + }; +}, { + path: string; + data: { + version: number; + }; +}>; +type ReverHistoryArgs = z.infer; +declare function revertHistory(this: PloneClient, { path, data }: ReverHistoryArgs): Promise>; + +declare const getLinkintegriyArgsSchema: z.ZodObject<{ + uids: z.ZodString; +}, "strip", z.ZodTypeAny, { + uids: string; +}, { + uids: string; +}>; +type GetLinkintegrityArgs = z.infer; +declare function getLinkintegrity(this: PloneClient, { uids }: GetLinkintegrityArgs): Promise>; + +declare const getLockSchema: z.ZodObject<{ + path: z.ZodString; +}, "strip", z.ZodTypeAny, { + path: string; +}, { + path: string; +}>; +type LockArgs = z.infer; +declare function getLock(this: PloneClient, { path }: LockArgs): Promise>; + +declare const createLockArgsSchema: z.ZodObject<{ + path: z.ZodString; + data: z.ZodObject<{ + stealable: z.ZodOptional; + timeout: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + stealable?: boolean | undefined; + timeout?: number | undefined; + }, { + stealable?: boolean | undefined; + timeout?: number | undefined; + }>; +}, "strip", z.ZodTypeAny, { + path: string; + data: { + stealable?: boolean | undefined; + timeout?: number | undefined; + }; +}, { + path: string; + data: { + stealable?: boolean | undefined; + timeout?: number | undefined; + }; +}>; +type CreateLockArgs = z.infer; +declare function createLock(this: PloneClient, { path, data }: CreateLockArgs): Promise>; + +declare const updateLockArgsSchema: z.ZodObject<{ + path: z.ZodString; + locktoken: z.ZodString; +}, "strip", z.ZodTypeAny, { + path: string; + locktoken: string; +}, { + path: string; + locktoken: string; +}>; +type UpdateLockArgs = z.infer; +declare function updateLock(this: PloneClient, { path, locktoken }: UpdateLockArgs): Promise>; + +declare const deleteLockArgsSchema: z.ZodObject<{ + path: z.ZodString; + data: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + force?: boolean | undefined; + }, { + force?: boolean | undefined; + }>>; +}, "strip", z.ZodTypeAny, { + path: string; + data?: { + force?: boolean | undefined; + } | undefined; +}, { + path: string; + data?: { + force?: boolean | undefined; + } | undefined; +}>; +type DeleteLockArgs = z.infer; +declare function deleteLock(this: PloneClient, { path, data }: DeleteLockArgs): Promise>; + +declare const loginArgsSchema: z.ZodObject<{ + data: z.ZodObject<{ + login: z.ZodString; + password: z.ZodString; + }, "strip", z.ZodTypeAny, { + login: string; + password: string; + }, { + login: string; + password: string; + }>; +}, "strip", z.ZodTypeAny, { + data: { + login: string; + password: string; + }; +}, { + data: { + login: string; + password: string; + }; +}>; +type LoginArgs = z.infer; +declare function login(this: PloneClient, { data }: LoginArgs): Promise>; + +declare const getNavigationSchema: z.ZodObject<{ + path: z.ZodString; + depth: z.ZodOptional; +}, "strip", z.ZodTypeAny, { + path: string; + depth?: number | undefined; +}, { + path: string; + depth?: number | undefined; +}>; +type NavigationArgs = z.infer; +declare function getNavigation(this: PloneClient, { path, depth }: NavigationArgs): Promise>; + +declare const getNavrootSchema: z.ZodObject<{ + path: z.ZodString; + language: z.ZodOptional; +}, "strip", z.ZodTypeAny, { + path: string; + language?: string | undefined; +}, { + path: string; + language?: string | undefined; +}>; +type NavrootArgs = z.infer; +declare function getNavroot(this: PloneClient, { path, language }: NavrootArgs): Promise>; + +declare const getPrincipalsSchema: z.ZodObject<{ + search: z.ZodString; +}, "strip", z.ZodTypeAny, { + search: string; +}, { + search: string; +}>; +type PrincipalsArgs = z.infer; +declare function getPrincipals(this: PloneClient, { search }: PrincipalsArgs): Promise>; + +declare const getQuerysourcesSchema: z.ZodObject<{ + path: z.ZodString; + field: z.ZodString; + query: z.ZodString; +}, "strip", z.ZodTypeAny, { + path: string; + field: string; + query: string; +}, { + path: string; + field: string; + query: string; +}>; +type QuerysourcesArgs = z.infer; +declare function getQuerysources(this: PloneClient, { path, field, query }: QuerysourcesArgs): Promise>; + +declare function getQuerystring(this: PloneClient): Promise>; + +declare const querystringSearchDataSchema: z.ZodObject<{ + b_start: z.ZodOptional; + b_size: z.ZodOptional; + limit: z.ZodOptional; + sort_on: z.ZodOptional; + sort_order: z.ZodOptional; + fullobjects: z.ZodOptional; + query: z.ZodArray]>; + }, "strip", z.ZodTypeAny, { + i: string; + o: string; + v: string | string[]; + }, { + i: string; + o: string; + v: string | string[]; + }>, "many">; + post: z.ZodOptional; +}, "strip", z.ZodTypeAny, { + query: { + i: string; + o: string; + v: string | string[]; + }[]; + post?: boolean | undefined; + b_start?: string | undefined; + b_size?: string | undefined; + limit?: string | undefined; + sort_on?: string | undefined; + sort_order?: string | undefined; + fullobjects?: boolean | undefined; +}, { + query: { + i: string; + o: string; + v: string | string[]; + }[]; + post?: boolean | undefined; + b_start?: string | undefined; + b_size?: string | undefined; + limit?: string | undefined; + sort_on?: string | undefined; + sort_order?: string | undefined; + fullobjects?: boolean | undefined; +}>; + +type QuerystringSearchArgs = z.infer; +declare function querystringSearch(this: PloneClient, { query, post }: QuerystringSearchArgs): Promise>; + +declare function getRegistry(this: PloneClient): Promise>; + +declare const getRegistryRecordSchema: z.ZodObject<{ + name: z.ZodString; +}, "strip", z.ZodTypeAny, { + name: string; +}, { + name: string; +}>; +type GetRegistryArgs = z.infer; +declare function getRegistryRecord(this: PloneClient, { name }: GetRegistryArgs): Promise>; + +declare const updateRegistryArgsSchema: z.ZodObject<{ + data: z.ZodRecord; +}, "strip", z.ZodTypeAny, { + data: Record; +}, { + data: Record; +}>; +type UpdateRegistryArgs = z.infer; +declare function updateRegistry(this: PloneClient, { data }: UpdateRegistryArgs): Promise>; + +declare function getAllRelations(this: PloneClient): Promise>; + +declare const getRelationsSchema: z.ZodEffects; + relation: z.ZodOptional; + onlyBroken: z.ZodOptional; +}, "strip", z.ZodTypeAny, { + source?: string | undefined; + relation?: string | undefined; + onlyBroken?: boolean | undefined; +}, { + source?: string | undefined; + relation?: string | undefined; + onlyBroken?: boolean | undefined; +}>, { + source?: string | undefined; + relation?: string | undefined; + onlyBroken?: boolean | undefined; +}, { + source?: string | undefined; + relation?: string | undefined; + onlyBroken?: boolean | undefined; +}>; +type RelationsArgs = z.infer; +declare function getRelations(this: PloneClient, { source, relation, onlyBroken }: RelationsArgs): Promise>; + +declare const createRelationsArgsSchema: z.ZodObject<{ + data: z.ZodObject<{ + items: z.ZodArray, "many">; + }, "strip", z.ZodTypeAny, { + items: { + source: string; + relation: string; + target: string; + }[]; + }, { + items: { + source: string; + relation: string; + target: string; + }[]; + }>; +}, "strip", z.ZodTypeAny, { + data: { + items: { + source: string; + relation: string; + target: string; + }[]; + }; +}, { + data: { + items: { + source: string; + relation: string; + target: string; + }[]; + }; +}>; +type CreateRelationsArgs = z.infer; +declare function createRelations(this: PloneClient, { data }: CreateRelationsArgs): Promise>; + +declare const fixRelationsArgsSchema: z.ZodObject<{ + data: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + flush?: number | undefined; + }, { + flush?: number | undefined; + }>>; +}, "strip", z.ZodTypeAny, { + data?: { + flush?: number | undefined; + } | undefined; +}, { + data?: { + flush?: number | undefined; + } | undefined; +}>; +type FixRelationsArgs = z.infer; +declare function fixRelations(this: PloneClient, { data }: FixRelationsArgs): Promise>; + +declare const deleteRelationsArgsSchema: z.ZodObject<{ + data: z.ZodObject<{ + items: z.ZodOptional, "many">>; + relation: z.ZodOptional; + source: z.ZodOptional; + target: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + items?: { + source: string; + relation: string; + target: string; + }[] | undefined; + source?: string | undefined; + relation?: string | undefined; + target?: string | undefined; + }, { + items?: { + source: string; + relation: string; + target: string; + }[] | undefined; + source?: string | undefined; + relation?: string | undefined; + target?: string | undefined; + }>; +}, "strip", z.ZodTypeAny, { + data: { + items?: { + source: string; + relation: string; + target: string; + }[] | undefined; + source?: string | undefined; + relation?: string | undefined; + target?: string | undefined; + }; +}, { + data: { + items?: { + source: string; + relation: string; + target: string; + }[] | undefined; + source?: string | undefined; + relation?: string | undefined; + target?: string | undefined; + }; +}>; +type DeleteRelationsArgs = z.infer; +declare function deleteRelations(this: PloneClient, { data }: DeleteRelationsArgs): Promise>; + +declare function getRoles(this: PloneClient): Promise>; + +declare function getRules(this: PloneClient): Promise>; + +declare const createRuleArgsSchema: z.ZodObject<{ + ruleId: z.ZodString; +}, "strip", z.ZodTypeAny, { + ruleId: string; +}, { + ruleId: string; +}>; +type CreateRuleArgs = z.infer; +declare function createRule(this: PloneClient, { ruleId }: CreateRuleArgs): Promise>; + +declare const updateRulesArgsSchema: z.ZodObject<{ + data: z.ZodObject<{ + 'form.button.Bubble': z.ZodOptional; + 'form.button.NoBubble': z.ZodOptional; + 'form.button.Enable': z.ZodOptional; + 'form.button.Disable': z.ZodOptional; + rules_ids: z.ZodOptional>; + operation: z.ZodOptional; + rule_id: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + 'form.button.Bubble'?: boolean | undefined; + 'form.button.NoBubble'?: boolean | undefined; + 'form.button.Enable'?: boolean | undefined; + 'form.button.Disable'?: boolean | undefined; + rules_ids?: string[] | undefined; + operation?: string | undefined; + rule_id?: string | undefined; + }, { + 'form.button.Bubble'?: boolean | undefined; + 'form.button.NoBubble'?: boolean | undefined; + 'form.button.Enable'?: boolean | undefined; + 'form.button.Disable'?: boolean | undefined; + rules_ids?: string[] | undefined; + operation?: string | undefined; + rule_id?: string | undefined; + }>; +}, "strip", z.ZodTypeAny, { + data: { + 'form.button.Bubble'?: boolean | undefined; + 'form.button.NoBubble'?: boolean | undefined; + 'form.button.Enable'?: boolean | undefined; + 'form.button.Disable'?: boolean | undefined; + rules_ids?: string[] | undefined; + operation?: string | undefined; + rule_id?: string | undefined; + }; +}, { + data: { + 'form.button.Bubble'?: boolean | undefined; + 'form.button.NoBubble'?: boolean | undefined; + 'form.button.Enable'?: boolean | undefined; + 'form.button.Disable'?: boolean | undefined; + rules_ids?: string[] | undefined; + operation?: string | undefined; + rule_id?: string | undefined; + }; +}>; +type UpdateRulesArgs = z.infer; +declare function updateRules(this: PloneClient, { data }: UpdateRulesArgs): Promise>; + +declare const deleteRulesArgsSchema: z.ZodObject<{ + data: z.ZodObject<{ + rules_ids: z.ZodArray; + }, "strip", z.ZodTypeAny, { + rules_ids: string[]; + }, { + rules_ids: string[]; + }>; +}, "strip", z.ZodTypeAny, { + data: { + rules_ids: string[]; + }; +}, { + data: { + rules_ids: string[]; + }; +}>; +type DeleteRulesArgs = z.infer; +declare function deleteRules(this: PloneClient, { data }: DeleteRulesArgs): Promise>; + +declare const searchSchema: z.ZodObject<{ + query: z.ZodIntersection]>; + depth: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + query: string | string[]; + depth?: number | undefined; + }, { + query: string | string[]; + depth?: number | undefined; + }>>; + sort_on: z.ZodOptional]>>; + SearchableText: z.ZodOptional; + metadata_fields: z.ZodOptional]>>; + fullobjects: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + path?: { + query: string | string[]; + depth?: number | undefined; + } | undefined; + sort_on?: string | string[] | undefined; + fullobjects?: number | undefined; + SearchableText?: string | undefined; + metadata_fields?: string | string[] | undefined; + }, { + path?: { + query: string | string[]; + depth?: number | undefined; + } | undefined; + sort_on?: string | string[] | undefined; + fullobjects?: number | undefined; + SearchableText?: string | undefined; + metadata_fields?: string | string[] | undefined; + }>, z.ZodRecord>; +}, "strip", z.ZodTypeAny, { + query: { + path?: { + query: string | string[]; + depth?: number | undefined; + } | undefined; + sort_on?: string | string[] | undefined; + fullobjects?: number | undefined; + SearchableText?: string | undefined; + metadata_fields?: string | string[] | undefined; + } & Record; +}, { + query: { + path?: { + query: string | string[]; + depth?: number | undefined; + } | undefined; + sort_on?: string | string[] | undefined; + fullobjects?: number | undefined; + SearchableText?: string | undefined; + metadata_fields?: string | string[] | undefined; + } & Record; +}>; + +type SearchArgs = z.infer; +declare function search(this: PloneClient, { query }: SearchArgs): Promise>; + +declare function getSite(this: PloneClient): Promise>; + +declare const getSourceSchema: z.ZodObject<{ + path: z.ZodString; + field: z.ZodString; +}, "strip", z.ZodTypeAny, { + path: string; + field: string; +}, { + path: string; + field: string; +}>; +type SourceArgs = z.infer; +declare function getSource(this: PloneClient, { path, field }: SourceArgs): Promise>; + +declare function getSystem(this: PloneClient): Promise>; + +declare function getTransactions(this: PloneClient): Promise>; + +declare const revertTransactionsArgsSchema: z.ZodObject<{ + data: z.ZodObject<{ + transaction_ids: z.ZodArray; + }, "strip", z.ZodTypeAny, { + transaction_ids: string[]; + }, { + transaction_ids: string[]; + }>; +}, "strip", z.ZodTypeAny, { + data: { + transaction_ids: string[]; + }; +}, { + data: { + transaction_ids: string[]; + }; +}>; +type RevertTransactionsArgs = z.infer; +declare function revertTransactions(this: PloneClient, { data }: RevertTransactionsArgs): Promise>; + +declare const getTranslationSchema: z.ZodObject<{ + path: z.ZodString; +}, "strip", z.ZodTypeAny, { + path: string; +}, { + path: string; +}>; +type TranslationArgs = z.infer; +declare function getTranslation(this: PloneClient, { path }: TranslationArgs): Promise>; + +declare const linkTranslationArgsSchema: z.ZodObject<{ + path: z.ZodString; + data: z.ZodObject<{ + id: z.ZodString; + }, "strip", z.ZodTypeAny, { + id: string; + }, { + id: string; + }>; +}, "strip", z.ZodTypeAny, { + path: string; + data: { + id: string; + }; +}, { + path: string; + data: { + id: string; + }; +}>; +type LinkTranslationArgs = z.infer; +declare function linkTranslation(this: PloneClient, { path, data }: LinkTranslationArgs): Promise>; + +declare const unlinkTranslationArgsSchema: z.ZodObject<{ + path: z.ZodString; + data: z.ZodObject<{ + language: z.ZodString; + }, "strip", z.ZodTypeAny, { + language: string; + }, { + language: string; + }>; +}, "strip", z.ZodTypeAny, { + path: string; + data: { + language: string; + }; +}, { + path: string; + data: { + language: string; + }; +}>; +type UnlinkTranslationArgs = z.infer; +declare function unlinkTranslation(this: PloneClient, { path, data }: UnlinkTranslationArgs): Promise>; + +declare function getTypes(this: PloneClient): Promise>; + +declare const getTypeSchema: z.ZodObject<{ + type: z.ZodString; +}, "strip", z.ZodTypeAny, { + type: string; +}, { + type: string; +}>; +type GetTypeArgs = z.infer; +declare function getType(this: PloneClient, { type }: GetTypeArgs): Promise>; + +declare const getTypeFieldSchema: z.ZodObject<{ + contentFieldPath: z.ZodString; +}, "strip", z.ZodTypeAny, { + contentFieldPath: string; +}, { + contentFieldPath: string; +}>; +type GetTypeFieldArgs = z.infer & {}; +declare function getTypeField(this: PloneClient, { contentFieldPath }: GetTypeFieldArgs): Promise>; + +declare const createTypeFieldArgsSchema: z.ZodObject<{ + contentPath: z.ZodString; + data: z.ZodObject<{ + description: z.ZodString; + factory: z.ZodString; + required: z.ZodOptional; + title: z.ZodString; + }, "strip", z.ZodTypeAny, { + description: string; + title: string; + factory: string; + required?: boolean | undefined; + }, { + description: string; + title: string; + factory: string; + required?: boolean | undefined; + }>; +}, "strip", z.ZodTypeAny, { + data: { + description: string; + title: string; + factory: string; + required?: boolean | undefined; + }; + contentPath: string; +}, { + data: { + description: string; + title: string; + factory: string; + required?: boolean | undefined; + }; + contentPath: string; +}>; +type CreateTypeFieldArgs = z.infer; +declare function createTypeField(this: PloneClient, { contentPath, data }: CreateTypeFieldArgs): Promise>; + +declare const updateTypeFieldArgsSchema: z.ZodObject<{ + contentPath: z.ZodString; + data: z.ZodObject<{ + description: z.ZodOptional; + maxLength: z.ZodOptional; + minLength: z.ZodOptional; + fields: z.ZodOptional>; + required: z.ZodOptional; + title: z.ZodOptional; + properties: z.ZodOptional; + fieldsets: z.ZodOptional>; + }, "strip", z.ZodTypeAny, { + description?: string | undefined; + title?: string | undefined; + required?: boolean | undefined; + maxLength?: number | undefined; + minLength?: number | undefined; + fields?: string[] | undefined; + properties?: any; + fieldsets?: any[] | undefined; + }, { + description?: string | undefined; + title?: string | undefined; + required?: boolean | undefined; + maxLength?: number | undefined; + minLength?: number | undefined; + fields?: string[] | undefined; + properties?: any; + fieldsets?: any[] | undefined; + }>; +}, "strip", z.ZodTypeAny, { + data: { + description?: string | undefined; + title?: string | undefined; + required?: boolean | undefined; + maxLength?: number | undefined; + minLength?: number | undefined; + fields?: string[] | undefined; + properties?: any; + fieldsets?: any[] | undefined; + }; + contentPath: string; +}, { + data: { + description?: string | undefined; + title?: string | undefined; + required?: boolean | undefined; + maxLength?: number | undefined; + minLength?: number | undefined; + fields?: string[] | undefined; + properties?: any; + fieldsets?: any[] | undefined; + }; + contentPath: string; +}>; +type UpdateTypeFieldArgs = z.infer; +declare function updateTypeField(this: PloneClient, { contentPath, data }: UpdateTypeFieldArgs): Promise>; + +declare function getUpgrade(this: PloneClient): Promise>; + +declare const runUpgradeArgsSchema: z.ZodObject<{ + data: z.ZodObject<{ + dry_run: z.ZodBoolean; + }, "strip", z.ZodTypeAny, { + dry_run: boolean; + }, { + dry_run: boolean; + }>; +}, "strip", z.ZodTypeAny, { + data: { + dry_run: boolean; + }; +}, { + data: { + dry_run: boolean; + }; +}>; +type RunUpgradeArgs = z.infer; +declare function runUpgrade(this: PloneClient, { data }: RunUpgradeArgs): Promise>; + +declare const getUsersSchema: z.ZodObject<{ + query: z.ZodOptional; + groupsFilter: z.ZodOptional>; + search: z.ZodOptional; + limit: z.ZodOptional; +}, "strip", z.ZodTypeAny, { + search?: string | undefined; + query?: string | undefined; + limit?: number | undefined; + groupsFilter?: string[] | undefined; +}, { + search?: string | undefined; + query?: string | undefined; + limit?: number | undefined; + groupsFilter?: string[] | undefined; +}>; +type GetUsersArgs = z.infer; +declare function getUsers(this: PloneClient, { query, groupsFilter, search, limit }: GetUsersArgs): Promise>; + +declare const getUserSchema: z.ZodObject<{ + id: z.ZodString; +}, "strip", z.ZodTypeAny, { + id: string; +}, { + id: string; +}>; +type UserArgs = z.infer; +declare function getUser(this: PloneClient, { id }: UserArgs): Promise>; + +declare const createUserArgsSchema: z.ZodObject<{ + data: z.ZodObject<{ + description: z.ZodOptional; + email: z.ZodString; + fullname: z.ZodOptional; + home_page: z.ZodOptional; + location: z.ZodOptional; + sendPasswordReset: z.ZodOptional; + username: z.ZodString; + roles: z.ZodOptional>; + password: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + email: string; + username: string; + location?: string | undefined; + description?: string | undefined; + roles?: string[] | undefined; + password?: string | undefined; + fullname?: string | undefined; + home_page?: string | undefined; + sendPasswordReset?: boolean | undefined; + }, { + email: string; + username: string; + location?: string | undefined; + description?: string | undefined; + roles?: string[] | undefined; + password?: string | undefined; + fullname?: string | undefined; + home_page?: string | undefined; + sendPasswordReset?: boolean | undefined; + }>; +}, "strip", z.ZodTypeAny, { + data: { + email: string; + username: string; + location?: string | undefined; + description?: string | undefined; + roles?: string[] | undefined; + password?: string | undefined; + fullname?: string | undefined; + home_page?: string | undefined; + sendPasswordReset?: boolean | undefined; + }; +}, { + data: { + email: string; + username: string; + location?: string | undefined; + description?: string | undefined; + roles?: string[] | undefined; + password?: string | undefined; + fullname?: string | undefined; + home_page?: string | undefined; + sendPasswordReset?: boolean | undefined; + }; +}>; +type CreateUserArgs = z.infer; +declare function createUser(this: PloneClient, { data }: CreateUserArgs): Promise>; + +declare const updateUserArgsSchema: z.ZodObject<{ + id: z.ZodString; + data: z.ZodObject<{ + description: z.ZodOptional; + email: z.ZodOptional; + fullname: z.ZodOptional; + home_page: z.ZodOptional; + location: z.ZodOptional; + username: z.ZodOptional; + portrait: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + data: string; + 'content-type': string; + encoding: string; + filename: string; + scale?: boolean | undefined; + }, { + data: string; + 'content-type': string; + encoding: string; + filename: string; + scale?: boolean | undefined; + }>>; + }, "strip", z.ZodTypeAny, { + location?: string | undefined; + description?: string | undefined; + email?: string | undefined; + fullname?: string | undefined; + home_page?: string | undefined; + username?: string | undefined; + portrait?: { + data: string; + 'content-type': string; + encoding: string; + filename: string; + scale?: boolean | undefined; + } | undefined; + }, { + location?: string | undefined; + description?: string | undefined; + email?: string | undefined; + fullname?: string | undefined; + home_page?: string | undefined; + username?: string | undefined; + portrait?: { + data: string; + 'content-type': string; + encoding: string; + filename: string; + scale?: boolean | undefined; + } | undefined; + }>; +}, "strip", z.ZodTypeAny, { + data: { + location?: string | undefined; + description?: string | undefined; + email?: string | undefined; + fullname?: string | undefined; + home_page?: string | undefined; + username?: string | undefined; + portrait?: { + data: string; + 'content-type': string; + encoding: string; + filename: string; + scale?: boolean | undefined; + } | undefined; + }; + id: string; +}, { + data: { + location?: string | undefined; + description?: string | undefined; + email?: string | undefined; + fullname?: string | undefined; + home_page?: string | undefined; + username?: string | undefined; + portrait?: { + data: string; + 'content-type': string; + encoding: string; + filename: string; + scale?: boolean | undefined; + } | undefined; + }; + id: string; +}>; +type UpdateUserArgs = z.infer; +declare function updateUser(this: PloneClient, { id, data }: UpdateUserArgs): Promise>; + +declare const deleteUserArgsSchema: z.ZodObject<{ + id: z.ZodString; +}, "strip", z.ZodTypeAny, { + id: string; +}, { + id: string; +}>; +type DeleteUserArgs = z.infer; +declare function deleteUser(this: PloneClient, { id }: DeleteUserArgs): Promise>; + +declare const resetPasswordArgsSchema: z.ZodObject<{ + id: z.ZodString; +}, "strip", z.ZodTypeAny, { + id: string; +}, { + id: string; +}>; +type ResetUserArgs = z.infer; +declare function resetPassword(this: PloneClient, { id }: ResetUserArgs): Promise>; + +declare const resetPasswordWithTokenArgsSchema: z.ZodObject<{ + id: z.ZodString; + data: z.ZodObject<{ + reset_token: z.ZodString; + new_password: z.ZodString; + }, "strip", z.ZodTypeAny, { + reset_token: string; + new_password: string; + }, { + reset_token: string; + new_password: string; + }>; +}, "strip", z.ZodTypeAny, { + data: { + reset_token: string; + new_password: string; + }; + id: string; +}, { + data: { + reset_token: string; + new_password: string; + }; + id: string; +}>; +type ResetPasswordWithTokenUserArgs = z.infer; +declare function resetPasswordWithToken(this: PloneClient, { id, data }: ResetPasswordWithTokenUserArgs): Promise>; + +declare const updatePasswordArgsSchema: z.ZodObject<{ + id: z.ZodString; + data: z.ZodObject<{ + new_password: z.ZodString; + old_password: z.ZodString; + }, "strip", z.ZodTypeAny, { + new_password: string; + old_password: string; + }, { + new_password: string; + old_password: string; + }>; +}, "strip", z.ZodTypeAny, { + data: { + new_password: string; + old_password: string; + }; + id: string; +}, { + data: { + new_password: string; + old_password: string; + }; + id: string; +}>; +type UpdatePasswordArgs = z.infer; +declare function updatePassword(this: PloneClient, { id, data }: UpdatePasswordArgs): Promise>; + +declare function getUserschema(this: PloneClient): Promise>; + +declare function getVocabularies(this: PloneClient): Promise>; + +declare const getVocabularySchema: z.ZodObject<{ + path: z.ZodString; + title: z.ZodOptional; + token: z.ZodOptional; + tokens: z.ZodOptional>; +}, "strip", z.ZodTypeAny, { + path: string; + token?: string | undefined; + title?: string | undefined; + tokens?: string[] | undefined; +}, { + path: string; + token?: string | undefined; + title?: string | undefined; + tokens?: string[] | undefined; +}>; +type VocabulariesArgs = z.infer; +declare function getVocabulary(this: PloneClient, { path, title, token, tokens }: VocabulariesArgs): Promise>; + +declare const getWorkflowSchema: z.ZodObject<{ + path: z.ZodString; +}, "strip", z.ZodTypeAny, { + path: string; +}, { + path: string; +}>; +type WorkflowArgs = z.infer; +declare function getWorkflow(this: PloneClient, { path }: WorkflowArgs): Promise>; + +declare const createWorkflowArgsSchema: z.ZodObject<{ + path: z.ZodString; + data: z.ZodOptional; + effective: z.ZodOptional; + expires: z.ZodOptional; + include_children: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + effective?: string | undefined; + expires?: string | undefined; + comment?: string | undefined; + include_children?: boolean | undefined; + }, { + effective?: string | undefined; + expires?: string | undefined; + comment?: string | undefined; + include_children?: boolean | undefined; + }>>; +}, "strip", z.ZodTypeAny, { + path: string; + data?: { + effective?: string | undefined; + expires?: string | undefined; + comment?: string | undefined; + include_children?: boolean | undefined; + } | undefined; +}, { + path: string; + data?: { + effective?: string | undefined; + expires?: string | undefined; + comment?: string | undefined; + include_children?: boolean | undefined; + } | undefined; +}>; +type CreateWorkflowArgs = z.infer; +declare function createWorkflow(this: PloneClient, { path, data }: CreateWorkflowArgs): Promise>; + +declare const getWorkingcopySchema: z.ZodObject<{ + path: z.ZodString; +}, "strip", z.ZodTypeAny, { + path: string; +}, { + path: string; +}>; +type GetWorkingcopyArgs = z.infer; +declare function getWorkingcopy(this: PloneClient, { path }: GetWorkingcopyArgs): Promise>; + +declare const createWorkingcopyArgsSchema: z.ZodObject<{ + path: z.ZodString; +}, "strip", z.ZodTypeAny, { + path: string; +}, { + path: string; +}>; +type CreateWorkingcopyArgs = z.infer; +declare function createWorkingcopy(this: PloneClient, { path }: CreateWorkingcopyArgs): Promise>; + +declare const checkInWorkingcopyArgsSchema: z.ZodObject<{ + path: z.ZodString; +}, "strip", z.ZodTypeAny, { + path: string; +}, { + path: string; +}>; +type CheckInWorkingcopyArgs = z.infer; +declare function checkInWorkingcopy(this: PloneClient, { path }: CheckInWorkingcopyArgs): Promise>; + +declare const deleteWorkingcopyArgsSchema: z.ZodObject<{ + path: z.ZodString; +}, "strip", z.ZodTypeAny, { + path: string; +}, { + path: string; +}>; +type DeleteWorkingcopyArgs = z.infer; +declare function deleteWorkingcopy(this: PloneClient, { path }: DeleteWorkingcopyArgs): Promise>; + +declare const PloneClientConfigSchema: z.ZodObject<{ + apiPath: z.ZodString; + apiSuffix: z.ZodOptional; + token: z.ZodOptional; +}, "strip", z.ZodTypeAny, { + apiPath: string; + apiSuffix?: string | undefined; + token?: string | undefined; +}, { + apiPath: string; + apiSuffix?: string | undefined; + token?: string | undefined; +}>; +type PloneClientConfig = z.infer; + +declare class PloneClient { + config: PloneClientConfig; + static initialize: (config: PloneClientConfig) => InstanceType; + constructor(config: PloneClientConfig); + getActions: typeof getActions; + getAddons: typeof getAddons; + getAddon: typeof getAddon; + installAddon: typeof installAddon; + uninstallAddon: typeof uninstallAddon; + upgradeAddon: typeof upgradeAddon; + installAddonProfile: typeof installAddonProfile; + getAllAliases: typeof getAllAliases; + getAliases: typeof getAliases; + createAlias: typeof createAlias; + createAliases: typeof createAliases; + deleteAliases: typeof deleteAliases; + getBreadcrumbs: typeof getBreadcrumbs; + getComments: typeof getComments; + createComment: typeof createComment; + updateComment: typeof updateComment; + deleteComment: typeof deleteComment; + getContent: typeof getContent; + createContent: typeof createContent; + updateContent: typeof updateContent; + deleteContent: typeof deleteContent; + copyContent: typeof copyContent; + moveContent: typeof moveContent; + getContextNavigation: typeof getContextNavigation; + getControlpanels: typeof getControlpanels; + getControlpanel: typeof getControlpanel; + createControlpanel: typeof createControlpanel; + updateControlpanel: typeof updateControlpanel; + deleteControlpanel: typeof deleteControlpanel; + getDatabase: typeof getDatabase; + emailNotification: typeof emailNotification; + emailSend: typeof emailSend; + getGroups: typeof getGroups; + getGroup: typeof getGroup; + createGroup: typeof createGroup; + updateGroup: typeof updateGroup; + deleteGroup: typeof deleteGroup; + getHistory: typeof getHistory; + getHistoryVersion: typeof getHistoryVersion; + revertHistory: typeof revertHistory; + getLinkintegrity: typeof getLinkintegrity; + getLock: typeof getLock; + createLock: typeof createLock; + updateLock: typeof updateLock; + deleteLock: typeof deleteLock; + login: typeof login; + getNavigation: typeof getNavigation; + getNavroot: typeof getNavroot; + getPrincipals: typeof getPrincipals; + getQuerysources: typeof getQuerysources; + getQuerystring: typeof getQuerystring; + querystringSearch: typeof querystringSearch; + getRegistry: typeof getRegistry; + getRegistryRecord: typeof getRegistryRecord; + updateRegistry: typeof updateRegistry; + getAllRelations: typeof getAllRelations; + getRelations: typeof getRelations; + createRelations: typeof createRelations; + fixRelations: typeof fixRelations; + deleteRelations: typeof deleteRelations; + getRoles: typeof getRoles; + getRules: typeof getRules; + createRule: typeof createRule; + updateRules: typeof updateRules; + deleteRules: typeof deleteRules; + search: typeof search; + getSite: typeof getSite; + getSource: typeof getSource; + getSystem: typeof getSystem; + getTransactions: typeof getTransactions; + revertTransactions: typeof revertTransactions; + getTranslation: typeof getTranslation; + linkTranslation: typeof linkTranslation; + unlinkTranslation: typeof unlinkTranslation; + getTypes: typeof getTypes; + getType: typeof getType; + getTypeField: typeof getTypeField; + createTypeField: typeof createTypeField; + updateTypeField: typeof updateTypeField; + getUpgrade: typeof getUpgrade; + runUpgrade: typeof runUpgrade; + getUsers: typeof getUsers; + getUser: typeof getUser; + createUser: typeof createUser; + updateUser: typeof updateUser; + deleteUser: typeof deleteUser; + resetPassword: typeof resetPassword; + resetPasswordWithToken: typeof resetPasswordWithToken; + updatePassword: typeof updatePassword; + getUserschema: typeof getUserschema; + getVocabularies: typeof getVocabularies; + getVocabulary: typeof getVocabulary; + getWorkflow: typeof getWorkflow; + createWorkflow: typeof createWorkflow; + getWorkingcopy: typeof getWorkingcopy; + createWorkingcopy: typeof createWorkingcopy; + checkInWorkingcopy: typeof checkInWorkingcopy; + deleteWorkingcopy: typeof deleteWorkingcopy; +} + +export { PloneClient as default }; diff --git a/packages/client/dist/index.js b/packages/client/dist/index.js new file mode 100644 index 00000000000..9185f9c7e25 --- /dev/null +++ b/packages/client/dist/index.js @@ -0,0 +1,2245 @@ +// src/api.ts +import axios from "axios"; +import qs from "query-string"; +import debugFactory from "debug"; +var debug = debugFactory("axios"); +var APISUFFIX = "/++api++"; +function getBackendURL(apiPath, apiSuffix, path) { + if (path.startsWith("http://") || path.startsWith("https://")) return path; + const adjustedPath = path[0] !== "/" ? `/${path}` : path; + return `${apiPath}${apiSuffix ?? APISUFFIX}${adjustedPath}`; +} +var _handleResponse = (response) => response; +var _handleError = (config) => (error) => { + debug(error); + const status = error.status ?? 0; + return Promise.reject({ + status: error.status ?? error.code, + data: error.response?.data, + location: status >= 300 && status < 400 ? error.response?.headers.location.replaceAll( + `${config.apiPath}${config.apiSuffix ?? APISUFFIX}`, + "" + ).replace(/\?.*$/, "") : void 0 + }); +}; +function axiosConfigAdapter(method, path, options) { + const { + config, + params, + data, + maxRedirects, + headers = {} + } = options; + const axiosConfig = { + method, + url: getBackendURL(config.apiPath, config.apiSuffix, path), + params, + headers: { + Accept: "application/json", + ...headers + }, + data, + validateStatus: function(status) { + return status >= 200 && status < 300; + }, + paramsSerializer: function(params2) { + return qs.stringify(params2, { arrayFormat: "colon-list-separator" }); + }, + maxRedirects + }; + if (config.token && axiosConfig.headers) { + axiosConfig.headers["Authorization"] = `Bearer ${config.token}`; + } + debug(axiosConfig); + return axiosConfig; +} +async function apiRequest(method, path, options) { + const instance = axios.create(); + if (options.raw) { + instance.interceptors.response.use(void 0, _handleError(options.config)); + } else { + instance.interceptors.response.use( + _handleResponse, + _handleError(options.config) + ); + } + return instance.request(axiosConfigAdapter(method, path, options)); +} + +// src/restapi/actions/get.ts +import { z } from "zod"; +var getActionsSchema = z.object({ + path: z.string() +}); +async function getActions({ path }) { + const validatedArgs = getActionsSchema.parse({ + path + }); + const options = { + config: this.config, + params: {} + }; + const actionsPath = `${validatedArgs.path}/@actions`; + return apiRequest("get", actionsPath, options); +} + +// src/restapi/addons/get_list.ts +async function getAddons() { + const options = { + config: this.config, + params: {} + }; + return apiRequest("get", "/@addons", options); +} + +// src/restapi/addons/get.ts +import { z as z2 } from "zod"; +var getAddonSchema = z2.object({ + id: z2.string() +}); +async function getAddon({ id }) { + const validatedArgs = getAddonSchema.parse({ + id + }); + const options = { + config: this.config, + params: {} + }; + const addonName = `@addons/${validatedArgs.id}`; + return apiRequest("get", addonName, options); +} + +// src/restapi/addons/install.ts +import { z as z3 } from "zod"; +var installAddonSchema = z3.object({ + id: z3.string() +}); +async function installAddon({ id }) { + const validatedArgs = installAddonSchema.parse({ + id + }); + const options = { + config: this.config, + params: {} + }; + const addonName = `@addons/${validatedArgs.id}/install`; + return apiRequest("post", addonName, options); +} + +// src/restapi/addons/uninstall.ts +import { z as z4 } from "zod"; +var uninstallAddonSchema = z4.object({ + id: z4.string() +}); +async function uninstallAddon({ id }) { + const validatedArgs = uninstallAddonSchema.parse({ + id + }); + const options = { + config: this.config, + params: {} + }; + const addonName = `@addons/${validatedArgs.id}/uninstall`; + return apiRequest("post", addonName, options); +} + +// src/restapi/addons/upgrade.ts +import { z as z5 } from "zod"; +var upgradeAddonSchema = z5.object({ + id: z5.string() +}); +async function upgradeAddon({ id }) { + const validatedArgs = upgradeAddonSchema.parse({ + id + }); + const options = { + config: this.config, + params: {} + }; + const addonName = `@addons/${validatedArgs.id}/upgrade`; + return apiRequest("post", addonName, options); +} + +// src/restapi/addons/install_profile.ts +import { z as z6 } from "zod"; +var installAddonProfileSchema = z6.object({ + id: z6.string(), + profile: z6.string() +}); +async function installAddonProfile({ id, profile }) { + const validatedArgs = installAddonProfileSchema.parse({ + id, + profile + }); + const options = { + config: this.config, + params: {} + }; + const addonName = `@addons/${validatedArgs.id}/${profile}`; + return apiRequest("post", addonName, options); +} + +// src/restapi/aliases/get_all.ts +async function getAllAliases() { + const options = { + config: this.config, + params: {} + }; + return apiRequest("get", "/@aliases", options); +} + +// src/restapi/aliases/get.ts +import { z as z7 } from "zod"; +var getAliasesSchema = z7.object({ + path: z7.string() +}); +async function getAliases({ path }) { + const validatedArgs = getAliasesSchema.parse({ + path + }); + const options = { + config: this.config, + params: {} + }; + const aliasesPath = `${validatedArgs.path}/@aliases`; + return apiRequest("get", aliasesPath, options); +} + +// src/restapi/aliases/create.ts +import { z as z9 } from "zod"; + +// src/validation/aliases.ts +import { z as z8 } from "zod"; +var itemSchema = z8.object({ + path: z8.string() +}); +var createAliasDataSchema = z8.object({ + items: z8.array(itemSchema) +}); +var deleteAliasesDataSchema = z8.object({ + items: z8.array(itemSchema) +}); +var rootItemSchema = z8.object({ + datetime: z8.string().optional(), + path: z8.string(), + "redirect-to": z8.string() +}); +var createAliasesDataSchema = z8.object({ + items: z8.array(rootItemSchema) +}); + +// src/restapi/aliases/create.ts +var createAliasArgsSchema = z9.object({ + path: z9.string(), + data: createAliasDataSchema +}); +async function createAlias({ path, data }) { + const validatedArgs = createAliasArgsSchema.parse({ + path, + data + }); + const addAliasPath = `${validatedArgs.path}/@aliases`; + const options = { + data: validatedArgs.data, + config: this.config + }; + return apiRequest("post", addAliasPath, options); +} + +// src/restapi/aliases/create_multiple.ts +import { z as z10 } from "zod"; +var createAliasesArgsSchema = z10.object({ + data: createAliasesDataSchema +}); +async function createAliases({ data }) { + const validatedArgs = createAliasesArgsSchema.parse({ + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + return apiRequest("post", "/@aliases", options); +} + +// src/restapi/aliases/delete.ts +import { z as z11 } from "zod"; +var deleteAliasesArgsSchema = z11.object({ + path: z11.string(), + data: deleteAliasesDataSchema +}); +async function deleteAliases({ path, data }) { + const validatedArgs = deleteAliasesArgsSchema.parse({ + path, + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + const aliasesPath = `${validatedArgs.path}/@aliases`; + return apiRequest("delete", aliasesPath, options); +} + +// src/restapi/breadcrumbs/get.ts +import { z as z12 } from "zod"; +var getBreadcrumbsSchema = z12.object({ + path: z12.string() +}); +async function getBreadcrumbs({ path }) { + const validatedArgs = getBreadcrumbsSchema.parse({ + path + }); + const options = { + config: this.config, + params: {} + }; + const breadcrumbsPath = `${validatedArgs.path}/@breadcrumbs`; + return apiRequest("get", breadcrumbsPath, options); +} + +// src/restapi/comments/get.ts +import { z as z13 } from "zod"; +var getCommentsSchema = z13.object({ + path: z13.string() +}); +async function getComments({ path }) { + const validatedArgs = getCommentsSchema.parse({ + path + }); + const options = { + config: this.config, + params: {} + }; + const commentsPath = `/${validatedArgs.path}/@comments`; + return apiRequest("get", commentsPath, options); +} + +// src/restapi/comments/create.ts +import { z as z15 } from "zod"; + +// src/validation/comments.ts +import { z as z14 } from "zod"; +var createCommentDataSchema = z14.object({ + text: z14.string() +}); + +// src/restapi/comments/create.ts +var createCommentArgsSchema = z15.object({ + path: z15.string(), + in_reply_to: z15.string().optional(), + data: createCommentDataSchema +}); +async function createComment({ path, in_reply_to, data }) { + const validatedArgs = createCommentArgsSchema.parse({ + path, + in_reply_to, + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + const commentsPath = in_reply_to ? `/${validatedArgs.path}/@comments/${validatedArgs.in_reply_to}` : `/${validatedArgs.path}/@comments`; + return apiRequest("post", commentsPath, options); +} + +// src/restapi/comments/update.ts +import { z as z16 } from "zod"; +var updateCommentArgsSchema = z16.object({ + path: z16.string(), + comment_id: z16.string(), + data: createCommentDataSchema +}); +async function updateComment({ path, comment_id, data }) { + const validatedArgs = updateCommentArgsSchema.parse({ + path, + comment_id, + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + const commentsPath = `${validatedArgs.path}/@comments/${validatedArgs.comment_id}`; + return apiRequest("patch", commentsPath, options); +} + +// src/restapi/comments/delete.ts +import { z as z17 } from "zod"; +var deleteCommentArgsSchema = z17.object({ + path: z17.string(), + comment_id: z17.string() +}); +async function deleteComment({ path, comment_id }) { + const validatedArgs = deleteCommentArgsSchema.parse({ + path, + comment_id + }); + const options = { + config: this.config + }; + const commentsPath = `${validatedArgs.path}/@comments/${validatedArgs.comment_id}`; + return apiRequest("delete", commentsPath, options); +} + +// src/restapi/content/get.ts +import { z as z18 } from "zod"; +var getContentArgsSchema = z18.object({ + path: z18.string(), + version: z18.string().optional(), + page: z18.number().optional(), + fullObjects: z18.boolean().optional(), + expand: z18.string().array().optional() +}); +async function getContent({ path, version, page, fullObjects, expand }) { + const validatedArgs = getContentArgsSchema.parse({ + path, + version, + page, + fullObjects, + expand + }); + const options = { + config: this.config, + maxRedirects: 0, + params: { + ...validatedArgs.page && { page: validatedArgs.page }, + ...validatedArgs.version && { version: validatedArgs.version }, + ...validatedArgs.fullObjects && { + fullobjects: validatedArgs.fullObjects + } + } + }; + if (validatedArgs.version) { + return apiRequest( + "get", + `${path}/@history/${validatedArgs.version}`, + options + ); + } + if (validatedArgs.expand) { + options.params = { + ...options.params, + expand + }; + } + return apiRequest("get", path, options); +} + +// src/restapi/content/create.ts +import { z as z20 } from "zod"; + +// src/validation/content.ts +import { z as z19 } from "zod"; +var RelatedItemPayloadSchema = z19.object({ + "@id": z19.string(), + "@type": z19.string(), + CreationDate: z19.string(), + Creator: z19.string(), + Date: z19.string(), + Description: z19.string(), + EffectiveDate: z19.unknown(), + ExpirationDate: z19.unknown(), + ModificationDate: z19.string(), + Subject: z19.array(z19.unknown()), + Title: z19.string(), + Type: z19.string(), + UID: z19.string(), + author_name: z19.unknown(), + cmf_uid: z19.unknown(), + commentators: z19.array(z19.unknown()), + created: z19.string(), + description: z19.string(), + effective: z19.string(), + end: z19.unknown(), + exclude_from_nav: z19.boolean(), + expires: z19.string(), + getIcon: z19.unknown(), + getId: z19.string(), + getObjSize: z19.string(), + getPath: z19.string(), + getRemoteUrl: z19.unknown(), + getURL: z19.string(), + hasPreviewImage: z19.unknown(), + head_title: z19.unknown(), + id: z19.string(), + image_field: z19.string().nullable(), + image_scales: z19.unknown(), + in_response_to: z19.unknown(), + is_folderish: z19.boolean(), + last_comment_date: z19.unknown(), + listCreators: z19.array(z19.string()), + location: z19.unknown(), + mime_type: z19.string(), + modified: z19.string(), + nav_title: z19.unknown(), + portal_type: z19.string(), + review_state: z19.string(), + start: z19.unknown(), + sync_uid: z19.unknown(), + title: z19.string(), + total_comments: z19.number() +}).partial().required({ + "@id": true, + title: true +}); +var createContentDataSchema = z19.object({ + "@id": z19.string().optional(), + "@static_behaviors": z19.unknown().optional(), + "@type": z19.string(), + allow_discussion: z19.boolean().optional(), + blocks: z19.unknown().optional(), + blocks_layout: z19.object({ items: z19.array(z19.string()) }).optional(), + contributors: z19.array(z19.string()).optional(), + creators: z19.array(z19.string()).optional(), + description: z19.string().optional(), + effective: z19.string().nullable().optional(), + exclude_from_nav: z19.boolean().optional(), + expires: z19.string().nullable().optional(), + file: z19.object({ + "content-type": z19.string(), + data: z19.string(), + encoding: z19.string(), + filename: z19.string() + }).optional(), + id: z19.string().optional(), + image: z19.object({ + "content-type": z19.string(), + data: z19.string(), + encoding: z19.string(), + filename: z19.string() + }).optional(), + language: z19.string().optional(), + preview_caption: z19.string().optional(), + preview_image: z19.object({ + "content-type": z19.string(), + data: z19.string(), + encoding: z19.string(), + filename: z19.string() + }).optional(), + relatedItems: z19.array(RelatedItemPayloadSchema).optional(), + rights: z19.string().nullable().optional(), + title: z19.string(), + versioning_enabled: z19.boolean().optional() +}); +var updateContentDataSchema = z19.object({ + allow_discussion: z19.boolean().optional(), + blocks: z19.unknown().optional(), + blocks_layout: z19.object({ items: z19.array(z19.string()) }).optional(), + contributors: z19.array(z19.string()).optional(), + creators: z19.array(z19.string()).optional(), + description: z19.string().optional(), + effective: z19.string().nullable().optional(), + exclude_from_nav: z19.boolean().optional(), + expires: z19.string().nullable().optional(), + id: z19.string().nullable().optional(), + ordering: z19.object({ + obj_id: z19.string(), + delta: z19.union([z19.number(), z19.literal("bottom"), z19.literal("top")]), + subset_ids: z19.array(z19.string()).optional() + }).optional(), + preview_caption: z19.string().nullable().optional(), + preview_image: z19.object({ + "content-type": z19.string(), + data: z19.string(), + encoding: z19.string(), + filename: z19.string() + }).nullable().optional(), + relatedItems: z19.array(RelatedItemPayloadSchema).optional(), + rights: z19.string().nullable().optional(), + table_of_contents: z19.boolean().nullable().optional(), + title: z19.string().optional(), + versioning_enabled: z19.boolean().optional() +}).partial(); +var copyMoveContentDataSchema = z19.object({ + path: z19.string(), + data: z19.object({ + source: z19.union([z19.string(), z19.array(z19.string())]) + }) +}); + +// src/restapi/content/create.ts +var createContentArgsSchema = z20.object({ + path: z20.string(), + data: createContentDataSchema +}); +async function createContent({ path, data }) { + const validatedArgs = createContentArgsSchema.parse({ + path, + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + return apiRequest("post", validatedArgs.path, options); +} + +// src/restapi/content/update.ts +import { z as z21 } from "zod"; +var updateContentArgsSchema = z21.object({ + path: z21.string(), + data: updateContentDataSchema +}); +async function updateContent({ path, data }) { + const validatedArgs = updateContentArgsSchema.parse({ + path, + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + return apiRequest("patch", validatedArgs.path, options); +} + +// src/restapi/content/delete.ts +import { z as z22 } from "zod"; +var deleteContentArgsSchema = z22.object({ + path: z22.string() +}); +async function deleteContent({ path }) { + const validatedArgs = deleteContentArgsSchema.parse({ + path + }); + const options = { + config: this.config + }; + return apiRequest("delete", validatedArgs.path, options); +} + +// src/restapi/content/copy.ts +import "zod"; +async function copyContent({ path, data }) { + const validatedArgs = copyMoveContentDataSchema.parse({ + path, + data + }); + const options = { + config: this.config, + data: validatedArgs.data + }; + const copyPath = `${validatedArgs.path}/@copy`; + return apiRequest("post", copyPath, options); +} + +// src/restapi/content/move.ts +import "zod"; +async function moveContent({ path, data }) { + const validatedArgs = copyMoveContentDataSchema.parse({ + path, + data + }); + const options = { + config: this.config, + data: validatedArgs.data + }; + const movePath = `${validatedArgs.path}/@move`; + return apiRequest("post", movePath, options); +} + +// src/restapi/contextnavigation/get.ts +import { z as z25 } from "zod"; +var getContextNavigationSchema = z25.object({ + path: z25.string() +}); +async function getContextNavigation({ path }) { + const validatedArgs = getContextNavigationSchema.parse({ + path + }); + const options = { + config: this.config, + params: {} + }; + const contextnavigationPath = `${validatedArgs.path}/@contextnavigation`; + return apiRequest("get", contextnavigationPath, options); +} + +// src/restapi/controlpanels/get_list.ts +async function getControlpanels() { + const options = { + config: this.config, + params: {} + }; + return apiRequest("get", "/@controlpanels", options); +} + +// src/restapi/controlpanels/get.ts +import { z as z26 } from "zod"; +var getControlpanelSchema = z26.object({ + id: z26.string() +}); +async function getControlpanel({ id }) { + const validatedArgs = getControlpanelSchema.parse({ + id + }); + const options = { + config: this.config, + params: {} + }; + const getControlpanelPath = `@controlpanels/${validatedArgs.id}`; + return apiRequest("get", getControlpanelPath, options); +} + +// src/restapi/controlpanels/create.ts +import { z as z27 } from "zod"; +var createControlpanelArgsSchema = z27.object({ + path: z27.string(), + data: z27.any() +}); +async function createControlpanel({ path, data }) { + const validatedArgs = createControlpanelArgsSchema.parse({ + path, + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + const createControlpanelPath = `@controlpanels/${validatedArgs.path}`; + return apiRequest("post", createControlpanelPath, options); +} + +// src/restapi/controlpanels/update.ts +import { z as z28 } from "zod"; +var updateControlpanelArgsSchema = z28.object({ + path: z28.string(), + data: z28.any() +}); +async function updateControlpanel({ path, data }) { + const validatedArgs = updateControlpanelArgsSchema.parse({ + path, + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + const updateControlpanelPath = `@controlpanels/${validatedArgs.path}`; + return apiRequest("patch", updateControlpanelPath, options); +} + +// src/restapi/controlpanels/delete.ts +import { z as z29 } from "zod"; +var deleteControlpanelArgsSchema = z29.object({ + path: z29.string(), + data: z29.any() +}); +async function deleteControlpanel({ path, data }) { + const validatedArgs = deleteControlpanelArgsSchema.parse({ + path, + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + const deleteControlpanelPath = `@controlpanels/${validatedArgs.path}`; + return apiRequest("delete", deleteControlpanelPath, options); +} + +// src/restapi/database/get.ts +async function getDatabase() { + const options = { + config: this.config, + params: {} + }; + return apiRequest("get", "/@database", options); +} + +// src/restapi/email-notification/post.ts +import { z as z30 } from "zod"; +var emailNotificationDataSchema = z30.object({ + name: z30.string(), + from: z30.string(), + subject: z30.string(), + message: z30.string() +}); +var emailNotificationArgsSchema = z30.object({ + user: z30.string().optional(), + data: emailNotificationDataSchema +}); +async function emailNotification({ user, data }) { + const validatedArgs = emailNotificationArgsSchema.parse({ + user, + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + const emailNotificationPath = user ? `/@users/${user}/@email-notification` : "/@email-notification"; + return apiRequest("post", emailNotificationPath, options); +} + +// src/restapi/email-send/post.ts +import { z as z31 } from "zod"; +var emailSendDataSchema = z31.object({ + name: z31.string(), + from: z31.string(), + to: z31.string(), + subject: z31.string(), + message: z31.string() +}); +var emailSendArgsSchema = z31.object({ + data: emailSendDataSchema +}); +async function emailSend({ data }) { + const validatedArgs = emailSendArgsSchema.parse({ + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + return apiRequest("post", "/@email-send", options); +} + +// src/restapi/groups/get_list.ts +async function getGroups() { + const options = { + config: this.config, + params: {} + }; + return apiRequest("get", "/@groups", options); +} + +// src/restapi/groups/get.ts +import { z as z32 } from "zod"; +var getGroupSchema = z32.object({ + id: z32.string() +}); +async function getGroup({ id }) { + const validatedArgs = getGroupSchema.parse({ + id + }); + const options = { + config: this.config, + params: {} + }; + const groupName = `@groups/${validatedArgs.id}`; + return apiRequest("get", groupName, options); +} + +// src/restapi/groups/create.ts +import { z as z34 } from "zod"; + +// src/validation/groups.ts +import { z as z33 } from "zod"; +var createGroupDataSchema = z33.object({ + description: z33.string().optional(), + email: z33.string().optional(), + groupname: z33.string(), + groups: z33.array(z33.string()).optional(), + roles: z33.array(z33.string()).optional(), + title: z33.string().optional(), + users: z33.array(z33.string()).optional() +}); +var updateGroupDataSchema = z33.object({ + description: z33.string().optional(), + email: z33.string().optional(), + title: z33.string().optional() +}); + +// src/restapi/groups/create.ts +var createGroupArgsSchema = z34.object({ + data: createGroupDataSchema +}); +async function createGroup({ data }) { + const validatedArgs = createGroupArgsSchema.parse({ + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + return apiRequest("post", "/@groups", options); +} + +// src/restapi/groups/update.ts +import { z as z35 } from "zod"; +var updateGroupArgsSchema = z35.object({ + id: z35.string(), + data: updateGroupDataSchema +}); +async function updateGroup({ id, data }) { + const validatedArgs = updateGroupArgsSchema.parse({ + id, + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + const groupName = `/@groups/${validatedArgs.id}`; + return apiRequest("patch", groupName, options); +} + +// src/restapi/groups/delete.ts +import { z as z36 } from "zod"; +var deleteGroupArgsSchema = z36.object({ + id: z36.string() +}); +async function deleteGroup({ id }) { + const validatedArgs = deleteGroupArgsSchema.parse({ + id + }); + const options = { + config: this.config + }; + const groupName = `/@groups/${validatedArgs.id}`; + return apiRequest("delete", groupName, options); +} + +// src/restapi/history/get.ts +import { z as z37 } from "zod"; +var getHistorySchema = z37.object({ + path: z37.string() +}); +async function getHistory({ path }) { + const validatedArgs = getHistorySchema.parse({ + path + }); + const options = { + config: this.config, + params: {} + }; + const historyPath = `/${validatedArgs.path}/@history`; + return apiRequest("get", historyPath, options); +} + +// src/restapi/history/get_version.ts +import { z as z38 } from "zod"; +var getHistoryVersionSchema = z38.object({ + path: z38.string(), + version: z38.number() +}); +async function getHistoryVersion({ path, version }) { + const validatedArgs = getHistoryVersionSchema.parse({ + path, + version + }); + const options = { + config: this.config, + params: {} + }; + const historyPath = `${validatedArgs.path}/@history/${validatedArgs.version}`; + return apiRequest("get", historyPath, options); +} + +// src/restapi/history/revert.ts +import { z as z40 } from "zod"; + +// src/validation/history.ts +import { z as z39 } from "zod"; +var revertHistoryDataSchema = z39.object({ + version: z39.number() +}); + +// src/restapi/history/revert.ts +var revertHistoryArgsSchema = z40.object({ + path: z40.string(), + data: revertHistoryDataSchema +}); +async function revertHistory({ path, data }) { + const validatedArgs = revertHistoryArgsSchema.parse({ + path, + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + const historyPath = `${validatedArgs.path}/@history`; + return apiRequest("patch", historyPath, options); +} + +// src/restapi/linkintegrity/get.ts +import { z as z41 } from "zod"; +var getLinkintegriyArgsSchema = z41.object({ + uids: z41.string() +}); +async function getLinkintegrity({ uids }) { + const validatedArgs = getLinkintegriyArgsSchema.parse({ + uids + }); + const options = { + config: this.config, + params: { + ...validatedArgs && { uids: validatedArgs.uids } + } + }; + return apiRequest("get", "/@linkintegrity", options); +} + +// src/restapi/lock/get.ts +import { z as z42 } from "zod"; +var getLockSchema = z42.object({ + path: z42.string() +}); +async function getLock({ path }) { + const validatedArgs = getLockSchema.parse({ + path + }); + const options = { + config: this.config, + params: {} + }; + const getLockPath = `/${validatedArgs.path}/@lock`; + return apiRequest("get", getLockPath, options); +} + +// src/restapi/lock/create.ts +import { z as z44 } from "zod"; + +// src/validation/lock.ts +import { z as z43 } from "zod"; +var createLockDataSchema = z43.object({ + stealable: z43.boolean().optional(), + timeout: z43.number().optional() +}); +var deleteLockDataSchema = z43.object({ + force: z43.boolean().optional() +}); + +// src/restapi/lock/create.ts +var createLockArgsSchema = z44.object({ + path: z44.string(), + data: createLockDataSchema +}); +async function createLock({ path, data }) { + const validatedArgs = createLockArgsSchema.parse({ + path, + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + const addLockPath = `/${validatedArgs.path}/@lock`; + return apiRequest("post", addLockPath, options); +} + +// src/restapi/lock/update.ts +import { z as z45 } from "zod"; +var updateLockArgsSchema = z45.object({ + path: z45.string(), + locktoken: z45.string() +}); +async function updateLock({ path, locktoken }) { + const validatedArgs = updateLockArgsSchema.parse({ + path, + locktoken + }); + const options = { + headers: { + "Lock-Token": validatedArgs.locktoken + }, + config: this.config + }; + return apiRequest("patch", validatedArgs.path, options); +} + +// src/restapi/lock/delete.ts +import { z as z46 } from "zod"; +var deleteLockArgsSchema = z46.object({ + path: z46.string(), + data: deleteLockDataSchema.optional() +}); +async function deleteLock({ path, data }) { + const validatedArgs = deleteLockArgsSchema.parse({ + path, + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + const deleteLockPath = `/${validatedArgs.path}/@lock`; + return apiRequest("delete", deleteLockPath, options); +} + +// src/restapi/login/post.ts +import { z as z47 } from "zod"; +var loginArgsSchema = z47.object({ + data: z47.object({ + login: z47.string(), + password: z47.string() + }) +}); +async function login({ data }) { + const validatedArgs = loginArgsSchema.parse({ data }); + const options = { + data: { + login: validatedArgs.data.login, + password: validatedArgs.data.password + }, + config: this.config + }; + return apiRequest("post", "/@login", options); +} + +// src/restapi/navigation/get.ts +import { z as z48 } from "zod"; +var getNavigationSchema = z48.object({ + path: z48.string(), + depth: z48.number().optional() +}); +async function getNavigation({ path, depth }) { + const validatedArgs = getNavigationSchema.parse({ + path, + depth + }); + const options = { + config: this.config, + params: {} + }; + const navigationPath = `${validatedArgs.path}/@navigation`; + if (validatedArgs.depth) { + options.params["expand.navigation.depth"] = validatedArgs.depth; + } + return apiRequest("get", navigationPath, options); +} + +// src/restapi/navroot/get.ts +import { z as z49 } from "zod"; +var getNavrootSchema = z49.object({ + path: z49.string(), + language: z49.string().optional() +}); +async function getNavroot({ path, language }) { + const validatedArgs = getNavrootSchema.parse({ + path, + language + }); + const options = { + config: this.config, + params: {} + }; + const navrootPath = language ? `/${validatedArgs.language}/${validatedArgs.path}/@navroot` : `/${validatedArgs.path}/@navroot`; + return apiRequest("get", navrootPath, options); +} + +// src/restapi/principals/get.ts +import { z as z50 } from "zod"; +var getPrincipalsSchema = z50.object({ + search: z50.string() +}); +async function getPrincipals({ search: search2 }) { + const validatedArgs = getPrincipalsSchema.parse({ + search: search2 + }); + const options = { + config: this.config, + params: {} + }; + const principalsPath = `/@principals?search=${validatedArgs.search}`; + return apiRequest("get", principalsPath, options); +} + +// src/restapi/querysources/get.ts +import { z as z51 } from "zod"; +var getQuerysourcesSchema = z51.object({ + path: z51.string(), + field: z51.string(), + query: z51.string() +}); +async function getQuerysources({ path, field, query: query2 }) { + const validatedArgs = getQuerysourcesSchema.parse({ + path, + field, + query: query2 + }); + const options = { + config: this.config, + params: { + ...validatedArgs.query && { query: validatedArgs.query } + } + }; + const querysourcePath = `/${validatedArgs.path}/@querysources/${field}`; + return apiRequest("get", querysourcePath, options); +} + +// src/restapi/querystring/get.ts +async function getQuerystring() { + const options = { + config: this.config, + params: {} + }; + return apiRequest("get", "/@querystring", options); +} + +// src/restapi/querystring-search/get.ts +import "zod"; + +// src/validation/querystring-search.ts +import { z as z52 } from "zod"; +var query = z52.object({ + i: z52.string(), + o: z52.string(), + v: z52.union([z52.string(), z52.array(z52.string())]) +}); +var querystringSearchDataSchema = z52.object({ + b_start: z52.string().optional(), + b_size: z52.string().optional(), + limit: z52.string().optional(), + sort_on: z52.string().optional(), + sort_order: z52.string().optional(), + fullobjects: z52.boolean().optional(), + query: z52.array(query), + post: z52.boolean().optional() +}); + +// src/restapi/querystring-search/get.ts +async function querystringSearch({ query: query2, post }) { + const validatedArgs = querystringSearchDataSchema.parse({ + query: query2 + }); + if (post) { + const options = { + data: { query: validatedArgs.query }, + config: this.config + }; + return apiRequest("post", "/@querystring-search", options); + } else { + const queryObject = { query: validatedArgs.query }; + const querystring = JSON.stringify(queryObject); + const encodedQuery = encodeURIComponent(querystring); + const options = { + config: this.config, + params: { + ...encodedQuery && { query: encodedQuery } + } + }; + return apiRequest("get", "/@querystring-search", options); + } +} + +// src/restapi/registry/get_list.ts +async function getRegistry() { + const options = { + config: this.config, + params: {} + }; + return apiRequest("get", "/@registry", options); +} + +// src/restapi/registry/get.ts +import { z as z54 } from "zod"; +var getRegistryRecordSchema = z54.object({ + name: z54.string() +}); +async function getRegistryRecord({ name }) { + const validatedArgs = getRegistryRecordSchema.parse({ + name + }); + const options = { + config: this.config, + params: {} + }; + const registryPath = `/@registry/${validatedArgs.name}`; + return apiRequest("get", registryPath, options); +} + +// src/restapi/registry/update.ts +import { z as z56 } from "zod"; + +// src/validation/registry.ts +import { z as z55 } from "zod"; +var updateRegistryDataSchema = z55.record(z55.any()); + +// src/restapi/registry/update.ts +var updateRegistryArgsSchema = z56.object({ + data: updateRegistryDataSchema +}); +async function updateRegistry({ data }) { + const validatedArgs = updateRegistryArgsSchema.parse({ + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + return apiRequest("patch", "/@registry", options); +} + +// src/restapi/relations/get_list.ts +async function getAllRelations() { + const options = { + config: this.config, + params: {} + }; + return apiRequest("get", "/@relations", options); +} + +// src/restapi/relations/get.ts +import { z as z57 } from "zod"; +var getRelationsSchema = z57.object({ + source: z57.string().optional(), + relation: z57.string().optional(), + onlyBroken: z57.boolean().optional() +}).refine((data) => { + return data.source !== void 0 || data.relation !== void 0; +}); +async function getRelations({ source, relation, onlyBroken }) { + const validatedArgs = getRelationsSchema.parse({ + source, + relation, + onlyBroken + }); + const options = { + config: this.config, + params: { + ...validatedArgs.source && { source: validatedArgs.source }, + ...validatedArgs.relation && { relation: validatedArgs.relation }, + ...validatedArgs.onlyBroken && { relation: validatedArgs.onlyBroken } + } + }; + return apiRequest("get", "/@relations", options); +} + +// src/restapi/relations/create.ts +import { z as z59 } from "zod"; + +// src/validation/relations.ts +import { z as z58 } from "zod"; +var RelationDataSchema = z58.object({ + relation: z58.string(), + source: z58.string(), + target: z58.string() +}); +var createRelationsDataSchema = z58.object({ + items: z58.array(RelationDataSchema) +}); +var deleteRelationsDataSchema = z58.object({ + items: z58.array(RelationDataSchema).optional(), + relation: z58.string().optional(), + source: z58.string().optional(), + target: z58.string().optional() +}); +var fixRelationsDataSchema = z58.object({ + flush: z58.number().optional() +}); + +// src/restapi/relations/create.ts +var createRelationsArgsSchema = z59.object({ + data: createRelationsDataSchema +}); +async function createRelations({ data }) { + const validatedArgs = createRelationsArgsSchema.parse({ + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + return apiRequest("post", "/@relations", options); +} + +// src/restapi/relations/fix.ts +import { z as z60 } from "zod"; +var fixRelationsArgsSchema = z60.object({ + data: fixRelationsDataSchema.optional() +}); +async function fixRelations({ data }) { + const validatedArgs = fixRelationsArgsSchema.parse({ + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + return apiRequest("post", "@relations/rebuild", options); +} + +// src/restapi/relations/delete.ts +import { z as z61 } from "zod"; +var deleteRelationsArgsSchema = z61.object({ + data: deleteRelationsDataSchema +}); +async function deleteRelations({ data }) { + const validatedArgs = deleteRelationsArgsSchema.parse({ + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + return apiRequest("delete", "/@relations", options); +} + +// src/restapi/roles/get.ts +async function getRoles() { + const options = { + config: this.config, + params: {} + }; + return apiRequest("get", "/@roles", options); +} + +// src/restapi/rules/get.ts +async function getRules() { + const options = { + config: this.config, + params: {} + }; + return apiRequest("get", "/@content-rules", options); +} + +// src/restapi/rules/create.ts +import { z as z62 } from "zod"; +var createRuleArgsSchema = z62.object({ + ruleId: z62.string() +}); +async function createRule({ ruleId }) { + const validatedArgs = createRuleArgsSchema.parse({ + ruleId + }); + const options = { + config: this.config + }; + const addRulePath = `/@content-rules/${validatedArgs.ruleId}`; + return apiRequest("post", addRulePath, options); +} + +// src/restapi/rules/update.ts +import { z as z64 } from "zod"; + +// src/validation/rules.ts +import { z as z63 } from "zod"; +var updateRulesDataSchema = z63.object({ + "form.button.Bubble": z63.boolean().optional(), + "form.button.NoBubble": z63.boolean().optional(), + "form.button.Enable": z63.boolean().optional(), + "form.button.Disable": z63.boolean().optional(), + rules_ids: z63.array(z63.string()).optional(), + operation: z63.string().optional(), + rule_id: z63.string().optional() +}); +var deleteRulesDataSchema = z63.object({ + rules_ids: z63.array(z63.string()) +}); + +// src/restapi/rules/update.ts +var updateRulesArgsSchema = z64.object({ + data: updateRulesDataSchema +}); +async function updateRules({ data }) { + const validatedArgs = updateRulesArgsSchema.parse({ + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + return apiRequest("patch", "/@content-rules", options); +} + +// src/restapi/rules/delete.ts +import { z as z65 } from "zod"; +var deleteRulesArgsSchema = z65.object({ + data: deleteRulesDataSchema +}); +async function deleteRules({ data }) { + const validatedArgs = deleteRulesArgsSchema.parse({ + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + const deleteRulesPath = `/@content-rules`; + return apiRequest("delete", deleteRulesPath, options); +} + +// src/restapi/search/get.ts +import "zod"; + +// src/validation/search.ts +import { z as z66 } from "zod"; +var querySchema = z66.object({ + path: z66.object({ + query: z66.union([z66.string(), z66.array(z66.string())]), + depth: z66.number().optional() + }).optional(), + sort_on: z66.union([z66.string(), z66.array(z66.string())]).optional(), + SearchableText: z66.string().optional(), + metadata_fields: z66.union([z66.string(), z66.array(z66.string())]).optional(), + fullobjects: z66.number().optional() +}).and(z66.record(z66.any())); +var searchSchema = z66.object({ + query: querySchema +}); + +// src/restapi/search/get.ts +var flattenToDottedNotation = (obj, prefix = "") => { + const result = {}; + for (const key of Object.keys(obj)) { + const value = obj[key]; + const newKey = prefix ? `${prefix}.${key}` : key; + if (typeof value === "object" && !Array.isArray(value) && value !== null) { + Object.assign(result, flattenToDottedNotation(value, newKey)); + } else { + result[newKey] = value; + } + } + return result; +}; +async function search({ query: query2 }) { + const validatedArgs = searchSchema.parse({ + query: query2 + }); + const flattenedQuery = flattenToDottedNotation(validatedArgs.query); + const options = { + config: this.config, + params: { + ...flattenedQuery, + "path.query": void 0 + } + }; + return apiRequest("get", `${query2.path?.query ?? ""}/@search`, options); +} + +// src/restapi/site/get.ts +async function getSite() { + const options = { + config: this.config, + params: {} + }; + return apiRequest("get", "/@site", options); +} + +// src/restapi/sources/get.ts +import { z as z68 } from "zod"; +var getSourceSchema = z68.object({ + path: z68.string(), + field: z68.string() +}); +async function getSource({ path, field }) { + const validatedArgs = getSourceSchema.parse({ + path, + field + }); + const options = { + config: this.config + }; + const sourcePath = `/${validatedArgs.path}/@sources/${field}`; + return apiRequest("get", sourcePath, options); +} + +// src/restapi/system/get.ts +async function getSystem() { + const options = { + config: this.config, + params: {} + }; + return apiRequest("get", "/@system", options); +} + +// src/restapi/transactions/get.ts +async function getTransactions() { + const options = { + config: this.config, + params: {} + }; + return apiRequest("get", "/@transactions", options); +} + +// src/restapi/transactions/revert.ts +import { z as z70 } from "zod"; + +// src/validation/transactions.ts +import { z as z69 } from "zod"; +var revertTransactionsDataSchema = z69.object({ + transaction_ids: z69.array(z69.string()) +}); + +// src/restapi/transactions/revert.ts +var revertTransactionsArgsSchema = z70.object({ + data: revertTransactionsDataSchema +}); +async function revertTransactions({ data }) { + const validatedArgs = revertTransactionsArgsSchema.parse({ + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + return apiRequest("patch", "/@transactions", options); +} + +// src/restapi/translations/get.ts +import { z as z71 } from "zod"; +var getTranslationSchema = z71.object({ + path: z71.string() +}); +async function getTranslation({ path }) { + const validatedArgs = getTranslationSchema.parse({ + path + }); + const options = { + config: this.config, + params: {} + }; + const translationsPath = `${validatedArgs.path}/@translations`; + return apiRequest("get", translationsPath, options); +} + +// src/restapi/translations/link.ts +import { z as z73 } from "zod"; + +// src/validation/translations.ts +import { z as z72 } from "zod"; +var linkTranslationDataSchema = z72.object({ + id: z72.string() +}); +var unlinkTranslationDataSchema = z72.object({ + language: z72.string() +}); + +// src/restapi/translations/link.ts +var linkTranslationArgsSchema = z73.object({ + path: z73.string(), + data: linkTranslationDataSchema +}); +async function linkTranslation({ path, data }) { + const validatedArgs = linkTranslationArgsSchema.parse({ + path, + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + const translationsPath = `${validatedArgs.path}/@translations`; + return apiRequest("post", translationsPath, options); +} + +// src/restapi/translations/unlink.ts +import { z as z74 } from "zod"; +var unlinkTranslationArgsSchema = z74.object({ + path: z74.string(), + data: unlinkTranslationDataSchema +}); +async function unlinkTranslation({ path, data }) { + const validatedArgs = unlinkTranslationArgsSchema.parse({ + path, + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + const translationsPath = `${validatedArgs.path}/@translations`; + return apiRequest("delete", translationsPath, options); +} + +// src/restapi/types/get_list.ts +async function getTypes() { + const options = { + config: this.config, + params: {} + }; + return apiRequest("get", "/@types", options); +} + +// src/restapi/types/get.ts +import { z as z75 } from "zod"; +var getTypeSchema = z75.object({ + type: z75.string() +}); +async function getType({ type }) { + const validatedArgs = getTypeSchema.parse({ + type + }); + const options = { + config: this.config, + params: {} + }; + const contentPathPath = `/@types/${validatedArgs.type}`; + return apiRequest("get", contentPathPath, options); +} + +// src/restapi/types/get_type_field.ts +import { z as z76 } from "zod"; +var getTypeFieldSchema = z76.object({ + contentFieldPath: z76.string() +}); +async function getTypeField({ contentFieldPath }) { + const validatedArgs = getTypeFieldSchema.parse({ + contentFieldPath + }); + const options = { + config: this.config, + params: {} + }; + const contentFieldPathPath = `/@types/${validatedArgs.contentFieldPath}`; + return apiRequest("get", contentFieldPathPath, options); +} + +// src/restapi/types/create_type_field.ts +import { z as z78 } from "zod"; + +// src/validation/types.ts +import { z as z77 } from "zod"; +var createTypeFieldDataSchema = z77.object({ + description: z77.string(), + factory: z77.string(), + required: z77.boolean().optional(), + title: z77.string() +}); +var updateTypeFieldDataSchema = z77.object({ + description: z77.string().optional(), + maxLength: z77.number().optional(), + minLength: z77.number().optional(), + fields: z77.array(z77.string()).optional(), + required: z77.boolean().optional(), + title: z77.string().optional(), + properties: z77.any().optional(), + fieldsets: z77.array(z77.any()).optional() +}); + +// src/restapi/types/create_type_field.ts +var createTypeFieldArgsSchema = z78.object({ + contentPath: z78.string(), + data: createTypeFieldDataSchema +}); +async function createTypeField({ contentPath, data }) { + const validatedArgs = createTypeFieldArgsSchema.parse({ + contentPath, + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + const addTypeFieldPath = `/@types/${validatedArgs.contentPath}`; + return apiRequest("post", addTypeFieldPath, options); +} + +// src/restapi/types/update_type_field.ts +import { z as z79 } from "zod"; +var updateTypeFieldArgsSchema = z79.object({ + contentPath: z79.string(), + data: updateTypeFieldDataSchema +}); +async function updateTypeField({ contentPath, data }) { + const validatedArgs = updateTypeFieldArgsSchema.parse({ + contentPath, + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + const updateTypeFieldPath = `/@types/${validatedArgs.contentPath}`; + return apiRequest("patch", updateTypeFieldPath, options); +} + +// src/restapi/upgrade/get.ts +async function getUpgrade() { + const options = { + config: this.config, + params: {} + }; + return apiRequest("get", "/@upgrade", options); +} + +// src/restapi/upgrade/run.ts +import { z as z81 } from "zod"; + +// src/validation/upgrade.ts +import { z as z80 } from "zod"; +var runUpgradeDataSchema = z80.object({ + dry_run: z80.boolean() +}); + +// src/restapi/upgrade/run.ts +var runUpgradeArgsSchema = z81.object({ + data: runUpgradeDataSchema +}); +async function runUpgrade({ data }) { + const validatedArgs = runUpgradeArgsSchema.parse({ + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + return apiRequest("post", "/@upgrade", options); +} + +// src/restapi/users/get_list.ts +import { z as z82 } from "zod"; +var getUsersSchema = z82.object({ + query: z82.string().optional(), + groupsFilter: z82.array(z82.string()).optional(), + search: z82.string().optional(), + limit: z82.number().optional() +}); +async function getUsers({ query: query2, groupsFilter, search: search2, limit }) { + const validatedArgs = getUsersSchema.parse({ + query: query2, + groupsFilter, + search: search2, + limit + }); + const options = { + config: this.config, + params: { + ...validatedArgs.query && { query: validatedArgs.query }, + ...validatedArgs.groupsFilter && { + "groups-filter": validatedArgs.groupsFilter + }, + ...validatedArgs.limit && { limit: validatedArgs.limit }, + ...validatedArgs.search && { search: validatedArgs.search } + } + }; + return apiRequest("get", "/@users", options).then( + // Backwards compatibility for change in plone.restapi 10. + // The list of users is now inside the `items` property. + (response) => ({ ...response, data: response.data.items ?? response.data }) + ); +} + +// src/restapi/users/get.ts +import { z as z83 } from "zod"; +var getUserSchema = z83.object({ + id: z83.string() +}); +async function getUser({ id }) { + const validatedArgs = getUserSchema.parse({ + id + }); + const options = { + config: this.config, + params: {} + }; + const userName = `@users/${validatedArgs.id}`; + return apiRequest("get", userName, options); +} + +// src/restapi/users/create.ts +import { z as z85 } from "zod"; + +// src/validation/users.ts +import { z as z84 } from "zod"; +var createUserDataSchema = z84.object({ + description: z84.string().optional(), + email: z84.string().email(), + fullname: z84.string().optional(), + home_page: z84.string().url().optional(), + location: z84.string().optional(), + sendPasswordReset: z84.boolean().optional(), + username: z84.string(), + roles: z84.array(z84.string()).optional(), + password: z84.string().optional() +}); +var portraitSchema = z84.object({ + "content-type": z84.string(), + data: z84.string(), + encoding: z84.string(), + filename: z84.string(), + scale: z84.boolean().optional() +}); +var updateUserDataSchema = z84.object({ + description: z84.string().optional(), + email: z84.string().email().optional(), + fullname: z84.string().optional(), + home_page: z84.string().url().optional(), + location: z84.string().optional(), + username: z84.string().optional(), + portrait: portraitSchema.optional() +}); +var resetPasswordWithTokenDataSchema = z84.object({ + reset_token: z84.string(), + new_password: z84.string() +}); +var updatePasswordDataSchema = z84.object({ + new_password: z84.string(), + old_password: z84.string() +}); + +// src/restapi/users/create.ts +var createUserArgsSchema = z85.object({ + data: createUserDataSchema +}); +async function createUser({ data }) { + const validatedArgs = createUserArgsSchema.parse({ + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + return apiRequest("post", "/@users", options); +} + +// src/restapi/users/update.ts +import { z as z86 } from "zod"; +var updateUserArgsSchema = z86.object({ + id: z86.string(), + data: updateUserDataSchema +}); +async function updateUser({ id, data }) { + const validatedArgs = updateUserArgsSchema.parse({ + id, + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + const userName = `/@users/${validatedArgs.id}`; + return apiRequest("patch", userName, options); +} + +// src/restapi/users/delete.ts +import { z as z87 } from "zod"; +var deleteUserArgsSchema = z87.object({ + id: z87.string() +}); +async function deleteUser({ id }) { + const validatedArgs = deleteUserArgsSchema.parse({ + id + }); + const options = { + config: this.config + }; + const userName = `/@users/${validatedArgs.id}`; + return apiRequest("delete", userName, options); +} + +// src/restapi/users/reset_password.ts +import { z as z88 } from "zod"; +var resetPasswordArgsSchema = z88.object({ + id: z88.string() +}); +async function resetPassword({ id }) { + const validatedArgs = resetPasswordArgsSchema.parse({ + id + }); + const options = { + config: this.config + }; + const userName = `@users/${validatedArgs.id}/reset-password`; + return apiRequest("post", userName, options); +} + +// src/restapi/users/reset_password_with_token.ts +import { z as z89 } from "zod"; +var resetPasswordWithTokenArgsSchema = z89.object({ + id: z89.string(), + data: resetPasswordWithTokenDataSchema +}); +async function resetPasswordWithToken({ id, data }) { + const validatedArgs = resetPasswordWithTokenArgsSchema.parse({ + id, + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + const userName = `@users/${validatedArgs.id}/reset-password`; + return apiRequest("post", userName, options); +} + +// src/restapi/users/update_password.ts +import { z as z90 } from "zod"; +var updatePasswordArgsSchema = z90.object({ + id: z90.string(), + data: updatePasswordDataSchema +}); +async function updatePassword({ id, data }) { + const validatedArgs = updatePasswordArgsSchema.parse({ + id, + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + const userName = `@users/${validatedArgs.id}/reset-password`; + return apiRequest("post", userName, options); +} + +// src/restapi/userschema/get.ts +async function getUserschema() { + const options = { + config: this.config, + params: {} + }; + return apiRequest("get", "/@userschema", options); +} + +// src/restapi/vocabularies/get_list.ts +async function getVocabularies() { + const options = { + config: this.config, + params: {} + }; + return apiRequest("get", "/@vocabularies", options); +} + +// src/restapi/vocabularies/get.ts +import { z as z91 } from "zod"; +var getVocabularySchema = z91.object({ + path: z91.string(), + title: z91.string().optional(), + token: z91.string().optional(), + tokens: z91.array(z91.string()).optional() +}); +async function getVocabulary({ path, title, token, tokens }) { + const validatedArgs = getVocabularySchema.parse({ + path, + title, + token, + tokens + }); + const options = { + config: this.config, + params: { + ...validatedArgs.title && { title: validatedArgs.title }, + ...validatedArgs.token && { token: validatedArgs.token }, + ...validatedArgs.tokens && { tokens: validatedArgs.tokens } + } + }; + const vocabulariesPath = `@vocabularies/${validatedArgs.path}`; + return apiRequest("get", vocabulariesPath, options); +} + +// src/restapi/workflow/get.ts +import { z as z92 } from "zod"; +var getWorkflowSchema = z92.object({ + path: z92.string() +}); +async function getWorkflow({ path }) { + const validatedArgs = getWorkflowSchema.parse({ + path + }); + const options = { + config: this.config, + params: {} + }; + const workflowPath = `${validatedArgs.path}/@workflow`; + return apiRequest("get", workflowPath, options); +} + +// src/restapi/workflow/create.ts +import { z as z94 } from "zod"; + +// src/validation/workflow.ts +import { z as z93 } from "zod"; +var createWorkflowDataSchema = z93.object({ + comment: z93.string().optional(), + effective: z93.string().optional(), + expires: z93.string().optional(), + include_children: z93.boolean().optional() +}); + +// src/restapi/workflow/create.ts +var createWorkflowArgsSchema = z94.object({ + path: z94.string(), + data: createWorkflowDataSchema.optional() +}); +async function createWorkflow({ path, data }) { + const validatedArgs = createWorkflowArgsSchema.parse({ + path, + data + }); + const options = { + data: validatedArgs.data, + config: this.config + }; + const workflowPath = `${validatedArgs.path}/@workflow/publish`; + return apiRequest("post", workflowPath, options); +} + +// src/restapi/workingcopy/get.ts +import { z as z95 } from "zod"; +var getWorkingcopySchema = z95.object({ + path: z95.string() +}); +async function getWorkingcopy({ path }) { + const validatedArgs = getWorkingcopySchema.parse({ + path + }); + const options = { + config: this.config, + params: {} + }; + const workingcopyPath = `/${validatedArgs.path}/@workingcopy`; + return apiRequest("get", workingcopyPath, options); +} + +// src/restapi/workingcopy/create.ts +import { z as z96 } from "zod"; +var createWorkingcopyArgsSchema = z96.object({ + path: z96.string() +}); +async function createWorkingcopy({ path }) { + const validatedArgs = createWorkingcopyArgsSchema.parse({ + path + }); + const options = { + config: this.config + }; + const createWorkingcopyPath = `/${validatedArgs.path}/@workingcopy`; + return apiRequest("post", createWorkingcopyPath, options); +} + +// src/restapi/workingcopy/check-in.ts +import { z as z97 } from "zod"; +var checkInWorkingcopyArgsSchema = z97.object({ + path: z97.string() +}); +async function checkInWorkingcopy({ path }) { + const validatedArgs = checkInWorkingcopyArgsSchema.parse({ + path + }); + const options = { + config: this.config + }; + const checkInWorkingcopyPath = `/${validatedArgs.path}/@workingcopy`; + return apiRequest("patch", checkInWorkingcopyPath, options); +} + +// src/restapi/workingcopy/delete.ts +import { z as z98 } from "zod"; +var deleteWorkingcopyArgsSchema = z98.object({ + path: z98.string() +}); +async function deleteWorkingcopy({ path }) { + const validatedArgs = deleteWorkingcopyArgsSchema.parse({ + path + }); + const options = { + config: this.config + }; + const deleteWorkingcopyPath = `/${validatedArgs.path}/@workingcopy`; + return apiRequest("delete", deleteWorkingcopyPath, options); +} + +// src/client.ts +var PLONECLIENT_DEFAULT_CONFIG = { + apiPath: "http://localhost:8080/Plone" +}; +var PloneClient = class _PloneClient { + config = PLONECLIENT_DEFAULT_CONFIG; + static initialize = (config) => new _PloneClient({ ...PLONECLIENT_DEFAULT_CONFIG, ...config }); + constructor(config) { + this.config = config; + Object.values(this).forEach((propertyValue) => { + if (propertyValue instanceof Function) { + propertyValue = propertyValue.bind(this); + } + }); + } + getActions = getActions; + getAddons = getAddons; + getAddon = getAddon; + installAddon = installAddon; + uninstallAddon = uninstallAddon; + upgradeAddon = upgradeAddon; + installAddonProfile = installAddonProfile; + getAllAliases = getAllAliases; + getAliases = getAliases; + createAlias = createAlias; + createAliases = createAliases; + deleteAliases = deleteAliases; + getBreadcrumbs = getBreadcrumbs; + getComments = getComments; + createComment = createComment; + updateComment = updateComment; + deleteComment = deleteComment; + getContent = getContent; + createContent = createContent; + updateContent = updateContent; + deleteContent = deleteContent; + copyContent = copyContent; + moveContent = moveContent; + getContextNavigation = getContextNavigation; + getControlpanels = getControlpanels; + getControlpanel = getControlpanel; + createControlpanel = createControlpanel; + updateControlpanel = updateControlpanel; + deleteControlpanel = deleteControlpanel; + getDatabase = getDatabase; + emailNotification = emailNotification; + emailSend = emailSend; + getGroups = getGroups; + getGroup = getGroup; + createGroup = createGroup; + updateGroup = updateGroup; + deleteGroup = deleteGroup; + getHistory = getHistory; + getHistoryVersion = getHistoryVersion; + revertHistory = revertHistory; + getLinkintegrity = getLinkintegrity; + getLock = getLock; + createLock = createLock; + updateLock = updateLock; + deleteLock = deleteLock; + login = login; + getNavigation = getNavigation; + getNavroot = getNavroot; + getPrincipals = getPrincipals; + getQuerysources = getQuerysources; + getQuerystring = getQuerystring; + querystringSearch = querystringSearch; + getRegistry = getRegistry; + getRegistryRecord = getRegistryRecord; + updateRegistry = updateRegistry; + getAllRelations = getAllRelations; + getRelations = getRelations; + createRelations = createRelations; + fixRelations = fixRelations; + deleteRelations = deleteRelations; + getRoles = getRoles; + getRules = getRules; + createRule = createRule; + updateRules = updateRules; + deleteRules = deleteRules; + search = search; + getSite = getSite; + getSource = getSource; + getSystem = getSystem; + getTransactions = getTransactions; + revertTransactions = revertTransactions; + getTranslation = getTranslation; + linkTranslation = linkTranslation; + unlinkTranslation = unlinkTranslation; + getTypes = getTypes; + getType = getType; + getTypeField = getTypeField; + createTypeField = createTypeField; + updateTypeField = updateTypeField; + getUpgrade = getUpgrade; + runUpgrade = runUpgrade; + getUsers = getUsers; + getUser = getUser; + createUser = createUser; + updateUser = updateUser; + deleteUser = deleteUser; + resetPassword = resetPassword; + resetPasswordWithToken = resetPasswordWithToken; + updatePassword = updatePassword; + getUserschema = getUserschema; + getVocabularies = getVocabularies; + getVocabulary = getVocabulary; + getWorkflow = getWorkflow; + createWorkflow = createWorkflow; + getWorkingcopy = getWorkingcopy; + createWorkingcopy = createWorkingcopy; + checkInWorkingcopy = checkInWorkingcopy; + deleteWorkingcopy = deleteWorkingcopy; +}; + +// src/index.ts +var index_default = PloneClient; +export { + index_default as default +}; diff --git a/packages/helpers/dist/index.cjs b/packages/helpers/dist/index.cjs new file mode 100644 index 00000000000..08f0580d096 --- /dev/null +++ b/packages/helpers/dist/index.cjs @@ -0,0 +1,854 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var index_exports = {}; +__export(index_exports, { + InitAtoms: () => InitAtoms, + applyStyleFieldDefaultsInData: () => applyStyleFieldDefaultsInData, + findStyleDefinitionByName: () => findStyleDefinitionByName, + flattenToAppURL: () => flattenToAppURL, + getContentIcon: () => getContentIcon, + getStyleFieldDefinitionsFromRegistry: () => getStyleFieldDefinitionsFromRegistry, + getStyleFieldValue: () => getStyleFieldValue, + getStyleFieldsFromBlockSchema: () => getStyleFieldsFromBlockSchema, + getStyleFieldsFromSchema: () => getStyleFieldsFromSchema, + hasBlocksData: () => hasBlocksData, + isDeepEqual: () => isDeepEqual, + isEmpty: () => isEmpty, + isInternalURL: () => isInternalURL, + langmap: () => langmap, + resolveStyleFields: () => resolveStyleFields, + setStyleFieldValue: () => setStyleFieldValue, + useFieldFocusAtom: () => useFieldFocusAtom, + useFieldFocusedAtom: () => useFieldFocusedAtom, + useFieldValueFocusedAtom: () => useFieldValueFocusedAtom, + useSetFieldFocusedAtom: () => useSetFieldFocusedAtom +}); +module.exports = __toCommonJS(index_exports); + +// src/primitives.ts +var isEmpty = (obj) => (Array.isArray(obj) || obj instanceof Object) && !Object.entries(obj || {}).length; +function isDeepEqual(left, right) { + if (Object.is(left, right)) return true; + if (typeof left !== "object" || typeof right !== "object" || left === null || right === null) { + return false; + } + if (Array.isArray(left) || Array.isArray(right)) { + if (!Array.isArray(left) || !Array.isArray(right)) return false; + if (left.length !== right.length) return false; + for (let i = 0; i < left.length; i += 1) { + if (!isDeepEqual(left[i], right[i])) return false; + } + return true; + } + const leftEntries = Object.entries(left); + const rightEntries = Object.entries(right); + if (leftEntries.length !== rightEntries.length) return false; + for (const [key, value] of leftEntries) { + if (!(key in right)) return false; + if (!isDeepEqual(value, right[key])) { + return false; + } + } + return true; +} + +// src/atoms.ts +var import_react = require("react"); +var import_utils = require("jotai/utils"); +var import_jotai = require("jotai"); +var import_jotai_optics = require("jotai-optics"); +var InitAtoms = ({ + atomValues, + children +}) => { + (0, import_utils.useHydrateAtoms)(new Map(atomValues)); + return children; +}; +function useFieldFocusAtom(anAtom, field) { + return (0, import_jotai_optics.focusAtom)( + anAtom, + // @ts-expect-error https://github.com/jotaijs/jotai-optics/issues/6 + (0, import_react.useCallback)((optic) => optic.prop(field), [field]) + ); +} +function useFieldFocusedAtom(atom, field) { + return (0, import_jotai.useAtom)( + (0, import_jotai_optics.focusAtom)( + atom, + // @ts-expect-error https://github.com/jotaijs/jotai-optics/issues/6 + (0, import_react.useCallback)( + (optic) => optic.prop(field), + [field] + ) + ) + ); +} +function useSetFieldFocusedAtom(atom, field) { + return (0, import_jotai.useSetAtom)( + (0, import_jotai_optics.focusAtom)( + atom, + // @ts-expect-error https://github.com/jotaijs/jotai-optics/issues/6 + (0, import_react.useCallback)( + (optic) => optic.prop(field), + [field] + ) + ) + ); +} +function useFieldValueFocusedAtom(atom, field) { + return (0, import_jotai.useAtomValue)( + (0, import_jotai_optics.focusAtom)( + atom, + // @ts-expect-error https://github.com/jotaijs/jotai-optics/issues/6 + (0, import_react.useCallback)( + (optic) => optic.prop(field), + [field] + ) + ) + ); +} + +// src/blocks.ts +function hasBlocksData(content) { + return Object.keys(content).find( + (key) => key !== "volto.blocks" && key.endsWith("blocks") + ) !== void 0; +} + +// src/contents.ts +var import_registry = __toESM(require("@plone/registry"), 1); +var getContentIcon = (contentType, isFolderish = false) => { + const { settings } = import_registry.default; + const { contentIcons = {} } = settings; + let icon = isFolderish ? contentIcons.Folder : contentIcons.File; + if (contentType in contentIcons) icon = contentIcons[contentType]; + return icon; +}; + +// src/flattenToAppURL.ts +var import_registry2 = __toESM(require("@plone/registry"), 1); +function flattenToAppURL(data) { + let stringData = JSON.stringify(data); + stringData = stringData.replaceAll(`${import_registry2.default.settings.apiPath}/`, "/"); + stringData = stringData.replaceAll(import_registry2.default.settings.apiPath, "/"); + return JSON.parse(stringData); +} + +// src/isInternalURL.ts +var import_registry3 = __toESM(require("@plone/registry"), 1); +function isInternalURL(url) { + if (!url) return false; + if (url.startsWith("/") || url.startsWith(".") || url.startsWith("#")) { + return true; + } + const settings = import_registry3.default.settings ?? {}; + const apiPath = settings.apiPath; + if (apiPath) { + try { + const urlOrigin = new URL(url).origin; + const apiOrigin = new URL(apiPath).origin; + return urlOrigin === apiOrigin; + } catch { + return false; + } + } + return false; +} + +// src/languageMap.ts +var langmap = new Proxy( + { + aa: { nativeName: "\u043C\u0430\u0433I\u0430\u0440\u0443\u043B \u043C\u0430\u0446I", englishName: "Afar" }, + ab: { nativeName: "\u0431\u044B\u0437\u0448\u04D9\u0430", englishName: "Abkhazian" }, + ach: { nativeName: "Lwo", englishName: "Acholi" }, + ady: { nativeName: "\u0410\u0434\u044B\u0433\u044D\u0431\u0437\u044D", englishName: "Adyghe" }, + ae: { nativeName: "avesta", englishName: "Avestan" }, + af: { nativeName: "Afrikaans", englishName: "Afrikaans" }, + "af-NA": { + nativeName: "Afrikaans (Namibia)", + englishName: "Afrikaans (Namibia)" + }, + "af-ZA": { + nativeName: "Afrikaans (South Africa)", + englishName: "Afrikaans (South Africa)" + }, + ak: { nativeName: "T\u0255\u0265i", englishName: "Akan" }, + am: { nativeName: "\u12A0\u121B\u122D\u129B", englishName: "Amharic" }, + an: { nativeName: "aragon\xE9s", englishName: "Aragonese" }, + ar: { nativeName: "\u0627\u0644\u0639\u0631\u0628\u064A\u0629", englishName: "Arabic" }, + "ar-AR": { nativeName: "\u0627\u0644\u0639\u0631\u0628\u064A\u0629", englishName: "Arabic" }, + "ar-MA": { nativeName: "\u0627\u0644\u0639\u0631\u0628\u064A\u0629", englishName: "Arabic (Morocco)" }, + "ar-SA": { + nativeName: "\u0627\u0644\u0639\u0631\u0628\u064A\u0629 (\u0627\u0644\u0633\u0639\u0648\u062F\u064A\u0629)", + englishName: "Arabic (Saudi Arabia)" + }, + as: { nativeName: "\u0985\u09B8\u09AE\u09BF\u09DF\u09BE", englishName: "Assamese" }, + ay: { nativeName: "Aymara", englishName: "Aymara" }, + "ay-BO": { nativeName: "Aymar aru", englishName: "Aymara" }, + az: { nativeName: "Az\u0259rbaycan dili", englishName: "Azerbaijani" }, + "az-AZ": { nativeName: "Az\u0259rbaycan dili", englishName: "Azerbaijani" }, + ba: { nativeName: "Bashkir", englishName: "Bashkir" }, + "be-BY": { nativeName: "\u0411\u0435\u043B\u0430\u0440\u0443\u0441\u043A\u0430\u044F", englishName: "Belarusian" }, + bg: { nativeName: "\u0411\u044A\u043B\u0433\u0430\u0440\u0441\u043A\u0438", englishName: "Bulgarian" }, + "bg-BG": { nativeName: "\u0411\u044A\u043B\u0433\u0430\u0440\u0441\u043A\u0438", englishName: "Bulgarian" }, + be: { nativeName: "\u0411\u0435\u043B\u0430\u0440\u0443\u0441\u043A\u0456", englishName: "Belarussian" }, + bh: { nativeName: "Bihari", englishName: "Bihari" }, + bi: { nativeName: "Bislama", englishName: "Bislama" }, + bm: { nativeName: "bamanankan", englishName: "Bambara" }, + bn: { nativeName: "\u09AC\u09BE\u0982\u09B2\u09BE", englishName: "Bengali" }, + "bn-IN": { nativeName: "\u09AC\u09BE\u0982\u09B2\u09BE (\u09AD\u09BE\u09B0\u09A4)", englishName: "Bengali (India)" }, + "bn-BD": { + nativeName: "\u09AC\u09BE\u0982\u09B2\u09BE(\u09AC\u09BE\u0982\u09B2\u09BE\u09A6\u09C7\u09B6)", + englishName: "Bengali (Bangladesh)" + }, + bo: { nativeName: "\u0F56\u0F7C\u0F51\u0F0B\u0F66\u0F90\u0F51\u0F0B", englishName: "Tibetan" }, + br: { nativeName: "Brezhoneg", englishName: "Breton" }, + bs: { nativeName: "Bosanski", englishName: "Bosnian" }, + "bs-BA": { nativeName: "Bosanski", englishName: "Bosnian" }, + ca: { nativeName: "Catal\xE0", englishName: "Catalan" }, + "ca-ES": { nativeName: "Catal\xE0", englishName: "Catalan" }, + cak: { nativeName: "Maya Kaqchikel", englishName: "Kaqchikel" }, + "ck-US": { nativeName: "\u13E3\u13B3\u13A9 (tsalagi)", englishName: "Cherokee" }, + ce: { nativeName: "\u043D\u043E\u0445\u0447\u0438\u0439\u043D \u043C\u043E\u0442\u0442", englishName: "Chechen" }, + ch: { nativeName: "Chamoru", englishName: "Chamorro" }, + co: { nativeName: "Corsu", englishName: "Corsican" }, + cr: { nativeName: "\u14C0\u1426\u1403\u152D\u140D\u140F\u1423", englishName: "Cree" }, + cs: { nativeName: "\u010Ce\u0161tina", englishName: "Czech" }, + "cs-CZ": { nativeName: "\u010Ce\u0161tina", englishName: "Czech" }, + cu: { nativeName: "\u0469\u0437\u044B\u043A\u044A \u0441\u043B\u043E\u0432\u0463\u043D\u044C\u0441\u043A\u044A", englishName: "Old Church Slavonic" }, + cv: { nativeName: "\u0447\u04D1\u0432\u0430\u0448 \u0447\u04D7\u043B\u0445\u0438", englishName: "Chuvash" }, + cy: { nativeName: "Cymraeg", englishName: "Welsh" }, + "cy-GB": { nativeName: "Cymraeg", englishName: "Welsh" }, + da: { nativeName: "Dansk", englishName: "Danish" }, + "da-DK": { nativeName: "Dansk", englishName: "Danish" }, + de: { nativeName: "Deutsch", englishName: "German" }, + "de-AT": { + nativeName: "Deutsch (\xD6sterreich)", + englishName: "German (Austria)" + }, + "de-DE": { + nativeName: "Deutsch (Deutschland)", + englishName: "German (Germany)" + }, + "de-CH": { + nativeName: "Deutsch (Schweiz)", + englishName: "German (Switzerland)" + }, + dsb: { nativeName: "Dolnoserb\u0161\u0107ina", englishName: "Lower Sorbian" }, + dv: { nativeName: "Divehi", englishName: "Maldivian" }, + dz: { nativeName: "Bhutani", englishName: "Indian Bhutani" }, + ee: { nativeName: "E\u028Begbe", englishName: "Ewe" }, + el: { nativeName: "\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC", englishName: "Greek" }, + "el-GR": { nativeName: "\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC", englishName: "Greek (Greece)" }, + en: { nativeName: "English", englishName: "English" }, + "en-GB": { nativeName: "English (UK)", englishName: "English (UK)" }, + "en-AU": { + nativeName: "English (Australia)", + englishName: "English (Australia)" + }, + "en-CA": { + nativeName: "English (Canada)", + englishName: "English (Canada)" + }, + "en-IE": { + nativeName: "English (Ireland)", + englishName: "English (Ireland)" + }, + "en-IN": { nativeName: "English (India)", englishName: "English (India)" }, + "en-PI": { + nativeName: "English (Pirate)", + englishName: "English (Pirate)" + }, + "en-UD": { + nativeName: "English (Upside Down)", + englishName: "English (Upside Down)" + }, + "en-US": { nativeName: "English (US)", englishName: "English (US)" }, + "en-ZA": { + nativeName: "English (South Africa)", + englishName: "English (South Africa)" + }, + "en@pirate": { + nativeName: "English (Pirate)", + englishName: "English (Pirate)" + }, + eo: { nativeName: "Esperanto", englishName: "Esperanto" }, + "eo-EO": { nativeName: "Esperanto", englishName: "Esperanto" }, + es: { nativeName: "Espa\xF1ol", englishName: "Spanish" }, + "es-AR": { + nativeName: "Espa\xF1ol (Argentine)", + englishName: "Spanish (Argentina)" + }, + "es-419": { + nativeName: "Espa\xF1ol (Latinoam\xE9rica)", + englishName: "Spanish (Latin America)" + }, + "es-CL": { nativeName: "Espa\xF1ol (Chile)", englishName: "Spanish (Chile)" }, + "es-CO": { + nativeName: "Espa\xF1ol (Colombia)", + englishName: "Spanish (Colombia)" + }, + "es-EC": { + nativeName: "Espa\xF1ol (Ecuador)", + englishName: "Spanish (Ecuador)" + }, + "es-ES": { nativeName: "Espa\xF1ol (Espa\xF1a)", englishName: "Spanish (Spain)" }, + "es-LA": { + nativeName: "Espa\xF1ol (Latinoam\xE9rica)", + englishName: "Spanish (Latin America)" + }, + "es-NI": { + nativeName: "Espa\xF1ol (Nicaragua)", + englishName: "Spanish (Nicaragua)" + }, + "es-MX": { + nativeName: "Espa\xF1ol (M\xE9xico)", + englishName: "Spanish (Mexico)" + }, + "es-US": { + nativeName: "Espa\xF1ol (Estados Unidos)", + englishName: "Spanish (United States)" + }, + "es-VE": { + nativeName: "Espa\xF1ol (Venezuela)", + englishName: "Spanish (Venezuela)" + }, + "et-EE": { + nativeName: "Eesti (Estonia)", + englishName: "Estonian (Estonia)" + }, + eu: { nativeName: "Euskara", englishName: "Basque" }, + "eu-ES": { nativeName: "Euskara", englishName: "Basque" }, + fa: { nativeName: "\u0641\u0627\u0631\u0633\u06CC", englishName: "Persian" }, + "fa-IR": { nativeName: "\u0641\u0627\u0631\u0633\u06CC", englishName: "Persian" }, + "fb-LT": { nativeName: "Leet Speak", englishName: "Leet" }, + ff: { nativeName: "Fulah", englishName: "Fulah" }, + fi: { nativeName: "Suomi", englishName: "Finnish" }, + "fi-FI": { nativeName: "Suomi", englishName: "Finnish" }, + fj: { nativeName: "Fiji", englishName: "Fiji" }, + fo: { nativeName: "F\xF8royska", englishName: "Faroese" }, + "fo-FO": { nativeName: "F\xF8royskt", englishName: "Faroese" }, + fr: { nativeName: "Fran\xE7ais", englishName: "French" }, + "fr-CA": { + nativeName: "Fran\xE7ais (Canada)", + englishName: "French (Canada)" + }, + "fr-FR": { + nativeName: "Fran\xE7ais (France)", + englishName: "French (France)" + }, + "fr-BE": { + nativeName: "Fran\xE7ais (Belgique)", + englishName: "French (Belgium)" + }, + "fr-CH": { + nativeName: "Fran\xE7ais (Suisse)", + englishName: "French (Switzerland)" + }, + fy: { nativeName: "Frysk", englishName: "Frisian" }, + "fy-NL": { nativeName: "Frysk", englishName: "Frisian (West)" }, + ga: { nativeName: "Gaeilge", englishName: "Irish" }, + "ga-IE": { nativeName: "Gaeilge", englishName: "Irish" }, + gd: { nativeName: "G\xE0idhlig", englishName: "Gaelic" }, + gl: { nativeName: "Galego", englishName: "Galician" }, + "gl-ES": { nativeName: "Galego", englishName: "Galician" }, + gn: { nativeName: "Guarani", englishName: "Guarani" }, + "gn-PY": { nativeName: "Ava\xF1e'\u1EBD", englishName: "Guarani" }, + gu: { nativeName: "\u0A97\u0AC1\u0A9C\u0AB0\u0ABE\u0AA4\u0AC0", englishName: "Gujarati" }, + "gu-IN": { nativeName: "\u0A97\u0AC1\u0A9C\u0AB0\u0ABE\u0AA4\u0AC0", englishName: "Gujarati" }, + gv: { nativeName: "Gaelg", englishName: "Manx" }, + "gx-GR": { nativeName: "\u1F19\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AE \u1F00\u03C1\u03C7\u03B1\u03AF\u03B1", englishName: "Classical Greek" }, + ha: { nativeName: "\u0647\u064E\u0648\u064F\u0633", englishName: "Hausa" }, + he: { nativeName: "\u05E2\u05D1\u05E8\u05D9\u05EA\u200F", englishName: "Hebrew" }, + "he-IL": { nativeName: "\u05E2\u05D1\u05E8\u05D9\u05EA\u200F", englishName: "Hebrew" }, + hi: { nativeName: "\u0939\u093F\u0928\u094D\u0926\u0940", englishName: "Hindi" }, + "hi-IN": { nativeName: "\u0939\u093F\u0928\u094D\u0926\u0940", englishName: "Hindi" }, + ho: { nativeName: "Hiri Motu", englishName: "Hiri Motu" }, + hr: { nativeName: "Hrvatski", englishName: "Croatian" }, + "hr-HR": { nativeName: "Hrvatski", englishName: "Croatian" }, + hsb: { nativeName: "Hornjoserb\u0161\u0107ina", englishName: "Upper Sorbian" }, + ht: { nativeName: "Krey\xF2l", englishName: "Haitian Creole" }, + hu: { nativeName: "Magyar", englishName: "Hungarian" }, + "hu-HU": { nativeName: "Magyar", englishName: "Hungarian" }, + hy: { nativeName: "\u0540\u0561\u0575\u0565\u0580\u0567\u0576", englishName: "Armenian" }, + "hy-AM": { nativeName: "\u0540\u0561\u0575\u0565\u0580\u0565\u0576", englishName: "Armenian" }, + hz: { nativeName: "Otjiherero", englishName: "Herero" }, + ia: { nativeName: "Interlingua", englishName: "Interlingua" }, + id: { nativeName: "Bahasa Indonesia", englishName: "Indonesian" }, + "id-ID": { nativeName: "Bahasa Indonesia", englishName: "Indonesian" }, + ie: { nativeName: "Interlingue", englishName: "Interlingue" }, + ig: { nativeName: "As\u1EE5s\u1EE5 Igbo", englishName: "Igbo" }, + ii: { nativeName: "Nuosu", englishName: "Nuosu" }, + ik: { nativeName: "I\xF1upiaq", englishName: "Inupiak" }, + io: { nativeName: "Ido", englishName: "Ido" }, + is: { nativeName: "\xCDslenska", englishName: "Icelandic" }, + "is-IS": { + nativeName: "\xCDslenska (Iceland)", + englishName: "Icelandic (Iceland)" + }, + it: { nativeName: "Italiano", englishName: "Italian" }, + "it-IT": { nativeName: "Italiano", englishName: "Italian" }, + iu: { nativeName: "\u1403\u14C4\u1483\u144E\u1450\u1466", englishName: "Inuktitut" }, + ja: { nativeName: "\u65E5\u672C\u8A9E", englishName: "Japanese" }, + "ja-JP": { nativeName: "\u65E5\u672C\u8A9E (\u65E5\u672C)", englishName: "Japanese (Japan)" }, + jv: { nativeName: "Javanese", englishName: "basa Jawa" }, + "jv-ID": { nativeName: "Basa Jawa", englishName: "Javanese" }, + ka: { nativeName: "\u10E5\u10D0\u10E0\u10D7\u10E3\u10DA\u10D8", englishName: "Georgian" }, + "ka-GE": { nativeName: "\u10E5\u10D0\u10E0\u10D7\u10E3\u10DA\u10D8", englishName: "Georgian" }, + kab: { nativeName: "Taqbaylit", englishName: "Kabyle" }, + kg: { nativeName: "KiKongo", englishName: "Kongo" }, + ki: { nativeName: "G\u0129k\u0169y\u0169", englishName: "Kikuyu" }, + kj: { nativeName: "Kuanyama", englishName: "Kwanyama" }, + kk: { nativeName: "\uFED7\uFE8E\uFEAF\uFE8D\uFED7\uFEB8\uFE8E", englishName: "Kazakh" }, + "kk-KZ": { nativeName: "\u049A\u0430\u0437\u0430\u049B\u0448\u0430", englishName: "Kazakh" }, + kl: { nativeName: "Greenlandic", englishName: "Greenlandic" }, + km: { nativeName: "\u1797\u17B6\u179F\u17B6\u1781\u17D2\u1798\u17C2\u179A", englishName: "Khmer" }, + "km-KH": { nativeName: "\u1797\u17B6\u179F\u17B6\u1781\u17D2\u1798\u17C2\u179A", englishName: "Khmer" }, + kn: { nativeName: "\u0C95\u0CA8\u0CCD\u0CA8\u0CA1", englishName: "Kannada" }, + "kn-IN": { nativeName: "\u0C95\u0CA8\u0CCD\u0CA8\u0CA1 (India)", englishName: "Kannada (India)" }, + ko: { nativeName: "\uD55C\uAD6D\uC5B4", englishName: "Korean" }, + "ko-KR": { nativeName: "\uD55C\uAD6D\uC5B4 (\uD55C\uAD6D)", englishName: "Korean (Korea)" }, + kr: { nativeName: "Kanuri", englishName: "Kanuri" }, + ks: { nativeName: "\u0915\u093E\u093D\u0936\u0941\u0930", englishName: "Kashmiri" }, + ku: { nativeName: "Kurd\xED", englishName: "Kurdish" }, + "ku-TR": { nativeName: "Kurd\xEE", englishName: "Kurdish" }, + kv: { nativeName: "\u043A\u043E\u043C\u0438 \u043A\u044B\u0432", englishName: "Komi" }, + kw: { nativeName: "Kernewek", englishName: "Cornish" }, + ky: { nativeName: "\u041A\u044B\u0440\u0433\u044B\u0437", englishName: "Kirghiz" }, + la: { nativeName: "Latin", englishName: "Latin" }, + "la-VA": { nativeName: "Latin", englishName: "Latin" }, + lb: { nativeName: "L\xEBtzebuergesch", englishName: "Luxembourgish" }, + lg: { nativeName: "Luganda", englishName: "Ganda" }, + li: { nativeName: "Limburgs", englishName: "Limburgish" }, + "li-NL": { nativeName: "L\xE8mb\xF6rgs", englishName: "Limburgish" }, + ln: { nativeName: "Lingala", englishName: "Lingala" }, + lo: { nativeName: "\u0E9E\u0EB2\u0EAA\u0EB2\u0EA5\u0EB2\u0EA7", englishName: "Laotian" }, + lt: { nativeName: "Lietuvi\u0173", englishName: "Lithuanian" }, + "lt-LT": { nativeName: "Lietuvi\u0173", englishName: "Lithuanian" }, + lu: { nativeName: "Tshiluba", englishName: "Luba-Katanga" }, + lv: { nativeName: "Latvie\u0161u", englishName: "Latvian" }, + "lv-LV": { nativeName: "Latvie\u0161u", englishName: "Latvian" }, + mai: { nativeName: "\u092E\u0948\u0925\u093F\u0932\u0940, \u09AE\u09C8\u09A5\u09BF\u09B2\u09C0", englishName: "Maithili" }, + mg: { nativeName: "Malagasy", englishName: "Madagascarian" }, + "mg-MG": { nativeName: "Malagasy", englishName: "Malagasy" }, + mh: { nativeName: "Kajin M\u0327aje\u013C", englishName: "Marshallese" }, + mi: { nativeName: "Maori", englishName: "Maori" }, + mk: { nativeName: "\u041C\u0430\u043A\u0435\u0434\u043E\u043D\u0441\u043A\u0438", englishName: "Macedonian" }, + "mk-MK": { + nativeName: "\u041C\u0430\u043A\u0435\u0434\u043E\u043D\u0441\u043A\u0438 (\u041C\u0430\u043A\u0435\u0434\u043E\u043D\u0441\u043A\u0438)", + englishName: "Macedonian (Macedonian)" + }, + ml: { nativeName: "\u0D2E\u0D32\u0D2F\u0D3E\u0D33\u0D02", englishName: "Malayalam" }, + "ml-IN": { nativeName: "\u0D2E\u0D32\u0D2F\u0D3E\u0D33\u0D02", englishName: "Malayalam" }, + mn: { nativeName: "\u041C\u043E\u043D\u0433\u043E\u043B", englishName: "Mongolian" }, + "mn-MN": { nativeName: "\u041C\u043E\u043D\u0433\u043E\u043B", englishName: "Mongolian" }, + mo: { nativeName: "Moldavian", englishName: "Moldavian" }, + mr: { nativeName: "\u092E\u0930\u093E\u0920\u0940", englishName: "Marathi" }, + "mr-IN": { nativeName: "\u092E\u0930\u093E\u0920\u0940", englishName: "Marathi" }, + ms: { nativeName: "Bahasa Melayu", englishName: "Malay" }, + "ms-MY": { nativeName: "Bahasa Melayu", englishName: "Malay" }, + mt: { nativeName: "Malti", englishName: "Maltese" }, + "mt-MT": { nativeName: "Malti", englishName: "Maltese" }, + my: { nativeName: "\u1017\u1019\u102C\u1005\u1000\u102C", englishName: "Burmese" }, + na: { nativeName: "Nauru", englishName: "Nauruan" }, + nb: { nativeName: "Norsk (bokm\xE5l)", englishName: "Norwegian (bokmal)" }, + "nb-NO": { + nativeName: "Norsk (bokm\xE5l)", + englishName: "Norwegian (bokmal)" + }, + nd: { nativeName: "Ndebele (North)", englishName: "Ndebele (North)" }, + ne: { nativeName: "\u0928\u0947\u092A\u093E\u0932\u0940", englishName: "Nepali" }, + "ne-NP": { nativeName: "\u0928\u0947\u092A\u093E\u0932\u0940", englishName: "Nepali" }, + ng: { nativeName: "Owambo", englishName: "Ndonga" }, + nl: { nativeName: "Nederlands", englishName: "Dutch" }, + "nl-BE": { + nativeName: "Nederlands (Belgi\xEB)", + englishName: "Dutch (Belgium)" + }, + "nl-NL": { + nativeName: "Nederlands (Nederland)", + englishName: "Dutch (Netherlands)" + }, + nn: { nativeName: "Nynorsk", englishName: "Nynorsk" }, + "nn-NO": { + nativeName: "Norsk (nynorsk)", + englishName: "Norwegian (nynorsk)" + }, + no: { nativeName: "Norsk", englishName: "Norwegian" }, + nr: { nativeName: "IsiNdebele", englishName: "Ndebele (South)" }, + nv: { nativeName: "Din\xE9 bizaad", englishName: "Navajo" }, + ny: { nativeName: "chiChe\u0175a", englishName: "Chichewa" }, + oc: { nativeName: "Occitan", englishName: "Occitan" }, + oj: { nativeName: "\u140A\u14C2\u1511\u14C8\u142F\u14A7\u140E\u14D0", englishName: "Ojibwe" }, + om: { nativeName: "Oromo", englishName: "Oromo" }, + or: { nativeName: "\u0B13\u0B5C\u0B3F\u0B06", englishName: "Oriya" }, + "or-IN": { nativeName: "\u0B13\u0B21\u0B3C\u0B3F\u0B06", englishName: "Oriya" }, + os: { nativeName: "\u0438\u0440\u043E\u043D \xE6\u0432\u0437\u0430\u0433", englishName: "Ossetian" }, + pa: { nativeName: "\u0A2A\u0A70\u0A1C\u0A3E\u0A2C\u0A40", englishName: "Punjabi" }, + "pa-IN": { + nativeName: "\u0A2A\u0A70\u0A1C\u0A3E\u0A2C\u0A40 (\u0A2D\u0A3E\u0A30\u0A24 \u0A28\u0A42\u0A70)", + englishName: "Punjabi (India)" + }, + pi: { nativeName: "\u092A\u093E\u0934\u093F", englishName: "P\u0101li" }, + pl: { nativeName: "Polski", englishName: "Polish" }, + "pl-PL": { nativeName: "Polski", englishName: "Polish" }, + ps: { nativeName: "\u067E\u069A\u062A\u0648", englishName: "Pashto" }, + "ps-AF": { nativeName: "\u067E\u069A\u062A\u0648", englishName: "Pashto" }, + pt: { nativeName: "Portugu\xEAs", englishName: "Portuguese" }, + "pt-BR": { + nativeName: "Portugu\xEAs (Brasil)", + englishName: "Portuguese (Brazil)" + }, + "pt-PT": { + nativeName: "Portugu\xEAs (Portugal)", + englishName: "Portuguese (Portugal)" + }, + qu: { nativeName: "Quechua", englishName: "Quechua" }, + "qu-PE": { nativeName: "Qhichwa", englishName: "Quechua" }, + "rm-CH": { nativeName: "Rumantsch", englishName: "Romansh" }, + ro: { nativeName: "Rom\xE2n\u0103", englishName: "Romanian" }, + "ro-RO": { nativeName: "Rom\xE2n\u0103", englishName: "Romanian" }, + rm: { nativeName: "Rhaeto-Romance", englishName: "Rhaeto-Romance" }, + rn: { nativeName: "Kirundi", englishName: "Kirundi" }, + ru: { nativeName: "\u0420\u0443\u0441\u0441\u043A\u0438\u0439", englishName: "Russian" }, + "ru-RU": { nativeName: "\u0420\u0443\u0441\u0441\u043A\u0438\u0439", englishName: "Russian" }, + rw: { nativeName: "Kinyarwanda", englishName: "Kinyarwanda" }, + sa: { nativeName: "\u0938\u0902\u0938\u094D\u0915\u0943\u0924", englishName: "Sanskrit" }, + "sa-IN": { nativeName: "\u0938\u0902\u0938\u094D\u0915\u0943\u0924\u092E\u094D", englishName: "Sanskrit" }, + sc: { nativeName: "sardu", englishName: "Sardinian" }, + sd: { nativeName: "\u0633\u0646\u068C\u064A", englishName: "Sindhi" }, + se: { nativeName: "Northern S\xE1mi", englishName: "Northern S\xE1mi" }, + "se-NO": { nativeName: "Davvis\xE1megiella", englishName: "Northern S\xE1mi" }, + sg: { nativeName: "Sangho", englishName: "Sangho" }, + sh: { nativeName: "\u0441\u0440\u043F\u0441\u043A\u043E\u0445\u0440\u0432\u0430\u0442\u0441\u043A\u0438", englishName: "Serbo-Croatian" }, + si: { nativeName: "Singhalese", englishName: "Singhalese" }, + "si-LK": { nativeName: "\u0DB4\u0DC5\u0DCF\u0DAD", englishName: "Sinhala (Sri Lanka)" }, + sk: { nativeName: "Sloven\u010Dina", englishName: "Slovak" }, + "sk-SK": { + nativeName: "Sloven\u010Dina (Slovakia)", + englishName: "Slovak (Slovakia)" + }, + sl: { nativeName: "Sloven\u0161\u010Dina", englishName: "Slovenian" }, + "sl-SI": { nativeName: "Sloven\u0161\u010Dina", englishName: "Slovenian" }, + sm: { nativeName: "Samoan", englishName: "Samoan" }, + sn: { nativeName: "Shona", englishName: "Shona" }, + "so-SO": { nativeName: "Soomaaliga", englishName: "Somali" }, + so: { nativeName: "Somali", englishName: "Somali" }, + sq: { nativeName: "Shqip", englishName: "Albanian" }, + "sq-AL": { nativeName: "Shqip", englishName: "Albanian" }, + sr: { nativeName: "\u0421\u0440\u043F\u0441\u043A\u0438", englishName: "Serbian" }, + "sr-RS": { nativeName: "\u0421\u0440\u043F\u0441\u043A\u0438 (Serbia)", englishName: "Serbian (Serbia)" }, + ss: { nativeName: "SiSwati", englishName: "Swati" }, + st: { nativeName: "Sesotho", englishName: "Southern Sotho" }, + su: { nativeName: "Basa Sunda", englishName: "Sundanese" }, + sv: { nativeName: "Svenska", englishName: "Swedish" }, + "sv-SE": { nativeName: "Svenska", englishName: "Swedish" }, + sw: { nativeName: "Kiswahili", englishName: "Swahili" }, + "sw-KE": { nativeName: "Kiswahili", englishName: "Swahili (Kenya)" }, + ta: { nativeName: "\u0BA4\u0BAE\u0BBF\u0BB4\u0BCD", englishName: "Tamil" }, + "ta-IN": { nativeName: "\u0BA4\u0BAE\u0BBF\u0BB4\u0BCD", englishName: "Tamil" }, + te: { nativeName: "\u0C24\u0C46\u0C32\u0C41\u0C17\u0C41", englishName: "Telugu" }, + "te-IN": { nativeName: "\u0C24\u0C46\u0C32\u0C41\u0C17\u0C41", englishName: "Telugu" }, + tg: { nativeName: "\u0437\u0430\u0431\u043E\u0301\u043D\u0438 \u0442\u043E\u04B7\u0438\u043A\u04E3\u0301", englishName: "Tajik" }, + "tg-TJ": { nativeName: "\u0442\u043E\u04B7\u0438\u043A\u04E3", englishName: "Tajik" }, + th: { nativeName: "\u0E20\u0E32\u0E29\u0E32\u0E44\u0E17\u0E22", englishName: "Thai" }, + "th-TH": { + nativeName: "\u0E20\u0E32\u0E29\u0E32\u0E44\u0E17\u0E22 (\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28\u0E44\u0E17\u0E22)", + englishName: "Thai (Thailand)" + }, + ti: { nativeName: "\u1275\u130D\u122D\u129B", englishName: "Tigrinya" }, + tk: { nativeName: "\u0442\u04AF\u0440\u043Am\u0435\u043D\u0447\u0435", englishName: "Turkmen" }, + tl: { nativeName: "Filipino", englishName: "Filipino" }, + "tl-PH": { nativeName: "Filipino", englishName: "Filipino" }, + tlh: { nativeName: "tlhIngan-Hol", englishName: "Klingon" }, + tn: { nativeName: "Setswana", englishName: "Tswana" }, + to: { nativeName: "Tonga", englishName: "Tonga" }, + tr: { nativeName: "T\xFCrk\xE7e", englishName: "Turkish" }, + "tr-TR": { nativeName: "T\xFCrk\xE7e", englishName: "Turkish" }, + ts: { nativeName: "Xitsonga", englishName: "Tsonga" }, + tt: { nativeName: "\u0442\u0430\u0442\u0430\u0440\u0447\u0430", englishName: "Tatar" }, + "tt-RU": { nativeName: "\u0442\u0430\u0442\u0430\u0440\u0447\u0430", englishName: "Tatar" }, + tw: { nativeName: "Twi", englishName: "Twi" }, + ty: { nativeName: "Reo Tahiti", englishName: "Tahitian" }, + uk: { nativeName: "\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430", englishName: "Ukrainian" }, + "uk-UA": { nativeName: "\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430", englishName: "Ukrainian" }, + ug: { nativeName: "Uigur", englishName: "Uigur" }, + ur: { nativeName: "\u0627\u0631\u062F\u0648", englishName: "Urdu" }, + "ur-PK": { nativeName: "\u0627\u0631\u062F\u0648", englishName: "Urdu" }, + uz: { nativeName: "O'zbek", englishName: "Uzbek" }, + "uz-UZ": { nativeName: "O'zbek", englishName: "Uzbek" }, + ve: { nativeName: "Tshiven\u1E13a", englishName: "Venda" }, + vi: { nativeName: "Ti\u1EBFng Vi\u1EC7t", englishName: "Vietnamese" }, + "vi-VN": { nativeName: "Ti\u1EBFng Vi\u1EC7t", englishName: "Vietnamese" }, + vk: { nativeName: "Ovalingo", englishName: "Viking" }, + vo: { nativeName: "Volap\xFCk", englishName: "Volap\xFCk" }, + wa: { nativeName: "Walon", englishName: "Walloon" }, + wo: { nativeName: "Wolof", englishName: "Wolof" }, + xh: { nativeName: "IsiXhosa", englishName: "Xhosa" }, + "xh-ZA": { nativeName: "isiXhosa", englishName: "Xhosa" }, + yi: { nativeName: "\u05D9\u05D9\u05B4\u05D3\u05D9\u05E9", englishName: "Yiddish" }, + "yi-DE": { nativeName: "\u05D9\u05D9\u05B4\u05D3\u05D9\u05E9 (German)", englishName: "Yiddish (German)" }, + yo: { nativeName: "Yor\xF9b\xE1", englishName: "Yorouba" }, + za: { nativeName: "Zhuang", englishName: "Zhuang" }, + zh: { nativeName: "\u4E2D\u6587", englishName: "Chinese" }, + "zh-Hans": { nativeName: "\u4E2D\u6587\u7B80\u4F53", englishName: "Chinese Simplified" }, + "zh-Hant": { nativeName: "\u4E2D\u6587\u7E41\u9AD4", englishName: "Chinese Traditional" }, + "zh-CN": { + nativeName: "\u4E2D\u6587\uFF08\u4E2D\u56FD\uFF09", + englishName: "Chinese Simplified (China)" + }, + "zh-HK": { + nativeName: "\u4E2D\u6587\uFF08\u9999\u6E2F\uFF09", + englishName: "Chinese Traditional (Hong Kong)" + }, + "zh-SG": { + nativeName: "\u4E2D\u6587\uFF08\u65B0\u52A0\u5761\uFF09", + englishName: "Chinese Simplified (Singapore)" + }, + "zh-TW": { + nativeName: "\u4E2D\u6587\uFF08\u53F0\u7063\uFF09", + englishName: "Chinese Traditional (Taiwan)" + } + }, + { + get: function(obj, lang) { + if (typeof lang === "string") { + let processedLang = lang; + if (processedLang.includes("-")) { + const parts = processedLang.split("-"); + if (parts.length > 1) { + processedLang = `${parts[0]}-${parts[1].toUpperCase()}`; + } + } else if (processedLang.includes("_")) { + const parts = processedLang.split("_"); + if (parts.length > 1) { + processedLang = `${parts[0]}-${parts[1].toUpperCase()}`; + } + } + return obj[processedLang]; + } + return void 0; + } + } +); + +// src/styleFields.ts +var import_registry4 = __toESM(require("@plone/registry"), 1); +var config4 = import_registry4.default.getUtility ? import_registry4.default : import_registry4.default.default; +var isRecord = (value) => !!value && typeof value === "object" && !Array.isArray(value); +var isStyleFieldMarker = (value) => value === true || isRecord(value); +var splitPath = (path) => path?.split(".").filter((segment) => !!segment) ?? []; +var getPathValue = (data, path) => { + const segments = splitPath(path); + if (!segments.length) return void 0; + let current = data; + for (const segment of segments) { + if (!isRecord(current)) return void 0; + current = current[segment]; + } + return current; +}; +var setPathValue = (data, path, value) => { + const segments = splitPath(path); + if (!segments.length) return; + let current = data; + segments.forEach((segment, index) => { + if (index === segments.length - 1) { + current[segment] = value; + return; + } + const next = current[segment]; + if (!isRecord(next)) { + current[segment] = {}; + } + current = current[segment]; + }); +}; +var getBlockType = (data) => { + const plateType = data.type; + const ploneType = data["@type"]; + if (typeof plateType === "string" && plateType !== "unknown") + return plateType; + if (typeof ploneType === "string") return ploneType; + return void 0; +}; +var findStyleDefinitionByName = (definitions, name) => definitions.find((definition) => definition.name === name); +var getStyleFieldValue = (data, fieldName, fieldConfig) => { + const configuredValue = typeof fieldConfig?.path === "string" ? getPathValue(data, fieldConfig.path) : void 0; + if (typeof configuredValue === "string") return configuredValue; + const rootValue = data[fieldName]; + if (typeof rootValue === "string") return rootValue; + const legacyStyles = data.styles; + if (isRecord(legacyStyles) && typeof legacyStyles[fieldName] === "string") { + return legacyStyles[fieldName]; + } + return void 0; +}; +var setStyleFieldValue = (data, fieldName, value, fieldConfig) => { + if (typeof fieldConfig?.path === "string") { + setPathValue(data, fieldConfig.path, value); + return; + } + if (fieldName in data || !isRecord(data.styles)) { + data[fieldName] = value; + return; + } + const styles = data.styles; + styles[fieldName] = value; +}; +var getCandidateFields = (fieldConfigs) => Object.keys(fieldConfigs ?? {}); +var isAllowedValue = (definitions, value, fieldConfig) => { + const allowedValues = fieldConfig?.values?.length ? fieldConfig.values : definitions.map((definition) => definition.name).filter((name) => !!name); + return allowedValues.includes(value); +}; +var getValuesFromSchemaProperty = (property) => { + if (Array.isArray(property.choices)) { + return property.choices.map( + (choice) => Array.isArray(choice) && typeof choice[0] === "string" ? choice[0] : void 0 + ).filter((choice) => !!choice); + } + if (Array.isArray(property.actions)) { + return property.actions.filter( + (action) => typeof action === "string" + ); + } + return void 0; +}; +var getStyleFieldsFromSchema = (schema) => { + if (!schema || !isRecord(schema.properties)) return {}; + return Object.entries(schema.properties).reduce( + (acc, [fieldName, property]) => { + if (!isRecord(property) || !isStyleFieldMarker(property.styleField)) { + return acc; + } + acc[fieldName] = { + defaultValue: typeof property.default === "string" ? property.default : void 0, + values: getValuesFromSchemaProperty(property), + path: property.styleField === true ? void 0 : typeof property.styleField.path === "string" ? property.styleField.path : void 0 + }; + return acc; + }, + {} + ); +}; +var getStyleFieldsFromBlockSchema = (blockConfig, formData) => { + if (!blockConfig?.blockSchema) return {}; + try { + const schema = typeof blockConfig.blockSchema === "function" ? blockConfig.blockSchema({ formData, data: formData }) : blockConfig.blockSchema; + return getStyleFieldsFromSchema(schema); + } catch { + return {}; + } +}; +var resolveStyleFields = ({ + data, + fieldConfigs, + container, + resolveDefinitions +}) => { + const style = {}; + const values = {}; + const blockType = getBlockType(data); + getCandidateFields(fieldConfigs).forEach((fieldName) => { + const definitions = resolveDefinitions(fieldName, { + data, + container, + blockType, + fieldName + }); + if (!definitions.length) return; + const fieldConfig = fieldConfigs?.[fieldName]; + const rawValue = getStyleFieldValue(data, fieldName, fieldConfig); + const effectiveValue = typeof rawValue === "string" && isAllowedValue(definitions, rawValue, fieldConfig) ? rawValue : fieldConfig?.defaultValue; + if (!effectiveValue) return; + const definition = findStyleDefinitionByName(definitions, effectiveValue); + if (!definition?.style) return; + values[fieldName] = effectiveValue; + Object.assign(style, definition.style); + }); + return { style, values }; +}; +var applyStyleFieldDefaultsInData = ({ + data, + fieldConfigs, + container, + resolveDefinitions +}) => { + const blockType = getBlockType(data); + getCandidateFields(fieldConfigs).forEach((fieldName) => { + const definitions = resolveDefinitions(fieldName, { + data, + container, + blockType, + fieldName + }); + if (!definitions.length) return; + const fieldConfig = fieldConfigs?.[fieldName]; + const currentValue = getStyleFieldValue(data, fieldName, fieldConfig); + const defaultValue = fieldConfig?.defaultValue; + if (!defaultValue) return; + if (typeof currentValue === "string" && isAllowedValue(definitions, currentValue, fieldConfig)) { + return; + } + setStyleFieldValue(data, fieldName, defaultValue, fieldConfig); + }); + return data; +}; +var getStyleFieldDefinitionsFromRegistry = (fieldName, args) => { + const utility = config4.getUtility({ + type: "styleFieldDefinition", + name: fieldName + }); + return utility.method?.(args) ?? []; +}; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + InitAtoms, + applyStyleFieldDefaultsInData, + findStyleDefinitionByName, + flattenToAppURL, + getContentIcon, + getStyleFieldDefinitionsFromRegistry, + getStyleFieldValue, + getStyleFieldsFromBlockSchema, + getStyleFieldsFromSchema, + hasBlocksData, + isDeepEqual, + isEmpty, + isInternalURL, + langmap, + resolveStyleFields, + setStyleFieldValue, + useFieldFocusAtom, + useFieldFocusedAtom, + useFieldValueFocusedAtom, + useSetFieldFocusedAtom +}); diff --git a/packages/helpers/dist/index.d.cts b/packages/helpers/dist/index.d.cts new file mode 100644 index 00000000000..a54ed1f7bbf --- /dev/null +++ b/packages/helpers/dist/index.d.cts @@ -0,0 +1,105 @@ +import * as jotai from 'jotai'; +import { WritableAtom, PrimitiveAtom } from 'jotai'; +import * as react from 'react'; +import { ReactNode } from 'react'; +import { DeepKeys, DeepValue } from '@tanstack/react-form'; +import { Content, StyleDefinition, JSONSchema, BlockConfigBase, BlocksFormData } from '@plone/types'; + +/** + * Checks if an object or array is empty. + * @param obj - The object or array to check. + * @returns True if the object or array is empty, false otherwise. + */ +declare const isEmpty: (obj: object | Array) => boolean; +/** + * Deep equality check for plain JSON-like values. + * @param left - First value to compare. + * @param right - Second value to compare. + * @returns True when values are deeply equal. + */ +declare function isDeepEqual(left: unknown, right: unknown): boolean; + +/** + * Initialises atoms with the provided values. + * This component uses `useHydrateAtoms` to set the initial state of the atoms + * based on the `atomValues` prop. + * It is useful for server-side rendering or when you want to set the initial state + * of atoms based on some external data. + * It _does not_ update the values once the component is mounted. + * You have to subscribe to the atom in a child component to get the updated values. + * Hence the name `InitAtoms`, which indicates that it is only for initialisation. + * In the jotai docs, they call it "hydration" but it's not really hydration as + * in SSR terminology. + * + * Usage: + * + * + * + */ +declare const InitAtoms: ({ atomValues, children, }: { + atomValues: Iterable, unknown]>; + children: ReactNode; +}) => ReactNode; +declare function useFieldFocusAtom>(anAtom: PrimitiveAtom, field: K): WritableAtom | undefined>, [jotai.SetStateAction>], void>; +declare function useFieldFocusedAtom>(atom: PrimitiveAtom, field: K): [Awaited> | undefined, (args_0: jotai.SetStateAction>) => void]; +declare function useSetFieldFocusedAtom>(atom: PrimitiveAtom, field: K): (args_0: jotai.SetStateAction>) => void; +declare function useFieldValueFocusedAtom>(atom: PrimitiveAtom, field: K): Awaited> | undefined; + +declare function hasBlocksData(content: Content): boolean; + +declare const getContentIcon: (contentType: string, isFolderish?: boolean) => string | react.ComponentType; + +/** + * The definitive flattenToAppURL function + * Flattens all the URLs in the response to the current app URL + * This could be a potential use case for the upcoming RR7 middleware + */ +declare function flattenToAppURL(data: T): T; + +/** + * Lightweight check to detect if a URL points to the current Plone instance. + * For absolute URLs, compares origins to avoid prefix-matching attacks + */ +declare function isInternalURL(url?: string): boolean; + +interface LanguageInfo { + nativeName: string; + englishName: string; +} +type LanguageMap = Record; +declare const langmap: LanguageMap; + +type DataRecord = Record; +type StyleFieldConfig = { + defaultValue?: string; + values?: readonly string[]; + path?: string; +}; +type StyleFieldsConfig = Record; +type RegistryUtilityArgs = { + data: DataRecord; + container?: DataRecord; + blockType?: string; + fieldName: string; +}; +type ResolveStyleDefinitions = (fieldName: string, args: RegistryUtilityArgs) => readonly StyleDefinition[]; +type ResolveStyleFieldsArgs = { + data: DataRecord; + fieldConfigs?: StyleFieldsConfig; + container?: DataRecord; + resolveDefinitions: ResolveStyleDefinitions; +}; +type ResolvedStyleFields = { + style: Record<`--${string}`, string>; + values: Record; +}; +declare const findStyleDefinitionByName: (definitions: readonly StyleDefinition[], name?: string) => StyleDefinition | undefined; +declare const getStyleFieldValue: (data: DataRecord, fieldName: string, fieldConfig?: StyleFieldConfig) => string | undefined; +declare const setStyleFieldValue: (data: DataRecord, fieldName: string, value: string, fieldConfig?: StyleFieldConfig) => void; +declare const getStyleFieldsFromSchema: (schema?: JSONSchema) => StyleFieldsConfig; +declare const getStyleFieldsFromBlockSchema: (blockConfig: Pick | undefined, formData?: BlocksFormData) => StyleFieldsConfig; +declare const resolveStyleFields: ({ data, fieldConfigs, container, resolveDefinitions, }: ResolveStyleFieldsArgs) => ResolvedStyleFields; +declare const applyStyleFieldDefaultsInData: ({ data, fieldConfigs, container, resolveDefinitions, }: ResolveStyleFieldsArgs) => DataRecord; +declare const getStyleFieldDefinitionsFromRegistry: ResolveStyleDefinitions; + +export { InitAtoms, type ResolveStyleDefinitions, type ResolveStyleFieldsArgs, type ResolvedStyleFields, applyStyleFieldDefaultsInData, findStyleDefinitionByName, flattenToAppURL, getContentIcon, getStyleFieldDefinitionsFromRegistry, getStyleFieldValue, getStyleFieldsFromBlockSchema, getStyleFieldsFromSchema, hasBlocksData, isDeepEqual, isEmpty, isInternalURL, langmap, resolveStyleFields, setStyleFieldValue, useFieldFocusAtom, useFieldFocusedAtom, useFieldValueFocusedAtom, useSetFieldFocusedAtom }; diff --git a/packages/helpers/dist/index.d.ts b/packages/helpers/dist/index.d.ts new file mode 100644 index 00000000000..a54ed1f7bbf --- /dev/null +++ b/packages/helpers/dist/index.d.ts @@ -0,0 +1,105 @@ +import * as jotai from 'jotai'; +import { WritableAtom, PrimitiveAtom } from 'jotai'; +import * as react from 'react'; +import { ReactNode } from 'react'; +import { DeepKeys, DeepValue } from '@tanstack/react-form'; +import { Content, StyleDefinition, JSONSchema, BlockConfigBase, BlocksFormData } from '@plone/types'; + +/** + * Checks if an object or array is empty. + * @param obj - The object or array to check. + * @returns True if the object or array is empty, false otherwise. + */ +declare const isEmpty: (obj: object | Array) => boolean; +/** + * Deep equality check for plain JSON-like values. + * @param left - First value to compare. + * @param right - Second value to compare. + * @returns True when values are deeply equal. + */ +declare function isDeepEqual(left: unknown, right: unknown): boolean; + +/** + * Initialises atoms with the provided values. + * This component uses `useHydrateAtoms` to set the initial state of the atoms + * based on the `atomValues` prop. + * It is useful for server-side rendering or when you want to set the initial state + * of atoms based on some external data. + * It _does not_ update the values once the component is mounted. + * You have to subscribe to the atom in a child component to get the updated values. + * Hence the name `InitAtoms`, which indicates that it is only for initialisation. + * In the jotai docs, they call it "hydration" but it's not really hydration as + * in SSR terminology. + * + * Usage: + * + * + * + */ +declare const InitAtoms: ({ atomValues, children, }: { + atomValues: Iterable, unknown]>; + children: ReactNode; +}) => ReactNode; +declare function useFieldFocusAtom>(anAtom: PrimitiveAtom, field: K): WritableAtom | undefined>, [jotai.SetStateAction>], void>; +declare function useFieldFocusedAtom>(atom: PrimitiveAtom, field: K): [Awaited> | undefined, (args_0: jotai.SetStateAction>) => void]; +declare function useSetFieldFocusedAtom>(atom: PrimitiveAtom, field: K): (args_0: jotai.SetStateAction>) => void; +declare function useFieldValueFocusedAtom>(atom: PrimitiveAtom, field: K): Awaited> | undefined; + +declare function hasBlocksData(content: Content): boolean; + +declare const getContentIcon: (contentType: string, isFolderish?: boolean) => string | react.ComponentType; + +/** + * The definitive flattenToAppURL function + * Flattens all the URLs in the response to the current app URL + * This could be a potential use case for the upcoming RR7 middleware + */ +declare function flattenToAppURL(data: T): T; + +/** + * Lightweight check to detect if a URL points to the current Plone instance. + * For absolute URLs, compares origins to avoid prefix-matching attacks + */ +declare function isInternalURL(url?: string): boolean; + +interface LanguageInfo { + nativeName: string; + englishName: string; +} +type LanguageMap = Record; +declare const langmap: LanguageMap; + +type DataRecord = Record; +type StyleFieldConfig = { + defaultValue?: string; + values?: readonly string[]; + path?: string; +}; +type StyleFieldsConfig = Record; +type RegistryUtilityArgs = { + data: DataRecord; + container?: DataRecord; + blockType?: string; + fieldName: string; +}; +type ResolveStyleDefinitions = (fieldName: string, args: RegistryUtilityArgs) => readonly StyleDefinition[]; +type ResolveStyleFieldsArgs = { + data: DataRecord; + fieldConfigs?: StyleFieldsConfig; + container?: DataRecord; + resolveDefinitions: ResolveStyleDefinitions; +}; +type ResolvedStyleFields = { + style: Record<`--${string}`, string>; + values: Record; +}; +declare const findStyleDefinitionByName: (definitions: readonly StyleDefinition[], name?: string) => StyleDefinition | undefined; +declare const getStyleFieldValue: (data: DataRecord, fieldName: string, fieldConfig?: StyleFieldConfig) => string | undefined; +declare const setStyleFieldValue: (data: DataRecord, fieldName: string, value: string, fieldConfig?: StyleFieldConfig) => void; +declare const getStyleFieldsFromSchema: (schema?: JSONSchema) => StyleFieldsConfig; +declare const getStyleFieldsFromBlockSchema: (blockConfig: Pick | undefined, formData?: BlocksFormData) => StyleFieldsConfig; +declare const resolveStyleFields: ({ data, fieldConfigs, container, resolveDefinitions, }: ResolveStyleFieldsArgs) => ResolvedStyleFields; +declare const applyStyleFieldDefaultsInData: ({ data, fieldConfigs, container, resolveDefinitions, }: ResolveStyleFieldsArgs) => DataRecord; +declare const getStyleFieldDefinitionsFromRegistry: ResolveStyleDefinitions; + +export { InitAtoms, type ResolveStyleDefinitions, type ResolveStyleFieldsArgs, type ResolvedStyleFields, applyStyleFieldDefaultsInData, findStyleDefinitionByName, flattenToAppURL, getContentIcon, getStyleFieldDefinitionsFromRegistry, getStyleFieldValue, getStyleFieldsFromBlockSchema, getStyleFieldsFromSchema, hasBlocksData, isDeepEqual, isEmpty, isInternalURL, langmap, resolveStyleFields, setStyleFieldValue, useFieldFocusAtom, useFieldFocusedAtom, useFieldValueFocusedAtom, useSetFieldFocusedAtom }; diff --git a/packages/helpers/dist/index.js b/packages/helpers/dist/index.js new file mode 100644 index 00000000000..5cbdf9ffca4 --- /dev/null +++ b/packages/helpers/dist/index.js @@ -0,0 +1,798 @@ +// src/primitives.ts +var isEmpty = (obj) => (Array.isArray(obj) || obj instanceof Object) && !Object.entries(obj || {}).length; +function isDeepEqual(left, right) { + if (Object.is(left, right)) return true; + if (typeof left !== "object" || typeof right !== "object" || left === null || right === null) { + return false; + } + if (Array.isArray(left) || Array.isArray(right)) { + if (!Array.isArray(left) || !Array.isArray(right)) return false; + if (left.length !== right.length) return false; + for (let i = 0; i < left.length; i += 1) { + if (!isDeepEqual(left[i], right[i])) return false; + } + return true; + } + const leftEntries = Object.entries(left); + const rightEntries = Object.entries(right); + if (leftEntries.length !== rightEntries.length) return false; + for (const [key, value] of leftEntries) { + if (!(key in right)) return false; + if (!isDeepEqual(value, right[key])) { + return false; + } + } + return true; +} + +// src/atoms.ts +import { useCallback } from "react"; +import { useHydrateAtoms } from "jotai/utils"; +import { useAtom, useAtomValue, useSetAtom } from "jotai"; +import { focusAtom } from "jotai-optics"; +var InitAtoms = ({ + atomValues, + children +}) => { + useHydrateAtoms(new Map(atomValues)); + return children; +}; +function useFieldFocusAtom(anAtom, field) { + return focusAtom( + anAtom, + // @ts-expect-error https://github.com/jotaijs/jotai-optics/issues/6 + useCallback((optic) => optic.prop(field), [field]) + ); +} +function useFieldFocusedAtom(atom, field) { + return useAtom( + focusAtom( + atom, + // @ts-expect-error https://github.com/jotaijs/jotai-optics/issues/6 + useCallback( + (optic) => optic.prop(field), + [field] + ) + ) + ); +} +function useSetFieldFocusedAtom(atom, field) { + return useSetAtom( + focusAtom( + atom, + // @ts-expect-error https://github.com/jotaijs/jotai-optics/issues/6 + useCallback( + (optic) => optic.prop(field), + [field] + ) + ) + ); +} +function useFieldValueFocusedAtom(atom, field) { + return useAtomValue( + focusAtom( + atom, + // @ts-expect-error https://github.com/jotaijs/jotai-optics/issues/6 + useCallback( + (optic) => optic.prop(field), + [field] + ) + ) + ); +} + +// src/blocks.ts +function hasBlocksData(content) { + return Object.keys(content).find( + (key) => key !== "volto.blocks" && key.endsWith("blocks") + ) !== void 0; +} + +// src/contents.ts +import config from "@plone/registry"; +var getContentIcon = (contentType, isFolderish = false) => { + const { settings } = config; + const { contentIcons = {} } = settings; + let icon = isFolderish ? contentIcons.Folder : contentIcons.File; + if (contentType in contentIcons) icon = contentIcons[contentType]; + return icon; +}; + +// src/flattenToAppURL.ts +import config2 from "@plone/registry"; +function flattenToAppURL(data) { + let stringData = JSON.stringify(data); + stringData = stringData.replaceAll(`${config2.settings.apiPath}/`, "/"); + stringData = stringData.replaceAll(config2.settings.apiPath, "/"); + return JSON.parse(stringData); +} + +// src/isInternalURL.ts +import config3 from "@plone/registry"; +function isInternalURL(url) { + if (!url) return false; + if (url.startsWith("/") || url.startsWith(".") || url.startsWith("#")) { + return true; + } + const settings = config3.settings ?? {}; + const apiPath = settings.apiPath; + if (apiPath) { + try { + const urlOrigin = new URL(url).origin; + const apiOrigin = new URL(apiPath).origin; + return urlOrigin === apiOrigin; + } catch { + return false; + } + } + return false; +} + +// src/languageMap.ts +var langmap = new Proxy( + { + aa: { nativeName: "\u043C\u0430\u0433I\u0430\u0440\u0443\u043B \u043C\u0430\u0446I", englishName: "Afar" }, + ab: { nativeName: "\u0431\u044B\u0437\u0448\u04D9\u0430", englishName: "Abkhazian" }, + ach: { nativeName: "Lwo", englishName: "Acholi" }, + ady: { nativeName: "\u0410\u0434\u044B\u0433\u044D\u0431\u0437\u044D", englishName: "Adyghe" }, + ae: { nativeName: "avesta", englishName: "Avestan" }, + af: { nativeName: "Afrikaans", englishName: "Afrikaans" }, + "af-NA": { + nativeName: "Afrikaans (Namibia)", + englishName: "Afrikaans (Namibia)" + }, + "af-ZA": { + nativeName: "Afrikaans (South Africa)", + englishName: "Afrikaans (South Africa)" + }, + ak: { nativeName: "T\u0255\u0265i", englishName: "Akan" }, + am: { nativeName: "\u12A0\u121B\u122D\u129B", englishName: "Amharic" }, + an: { nativeName: "aragon\xE9s", englishName: "Aragonese" }, + ar: { nativeName: "\u0627\u0644\u0639\u0631\u0628\u064A\u0629", englishName: "Arabic" }, + "ar-AR": { nativeName: "\u0627\u0644\u0639\u0631\u0628\u064A\u0629", englishName: "Arabic" }, + "ar-MA": { nativeName: "\u0627\u0644\u0639\u0631\u0628\u064A\u0629", englishName: "Arabic (Morocco)" }, + "ar-SA": { + nativeName: "\u0627\u0644\u0639\u0631\u0628\u064A\u0629 (\u0627\u0644\u0633\u0639\u0648\u062F\u064A\u0629)", + englishName: "Arabic (Saudi Arabia)" + }, + as: { nativeName: "\u0985\u09B8\u09AE\u09BF\u09DF\u09BE", englishName: "Assamese" }, + ay: { nativeName: "Aymara", englishName: "Aymara" }, + "ay-BO": { nativeName: "Aymar aru", englishName: "Aymara" }, + az: { nativeName: "Az\u0259rbaycan dili", englishName: "Azerbaijani" }, + "az-AZ": { nativeName: "Az\u0259rbaycan dili", englishName: "Azerbaijani" }, + ba: { nativeName: "Bashkir", englishName: "Bashkir" }, + "be-BY": { nativeName: "\u0411\u0435\u043B\u0430\u0440\u0443\u0441\u043A\u0430\u044F", englishName: "Belarusian" }, + bg: { nativeName: "\u0411\u044A\u043B\u0433\u0430\u0440\u0441\u043A\u0438", englishName: "Bulgarian" }, + "bg-BG": { nativeName: "\u0411\u044A\u043B\u0433\u0430\u0440\u0441\u043A\u0438", englishName: "Bulgarian" }, + be: { nativeName: "\u0411\u0435\u043B\u0430\u0440\u0443\u0441\u043A\u0456", englishName: "Belarussian" }, + bh: { nativeName: "Bihari", englishName: "Bihari" }, + bi: { nativeName: "Bislama", englishName: "Bislama" }, + bm: { nativeName: "bamanankan", englishName: "Bambara" }, + bn: { nativeName: "\u09AC\u09BE\u0982\u09B2\u09BE", englishName: "Bengali" }, + "bn-IN": { nativeName: "\u09AC\u09BE\u0982\u09B2\u09BE (\u09AD\u09BE\u09B0\u09A4)", englishName: "Bengali (India)" }, + "bn-BD": { + nativeName: "\u09AC\u09BE\u0982\u09B2\u09BE(\u09AC\u09BE\u0982\u09B2\u09BE\u09A6\u09C7\u09B6)", + englishName: "Bengali (Bangladesh)" + }, + bo: { nativeName: "\u0F56\u0F7C\u0F51\u0F0B\u0F66\u0F90\u0F51\u0F0B", englishName: "Tibetan" }, + br: { nativeName: "Brezhoneg", englishName: "Breton" }, + bs: { nativeName: "Bosanski", englishName: "Bosnian" }, + "bs-BA": { nativeName: "Bosanski", englishName: "Bosnian" }, + ca: { nativeName: "Catal\xE0", englishName: "Catalan" }, + "ca-ES": { nativeName: "Catal\xE0", englishName: "Catalan" }, + cak: { nativeName: "Maya Kaqchikel", englishName: "Kaqchikel" }, + "ck-US": { nativeName: "\u13E3\u13B3\u13A9 (tsalagi)", englishName: "Cherokee" }, + ce: { nativeName: "\u043D\u043E\u0445\u0447\u0438\u0439\u043D \u043C\u043E\u0442\u0442", englishName: "Chechen" }, + ch: { nativeName: "Chamoru", englishName: "Chamorro" }, + co: { nativeName: "Corsu", englishName: "Corsican" }, + cr: { nativeName: "\u14C0\u1426\u1403\u152D\u140D\u140F\u1423", englishName: "Cree" }, + cs: { nativeName: "\u010Ce\u0161tina", englishName: "Czech" }, + "cs-CZ": { nativeName: "\u010Ce\u0161tina", englishName: "Czech" }, + cu: { nativeName: "\u0469\u0437\u044B\u043A\u044A \u0441\u043B\u043E\u0432\u0463\u043D\u044C\u0441\u043A\u044A", englishName: "Old Church Slavonic" }, + cv: { nativeName: "\u0447\u04D1\u0432\u0430\u0448 \u0447\u04D7\u043B\u0445\u0438", englishName: "Chuvash" }, + cy: { nativeName: "Cymraeg", englishName: "Welsh" }, + "cy-GB": { nativeName: "Cymraeg", englishName: "Welsh" }, + da: { nativeName: "Dansk", englishName: "Danish" }, + "da-DK": { nativeName: "Dansk", englishName: "Danish" }, + de: { nativeName: "Deutsch", englishName: "German" }, + "de-AT": { + nativeName: "Deutsch (\xD6sterreich)", + englishName: "German (Austria)" + }, + "de-DE": { + nativeName: "Deutsch (Deutschland)", + englishName: "German (Germany)" + }, + "de-CH": { + nativeName: "Deutsch (Schweiz)", + englishName: "German (Switzerland)" + }, + dsb: { nativeName: "Dolnoserb\u0161\u0107ina", englishName: "Lower Sorbian" }, + dv: { nativeName: "Divehi", englishName: "Maldivian" }, + dz: { nativeName: "Bhutani", englishName: "Indian Bhutani" }, + ee: { nativeName: "E\u028Begbe", englishName: "Ewe" }, + el: { nativeName: "\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC", englishName: "Greek" }, + "el-GR": { nativeName: "\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC", englishName: "Greek (Greece)" }, + en: { nativeName: "English", englishName: "English" }, + "en-GB": { nativeName: "English (UK)", englishName: "English (UK)" }, + "en-AU": { + nativeName: "English (Australia)", + englishName: "English (Australia)" + }, + "en-CA": { + nativeName: "English (Canada)", + englishName: "English (Canada)" + }, + "en-IE": { + nativeName: "English (Ireland)", + englishName: "English (Ireland)" + }, + "en-IN": { nativeName: "English (India)", englishName: "English (India)" }, + "en-PI": { + nativeName: "English (Pirate)", + englishName: "English (Pirate)" + }, + "en-UD": { + nativeName: "English (Upside Down)", + englishName: "English (Upside Down)" + }, + "en-US": { nativeName: "English (US)", englishName: "English (US)" }, + "en-ZA": { + nativeName: "English (South Africa)", + englishName: "English (South Africa)" + }, + "en@pirate": { + nativeName: "English (Pirate)", + englishName: "English (Pirate)" + }, + eo: { nativeName: "Esperanto", englishName: "Esperanto" }, + "eo-EO": { nativeName: "Esperanto", englishName: "Esperanto" }, + es: { nativeName: "Espa\xF1ol", englishName: "Spanish" }, + "es-AR": { + nativeName: "Espa\xF1ol (Argentine)", + englishName: "Spanish (Argentina)" + }, + "es-419": { + nativeName: "Espa\xF1ol (Latinoam\xE9rica)", + englishName: "Spanish (Latin America)" + }, + "es-CL": { nativeName: "Espa\xF1ol (Chile)", englishName: "Spanish (Chile)" }, + "es-CO": { + nativeName: "Espa\xF1ol (Colombia)", + englishName: "Spanish (Colombia)" + }, + "es-EC": { + nativeName: "Espa\xF1ol (Ecuador)", + englishName: "Spanish (Ecuador)" + }, + "es-ES": { nativeName: "Espa\xF1ol (Espa\xF1a)", englishName: "Spanish (Spain)" }, + "es-LA": { + nativeName: "Espa\xF1ol (Latinoam\xE9rica)", + englishName: "Spanish (Latin America)" + }, + "es-NI": { + nativeName: "Espa\xF1ol (Nicaragua)", + englishName: "Spanish (Nicaragua)" + }, + "es-MX": { + nativeName: "Espa\xF1ol (M\xE9xico)", + englishName: "Spanish (Mexico)" + }, + "es-US": { + nativeName: "Espa\xF1ol (Estados Unidos)", + englishName: "Spanish (United States)" + }, + "es-VE": { + nativeName: "Espa\xF1ol (Venezuela)", + englishName: "Spanish (Venezuela)" + }, + "et-EE": { + nativeName: "Eesti (Estonia)", + englishName: "Estonian (Estonia)" + }, + eu: { nativeName: "Euskara", englishName: "Basque" }, + "eu-ES": { nativeName: "Euskara", englishName: "Basque" }, + fa: { nativeName: "\u0641\u0627\u0631\u0633\u06CC", englishName: "Persian" }, + "fa-IR": { nativeName: "\u0641\u0627\u0631\u0633\u06CC", englishName: "Persian" }, + "fb-LT": { nativeName: "Leet Speak", englishName: "Leet" }, + ff: { nativeName: "Fulah", englishName: "Fulah" }, + fi: { nativeName: "Suomi", englishName: "Finnish" }, + "fi-FI": { nativeName: "Suomi", englishName: "Finnish" }, + fj: { nativeName: "Fiji", englishName: "Fiji" }, + fo: { nativeName: "F\xF8royska", englishName: "Faroese" }, + "fo-FO": { nativeName: "F\xF8royskt", englishName: "Faroese" }, + fr: { nativeName: "Fran\xE7ais", englishName: "French" }, + "fr-CA": { + nativeName: "Fran\xE7ais (Canada)", + englishName: "French (Canada)" + }, + "fr-FR": { + nativeName: "Fran\xE7ais (France)", + englishName: "French (France)" + }, + "fr-BE": { + nativeName: "Fran\xE7ais (Belgique)", + englishName: "French (Belgium)" + }, + "fr-CH": { + nativeName: "Fran\xE7ais (Suisse)", + englishName: "French (Switzerland)" + }, + fy: { nativeName: "Frysk", englishName: "Frisian" }, + "fy-NL": { nativeName: "Frysk", englishName: "Frisian (West)" }, + ga: { nativeName: "Gaeilge", englishName: "Irish" }, + "ga-IE": { nativeName: "Gaeilge", englishName: "Irish" }, + gd: { nativeName: "G\xE0idhlig", englishName: "Gaelic" }, + gl: { nativeName: "Galego", englishName: "Galician" }, + "gl-ES": { nativeName: "Galego", englishName: "Galician" }, + gn: { nativeName: "Guarani", englishName: "Guarani" }, + "gn-PY": { nativeName: "Ava\xF1e'\u1EBD", englishName: "Guarani" }, + gu: { nativeName: "\u0A97\u0AC1\u0A9C\u0AB0\u0ABE\u0AA4\u0AC0", englishName: "Gujarati" }, + "gu-IN": { nativeName: "\u0A97\u0AC1\u0A9C\u0AB0\u0ABE\u0AA4\u0AC0", englishName: "Gujarati" }, + gv: { nativeName: "Gaelg", englishName: "Manx" }, + "gx-GR": { nativeName: "\u1F19\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AE \u1F00\u03C1\u03C7\u03B1\u03AF\u03B1", englishName: "Classical Greek" }, + ha: { nativeName: "\u0647\u064E\u0648\u064F\u0633", englishName: "Hausa" }, + he: { nativeName: "\u05E2\u05D1\u05E8\u05D9\u05EA\u200F", englishName: "Hebrew" }, + "he-IL": { nativeName: "\u05E2\u05D1\u05E8\u05D9\u05EA\u200F", englishName: "Hebrew" }, + hi: { nativeName: "\u0939\u093F\u0928\u094D\u0926\u0940", englishName: "Hindi" }, + "hi-IN": { nativeName: "\u0939\u093F\u0928\u094D\u0926\u0940", englishName: "Hindi" }, + ho: { nativeName: "Hiri Motu", englishName: "Hiri Motu" }, + hr: { nativeName: "Hrvatski", englishName: "Croatian" }, + "hr-HR": { nativeName: "Hrvatski", englishName: "Croatian" }, + hsb: { nativeName: "Hornjoserb\u0161\u0107ina", englishName: "Upper Sorbian" }, + ht: { nativeName: "Krey\xF2l", englishName: "Haitian Creole" }, + hu: { nativeName: "Magyar", englishName: "Hungarian" }, + "hu-HU": { nativeName: "Magyar", englishName: "Hungarian" }, + hy: { nativeName: "\u0540\u0561\u0575\u0565\u0580\u0567\u0576", englishName: "Armenian" }, + "hy-AM": { nativeName: "\u0540\u0561\u0575\u0565\u0580\u0565\u0576", englishName: "Armenian" }, + hz: { nativeName: "Otjiherero", englishName: "Herero" }, + ia: { nativeName: "Interlingua", englishName: "Interlingua" }, + id: { nativeName: "Bahasa Indonesia", englishName: "Indonesian" }, + "id-ID": { nativeName: "Bahasa Indonesia", englishName: "Indonesian" }, + ie: { nativeName: "Interlingue", englishName: "Interlingue" }, + ig: { nativeName: "As\u1EE5s\u1EE5 Igbo", englishName: "Igbo" }, + ii: { nativeName: "Nuosu", englishName: "Nuosu" }, + ik: { nativeName: "I\xF1upiaq", englishName: "Inupiak" }, + io: { nativeName: "Ido", englishName: "Ido" }, + is: { nativeName: "\xCDslenska", englishName: "Icelandic" }, + "is-IS": { + nativeName: "\xCDslenska (Iceland)", + englishName: "Icelandic (Iceland)" + }, + it: { nativeName: "Italiano", englishName: "Italian" }, + "it-IT": { nativeName: "Italiano", englishName: "Italian" }, + iu: { nativeName: "\u1403\u14C4\u1483\u144E\u1450\u1466", englishName: "Inuktitut" }, + ja: { nativeName: "\u65E5\u672C\u8A9E", englishName: "Japanese" }, + "ja-JP": { nativeName: "\u65E5\u672C\u8A9E (\u65E5\u672C)", englishName: "Japanese (Japan)" }, + jv: { nativeName: "Javanese", englishName: "basa Jawa" }, + "jv-ID": { nativeName: "Basa Jawa", englishName: "Javanese" }, + ka: { nativeName: "\u10E5\u10D0\u10E0\u10D7\u10E3\u10DA\u10D8", englishName: "Georgian" }, + "ka-GE": { nativeName: "\u10E5\u10D0\u10E0\u10D7\u10E3\u10DA\u10D8", englishName: "Georgian" }, + kab: { nativeName: "Taqbaylit", englishName: "Kabyle" }, + kg: { nativeName: "KiKongo", englishName: "Kongo" }, + ki: { nativeName: "G\u0129k\u0169y\u0169", englishName: "Kikuyu" }, + kj: { nativeName: "Kuanyama", englishName: "Kwanyama" }, + kk: { nativeName: "\uFED7\uFE8E\uFEAF\uFE8D\uFED7\uFEB8\uFE8E", englishName: "Kazakh" }, + "kk-KZ": { nativeName: "\u049A\u0430\u0437\u0430\u049B\u0448\u0430", englishName: "Kazakh" }, + kl: { nativeName: "Greenlandic", englishName: "Greenlandic" }, + km: { nativeName: "\u1797\u17B6\u179F\u17B6\u1781\u17D2\u1798\u17C2\u179A", englishName: "Khmer" }, + "km-KH": { nativeName: "\u1797\u17B6\u179F\u17B6\u1781\u17D2\u1798\u17C2\u179A", englishName: "Khmer" }, + kn: { nativeName: "\u0C95\u0CA8\u0CCD\u0CA8\u0CA1", englishName: "Kannada" }, + "kn-IN": { nativeName: "\u0C95\u0CA8\u0CCD\u0CA8\u0CA1 (India)", englishName: "Kannada (India)" }, + ko: { nativeName: "\uD55C\uAD6D\uC5B4", englishName: "Korean" }, + "ko-KR": { nativeName: "\uD55C\uAD6D\uC5B4 (\uD55C\uAD6D)", englishName: "Korean (Korea)" }, + kr: { nativeName: "Kanuri", englishName: "Kanuri" }, + ks: { nativeName: "\u0915\u093E\u093D\u0936\u0941\u0930", englishName: "Kashmiri" }, + ku: { nativeName: "Kurd\xED", englishName: "Kurdish" }, + "ku-TR": { nativeName: "Kurd\xEE", englishName: "Kurdish" }, + kv: { nativeName: "\u043A\u043E\u043C\u0438 \u043A\u044B\u0432", englishName: "Komi" }, + kw: { nativeName: "Kernewek", englishName: "Cornish" }, + ky: { nativeName: "\u041A\u044B\u0440\u0433\u044B\u0437", englishName: "Kirghiz" }, + la: { nativeName: "Latin", englishName: "Latin" }, + "la-VA": { nativeName: "Latin", englishName: "Latin" }, + lb: { nativeName: "L\xEBtzebuergesch", englishName: "Luxembourgish" }, + lg: { nativeName: "Luganda", englishName: "Ganda" }, + li: { nativeName: "Limburgs", englishName: "Limburgish" }, + "li-NL": { nativeName: "L\xE8mb\xF6rgs", englishName: "Limburgish" }, + ln: { nativeName: "Lingala", englishName: "Lingala" }, + lo: { nativeName: "\u0E9E\u0EB2\u0EAA\u0EB2\u0EA5\u0EB2\u0EA7", englishName: "Laotian" }, + lt: { nativeName: "Lietuvi\u0173", englishName: "Lithuanian" }, + "lt-LT": { nativeName: "Lietuvi\u0173", englishName: "Lithuanian" }, + lu: { nativeName: "Tshiluba", englishName: "Luba-Katanga" }, + lv: { nativeName: "Latvie\u0161u", englishName: "Latvian" }, + "lv-LV": { nativeName: "Latvie\u0161u", englishName: "Latvian" }, + mai: { nativeName: "\u092E\u0948\u0925\u093F\u0932\u0940, \u09AE\u09C8\u09A5\u09BF\u09B2\u09C0", englishName: "Maithili" }, + mg: { nativeName: "Malagasy", englishName: "Madagascarian" }, + "mg-MG": { nativeName: "Malagasy", englishName: "Malagasy" }, + mh: { nativeName: "Kajin M\u0327aje\u013C", englishName: "Marshallese" }, + mi: { nativeName: "Maori", englishName: "Maori" }, + mk: { nativeName: "\u041C\u0430\u043A\u0435\u0434\u043E\u043D\u0441\u043A\u0438", englishName: "Macedonian" }, + "mk-MK": { + nativeName: "\u041C\u0430\u043A\u0435\u0434\u043E\u043D\u0441\u043A\u0438 (\u041C\u0430\u043A\u0435\u0434\u043E\u043D\u0441\u043A\u0438)", + englishName: "Macedonian (Macedonian)" + }, + ml: { nativeName: "\u0D2E\u0D32\u0D2F\u0D3E\u0D33\u0D02", englishName: "Malayalam" }, + "ml-IN": { nativeName: "\u0D2E\u0D32\u0D2F\u0D3E\u0D33\u0D02", englishName: "Malayalam" }, + mn: { nativeName: "\u041C\u043E\u043D\u0433\u043E\u043B", englishName: "Mongolian" }, + "mn-MN": { nativeName: "\u041C\u043E\u043D\u0433\u043E\u043B", englishName: "Mongolian" }, + mo: { nativeName: "Moldavian", englishName: "Moldavian" }, + mr: { nativeName: "\u092E\u0930\u093E\u0920\u0940", englishName: "Marathi" }, + "mr-IN": { nativeName: "\u092E\u0930\u093E\u0920\u0940", englishName: "Marathi" }, + ms: { nativeName: "Bahasa Melayu", englishName: "Malay" }, + "ms-MY": { nativeName: "Bahasa Melayu", englishName: "Malay" }, + mt: { nativeName: "Malti", englishName: "Maltese" }, + "mt-MT": { nativeName: "Malti", englishName: "Maltese" }, + my: { nativeName: "\u1017\u1019\u102C\u1005\u1000\u102C", englishName: "Burmese" }, + na: { nativeName: "Nauru", englishName: "Nauruan" }, + nb: { nativeName: "Norsk (bokm\xE5l)", englishName: "Norwegian (bokmal)" }, + "nb-NO": { + nativeName: "Norsk (bokm\xE5l)", + englishName: "Norwegian (bokmal)" + }, + nd: { nativeName: "Ndebele (North)", englishName: "Ndebele (North)" }, + ne: { nativeName: "\u0928\u0947\u092A\u093E\u0932\u0940", englishName: "Nepali" }, + "ne-NP": { nativeName: "\u0928\u0947\u092A\u093E\u0932\u0940", englishName: "Nepali" }, + ng: { nativeName: "Owambo", englishName: "Ndonga" }, + nl: { nativeName: "Nederlands", englishName: "Dutch" }, + "nl-BE": { + nativeName: "Nederlands (Belgi\xEB)", + englishName: "Dutch (Belgium)" + }, + "nl-NL": { + nativeName: "Nederlands (Nederland)", + englishName: "Dutch (Netherlands)" + }, + nn: { nativeName: "Nynorsk", englishName: "Nynorsk" }, + "nn-NO": { + nativeName: "Norsk (nynorsk)", + englishName: "Norwegian (nynorsk)" + }, + no: { nativeName: "Norsk", englishName: "Norwegian" }, + nr: { nativeName: "IsiNdebele", englishName: "Ndebele (South)" }, + nv: { nativeName: "Din\xE9 bizaad", englishName: "Navajo" }, + ny: { nativeName: "chiChe\u0175a", englishName: "Chichewa" }, + oc: { nativeName: "Occitan", englishName: "Occitan" }, + oj: { nativeName: "\u140A\u14C2\u1511\u14C8\u142F\u14A7\u140E\u14D0", englishName: "Ojibwe" }, + om: { nativeName: "Oromo", englishName: "Oromo" }, + or: { nativeName: "\u0B13\u0B5C\u0B3F\u0B06", englishName: "Oriya" }, + "or-IN": { nativeName: "\u0B13\u0B21\u0B3C\u0B3F\u0B06", englishName: "Oriya" }, + os: { nativeName: "\u0438\u0440\u043E\u043D \xE6\u0432\u0437\u0430\u0433", englishName: "Ossetian" }, + pa: { nativeName: "\u0A2A\u0A70\u0A1C\u0A3E\u0A2C\u0A40", englishName: "Punjabi" }, + "pa-IN": { + nativeName: "\u0A2A\u0A70\u0A1C\u0A3E\u0A2C\u0A40 (\u0A2D\u0A3E\u0A30\u0A24 \u0A28\u0A42\u0A70)", + englishName: "Punjabi (India)" + }, + pi: { nativeName: "\u092A\u093E\u0934\u093F", englishName: "P\u0101li" }, + pl: { nativeName: "Polski", englishName: "Polish" }, + "pl-PL": { nativeName: "Polski", englishName: "Polish" }, + ps: { nativeName: "\u067E\u069A\u062A\u0648", englishName: "Pashto" }, + "ps-AF": { nativeName: "\u067E\u069A\u062A\u0648", englishName: "Pashto" }, + pt: { nativeName: "Portugu\xEAs", englishName: "Portuguese" }, + "pt-BR": { + nativeName: "Portugu\xEAs (Brasil)", + englishName: "Portuguese (Brazil)" + }, + "pt-PT": { + nativeName: "Portugu\xEAs (Portugal)", + englishName: "Portuguese (Portugal)" + }, + qu: { nativeName: "Quechua", englishName: "Quechua" }, + "qu-PE": { nativeName: "Qhichwa", englishName: "Quechua" }, + "rm-CH": { nativeName: "Rumantsch", englishName: "Romansh" }, + ro: { nativeName: "Rom\xE2n\u0103", englishName: "Romanian" }, + "ro-RO": { nativeName: "Rom\xE2n\u0103", englishName: "Romanian" }, + rm: { nativeName: "Rhaeto-Romance", englishName: "Rhaeto-Romance" }, + rn: { nativeName: "Kirundi", englishName: "Kirundi" }, + ru: { nativeName: "\u0420\u0443\u0441\u0441\u043A\u0438\u0439", englishName: "Russian" }, + "ru-RU": { nativeName: "\u0420\u0443\u0441\u0441\u043A\u0438\u0439", englishName: "Russian" }, + rw: { nativeName: "Kinyarwanda", englishName: "Kinyarwanda" }, + sa: { nativeName: "\u0938\u0902\u0938\u094D\u0915\u0943\u0924", englishName: "Sanskrit" }, + "sa-IN": { nativeName: "\u0938\u0902\u0938\u094D\u0915\u0943\u0924\u092E\u094D", englishName: "Sanskrit" }, + sc: { nativeName: "sardu", englishName: "Sardinian" }, + sd: { nativeName: "\u0633\u0646\u068C\u064A", englishName: "Sindhi" }, + se: { nativeName: "Northern S\xE1mi", englishName: "Northern S\xE1mi" }, + "se-NO": { nativeName: "Davvis\xE1megiella", englishName: "Northern S\xE1mi" }, + sg: { nativeName: "Sangho", englishName: "Sangho" }, + sh: { nativeName: "\u0441\u0440\u043F\u0441\u043A\u043E\u0445\u0440\u0432\u0430\u0442\u0441\u043A\u0438", englishName: "Serbo-Croatian" }, + si: { nativeName: "Singhalese", englishName: "Singhalese" }, + "si-LK": { nativeName: "\u0DB4\u0DC5\u0DCF\u0DAD", englishName: "Sinhala (Sri Lanka)" }, + sk: { nativeName: "Sloven\u010Dina", englishName: "Slovak" }, + "sk-SK": { + nativeName: "Sloven\u010Dina (Slovakia)", + englishName: "Slovak (Slovakia)" + }, + sl: { nativeName: "Sloven\u0161\u010Dina", englishName: "Slovenian" }, + "sl-SI": { nativeName: "Sloven\u0161\u010Dina", englishName: "Slovenian" }, + sm: { nativeName: "Samoan", englishName: "Samoan" }, + sn: { nativeName: "Shona", englishName: "Shona" }, + "so-SO": { nativeName: "Soomaaliga", englishName: "Somali" }, + so: { nativeName: "Somali", englishName: "Somali" }, + sq: { nativeName: "Shqip", englishName: "Albanian" }, + "sq-AL": { nativeName: "Shqip", englishName: "Albanian" }, + sr: { nativeName: "\u0421\u0440\u043F\u0441\u043A\u0438", englishName: "Serbian" }, + "sr-RS": { nativeName: "\u0421\u0440\u043F\u0441\u043A\u0438 (Serbia)", englishName: "Serbian (Serbia)" }, + ss: { nativeName: "SiSwati", englishName: "Swati" }, + st: { nativeName: "Sesotho", englishName: "Southern Sotho" }, + su: { nativeName: "Basa Sunda", englishName: "Sundanese" }, + sv: { nativeName: "Svenska", englishName: "Swedish" }, + "sv-SE": { nativeName: "Svenska", englishName: "Swedish" }, + sw: { nativeName: "Kiswahili", englishName: "Swahili" }, + "sw-KE": { nativeName: "Kiswahili", englishName: "Swahili (Kenya)" }, + ta: { nativeName: "\u0BA4\u0BAE\u0BBF\u0BB4\u0BCD", englishName: "Tamil" }, + "ta-IN": { nativeName: "\u0BA4\u0BAE\u0BBF\u0BB4\u0BCD", englishName: "Tamil" }, + te: { nativeName: "\u0C24\u0C46\u0C32\u0C41\u0C17\u0C41", englishName: "Telugu" }, + "te-IN": { nativeName: "\u0C24\u0C46\u0C32\u0C41\u0C17\u0C41", englishName: "Telugu" }, + tg: { nativeName: "\u0437\u0430\u0431\u043E\u0301\u043D\u0438 \u0442\u043E\u04B7\u0438\u043A\u04E3\u0301", englishName: "Tajik" }, + "tg-TJ": { nativeName: "\u0442\u043E\u04B7\u0438\u043A\u04E3", englishName: "Tajik" }, + th: { nativeName: "\u0E20\u0E32\u0E29\u0E32\u0E44\u0E17\u0E22", englishName: "Thai" }, + "th-TH": { + nativeName: "\u0E20\u0E32\u0E29\u0E32\u0E44\u0E17\u0E22 (\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28\u0E44\u0E17\u0E22)", + englishName: "Thai (Thailand)" + }, + ti: { nativeName: "\u1275\u130D\u122D\u129B", englishName: "Tigrinya" }, + tk: { nativeName: "\u0442\u04AF\u0440\u043Am\u0435\u043D\u0447\u0435", englishName: "Turkmen" }, + tl: { nativeName: "Filipino", englishName: "Filipino" }, + "tl-PH": { nativeName: "Filipino", englishName: "Filipino" }, + tlh: { nativeName: "tlhIngan-Hol", englishName: "Klingon" }, + tn: { nativeName: "Setswana", englishName: "Tswana" }, + to: { nativeName: "Tonga", englishName: "Tonga" }, + tr: { nativeName: "T\xFCrk\xE7e", englishName: "Turkish" }, + "tr-TR": { nativeName: "T\xFCrk\xE7e", englishName: "Turkish" }, + ts: { nativeName: "Xitsonga", englishName: "Tsonga" }, + tt: { nativeName: "\u0442\u0430\u0442\u0430\u0440\u0447\u0430", englishName: "Tatar" }, + "tt-RU": { nativeName: "\u0442\u0430\u0442\u0430\u0440\u0447\u0430", englishName: "Tatar" }, + tw: { nativeName: "Twi", englishName: "Twi" }, + ty: { nativeName: "Reo Tahiti", englishName: "Tahitian" }, + uk: { nativeName: "\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430", englishName: "Ukrainian" }, + "uk-UA": { nativeName: "\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430", englishName: "Ukrainian" }, + ug: { nativeName: "Uigur", englishName: "Uigur" }, + ur: { nativeName: "\u0627\u0631\u062F\u0648", englishName: "Urdu" }, + "ur-PK": { nativeName: "\u0627\u0631\u062F\u0648", englishName: "Urdu" }, + uz: { nativeName: "O'zbek", englishName: "Uzbek" }, + "uz-UZ": { nativeName: "O'zbek", englishName: "Uzbek" }, + ve: { nativeName: "Tshiven\u1E13a", englishName: "Venda" }, + vi: { nativeName: "Ti\u1EBFng Vi\u1EC7t", englishName: "Vietnamese" }, + "vi-VN": { nativeName: "Ti\u1EBFng Vi\u1EC7t", englishName: "Vietnamese" }, + vk: { nativeName: "Ovalingo", englishName: "Viking" }, + vo: { nativeName: "Volap\xFCk", englishName: "Volap\xFCk" }, + wa: { nativeName: "Walon", englishName: "Walloon" }, + wo: { nativeName: "Wolof", englishName: "Wolof" }, + xh: { nativeName: "IsiXhosa", englishName: "Xhosa" }, + "xh-ZA": { nativeName: "isiXhosa", englishName: "Xhosa" }, + yi: { nativeName: "\u05D9\u05D9\u05B4\u05D3\u05D9\u05E9", englishName: "Yiddish" }, + "yi-DE": { nativeName: "\u05D9\u05D9\u05B4\u05D3\u05D9\u05E9 (German)", englishName: "Yiddish (German)" }, + yo: { nativeName: "Yor\xF9b\xE1", englishName: "Yorouba" }, + za: { nativeName: "Zhuang", englishName: "Zhuang" }, + zh: { nativeName: "\u4E2D\u6587", englishName: "Chinese" }, + "zh-Hans": { nativeName: "\u4E2D\u6587\u7B80\u4F53", englishName: "Chinese Simplified" }, + "zh-Hant": { nativeName: "\u4E2D\u6587\u7E41\u9AD4", englishName: "Chinese Traditional" }, + "zh-CN": { + nativeName: "\u4E2D\u6587\uFF08\u4E2D\u56FD\uFF09", + englishName: "Chinese Simplified (China)" + }, + "zh-HK": { + nativeName: "\u4E2D\u6587\uFF08\u9999\u6E2F\uFF09", + englishName: "Chinese Traditional (Hong Kong)" + }, + "zh-SG": { + nativeName: "\u4E2D\u6587\uFF08\u65B0\u52A0\u5761\uFF09", + englishName: "Chinese Simplified (Singapore)" + }, + "zh-TW": { + nativeName: "\u4E2D\u6587\uFF08\u53F0\u7063\uFF09", + englishName: "Chinese Traditional (Taiwan)" + } + }, + { + get: function(obj, lang) { + if (typeof lang === "string") { + let processedLang = lang; + if (processedLang.includes("-")) { + const parts = processedLang.split("-"); + if (parts.length > 1) { + processedLang = `${parts[0]}-${parts[1].toUpperCase()}`; + } + } else if (processedLang.includes("_")) { + const parts = processedLang.split("_"); + if (parts.length > 1) { + processedLang = `${parts[0]}-${parts[1].toUpperCase()}`; + } + } + return obj[processedLang]; + } + return void 0; + } + } +); + +// src/styleFields.ts +import registryModule from "@plone/registry"; +var config4 = registryModule.getUtility ? registryModule : registryModule.default; +var isRecord = (value) => !!value && typeof value === "object" && !Array.isArray(value); +var isStyleFieldMarker = (value) => value === true || isRecord(value); +var splitPath = (path) => path?.split(".").filter((segment) => !!segment) ?? []; +var getPathValue = (data, path) => { + const segments = splitPath(path); + if (!segments.length) return void 0; + let current = data; + for (const segment of segments) { + if (!isRecord(current)) return void 0; + current = current[segment]; + } + return current; +}; +var setPathValue = (data, path, value) => { + const segments = splitPath(path); + if (!segments.length) return; + let current = data; + segments.forEach((segment, index) => { + if (index === segments.length - 1) { + current[segment] = value; + return; + } + const next = current[segment]; + if (!isRecord(next)) { + current[segment] = {}; + } + current = current[segment]; + }); +}; +var getBlockType = (data) => { + const plateType = data.type; + const ploneType = data["@type"]; + if (typeof plateType === "string" && plateType !== "unknown") + return plateType; + if (typeof ploneType === "string") return ploneType; + return void 0; +}; +var findStyleDefinitionByName = (definitions, name) => definitions.find((definition) => definition.name === name); +var getStyleFieldValue = (data, fieldName, fieldConfig) => { + const configuredValue = typeof fieldConfig?.path === "string" ? getPathValue(data, fieldConfig.path) : void 0; + if (typeof configuredValue === "string") return configuredValue; + const rootValue = data[fieldName]; + if (typeof rootValue === "string") return rootValue; + const legacyStyles = data.styles; + if (isRecord(legacyStyles) && typeof legacyStyles[fieldName] === "string") { + return legacyStyles[fieldName]; + } + return void 0; +}; +var setStyleFieldValue = (data, fieldName, value, fieldConfig) => { + if (typeof fieldConfig?.path === "string") { + setPathValue(data, fieldConfig.path, value); + return; + } + if (fieldName in data || !isRecord(data.styles)) { + data[fieldName] = value; + return; + } + const styles = data.styles; + styles[fieldName] = value; +}; +var getCandidateFields = (fieldConfigs) => Object.keys(fieldConfigs ?? {}); +var isAllowedValue = (definitions, value, fieldConfig) => { + const allowedValues = fieldConfig?.values?.length ? fieldConfig.values : definitions.map((definition) => definition.name).filter((name) => !!name); + return allowedValues.includes(value); +}; +var getValuesFromSchemaProperty = (property) => { + if (Array.isArray(property.choices)) { + return property.choices.map( + (choice) => Array.isArray(choice) && typeof choice[0] === "string" ? choice[0] : void 0 + ).filter((choice) => !!choice); + } + if (Array.isArray(property.actions)) { + return property.actions.filter( + (action) => typeof action === "string" + ); + } + return void 0; +}; +var getStyleFieldsFromSchema = (schema) => { + if (!schema || !isRecord(schema.properties)) return {}; + return Object.entries(schema.properties).reduce( + (acc, [fieldName, property]) => { + if (!isRecord(property) || !isStyleFieldMarker(property.styleField)) { + return acc; + } + acc[fieldName] = { + defaultValue: typeof property.default === "string" ? property.default : void 0, + values: getValuesFromSchemaProperty(property), + path: property.styleField === true ? void 0 : typeof property.styleField.path === "string" ? property.styleField.path : void 0 + }; + return acc; + }, + {} + ); +}; +var getStyleFieldsFromBlockSchema = (blockConfig, formData) => { + if (!blockConfig?.blockSchema) return {}; + try { + const schema = typeof blockConfig.blockSchema === "function" ? blockConfig.blockSchema({ formData, data: formData }) : blockConfig.blockSchema; + return getStyleFieldsFromSchema(schema); + } catch { + return {}; + } +}; +var resolveStyleFields = ({ + data, + fieldConfigs, + container, + resolveDefinitions +}) => { + const style = {}; + const values = {}; + const blockType = getBlockType(data); + getCandidateFields(fieldConfigs).forEach((fieldName) => { + const definitions = resolveDefinitions(fieldName, { + data, + container, + blockType, + fieldName + }); + if (!definitions.length) return; + const fieldConfig = fieldConfigs?.[fieldName]; + const rawValue = getStyleFieldValue(data, fieldName, fieldConfig); + const effectiveValue = typeof rawValue === "string" && isAllowedValue(definitions, rawValue, fieldConfig) ? rawValue : fieldConfig?.defaultValue; + if (!effectiveValue) return; + const definition = findStyleDefinitionByName(definitions, effectiveValue); + if (!definition?.style) return; + values[fieldName] = effectiveValue; + Object.assign(style, definition.style); + }); + return { style, values }; +}; +var applyStyleFieldDefaultsInData = ({ + data, + fieldConfigs, + container, + resolveDefinitions +}) => { + const blockType = getBlockType(data); + getCandidateFields(fieldConfigs).forEach((fieldName) => { + const definitions = resolveDefinitions(fieldName, { + data, + container, + blockType, + fieldName + }); + if (!definitions.length) return; + const fieldConfig = fieldConfigs?.[fieldName]; + const currentValue = getStyleFieldValue(data, fieldName, fieldConfig); + const defaultValue = fieldConfig?.defaultValue; + if (!defaultValue) return; + if (typeof currentValue === "string" && isAllowedValue(definitions, currentValue, fieldConfig)) { + return; + } + setStyleFieldValue(data, fieldName, defaultValue, fieldConfig); + }); + return data; +}; +var getStyleFieldDefinitionsFromRegistry = (fieldName, args) => { + const utility = config4.getUtility({ + type: "styleFieldDefinition", + name: fieldName + }); + return utility.method?.(args) ?? []; +}; +export { + InitAtoms, + applyStyleFieldDefaultsInData, + findStyleDefinitionByName, + flattenToAppURL, + getContentIcon, + getStyleFieldDefinitionsFromRegistry, + getStyleFieldValue, + getStyleFieldsFromBlockSchema, + getStyleFieldsFromSchema, + hasBlocksData, + isDeepEqual, + isEmpty, + isInternalURL, + langmap, + resolveStyleFields, + setStyleFieldValue, + useFieldFocusAtom, + useFieldFocusedAtom, + useFieldValueFocusedAtom, + useSetFieldFocusedAtom +}; diff --git a/packages/react-router/dist/index.cjs b/packages/react-router/dist/index.cjs new file mode 100644 index 00000000000..9df9ef31338 --- /dev/null +++ b/packages/react-router/dist/index.cjs @@ -0,0 +1,7749 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// ../../node_modules/.pnpm/pathe@1.1.2/node_modules/pathe/dist/shared/pathe.1f0a373c.cjs +var require_pathe_1f0a373c = __commonJS({ + "../../node_modules/.pnpm/pathe@1.1.2/node_modules/pathe/dist/shared/pathe.1f0a373c.cjs"(exports2) { + "use strict"; + var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//; + function normalizeWindowsPath(input = "") { + if (!input) { + return input; + } + return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase()); + } + var _UNC_REGEX = /^[/\\]{2}/; + var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/; + var _DRIVE_LETTER_RE = /^[A-Za-z]:$/; + var _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/; + var sep = "/"; + var delimiter = ":"; + var normalize = function(path3) { + if (path3.length === 0) { + return "."; + } + path3 = normalizeWindowsPath(path3); + const isUNCPath = path3.match(_UNC_REGEX); + const isPathAbsolute = isAbsolute(path3); + const trailingSeparator = path3[path3.length - 1] === "/"; + path3 = normalizeString(path3, !isPathAbsolute); + if (path3.length === 0) { + if (isPathAbsolute) { + return "/"; + } + return trailingSeparator ? "./" : "."; + } + if (trailingSeparator) { + path3 += "/"; + } + if (_DRIVE_LETTER_RE.test(path3)) { + path3 += "/"; + } + if (isUNCPath) { + if (!isPathAbsolute) { + return `//./${path3}`; + } + return `//${path3}`; + } + return isPathAbsolute && !isAbsolute(path3) ? `/${path3}` : path3; + }; + var join = function(...arguments_) { + if (arguments_.length === 0) { + return "."; + } + let joined; + for (const argument of arguments_) { + if (argument && argument.length > 0) { + if (joined === void 0) { + joined = argument; + } else { + joined += `/${argument}`; + } + } + } + if (joined === void 0) { + return "."; + } + return normalize(joined.replace(/\/\/+/g, "/")); + }; + function cwd() { + if (typeof process !== "undefined" && typeof process.cwd === "function") { + return process.cwd().replace(/\\/g, "/"); + } + return "/"; + } + var resolve = function(...arguments_) { + arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument)); + let resolvedPath = ""; + let resolvedAbsolute = false; + for (let index2 = arguments_.length - 1; index2 >= -1 && !resolvedAbsolute; index2--) { + const path3 = index2 >= 0 ? arguments_[index2] : cwd(); + if (!path3 || path3.length === 0) { + continue; + } + resolvedPath = `${path3}/${resolvedPath}`; + resolvedAbsolute = isAbsolute(path3); + } + resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute); + if (resolvedAbsolute && !isAbsolute(resolvedPath)) { + return `/${resolvedPath}`; + } + return resolvedPath.length > 0 ? resolvedPath : "."; + }; + function normalizeString(path3, allowAboveRoot) { + let res = ""; + let lastSegmentLength = 0; + let lastSlash = -1; + let dots = 0; + let char = null; + for (let index2 = 0; index2 <= path3.length; ++index2) { + if (index2 < path3.length) { + char = path3[index2]; + } else if (char === "/") { + break; + } else { + char = "/"; + } + if (char === "/") { + if (lastSlash === index2 - 1 || dots === 1) ; + else if (dots === 2) { + if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") { + if (res.length > 2) { + const lastSlashIndex = res.lastIndexOf("/"); + if (lastSlashIndex === -1) { + res = ""; + lastSegmentLength = 0; + } else { + res = res.slice(0, lastSlashIndex); + lastSegmentLength = res.length - 1 - res.lastIndexOf("/"); + } + lastSlash = index2; + dots = 0; + continue; + } else if (res.length > 0) { + res = ""; + lastSegmentLength = 0; + lastSlash = index2; + dots = 0; + continue; + } + } + if (allowAboveRoot) { + res += res.length > 0 ? "/.." : ".."; + lastSegmentLength = 2; + } + } else { + if (res.length > 0) { + res += `/${path3.slice(lastSlash + 1, index2)}`; + } else { + res = path3.slice(lastSlash + 1, index2); + } + lastSegmentLength = index2 - lastSlash - 1; + } + lastSlash = index2; + dots = 0; + } else if (char === "." && dots !== -1) { + ++dots; + } else { + dots = -1; + } + } + return res; + } + var isAbsolute = function(p) { + return _IS_ABSOLUTE_RE.test(p); + }; + var toNamespacedPath = function(p) { + return normalizeWindowsPath(p); + }; + var _EXTNAME_RE = /.(\.[^./]+)$/; + var extname = function(p) { + const match = _EXTNAME_RE.exec(normalizeWindowsPath(p)); + return match && match[1] || ""; + }; + var relative2 = function(from, to) { + const _from = resolve(from).replace(_ROOT_FOLDER_RE, "$1").split("/"); + const _to = resolve(to).replace(_ROOT_FOLDER_RE, "$1").split("/"); + if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0]) { + return _to.join("/"); + } + const _fromCopy = [..._from]; + for (const segment of _fromCopy) { + if (_to[0] !== segment) { + break; + } + _from.shift(); + _to.shift(); + } + return [..._from.map(() => ".."), ..._to].join("/"); + }; + var dirname = function(p) { + const segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1); + if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) { + segments[0] += "/"; + } + return segments.join("/") || (isAbsolute(p) ? "/" : "."); + }; + var format = function(p) { + const segments = [p.root, p.dir, p.base ?? p.name + p.ext].filter(Boolean); + return normalizeWindowsPath( + p.root ? resolve(...segments) : segments.join("/") + ); + }; + var basename = function(p, extension) { + const lastSegment = normalizeWindowsPath(p).split("/").pop(); + return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment; + }; + var parse = function(p) { + const root = normalizeWindowsPath(p).split("/").shift() || "/"; + const base = basename(p); + const extension = extname(base); + return { + root, + dir: dirname(p), + base, + ext: extension, + name: base.slice(0, base.length - extension.length) + }; + }; + var path2 = { + __proto__: null, + basename, + delimiter, + dirname, + extname, + format, + isAbsolute, + join, + normalize, + normalizeString, + parse, + relative: relative2, + resolve, + sep, + toNamespacedPath + }; + exports2.basename = basename; + exports2.delimiter = delimiter; + exports2.dirname = dirname; + exports2.extname = extname; + exports2.format = format; + exports2.isAbsolute = isAbsolute; + exports2.join = join; + exports2.normalize = normalize; + exports2.normalizeString = normalizeString; + exports2.normalizeWindowsPath = normalizeWindowsPath; + exports2.parse = parse; + exports2.path = path2; + exports2.relative = relative2; + exports2.resolve = resolve; + exports2.sep = sep; + exports2.toNamespacedPath = toNamespacedPath; + } +}); + +// ../../node_modules/.pnpm/pathe@1.1.2/node_modules/pathe/dist/index.cjs +var require_dist = __commonJS({ + "../../node_modules/.pnpm/pathe@1.1.2/node_modules/pathe/dist/index.cjs"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var index2 = require_pathe_1f0a373c(); + exports2.basename = index2.basename; + exports2.default = index2.path; + exports2.delimiter = index2.delimiter; + exports2.dirname = index2.dirname; + exports2.extname = index2.extname; + exports2.format = index2.format; + exports2.isAbsolute = index2.isAbsolute; + exports2.join = index2.join; + exports2.normalize = index2.normalize; + exports2.normalizeString = index2.normalizeString; + exports2.parse = index2.parse; + exports2.relative = index2.relative; + exports2.resolve = index2.resolve; + exports2.sep = index2.sep; + exports2.toNamespacedPath = index2.toNamespacedPath; + } +}); + +// ../../node_modules/.pnpm/valibot@1.2.0_typescript@5.9.2/node_modules/valibot/dist/index.cjs +var require_dist2 = __commonJS({ + "../../node_modules/.pnpm/valibot@1.2.0_typescript@5.9.2/node_modules/valibot/dist/index.cjs"(exports2) { + "use strict"; + var store$4; + function setGlobalConfig(config$1) { + store$4 = { + ...store$4, + ...config$1 + }; + } + // @__NO_SIDE_EFFECTS__ + function getGlobalConfig(config$1) { + return { + lang: config$1?.lang ?? store$4?.lang, + message: config$1?.message, + abortEarly: config$1?.abortEarly ?? store$4?.abortEarly, + abortPipeEarly: config$1?.abortPipeEarly ?? store$4?.abortPipeEarly + }; + } + function deleteGlobalConfig() { + store$4 = void 0; + } + var store$3; + function setGlobalMessage(message$1, lang) { + if (!store$3) store$3 = /* @__PURE__ */ new Map(); + store$3.set(lang, message$1); + } + // @__NO_SIDE_EFFECTS__ + function getGlobalMessage(lang) { + return store$3?.get(lang); + } + function deleteGlobalMessage(lang) { + store$3?.delete(lang); + } + var store$2; + function setSchemaMessage(message$1, lang) { + if (!store$2) store$2 = /* @__PURE__ */ new Map(); + store$2.set(lang, message$1); + } + // @__NO_SIDE_EFFECTS__ + function getSchemaMessage(lang) { + return store$2?.get(lang); + } + function deleteSchemaMessage(lang) { + store$2?.delete(lang); + } + var store$1; + function setSpecificMessage(reference, message$1, lang) { + if (!store$1) store$1 = /* @__PURE__ */ new Map(); + if (!store$1.get(reference)) store$1.set(reference, /* @__PURE__ */ new Map()); + store$1.get(reference).set(lang, message$1); + } + // @__NO_SIDE_EFFECTS__ + function getSpecificMessage(reference, lang) { + return store$1?.get(reference)?.get(lang); + } + function deleteSpecificMessage(reference, lang) { + store$1?.get(reference)?.delete(lang); + } + // @__NO_SIDE_EFFECTS__ + function _stringify(input) { + const type = typeof input; + if (type === "string") return `"${input}"`; + if (type === "number" || type === "bigint" || type === "boolean") return `${input}`; + if (type === "object" || type === "function") return (input && Object.getPrototypeOf(input)?.constructor?.name) ?? "null"; + return type; + } + function _addIssue(context, label, dataset, config$1, other) { + const input = other && "input" in other ? other.input : dataset.value; + const expected = other?.expected ?? context.expects ?? null; + const received = other?.received ?? /* @__PURE__ */ _stringify(input); + const issue = { + kind: context.kind, + type: context.type, + input, + expected, + received, + message: `Invalid ${label}: ${expected ? `Expected ${expected} but r` : "R"}eceived ${received}`, + requirement: context.requirement, + path: other?.path, + issues: other?.issues, + lang: config$1.lang, + abortEarly: config$1.abortEarly, + abortPipeEarly: config$1.abortPipeEarly + }; + const isSchema = context.kind === "schema"; + const message$1 = other?.message ?? context.message ?? /* @__PURE__ */ getSpecificMessage(context.reference, issue.lang) ?? (isSchema ? /* @__PURE__ */ getSchemaMessage(issue.lang) : null) ?? config$1.message ?? /* @__PURE__ */ getGlobalMessage(issue.lang); + if (message$1 !== void 0) issue.message = typeof message$1 === "function" ? message$1(issue) : message$1; + if (isSchema) dataset.typed = false; + if (dataset.issues) dataset.issues.push(issue); + else dataset.issues = [issue]; + } + var textEncoder; + // @__NO_SIDE_EFFECTS__ + function _getByteCount(input) { + if (!textEncoder) textEncoder = new TextEncoder(); + return textEncoder.encode(input).length; + } + var segmenter; + // @__NO_SIDE_EFFECTS__ + function _getGraphemeCount(input) { + if (!segmenter) segmenter = new Intl.Segmenter(); + const segments = segmenter.segment(input); + let count = 0; + for (const _ of segments) count++; + return count; + } + // @__NO_SIDE_EFFECTS__ + function _getLastMetadata(schema, type) { + if ("pipe" in schema) { + const nestedSchemas = []; + for (let index2 = schema.pipe.length - 1; index2 >= 0; index2--) { + const item = schema.pipe[index2]; + if (item.kind === "schema" && "pipe" in item) nestedSchemas.push(item); + else if (item.kind === "metadata" && item.type === type) return item[type]; + } + for (const nestedSchema of nestedSchemas) { + const result = /* @__PURE__ */ _getLastMetadata(nestedSchema, type); + if (result !== void 0) return result; + } + } + } + // @__NO_SIDE_EFFECTS__ + function _getStandardProps(context) { + return { + version: 1, + vendor: "valibot", + validate(value$1) { + return context["~run"]({ value: value$1 }, /* @__PURE__ */ getGlobalConfig()); + } + }; + } + var store; + // @__NO_SIDE_EFFECTS__ + function _getWordCount(locales, input) { + if (!store) store = /* @__PURE__ */ new Map(); + if (!store.get(locales)) store.set(locales, new Intl.Segmenter(locales, { granularity: "word" })); + const segments = store.get(locales).segment(input); + let count = 0; + for (const segment of segments) if (segment.isWordLike) count++; + return count; + } + var NON_DIGIT_REGEX = /\D/gu; + // @__NO_SIDE_EFFECTS__ + function _isLuhnAlgo(input) { + const number$1 = input.replace(NON_DIGIT_REGEX, ""); + let length$1 = number$1.length; + let bit = 1; + let sum = 0; + while (length$1) { + const value$1 = +number$1[--length$1]; + bit ^= 1; + sum += bit ? [ + 0, + 2, + 4, + 6, + 8, + 1, + 3, + 5, + 7, + 9 + ][value$1] : value$1; + } + return sum % 10 === 0; + } + // @__NO_SIDE_EFFECTS__ + function _isValidObjectKey(object$1, key) { + return Object.hasOwn(object$1, key) && key !== "__proto__" && key !== "prototype" && key !== "constructor"; + } + // @__NO_SIDE_EFFECTS__ + function _joinExpects(values$1, separator) { + const list = [...new Set(values$1)]; + if (list.length > 1) return `(${list.join(` ${separator} `)})`; + return list[0] ?? "never"; + } + // @__NO_SIDE_EFFECTS__ + function entriesFromList(list, schema) { + const entries$1 = {}; + for (const key of list) entries$1[key] = schema; + return entries$1; + } + // @__NO_SIDE_EFFECTS__ + function entriesFromObjects(schemas) { + const entries$1 = {}; + for (const schema of schemas) Object.assign(entries$1, schema.entries); + return entries$1; + } + // @__NO_SIDE_EFFECTS__ + function getDotPath(issue) { + if (issue.path) { + let key = ""; + for (const item of issue.path) if (typeof item.key === "string" || typeof item.key === "number") if (key) key += `.${item.key}`; + else key += item.key; + else return null; + return key; + } + return null; + } + // @__NO_SIDE_EFFECTS__ + function isOfKind(kind, object$1) { + return object$1.kind === kind; + } + // @__NO_SIDE_EFFECTS__ + function isOfType(type, object$1) { + return object$1.type === type; + } + // @__NO_SIDE_EFFECTS__ + function isValiError(error) { + return error instanceof ValiError; + } + var ValiError = class extends Error { + /** + * Creates a Valibot error with useful information. + * + * @param issues The error issues. + */ + constructor(issues) { + super(issues[0].message); + this.name = "ValiError"; + this.issues = issues; + } + }; + // @__NO_SIDE_EFFECTS__ + function args(schema) { + return { + kind: "transformation", + type: "args", + reference: args, + async: false, + schema, + "~run"(dataset, config$1) { + const func = dataset.value; + dataset.value = (...args_) => { + const argsDataset = this.schema["~run"]({ value: args_ }, config$1); + if (argsDataset.issues) throw new ValiError(argsDataset.issues); + return func(...argsDataset.value); + }; + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function argsAsync(schema) { + return { + kind: "transformation", + type: "args", + reference: argsAsync, + async: false, + schema, + "~run"(dataset, config$1) { + const func = dataset.value; + dataset.value = async (...args$1) => { + const argsDataset = await schema["~run"]({ value: args$1 }, config$1); + if (argsDataset.issues) throw new ValiError(argsDataset.issues); + return func(...argsDataset.value); + }; + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function awaitAsync() { + return { + kind: "transformation", + type: "await", + reference: awaitAsync, + async: true, + async "~run"(dataset) { + dataset.value = await dataset.value; + return dataset; + } + }; + } + var BASE64_REGEX = /^(?:[\da-z+/]{4})*(?:[\da-z+/]{2}==|[\da-z+/]{3}=)?$/iu; + var BIC_REGEX = /^[A-Z]{6}(?!00)[\dA-Z]{2}(?:[\dA-Z]{3})?$/u; + var CUID2_REGEX = /^[a-z][\da-z]*$/u; + var DECIMAL_REGEX = /^[+-]?(?:\d*\.)?\d+$/u; + var DIGITS_REGEX = /^\d+$/u; + var EMAIL_REGEX = /^[\w+-]+(?:\.[\w+-]+)*@[\da-z]+(?:[.-][\da-z]+)*\.[a-z]{2,}$/iu; + var EMOJI_REGEX = /^(?:[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|(?![\p{Emoji_Modifier_Base}\u{1F1E6}-\u{1F1FF}])\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|(?![\p{Emoji_Modifier_Base}\u{1F1E6}-\u{1F1FF}])\p{Emoji_Presentation}))*)+$/u; + var HEXADECIMAL_REGEX = /^(?:0[hx])?[\da-fA-F]+$/u; + var HEX_COLOR_REGEX = /^#(?:[\da-fA-F]{3,4}|[\da-fA-F]{6}|[\da-fA-F]{8})$/u; + var IMEI_REGEX = /^\d{15}$|^\d{2}-\d{6}-\d{6}-\d$/u; + var IPV4_REGEX = /^(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])(?:\.(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])){3}$/u; + var IPV6_REGEX = /^(?:(?:[\da-f]{1,4}:){7}[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,7}:|(?:[\da-f]{1,4}:){1,6}:[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,5}(?::[\da-f]{1,4}){1,2}|(?:[\da-f]{1,4}:){1,4}(?::[\da-f]{1,4}){1,3}|(?:[\da-f]{1,4}:){1,3}(?::[\da-f]{1,4}){1,4}|(?:[\da-f]{1,4}:){1,2}(?::[\da-f]{1,4}){1,5}|[\da-f]{1,4}:(?::[\da-f]{1,4}){1,6}|:(?:(?::[\da-f]{1,4}){1,7}|:)|fe80:(?::[\da-f]{0,4}){0,4}%[\da-z]+|::(?:f{4}(?::0{1,4})?:)?(?:(?:25[0-5]|(?:2[0-4]|1?\d)?\d)\.){3}(?:25[0-5]|(?:2[0-4]|1?\d)?\d)|(?:[\da-f]{1,4}:){1,4}:(?:(?:25[0-5]|(?:2[0-4]|1?\d)?\d)\.){3}(?:25[0-5]|(?:2[0-4]|1?\d)?\d))$/iu; + var IP_REGEX = /^(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])(?:\.(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])){3}$|^(?:(?:[\da-f]{1,4}:){7}[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,7}:|(?:[\da-f]{1,4}:){1,6}:[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,5}(?::[\da-f]{1,4}){1,2}|(?:[\da-f]{1,4}:){1,4}(?::[\da-f]{1,4}){1,3}|(?:[\da-f]{1,4}:){1,3}(?::[\da-f]{1,4}){1,4}|(?:[\da-f]{1,4}:){1,2}(?::[\da-f]{1,4}){1,5}|[\da-f]{1,4}:(?::[\da-f]{1,4}){1,6}|:(?:(?::[\da-f]{1,4}){1,7}|:)|fe80:(?::[\da-f]{0,4}){0,4}%[\da-z]+|::(?:f{4}(?::0{1,4})?:)?(?:(?:25[0-5]|(?:2[0-4]|1?\d)?\d)\.){3}(?:25[0-5]|(?:2[0-4]|1?\d)?\d)|(?:[\da-f]{1,4}:){1,4}:(?:(?:25[0-5]|(?:2[0-4]|1?\d)?\d)\.){3}(?:25[0-5]|(?:2[0-4]|1?\d)?\d))$/iu; + var ISO_DATE_REGEX = /^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])$/u; + var ISO_DATE_TIME_REGEX = /^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])[T ](?:0\d|1\d|2[0-3]):[0-5]\d$/u; + var ISO_TIME_REGEX = /^(?:0\d|1\d|2[0-3]):[0-5]\d$/u; + var ISO_TIME_SECOND_REGEX = /^(?:0\d|1\d|2[0-3])(?::[0-5]\d){2}$/u; + var ISO_TIMESTAMP_REGEX = /^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])[T ](?:0\d|1\d|2[0-3])(?::[0-5]\d){2}(?:\.\d{1,9})?(?:Z|[+-](?:0\d|1\d|2[0-3])(?::?[0-5]\d)?)$/u; + var ISO_WEEK_REGEX = /^\d{4}-W(?:0[1-9]|[1-4]\d|5[0-3])$/u; + var MAC48_REGEX = /^(?:[\da-f]{2}:){5}[\da-f]{2}$|^(?:[\da-f]{2}-){5}[\da-f]{2}$|^(?:[\da-f]{4}\.){2}[\da-f]{4}$/iu; + var MAC64_REGEX = /^(?:[\da-f]{2}:){7}[\da-f]{2}$|^(?:[\da-f]{2}-){7}[\da-f]{2}$|^(?:[\da-f]{4}\.){3}[\da-f]{4}$|^(?:[\da-f]{4}:){3}[\da-f]{4}$/iu; + var MAC_REGEX = /^(?:[\da-f]{2}:){5}[\da-f]{2}$|^(?:[\da-f]{2}-){5}[\da-f]{2}$|^(?:[\da-f]{4}\.){2}[\da-f]{4}$|^(?:[\da-f]{2}:){7}[\da-f]{2}$|^(?:[\da-f]{2}-){7}[\da-f]{2}$|^(?:[\da-f]{4}\.){3}[\da-f]{4}$|^(?:[\da-f]{4}:){3}[\da-f]{4}$/iu; + var NANO_ID_REGEX = /^[\w-]+$/u; + var OCTAL_REGEX = /^(?:0o)?[0-7]+$/u; + var RFC_EMAIL_REGEX = /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/; + var SLUG_REGEX = /^[\da-z]+(?:[-_][\da-z]+)*$/u; + var ULID_REGEX = /^[\da-hjkmnp-tv-zA-HJKMNP-TV-Z]{26}$/u; + var UUID_REGEX = /^[\da-f]{8}(?:-[\da-f]{4}){3}-[\da-f]{12}$/iu; + // @__NO_SIDE_EFFECTS__ + function base64(message$1) { + return { + kind: "validation", + type: "base64", + reference: base64, + async: false, + expects: null, + requirement: BASE64_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "Base64", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function bic(message$1) { + return { + kind: "validation", + type: "bic", + reference: bic, + async: false, + expects: null, + requirement: BIC_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "BIC", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function brand(name) { + return { + kind: "transformation", + type: "brand", + reference: brand, + async: false, + name, + "~run"(dataset) { + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function bytes(requirement, message$1) { + return { + kind: "validation", + type: "bytes", + reference: bytes, + async: false, + expects: `${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const length$1 = /* @__PURE__ */ _getByteCount(dataset.value); + if (length$1 !== this.requirement) _addIssue(this, "bytes", dataset, config$1, { received: `${length$1}` }); + } + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function check(requirement, message$1) { + return { + kind: "validation", + type: "check", + reference: check, + async: false, + expects: null, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "input", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function checkAsync(requirement, message$1) { + return { + kind: "validation", + type: "check", + reference: checkAsync, + async: true, + expects: null, + requirement, + message: message$1, + async "~run"(dataset, config$1) { + if (dataset.typed && !await this.requirement(dataset.value)) _addIssue(this, "input", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function checkItems(requirement, message$1) { + return { + kind: "validation", + type: "check_items", + reference: checkItems, + async: false, + expects: null, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) for (let index2 = 0; index2 < dataset.value.length; index2++) { + const item = dataset.value[index2]; + if (!this.requirement(item, index2, dataset.value)) _addIssue(this, "item", dataset, config$1, { + input: item, + path: [{ + type: "array", + origin: "value", + input: dataset.value, + key: index2, + value: item + }] + }); + } + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function checkItemsAsync(requirement, message$1) { + return { + kind: "validation", + type: "check_items", + reference: checkItemsAsync, + async: true, + expects: null, + requirement, + message: message$1, + async "~run"(dataset, config$1) { + if (dataset.typed) { + const requirementResults = await Promise.all(dataset.value.map(this.requirement)); + for (let index2 = 0; index2 < dataset.value.length; index2++) if (!requirementResults[index2]) { + const item = dataset.value[index2]; + _addIssue(this, "item", dataset, config$1, { + input: item, + path: [{ + type: "array", + origin: "value", + input: dataset.value, + key: index2, + value: item + }] + }); + } + } + return dataset; + } + }; + } + var CREDIT_CARD_REGEX = /^(?:\d{14,19}|\d{4}(?: \d{3,6}){2,4}|\d{4}(?:-\d{3,6}){2,4})$/u; + var SANITIZE_REGEX = /[- ]/gu; + var PROVIDER_REGEX_LIST = [ + /^3[47]\d{13}$/u, + /^3(?:0[0-5]|[68]\d)\d{11,13}$/u, + /^6(?:011|5\d{2})\d{12,15}$/u, + /^(?:2131|1800|35\d{3})\d{11}$/u, + /^5[1-5]\d{2}|(?:222\d|22[3-9]\d|2[3-6]\d{2}|27[01]\d|2720)\d{12}$/u, + /^(?:6[27]\d{14,17}|81\d{14,17})$/u, + /^4\d{12}(?:\d{3,6})?$/u + ]; + // @__NO_SIDE_EFFECTS__ + function creditCard(message$1) { + return { + kind: "validation", + type: "credit_card", + reference: creditCard, + async: false, + expects: null, + requirement(input) { + let sanitized; + return CREDIT_CARD_REGEX.test(input) && (sanitized = input.replace(SANITIZE_REGEX, "")) && PROVIDER_REGEX_LIST.some((regex$1) => regex$1.test(sanitized)) && /* @__PURE__ */ _isLuhnAlgo(sanitized); + }, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "credit card", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function cuid2(message$1) { + return { + kind: "validation", + type: "cuid2", + reference: cuid2, + async: false, + expects: null, + requirement: CUID2_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "Cuid2", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function decimal(message$1) { + return { + kind: "validation", + type: "decimal", + reference: decimal, + async: false, + expects: null, + requirement: DECIMAL_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "decimal", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function description(description_) { + return { + kind: "metadata", + type: "description", + reference: description, + description: description_ + }; + } + // @__NO_SIDE_EFFECTS__ + function digits(message$1) { + return { + kind: "validation", + type: "digits", + reference: digits, + async: false, + expects: null, + requirement: DIGITS_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "digits", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function email(message$1) { + return { + kind: "validation", + type: "email", + reference: email, + expects: null, + async: false, + requirement: EMAIL_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "email", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function emoji(message$1) { + return { + kind: "validation", + type: "emoji", + reference: emoji, + async: false, + expects: null, + requirement: EMOJI_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "emoji", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function empty(message$1) { + return { + kind: "validation", + type: "empty", + reference: empty, + async: false, + expects: "0", + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value.length > 0) _addIssue(this, "length", dataset, config$1, { received: `${dataset.value.length}` }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function endsWith(requirement, message$1) { + return { + kind: "validation", + type: "ends_with", + reference: endsWith, + async: false, + expects: `"${requirement}"`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !dataset.value.endsWith(this.requirement)) _addIssue(this, "end", dataset, config$1, { received: `"${dataset.value.slice(-this.requirement.length)}"` }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function entries(requirement, message$1) { + return { + kind: "validation", + type: "entries", + reference: entries, + async: false, + expects: `${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (!dataset.typed) return dataset; + const count = Object.keys(dataset.value).length; + if (dataset.typed && count !== this.requirement) _addIssue(this, "entries", dataset, config$1, { received: `${count}` }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function everyItem(requirement, message$1) { + return { + kind: "validation", + type: "every_item", + reference: everyItem, + async: false, + expects: null, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !dataset.value.every(this.requirement)) _addIssue(this, "item", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function examples(examples_) { + return { + kind: "metadata", + type: "examples", + reference: examples, + examples: examples_ + }; + } + // @__NO_SIDE_EFFECTS__ + function excludes(requirement, message$1) { + const received = /* @__PURE__ */ _stringify(requirement); + return { + kind: "validation", + type: "excludes", + reference: excludes, + async: false, + expects: `!${received}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value.includes(this.requirement)) _addIssue(this, "content", dataset, config$1, { received }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function filterItems(operation) { + return { + kind: "transformation", + type: "filter_items", + reference: filterItems, + async: false, + operation, + "~run"(dataset) { + dataset.value = dataset.value.filter(this.operation); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function findItem(operation) { + return { + kind: "transformation", + type: "find_item", + reference: findItem, + async: false, + operation, + "~run"(dataset) { + dataset.value = dataset.value.find(this.operation); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function finite(message$1) { + return { + kind: "validation", + type: "finite", + reference: finite, + async: false, + expects: null, + requirement: Number.isFinite, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "finite", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function flavor(name) { + return { + kind: "transformation", + type: "flavor", + reference: flavor, + async: false, + name, + "~run"(dataset) { + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function graphemes(requirement, message$1) { + return { + kind: "validation", + type: "graphemes", + reference: graphemes, + async: false, + expects: `${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const count = /* @__PURE__ */ _getGraphemeCount(dataset.value); + if (count !== this.requirement) _addIssue(this, "graphemes", dataset, config$1, { received: `${count}` }); + } + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function gtValue(requirement, message$1) { + return { + kind: "validation", + type: "gt_value", + reference: gtValue, + async: false, + expects: `>${requirement instanceof Date ? requirement.toJSON() : /* @__PURE__ */ _stringify(requirement)}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !(dataset.value > this.requirement)) _addIssue(this, "value", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) }); + return dataset; + } + }; + } + var HASH_LENGTHS = { + md4: 32, + md5: 32, + sha1: 40, + sha256: 64, + sha384: 96, + sha512: 128, + ripemd128: 32, + ripemd160: 40, + tiger128: 32, + tiger160: 40, + tiger192: 48, + crc32: 8, + crc32b: 8, + adler32: 8 + }; + // @__NO_SIDE_EFFECTS__ + function hash(types, message$1) { + return { + kind: "validation", + type: "hash", + reference: hash, + expects: null, + async: false, + requirement: RegExp(types.map((type) => `^[a-f0-9]{${HASH_LENGTHS[type]}}$`).join("|"), "iu"), + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "hash", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function hexadecimal(message$1) { + return { + kind: "validation", + type: "hexadecimal", + reference: hexadecimal, + async: false, + expects: null, + requirement: HEXADECIMAL_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "hexadecimal", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function hexColor(message$1) { + return { + kind: "validation", + type: "hex_color", + reference: hexColor, + async: false, + expects: null, + requirement: HEX_COLOR_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "hex color", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function imei(message$1) { + return { + kind: "validation", + type: "imei", + reference: imei, + async: false, + expects: null, + requirement(input) { + return IMEI_REGEX.test(input) && /* @__PURE__ */ _isLuhnAlgo(input); + }, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "IMEI", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function includes(requirement, message$1) { + const expects = /* @__PURE__ */ _stringify(requirement); + return { + kind: "validation", + type: "includes", + reference: includes, + async: false, + expects, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !dataset.value.includes(this.requirement)) _addIssue(this, "content", dataset, config$1, { received: `!${expects}` }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function integer(message$1) { + return { + kind: "validation", + type: "integer", + reference: integer, + async: false, + expects: null, + requirement: Number.isInteger, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "integer", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function ip(message$1) { + return { + kind: "validation", + type: "ip", + reference: ip, + async: false, + expects: null, + requirement: IP_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "IP", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function ipv4(message$1) { + return { + kind: "validation", + type: "ipv4", + reference: ipv4, + async: false, + expects: null, + requirement: IPV4_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "IPv4", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function ipv6(message$1) { + return { + kind: "validation", + type: "ipv6", + reference: ipv6, + async: false, + expects: null, + requirement: IPV6_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "IPv6", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function isoDate(message$1) { + return { + kind: "validation", + type: "iso_date", + reference: isoDate, + async: false, + expects: null, + requirement: ISO_DATE_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "date", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function isoDateTime(message$1) { + return { + kind: "validation", + type: "iso_date_time", + reference: isoDateTime, + async: false, + expects: null, + requirement: ISO_DATE_TIME_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "date-time", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function isoTime(message$1) { + return { + kind: "validation", + type: "iso_time", + reference: isoTime, + async: false, + expects: null, + requirement: ISO_TIME_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "time", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function isoTimeSecond(message$1) { + return { + kind: "validation", + type: "iso_time_second", + reference: isoTimeSecond, + async: false, + expects: null, + requirement: ISO_TIME_SECOND_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "time-second", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function isoTimestamp(message$1) { + return { + kind: "validation", + type: "iso_timestamp", + reference: isoTimestamp, + async: false, + expects: null, + requirement: ISO_TIMESTAMP_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "timestamp", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function isoWeek(message$1) { + return { + kind: "validation", + type: "iso_week", + reference: isoWeek, + async: false, + expects: null, + requirement: ISO_WEEK_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "week", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function length(requirement, message$1) { + return { + kind: "validation", + type: "length", + reference: length, + async: false, + expects: `${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value.length !== this.requirement) _addIssue(this, "length", dataset, config$1, { received: `${dataset.value.length}` }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function ltValue(requirement, message$1) { + return { + kind: "validation", + type: "lt_value", + reference: ltValue, + async: false, + expects: `<${requirement instanceof Date ? requirement.toJSON() : /* @__PURE__ */ _stringify(requirement)}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !(dataset.value < this.requirement)) _addIssue(this, "value", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function mac(message$1) { + return { + kind: "validation", + type: "mac", + reference: mac, + async: false, + expects: null, + requirement: MAC_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "MAC", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function mac48(message$1) { + return { + kind: "validation", + type: "mac48", + reference: mac48, + async: false, + expects: null, + requirement: MAC48_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "48-bit MAC", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function mac64(message$1) { + return { + kind: "validation", + type: "mac64", + reference: mac64, + async: false, + expects: null, + requirement: MAC64_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "64-bit MAC", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function mapItems(operation) { + return { + kind: "transformation", + type: "map_items", + reference: mapItems, + async: false, + operation, + "~run"(dataset) { + dataset.value = dataset.value.map(this.operation); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function maxBytes(requirement, message$1) { + return { + kind: "validation", + type: "max_bytes", + reference: maxBytes, + async: false, + expects: `<=${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const length$1 = /* @__PURE__ */ _getByteCount(dataset.value); + if (length$1 > this.requirement) _addIssue(this, "bytes", dataset, config$1, { received: `${length$1}` }); + } + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function maxEntries(requirement, message$1) { + return { + kind: "validation", + type: "max_entries", + reference: maxEntries, + async: false, + expects: `<=${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (!dataset.typed) return dataset; + const count = Object.keys(dataset.value).length; + if (dataset.typed && count > this.requirement) _addIssue(this, "entries", dataset, config$1, { received: `${count}` }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function maxGraphemes(requirement, message$1) { + return { + kind: "validation", + type: "max_graphemes", + reference: maxGraphemes, + async: false, + expects: `<=${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const count = /* @__PURE__ */ _getGraphemeCount(dataset.value); + if (count > this.requirement) _addIssue(this, "graphemes", dataset, config$1, { received: `${count}` }); + } + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function maxLength(requirement, message$1) { + return { + kind: "validation", + type: "max_length", + reference: maxLength, + async: false, + expects: `<=${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value.length > this.requirement) _addIssue(this, "length", dataset, config$1, { received: `${dataset.value.length}` }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function maxSize(requirement, message$1) { + return { + kind: "validation", + type: "max_size", + reference: maxSize, + async: false, + expects: `<=${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value.size > this.requirement) _addIssue(this, "size", dataset, config$1, { received: `${dataset.value.size}` }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function maxValue(requirement, message$1) { + return { + kind: "validation", + type: "max_value", + reference: maxValue, + async: false, + expects: `<=${requirement instanceof Date ? requirement.toJSON() : /* @__PURE__ */ _stringify(requirement)}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !(dataset.value <= this.requirement)) _addIssue(this, "value", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function maxWords(locales, requirement, message$1) { + return { + kind: "validation", + type: "max_words", + reference: maxWords, + async: false, + expects: `<=${requirement}`, + locales, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const count = /* @__PURE__ */ _getWordCount(this.locales, dataset.value); + if (count > this.requirement) _addIssue(this, "words", dataset, config$1, { received: `${count}` }); + } + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function metadata(metadata_) { + return { + kind: "metadata", + type: "metadata", + reference: metadata, + metadata: metadata_ + }; + } + // @__NO_SIDE_EFFECTS__ + function mimeType(requirement, message$1) { + return { + kind: "validation", + type: "mime_type", + reference: mimeType, + async: false, + expects: /* @__PURE__ */ _joinExpects(requirement.map((option) => `"${option}"`), "|"), + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.includes(dataset.value.type)) _addIssue(this, "MIME type", dataset, config$1, { received: `"${dataset.value.type}"` }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function minBytes(requirement, message$1) { + return { + kind: "validation", + type: "min_bytes", + reference: minBytes, + async: false, + expects: `>=${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const length$1 = /* @__PURE__ */ _getByteCount(dataset.value); + if (length$1 < this.requirement) _addIssue(this, "bytes", dataset, config$1, { received: `${length$1}` }); + } + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function minEntries(requirement, message$1) { + return { + kind: "validation", + type: "min_entries", + reference: minEntries, + async: false, + expects: `>=${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (!dataset.typed) return dataset; + const count = Object.keys(dataset.value).length; + if (dataset.typed && count < this.requirement) _addIssue(this, "entries", dataset, config$1, { received: `${count}` }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function minGraphemes(requirement, message$1) { + return { + kind: "validation", + type: "min_graphemes", + reference: minGraphemes, + async: false, + expects: `>=${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const count = /* @__PURE__ */ _getGraphemeCount(dataset.value); + if (count < this.requirement) _addIssue(this, "graphemes", dataset, config$1, { received: `${count}` }); + } + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function minLength(requirement, message$1) { + return { + kind: "validation", + type: "min_length", + reference: minLength, + async: false, + expects: `>=${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value.length < this.requirement) _addIssue(this, "length", dataset, config$1, { received: `${dataset.value.length}` }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function minSize(requirement, message$1) { + return { + kind: "validation", + type: "min_size", + reference: minSize, + async: false, + expects: `>=${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value.size < this.requirement) _addIssue(this, "size", dataset, config$1, { received: `${dataset.value.size}` }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function minValue(requirement, message$1) { + return { + kind: "validation", + type: "min_value", + reference: minValue, + async: false, + expects: `>=${requirement instanceof Date ? requirement.toJSON() : /* @__PURE__ */ _stringify(requirement)}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !(dataset.value >= this.requirement)) _addIssue(this, "value", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function minWords(locales, requirement, message$1) { + return { + kind: "validation", + type: "min_words", + reference: minWords, + async: false, + expects: `>=${requirement}`, + locales, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const count = /* @__PURE__ */ _getWordCount(this.locales, dataset.value); + if (count < this.requirement) _addIssue(this, "words", dataset, config$1, { received: `${count}` }); + } + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function multipleOf(requirement, message$1) { + return { + kind: "validation", + type: "multiple_of", + reference: multipleOf, + async: false, + expects: `%${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value % this.requirement != 0) _addIssue(this, "multiple", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function nanoid(message$1) { + return { + kind: "validation", + type: "nanoid", + reference: nanoid, + async: false, + expects: null, + requirement: NANO_ID_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "Nano ID", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function nonEmpty(message$1) { + return { + kind: "validation", + type: "non_empty", + reference: nonEmpty, + async: false, + expects: "!0", + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value.length === 0) _addIssue(this, "length", dataset, config$1, { received: "0" }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function normalize(form) { + return { + kind: "transformation", + type: "normalize", + reference: normalize, + async: false, + form, + "~run"(dataset) { + dataset.value = dataset.value.normalize(this.form); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function notBytes(requirement, message$1) { + return { + kind: "validation", + type: "not_bytes", + reference: notBytes, + async: false, + expects: `!${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const length$1 = /* @__PURE__ */ _getByteCount(dataset.value); + if (length$1 === this.requirement) _addIssue(this, "bytes", dataset, config$1, { received: `${length$1}` }); + } + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function notEntries(requirement, message$1) { + return { + kind: "validation", + type: "not_entries", + reference: notEntries, + async: false, + expects: `!${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (!dataset.typed) return dataset; + const count = Object.keys(dataset.value).length; + if (dataset.typed && count === this.requirement) _addIssue(this, "entries", dataset, config$1, { received: `${count}` }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function notGraphemes(requirement, message$1) { + return { + kind: "validation", + type: "not_graphemes", + reference: notGraphemes, + async: false, + expects: `!${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const count = /* @__PURE__ */ _getGraphemeCount(dataset.value); + if (count === this.requirement) _addIssue(this, "graphemes", dataset, config$1, { received: `${count}` }); + } + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function notLength(requirement, message$1) { + return { + kind: "validation", + type: "not_length", + reference: notLength, + async: false, + expects: `!${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value.length === this.requirement) _addIssue(this, "length", dataset, config$1, { received: `${dataset.value.length}` }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function notSize(requirement, message$1) { + return { + kind: "validation", + type: "not_size", + reference: notSize, + async: false, + expects: `!${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value.size === this.requirement) _addIssue(this, "size", dataset, config$1, { received: `${dataset.value.size}` }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function notValue(requirement, message$1) { + return { + kind: "validation", + type: "not_value", + reference: notValue, + async: false, + expects: requirement instanceof Date ? `!${requirement.toJSON()}` : `!${/* @__PURE__ */ _stringify(requirement)}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && this.requirement <= dataset.value && this.requirement >= dataset.value) _addIssue(this, "value", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function notValues(requirement, message$1) { + return { + kind: "validation", + type: "not_values", + reference: notValues, + async: false, + expects: `!${/* @__PURE__ */ _joinExpects(requirement.map((value$1) => value$1 instanceof Date ? value$1.toJSON() : /* @__PURE__ */ _stringify(value$1)), "|")}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && this.requirement.some((value$1) => value$1 <= dataset.value && value$1 >= dataset.value)) _addIssue(this, "value", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function notWords(locales, requirement, message$1) { + return { + kind: "validation", + type: "not_words", + reference: notWords, + async: false, + expects: `!${requirement}`, + locales, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const count = /* @__PURE__ */ _getWordCount(this.locales, dataset.value); + if (count === this.requirement) _addIssue(this, "words", dataset, config$1, { received: `${count}` }); + } + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function octal(message$1) { + return { + kind: "validation", + type: "octal", + reference: octal, + async: false, + expects: null, + requirement: OCTAL_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "octal", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function parseJson(config$1, message$1) { + return { + kind: "transformation", + type: "parse_json", + reference: parseJson, + config: config$1, + message: message$1, + async: false, + "~run"(dataset, config$2) { + try { + dataset.value = JSON.parse(dataset.value, this.config?.reviver); + } catch (error) { + if (error instanceof Error) { + _addIssue(this, "JSON", dataset, config$2, { received: `"${error.message}"` }); + dataset.typed = false; + } else throw error; + } + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function _isPartiallyTyped(dataset, paths) { + if (dataset.issues) for (const path2 of paths) for (const issue of dataset.issues) { + let typed = false; + const bound = Math.min(path2.length, issue.path?.length ?? 0); + for (let index2 = 0; index2 < bound; index2++) if (path2[index2] !== issue.path[index2].key && (path2[index2] !== "$" || issue.path[index2].type !== "array")) { + typed = true; + break; + } + if (!typed) return false; + } + return true; + } + // @__NO_SIDE_EFFECTS__ + function partialCheck(paths, requirement, message$1) { + return { + kind: "validation", + type: "partial_check", + reference: partialCheck, + async: false, + expects: null, + paths, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if ((dataset.typed || /* @__PURE__ */ _isPartiallyTyped(dataset, paths)) && !this.requirement(dataset.value)) _addIssue(this, "input", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function partialCheckAsync(paths, requirement, message$1) { + return { + kind: "validation", + type: "partial_check", + reference: partialCheckAsync, + async: true, + expects: null, + paths, + requirement, + message: message$1, + async "~run"(dataset, config$1) { + if ((dataset.typed || /* @__PURE__ */ _isPartiallyTyped(dataset, paths)) && !await this.requirement(dataset.value)) _addIssue(this, "input", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function rawCheck(action) { + return { + kind: "validation", + type: "raw_check", + reference: rawCheck, + async: false, + expects: null, + "~run"(dataset, config$1) { + action({ + dataset, + config: config$1, + addIssue: (info) => _addIssue(this, info?.label ?? "input", dataset, config$1, info) + }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function rawCheckAsync(action) { + return { + kind: "validation", + type: "raw_check", + reference: rawCheckAsync, + async: true, + expects: null, + async "~run"(dataset, config$1) { + await action({ + dataset, + config: config$1, + addIssue: (info) => _addIssue(this, info?.label ?? "input", dataset, config$1, info) + }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function rawTransform(action) { + return { + kind: "transformation", + type: "raw_transform", + reference: rawTransform, + async: false, + "~run"(dataset, config$1) { + const output = action({ + dataset, + config: config$1, + addIssue: (info) => _addIssue(this, info?.label ?? "input", dataset, config$1, info), + NEVER: null + }); + if (dataset.issues) dataset.typed = false; + else dataset.value = output; + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function rawTransformAsync(action) { + return { + kind: "transformation", + type: "raw_transform", + reference: rawTransformAsync, + async: true, + async "~run"(dataset, config$1) { + const output = await action({ + dataset, + config: config$1, + addIssue: (info) => _addIssue(this, info?.label ?? "input", dataset, config$1, info), + NEVER: null + }); + if (dataset.issues) dataset.typed = false; + else dataset.value = output; + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function readonly() { + return { + kind: "transformation", + type: "readonly", + reference: readonly, + async: false, + "~run"(dataset) { + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function reduceItems(operation, initial) { + return { + kind: "transformation", + type: "reduce_items", + reference: reduceItems, + async: false, + operation, + initial, + "~run"(dataset) { + dataset.value = dataset.value.reduce(this.operation, this.initial); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function regex(requirement, message$1) { + return { + kind: "validation", + type: "regex", + reference: regex, + async: false, + expects: `${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "format", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function returns(schema) { + return { + kind: "transformation", + type: "returns", + reference: returns, + async: false, + schema, + "~run"(dataset, config$1) { + const func = dataset.value; + dataset.value = (...args_) => { + const returnsDataset = this.schema["~run"]({ value: func(...args_) }, config$1); + if (returnsDataset.issues) throw new ValiError(returnsDataset.issues); + return returnsDataset.value; + }; + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function returnsAsync(schema) { + return { + kind: "transformation", + type: "returns", + reference: returnsAsync, + async: false, + schema, + "~run"(dataset, config$1) { + const func = dataset.value; + dataset.value = async (...args_) => { + const returnsDataset = await this.schema["~run"]({ value: await func(...args_) }, config$1); + if (returnsDataset.issues) throw new ValiError(returnsDataset.issues); + return returnsDataset.value; + }; + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function rfcEmail(message$1) { + return { + kind: "validation", + type: "rfc_email", + reference: rfcEmail, + expects: null, + async: false, + requirement: RFC_EMAIL_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "email", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function safeInteger(message$1) { + return { + kind: "validation", + type: "safe_integer", + reference: safeInteger, + async: false, + expects: null, + requirement: Number.isSafeInteger, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "safe integer", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function size(requirement, message$1) { + return { + kind: "validation", + type: "size", + reference: size, + async: false, + expects: `${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value.size !== this.requirement) _addIssue(this, "size", dataset, config$1, { received: `${dataset.value.size}` }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function slug(message$1) { + return { + kind: "validation", + type: "slug", + reference: slug, + async: false, + expects: null, + requirement: SLUG_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "slug", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function someItem(requirement, message$1) { + return { + kind: "validation", + type: "some_item", + reference: someItem, + async: false, + expects: null, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !dataset.value.some(this.requirement)) _addIssue(this, "item", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function sortItems(operation) { + return { + kind: "transformation", + type: "sort_items", + reference: sortItems, + async: false, + operation, + "~run"(dataset) { + dataset.value = dataset.value.sort(this.operation); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function startsWith(requirement, message$1) { + return { + kind: "validation", + type: "starts_with", + reference: startsWith, + async: false, + expects: `"${requirement}"`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !dataset.value.startsWith(this.requirement)) _addIssue(this, "start", dataset, config$1, { received: `"${dataset.value.slice(0, this.requirement.length)}"` }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function stringifyJson(config$1, message$1) { + return { + kind: "transformation", + type: "stringify_json", + reference: stringifyJson, + message: message$1, + config: config$1, + async: false, + "~run"(dataset, config$2) { + try { + const output = JSON.stringify(dataset.value, this.config?.replacer, this.config?.space); + if (output === void 0) { + _addIssue(this, "JSON", dataset, config$2); + dataset.typed = false; + } + dataset.value = output; + } catch (error) { + if (error instanceof Error) { + _addIssue(this, "JSON", dataset, config$2, { received: `"${error.message}"` }); + dataset.typed = false; + } else throw error; + } + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function title(title_) { + return { + kind: "metadata", + type: "title", + reference: title, + title: title_ + }; + } + // @__NO_SIDE_EFFECTS__ + function toBigint(message$1) { + return { + kind: "transformation", + type: "to_bigint", + reference: toBigint, + async: false, + message: message$1, + "~run"(dataset, config$1) { + try { + dataset.value = BigInt(dataset.value); + } catch { + _addIssue(this, "bigint", dataset, config$1); + dataset.typed = false; + } + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function toBoolean() { + return { + kind: "transformation", + type: "to_boolean", + reference: toBoolean, + async: false, + "~run"(dataset) { + dataset.value = Boolean(dataset.value); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function toDate(message$1) { + return { + kind: "transformation", + type: "to_date", + reference: toDate, + async: false, + message: message$1, + "~run"(dataset, config$1) { + try { + dataset.value = new Date(dataset.value); + if (isNaN(dataset.value)) { + _addIssue(this, "date", dataset, config$1, { received: '"Invalid Date"' }); + dataset.typed = false; + } + } catch { + _addIssue(this, "date", dataset, config$1); + dataset.typed = false; + } + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function toLowerCase() { + return { + kind: "transformation", + type: "to_lower_case", + reference: toLowerCase, + async: false, + "~run"(dataset) { + dataset.value = dataset.value.toLowerCase(); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function toMaxValue(requirement) { + return { + kind: "transformation", + type: "to_max_value", + reference: toMaxValue, + async: false, + requirement, + "~run"(dataset) { + dataset.value = dataset.value > this.requirement ? this.requirement : dataset.value; + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function toMinValue(requirement) { + return { + kind: "transformation", + type: "to_min_value", + reference: toMinValue, + async: false, + requirement, + "~run"(dataset) { + dataset.value = dataset.value < this.requirement ? this.requirement : dataset.value; + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function toNumber(message$1) { + return { + kind: "transformation", + type: "to_number", + reference: toNumber, + async: false, + message: message$1, + "~run"(dataset, config$1) { + try { + dataset.value = Number(dataset.value); + if (isNaN(dataset.value)) { + _addIssue(this, "number", dataset, config$1); + dataset.typed = false; + } + } catch { + _addIssue(this, "number", dataset, config$1); + dataset.typed = false; + } + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function toString(message$1) { + return { + kind: "transformation", + type: "to_string", + reference: toString, + async: false, + message: message$1, + "~run"(dataset, config$1) { + try { + dataset.value = String(dataset.value); + } catch { + _addIssue(this, "string", dataset, config$1); + dataset.typed = false; + } + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function toUpperCase() { + return { + kind: "transformation", + type: "to_upper_case", + reference: toUpperCase, + async: false, + "~run"(dataset) { + dataset.value = dataset.value.toUpperCase(); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function transform(operation) { + return { + kind: "transformation", + type: "transform", + reference: transform, + async: false, + operation, + "~run"(dataset) { + dataset.value = this.operation(dataset.value); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function transformAsync(operation) { + return { + kind: "transformation", + type: "transform", + reference: transformAsync, + async: true, + operation, + async "~run"(dataset) { + dataset.value = await this.operation(dataset.value); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function trim() { + return { + kind: "transformation", + type: "trim", + reference: trim, + async: false, + "~run"(dataset) { + dataset.value = dataset.value.trim(); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function trimEnd() { + return { + kind: "transformation", + type: "trim_end", + reference: trimEnd, + async: false, + "~run"(dataset) { + dataset.value = dataset.value.trimEnd(); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function trimStart() { + return { + kind: "transformation", + type: "trim_start", + reference: trimStart, + async: false, + "~run"(dataset) { + dataset.value = dataset.value.trimStart(); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function ulid(message$1) { + return { + kind: "validation", + type: "ulid", + reference: ulid, + async: false, + expects: null, + requirement: ULID_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "ULID", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function url(message$1) { + return { + kind: "validation", + type: "url", + reference: url, + async: false, + expects: null, + requirement(input) { + try { + new URL(input); + return true; + } catch { + return false; + } + }, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "URL", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function uuid(message$1) { + return { + kind: "validation", + type: "uuid", + reference: uuid, + async: false, + expects: null, + requirement: UUID_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "UUID", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function value(requirement, message$1) { + return { + kind: "validation", + type: "value", + reference: value, + async: false, + expects: requirement instanceof Date ? requirement.toJSON() : /* @__PURE__ */ _stringify(requirement), + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !(this.requirement <= dataset.value && this.requirement >= dataset.value)) _addIssue(this, "value", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function values(requirement, message$1) { + return { + kind: "validation", + type: "values", + reference: values, + async: false, + expects: `${/* @__PURE__ */ _joinExpects(requirement.map((value$1) => value$1 instanceof Date ? value$1.toJSON() : /* @__PURE__ */ _stringify(value$1)), "|")}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.some((value$1) => value$1 <= dataset.value && value$1 >= dataset.value)) _addIssue(this, "value", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function words(locales, requirement, message$1) { + return { + kind: "validation", + type: "words", + reference: words, + async: false, + expects: `${requirement}`, + locales, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const count = /* @__PURE__ */ _getWordCount(this.locales, dataset.value); + if (count !== this.requirement) _addIssue(this, "words", dataset, config$1, { received: `${count}` }); + } + return dataset; + } + }; + } + function assert(schema, input) { + const issues = schema["~run"]({ value: input }, { abortEarly: true }).issues; + if (issues) throw new ValiError(issues); + } + // @__NO_SIDE_EFFECTS__ + function config(schema, config$1) { + return { + ...schema, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config_) { + return schema["~run"](dataset, { + ...config_, + ...config$1 + }); + } + }; + } + // @__NO_SIDE_EFFECTS__ + function getFallback(schema, dataset, config$1) { + return typeof schema.fallback === "function" ? schema.fallback(dataset, config$1) : schema.fallback; + } + // @__NO_SIDE_EFFECTS__ + function fallback(schema, fallback$1) { + return { + ...schema, + fallback: fallback$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const outputDataset = schema["~run"](dataset, config$1); + return outputDataset.issues ? { + typed: true, + value: /* @__PURE__ */ getFallback(this, outputDataset, config$1) + } : outputDataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function fallbackAsync(schema, fallback$1) { + return { + ...schema, + fallback: fallback$1, + async: true, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const outputDataset = await schema["~run"](dataset, config$1); + return outputDataset.issues ? { + typed: true, + value: await /* @__PURE__ */ getFallback(this, outputDataset, config$1) + } : outputDataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function flatten(issues) { + const flatErrors = {}; + for (const issue of issues) if (issue.path) { + const dotPath = /* @__PURE__ */ getDotPath(issue); + if (dotPath) { + if (!flatErrors.nested) flatErrors.nested = {}; + if (flatErrors.nested[dotPath]) flatErrors.nested[dotPath].push(issue.message); + else flatErrors.nested[dotPath] = [issue.message]; + } else if (flatErrors.other) flatErrors.other.push(issue.message); + else flatErrors.other = [issue.message]; + } else if (flatErrors.root) flatErrors.root.push(issue.message); + else flatErrors.root = [issue.message]; + return flatErrors; + } + // @__NO_SIDE_EFFECTS__ + function forward(action, path2) { + return { + ...action, + "~run"(dataset, config$1) { + const prevIssues = dataset.issues && [...dataset.issues]; + dataset = action["~run"](dataset, config$1); + if (dataset.issues) { + for (const issue of dataset.issues) if (!prevIssues?.includes(issue)) { + let pathInput = dataset.value; + for (const key of path2) { + const pathValue = pathInput[key]; + const pathItem = { + type: "unknown", + origin: "value", + input: pathInput, + key, + value: pathValue + }; + if (issue.path) issue.path.push(pathItem); + else issue.path = [pathItem]; + if (!pathValue) break; + pathInput = pathValue; + } + } + } + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function forwardAsync(action, path2) { + return { + ...action, + async: true, + async "~run"(dataset, config$1) { + const prevIssues = dataset.issues && [...dataset.issues]; + dataset = await action["~run"](dataset, config$1); + if (dataset.issues) { + for (const issue of dataset.issues) if (!prevIssues?.includes(issue)) { + let pathInput = dataset.value; + for (const key of path2) { + const pathValue = pathInput[key]; + const pathItem = { + type: "unknown", + origin: "value", + input: pathInput, + key, + value: pathValue + }; + if (issue.path) issue.path.push(pathItem); + else issue.path = [pathItem]; + if (!pathValue) break; + pathInput = pathValue; + } + } + } + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function getDefault(schema, dataset, config$1) { + return typeof schema.default === "function" ? schema.default(dataset, config$1) : schema.default; + } + // @__NO_SIDE_EFFECTS__ + function getDefaults(schema) { + if ("entries" in schema) { + const object$1 = {}; + for (const key in schema.entries) object$1[key] = /* @__PURE__ */ getDefaults(schema.entries[key]); + return object$1; + } + if ("items" in schema) return schema.items.map(getDefaults); + return /* @__PURE__ */ getDefault(schema); + } + // @__NO_SIDE_EFFECTS__ + async function getDefaultsAsync(schema) { + if ("entries" in schema) return Object.fromEntries(await Promise.all(Object.entries(schema.entries).map(async ([key, value$1]) => [key, await /* @__PURE__ */ getDefaultsAsync(value$1)]))); + if ("items" in schema) return Promise.all(schema.items.map(getDefaultsAsync)); + return /* @__PURE__ */ getDefault(schema); + } + // @__NO_SIDE_EFFECTS__ + function getDescription(schema) { + return /* @__PURE__ */ _getLastMetadata(schema, "description"); + } + // @__NO_SIDE_EFFECTS__ + function getExamples(schema) { + const examples$1 = []; + function depthFirstCollect(schema$1) { + if ("pipe" in schema$1) { + for (const item of schema$1.pipe) if (item.kind === "schema" && "pipe" in item) depthFirstCollect(item); + else if (item.kind === "metadata" && item.type === "examples") examples$1.push(...item.examples); + } + } + depthFirstCollect(schema); + return examples$1; + } + // @__NO_SIDE_EFFECTS__ + function getFallbacks(schema) { + if ("entries" in schema) { + const object$1 = {}; + for (const key in schema.entries) object$1[key] = /* @__PURE__ */ getFallbacks(schema.entries[key]); + return object$1; + } + if ("items" in schema) return schema.items.map(getFallbacks); + return /* @__PURE__ */ getFallback(schema); + } + // @__NO_SIDE_EFFECTS__ + async function getFallbacksAsync(schema) { + if ("entries" in schema) return Object.fromEntries(await Promise.all(Object.entries(schema.entries).map(async ([key, value$1]) => [key, await /* @__PURE__ */ getFallbacksAsync(value$1)]))); + if ("items" in schema) return Promise.all(schema.items.map(getFallbacksAsync)); + return /* @__PURE__ */ getFallback(schema); + } + // @__NO_SIDE_EFFECTS__ + function getMetadata(schema) { + const result = {}; + function depthFirstMerge(schema$1) { + if ("pipe" in schema$1) { + for (const item of schema$1.pipe) if (item.kind === "schema" && "pipe" in item) depthFirstMerge(item); + else if (item.kind === "metadata" && item.type === "metadata") Object.assign(result, item.metadata); + } + } + depthFirstMerge(schema); + return result; + } + // @__NO_SIDE_EFFECTS__ + function getTitle(schema) { + return /* @__PURE__ */ _getLastMetadata(schema, "title"); + } + // @__NO_SIDE_EFFECTS__ + function is(schema, input) { + return !schema["~run"]({ value: input }, { abortEarly: true }).issues; + } + // @__NO_SIDE_EFFECTS__ + function any() { + return { + kind: "schema", + type: "any", + reference: any, + expects: "any", + async: false, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset) { + dataset.typed = true; + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function array(item, message$1) { + return { + kind: "schema", + type: "array", + reference: array, + expects: "Array", + async: false, + item, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (Array.isArray(input)) { + dataset.typed = true; + dataset.value = []; + for (let key = 0; key < input.length; key++) { + const value$1 = input[key]; + const itemDataset = this.item["~run"]({ value: value$1 }, config$1); + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function arrayAsync(item, message$1) { + return { + kind: "schema", + type: "array", + reference: arrayAsync, + expects: "Array", + async: true, + item, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (Array.isArray(input)) { + dataset.typed = true; + dataset.value = []; + const itemDatasets = await Promise.all(input.map((value$1) => this.item["~run"]({ value: value$1 }, config$1))); + for (let key = 0; key < itemDatasets.length; key++) { + const itemDataset = itemDatasets[key]; + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: input[key] + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function bigint(message$1) { + return { + kind: "schema", + type: "bigint", + reference: bigint, + expects: "bigint", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (typeof dataset.value === "bigint") dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function blob(message$1) { + return { + kind: "schema", + type: "blob", + reference: blob, + expects: "Blob", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value instanceof Blob) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function boolean(message$1) { + return { + kind: "schema", + type: "boolean", + reference: boolean, + expects: "boolean", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (typeof dataset.value === "boolean") dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function custom(check$1, message$1) { + return { + kind: "schema", + type: "custom", + reference: custom, + expects: "unknown", + async: false, + check: check$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (this.check(dataset.value)) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function customAsync(check$1, message$1) { + return { + kind: "schema", + type: "custom", + reference: customAsync, + expects: "unknown", + async: true, + check: check$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + if (await this.check(dataset.value)) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function date(message$1) { + return { + kind: "schema", + type: "date", + reference: date, + expects: "Date", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value instanceof Date) if (!isNaN(dataset.value)) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1, { received: '"Invalid Date"' }); + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function enum_(enum__, message$1) { + const options = []; + for (const key in enum__) if (`${+key}` !== key || typeof enum__[key] !== "string" || !Object.is(enum__[enum__[key]], +key)) options.push(enum__[key]); + return { + kind: "schema", + type: "enum", + reference: enum_, + expects: /* @__PURE__ */ _joinExpects(options.map(_stringify), "|"), + async: false, + enum: enum__, + options, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (this.options.includes(dataset.value)) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function exactOptional(wrapped, default_) { + return { + kind: "schema", + type: "exact_optional", + reference: exactOptional, + expects: wrapped.expects, + async: false, + wrapped, + default: default_, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + return this.wrapped["~run"](dataset, config$1); + } + }; + } + // @__NO_SIDE_EFFECTS__ + function exactOptionalAsync(wrapped, default_) { + return { + kind: "schema", + type: "exact_optional", + reference: exactOptionalAsync, + expects: wrapped.expects, + async: true, + wrapped, + default: default_, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + return this.wrapped["~run"](dataset, config$1); + } + }; + } + // @__NO_SIDE_EFFECTS__ + function file(message$1) { + return { + kind: "schema", + type: "file", + reference: file, + expects: "File", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value instanceof File) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function function_(message$1) { + return { + kind: "schema", + type: "function", + reference: function_, + expects: "Function", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (typeof dataset.value === "function") dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function instance(class_, message$1) { + return { + kind: "schema", + type: "instance", + reference: instance, + expects: class_.name, + async: false, + class: class_, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value instanceof this.class) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function _merge(value1, value2) { + if (typeof value1 === typeof value2) { + if (value1 === value2 || value1 instanceof Date && value2 instanceof Date && +value1 === +value2) return { value: value1 }; + if (value1 && value2 && value1.constructor === Object && value2.constructor === Object) { + for (const key in value2) if (key in value1) { + const dataset = /* @__PURE__ */ _merge(value1[key], value2[key]); + if (dataset.issue) return dataset; + value1[key] = dataset.value; + } else value1[key] = value2[key]; + return { value: value1 }; + } + if (Array.isArray(value1) && Array.isArray(value2)) { + if (value1.length === value2.length) { + for (let index2 = 0; index2 < value1.length; index2++) { + const dataset = /* @__PURE__ */ _merge(value1[index2], value2[index2]); + if (dataset.issue) return dataset; + value1[index2] = dataset.value; + } + return { value: value1 }; + } + } + } + return { issue: true }; + } + // @__NO_SIDE_EFFECTS__ + function intersect(options, message$1) { + return { + kind: "schema", + type: "intersect", + reference: intersect, + expects: /* @__PURE__ */ _joinExpects(options.map((option) => option.expects), "&"), + async: false, + options, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (this.options.length) { + const input = dataset.value; + let outputs; + dataset.typed = true; + for (const schema of this.options) { + const optionDataset = schema["~run"]({ value: input }, config$1); + if (optionDataset.issues) { + if (dataset.issues) dataset.issues.push(...optionDataset.issues); + else dataset.issues = optionDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!optionDataset.typed) dataset.typed = false; + if (dataset.typed) if (outputs) outputs.push(optionDataset.value); + else outputs = [optionDataset.value]; + } + if (dataset.typed) { + dataset.value = outputs[0]; + for (let index2 = 1; index2 < outputs.length; index2++) { + const mergeDataset = /* @__PURE__ */ _merge(dataset.value, outputs[index2]); + if (mergeDataset.issue) { + _addIssue(this, "type", dataset, config$1, { received: "unknown" }); + break; + } + dataset.value = mergeDataset.value; + } + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function intersectAsync(options, message$1) { + return { + kind: "schema", + type: "intersect", + reference: intersectAsync, + expects: /* @__PURE__ */ _joinExpects(options.map((option) => option.expects), "&"), + async: true, + options, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + if (this.options.length) { + const input = dataset.value; + let outputs; + dataset.typed = true; + const optionDatasets = await Promise.all(this.options.map((schema) => schema["~run"]({ value: input }, config$1))); + for (const optionDataset of optionDatasets) { + if (optionDataset.issues) { + if (dataset.issues) dataset.issues.push(...optionDataset.issues); + else dataset.issues = optionDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!optionDataset.typed) dataset.typed = false; + if (dataset.typed) if (outputs) outputs.push(optionDataset.value); + else outputs = [optionDataset.value]; + } + if (dataset.typed) { + dataset.value = outputs[0]; + for (let index2 = 1; index2 < outputs.length; index2++) { + const mergeDataset = /* @__PURE__ */ _merge(dataset.value, outputs[index2]); + if (mergeDataset.issue) { + _addIssue(this, "type", dataset, config$1, { received: "unknown" }); + break; + } + dataset.value = mergeDataset.value; + } + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function lazy(getter) { + return { + kind: "schema", + type: "lazy", + reference: lazy, + expects: "unknown", + async: false, + getter, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + return this.getter(dataset.value)["~run"](dataset, config$1); + } + }; + } + // @__NO_SIDE_EFFECTS__ + function lazyAsync(getter) { + return { + kind: "schema", + type: "lazy", + reference: lazyAsync, + expects: "unknown", + async: true, + getter, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + return (await this.getter(dataset.value))["~run"](dataset, config$1); + } + }; + } + // @__NO_SIDE_EFFECTS__ + function literal(literal_, message$1) { + return { + kind: "schema", + type: "literal", + reference: literal, + expects: /* @__PURE__ */ _stringify(literal_), + async: false, + literal: literal_, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value === this.literal) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function looseObject(entries$1, message$1) { + return { + kind: "schema", + type: "loose_object", + reference: looseObject, + expects: "Object", + async: false, + entries: entries$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + dataset.typed = true; + dataset.value = {}; + for (const key in this.entries) { + const valueSchema = this.entries[key]; + if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) { + const value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema); + const valueDataset = valueSchema["~run"]({ value: value$1 }, config$1); + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value[key] = valueDataset.value; + } else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema); + else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") { + _addIssue(this, "key", dataset, config$1, { + input: void 0, + expected: `"${key}"`, + path: [{ + type: "object", + origin: "key", + input, + key, + value: input[key] + }] + }); + if (config$1.abortEarly) break; + } + } + if (!dataset.issues || !config$1.abortEarly) { + for (const key in input) if (/* @__PURE__ */ _isValidObjectKey(input, key) && !(key in this.entries)) dataset.value[key] = input[key]; + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function looseObjectAsync(entries$1, message$1) { + return { + kind: "schema", + type: "loose_object", + reference: looseObjectAsync, + expects: "Object", + async: true, + entries: entries$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + dataset.typed = true; + dataset.value = {}; + const valueDatasets = await Promise.all(Object.entries(this.entries).map(async ([key, valueSchema]) => { + if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) { + const value$1 = key in input ? input[key] : await /* @__PURE__ */ getDefault(valueSchema); + return [ + key, + value$1, + valueSchema, + await valueSchema["~run"]({ value: value$1 }, config$1) + ]; + } + return [ + key, + input[key], + valueSchema, + null + ]; + })); + for (const [key, value$1, valueSchema, valueDataset] of valueDatasets) if (valueDataset) { + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value[key] = valueDataset.value; + } else if (valueSchema.fallback !== void 0) dataset.value[key] = await /* @__PURE__ */ getFallback(valueSchema); + else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") { + _addIssue(this, "key", dataset, config$1, { + input: void 0, + expected: `"${key}"`, + path: [{ + type: "object", + origin: "key", + input, + key, + value: value$1 + }] + }); + if (config$1.abortEarly) break; + } + if (!dataset.issues || !config$1.abortEarly) { + for (const key in input) if (/* @__PURE__ */ _isValidObjectKey(input, key) && !(key in this.entries)) dataset.value[key] = input[key]; + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function looseTuple(items, message$1) { + return { + kind: "schema", + type: "loose_tuple", + reference: looseTuple, + expects: "Array", + async: false, + items, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (Array.isArray(input)) { + dataset.typed = true; + dataset.value = []; + for (let key = 0; key < this.items.length; key++) { + const value$1 = input[key]; + const itemDataset = this.items[key]["~run"]({ value: value$1 }, config$1); + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + if (!dataset.issues || !config$1.abortEarly) for (let key = this.items.length; key < input.length; key++) dataset.value.push(input[key]); + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function looseTupleAsync(items, message$1) { + return { + kind: "schema", + type: "loose_tuple", + reference: looseTupleAsync, + expects: "Array", + async: true, + items, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (Array.isArray(input)) { + dataset.typed = true; + dataset.value = []; + const itemDatasets = await Promise.all(this.items.map(async (item, key) => { + const value$1 = input[key]; + return [ + key, + value$1, + await item["~run"]({ value: value$1 }, config$1) + ]; + })); + for (const [key, value$1, itemDataset] of itemDatasets) { + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + if (!dataset.issues || !config$1.abortEarly) for (let key = this.items.length; key < input.length; key++) dataset.value.push(input[key]); + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function map(key, value$1, message$1) { + return { + kind: "schema", + type: "map", + reference: map, + expects: "Map", + async: false, + key, + value: value$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (input instanceof Map) { + dataset.typed = true; + dataset.value = /* @__PURE__ */ new Map(); + for (const [inputKey, inputValue] of input) { + const keyDataset = this.key["~run"]({ value: inputKey }, config$1); + if (keyDataset.issues) { + const pathItem = { + type: "map", + origin: "key", + input, + key: inputKey, + value: inputValue + }; + for (const issue of keyDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = keyDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + const valueDataset = this.value["~run"]({ value: inputValue }, config$1); + if (valueDataset.issues) { + const pathItem = { + type: "map", + origin: "value", + input, + key: inputKey, + value: inputValue + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!keyDataset.typed || !valueDataset.typed) dataset.typed = false; + dataset.value.set(keyDataset.value, valueDataset.value); + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function mapAsync(key, value$1, message$1) { + return { + kind: "schema", + type: "map", + reference: mapAsync, + expects: "Map", + async: true, + key, + value: value$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (input instanceof Map) { + dataset.typed = true; + dataset.value = /* @__PURE__ */ new Map(); + const datasets = await Promise.all([...input].map(([inputKey, inputValue]) => Promise.all([ + inputKey, + inputValue, + this.key["~run"]({ value: inputKey }, config$1), + this.value["~run"]({ value: inputValue }, config$1) + ]))); + for (const [inputKey, inputValue, keyDataset, valueDataset] of datasets) { + if (keyDataset.issues) { + const pathItem = { + type: "map", + origin: "key", + input, + key: inputKey, + value: inputValue + }; + for (const issue of keyDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = keyDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (valueDataset.issues) { + const pathItem = { + type: "map", + origin: "value", + input, + key: inputKey, + value: inputValue + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!keyDataset.typed || !valueDataset.typed) dataset.typed = false; + dataset.value.set(keyDataset.value, valueDataset.value); + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function nan(message$1) { + return { + kind: "schema", + type: "nan", + reference: nan, + expects: "NaN", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (Number.isNaN(dataset.value)) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function never(message$1) { + return { + kind: "schema", + type: "never", + reference: never, + expects: "never", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function nonNullable(wrapped, message$1) { + return { + kind: "schema", + type: "non_nullable", + reference: nonNullable, + expects: "!null", + async: false, + wrapped, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value !== null) dataset = this.wrapped["~run"](dataset, config$1); + if (dataset.value === null) _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function nonNullableAsync(wrapped, message$1) { + return { + kind: "schema", + type: "non_nullable", + reference: nonNullableAsync, + expects: "!null", + async: true, + wrapped, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + if (dataset.value !== null) dataset = await this.wrapped["~run"](dataset, config$1); + if (dataset.value === null) _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function nonNullish(wrapped, message$1) { + return { + kind: "schema", + type: "non_nullish", + reference: nonNullish, + expects: "(!null & !undefined)", + async: false, + wrapped, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (!(dataset.value === null || dataset.value === void 0)) dataset = this.wrapped["~run"](dataset, config$1); + if (dataset.value === null || dataset.value === void 0) _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function nonNullishAsync(wrapped, message$1) { + return { + kind: "schema", + type: "non_nullish", + reference: nonNullishAsync, + expects: "(!null & !undefined)", + async: true, + wrapped, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + if (!(dataset.value === null || dataset.value === void 0)) dataset = await this.wrapped["~run"](dataset, config$1); + if (dataset.value === null || dataset.value === void 0) _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function nonOptional(wrapped, message$1) { + return { + kind: "schema", + type: "non_optional", + reference: nonOptional, + expects: "!undefined", + async: false, + wrapped, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value !== void 0) dataset = this.wrapped["~run"](dataset, config$1); + if (dataset.value === void 0) _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function nonOptionalAsync(wrapped, message$1) { + return { + kind: "schema", + type: "non_optional", + reference: nonOptionalAsync, + expects: "!undefined", + async: true, + wrapped, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + if (dataset.value !== void 0) dataset = await this.wrapped["~run"](dataset, config$1); + if (dataset.value === void 0) _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function null_(message$1) { + return { + kind: "schema", + type: "null", + reference: null_, + expects: "null", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value === null) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function nullable(wrapped, default_) { + return { + kind: "schema", + type: "nullable", + reference: nullable, + expects: `(${wrapped.expects} | null)`, + async: false, + wrapped, + default: default_, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value === null) { + if (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1); + if (dataset.value === null) { + dataset.typed = true; + return dataset; + } + } + return this.wrapped["~run"](dataset, config$1); + } + }; + } + // @__NO_SIDE_EFFECTS__ + function nullableAsync(wrapped, default_) { + return { + kind: "schema", + type: "nullable", + reference: nullableAsync, + expects: `(${wrapped.expects} | null)`, + async: true, + wrapped, + default: default_, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + if (dataset.value === null) { + if (this.default !== void 0) dataset.value = await /* @__PURE__ */ getDefault(this, dataset, config$1); + if (dataset.value === null) { + dataset.typed = true; + return dataset; + } + } + return this.wrapped["~run"](dataset, config$1); + } + }; + } + // @__NO_SIDE_EFFECTS__ + function nullish(wrapped, default_) { + return { + kind: "schema", + type: "nullish", + reference: nullish, + expects: `(${wrapped.expects} | null | undefined)`, + async: false, + wrapped, + default: default_, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value === null || dataset.value === void 0) { + if (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1); + if (dataset.value === null || dataset.value === void 0) { + dataset.typed = true; + return dataset; + } + } + return this.wrapped["~run"](dataset, config$1); + } + }; + } + // @__NO_SIDE_EFFECTS__ + function nullishAsync(wrapped, default_) { + return { + kind: "schema", + type: "nullish", + reference: nullishAsync, + expects: `(${wrapped.expects} | null | undefined)`, + async: true, + wrapped, + default: default_, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + if (dataset.value === null || dataset.value === void 0) { + if (this.default !== void 0) dataset.value = await /* @__PURE__ */ getDefault(this, dataset, config$1); + if (dataset.value === null || dataset.value === void 0) { + dataset.typed = true; + return dataset; + } + } + return this.wrapped["~run"](dataset, config$1); + } + }; + } + // @__NO_SIDE_EFFECTS__ + function number(message$1) { + return { + kind: "schema", + type: "number", + reference: number, + expects: "number", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (typeof dataset.value === "number" && !isNaN(dataset.value)) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function object(entries$1, message$1) { + return { + kind: "schema", + type: "object", + reference: object, + expects: "Object", + async: false, + entries: entries$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + dataset.typed = true; + dataset.value = {}; + for (const key in this.entries) { + const valueSchema = this.entries[key]; + if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) { + const value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema); + const valueDataset = valueSchema["~run"]({ value: value$1 }, config$1); + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value[key] = valueDataset.value; + } else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema); + else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") { + _addIssue(this, "key", dataset, config$1, { + input: void 0, + expected: `"${key}"`, + path: [{ + type: "object", + origin: "key", + input, + key, + value: input[key] + }] + }); + if (config$1.abortEarly) break; + } + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function objectAsync(entries$1, message$1) { + return { + kind: "schema", + type: "object", + reference: objectAsync, + expects: "Object", + async: true, + entries: entries$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + dataset.typed = true; + dataset.value = {}; + const valueDatasets = await Promise.all(Object.entries(this.entries).map(async ([key, valueSchema]) => { + if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) { + const value$1 = key in input ? input[key] : await /* @__PURE__ */ getDefault(valueSchema); + return [ + key, + value$1, + valueSchema, + await valueSchema["~run"]({ value: value$1 }, config$1) + ]; + } + return [ + key, + input[key], + valueSchema, + null + ]; + })); + for (const [key, value$1, valueSchema, valueDataset] of valueDatasets) if (valueDataset) { + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value[key] = valueDataset.value; + } else if (valueSchema.fallback !== void 0) dataset.value[key] = await /* @__PURE__ */ getFallback(valueSchema); + else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") { + _addIssue(this, "key", dataset, config$1, { + input: void 0, + expected: `"${key}"`, + path: [{ + type: "object", + origin: "key", + input, + key, + value: value$1 + }] + }); + if (config$1.abortEarly) break; + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function objectWithRest(entries$1, rest, message$1) { + return { + kind: "schema", + type: "object_with_rest", + reference: objectWithRest, + expects: "Object", + async: false, + entries: entries$1, + rest, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + dataset.typed = true; + dataset.value = {}; + for (const key in this.entries) { + const valueSchema = this.entries[key]; + if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) { + const value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema); + const valueDataset = valueSchema["~run"]({ value: value$1 }, config$1); + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value[key] = valueDataset.value; + } else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema); + else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") { + _addIssue(this, "key", dataset, config$1, { + input: void 0, + expected: `"${key}"`, + path: [{ + type: "object", + origin: "key", + input, + key, + value: input[key] + }] + }); + if (config$1.abortEarly) break; + } + } + if (!dataset.issues || !config$1.abortEarly) { + for (const key in input) if (/* @__PURE__ */ _isValidObjectKey(input, key) && !(key in this.entries)) { + const valueDataset = this.rest["~run"]({ value: input[key] }, config$1); + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key, + value: input[key] + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value[key] = valueDataset.value; + } + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function objectWithRestAsync(entries$1, rest, message$1) { + return { + kind: "schema", + type: "object_with_rest", + reference: objectWithRestAsync, + expects: "Object", + async: true, + entries: entries$1, + rest, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + dataset.typed = true; + dataset.value = {}; + const [normalDatasets, restDatasets] = await Promise.all([Promise.all(Object.entries(this.entries).map(async ([key, valueSchema]) => { + if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) { + const value$1 = key in input ? input[key] : await /* @__PURE__ */ getDefault(valueSchema); + return [ + key, + value$1, + valueSchema, + await valueSchema["~run"]({ value: value$1 }, config$1) + ]; + } + return [ + key, + input[key], + valueSchema, + null + ]; + })), Promise.all(Object.entries(input).filter(([key]) => /* @__PURE__ */ _isValidObjectKey(input, key) && !(key in this.entries)).map(async ([key, value$1]) => [ + key, + value$1, + await this.rest["~run"]({ value: value$1 }, config$1) + ]))]); + for (const [key, value$1, valueSchema, valueDataset] of normalDatasets) if (valueDataset) { + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value[key] = valueDataset.value; + } else if (valueSchema.fallback !== void 0) dataset.value[key] = await /* @__PURE__ */ getFallback(valueSchema); + else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") { + _addIssue(this, "key", dataset, config$1, { + input: void 0, + expected: `"${key}"`, + path: [{ + type: "object", + origin: "key", + input, + key, + value: value$1 + }] + }); + if (config$1.abortEarly) break; + } + if (!dataset.issues || !config$1.abortEarly) for (const [key, value$1, valueDataset] of restDatasets) { + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value[key] = valueDataset.value; + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function optional(wrapped, default_) { + return { + kind: "schema", + type: "optional", + reference: optional, + expects: `(${wrapped.expects} | undefined)`, + async: false, + wrapped, + default: default_, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value === void 0) { + if (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1); + if (dataset.value === void 0) { + dataset.typed = true; + return dataset; + } + } + return this.wrapped["~run"](dataset, config$1); + } + }; + } + // @__NO_SIDE_EFFECTS__ + function optionalAsync(wrapped, default_) { + return { + kind: "schema", + type: "optional", + reference: optionalAsync, + expects: `(${wrapped.expects} | undefined)`, + async: true, + wrapped, + default: default_, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + if (dataset.value === void 0) { + if (this.default !== void 0) dataset.value = await /* @__PURE__ */ getDefault(this, dataset, config$1); + if (dataset.value === void 0) { + dataset.typed = true; + return dataset; + } + } + return this.wrapped["~run"](dataset, config$1); + } + }; + } + // @__NO_SIDE_EFFECTS__ + function picklist(options, message$1) { + return { + kind: "schema", + type: "picklist", + reference: picklist, + expects: /* @__PURE__ */ _joinExpects(options.map(_stringify), "|"), + async: false, + options, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (this.options.includes(dataset.value)) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function promise(message$1) { + return { + kind: "schema", + type: "promise", + reference: promise, + expects: "Promise", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value instanceof Promise) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function record(key, value$1, message$1) { + return { + kind: "schema", + type: "record", + reference: record, + expects: "Object", + async: false, + key, + value: value$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + dataset.typed = true; + dataset.value = {}; + for (const entryKey in input) if (/* @__PURE__ */ _isValidObjectKey(input, entryKey)) { + const entryValue = input[entryKey]; + const keyDataset = this.key["~run"]({ value: entryKey }, config$1); + if (keyDataset.issues) { + const pathItem = { + type: "object", + origin: "key", + input, + key: entryKey, + value: entryValue + }; + for (const issue of keyDataset.issues) { + issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = keyDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + const valueDataset = this.value["~run"]({ value: entryValue }, config$1); + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key: entryKey, + value: entryValue + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!keyDataset.typed || !valueDataset.typed) dataset.typed = false; + if (keyDataset.typed) dataset.value[keyDataset.value] = valueDataset.value; + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function recordAsync(key, value$1, message$1) { + return { + kind: "schema", + type: "record", + reference: recordAsync, + expects: "Object", + async: true, + key, + value: value$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + dataset.typed = true; + dataset.value = {}; + const datasets = await Promise.all(Object.entries(input).filter(([key$1]) => /* @__PURE__ */ _isValidObjectKey(input, key$1)).map(([entryKey, entryValue]) => Promise.all([ + entryKey, + entryValue, + this.key["~run"]({ value: entryKey }, config$1), + this.value["~run"]({ value: entryValue }, config$1) + ]))); + for (const [entryKey, entryValue, keyDataset, valueDataset] of datasets) { + if (keyDataset.issues) { + const pathItem = { + type: "object", + origin: "key", + input, + key: entryKey, + value: entryValue + }; + for (const issue of keyDataset.issues) { + issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = keyDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key: entryKey, + value: entryValue + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!keyDataset.typed || !valueDataset.typed) dataset.typed = false; + if (keyDataset.typed) dataset.value[keyDataset.value] = valueDataset.value; + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function set(value$1, message$1) { + return { + kind: "schema", + type: "set", + reference: set, + expects: "Set", + async: false, + value: value$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (input instanceof Set) { + dataset.typed = true; + dataset.value = /* @__PURE__ */ new Set(); + for (const inputValue of input) { + const valueDataset = this.value["~run"]({ value: inputValue }, config$1); + if (valueDataset.issues) { + const pathItem = { + type: "set", + origin: "value", + input, + key: null, + value: inputValue + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value.add(valueDataset.value); + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function setAsync(value$1, message$1) { + return { + kind: "schema", + type: "set", + reference: setAsync, + expects: "Set", + async: true, + value: value$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (input instanceof Set) { + dataset.typed = true; + dataset.value = /* @__PURE__ */ new Set(); + const valueDatasets = await Promise.all([...input].map(async (inputValue) => [inputValue, await this.value["~run"]({ value: inputValue }, config$1)])); + for (const [inputValue, valueDataset] of valueDatasets) { + if (valueDataset.issues) { + const pathItem = { + type: "set", + origin: "value", + input, + key: null, + value: inputValue + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value.add(valueDataset.value); + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function strictObject(entries$1, message$1) { + return { + kind: "schema", + type: "strict_object", + reference: strictObject, + expects: "Object", + async: false, + entries: entries$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + dataset.typed = true; + dataset.value = {}; + for (const key in this.entries) { + const valueSchema = this.entries[key]; + if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) { + const value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema); + const valueDataset = valueSchema["~run"]({ value: value$1 }, config$1); + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value[key] = valueDataset.value; + } else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema); + else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") { + _addIssue(this, "key", dataset, config$1, { + input: void 0, + expected: `"${key}"`, + path: [{ + type: "object", + origin: "key", + input, + key, + value: input[key] + }] + }); + if (config$1.abortEarly) break; + } + } + if (!dataset.issues || !config$1.abortEarly) { + for (const key in input) if (!(key in this.entries)) { + _addIssue(this, "key", dataset, config$1, { + input: key, + expected: "never", + path: [{ + type: "object", + origin: "key", + input, + key, + value: input[key] + }] + }); + break; + } + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function strictObjectAsync(entries$1, message$1) { + return { + kind: "schema", + type: "strict_object", + reference: strictObjectAsync, + expects: "Object", + async: true, + entries: entries$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + dataset.typed = true; + dataset.value = {}; + const valueDatasets = await Promise.all(Object.entries(this.entries).map(async ([key, valueSchema]) => { + if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) { + const value$1 = key in input ? input[key] : await /* @__PURE__ */ getDefault(valueSchema); + return [ + key, + value$1, + valueSchema, + await valueSchema["~run"]({ value: value$1 }, config$1) + ]; + } + return [ + key, + input[key], + valueSchema, + null + ]; + })); + for (const [key, value$1, valueSchema, valueDataset] of valueDatasets) if (valueDataset) { + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value[key] = valueDataset.value; + } else if (valueSchema.fallback !== void 0) dataset.value[key] = await /* @__PURE__ */ getFallback(valueSchema); + else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") { + _addIssue(this, "key", dataset, config$1, { + input: void 0, + expected: `"${key}"`, + path: [{ + type: "object", + origin: "key", + input, + key, + value: value$1 + }] + }); + if (config$1.abortEarly) break; + } + if (!dataset.issues || !config$1.abortEarly) { + for (const key in input) if (!(key in this.entries)) { + _addIssue(this, "key", dataset, config$1, { + input: key, + expected: "never", + path: [{ + type: "object", + origin: "key", + input, + key, + value: input[key] + }] + }); + break; + } + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function strictTuple(items, message$1) { + return { + kind: "schema", + type: "strict_tuple", + reference: strictTuple, + expects: "Array", + async: false, + items, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (Array.isArray(input)) { + dataset.typed = true; + dataset.value = []; + for (let key = 0; key < this.items.length; key++) { + const value$1 = input[key]; + const itemDataset = this.items[key]["~run"]({ value: value$1 }, config$1); + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + if (!(dataset.issues && config$1.abortEarly) && this.items.length < input.length) _addIssue(this, "type", dataset, config$1, { + input: input[this.items.length], + expected: "never", + path: [{ + type: "array", + origin: "value", + input, + key: this.items.length, + value: input[this.items.length] + }] + }); + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function strictTupleAsync(items, message$1) { + return { + kind: "schema", + type: "strict_tuple", + reference: strictTupleAsync, + expects: "Array", + async: true, + items, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (Array.isArray(input)) { + dataset.typed = true; + dataset.value = []; + const itemDatasets = await Promise.all(this.items.map(async (item, key) => { + const value$1 = input[key]; + return [ + key, + value$1, + await item["~run"]({ value: value$1 }, config$1) + ]; + })); + for (const [key, value$1, itemDataset] of itemDatasets) { + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + if (!(dataset.issues && config$1.abortEarly) && this.items.length < input.length) _addIssue(this, "type", dataset, config$1, { + input: input[this.items.length], + expected: "never", + path: [{ + type: "array", + origin: "value", + input, + key: this.items.length, + value: input[this.items.length] + }] + }); + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function string(message$1) { + return { + kind: "schema", + type: "string", + reference: string, + expects: "string", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (typeof dataset.value === "string") dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function symbol(message$1) { + return { + kind: "schema", + type: "symbol", + reference: symbol, + expects: "symbol", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (typeof dataset.value === "symbol") dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function tuple(items, message$1) { + return { + kind: "schema", + type: "tuple", + reference: tuple, + expects: "Array", + async: false, + items, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (Array.isArray(input)) { + dataset.typed = true; + dataset.value = []; + for (let key = 0; key < this.items.length; key++) { + const value$1 = input[key]; + const itemDataset = this.items[key]["~run"]({ value: value$1 }, config$1); + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function tupleAsync(items, message$1) { + return { + kind: "schema", + type: "tuple", + reference: tupleAsync, + expects: "Array", + async: true, + items, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (Array.isArray(input)) { + dataset.typed = true; + dataset.value = []; + const itemDatasets = await Promise.all(this.items.map(async (item, key) => { + const value$1 = input[key]; + return [ + key, + value$1, + await item["~run"]({ value: value$1 }, config$1) + ]; + })); + for (const [key, value$1, itemDataset] of itemDatasets) { + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function tupleWithRest(items, rest, message$1) { + return { + kind: "schema", + type: "tuple_with_rest", + reference: tupleWithRest, + expects: "Array", + async: false, + items, + rest, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (Array.isArray(input)) { + dataset.typed = true; + dataset.value = []; + for (let key = 0; key < this.items.length; key++) { + const value$1 = input[key]; + const itemDataset = this.items[key]["~run"]({ value: value$1 }, config$1); + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + if (!dataset.issues || !config$1.abortEarly) for (let key = this.items.length; key < input.length; key++) { + const value$1 = input[key]; + const itemDataset = this.rest["~run"]({ value: value$1 }, config$1); + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function tupleWithRestAsync(items, rest, message$1) { + return { + kind: "schema", + type: "tuple_with_rest", + reference: tupleWithRestAsync, + expects: "Array", + async: true, + items, + rest, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (Array.isArray(input)) { + dataset.typed = true; + dataset.value = []; + const [normalDatasets, restDatasets] = await Promise.all([Promise.all(this.items.map(async (item, key) => { + const value$1 = input[key]; + return [ + key, + value$1, + await item["~run"]({ value: value$1 }, config$1) + ]; + })), Promise.all(input.slice(this.items.length).map(async (value$1, key) => { + return [ + key + this.items.length, + value$1, + await this.rest["~run"]({ value: value$1 }, config$1) + ]; + }))]); + for (const [key, value$1, itemDataset] of normalDatasets) { + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + if (!dataset.issues || !config$1.abortEarly) for (const [key, value$1, itemDataset] of restDatasets) { + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function undefined_(message$1) { + return { + kind: "schema", + type: "undefined", + reference: undefined_, + expects: "undefined", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value === void 0) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function undefinedable(wrapped, default_) { + return { + kind: "schema", + type: "undefinedable", + reference: undefinedable, + expects: `(${wrapped.expects} | undefined)`, + async: false, + wrapped, + default: default_, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value === void 0) { + if (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1); + if (dataset.value === void 0) { + dataset.typed = true; + return dataset; + } + } + return this.wrapped["~run"](dataset, config$1); + } + }; + } + // @__NO_SIDE_EFFECTS__ + function undefinedableAsync(wrapped, default_) { + return { + kind: "schema", + type: "undefinedable", + reference: undefinedableAsync, + expects: `(${wrapped.expects} | undefined)`, + async: true, + wrapped, + default: default_, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + if (dataset.value === void 0) { + if (this.default !== void 0) dataset.value = await /* @__PURE__ */ getDefault(this, dataset, config$1); + if (dataset.value === void 0) { + dataset.typed = true; + return dataset; + } + } + return this.wrapped["~run"](dataset, config$1); + } + }; + } + // @__NO_SIDE_EFFECTS__ + function _subIssues(datasets) { + let issues; + if (datasets) for (const dataset of datasets) if (issues) issues.push(...dataset.issues); + else issues = dataset.issues; + return issues; + } + // @__NO_SIDE_EFFECTS__ + function union(options, message$1) { + return { + kind: "schema", + type: "union", + reference: union, + expects: /* @__PURE__ */ _joinExpects(options.map((option) => option.expects), "|"), + async: false, + options, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + let validDataset; + let typedDatasets; + let untypedDatasets; + for (const schema of this.options) { + const optionDataset = schema["~run"]({ value: dataset.value }, config$1); + if (optionDataset.typed) if (optionDataset.issues) if (typedDatasets) typedDatasets.push(optionDataset); + else typedDatasets = [optionDataset]; + else { + validDataset = optionDataset; + break; + } + else if (untypedDatasets) untypedDatasets.push(optionDataset); + else untypedDatasets = [optionDataset]; + } + if (validDataset) return validDataset; + if (typedDatasets) { + if (typedDatasets.length === 1) return typedDatasets[0]; + _addIssue(this, "type", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(typedDatasets) }); + dataset.typed = true; + } else if (untypedDatasets?.length === 1) return untypedDatasets[0]; + else _addIssue(this, "type", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(untypedDatasets) }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function unionAsync(options, message$1) { + return { + kind: "schema", + type: "union", + reference: unionAsync, + expects: /* @__PURE__ */ _joinExpects(options.map((option) => option.expects), "|"), + async: true, + options, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + let validDataset; + let typedDatasets; + let untypedDatasets; + for (const schema of this.options) { + const optionDataset = await schema["~run"]({ value: dataset.value }, config$1); + if (optionDataset.typed) if (optionDataset.issues) if (typedDatasets) typedDatasets.push(optionDataset); + else typedDatasets = [optionDataset]; + else { + validDataset = optionDataset; + break; + } + else if (untypedDatasets) untypedDatasets.push(optionDataset); + else untypedDatasets = [optionDataset]; + } + if (validDataset) return validDataset; + if (typedDatasets) { + if (typedDatasets.length === 1) return typedDatasets[0]; + _addIssue(this, "type", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(typedDatasets) }); + dataset.typed = true; + } else if (untypedDatasets?.length === 1) return untypedDatasets[0]; + else _addIssue(this, "type", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(untypedDatasets) }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function unknown() { + return { + kind: "schema", + type: "unknown", + reference: unknown, + expects: "unknown", + async: false, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset) { + dataset.typed = true; + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function variant(key, options, message$1) { + return { + kind: "schema", + type: "variant", + reference: variant, + expects: "Object", + async: false, + key, + options, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + let outputDataset; + let maxDiscriminatorPriority = 0; + let invalidDiscriminatorKey = this.key; + let expectedDiscriminators = []; + const parseOptions = (variant$1, allKeys) => { + for (const schema of variant$1.options) { + if (schema.type === "variant") parseOptions(schema, new Set(allKeys).add(schema.key)); + else { + let keysAreValid = true; + let currentPriority = 0; + for (const currentKey of allKeys) { + const discriminatorSchema = schema.entries[currentKey]; + if (currentKey in input ? discriminatorSchema["~run"]({ + typed: false, + value: input[currentKey] + }, { abortEarly: true }).issues : discriminatorSchema.type !== "exact_optional" && discriminatorSchema.type !== "optional" && discriminatorSchema.type !== "nullish") { + keysAreValid = false; + if (invalidDiscriminatorKey !== currentKey && (maxDiscriminatorPriority < currentPriority || maxDiscriminatorPriority === currentPriority && currentKey in input && !(invalidDiscriminatorKey in input))) { + maxDiscriminatorPriority = currentPriority; + invalidDiscriminatorKey = currentKey; + expectedDiscriminators = []; + } + if (invalidDiscriminatorKey === currentKey) expectedDiscriminators.push(schema.entries[currentKey].expects); + break; + } + currentPriority++; + } + if (keysAreValid) { + const optionDataset = schema["~run"]({ value: input }, config$1); + if (!outputDataset || !outputDataset.typed && optionDataset.typed) outputDataset = optionDataset; + } + } + if (outputDataset && !outputDataset.issues) break; + } + }; + parseOptions(this, /* @__PURE__ */ new Set([this.key])); + if (outputDataset) return outputDataset; + _addIssue(this, "type", dataset, config$1, { + input: input[invalidDiscriminatorKey], + expected: /* @__PURE__ */ _joinExpects(expectedDiscriminators, "|"), + path: [{ + type: "object", + origin: "value", + input, + key: invalidDiscriminatorKey, + value: input[invalidDiscriminatorKey] + }] + }); + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function variantAsync(key, options, message$1) { + return { + kind: "schema", + type: "variant", + reference: variantAsync, + expects: "Object", + async: true, + key, + options, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + let outputDataset; + let maxDiscriminatorPriority = 0; + let invalidDiscriminatorKey = this.key; + let expectedDiscriminators = []; + const parseOptions = async (variant$1, allKeys) => { + for (const schema of variant$1.options) { + if (schema.type === "variant") await parseOptions(schema, new Set(allKeys).add(schema.key)); + else { + let keysAreValid = true; + let currentPriority = 0; + for (const currentKey of allKeys) { + const discriminatorSchema = schema.entries[currentKey]; + if (currentKey in input ? (await discriminatorSchema["~run"]({ + typed: false, + value: input[currentKey] + }, { abortEarly: true })).issues : discriminatorSchema.type !== "exact_optional" && discriminatorSchema.type !== "optional" && discriminatorSchema.type !== "nullish") { + keysAreValid = false; + if (invalidDiscriminatorKey !== currentKey && (maxDiscriminatorPriority < currentPriority || maxDiscriminatorPriority === currentPriority && currentKey in input && !(invalidDiscriminatorKey in input))) { + maxDiscriminatorPriority = currentPriority; + invalidDiscriminatorKey = currentKey; + expectedDiscriminators = []; + } + if (invalidDiscriminatorKey === currentKey) expectedDiscriminators.push(schema.entries[currentKey].expects); + break; + } + currentPriority++; + } + if (keysAreValid) { + const optionDataset = await schema["~run"]({ value: input }, config$1); + if (!outputDataset || !outputDataset.typed && optionDataset.typed) outputDataset = optionDataset; + } + } + if (outputDataset && !outputDataset.issues) break; + } + }; + await parseOptions(this, /* @__PURE__ */ new Set([this.key])); + if (outputDataset) return outputDataset; + _addIssue(this, "type", dataset, config$1, { + input: input[invalidDiscriminatorKey], + expected: /* @__PURE__ */ _joinExpects(expectedDiscriminators, "|"), + path: [{ + type: "object", + origin: "value", + input, + key: invalidDiscriminatorKey, + value: input[invalidDiscriminatorKey] + }] + }); + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function void_(message$1) { + return { + kind: "schema", + type: "void", + reference: void_, + expects: "void", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value === void 0) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function keyof(schema, message$1) { + return /* @__PURE__ */ picklist(Object.keys(schema.entries), message$1); + } + // @__NO_SIDE_EFFECTS__ + function message(schema, message_) { + return { + ...schema, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + return schema["~run"](dataset, { + ...config$1, + message: message_ + }); + } + }; + } + // @__NO_SIDE_EFFECTS__ + function omit(schema, keys) { + const entries$1 = { ...schema.entries }; + for (const key of keys) delete entries$1[key]; + return { + ...schema, + entries: entries$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + } + }; + } + function parse(schema, input, config$1) { + const dataset = schema["~run"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config$1)); + if (dataset.issues) throw new ValiError(dataset.issues); + return dataset.value; + } + async function parseAsync(schema, input, config$1) { + const dataset = await schema["~run"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config$1)); + if (dataset.issues) throw new ValiError(dataset.issues); + return dataset.value; + } + // @__NO_SIDE_EFFECTS__ + function parser(schema, config$1) { + const func = (input) => parse(schema, input, config$1); + func.schema = schema; + func.config = config$1; + return func; + } + // @__NO_SIDE_EFFECTS__ + function parserAsync(schema, config$1) { + const func = (input) => parseAsync(schema, input, config$1); + func.schema = schema; + func.config = config$1; + return func; + } + // @__NO_SIDE_EFFECTS__ + function partial(schema, keys) { + const entries$1 = {}; + for (const key in schema.entries) entries$1[key] = !keys || keys.includes(key) ? /* @__PURE__ */ optional(schema.entries[key]) : schema.entries[key]; + return { + ...schema, + entries: entries$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + } + }; + } + // @__NO_SIDE_EFFECTS__ + function partialAsync(schema, keys) { + const entries$1 = {}; + for (const key in schema.entries) entries$1[key] = !keys || keys.includes(key) ? /* @__PURE__ */ optionalAsync(schema.entries[key]) : schema.entries[key]; + return { + ...schema, + entries: entries$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + } + }; + } + // @__NO_SIDE_EFFECTS__ + function pick(schema, keys) { + const entries$1 = {}; + for (const key of keys) entries$1[key] = schema.entries[key]; + return { + ...schema, + entries: entries$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + } + }; + } + // @__NO_SIDE_EFFECTS__ + function pipe(...pipe$1) { + return { + ...pipe$1[0], + pipe: pipe$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + for (const item of pipe$1) if (item.kind !== "metadata") { + if (dataset.issues && (item.kind === "schema" || item.kind === "transformation")) { + dataset.typed = false; + break; + } + if (!dataset.issues || !config$1.abortEarly && !config$1.abortPipeEarly) dataset = item["~run"](dataset, config$1); + } + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function pipeAsync(...pipe$1) { + return { + ...pipe$1[0], + pipe: pipe$1, + async: true, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + for (const item of pipe$1) if (item.kind !== "metadata") { + if (dataset.issues && (item.kind === "schema" || item.kind === "transformation")) { + dataset.typed = false; + break; + } + if (!dataset.issues || !config$1.abortEarly && !config$1.abortPipeEarly) dataset = await item["~run"](dataset, config$1); + } + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function required(schema, arg2, arg3) { + const keys = Array.isArray(arg2) ? arg2 : void 0; + const message$1 = Array.isArray(arg2) ? arg3 : arg2; + const entries$1 = {}; + for (const key in schema.entries) entries$1[key] = !keys || keys.includes(key) ? /* @__PURE__ */ nonOptional(schema.entries[key], message$1) : schema.entries[key]; + return { + ...schema, + entries: entries$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + } + }; + } + // @__NO_SIDE_EFFECTS__ + function requiredAsync(schema, arg2, arg3) { + const keys = Array.isArray(arg2) ? arg2 : void 0; + const message$1 = Array.isArray(arg2) ? arg3 : arg2; + const entries$1 = {}; + for (const key in schema.entries) entries$1[key] = !keys || keys.includes(key) ? /* @__PURE__ */ nonOptionalAsync(schema.entries[key], message$1) : schema.entries[key]; + return { + ...schema, + entries: entries$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + } + }; + } + // @__NO_SIDE_EFFECTS__ + function safeParse(schema, input, config$1) { + const dataset = schema["~run"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config$1)); + return { + typed: dataset.typed, + success: !dataset.issues, + output: dataset.value, + issues: dataset.issues + }; + } + // @__NO_SIDE_EFFECTS__ + async function safeParseAsync(schema, input, config$1) { + const dataset = await schema["~run"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config$1)); + return { + typed: dataset.typed, + success: !dataset.issues, + output: dataset.value, + issues: dataset.issues + }; + } + // @__NO_SIDE_EFFECTS__ + function safeParser(schema, config$1) { + const func = (input) => /* @__PURE__ */ safeParse(schema, input, config$1); + func.schema = schema; + func.config = config$1; + return func; + } + // @__NO_SIDE_EFFECTS__ + function safeParserAsync(schema, config$1) { + const func = (input) => /* @__PURE__ */ safeParseAsync(schema, input, config$1); + func.schema = schema; + func.config = config$1; + return func; + } + // @__NO_SIDE_EFFECTS__ + function summarize(issues) { + let summary = ""; + for (const issue of issues) { + if (summary) summary += "\n"; + summary += `\xD7 ${issue.message}`; + const dotPath = /* @__PURE__ */ getDotPath(issue); + if (dotPath) summary += ` + \u2192 at ${dotPath}`; + } + return summary; + } + // @__NO_SIDE_EFFECTS__ + function unwrap(schema) { + return schema.wrapped; + } + exports2.BASE64_REGEX = BASE64_REGEX; + exports2.BIC_REGEX = BIC_REGEX; + exports2.CUID2_REGEX = CUID2_REGEX; + exports2.DECIMAL_REGEX = DECIMAL_REGEX; + exports2.DIGITS_REGEX = DIGITS_REGEX; + exports2.EMAIL_REGEX = EMAIL_REGEX; + exports2.EMOJI_REGEX = EMOJI_REGEX; + exports2.HEXADECIMAL_REGEX = HEXADECIMAL_REGEX; + exports2.HEX_COLOR_REGEX = HEX_COLOR_REGEX; + exports2.IMEI_REGEX = IMEI_REGEX; + exports2.IPV4_REGEX = IPV4_REGEX; + exports2.IPV6_REGEX = IPV6_REGEX; + exports2.IP_REGEX = IP_REGEX; + exports2.ISO_DATE_REGEX = ISO_DATE_REGEX; + exports2.ISO_DATE_TIME_REGEX = ISO_DATE_TIME_REGEX; + exports2.ISO_TIMESTAMP_REGEX = ISO_TIMESTAMP_REGEX; + exports2.ISO_TIME_REGEX = ISO_TIME_REGEX; + exports2.ISO_TIME_SECOND_REGEX = ISO_TIME_SECOND_REGEX; + exports2.ISO_WEEK_REGEX = ISO_WEEK_REGEX; + exports2.MAC48_REGEX = MAC48_REGEX; + exports2.MAC64_REGEX = MAC64_REGEX; + exports2.MAC_REGEX = MAC_REGEX; + exports2.NANO_ID_REGEX = NANO_ID_REGEX; + exports2.OCTAL_REGEX = OCTAL_REGEX; + exports2.RFC_EMAIL_REGEX = RFC_EMAIL_REGEX; + exports2.SLUG_REGEX = SLUG_REGEX; + exports2.ULID_REGEX = ULID_REGEX; + exports2.UUID_REGEX = UUID_REGEX; + exports2.ValiError = ValiError; + exports2._addIssue = _addIssue; + exports2._getByteCount = _getByteCount; + exports2._getGraphemeCount = _getGraphemeCount; + exports2._getLastMetadata = _getLastMetadata; + exports2._getStandardProps = _getStandardProps; + exports2._getWordCount = _getWordCount; + exports2._isLuhnAlgo = _isLuhnAlgo; + exports2._isValidObjectKey = _isValidObjectKey; + exports2._joinExpects = _joinExpects; + exports2._stringify = _stringify; + exports2.any = any; + exports2.args = args; + exports2.argsAsync = argsAsync; + exports2.array = array; + exports2.arrayAsync = arrayAsync; + exports2.assert = assert; + exports2.awaitAsync = awaitAsync; + exports2.base64 = base64; + exports2.bic = bic; + exports2.bigint = bigint; + exports2.blob = blob; + exports2.boolean = boolean; + exports2.brand = brand; + exports2.bytes = bytes; + exports2.check = check; + exports2.checkAsync = checkAsync; + exports2.checkItems = checkItems; + exports2.checkItemsAsync = checkItemsAsync; + exports2.config = config; + exports2.creditCard = creditCard; + exports2.cuid2 = cuid2; + exports2.custom = custom; + exports2.customAsync = customAsync; + exports2.date = date; + exports2.decimal = decimal; + exports2.deleteGlobalConfig = deleteGlobalConfig; + exports2.deleteGlobalMessage = deleteGlobalMessage; + exports2.deleteSchemaMessage = deleteSchemaMessage; + exports2.deleteSpecificMessage = deleteSpecificMessage; + exports2.description = description; + exports2.digits = digits; + exports2.email = email; + exports2.emoji = emoji; + exports2.empty = empty; + exports2.endsWith = endsWith; + exports2.entries = entries; + exports2.entriesFromList = entriesFromList; + exports2.entriesFromObjects = entriesFromObjects; + exports2.enum = enum_; + exports2.enum_ = enum_; + exports2.everyItem = everyItem; + exports2.exactOptional = exactOptional; + exports2.exactOptionalAsync = exactOptionalAsync; + exports2.examples = examples; + exports2.excludes = excludes; + exports2.fallback = fallback; + exports2.fallbackAsync = fallbackAsync; + exports2.file = file; + exports2.filterItems = filterItems; + exports2.findItem = findItem; + exports2.finite = finite; + exports2.flatten = flatten; + exports2.flavor = flavor; + exports2.forward = forward; + exports2.forwardAsync = forwardAsync; + exports2.function = function_; + exports2.function_ = function_; + exports2.getDefault = getDefault; + exports2.getDefaults = getDefaults; + exports2.getDefaultsAsync = getDefaultsAsync; + exports2.getDescription = getDescription; + exports2.getDotPath = getDotPath; + exports2.getExamples = getExamples; + exports2.getFallback = getFallback; + exports2.getFallbacks = getFallbacks; + exports2.getFallbacksAsync = getFallbacksAsync; + exports2.getGlobalConfig = getGlobalConfig; + exports2.getGlobalMessage = getGlobalMessage; + exports2.getMetadata = getMetadata; + exports2.getSchemaMessage = getSchemaMessage; + exports2.getSpecificMessage = getSpecificMessage; + exports2.getTitle = getTitle; + exports2.graphemes = graphemes; + exports2.gtValue = gtValue; + exports2.hash = hash; + exports2.hexColor = hexColor; + exports2.hexadecimal = hexadecimal; + exports2.imei = imei; + exports2.includes = includes; + exports2.instance = instance; + exports2.integer = integer; + exports2.intersect = intersect; + exports2.intersectAsync = intersectAsync; + exports2.ip = ip; + exports2.ipv4 = ipv4; + exports2.ipv6 = ipv6; + exports2.is = is; + exports2.isOfKind = isOfKind; + exports2.isOfType = isOfType; + exports2.isValiError = isValiError; + exports2.isoDate = isoDate; + exports2.isoDateTime = isoDateTime; + exports2.isoTime = isoTime; + exports2.isoTimeSecond = isoTimeSecond; + exports2.isoTimestamp = isoTimestamp; + exports2.isoWeek = isoWeek; + exports2.keyof = keyof; + exports2.lazy = lazy; + exports2.lazyAsync = lazyAsync; + exports2.length = length; + exports2.literal = literal; + exports2.looseObject = looseObject; + exports2.looseObjectAsync = looseObjectAsync; + exports2.looseTuple = looseTuple; + exports2.looseTupleAsync = looseTupleAsync; + exports2.ltValue = ltValue; + exports2.mac = mac; + exports2.mac48 = mac48; + exports2.mac64 = mac64; + exports2.map = map; + exports2.mapAsync = mapAsync; + exports2.mapItems = mapItems; + exports2.maxBytes = maxBytes; + exports2.maxEntries = maxEntries; + exports2.maxGraphemes = maxGraphemes; + exports2.maxLength = maxLength; + exports2.maxSize = maxSize; + exports2.maxValue = maxValue; + exports2.maxWords = maxWords; + exports2.message = message; + exports2.metadata = metadata; + exports2.mimeType = mimeType; + exports2.minBytes = minBytes; + exports2.minEntries = minEntries; + exports2.minGraphemes = minGraphemes; + exports2.minLength = minLength; + exports2.minSize = minSize; + exports2.minValue = minValue; + exports2.minWords = minWords; + exports2.multipleOf = multipleOf; + exports2.nan = nan; + exports2.nanoid = nanoid; + exports2.never = never; + exports2.nonEmpty = nonEmpty; + exports2.nonNullable = nonNullable; + exports2.nonNullableAsync = nonNullableAsync; + exports2.nonNullish = nonNullish; + exports2.nonNullishAsync = nonNullishAsync; + exports2.nonOptional = nonOptional; + exports2.nonOptionalAsync = nonOptionalAsync; + exports2.normalize = normalize; + exports2.notBytes = notBytes; + exports2.notEntries = notEntries; + exports2.notGraphemes = notGraphemes; + exports2.notLength = notLength; + exports2.notSize = notSize; + exports2.notValue = notValue; + exports2.notValues = notValues; + exports2.notWords = notWords; + exports2.null = null_; + exports2.null_ = null_; + exports2.nullable = nullable; + exports2.nullableAsync = nullableAsync; + exports2.nullish = nullish; + exports2.nullishAsync = nullishAsync; + exports2.number = number; + exports2.object = object; + exports2.objectAsync = objectAsync; + exports2.objectWithRest = objectWithRest; + exports2.objectWithRestAsync = objectWithRestAsync; + exports2.octal = octal; + exports2.omit = omit; + exports2.optional = optional; + exports2.optionalAsync = optionalAsync; + exports2.parse = parse; + exports2.parseAsync = parseAsync; + exports2.parseJson = parseJson; + exports2.parser = parser; + exports2.parserAsync = parserAsync; + exports2.partial = partial; + exports2.partialAsync = partialAsync; + exports2.partialCheck = partialCheck; + exports2.partialCheckAsync = partialCheckAsync; + exports2.pick = pick; + exports2.picklist = picklist; + exports2.pipe = pipe; + exports2.pipeAsync = pipeAsync; + exports2.promise = promise; + exports2.rawCheck = rawCheck; + exports2.rawCheckAsync = rawCheckAsync; + exports2.rawTransform = rawTransform; + exports2.rawTransformAsync = rawTransformAsync; + exports2.readonly = readonly; + exports2.record = record; + exports2.recordAsync = recordAsync; + exports2.reduceItems = reduceItems; + exports2.regex = regex; + exports2.required = required; + exports2.requiredAsync = requiredAsync; + exports2.returns = returns; + exports2.returnsAsync = returnsAsync; + exports2.rfcEmail = rfcEmail; + exports2.safeInteger = safeInteger; + exports2.safeParse = safeParse; + exports2.safeParseAsync = safeParseAsync; + exports2.safeParser = safeParser; + exports2.safeParserAsync = safeParserAsync; + exports2.set = set; + exports2.setAsync = setAsync; + exports2.setGlobalConfig = setGlobalConfig; + exports2.setGlobalMessage = setGlobalMessage; + exports2.setSchemaMessage = setSchemaMessage; + exports2.setSpecificMessage = setSpecificMessage; + exports2.size = size; + exports2.slug = slug; + exports2.someItem = someItem; + exports2.sortItems = sortItems; + exports2.startsWith = startsWith; + exports2.strictObject = strictObject; + exports2.strictObjectAsync = strictObjectAsync; + exports2.strictTuple = strictTuple; + exports2.strictTupleAsync = strictTupleAsync; + exports2.string = string; + exports2.stringifyJson = stringifyJson; + exports2.summarize = summarize; + exports2.symbol = symbol; + exports2.title = title; + exports2.toBigint = toBigint; + exports2.toBoolean = toBoolean; + exports2.toDate = toDate; + exports2.toLowerCase = toLowerCase; + exports2.toMaxValue = toMaxValue; + exports2.toMinValue = toMinValue; + exports2.toNumber = toNumber; + exports2.toString = toString; + exports2.toUpperCase = toUpperCase; + exports2.transform = transform; + exports2.transformAsync = transformAsync; + exports2.trim = trim; + exports2.trimEnd = trimEnd; + exports2.trimStart = trimStart; + exports2.tuple = tuple; + exports2.tupleAsync = tupleAsync; + exports2.tupleWithRest = tupleWithRest; + exports2.tupleWithRestAsync = tupleWithRestAsync; + exports2.ulid = ulid; + exports2.undefined = undefined_; + exports2.undefined_ = undefined_; + exports2.undefinedable = undefinedable; + exports2.undefinedableAsync = undefinedableAsync; + exports2.union = union; + exports2.unionAsync = unionAsync; + exports2.unknown = unknown; + exports2.unwrap = unwrap; + exports2.url = url; + exports2.uuid = uuid; + exports2.value = value; + exports2.values = values; + exports2.variant = variant; + exports2.variantAsync = variantAsync; + exports2.void = void_; + exports2.void_ = void_; + exports2.words = words; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isArray.js +var require_isArray = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isArray.js"(exports2, module2) { + "use strict"; + var isArray = Array.isArray; + module2.exports = isArray; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_freeGlobal.js +var require_freeGlobal = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_freeGlobal.js"(exports2, module2) { + "use strict"; + var freeGlobal = typeof global == "object" && global && global.Object === Object && global; + module2.exports = freeGlobal; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_root.js +var require_root = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_root.js"(exports2, module2) { + "use strict"; + var freeGlobal = require_freeGlobal(); + var freeSelf = typeof self == "object" && self && self.Object === Object && self; + var root = freeGlobal || freeSelf || Function("return this")(); + module2.exports = root; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_Symbol.js +var require_Symbol = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_Symbol.js"(exports2, module2) { + "use strict"; + var root = require_root(); + var Symbol2 = root.Symbol; + module2.exports = Symbol2; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_getRawTag.js +var require_getRawTag = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_getRawTag.js"(exports2, module2) { + "use strict"; + var Symbol2 = require_Symbol(); + var objectProto = Object.prototype; + var hasOwnProperty = objectProto.hasOwnProperty; + var nativeObjectToString = objectProto.toString; + var symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0; + function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag]; + try { + value[symToStringTag] = void 0; + var unmasked = true; + } catch (e) { + } + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; + } + module2.exports = getRawTag; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_objectToString.js +var require_objectToString = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_objectToString.js"(exports2, module2) { + "use strict"; + var objectProto = Object.prototype; + var nativeObjectToString = objectProto.toString; + function objectToString(value) { + return nativeObjectToString.call(value); + } + module2.exports = objectToString; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseGetTag.js +var require_baseGetTag = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseGetTag.js"(exports2, module2) { + "use strict"; + var Symbol2 = require_Symbol(); + var getRawTag = require_getRawTag(); + var objectToString = require_objectToString(); + var nullTag = "[object Null]"; + var undefinedTag = "[object Undefined]"; + var symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0; + function baseGetTag(value) { + if (value == null) { + return value === void 0 ? undefinedTag : nullTag; + } + return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value); + } + module2.exports = baseGetTag; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isObjectLike.js +var require_isObjectLike = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isObjectLike.js"(exports2, module2) { + "use strict"; + function isObjectLike(value) { + return value != null && typeof value == "object"; + } + module2.exports = isObjectLike; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isSymbol.js +var require_isSymbol = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isSymbol.js"(exports2, module2) { + "use strict"; + var baseGetTag = require_baseGetTag(); + var isObjectLike = require_isObjectLike(); + var symbolTag = "[object Symbol]"; + function isSymbol(value) { + return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag; + } + module2.exports = isSymbol; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_isKey.js +var require_isKey = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_isKey.js"(exports2, module2) { + "use strict"; + var isArray = require_isArray(); + var isSymbol = require_isSymbol(); + var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/; + var reIsPlainProp = /^\w*$/; + function isKey(value, object) { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object); + } + module2.exports = isKey; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isObject.js +var require_isObject = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isObject.js"(exports2, module2) { + "use strict"; + function isObject(value) { + var type = typeof value; + return value != null && (type == "object" || type == "function"); + } + module2.exports = isObject; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isFunction.js +var require_isFunction = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isFunction.js"(exports2, module2) { + "use strict"; + var baseGetTag = require_baseGetTag(); + var isObject = require_isObject(); + var asyncTag = "[object AsyncFunction]"; + var funcTag = "[object Function]"; + var genTag = "[object GeneratorFunction]"; + var proxyTag = "[object Proxy]"; + function isFunction(value) { + if (!isObject(value)) { + return false; + } + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; + } + module2.exports = isFunction; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_coreJsData.js +var require_coreJsData = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_coreJsData.js"(exports2, module2) { + "use strict"; + var root = require_root(); + var coreJsData = root["__core-js_shared__"]; + module2.exports = coreJsData; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_isMasked.js +var require_isMasked = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_isMasked.js"(exports2, module2) { + "use strict"; + var coreJsData = require_coreJsData(); + var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ""); + return uid ? "Symbol(src)_1." + uid : ""; + })(); + function isMasked(func) { + return !!maskSrcKey && maskSrcKey in func; + } + module2.exports = isMasked; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_toSource.js +var require_toSource = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_toSource.js"(exports2, module2) { + "use strict"; + var funcProto = Function.prototype; + var funcToString = funcProto.toString; + function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) { + } + try { + return func + ""; + } catch (e) { + } + } + return ""; + } + module2.exports = toSource; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseIsNative.js +var require_baseIsNative = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseIsNative.js"(exports2, module2) { + "use strict"; + var isFunction = require_isFunction(); + var isMasked = require_isMasked(); + var isObject = require_isObject(); + var toSource = require_toSource(); + var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + var reIsHostCtor = /^\[object .+?Constructor\]$/; + var funcProto = Function.prototype; + var objectProto = Object.prototype; + var funcToString = funcProto.toString; + var hasOwnProperty = objectProto.hasOwnProperty; + var reIsNative = RegExp( + "^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" + ); + function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); + } + module2.exports = baseIsNative; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_getValue.js +var require_getValue = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_getValue.js"(exports2, module2) { + "use strict"; + function getValue(object, key) { + return object == null ? void 0 : object[key]; + } + module2.exports = getValue; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_getNative.js +var require_getNative = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_getNative.js"(exports2, module2) { + "use strict"; + var baseIsNative = require_baseIsNative(); + var getValue = require_getValue(); + function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : void 0; + } + module2.exports = getNative; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_nativeCreate.js +var require_nativeCreate = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_nativeCreate.js"(exports2, module2) { + "use strict"; + var getNative = require_getNative(); + var nativeCreate = getNative(Object, "create"); + module2.exports = nativeCreate; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_hashClear.js +var require_hashClear = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_hashClear.js"(exports2, module2) { + "use strict"; + var nativeCreate = require_nativeCreate(); + function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; + } + module2.exports = hashClear; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_hashDelete.js +var require_hashDelete = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_hashDelete.js"(exports2, module2) { + "use strict"; + function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; + } + module2.exports = hashDelete; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_hashGet.js +var require_hashGet = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_hashGet.js"(exports2, module2) { + "use strict"; + var nativeCreate = require_nativeCreate(); + var HASH_UNDEFINED = "__lodash_hash_undefined__"; + var objectProto = Object.prototype; + var hasOwnProperty = objectProto.hasOwnProperty; + function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? void 0 : result; + } + return hasOwnProperty.call(data, key) ? data[key] : void 0; + } + module2.exports = hashGet; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_hashHas.js +var require_hashHas = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_hashHas.js"(exports2, module2) { + "use strict"; + var nativeCreate = require_nativeCreate(); + var objectProto = Object.prototype; + var hasOwnProperty = objectProto.hasOwnProperty; + function hashHas(key) { + var data = this.__data__; + return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key); + } + module2.exports = hashHas; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_hashSet.js +var require_hashSet = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_hashSet.js"(exports2, module2) { + "use strict"; + var nativeCreate = require_nativeCreate(); + var HASH_UNDEFINED = "__lodash_hash_undefined__"; + function hashSet(key, value) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value; + return this; + } + module2.exports = hashSet; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_Hash.js +var require_Hash = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_Hash.js"(exports2, module2) { + "use strict"; + var hashClear = require_hashClear(); + var hashDelete = require_hashDelete(); + var hashGet = require_hashGet(); + var hashHas = require_hashHas(); + var hashSet = require_hashSet(); + function Hash(entries) { + var index2 = -1, length = entries == null ? 0 : entries.length; + this.clear(); + while (++index2 < length) { + var entry = entries[index2]; + this.set(entry[0], entry[1]); + } + } + Hash.prototype.clear = hashClear; + Hash.prototype["delete"] = hashDelete; + Hash.prototype.get = hashGet; + Hash.prototype.has = hashHas; + Hash.prototype.set = hashSet; + module2.exports = Hash; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_listCacheClear.js +var require_listCacheClear = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_listCacheClear.js"(exports2, module2) { + "use strict"; + function listCacheClear() { + this.__data__ = []; + this.size = 0; + } + module2.exports = listCacheClear; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/eq.js +var require_eq = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/eq.js"(exports2, module2) { + "use strict"; + function eq(value, other) { + return value === other || value !== value && other !== other; + } + module2.exports = eq; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_assocIndexOf.js +var require_assocIndexOf = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_assocIndexOf.js"(exports2, module2) { + "use strict"; + var eq = require_eq(); + function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; + } + module2.exports = assocIndexOf; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_listCacheDelete.js +var require_listCacheDelete = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_listCacheDelete.js"(exports2, module2) { + "use strict"; + var assocIndexOf = require_assocIndexOf(); + var arrayProto = Array.prototype; + var splice = arrayProto.splice; + function listCacheDelete(key) { + var data = this.__data__, index2 = assocIndexOf(data, key); + if (index2 < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index2 == lastIndex) { + data.pop(); + } else { + splice.call(data, index2, 1); + } + --this.size; + return true; + } + module2.exports = listCacheDelete; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_listCacheGet.js +var require_listCacheGet = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_listCacheGet.js"(exports2, module2) { + "use strict"; + var assocIndexOf = require_assocIndexOf(); + function listCacheGet(key) { + var data = this.__data__, index2 = assocIndexOf(data, key); + return index2 < 0 ? void 0 : data[index2][1]; + } + module2.exports = listCacheGet; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_listCacheHas.js +var require_listCacheHas = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_listCacheHas.js"(exports2, module2) { + "use strict"; + var assocIndexOf = require_assocIndexOf(); + function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; + } + module2.exports = listCacheHas; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_listCacheSet.js +var require_listCacheSet = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_listCacheSet.js"(exports2, module2) { + "use strict"; + var assocIndexOf = require_assocIndexOf(); + function listCacheSet(key, value) { + var data = this.__data__, index2 = assocIndexOf(data, key); + if (index2 < 0) { + ++this.size; + data.push([key, value]); + } else { + data[index2][1] = value; + } + return this; + } + module2.exports = listCacheSet; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_ListCache.js +var require_ListCache = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_ListCache.js"(exports2, module2) { + "use strict"; + var listCacheClear = require_listCacheClear(); + var listCacheDelete = require_listCacheDelete(); + var listCacheGet = require_listCacheGet(); + var listCacheHas = require_listCacheHas(); + var listCacheSet = require_listCacheSet(); + function ListCache(entries) { + var index2 = -1, length = entries == null ? 0 : entries.length; + this.clear(); + while (++index2 < length) { + var entry = entries[index2]; + this.set(entry[0], entry[1]); + } + } + ListCache.prototype.clear = listCacheClear; + ListCache.prototype["delete"] = listCacheDelete; + ListCache.prototype.get = listCacheGet; + ListCache.prototype.has = listCacheHas; + ListCache.prototype.set = listCacheSet; + module2.exports = ListCache; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_Map.js +var require_Map = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_Map.js"(exports2, module2) { + "use strict"; + var getNative = require_getNative(); + var root = require_root(); + var Map2 = getNative(root, "Map"); + module2.exports = Map2; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_mapCacheClear.js +var require_mapCacheClear = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_mapCacheClear.js"(exports2, module2) { + "use strict"; + var Hash = require_Hash(); + var ListCache = require_ListCache(); + var Map2 = require_Map(); + function mapCacheClear() { + this.size = 0; + this.__data__ = { + "hash": new Hash(), + "map": new (Map2 || ListCache)(), + "string": new Hash() + }; + } + module2.exports = mapCacheClear; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_isKeyable.js +var require_isKeyable = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_isKeyable.js"(exports2, module2) { + "use strict"; + function isKeyable(value) { + var type = typeof value; + return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null; + } + module2.exports = isKeyable; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_getMapData.js +var require_getMapData = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_getMapData.js"(exports2, module2) { + "use strict"; + var isKeyable = require_isKeyable(); + function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map; + } + module2.exports = getMapData; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_mapCacheDelete.js +var require_mapCacheDelete = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_mapCacheDelete.js"(exports2, module2) { + "use strict"; + var getMapData = require_getMapData(); + function mapCacheDelete(key) { + var result = getMapData(this, key)["delete"](key); + this.size -= result ? 1 : 0; + return result; + } + module2.exports = mapCacheDelete; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_mapCacheGet.js +var require_mapCacheGet = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_mapCacheGet.js"(exports2, module2) { + "use strict"; + var getMapData = require_getMapData(); + function mapCacheGet(key) { + return getMapData(this, key).get(key); + } + module2.exports = mapCacheGet; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_mapCacheHas.js +var require_mapCacheHas = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_mapCacheHas.js"(exports2, module2) { + "use strict"; + var getMapData = require_getMapData(); + function mapCacheHas(key) { + return getMapData(this, key).has(key); + } + module2.exports = mapCacheHas; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_mapCacheSet.js +var require_mapCacheSet = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_mapCacheSet.js"(exports2, module2) { + "use strict"; + var getMapData = require_getMapData(); + function mapCacheSet(key, value) { + var data = getMapData(this, key), size = data.size; + data.set(key, value); + this.size += data.size == size ? 0 : 1; + return this; + } + module2.exports = mapCacheSet; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_MapCache.js +var require_MapCache = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_MapCache.js"(exports2, module2) { + "use strict"; + var mapCacheClear = require_mapCacheClear(); + var mapCacheDelete = require_mapCacheDelete(); + var mapCacheGet = require_mapCacheGet(); + var mapCacheHas = require_mapCacheHas(); + var mapCacheSet = require_mapCacheSet(); + function MapCache(entries) { + var index2 = -1, length = entries == null ? 0 : entries.length; + this.clear(); + while (++index2 < length) { + var entry = entries[index2]; + this.set(entry[0], entry[1]); + } + } + MapCache.prototype.clear = mapCacheClear; + MapCache.prototype["delete"] = mapCacheDelete; + MapCache.prototype.get = mapCacheGet; + MapCache.prototype.has = mapCacheHas; + MapCache.prototype.set = mapCacheSet; + module2.exports = MapCache; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/memoize.js +var require_memoize = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/memoize.js"(exports2, module2) { + "use strict"; + var MapCache = require_MapCache(); + var FUNC_ERROR_TEXT = "Expected a function"; + function memoize(func, resolver) { + if (typeof func != "function" || resolver != null && typeof resolver != "function") { + throw new TypeError(FUNC_ERROR_TEXT); + } + var memoized = function() { + var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache; + if (cache.has(key)) { + return cache.get(key); + } + var result = func.apply(this, args); + memoized.cache = cache.set(key, result) || cache; + return result; + }; + memoized.cache = new (memoize.Cache || MapCache)(); + return memoized; + } + memoize.Cache = MapCache; + module2.exports = memoize; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_memoizeCapped.js +var require_memoizeCapped = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_memoizeCapped.js"(exports2, module2) { + "use strict"; + var memoize = require_memoize(); + var MAX_MEMOIZE_SIZE = 500; + function memoizeCapped(func) { + var result = memoize(func, function(key) { + if (cache.size === MAX_MEMOIZE_SIZE) { + cache.clear(); + } + return key; + }); + var cache = result.cache; + return result; + } + module2.exports = memoizeCapped; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_stringToPath.js +var require_stringToPath = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_stringToPath.js"(exports2, module2) { + "use strict"; + var memoizeCapped = require_memoizeCapped(); + var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + var reEscapeChar = /\\(\\)?/g; + var stringToPath = memoizeCapped(function(string) { + var result = []; + if (string.charCodeAt(0) === 46) { + result.push(""); + } + string.replace(rePropName, function(match, number, quote, subString) { + result.push(quote ? subString.replace(reEscapeChar, "$1") : number || match); + }); + return result; + }); + module2.exports = stringToPath; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_arrayMap.js +var require_arrayMap = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_arrayMap.js"(exports2, module2) { + "use strict"; + function arrayMap(array, iteratee) { + var index2 = -1, length = array == null ? 0 : array.length, result = Array(length); + while (++index2 < length) { + result[index2] = iteratee(array[index2], index2, array); + } + return result; + } + module2.exports = arrayMap; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseToString.js +var require_baseToString = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseToString.js"(exports2, module2) { + "use strict"; + var Symbol2 = require_Symbol(); + var arrayMap = require_arrayMap(); + var isArray = require_isArray(); + var isSymbol = require_isSymbol(); + var INFINITY = 1 / 0; + var symbolProto = Symbol2 ? Symbol2.prototype : void 0; + var symbolToString = symbolProto ? symbolProto.toString : void 0; + function baseToString(value) { + if (typeof value == "string") { + return value; + } + if (isArray(value)) { + return arrayMap(value, baseToString) + ""; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ""; + } + var result = value + ""; + return result == "0" && 1 / value == -INFINITY ? "-0" : result; + } + module2.exports = baseToString; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/toString.js +var require_toString = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/toString.js"(exports2, module2) { + "use strict"; + var baseToString = require_baseToString(); + function toString(value) { + return value == null ? "" : baseToString(value); + } + module2.exports = toString; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_castPath.js +var require_castPath = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_castPath.js"(exports2, module2) { + "use strict"; + var isArray = require_isArray(); + var isKey = require_isKey(); + var stringToPath = require_stringToPath(); + var toString = require_toString(); + function castPath(value, object) { + if (isArray(value)) { + return value; + } + return isKey(value, object) ? [value] : stringToPath(toString(value)); + } + module2.exports = castPath; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_toKey.js +var require_toKey = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_toKey.js"(exports2, module2) { + "use strict"; + var isSymbol = require_isSymbol(); + var INFINITY = 1 / 0; + function toKey(value) { + if (typeof value == "string" || isSymbol(value)) { + return value; + } + var result = value + ""; + return result == "0" && 1 / value == -INFINITY ? "-0" : result; + } + module2.exports = toKey; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseGet.js +var require_baseGet = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseGet.js"(exports2, module2) { + "use strict"; + var castPath = require_castPath(); + var toKey = require_toKey(); + function baseGet(object, path2) { + path2 = castPath(path2, object); + var index2 = 0, length = path2.length; + while (object != null && index2 < length) { + object = object[toKey(path2[index2++])]; + } + return index2 && index2 == length ? object : void 0; + } + module2.exports = baseGet; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_defineProperty.js +var require_defineProperty = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_defineProperty.js"(exports2, module2) { + "use strict"; + var getNative = require_getNative(); + var defineProperty = (function() { + try { + var func = getNative(Object, "defineProperty"); + func({}, "", {}); + return func; + } catch (e) { + } + })(); + module2.exports = defineProperty; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseAssignValue.js +var require_baseAssignValue = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseAssignValue.js"(exports2, module2) { + "use strict"; + var defineProperty = require_defineProperty(); + function baseAssignValue(object, key, value) { + if (key == "__proto__" && defineProperty) { + defineProperty(object, key, { + "configurable": true, + "enumerable": true, + "value": value, + "writable": true + }); + } else { + object[key] = value; + } + } + module2.exports = baseAssignValue; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_assignValue.js +var require_assignValue = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_assignValue.js"(exports2, module2) { + "use strict"; + var baseAssignValue = require_baseAssignValue(); + var eq = require_eq(); + var objectProto = Object.prototype; + var hasOwnProperty = objectProto.hasOwnProperty; + function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) { + baseAssignValue(object, key, value); + } + } + module2.exports = assignValue; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_isIndex.js +var require_isIndex = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_isIndex.js"(exports2, module2) { + "use strict"; + var MAX_SAFE_INTEGER = 9007199254740991; + var reIsUint = /^(?:0|[1-9]\d*)$/; + function isIndex(value, length) { + var type = typeof value; + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length); + } + module2.exports = isIndex; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseSet.js +var require_baseSet = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseSet.js"(exports2, module2) { + "use strict"; + var assignValue = require_assignValue(); + var castPath = require_castPath(); + var isIndex = require_isIndex(); + var isObject = require_isObject(); + var toKey = require_toKey(); + function baseSet(object, path2, value, customizer) { + if (!isObject(object)) { + return object; + } + path2 = castPath(path2, object); + var index2 = -1, length = path2.length, lastIndex = length - 1, nested = object; + while (nested != null && ++index2 < length) { + var key = toKey(path2[index2]), newValue = value; + if (key === "__proto__" || key === "constructor" || key === "prototype") { + return object; + } + if (index2 != lastIndex) { + var objValue = nested[key]; + newValue = customizer ? customizer(objValue, key, nested) : void 0; + if (newValue === void 0) { + newValue = isObject(objValue) ? objValue : isIndex(path2[index2 + 1]) ? [] : {}; + } + } + assignValue(nested, key, newValue); + nested = nested[key]; + } + return object; + } + module2.exports = baseSet; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_basePickBy.js +var require_basePickBy = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_basePickBy.js"(exports2, module2) { + "use strict"; + var baseGet = require_baseGet(); + var baseSet = require_baseSet(); + var castPath = require_castPath(); + function basePickBy(object, paths, predicate) { + var index2 = -1, length = paths.length, result = {}; + while (++index2 < length) { + var path2 = paths[index2], value = baseGet(object, path2); + if (predicate(value, path2)) { + baseSet(result, castPath(path2, object), value); + } + } + return result; + } + module2.exports = basePickBy; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseHasIn.js +var require_baseHasIn = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseHasIn.js"(exports2, module2) { + "use strict"; + function baseHasIn(object, key) { + return object != null && key in Object(object); + } + module2.exports = baseHasIn; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseIsArguments.js +var require_baseIsArguments = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseIsArguments.js"(exports2, module2) { + "use strict"; + var baseGetTag = require_baseGetTag(); + var isObjectLike = require_isObjectLike(); + var argsTag = "[object Arguments]"; + function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; + } + module2.exports = baseIsArguments; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isArguments.js +var require_isArguments = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isArguments.js"(exports2, module2) { + "use strict"; + var baseIsArguments = require_baseIsArguments(); + var isObjectLike = require_isObjectLike(); + var objectProto = Object.prototype; + var hasOwnProperty = objectProto.hasOwnProperty; + var propertyIsEnumerable = objectProto.propertyIsEnumerable; + var isArguments = baseIsArguments(/* @__PURE__ */ (function() { + return arguments; + })()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee"); + }; + module2.exports = isArguments; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isLength.js +var require_isLength = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isLength.js"(exports2, module2) { + "use strict"; + var MAX_SAFE_INTEGER = 9007199254740991; + function isLength(value) { + return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + module2.exports = isLength; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_hasPath.js +var require_hasPath = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_hasPath.js"(exports2, module2) { + "use strict"; + var castPath = require_castPath(); + var isArguments = require_isArguments(); + var isArray = require_isArray(); + var isIndex = require_isIndex(); + var isLength = require_isLength(); + var toKey = require_toKey(); + function hasPath(object, path2, hasFunc) { + path2 = castPath(path2, object); + var index2 = -1, length = path2.length, result = false; + while (++index2 < length) { + var key = toKey(path2[index2]); + if (!(result = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; + } + if (result || ++index2 != length) { + return result; + } + length = object == null ? 0 : object.length; + return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object)); + } + module2.exports = hasPath; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/hasIn.js +var require_hasIn = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/hasIn.js"(exports2, module2) { + "use strict"; + var baseHasIn = require_baseHasIn(); + var hasPath = require_hasPath(); + function hasIn(object, path2) { + return object != null && hasPath(object, path2, baseHasIn); + } + module2.exports = hasIn; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_basePick.js +var require_basePick = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_basePick.js"(exports2, module2) { + "use strict"; + var basePickBy = require_basePickBy(); + var hasIn = require_hasIn(); + function basePick(object, paths) { + return basePickBy(object, paths, function(value, path2) { + return hasIn(object, path2); + }); + } + module2.exports = basePick; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_arrayPush.js +var require_arrayPush = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_arrayPush.js"(exports2, module2) { + "use strict"; + function arrayPush(array, values) { + var index2 = -1, length = values.length, offset = array.length; + while (++index2 < length) { + array[offset + index2] = values[index2]; + } + return array; + } + module2.exports = arrayPush; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_isFlattenable.js +var require_isFlattenable = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_isFlattenable.js"(exports2, module2) { + "use strict"; + var Symbol2 = require_Symbol(); + var isArguments = require_isArguments(); + var isArray = require_isArray(); + var spreadableSymbol = Symbol2 ? Symbol2.isConcatSpreadable : void 0; + function isFlattenable(value) { + return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]); + } + module2.exports = isFlattenable; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseFlatten.js +var require_baseFlatten = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseFlatten.js"(exports2, module2) { + "use strict"; + var arrayPush = require_arrayPush(); + var isFlattenable = require_isFlattenable(); + function baseFlatten(array, depth, predicate, isStrict, result) { + var index2 = -1, length = array.length; + predicate || (predicate = isFlattenable); + result || (result = []); + while (++index2 < length) { + var value = array[index2]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; + } + module2.exports = baseFlatten; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/flatten.js +var require_flatten = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/flatten.js"(exports2, module2) { + "use strict"; + var baseFlatten = require_baseFlatten(); + function flatten(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, 1) : []; + } + module2.exports = flatten; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_apply.js +var require_apply = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_apply.js"(exports2, module2) { + "use strict"; + function apply(func, thisArg, args) { + switch (args.length) { + case 0: + return func.call(thisArg); + case 1: + return func.call(thisArg, args[0]); + case 2: + return func.call(thisArg, args[0], args[1]); + case 3: + return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); + } + module2.exports = apply; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_overRest.js +var require_overRest = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_overRest.js"(exports2, module2) { + "use strict"; + var apply = require_apply(); + var nativeMax = Math.max; + function overRest(func, start, transform) { + start = nativeMax(start === void 0 ? func.length - 1 : start, 0); + return function() { + var args = arguments, index2 = -1, length = nativeMax(args.length - start, 0), array = Array(length); + while (++index2 < length) { + array[index2] = args[start + index2]; + } + index2 = -1; + var otherArgs = Array(start + 1); + while (++index2 < start) { + otherArgs[index2] = args[index2]; + } + otherArgs[start] = transform(array); + return apply(func, this, otherArgs); + }; + } + module2.exports = overRest; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/constant.js +var require_constant = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/constant.js"(exports2, module2) { + "use strict"; + function constant(value) { + return function() { + return value; + }; + } + module2.exports = constant; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/identity.js +var require_identity = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/identity.js"(exports2, module2) { + "use strict"; + function identity(value) { + return value; + } + module2.exports = identity; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseSetToString.js +var require_baseSetToString = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseSetToString.js"(exports2, module2) { + "use strict"; + var constant = require_constant(); + var defineProperty = require_defineProperty(); + var identity = require_identity(); + var baseSetToString = !defineProperty ? identity : function(func, string) { + return defineProperty(func, "toString", { + "configurable": true, + "enumerable": false, + "value": constant(string), + "writable": true + }); + }; + module2.exports = baseSetToString; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_shortOut.js +var require_shortOut = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_shortOut.js"(exports2, module2) { + "use strict"; + var HOT_COUNT = 800; + var HOT_SPAN = 16; + var nativeNow = Date.now; + function shortOut(func) { + var count = 0, lastCalled = 0; + return function() { + var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled); + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return arguments[0]; + } + } else { + count = 0; + } + return func.apply(void 0, arguments); + }; + } + module2.exports = shortOut; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_setToString.js +var require_setToString = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_setToString.js"(exports2, module2) { + "use strict"; + var baseSetToString = require_baseSetToString(); + var shortOut = require_shortOut(); + var setToString = shortOut(baseSetToString); + module2.exports = setToString; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_flatRest.js +var require_flatRest = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_flatRest.js"(exports2, module2) { + "use strict"; + var flatten = require_flatten(); + var overRest = require_overRest(); + var setToString = require_setToString(); + function flatRest(func) { + return setToString(overRest(func, void 0, flatten), func + ""); + } + module2.exports = flatRest; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/pick.js +var require_pick = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/pick.js"(exports2, module2) { + "use strict"; + var basePick = require_basePick(); + var flatRest = require_flatRest(); + var pick = flatRest(function(object, paths) { + return object == null ? {} : basePick(object, paths); + }); + module2.exports = pick; + } +}); + +// ../../node_modules/.pnpm/@react-router+dev@7.14.0_@react-router+serve@7.14.0_react-router@7.14.0_react-dom@19.2._ec11c05ad7feecef203217fd751c918f/node_modules/@react-router/dev/dist/routes.js +var require_routes = __commonJS({ + "../../node_modules/.pnpm/@react-router+dev@7.14.0_@react-router+serve@7.14.0_react-router@7.14.0_react-dom@19.2._ec11c05ad7feecef203217fd751c918f/node_modules/@react-router/dev/dist/routes.js"(exports2, module2) { + "use strict"; + var __create2 = Object.create; + var __defProp2 = Object.defineProperty; + var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; + var __getOwnPropNames2 = Object.getOwnPropertyNames; + var __getProtoOf2 = Object.getPrototypeOf; + var __hasOwnProp2 = Object.prototype.hasOwnProperty; + var __export2 = (target, all) => { + for (var name in all) + __defProp2(target, name, { get: all[name], enumerable: true }); + }; + var __copyProps2 = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames2(from)) + if (!__hasOwnProp2.call(to, key) && key !== except) + __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); + } + return to; + }; + var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target, + mod + )); + var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); + var routes_exports = {}; + __export2(routes_exports, { + getAppDirectory: () => getAppDirectory, + index: () => index2, + layout: () => layout2, + prefix: () => prefix2, + relative: () => relative2, + route: () => route2 + }); + module2.exports = __toCommonJS2(routes_exports); + var Path = __toESM2(require_dist()); + var v = __toESM2(require_dist2()); + var import_pick = __toESM2(require_pick()); + function invariant(value, message) { + if (value === false || value === null || typeof value === "undefined") { + console.error( + "The following error is a bug in React Router; please open an issue! https://github.com/remix-run/react-router/issues/new/choose" + ); + throw new Error(message); + } + } + function getAppDirectory() { + invariant(globalThis.__reactRouterAppDirectory); + return globalThis.__reactRouterAppDirectory; + } + var routeConfigEntrySchema = v.pipe( + v.custom((value) => { + return !(typeof value === "object" && value !== null && "then" in value && "catch" in value); + }, "Invalid type: Expected object but received a promise. Did you forget to await?"), + v.object({ + id: v.optional( + v.pipe( + v.string(), + v.notValue("root", "A route cannot use the reserved id 'root'.") + ) + ), + path: v.optional(v.string()), + index: v.optional(v.boolean()), + caseSensitive: v.optional(v.boolean()), + file: v.string(), + children: v.optional(v.array(v.lazy(() => routeConfigEntrySchema))) + }) + ); + var resolvedRouteConfigSchema = v.array(routeConfigEntrySchema); + var createConfigRouteOptionKeys = [ + "id", + "index", + "caseSensitive" + ]; + function route2(path2, file, optionsOrChildren, children) { + let options = {}; + if (Array.isArray(optionsOrChildren) || !optionsOrChildren) { + children = optionsOrChildren; + } else { + options = optionsOrChildren; + } + return { + file, + children, + path: path2 ?? void 0, + ...(0, import_pick.default)(options, createConfigRouteOptionKeys) + }; + } + var createIndexOptionKeys = ["id"]; + function index2(file, options) { + return { + file, + index: true, + ...(0, import_pick.default)(options, createIndexOptionKeys) + }; + } + var createLayoutOptionKeys = ["id"]; + function layout2(file, optionsOrChildren, children) { + let options = {}; + if (Array.isArray(optionsOrChildren) || !optionsOrChildren) { + children = optionsOrChildren; + } else { + options = optionsOrChildren; + } + return { + file, + children, + ...(0, import_pick.default)(options, createLayoutOptionKeys) + }; + } + function prefix2(prefixPath, routes) { + return routes.map((route22) => { + if (route22.index || typeof route22.path === "string") { + return { + ...route22, + path: route22.path ? joinRoutePaths(prefixPath, route22.path) : prefixPath, + children: route22.children + }; + } else if (route22.children) { + return { + ...route22, + children: prefix2(prefixPath, route22.children) + }; + } + return route22; + }); + } + function relative2(directory) { + return { + /** + * Helper function for creating a route config entry, for use within + * `routes.ts`. Note that this helper has been scoped, meaning that file + * path will be resolved relative to the directory provided to the + * `relative` call that created this helper. + */ + route: (path2, file, ...rest) => { + return route2(path2, Path.resolve(directory, file), ...rest); + }, + /** + * Helper function for creating a route config entry for an index route, for + * use within `routes.ts`. Note that this helper has been scoped, meaning + * that file path will be resolved relative to the directory provided to the + * `relative` call that created this helper. + */ + index: (file, ...rest) => { + return index2(Path.resolve(directory, file), ...rest); + }, + /** + * Helper function for creating a route config entry for a layout route, for + * use within `routes.ts`. Note that this helper has been scoped, meaning + * that file path will be resolved relative to the directory provided to the + * `relative` call that created this helper. + */ + layout: (file, ...rest) => { + return layout2(Path.resolve(directory, file), ...rest); + }, + // Passthrough of helper functions that don't need relative scoping so that + // a complete API is still provided. + prefix: prefix2 + }; + } + function joinRoutePaths(path1, path2) { + return [ + path1.replace(/\/+$/, ""), + // Remove trailing slashes + path2.replace(/^\/+/, "") + // Remove leading slashes + ].join("/"); + } + } +}); + +// src/index.ts +var index_exports = {}; +__export(index_exports, { + clearAuthOnResponse: () => clearAuthOnResponse, + cookie: () => cookie, + getAddonRoutesConfig: () => getAddonRoutesConfig, + getAuthFromRequest: () => getAuthFromRequest, + getClearAuthCookieHeader: () => getClearAuthCookieHeader, + redirectIfLoggedInLoader: () => redirectIfLoggedInLoader, + redirectWithClearedCookie: () => redirectWithClearedCookie, + requireAuthCookie: () => requireAuthCookie, + setAuthOnResponse: () => setAuthOnResponse +}); +module.exports = __toCommonJS(index_exports); +var import_react_router = require("react-router"); +var import_routes = __toESM(require_routes(), 1); +var import_node_path = __toESM(require("path"), 1); +function getAddonRoutesConfig(routesConfig, addonsInfo) { + const resultRoutesConfig = []; + for (const routeConfig of routesConfig) { + if (routeConfig.type !== "prefix") { + const containsAddonModule = addonsInfo.find( + (addon) => routeConfig.file.includes(addon.name) + ); + if (containsAddonModule) { + routeConfig.file = import_node_path.default.join( + containsAddonModule.modulePath, + routeConfig.file.replace(containsAddonModule.name, "") + ); + } + } + switch (routeConfig.type) { + case "route": { + const children = routeConfig.children ? getAddonRoutesConfig( + routeConfig.children, + addonsInfo + ) : void 0; + resultRoutesConfig.push( + (0, import_routes.route)( + routeConfig.path, + routeConfig.file, + routeConfig.options || {}, + children + ) + ); + break; + } + case "index": + resultRoutesConfig.push((0, import_routes.index)(routeConfig.file, routeConfig.options)); + break; + case "layout": { + const children = routeConfig.children ? getAddonRoutesConfig( + routeConfig.children, + addonsInfo + ) : void 0; + resultRoutesConfig.push( + (0, import_routes.layout)(routeConfig.file, routeConfig.options || {}, children) + ); + break; + } + case "prefix": + resultRoutesConfig.push( + ...(0, import_routes.prefix)( + routeConfig.path, + getAddonRoutesConfig(routeConfig.children, addonsInfo) + ) + ); + break; + default: + break; + } + } + return resultRoutesConfig; +} +var secret = process.env.COOKIE_SECRET || "default"; +if (secret === "default" && process.env.NODE_ENV === "production") { + console.warn( + "\u{1F6A8} No COOKIE_SECRET environment variable set, using default. The app is insecure in production." + ); +} +var cookie = (0, import_react_router.createCookie)("auth_seven", { + secrets: [secret], + // 30 days + // maxAge: 30 * 24 * 60 * 60, + httpOnly: true, + secure: process.env.NODE_ENV === "production", + sameSite: "lax" +}); +async function getAuthFromRequest(request) { + let token; + try { + token = await cookie.parse(request.headers.get("Cookie")); + } catch { + } + return token ?? void 0; +} +async function setAuthOnResponse(response, token, options) { + const header = await cookie.serialize(token, options); + response.headers.append("Set-Cookie", header); + return response; +} +async function clearAuthOnResponse(response, options) { + const header = await getClearAuthCookieHeader(options); + response.headers.append("Set-Cookie", header); + return response; +} +async function getClearAuthCookieHeader(options) { + return await cookie.serialize("", { + maxAge: 0, + ...options + }); +} +async function requireAuthCookie(request) { + const token = await getAuthFromRequest(request); + if (!token) { + throw await redirectWithClearedCookie("/login"); + } + return token; +} +async function redirectIfLoggedInLoader({ + request +}) { + const token = await getAuthFromRequest(request); + if (token) { + throw (0, import_react_router.redirect)("/"); + } + return null; +} +async function redirectWithClearedCookie(url = "/") { + return clearAuthOnResponse((0, import_react_router.redirect)(url)); +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + clearAuthOnResponse, + cookie, + getAddonRoutesConfig, + getAuthFromRequest, + getClearAuthCookieHeader, + redirectIfLoggedInLoader, + redirectWithClearedCookie, + requireAuthCookie, + setAuthOnResponse +}); +/*! Bundled license information: + +@react-router/dev/dist/routes.js: + (** + * @react-router/dev v7.14.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + *) +*/ diff --git a/packages/react-router/dist/index.d.cts b/packages/react-router/dist/index.d.cts new file mode 100644 index 00000000000..ab9cea9b793 --- /dev/null +++ b/packages/react-router/dist/index.d.cts @@ -0,0 +1,16 @@ +import * as react_router from 'react-router'; +import { LoaderFunctionArgs } from 'react-router'; +import { RouteConfigEntry } from '@react-router/dev/routes'; +import { ReactRouterRouteEntry } from '@plone/types'; + +declare function getAddonRoutesConfig(routesConfig: Array, addonsInfo: Array): Array; +declare const cookie: react_router.Cookie; +declare function getAuthFromRequest(request: Request): Promise; +declare function setAuthOnResponse(response: Response, token: string, options?: Parameters[1]): Promise; +declare function clearAuthOnResponse(response: Response, options?: Parameters[1]): Promise; +declare function getClearAuthCookieHeader(options?: Parameters[1]): Promise; +declare function requireAuthCookie(request: Request): Promise; +declare function redirectIfLoggedInLoader({ request, }: LoaderFunctionArgs): Promise; +declare function redirectWithClearedCookie(url?: string): Promise; + +export { clearAuthOnResponse, cookie, getAddonRoutesConfig, getAuthFromRequest, getClearAuthCookieHeader, redirectIfLoggedInLoader, redirectWithClearedCookie, requireAuthCookie, setAuthOnResponse }; diff --git a/packages/react-router/dist/index.d.ts b/packages/react-router/dist/index.d.ts new file mode 100644 index 00000000000..ab9cea9b793 --- /dev/null +++ b/packages/react-router/dist/index.d.ts @@ -0,0 +1,16 @@ +import * as react_router from 'react-router'; +import { LoaderFunctionArgs } from 'react-router'; +import { RouteConfigEntry } from '@react-router/dev/routes'; +import { ReactRouterRouteEntry } from '@plone/types'; + +declare function getAddonRoutesConfig(routesConfig: Array, addonsInfo: Array): Array; +declare const cookie: react_router.Cookie; +declare function getAuthFromRequest(request: Request): Promise; +declare function setAuthOnResponse(response: Response, token: string, options?: Parameters[1]): Promise; +declare function clearAuthOnResponse(response: Response, options?: Parameters[1]): Promise; +declare function getClearAuthCookieHeader(options?: Parameters[1]): Promise; +declare function requireAuthCookie(request: Request): Promise; +declare function redirectIfLoggedInLoader({ request, }: LoaderFunctionArgs): Promise; +declare function redirectWithClearedCookie(url?: string): Promise; + +export { clearAuthOnResponse, cookie, getAddonRoutesConfig, getAuthFromRequest, getClearAuthCookieHeader, redirectIfLoggedInLoader, redirectWithClearedCookie, requireAuthCookie, setAuthOnResponse }; diff --git a/packages/react-router/dist/index.js b/packages/react-router/dist/index.js new file mode 100644 index 00000000000..4615eb6d734 --- /dev/null +++ b/packages/react-router/dist/index.js @@ -0,0 +1,7729 @@ +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); + +// ../../node_modules/.pnpm/pathe@1.1.2/node_modules/pathe/dist/shared/pathe.1f0a373c.cjs +var require_pathe_1f0a373c = __commonJS({ + "../../node_modules/.pnpm/pathe@1.1.2/node_modules/pathe/dist/shared/pathe.1f0a373c.cjs"(exports) { + "use strict"; + var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//; + function normalizeWindowsPath(input = "") { + if (!input) { + return input; + } + return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase()); + } + var _UNC_REGEX = /^[/\\]{2}/; + var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/; + var _DRIVE_LETTER_RE = /^[A-Za-z]:$/; + var _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/; + var sep = "/"; + var delimiter = ":"; + var normalize = function(path3) { + if (path3.length === 0) { + return "."; + } + path3 = normalizeWindowsPath(path3); + const isUNCPath = path3.match(_UNC_REGEX); + const isPathAbsolute = isAbsolute(path3); + const trailingSeparator = path3[path3.length - 1] === "/"; + path3 = normalizeString(path3, !isPathAbsolute); + if (path3.length === 0) { + if (isPathAbsolute) { + return "/"; + } + return trailingSeparator ? "./" : "."; + } + if (trailingSeparator) { + path3 += "/"; + } + if (_DRIVE_LETTER_RE.test(path3)) { + path3 += "/"; + } + if (isUNCPath) { + if (!isPathAbsolute) { + return `//./${path3}`; + } + return `//${path3}`; + } + return isPathAbsolute && !isAbsolute(path3) ? `/${path3}` : path3; + }; + var join = function(...arguments_) { + if (arguments_.length === 0) { + return "."; + } + let joined; + for (const argument of arguments_) { + if (argument && argument.length > 0) { + if (joined === void 0) { + joined = argument; + } else { + joined += `/${argument}`; + } + } + } + if (joined === void 0) { + return "."; + } + return normalize(joined.replace(/\/\/+/g, "/")); + }; + function cwd() { + if (typeof process !== "undefined" && typeof process.cwd === "function") { + return process.cwd().replace(/\\/g, "/"); + } + return "/"; + } + var resolve = function(...arguments_) { + arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument)); + let resolvedPath = ""; + let resolvedAbsolute = false; + for (let index2 = arguments_.length - 1; index2 >= -1 && !resolvedAbsolute; index2--) { + const path3 = index2 >= 0 ? arguments_[index2] : cwd(); + if (!path3 || path3.length === 0) { + continue; + } + resolvedPath = `${path3}/${resolvedPath}`; + resolvedAbsolute = isAbsolute(path3); + } + resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute); + if (resolvedAbsolute && !isAbsolute(resolvedPath)) { + return `/${resolvedPath}`; + } + return resolvedPath.length > 0 ? resolvedPath : "."; + }; + function normalizeString(path3, allowAboveRoot) { + let res = ""; + let lastSegmentLength = 0; + let lastSlash = -1; + let dots = 0; + let char = null; + for (let index2 = 0; index2 <= path3.length; ++index2) { + if (index2 < path3.length) { + char = path3[index2]; + } else if (char === "/") { + break; + } else { + char = "/"; + } + if (char === "/") { + if (lastSlash === index2 - 1 || dots === 1) ; + else if (dots === 2) { + if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") { + if (res.length > 2) { + const lastSlashIndex = res.lastIndexOf("/"); + if (lastSlashIndex === -1) { + res = ""; + lastSegmentLength = 0; + } else { + res = res.slice(0, lastSlashIndex); + lastSegmentLength = res.length - 1 - res.lastIndexOf("/"); + } + lastSlash = index2; + dots = 0; + continue; + } else if (res.length > 0) { + res = ""; + lastSegmentLength = 0; + lastSlash = index2; + dots = 0; + continue; + } + } + if (allowAboveRoot) { + res += res.length > 0 ? "/.." : ".."; + lastSegmentLength = 2; + } + } else { + if (res.length > 0) { + res += `/${path3.slice(lastSlash + 1, index2)}`; + } else { + res = path3.slice(lastSlash + 1, index2); + } + lastSegmentLength = index2 - lastSlash - 1; + } + lastSlash = index2; + dots = 0; + } else if (char === "." && dots !== -1) { + ++dots; + } else { + dots = -1; + } + } + return res; + } + var isAbsolute = function(p) { + return _IS_ABSOLUTE_RE.test(p); + }; + var toNamespacedPath = function(p) { + return normalizeWindowsPath(p); + }; + var _EXTNAME_RE = /.(\.[^./]+)$/; + var extname = function(p) { + const match = _EXTNAME_RE.exec(normalizeWindowsPath(p)); + return match && match[1] || ""; + }; + var relative2 = function(from, to) { + const _from = resolve(from).replace(_ROOT_FOLDER_RE, "$1").split("/"); + const _to = resolve(to).replace(_ROOT_FOLDER_RE, "$1").split("/"); + if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0]) { + return _to.join("/"); + } + const _fromCopy = [..._from]; + for (const segment of _fromCopy) { + if (_to[0] !== segment) { + break; + } + _from.shift(); + _to.shift(); + } + return [..._from.map(() => ".."), ..._to].join("/"); + }; + var dirname = function(p) { + const segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1); + if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) { + segments[0] += "/"; + } + return segments.join("/") || (isAbsolute(p) ? "/" : "."); + }; + var format = function(p) { + const segments = [p.root, p.dir, p.base ?? p.name + p.ext].filter(Boolean); + return normalizeWindowsPath( + p.root ? resolve(...segments) : segments.join("/") + ); + }; + var basename = function(p, extension) { + const lastSegment = normalizeWindowsPath(p).split("/").pop(); + return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment; + }; + var parse = function(p) { + const root = normalizeWindowsPath(p).split("/").shift() || "/"; + const base = basename(p); + const extension = extname(base); + return { + root, + dir: dirname(p), + base, + ext: extension, + name: base.slice(0, base.length - extension.length) + }; + }; + var path2 = { + __proto__: null, + basename, + delimiter, + dirname, + extname, + format, + isAbsolute, + join, + normalize, + normalizeString, + parse, + relative: relative2, + resolve, + sep, + toNamespacedPath + }; + exports.basename = basename; + exports.delimiter = delimiter; + exports.dirname = dirname; + exports.extname = extname; + exports.format = format; + exports.isAbsolute = isAbsolute; + exports.join = join; + exports.normalize = normalize; + exports.normalizeString = normalizeString; + exports.normalizeWindowsPath = normalizeWindowsPath; + exports.parse = parse; + exports.path = path2; + exports.relative = relative2; + exports.resolve = resolve; + exports.sep = sep; + exports.toNamespacedPath = toNamespacedPath; + } +}); + +// ../../node_modules/.pnpm/pathe@1.1.2/node_modules/pathe/dist/index.cjs +var require_dist = __commonJS({ + "../../node_modules/.pnpm/pathe@1.1.2/node_modules/pathe/dist/index.cjs"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var index2 = require_pathe_1f0a373c(); + exports.basename = index2.basename; + exports.default = index2.path; + exports.delimiter = index2.delimiter; + exports.dirname = index2.dirname; + exports.extname = index2.extname; + exports.format = index2.format; + exports.isAbsolute = index2.isAbsolute; + exports.join = index2.join; + exports.normalize = index2.normalize; + exports.normalizeString = index2.normalizeString; + exports.parse = index2.parse; + exports.relative = index2.relative; + exports.resolve = index2.resolve; + exports.sep = index2.sep; + exports.toNamespacedPath = index2.toNamespacedPath; + } +}); + +// ../../node_modules/.pnpm/valibot@1.2.0_typescript@5.9.2/node_modules/valibot/dist/index.cjs +var require_dist2 = __commonJS({ + "../../node_modules/.pnpm/valibot@1.2.0_typescript@5.9.2/node_modules/valibot/dist/index.cjs"(exports) { + "use strict"; + var store$4; + function setGlobalConfig(config$1) { + store$4 = { + ...store$4, + ...config$1 + }; + } + // @__NO_SIDE_EFFECTS__ + function getGlobalConfig(config$1) { + return { + lang: config$1?.lang ?? store$4?.lang, + message: config$1?.message, + abortEarly: config$1?.abortEarly ?? store$4?.abortEarly, + abortPipeEarly: config$1?.abortPipeEarly ?? store$4?.abortPipeEarly + }; + } + function deleteGlobalConfig() { + store$4 = void 0; + } + var store$3; + function setGlobalMessage(message$1, lang) { + if (!store$3) store$3 = /* @__PURE__ */ new Map(); + store$3.set(lang, message$1); + } + // @__NO_SIDE_EFFECTS__ + function getGlobalMessage(lang) { + return store$3?.get(lang); + } + function deleteGlobalMessage(lang) { + store$3?.delete(lang); + } + var store$2; + function setSchemaMessage(message$1, lang) { + if (!store$2) store$2 = /* @__PURE__ */ new Map(); + store$2.set(lang, message$1); + } + // @__NO_SIDE_EFFECTS__ + function getSchemaMessage(lang) { + return store$2?.get(lang); + } + function deleteSchemaMessage(lang) { + store$2?.delete(lang); + } + var store$1; + function setSpecificMessage(reference, message$1, lang) { + if (!store$1) store$1 = /* @__PURE__ */ new Map(); + if (!store$1.get(reference)) store$1.set(reference, /* @__PURE__ */ new Map()); + store$1.get(reference).set(lang, message$1); + } + // @__NO_SIDE_EFFECTS__ + function getSpecificMessage(reference, lang) { + return store$1?.get(reference)?.get(lang); + } + function deleteSpecificMessage(reference, lang) { + store$1?.get(reference)?.delete(lang); + } + // @__NO_SIDE_EFFECTS__ + function _stringify(input) { + const type = typeof input; + if (type === "string") return `"${input}"`; + if (type === "number" || type === "bigint" || type === "boolean") return `${input}`; + if (type === "object" || type === "function") return (input && Object.getPrototypeOf(input)?.constructor?.name) ?? "null"; + return type; + } + function _addIssue(context, label, dataset, config$1, other) { + const input = other && "input" in other ? other.input : dataset.value; + const expected = other?.expected ?? context.expects ?? null; + const received = other?.received ?? /* @__PURE__ */ _stringify(input); + const issue = { + kind: context.kind, + type: context.type, + input, + expected, + received, + message: `Invalid ${label}: ${expected ? `Expected ${expected} but r` : "R"}eceived ${received}`, + requirement: context.requirement, + path: other?.path, + issues: other?.issues, + lang: config$1.lang, + abortEarly: config$1.abortEarly, + abortPipeEarly: config$1.abortPipeEarly + }; + const isSchema = context.kind === "schema"; + const message$1 = other?.message ?? context.message ?? /* @__PURE__ */ getSpecificMessage(context.reference, issue.lang) ?? (isSchema ? /* @__PURE__ */ getSchemaMessage(issue.lang) : null) ?? config$1.message ?? /* @__PURE__ */ getGlobalMessage(issue.lang); + if (message$1 !== void 0) issue.message = typeof message$1 === "function" ? message$1(issue) : message$1; + if (isSchema) dataset.typed = false; + if (dataset.issues) dataset.issues.push(issue); + else dataset.issues = [issue]; + } + var textEncoder; + // @__NO_SIDE_EFFECTS__ + function _getByteCount(input) { + if (!textEncoder) textEncoder = new TextEncoder(); + return textEncoder.encode(input).length; + } + var segmenter; + // @__NO_SIDE_EFFECTS__ + function _getGraphemeCount(input) { + if (!segmenter) segmenter = new Intl.Segmenter(); + const segments = segmenter.segment(input); + let count = 0; + for (const _ of segments) count++; + return count; + } + // @__NO_SIDE_EFFECTS__ + function _getLastMetadata(schema, type) { + if ("pipe" in schema) { + const nestedSchemas = []; + for (let index2 = schema.pipe.length - 1; index2 >= 0; index2--) { + const item = schema.pipe[index2]; + if (item.kind === "schema" && "pipe" in item) nestedSchemas.push(item); + else if (item.kind === "metadata" && item.type === type) return item[type]; + } + for (const nestedSchema of nestedSchemas) { + const result = /* @__PURE__ */ _getLastMetadata(nestedSchema, type); + if (result !== void 0) return result; + } + } + } + // @__NO_SIDE_EFFECTS__ + function _getStandardProps(context) { + return { + version: 1, + vendor: "valibot", + validate(value$1) { + return context["~run"]({ value: value$1 }, /* @__PURE__ */ getGlobalConfig()); + } + }; + } + var store; + // @__NO_SIDE_EFFECTS__ + function _getWordCount(locales, input) { + if (!store) store = /* @__PURE__ */ new Map(); + if (!store.get(locales)) store.set(locales, new Intl.Segmenter(locales, { granularity: "word" })); + const segments = store.get(locales).segment(input); + let count = 0; + for (const segment of segments) if (segment.isWordLike) count++; + return count; + } + var NON_DIGIT_REGEX = /\D/gu; + // @__NO_SIDE_EFFECTS__ + function _isLuhnAlgo(input) { + const number$1 = input.replace(NON_DIGIT_REGEX, ""); + let length$1 = number$1.length; + let bit = 1; + let sum = 0; + while (length$1) { + const value$1 = +number$1[--length$1]; + bit ^= 1; + sum += bit ? [ + 0, + 2, + 4, + 6, + 8, + 1, + 3, + 5, + 7, + 9 + ][value$1] : value$1; + } + return sum % 10 === 0; + } + // @__NO_SIDE_EFFECTS__ + function _isValidObjectKey(object$1, key) { + return Object.hasOwn(object$1, key) && key !== "__proto__" && key !== "prototype" && key !== "constructor"; + } + // @__NO_SIDE_EFFECTS__ + function _joinExpects(values$1, separator) { + const list = [...new Set(values$1)]; + if (list.length > 1) return `(${list.join(` ${separator} `)})`; + return list[0] ?? "never"; + } + // @__NO_SIDE_EFFECTS__ + function entriesFromList(list, schema) { + const entries$1 = {}; + for (const key of list) entries$1[key] = schema; + return entries$1; + } + // @__NO_SIDE_EFFECTS__ + function entriesFromObjects(schemas) { + const entries$1 = {}; + for (const schema of schemas) Object.assign(entries$1, schema.entries); + return entries$1; + } + // @__NO_SIDE_EFFECTS__ + function getDotPath(issue) { + if (issue.path) { + let key = ""; + for (const item of issue.path) if (typeof item.key === "string" || typeof item.key === "number") if (key) key += `.${item.key}`; + else key += item.key; + else return null; + return key; + } + return null; + } + // @__NO_SIDE_EFFECTS__ + function isOfKind(kind, object$1) { + return object$1.kind === kind; + } + // @__NO_SIDE_EFFECTS__ + function isOfType(type, object$1) { + return object$1.type === type; + } + // @__NO_SIDE_EFFECTS__ + function isValiError(error) { + return error instanceof ValiError; + } + var ValiError = class extends Error { + /** + * Creates a Valibot error with useful information. + * + * @param issues The error issues. + */ + constructor(issues) { + super(issues[0].message); + this.name = "ValiError"; + this.issues = issues; + } + }; + // @__NO_SIDE_EFFECTS__ + function args(schema) { + return { + kind: "transformation", + type: "args", + reference: args, + async: false, + schema, + "~run"(dataset, config$1) { + const func = dataset.value; + dataset.value = (...args_) => { + const argsDataset = this.schema["~run"]({ value: args_ }, config$1); + if (argsDataset.issues) throw new ValiError(argsDataset.issues); + return func(...argsDataset.value); + }; + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function argsAsync(schema) { + return { + kind: "transformation", + type: "args", + reference: argsAsync, + async: false, + schema, + "~run"(dataset, config$1) { + const func = dataset.value; + dataset.value = async (...args$1) => { + const argsDataset = await schema["~run"]({ value: args$1 }, config$1); + if (argsDataset.issues) throw new ValiError(argsDataset.issues); + return func(...argsDataset.value); + }; + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function awaitAsync() { + return { + kind: "transformation", + type: "await", + reference: awaitAsync, + async: true, + async "~run"(dataset) { + dataset.value = await dataset.value; + return dataset; + } + }; + } + var BASE64_REGEX = /^(?:[\da-z+/]{4})*(?:[\da-z+/]{2}==|[\da-z+/]{3}=)?$/iu; + var BIC_REGEX = /^[A-Z]{6}(?!00)[\dA-Z]{2}(?:[\dA-Z]{3})?$/u; + var CUID2_REGEX = /^[a-z][\da-z]*$/u; + var DECIMAL_REGEX = /^[+-]?(?:\d*\.)?\d+$/u; + var DIGITS_REGEX = /^\d+$/u; + var EMAIL_REGEX = /^[\w+-]+(?:\.[\w+-]+)*@[\da-z]+(?:[.-][\da-z]+)*\.[a-z]{2,}$/iu; + var EMOJI_REGEX = /^(?:[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|(?![\p{Emoji_Modifier_Base}\u{1F1E6}-\u{1F1FF}])\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|(?![\p{Emoji_Modifier_Base}\u{1F1E6}-\u{1F1FF}])\p{Emoji_Presentation}))*)+$/u; + var HEXADECIMAL_REGEX = /^(?:0[hx])?[\da-fA-F]+$/u; + var HEX_COLOR_REGEX = /^#(?:[\da-fA-F]{3,4}|[\da-fA-F]{6}|[\da-fA-F]{8})$/u; + var IMEI_REGEX = /^\d{15}$|^\d{2}-\d{6}-\d{6}-\d$/u; + var IPV4_REGEX = /^(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])(?:\.(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])){3}$/u; + var IPV6_REGEX = /^(?:(?:[\da-f]{1,4}:){7}[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,7}:|(?:[\da-f]{1,4}:){1,6}:[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,5}(?::[\da-f]{1,4}){1,2}|(?:[\da-f]{1,4}:){1,4}(?::[\da-f]{1,4}){1,3}|(?:[\da-f]{1,4}:){1,3}(?::[\da-f]{1,4}){1,4}|(?:[\da-f]{1,4}:){1,2}(?::[\da-f]{1,4}){1,5}|[\da-f]{1,4}:(?::[\da-f]{1,4}){1,6}|:(?:(?::[\da-f]{1,4}){1,7}|:)|fe80:(?::[\da-f]{0,4}){0,4}%[\da-z]+|::(?:f{4}(?::0{1,4})?:)?(?:(?:25[0-5]|(?:2[0-4]|1?\d)?\d)\.){3}(?:25[0-5]|(?:2[0-4]|1?\d)?\d)|(?:[\da-f]{1,4}:){1,4}:(?:(?:25[0-5]|(?:2[0-4]|1?\d)?\d)\.){3}(?:25[0-5]|(?:2[0-4]|1?\d)?\d))$/iu; + var IP_REGEX = /^(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])(?:\.(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])){3}$|^(?:(?:[\da-f]{1,4}:){7}[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,7}:|(?:[\da-f]{1,4}:){1,6}:[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,5}(?::[\da-f]{1,4}){1,2}|(?:[\da-f]{1,4}:){1,4}(?::[\da-f]{1,4}){1,3}|(?:[\da-f]{1,4}:){1,3}(?::[\da-f]{1,4}){1,4}|(?:[\da-f]{1,4}:){1,2}(?::[\da-f]{1,4}){1,5}|[\da-f]{1,4}:(?::[\da-f]{1,4}){1,6}|:(?:(?::[\da-f]{1,4}){1,7}|:)|fe80:(?::[\da-f]{0,4}){0,4}%[\da-z]+|::(?:f{4}(?::0{1,4})?:)?(?:(?:25[0-5]|(?:2[0-4]|1?\d)?\d)\.){3}(?:25[0-5]|(?:2[0-4]|1?\d)?\d)|(?:[\da-f]{1,4}:){1,4}:(?:(?:25[0-5]|(?:2[0-4]|1?\d)?\d)\.){3}(?:25[0-5]|(?:2[0-4]|1?\d)?\d))$/iu; + var ISO_DATE_REGEX = /^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])$/u; + var ISO_DATE_TIME_REGEX = /^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])[T ](?:0\d|1\d|2[0-3]):[0-5]\d$/u; + var ISO_TIME_REGEX = /^(?:0\d|1\d|2[0-3]):[0-5]\d$/u; + var ISO_TIME_SECOND_REGEX = /^(?:0\d|1\d|2[0-3])(?::[0-5]\d){2}$/u; + var ISO_TIMESTAMP_REGEX = /^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])[T ](?:0\d|1\d|2[0-3])(?::[0-5]\d){2}(?:\.\d{1,9})?(?:Z|[+-](?:0\d|1\d|2[0-3])(?::?[0-5]\d)?)$/u; + var ISO_WEEK_REGEX = /^\d{4}-W(?:0[1-9]|[1-4]\d|5[0-3])$/u; + var MAC48_REGEX = /^(?:[\da-f]{2}:){5}[\da-f]{2}$|^(?:[\da-f]{2}-){5}[\da-f]{2}$|^(?:[\da-f]{4}\.){2}[\da-f]{4}$/iu; + var MAC64_REGEX = /^(?:[\da-f]{2}:){7}[\da-f]{2}$|^(?:[\da-f]{2}-){7}[\da-f]{2}$|^(?:[\da-f]{4}\.){3}[\da-f]{4}$|^(?:[\da-f]{4}:){3}[\da-f]{4}$/iu; + var MAC_REGEX = /^(?:[\da-f]{2}:){5}[\da-f]{2}$|^(?:[\da-f]{2}-){5}[\da-f]{2}$|^(?:[\da-f]{4}\.){2}[\da-f]{4}$|^(?:[\da-f]{2}:){7}[\da-f]{2}$|^(?:[\da-f]{2}-){7}[\da-f]{2}$|^(?:[\da-f]{4}\.){3}[\da-f]{4}$|^(?:[\da-f]{4}:){3}[\da-f]{4}$/iu; + var NANO_ID_REGEX = /^[\w-]+$/u; + var OCTAL_REGEX = /^(?:0o)?[0-7]+$/u; + var RFC_EMAIL_REGEX = /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/; + var SLUG_REGEX = /^[\da-z]+(?:[-_][\da-z]+)*$/u; + var ULID_REGEX = /^[\da-hjkmnp-tv-zA-HJKMNP-TV-Z]{26}$/u; + var UUID_REGEX = /^[\da-f]{8}(?:-[\da-f]{4}){3}-[\da-f]{12}$/iu; + // @__NO_SIDE_EFFECTS__ + function base64(message$1) { + return { + kind: "validation", + type: "base64", + reference: base64, + async: false, + expects: null, + requirement: BASE64_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "Base64", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function bic(message$1) { + return { + kind: "validation", + type: "bic", + reference: bic, + async: false, + expects: null, + requirement: BIC_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "BIC", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function brand(name) { + return { + kind: "transformation", + type: "brand", + reference: brand, + async: false, + name, + "~run"(dataset) { + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function bytes(requirement, message$1) { + return { + kind: "validation", + type: "bytes", + reference: bytes, + async: false, + expects: `${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const length$1 = /* @__PURE__ */ _getByteCount(dataset.value); + if (length$1 !== this.requirement) _addIssue(this, "bytes", dataset, config$1, { received: `${length$1}` }); + } + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function check(requirement, message$1) { + return { + kind: "validation", + type: "check", + reference: check, + async: false, + expects: null, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "input", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function checkAsync(requirement, message$1) { + return { + kind: "validation", + type: "check", + reference: checkAsync, + async: true, + expects: null, + requirement, + message: message$1, + async "~run"(dataset, config$1) { + if (dataset.typed && !await this.requirement(dataset.value)) _addIssue(this, "input", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function checkItems(requirement, message$1) { + return { + kind: "validation", + type: "check_items", + reference: checkItems, + async: false, + expects: null, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) for (let index2 = 0; index2 < dataset.value.length; index2++) { + const item = dataset.value[index2]; + if (!this.requirement(item, index2, dataset.value)) _addIssue(this, "item", dataset, config$1, { + input: item, + path: [{ + type: "array", + origin: "value", + input: dataset.value, + key: index2, + value: item + }] + }); + } + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function checkItemsAsync(requirement, message$1) { + return { + kind: "validation", + type: "check_items", + reference: checkItemsAsync, + async: true, + expects: null, + requirement, + message: message$1, + async "~run"(dataset, config$1) { + if (dataset.typed) { + const requirementResults = await Promise.all(dataset.value.map(this.requirement)); + for (let index2 = 0; index2 < dataset.value.length; index2++) if (!requirementResults[index2]) { + const item = dataset.value[index2]; + _addIssue(this, "item", dataset, config$1, { + input: item, + path: [{ + type: "array", + origin: "value", + input: dataset.value, + key: index2, + value: item + }] + }); + } + } + return dataset; + } + }; + } + var CREDIT_CARD_REGEX = /^(?:\d{14,19}|\d{4}(?: \d{3,6}){2,4}|\d{4}(?:-\d{3,6}){2,4})$/u; + var SANITIZE_REGEX = /[- ]/gu; + var PROVIDER_REGEX_LIST = [ + /^3[47]\d{13}$/u, + /^3(?:0[0-5]|[68]\d)\d{11,13}$/u, + /^6(?:011|5\d{2})\d{12,15}$/u, + /^(?:2131|1800|35\d{3})\d{11}$/u, + /^5[1-5]\d{2}|(?:222\d|22[3-9]\d|2[3-6]\d{2}|27[01]\d|2720)\d{12}$/u, + /^(?:6[27]\d{14,17}|81\d{14,17})$/u, + /^4\d{12}(?:\d{3,6})?$/u + ]; + // @__NO_SIDE_EFFECTS__ + function creditCard(message$1) { + return { + kind: "validation", + type: "credit_card", + reference: creditCard, + async: false, + expects: null, + requirement(input) { + let sanitized; + return CREDIT_CARD_REGEX.test(input) && (sanitized = input.replace(SANITIZE_REGEX, "")) && PROVIDER_REGEX_LIST.some((regex$1) => regex$1.test(sanitized)) && /* @__PURE__ */ _isLuhnAlgo(sanitized); + }, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "credit card", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function cuid2(message$1) { + return { + kind: "validation", + type: "cuid2", + reference: cuid2, + async: false, + expects: null, + requirement: CUID2_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "Cuid2", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function decimal(message$1) { + return { + kind: "validation", + type: "decimal", + reference: decimal, + async: false, + expects: null, + requirement: DECIMAL_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "decimal", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function description(description_) { + return { + kind: "metadata", + type: "description", + reference: description, + description: description_ + }; + } + // @__NO_SIDE_EFFECTS__ + function digits(message$1) { + return { + kind: "validation", + type: "digits", + reference: digits, + async: false, + expects: null, + requirement: DIGITS_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "digits", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function email(message$1) { + return { + kind: "validation", + type: "email", + reference: email, + expects: null, + async: false, + requirement: EMAIL_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "email", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function emoji(message$1) { + return { + kind: "validation", + type: "emoji", + reference: emoji, + async: false, + expects: null, + requirement: EMOJI_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "emoji", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function empty(message$1) { + return { + kind: "validation", + type: "empty", + reference: empty, + async: false, + expects: "0", + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value.length > 0) _addIssue(this, "length", dataset, config$1, { received: `${dataset.value.length}` }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function endsWith(requirement, message$1) { + return { + kind: "validation", + type: "ends_with", + reference: endsWith, + async: false, + expects: `"${requirement}"`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !dataset.value.endsWith(this.requirement)) _addIssue(this, "end", dataset, config$1, { received: `"${dataset.value.slice(-this.requirement.length)}"` }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function entries(requirement, message$1) { + return { + kind: "validation", + type: "entries", + reference: entries, + async: false, + expects: `${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (!dataset.typed) return dataset; + const count = Object.keys(dataset.value).length; + if (dataset.typed && count !== this.requirement) _addIssue(this, "entries", dataset, config$1, { received: `${count}` }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function everyItem(requirement, message$1) { + return { + kind: "validation", + type: "every_item", + reference: everyItem, + async: false, + expects: null, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !dataset.value.every(this.requirement)) _addIssue(this, "item", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function examples(examples_) { + return { + kind: "metadata", + type: "examples", + reference: examples, + examples: examples_ + }; + } + // @__NO_SIDE_EFFECTS__ + function excludes(requirement, message$1) { + const received = /* @__PURE__ */ _stringify(requirement); + return { + kind: "validation", + type: "excludes", + reference: excludes, + async: false, + expects: `!${received}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value.includes(this.requirement)) _addIssue(this, "content", dataset, config$1, { received }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function filterItems(operation) { + return { + kind: "transformation", + type: "filter_items", + reference: filterItems, + async: false, + operation, + "~run"(dataset) { + dataset.value = dataset.value.filter(this.operation); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function findItem(operation) { + return { + kind: "transformation", + type: "find_item", + reference: findItem, + async: false, + operation, + "~run"(dataset) { + dataset.value = dataset.value.find(this.operation); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function finite(message$1) { + return { + kind: "validation", + type: "finite", + reference: finite, + async: false, + expects: null, + requirement: Number.isFinite, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "finite", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function flavor(name) { + return { + kind: "transformation", + type: "flavor", + reference: flavor, + async: false, + name, + "~run"(dataset) { + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function graphemes(requirement, message$1) { + return { + kind: "validation", + type: "graphemes", + reference: graphemes, + async: false, + expects: `${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const count = /* @__PURE__ */ _getGraphemeCount(dataset.value); + if (count !== this.requirement) _addIssue(this, "graphemes", dataset, config$1, { received: `${count}` }); + } + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function gtValue(requirement, message$1) { + return { + kind: "validation", + type: "gt_value", + reference: gtValue, + async: false, + expects: `>${requirement instanceof Date ? requirement.toJSON() : /* @__PURE__ */ _stringify(requirement)}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !(dataset.value > this.requirement)) _addIssue(this, "value", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) }); + return dataset; + } + }; + } + var HASH_LENGTHS = { + md4: 32, + md5: 32, + sha1: 40, + sha256: 64, + sha384: 96, + sha512: 128, + ripemd128: 32, + ripemd160: 40, + tiger128: 32, + tiger160: 40, + tiger192: 48, + crc32: 8, + crc32b: 8, + adler32: 8 + }; + // @__NO_SIDE_EFFECTS__ + function hash(types, message$1) { + return { + kind: "validation", + type: "hash", + reference: hash, + expects: null, + async: false, + requirement: RegExp(types.map((type) => `^[a-f0-9]{${HASH_LENGTHS[type]}}$`).join("|"), "iu"), + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "hash", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function hexadecimal(message$1) { + return { + kind: "validation", + type: "hexadecimal", + reference: hexadecimal, + async: false, + expects: null, + requirement: HEXADECIMAL_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "hexadecimal", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function hexColor(message$1) { + return { + kind: "validation", + type: "hex_color", + reference: hexColor, + async: false, + expects: null, + requirement: HEX_COLOR_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "hex color", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function imei(message$1) { + return { + kind: "validation", + type: "imei", + reference: imei, + async: false, + expects: null, + requirement(input) { + return IMEI_REGEX.test(input) && /* @__PURE__ */ _isLuhnAlgo(input); + }, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "IMEI", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function includes(requirement, message$1) { + const expects = /* @__PURE__ */ _stringify(requirement); + return { + kind: "validation", + type: "includes", + reference: includes, + async: false, + expects, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !dataset.value.includes(this.requirement)) _addIssue(this, "content", dataset, config$1, { received: `!${expects}` }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function integer(message$1) { + return { + kind: "validation", + type: "integer", + reference: integer, + async: false, + expects: null, + requirement: Number.isInteger, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "integer", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function ip(message$1) { + return { + kind: "validation", + type: "ip", + reference: ip, + async: false, + expects: null, + requirement: IP_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "IP", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function ipv4(message$1) { + return { + kind: "validation", + type: "ipv4", + reference: ipv4, + async: false, + expects: null, + requirement: IPV4_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "IPv4", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function ipv6(message$1) { + return { + kind: "validation", + type: "ipv6", + reference: ipv6, + async: false, + expects: null, + requirement: IPV6_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "IPv6", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function isoDate(message$1) { + return { + kind: "validation", + type: "iso_date", + reference: isoDate, + async: false, + expects: null, + requirement: ISO_DATE_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "date", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function isoDateTime(message$1) { + return { + kind: "validation", + type: "iso_date_time", + reference: isoDateTime, + async: false, + expects: null, + requirement: ISO_DATE_TIME_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "date-time", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function isoTime(message$1) { + return { + kind: "validation", + type: "iso_time", + reference: isoTime, + async: false, + expects: null, + requirement: ISO_TIME_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "time", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function isoTimeSecond(message$1) { + return { + kind: "validation", + type: "iso_time_second", + reference: isoTimeSecond, + async: false, + expects: null, + requirement: ISO_TIME_SECOND_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "time-second", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function isoTimestamp(message$1) { + return { + kind: "validation", + type: "iso_timestamp", + reference: isoTimestamp, + async: false, + expects: null, + requirement: ISO_TIMESTAMP_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "timestamp", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function isoWeek(message$1) { + return { + kind: "validation", + type: "iso_week", + reference: isoWeek, + async: false, + expects: null, + requirement: ISO_WEEK_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "week", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function length(requirement, message$1) { + return { + kind: "validation", + type: "length", + reference: length, + async: false, + expects: `${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value.length !== this.requirement) _addIssue(this, "length", dataset, config$1, { received: `${dataset.value.length}` }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function ltValue(requirement, message$1) { + return { + kind: "validation", + type: "lt_value", + reference: ltValue, + async: false, + expects: `<${requirement instanceof Date ? requirement.toJSON() : /* @__PURE__ */ _stringify(requirement)}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !(dataset.value < this.requirement)) _addIssue(this, "value", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function mac(message$1) { + return { + kind: "validation", + type: "mac", + reference: mac, + async: false, + expects: null, + requirement: MAC_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "MAC", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function mac48(message$1) { + return { + kind: "validation", + type: "mac48", + reference: mac48, + async: false, + expects: null, + requirement: MAC48_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "48-bit MAC", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function mac64(message$1) { + return { + kind: "validation", + type: "mac64", + reference: mac64, + async: false, + expects: null, + requirement: MAC64_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "64-bit MAC", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function mapItems(operation) { + return { + kind: "transformation", + type: "map_items", + reference: mapItems, + async: false, + operation, + "~run"(dataset) { + dataset.value = dataset.value.map(this.operation); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function maxBytes(requirement, message$1) { + return { + kind: "validation", + type: "max_bytes", + reference: maxBytes, + async: false, + expects: `<=${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const length$1 = /* @__PURE__ */ _getByteCount(dataset.value); + if (length$1 > this.requirement) _addIssue(this, "bytes", dataset, config$1, { received: `${length$1}` }); + } + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function maxEntries(requirement, message$1) { + return { + kind: "validation", + type: "max_entries", + reference: maxEntries, + async: false, + expects: `<=${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (!dataset.typed) return dataset; + const count = Object.keys(dataset.value).length; + if (dataset.typed && count > this.requirement) _addIssue(this, "entries", dataset, config$1, { received: `${count}` }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function maxGraphemes(requirement, message$1) { + return { + kind: "validation", + type: "max_graphemes", + reference: maxGraphemes, + async: false, + expects: `<=${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const count = /* @__PURE__ */ _getGraphemeCount(dataset.value); + if (count > this.requirement) _addIssue(this, "graphemes", dataset, config$1, { received: `${count}` }); + } + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function maxLength(requirement, message$1) { + return { + kind: "validation", + type: "max_length", + reference: maxLength, + async: false, + expects: `<=${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value.length > this.requirement) _addIssue(this, "length", dataset, config$1, { received: `${dataset.value.length}` }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function maxSize(requirement, message$1) { + return { + kind: "validation", + type: "max_size", + reference: maxSize, + async: false, + expects: `<=${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value.size > this.requirement) _addIssue(this, "size", dataset, config$1, { received: `${dataset.value.size}` }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function maxValue(requirement, message$1) { + return { + kind: "validation", + type: "max_value", + reference: maxValue, + async: false, + expects: `<=${requirement instanceof Date ? requirement.toJSON() : /* @__PURE__ */ _stringify(requirement)}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !(dataset.value <= this.requirement)) _addIssue(this, "value", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function maxWords(locales, requirement, message$1) { + return { + kind: "validation", + type: "max_words", + reference: maxWords, + async: false, + expects: `<=${requirement}`, + locales, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const count = /* @__PURE__ */ _getWordCount(this.locales, dataset.value); + if (count > this.requirement) _addIssue(this, "words", dataset, config$1, { received: `${count}` }); + } + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function metadata(metadata_) { + return { + kind: "metadata", + type: "metadata", + reference: metadata, + metadata: metadata_ + }; + } + // @__NO_SIDE_EFFECTS__ + function mimeType(requirement, message$1) { + return { + kind: "validation", + type: "mime_type", + reference: mimeType, + async: false, + expects: /* @__PURE__ */ _joinExpects(requirement.map((option) => `"${option}"`), "|"), + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.includes(dataset.value.type)) _addIssue(this, "MIME type", dataset, config$1, { received: `"${dataset.value.type}"` }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function minBytes(requirement, message$1) { + return { + kind: "validation", + type: "min_bytes", + reference: minBytes, + async: false, + expects: `>=${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const length$1 = /* @__PURE__ */ _getByteCount(dataset.value); + if (length$1 < this.requirement) _addIssue(this, "bytes", dataset, config$1, { received: `${length$1}` }); + } + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function minEntries(requirement, message$1) { + return { + kind: "validation", + type: "min_entries", + reference: minEntries, + async: false, + expects: `>=${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (!dataset.typed) return dataset; + const count = Object.keys(dataset.value).length; + if (dataset.typed && count < this.requirement) _addIssue(this, "entries", dataset, config$1, { received: `${count}` }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function minGraphemes(requirement, message$1) { + return { + kind: "validation", + type: "min_graphemes", + reference: minGraphemes, + async: false, + expects: `>=${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const count = /* @__PURE__ */ _getGraphemeCount(dataset.value); + if (count < this.requirement) _addIssue(this, "graphemes", dataset, config$1, { received: `${count}` }); + } + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function minLength(requirement, message$1) { + return { + kind: "validation", + type: "min_length", + reference: minLength, + async: false, + expects: `>=${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value.length < this.requirement) _addIssue(this, "length", dataset, config$1, { received: `${dataset.value.length}` }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function minSize(requirement, message$1) { + return { + kind: "validation", + type: "min_size", + reference: minSize, + async: false, + expects: `>=${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value.size < this.requirement) _addIssue(this, "size", dataset, config$1, { received: `${dataset.value.size}` }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function minValue(requirement, message$1) { + return { + kind: "validation", + type: "min_value", + reference: minValue, + async: false, + expects: `>=${requirement instanceof Date ? requirement.toJSON() : /* @__PURE__ */ _stringify(requirement)}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !(dataset.value >= this.requirement)) _addIssue(this, "value", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function minWords(locales, requirement, message$1) { + return { + kind: "validation", + type: "min_words", + reference: minWords, + async: false, + expects: `>=${requirement}`, + locales, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const count = /* @__PURE__ */ _getWordCount(this.locales, dataset.value); + if (count < this.requirement) _addIssue(this, "words", dataset, config$1, { received: `${count}` }); + } + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function multipleOf(requirement, message$1) { + return { + kind: "validation", + type: "multiple_of", + reference: multipleOf, + async: false, + expects: `%${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value % this.requirement != 0) _addIssue(this, "multiple", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function nanoid(message$1) { + return { + kind: "validation", + type: "nanoid", + reference: nanoid, + async: false, + expects: null, + requirement: NANO_ID_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "Nano ID", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function nonEmpty(message$1) { + return { + kind: "validation", + type: "non_empty", + reference: nonEmpty, + async: false, + expects: "!0", + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value.length === 0) _addIssue(this, "length", dataset, config$1, { received: "0" }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function normalize(form) { + return { + kind: "transformation", + type: "normalize", + reference: normalize, + async: false, + form, + "~run"(dataset) { + dataset.value = dataset.value.normalize(this.form); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function notBytes(requirement, message$1) { + return { + kind: "validation", + type: "not_bytes", + reference: notBytes, + async: false, + expects: `!${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const length$1 = /* @__PURE__ */ _getByteCount(dataset.value); + if (length$1 === this.requirement) _addIssue(this, "bytes", dataset, config$1, { received: `${length$1}` }); + } + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function notEntries(requirement, message$1) { + return { + kind: "validation", + type: "not_entries", + reference: notEntries, + async: false, + expects: `!${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (!dataset.typed) return dataset; + const count = Object.keys(dataset.value).length; + if (dataset.typed && count === this.requirement) _addIssue(this, "entries", dataset, config$1, { received: `${count}` }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function notGraphemes(requirement, message$1) { + return { + kind: "validation", + type: "not_graphemes", + reference: notGraphemes, + async: false, + expects: `!${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const count = /* @__PURE__ */ _getGraphemeCount(dataset.value); + if (count === this.requirement) _addIssue(this, "graphemes", dataset, config$1, { received: `${count}` }); + } + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function notLength(requirement, message$1) { + return { + kind: "validation", + type: "not_length", + reference: notLength, + async: false, + expects: `!${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value.length === this.requirement) _addIssue(this, "length", dataset, config$1, { received: `${dataset.value.length}` }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function notSize(requirement, message$1) { + return { + kind: "validation", + type: "not_size", + reference: notSize, + async: false, + expects: `!${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value.size === this.requirement) _addIssue(this, "size", dataset, config$1, { received: `${dataset.value.size}` }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function notValue(requirement, message$1) { + return { + kind: "validation", + type: "not_value", + reference: notValue, + async: false, + expects: requirement instanceof Date ? `!${requirement.toJSON()}` : `!${/* @__PURE__ */ _stringify(requirement)}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && this.requirement <= dataset.value && this.requirement >= dataset.value) _addIssue(this, "value", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function notValues(requirement, message$1) { + return { + kind: "validation", + type: "not_values", + reference: notValues, + async: false, + expects: `!${/* @__PURE__ */ _joinExpects(requirement.map((value$1) => value$1 instanceof Date ? value$1.toJSON() : /* @__PURE__ */ _stringify(value$1)), "|")}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && this.requirement.some((value$1) => value$1 <= dataset.value && value$1 >= dataset.value)) _addIssue(this, "value", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function notWords(locales, requirement, message$1) { + return { + kind: "validation", + type: "not_words", + reference: notWords, + async: false, + expects: `!${requirement}`, + locales, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const count = /* @__PURE__ */ _getWordCount(this.locales, dataset.value); + if (count === this.requirement) _addIssue(this, "words", dataset, config$1, { received: `${count}` }); + } + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function octal(message$1) { + return { + kind: "validation", + type: "octal", + reference: octal, + async: false, + expects: null, + requirement: OCTAL_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "octal", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function parseJson(config$1, message$1) { + return { + kind: "transformation", + type: "parse_json", + reference: parseJson, + config: config$1, + message: message$1, + async: false, + "~run"(dataset, config$2) { + try { + dataset.value = JSON.parse(dataset.value, this.config?.reviver); + } catch (error) { + if (error instanceof Error) { + _addIssue(this, "JSON", dataset, config$2, { received: `"${error.message}"` }); + dataset.typed = false; + } else throw error; + } + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function _isPartiallyTyped(dataset, paths) { + if (dataset.issues) for (const path2 of paths) for (const issue of dataset.issues) { + let typed = false; + const bound = Math.min(path2.length, issue.path?.length ?? 0); + for (let index2 = 0; index2 < bound; index2++) if (path2[index2] !== issue.path[index2].key && (path2[index2] !== "$" || issue.path[index2].type !== "array")) { + typed = true; + break; + } + if (!typed) return false; + } + return true; + } + // @__NO_SIDE_EFFECTS__ + function partialCheck(paths, requirement, message$1) { + return { + kind: "validation", + type: "partial_check", + reference: partialCheck, + async: false, + expects: null, + paths, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if ((dataset.typed || /* @__PURE__ */ _isPartiallyTyped(dataset, paths)) && !this.requirement(dataset.value)) _addIssue(this, "input", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function partialCheckAsync(paths, requirement, message$1) { + return { + kind: "validation", + type: "partial_check", + reference: partialCheckAsync, + async: true, + expects: null, + paths, + requirement, + message: message$1, + async "~run"(dataset, config$1) { + if ((dataset.typed || /* @__PURE__ */ _isPartiallyTyped(dataset, paths)) && !await this.requirement(dataset.value)) _addIssue(this, "input", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function rawCheck(action) { + return { + kind: "validation", + type: "raw_check", + reference: rawCheck, + async: false, + expects: null, + "~run"(dataset, config$1) { + action({ + dataset, + config: config$1, + addIssue: (info) => _addIssue(this, info?.label ?? "input", dataset, config$1, info) + }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function rawCheckAsync(action) { + return { + kind: "validation", + type: "raw_check", + reference: rawCheckAsync, + async: true, + expects: null, + async "~run"(dataset, config$1) { + await action({ + dataset, + config: config$1, + addIssue: (info) => _addIssue(this, info?.label ?? "input", dataset, config$1, info) + }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function rawTransform(action) { + return { + kind: "transformation", + type: "raw_transform", + reference: rawTransform, + async: false, + "~run"(dataset, config$1) { + const output = action({ + dataset, + config: config$1, + addIssue: (info) => _addIssue(this, info?.label ?? "input", dataset, config$1, info), + NEVER: null + }); + if (dataset.issues) dataset.typed = false; + else dataset.value = output; + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function rawTransformAsync(action) { + return { + kind: "transformation", + type: "raw_transform", + reference: rawTransformAsync, + async: true, + async "~run"(dataset, config$1) { + const output = await action({ + dataset, + config: config$1, + addIssue: (info) => _addIssue(this, info?.label ?? "input", dataset, config$1, info), + NEVER: null + }); + if (dataset.issues) dataset.typed = false; + else dataset.value = output; + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function readonly() { + return { + kind: "transformation", + type: "readonly", + reference: readonly, + async: false, + "~run"(dataset) { + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function reduceItems(operation, initial) { + return { + kind: "transformation", + type: "reduce_items", + reference: reduceItems, + async: false, + operation, + initial, + "~run"(dataset) { + dataset.value = dataset.value.reduce(this.operation, this.initial); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function regex(requirement, message$1) { + return { + kind: "validation", + type: "regex", + reference: regex, + async: false, + expects: `${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "format", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function returns(schema) { + return { + kind: "transformation", + type: "returns", + reference: returns, + async: false, + schema, + "~run"(dataset, config$1) { + const func = dataset.value; + dataset.value = (...args_) => { + const returnsDataset = this.schema["~run"]({ value: func(...args_) }, config$1); + if (returnsDataset.issues) throw new ValiError(returnsDataset.issues); + return returnsDataset.value; + }; + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function returnsAsync(schema) { + return { + kind: "transformation", + type: "returns", + reference: returnsAsync, + async: false, + schema, + "~run"(dataset, config$1) { + const func = dataset.value; + dataset.value = async (...args_) => { + const returnsDataset = await this.schema["~run"]({ value: await func(...args_) }, config$1); + if (returnsDataset.issues) throw new ValiError(returnsDataset.issues); + return returnsDataset.value; + }; + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function rfcEmail(message$1) { + return { + kind: "validation", + type: "rfc_email", + reference: rfcEmail, + expects: null, + async: false, + requirement: RFC_EMAIL_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "email", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function safeInteger(message$1) { + return { + kind: "validation", + type: "safe_integer", + reference: safeInteger, + async: false, + expects: null, + requirement: Number.isSafeInteger, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "safe integer", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function size(requirement, message$1) { + return { + kind: "validation", + type: "size", + reference: size, + async: false, + expects: `${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value.size !== this.requirement) _addIssue(this, "size", dataset, config$1, { received: `${dataset.value.size}` }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function slug(message$1) { + return { + kind: "validation", + type: "slug", + reference: slug, + async: false, + expects: null, + requirement: SLUG_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "slug", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function someItem(requirement, message$1) { + return { + kind: "validation", + type: "some_item", + reference: someItem, + async: false, + expects: null, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !dataset.value.some(this.requirement)) _addIssue(this, "item", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function sortItems(operation) { + return { + kind: "transformation", + type: "sort_items", + reference: sortItems, + async: false, + operation, + "~run"(dataset) { + dataset.value = dataset.value.sort(this.operation); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function startsWith(requirement, message$1) { + return { + kind: "validation", + type: "starts_with", + reference: startsWith, + async: false, + expects: `"${requirement}"`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !dataset.value.startsWith(this.requirement)) _addIssue(this, "start", dataset, config$1, { received: `"${dataset.value.slice(0, this.requirement.length)}"` }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function stringifyJson(config$1, message$1) { + return { + kind: "transformation", + type: "stringify_json", + reference: stringifyJson, + message: message$1, + config: config$1, + async: false, + "~run"(dataset, config$2) { + try { + const output = JSON.stringify(dataset.value, this.config?.replacer, this.config?.space); + if (output === void 0) { + _addIssue(this, "JSON", dataset, config$2); + dataset.typed = false; + } + dataset.value = output; + } catch (error) { + if (error instanceof Error) { + _addIssue(this, "JSON", dataset, config$2, { received: `"${error.message}"` }); + dataset.typed = false; + } else throw error; + } + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function title(title_) { + return { + kind: "metadata", + type: "title", + reference: title, + title: title_ + }; + } + // @__NO_SIDE_EFFECTS__ + function toBigint(message$1) { + return { + kind: "transformation", + type: "to_bigint", + reference: toBigint, + async: false, + message: message$1, + "~run"(dataset, config$1) { + try { + dataset.value = BigInt(dataset.value); + } catch { + _addIssue(this, "bigint", dataset, config$1); + dataset.typed = false; + } + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function toBoolean() { + return { + kind: "transformation", + type: "to_boolean", + reference: toBoolean, + async: false, + "~run"(dataset) { + dataset.value = Boolean(dataset.value); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function toDate(message$1) { + return { + kind: "transformation", + type: "to_date", + reference: toDate, + async: false, + message: message$1, + "~run"(dataset, config$1) { + try { + dataset.value = new Date(dataset.value); + if (isNaN(dataset.value)) { + _addIssue(this, "date", dataset, config$1, { received: '"Invalid Date"' }); + dataset.typed = false; + } + } catch { + _addIssue(this, "date", dataset, config$1); + dataset.typed = false; + } + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function toLowerCase() { + return { + kind: "transformation", + type: "to_lower_case", + reference: toLowerCase, + async: false, + "~run"(dataset) { + dataset.value = dataset.value.toLowerCase(); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function toMaxValue(requirement) { + return { + kind: "transformation", + type: "to_max_value", + reference: toMaxValue, + async: false, + requirement, + "~run"(dataset) { + dataset.value = dataset.value > this.requirement ? this.requirement : dataset.value; + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function toMinValue(requirement) { + return { + kind: "transformation", + type: "to_min_value", + reference: toMinValue, + async: false, + requirement, + "~run"(dataset) { + dataset.value = dataset.value < this.requirement ? this.requirement : dataset.value; + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function toNumber(message$1) { + return { + kind: "transformation", + type: "to_number", + reference: toNumber, + async: false, + message: message$1, + "~run"(dataset, config$1) { + try { + dataset.value = Number(dataset.value); + if (isNaN(dataset.value)) { + _addIssue(this, "number", dataset, config$1); + dataset.typed = false; + } + } catch { + _addIssue(this, "number", dataset, config$1); + dataset.typed = false; + } + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function toString(message$1) { + return { + kind: "transformation", + type: "to_string", + reference: toString, + async: false, + message: message$1, + "~run"(dataset, config$1) { + try { + dataset.value = String(dataset.value); + } catch { + _addIssue(this, "string", dataset, config$1); + dataset.typed = false; + } + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function toUpperCase() { + return { + kind: "transformation", + type: "to_upper_case", + reference: toUpperCase, + async: false, + "~run"(dataset) { + dataset.value = dataset.value.toUpperCase(); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function transform(operation) { + return { + kind: "transformation", + type: "transform", + reference: transform, + async: false, + operation, + "~run"(dataset) { + dataset.value = this.operation(dataset.value); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function transformAsync(operation) { + return { + kind: "transformation", + type: "transform", + reference: transformAsync, + async: true, + operation, + async "~run"(dataset) { + dataset.value = await this.operation(dataset.value); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function trim() { + return { + kind: "transformation", + type: "trim", + reference: trim, + async: false, + "~run"(dataset) { + dataset.value = dataset.value.trim(); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function trimEnd() { + return { + kind: "transformation", + type: "trim_end", + reference: trimEnd, + async: false, + "~run"(dataset) { + dataset.value = dataset.value.trimEnd(); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function trimStart() { + return { + kind: "transformation", + type: "trim_start", + reference: trimStart, + async: false, + "~run"(dataset) { + dataset.value = dataset.value.trimStart(); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function ulid(message$1) { + return { + kind: "validation", + type: "ulid", + reference: ulid, + async: false, + expects: null, + requirement: ULID_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "ULID", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function url(message$1) { + return { + kind: "validation", + type: "url", + reference: url, + async: false, + expects: null, + requirement(input) { + try { + new URL(input); + return true; + } catch { + return false; + } + }, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "URL", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function uuid(message$1) { + return { + kind: "validation", + type: "uuid", + reference: uuid, + async: false, + expects: null, + requirement: UUID_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "UUID", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function value(requirement, message$1) { + return { + kind: "validation", + type: "value", + reference: value, + async: false, + expects: requirement instanceof Date ? requirement.toJSON() : /* @__PURE__ */ _stringify(requirement), + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !(this.requirement <= dataset.value && this.requirement >= dataset.value)) _addIssue(this, "value", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function values(requirement, message$1) { + return { + kind: "validation", + type: "values", + reference: values, + async: false, + expects: `${/* @__PURE__ */ _joinExpects(requirement.map((value$1) => value$1 instanceof Date ? value$1.toJSON() : /* @__PURE__ */ _stringify(value$1)), "|")}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.some((value$1) => value$1 <= dataset.value && value$1 >= dataset.value)) _addIssue(this, "value", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function words(locales, requirement, message$1) { + return { + kind: "validation", + type: "words", + reference: words, + async: false, + expects: `${requirement}`, + locales, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const count = /* @__PURE__ */ _getWordCount(this.locales, dataset.value); + if (count !== this.requirement) _addIssue(this, "words", dataset, config$1, { received: `${count}` }); + } + return dataset; + } + }; + } + function assert(schema, input) { + const issues = schema["~run"]({ value: input }, { abortEarly: true }).issues; + if (issues) throw new ValiError(issues); + } + // @__NO_SIDE_EFFECTS__ + function config(schema, config$1) { + return { + ...schema, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config_) { + return schema["~run"](dataset, { + ...config_, + ...config$1 + }); + } + }; + } + // @__NO_SIDE_EFFECTS__ + function getFallback(schema, dataset, config$1) { + return typeof schema.fallback === "function" ? schema.fallback(dataset, config$1) : schema.fallback; + } + // @__NO_SIDE_EFFECTS__ + function fallback(schema, fallback$1) { + return { + ...schema, + fallback: fallback$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const outputDataset = schema["~run"](dataset, config$1); + return outputDataset.issues ? { + typed: true, + value: /* @__PURE__ */ getFallback(this, outputDataset, config$1) + } : outputDataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function fallbackAsync(schema, fallback$1) { + return { + ...schema, + fallback: fallback$1, + async: true, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const outputDataset = await schema["~run"](dataset, config$1); + return outputDataset.issues ? { + typed: true, + value: await /* @__PURE__ */ getFallback(this, outputDataset, config$1) + } : outputDataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function flatten(issues) { + const flatErrors = {}; + for (const issue of issues) if (issue.path) { + const dotPath = /* @__PURE__ */ getDotPath(issue); + if (dotPath) { + if (!flatErrors.nested) flatErrors.nested = {}; + if (flatErrors.nested[dotPath]) flatErrors.nested[dotPath].push(issue.message); + else flatErrors.nested[dotPath] = [issue.message]; + } else if (flatErrors.other) flatErrors.other.push(issue.message); + else flatErrors.other = [issue.message]; + } else if (flatErrors.root) flatErrors.root.push(issue.message); + else flatErrors.root = [issue.message]; + return flatErrors; + } + // @__NO_SIDE_EFFECTS__ + function forward(action, path2) { + return { + ...action, + "~run"(dataset, config$1) { + const prevIssues = dataset.issues && [...dataset.issues]; + dataset = action["~run"](dataset, config$1); + if (dataset.issues) { + for (const issue of dataset.issues) if (!prevIssues?.includes(issue)) { + let pathInput = dataset.value; + for (const key of path2) { + const pathValue = pathInput[key]; + const pathItem = { + type: "unknown", + origin: "value", + input: pathInput, + key, + value: pathValue + }; + if (issue.path) issue.path.push(pathItem); + else issue.path = [pathItem]; + if (!pathValue) break; + pathInput = pathValue; + } + } + } + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function forwardAsync(action, path2) { + return { + ...action, + async: true, + async "~run"(dataset, config$1) { + const prevIssues = dataset.issues && [...dataset.issues]; + dataset = await action["~run"](dataset, config$1); + if (dataset.issues) { + for (const issue of dataset.issues) if (!prevIssues?.includes(issue)) { + let pathInput = dataset.value; + for (const key of path2) { + const pathValue = pathInput[key]; + const pathItem = { + type: "unknown", + origin: "value", + input: pathInput, + key, + value: pathValue + }; + if (issue.path) issue.path.push(pathItem); + else issue.path = [pathItem]; + if (!pathValue) break; + pathInput = pathValue; + } + } + } + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function getDefault(schema, dataset, config$1) { + return typeof schema.default === "function" ? schema.default(dataset, config$1) : schema.default; + } + // @__NO_SIDE_EFFECTS__ + function getDefaults(schema) { + if ("entries" in schema) { + const object$1 = {}; + for (const key in schema.entries) object$1[key] = /* @__PURE__ */ getDefaults(schema.entries[key]); + return object$1; + } + if ("items" in schema) return schema.items.map(getDefaults); + return /* @__PURE__ */ getDefault(schema); + } + // @__NO_SIDE_EFFECTS__ + async function getDefaultsAsync(schema) { + if ("entries" in schema) return Object.fromEntries(await Promise.all(Object.entries(schema.entries).map(async ([key, value$1]) => [key, await /* @__PURE__ */ getDefaultsAsync(value$1)]))); + if ("items" in schema) return Promise.all(schema.items.map(getDefaultsAsync)); + return /* @__PURE__ */ getDefault(schema); + } + // @__NO_SIDE_EFFECTS__ + function getDescription(schema) { + return /* @__PURE__ */ _getLastMetadata(schema, "description"); + } + // @__NO_SIDE_EFFECTS__ + function getExamples(schema) { + const examples$1 = []; + function depthFirstCollect(schema$1) { + if ("pipe" in schema$1) { + for (const item of schema$1.pipe) if (item.kind === "schema" && "pipe" in item) depthFirstCollect(item); + else if (item.kind === "metadata" && item.type === "examples") examples$1.push(...item.examples); + } + } + depthFirstCollect(schema); + return examples$1; + } + // @__NO_SIDE_EFFECTS__ + function getFallbacks(schema) { + if ("entries" in schema) { + const object$1 = {}; + for (const key in schema.entries) object$1[key] = /* @__PURE__ */ getFallbacks(schema.entries[key]); + return object$1; + } + if ("items" in schema) return schema.items.map(getFallbacks); + return /* @__PURE__ */ getFallback(schema); + } + // @__NO_SIDE_EFFECTS__ + async function getFallbacksAsync(schema) { + if ("entries" in schema) return Object.fromEntries(await Promise.all(Object.entries(schema.entries).map(async ([key, value$1]) => [key, await /* @__PURE__ */ getFallbacksAsync(value$1)]))); + if ("items" in schema) return Promise.all(schema.items.map(getFallbacksAsync)); + return /* @__PURE__ */ getFallback(schema); + } + // @__NO_SIDE_EFFECTS__ + function getMetadata(schema) { + const result = {}; + function depthFirstMerge(schema$1) { + if ("pipe" in schema$1) { + for (const item of schema$1.pipe) if (item.kind === "schema" && "pipe" in item) depthFirstMerge(item); + else if (item.kind === "metadata" && item.type === "metadata") Object.assign(result, item.metadata); + } + } + depthFirstMerge(schema); + return result; + } + // @__NO_SIDE_EFFECTS__ + function getTitle(schema) { + return /* @__PURE__ */ _getLastMetadata(schema, "title"); + } + // @__NO_SIDE_EFFECTS__ + function is(schema, input) { + return !schema["~run"]({ value: input }, { abortEarly: true }).issues; + } + // @__NO_SIDE_EFFECTS__ + function any() { + return { + kind: "schema", + type: "any", + reference: any, + expects: "any", + async: false, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset) { + dataset.typed = true; + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function array(item, message$1) { + return { + kind: "schema", + type: "array", + reference: array, + expects: "Array", + async: false, + item, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (Array.isArray(input)) { + dataset.typed = true; + dataset.value = []; + for (let key = 0; key < input.length; key++) { + const value$1 = input[key]; + const itemDataset = this.item["~run"]({ value: value$1 }, config$1); + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function arrayAsync(item, message$1) { + return { + kind: "schema", + type: "array", + reference: arrayAsync, + expects: "Array", + async: true, + item, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (Array.isArray(input)) { + dataset.typed = true; + dataset.value = []; + const itemDatasets = await Promise.all(input.map((value$1) => this.item["~run"]({ value: value$1 }, config$1))); + for (let key = 0; key < itemDatasets.length; key++) { + const itemDataset = itemDatasets[key]; + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: input[key] + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function bigint(message$1) { + return { + kind: "schema", + type: "bigint", + reference: bigint, + expects: "bigint", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (typeof dataset.value === "bigint") dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function blob(message$1) { + return { + kind: "schema", + type: "blob", + reference: blob, + expects: "Blob", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value instanceof Blob) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function boolean(message$1) { + return { + kind: "schema", + type: "boolean", + reference: boolean, + expects: "boolean", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (typeof dataset.value === "boolean") dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function custom(check$1, message$1) { + return { + kind: "schema", + type: "custom", + reference: custom, + expects: "unknown", + async: false, + check: check$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (this.check(dataset.value)) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function customAsync(check$1, message$1) { + return { + kind: "schema", + type: "custom", + reference: customAsync, + expects: "unknown", + async: true, + check: check$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + if (await this.check(dataset.value)) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function date(message$1) { + return { + kind: "schema", + type: "date", + reference: date, + expects: "Date", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value instanceof Date) if (!isNaN(dataset.value)) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1, { received: '"Invalid Date"' }); + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function enum_(enum__, message$1) { + const options = []; + for (const key in enum__) if (`${+key}` !== key || typeof enum__[key] !== "string" || !Object.is(enum__[enum__[key]], +key)) options.push(enum__[key]); + return { + kind: "schema", + type: "enum", + reference: enum_, + expects: /* @__PURE__ */ _joinExpects(options.map(_stringify), "|"), + async: false, + enum: enum__, + options, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (this.options.includes(dataset.value)) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function exactOptional(wrapped, default_) { + return { + kind: "schema", + type: "exact_optional", + reference: exactOptional, + expects: wrapped.expects, + async: false, + wrapped, + default: default_, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + return this.wrapped["~run"](dataset, config$1); + } + }; + } + // @__NO_SIDE_EFFECTS__ + function exactOptionalAsync(wrapped, default_) { + return { + kind: "schema", + type: "exact_optional", + reference: exactOptionalAsync, + expects: wrapped.expects, + async: true, + wrapped, + default: default_, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + return this.wrapped["~run"](dataset, config$1); + } + }; + } + // @__NO_SIDE_EFFECTS__ + function file(message$1) { + return { + kind: "schema", + type: "file", + reference: file, + expects: "File", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value instanceof File) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function function_(message$1) { + return { + kind: "schema", + type: "function", + reference: function_, + expects: "Function", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (typeof dataset.value === "function") dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function instance(class_, message$1) { + return { + kind: "schema", + type: "instance", + reference: instance, + expects: class_.name, + async: false, + class: class_, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value instanceof this.class) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function _merge(value1, value2) { + if (typeof value1 === typeof value2) { + if (value1 === value2 || value1 instanceof Date && value2 instanceof Date && +value1 === +value2) return { value: value1 }; + if (value1 && value2 && value1.constructor === Object && value2.constructor === Object) { + for (const key in value2) if (key in value1) { + const dataset = /* @__PURE__ */ _merge(value1[key], value2[key]); + if (dataset.issue) return dataset; + value1[key] = dataset.value; + } else value1[key] = value2[key]; + return { value: value1 }; + } + if (Array.isArray(value1) && Array.isArray(value2)) { + if (value1.length === value2.length) { + for (let index2 = 0; index2 < value1.length; index2++) { + const dataset = /* @__PURE__ */ _merge(value1[index2], value2[index2]); + if (dataset.issue) return dataset; + value1[index2] = dataset.value; + } + return { value: value1 }; + } + } + } + return { issue: true }; + } + // @__NO_SIDE_EFFECTS__ + function intersect(options, message$1) { + return { + kind: "schema", + type: "intersect", + reference: intersect, + expects: /* @__PURE__ */ _joinExpects(options.map((option) => option.expects), "&"), + async: false, + options, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (this.options.length) { + const input = dataset.value; + let outputs; + dataset.typed = true; + for (const schema of this.options) { + const optionDataset = schema["~run"]({ value: input }, config$1); + if (optionDataset.issues) { + if (dataset.issues) dataset.issues.push(...optionDataset.issues); + else dataset.issues = optionDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!optionDataset.typed) dataset.typed = false; + if (dataset.typed) if (outputs) outputs.push(optionDataset.value); + else outputs = [optionDataset.value]; + } + if (dataset.typed) { + dataset.value = outputs[0]; + for (let index2 = 1; index2 < outputs.length; index2++) { + const mergeDataset = /* @__PURE__ */ _merge(dataset.value, outputs[index2]); + if (mergeDataset.issue) { + _addIssue(this, "type", dataset, config$1, { received: "unknown" }); + break; + } + dataset.value = mergeDataset.value; + } + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function intersectAsync(options, message$1) { + return { + kind: "schema", + type: "intersect", + reference: intersectAsync, + expects: /* @__PURE__ */ _joinExpects(options.map((option) => option.expects), "&"), + async: true, + options, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + if (this.options.length) { + const input = dataset.value; + let outputs; + dataset.typed = true; + const optionDatasets = await Promise.all(this.options.map((schema) => schema["~run"]({ value: input }, config$1))); + for (const optionDataset of optionDatasets) { + if (optionDataset.issues) { + if (dataset.issues) dataset.issues.push(...optionDataset.issues); + else dataset.issues = optionDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!optionDataset.typed) dataset.typed = false; + if (dataset.typed) if (outputs) outputs.push(optionDataset.value); + else outputs = [optionDataset.value]; + } + if (dataset.typed) { + dataset.value = outputs[0]; + for (let index2 = 1; index2 < outputs.length; index2++) { + const mergeDataset = /* @__PURE__ */ _merge(dataset.value, outputs[index2]); + if (mergeDataset.issue) { + _addIssue(this, "type", dataset, config$1, { received: "unknown" }); + break; + } + dataset.value = mergeDataset.value; + } + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function lazy(getter) { + return { + kind: "schema", + type: "lazy", + reference: lazy, + expects: "unknown", + async: false, + getter, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + return this.getter(dataset.value)["~run"](dataset, config$1); + } + }; + } + // @__NO_SIDE_EFFECTS__ + function lazyAsync(getter) { + return { + kind: "schema", + type: "lazy", + reference: lazyAsync, + expects: "unknown", + async: true, + getter, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + return (await this.getter(dataset.value))["~run"](dataset, config$1); + } + }; + } + // @__NO_SIDE_EFFECTS__ + function literal(literal_, message$1) { + return { + kind: "schema", + type: "literal", + reference: literal, + expects: /* @__PURE__ */ _stringify(literal_), + async: false, + literal: literal_, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value === this.literal) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function looseObject(entries$1, message$1) { + return { + kind: "schema", + type: "loose_object", + reference: looseObject, + expects: "Object", + async: false, + entries: entries$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + dataset.typed = true; + dataset.value = {}; + for (const key in this.entries) { + const valueSchema = this.entries[key]; + if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) { + const value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema); + const valueDataset = valueSchema["~run"]({ value: value$1 }, config$1); + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value[key] = valueDataset.value; + } else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema); + else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") { + _addIssue(this, "key", dataset, config$1, { + input: void 0, + expected: `"${key}"`, + path: [{ + type: "object", + origin: "key", + input, + key, + value: input[key] + }] + }); + if (config$1.abortEarly) break; + } + } + if (!dataset.issues || !config$1.abortEarly) { + for (const key in input) if (/* @__PURE__ */ _isValidObjectKey(input, key) && !(key in this.entries)) dataset.value[key] = input[key]; + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function looseObjectAsync(entries$1, message$1) { + return { + kind: "schema", + type: "loose_object", + reference: looseObjectAsync, + expects: "Object", + async: true, + entries: entries$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + dataset.typed = true; + dataset.value = {}; + const valueDatasets = await Promise.all(Object.entries(this.entries).map(async ([key, valueSchema]) => { + if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) { + const value$1 = key in input ? input[key] : await /* @__PURE__ */ getDefault(valueSchema); + return [ + key, + value$1, + valueSchema, + await valueSchema["~run"]({ value: value$1 }, config$1) + ]; + } + return [ + key, + input[key], + valueSchema, + null + ]; + })); + for (const [key, value$1, valueSchema, valueDataset] of valueDatasets) if (valueDataset) { + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value[key] = valueDataset.value; + } else if (valueSchema.fallback !== void 0) dataset.value[key] = await /* @__PURE__ */ getFallback(valueSchema); + else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") { + _addIssue(this, "key", dataset, config$1, { + input: void 0, + expected: `"${key}"`, + path: [{ + type: "object", + origin: "key", + input, + key, + value: value$1 + }] + }); + if (config$1.abortEarly) break; + } + if (!dataset.issues || !config$1.abortEarly) { + for (const key in input) if (/* @__PURE__ */ _isValidObjectKey(input, key) && !(key in this.entries)) dataset.value[key] = input[key]; + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function looseTuple(items, message$1) { + return { + kind: "schema", + type: "loose_tuple", + reference: looseTuple, + expects: "Array", + async: false, + items, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (Array.isArray(input)) { + dataset.typed = true; + dataset.value = []; + for (let key = 0; key < this.items.length; key++) { + const value$1 = input[key]; + const itemDataset = this.items[key]["~run"]({ value: value$1 }, config$1); + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + if (!dataset.issues || !config$1.abortEarly) for (let key = this.items.length; key < input.length; key++) dataset.value.push(input[key]); + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function looseTupleAsync(items, message$1) { + return { + kind: "schema", + type: "loose_tuple", + reference: looseTupleAsync, + expects: "Array", + async: true, + items, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (Array.isArray(input)) { + dataset.typed = true; + dataset.value = []; + const itemDatasets = await Promise.all(this.items.map(async (item, key) => { + const value$1 = input[key]; + return [ + key, + value$1, + await item["~run"]({ value: value$1 }, config$1) + ]; + })); + for (const [key, value$1, itemDataset] of itemDatasets) { + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + if (!dataset.issues || !config$1.abortEarly) for (let key = this.items.length; key < input.length; key++) dataset.value.push(input[key]); + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function map(key, value$1, message$1) { + return { + kind: "schema", + type: "map", + reference: map, + expects: "Map", + async: false, + key, + value: value$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (input instanceof Map) { + dataset.typed = true; + dataset.value = /* @__PURE__ */ new Map(); + for (const [inputKey, inputValue] of input) { + const keyDataset = this.key["~run"]({ value: inputKey }, config$1); + if (keyDataset.issues) { + const pathItem = { + type: "map", + origin: "key", + input, + key: inputKey, + value: inputValue + }; + for (const issue of keyDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = keyDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + const valueDataset = this.value["~run"]({ value: inputValue }, config$1); + if (valueDataset.issues) { + const pathItem = { + type: "map", + origin: "value", + input, + key: inputKey, + value: inputValue + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!keyDataset.typed || !valueDataset.typed) dataset.typed = false; + dataset.value.set(keyDataset.value, valueDataset.value); + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function mapAsync(key, value$1, message$1) { + return { + kind: "schema", + type: "map", + reference: mapAsync, + expects: "Map", + async: true, + key, + value: value$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (input instanceof Map) { + dataset.typed = true; + dataset.value = /* @__PURE__ */ new Map(); + const datasets = await Promise.all([...input].map(([inputKey, inputValue]) => Promise.all([ + inputKey, + inputValue, + this.key["~run"]({ value: inputKey }, config$1), + this.value["~run"]({ value: inputValue }, config$1) + ]))); + for (const [inputKey, inputValue, keyDataset, valueDataset] of datasets) { + if (keyDataset.issues) { + const pathItem = { + type: "map", + origin: "key", + input, + key: inputKey, + value: inputValue + }; + for (const issue of keyDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = keyDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (valueDataset.issues) { + const pathItem = { + type: "map", + origin: "value", + input, + key: inputKey, + value: inputValue + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!keyDataset.typed || !valueDataset.typed) dataset.typed = false; + dataset.value.set(keyDataset.value, valueDataset.value); + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function nan(message$1) { + return { + kind: "schema", + type: "nan", + reference: nan, + expects: "NaN", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (Number.isNaN(dataset.value)) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function never(message$1) { + return { + kind: "schema", + type: "never", + reference: never, + expects: "never", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function nonNullable(wrapped, message$1) { + return { + kind: "schema", + type: "non_nullable", + reference: nonNullable, + expects: "!null", + async: false, + wrapped, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value !== null) dataset = this.wrapped["~run"](dataset, config$1); + if (dataset.value === null) _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function nonNullableAsync(wrapped, message$1) { + return { + kind: "schema", + type: "non_nullable", + reference: nonNullableAsync, + expects: "!null", + async: true, + wrapped, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + if (dataset.value !== null) dataset = await this.wrapped["~run"](dataset, config$1); + if (dataset.value === null) _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function nonNullish(wrapped, message$1) { + return { + kind: "schema", + type: "non_nullish", + reference: nonNullish, + expects: "(!null & !undefined)", + async: false, + wrapped, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (!(dataset.value === null || dataset.value === void 0)) dataset = this.wrapped["~run"](dataset, config$1); + if (dataset.value === null || dataset.value === void 0) _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function nonNullishAsync(wrapped, message$1) { + return { + kind: "schema", + type: "non_nullish", + reference: nonNullishAsync, + expects: "(!null & !undefined)", + async: true, + wrapped, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + if (!(dataset.value === null || dataset.value === void 0)) dataset = await this.wrapped["~run"](dataset, config$1); + if (dataset.value === null || dataset.value === void 0) _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function nonOptional(wrapped, message$1) { + return { + kind: "schema", + type: "non_optional", + reference: nonOptional, + expects: "!undefined", + async: false, + wrapped, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value !== void 0) dataset = this.wrapped["~run"](dataset, config$1); + if (dataset.value === void 0) _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function nonOptionalAsync(wrapped, message$1) { + return { + kind: "schema", + type: "non_optional", + reference: nonOptionalAsync, + expects: "!undefined", + async: true, + wrapped, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + if (dataset.value !== void 0) dataset = await this.wrapped["~run"](dataset, config$1); + if (dataset.value === void 0) _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function null_(message$1) { + return { + kind: "schema", + type: "null", + reference: null_, + expects: "null", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value === null) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function nullable(wrapped, default_) { + return { + kind: "schema", + type: "nullable", + reference: nullable, + expects: `(${wrapped.expects} | null)`, + async: false, + wrapped, + default: default_, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value === null) { + if (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1); + if (dataset.value === null) { + dataset.typed = true; + return dataset; + } + } + return this.wrapped["~run"](dataset, config$1); + } + }; + } + // @__NO_SIDE_EFFECTS__ + function nullableAsync(wrapped, default_) { + return { + kind: "schema", + type: "nullable", + reference: nullableAsync, + expects: `(${wrapped.expects} | null)`, + async: true, + wrapped, + default: default_, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + if (dataset.value === null) { + if (this.default !== void 0) dataset.value = await /* @__PURE__ */ getDefault(this, dataset, config$1); + if (dataset.value === null) { + dataset.typed = true; + return dataset; + } + } + return this.wrapped["~run"](dataset, config$1); + } + }; + } + // @__NO_SIDE_EFFECTS__ + function nullish(wrapped, default_) { + return { + kind: "schema", + type: "nullish", + reference: nullish, + expects: `(${wrapped.expects} | null | undefined)`, + async: false, + wrapped, + default: default_, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value === null || dataset.value === void 0) { + if (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1); + if (dataset.value === null || dataset.value === void 0) { + dataset.typed = true; + return dataset; + } + } + return this.wrapped["~run"](dataset, config$1); + } + }; + } + // @__NO_SIDE_EFFECTS__ + function nullishAsync(wrapped, default_) { + return { + kind: "schema", + type: "nullish", + reference: nullishAsync, + expects: `(${wrapped.expects} | null | undefined)`, + async: true, + wrapped, + default: default_, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + if (dataset.value === null || dataset.value === void 0) { + if (this.default !== void 0) dataset.value = await /* @__PURE__ */ getDefault(this, dataset, config$1); + if (dataset.value === null || dataset.value === void 0) { + dataset.typed = true; + return dataset; + } + } + return this.wrapped["~run"](dataset, config$1); + } + }; + } + // @__NO_SIDE_EFFECTS__ + function number(message$1) { + return { + kind: "schema", + type: "number", + reference: number, + expects: "number", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (typeof dataset.value === "number" && !isNaN(dataset.value)) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function object(entries$1, message$1) { + return { + kind: "schema", + type: "object", + reference: object, + expects: "Object", + async: false, + entries: entries$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + dataset.typed = true; + dataset.value = {}; + for (const key in this.entries) { + const valueSchema = this.entries[key]; + if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) { + const value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema); + const valueDataset = valueSchema["~run"]({ value: value$1 }, config$1); + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value[key] = valueDataset.value; + } else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema); + else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") { + _addIssue(this, "key", dataset, config$1, { + input: void 0, + expected: `"${key}"`, + path: [{ + type: "object", + origin: "key", + input, + key, + value: input[key] + }] + }); + if (config$1.abortEarly) break; + } + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function objectAsync(entries$1, message$1) { + return { + kind: "schema", + type: "object", + reference: objectAsync, + expects: "Object", + async: true, + entries: entries$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + dataset.typed = true; + dataset.value = {}; + const valueDatasets = await Promise.all(Object.entries(this.entries).map(async ([key, valueSchema]) => { + if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) { + const value$1 = key in input ? input[key] : await /* @__PURE__ */ getDefault(valueSchema); + return [ + key, + value$1, + valueSchema, + await valueSchema["~run"]({ value: value$1 }, config$1) + ]; + } + return [ + key, + input[key], + valueSchema, + null + ]; + })); + for (const [key, value$1, valueSchema, valueDataset] of valueDatasets) if (valueDataset) { + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value[key] = valueDataset.value; + } else if (valueSchema.fallback !== void 0) dataset.value[key] = await /* @__PURE__ */ getFallback(valueSchema); + else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") { + _addIssue(this, "key", dataset, config$1, { + input: void 0, + expected: `"${key}"`, + path: [{ + type: "object", + origin: "key", + input, + key, + value: value$1 + }] + }); + if (config$1.abortEarly) break; + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function objectWithRest(entries$1, rest, message$1) { + return { + kind: "schema", + type: "object_with_rest", + reference: objectWithRest, + expects: "Object", + async: false, + entries: entries$1, + rest, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + dataset.typed = true; + dataset.value = {}; + for (const key in this.entries) { + const valueSchema = this.entries[key]; + if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) { + const value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema); + const valueDataset = valueSchema["~run"]({ value: value$1 }, config$1); + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value[key] = valueDataset.value; + } else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema); + else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") { + _addIssue(this, "key", dataset, config$1, { + input: void 0, + expected: `"${key}"`, + path: [{ + type: "object", + origin: "key", + input, + key, + value: input[key] + }] + }); + if (config$1.abortEarly) break; + } + } + if (!dataset.issues || !config$1.abortEarly) { + for (const key in input) if (/* @__PURE__ */ _isValidObjectKey(input, key) && !(key in this.entries)) { + const valueDataset = this.rest["~run"]({ value: input[key] }, config$1); + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key, + value: input[key] + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value[key] = valueDataset.value; + } + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function objectWithRestAsync(entries$1, rest, message$1) { + return { + kind: "schema", + type: "object_with_rest", + reference: objectWithRestAsync, + expects: "Object", + async: true, + entries: entries$1, + rest, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + dataset.typed = true; + dataset.value = {}; + const [normalDatasets, restDatasets] = await Promise.all([Promise.all(Object.entries(this.entries).map(async ([key, valueSchema]) => { + if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) { + const value$1 = key in input ? input[key] : await /* @__PURE__ */ getDefault(valueSchema); + return [ + key, + value$1, + valueSchema, + await valueSchema["~run"]({ value: value$1 }, config$1) + ]; + } + return [ + key, + input[key], + valueSchema, + null + ]; + })), Promise.all(Object.entries(input).filter(([key]) => /* @__PURE__ */ _isValidObjectKey(input, key) && !(key in this.entries)).map(async ([key, value$1]) => [ + key, + value$1, + await this.rest["~run"]({ value: value$1 }, config$1) + ]))]); + for (const [key, value$1, valueSchema, valueDataset] of normalDatasets) if (valueDataset) { + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value[key] = valueDataset.value; + } else if (valueSchema.fallback !== void 0) dataset.value[key] = await /* @__PURE__ */ getFallback(valueSchema); + else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") { + _addIssue(this, "key", dataset, config$1, { + input: void 0, + expected: `"${key}"`, + path: [{ + type: "object", + origin: "key", + input, + key, + value: value$1 + }] + }); + if (config$1.abortEarly) break; + } + if (!dataset.issues || !config$1.abortEarly) for (const [key, value$1, valueDataset] of restDatasets) { + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value[key] = valueDataset.value; + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function optional(wrapped, default_) { + return { + kind: "schema", + type: "optional", + reference: optional, + expects: `(${wrapped.expects} | undefined)`, + async: false, + wrapped, + default: default_, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value === void 0) { + if (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1); + if (dataset.value === void 0) { + dataset.typed = true; + return dataset; + } + } + return this.wrapped["~run"](dataset, config$1); + } + }; + } + // @__NO_SIDE_EFFECTS__ + function optionalAsync(wrapped, default_) { + return { + kind: "schema", + type: "optional", + reference: optionalAsync, + expects: `(${wrapped.expects} | undefined)`, + async: true, + wrapped, + default: default_, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + if (dataset.value === void 0) { + if (this.default !== void 0) dataset.value = await /* @__PURE__ */ getDefault(this, dataset, config$1); + if (dataset.value === void 0) { + dataset.typed = true; + return dataset; + } + } + return this.wrapped["~run"](dataset, config$1); + } + }; + } + // @__NO_SIDE_EFFECTS__ + function picklist(options, message$1) { + return { + kind: "schema", + type: "picklist", + reference: picklist, + expects: /* @__PURE__ */ _joinExpects(options.map(_stringify), "|"), + async: false, + options, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (this.options.includes(dataset.value)) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function promise(message$1) { + return { + kind: "schema", + type: "promise", + reference: promise, + expects: "Promise", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value instanceof Promise) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function record(key, value$1, message$1) { + return { + kind: "schema", + type: "record", + reference: record, + expects: "Object", + async: false, + key, + value: value$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + dataset.typed = true; + dataset.value = {}; + for (const entryKey in input) if (/* @__PURE__ */ _isValidObjectKey(input, entryKey)) { + const entryValue = input[entryKey]; + const keyDataset = this.key["~run"]({ value: entryKey }, config$1); + if (keyDataset.issues) { + const pathItem = { + type: "object", + origin: "key", + input, + key: entryKey, + value: entryValue + }; + for (const issue of keyDataset.issues) { + issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = keyDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + const valueDataset = this.value["~run"]({ value: entryValue }, config$1); + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key: entryKey, + value: entryValue + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!keyDataset.typed || !valueDataset.typed) dataset.typed = false; + if (keyDataset.typed) dataset.value[keyDataset.value] = valueDataset.value; + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function recordAsync(key, value$1, message$1) { + return { + kind: "schema", + type: "record", + reference: recordAsync, + expects: "Object", + async: true, + key, + value: value$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + dataset.typed = true; + dataset.value = {}; + const datasets = await Promise.all(Object.entries(input).filter(([key$1]) => /* @__PURE__ */ _isValidObjectKey(input, key$1)).map(([entryKey, entryValue]) => Promise.all([ + entryKey, + entryValue, + this.key["~run"]({ value: entryKey }, config$1), + this.value["~run"]({ value: entryValue }, config$1) + ]))); + for (const [entryKey, entryValue, keyDataset, valueDataset] of datasets) { + if (keyDataset.issues) { + const pathItem = { + type: "object", + origin: "key", + input, + key: entryKey, + value: entryValue + }; + for (const issue of keyDataset.issues) { + issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = keyDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key: entryKey, + value: entryValue + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!keyDataset.typed || !valueDataset.typed) dataset.typed = false; + if (keyDataset.typed) dataset.value[keyDataset.value] = valueDataset.value; + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function set(value$1, message$1) { + return { + kind: "schema", + type: "set", + reference: set, + expects: "Set", + async: false, + value: value$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (input instanceof Set) { + dataset.typed = true; + dataset.value = /* @__PURE__ */ new Set(); + for (const inputValue of input) { + const valueDataset = this.value["~run"]({ value: inputValue }, config$1); + if (valueDataset.issues) { + const pathItem = { + type: "set", + origin: "value", + input, + key: null, + value: inputValue + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value.add(valueDataset.value); + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function setAsync(value$1, message$1) { + return { + kind: "schema", + type: "set", + reference: setAsync, + expects: "Set", + async: true, + value: value$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (input instanceof Set) { + dataset.typed = true; + dataset.value = /* @__PURE__ */ new Set(); + const valueDatasets = await Promise.all([...input].map(async (inputValue) => [inputValue, await this.value["~run"]({ value: inputValue }, config$1)])); + for (const [inputValue, valueDataset] of valueDatasets) { + if (valueDataset.issues) { + const pathItem = { + type: "set", + origin: "value", + input, + key: null, + value: inputValue + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value.add(valueDataset.value); + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function strictObject(entries$1, message$1) { + return { + kind: "schema", + type: "strict_object", + reference: strictObject, + expects: "Object", + async: false, + entries: entries$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + dataset.typed = true; + dataset.value = {}; + for (const key in this.entries) { + const valueSchema = this.entries[key]; + if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) { + const value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema); + const valueDataset = valueSchema["~run"]({ value: value$1 }, config$1); + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value[key] = valueDataset.value; + } else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema); + else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") { + _addIssue(this, "key", dataset, config$1, { + input: void 0, + expected: `"${key}"`, + path: [{ + type: "object", + origin: "key", + input, + key, + value: input[key] + }] + }); + if (config$1.abortEarly) break; + } + } + if (!dataset.issues || !config$1.abortEarly) { + for (const key in input) if (!(key in this.entries)) { + _addIssue(this, "key", dataset, config$1, { + input: key, + expected: "never", + path: [{ + type: "object", + origin: "key", + input, + key, + value: input[key] + }] + }); + break; + } + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function strictObjectAsync(entries$1, message$1) { + return { + kind: "schema", + type: "strict_object", + reference: strictObjectAsync, + expects: "Object", + async: true, + entries: entries$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + dataset.typed = true; + dataset.value = {}; + const valueDatasets = await Promise.all(Object.entries(this.entries).map(async ([key, valueSchema]) => { + if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) { + const value$1 = key in input ? input[key] : await /* @__PURE__ */ getDefault(valueSchema); + return [ + key, + value$1, + valueSchema, + await valueSchema["~run"]({ value: value$1 }, config$1) + ]; + } + return [ + key, + input[key], + valueSchema, + null + ]; + })); + for (const [key, value$1, valueSchema, valueDataset] of valueDatasets) if (valueDataset) { + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value[key] = valueDataset.value; + } else if (valueSchema.fallback !== void 0) dataset.value[key] = await /* @__PURE__ */ getFallback(valueSchema); + else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") { + _addIssue(this, "key", dataset, config$1, { + input: void 0, + expected: `"${key}"`, + path: [{ + type: "object", + origin: "key", + input, + key, + value: value$1 + }] + }); + if (config$1.abortEarly) break; + } + if (!dataset.issues || !config$1.abortEarly) { + for (const key in input) if (!(key in this.entries)) { + _addIssue(this, "key", dataset, config$1, { + input: key, + expected: "never", + path: [{ + type: "object", + origin: "key", + input, + key, + value: input[key] + }] + }); + break; + } + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function strictTuple(items, message$1) { + return { + kind: "schema", + type: "strict_tuple", + reference: strictTuple, + expects: "Array", + async: false, + items, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (Array.isArray(input)) { + dataset.typed = true; + dataset.value = []; + for (let key = 0; key < this.items.length; key++) { + const value$1 = input[key]; + const itemDataset = this.items[key]["~run"]({ value: value$1 }, config$1); + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + if (!(dataset.issues && config$1.abortEarly) && this.items.length < input.length) _addIssue(this, "type", dataset, config$1, { + input: input[this.items.length], + expected: "never", + path: [{ + type: "array", + origin: "value", + input, + key: this.items.length, + value: input[this.items.length] + }] + }); + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function strictTupleAsync(items, message$1) { + return { + kind: "schema", + type: "strict_tuple", + reference: strictTupleAsync, + expects: "Array", + async: true, + items, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (Array.isArray(input)) { + dataset.typed = true; + dataset.value = []; + const itemDatasets = await Promise.all(this.items.map(async (item, key) => { + const value$1 = input[key]; + return [ + key, + value$1, + await item["~run"]({ value: value$1 }, config$1) + ]; + })); + for (const [key, value$1, itemDataset] of itemDatasets) { + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + if (!(dataset.issues && config$1.abortEarly) && this.items.length < input.length) _addIssue(this, "type", dataset, config$1, { + input: input[this.items.length], + expected: "never", + path: [{ + type: "array", + origin: "value", + input, + key: this.items.length, + value: input[this.items.length] + }] + }); + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function string(message$1) { + return { + kind: "schema", + type: "string", + reference: string, + expects: "string", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (typeof dataset.value === "string") dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function symbol(message$1) { + return { + kind: "schema", + type: "symbol", + reference: symbol, + expects: "symbol", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (typeof dataset.value === "symbol") dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function tuple(items, message$1) { + return { + kind: "schema", + type: "tuple", + reference: tuple, + expects: "Array", + async: false, + items, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (Array.isArray(input)) { + dataset.typed = true; + dataset.value = []; + for (let key = 0; key < this.items.length; key++) { + const value$1 = input[key]; + const itemDataset = this.items[key]["~run"]({ value: value$1 }, config$1); + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function tupleAsync(items, message$1) { + return { + kind: "schema", + type: "tuple", + reference: tupleAsync, + expects: "Array", + async: true, + items, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (Array.isArray(input)) { + dataset.typed = true; + dataset.value = []; + const itemDatasets = await Promise.all(this.items.map(async (item, key) => { + const value$1 = input[key]; + return [ + key, + value$1, + await item["~run"]({ value: value$1 }, config$1) + ]; + })); + for (const [key, value$1, itemDataset] of itemDatasets) { + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function tupleWithRest(items, rest, message$1) { + return { + kind: "schema", + type: "tuple_with_rest", + reference: tupleWithRest, + expects: "Array", + async: false, + items, + rest, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (Array.isArray(input)) { + dataset.typed = true; + dataset.value = []; + for (let key = 0; key < this.items.length; key++) { + const value$1 = input[key]; + const itemDataset = this.items[key]["~run"]({ value: value$1 }, config$1); + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + if (!dataset.issues || !config$1.abortEarly) for (let key = this.items.length; key < input.length; key++) { + const value$1 = input[key]; + const itemDataset = this.rest["~run"]({ value: value$1 }, config$1); + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function tupleWithRestAsync(items, rest, message$1) { + return { + kind: "schema", + type: "tuple_with_rest", + reference: tupleWithRestAsync, + expects: "Array", + async: true, + items, + rest, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (Array.isArray(input)) { + dataset.typed = true; + dataset.value = []; + const [normalDatasets, restDatasets] = await Promise.all([Promise.all(this.items.map(async (item, key) => { + const value$1 = input[key]; + return [ + key, + value$1, + await item["~run"]({ value: value$1 }, config$1) + ]; + })), Promise.all(input.slice(this.items.length).map(async (value$1, key) => { + return [ + key + this.items.length, + value$1, + await this.rest["~run"]({ value: value$1 }, config$1) + ]; + }))]); + for (const [key, value$1, itemDataset] of normalDatasets) { + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + if (!dataset.issues || !config$1.abortEarly) for (const [key, value$1, itemDataset] of restDatasets) { + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function undefined_(message$1) { + return { + kind: "schema", + type: "undefined", + reference: undefined_, + expects: "undefined", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value === void 0) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function undefinedable(wrapped, default_) { + return { + kind: "schema", + type: "undefinedable", + reference: undefinedable, + expects: `(${wrapped.expects} | undefined)`, + async: false, + wrapped, + default: default_, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value === void 0) { + if (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1); + if (dataset.value === void 0) { + dataset.typed = true; + return dataset; + } + } + return this.wrapped["~run"](dataset, config$1); + } + }; + } + // @__NO_SIDE_EFFECTS__ + function undefinedableAsync(wrapped, default_) { + return { + kind: "schema", + type: "undefinedable", + reference: undefinedableAsync, + expects: `(${wrapped.expects} | undefined)`, + async: true, + wrapped, + default: default_, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + if (dataset.value === void 0) { + if (this.default !== void 0) dataset.value = await /* @__PURE__ */ getDefault(this, dataset, config$1); + if (dataset.value === void 0) { + dataset.typed = true; + return dataset; + } + } + return this.wrapped["~run"](dataset, config$1); + } + }; + } + // @__NO_SIDE_EFFECTS__ + function _subIssues(datasets) { + let issues; + if (datasets) for (const dataset of datasets) if (issues) issues.push(...dataset.issues); + else issues = dataset.issues; + return issues; + } + // @__NO_SIDE_EFFECTS__ + function union(options, message$1) { + return { + kind: "schema", + type: "union", + reference: union, + expects: /* @__PURE__ */ _joinExpects(options.map((option) => option.expects), "|"), + async: false, + options, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + let validDataset; + let typedDatasets; + let untypedDatasets; + for (const schema of this.options) { + const optionDataset = schema["~run"]({ value: dataset.value }, config$1); + if (optionDataset.typed) if (optionDataset.issues) if (typedDatasets) typedDatasets.push(optionDataset); + else typedDatasets = [optionDataset]; + else { + validDataset = optionDataset; + break; + } + else if (untypedDatasets) untypedDatasets.push(optionDataset); + else untypedDatasets = [optionDataset]; + } + if (validDataset) return validDataset; + if (typedDatasets) { + if (typedDatasets.length === 1) return typedDatasets[0]; + _addIssue(this, "type", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(typedDatasets) }); + dataset.typed = true; + } else if (untypedDatasets?.length === 1) return untypedDatasets[0]; + else _addIssue(this, "type", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(untypedDatasets) }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function unionAsync(options, message$1) { + return { + kind: "schema", + type: "union", + reference: unionAsync, + expects: /* @__PURE__ */ _joinExpects(options.map((option) => option.expects), "|"), + async: true, + options, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + let validDataset; + let typedDatasets; + let untypedDatasets; + for (const schema of this.options) { + const optionDataset = await schema["~run"]({ value: dataset.value }, config$1); + if (optionDataset.typed) if (optionDataset.issues) if (typedDatasets) typedDatasets.push(optionDataset); + else typedDatasets = [optionDataset]; + else { + validDataset = optionDataset; + break; + } + else if (untypedDatasets) untypedDatasets.push(optionDataset); + else untypedDatasets = [optionDataset]; + } + if (validDataset) return validDataset; + if (typedDatasets) { + if (typedDatasets.length === 1) return typedDatasets[0]; + _addIssue(this, "type", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(typedDatasets) }); + dataset.typed = true; + } else if (untypedDatasets?.length === 1) return untypedDatasets[0]; + else _addIssue(this, "type", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(untypedDatasets) }); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function unknown() { + return { + kind: "schema", + type: "unknown", + reference: unknown, + expects: "unknown", + async: false, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset) { + dataset.typed = true; + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function variant(key, options, message$1) { + return { + kind: "schema", + type: "variant", + reference: variant, + expects: "Object", + async: false, + key, + options, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + let outputDataset; + let maxDiscriminatorPriority = 0; + let invalidDiscriminatorKey = this.key; + let expectedDiscriminators = []; + const parseOptions = (variant$1, allKeys) => { + for (const schema of variant$1.options) { + if (schema.type === "variant") parseOptions(schema, new Set(allKeys).add(schema.key)); + else { + let keysAreValid = true; + let currentPriority = 0; + for (const currentKey of allKeys) { + const discriminatorSchema = schema.entries[currentKey]; + if (currentKey in input ? discriminatorSchema["~run"]({ + typed: false, + value: input[currentKey] + }, { abortEarly: true }).issues : discriminatorSchema.type !== "exact_optional" && discriminatorSchema.type !== "optional" && discriminatorSchema.type !== "nullish") { + keysAreValid = false; + if (invalidDiscriminatorKey !== currentKey && (maxDiscriminatorPriority < currentPriority || maxDiscriminatorPriority === currentPriority && currentKey in input && !(invalidDiscriminatorKey in input))) { + maxDiscriminatorPriority = currentPriority; + invalidDiscriminatorKey = currentKey; + expectedDiscriminators = []; + } + if (invalidDiscriminatorKey === currentKey) expectedDiscriminators.push(schema.entries[currentKey].expects); + break; + } + currentPriority++; + } + if (keysAreValid) { + const optionDataset = schema["~run"]({ value: input }, config$1); + if (!outputDataset || !outputDataset.typed && optionDataset.typed) outputDataset = optionDataset; + } + } + if (outputDataset && !outputDataset.issues) break; + } + }; + parseOptions(this, /* @__PURE__ */ new Set([this.key])); + if (outputDataset) return outputDataset; + _addIssue(this, "type", dataset, config$1, { + input: input[invalidDiscriminatorKey], + expected: /* @__PURE__ */ _joinExpects(expectedDiscriminators, "|"), + path: [{ + type: "object", + origin: "value", + input, + key: invalidDiscriminatorKey, + value: input[invalidDiscriminatorKey] + }] + }); + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function variantAsync(key, options, message$1) { + return { + kind: "schema", + type: "variant", + reference: variantAsync, + expects: "Object", + async: true, + key, + options, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + let outputDataset; + let maxDiscriminatorPriority = 0; + let invalidDiscriminatorKey = this.key; + let expectedDiscriminators = []; + const parseOptions = async (variant$1, allKeys) => { + for (const schema of variant$1.options) { + if (schema.type === "variant") await parseOptions(schema, new Set(allKeys).add(schema.key)); + else { + let keysAreValid = true; + let currentPriority = 0; + for (const currentKey of allKeys) { + const discriminatorSchema = schema.entries[currentKey]; + if (currentKey in input ? (await discriminatorSchema["~run"]({ + typed: false, + value: input[currentKey] + }, { abortEarly: true })).issues : discriminatorSchema.type !== "exact_optional" && discriminatorSchema.type !== "optional" && discriminatorSchema.type !== "nullish") { + keysAreValid = false; + if (invalidDiscriminatorKey !== currentKey && (maxDiscriminatorPriority < currentPriority || maxDiscriminatorPriority === currentPriority && currentKey in input && !(invalidDiscriminatorKey in input))) { + maxDiscriminatorPriority = currentPriority; + invalidDiscriminatorKey = currentKey; + expectedDiscriminators = []; + } + if (invalidDiscriminatorKey === currentKey) expectedDiscriminators.push(schema.entries[currentKey].expects); + break; + } + currentPriority++; + } + if (keysAreValid) { + const optionDataset = await schema["~run"]({ value: input }, config$1); + if (!outputDataset || !outputDataset.typed && optionDataset.typed) outputDataset = optionDataset; + } + } + if (outputDataset && !outputDataset.issues) break; + } + }; + await parseOptions(this, /* @__PURE__ */ new Set([this.key])); + if (outputDataset) return outputDataset; + _addIssue(this, "type", dataset, config$1, { + input: input[invalidDiscriminatorKey], + expected: /* @__PURE__ */ _joinExpects(expectedDiscriminators, "|"), + path: [{ + type: "object", + origin: "value", + input, + key: invalidDiscriminatorKey, + value: input[invalidDiscriminatorKey] + }] + }); + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function void_(message$1) { + return { + kind: "schema", + type: "void", + reference: void_, + expects: "void", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value === void 0) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function keyof(schema, message$1) { + return /* @__PURE__ */ picklist(Object.keys(schema.entries), message$1); + } + // @__NO_SIDE_EFFECTS__ + function message(schema, message_) { + return { + ...schema, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + return schema["~run"](dataset, { + ...config$1, + message: message_ + }); + } + }; + } + // @__NO_SIDE_EFFECTS__ + function omit(schema, keys) { + const entries$1 = { ...schema.entries }; + for (const key of keys) delete entries$1[key]; + return { + ...schema, + entries: entries$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + } + }; + } + function parse(schema, input, config$1) { + const dataset = schema["~run"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config$1)); + if (dataset.issues) throw new ValiError(dataset.issues); + return dataset.value; + } + async function parseAsync(schema, input, config$1) { + const dataset = await schema["~run"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config$1)); + if (dataset.issues) throw new ValiError(dataset.issues); + return dataset.value; + } + // @__NO_SIDE_EFFECTS__ + function parser(schema, config$1) { + const func = (input) => parse(schema, input, config$1); + func.schema = schema; + func.config = config$1; + return func; + } + // @__NO_SIDE_EFFECTS__ + function parserAsync(schema, config$1) { + const func = (input) => parseAsync(schema, input, config$1); + func.schema = schema; + func.config = config$1; + return func; + } + // @__NO_SIDE_EFFECTS__ + function partial(schema, keys) { + const entries$1 = {}; + for (const key in schema.entries) entries$1[key] = !keys || keys.includes(key) ? /* @__PURE__ */ optional(schema.entries[key]) : schema.entries[key]; + return { + ...schema, + entries: entries$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + } + }; + } + // @__NO_SIDE_EFFECTS__ + function partialAsync(schema, keys) { + const entries$1 = {}; + for (const key in schema.entries) entries$1[key] = !keys || keys.includes(key) ? /* @__PURE__ */ optionalAsync(schema.entries[key]) : schema.entries[key]; + return { + ...schema, + entries: entries$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + } + }; + } + // @__NO_SIDE_EFFECTS__ + function pick(schema, keys) { + const entries$1 = {}; + for (const key of keys) entries$1[key] = schema.entries[key]; + return { + ...schema, + entries: entries$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + } + }; + } + // @__NO_SIDE_EFFECTS__ + function pipe(...pipe$1) { + return { + ...pipe$1[0], + pipe: pipe$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + for (const item of pipe$1) if (item.kind !== "metadata") { + if (dataset.issues && (item.kind === "schema" || item.kind === "transformation")) { + dataset.typed = false; + break; + } + if (!dataset.issues || !config$1.abortEarly && !config$1.abortPipeEarly) dataset = item["~run"](dataset, config$1); + } + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function pipeAsync(...pipe$1) { + return { + ...pipe$1[0], + pipe: pipe$1, + async: true, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + for (const item of pipe$1) if (item.kind !== "metadata") { + if (dataset.issues && (item.kind === "schema" || item.kind === "transformation")) { + dataset.typed = false; + break; + } + if (!dataset.issues || !config$1.abortEarly && !config$1.abortPipeEarly) dataset = await item["~run"](dataset, config$1); + } + return dataset; + } + }; + } + // @__NO_SIDE_EFFECTS__ + function required(schema, arg2, arg3) { + const keys = Array.isArray(arg2) ? arg2 : void 0; + const message$1 = Array.isArray(arg2) ? arg3 : arg2; + const entries$1 = {}; + for (const key in schema.entries) entries$1[key] = !keys || keys.includes(key) ? /* @__PURE__ */ nonOptional(schema.entries[key], message$1) : schema.entries[key]; + return { + ...schema, + entries: entries$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + } + }; + } + // @__NO_SIDE_EFFECTS__ + function requiredAsync(schema, arg2, arg3) { + const keys = Array.isArray(arg2) ? arg2 : void 0; + const message$1 = Array.isArray(arg2) ? arg3 : arg2; + const entries$1 = {}; + for (const key in schema.entries) entries$1[key] = !keys || keys.includes(key) ? /* @__PURE__ */ nonOptionalAsync(schema.entries[key], message$1) : schema.entries[key]; + return { + ...schema, + entries: entries$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + } + }; + } + // @__NO_SIDE_EFFECTS__ + function safeParse(schema, input, config$1) { + const dataset = schema["~run"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config$1)); + return { + typed: dataset.typed, + success: !dataset.issues, + output: dataset.value, + issues: dataset.issues + }; + } + // @__NO_SIDE_EFFECTS__ + async function safeParseAsync(schema, input, config$1) { + const dataset = await schema["~run"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config$1)); + return { + typed: dataset.typed, + success: !dataset.issues, + output: dataset.value, + issues: dataset.issues + }; + } + // @__NO_SIDE_EFFECTS__ + function safeParser(schema, config$1) { + const func = (input) => /* @__PURE__ */ safeParse(schema, input, config$1); + func.schema = schema; + func.config = config$1; + return func; + } + // @__NO_SIDE_EFFECTS__ + function safeParserAsync(schema, config$1) { + const func = (input) => /* @__PURE__ */ safeParseAsync(schema, input, config$1); + func.schema = schema; + func.config = config$1; + return func; + } + // @__NO_SIDE_EFFECTS__ + function summarize(issues) { + let summary = ""; + for (const issue of issues) { + if (summary) summary += "\n"; + summary += `\xD7 ${issue.message}`; + const dotPath = /* @__PURE__ */ getDotPath(issue); + if (dotPath) summary += ` + \u2192 at ${dotPath}`; + } + return summary; + } + // @__NO_SIDE_EFFECTS__ + function unwrap(schema) { + return schema.wrapped; + } + exports.BASE64_REGEX = BASE64_REGEX; + exports.BIC_REGEX = BIC_REGEX; + exports.CUID2_REGEX = CUID2_REGEX; + exports.DECIMAL_REGEX = DECIMAL_REGEX; + exports.DIGITS_REGEX = DIGITS_REGEX; + exports.EMAIL_REGEX = EMAIL_REGEX; + exports.EMOJI_REGEX = EMOJI_REGEX; + exports.HEXADECIMAL_REGEX = HEXADECIMAL_REGEX; + exports.HEX_COLOR_REGEX = HEX_COLOR_REGEX; + exports.IMEI_REGEX = IMEI_REGEX; + exports.IPV4_REGEX = IPV4_REGEX; + exports.IPV6_REGEX = IPV6_REGEX; + exports.IP_REGEX = IP_REGEX; + exports.ISO_DATE_REGEX = ISO_DATE_REGEX; + exports.ISO_DATE_TIME_REGEX = ISO_DATE_TIME_REGEX; + exports.ISO_TIMESTAMP_REGEX = ISO_TIMESTAMP_REGEX; + exports.ISO_TIME_REGEX = ISO_TIME_REGEX; + exports.ISO_TIME_SECOND_REGEX = ISO_TIME_SECOND_REGEX; + exports.ISO_WEEK_REGEX = ISO_WEEK_REGEX; + exports.MAC48_REGEX = MAC48_REGEX; + exports.MAC64_REGEX = MAC64_REGEX; + exports.MAC_REGEX = MAC_REGEX; + exports.NANO_ID_REGEX = NANO_ID_REGEX; + exports.OCTAL_REGEX = OCTAL_REGEX; + exports.RFC_EMAIL_REGEX = RFC_EMAIL_REGEX; + exports.SLUG_REGEX = SLUG_REGEX; + exports.ULID_REGEX = ULID_REGEX; + exports.UUID_REGEX = UUID_REGEX; + exports.ValiError = ValiError; + exports._addIssue = _addIssue; + exports._getByteCount = _getByteCount; + exports._getGraphemeCount = _getGraphemeCount; + exports._getLastMetadata = _getLastMetadata; + exports._getStandardProps = _getStandardProps; + exports._getWordCount = _getWordCount; + exports._isLuhnAlgo = _isLuhnAlgo; + exports._isValidObjectKey = _isValidObjectKey; + exports._joinExpects = _joinExpects; + exports._stringify = _stringify; + exports.any = any; + exports.args = args; + exports.argsAsync = argsAsync; + exports.array = array; + exports.arrayAsync = arrayAsync; + exports.assert = assert; + exports.awaitAsync = awaitAsync; + exports.base64 = base64; + exports.bic = bic; + exports.bigint = bigint; + exports.blob = blob; + exports.boolean = boolean; + exports.brand = brand; + exports.bytes = bytes; + exports.check = check; + exports.checkAsync = checkAsync; + exports.checkItems = checkItems; + exports.checkItemsAsync = checkItemsAsync; + exports.config = config; + exports.creditCard = creditCard; + exports.cuid2 = cuid2; + exports.custom = custom; + exports.customAsync = customAsync; + exports.date = date; + exports.decimal = decimal; + exports.deleteGlobalConfig = deleteGlobalConfig; + exports.deleteGlobalMessage = deleteGlobalMessage; + exports.deleteSchemaMessage = deleteSchemaMessage; + exports.deleteSpecificMessage = deleteSpecificMessage; + exports.description = description; + exports.digits = digits; + exports.email = email; + exports.emoji = emoji; + exports.empty = empty; + exports.endsWith = endsWith; + exports.entries = entries; + exports.entriesFromList = entriesFromList; + exports.entriesFromObjects = entriesFromObjects; + exports.enum = enum_; + exports.enum_ = enum_; + exports.everyItem = everyItem; + exports.exactOptional = exactOptional; + exports.exactOptionalAsync = exactOptionalAsync; + exports.examples = examples; + exports.excludes = excludes; + exports.fallback = fallback; + exports.fallbackAsync = fallbackAsync; + exports.file = file; + exports.filterItems = filterItems; + exports.findItem = findItem; + exports.finite = finite; + exports.flatten = flatten; + exports.flavor = flavor; + exports.forward = forward; + exports.forwardAsync = forwardAsync; + exports.function = function_; + exports.function_ = function_; + exports.getDefault = getDefault; + exports.getDefaults = getDefaults; + exports.getDefaultsAsync = getDefaultsAsync; + exports.getDescription = getDescription; + exports.getDotPath = getDotPath; + exports.getExamples = getExamples; + exports.getFallback = getFallback; + exports.getFallbacks = getFallbacks; + exports.getFallbacksAsync = getFallbacksAsync; + exports.getGlobalConfig = getGlobalConfig; + exports.getGlobalMessage = getGlobalMessage; + exports.getMetadata = getMetadata; + exports.getSchemaMessage = getSchemaMessage; + exports.getSpecificMessage = getSpecificMessage; + exports.getTitle = getTitle; + exports.graphemes = graphemes; + exports.gtValue = gtValue; + exports.hash = hash; + exports.hexColor = hexColor; + exports.hexadecimal = hexadecimal; + exports.imei = imei; + exports.includes = includes; + exports.instance = instance; + exports.integer = integer; + exports.intersect = intersect; + exports.intersectAsync = intersectAsync; + exports.ip = ip; + exports.ipv4 = ipv4; + exports.ipv6 = ipv6; + exports.is = is; + exports.isOfKind = isOfKind; + exports.isOfType = isOfType; + exports.isValiError = isValiError; + exports.isoDate = isoDate; + exports.isoDateTime = isoDateTime; + exports.isoTime = isoTime; + exports.isoTimeSecond = isoTimeSecond; + exports.isoTimestamp = isoTimestamp; + exports.isoWeek = isoWeek; + exports.keyof = keyof; + exports.lazy = lazy; + exports.lazyAsync = lazyAsync; + exports.length = length; + exports.literal = literal; + exports.looseObject = looseObject; + exports.looseObjectAsync = looseObjectAsync; + exports.looseTuple = looseTuple; + exports.looseTupleAsync = looseTupleAsync; + exports.ltValue = ltValue; + exports.mac = mac; + exports.mac48 = mac48; + exports.mac64 = mac64; + exports.map = map; + exports.mapAsync = mapAsync; + exports.mapItems = mapItems; + exports.maxBytes = maxBytes; + exports.maxEntries = maxEntries; + exports.maxGraphemes = maxGraphemes; + exports.maxLength = maxLength; + exports.maxSize = maxSize; + exports.maxValue = maxValue; + exports.maxWords = maxWords; + exports.message = message; + exports.metadata = metadata; + exports.mimeType = mimeType; + exports.minBytes = minBytes; + exports.minEntries = minEntries; + exports.minGraphemes = minGraphemes; + exports.minLength = minLength; + exports.minSize = minSize; + exports.minValue = minValue; + exports.minWords = minWords; + exports.multipleOf = multipleOf; + exports.nan = nan; + exports.nanoid = nanoid; + exports.never = never; + exports.nonEmpty = nonEmpty; + exports.nonNullable = nonNullable; + exports.nonNullableAsync = nonNullableAsync; + exports.nonNullish = nonNullish; + exports.nonNullishAsync = nonNullishAsync; + exports.nonOptional = nonOptional; + exports.nonOptionalAsync = nonOptionalAsync; + exports.normalize = normalize; + exports.notBytes = notBytes; + exports.notEntries = notEntries; + exports.notGraphemes = notGraphemes; + exports.notLength = notLength; + exports.notSize = notSize; + exports.notValue = notValue; + exports.notValues = notValues; + exports.notWords = notWords; + exports.null = null_; + exports.null_ = null_; + exports.nullable = nullable; + exports.nullableAsync = nullableAsync; + exports.nullish = nullish; + exports.nullishAsync = nullishAsync; + exports.number = number; + exports.object = object; + exports.objectAsync = objectAsync; + exports.objectWithRest = objectWithRest; + exports.objectWithRestAsync = objectWithRestAsync; + exports.octal = octal; + exports.omit = omit; + exports.optional = optional; + exports.optionalAsync = optionalAsync; + exports.parse = parse; + exports.parseAsync = parseAsync; + exports.parseJson = parseJson; + exports.parser = parser; + exports.parserAsync = parserAsync; + exports.partial = partial; + exports.partialAsync = partialAsync; + exports.partialCheck = partialCheck; + exports.partialCheckAsync = partialCheckAsync; + exports.pick = pick; + exports.picklist = picklist; + exports.pipe = pipe; + exports.pipeAsync = pipeAsync; + exports.promise = promise; + exports.rawCheck = rawCheck; + exports.rawCheckAsync = rawCheckAsync; + exports.rawTransform = rawTransform; + exports.rawTransformAsync = rawTransformAsync; + exports.readonly = readonly; + exports.record = record; + exports.recordAsync = recordAsync; + exports.reduceItems = reduceItems; + exports.regex = regex; + exports.required = required; + exports.requiredAsync = requiredAsync; + exports.returns = returns; + exports.returnsAsync = returnsAsync; + exports.rfcEmail = rfcEmail; + exports.safeInteger = safeInteger; + exports.safeParse = safeParse; + exports.safeParseAsync = safeParseAsync; + exports.safeParser = safeParser; + exports.safeParserAsync = safeParserAsync; + exports.set = set; + exports.setAsync = setAsync; + exports.setGlobalConfig = setGlobalConfig; + exports.setGlobalMessage = setGlobalMessage; + exports.setSchemaMessage = setSchemaMessage; + exports.setSpecificMessage = setSpecificMessage; + exports.size = size; + exports.slug = slug; + exports.someItem = someItem; + exports.sortItems = sortItems; + exports.startsWith = startsWith; + exports.strictObject = strictObject; + exports.strictObjectAsync = strictObjectAsync; + exports.strictTuple = strictTuple; + exports.strictTupleAsync = strictTupleAsync; + exports.string = string; + exports.stringifyJson = stringifyJson; + exports.summarize = summarize; + exports.symbol = symbol; + exports.title = title; + exports.toBigint = toBigint; + exports.toBoolean = toBoolean; + exports.toDate = toDate; + exports.toLowerCase = toLowerCase; + exports.toMaxValue = toMaxValue; + exports.toMinValue = toMinValue; + exports.toNumber = toNumber; + exports.toString = toString; + exports.toUpperCase = toUpperCase; + exports.transform = transform; + exports.transformAsync = transformAsync; + exports.trim = trim; + exports.trimEnd = trimEnd; + exports.trimStart = trimStart; + exports.tuple = tuple; + exports.tupleAsync = tupleAsync; + exports.tupleWithRest = tupleWithRest; + exports.tupleWithRestAsync = tupleWithRestAsync; + exports.ulid = ulid; + exports.undefined = undefined_; + exports.undefined_ = undefined_; + exports.undefinedable = undefinedable; + exports.undefinedableAsync = undefinedableAsync; + exports.union = union; + exports.unionAsync = unionAsync; + exports.unknown = unknown; + exports.unwrap = unwrap; + exports.url = url; + exports.uuid = uuid; + exports.value = value; + exports.values = values; + exports.variant = variant; + exports.variantAsync = variantAsync; + exports.void = void_; + exports.void_ = void_; + exports.words = words; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isArray.js +var require_isArray = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isArray.js"(exports, module) { + "use strict"; + var isArray = Array.isArray; + module.exports = isArray; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_freeGlobal.js +var require_freeGlobal = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_freeGlobal.js"(exports, module) { + "use strict"; + var freeGlobal = typeof global == "object" && global && global.Object === Object && global; + module.exports = freeGlobal; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_root.js +var require_root = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_root.js"(exports, module) { + "use strict"; + var freeGlobal = require_freeGlobal(); + var freeSelf = typeof self == "object" && self && self.Object === Object && self; + var root = freeGlobal || freeSelf || Function("return this")(); + module.exports = root; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_Symbol.js +var require_Symbol = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_Symbol.js"(exports, module) { + "use strict"; + var root = require_root(); + var Symbol2 = root.Symbol; + module.exports = Symbol2; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_getRawTag.js +var require_getRawTag = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_getRawTag.js"(exports, module) { + "use strict"; + var Symbol2 = require_Symbol(); + var objectProto = Object.prototype; + var hasOwnProperty = objectProto.hasOwnProperty; + var nativeObjectToString = objectProto.toString; + var symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0; + function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag]; + try { + value[symToStringTag] = void 0; + var unmasked = true; + } catch (e) { + } + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; + } + module.exports = getRawTag; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_objectToString.js +var require_objectToString = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_objectToString.js"(exports, module) { + "use strict"; + var objectProto = Object.prototype; + var nativeObjectToString = objectProto.toString; + function objectToString(value) { + return nativeObjectToString.call(value); + } + module.exports = objectToString; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseGetTag.js +var require_baseGetTag = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseGetTag.js"(exports, module) { + "use strict"; + var Symbol2 = require_Symbol(); + var getRawTag = require_getRawTag(); + var objectToString = require_objectToString(); + var nullTag = "[object Null]"; + var undefinedTag = "[object Undefined]"; + var symToStringTag = Symbol2 ? Symbol2.toStringTag : void 0; + function baseGetTag(value) { + if (value == null) { + return value === void 0 ? undefinedTag : nullTag; + } + return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value); + } + module.exports = baseGetTag; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isObjectLike.js +var require_isObjectLike = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isObjectLike.js"(exports, module) { + "use strict"; + function isObjectLike(value) { + return value != null && typeof value == "object"; + } + module.exports = isObjectLike; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isSymbol.js +var require_isSymbol = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isSymbol.js"(exports, module) { + "use strict"; + var baseGetTag = require_baseGetTag(); + var isObjectLike = require_isObjectLike(); + var symbolTag = "[object Symbol]"; + function isSymbol(value) { + return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag; + } + module.exports = isSymbol; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_isKey.js +var require_isKey = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_isKey.js"(exports, module) { + "use strict"; + var isArray = require_isArray(); + var isSymbol = require_isSymbol(); + var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/; + var reIsPlainProp = /^\w*$/; + function isKey(value, object) { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object); + } + module.exports = isKey; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isObject.js +var require_isObject = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isObject.js"(exports, module) { + "use strict"; + function isObject(value) { + var type = typeof value; + return value != null && (type == "object" || type == "function"); + } + module.exports = isObject; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isFunction.js +var require_isFunction = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isFunction.js"(exports, module) { + "use strict"; + var baseGetTag = require_baseGetTag(); + var isObject = require_isObject(); + var asyncTag = "[object AsyncFunction]"; + var funcTag = "[object Function]"; + var genTag = "[object GeneratorFunction]"; + var proxyTag = "[object Proxy]"; + function isFunction(value) { + if (!isObject(value)) { + return false; + } + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; + } + module.exports = isFunction; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_coreJsData.js +var require_coreJsData = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_coreJsData.js"(exports, module) { + "use strict"; + var root = require_root(); + var coreJsData = root["__core-js_shared__"]; + module.exports = coreJsData; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_isMasked.js +var require_isMasked = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_isMasked.js"(exports, module) { + "use strict"; + var coreJsData = require_coreJsData(); + var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ""); + return uid ? "Symbol(src)_1." + uid : ""; + })(); + function isMasked(func) { + return !!maskSrcKey && maskSrcKey in func; + } + module.exports = isMasked; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_toSource.js +var require_toSource = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_toSource.js"(exports, module) { + "use strict"; + var funcProto = Function.prototype; + var funcToString = funcProto.toString; + function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) { + } + try { + return func + ""; + } catch (e) { + } + } + return ""; + } + module.exports = toSource; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseIsNative.js +var require_baseIsNative = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseIsNative.js"(exports, module) { + "use strict"; + var isFunction = require_isFunction(); + var isMasked = require_isMasked(); + var isObject = require_isObject(); + var toSource = require_toSource(); + var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + var reIsHostCtor = /^\[object .+?Constructor\]$/; + var funcProto = Function.prototype; + var objectProto = Object.prototype; + var funcToString = funcProto.toString; + var hasOwnProperty = objectProto.hasOwnProperty; + var reIsNative = RegExp( + "^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" + ); + function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); + } + module.exports = baseIsNative; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_getValue.js +var require_getValue = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_getValue.js"(exports, module) { + "use strict"; + function getValue(object, key) { + return object == null ? void 0 : object[key]; + } + module.exports = getValue; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_getNative.js +var require_getNative = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_getNative.js"(exports, module) { + "use strict"; + var baseIsNative = require_baseIsNative(); + var getValue = require_getValue(); + function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : void 0; + } + module.exports = getNative; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_nativeCreate.js +var require_nativeCreate = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_nativeCreate.js"(exports, module) { + "use strict"; + var getNative = require_getNative(); + var nativeCreate = getNative(Object, "create"); + module.exports = nativeCreate; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_hashClear.js +var require_hashClear = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_hashClear.js"(exports, module) { + "use strict"; + var nativeCreate = require_nativeCreate(); + function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; + } + module.exports = hashClear; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_hashDelete.js +var require_hashDelete = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_hashDelete.js"(exports, module) { + "use strict"; + function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; + } + module.exports = hashDelete; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_hashGet.js +var require_hashGet = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_hashGet.js"(exports, module) { + "use strict"; + var nativeCreate = require_nativeCreate(); + var HASH_UNDEFINED = "__lodash_hash_undefined__"; + var objectProto = Object.prototype; + var hasOwnProperty = objectProto.hasOwnProperty; + function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? void 0 : result; + } + return hasOwnProperty.call(data, key) ? data[key] : void 0; + } + module.exports = hashGet; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_hashHas.js +var require_hashHas = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_hashHas.js"(exports, module) { + "use strict"; + var nativeCreate = require_nativeCreate(); + var objectProto = Object.prototype; + var hasOwnProperty = objectProto.hasOwnProperty; + function hashHas(key) { + var data = this.__data__; + return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key); + } + module.exports = hashHas; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_hashSet.js +var require_hashSet = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_hashSet.js"(exports, module) { + "use strict"; + var nativeCreate = require_nativeCreate(); + var HASH_UNDEFINED = "__lodash_hash_undefined__"; + function hashSet(key, value) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value; + return this; + } + module.exports = hashSet; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_Hash.js +var require_Hash = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_Hash.js"(exports, module) { + "use strict"; + var hashClear = require_hashClear(); + var hashDelete = require_hashDelete(); + var hashGet = require_hashGet(); + var hashHas = require_hashHas(); + var hashSet = require_hashSet(); + function Hash(entries) { + var index2 = -1, length = entries == null ? 0 : entries.length; + this.clear(); + while (++index2 < length) { + var entry = entries[index2]; + this.set(entry[0], entry[1]); + } + } + Hash.prototype.clear = hashClear; + Hash.prototype["delete"] = hashDelete; + Hash.prototype.get = hashGet; + Hash.prototype.has = hashHas; + Hash.prototype.set = hashSet; + module.exports = Hash; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_listCacheClear.js +var require_listCacheClear = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_listCacheClear.js"(exports, module) { + "use strict"; + function listCacheClear() { + this.__data__ = []; + this.size = 0; + } + module.exports = listCacheClear; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/eq.js +var require_eq = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/eq.js"(exports, module) { + "use strict"; + function eq(value, other) { + return value === other || value !== value && other !== other; + } + module.exports = eq; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_assocIndexOf.js +var require_assocIndexOf = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_assocIndexOf.js"(exports, module) { + "use strict"; + var eq = require_eq(); + function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; + } + module.exports = assocIndexOf; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_listCacheDelete.js +var require_listCacheDelete = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_listCacheDelete.js"(exports, module) { + "use strict"; + var assocIndexOf = require_assocIndexOf(); + var arrayProto = Array.prototype; + var splice = arrayProto.splice; + function listCacheDelete(key) { + var data = this.__data__, index2 = assocIndexOf(data, key); + if (index2 < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index2 == lastIndex) { + data.pop(); + } else { + splice.call(data, index2, 1); + } + --this.size; + return true; + } + module.exports = listCacheDelete; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_listCacheGet.js +var require_listCacheGet = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_listCacheGet.js"(exports, module) { + "use strict"; + var assocIndexOf = require_assocIndexOf(); + function listCacheGet(key) { + var data = this.__data__, index2 = assocIndexOf(data, key); + return index2 < 0 ? void 0 : data[index2][1]; + } + module.exports = listCacheGet; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_listCacheHas.js +var require_listCacheHas = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_listCacheHas.js"(exports, module) { + "use strict"; + var assocIndexOf = require_assocIndexOf(); + function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; + } + module.exports = listCacheHas; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_listCacheSet.js +var require_listCacheSet = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_listCacheSet.js"(exports, module) { + "use strict"; + var assocIndexOf = require_assocIndexOf(); + function listCacheSet(key, value) { + var data = this.__data__, index2 = assocIndexOf(data, key); + if (index2 < 0) { + ++this.size; + data.push([key, value]); + } else { + data[index2][1] = value; + } + return this; + } + module.exports = listCacheSet; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_ListCache.js +var require_ListCache = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_ListCache.js"(exports, module) { + "use strict"; + var listCacheClear = require_listCacheClear(); + var listCacheDelete = require_listCacheDelete(); + var listCacheGet = require_listCacheGet(); + var listCacheHas = require_listCacheHas(); + var listCacheSet = require_listCacheSet(); + function ListCache(entries) { + var index2 = -1, length = entries == null ? 0 : entries.length; + this.clear(); + while (++index2 < length) { + var entry = entries[index2]; + this.set(entry[0], entry[1]); + } + } + ListCache.prototype.clear = listCacheClear; + ListCache.prototype["delete"] = listCacheDelete; + ListCache.prototype.get = listCacheGet; + ListCache.prototype.has = listCacheHas; + ListCache.prototype.set = listCacheSet; + module.exports = ListCache; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_Map.js +var require_Map = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_Map.js"(exports, module) { + "use strict"; + var getNative = require_getNative(); + var root = require_root(); + var Map2 = getNative(root, "Map"); + module.exports = Map2; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_mapCacheClear.js +var require_mapCacheClear = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_mapCacheClear.js"(exports, module) { + "use strict"; + var Hash = require_Hash(); + var ListCache = require_ListCache(); + var Map2 = require_Map(); + function mapCacheClear() { + this.size = 0; + this.__data__ = { + "hash": new Hash(), + "map": new (Map2 || ListCache)(), + "string": new Hash() + }; + } + module.exports = mapCacheClear; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_isKeyable.js +var require_isKeyable = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_isKeyable.js"(exports, module) { + "use strict"; + function isKeyable(value) { + var type = typeof value; + return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null; + } + module.exports = isKeyable; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_getMapData.js +var require_getMapData = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_getMapData.js"(exports, module) { + "use strict"; + var isKeyable = require_isKeyable(); + function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map; + } + module.exports = getMapData; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_mapCacheDelete.js +var require_mapCacheDelete = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_mapCacheDelete.js"(exports, module) { + "use strict"; + var getMapData = require_getMapData(); + function mapCacheDelete(key) { + var result = getMapData(this, key)["delete"](key); + this.size -= result ? 1 : 0; + return result; + } + module.exports = mapCacheDelete; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_mapCacheGet.js +var require_mapCacheGet = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_mapCacheGet.js"(exports, module) { + "use strict"; + var getMapData = require_getMapData(); + function mapCacheGet(key) { + return getMapData(this, key).get(key); + } + module.exports = mapCacheGet; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_mapCacheHas.js +var require_mapCacheHas = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_mapCacheHas.js"(exports, module) { + "use strict"; + var getMapData = require_getMapData(); + function mapCacheHas(key) { + return getMapData(this, key).has(key); + } + module.exports = mapCacheHas; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_mapCacheSet.js +var require_mapCacheSet = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_mapCacheSet.js"(exports, module) { + "use strict"; + var getMapData = require_getMapData(); + function mapCacheSet(key, value) { + var data = getMapData(this, key), size = data.size; + data.set(key, value); + this.size += data.size == size ? 0 : 1; + return this; + } + module.exports = mapCacheSet; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_MapCache.js +var require_MapCache = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_MapCache.js"(exports, module) { + "use strict"; + var mapCacheClear = require_mapCacheClear(); + var mapCacheDelete = require_mapCacheDelete(); + var mapCacheGet = require_mapCacheGet(); + var mapCacheHas = require_mapCacheHas(); + var mapCacheSet = require_mapCacheSet(); + function MapCache(entries) { + var index2 = -1, length = entries == null ? 0 : entries.length; + this.clear(); + while (++index2 < length) { + var entry = entries[index2]; + this.set(entry[0], entry[1]); + } + } + MapCache.prototype.clear = mapCacheClear; + MapCache.prototype["delete"] = mapCacheDelete; + MapCache.prototype.get = mapCacheGet; + MapCache.prototype.has = mapCacheHas; + MapCache.prototype.set = mapCacheSet; + module.exports = MapCache; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/memoize.js +var require_memoize = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/memoize.js"(exports, module) { + "use strict"; + var MapCache = require_MapCache(); + var FUNC_ERROR_TEXT = "Expected a function"; + function memoize(func, resolver) { + if (typeof func != "function" || resolver != null && typeof resolver != "function") { + throw new TypeError(FUNC_ERROR_TEXT); + } + var memoized = function() { + var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache; + if (cache.has(key)) { + return cache.get(key); + } + var result = func.apply(this, args); + memoized.cache = cache.set(key, result) || cache; + return result; + }; + memoized.cache = new (memoize.Cache || MapCache)(); + return memoized; + } + memoize.Cache = MapCache; + module.exports = memoize; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_memoizeCapped.js +var require_memoizeCapped = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_memoizeCapped.js"(exports, module) { + "use strict"; + var memoize = require_memoize(); + var MAX_MEMOIZE_SIZE = 500; + function memoizeCapped(func) { + var result = memoize(func, function(key) { + if (cache.size === MAX_MEMOIZE_SIZE) { + cache.clear(); + } + return key; + }); + var cache = result.cache; + return result; + } + module.exports = memoizeCapped; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_stringToPath.js +var require_stringToPath = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_stringToPath.js"(exports, module) { + "use strict"; + var memoizeCapped = require_memoizeCapped(); + var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + var reEscapeChar = /\\(\\)?/g; + var stringToPath = memoizeCapped(function(string) { + var result = []; + if (string.charCodeAt(0) === 46) { + result.push(""); + } + string.replace(rePropName, function(match, number, quote, subString) { + result.push(quote ? subString.replace(reEscapeChar, "$1") : number || match); + }); + return result; + }); + module.exports = stringToPath; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_arrayMap.js +var require_arrayMap = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_arrayMap.js"(exports, module) { + "use strict"; + function arrayMap(array, iteratee) { + var index2 = -1, length = array == null ? 0 : array.length, result = Array(length); + while (++index2 < length) { + result[index2] = iteratee(array[index2], index2, array); + } + return result; + } + module.exports = arrayMap; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseToString.js +var require_baseToString = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseToString.js"(exports, module) { + "use strict"; + var Symbol2 = require_Symbol(); + var arrayMap = require_arrayMap(); + var isArray = require_isArray(); + var isSymbol = require_isSymbol(); + var INFINITY = 1 / 0; + var symbolProto = Symbol2 ? Symbol2.prototype : void 0; + var symbolToString = symbolProto ? symbolProto.toString : void 0; + function baseToString(value) { + if (typeof value == "string") { + return value; + } + if (isArray(value)) { + return arrayMap(value, baseToString) + ""; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ""; + } + var result = value + ""; + return result == "0" && 1 / value == -INFINITY ? "-0" : result; + } + module.exports = baseToString; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/toString.js +var require_toString = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/toString.js"(exports, module) { + "use strict"; + var baseToString = require_baseToString(); + function toString(value) { + return value == null ? "" : baseToString(value); + } + module.exports = toString; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_castPath.js +var require_castPath = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_castPath.js"(exports, module) { + "use strict"; + var isArray = require_isArray(); + var isKey = require_isKey(); + var stringToPath = require_stringToPath(); + var toString = require_toString(); + function castPath(value, object) { + if (isArray(value)) { + return value; + } + return isKey(value, object) ? [value] : stringToPath(toString(value)); + } + module.exports = castPath; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_toKey.js +var require_toKey = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_toKey.js"(exports, module) { + "use strict"; + var isSymbol = require_isSymbol(); + var INFINITY = 1 / 0; + function toKey(value) { + if (typeof value == "string" || isSymbol(value)) { + return value; + } + var result = value + ""; + return result == "0" && 1 / value == -INFINITY ? "-0" : result; + } + module.exports = toKey; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseGet.js +var require_baseGet = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseGet.js"(exports, module) { + "use strict"; + var castPath = require_castPath(); + var toKey = require_toKey(); + function baseGet(object, path2) { + path2 = castPath(path2, object); + var index2 = 0, length = path2.length; + while (object != null && index2 < length) { + object = object[toKey(path2[index2++])]; + } + return index2 && index2 == length ? object : void 0; + } + module.exports = baseGet; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_defineProperty.js +var require_defineProperty = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_defineProperty.js"(exports, module) { + "use strict"; + var getNative = require_getNative(); + var defineProperty = (function() { + try { + var func = getNative(Object, "defineProperty"); + func({}, "", {}); + return func; + } catch (e) { + } + })(); + module.exports = defineProperty; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseAssignValue.js +var require_baseAssignValue = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseAssignValue.js"(exports, module) { + "use strict"; + var defineProperty = require_defineProperty(); + function baseAssignValue(object, key, value) { + if (key == "__proto__" && defineProperty) { + defineProperty(object, key, { + "configurable": true, + "enumerable": true, + "value": value, + "writable": true + }); + } else { + object[key] = value; + } + } + module.exports = baseAssignValue; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_assignValue.js +var require_assignValue = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_assignValue.js"(exports, module) { + "use strict"; + var baseAssignValue = require_baseAssignValue(); + var eq = require_eq(); + var objectProto = Object.prototype; + var hasOwnProperty = objectProto.hasOwnProperty; + function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) { + baseAssignValue(object, key, value); + } + } + module.exports = assignValue; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_isIndex.js +var require_isIndex = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_isIndex.js"(exports, module) { + "use strict"; + var MAX_SAFE_INTEGER = 9007199254740991; + var reIsUint = /^(?:0|[1-9]\d*)$/; + function isIndex(value, length) { + var type = typeof value; + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length); + } + module.exports = isIndex; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseSet.js +var require_baseSet = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseSet.js"(exports, module) { + "use strict"; + var assignValue = require_assignValue(); + var castPath = require_castPath(); + var isIndex = require_isIndex(); + var isObject = require_isObject(); + var toKey = require_toKey(); + function baseSet(object, path2, value, customizer) { + if (!isObject(object)) { + return object; + } + path2 = castPath(path2, object); + var index2 = -1, length = path2.length, lastIndex = length - 1, nested = object; + while (nested != null && ++index2 < length) { + var key = toKey(path2[index2]), newValue = value; + if (key === "__proto__" || key === "constructor" || key === "prototype") { + return object; + } + if (index2 != lastIndex) { + var objValue = nested[key]; + newValue = customizer ? customizer(objValue, key, nested) : void 0; + if (newValue === void 0) { + newValue = isObject(objValue) ? objValue : isIndex(path2[index2 + 1]) ? [] : {}; + } + } + assignValue(nested, key, newValue); + nested = nested[key]; + } + return object; + } + module.exports = baseSet; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_basePickBy.js +var require_basePickBy = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_basePickBy.js"(exports, module) { + "use strict"; + var baseGet = require_baseGet(); + var baseSet = require_baseSet(); + var castPath = require_castPath(); + function basePickBy(object, paths, predicate) { + var index2 = -1, length = paths.length, result = {}; + while (++index2 < length) { + var path2 = paths[index2], value = baseGet(object, path2); + if (predicate(value, path2)) { + baseSet(result, castPath(path2, object), value); + } + } + return result; + } + module.exports = basePickBy; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseHasIn.js +var require_baseHasIn = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseHasIn.js"(exports, module) { + "use strict"; + function baseHasIn(object, key) { + return object != null && key in Object(object); + } + module.exports = baseHasIn; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseIsArguments.js +var require_baseIsArguments = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseIsArguments.js"(exports, module) { + "use strict"; + var baseGetTag = require_baseGetTag(); + var isObjectLike = require_isObjectLike(); + var argsTag = "[object Arguments]"; + function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; + } + module.exports = baseIsArguments; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isArguments.js +var require_isArguments = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isArguments.js"(exports, module) { + "use strict"; + var baseIsArguments = require_baseIsArguments(); + var isObjectLike = require_isObjectLike(); + var objectProto = Object.prototype; + var hasOwnProperty = objectProto.hasOwnProperty; + var propertyIsEnumerable = objectProto.propertyIsEnumerable; + var isArguments = baseIsArguments(/* @__PURE__ */ (function() { + return arguments; + })()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee"); + }; + module.exports = isArguments; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isLength.js +var require_isLength = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/isLength.js"(exports, module) { + "use strict"; + var MAX_SAFE_INTEGER = 9007199254740991; + function isLength(value) { + return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + module.exports = isLength; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_hasPath.js +var require_hasPath = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_hasPath.js"(exports, module) { + "use strict"; + var castPath = require_castPath(); + var isArguments = require_isArguments(); + var isArray = require_isArray(); + var isIndex = require_isIndex(); + var isLength = require_isLength(); + var toKey = require_toKey(); + function hasPath(object, path2, hasFunc) { + path2 = castPath(path2, object); + var index2 = -1, length = path2.length, result = false; + while (++index2 < length) { + var key = toKey(path2[index2]); + if (!(result = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; + } + if (result || ++index2 != length) { + return result; + } + length = object == null ? 0 : object.length; + return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object)); + } + module.exports = hasPath; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/hasIn.js +var require_hasIn = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/hasIn.js"(exports, module) { + "use strict"; + var baseHasIn = require_baseHasIn(); + var hasPath = require_hasPath(); + function hasIn(object, path2) { + return object != null && hasPath(object, path2, baseHasIn); + } + module.exports = hasIn; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_basePick.js +var require_basePick = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_basePick.js"(exports, module) { + "use strict"; + var basePickBy = require_basePickBy(); + var hasIn = require_hasIn(); + function basePick(object, paths) { + return basePickBy(object, paths, function(value, path2) { + return hasIn(object, path2); + }); + } + module.exports = basePick; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_arrayPush.js +var require_arrayPush = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_arrayPush.js"(exports, module) { + "use strict"; + function arrayPush(array, values) { + var index2 = -1, length = values.length, offset = array.length; + while (++index2 < length) { + array[offset + index2] = values[index2]; + } + return array; + } + module.exports = arrayPush; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_isFlattenable.js +var require_isFlattenable = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_isFlattenable.js"(exports, module) { + "use strict"; + var Symbol2 = require_Symbol(); + var isArguments = require_isArguments(); + var isArray = require_isArray(); + var spreadableSymbol = Symbol2 ? Symbol2.isConcatSpreadable : void 0; + function isFlattenable(value) { + return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]); + } + module.exports = isFlattenable; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseFlatten.js +var require_baseFlatten = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseFlatten.js"(exports, module) { + "use strict"; + var arrayPush = require_arrayPush(); + var isFlattenable = require_isFlattenable(); + function baseFlatten(array, depth, predicate, isStrict, result) { + var index2 = -1, length = array.length; + predicate || (predicate = isFlattenable); + result || (result = []); + while (++index2 < length) { + var value = array[index2]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; + } + module.exports = baseFlatten; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/flatten.js +var require_flatten = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/flatten.js"(exports, module) { + "use strict"; + var baseFlatten = require_baseFlatten(); + function flatten(array) { + var length = array == null ? 0 : array.length; + return length ? baseFlatten(array, 1) : []; + } + module.exports = flatten; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_apply.js +var require_apply = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_apply.js"(exports, module) { + "use strict"; + function apply(func, thisArg, args) { + switch (args.length) { + case 0: + return func.call(thisArg); + case 1: + return func.call(thisArg, args[0]); + case 2: + return func.call(thisArg, args[0], args[1]); + case 3: + return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); + } + module.exports = apply; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_overRest.js +var require_overRest = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_overRest.js"(exports, module) { + "use strict"; + var apply = require_apply(); + var nativeMax = Math.max; + function overRest(func, start, transform) { + start = nativeMax(start === void 0 ? func.length - 1 : start, 0); + return function() { + var args = arguments, index2 = -1, length = nativeMax(args.length - start, 0), array = Array(length); + while (++index2 < length) { + array[index2] = args[start + index2]; + } + index2 = -1; + var otherArgs = Array(start + 1); + while (++index2 < start) { + otherArgs[index2] = args[index2]; + } + otherArgs[start] = transform(array); + return apply(func, this, otherArgs); + }; + } + module.exports = overRest; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/constant.js +var require_constant = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/constant.js"(exports, module) { + "use strict"; + function constant(value) { + return function() { + return value; + }; + } + module.exports = constant; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/identity.js +var require_identity = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/identity.js"(exports, module) { + "use strict"; + function identity(value) { + return value; + } + module.exports = identity; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseSetToString.js +var require_baseSetToString = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_baseSetToString.js"(exports, module) { + "use strict"; + var constant = require_constant(); + var defineProperty = require_defineProperty(); + var identity = require_identity(); + var baseSetToString = !defineProperty ? identity : function(func, string) { + return defineProperty(func, "toString", { + "configurable": true, + "enumerable": false, + "value": constant(string), + "writable": true + }); + }; + module.exports = baseSetToString; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_shortOut.js +var require_shortOut = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_shortOut.js"(exports, module) { + "use strict"; + var HOT_COUNT = 800; + var HOT_SPAN = 16; + var nativeNow = Date.now; + function shortOut(func) { + var count = 0, lastCalled = 0; + return function() { + var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled); + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return arguments[0]; + } + } else { + count = 0; + } + return func.apply(void 0, arguments); + }; + } + module.exports = shortOut; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_setToString.js +var require_setToString = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_setToString.js"(exports, module) { + "use strict"; + var baseSetToString = require_baseSetToString(); + var shortOut = require_shortOut(); + var setToString = shortOut(baseSetToString); + module.exports = setToString; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_flatRest.js +var require_flatRest = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/_flatRest.js"(exports, module) { + "use strict"; + var flatten = require_flatten(); + var overRest = require_overRest(); + var setToString = require_setToString(); + function flatRest(func) { + return setToString(overRest(func, void 0, flatten), func + ""); + } + module.exports = flatRest; + } +}); + +// ../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/pick.js +var require_pick = __commonJS({ + "../../node_modules/.pnpm/lodash@4.18.1/node_modules/lodash/pick.js"(exports, module) { + "use strict"; + var basePick = require_basePick(); + var flatRest = require_flatRest(); + var pick = flatRest(function(object, paths) { + return object == null ? {} : basePick(object, paths); + }); + module.exports = pick; + } +}); + +// ../../node_modules/.pnpm/@react-router+dev@7.14.0_@react-router+serve@7.14.0_react-router@7.14.0_react-dom@19.2._ec11c05ad7feecef203217fd751c918f/node_modules/@react-router/dev/dist/routes.js +var require_routes = __commonJS({ + "../../node_modules/.pnpm/@react-router+dev@7.14.0_@react-router+serve@7.14.0_react-router@7.14.0_react-dom@19.2._ec11c05ad7feecef203217fd751c918f/node_modules/@react-router/dev/dist/routes.js"(exports, module) { + "use strict"; + var __create2 = Object.create; + var __defProp2 = Object.defineProperty; + var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; + var __getOwnPropNames2 = Object.getOwnPropertyNames; + var __getProtoOf2 = Object.getPrototypeOf; + var __hasOwnProp2 = Object.prototype.hasOwnProperty; + var __export = (target, all) => { + for (var name in all) + __defProp2(target, name, { get: all[name], enumerable: true }); + }; + var __copyProps2 = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames2(from)) + if (!__hasOwnProp2.call(to, key) && key !== except) + __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); + } + return to; + }; + var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target, + mod + )); + var __toCommonJS = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); + var routes_exports = {}; + __export(routes_exports, { + getAppDirectory: () => getAppDirectory, + index: () => index2, + layout: () => layout2, + prefix: () => prefix2, + relative: () => relative2, + route: () => route2 + }); + module.exports = __toCommonJS(routes_exports); + var Path = __toESM2(require_dist()); + var v = __toESM2(require_dist2()); + var import_pick = __toESM2(require_pick()); + function invariant(value, message) { + if (value === false || value === null || typeof value === "undefined") { + console.error( + "The following error is a bug in React Router; please open an issue! https://github.com/remix-run/react-router/issues/new/choose" + ); + throw new Error(message); + } + } + function getAppDirectory() { + invariant(globalThis.__reactRouterAppDirectory); + return globalThis.__reactRouterAppDirectory; + } + var routeConfigEntrySchema = v.pipe( + v.custom((value) => { + return !(typeof value === "object" && value !== null && "then" in value && "catch" in value); + }, "Invalid type: Expected object but received a promise. Did you forget to await?"), + v.object({ + id: v.optional( + v.pipe( + v.string(), + v.notValue("root", "A route cannot use the reserved id 'root'.") + ) + ), + path: v.optional(v.string()), + index: v.optional(v.boolean()), + caseSensitive: v.optional(v.boolean()), + file: v.string(), + children: v.optional(v.array(v.lazy(() => routeConfigEntrySchema))) + }) + ); + var resolvedRouteConfigSchema = v.array(routeConfigEntrySchema); + var createConfigRouteOptionKeys = [ + "id", + "index", + "caseSensitive" + ]; + function route2(path2, file, optionsOrChildren, children) { + let options = {}; + if (Array.isArray(optionsOrChildren) || !optionsOrChildren) { + children = optionsOrChildren; + } else { + options = optionsOrChildren; + } + return { + file, + children, + path: path2 ?? void 0, + ...(0, import_pick.default)(options, createConfigRouteOptionKeys) + }; + } + var createIndexOptionKeys = ["id"]; + function index2(file, options) { + return { + file, + index: true, + ...(0, import_pick.default)(options, createIndexOptionKeys) + }; + } + var createLayoutOptionKeys = ["id"]; + function layout2(file, optionsOrChildren, children) { + let options = {}; + if (Array.isArray(optionsOrChildren) || !optionsOrChildren) { + children = optionsOrChildren; + } else { + options = optionsOrChildren; + } + return { + file, + children, + ...(0, import_pick.default)(options, createLayoutOptionKeys) + }; + } + function prefix2(prefixPath, routes) { + return routes.map((route22) => { + if (route22.index || typeof route22.path === "string") { + return { + ...route22, + path: route22.path ? joinRoutePaths(prefixPath, route22.path) : prefixPath, + children: route22.children + }; + } else if (route22.children) { + return { + ...route22, + children: prefix2(prefixPath, route22.children) + }; + } + return route22; + }); + } + function relative2(directory) { + return { + /** + * Helper function for creating a route config entry, for use within + * `routes.ts`. Note that this helper has been scoped, meaning that file + * path will be resolved relative to the directory provided to the + * `relative` call that created this helper. + */ + route: (path2, file, ...rest) => { + return route2(path2, Path.resolve(directory, file), ...rest); + }, + /** + * Helper function for creating a route config entry for an index route, for + * use within `routes.ts`. Note that this helper has been scoped, meaning + * that file path will be resolved relative to the directory provided to the + * `relative` call that created this helper. + */ + index: (file, ...rest) => { + return index2(Path.resolve(directory, file), ...rest); + }, + /** + * Helper function for creating a route config entry for a layout route, for + * use within `routes.ts`. Note that this helper has been scoped, meaning + * that file path will be resolved relative to the directory provided to the + * `relative` call that created this helper. + */ + layout: (file, ...rest) => { + return layout2(Path.resolve(directory, file), ...rest); + }, + // Passthrough of helper functions that don't need relative scoping so that + // a complete API is still provided. + prefix: prefix2 + }; + } + function joinRoutePaths(path1, path2) { + return [ + path1.replace(/\/+$/, ""), + // Remove trailing slashes + path2.replace(/^\/+/, "") + // Remove leading slashes + ].join("/"); + } + } +}); + +// src/index.ts +var import_routes = __toESM(require_routes(), 1); +import { createCookie, redirect } from "react-router"; +import path from "path"; +function getAddonRoutesConfig(routesConfig, addonsInfo) { + const resultRoutesConfig = []; + for (const routeConfig of routesConfig) { + if (routeConfig.type !== "prefix") { + const containsAddonModule = addonsInfo.find( + (addon) => routeConfig.file.includes(addon.name) + ); + if (containsAddonModule) { + routeConfig.file = path.join( + containsAddonModule.modulePath, + routeConfig.file.replace(containsAddonModule.name, "") + ); + } + } + switch (routeConfig.type) { + case "route": { + const children = routeConfig.children ? getAddonRoutesConfig( + routeConfig.children, + addonsInfo + ) : void 0; + resultRoutesConfig.push( + (0, import_routes.route)( + routeConfig.path, + routeConfig.file, + routeConfig.options || {}, + children + ) + ); + break; + } + case "index": + resultRoutesConfig.push((0, import_routes.index)(routeConfig.file, routeConfig.options)); + break; + case "layout": { + const children = routeConfig.children ? getAddonRoutesConfig( + routeConfig.children, + addonsInfo + ) : void 0; + resultRoutesConfig.push( + (0, import_routes.layout)(routeConfig.file, routeConfig.options || {}, children) + ); + break; + } + case "prefix": + resultRoutesConfig.push( + ...(0, import_routes.prefix)( + routeConfig.path, + getAddonRoutesConfig(routeConfig.children, addonsInfo) + ) + ); + break; + default: + break; + } + } + return resultRoutesConfig; +} +var secret = process.env.COOKIE_SECRET || "default"; +if (secret === "default" && process.env.NODE_ENV === "production") { + console.warn( + "\u{1F6A8} No COOKIE_SECRET environment variable set, using default. The app is insecure in production." + ); +} +var cookie = createCookie("auth_seven", { + secrets: [secret], + // 30 days + // maxAge: 30 * 24 * 60 * 60, + httpOnly: true, + secure: process.env.NODE_ENV === "production", + sameSite: "lax" +}); +async function getAuthFromRequest(request) { + let token; + try { + token = await cookie.parse(request.headers.get("Cookie")); + } catch { + } + return token ?? void 0; +} +async function setAuthOnResponse(response, token, options) { + const header = await cookie.serialize(token, options); + response.headers.append("Set-Cookie", header); + return response; +} +async function clearAuthOnResponse(response, options) { + const header = await getClearAuthCookieHeader(options); + response.headers.append("Set-Cookie", header); + return response; +} +async function getClearAuthCookieHeader(options) { + return await cookie.serialize("", { + maxAge: 0, + ...options + }); +} +async function requireAuthCookie(request) { + const token = await getAuthFromRequest(request); + if (!token) { + throw await redirectWithClearedCookie("/login"); + } + return token; +} +async function redirectIfLoggedInLoader({ + request +}) { + const token = await getAuthFromRequest(request); + if (token) { + throw redirect("/"); + } + return null; +} +async function redirectWithClearedCookie(url = "/") { + return clearAuthOnResponse(redirect(url)); +} +export { + clearAuthOnResponse, + cookie, + getAddonRoutesConfig, + getAuthFromRequest, + getClearAuthCookieHeader, + redirectIfLoggedInLoader, + redirectWithClearedCookie, + requireAuthCookie, + setAuthOnResponse +}; +/*! Bundled license information: + +@react-router/dev/dist/routes.js: + (** + * @react-router/dev v7.14.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + *) +*/ diff --git a/packages/registry/__tests__/fixtures/test-app/node_modules/@plone/layout/components/Logo/Logo.svg b/packages/registry/__tests__/fixtures/test-app/node_modules/@plone/layout/components/Logo/Logo.svg deleted file mode 100644 index 1aa6adfdf3b..00000000000 --- a/packages/registry/__tests__/fixtures/test-app/node_modules/@plone/layout/components/Logo/Logo.svg +++ /dev/null @@ -1 +0,0 @@ -asdasd diff --git a/packages/registry/__tests__/fixtures/test-app/node_modules/@plone/layout/index.js b/packages/registry/__tests__/fixtures/test-app/node_modules/@plone/layout/index.js deleted file mode 100644 index 8cb61d300ac..00000000000 --- a/packages/registry/__tests__/fixtures/test-app/node_modules/@plone/layout/index.js +++ /dev/null @@ -1 +0,0 @@ -export default (config) => config; diff --git a/packages/registry/__tests__/fixtures/test-app/node_modules/@plone/layout/package.json b/packages/registry/__tests__/fixtures/test-app/node_modules/@plone/layout/package.json deleted file mode 100644 index 40c09fe4ad0..00000000000 --- a/packages/registry/__tests__/fixtures/test-app/node_modules/@plone/layout/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "@plone/layout", - "main": "index.js" -} diff --git a/packages/registry/__tests__/fixtures/test-app/node_modules/my-addon/customizations/@plone/layout/components/Logo/Logo.svg b/packages/registry/__tests__/fixtures/test-app/node_modules/my-addon/customizations/@plone/layout/components/Logo/Logo.svg deleted file mode 100644 index 3e8fcacea68..00000000000 --- a/packages/registry/__tests__/fixtures/test-app/node_modules/my-addon/customizations/@plone/layout/components/Logo/Logo.svg +++ /dev/null @@ -1 +0,0 @@ - diff --git a/packages/registry/__tests__/fixtures/test-app/node_modules/my-addon/index.js b/packages/registry/__tests__/fixtures/test-app/node_modules/my-addon/index.js deleted file mode 100644 index 8cb61d300ac..00000000000 --- a/packages/registry/__tests__/fixtures/test-app/node_modules/my-addon/index.js +++ /dev/null @@ -1 +0,0 @@ -export default (config) => config; diff --git a/packages/registry/__tests__/fixtures/test-app/node_modules/my-addon/package.json b/packages/registry/__tests__/fixtures/test-app/node_modules/my-addon/package.json deleted file mode 100644 index ccf0c501c10..00000000000 --- a/packages/registry/__tests__/fixtures/test-app/node_modules/my-addon/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "my-addon", - "main": "index.js" -} diff --git a/packages/registry/__tests__/fixtures/test-volto-project/node_modules/@plone/volto/src/LanguageSwitcher.jsx b/packages/registry/__tests__/fixtures/test-volto-project/node_modules/@plone/volto/src/LanguageSwitcher.jsx deleted file mode 100644 index 8337712ea57..00000000000 --- a/packages/registry/__tests__/fixtures/test-volto-project/node_modules/@plone/volto/src/LanguageSwitcher.jsx +++ /dev/null @@ -1 +0,0 @@ -// diff --git a/packages/registry/__tests__/fixtures/test-volto-project/node_modules/@plone/volto/src/TSComponent.tsx b/packages/registry/__tests__/fixtures/test-volto-project/node_modules/@plone/volto/src/TSComponent.tsx deleted file mode 100644 index 8337712ea57..00000000000 --- a/packages/registry/__tests__/fixtures/test-volto-project/node_modules/@plone/volto/src/TSComponent.tsx +++ /dev/null @@ -1 +0,0 @@ -// diff --git a/packages/registry/__tests__/fixtures/test-volto-project/node_modules/@plone/volto/src/client.js b/packages/registry/__tests__/fixtures/test-volto-project/node_modules/@plone/volto/src/client.js deleted file mode 100644 index 0dae97301d2..00000000000 --- a/packages/registry/__tests__/fixtures/test-volto-project/node_modules/@plone/volto/src/client.js +++ /dev/null @@ -1 +0,0 @@ -//dummy file diff --git a/packages/registry/__tests__/fixtures/test-volto-project/node_modules/@plone/volto/src/routes.jsx b/packages/registry/__tests__/fixtures/test-volto-project/node_modules/@plone/volto/src/routes.jsx deleted file mode 100644 index 8337712ea57..00000000000 --- a/packages/registry/__tests__/fixtures/test-volto-project/node_modules/@plone/volto/src/routes.jsx +++ /dev/null @@ -1 +0,0 @@ -// diff --git a/packages/registry/__tests__/fixtures/test-volto-project/node_modules/@plone/volto/src/server.jsx b/packages/registry/__tests__/fixtures/test-volto-project/node_modules/@plone/volto/src/server.jsx deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/packages/registry/__tests__/fixtures/test-volto-project/node_modules/my-volto-config-addon-via-env-var/index.js b/packages/registry/__tests__/fixtures/test-volto-project/node_modules/my-volto-config-addon-via-env-var/index.js deleted file mode 100644 index 8cb61d300ac..00000000000 --- a/packages/registry/__tests__/fixtures/test-volto-project/node_modules/my-volto-config-addon-via-env-var/index.js +++ /dev/null @@ -1 +0,0 @@ -export default (config) => config; diff --git a/packages/registry/__tests__/fixtures/test-volto-project/node_modules/my-volto-config-addon-via-env-var/package.json b/packages/registry/__tests__/fixtures/test-volto-project/node_modules/my-volto-config-addon-via-env-var/package.json deleted file mode 100644 index ac0652a9b0f..00000000000 --- a/packages/registry/__tests__/fixtures/test-volto-project/node_modules/my-volto-config-addon-via-env-var/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "my-volto-config-addon-via-env-var", - "version": "0.0.0", - "main": "index.js", - "customizationPaths": [ - "src/custom-addons" - ], - "addons": [ - "test-released-dummy" - ] -} diff --git a/packages/registry/__tests__/fixtures/test-volto-project/node_modules/test-released-addon/index.js b/packages/registry/__tests__/fixtures/test-volto-project/node_modules/test-released-addon/index.js deleted file mode 100644 index 8cb61d300ac..00000000000 --- a/packages/registry/__tests__/fixtures/test-volto-project/node_modules/test-released-addon/index.js +++ /dev/null @@ -1 +0,0 @@ -export default (config) => config; diff --git a/packages/registry/__tests__/fixtures/test-volto-project/node_modules/test-released-addon/package.json b/packages/registry/__tests__/fixtures/test-volto-project/node_modules/test-released-addon/package.json deleted file mode 100644 index 10f0fe2801c..00000000000 --- a/packages/registry/__tests__/fixtures/test-volto-project/node_modules/test-released-addon/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "test-released-addon", - "version": "0.0.0", - "main": "index.js", - "addons": [ - "test-released-unmentioned:extra1,extra2" - ], - "theme": "test-released-addon-theme" -} diff --git a/packages/registry/__tests__/fixtures/test-volto-project/node_modules/test-released-dummy/index.js b/packages/registry/__tests__/fixtures/test-volto-project/node_modules/test-released-dummy/index.js deleted file mode 100644 index 53e61140f21..00000000000 --- a/packages/registry/__tests__/fixtures/test-volto-project/node_modules/test-released-dummy/index.js +++ /dev/null @@ -1,2 +0,0 @@ -export default (config) => config; - diff --git a/packages/registry/__tests__/fixtures/test-volto-project/node_modules/test-released-dummy/package.json b/packages/registry/__tests__/fixtures/test-volto-project/node_modules/test-released-dummy/package.json deleted file mode 100644 index 4640873bbf9..00000000000 --- a/packages/registry/__tests__/fixtures/test-volto-project/node_modules/test-released-dummy/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "test-released-dummy", - "main": "index.js", - "addons": [] -} diff --git a/packages/registry/__tests__/fixtures/test-volto-project/node_modules/test-released-source-addon/package.json b/packages/registry/__tests__/fixtures/test-volto-project/node_modules/test-released-source-addon/package.json deleted file mode 100644 index 18f9ba7a963..00000000000 --- a/packages/registry/__tests__/fixtures/test-volto-project/node_modules/test-released-source-addon/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "test-released-source-addon", - "version": "0.0.0", - "main": "src/index.js", - "theme": "test-released-source-addon-theme" -} diff --git a/packages/registry/__tests__/fixtures/test-volto-project/node_modules/test-released-source-addon/razzle.extend.js b/packages/registry/__tests__/fixtures/test-volto-project/node_modules/test-released-source-addon/razzle.extend.js deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/packages/registry/__tests__/fixtures/test-volto-project/node_modules/test-released-source-addon/src/customizations/@root/marker.js b/packages/registry/__tests__/fixtures/test-volto-project/node_modules/test-released-source-addon/src/customizations/@root/marker.js deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/packages/registry/__tests__/fixtures/test-volto-project/node_modules/test-released-source-addon/src/customizations/LanguageSwitcher.js b/packages/registry/__tests__/fixtures/test-volto-project/node_modules/test-released-source-addon/src/customizations/LanguageSwitcher.js deleted file mode 100644 index 8337712ea57..00000000000 --- a/packages/registry/__tests__/fixtures/test-volto-project/node_modules/test-released-source-addon/src/customizations/LanguageSwitcher.js +++ /dev/null @@ -1 +0,0 @@ -// diff --git a/packages/registry/__tests__/fixtures/test-volto-project/node_modules/test-released-source-addon/src/customizations/TSComponent.jsx b/packages/registry/__tests__/fixtures/test-volto-project/node_modules/test-released-source-addon/src/customizations/TSComponent.jsx deleted file mode 100644 index 8337712ea57..00000000000 --- a/packages/registry/__tests__/fixtures/test-volto-project/node_modules/test-released-source-addon/src/customizations/TSComponent.jsx +++ /dev/null @@ -1 +0,0 @@ -// diff --git a/packages/registry/__tests__/fixtures/test-volto-project/node_modules/test-released-source-addon/src/customizations/client.js b/packages/registry/__tests__/fixtures/test-volto-project/node_modules/test-released-source-addon/src/customizations/client.js deleted file mode 100644 index 8337712ea57..00000000000 --- a/packages/registry/__tests__/fixtures/test-volto-project/node_modules/test-released-source-addon/src/customizations/client.js +++ /dev/null @@ -1 +0,0 @@ -// diff --git a/packages/registry/__tests__/fixtures/test-volto-project/node_modules/test-released-source-addon/src/customizations/routes.tsx b/packages/registry/__tests__/fixtures/test-volto-project/node_modules/test-released-source-addon/src/customizations/routes.tsx deleted file mode 100644 index 8337712ea57..00000000000 --- a/packages/registry/__tests__/fixtures/test-volto-project/node_modules/test-released-source-addon/src/customizations/routes.tsx +++ /dev/null @@ -1 +0,0 @@ -// diff --git a/packages/registry/__tests__/fixtures/test-volto-project/node_modules/test-released-source-addon/src/index.js b/packages/registry/__tests__/fixtures/test-volto-project/node_modules/test-released-source-addon/src/index.js deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/packages/registry/__tests__/fixtures/test-volto-project/node_modules/test-released-unmentioned/index.js b/packages/registry/__tests__/fixtures/test-volto-project/node_modules/test-released-unmentioned/index.js deleted file mode 100644 index 53e61140f21..00000000000 --- a/packages/registry/__tests__/fixtures/test-volto-project/node_modules/test-released-unmentioned/index.js +++ /dev/null @@ -1,2 +0,0 @@ -export default (config) => config; - diff --git a/packages/registry/__tests__/fixtures/test-volto-project/node_modules/test-released-unmentioned/package.json b/packages/registry/__tests__/fixtures/test-volto-project/node_modules/test-released-unmentioned/package.json deleted file mode 100644 index b3b3c399f15..00000000000 --- a/packages/registry/__tests__/fixtures/test-volto-project/node_modules/test-released-unmentioned/package.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "test-released-unmentioned", - "version": "0.0.0", - "main": "index.js" -} diff --git a/packages/registry/__tests__/fixtures/test-volto-project/node_modules/test-released-via-addons-env-var/index.js b/packages/registry/__tests__/fixtures/test-volto-project/node_modules/test-released-via-addons-env-var/index.js deleted file mode 100644 index 53e61140f21..00000000000 --- a/packages/registry/__tests__/fixtures/test-volto-project/node_modules/test-released-via-addons-env-var/index.js +++ /dev/null @@ -1,2 +0,0 @@ -export default (config) => config; - diff --git a/packages/registry/__tests__/fixtures/test-volto-project/node_modules/test-released-via-addons-env-var/package.json b/packages/registry/__tests__/fixtures/test-volto-project/node_modules/test-released-via-addons-env-var/package.json deleted file mode 100644 index c6a44243100..00000000000 --- a/packages/registry/__tests__/fixtures/test-volto-project/node_modules/test-released-via-addons-env-var/package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "test-released-via-addons-env-var", - "main": "index.js" -} diff --git a/packages/volto/locales/af/LC_MESSAGES/volto.po b/packages/volto/locales/af/LC_MESSAGES/volto.po index 156ffce0610..240b0fec2e8 100644 --- a/packages/volto/locales/af/LC_MESSAGES/volto.po +++ b/packages/volto/locales/af/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/ar/LC_MESSAGES/volto.po b/packages/volto/locales/ar/LC_MESSAGES/volto.po index 36770063c41..cd3ffbe20be 100644 --- a/packages/volto/locales/ar/LC_MESSAGES/volto.po +++ b/packages/volto/locales/ar/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/bg/LC_MESSAGES/volto.po b/packages/volto/locales/bg/LC_MESSAGES/volto.po index c738f3a8216..10f0cacdf36 100644 --- a/packages/volto/locales/bg/LC_MESSAGES/volto.po +++ b/packages/volto/locales/bg/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/bn/LC_MESSAGES/volto.po b/packages/volto/locales/bn/LC_MESSAGES/volto.po index eb683e12e91..85fb601d89b 100644 --- a/packages/volto/locales/bn/LC_MESSAGES/volto.po +++ b/packages/volto/locales/bn/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/ca/LC_MESSAGES/volto.po b/packages/volto/locales/ca/LC_MESSAGES/volto.po index ea5f7433ace..a3a9900af80 100644 --- a/packages/volto/locales/ca/LC_MESSAGES/volto.po +++ b/packages/volto/locales/ca/LC_MESSAGES/volto.po @@ -114,6 +114,11 @@ msgstr "Afegeix contingut" msgid "Add Content Rule" msgstr "Afegir regla de contingut" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1239,6 +1244,11 @@ msgstr "Document" msgid "Download Event" msgstr "Descarrega l'esdeveniment" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/cs/LC_MESSAGES/volto.po b/packages/volto/locales/cs/LC_MESSAGES/volto.po index 705a5c1c67f..a1fe8bde1d2 100644 --- a/packages/volto/locales/cs/LC_MESSAGES/volto.po +++ b/packages/volto/locales/cs/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/cy/LC_MESSAGES/volto.po b/packages/volto/locales/cy/LC_MESSAGES/volto.po index 510c531d442..adbd618fe85 100644 --- a/packages/volto/locales/cy/LC_MESSAGES/volto.po +++ b/packages/volto/locales/cy/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/da/LC_MESSAGES/volto.po b/packages/volto/locales/da/LC_MESSAGES/volto.po index f35213ef34f..1174ecd6589 100644 --- a/packages/volto/locales/da/LC_MESSAGES/volto.po +++ b/packages/volto/locales/da/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/de/LC_MESSAGES/volto.po b/packages/volto/locales/de/LC_MESSAGES/volto.po index 10bb4f38de1..dfb51d3c3f4 100644 --- a/packages/volto/locales/de/LC_MESSAGES/volto.po +++ b/packages/volto/locales/de/LC_MESSAGES/volto.po @@ -114,6 +114,11 @@ msgstr "Inhalte hinzufügen" msgid "Add Content Rule" msgstr "Inhaltsregel hinzufügen" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1239,6 +1244,11 @@ msgstr "Seite" msgid "Download Event" msgstr "Termindetails herunterladen" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/el/LC_MESSAGES/volto.po b/packages/volto/locales/el/LC_MESSAGES/volto.po index dd732d7ba10..5d90374e2dd 100644 --- a/packages/volto/locales/el/LC_MESSAGES/volto.po +++ b/packages/volto/locales/el/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/en/LC_MESSAGES/volto.po b/packages/volto/locales/en/LC_MESSAGES/volto.po index e79f92a8cc2..bcad2aef69d 100644 --- a/packages/volto/locales/en/LC_MESSAGES/volto.po +++ b/packages/volto/locales/en/LC_MESSAGES/volto.po @@ -112,6 +112,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1237,6 +1242,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/en_AU/LC_MESSAGES/volto.po b/packages/volto/locales/en_AU/LC_MESSAGES/volto.po index 2399e9a665c..f1ef562b5e0 100644 --- a/packages/volto/locales/en_AU/LC_MESSAGES/volto.po +++ b/packages/volto/locales/en_AU/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/en_GB/LC_MESSAGES/volto.po b/packages/volto/locales/en_GB/LC_MESSAGES/volto.po index 39c31781d84..c5f70fc7188 100644 --- a/packages/volto/locales/en_GB/LC_MESSAGES/volto.po +++ b/packages/volto/locales/en_GB/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/eo/LC_MESSAGES/volto.po b/packages/volto/locales/eo/LC_MESSAGES/volto.po index 09ab9c1696c..2b000e2ec06 100644 --- a/packages/volto/locales/eo/LC_MESSAGES/volto.po +++ b/packages/volto/locales/eo/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/es/LC_MESSAGES/volto.po b/packages/volto/locales/es/LC_MESSAGES/volto.po index d272e1319f2..a818f79b7e9 100644 --- a/packages/volto/locales/es/LC_MESSAGES/volto.po +++ b/packages/volto/locales/es/LC_MESSAGES/volto.po @@ -114,6 +114,11 @@ msgstr "Añadir contenido" msgid "Add Content Rule" msgstr "Añadir regla de contenido" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1239,6 +1244,11 @@ msgstr "Vista de documento" msgid "Download Event" msgstr "Descargar evento" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/et/LC_MESSAGES/volto.po b/packages/volto/locales/et/LC_MESSAGES/volto.po index 5c0525977b8..07f2411fe02 100644 --- a/packages/volto/locales/et/LC_MESSAGES/volto.po +++ b/packages/volto/locales/et/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/eu/LC_MESSAGES/volto.po b/packages/volto/locales/eu/LC_MESSAGES/volto.po index 87c172fd75a..8d2fdcfd9c3 100644 --- a/packages/volto/locales/eu/LC_MESSAGES/volto.po +++ b/packages/volto/locales/eu/LC_MESSAGES/volto.po @@ -114,6 +114,11 @@ msgstr "Gehitu edukia" msgid "Add Content Rule" msgstr "Gehitu eduki erregela" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1239,6 +1244,11 @@ msgstr "Dokumentuaren bista" msgid "Download Event" msgstr "Deskargatu hitzorduaren fitxategia" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/fa/LC_MESSAGES/volto.po b/packages/volto/locales/fa/LC_MESSAGES/volto.po index c7ffd2c9283..220f1dd4d46 100644 --- a/packages/volto/locales/fa/LC_MESSAGES/volto.po +++ b/packages/volto/locales/fa/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/fi/LC_MESSAGES/volto.po b/packages/volto/locales/fi/LC_MESSAGES/volto.po index 89267d1bbcf..32ce4d0cbfa 100644 --- a/packages/volto/locales/fi/LC_MESSAGES/volto.po +++ b/packages/volto/locales/fi/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "Lisää sisältöä" msgid "Add Content Rule" msgstr "Lisää sisältösääntö" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "Dokumenttinäkymä" msgid "Download Event" msgstr "Lataa tapahtuma" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/fr/LC_MESSAGES/volto.po b/packages/volto/locales/fr/LC_MESSAGES/volto.po index 202d69de052..5b0f0b276bb 100644 --- a/packages/volto/locales/fr/LC_MESSAGES/volto.po +++ b/packages/volto/locales/fr/LC_MESSAGES/volto.po @@ -114,6 +114,11 @@ msgstr "Ajouter du contenu" msgid "Add Content Rule" msgstr "Ajouter une règle de contenu" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1239,6 +1244,11 @@ msgstr "Vue document" msgid "Download Event" msgstr "Télécharger l'événement" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/fu/LC_MESSAGES/volto.po b/packages/volto/locales/fu/LC_MESSAGES/volto.po index ce98b92701b..4d3576a97f5 100644 --- a/packages/volto/locales/fu/LC_MESSAGES/volto.po +++ b/packages/volto/locales/fu/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/gl/LC_MESSAGES/volto.po b/packages/volto/locales/gl/LC_MESSAGES/volto.po index 7866e020f5d..7d5c2c806c6 100644 --- a/packages/volto/locales/gl/LC_MESSAGES/volto.po +++ b/packages/volto/locales/gl/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "Engadir Contido" msgid "Add Content Rule" msgstr "Engadir Regra de Contido" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "Vista documento" msgid "Download Event" msgstr "Descargar Evento" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/he/LC_MESSAGES/volto.po b/packages/volto/locales/he/LC_MESSAGES/volto.po index 536b411e4ff..4c20fdae535 100644 --- a/packages/volto/locales/he/LC_MESSAGES/volto.po +++ b/packages/volto/locales/he/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/hi/LC_MESSAGES/volto.po b/packages/volto/locales/hi/LC_MESSAGES/volto.po index 2f6f087cd67..6c32617685f 100644 --- a/packages/volto/locales/hi/LC_MESSAGES/volto.po +++ b/packages/volto/locales/hi/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "जोड़े कंटेंट" msgid "Add Content Rule" msgstr "कंटेंट रूल्स जोड़े" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "दस्तावेज़ दृश्य" msgid "Download Event" msgstr "आयोजन डाउनलोड करें" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/hr/LC_MESSAGES/volto.po b/packages/volto/locales/hr/LC_MESSAGES/volto.po index 302987d803e..54663bdc966 100644 --- a/packages/volto/locales/hr/LC_MESSAGES/volto.po +++ b/packages/volto/locales/hr/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/hu/LC_MESSAGES/volto.po b/packages/volto/locales/hu/LC_MESSAGES/volto.po index 8631d8abe8a..6d6717392b5 100644 --- a/packages/volto/locales/hu/LC_MESSAGES/volto.po +++ b/packages/volto/locales/hu/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/hy/LC_MESSAGES/volto.po b/packages/volto/locales/hy/LC_MESSAGES/volto.po index 451de6dc115..513a43dbb36 100644 --- a/packages/volto/locales/hy/LC_MESSAGES/volto.po +++ b/packages/volto/locales/hy/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/id/LC_MESSAGES/volto.po b/packages/volto/locales/id/LC_MESSAGES/volto.po index e14794119c3..6479fb0069f 100644 --- a/packages/volto/locales/id/LC_MESSAGES/volto.po +++ b/packages/volto/locales/id/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/it/LC_MESSAGES/volto.po b/packages/volto/locales/it/LC_MESSAGES/volto.po index a3b136b0be7..56853a0cf1b 100644 --- a/packages/volto/locales/it/LC_MESSAGES/volto.po +++ b/packages/volto/locales/it/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "Aggiungi un contenuto" msgid "Add Content Rule" msgstr "Aggiungi una regola di contenuto" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "Vista pagina" msgid "Download Event" msgstr "Scarica l'evento" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/ja/LC_MESSAGES/volto.po b/packages/volto/locales/ja/LC_MESSAGES/volto.po index 7829f747c25..463e78971e6 100644 --- a/packages/volto/locales/ja/LC_MESSAGES/volto.po +++ b/packages/volto/locales/ja/LC_MESSAGES/volto.po @@ -114,6 +114,11 @@ msgstr "新規追加" msgid "Add Content Rule" msgstr "コンテンツルールを追加" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1239,6 +1244,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/ka/LC_MESSAGES/volto.po b/packages/volto/locales/ka/LC_MESSAGES/volto.po index 15d592e55c5..799256e67d7 100644 --- a/packages/volto/locales/ka/LC_MESSAGES/volto.po +++ b/packages/volto/locales/ka/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/kn/LC_MESSAGES/volto.po b/packages/volto/locales/kn/LC_MESSAGES/volto.po index be0a906630b..af396ac1ebd 100644 --- a/packages/volto/locales/kn/LC_MESSAGES/volto.po +++ b/packages/volto/locales/kn/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/ko/LC_MESSAGES/volto.po b/packages/volto/locales/ko/LC_MESSAGES/volto.po index 95569acf9e0..ab59506ce92 100644 --- a/packages/volto/locales/ko/LC_MESSAGES/volto.po +++ b/packages/volto/locales/ko/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/lt/LC_MESSAGES/volto.po b/packages/volto/locales/lt/LC_MESSAGES/volto.po index 237c32e1b38..9298ad5401b 100644 --- a/packages/volto/locales/lt/LC_MESSAGES/volto.po +++ b/packages/volto/locales/lt/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/lv/LC_MESSAGES/volto.po b/packages/volto/locales/lv/LC_MESSAGES/volto.po index 20fce5b659e..6320adf9a38 100644 --- a/packages/volto/locales/lv/LC_MESSAGES/volto.po +++ b/packages/volto/locales/lv/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/mi/LC_MESSAGES/volto.po b/packages/volto/locales/mi/LC_MESSAGES/volto.po index c80c2531bd8..f25600477a2 100644 --- a/packages/volto/locales/mi/LC_MESSAGES/volto.po +++ b/packages/volto/locales/mi/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/mk/LC_MESSAGES/volto.po b/packages/volto/locales/mk/LC_MESSAGES/volto.po index c5b92038e8a..7d6bb043457 100644 --- a/packages/volto/locales/mk/LC_MESSAGES/volto.po +++ b/packages/volto/locales/mk/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/my/LC_MESSAGES/volto.po b/packages/volto/locales/my/LC_MESSAGES/volto.po index da9e1fee5e7..405b89aeb4f 100644 --- a/packages/volto/locales/my/LC_MESSAGES/volto.po +++ b/packages/volto/locales/my/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/nb_NO/LC_MESSAGES/volto.po b/packages/volto/locales/nb_NO/LC_MESSAGES/volto.po index dd1e079f4b5..8b9cb21c8d8 100644 --- a/packages/volto/locales/nb_NO/LC_MESSAGES/volto.po +++ b/packages/volto/locales/nb_NO/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/nl/LC_MESSAGES/volto.po b/packages/volto/locales/nl/LC_MESSAGES/volto.po index 585f37e40c5..6f6ed562f76 100644 --- a/packages/volto/locales/nl/LC_MESSAGES/volto.po +++ b/packages/volto/locales/nl/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "Inhoud toevoegen…" msgid "Add Content Rule" msgstr "Inhoudsregel toevoegen" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "Document weergave" msgid "Download Event" msgstr "Evenement downloaden" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/nn/LC_MESSAGES/volto.po b/packages/volto/locales/nn/LC_MESSAGES/volto.po index 7013caad30d..3795e846f85 100644 --- a/packages/volto/locales/nn/LC_MESSAGES/volto.po +++ b/packages/volto/locales/nn/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/pl/LC_MESSAGES/volto.po b/packages/volto/locales/pl/LC_MESSAGES/volto.po index e6082b3160c..0035469f550 100644 --- a/packages/volto/locales/pl/LC_MESSAGES/volto.po +++ b/packages/volto/locales/pl/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/pt/LC_MESSAGES/volto.po b/packages/volto/locales/pt/LC_MESSAGES/volto.po index fce2d9e7126..33e4ba99e49 100644 --- a/packages/volto/locales/pt/LC_MESSAGES/volto.po +++ b/packages/volto/locales/pt/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "Adicionar Conteúdo" msgid "Add Content Rule" msgstr "Adicionar regra de conteúdo" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "Visão do Documento" msgid "Download Event" msgstr "Descarregar evento" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/pt_BR/LC_MESSAGES/volto.po b/packages/volto/locales/pt_BR/LC_MESSAGES/volto.po index 8d4ec017e5a..e05b56e3166 100644 --- a/packages/volto/locales/pt_BR/LC_MESSAGES/volto.po +++ b/packages/volto/locales/pt_BR/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "Adicionar conteúdo" msgid "Add Content Rule" msgstr "Adicionar regra de conteúdo" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "Visão do Documento" msgid "Download Event" msgstr "Baixar evento" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/rm/LC_MESSAGES/volto.po b/packages/volto/locales/rm/LC_MESSAGES/volto.po index 45fdb892a67..61013a09beb 100644 --- a/packages/volto/locales/rm/LC_MESSAGES/volto.po +++ b/packages/volto/locales/rm/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/ro/LC_MESSAGES/volto.po b/packages/volto/locales/ro/LC_MESSAGES/volto.po index 77334416315..e7d90ff8535 100644 --- a/packages/volto/locales/ro/LC_MESSAGES/volto.po +++ b/packages/volto/locales/ro/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "Adăugare conținut" msgid "Add Content Rule" msgstr "Adaugă regulă conținut" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "Vizualizare document" msgid "Download Event" msgstr "Descărcați evenimentul" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/ru/LC_MESSAGES/volto.po b/packages/volto/locales/ru/LC_MESSAGES/volto.po index 3f8559d6503..f92abe7c96e 100644 --- a/packages/volto/locales/ru/LC_MESSAGES/volto.po +++ b/packages/volto/locales/ru/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "Добавить контент" msgid "Add Content Rule" msgstr "Добавить правило контента" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "Вид документа" msgid "Download Event" msgstr "Скачать событие" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/sk/LC_MESSAGES/volto.po b/packages/volto/locales/sk/LC_MESSAGES/volto.po index 1b2fcfbdfe1..242ae4dd0f3 100644 --- a/packages/volto/locales/sk/LC_MESSAGES/volto.po +++ b/packages/volto/locales/sk/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/sl/LC_MESSAGES/volto.po b/packages/volto/locales/sl/LC_MESSAGES/volto.po index a00cfa20937..7e1fb8e3969 100644 --- a/packages/volto/locales/sl/LC_MESSAGES/volto.po +++ b/packages/volto/locales/sl/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/sm/LC_MESSAGES/volto.po b/packages/volto/locales/sm/LC_MESSAGES/volto.po index fa82f98c7e5..5d7531a8f55 100644 --- a/packages/volto/locales/sm/LC_MESSAGES/volto.po +++ b/packages/volto/locales/sm/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/sq/LC_MESSAGES/volto.po b/packages/volto/locales/sq/LC_MESSAGES/volto.po index 10871684ff4..202fbda3514 100644 --- a/packages/volto/locales/sq/LC_MESSAGES/volto.po +++ b/packages/volto/locales/sq/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/sr/LC_MESSAGES/volto.po b/packages/volto/locales/sr/LC_MESSAGES/volto.po index e3fd6ee54c5..7073263c0e2 100644 --- a/packages/volto/locales/sr/LC_MESSAGES/volto.po +++ b/packages/volto/locales/sr/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/sr@cyrl/LC_MESSAGES/volto.po b/packages/volto/locales/sr@cyrl/LC_MESSAGES/volto.po index a5970f39c0c..9e0177536d0 100644 --- a/packages/volto/locales/sr@cyrl/LC_MESSAGES/volto.po +++ b/packages/volto/locales/sr@cyrl/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/sr@latn/LC_MESSAGES/volto.po b/packages/volto/locales/sr@latn/LC_MESSAGES/volto.po index 41f81416a11..a3096b4cffd 100644 --- a/packages/volto/locales/sr@latn/LC_MESSAGES/volto.po +++ b/packages/volto/locales/sr@latn/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/sv/LC_MESSAGES/volto.po b/packages/volto/locales/sv/LC_MESSAGES/volto.po index ab89d6c1cc0..00775bb86ce 100644 --- a/packages/volto/locales/sv/LC_MESSAGES/volto.po +++ b/packages/volto/locales/sv/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "Lägga till innehåll" msgid "Add Content Rule" msgstr "Lägg till innehållsregel" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "" msgid "Download Event" msgstr "Ladda ner evenemang" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/ta/LC_MESSAGES/volto.po b/packages/volto/locales/ta/LC_MESSAGES/volto.po index c2e36441d1c..35de7cf5478 100644 --- a/packages/volto/locales/ta/LC_MESSAGES/volto.po +++ b/packages/volto/locales/ta/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "உள்ளடக்கத்தைச் சேர்க்கவு msgid "Add Content Rule" msgstr "உள்ளடக்க விதியைச் சேர்க்கவும்" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "ஆவணக் காட்சி" msgid "Download Event" msgstr "நிகழ்வைப் பதிவிறக்கவும்" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/te/LC_MESSAGES/volto.po b/packages/volto/locales/te/LC_MESSAGES/volto.po index 8ceb165a2f9..5effaa6a828 100644 --- a/packages/volto/locales/te/LC_MESSAGES/volto.po +++ b/packages/volto/locales/te/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/th/LC_MESSAGES/volto.po b/packages/volto/locales/th/LC_MESSAGES/volto.po index f4b7268f6fa..826185e0a68 100644 --- a/packages/volto/locales/th/LC_MESSAGES/volto.po +++ b/packages/volto/locales/th/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/to/LC_MESSAGES/volto.po b/packages/volto/locales/to/LC_MESSAGES/volto.po index cf6ff9d01c2..bb813f8783f 100644 --- a/packages/volto/locales/to/LC_MESSAGES/volto.po +++ b/packages/volto/locales/to/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/tr/LC_MESSAGES/volto.po b/packages/volto/locales/tr/LC_MESSAGES/volto.po index 5c464b76203..1fa6eda86c0 100644 --- a/packages/volto/locales/tr/LC_MESSAGES/volto.po +++ b/packages/volto/locales/tr/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/uk/LC_MESSAGES/volto.po b/packages/volto/locales/uk/LC_MESSAGES/volto.po index 3d35b22b0cd..2f044c1e9e6 100644 --- a/packages/volto/locales/uk/LC_MESSAGES/volto.po +++ b/packages/volto/locales/uk/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/vi/LC_MESSAGES/volto.po b/packages/volto/locales/vi/LC_MESSAGES/volto.po index b2b1f1be3df..79cfa66f715 100644 --- a/packages/volto/locales/vi/LC_MESSAGES/volto.po +++ b/packages/volto/locales/vi/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/volto.pot b/packages/volto/locales/volto.pot index 9ec18728c85..d73a0238fda 100644 --- a/packages/volto/locales/volto.pot +++ b/packages/volto/locales/volto.pot @@ -109,6 +109,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1234,6 +1239,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/zh_CN/LC_MESSAGES/volto.po b/packages/volto/locales/zh_CN/LC_MESSAGES/volto.po index 0edca67586d..755676b6865 100644 --- a/packages/volto/locales/zh_CN/LC_MESSAGES/volto.po +++ b/packages/volto/locales/zh_CN/LC_MESSAGES/volto.po @@ -114,6 +114,11 @@ msgstr "添加内容" msgid "Add Content Rule" msgstr "添加内容规则" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1239,6 +1244,11 @@ msgstr "文档视图" msgid "Download Event" msgstr "下载事件" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/zh_Hant/LC_MESSAGES/volto.po b/packages/volto/locales/zh_Hant/LC_MESSAGES/volto.po index 85e7068fe4b..3c26792f037 100644 --- a/packages/volto/locales/zh_Hant/LC_MESSAGES/volto.po +++ b/packages/volto/locales/zh_Hant/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/locales/zh_Hant_HK/LC_MESSAGES/volto.po b/packages/volto/locales/zh_Hant_HK/LC_MESSAGES/volto.po index ce7039239e5..d2b171009cd 100644 --- a/packages/volto/locales/zh_Hant_HK/LC_MESSAGES/volto.po +++ b/packages/volto/locales/zh_Hant_HK/LC_MESSAGES/volto.po @@ -113,6 +113,11 @@ msgstr "" msgid "Add Content Rule" msgstr "" +#. Default: "Add Members via CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Add Members via CSV" +msgstr "" + #. Default: "Add Rule" #: components/manage/Controlpanels/Rules/AddRule msgid "Add Rule" @@ -1238,6 +1243,11 @@ msgstr "" msgid "Download Event" msgstr "" +#. Default: "Download Members as CSV" +#: helpers/MessageLabels/MessageLabels +msgid "Download Members as CSV" +msgstr "" + #. Default: "Download file" #: components/theme/View/FileView msgid "Download file" diff --git a/packages/volto/news/8356.feature b/packages/volto/news/8356.feature new file mode 100644 index 00000000000..1c723e5472e --- /dev/null +++ b/packages/volto/news/8356.feature @@ -0,0 +1 @@ +Added functionality to up- and download users via csv file in the users controlpanel. @TimoBroeskamp \ No newline at end of file diff --git a/packages/volto/src/actions/users/users.js b/packages/volto/src/actions/users/users.js index cd21de20baf..b0098c8541c 100644 --- a/packages/volto/src/actions/users/users.js +++ b/packages/volto/src/actions/users/users.js @@ -7,10 +7,12 @@ import qs from 'query-string'; import { CREATE_USER, + UPDATE_USERS_CSV, DELETE_USER, GET_USER, INITIAL_PASSWORD, LIST_USERS, + GET_USERS_CSV, RESET_PASSWORD, UPDATE_PASSWORD, UPDATE_USER, @@ -33,6 +35,17 @@ export function createUser(content, sendPasswordReset = null) { }; } +export function uploadUsersCsv(file) { + return { + type: UPDATE_USERS_CSV, + request: { + op: 'post', + path: '/@users', + attach: [['file', file]], + }, + }; +} + /** * Delete user function. * @function deleteUser @@ -114,6 +127,17 @@ export function listUsers(options = {}) { }; } +export function getUsersCsv() { + return { + type: GET_USERS_CSV, + request: { + op: 'get', + path: '/@users', + headers: { Accept: 'text/csv' }, + }, + }; +} + /** * Update user function * @function updateUser diff --git a/packages/volto/src/components/manage/Controlpanels/Users/UsersControlpanel.jsx b/packages/volto/src/components/manage/Controlpanels/Users/UsersControlpanel.jsx index 91dee032401..c5cd05b1486 100644 --- a/packages/volto/src/components/manage/Controlpanels/Users/UsersControlpanel.jsx +++ b/packages/volto/src/components/manage/Controlpanels/Users/UsersControlpanel.jsx @@ -8,6 +8,8 @@ import { listUsers, updateUser, getUser, + getUsersCsv, + uploadUsersCsv, } from '@plone/volto/actions/users/users'; import { listRoles } from '@plone/volto/actions/roles/roles'; import { listGroups, updateGroup } from '@plone/volto/actions/groups/groups'; @@ -31,6 +33,8 @@ import clearSVG from '@plone/volto/icons/clear.svg'; import addUserSvg from '@plone/volto/icons/add-user.svg'; import saveSVG from '@plone/volto/icons/save.svg'; import ploneSVG from '@plone/volto/icons/plone.svg'; +import downloadSVG from '@plone/volto/icons/download.svg'; +import uploadSVG from '@plone/volto/icons/upload.svg'; import find from 'lodash/find'; import map from 'lodash/map'; import pull from 'lodash/pull'; @@ -127,6 +131,7 @@ const UsersControlpanel = (props) => { const [isLoading, setIsLoading] = useState(false); const [showAddUser, setShowAddUser] = useState(false); const [addUserError, setAddUserError] = useState(''); + const [showAddCSVImport, setShowCSVImport] = useState(false); const [showDelete, setShowDelete] = useState(false); const [userToDelete, setUserToDelete] = useState(undefined); const [entries, setEntries] = useState([]); @@ -535,6 +540,7 @@ const UsersControlpanel = (props) => { .map((group) => [group.id, group.id]), noValueOption: false, }; + // Add custom fields to the first fieldset if they don't already exist if ( adduserschema.fieldsets && @@ -552,6 +558,85 @@ const UsersControlpanel = (props) => { } } + const csvUploadSchema = { + fieldsets: [ + { + behavior: 'plone', + fields: ['file'], + id: 'default', + title: 'Default', + }, + ], + properties: { + file: { + title: 'CSV File', + description: '\n Drag and drop your CSV file in here.\n ', + factory: 'File', + properties: { + 'file.contentType': { + default: '', + description: 'The content type identifies the type of data.', + factory: 'Text line (String)', + title: 'Content Type', + type: 'string', + }, + 'file.data': { + default: '', + description: 'The actual content of the object.', + factory: 'Text line (String)', + title: 'Data', + type: 'string', + }, + 'file.filename': { + description: '', + factory: 'Text line (String)', + title: 'Filename', + type: 'string', + }, + }, + type: 'object', + widget: 'file', + }, + }, + required: [], + }; + + function downloadUserCsv(filename = 'users.csv') { + const csvContent = dispatch(getUsersCsv()); + const blob = new Blob([csvContent], { type: 'text/csv;charset=utf-8;' }); + const url = window.URL.createObjectURL(blob); + const a = document.createElement('a'); + a.href = url; + a.download = filename; + document.body.appendChild(a); + a.click(); + a.remove(); + window.URL.revokeObjectURL(url); + } + + const handleCsvUpload = (formData) => { + fetch(`data:${formData.file['content-type']};base64,${formData.file.data}`) + .then((res) => res.blob()) + .then((blob) => { + dispatch(uploadUsersCsv(blob)) + .then(() => { + dispatch(listUsers()); + setAddUserError(null); + setShowCSVImport(false); + toast.success( + , + ); + }) + .catch((error) => { + setAddUserError(error.response?.body?.message); + }); + }); + }; + return ( @@ -597,10 +682,97 @@ const UsersControlpanel = (props) => { schema={adduserschema} /> ) : null} + {userschema?.loaded && showAddCSVImport ? ( + { + setShowCSVImport(false); + setAddUserError(undefined); + }} + title={intl.formatMessage(messages.addMemberImport)} + loading={createRequest?.loading} + schema={csvUploadSchema} + /> + ) : null} - + +
+ + {' '} +
0; + return ( <> {/* aria-live region outside Modal so it persists through open/close cycles */} diff --git a/packages/volto/src/constants/ActionTypes.js b/packages/volto/src/constants/ActionTypes.js index ac7b0ba0d95..ca5f54f1200 100644 --- a/packages/volto/src/constants/ActionTypes.js +++ b/packages/volto/src/constants/ActionTypes.js @@ -12,6 +12,7 @@ export const COPY_CONTENT = 'COPY_CONTENT'; export const CREATE_CONTENT = 'CREATE_CONTENT'; export const CREATE_GROUP = 'CREATE_GROUP'; export const CREATE_USER = 'CREATE_USER'; +export const UPDATE_USERS_CSV = 'UPDATE_USERS_CSV'; export const CUT = 'CUT'; export const DELETE_COMMENT = 'DELETE_COMMENT'; export const DELETE_CONTENT = 'DELETE_CONTENT'; @@ -68,6 +69,7 @@ export const LIST_FILTER_GROUPS = 'LIST_FILTER_GROUPS'; export const LIST_ROLES = 'LIST_ROLES'; export const AUTH_ROLE = 'AUTH_ROLE'; export const LIST_USERS = 'LIST_USERS'; +export const GET_USERS_CSV = 'GET_USERS_CSV'; export const LOGIN = 'LOGIN'; export const LOGIN_RENEW = 'LOGIN_RENEW'; export const LOGOUT = 'LOGOUT'; diff --git a/packages/volto/src/helpers/MessageLabels/MessageLabels.js b/packages/volto/src/helpers/MessageLabels/MessageLabels.js index 36c327830ce..b29d7a472be 100644 --- a/packages/volto/src/helpers/MessageLabels/MessageLabels.js +++ b/packages/volto/src/helpers/MessageLabels/MessageLabels.js @@ -111,6 +111,14 @@ export const messages = defineMessages({ id: 'Add User', defaultMessage: 'Add User', }, + addMemberImport: { + id: 'Add Members via CSV', + defaultMessage: 'Add Members via CSV', + }, + membersCSVExport: { + id: 'Download Members as CSV', + defaultMessage: 'Download Members as CSV', + }, addGroupsFormTitle: { id: 'Add group', defaultMessage: 'Add group',