diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9b7910f..7e0d73c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,14 @@ jobs: env: NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: pnpm run lint + - run: pnpm run typecheck # Check TS types. Not done by linting or building - run: pnpm run build + - name: Verify committed bundles match source + run: | + git diff --stat --exit-code servers/ bin/ || { + echo "::error::Committed bundles are out of sync with source. Run 'pnpm run build' and commit the result." + exit 1 + } - name: Smoke test MCP server run: > pnpm dlx @modelcontextprotocol/inspector --cli node servers/genesys-cloud-architect-mcp.js --method tools/list diff --git a/.husky/pre-commit b/.husky/pre-commit index b95380d..2aef755 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,5 @@ pnpm biome check --write --staged --no-errors-on-unmatched +pnpm typecheck pnpm build git add servers/genesys-cloud-architect-mcp.js git add bin/deploy-runner.js diff --git a/package.json b/package.json index ae9f73b..933d21e 100644 --- a/package.json +++ b/package.json @@ -7,6 +7,7 @@ "build": "pnpm run build:mcp-server && pnpm run build:deploy-runner", "build:mcp-server": "esbuild src/mcp-server/index.ts --bundle --platform=node --target=node22 --format=cjs --minify --tree-shaking=true --define:process.env.npm_package_version=\\\"$npm_package_version\\\" --outfile=servers/genesys-cloud-architect-mcp.js", "build:deploy-runner": "esbuild src/deploy-runner/index.ts --bundle --platform=node --target=node22 --format=cjs --outfile=bin/deploy-runner.js", + "typecheck": "tsc --noEmit", "lint": "biome check", "lint:fix": "biome check --write", "format": "biome format --write", diff --git a/servers/genesys-cloud-architect-mcp.js b/servers/genesys-cloud-architect-mcp.js index e00defa..cce1a3f 100644 --- a/servers/genesys-cloud-architect-mcp.js +++ b/servers/genesys-cloud-architect-mcp.js @@ -2,22 +2,22 @@ `:""},this._extScope=e,this._scope=new Ei.Scope({parent:e}),this._nodes=[new Bm]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,n){let i=this._extScope.value(e,n);return(this._values[i.prefix]||(this._values[i.prefix]=new Set)).add(i),i}getScopeValue(e,n){return this._extScope.getValue(e,n)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,n,i,a){let r=this._scope.toName(n);return i!==void 0&&a&&(this._constants[r.str]=i),this._leafNode(new Gm(e,r,i)),r}const(e,n,i){return this._def(Ei.varKinds.const,e,n,i)}let(e,n,i){return this._def(Ei.varKinds.let,e,n,i)}var(e,n,i){return this._def(Ei.varKinds.var,e,n,i)}assign(e,n,i){return this._leafNode(new tc(e,n,i))}add(e,n){return this._leafNode(new $m(e,ue.operators.ADD,n))}code(e){return typeof e=="function"?e():e!==Ae.nil&&this._leafNode(new Wm(e)),this}object(...e){let n=["{"];for(let[i,a]of e)n.length>1&&n.push(","),n.push(i),(i!==a||this.opts.es5)&&(n.push(":"),(0,Ae.addCodeArg)(n,a));return n.push("}"),new Ae._Code(n)}if(e,n,i){if(this._blockNode(new ka(e)),n&&i)this.code(n).else().code(i).endIf();else if(n)this.code(n).endIf();else if(i)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new ka(e))}else(){return this._elseNode(new Rr)}endIf(){return this._endBlockNode(ka,Rr)}_for(e,n){return this._blockNode(e),n&&this.code(n).endFor(),this}for(e,n){return this._for(new Fm(e),n)}forRange(e,n,i,a,r=this.opts.es5?Ei.varKinds.var:Ei.varKinds.let){let s=this._scope.toName(e);return this._for(new Vm(r,s,n,i),()=>a(s))}forOf(e,n,i,a=Ei.varKinds.const){let r=this._scope.toName(e);if(this.opts.es5){let s=n instanceof Ae.Name?n:this.var("_arr",n);return this.forRange("_i",0,(0,Ae._)`${s}.length`,o=>{this.var(r,(0,Ae._)`${s}[${o}]`),i(r)})}return this._for(new ac("of",a,r,n),()=>i(r))}forIn(e,n,i,a=this.opts.es5?Ei.varKinds.var:Ei.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,Ae._)`Object.keys(${n})`,i);let r=this._scope.toName(e);return this._for(new ac("in",a,r,n),()=>i(r))}endFor(){return this._endBlockNode(qa)}label(e){return this._leafNode(new Nm(e))}break(e){return this._leafNode(new Um(e))}return(e){let n=new Ao;if(this._blockNode(n),this.code(e),n.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Ao)}try(e,n,i){if(!n&&!i)throw new Error('CodeGen: "try" without "catch" and "finally"');let a=new Jm;if(this._blockNode(a),this.code(e),n){let r=this.name("e");this._currNode=a.catch=new bo(r),n(r)}return i&&(this._currNode=a.finally=new yo,this.code(i)),this._endBlockNode(bo,yo)}throw(e){return this._leafNode(new Lm(e))}block(e,n){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(n),this}endBlock(e){let n=this._blockStarts.pop();if(n===void 0)throw new Error("CodeGen: not in self-balancing block");let i=this._nodes.length-n;if(i<0||e!==void 0&&i!==e)throw new Error(`CodeGen: wrong number of nodes: ${i} vs ${e} expected`);return this._nodes.length=n,this}func(e,n=Ae.nil,i,a){return this._blockNode(new Co(e,n,i)),a&&this.code(a).endFunc(),this}endFunc(){return this._endBlockNode(Co)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,n){let i=this._currNode;if(i instanceof e||n&&i instanceof n)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${n?`${e.kind}/${n.kind}`:e.kind}"`)}_elseNode(e){let n=this._currNode;if(!(n instanceof ka))throw new Error('CodeGen: "else" without "if"');return this._currNode=n.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let n=this._nodes;n[n.length-1]=e}};ue.CodeGen=Zm;function _a(t,e){for(let n in e)t[n]=(t[n]||0)+(e[n]||0);return t}function rc(t,e){return e instanceof Ae._CodeOrName?_a(t,e.names):t}function zr(t,e,n){if(t instanceof Ae.Name)return i(t);if(!a(t))return t;return new Ae._Code(t._items.reduce((r,s)=>(s instanceof Ae.Name&&(s=i(s)),s instanceof Ae._Code?r.push(...s._items):r.push(s),r),[]));function i(r){let s=n[r.str];return s===void 0||e[r.str]!==1?r:(delete e[r.str],s)}function a(r){return r instanceof Ae._Code&&r._items.some(s=>s instanceof Ae.Name&&e[s.str]===1&&n[s.str]!==void 0)}}function KN(t,e){for(let n in e)t[n]=(t[n]||0)-(e[n]||0)}function IO(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,Ae._)`!${Km(t)}`}ue.not=IO;var QN=RO(ue.operators.AND);function YN(...t){return t.reduce(QN)}ue.and=YN;var XN=RO(ue.operators.OR);function eU(...t){return t.reduce(XN)}ue.or=eU;function RO(t){return(e,n)=>e===Ae.nil?n:n===Ae.nil?e:(0,Ae._)`${Km(e)} ${t} ${Km(n)}`}function Km(t){return t instanceof Ae.Name?t:(0,Ae._)`(${t})`}});var ye=v(de=>{"use strict";Object.defineProperty(de,"__esModule",{value:!0});de.checkStrictMode=de.getErrorPath=de.Type=de.useFunc=de.setEvaluated=de.evaluatedPropsToName=de.mergeEvaluated=de.eachItem=de.unescapeJsonPointer=de.escapeJsonPointer=de.escapeFragment=de.unescapeFragment=de.schemaRefOrVal=de.schemaHasRulesButRef=de.schemaHasRules=de.checkUnknownRules=de.alwaysValidSchema=de.toHash=void 0;var Ie=le(),nU=wo();function iU(t){let e={};for(let n of t)e[n]=!0;return e}de.toHash=iU;function tU(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(GO(t,e),!$O(e,t.self.RULES.all))}de.alwaysValidSchema=tU;function GO(t,e=t.schema){let{opts:n,self:i}=t;if(!n.strictSchema||typeof e=="boolean")return;let a=i.RULES.keywords;for(let r in e)a[r]||LO(t,`unknown keyword: "${r}"`)}de.checkUnknownRules=GO;function $O(t,e){if(typeof t=="boolean")return!t;for(let n in t)if(e[n])return!0;return!1}de.schemaHasRules=$O;function aU(t,e){if(typeof t=="boolean")return!t;for(let n in t)if(n!=="$ref"&&e.all[n])return!0;return!1}de.schemaHasRulesButRef=aU;function rU({topSchemaRef:t,schemaPath:e},n,i,a){if(!a){if(typeof n=="number"||typeof n=="boolean")return n;if(typeof n=="string")return(0,Ie._)`${n}`}return(0,Ie._)`${t}${e}${(0,Ie.getProperty)(i)}`}de.schemaRefOrVal=rU;function sU(t){return NO(decodeURIComponent(t))}de.unescapeFragment=sU;function oU(t){return encodeURIComponent(Ym(t))}de.escapeFragment=oU;function Ym(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}de.escapeJsonPointer=Ym;function NO(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}de.unescapeJsonPointer=NO;function lU(t,e){if(Array.isArray(t))for(let n of t)e(n);else e(t)}de.eachItem=lU;function zO({mergeNames:t,mergeToName:e,mergeValues:n,resultToName:i}){return(a,r,s,o)=>{let l=s===void 0?r:s instanceof Ie.Name?(r instanceof Ie.Name?t(a,r,s):e(a,r,s),s):r instanceof Ie.Name?(e(a,s,r),r):n(r,s);return o===Ie.Name&&!(l instanceof Ie.Name)?i(a,l):l}}de.mergeEvaluated={props:zO({mergeNames:(t,e,n)=>t.if((0,Ie._)`${n} !== true && ${e} !== undefined`,()=>{t.if((0,Ie._)`${e} === true`,()=>t.assign(n,!0),()=>t.assign(n,(0,Ie._)`${n} || {}`).code((0,Ie._)`Object.assign(${n}, ${e})`))}),mergeToName:(t,e,n)=>t.if((0,Ie._)`${n} !== true`,()=>{e===!0?t.assign(n,!0):(t.assign(n,(0,Ie._)`${n} || {}`),Xm(t,n,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:UO}),items:zO({mergeNames:(t,e,n)=>t.if((0,Ie._)`${n} !== true && ${e} !== undefined`,()=>t.assign(n,(0,Ie._)`${e} === true ? true : ${n} > ${e} ? ${n} : ${e}`)),mergeToName:(t,e,n)=>t.if((0,Ie._)`${n} !== true`,()=>t.assign(n,e===!0?!0:(0,Ie._)`${n} > ${e} ? ${n} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function UO(t,e){if(e===!0)return t.var("props",!0);let n=t.var("props",(0,Ie._)`{}`);return e!==void 0&&Xm(t,n,e),n}de.evaluatedPropsToName=UO;function Xm(t,e,n){Object.keys(n).forEach(i=>t.assign((0,Ie._)`${e}${(0,Ie.getProperty)(i)}`,!0))}de.setEvaluated=Xm;var DO={};function uU(t,e){return t.scopeValue("func",{ref:e,code:DO[e.code]||(DO[e.code]=new nU._Code(e.code))})}de.useFunc=uU;var Qm;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(Qm||(de.Type=Qm={}));function cU(t,e,n){if(t instanceof Ie.Name){let i=e===Qm.Num;return n?i?(0,Ie._)`"[" + ${t} + "]"`:(0,Ie._)`"['" + ${t} + "']"`:i?(0,Ie._)`"/" + ${t}`:(0,Ie._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?(0,Ie.getProperty)(t).toString():"/"+Ym(t)}de.getErrorPath=cU;function LO(t,e,n=t.opts.strictSchema){if(n){if(e=`strict mode: ${e}`,n===!0)throw new Error(e);t.self.logger.warn(e)}}de.checkStrictMode=LO});var wt=v(ef=>{"use strict";Object.defineProperty(ef,"__esModule",{value:!0});var Hn=le(),pU={data:new Hn.Name("data"),valCxt:new Hn.Name("valCxt"),instancePath:new Hn.Name("instancePath"),parentData:new Hn.Name("parentData"),parentDataProperty:new Hn.Name("parentDataProperty"),rootData:new Hn.Name("rootData"),dynamicAnchors:new Hn.Name("dynamicAnchors"),vErrors:new Hn.Name("vErrors"),errors:new Hn.Name("errors"),this:new Hn.Name("this"),self:new Hn.Name("self"),scope:new Hn.Name("scope"),json:new Hn.Name("json"),jsonPos:new Hn.Name("jsonPos"),jsonLen:new Hn.Name("jsonLen"),jsonPart:new Hn.Name("jsonPart")};ef.default=pU});var Po=v(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});In.extendErrors=In.resetErrorsCount=In.reportExtraError=In.reportError=In.keyword$DataError=In.keywordError=void 0;var Pe=le(),oc=ye(),Nn=wt();In.keywordError={message:({keyword:t})=>(0,Pe.str)`must pass "${t}" keyword validation`};In.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,Pe.str)`"${t}" keyword must be ${e} ($data)`:(0,Pe.str)`"${t}" keyword is invalid ($data)`};function dU(t,e=In.keywordError,n,i){let{it:a}=t,{gen:r,compositeRule:s,allErrors:o}=a,l=FO(t,e,n);i??(s||o)?WO(r,l):BO(a,(0,Pe._)`[${l}]`)}In.reportError=dU;function hU(t,e=In.keywordError,n){let{it:i}=t,{gen:a,compositeRule:r,allErrors:s}=i,o=FO(t,e,n);WO(a,o),r||s||BO(i,Nn.default.vErrors)}In.reportExtraError=hU;function gU(t,e){t.assign(Nn.default.errors,e),t.if((0,Pe._)`${Nn.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,Pe._)`${Nn.default.vErrors}.length`,e),()=>t.assign(Nn.default.vErrors,null)))}In.resetErrorsCount=gU;function mU({gen:t,keyword:e,schemaValue:n,data:i,errsCount:a,it:r}){if(a===void 0)throw new Error("ajv implementation error");let s=t.name("err");t.forRange("i",a,Nn.default.errors,o=>{t.const(s,(0,Pe._)`${Nn.default.vErrors}[${o}]`),t.if((0,Pe._)`${s}.instancePath === undefined`,()=>t.assign((0,Pe._)`${s}.instancePath`,(0,Pe.strConcat)(Nn.default.instancePath,r.errorPath))),t.assign((0,Pe._)`${s}.schemaPath`,(0,Pe.str)`${r.errSchemaPath}/${e}`),r.opts.verbose&&(t.assign((0,Pe._)`${s}.schema`,n),t.assign((0,Pe._)`${s}.data`,i))})}In.extendErrors=mU;function WO(t,e){let n=t.const("err",e);t.if((0,Pe._)`${Nn.default.vErrors} === null`,()=>t.assign(Nn.default.vErrors,(0,Pe._)`[${n}]`),(0,Pe._)`${Nn.default.vErrors}.push(${n})`),t.code((0,Pe._)`${Nn.default.errors}++`)}function BO(t,e){let{gen:n,validateName:i,schemaEnv:a}=t;a.$async?n.throw((0,Pe._)`new ${t.ValidationError}(${e})`):(n.assign((0,Pe._)`${i}.errors`,e),n.return(!1))}var Ha={keyword:new Pe.Name("keyword"),schemaPath:new Pe.Name("schemaPath"),params:new Pe.Name("params"),propertyName:new Pe.Name("propertyName"),message:new Pe.Name("message"),schema:new Pe.Name("schema"),parentSchema:new Pe.Name("parentSchema")};function FO(t,e,n){let{createErrors:i}=t.it;return i===!1?(0,Pe._)`{}`:fU(t,e,n)}function fU(t,e,n={}){let{gen:i,it:a}=t,r=[wU(a,n),vU(t,n)];return CU(t,e,r),i.object(...r)}function wU({errorPath:t},{instancePath:e}){let n=e?(0,Pe.str)`${t}${(0,oc.getErrorPath)(e,oc.Type.Str)}`:t;return[Nn.default.instancePath,(0,Pe.strConcat)(Nn.default.instancePath,n)]}function vU({keyword:t,it:{errSchemaPath:e}},{schemaPath:n,parentSchema:i}){let a=i?e:(0,Pe.str)`${e}/${t}`;return n&&(a=(0,Pe.str)`${a}${(0,oc.getErrorPath)(n,oc.Type.Str)}`),[Ha.schemaPath,a]}function CU(t,{params:e,message:n},i){let{keyword:a,data:r,schemaValue:s,it:o}=t,{opts:l,propertyName:u,topSchemaRef:c,schemaPath:p}=o;i.push([Ha.keyword,a],[Ha.params,typeof e=="function"?e(t):e||(0,Pe._)`{}`]),l.messages&&i.push([Ha.message,typeof n=="function"?n(t):n]),l.verbose&&i.push([Ha.schema,s],[Ha.parentSchema,(0,Pe._)`${c}${p}`],[Nn.default.data,r]),u&&i.push([Ha.propertyName,u])}});var JO=v(Dr=>{"use strict";Object.defineProperty(Dr,"__esModule",{value:!0});Dr.boolOrEmptySchema=Dr.topBoolOrEmptySchema=void 0;var AU=Po(),bU=le(),yU=wt(),PU={message:"boolean schema is false"};function jU(t){let{gen:e,schema:n,validateName:i}=t;n===!1?VO(t,!1):typeof n=="object"&&n.$async===!0?e.return(yU.default.data):(e.assign((0,bU._)`${i}.errors`,null),e.return(!0))}Dr.topBoolOrEmptySchema=jU;function SU(t,e){let{gen:n,schema:i}=t;i===!1?(n.var(e,!1),VO(t)):n.var(e,!0)}Dr.boolOrEmptySchema=SU;function VO(t,e){let{gen:n,data:i}=t,a={gen:n,keyword:"false schema",data:i,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,AU.reportError)(a,PU,void 0,e)}});var nf=v(Gr=>{"use strict";Object.defineProperty(Gr,"__esModule",{value:!0});Gr.getRules=Gr.isJSONType=void 0;var OU=["string","number","integer","boolean","null","object","array"],xU=new Set(OU);function TU(t){return typeof t=="string"&&xU.has(t)}Gr.isJSONType=TU;function MU(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}Gr.getRules=MU});var tf=v(Gt=>{"use strict";Object.defineProperty(Gt,"__esModule",{value:!0});Gt.shouldUseRule=Gt.shouldUseGroup=Gt.schemaHasRulesForType=void 0;function EU({schema:t,self:e},n){let i=e.RULES.types[n];return i&&i!==!0&&ZO(t,i)}Gt.schemaHasRulesForType=EU;function ZO(t,e){return e.rules.some(n=>KO(t,n))}Gt.shouldUseGroup=ZO;function KO(t,e){var n;return t[e.keyword]!==void 0||((n=e.definition.implements)===null||n===void 0?void 0:n.some(i=>t[i]!==void 0))}Gt.shouldUseRule=KO});var jo=v(Rn=>{"use strict";Object.defineProperty(Rn,"__esModule",{value:!0});Rn.reportTypeError=Rn.checkDataTypes=Rn.checkDataType=Rn.coerceAndCheckDataType=Rn.getJSONTypes=Rn.getSchemaTypes=Rn.DataType=void 0;var kU=nf(),qU=tf(),_U=Po(),ae=le(),QO=ye(),$r;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})($r||(Rn.DataType=$r={}));function HU(t){let e=YO(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}Rn.getSchemaTypes=HU;function YO(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(kU.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}Rn.getJSONTypes=YO;function IU(t,e){let{gen:n,data:i,opts:a}=t,r=RU(e,a.coerceTypes),s=e.length>0&&!(r.length===0&&e.length===1&&(0,qU.schemaHasRulesForType)(t,e[0]));if(s){let o=rf(e,i,a.strictNumbers,$r.Wrong);n.if(o,()=>{r.length?zU(t,e,r):sf(t)})}return s}Rn.coerceAndCheckDataType=IU;var XO=new Set(["string","number","integer","boolean","null"]);function RU(t,e){return e?t.filter(n=>XO.has(n)||e==="array"&&n==="array"):[]}function zU(t,e,n){let{gen:i,data:a,opts:r}=t,s=i.let("dataType",(0,ae._)`typeof ${a}`),o=i.let("coerced",(0,ae._)`undefined`);r.coerceTypes==="array"&&i.if((0,ae._)`${s} == 'object' && Array.isArray(${a}) && ${a}.length == 1`,()=>i.assign(a,(0,ae._)`${a}[0]`).assign(s,(0,ae._)`typeof ${a}`).if(rf(e,a,r.strictNumbers),()=>i.assign(o,a))),i.if((0,ae._)`${o} !== undefined`);for(let u of n)(XO.has(u)||u==="array"&&r.coerceTypes==="array")&&l(u);i.else(),sf(t),i.endIf(),i.if((0,ae._)`${o} !== undefined`,()=>{i.assign(a,o),DU(t,o)});function l(u){switch(u){case"string":i.elseIf((0,ae._)`${s} == "number" || ${s} == "boolean"`).assign(o,(0,ae._)`"" + ${a}`).elseIf((0,ae._)`${a} === null`).assign(o,(0,ae._)`""`);return;case"number":i.elseIf((0,ae._)`${s} == "boolean" || ${a} === null || (${s} == "string" && ${a} && ${a} == +${a})`).assign(o,(0,ae._)`+${a}`);return;case"integer":i.elseIf((0,ae._)`${s} === "boolean" || ${a} === null || (${s} === "string" && ${a} && ${a} == +${a} && !(${a} % 1))`).assign(o,(0,ae._)`+${a}`);return;case"boolean":i.elseIf((0,ae._)`${a} === "false" || ${a} === 0 || ${a} === null`).assign(o,!1).elseIf((0,ae._)`${a} === "true" || ${a} === 1`).assign(o,!0);return;case"null":i.elseIf((0,ae._)`${a} === "" || ${a} === 0 || ${a} === false`),i.assign(o,null);return;case"array":i.elseIf((0,ae._)`${s} === "string" || ${s} === "number" - || ${s} === "boolean" || ${a} === null`).assign(o,(0,ae._)`[${a}]`)}}}function DU({gen:t,parentData:e,parentDataProperty:n},i){t.if((0,ae._)`${e} !== undefined`,()=>t.assign((0,ae._)`${e}[${n}]`,i))}function af(t,e,n,i=$r.Correct){let a=i===$r.Correct?ae.operators.EQ:ae.operators.NEQ,r;switch(t){case"null":return(0,ae._)`${e} ${a} null`;case"array":r=(0,ae._)`Array.isArray(${e})`;break;case"object":r=(0,ae._)`${e} && typeof ${e} == "object" && !Array.isArray(${e})`;break;case"integer":r=s((0,ae._)`!(${e} % 1) && !isNaN(${e})`);break;case"number":r=s();break;default:return(0,ae._)`typeof ${e} ${a} ${t}`}return i===$r.Correct?r:(0,ae.not)(r);function s(o=ae.nil){return(0,ae.and)((0,ae._)`typeof ${e} == "number"`,o,n?(0,ae._)`isFinite(${e})`:ae.nil)}}Rn.checkDataType=af;function rf(t,e,n,i){if(t.length===1)return af(t[0],e,n,i);let a,r=(0,QO.toHash)(t);if(r.array&&r.object){let s=(0,ae._)`typeof ${e} != "object"`;a=r.null?s:(0,ae._)`!${e} || ${s}`,delete r.null,delete r.array,delete r.object}else a=ae.nil;r.number&&delete r.integer;for(let s in r)a=(0,ae.and)(a,af(s,e,n,i));return a}Rn.checkDataTypes=rf;var GU={message:({schema:t})=>`must be ${t}`,params:({schema:t,schemaValue:e})=>typeof t=="string"?(0,ae._)`{type: ${t}}`:(0,ae._)`{type: ${e}}`};function sf(t){let e=$U(t);(0,_U.reportError)(e,GU)}Rn.reportTypeError=sf;function $U(t){let{gen:e,data:n,schema:i}=t,a=(0,QO.schemaRefOrVal)(t,i,"type");return{gen:e,keyword:"type",data:n,schema:i.type,schemaCode:a,schemaValue:a,parentSchema:i,params:{},it:t}}});var nx=v(lc=>{"use strict";Object.defineProperty(lc,"__esModule",{value:!0});lc.assignDefaults=void 0;var Nr=le(),NU=ye();function UU(t,e){let{properties:n,items:i}=t.schema;if(e==="object"&&n)for(let a in n)ex(t,a,n[a].default);else e==="array"&&Array.isArray(i)&&i.forEach((a,r)=>ex(t,r,a.default))}lc.assignDefaults=UU;function ex(t,e,n){let{gen:i,compositeRule:a,data:r,opts:s}=t;if(n===void 0)return;let o=(0,Nr._)`${r}${(0,Nr.getProperty)(e)}`;if(a){(0,NU.checkStrictMode)(t,`default is ignored for: ${o}`);return}let l=(0,Nr._)`${o} === undefined`;s.useDefaults==="empty"&&(l=(0,Nr._)`${l} || ${o} === null || ${o} === ""`),i.if(l,(0,Nr._)`${o} = ${(0,Nr.stringify)(n)}`)}});var Ci=v(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.validateUnion=qe.validateArray=qe.usePattern=qe.callValidateCode=qe.schemaProperties=qe.allSchemaProperties=qe.noPropertyInData=qe.propertyInData=qe.isOwnProperty=qe.hasPropFunc=qe.reportMissingProp=qe.checkMissingProp=qe.checkReportMissingProp=void 0;var Ne=le(),of=ye(),$t=wt(),LU=ye();function WU(t,e){let{gen:n,data:i,it:a}=t;n.if(uf(n,i,e,a.opts.ownProperties),()=>{t.setParams({missingProperty:(0,Ne._)`${e}`},!0),t.error()})}qe.checkReportMissingProp=WU;function BU({gen:t,data:e,it:{opts:n}},i,a){return(0,Ne.or)(...i.map(r=>(0,Ne.and)(uf(t,e,r,n.ownProperties),(0,Ne._)`${a} = ${r}`)))}qe.checkMissingProp=BU;function FU(t,e){t.setParams({missingProperty:e},!0),t.error()}qe.reportMissingProp=FU;function ix(t){return t.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,Ne._)`Object.prototype.hasOwnProperty`})}qe.hasPropFunc=ix;function lf(t,e,n){return(0,Ne._)`${ix(t)}.call(${e}, ${n})`}qe.isOwnProperty=lf;function VU(t,e,n,i){let a=(0,Ne._)`${e}${(0,Ne.getProperty)(n)} !== undefined`;return i?(0,Ne._)`${a} && ${lf(t,e,n)}`:a}qe.propertyInData=VU;function uf(t,e,n,i){let a=(0,Ne._)`${e}${(0,Ne.getProperty)(n)} === undefined`;return i?(0,Ne.or)(a,(0,Ne.not)(lf(t,e,n))):a}qe.noPropertyInData=uf;function tx(t){return t?Object.keys(t).filter(e=>e!=="__proto__"):[]}qe.allSchemaProperties=tx;function JU(t,e){return tx(e).filter(n=>!(0,of.alwaysValidSchema)(t,e[n]))}qe.schemaProperties=JU;function ZU({schemaCode:t,data:e,it:{gen:n,topSchemaRef:i,schemaPath:a,errorPath:r},it:s},o,l,u){let c=u?(0,Ne._)`${t}, ${e}, ${i}${a}`:e,p=[[$t.default.instancePath,(0,Ne.strConcat)($t.default.instancePath,r)],[$t.default.parentData,s.parentData],[$t.default.parentDataProperty,s.parentDataProperty],[$t.default.rootData,$t.default.rootData]];s.opts.dynamicRef&&p.push([$t.default.dynamicAnchors,$t.default.dynamicAnchors]);let h=(0,Ne._)`${c}, ${n.object(...p)}`;return l!==Ne.nil?(0,Ne._)`${o}.call(${l}, ${h})`:(0,Ne._)`${o}(${h})`}qe.callValidateCode=ZU;var KU=(0,Ne._)`new RegExp`;function QU({gen:t,it:{opts:e}},n){let i=e.unicodeRegExp?"u":"",{regExp:a}=e.code,r=a(n,i);return t.scopeValue("pattern",{key:r.toString(),ref:r,code:(0,Ne._)`${a.code==="new RegExp"?KU:(0,LU.useFunc)(t,a)}(${n}, ${i})`})}qe.usePattern=QU;function YU(t){let{gen:e,data:n,keyword:i,it:a}=t,r=e.name("valid");if(a.allErrors){let o=e.let("valid",!0);return s(()=>e.assign(o,!1)),o}return e.var(r,!0),s(()=>e.break()),r;function s(o){let l=e.const("len",(0,Ne._)`${n}.length`);e.forRange("i",0,l,u=>{t.subschema({keyword:i,dataProp:u,dataPropType:of.Type.Num},r),e.if((0,Ne.not)(r),o)})}}qe.validateArray=YU;function XU(t){let{gen:e,schema:n,keyword:i,it:a}=t;if(!Array.isArray(n))throw new Error("ajv implementation error");if(n.some(l=>(0,of.alwaysValidSchema)(a,l))&&!a.opts.unevaluated)return;let s=e.let("valid",!1),o=e.name("_valid");e.block(()=>n.forEach((l,u)=>{let c=t.subschema({keyword:i,schemaProp:u,compositeRule:!0},o);e.assign(s,(0,Ne._)`${s} || ${o}`),t.mergeValidEvaluated(c,o)||e.if((0,Ne.not)(s))})),t.result(s,()=>t.reset(),()=>t.error(!0))}qe.validateUnion=XU});var sx=v(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.validateKeywordUsage=Bi.validSchemaType=Bi.funcKeywordCode=Bi.macroKeywordCode=void 0;var Un=le(),Ia=wt(),eL=Ci(),nL=Po();function iL(t,e){let{gen:n,keyword:i,schema:a,parentSchema:r,it:s}=t,o=e.macro.call(s.self,a,r,s),l=rx(n,i,o);s.opts.validateSchema!==!1&&s.self.validateSchema(o,!0);let u=n.name("valid");t.subschema({schema:o,schemaPath:Un.nil,errSchemaPath:`${s.errSchemaPath}/${i}`,topSchemaRef:l,compositeRule:!0},u),t.pass(u,()=>t.error(!0))}Bi.macroKeywordCode=iL;function tL(t,e){var n;let{gen:i,keyword:a,schema:r,parentSchema:s,$data:o,it:l}=t;rL(l,e);let u=!o&&e.compile?e.compile.call(l.self,r,s,l):e.validate,c=rx(i,a,u),p=i.let("valid");t.block$data(p,h),t.ok((n=e.valid)!==null&&n!==void 0?n:p);function h(){if(e.errors===!1)m(),e.modifying&&ax(t),f(()=>t.error());else{let w=e.async?d():g();e.modifying&&ax(t),f(()=>aL(t,w))}}function d(){let w=i.let("ruleErrs",null);return i.try(()=>m((0,Un._)`await `),b=>i.assign(p,!1).if((0,Un._)`${b} instanceof ${l.ValidationError}`,()=>i.assign(w,(0,Un._)`${b}.errors`),()=>i.throw(b))),w}function g(){let w=(0,Un._)`${c}.errors`;return i.assign(w,null),m(Un.nil),w}function m(w=e.async?(0,Un._)`await `:Un.nil){let b=l.opts.passContext?Ia.default.this:Ia.default.self,A=!("compile"in e&&!o||e.schema===!1);i.assign(p,(0,Un._)`${w}${(0,eL.callValidateCode)(t,c,b,A)}`,e.modifying)}function f(w){var b;i.if((0,Un.not)((b=e.valid)!==null&&b!==void 0?b:p),w)}}Bi.funcKeywordCode=tL;function ax(t){let{gen:e,data:n,it:i}=t;e.if(i.parentData,()=>e.assign(n,(0,Un._)`${i.parentData}[${i.parentDataProperty}]`))}function aL(t,e){let{gen:n}=t;n.if((0,Un._)`Array.isArray(${e})`,()=>{n.assign(Ia.default.vErrors,(0,Un._)`${Ia.default.vErrors} === null ? ${e} : ${Ia.default.vErrors}.concat(${e})`).assign(Ia.default.errors,(0,Un._)`${Ia.default.vErrors}.length`),(0,nL.extendErrors)(t)},()=>t.error())}function rL({schemaEnv:t},e){if(e.async&&!t.$async)throw new Error("async keyword in sync schema")}function rx(t,e,n){if(n===void 0)throw new Error(`keyword "${e}" failed to compile`);return t.scopeValue("keyword",typeof n=="function"?{ref:n}:{ref:n,code:(0,Un.stringify)(n)})}function sL(t,e,n=!1){return!e.length||e.some(i=>i==="array"?Array.isArray(t):i==="object"?t&&typeof t=="object"&&!Array.isArray(t):typeof t==i||n&&typeof t>"u")}Bi.validSchemaType=sL;function oL({schema:t,opts:e,self:n,errSchemaPath:i},a,r){if(Array.isArray(a.keyword)?!a.keyword.includes(r):a.keyword!==r)throw new Error("ajv implementation error");let s=a.dependencies;if(s?.some(o=>!Object.prototype.hasOwnProperty.call(t,o)))throw new Error(`parent schema must have dependencies of ${r}: ${s.join(",")}`);if(a.validateSchema&&!a.validateSchema(t[r])){let l=`keyword "${r}" value is invalid at path "${i}": `+n.errorsText(a.validateSchema.errors);if(e.validateSchema==="log")n.logger.error(l);else throw new Error(l)}}Bi.validateKeywordUsage=oL});var lx=v(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.extendSubschemaMode=Nt.extendSubschemaData=Nt.getSubschema=void 0;var Fi=le(),ox=ye();function lL(t,{keyword:e,schemaProp:n,schema:i,schemaPath:a,errSchemaPath:r,topSchemaRef:s}){if(e!==void 0&&i!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(e!==void 0){let o=t.schema[e];return n===void 0?{schema:o,schemaPath:(0,Fi._)`${t.schemaPath}${(0,Fi.getProperty)(e)}`,errSchemaPath:`${t.errSchemaPath}/${e}`}:{schema:o[n],schemaPath:(0,Fi._)`${t.schemaPath}${(0,Fi.getProperty)(e)}${(0,Fi.getProperty)(n)}`,errSchemaPath:`${t.errSchemaPath}/${e}/${(0,ox.escapeFragment)(n)}`}}if(i!==void 0){if(a===void 0||r===void 0||s===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:i,schemaPath:a,topSchemaRef:s,errSchemaPath:r}}throw new Error('either "keyword" or "schema" must be passed')}Nt.getSubschema=lL;function uL(t,e,{dataProp:n,dataPropType:i,data:a,dataTypes:r,propertyName:s}){if(a!==void 0&&n!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:o}=e;if(n!==void 0){let{errorPath:u,dataPathArr:c,opts:p}=e,h=o.let("data",(0,Fi._)`${e.data}${(0,Fi.getProperty)(n)}`,!0);l(h),t.errorPath=(0,Fi.str)`${u}${(0,ox.getErrorPath)(n,i,p.jsPropertySyntax)}`,t.parentDataProperty=(0,Fi._)`${n}`,t.dataPathArr=[...c,t.parentDataProperty]}if(a!==void 0){let u=a instanceof Fi.Name?a:o.let("data",a,!0);l(u),s!==void 0&&(t.propertyName=s)}r&&(t.dataTypes=r);function l(u){t.data=u,t.dataLevel=e.dataLevel+1,t.dataTypes=[],e.definedProperties=new Set,t.parentData=e.data,t.dataNames=[...e.dataNames,u]}}Nt.extendSubschemaData=uL;function cL(t,{jtdDiscriminator:e,jtdMetadata:n,compositeRule:i,createErrors:a,allErrors:r}){i!==void 0&&(t.compositeRule=i),a!==void 0&&(t.createErrors=a),r!==void 0&&(t.allErrors=r),t.jtdDiscriminator=e,t.jtdMetadata=n}Nt.extendSubschemaMode=cL});var cf=v((Hse,ux)=>{"use strict";ux.exports=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var i,a,r;if(Array.isArray(e)){if(i=e.length,i!=n.length)return!1;for(a=i;a--!==0;)if(!t(e[a],n[a]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(r=Object.keys(e),i=r.length,i!==Object.keys(n).length)return!1;for(a=i;a--!==0;)if(!Object.prototype.hasOwnProperty.call(n,r[a]))return!1;for(a=i;a--!==0;){var s=r[a];if(!t(e[s],n[s]))return!1}return!0}return e!==e&&n!==n}});var px=v((Ise,cx)=>{"use strict";var Ut=cx.exports=function(t,e,n){typeof e=="function"&&(n=e,e={}),n=e.cb||n;var i=typeof n=="function"?n:n.pre||function(){},a=n.post||function(){};uc(e,i,a,t,"",t)};Ut.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0};Ut.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};Ut.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};Ut.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function uc(t,e,n,i,a,r,s,o,l,u){if(i&&typeof i=="object"&&!Array.isArray(i)){e(i,a,r,s,o,l,u);for(var c in i){var p=i[c];if(Array.isArray(p)){if(c in Ut.arrayKeywords)for(var h=0;h
{if(r)return;r=!0,s&&(clearTimeout(s),s=null);let p=i,h=p.length,d=h;for(;d--;)if(p[d][0]===a){h===1?delete this.sessions[e]:p.splice(d,1),a.closed||a.close();return}},l=a.request,{sessionTimeout:u}=n;if(u!=null){let p=0;a.request=function(){let h=l.apply(this,arguments);return p++,s&&(clearTimeout(s),s=null),h.once("close",()=>{--p||(s=setTimeout(()=>{s=null,o()},u))}),h}}a.once("close",o);let c=[a,n];return i?i.push(c):i=this.sessions[e]=[c],a}},x5=(t,e)=>C.isAsyncFn(t)?function(...n){let i=n.pop();t.apply(this,n).then(a=>{try{e?i(null,...e(a)):i(null,a)}catch(r){i(r)}},i)}:t,T5=new Set(["localhost","0.0.0.0"]),a_=t=>{let e=t.split(".");return e.length!==4||e[0]!=="127"?!1:e.every(n=>/^\d+$/.test(n)&&Number(n)>=0&&Number(n)<=255)},Tv=t=>{if(/^0[xX][0-9a-fA-F]+$/.test(t)){let e=parseInt(t.slice(2),16);return Number.isFinite(e)?e:null}if(t.length>1&&/^0[0-7]+$/.test(t)){let e=parseInt(t,8);return Number.isFinite(e)?e:null}if(t.length>1&&/^0[0-9]+$/.test(t))return null;if(/^[0-9]+$/.test(t)){let e=parseInt(t,10);return Number.isFinite(e)?e:null}return null},M5=t=>{if(typeof t!="string"||!t||t.indexOf(":")!==-1)return t;let e=t;if(e.charAt(0)==="["&&e.charAt(e.length-1)==="]"&&(e=e.slice(1,-1)),e=e.replace(/\.+$/,""),!/^[0-9.xXa-fA-F]+$/.test(e))return t;let n=e.split(".");if(n.some(c=>c===""))return t;if(n.length===4){let c=n.map(Tv);return c.some(p=>p===null||p<0||p>255)?t:c.join(".")}if(n.length>4||n.length===1)return t;let i=n.slice(0,-1),a=n[n.length-1],r=4-i.length,s=Tv(a);if(s===null)return t;let o=(1<<8*r)-1;if(s<0||s>o)return t;let l=new Array(r).fill(0);for(let c=r-1,p=s;c>=0;c--,p>>=8)l[c]=p&255;let u=i.map(Tv);return u.some(c=>c===null||c<0||c>255)?t:[...u,...l].join(".")},Mv=t=>/^0{1,4}$/.test(t),E5=t=>{if(t==="::")return!0;let e=t.indexOf("::");if(e!==-1){if(e!==t.lastIndexOf("::"))return!1;let i=t.slice(0,e),a=t.slice(e+2),r=i?i.split(":"):[],s=a?a.split(":"):[];return r.length+s.length<8&&r.every(Mv)&&s.every(Mv)}let n=t.split(":");return n.length===8&&n.every(Mv)},k5=t=>{if(t==="::1")return!0;let e=t.match(/^::ffff:(\d+\.\d+\.\d+\.\d+)$/i);if(e)return a_(e[1]);let n=t.match(/^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i);if(n){let a=parseInt(n[1],16);return a>=32512&&a<=32767}let i=t.split(":");if(i.length===8){for(let a=0;a<7;a++)if(!/^0+$/.test(i[a]))return!1;return/^0*1$/.test(i[7])}return!1},hq=t=>t?T5.has(t)||a_(t)||E5(t)?!0:k5(t):!1,q5={http:80,https:443,ws:80,wss:443,ftp:21},_5=t=>{let e=t,n=0;if(e.charAt(0)==="["){let r=e.indexOf("]");if(r!==-1){let s=e.slice(1,r),o=e.slice(r+1);return o.charAt(0)===":"&&/^\d+$/.test(o.slice(1))&&(n=Number.parseInt(o.slice(1),10)),[s,n]}}let i=e.indexOf(":"),a=e.lastIndexOf(":");return i!==-1&&i===a&&/^\d+$/.test(e.slice(a+1))&&(n=Number.parseInt(e.slice(a+1),10),e=e.slice(0,a)),[e,n]},H5=/^(?:::|(?:0{1,4}:){1,4}:|(?:0{1,4}:){5})ffff:(\d+\.\d+\.\d+\.\d+)$/i,I5=/^(?:::|(?:0{1,4}:){1,4}:|(?:0{1,4}:){5})ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/i,R5=t=>{if(typeof t!="string"||t.indexOf(":")===-1)return t;let e=t.match(H5);if(e)return e[1];let n=t.match(I5);if(n){let i=parseInt(n[1],16),a=parseInt(n[2],16);return`${i>>8}.${i&255}.${a>>8}.${a&255}`}return t},gq=t=>{if(!t)return t;t.charAt(0)==="["&&t.charAt(t.length-1)==="]"&&(t=t.slice(1,-1));let e=t.replace(/\.+$/,""),n=M5(e);return n!==e?n:R5(e)};function z5(t){let e;try{e=new URL(t)}catch{return!1}let n=(process.env.no_proxy||process.env.NO_PROXY||"").toLowerCase();if(!n)return!1;if(n==="*")return!0;let i=Number.parseInt(e.port,10)||q5[e.protocol.split(":",1)[0]]||0,a=gq(e.hostname.toLowerCase());return n.split(/[\s,]+/).some(r=>{if(!r)return!1;if(r==="*")return!0;let[s,o]=_5(r);return s=gq(s),!s||o&&o!==i?!1:(s.charAt(0)==="*"&&(s=s.slice(1)),s.charAt(0)==="."?a.endsWith(s):a===s||hq(a)&&hq(s))})}function D5(t,e){t=t||10;let n=new Array(t),i=new Array(t),a=0,r=0,s;return e=e!==void 0?e:1e3,function(l){let u=Date.now(),c=i[r];s||(s=u),n[a]=l,i[a]=u;let p=r,h=0;for(;p!==a;)h+=n[p++],p=p%t;if(a=(a+1)%t,a===r&&(r=(r+1)%t),u-snew zC(t)});var S0=v((Dp,j0)=>{(function(t,e){typeof Dp=="object"&&typeof j0<"u"?e(Dp):typeof define=="function"&&define.amd?define(["exports"],e):e(t.fecha={})})(Dp,(function(t){"use strict";var e=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,n="\\d\\d?",i="\\d\\d",a="\\d{3}",r="\\d{4}",s="[^\\s]+",o=/\[([^]*?)\]/gm;function l(O,R){for(var Se=[],Xe=0,_=O.length;Xe<_;Xe++)Se.push(O[Xe].substr(0,R));return Se}var u=function(O){return function(R,Se){var Xe=Se[O].map(function(be){return be.toLowerCase()}),_=Xe.indexOf(R.toLowerCase());return _>-1?_:null}};function c(O){for(var R=[],Se=1;Senew zC(t)});var S0=v((Dp,j0)=>{(function(t,e){typeof Dp=="object"&&typeof j0<"u"?e(Dp):typeof define=="function"&&define.amd?define(["exports"],e):e(t.fecha={})})(Dp,(function(t){"use strict";var e=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,n="\\d\\d?",i="\\d\\d",a="\\d{3}",r="\\d{4}",s="[^\\s]+",o=/\[([^]*?)\]/gm;function l(O,R){for(var Se=[],Xe=0,_=O.length;Xe<_;Xe++)Se.push(O[Xe].substr(0,R));return Se}var u=function(O){return function(R,Se){var Xe=Se[O].map(function(be){return be.toLowerCase()}),_=Xe.indexOf(R.toLowerCase());return _>-1?_:null}};function c(O){for(var R=[],Se=1;Se