strapi-plugin-navigation 3.3.2 → 3.3.3-beta.2

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.
@@ -1,75 +1,75 @@
1
- "use strict";const B=require("lodash"),Yr=require("zod"),C=require("lodash/fp"),Hu=require("crypto"),Bu=require("child_process"),Uu=require("lodash/has"),Gu=require("lodash/mapValues"),qu=require("lodash/snakeCase"),Ku=require("lodash/camelCase"),Wu=require("lodash/mapKeys"),zu=require("os"),Yu=require("path"),Qu=require("fs"),Vu=require("assert"),Xu=require("events"),Zu=require("buffer"),Ju=require("stream"),ec=require("util"),tc=require("constants");require("node:stream");const nc=require("@sindresorhus/slugify"),rc=require("zod/v4"),ic=require("pluralize"),ue=e=>e&&e.__esModule?e:{default:e};function aa(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 ge=ue(B),y=aa(Yr),Pi=ue(Hu),fn=ue(Bu),pn=ue(Uu),sa=ue(Gu),Li=ue(qu),oc=ue(Ku),ac=ue(Wu),Ln=ue(zu),Se=ue(Yu),We=ue(Qu),ua=ue(Vu),sc=ue(Xu),uc=ue(Zu),kn=ue(Ju),it=ue(ec),cc=ue(tc),lc=ue(nc),z=aa(rc),fc=ue(ic),Qr=y.object({name:y.string({required_error:"requiredError"}).nonempty("requiredError").refine(e=>!e.includes(" "),{message:"noSpaceError"}),label:y.string({required_error:"requiredError"}).nonempty("requiredError"),description:y.string().optional(),placeholder:y.string().optional(),required:y.boolean().optional(),enabled:y.boolean().optional()}),pc=Qr.extend({type:y.literal("select"),multi:y.boolean(),options:y.array(y.string(),{required_error:"requiredError"}).min(1,{message:"requiredError"})}),dc=Qr.extend({type:y.enum(["boolean","string"]),multi:y.literal(!1).optional(),options:y.array(y.string()).max(0).optional()}),hc=Qr.extend({type:y.literal("media"),multi:y.literal(!1).optional(),options:y.array(y.string()).max(0).optional()}),ca=y.discriminatedUnion("type",[dc,hc,pc]),la=y.union([y.literal("audience"),ca]),mc=y.object({additionalFields:y.array(la),allowedLevels:y.number(),contentTypes:y.array(y.string()),defaultContentType:y.string().optional(),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()}),fa=y.object({id:y.number(),documentId:y.string(),name:y.string(),key:y.string()}),gc=y.enum(["INTERNAL","EXTERNAL","WRAPPER"]),Vr=y.object({id:y.number(),documentId:y.string(),title:y.string(),type:gc,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(fa).or(y.null()).optional(),autoSync:y.boolean().or(y.null()).optional()}),yc=Vr.omit({related:!0}).pick({path:!0,type:!0,uiRouterKey:!0,title:!0,externalPath:!0}).extend({related:y.unknown().optional()}),Lt=Vr.extend({parent:y.lazy(()=>Lt.or(y.null())).optional(),items:y.lazy(()=>Lt.array()).optional(),master:y.lazy(()=>Ve(!1)).optional()}),ki=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()}),vc=Ve(!1).omit({items:!0,id:!0,documentId:!0,slug:!0,locale:!0}).extend({documentId:y.string().optional(),id:y.undefined().optional()}),wc=Vr.omit({id:!0,documentId:!0}).extend({id:y.number().optional(),documentId:y.string().optional(),items:y.lazy(()=>pa).or(y.null()).optional(),updated:y.boolean().optional(),removed:y.boolean().optional()}),pa=y.array(wc),Ec=Ve(!1).extend({items:pa}).partial().required({id:!0,documentId:!0}),bc=y.enum(["collectionType","singleType"]),Sc=y.object({singularName:y.string(),pluralName:y.string(),displayName:y.string(),description:y.string().optional(),name:y.string().optional()}),da=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()}),xc=y.enum(["string","text","richtext","blocks","email","password","date","time","datetime","timestamp","boolean","integer","biginteger","float","decimal","json","relation","media"]),_c=da.extend({type:xc}),Ac=da.extend({type:y.literal("enumeration"),enum:y.string().array()}),Tc=y.object({type:y.literal("component"),component:y.string(),repeatable:y.boolean().optional()}),Cc=y.object({type:y.literal("dynamiczone"),components:y.string().array()}),Rc=y.object({type:y.literal("uid")}),Fc=y.object({type:y.literal("media"),allowedTypes:y.enum(["images","videos","audios","files"]).array(),required:y.boolean().optional()}),$c=y.enum(["oneToOne","oneToMany","manyToOne","manyToMany","morphToMany","manyToMorph"]),Ic=y.object({type:y.literal("relation"),relation:$c,target:y.string(),mappedBy:y.string().optional(),inversedBy:y.string().optional()}),Oc=y.record(y.string(),y.union([_c,Ac,Tc,Cc,Ic,Fc,Rc])),Ar=y.object({kind:bc,collectionName:y.string(),info:Sc,options:y.object({draftAndPublish:y.boolean().optional(),hidden:y.boolean().optional(),templateName:y.string().optional()}).optional(),attributes:Oc,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 jt=(e,t)=>n=>{t(n(e()))};let Tr=mc;const Nc=jt(()=>Tr,e=>{Tr=e});let Cr=la;const Pc=jt(()=>Cr,e=>{Cr=e});let Rr=ca;const Lc=jt(()=>Rr,e=>{Rr=e});let Fr=vc;const kc=jt(()=>Fr,e=>{Fr=e});let $r=Ec;const Dc=jt(()=>$r,e=>{$r=e}),Fe={get configSchema(){return Tr},get navigationItemAdditionalField(){return Cr},get navigationItemCustomField(){return Rr},get createNavigationSchema(){return Fr},get updateNavigationSchema(){return $r}},Mc=/^(?<type>[a-z0-9-]+)\:{2}(?<api>[a-z0-9-]+)\.{1}(?<contentType>[a-z0-9-]+)$/i,jc=["beforeCreate","beforeCreateMany","afterCreate","afterCreateMany","beforeUpdate","beforeUpdateMany","afterUpdate","afterUpdateMany","beforeDelete","beforeDeleteMany","afterDelete","afterDeleteMany","beforeCount","afterCount","beforeFindOne","afterFindOne","beforeFindMany","afterFindMany"],Hc="$",ha=["api::","plugin::"],ma=["admin::","plugin::content-releases","plugin::i18n.locale","plugin::navigation","plugin::review-workflows","plugin::users-permissions","plugin::upload.folder"],Bc=["title","subject","name"],Di={SINGLE:"singleType"},Mi=["title","type","path","externalPath","uiRouterKey","menuAttached","order","collapsed","related","parent","master","audience","additionalFields"],Uc=e=>e.filter(t=>t!=="audience"),ga=e=>{const t=Uc(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(Mi,n.name))))throw new Error(`Name of custom field cannot be one of: ${Mi.join(", ")}`)},ya=(e,t)=>{if(e==null)throw t??new Error("Non-empty value expected, empty given")},Gc=(e="")=>{const t=a=>a.split("-").map(o=>B.capitalize(o)).join(""),[n,r,i]=qc(e);return n==="api"?t(i):`${t(r)}${t(i)}`},qc=(e="")=>e.split(Mc).filter(t=>t&&t.length>0),Kc=(e,t)=>n=>[n,async r=>{await re(t,"common").runLifeCycleHook({contentTypeName:e,hookName:n,event:r})}],va=(e,t)=>Object.fromEntries(jc.map(Kc(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 re({strapi:e},t){return e.plugin("navigation").service(t)}const Qt=e=>e==="*"?"*":typeof e=="string"?[e]:e===!1?[]:e===!0?"*":e,Wc=(e="")=>{const t=!!ha.find(r=>e.includes(r)),n=!ma.find(r=>e.includes(r)||e===r);return!!e&&t&&n},zc=(e="")=>B.last(e)==="s"?e.substr(0,e.length-1):e,Yc=B.once(e=>({find(t,n){const{audienceModel:{uid:r}}=we(e);return e.strapi.query(r).findMany({where:t,limit:n}).then(fa.array().parse)}})),kt=(e,t)=>({findFirst(n,r,i={}){return e.strapi.documents(t).findFirst({populate:Qt(n),status:r,...i})},findById(n,r,i,a={}){return e.strapi.documents(t).findOne({documentId:n,populate:Qt(r),status:i,...a})},findManyById(n,r,i){return e.strapi.documents(t).findMany({where:{documentId:{$in:n}},populate:Qt(r),status:i})},findMany(n,r,i,a){return e.strapi.documents(t).findMany({where:n,populate:Qt(r),status:i,locale:a})},count(n,r){return e.strapi.documents(t).count({where:n,status:r})}}),Le=B.once(e=>({async save({item:t,locale:n}){const{itemModel:r}=we(e),{__type:i,documentId:a}=t?.related??{},o=i?kt(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,...f}=t;return e.strapi.documents(r.uid).update({documentId:t.documentId,data:{...f,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(Ir)).then(ki.parse).then(s=>s.map(dn))},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(ki.parse)}})),Qc=["id","publishedAt","createdAt","updatedAt","locale"],dn=({related:e,items:t=[],...n})=>({...n,items:t.map(dn),related:e?B.omit(e,Qc):void 0}),Ir=({related:e,...t})=>({...t,related:e?.[0]});class Et extends Error{constructor(t,n){super(t),this.additionalInfo=n,this.type="NavigationError"}}class rr extends Et{constructor(){super(...arguments),this.type="FillNavigationError"}}class Vc extends Et{constructor(){super(...arguments),this.type="InvalidParamNavigationError"}}const ji=e=>e===!0?!0:Array.isArray(e)?e.includes("items"):!1,_e=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,...f})=>({...f,items:u?.map(Ir)}))).then(s=>s.map(({items:u,...f})=>({...f,items:u?.map(dn)}))).then(s=>Ve(ji(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(Ir)}).then(a=>Ve(ji(r)).parse(a)).then(a=>({...a,items:a.items?.map(dn)}))},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 Et("Document id is required.");return e.strapi.documents(n.uid).delete({documentId:t.documentId,locale:t.locale})}})),Xc=async e=>{const t=await _e(e).find({locale:"*",limit:Number.MAX_SAFE_INTEGER}),n=await e.strapi.plugin("i18n").service("locales").getDefaultLocale();await Promise.all(t.map(async r=>{t.find(({documentId:a,locale:o})=>a===r.documentId&&o===n)||await _e(e).remove({documentId:r.documentId,locale:r.locale})}))},wa=async({strapi:e,forceDefault:t=!1})=>{const n=e.store({type:"plugin",name:"navigation"}),r=await e.plugin("navigation").config,i=t?{}:{...Or.default,...await n.get({key:"config"})??Or.default};let a=B.isEmpty(i)?i:Fe.configSchema.parse(i);const o=Zc(a,r);return a={additionalFields:o("additionalFields"),contentTypes:o("contentTypes"),contentTypesNameFields:o("contentTypesNameFields"),contentTypesPopulate:o("contentTypesPopulate"),defaultContentType:o("defaultContentType"),allowedLevels:o("allowedLevels"),gql:o("gql"),pathDefaultFields:o("pathDefaultFields"),cascadeMenuAttached:o("cascadeMenuAttached"),preferCustomContentTypes:o("preferCustomContentTypes"),isCacheEnabled:o("isCacheEnabled")},Jc(a,{strapi:e}),ga(a.additionalFields),await n.set({key:"config",value:a}),a},Zc=(e,t)=>n=>{const r=e?.[n]??t(n);return ya(r,new Error(`[Navigation] Config "${n}" is undefined`)),r},Jc=(e,{strapi:t})=>{const n=e.contentTypes.filter(i=>!t.contentTypes[i]);if(n.length===0)return;const r=n.map(Gc);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))},Or={default:{additionalFields:[],allowedLevels:2,contentTypes:[],defaultContentType:"",contentTypesNameFields:{},contentTypesPopulate:{},gql:{navigationItemRelated:[]},pathDefaultFields:{},pruneObsoleteI18nNavigations:!1,cascadeMenuAttached:!0,preferCustomContentTypes:!1,isCacheEnabled:!1}},el="Navigation",tl="navigation",nl=async e=>{const t=re(e,"common"),{defaultLocale:n,restLocale:r=[]}=await t.readLocale(),i=_e(e),a=await i.find({limit:Number.MAX_SAFE_INTEGER,filters:{},locale:"*"});a.length===0&&a.push(await i.save({name:el,visible:!0,locale:n,slug:tl}));const o=a.filter(({locale:s})=>s===n);for(const s of o)for(const u of r)!a.find(({locale:c,documentId:l})=>l===s.documentId&&u===c)&&await i.save({documentId:s.documentId,name:s.name,locale:u,visible:s.visible,slug:s.slug})},he={render:function(e){return`plugin::navigation.${e}`},navigation:{read:"read",update:"update",settings:"settings"}},rl=async({strapi:e})=>{const t=[{section:"plugins",displayName:"Read",uid:he.navigation.read,pluginName:"navigation"},{section:"plugins",displayName:"Update",uid:he.navigation.update,pluginName:"navigation"},{section:"plugins",displayName:"Settings",uid:he.navigation.settings,pluginName:"navigation"}];await e.admin.services.permission.actionProvider.registerMany(t)},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:f,type:c,menuOnly:l,path:p,locale:d}){const h=Yr.z.string().parse(f);return re({strapi:e},"client").render({idOrSlug:h,type:c,rootPath:p,locale:d,menuOnly:l,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:f,type:c,menuOnly:l}=s,p=Yr.z.string().parse(u);return re({strapi:e},"client").renderChildren({idOrSlug:p,childUIKey:f,type:c,menuOnly:l,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=({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")}}),ll=({nexus:e,strapi:t})=>e.objectType({name:"ContentTypesNameFields",async definition(n){n.nonNull.list.nonNull.string("default");const i=await re({strapi:t},"common").getPluginStore(),o=Fe.configSchema.parse(await i.get({key:"config"})).contentTypesNameFields;Object.keys(o||{}).forEach(s=>n.nonNull.list.string(s))}}),fl=({nexus:e})=>e.inputObjectType({name:"CreateNavigation",definition(t){t.nonNull.string("name"),t.nonNull.list.field("items",{type:"CreateNavigationItem"})}}),pl=({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"})}}),dl=({nexus:e})=>e.inputObjectType({name:"CreateNavigationRelated",definition(t){t.nonNull.string("ref"),t.nonNull.string("field"),t.nonNull.string("refId")}}),hl=({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")}}),ml=({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"})}}),gl=({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"})}}),yl=({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")}}),vl=({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`)}})}}),wl=({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"]}),bl=({nexus:e})=>e.enumType({name:"NavigationRenderType",members:["FLAT","TREE"]}),Sl=[vl,wl,yl,bl,hl,gl,ll,cl,ml,dl,pl,fl,El],xl=e=>Sl.map(t=>t(e)),_l=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 re({strapi:e},"common").getPluginStore(),i=Fe.configSchema.parse(await r.get({key:"config"}));t.use(({strapi:a,nexus:o})=>{const s=xl({strapi:a,nexus:o,config:i}),u=sl({strapi:a,nexus:o}),f=ul();return{types:[s,u],resolversConfig:f}})},Al=async({strapi:e})=>{!!e.plugin("graphql")&&await _l({strapi:e})},Tl=async e=>{await Xc(e),await wa(e),await nl(e),await rl(e),await Al(e),await strapi.service("plugin::navigation.migrate").migrateRelatedIdToDocumentId()},Cl=({strapi:e})=>{},Rl=({strapi:e})=>{const t=e.plugin("navigation").service("admin");return async(n,r)=>{if(await r(),!(n.method==="POST"&&n.path==="/i18n/locales"))return;const a=n.body?.code;if(!(!a||typeof a!="string"))try{await t.refreshNavigationLocale(a)}catch(o){e.log.error(`Failed to refresh navigation for new locale ${a}`,o)}}},Ea={localeMiddleware:Rl},Fl=({strapi:e})=>{e.server.use(Ea.localeMiddleware({strapi:e}))},$l={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"}}},Il={schema:$l},Ol=va("navigation",{strapi}),Nl={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"}}},Pl={schema:Nl,lifecycles:Ol},Ll=va("navigation-item",{strapi}),kl={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:{}}}},Dl={schema:kl,lifecycles:Ll},Ml={audience:Il,navigation:Pl,"navigation-item":Dl},ba=y.enum(["true","false"]),Vt=y.string(),jl=y.object({locale:y.string().optional(),orderBy:y.string().optional(),orderDirection:y.enum(["DESC","ASC"]).optional()}),Sa=y.enum(["FLAT","TREE","RFR"]),xa=y.string().transform(e=>e==="published"?"published":"draft").pipe(y.enum(["draft","published"])),Hl=e=>{if(typeof e=="string"){if(e==="true")return!0;if(e==="false")return!1}return e},_a=y.lazy(()=>y.preprocess(Hl,y.union([y.boolean(),y.string(),y.string().array(),y.undefined(),y.record(_a)]))),Bl=y.object({type:Sa.optional(),menu:ba.optional(),path:y.string().optional(),locale:y.string().optional(),populate:_a.optional(),status:xa.optional()}),Ul=y.object({type:Sa.optional(),menu:ba.optional(),locale:y.string().optional(),status:xa.optional()}),Gl=y.object({source:y.string().min(1),target:y.string().min(1),documentId:y.string().min(1)});function ql(e){return{getAdminService(){return re(e,"admin")},getCommonService(){return re(e,"common")},async get(){return await this.getAdminService().get({})},async post(t){const{auditLog:n}=t;try{return await this.getAdminService().post({payload:Fe.createNavigationSchema.parse(t.request.body),auditLog:n})}catch(r){const i=r instanceof Error?{name:r.name,message:r.message}:{};return t.internalServerError("Unable to create",{originalError:i})}},async put(t){const{params:{documentId:n},auditLog:r}=t,i=y.record(y.string(),y.unknown()).parse(t.request.body);try{return await this.getAdminService().put({auditLog:r,payload:Fe.updateNavigationSchema.parse({...i,documentId:n})})}catch(a){const o=a instanceof Error?{name:a.name,message:a.message}:{};return t.internalServerError("Unable to update",{originalError:o})}},async delete(t){const{auditLog:n,params:{documentId:r}}=t;return await this.getAdminService().delete({documentId:Vt.parse(r),auditLog:n}),{}},config(){return this.getAdminService().config({viaSettingsPage:!1})},async updateConfig(t){return await this.getAdminService().updateConfig({config:Fe.configSchema.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:Vt.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}=Gl.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:Vt.parse(n),target:Vt.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()}}}function Kl(e){return{getService(){return re(e,"client")},async readAll(t){try{const{query:n={}}=t,{locale:r,orderBy:i,orderDirection:a}=jl.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,status:f="published"}=Bl.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:u,status:f})},async renderChild(t){const{params:n,query:r={}}=t,{type:i,menu:a,locale:o,status:s="published"}=Ul.parse(r),u=y.string().parse(n.idOrSlug),f=y.string().parse(n.childUIKey);return await this.getService().renderChildren({idOrSlug:u,childUIKey:f,type:i,menuOnly:a==="true",locale:o,status:s})}}}const Wl={admin:ql,client:Kl},zl={},Yl={type:"admin",routes:[{method:"GET",path:"/",handler:"admin.get",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("read")]}}]}},{method:"POST",path:"/",handler:"admin.post",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("update")]}}]}},{method:"GET",path:"/config",handler:"admin.config",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("read")]}}]}},{method:"PUT",path:"/config",handler:"admin.updateConfig",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("settings")]}}]}},{method:"DELETE",path:"/config",handler:"admin.restoreConfig",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.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:[he.render("read")]}}]}},{method:"PUT",path:"/:documentId",handler:"admin.put",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("update")]}}]}},{method:"DELETE",path:"/:documentId",handler:"admin.delete",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.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:[he.render("settings")]}}]}},{method:"GET",path:"/settings/restart",handler:"admin.settingsRestart",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("settings")]}}]}},{method:"PUT",path:"/i18n/copy/:documentId/:source/:target",handler:"admin.fillFromOtherLocale",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("update")]}}]}},{method:"GET",path:"/i18n/item/read/:source/:target",handler:"admin.readNavigationItemFromLocale",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("read")]}}]}}]},Ql={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:[]}}]},Vl={admin:Yl,"content-api":Ql};function Xl(e,t){return ge.default.has(process.env,e)?process.env[e]:t}function At(e){return process.env[e]??""}function Zl(e,t){return ge.default.has(process.env,e)?parseInt(At(e),10):t}function Jl(e,t){return ge.default.has(process.env,e)?parseFloat(At(e)):t}function ef(e,t){return ge.default.has(process.env,e)?At(e)==="true":t}function tf(e,t){if(!ge.default.has(process.env,e))return t;try{return JSON.parse(At(e))}catch(n){throw n instanceof Error?new Error(`Invalid json environment variable ${e}: ${n.message}`):n}}function nf(e,t){if(!ge.default.has(process.env,e))return t;let n=At(e);return n.startsWith("[")&&n.endsWith("]")&&(n=n.substring(1,n.length-1)),n.split(",").map(r=>ge.default.trim(ge.default.trim(r," "),'"'))}function rf(e,t){return ge.default.has(process.env,e)?new Date(At(e)):t}function of(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=sf(e,n);return r!==void 0&&t.includes(r)?r:n}const af={int:Zl,float:Jl,bool:ef,json:tf,array:nf,date:rf,oneOf:of},sf=Object.assign(Xl,af),uf="id",cf="documentId",lf={ID_ATTRIBUTE:uf,DOC_ID_ATTRIBUTE:cf},ff=e=>C.union(strapi?.config?.get("api.responses.privateAttributes",[])??[],C.getOr([],"options.privateAttributes",e)),pf=(e,t)=>e?.attributes?.[t]?.private===!0?!0:ff(e).includes(t),Aa=e=>e&&!["media","component","relation","dynamiczone"].includes(e.type),df=e=>e?.type==="media",Ta=e=>e?.type==="relation",hf=e=>!!e&&e.type==="dynamiczone",Ca=e=>!!e&&Ta(e)&&e.relation?.startsWith?.("morphTo"),pt=async(e,t,n)=>{const{path:r={raw:null,attribute:null,rawWithIndices:null},schema:i,getModel:a}=t;let o=t.parent;const s=async(m,g,E)=>{const T={schema:a(E.__type),path:g,getModel:a,parent:o};return pt(m,T,E)},u=m=>async(g,E,S)=>pt(g,{schema:m,path:E,getModel:a,parent:o},S),f=async(m,g,E)=>{const A={schema:a("plugin::upload.file"),path:g,getModel:a,parent:o};return pt(m,A,E)},c=async(m,g,E,S)=>pt(m,{schema:E,path:g,getModel:a,parent:o},S),l=async(m,g,E)=>{const T={schema:a(E.__component),path:g,getModel:a,parent:o};return pt(m,T,E)};if(!C.isObject(n)||C.isNil(i))return n;const p=C.clone(n),d=mf({data:p}),h=Object.keys(p);for(let m=0;m<h.length;m+=1){const g=h[m],E=i.attributes[g],S={...r};S.raw=C.isNil(r.raw)?g:`${r.raw}.${g}`,S.rawWithIndices=C.isNil(r.rawWithIndices)?g:`${r.rawWithIndices}.${g}`,C.isNil(E)||(S.attribute=C.isNil(r.attribute)?g:`${r.attribute}.${g}`);const T={data:p,schema:i,key:g,value:p[g],attribute:E,path:S,getModel:a,parent:o};await e(T,d);const A=p[g];if(!(C.isNil(A)||C.isNil(E))){if(Ta(E)){o={schema:i,key:g,attribute:E,path:S};const F=E.relation.toLowerCase().startsWith("morph")?s:u(a(E.target));if(C.isArray(A)){const D=new Array(A.length);for(let x=0;x<A.length;x+=1){const _={...S,rawWithIndices:C.isNil(S.rawWithIndices)?`${x}`:`${S.rawWithIndices}.${x}`};D[x]=await F(e,_,A[x])}p[g]=D}else p[g]=await F(e,S,A);continue}if(df(E)){if(o={schema:i,key:g,attribute:E,path:S},C.isArray(A)){const R=new Array(A.length);for(let F=0;F<A.length;F+=1){const D={...S,rawWithIndices:C.isNil(S.rawWithIndices)?`${F}`:`${S.rawWithIndices}.${F}`};R[F]=await f(e,D,A[F])}p[g]=R}else p[g]=await f(e,S,A);continue}if(E.type==="component"){o={schema:i,key:g,attribute:E,path:S};const R=a(E.component);if(C.isArray(A)){const F=new Array(A.length);for(let D=0;D<A.length;D+=1){const x={...S,rawWithIndices:C.isNil(S.rawWithIndices)?`${D}`:`${S.rawWithIndices}.${D}`};F[D]=await c(e,x,R,A[D])}p[g]=F}else p[g]=await c(e,S,R,A);continue}if(E.type==="dynamiczone"&&C.isArray(A)){o={schema:i,key:g,attribute:E,path:S};const R=new Array(A.length);for(let F=0;F<A.length;F+=1){const D={...S,rawWithIndices:C.isNil(S.rawWithIndices)?`${F}`:`${S.rawWithIndices}.${F}`};R[F]=await l(e,D,A[F])}p[g]=R;continue}}}return p},mf=({data:e})=>({remove(t){delete e[t]},set(t,n){e[t]=n}});var gf=C.curry(pt),Ee=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ra(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var yf={exports:{}};(function(e,t){(function(n,r){e.exports=r(fn.default,Pi.default)})(Ee,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),f=o(2).Symbol,c=typeof f=="function",l=i.exports=function(p){return s[p]||(s[p]=c&&f[p]||(c?f:u)("Symbol."+p))};l.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(f,c,l){return s.f(f,c,u(1,l))}:function(f,c,l){return f[c]=l,f}},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,f,c){if(s(u),f===void 0)return u;switch(c){case 1:return function(l){return u.call(f,l)};case 2:return function(l,p){return u.call(f,l,p)};case 3:return function(l,p,d){return u.call(f,l,p,d)}}return function(){return u.apply(f,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),f=o(32),c=Object.defineProperty;a.f=o(4)?Object.defineProperty:function(l,p,d){if(s(l),p=f(p,!0),s(d),u)try{return c(l,p,d)}catch{}if("get"in d||"set"in d)throw TypeError("Accessors not supported!");return"value"in d&&(l[p]=d.value),l}},function(i,a,o){var s=o(42),u=o(15);i.exports=function(f){return s(u(f))}},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,f=s(u)&&s(u.createElement);i.exports=function(c){return f?u.createElement(c):{}}},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),f=o(1)("toStringTag");i.exports=function(c,l,p){c&&!u(c=p?c:c.prototype,f)&&s(c,f,{configurable:!0,value:l})}},function(i,a,o){var s=o(29)("keys"),u=o(33);i.exports=function(f){return s[f]||(s[f]=u(f))}},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"),f=s((function(){return arguments})())=="Arguments",c=function(l,p){try{return l[p]}catch{}};i.exports=function(l){var p,d,h;return l===void 0?"Undefined":l===null?"Null":typeof(d=c(p=Object(l),u))=="string"?d:f?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),f=o(7),c=o(5),l="prototype",p=function(d,h,m){var g,E,S,T=d&p.F,A=d&p.G,R=d&p.S,F=d&p.P,D=d&p.B,x=d&p.W,_=A?u:u[h]||(u[h]={}),N=_[l],v=A?s:R?s[h]:(s[h]||{})[l];A&&(m=h);for(g in m)E=!T&&v&&v[g]!==void 0,E&&g in _||(S=E?v[g]:m[g],_[g]=A&&typeof v[g]!="function"?m[g]:D&&E?f(S,s):x&&v[g]==S?(function(j){var H=function(K,w,b){if(this instanceof j){switch(arguments.length){case 0:return new j;case 1:return new j(K);case 2:return new j(K,w)}return new j(K,w,b)}return j.apply(this,arguments)};return H[l]=j[l],H})(S):F&&typeof S=="function"?f(Function.call,S):S,F&&((_.virtual||(_.virtual={}))[g]=S,d&p.R&&N&&!N[g]&&c(N,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),f=o(57),c=o(5),l=o(8),p=o(10),d=o(45),h=o(18),m=o(52),g=o(1)("iterator"),E=!([].keys&&"next"in[].keys()),S="@@iterator",T="keys",A="values",R=function(){return this};i.exports=function(F,D,x,_,N,v,j){d(x,D,_);var H,K,w,b=function(k){if(!E&&k in W)return W[k];switch(k){case T:return function(){return new x(this,k)};case A:return function(){return new x(this,k)}}return function(){return new x(this,k)}},I=D+" Iterator",M=N==A,U=!1,W=F.prototype,Q=W[g]||W[S]||N&&W[N],ee=Q||b(N),Ce=N?M?b("entries"):ee:void 0,$=D=="Array"&&W.entries||Q;if($&&(w=m($.call(new F)),w!==Object.prototype&&(h(w,I,!0),s||l(w,g)||c(w,g,R))),M&&Q&&Q.name!==A&&(U=!0,ee=function(){return Q.call(this)}),s&&!j||!E&&!U&&W[g]||c(W,g,ee),p[D]=ee,p[I]=R,N)if(H={values:M?ee:b(A),keys:v?ee:b(T),entries:Ce},j)for(K in H)K in W||f(W,K,H[K]);else u(u.P+u.F*(E||U),D,H);return H}},function(i,a){i.exports=!0},function(i,a,o){var s=o(2),u="__core-js_shared__",f=s[u]||(s[u]={});i.exports=function(c){return f[c]||(f[c]={})}},function(i,a,o){var s,u,f,c=o(7),l=o(41),p=o(25),d=o(16),h=o(2),m=h.process,g=h.setImmediate,E=h.clearImmediate,S=h.MessageChannel,T=0,A={},R="onreadystatechange",F=function(){var x=+this;if(A.hasOwnProperty(x)){var _=A[x];delete A[x],_()}},D=function(x){F.call(x.data)};g&&E||(g=function(x){for(var _=[],N=1;arguments.length>N;)_.push(arguments[N++]);return A[++T]=function(){l(typeof x=="function"?x:Function(x),_)},s(T),T},E=function(x){delete A[x]},o(11)(m)=="process"?s=function(x){m.nextTick(c(F,x,1))}:S?(u=new S,f=u.port2,u.port1.onmessage=D,s=c(f.postMessage,f,1)):h.addEventListener&&typeof postMessage=="function"&&!h.importScripts?(s=function(x){h.postMessage(x+"","*")},h.addEventListener("message",D,!1)):s=R in d("script")?function(x){p.appendChild(d("script"))[R]=function(){p.removeChild(this),F.call(x)}}:function(x){setTimeout(c(F,x,1),0)}),i.exports={set:g,clear:E}},function(i,a,o){var s=o(20),u=Math.min;i.exports=function(f){return f>0?u(s(f),9007199254740991):0}},function(i,a,o){var s=o(9);i.exports=function(u,f){if(!s(u))return u;var c,l;if(f&&typeof(c=u.toString)=="function"&&!s(l=c.call(u))||typeof(c=u.valueOf)=="function"&&!s(l=c.call(u))||!f&&typeof(c=u.toString)=="function"&&!s(l=c.call(u)))return l;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(R){return R&&R.__esModule?R:{default:R}}function u(){return process.platform!=="win32"?"":process.arch==="ia32"&&process.env.hasOwnProperty("PROCESSOR_ARCHITEW6432")?"mixed":"native"}function f(R){return(0,g.createHash)("sha256").update(R).digest("hex")}function c(R){switch(S){case"darwin":return R.split("IOPlatformUUID")[1].split(`
2
- `)[0].replace(/\=|\s+|\"/gi,"").toLowerCase();case"win32":return R.toString().split("REG_SZ")[1].replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"linux":return R.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"freebsd":return R.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();default:throw new Error("Unsupported platform: "+process.platform)}}function l(R){var F=c((0,m.execSync)(A[S]).toString());return R?F:f(F)}function p(R){return new h.default(function(F,D){return(0,m.exec)(A[S],{},function(x,_,N){if(x)return D(new Error("Error while obtaining machine id: "+x.stack));var v=c(_.toString());return F(R?v:f(v))})})}Object.defineProperty(a,"__esModule",{value:!0});var d=o(35),h=s(d);a.machineIdSync=l,a.machineId=p;var m=o(70),g=o(71),E=process,S=E.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,f){if(!(o instanceof s)||f!==void 0&&f in o)throw TypeError(u+": incorrect invocation!");return o}},function(i,a,o){var s=o(13),u=o(31),f=o(62);i.exports=function(c){return function(l,p,d){var h,m=s(l),g=u(m.length),E=f(d,g);if(c&&p!=p){for(;g>E;)if(h=m[E++],h!=h)return!0}else for(;g>E;E++)if((c||E in m)&&m[E]===p)return c||E||0;return!c&&-1}}},function(i,m,o){var s=o(7),u=o(44),f=o(43),c=o(3),l=o(31),p=o(64),d={},h={},m=i.exports=function(g,E,S,T,A){var R,F,D,x,_=A?function(){return g}:p(g),N=s(S,T,E?2:1),v=0;if(typeof _!="function")throw TypeError(g+" is not iterable!");if(f(_)){for(R=l(g.length);R>v;v++)if(x=E?N(c(F=g[v])[0],F[1]):N(g[v]),x===d||x===h)return x}else for(D=_.call(g);!(F=D.next()).done;)if(x=u(D,N,F.value,E),x===d||x===h)return x};m.BREAK=d,m.RETURN=h},function(i,a){i.exports=function(o,s,u){var f=u===void 0;switch(s.length){case 0:return f?o():o.call(u);case 1:return f?o(s[0]):o.call(u,s[0]);case 2:return f?o(s[0],s[1]):o.call(u,s[0],s[1]);case 3:return f?o(s[0],s[1],s[2]):o.call(u,s[0],s[1],s[2]);case 4:return f?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"),f=Array.prototype;i.exports=function(c){return c!==void 0&&(s.Array===c||f[u]===c)}},function(i,a,o){var s=o(3);i.exports=function(u,f,c,l){try{return l?f(s(c)[0],c[1]):f(c)}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),f=o(18),c={};o(5)(c,o(1)("iterator"),function(){return this}),i.exports=function(l,p,d){l.prototype=s(c,{next:u(1,d)}),f(l,p+" Iterator")}},function(i,a,o){var s=o(1)("iterator"),u=!1;try{var f=[7][s]();f.return=function(){u=!0},Array.from(f,function(){throw 2})}catch{}i.exports=function(c,l){if(!l&&!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},c(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,f=s.MutationObserver||s.WebKitMutationObserver,c=s.process,l=s.Promise,p=o(11)(c)=="process";i.exports=function(){var d,h,m,g=function(){var A,R;for(p&&(A=c.domain)&&A.exit();d;){R=d.fn,d=d.next;try{R()}catch(F){throw d?m():h=void 0,F}}h=void 0,A&&A.enter()};if(p)m=function(){c.nextTick(g)};else if(f){var E=!0,S=document.createTextNode("");new f(g).observe(S,{characterData:!0}),m=function(){S.data=E=!E}}else if(l&&l.resolve){var T=l.resolve();m=function(){T.then(g)}}else m=function(){u.call(s,g)};return function(A){var R={fn:A,next:void 0};h&&(h.next=R),d||(d=R,m()),h=R}}},function(i,a,o){var s=o(3),u=o(50),f=o(22),c=o(19)("IE_PROTO"),l=function(){},p="prototype",d=function(){var h,m=o(16)("iframe"),g=f.length,E=">";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"+E),h.close(),d=h.F;g--;)delete d[p][f[g]];return d()};i.exports=Object.create||function(h,m){var g;return h!==null?(l[p]=s(h),g=new l,l[p]=null,g[c]=h):g=d(),m===void 0?g:u(g,m)}},function(i,a,o){var s=o(12),u=o(3),f=o(54);i.exports=o(4)?Object.defineProperties:function(c,l){u(c);for(var p,d=f(l),h=d.length,m=0;h>m;)s.f(c,p=d[m++],l[p]);return c}},function(i,a,o){var s=o(55),u=o(17),f=o(13),c=o(32),l=o(8),p=o(26),d=Object.getOwnPropertyDescriptor;a.f=o(4)?d:function(h,m){if(h=f(h),m=c(m,!0),p)try{return d(h,m)}catch{}if(l(h,m))return u(!s.f.call(h,m),h[m])}},function(i,a,o){var s=o(8),u=o(63),f=o(19)("IE_PROTO"),c=Object.prototype;i.exports=Object.getPrototypeOf||function(l){return l=u(l),s(l,f)?l[f]:typeof l.constructor=="function"&&l instanceof l.constructor?l.constructor.prototype:l instanceof Object?c:null}},function(i,a,o){var s=o(8),u=o(13),f=o(39)(!1),c=o(19)("IE_PROTO");i.exports=function(l,p){var d,h=u(l),m=0,g=[];for(d in h)d!=c&&s(h,d)&&g.push(d);for(;p.length>m;)s(h,d=p[m++])&&(~f(g,d)||g.push(d));return g}},function(i,a,o){var s=o(53),u=o(22);i.exports=Object.keys||function(f){return s(f,u)}},function(i,a){a.f={}.propertyIsEnumerable},function(i,a,o){var s=o(5);i.exports=function(u,f,c){for(var l in f)c&&u[l]?u[l]=f[l]:s(u,l,f[l]);return u}},function(i,a,o){i.exports=o(5)},function(i,a,o){var s=o(9),u=o(3),f=function(c,l){if(u(c),!s(l)&&l!==null)throw TypeError(l+": can't set as prototype!")};i.exports={set:Object.setPrototypeOf||("__proto__"in{}?(function(c,l,p){try{p=o(7)(Function.call,o(51).f(Object.prototype,"__proto__").set,2),p(c,[]),l=!(c instanceof Array)}catch{l=!0}return function(d,h){return f(d,h),l?d.__proto__=h:p(d,h),d}})({},!1):void 0),check:f}},function(i,a,o){var s=o(2),u=o(6),f=o(12),c=o(4),l=o(1)("species");i.exports=function(p){var d=typeof u[p]=="function"?u[p]:s[p];c&&d&&!d[l]&&f.f(d,l,{configurable:!0,get:function(){return this}})}},function(i,a,o){var s=o(3),u=o(14),f=o(1)("species");i.exports=function(c,l){var p,d=s(c).constructor;return d===void 0||(p=s(d)[f])==null?l:u(p)}},function(i,a,o){var s=o(20),u=o(15);i.exports=function(f){return function(c,l){var p,d,h=String(u(c)),m=s(l),g=h.length;return m<0||m>=g?f?"":void 0:(p=h.charCodeAt(m),p<55296||p>56319||m+1===g||(d=h.charCodeAt(m+1))<56320||d>57343?f?h.charAt(m):p:f?h.slice(m,m+2):(p-55296<<10)+(d-56320)+65536)}}},function(i,a,o){var s=o(20),u=Math.max,f=Math.min;i.exports=function(c,l){return c=s(c),c<0?u(c+l,0):f(c,l)}},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"),f=o(10);i.exports=o(6).getIteratorMethod=function(c){if(c!=null)return c[u]||c["@@iterator"]||f[s(c)]}},function(i,a,o){var s=o(37),u=o(47),f=o(10),c=o(13);i.exports=o(27)(Array,"Array",function(l,p){this._t=c(l),this._i=0,this._k=p},function(){var l=this._t,p=this._k,d=this._i++;return!l||d>=l.length?(this._t=void 0,u(1)):p=="keys"?u(0,d):p=="values"?u(0,l[d]):u(0,[d,l[d]])},"values"),f.Arguments=f.Array,s("keys"),s("values"),s("entries")},function(i,a){},function(i,a,o){var s,u,f,c=o(28),l=o(2),p=o(7),d=o(21),h=o(23),m=o(9),g=(o(3),o(14)),E=o(38),S=o(40),T=(o(58).set,o(60)),A=o(30).set,R=o(48)(),F="Promise",D=l.TypeError,_=l.process,x=l[F],_=l.process,N=d(_)=="process",v=function(){},j=!!(function(){try{var $=x.resolve(1),k=($.constructor={})[o(1)("species")]=function(P){P(v,v)};return(N||typeof PromiseRejectionEvent=="function")&&$.then(v)instanceof k}catch{}})(),H=function($,k){return $===k||$===x&&k===f},K=function($){var k;return!(!m($)||typeof(k=$.then)!="function")&&k},w=function($){return H(x,$)?new b($):new u($)},b=u=function($){var k,P;this.promise=new $(function(V,ce){if(k!==void 0||P!==void 0)throw D("Bad Promise constructor");k=V,P=ce}),this.resolve=g(k),this.reject=g(P)},I=function($){try{$()}catch(k){return{error:k}}},M=function($,k){if(!$._n){$._n=!0;var P=$._c;R(function(){for(var V=$._v,ce=$._s==1,L=0,Y=function(O){var q,X,oe=ce?O.ok:O.fail,Z=O.resolve,Ne=O.reject,je=O.domain;try{oe?(ce||($._h==2&&Q($),$._h=1),oe===!0?q=V:(je&&je.enter(),q=oe(V),je&&je.exit()),q===O.promise?Ne(D("Promise-chain cycle")):(X=K(q))?X.call(q,Z,Ne):Z(q)):Ne(V)}catch(ju){Ne(ju)}};P.length>L;)Y(P[L++]);$._c=[],$._n=!1,k&&!$._h&&U($)})}},U=function($){A.call(l,function(){var k,P,V,ce=$._v;if(W($)&&(k=I(function(){N?_.emit("unhandledRejection",ce,$):(P=l.onunhandledrejection)?P({promise:$,reason:ce}):(V=l.console)&&V.error&&V.error("Unhandled promise rejection",ce)}),$._h=N||W($)?2:1),$._a=void 0,k)throw k.error})},W=function($){if($._h==1)return!1;for(var k,P=$._a||$._c,V=0;P.length>V;)if(k=P[V++],k.fail||!W(k.promise))return!1;return!0},Q=function($){A.call(l,function(){var k;N?_.emit("rejectionHandled",$):(k=l.onrejectionhandled)&&k({promise:$,reason:$._v})})},ee=function($){var k=this;k._d||(k._d=!0,k=k._w||k,k._v=$,k._s=2,k._a||(k._a=k._c.slice()),M(k,!0))},Ce=function($){var k,P=this;if(!P._d){P._d=!0,P=P._w||P;try{if(P===$)throw D("Promise can't be resolved itself");(k=K($))?R(function(){var V={_w:P,_d:!1};try{k.call($,p(Ce,V,1),p(ee,V,1))}catch(ce){ee.call(V,ce)}}):(P._v=$,P._s=1,M(P,!1))}catch(V){ee.call({_w:P,_d:!1},V)}}};j||(x=function($){E(this,x,F,"_h"),g($),s.call(this);try{$(p(Ce,this,1),p(ee,this,1))}catch(k){ee.call(this,k)}},s=function($){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($,k){var P=w(T(this,x));return P.ok=typeof $!="function"||$,P.fail=typeof k=="function"&&k,P.domain=N?_.domain:void 0,this._c.push(P),this._a&&this._a.push(P),this._s&&M(this,!1),P.promise},catch:function($){return this.then(void 0,$)}}),b=function(){var $=new s;this.promise=$,this.resolve=p(Ce,$,1),this.reject=p(ee,$,1)}),h(h.G+h.W+h.F*!j,{Promise:x}),o(18)(x,F),o(59)(F),f=o(6)[F],h(h.S+h.F*!j,F,{reject:function($){var k=w(this),P=k.reject;return P($),k.promise}}),h(h.S+h.F*(c||!j),F,{resolve:function($){if($ instanceof x&&H($.constructor,this))return $;var k=w(this),P=k.resolve;return P($),k.promise}}),h(h.S+h.F*!(j&&o(46)(function($){x.all($).catch(v)})),F,{all:function($){var k=this,P=w(k),V=P.resolve,ce=P.reject,L=I(function(){var Y=[],O=0,q=1;S($,!1,function(X){var oe=O++,Z=!1;Y.push(void 0),q++,k.resolve(X).then(function(Ne){Z||(Z=!0,Y[oe]=Ne,--q||V(Y))},ce)}),--q||V(Y)});return L&&ce(L.error),P.promise},race:function($){var k=this,P=w(k),V=P.reject,ce=I(function(){S($,!1,function(L){k.resolve(L).then(P.resolve,V)})});return ce&&V(ce.error),P.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,f=this._t,c=this._i;return c>=f.length?{value:void 0,done:!0}:(u=s(f,c),this._i+=u.length,{value:u,done:!1})})},function(i,a,o){o(65);for(var s=o(2),u=o(5),f=o(10),c=o(1)("toStringTag"),l=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],p=0;p<5;p++){var d=l[p],h=s[d],m=h&&h.prototype;m&&!m[c]&&u(m,c,d),f[d]=f.Array}},function(i,a){i.exports=fn.default},function(i,a){i.exports=Pi.default}])})})(yf);var Nr;try{Nr=Map}catch{}var Pr;try{Pr=Set}catch{}function Fa(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(Lr);if(Nr&&e instanceof Nr)return new Map(Array.from(e.entries()));if(Pr&&e instanceof Pr)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]:Fa(e[i],t,n)}return r}return e}function Lr(e){return Fa(e,[],[])}const vf=Object.prototype.toString,wf=Error.prototype.toString,Ef=RegExp.prototype.toString,bf=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",Sf=/^Symbol\((.*)\)(.*)$/;function xf(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function Hi(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const n=typeof e;if(n==="number")return xf(e);if(n==="string")return t?`"${e}"`:e;if(n==="function")return"[Function "+(e.name||"anonymous")+"]";if(n==="symbol")return bf.call(e).replace(Sf,"Symbol($1)");const r=vf.call(e).slice(8,-1);return r==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):r==="Error"||e instanceof Error?"["+wf.call(e)+"]":r==="RegExp"?Ef.call(e):null}function bt(e,t){let n=Hi(e,t);return n!==null?n:JSON.stringify(e,function(r,i){let a=Hi(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: \`${bt(n,!0)}\``+(i?` (cast from the value \`${bt(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"},Ie={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"},_f={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"},kr={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},Af={isValue:"${path} field must be ${value}"},Dr={noUnknown:"${path} field has unspecified keys: ${unknown}"},on={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 Tf=Object.assign(Object.create(null),{mixed:Ye,string:Ie,number:_f,date:kr,object:Dr,array:on,boolean:Af}),Dn=(e=>e&&e.__isYupSchema__);class Cf{constructor(t,n){if(this.refs=t,this.refs=t,typeof n=="function"){this.fn=n;return}if(!pn.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(),f=s.pop(),c=o(...s)?i:a;if(c)return typeof c=="function"?c(f):f.concat(c.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(!Dn(i))throw new TypeError("conditions must return a schema object");return i.resolve(n)}}function $a(e){return e==null?[]:[].concat(e)}function Mr(){return Mr=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},Mr.apply(this,arguments)}let Rf=/\$\{\s*(\w+)\s*\}/g;class me extends Error{static formatError(t,n){const r=n.label||n.path||"this";return r!==n.path&&(n=Mr({},n,{path:r})),typeof t=="string"?t.replace(Rf,(i,a)=>bt(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=[],$a(t).forEach(a=>{me.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,me)}}const Ff=e=>{let t=!1;return(...n)=>{t||(t=!0,e(...n))}};function hn(e,t){let{endEarly:n,tests:r,args:i,value:a,errors:o,sort:s,path:u}=e,f=Ff(t),c=r.length;const l=[];if(o=o||[],!c)return o.length?f(new me(o,a,u)):f(null,a);for(let p=0;p<r.length;p++){const d=r[p];d(i,function(m){if(m){if(!me.isError(m))return f(m,a);if(n)return m.value=a,f(m,a);l.push(m)}if(--c<=0){if(l.length&&(s&&l.sort(s),o.length&&l.push(...o),o=l),o.length){f(new me(o,a,u),a);return}f(null,a)}})}}function Tt(e){this._maxSize=e,this.clear()}Tt.prototype.clear=function(){this._size=0,this._values=Object.create(null)};Tt.prototype.get=function(e){return this._values[e]};Tt.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var $f=/[^.^\]^[]+|(?=\[\]|\.\.)/g,If=/^\d+$/,Of=/^\d/,Nf=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,Pf=/^\s*(['"]?)(.*?)(\1)\s*$/,Xr=512,Bi=new Tt(Xr);new Tt(Xr);var Ui=new Tt(Xr),Mn={split:jr,getter:function(e,t){var n=Lf(e);return Ui.get(e)||Ui.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})},forEach:function(e,t,n){kf(Array.isArray(e)?e:jr(e),t,n)}};function Lf(e){return Bi.get(e)||Bi.set(e,jr(e).map(function(t){return t.replace(Pf,"$2")}))}function jr(e){return e.match($f)||[""]}function kf(e,t,n){var r=e.length,i,a,o,s;for(a=0;a<r;a++)i=e[a],i&&(jf(i)&&(i='"'+i+'"'),s=Ia(i),o=!s&&/^\d+$/.test(i),t.call(n,i,s,o,a,e))}function Ia(e){return typeof e=="string"&&e&&["'",'"'].indexOf(e.charAt(0))!==-1}function Df(e){return e.match(Of)&&!e.match(If)}function Mf(e){return Nf.test(e)}function jf(e){return!Ia(e)&&(Df(e)||Mf(e))}const Xt={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]===Xt.context,this.isValue=this.key[0]===Xt.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?Xt.context:this.isValue?Xt.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&Mn.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 mn(){return mn=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},mn.apply(this,arguments)}function Hf(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 Zt(e){function t(n,r){let{value:i,path:a="",label:o,options:s,originalValue:u,sync:f}=n,c=Hf(n,["value","path","label","options","originalValue","sync"]);const{name:l,test:p,params:d,message:h}=e;let{parent:m,context:g}=s;function E(F){return tt.isRef(F)?F.getValue(i,m,g):F}function S(F={}){const D=sa.default(mn({value:i,originalValue:u,label:o,path:F.path||a},d,F.params),E),x=new me(me.formatError(F.message||h,D),i,D.path,F.type||l);return x.params=D,x}let T=mn({path:a,parent:m,type:l,createError:S,resolve:E,options:s,originalValue:u},c);if(!f){try{Promise.resolve(p.call(T,i,T)).then(F=>{me.isError(F)?r(F):F?r(null,F):r(S())})}catch(F){r(F)}return}let A;try{var R;if(A=p.call(T,i,T),typeof((R=A)==null?void 0:R.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}me.isError(A)?r(A):A?r(null,A):r(S())}return t.OPTIONS=e,t}let Bf=e=>e.substr(0,e.length-1).substr(1);function Uf(e,t,n,r=n){let i,a,o;return t?(Mn.forEach(t,(s,u,f)=>{let c=u?Bf(s):s;if(e=e.resolve({context:r,parent:i,value:n}),e.innerType){let l=f?parseInt(c,10):0;if(n&&l>=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[l],e=e.innerType}if(!f){if(!e.fields||!e.fields[c])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[c],e=e.fields[c]}a=c,o=u?"["+s+"]":"."+s}),{schema:e,parent:i,parentPath:a}):{parent:i,parentPath:t,schema:e}}class gn{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 gn;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 Re(){return Re=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},Re.apply(this,arguments)}class ye{constructor(t){this.deps=[],this.conditions=[],this._whitelist=new gn,this._blacklist=new gn,this.exclusiveTests=Object.create(null),this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(Ye.notType)}),this.type=t?.type||"mixed",this.spec=Re({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=Re({},this.exclusiveTests),n.deps=[...this.deps],n.conditions=[...this.conditions],n.tests=[...this.tests],n.transforms=[...this.transforms],n.spec=Lr(Re({},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=Re({},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(Re({value:t},n)),i=r._cast(t,n);if(t!==void 0&&n.assert!==!1&&r.isType(i)!==!0){let a=bt(t),o=bt(i);throw new TypeError(`The value of ${n.path||"field"} could not be cast to a value that satisfies the schema type: "${r._type}".
1
+ "use strict";const B=require("lodash"),Qr=require("zod"),C=require("lodash/fp"),Bu=require("crypto"),Uu=require("child_process"),Gu=require("lodash/has"),qu=require("lodash/mapValues"),Ku=require("lodash/snakeCase"),Wu=require("lodash/camelCase"),zu=require("lodash/mapKeys"),Yu=require("os"),Qu=require("path"),Vu=require("fs"),Xu=require("assert"),Zu=require("events"),Ju=require("buffer"),ec=require("stream"),tc=require("util"),nc=require("constants");require("node:stream");const rc=require("@sindresorhus/slugify"),ic=require("zod/v4"),oc=require("pluralize"),ue=e=>e&&e.__esModule?e:{default:e};function sa(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 ge=ue(B),y=sa(Qr),Li=ue(Bu),pn=ue(Uu),dn=ue(Gu),ua=ue(qu),ki=ue(Ku),ac=ue(Wu),sc=ue(zu),kn=ue(Yu),Se=ue(Qu),We=ue(Vu),ca=ue(Xu),uc=ue(Zu),cc=ue(Ju),Dn=ue(ec),it=ue(tc),lc=ue(nc),fc=ue(rc),z=sa(ic),pc=ue(oc),Vr=y.object({name:y.string({required_error:"requiredError"}).nonempty("requiredError").refine(e=>!e.includes(" "),{message:"noSpaceError"}),label:y.string({required_error:"requiredError"}).nonempty("requiredError"),description:y.string().optional(),placeholder:y.string().optional(),required:y.boolean().optional(),enabled:y.boolean().optional()}),dc=Vr.extend({type:y.literal("select"),multi:y.boolean(),options:y.array(y.string(),{required_error:"requiredError"}).min(1,{message:"requiredError"})}),hc=Vr.extend({type:y.enum(["boolean","string"]),multi:y.literal(!1).optional(),options:y.array(y.string()).max(0).optional()}),mc=Vr.extend({type:y.literal("media"),multi:y.literal(!1).optional(),options:y.array(y.string()).max(0).optional()}),la=y.discriminatedUnion("type",[hc,mc,dc]),fa=y.union([y.literal("audience"),la]),gc=y.object({additionalFields:y.array(fa),allowedLevels:y.number(),contentTypes:y.array(y.string()),defaultContentType:y.string().optional(),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()}),pa=y.object({id:y.number(),documentId:y.string(),name:y.string(),key:y.string()}),yc=y.enum(["INTERNAL","EXTERNAL","WRAPPER"]),Xr=y.object({id:y.number(),documentId:y.string(),title:y.string(),type:yc,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(pa).or(y.null()).optional(),autoSync:y.boolean().or(y.null()).optional()}),vc=Xr.omit({related:!0}).pick({path:!0,type:!0,uiRouterKey:!0,title:!0,externalPath:!0}).extend({related:y.unknown().optional()}),Lt=Xr.extend({parent:y.lazy(()=>Lt.or(y.null())).optional(),items:y.lazy(()=>Lt.array()).optional(),master:y.lazy(()=>Ve(!1)).optional()}),Di=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()}),wc=Ve(!1).omit({items:!0,id:!0,documentId:!0,slug:!0,locale:!0}).extend({documentId:y.string().optional(),id:y.undefined().optional()}),Ec=Xr.omit({id:!0,documentId:!0}).extend({id:y.number().optional(),documentId:y.string().optional(),items:y.lazy(()=>da).or(y.null()).optional(),updated:y.boolean().optional(),removed:y.boolean().optional()}),da=y.array(Ec),bc=Ve(!1).extend({items:da}).partial().required({id:!0,documentId:!0}),Sc=y.enum(["collectionType","singleType"]),xc=y.object({singularName:y.string(),pluralName:y.string(),displayName:y.string(),description:y.string().optional(),name:y.string().optional()}),ha=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()}),_c=y.enum(["string","text","richtext","blocks","email","password","date","time","datetime","timestamp","boolean","integer","biginteger","float","decimal","json","relation","media"]),Ac=ha.extend({type:_c}),Tc=ha.extend({type:y.literal("enumeration"),enum:y.string().array()}),Cc=y.object({type:y.literal("component"),component:y.string(),repeatable:y.boolean().optional()}),Rc=y.object({type:y.literal("dynamiczone"),components:y.string().array()}),Fc=y.object({type:y.literal("uid")}),$c=y.object({type:y.literal("media"),allowedTypes:y.enum(["images","videos","audios","files"]).array(),required:y.boolean().optional()}),Ic=y.enum(["oneToOne","oneToMany","manyToOne","manyToMany","morphToMany","manyToMorph"]),Oc=y.object({type:y.literal("relation"),relation:Ic,target:y.string(),mappedBy:y.string().optional(),inversedBy:y.string().optional()}),Nc=y.record(y.string(),y.union([Ac,Tc,Cc,Rc,Oc,$c,Fc])),Tr=y.object({kind:Sc,collectionName:y.string(),info:xc,options:y.object({draftAndPublish:y.boolean().optional(),hidden:y.boolean().optional(),templateName:y.string().optional()}).optional(),attributes:Nc,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()});Tr.pick({info:!0,kind:!0,attributes:!0,options:!0});const jt=(e,t)=>n=>{t(n(e()))};let Cr=gc;const Pc=jt(()=>Cr,e=>{Cr=e});let Rr=fa;const Lc=jt(()=>Rr,e=>{Rr=e});let Fr=la;const kc=jt(()=>Fr,e=>{Fr=e});let $r=wc;const Dc=jt(()=>$r,e=>{$r=e});let Ir=bc;const Mc=jt(()=>Ir,e=>{Ir=e}),Fe={get configSchema(){return Cr},get navigationItemAdditionalField(){return Rr},get navigationItemCustomField(){return Fr},get createNavigationSchema(){return $r},get updateNavigationSchema(){return Ir}},jc=/^(?<type>[a-z0-9-]+)\:{2}(?<api>[a-z0-9-]+)\.{1}(?<contentType>[a-z0-9-]+)$/i,Hc=["beforeCreate","beforeCreateMany","afterCreate","afterCreateMany","beforeUpdate","beforeUpdateMany","afterUpdate","afterUpdateMany","beforeDelete","beforeDeleteMany","afterDelete","afterDeleteMany","beforeCount","afterCount","beforeFindOne","afterFindOne","beforeFindMany","afterFindMany"],Bc="$",ma=["api::","plugin::"],ga=["admin::","plugin::content-releases","plugin::i18n.locale","plugin::navigation","plugin::review-workflows","plugin::users-permissions","plugin::upload.folder"],Uc=["title","subject","name"],Mi={SINGLE:"singleType"},ji=["title","type","path","externalPath","uiRouterKey","menuAttached","order","collapsed","related","parent","master","audience","additionalFields"],Gc=e=>e.filter(t=>t!=="audience"),ya=e=>{const t=Gc(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(ji,n.name))))throw new Error(`Name of custom field cannot be one of: ${ji.join(", ")}`)},va=(e,t)=>{if(e==null)throw t??new Error("Non-empty value expected, empty given")},qc=(e="")=>{const t=a=>a.split("-").map(o=>B.capitalize(o)).join(""),[n,r,i]=Kc(e);return n==="api"?t(i):`${t(r)}${t(i)}`},Kc=(e="")=>e.split(jc).filter(t=>t&&t.length>0),Wc=(e,t)=>n=>[n,async r=>{await re(t,"common").runLifeCycleHook({contentTypeName:e,hookName:n,event:r})}],wa=(e,t)=>Object.fromEntries(Hc.map(Wc(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 re({strapi:e},t){return e.plugin("navigation").service(t)}const Qt=e=>e==="*"?"*":typeof e=="string"?[e]:e===!1?[]:e===!0?"*":e,zc=(e="")=>{const t=!!ma.find(r=>e.includes(r)),n=!ga.find(r=>e.includes(r)||e===r);return!!e&&t&&n},Yc=(e="")=>B.last(e)==="s"?e.substr(0,e.length-1):e,Qc=B.once(e=>({find(t,n){const{audienceModel:{uid:r}}=we(e);return e.strapi.query(r).findMany({where:t,limit:n}).then(pa.array().parse)}})),kt=(e,t)=>({findFirst(n,r,i={}){return e.strapi.documents(t).findFirst({populate:Qt(n),status:r,...i})},findById(n,r,i,a={}){return e.strapi.documents(t).findOne({documentId:n,populate:Qt(r),status:i,...a})},findManyById(n,r,i){return e.strapi.documents(t).findMany({where:{documentId:{$in:n}},populate:Qt(r),status:i})},findMany(n,r,i,a){return e.strapi.documents(t).findMany({where:n,populate:Qt(r),status:i,locale:a})},count(n,r){return e.strapi.documents(t).count({where:n,status:r})}}),Le=B.once(e=>({async save({item:t,locale:n}){const{itemModel:r}=we(e),{__type:i,documentId:a}=t?.related??{},o=i?kt(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,...f}=t;return e.strapi.documents(r.uid).update({documentId:t.documentId,data:{...f,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(Or)).then(Di.parse).then(s=>s.map(hn))},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(Di.parse)}})),Vc=["id","publishedAt","createdAt","updatedAt","locale"],hn=({related:e,items:t=[],...n})=>({...n,items:t.map(hn),related:e?B.omit(e,Vc):void 0}),Or=({related:e,...t})=>({...t,related:e?.[0]});class Et extends Error{constructor(t,n){super(t),this.additionalInfo=n,this.type="NavigationError"}}class ir extends Et{constructor(){super(...arguments),this.type="FillNavigationError"}}class Xc extends Et{constructor(){super(...arguments),this.type="InvalidParamNavigationError"}}const Hi=e=>e===!0?!0:Array.isArray(e)?e.includes("items"):!1,_e=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,...f})=>({...f,items:u?.map(Or)}))).then(s=>s.map(({items:u,...f})=>({...f,items:u?.map(hn)}))).then(s=>Ve(Hi(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(Or)}).then(a=>Ve(Hi(r)).parse(a)).then(a=>({...a,items:a.items?.map(hn)}))},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 Et("Document id is required.");return e.strapi.documents(n.uid).delete({documentId:t.documentId,locale:t.locale})}})),Zc=async e=>{const t=await _e(e).find({locale:"*",limit:Number.MAX_SAFE_INTEGER}),n=await e.strapi.plugin("i18n").service("locales").getDefaultLocale();await Promise.all(t.map(async r=>{t.find(({documentId:a,locale:o})=>a===r.documentId&&o===n)||await _e(e).remove({documentId:r.documentId,locale:r.locale})}))},Ea=async({strapi:e,forceDefault:t=!1})=>{const n=e.store({type:"plugin",name:"navigation"}),r=await e.plugin("navigation").config,i=t?{}:{...Nr.default,...await n.get({key:"config"})??Nr.default};let a=B.isEmpty(i)?i:Fe.configSchema.parse(i);const o=Jc(a,r);return a={additionalFields:o("additionalFields"),contentTypes:o("contentTypes"),contentTypesNameFields:o("contentTypesNameFields"),contentTypesPopulate:o("contentTypesPopulate"),defaultContentType:o("defaultContentType"),allowedLevels:o("allowedLevels"),gql:o("gql"),pathDefaultFields:o("pathDefaultFields"),cascadeMenuAttached:o("cascadeMenuAttached"),preferCustomContentTypes:o("preferCustomContentTypes"),isCacheEnabled:o("isCacheEnabled")},el(a,{strapi:e}),ya(a.additionalFields),await n.set({key:"config",value:a}),a},Jc=(e,t)=>n=>{const r=e?.[n]??t(n);return va(r,new Error(`[Navigation] Config "${n}" is undefined`)),r},el=(e,{strapi:t})=>{const n=e.contentTypes.filter(i=>!t.contentTypes[i]);if(n.length===0)return;const r=n.map(qc);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))},Nr={default:{additionalFields:[],allowedLevels:2,contentTypes:[],defaultContentType:"",contentTypesNameFields:{},contentTypesPopulate:{},gql:{navigationItemRelated:[]},pathDefaultFields:{},pruneObsoleteI18nNavigations:!1,cascadeMenuAttached:!0,preferCustomContentTypes:!1,isCacheEnabled:!1}},tl="Navigation",nl="navigation",rl=async e=>{const t=re(e,"common"),{defaultLocale:n,restLocale:r=[]}=await t.readLocale(),i=_e(e),a=await i.find({limit:Number.MAX_SAFE_INTEGER,filters:{},locale:"*"});a.length===0&&a.push(await i.save({name:tl,visible:!0,locale:n,slug:nl}));const o=a.filter(({locale:s})=>s===n);for(const s of o)for(const u of r)!a.find(({locale:c,documentId:l})=>l===s.documentId&&u===c)&&await i.save({documentId:s.documentId,name:s.name,locale:u,visible:s.visible,slug:s.slug})},he={render:function(e){return`plugin::navigation.${e}`},navigation:{read:"read",update:"update",settings:"settings"}},il=async({strapi:e})=>{const t=[{section:"plugins",displayName:"Read",uid:he.navigation.read,pluginName:"navigation"},{section:"plugins",displayName:"Update",uid:he.navigation.update,pluginName:"navigation"},{section:"plugins",displayName:"Settings",uid:he.navigation.settings,pluginName:"navigation"}];await e.admin.services.permission.actionProvider.registerMany(t)},ol="I18NLocaleCode",al=({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:ol})},type:n(r("NavigationItem")),resolve(u,{navigationIdOrSlug:f,type:c,menuOnly:l,path:p,locale:d}){const h=Qr.z.string().parse(f);return re({strapi:e},"client").render({idOrSlug:h,type:c,rootPath:p,locale:d,menuOnly:l,wrapRelated:!0})}}},sl=({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:f,type:c,menuOnly:l}=s,p=Qr.z.string().parse(u);return re({strapi:e},"client").renderChildren({idOrSlug:p,childUIKey:f,type:c,menuOnly:l,wrapRelated:!0})}}},ul=e=>{const t={renderNavigationChild:sl,renderNavigation:al};return e.nexus.extendType({type:"Query",definition(n){for(const[r,i]of Object.entries(t)){const a=i(e);n.field(r,a)}}})},cl=()=>({"Query.renderNavigationChild":{auth:!1},"Query.renderNavigation":{auth:!1}}),ll=({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")}}),fl=({nexus:e,strapi:t})=>e.objectType({name:"ContentTypesNameFields",async definition(n){n.nonNull.list.nonNull.string("default");const i=await re({strapi:t},"common").getPluginStore(),o=Fe.configSchema.parse(await i.get({key:"config"})).contentTypesNameFields;Object.keys(o||{}).forEach(s=>n.nonNull.list.string(s))}}),pl=({nexus:e})=>e.inputObjectType({name:"CreateNavigation",definition(t){t.nonNull.string("name"),t.nonNull.list.field("items",{type:"CreateNavigationItem"})}}),dl=({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"})}}),hl=({nexus:e})=>e.inputObjectType({name:"CreateNavigationRelated",definition(t){t.nonNull.string("ref"),t.nonNull.string("field"),t.nonNull.string("refId")}}),ml=({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")}}),gl=({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"})}}),yl=({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"})}}),vl=({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")}}),wl=({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`)}})}}),El=({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")}})},bl=({nexus:e})=>e.enumType({name:"NavigationItemType",members:["INTERNAL","EXTERNAL","WRAPPER"]}),Sl=({nexus:e})=>e.enumType({name:"NavigationRenderType",members:["FLAT","TREE"]}),xl=[wl,El,vl,Sl,ml,yl,fl,ll,gl,hl,dl,pl,bl],_l=e=>xl.map(t=>t(e)),Al=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 re({strapi:e},"common").getPluginStore(),i=Fe.configSchema.parse(await r.get({key:"config"}));t.use(({strapi:a,nexus:o})=>{const s=_l({strapi:a,nexus:o,config:i}),u=ul({strapi:a,nexus:o}),f=cl();return{types:[s,u],resolversConfig:f}})},Tl=async({strapi:e})=>{!!e.plugin("graphql")&&await Al({strapi:e})},Cl=async e=>{await Zc(e),await Ea(e),await rl(e),await il(e),await Tl(e),await strapi.service("plugin::navigation.migrate").migrateRelatedIdToDocumentId()},Rl=({strapi:e})=>{},Fl=({strapi:e})=>{const t=e.plugin("navigation").service("admin");return async(n,r)=>{if(await r(),!(n.method==="POST"&&n.path==="/i18n/locales"))return;const a=n.body?.code;if(!(!a||typeof a!="string"))try{await t.refreshNavigationLocale(a)}catch(o){e.log.error(`Failed to refresh navigation for new locale ${a}`,o)}}},ba={localeMiddleware:Fl},$l=({strapi:e})=>{e.server.use(ba.localeMiddleware({strapi:e}))},Il={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"}}},Ol={schema:Il},Nl=wa("navigation",{strapi}),Pl={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"}}},Ll={schema:Pl,lifecycles:Nl},kl=wa("navigation-item",{strapi}),Dl={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:{}}}},Ml={schema:Dl,lifecycles:kl},jl={audience:Ol,navigation:Ll,"navigation-item":Ml},Sa=y.enum(["true","false"]),Vt=y.string(),Hl=y.object({locale:y.string().optional(),orderBy:y.string().optional(),orderDirection:y.enum(["DESC","ASC"]).optional()}),xa=y.enum(["FLAT","TREE","RFR"]),_a=y.string().transform(e=>e==="published"?"published":"draft").pipe(y.enum(["draft","published"])),Bl=e=>{if(typeof e=="string"){if(e==="true")return!0;if(e==="false")return!1}return e},Aa=y.lazy(()=>y.preprocess(Bl,y.union([y.boolean(),y.string(),y.string().array(),y.undefined(),y.record(Aa)]))),Ul=y.object({type:xa.optional(),menu:Sa.optional(),path:y.string().optional(),locale:y.string().optional(),populate:Aa.optional(),status:_a.optional()}),Gl=y.object({type:xa.optional(),menu:Sa.optional(),locale:y.string().optional(),status:_a.optional()}),ql=y.object({source:y.string().min(1),target:y.string().min(1),documentId:y.string().min(1)});function Kl(e){return{getAdminService(){return re(e,"admin")},getCommonService(){return re(e,"common")},async get(){return await this.getAdminService().get({})},async post(t){const{auditLog:n}=t;try{return await this.getAdminService().post({payload:Fe.createNavigationSchema.parse(t.request.body),auditLog:n})}catch(r){const i=r instanceof Error?{name:r.name,message:r.message}:{};return t.internalServerError("Unable to create",{originalError:i})}},async put(t){const{params:{documentId:n},auditLog:r}=t,i=y.record(y.string(),y.unknown()).parse(t.request.body);try{return await this.getAdminService().put({auditLog:r,payload:Fe.updateNavigationSchema.parse({...i,documentId:n})})}catch(a){const o=a instanceof Error?{name:a.name,message:a.message}:{};return t.internalServerError("Unable to update",{originalError:o})}},async delete(t){const{auditLog:n,params:{documentId:r}}=t;return await this.getAdminService().delete({documentId:Vt.parse(r),auditLog:n}),{}},config(){return this.getAdminService().config({viaSettingsPage:!1})},async updateConfig(t){return await this.getAdminService().updateConfig({config:Fe.configSchema.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:Vt.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}=ql.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:Vt.parse(n),target:Vt.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()}}}function Wl(e){return{getService(){return re(e,"client")},async readAll(t){try{const{query:n={}}=t,{locale:r,orderBy:i,orderDirection:a}=Hl.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,status:f="published"}=Ul.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:u,status:f})},async renderChild(t){const{params:n,query:r={}}=t,{type:i,menu:a,locale:o,status:s="published"}=Gl.parse(r),u=y.string().parse(n.idOrSlug),f=y.string().parse(n.childUIKey);return await this.getService().renderChildren({idOrSlug:u,childUIKey:f,type:i,menuOnly:a==="true",locale:o,status:s})}}}const zl={admin:Kl,client:Wl},Yl={},Ql={type:"admin",routes:[{method:"GET",path:"/",handler:"admin.get",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("read")]}}]}},{method:"POST",path:"/",handler:"admin.post",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("update")]}}]}},{method:"GET",path:"/config",handler:"admin.config",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("read")]}}]}},{method:"PUT",path:"/config",handler:"admin.updateConfig",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("settings")]}}]}},{method:"DELETE",path:"/config",handler:"admin.restoreConfig",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.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:[he.render("read")]}}]}},{method:"PUT",path:"/:documentId",handler:"admin.put",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("update")]}}]}},{method:"DELETE",path:"/:documentId",handler:"admin.delete",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.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:[he.render("settings")]}}]}},{method:"GET",path:"/settings/restart",handler:"admin.settingsRestart",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("settings")]}}]}},{method:"PUT",path:"/i18n/copy/:documentId/:source/:target",handler:"admin.fillFromOtherLocale",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("update")]}}]}},{method:"GET",path:"/i18n/item/read/:source/:target",handler:"admin.readNavigationItemFromLocale",config:{policies:[{name:"admin::hasPermissions",config:{actions:[he.render("read")]}}]}}]},Vl={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:[]}}]},Xl={admin:Ql,"content-api":Vl};function Zl(e,t){return ge.default.has(process.env,e)?process.env[e]:t}function At(e){return process.env[e]??""}function Jl(e,t){return ge.default.has(process.env,e)?parseInt(At(e),10):t}function ef(e,t){return ge.default.has(process.env,e)?parseFloat(At(e)):t}function tf(e,t){return ge.default.has(process.env,e)?At(e)==="true":t}function nf(e,t){if(!ge.default.has(process.env,e))return t;try{return JSON.parse(At(e))}catch(n){throw n instanceof Error?new Error(`Invalid json environment variable ${e}: ${n.message}`):n}}function rf(e,t){if(!ge.default.has(process.env,e))return t;let n=At(e);return n.startsWith("[")&&n.endsWith("]")&&(n=n.substring(1,n.length-1)),n.split(",").map(r=>ge.default.trim(ge.default.trim(r," "),'"'))}function of(e,t){return ge.default.has(process.env,e)?new Date(At(e)):t}function af(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=uf(e,n);return r!==void 0&&t.includes(r)?r:n}const sf={int:Jl,float:ef,bool:tf,json:nf,array:rf,date:of,oneOf:af},uf=Object.assign(Zl,sf),cf="id",lf="documentId",ff={ID_ATTRIBUTE:cf,DOC_ID_ATTRIBUTE:lf},pf=e=>C.union(strapi?.config?.get("api.responses.privateAttributes",[])??[],C.getOr([],"options.privateAttributes",e)),df=(e,t)=>e?.attributes?.[t]?.private===!0?!0:pf(e).includes(t),Ta=e=>e&&!["media","component","relation","dynamiczone"].includes(e.type),hf=e=>e?.type==="media",Ca=e=>e?.type==="relation",mf=e=>!!e&&e.type==="dynamiczone",Ra=e=>!!e&&Ca(e)&&e.relation?.startsWith?.("morphTo"),Xt=async e=>{const t=await Promise.allSettled(e);for(let n=0;n<t.length;n+=1){const r=t[n];if(r.status==="rejected")throw r.reason}return t.map(n=>n.value)},pt=async(e,t,n)=>{const{path:r={raw:null,attribute:null,rawWithIndices:null},schema:i,getModel:a,allowedExtraRootKeys:o}=t;let s=t.parent;const u=async(g,w,S)=>{const R={schema:a(S.__type),path:w,getModel:a,parent:s,allowedExtraRootKeys:o};return pt(g,R,S)},f=g=>async(w,S,x)=>pt(w,{schema:g,path:S,getModel:a,parent:s,allowedExtraRootKeys:o},x),c=async(g,w,S)=>{const T={schema:a("plugin::upload.file"),path:w,getModel:a,parent:s,allowedExtraRootKeys:o};return pt(g,T,S)},l=async(g,w,S,x)=>pt(g,{schema:S,path:w,getModel:a,parent:s,allowedExtraRootKeys:o},x),p=async(g,w,S)=>{const R={schema:a(S.__component),path:w,getModel:a,parent:s,allowedExtraRootKeys:o};return pt(g,R,S)};if(!C.isObject(n)||C.isNil(i))return n;const d=C.clone(n),h=gf({data:d}),m=Object.keys(d);for(let g=0;g<m.length;g+=1){const w=m[g],S=i.attributes[w],x={...r};x.raw=C.isNil(r.raw)?w:`${r.raw}.${w}`,x.rawWithIndices=C.isNil(r.rawWithIndices)?w:`${r.rawWithIndices}.${w}`,C.isNil(S)||(x.attribute=C.isNil(r.attribute)?w:`${r.attribute}.${w}`);const R={data:d,schema:i,key:w,value:d[w],attribute:S,path:x,getModel:a,parent:s,allowedExtraRootKeys:o};await e(R,h);const T=d[w];if(!(C.isNil(T)||C.isNil(S))){if(Ca(S)){s={schema:i,key:w,attribute:S,path:x};const M=S.relation.toLowerCase().startsWith("morph")?u:f(a(S.target));C.isArray(T)?d[w]=await Xt(T.map((A,_)=>{const N={...x,rawWithIndices:C.isNil(x.rawWithIndices)?`${_}`:`${x.rawWithIndices}.${_}`};return M(e,N,A)})):d[w]=await M(e,x,T);continue}if(hf(S)){s={schema:i,key:w,attribute:S,path:x},C.isArray(T)?d[w]=await Xt(T.map((O,M)=>{const A={...x,rawWithIndices:C.isNil(x.rawWithIndices)?`${M}`:`${x.rawWithIndices}.${M}`};return c(e,A,O)})):d[w]=await c(e,x,T);continue}if(S.type==="component"){s={schema:i,key:w,attribute:S,path:x};const O=a(S.component);C.isArray(T)?d[w]=await Xt(T.map((M,A)=>{const _={...x,rawWithIndices:C.isNil(x.rawWithIndices)?`${A}`:`${x.rawWithIndices}.${A}`};return l(e,_,O,M)})):d[w]=await l(e,x,O,T);continue}if(S.type==="dynamiczone"&&C.isArray(T)){s={schema:i,key:w,attribute:S,path:x},d[w]=await Xt(T.map((O,M)=>{const A={...x,rawWithIndices:C.isNil(x.rawWithIndices)?`${M}`:`${x.rawWithIndices}.${M}`};return p(e,A,O)}));continue}}}return d},gf=({data:e})=>({remove(t){delete e[t]},set(t,n){e[t]=n}});var yf=C.curry(pt),Ee=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var vf={exports:{}};(function(e,t){(function(n,r){e.exports=r(pn.default,Li.default)})(Ee,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),f=o(2).Symbol,c=typeof f=="function",l=i.exports=function(p){return s[p]||(s[p]=c&&f[p]||(c?f:u)("Symbol."+p))};l.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(f,c,l){return s.f(f,c,u(1,l))}:function(f,c,l){return f[c]=l,f}},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,f,c){if(s(u),f===void 0)return u;switch(c){case 1:return function(l){return u.call(f,l)};case 2:return function(l,p){return u.call(f,l,p)};case 3:return function(l,p,d){return u.call(f,l,p,d)}}return function(){return u.apply(f,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),f=o(32),c=Object.defineProperty;a.f=o(4)?Object.defineProperty:function(l,p,d){if(s(l),p=f(p,!0),s(d),u)try{return c(l,p,d)}catch{}if("get"in d||"set"in d)throw TypeError("Accessors not supported!");return"value"in d&&(l[p]=d.value),l}},function(i,a,o){var s=o(42),u=o(15);i.exports=function(f){return s(u(f))}},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,f=s(u)&&s(u.createElement);i.exports=function(c){return f?u.createElement(c):{}}},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),f=o(1)("toStringTag");i.exports=function(c,l,p){c&&!u(c=p?c:c.prototype,f)&&s(c,f,{configurable:!0,value:l})}},function(i,a,o){var s=o(29)("keys"),u=o(33);i.exports=function(f){return s[f]||(s[f]=u(f))}},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"),f=s((function(){return arguments})())=="Arguments",c=function(l,p){try{return l[p]}catch{}};i.exports=function(l){var p,d,h;return l===void 0?"Undefined":l===null?"Null":typeof(d=c(p=Object(l),u))=="string"?d:f?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),f=o(7),c=o(5),l="prototype",p=function(d,h,m){var g,w,S,x=d&p.F,R=d&p.G,T=d&p.S,O=d&p.P,M=d&p.B,A=d&p.W,_=R?u:u[h]||(u[h]={}),N=_[l],v=R?s:T?s[h]:(s[h]||{})[l];R&&(m=h);for(g in m)w=!x&&v&&v[g]!==void 0,w&&g in _||(S=w?v[g]:m[g],_[g]=R&&typeof v[g]!="function"?m[g]:M&&w?f(S,s):A&&v[g]==S?(function(j){var H=function(K,E,b){if(this instanceof j){switch(arguments.length){case 0:return new j;case 1:return new j(K);case 2:return new j(K,E)}return new j(K,E,b)}return j.apply(this,arguments)};return H[l]=j[l],H})(S):O&&typeof S=="function"?f(Function.call,S):S,O&&((_.virtual||(_.virtual={}))[g]=S,d&p.R&&N&&!N[g]&&c(N,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),f=o(57),c=o(5),l=o(8),p=o(10),d=o(45),h=o(18),m=o(52),g=o(1)("iterator"),w=!([].keys&&"next"in[].keys()),S="@@iterator",x="keys",R="values",T=function(){return this};i.exports=function(O,M,A,_,N,v,j){d(A,M,_);var H,K,E,b=function(k){if(!w&&k in W)return W[k];switch(k){case x:return function(){return new A(this,k)};case R:return function(){return new A(this,k)}}return function(){return new A(this,k)}},$=M+" Iterator",D=N==R,U=!1,W=O.prototype,Q=W[g]||W[S]||N&&W[N],ee=Q||b(N),Ce=N?D?b("entries"):ee:void 0,F=M=="Array"&&W.entries||Q;if(F&&(E=m(F.call(new O)),E!==Object.prototype&&(h(E,$,!0),s||l(E,g)||c(E,g,T))),D&&Q&&Q.name!==R&&(U=!0,ee=function(){return Q.call(this)}),s&&!j||!w&&!U&&W[g]||c(W,g,ee),p[M]=ee,p[$]=T,N)if(H={values:D?ee:b(R),keys:v?ee:b(x),entries:Ce},j)for(K in H)K in W||f(W,K,H[K]);else u(u.P+u.F*(w||U),M,H);return H}},function(i,a){i.exports=!0},function(i,a,o){var s=o(2),u="__core-js_shared__",f=s[u]||(s[u]={});i.exports=function(c){return f[c]||(f[c]={})}},function(i,a,o){var s,u,f,c=o(7),l=o(41),p=o(25),d=o(16),h=o(2),m=h.process,g=h.setImmediate,w=h.clearImmediate,S=h.MessageChannel,x=0,R={},T="onreadystatechange",O=function(){var A=+this;if(R.hasOwnProperty(A)){var _=R[A];delete R[A],_()}},M=function(A){O.call(A.data)};g&&w||(g=function(A){for(var _=[],N=1;arguments.length>N;)_.push(arguments[N++]);return R[++x]=function(){l(typeof A=="function"?A:Function(A),_)},s(x),x},w=function(A){delete R[A]},o(11)(m)=="process"?s=function(A){m.nextTick(c(O,A,1))}:S?(u=new S,f=u.port2,u.port1.onmessage=M,s=c(f.postMessage,f,1)):h.addEventListener&&typeof postMessage=="function"&&!h.importScripts?(s=function(A){h.postMessage(A+"","*")},h.addEventListener("message",M,!1)):s=T in d("script")?function(A){p.appendChild(d("script"))[T]=function(){p.removeChild(this),O.call(A)}}:function(A){setTimeout(c(O,A,1),0)}),i.exports={set:g,clear:w}},function(i,a,o){var s=o(20),u=Math.min;i.exports=function(f){return f>0?u(s(f),9007199254740991):0}},function(i,a,o){var s=o(9);i.exports=function(u,f){if(!s(u))return u;var c,l;if(f&&typeof(c=u.toString)=="function"&&!s(l=c.call(u))||typeof(c=u.valueOf)=="function"&&!s(l=c.call(u))||!f&&typeof(c=u.toString)=="function"&&!s(l=c.call(u)))return l;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(T){return T&&T.__esModule?T:{default:T}}function u(){return process.platform!=="win32"?"":process.arch==="ia32"&&process.env.hasOwnProperty("PROCESSOR_ARCHITEW6432")?"mixed":"native"}function f(T){return(0,g.createHash)("sha256").update(T).digest("hex")}function c(T){switch(S){case"darwin":return T.split("IOPlatformUUID")[1].split(`
2
+ `)[0].replace(/\=|\s+|\"/gi,"").toLowerCase();case"win32":return T.toString().split("REG_SZ")[1].replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"linux":return T.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"freebsd":return T.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();default:throw new Error("Unsupported platform: "+process.platform)}}function l(T){var O=c((0,m.execSync)(R[S]).toString());return T?O:f(O)}function p(T){return new h.default(function(O,M){return(0,m.exec)(R[S],{},function(A,_,N){if(A)return M(new Error("Error while obtaining machine id: "+A.stack));var v=c(_.toString());return O(T?v:f(v))})})}Object.defineProperty(a,"__esModule",{value:!0});var d=o(35),h=s(d);a.machineIdSync=l,a.machineId=p;var m=o(70),g=o(71),w=process,S=w.platform,x={native:"%windir%\\System32",mixed:"%windir%\\sysnative\\cmd.exe /c %windir%\\System32"},R={darwin:"ioreg -rd1 -c IOPlatformExpertDevice",win32:x[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,f){if(!(o instanceof s)||f!==void 0&&f in o)throw TypeError(u+": incorrect invocation!");return o}},function(i,a,o){var s=o(13),u=o(31),f=o(62);i.exports=function(c){return function(l,p,d){var h,m=s(l),g=u(m.length),w=f(d,g);if(c&&p!=p){for(;g>w;)if(h=m[w++],h!=h)return!0}else for(;g>w;w++)if((c||w in m)&&m[w]===p)return c||w||0;return!c&&-1}}},function(i,m,o){var s=o(7),u=o(44),f=o(43),c=o(3),l=o(31),p=o(64),d={},h={},m=i.exports=function(g,w,S,x,R){var T,O,M,A,_=R?function(){return g}:p(g),N=s(S,x,w?2:1),v=0;if(typeof _!="function")throw TypeError(g+" is not iterable!");if(f(_)){for(T=l(g.length);T>v;v++)if(A=w?N(c(O=g[v])[0],O[1]):N(g[v]),A===d||A===h)return A}else for(M=_.call(g);!(O=M.next()).done;)if(A=u(M,N,O.value,w),A===d||A===h)return A};m.BREAK=d,m.RETURN=h},function(i,a){i.exports=function(o,s,u){var f=u===void 0;switch(s.length){case 0:return f?o():o.call(u);case 1:return f?o(s[0]):o.call(u,s[0]);case 2:return f?o(s[0],s[1]):o.call(u,s[0],s[1]);case 3:return f?o(s[0],s[1],s[2]):o.call(u,s[0],s[1],s[2]);case 4:return f?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"),f=Array.prototype;i.exports=function(c){return c!==void 0&&(s.Array===c||f[u]===c)}},function(i,a,o){var s=o(3);i.exports=function(u,f,c,l){try{return l?f(s(c)[0],c[1]):f(c)}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),f=o(18),c={};o(5)(c,o(1)("iterator"),function(){return this}),i.exports=function(l,p,d){l.prototype=s(c,{next:u(1,d)}),f(l,p+" Iterator")}},function(i,a,o){var s=o(1)("iterator"),u=!1;try{var f=[7][s]();f.return=function(){u=!0},Array.from(f,function(){throw 2})}catch{}i.exports=function(c,l){if(!l&&!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},c(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,f=s.MutationObserver||s.WebKitMutationObserver,c=s.process,l=s.Promise,p=o(11)(c)=="process";i.exports=function(){var d,h,m,g=function(){var R,T;for(p&&(R=c.domain)&&R.exit();d;){T=d.fn,d=d.next;try{T()}catch(O){throw d?m():h=void 0,O}}h=void 0,R&&R.enter()};if(p)m=function(){c.nextTick(g)};else if(f){var w=!0,S=document.createTextNode("");new f(g).observe(S,{characterData:!0}),m=function(){S.data=w=!w}}else if(l&&l.resolve){var x=l.resolve();m=function(){x.then(g)}}else m=function(){u.call(s,g)};return function(R){var T={fn:R,next:void 0};h&&(h.next=T),d||(d=T,m()),h=T}}},function(i,a,o){var s=o(3),u=o(50),f=o(22),c=o(19)("IE_PROTO"),l=function(){},p="prototype",d=function(){var h,m=o(16)("iframe"),g=f.length,w=">";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"+w),h.close(),d=h.F;g--;)delete d[p][f[g]];return d()};i.exports=Object.create||function(h,m){var g;return h!==null?(l[p]=s(h),g=new l,l[p]=null,g[c]=h):g=d(),m===void 0?g:u(g,m)}},function(i,a,o){var s=o(12),u=o(3),f=o(54);i.exports=o(4)?Object.defineProperties:function(c,l){u(c);for(var p,d=f(l),h=d.length,m=0;h>m;)s.f(c,p=d[m++],l[p]);return c}},function(i,a,o){var s=o(55),u=o(17),f=o(13),c=o(32),l=o(8),p=o(26),d=Object.getOwnPropertyDescriptor;a.f=o(4)?d:function(h,m){if(h=f(h),m=c(m,!0),p)try{return d(h,m)}catch{}if(l(h,m))return u(!s.f.call(h,m),h[m])}},function(i,a,o){var s=o(8),u=o(63),f=o(19)("IE_PROTO"),c=Object.prototype;i.exports=Object.getPrototypeOf||function(l){return l=u(l),s(l,f)?l[f]:typeof l.constructor=="function"&&l instanceof l.constructor?l.constructor.prototype:l instanceof Object?c:null}},function(i,a,o){var s=o(8),u=o(13),f=o(39)(!1),c=o(19)("IE_PROTO");i.exports=function(l,p){var d,h=u(l),m=0,g=[];for(d in h)d!=c&&s(h,d)&&g.push(d);for(;p.length>m;)s(h,d=p[m++])&&(~f(g,d)||g.push(d));return g}},function(i,a,o){var s=o(53),u=o(22);i.exports=Object.keys||function(f){return s(f,u)}},function(i,a){a.f={}.propertyIsEnumerable},function(i,a,o){var s=o(5);i.exports=function(u,f,c){for(var l in f)c&&u[l]?u[l]=f[l]:s(u,l,f[l]);return u}},function(i,a,o){i.exports=o(5)},function(i,a,o){var s=o(9),u=o(3),f=function(c,l){if(u(c),!s(l)&&l!==null)throw TypeError(l+": can't set as prototype!")};i.exports={set:Object.setPrototypeOf||("__proto__"in{}?(function(c,l,p){try{p=o(7)(Function.call,o(51).f(Object.prototype,"__proto__").set,2),p(c,[]),l=!(c instanceof Array)}catch{l=!0}return function(d,h){return f(d,h),l?d.__proto__=h:p(d,h),d}})({},!1):void 0),check:f}},function(i,a,o){var s=o(2),u=o(6),f=o(12),c=o(4),l=o(1)("species");i.exports=function(p){var d=typeof u[p]=="function"?u[p]:s[p];c&&d&&!d[l]&&f.f(d,l,{configurable:!0,get:function(){return this}})}},function(i,a,o){var s=o(3),u=o(14),f=o(1)("species");i.exports=function(c,l){var p,d=s(c).constructor;return d===void 0||(p=s(d)[f])==null?l:u(p)}},function(i,a,o){var s=o(20),u=o(15);i.exports=function(f){return function(c,l){var p,d,h=String(u(c)),m=s(l),g=h.length;return m<0||m>=g?f?"":void 0:(p=h.charCodeAt(m),p<55296||p>56319||m+1===g||(d=h.charCodeAt(m+1))<56320||d>57343?f?h.charAt(m):p:f?h.slice(m,m+2):(p-55296<<10)+(d-56320)+65536)}}},function(i,a,o){var s=o(20),u=Math.max,f=Math.min;i.exports=function(c,l){return c=s(c),c<0?u(c+l,0):f(c,l)}},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"),f=o(10);i.exports=o(6).getIteratorMethod=function(c){if(c!=null)return c[u]||c["@@iterator"]||f[s(c)]}},function(i,a,o){var s=o(37),u=o(47),f=o(10),c=o(13);i.exports=o(27)(Array,"Array",function(l,p){this._t=c(l),this._i=0,this._k=p},function(){var l=this._t,p=this._k,d=this._i++;return!l||d>=l.length?(this._t=void 0,u(1)):p=="keys"?u(0,d):p=="values"?u(0,l[d]):u(0,[d,l[d]])},"values"),f.Arguments=f.Array,s("keys"),s("values"),s("entries")},function(i,a){},function(i,a,o){var s,u,f,c=o(28),l=o(2),p=o(7),d=o(21),h=o(23),m=o(9),g=(o(3),o(14)),w=o(38),S=o(40),x=(o(58).set,o(60)),R=o(30).set,T=o(48)(),O="Promise",M=l.TypeError,_=l.process,A=l[O],_=l.process,N=d(_)=="process",v=function(){},j=!!(function(){try{var F=A.resolve(1),k=(F.constructor={})[o(1)("species")]=function(P){P(v,v)};return(N||typeof PromiseRejectionEvent=="function")&&F.then(v)instanceof k}catch{}})(),H=function(F,k){return F===k||F===A&&k===f},K=function(F){var k;return!(!m(F)||typeof(k=F.then)!="function")&&k},E=function(F){return H(A,F)?new b(F):new u(F)},b=u=function(F){var k,P;this.promise=new F(function(V,ce){if(k!==void 0||P!==void 0)throw M("Bad Promise constructor");k=V,P=ce}),this.resolve=g(k),this.reject=g(P)},$=function(F){try{F()}catch(k){return{error:k}}},D=function(F,k){if(!F._n){F._n=!0;var P=F._c;T(function(){for(var V=F._v,ce=F._s==1,L=0,Y=function(I){var q,X,oe=ce?I.ok:I.fail,Z=I.resolve,Ne=I.reject,je=I.domain;try{oe?(ce||(F._h==2&&Q(F),F._h=1),oe===!0?q=V:(je&&je.enter(),q=oe(V),je&&je.exit()),q===I.promise?Ne(M("Promise-chain cycle")):(X=K(q))?X.call(q,Z,Ne):Z(q)):Ne(V)}catch(Hu){Ne(Hu)}};P.length>L;)Y(P[L++]);F._c=[],F._n=!1,k&&!F._h&&U(F)})}},U=function(F){R.call(l,function(){var k,P,V,ce=F._v;if(W(F)&&(k=$(function(){N?_.emit("unhandledRejection",ce,F):(P=l.onunhandledrejection)?P({promise:F,reason:ce}):(V=l.console)&&V.error&&V.error("Unhandled promise rejection",ce)}),F._h=N||W(F)?2:1),F._a=void 0,k)throw k.error})},W=function(F){if(F._h==1)return!1;for(var k,P=F._a||F._c,V=0;P.length>V;)if(k=P[V++],k.fail||!W(k.promise))return!1;return!0},Q=function(F){R.call(l,function(){var k;N?_.emit("rejectionHandled",F):(k=l.onrejectionhandled)&&k({promise:F,reason:F._v})})},ee=function(F){var k=this;k._d||(k._d=!0,k=k._w||k,k._v=F,k._s=2,k._a||(k._a=k._c.slice()),D(k,!0))},Ce=function(F){var k,P=this;if(!P._d){P._d=!0,P=P._w||P;try{if(P===F)throw M("Promise can't be resolved itself");(k=K(F))?T(function(){var V={_w:P,_d:!1};try{k.call(F,p(Ce,V,1),p(ee,V,1))}catch(ce){ee.call(V,ce)}}):(P._v=F,P._s=1,D(P,!1))}catch(V){ee.call({_w:P,_d:!1},V)}}};j||(A=function(F){w(this,A,O,"_h"),g(F),s.call(this);try{F(p(Ce,this,1),p(ee,this,1))}catch(k){ee.call(this,k)}},s=function(F){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)(A.prototype,{then:function(F,k){var P=E(x(this,A));return P.ok=typeof F!="function"||F,P.fail=typeof k=="function"&&k,P.domain=N?_.domain:void 0,this._c.push(P),this._a&&this._a.push(P),this._s&&D(this,!1),P.promise},catch:function(F){return this.then(void 0,F)}}),b=function(){var F=new s;this.promise=F,this.resolve=p(Ce,F,1),this.reject=p(ee,F,1)}),h(h.G+h.W+h.F*!j,{Promise:A}),o(18)(A,O),o(59)(O),f=o(6)[O],h(h.S+h.F*!j,O,{reject:function(F){var k=E(this),P=k.reject;return P(F),k.promise}}),h(h.S+h.F*(c||!j),O,{resolve:function(F){if(F instanceof A&&H(F.constructor,this))return F;var k=E(this),P=k.resolve;return P(F),k.promise}}),h(h.S+h.F*!(j&&o(46)(function(F){A.all(F).catch(v)})),O,{all:function(F){var k=this,P=E(k),V=P.resolve,ce=P.reject,L=$(function(){var Y=[],I=0,q=1;S(F,!1,function(X){var oe=I++,Z=!1;Y.push(void 0),q++,k.resolve(X).then(function(Ne){Z||(Z=!0,Y[oe]=Ne,--q||V(Y))},ce)}),--q||V(Y)});return L&&ce(L.error),P.promise},race:function(F){var k=this,P=E(k),V=P.reject,ce=$(function(){S(F,!1,function(L){k.resolve(L).then(P.resolve,V)})});return ce&&V(ce.error),P.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,f=this._t,c=this._i;return c>=f.length?{value:void 0,done:!0}:(u=s(f,c),this._i+=u.length,{value:u,done:!1})})},function(i,a,o){o(65);for(var s=o(2),u=o(5),f=o(10),c=o(1)("toStringTag"),l=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],p=0;p<5;p++){var d=l[p],h=s[d],m=h&&h.prototype;m&&!m[c]&&u(m,c,d),f[d]=f.Array}},function(i,a){i.exports=pn.default},function(i,a){i.exports=Li.default}])})})(vf);var Pr;try{Pr=Map}catch{}var Lr;try{Lr=Set}catch{}function $a(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(kr);if(Pr&&e instanceof Pr)return new Map(Array.from(e.entries()));if(Lr&&e instanceof Lr)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]:$a(e[i],t,n)}return r}return e}function kr(e){return $a(e,[],[])}const wf=Object.prototype.toString,Ef=Error.prototype.toString,bf=RegExp.prototype.toString,Sf=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",xf=/^Symbol\((.*)\)(.*)$/;function _f(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function Bi(e,t=!1){if(e==null||e===!0||e===!1)return""+e;const n=typeof e;if(n==="number")return _f(e);if(n==="string")return t?`"${e}"`:e;if(n==="function")return"[Function "+(e.name||"anonymous")+"]";if(n==="symbol")return Sf.call(e).replace(xf,"Symbol($1)");const r=wf.call(e).slice(8,-1);return r==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):r==="Error"||e instanceof Error?"["+Ef.call(e)+"]":r==="RegExp"?bf.call(e):null}function bt(e,t){let n=Bi(e,t);return n!==null?n:JSON.stringify(e,function(r,i){let a=Bi(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: \`${bt(n,!0)}\``+(i?` (cast from the value \`${bt(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"},Ie={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"},Af={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"},Dr={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},Tf={isValue:"${path} field must be ${value}"},Mr={noUnknown:"${path} field has unspecified keys: ${unknown}"},an={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 Cf=Object.assign(Object.create(null),{mixed:Ye,string:Ie,number:Af,date:Dr,object:Mr,array:an,boolean:Tf}),Mn=(e=>e&&e.__isYupSchema__);class Rf{constructor(t,n){if(this.refs=t,this.refs=t,typeof n=="function"){this.fn=n;return}if(!dn.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(),f=s.pop(),c=o(...s)?i:a;if(c)return typeof c=="function"?c(f):f.concat(c.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(!Mn(i))throw new TypeError("conditions must return a schema object");return i.resolve(n)}}function Ia(e){return e==null?[]:[].concat(e)}function jr(){return jr=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},jr.apply(this,arguments)}let Ff=/\$\{\s*(\w+)\s*\}/g;class me extends Error{static formatError(t,n){const r=n.label||n.path||"this";return r!==n.path&&(n=jr({},n,{path:r})),typeof t=="string"?t.replace(Ff,(i,a)=>bt(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=[],Ia(t).forEach(a=>{me.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,me)}}const $f=e=>{let t=!1;return(...n)=>{t||(t=!0,e(...n))}};function mn(e,t){let{endEarly:n,tests:r,args:i,value:a,errors:o,sort:s,path:u}=e,f=$f(t),c=r.length;const l=[];if(o=o||[],!c)return o.length?f(new me(o,a,u)):f(null,a);for(let p=0;p<r.length;p++){const d=r[p];d(i,function(m){if(m){if(!me.isError(m))return f(m,a);if(n)return m.value=a,f(m,a);l.push(m)}if(--c<=0){if(l.length&&(s&&l.sort(s),o.length&&l.push(...o),o=l),o.length){f(new me(o,a,u),a);return}f(null,a)}})}}function Tt(e){this._maxSize=e,this.clear()}Tt.prototype.clear=function(){this._size=0,this._values=Object.create(null)};Tt.prototype.get=function(e){return this._values[e]};Tt.prototype.set=function(e,t){return this._size>=this._maxSize&&this.clear(),e in this._values||this._size++,this._values[e]=t};var If=/[^.^\]^[]+|(?=\[\]|\.\.)/g,Of=/^\d+$/,Nf=/^\d/,Pf=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,Lf=/^\s*(['"]?)(.*?)(\1)\s*$/,Zr=512,Ui=new Tt(Zr);new Tt(Zr);var Gi=new Tt(Zr),jn={split:Hr,getter:function(e,t){var n=kf(e);return Gi.get(e)||Gi.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})},forEach:function(e,t,n){Df(Array.isArray(e)?e:Hr(e),t,n)}};function kf(e){return Ui.get(e)||Ui.set(e,Hr(e).map(function(t){return t.replace(Lf,"$2")}))}function Hr(e){return e.match(If)||[""]}function Df(e,t,n){var r=e.length,i,a,o,s;for(a=0;a<r;a++)i=e[a],i&&(Hf(i)&&(i='"'+i+'"'),s=Oa(i),o=!s&&/^\d+$/.test(i),t.call(n,i,s,o,a,e))}function Oa(e){return typeof e=="string"&&e&&["'",'"'].indexOf(e.charAt(0))!==-1}function Mf(e){return e.match(Nf)&&!e.match(Of)}function jf(e){return Pf.test(e)}function Hf(e){return!Oa(e)&&(Mf(e)||jf(e))}const Zt={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]===Zt.context,this.isValue=this.key[0]===Zt.value,this.isSibling=!this.isContext&&!this.isValue;let r=this.isContext?Zt.context:this.isValue?Zt.value:"";this.path=this.key.slice(r.length),this.getter=this.path&&jn.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 gn(){return gn=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},gn.apply(this,arguments)}function Bf(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 Jt(e){function t(n,r){let{value:i,path:a="",label:o,options:s,originalValue:u,sync:f}=n,c=Bf(n,["value","path","label","options","originalValue","sync"]);const{name:l,test:p,params:d,message:h}=e;let{parent:m,context:g}=s;function w(O){return tt.isRef(O)?O.getValue(i,m,g):O}function S(O={}){const M=ua.default(gn({value:i,originalValue:u,label:o,path:O.path||a},d,O.params),w),A=new me(me.formatError(O.message||h,M),i,M.path,O.type||l);return A.params=M,A}let x=gn({path:a,parent:m,type:l,createError:S,resolve:w,options:s,originalValue:u},c);if(!f){try{Promise.resolve(p.call(x,i,x)).then(O=>{me.isError(O)?r(O):O?r(null,O):r(S())})}catch(O){r(O)}return}let R;try{var T;if(R=p.call(x,i,x),typeof((T=R)==null?void 0:T.then)=="function")throw new Error(`Validation test of type: "${x.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`)}catch(O){r(O);return}me.isError(R)?r(R):R?r(null,R):r(S())}return t.OPTIONS=e,t}let Uf=e=>e.substr(0,e.length-1).substr(1);function Gf(e,t,n,r=n){let i,a,o;return t?(jn.forEach(t,(s,u,f)=>{let c=u?Uf(s):s;if(e=e.resolve({context:r,parent:i,value:n}),e.innerType){let l=f?parseInt(c,10):0;if(n&&l>=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[l],e=e.innerType}if(!f){if(!e.fields||!e.fields[c])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[c],e=e.fields[c]}a=c,o=u?"["+s+"]":"."+s}),{schema:e,parent:i,parentPath:a}):{parent:i,parentPath:t,schema:e}}class yn{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 yn;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 Re(){return Re=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},Re.apply(this,arguments)}class ye{constructor(t){this.deps=[],this.conditions=[],this._whitelist=new yn,this._blacklist=new yn,this.exclusiveTests=Object.create(null),this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(Ye.notType)}),this.type=t?.type||"mixed",this.spec=Re({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=Re({},this.exclusiveTests),n.deps=[...this.deps],n.conditions=[...this.conditions],n.tests=[...this.tests],n.transforms=[...this.transforms],n.spec=kr(Re({},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=Re({},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(Re({value:t},n)),i=r._cast(t,n);if(t!==void 0&&n.assert!==!1&&r.isType(i)!==!0){let a=bt(t),o=bt(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}
5
- `+(o!==a?`result of cast: ${o}`:""))}return i}_cast(t,n){let r=t===void 0?t:this.transforms.reduce((i,a)=>a.call(this,i,t,this),t);return r===void 0&&(r=this.getDefault()),r}_validate(t,n={},r){let{sync:i,path:a,from:o=[],originalValue:s=t,strict:u=this.spec.strict,abortEarly:f=this.spec.abortEarly}=n,c=t;u||(c=this._cast(c,Re({assert:!1},n)));let l={value:c,path:a,options:n,originalValue:s,schema:this,label:this.spec.label,sync:i,from:o},p=[];this._typeError&&p.push(this._typeError),this._whitelistError&&p.push(this._whitelistError),this._blacklistError&&p.push(this._blacklistError),hn({args:l,value:c,path:a,tests:p,endEarly:f},d=>{if(d)return void r(d,c);hn({tests:this.tests,args:l,path:a,sync:i,value:c,endEarly:f},r)})}validate(t,n,r){let i=this.resolve(Re({},n,{value:t}));return typeof r=="function"?i._validate(t,n,r):new Promise((a,o)=>i._validate(t,n,(s,u)=>{s?o(s):a(u)}))}validateSync(t,n){let r=this.resolve(Re({},n,{value:t})),i;return r._validate(t,Re({},n,{sync:!0}),(a,o)=>{if(a)throw a;i=o}),i}isValid(t,n){return this.validate(t,n).then(()=>!0,r=>{if(me.isError(r))return!1;throw r})}isValidSync(t,n){try{return this.validateSync(t,n),!0}catch(r){if(me.isError(r))return!1;throw r}}_getDefault(){let t=this.spec.default;return t==null?t:typeof t=="function"?t.call(this):Lr(t)}getDefault(t){return this.resolve(t||{})._getDefault()}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){var n=this.clone();return n.spec.strict=t,n}_isPresent(t){return t!=null}defined(t=Ye.defined){return this.test({message:t,name:"defined",exclusive:!0,test(n){return n!==void 0}})}required(t=Ye.required){return this.clone({presence:"required"}).withMutation(n=>n.test({message:t,name:"required",exclusive:!0,test(r){return this.schema._isPresent(r)}}))}notRequired(){var t=this.clone({presence:"optional"});return t.tests=t.tests.filter(n=>n.OPTIONS.name!=="required"),t}nullable(t=!0){var n=this.clone({nullable:t!==!1});return n}transform(t){var n=this.clone();return n.transforms.push(t),n}test(...t){let n;if(t.length===1?typeof t[0]=="function"?n={test:t[0]}:n=t[0]:t.length===2?n={name:t[0],test:t[1]}:n={name:t[0],message:t[1],test:t[2]},n.message===void 0&&(n.message=Ye.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let r=this.clone(),i=Zt(n),a=n.exclusive||n.name&&r.exclusiveTests[n.name]===!0;if(n.exclusive&&!n.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return n.name&&(r.exclusiveTests[n.name]=!!n.exclusive),r.tests=r.tests.filter(o=>!(o.OPTIONS.name===n.name&&(a||o.OPTIONS.test===i.OPTIONS.test))),r.tests.push(i),r}when(t,n){!Array.isArray(t)&&typeof t!="string"&&(n=t,t=".");let r=this.clone(),i=$a(t).map(a=>new tt(a));return i.forEach(a=>{a.isSibling&&r.deps.push(a.key)}),r.conditions.push(new Cf(i,n)),r}typeError(t){var n=this.clone();return n._typeError=Zt({message:t,name:"typeError",test(r){return r!==void 0&&!this.schema.isType(r)?this.createError({params:{type:this.schema._type}}):!0}}),n}oneOf(t,n=Ye.oneOf){var r=this.clone();return t.forEach(i=>{r._whitelist.add(i),r._blacklist.delete(i)}),r._whitelistError=Zt({message:n,name:"oneOf",test(i){if(i===void 0)return!0;let a=this.schema._whitelist;return a.has(i,this.resolve)?!0:this.createError({params:{values:a.toArray().join(", ")}})}}),r}notOneOf(t,n=Ye.notOneOf){var r=this.clone();return t.forEach(i=>{r._blacklist.add(i),r._whitelist.delete(i)}),r._blacklistError=Zt({message:n,name:"notOneOf",test(i){let a=this.schema._blacklist;return a.has(i,this.resolve)?this.createError({params:{values:a.toArray().join(", ")}}):!0}}),r}strip(t=!0){let n=this.clone();return n.spec.strip=t,n}describe(){const t=this.clone(),{label:n,meta:r}=t.spec;return{meta:r,label:n,type:t.type,oneOf:t._whitelist.describe(),notOneOf:t._blacklist.describe(),tests:t.tests.map(a=>({name:a.OPTIONS.name,params:a.OPTIONS.params})).filter((a,o,s)=>s.findIndex(u=>u.name===a.name)===o)}}}ye.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])ye.prototype[`${e}At`]=function(t,n,r={}){const{parent:i,parentPath:a,schema:o}=Uf(this,t,n,r.context);return o[e](i&&i[a],Re({},r,{parent:i,path:t}))};for(const e of["equals","is"])ye.prototype[e]=ye.prototype.oneOf;for(const e of["not","nope"])ye.prototype[e]=ye.prototype.notOneOf;ye.prototype.optional=ye.prototype.notRequired;const Oa=ye;function jn(){return new Oa}jn.prototype=Oa.prototype;const ve=(e=>e==null);let Gf=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i,qf=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,Kf=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,Wf=e=>ve(e)||e===e.trim(),zf={}.toString();function Zr(){return new Na}class Na extends ye{constructor(){super({type:"string"}),this.withMutation(()=>{this.transform(function(t){if(this.isType(t)||Array.isArray(t))return t;const n=t!=null&&t.toString?t.toString():t;return n===zf?t:n})})}_typeCheck(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}_isPresent(t){return super._isPresent(t)&&!!t.length}length(t,n=Ie.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},test(r){return ve(r)||r.length===this.resolve(t)}})}min(t,n=Ie.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},test(r){return ve(r)||r.length>=this.resolve(t)}})}max(t,n=Ie.max){return this.test({name:"max",exclusive:!0,message:n,params:{max:t},test(r){return ve(r)||r.length<=this.resolve(t)}})}matches(t,n){let r=!1,i,a;return n&&(typeof n=="object"?{excludeEmptyString:r=!1,message:i,name:a}=n:i=n),this.test({name:a||"matches",message:i||Ie.matches,params:{regex:t},test:o=>ve(o)||o===""&&r||o.search(t)!==-1})}email(t=Ie.email){return this.matches(Gf,{name:"email",message:t,excludeEmptyString:!0})}url(t=Ie.url){return this.matches(qf,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=Ie.uuid){return this.matches(Kf,{name:"uuid",message:t,excludeEmptyString:!1})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=Ie.trim){return this.transform(n=>n!=null?n.trim():n).test({message:t,name:"trim",test:Wf})}lowercase(t=Ie.lowercase){return this.transform(n=>ve(n)?n:n.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,test:n=>ve(n)||n===n.toLowerCase()})}uppercase(t=Ie.uppercase){return this.transform(n=>ve(n)?n:n.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,test:n=>ve(n)||n===n.toUpperCase()})}}Zr.prototype=Na.prototype;var Yf=/^(\d{4}|[+\-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;function Qf(e){var t=[1,4,5,6,7,10,11],n=0,r,i;if(i=Yf.exec(e)){for(var a=0,o;o=t[a];++a)i[o]=+i[o]||0;i[2]=(+i[2]||1)-1,i[3]=+i[3]||1,i[7]=i[7]?String(i[7]).substr(0,3):0,(i[8]===void 0||i[8]==="")&&(i[9]===void 0||i[9]==="")?r=+new Date(i[1],i[2],i[3],i[4],i[5],i[6],i[7]):(i[8]!=="Z"&&i[9]!==void 0&&(n=i[10]*60+i[11],i[9]==="+"&&(n=0-n)),r=Date.UTC(i[1],i[2],i[3],i[4],i[5]+n,i[6],i[7]))}else r=Date.parse?Date.parse(e):NaN;return r}let Pa=new Date(""),Vf=e=>Object.prototype.toString.call(e)==="[object Date]";class Xf extends ye{constructor(){super({type:"date"}),this.withMutation(()=>{this.transform(function(t){return this.isType(t)?t:(t=Qf(t),isNaN(t)?Pa:new Date(t))})})}_typeCheck(t){return Vf(t)&&!isNaN(t.getTime())}prepareParam(t,n){let r;if(tt.isRef(t))r=t;else{let i=this.cast(t);if(!this._typeCheck(i))throw new TypeError(`\`${n}\` must be a Date or a value that can be \`cast()\` to a Date`);r=i}return r}min(t,n=kr.min){let r=this.prepareParam(t,"min");return this.test({message:n,name:"min",exclusive:!0,params:{min:t},test(i){return ve(i)||i>=this.resolve(r)}})}max(t,n=kr.max){var r=this.prepareParam(t,"max");return this.test({message:n,name:"max",exclusive:!0,params:{max:t},test(i){return ve(i)||i<=this.resolve(r)}})}}Xf.INVALID_DATE=Pa;var Jr={exports:{}};Jr.exports=function(e){return La(Zf(e),e)};Jr.exports.array=La;function La(e,t){var n=e.length,r=new Array(n),i={},a=n,o=Jf(t),s=ep(e);for(t.forEach(function(f){if(!s.has(f[0])||!s.has(f[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});a--;)i[a]||u(e[a],a,new Set);return r;function u(f,c,l){if(l.has(f)){var p;try{p=", node was:"+JSON.stringify(f)}catch{p=""}throw new Error("Cyclic dependency"+p)}if(!s.has(f))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(f));if(!i[c]){i[c]=!0;var d=o.get(f)||new Set;if(d=Array.from(d),c=d.length){l.add(f);do{var h=d[--c];u(h,s.get(h),l)}while(c);l.delete(f)}r[--n]=f}}}function Zf(e){for(var t=new Set,n=0,r=e.length;n<r;n++){var i=e[n];t.add(i[0]),t.add(i[1])}return Array.from(t)}function Jf(e){for(var t=new Map,n=0,r=e.length;n<r;n++){var i=e[n];t.has(i[0])||t.set(i[0],new Set),t.has(i[1])||t.set(i[1],new Set),t.get(i[0]).add(i[1])}return t}function ep(e){for(var t=new Map,n=0,r=e.length;n<r;n++)t.set(e[n],n);return t}var tp=Jr.exports;const np=Ra(tp);function rp(e,t=[]){let n=[],r=[];function i(a,o){var s=Mn.split(a)[0];~r.indexOf(s)||r.push(s),~t.indexOf(`${o}-${s}`)||n.push([o,s])}for(const a in e)if(pn.default(e,a)){let o=e[a];~r.indexOf(a)||r.push(a),tt.isRef(o)&&o.isSibling?i(o.path,a):Dn(o)&&"deps"in o&&o.deps.forEach(s=>i(s,a))}return np.array(r,n).reverse()}function Gi(e,t){let n=1/0;return e.some((r,i)=>{var a;if(((a=t.path)==null?void 0:a.indexOf(r))!==-1)return n=i,!0}),n}function ka(e){return(t,n)=>Gi(e,t)-Gi(e,n)}function mt(){return mt=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},mt.apply(this,arguments)}let qi=e=>Object.prototype.toString.call(e)==="[object Object]";function ip(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(r=>n.indexOf(r)===-1)}const op=ka([]);class Da extends ye{constructor(t){super({type:"object"}),this.fields=Object.create(null),this._sortErrors=op,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{this.transform(function(r){if(typeof r=="string")try{r=JSON.parse(r)}catch{r=null}return this.isType(r)?r:null}),t&&this.shape(t)})}_typeCheck(t){return qi(t)||typeof t=="function"}_cast(t,n={}){var r;let i=super._cast(t,n);if(i===void 0)return this.getDefault();if(!this._typeCheck(i))return i;let a=this.fields,o=(r=n.stripUnknown)!=null?r:this.spec.noUnknown,s=this._nodes.concat(Object.keys(i).filter(l=>this._nodes.indexOf(l)===-1)),u={},f=mt({},n,{parent:u,__validating:n.__validating||!1}),c=!1;for(const l of s){let p=a[l],d=pn.default(i,l);if(p){let h,m=i[l];f.path=(n.path?`${n.path}.`:"")+l,p=p.resolve({value:m,context:n.context,parent:u});let g="spec"in p?p.spec:void 0,E=g?.strict;if(g?.strip){c=c||l in i;continue}h=!n.__validating||!E?p.cast(i[l],f):i[l],h!==void 0&&(u[l]=h)}else d&&!o&&(u[l]=i[l]);u[l]!==i[l]&&(c=!0)}return c?u:i}_validate(t,n={},r){let i=[],{sync:a,from:o=[],originalValue:s=t,abortEarly:u=this.spec.abortEarly,recursive:f=this.spec.recursive}=n;o=[{schema:this,value:s},...o],n.__validating=!0,n.originalValue=s,n.from=o,super._validate(t,n,(c,l)=>{if(c){if(!me.isError(c)||u)return void r(c,l);i.push(c)}if(!f||!qi(l)){r(i[0]||null,l);return}s=s||l;let p=this._nodes.map(d=>(h,m)=>{let g=d.indexOf(".")===-1?(n.path?`${n.path}.`:"")+d:`${n.path||""}["${d}"]`,E=this.fields[d];if(E&&"validate"in E){E.validate(l[d],mt({},n,{path:g,from:o,strict:!0,parent:l,originalValue:s[d]}),m);return}m(null)});hn({tests:p,value:l,errors:i,endEarly:u,sort:this._sortErrors,path:n.path},r)})}clone(t){const n=super.clone(t);return n.fields=mt({},this.fields),n._nodes=this._nodes,n._excludedEdges=this._excludedEdges,n._sortErrors=this._sortErrors,n}concat(t){let n=super.concat(t),r=n.fields;for(let[i,a]of Object.entries(this.fields)){const o=r[i];o===void 0?r[i]=a:o instanceof ye&&a instanceof ye&&(r[i]=a.concat(o))}return n.withMutation(()=>n.shape(r))}getDefaultFromShape(){let t={};return this._nodes.forEach(n=>{const r=this.fields[n];t[n]="default"in r?r.getDefault():void 0}),t}_getDefault(){if("default"in this.spec)return super._getDefault();if(this._nodes.length)return this.getDefaultFromShape()}shape(t,n=[]){let r=this.clone(),i=Object.assign(r.fields,t);if(r.fields=i,r._sortErrors=ka(Object.keys(i)),n.length){Array.isArray(n[0])||(n=[n]);let a=n.map(([o,s])=>`${o}-${s}`);r._excludedEdges=r._excludedEdges.concat(a)}return r._nodes=rp(i,r._excludedEdges),r}pick(t){const n={};for(const r of t)this.fields[r]&&(n[r]=this.fields[r]);return this.clone().withMutation(r=>(r.fields={},r.shape(n)))}omit(t){const n=this.clone(),r=n.fields;n.fields={};for(const i of t)delete r[i];return n.withMutation(()=>n.shape(r))}from(t,n,r){let i=Mn.getter(t,!0);return this.transform(a=>{if(a==null)return a;let o=a;return pn.default(a,t)&&(o=mt({},a),r||delete o[t],o[n]=i(a)),o})}noUnknown(t=!0,n=Dr.noUnknown){typeof t=="string"&&(n=t,t=!0);let r=this.test({name:"noUnknown",exclusive:!0,message:n,test(i){if(i==null)return!0;const a=ip(this.schema,i);return!t||a.length===0||this.createError({params:{unknown:a.join(", ")}})}});return r.spec.noUnknown=t,r}unknown(t=!0,n=Dr.noUnknown){return this.noUnknown(!t,n)}transformKeys(t){return this.transform(n=>n&&ac.default(n,(r,i)=>t(i)))}camelCase(){return this.transformKeys(oc.default)}snakeCase(){return this.transformKeys(Li.default)}constantCase(){return this.transformKeys(t=>Li.default(t).toUpperCase())}describe(){let t=super.describe();return t.fields=sa.default(this.fields,n=>n.describe()),t}}function Ma(e){return new Da(e)}Ma.prototype=Da.prototype;function yn(){return yn=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},yn.apply(this,arguments)}function ja(e){return new Ha(e)}class Ha extends ye{constructor(t){super({type:"array"}),this.innerType=t,this.withMutation(()=>{this.transform(function(n){if(typeof n=="string")try{n=JSON.parse(n)}catch{n=null}return this.isType(n)?n:null})})}_typeCheck(t){return Array.isArray(t)}get _subType(){return this.innerType}_cast(t,n){const r=super._cast(t,n);if(!this._typeCheck(r)||!this.innerType)return r;let i=!1;const a=r.map((o,s)=>{const u=this.innerType.cast(o,yn({},n,{path:`${n.path||""}[${s}]`}));return u!==o&&(i=!0),u});return i?a:r}_validate(t,n={},r){var i,a;let o=[];n.sync;let s=n.path,u=this.innerType,f=(i=n.abortEarly)!=null?i:this.spec.abortEarly,c=(a=n.recursive)!=null?a:this.spec.recursive,l=n.originalValue!=null?n.originalValue:t;super._validate(t,n,(p,d)=>{if(p){if(!me.isError(p)||f)return void r(p,d);o.push(p)}if(!c||!u||!this._typeCheck(d)){r(o[0]||null,d);return}l=l||d;let h=new Array(d.length);for(let m=0;m<d.length;m++){let g=d[m],E=`${n.path||""}[${m}]`,S=yn({},n,{path:E,strict:!0,parent:d,index:m,originalValue:l[m]});h[m]=(T,A)=>u.validate(g,S,A)}hn({path:s,value:d,errors:o,endEarly:f,tests:h},r)})}clone(t){const n=super.clone(t);return n.innerType=this.innerType,n}concat(t){let n=super.concat(t);return n.innerType=this.innerType,t.innerType&&(n.innerType=n.innerType?n.innerType.concat(t.innerType):t.innerType),n}of(t){let n=this.clone();if(!Dn(t))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+bt(t));return n.innerType=t,n}length(t,n=on.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},test(r){return ve(r)||r.length===this.resolve(t)}})}min(t,n){return n=n||on.min,this.test({message:n,name:"min",exclusive:!0,params:{min:t},test(r){return ve(r)||r.length>=this.resolve(t)}})}max(t,n){return n=n||on.max,this.test({message:n,name:"max",exclusive:!0,params:{max:t},test(r){return ve(r)||r.length<=this.resolve(t)}})}ensure(){return this.default(()=>[]).transform((t,n)=>this._typeCheck(t)?t:n==null?[]:[].concat(n))}compact(t){let n=t?(r,i,a)=>!t(r,i,a):r=>!!r;return this.transform(r=>r!=null?r.filter(n):r)}describe(){let t=super.describe();return this.innerType&&(t.innerType=this.innerType.describe()),t}nullable(t=!0){return super.nullable(t)}defined(){return super.defined()}required(t){return super.required(t)}}ja.prototype=Ha.prototype;function ap(e){Object.keys(e).forEach(t=>{Object.keys(e[t]).forEach(n=>{Tf[t][n]=e[t][n]})})}function ot(e,t,n){if(!e||!Dn(e.prototype))throw new TypeError("You must provide a yup schema constructor function");if(typeof t!="string")throw new TypeError("A Method name must be provided");if(typeof n!="function")throw new TypeError("Method function must be provided");e.prototype[t]=n}var sp={exports:{}};/*!
5
+ `+(o!==a?`result of cast: ${o}`:""))}return i}_cast(t,n){let r=t===void 0?t:this.transforms.reduce((i,a)=>a.call(this,i,t,this),t);return r===void 0&&(r=this.getDefault()),r}_validate(t,n={},r){let{sync:i,path:a,from:o=[],originalValue:s=t,strict:u=this.spec.strict,abortEarly:f=this.spec.abortEarly}=n,c=t;u||(c=this._cast(c,Re({assert:!1},n)));let l={value:c,path:a,options:n,originalValue:s,schema:this,label:this.spec.label,sync:i,from:o},p=[];this._typeError&&p.push(this._typeError),this._whitelistError&&p.push(this._whitelistError),this._blacklistError&&p.push(this._blacklistError),mn({args:l,value:c,path:a,tests:p,endEarly:f},d=>{if(d)return void r(d,c);mn({tests:this.tests,args:l,path:a,sync:i,value:c,endEarly:f},r)})}validate(t,n,r){let i=this.resolve(Re({},n,{value:t}));return typeof r=="function"?i._validate(t,n,r):new Promise((a,o)=>i._validate(t,n,(s,u)=>{s?o(s):a(u)}))}validateSync(t,n){let r=this.resolve(Re({},n,{value:t})),i;return r._validate(t,Re({},n,{sync:!0}),(a,o)=>{if(a)throw a;i=o}),i}isValid(t,n){return this.validate(t,n).then(()=>!0,r=>{if(me.isError(r))return!1;throw r})}isValidSync(t,n){try{return this.validateSync(t,n),!0}catch(r){if(me.isError(r))return!1;throw r}}_getDefault(){let t=this.spec.default;return t==null?t:typeof t=="function"?t.call(this):kr(t)}getDefault(t){return this.resolve(t||{})._getDefault()}default(t){return arguments.length===0?this._getDefault():this.clone({default:t})}strict(t=!0){var n=this.clone();return n.spec.strict=t,n}_isPresent(t){return t!=null}defined(t=Ye.defined){return this.test({message:t,name:"defined",exclusive:!0,test(n){return n!==void 0}})}required(t=Ye.required){return this.clone({presence:"required"}).withMutation(n=>n.test({message:t,name:"required",exclusive:!0,test(r){return this.schema._isPresent(r)}}))}notRequired(){var t=this.clone({presence:"optional"});return t.tests=t.tests.filter(n=>n.OPTIONS.name!=="required"),t}nullable(t=!0){var n=this.clone({nullable:t!==!1});return n}transform(t){var n=this.clone();return n.transforms.push(t),n}test(...t){let n;if(t.length===1?typeof t[0]=="function"?n={test:t[0]}:n=t[0]:t.length===2?n={name:t[0],test:t[1]}:n={name:t[0],message:t[1],test:t[2]},n.message===void 0&&(n.message=Ye.default),typeof n.test!="function")throw new TypeError("`test` is a required parameters");let r=this.clone(),i=Jt(n),a=n.exclusive||n.name&&r.exclusiveTests[n.name]===!0;if(n.exclusive&&!n.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return n.name&&(r.exclusiveTests[n.name]=!!n.exclusive),r.tests=r.tests.filter(o=>!(o.OPTIONS.name===n.name&&(a||o.OPTIONS.test===i.OPTIONS.test))),r.tests.push(i),r}when(t,n){!Array.isArray(t)&&typeof t!="string"&&(n=t,t=".");let r=this.clone(),i=Ia(t).map(a=>new tt(a));return i.forEach(a=>{a.isSibling&&r.deps.push(a.key)}),r.conditions.push(new Rf(i,n)),r}typeError(t){var n=this.clone();return n._typeError=Jt({message:t,name:"typeError",test(r){return r!==void 0&&!this.schema.isType(r)?this.createError({params:{type:this.schema._type}}):!0}}),n}oneOf(t,n=Ye.oneOf){var r=this.clone();return t.forEach(i=>{r._whitelist.add(i),r._blacklist.delete(i)}),r._whitelistError=Jt({message:n,name:"oneOf",test(i){if(i===void 0)return!0;let a=this.schema._whitelist;return a.has(i,this.resolve)?!0:this.createError({params:{values:a.toArray().join(", ")}})}}),r}notOneOf(t,n=Ye.notOneOf){var r=this.clone();return t.forEach(i=>{r._blacklist.add(i),r._whitelist.delete(i)}),r._blacklistError=Jt({message:n,name:"notOneOf",test(i){let a=this.schema._blacklist;return a.has(i,this.resolve)?this.createError({params:{values:a.toArray().join(", ")}}):!0}}),r}strip(t=!0){let n=this.clone();return n.spec.strip=t,n}describe(){const t=this.clone(),{label:n,meta:r}=t.spec;return{meta:r,label:n,type:t.type,oneOf:t._whitelist.describe(),notOneOf:t._blacklist.describe(),tests:t.tests.map(a=>({name:a.OPTIONS.name,params:a.OPTIONS.params})).filter((a,o,s)=>s.findIndex(u=>u.name===a.name)===o)}}}ye.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])ye.prototype[`${e}At`]=function(t,n,r={}){const{parent:i,parentPath:a,schema:o}=Gf(this,t,n,r.context);return o[e](i&&i[a],Re({},r,{parent:i,path:t}))};for(const e of["equals","is"])ye.prototype[e]=ye.prototype.oneOf;for(const e of["not","nope"])ye.prototype[e]=ye.prototype.notOneOf;ye.prototype.optional=ye.prototype.notRequired;const Na=ye;function Hn(){return new Na}Hn.prototype=Na.prototype;const ve=(e=>e==null);let qf=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i,Kf=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,Wf=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,zf=e=>ve(e)||e===e.trim(),Yf={}.toString();function Jr(){return new Pa}class Pa extends ye{constructor(){super({type:"string"}),this.withMutation(()=>{this.transform(function(t){if(this.isType(t)||Array.isArray(t))return t;const n=t!=null&&t.toString?t.toString():t;return n===Yf?t:n})})}_typeCheck(t){return t instanceof String&&(t=t.valueOf()),typeof t=="string"}_isPresent(t){return super._isPresent(t)&&!!t.length}length(t,n=Ie.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},test(r){return ve(r)||r.length===this.resolve(t)}})}min(t,n=Ie.min){return this.test({message:n,name:"min",exclusive:!0,params:{min:t},test(r){return ve(r)||r.length>=this.resolve(t)}})}max(t,n=Ie.max){return this.test({name:"max",exclusive:!0,message:n,params:{max:t},test(r){return ve(r)||r.length<=this.resolve(t)}})}matches(t,n){let r=!1,i,a;return n&&(typeof n=="object"?{excludeEmptyString:r=!1,message:i,name:a}=n:i=n),this.test({name:a||"matches",message:i||Ie.matches,params:{regex:t},test:o=>ve(o)||o===""&&r||o.search(t)!==-1})}email(t=Ie.email){return this.matches(qf,{name:"email",message:t,excludeEmptyString:!0})}url(t=Ie.url){return this.matches(Kf,{name:"url",message:t,excludeEmptyString:!0})}uuid(t=Ie.uuid){return this.matches(Wf,{name:"uuid",message:t,excludeEmptyString:!1})}ensure(){return this.default("").transform(t=>t===null?"":t)}trim(t=Ie.trim){return this.transform(n=>n!=null?n.trim():n).test({message:t,name:"trim",test:zf})}lowercase(t=Ie.lowercase){return this.transform(n=>ve(n)?n:n.toLowerCase()).test({message:t,name:"string_case",exclusive:!0,test:n=>ve(n)||n===n.toLowerCase()})}uppercase(t=Ie.uppercase){return this.transform(n=>ve(n)?n:n.toUpperCase()).test({message:t,name:"string_case",exclusive:!0,test:n=>ve(n)||n===n.toUpperCase()})}}Jr.prototype=Pa.prototype;var Qf=/^(\d{4}|[+\-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;function Vf(e){var t=[1,4,5,6,7,10,11],n=0,r,i;if(i=Qf.exec(e)){for(var a=0,o;o=t[a];++a)i[o]=+i[o]||0;i[2]=(+i[2]||1)-1,i[3]=+i[3]||1,i[7]=i[7]?String(i[7]).substr(0,3):0,(i[8]===void 0||i[8]==="")&&(i[9]===void 0||i[9]==="")?r=+new Date(i[1],i[2],i[3],i[4],i[5],i[6],i[7]):(i[8]!=="Z"&&i[9]!==void 0&&(n=i[10]*60+i[11],i[9]==="+"&&(n=0-n)),r=Date.UTC(i[1],i[2],i[3],i[4],i[5]+n,i[6],i[7]))}else r=Date.parse?Date.parse(e):NaN;return r}let La=new Date(""),Xf=e=>Object.prototype.toString.call(e)==="[object Date]";class Zf extends ye{constructor(){super({type:"date"}),this.withMutation(()=>{this.transform(function(t){return this.isType(t)?t:(t=Vf(t),isNaN(t)?La:new Date(t))})})}_typeCheck(t){return Xf(t)&&!isNaN(t.getTime())}prepareParam(t,n){let r;if(tt.isRef(t))r=t;else{let i=this.cast(t);if(!this._typeCheck(i))throw new TypeError(`\`${n}\` must be a Date or a value that can be \`cast()\` to a Date`);r=i}return r}min(t,n=Dr.min){let r=this.prepareParam(t,"min");return this.test({message:n,name:"min",exclusive:!0,params:{min:t},test(i){return ve(i)||i>=this.resolve(r)}})}max(t,n=Dr.max){var r=this.prepareParam(t,"max");return this.test({message:n,name:"max",exclusive:!0,params:{max:t},test(i){return ve(i)||i<=this.resolve(r)}})}}Zf.INVALID_DATE=La;var ei={exports:{}};ei.exports=function(e){return ka(Jf(e),e)};ei.exports.array=ka;function ka(e,t){var n=e.length,r=new Array(n),i={},a=n,o=ep(t),s=tp(e);for(t.forEach(function(f){if(!s.has(f[0])||!s.has(f[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});a--;)i[a]||u(e[a],a,new Set);return r;function u(f,c,l){if(l.has(f)){var p;try{p=", node was:"+JSON.stringify(f)}catch{p=""}throw new Error("Cyclic dependency"+p)}if(!s.has(f))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(f));if(!i[c]){i[c]=!0;var d=o.get(f)||new Set;if(d=Array.from(d),c=d.length){l.add(f);do{var h=d[--c];u(h,s.get(h),l)}while(c);l.delete(f)}r[--n]=f}}}function Jf(e){for(var t=new Set,n=0,r=e.length;n<r;n++){var i=e[n];t.add(i[0]),t.add(i[1])}return Array.from(t)}function ep(e){for(var t=new Map,n=0,r=e.length;n<r;n++){var i=e[n];t.has(i[0])||t.set(i[0],new Set),t.has(i[1])||t.set(i[1],new Set),t.get(i[0]).add(i[1])}return t}function tp(e){for(var t=new Map,n=0,r=e.length;n<r;n++)t.set(e[n],n);return t}var np=ei.exports;const rp=Fa(np);function ip(e,t=[]){let n=[],r=[];function i(a,o){var s=jn.split(a)[0];~r.indexOf(s)||r.push(s),~t.indexOf(`${o}-${s}`)||n.push([o,s])}for(const a in e)if(dn.default(e,a)){let o=e[a];~r.indexOf(a)||r.push(a),tt.isRef(o)&&o.isSibling?i(o.path,a):Mn(o)&&"deps"in o&&o.deps.forEach(s=>i(s,a))}return rp.array(r,n).reverse()}function qi(e,t){let n=1/0;return e.some((r,i)=>{var a;if(((a=t.path)==null?void 0:a.indexOf(r))!==-1)return n=i,!0}),n}function Da(e){return(t,n)=>qi(e,t)-qi(e,n)}function mt(){return mt=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},mt.apply(this,arguments)}let Ki=e=>Object.prototype.toString.call(e)==="[object Object]";function op(e,t){let n=Object.keys(e.fields);return Object.keys(t).filter(r=>n.indexOf(r)===-1)}const ap=Da([]);class Ma extends ye{constructor(t){super({type:"object"}),this.fields=Object.create(null),this._sortErrors=ap,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{this.transform(function(r){if(typeof r=="string")try{r=JSON.parse(r)}catch{r=null}return this.isType(r)?r:null}),t&&this.shape(t)})}_typeCheck(t){return Ki(t)||typeof t=="function"}_cast(t,n={}){var r;let i=super._cast(t,n);if(i===void 0)return this.getDefault();if(!this._typeCheck(i))return i;let a=this.fields,o=(r=n.stripUnknown)!=null?r:this.spec.noUnknown,s=this._nodes.concat(Object.keys(i).filter(l=>this._nodes.indexOf(l)===-1)),u={},f=mt({},n,{parent:u,__validating:n.__validating||!1}),c=!1;for(const l of s){let p=a[l],d=dn.default(i,l);if(p){let h,m=i[l];f.path=(n.path?`${n.path}.`:"")+l,p=p.resolve({value:m,context:n.context,parent:u});let g="spec"in p?p.spec:void 0,w=g?.strict;if(g?.strip){c=c||l in i;continue}h=!n.__validating||!w?p.cast(i[l],f):i[l],h!==void 0&&(u[l]=h)}else d&&!o&&(u[l]=i[l]);u[l]!==i[l]&&(c=!0)}return c?u:i}_validate(t,n={},r){let i=[],{sync:a,from:o=[],originalValue:s=t,abortEarly:u=this.spec.abortEarly,recursive:f=this.spec.recursive}=n;o=[{schema:this,value:s},...o],n.__validating=!0,n.originalValue=s,n.from=o,super._validate(t,n,(c,l)=>{if(c){if(!me.isError(c)||u)return void r(c,l);i.push(c)}if(!f||!Ki(l)){r(i[0]||null,l);return}s=s||l;let p=this._nodes.map(d=>(h,m)=>{let g=d.indexOf(".")===-1?(n.path?`${n.path}.`:"")+d:`${n.path||""}["${d}"]`,w=this.fields[d];if(w&&"validate"in w){w.validate(l[d],mt({},n,{path:g,from:o,strict:!0,parent:l,originalValue:s[d]}),m);return}m(null)});mn({tests:p,value:l,errors:i,endEarly:u,sort:this._sortErrors,path:n.path},r)})}clone(t){const n=super.clone(t);return n.fields=mt({},this.fields),n._nodes=this._nodes,n._excludedEdges=this._excludedEdges,n._sortErrors=this._sortErrors,n}concat(t){let n=super.concat(t),r=n.fields;for(let[i,a]of Object.entries(this.fields)){const o=r[i];o===void 0?r[i]=a:o instanceof ye&&a instanceof ye&&(r[i]=a.concat(o))}return n.withMutation(()=>n.shape(r))}getDefaultFromShape(){let t={};return this._nodes.forEach(n=>{const r=this.fields[n];t[n]="default"in r?r.getDefault():void 0}),t}_getDefault(){if("default"in this.spec)return super._getDefault();if(this._nodes.length)return this.getDefaultFromShape()}shape(t,n=[]){let r=this.clone(),i=Object.assign(r.fields,t);if(r.fields=i,r._sortErrors=Da(Object.keys(i)),n.length){Array.isArray(n[0])||(n=[n]);let a=n.map(([o,s])=>`${o}-${s}`);r._excludedEdges=r._excludedEdges.concat(a)}return r._nodes=ip(i,r._excludedEdges),r}pick(t){const n={};for(const r of t)this.fields[r]&&(n[r]=this.fields[r]);return this.clone().withMutation(r=>(r.fields={},r.shape(n)))}omit(t){const n=this.clone(),r=n.fields;n.fields={};for(const i of t)delete r[i];return n.withMutation(()=>n.shape(r))}from(t,n,r){let i=jn.getter(t,!0);return this.transform(a=>{if(a==null)return a;let o=a;return dn.default(a,t)&&(o=mt({},a),r||delete o[t],o[n]=i(a)),o})}noUnknown(t=!0,n=Mr.noUnknown){typeof t=="string"&&(n=t,t=!0);let r=this.test({name:"noUnknown",exclusive:!0,message:n,test(i){if(i==null)return!0;const a=op(this.schema,i);return!t||a.length===0||this.createError({params:{unknown:a.join(", ")}})}});return r.spec.noUnknown=t,r}unknown(t=!0,n=Mr.noUnknown){return this.noUnknown(!t,n)}transformKeys(t){return this.transform(n=>n&&sc.default(n,(r,i)=>t(i)))}camelCase(){return this.transformKeys(ac.default)}snakeCase(){return this.transformKeys(ki.default)}constantCase(){return this.transformKeys(t=>ki.default(t).toUpperCase())}describe(){let t=super.describe();return t.fields=ua.default(this.fields,n=>n.describe()),t}}function ja(e){return new Ma(e)}ja.prototype=Ma.prototype;function vn(){return vn=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},vn.apply(this,arguments)}function Ha(e){return new Ba(e)}class Ba extends ye{constructor(t){super({type:"array"}),this.innerType=t,this.withMutation(()=>{this.transform(function(n){if(typeof n=="string")try{n=JSON.parse(n)}catch{n=null}return this.isType(n)?n:null})})}_typeCheck(t){return Array.isArray(t)}get _subType(){return this.innerType}_cast(t,n){const r=super._cast(t,n);if(!this._typeCheck(r)||!this.innerType)return r;let i=!1;const a=r.map((o,s)=>{const u=this.innerType.cast(o,vn({},n,{path:`${n.path||""}[${s}]`}));return u!==o&&(i=!0),u});return i?a:r}_validate(t,n={},r){var i,a;let o=[];n.sync;let s=n.path,u=this.innerType,f=(i=n.abortEarly)!=null?i:this.spec.abortEarly,c=(a=n.recursive)!=null?a:this.spec.recursive,l=n.originalValue!=null?n.originalValue:t;super._validate(t,n,(p,d)=>{if(p){if(!me.isError(p)||f)return void r(p,d);o.push(p)}if(!c||!u||!this._typeCheck(d)){r(o[0]||null,d);return}l=l||d;let h=new Array(d.length);for(let m=0;m<d.length;m++){let g=d[m],w=`${n.path||""}[${m}]`,S=vn({},n,{path:w,strict:!0,parent:d,index:m,originalValue:l[m]});h[m]=(x,R)=>u.validate(g,S,R)}mn({path:s,value:d,errors:o,endEarly:f,tests:h},r)})}clone(t){const n=super.clone(t);return n.innerType=this.innerType,n}concat(t){let n=super.concat(t);return n.innerType=this.innerType,t.innerType&&(n.innerType=n.innerType?n.innerType.concat(t.innerType):t.innerType),n}of(t){let n=this.clone();if(!Mn(t))throw new TypeError("`array.of()` sub-schema must be a valid yup schema not: "+bt(t));return n.innerType=t,n}length(t,n=an.length){return this.test({message:n,name:"length",exclusive:!0,params:{length:t},test(r){return ve(r)||r.length===this.resolve(t)}})}min(t,n){return n=n||an.min,this.test({message:n,name:"min",exclusive:!0,params:{min:t},test(r){return ve(r)||r.length>=this.resolve(t)}})}max(t,n){return n=n||an.max,this.test({message:n,name:"max",exclusive:!0,params:{max:t},test(r){return ve(r)||r.length<=this.resolve(t)}})}ensure(){return this.default(()=>[]).transform((t,n)=>this._typeCheck(t)?t:n==null?[]:[].concat(n))}compact(t){let n=t?(r,i,a)=>!t(r,i,a):r=>!!r;return this.transform(r=>r!=null?r.filter(n):r)}describe(){let t=super.describe();return this.innerType&&(t.innerType=this.innerType.describe()),t}nullable(t=!0){return super.nullable(t)}defined(){return super.defined()}required(t){return super.required(t)}}Ha.prototype=Ba.prototype;function sp(e){Object.keys(e).forEach(t=>{Object.keys(e[t]).forEach(n=>{Cf[t][n]=e[t][n]})})}function ot(e,t,n){if(!e||!Mn(e.prototype))throw new TypeError("You must provide a yup schema constructor function");if(typeof t!="string")throw new TypeError("A Method name must be provided");if(typeof n!="function")throw new TypeError("Method function must be provided");e.prototype[t]=n}var up={exports:{}};/*!
6
6
  * depd
7
7
  * Copyright(c) 2015 Douglas Christopher Wilson
8
8
  * MIT Licensed
9
- */var up=cp;function cp(e){if(!e)throw new TypeError("argument namespace is required");function t(n){}return t._file=void 0,t._ignored=!0,t._namespace=e,t._traced=!1,t._warned=Object.create(null),t.function=lp,t.property=fp,t}function lp(e,t){if(typeof e!="function")throw new TypeError("argument fn must be a function");return e}function fp(e,t,n){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("argument obj must be object");var r=Object.getOwnPropertyDescriptor(e,t);if(!r)throw new TypeError("must call property on owner object");if(!r.configurable)throw new TypeError("property must be configurable")}var pp=Object.setPrototypeOf||({__proto__:[]}instanceof Array?dp:hp);function dp(e,t){return e.__proto__=t,e}function hp(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(e,n)||(e[n]=t[n]);return e}const mp={100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a Teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"};/*!
9
+ */var cp=lp;function lp(e){if(!e)throw new TypeError("argument namespace is required");function t(n){}return t._file=void 0,t._ignored=!0,t._namespace=e,t._traced=!1,t._warned=Object.create(null),t.function=fp,t.property=pp,t}function fp(e,t){if(typeof e!="function")throw new TypeError("argument fn must be a function");return e}function pp(e,t,n){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("argument obj must be object");var r=Object.getOwnPropertyDescriptor(e,t);if(!r)throw new TypeError("must call property on owner object");if(!r.configurable)throw new TypeError("property must be configurable")}var dp=Object.setPrototypeOf||({__proto__:[]}instanceof Array?hp:mp);function hp(e,t){return e.__proto__=t,e}function mp(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(e,n)||(e[n]=t[n]);return e}const gp={100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a Teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"};/*!
10
10
  * statuses
11
11
  * Copyright(c) 2014 Jonathan Ong
12
12
  * Copyright(c) 2016 Douglas Christopher Wilson
13
13
  * MIT Licensed
14
- */var ei=mp,gp=Oe;Oe.message=ei;Oe.code=yp(ei);Oe.codes=vp(ei);Oe.redirect={300:!0,301:!0,302:!0,303:!0,305:!0,307:!0,308:!0};Oe.empty={204:!0,205:!0,304:!0};Oe.retry={502:!0,503:!0,504:!0};function yp(e){var t={};return Object.keys(e).forEach(function(r){var i=e[r],a=Number(r);t[i.toLowerCase()]=a}),t}function vp(e){return Object.keys(e).map(function(n){return Number(n)})}function wp(e){var t=e.toLowerCase();if(!Object.prototype.hasOwnProperty.call(Oe.code,t))throw new Error('invalid status message: "'+e+'"');return Oe.code[t]}function Ki(e){if(!Object.prototype.hasOwnProperty.call(Oe.message,e))throw new Error("invalid status code: "+e);return Oe.message[e]}function Oe(e){if(typeof e=="number")return Ki(e);if(typeof e!="string")throw new TypeError("code must be a number or string");var t=parseInt(e,10);return isNaN(t)?wp(e):Ki(t)}var Hr={exports:{}};typeof Object.create=="function"?Hr.exports=function(t,n){n&&(t.super_=n,t.prototype=Object.create(n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:Hr.exports=function(t,n){if(n){t.super_=n;var r=function(){};r.prototype=n.prototype,t.prototype=new r,t.prototype.constructor=t}};var Ep=Hr.exports;/*!
14
+ */var ti=gp,yp=Oe;Oe.message=ti;Oe.code=vp(ti);Oe.codes=wp(ti);Oe.redirect={300:!0,301:!0,302:!0,303:!0,305:!0,307:!0,308:!0};Oe.empty={204:!0,205:!0,304:!0};Oe.retry={502:!0,503:!0,504:!0};function vp(e){var t={};return Object.keys(e).forEach(function(r){var i=e[r],a=Number(r);t[i.toLowerCase()]=a}),t}function wp(e){return Object.keys(e).map(function(n){return Number(n)})}function Ep(e){var t=e.toLowerCase();if(!Object.prototype.hasOwnProperty.call(Oe.code,t))throw new Error('invalid status message: "'+e+'"');return Oe.code[t]}function Wi(e){if(!Object.prototype.hasOwnProperty.call(Oe.message,e))throw new Error("invalid status code: "+e);return Oe.message[e]}function Oe(e){if(typeof e=="number")return Wi(e);if(typeof e!="string")throw new TypeError("code must be a number or string");var t=parseInt(e,10);return isNaN(t)?Ep(e):Wi(t)}var Br={exports:{}};typeof Object.create=="function"?Br.exports=function(t,n){n&&(t.super_=n,t.prototype=Object.create(n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:Br.exports=function(t,n){if(n){t.super_=n;var r=function(){};r.prototype=n.prototype,t.prototype=new r,t.prototype.constructor=t}};var bp=Br.exports;/*!
15
15
  * toidentifier
16
16
  * Copyright(c) 2016 Douglas Christopher Wilson
17
17
  * MIT Licensed
18
- */var bp=Sp;function Sp(e){return e.split(" ").map(function(t){return t.slice(0,1).toUpperCase()+t.slice(1)}).join("").replace(/[^ _0-9a-z]/gi,"")}/*!
18
+ */var Sp=xp;function xp(e){return e.split(" ").map(function(t){return t.slice(0,1).toUpperCase()+t.slice(1)}).join("").replace(/[^ _0-9a-z]/gi,"")}/*!
19
19
  * http-errors
20
20
  * Copyright(c) 2014 Jonathan Ong
21
21
  * Copyright(c) 2016 Douglas Christopher Wilson
22
22
  * MIT Licensed
23
- */(function(e){up("http-errors");var t=pp,n=gp,r=Ep,i=bp;e.exports=o,e.exports.HttpError=s(),e.exports.isHttpError=f(e.exports.HttpError),p(e.exports,n.codes,e.exports.HttpError);function a(h){return+(String(h).charAt(0)+"00")}function o(){for(var h,m,g=500,E={},S=0;S<arguments.length;S++){var T=arguments[S],A=typeof T;if(A==="object"&&T instanceof Error)h=T,g=h.status||h.statusCode||g;else if(A==="number"&&S===0)g=T;else if(A==="string")m=T;else if(A==="object")E=T;else throw new TypeError("argument #"+(S+1)+" unsupported type "+A)}(typeof g!="number"||!n.message[g]&&(g<400||g>=600))&&(g=500);var R=o[g]||o[a(g)];h||(h=R?new R(m):new Error(m||n.message[g]),Error.captureStackTrace(h,o)),(!R||!(h instanceof R)||h.status!==g)&&(h.expose=g<500,h.status=h.statusCode=g);for(var F in E)F!=="status"&&F!=="statusCode"&&(h[F]=E[F]);return h}function s(){function h(){throw new TypeError("cannot construct abstract class")}return r(h,Error),h}function u(h,m,g){var E=d(m);function S(T){var A=T??n.message[g],R=new Error(A);return Error.captureStackTrace(R,S),t(R,S.prototype),Object.defineProperty(R,"message",{enumerable:!0,configurable:!0,value:A,writable:!0}),Object.defineProperty(R,"name",{enumerable:!1,configurable:!0,value:E,writable:!0}),R}return r(S,h),l(S,E),S.prototype.status=g,S.prototype.statusCode=g,S.prototype.expose=!0,S}function f(h){return function(g){return!g||typeof g!="object"?!1:g instanceof h?!0:g instanceof Error&&typeof g.expose=="boolean"&&typeof g.statusCode=="number"&&g.status===g.statusCode}}function c(h,m,g){var E=d(m);function S(T){var A=T??n.message[g],R=new Error(A);return Error.captureStackTrace(R,S),t(R,S.prototype),Object.defineProperty(R,"message",{enumerable:!0,configurable:!0,value:A,writable:!0}),Object.defineProperty(R,"name",{enumerable:!1,configurable:!0,value:E,writable:!0}),R}return r(S,h),l(S,E),S.prototype.status=g,S.prototype.statusCode=g,S.prototype.expose=!1,S}function l(h,m){var g=Object.getOwnPropertyDescriptor(h,"name");g&&g.configurable&&(g.value=m,Object.defineProperty(h,"name",g))}function p(h,m,g){m.forEach(function(S){var T,A=i(n.message[S]);switch(a(S)){case 400:T=u(g,A,S);break;case 500:T=c(g,A,S);break}T&&(h[S]=T,h[A]=T)})}function d(h){return h.substr(-5)!=="Error"?h+"Error":h}})(sp);class xp extends Error{constructor(t="An application error occurred",n={}){super(),this.name="ApplicationError",this.message=t,this.details=n}}class It extends xp{constructor(t="Entity not found",n){super(t,n),this.name="NotFoundError",this.message=t}}const _p=["$and","$or"],Ap=["$not","$in","$notIn","$eq","$eqi","$ne","$nei","$gt","$gte","$lt","$lte","$null","$notNull","$between","$startsWith","$endsWith","$startsWithi","$endsWithi","$contains","$notContains","$containsi","$notContainsi","$jsonSupersetOf"],Tp=["$not","$in","$notIn","$eq","$ne","$gt","$gte","$lt","$lte","$between"],Cp=["$in","$notIn","$between"],vn={where:Ap,cast:Tp,group:_p,array:Cp},Rp=Object.fromEntries(Object.entries(vn).map(([e,t])=>[e,t.map(n=>n.toLowerCase())])),Fp=(e,t)=>e in t,$p=(e,t,n=!1)=>n?Rp[e]?.includes(t.toLowerCase())??!1:Fp(e,vn)?vn[e]?.includes(t)??!1:!1,Ip=(e,t=!1)=>Object.keys(vn).some(n=>$p(n,e,t));var Op=(e,t=1,n)=>{if(n={indent:" ",includeEmptyLines:!1,...n},typeof e!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if(typeof t!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(typeof n.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof n.indent}\``);if(t===0)return e;const r=n.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return e.replace(r,n.indent.repeat(t))};const Wi=Ln.default,zi=/\s+at.*(?:\(|\s)(.*)\)?/,Np=/^(?:(?:(?:node|(?:internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)\.js:\d+:\d+)|native)/,Pp=typeof Wi.homedir>"u"?"":Wi.homedir();var Lp=(e,t)=>(t=Object.assign({pretty:!1},t),e.replace(/\\/g,"/").split(`
24
- `).filter(n=>{const r=n.match(zi);if(r===null||!r[1])return!0;const i=r[1];return i.includes(".app/Contents/Resources/electron.asar")||i.includes(".app/Contents/Resources/default_app.asar")?!1:!Np.test(i)}).filter(n=>n.trim()!=="").map(n=>t.pretty?n.replace(zi,(r,i)=>r.replace(i,i.replace(Pp,"~"))):n).join(`
25
- `));const kp=Op,Dp=Lp,Mp=e=>e.replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g,"");let jp=class extends Error{constructor(t){if(!Array.isArray(t))throw new TypeError(`Expected input to be an Array, got ${typeof t}`);t=[...t].map(r=>r instanceof Error?r:r!==null&&typeof r=="object"?Object.assign(new Error(r.message),r):new Error(r));let n=t.map(r=>typeof r.stack=="string"?Mp(Dp(r.stack)):String(r)).join(`
23
+ */(function(e){cp("http-errors");var t=dp,n=yp,r=bp,i=Sp;e.exports=o,e.exports.HttpError=s(),e.exports.isHttpError=f(e.exports.HttpError),p(e.exports,n.codes,e.exports.HttpError);function a(h){return+(String(h).charAt(0)+"00")}function o(){for(var h,m,g=500,w={},S=0;S<arguments.length;S++){var x=arguments[S],R=typeof x;if(R==="object"&&x instanceof Error)h=x,g=h.status||h.statusCode||g;else if(R==="number"&&S===0)g=x;else if(R==="string")m=x;else if(R==="object")w=x;else throw new TypeError("argument #"+(S+1)+" unsupported type "+R)}(typeof g!="number"||!n.message[g]&&(g<400||g>=600))&&(g=500);var T=o[g]||o[a(g)];h||(h=T?new T(m):new Error(m||n.message[g]),Error.captureStackTrace(h,o)),(!T||!(h instanceof T)||h.status!==g)&&(h.expose=g<500,h.status=h.statusCode=g);for(var O in w)O!=="status"&&O!=="statusCode"&&(h[O]=w[O]);return h}function s(){function h(){throw new TypeError("cannot construct abstract class")}return r(h,Error),h}function u(h,m,g){var w=d(m);function S(x){var R=x??n.message[g],T=new Error(R);return Error.captureStackTrace(T,S),t(T,S.prototype),Object.defineProperty(T,"message",{enumerable:!0,configurable:!0,value:R,writable:!0}),Object.defineProperty(T,"name",{enumerable:!1,configurable:!0,value:w,writable:!0}),T}return r(S,h),l(S,w),S.prototype.status=g,S.prototype.statusCode=g,S.prototype.expose=!0,S}function f(h){return function(g){return!g||typeof g!="object"?!1:g instanceof h?!0:g instanceof Error&&typeof g.expose=="boolean"&&typeof g.statusCode=="number"&&g.status===g.statusCode}}function c(h,m,g){var w=d(m);function S(x){var R=x??n.message[g],T=new Error(R);return Error.captureStackTrace(T,S),t(T,S.prototype),Object.defineProperty(T,"message",{enumerable:!0,configurable:!0,value:R,writable:!0}),Object.defineProperty(T,"name",{enumerable:!1,configurable:!0,value:w,writable:!0}),T}return r(S,h),l(S,w),S.prototype.status=g,S.prototype.statusCode=g,S.prototype.expose=!1,S}function l(h,m){var g=Object.getOwnPropertyDescriptor(h,"name");g&&g.configurable&&(g.value=m,Object.defineProperty(h,"name",g))}function p(h,m,g){m.forEach(function(S){var x,R=i(n.message[S]);switch(a(S)){case 400:x=u(g,R,S);break;case 500:x=c(g,R,S);break}x&&(h[S]=x,h[R]=x)})}function d(h){return h.substr(-5)!=="Error"?h+"Error":h}})(up);class _p extends Error{constructor(t="An application error occurred",n={}){super(),this.name="ApplicationError",this.message=t,this.details=n}}class It extends _p{constructor(t="Entity not found",n){super(t,n),this.name="NotFoundError",this.message=t}}const Ap=["$and","$or"],Tp=["$not","$in","$notIn","$eq","$eqi","$ne","$nei","$gt","$gte","$lt","$lte","$null","$notNull","$between","$startsWith","$endsWith","$startsWithi","$endsWithi","$contains","$notContains","$containsi","$notContainsi","$jsonSupersetOf"],Cp=["$not","$in","$notIn","$eq","$ne","$gt","$gte","$lt","$lte","$between"],Rp=["$in","$notIn","$between"],wn={where:Tp,cast:Cp,group:Ap,array:Rp},Fp=Object.fromEntries(Object.entries(wn).map(([e,t])=>[e,t.map(n=>n.toLowerCase())])),$p=(e,t)=>e in t,Ip=(e,t,n=!1)=>n?Fp[e]?.includes(t.toLowerCase())??!1:$p(e,wn)?wn[e]?.includes(t)??!1:!1,Op=(e,t=!1)=>Object.keys(wn).some(n=>Ip(n,e,t));var Np=(e,t=1,n)=>{if(n={indent:" ",includeEmptyLines:!1,...n},typeof e!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if(typeof t!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(typeof n.indent!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof n.indent}\``);if(t===0)return e;const r=n.includeEmptyLines?/^/gm:/^(?!\s*$)/gm;return e.replace(r,n.indent.repeat(t))};const zi=kn.default,Yi=/\s+at.*(?:\(|\s)(.*)\)?/,Pp=/^(?:(?:(?:node|(?:internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)\.js:\d+:\d+)|native)/,Lp=typeof zi.homedir>"u"?"":zi.homedir();var kp=(e,t)=>(t=Object.assign({pretty:!1},t),e.replace(/\\/g,"/").split(`
24
+ `).filter(n=>{const r=n.match(Yi);if(r===null||!r[1])return!0;const i=r[1];return i.includes(".app/Contents/Resources/electron.asar")||i.includes(".app/Contents/Resources/default_app.asar")?!1:!Pp.test(i)}).filter(n=>n.trim()!=="").map(n=>t.pretty?n.replace(Yi,(r,i)=>r.replace(i,i.replace(Lp,"~"))):n).join(`
25
+ `));const Dp=Np,Mp=kp,jp=e=>e.replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g,"");let Hp=class extends Error{constructor(t){if(!Array.isArray(t))throw new TypeError(`Expected input to be an Array, got ${typeof t}`);t=[...t].map(r=>r instanceof Error?r:r!==null&&typeof r=="object"?Object.assign(new Error(r.message),r):new Error(r));let n=t.map(r=>typeof r.stack=="string"?jp(Mp(r.stack)):String(r)).join(`
26
26
  `);n=`
27
- `+kp(n,4),super(n),this.name="AggregateError",Object.defineProperty(this,"_errors",{value:t})}*[Symbol.iterator](){for(const t of this._errors)yield t}};var Hp=jp;const Bp=Hp;var Up=async(e,t,{concurrency:n=1/0,stopOnError:r=!0}={})=>new Promise((i,a)=>{if(typeof t!="function")throw new TypeError("Mapper function is required");if(!((Number.isSafeInteger(n)||n===1/0)&&n>=1))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${n}\` (${typeof n})`);const o=[],s=[],u=e[Symbol.iterator]();let f=!1,c=!1,l=0,p=0;const d=()=>{if(f)return;const h=u.next(),m=p;if(p++,h.done){c=!0,l===0&&(!r&&s.length!==0?a(new Bp(s)):i(o));return}l++,(async()=>{try{const g=await h.value;o[m]=await t(g,m),l--,d()}catch(g){r?(f=!0,a(g)):(s.push(g),l--,d())}})()};for(let h=0;h<n&&(d(),!c);h++);});const Gp=Ra(Up);function Hn(...e){const[t,...n]=e;return async(...r)=>{let i=await t.apply(t,r);for(let a=0;a<n.length;a+=1)i=await n[a](i);return i}}C.curry(Gp);const Bn=({key:e,attribute:t},{remove:n})=>{t?.type==="password"&&n(e)},Ht=({schema:e,key:t,attribute:n},{remove:r})=>{if(!n)return;(n.private===!0||pf(e,t))&&r(t)},Ba=({key:e,attribute:t},{remove:n})=>{Ca(t)&&n(e)},Ua=({key:e,attribute:t},{remove:n})=>{hf(t)&&n(e)},qp=({schema:e,key:t,value:n},{set:r})=>{if(t===""&&n==="*"){const{attributes:i}=e,a=Object.entries(i).filter(([,o])=>["relation","component","media","dynamiczone"].includes(o.type)).reduce((o,[s])=>({...o,[s]:!0}),{});r("",a)}},Kp={raw:null,attribute:null};var Un=(()=>{const e={parsers:[],interceptors:[],ignore:[],handlers:{attributes:[],common:[]}},t=async(n,r,i)=>{const{path:a=Kp,parent:o,schema:s,getModel:u}=r??{};for(const{predicate:d,handler:h}of e.interceptors)if(d(i))return h(n,r,i,{recurse:t});const f=e.parsers.find(d=>d.predicate(i))?.parser,c=f?.(i);if(!c)return i;let l=c.transform(i);const p=c.keys(l);for(const d of p){const h=s?.attributes?.[d],m={...a};m.raw=C.isNil(a.raw)?d:`${a.raw}.${d}`,C.isNil(h)||(m.attribute=C.isNil(a.attribute)?d:`${a.attribute}.${d}`);const g={key:d,value:c.get(d,l),attribute:h,schema:s,path:m,data:l,getModel:u,parent:o},E={remove(D){l=c.remove(D,l)},set(D,x){l=c.set(D,x,l)},recurse:t};await n(g,C.pick(["remove","set"],E));const S=c.get(d,l),T=()=>({key:d,value:S,attribute:h,schema:s,path:m,data:l,visitor:n,getModel:u,parent:o}),A=T();if(e.ignore.some(D=>D(A)))continue;const F=[...e.handlers.common,...e.handlers.attributes];for await(const D of F){const x=T();await D.predicate(x)&&await D.handler(x,C.pick(["recurse","set"],E))}}return l};return{traverse:t,intercept(n,r){return e.interceptors.push({predicate:n,handler:r}),this},parse(n,r){return e.parsers.push({predicate:n,parser:r}),this},ignore(n){return e.ignore.push(n),this},on(n,r){return e.handlers.common.push({predicate:n,handler:r}),this},onAttribute(n,r){return e.handlers.attributes.push({predicate:n,handler:r}),this},onRelation(n){return this.onAttribute(({attribute:r})=>r?.type==="relation",n)},onMedia(n){return this.onAttribute(({attribute:r})=>r?.type==="media",n)},onComponent(n){return this.onAttribute(({attribute:r})=>r?.type==="component",n)},onDynamicZone(n){return this.onAttribute(({attribute:r})=>r?.type==="dynamiczone",n)}}});const Wp=e=>C.isObject(e),zp=Un().intercept(C.isArray,async(e,t,n,{recurse:r})=>Promise.all(n.map((i,a)=>{const o=t.path?{...t.path,raw:`${t.path.raw}[${a}]`}:t.path;return r(e,{...t,path:o},i)})).then(i=>i.filter(a=>!(C.isObject(a)&&C.isEmpty(a))))).intercept(e=>!C.isObject(e),(e,t,n)=>n).parse(Wp,()=>({transform:C.cloneDeep,remove(e,t){return C.omit(e,t)},set(e,t,n){return{...n,[e]:t}},keys(e){return Object.keys(e)},get(e,t){return t[e]}})).ignore(({value:e})=>C.isNil(e)).on(({attribute:e})=>C.isNil(e),async({key:e,visitor:t,path:n,value:r,schema:i,getModel:a,attribute:o},{set:s,recurse:u})=>{s(e,await u(t,{schema:i,path:n,getModel:a,parent:{key:e,path:n,schema:i,attribute:o}},r))}).onRelation(async({key:e,attribute:t,visitor:n,path:r,value:i,schema:a,getModel:o},{set:s,recurse:u})=>{if(t.relation.toLowerCase().startsWith("morph"))return;const c={key:e,path:r,schema:a,attribute:t},l=t.target,p=o(l),d=await u(n,{schema:p,path:r,getModel:o,parent:c},i);s(e,d)}).onComponent(async({key:e,attribute:t,visitor:n,path:r,schema:i,value:a,getModel:o},{set:s,recurse:u})=>{const f={key:e,path:r,schema:i,attribute:t},c=o(t.component),l=await u(n,{schema:c,path:r,getModel:o,parent:f},a);s(e,l)}).onMedia(async({key:e,visitor:t,path:n,schema:r,attribute:i,value:a,getModel:o},{set:s,recurse:u})=>{const f={key:e,path:n,schema:r,attribute:i},l=o("plugin::upload.file"),p=await u(t,{schema:l,path:n,getModel:o,parent:f},a);s(e,p)});var at=C.curry(zp.traverse);const Yp={asc:"asc",desc:"desc"},Qp=Object.values(Yp),Vp=e=>Qp.includes(e.toLowerCase()),Xp=e=>Array.isArray(e)&&e.every(C.isString),Zp=e=>Array.isArray(e)&&e.every(C.isObject),Jp=e=>C.isString(e)&&e.split(",").length>1,ed=e=>C.isObject(e),td=Un().intercept(Jp,async(e,t,n,{recurse:r})=>Promise.all(n.split(",").map(C.trim).map(i=>r(e,t,i))).then(i=>i.filter(a=>!C.isEmpty(a)).join(","))).intercept(Xp,async(e,t,n,{recurse:r})=>Promise.all(n.map(i=>r(e,t,i))).then(i=>i.filter(a=>!C.isEmpty(a)))).intercept(Zp,async(e,t,n,{recurse:r})=>Promise.all(n.map(i=>r(e,t,i))).then(i=>i.filter(a=>!C.isEmpty(a)))).parse(C.isString,()=>{const e=C.pipe(C.split("."),C.map(C.split(":")),C.flatten),t=n=>{if(n.length!==0)return n.reduce((r,i)=>C.isEmpty(i)?r:r===""?i:Vp(i)?`${r}:${i}`:`${r}.${i}`,"")};return{transform:C.trim,remove(n,r){const[i]=e(r);return i===n?void 0:r},set(n,r,i){const[a]=e(i);return a!==n?i:C.isNil(r)?a:`${a}.${r}`},keys(n){const r=C.first(e(n));return r?[r]:[]},get(n,r){const[i,...a]=e(r);return n===i?t(a):void 0}}}).parse(ed,()=>({transform:C.cloneDeep,remove(e,t){const{[e]:n,...r}=t;return r},set(e,t,n){return{...n,[e]:t}},keys(e){return Object.keys(e)},get(e,t){return t[e]}})).onRelation(async({key:e,value:t,attribute:n,visitor:r,path:i,getModel:a,schema:o},{set:s,recurse:u})=>{if(n.relation.toLowerCase().startsWith("morph"))return;const c={key:e,path:i,schema:o,attribute:n},l=n.target,p=a(l),d=await u(r,{schema:p,path:i,getModel:a,parent:c},t);s(e,d)}).onMedia(async({key:e,path:t,schema:n,attribute:r,visitor:i,value:a,getModel:o},{recurse:s,set:u})=>{const f={key:e,path:t,schema:n,attribute:r},l=o("plugin::upload.file"),p=await s(i,{schema:l,path:t,getModel:o,parent:f},a);u(e,p)}).onComponent(async({key:e,value:t,visitor:n,path:r,schema:i,attribute:a,getModel:o},{recurse:s,set:u})=>{const f={key:e,path:r,schema:i,attribute:a},c=o(a.component),l=await s(n,{schema:c,path:r,getModel:o,parent:f},t);u(e,l)});var st=C.curry(td.traverse);const Yi=e=>({key:t,attribute:n})=>!n&&e===t,Ga=e=>e==="*",nd=e=>C.isString(e)&&!Ga(e),rd=e=>C.isArray(e)&&e.every(C.isString),Qi=e=>C.isObject(e),id=Un().intercept(nd,async(e,t,n,{recurse:r})=>{const i=ad([n]),a=await r(e,t,i),[o]=od(a);return o}).intercept(rd,async(e,t,n,{recurse:r})=>(await Promise.all(n.map(a=>r(e,t,a)))).filter(a=>!C.isNil(a))).parse(Ga,()=>({transform:C.identity,get:(e,t)=>t,set:(e,t)=>t,keys:C.constant([""]),remove:C.constant(void 0)})).parse(C.isString,()=>{const e=C.split("."),t=C.join(".");return{transform:C.trim,remove(n,r){const[i]=e(r);return i===n?void 0:r},set(n,r,i){const[a]=e(i);return a!==n?i:C.isNil(r)||C.isEmpty(r)?a:`${a}.${r}`},keys(n){const r=C.first(e(n));return r?[r]:[]},get(n,r){const[i,...a]=e(r);return n===i?t(a):void 0}}}).parse(Qi,()=>({transform:C.cloneDeep,remove(e,t){const{[e]:n,...r}=t;return r},set(e,t,n){return{...n,[e]:t}},keys(e){return Object.keys(e)},get(e,t){return t[e]}})).ignore(({key:e,attribute:t})=>["sort","filters","fields"].includes(e)&&!t).on(Yi("populate"),async({key:e,visitor:t,path:n,value:r,schema:i,getModel:a,attribute:o},{set:s,recurse:u})=>{const c=await u(t,{schema:i,path:n,getModel:a,parent:{key:e,path:n,schema:i,attribute:o}},r);s(e,c)}).on(Yi("on"),async({key:e,visitor:t,path:n,value:r,getModel:i,parent:a},{set:o,recurse:s})=>{const u={};if(Qi(r)){for(const[f,c]of Object.entries(r)){const l=i(f),p={...n,raw:`${n.raw}[${f}]`};u[f]=await s(t,{schema:l,path:p,getModel:i,parent:a},c)}o(e,u)}}).onRelation(async({key:e,value:t,attribute:n,visitor:r,path:i,schema:a,getModel:o},{set:s,recurse:u})=>{if(C.isNil(t))return;const f={key:e,path:i,schema:a,attribute:n};if(Ca(n)){if(!C.isObject(t)||!("on"in t&&C.isObject(t?.on)))return;const d=await u(r,{schema:a,path:i,getModel:o,parent:f},{on:t?.on});s(e,d);return}const c=n.target,l=o(c),p=await u(r,{schema:l,path:i,getModel:o,parent:f},t);s(e,p)}).onMedia(async({key:e,path:t,schema:n,attribute:r,visitor:i,value:a,getModel:o},{recurse:s,set:u})=>{if(C.isNil(a))return;const f={key:e,path:t,schema:n,attribute:r},l=o("plugin::upload.file"),p=await s(i,{schema:l,path:t,getModel:o,parent:f},a);u(e,p)}).onComponent(async({key:e,value:t,schema:n,visitor:r,path:i,attribute:a,getModel:o},{recurse:s,set:u})=>{if(C.isNil(t))return;const f={key:e,path:i,schema:n,attribute:a},c=o(a.component),l=await s(r,{schema:c,path:i,getModel:o,parent:f},t);u(e,l)}).onDynamicZone(async({key:e,value:t,schema:n,visitor:r,path:i,attribute:a,getModel:o},{set:s,recurse:u})=>{if(C.isNil(t)||!C.isObject(t))return;const f={key:e,path:i,schema:n,attribute:a};if("on"in t&&t.on){const c=await u(r,{schema:n,path:i,getModel:o,parent:f},{on:t.on});s(e,c)}});var ir=C.curry(id.traverse);const od=e=>{const t=[];function n(r,i){for(const[a,o]of Object.entries(r)){const s=i?`${i}.${a}`:a;o===!0?t.push(s):n(o.populate,s)}}return n(e,""),t},ad=e=>{const t={};function n(r,i){const[a,...o]=i;o.length===0?r[a]=!0:((!r[a]||typeof r[a]=="boolean")&&(r[a]={populate:{}}),n(r[a].populate,o))}return e.forEach(r=>n(t,r.split("."))),t},sd=e=>C.isArray(e)&&e.every(C.isString),ud=Un().intercept(sd,async(e,t,n,{recurse:r})=>Promise.all(n.map(i=>r(e,t,i)))).intercept(e=>C.isString(e)&&e.includes(","),(e,t,n,{recurse:r})=>Promise.all(n.split(",").map(i=>r(e,t,i)))).intercept(e=>C.eq("*",e),C.constant("*")).parse(C.isString,()=>({transform:C.trim,remove(e,t){return t===e?void 0:t},set(e,t,n){return n},keys(e){return[e]},get(e,t){return e===t?t:void 0}}));var or=C.curry(ud.traverse);const{ID_ATTRIBUTE:wn,DOC_ID_ATTRIBUTE:En}=lf,cd=async(e,t)=>{if(!e.schema)throw new Error("Missing schema in defaultSanitizeOutput");return gf((...n)=>{Bn(...n),Ht(...n)},e,t)},ld=C.curry((e,t)=>{if(!e.schema)throw new Error("Missing schema in defaultSanitizeFilters");return Hn(at(({key:n,attribute:r},{remove:i})=>{const a=!!r;[wn,En].includes(n)||!a&&!Ip(n)&&i(n)},e),at(Ua,e),at(Ba,e),at(Bn,e),at(Ht,e),at(({key:n,value:r},{remove:i})=>{C.isObject(r)&&C.isEmpty(r)&&i(n)},e))(t)}),fd=C.curry((e,t)=>{if(!e.schema)throw new Error("Missing schema in defaultSanitizeSort");return Hn(st(({key:n,attribute:r},{remove:i})=>{[wn,En].includes(n)||r||i(n)},e),st(Ua,e),st(Ba,e),st(Ht,e),st(Bn,e),st(({key:n,attribute:r,value:i},{remove:a})=>{[wn,En].includes(n)||!Aa(r)&&C.isEmpty(i)&&a(n)},e))(t)}),pd=C.curry((e,t)=>{if(!e.schema)throw new Error("Missing schema in defaultSanitizeFields");return Hn(or(({key:n,attribute:r},{remove:i})=>{[wn,En].includes(n)||(C.isNil(r)||!Aa(r))&&i(n)},e),or(Ht,e),or(Bn,e),n=>C.isArray(n)?n.filter(r=>!C.isNil(r)):n)(t)}),dd=C.curry((e,t)=>{if(!e.schema)throw new Error("Missing schema in defaultSanitizePopulate");return Hn(ir(qp,e),ir(async({key:n,value:r,schema:i,attribute:a,getModel:o,path:s},{set:u})=>{if(a)return;const f={key:n,path:s,schema:i,attribute:a};n==="sort"&&u(n,await fd({schema:i,getModel:o,parent:f},r)),n==="filters"&&u(n,await ld({schema:i,getModel:o,parent:f},r)),n==="fields"&&u(n,await pd({schema:i,getModel:o,parent:f},r)),n==="populate"&&u(n,await dd({schema:i,getModel:o,parent:f},r))},e),ir(Ht,e))(t)});var Bt={exports:{}},Ct={exports:{}},ar,Vi;function hd(){if(Vi)return ar;Vi=1,ar=r,r.sync=i;var e=We.default;function t(a,o){var s=o.pathExt!==void 0?o.pathExt:process.env.PATHEXT;if(!s||(s=s.split(";"),s.indexOf("")!==-1))return!0;for(var u=0;u<s.length;u++){var f=s[u].toLowerCase();if(f&&a.substr(-f.length).toLowerCase()===f)return!0}return!1}function n(a,o,s){return!a.isSymbolicLink()&&!a.isFile()?!1:t(o,s)}function r(a,o,s){e.stat(a,function(u,f){s(u,u?!1:n(f,a,o))})}function i(a,o){return n(e.statSync(a),a,o)}return ar}var sr,Xi;function md(){if(Xi)return sr;Xi=1,sr=t,t.sync=n;var e=We.default;function t(a,o,s){e.stat(a,function(u,f){s(u,u?!1:r(f,o))})}function n(a,o){return r(e.statSync(a),o)}function r(a,o){return a.isFile()&&i(a,o)}function i(a,o){var s=a.mode,u=a.uid,f=a.gid,c=o.uid!==void 0?o.uid:process.getuid&&process.getuid(),l=o.gid!==void 0?o.gid:process.getgid&&process.getgid(),p=parseInt("100",8),d=parseInt("010",8),h=parseInt("001",8),m=p|d,g=s&h||s&d&&f===l||s&p&&u===c||s&m&&c===0;return g}return sr}var bn;process.platform==="win32"||Ee.TESTING_WINDOWS?bn=hd():bn=md();var gd=ti;ti.sync=yd;function ti(e,t,n){if(typeof t=="function"&&(n=t,t={}),!n){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(r,i){ti(e,t||{},function(a,o){a?i(a):r(o)})})}bn(e,t||{},function(r,i){r&&(r.code==="EACCES"||t&&t.ignoreErrors)&&(r=null,i=!1),n(r,i)})}function yd(e,t){try{return bn.sync(e,t||{})}catch(n){if(t&&t.ignoreErrors||n.code==="EACCES")return!1;throw n}}const dt=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",qa=Se.default,vd=dt?";":":",Ka=gd,Wa=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),za=(e,t)=>{const n=t.colon||vd,r=e.match(/\//)||dt&&e.match(/\\/)?[""]:[...dt?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(n)],i=dt?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",a=dt?i.split(n):[""];return dt&&e.indexOf(".")!==-1&&a[0]!==""&&a.unshift(""),{pathEnv:r,pathExt:a,pathExtExe:i}},Ya=(e,t,n)=>{typeof t=="function"&&(n=t,t={}),t||(t={});const{pathEnv:r,pathExt:i,pathExtExe:a}=za(e,t),o=[],s=f=>new Promise((c,l)=>{if(f===r.length)return t.all&&o.length?c(o):l(Wa(e));const p=r[f],d=/^".*"$/.test(p)?p.slice(1,-1):p,h=qa.join(d,e),m=!d&&/^\.[\\\/]/.test(e)?e.slice(0,2)+h:h;c(u(m,f,0))}),u=(f,c,l)=>new Promise((p,d)=>{if(l===i.length)return p(s(c+1));const h=i[l];Ka(f+h,{pathExt:a},(m,g)=>{if(!m&&g)if(t.all)o.push(f+h);else return p(f+h);return p(u(f,c,l+1))})});return n?s(0).then(f=>n(null,f),n):s(0)},wd=(e,t)=>{t=t||{};const{pathEnv:n,pathExt:r,pathExtExe:i}=za(e,t),a=[];for(let o=0;o<n.length;o++){const s=n[o],u=/^".*"$/.test(s)?s.slice(1,-1):s,f=qa.join(u,e),c=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+f:f;for(let l=0;l<r.length;l++){const p=c+r[l];try{if(Ka.sync(p,{pathExt:i}))if(t.all)a.push(p);else return p}catch{}}}if(t.all&&a.length)return a;if(t.nothrow)return null;throw Wa(e)};var Ed=Ya;Ya.sync=wd;var ni={exports:{}};const Qa=(e={})=>{const t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"};ni.exports=Qa;ni.exports.default=Qa;var Va=ni.exports;const Zi=Se.default,bd=Ed,Sd=Va;function Ji(e,t){const n=e.options.env||process.env,r=process.cwd(),i=e.options.cwd!=null,a=i&&process.chdir!==void 0&&!process.chdir.disabled;if(a)try{process.chdir(e.options.cwd)}catch{}let o;try{o=bd.sync(e.command,{path:n[Sd({env:n})],pathExt:t?Zi.delimiter:void 0})}catch{}finally{a&&process.chdir(r)}return o&&(o=Zi.resolve(i?e.options.cwd:"",o)),o}function xd(e){return Ji(e)||Ji(e,!0)}var _d=xd,ri={};const Br=/([()\][%!^"`<>&|;, *?])/g;function Ad(e){return e=e.replace(Br,"^$1"),e}function Td(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(Br,"^$1"),t&&(e=e.replace(Br,"^$1")),e}ri.command=Ad;ri.argument=Td;var Cd=/^#!(.*)/;const Rd=Cd;var Fd=(e="")=>{const t=e.match(Rd);if(!t)return null;const[n,r]=t[0].replace(/#! ?/,"").split(" "),i=n.split("/").pop();return i==="env"?r:r?`${i} ${r}`:i};const ur=We.default,$d=Fd;function Id(e){const n=Buffer.alloc(150);let r;try{r=ur.openSync(e,"r"),ur.readSync(r,n,0,150,0),ur.closeSync(r)}catch{}return $d(n.toString())}var Od=Id;const Nd=Se.default,eo=_d,to=ri,Pd=Od,Ld=process.platform==="win32",kd=/\.(?:com|exe)$/i,Dd=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Md(e){e.file=eo(e);const t=e.file&&Pd(e.file);return t?(e.args.unshift(e.file),e.command=t,eo(e)):e.file}function jd(e){if(!Ld)return e;const t=Md(e),n=!kd.test(t);if(e.options.forceShell||n){const r=Dd.test(t);e.command=Nd.normalize(e.command),e.command=to.command(e.command),e.args=e.args.map(a=>to.argument(a,r));const i=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${i}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function Hd(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);const r={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?r:jd(r)}var Bd=Hd;const ii=process.platform==="win32";function oi(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function Ud(e,t){if(!ii)return;const n=e.emit;e.emit=function(r,i){if(r==="exit"){const a=Xa(i,t);if(a)return n.call(e,"error",a)}return n.apply(e,arguments)}}function Xa(e,t){return ii&&e===1&&!t.file?oi(t.original,"spawn"):null}function Gd(e,t){return ii&&e===1&&!t.file?oi(t.original,"spawnSync"):null}var qd={hookChildProcess:Ud,verifyENOENT:Xa,verifyENOENTSync:Gd,notFoundError:oi};const Za=fn.default,ai=Bd,si=qd;function Ja(e,t,n){const r=ai(e,t,n),i=Za.spawn(r.command,r.args,r.options);return si.hookChildProcess(i,r),i}function Kd(e,t,n){const r=ai(e,t,n),i=Za.spawnSync(r.command,r.args,r.options);return i.error=i.error||si.verifyENOENTSync(i.status,r),i}Ct.exports=Ja;Ct.exports.spawn=Ja;Ct.exports.sync=Kd;Ct.exports._parse=ai;Ct.exports._enoent=si;var Wd=Ct.exports,zd=e=>{const t=typeof e=="string"?`
28
- `:10,n=typeof e=="string"?"\r":13;return e[e.length-1]===t&&(e=e.slice(0,e.length-1)),e[e.length-1]===n&&(e=e.slice(0,e.length-1)),e},ui={exports:{}};ui.exports;(function(e){const t=Se.default,n=Va,r=i=>{i={cwd:process.cwd(),path:process.env[n()],execPath:process.execPath,...i};let a,o=t.resolve(i.cwd);const s=[];for(;a!==o;)s.push(t.join(o,"node_modules/.bin")),a=o,o=t.resolve(o,"..");const u=t.resolve(i.cwd,i.execPath,"..");return s.push(u),s.concat(i.path).join(t.delimiter)};e.exports=r,e.exports.default=r,e.exports.env=i=>{i={env:process.env,...i};const a={...i.env},o=n({env:a});return i.path=a[o],a[o]=e.exports(i),a}})(ui);var Yd=ui.exports,Gn={exports:{}},ci={exports:{}};const es=(e,t)=>{for(const n of Reflect.ownKeys(t))Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n));return e};ci.exports=es;ci.exports.default=es;var Qd=ci.exports;const Vd=Qd,Sn=new WeakMap,ts=(e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let n,r=0;const i=e.displayName||e.name||"<anonymous>",a=function(...o){if(Sn.set(a,++r),r===1)n=e.apply(this,o),e=null;else if(t.throw===!0)throw new Error(`Function \`${i}\` can only be called once`);return n};return Vd(a,e),Sn.set(a,r),a};Gn.exports=ts;Gn.exports.default=ts;Gn.exports.callCount=e=>{if(!Sn.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return Sn.get(e)};var Xd=Gn.exports,St={},qn={},Kn={};Object.defineProperty(Kn,"__esModule",{value:!0});Kn.SIGNALS=void 0;const Zd=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];Kn.SIGNALS=Zd;var nt={};Object.defineProperty(nt,"__esModule",{value:!0});nt.SIGRTMAX=nt.getRealtimeSignals=void 0;const Jd=function(){const e=rs-ns+1;return Array.from({length:e},eh)};nt.getRealtimeSignals=Jd;const eh=function(e,t){return{name:`SIGRT${t+1}`,number:ns+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}},ns=34,rs=64;nt.SIGRTMAX=rs;Object.defineProperty(qn,"__esModule",{value:!0});qn.getSignals=void 0;var th=Ln.default,nh=Kn,rh=nt;const ih=function(){const e=(0,rh.getRealtimeSignals)();return[...nh.SIGNALS,...e].map(oh)};qn.getSignals=ih;const oh=function({name:e,number:t,description:n,action:r,forced:i=!1,standard:a}){const{signals:{[e]:o}}=th.constants,s=o!==void 0;return{name:e,number:s?o:t,description:n,supported:s,action:r,forced:i,standard:a}};Object.defineProperty(St,"__esModule",{value:!0});St.signalsByNumber=St.signalsByName=void 0;var ah=Ln.default,is=qn,sh=nt;const uh=function(){return(0,is.getSignals)().reduce(ch,{})},ch=function(e,{name:t,number:n,description:r,supported:i,action:a,forced:o,standard:s}){return{...e,[t]:{name:t,number:n,description:r,supported:i,action:a,forced:o,standard:s}}},lh=uh();St.signalsByName=lh;const fh=function(){const e=(0,is.getSignals)(),t=sh.SIGRTMAX+1,n=Array.from({length:t},(r,i)=>ph(i,e));return Object.assign({},...n)},ph=function(e,t){const n=dh(e,t);if(n===void 0)return{};const{name:r,description:i,supported:a,action:o,forced:s,standard:u}=n;return{[e]:{name:r,number:e,description:i,supported:a,action:o,forced:s,standard:u}}},dh=function(e,t){const n=t.find(({name:r})=>ah.constants.signals[r]===e);return n!==void 0?n:t.find(r=>r.number===e)},hh=fh();St.signalsByNumber=hh;const{signalsByName:mh}=St,gh=({timedOut:e,timeout:t,errorCode:n,signal:r,signalDescription:i,exitCode:a,isCanceled:o})=>e?`timed out after ${t} milliseconds`:o?"was canceled":n!==void 0?`failed with ${n}`:r!==void 0?`was killed with ${r} (${i})`:a!==void 0?`failed with exit code ${a}`:"failed",yh=({stdout:e,stderr:t,all:n,error:r,signal:i,exitCode:a,command:o,escapedCommand:s,timedOut:u,isCanceled:f,killed:c,parsed:{options:{timeout:l}}})=>{a=a===null?void 0:a,i=i===null?void 0:i;const p=i===void 0?void 0:mh[i].description,d=r&&r.code,m=`Command ${gh({timedOut:u,timeout:l,errorCode:d,signal:i,signalDescription:p,exitCode:a,isCanceled:f})}: ${o}`,g=Object.prototype.toString.call(r)==="[object Error]",E=g?`${m}
29
- ${r.message}`:m,S=[E,t,e].filter(Boolean).join(`
30
- `);return g?(r.originalMessage=r.message,r.message=S):r=new Error(S),r.shortMessage=E,r.command=o,r.escapedCommand=s,r.exitCode=a,r.signal=i,r.signalDescription=p,r.stdout=e,r.stderr=t,n!==void 0&&(r.all=n),"bufferedData"in r&&delete r.bufferedData,r.failed=!0,r.timedOut=!!u,r.isCanceled=f,r.killed=c&&!u,r};var vh=yh,li={exports:{}};const an=["stdin","stdout","stderr"],wh=e=>an.some(t=>e[t]!==void 0),os=e=>{if(!e)return;const{stdio:t}=e;if(t===void 0)return an.map(r=>e[r]);if(wh(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${an.map(r=>`\`${r}\``).join(", ")}`);if(typeof t=="string")return t;if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);const n=Math.max(t.length,an.length);return Array.from({length:n},(r,i)=>t[i])};li.exports=os;li.exports.node=e=>{const t=os(e);return t==="ipc"?"ipc":t===void 0||typeof t=="string"?[t,t,t,"ipc"]:t.includes("ipc")?t:[...t,"ipc"]};var Eh=li.exports,ht={exports:{}},cr={exports:{}},no;function bh(){return no||(no=1,(function(e){e.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"],process.platform!=="win32"&&e.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),process.platform==="linux"&&e.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")})(cr)),cr.exports}var te=Ee.process;const ze=function(e){return e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function"};if(!ze(te))ht.exports=function(){return function(){}};else{var Sh=ua.default,Ft=bh(),xh=/^win/i.test(te.platform),Jt=sc.default;typeof Jt!="function"&&(Jt=Jt.EventEmitter);var fe;te.__signal_exit_emitter__?fe=te.__signal_exit_emitter__:(fe=te.__signal_exit_emitter__=new Jt,fe.count=0,fe.emitted={}),fe.infinite||(fe.setMaxListeners(1/0),fe.infinite=!0),ht.exports=function(e,t){if(!ze(Ee.process))return function(){};Sh.equal(typeof e,"function","a callback must be provided for exit handler"),$t===!1&&ro();var n="exit";t&&t.alwaysLast&&(n="afterexit");var r=function(){fe.removeListener(n,e),fe.listeners("exit").length===0&&fe.listeners("afterexit").length===0&&lr()};return fe.on(n,e),r};var lr=function(){!$t||!ze(Ee.process)||($t=!1,Ft.forEach(function(t){try{te.removeListener(t,fr[t])}catch{}}),te.emit=pr,te.reallyExit=io,fe.count-=1)};ht.exports.unload=lr;var ut=function(t,n,r){fe.emitted[t]||(fe.emitted[t]=!0,fe.emit(t,n,r))},fr={};Ft.forEach(function(e){fr[e]=function(){if(ze(Ee.process)){var n=te.listeners(e);n.length===fe.count&&(lr(),ut("exit",null,e),ut("afterexit",null,e),xh&&e==="SIGHUP"&&(e="SIGINT"),te.kill(te.pid,e))}}}),ht.exports.signals=function(){return Ft};var $t=!1,ro=function(){$t||!ze(Ee.process)||($t=!0,fe.count+=1,Ft=Ft.filter(function(t){try{return te.on(t,fr[t]),!0}catch{return!1}}),te.emit=Ah,te.reallyExit=_h)};ht.exports.load=ro;var io=te.reallyExit,_h=function(t){ze(Ee.process)&&(te.exitCode=t||0,ut("exit",te.exitCode,null),ut("afterexit",te.exitCode,null),io.call(te,te.exitCode))},pr=te.emit,Ah=function(t,n){if(t==="exit"&&ze(Ee.process)){n!==void 0&&(te.exitCode=n);var r=pr.apply(this,arguments);return ut("exit",te.exitCode,null),ut("afterexit",te.exitCode,null),r}else return pr.apply(this,arguments)}}var Th=ht.exports;const Ch=Ln.default,Rh=Th,Fh=1e3*5,$h=(e,t="SIGTERM",n={})=>{const r=e(t);return Ih(e,t,n,r),r},Ih=(e,t,n,r)=>{if(!Oh(t,n,r))return;const i=Ph(n),a=setTimeout(()=>{e("SIGKILL")},i);a.unref&&a.unref()},Oh=(e,{forceKillAfterTimeout:t},n)=>Nh(e)&&t!==!1&&n,Nh=e=>e===Ch.constants.signals.SIGTERM||typeof e=="string"&&e.toUpperCase()==="SIGTERM",Ph=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return Fh;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},Lh=(e,t)=>{e.kill()&&(t.isCanceled=!0)},kh=(e,t,n)=>{e.kill(t),n(Object.assign(new Error("Timed out"),{timedOut:!0,signal:t}))},Dh=(e,{timeout:t,killSignal:n="SIGTERM"},r)=>{if(t===0||t===void 0)return r;let i;const a=new Promise((s,u)=>{i=setTimeout(()=>{kh(e,n,u)},t)}),o=r.finally(()=>{clearTimeout(i)});return Promise.race([a,o])},Mh=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},jh=async(e,{cleanup:t,detached:n},r)=>{if(!t||n)return r;const i=Rh(()=>{e.kill()});return r.finally(()=>{i()})};var Hh={spawnedKill:$h,spawnedCancel:Lh,setupTimeout:Dh,validateTimeout:Mh,setExitHandler:jh};const ke=e=>e!==null&&typeof e=="object"&&typeof e.pipe=="function";ke.writable=e=>ke(e)&&e.writable!==!1&&typeof e._write=="function"&&typeof e._writableState=="object";ke.readable=e=>ke(e)&&e.readable!==!1&&typeof e._read=="function"&&typeof e._readableState=="object";ke.duplex=e=>ke.writable(e)&&ke.readable(e);ke.transform=e=>ke.duplex(e)&&typeof e._transform=="function";var Bh=ke,Ut={exports:{}};const{PassThrough:Uh}=kn.default;var Gh=e=>{e={...e};const{array:t}=e;let{encoding:n}=e;const r=n==="buffer";let i=!1;t?i=!(n||r):n=n||"utf8",r&&(n=null);const a=new Uh({objectMode:i});n&&a.setEncoding(n);let o=0;const s=[];return a.on("data",u=>{s.push(u),i?o=s.length:o+=u.length}),a.getBufferedValue=()=>t?s:r?Buffer.concat(s,o):s.join(""),a.getBufferedLength=()=>o,a};const{constants:qh}=uc.default,Kh=kn.default,{promisify:Wh}=it.default,zh=Gh,Yh=Wh(Kh.pipeline);class as extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}}async function fi(e,t){if(!e)throw new Error("Expected a stream");t={maxBuffer:1/0,...t};const{maxBuffer:n}=t,r=zh(t);return await new Promise((i,a)=>{const o=s=>{s&&r.getBufferedLength()<=qh.MAX_LENGTH&&(s.bufferedData=r.getBufferedValue()),a(s)};(async()=>{try{await Yh(e,r),i()}catch(s){o(s)}})(),r.on("data",()=>{r.getBufferedLength()>n&&o(new as)})}),r.getBufferedValue()}Ut.exports=fi;Ut.exports.buffer=(e,t)=>fi(e,{...t,encoding:"buffer"});Ut.exports.array=(e,t)=>fi(e,{...t,array:!0});Ut.exports.MaxBufferError=as;var Qh=Ut.exports;const{PassThrough:Vh}=kn.default;var Xh=function(){var e=[],t=new Vh({objectMode:!0});return t.setMaxListeners(0),t.add=n,t.isEmpty=r,t.on("unpipe",i),Array.prototype.slice.call(arguments).forEach(n),t;function n(a){return Array.isArray(a)?(a.forEach(n),this):(e.push(a),a.once("end",i.bind(null,a)),a.once("error",t.emit.bind(t,"error")),a.pipe(t,{end:!1}),this)}function r(){return e.length==0}function i(a){e=e.filter(function(o){return o!==a}),!e.length&&t.readable&&t.end()}};const ss=Bh,oo=Qh,Zh=Xh,Jh=(e,t)=>{t===void 0||e.stdin===void 0||(ss(t)?t.pipe(e.stdin):e.stdin.end(t))},em=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;const n=Zh();return e.stdout&&n.add(e.stdout),e.stderr&&n.add(e.stderr),n},dr=async(e,t)=>{if(e){e.destroy();try{return await t}catch(n){return n.bufferedData}}},hr=(e,{encoding:t,buffer:n,maxBuffer:r})=>{if(!(!e||!n))return t?oo(e,{encoding:t,maxBuffer:r}):oo.buffer(e,{maxBuffer:r})},tm=async({stdout:e,stderr:t,all:n},{encoding:r,buffer:i,maxBuffer:a},o)=>{const s=hr(e,{encoding:r,buffer:i,maxBuffer:a}),u=hr(t,{encoding:r,buffer:i,maxBuffer:a}),f=hr(n,{encoding:r,buffer:i,maxBuffer:a*2});try{return await Promise.all([o,s,u,f])}catch(c){return Promise.all([{error:c,signal:c.signal,timedOut:c.timedOut},dr(e,s),dr(t,u),dr(n,f)])}},nm=({input:e})=>{if(ss(e))throw new TypeError("The `input` option cannot be a stream in sync mode")};var rm={handleInput:Jh,makeAllStream:em,getSpawnedResult:tm,validateInputSync:nm};const im=(async()=>{})().constructor.prototype,om=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(im,e)]),am=(e,t)=>{for(const[n,r]of om){const i=typeof t=="function"?(...a)=>Reflect.apply(r.value,t(),a):r.value.bind(t);Reflect.defineProperty(e,n,{...r,value:i})}return e},sm=e=>new Promise((t,n)=>{e.on("exit",(r,i)=>{t({exitCode:r,signal:i})}),e.on("error",r=>{n(r)}),e.stdin&&e.stdin.on("error",r=>{n(r)})});var um={mergePromise:am,getSpawnedPromise:sm};const us=(e,t=[])=>Array.isArray(t)?[e,...t]:[e],cm=/^[\w.-]+$/,lm=/"/g,fm=e=>typeof e!="string"||cm.test(e)?e:`"${e.replace(lm,'\\"')}"`,pm=(e,t)=>us(e,t).join(" "),dm=(e,t)=>us(e,t).map(n=>fm(n)).join(" "),hm=/ +/g,mm=e=>{const t=[];for(const n of e.trim().split(hm)){const r=t[t.length-1];r&&r.endsWith("\\")?t[t.length-1]=`${r.slice(0,-1)} ${n}`:t.push(n)}return t};var gm={joinCommand:pm,getEscapedCommand:dm,parseCommand:mm};const ym=Se.default,Ur=fn.default,vm=Wd,wm=zd,Em=Yd,bm=Xd,xn=vh,cs=Eh,{spawnedKill:Sm,spawnedCancel:xm,setupTimeout:_m,validateTimeout:Am,setExitHandler:Tm}=Hh,{handleInput:Cm,getSpawnedResult:Rm,makeAllStream:Fm,validateInputSync:$m}=rm,{mergePromise:ao,getSpawnedPromise:Im}=um,{joinCommand:ls,parseCommand:fs,getEscapedCommand:ps}=gm,Om=1e3*1e3*100,Nm=({env:e,extendEnv:t,preferLocal:n,localDir:r,execPath:i})=>{const a=t?{...process.env,...e}:e;return n?Em.env({env:a,cwd:r,execPath:i}):a},ds=(e,t,n={})=>{const r=vm._parse(e,t,n);return e=r.command,t=r.args,n=r.options,n={maxBuffer:Om,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:n.cwd||process.cwd(),execPath:process.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,...n},n.env=Nm(n),n.stdio=cs(n),process.platform==="win32"&&ym.basename(e,".exe")==="cmd"&&t.unshift("/q"),{file:e,args:t,options:n,parsed:r}},Nt=(e,t,n)=>typeof t!="string"&&!Buffer.isBuffer(t)?n===void 0?void 0:"":e.stripFinalNewline?wm(t):t,Wn=(e,t,n)=>{const r=ds(e,t,n),i=ls(e,t),a=ps(e,t);Am(r.options);let o;try{o=Ur.spawn(r.file,r.args,r.options)}catch(d){const h=new Ur.ChildProcess,m=Promise.reject(xn({error:d,stdout:"",stderr:"",all:"",command:i,escapedCommand:a,parsed:r,timedOut:!1,isCanceled:!1,killed:!1}));return ao(h,m)}const s=Im(o),u=_m(o,r.options,s),f=Tm(o,r.options,u),c={isCanceled:!1};o.kill=Sm.bind(null,o.kill.bind(o)),o.cancel=xm.bind(null,o,c);const p=bm(async()=>{const[{error:d,exitCode:h,signal:m,timedOut:g},E,S,T]=await Rm(o,r.options,f),A=Nt(r.options,E),R=Nt(r.options,S),F=Nt(r.options,T);if(d||h!==0||m!==null){const D=xn({error:d,exitCode:h,signal:m,stdout:A,stderr:R,all:F,command:i,escapedCommand:a,parsed:r,timedOut:g,isCanceled:c.isCanceled,killed:o.killed});if(!r.options.reject)return D;throw D}return{command:i,escapedCommand:a,exitCode:0,stdout:A,stderr:R,all:F,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return Cm(o,r.options.input),o.all=Fm(o,r.options),ao(o,p)};Bt.exports=Wn;Bt.exports.sync=(e,t,n)=>{const r=ds(e,t,n),i=ls(e,t),a=ps(e,t);$m(r.options);let o;try{o=Ur.spawnSync(r.file,r.args,r.options)}catch(f){throw xn({error:f,stdout:"",stderr:"",all:"",command:i,escapedCommand:a,parsed:r,timedOut:!1,isCanceled:!1,killed:!1})}const s=Nt(r.options,o.stdout,o.error),u=Nt(r.options,o.stderr,o.error);if(o.error||o.status!==0||o.signal!==null){const f=xn({stdout:s,stderr:u,error:o.error,signal:o.signal,exitCode:o.status,command:i,escapedCommand:a,parsed:r,timedOut:o.error&&o.error.code==="ETIMEDOUT",isCanceled:!1,killed:o.signal!==null});if(!r.options.reject)return f;throw f}return{command:i,escapedCommand:a,exitCode:0,stdout:s,stderr:u,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}};Bt.exports.command=(e,t)=>{const[n,...r]=fs(e);return Wn(n,r,t)};Bt.exports.commandSync=(e,t)=>{const[n,...r]=fs(e);return Wn.sync(n,r,t)};Bt.exports.node=(e,t,n={})=>{t&&!Array.isArray(t)&&typeof t=="object"&&(n=t,t=[]);const r=cs.node(n),i=process.execArgv.filter(s=>!s.startsWith("--inspect")),{nodePath:a=process.execPath,nodeOptions:o=i}=n;return Wn(a,[...o,e,...Array.isArray(t)?t:[]],{...n,stdin:void 0,stdout:void 0,stderr:void 0,stdio:r,shell:!1})};var Ae={},zn={exports:{}},hs={exports:{}},pi={exports:{}},di={exports:{}},hi={exports:{}},mi={exports:{}};const ms=(e,...t)=>new Promise(n=>{n(e(...t))});mi.exports=ms;mi.exports.default=ms;var Pm=mi.exports;const Lm=Pm,gs=e=>{if(!((Number.isInteger(e)||e===1/0)&&e>0))return Promise.reject(new TypeError("Expected `concurrency` to be a number from 1 and up"));const t=[];let n=0;const r=()=>{n--,t.length>0&&t.shift()()},i=(s,u,...f)=>{n++;const c=Lm(s,...f);u(c),c.then(r,r)},a=(s,u,...f)=>{n<e?i(s,u,...f):t.push(i.bind(null,s,u,...f))},o=(s,...u)=>new Promise(f=>a(s,f,...u));return Object.defineProperties(o,{activeCount:{get:()=>n},pendingCount:{get:()=>t.length},clearQueue:{value:()=>{t.length=0}}}),o};hi.exports=gs;hi.exports.default=gs;var km=hi.exports;const so=km;let ys=class extends Error{constructor(t){super(),this.value=t}};const Dm=async(e,t)=>t(await e),Mm=async e=>{const t=await Promise.all(e);if(t[1]===!0)throw new ys(t[0]);return!1},vs=async(e,t,n)=>{n={concurrency:1/0,preserveOrder:!0,...n};const r=so(n.concurrency),i=[...e].map(o=>[o,r(Dm,o,t)]),a=so(n.preserveOrder?1:1/0);try{await Promise.all(i.map(o=>a(Mm,o)))}catch(o){if(o instanceof ys)return o.value;throw o}};di.exports=vs;di.exports.default=vs;var jm=di.exports;const ws=Se.default,_n=We.default,{promisify:Es}=it.default,Hm=jm,Bm=Es(_n.stat),Um=Es(_n.lstat),bs={directory:"isDirectory",file:"isFile"};function Ss({type:e}){if(!(e in bs))throw new Error(`Invalid type specified: ${e}`)}const xs=(e,t)=>e===void 0||t[bs[e]]();pi.exports=async(e,t)=>{t={cwd:process.cwd(),type:"file",allowSymlinks:!0,...t},Ss(t);const n=t.allowSymlinks?Bm:Um;return Hm(e,async r=>{try{const i=await n(ws.resolve(t.cwd,r));return xs(t.type,i)}catch{return!1}},t)};pi.exports.sync=(e,t)=>{t={cwd:process.cwd(),allowSymlinks:!0,type:"file",...t},Ss(t);const n=t.allowSymlinks?_n.statSync:_n.lstatSync;for(const r of e)try{const i=n(ws.resolve(t.cwd,r));if(xs(t.type,i))return r}catch{}};var Gm=pi.exports,gi={exports:{}};const _s=We.default,{promisify:qm}=it.default,Km=qm(_s.access);gi.exports=async e=>{try{return await Km(e),!0}catch{return!1}};gi.exports.sync=e=>{try{return _s.accessSync(e),!0}catch{return!1}};var As=gi.exports;(function(e){const t=Se.default,n=Gm,r=As,i=Symbol("findUp.stop");e.exports=async(a,o={})=>{let s=t.resolve(o.cwd||"");const{root:u}=t.parse(s),f=[].concat(a),c=async l=>{if(typeof a!="function")return n(f,l);const p=await a(l.cwd);return typeof p=="string"?n([p],l):p};for(;;){const l=await c({...o,cwd:s});if(l===i)return;if(l)return t.resolve(s,l);if(s===u)return;s=t.dirname(s)}},e.exports.sync=(a,o={})=>{let s=t.resolve(o.cwd||"");const{root:u}=t.parse(s),f=[].concat(a),c=l=>{if(typeof a!="function")return n.sync(f,l);const p=a(l.cwd);return typeof p=="string"?n.sync([p],l):p};for(;;){const l=c({...o,cwd:s});if(l===i)return;if(l)return t.resolve(s,l);if(s===u)return;s=t.dirname(s)}},e.exports.exists=r,e.exports.sync.exists=r.sync,e.exports.stop=i})(hs);var Wm=hs.exports;const Ts=Se.default,Cs=Wm,Rs=async e=>{const t=await Cs("package.json",{cwd:e});return t&&Ts.dirname(t)};zn.exports=Rs;zn.exports.default=Rs;zn.exports.sync=e=>{const t=Cs.sync("package.json",{cwd:e});return t&&Ts.dirname(t)};var zm=zn.exports,Yn={};(function(e){e.isInteger=t=>typeof t=="number"?Number.isInteger(t):typeof t=="string"&&t.trim()!==""?Number.isInteger(Number(t)):!1,e.find=(t,n)=>t.nodes.find(r=>r.type===n),e.exceedsLimit=(t,n,r=1,i)=>i===!1||!e.isInteger(t)||!e.isInteger(n)?!1:(Number(n)-Number(t))/Number(r)>=i,e.escapeNode=(t,n=0,r)=>{const i=t.nodes[n];i&&(r&&i.type===r||i.type==="open"||i.type==="close")&&i.escaped!==!0&&(i.value="\\"+i.value,i.escaped=!0)},e.encloseBrace=t=>t.type!=="brace"?!1:t.commas>>0+t.ranges>>0===0?(t.invalid=!0,!0):!1,e.isInvalidBrace=t=>t.type!=="brace"?!1:t.invalid===!0||t.dollar?!0:t.commas>>0+t.ranges>>0===0||t.open!==!0||t.close!==!0?(t.invalid=!0,!0):!1,e.isOpenOrClose=t=>t.type==="open"||t.type==="close"?!0:t.open===!0||t.close===!0,e.reduce=t=>t.reduce((n,r)=>(r.type==="text"&&n.push(r.value),r.type==="range"&&(r.type="text"),n),[]),e.flatten=(...t)=>{const n=[],r=i=>{for(let a=0;a<i.length;a++){const o=i[a];if(Array.isArray(o)){r(o);continue}o!==void 0&&n.push(o)}return n};return r(t),n}})(Yn);const uo=Yn;var yi=(e,t={})=>{const n=(r,i={})=>{const a=t.escapeInvalid&&uo.isInvalidBrace(i),o=r.invalid===!0&&t.escapeInvalid===!0;let s="";if(r.value)return(a||o)&&uo.isOpenOrClose(r)?"\\"+r.value:r.value;if(r.value)return r.value;if(r.nodes)for(const u of r.nodes)s+=n(u);return s};return n(e)};/*!
27
+ `+Dp(n,4),super(n),this.name="AggregateError",Object.defineProperty(this,"_errors",{value:t})}*[Symbol.iterator](){for(const t of this._errors)yield t}};var Bp=Hp;const Up=Bp;var Gp=async(e,t,{concurrency:n=1/0,stopOnError:r=!0}={})=>new Promise((i,a)=>{if(typeof t!="function")throw new TypeError("Mapper function is required");if(!((Number.isSafeInteger(n)||n===1/0)&&n>=1))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${n}\` (${typeof n})`);const o=[],s=[],u=e[Symbol.iterator]();let f=!1,c=!1,l=0,p=0;const d=()=>{if(f)return;const h=u.next(),m=p;if(p++,h.done){c=!0,l===0&&(!r&&s.length!==0?a(new Up(s)):i(o));return}l++,(async()=>{try{const g=await h.value;o[m]=await t(g,m),l--,d()}catch(g){r?(f=!0,a(g)):(s.push(g),l--,d())}})()};for(let h=0;h<n&&(d(),!c);h++);});const qp=Fa(Gp);function Bn(...e){const[t,...n]=e;return async(...r)=>{let i=await t.apply(t,r);for(let a=0;a<n.length;a+=1)i=await n[a](i);return i}}C.curry(qp);const Un=({key:e,attribute:t},{remove:n})=>{t?.type==="password"&&n(e)},Ht=({schema:e,key:t,attribute:n},{remove:r})=>{if(!n)return;(n.private===!0||df(e,t))&&r(t)},Ua=({key:e,attribute:t},{remove:n})=>{Ra(t)&&n(e)},Ga=({key:e,attribute:t},{remove:n})=>{mf(t)&&n(e)},Kp=({schema:e,key:t,value:n},{set:r})=>{if(t===""&&n==="*"){const{attributes:i}=e,a=Object.entries(i).filter(([,o])=>["relation","component","media","dynamiczone"].includes(o.type)).reduce((o,[s])=>({...o,[s]:!0}),{});r("",a)}},Wp={raw:null,attribute:null};var Gn=(()=>{const e={parsers:[],interceptors:[],ignore:[],handlers:{attributes:[],common:[]}},t=async(n,r,i)=>{const{path:a=Wp,parent:o,schema:s,getModel:u}=r??{};for(const{predicate:d,handler:h}of e.interceptors)if(d(i))return h(n,r,i,{recurse:t});const f=e.parsers.find(d=>d.predicate(i))?.parser,c=f?.(i);if(!c)return i;let l=c.transform(i);const p=c.keys(l);for(const d of p){const h=s?.attributes?.[d],m={...a};m.raw=C.isNil(a.raw)?d:`${a.raw}.${d}`,C.isNil(h)||(m.attribute=C.isNil(a.attribute)?d:`${a.attribute}.${d}`);const g={key:d,value:c.get(d,l),attribute:h,schema:s,path:m,data:l,getModel:u,parent:o},w={remove(M){l=c.remove(M,l)},set(M,A){l=c.set(M,A,l)},recurse:t};await n(g,C.pick(["remove","set"],w));const S=c.get(d,l),x=()=>({key:d,value:S,attribute:h,schema:s,path:m,data:l,visitor:n,getModel:u,parent:o}),R=x();if(e.ignore.some(M=>M(R)))continue;const O=[...e.handlers.common,...e.handlers.attributes];for await(const M of O){const A=x();await M.predicate(A)&&await M.handler(A,C.pick(["recurse","set"],w))}}return l};return{traverse:t,intercept(n,r){return e.interceptors.push({predicate:n,handler:r}),this},parse(n,r){return e.parsers.push({predicate:n,parser:r}),this},ignore(n){return e.ignore.push(n),this},on(n,r){return e.handlers.common.push({predicate:n,handler:r}),this},onAttribute(n,r){return e.handlers.attributes.push({predicate:n,handler:r}),this},onRelation(n){return this.onAttribute(({attribute:r})=>r?.type==="relation",n)},onMedia(n){return this.onAttribute(({attribute:r})=>r?.type==="media",n)},onComponent(n){return this.onAttribute(({attribute:r})=>r?.type==="component",n)},onDynamicZone(n){return this.onAttribute(({attribute:r})=>r?.type==="dynamiczone",n)}}});const zp=e=>C.isObject(e),Yp=Gn().intercept(C.isArray,async(e,t,n,{recurse:r})=>Promise.all(n.map((i,a)=>{const o=t.path?{...t.path,raw:`${t.path.raw}[${a}]`}:t.path;return r(e,{...t,path:o},i)})).then(i=>i.filter(a=>!(C.isObject(a)&&C.isEmpty(a))))).intercept(e=>!C.isObject(e),(e,t,n)=>n).parse(zp,()=>({transform:C.cloneDeep,remove(e,t){return C.omit(e,t)},set(e,t,n){return{...n,[e]:t}},keys(e){return Object.keys(e)},get(e,t){return t[e]}})).ignore(({value:e})=>C.isNil(e)).on(({attribute:e})=>C.isNil(e),async({key:e,visitor:t,path:n,value:r,schema:i,getModel:a,attribute:o},{set:s,recurse:u})=>{s(e,await u(t,{schema:i,path:n,getModel:a,parent:{key:e,path:n,schema:i,attribute:o}},r))}).onRelation(async({key:e,attribute:t,visitor:n,path:r,value:i,schema:a,getModel:o},{set:s,recurse:u})=>{if(t.relation.toLowerCase().startsWith("morph"))return;const c={key:e,path:r,schema:a,attribute:t},l=t.target,p=o(l),d=await u(n,{schema:p,path:r,getModel:o,parent:c},i);s(e,d)}).onComponent(async({key:e,attribute:t,visitor:n,path:r,schema:i,value:a,getModel:o},{set:s,recurse:u})=>{const f={key:e,path:r,schema:i,attribute:t},c=o(t.component),l=await u(n,{schema:c,path:r,getModel:o,parent:f},a);s(e,l)}).onMedia(async({key:e,visitor:t,path:n,schema:r,attribute:i,value:a,getModel:o},{set:s,recurse:u})=>{const f={key:e,path:n,schema:r,attribute:i},l=o("plugin::upload.file"),p=await u(t,{schema:l,path:n,getModel:o,parent:f},a);s(e,p)});var at=C.curry(Yp.traverse);const Qp={asc:"asc",desc:"desc"},Vp=Object.values(Qp),Xp=e=>Vp.includes(e.toLowerCase()),Zp=e=>Array.isArray(e)&&e.every(C.isString),Jp=e=>Array.isArray(e)&&e.every(C.isObject),ed=e=>C.isString(e)&&e.split(",").length>1,td=e=>C.isObject(e),nd=Gn().intercept(ed,async(e,t,n,{recurse:r})=>Promise.all(n.split(",").map(C.trim).map(i=>r(e,t,i))).then(i=>i.filter(a=>!C.isEmpty(a)).join(","))).intercept(Zp,async(e,t,n,{recurse:r})=>Promise.all(n.map(i=>r(e,t,i))).then(i=>i.filter(a=>!C.isEmpty(a)))).intercept(Jp,async(e,t,n,{recurse:r})=>Promise.all(n.map(i=>r(e,t,i))).then(i=>i.filter(a=>!C.isEmpty(a)))).parse(C.isString,()=>{const e=C.pipe(C.split("."),C.map(C.split(":")),C.flatten),t=n=>{if(n.length!==0)return n.reduce((r,i)=>C.isEmpty(i)?r:r===""?i:Xp(i)?`${r}:${i}`:`${r}.${i}`,"")};return{transform:C.trim,remove(n,r){const[i]=e(r);return i===n?void 0:r},set(n,r,i){const[a]=e(i);return a!==n?i:C.isNil(r)?a:`${a}.${r}`},keys(n){const r=C.first(e(n));return r?[r]:[]},get(n,r){const[i,...a]=e(r);return n===i?t(a):void 0}}}).parse(td,()=>({transform:C.cloneDeep,remove(e,t){const{[e]:n,...r}=t;return r},set(e,t,n){return{...n,[e]:t}},keys(e){return Object.keys(e)},get(e,t){return t[e]}})).onRelation(async({key:e,value:t,attribute:n,visitor:r,path:i,getModel:a,schema:o},{set:s,recurse:u})=>{if(n.relation.toLowerCase().startsWith("morph"))return;const c={key:e,path:i,schema:o,attribute:n},l=n.target,p=a(l),d=await u(r,{schema:p,path:i,getModel:a,parent:c},t);s(e,d)}).onMedia(async({key:e,path:t,schema:n,attribute:r,visitor:i,value:a,getModel:o},{recurse:s,set:u})=>{const f={key:e,path:t,schema:n,attribute:r},l=o("plugin::upload.file"),p=await s(i,{schema:l,path:t,getModel:o,parent:f},a);u(e,p)}).onComponent(async({key:e,value:t,visitor:n,path:r,schema:i,attribute:a,getModel:o},{recurse:s,set:u})=>{const f={key:e,path:r,schema:i,attribute:a},c=o(a.component),l=await s(n,{schema:c,path:r,getModel:o,parent:f},t);u(e,l)});var st=C.curry(nd.traverse);const Qi=e=>({key:t,attribute:n})=>!n&&e===t,qa=e=>e==="*",rd=e=>C.isString(e)&&!qa(e),id=e=>C.isArray(e)&&e.every(C.isString),Vi=e=>C.isObject(e),od=Gn().intercept(rd,async(e,t,n,{recurse:r})=>{const i=sd([n]),a=await r(e,t,i),[o]=ad(a);return o}).intercept(id,async(e,t,n,{recurse:r})=>(await Promise.all(n.map(a=>r(e,t,a)))).filter(a=>!C.isNil(a))).parse(qa,()=>({transform:C.identity,get:(e,t)=>t,set:(e,t)=>t,keys:C.constant([""]),remove:C.constant(void 0)})).parse(C.isString,()=>{const e=C.split("."),t=C.join(".");return{transform:C.trim,remove(n,r){const[i]=e(r);return i===n?void 0:r},set(n,r,i){const[a]=e(i);return a!==n?i:C.isNil(r)||C.isEmpty(r)?a:`${a}.${r}`},keys(n){const r=C.first(e(n));return r?[r]:[]},get(n,r){const[i,...a]=e(r);return n===i?t(a):void 0}}}).parse(Vi,()=>({transform:C.cloneDeep,remove(e,t){const{[e]:n,...r}=t;return r},set(e,t,n){return{...n,[e]:t}},keys(e){return Object.keys(e)},get(e,t){return t[e]}})).ignore(({key:e,attribute:t})=>["sort","filters","fields"].includes(e)&&!t).on(Qi("populate"),async({key:e,visitor:t,path:n,value:r,schema:i,getModel:a,attribute:o},{set:s,recurse:u})=>{const c=await u(t,{schema:i,path:n,getModel:a,parent:{key:e,path:n,schema:i,attribute:o}},r);s(e,c)}).on(Qi("on"),async({key:e,visitor:t,path:n,value:r,getModel:i,parent:a},{set:o,recurse:s})=>{const u={};if(Vi(r)){for(const[f,c]of Object.entries(r)){const l=i(f),p={...n,raw:`${n.raw}[${f}]`};u[f]=await s(t,{schema:l,path:p,getModel:i,parent:a},c)}o(e,u)}}).onRelation(async({key:e,value:t,attribute:n,visitor:r,path:i,schema:a,getModel:o},{set:s,recurse:u})=>{if(C.isNil(t))return;const f={key:e,path:i,schema:a,attribute:n};if(Ra(n)){if(!C.isObject(t)||!("on"in t&&C.isObject(t?.on)))return;const d=await u(r,{schema:a,path:i,getModel:o,parent:f},{on:t?.on});s(e,d);return}const c=n.target,l=o(c),p=await u(r,{schema:l,path:i,getModel:o,parent:f},t);s(e,p)}).onMedia(async({key:e,path:t,schema:n,attribute:r,visitor:i,value:a,getModel:o},{recurse:s,set:u})=>{if(C.isNil(a))return;const f={key:e,path:t,schema:n,attribute:r},l=o("plugin::upload.file"),p=await s(i,{schema:l,path:t,getModel:o,parent:f},a);u(e,p)}).onComponent(async({key:e,value:t,schema:n,visitor:r,path:i,attribute:a,getModel:o},{recurse:s,set:u})=>{if(C.isNil(t))return;const f={key:e,path:i,schema:n,attribute:a},c=o(a.component),l=await s(r,{schema:c,path:i,getModel:o,parent:f},t);u(e,l)}).onDynamicZone(async({key:e,value:t,schema:n,visitor:r,path:i,attribute:a,getModel:o},{set:s,recurse:u})=>{if(C.isNil(t)||!C.isObject(t))return;const f={key:e,path:i,schema:n,attribute:a};if("on"in t&&t.on){const c=await u(r,{schema:n,path:i,getModel:o,parent:f},{on:t.on});s(e,c)}});var or=C.curry(od.traverse);const ad=e=>{const t=[];function n(r,i){for(const[a,o]of Object.entries(r)){const s=i?`${i}.${a}`:a;o===!0?t.push(s):n(o.populate,s)}}return n(e,""),t},sd=e=>{const t={};function n(r,i){const[a,...o]=i;o.length===0?r[a]=!0:((!r[a]||typeof r[a]=="boolean")&&(r[a]={populate:{}}),n(r[a].populate,o))}return e.forEach(r=>n(t,r.split("."))),t},ud=e=>C.isArray(e)&&e.every(C.isString),cd=Gn().intercept(ud,async(e,t,n,{recurse:r})=>Promise.all(n.map(i=>r(e,t,i)))).intercept(e=>C.isString(e)&&e.includes(","),(e,t,n,{recurse:r})=>Promise.all(n.split(",").map(i=>r(e,t,i)))).intercept(e=>C.eq("*",e),C.constant("*")).parse(C.isString,()=>({transform:C.trim,remove(e,t){return t===e?void 0:t},set(e,t,n){return n},keys(e){return[e]},get(e,t){return e===t?t:void 0}}));var ar=C.curry(cd.traverse);const{ID_ATTRIBUTE:En,DOC_ID_ATTRIBUTE:bn}=ff,ld=async(e,t)=>{if(!e.schema)throw new Error("Missing schema in defaultSanitizeOutput");return yf((...n)=>{Un(...n),Ht(...n)},e,t)},fd=C.curry((e,t)=>{if(!e.schema)throw new Error("Missing schema in defaultSanitizeFilters");return Bn(at(({key:n,attribute:r},{remove:i})=>{const a=!!r;[En,bn].includes(n)||!a&&!Op(n)&&i(n)},e),at(Ga,e),at(Ua,e),at(Un,e),at(Ht,e),at(({key:n,value:r},{remove:i})=>{C.isObject(r)&&C.isEmpty(r)&&i(n)},e))(t)}),pd=C.curry((e,t)=>{if(!e.schema)throw new Error("Missing schema in defaultSanitizeSort");return Bn(st(({key:n,attribute:r},{remove:i})=>{[En,bn].includes(n)||r||i(n)},e),st(Ga,e),st(Ua,e),st(Ht,e),st(Un,e),st(({key:n,attribute:r,value:i},{remove:a})=>{[En,bn].includes(n)||!Ta(r)&&C.isEmpty(i)&&a(n)},e))(t)}),dd=C.curry((e,t)=>{if(!e.schema)throw new Error("Missing schema in defaultSanitizeFields");return Bn(ar(({key:n,attribute:r},{remove:i})=>{[En,bn].includes(n)||(C.isNil(r)||!Ta(r))&&i(n)},e),ar(Ht,e),ar(Un,e),n=>C.isArray(n)?n.filter(r=>!C.isNil(r)):n)(t)}),hd=C.curry((e,t)=>{if(!e.schema)throw new Error("Missing schema in defaultSanitizePopulate");return Bn(or(Kp,e),or(async({key:n,value:r,schema:i,attribute:a,getModel:o,path:s},{set:u})=>{if(a)return;const f={key:n,path:s,schema:i,attribute:a};n==="sort"&&u(n,await pd({schema:i,getModel:o,parent:f},r)),n==="filters"&&u(n,await fd({schema:i,getModel:o,parent:f},r)),n==="fields"&&u(n,await dd({schema:i,getModel:o,parent:f},r)),n==="populate"&&u(n,await hd({schema:i,getModel:o,parent:f},r))},e),or(Ht,e))(t)});var Bt={exports:{}},Ct={exports:{}},sr,Xi;function md(){if(Xi)return sr;Xi=1,sr=r,r.sync=i;var e=We.default;function t(a,o){var s=o.pathExt!==void 0?o.pathExt:process.env.PATHEXT;if(!s||(s=s.split(";"),s.indexOf("")!==-1))return!0;for(var u=0;u<s.length;u++){var f=s[u].toLowerCase();if(f&&a.substr(-f.length).toLowerCase()===f)return!0}return!1}function n(a,o,s){return!a.isSymbolicLink()&&!a.isFile()?!1:t(o,s)}function r(a,o,s){e.stat(a,function(u,f){s(u,u?!1:n(f,a,o))})}function i(a,o){return n(e.statSync(a),a,o)}return sr}var ur,Zi;function gd(){if(Zi)return ur;Zi=1,ur=t,t.sync=n;var e=We.default;function t(a,o,s){e.stat(a,function(u,f){s(u,u?!1:r(f,o))})}function n(a,o){return r(e.statSync(a),o)}function r(a,o){return a.isFile()&&i(a,o)}function i(a,o){var s=a.mode,u=a.uid,f=a.gid,c=o.uid!==void 0?o.uid:process.getuid&&process.getuid(),l=o.gid!==void 0?o.gid:process.getgid&&process.getgid(),p=parseInt("100",8),d=parseInt("010",8),h=parseInt("001",8),m=p|d,g=s&h||s&d&&f===l||s&p&&u===c||s&m&&c===0;return g}return ur}var Sn;process.platform==="win32"||Ee.TESTING_WINDOWS?Sn=md():Sn=gd();var yd=ni;ni.sync=vd;function ni(e,t,n){if(typeof t=="function"&&(n=t,t={}),!n){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(r,i){ni(e,t||{},function(a,o){a?i(a):r(o)})})}Sn(e,t||{},function(r,i){r&&(r.code==="EACCES"||t&&t.ignoreErrors)&&(r=null,i=!1),n(r,i)})}function vd(e,t){try{return Sn.sync(e,t||{})}catch(n){if(t&&t.ignoreErrors||n.code==="EACCES")return!1;throw n}}const dt=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Ka=Se.default,wd=dt?";":":",Wa=yd,za=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),Ya=(e,t)=>{const n=t.colon||wd,r=e.match(/\//)||dt&&e.match(/\\/)?[""]:[...dt?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(n)],i=dt?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",a=dt?i.split(n):[""];return dt&&e.indexOf(".")!==-1&&a[0]!==""&&a.unshift(""),{pathEnv:r,pathExt:a,pathExtExe:i}},Qa=(e,t,n)=>{typeof t=="function"&&(n=t,t={}),t||(t={});const{pathEnv:r,pathExt:i,pathExtExe:a}=Ya(e,t),o=[],s=f=>new Promise((c,l)=>{if(f===r.length)return t.all&&o.length?c(o):l(za(e));const p=r[f],d=/^".*"$/.test(p)?p.slice(1,-1):p,h=Ka.join(d,e),m=!d&&/^\.[\\\/]/.test(e)?e.slice(0,2)+h:h;c(u(m,f,0))}),u=(f,c,l)=>new Promise((p,d)=>{if(l===i.length)return p(s(c+1));const h=i[l];Wa(f+h,{pathExt:a},(m,g)=>{if(!m&&g)if(t.all)o.push(f+h);else return p(f+h);return p(u(f,c,l+1))})});return n?s(0).then(f=>n(null,f),n):s(0)},Ed=(e,t)=>{t=t||{};const{pathEnv:n,pathExt:r,pathExtExe:i}=Ya(e,t),a=[];for(let o=0;o<n.length;o++){const s=n[o],u=/^".*"$/.test(s)?s.slice(1,-1):s,f=Ka.join(u,e),c=!u&&/^\.[\\\/]/.test(e)?e.slice(0,2)+f:f;for(let l=0;l<r.length;l++){const p=c+r[l];try{if(Wa.sync(p,{pathExt:i}))if(t.all)a.push(p);else return p}catch{}}}if(t.all&&a.length)return a;if(t.nothrow)return null;throw za(e)};var bd=Qa;Qa.sync=Ed;var ri={exports:{}};const Va=(e={})=>{const t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"};ri.exports=Va;ri.exports.default=Va;var Xa=ri.exports;const Ji=Se.default,Sd=bd,xd=Xa;function eo(e,t){const n=e.options.env||process.env,r=process.cwd(),i=e.options.cwd!=null,a=i&&process.chdir!==void 0&&!process.chdir.disabled;if(a)try{process.chdir(e.options.cwd)}catch{}let o;try{o=Sd.sync(e.command,{path:n[xd({env:n})],pathExt:t?Ji.delimiter:void 0})}catch{}finally{a&&process.chdir(r)}return o&&(o=Ji.resolve(i?e.options.cwd:"",o)),o}function _d(e){return eo(e)||eo(e,!0)}var Ad=_d,ii={};const Ur=/([()\][%!^"`<>&|;, *?])/g;function Td(e){return e=e.replace(Ur,"^$1"),e}function Cd(e,t){return e=`${e}`,e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),e=e.replace(/(?=(\\+?)?)\1$/,"$1$1"),e=`"${e}"`,e=e.replace(Ur,"^$1"),t&&(e=e.replace(Ur,"^$1")),e}ii.command=Td;ii.argument=Cd;var Rd=/^#!(.*)/;const Fd=Rd;var $d=(e="")=>{const t=e.match(Fd);if(!t)return null;const[n,r]=t[0].replace(/#! ?/,"").split(" "),i=n.split("/").pop();return i==="env"?r:r?`${i} ${r}`:i};const cr=We.default,Id=$d;function Od(e){const n=Buffer.alloc(150);let r;try{r=cr.openSync(e,"r"),cr.readSync(r,n,0,150,0),cr.closeSync(r)}catch{}return Id(n.toString())}var Nd=Od;const Pd=Se.default,to=Ad,no=ii,Ld=Nd,kd=process.platform==="win32",Dd=/\.(?:com|exe)$/i,Md=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function jd(e){e.file=to(e);const t=e.file&&Ld(e.file);return t?(e.args.unshift(e.file),e.command=t,to(e)):e.file}function Hd(e){if(!kd)return e;const t=jd(e),n=!Dd.test(t);if(e.options.forceShell||n){const r=Md.test(t);e.command=Pd.normalize(e.command),e.command=no.command(e.command),e.args=e.args.map(a=>no.argument(a,r));const i=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${i}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function Bd(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);const r={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?r:Hd(r)}var Ud=Bd;const oi=process.platform==="win32";function ai(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function Gd(e,t){if(!oi)return;const n=e.emit;e.emit=function(r,i){if(r==="exit"){const a=Za(i,t);if(a)return n.call(e,"error",a)}return n.apply(e,arguments)}}function Za(e,t){return oi&&e===1&&!t.file?ai(t.original,"spawn"):null}function qd(e,t){return oi&&e===1&&!t.file?ai(t.original,"spawnSync"):null}var Kd={hookChildProcess:Gd,verifyENOENT:Za,verifyENOENTSync:qd,notFoundError:ai};const Ja=pn.default,si=Ud,ui=Kd;function es(e,t,n){const r=si(e,t,n),i=Ja.spawn(r.command,r.args,r.options);return ui.hookChildProcess(i,r),i}function Wd(e,t,n){const r=si(e,t,n),i=Ja.spawnSync(r.command,r.args,r.options);return i.error=i.error||ui.verifyENOENTSync(i.status,r),i}Ct.exports=es;Ct.exports.spawn=es;Ct.exports.sync=Wd;Ct.exports._parse=si;Ct.exports._enoent=ui;var zd=Ct.exports,Yd=e=>{const t=typeof e=="string"?`
28
+ `:10,n=typeof e=="string"?"\r":13;return e[e.length-1]===t&&(e=e.slice(0,e.length-1)),e[e.length-1]===n&&(e=e.slice(0,e.length-1)),e},ci={exports:{}};ci.exports;(function(e){const t=Se.default,n=Xa,r=i=>{i={cwd:process.cwd(),path:process.env[n()],execPath:process.execPath,...i};let a,o=t.resolve(i.cwd);const s=[];for(;a!==o;)s.push(t.join(o,"node_modules/.bin")),a=o,o=t.resolve(o,"..");const u=t.resolve(i.cwd,i.execPath,"..");return s.push(u),s.concat(i.path).join(t.delimiter)};e.exports=r,e.exports.default=r,e.exports.env=i=>{i={env:process.env,...i};const a={...i.env},o=n({env:a});return i.path=a[o],a[o]=e.exports(i),a}})(ci);var Qd=ci.exports,qn={exports:{}},li={exports:{}};const ts=(e,t)=>{for(const n of Reflect.ownKeys(t))Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n));return e};li.exports=ts;li.exports.default=ts;var Vd=li.exports;const Xd=Vd,xn=new WeakMap,ns=(e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let n,r=0;const i=e.displayName||e.name||"<anonymous>",a=function(...o){if(xn.set(a,++r),r===1)n=e.apply(this,o),e=null;else if(t.throw===!0)throw new Error(`Function \`${i}\` can only be called once`);return n};return Xd(a,e),xn.set(a,r),a};qn.exports=ns;qn.exports.default=ns;qn.exports.callCount=e=>{if(!xn.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return xn.get(e)};var Zd=qn.exports,St={},Kn={},Wn={};Object.defineProperty(Wn,"__esModule",{value:!0});Wn.SIGNALS=void 0;const Jd=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];Wn.SIGNALS=Jd;var nt={};Object.defineProperty(nt,"__esModule",{value:!0});nt.SIGRTMAX=nt.getRealtimeSignals=void 0;const eh=function(){const e=is-rs+1;return Array.from({length:e},th)};nt.getRealtimeSignals=eh;const th=function(e,t){return{name:`SIGRT${t+1}`,number:rs+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}},rs=34,is=64;nt.SIGRTMAX=is;Object.defineProperty(Kn,"__esModule",{value:!0});Kn.getSignals=void 0;var nh=kn.default,rh=Wn,ih=nt;const oh=function(){const e=(0,ih.getRealtimeSignals)();return[...rh.SIGNALS,...e].map(ah)};Kn.getSignals=oh;const ah=function({name:e,number:t,description:n,action:r,forced:i=!1,standard:a}){const{signals:{[e]:o}}=nh.constants,s=o!==void 0;return{name:e,number:s?o:t,description:n,supported:s,action:r,forced:i,standard:a}};Object.defineProperty(St,"__esModule",{value:!0});St.signalsByNumber=St.signalsByName=void 0;var sh=kn.default,os=Kn,uh=nt;const ch=function(){return(0,os.getSignals)().reduce(lh,{})},lh=function(e,{name:t,number:n,description:r,supported:i,action:a,forced:o,standard:s}){return{...e,[t]:{name:t,number:n,description:r,supported:i,action:a,forced:o,standard:s}}},fh=ch();St.signalsByName=fh;const ph=function(){const e=(0,os.getSignals)(),t=uh.SIGRTMAX+1,n=Array.from({length:t},(r,i)=>dh(i,e));return Object.assign({},...n)},dh=function(e,t){const n=hh(e,t);if(n===void 0)return{};const{name:r,description:i,supported:a,action:o,forced:s,standard:u}=n;return{[e]:{name:r,number:e,description:i,supported:a,action:o,forced:s,standard:u}}},hh=function(e,t){const n=t.find(({name:r})=>sh.constants.signals[r]===e);return n!==void 0?n:t.find(r=>r.number===e)},mh=ph();St.signalsByNumber=mh;const{signalsByName:gh}=St,yh=({timedOut:e,timeout:t,errorCode:n,signal:r,signalDescription:i,exitCode:a,isCanceled:o})=>e?`timed out after ${t} milliseconds`:o?"was canceled":n!==void 0?`failed with ${n}`:r!==void 0?`was killed with ${r} (${i})`:a!==void 0?`failed with exit code ${a}`:"failed",vh=({stdout:e,stderr:t,all:n,error:r,signal:i,exitCode:a,command:o,escapedCommand:s,timedOut:u,isCanceled:f,killed:c,parsed:{options:{timeout:l}}})=>{a=a===null?void 0:a,i=i===null?void 0:i;const p=i===void 0?void 0:gh[i].description,d=r&&r.code,m=`Command ${yh({timedOut:u,timeout:l,errorCode:d,signal:i,signalDescription:p,exitCode:a,isCanceled:f})}: ${o}`,g=Object.prototype.toString.call(r)==="[object Error]",w=g?`${m}
29
+ ${r.message}`:m,S=[w,t,e].filter(Boolean).join(`
30
+ `);return g?(r.originalMessage=r.message,r.message=S):r=new Error(S),r.shortMessage=w,r.command=o,r.escapedCommand=s,r.exitCode=a,r.signal=i,r.signalDescription=p,r.stdout=e,r.stderr=t,n!==void 0&&(r.all=n),"bufferedData"in r&&delete r.bufferedData,r.failed=!0,r.timedOut=!!u,r.isCanceled=f,r.killed=c&&!u,r};var wh=vh,fi={exports:{}};const sn=["stdin","stdout","stderr"],Eh=e=>sn.some(t=>e[t]!==void 0),as=e=>{if(!e)return;const{stdio:t}=e;if(t===void 0)return sn.map(r=>e[r]);if(Eh(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${sn.map(r=>`\`${r}\``).join(", ")}`);if(typeof t=="string")return t;if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);const n=Math.max(t.length,sn.length);return Array.from({length:n},(r,i)=>t[i])};fi.exports=as;fi.exports.node=e=>{const t=as(e);return t==="ipc"?"ipc":t===void 0||typeof t=="string"?[t,t,t,"ipc"]:t.includes("ipc")?t:[...t,"ipc"]};var bh=fi.exports,ht={exports:{}},lr={exports:{}},ro;function Sh(){return ro||(ro=1,(function(e){e.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"],process.platform!=="win32"&&e.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),process.platform==="linux"&&e.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")})(lr)),lr.exports}var te=Ee.process;const ze=function(e){return e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function"};if(!ze(te))ht.exports=function(){return function(){}};else{var xh=ca.default,Ft=Sh(),_h=/^win/i.test(te.platform),en=uc.default;typeof en!="function"&&(en=en.EventEmitter);var fe;te.__signal_exit_emitter__?fe=te.__signal_exit_emitter__:(fe=te.__signal_exit_emitter__=new en,fe.count=0,fe.emitted={}),fe.infinite||(fe.setMaxListeners(1/0),fe.infinite=!0),ht.exports=function(e,t){if(!ze(Ee.process))return function(){};xh.equal(typeof e,"function","a callback must be provided for exit handler"),$t===!1&&io();var n="exit";t&&t.alwaysLast&&(n="afterexit");var r=function(){fe.removeListener(n,e),fe.listeners("exit").length===0&&fe.listeners("afterexit").length===0&&fr()};return fe.on(n,e),r};var fr=function(){!$t||!ze(Ee.process)||($t=!1,Ft.forEach(function(t){try{te.removeListener(t,pr[t])}catch{}}),te.emit=dr,te.reallyExit=oo,fe.count-=1)};ht.exports.unload=fr;var ut=function(t,n,r){fe.emitted[t]||(fe.emitted[t]=!0,fe.emit(t,n,r))},pr={};Ft.forEach(function(e){pr[e]=function(){if(ze(Ee.process)){var n=te.listeners(e);n.length===fe.count&&(fr(),ut("exit",null,e),ut("afterexit",null,e),_h&&e==="SIGHUP"&&(e="SIGINT"),te.kill(te.pid,e))}}}),ht.exports.signals=function(){return Ft};var $t=!1,io=function(){$t||!ze(Ee.process)||($t=!0,fe.count+=1,Ft=Ft.filter(function(t){try{return te.on(t,pr[t]),!0}catch{return!1}}),te.emit=Th,te.reallyExit=Ah)};ht.exports.load=io;var oo=te.reallyExit,Ah=function(t){ze(Ee.process)&&(te.exitCode=t||0,ut("exit",te.exitCode,null),ut("afterexit",te.exitCode,null),oo.call(te,te.exitCode))},dr=te.emit,Th=function(t,n){if(t==="exit"&&ze(Ee.process)){n!==void 0&&(te.exitCode=n);var r=dr.apply(this,arguments);return ut("exit",te.exitCode,null),ut("afterexit",te.exitCode,null),r}else return dr.apply(this,arguments)}}var Ch=ht.exports;const Rh=kn.default,Fh=Ch,$h=1e3*5,Ih=(e,t="SIGTERM",n={})=>{const r=e(t);return Oh(e,t,n,r),r},Oh=(e,t,n,r)=>{if(!Nh(t,n,r))return;const i=Lh(n),a=setTimeout(()=>{e("SIGKILL")},i);a.unref&&a.unref()},Nh=(e,{forceKillAfterTimeout:t},n)=>Ph(e)&&t!==!1&&n,Ph=e=>e===Rh.constants.signals.SIGTERM||typeof e=="string"&&e.toUpperCase()==="SIGTERM",Lh=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return $h;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},kh=(e,t)=>{e.kill()&&(t.isCanceled=!0)},Dh=(e,t,n)=>{e.kill(t),n(Object.assign(new Error("Timed out"),{timedOut:!0,signal:t}))},Mh=(e,{timeout:t,killSignal:n="SIGTERM"},r)=>{if(t===0||t===void 0)return r;let i;const a=new Promise((s,u)=>{i=setTimeout(()=>{Dh(e,n,u)},t)}),o=r.finally(()=>{clearTimeout(i)});return Promise.race([a,o])},jh=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},Hh=async(e,{cleanup:t,detached:n},r)=>{if(!t||n)return r;const i=Fh(()=>{e.kill()});return r.finally(()=>{i()})};var Bh={spawnedKill:Ih,spawnedCancel:kh,setupTimeout:Mh,validateTimeout:jh,setExitHandler:Hh};const ke=e=>e!==null&&typeof e=="object"&&typeof e.pipe=="function";ke.writable=e=>ke(e)&&e.writable!==!1&&typeof e._write=="function"&&typeof e._writableState=="object";ke.readable=e=>ke(e)&&e.readable!==!1&&typeof e._read=="function"&&typeof e._readableState=="object";ke.duplex=e=>ke.writable(e)&&ke.readable(e);ke.transform=e=>ke.duplex(e)&&typeof e._transform=="function";var Uh=ke,Ut={exports:{}};const{PassThrough:Gh}=Dn.default;var qh=e=>{e={...e};const{array:t}=e;let{encoding:n}=e;const r=n==="buffer";let i=!1;t?i=!(n||r):n=n||"utf8",r&&(n=null);const a=new Gh({objectMode:i});n&&a.setEncoding(n);let o=0;const s=[];return a.on("data",u=>{s.push(u),i?o=s.length:o+=u.length}),a.getBufferedValue=()=>t?s:r?Buffer.concat(s,o):s.join(""),a.getBufferedLength=()=>o,a};const{constants:Kh}=cc.default,Wh=Dn.default,{promisify:zh}=it.default,Yh=qh,Qh=zh(Wh.pipeline);class ss extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}}async function pi(e,t){if(!e)throw new Error("Expected a stream");t={maxBuffer:1/0,...t};const{maxBuffer:n}=t,r=Yh(t);return await new Promise((i,a)=>{const o=s=>{s&&r.getBufferedLength()<=Kh.MAX_LENGTH&&(s.bufferedData=r.getBufferedValue()),a(s)};(async()=>{try{await Qh(e,r),i()}catch(s){o(s)}})(),r.on("data",()=>{r.getBufferedLength()>n&&o(new ss)})}),r.getBufferedValue()}Ut.exports=pi;Ut.exports.buffer=(e,t)=>pi(e,{...t,encoding:"buffer"});Ut.exports.array=(e,t)=>pi(e,{...t,array:!0});Ut.exports.MaxBufferError=ss;var Vh=Ut.exports;const{PassThrough:Xh}=Dn.default;var Zh=function(){var e=[],t=new Xh({objectMode:!0});return t.setMaxListeners(0),t.add=n,t.isEmpty=r,t.on("unpipe",i),Array.prototype.slice.call(arguments).forEach(n),t;function n(a){return Array.isArray(a)?(a.forEach(n),this):(e.push(a),a.once("end",i.bind(null,a)),a.once("error",t.emit.bind(t,"error")),a.pipe(t,{end:!1}),this)}function r(){return e.length==0}function i(a){e=e.filter(function(o){return o!==a}),!e.length&&t.readable&&t.end()}};const us=Uh,ao=Vh,Jh=Zh,em=(e,t)=>{t===void 0||e.stdin===void 0||(us(t)?t.pipe(e.stdin):e.stdin.end(t))},tm=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;const n=Jh();return e.stdout&&n.add(e.stdout),e.stderr&&n.add(e.stderr),n},hr=async(e,t)=>{if(e){e.destroy();try{return await t}catch(n){return n.bufferedData}}},mr=(e,{encoding:t,buffer:n,maxBuffer:r})=>{if(!(!e||!n))return t?ao(e,{encoding:t,maxBuffer:r}):ao.buffer(e,{maxBuffer:r})},nm=async({stdout:e,stderr:t,all:n},{encoding:r,buffer:i,maxBuffer:a},o)=>{const s=mr(e,{encoding:r,buffer:i,maxBuffer:a}),u=mr(t,{encoding:r,buffer:i,maxBuffer:a}),f=mr(n,{encoding:r,buffer:i,maxBuffer:a*2});try{return await Promise.all([o,s,u,f])}catch(c){return Promise.all([{error:c,signal:c.signal,timedOut:c.timedOut},hr(e,s),hr(t,u),hr(n,f)])}},rm=({input:e})=>{if(us(e))throw new TypeError("The `input` option cannot be a stream in sync mode")};var im={handleInput:em,makeAllStream:tm,getSpawnedResult:nm,validateInputSync:rm};const om=(async()=>{})().constructor.prototype,am=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(om,e)]),sm=(e,t)=>{for(const[n,r]of am){const i=typeof t=="function"?(...a)=>Reflect.apply(r.value,t(),a):r.value.bind(t);Reflect.defineProperty(e,n,{...r,value:i})}return e},um=e=>new Promise((t,n)=>{e.on("exit",(r,i)=>{t({exitCode:r,signal:i})}),e.on("error",r=>{n(r)}),e.stdin&&e.stdin.on("error",r=>{n(r)})});var cm={mergePromise:sm,getSpawnedPromise:um};const cs=(e,t=[])=>Array.isArray(t)?[e,...t]:[e],lm=/^[\w.-]+$/,fm=/"/g,pm=e=>typeof e!="string"||lm.test(e)?e:`"${e.replace(fm,'\\"')}"`,dm=(e,t)=>cs(e,t).join(" "),hm=(e,t)=>cs(e,t).map(n=>pm(n)).join(" "),mm=/ +/g,gm=e=>{const t=[];for(const n of e.trim().split(mm)){const r=t[t.length-1];r&&r.endsWith("\\")?t[t.length-1]=`${r.slice(0,-1)} ${n}`:t.push(n)}return t};var ym={joinCommand:dm,getEscapedCommand:hm,parseCommand:gm};const vm=Se.default,Gr=pn.default,wm=zd,Em=Yd,bm=Qd,Sm=Zd,_n=wh,ls=bh,{spawnedKill:xm,spawnedCancel:_m,setupTimeout:Am,validateTimeout:Tm,setExitHandler:Cm}=Bh,{handleInput:Rm,getSpawnedResult:Fm,makeAllStream:$m,validateInputSync:Im}=im,{mergePromise:so,getSpawnedPromise:Om}=cm,{joinCommand:fs,parseCommand:ps,getEscapedCommand:ds}=ym,Nm=1e3*1e3*100,Pm=({env:e,extendEnv:t,preferLocal:n,localDir:r,execPath:i})=>{const a=t?{...process.env,...e}:e;return n?bm.env({env:a,cwd:r,execPath:i}):a},hs=(e,t,n={})=>{const r=wm._parse(e,t,n);return e=r.command,t=r.args,n=r.options,n={maxBuffer:Nm,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:n.cwd||process.cwd(),execPath:process.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,...n},n.env=Pm(n),n.stdio=ls(n),process.platform==="win32"&&vm.basename(e,".exe")==="cmd"&&t.unshift("/q"),{file:e,args:t,options:n,parsed:r}},Nt=(e,t,n)=>typeof t!="string"&&!Buffer.isBuffer(t)?n===void 0?void 0:"":e.stripFinalNewline?Em(t):t,zn=(e,t,n)=>{const r=hs(e,t,n),i=fs(e,t),a=ds(e,t);Tm(r.options);let o;try{o=Gr.spawn(r.file,r.args,r.options)}catch(d){const h=new Gr.ChildProcess,m=Promise.reject(_n({error:d,stdout:"",stderr:"",all:"",command:i,escapedCommand:a,parsed:r,timedOut:!1,isCanceled:!1,killed:!1}));return so(h,m)}const s=Om(o),u=Am(o,r.options,s),f=Cm(o,r.options,u),c={isCanceled:!1};o.kill=xm.bind(null,o.kill.bind(o)),o.cancel=_m.bind(null,o,c);const p=Sm(async()=>{const[{error:d,exitCode:h,signal:m,timedOut:g},w,S,x]=await Fm(o,r.options,f),R=Nt(r.options,w),T=Nt(r.options,S),O=Nt(r.options,x);if(d||h!==0||m!==null){const M=_n({error:d,exitCode:h,signal:m,stdout:R,stderr:T,all:O,command:i,escapedCommand:a,parsed:r,timedOut:g,isCanceled:c.isCanceled,killed:o.killed});if(!r.options.reject)return M;throw M}return{command:i,escapedCommand:a,exitCode:0,stdout:R,stderr:T,all:O,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return Rm(o,r.options.input),o.all=$m(o,r.options),so(o,p)};Bt.exports=zn;Bt.exports.sync=(e,t,n)=>{const r=hs(e,t,n),i=fs(e,t),a=ds(e,t);Im(r.options);let o;try{o=Gr.spawnSync(r.file,r.args,r.options)}catch(f){throw _n({error:f,stdout:"",stderr:"",all:"",command:i,escapedCommand:a,parsed:r,timedOut:!1,isCanceled:!1,killed:!1})}const s=Nt(r.options,o.stdout,o.error),u=Nt(r.options,o.stderr,o.error);if(o.error||o.status!==0||o.signal!==null){const f=_n({stdout:s,stderr:u,error:o.error,signal:o.signal,exitCode:o.status,command:i,escapedCommand:a,parsed:r,timedOut:o.error&&o.error.code==="ETIMEDOUT",isCanceled:!1,killed:o.signal!==null});if(!r.options.reject)return f;throw f}return{command:i,escapedCommand:a,exitCode:0,stdout:s,stderr:u,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}};Bt.exports.command=(e,t)=>{const[n,...r]=ps(e);return zn(n,r,t)};Bt.exports.commandSync=(e,t)=>{const[n,...r]=ps(e);return zn.sync(n,r,t)};Bt.exports.node=(e,t,n={})=>{t&&!Array.isArray(t)&&typeof t=="object"&&(n=t,t=[]);const r=ls.node(n),i=process.execArgv.filter(s=>!s.startsWith("--inspect")),{nodePath:a=process.execPath,nodeOptions:o=i}=n;return zn(a,[...o,e,...Array.isArray(t)?t:[]],{...n,stdin:void 0,stdout:void 0,stderr:void 0,stdio:r,shell:!1})};var Ae={},Yn={exports:{}},ms={exports:{}},di={exports:{}},hi={exports:{}},mi={exports:{}},gi={exports:{}};const gs=(e,...t)=>new Promise(n=>{n(e(...t))});gi.exports=gs;gi.exports.default=gs;var Lm=gi.exports;const km=Lm,ys=e=>{if(!((Number.isInteger(e)||e===1/0)&&e>0))return Promise.reject(new TypeError("Expected `concurrency` to be a number from 1 and up"));const t=[];let n=0;const r=()=>{n--,t.length>0&&t.shift()()},i=(s,u,...f)=>{n++;const c=km(s,...f);u(c),c.then(r,r)},a=(s,u,...f)=>{n<e?i(s,u,...f):t.push(i.bind(null,s,u,...f))},o=(s,...u)=>new Promise(f=>a(s,f,...u));return Object.defineProperties(o,{activeCount:{get:()=>n},pendingCount:{get:()=>t.length},clearQueue:{value:()=>{t.length=0}}}),o};mi.exports=ys;mi.exports.default=ys;var Dm=mi.exports;const uo=Dm;let vs=class extends Error{constructor(t){super(),this.value=t}};const Mm=async(e,t)=>t(await e),jm=async e=>{const t=await Promise.all(e);if(t[1]===!0)throw new vs(t[0]);return!1},ws=async(e,t,n)=>{n={concurrency:1/0,preserveOrder:!0,...n};const r=uo(n.concurrency),i=[...e].map(o=>[o,r(Mm,o,t)]),a=uo(n.preserveOrder?1:1/0);try{await Promise.all(i.map(o=>a(jm,o)))}catch(o){if(o instanceof vs)return o.value;throw o}};hi.exports=ws;hi.exports.default=ws;var Hm=hi.exports;const Es=Se.default,An=We.default,{promisify:bs}=it.default,Bm=Hm,Um=bs(An.stat),Gm=bs(An.lstat),Ss={directory:"isDirectory",file:"isFile"};function xs({type:e}){if(!(e in Ss))throw new Error(`Invalid type specified: ${e}`)}const _s=(e,t)=>e===void 0||t[Ss[e]]();di.exports=async(e,t)=>{t={cwd:process.cwd(),type:"file",allowSymlinks:!0,...t},xs(t);const n=t.allowSymlinks?Um:Gm;return Bm(e,async r=>{try{const i=await n(Es.resolve(t.cwd,r));return _s(t.type,i)}catch{return!1}},t)};di.exports.sync=(e,t)=>{t={cwd:process.cwd(),allowSymlinks:!0,type:"file",...t},xs(t);const n=t.allowSymlinks?An.statSync:An.lstatSync;for(const r of e)try{const i=n(Es.resolve(t.cwd,r));if(_s(t.type,i))return r}catch{}};var qm=di.exports,yi={exports:{}};const As=We.default,{promisify:Km}=it.default,Wm=Km(As.access);yi.exports=async e=>{try{return await Wm(e),!0}catch{return!1}};yi.exports.sync=e=>{try{return As.accessSync(e),!0}catch{return!1}};var Ts=yi.exports;(function(e){const t=Se.default,n=qm,r=Ts,i=Symbol("findUp.stop");e.exports=async(a,o={})=>{let s=t.resolve(o.cwd||"");const{root:u}=t.parse(s),f=[].concat(a),c=async l=>{if(typeof a!="function")return n(f,l);const p=await a(l.cwd);return typeof p=="string"?n([p],l):p};for(;;){const l=await c({...o,cwd:s});if(l===i)return;if(l)return t.resolve(s,l);if(s===u)return;s=t.dirname(s)}},e.exports.sync=(a,o={})=>{let s=t.resolve(o.cwd||"");const{root:u}=t.parse(s),f=[].concat(a),c=l=>{if(typeof a!="function")return n.sync(f,l);const p=a(l.cwd);return typeof p=="string"?n.sync([p],l):p};for(;;){const l=c({...o,cwd:s});if(l===i)return;if(l)return t.resolve(s,l);if(s===u)return;s=t.dirname(s)}},e.exports.exists=r,e.exports.sync.exists=r.sync,e.exports.stop=i})(ms);var zm=ms.exports;const Cs=Se.default,Rs=zm,Fs=async e=>{const t=await Rs("package.json",{cwd:e});return t&&Cs.dirname(t)};Yn.exports=Fs;Yn.exports.default=Fs;Yn.exports.sync=e=>{const t=Rs.sync("package.json",{cwd:e});return t&&Cs.dirname(t)};var Ym=Yn.exports,Qn={};(function(e){e.isInteger=t=>typeof t=="number"?Number.isInteger(t):typeof t=="string"&&t.trim()!==""?Number.isInteger(Number(t)):!1,e.find=(t,n)=>t.nodes.find(r=>r.type===n),e.exceedsLimit=(t,n,r=1,i)=>i===!1||!e.isInteger(t)||!e.isInteger(n)?!1:(Number(n)-Number(t))/Number(r)>=i,e.escapeNode=(t,n=0,r)=>{const i=t.nodes[n];i&&(r&&i.type===r||i.type==="open"||i.type==="close")&&i.escaped!==!0&&(i.value="\\"+i.value,i.escaped=!0)},e.encloseBrace=t=>t.type!=="brace"?!1:t.commas>>0+t.ranges>>0===0?(t.invalid=!0,!0):!1,e.isInvalidBrace=t=>t.type!=="brace"?!1:t.invalid===!0||t.dollar?!0:t.commas>>0+t.ranges>>0===0||t.open!==!0||t.close!==!0?(t.invalid=!0,!0):!1,e.isOpenOrClose=t=>t.type==="open"||t.type==="close"?!0:t.open===!0||t.close===!0,e.reduce=t=>t.reduce((n,r)=>(r.type==="text"&&n.push(r.value),r.type==="range"&&(r.type="text"),n),[]),e.flatten=(...t)=>{const n=[],r=i=>{for(let a=0;a<i.length;a++){const o=i[a];if(Array.isArray(o)){r(o);continue}o!==void 0&&n.push(o)}return n};return r(t),n}})(Qn);const co=Qn;var vi=(e,t={})=>{const n=(r,i={})=>{const a=t.escapeInvalid&&co.isInvalidBrace(i),o=r.invalid===!0&&t.escapeInvalid===!0;let s="";if(r.value)return(a||o)&&co.isOpenOrClose(r)?"\\"+r.value:r.value;if(r.value)return r.value;if(r.nodes)for(const u of r.nodes)s+=n(u);return s};return n(e)};/*!
31
31
  * is-number <https://github.com/jonschlinkert/is-number>
32
32
  *
33
33
  * Copyright (c) 2014-present, Jon Schlinkert.
34
34
  * Released under the MIT License.
35
- */var Ym=function(e){return typeof e=="number"?e-e===0:typeof e=="string"&&e.trim()!==""?Number.isFinite?Number.isFinite(+e):isFinite(+e):!1};/*!
35
+ */var Qm=function(e){return typeof e=="number"?e-e===0:typeof e=="string"&&e.trim()!==""?Number.isFinite?Number.isFinite(+e):isFinite(+e):!1};/*!
36
36
  * to-regex-range <https://github.com/micromatch/to-regex-range>
37
37
  *
38
38
  * Copyright (c) 2015-present, Jon Schlinkert.
39
39
  * Released under the MIT License.
40
- */const co=Ym,Ze=(e,t,n)=>{if(co(e)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(t===void 0||e===t)return String(e);if(co(t)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let r={relaxZeros:!0,...n};typeof r.strictZeros=="boolean"&&(r.relaxZeros=r.strictZeros===!1);let i=String(r.relaxZeros),a=String(r.shorthand),o=String(r.capture),s=String(r.wrap),u=e+":"+t+"="+i+a+o+s;if(Ze.cache.hasOwnProperty(u))return Ze.cache[u].result;let f=Math.min(e,t),c=Math.max(e,t);if(Math.abs(f-c)===1){let m=e+"|"+t;return r.capture?`(${m})`:r.wrap===!1?m:`(?:${m})`}let l=go(e)||go(t),p={min:e,max:t,a:f,b:c},d=[],h=[];if(l&&(p.isPadded=l,p.maxLen=String(p.max).length),f<0){let m=c<0?Math.abs(c):1;h=lo(m,Math.abs(f),p,r),f=p.a=0}return c>=0&&(d=lo(f,c,p,r)),p.negatives=h,p.positives=d,p.result=Qm(h,d),r.capture===!0?p.result=`(${p.result})`:r.wrap!==!1&&d.length+h.length>1&&(p.result=`(?:${p.result})`),Ze.cache[u]=p,p.result};function Qm(e,t,n){let r=mr(e,t,"-",!1)||[],i=mr(t,e,"",!1)||[],a=mr(e,t,"-?",!0)||[];return r.concat(a).concat(i).join("|")}function Vm(e,t){let n=1,r=1,i=po(e,n),a=new Set([t]);for(;e<=i&&i<=t;)a.add(i),n+=1,i=po(e,n);for(i=ho(t+1,r)-1;e<i&&i<=t;)a.add(i),r+=1,i=ho(t+1,r)-1;return a=[...a],a.sort(Jm),a}function Xm(e,t,n){if(e===t)return{pattern:e,count:[],digits:0};let r=Zm(e,t),i=r.length,a="",o=0;for(let s=0;s<i;s++){let[u,f]=r[s];u===f?a+=u:u!=="0"||f!=="9"?a+=eg(u,f):o++}return o&&(a+=n.shorthand===!0?"\\d":"[0-9]"),{pattern:a,count:[o],digits:i}}function lo(e,t,n,r){let i=Vm(e,t),a=[],o=e,s;for(let u=0;u<i.length;u++){let f=i[u],c=Xm(String(o),String(f),r),l="";if(!n.isPadded&&s&&s.pattern===c.pattern){s.count.length>1&&s.count.pop(),s.count.push(c.count[0]),s.string=s.pattern+mo(s.count),o=f+1;continue}n.isPadded&&(l=tg(f,n,r)),c.string=l+c.pattern+mo(c.count),a.push(c),o=f+1,s=c}return a}function mr(e,t,n,r,i){let a=[];for(let o of e){let{string:s}=o;!r&&!fo(t,"string",s)&&a.push(n+s),r&&fo(t,"string",s)&&a.push(n+s)}return a}function Zm(e,t){let n=[];for(let r=0;r<e.length;r++)n.push([e[r],t[r]]);return n}function Jm(e,t){return e>t?1:t>e?-1:0}function fo(e,t,n){return e.some(r=>r[t]===n)}function po(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function ho(e,t){return e-e%Math.pow(10,t)}function mo(e){let[t=0,n=""]=e;return n||t>1?`{${t+(n?","+n:"")}}`:""}function eg(e,t,n){return`[${e}${t-e===1?"":"-"}${t}]`}function go(e){return/^-?(0+)\d/.test(e)}function tg(e,t,n){if(!t.isPadded)return e;let r=Math.abs(t.maxLen-String(e).length),i=n.relaxZeros!==!1;switch(r){case 0:return"";case 1:return i?"0?":"0";case 2:return i?"0{0,2}":"00";default:return i?`0{0,${r}}`:`0{${r}}`}}Ze.cache={};Ze.clearCache=()=>Ze.cache={};var ng=Ze;/*!
40
+ */const lo=Qm,Ze=(e,t,n)=>{if(lo(e)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(t===void 0||e===t)return String(e);if(lo(t)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let r={relaxZeros:!0,...n};typeof r.strictZeros=="boolean"&&(r.relaxZeros=r.strictZeros===!1);let i=String(r.relaxZeros),a=String(r.shorthand),o=String(r.capture),s=String(r.wrap),u=e+":"+t+"="+i+a+o+s;if(Ze.cache.hasOwnProperty(u))return Ze.cache[u].result;let f=Math.min(e,t),c=Math.max(e,t);if(Math.abs(f-c)===1){let m=e+"|"+t;return r.capture?`(${m})`:r.wrap===!1?m:`(?:${m})`}let l=yo(e)||yo(t),p={min:e,max:t,a:f,b:c},d=[],h=[];if(l&&(p.isPadded=l,p.maxLen=String(p.max).length),f<0){let m=c<0?Math.abs(c):1;h=fo(m,Math.abs(f),p,r),f=p.a=0}return c>=0&&(d=fo(f,c,p,r)),p.negatives=h,p.positives=d,p.result=Vm(h,d),r.capture===!0?p.result=`(${p.result})`:r.wrap!==!1&&d.length+h.length>1&&(p.result=`(?:${p.result})`),Ze.cache[u]=p,p.result};function Vm(e,t,n){let r=gr(e,t,"-",!1)||[],i=gr(t,e,"",!1)||[],a=gr(e,t,"-?",!0)||[];return r.concat(a).concat(i).join("|")}function Xm(e,t){let n=1,r=1,i=ho(e,n),a=new Set([t]);for(;e<=i&&i<=t;)a.add(i),n+=1,i=ho(e,n);for(i=mo(t+1,r)-1;e<i&&i<=t;)a.add(i),r+=1,i=mo(t+1,r)-1;return a=[...a],a.sort(eg),a}function Zm(e,t,n){if(e===t)return{pattern:e,count:[],digits:0};let r=Jm(e,t),i=r.length,a="",o=0;for(let s=0;s<i;s++){let[u,f]=r[s];u===f?a+=u:u!=="0"||f!=="9"?a+=tg(u,f):o++}return o&&(a+=n.shorthand===!0?"\\d":"[0-9]"),{pattern:a,count:[o],digits:i}}function fo(e,t,n,r){let i=Xm(e,t),a=[],o=e,s;for(let u=0;u<i.length;u++){let f=i[u],c=Zm(String(o),String(f),r),l="";if(!n.isPadded&&s&&s.pattern===c.pattern){s.count.length>1&&s.count.pop(),s.count.push(c.count[0]),s.string=s.pattern+go(s.count),o=f+1;continue}n.isPadded&&(l=ng(f,n,r)),c.string=l+c.pattern+go(c.count),a.push(c),o=f+1,s=c}return a}function gr(e,t,n,r,i){let a=[];for(let o of e){let{string:s}=o;!r&&!po(t,"string",s)&&a.push(n+s),r&&po(t,"string",s)&&a.push(n+s)}return a}function Jm(e,t){let n=[];for(let r=0;r<e.length;r++)n.push([e[r],t[r]]);return n}function eg(e,t){return e>t?1:t>e?-1:0}function po(e,t,n){return e.some(r=>r[t]===n)}function ho(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function mo(e,t){return e-e%Math.pow(10,t)}function go(e){let[t=0,n=""]=e;return n||t>1?`{${t+(n?","+n:"")}}`:""}function tg(e,t,n){return`[${e}${t-e===1?"":"-"}${t}]`}function yo(e){return/^-?(0+)\d/.test(e)}function ng(e,t,n){if(!t.isPadded)return e;let r=Math.abs(t.maxLen-String(e).length),i=n.relaxZeros!==!1;switch(r){case 0:return"";case 1:return i?"0?":"0";case 2:return i?"0{0,2}":"00";default:return i?`0{0,${r}}`:`0{${r}}`}}Ze.cache={};Ze.clearCache=()=>Ze.cache={};var rg=Ze;/*!
41
41
  * fill-range <https://github.com/jonschlinkert/fill-range>
42
42
  *
43
43
  * Copyright (c) 2014-present, Jon Schlinkert.
44
44
  * Licensed under the MIT License.
45
- */const rg=it.default,Fs=ng,yo=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),ig=e=>t=>e===!0?Number(t):String(t),gr=e=>typeof e=="number"||typeof e=="string"&&e!=="",Pt=e=>Number.isInteger(+e),yr=e=>{let t=`${e}`,n=-1;if(t[0]==="-"&&(t=t.slice(1)),t==="0")return!1;for(;t[++n]==="0";);return n>0},og=(e,t,n)=>typeof e=="string"||typeof t=="string"?!0:n.stringify===!0,ag=(e,t,n)=>{if(t>0){let r=e[0]==="-"?"-":"";r&&(e=e.slice(1)),e=r+e.padStart(r?t-1:t,"0")}return n===!1?String(e):e},An=(e,t)=>{let n=e[0]==="-"?"-":"";for(n&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return n?"-"+e:e},sg=(e,t,n)=>{e.negatives.sort((s,u)=>s<u?-1:s>u?1:0),e.positives.sort((s,u)=>s<u?-1:s>u?1:0);let r=t.capture?"":"?:",i="",a="",o;return e.positives.length&&(i=e.positives.map(s=>An(String(s),n)).join("|")),e.negatives.length&&(a=`-(${r}${e.negatives.map(s=>An(String(s),n)).join("|")})`),i&&a?o=`${i}|${a}`:o=i||a,t.wrap?`(${r}${o})`:o},$s=(e,t,n,r)=>{if(n)return Fs(e,t,{wrap:!1,...r});let i=String.fromCharCode(e);if(e===t)return i;let a=String.fromCharCode(t);return`[${i}-${a}]`},Is=(e,t,n)=>{if(Array.isArray(e)){let r=n.wrap===!0,i=n.capture?"":"?:";return r?`(${i}${e.join("|")})`:e.join("|")}return Fs(e,t,n)},Os=(...e)=>new RangeError("Invalid range arguments: "+rg.inspect(...e)),Ns=(e,t,n)=>{if(n.strictRanges===!0)throw Os([e,t]);return[]},ug=(e,t)=>{if(t.strictRanges===!0)throw new TypeError(`Expected step "${e}" to be a number`);return[]},cg=(e,t,n=1,r={})=>{let i=Number(e),a=Number(t);if(!Number.isInteger(i)||!Number.isInteger(a)){if(r.strictRanges===!0)throw Os([e,t]);return[]}i===0&&(i=0),a===0&&(a=0);let o=i>a,s=String(e),u=String(t),f=String(n);n=Math.max(Math.abs(n),1);let c=yr(s)||yr(u)||yr(f),l=c?Math.max(s.length,u.length,f.length):0,p=c===!1&&og(e,t,r)===!1,d=r.transform||ig(p);if(r.toRegex&&n===1)return $s(An(e,l),An(t,l),!0,r);let h={negatives:[],positives:[]},m=S=>h[S<0?"negatives":"positives"].push(Math.abs(S)),g=[],E=0;for(;o?i>=a:i<=a;)r.toRegex===!0&&n>1?m(i):g.push(ag(d(i,E),l,p)),i=o?i-n:i+n,E++;return r.toRegex===!0?n>1?sg(h,r,l):Is(g,null,{wrap:!1,...r}):g},lg=(e,t,n=1,r={})=>{if(!Pt(e)&&e.length>1||!Pt(t)&&t.length>1)return Ns(e,t,r);let i=r.transform||(p=>String.fromCharCode(p)),a=`${e}`.charCodeAt(0),o=`${t}`.charCodeAt(0),s=a>o,u=Math.min(a,o),f=Math.max(a,o);if(r.toRegex&&n===1)return $s(u,f,!1,r);let c=[],l=0;for(;s?a>=o:a<=o;)c.push(i(a,l)),a=s?a-n:a+n,l++;return r.toRegex===!0?Is(c,null,{wrap:!1,options:r}):c},sn=(e,t,n,r={})=>{if(t==null&&gr(e))return[e];if(!gr(e)||!gr(t))return Ns(e,t,r);if(typeof n=="function")return sn(e,t,1,{transform:n});if(yo(n))return sn(e,t,0,n);let i={...r};return i.capture===!0&&(i.wrap=!0),n=n||i.step||1,Pt(n)?Pt(e)&&Pt(t)?cg(e,t,n,i):lg(e,t,Math.max(Math.abs(n),1),i):n!=null&&!yo(n)?ug(n,i):sn(e,t,1,n)};var Ps=sn;const fg=Ps,vo=Yn,pg=(e,t={})=>{const n=(r,i={})=>{const a=vo.isInvalidBrace(i),o=r.invalid===!0&&t.escapeInvalid===!0,s=a===!0||o===!0,u=t.escapeInvalid===!0?"\\":"";let f="";if(r.isOpen===!0)return u+r.value;if(r.isClose===!0)return console.log("node.isClose",u,r.value),u+r.value;if(r.type==="open")return s?u+r.value:"(";if(r.type==="close")return s?u+r.value:")";if(r.type==="comma")return r.prev.type==="comma"?"":s?r.value:"|";if(r.value)return r.value;if(r.nodes&&r.ranges>0){const c=vo.reduce(r.nodes),l=fg(...c,{...t,wrap:!1,toRegex:!0,strictZeros:!0});if(l.length!==0)return c.length>1&&l.length>1?`(${l})`:l}if(r.nodes)for(const c of r.nodes)f+=n(c,r);return f};return n(e)};var dg=pg;const hg=Ps,wo=yi,gt=Yn,Qe=(e="",t="",n=!1)=>{const r=[];if(e=[].concat(e),t=[].concat(t),!t.length)return e;if(!e.length)return n?gt.flatten(t).map(i=>`{${i}}`):t;for(const i of e)if(Array.isArray(i))for(const a of i)r.push(Qe(a,t,n));else for(let a of t)n===!0&&typeof a=="string"&&(a=`{${a}}`),r.push(Array.isArray(a)?Qe(i,a,n):i+a);return gt.flatten(r)},mg=(e,t={})=>{const n=t.rangeLimit===void 0?1e3:t.rangeLimit,r=(i,a={})=>{i.queue=[];let o=a,s=a.queue;for(;o.type!=="brace"&&o.type!=="root"&&o.parent;)o=o.parent,s=o.queue;if(i.invalid||i.dollar){s.push(Qe(s.pop(),wo(i,t)));return}if(i.type==="brace"&&i.invalid!==!0&&i.nodes.length===2){s.push(Qe(s.pop(),["{}"]));return}if(i.nodes&&i.ranges>0){const l=gt.reduce(i.nodes);if(gt.exceedsLimit(...l,t.step,n))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let p=hg(...l,t);p.length===0&&(p=wo(i,t)),s.push(Qe(s.pop(),p)),i.nodes=[];return}const u=gt.encloseBrace(i);let f=i.queue,c=i;for(;c.type!=="brace"&&c.type!=="root"&&c.parent;)c=c.parent,f=c.queue;for(let l=0;l<i.nodes.length;l++){const p=i.nodes[l];if(p.type==="comma"&&i.type==="brace"){l===1&&f.push(""),f.push("");continue}if(p.type==="close"){s.push(Qe(s.pop(),f,u));continue}if(p.value&&p.type!=="open"){f.push(Qe(f.pop(),p.value));continue}p.nodes&&r(p,i)}return f};return gt.flatten(r(e))};var gg=mg,yg={MAX_LENGTH:1e4,CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_COMMA:",",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_NO_BREAK_SPACE:" ",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SINGLE_QUOTE:"'",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"};const vg=yi,{MAX_LENGTH:Eo,CHAR_BACKSLASH:vr,CHAR_BACKTICK:wg,CHAR_COMMA:Eg,CHAR_DOT:bg,CHAR_LEFT_PARENTHESES:Sg,CHAR_RIGHT_PARENTHESES:xg,CHAR_LEFT_CURLY_BRACE:_g,CHAR_RIGHT_CURLY_BRACE:Ag,CHAR_LEFT_SQUARE_BRACKET:bo,CHAR_RIGHT_SQUARE_BRACKET:So,CHAR_DOUBLE_QUOTE:Tg,CHAR_SINGLE_QUOTE:Cg,CHAR_NO_BREAK_SPACE:Rg,CHAR_ZERO_WIDTH_NOBREAK_SPACE:Fg}=yg,$g=(e,t={})=>{if(typeof e!="string")throw new TypeError("Expected a string");const n=t||{},r=typeof n.maxLength=="number"?Math.min(Eo,n.maxLength):Eo;if(e.length>r)throw new SyntaxError(`Input length (${e.length}), exceeds max characters (${r})`);const i={type:"root",input:e,nodes:[]},a=[i];let o=i,s=i,u=0;const f=e.length;let c=0,l=0,p;const d=()=>e[c++],h=m=>{if(m.type==="text"&&s.type==="dot"&&(s.type="text"),s&&s.type==="text"&&m.type==="text"){s.value+=m.value;return}return o.nodes.push(m),m.parent=o,m.prev=s,s=m,m};for(h({type:"bos"});c<f;)if(o=a[a.length-1],p=d(),!(p===Fg||p===Rg)){if(p===vr){h({type:"text",value:(t.keepEscaping?p:"")+d()});continue}if(p===So){h({type:"text",value:"\\"+p});continue}if(p===bo){u++;let m;for(;c<f&&(m=d());){if(p+=m,m===bo){u++;continue}if(m===vr){p+=d();continue}if(m===So&&(u--,u===0))break}h({type:"text",value:p});continue}if(p===Sg){o=h({type:"paren",nodes:[]}),a.push(o),h({type:"text",value:p});continue}if(p===xg){if(o.type!=="paren"){h({type:"text",value:p});continue}o=a.pop(),h({type:"text",value:p}),o=a[a.length-1];continue}if(p===Tg||p===Cg||p===wg){const m=p;let g;for(t.keepQuotes!==!0&&(p="");c<f&&(g=d());){if(g===vr){p+=g+d();continue}if(g===m){t.keepQuotes===!0&&(p+=g);break}p+=g}h({type:"text",value:p});continue}if(p===_g){l++;const g={type:"brace",open:!0,close:!1,dollar:s.value&&s.value.slice(-1)==="$"||o.dollar===!0,depth:l,commas:0,ranges:0,nodes:[]};o=h(g),a.push(o),h({type:"open",value:p});continue}if(p===Ag){if(o.type!=="brace"){h({type:"text",value:p});continue}const m="close";o=a.pop(),o.close=!0,h({type:m,value:p}),l--,o=a[a.length-1];continue}if(p===Eg&&l>0){if(o.ranges>0){o.ranges=0;const m=o.nodes.shift();o.nodes=[m,{type:"text",value:vg(o)}]}h({type:"comma",value:p}),o.commas++;continue}if(p===bg&&l>0&&o.commas===0){const m=o.nodes;if(l===0||m.length===0){h({type:"text",value:p});continue}if(s.type==="dot"){if(o.range=[],s.value+=p,s.type="range",o.nodes.length!==3&&o.nodes.length!==5){o.invalid=!0,o.ranges=0,s.type="text";continue}o.ranges++,o.args=[];continue}if(s.type==="range"){m.pop();const g=m[m.length-1];g.value+=s.value+p,s=g,o.ranges--;continue}h({type:"dot",value:p});continue}h({type:"text",value:p})}do if(o=a.pop(),o.type!=="root"){o.nodes.forEach(E=>{E.nodes||(E.type==="open"&&(E.isOpen=!0),E.type==="close"&&(E.isClose=!0),E.nodes||(E.type="text"),E.invalid=!0)});const m=a[a.length-1],g=m.nodes.indexOf(o);m.nodes.splice(g,1,...o.nodes)}while(a.length>0);return h({type:"eos"}),i};var Ig=$g;const xo=yi,Og=dg,Ng=gg,Pg=Ig,Te=(e,t={})=>{let n=[];if(Array.isArray(e))for(const r of e){const i=Te.create(r,t);Array.isArray(i)?n.push(...i):n.push(i)}else n=[].concat(Te.create(e,t));return t&&t.expand===!0&&t.nodupes===!0&&(n=[...new Set(n)]),n};Te.parse=(e,t={})=>Pg(e,t);Te.stringify=(e,t={})=>xo(typeof e=="string"?Te.parse(e,t):e,t);Te.compile=(e,t={})=>(typeof e=="string"&&(e=Te.parse(e,t)),Og(e,t));Te.expand=(e,t={})=>{typeof e=="string"&&(e=Te.parse(e,t));let n=Ng(e,t);return t.noempty===!0&&(n=n.filter(Boolean)),t.nodupes===!0&&(n=[...new Set(n)]),n};Te.create=(e,t={})=>e===""||e.length<3?[e]:t.expand!==!0?Te.compile(e,t):Te.expand(e,t);var Lg=Te,Gt={};const kg=Se.default,Pe="\\\\/",_o=`[^${Pe}]`,He="\\.",Dg="\\+",Mg="\\?",Qn="\\/",jg="(?=.)",Ls="[^/]",vi=`(?:${Qn}|$)`,ks=`(?:^|${Qn})`,wi=`${He}{1,2}${vi}`,Hg=`(?!${He})`,Bg=`(?!${ks}${wi})`,Ug=`(?!${He}{0,1}${vi})`,Gg=`(?!${wi})`,qg=`[^.${Qn}]`,Kg=`${Ls}*?`,Ds={DOT_LITERAL:He,PLUS_LITERAL:Dg,QMARK_LITERAL:Mg,SLASH_LITERAL:Qn,ONE_CHAR:jg,QMARK:Ls,END_ANCHOR:vi,DOTS_SLASH:wi,NO_DOT:Hg,NO_DOTS:Bg,NO_DOT_SLASH:Ug,NO_DOTS_SLASH:Gg,QMARK_NO_DOT:qg,STAR:Kg,START_ANCHOR:ks},Wg={...Ds,SLASH_LITERAL:`[${Pe}]`,QMARK:_o,STAR:`${_o}*?`,DOTS_SLASH:`${He}{1,2}(?:[${Pe}]|$)`,NO_DOT:`(?!${He})`,NO_DOTS:`(?!(?:^|[${Pe}])${He}{1,2}(?:[${Pe}]|$))`,NO_DOT_SLASH:`(?!${He}{0,1}(?:[${Pe}]|$))`,NO_DOTS_SLASH:`(?!${He}{1,2}(?:[${Pe}]|$))`,QMARK_NO_DOT:`[^.${Pe}]`,START_ANCHOR:`(?:^|[${Pe}])`,END_ANCHOR:`(?:[${Pe}]|$)`},zg={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};var Vn={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:zg,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:kg.sep,extglobChars(e){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(e){return e===!0?Wg:Ds}};(function(e){const t=Se.default,n=process.platform==="win32",{REGEX_BACKSLASH:r,REGEX_REMOVE_BACKSLASH:i,REGEX_SPECIAL_CHARS:a,REGEX_SPECIAL_CHARS_GLOBAL:o}=Vn;e.isObject=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),e.hasRegexChars=s=>a.test(s),e.isRegexChar=s=>s.length===1&&e.hasRegexChars(s),e.escapeRegex=s=>s.replace(o,"\\$1"),e.toPosixSlashes=s=>s.replace(r,"/"),e.removeBackslashes=s=>s.replace(i,u=>u==="\\"?"":u),e.supportsLookbehinds=()=>{const s=process.version.slice(1).split(".").map(Number);return s.length===3&&s[0]>=9||s[0]===8&&s[1]>=10},e.isWindows=s=>s&&typeof s.windows=="boolean"?s.windows:n===!0||t.sep==="\\",e.escapeLast=(s,u,f)=>{const c=s.lastIndexOf(u,f);return c===-1?s:s[c-1]==="\\"?e.escapeLast(s,u,c-1):`${s.slice(0,c)}\\${s.slice(c)}`},e.removePrefix=(s,u={})=>{let f=s;return f.startsWith("./")&&(f=f.slice(2),u.prefix="./"),f},e.wrapOutput=(s,u={},f={})=>{const c=f.contains?"":"^",l=f.contains?"":"$";let p=`${c}(?:${s})${l}`;return u.negated===!0&&(p=`(?:^(?!${p}).*$)`),p}})(Gt);const Ao=Gt,{CHAR_ASTERISK:wr,CHAR_AT:Yg,CHAR_BACKWARD_SLASH:Ot,CHAR_COMMA:Qg,CHAR_DOT:Er,CHAR_EXCLAMATION_MARK:br,CHAR_FORWARD_SLASH:Ms,CHAR_LEFT_CURLY_BRACE:Sr,CHAR_LEFT_PARENTHESES:xr,CHAR_LEFT_SQUARE_BRACKET:Vg,CHAR_PLUS:Xg,CHAR_QUESTION_MARK:To,CHAR_RIGHT_CURLY_BRACE:Zg,CHAR_RIGHT_PARENTHESES:Co,CHAR_RIGHT_SQUARE_BRACKET:Jg}=Vn,Ro=e=>e===Ms||e===Ot,Fo=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)},ey=(e,t)=>{const n=t||{},r=e.length-1,i=n.parts===!0||n.scanToEnd===!0,a=[],o=[],s=[];let u=e,f=-1,c=0,l=0,p=!1,d=!1,h=!1,m=!1,g=!1,E=!1,S=!1,T=!1,A=!1,R=!1,F=0,D,x,_={value:"",depth:0,isGlob:!1};const N=()=>f>=r,v=()=>u.charCodeAt(f+1),j=()=>(D=x,u.charCodeAt(++f));for(;f<r;){x=j();let I;if(x===Ot){S=_.backslashes=!0,x=j(),x===Sr&&(E=!0);continue}if(E===!0||x===Sr){for(F++;N()!==!0&&(x=j());){if(x===Ot){S=_.backslashes=!0,j();continue}if(x===Sr){F++;continue}if(E!==!0&&x===Er&&(x=j())===Er){if(p=_.isBrace=!0,h=_.isGlob=!0,R=!0,i===!0)continue;break}if(E!==!0&&x===Qg){if(p=_.isBrace=!0,h=_.isGlob=!0,R=!0,i===!0)continue;break}if(x===Zg&&(F--,F===0)){E=!1,p=_.isBrace=!0,R=!0;break}}if(i===!0)continue;break}if(x===Ms){if(a.push(f),o.push(_),_={value:"",depth:0,isGlob:!1},R===!0)continue;if(D===Er&&f===c+1){c+=2;continue}l=f+1;continue}if(n.noext!==!0&&(x===Xg||x===Yg||x===wr||x===To||x===br)===!0&&v()===xr){if(h=_.isGlob=!0,m=_.isExtglob=!0,R=!0,x===br&&f===c&&(A=!0),i===!0){for(;N()!==!0&&(x=j());){if(x===Ot){S=_.backslashes=!0,x=j();continue}if(x===Co){h=_.isGlob=!0,R=!0;break}}continue}break}if(x===wr){if(D===wr&&(g=_.isGlobstar=!0),h=_.isGlob=!0,R=!0,i===!0)continue;break}if(x===To){if(h=_.isGlob=!0,R=!0,i===!0)continue;break}if(x===Vg){for(;N()!==!0&&(I=j());){if(I===Ot){S=_.backslashes=!0,j();continue}if(I===Jg){d=_.isBracket=!0,h=_.isGlob=!0,R=!0;break}}if(i===!0)continue;break}if(n.nonegate!==!0&&x===br&&f===c){T=_.negated=!0,c++;continue}if(n.noparen!==!0&&x===xr){if(h=_.isGlob=!0,i===!0){for(;N()!==!0&&(x=j());){if(x===xr){S=_.backslashes=!0,x=j();continue}if(x===Co){R=!0;break}}continue}break}if(h===!0){if(R=!0,i===!0)continue;break}}n.noext===!0&&(m=!1,h=!1);let H=u,K="",w="";c>0&&(K=u.slice(0,c),u=u.slice(c),l-=c),H&&h===!0&&l>0?(H=u.slice(0,l),w=u.slice(l)):h===!0?(H="",w=u):H=u,H&&H!==""&&H!=="/"&&H!==u&&Ro(H.charCodeAt(H.length-1))&&(H=H.slice(0,-1)),n.unescape===!0&&(w&&(w=Ao.removeBackslashes(w)),H&&S===!0&&(H=Ao.removeBackslashes(H)));const b={prefix:K,input:e,start:c,base:H,glob:w,isBrace:p,isBracket:d,isGlob:h,isExtglob:m,isGlobstar:g,negated:T,negatedExtglob:A};if(n.tokens===!0&&(b.maxDepth=0,Ro(x)||o.push(_),b.tokens=o),n.parts===!0||n.tokens===!0){let I;for(let M=0;M<a.length;M++){const U=I?I+1:c,W=a[M],Q=e.slice(U,W);n.tokens&&(M===0&&c!==0?(o[M].isPrefix=!0,o[M].value=K):o[M].value=Q,Fo(o[M]),b.maxDepth+=o[M].depth),(M!==0||Q!=="")&&s.push(Q),I=W}if(I&&I+1<e.length){const M=e.slice(I+1);s.push(M),n.tokens&&(o[o.length-1].value=M,Fo(o[o.length-1]),b.maxDepth+=o[o.length-1].depth)}b.slashes=a,b.parts=s}return b};var ty=ey;const Tn=Vn,xe=Gt,{MAX_LENGTH:Cn,POSIX_REGEX_SOURCE:ny,REGEX_NON_SPECIAL_CHARS:ry,REGEX_SPECIAL_CHARS_BACKREF:iy,REPLACEMENTS:js}=Tn,oy=(e,t)=>{if(typeof t.expandRange=="function")return t.expandRange(...e,t);e.sort();const n=`[${e.join("-")}]`;try{new RegExp(n)}catch{return e.map(i=>xe.escapeRegex(i)).join("..")}return n},ct=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,Ei=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");e=js[e]||e;const n={...t},r=typeof n.maxLength=="number"?Math.min(Cn,n.maxLength):Cn;let i=e.length;if(i>r)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${r}`);const a={type:"bos",value:"",output:n.prepend||""},o=[a],s=n.capture?"":"?:",u=xe.isWindows(t),f=Tn.globChars(u),c=Tn.extglobChars(f),{DOT_LITERAL:l,PLUS_LITERAL:p,SLASH_LITERAL:d,ONE_CHAR:h,DOTS_SLASH:m,NO_DOT:g,NO_DOT_SLASH:E,NO_DOTS_SLASH:S,QMARK:T,QMARK_NO_DOT:A,STAR:R,START_ANCHOR:F}=f,D=L=>`(${s}(?:(?!${F}${L.dot?m:l}).)*?)`,x=n.dot?"":g,_=n.dot?T:A;let N=n.bash===!0?D(n):R;n.capture&&(N=`(${N})`),typeof n.noext=="boolean"&&(n.noextglob=n.noext);const v={input:e,index:-1,start:0,dot:n.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:o};e=xe.removePrefix(e,v),i=e.length;const j=[],H=[],K=[];let w=a,b;const I=()=>v.index===i-1,M=v.peek=(L=1)=>e[v.index+L],U=v.advance=()=>e[++v.index]||"",W=()=>e.slice(v.index+1),Q=(L="",Y=0)=>{v.consumed+=L,v.index+=Y},ee=L=>{v.output+=L.output!=null?L.output:L.value,Q(L.value)},Ce=()=>{let L=1;for(;M()==="!"&&(M(2)!=="("||M(3)==="?");)U(),v.start++,L++;return L%2===0?!1:(v.negated=!0,v.start++,!0)},$=L=>{v[L]++,K.push(L)},k=L=>{v[L]--,K.pop()},P=L=>{if(w.type==="globstar"){const Y=v.braces>0&&(L.type==="comma"||L.type==="brace"),O=L.extglob===!0||j.length&&(L.type==="pipe"||L.type==="paren");L.type!=="slash"&&L.type!=="paren"&&!Y&&!O&&(v.output=v.output.slice(0,-w.output.length),w.type="star",w.value="*",w.output=N,v.output+=w.output)}if(j.length&&L.type!=="paren"&&(j[j.length-1].inner+=L.value),(L.value||L.output)&&ee(L),w&&w.type==="text"&&L.type==="text"){w.value+=L.value,w.output=(w.output||"")+L.value;return}L.prev=w,o.push(L),w=L},V=(L,Y)=>{const O={...c[Y],conditions:1,inner:""};O.prev=w,O.parens=v.parens,O.output=v.output;const q=(n.capture?"(":"")+O.open;$("parens"),P({type:L,value:Y,output:v.output?"":h}),P({type:"paren",extglob:!0,value:U(),output:q}),j.push(O)},ce=L=>{let Y=L.close+(n.capture?")":""),O;if(L.type==="negate"){let q=N;if(L.inner&&L.inner.length>1&&L.inner.includes("/")&&(q=D(n)),(q!==N||I()||/^\)+$/.test(W()))&&(Y=L.close=`)$))${q}`),L.inner.includes("*")&&(O=W())&&/^\.[^\\/.]+$/.test(O)){const X=Ei(O,{...t,fastpaths:!1}).output;Y=L.close=`)${X})${q})`}L.prev.type==="bos"&&(v.negatedExtglob=!0)}P({type:"paren",extglob:!0,value:b,output:Y}),k("parens")};if(n.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let L=!1,Y=e.replace(iy,(O,q,X,oe,Z,Ne)=>oe==="\\"?(L=!0,O):oe==="?"?q?q+oe+(Z?T.repeat(Z.length):""):Ne===0?_+(Z?T.repeat(Z.length):""):T.repeat(X.length):oe==="."?l.repeat(X.length):oe==="*"?q?q+oe+(Z?N:""):N:q?O:`\\${O}`);return L===!0&&(n.unescape===!0?Y=Y.replace(/\\/g,""):Y=Y.replace(/\\+/g,O=>O.length%2===0?"\\\\":O?"\\":"")),Y===e&&n.contains===!0?(v.output=e,v):(v.output=xe.wrapOutput(Y,v,t),v)}for(;!I();){if(b=U(),b==="\0")continue;if(b==="\\"){const O=M();if(O==="/"&&n.bash!==!0||O==="."||O===";")continue;if(!O){b+="\\",P({type:"text",value:b});continue}const q=/^\\+/.exec(W());let X=0;if(q&&q[0].length>2&&(X=q[0].length,v.index+=X,X%2!==0&&(b+="\\")),n.unescape===!0?b=U():b+=U(),v.brackets===0){P({type:"text",value:b});continue}}if(v.brackets>0&&(b!=="]"||w.value==="["||w.value==="[^")){if(n.posix!==!1&&b===":"){const O=w.value.slice(1);if(O.includes("[")&&(w.posix=!0,O.includes(":"))){const q=w.value.lastIndexOf("["),X=w.value.slice(0,q),oe=w.value.slice(q+2),Z=ny[oe];if(Z){w.value=X+Z,v.backtrack=!0,U(),!a.output&&o.indexOf(w)===1&&(a.output=h);continue}}}(b==="["&&M()!==":"||b==="-"&&M()==="]")&&(b=`\\${b}`),b==="]"&&(w.value==="["||w.value==="[^")&&(b=`\\${b}`),n.posix===!0&&b==="!"&&w.value==="["&&(b="^"),w.value+=b,ee({value:b});continue}if(v.quotes===1&&b!=='"'){b=xe.escapeRegex(b),w.value+=b,ee({value:b});continue}if(b==='"'){v.quotes=v.quotes===1?0:1,n.keepQuotes===!0&&P({type:"text",value:b});continue}if(b==="("){$("parens"),P({type:"paren",value:b});continue}if(b===")"){if(v.parens===0&&n.strictBrackets===!0)throw new SyntaxError(ct("opening","("));const O=j[j.length-1];if(O&&v.parens===O.parens+1){ce(j.pop());continue}P({type:"paren",value:b,output:v.parens?")":"\\)"}),k("parens");continue}if(b==="["){if(n.nobracket===!0||!W().includes("]")){if(n.nobracket!==!0&&n.strictBrackets===!0)throw new SyntaxError(ct("closing","]"));b=`\\${b}`}else $("brackets");P({type:"bracket",value:b});continue}if(b==="]"){if(n.nobracket===!0||w&&w.type==="bracket"&&w.value.length===1){P({type:"text",value:b,output:`\\${b}`});continue}if(v.brackets===0){if(n.strictBrackets===!0)throw new SyntaxError(ct("opening","["));P({type:"text",value:b,output:`\\${b}`});continue}k("brackets");const O=w.value.slice(1);if(w.posix!==!0&&O[0]==="^"&&!O.includes("/")&&(b=`/${b}`),w.value+=b,ee({value:b}),n.literalBrackets===!1||xe.hasRegexChars(O))continue;const q=xe.escapeRegex(w.value);if(v.output=v.output.slice(0,-w.value.length),n.literalBrackets===!0){v.output+=q,w.value=q;continue}w.value=`(${s}${q}|${w.value})`,v.output+=w.value;continue}if(b==="{"&&n.nobrace!==!0){$("braces");const O={type:"brace",value:b,output:"(",outputIndex:v.output.length,tokensIndex:v.tokens.length};H.push(O),P(O);continue}if(b==="}"){const O=H[H.length-1];if(n.nobrace===!0||!O){P({type:"text",value:b,output:b});continue}let q=")";if(O.dots===!0){const X=o.slice(),oe=[];for(let Z=X.length-1;Z>=0&&(o.pop(),X[Z].type!=="brace");Z--)X[Z].type!=="dots"&&oe.unshift(X[Z].value);q=oy(oe,n),v.backtrack=!0}if(O.comma!==!0&&O.dots!==!0){const X=v.output.slice(0,O.outputIndex),oe=v.tokens.slice(O.tokensIndex);O.value=O.output="\\{",b=q="\\}",v.output=X;for(const Z of oe)v.output+=Z.output||Z.value}P({type:"brace",value:b,output:q}),k("braces"),H.pop();continue}if(b==="|"){j.length>0&&j[j.length-1].conditions++,P({type:"text",value:b});continue}if(b===","){let O=b;const q=H[H.length-1];q&&K[K.length-1]==="braces"&&(q.comma=!0,O="|"),P({type:"comma",value:b,output:O});continue}if(b==="/"){if(w.type==="dot"&&v.index===v.start+1){v.start=v.index+1,v.consumed="",v.output="",o.pop(),w=a;continue}P({type:"slash",value:b,output:d});continue}if(b==="."){if(v.braces>0&&w.type==="dot"){w.value==="."&&(w.output=l);const O=H[H.length-1];w.type="dots",w.output+=b,w.value+=b,O.dots=!0;continue}if(v.braces+v.parens===0&&w.type!=="bos"&&w.type!=="slash"){P({type:"text",value:b,output:l});continue}P({type:"dot",value:b,output:l});continue}if(b==="?"){if(!(w&&w.value==="(")&&n.noextglob!==!0&&M()==="("&&M(2)!=="?"){V("qmark",b);continue}if(w&&w.type==="paren"){const q=M();let X=b;if(q==="<"&&!xe.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(w.value==="("&&!/[!=<:]/.test(q)||q==="<"&&!/<([!=]|\w+>)/.test(W()))&&(X=`\\${b}`),P({type:"text",value:b,output:X});continue}if(n.dot!==!0&&(w.type==="slash"||w.type==="bos")){P({type:"qmark",value:b,output:A});continue}P({type:"qmark",value:b,output:T});continue}if(b==="!"){if(n.noextglob!==!0&&M()==="("&&(M(2)!=="?"||!/[!=<:]/.test(M(3)))){V("negate",b);continue}if(n.nonegate!==!0&&v.index===0){Ce();continue}}if(b==="+"){if(n.noextglob!==!0&&M()==="("&&M(2)!=="?"){V("plus",b);continue}if(w&&w.value==="("||n.regex===!1){P({type:"plus",value:b,output:p});continue}if(w&&(w.type==="bracket"||w.type==="paren"||w.type==="brace")||v.parens>0){P({type:"plus",value:b});continue}P({type:"plus",value:p});continue}if(b==="@"){if(n.noextglob!==!0&&M()==="("&&M(2)!=="?"){P({type:"at",extglob:!0,value:b,output:""});continue}P({type:"text",value:b});continue}if(b!=="*"){(b==="$"||b==="^")&&(b=`\\${b}`);const O=ry.exec(W());O&&(b+=O[0],v.index+=O[0].length),P({type:"text",value:b});continue}if(w&&(w.type==="globstar"||w.star===!0)){w.type="star",w.star=!0,w.value+=b,w.output=N,v.backtrack=!0,v.globstar=!0,Q(b);continue}let L=W();if(n.noextglob!==!0&&/^\([^?]/.test(L)){V("star",b);continue}if(w.type==="star"){if(n.noglobstar===!0){Q(b);continue}const O=w.prev,q=O.prev,X=O.type==="slash"||O.type==="bos",oe=q&&(q.type==="star"||q.type==="globstar");if(n.bash===!0&&(!X||L[0]&&L[0]!=="/")){P({type:"star",value:b,output:""});continue}const Z=v.braces>0&&(O.type==="comma"||O.type==="brace"),Ne=j.length&&(O.type==="pipe"||O.type==="paren");if(!X&&O.type!=="paren"&&!Z&&!Ne){P({type:"star",value:b,output:""});continue}for(;L.slice(0,3)==="/**";){const je=e[v.index+4];if(je&&je!=="/")break;L=L.slice(3),Q("/**",3)}if(O.type==="bos"&&I()){w.type="globstar",w.value+=b,w.output=D(n),v.output=w.output,v.globstar=!0,Q(b);continue}if(O.type==="slash"&&O.prev.type!=="bos"&&!oe&&I()){v.output=v.output.slice(0,-(O.output+w.output).length),O.output=`(?:${O.output}`,w.type="globstar",w.output=D(n)+(n.strictSlashes?")":"|$)"),w.value+=b,v.globstar=!0,v.output+=O.output+w.output,Q(b);continue}if(O.type==="slash"&&O.prev.type!=="bos"&&L[0]==="/"){const je=L[1]!==void 0?"|$":"";v.output=v.output.slice(0,-(O.output+w.output).length),O.output=`(?:${O.output}`,w.type="globstar",w.output=`${D(n)}${d}|${d}${je})`,w.value+=b,v.output+=O.output+w.output,v.globstar=!0,Q(b+U()),P({type:"slash",value:"/",output:""});continue}if(O.type==="bos"&&L[0]==="/"){w.type="globstar",w.value+=b,w.output=`(?:^|${d}|${D(n)}${d})`,v.output=w.output,v.globstar=!0,Q(b+U()),P({type:"slash",value:"/",output:""});continue}v.output=v.output.slice(0,-w.output.length),w.type="globstar",w.output=D(n),w.value+=b,v.output+=w.output,v.globstar=!0,Q(b);continue}const Y={type:"star",value:b,output:N};if(n.bash===!0){Y.output=".*?",(w.type==="bos"||w.type==="slash")&&(Y.output=x+Y.output),P(Y);continue}if(w&&(w.type==="bracket"||w.type==="paren")&&n.regex===!0){Y.output=b,P(Y);continue}(v.index===v.start||w.type==="slash"||w.type==="dot")&&(w.type==="dot"?(v.output+=E,w.output+=E):n.dot===!0?(v.output+=S,w.output+=S):(v.output+=x,w.output+=x),M()!=="*"&&(v.output+=h,w.output+=h)),P(Y)}for(;v.brackets>0;){if(n.strictBrackets===!0)throw new SyntaxError(ct("closing","]"));v.output=xe.escapeLast(v.output,"["),k("brackets")}for(;v.parens>0;){if(n.strictBrackets===!0)throw new SyntaxError(ct("closing",")"));v.output=xe.escapeLast(v.output,"("),k("parens")}for(;v.braces>0;){if(n.strictBrackets===!0)throw new SyntaxError(ct("closing","}"));v.output=xe.escapeLast(v.output,"{"),k("braces")}if(n.strictSlashes!==!0&&(w.type==="star"||w.type==="bracket")&&P({type:"maybe_slash",value:"",output:`${d}?`}),v.backtrack===!0){v.output="";for(const L of v.tokens)v.output+=L.output!=null?L.output:L.value,L.suffix&&(v.output+=L.suffix)}return v};Ei.fastpaths=(e,t)=>{const n={...t},r=typeof n.maxLength=="number"?Math.min(Cn,n.maxLength):Cn,i=e.length;if(i>r)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${r}`);e=js[e]||e;const a=xe.isWindows(t),{DOT_LITERAL:o,SLASH_LITERAL:s,ONE_CHAR:u,DOTS_SLASH:f,NO_DOT:c,NO_DOTS:l,NO_DOTS_SLASH:p,STAR:d,START_ANCHOR:h}=Tn.globChars(a),m=n.dot?l:c,g=n.dot?p:c,E=n.capture?"":"?:",S={negated:!1,prefix:""};let T=n.bash===!0?".*?":d;n.capture&&(T=`(${T})`);const A=x=>x.noglobstar===!0?T:`(${E}(?:(?!${h}${x.dot?f:o}).)*?)`,R=x=>{switch(x){case"*":return`${m}${u}${T}`;case".*":return`${o}${u}${T}`;case"*.*":return`${m}${T}${o}${u}${T}`;case"*/*":return`${m}${T}${s}${u}${g}${T}`;case"**":return m+A(n);case"**/*":return`(?:${m}${A(n)}${s})?${g}${u}${T}`;case"**/*.*":return`(?:${m}${A(n)}${s})?${g}${T}${o}${u}${T}`;case"**/.*":return`(?:${m}${A(n)}${s})?${o}${u}${T}`;default:{const _=/^(.*?)\.(\w+)$/.exec(x);if(!_)return;const N=R(_[1]);return N?N+o+_[2]:void 0}}},F=xe.removePrefix(e,S);let D=R(F);return D&&n.strictSlashes!==!0&&(D+=`${s}?`),D};var ay=Ei;const sy=Se.default,uy=ty,Gr=ay,bi=Gt,cy=Vn,ly=e=>e&&typeof e=="object"&&!Array.isArray(e),ae=(e,t,n=!1)=>{if(Array.isArray(e)){const c=e.map(p=>ae(p,t,n));return p=>{for(const d of c){const h=d(p);if(h)return h}return!1}}const r=ly(e)&&e.tokens&&e.input;if(e===""||typeof e!="string"&&!r)throw new TypeError("Expected pattern to be a non-empty string");const i=t||{},a=bi.isWindows(t),o=r?ae.compileRe(e,t):ae.makeRe(e,t,!1,!0),s=o.state;delete o.state;let u=()=>!1;if(i.ignore){const c={...t,ignore:null,onMatch:null,onResult:null};u=ae(i.ignore,c,n)}const f=(c,l=!1)=>{const{isMatch:p,match:d,output:h}=ae.test(c,o,t,{glob:e,posix:a}),m={glob:e,state:s,regex:o,posix:a,input:c,output:h,match:d,isMatch:p};return typeof i.onResult=="function"&&i.onResult(m),p===!1?(m.isMatch=!1,l?m:!1):u(c)?(typeof i.onIgnore=="function"&&i.onIgnore(m),m.isMatch=!1,l?m:!1):(typeof i.onMatch=="function"&&i.onMatch(m),l?m:!0)};return n&&(f.state=s),f};ae.test=(e,t,n,{glob:r,posix:i}={})=>{if(typeof e!="string")throw new TypeError("Expected input to be a string");if(e==="")return{isMatch:!1,output:""};const a=n||{},o=a.format||(i?bi.toPosixSlashes:null);let s=e===r,u=s&&o?o(e):e;return s===!1&&(u=o?o(e):e,s=u===r),(s===!1||a.capture===!0)&&(a.matchBase===!0||a.basename===!0?s=ae.matchBase(e,t,n,i):s=t.exec(u)),{isMatch:!!s,match:s,output:u}};ae.matchBase=(e,t,n,r=bi.isWindows(n))=>(t instanceof RegExp?t:ae.makeRe(t,n)).test(sy.basename(e));ae.isMatch=(e,t,n)=>ae(t,n)(e);ae.parse=(e,t)=>Array.isArray(e)?e.map(n=>ae.parse(n,t)):Gr(e,{...t,fastpaths:!1});ae.scan=(e,t)=>uy(e,t);ae.compileRe=(e,t,n=!1,r=!1)=>{if(n===!0)return e.output;const i=t||{},a=i.contains?"":"^",o=i.contains?"":"$";let s=`${a}(?:${e.output})${o}`;e&&e.negated===!0&&(s=`^(?!${s}).*$`);const u=ae.toRegex(s,t);return r===!0&&(u.state=e),u};ae.makeRe=(e,t={},n=!1,r=!1)=>{if(!e||typeof e!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]==="."||e[0]==="*")&&(i.output=Gr.fastpaths(e,t)),i.output||(i=Gr(e,t)),ae.compileRe(i,t,n,r)};ae.toRegex=(e,t)=>{try{const n=t||{};return new RegExp(e,n.flags||(n.nocase?"i":""))}catch(n){if(t&&t.debug===!0)throw n;return/$^/}};ae.constants=cy;var fy=ae,py=fy;const Hs=it.default,Bs=Lg,Me=py,qr=Gt,$o=e=>e===""||e==="./",Us=e=>{const t=e.indexOf("{");return t>-1&&e.indexOf("}",t)>-1},J=(e,t,n)=>{t=[].concat(t),e=[].concat(e);let r=new Set,i=new Set,a=new Set,o=0,s=c=>{a.add(c.output),n&&n.onResult&&n.onResult(c)};for(let c=0;c<t.length;c++){let l=Me(String(t[c]),{...n,onResult:s},!0),p=l.state.negated||l.state.negatedExtglob;p&&o++;for(let d of e){let h=l(d,!0);(p?!h.isMatch:h.isMatch)&&(p?r.add(h.output):(r.delete(h.output),i.add(h.output)))}}let f=(o===t.length?[...a]:[...i]).filter(c=>!r.has(c));if(n&&f.length===0){if(n.failglob===!0)throw new Error(`No matches found for "${t.join(", ")}"`);if(n.nonull===!0||n.nullglob===!0)return n.unescape?t.map(c=>c.replace(/\\/g,"")):t}return f};J.match=J;J.matcher=(e,t)=>Me(e,t);J.isMatch=(e,t,n)=>Me(t,n)(e);J.any=J.isMatch;J.not=(e,t,n={})=>{t=[].concat(t).map(String);let r=new Set,i=[],a=s=>{n.onResult&&n.onResult(s),i.push(s.output)},o=new Set(J(e,t,{...n,onResult:a}));for(let s of i)o.has(s)||r.add(s);return[...r]};J.contains=(e,t,n)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${Hs.inspect(e)}"`);if(Array.isArray(t))return t.some(r=>J.contains(e,r,n));if(typeof t=="string"){if($o(e)||$o(t))return!1;if(e.includes(t)||e.startsWith("./")&&e.slice(2).includes(t))return!0}return J.isMatch(e,t,{...n,contains:!0})};J.matchKeys=(e,t,n)=>{if(!qr.isObject(e))throw new TypeError("Expected the first argument to be an object");let r=J(Object.keys(e),t,n),i={};for(let a of r)i[a]=e[a];return i};J.some=(e,t,n)=>{let r=[].concat(e);for(let i of[].concat(t)){let a=Me(String(i),n);if(r.some(o=>a(o)))return!0}return!1};J.every=(e,t,n)=>{let r=[].concat(e);for(let i of[].concat(t)){let a=Me(String(i),n);if(!r.every(o=>a(o)))return!1}return!0};J.all=(e,t,n)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${Hs.inspect(e)}"`);return[].concat(t).every(r=>Me(r,n)(e))};J.capture=(e,t,n)=>{let r=qr.isWindows(n),a=Me.makeRe(String(e),{...n,capture:!0}).exec(r?qr.toPosixSlashes(t):t);if(a)return a.slice(1).map(o=>o===void 0?"":o)};J.makeRe=(...e)=>Me.makeRe(...e);J.scan=(...e)=>Me.scan(...e);J.parse=(e,t)=>{let n=[];for(let r of[].concat(e||[]))for(let i of Bs(String(r),t))n.push(Me.parse(i,t));return n};J.braces=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return t&&t.nobrace===!0||!Us(e)?[e]:Bs(e,t)};J.braceExpand=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return J.braces(e,{...t,expand:!0})};J.hasBraces=Us;var dy=J,Si=Ee&&Ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ae,"__esModule",{value:!0});Ae.readPackageJSON=Ae.extractWorkspaces=Ae.isMatchWorkspaces=Ae.checkWorkspaces=Ae.findWorkspaceRoot=void 0;const Rn=Si(Se.default),hy=Si(zm),Io=We.default,my=Si(dy);function Ue(e){e||(e=process.cwd());let t=hy.default.sync(e);if(!t)return null;e=Rn.default.normalize(t);let n=null,r=e;do{const i=Zn(r);Xn(i);let{done:a,found:o}=Gs(r,e);if(a)return o;n=r,r=Rn.default.dirname(r)}while(r!==n);return null}Ae.findWorkspaceRoot=Ue;function Gs(e,t){const n=Zn(e),r=Xn(n);let i=!1,a,o;return r&&(i=!0,o=Rn.default.relative(e,t),o===""||xi(o,r)?a=e:a=null),{done:i,found:a,relativePath:o}}Ae.checkWorkspaces=Gs;function xi(e,t){return my.default([e],t).length>0}Ae.isMatchWorkspaces=xi;function Xn(e){const t=(e||{}).workspaces;return t&&t.packages||(Array.isArray(t)?t:null)}Ae.extractWorkspaces=Xn;function Zn(e){const t=Rn.default.join(e,"package.json");return Io.existsSync(t)?JSON.parse(Io.readFileSync(t,"utf8")):null}Ae.readPackageJSON=Zn;Ue.findWorkspaceRoot=Ue;Ue.readPackageJSON=Zn;Ue.extractWorkspaces=Xn;Ue.isMatchWorkspaces=xi;Ue.default=Ue;Ae.default=Ue;const gy=Ae;gy.findWorkspaceRoot;var yy={exports:{}},_i={exports:{}};class vy{constructor(t){this.value=t,this.next=void 0}}let wy=class{constructor(){this.clear()}enqueue(t){const n=new vy(t);this._head?(this._tail.next=n,this._tail=n):(this._head=n,this._tail=n),this._size++}dequeue(){const t=this._head;if(t)return this._head=this._head.next,this._size--,t.value}clear(){this._head=void 0,this._tail=void 0,this._size=0}get size(){return this._size}*[Symbol.iterator](){let t=this._head;for(;t;)yield t.value,t=t.next}};var Ey=wy;const by=Ey,Sy=e=>{if(!((Number.isInteger(e)||e===1/0)&&e>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up");const t=new by;let n=0;const r=()=>{n--,t.size>0&&t.dequeue()()},i=async(s,u,...f)=>{n++;const c=(async()=>s(...f))();u(c);try{await c}catch{}r()},a=(s,u,...f)=>{t.enqueue(i.bind(null,s,u,...f)),(async()=>(await Promise.resolve(),n<e&&t.size>0&&t.dequeue()()))()},o=(s,...u)=>new Promise(f=>{a(s,f,...u)});return Object.defineProperties(o,{activeCount:{get:()=>n},pendingCount:{get:()=>t.size},clearQueue:{value:()=>{t.clear()}}}),o};var xy=Sy;const Oo=xy;class qs extends Error{constructor(t){super(),this.value=t}}const _y=async(e,t)=>t(await e),Ay=async e=>{const t=await Promise.all(e);if(t[1]===!0)throw new qs(t[0]);return!1},Ty=async(e,t,n)=>{n={concurrency:1/0,preserveOrder:!0,...n};const r=Oo(n.concurrency),i=[...e].map(o=>[o,r(_y,o,t)]),a=Oo(n.preserveOrder?1:1/0);try{await Promise.all(i.map(o=>a(Ay,o)))}catch(o){if(o instanceof qs)return o.value;throw o}};var Cy=Ty;const Ks=Se.default,Fn=We.default,{promisify:Ws}=it.default,Ry=Cy,Fy=Ws(Fn.stat),$y=Ws(Fn.lstat),zs={directory:"isDirectory",file:"isFile"};function Ys({type:e}){if(!(e in zs))throw new Error(`Invalid type specified: ${e}`)}const Qs=(e,t)=>e===void 0||t[zs[e]]();_i.exports=async(e,t)=>{t={cwd:process.cwd(),type:"file",allowSymlinks:!0,...t},Ys(t);const n=t.allowSymlinks?Fy:$y;return Ry(e,async r=>{try{const i=await n(Ks.resolve(t.cwd,r));return Qs(t.type,i)}catch{return!1}},t)};_i.exports.sync=(e,t)=>{t={cwd:process.cwd(),allowSymlinks:!0,type:"file",...t},Ys(t);const n=t.allowSymlinks?Fn.statSync:Fn.lstatSync;for(const r of e)try{const i=n(Ks.resolve(t.cwd,r));if(Qs(t.type,i))return r}catch{}};var Iy=_i.exports;(function(e){const t=Se.default,n=Iy,r=As,i=Symbol("findUp.stop");e.exports=async(a,o={})=>{let s=t.resolve(o.cwd||"");const{root:u}=t.parse(s),f=[].concat(a),c=async l=>{if(typeof a!="function")return n(f,l);const p=await a(l.cwd);return typeof p=="string"?n([p],l):p};for(;;){const l=await c({...o,cwd:s});if(l===i)return;if(l)return t.resolve(s,l);if(s===u)return;s=t.dirname(s)}},e.exports.sync=(a,o={})=>{let s=t.resolve(o.cwd||"");const{root:u}=t.parse(s),f=[].concat(a),c=l=>{if(typeof a!="function")return n.sync(f,l);const p=a(l.cwd);return typeof p=="string"?n.sync([p],l):p};for(;;){const l=c({...o,cwd:s});if(l===i)return;if(l)return t.resolve(s,l);if(s===u)return;s=t.dirname(s)}},e.exports.exists=r,e.exports.sync.exists=r.sync,e.exports.stop=i})(yy);var Vs={exports:{}},Ge=cc.default,Oy=process.cwd,un=null,Ny=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return un||(un=Oy.call(process)),un};try{process.cwd()}catch{}if(typeof process.chdir=="function"){var No=process.chdir;process.chdir=function(e){un=null,No.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,No)}var Py=Ly;function Ly(e){Ge.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&t(e),e.lutimes||n(e),e.chown=a(e.chown),e.fchown=a(e.fchown),e.lchown=a(e.lchown),e.chmod=r(e.chmod),e.fchmod=r(e.fchmod),e.lchmod=r(e.lchmod),e.chownSync=o(e.chownSync),e.fchownSync=o(e.fchownSync),e.lchownSync=o(e.lchownSync),e.chmodSync=i(e.chmodSync),e.fchmodSync=i(e.fchmodSync),e.lchmodSync=i(e.lchmodSync),e.stat=s(e.stat),e.fstat=s(e.fstat),e.lstat=s(e.lstat),e.statSync=u(e.statSync),e.fstatSync=u(e.fstatSync),e.lstatSync=u(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(c,l,p){p&&process.nextTick(p)},e.lchmodSync=function(){}),e.chown&&!e.lchown&&(e.lchown=function(c,l,p,d){d&&process.nextTick(d)},e.lchownSync=function(){}),Ny==="win32"&&(e.rename=typeof e.rename!="function"?e.rename:(function(c){function l(p,d,h){var m=Date.now(),g=0;c(p,d,function E(S){if(S&&(S.code==="EACCES"||S.code==="EPERM"||S.code==="EBUSY")&&Date.now()-m<6e4){setTimeout(function(){e.stat(d,function(T,A){T&&T.code==="ENOENT"?c(p,d,E):h(S)})},g),g<100&&(g+=10);return}h&&h(S)})}return Object.setPrototypeOf&&Object.setPrototypeOf(l,c),l})(e.rename)),e.read=typeof e.read!="function"?e.read:(function(c){function l(p,d,h,m,g,E){var S;if(E&&typeof E=="function"){var T=0;S=function(A,R,F){if(A&&A.code==="EAGAIN"&&T<10)return T++,c.call(e,p,d,h,m,g,S);E.apply(this,arguments)}}return c.call(e,p,d,h,m,g,S)}return Object.setPrototypeOf&&Object.setPrototypeOf(l,c),l})(e.read),e.readSync=typeof e.readSync!="function"?e.readSync:(function(c){return function(l,p,d,h,m){for(var g=0;;)try{return c.call(e,l,p,d,h,m)}catch(E){if(E.code==="EAGAIN"&&g<10){g++;continue}throw E}}})(e.readSync);function t(c){c.lchmod=function(l,p,d){c.open(l,Ge.O_WRONLY|Ge.O_SYMLINK,p,function(h,m){if(h){d&&d(h);return}c.fchmod(m,p,function(g){c.close(m,function(E){d&&d(g||E)})})})},c.lchmodSync=function(l,p){var d=c.openSync(l,Ge.O_WRONLY|Ge.O_SYMLINK,p),h=!0,m;try{m=c.fchmodSync(d,p),h=!1}finally{if(h)try{c.closeSync(d)}catch{}else c.closeSync(d)}return m}}function n(c){Ge.hasOwnProperty("O_SYMLINK")&&c.futimes?(c.lutimes=function(l,p,d,h){c.open(l,Ge.O_SYMLINK,function(m,g){if(m){h&&h(m);return}c.futimes(g,p,d,function(E){c.close(g,function(S){h&&h(E||S)})})})},c.lutimesSync=function(l,p,d){var h=c.openSync(l,Ge.O_SYMLINK),m,g=!0;try{m=c.futimesSync(h,p,d),g=!1}finally{if(g)try{c.closeSync(h)}catch{}else c.closeSync(h)}return m}):c.futimes&&(c.lutimes=function(l,p,d,h){h&&process.nextTick(h)},c.lutimesSync=function(){})}function r(c){return c&&function(l,p,d){return c.call(e,l,p,function(h){f(h)&&(h=null),d&&d.apply(this,arguments)})}}function i(c){return c&&function(l,p){try{return c.call(e,l,p)}catch(d){if(!f(d))throw d}}}function a(c){return c&&function(l,p,d,h){return c.call(e,l,p,d,function(m){f(m)&&(m=null),h&&h.apply(this,arguments)})}}function o(c){return c&&function(l,p,d){try{return c.call(e,l,p,d)}catch(h){if(!f(h))throw h}}}function s(c){return c&&function(l,p,d){typeof p=="function"&&(d=p,p=null);function h(m,g){g&&(g.uid<0&&(g.uid+=4294967296),g.gid<0&&(g.gid+=4294967296)),d&&d.apply(this,arguments)}return p?c.call(e,l,p,h):c.call(e,l,h)}}function u(c){return c&&function(l,p){var d=p?c.call(e,l,p):c.call(e,l);return d&&(d.uid<0&&(d.uid+=4294967296),d.gid<0&&(d.gid+=4294967296)),d}}function f(c){if(!c||c.code==="ENOSYS")return!0;var l=!process.getuid||process.getuid()!==0;return!!(l&&(c.code==="EINVAL"||c.code==="EPERM"))}}var Po=kn.default.Stream,ky=Dy;function Dy(e){return{ReadStream:t,WriteStream:n};function t(r,i){if(!(this instanceof t))return new t(r,i);Po.call(this);var a=this;this.path=r,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var o=Object.keys(i),s=0,u=o.length;s<u;s++){var f=o[s];this[f]=i[f]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){a._read()});return}e.open(this.path,this.flags,this.mode,function(c,l){if(c){a.emit("error",c),a.readable=!1;return}a.fd=l,a.emit("open",l),a._read()})}function n(r,i){if(!(this instanceof n))return new n(r,i);Po.call(this),this.path=r,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var a=Object.keys(i),o=0,s=a.length;o<s;o++){var u=a[o];this[u]=i[u]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}var My=Hy,jy=Object.getPrototypeOf||function(e){return e.__proto__};function Hy(e){if(e===null||typeof e!="object")return e;if(e instanceof Object)var t={__proto__:jy(e)};else var t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}),t}var ne=We.default,By=Py,Uy=ky,Gy=My,en=it.default,pe,$n;typeof Symbol=="function"&&typeof Symbol.for=="function"?(pe=Symbol.for("graceful-fs.queue"),$n=Symbol.for("graceful-fs.previous")):(pe="___graceful-fs.queue",$n="___graceful-fs.previous");function qy(){}function Xs(e,t){Object.defineProperty(e,pe,{get:function(){return t}})}var Je=qy;en.debuglog?Je=en.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Je=function(){var e=en.format.apply(en,arguments);e="GFS4: "+e.split(/\n/).join(`
46
- GFS4: `),console.error(e)});if(!ne[pe]){var Ky=Ee[pe]||[];Xs(ne,Ky),ne.close=(function(e){function t(n,r){return e.call(ne,n,function(i){i||Lo(),typeof r=="function"&&r.apply(this,arguments)})}return Object.defineProperty(t,$n,{value:e}),t})(ne.close),ne.closeSync=(function(e){function t(n){e.apply(ne,arguments),Lo()}return Object.defineProperty(t,$n,{value:e}),t})(ne.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Je(ne[pe]),ua.default.equal(ne[pe].length,0)})}Ee[pe]||Xs(Ee,ne[pe]);var Zs=Ai(Gy(ne));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!ne.__patched&&(Zs=Ai(ne),ne.__patched=!0);function Ai(e){By(e),e.gracefulify=Ai,e.createReadStream=R,e.createWriteStream=F;var t=e.readFile;e.readFile=n;function n(_,N,v){return typeof N=="function"&&(v=N,N=null),j(_,N,v);function j(H,K,w,b){return t(H,K,function(I){I&&(I.code==="EMFILE"||I.code==="ENFILE")?lt([j,[H,K,w],I,b||Date.now(),Date.now()]):typeof w=="function"&&w.apply(this,arguments)})}}var r=e.writeFile;e.writeFile=i;function i(_,N,v,j){return typeof v=="function"&&(j=v,v=null),H(_,N,v,j);function H(K,w,b,I,M){return r(K,w,b,function(U){U&&(U.code==="EMFILE"||U.code==="ENFILE")?lt([H,[K,w,b,I],U,M||Date.now(),Date.now()]):typeof I=="function"&&I.apply(this,arguments)})}}var a=e.appendFile;a&&(e.appendFile=o);function o(_,N,v,j){return typeof v=="function"&&(j=v,v=null),H(_,N,v,j);function H(K,w,b,I,M){return a(K,w,b,function(U){U&&(U.code==="EMFILE"||U.code==="ENFILE")?lt([H,[K,w,b,I],U,M||Date.now(),Date.now()]):typeof I=="function"&&I.apply(this,arguments)})}}var s=e.copyFile;s&&(e.copyFile=u);function u(_,N,v,j){return typeof v=="function"&&(j=v,v=0),H(_,N,v,j);function H(K,w,b,I,M){return s(K,w,b,function(U){U&&(U.code==="EMFILE"||U.code==="ENFILE")?lt([H,[K,w,b,I],U,M||Date.now(),Date.now()]):typeof I=="function"&&I.apply(this,arguments)})}}var f=e.readdir;e.readdir=l;var c=/^v[0-5]\./;function l(_,N,v){typeof N=="function"&&(v=N,N=null);var j=c.test(process.version)?function(w,b,I,M){return f(w,H(w,b,I,M))}:function(w,b,I,M){return f(w,b,H(w,b,I,M))};return j(_,N,v);function H(K,w,b,I){return function(M,U){M&&(M.code==="EMFILE"||M.code==="ENFILE")?lt([j,[K,w,b],M,I||Date.now(),Date.now()]):(U&&U.sort&&U.sort(),typeof b=="function"&&b.call(this,M,U))}}}if(process.version.substr(0,4)==="v0.8"){var p=Uy(e);E=p.ReadStream,T=p.WriteStream}var d=e.ReadStream;d&&(E.prototype=Object.create(d.prototype),E.prototype.open=S);var h=e.WriteStream;h&&(T.prototype=Object.create(h.prototype),T.prototype.open=A),Object.defineProperty(e,"ReadStream",{get:function(){return E},set:function(_){E=_},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return T},set:function(_){T=_},enumerable:!0,configurable:!0});var m=E;Object.defineProperty(e,"FileReadStream",{get:function(){return m},set:function(_){m=_},enumerable:!0,configurable:!0});var g=T;Object.defineProperty(e,"FileWriteStream",{get:function(){return g},set:function(_){g=_},enumerable:!0,configurable:!0});function E(_,N){return this instanceof E?(d.apply(this,arguments),this):E.apply(Object.create(E.prototype),arguments)}function S(){var _=this;x(_.path,_.flags,_.mode,function(N,v){N?(_.autoClose&&_.destroy(),_.emit("error",N)):(_.fd=v,_.emit("open",v),_.read())})}function T(_,N){return this instanceof T?(h.apply(this,arguments),this):T.apply(Object.create(T.prototype),arguments)}function A(){var _=this;x(_.path,_.flags,_.mode,function(N,v){N?(_.destroy(),_.emit("error",N)):(_.fd=v,_.emit("open",v))})}function R(_,N){return new e.ReadStream(_,N)}function F(_,N){return new e.WriteStream(_,N)}var D=e.open;e.open=x;function x(_,N,v,j){return typeof v=="function"&&(j=v,v=null),H(_,N,v,j);function H(K,w,b,I,M){return D(K,w,b,function(U,W){U&&(U.code==="EMFILE"||U.code==="ENFILE")?lt([H,[K,w,b,I],U,M||Date.now(),Date.now()]):typeof I=="function"&&I.apply(this,arguments)})}}return e}function lt(e){Je("ENQUEUE",e[0].name,e[1]),ne[pe].push(e),Ti()}var tn;function Lo(){for(var e=Date.now(),t=0;t<ne[pe].length;++t)ne[pe][t].length>2&&(ne[pe][t][3]=e,ne[pe][t][4]=e);Ti()}function Ti(){if(clearTimeout(tn),tn=void 0,ne[pe].length!==0){var e=ne[pe].shift(),t=e[0],n=e[1],r=e[2],i=e[3],a=e[4];if(i===void 0)Je("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-i>=6e4){Je("TIMEOUT",t.name,n);var o=n.pop();typeof o=="function"&&o.call(null,r)}else{var s=Date.now()-a,u=Math.max(a-i,1),f=Math.min(u*1.2,100);s>=f?(Je("RETRY",t.name,n),t.apply(null,n.concat([i]))):ne[pe].push(e)}tn===void 0&&(tn=setTimeout(Ti,0))}}const ko=(e,t)=>function(...n){const r=t.promiseModule;return new r((i,a)=>{t.multiArgs?n.push((...o)=>{t.errorFirst?o[0]?a(o):(o.shift(),i(o)):i(o)}):t.errorFirst?n.push((o,s)=>{o?a(o):i(s)}):n.push(i),e.apply(this,n)})};var Wy=(e,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);const n=typeof e;if(!(e!==null&&(n==="object"||n==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${e===null?"null":n}\``);const r=a=>{const o=s=>typeof s=="string"?a===s:s.test(a);return t.include?t.include.some(o):!t.exclude.some(o)};let i;n==="function"?i=function(...a){return t.excludeMain?e(...a):ko(e,t).apply(this,a)}:i=Object.create(Object.getPrototypeOf(e));for(const a in e){const o=e[a];i[a]=typeof o=="function"&&r(a)?ko(o,t):o}return i},zy=e=>{if(typeof e!="string")throw new TypeError("Expected a string, got "+typeof e);return e.charCodeAt(0)===65279?e.slice(1):e},ie={},qt={},$e={};function Js(e){return typeof e>"u"||e===null}function Yy(e){return typeof e=="object"&&e!==null}function Qy(e){return Array.isArray(e)?e:Js(e)?[]:[e]}function Vy(e,t){var n,r,i,a;if(t)for(a=Object.keys(t),n=0,r=a.length;n<r;n+=1)i=a[n],e[i]=t[i];return e}function Xy(e,t){var n="",r;for(r=0;r<t;r+=1)n+=e;return n}function Zy(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}$e.isNothing=Js;$e.isObject=Yy;$e.toArray=Qy;$e.repeat=Xy;$e.isNegativeZero=Zy;$e.extend=Vy;function Dt(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Dt.prototype=Object.create(Error.prototype);Dt.prototype.constructor=Dt;Dt.prototype.toString=function(t){var n=this.name+": ";return n+=this.reason||"(unknown reason)",!t&&this.mark&&(n+=" "+this.mark.toString()),n};var Kt=Dt,Do=$e;function Ci(e,t,n,r,i){this.name=e,this.buffer=t,this.position=n,this.line=r,this.column=i}Ci.prototype.getSnippet=function(t,n){var r,i,a,o,s;if(!this.buffer)return null;for(t=t||4,n=n||75,r="",i=this.position;i>0&&`\0\r
45
+ */const ig=it.default,$s=rg,vo=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),og=e=>t=>e===!0?Number(t):String(t),yr=e=>typeof e=="number"||typeof e=="string"&&e!=="",Pt=e=>Number.isInteger(+e),vr=e=>{let t=`${e}`,n=-1;if(t[0]==="-"&&(t=t.slice(1)),t==="0")return!1;for(;t[++n]==="0";);return n>0},ag=(e,t,n)=>typeof e=="string"||typeof t=="string"?!0:n.stringify===!0,sg=(e,t,n)=>{if(t>0){let r=e[0]==="-"?"-":"";r&&(e=e.slice(1)),e=r+e.padStart(r?t-1:t,"0")}return n===!1?String(e):e},Tn=(e,t)=>{let n=e[0]==="-"?"-":"";for(n&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return n?"-"+e:e},ug=(e,t,n)=>{e.negatives.sort((s,u)=>s<u?-1:s>u?1:0),e.positives.sort((s,u)=>s<u?-1:s>u?1:0);let r=t.capture?"":"?:",i="",a="",o;return e.positives.length&&(i=e.positives.map(s=>Tn(String(s),n)).join("|")),e.negatives.length&&(a=`-(${r}${e.negatives.map(s=>Tn(String(s),n)).join("|")})`),i&&a?o=`${i}|${a}`:o=i||a,t.wrap?`(${r}${o})`:o},Is=(e,t,n,r)=>{if(n)return $s(e,t,{wrap:!1,...r});let i=String.fromCharCode(e);if(e===t)return i;let a=String.fromCharCode(t);return`[${i}-${a}]`},Os=(e,t,n)=>{if(Array.isArray(e)){let r=n.wrap===!0,i=n.capture?"":"?:";return r?`(${i}${e.join("|")})`:e.join("|")}return $s(e,t,n)},Ns=(...e)=>new RangeError("Invalid range arguments: "+ig.inspect(...e)),Ps=(e,t,n)=>{if(n.strictRanges===!0)throw Ns([e,t]);return[]},cg=(e,t)=>{if(t.strictRanges===!0)throw new TypeError(`Expected step "${e}" to be a number`);return[]},lg=(e,t,n=1,r={})=>{let i=Number(e),a=Number(t);if(!Number.isInteger(i)||!Number.isInteger(a)){if(r.strictRanges===!0)throw Ns([e,t]);return[]}i===0&&(i=0),a===0&&(a=0);let o=i>a,s=String(e),u=String(t),f=String(n);n=Math.max(Math.abs(n),1);let c=vr(s)||vr(u)||vr(f),l=c?Math.max(s.length,u.length,f.length):0,p=c===!1&&ag(e,t,r)===!1,d=r.transform||og(p);if(r.toRegex&&n===1)return Is(Tn(e,l),Tn(t,l),!0,r);let h={negatives:[],positives:[]},m=S=>h[S<0?"negatives":"positives"].push(Math.abs(S)),g=[],w=0;for(;o?i>=a:i<=a;)r.toRegex===!0&&n>1?m(i):g.push(sg(d(i,w),l,p)),i=o?i-n:i+n,w++;return r.toRegex===!0?n>1?ug(h,r,l):Os(g,null,{wrap:!1,...r}):g},fg=(e,t,n=1,r={})=>{if(!Pt(e)&&e.length>1||!Pt(t)&&t.length>1)return Ps(e,t,r);let i=r.transform||(p=>String.fromCharCode(p)),a=`${e}`.charCodeAt(0),o=`${t}`.charCodeAt(0),s=a>o,u=Math.min(a,o),f=Math.max(a,o);if(r.toRegex&&n===1)return Is(u,f,!1,r);let c=[],l=0;for(;s?a>=o:a<=o;)c.push(i(a,l)),a=s?a-n:a+n,l++;return r.toRegex===!0?Os(c,null,{wrap:!1,options:r}):c},un=(e,t,n,r={})=>{if(t==null&&yr(e))return[e];if(!yr(e)||!yr(t))return Ps(e,t,r);if(typeof n=="function")return un(e,t,1,{transform:n});if(vo(n))return un(e,t,0,n);let i={...r};return i.capture===!0&&(i.wrap=!0),n=n||i.step||1,Pt(n)?Pt(e)&&Pt(t)?lg(e,t,n,i):fg(e,t,Math.max(Math.abs(n),1),i):n!=null&&!vo(n)?cg(n,i):un(e,t,1,n)};var Ls=un;const pg=Ls,wo=Qn,dg=(e,t={})=>{const n=(r,i={})=>{const a=wo.isInvalidBrace(i),o=r.invalid===!0&&t.escapeInvalid===!0,s=a===!0||o===!0,u=t.escapeInvalid===!0?"\\":"";let f="";if(r.isOpen===!0)return u+r.value;if(r.isClose===!0)return console.log("node.isClose",u,r.value),u+r.value;if(r.type==="open")return s?u+r.value:"(";if(r.type==="close")return s?u+r.value:")";if(r.type==="comma")return r.prev.type==="comma"?"":s?r.value:"|";if(r.value)return r.value;if(r.nodes&&r.ranges>0){const c=wo.reduce(r.nodes),l=pg(...c,{...t,wrap:!1,toRegex:!0,strictZeros:!0});if(l.length!==0)return c.length>1&&l.length>1?`(${l})`:l}if(r.nodes)for(const c of r.nodes)f+=n(c,r);return f};return n(e)};var hg=dg;const mg=Ls,Eo=vi,gt=Qn,Qe=(e="",t="",n=!1)=>{const r=[];if(e=[].concat(e),t=[].concat(t),!t.length)return e;if(!e.length)return n?gt.flatten(t).map(i=>`{${i}}`):t;for(const i of e)if(Array.isArray(i))for(const a of i)r.push(Qe(a,t,n));else for(let a of t)n===!0&&typeof a=="string"&&(a=`{${a}}`),r.push(Array.isArray(a)?Qe(i,a,n):i+a);return gt.flatten(r)},gg=(e,t={})=>{const n=t.rangeLimit===void 0?1e3:t.rangeLimit,r=(i,a={})=>{i.queue=[];let o=a,s=a.queue;for(;o.type!=="brace"&&o.type!=="root"&&o.parent;)o=o.parent,s=o.queue;if(i.invalid||i.dollar){s.push(Qe(s.pop(),Eo(i,t)));return}if(i.type==="brace"&&i.invalid!==!0&&i.nodes.length===2){s.push(Qe(s.pop(),["{}"]));return}if(i.nodes&&i.ranges>0){const l=gt.reduce(i.nodes);if(gt.exceedsLimit(...l,t.step,n))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let p=mg(...l,t);p.length===0&&(p=Eo(i,t)),s.push(Qe(s.pop(),p)),i.nodes=[];return}const u=gt.encloseBrace(i);let f=i.queue,c=i;for(;c.type!=="brace"&&c.type!=="root"&&c.parent;)c=c.parent,f=c.queue;for(let l=0;l<i.nodes.length;l++){const p=i.nodes[l];if(p.type==="comma"&&i.type==="brace"){l===1&&f.push(""),f.push("");continue}if(p.type==="close"){s.push(Qe(s.pop(),f,u));continue}if(p.value&&p.type!=="open"){f.push(Qe(f.pop(),p.value));continue}p.nodes&&r(p,i)}return f};return gt.flatten(r(e))};var yg=gg,vg={MAX_LENGTH:1e4,CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_COMMA:",",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_NO_BREAK_SPACE:" ",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SINGLE_QUOTE:"'",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"};const wg=vi,{MAX_LENGTH:bo,CHAR_BACKSLASH:wr,CHAR_BACKTICK:Eg,CHAR_COMMA:bg,CHAR_DOT:Sg,CHAR_LEFT_PARENTHESES:xg,CHAR_RIGHT_PARENTHESES:_g,CHAR_LEFT_CURLY_BRACE:Ag,CHAR_RIGHT_CURLY_BRACE:Tg,CHAR_LEFT_SQUARE_BRACKET:So,CHAR_RIGHT_SQUARE_BRACKET:xo,CHAR_DOUBLE_QUOTE:Cg,CHAR_SINGLE_QUOTE:Rg,CHAR_NO_BREAK_SPACE:Fg,CHAR_ZERO_WIDTH_NOBREAK_SPACE:$g}=vg,Ig=(e,t={})=>{if(typeof e!="string")throw new TypeError("Expected a string");const n=t||{},r=typeof n.maxLength=="number"?Math.min(bo,n.maxLength):bo;if(e.length>r)throw new SyntaxError(`Input length (${e.length}), exceeds max characters (${r})`);const i={type:"root",input:e,nodes:[]},a=[i];let o=i,s=i,u=0;const f=e.length;let c=0,l=0,p;const d=()=>e[c++],h=m=>{if(m.type==="text"&&s.type==="dot"&&(s.type="text"),s&&s.type==="text"&&m.type==="text"){s.value+=m.value;return}return o.nodes.push(m),m.parent=o,m.prev=s,s=m,m};for(h({type:"bos"});c<f;)if(o=a[a.length-1],p=d(),!(p===$g||p===Fg)){if(p===wr){h({type:"text",value:(t.keepEscaping?p:"")+d()});continue}if(p===xo){h({type:"text",value:"\\"+p});continue}if(p===So){u++;let m;for(;c<f&&(m=d());){if(p+=m,m===So){u++;continue}if(m===wr){p+=d();continue}if(m===xo&&(u--,u===0))break}h({type:"text",value:p});continue}if(p===xg){o=h({type:"paren",nodes:[]}),a.push(o),h({type:"text",value:p});continue}if(p===_g){if(o.type!=="paren"){h({type:"text",value:p});continue}o=a.pop(),h({type:"text",value:p}),o=a[a.length-1];continue}if(p===Cg||p===Rg||p===Eg){const m=p;let g;for(t.keepQuotes!==!0&&(p="");c<f&&(g=d());){if(g===wr){p+=g+d();continue}if(g===m){t.keepQuotes===!0&&(p+=g);break}p+=g}h({type:"text",value:p});continue}if(p===Ag){l++;const g={type:"brace",open:!0,close:!1,dollar:s.value&&s.value.slice(-1)==="$"||o.dollar===!0,depth:l,commas:0,ranges:0,nodes:[]};o=h(g),a.push(o),h({type:"open",value:p});continue}if(p===Tg){if(o.type!=="brace"){h({type:"text",value:p});continue}const m="close";o=a.pop(),o.close=!0,h({type:m,value:p}),l--,o=a[a.length-1];continue}if(p===bg&&l>0){if(o.ranges>0){o.ranges=0;const m=o.nodes.shift();o.nodes=[m,{type:"text",value:wg(o)}]}h({type:"comma",value:p}),o.commas++;continue}if(p===Sg&&l>0&&o.commas===0){const m=o.nodes;if(l===0||m.length===0){h({type:"text",value:p});continue}if(s.type==="dot"){if(o.range=[],s.value+=p,s.type="range",o.nodes.length!==3&&o.nodes.length!==5){o.invalid=!0,o.ranges=0,s.type="text";continue}o.ranges++,o.args=[];continue}if(s.type==="range"){m.pop();const g=m[m.length-1];g.value+=s.value+p,s=g,o.ranges--;continue}h({type:"dot",value:p});continue}h({type:"text",value:p})}do if(o=a.pop(),o.type!=="root"){o.nodes.forEach(w=>{w.nodes||(w.type==="open"&&(w.isOpen=!0),w.type==="close"&&(w.isClose=!0),w.nodes||(w.type="text"),w.invalid=!0)});const m=a[a.length-1],g=m.nodes.indexOf(o);m.nodes.splice(g,1,...o.nodes)}while(a.length>0);return h({type:"eos"}),i};var Og=Ig;const _o=vi,Ng=hg,Pg=yg,Lg=Og,Te=(e,t={})=>{let n=[];if(Array.isArray(e))for(const r of e){const i=Te.create(r,t);Array.isArray(i)?n.push(...i):n.push(i)}else n=[].concat(Te.create(e,t));return t&&t.expand===!0&&t.nodupes===!0&&(n=[...new Set(n)]),n};Te.parse=(e,t={})=>Lg(e,t);Te.stringify=(e,t={})=>_o(typeof e=="string"?Te.parse(e,t):e,t);Te.compile=(e,t={})=>(typeof e=="string"&&(e=Te.parse(e,t)),Ng(e,t));Te.expand=(e,t={})=>{typeof e=="string"&&(e=Te.parse(e,t));let n=Pg(e,t);return t.noempty===!0&&(n=n.filter(Boolean)),t.nodupes===!0&&(n=[...new Set(n)]),n};Te.create=(e,t={})=>e===""||e.length<3?[e]:t.expand!==!0?Te.compile(e,t):Te.expand(e,t);var kg=Te,Gt={};const Dg=Se.default,Pe="\\\\/",Ao=`[^${Pe}]`,He="\\.",Mg="\\+",jg="\\?",Vn="\\/",Hg="(?=.)",ks="[^/]",wi=`(?:${Vn}|$)`,Ds=`(?:^|${Vn})`,Ei=`${He}{1,2}${wi}`,Bg=`(?!${He})`,Ug=`(?!${Ds}${Ei})`,Gg=`(?!${He}{0,1}${wi})`,qg=`(?!${Ei})`,Kg=`[^.${Vn}]`,Wg=`${ks}*?`,Ms={DOT_LITERAL:He,PLUS_LITERAL:Mg,QMARK_LITERAL:jg,SLASH_LITERAL:Vn,ONE_CHAR:Hg,QMARK:ks,END_ANCHOR:wi,DOTS_SLASH:Ei,NO_DOT:Bg,NO_DOTS:Ug,NO_DOT_SLASH:Gg,NO_DOTS_SLASH:qg,QMARK_NO_DOT:Kg,STAR:Wg,START_ANCHOR:Ds},zg={...Ms,SLASH_LITERAL:`[${Pe}]`,QMARK:Ao,STAR:`${Ao}*?`,DOTS_SLASH:`${He}{1,2}(?:[${Pe}]|$)`,NO_DOT:`(?!${He})`,NO_DOTS:`(?!(?:^|[${Pe}])${He}{1,2}(?:[${Pe}]|$))`,NO_DOT_SLASH:`(?!${He}{0,1}(?:[${Pe}]|$))`,NO_DOTS_SLASH:`(?!${He}{1,2}(?:[${Pe}]|$))`,QMARK_NO_DOT:`[^.${Pe}]`,START_ANCHOR:`(?:^|[${Pe}])`,END_ANCHOR:`(?:[${Pe}]|$)`},Yg={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};var Xn={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Yg,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:Dg.sep,extglobChars(e){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(e){return e===!0?zg:Ms}};(function(e){const t=Se.default,n=process.platform==="win32",{REGEX_BACKSLASH:r,REGEX_REMOVE_BACKSLASH:i,REGEX_SPECIAL_CHARS:a,REGEX_SPECIAL_CHARS_GLOBAL:o}=Xn;e.isObject=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),e.hasRegexChars=s=>a.test(s),e.isRegexChar=s=>s.length===1&&e.hasRegexChars(s),e.escapeRegex=s=>s.replace(o,"\\$1"),e.toPosixSlashes=s=>s.replace(r,"/"),e.removeBackslashes=s=>s.replace(i,u=>u==="\\"?"":u),e.supportsLookbehinds=()=>{const s=process.version.slice(1).split(".").map(Number);return s.length===3&&s[0]>=9||s[0]===8&&s[1]>=10},e.isWindows=s=>s&&typeof s.windows=="boolean"?s.windows:n===!0||t.sep==="\\",e.escapeLast=(s,u,f)=>{const c=s.lastIndexOf(u,f);return c===-1?s:s[c-1]==="\\"?e.escapeLast(s,u,c-1):`${s.slice(0,c)}\\${s.slice(c)}`},e.removePrefix=(s,u={})=>{let f=s;return f.startsWith("./")&&(f=f.slice(2),u.prefix="./"),f},e.wrapOutput=(s,u={},f={})=>{const c=f.contains?"":"^",l=f.contains?"":"$";let p=`${c}(?:${s})${l}`;return u.negated===!0&&(p=`(?:^(?!${p}).*$)`),p}})(Gt);const To=Gt,{CHAR_ASTERISK:Er,CHAR_AT:Qg,CHAR_BACKWARD_SLASH:Ot,CHAR_COMMA:Vg,CHAR_DOT:br,CHAR_EXCLAMATION_MARK:Sr,CHAR_FORWARD_SLASH:js,CHAR_LEFT_CURLY_BRACE:xr,CHAR_LEFT_PARENTHESES:_r,CHAR_LEFT_SQUARE_BRACKET:Xg,CHAR_PLUS:Zg,CHAR_QUESTION_MARK:Co,CHAR_RIGHT_CURLY_BRACE:Jg,CHAR_RIGHT_PARENTHESES:Ro,CHAR_RIGHT_SQUARE_BRACKET:ey}=Xn,Fo=e=>e===js||e===Ot,$o=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)},ty=(e,t)=>{const n=t||{},r=e.length-1,i=n.parts===!0||n.scanToEnd===!0,a=[],o=[],s=[];let u=e,f=-1,c=0,l=0,p=!1,d=!1,h=!1,m=!1,g=!1,w=!1,S=!1,x=!1,R=!1,T=!1,O=0,M,A,_={value:"",depth:0,isGlob:!1};const N=()=>f>=r,v=()=>u.charCodeAt(f+1),j=()=>(M=A,u.charCodeAt(++f));for(;f<r;){A=j();let $;if(A===Ot){S=_.backslashes=!0,A=j(),A===xr&&(w=!0);continue}if(w===!0||A===xr){for(O++;N()!==!0&&(A=j());){if(A===Ot){S=_.backslashes=!0,j();continue}if(A===xr){O++;continue}if(w!==!0&&A===br&&(A=j())===br){if(p=_.isBrace=!0,h=_.isGlob=!0,T=!0,i===!0)continue;break}if(w!==!0&&A===Vg){if(p=_.isBrace=!0,h=_.isGlob=!0,T=!0,i===!0)continue;break}if(A===Jg&&(O--,O===0)){w=!1,p=_.isBrace=!0,T=!0;break}}if(i===!0)continue;break}if(A===js){if(a.push(f),o.push(_),_={value:"",depth:0,isGlob:!1},T===!0)continue;if(M===br&&f===c+1){c+=2;continue}l=f+1;continue}if(n.noext!==!0&&(A===Zg||A===Qg||A===Er||A===Co||A===Sr)===!0&&v()===_r){if(h=_.isGlob=!0,m=_.isExtglob=!0,T=!0,A===Sr&&f===c&&(R=!0),i===!0){for(;N()!==!0&&(A=j());){if(A===Ot){S=_.backslashes=!0,A=j();continue}if(A===Ro){h=_.isGlob=!0,T=!0;break}}continue}break}if(A===Er){if(M===Er&&(g=_.isGlobstar=!0),h=_.isGlob=!0,T=!0,i===!0)continue;break}if(A===Co){if(h=_.isGlob=!0,T=!0,i===!0)continue;break}if(A===Xg){for(;N()!==!0&&($=j());){if($===Ot){S=_.backslashes=!0,j();continue}if($===ey){d=_.isBracket=!0,h=_.isGlob=!0,T=!0;break}}if(i===!0)continue;break}if(n.nonegate!==!0&&A===Sr&&f===c){x=_.negated=!0,c++;continue}if(n.noparen!==!0&&A===_r){if(h=_.isGlob=!0,i===!0){for(;N()!==!0&&(A=j());){if(A===_r){S=_.backslashes=!0,A=j();continue}if(A===Ro){T=!0;break}}continue}break}if(h===!0){if(T=!0,i===!0)continue;break}}n.noext===!0&&(m=!1,h=!1);let H=u,K="",E="";c>0&&(K=u.slice(0,c),u=u.slice(c),l-=c),H&&h===!0&&l>0?(H=u.slice(0,l),E=u.slice(l)):h===!0?(H="",E=u):H=u,H&&H!==""&&H!=="/"&&H!==u&&Fo(H.charCodeAt(H.length-1))&&(H=H.slice(0,-1)),n.unescape===!0&&(E&&(E=To.removeBackslashes(E)),H&&S===!0&&(H=To.removeBackslashes(H)));const b={prefix:K,input:e,start:c,base:H,glob:E,isBrace:p,isBracket:d,isGlob:h,isExtglob:m,isGlobstar:g,negated:x,negatedExtglob:R};if(n.tokens===!0&&(b.maxDepth=0,Fo(A)||o.push(_),b.tokens=o),n.parts===!0||n.tokens===!0){let $;for(let D=0;D<a.length;D++){const U=$?$+1:c,W=a[D],Q=e.slice(U,W);n.tokens&&(D===0&&c!==0?(o[D].isPrefix=!0,o[D].value=K):o[D].value=Q,$o(o[D]),b.maxDepth+=o[D].depth),(D!==0||Q!=="")&&s.push(Q),$=W}if($&&$+1<e.length){const D=e.slice($+1);s.push(D),n.tokens&&(o[o.length-1].value=D,$o(o[o.length-1]),b.maxDepth+=o[o.length-1].depth)}b.slashes=a,b.parts=s}return b};var ny=ty;const Cn=Xn,xe=Gt,{MAX_LENGTH:Rn,POSIX_REGEX_SOURCE:ry,REGEX_NON_SPECIAL_CHARS:iy,REGEX_SPECIAL_CHARS_BACKREF:oy,REPLACEMENTS:Hs}=Cn,ay=(e,t)=>{if(typeof t.expandRange=="function")return t.expandRange(...e,t);e.sort();const n=`[${e.join("-")}]`;try{new RegExp(n)}catch{return e.map(i=>xe.escapeRegex(i)).join("..")}return n},ct=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,bi=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");e=Hs[e]||e;const n={...t},r=typeof n.maxLength=="number"?Math.min(Rn,n.maxLength):Rn;let i=e.length;if(i>r)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${r}`);const a={type:"bos",value:"",output:n.prepend||""},o=[a],s=n.capture?"":"?:",u=xe.isWindows(t),f=Cn.globChars(u),c=Cn.extglobChars(f),{DOT_LITERAL:l,PLUS_LITERAL:p,SLASH_LITERAL:d,ONE_CHAR:h,DOTS_SLASH:m,NO_DOT:g,NO_DOT_SLASH:w,NO_DOTS_SLASH:S,QMARK:x,QMARK_NO_DOT:R,STAR:T,START_ANCHOR:O}=f,M=L=>`(${s}(?:(?!${O}${L.dot?m:l}).)*?)`,A=n.dot?"":g,_=n.dot?x:R;let N=n.bash===!0?M(n):T;n.capture&&(N=`(${N})`),typeof n.noext=="boolean"&&(n.noextglob=n.noext);const v={input:e,index:-1,start:0,dot:n.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:o};e=xe.removePrefix(e,v),i=e.length;const j=[],H=[],K=[];let E=a,b;const $=()=>v.index===i-1,D=v.peek=(L=1)=>e[v.index+L],U=v.advance=()=>e[++v.index]||"",W=()=>e.slice(v.index+1),Q=(L="",Y=0)=>{v.consumed+=L,v.index+=Y},ee=L=>{v.output+=L.output!=null?L.output:L.value,Q(L.value)},Ce=()=>{let L=1;for(;D()==="!"&&(D(2)!=="("||D(3)==="?");)U(),v.start++,L++;return L%2===0?!1:(v.negated=!0,v.start++,!0)},F=L=>{v[L]++,K.push(L)},k=L=>{v[L]--,K.pop()},P=L=>{if(E.type==="globstar"){const Y=v.braces>0&&(L.type==="comma"||L.type==="brace"),I=L.extglob===!0||j.length&&(L.type==="pipe"||L.type==="paren");L.type!=="slash"&&L.type!=="paren"&&!Y&&!I&&(v.output=v.output.slice(0,-E.output.length),E.type="star",E.value="*",E.output=N,v.output+=E.output)}if(j.length&&L.type!=="paren"&&(j[j.length-1].inner+=L.value),(L.value||L.output)&&ee(L),E&&E.type==="text"&&L.type==="text"){E.value+=L.value,E.output=(E.output||"")+L.value;return}L.prev=E,o.push(L),E=L},V=(L,Y)=>{const I={...c[Y],conditions:1,inner:""};I.prev=E,I.parens=v.parens,I.output=v.output;const q=(n.capture?"(":"")+I.open;F("parens"),P({type:L,value:Y,output:v.output?"":h}),P({type:"paren",extglob:!0,value:U(),output:q}),j.push(I)},ce=L=>{let Y=L.close+(n.capture?")":""),I;if(L.type==="negate"){let q=N;if(L.inner&&L.inner.length>1&&L.inner.includes("/")&&(q=M(n)),(q!==N||$()||/^\)+$/.test(W()))&&(Y=L.close=`)$))${q}`),L.inner.includes("*")&&(I=W())&&/^\.[^\\/.]+$/.test(I)){const X=bi(I,{...t,fastpaths:!1}).output;Y=L.close=`)${X})${q})`}L.prev.type==="bos"&&(v.negatedExtglob=!0)}P({type:"paren",extglob:!0,value:b,output:Y}),k("parens")};if(n.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let L=!1,Y=e.replace(oy,(I,q,X,oe,Z,Ne)=>oe==="\\"?(L=!0,I):oe==="?"?q?q+oe+(Z?x.repeat(Z.length):""):Ne===0?_+(Z?x.repeat(Z.length):""):x.repeat(X.length):oe==="."?l.repeat(X.length):oe==="*"?q?q+oe+(Z?N:""):N:q?I:`\\${I}`);return L===!0&&(n.unescape===!0?Y=Y.replace(/\\/g,""):Y=Y.replace(/\\+/g,I=>I.length%2===0?"\\\\":I?"\\":"")),Y===e&&n.contains===!0?(v.output=e,v):(v.output=xe.wrapOutput(Y,v,t),v)}for(;!$();){if(b=U(),b==="\0")continue;if(b==="\\"){const I=D();if(I==="/"&&n.bash!==!0||I==="."||I===";")continue;if(!I){b+="\\",P({type:"text",value:b});continue}const q=/^\\+/.exec(W());let X=0;if(q&&q[0].length>2&&(X=q[0].length,v.index+=X,X%2!==0&&(b+="\\")),n.unescape===!0?b=U():b+=U(),v.brackets===0){P({type:"text",value:b});continue}}if(v.brackets>0&&(b!=="]"||E.value==="["||E.value==="[^")){if(n.posix!==!1&&b===":"){const I=E.value.slice(1);if(I.includes("[")&&(E.posix=!0,I.includes(":"))){const q=E.value.lastIndexOf("["),X=E.value.slice(0,q),oe=E.value.slice(q+2),Z=ry[oe];if(Z){E.value=X+Z,v.backtrack=!0,U(),!a.output&&o.indexOf(E)===1&&(a.output=h);continue}}}(b==="["&&D()!==":"||b==="-"&&D()==="]")&&(b=`\\${b}`),b==="]"&&(E.value==="["||E.value==="[^")&&(b=`\\${b}`),n.posix===!0&&b==="!"&&E.value==="["&&(b="^"),E.value+=b,ee({value:b});continue}if(v.quotes===1&&b!=='"'){b=xe.escapeRegex(b),E.value+=b,ee({value:b});continue}if(b==='"'){v.quotes=v.quotes===1?0:1,n.keepQuotes===!0&&P({type:"text",value:b});continue}if(b==="("){F("parens"),P({type:"paren",value:b});continue}if(b===")"){if(v.parens===0&&n.strictBrackets===!0)throw new SyntaxError(ct("opening","("));const I=j[j.length-1];if(I&&v.parens===I.parens+1){ce(j.pop());continue}P({type:"paren",value:b,output:v.parens?")":"\\)"}),k("parens");continue}if(b==="["){if(n.nobracket===!0||!W().includes("]")){if(n.nobracket!==!0&&n.strictBrackets===!0)throw new SyntaxError(ct("closing","]"));b=`\\${b}`}else F("brackets");P({type:"bracket",value:b});continue}if(b==="]"){if(n.nobracket===!0||E&&E.type==="bracket"&&E.value.length===1){P({type:"text",value:b,output:`\\${b}`});continue}if(v.brackets===0){if(n.strictBrackets===!0)throw new SyntaxError(ct("opening","["));P({type:"text",value:b,output:`\\${b}`});continue}k("brackets");const I=E.value.slice(1);if(E.posix!==!0&&I[0]==="^"&&!I.includes("/")&&(b=`/${b}`),E.value+=b,ee({value:b}),n.literalBrackets===!1||xe.hasRegexChars(I))continue;const q=xe.escapeRegex(E.value);if(v.output=v.output.slice(0,-E.value.length),n.literalBrackets===!0){v.output+=q,E.value=q;continue}E.value=`(${s}${q}|${E.value})`,v.output+=E.value;continue}if(b==="{"&&n.nobrace!==!0){F("braces");const I={type:"brace",value:b,output:"(",outputIndex:v.output.length,tokensIndex:v.tokens.length};H.push(I),P(I);continue}if(b==="}"){const I=H[H.length-1];if(n.nobrace===!0||!I){P({type:"text",value:b,output:b});continue}let q=")";if(I.dots===!0){const X=o.slice(),oe=[];for(let Z=X.length-1;Z>=0&&(o.pop(),X[Z].type!=="brace");Z--)X[Z].type!=="dots"&&oe.unshift(X[Z].value);q=ay(oe,n),v.backtrack=!0}if(I.comma!==!0&&I.dots!==!0){const X=v.output.slice(0,I.outputIndex),oe=v.tokens.slice(I.tokensIndex);I.value=I.output="\\{",b=q="\\}",v.output=X;for(const Z of oe)v.output+=Z.output||Z.value}P({type:"brace",value:b,output:q}),k("braces"),H.pop();continue}if(b==="|"){j.length>0&&j[j.length-1].conditions++,P({type:"text",value:b});continue}if(b===","){let I=b;const q=H[H.length-1];q&&K[K.length-1]==="braces"&&(q.comma=!0,I="|"),P({type:"comma",value:b,output:I});continue}if(b==="/"){if(E.type==="dot"&&v.index===v.start+1){v.start=v.index+1,v.consumed="",v.output="",o.pop(),E=a;continue}P({type:"slash",value:b,output:d});continue}if(b==="."){if(v.braces>0&&E.type==="dot"){E.value==="."&&(E.output=l);const I=H[H.length-1];E.type="dots",E.output+=b,E.value+=b,I.dots=!0;continue}if(v.braces+v.parens===0&&E.type!=="bos"&&E.type!=="slash"){P({type:"text",value:b,output:l});continue}P({type:"dot",value:b,output:l});continue}if(b==="?"){if(!(E&&E.value==="(")&&n.noextglob!==!0&&D()==="("&&D(2)!=="?"){V("qmark",b);continue}if(E&&E.type==="paren"){const q=D();let X=b;if(q==="<"&&!xe.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(E.value==="("&&!/[!=<:]/.test(q)||q==="<"&&!/<([!=]|\w+>)/.test(W()))&&(X=`\\${b}`),P({type:"text",value:b,output:X});continue}if(n.dot!==!0&&(E.type==="slash"||E.type==="bos")){P({type:"qmark",value:b,output:R});continue}P({type:"qmark",value:b,output:x});continue}if(b==="!"){if(n.noextglob!==!0&&D()==="("&&(D(2)!=="?"||!/[!=<:]/.test(D(3)))){V("negate",b);continue}if(n.nonegate!==!0&&v.index===0){Ce();continue}}if(b==="+"){if(n.noextglob!==!0&&D()==="("&&D(2)!=="?"){V("plus",b);continue}if(E&&E.value==="("||n.regex===!1){P({type:"plus",value:b,output:p});continue}if(E&&(E.type==="bracket"||E.type==="paren"||E.type==="brace")||v.parens>0){P({type:"plus",value:b});continue}P({type:"plus",value:p});continue}if(b==="@"){if(n.noextglob!==!0&&D()==="("&&D(2)!=="?"){P({type:"at",extglob:!0,value:b,output:""});continue}P({type:"text",value:b});continue}if(b!=="*"){(b==="$"||b==="^")&&(b=`\\${b}`);const I=iy.exec(W());I&&(b+=I[0],v.index+=I[0].length),P({type:"text",value:b});continue}if(E&&(E.type==="globstar"||E.star===!0)){E.type="star",E.star=!0,E.value+=b,E.output=N,v.backtrack=!0,v.globstar=!0,Q(b);continue}let L=W();if(n.noextglob!==!0&&/^\([^?]/.test(L)){V("star",b);continue}if(E.type==="star"){if(n.noglobstar===!0){Q(b);continue}const I=E.prev,q=I.prev,X=I.type==="slash"||I.type==="bos",oe=q&&(q.type==="star"||q.type==="globstar");if(n.bash===!0&&(!X||L[0]&&L[0]!=="/")){P({type:"star",value:b,output:""});continue}const Z=v.braces>0&&(I.type==="comma"||I.type==="brace"),Ne=j.length&&(I.type==="pipe"||I.type==="paren");if(!X&&I.type!=="paren"&&!Z&&!Ne){P({type:"star",value:b,output:""});continue}for(;L.slice(0,3)==="/**";){const je=e[v.index+4];if(je&&je!=="/")break;L=L.slice(3),Q("/**",3)}if(I.type==="bos"&&$()){E.type="globstar",E.value+=b,E.output=M(n),v.output=E.output,v.globstar=!0,Q(b);continue}if(I.type==="slash"&&I.prev.type!=="bos"&&!oe&&$()){v.output=v.output.slice(0,-(I.output+E.output).length),I.output=`(?:${I.output}`,E.type="globstar",E.output=M(n)+(n.strictSlashes?")":"|$)"),E.value+=b,v.globstar=!0,v.output+=I.output+E.output,Q(b);continue}if(I.type==="slash"&&I.prev.type!=="bos"&&L[0]==="/"){const je=L[1]!==void 0?"|$":"";v.output=v.output.slice(0,-(I.output+E.output).length),I.output=`(?:${I.output}`,E.type="globstar",E.output=`${M(n)}${d}|${d}${je})`,E.value+=b,v.output+=I.output+E.output,v.globstar=!0,Q(b+U()),P({type:"slash",value:"/",output:""});continue}if(I.type==="bos"&&L[0]==="/"){E.type="globstar",E.value+=b,E.output=`(?:^|${d}|${M(n)}${d})`,v.output=E.output,v.globstar=!0,Q(b+U()),P({type:"slash",value:"/",output:""});continue}v.output=v.output.slice(0,-E.output.length),E.type="globstar",E.output=M(n),E.value+=b,v.output+=E.output,v.globstar=!0,Q(b);continue}const Y={type:"star",value:b,output:N};if(n.bash===!0){Y.output=".*?",(E.type==="bos"||E.type==="slash")&&(Y.output=A+Y.output),P(Y);continue}if(E&&(E.type==="bracket"||E.type==="paren")&&n.regex===!0){Y.output=b,P(Y);continue}(v.index===v.start||E.type==="slash"||E.type==="dot")&&(E.type==="dot"?(v.output+=w,E.output+=w):n.dot===!0?(v.output+=S,E.output+=S):(v.output+=A,E.output+=A),D()!=="*"&&(v.output+=h,E.output+=h)),P(Y)}for(;v.brackets>0;){if(n.strictBrackets===!0)throw new SyntaxError(ct("closing","]"));v.output=xe.escapeLast(v.output,"["),k("brackets")}for(;v.parens>0;){if(n.strictBrackets===!0)throw new SyntaxError(ct("closing",")"));v.output=xe.escapeLast(v.output,"("),k("parens")}for(;v.braces>0;){if(n.strictBrackets===!0)throw new SyntaxError(ct("closing","}"));v.output=xe.escapeLast(v.output,"{"),k("braces")}if(n.strictSlashes!==!0&&(E.type==="star"||E.type==="bracket")&&P({type:"maybe_slash",value:"",output:`${d}?`}),v.backtrack===!0){v.output="";for(const L of v.tokens)v.output+=L.output!=null?L.output:L.value,L.suffix&&(v.output+=L.suffix)}return v};bi.fastpaths=(e,t)=>{const n={...t},r=typeof n.maxLength=="number"?Math.min(Rn,n.maxLength):Rn,i=e.length;if(i>r)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${r}`);e=Hs[e]||e;const a=xe.isWindows(t),{DOT_LITERAL:o,SLASH_LITERAL:s,ONE_CHAR:u,DOTS_SLASH:f,NO_DOT:c,NO_DOTS:l,NO_DOTS_SLASH:p,STAR:d,START_ANCHOR:h}=Cn.globChars(a),m=n.dot?l:c,g=n.dot?p:c,w=n.capture?"":"?:",S={negated:!1,prefix:""};let x=n.bash===!0?".*?":d;n.capture&&(x=`(${x})`);const R=A=>A.noglobstar===!0?x:`(${w}(?:(?!${h}${A.dot?f:o}).)*?)`,T=A=>{switch(A){case"*":return`${m}${u}${x}`;case".*":return`${o}${u}${x}`;case"*.*":return`${m}${x}${o}${u}${x}`;case"*/*":return`${m}${x}${s}${u}${g}${x}`;case"**":return m+R(n);case"**/*":return`(?:${m}${R(n)}${s})?${g}${u}${x}`;case"**/*.*":return`(?:${m}${R(n)}${s})?${g}${x}${o}${u}${x}`;case"**/.*":return`(?:${m}${R(n)}${s})?${o}${u}${x}`;default:{const _=/^(.*?)\.(\w+)$/.exec(A);if(!_)return;const N=T(_[1]);return N?N+o+_[2]:void 0}}},O=xe.removePrefix(e,S);let M=T(O);return M&&n.strictSlashes!==!0&&(M+=`${s}?`),M};var sy=bi;const uy=Se.default,cy=ny,qr=sy,Si=Gt,ly=Xn,fy=e=>e&&typeof e=="object"&&!Array.isArray(e),ae=(e,t,n=!1)=>{if(Array.isArray(e)){const c=e.map(p=>ae(p,t,n));return p=>{for(const d of c){const h=d(p);if(h)return h}return!1}}const r=fy(e)&&e.tokens&&e.input;if(e===""||typeof e!="string"&&!r)throw new TypeError("Expected pattern to be a non-empty string");const i=t||{},a=Si.isWindows(t),o=r?ae.compileRe(e,t):ae.makeRe(e,t,!1,!0),s=o.state;delete o.state;let u=()=>!1;if(i.ignore){const c={...t,ignore:null,onMatch:null,onResult:null};u=ae(i.ignore,c,n)}const f=(c,l=!1)=>{const{isMatch:p,match:d,output:h}=ae.test(c,o,t,{glob:e,posix:a}),m={glob:e,state:s,regex:o,posix:a,input:c,output:h,match:d,isMatch:p};return typeof i.onResult=="function"&&i.onResult(m),p===!1?(m.isMatch=!1,l?m:!1):u(c)?(typeof i.onIgnore=="function"&&i.onIgnore(m),m.isMatch=!1,l?m:!1):(typeof i.onMatch=="function"&&i.onMatch(m),l?m:!0)};return n&&(f.state=s),f};ae.test=(e,t,n,{glob:r,posix:i}={})=>{if(typeof e!="string")throw new TypeError("Expected input to be a string");if(e==="")return{isMatch:!1,output:""};const a=n||{},o=a.format||(i?Si.toPosixSlashes:null);let s=e===r,u=s&&o?o(e):e;return s===!1&&(u=o?o(e):e,s=u===r),(s===!1||a.capture===!0)&&(a.matchBase===!0||a.basename===!0?s=ae.matchBase(e,t,n,i):s=t.exec(u)),{isMatch:!!s,match:s,output:u}};ae.matchBase=(e,t,n,r=Si.isWindows(n))=>(t instanceof RegExp?t:ae.makeRe(t,n)).test(uy.basename(e));ae.isMatch=(e,t,n)=>ae(t,n)(e);ae.parse=(e,t)=>Array.isArray(e)?e.map(n=>ae.parse(n,t)):qr(e,{...t,fastpaths:!1});ae.scan=(e,t)=>cy(e,t);ae.compileRe=(e,t,n=!1,r=!1)=>{if(n===!0)return e.output;const i=t||{},a=i.contains?"":"^",o=i.contains?"":"$";let s=`${a}(?:${e.output})${o}`;e&&e.negated===!0&&(s=`^(?!${s}).*$`);const u=ae.toRegex(s,t);return r===!0&&(u.state=e),u};ae.makeRe=(e,t={},n=!1,r=!1)=>{if(!e||typeof e!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]==="."||e[0]==="*")&&(i.output=qr.fastpaths(e,t)),i.output||(i=qr(e,t)),ae.compileRe(i,t,n,r)};ae.toRegex=(e,t)=>{try{const n=t||{};return new RegExp(e,n.flags||(n.nocase?"i":""))}catch(n){if(t&&t.debug===!0)throw n;return/$^/}};ae.constants=ly;var py=ae,dy=py;const Bs=it.default,Us=kg,Me=dy,Kr=Gt,Io=e=>e===""||e==="./",Gs=e=>{const t=e.indexOf("{");return t>-1&&e.indexOf("}",t)>-1},J=(e,t,n)=>{t=[].concat(t),e=[].concat(e);let r=new Set,i=new Set,a=new Set,o=0,s=c=>{a.add(c.output),n&&n.onResult&&n.onResult(c)};for(let c=0;c<t.length;c++){let l=Me(String(t[c]),{...n,onResult:s},!0),p=l.state.negated||l.state.negatedExtglob;p&&o++;for(let d of e){let h=l(d,!0);(p?!h.isMatch:h.isMatch)&&(p?r.add(h.output):(r.delete(h.output),i.add(h.output)))}}let f=(o===t.length?[...a]:[...i]).filter(c=>!r.has(c));if(n&&f.length===0){if(n.failglob===!0)throw new Error(`No matches found for "${t.join(", ")}"`);if(n.nonull===!0||n.nullglob===!0)return n.unescape?t.map(c=>c.replace(/\\/g,"")):t}return f};J.match=J;J.matcher=(e,t)=>Me(e,t);J.isMatch=(e,t,n)=>Me(t,n)(e);J.any=J.isMatch;J.not=(e,t,n={})=>{t=[].concat(t).map(String);let r=new Set,i=[],a=s=>{n.onResult&&n.onResult(s),i.push(s.output)},o=new Set(J(e,t,{...n,onResult:a}));for(let s of i)o.has(s)||r.add(s);return[...r]};J.contains=(e,t,n)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${Bs.inspect(e)}"`);if(Array.isArray(t))return t.some(r=>J.contains(e,r,n));if(typeof t=="string"){if(Io(e)||Io(t))return!1;if(e.includes(t)||e.startsWith("./")&&e.slice(2).includes(t))return!0}return J.isMatch(e,t,{...n,contains:!0})};J.matchKeys=(e,t,n)=>{if(!Kr.isObject(e))throw new TypeError("Expected the first argument to be an object");let r=J(Object.keys(e),t,n),i={};for(let a of r)i[a]=e[a];return i};J.some=(e,t,n)=>{let r=[].concat(e);for(let i of[].concat(t)){let a=Me(String(i),n);if(r.some(o=>a(o)))return!0}return!1};J.every=(e,t,n)=>{let r=[].concat(e);for(let i of[].concat(t)){let a=Me(String(i),n);if(!r.every(o=>a(o)))return!1}return!0};J.all=(e,t,n)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${Bs.inspect(e)}"`);return[].concat(t).every(r=>Me(r,n)(e))};J.capture=(e,t,n)=>{let r=Kr.isWindows(n),a=Me.makeRe(String(e),{...n,capture:!0}).exec(r?Kr.toPosixSlashes(t):t);if(a)return a.slice(1).map(o=>o===void 0?"":o)};J.makeRe=(...e)=>Me.makeRe(...e);J.scan=(...e)=>Me.scan(...e);J.parse=(e,t)=>{let n=[];for(let r of[].concat(e||[]))for(let i of Us(String(r),t))n.push(Me.parse(i,t));return n};J.braces=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return t&&t.nobrace===!0||!Gs(e)?[e]:Us(e,t)};J.braceExpand=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return J.braces(e,{...t,expand:!0})};J.hasBraces=Gs;var hy=J,xi=Ee&&Ee.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ae,"__esModule",{value:!0});Ae.readPackageJSON=Ae.extractWorkspaces=Ae.isMatchWorkspaces=Ae.checkWorkspaces=Ae.findWorkspaceRoot=void 0;const Fn=xi(Se.default),my=xi(Ym),Oo=We.default,gy=xi(hy);function Ue(e){e||(e=process.cwd());let t=my.default.sync(e);if(!t)return null;e=Fn.default.normalize(t);let n=null,r=e;do{const i=Jn(r);Zn(i);let{done:a,found:o}=qs(r,e);if(a)return o;n=r,r=Fn.default.dirname(r)}while(r!==n);return null}Ae.findWorkspaceRoot=Ue;function qs(e,t){const n=Jn(e),r=Zn(n);let i=!1,a,o;return r&&(i=!0,o=Fn.default.relative(e,t),o===""||_i(o,r)?a=e:a=null),{done:i,found:a,relativePath:o}}Ae.checkWorkspaces=qs;function _i(e,t){return gy.default([e],t).length>0}Ae.isMatchWorkspaces=_i;function Zn(e){const t=(e||{}).workspaces;return t&&t.packages||(Array.isArray(t)?t:null)}Ae.extractWorkspaces=Zn;function Jn(e){const t=Fn.default.join(e,"package.json");return Oo.existsSync(t)?JSON.parse(Oo.readFileSync(t,"utf8")):null}Ae.readPackageJSON=Jn;Ue.findWorkspaceRoot=Ue;Ue.readPackageJSON=Jn;Ue.extractWorkspaces=Zn;Ue.isMatchWorkspaces=_i;Ue.default=Ue;Ae.default=Ue;const yy=Ae;yy.findWorkspaceRoot;var vy={exports:{}},Ai={exports:{}};class wy{constructor(t){this.value=t,this.next=void 0}}let Ey=class{constructor(){this.clear()}enqueue(t){const n=new wy(t);this._head?(this._tail.next=n,this._tail=n):(this._head=n,this._tail=n),this._size++}dequeue(){const t=this._head;if(t)return this._head=this._head.next,this._size--,t.value}clear(){this._head=void 0,this._tail=void 0,this._size=0}get size(){return this._size}*[Symbol.iterator](){let t=this._head;for(;t;)yield t.value,t=t.next}};var by=Ey;const Sy=by,xy=e=>{if(!((Number.isInteger(e)||e===1/0)&&e>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up");const t=new Sy;let n=0;const r=()=>{n--,t.size>0&&t.dequeue()()},i=async(s,u,...f)=>{n++;const c=(async()=>s(...f))();u(c);try{await c}catch{}r()},a=(s,u,...f)=>{t.enqueue(i.bind(null,s,u,...f)),(async()=>(await Promise.resolve(),n<e&&t.size>0&&t.dequeue()()))()},o=(s,...u)=>new Promise(f=>{a(s,f,...u)});return Object.defineProperties(o,{activeCount:{get:()=>n},pendingCount:{get:()=>t.size},clearQueue:{value:()=>{t.clear()}}}),o};var _y=xy;const No=_y;class Ks extends Error{constructor(t){super(),this.value=t}}const Ay=async(e,t)=>t(await e),Ty=async e=>{const t=await Promise.all(e);if(t[1]===!0)throw new Ks(t[0]);return!1},Cy=async(e,t,n)=>{n={concurrency:1/0,preserveOrder:!0,...n};const r=No(n.concurrency),i=[...e].map(o=>[o,r(Ay,o,t)]),a=No(n.preserveOrder?1:1/0);try{await Promise.all(i.map(o=>a(Ty,o)))}catch(o){if(o instanceof Ks)return o.value;throw o}};var Ry=Cy;const Ws=Se.default,$n=We.default,{promisify:zs}=it.default,Fy=Ry,$y=zs($n.stat),Iy=zs($n.lstat),Ys={directory:"isDirectory",file:"isFile"};function Qs({type:e}){if(!(e in Ys))throw new Error(`Invalid type specified: ${e}`)}const Vs=(e,t)=>e===void 0||t[Ys[e]]();Ai.exports=async(e,t)=>{t={cwd:process.cwd(),type:"file",allowSymlinks:!0,...t},Qs(t);const n=t.allowSymlinks?$y:Iy;return Fy(e,async r=>{try{const i=await n(Ws.resolve(t.cwd,r));return Vs(t.type,i)}catch{return!1}},t)};Ai.exports.sync=(e,t)=>{t={cwd:process.cwd(),allowSymlinks:!0,type:"file",...t},Qs(t);const n=t.allowSymlinks?$n.statSync:$n.lstatSync;for(const r of e)try{const i=n(Ws.resolve(t.cwd,r));if(Vs(t.type,i))return r}catch{}};var Oy=Ai.exports;(function(e){const t=Se.default,n=Oy,r=Ts,i=Symbol("findUp.stop");e.exports=async(a,o={})=>{let s=t.resolve(o.cwd||"");const{root:u}=t.parse(s),f=[].concat(a),c=async l=>{if(typeof a!="function")return n(f,l);const p=await a(l.cwd);return typeof p=="string"?n([p],l):p};for(;;){const l=await c({...o,cwd:s});if(l===i)return;if(l)return t.resolve(s,l);if(s===u)return;s=t.dirname(s)}},e.exports.sync=(a,o={})=>{let s=t.resolve(o.cwd||"");const{root:u}=t.parse(s),f=[].concat(a),c=l=>{if(typeof a!="function")return n.sync(f,l);const p=a(l.cwd);return typeof p=="string"?n.sync([p],l):p};for(;;){const l=c({...o,cwd:s});if(l===i)return;if(l)return t.resolve(s,l);if(s===u)return;s=t.dirname(s)}},e.exports.exists=r,e.exports.sync.exists=r.sync,e.exports.stop=i})(vy);var Xs={exports:{}},Ge=lc.default,Ny=process.cwd,cn=null,Py=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return cn||(cn=Ny.call(process)),cn};try{process.cwd()}catch{}if(typeof process.chdir=="function"){var Po=process.chdir;process.chdir=function(e){cn=null,Po.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Po)}var Ly=ky;function ky(e){Ge.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&t(e),e.lutimes||n(e),e.chown=a(e.chown),e.fchown=a(e.fchown),e.lchown=a(e.lchown),e.chmod=r(e.chmod),e.fchmod=r(e.fchmod),e.lchmod=r(e.lchmod),e.chownSync=o(e.chownSync),e.fchownSync=o(e.fchownSync),e.lchownSync=o(e.lchownSync),e.chmodSync=i(e.chmodSync),e.fchmodSync=i(e.fchmodSync),e.lchmodSync=i(e.lchmodSync),e.stat=s(e.stat),e.fstat=s(e.fstat),e.lstat=s(e.lstat),e.statSync=u(e.statSync),e.fstatSync=u(e.fstatSync),e.lstatSync=u(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(c,l,p){p&&process.nextTick(p)},e.lchmodSync=function(){}),e.chown&&!e.lchown&&(e.lchown=function(c,l,p,d){d&&process.nextTick(d)},e.lchownSync=function(){}),Py==="win32"&&(e.rename=typeof e.rename!="function"?e.rename:(function(c){function l(p,d,h){var m=Date.now(),g=0;c(p,d,function w(S){if(S&&(S.code==="EACCES"||S.code==="EPERM"||S.code==="EBUSY")&&Date.now()-m<6e4){setTimeout(function(){e.stat(d,function(x,R){x&&x.code==="ENOENT"?c(p,d,w):h(S)})},g),g<100&&(g+=10);return}h&&h(S)})}return Object.setPrototypeOf&&Object.setPrototypeOf(l,c),l})(e.rename)),e.read=typeof e.read!="function"?e.read:(function(c){function l(p,d,h,m,g,w){var S;if(w&&typeof w=="function"){var x=0;S=function(R,T,O){if(R&&R.code==="EAGAIN"&&x<10)return x++,c.call(e,p,d,h,m,g,S);w.apply(this,arguments)}}return c.call(e,p,d,h,m,g,S)}return Object.setPrototypeOf&&Object.setPrototypeOf(l,c),l})(e.read),e.readSync=typeof e.readSync!="function"?e.readSync:(function(c){return function(l,p,d,h,m){for(var g=0;;)try{return c.call(e,l,p,d,h,m)}catch(w){if(w.code==="EAGAIN"&&g<10){g++;continue}throw w}}})(e.readSync);function t(c){c.lchmod=function(l,p,d){c.open(l,Ge.O_WRONLY|Ge.O_SYMLINK,p,function(h,m){if(h){d&&d(h);return}c.fchmod(m,p,function(g){c.close(m,function(w){d&&d(g||w)})})})},c.lchmodSync=function(l,p){var d=c.openSync(l,Ge.O_WRONLY|Ge.O_SYMLINK,p),h=!0,m;try{m=c.fchmodSync(d,p),h=!1}finally{if(h)try{c.closeSync(d)}catch{}else c.closeSync(d)}return m}}function n(c){Ge.hasOwnProperty("O_SYMLINK")&&c.futimes?(c.lutimes=function(l,p,d,h){c.open(l,Ge.O_SYMLINK,function(m,g){if(m){h&&h(m);return}c.futimes(g,p,d,function(w){c.close(g,function(S){h&&h(w||S)})})})},c.lutimesSync=function(l,p,d){var h=c.openSync(l,Ge.O_SYMLINK),m,g=!0;try{m=c.futimesSync(h,p,d),g=!1}finally{if(g)try{c.closeSync(h)}catch{}else c.closeSync(h)}return m}):c.futimes&&(c.lutimes=function(l,p,d,h){h&&process.nextTick(h)},c.lutimesSync=function(){})}function r(c){return c&&function(l,p,d){return c.call(e,l,p,function(h){f(h)&&(h=null),d&&d.apply(this,arguments)})}}function i(c){return c&&function(l,p){try{return c.call(e,l,p)}catch(d){if(!f(d))throw d}}}function a(c){return c&&function(l,p,d,h){return c.call(e,l,p,d,function(m){f(m)&&(m=null),h&&h.apply(this,arguments)})}}function o(c){return c&&function(l,p,d){try{return c.call(e,l,p,d)}catch(h){if(!f(h))throw h}}}function s(c){return c&&function(l,p,d){typeof p=="function"&&(d=p,p=null);function h(m,g){g&&(g.uid<0&&(g.uid+=4294967296),g.gid<0&&(g.gid+=4294967296)),d&&d.apply(this,arguments)}return p?c.call(e,l,p,h):c.call(e,l,h)}}function u(c){return c&&function(l,p){var d=p?c.call(e,l,p):c.call(e,l);return d&&(d.uid<0&&(d.uid+=4294967296),d.gid<0&&(d.gid+=4294967296)),d}}function f(c){if(!c||c.code==="ENOSYS")return!0;var l=!process.getuid||process.getuid()!==0;return!!(l&&(c.code==="EINVAL"||c.code==="EPERM"))}}var Lo=Dn.default.Stream,Dy=My;function My(e){return{ReadStream:t,WriteStream:n};function t(r,i){if(!(this instanceof t))return new t(r,i);Lo.call(this);var a=this;this.path=r,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var o=Object.keys(i),s=0,u=o.length;s<u;s++){var f=o[s];this[f]=i[f]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){a._read()});return}e.open(this.path,this.flags,this.mode,function(c,l){if(c){a.emit("error",c),a.readable=!1;return}a.fd=l,a.emit("open",l),a._read()})}function n(r,i){if(!(this instanceof n))return new n(r,i);Lo.call(this),this.path=r,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var a=Object.keys(i),o=0,s=a.length;o<s;o++){var u=a[o];this[u]=i[u]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}var jy=By,Hy=Object.getPrototypeOf||function(e){return e.__proto__};function By(e){if(e===null||typeof e!="object")return e;if(e instanceof Object)var t={__proto__:Hy(e)};else var t=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}),t}var ne=We.default,Uy=Ly,Gy=Dy,qy=jy,tn=it.default,pe,In;typeof Symbol=="function"&&typeof Symbol.for=="function"?(pe=Symbol.for("graceful-fs.queue"),In=Symbol.for("graceful-fs.previous")):(pe="___graceful-fs.queue",In="___graceful-fs.previous");function Ky(){}function Zs(e,t){Object.defineProperty(e,pe,{get:function(){return t}})}var Je=Ky;tn.debuglog?Je=tn.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Je=function(){var e=tn.format.apply(tn,arguments);e="GFS4: "+e.split(/\n/).join(`
46
+ GFS4: `),console.error(e)});if(!ne[pe]){var Wy=Ee[pe]||[];Zs(ne,Wy),ne.close=(function(e){function t(n,r){return e.call(ne,n,function(i){i||ko(),typeof r=="function"&&r.apply(this,arguments)})}return Object.defineProperty(t,In,{value:e}),t})(ne.close),ne.closeSync=(function(e){function t(n){e.apply(ne,arguments),ko()}return Object.defineProperty(t,In,{value:e}),t})(ne.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Je(ne[pe]),ca.default.equal(ne[pe].length,0)})}Ee[pe]||Zs(Ee,ne[pe]);var Js=Ti(qy(ne));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!ne.__patched&&(Js=Ti(ne),ne.__patched=!0);function Ti(e){Uy(e),e.gracefulify=Ti,e.createReadStream=T,e.createWriteStream=O;var t=e.readFile;e.readFile=n;function n(_,N,v){return typeof N=="function"&&(v=N,N=null),j(_,N,v);function j(H,K,E,b){return t(H,K,function($){$&&($.code==="EMFILE"||$.code==="ENFILE")?lt([j,[H,K,E],$,b||Date.now(),Date.now()]):typeof E=="function"&&E.apply(this,arguments)})}}var r=e.writeFile;e.writeFile=i;function i(_,N,v,j){return typeof v=="function"&&(j=v,v=null),H(_,N,v,j);function H(K,E,b,$,D){return r(K,E,b,function(U){U&&(U.code==="EMFILE"||U.code==="ENFILE")?lt([H,[K,E,b,$],U,D||Date.now(),Date.now()]):typeof $=="function"&&$.apply(this,arguments)})}}var a=e.appendFile;a&&(e.appendFile=o);function o(_,N,v,j){return typeof v=="function"&&(j=v,v=null),H(_,N,v,j);function H(K,E,b,$,D){return a(K,E,b,function(U){U&&(U.code==="EMFILE"||U.code==="ENFILE")?lt([H,[K,E,b,$],U,D||Date.now(),Date.now()]):typeof $=="function"&&$.apply(this,arguments)})}}var s=e.copyFile;s&&(e.copyFile=u);function u(_,N,v,j){return typeof v=="function"&&(j=v,v=0),H(_,N,v,j);function H(K,E,b,$,D){return s(K,E,b,function(U){U&&(U.code==="EMFILE"||U.code==="ENFILE")?lt([H,[K,E,b,$],U,D||Date.now(),Date.now()]):typeof $=="function"&&$.apply(this,arguments)})}}var f=e.readdir;e.readdir=l;var c=/^v[0-5]\./;function l(_,N,v){typeof N=="function"&&(v=N,N=null);var j=c.test(process.version)?function(E,b,$,D){return f(E,H(E,b,$,D))}:function(E,b,$,D){return f(E,b,H(E,b,$,D))};return j(_,N,v);function H(K,E,b,$){return function(D,U){D&&(D.code==="EMFILE"||D.code==="ENFILE")?lt([j,[K,E,b],D,$||Date.now(),Date.now()]):(U&&U.sort&&U.sort(),typeof b=="function"&&b.call(this,D,U))}}}if(process.version.substr(0,4)==="v0.8"){var p=Gy(e);w=p.ReadStream,x=p.WriteStream}var d=e.ReadStream;d&&(w.prototype=Object.create(d.prototype),w.prototype.open=S);var h=e.WriteStream;h&&(x.prototype=Object.create(h.prototype),x.prototype.open=R),Object.defineProperty(e,"ReadStream",{get:function(){return w},set:function(_){w=_},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return x},set:function(_){x=_},enumerable:!0,configurable:!0});var m=w;Object.defineProperty(e,"FileReadStream",{get:function(){return m},set:function(_){m=_},enumerable:!0,configurable:!0});var g=x;Object.defineProperty(e,"FileWriteStream",{get:function(){return g},set:function(_){g=_},enumerable:!0,configurable:!0});function w(_,N){return this instanceof w?(d.apply(this,arguments),this):w.apply(Object.create(w.prototype),arguments)}function S(){var _=this;A(_.path,_.flags,_.mode,function(N,v){N?(_.autoClose&&_.destroy(),_.emit("error",N)):(_.fd=v,_.emit("open",v),_.read())})}function x(_,N){return this instanceof x?(h.apply(this,arguments),this):x.apply(Object.create(x.prototype),arguments)}function R(){var _=this;A(_.path,_.flags,_.mode,function(N,v){N?(_.destroy(),_.emit("error",N)):(_.fd=v,_.emit("open",v))})}function T(_,N){return new e.ReadStream(_,N)}function O(_,N){return new e.WriteStream(_,N)}var M=e.open;e.open=A;function A(_,N,v,j){return typeof v=="function"&&(j=v,v=null),H(_,N,v,j);function H(K,E,b,$,D){return M(K,E,b,function(U,W){U&&(U.code==="EMFILE"||U.code==="ENFILE")?lt([H,[K,E,b,$],U,D||Date.now(),Date.now()]):typeof $=="function"&&$.apply(this,arguments)})}}return e}function lt(e){Je("ENQUEUE",e[0].name,e[1]),ne[pe].push(e),Ci()}var nn;function ko(){for(var e=Date.now(),t=0;t<ne[pe].length;++t)ne[pe][t].length>2&&(ne[pe][t][3]=e,ne[pe][t][4]=e);Ci()}function Ci(){if(clearTimeout(nn),nn=void 0,ne[pe].length!==0){var e=ne[pe].shift(),t=e[0],n=e[1],r=e[2],i=e[3],a=e[4];if(i===void 0)Je("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-i>=6e4){Je("TIMEOUT",t.name,n);var o=n.pop();typeof o=="function"&&o.call(null,r)}else{var s=Date.now()-a,u=Math.max(a-i,1),f=Math.min(u*1.2,100);s>=f?(Je("RETRY",t.name,n),t.apply(null,n.concat([i]))):ne[pe].push(e)}nn===void 0&&(nn=setTimeout(Ci,0))}}const Do=(e,t)=>function(...n){const r=t.promiseModule;return new r((i,a)=>{t.multiArgs?n.push((...o)=>{t.errorFirst?o[0]?a(o):(o.shift(),i(o)):i(o)}):t.errorFirst?n.push((o,s)=>{o?a(o):i(s)}):n.push(i),e.apply(this,n)})};var zy=(e,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);const n=typeof e;if(!(e!==null&&(n==="object"||n==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${e===null?"null":n}\``);const r=a=>{const o=s=>typeof s=="string"?a===s:s.test(a);return t.include?t.include.some(o):!t.exclude.some(o)};let i;n==="function"?i=function(...a){return t.excludeMain?e(...a):Do(e,t).apply(this,a)}:i=Object.create(Object.getPrototypeOf(e));for(const a in e){const o=e[a];i[a]=typeof o=="function"&&r(a)?Do(o,t):o}return i},Yy=e=>{if(typeof e!="string")throw new TypeError("Expected a string, got "+typeof e);return e.charCodeAt(0)===65279?e.slice(1):e},ie={},qt={},$e={};function eu(e){return typeof e>"u"||e===null}function Qy(e){return typeof e=="object"&&e!==null}function Vy(e){return Array.isArray(e)?e:eu(e)?[]:[e]}function Xy(e,t){var n,r,i,a;if(t)for(a=Object.keys(t),n=0,r=a.length;n<r;n+=1)i=a[n],e[i]=t[i];return e}function Zy(e,t){var n="",r;for(r=0;r<t;r+=1)n+=e;return n}function Jy(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}$e.isNothing=eu;$e.isObject=Qy;$e.toArray=Vy;$e.repeat=Zy;$e.isNegativeZero=Jy;$e.extend=Xy;function Dt(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Dt.prototype=Object.create(Error.prototype);Dt.prototype.constructor=Dt;Dt.prototype.toString=function(t){var n=this.name+": ";return n+=this.reason||"(unknown reason)",!t&&this.mark&&(n+=" "+this.mark.toString()),n};var Kt=Dt,Mo=$e;function Ri(e,t,n,r,i){this.name=e,this.buffer=t,this.position=n,this.line=r,this.column=i}Ri.prototype.getSnippet=function(t,n){var r,i,a,o,s;if(!this.buffer)return null;for(t=t||4,n=n||75,r="",i=this.position;i>0&&`\0\r
47
47
  …\u2028\u2029`.indexOf(this.buffer.charAt(i-1))===-1;)if(i-=1,this.position-i>n/2-1){r=" ... ",i+=5;break}for(a="",o=this.position;o<this.buffer.length&&`\0\r
48
- …\u2028\u2029`.indexOf(this.buffer.charAt(o))===-1;)if(o+=1,o-this.position>n/2-1){a=" ... ",o-=5;break}return s=this.buffer.slice(i,o),Do.repeat(" ",t)+r+s+a+`
49
- `+Do.repeat(" ",t+this.position-i+r.length)+"^"};Ci.prototype.toString=function(t){var n,r="";return this.name&&(r+='in "'+this.name+'" '),r+="at line "+(this.line+1)+", column "+(this.column+1),t||(n=this.getSnippet(),n&&(r+=`:
50
- `+n)),r};var Jy=Ci,Mo=Kt,ev=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],tv=["scalar","sequence","mapping"];function nv(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(r){t[String(r)]=n})}),t}function rv(e,t){if(t=t||{},Object.keys(t).forEach(function(n){if(ev.indexOf(n)===-1)throw new Mo('Unknown option "'+n+'" is met in definition of "'+e+'" YAML type.')}),this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(n){return n},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.defaultStyle=t.defaultStyle||null,this.styleAliases=nv(t.styleAliases||null),tv.indexOf(this.kind)===-1)throw new Mo('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var le=rv,jo=$e,cn=Kt,iv=le;function Kr(e,t,n){var r=[];return e.include.forEach(function(i){n=Kr(i,t,n)}),e[t].forEach(function(i){n.forEach(function(a,o){a.tag===i.tag&&a.kind===i.kind&&r.push(o)}),n.push(i)}),n.filter(function(i,a){return r.indexOf(a)===-1})}function ov(){var e={scalar:{},sequence:{},mapping:{},fallback:{}},t,n;function r(i){e[i.kind][i.tag]=e.fallback[i.tag]=i}for(t=0,n=arguments.length;t<n;t+=1)arguments[t].forEach(r);return e}function yt(e){this.include=e.include||[],this.implicit=e.implicit||[],this.explicit=e.explicit||[],this.implicit.forEach(function(t){if(t.loadKind&&t.loadKind!=="scalar")throw new cn("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=Kr(this,"implicit",[]),this.compiledExplicit=Kr(this,"explicit",[]),this.compiledTypeMap=ov(this.compiledImplicit,this.compiledExplicit)}yt.DEFAULT=null;yt.create=function(){var t,n;switch(arguments.length){case 1:t=yt.DEFAULT,n=arguments[0];break;case 2:t=arguments[0],n=arguments[1];break;default:throw new cn("Wrong number of arguments for Schema.create function")}if(t=jo.toArray(t),n=jo.toArray(n),!t.every(function(r){return r instanceof yt}))throw new cn("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!n.every(function(r){return r instanceof iv}))throw new cn("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new yt({include:t,explicit:n})};var Rt=yt,av=le,sv=new av("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),uv=le,cv=new uv("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),lv=le,fv=new lv("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),pv=Rt,Ri=new pv({explicit:[sv,cv,fv]}),dv=le;function hv(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function mv(){return null}function gv(e){return e===null}var yv=new dv("tag:yaml.org,2002:null",{kind:"scalar",resolve:hv,construct:mv,predicate:gv,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"}),vv=le;function wv(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function Ev(e){return e==="true"||e==="True"||e==="TRUE"}function bv(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var Sv=new vv("tag:yaml.org,2002:bool",{kind:"scalar",resolve:wv,construct:Ev,predicate:bv,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"}),xv=$e,_v=le;function Av(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Tv(e){return 48<=e&&e<=55}function Cv(e){return 48<=e&&e<=57}function Rv(e){if(e===null)return!1;var t=e.length,n=0,r=!1,i;if(!t)return!1;if(i=e[n],(i==="-"||i==="+")&&(i=e[++n]),i==="0"){if(n+1===t)return!0;if(i=e[++n],i==="b"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(i!=="0"&&i!=="1")return!1;r=!0}return r&&i!=="_"}if(i==="x"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(!Av(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}for(;n<t;n++)if(i=e[n],i!=="_"){if(!Tv(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}if(i==="_")return!1;for(;n<t;n++)if(i=e[n],i!=="_"){if(i===":")break;if(!Cv(e.charCodeAt(n)))return!1;r=!0}return!r||i==="_"?!1:i!==":"?!0:/^(:[0-5]?[0-9])+$/.test(e.slice(n))}function Fv(e){var t=e,n=1,r,i,a=[];return t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),r=t[0],(r==="-"||r==="+")&&(r==="-"&&(n=-1),t=t.slice(1),r=t[0]),t==="0"?0:r==="0"?t[1]==="b"?n*parseInt(t.slice(2),2):t[1]==="x"?n*parseInt(t,16):n*parseInt(t,8):t.indexOf(":")!==-1?(t.split(":").forEach(function(o){a.unshift(parseInt(o,10))}),t=0,i=1,a.forEach(function(o){t+=o*i,i*=60}),n*t):n*parseInt(t,10)}function $v(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!xv.isNegativeZero(e)}var Iv=new _v("tag:yaml.org,2002:int",{kind:"scalar",resolve:Rv,construct:Fv,predicate:$v,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0"+e.toString(8):"-0"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),eu=$e,Ov=le,Nv=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Pv(e){return!(e===null||!Nv.test(e)||e[e.length-1]==="_")}function Lv(e){var t,n,r,i;return t=e.replace(/_/g,"").toLowerCase(),n=t[0]==="-"?-1:1,i=[],"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:t.indexOf(":")>=0?(t.split(":").forEach(function(a){i.unshift(parseFloat(a,10))}),t=0,r=1,i.forEach(function(a){t+=a*r,r*=60}),n*t):n*parseFloat(t,10)}var kv=/^[-+]?[0-9]+e/;function Dv(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(eu.isNegativeZero(e))return"-0.0";return n=e.toString(10),kv.test(n)?n.replace("e",".e"):n}function Mv(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||eu.isNegativeZero(e))}var jv=new Ov("tag:yaml.org,2002:float",{kind:"scalar",resolve:Pv,construct:Lv,predicate:Mv,represent:Dv,defaultStyle:"lowercase"}),Hv=Rt,tu=new Hv({include:[Ri],implicit:[yv,Sv,Iv,jv]}),Bv=Rt,nu=new Bv({include:[tu]}),Uv=le,ru=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),iu=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function Gv(e){return e===null?!1:ru.exec(e)!==null||iu.exec(e)!==null}function qv(e){var t,n,r,i,a,o,s,u=0,f=null,c,l,p;if(t=ru.exec(e),t===null&&(t=iu.exec(e)),t===null)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(n,r,i));if(a=+t[4],o=+t[5],s=+t[6],t[7]){for(u=t[7].slice(0,3);u.length<3;)u+="0";u=+u}return t[9]&&(c=+t[10],l=+(t[11]||0),f=(c*60+l)*6e4,t[9]==="-"&&(f=-f)),p=new Date(Date.UTC(n,r,i,a,o,s,u)),f&&p.setTime(p.getTime()-f),p}function Kv(e){return e.toISOString()}var Wv=new Uv("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:Gv,construct:qv,instanceOf:Date,represent:Kv}),zv=le;function Yv(e){return e==="<<"||e===null}var Qv=new zv("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Yv});function ou(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Xe;try{var Vv=ou;Xe=Vv("buffer").Buffer}catch{}var Xv=le,Fi=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
51
- \r`;function Zv(e){if(e===null)return!1;var t,n,r=0,i=e.length,a=Fi;for(n=0;n<i;n++)if(t=a.indexOf(e.charAt(n)),!(t>64)){if(t<0)return!1;r+=6}return r%8===0}function Jv(e){var t,n,r=e.replace(/[\r\n=]/g,""),i=r.length,a=Fi,o=0,s=[];for(t=0;t<i;t++)t%4===0&&t&&(s.push(o>>16&255),s.push(o>>8&255),s.push(o&255)),o=o<<6|a.indexOf(r.charAt(t));return n=i%4*6,n===0?(s.push(o>>16&255),s.push(o>>8&255),s.push(o&255)):n===18?(s.push(o>>10&255),s.push(o>>2&255)):n===12&&s.push(o>>4&255),Xe?Xe.from?Xe.from(s):new Xe(s):s}function e0(e){var t="",n=0,r,i,a=e.length,o=Fi;for(r=0;r<a;r++)r%3===0&&r&&(t+=o[n>>18&63],t+=o[n>>12&63],t+=o[n>>6&63],t+=o[n&63]),n=(n<<8)+e[r];return i=a%3,i===0?(t+=o[n>>18&63],t+=o[n>>12&63],t+=o[n>>6&63],t+=o[n&63]):i===2?(t+=o[n>>10&63],t+=o[n>>4&63],t+=o[n<<2&63],t+=o[64]):i===1&&(t+=o[n>>2&63],t+=o[n<<4&63],t+=o[64],t+=o[64]),t}function t0(e){return Xe&&Xe.isBuffer(e)}var n0=new Xv("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Zv,construct:Jv,predicate:t0,represent:e0}),r0=le,i0=Object.prototype.hasOwnProperty,o0=Object.prototype.toString;function a0(e){if(e===null)return!0;var t=[],n,r,i,a,o,s=e;for(n=0,r=s.length;n<r;n+=1){if(i=s[n],o=!1,o0.call(i)!=="[object Object]")return!1;for(a in i)if(i0.call(i,a))if(!o)o=!0;else return!1;if(!o)return!1;if(t.indexOf(a)===-1)t.push(a);else return!1}return!0}function s0(e){return e!==null?e:[]}var u0=new r0("tag:yaml.org,2002:omap",{kind:"sequence",resolve:a0,construct:s0}),c0=le,l0=Object.prototype.toString;function f0(e){if(e===null)return!0;var t,n,r,i,a,o=e;for(a=new Array(o.length),t=0,n=o.length;t<n;t+=1){if(r=o[t],l0.call(r)!=="[object Object]"||(i=Object.keys(r),i.length!==1))return!1;a[t]=[i[0],r[i[0]]]}return!0}function p0(e){if(e===null)return[];var t,n,r,i,a,o=e;for(a=new Array(o.length),t=0,n=o.length;t<n;t+=1)r=o[t],i=Object.keys(r),a[t]=[i[0],r[i[0]]];return a}var d0=new c0("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:f0,construct:p0}),h0=le,m0=Object.prototype.hasOwnProperty;function g0(e){if(e===null)return!0;var t,n=e;for(t in n)if(m0.call(n,t)&&n[t]!==null)return!1;return!0}function y0(e){return e!==null?e:{}}var v0=new h0("tag:yaml.org,2002:set",{kind:"mapping",resolve:g0,construct:y0}),w0=Rt,Wt=new w0({include:[nu],implicit:[Wv,Qv],explicit:[n0,u0,d0,v0]}),E0=le;function b0(){return!0}function S0(){}function x0(){return""}function _0(e){return typeof e>"u"}var A0=new E0("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:b0,construct:S0,predicate:_0,represent:x0}),T0=le;function C0(e){if(e===null||e.length===0)return!1;var t=e,n=/\/([gim]*)$/.exec(e),r="";return!(t[0]==="/"&&(n&&(r=n[1]),r.length>3||t[t.length-r.length-1]!=="/"))}function R0(e){var t=e,n=/\/([gim]*)$/.exec(e),r="";return t[0]==="/"&&(n&&(r=n[1]),t=t.slice(1,t.length-r.length-1)),new RegExp(t,r)}function F0(e){var t="/"+e.source+"/";return e.global&&(t+="g"),e.multiline&&(t+="m"),e.ignoreCase&&(t+="i"),t}function $0(e){return Object.prototype.toString.call(e)==="[object RegExp]"}var I0=new T0("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:C0,construct:R0,predicate:$0,represent:F0}),In;try{var O0=ou;In=O0("esprima")}catch{typeof window<"u"&&(In=window.esprima)}var N0=le;function P0(e){if(e===null)return!1;try{var t="("+e+")",n=In.parse(t,{range:!0});return!(n.type!=="Program"||n.body.length!==1||n.body[0].type!=="ExpressionStatement"||n.body[0].expression.type!=="ArrowFunctionExpression"&&n.body[0].expression.type!=="FunctionExpression")}catch{return!1}}function L0(e){var t="("+e+")",n=In.parse(t,{range:!0}),r=[],i;if(n.type!=="Program"||n.body.length!==1||n.body[0].type!=="ExpressionStatement"||n.body[0].expression.type!=="ArrowFunctionExpression"&&n.body[0].expression.type!=="FunctionExpression")throw new Error("Failed to resolve function");return n.body[0].expression.params.forEach(function(a){r.push(a.name)}),i=n.body[0].expression.body.range,n.body[0].expression.body.type==="BlockStatement"?new Function(r,t.slice(i[0]+1,i[1]-1)):new Function(r,"return "+t.slice(i[0],i[1]))}function k0(e){return e.toString()}function D0(e){return Object.prototype.toString.call(e)==="[object Function]"}var M0=new N0("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:P0,construct:L0,predicate:D0,represent:k0}),Ho=Rt,Jn=Ho.DEFAULT=new Ho({include:[Wt],explicit:[A0,I0,M0]}),Be=$e,au=Kt,j0=Jy,su=Wt,H0=Jn,Ke=Object.prototype.hasOwnProperty,On=1,uu=2,cu=3,Nn=4,_r=1,B0=2,Bo=3,U0=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,G0=/[\x85\u2028\u2029]/,q0=/[,\[\]\{\}]/,lu=/^(?:!|!!|![a-z\-]+!)$/i,fu=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Uo(e){return Object.prototype.toString.call(e)}function De(e){return e===10||e===13}function et(e){return e===9||e===32}function be(e){return e===9||e===32||e===10||e===13}function vt(e){return e===44||e===91||e===93||e===123||e===125}function K0(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function W0(e){return e===120?2:e===117?4:e===85?8:0}function z0(e){return 48<=e&&e<=57?e-48:-1}function Go(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
52
- `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"…":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}function Y0(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function pu(e,t,n){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:n}):e[t]=n}var du=new Array(256),hu=new Array(256);for(var ft=0;ft<256;ft++)du[ft]=Go(ft)?1:0,hu[ft]=Go(ft);function Q0(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||H0,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function mu(e,t){return new au(t,new j0(e.filename,e.input,e.position,e.line,e.position-e.lineStart))}function G(e,t){throw mu(e,t)}function Pn(e,t){e.onWarning&&e.onWarning.call(null,mu(e,t))}var qo={YAML:function(t,n,r){var i,a,o;t.version!==null&&G(t,"duplication of %YAML directive"),r.length!==1&&G(t,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&G(t,"ill-formed argument of the YAML directive"),a=parseInt(i[1],10),o=parseInt(i[2],10),a!==1&&G(t,"unacceptable YAML version of the document"),t.version=r[0],t.checkLineBreaks=o<2,o!==1&&o!==2&&Pn(t,"unsupported YAML version of the document")},TAG:function(t,n,r){var i,a;r.length!==2&&G(t,"TAG directive accepts exactly two arguments"),i=r[0],a=r[1],lu.test(i)||G(t,"ill-formed tag handle (first argument) of the TAG directive"),Ke.call(t.tagMap,i)&&G(t,'there is a previously declared suffix for "'+i+'" tag handle'),fu.test(a)||G(t,"ill-formed tag prefix (second argument) of the TAG directive"),t.tagMap[i]=a}};function qe(e,t,n,r){var i,a,o,s;if(t<n){if(s=e.input.slice(t,n),r)for(i=0,a=s.length;i<a;i+=1)o=s.charCodeAt(i),o===9||32<=o&&o<=1114111||G(e,"expected valid JSON character");else U0.test(s)&&G(e,"the stream contains non-printable characters");e.result+=s}}function Ko(e,t,n,r){var i,a,o,s;for(Be.isObject(n)||G(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(n),o=0,s=i.length;o<s;o+=1)a=i[o],Ke.call(t,a)||(pu(t,a,n[a]),r[a]=!0)}function wt(e,t,n,r,i,a,o,s){var u,f;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),u=0,f=i.length;u<f;u+=1)Array.isArray(i[u])&&G(e,"nested arrays are not supported inside keys"),typeof i=="object"&&Uo(i[u])==="[object Object]"&&(i[u]="[object Object]");if(typeof i=="object"&&Uo(i)==="[object Object]"&&(i="[object Object]"),i=String(i),t===null&&(t={}),r==="tag:yaml.org,2002:merge")if(Array.isArray(a))for(u=0,f=a.length;u<f;u+=1)Ko(e,t,a[u],n);else Ko(e,t,a,n);else!e.json&&!Ke.call(n,i)&&Ke.call(t,i)&&(e.line=o||e.line,e.position=s||e.position,G(e,"duplicated mapping key")),pu(t,i,a),delete n[i];return t}function $i(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):G(e,"a line break is expected"),e.line+=1,e.lineStart=e.position}function se(e,t,n){for(var r=0,i=e.input.charCodeAt(e.position);i!==0;){for(;et(i);)i=e.input.charCodeAt(++e.position);if(t&&i===35)do i=e.input.charCodeAt(++e.position);while(i!==10&&i!==13&&i!==0);if(De(i))for($i(e),i=e.input.charCodeAt(e.position),r++,e.lineIndent=0;i===32;)e.lineIndent++,i=e.input.charCodeAt(++e.position);else break}return n!==-1&&r!==0&&e.lineIndent<n&&Pn(e,"deficient indentation"),r}function er(e){var t=e.position,n;return n=e.input.charCodeAt(t),!!((n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)&&(t+=3,n=e.input.charCodeAt(t),n===0||be(n)))}function Ii(e,t){t===1?e.result+=" ":t>1&&(e.result+=Be.repeat(`
53
- `,t-1))}function V0(e,t,n){var r,i,a,o,s,u,f,c,l=e.kind,p=e.result,d;if(d=e.input.charCodeAt(e.position),be(d)||vt(d)||d===35||d===38||d===42||d===33||d===124||d===62||d===39||d===34||d===37||d===64||d===96||(d===63||d===45)&&(i=e.input.charCodeAt(e.position+1),be(i)||n&&vt(i)))return!1;for(e.kind="scalar",e.result="",a=o=e.position,s=!1;d!==0;){if(d===58){if(i=e.input.charCodeAt(e.position+1),be(i)||n&&vt(i))break}else if(d===35){if(r=e.input.charCodeAt(e.position-1),be(r))break}else{if(e.position===e.lineStart&&er(e)||n&&vt(d))break;if(De(d))if(u=e.line,f=e.lineStart,c=e.lineIndent,se(e,!1,-1),e.lineIndent>=t){s=!0,d=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=u,e.lineStart=f,e.lineIndent=c;break}}s&&(qe(e,a,o,!1),Ii(e,e.line-u),a=o=e.position,s=!1),et(d)||(o=e.position+1),d=e.input.charCodeAt(++e.position)}return qe(e,a,o,!1),e.result?!0:(e.kind=l,e.result=p,!1)}function X0(e,t){var n,r,i;if(n=e.input.charCodeAt(e.position),n!==39)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(qe(e,r,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)r=e.position,e.position++,i=e.position;else return!0;else De(n)?(qe(e,r,i,!0),Ii(e,se(e,!1,t)),r=i=e.position):e.position===e.lineStart&&er(e)?G(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);G(e,"unexpected end of the stream within a single quoted scalar")}function Z0(e,t){var n,r,i,a,o,s;if(s=e.input.charCodeAt(e.position),s!==34)return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;(s=e.input.charCodeAt(e.position))!==0;){if(s===34)return qe(e,n,e.position,!0),e.position++,!0;if(s===92){if(qe(e,n,e.position,!0),s=e.input.charCodeAt(++e.position),De(s))se(e,!1,t);else if(s<256&&du[s])e.result+=hu[s],e.position++;else if((o=W0(s))>0){for(i=o,a=0;i>0;i--)s=e.input.charCodeAt(++e.position),(o=K0(s))>=0?a=(a<<4)+o:G(e,"expected hexadecimal character");e.result+=Y0(a),e.position++}else G(e,"unknown escape sequence");n=r=e.position}else De(s)?(qe(e,n,r,!0),Ii(e,se(e,!1,t)),n=r=e.position):e.position===e.lineStart&&er(e)?G(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}G(e,"unexpected end of the stream within a double quoted scalar")}function J0(e,t){var n=!0,r,i=e.tag,a,o=e.anchor,s,u,f,c,l,p={},d,h,m,g;if(g=e.input.charCodeAt(e.position),g===91)u=93,l=!1,a=[];else if(g===123)u=125,l=!0,a={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),g=e.input.charCodeAt(++e.position);g!==0;){if(se(e,!0,t),g=e.input.charCodeAt(e.position),g===u)return e.position++,e.tag=i,e.anchor=o,e.kind=l?"mapping":"sequence",e.result=a,!0;n||G(e,"missed comma between flow collection entries"),h=d=m=null,f=c=!1,g===63&&(s=e.input.charCodeAt(e.position+1),be(s)&&(f=c=!0,e.position++,se(e,!0,t))),r=e.line,xt(e,t,On,!1,!0),h=e.tag,d=e.result,se(e,!0,t),g=e.input.charCodeAt(e.position),(c||e.line===r)&&g===58&&(f=!0,g=e.input.charCodeAt(++e.position),se(e,!0,t),xt(e,t,On,!1,!0),m=e.result),l?wt(e,a,p,h,d,m):f?a.push(wt(e,null,p,h,d,m)):a.push(d),se(e,!0,t),g=e.input.charCodeAt(e.position),g===44?(n=!0,g=e.input.charCodeAt(++e.position)):n=!1}G(e,"unexpected end of the stream within a flow collection")}function ew(e,t){var n,r,i=_r,a=!1,o=!1,s=t,u=0,f=!1,c,l;if(l=e.input.charCodeAt(e.position),l===124)r=!1;else if(l===62)r=!0;else return!1;for(e.kind="scalar",e.result="";l!==0;)if(l=e.input.charCodeAt(++e.position),l===43||l===45)_r===i?i=l===43?Bo:B0:G(e,"repeat of a chomping mode identifier");else if((c=z0(l))>=0)c===0?G(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?G(e,"repeat of an indentation width identifier"):(s=t+c-1,o=!0);else break;if(et(l)){do l=e.input.charCodeAt(++e.position);while(et(l));if(l===35)do l=e.input.charCodeAt(++e.position);while(!De(l)&&l!==0)}for(;l!==0;){for($i(e),e.lineIndent=0,l=e.input.charCodeAt(e.position);(!o||e.lineIndent<s)&&l===32;)e.lineIndent++,l=e.input.charCodeAt(++e.position);if(!o&&e.lineIndent>s&&(s=e.lineIndent),De(l)){u++;continue}if(e.lineIndent<s){i===Bo?e.result+=Be.repeat(`
54
- `,a?1+u:u):i===_r&&a&&(e.result+=`
48
+ …\u2028\u2029`.indexOf(this.buffer.charAt(o))===-1;)if(o+=1,o-this.position>n/2-1){a=" ... ",o-=5;break}return s=this.buffer.slice(i,o),Mo.repeat(" ",t)+r+s+a+`
49
+ `+Mo.repeat(" ",t+this.position-i+r.length)+"^"};Ri.prototype.toString=function(t){var n,r="";return this.name&&(r+='in "'+this.name+'" '),r+="at line "+(this.line+1)+", column "+(this.column+1),t||(n=this.getSnippet(),n&&(r+=`:
50
+ `+n)),r};var ev=Ri,jo=Kt,tv=["kind","resolve","construct","instanceOf","predicate","represent","defaultStyle","styleAliases"],nv=["scalar","sequence","mapping"];function rv(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(r){t[String(r)]=n})}),t}function iv(e,t){if(t=t||{},Object.keys(t).forEach(function(n){if(tv.indexOf(n)===-1)throw new jo('Unknown option "'+n+'" is met in definition of "'+e+'" YAML type.')}),this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(n){return n},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.defaultStyle=t.defaultStyle||null,this.styleAliases=rv(t.styleAliases||null),nv.indexOf(this.kind)===-1)throw new jo('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var le=iv,Ho=$e,ln=Kt,ov=le;function Wr(e,t,n){var r=[];return e.include.forEach(function(i){n=Wr(i,t,n)}),e[t].forEach(function(i){n.forEach(function(a,o){a.tag===i.tag&&a.kind===i.kind&&r.push(o)}),n.push(i)}),n.filter(function(i,a){return r.indexOf(a)===-1})}function av(){var e={scalar:{},sequence:{},mapping:{},fallback:{}},t,n;function r(i){e[i.kind][i.tag]=e.fallback[i.tag]=i}for(t=0,n=arguments.length;t<n;t+=1)arguments[t].forEach(r);return e}function yt(e){this.include=e.include||[],this.implicit=e.implicit||[],this.explicit=e.explicit||[],this.implicit.forEach(function(t){if(t.loadKind&&t.loadKind!=="scalar")throw new ln("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.")}),this.compiledImplicit=Wr(this,"implicit",[]),this.compiledExplicit=Wr(this,"explicit",[]),this.compiledTypeMap=av(this.compiledImplicit,this.compiledExplicit)}yt.DEFAULT=null;yt.create=function(){var t,n;switch(arguments.length){case 1:t=yt.DEFAULT,n=arguments[0];break;case 2:t=arguments[0],n=arguments[1];break;default:throw new ln("Wrong number of arguments for Schema.create function")}if(t=Ho.toArray(t),n=Ho.toArray(n),!t.every(function(r){return r instanceof yt}))throw new ln("Specified list of super schemas (or a single Schema object) contains a non-Schema object.");if(!n.every(function(r){return r instanceof ov}))throw new ln("Specified list of YAML types (or a single Type object) contains a non-Type object.");return new yt({include:t,explicit:n})};var Rt=yt,sv=le,uv=new sv("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),cv=le,lv=new cv("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),fv=le,pv=new fv("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),dv=Rt,Fi=new dv({explicit:[uv,lv,pv]}),hv=le;function mv(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function gv(){return null}function yv(e){return e===null}var vv=new hv("tag:yaml.org,2002:null",{kind:"scalar",resolve:mv,construct:gv,predicate:yv,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"}},defaultStyle:"lowercase"}),wv=le;function Ev(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function bv(e){return e==="true"||e==="True"||e==="TRUE"}function Sv(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var xv=new wv("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Ev,construct:bv,predicate:Sv,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"}),_v=$e,Av=le;function Tv(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Cv(e){return 48<=e&&e<=55}function Rv(e){return 48<=e&&e<=57}function Fv(e){if(e===null)return!1;var t=e.length,n=0,r=!1,i;if(!t)return!1;if(i=e[n],(i==="-"||i==="+")&&(i=e[++n]),i==="0"){if(n+1===t)return!0;if(i=e[++n],i==="b"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(i!=="0"&&i!=="1")return!1;r=!0}return r&&i!=="_"}if(i==="x"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(!Tv(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}for(;n<t;n++)if(i=e[n],i!=="_"){if(!Cv(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}if(i==="_")return!1;for(;n<t;n++)if(i=e[n],i!=="_"){if(i===":")break;if(!Rv(e.charCodeAt(n)))return!1;r=!0}return!r||i==="_"?!1:i!==":"?!0:/^(:[0-5]?[0-9])+$/.test(e.slice(n))}function $v(e){var t=e,n=1,r,i,a=[];return t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),r=t[0],(r==="-"||r==="+")&&(r==="-"&&(n=-1),t=t.slice(1),r=t[0]),t==="0"?0:r==="0"?t[1]==="b"?n*parseInt(t.slice(2),2):t[1]==="x"?n*parseInt(t,16):n*parseInt(t,8):t.indexOf(":")!==-1?(t.split(":").forEach(function(o){a.unshift(parseInt(o,10))}),t=0,i=1,a.forEach(function(o){t+=o*i,i*=60}),n*t):n*parseInt(t,10)}function Iv(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!_v.isNegativeZero(e)}var Ov=new Av("tag:yaml.org,2002:int",{kind:"scalar",resolve:Fv,construct:$v,predicate:Iv,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0"+e.toString(8):"-0"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),tu=$e,Nv=le,Pv=new RegExp("^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function Lv(e){return!(e===null||!Pv.test(e)||e[e.length-1]==="_")}function kv(e){var t,n,r,i;return t=e.replace(/_/g,"").toLowerCase(),n=t[0]==="-"?-1:1,i=[],"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:t.indexOf(":")>=0?(t.split(":").forEach(function(a){i.unshift(parseFloat(a,10))}),t=0,r=1,i.forEach(function(a){t+=a*r,r*=60}),n*t):n*parseFloat(t,10)}var Dv=/^[-+]?[0-9]+e/;function Mv(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(tu.isNegativeZero(e))return"-0.0";return n=e.toString(10),Dv.test(n)?n.replace("e",".e"):n}function jv(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||tu.isNegativeZero(e))}var Hv=new Nv("tag:yaml.org,2002:float",{kind:"scalar",resolve:Lv,construct:kv,predicate:jv,represent:Mv,defaultStyle:"lowercase"}),Bv=Rt,nu=new Bv({include:[Fi],implicit:[vv,xv,Ov,Hv]}),Uv=Rt,ru=new Uv({include:[nu]}),Gv=le,iu=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),ou=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function qv(e){return e===null?!1:iu.exec(e)!==null||ou.exec(e)!==null}function Kv(e){var t,n,r,i,a,o,s,u=0,f=null,c,l,p;if(t=iu.exec(e),t===null&&(t=ou.exec(e)),t===null)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(n,r,i));if(a=+t[4],o=+t[5],s=+t[6],t[7]){for(u=t[7].slice(0,3);u.length<3;)u+="0";u=+u}return t[9]&&(c=+t[10],l=+(t[11]||0),f=(c*60+l)*6e4,t[9]==="-"&&(f=-f)),p=new Date(Date.UTC(n,r,i,a,o,s,u)),f&&p.setTime(p.getTime()-f),p}function Wv(e){return e.toISOString()}var zv=new Gv("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:qv,construct:Kv,instanceOf:Date,represent:Wv}),Yv=le;function Qv(e){return e==="<<"||e===null}var Vv=new Yv("tag:yaml.org,2002:merge",{kind:"scalar",resolve:Qv});function au(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Xe;try{var Xv=au;Xe=Xv("buffer").Buffer}catch{}var Zv=le,$i=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
51
+ \r`;function Jv(e){if(e===null)return!1;var t,n,r=0,i=e.length,a=$i;for(n=0;n<i;n++)if(t=a.indexOf(e.charAt(n)),!(t>64)){if(t<0)return!1;r+=6}return r%8===0}function e0(e){var t,n,r=e.replace(/[\r\n=]/g,""),i=r.length,a=$i,o=0,s=[];for(t=0;t<i;t++)t%4===0&&t&&(s.push(o>>16&255),s.push(o>>8&255),s.push(o&255)),o=o<<6|a.indexOf(r.charAt(t));return n=i%4*6,n===0?(s.push(o>>16&255),s.push(o>>8&255),s.push(o&255)):n===18?(s.push(o>>10&255),s.push(o>>2&255)):n===12&&s.push(o>>4&255),Xe?Xe.from?Xe.from(s):new Xe(s):s}function t0(e){var t="",n=0,r,i,a=e.length,o=$i;for(r=0;r<a;r++)r%3===0&&r&&(t+=o[n>>18&63],t+=o[n>>12&63],t+=o[n>>6&63],t+=o[n&63]),n=(n<<8)+e[r];return i=a%3,i===0?(t+=o[n>>18&63],t+=o[n>>12&63],t+=o[n>>6&63],t+=o[n&63]):i===2?(t+=o[n>>10&63],t+=o[n>>4&63],t+=o[n<<2&63],t+=o[64]):i===1&&(t+=o[n>>2&63],t+=o[n<<4&63],t+=o[64],t+=o[64]),t}function n0(e){return Xe&&Xe.isBuffer(e)}var r0=new Zv("tag:yaml.org,2002:binary",{kind:"scalar",resolve:Jv,construct:e0,predicate:n0,represent:t0}),i0=le,o0=Object.prototype.hasOwnProperty,a0=Object.prototype.toString;function s0(e){if(e===null)return!0;var t=[],n,r,i,a,o,s=e;for(n=0,r=s.length;n<r;n+=1){if(i=s[n],o=!1,a0.call(i)!=="[object Object]")return!1;for(a in i)if(o0.call(i,a))if(!o)o=!0;else return!1;if(!o)return!1;if(t.indexOf(a)===-1)t.push(a);else return!1}return!0}function u0(e){return e!==null?e:[]}var c0=new i0("tag:yaml.org,2002:omap",{kind:"sequence",resolve:s0,construct:u0}),l0=le,f0=Object.prototype.toString;function p0(e){if(e===null)return!0;var t,n,r,i,a,o=e;for(a=new Array(o.length),t=0,n=o.length;t<n;t+=1){if(r=o[t],f0.call(r)!=="[object Object]"||(i=Object.keys(r),i.length!==1))return!1;a[t]=[i[0],r[i[0]]]}return!0}function d0(e){if(e===null)return[];var t,n,r,i,a,o=e;for(a=new Array(o.length),t=0,n=o.length;t<n;t+=1)r=o[t],i=Object.keys(r),a[t]=[i[0],r[i[0]]];return a}var h0=new l0("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:p0,construct:d0}),m0=le,g0=Object.prototype.hasOwnProperty;function y0(e){if(e===null)return!0;var t,n=e;for(t in n)if(g0.call(n,t)&&n[t]!==null)return!1;return!0}function v0(e){return e!==null?e:{}}var w0=new m0("tag:yaml.org,2002:set",{kind:"mapping",resolve:y0,construct:v0}),E0=Rt,Wt=new E0({include:[ru],implicit:[zv,Vv],explicit:[r0,c0,h0,w0]}),b0=le;function S0(){return!0}function x0(){}function _0(){return""}function A0(e){return typeof e>"u"}var T0=new b0("tag:yaml.org,2002:js/undefined",{kind:"scalar",resolve:S0,construct:x0,predicate:A0,represent:_0}),C0=le;function R0(e){if(e===null||e.length===0)return!1;var t=e,n=/\/([gim]*)$/.exec(e),r="";return!(t[0]==="/"&&(n&&(r=n[1]),r.length>3||t[t.length-r.length-1]!=="/"))}function F0(e){var t=e,n=/\/([gim]*)$/.exec(e),r="";return t[0]==="/"&&(n&&(r=n[1]),t=t.slice(1,t.length-r.length-1)),new RegExp(t,r)}function $0(e){var t="/"+e.source+"/";return e.global&&(t+="g"),e.multiline&&(t+="m"),e.ignoreCase&&(t+="i"),t}function I0(e){return Object.prototype.toString.call(e)==="[object RegExp]"}var O0=new C0("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:R0,construct:F0,predicate:I0,represent:$0}),On;try{var N0=au;On=N0("esprima")}catch{typeof window<"u"&&(On=window.esprima)}var P0=le;function L0(e){if(e===null)return!1;try{var t="("+e+")",n=On.parse(t,{range:!0});return!(n.type!=="Program"||n.body.length!==1||n.body[0].type!=="ExpressionStatement"||n.body[0].expression.type!=="ArrowFunctionExpression"&&n.body[0].expression.type!=="FunctionExpression")}catch{return!1}}function k0(e){var t="("+e+")",n=On.parse(t,{range:!0}),r=[],i;if(n.type!=="Program"||n.body.length!==1||n.body[0].type!=="ExpressionStatement"||n.body[0].expression.type!=="ArrowFunctionExpression"&&n.body[0].expression.type!=="FunctionExpression")throw new Error("Failed to resolve function");return n.body[0].expression.params.forEach(function(a){r.push(a.name)}),i=n.body[0].expression.body.range,n.body[0].expression.body.type==="BlockStatement"?new Function(r,t.slice(i[0]+1,i[1]-1)):new Function(r,"return "+t.slice(i[0],i[1]))}function D0(e){return e.toString()}function M0(e){return Object.prototype.toString.call(e)==="[object Function]"}var j0=new P0("tag:yaml.org,2002:js/function",{kind:"scalar",resolve:L0,construct:k0,predicate:M0,represent:D0}),Bo=Rt,er=Bo.DEFAULT=new Bo({include:[Wt],explicit:[T0,O0,j0]}),Be=$e,su=Kt,H0=ev,uu=Wt,B0=er,Ke=Object.prototype.hasOwnProperty,Nn=1,cu=2,lu=3,Pn=4,Ar=1,U0=2,Uo=3,G0=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,q0=/[\x85\u2028\u2029]/,K0=/[,\[\]\{\}]/,fu=/^(?:!|!!|![a-z\-]+!)$/i,pu=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Go(e){return Object.prototype.toString.call(e)}function De(e){return e===10||e===13}function et(e){return e===9||e===32}function be(e){return e===9||e===32||e===10||e===13}function vt(e){return e===44||e===91||e===93||e===123||e===125}function W0(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function z0(e){return e===120?2:e===117?4:e===85?8:0}function Y0(e){return 48<=e&&e<=57?e-48:-1}function qo(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
52
+ `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"…":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}function Q0(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function du(e,t,n){t==="__proto__"?Object.defineProperty(e,t,{configurable:!0,enumerable:!0,writable:!0,value:n}):e[t]=n}var hu=new Array(256),mu=new Array(256);for(var ft=0;ft<256;ft++)hu[ft]=qo(ft)?1:0,mu[ft]=qo(ft);function V0(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||B0,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.documents=[]}function gu(e,t){return new su(t,new H0(e.filename,e.input,e.position,e.line,e.position-e.lineStart))}function G(e,t){throw gu(e,t)}function Ln(e,t){e.onWarning&&e.onWarning.call(null,gu(e,t))}var Ko={YAML:function(t,n,r){var i,a,o;t.version!==null&&G(t,"duplication of %YAML directive"),r.length!==1&&G(t,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&G(t,"ill-formed argument of the YAML directive"),a=parseInt(i[1],10),o=parseInt(i[2],10),a!==1&&G(t,"unacceptable YAML version of the document"),t.version=r[0],t.checkLineBreaks=o<2,o!==1&&o!==2&&Ln(t,"unsupported YAML version of the document")},TAG:function(t,n,r){var i,a;r.length!==2&&G(t,"TAG directive accepts exactly two arguments"),i=r[0],a=r[1],fu.test(i)||G(t,"ill-formed tag handle (first argument) of the TAG directive"),Ke.call(t.tagMap,i)&&G(t,'there is a previously declared suffix for "'+i+'" tag handle'),pu.test(a)||G(t,"ill-formed tag prefix (second argument) of the TAG directive"),t.tagMap[i]=a}};function qe(e,t,n,r){var i,a,o,s;if(t<n){if(s=e.input.slice(t,n),r)for(i=0,a=s.length;i<a;i+=1)o=s.charCodeAt(i),o===9||32<=o&&o<=1114111||G(e,"expected valid JSON character");else G0.test(s)&&G(e,"the stream contains non-printable characters");e.result+=s}}function Wo(e,t,n,r){var i,a,o,s;for(Be.isObject(n)||G(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(n),o=0,s=i.length;o<s;o+=1)a=i[o],Ke.call(t,a)||(du(t,a,n[a]),r[a]=!0)}function wt(e,t,n,r,i,a,o,s){var u,f;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),u=0,f=i.length;u<f;u+=1)Array.isArray(i[u])&&G(e,"nested arrays are not supported inside keys"),typeof i=="object"&&Go(i[u])==="[object Object]"&&(i[u]="[object Object]");if(typeof i=="object"&&Go(i)==="[object Object]"&&(i="[object Object]"),i=String(i),t===null&&(t={}),r==="tag:yaml.org,2002:merge")if(Array.isArray(a))for(u=0,f=a.length;u<f;u+=1)Wo(e,t,a[u],n);else Wo(e,t,a,n);else!e.json&&!Ke.call(n,i)&&Ke.call(t,i)&&(e.line=o||e.line,e.position=s||e.position,G(e,"duplicated mapping key")),du(t,i,a),delete n[i];return t}function Ii(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):G(e,"a line break is expected"),e.line+=1,e.lineStart=e.position}function se(e,t,n){for(var r=0,i=e.input.charCodeAt(e.position);i!==0;){for(;et(i);)i=e.input.charCodeAt(++e.position);if(t&&i===35)do i=e.input.charCodeAt(++e.position);while(i!==10&&i!==13&&i!==0);if(De(i))for(Ii(e),i=e.input.charCodeAt(e.position),r++,e.lineIndent=0;i===32;)e.lineIndent++,i=e.input.charCodeAt(++e.position);else break}return n!==-1&&r!==0&&e.lineIndent<n&&Ln(e,"deficient indentation"),r}function tr(e){var t=e.position,n;return n=e.input.charCodeAt(t),!!((n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)&&(t+=3,n=e.input.charCodeAt(t),n===0||be(n)))}function Oi(e,t){t===1?e.result+=" ":t>1&&(e.result+=Be.repeat(`
53
+ `,t-1))}function X0(e,t,n){var r,i,a,o,s,u,f,c,l=e.kind,p=e.result,d;if(d=e.input.charCodeAt(e.position),be(d)||vt(d)||d===35||d===38||d===42||d===33||d===124||d===62||d===39||d===34||d===37||d===64||d===96||(d===63||d===45)&&(i=e.input.charCodeAt(e.position+1),be(i)||n&&vt(i)))return!1;for(e.kind="scalar",e.result="",a=o=e.position,s=!1;d!==0;){if(d===58){if(i=e.input.charCodeAt(e.position+1),be(i)||n&&vt(i))break}else if(d===35){if(r=e.input.charCodeAt(e.position-1),be(r))break}else{if(e.position===e.lineStart&&tr(e)||n&&vt(d))break;if(De(d))if(u=e.line,f=e.lineStart,c=e.lineIndent,se(e,!1,-1),e.lineIndent>=t){s=!0,d=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=u,e.lineStart=f,e.lineIndent=c;break}}s&&(qe(e,a,o,!1),Oi(e,e.line-u),a=o=e.position,s=!1),et(d)||(o=e.position+1),d=e.input.charCodeAt(++e.position)}return qe(e,a,o,!1),e.result?!0:(e.kind=l,e.result=p,!1)}function Z0(e,t){var n,r,i;if(n=e.input.charCodeAt(e.position),n!==39)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(qe(e,r,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)r=e.position,e.position++,i=e.position;else return!0;else De(n)?(qe(e,r,i,!0),Oi(e,se(e,!1,t)),r=i=e.position):e.position===e.lineStart&&tr(e)?G(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);G(e,"unexpected end of the stream within a single quoted scalar")}function J0(e,t){var n,r,i,a,o,s;if(s=e.input.charCodeAt(e.position),s!==34)return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;(s=e.input.charCodeAt(e.position))!==0;){if(s===34)return qe(e,n,e.position,!0),e.position++,!0;if(s===92){if(qe(e,n,e.position,!0),s=e.input.charCodeAt(++e.position),De(s))se(e,!1,t);else if(s<256&&hu[s])e.result+=mu[s],e.position++;else if((o=z0(s))>0){for(i=o,a=0;i>0;i--)s=e.input.charCodeAt(++e.position),(o=W0(s))>=0?a=(a<<4)+o:G(e,"expected hexadecimal character");e.result+=Q0(a),e.position++}else G(e,"unknown escape sequence");n=r=e.position}else De(s)?(qe(e,n,r,!0),Oi(e,se(e,!1,t)),n=r=e.position):e.position===e.lineStart&&tr(e)?G(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}G(e,"unexpected end of the stream within a double quoted scalar")}function ew(e,t){var n=!0,r,i=e.tag,a,o=e.anchor,s,u,f,c,l,p={},d,h,m,g;if(g=e.input.charCodeAt(e.position),g===91)u=93,l=!1,a=[];else if(g===123)u=125,l=!0,a={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),g=e.input.charCodeAt(++e.position);g!==0;){if(se(e,!0,t),g=e.input.charCodeAt(e.position),g===u)return e.position++,e.tag=i,e.anchor=o,e.kind=l?"mapping":"sequence",e.result=a,!0;n||G(e,"missed comma between flow collection entries"),h=d=m=null,f=c=!1,g===63&&(s=e.input.charCodeAt(e.position+1),be(s)&&(f=c=!0,e.position++,se(e,!0,t))),r=e.line,xt(e,t,Nn,!1,!0),h=e.tag,d=e.result,se(e,!0,t),g=e.input.charCodeAt(e.position),(c||e.line===r)&&g===58&&(f=!0,g=e.input.charCodeAt(++e.position),se(e,!0,t),xt(e,t,Nn,!1,!0),m=e.result),l?wt(e,a,p,h,d,m):f?a.push(wt(e,null,p,h,d,m)):a.push(d),se(e,!0,t),g=e.input.charCodeAt(e.position),g===44?(n=!0,g=e.input.charCodeAt(++e.position)):n=!1}G(e,"unexpected end of the stream within a flow collection")}function tw(e,t){var n,r,i=Ar,a=!1,o=!1,s=t,u=0,f=!1,c,l;if(l=e.input.charCodeAt(e.position),l===124)r=!1;else if(l===62)r=!0;else return!1;for(e.kind="scalar",e.result="";l!==0;)if(l=e.input.charCodeAt(++e.position),l===43||l===45)Ar===i?i=l===43?Uo:U0:G(e,"repeat of a chomping mode identifier");else if((c=Y0(l))>=0)c===0?G(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?G(e,"repeat of an indentation width identifier"):(s=t+c-1,o=!0);else break;if(et(l)){do l=e.input.charCodeAt(++e.position);while(et(l));if(l===35)do l=e.input.charCodeAt(++e.position);while(!De(l)&&l!==0)}for(;l!==0;){for(Ii(e),e.lineIndent=0,l=e.input.charCodeAt(e.position);(!o||e.lineIndent<s)&&l===32;)e.lineIndent++,l=e.input.charCodeAt(++e.position);if(!o&&e.lineIndent>s&&(s=e.lineIndent),De(l)){u++;continue}if(e.lineIndent<s){i===Uo?e.result+=Be.repeat(`
54
+ `,a?1+u:u):i===Ar&&a&&(e.result+=`
55
55
  `);break}for(r?et(l)?(f=!0,e.result+=Be.repeat(`
56
56
  `,a?1+u:u)):f?(f=!1,e.result+=Be.repeat(`
57
57
  `,u+1)):u===0?a&&(e.result+=" "):e.result+=Be.repeat(`
58
58
  `,u):e.result+=Be.repeat(`
59
- `,a?1+u:u),a=!0,o=!0,u=0,n=e.position;!De(l)&&l!==0;)l=e.input.charCodeAt(++e.position);qe(e,n,e.position,!1)}return!0}function Wo(e,t){var n,r=e.tag,i=e.anchor,a=[],o,s=!1,u;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),u=e.input.charCodeAt(e.position);u!==0&&!(u!==45||(o=e.input.charCodeAt(e.position+1),!be(o)));){if(s=!0,e.position++,se(e,!0,-1)&&e.lineIndent<=t){a.push(null),u=e.input.charCodeAt(e.position);continue}if(n=e.line,xt(e,t,cu,!1,!0),a.push(e.result),se(e,!0,-1),u=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&u!==0)G(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return s?(e.tag=r,e.anchor=i,e.kind="sequence",e.result=a,!0):!1}function tw(e,t,n){var r,i,a,o,s=e.tag,u=e.anchor,f={},c={},l=null,p=null,d=null,h=!1,m=!1,g;for(e.anchor!==null&&(e.anchorMap[e.anchor]=f),g=e.input.charCodeAt(e.position);g!==0;){if(r=e.input.charCodeAt(e.position+1),a=e.line,o=e.position,(g===63||g===58)&&be(r))g===63?(h&&(wt(e,f,c,l,p,null),l=p=d=null),m=!0,h=!0,i=!0):h?(h=!1,i=!0):G(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,g=r;else if(xt(e,n,uu,!1,!0))if(e.line===a){for(g=e.input.charCodeAt(e.position);et(g);)g=e.input.charCodeAt(++e.position);if(g===58)g=e.input.charCodeAt(++e.position),be(g)||G(e,"a whitespace character is expected after the key-value separator within a block mapping"),h&&(wt(e,f,c,l,p,null),l=p=d=null),m=!0,h=!1,i=!1,l=e.tag,p=e.result;else if(m)G(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=s,e.anchor=u,!0}else if(m)G(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=s,e.anchor=u,!0;else break;if((e.line===a||e.lineIndent>t)&&(xt(e,t,Nn,!0,i)&&(h?p=e.result:d=e.result),h||(wt(e,f,c,l,p,d,a,o),l=p=d=null),se(e,!0,-1),g=e.input.charCodeAt(e.position)),e.lineIndent>t&&g!==0)G(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return h&&wt(e,f,c,l,p,null),m&&(e.tag=s,e.anchor=u,e.kind="mapping",e.result=f),m}function nw(e){var t,n=!1,r=!1,i,a,o;if(o=e.input.charCodeAt(e.position),o!==33)return!1;if(e.tag!==null&&G(e,"duplication of a tag property"),o=e.input.charCodeAt(++e.position),o===60?(n=!0,o=e.input.charCodeAt(++e.position)):o===33?(r=!0,i="!!",o=e.input.charCodeAt(++e.position)):i="!",t=e.position,n){do o=e.input.charCodeAt(++e.position);while(o!==0&&o!==62);e.position<e.length?(a=e.input.slice(t,e.position),o=e.input.charCodeAt(++e.position)):G(e,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!be(o);)o===33&&(r?G(e,"tag suffix cannot contain exclamation marks"):(i=e.input.slice(t-1,e.position+1),lu.test(i)||G(e,"named tag handle cannot contain such characters"),r=!0,t=e.position+1)),o=e.input.charCodeAt(++e.position);a=e.input.slice(t,e.position),q0.test(a)&&G(e,"tag suffix cannot contain flow indicator characters")}return a&&!fu.test(a)&&G(e,"tag name cannot contain such characters: "+a),n?e.tag=a:Ke.call(e.tagMap,i)?e.tag=e.tagMap[i]+a:i==="!"?e.tag="!"+a:i==="!!"?e.tag="tag:yaml.org,2002:"+a:G(e,'undeclared tag handle "'+i+'"'),!0}function rw(e){var t,n;if(n=e.input.charCodeAt(e.position),n!==38)return!1;for(e.anchor!==null&&G(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!be(n)&&!vt(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&G(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function iw(e){var t,n,r;if(r=e.input.charCodeAt(e.position),r!==42)return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!be(r)&&!vt(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&G(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),Ke.call(e.anchorMap,n)||G(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],se(e,!0,-1),!0}function xt(e,t,n,r,i){var a,o,s,u=1,f=!1,c=!1,l,p,d,h,m;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,a=o=s=Nn===n||cu===n,r&&se(e,!0,-1)&&(f=!0,e.lineIndent>t?u=1:e.lineIndent===t?u=0:e.lineIndent<t&&(u=-1)),u===1)for(;nw(e)||rw(e);)se(e,!0,-1)?(f=!0,s=a,e.lineIndent>t?u=1:e.lineIndent===t?u=0:e.lineIndent<t&&(u=-1)):s=!1;if(s&&(s=f||i),(u===1||Nn===n)&&(On===n||uu===n?h=t:h=t+1,m=e.position-e.lineStart,u===1?s&&(Wo(e,m)||tw(e,m,h))||J0(e,h)?c=!0:(o&&ew(e,h)||X0(e,h)||Z0(e,h)?c=!0:iw(e)?(c=!0,(e.tag!==null||e.anchor!==null)&&G(e,"alias node should not have any properties")):V0(e,h,On===n)&&(c=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):u===0&&(c=s&&Wo(e,m))),e.tag!==null&&e.tag!=="!")if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&G(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),l=0,p=e.implicitTypes.length;l<p;l+=1)if(d=e.implicitTypes[l],d.resolve(e.result)){e.result=d.construct(e.result),e.tag=d.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else Ke.call(e.typeMap[e.kind||"fallback"],e.tag)?(d=e.typeMap[e.kind||"fallback"][e.tag],e.result!==null&&d.kind!==e.kind&&G(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+d.kind+'", not "'+e.kind+'"'),d.resolve(e.result)?(e.result=d.construct(e.result),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):G(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")):G(e,"unknown tag !<"+e.tag+">");return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||c}function ow(e){var t=e.position,n,r,i,a=!1,o;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap={},e.anchorMap={};(o=e.input.charCodeAt(e.position))!==0&&(se(e,!0,-1),o=e.input.charCodeAt(e.position),!(e.lineIndent>0||o!==37));){for(a=!0,o=e.input.charCodeAt(++e.position),n=e.position;o!==0&&!be(o);)o=e.input.charCodeAt(++e.position);for(r=e.input.slice(n,e.position),i=[],r.length<1&&G(e,"directive name must not be less than one character in length");o!==0;){for(;et(o);)o=e.input.charCodeAt(++e.position);if(o===35){do o=e.input.charCodeAt(++e.position);while(o!==0&&!De(o));break}if(De(o))break;for(n=e.position;o!==0&&!be(o);)o=e.input.charCodeAt(++e.position);i.push(e.input.slice(n,e.position))}o!==0&&$i(e),Ke.call(qo,r)?qo[r](e,r,i):Pn(e,'unknown document directive "'+r+'"')}if(se(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,se(e,!0,-1)):a&&G(e,"directives end mark is expected"),xt(e,e.lineIndent-1,Nn,!1,!0),se(e,!0,-1),e.checkLineBreaks&&G0.test(e.input.slice(t,e.position))&&Pn(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&er(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,se(e,!0,-1));return}if(e.position<e.length-1)G(e,"end of the stream or a document separator is expected");else return}function gu(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
60
- `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new Q0(e,t),r=e.indexOf("\0");for(r!==-1&&(n.position=r,G(n,"null byte is not allowed in input")),n.input+="\0";n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)ow(n);return n.documents}function yu(e,t,n){t!==null&&typeof t=="object"&&typeof n>"u"&&(n=t,t=null);var r=gu(e,n);if(typeof t!="function")return r;for(var i=0,a=r.length;i<a;i+=1)t(r[i])}function vu(e,t){var n=gu(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new au("expected a single document in the stream, but found more")}}function aw(e,t,n){return typeof t=="object"&&t!==null&&typeof n>"u"&&(n=t,t=null),yu(e,t,Be.extend({schema:su},n))}function sw(e,t){return vu(e,Be.extend({schema:su},t))}qt.loadAll=yu;qt.load=vu;qt.safeLoadAll=aw;qt.safeLoad=sw;var Oi={},zt=$e,Yt=Kt,uw=Jn,cw=Wt,wu=Object.prototype.toString,Eu=Object.prototype.hasOwnProperty,lw=9,Mt=10,fw=13,pw=32,dw=33,hw=34,bu=35,mw=37,gw=38,yw=39,vw=42,Su=44,ww=45,xu=58,Ew=61,bw=62,Sw=63,xw=64,_u=91,Au=93,_w=96,Tu=123,Aw=124,Cu=125,de={};de[0]="\\0";de[7]="\\a";de[8]="\\b";de[9]="\\t";de[10]="\\n";de[11]="\\v";de[12]="\\f";de[13]="\\r";de[27]="\\e";de[34]='\\"';de[92]="\\\\";de[133]="\\N";de[160]="\\_";de[8232]="\\L";de[8233]="\\P";var Tw=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function Cw(e,t){var n,r,i,a,o,s,u;if(t===null)return{};for(n={},r=Object.keys(t),i=0,a=r.length;i<a;i+=1)o=r[i],s=String(t[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),u=e.compiledTypeMap.fallback[o],u&&Eu.call(u.styleAliases,s)&&(s=u.styleAliases[s]),n[o]=s;return n}function zo(e){var t,n,r;if(t=e.toString(16).toUpperCase(),e<=255)n="x",r=2;else if(e<=65535)n="u",r=4;else if(e<=4294967295)n="U",r=8;else throw new Yt("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+zt.repeat("0",r-t.length)+t}function Rw(e){this.schema=e.schema||uw,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=zt.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=Cw(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Yo(e,t){for(var n=zt.repeat(" ",t),r=0,i=-1,a="",o,s=e.length;r<s;)i=e.indexOf(`
59
+ `,a?1+u:u),a=!0,o=!0,u=0,n=e.position;!De(l)&&l!==0;)l=e.input.charCodeAt(++e.position);qe(e,n,e.position,!1)}return!0}function zo(e,t){var n,r=e.tag,i=e.anchor,a=[],o,s=!1,u;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),u=e.input.charCodeAt(e.position);u!==0&&!(u!==45||(o=e.input.charCodeAt(e.position+1),!be(o)));){if(s=!0,e.position++,se(e,!0,-1)&&e.lineIndent<=t){a.push(null),u=e.input.charCodeAt(e.position);continue}if(n=e.line,xt(e,t,lu,!1,!0),a.push(e.result),se(e,!0,-1),u=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&u!==0)G(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return s?(e.tag=r,e.anchor=i,e.kind="sequence",e.result=a,!0):!1}function nw(e,t,n){var r,i,a,o,s=e.tag,u=e.anchor,f={},c={},l=null,p=null,d=null,h=!1,m=!1,g;for(e.anchor!==null&&(e.anchorMap[e.anchor]=f),g=e.input.charCodeAt(e.position);g!==0;){if(r=e.input.charCodeAt(e.position+1),a=e.line,o=e.position,(g===63||g===58)&&be(r))g===63?(h&&(wt(e,f,c,l,p,null),l=p=d=null),m=!0,h=!0,i=!0):h?(h=!1,i=!0):G(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,g=r;else if(xt(e,n,cu,!1,!0))if(e.line===a){for(g=e.input.charCodeAt(e.position);et(g);)g=e.input.charCodeAt(++e.position);if(g===58)g=e.input.charCodeAt(++e.position),be(g)||G(e,"a whitespace character is expected after the key-value separator within a block mapping"),h&&(wt(e,f,c,l,p,null),l=p=d=null),m=!0,h=!1,i=!1,l=e.tag,p=e.result;else if(m)G(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=s,e.anchor=u,!0}else if(m)G(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=s,e.anchor=u,!0;else break;if((e.line===a||e.lineIndent>t)&&(xt(e,t,Pn,!0,i)&&(h?p=e.result:d=e.result),h||(wt(e,f,c,l,p,d,a,o),l=p=d=null),se(e,!0,-1),g=e.input.charCodeAt(e.position)),e.lineIndent>t&&g!==0)G(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return h&&wt(e,f,c,l,p,null),m&&(e.tag=s,e.anchor=u,e.kind="mapping",e.result=f),m}function rw(e){var t,n=!1,r=!1,i,a,o;if(o=e.input.charCodeAt(e.position),o!==33)return!1;if(e.tag!==null&&G(e,"duplication of a tag property"),o=e.input.charCodeAt(++e.position),o===60?(n=!0,o=e.input.charCodeAt(++e.position)):o===33?(r=!0,i="!!",o=e.input.charCodeAt(++e.position)):i="!",t=e.position,n){do o=e.input.charCodeAt(++e.position);while(o!==0&&o!==62);e.position<e.length?(a=e.input.slice(t,e.position),o=e.input.charCodeAt(++e.position)):G(e,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!be(o);)o===33&&(r?G(e,"tag suffix cannot contain exclamation marks"):(i=e.input.slice(t-1,e.position+1),fu.test(i)||G(e,"named tag handle cannot contain such characters"),r=!0,t=e.position+1)),o=e.input.charCodeAt(++e.position);a=e.input.slice(t,e.position),K0.test(a)&&G(e,"tag suffix cannot contain flow indicator characters")}return a&&!pu.test(a)&&G(e,"tag name cannot contain such characters: "+a),n?e.tag=a:Ke.call(e.tagMap,i)?e.tag=e.tagMap[i]+a:i==="!"?e.tag="!"+a:i==="!!"?e.tag="tag:yaml.org,2002:"+a:G(e,'undeclared tag handle "'+i+'"'),!0}function iw(e){var t,n;if(n=e.input.charCodeAt(e.position),n!==38)return!1;for(e.anchor!==null&&G(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!be(n)&&!vt(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&G(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function ow(e){var t,n,r;if(r=e.input.charCodeAt(e.position),r!==42)return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!be(r)&&!vt(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&G(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),Ke.call(e.anchorMap,n)||G(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],se(e,!0,-1),!0}function xt(e,t,n,r,i){var a,o,s,u=1,f=!1,c=!1,l,p,d,h,m;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,a=o=s=Pn===n||lu===n,r&&se(e,!0,-1)&&(f=!0,e.lineIndent>t?u=1:e.lineIndent===t?u=0:e.lineIndent<t&&(u=-1)),u===1)for(;rw(e)||iw(e);)se(e,!0,-1)?(f=!0,s=a,e.lineIndent>t?u=1:e.lineIndent===t?u=0:e.lineIndent<t&&(u=-1)):s=!1;if(s&&(s=f||i),(u===1||Pn===n)&&(Nn===n||cu===n?h=t:h=t+1,m=e.position-e.lineStart,u===1?s&&(zo(e,m)||nw(e,m,h))||ew(e,h)?c=!0:(o&&tw(e,h)||Z0(e,h)||J0(e,h)?c=!0:ow(e)?(c=!0,(e.tag!==null||e.anchor!==null)&&G(e,"alias node should not have any properties")):X0(e,h,Nn===n)&&(c=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):u===0&&(c=s&&zo(e,m))),e.tag!==null&&e.tag!=="!")if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&G(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),l=0,p=e.implicitTypes.length;l<p;l+=1)if(d=e.implicitTypes[l],d.resolve(e.result)){e.result=d.construct(e.result),e.tag=d.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else Ke.call(e.typeMap[e.kind||"fallback"],e.tag)?(d=e.typeMap[e.kind||"fallback"][e.tag],e.result!==null&&d.kind!==e.kind&&G(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+d.kind+'", not "'+e.kind+'"'),d.resolve(e.result)?(e.result=d.construct(e.result),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):G(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")):G(e,"unknown tag !<"+e.tag+">");return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||c}function aw(e){var t=e.position,n,r,i,a=!1,o;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap={},e.anchorMap={};(o=e.input.charCodeAt(e.position))!==0&&(se(e,!0,-1),o=e.input.charCodeAt(e.position),!(e.lineIndent>0||o!==37));){for(a=!0,o=e.input.charCodeAt(++e.position),n=e.position;o!==0&&!be(o);)o=e.input.charCodeAt(++e.position);for(r=e.input.slice(n,e.position),i=[],r.length<1&&G(e,"directive name must not be less than one character in length");o!==0;){for(;et(o);)o=e.input.charCodeAt(++e.position);if(o===35){do o=e.input.charCodeAt(++e.position);while(o!==0&&!De(o));break}if(De(o))break;for(n=e.position;o!==0&&!be(o);)o=e.input.charCodeAt(++e.position);i.push(e.input.slice(n,e.position))}o!==0&&Ii(e),Ke.call(Ko,r)?Ko[r](e,r,i):Ln(e,'unknown document directive "'+r+'"')}if(se(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,se(e,!0,-1)):a&&G(e,"directives end mark is expected"),xt(e,e.lineIndent-1,Pn,!1,!0),se(e,!0,-1),e.checkLineBreaks&&q0.test(e.input.slice(t,e.position))&&Ln(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&tr(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,se(e,!0,-1));return}if(e.position<e.length-1)G(e,"end of the stream or a document separator is expected");else return}function yu(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
60
+ `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new V0(e,t),r=e.indexOf("\0");for(r!==-1&&(n.position=r,G(n,"null byte is not allowed in input")),n.input+="\0";n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)aw(n);return n.documents}function vu(e,t,n){t!==null&&typeof t=="object"&&typeof n>"u"&&(n=t,t=null);var r=yu(e,n);if(typeof t!="function")return r;for(var i=0,a=r.length;i<a;i+=1)t(r[i])}function wu(e,t){var n=yu(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new su("expected a single document in the stream, but found more")}}function sw(e,t,n){return typeof t=="object"&&t!==null&&typeof n>"u"&&(n=t,t=null),vu(e,t,Be.extend({schema:uu},n))}function uw(e,t){return wu(e,Be.extend({schema:uu},t))}qt.loadAll=vu;qt.load=wu;qt.safeLoadAll=sw;qt.safeLoad=uw;var Ni={},zt=$e,Yt=Kt,cw=er,lw=Wt,Eu=Object.prototype.toString,bu=Object.prototype.hasOwnProperty,fw=9,Mt=10,pw=13,dw=32,hw=33,mw=34,Su=35,gw=37,yw=38,vw=39,ww=42,xu=44,Ew=45,_u=58,bw=61,Sw=62,xw=63,_w=64,Au=91,Tu=93,Aw=96,Cu=123,Tw=124,Ru=125,de={};de[0]="\\0";de[7]="\\a";de[8]="\\b";de[9]="\\t";de[10]="\\n";de[11]="\\v";de[12]="\\f";de[13]="\\r";de[27]="\\e";de[34]='\\"';de[92]="\\\\";de[133]="\\N";de[160]="\\_";de[8232]="\\L";de[8233]="\\P";var Cw=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];function Rw(e,t){var n,r,i,a,o,s,u;if(t===null)return{};for(n={},r=Object.keys(t),i=0,a=r.length;i<a;i+=1)o=r[i],s=String(t[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),u=e.compiledTypeMap.fallback[o],u&&bu.call(u.styleAliases,s)&&(s=u.styleAliases[s]),n[o]=s;return n}function Yo(e){var t,n,r;if(t=e.toString(16).toUpperCase(),e<=255)n="x",r=2;else if(e<=65535)n="u",r=4;else if(e<=4294967295)n="U",r=8;else throw new Yt("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+zt.repeat("0",r-t.length)+t}function Fw(e){this.schema=e.schema||cw,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=zt.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=Rw(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Qo(e,t){for(var n=zt.repeat(" ",t),r=0,i=-1,a="",o,s=e.length;r<s;)i=e.indexOf(`
61
61
  `,r),i===-1?(o=e.slice(r),r=s):(o=e.slice(r,i+1),r=i+1),o.length&&o!==`
62
- `&&(a+=n),a+=o;return a}function Wr(e,t){return`
63
- `+zt.repeat(" ",e.indent*t)}function Fw(e,t){var n,r,i;for(n=0,r=e.implicitTypes.length;n<r;n+=1)if(i=e.implicitTypes[n],i.resolve(t))return!0;return!1}function Ni(e){return e===pw||e===lw}function _t(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==65279||65536<=e&&e<=1114111}function $w(e){return _t(e)&&!Ni(e)&&e!==65279&&e!==fw&&e!==Mt}function Qo(e,t){return _t(e)&&e!==65279&&e!==Su&&e!==_u&&e!==Au&&e!==Tu&&e!==Cu&&e!==xu&&(e!==bu||t&&$w(t))}function Iw(e){return _t(e)&&e!==65279&&!Ni(e)&&e!==ww&&e!==Sw&&e!==xu&&e!==Su&&e!==_u&&e!==Au&&e!==Tu&&e!==Cu&&e!==bu&&e!==gw&&e!==vw&&e!==dw&&e!==Aw&&e!==Ew&&e!==bw&&e!==yw&&e!==hw&&e!==mw&&e!==xw&&e!==_w}function Ru(e){var t=/^\n* /;return t.test(e)}var Fu=1,$u=2,Iu=3,Ou=4,ln=5;function Ow(e,t,n,r,i){var a,o,s,u=!1,f=!1,c=r!==-1,l=-1,p=Iw(e.charCodeAt(0))&&!Ni(e.charCodeAt(e.length-1));if(t)for(a=0;a<e.length;a++){if(o=e.charCodeAt(a),!_t(o))return ln;s=a>0?e.charCodeAt(a-1):null,p=p&&Qo(o,s)}else{for(a=0;a<e.length;a++){if(o=e.charCodeAt(a),o===Mt)u=!0,c&&(f=f||a-l-1>r&&e[l+1]!==" ",l=a);else if(!_t(o))return ln;s=a>0?e.charCodeAt(a-1):null,p=p&&Qo(o,s)}f=f||c&&a-l-1>r&&e[l+1]!==" "}return!u&&!f?p&&!i(e)?Fu:$u:n>9&&Ru(e)?ln:f?Ou:Iu}function Nw(e,t,n,r){e.dump=(function(){if(t.length===0)return"''";if(!e.noCompatMode&&Tw.indexOf(t)!==-1)return"'"+t+"'";var i=e.indent*Math.max(1,n),a=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-i),o=r||e.flowLevel>-1&&n>=e.flowLevel;function s(u){return Fw(e,u)}switch(Ow(t,o,e.indent,a,s)){case Fu:return t;case $u:return"'"+t.replace(/'/g,"''")+"'";case Iu:return"|"+Vo(t,e.indent)+Xo(Yo(t,i));case Ou:return">"+Vo(t,e.indent)+Xo(Yo(Pw(t,a),i));case ln:return'"'+Lw(t)+'"';default:throw new Yt("impossible error: invalid scalar style")}})()}function Vo(e,t){var n=Ru(e)?String(t):"",r=e[e.length-1]===`
62
+ `&&(a+=n),a+=o;return a}function zr(e,t){return`
63
+ `+zt.repeat(" ",e.indent*t)}function $w(e,t){var n,r,i;for(n=0,r=e.implicitTypes.length;n<r;n+=1)if(i=e.implicitTypes[n],i.resolve(t))return!0;return!1}function Pi(e){return e===dw||e===fw}function _t(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==65279||65536<=e&&e<=1114111}function Iw(e){return _t(e)&&!Pi(e)&&e!==65279&&e!==pw&&e!==Mt}function Vo(e,t){return _t(e)&&e!==65279&&e!==xu&&e!==Au&&e!==Tu&&e!==Cu&&e!==Ru&&e!==_u&&(e!==Su||t&&Iw(t))}function Ow(e){return _t(e)&&e!==65279&&!Pi(e)&&e!==Ew&&e!==xw&&e!==_u&&e!==xu&&e!==Au&&e!==Tu&&e!==Cu&&e!==Ru&&e!==Su&&e!==yw&&e!==ww&&e!==hw&&e!==Tw&&e!==bw&&e!==Sw&&e!==vw&&e!==mw&&e!==gw&&e!==_w&&e!==Aw}function Fu(e){var t=/^\n* /;return t.test(e)}var $u=1,Iu=2,Ou=3,Nu=4,fn=5;function Nw(e,t,n,r,i){var a,o,s,u=!1,f=!1,c=r!==-1,l=-1,p=Ow(e.charCodeAt(0))&&!Pi(e.charCodeAt(e.length-1));if(t)for(a=0;a<e.length;a++){if(o=e.charCodeAt(a),!_t(o))return fn;s=a>0?e.charCodeAt(a-1):null,p=p&&Vo(o,s)}else{for(a=0;a<e.length;a++){if(o=e.charCodeAt(a),o===Mt)u=!0,c&&(f=f||a-l-1>r&&e[l+1]!==" ",l=a);else if(!_t(o))return fn;s=a>0?e.charCodeAt(a-1):null,p=p&&Vo(o,s)}f=f||c&&a-l-1>r&&e[l+1]!==" "}return!u&&!f?p&&!i(e)?$u:Iu:n>9&&Fu(e)?fn:f?Nu:Ou}function Pw(e,t,n,r){e.dump=(function(){if(t.length===0)return"''";if(!e.noCompatMode&&Cw.indexOf(t)!==-1)return"'"+t+"'";var i=e.indent*Math.max(1,n),a=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-i),o=r||e.flowLevel>-1&&n>=e.flowLevel;function s(u){return $w(e,u)}switch(Nw(t,o,e.indent,a,s)){case $u:return t;case Iu:return"'"+t.replace(/'/g,"''")+"'";case Ou:return"|"+Xo(t,e.indent)+Zo(Qo(t,i));case Nu:return">"+Xo(t,e.indent)+Zo(Qo(Lw(t,a),i));case fn:return'"'+kw(t)+'"';default:throw new Yt("impossible error: invalid scalar style")}})()}function Xo(e,t){var n=Fu(e)?String(t):"",r=e[e.length-1]===`
64
64
  `,i=r&&(e[e.length-2]===`
65
65
  `||e===`
66
66
  `),a=i?"+":r?"":"-";return n+a+`
67
- `}function Xo(e){return e[e.length-1]===`
68
- `?e.slice(0,-1):e}function Pw(e,t){for(var n=/(\n+)([^\n]*)/g,r=(function(){var f=e.indexOf(`
69
- `);return f=f!==-1?f:e.length,n.lastIndex=f,Zo(e.slice(0,f),t)})(),i=e[0]===`
67
+ `}function Zo(e){return e[e.length-1]===`
68
+ `?e.slice(0,-1):e}function Lw(e,t){for(var n=/(\n+)([^\n]*)/g,r=(function(){var f=e.indexOf(`
69
+ `);return f=f!==-1?f:e.length,n.lastIndex=f,Jo(e.slice(0,f),t)})(),i=e[0]===`
70
70
  `||e[0]===" ",a,o;o=n.exec(e);){var s=o[1],u=o[2];a=u[0]===" ",r+=s+(!i&&!a&&u!==""?`
71
- `:"")+Zo(u,t),i=a}return r}function Zo(e,t){if(e===""||e[0]===" ")return e;for(var n=/ [^ ]/g,r,i=0,a,o=0,s=0,u="";r=n.exec(e);)s=r.index,s-i>t&&(a=o>i?o:s,u+=`
71
+ `:"")+Jo(u,t),i=a}return r}function Jo(e,t){if(e===""||e[0]===" ")return e;for(var n=/ [^ ]/g,r,i=0,a,o=0,s=0,u="";r=n.exec(e);)s=r.index,s-i>t&&(a=o>i?o:s,u+=`
72
72
  `+e.slice(i,a),i=a+1),o=s;return u+=`
73
73
  `,e.length-i>t&&o>i?u+=e.slice(i,o)+`
74
- `+e.slice(o+1):u+=e.slice(i),u.slice(1)}function Lw(e){for(var t="",n,r,i,a=0;a<e.length;a++){if(n=e.charCodeAt(a),n>=55296&&n<=56319&&(r=e.charCodeAt(a+1),r>=56320&&r<=57343)){t+=zo((n-55296)*1024+r-56320+65536),a++;continue}i=de[n],t+=!i&&_t(n)?e[a]:i||zo(n)}return t}function kw(e,t,n){var r="",i=e.tag,a,o;for(a=0,o=n.length;a<o;a+=1)rt(e,t,n[a],!1,!1)&&(a!==0&&(r+=","+(e.condenseFlow?"":" ")),r+=e.dump);e.tag=i,e.dump="["+r+"]"}function Dw(e,t,n,r){var i="",a=e.tag,o,s;for(o=0,s=n.length;o<s;o+=1)rt(e,t+1,n[o],!0,!0)&&((!r||o!==0)&&(i+=Wr(e,t)),e.dump&&Mt===e.dump.charCodeAt(0)?i+="-":i+="- ",i+=e.dump);e.tag=a,e.dump=i||"[]"}function Mw(e,t,n){var r="",i=e.tag,a=Object.keys(n),o,s,u,f,c;for(o=0,s=a.length;o<s;o+=1)c="",o!==0&&(c+=", "),e.condenseFlow&&(c+='"'),u=a[o],f=n[u],rt(e,t,u,!1,!1)&&(e.dump.length>1024&&(c+="? "),c+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),rt(e,t,f,!1,!1)&&(c+=e.dump,r+=c));e.tag=i,e.dump="{"+r+"}"}function jw(e,t,n,r){var i="",a=e.tag,o=Object.keys(n),s,u,f,c,l,p;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys=="function")o.sort(e.sortKeys);else if(e.sortKeys)throw new Yt("sortKeys must be a boolean or a function");for(s=0,u=o.length;s<u;s+=1)p="",(!r||s!==0)&&(p+=Wr(e,t)),f=o[s],c=n[f],rt(e,t+1,f,!0,!0,!0)&&(l=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,l&&(e.dump&&Mt===e.dump.charCodeAt(0)?p+="?":p+="? "),p+=e.dump,l&&(p+=Wr(e,t)),rt(e,t+1,c,!0,l)&&(e.dump&&Mt===e.dump.charCodeAt(0)?p+=":":p+=": ",p+=e.dump,i+=p));e.tag=a,e.dump=i||"{}"}function Jo(e,t,n){var r,i,a,o,s,u;for(i=n?e.explicitTypes:e.implicitTypes,a=0,o=i.length;a<o;a+=1)if(s=i[a],(s.instanceOf||s.predicate)&&(!s.instanceOf||typeof t=="object"&&t instanceof s.instanceOf)&&(!s.predicate||s.predicate(t))){if(e.tag=n?s.tag:"?",s.represent){if(u=e.styleMap[s.tag]||s.defaultStyle,wu.call(s.represent)==="[object Function]")r=s.represent(t,u);else if(Eu.call(s.represent,u))r=s.represent[u](t,u);else throw new Yt("!<"+s.tag+'> tag resolver accepts not "'+u+'" style');e.dump=r}return!0}return!1}function rt(e,t,n,r,i,a){e.tag=null,e.dump=n,Jo(e,n,!1)||Jo(e,n,!0);var o=wu.call(e.dump);r&&(r=e.flowLevel<0||e.flowLevel>t);var s=o==="[object Object]"||o==="[object Array]",u,f;if(s&&(u=e.duplicates.indexOf(n),f=u!==-1),(e.tag!==null&&e.tag!=="?"||f||e.indent!==2&&t>0)&&(i=!1),f&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(s&&f&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),o==="[object Object]")r&&Object.keys(e.dump).length!==0?(jw(e,t,e.dump,i),f&&(e.dump="&ref_"+u+e.dump)):(Mw(e,t,e.dump),f&&(e.dump="&ref_"+u+" "+e.dump));else if(o==="[object Array]"){var c=e.noArrayIndent&&t>0?t-1:t;r&&e.dump.length!==0?(Dw(e,c,e.dump,i),f&&(e.dump="&ref_"+u+e.dump)):(kw(e,c,e.dump),f&&(e.dump="&ref_"+u+" "+e.dump))}else if(o==="[object String]")e.tag!=="?"&&Nw(e,e.dump,t,a);else{if(e.skipInvalid)return!1;throw new Yt("unacceptable kind of an object to dump "+o)}e.tag!==null&&e.tag!=="?"&&(e.dump="!<"+e.tag+"> "+e.dump)}return!0}function Hw(e,t){var n=[],r=[],i,a;for(zr(e,n,r),i=0,a=r.length;i<a;i+=1)t.duplicates.push(n[r[i]]);t.usedDuplicates=new Array(a)}function zr(e,t,n){var r,i,a;if(e!==null&&typeof e=="object")if(i=t.indexOf(e),i!==-1)n.indexOf(i)===-1&&n.push(i);else if(t.push(e),Array.isArray(e))for(i=0,a=e.length;i<a;i+=1)zr(e[i],t,n);else for(r=Object.keys(e),i=0,a=r.length;i<a;i+=1)zr(e[r[i]],t,n)}function Nu(e,t){t=t||{};var n=new Rw(t);return n.noRefs||Hw(e,n),rt(n,0,e,!0,!0)?n.dump+`
75
- `:""}function Bw(e,t){return Nu(e,zt.extend({schema:cw},t))}Oi.dump=Nu;Oi.safeDump=Bw;var tr=qt,Pu=Oi;function nr(e){return function(){throw new Error("Function "+e+" is deprecated and cannot be used.")}}ie.Type=le;ie.Schema=Rt;ie.FAILSAFE_SCHEMA=Ri;ie.JSON_SCHEMA=tu;ie.CORE_SCHEMA=nu;ie.DEFAULT_SAFE_SCHEMA=Wt;ie.DEFAULT_FULL_SCHEMA=Jn;ie.load=tr.load;ie.loadAll=tr.loadAll;ie.safeLoad=tr.safeLoad;ie.safeLoadAll=tr.safeLoadAll;ie.dump=Pu.dump;ie.safeDump=Pu.safeDump;ie.YAMLException=Kt;ie.MINIMAL_SCHEMA=Ri;ie.SAFE_SCHEMA=Wt;ie.DEFAULT_SCHEMA=Jn;ie.scan=nr("scan");ie.parse=nr("parse");ie.compose=nr("compose");ie.addConstructor=nr("addConstructor");var Uw=ie,Gw=Uw;const Lu=Zs,qw=Wy,Kw=zy,Ww=Gw,ku=e=>Ww.safeLoad(Kw(e));Vs.exports=e=>qw(Lu.readFile)(e,"utf8").then(t=>ku(t));Vs.exports.sync=e=>ku(Lu.readFileSync(e,"utf8"));const zw=e=>/^[a-z][a-zA-Z0-9]+$/.test(e),Yw=e=>/^([a-z][a-z0-9]*)(-[a-z0-9]+)*$/.test(e),{toString:Qw}=Object.prototype,Vw=Error.prototype.toString,Xw=RegExp.prototype.toString,Zw=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",Jw=/^Symbol\((.*)\)(.*)$/;function eE(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":`${e}`}function ea(e,t=!1){if(e==null||e===!0||e===!1)return`${e}`;if(typeof e=="number")return eE(e);if(typeof e=="string")return t?`"${e}"`:e;if(typeof e=="function")return`[Function ${e.name||"anonymous"}]`;if(typeof e=="symbol")return Zw.call(e).replace(Jw,"Symbol($1)");const n=Qw.call(e).slice(8,-1);if(n==="Date"){const r=e;return Number.isNaN(r.getTime())?`${r}`:r.toISOString()}return n==="Error"||e instanceof Error?`[${Vw.call(e)}]`:n==="RegExp"?Xw.call(e):null}function ta(e,t){const n=ea(e,t);return n!==null?n:JSON.stringify(e,function(i,a){const o=ea(this[i],t);return o!==null?o:a},2)}const tE=e=>!ge.default.isNil(e),nE=e=>!ge.default.isNull(e);ot(jn,"notNil",function(t="${path} must be defined."){return this.test("defined",t,tE)});ot(jn,"notNull",function(t="${path} cannot be null."){return this.test("defined",t,nE)});ot(jn,"isFunction",function(t="${path} is not a function"){return this.test("is a function",t,n=>ge.default.isUndefined(n)||ge.default.isFunction(n))});ot(Zr,"isCamelCase",function(t="${path} is not in camel case (anExampleOfCamelCase)"){return this.test("is in camelCase",t,n=>n?zw(n):!0)});ot(Zr,"isKebabCase",function(t="${path} is not in kebab case (an-example-of-kebab-case)"){return this.test("is in kebab-case",t,n=>n?Yw(n):!0)});ot(Ma,"onlyContainsFunctions",function(t="${path} contains values that are not functions"){return this.test("only contains functions",t,n=>ge.default.isUndefined(n)||n&&Object.values(n).every(ge.default.isFunction))});ot(ja,"uniqueProperty",function(t,n){return this.test("unique",n,function(i){const a=[];if(i?.forEach((o,s)=>{i.filter(f=>C.get(t,f)===C.get(t,o)).length>1&&a.push(this.createError({path:`${this.path}[${s}].${t}`,message:n}))}),a.length)throw new me(a);return!0})});ap({mixed:{notType(e){const{path:t,type:n,value:r,originalValue:i}=e,a=i!=null&&i!==r;return`${t} must be a \`${n}\` type, but the final value was: \`${ta(r,!0)}\`${a?` (cast from the value \`${ta(i,!0)}\`).`:"."}`}}});z.union([z.string(),z.array(z.string())]).describe("Select specific fields to return in the response");z.union([z.literal("*"),z.string(),z.array(z.string()),z.record(z.string(),z.any())]).describe("Specify which relations to populate in the response");z.union([z.string(),z.array(z.string()),z.record(z.string(),z.enum(["asc","desc"])),z.array(z.record(z.string(),z.enum(["asc","desc"])))]).describe("Sort the results by specified fields");z.intersection(z.object({withCount:z.boolean().optional().describe("Include total count in response")}),z.union([z.object({page:z.number().int().positive().describe("Page number (1-based)"),pageSize:z.number().int().positive().describe("Number of entries per page")}).describe("Page-based pagination"),z.object({start:z.number().int().min(0).describe("Number of entries to skip"),limit:z.number().int().positive().describe("Maximum number of entries to return")}).describe("Offset-based pagination")])).describe("Pagination parameters");z.record(z.string(),z.any()).describe("Apply filters to the query");z.string().describe("Specify the locale for localized content");z.enum(["draft","published"]).describe("Filter by publication status");z.string().describe("Search query string");const nn=(e,t,n)=>{e&&e.emit&&e.emit(t,n)},rE=e=>[...new Set(e.filter(t=>!!t).flatMap(({remove:t,create:n,update:r})=>[n?"CREATE":"",r?"UPDATE":"",t?"REMOVE":""].filter(i=>!!i)))].join("_"),Du=e=>async t=>({title:t.title,path:t.path,audience:t.audience,type:t.type,uiRouterKey:t.uiRouterKey,order:t.order,collapsed:t.collapsed,menuAttached:t.menuAttached,autoSync:t.autoSync,removed:!1,updated:!0,externalPath:t.externalPath,items:t.items?await Promise.all(t.items.map(Du(e))):[],master:e.master,parent:void 0,related:t.related,additionalFields:t.additionalFields}),iE=(e,t)=>t.slice(1).reduce((n,r)=>n.concat([e,r]),t.slice(0,1)),oE=async({strapi:e})=>{const n=!!e.plugin("rest-cache"),r=e.store({type:"plugin",name:"navigation"}),i=Fe.configSchema.parse(await r.get({key:"config"}));return n?{hasCachePlugin:n,enabled:!!i.isCacheEnabled}:{hasCachePlugin:n,enabled:!1}},aE=e=>({async config({viaSettingsPage:t=!1}){const n=re(e,"common"),r=await oE(e),a=await(await n.getPluginStore()).get({key:"config"}).then(Fe.configSchema.parse),{additionalFields:o,cascadeMenuAttached:s,contentTypesPopulate:u,contentTypesNameFields:f,defaultContentType:c,pathDefaultFields:l,allowedLevels:p,preferCustomContentTypes:d}=a,h=!!e.strapi.plugin("graphql");let m={allowedContentTypes:ha,restrictedContentTypes:ma,availableAudience:[]};const g=await this.configContentTypes({}),E={contentTypes:await this.configContentTypes({viaSettingsPage:t}),contentTypesNameFields:{default:Bc,...B.isObject(f)?f:{}},contentTypesPopulate:B.isObject(u)?u:{},defaultContentType:c,pathDefaultFields:B.isObject(l)?l:{},allowedLevels:p,additionalFields:t?o:o.filter(S=>typeof S=="string"||!!S.enabled),gql:{navigationItemRelated:g.map(({gqlTypeName:S})=>S)},isGQLPluginEnabled:t?h:void 0,cascadeMenuAttached:s,preferCustomContentTypes:d};if(o.includes("audience")){const S=await Yc(e).find({},Number.MAX_SAFE_INTEGER);m={...m,availableAudience:S}}return{...E,...m,isCacheEnabled:r.enabled,isCachePluginEnabled:r.hasCachePlugin}},async configContentTypes({viaSettingsPage:t=!1}){const i=await(await re(e,"common").getPluginStore()).get({key:"config"}).then(Fe.configSchema.parse);return(await Promise.all(i.contentTypes.filter(o=>!!e.strapi.contentTypes[o]&&Wc(o)).map(async o=>{const s=Ar.parse(strapi.contentTypes[o]),{kind:u,options:f,uid:c}=s,l=f?.draftAndPublish,p=u===Di.SINGLE,d=p&&l,h=m=>({key:o,available:m});if(p){const m=kt(e,c);if(d){const E=d?await m.count({},"published"):!0;return h(E!==0)}return await m.count({})!==0?h(!0):t?h(!1):void 0}return h(!0)}))).reduce((o,s)=>{if(!s?.key)return o;const{key:u,available:f}=s,c=Ar.parse(e.strapi.contentTypes[u]),l=(c.associations||[]).find(({model:W})=>W==="navigationitem"),{uid:p,options:d,info:h,collectionName:m,modelName:g,apiName:E,plugin:S,kind:T,pluginOptions:A={}}=c,R=f&&!d?.hidden;if(!R)return o;const{visible:F=!0}=A["content-manager"]||{},{description:D="",displayName:x=""}=h,_=B.find(B.get(e.strapi.api,`[${g}].config.routes`,[]),W=>W.handler.includes(".find")),N=_&&_.path.split("/")[1],v=N&&N!==E?N:E||g,j=T===Di.SINGLE,H=j?v:fc.default(v),K=zc(g),w=typeof p=="string"?B.last(p.split(".")).split("-"):[],b=w.length>1?w.reduce((W,Q)=>`${W}${B.upperFirst(Q)}`,""):B.upperFirst(g),U=e.strapi.plugin("graphql")?.service("utils")?.naming?.getTypeName(c)||"";return o.push({uid:p,name:K,draftAndPublish:d?.draftAndPublish,isSingle:j,description:D,collectionName:m,contentTypeName:b,label:x,relatedField:l?l.alias:void 0,endpoint:H,plugin:S,available:R,visible:F,templateName:d?.templateName,gqlTypeName:U}),o},[])},async get({ids:t,locale:n}){let r={};t&&t.length&&(r.id={$in:t});const i=await _e(e).find({filters:r,locale:n||"*",limit:Number.MAX_SAFE_INTEGER,populate:["items","items.parent","items.audience","items.related"]}),a=({allItems:o,item:s,parent:u})=>{const f=o.filter(c=>c.parent?.documentId===s.documentId);return{...s,parent:u,items:f.map(c=>a({parent:s,item:c,allItems:o})).sort((c,l)=>c.order-l.order)}};return i.map(o=>({...o,items:o.items?.filter(s=>!s.parent).map(s=>a({allItems:o.items??[],item:s})).sort((s,u)=>s.order-u.order)}))},async getById({documentId:t,locale:n,populate:r=[]}){const i=re(e,"common"),{defaultLocale:a}=await i.readLocale(),o={documentId:t},s=await _e(e).findOne({filters:o,locale:n||a}),u=await Le(e).find({filters:{master:s.id},locale:n||a,limit:Number.MAX_SAFE_INTEGER,order:[{order:"asc"}],populate:["parent","audience",...r]});return{...s,items:i.buildNestedStructure({navigationItems:u}).filter(({parent:f})=>!f)}},async post({auditLog:t,payload:n}){const{masterModel:r}=we(e),i=re(e,"common"),{defaultLocale:a,restLocale:o}=await i.readLocale(),s=_e(e),u=[],{name:f,visible:c}=n,l=await i.getSlug({query:f}),p=await s.save({name:f,visible:c,locale:a,slug:l});u.push(await this.getById({documentId:p.documentId}));for(const d of o){const h=await s.save({name:f,visible:c,locale:d,slug:l,documentId:p.documentId});u.push(await this.getById({documentId:h.documentId}))}return u.map(d=>{nn(t,"onChangeNavigation",{actionType:"CREATE",oldEntity:d,newEntity:d})}),await i.emitEvent({entity:p,event:"entry.create",uid:r.uid}),{...p,items:[]}},async put({auditLog:t,payload:n}){const{masterModel:r}=we(e),i=re(e,"common"),{defaultLocale:a,restLocale:o}=await i.readLocale(),s=_e(e),{name:u,visible:f,items:c}=n,l=await s.findOne({filters:{documentId:n.documentId},locale:n.locale,populate:"*"}),p=await this.getById({documentId:n.documentId,locale:n.locale});if(l.name!==u||l.visible!==f){const h=u?await i.getSlug({query:u}):l.slug,m=await Promise.all([a,...o].map(g=>s.findOne({filters:{documentId:l.documentId},locale:g})));for(const g of m)await s.save({documentId:g.documentId,id:g.id,slug:h,locale:g.locale,name:u,visible:f})}return await i.analyzeBranch({navigationItems:c??[],masterEntity:l,prevAction:{}}).then(rE).then(async h=>{const m=await this.getById({documentId:l.documentId});nn(t,"onChangeNavigation",{actionType:h,oldEntity:p,newEntity:m})}),await i.emitEvent({entity:await s.findOne({filters:{documentId:n.documentId},populate:"*"}),event:"entry.update",uid:r.uid}),await this.getById({documentId:n.documentId,locale:n.locale,populate:["related"]})},async delete({auditLog:t,documentId:n}){const r=_e(e),i=Le(e),a=await this.getById({documentId:n}),o=async f=>{f.length<1||await i.removeForIds(await i.findForMasterIds(f).then(c=>c.reduce((l,{documentId:p})=>(p&&l.push(p),l),[])))},s=await r.findOne({filters:{documentId:n},populate:"*"}),u=await r.find({filters:{documentId:s.documentId},locale:"*",populate:"*"});await o(u.map(({id:f})=>f)),await r.remove({documentId:s.documentId,locale:"*"}),nn(t,"onNavigationDeletion",{entity:a,actionType:"DELETE"})},async restart(){e.strapi.reload.isWatching=!1,setImmediate(()=>e.strapi.reload())},async restoreConfig(){console.log("restore");const t=re(e,"common");await(await t.getPluginStore()).delete({key:"config"}),await t.setDefaultConfig()},async refreshNavigationLocale(t){if(!t)return;const n=re(e,"common"),{defaultLocale:r}=await n.readLocale(),i=_e(e),a=await i.find({limit:Number.MAX_SAFE_INTEGER,locale:r});await Promise.all(a.map(({name:o,visible:s,slug:u,documentId:f})=>i.save({name:o,visible:s,locale:t,slug:u,documentId:f})))},async updateConfig({config:t}){const n=re(e,"common"),r=await n.getPluginStore(),i=await r.get({key:"config"}).then(Fe.configSchema.parse);ga(t.additionalFields),await r.set({key:"config",value:t});const a=B.differenceBy(i.additionalFields,t.additionalFields,"name").reduce((o,s)=>(typeof s=="string"||o.push(s),o),[]);B.isEmpty(a)||await n.pruneCustomFields({removedFields:a})},async fillFromOtherLocale({auditLog:t,source:n,target:r,documentId:i}){const a=await this.getById({documentId:i,locale:r});return await this.i18nNavigationContentsCopy({source:await this.getById({documentId:i,locale:n,populate:["related"]}),target:a}).then(()=>this.getById({documentId:i,locale:r,populate:["related"]})).then(o=>(nn(t,"onChangeNavigation",{actionType:"UPDATE",oldEntity:a,newEntity:o}),o))},async i18nNavigationContentsCopy({source:t,target:n}){const r=re(e,"common"),i=t.items??[],a=_e(e);if(n.items?.length)throw new rr("Current navigation is non-empty");if(!n.locale)throw new rr("Current navigation does not have specified locale");if(!i.length)throw new rr("Source navigation is empty");const o=Du({master:n,locale:n.locale,strapi});await r.createBranch({action:{create:!0},masterEntity:await a.findOne({filters:{documentId:n.documentId},locale:n.locale,populate:"*"}),navigationItems:await Promise.all(i.map(o)),parentItem:void 0})},async readNavigationItemFromLocale({path:t,source:n,target:r}){const i=await this.getById({documentId:n}),a=await this.getById({documentId:r});if(!i)throw new It("Unable to find source navigation for specified query");if(!a)throw new It("Unable to find target navigation for specified query");const o=["path","related","type","uiRouterKey","title","externalPath"],s=t.split(".").map(f=>parseInt(f,10));(!s.some(Number.isNaN)||!s.length)&&new Vc("Path is invalid");let u=B.get(i.items,iE("items",s.map(B.toString)));if(!u)throw new It("Unable to find navigation item");return yc.parse(B.pick(u,o))},async getContentTypeItems({query:t,uid:n}){const a=await(await re(e,"common").getPluginStore()).get({key:"config"}).then(Fe.configSchema.parse),o={publishedAt:{$notNull:!0}},s=B.get(e.strapi.contentTypes,n),{draftAndPublish:u}=s.options,f=kt(e,n);try{return await f.findMany(o,a.contentTypesPopulate[n]||[],u?"published":void 0,t.locale)}catch(c){return console.error(c),[]}},async purgeNavigationCache(t,n){const r=_e(e),i=await r.findOne({filters:{documentId:t}});if(!i)throw new It("Navigation is not defined");const a=f=>new RegExp(`/api/navigation/render/${f}`);let o=[a(i.documentId)];n&&(o=(await r.find({filters:{documentId:i.documentId}})).map(({documentId:c})=>a(c)));const u=strapi.plugin("rest-cache").service("cacheStore");return o.push(a(t)),await u.clearByRegexp(o),{success:!0}},async purgeNavigationsCache(){const n=strapi.plugin("rest-cache").service("cacheStore"),r=new RegExp("/api/navigation/render(.*)");return await n.clearByRegexp([r]),{success:!0}}}),na=(e,t={},n=[])=>{const{title:r,related:i}=e,a=B.isArray(i)?B.last(i):i;if(r)return B.isString(r)&&!B.isEmpty(r)?r:void 0;if(a){const o=sE(a,t,n);return B.isString(o)&&!B.isEmpty(o)?o:void 0}},sE=(e,t={},n=[])=>{const{__contentType:r}=e,i=B.find(n,o=>o.contentTypeName===r),{default:a=[]}=t;return B.get(t,`${i?i.collectionName:""}`,a).map(o=>e[o]).filter(o=>o)[0]||""},ra=(e,t)=>{const n=Mu(e),r=t?n.filter(({path:a})=>a.includes(t)):n,i=r.find(({path:a})=>a===t);return{root:i,items:B.isNil(i)?[]:e.filter(({documentId:a})=>r.find(o=>o.documentId===a))}},Mu=(e,t,n=null)=>e.filter(r=>!r.parent==null&&!t?!0:r.parent?.documentId===t).reduce((r,i)=>{const a=`${n||""}/${i.path}`.replace("//","/");return[{documentId:i.documentId,parent:n&&i.parent?.documentId?{id:i.parent?.id,documentId:i.parent?.documentId,path:n}:void 0,path:a},...Mu(e,i.documentId,a),...r]},[]),uE=(e,t)=>{const n=B.zipWith(e,t,(r,i)=>B.isNil(r)?-1:B.isNil(i)?1:r-i);return B.find(n,r=>r!==0)||0},cE=e=>({async readAll({locale:t,orderBy:n="createdAt",orderDirection:r="DESC"}){return _e(e).find({locale:t,orderBy:{[n]:r}})},renderRFRNavigationItem({item:t}){const{uiRouterKey:n,title:r,path:i,type:a,audience:o,additionalFields:s}=t,u={label:r,type:a,audience:o?.map(({key:f})=>f),additionalFields:s};if(a==="WRAPPER")return{...u};if(a==="EXTERNAL")return ya(i,new Et("External navigation item's path is undefined",t)),{...u,url:i};if(a==="INTERNAL")return{...u,page:n};if(a==="WRAPPER")return{...u};throw new Et("Unknown item type",t)},renderRFRPage({item:t,parent:n,enabledCustomFieldsNames:r}){const{documentId:i,uiRouterKey:a,title:o,path:s,related:u,type:f,audience:c,menuAttached:l,additionalFields:p}=t,d=r.reduce((h,m)=>({...h,[m]:p?.[m]}),{});return{id:a,documentId:i,title:o,related:f==="INTERNAL"&&u?.documentId&&u?.__type?{contentType:u.__type,documentId:u.documentId}:void 0,path:s,parent:n,audience:c,menuAttached:l,additionalFields:d}},renderRFR({items:t,parent:n,parentNavItem:r,contentTypes:i=[],enabledCustomFieldsNames:a}){const o=[];let s={},u={};return t.forEach(f=>{const{items:c,...l}=f,p=this.renderRFRNavigationItem({item:l}),d=this.renderRFRPage({item:l,parent:n,enabledCustomFieldsNames:a});if(f.type!=="EXTERNAL"&&(u={...u,[d.documentId]:{...d}}),f.menuAttached&&o.push(p),!n)s={...s,root:o};else{const h=o.filter(m=>m.type);B.isEmpty(h)||(s={...s,[n]:h.concat(r||[])})}if(!B.isEmpty(c)){const{nav:h}=this.renderRFR({items:c??[],parent:d.documentId,parentNavItem:p,contentTypes:i,enabledCustomFieldsNames:a}),{pages:m}=this.renderRFR({items:c||[],parent:d.documentId,parentNavItem:p,contentTypes:i,enabledCustomFieldsNames:a});u={...u,...m},s={...s,...h}}}),{pages:u,nav:s}},renderTree({items:t=[],documentId:n,path:r="",itemParser:i=a=>Promise.resolve(a)}){return Promise.all(t.reduce((a,o)=>(o.parent?.documentId===n&&a.push(i(B.cloneDeep(o),r)),a),[])).then(a=>a.sort((o,s)=>o.order!==void 0&&s.order!==void 0?o.order-s.order:0))},getCustomFields(t){return t.reduce((n,r)=>(r!=="audience"&&n.push(r),n),[])},async renderType({criteria:t={},filter:n,itemCriteria:r={},locale:i,populate:a,rootPath:o,type:s="FLAT",wrapRelated:u,status:f="published"}){const c=re(e,"admin"),l=re(e,"common"),p={...t,visible:!0},d=_e(e),h=Le(e);let m;if(i?m=await d.find({filters:{...p},locale:i,limit:1}):m=await d.find({filters:p,limit:1}),B.isArray(m)&&(m=B.first(m)),m&&m.documentId){const g=await h.find({filters:{master:B.pick(m,["slug","id"]),...r},locale:i,limit:Number.MAX_SAFE_INTEGER,order:[{order:"asc"}],populate:["audience","parent","related"]}),E=await l.mapToNavigationItemDTO({locale:i,master:m,navigationItems:g,populate:a,status:f}),{contentTypes:S,contentTypesNameFields:T,additionalFields:A}=await c.config({viaSettingsPage:!1}),R=this.getCustomFields(A).reduce((_,N)=>N.enabled?[..._,N.name]:_,[]),F=_=>u&&_?{documentId:_.documentId,..._}:_,D=A.filter(_=>typeof _!="string"),x=_=>(N,v)=>{const j=D.find(({name:K})=>K===v);let H=_.additionalFields?.[v];if(H)switch(j?.type){case"media":H=JSON.parse(H);break;case"boolean":H=H==="true";break}return{...N,[v]:H}};switch(s){case"TREE":case"RFR":const _=async(I,M="")=>{const U=I.type==="EXTERNAL",W=U?void 0:`${M==="/"?"":M}/${B.first(I.path)==="/"?I.path.substring(1):I.path}`,Q=typeof W=="string"?await l.getSlug({query:(B.first(W)==="/"?W.substring(1):W).replace(/\//g,"-")}):void 0,ee=B.isArray(I.related)?B.last(I.related):I.related,Ce=F(ee),$=R.reduce(x(I),{});return{id:I.id,documentId:I.documentId,title:na(I,T,S)??"Title missing",menuAttached:I.menuAttached,order:I.order,path:(U?I.externalPath:W)??"Path is missing",type:I.type,uiRouterKey:I.uiRouterKey,slug:!Q&&I.uiRouterKey?await l.getSlug({query:I.uiRouterKey}):Q,related:U||!ee?void 0:{...Ce},audience:B.isEmpty(I.audience)?void 0:I.audience,items:await this.renderTree({itemParser:_,path:W,documentId:I.documentId,items:E}),collapsed:I.collapsed,additionalFields:$||{}}},{items:N,root:v}=ra(E,o),j=await this.renderTree({itemParser:_,items:B.isNil(o)?E:N,path:v?.parent?.path,documentId:v?.parent?.documentId}),H=n?j.filter(I=>I.uiRouterKey===n):j;return s==="RFR"?this.renderRFR({items:H,contentTypes:S.map(I=>I.contentTypeName),enabledCustomFieldsNames:R}):H;default:const K=B.isNil(o)?E:ra(E,o).items,w=new Map,b=(I,M=w)=>{const U=M.get(I);if(!B.isNil(U))return U;const W=K.find($=>$.documentId===I);if(B.isNil(W))return[];const{order:Q,parent:ee}=W,Ce=ee?b(ee.documentId,M).concat(Q):[Q];return M.set(I,Ce),Ce};return K.map(I=>{const M=R.reduce(x(I),{});return{...I,audience:I.audience?.map(U=>U.key),title:na(I,T,S)||"",related:F(I.related),items:null,additionalFields:M}}).sort((I,M)=>uE(b(I.documentId),b(M.documentId)))}}throw new It},renderChildren({childUIKey:t,idOrSlug:n,locale:r,menuOnly:i,type:a="FLAT",wrapRelated:o,status:s}){const u={$or:[{documentId:n},{slug:n}]},f=a==="FLAT"?void 0:t,c={...i&&{menuAttached:!0},...a==="FLAT"?{uiRouterKey:t}:{}};return this.renderType({type:a,criteria:u,itemCriteria:c,filter:f,wrapRelated:o,locale:r,status:s})},render({idOrSlug:t,locale:n,menuOnly:r,populate:i,rootPath:a,type:o="FLAT",wrapRelated:s,status:u}){const f={$or:[{documentId:t},{slug:t}]},c=r?{menuAttached:!0}:{};return this.renderType({type:o,criteria:f,itemCriteria:c,rootPath:a,wrapRelated:s,locale:n,populate:i,status:u})}}),lE=({checkData:e,parentItem:t})=>new Promise((n,r)=>{if(t&&t.items){for(let i of e)for(let a of t.items)if(a.path===i.path&&a.id!==i.id&&i.type==="INTERNAL"&&!a.removed)return r(new Et(`Duplicate path:${i.path} in parent: ${t.title||"root"} for ${i.title} and ${a.title} items`,{parentTitle:t.title,parentId:t.id,path:i.path,errorTitles:[i.title,a.title]}))}return n()}),fE=async(e,t,n,r,i)=>{if(!t)return{title:void 0,path:void 0};const a=await kt(e,t.__type).findById(t.documentId,void 0,"published",{locale:n}),s=(B.isEmpty(r[t.__type])?r.default:r[t.__type]).reduce((c,l)=>c||a?.[l]?.toString(),""),f=(i[t.__type]||[]).reduce((c,l)=>c||a?.[l]?.toString(),void 0)||a?.id.toString();return{title:s,path:f}},rn={navigation:{},"navigation-item":{}},pE=e=>({async getPluginStore(){return await strapi.store({type:"plugin",name:"navigation"})},async mapToNavigationItemDTO({locale:t,master:n,navigationItems:r,parent:i,populate:a,status:o="published"}){const s=[],f=await(await this.getPluginStore()).get({key:"config"}).then(Fe.configSchema.parse),c=await Promise.all(r.map(async l=>{if(!l.related?.__type||!l.related.documentId)return l;const p=a??f.contentTypesPopulate[l.related.__type],h=await kt({strapi},l.related.__type).findById(l.related.documentId,p,o,{locale:t});return{...l,related:{...h,__type:l.related.__type,documentId:l.related.documentId}}}));for(const l of c){const{items:p=[],...d}=l;s.push({...d,parent:i??d.parent,items:await this.mapToNavigationItemDTO({navigationItems:p,populate:a,master:n,parent:d,locale:t,status:o})})}return s},setDefaultConfig(){return wa({strapi,forceDefault:!0})},getBranchName({item:t}){const n=!!t.documentId,r=t.removed;if(n&&!r)return"toUpdate";if(n&&r)return"toRemove";if(!n&&!r)return"toCreate"},async analyzeBranch({masterEntity:t,navigationItems:n=[],parentItem:r,prevAction:i={}}){const{toCreate:a,toRemove:o,toUpdate:s}=n.reduce((c,l)=>{const p=this.getBranchName({item:l});return p?{...c,[p]:[...c[p],l]}:c},{toRemove:[],toCreate:[],toUpdate:[]}),u={create:i.create||a.length>0,update:i.update||s.length>0,remove:i.remove||o.length>0},f=[...a,...s];return await lE({checkData:f,parentItem:r}),Promise.all([this.createBranch({action:u,masterEntity:t,navigationItems:a,parentItem:r}),this.removeBranch({navigationItems:o,action:u}),this.updateBranch({action:u,masterEntity:t,navigationItems:s,parentItem:r})]).then(([c,l,p])=>[...c,...l,...p])},async removeBranch({navigationItems:t=[],action:n={}}){const r=[];for(const i of t)i.documentId&&(n.remove=!0,await Le(e).remove(i),r.push(n),i.items?.length&&(await this.removeBranch({navigationItems:i.items})).forEach(o=>{r.push(o)}));return r},async createBranch({action:t,masterEntity:n,navigationItems:r,parentItem:i}){let a=[];const o=re(e,"admin"),{contentTypesNameFields:s,pathDefaultFields:u}=await o.config({viaSettingsPage:!1});for(const f of r){t.create=!0;const{parent:c,master:l,items:p,documentId:d,id:h,related:m,autoSync:g,...E}=f,{title:S=E.title,path:T=E.path}=g?await fE(e,m,n?.locale||"en",s,u):{},A=d&&h?{...E,documentId:d,id:h,master:n?n.id:void 0,parent:i?i.id:void 0,autoSync:g,title:S,path:T,related:m}:{...E,documentId:void 0,id:void 0,master:n?n.id:void 0,parent:i?i.id:void 0,autoSync:g,title:S,path:T,related:m},R=await Le(e).save({item:A,locale:n?.locale});if(f.items?.length){const F=await this.createBranch({action:{},masterEntity:n,navigationItems:f.items,parentItem:R});a=a.concat(F).concat([t])}else a.push(t)}return a},async updateBranch({masterEntity:t,navigationItems:n,action:r,parentItem:i}){const a=[];for(const o of n){r.update=!0;const{documentId:s,updated:u,parent:f,master:c,items:l,...p}=o;let d;u?d=await Le(e).save({item:{documentId:s,...p},locale:t?.locale}):d=o,l?.length?(await this.analyzeBranch({navigationItems:l,prevAction:{},masterEntity:t,parentItem:d})).forEach(m=>{a.push(m)}):a.push(r)}return a},async emitEvent({entity:t,event:n,uid:r}){const i=strapi.getModel(r),a=await cd({...i,schema:i.__schema__,getModel:()=>i},t);strapi.webhookRunner?strapi.webhookRunner.eventHub.emit(n,{model:i.modelName,entry:a}):console.warn("Webhook runner not present. Contact with Strapi Navigation Plugin team.")},async pruneCustomFields({removedFields:t}){const n=t.map(({name:o})=>`additionalFields.${o}`),r=t.map(({name:o})=>o),a=(await Le(e).find({filters:{additionalFields:{$contains:[r]}}})).map(o=>B.omit(o,n));for(const o of a)await Le(e).save({item:{documentId:o.documentId,additionalFields:o.additionalFields}})},async getSlug({query:t}){let n=lc.default(t);if(n){const r=await Le(e).count({$or:[{uiRouterKey:{$startsWith:n}},{uiRouterKey:n}]});r&&(n=`${n}-${r}`)}return n.toLowerCase()},registerLifeCycleHook({callback:t,contentTypeName:n,hookName:r}){rn[n][r]||(rn[n][r]=[]),rn[n][r]?.push(t)},async runLifeCycleHook({contentTypeName:t,event:n,hookName:r}){const i=rn[t][r]??[];for(const a of i)await a(n)},buildNestedStructure({navigationItems:t,id:n}){return t?.reduce((r,i)=>(n&&i.parent?.id!==n||r.push({...B.omit(i,["related","items"]),related:i.related,items:this.buildNestedStructure({navigationItems:t,id:i.id})}),r),[])??[]},async readLocale(){const t=strapi.plugin("i18n").service("locales");let n=await t.getDefaultLocale(),r=(await t.find({})).map(({code:i})=>i).filter(i=>i!==n);return n||(n=r[0],r=r.slice(1)),{defaultLocale:n,restLocale:r}},updateConfigSchema:Nc,updateCreateNavigationSchema:kc,updateNavigationItemAdditionalField:Pc,updateNavigationItemCustomField:Lc,updateUpdateNavigationSchema:Dc}),ia="navigations_items",oa="related",dE=e=>({async migrateRelatedIdToDocumentId(){if(!await strapi.db.connection.schema.hasColumn(ia,oa))return;console.log("Navigation plugin :: Migrations :: Related id to document id - START");const n=Le(e),r=await n.findV4({filters:{},limit:Number.MAX_SAFE_INTEGER});await Promise.all(r.map(async i=>{const a=i.related;if(a&&typeof a=="string"){const[o,s]=a.split(Hc);if(!B.isNaN(parseInt(s,10))){const u=await e.strapi.query(o).findOne({where:{id:s}});u&&await n.save({item:{documentId:i.documentId,related:{__type:o,documentId:u.documentId}}})}}})),await strapi.db.connection.schema.alterTable(ia,i=>{i.dropColumn(oa)}),console.log("Navigation plugin :: Migrations :: Related id to document id - DONE")}}),hE={admin:aE,common:pE,client:cE,migrate:dE},mE={bootstrap:Tl,destroy:Cl,register:Fl,config:Or,controllers:Wl,contentTypes:Ml,middlewares:Ea,policies:zl,routes:Vl,services:hE};module.exports=mE;
74
+ `+e.slice(o+1):u+=e.slice(i),u.slice(1)}function kw(e){for(var t="",n,r,i,a=0;a<e.length;a++){if(n=e.charCodeAt(a),n>=55296&&n<=56319&&(r=e.charCodeAt(a+1),r>=56320&&r<=57343)){t+=Yo((n-55296)*1024+r-56320+65536),a++;continue}i=de[n],t+=!i&&_t(n)?e[a]:i||Yo(n)}return t}function Dw(e,t,n){var r="",i=e.tag,a,o;for(a=0,o=n.length;a<o;a+=1)rt(e,t,n[a],!1,!1)&&(a!==0&&(r+=","+(e.condenseFlow?"":" ")),r+=e.dump);e.tag=i,e.dump="["+r+"]"}function Mw(e,t,n,r){var i="",a=e.tag,o,s;for(o=0,s=n.length;o<s;o+=1)rt(e,t+1,n[o],!0,!0)&&((!r||o!==0)&&(i+=zr(e,t)),e.dump&&Mt===e.dump.charCodeAt(0)?i+="-":i+="- ",i+=e.dump);e.tag=a,e.dump=i||"[]"}function jw(e,t,n){var r="",i=e.tag,a=Object.keys(n),o,s,u,f,c;for(o=0,s=a.length;o<s;o+=1)c="",o!==0&&(c+=", "),e.condenseFlow&&(c+='"'),u=a[o],f=n[u],rt(e,t,u,!1,!1)&&(e.dump.length>1024&&(c+="? "),c+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),rt(e,t,f,!1,!1)&&(c+=e.dump,r+=c));e.tag=i,e.dump="{"+r+"}"}function Hw(e,t,n,r){var i="",a=e.tag,o=Object.keys(n),s,u,f,c,l,p;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys=="function")o.sort(e.sortKeys);else if(e.sortKeys)throw new Yt("sortKeys must be a boolean or a function");for(s=0,u=o.length;s<u;s+=1)p="",(!r||s!==0)&&(p+=zr(e,t)),f=o[s],c=n[f],rt(e,t+1,f,!0,!0,!0)&&(l=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,l&&(e.dump&&Mt===e.dump.charCodeAt(0)?p+="?":p+="? "),p+=e.dump,l&&(p+=zr(e,t)),rt(e,t+1,c,!0,l)&&(e.dump&&Mt===e.dump.charCodeAt(0)?p+=":":p+=": ",p+=e.dump,i+=p));e.tag=a,e.dump=i||"{}"}function ea(e,t,n){var r,i,a,o,s,u;for(i=n?e.explicitTypes:e.implicitTypes,a=0,o=i.length;a<o;a+=1)if(s=i[a],(s.instanceOf||s.predicate)&&(!s.instanceOf||typeof t=="object"&&t instanceof s.instanceOf)&&(!s.predicate||s.predicate(t))){if(e.tag=n?s.tag:"?",s.represent){if(u=e.styleMap[s.tag]||s.defaultStyle,Eu.call(s.represent)==="[object Function]")r=s.represent(t,u);else if(bu.call(s.represent,u))r=s.represent[u](t,u);else throw new Yt("!<"+s.tag+'> tag resolver accepts not "'+u+'" style');e.dump=r}return!0}return!1}function rt(e,t,n,r,i,a){e.tag=null,e.dump=n,ea(e,n,!1)||ea(e,n,!0);var o=Eu.call(e.dump);r&&(r=e.flowLevel<0||e.flowLevel>t);var s=o==="[object Object]"||o==="[object Array]",u,f;if(s&&(u=e.duplicates.indexOf(n),f=u!==-1),(e.tag!==null&&e.tag!=="?"||f||e.indent!==2&&t>0)&&(i=!1),f&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(s&&f&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),o==="[object Object]")r&&Object.keys(e.dump).length!==0?(Hw(e,t,e.dump,i),f&&(e.dump="&ref_"+u+e.dump)):(jw(e,t,e.dump),f&&(e.dump="&ref_"+u+" "+e.dump));else if(o==="[object Array]"){var c=e.noArrayIndent&&t>0?t-1:t;r&&e.dump.length!==0?(Mw(e,c,e.dump,i),f&&(e.dump="&ref_"+u+e.dump)):(Dw(e,c,e.dump),f&&(e.dump="&ref_"+u+" "+e.dump))}else if(o==="[object String]")e.tag!=="?"&&Pw(e,e.dump,t,a);else{if(e.skipInvalid)return!1;throw new Yt("unacceptable kind of an object to dump "+o)}e.tag!==null&&e.tag!=="?"&&(e.dump="!<"+e.tag+"> "+e.dump)}return!0}function Bw(e,t){var n=[],r=[],i,a;for(Yr(e,n,r),i=0,a=r.length;i<a;i+=1)t.duplicates.push(n[r[i]]);t.usedDuplicates=new Array(a)}function Yr(e,t,n){var r,i,a;if(e!==null&&typeof e=="object")if(i=t.indexOf(e),i!==-1)n.indexOf(i)===-1&&n.push(i);else if(t.push(e),Array.isArray(e))for(i=0,a=e.length;i<a;i+=1)Yr(e[i],t,n);else for(r=Object.keys(e),i=0,a=r.length;i<a;i+=1)Yr(e[r[i]],t,n)}function Pu(e,t){t=t||{};var n=new Fw(t);return n.noRefs||Bw(e,n),rt(n,0,e,!0,!0)?n.dump+`
75
+ `:""}function Uw(e,t){return Pu(e,zt.extend({schema:lw},t))}Ni.dump=Pu;Ni.safeDump=Uw;var nr=qt,Lu=Ni;function rr(e){return function(){throw new Error("Function "+e+" is deprecated and cannot be used.")}}ie.Type=le;ie.Schema=Rt;ie.FAILSAFE_SCHEMA=Fi;ie.JSON_SCHEMA=nu;ie.CORE_SCHEMA=ru;ie.DEFAULT_SAFE_SCHEMA=Wt;ie.DEFAULT_FULL_SCHEMA=er;ie.load=nr.load;ie.loadAll=nr.loadAll;ie.safeLoad=nr.safeLoad;ie.safeLoadAll=nr.safeLoadAll;ie.dump=Lu.dump;ie.safeDump=Lu.safeDump;ie.YAMLException=Kt;ie.MINIMAL_SCHEMA=Fi;ie.SAFE_SCHEMA=Wt;ie.DEFAULT_SCHEMA=er;ie.scan=rr("scan");ie.parse=rr("parse");ie.compose=rr("compose");ie.addConstructor=rr("addConstructor");var Gw=ie,qw=Gw;const ku=Js,Kw=zy,Ww=Yy,zw=qw,Du=e=>zw.safeLoad(Ww(e));Xs.exports=e=>Kw(ku.readFile)(e,"utf8").then(t=>Du(t));Xs.exports.sync=e=>Du(ku.readFileSync(e,"utf8"));const Yw=e=>/^[a-z][a-zA-Z0-9]+$/.test(e),Qw=e=>/^([a-z][a-z0-9]*)(-[a-z0-9]+)*$/.test(e),{toString:Vw}=Object.prototype,Xw=Error.prototype.toString,Zw=RegExp.prototype.toString,Jw=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",eE=/^Symbol\((.*)\)(.*)$/;function tE(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":`${e}`}function ta(e,t=!1){if(e==null||e===!0||e===!1)return`${e}`;if(typeof e=="number")return tE(e);if(typeof e=="string")return t?`"${e}"`:e;if(typeof e=="function")return`[Function ${e.name||"anonymous"}]`;if(typeof e=="symbol")return Jw.call(e).replace(eE,"Symbol($1)");const n=Vw.call(e).slice(8,-1);if(n==="Date"){const r=e;return Number.isNaN(r.getTime())?`${r}`:r.toISOString()}return n==="Error"||e instanceof Error?`[${Xw.call(e)}]`:n==="RegExp"?Zw.call(e):null}function na(e,t){const n=ta(e,t);return n!==null?n:JSON.stringify(e,function(i,a){const o=ta(this[i],t);return o!==null?o:a},2)}const nE=e=>!ge.default.isNil(e),rE=e=>!ge.default.isNull(e);ot(Hn,"notNil",function(t="${path} must be defined."){return this.test("defined",t,nE)});ot(Hn,"notNull",function(t="${path} cannot be null."){return this.test("defined",t,rE)});ot(Hn,"isFunction",function(t="${path} is not a function"){return this.test("is a function",t,n=>ge.default.isUndefined(n)||ge.default.isFunction(n))});ot(Jr,"isCamelCase",function(t="${path} is not in camel case (anExampleOfCamelCase)"){return this.test("is in camelCase",t,n=>n?Yw(n):!0)});ot(Jr,"isKebabCase",function(t="${path} is not in kebab case (an-example-of-kebab-case)"){return this.test("is in kebab-case",t,n=>n?Qw(n):!0)});ot(ja,"onlyContainsFunctions",function(t="${path} contains values that are not functions"){return this.test("only contains functions",t,n=>ge.default.isUndefined(n)||n&&Object.values(n).every(ge.default.isFunction))});ot(Ha,"uniqueProperty",function(t,n){return this.test("unique",n,function(i){const a=[];if(i?.forEach((o,s)=>{i.filter(f=>C.get(t,f)===C.get(t,o)).length>1&&a.push(this.createError({path:`${this.path}[${s}].${t}`,message:n}))}),a.length)throw new me(a);return!0})});sp({mixed:{notType(e){const{path:t,type:n,value:r,originalValue:i}=e,a=i!=null&&i!==r;return`${t} must be a \`${n}\` type, but the final value was: \`${na(r,!0)}\`${a?` (cast from the value \`${na(i,!0)}\`).`:"."}`}}});z.union([z.string(),z.array(z.string())]).describe("Select specific fields to return in the response");z.union([z.literal("*"),z.string(),z.array(z.string()),z.record(z.string(),z.any())]).describe("Specify which relations to populate in the response");z.union([z.string(),z.array(z.string()),z.record(z.string(),z.enum(["asc","desc"])),z.array(z.record(z.string(),z.enum(["asc","desc"])))]).describe("Sort the results by specified fields");z.intersection(z.object({withCount:z.boolean().optional().describe("Include total count in response")}),z.union([z.object({page:z.number().int().positive().describe("Page number (1-based)"),pageSize:z.number().int().positive().describe("Number of entries per page")}).describe("Page-based pagination"),z.object({start:z.number().int().min(0).describe("Number of entries to skip"),limit:z.number().int().positive().describe("Maximum number of entries to return")}).describe("Offset-based pagination")])).describe("Pagination parameters");z.record(z.string(),z.any()).describe("Apply filters to the query");z.string().describe("Specify the locale for localized content");z.enum(["draft","published"]).describe("Filter by publication status");z.string().describe("Search query string");const rn=(e,t,n)=>{e&&e.emit&&e.emit(t,n)},iE=e=>[...new Set(e.filter(t=>!!t).flatMap(({remove:t,create:n,update:r})=>[n?"CREATE":"",r?"UPDATE":"",t?"REMOVE":""].filter(i=>!!i)))].join("_"),Mu=e=>async t=>({title:t.title,path:t.path,audience:t.audience,type:t.type,uiRouterKey:t.uiRouterKey,order:t.order,collapsed:t.collapsed,menuAttached:t.menuAttached,autoSync:t.autoSync,removed:!1,updated:!0,externalPath:t.externalPath,items:t.items?await Promise.all(t.items.map(Mu(e))):[],master:e.master,parent:void 0,related:t.related,additionalFields:t.additionalFields}),oE=(e,t)=>t.slice(1).reduce((n,r)=>n.concat([e,r]),t.slice(0,1)),aE=async({strapi:e})=>{const n=!!e.plugin("rest-cache"),r=e.store({type:"plugin",name:"navigation"}),i=Fe.configSchema.parse(await r.get({key:"config"}));return n?{hasCachePlugin:n,enabled:!!i.isCacheEnabled}:{hasCachePlugin:n,enabled:!1}},sE=e=>({async config({viaSettingsPage:t=!1}){const n=re(e,"common"),r=await aE(e),a=await(await n.getPluginStore()).get({key:"config"}).then(Fe.configSchema.parse),{additionalFields:o,cascadeMenuAttached:s,contentTypesPopulate:u,contentTypesNameFields:f,defaultContentType:c,pathDefaultFields:l,allowedLevels:p,preferCustomContentTypes:d}=a,h=!!e.strapi.plugin("graphql");let m={allowedContentTypes:ma,restrictedContentTypes:ga,availableAudience:[]};const g=await this.configContentTypes({}),w={contentTypes:await this.configContentTypes({viaSettingsPage:t}),contentTypesNameFields:{default:Uc,...B.isObject(f)?f:{}},contentTypesPopulate:B.isObject(u)?u:{},defaultContentType:c,pathDefaultFields:B.isObject(l)?l:{},allowedLevels:p,additionalFields:t?o:o.filter(S=>typeof S=="string"||!!S.enabled),gql:{navigationItemRelated:g.map(({gqlTypeName:S})=>S)},isGQLPluginEnabled:t?h:void 0,cascadeMenuAttached:s,preferCustomContentTypes:d};if(o.includes("audience")){const S=await Qc(e).find({},Number.MAX_SAFE_INTEGER);m={...m,availableAudience:S}}return{...w,...m,isCacheEnabled:r.enabled,isCachePluginEnabled:r.hasCachePlugin}},async configContentTypes({viaSettingsPage:t=!1}){const i=await(await re(e,"common").getPluginStore()).get({key:"config"}).then(Fe.configSchema.parse);return(await Promise.all(i.contentTypes.filter(o=>!!e.strapi.contentTypes[o]&&zc(o)).map(async o=>{const s=Tr.parse(strapi.contentTypes[o]),{kind:u,options:f,uid:c}=s,l=f?.draftAndPublish,p=u===Mi.SINGLE,d=p&&l,h=m=>({key:o,available:m});if(p){const m=kt(e,c);if(d){const w=d?await m.count({},"published"):!0;return h(w!==0)}return await m.count({})!==0?h(!0):t?h(!1):void 0}return h(!0)}))).reduce((o,s)=>{if(!s?.key)return o;const{key:u,available:f}=s,c=Tr.parse(e.strapi.contentTypes[u]),l=(c.associations||[]).find(({model:W})=>W==="navigationitem"),{uid:p,options:d,info:h,collectionName:m,modelName:g,apiName:w,plugin:S,kind:x,pluginOptions:R={}}=c,T=f&&!d?.hidden;if(!T)return o;const{visible:O=!0}=R["content-manager"]||{},{description:M="",displayName:A=""}=h,_=B.find(B.get(e.strapi.api,`[${g}].config.routes`,[]),W=>W.handler.includes(".find")),N=_&&_.path.split("/")[1],v=N&&N!==w?N:w||g,j=x===Mi.SINGLE,H=j?v:pc.default(v),K=Yc(g),E=typeof p=="string"?B.last(p.split(".")).split("-"):[],b=E.length>1?E.reduce((W,Q)=>`${W}${B.upperFirst(Q)}`,""):B.upperFirst(g),U=e.strapi.plugin("graphql")?.service("utils")?.naming?.getTypeName(c)||"";return o.push({uid:p,name:K,draftAndPublish:d?.draftAndPublish,isSingle:j,description:M,collectionName:m,contentTypeName:b,label:A,relatedField:l?l.alias:void 0,endpoint:H,plugin:S,available:T,visible:O,templateName:d?.templateName,gqlTypeName:U}),o},[])},async get({ids:t,locale:n}){let r={};t&&t.length&&(r.id={$in:t});const i=await _e(e).find({filters:r,locale:n||"*",limit:Number.MAX_SAFE_INTEGER,populate:["items","items.parent","items.audience","items.related"]}),a=({allItems:o,item:s,parent:u})=>{const f=o.filter(c=>c.parent?.documentId===s.documentId);return{...s,parent:u,items:f.map(c=>a({parent:s,item:c,allItems:o})).sort((c,l)=>c.order-l.order)}};return i.map(o=>({...o,items:o.items?.filter(s=>!s.parent).map(s=>a({allItems:o.items??[],item:s})).sort((s,u)=>s.order-u.order)}))},async getById({documentId:t,locale:n,populate:r=[]}){const i=re(e,"common"),{defaultLocale:a}=await i.readLocale(),o={documentId:t},s=await _e(e).findOne({filters:o,locale:n||a}),u=await Le(e).find({filters:{master:s.id},locale:n||a,limit:Number.MAX_SAFE_INTEGER,order:[{order:"asc"}],populate:["parent","audience",...r]});return{...s,items:i.buildNestedStructure({navigationItems:u}).filter(({parent:f})=>!f)}},async post({auditLog:t,payload:n}){const{masterModel:r}=we(e),i=re(e,"common"),{defaultLocale:a,restLocale:o}=await i.readLocale(),s=_e(e),u=[],{name:f,visible:c}=n,l=await i.getSlug({query:f}),p=await s.save({name:f,visible:c,locale:a,slug:l});u.push(await this.getById({documentId:p.documentId}));for(const d of o){const h=await s.save({name:f,visible:c,locale:d,slug:l,documentId:p.documentId});u.push(await this.getById({documentId:h.documentId}))}return u.map(d=>{rn(t,"onChangeNavigation",{actionType:"CREATE",oldEntity:d,newEntity:d})}),await i.emitEvent({entity:p,event:"entry.create",uid:r.uid}),{...p,items:[]}},async put({auditLog:t,payload:n}){const{masterModel:r}=we(e),i=re(e,"common"),{defaultLocale:a,restLocale:o}=await i.readLocale(),s=_e(e),{name:u,visible:f,items:c}=n,l=await s.findOne({filters:{documentId:n.documentId},locale:n.locale,populate:"*"}),p=await this.getById({documentId:n.documentId,locale:n.locale});if(l.name!==u||l.visible!==f){const h=u?await i.getSlug({query:u}):l.slug,m=await Promise.all([a,...o].map(g=>s.findOne({filters:{documentId:l.documentId},locale:g})));for(const g of m)await s.save({documentId:g.documentId,id:g.id,slug:h,locale:g.locale,name:u,visible:f})}return await i.analyzeBranch({navigationItems:c??[],masterEntity:l,prevAction:{}}).then(iE).then(async h=>{const m=await this.getById({documentId:l.documentId});rn(t,"onChangeNavigation",{actionType:h,oldEntity:p,newEntity:m})}),await i.emitEvent({entity:await s.findOne({filters:{documentId:n.documentId},populate:"*"}),event:"entry.update",uid:r.uid}),await this.getById({documentId:n.documentId,locale:n.locale,populate:["related"]})},async delete({auditLog:t,documentId:n}){const r=_e(e),i=Le(e),a=await this.getById({documentId:n}),o=async f=>{f.length<1||await i.removeForIds(await i.findForMasterIds(f).then(c=>c.reduce((l,{documentId:p})=>(p&&l.push(p),l),[])))},s=await r.findOne({filters:{documentId:n},populate:"*"}),u=await r.find({filters:{documentId:s.documentId},locale:"*",populate:"*"});await o(u.map(({id:f})=>f)),await r.remove({documentId:s.documentId,locale:"*"}),rn(t,"onNavigationDeletion",{entity:a,actionType:"DELETE"})},async restart(){e.strapi.reload.isWatching=!1,setImmediate(()=>e.strapi.reload())},async restoreConfig(){console.log("restore");const t=re(e,"common");await(await t.getPluginStore()).delete({key:"config"}),await t.setDefaultConfig()},async refreshNavigationLocale(t){if(!t)return;const n=re(e,"common"),{defaultLocale:r}=await n.readLocale(),i=_e(e),a=await i.find({limit:Number.MAX_SAFE_INTEGER,locale:r});await Promise.all(a.map(({name:o,visible:s,slug:u,documentId:f})=>i.save({name:o,visible:s,locale:t,slug:u,documentId:f})))},async updateConfig({config:t}){const n=re(e,"common"),r=await n.getPluginStore(),i=await r.get({key:"config"}).then(Fe.configSchema.parse);ya(t.additionalFields),await r.set({key:"config",value:t});const a=B.differenceBy(i.additionalFields,t.additionalFields,"name").reduce((o,s)=>(typeof s=="string"||o.push(s),o),[]);B.isEmpty(a)||await n.pruneCustomFields({removedFields:a})},async fillFromOtherLocale({auditLog:t,source:n,target:r,documentId:i}){const a=await this.getById({documentId:i,locale:r});return await this.i18nNavigationContentsCopy({source:await this.getById({documentId:i,locale:n,populate:["related"]}),target:a}).then(()=>this.getById({documentId:i,locale:r,populate:["related"]})).then(o=>(rn(t,"onChangeNavigation",{actionType:"UPDATE",oldEntity:a,newEntity:o}),o))},async i18nNavigationContentsCopy({source:t,target:n}){const r=re(e,"common"),i=t.items??[],a=_e(e);if(n.items?.length)throw new ir("Current navigation is non-empty");if(!n.locale)throw new ir("Current navigation does not have specified locale");if(!i.length)throw new ir("Source navigation is empty");const o=Mu({master:n,locale:n.locale,strapi});await r.createBranch({action:{create:!0},masterEntity:await a.findOne({filters:{documentId:n.documentId},locale:n.locale,populate:"*"}),navigationItems:await Promise.all(i.map(o)),parentItem:void 0})},async readNavigationItemFromLocale({path:t,source:n,target:r}){const i=await this.getById({documentId:n}),a=await this.getById({documentId:r});if(!i)throw new It("Unable to find source navigation for specified query");if(!a)throw new It("Unable to find target navigation for specified query");const o=["path","related","type","uiRouterKey","title","externalPath"],s=t.split(".").map(f=>parseInt(f,10));(!s.some(Number.isNaN)||!s.length)&&new Xc("Path is invalid");let u=B.get(i.items,oE("items",s.map(B.toString)));if(!u)throw new It("Unable to find navigation item");return vc.parse(B.pick(u,o))},async getContentTypeItems({query:t,uid:n}){const a=await(await re(e,"common").getPluginStore()).get({key:"config"}).then(Fe.configSchema.parse),o={publishedAt:{$notNull:!0}},s=B.get(e.strapi.contentTypes,n),{draftAndPublish:u}=s.options,f=kt(e,n);try{return await f.findMany(o,a.contentTypesPopulate[n]||[],u?"published":void 0,t.locale)}catch(c){return console.error(c),[]}},async purgeNavigationCache(t,n){const r=_e(e),i=await r.findOne({filters:{documentId:t}});if(!i)throw new It("Navigation is not defined");const a=f=>new RegExp(`/api/navigation/render/${f}`);let o=[a(i.documentId)];n&&(o=(await r.find({filters:{documentId:i.documentId}})).map(({documentId:c})=>a(c)));const u=strapi.plugin("rest-cache").service("cacheStore");return o.push(a(t)),await u.clearByRegexp(o),{success:!0}},async purgeNavigationsCache(){const n=strapi.plugin("rest-cache").service("cacheStore"),r=new RegExp("/api/navigation/render(.*)");return await n.clearByRegexp([r]),{success:!0}}}),ra=(e,t={},n=[])=>{const{title:r,related:i}=e,a=B.isArray(i)?B.last(i):i;if(r)return B.isString(r)&&!B.isEmpty(r)?r:void 0;if(a){const o=uE(a,t,n);return B.isString(o)&&!B.isEmpty(o)?o:void 0}},uE=(e,t={},n=[])=>{const{__contentType:r}=e,i=B.find(n,o=>o.contentTypeName===r),{default:a=[]}=t;return B.get(t,`${i?i.collectionName:""}`,a).map(o=>e[o]).filter(o=>o)[0]||""},ia=(e,t)=>{const n=ju(e),r=t?n.filter(({path:a})=>a.includes(t)):n,i=r.find(({path:a})=>a===t);return{root:i,items:B.isNil(i)?[]:e.filter(({documentId:a})=>r.find(o=>o.documentId===a))}},ju=(e,t,n=null)=>e.filter(r=>!r.parent==null&&!t?!0:r.parent?.documentId===t).reduce((r,i)=>{const a=`${n||""}/${i.path}`.replace("//","/");return[{documentId:i.documentId,parent:n&&i.parent?.documentId?{id:i.parent?.id,documentId:i.parent?.documentId,path:n}:void 0,path:a},...ju(e,i.documentId,a),...r]},[]),cE=(e,t)=>{const n=B.zipWith(e,t,(r,i)=>B.isNil(r)?-1:B.isNil(i)?1:r-i);return B.find(n,r=>r!==0)||0},lE=e=>({async readAll({locale:t,orderBy:n="createdAt",orderDirection:r="DESC"}){return _e(e).find({locale:t,orderBy:{[n]:r}})},renderRFRNavigationItem({item:t}){const{uiRouterKey:n,title:r,path:i,type:a,audience:o,additionalFields:s}=t,u={label:r,type:a,audience:o?.map(({key:f})=>f),additionalFields:s};if(a==="WRAPPER")return{...u};if(a==="EXTERNAL")return va(i,new Et("External navigation item's path is undefined",t)),{...u,url:i};if(a==="INTERNAL")return{...u,page:n};if(a==="WRAPPER")return{...u};throw new Et("Unknown item type",t)},renderRFRPage({item:t,parent:n,enabledCustomFieldsNames:r}){const{documentId:i,uiRouterKey:a,title:o,path:s,related:u,type:f,audience:c,menuAttached:l,additionalFields:p}=t,d=r.reduce((h,m)=>({...h,[m]:p?.[m]}),{});return{id:a,documentId:i,title:o,related:f==="INTERNAL"&&u?.documentId&&u?.__type?{contentType:u.__type,documentId:u.documentId}:void 0,path:s,parent:n,audience:c,menuAttached:l,additionalFields:d}},renderRFR({items:t,parent:n,parentNavItem:r,contentTypes:i=[],enabledCustomFieldsNames:a}){const o=[];let s={},u={};return t.forEach(f=>{const{items:c,...l}=f,p=this.renderRFRNavigationItem({item:l}),d=this.renderRFRPage({item:l,parent:n,enabledCustomFieldsNames:a});if(f.type!=="EXTERNAL"&&(u={...u,[d.documentId]:{...d}}),f.menuAttached&&o.push(p),!n)s={...s,root:o};else{const h=o.filter(m=>m.type);B.isEmpty(h)||(s={...s,[n]:h.concat(r||[])})}if(!B.isEmpty(c)){const{nav:h}=this.renderRFR({items:c??[],parent:d.documentId,parentNavItem:p,contentTypes:i,enabledCustomFieldsNames:a}),{pages:m}=this.renderRFR({items:c||[],parent:d.documentId,parentNavItem:p,contentTypes:i,enabledCustomFieldsNames:a});u={...u,...m},s={...s,...h}}}),{pages:u,nav:s}},renderTree({items:t=[],documentId:n,path:r="",itemParser:i=a=>Promise.resolve(a)}){return Promise.all(t.reduce((a,o)=>(o.parent?.documentId===n&&a.push(i(B.cloneDeep(o),r)),a),[])).then(a=>a.sort((o,s)=>o.order!==void 0&&s.order!==void 0?o.order-s.order:0))},getCustomFields(t){return t.reduce((n,r)=>(r!=="audience"&&n.push(r),n),[])},async renderType({criteria:t={},filter:n,itemCriteria:r={},locale:i,populate:a,rootPath:o,type:s="FLAT",wrapRelated:u,status:f="published"}){const c=re(e,"admin"),l=re(e,"common"),p={...t,visible:!0},d=_e(e),h=Le(e);let m;if(i?m=await d.find({filters:{...p},locale:i,limit:1}):m=await d.find({filters:p,limit:1}),B.isArray(m)&&(m=B.first(m)),m&&m.documentId){const g=await h.find({filters:{master:B.pick(m,["slug","id"]),...r},locale:i,limit:Number.MAX_SAFE_INTEGER,order:[{order:"asc"}],populate:["audience","parent","related"]}),w=await l.mapToNavigationItemDTO({locale:i,master:m,navigationItems:g,populate:a,status:f}),{contentTypes:S,contentTypesNameFields:x,additionalFields:R}=await c.config({viaSettingsPage:!1}),T=this.getCustomFields(R).reduce((_,N)=>N.enabled?[..._,N.name]:_,[]),O=_=>u&&_?{documentId:_.documentId,..._}:_,M=R.filter(_=>typeof _!="string"),A=_=>(N,v)=>{const j=M.find(({name:K})=>K===v);let H=_.additionalFields?.[v];if(H)switch(j?.type){case"media":H=JSON.parse(H);break;case"boolean":H=H==="true";break}return{...N,[v]:H}};switch(s){case"TREE":case"RFR":const _=async($,D="")=>{const U=$.type==="EXTERNAL",W=U?void 0:`${D==="/"?"":D}/${B.first($.path)==="/"?$.path.substring(1):$.path}`,Q=typeof W=="string"?await l.getSlug({query:(B.first(W)==="/"?W.substring(1):W).replace(/\//g,"-")}):void 0,ee=B.isArray($.related)?B.last($.related):$.related,Ce=O(ee),F=T.reduce(A($),{});return{id:$.id,documentId:$.documentId,title:ra($,x,S)??"Title missing",menuAttached:$.menuAttached,order:$.order,path:(U?$.externalPath:W)??"Path is missing",type:$.type,uiRouterKey:$.uiRouterKey,slug:!Q&&$.uiRouterKey?await l.getSlug({query:$.uiRouterKey}):Q,related:U||!ee?void 0:{...Ce},audience:B.isEmpty($.audience)?void 0:$.audience,items:await this.renderTree({itemParser:_,path:W,documentId:$.documentId,items:w}),collapsed:$.collapsed,additionalFields:F||{}}},{items:N,root:v}=ia(w,o),j=await this.renderTree({itemParser:_,items:B.isNil(o)?w:N,path:v?.parent?.path,documentId:v?.parent?.documentId}),H=n?j.filter($=>$.uiRouterKey===n):j;return s==="RFR"?this.renderRFR({items:H,contentTypes:S.map($=>$.contentTypeName),enabledCustomFieldsNames:T}):H;default:const K=B.isNil(o)?w:ia(w,o).items,E=new Map,b=($,D=E)=>{const U=D.get($);if(!B.isNil(U))return U;const W=K.find(F=>F.documentId===$);if(B.isNil(W))return[];const{order:Q,parent:ee}=W,Ce=ee?b(ee.documentId,D).concat(Q):[Q];return D.set($,Ce),Ce};return K.map($=>{const D=T.reduce(A($),{});return{...$,audience:$.audience?.map(U=>U.key),title:ra($,x,S)||"",related:O($.related),items:null,additionalFields:D}}).sort(($,D)=>cE(b($.documentId),b(D.documentId)))}}throw new It},renderChildren({childUIKey:t,idOrSlug:n,locale:r,menuOnly:i,type:a="FLAT",wrapRelated:o,status:s}){const u={$or:[{documentId:n},{slug:n}]},f=a==="FLAT"?void 0:t,c={...i&&{menuAttached:!0},...a==="FLAT"?{uiRouterKey:t}:{}};return this.renderType({type:a,criteria:u,itemCriteria:c,filter:f,wrapRelated:o,locale:r,status:s})},render({idOrSlug:t,locale:n,menuOnly:r,populate:i,rootPath:a,type:o="FLAT",wrapRelated:s,status:u}){const f={$or:[{documentId:t},{slug:t}]},c=r?{menuAttached:!0}:{};return this.renderType({type:o,criteria:f,itemCriteria:c,rootPath:a,wrapRelated:s,locale:n,populate:i,status:u})}}),fE=({checkData:e,parentItem:t})=>new Promise((n,r)=>{if(t&&t.items){for(let i of e)for(let a of t.items)if(a.path===i.path&&a.id!==i.id&&i.type==="INTERNAL"&&!a.removed)return r(new Et(`Duplicate path:${i.path} in parent: ${t.title||"root"} for ${i.title} and ${a.title} items`,{parentTitle:t.title,parentId:t.id,path:i.path,errorTitles:[i.title,a.title]}))}return n()}),pE=async(e,t,n,r,i)=>{if(!t)return{title:void 0,path:void 0};const a=await kt(e,t.__type).findById(t.documentId,void 0,"published",{locale:n}),s=(B.isEmpty(r[t.__type])?r.default:r[t.__type]).reduce((c,l)=>c||a?.[l]?.toString(),""),f=(i[t.__type]||[]).reduce((c,l)=>c||a?.[l]?.toString(),void 0)||a?.id.toString();return{title:s,path:f}},on={navigation:{},"navigation-item":{}},dE=e=>({async getPluginStore(){return await strapi.store({type:"plugin",name:"navigation"})},async mapToNavigationItemDTO({locale:t,master:n,navigationItems:r,parent:i,populate:a,status:o="published"}){const s=[],f=await(await this.getPluginStore()).get({key:"config"}).then(Fe.configSchema.parse),c=await Promise.all(r.map(async l=>{if(!l.related?.__type||!l.related.documentId)return l;const p=a??f.contentTypesPopulate[l.related.__type],h=await kt({strapi},l.related.__type).findById(l.related.documentId,p,o,{locale:t});return{...l,related:{...h,__type:l.related.__type,documentId:l.related.documentId}}}));for(const l of c){const{items:p=[],...d}=l;s.push({...d,parent:i??d.parent,items:await this.mapToNavigationItemDTO({navigationItems:p,populate:a,master:n,parent:d,locale:t,status:o})})}return s},setDefaultConfig(){return Ea({strapi,forceDefault:!0})},getBranchName({item:t}){const n=!!t.documentId,r=t.removed;if(n&&!r)return"toUpdate";if(n&&r)return"toRemove";if(!n&&!r)return"toCreate"},async analyzeBranch({masterEntity:t,navigationItems:n=[],parentItem:r,prevAction:i={}}){const{toCreate:a,toRemove:o,toUpdate:s}=n.reduce((c,l)=>{const p=this.getBranchName({item:l});return p?{...c,[p]:[...c[p],l]}:c},{toRemove:[],toCreate:[],toUpdate:[]}),u={create:i.create||a.length>0,update:i.update||s.length>0,remove:i.remove||o.length>0},f=[...a,...s];return await fE({checkData:f,parentItem:r}),Promise.all([this.createBranch({action:u,masterEntity:t,navigationItems:a,parentItem:r}),this.removeBranch({navigationItems:o,action:u}),this.updateBranch({action:u,masterEntity:t,navigationItems:s,parentItem:r})]).then(([c,l,p])=>[...c,...l,...p])},async removeBranch({navigationItems:t=[],action:n={}}){const r=[];for(const i of t)i.documentId&&(n.remove=!0,await Le(e).remove(i),r.push(n),i.items?.length&&(await this.removeBranch({navigationItems:i.items})).forEach(o=>{r.push(o)}));return r},async createBranch({action:t,masterEntity:n,navigationItems:r,parentItem:i}){let a=[];const o=re(e,"admin"),{contentTypesNameFields:s,pathDefaultFields:u}=await o.config({viaSettingsPage:!1});for(const f of r){t.create=!0;const{parent:c,master:l,items:p,documentId:d,id:h,related:m,autoSync:g,...w}=f,{title:S=w.title,path:x=w.path}=g?await pE(e,m,n?.locale||"en",s,u):{},R=d&&h?{...w,documentId:d,id:h,master:n?n.id:void 0,parent:i?i.id:void 0,autoSync:g,title:S,path:x,related:m}:{...w,documentId:void 0,id:void 0,master:n?n.id:void 0,parent:i?i.id:void 0,autoSync:g,title:S,path:x,related:m},T=await Le(e).save({item:R,locale:n?.locale});if(f.items?.length){const O=await this.createBranch({action:{},masterEntity:n,navigationItems:f.items,parentItem:T});a=a.concat(O).concat([t])}else a.push(t)}return a},async updateBranch({masterEntity:t,navigationItems:n,action:r,parentItem:i}){const a=[];for(const o of n){r.update=!0;const{documentId:s,updated:u,parent:f,master:c,items:l,...p}=o;let d;u?d=await Le(e).save({item:{documentId:s,...p},locale:t?.locale}):d=o,l?.length?(await this.analyzeBranch({navigationItems:l,prevAction:{},masterEntity:t,parentItem:d})).forEach(m=>{a.push(m)}):a.push(r)}return a},async emitEvent({entity:t,event:n,uid:r}){const i=strapi.getModel(r),a=await ld({...i,schema:i.__schema__,getModel:()=>i},t);strapi.webhookRunner?strapi.webhookRunner.eventHub.emit(n,{model:i.modelName,entry:a}):console.warn("Webhook runner not present. Contact with Strapi Navigation Plugin team.")},async pruneCustomFields({removedFields:t}){const n=t.map(({name:o})=>`additionalFields.${o}`),r=t.map(({name:o})=>o),a=(await Le(e).find({filters:{additionalFields:{$contains:[r]}}})).map(o=>B.omit(o,n));for(const o of a)await Le(e).save({item:{documentId:o.documentId,additionalFields:o.additionalFields}})},async getSlug({query:t}){let n=fc.default(t);if(n){const r=await Le(e).count({$or:[{uiRouterKey:{$startsWith:n}},{uiRouterKey:n}]});r&&(n=`${n}-${r}`)}return n.toLowerCase()},registerLifeCycleHook({callback:t,contentTypeName:n,hookName:r}){on[n][r]||(on[n][r]=[]),on[n][r]?.push(t)},async runLifeCycleHook({contentTypeName:t,event:n,hookName:r}){const i=on[t][r]??[];for(const a of i)await a(n)},buildNestedStructure({navigationItems:t,id:n}){return t?.reduce((r,i)=>(n&&i.parent?.id!==n||r.push({...B.omit(i,["related","items"]),related:i.related,items:this.buildNestedStructure({navigationItems:t,id:i.id})}),r),[])??[]},async readLocale(){const t=strapi.plugin("i18n").service("locales");let n=await t.getDefaultLocale(),r=(await t.find({})).map(({code:i})=>i).filter(i=>i!==n);return n||(n=r[0],r=r.slice(1)),{defaultLocale:n,restLocale:r}},updateConfigSchema:Pc,updateCreateNavigationSchema:Dc,updateNavigationItemAdditionalField:Lc,updateNavigationItemCustomField:kc,updateUpdateNavigationSchema:Mc}),oa="navigations_items",aa="related",hE=e=>({async migrateRelatedIdToDocumentId(){if(!await strapi.db.connection.schema.hasColumn(oa,aa))return;console.log("Navigation plugin :: Migrations :: Related id to document id - START");const n=Le(e),r=await n.findV4({filters:{},limit:Number.MAX_SAFE_INTEGER});await Promise.all(r.map(async i=>{const a=i.related;if(a&&typeof a=="string"){const[o,s]=a.split(Bc);if(!B.isNaN(parseInt(s,10))){const u=await e.strapi.query(o).findOne({where:{id:s}});u&&await n.save({item:{documentId:i.documentId,related:{__type:o,documentId:u.documentId}}})}}})),await strapi.db.connection.schema.alterTable(oa,i=>{i.dropColumn(aa)}),console.log("Navigation plugin :: Migrations :: Related id to document id - DONE")}}),mE={admin:sE,common:dE,client:lE,migrate:hE},gE={bootstrap:Cl,destroy:Rl,register:$l,config:Nr,controllers:zl,contentTypes:jl,middlewares:ba,policies:Yl,routes:Xl,services:mE};module.exports=gE;