strapi-plugin-navigation 3.0.15 → 3.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{ca-BzGBgdJx.js → ca-Gq9Ty_aG.js} +1 -1
- package/dist/_chunks/{ca-DVB9tv4s.mjs → ca-Jr1amAtF.mjs} +7 -0
- package/dist/_chunks/{en-CKowl_sX.js → en-BP5RWE-N.js} +1 -1
- package/dist/_chunks/{en--XL9UqS_.mjs → en-DmeenfQT.mjs} +7 -0
- package/dist/_chunks/{fr-BjVniZne.js → fr-BIJn6QmK.js} +1 -1
- package/dist/_chunks/{fr-B3UeLLGy.mjs → fr-CZx3EMw8.mjs} +7 -0
- package/dist/admin/index.js +295 -275
- package/dist/admin/index.mjs +7555 -7452
- package/dist/admin/src/pages/HomePage/components/ChangeLanguageDialog/index.d.ts +13 -0
- package/dist/admin/src/pages/HomePage/components/NavigationItemForm/utils/form.d.ts +3 -3
- package/dist/admin/src/translations/ca.d.ts +7 -0
- package/dist/admin/src/translations/en.d.ts +7 -0
- package/dist/admin/src/translations/es.d.ts +7 -0
- package/dist/admin/src/translations/fr.d.ts +7 -0
- package/dist/admin/src/translations/tr.d.ts +7 -0
- package/dist/server/index.js +1 -1
- package/dist/server/index.mjs +2 -2
- package/dist/server/src/schemas/navigation.d.ts +5 -5
- package/package.json +6 -8
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
export interface ConfirmEffect {
|
|
3
|
+
(): void;
|
|
4
|
+
}
|
|
5
|
+
export interface CancelEffect {
|
|
6
|
+
(): void;
|
|
7
|
+
}
|
|
8
|
+
interface Props {
|
|
9
|
+
onConfirm: ConfirmEffect;
|
|
10
|
+
onCancel: CancelEffect;
|
|
11
|
+
}
|
|
12
|
+
export declare const ChangeLanguageDialog: FC<Props>;
|
|
13
|
+
export {};
|
|
@@ -120,7 +120,7 @@ export declare const navigationItemFormSchema: (input: FormSchemaBuilderInput) =
|
|
|
120
120
|
} & {
|
|
121
121
|
type: z.ZodLiteral<"INTERNAL">;
|
|
122
122
|
path: z.ZodString;
|
|
123
|
-
externalPath: z.ZodOptional<z.ZodString
|
|
123
|
+
externalPath: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
124
124
|
relatedType: z.ZodString;
|
|
125
125
|
related: z.ZodString | z.ZodOptional<z.ZodString>;
|
|
126
126
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -136,7 +136,7 @@ export declare const navigationItemFormSchema: (input: FormSchemaBuilderInput) =
|
|
|
136
136
|
order?: number | undefined;
|
|
137
137
|
audience?: string[] | undefined;
|
|
138
138
|
documentId?: string | undefined;
|
|
139
|
-
externalPath?: string | undefined;
|
|
139
|
+
externalPath?: string | null | undefined;
|
|
140
140
|
menuAttached?: boolean | undefined;
|
|
141
141
|
collapsed?: boolean | undefined;
|
|
142
142
|
autoSync?: boolean | undefined;
|
|
@@ -164,7 +164,7 @@ export declare const navigationItemFormSchema: (input: FormSchemaBuilderInput) =
|
|
|
164
164
|
order?: number | undefined;
|
|
165
165
|
audience?: string[] | undefined;
|
|
166
166
|
documentId?: string | undefined;
|
|
167
|
-
externalPath?: string | undefined;
|
|
167
|
+
externalPath?: string | null | undefined;
|
|
168
168
|
menuAttached?: boolean | undefined;
|
|
169
169
|
collapsed?: boolean | undefined;
|
|
170
170
|
autoSync?: boolean | undefined;
|
package/dist/server/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const Ie=require("zod"),B=require("lodash"),R=require("lodash/fp"),Iu=require("crypto"),Nu=require("child_process"),Pu=require("lodash/has"),Lu=require("lodash/mapValues"),ku=require("lodash/snakeCase"),Du=require("lodash/camelCase"),Mu=require("lodash/mapKeys"),ju=require("os"),Hu=require("path"),Bu=require("fs"),Uu=require("assert"),Gu=require("events"),qu=require("buffer"),Ku=require("stream"),zu=require("util"),Wu=require("constants");require("node:stream");const Yu=require("@sindresorhus/slugify"),Qu=require("pluralize"),se=e=>e&&e.__esModule?e:{default:e};function Vu(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const y=Vu(Ie),he=se(B),Fi=se(Iu),cn=se(Nu),ln=se(Pu),ia=se(Lu),$i=se(ku),Xu=se(Du),Zu=se(Mu),Pn=se(ju),be=se(Hu),ze=se(Bu),oa=se(Uu),Ju=se(Gu),ec=se(qu),Ln=se(Ku),it=se(zu),tc=se(Wu),nc=se(Yu),Oi=se(Qu),Gr=y.object({name:y.string().refine(e=>!e.includes(" "),{message:"No space allowed"}),label:y.string(),required:y.boolean().optional(),enabled:y.boolean().optional()}),rc=Gr.extend({type:y.literal("select"),multi:y.boolean(),options:y.array(y.string())}),ic=Gr.extend({type:y.enum(["boolean","string"]),multi:y.literal(!1).optional(),options:y.array(y.string()).max(0).optional()}),oc=Gr.extend({type:y.literal("media"),multi:y.literal(!1).optional(),options:y.array(y.string()).max(0).optional()}),ac=y.union([ic,oc,rc]),sc=y.union([y.literal("audience"),ac]),Le=y.object({additionalFields:y.array(sc),allowedLevels:y.number(),contentTypes:y.array(y.string()),contentTypesNameFields:y.record(y.string(),y.array(y.string())),contentTypesPopulate:y.record(y.string(),y.array(y.string())),gql:y.object({navigationItemRelated:y.array(y.string())}),pathDefaultFields:y.record(y.string(),y.any()),cascadeMenuAttached:y.boolean(),preferCustomContentTypes:y.boolean(),isCacheEnabled:y.boolean().optional()}),uc=y.enum(["collectionType","singleType"]),cc=y.object({singularName:y.string(),pluralName:y.string(),displayName:y.string(),description:y.string().optional(),name:y.string().optional()}),aa=y.object({required:y.boolean().optional(),max:y.number().optional(),min:y.number().optional(),minLength:y.number().optional(),maxLength:y.number().optional(),private:y.boolean().optional(),configurable:y.boolean().optional(),default:y.any().optional()}),lc=y.enum(["string","text","richtext","blocks","email","password","date","time","datetime","timestamp","boolean","integer","biginteger","float","decimal","json","relation","media"]),fc=aa.extend({type:lc}),pc=aa.extend({type:y.literal("enumeration"),enum:y.string().array()}),dc=y.object({type:y.literal("component"),component:y.string(),repeatable:y.boolean().optional()}),hc=y.object({type:y.literal("dynamiczone"),components:y.string().array()}),mc=y.object({type:y.literal("uid")}),gc=y.object({type:y.literal("media"),allowedTypes:y.enum(["images","videos","audios","files"]).array(),required:y.boolean().optional()}),yc=y.enum(["oneToOne","oneToMany","manyToOne","manyToMany","morphToMany","manyToMorph"]),vc=y.object({type:y.literal("relation"),relation:yc,target:y.string(),mappedBy:y.string().optional(),inversedBy:y.string().optional()}),wc=y.record(y.string(),y.union([fc,pc,dc,hc,vc,gc,mc])),Ar=y.object({kind:uc,collectionName:y.string(),info:cc,options:y.object({draftAndPublish:y.boolean().optional(),hidden:y.boolean().optional(),templateName:y.string().optional()}).optional(),attributes:wc,actions:y.record(y.string(),y.any()).optional(),lifecycles:y.record(y.string(),y.any()).optional(),uid:y.string(),apiName:y.string().optional(),associations:y.object({model:y.string(),alias:y.string()}).array().optional(),modelName:y.string().optional(),plugin:y.string().optional(),pluginOptions:y.record(y.string(),y.any()).optional(),isSingle:y.boolean().optional()});Ar.pick({info:!0,kind:!0,attributes:!0,options:!0});const sa=y.object({id:y.number(),documentId:y.string(),name:y.string(),key:y.string()}),Ec=y.enum(["INTERNAL","EXTERNAL","WRAPPER"]),qr=y.object({id:y.number(),documentId:y.string(),title:y.string(),type:Ec,path:y.string().or(y.null()).optional(),slug:y.string().or(y.null()).optional(),externalPath:y.string().or(y.null()).optional(),uiRouterKey:y.string(),menuAttached:y.boolean(),order:y.number().int(),collapsed:y.boolean(),related:y.object({documentId:y.string().optional(),__type:y.string()}).catchall(y.unknown()).nullish(),additionalFields:y.record(y.string(),y.unknown()).or(y.null()).optional(),audience:y.array(sa).or(y.null()).optional(),autoSync:y.boolean().or(y.null()).optional()}),bc=qr.omit({related:!0}).pick({path:!0,type:!0,uiRouterKey:!0,title:!0,externalPath:!0}).extend({related:y.unknown()}),Lt=qr.extend({parent:y.lazy(()=>Lt.or(y.null())).optional(),items:y.lazy(()=>Lt.array()).optional(),master:y.lazy(()=>Ve(!1)).optional()}),Ii=y.array(Lt),Ve=e=>y.object({id:y.number(),documentId:y.string(),name:y.string(),slug:y.string(),locale:y.string(),visible:y.boolean(),items:e?y.array(Lt):Lt.array().optional()}),xc=Ve(!1).omit({items:!0,id:!0,documentId:!0,slug:!0,locale:!0}).extend({documentId:y.string().optional(),id:y.undefined().optional()}),Sc=qr.omit({id:!0,documentId:!0}).extend({id:y.number().optional(),documentId:y.string().optional(),items:y.lazy(()=>ua).or(y.null()).optional(),updated:y.boolean().optional(),removed:y.boolean().optional()}),ua=y.array(Sc),_c=Ve(!1).extend({items:ua}).partial().required({id:!0,documentId:!0}),Ac=/^(?<type>[a-z0-9-]+)\:{2}(?<api>[a-z0-9-]+)\.{1}(?<contentType>[a-z0-9-]+)$/i,Tc=["beforeCreate","beforeCreateMany","afterCreate","afterCreateMany","beforeUpdate","beforeUpdateMany","afterUpdate","afterUpdateMany","beforeDelete","beforeDeleteMany","afterDelete","afterDeleteMany","beforeCount","afterCount","beforeFindOne","afterFindOne","beforeFindMany","afterFindMany"],Cc="$",ca=["api::","plugin::"],la=["admin::","plugin::content-releases","plugin::i18n.locale","plugin::navigation","plugin::review-workflows","plugin::users-permissions","plugin::upload.folder"],Rc=["title","subject","name"],Ni={SINGLE:"singleType"},Pi=["title","type","path","externalPath","uiRouterKey","menuAttached","order","collapsed","related","parent","master","audience","additionalFields"],Fc=e=>e.filter(t=>t!=="audience"),fa=e=>{const t=Fc(e);if(t.length!==B.uniqBy(t,"name").length)throw new Error("All names of custom fields must be unique.");if(!B.isNil(B.find(t,n=>typeof n=="object"&&B.includes(Pi,n.name))))throw new Error(`Name of custom field cannot be one of: ${Pi.join(", ")}`)},pa=(e,t)=>{if(e==null)throw t??new Error("Non-empty value expected, empty given")},$c=(e="")=>{const t=a=>a.split("-").map(o=>B.capitalize(o)).join(""),[n,r,i]=Oc(e);return n==="api"?t(i):`${t(r)}${t(i)}`},Oc=(e="")=>e.split(Ac).filter(t=>t&&t.length>0),Ic=(e,t)=>n=>[n,async r=>{await oe(t,"common").runLifeCycleHook({contentTypeName:e,hookName:n,event:r})}],da=(e,t)=>Object.fromEntries(Tc.map(Ic(e,t))),we=({strapi:e})=>{const t=e.plugin("navigation");return{masterModel:t.contentType("navigation"),itemModel:t.contentType("navigation-item"),relatedModel:t.contentType("navigations-items-related"),audienceModel:t.contentType("audience")}};function oe({strapi:e},t){return e.plugin("navigation").service(t)}const Wt=e=>e==="*"?"*":typeof e=="string"?[e]:e===!1?[]:e===!0?"*":e,Nc=(e="")=>{const t=!!ca.find(r=>e.includes(r)),n=!la.find(r=>e.includes(r)||e===r);return!!e&&t&&n},Li=(e="")=>B.last(e)==="s"?e.substr(0,e.length-1):e,ha=async({strapi:e,forceDefault:t=!1})=>{const n=e.store({type:"plugin",name:"navigation"}),r=await e.plugin("navigation").config,i=t?{}:{...Tr.default,...await n.get({key:"config"})??Tr.default};let a=B.isEmpty(i)?i:Le.parse(i);const o=Pc(a,r);return a={additionalFields:o("additionalFields"),contentTypes:o("contentTypes"),contentTypesNameFields:o("contentTypesNameFields"),contentTypesPopulate:o("contentTypesPopulate"),allowedLevels:o("allowedLevels"),gql:o("gql"),pathDefaultFields:o("pathDefaultFields"),cascadeMenuAttached:o("cascadeMenuAttached"),preferCustomContentTypes:o("preferCustomContentTypes"),isCacheEnabled:o("isCacheEnabled")},Lc(a,{strapi:e}),fa(a.additionalFields),await n.set({key:"config",value:a}),a},Pc=(e,t)=>n=>{const r=e?.[n]??t(n);return pa(r,new Error(`[Navigation] Config "${n}" is undefined`)),r},Lc=(e,{strapi:t})=>{const n=e.contentTypes.filter(i=>!t.contentTypes[i]);if(n.length===0)return;const r=n.map($c);e.contentTypes=e.contentTypes.filter(i=>!n.includes(i)),e.contentTypesNameFields=Object.fromEntries(Object.entries(e.contentTypesNameFields).filter(([i])=>!n.includes(i))),e.gql.navigationItemRelated=e.gql.navigationItemRelated.filter(i=>!r.includes(i))},Tr={default:{additionalFields:[],allowedLevels:2,contentTypes:[],contentTypesNameFields:{},contentTypesPopulate:{},gql:{navigationItemRelated:[]},pathDefaultFields:{},pruneObsoleteI18nNavigations:!1,cascadeMenuAttached:!0,preferCustomContentTypes:!1,isCacheEnabled:!1}},kc=B.once(e=>({find(t,n){const{audienceModel:{uid:r}}=we(e);return e.strapi.query(r).findMany({where:t,limit:n}).then(sa.array().parse)}})),fn=(e,t)=>({findFirst(n,r,i={}){return e.strapi.documents(t).findFirst({populate:Wt(n),status:r,...i})},findById(n,r,i,a={}){return e.strapi.documents(t).findOne({documentId:n,populate:Wt(r),status:i,...a})},findManyById(n,r,i){return e.strapi.documents(t).findMany({where:{documentId:{$in:n}},populate:Wt(r),status:i})},findMany(n,r,i,a){return e.strapi.documents(t).findMany({where:n,populate:Wt(r),status:i,locale:a})},count(n,r){return e.strapi.documents(t).count({where:n,status:r})}}),Pe=B.once(e=>({async save({item:t,locale:n}){const{itemModel:r}=we(e),{__type:i,documentId:a}=t?.related??{},o=i?fn(e,i):void 0,s=i&&o?a?await o.findById(a,void 0,void 0,{locale:n}):await o.findFirst(void 0,void 0,{locale:n}):void 0;if(typeof t.documentId=="string"){const{documentId:u,...c}=t;return e.strapi.documents(r.uid).update({documentId:t.documentId,data:{...c,related:s?{...s,__type:i}:void 0},locale:n})}else return e.strapi.documents(r.uid).create({data:{...t,related:s?{...s,__type:i}:void 0},locale:n})},find({filters:t,locale:n,limit:r,order:i,populate:a}){const{itemModel:o}=we(e);return e.strapi.documents(o.uid).findMany({filters:t,locale:n,limit:r,populate:a,orderBy:i}).then(s=>s.map(Cr)).then(Ii.parse).then(s=>s.map(pn))},findV4({filters:t,locale:n,limit:r,order:i,populate:a}){const{itemModel:o}=we(e);return e.strapi.documents(o.uid).findMany({filters:t,locale:n,limit:r,populate:a,orderBy:i})},count(t){const{itemModel:n}=we(e);return e.strapi.query(n.uid).count({where:t})},remove(t){const{itemModel:n}=we(e);return e.strapi.documents(n.uid).delete({documentId:t.documentId,populate:"*"})},removeForIds(t){const{itemModel:n}=we(e);return t.map(r=>e.strapi.documents(n.uid).delete({documentId:r,populate:"*"}))},findForMasterIds(t){const{itemModel:n}=we(e);return e.strapi.query(n.uid).findMany({where:{$or:t.map(r=>({master:r}))},limit:Number.MAX_SAFE_INTEGER}).then(Ii.parse)}})),Dc=["id","publishedAt","createdAt","updatedAt","locale"],pn=({related:e,items:t=[],...n})=>({...n,items:t.map(pn),related:e?B.omit(e,Dc):void 0}),Cr=({related:e,...t})=>({...t,related:e?.[0]});class xt extends Error{constructor(t,n){super(t),this.additionalInfo=n,this.type="NavigationError"}}class nr extends xt{constructor(){super(...arguments),this.type="FillNavigationError"}}class Mc extends xt{constructor(){super(...arguments),this.type="InvalidParamNavigationError"}}const ki=e=>e===!0?!0:Array.isArray(e)?e.includes("items"):!1,Ne=B.once(e=>({find({filters:t,locale:n,limit:r,orderBy:i,populate:a}){const{masterModel:o}=we(e);return e.strapi.documents(o.uid).findMany({filters:t,locale:n,limit:r,populate:a,orderBy:i}).then(s=>s.map(({items:u,...c})=>({...c,items:u?.map(Cr)}))).then(s=>s.map(({items:u,...c})=>({...c,items:u?.map(pn)}))).then(s=>Ve(ki(a)).array().parse(s))},findOne({locale:t,filters:n,populate:r}){const{masterModel:i}=we(e);return e.strapi.documents(i.uid).findOne({documentId:n.documentId,locale:t,populate:r}).then(a=>a&&{...a,items:a.items?.map(Cr)}).then(a=>Ve(ki(r)).parse(a)).then(a=>({...a,items:a.items?.map(pn)}))},async save(t){const{masterModel:n}=we(e),{documentId:r,locale:i,...a}=t;return r?e.strapi.documents(n.uid).update({locale:i,documentId:r,data:B.omit(a,["id","documentId"]),populate:["items"]}).then(Ve(!1).parse):e.strapi.documents(n.uid).create({locale:i,data:{...a,populate:["items"]}}).then(Ve(!1).parse)},remove(t){const{masterModel:n}=we(e);if(!t.documentId)throw new xt("Document id is required.");return e.strapi.documents(n.uid).delete({documentId:t.documentId})}})),jc="Navigation",Hc="navigation",Bc=async e=>{const t=oe(e,"common"),{defaultLocale:n,restLocale:r=[]}=await t.readLocale(),i=Ne(e),a=await i.find({limit:Number.MAX_SAFE_INTEGER,filters:{},locale:"*"});a.length===0&&a.push(await i.save({name:jc,visible:!0,locale:n,slug:Hc}));const o=a.filter(({locale:s})=>s===n);for(const s of o)for(const u of r)!a.find(({locale:l,documentId:f})=>f===s.documentId&&u===l)&&await i.save({documentId:s.documentId,name:s.name,locale:u,visible:s.visible,slug:s.slug})},de={render:function(e){return`plugin::navigation.${e}`},navigation:{read:"read",update:"update",settings:"settings"}},Uc=async({strapi:e})=>{const t=[{section:"plugins",displayName:"Read",uid:de.navigation.read,pluginName:"navigation"},{section:"plugins",displayName:"Update",uid:de.navigation.update,pluginName:"navigation"},{section:"plugins",displayName:"Settings",uid:de.navigation.settings,pluginName:"navigation"}];await e.admin.services.permission.actionProvider.registerMany(t)},Gc=({nexus:e})=>e.objectType({name:"ContentTypes",definition(t){t.nonNull.string("uid"),t.nonNull.string("name"),t.nonNull.boolean("isSingle"),t.nonNull.string("collectionName"),t.nonNull.string("contentTypeName"),t.nonNull.string("label"),t.nonNull.string("relatedField"),t.nonNull.string("labelSingular"),t.nonNull.string("endpoint"),t.nonNull.boolean("available"),t.nonNull.boolean("visible")}}),qc=({nexus:e,strapi:t})=>e.objectType({name:"ContentTypesNameFields",async definition(n){n.nonNull.list.nonNull.string("default");const i=await oe({strapi:t},"common").getPluginStore(),o=Le.parse(await i.get({key:"config"})).contentTypesNameFields;Object.keys(o||{}).forEach(s=>n.nonNull.list.string(s))}}),Kc=({nexus:e})=>e.inputObjectType({name:"CreateNavigation",definition(t){t.nonNull.string("name"),t.nonNull.list.field("items",{type:"CreateNavigationItem"})}}),zc=({nexus:e})=>e.inputObjectType({name:"CreateNavigationItem",definition(t){t.nonNull.string("title"),t.nonNull.field("type",{type:"NavigationItemType"}),t.string("path"),t.string("externalPath"),t.nonNull.string("uiRouterKey"),t.nonNull.boolean("menuAttached"),t.nonNull.int("order"),t.string("parent"),t.string("master"),t.list.field("items",{type:"CreateNavigationItem"}),t.list.string("audience"),t.field("related",{type:"CreateNavigationRelated"})}}),Wc=({nexus:e})=>e.inputObjectType({name:"CreateNavigationRelated",definition(t){t.nonNull.string("ref"),t.nonNull.string("field"),t.nonNull.string("refId")}}),Yc=({nexus:e})=>e.objectType({name:"Navigation",definition(t){t.nonNull.string("id"),t.nonNull.string("documentId"),t.nonNull.string("name"),t.nonNull.string("slug"),t.nonNull.boolean("visible")}}),Qc=({nexus:e})=>e.objectType({name:"NavigationConfig",definition(t){t.int("allowedLevels"),t.nonNull.list.string("additionalFields"),t.field("contentTypesNameFields",{type:"ContentTypesNameFields"}),t.list.field("contentTypes",{type:"ContentTypes"})}}),Vc=({nexus:e})=>e.objectType({name:"NavigationDetails",definition(t){t.nonNull.string("id"),t.nonNull.string("documentId"),t.nonNull.string("name"),t.nonNull.string("slug"),t.nonNull.boolean("visible"),t.nonNull.list.field("items",{type:"NavigationItem"})}}),Xc=({nexus:e,config:t})=>e.objectType({name:"NavigationItem",definition(n){n.nonNull.int("id"),n.nonNull.string("documentId"),n.nonNull.string("title"),n.nonNull.field("type",{type:"NavigationItemType"}),n.string("path"),n.string("externalPath"),n.nonNull.string("uiRouterKey"),n.nonNull.boolean("menuAttached"),n.nonNull.int("order"),n.field("parent",{type:"NavigationItem"}),n.string("master"),n.list.field("items",{type:"NavigationItem"}),n.field("related",{type:"NavigationItemRelated"}),t.additionalFields.find(r=>r==="audience")&&n.list.string("audience"),n.field("additionalFields",{type:"NavigationItemAdditionalFields"}),n.string("created_at"),n.string("updated_at"),n.string("created_by"),n.string("updated_by"),n.string("createdAt"),n.string("updatedAt"),n.string("createdBy"),n.string("updatedBy")}}),Zc=({nexus:e,config:t})=>e.objectType({name:"NavigationItemAdditionalFields",definition(n){t.additionalFields.forEach(r=>{if(r!=="audience"&&r.enabled)switch(r.type){case"media":n.field(r.name,{type:"UploadFile"});break;case"string":n.string(r.name);break;case"boolean":n.boolean(r.name);break;case"select":r.multi?n.list.string(r.name):n.string(r.name);break;default:throw new Error(`Type "${JSON.stringify(r.type)}" is unsupported by custom fields`)}})}}),Jc=({strapi:e,nexus:t,config:n})=>{const r=n.gql?.navigationItemRelated,i="NavigationItemRelated";return r?.length?t.unionType({name:i,definition(a){a.members(...r)},resolveType:a=>e.contentTypes[a.__type]?.globalId}):t.objectType({name:i,definition(a){a.int("id"),a.string("documentId"),a.string("title"),a.string("name")}})},el=({nexus:e})=>e.enumType({name:"NavigationItemType",members:["INTERNAL","EXTERNAL","WRAPPER"]}),tl=({nexus:e})=>e.enumType({name:"NavigationRenderType",members:["FLAT","TREE"]}),nl=[Zc,Jc,Xc,tl,Yc,Vc,qc,Gc,Qc,Wc,zc,Kc,el],rl=e=>nl.map(t=>t(e)),il="I18NLocaleCode",ol=({strapi:e,nexus:t})=>{const{nonNull:n,list:r,stringArg:i,booleanArg:a}=t;return{args:{navigationIdOrSlug:n(i()),type:"NavigationRenderType",menuOnly:a(),path:i(),locale:t.arg({type:il})},type:n(r("NavigationItem")),resolve(u,{navigationIdOrSlug:c,type:l,menuOnly:f,path:p,locale:d}){const h=Ie.z.string().parse(c);return oe({strapi:e},"client").render({idOrSlug:h,type:l,rootPath:p,locale:d,menuOnly:f,wrapRelated:!0})}}},al=({strapi:e,nexus:t})=>{const{nonNull:n,list:r,stringArg:i,booleanArg:a}=t;return{type:n(r("NavigationItem")),args:{documentId:n(i()),childUiKey:n(i()),type:"NavigationRenderType",menuOnly:a()},resolve(o,s){const{documentId:u,childUIKey:c,type:l,menuOnly:f}=s,p=Ie.z.string().parse(u);return oe({strapi:e},"client").renderChildren({idOrSlug:p,childUIKey:c,type:l,menuOnly:f,wrapRelated:!0})}}},sl=e=>{const t={renderNavigationChild:al,renderNavigation:ol};return e.nexus.extendType({type:"Query",definition(n){for(const[r,i]of Object.entries(t)){const a=i(e);n.field(r,a)}}})},ul=()=>({"Query.renderNavigationChild":{auth:!1},"Query.renderNavigation":{auth:!1}}),cl=async({strapi:e})=>{const t=e.plugin("graphql").service("extension");t.shadowCRUD("plugin::navigation.audience").disable(),t.shadowCRUD("plugin::navigation.navigation").disable(),t.shadowCRUD("plugin::navigation.navigation-item").disable(),t.shadowCRUD("plugin::navigation.navigations-items-related").disable();const r=await oe({strapi:e},"common").getPluginStore(),i=Le.parse(await r.get({key:"config"}));t.use(({strapi:a,nexus:o})=>{const s=rl({strapi:a,nexus:o,config:i}),u=sl({strapi:a,nexus:o}),c=ul();return{types:[s,u],resolversConfig:c}})},ll=async({strapi:e})=>{!!e.plugin("graphql")&&await cl({strapi:e})},fl=async e=>{await ha(e),await Bc(e),await Uc(e),await ll(e),await strapi.service("plugin::navigation.migrate").migrateRelatedIdToDocumentId()},pl=({strapi:e})=>{},dl=({strapi:e})=>{},hl={collectionName:"audience",info:{singularName:"audience",pluralName:"audiences",displayName:"Audience",name:"audience"},options:{increments:!0,comment:"Audience"},attributes:{name:{type:"string",required:!0},key:{type:"uid",targetField:"name"}}},ml={schema:hl},gl=da("navigation",{strapi}),yl={collectionName:"navigations",info:{singularName:"navigation",pluralName:"navigations",displayName:"Navigation",name:"navigation"},options:{comment:""},pluginOptions:{"content-manager":{visible:!1},"content-type-builder":{visible:!1},i18n:{localized:!0}},attributes:{name:{type:"text",configurable:!1,required:!0},slug:{type:"uid",target:"name",configurable:!1,required:!0},visible:{type:"boolean",default:!1,configurable:!1},items:{type:"relation",relation:"oneToMany",target:"plugin::navigation.navigation-item",configurable:!1,mappedBy:"master"}}},vl={schema:yl,lifecycles:gl},wl=da("navigation-item",{strapi}),El={collectionName:"navigations_items",info:{singularName:"navigation-item",pluralName:"navigation-items",displayName:"Navigation Item",name:"navigation-item"},options:{increments:!0,timestamps:!0,comment:"Navigation Item"},pluginOptions:{"content-manager":{visible:!1},"content-type-builder":{visible:!1},i18n:{localized:!1}},attributes:{title:{type:"text",configurable:!1,required:!0,pluginOptions:{i18n:{localized:!1}}},type:{type:"enumeration",enum:["INTERNAL","EXTERNAL","WRAPPER"],default:"INTERNAL",configurable:!1},path:{type:"text",targetField:"title",configurable:!1},externalPath:{type:"text",configurable:!1},uiRouterKey:{type:"string",configurable:!1},menuAttached:{type:"boolean",default:!1,configurable:!1},order:{type:"integer",default:0,configurable:!1},collapsed:{type:"boolean",default:!1,configurable:!1},autoSync:{type:"boolean",default:!0,configurable:!1},related:{type:"relation",relation:"morphToMany",required:!0,configurable:!1},parent:{type:"relation",relation:"oneToOne",target:"plugin::navigation.navigation-item",configurable:!1,default:null},master:{type:"relation",relation:"manyToOne",target:"plugin::navigation.navigation",configurable:!1,inversedBy:"items"},audience:{type:"relation",relation:"oneToMany",target:"plugin::navigation.audience"},additionalFields:{type:"json",require:!1,default:{}}}},bl={schema:El,lifecycles:wl},xl={audience:ml,navigation:vl,"navigation-item":bl},ma=y.enum(["true","false"]),Yt=y.string(),Sl=y.object({locale:y.string().optional(),orderBy:y.string().optional(),orderDirection:y.enum(["DESC","ASC"]).optional()}),ga=y.enum(["FLAT","TREE","RFR"]),ya=y.union([y.boolean(),y.string(),y.string().array(),y.undefined()]),_l=y.object({type:ga.optional(),menu:ma.optional(),path:y.string().optional(),locale:y.string().optional(),populate:ya.optional()}),Al=y.object({type:ga.optional(),menu:ma.optional(),locale:y.string().optional()}),Tl=y.object({source:y.string().min(1),target:y.string().min(1),documentId:y.string().min(1)});function Cl(e){return{getAdminService(){return oe(e,"admin")},getCommonService(){return oe(e,"common")},async get(){return await this.getAdminService().get({})},post(t){const{auditLog:n}=t;return this.getAdminService().post({payload:xc.parse(t.request.body),auditLog:n})},put(t){const{params:{documentId:n},auditLog:r}=t,i=y.record(y.string(),y.unknown()).parse(t.request.body);return this.getAdminService().put({auditLog:r,payload:_c.parse({...i,documentId:n})})},async delete(t){const{auditLog:n,params:{documentId:r}}=t;return await this.getAdminService().delete({documentId:Yt.parse(r),auditLog:n}),{}},config(){return this.getAdminService().config({viaSettingsPage:!1})},async updateConfig(t){return await this.getAdminService().updateConfig({config:Le.parse(t.request.body)}),{}},async restoreConfig(){return await this.getAdminService().restoreConfig(),{}},settingsConfig(){return this.getAdminService().config({viaSettingsPage:!0})},async settingsRestart(){return await this.getAdminService().restart(),{}},getById(t){const{params:{documentId:n}}=t;return this.getAdminService().getById({documentId:Yt.parse(n)})},getContentTypeItems(t){const{params:{model:n},query:r={}}=t;return this.getAdminService().getContentTypeItems({query:y.record(y.string(),y.unknown()).parse(r),uid:y.string().parse(n)})},async fillFromOtherLocale(t){const{params:n,auditLog:r}=t,{source:i,target:a,documentId:o}=Tl.parse(n);return await this.getAdminService().fillFromOtherLocale({source:i,target:a,documentId:o,auditLog:r})},readNavigationItemFromLocale(t){const{params:{source:n,target:r},query:{path:i}}=t;return this.getAdminService().readNavigationItemFromLocale({path:y.string().parse(i),source:Yt.parse(n),target:Yt.parse(r)})},getSlug(t){const{query:{q:n}}=t;return this.getCommonService().getSlug({query:y.string().parse(n)}).then(r=>({slug:r}))},settingsLocale(){return this.getCommonService().readLocale()}}}const Rl=e=>{if(!(!e||e===!0||e==="*")&&typeof e!="object")return Array.isArray(e),e};function Fl(e){return{getService(){return oe(e,"client")},async readAll(t){try{const{query:n={}}=t,{locale:r,orderBy:i,orderDirection:a}=Sl.parse(n);return await this.getService().readAll({locale:r,orderBy:i,orderDirection:a})}catch(n){if(n instanceof Error)return t.badRequest(n.message);throw n}},async render(t){const{params:n,query:r={}}=t,{type:i,menu:a,path:o,locale:s,populate:u}=_l.parse(r),c=y.string().parse(n.idOrSlug);return await this.getService().render({idOrSlug:c,type:i,menuOnly:a==="true",rootPath:o,locale:s,populate:Rl(ya.parse(u==="true"?!0:u==="false"?!1:Array.isArray(u)?u.map(l=>l==="true"?!0:l==="false"?!1:u):u))})},async renderChild(t){const{params:n,query:r={}}=t,{type:i,menu:a,locale:o}=Al.parse(r),s=y.string().parse(n.documentId),u=y.string().parse(n.childUIKey);return await this.getService().renderChildren({idOrSlug:s,childUIKey:u,type:i,menuOnly:a==="true",locale:o})}}}const $l={admin:Cl,client:Fl},Ol={},Il={},Nl={type:"admin",routes:[{method:"GET",path:"/",handler:"admin.get",config:{policies:[{name:"admin::hasPermissions",config:{actions:[de.render("read")]}}]}},{method:"POST",path:"/",handler:"admin.post",config:{policies:[{name:"admin::hasPermissions",config:{actions:[de.render("update")]}}]}},{method:"GET",path:"/config",handler:"admin.config",config:{policies:[{name:"admin::hasPermissions",config:{actions:[de.render("read")]}}]}},{method:"PUT",path:"/config",handler:"admin.updateConfig",config:{policies:[{name:"admin::hasPermissions",config:{actions:[de.render("settings")]}}]}},{method:"DELETE",path:"/config",handler:"admin.restoreConfig",config:{policies:[{name:"admin::hasPermissions",config:{actions:[de.render("settings")]}}]}},{method:"GET",path:"/slug",handler:"admin.getSlug",config:{policies:["admin::isAuthenticatedAdmin"]}},{method:"GET",path:"/:documentId",handler:"admin.getById",config:{policies:[{name:"admin::hasPermissions",config:{actions:[de.render("read")]}}]}},{method:"PUT",path:"/:documentId",handler:"admin.put",config:{policies:[{name:"admin::hasPermissions",config:{actions:[de.render("update")]}}]}},{method:"DELETE",path:"/:documentId",handler:"admin.delete",config:{policies:[{name:"admin::hasPermissions",config:{actions:[de.render("update")]}}]}},{method:"GET",path:"/content-type-items/:model",handler:"admin.getContentTypeItems",config:{policies:["admin::isAuthenticatedAdmin"]}},{method:"GET",path:"/settings/locale",handler:"admin.settingsLocale",config:{policies:["admin::isAuthenticatedAdmin"]}},{method:"GET",path:"/settings/config",handler:"admin.settingsConfig",config:{policies:[{name:"admin::hasPermissions",config:{actions:[de.render("settings")]}}]}},{method:"GET",path:"/settings/restart",handler:"admin.settingsRestart",config:{policies:[{name:"admin::hasPermissions",config:{actions:[de.render("settings")]}}]}},{method:"PUT",path:"/i18n/copy/:documentId/:source/:target",handler:"admin.fillFromOtherLocale",config:{policies:[{name:"admin::hasPermissions",config:{actions:[de.render("update")]}}]}},{method:"GET",path:"/i18n/item/read/:source/:target",handler:"admin.readNavigationItemFromLocale",config:{policies:[{name:"admin::hasPermissions",config:{actions:[de.render("read")]}}]}}]},Pl={type:"content-api",routes:[{method:"GET",path:"/render/:idOrSlug",handler:"client.render",config:{policies:[]}},{method:"GET",path:"/render/:idOrSlug/:childUIKey",handler:"client.renderChild",config:{policies:[]}},{method:"GET",path:"/",handler:"client.readAll",config:{policies:[]}}]},Ll={admin:Nl,"content-api":Pl};function kl(e,t){return he.default.has(process.env,e)?process.env[e]:t}function st(e){return process.env[e]??""}const Dl={int(e,t){return he.default.has(process.env,e)?parseInt(st(e),10):t},float(e,t){return he.default.has(process.env,e)?parseFloat(st(e)):t},bool(e,t){return he.default.has(process.env,e)?st(e)==="true":t},json(e,t){if(!he.default.has(process.env,e))return t;try{return JSON.parse(st(e))}catch(n){throw n instanceof Error?new Error(`Invalid json environment variable ${e}: ${n.message}`):n}},array(e,t){if(!he.default.has(process.env,e))return t;let n=st(e);return n.startsWith("[")&&n.endsWith("]")&&(n=n.substring(1,n.length-1)),n.split(",").map(r=>he.default.trim(he.default.trim(r," "),'"'))},date(e,t){return he.default.has(process.env,e)?new Date(st(e)):t},oneOf(e,t,n){if(!t)throw new Error("env.oneOf requires expectedValues");if(n&&!t.includes(n))throw new Error("env.oneOf requires defaultValue to be included in expectedValues");const r=Ml(e,n);return t.includes(r)?r:n}},Ml=Object.assign(kl,Dl),jl="id",Hl="documentId",Bl={ID_ATTRIBUTE:jl,DOC_ID_ATTRIBUTE:Hl},Ul=e=>R.union(strapi?.config?.get("api.responses.privateAttributes",[])??[],R.getOr([],"options.privateAttributes",e)),Gl=(e,t)=>e?.attributes?.[t]?.private===!0?!0:Ul(e).includes(t),va=e=>e&&!["media","component","relation","dynamiczone"].includes(e.type),ql=e=>e?.type==="media",wa=e=>e?.type==="relation",Kl=e=>!!e&&e.type==="dynamiczone",Ea=e=>!!e&&wa(e)&&e.relation?.startsWith?.("morphTo"),ht=async(e,t,n)=>{const{path:r={raw:null,attribute:null},schema:i,getModel:a}=t;let o=t.parent;const s=async(m,g,b)=>{const T={schema:a(b.__type),path:g,getModel:a,parent:o};return ht(m,T,b)},u=m=>async(g,b,S)=>ht(g,{schema:m,path:b,getModel:a,parent:o},S),c=async(m,g,b)=>{const A={schema:a("plugin::upload.file"),path:g,getModel:a,parent:o};return ht(m,A,b)},l=async(m,g,b,S)=>ht(m,{schema:b,path:g,getModel:a,parent:o},S),f=async(m,g,b)=>{const T={schema:a(b.__component),path:g,getModel:a,parent:o};return ht(m,T,b)};if(!R.isObject(n)||R.isNil(i))return n;const p=R.clone(n),d=zl({data:p}),h=Object.keys(p);for(let m=0;m<h.length;m+=1){const g=h[m],b=i.attributes[g],S={...r};S.raw=R.isNil(r.raw)?g:`${r.raw}.${g}`,R.isNil(b)||(S.attribute=R.isNil(r.attribute)?g:`${r.attribute}.${g}`);const T={data:p,schema:i,key:g,value:p[g],attribute:b,path:S,getModel:a,parent:o};await e(T,d);const A=p[g];if(!(R.isNil(A)||R.isNil(b))){if(o={schema:i,key:g,attribute:b,path:S},wa(b)){const F=b.relation.toLowerCase().startsWith("morph")?s:u(a(b.target));if(R.isArray(A)){const M=new Array(A.length);for(let x=0;x<A.length;x+=1)M[x]=await F(e,S,A[x]);p[g]=M}else p[g]=await F(e,S,A);continue}if(ql(b)){if(R.isArray(A)){const C=new Array(A.length);for(let F=0;F<A.length;F+=1)C[F]=await c(e,S,A[F]);p[g]=C}else p[g]=await c(e,S,A);continue}if(b.type==="component"){const C=a(b.component);if(R.isArray(A)){const F=new Array(A.length);for(let M=0;M<A.length;M+=1)F[M]=await l(e,S,C,A[M]);p[g]=F}else p[g]=await l(e,S,C,A);continue}if(b.type==="dynamiczone"&&R.isArray(A)){const C=new Array(A.length);for(let F=0;F<A.length;F+=1)C[F]=await f(e,S,A[F]);p[g]=C;continue}}}return p},zl=({data:e})=>({remove(t){delete e[t]},set(t,n){e[t]=n}});var Wl=R.curry(ht),me=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ba(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Yl={exports:{}};(function(e,t){(function(n,r){e.exports=r(cn.default,Fi.default)})(me,function(n,r){return function(i){function a(s){if(o[s])return o[s].exports;var u=o[s]={exports:{},id:s,loaded:!1};return i[s].call(u.exports,u,u.exports,a),u.loaded=!0,u.exports}var o={};return a.m=i,a.c=o,a.p="",a(0)}([function(i,a,o){i.exports=o(34)},function(i,a,o){var s=o(29)("wks"),u=o(33),c=o(2).Symbol,l=typeof c=="function",f=i.exports=function(p){return s[p]||(s[p]=l&&c[p]||(l?c:u)("Symbol."+p))};f.store=s},function(i,a){var o=i.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=o)},function(i,a,o){var s=o(9);i.exports=function(u){if(!s(u))throw TypeError(u+" is not an object!");return u}},function(i,a,o){i.exports=!o(24)(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},function(i,a,o){var s=o(12),u=o(17);i.exports=o(4)?function(c,l,f){return s.f(c,l,u(1,f))}:function(c,l,f){return c[l]=f,c}},function(i,a){var o=i.exports={version:"2.4.0"};typeof __e=="number"&&(__e=o)},function(i,a,o){var s=o(14);i.exports=function(u,c,l){if(s(u),c===void 0)return u;switch(l){case 1:return function(f){return u.call(c,f)};case 2:return function(f,p){return u.call(c,f,p)};case 3:return function(f,p,d){return u.call(c,f,p,d)}}return function(){return u.apply(c,arguments)}}},function(i,a){var o={}.hasOwnProperty;i.exports=function(s,u){return o.call(s,u)}},function(i,a){i.exports=function(o){return typeof o=="object"?o!==null:typeof o=="function"}},function(i,a){i.exports={}},function(i,a){var o={}.toString;i.exports=function(s){return o.call(s).slice(8,-1)}},function(i,a,o){var s=o(3),u=o(26),c=o(32),l=Object.defineProperty;a.f=o(4)?Object.defineProperty:function(f,p,d){if(s(f),p=c(p,!0),s(d),u)try{return l(f,p,d)}catch{}if("get"in d||"set"in d)throw TypeError("Accessors not supported!");return"value"in d&&(f[p]=d.value),f}},function(i,a,o){var s=o(42),u=o(15);i.exports=function(c){return s(u(c))}},function(i,a){i.exports=function(o){if(typeof o!="function")throw TypeError(o+" is not a function!");return o}},function(i,a){i.exports=function(o){if(o==null)throw TypeError("Can't call method on "+o);return o}},function(i,a,o){var s=o(9),u=o(2).document,c=s(u)&&s(u.createElement);i.exports=function(l){return c?u.createElement(l):{}}},function(i,a){i.exports=function(o,s){return{enumerable:!(1&o),configurable:!(2&o),writable:!(4&o),value:s}}},function(i,a,o){var s=o(12).f,u=o(8),c=o(1)("toStringTag");i.exports=function(l,f,p){l&&!u(l=p?l:l.prototype,c)&&s(l,c,{configurable:!0,value:f})}},function(i,a,o){var s=o(29)("keys"),u=o(33);i.exports=function(c){return s[c]||(s[c]=u(c))}},function(i,a){var o=Math.ceil,s=Math.floor;i.exports=function(u){return isNaN(u=+u)?0:(u>0?s:o)(u)}},function(i,a,o){var s=o(11),u=o(1)("toStringTag"),c=s(function(){return arguments}())=="Arguments",l=function(f,p){try{return f[p]}catch{}};i.exports=function(f){var p,d,h;return f===void 0?"Undefined":f===null?"Null":typeof(d=l(p=Object(f),u))=="string"?d:c?s(p):(h=s(p))=="Object"&&typeof p.callee=="function"?"Arguments":h}},function(i,a){i.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(i,a,o){var s=o(2),u=o(6),c=o(7),l=o(5),f="prototype",p=function(d,h,m){var g,b,S,T=d&p.F,A=d&p.G,C=d&p.S,F=d&p.P,M=d&p.B,x=d&p.W,_=A?u:u[h]||(u[h]={}),I=_[f],w=A?s:C?s[h]:(s[h]||{})[f];A&&(m=h);for(g in m)b=!T&&w&&w[g]!==void 0,b&&g in _||(S=b?w[g]:m[g],_[g]=A&&typeof w[g]!="function"?m[g]:M&&b?c(S,s):x&&w[g]==S?function(L){var H=function(K,E,v){if(this instanceof L){switch(arguments.length){case 0:return new L;case 1:return new L(K);case 2:return new L(K,E)}return new L(K,E,v)}return L.apply(this,arguments)};return H[f]=L[f],H}(S):F&&typeof S=="function"?c(Function.call,S):S,F&&((_.virtual||(_.virtual={}))[g]=S,d&p.R&&I&&!I[g]&&l(I,g,S)))};p.F=1,p.G=2,p.S=4,p.P=8,p.B=16,p.W=32,p.U=64,p.R=128,i.exports=p},function(i,a){i.exports=function(o){try{return!!o()}catch{return!0}}},function(i,a,o){i.exports=o(2).document&&document.documentElement},function(i,a,o){i.exports=!o(4)&&!o(24)(function(){return Object.defineProperty(o(16)("div"),"a",{get:function(){return 7}}).a!=7})},function(i,a,o){var s=o(28),u=o(23),c=o(57),l=o(5),f=o(8),p=o(10),d=o(45),h=o(18),m=o(52),g=o(1)("iterator"),b=!([].keys&&"next"in[].keys()),S="@@iterator",T="keys",A="values",C=function(){return this};i.exports=function(F,M,x,_,I,w,L){d(x,M,_);var H,K,E,v=function(D){if(!b&&D in z)return z[D];switch(D){case T:return function(){return new x(this,D)};case A:return function(){return new x(this,D)}}return function(){return new x(this,D)}},j=M+" Iterator",k=I==A,U=!1,z=F.prototype,Q=z[g]||z[S]||I&&z[I],ee=Q||v(I),Ce=I?k?v("entries"):ee:void 0,O=M=="Array"&&z.entries||Q;if(O&&(E=m(O.call(new F)),E!==Object.prototype&&(h(E,j,!0),s||f(E,g)||l(E,g,C))),k&&Q&&Q.name!==A&&(U=!0,ee=function(){return Q.call(this)}),s&&!L||!b&&!U&&z[g]||l(z,g,ee),p[M]=ee,p[j]=C,I)if(H={values:k?ee:v(A),keys:w?ee:v(T),entries:Ce},L)for(K in H)K in z||c(z,K,H[K]);else u(u.P+u.F*(b||U),M,H);return H}},function(i,a){i.exports=!0},function(i,a,o){var s=o(2),u="__core-js_shared__",c=s[u]||(s[u]={});i.exports=function(l){return c[l]||(c[l]={})}},function(i,a,o){var s,u,c,l=o(7),f=o(41),p=o(25),d=o(16),h=o(2),m=h.process,g=h.setImmediate,b=h.clearImmediate,S=h.MessageChannel,T=0,A={},C="onreadystatechange",F=function(){var x=+this;if(A.hasOwnProperty(x)){var _=A[x];delete A[x],_()}},M=function(x){F.call(x.data)};g&&b||(g=function(x){for(var _=[],I=1;arguments.length>I;)_.push(arguments[I++]);return A[++T]=function(){f(typeof x=="function"?x:Function(x),_)},s(T),T},b=function(x){delete A[x]},o(11)(m)=="process"?s=function(x){m.nextTick(l(F,x,1))}:S?(u=new S,c=u.port2,u.port1.onmessage=M,s=l(c.postMessage,c,1)):h.addEventListener&&typeof postMessage=="function"&&!h.importScripts?(s=function(x){h.postMessage(x+"","*")},h.addEventListener("message",M,!1)):s=C in d("script")?function(x){p.appendChild(d("script"))[C]=function(){p.removeChild(this),F.call(x)}}:function(x){setTimeout(l(F,x,1),0)}),i.exports={set:g,clear:b}},function(i,a,o){var s=o(20),u=Math.min;i.exports=function(c){return c>0?u(s(c),9007199254740991):0}},function(i,a,o){var s=o(9);i.exports=function(u,c){if(!s(u))return u;var l,f;if(c&&typeof(l=u.toString)=="function"&&!s(f=l.call(u))||typeof(l=u.valueOf)=="function"&&!s(f=l.call(u))||!c&&typeof(l=u.toString)=="function"&&!s(f=l.call(u)))return f;throw TypeError("Can't convert object to primitive value")}},function(i,a){var o=0,s=Math.random();i.exports=function(u){return"Symbol(".concat(u===void 0?"":u,")_",(++o+s).toString(36))}},function(i,a,o){function s(C){return C&&C.__esModule?C:{default:C}}function u(){return process.platform!=="win32"?"":process.arch==="ia32"&&process.env.hasOwnProperty("PROCESSOR_ARCHITEW6432")?"mixed":"native"}function c(C){return(0,g.createHash)("sha256").update(C).digest("hex")}function l(C){switch(S){case"darwin":return C.split("IOPlatformUUID")[1].split(`
|
|
1
|
+
"use strict";const Ie=require("zod"),B=require("lodash"),R=require("lodash/fp"),Iu=require("crypto"),Nu=require("child_process"),Pu=require("lodash/has"),Lu=require("lodash/mapValues"),ku=require("lodash/snakeCase"),Du=require("lodash/camelCase"),Mu=require("lodash/mapKeys"),ju=require("os"),Hu=require("path"),Bu=require("fs"),Uu=require("assert"),Gu=require("events"),qu=require("buffer"),Ku=require("stream"),zu=require("util"),Wu=require("constants");require("node:stream");const Yu=require("@sindresorhus/slugify"),Qu=require("pluralize"),se=e=>e&&e.__esModule?e:{default:e};function Vu(e){if(e&&e.__esModule)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const y=Vu(Ie),he=se(B),Fi=se(Iu),cn=se(Nu),ln=se(Pu),ia=se(Lu),$i=se(ku),Xu=se(Du),Zu=se(Mu),Pn=se(ju),be=se(Hu),ze=se(Bu),oa=se(Uu),Ju=se(Gu),ec=se(qu),Ln=se(Ku),it=se(zu),tc=se(Wu),nc=se(Yu),Oi=se(Qu),Gr=y.object({name:y.string().refine(e=>!e.includes(" "),{message:"No space allowed"}),label:y.string(),required:y.boolean().optional(),enabled:y.boolean().optional()}),rc=Gr.extend({type:y.literal("select"),multi:y.boolean(),options:y.array(y.string())}),ic=Gr.extend({type:y.enum(["boolean","string"]),multi:y.literal(!1).optional(),options:y.array(y.string()).max(0).optional()}),oc=Gr.extend({type:y.literal("media"),multi:y.literal(!1).optional(),options:y.array(y.string()).max(0).optional()}),ac=y.union([ic,oc,rc]),sc=y.union([y.literal("audience"),ac]),Le=y.object({additionalFields:y.array(sc),allowedLevels:y.number(),contentTypes:y.array(y.string()),contentTypesNameFields:y.record(y.string(),y.array(y.string())),contentTypesPopulate:y.record(y.string(),y.array(y.string())),gql:y.object({navigationItemRelated:y.array(y.string())}),pathDefaultFields:y.record(y.string(),y.any()),cascadeMenuAttached:y.boolean(),preferCustomContentTypes:y.boolean(),isCacheEnabled:y.boolean().optional()}),uc=y.enum(["collectionType","singleType"]),cc=y.object({singularName:y.string(),pluralName:y.string(),displayName:y.string(),description:y.string().optional(),name:y.string().optional()}),aa=y.object({required:y.boolean().optional(),max:y.number().optional(),min:y.number().optional(),minLength:y.number().optional(),maxLength:y.number().optional(),private:y.boolean().optional(),configurable:y.boolean().optional(),default:y.any().optional()}),lc=y.enum(["string","text","richtext","blocks","email","password","date","time","datetime","timestamp","boolean","integer","biginteger","float","decimal","json","relation","media"]),fc=aa.extend({type:lc}),pc=aa.extend({type:y.literal("enumeration"),enum:y.string().array()}),dc=y.object({type:y.literal("component"),component:y.string(),repeatable:y.boolean().optional()}),hc=y.object({type:y.literal("dynamiczone"),components:y.string().array()}),mc=y.object({type:y.literal("uid")}),gc=y.object({type:y.literal("media"),allowedTypes:y.enum(["images","videos","audios","files"]).array(),required:y.boolean().optional()}),yc=y.enum(["oneToOne","oneToMany","manyToOne","manyToMany","morphToMany","manyToMorph"]),vc=y.object({type:y.literal("relation"),relation:yc,target:y.string(),mappedBy:y.string().optional(),inversedBy:y.string().optional()}),wc=y.record(y.string(),y.union([fc,pc,dc,hc,vc,gc,mc])),Ar=y.object({kind:uc,collectionName:y.string(),info:cc,options:y.object({draftAndPublish:y.boolean().optional(),hidden:y.boolean().optional(),templateName:y.string().optional()}).optional(),attributes:wc,actions:y.record(y.string(),y.any()).optional(),lifecycles:y.record(y.string(),y.any()).optional(),uid:y.string(),apiName:y.string().optional(),associations:y.object({model:y.string(),alias:y.string()}).array().optional(),modelName:y.string().optional(),plugin:y.string().optional(),pluginOptions:y.record(y.string(),y.any()).optional(),isSingle:y.boolean().optional()});Ar.pick({info:!0,kind:!0,attributes:!0,options:!0});const sa=y.object({id:y.number(),documentId:y.string(),name:y.string(),key:y.string()}),Ec=y.enum(["INTERNAL","EXTERNAL","WRAPPER"]),qr=y.object({id:y.number(),documentId:y.string(),title:y.string(),type:Ec,path:y.string().or(y.null()).optional(),slug:y.string().or(y.null()).optional(),externalPath:y.string().or(y.null()).optional(),uiRouterKey:y.string(),menuAttached:y.boolean(),order:y.number().int(),collapsed:y.boolean(),related:y.object({documentId:y.string().optional(),__type:y.string()}).catchall(y.unknown()).nullish().optional(),additionalFields:y.record(y.string(),y.unknown()).or(y.null()).optional(),audience:y.array(sa).or(y.null()).optional(),autoSync:y.boolean().or(y.null()).optional()}),bc=qr.omit({related:!0}).pick({path:!0,type:!0,uiRouterKey:!0,title:!0,externalPath:!0}).extend({related:y.unknown().optional()}),Lt=qr.extend({parent:y.lazy(()=>Lt.or(y.null())).optional(),items:y.lazy(()=>Lt.array()).optional(),master:y.lazy(()=>Ve(!1)).optional()}),Ii=y.array(Lt),Ve=e=>y.object({id:y.number(),documentId:y.string(),name:y.string(),slug:y.string(),locale:y.string(),visible:y.boolean(),items:e?y.array(Lt):Lt.array().optional()}),xc=Ve(!1).omit({items:!0,id:!0,documentId:!0,slug:!0,locale:!0}).extend({documentId:y.string().optional(),id:y.undefined().optional()}),Sc=qr.omit({id:!0,documentId:!0}).extend({id:y.number().optional(),documentId:y.string().optional(),items:y.lazy(()=>ua).or(y.null()).optional(),updated:y.boolean().optional(),removed:y.boolean().optional()}),ua=y.array(Sc),_c=Ve(!1).extend({items:ua}).partial().required({id:!0,documentId:!0}),Ac=/^(?<type>[a-z0-9-]+)\:{2}(?<api>[a-z0-9-]+)\.{1}(?<contentType>[a-z0-9-]+)$/i,Tc=["beforeCreate","beforeCreateMany","afterCreate","afterCreateMany","beforeUpdate","beforeUpdateMany","afterUpdate","afterUpdateMany","beforeDelete","beforeDeleteMany","afterDelete","afterDeleteMany","beforeCount","afterCount","beforeFindOne","afterFindOne","beforeFindMany","afterFindMany"],Cc="$",ca=["api::","plugin::"],la=["admin::","plugin::content-releases","plugin::i18n.locale","plugin::navigation","plugin::review-workflows","plugin::users-permissions","plugin::upload.folder"],Rc=["title","subject","name"],Ni={SINGLE:"singleType"},Pi=["title","type","path","externalPath","uiRouterKey","menuAttached","order","collapsed","related","parent","master","audience","additionalFields"],Fc=e=>e.filter(t=>t!=="audience"),fa=e=>{const t=Fc(e);if(t.length!==B.uniqBy(t,"name").length)throw new Error("All names of custom fields must be unique.");if(!B.isNil(B.find(t,n=>typeof n=="object"&&B.includes(Pi,n.name))))throw new Error(`Name of custom field cannot be one of: ${Pi.join(", ")}`)},pa=(e,t)=>{if(e==null)throw t??new Error("Non-empty value expected, empty given")},$c=(e="")=>{const t=a=>a.split("-").map(o=>B.capitalize(o)).join(""),[n,r,i]=Oc(e);return n==="api"?t(i):`${t(r)}${t(i)}`},Oc=(e="")=>e.split(Ac).filter(t=>t&&t.length>0),Ic=(e,t)=>n=>[n,async r=>{await oe(t,"common").runLifeCycleHook({contentTypeName:e,hookName:n,event:r})}],da=(e,t)=>Object.fromEntries(Tc.map(Ic(e,t))),we=({strapi:e})=>{const t=e.plugin("navigation");return{masterModel:t.contentType("navigation"),itemModel:t.contentType("navigation-item"),relatedModel:t.contentType("navigations-items-related"),audienceModel:t.contentType("audience")}};function oe({strapi:e},t){return e.plugin("navigation").service(t)}const Wt=e=>e==="*"?"*":typeof e=="string"?[e]:e===!1?[]:e===!0?"*":e,Nc=(e="")=>{const t=!!ca.find(r=>e.includes(r)),n=!la.find(r=>e.includes(r)||e===r);return!!e&&t&&n},Li=(e="")=>B.last(e)==="s"?e.substr(0,e.length-1):e,ha=async({strapi:e,forceDefault:t=!1})=>{const n=e.store({type:"plugin",name:"navigation"}),r=await e.plugin("navigation").config,i=t?{}:{...Tr.default,...await n.get({key:"config"})??Tr.default};let a=B.isEmpty(i)?i:Le.parse(i);const o=Pc(a,r);return a={additionalFields:o("additionalFields"),contentTypes:o("contentTypes"),contentTypesNameFields:o("contentTypesNameFields"),contentTypesPopulate:o("contentTypesPopulate"),allowedLevels:o("allowedLevels"),gql:o("gql"),pathDefaultFields:o("pathDefaultFields"),cascadeMenuAttached:o("cascadeMenuAttached"),preferCustomContentTypes:o("preferCustomContentTypes"),isCacheEnabled:o("isCacheEnabled")},Lc(a,{strapi:e}),fa(a.additionalFields),await n.set({key:"config",value:a}),a},Pc=(e,t)=>n=>{const r=e?.[n]??t(n);return pa(r,new Error(`[Navigation] Config "${n}" is undefined`)),r},Lc=(e,{strapi:t})=>{const n=e.contentTypes.filter(i=>!t.contentTypes[i]);if(n.length===0)return;const r=n.map($c);e.contentTypes=e.contentTypes.filter(i=>!n.includes(i)),e.contentTypesNameFields=Object.fromEntries(Object.entries(e.contentTypesNameFields).filter(([i])=>!n.includes(i))),e.gql.navigationItemRelated=e.gql.navigationItemRelated.filter(i=>!r.includes(i))},Tr={default:{additionalFields:[],allowedLevels:2,contentTypes:[],contentTypesNameFields:{},contentTypesPopulate:{},gql:{navigationItemRelated:[]},pathDefaultFields:{},pruneObsoleteI18nNavigations:!1,cascadeMenuAttached:!0,preferCustomContentTypes:!1,isCacheEnabled:!1}},kc=B.once(e=>({find(t,n){const{audienceModel:{uid:r}}=we(e);return e.strapi.query(r).findMany({where:t,limit:n}).then(sa.array().parse)}})),fn=(e,t)=>({findFirst(n,r,i={}){return e.strapi.documents(t).findFirst({populate:Wt(n),status:r,...i})},findById(n,r,i,a={}){return e.strapi.documents(t).findOne({documentId:n,populate:Wt(r),status:i,...a})},findManyById(n,r,i){return e.strapi.documents(t).findMany({where:{documentId:{$in:n}},populate:Wt(r),status:i})},findMany(n,r,i,a){return e.strapi.documents(t).findMany({where:n,populate:Wt(r),status:i,locale:a})},count(n,r){return e.strapi.documents(t).count({where:n,status:r})}}),Pe=B.once(e=>({async save({item:t,locale:n}){const{itemModel:r}=we(e),{__type:i,documentId:a}=t?.related??{},o=i?fn(e,i):void 0,s=i&&o?a?await o.findById(a,void 0,void 0,{locale:n}):await o.findFirst(void 0,void 0,{locale:n}):void 0;if(typeof t.documentId=="string"){const{documentId:u,...c}=t;return e.strapi.documents(r.uid).update({documentId:t.documentId,data:{...c,related:s?{...s,__type:i}:void 0},locale:n})}else return e.strapi.documents(r.uid).create({data:{...t,related:s?{...s,__type:i}:void 0},locale:n})},find({filters:t,locale:n,limit:r,order:i,populate:a}){const{itemModel:o}=we(e);return e.strapi.documents(o.uid).findMany({filters:t,locale:n,limit:r,populate:a,orderBy:i}).then(s=>s.map(Cr)).then(Ii.parse).then(s=>s.map(pn))},findV4({filters:t,locale:n,limit:r,order:i,populate:a}){const{itemModel:o}=we(e);return e.strapi.documents(o.uid).findMany({filters:t,locale:n,limit:r,populate:a,orderBy:i})},count(t){const{itemModel:n}=we(e);return e.strapi.query(n.uid).count({where:t})},remove(t){const{itemModel:n}=we(e);return e.strapi.documents(n.uid).delete({documentId:t.documentId,populate:"*"})},removeForIds(t){const{itemModel:n}=we(e);return t.map(r=>e.strapi.documents(n.uid).delete({documentId:r,populate:"*"}))},findForMasterIds(t){const{itemModel:n}=we(e);return e.strapi.query(n.uid).findMany({where:{$or:t.map(r=>({master:r}))},limit:Number.MAX_SAFE_INTEGER}).then(Ii.parse)}})),Dc=["id","publishedAt","createdAt","updatedAt","locale"],pn=({related:e,items:t=[],...n})=>({...n,items:t.map(pn),related:e?B.omit(e,Dc):void 0}),Cr=({related:e,...t})=>({...t,related:e?.[0]});class xt extends Error{constructor(t,n){super(t),this.additionalInfo=n,this.type="NavigationError"}}class nr extends xt{constructor(){super(...arguments),this.type="FillNavigationError"}}class Mc extends xt{constructor(){super(...arguments),this.type="InvalidParamNavigationError"}}const ki=e=>e===!0?!0:Array.isArray(e)?e.includes("items"):!1,Ne=B.once(e=>({find({filters:t,locale:n,limit:r,orderBy:i,populate:a}){const{masterModel:o}=we(e);return e.strapi.documents(o.uid).findMany({filters:t,locale:n,limit:r,populate:a,orderBy:i}).then(s=>s.map(({items:u,...c})=>({...c,items:u?.map(Cr)}))).then(s=>s.map(({items:u,...c})=>({...c,items:u?.map(pn)}))).then(s=>Ve(ki(a)).array().parse(s))},findOne({locale:t,filters:n,populate:r}){const{masterModel:i}=we(e);return e.strapi.documents(i.uid).findOne({documentId:n.documentId,locale:t,populate:r}).then(a=>a&&{...a,items:a.items?.map(Cr)}).then(a=>Ve(ki(r)).parse(a)).then(a=>({...a,items:a.items?.map(pn)}))},async save(t){const{masterModel:n}=we(e),{documentId:r,locale:i,...a}=t;return r?e.strapi.documents(n.uid).update({locale:i,documentId:r,data:B.omit(a,["id","documentId"]),populate:["items"]}).then(Ve(!1).parse):e.strapi.documents(n.uid).create({locale:i,data:{...a,populate:["items"]}}).then(Ve(!1).parse)},remove(t){const{masterModel:n}=we(e);if(!t.documentId)throw new xt("Document id is required.");return e.strapi.documents(n.uid).delete({documentId:t.documentId})}})),jc="Navigation",Hc="navigation",Bc=async e=>{const t=oe(e,"common"),{defaultLocale:n,restLocale:r=[]}=await t.readLocale(),i=Ne(e),a=await i.find({limit:Number.MAX_SAFE_INTEGER,filters:{},locale:"*"});a.length===0&&a.push(await i.save({name:jc,visible:!0,locale:n,slug:Hc}));const o=a.filter(({locale:s})=>s===n);for(const s of o)for(const u of r)!a.find(({locale:l,documentId:f})=>f===s.documentId&&u===l)&&await i.save({documentId:s.documentId,name:s.name,locale:u,visible:s.visible,slug:s.slug})},de={render:function(e){return`plugin::navigation.${e}`},navigation:{read:"read",update:"update",settings:"settings"}},Uc=async({strapi:e})=>{const t=[{section:"plugins",displayName:"Read",uid:de.navigation.read,pluginName:"navigation"},{section:"plugins",displayName:"Update",uid:de.navigation.update,pluginName:"navigation"},{section:"plugins",displayName:"Settings",uid:de.navigation.settings,pluginName:"navigation"}];await e.admin.services.permission.actionProvider.registerMany(t)},Gc=({nexus:e})=>e.objectType({name:"ContentTypes",definition(t){t.nonNull.string("uid"),t.nonNull.string("name"),t.nonNull.boolean("isSingle"),t.nonNull.string("collectionName"),t.nonNull.string("contentTypeName"),t.nonNull.string("label"),t.nonNull.string("relatedField"),t.nonNull.string("labelSingular"),t.nonNull.string("endpoint"),t.nonNull.boolean("available"),t.nonNull.boolean("visible")}}),qc=({nexus:e,strapi:t})=>e.objectType({name:"ContentTypesNameFields",async definition(n){n.nonNull.list.nonNull.string("default");const i=await oe({strapi:t},"common").getPluginStore(),o=Le.parse(await i.get({key:"config"})).contentTypesNameFields;Object.keys(o||{}).forEach(s=>n.nonNull.list.string(s))}}),Kc=({nexus:e})=>e.inputObjectType({name:"CreateNavigation",definition(t){t.nonNull.string("name"),t.nonNull.list.field("items",{type:"CreateNavigationItem"})}}),zc=({nexus:e})=>e.inputObjectType({name:"CreateNavigationItem",definition(t){t.nonNull.string("title"),t.nonNull.field("type",{type:"NavigationItemType"}),t.string("path"),t.string("externalPath"),t.nonNull.string("uiRouterKey"),t.nonNull.boolean("menuAttached"),t.nonNull.int("order"),t.string("parent"),t.string("master"),t.list.field("items",{type:"CreateNavigationItem"}),t.list.string("audience"),t.field("related",{type:"CreateNavigationRelated"})}}),Wc=({nexus:e})=>e.inputObjectType({name:"CreateNavigationRelated",definition(t){t.nonNull.string("ref"),t.nonNull.string("field"),t.nonNull.string("refId")}}),Yc=({nexus:e})=>e.objectType({name:"Navigation",definition(t){t.nonNull.string("id"),t.nonNull.string("documentId"),t.nonNull.string("name"),t.nonNull.string("slug"),t.nonNull.boolean("visible")}}),Qc=({nexus:e})=>e.objectType({name:"NavigationConfig",definition(t){t.int("allowedLevels"),t.nonNull.list.string("additionalFields"),t.field("contentTypesNameFields",{type:"ContentTypesNameFields"}),t.list.field("contentTypes",{type:"ContentTypes"})}}),Vc=({nexus:e})=>e.objectType({name:"NavigationDetails",definition(t){t.nonNull.string("id"),t.nonNull.string("documentId"),t.nonNull.string("name"),t.nonNull.string("slug"),t.nonNull.boolean("visible"),t.nonNull.list.field("items",{type:"NavigationItem"})}}),Xc=({nexus:e,config:t})=>e.objectType({name:"NavigationItem",definition(n){n.nonNull.int("id"),n.nonNull.string("documentId"),n.nonNull.string("title"),n.nonNull.field("type",{type:"NavigationItemType"}),n.string("path"),n.string("externalPath"),n.nonNull.string("uiRouterKey"),n.nonNull.boolean("menuAttached"),n.nonNull.int("order"),n.field("parent",{type:"NavigationItem"}),n.string("master"),n.list.field("items",{type:"NavigationItem"}),n.field("related",{type:"NavigationItemRelated"}),t.additionalFields.find(r=>r==="audience")&&n.list.string("audience"),n.field("additionalFields",{type:"NavigationItemAdditionalFields"}),n.string("created_at"),n.string("updated_at"),n.string("created_by"),n.string("updated_by"),n.string("createdAt"),n.string("updatedAt"),n.string("createdBy"),n.string("updatedBy")}}),Zc=({nexus:e,config:t})=>e.objectType({name:"NavigationItemAdditionalFields",definition(n){t.additionalFields.forEach(r=>{if(r!=="audience"&&r.enabled)switch(r.type){case"media":n.field(r.name,{type:"UploadFile"});break;case"string":n.string(r.name);break;case"boolean":n.boolean(r.name);break;case"select":r.multi?n.list.string(r.name):n.string(r.name);break;default:throw new Error(`Type "${JSON.stringify(r.type)}" is unsupported by custom fields`)}})}}),Jc=({strapi:e,nexus:t,config:n})=>{const r=n.gql?.navigationItemRelated,i="NavigationItemRelated";return r?.length?t.unionType({name:i,definition(a){a.members(...r)},resolveType:a=>e.contentTypes[a.__type]?.globalId}):t.objectType({name:i,definition(a){a.int("id"),a.string("documentId"),a.string("title"),a.string("name")}})},el=({nexus:e})=>e.enumType({name:"NavigationItemType",members:["INTERNAL","EXTERNAL","WRAPPER"]}),tl=({nexus:e})=>e.enumType({name:"NavigationRenderType",members:["FLAT","TREE"]}),nl=[Zc,Jc,Xc,tl,Yc,Vc,qc,Gc,Qc,Wc,zc,Kc,el],rl=e=>nl.map(t=>t(e)),il="I18NLocaleCode",ol=({strapi:e,nexus:t})=>{const{nonNull:n,list:r,stringArg:i,booleanArg:a}=t;return{args:{navigationIdOrSlug:n(i()),type:"NavigationRenderType",menuOnly:a(),path:i(),locale:t.arg({type:il})},type:n(r("NavigationItem")),resolve(u,{navigationIdOrSlug:c,type:l,menuOnly:f,path:p,locale:d}){const h=Ie.z.string().parse(c);return oe({strapi:e},"client").render({idOrSlug:h,type:l,rootPath:p,locale:d,menuOnly:f,wrapRelated:!0})}}},al=({strapi:e,nexus:t})=>{const{nonNull:n,list:r,stringArg:i,booleanArg:a}=t;return{type:n(r("NavigationItem")),args:{documentId:n(i()),childUiKey:n(i()),type:"NavigationRenderType",menuOnly:a()},resolve(o,s){const{documentId:u,childUIKey:c,type:l,menuOnly:f}=s,p=Ie.z.string().parse(u);return oe({strapi:e},"client").renderChildren({idOrSlug:p,childUIKey:c,type:l,menuOnly:f,wrapRelated:!0})}}},sl=e=>{const t={renderNavigationChild:al,renderNavigation:ol};return e.nexus.extendType({type:"Query",definition(n){for(const[r,i]of Object.entries(t)){const a=i(e);n.field(r,a)}}})},ul=()=>({"Query.renderNavigationChild":{auth:!1},"Query.renderNavigation":{auth:!1}}),cl=async({strapi:e})=>{const t=e.plugin("graphql").service("extension");t.shadowCRUD("plugin::navigation.audience").disable(),t.shadowCRUD("plugin::navigation.navigation").disable(),t.shadowCRUD("plugin::navigation.navigation-item").disable(),t.shadowCRUD("plugin::navigation.navigations-items-related").disable();const r=await oe({strapi:e},"common").getPluginStore(),i=Le.parse(await r.get({key:"config"}));t.use(({strapi:a,nexus:o})=>{const s=rl({strapi:a,nexus:o,config:i}),u=sl({strapi:a,nexus:o}),c=ul();return{types:[s,u],resolversConfig:c}})},ll=async({strapi:e})=>{!!e.plugin("graphql")&&await cl({strapi:e})},fl=async e=>{await ha(e),await Bc(e),await Uc(e),await ll(e),await strapi.service("plugin::navigation.migrate").migrateRelatedIdToDocumentId()},pl=({strapi:e})=>{},dl=({strapi:e})=>{},hl={collectionName:"audience",info:{singularName:"audience",pluralName:"audiences",displayName:"Audience",name:"audience"},options:{increments:!0,comment:"Audience"},attributes:{name:{type:"string",required:!0},key:{type:"uid",targetField:"name"}}},ml={schema:hl},gl=da("navigation",{strapi}),yl={collectionName:"navigations",info:{singularName:"navigation",pluralName:"navigations",displayName:"Navigation",name:"navigation"},options:{comment:""},pluginOptions:{"content-manager":{visible:!1},"content-type-builder":{visible:!1},i18n:{localized:!0}},attributes:{name:{type:"text",configurable:!1,required:!0},slug:{type:"uid",target:"name",configurable:!1,required:!0},visible:{type:"boolean",default:!1,configurable:!1},items:{type:"relation",relation:"oneToMany",target:"plugin::navigation.navigation-item",configurable:!1,mappedBy:"master"}}},vl={schema:yl,lifecycles:gl},wl=da("navigation-item",{strapi}),El={collectionName:"navigations_items",info:{singularName:"navigation-item",pluralName:"navigation-items",displayName:"Navigation Item",name:"navigation-item"},options:{increments:!0,timestamps:!0,comment:"Navigation Item"},pluginOptions:{"content-manager":{visible:!1},"content-type-builder":{visible:!1},i18n:{localized:!1}},attributes:{title:{type:"text",configurable:!1,required:!0,pluginOptions:{i18n:{localized:!1}}},type:{type:"enumeration",enum:["INTERNAL","EXTERNAL","WRAPPER"],default:"INTERNAL",configurable:!1},path:{type:"text",targetField:"title",configurable:!1},externalPath:{type:"text",configurable:!1},uiRouterKey:{type:"string",configurable:!1},menuAttached:{type:"boolean",default:!1,configurable:!1},order:{type:"integer",default:0,configurable:!1},collapsed:{type:"boolean",default:!1,configurable:!1},autoSync:{type:"boolean",default:!0,configurable:!1},related:{type:"relation",relation:"morphToMany",required:!0,configurable:!1},parent:{type:"relation",relation:"oneToOne",target:"plugin::navigation.navigation-item",configurable:!1,default:null},master:{type:"relation",relation:"manyToOne",target:"plugin::navigation.navigation",configurable:!1,inversedBy:"items"},audience:{type:"relation",relation:"oneToMany",target:"plugin::navigation.audience"},additionalFields:{type:"json",require:!1,default:{}}}},bl={schema:El,lifecycles:wl},xl={audience:ml,navigation:vl,"navigation-item":bl},ma=y.enum(["true","false"]),Yt=y.string(),Sl=y.object({locale:y.string().optional(),orderBy:y.string().optional(),orderDirection:y.enum(["DESC","ASC"]).optional()}),ga=y.enum(["FLAT","TREE","RFR"]),ya=y.union([y.boolean(),y.string(),y.string().array(),y.undefined()]),_l=y.object({type:ga.optional(),menu:ma.optional(),path:y.string().optional(),locale:y.string().optional(),populate:ya.optional()}),Al=y.object({type:ga.optional(),menu:ma.optional(),locale:y.string().optional()}),Tl=y.object({source:y.string().min(1),target:y.string().min(1),documentId:y.string().min(1)});function Cl(e){return{getAdminService(){return oe(e,"admin")},getCommonService(){return oe(e,"common")},async get(){return await this.getAdminService().get({})},post(t){const{auditLog:n}=t;return this.getAdminService().post({payload:xc.parse(t.request.body),auditLog:n})},put(t){const{params:{documentId:n},auditLog:r}=t,i=y.record(y.string(),y.unknown()).parse(t.request.body);return this.getAdminService().put({auditLog:r,payload:_c.parse({...i,documentId:n})})},async delete(t){const{auditLog:n,params:{documentId:r}}=t;return await this.getAdminService().delete({documentId:Yt.parse(r),auditLog:n}),{}},config(){return this.getAdminService().config({viaSettingsPage:!1})},async updateConfig(t){return await this.getAdminService().updateConfig({config:Le.parse(t.request.body)}),{}},async restoreConfig(){return await this.getAdminService().restoreConfig(),{}},settingsConfig(){return this.getAdminService().config({viaSettingsPage:!0})},async settingsRestart(){return await this.getAdminService().restart(),{}},getById(t){const{params:{documentId:n}}=t;return this.getAdminService().getById({documentId:Yt.parse(n)})},getContentTypeItems(t){const{params:{model:n},query:r={}}=t;return this.getAdminService().getContentTypeItems({query:y.record(y.string(),y.unknown()).parse(r),uid:y.string().parse(n)})},async fillFromOtherLocale(t){const{params:n,auditLog:r}=t,{source:i,target:a,documentId:o}=Tl.parse(n);return await this.getAdminService().fillFromOtherLocale({source:i,target:a,documentId:o,auditLog:r})},readNavigationItemFromLocale(t){const{params:{source:n,target:r},query:{path:i}}=t;return this.getAdminService().readNavigationItemFromLocale({path:y.string().parse(i),source:Yt.parse(n),target:Yt.parse(r)})},getSlug(t){const{query:{q:n}}=t;return this.getCommonService().getSlug({query:y.string().parse(n)}).then(r=>({slug:r}))},settingsLocale(){return this.getCommonService().readLocale()}}}const Rl=e=>{if(!(!e||e===!0||e==="*")&&typeof e!="object")return Array.isArray(e),e};function Fl(e){return{getService(){return oe(e,"client")},async readAll(t){try{const{query:n={}}=t,{locale:r,orderBy:i,orderDirection:a}=Sl.parse(n);return await this.getService().readAll({locale:r,orderBy:i,orderDirection:a})}catch(n){if(n instanceof Error)return t.badRequest(n.message);throw n}},async render(t){const{params:n,query:r={}}=t,{type:i,menu:a,path:o,locale:s,populate:u}=_l.parse(r),c=y.string().parse(n.idOrSlug);return await this.getService().render({idOrSlug:c,type:i,menuOnly:a==="true",rootPath:o,locale:s,populate:Rl(ya.parse(u==="true"?!0:u==="false"?!1:Array.isArray(u)?u.map(l=>l==="true"?!0:l==="false"?!1:u):u))})},async renderChild(t){const{params:n,query:r={}}=t,{type:i,menu:a,locale:o}=Al.parse(r),s=y.string().parse(n.documentId),u=y.string().parse(n.childUIKey);return await this.getService().renderChildren({idOrSlug:s,childUIKey:u,type:i,menuOnly:a==="true",locale:o})}}}const $l={admin:Cl,client:Fl},Ol={},Il={},Nl={type:"admin",routes:[{method:"GET",path:"/",handler:"admin.get",config:{policies:[{name:"admin::hasPermissions",config:{actions:[de.render("read")]}}]}},{method:"POST",path:"/",handler:"admin.post",config:{policies:[{name:"admin::hasPermissions",config:{actions:[de.render("update")]}}]}},{method:"GET",path:"/config",handler:"admin.config",config:{policies:[{name:"admin::hasPermissions",config:{actions:[de.render("read")]}}]}},{method:"PUT",path:"/config",handler:"admin.updateConfig",config:{policies:[{name:"admin::hasPermissions",config:{actions:[de.render("settings")]}}]}},{method:"DELETE",path:"/config",handler:"admin.restoreConfig",config:{policies:[{name:"admin::hasPermissions",config:{actions:[de.render("settings")]}}]}},{method:"GET",path:"/slug",handler:"admin.getSlug",config:{policies:["admin::isAuthenticatedAdmin"]}},{method:"GET",path:"/:documentId",handler:"admin.getById",config:{policies:[{name:"admin::hasPermissions",config:{actions:[de.render("read")]}}]}},{method:"PUT",path:"/:documentId",handler:"admin.put",config:{policies:[{name:"admin::hasPermissions",config:{actions:[de.render("update")]}}]}},{method:"DELETE",path:"/:documentId",handler:"admin.delete",config:{policies:[{name:"admin::hasPermissions",config:{actions:[de.render("update")]}}]}},{method:"GET",path:"/content-type-items/:model",handler:"admin.getContentTypeItems",config:{policies:["admin::isAuthenticatedAdmin"]}},{method:"GET",path:"/settings/locale",handler:"admin.settingsLocale",config:{policies:["admin::isAuthenticatedAdmin"]}},{method:"GET",path:"/settings/config",handler:"admin.settingsConfig",config:{policies:[{name:"admin::hasPermissions",config:{actions:[de.render("settings")]}}]}},{method:"GET",path:"/settings/restart",handler:"admin.settingsRestart",config:{policies:[{name:"admin::hasPermissions",config:{actions:[de.render("settings")]}}]}},{method:"PUT",path:"/i18n/copy/:documentId/:source/:target",handler:"admin.fillFromOtherLocale",config:{policies:[{name:"admin::hasPermissions",config:{actions:[de.render("update")]}}]}},{method:"GET",path:"/i18n/item/read/:source/:target",handler:"admin.readNavigationItemFromLocale",config:{policies:[{name:"admin::hasPermissions",config:{actions:[de.render("read")]}}]}}]},Pl={type:"content-api",routes:[{method:"GET",path:"/render/:idOrSlug",handler:"client.render",config:{policies:[]}},{method:"GET",path:"/render/:idOrSlug/:childUIKey",handler:"client.renderChild",config:{policies:[]}},{method:"GET",path:"/",handler:"client.readAll",config:{policies:[]}}]},Ll={admin:Nl,"content-api":Pl};function kl(e,t){return he.default.has(process.env,e)?process.env[e]:t}function st(e){return process.env[e]??""}const Dl={int(e,t){return he.default.has(process.env,e)?parseInt(st(e),10):t},float(e,t){return he.default.has(process.env,e)?parseFloat(st(e)):t},bool(e,t){return he.default.has(process.env,e)?st(e)==="true":t},json(e,t){if(!he.default.has(process.env,e))return t;try{return JSON.parse(st(e))}catch(n){throw n instanceof Error?new Error(`Invalid json environment variable ${e}: ${n.message}`):n}},array(e,t){if(!he.default.has(process.env,e))return t;let n=st(e);return n.startsWith("[")&&n.endsWith("]")&&(n=n.substring(1,n.length-1)),n.split(",").map(r=>he.default.trim(he.default.trim(r," "),'"'))},date(e,t){return he.default.has(process.env,e)?new Date(st(e)):t},oneOf(e,t,n){if(!t)throw new Error("env.oneOf requires expectedValues");if(n&&!t.includes(n))throw new Error("env.oneOf requires defaultValue to be included in expectedValues");const r=Ml(e,n);return t.includes(r)?r:n}},Ml=Object.assign(kl,Dl),jl="id",Hl="documentId",Bl={ID_ATTRIBUTE:jl,DOC_ID_ATTRIBUTE:Hl},Ul=e=>R.union(strapi?.config?.get("api.responses.privateAttributes",[])??[],R.getOr([],"options.privateAttributes",e)),Gl=(e,t)=>e?.attributes?.[t]?.private===!0?!0:Ul(e).includes(t),va=e=>e&&!["media","component","relation","dynamiczone"].includes(e.type),ql=e=>e?.type==="media",wa=e=>e?.type==="relation",Kl=e=>!!e&&e.type==="dynamiczone",Ea=e=>!!e&&wa(e)&&e.relation?.startsWith?.("morphTo"),ht=async(e,t,n)=>{const{path:r={raw:null,attribute:null},schema:i,getModel:a}=t;let o=t.parent;const s=async(m,g,b)=>{const T={schema:a(b.__type),path:g,getModel:a,parent:o};return ht(m,T,b)},u=m=>async(g,b,S)=>ht(g,{schema:m,path:b,getModel:a,parent:o},S),c=async(m,g,b)=>{const A={schema:a("plugin::upload.file"),path:g,getModel:a,parent:o};return ht(m,A,b)},l=async(m,g,b,S)=>ht(m,{schema:b,path:g,getModel:a,parent:o},S),f=async(m,g,b)=>{const T={schema:a(b.__component),path:g,getModel:a,parent:o};return ht(m,T,b)};if(!R.isObject(n)||R.isNil(i))return n;const p=R.clone(n),d=zl({data:p}),h=Object.keys(p);for(let m=0;m<h.length;m+=1){const g=h[m],b=i.attributes[g],S={...r};S.raw=R.isNil(r.raw)?g:`${r.raw}.${g}`,R.isNil(b)||(S.attribute=R.isNil(r.attribute)?g:`${r.attribute}.${g}`);const T={data:p,schema:i,key:g,value:p[g],attribute:b,path:S,getModel:a,parent:o};await e(T,d);const A=p[g];if(!(R.isNil(A)||R.isNil(b))){if(o={schema:i,key:g,attribute:b,path:S},wa(b)){const F=b.relation.toLowerCase().startsWith("morph")?s:u(a(b.target));if(R.isArray(A)){const M=new Array(A.length);for(let x=0;x<A.length;x+=1)M[x]=await F(e,S,A[x]);p[g]=M}else p[g]=await F(e,S,A);continue}if(ql(b)){if(R.isArray(A)){const C=new Array(A.length);for(let F=0;F<A.length;F+=1)C[F]=await c(e,S,A[F]);p[g]=C}else p[g]=await c(e,S,A);continue}if(b.type==="component"){const C=a(b.component);if(R.isArray(A)){const F=new Array(A.length);for(let M=0;M<A.length;M+=1)F[M]=await l(e,S,C,A[M]);p[g]=F}else p[g]=await l(e,S,C,A);continue}if(b.type==="dynamiczone"&&R.isArray(A)){const C=new Array(A.length);for(let F=0;F<A.length;F+=1)C[F]=await f(e,S,A[F]);p[g]=C;continue}}}return p},zl=({data:e})=>({remove(t){delete e[t]},set(t,n){e[t]=n}});var Wl=R.curry(ht),me=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ba(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Yl={exports:{}};(function(e,t){(function(n,r){e.exports=r(cn.default,Fi.default)})(me,function(n,r){return function(i){function a(s){if(o[s])return o[s].exports;var u=o[s]={exports:{},id:s,loaded:!1};return i[s].call(u.exports,u,u.exports,a),u.loaded=!0,u.exports}var o={};return a.m=i,a.c=o,a.p="",a(0)}([function(i,a,o){i.exports=o(34)},function(i,a,o){var s=o(29)("wks"),u=o(33),c=o(2).Symbol,l=typeof c=="function",f=i.exports=function(p){return s[p]||(s[p]=l&&c[p]||(l?c:u)("Symbol."+p))};f.store=s},function(i,a){var o=i.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=o)},function(i,a,o){var s=o(9);i.exports=function(u){if(!s(u))throw TypeError(u+" is not an object!");return u}},function(i,a,o){i.exports=!o(24)(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},function(i,a,o){var s=o(12),u=o(17);i.exports=o(4)?function(c,l,f){return s.f(c,l,u(1,f))}:function(c,l,f){return c[l]=f,c}},function(i,a){var o=i.exports={version:"2.4.0"};typeof __e=="number"&&(__e=o)},function(i,a,o){var s=o(14);i.exports=function(u,c,l){if(s(u),c===void 0)return u;switch(l){case 1:return function(f){return u.call(c,f)};case 2:return function(f,p){return u.call(c,f,p)};case 3:return function(f,p,d){return u.call(c,f,p,d)}}return function(){return u.apply(c,arguments)}}},function(i,a){var o={}.hasOwnProperty;i.exports=function(s,u){return o.call(s,u)}},function(i,a){i.exports=function(o){return typeof o=="object"?o!==null:typeof o=="function"}},function(i,a){i.exports={}},function(i,a){var o={}.toString;i.exports=function(s){return o.call(s).slice(8,-1)}},function(i,a,o){var s=o(3),u=o(26),c=o(32),l=Object.defineProperty;a.f=o(4)?Object.defineProperty:function(f,p,d){if(s(f),p=c(p,!0),s(d),u)try{return l(f,p,d)}catch{}if("get"in d||"set"in d)throw TypeError("Accessors not supported!");return"value"in d&&(f[p]=d.value),f}},function(i,a,o){var s=o(42),u=o(15);i.exports=function(c){return s(u(c))}},function(i,a){i.exports=function(o){if(typeof o!="function")throw TypeError(o+" is not a function!");return o}},function(i,a){i.exports=function(o){if(o==null)throw TypeError("Can't call method on "+o);return o}},function(i,a,o){var s=o(9),u=o(2).document,c=s(u)&&s(u.createElement);i.exports=function(l){return c?u.createElement(l):{}}},function(i,a){i.exports=function(o,s){return{enumerable:!(1&o),configurable:!(2&o),writable:!(4&o),value:s}}},function(i,a,o){var s=o(12).f,u=o(8),c=o(1)("toStringTag");i.exports=function(l,f,p){l&&!u(l=p?l:l.prototype,c)&&s(l,c,{configurable:!0,value:f})}},function(i,a,o){var s=o(29)("keys"),u=o(33);i.exports=function(c){return s[c]||(s[c]=u(c))}},function(i,a){var o=Math.ceil,s=Math.floor;i.exports=function(u){return isNaN(u=+u)?0:(u>0?s:o)(u)}},function(i,a,o){var s=o(11),u=o(1)("toStringTag"),c=s(function(){return arguments}())=="Arguments",l=function(f,p){try{return f[p]}catch{}};i.exports=function(f){var p,d,h;return f===void 0?"Undefined":f===null?"Null":typeof(d=l(p=Object(f),u))=="string"?d:c?s(p):(h=s(p))=="Object"&&typeof p.callee=="function"?"Arguments":h}},function(i,a){i.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(i,a,o){var s=o(2),u=o(6),c=o(7),l=o(5),f="prototype",p=function(d,h,m){var g,b,S,T=d&p.F,A=d&p.G,C=d&p.S,F=d&p.P,M=d&p.B,x=d&p.W,_=A?u:u[h]||(u[h]={}),I=_[f],w=A?s:C?s[h]:(s[h]||{})[f];A&&(m=h);for(g in m)b=!T&&w&&w[g]!==void 0,b&&g in _||(S=b?w[g]:m[g],_[g]=A&&typeof w[g]!="function"?m[g]:M&&b?c(S,s):x&&w[g]==S?function(L){var H=function(K,E,v){if(this instanceof L){switch(arguments.length){case 0:return new L;case 1:return new L(K);case 2:return new L(K,E)}return new L(K,E,v)}return L.apply(this,arguments)};return H[f]=L[f],H}(S):F&&typeof S=="function"?c(Function.call,S):S,F&&((_.virtual||(_.virtual={}))[g]=S,d&p.R&&I&&!I[g]&&l(I,g,S)))};p.F=1,p.G=2,p.S=4,p.P=8,p.B=16,p.W=32,p.U=64,p.R=128,i.exports=p},function(i,a){i.exports=function(o){try{return!!o()}catch{return!0}}},function(i,a,o){i.exports=o(2).document&&document.documentElement},function(i,a,o){i.exports=!o(4)&&!o(24)(function(){return Object.defineProperty(o(16)("div"),"a",{get:function(){return 7}}).a!=7})},function(i,a,o){var s=o(28),u=o(23),c=o(57),l=o(5),f=o(8),p=o(10),d=o(45),h=o(18),m=o(52),g=o(1)("iterator"),b=!([].keys&&"next"in[].keys()),S="@@iterator",T="keys",A="values",C=function(){return this};i.exports=function(F,M,x,_,I,w,L){d(x,M,_);var H,K,E,v=function(D){if(!b&&D in z)return z[D];switch(D){case T:return function(){return new x(this,D)};case A:return function(){return new x(this,D)}}return function(){return new x(this,D)}},j=M+" Iterator",k=I==A,U=!1,z=F.prototype,Q=z[g]||z[S]||I&&z[I],ee=Q||v(I),Ce=I?k?v("entries"):ee:void 0,O=M=="Array"&&z.entries||Q;if(O&&(E=m(O.call(new F)),E!==Object.prototype&&(h(E,j,!0),s||f(E,g)||l(E,g,C))),k&&Q&&Q.name!==A&&(U=!0,ee=function(){return Q.call(this)}),s&&!L||!b&&!U&&z[g]||l(z,g,ee),p[M]=ee,p[j]=C,I)if(H={values:k?ee:v(A),keys:w?ee:v(T),entries:Ce},L)for(K in H)K in z||c(z,K,H[K]);else u(u.P+u.F*(b||U),M,H);return H}},function(i,a){i.exports=!0},function(i,a,o){var s=o(2),u="__core-js_shared__",c=s[u]||(s[u]={});i.exports=function(l){return c[l]||(c[l]={})}},function(i,a,o){var s,u,c,l=o(7),f=o(41),p=o(25),d=o(16),h=o(2),m=h.process,g=h.setImmediate,b=h.clearImmediate,S=h.MessageChannel,T=0,A={},C="onreadystatechange",F=function(){var x=+this;if(A.hasOwnProperty(x)){var _=A[x];delete A[x],_()}},M=function(x){F.call(x.data)};g&&b||(g=function(x){for(var _=[],I=1;arguments.length>I;)_.push(arguments[I++]);return A[++T]=function(){f(typeof x=="function"?x:Function(x),_)},s(T),T},b=function(x){delete A[x]},o(11)(m)=="process"?s=function(x){m.nextTick(l(F,x,1))}:S?(u=new S,c=u.port2,u.port1.onmessage=M,s=l(c.postMessage,c,1)):h.addEventListener&&typeof postMessage=="function"&&!h.importScripts?(s=function(x){h.postMessage(x+"","*")},h.addEventListener("message",M,!1)):s=C in d("script")?function(x){p.appendChild(d("script"))[C]=function(){p.removeChild(this),F.call(x)}}:function(x){setTimeout(l(F,x,1),0)}),i.exports={set:g,clear:b}},function(i,a,o){var s=o(20),u=Math.min;i.exports=function(c){return c>0?u(s(c),9007199254740991):0}},function(i,a,o){var s=o(9);i.exports=function(u,c){if(!s(u))return u;var l,f;if(c&&typeof(l=u.toString)=="function"&&!s(f=l.call(u))||typeof(l=u.valueOf)=="function"&&!s(f=l.call(u))||!c&&typeof(l=u.toString)=="function"&&!s(f=l.call(u)))return f;throw TypeError("Can't convert object to primitive value")}},function(i,a){var o=0,s=Math.random();i.exports=function(u){return"Symbol(".concat(u===void 0?"":u,")_",(++o+s).toString(36))}},function(i,a,o){function s(C){return C&&C.__esModule?C:{default:C}}function u(){return process.platform!=="win32"?"":process.arch==="ia32"&&process.env.hasOwnProperty("PROCESSOR_ARCHITEW6432")?"mixed":"native"}function c(C){return(0,g.createHash)("sha256").update(C).digest("hex")}function l(C){switch(S){case"darwin":return C.split("IOPlatformUUID")[1].split(`
|
|
2
2
|
`)[0].replace(/\=|\s+|\"/gi,"").toLowerCase();case"win32":return C.toString().split("REG_SZ")[1].replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"linux":return C.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"freebsd":return C.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();default:throw new Error("Unsupported platform: "+process.platform)}}function f(C){var F=l((0,m.execSync)(A[S]).toString());return C?F:c(F)}function p(C){return new h.default(function(F,M){return(0,m.exec)(A[S],{},function(x,_,I){if(x)return M(new Error("Error while obtaining machine id: "+x.stack));var w=l(_.toString());return F(C?w:c(w))})})}Object.defineProperty(a,"__esModule",{value:!0});var d=o(35),h=s(d);a.machineIdSync=f,a.machineId=p;var m=o(70),g=o(71),b=process,S=b.platform,T={native:"%windir%\\System32",mixed:"%windir%\\sysnative\\cmd.exe /c %windir%\\System32"},A={darwin:"ioreg -rd1 -c IOPlatformExpertDevice",win32:T[u()]+"\\REG.exe QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",linux:"( cat /var/lib/dbus/machine-id /etc/machine-id 2> /dev/null || hostname ) | head -n 1 || :",freebsd:"kenv -q smbios.system.uuid || sysctl -n kern.hostuuid"}},function(i,a,o){i.exports={default:o(36),__esModule:!0}},function(i,a,o){o(66),o(68),o(69),o(67),i.exports=o(6).Promise},function(i,a){i.exports=function(){}},function(i,a){i.exports=function(o,s,u,c){if(!(o instanceof s)||c!==void 0&&c in o)throw TypeError(u+": incorrect invocation!");return o}},function(i,a,o){var s=o(13),u=o(31),c=o(62);i.exports=function(l){return function(f,p,d){var h,m=s(f),g=u(m.length),b=c(d,g);if(l&&p!=p){for(;g>b;)if(h=m[b++],h!=h)return!0}else for(;g>b;b++)if((l||b in m)&&m[b]===p)return l||b||0;return!l&&-1}}},function(i,m,o){var s=o(7),u=o(44),c=o(43),l=o(3),f=o(31),p=o(64),d={},h={},m=i.exports=function(g,b,S,T,A){var C,F,M,x,_=A?function(){return g}:p(g),I=s(S,T,b?2:1),w=0;if(typeof _!="function")throw TypeError(g+" is not iterable!");if(c(_)){for(C=f(g.length);C>w;w++)if(x=b?I(l(F=g[w])[0],F[1]):I(g[w]),x===d||x===h)return x}else for(M=_.call(g);!(F=M.next()).done;)if(x=u(M,I,F.value,b),x===d||x===h)return x};m.BREAK=d,m.RETURN=h},function(i,a){i.exports=function(o,s,u){var c=u===void 0;switch(s.length){case 0:return c?o():o.call(u);case 1:return c?o(s[0]):o.call(u,s[0]);case 2:return c?o(s[0],s[1]):o.call(u,s[0],s[1]);case 3:return c?o(s[0],s[1],s[2]):o.call(u,s[0],s[1],s[2]);case 4:return c?o(s[0],s[1],s[2],s[3]):o.call(u,s[0],s[1],s[2],s[3])}return o.apply(u,s)}},function(i,a,o){var s=o(11);i.exports=Object("z").propertyIsEnumerable(0)?Object:function(u){return s(u)=="String"?u.split(""):Object(u)}},function(i,a,o){var s=o(10),u=o(1)("iterator"),c=Array.prototype;i.exports=function(l){return l!==void 0&&(s.Array===l||c[u]===l)}},function(i,a,o){var s=o(3);i.exports=function(u,c,l,f){try{return f?c(s(l)[0],l[1]):c(l)}catch(d){var p=u.return;throw p!==void 0&&s(p.call(u)),d}}},function(i,a,o){var s=o(49),u=o(17),c=o(18),l={};o(5)(l,o(1)("iterator"),function(){return this}),i.exports=function(f,p,d){f.prototype=s(l,{next:u(1,d)}),c(f,p+" Iterator")}},function(i,a,o){var s=o(1)("iterator"),u=!1;try{var c=[7][s]();c.return=function(){u=!0},Array.from(c,function(){throw 2})}catch{}i.exports=function(l,f){if(!f&&!u)return!1;var p=!1;try{var d=[7],h=d[s]();h.next=function(){return{done:p=!0}},d[s]=function(){return h},l(d)}catch{}return p}},function(i,a){i.exports=function(o,s){return{value:s,done:!!o}}},function(i,a,o){var s=o(2),u=o(30).set,c=s.MutationObserver||s.WebKitMutationObserver,l=s.process,f=s.Promise,p=o(11)(l)=="process";i.exports=function(){var d,h,m,g=function(){var A,C;for(p&&(A=l.domain)&&A.exit();d;){C=d.fn,d=d.next;try{C()}catch(F){throw d?m():h=void 0,F}}h=void 0,A&&A.enter()};if(p)m=function(){l.nextTick(g)};else if(c){var b=!0,S=document.createTextNode("");new c(g).observe(S,{characterData:!0}),m=function(){S.data=b=!b}}else if(f&&f.resolve){var T=f.resolve();m=function(){T.then(g)}}else m=function(){u.call(s,g)};return function(A){var C={fn:A,next:void 0};h&&(h.next=C),d||(d=C,m()),h=C}}},function(i,a,o){var s=o(3),u=o(50),c=o(22),l=o(19)("IE_PROTO"),f=function(){},p="prototype",d=function(){var h,m=o(16)("iframe"),g=c.length,b=">";for(m.style.display="none",o(25).appendChild(m),m.src="javascript:",h=m.contentWindow.document,h.open(),h.write("<script>document.F=Object<\/script"+b),h.close(),d=h.F;g--;)delete d[p][c[g]];return d()};i.exports=Object.create||function(h,m){var g;return h!==null?(f[p]=s(h),g=new f,f[p]=null,g[l]=h):g=d(),m===void 0?g:u(g,m)}},function(i,a,o){var s=o(12),u=o(3),c=o(54);i.exports=o(4)?Object.defineProperties:function(l,f){u(l);for(var p,d=c(f),h=d.length,m=0;h>m;)s.f(l,p=d[m++],f[p]);return l}},function(i,a,o){var s=o(55),u=o(17),c=o(13),l=o(32),f=o(8),p=o(26),d=Object.getOwnPropertyDescriptor;a.f=o(4)?d:function(h,m){if(h=c(h),m=l(m,!0),p)try{return d(h,m)}catch{}if(f(h,m))return u(!s.f.call(h,m),h[m])}},function(i,a,o){var s=o(8),u=o(63),c=o(19)("IE_PROTO"),l=Object.prototype;i.exports=Object.getPrototypeOf||function(f){return f=u(f),s(f,c)?f[c]:typeof f.constructor=="function"&&f instanceof f.constructor?f.constructor.prototype:f instanceof Object?l:null}},function(i,a,o){var s=o(8),u=o(13),c=o(39)(!1),l=o(19)("IE_PROTO");i.exports=function(f,p){var d,h=u(f),m=0,g=[];for(d in h)d!=l&&s(h,d)&&g.push(d);for(;p.length>m;)s(h,d=p[m++])&&(~c(g,d)||g.push(d));return g}},function(i,a,o){var s=o(53),u=o(22);i.exports=Object.keys||function(c){return s(c,u)}},function(i,a){a.f={}.propertyIsEnumerable},function(i,a,o){var s=o(5);i.exports=function(u,c,l){for(var f in c)l&&u[f]?u[f]=c[f]:s(u,f,c[f]);return u}},function(i,a,o){i.exports=o(5)},function(i,a,o){var s=o(9),u=o(3),c=function(l,f){if(u(l),!s(f)&&f!==null)throw TypeError(f+": can't set as prototype!")};i.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(l,f,p){try{p=o(7)(Function.call,o(51).f(Object.prototype,"__proto__").set,2),p(l,[]),f=!(l instanceof Array)}catch{f=!0}return function(d,h){return c(d,h),f?d.__proto__=h:p(d,h),d}}({},!1):void 0),check:c}},function(i,a,o){var s=o(2),u=o(6),c=o(12),l=o(4),f=o(1)("species");i.exports=function(p){var d=typeof u[p]=="function"?u[p]:s[p];l&&d&&!d[f]&&c.f(d,f,{configurable:!0,get:function(){return this}})}},function(i,a,o){var s=o(3),u=o(14),c=o(1)("species");i.exports=function(l,f){var p,d=s(l).constructor;return d===void 0||(p=s(d)[c])==null?f:u(p)}},function(i,a,o){var s=o(20),u=o(15);i.exports=function(c){return function(l,f){var p,d,h=String(u(l)),m=s(f),g=h.length;return m<0||m>=g?c?"":void 0:(p=h.charCodeAt(m),p<55296||p>56319||m+1===g||(d=h.charCodeAt(m+1))<56320||d>57343?c?h.charAt(m):p:c?h.slice(m,m+2):(p-55296<<10)+(d-56320)+65536)}}},function(i,a,o){var s=o(20),u=Math.max,c=Math.min;i.exports=function(l,f){return l=s(l),l<0?u(l+f,0):c(l,f)}},function(i,a,o){var s=o(15);i.exports=function(u){return Object(s(u))}},function(i,a,o){var s=o(21),u=o(1)("iterator"),c=o(10);i.exports=o(6).getIteratorMethod=function(l){if(l!=null)return l[u]||l["@@iterator"]||c[s(l)]}},function(i,a,o){var s=o(37),u=o(47),c=o(10),l=o(13);i.exports=o(27)(Array,"Array",function(f,p){this._t=l(f),this._i=0,this._k=p},function(){var f=this._t,p=this._k,d=this._i++;return!f||d>=f.length?(this._t=void 0,u(1)):p=="keys"?u(0,d):p=="values"?u(0,f[d]):u(0,[d,f[d]])},"values"),c.Arguments=c.Array,s("keys"),s("values"),s("entries")},function(i,a){},function(i,a,o){var s,u,c,l=o(28),f=o(2),p=o(7),d=o(21),h=o(23),m=o(9),g=(o(3),o(14)),b=o(38),S=o(40),T=(o(58).set,o(60)),A=o(30).set,C=o(48)(),F="Promise",M=f.TypeError,_=f.process,x=f[F],_=f.process,I=d(_)=="process",w=function(){},L=!!function(){try{var O=x.resolve(1),D=(O.constructor={})[o(1)("species")]=function(N){N(w,w)};return(I||typeof PromiseRejectionEvent=="function")&&O.then(w)instanceof D}catch{}}(),H=function(O,D){return O===D||O===x&&D===c},K=function(O){var D;return!(!m(O)||typeof(D=O.then)!="function")&&D},E=function(O){return H(x,O)?new v(O):new u(O)},v=u=function(O){var D,N;this.promise=new O(function(Y,ue){if(D!==void 0||N!==void 0)throw M("Bad Promise constructor");D=Y,N=ue}),this.resolve=g(D),this.reject=g(N)},j=function(O){try{O()}catch(D){return{error:D}}},k=function(O,D){if(!O._n){O._n=!0;var N=O._c;C(function(){for(var Y=O._v,ue=O._s==1,P=0,W=function($){var q,V,re=ue?$.ok:$.fail,X=$.resolve,$e=$.reject,je=$.domain;try{re?(ue||(O._h==2&&Q(O),O._h=1),re===!0?q=Y:(je&&je.enter(),q=re(Y),je&&je.exit()),q===$.promise?$e(M("Promise-chain cycle")):(V=K(q))?V.call(q,X,$e):X(q)):$e(Y)}catch(Ou){$e(Ou)}};N.length>P;)W(N[P++]);O._c=[],O._n=!1,D&&!O._h&&U(O)})}},U=function(O){A.call(f,function(){var D,N,Y,ue=O._v;if(z(O)&&(D=j(function(){I?_.emit("unhandledRejection",ue,O):(N=f.onunhandledrejection)?N({promise:O,reason:ue}):(Y=f.console)&&Y.error&&Y.error("Unhandled promise rejection",ue)}),O._h=I||z(O)?2:1),O._a=void 0,D)throw D.error})},z=function(O){if(O._h==1)return!1;for(var D,N=O._a||O._c,Y=0;N.length>Y;)if(D=N[Y++],D.fail||!z(D.promise))return!1;return!0},Q=function(O){A.call(f,function(){var D;I?_.emit("rejectionHandled",O):(D=f.onrejectionhandled)&&D({promise:O,reason:O._v})})},ee=function(O){var D=this;D._d||(D._d=!0,D=D._w||D,D._v=O,D._s=2,D._a||(D._a=D._c.slice()),k(D,!0))},Ce=function(O){var D,N=this;if(!N._d){N._d=!0,N=N._w||N;try{if(N===O)throw M("Promise can't be resolved itself");(D=K(O))?C(function(){var Y={_w:N,_d:!1};try{D.call(O,p(Ce,Y,1),p(ee,Y,1))}catch(ue){ee.call(Y,ue)}}):(N._v=O,N._s=1,k(N,!1))}catch(Y){ee.call({_w:N,_d:!1},Y)}}};L||(x=function(O){b(this,x,F,"_h"),g(O),s.call(this);try{O(p(Ce,this,1),p(ee,this,1))}catch(D){ee.call(this,D)}},s=function(O){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},s.prototype=o(56)(x.prototype,{then:function(O,D){var N=E(T(this,x));return N.ok=typeof O!="function"||O,N.fail=typeof D=="function"&&D,N.domain=I?_.domain:void 0,this._c.push(N),this._a&&this._a.push(N),this._s&&k(this,!1),N.promise},catch:function(O){return this.then(void 0,O)}}),v=function(){var O=new s;this.promise=O,this.resolve=p(Ce,O,1),this.reject=p(ee,O,1)}),h(h.G+h.W+h.F*!L,{Promise:x}),o(18)(x,F),o(59)(F),c=o(6)[F],h(h.S+h.F*!L,F,{reject:function(O){var D=E(this),N=D.reject;return N(O),D.promise}}),h(h.S+h.F*(l||!L),F,{resolve:function(O){if(O instanceof x&&H(O.constructor,this))return O;var D=E(this),N=D.resolve;return N(O),D.promise}}),h(h.S+h.F*!(L&&o(46)(function(O){x.all(O).catch(w)})),F,{all:function(O){var D=this,N=E(D),Y=N.resolve,ue=N.reject,P=j(function(){var W=[],$=0,q=1;S(O,!1,function(V){var re=$++,X=!1;W.push(void 0),q++,D.resolve(V).then(function($e){X||(X=!0,W[re]=$e,--q||Y(W))},ue)}),--q||Y(W)});return P&&ue(P.error),N.promise},race:function(O){var D=this,N=E(D),Y=N.reject,ue=j(function(){S(O,!1,function(P){D.resolve(P).then(N.resolve,Y)})});return ue&&Y(ue.error),N.promise}})},function(i,a,o){var s=o(61)(!0);o(27)(String,"String",function(u){this._t=String(u),this._i=0},function(){var u,c=this._t,l=this._i;return l>=c.length?{value:void 0,done:!0}:(u=s(c,l),this._i+=u.length,{value:u,done:!1})})},function(i,a,o){o(65);for(var s=o(2),u=o(5),c=o(10),l=o(1)("toStringTag"),f=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],p=0;p<5;p++){var d=f[p],h=s[d],m=h&&h.prototype;m&&!m[l]&&u(m,l,d),c[d]=c.Array}},function(i,a){i.exports=cn.default},function(i,a){i.exports=Fi.default}])})})(Yl);var Rr;try{Rr=Map}catch{}var Fr;try{Fr=Set}catch{}function xa(e,t,n){if(!e||typeof e!="object"||typeof e=="function")return e;if(e.nodeType&&"cloneNode"in e)return e.cloneNode(!0);if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e);if(Array.isArray(e))return e.map($r);if(Rr&&e instanceof Rr)return new Map(Array.from(e.entries()));if(Fr&&e instanceof Fr)return new Set(Array.from(e.values()));if(e instanceof Object){t.push(e);var r=Object.create(e);n.push(r);for(var i in e){var a=t.findIndex(function(o){return o===e[i]});r[i]=a>-1?n[a]:xa(e[i],t,n)}return r}return e}function $r(e){return xa(e,[],[])}const Ql=Object.prototype.toString,Vl=Error.prototype.toString,Xl=RegExp.prototype.toString,Zl=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",Jl=/^Symbol\((.*)\)(.*)$/;function ef(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function Di(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const n=typeof e;if(n==="number")return ef(e);if(n==="string")return t?`"${e}"`:e;if(n==="function")return"[Function "+(e.name||"anonymous")+"]";if(n==="symbol")return Zl.call(e).replace(Jl,"Symbol($1)");const r=Ql.call(e).slice(8,-1);return r==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):r==="Error"||e instanceof Error?"["+Vl.call(e)+"]":r==="RegExp"?Xl.call(e):null}function St(e,t){let n=Di(e,t);return n!==null?n:JSON.stringify(e,function(r,i){let a=Di(this[r],t);return a!==null?a:i},2)}let Ye={default:"${path} is invalid",required:"${path} is a required field",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:t,value:n,originalValue:r})=>{let i=r!=null&&r!==n,a=`${e} must be a \`${t}\` type, but the final value was: \`${St(n,!0)}\``+(i?` (cast from the value \`${St(r,!0)}\`).`:".");return n===null&&(a+='\n If "null" is intended as an empty value be sure to mark the schema as `.nullable()`'),a},defined:"${path} must be defined"},Re={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},tf={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},Or={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},nf={isValue:"${path} field must be ${value}"},Ir={noUnknown:"${path} field has unspecified keys: ${unknown}"},nn={min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must be have ${length} items"};const rf=Object.assign(Object.create(null),{mixed:Ye,string:Re,number:tf,date:Or,object:Ir,array:nn,boolean:nf}),kn=e=>e&&e.__isYupSchema__;class of{constructor(t,n){if(this.refs=t,this.refs=t,typeof n=="function"){this.fn=n;return}if(!ln.default(n,"is"))throw new TypeError("`is:` is required for `when()` conditions");if(!n.then&&!n.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:r,then:i,otherwise:a}=n,o=typeof r=="function"?r:(...s)=>s.every(u=>u===r);this.fn=function(...s){let u=s.pop(),c=s.pop(),l=o(...s)?i:a;if(l)return typeof l=="function"?l(c):c.concat(l.resolve(u))}}resolve(t,n){let r=this.refs.map(a=>a.getValue(n?.value,n?.parent,n?.context)),i=this.fn.apply(t,r.concat(t,n));if(i===void 0||i===t)return t;if(!kn(i))throw new TypeError("conditions must return a schema object");return i.resolve(n)}}function Sa(e){return e==null?[]:[].concat(e)}function Nr(){return Nr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Nr.apply(this,arguments)}let af=/\$\{\s*(\w+)\s*\}/g;class ge extends Error{static formatError(t,n){const r=n.label||n.path||"this";return r!==n.path&&(n=Nr({},n,{path:r})),typeof t=="string"?t.replace(af,(i,a)=>St(n[a])):typeof t=="function"?t(n):t}static isError(t){return t&&t.name==="ValidationError"}constructor(t,n,r,i){super(),this.name="ValidationError",this.value=n,this.path=r,this.type=i,this.errors=[],this.inner=[],Sa(t).forEach(a=>{ge.isError(a)?(this.errors.push(...a.errors),this.inner=this.inner.concat(a.inner.length?a.inner:a)):this.errors.push(a)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0],Error.captureStackTrace&&Error.captureStackTrace(this,ge)}}const sf=e=>{let t=!1;return(...n)=>{t||(t=!0,e(...n))}};function dn(e,t){let{endEarly:n,tests:r,args:i,value:a,errors:o,sort:s,path:u}=e,c=sf(t),l=r.length;const f=[];if(o=o||[],!l)return o.length?c(new ge(o,a,u)):c(null,a);for(let p=0;p<r.length;p++){const d=r[p];d(i,function(m){if(m){if(!ge.isError(m))return c(m,a);if(n)return m.value=a,c(m,a);f.push(m)}if(--l<=0){if(f.length&&(s&&f.sort(s),o.length&&f.push(...o),o=f),o.length){c(new ge(o,a,u),a);return}c(null,a)}})}}function ot(e){this._maxSize=e,this.clear()}ot.prototype.clear=function(){this._size=0,this._values=Object.create(null)};ot.prototype.get=function(e){return this._values[e]};ot.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var uf=/[^.^\]^[]+|(?=\[\]|\.\.)/g,_a=/^\d+$/,cf=/^\d/,lf=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,ff=/^\s*(['"]?)(.*?)(\1)\s*$/,Kr=512,Mi=new ot(Kr),ji=new ot(Kr),Hi=new ot(Kr),Dn={Cache:ot,split:Pr,normalizePath:rr,setter:function(e){var t=rr(e);return ji.get(e)||ji.set(e,function(r,i){for(var a=0,o=t.length,s=r;a<o-1;){var u=t[a];if(u==="__proto__"||u==="constructor"||u==="prototype")return r;s=s[t[a++]]}s[t[a]]=i})},getter:function(e,t){var n=rr(e);return Hi.get(e)||Hi.set(e,function(i){for(var a=0,o=n.length;a<o;)if(i!=null||!t)i=i[n[a++]];else return;return i})},join:function(e){return e.reduce(function(t,n){return t+(zr(n)||_a.test(n)?"["+n+"]":(t?".":"")+n)},"")},forEach:function(e,t,n){pf(Array.isArray(e)?e:Pr(e),t,n)}};function rr(e){return Mi.get(e)||Mi.set(e,Pr(e).map(function(t){return t.replace(ff,"$2")}))}function Pr(e){return e.match(uf)||[""]}function pf(e,t,n){var r=e.length,i,a,o,s;for(a=0;a<r;a++)i=e[a],i&&(mf(i)&&(i='"'+i+'"'),s=zr(i),o=!s&&/^\d+$/.test(i),t.call(n,i,s,o,a,e))}function zr(e){return typeof e=="string"&&e&&["'",'"'].indexOf(e.charAt(0))!==-1}function df(e){return e.match(cf)&&!e.match(_a)}function hf(e){return lf.test(e)}function mf(e){return!zr(e)&&(df(e)||hf(e))}const Qt={context:"$",value:"."};class tt{constructor(t,n={}){if(typeof t!="string")throw new TypeError("ref must be a string, got: "+t);if(this.key=t.trim(),t==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===Qt.context,this.isValue=this.key[0]===Qt.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?Qt.context:this.isValue?Qt.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&Dn.getter(this.path,!0),this.map=n.map}getValue(t,n,r){let i=this.isContext?r:this.isValue?t:n;return this.getter&&(i=this.getter(i||{})),this.map&&(i=this.map(i)),i}cast(t,n){return this.getValue(t,n?.parent,n?.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(t){return t&&t.__isYupRef}}tt.prototype.__isYupRef=!0;function hn(){return hn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hn.apply(this,arguments)}function gf(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function Vt(e){function t(n,r){let{value:i,path:a="",label:o,options:s,originalValue:u,sync:c}=n,l=gf(n,["value","path","label","options","originalValue","sync"]);const{name:f,test:p,params:d,message:h}=e;let{parent:m,context:g}=s;function b(F){return tt.isRef(F)?F.getValue(i,m,g):F}function S(F={}){const M=ia.default(hn({value:i,originalValue:u,label:o,path:F.path||a},d,F.params),b),x=new ge(ge.formatError(F.message||h,M),i,M.path,F.type||f);return x.params=M,x}let T=hn({path:a,parent:m,type:f,createError:S,resolve:b,options:s,originalValue:u},l);if(!c){try{Promise.resolve(p.call(T,i,T)).then(F=>{ge.isError(F)?r(F):F?r(null,F):r(S())})}catch(F){r(F)}return}let A;try{var C;if(A=p.call(T,i,T),typeof((C=A)==null?void 0:C.then)=="function")throw new Error(`Validation test of type: "${T.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`)}catch(F){r(F);return}ge.isError(A)?r(A):A?r(null,A):r(S())}return t.OPTIONS=e,t}let yf=e=>e.substr(0,e.length-1).substr(1);function vf(e,t,n,r=n){let i,a,o;return t?(Dn.forEach(t,(s,u,c)=>{let l=u?yf(s):s;if(e=e.resolve({context:r,parent:i,value:n}),e.innerType){let f=c?parseInt(l,10):0;if(n&&f>=n.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${s}, in the path: ${t}. because there is no value at that index. `);i=n,n=n&&n[f],e=e.innerType}if(!c){if(!e.fields||!e.fields[l])throw new Error(`The schema does not contain the path: ${t}. (failed at: ${o} which is a type: "${e._type}")`);i=n,n=n&&n[l],e=e.fields[l]}a=l,o=u?"["+s+"]":"."+s}),{schema:e,parent:i,parentPath:a}):{parent:i,parentPath:t,schema:e}}class mn{constructor(){this.list=new Set,this.refs=new Map}get size(){return this.list.size+this.refs.size}describe(){const t=[];for(const n of this.list)t.push(n);for(const[,n]of this.refs)t.push(n.describe());return t}toArray(){return Array.from(this.list).concat(Array.from(this.refs.values()))}add(t){tt.isRef(t)?this.refs.set(t.key,t):this.list.add(t)}delete(t){tt.isRef(t)?this.refs.delete(t.key):this.list.delete(t)}has(t,n){if(this.list.has(t))return!0;let r,i=this.refs.values();for(;r=i.next(),!r.done;)if(n(r.value)===t)return!0;return!1}clone(){const t=new mn;return t.list=new Set(this.list),t.refs=new Map(this.refs),t}merge(t,n){const r=this.clone();return t.list.forEach(i=>r.add(i)),t.refs.forEach(i=>r.add(i)),n.list.forEach(i=>r.delete(i)),n.refs.forEach(i=>r.delete(i)),r}}function Ae(){return Ae=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ae.apply(this,arguments)}class ye{constructor(t){this.deps=[],this.conditions=[],this._whitelist=new mn,this._blacklist=new mn,this.exclusiveTests=Object.create(null),this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(Ye.notType)}),this.type=t?.type||"mixed",this.spec=Ae({strip:!1,strict:!1,abortEarly:!0,recursive:!0,nullable:!1,presence:"optional"},t?.spec)}get _type(){return this.type}_typeCheck(t){return!0}clone(t){if(this._mutate)return t&&Object.assign(this.spec,t),this;const n=Object.create(Object.getPrototypeOf(this));return n.type=this.type,n._typeError=this._typeError,n._whitelistError=this._whitelistError,n._blacklistError=this._blacklistError,n._whitelist=this._whitelist.clone(),n._blacklist=this._blacklist.clone(),n.exclusiveTests=Ae({},this.exclusiveTests),n.deps=[...this.deps],n.conditions=[...this.conditions],n.tests=[...this.tests],n.transforms=[...this.transforms],n.spec=$r(Ae({},this.spec,t)),n}label(t){var n=this.clone();return n.spec.label=t,n}meta(...t){if(t.length===0)return this.spec.meta;let n=this.clone();return n.spec.meta=Object.assign(n.spec.meta||{},t[0]),n}withMutation(t){let n=this._mutate;this._mutate=!0;let r=t(this);return this._mutate=n,r}concat(t){if(!t||t===this)return this;if(t.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${t.type}`);let n=this,r=t.clone();const i=Ae({},n.spec,r.spec);return r.spec=i,r._typeError||(r._typeError=n._typeError),r._whitelistError||(r._whitelistError=n._whitelistError),r._blacklistError||(r._blacklistError=n._blacklistError),r._whitelist=n._whitelist.merge(t._whitelist,t._blacklist),r._blacklist=n._blacklist.merge(t._blacklist,t._whitelist),r.tests=n.tests,r.exclusiveTests=n.exclusiveTests,r.withMutation(a=>{t.tests.forEach(o=>{a.test(o.OPTIONS)})}),r}isType(t){return this.spec.nullable&&t===null?!0:this._typeCheck(t)}resolve(t){let n=this;if(n.conditions.length){let r=n.conditions;n=n.clone(),n.conditions=[],n=r.reduce((i,a)=>a.resolve(i,t),n),n=n.resolve(t)}return n}cast(t,n={}){let r=this.resolve(Ae({value:t},n)),i=r._cast(t,n);if(t!==void 0&&n.assert!==!1&&r.isType(i)!==!0){let a=St(t),o=St(i);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${r._type}".
|
|
3
3
|
|
|
4
4
|
attempted value: ${a}
|
package/dist/server/index.mjs
CHANGED
|
@@ -182,7 +182,7 @@ const $a = y.object({
|
|
|
182
182
|
menuAttached: y.boolean(),
|
|
183
183
|
order: y.number().int(),
|
|
184
184
|
collapsed: y.boolean(),
|
|
185
|
-
related: y.object({ documentId: y.string().optional(), __type: y.string() }).catchall(y.unknown()).nullish(),
|
|
185
|
+
related: y.object({ documentId: y.string().optional(), __type: y.string() }).catchall(y.unknown()).nullish().optional(),
|
|
186
186
|
additionalFields: y.record(y.string(), y.unknown()).or(y.null()).optional(),
|
|
187
187
|
audience: y.array($a).or(y.null()).optional(),
|
|
188
188
|
autoSync: y.boolean().or(y.null()).optional()
|
|
@@ -194,7 +194,7 @@ const $a = y.object({
|
|
|
194
194
|
uiRouterKey: !0,
|
|
195
195
|
title: !0,
|
|
196
196
|
externalPath: !0
|
|
197
|
-
}).extend({ related: y.unknown() }), Ht = ui.extend({
|
|
197
|
+
}).extend({ related: y.unknown().optional() }), Ht = ui.extend({
|
|
198
198
|
parent: y.lazy(() => Ht.or(y.null())).optional(),
|
|
199
199
|
items: y.lazy(() => Ht.array()).optional(),
|
|
200
200
|
master: y.lazy(() => et(!1)).optional()
|
|
@@ -30,7 +30,7 @@ declare const navigationItemDBBaseSchema: z.ZodObject<{
|
|
|
30
30
|
menuAttached: z.ZodBoolean;
|
|
31
31
|
order: z.ZodNumber;
|
|
32
32
|
collapsed: z.ZodBoolean;
|
|
33
|
-
related: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
33
|
+
related: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
34
34
|
documentId: z.ZodOptional<z.ZodString>;
|
|
35
35
|
__type: z.ZodString;
|
|
36
36
|
}, "strip", z.ZodUnknown, z.objectOutputType<{
|
|
@@ -39,7 +39,7 @@ declare const navigationItemDBBaseSchema: z.ZodObject<{
|
|
|
39
39
|
}, z.ZodUnknown, "strip">, z.objectInputType<{
|
|
40
40
|
documentId: z.ZodOptional<z.ZodString>;
|
|
41
41
|
__type: z.ZodString;
|
|
42
|
-
}, z.ZodUnknown, "strip"
|
|
42
|
+
}, z.ZodUnknown, "strip">>>>>;
|
|
43
43
|
additionalFields: z.ZodOptional<z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodNull]>>;
|
|
44
44
|
audience: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodObject<{
|
|
45
45
|
id: z.ZodNumber;
|
|
@@ -120,7 +120,7 @@ export declare const readNavigationItemFromLocaleSchema: z.ZodObject<Pick<Omit<{
|
|
|
120
120
|
menuAttached: z.ZodBoolean;
|
|
121
121
|
order: z.ZodNumber;
|
|
122
122
|
collapsed: z.ZodBoolean;
|
|
123
|
-
related: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
123
|
+
related: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
124
124
|
documentId: z.ZodOptional<z.ZodString>;
|
|
125
125
|
__type: z.ZodString;
|
|
126
126
|
}, "strip", z.ZodUnknown, z.objectOutputType<{
|
|
@@ -129,7 +129,7 @@ export declare const readNavigationItemFromLocaleSchema: z.ZodObject<Pick<Omit<{
|
|
|
129
129
|
}, z.ZodUnknown, "strip">, z.objectInputType<{
|
|
130
130
|
documentId: z.ZodOptional<z.ZodString>;
|
|
131
131
|
__type: z.ZodString;
|
|
132
|
-
}, z.ZodUnknown, "strip"
|
|
132
|
+
}, z.ZodUnknown, "strip">>>>>;
|
|
133
133
|
additionalFields: z.ZodOptional<z.ZodUnion<[z.ZodRecord<z.ZodString, z.ZodUnknown>, z.ZodNull]>>;
|
|
134
134
|
audience: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodObject<{
|
|
135
135
|
id: z.ZodNumber;
|
|
@@ -149,7 +149,7 @@ export declare const readNavigationItemFromLocaleSchema: z.ZodObject<Pick<Omit<{
|
|
|
149
149
|
}>, "many">, z.ZodNull]>>;
|
|
150
150
|
autoSync: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodNull]>>;
|
|
151
151
|
}, "related">, "path" | "type" | "title" | "externalPath" | "uiRouterKey"> & {
|
|
152
|
-
related: z.ZodUnknown
|
|
152
|
+
related: z.ZodOptional<z.ZodUnknown>;
|
|
153
153
|
}, "strip", z.ZodTypeAny, {
|
|
154
154
|
type: "INTERNAL" | "EXTERNAL" | "WRAPPER";
|
|
155
155
|
title: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "strapi-plugin-navigation",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.16",
|
|
4
4
|
"description": "Strapi - Navigation plugin",
|
|
5
5
|
"strapi": {
|
|
6
6
|
"name": "navigation",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
}
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@sensinum/strapi-utils": "^1.0.
|
|
43
|
+
"@sensinum/strapi-utils": "^1.0.10",
|
|
44
44
|
"@sindresorhus/slugify": "1.1.0",
|
|
45
45
|
"@tanstack/react-query": "^5.40.0",
|
|
46
46
|
"pluralize": "8.0.0",
|
|
@@ -54,13 +54,11 @@
|
|
|
54
54
|
"@faker-js/faker": "^9.0.3",
|
|
55
55
|
"@jest/types": "29.5.x",
|
|
56
56
|
"@koa/router": "^12.0.1",
|
|
57
|
-
"@strapi/
|
|
58
|
-
"@strapi/icons": "2.0.0-rc.23",
|
|
59
|
-
"@strapi/plugin-graphql": "^5.12.7",
|
|
57
|
+
"@strapi/plugin-graphql": "^5.14.0",
|
|
60
58
|
"@strapi/sdk-plugin": "^5.3.2",
|
|
61
|
-
"@strapi/strapi": "^5.
|
|
62
|
-
"@strapi/types": "^5.
|
|
63
|
-
"@strapi/typescript-utils": "^5.
|
|
59
|
+
"@strapi/strapi": "^5.14.0",
|
|
60
|
+
"@strapi/types": "^5.14.0",
|
|
61
|
+
"@strapi/typescript-utils": "^5.14.0",
|
|
64
62
|
"@types/jest": "^29.5.12",
|
|
65
63
|
"@types/koa": "^2.15.0",
|
|
66
64
|
"@types/koa-bodyparser": "^4.3.12",
|