@nekzus/liop 2.0.0-alpha.15 → 2.0.0-alpha.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/bin/agent.js +1 -1
- package/dist/bridge.js +1 -1
- package/dist/{chunk-YDGVPISC.js → chunk-3642NPOH.js} +14 -14
- package/dist/chunk-3642NPOH.js.map +1 -0
- package/dist/{chunk-PPCOS2NU.js → chunk-7I6YJS3C.js} +2 -2
- package/dist/{chunk-PPCOS2NU.js.map → chunk-7I6YJS3C.js.map} +1 -1
- package/dist/{chunk-HNDVAKEK.js → chunk-C65RM2A3.js} +6 -6
- package/dist/chunk-C65RM2A3.js.map +1 -0
- package/dist/{chunk-KUCR7DYN.js → chunk-HIMYXEHH.js} +3 -3
- package/dist/chunk-HIMYXEHH.js.map +1 -0
- package/dist/{chunk-P52IE4L6.js → chunk-ISKM7EAL.js} +2 -2
- package/dist/{chunk-P52IE4L6.js.map → chunk-ISKM7EAL.js.map} +1 -1
- package/dist/{chunk-DRCLBOMG.js → chunk-SYMZRXI3.js} +3 -3
- package/dist/{chunk-DRCLBOMG.js.map → chunk-SYMZRXI3.js.map} +1 -1
- package/dist/{chunk-CTB5O4PB.js → chunk-UK7OBXGZ.js} +10 -10
- package/dist/chunk-UK7OBXGZ.js.map +1 -0
- package/dist/chunk-V5MKJT6S.js +2 -0
- package/dist/chunk-V5MKJT6S.js.map +1 -0
- package/dist/client.d.ts +1 -1
- package/dist/client.js +1 -1
- package/dist/gateway.js +1 -1
- package/dist/{index-CyxNLlz7.d.ts → index-BihN3W-K.d.ts} +9 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/mesh.js +1 -1
- package/dist/server.js +1 -1
- package/dist/workers/logic-execution.js +1 -1
- package/dist/workers/logic-execution.js.map +1 -1
- package/package.json +10 -10
- package/dist/chunk-CTB5O4PB.js.map +0 -1
- package/dist/chunk-HM77MWB6.js +0 -2
- package/dist/chunk-HM77MWB6.js.map +0 -1
- package/dist/chunk-HNDVAKEK.js.map +0 -1
- package/dist/chunk-KUCR7DYN.js.map +0 -1
- package/dist/chunk-YDGVPISC.js.map +0 -1
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import {b as b$1,a as a$3}from'./chunk-2MGFSIXN.js';import {a,b}from'./chunk-HM77MWB6.js';import {a as a$2}from'./chunk-PPCOS2NU.js';import {a as a$1}from'./chunk-S6RJHZV2.js';import {Buffer}from'buffer';import Vi from'crypto';import*as Bi from'fs';import {createRequire}from'module';import be from'path';import {fileURLToPath,pathToFileURL}from'url';import*as Gt from'@grpc/grpc-js';import {Piscina,FixedQueue}from'piscina';var gt=Symbol("Let zodToJsonSchema decide on which parser to use");var mt={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:true,rejectedAdditionalProperties:false,definitionPath:"definitions",target:"jsonSchema7",strictUnions:false,definitions:{},errorMessages:false,markdownDescription:false,patternStrategy:"escape",applyRegexFlags:false,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},xt=e=>({...mt,...e});var yt=e=>{let t=xt(e),i=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return {...t,flags:{hasReferencedOpenAiAnyType:false},currentPath:i,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([r,s])=>[s._def,{def:s._def,path:[...t.basePath,t.definitionPath,r],jsonSchema:void 0}]))}};function We(e,t,i,r){r?.errorMessages&&i&&(e.errorMessage={...e.errorMessage,[t]:i});}function _(e,t,i,r,s){e[t]=i,We(e,t,r,s);}var Ee=(e,t)=>{let i=0;for(;i<e.length&&i<t.length&&e[i]===t[i];i++);return [(e.length-i).toString(),...t.slice(i)].join("/")};function k(e){if(e.target!=="openAi")return {};let t=[...e.basePath,e.definitionPath,e.openAiAnyTypeName];return e.flags.hasReferencedOpenAiAnyType=true,{$ref:e.$refStrategy==="relative"?Ee(t,e.currentPath):t.join("/")}}function vt(e,t){let i={type:"array"};return e.type?._def&&e.type?._def?.typeName!==a$3.ZodAny&&(i.items=g(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&_(i,"minItems",e.minLength.value,e.minLength.message,t),e.maxLength&&_(i,"maxItems",e.maxLength.value,e.maxLength.message,t),e.exactLength&&(_(i,"minItems",e.exactLength.value,e.exactLength.message,t),_(i,"maxItems",e.exactLength.value,e.exactLength.message,t)),i}function bt(e,t){let i={type:"integer",format:"int64"};if(!e.checks)return i;for(let r of e.checks)switch(r.kind){case "min":t.target==="jsonSchema7"?r.inclusive?_(i,"minimum",r.value,r.message,t):_(i,"exclusiveMinimum",r.value,r.message,t):(r.inclusive||(i.exclusiveMinimum=true),_(i,"minimum",r.value,r.message,t));break;case "max":t.target==="jsonSchema7"?r.inclusive?_(i,"maximum",r.value,r.message,t):_(i,"exclusiveMaximum",r.value,r.message,t):(r.inclusive||(i.exclusiveMaximum=true),_(i,"maximum",r.value,r.message,t));break;case "multipleOf":_(i,"multipleOf",r.value,r.message,t);break}return i}function St(){return {type:"boolean"}}function _e(e,t){return g(e.type._def,t)}var Et=(e,t)=>g(e.innerType._def,t);function Ze(e,t,i){let r=i??t.dateStrategy;if(Array.isArray(r))return {anyOf:r.map((s,a)=>Ze(e,t,s))};switch(r){case "string":case "format:date-time":return {type:"string",format:"date-time"};case "format:date":return {type:"string",format:"date"};case "integer":return Wi(e,t)}}var Wi=(e,t)=>{let i={type:"integer",format:"unix-time"};if(t.target==="openApi3")return i;for(let r of e.checks)switch(r.kind){case "min":_(i,"minimum",r.value,r.message,t);break;case "max":_(i,"maximum",r.value,r.message,t);break}return i};function _t(e,t){return {...g(e.innerType._def,t),default:e.defaultValue()}}function wt(e,t){return t.effectStrategy==="input"?g(e.schema._def,t):k(t)}function Pt(e){return {type:"string",enum:Array.from(e.values)}}var Zi=e=>"type"in e&&e.type==="string"?false:"allOf"in e;function kt(e,t){let i=[g(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),g(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(a=>!!a),r=t.target==="jsonSchema2019-09"?{unevaluatedProperties:false}:void 0,s=[];return i.forEach(a=>{if(Zi(a))s.push(...a.allOf),a.unevaluatedProperties===void 0&&(r=void 0);else {let o=a;if("additionalProperties"in a&&a.additionalProperties===false){let{additionalProperties:u,...c}=a;o=c;}else r=void 0;s.push(o);}}),s.length?{allOf:s,...r}:void 0}function At(e,t){let i=typeof e.value;return i!=="bigint"&&i!=="number"&&i!=="boolean"&&i!=="string"?{type:Array.isArray(e.value)?"array":"object"}:t.target==="openApi3"?{type:i==="bigint"?"integer":i,enum:[e.value]}:{type:i==="bigint"?"integer":i,const:e.value}}var $e,$={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>($e===void 0&&($e=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),$e),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function we(e,t){let i={type:"string"};if(e.checks)for(let r of e.checks)switch(r.kind){case "min":_(i,"minLength",typeof i.minLength=="number"?Math.max(i.minLength,r.value):r.value,r.message,t);break;case "max":_(i,"maxLength",typeof i.maxLength=="number"?Math.min(i.maxLength,r.value):r.value,r.message,t);break;case "email":switch(t.emailStrategy){case "format:email":q(i,"email",r.message,t);break;case "format:idn-email":q(i,"idn-email",r.message,t);break;case "pattern:zod":M(i,$.email,r.message,t);break}break;case "url":q(i,"uri",r.message,t);break;case "uuid":q(i,"uuid",r.message,t);break;case "regex":M(i,r.regex,r.message,t);break;case "cuid":M(i,$.cuid,r.message,t);break;case "cuid2":M(i,$.cuid2,r.message,t);break;case "startsWith":M(i,RegExp(`^${qe(r.value,t)}`),r.message,t);break;case "endsWith":M(i,RegExp(`${qe(r.value,t)}$`),r.message,t);break;case "datetime":q(i,"date-time",r.message,t);break;case "date":q(i,"date",r.message,t);break;case "time":q(i,"time",r.message,t);break;case "duration":q(i,"duration",r.message,t);break;case "length":_(i,"minLength",typeof i.minLength=="number"?Math.max(i.minLength,r.value):r.value,r.message,t),_(i,"maxLength",typeof i.maxLength=="number"?Math.min(i.maxLength,r.value):r.value,r.message,t);break;case "includes":{M(i,RegExp(qe(r.value,t)),r.message,t);break}case "ip":{r.version!=="v6"&&q(i,"ipv4",r.message,t),r.version!=="v4"&&q(i,"ipv6",r.message,t);break}case "base64url":M(i,$.base64url,r.message,t);break;case "jwt":M(i,$.jwt,r.message,t);break;case "cidr":{r.version!=="v6"&&M(i,$.ipv4Cidr,r.message,t),r.version!=="v4"&&M(i,$.ipv6Cidr,r.message,t);break}case "emoji":M(i,$.emoji(),r.message,t);break;case "ulid":{M(i,$.ulid,r.message,t);break}case "base64":{switch(t.base64Strategy){case "format:binary":{q(i,"binary",r.message,t);break}case "contentEncoding:base64":{_(i,"contentEncoding","base64",r.message,t);break}case "pattern:zod":{M(i,$.base64,r.message,t);break}}break}case "nanoid":M(i,$.nanoid,r.message,t);}return i}function qe(e,t){return t.patternStrategy==="escape"?qi(e):e}var $i=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function qi(e){let t="";for(let i=0;i<e.length;i++)$i.has(e[i])||(t+="\\"),t+=e[i];return t}function q(e,t,i,r){e.format||e.anyOf?.some(s=>s.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&r.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.anyOf.push({format:t,...i&&r.errorMessages&&{errorMessage:{format:i}}})):_(e,"format",t,i,r);}function M(e,t,i,r){e.pattern||e.allOf?.some(s=>s.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&r.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.allOf.push({pattern:Ct(t,r),...i&&r.errorMessages&&{errorMessage:{pattern:i}}})):_(e,"pattern",Ct(t,r),i,r);}function Ct(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let i={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},r=i.i?e.source.toLowerCase():e.source,s="",a=false,o=false,u=false;for(let c=0;c<r.length;c++){if(a){s+=r[c],a=false;continue}if(i.i){if(o){if(r[c].match(/[a-z]/)){u?(s+=r[c],s+=`${r[c-2]}-${r[c]}`.toUpperCase(),u=false):r[c+1]==="-"&&r[c+2]?.match(/[a-z]/)?(s+=r[c],u=true):s+=`${r[c]}${r[c].toUpperCase()}`;continue}}else if(r[c].match(/[a-z]/)){s+=`[${r[c]}${r[c].toUpperCase()}]`;continue}}if(i.m){if(r[c]==="^"){s+=`(^|(?<=[\r
|
|
1
|
+
import {b as b$1,a as a$3}from'./chunk-2MGFSIXN.js';import {a,b}from'./chunk-V5MKJT6S.js';import {a as a$2}from'./chunk-7I6YJS3C.js';import {a as a$1}from'./chunk-S6RJHZV2.js';import {Buffer}from'buffer';import Fi from'crypto';import*as Ui from'fs';import {createRequire}from'module';import Ee from'path';import {fileURLToPath,pathToFileURL}from'url';import*as Ht from'@grpc/grpc-js';import {Piscina,FixedQueue}from'piscina';var xt=Symbol("Let zodToJsonSchema decide on which parser to use");var gt={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:true,rejectedAdditionalProperties:false,definitionPath:"definitions",target:"jsonSchema7",strictUnions:false,definitions:{},errorMessages:false,markdownDescription:false,patternStrategy:"escape",applyRegexFlags:false,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},yt=e=>({...gt,...e});var vt=e=>{let t=yt(e),i=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return {...t,flags:{hasReferencedOpenAiAnyType:false},currentPath:i,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([r,s])=>[s._def,{def:s._def,path:[...t.basePath,t.definitionPath,r],jsonSchema:void 0}]))}};function $e(e,t,i,r){r?.errorMessages&&i&&(e.errorMessage={...e.errorMessage,[t]:i});}function _(e,t,i,r,s){e[t]=i,$e(e,t,r,s);}var Pe=(e,t)=>{let i=0;for(;i<e.length&&i<t.length&&e[i]===t[i];i++);return [(e.length-i).toString(),...t.slice(i)].join("/")};function C(e){if(e.target!=="openAi")return {};let t=[...e.basePath,e.definitionPath,e.openAiAnyTypeName];return e.flags.hasReferencedOpenAiAnyType=true,{$ref:e.$refStrategy==="relative"?Pe(t,e.currentPath):t.join("/")}}function bt(e,t){let i={type:"array"};return e.type?._def&&e.type?._def?.typeName!==a$3.ZodAny&&(i.items=g(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&_(i,"minItems",e.minLength.value,e.minLength.message,t),e.maxLength&&_(i,"maxItems",e.maxLength.value,e.maxLength.message,t),e.exactLength&&(_(i,"minItems",e.exactLength.value,e.exactLength.message,t),_(i,"maxItems",e.exactLength.value,e.exactLength.message,t)),i}function St(e,t){let i={type:"integer",format:"int64"};if(!e.checks)return i;for(let r of e.checks)switch(r.kind){case "min":t.target==="jsonSchema7"?r.inclusive?_(i,"minimum",r.value,r.message,t):_(i,"exclusiveMinimum",r.value,r.message,t):(r.inclusive||(i.exclusiveMinimum=true),_(i,"minimum",r.value,r.message,t));break;case "max":t.target==="jsonSchema7"?r.inclusive?_(i,"maximum",r.value,r.message,t):_(i,"exclusiveMaximum",r.value,r.message,t):(r.inclusive||(i.exclusiveMaximum=true),_(i,"maximum",r.value,r.message,t));break;case "multipleOf":_(i,"multipleOf",r.value,r.message,t);break}return i}function Et(){return {type:"boolean"}}function ke(e,t){return g(e.type._def,t)}var _t=(e,t)=>g(e.innerType._def,t);function qe(e,t,i){let r=i??t.dateStrategy;if(Array.isArray(r))return {anyOf:r.map((s,a)=>qe(e,t,s))};switch(r){case "string":case "format:date-time":return {type:"string",format:"date-time"};case "format:date":return {type:"string",format:"date"};case "integer":return Wi(e,t)}}var Wi=(e,t)=>{let i={type:"integer",format:"unix-time"};if(t.target==="openApi3")return i;for(let r of e.checks)switch(r.kind){case "min":_(i,"minimum",r.value,r.message,t);break;case "max":_(i,"maximum",r.value,r.message,t);break}return i};function wt(e,t){return {...g(e.innerType._def,t),default:e.defaultValue()}}function Pt(e,t){return t.effectStrategy==="input"?g(e.schema._def,t):C(t)}function kt(e){return {type:"string",enum:Array.from(e.values)}}var Zi=e=>"type"in e&&e.type==="string"?false:"allOf"in e;function At(e,t){let i=[g(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),g(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(a=>!!a),r=t.target==="jsonSchema2019-09"?{unevaluatedProperties:false}:void 0,s=[];return i.forEach(a=>{if(Zi(a))s.push(...a.allOf),a.unevaluatedProperties===void 0&&(r=void 0);else {let o=a;if("additionalProperties"in a&&a.additionalProperties===false){let{additionalProperties:u,...c}=a;o=c;}else r=void 0;s.push(o);}}),s.length?{allOf:s,...r}:void 0}function Ct(e,t){let i=typeof e.value;return i!=="bigint"&&i!=="number"&&i!=="boolean"&&i!=="string"?{type:Array.isArray(e.value)?"array":"object"}:t.target==="openApi3"?{type:i==="bigint"?"integer":i,enum:[e.value]}:{type:i==="bigint"?"integer":i,const:e.value}}var Ge,G={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(Ge===void 0&&(Ge=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Ge),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function Ae(e,t){let i={type:"string"};if(e.checks)for(let r of e.checks)switch(r.kind){case "min":_(i,"minLength",typeof i.minLength=="number"?Math.max(i.minLength,r.value):r.value,r.message,t);break;case "max":_(i,"maxLength",typeof i.maxLength=="number"?Math.min(i.maxLength,r.value):r.value,r.message,t);break;case "email":switch(t.emailStrategy){case "format:email":H(i,"email",r.message,t);break;case "format:idn-email":H(i,"idn-email",r.message,t);break;case "pattern:zod":M(i,G.email,r.message,t);break}break;case "url":H(i,"uri",r.message,t);break;case "uuid":H(i,"uuid",r.message,t);break;case "regex":M(i,r.regex,r.message,t);break;case "cuid":M(i,G.cuid,r.message,t);break;case "cuid2":M(i,G.cuid2,r.message,t);break;case "startsWith":M(i,RegExp(`^${He(r.value,t)}`),r.message,t);break;case "endsWith":M(i,RegExp(`${He(r.value,t)}$`),r.message,t);break;case "datetime":H(i,"date-time",r.message,t);break;case "date":H(i,"date",r.message,t);break;case "time":H(i,"time",r.message,t);break;case "duration":H(i,"duration",r.message,t);break;case "length":_(i,"minLength",typeof i.minLength=="number"?Math.max(i.minLength,r.value):r.value,r.message,t),_(i,"maxLength",typeof i.maxLength=="number"?Math.min(i.maxLength,r.value):r.value,r.message,t);break;case "includes":{M(i,RegExp(He(r.value,t)),r.message,t);break}case "ip":{r.version!=="v6"&&H(i,"ipv4",r.message,t),r.version!=="v4"&&H(i,"ipv6",r.message,t);break}case "base64url":M(i,G.base64url,r.message,t);break;case "jwt":M(i,G.jwt,r.message,t);break;case "cidr":{r.version!=="v6"&&M(i,G.ipv4Cidr,r.message,t),r.version!=="v4"&&M(i,G.ipv6Cidr,r.message,t);break}case "emoji":M(i,G.emoji(),r.message,t);break;case "ulid":{M(i,G.ulid,r.message,t);break}case "base64":{switch(t.base64Strategy){case "format:binary":{H(i,"binary",r.message,t);break}case "contentEncoding:base64":{_(i,"contentEncoding","base64",r.message,t);break}case "pattern:zod":{M(i,G.base64,r.message,t);break}}break}case "nanoid":M(i,G.nanoid,r.message,t);}return i}function He(e,t){return t.patternStrategy==="escape"?qi(e):e}var $i=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function qi(e){let t="";for(let i=0;i<e.length;i++)$i.has(e[i])||(t+="\\"),t+=e[i];return t}function H(e,t,i,r){e.format||e.anyOf?.some(s=>s.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&r.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.anyOf.push({format:t,...i&&r.errorMessages&&{errorMessage:{format:i}}})):_(e,"format",t,i,r);}function M(e,t,i,r){e.pattern||e.allOf?.some(s=>s.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&r.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.allOf.push({pattern:It(t,r),...i&&r.errorMessages&&{errorMessage:{pattern:i}}})):_(e,"pattern",It(t,r),i,r);}function It(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let i={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},r=i.i?e.source.toLowerCase():e.source,s="",a=false,o=false,u=false;for(let c=0;c<r.length;c++){if(a){s+=r[c],a=false;continue}if(i.i){if(o){if(r[c].match(/[a-z]/)){u?(s+=r[c],s+=`${r[c-2]}-${r[c]}`.toUpperCase(),u=false):r[c+1]==="-"&&r[c+2]?.match(/[a-z]/)?(s+=r[c],u=true):s+=`${r[c]}${r[c].toUpperCase()}`;continue}}else if(r[c].match(/[a-z]/)){s+=`[${r[c]}${r[c].toUpperCase()}]`;continue}}if(i.m){if(r[c]==="^"){s+=`(^|(?<=[\r
|
|
2
2
|
]))`;continue}else if(r[c]==="$"){s+=`($|(?=[\r
|
|
3
3
|
]))`;continue}}if(i.s&&r[c]==="."){s+=o?`${r[c]}\r
|
|
4
4
|
`:`[${r[c]}\r
|
|
5
|
-
]`;continue}s+=r[c],r[c]==="\\"?a=true:o&&r[c]==="]"?o=false:!o&&r[c]==="["&&(o=true);}try{new RegExp(s);}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return s}function Pe(e,t){if(t.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),t.target==="openApi3"&&e.keyType?._def.typeName===a$3.ZodEnum)return {type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((r,s)=>({...r,[s]:g(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",s]})??k(t)}),{}),additionalProperties:t.rejectedAdditionalProperties};let i={type:"object",additionalProperties:g(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??t.allowedAdditionalProperties};if(t.target==="openApi3")return i;if(e.keyType?._def.typeName===a$3.ZodString&&e.keyType._def.checks?.length){let{type:r,...s}=we(e.keyType._def,t);return {...i,propertyNames:s}}else {if(e.keyType?._def.typeName===a$3.ZodEnum)return {...i,propertyNames:{enum:e.keyType._def.values}};if(e.keyType?._def.typeName===a$3.ZodBranded&&e.keyType._def.type._def.typeName===a$3.ZodString&&e.keyType._def.type._def.checks?.length){let{type:r,...s}=_e(e.keyType._def,t);return {...i,propertyNames:s}}}return i}function It(e,t){if(t.mapStrategy==="record")return Pe(e,t);let i=g(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||k(t),r=g(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||k(t);return {type:"array",maxItems:125,items:{type:"array",items:[i,r],minItems:2,maxItems:2}}}function Tt(e){let t=e.values,r=Object.keys(e.values).filter(a=>typeof t[t[a]]!="number").map(a=>t[a]),s=Array.from(new Set(r.map(a=>typeof a)));return {type:s.length===1?s[0]==="string"?"string":"number":["string","number"],enum:r}}function Nt(e){return e.target==="openAi"?void 0:{not:k({...e,currentPath:[...e.currentPath,"not"]})}}function Rt(e){return e.target==="openApi3"?{enum:["null"],nullable:true}:{type:"null"}}var me={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function Ot(e,t){if(t.target==="openApi3")return Lt(e,t);let i=e.options instanceof Map?Array.from(e.options.values()):e.options;if(i.every(r=>r._def.typeName in me&&(!r._def.checks||!r._def.checks.length))){let r=i.reduce((s,a)=>{let o=me[a._def.typeName];return o&&!s.includes(o)?[...s,o]:s},[]);return {type:r.length>1?r:r[0]}}else if(i.every(r=>r._def.typeName==="ZodLiteral"&&!r.description)){let r=i.reduce((s,a)=>{let o=typeof a._def.value;switch(o){case "string":case "number":case "boolean":return [...s,o];case "bigint":return [...s,"integer"];case "object":if(a._def.value===null)return [...s,"null"];default:return s}},[]);if(r.length===i.length){let s=r.filter((a,o,u)=>u.indexOf(a)===o);return {type:s.length>1?s:s[0],enum:i.reduce((a,o)=>a.includes(o._def.value)?a:[...a,o._def.value],[])}}}else if(i.every(r=>r._def.typeName==="ZodEnum"))return {type:"string",enum:i.reduce((r,s)=>[...r,...s._def.values.filter(a=>!r.includes(a))],[])};return Lt(e,t)}var Lt=(e,t)=>{let i=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((r,s)=>g(r._def,{...t,currentPath:[...t.currentPath,"anyOf",`${s}`]})).filter(r=>!!r&&(!t.strictUnions||typeof r=="object"&&Object.keys(r).length>0));return i.length?{anyOf:i}:void 0};function Dt(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return t.target==="openApi3"?{type:me[e.innerType._def.typeName],nullable:true}:{type:[me[e.innerType._def.typeName],"null"]};if(t.target==="openApi3"){let r=g(e.innerType._def,{...t,currentPath:[...t.currentPath]});return r&&"$ref"in r?{allOf:[r],nullable:true}:r&&{...r,nullable:true}}let i=g(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return i&&{anyOf:[i,{type:"null"}]}}function Mt(e,t){let i={type:"number"};if(!e.checks)return i;for(let r of e.checks)switch(r.kind){case "int":i.type="integer",We(i,"type",r.message,t);break;case "min":t.target==="jsonSchema7"?r.inclusive?_(i,"minimum",r.value,r.message,t):_(i,"exclusiveMinimum",r.value,r.message,t):(r.inclusive||(i.exclusiveMinimum=true),_(i,"minimum",r.value,r.message,t));break;case "max":t.target==="jsonSchema7"?r.inclusive?_(i,"maximum",r.value,r.message,t):_(i,"exclusiveMaximum",r.value,r.message,t):(r.inclusive||(i.exclusiveMaximum=true),_(i,"maximum",r.value,r.message,t));break;case "multipleOf":_(i,"multipleOf",r.value,r.message,t);break}return i}function Vt(e,t){let i=t.target==="openAi",r={type:"object",properties:{}},s=[],a=e.shape();for(let u in a){let c=a[u];if(c===void 0||c._def===void 0)continue;let l=Hi(c);l&&i&&(c._def.typeName==="ZodOptional"&&(c=c._def.innerType),c.isNullable()||(c=c.nullable()),l=false);let p=g(c._def,{...t,currentPath:[...t.currentPath,"properties",u],propertyPath:[...t.currentPath,"properties",u]});p!==void 0&&(r.properties[u]=p,l||s.push(u));}s.length&&(r.required=s);let o=Gi(e,t);return o!==void 0&&(r.additionalProperties=o),r}function Gi(e,t){if(e.catchall._def.typeName!=="ZodNever")return g(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case "passthrough":return t.allowedAdditionalProperties;case "strict":return t.rejectedAdditionalProperties;case "strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function Hi(e){try{return e.isOptional()}catch{return true}}var Ft=(e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return g(e.innerType._def,t);let i=g(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return i?{anyOf:[{not:k(t)},i]}:k(t)};var jt=(e,t)=>{if(t.pipeStrategy==="input")return g(e.in._def,t);if(t.pipeStrategy==="output")return g(e.out._def,t);let i=g(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),r=g(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",i?"1":"0"]});return {allOf:[i,r].filter(s=>s!==void 0)}};function Bt(e,t){return g(e.type._def,t)}function Ut(e,t){let r={type:"array",uniqueItems:true,items:g(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&_(r,"minItems",e.minSize.value,e.minSize.message,t),e.maxSize&&_(r,"maxItems",e.maxSize.value,e.maxSize.message,t),r}function zt(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((i,r)=>g(i._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((i,r)=>r===void 0?i:[...i,r],[]),additionalItems:g(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((i,r)=>g(i._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((i,r)=>r===void 0?i:[...i,r],[])}}function Wt(e){return {not:k(e)}}function Zt(e){return k(e)}var $t=(e,t)=>g(e.innerType._def,t);var qt=(e,t,i)=>{switch(t){case a$3.ZodString:return we(e,i);case a$3.ZodNumber:return Mt(e,i);case a$3.ZodObject:return Vt(e,i);case a$3.ZodBigInt:return bt(e,i);case a$3.ZodBoolean:return St();case a$3.ZodDate:return Ze(e,i);case a$3.ZodUndefined:return Wt(i);case a$3.ZodNull:return Rt(i);case a$3.ZodArray:return vt(e,i);case a$3.ZodUnion:case a$3.ZodDiscriminatedUnion:return Ot(e,i);case a$3.ZodIntersection:return kt(e,i);case a$3.ZodTuple:return zt(e,i);case a$3.ZodRecord:return Pe(e,i);case a$3.ZodLiteral:return At(e,i);case a$3.ZodEnum:return Pt(e);case a$3.ZodNativeEnum:return Tt(e);case a$3.ZodNullable:return Dt(e,i);case a$3.ZodOptional:return Ft(e,i);case a$3.ZodMap:return It(e,i);case a$3.ZodSet:return Ut(e,i);case a$3.ZodLazy:return ()=>e.getter()._def;case a$3.ZodPromise:return Bt(e,i);case a$3.ZodNaN:case a$3.ZodNever:return Nt(i);case a$3.ZodEffects:return wt(e,i);case a$3.ZodAny:return k(i);case a$3.ZodUnknown:return Zt(i);case a$3.ZodDefault:return _t(e,i);case a$3.ZodBranded:return _e(e,i);case a$3.ZodReadonly:return $t(e,i);case a$3.ZodCatch:return Et(e,i);case a$3.ZodPipeline:return jt(e,i);case a$3.ZodFunction:case a$3.ZodVoid:case a$3.ZodSymbol:return;default:return (r=>{})()}};function g(e,t,i=false){let r=t.seen.get(e);if(t.override){let u=t.override?.(e,t,r,i);if(u!==gt)return u}if(r&&!i){let u=Ki(r,t);if(u!==void 0)return u}let s={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,s);let a=qt(e,e.typeName,t),o=typeof a=="function"?g(a(),t):a;if(o&&Qi(e,t,o),t.postProcess){let u=t.postProcess(o,e,t);return s.jsonSchema=o,u}return s.jsonSchema=o,o}var Ki=(e,t)=>{switch(t.$refStrategy){case "root":return {$ref:e.path.join("/")};case "relative":return {$ref:Ee(t.currentPath,e.path)};case "none":case "seen":return e.path.length<t.currentPath.length&&e.path.every((i,r)=>t.currentPath[r]===i)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),k(t)):t.$refStrategy==="seen"?k(t):void 0}},Qi=(e,t,i)=>(e.description&&(i.description=e.description,t.markdownDescription&&(i.markdownDescription=e.description)),i);var Ge=(e,t)=>{let i=yt(t),r=void 0,s=t?.name,a=g(e._def,i,false)??k(i);i.flags.hasReferencedOpenAiAnyType&&(r||(r={}),r[i.openAiAnyTypeName]||(r[i.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:i.$refStrategy==="relative"?"1":[...i.basePath,i.definitionPath,i.openAiAnyTypeName].join("/")}}));let u=s===void 0?r?{...a,[i.definitionPath]:r}:a:{$ref:[...i.$refStrategy==="relative"?[]:i.basePath,i.definitionPath,s].join("/"),[i.definitionPath]:{...r,[s]:a}};return i.target==="jsonSchema7"?u.$schema="http://json-schema.org/draft-07/schema#":(i.target==="jsonSchema2019-09"||i.target==="openAi")&&(u.$schema="https://json-schema.org/draft/2019-09/schema#"),i.target==="openAi"&&("anyOf"in u||"oneOf"in u||"allOf"in u||"type"in u&&Array.isArray(u.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),u};var Yi={"grpc.keepalive_time_ms":3e4,"grpc.keepalive_timeout_ms":1e4,"grpc.keepalive_permit_without_calls":1,"grpc.max_send_message_length":-1,"grpc.max_receive_message_length":-1,"grpc.enable_retries":1},ke=class{server;constructor(){this.server=new Gt.Server(Yi);}addService(t){this.server.addService(a.LogicMesh.service,{NegotiateIntent:t.negotiateIntent,ExecuteLogic:t.executeLogic});}async listen(t=50051,i){let r=b(i);return new Promise((s,a)=>{this.server.bindAsync(`0.0.0.0:${t}`,r,(o,u)=>{if(o){a(o);return}a$1.info(`[LIOP-RPC] Server listening on port ${u}`),s(u);});})}async stop(){return new Promise(t=>{this.server.tryShutdown(()=>{a$1.info("[LIOP-RPC] Server shut down"),t();});})}};var Ji=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],Xt=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],Xi="\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",ei="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",He={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},Ke="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",er={5:Ke,"5module":Ke+" export import",6:Ke+" const class extends export import super"},ti=/^in(stanceof)?$/,tr=new RegExp("["+ei+"]"),ir=new RegExp("["+ei+Xi+"]");function Ye(e,t){for(var i=65536,r=0;r<t.length;r+=2){if(i+=t[r],i>e)return false;if(i+=t[r+1],i>=e)return true}return false}function H(e,t){return e<65?e===36:e<91?true:e<97?e===95:e<123?true:e<=65535?e>=170&&tr.test(String.fromCharCode(e)):t===false?false:Ye(e,Xt)}function re(e,t){return e<48?e===36:e<58?true:e<65?false:e<91?true:e<97?e===95:e<123?true:e<=65535?e>=170&&ir.test(String.fromCharCode(e)):t===false?false:Ye(e,Xt)||Ye(e,Ji)}var P=function(t,i){i===void 0&&(i={}),this.label=t,this.keyword=i.keyword,this.beforeExpr=!!i.beforeExpr,this.startsExpr=!!i.startsExpr,this.isLoop=!!i.isLoop,this.isAssign=!!i.isAssign,this.prefix=!!i.prefix,this.postfix=!!i.postfix,this.binop=i.binop||null,this.updateContext=null;};function B(e,t){return new P(e,{beforeExpr:true,binop:t})}var U={beforeExpr:true},F={startsExpr:true},tt={};function w(e,t){return t===void 0&&(t={}),t.keyword=e,tt[e]=new P(e,t)}var n={num:new P("num",F),regexp:new P("regexp",F),string:new P("string",F),name:new P("name",F),privateId:new P("privateId",F),eof:new P("eof"),bracketL:new P("[",{beforeExpr:true,startsExpr:true}),bracketR:new P("]"),braceL:new P("{",{beforeExpr:true,startsExpr:true}),braceR:new P("}"),parenL:new P("(",{beforeExpr:true,startsExpr:true}),parenR:new P(")"),comma:new P(",",U),semi:new P(";",U),colon:new P(":",U),dot:new P("."),question:new P("?",U),questionDot:new P("?."),arrow:new P("=>",U),template:new P("template"),invalidTemplate:new P("invalidTemplate"),ellipsis:new P("...",U),backQuote:new P("`",F),dollarBraceL:new P("${",{beforeExpr:true,startsExpr:true}),eq:new P("=",{beforeExpr:true,isAssign:true}),assign:new P("_=",{beforeExpr:true,isAssign:true}),incDec:new P("++/--",{prefix:true,postfix:true,startsExpr:true}),prefix:new P("!/~",{beforeExpr:true,prefix:true,startsExpr:true}),logicalOR:B("||",1),logicalAND:B("&&",2),bitwiseOR:B("|",3),bitwiseXOR:B("^",4),bitwiseAND:B("&",5),equality:B("==/!=/===/!==",6),relational:B("</>/<=/>=",7),bitShift:B("<</>>/>>>",8),plusMin:new P("+/-",{beforeExpr:true,binop:9,prefix:true,startsExpr:true}),modulo:B("%",10),star:B("*",10),slash:B("/",10),starstar:new P("**",{beforeExpr:true}),coalesce:B("??",1),_break:w("break"),_case:w("case",U),_catch:w("catch"),_continue:w("continue"),_debugger:w("debugger"),_default:w("default",U),_do:w("do",{isLoop:true,beforeExpr:true}),_else:w("else",U),_finally:w("finally"),_for:w("for",{isLoop:true}),_function:w("function",F),_if:w("if"),_return:w("return",U),_switch:w("switch"),_throw:w("throw",U),_try:w("try"),_var:w("var"),_const:w("const"),_while:w("while",{isLoop:true}),_with:w("with"),_new:w("new",{beforeExpr:true,startsExpr:true}),_this:w("this",F),_super:w("super",F),_class:w("class",F),_extends:w("extends",U),_export:w("export"),_import:w("import",F),_null:w("null",F),_true:w("true",F),_false:w("false",F),_in:w("in",{beforeExpr:true,binop:7}),_instanceof:w("instanceof",{beforeExpr:true,binop:7}),_typeof:w("typeof",{beforeExpr:true,prefix:true,startsExpr:true}),_void:w("void",{beforeExpr:true,prefix:true,startsExpr:true}),_delete:w("delete",{beforeExpr:true,prefix:true,startsExpr:true})},j=/\r\n?|\n|\u2028|\u2029/,rr=new RegExp(j.source,"g");function le(e){return e===10||e===13||e===8232||e===8233}function ii(e,t,i){i===void 0&&(i=e.length);for(var r=t;r<i;r++){var s=e.charCodeAt(r);if(le(s))return r<i-1&&s===13&&e.charCodeAt(r+1)===10?r+2:r+1}return -1}var ri=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,O=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,si=Object.prototype,sr=si.hasOwnProperty,ar=si.toString,pe=Object.hasOwn||(function(e,t){return sr.call(e,t)}),Ht=Array.isArray||(function(e){return ar.call(e)==="[object Array]"}),Kt=Object.create(null);function ie(e){return Kt[e]||(Kt[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function J(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var nr=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,xe=function(t,i){this.line=t,this.column=i;};xe.prototype.offset=function(t){return new xe(this.line,this.column+t)};var Re=function(t,i,r){this.start=i,this.end=r,t.sourceFile!==null&&(this.source=t.sourceFile);};function ai(e,t){for(var i=1,r=0;;){var s=ii(e,r,t);if(s<0)return new xe(i,t-r);++i,r=s;}}var Je={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:false,allowImportExportEverywhere:false,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:false,checkPrivateFields:true,locations:false,onToken:null,onComment:null,ranges:false,program:null,sourceFile:null,directSourceFile:null,preserveParens:false},Qt=false;function or(e){var t={};for(var i in Je)t[i]=e&&pe(e,i)?e[i]:Je[i];if(t.ecmaVersion==="latest"?t.ecmaVersion=1e8:t.ecmaVersion==null?(!Qt&&typeof console=="object"&&console.warn&&(Qt=true,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
6
|
-
Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved==null&&(t.allowReserved=t.ecmaVersion<5),(!e||e.allowHashBang==null)&&(t.allowHashBang=t.ecmaVersion>=14),
|
|
7
|
-
`,r-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(j).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=n.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=true,this.inModule=t.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=false,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&t.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(this.options.sourceType==="commonjs"?oe:ne),this.regexpState=null,this.privateNameStack=[];},W={inFunction:{configurable:true},inGenerator:{configurable:true},inAsync:{configurable:true},canAwait:{configurable:true},allowReturn:{configurable:true},allowSuper:{configurable:true},allowDirectSuper:{configurable:true},treatFunctionsAsVar:{configurable:true},allowNewDotTarget:{configurable:true},allowUsing:{configurable:true},inClassStaticBlock:{configurable:true}};N.prototype.parse=function(){var t=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(t)};W.inFunction.get=function(){return (this.currentVarScope().flags&oe)>0};W.inGenerator.get=function(){return (this.currentVarScope().flags&ni)>0};W.inAsync.get=function(){return (this.currentVarScope().flags&it)>0};W.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e],i=t.flags;if(i&(ue|ye))return false;if(i&oe)return (i&it)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};W.allowReturn.get=function(){return !!(this.inFunction||this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&ne)};W.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags;return (t&Le)>0||this.options.allowSuperOutsideMethod};W.allowDirectSuper.get=function(){return (this.currentThisScope().flags&ui)>0};W.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};W.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e],i=t.flags;if(i&(ue|ye)||i&oe&&!(i&rt))return true}return false};W.allowUsing.get=function(){var e=this.currentScope(),t=e.flags;return !(t&ci||!this.inModule&&t&ne)};W.inClassStaticBlock.get=function(){return (this.currentVarScope().flags&ue)>0};N.extend=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];for(var r=this,s=0;s<t.length;s++)r=t[s](r);return r};N.parse=function(t,i){return new this(i,t).parse()};N.parseExpressionAt=function(t,i,r){var s=new this(r,t,i);return s.nextToken(),s.parseExpression()};N.tokenizer=function(t,i){return new this(i,t)};Object.defineProperties(N.prototype,W);var V=N.prototype,cr=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;V.strictDirective=function(e){if(this.options.ecmaVersion<5)return false;for(;;){O.lastIndex=e,e+=O.exec(this.input)[0].length;var t=cr.exec(this.input.slice(e));if(!t)return false;if((t[1]||t[2])==="use strict"){O.lastIndex=e+t[0].length;var i=O.exec(this.input),r=i.index+i[0].length,s=this.input.charAt(r);return s===";"||s==="}"||j.test(i[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(s)||s==="!"&&this.input.charAt(r+1)==="=")}e+=t[0].length,O.lastIndex=e,e+=O.exec(this.input)[0].length,this.input[e]===";"&&e++;}};V.eat=function(e){return this.type===e?(this.next(),true):false};V.isContextual=function(e){return this.type===n.name&&this.value===e&&!this.containsEsc};V.eatContextual=function(e){return this.isContextual(e)?(this.next(),true):false};V.expectContextual=function(e){this.eatContextual(e)||this.unexpected();};V.canInsertSemicolon=function(){return this.type===n.eof||this.type===n.braceR||j.test(this.input.slice(this.lastTokEnd,this.start))};V.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),true};V.semicolon=function(){!this.eat(n.semi)&&!this.insertSemicolon()&&this.unexpected();};V.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),true};V.expect=function(e){this.eat(e)||this.unexpected();};V.unexpected=function(e){this.raise(e??this.start,"Unexpected token");};var De=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1;};V.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var i=t?e.parenthesizedAssign:e.parenthesizedBind;i>-1&&this.raiseRecoverable(i,t?"Assigning to rvalue":"Parenthesized pattern");}};V.checkExpressionErrors=function(e,t){if(!e)return false;var i=e.shorthandAssign,r=e.doubleProto;if(!t)return i>=0||r>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),r>=0&&this.raiseRecoverable(r,"Redefinition of __proto__ property");};V.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value");};V.isSimpleAssignTarget=function(e){return e.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(e.expression):e.type==="Identifier"||e.type==="MemberExpression"};var d=N.prototype;d.parseTopLevel=function(e){var t=Object.create(null);for(e.body||(e.body=[]);this.type!==n.eof;){var i=this.parseStatement(null,true,t);e.body.push(i);}if(this.inModule)for(var r=0,s=Object.keys(this.undefinedExports);r<s.length;r+=1){var a=s[r];this.raiseRecoverable(this.undefinedExports[a].start,"Export '"+a+"' is not defined");}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType==="commonjs"?"script":this.options.sourceType,this.finishNode(e,"Program")};var nt={kind:"loop"},lr={kind:"switch"};d.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return false;O.lastIndex=this.pos;var t=O.exec(this.input),i=this.pos+t[0].length,r=this.fullCharCodeAt(i);if(r===91||r===92)return true;if(e)return false;if(r===123)return true;if(H(r)){var s=i;do i+=r<=65535?1:2;while(re(r=this.fullCharCodeAt(i)));if(r===92)return true;var a=this.input.slice(s,i);if(!ti.test(a))return true}return false};d.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return false;O.lastIndex=this.pos;var e=O.exec(this.input),t=this.pos+e[0].length,i;return !j.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)==="function"&&(t+8===this.input.length||!(re(i=this.fullCharCodeAt(t+8))||i===92))};d.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?"await":"using"))return false;O.lastIndex=this.pos;var i=O.exec(this.input),r=this.pos+i[0].length;if(j.test(this.input.slice(this.pos,r)))return false;if(e){var s=r+5,a;if(this.input.slice(r,s)!=="using"||s===this.input.length||re(a=this.fullCharCodeAt(s))||a===92)return false;O.lastIndex=s;var o=O.exec(this.input);if(r=s+o[0].length,o&&j.test(this.input.slice(s,r)))return false}var u=this.fullCharCodeAt(r);if(!H(u)&&u!==92)return false;var c=r;do r+=u<=65535?1:2;while(re(u=this.fullCharCodeAt(r)));if(u===92)return true;var l=this.input.slice(c,r);return !(ti.test(l)||t&&l==="of")};d.isAwaitUsing=function(e){return this.isUsingKeyword(true,e)};d.isUsing=function(e){return this.isUsingKeyword(false,e)};d.parseStatement=function(e,t,i){var r=this.type,s=this.startNode(),a;switch(this.isLet(e)&&(r=n._var,a="let"),r){case n._break:case n._continue:return this.parseBreakContinueStatement(s,r.keyword);case n._debugger:return this.parseDebuggerStatement(s);case n._do:return this.parseDoStatement(s);case n._for:return this.parseForStatement(s);case n._function:return e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(s,false,!e);case n._class:return e&&this.unexpected(),this.parseClass(s,true);case n._if:return this.parseIfStatement(s);case n._return:return this.parseReturnStatement(s);case n._switch:return this.parseSwitchStatement(s);case n._throw:return this.parseThrowStatement(s);case n._try:return this.parseTryStatement(s);case n._const:case n._var:return a=a||this.value,e&&a!=="var"&&this.unexpected(),this.parseVarStatement(s,a);case n._while:return this.parseWhileStatement(s);case n._with:return this.parseWithStatement(s);case n.braceL:return this.parseBlock(true,s);case n.semi:return this.parseEmptyStatement(s);case n._export:case n._import:if(this.options.ecmaVersion>10&&r===n._import){O.lastIndex=this.pos;var o=O.exec(this.input),u=this.pos+o[0].length,c=this.input.charCodeAt(u);if(c===40||c===46)return this.parseExpressionStatement(s,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),r===n._import?this.parseImport(s):this.parseExport(s,i);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(s,true,!e);var l=this.isAwaitUsing(false)?"await using":this.isUsing(false)?"using":null;if(l)return this.allowUsing||this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement"),l==="await using"&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.next(),this.parseVar(s,false,l),this.semicolon(),this.finishNode(s,"VariableDeclaration");var p=this.value,m=this.parseExpression();return r===n.name&&m.type==="Identifier"&&this.eat(n.colon)?this.parseLabeledStatement(s,p,m,e):this.parseExpressionStatement(s,m)}};d.parseBreakContinueStatement=function(e,t){var i=t==="break";this.next(),this.eat(n.semi)||this.insertSemicolon()?e.label=null:this.type!==n.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var r=0;r<this.labels.length;++r){var s=this.labels[r];if((e.label==null||s.name===e.label.name)&&(s.kind!=null&&(i||s.kind==="loop")||e.label&&i))break}return r===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,i?"BreakStatement":"ContinueStatement")};d.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")};d.parseDoStatement=function(e){return this.next(),this.labels.push(nt),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(n._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(n.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")};d.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(nt),this.enterScope(0),this.expect(n.parenL),this.type===n.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var i=this.isLet();if(this.type===n._var||this.type===n._const||i){var r=this.startNode(),s=i?"let":this.value;return this.next(),this.parseVar(r,true,s),this.finishNode(r,"VariableDeclaration"),this.parseForAfterInit(e,r,t)}var a=this.isContextual("let"),o=false,u=this.isUsing(true)?"using":this.isAwaitUsing(true)?"await using":null;if(u){var c=this.startNode();return this.next(),u==="await using"&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.parseVar(c,true,u),this.finishNode(c,"VariableDeclaration"),this.parseForAfterInit(e,c,t)}var l=this.containsEsc,p=new De,m=this.start,S=t>-1?this.parseExprSubscripts(p,"await"):this.parseExpression(true,p);return this.type===n._in||(o=this.options.ecmaVersion>=6&&this.isContextual("of"))?(t>-1?(this.type===n._in&&this.unexpected(t),e.await=true):o&&this.options.ecmaVersion>=8&&(S.start===m&&!l&&S.type==="Identifier"&&S.name==="async"?this.unexpected():this.options.ecmaVersion>=9&&(e.await=false)),a&&o&&this.raise(S.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(S,false,p),this.checkLValPattern(S),this.parseForIn(e,S)):(this.checkExpressionErrors(p,true),t>-1&&this.unexpected(t),this.parseFor(e,S))};d.parseForAfterInit=function(e,t,i){return (this.type===n._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&t.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===n._in?i>-1&&this.unexpected(i):e.await=i>-1),this.parseForIn(e,t)):(i>-1&&this.unexpected(i),this.parseFor(e,t))};d.parseFunctionStatement=function(e,t,i){return this.next(),this.parseFunction(e,ge|(i?0:Xe),false,t)};d.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(n._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")};d.parseReturnStatement=function(e){return this.allowReturn||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(n.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")};d.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(n.braceL),this.labels.push(lr),this.enterScope(ci);for(var t,i=false;this.type!==n.braceR;)if(this.type===n._case||this.type===n._default){var r=this.type===n._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r?t.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=true,t.test=null),this.expect(n.colon);}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")};d.parseThrowStatement=function(e){return this.next(),j.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var pr=[];d.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type==="Identifier";return this.enterScope(t?oi:0),this.checkLValPattern(e,t?pi:ee),this.expect(n.parenR),e};d.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===n._catch){var t=this.startNode();this.next(),this.eat(n.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(false),this.exitScope(),e.handler=this.finishNode(t,"CatchClause");}return e.finalizer=this.eat(n._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")};d.parseVarStatement=function(e,t,i){return this.next(),this.parseVar(e,false,t,i),this.semicolon(),this.finishNode(e,"VariableDeclaration")};d.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(nt),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")};d.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")};d.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")};d.parseLabeledStatement=function(e,t,i,r){for(var s=0,a=this.labels;s<a.length;s+=1){var o=a[s];o.name===t&&this.raise(i.start,"Label '"+t+"' is already declared");}for(var u=this.type.isLoop?"loop":this.type===n._switch?"switch":null,c=this.labels.length-1;c>=0;c--){var l=this.labels[c];if(l.statementStart===e.start)l.statementStart=this.start,l.kind=u;else break}return this.labels.push({name:t,kind:u,statementStart:this.start}),e.body=this.parseStatement(r?r.indexOf("label")===-1?r+"label":r:"label"),this.labels.pop(),e.label=i,this.finishNode(e,"LabeledStatement")};d.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")};d.parseBlock=function(e,t,i){for(e===void 0&&(e=true),t===void 0&&(t=this.startNode()),t.body=[],this.expect(n.braceL),e&&this.enterScope(0);this.type!==n.braceR;){var r=this.parseStatement(null);t.body.push(r);}return i&&(this.strict=false),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")};d.parseFor=function(e,t){return e.init=t,this.expect(n.semi),e.test=this.type===n.semi?null:this.parseExpression(),this.expect(n.semi),e.update=this.type===n.parenR?null:this.parseExpression(),this.expect(n.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")};d.parseForIn=function(e,t){var i=this.type===n._in;return this.next(),t.type==="VariableDeclaration"&&t.declarations[0].init!=null&&(!i||this.options.ecmaVersion<8||this.strict||t.kind!=="var"||t.declarations[0].id.type!=="Identifier")&&this.raise(t.start,(i?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=t,e.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(n.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,i?"ForInStatement":"ForOfStatement")};d.parseVar=function(e,t,i,r){for(e.declarations=[],e.kind=i;;){var s=this.startNode();if(this.parseVarId(s,i),this.eat(n.eq)?s.init=this.parseMaybeAssign(t):!r&&i==="const"&&!(this.type===n._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!r&&(i==="using"||i==="await using")&&this.options.ecmaVersion>=17&&this.type!==n._in&&!this.isContextual("of")?this.raise(this.lastTokEnd,"Missing initializer in "+i+" declaration"):!r&&s.id.type!=="Identifier"&&!(t&&(this.type===n._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):s.init=null,e.declarations.push(this.finishNode(s,"VariableDeclarator")),!this.eat(n.comma))break}return e};d.parseVarId=function(e,t){e.id=t==="using"||t==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,t==="var"?at:ee,false);};var ge=1,Xe=2,fi=4;d.parseFunction=function(e,t,i,r,s){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===n.star&&t&Xe&&this.unexpected(),e.generator=this.eat(n.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&ge&&(e.id=t&fi&&this.type!==n.name?null:this.parseIdent(),e.id&&!(t&Xe)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?at:ee:li));var a=this.yieldPos,o=this.awaitPos,u=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(st(e.async,e.generator)),t&ge||(e.id=this.type===n.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,i,false,s),this.yieldPos=a,this.awaitPos=o,this.awaitIdentPos=u,this.finishNode(e,t&ge?"FunctionDeclaration":"FunctionExpression")};d.parseFunctionParams=function(e){this.expect(n.parenL),e.params=this.parseBindingList(n.parenR,false,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams();};d.parseClass=function(e,t){this.next();var i=this.strict;this.strict=true,this.parseClassId(e,t),this.parseClassSuper(e);var r=this.enterClassBody(),s=this.startNode(),a=false;for(s.body=[],this.expect(n.braceL);this.type!==n.braceR;){var o=this.parseClassElement(e.superClass!==null);o&&(s.body.push(o),o.type==="MethodDefinition"&&o.kind==="constructor"?(a&&this.raiseRecoverable(o.start,"Duplicate constructor in the same class"),a=true):o.key&&o.key.type==="PrivateIdentifier"&&hr(r,o)&&this.raiseRecoverable(o.key.start,"Identifier '#"+o.key.name+"' has already been declared"));}return this.strict=i,this.next(),e.body=this.finishNode(s,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")};d.parseClassElement=function(e){if(this.eat(n.semi))return null;var t=this.options.ecmaVersion,i=this.startNode(),r="",s=false,a=false,o="method",u=false;if(this.eatContextual("static")){if(t>=13&&this.eat(n.braceL))return this.parseClassStaticBlock(i),i;this.isClassElementNameStart()||this.type===n.star?u=true:r="static";}if(i.static=u,!r&&t>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===n.star)&&!this.canInsertSemicolon()?a=true:r="async"),!r&&(t>=9||!a)&&this.eat(n.star)&&(s=true),!r&&!a&&!s){var c=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?o=c:r=c);}if(r?(i.computed=false,i.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),i.key.name=r,this.finishNode(i.key,"Identifier")):this.parseClassElementName(i),t<13||this.type===n.parenL||o!=="method"||s||a){var l=!i.static&&Ie(i,"constructor"),p=l&&e;l&&o!=="method"&&this.raise(i.key.start,"Constructor can't have get/set modifier"),i.kind=l?"constructor":o,this.parseClassMethod(i,s,a,p);}else this.parseClassField(i);return i};d.isClassElementNameStart=function(){return this.type===n.name||this.type===n.privateId||this.type===n.num||this.type===n.string||this.type===n.bracketL||this.type.keyword};d.parseClassElementName=function(e){this.type===n.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=false,e.key=this.parsePrivateIdent()):this.parsePropertyName(e);};d.parseClassMethod=function(e,t,i,r){var s=e.key;e.kind==="constructor"?(t&&this.raise(s.start,"Constructor can't be a generator"),i&&this.raise(s.start,"Constructor can't be an async method")):e.static&&Ie(e,"prototype")&&this.raise(s.start,"Classes may not have a static property named prototype");var a=e.value=this.parseMethod(t,i,r);return e.kind==="get"&&a.params.length!==0&&this.raiseRecoverable(a.start,"getter should have no params"),e.kind==="set"&&a.params.length!==1&&this.raiseRecoverable(a.start,"setter should have exactly one param"),e.kind==="set"&&a.params[0].type==="RestElement"&&this.raiseRecoverable(a.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")};d.parseClassField=function(e){return Ie(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&Ie(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(n.eq)?(this.enterScope(ye|Le),e.value=this.parseMaybeAssign(),this.exitScope()):e.value=null,this.semicolon(),this.finishNode(e,"PropertyDefinition")};d.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(ue|Le);this.type!==n.braceR;){var i=this.parseStatement(null);e.body.push(i);}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")};d.parseClassId=function(e,t){this.type===n.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,ee,false)):(t===true&&this.unexpected(),e.id=null);};d.parseClassSuper=function(e){e.superClass=this.eat(n._extends)?this.parseExprSubscripts(null,false):null;};d.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared};d.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,i=e.used;if(this.options.checkPrivateFields)for(var r=this.privateNameStack.length,s=r===0?null:this.privateNameStack[r-1],a=0;a<i.length;++a){var o=i[a];pe(t,o.name)||(s?s.used.push(o):this.raiseRecoverable(o.start,"Private field '#"+o.name+"' must be declared in an enclosing class"));}};function hr(e,t){var i=t.key.name,r=e[i],s="true";return t.type==="MethodDefinition"&&(t.kind==="get"||t.kind==="set")&&(s=(t.static?"s":"i")+t.kind),r==="iget"&&s==="iset"||r==="iset"&&s==="iget"||r==="sget"&&s==="sset"||r==="sset"&&s==="sget"?(e[i]="true",false):r?true:(e[i]=s,false)}function Ie(e,t){var i=e.computed,r=e.key;return !i&&(r.type==="Identifier"&&r.name===t||r.type==="Literal"&&r.value===t)}d.parseExportAllDeclaration=function(e,t){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==n.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")};d.parseExport=function(e,t){if(this.next(),this.eat(n.star))return this.parseExportAllDeclaration(e,t);if(this.eat(n._default))return this.checkExport(t,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type==="VariableDeclaration"?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[]);else {if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==n.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else {for(var i=0,r=e.specifiers;i<r.length;i+=1){var s=r[i];this.checkUnreserved(s.local),this.checkLocalExport(s.local),s.local.type==="Literal"&&this.raise(s.local.start,"A string literal cannot be used as an exported binding without `from`.");}e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[]);}this.semicolon();}return this.finishNode(e,"ExportNamedDeclaration")};d.parseExportDeclaration=function(e){return this.parseStatement(null)};d.parseExportDefaultDeclaration=function(){var e;if(this.type===n._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,ge|fi,false,e)}else if(this.type===n._class){var i=this.startNode();return this.parseClass(i,"nullableID")}else {var r=this.parseMaybeAssign();return this.semicolon(),r}};d.checkExport=function(e,t,i){e&&(typeof t!="string"&&(t=t.type==="Identifier"?t.name:t.value),pe(e,t)&&this.raiseRecoverable(i,"Duplicate export '"+t+"'"),e[t]=true);};d.checkPatternExport=function(e,t){var i=t.type;if(i==="Identifier")this.checkExport(e,t,t.start);else if(i==="ObjectPattern")for(var r=0,s=t.properties;r<s.length;r+=1){var a=s[r];this.checkPatternExport(e,a);}else if(i==="ArrayPattern")for(var o=0,u=t.elements;o<u.length;o+=1){var c=u[o];c&&this.checkPatternExport(e,c);}else i==="Property"?this.checkPatternExport(e,t.value):i==="AssignmentPattern"?this.checkPatternExport(e,t.left):i==="RestElement"&&this.checkPatternExport(e,t.argument);};d.checkVariableExport=function(e,t){if(e)for(var i=0,r=t;i<r.length;i+=1){var s=r[i];this.checkPatternExport(e,s.id);}};d.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};d.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual("as")?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,"ExportSpecifier")};d.parseExportSpecifiers=function(e){var t=[],i=true;for(this.expect(n.braceL);!this.eat(n.braceR);){if(i)i=false;else if(this.expect(n.comma),this.afterTrailingComma(n.braceR))break;t.push(this.parseExportSpecifier(e));}return t};d.parseImport=function(e){return this.next(),this.type===n.string?(e.specifiers=pr,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===n.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ImportDeclaration")};d.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual("as")?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,ee),this.finishNode(e,"ImportSpecifier")};d.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,ee),this.finishNode(e,"ImportDefaultSpecifier")};d.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual("as"),e.local=this.parseIdent(),this.checkLValSimple(e.local,ee),this.finishNode(e,"ImportNamespaceSpecifier")};d.parseImportSpecifiers=function(){var e=[],t=true;if(this.type===n.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(n.comma)))return e;if(this.type===n.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(n.braceL);!this.eat(n.braceR);){if(t)t=false;else if(this.expect(n.comma),this.afterTrailingComma(n.braceR))break;e.push(this.parseImportSpecifier());}return e};d.parseWithClause=function(){var e=[];if(!this.eat(n._with))return e;this.expect(n.braceL);for(var t={},i=true;!this.eat(n.braceR);){if(i)i=false;else if(this.expect(n.comma),this.afterTrailingComma(n.braceR))break;var r=this.parseImportAttribute(),s=r.key.type==="Identifier"?r.key.name:r.key.value;pe(t,s)&&this.raiseRecoverable(r.key.start,"Duplicate attribute key '"+s+"'"),t[s]=true,e.push(r);}return e};d.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===n.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(n.colon),this.type!==n.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,"ImportAttribute")};d.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===n.string){var e=this.parseLiteral(this.value);return nr.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(true)};d.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1);};d.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var Z=N.prototype;Z.toAssignable=function(e,t,i){if(this.options.ecmaVersion>=6&&e)switch(e.type){case "Identifier":this.inAsync&&e.name==="await"&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case "ObjectPattern":case "ArrayPattern":case "AssignmentPattern":case "RestElement":break;case "ObjectExpression":e.type="ObjectPattern",i&&this.checkPatternErrors(i,true);for(var r=0,s=e.properties;r<s.length;r+=1){var a=s[r];this.toAssignable(a,t),a.type==="RestElement"&&(a.argument.type==="ArrayPattern"||a.argument.type==="ObjectPattern")&&this.raise(a.argument.start,"Unexpected token");}break;case "Property":e.kind!=="init"&&this.raise(e.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(e.value,t);break;case "ArrayExpression":e.type="ArrayPattern",i&&this.checkPatternErrors(i,true),this.toAssignableList(e.elements,t);break;case "SpreadElement":e.type="RestElement",this.toAssignable(e.argument,t),e.argument.type==="AssignmentPattern"&&this.raise(e.argument.start,"Rest elements cannot have a default value");break;case "AssignmentExpression":e.operator!=="="&&this.raise(e.left.end,"Only '=' operator can be used for specifying default value."),e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,t);break;case "ParenthesizedExpression":this.toAssignable(e.expression,t,i);break;case "ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case "MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue");}else i&&this.checkPatternErrors(i,true);return e};Z.toAssignableList=function(e,t){for(var i=e.length,r=0;r<i;r++){var s=e[r];s&&this.toAssignable(s,t);}if(i){var a=e[i-1];this.options.ecmaVersion===6&&t&&a&&a.type==="RestElement"&&a.argument.type!=="Identifier"&&this.unexpected(a.argument.start);}return e};Z.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(false,e),this.finishNode(t,"SpreadElement")};Z.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==n.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")};Z.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case n.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(n.bracketR,true,true),this.finishNode(e,"ArrayPattern");case n.braceL:return this.parseObj(true)}return this.parseIdent()};Z.parseBindingList=function(e,t,i,r){for(var s=[],a=true;!this.eat(e);)if(a?a=false:this.expect(n.comma),t&&this.type===n.comma)s.push(null);else {if(i&&this.afterTrailingComma(e))break;if(this.type===n.ellipsis){var o=this.parseRestBinding();this.parseBindingListItem(o),s.push(o),this.type===n.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(e);break}else s.push(this.parseAssignableListItem(r));}return s};Z.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t};Z.parseBindingListItem=function(e){return e};Z.parseMaybeDefault=function(e,t,i){if(i=i||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(n.eq))return i;var r=this.startNodeAt(e,t);return r.left=i,r.right=this.parseMaybeAssign(),this.finishNode(r,"AssignmentPattern")};Z.checkLValSimple=function(e,t,i){t===void 0&&(t=Ce);var r=t!==Ce;switch(e.type){case "Identifier":this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(r?"Binding ":"Assigning to ")+e.name+" in strict mode"),r&&(t===ee&&e.name==="let"&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),i&&(pe(i,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),i[e.name]=true),t!==hi&&this.declareName(e.name,t,e.start));break;case "ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case "MemberExpression":r&&this.raiseRecoverable(e.start,"Binding member expression");break;case "ParenthesizedExpression":return r&&this.raiseRecoverable(e.start,"Binding parenthesized expression"),this.checkLValSimple(e.expression,t,i);default:this.raise(e.start,(r?"Binding":"Assigning to")+" rvalue");}};Z.checkLValPattern=function(e,t,i){switch(t===void 0&&(t=Ce),e.type){case "ObjectPattern":for(var r=0,s=e.properties;r<s.length;r+=1){var a=s[r];this.checkLValInnerPattern(a,t,i);}break;case "ArrayPattern":for(var o=0,u=e.elements;o<u.length;o+=1){var c=u[o];c&&this.checkLValInnerPattern(c,t,i);}break;default:this.checkLValSimple(e,t,i);}};Z.checkLValInnerPattern=function(e,t,i){switch(t===void 0&&(t=Ce),e.type){case "Property":this.checkLValInnerPattern(e.value,t,i);break;case "AssignmentPattern":this.checkLValPattern(e.left,t,i);break;case "RestElement":this.checkLValPattern(e.argument,t,i);break;default:this.checkLValPattern(e,t,i);}};var G=function(t,i,r,s,a){this.token=t,this.isExpr=!!i,this.preserveSpace=!!r,this.override=s,this.generator=!!a;},A={b_stat:new G("{",false),b_expr:new G("{",true),b_tmpl:new G("${",false),p_stat:new G("(",false),p_expr:new G("(",true),q_tmpl:new G("`",true,true,function(e){return e.tryReadTemplateToken()}),f_stat:new G("function",false),f_expr:new G("function",true),f_expr_gen:new G("function",true,false,null,true),f_gen:new G("function",false,false,null,true)},he=N.prototype;he.initialContext=function(){return [A.b_stat]};he.curContext=function(){return this.context[this.context.length-1]};he.braceIsBlock=function(e){var t=this.curContext();return t===A.f_expr||t===A.f_stat?true:e===n.colon&&(t===A.b_stat||t===A.b_expr)?!t.isExpr:e===n._return||e===n.name&&this.exprAllowed?j.test(this.input.slice(this.lastTokEnd,this.start)):e===n._else||e===n.semi||e===n.eof||e===n.parenR||e===n.arrow?true:e===n.braceL?t===A.b_stat:e===n._var||e===n._const||e===n.name?false:!this.exprAllowed};he.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token==="function")return t.generator}return false};he.updateContext=function(e){var t,i=this.type;i.keyword&&e===n.dot?this.exprAllowed=false:(t=i.updateContext)?t.call(this,e):this.exprAllowed=i.beforeExpr;};he.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e);};n.parenR.updateContext=n.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=true;return}var e=this.context.pop();e===A.b_stat&&this.curContext().token==="function"&&(e=this.context.pop()),this.exprAllowed=!e.isExpr;};n.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?A.b_stat:A.b_expr),this.exprAllowed=true;};n.dollarBraceL.updateContext=function(){this.context.push(A.b_tmpl),this.exprAllowed=true;};n.parenL.updateContext=function(e){var t=e===n._if||e===n._for||e===n._with||e===n._while;this.context.push(t?A.p_stat:A.p_expr),this.exprAllowed=true;};n.incDec.updateContext=function(){};n._function.updateContext=n._class.updateContext=function(e){e.beforeExpr&&e!==n._else&&!(e===n.semi&&this.curContext()!==A.p_stat)&&!(e===n._return&&j.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===n.colon||e===n.braceL)&&this.curContext()===A.b_stat)?this.context.push(A.f_expr):this.context.push(A.f_stat),this.exprAllowed=false;};n.colon.updateContext=function(){this.curContext().token==="function"&&this.context.pop(),this.exprAllowed=true;};n.backQuote.updateContext=function(){this.curContext()===A.q_tmpl?this.context.pop():this.context.push(A.q_tmpl),this.exprAllowed=false;};n.star.updateContext=function(e){if(e===n._function){var t=this.context.length-1;this.context[t]===A.f_expr?this.context[t]=A.f_expr_gen:this.context[t]=A.f_gen;}this.exprAllowed=true;};n.name.updateContext=function(e){var t=false;this.options.ecmaVersion>=6&&e!==n.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(t=true),this.exprAllowed=t;};var x=N.prototype;x.checkPropClash=function(e,t,i){if(!(this.options.ecmaVersion>=9&&e.type==="SpreadElement")&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var r=e.key,s;switch(r.type){case "Identifier":s=r.name;break;case "Literal":s=String(r.value);break;default:return}var a=e.kind;if(this.options.ecmaVersion>=6){s==="__proto__"&&a==="init"&&(t.proto&&(i?i.doubleProto<0&&(i.doubleProto=r.start):this.raiseRecoverable(r.start,"Redefinition of __proto__ property")),t.proto=true);return}s="$"+s;var o=t[s];if(o){var u;a==="init"?u=this.strict&&o.init||o.get||o.set:u=o.init||o[a],u&&this.raiseRecoverable(r.start,"Redefinition of property");}else o=t[s]={init:false,get:false,set:false};o[a]=true;}};x.parseExpression=function(e,t){var i=this.start,r=this.startLoc,s=this.parseMaybeAssign(e,t);if(this.type===n.comma){var a=this.startNodeAt(i,r);for(a.expressions=[s];this.eat(n.comma);)a.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(a,"SequenceExpression")}return s};x.parseMaybeAssign=function(e,t,i){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=false;}var r=false,s=-1,a=-1,o=-1;t?(s=t.parenthesizedAssign,a=t.trailingComma,o=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new De,r=true);var u=this.start,c=this.startLoc;(this.type===n.parenL||this.type===n.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e==="await");var l=this.parseMaybeConditional(e,t);if(i&&(l=i.call(this,l,u,c)),this.type.isAssign){var p=this.startNodeAt(u,c);return p.operator=this.value,this.type===n.eq&&(l=this.toAssignable(l,false,t)),r||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=l.start&&(t.shorthandAssign=-1),this.type===n.eq?this.checkLValPattern(l):this.checkLValSimple(l),p.left=l,this.next(),p.right=this.parseMaybeAssign(e),o>-1&&(t.doubleProto=o),this.finishNode(p,"AssignmentExpression")}else r&&this.checkExpressionErrors(t,true);return s>-1&&(t.parenthesizedAssign=s),a>-1&&(t.trailingComma=a),l};x.parseMaybeConditional=function(e,t){var i=this.start,r=this.startLoc,s=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return s;if(this.eat(n.question)){var a=this.startNodeAt(i,r);return a.test=s,a.consequent=this.parseMaybeAssign(),this.expect(n.colon),a.alternate=this.parseMaybeAssign(e),this.finishNode(a,"ConditionalExpression")}return s};x.parseExprOps=function(e,t){var i=this.start,r=this.startLoc,s=this.parseMaybeUnary(t,false,false,e);return this.checkExpressionErrors(t)||s.start===i&&s.type==="ArrowFunctionExpression"?s:this.parseExprOp(s,i,r,-1,e)};x.parseExprOp=function(e,t,i,r,s){var a=this.type.binop;if(a!=null&&(!s||this.type!==n._in)&&a>r){var o=this.type===n.logicalOR||this.type===n.logicalAND,u=this.type===n.coalesce;u&&(a=n.logicalAND.binop);var c=this.value;this.next();var l=this.start,p=this.startLoc,m=this.parseExprOp(this.parseMaybeUnary(null,false,false,s),l,p,a,s),S=this.buildBinary(t,i,e,m,c,o||u);return (o&&this.type===n.coalesce||u&&(this.type===n.logicalOR||this.type===n.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(S,t,i,r,s)}return e};x.buildBinary=function(e,t,i,r,s,a){r.type==="PrivateIdentifier"&&this.raise(r.start,"Private identifier can only be left side of binary expression");var o=this.startNodeAt(e,t);return o.left=i,o.operator=s,o.right=r,this.finishNode(o,a?"LogicalExpression":"BinaryExpression")};x.parseMaybeUnary=function(e,t,i,r){var s=this.start,a=this.startLoc,o;if(this.isContextual("await")&&this.canAwait)o=this.parseAwait(r),t=true;else if(this.type.prefix){var u=this.startNode(),c=this.type===n.incDec;u.operator=this.value,u.prefix=true,this.next(),u.argument=this.parseMaybeUnary(null,true,c,r),this.checkExpressionErrors(e,true),c?this.checkLValSimple(u.argument):this.strict&&u.operator==="delete"&&di(u.argument)?this.raiseRecoverable(u.start,"Deleting local variable in strict mode"):u.operator==="delete"&&et(u.argument)?this.raiseRecoverable(u.start,"Private fields can not be deleted"):t=true,o=this.finishNode(u,c?"UpdateExpression":"UnaryExpression");}else if(!t&&this.type===n.privateId)(r||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),o=this.parsePrivateIdent(),this.type!==n._in&&this.unexpected();else {if(o=this.parseExprSubscripts(e,r),this.checkExpressionErrors(e))return o;for(;this.type.postfix&&!this.canInsertSemicolon();){var l=this.startNodeAt(s,a);l.operator=this.value,l.prefix=false,l.argument=o,this.checkLValSimple(o),this.next(),o=this.finishNode(l,"UpdateExpression");}}if(!i&&this.eat(n.starstar))if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(s,a,o,this.parseMaybeUnary(null,false,false,r),"**",false);else return o};function di(e){return e.type==="Identifier"||e.type==="ParenthesizedExpression"&&di(e.expression)}function et(e){return e.type==="MemberExpression"&&e.property.type==="PrivateIdentifier"||e.type==="ChainExpression"&&et(e.expression)||e.type==="ParenthesizedExpression"&&et(e.expression)}x.parseExprSubscripts=function(e,t){var i=this.start,r=this.startLoc,s=this.parseExprAtom(e,t);if(s.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return s;var a=this.parseSubscripts(s,i,r,false,t);return e&&a.type==="MemberExpression"&&(e.parenthesizedAssign>=a.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=a.start&&(e.parenthesizedBind=-1),e.trailingComma>=a.start&&(e.trailingComma=-1)),a};x.parseSubscripts=function(e,t,i,r,s){for(var a=this.options.ecmaVersion>=8&&e.type==="Identifier"&&e.name==="async"&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,o=false;;){var u=this.parseSubscript(e,t,i,r,a,o,s);if(u.optional&&(o=true),u===e||u.type==="ArrowFunctionExpression"){if(o){var c=this.startNodeAt(t,i);c.expression=u,u=this.finishNode(c,"ChainExpression");}return u}e=u;}};x.shouldParseAsyncArrow=function(){return !this.canInsertSemicolon()&&this.eat(n.arrow)};x.parseSubscriptAsyncArrow=function(e,t,i,r){return this.parseArrowExpression(this.startNodeAt(e,t),i,true,r)};x.parseSubscript=function(e,t,i,r,s,a,o){var u=this.options.ecmaVersion>=11,c=u&&this.eat(n.questionDot);r&&c&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var l=this.eat(n.bracketL);if(l||c&&this.type!==n.parenL&&this.type!==n.backQuote||this.eat(n.dot)){var p=this.startNodeAt(t,i);p.object=e,l?(p.property=this.parseExpression(),this.expect(n.bracketR)):this.type===n.privateId&&e.type!=="Super"?p.property=this.parsePrivateIdent():p.property=this.parseIdent(this.options.allowReserved!=="never"),p.computed=!!l,u&&(p.optional=c),e=this.finishNode(p,"MemberExpression");}else if(!r&&this.eat(n.parenL)){var m=new De,S=this.yieldPos,C=this.awaitPos,I=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var D=this.parseExprList(n.parenR,this.options.ecmaVersion>=8,false,m);if(s&&!c&&this.shouldParseAsyncArrow())return this.checkPatternErrors(m,false),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=S,this.awaitPos=C,this.awaitIdentPos=I,this.parseSubscriptAsyncArrow(t,i,D,o);this.checkExpressionErrors(m,true),this.yieldPos=S||this.yieldPos,this.awaitPos=C||this.awaitPos,this.awaitIdentPos=I||this.awaitIdentPos;var T=this.startNodeAt(t,i);T.callee=e,T.arguments=D,u&&(T.optional=c),e=this.finishNode(T,"CallExpression");}else if(this.type===n.backQuote){(c||a)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var Y=this.startNodeAt(t,i);Y.tag=e,Y.quasi=this.parseTemplate({isTagged:true}),e=this.finishNode(Y,"TaggedTemplateExpression");}return e};x.parseExprAtom=function(e,t,i){this.type===n.slash&&this.readRegexp();var r,s=this.potentialArrowAt===this.start;switch(this.type){case n._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),r=this.startNode(),this.next(),this.type===n.parenL&&!this.allowDirectSuper&&this.raise(r.start,"super() call outside constructor of a subclass"),this.type!==n.dot&&this.type!==n.bracketL&&this.type!==n.parenL&&this.unexpected(),this.finishNode(r,"Super");case n._this:return r=this.startNode(),this.next(),this.finishNode(r,"ThisExpression");case n.name:var a=this.start,o=this.startLoc,u=this.containsEsc,c=this.parseIdent(false);if(this.options.ecmaVersion>=8&&!u&&c.name==="async"&&!this.canInsertSemicolon()&&this.eat(n._function))return this.overrideContext(A.f_expr),this.parseFunction(this.startNodeAt(a,o),0,false,true,t);if(s&&!this.canInsertSemicolon()){if(this.eat(n.arrow))return this.parseArrowExpression(this.startNodeAt(a,o),[c],false,t);if(this.options.ecmaVersion>=8&&c.name==="async"&&this.type===n.name&&!u&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return c=this.parseIdent(false),(this.canInsertSemicolon()||!this.eat(n.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(a,o),[c],true,t)}return c;case n.regexp:var l=this.value;return r=this.parseLiteral(l.value),r.regex={pattern:l.pattern,flags:l.flags},r;case n.num:case n.string:return this.parseLiteral(this.value);case n._null:case n._true:case n._false:return r=this.startNode(),r.value=this.type===n._null?null:this.type===n._true,r.raw=this.type.keyword,this.next(),this.finishNode(r,"Literal");case n.parenL:var p=this.start,m=this.parseParenAndDistinguishExpression(s,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(m)&&(e.parenthesizedAssign=p),e.parenthesizedBind<0&&(e.parenthesizedBind=p)),m;case n.bracketL:return r=this.startNode(),this.next(),r.elements=this.parseExprList(n.bracketR,true,true,e),this.finishNode(r,"ArrayExpression");case n.braceL:return this.overrideContext(A.b_expr),this.parseObj(false,e);case n._function:return r=this.startNode(),this.next(),this.parseFunction(r,0);case n._class:return this.parseClass(this.startNode(),false);case n._new:return this.parseNew();case n.backQuote:return this.parseTemplate();case n._import:return this.options.ecmaVersion>=11?this.parseExprImport(i):this.unexpected();default:return this.parseExprAtomDefault()}};x.parseExprAtomDefault=function(){this.unexpected();};x.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===n.parenL&&!e)return this.parseDynamicImport(t);if(this.type===n.dot){var i=this.startNodeAt(t.start,t.loc&&t.loc.start);return i.name="import",t.meta=this.finishNode(i,"Identifier"),this.parseImportMeta(t)}else this.unexpected();};x.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(n.parenR)?e.options=null:(this.expect(n.comma),this.afterTrailingComma(n.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(n.parenR)||(this.expect(n.comma),this.afterTrailingComma(n.parenR)||this.unexpected())));else if(!this.eat(n.parenR)){var t=this.start;this.eat(n.comma)&&this.eat(n.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t);}return this.finishNode(e,"ImportExpression")};x.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(true),e.property.name!=="meta"&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")};x.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.value!=null?t.value.toString():t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")};x.parseParenExpression=function(){this.expect(n.parenL);var e=this.parseExpression();return this.expect(n.parenR),e};x.shouldParseArrow=function(e){return !this.canInsertSemicolon()};x.parseParenAndDistinguishExpression=function(e,t){var i=this.start,r=this.startLoc,s,a=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var o=this.start,u=this.startLoc,c=[],l=true,p=false,m=new De,S=this.yieldPos,C=this.awaitPos,I;for(this.yieldPos=0,this.awaitPos=0;this.type!==n.parenR;)if(l?l=false:this.expect(n.comma),a&&this.afterTrailingComma(n.parenR,true)){p=true;break}else if(this.type===n.ellipsis){I=this.start,c.push(this.parseParenItem(this.parseRestBinding())),this.type===n.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else c.push(this.parseMaybeAssign(false,m,this.parseParenItem));var D=this.lastTokEnd,T=this.lastTokEndLoc;if(this.expect(n.parenR),e&&this.shouldParseArrow(c)&&this.eat(n.arrow))return this.checkPatternErrors(m,false),this.checkYieldAwaitInDefaultParams(),this.yieldPos=S,this.awaitPos=C,this.parseParenArrowList(i,r,c,t);(!c.length||p)&&this.unexpected(this.lastTokStart),I&&this.unexpected(I),this.checkExpressionErrors(m,true),this.yieldPos=S||this.yieldPos,this.awaitPos=C||this.awaitPos,c.length>1?(s=this.startNodeAt(o,u),s.expressions=c,this.finishNodeAt(s,"SequenceExpression",D,T)):s=c[0];}else s=this.parseParenExpression();if(this.options.preserveParens){var Y=this.startNodeAt(i,r);return Y.expression=s,this.finishNode(Y,"ParenthesizedExpression")}else return s};x.parseParenItem=function(e){return e};x.parseParenArrowList=function(e,t,i,r){return this.parseArrowExpression(this.startNodeAt(e,t),i,false,r)};var fr=[];x.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===n.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name="new",e.meta=this.finishNode(t,"Identifier"),this.next();var i=this.containsEsc;return e.property=this.parseIdent(true),e.property.name!=="target"&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),i&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var r=this.start,s=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,false,true),r,s,true,false),this.eat(n.parenL)?e.arguments=this.parseExprList(n.parenR,this.options.ecmaVersion>=8,false):e.arguments=fr,this.finishNode(e,"NewExpression")};x.parseTemplateElement=function(e){var t=e.isTagged,i=this.startNode();return this.type===n.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),i.value={raw:this.value.replace(/\r\n?/g,`
|
|
5
|
+
]`;continue}s+=r[c],r[c]==="\\"?a=true:o&&r[c]==="]"?o=false:!o&&r[c]==="["&&(o=true);}try{new RegExp(s);}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return s}function Ce(e,t){if(t.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),t.target==="openApi3"&&e.keyType?._def.typeName===a$3.ZodEnum)return {type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((r,s)=>({...r,[s]:g(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",s]})??C(t)}),{}),additionalProperties:t.rejectedAdditionalProperties};let i={type:"object",additionalProperties:g(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??t.allowedAdditionalProperties};if(t.target==="openApi3")return i;if(e.keyType?._def.typeName===a$3.ZodString&&e.keyType._def.checks?.length){let{type:r,...s}=Ae(e.keyType._def,t);return {...i,propertyNames:s}}else {if(e.keyType?._def.typeName===a$3.ZodEnum)return {...i,propertyNames:{enum:e.keyType._def.values}};if(e.keyType?._def.typeName===a$3.ZodBranded&&e.keyType._def.type._def.typeName===a$3.ZodString&&e.keyType._def.type._def.checks?.length){let{type:r,...s}=ke(e.keyType._def,t);return {...i,propertyNames:s}}}return i}function Tt(e,t){if(t.mapStrategy==="record")return Ce(e,t);let i=g(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||C(t),r=g(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||C(t);return {type:"array",maxItems:125,items:{type:"array",items:[i,r],minItems:2,maxItems:2}}}function Nt(e){let t=e.values,r=Object.keys(e.values).filter(a=>typeof t[t[a]]!="number").map(a=>t[a]),s=Array.from(new Set(r.map(a=>typeof a)));return {type:s.length===1?s[0]==="string"?"string":"number":["string","number"],enum:r}}function Rt(e){return e.target==="openAi"?void 0:{not:C({...e,currentPath:[...e.currentPath,"not"]})}}function Lt(e){return e.target==="openApi3"?{enum:["null"],nullable:true}:{type:"null"}}var xe={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function Dt(e,t){if(t.target==="openApi3")return Ot(e,t);let i=e.options instanceof Map?Array.from(e.options.values()):e.options;if(i.every(r=>r._def.typeName in xe&&(!r._def.checks||!r._def.checks.length))){let r=i.reduce((s,a)=>{let o=xe[a._def.typeName];return o&&!s.includes(o)?[...s,o]:s},[]);return {type:r.length>1?r:r[0]}}else if(i.every(r=>r._def.typeName==="ZodLiteral"&&!r.description)){let r=i.reduce((s,a)=>{let o=typeof a._def.value;switch(o){case "string":case "number":case "boolean":return [...s,o];case "bigint":return [...s,"integer"];case "object":if(a._def.value===null)return [...s,"null"];default:return s}},[]);if(r.length===i.length){let s=r.filter((a,o,u)=>u.indexOf(a)===o);return {type:s.length>1?s:s[0],enum:i.reduce((a,o)=>a.includes(o._def.value)?a:[...a,o._def.value],[])}}}else if(i.every(r=>r._def.typeName==="ZodEnum"))return {type:"string",enum:i.reduce((r,s)=>[...r,...s._def.values.filter(a=>!r.includes(a))],[])};return Ot(e,t)}var Ot=(e,t)=>{let i=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((r,s)=>g(r._def,{...t,currentPath:[...t.currentPath,"anyOf",`${s}`]})).filter(r=>!!r&&(!t.strictUnions||typeof r=="object"&&Object.keys(r).length>0));return i.length?{anyOf:i}:void 0};function Mt(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return t.target==="openApi3"?{type:xe[e.innerType._def.typeName],nullable:true}:{type:[xe[e.innerType._def.typeName],"null"]};if(t.target==="openApi3"){let r=g(e.innerType._def,{...t,currentPath:[...t.currentPath]});return r&&"$ref"in r?{allOf:[r],nullable:true}:r&&{...r,nullable:true}}let i=g(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return i&&{anyOf:[i,{type:"null"}]}}function Vt(e,t){let i={type:"number"};if(!e.checks)return i;for(let r of e.checks)switch(r.kind){case "int":i.type="integer",$e(i,"type",r.message,t);break;case "min":t.target==="jsonSchema7"?r.inclusive?_(i,"minimum",r.value,r.message,t):_(i,"exclusiveMinimum",r.value,r.message,t):(r.inclusive||(i.exclusiveMinimum=true),_(i,"minimum",r.value,r.message,t));break;case "max":t.target==="jsonSchema7"?r.inclusive?_(i,"maximum",r.value,r.message,t):_(i,"exclusiveMaximum",r.value,r.message,t):(r.inclusive||(i.exclusiveMaximum=true),_(i,"maximum",r.value,r.message,t));break;case "multipleOf":_(i,"multipleOf",r.value,r.message,t);break}return i}function Ft(e,t){let i=t.target==="openAi",r={type:"object",properties:{}},s=[],a=e.shape();for(let u in a){let c=a[u];if(c===void 0||c._def===void 0)continue;let l=Hi(c);l&&i&&(c._def.typeName==="ZodOptional"&&(c=c._def.innerType),c.isNullable()||(c=c.nullable()),l=false);let p=g(c._def,{...t,currentPath:[...t.currentPath,"properties",u],propertyPath:[...t.currentPath,"properties",u]});p!==void 0&&(r.properties[u]=p,l||s.push(u));}s.length&&(r.required=s);let o=Gi(e,t);return o!==void 0&&(r.additionalProperties=o),r}function Gi(e,t){if(e.catchall._def.typeName!=="ZodNever")return g(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case "passthrough":return t.allowedAdditionalProperties;case "strict":return t.rejectedAdditionalProperties;case "strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function Hi(e){try{return e.isOptional()}catch{return true}}var jt=(e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return g(e.innerType._def,t);let i=g(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return i?{anyOf:[{not:C(t)},i]}:C(t)};var Bt=(e,t)=>{if(t.pipeStrategy==="input")return g(e.in._def,t);if(t.pipeStrategy==="output")return g(e.out._def,t);let i=g(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),r=g(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",i?"1":"0"]});return {allOf:[i,r].filter(s=>s!==void 0)}};function Ut(e,t){return g(e.type._def,t)}function zt(e,t){let r={type:"array",uniqueItems:true,items:g(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&_(r,"minItems",e.minSize.value,e.minSize.message,t),e.maxSize&&_(r,"maxItems",e.maxSize.value,e.maxSize.message,t),r}function Wt(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((i,r)=>g(i._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((i,r)=>r===void 0?i:[...i,r],[]),additionalItems:g(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((i,r)=>g(i._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((i,r)=>r===void 0?i:[...i,r],[])}}function Zt(e){return {not:C(e)}}function $t(e){return C(e)}var qt=(e,t)=>g(e.innerType._def,t);var Gt=(e,t,i)=>{switch(t){case a$3.ZodString:return Ae(e,i);case a$3.ZodNumber:return Vt(e,i);case a$3.ZodObject:return Ft(e,i);case a$3.ZodBigInt:return St(e,i);case a$3.ZodBoolean:return Et();case a$3.ZodDate:return qe(e,i);case a$3.ZodUndefined:return Zt(i);case a$3.ZodNull:return Lt(i);case a$3.ZodArray:return bt(e,i);case a$3.ZodUnion:case a$3.ZodDiscriminatedUnion:return Dt(e,i);case a$3.ZodIntersection:return At(e,i);case a$3.ZodTuple:return Wt(e,i);case a$3.ZodRecord:return Ce(e,i);case a$3.ZodLiteral:return Ct(e,i);case a$3.ZodEnum:return kt(e);case a$3.ZodNativeEnum:return Nt(e);case a$3.ZodNullable:return Mt(e,i);case a$3.ZodOptional:return jt(e,i);case a$3.ZodMap:return Tt(e,i);case a$3.ZodSet:return zt(e,i);case a$3.ZodLazy:return ()=>e.getter()._def;case a$3.ZodPromise:return Ut(e,i);case a$3.ZodNaN:case a$3.ZodNever:return Rt(i);case a$3.ZodEffects:return Pt(e,i);case a$3.ZodAny:return C(i);case a$3.ZodUnknown:return $t(i);case a$3.ZodDefault:return wt(e,i);case a$3.ZodBranded:return ke(e,i);case a$3.ZodReadonly:return qt(e,i);case a$3.ZodCatch:return _t(e,i);case a$3.ZodPipeline:return Bt(e,i);case a$3.ZodFunction:case a$3.ZodVoid:case a$3.ZodSymbol:return;default:return (r=>{})()}};function g(e,t,i=false){let r=t.seen.get(e);if(t.override){let u=t.override?.(e,t,r,i);if(u!==xt)return u}if(r&&!i){let u=Ki(r,t);if(u!==void 0)return u}let s={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,s);let a=Gt(e,e.typeName,t),o=typeof a=="function"?g(a(),t):a;if(o&&Qi(e,t,o),t.postProcess){let u=t.postProcess(o,e,t);return s.jsonSchema=o,u}return s.jsonSchema=o,o}var Ki=(e,t)=>{switch(t.$refStrategy){case "root":return {$ref:e.path.join("/")};case "relative":return {$ref:Pe(t.currentPath,e.path)};case "none":case "seen":return e.path.length<t.currentPath.length&&e.path.every((i,r)=>t.currentPath[r]===i)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),C(t)):t.$refStrategy==="seen"?C(t):void 0}},Qi=(e,t,i)=>(e.description&&(i.description=e.description,t.markdownDescription&&(i.markdownDescription=e.description)),i);var Ke=(e,t)=>{let i=vt(t),r=void 0,s=t?.name,a=g(e._def,i,false)??C(i);i.flags.hasReferencedOpenAiAnyType&&(r||(r={}),r[i.openAiAnyTypeName]||(r[i.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:i.$refStrategy==="relative"?"1":[...i.basePath,i.definitionPath,i.openAiAnyTypeName].join("/")}}));let u=s===void 0?r?{...a,[i.definitionPath]:r}:a:{$ref:[...i.$refStrategy==="relative"?[]:i.basePath,i.definitionPath,s].join("/"),[i.definitionPath]:{...r,[s]:a}};return i.target==="jsonSchema7"?u.$schema="http://json-schema.org/draft-07/schema#":(i.target==="jsonSchema2019-09"||i.target==="openAi")&&(u.$schema="https://json-schema.org/draft/2019-09/schema#"),i.target==="openAi"&&("anyOf"in u||"oneOf"in u||"allOf"in u||"type"in u&&Array.isArray(u.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),u};var Yi={"grpc.keepalive_time_ms":3e4,"grpc.keepalive_timeout_ms":1e4,"grpc.keepalive_permit_without_calls":1,"grpc.max_send_message_length":-1,"grpc.max_receive_message_length":-1,"grpc.enable_retries":1},Ie=class{server;constructor(){this.server=new Ht.Server(Yi);}addService(t){this.server.addService(a.LogicMesh.service,{NegotiateIntent:t.negotiateIntent,ExecuteLogic:t.executeLogic});}async listen(t=50051,i){let r=b(i);return new Promise((s,a)=>{this.server.bindAsync(`0.0.0.0:${t}`,r,(o,u)=>{if(o){a(o);return}a$1.info(`[LIOP-RPC] Server listening on port ${u}`),s(u);});})}async stop(){return new Promise(t=>{this.server.tryShutdown(()=>{a$1.info("[LIOP-RPC] Server shut down"),t();});})}};var Ji=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],ei=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],Xi="\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",ti="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",Qe={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},Ye="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",er={5:Ye,"5module":Ye+" export import",6:Ye+" const class extends export import super"},ii=/^in(stanceof)?$/,tr=new RegExp("["+ti+"]"),ir=new RegExp("["+ti+Xi+"]");function Xe(e,t){for(var i=65536,r=0;r<t.length;r+=2){if(i+=t[r],i>e)return false;if(i+=t[r+1],i>=e)return true}return false}function Y(e,t){return e<65?e===36:e<91?true:e<97?e===95:e<123?true:e<=65535?e>=170&&tr.test(String.fromCharCode(e)):t===false?false:Xe(e,ei)}function se(e,t){return e<48?e===36:e<58?true:e<65?false:e<91?true:e<97?e===95:e<123?true:e<=65535?e>=170&&ir.test(String.fromCharCode(e)):t===false?false:Xe(e,ei)||Xe(e,Ji)}var P=function(t,i){i===void 0&&(i={}),this.label=t,this.keyword=i.keyword,this.beforeExpr=!!i.beforeExpr,this.startsExpr=!!i.startsExpr,this.isLoop=!!i.isLoop,this.isAssign=!!i.isAssign,this.prefix=!!i.prefix,this.postfix=!!i.postfix,this.binop=i.binop||null,this.updateContext=null;};function U(e,t){return new P(e,{beforeExpr:true,binop:t})}var z={beforeExpr:true},F={startsExpr:true},rt={};function w(e,t){return t===void 0&&(t={}),t.keyword=e,rt[e]=new P(e,t)}var n={num:new P("num",F),regexp:new P("regexp",F),string:new P("string",F),name:new P("name",F),privateId:new P("privateId",F),eof:new P("eof"),bracketL:new P("[",{beforeExpr:true,startsExpr:true}),bracketR:new P("]"),braceL:new P("{",{beforeExpr:true,startsExpr:true}),braceR:new P("}"),parenL:new P("(",{beforeExpr:true,startsExpr:true}),parenR:new P(")"),comma:new P(",",z),semi:new P(";",z),colon:new P(":",z),dot:new P("."),question:new P("?",z),questionDot:new P("?."),arrow:new P("=>",z),template:new P("template"),invalidTemplate:new P("invalidTemplate"),ellipsis:new P("...",z),backQuote:new P("`",F),dollarBraceL:new P("${",{beforeExpr:true,startsExpr:true}),eq:new P("=",{beforeExpr:true,isAssign:true}),assign:new P("_=",{beforeExpr:true,isAssign:true}),incDec:new P("++/--",{prefix:true,postfix:true,startsExpr:true}),prefix:new P("!/~",{beforeExpr:true,prefix:true,startsExpr:true}),logicalOR:U("||",1),logicalAND:U("&&",2),bitwiseOR:U("|",3),bitwiseXOR:U("^",4),bitwiseAND:U("&",5),equality:U("==/!=/===/!==",6),relational:U("</>/<=/>=",7),bitShift:U("<</>>/>>>",8),plusMin:new P("+/-",{beforeExpr:true,binop:9,prefix:true,startsExpr:true}),modulo:U("%",10),star:U("*",10),slash:U("/",10),starstar:new P("**",{beforeExpr:true}),coalesce:U("??",1),_break:w("break"),_case:w("case",z),_catch:w("catch"),_continue:w("continue"),_debugger:w("debugger"),_default:w("default",z),_do:w("do",{isLoop:true,beforeExpr:true}),_else:w("else",z),_finally:w("finally"),_for:w("for",{isLoop:true}),_function:w("function",F),_if:w("if"),_return:w("return",z),_switch:w("switch"),_throw:w("throw",z),_try:w("try"),_var:w("var"),_const:w("const"),_while:w("while",{isLoop:true}),_with:w("with"),_new:w("new",{beforeExpr:true,startsExpr:true}),_this:w("this",F),_super:w("super",F),_class:w("class",F),_extends:w("extends",z),_export:w("export"),_import:w("import",F),_null:w("null",F),_true:w("true",F),_false:w("false",F),_in:w("in",{beforeExpr:true,binop:7}),_instanceof:w("instanceof",{beforeExpr:true,binop:7}),_typeof:w("typeof",{beforeExpr:true,prefix:true,startsExpr:true}),_void:w("void",{beforeExpr:true,prefix:true,startsExpr:true}),_delete:w("delete",{beforeExpr:true,prefix:true,startsExpr:true})},j=/\r\n?|\n|\u2028|\u2029/,rr=new RegExp(j.source,"g");function fe(e){return e===10||e===13||e===8232||e===8233}function ri(e,t,i){i===void 0&&(i=e.length);for(var r=t;r<i;r++){var s=e.charCodeAt(r);if(fe(s))return r<i-1&&s===13&&e.charCodeAt(r+1)===10?r+2:r+1}return -1}var si=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,D=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,ai=Object.prototype,sr=ai.hasOwnProperty,ar=ai.toString,de=Object.hasOwn||(function(e,t){return sr.call(e,t)}),Kt=Array.isArray||(function(e){return ar.call(e)==="[object Array]"}),Qt=Object.create(null);function re(e){return Qt[e]||(Qt[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function ee(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var nr=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,ve=function(t,i){this.line=t,this.column=i;};ve.prototype.offset=function(t){return new ve(this.line,this.column+t)};var De=function(t,i,r){this.start=i,this.end=r,t.sourceFile!==null&&(this.source=t.sourceFile);};function ni(e,t){for(var i=1,r=0;;){var s=ri(e,r,t);if(s<0)return new ve(i,t-r);++i,r=s;}}var et={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:false,allowImportExportEverywhere:false,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:false,checkPrivateFields:true,locations:false,onToken:null,onComment:null,ranges:false,program:null,sourceFile:null,directSourceFile:null,preserveParens:false},Yt=false;function or(e){var t={};for(var i in et)t[i]=e&&de(e,i)?e[i]:et[i];if(t.ecmaVersion==="latest"?t.ecmaVersion=1e8:t.ecmaVersion==null?(!Yt&&typeof console=="object"&&console.warn&&(Yt=true,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
6
|
+
Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved==null&&(t.allowReserved=t.ecmaVersion<5),(!e||e.allowHashBang==null)&&(t.allowHashBang=t.ecmaVersion>=14),Kt(t.onToken)){var r=t.onToken;t.onToken=function(s){return r.push(s)};}if(Kt(t.onComment)&&(t.onComment=ur(t,t.onComment)),t.sourceType==="commonjs"&&t.allowAwaitOutsideFunction)throw new Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");return t}function ur(e,t){return function(i,r,s,a,o,u){var c={type:i?"Block":"Line",value:r,start:s,end:a};e.locations&&(c.loc=new De(this,o,u)),e.ranges&&(c.range=[s,a]),t.push(c);}}var ue=1,ce=2,st=4,oi=8,at=16,ui=32,Me=64,ci=128,le=256,be=512,li=1024,Ve=ue|ce|le;function nt(e,t){return ce|(e?st:0)|(t?oi:0)}var Ne=0,ot=1,ie=2,pi=3,hi=4,fi=5,R=function(t,i,r){this.options=t=or(t),this.sourceFile=t.sourceFile,this.keywords=re(er[t.ecmaVersion>=6?6:t.sourceType==="module"?"5module":5]);var s="";t.allowReserved!==true&&(s=Qe[t.ecmaVersion>=6?6:t.ecmaVersion===5?5:3],t.sourceType==="module"&&(s+=" await")),this.reservedWords=re(s);var a=(s?s+" ":"")+Qe.strict;this.reservedWordsStrict=re(a),this.reservedWordsStrictBind=re(a+" "+Qe.strictBind),this.input=String(i),this.containsEsc=false,r?(this.pos=r,this.lineStart=this.input.lastIndexOf(`
|
|
7
|
+
`,r-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(j).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=n.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=true,this.inModule=t.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=false,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&t.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(this.options.sourceType==="commonjs"?ce:ue),this.regexpState=null,this.privateNameStack=[];},Z={inFunction:{configurable:true},inGenerator:{configurable:true},inAsync:{configurable:true},canAwait:{configurable:true},allowReturn:{configurable:true},allowSuper:{configurable:true},allowDirectSuper:{configurable:true},treatFunctionsAsVar:{configurable:true},allowNewDotTarget:{configurable:true},allowUsing:{configurable:true},inClassStaticBlock:{configurable:true}};R.prototype.parse=function(){var t=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(t)};Z.inFunction.get=function(){return (this.currentVarScope().flags&ce)>0};Z.inGenerator.get=function(){return (this.currentVarScope().flags&oi)>0};Z.inAsync.get=function(){return (this.currentVarScope().flags&st)>0};Z.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e],i=t.flags;if(i&(le|be))return false;if(i&ce)return (i&st)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};Z.allowReturn.get=function(){return !!(this.inFunction||this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&ue)};Z.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags;return (t&Me)>0||this.options.allowSuperOutsideMethod};Z.allowDirectSuper.get=function(){return (this.currentThisScope().flags&ci)>0};Z.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};Z.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e],i=t.flags;if(i&(le|be)||i&ce&&!(i&at))return true}return false};Z.allowUsing.get=function(){var e=this.currentScope(),t=e.flags;return !(t&li||!this.inModule&&t&ue)};Z.inClassStaticBlock.get=function(){return (this.currentVarScope().flags&le)>0};R.extend=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];for(var r=this,s=0;s<t.length;s++)r=t[s](r);return r};R.parse=function(t,i){return new this(i,t).parse()};R.parseExpressionAt=function(t,i,r){var s=new this(r,t,i);return s.nextToken(),s.parseExpression()};R.tokenizer=function(t,i){return new this(i,t)};Object.defineProperties(R.prototype,Z);var V=R.prototype,cr=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;V.strictDirective=function(e){if(this.options.ecmaVersion<5)return false;for(;;){D.lastIndex=e,e+=D.exec(this.input)[0].length;var t=cr.exec(this.input.slice(e));if(!t)return false;if((t[1]||t[2])==="use strict"){D.lastIndex=e+t[0].length;var i=D.exec(this.input),r=i.index+i[0].length,s=this.input.charAt(r);return s===";"||s==="}"||j.test(i[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(s)||s==="!"&&this.input.charAt(r+1)==="=")}e+=t[0].length,D.lastIndex=e,e+=D.exec(this.input)[0].length,this.input[e]===";"&&e++;}};V.eat=function(e){return this.type===e?(this.next(),true):false};V.isContextual=function(e){return this.type===n.name&&this.value===e&&!this.containsEsc};V.eatContextual=function(e){return this.isContextual(e)?(this.next(),true):false};V.expectContextual=function(e){this.eatContextual(e)||this.unexpected();};V.canInsertSemicolon=function(){return this.type===n.eof||this.type===n.braceR||j.test(this.input.slice(this.lastTokEnd,this.start))};V.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),true};V.semicolon=function(){!this.eat(n.semi)&&!this.insertSemicolon()&&this.unexpected();};V.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),true};V.expect=function(e){this.eat(e)||this.unexpected();};V.unexpected=function(e){this.raise(e??this.start,"Unexpected token");};var Fe=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1;};V.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var i=t?e.parenthesizedAssign:e.parenthesizedBind;i>-1&&this.raiseRecoverable(i,t?"Assigning to rvalue":"Parenthesized pattern");}};V.checkExpressionErrors=function(e,t){if(!e)return false;var i=e.shorthandAssign,r=e.doubleProto;if(!t)return i>=0||r>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),r>=0&&this.raiseRecoverable(r,"Redefinition of __proto__ property");};V.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value");};V.isSimpleAssignTarget=function(e){return e.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(e.expression):e.type==="Identifier"||e.type==="MemberExpression"};var d=R.prototype;d.parseTopLevel=function(e){var t=Object.create(null);for(e.body||(e.body=[]);this.type!==n.eof;){var i=this.parseStatement(null,true,t);e.body.push(i);}if(this.inModule)for(var r=0,s=Object.keys(this.undefinedExports);r<s.length;r+=1){var a=s[r];this.raiseRecoverable(this.undefinedExports[a].start,"Export '"+a+"' is not defined");}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType==="commonjs"?"script":this.options.sourceType,this.finishNode(e,"Program")};var ut={kind:"loop"},lr={kind:"switch"};d.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return false;D.lastIndex=this.pos;var t=D.exec(this.input),i=this.pos+t[0].length,r=this.fullCharCodeAt(i);if(r===91||r===92)return true;if(e)return false;if(r===123)return true;if(Y(r)){var s=i;do i+=r<=65535?1:2;while(se(r=this.fullCharCodeAt(i)));if(r===92)return true;var a=this.input.slice(s,i);if(!ii.test(a))return true}return false};d.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return false;D.lastIndex=this.pos;var e=D.exec(this.input),t=this.pos+e[0].length,i;return !j.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)==="function"&&(t+8===this.input.length||!(se(i=this.fullCharCodeAt(t+8))||i===92))};d.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?"await":"using"))return false;D.lastIndex=this.pos;var i=D.exec(this.input),r=this.pos+i[0].length;if(j.test(this.input.slice(this.pos,r)))return false;if(e){var s=r+5,a;if(this.input.slice(r,s)!=="using"||s===this.input.length||se(a=this.fullCharCodeAt(s))||a===92)return false;D.lastIndex=s;var o=D.exec(this.input);if(r=s+o[0].length,o&&j.test(this.input.slice(s,r)))return false}var u=this.fullCharCodeAt(r);if(!Y(u)&&u!==92)return false;var c=r;do r+=u<=65535?1:2;while(se(u=this.fullCharCodeAt(r)));if(u===92)return true;var l=this.input.slice(c,r);return !(ii.test(l)||t&&l==="of")};d.isAwaitUsing=function(e){return this.isUsingKeyword(true,e)};d.isUsing=function(e){return this.isUsingKeyword(false,e)};d.parseStatement=function(e,t,i){var r=this.type,s=this.startNode(),a;switch(this.isLet(e)&&(r=n._var,a="let"),r){case n._break:case n._continue:return this.parseBreakContinueStatement(s,r.keyword);case n._debugger:return this.parseDebuggerStatement(s);case n._do:return this.parseDoStatement(s);case n._for:return this.parseForStatement(s);case n._function:return e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(s,false,!e);case n._class:return e&&this.unexpected(),this.parseClass(s,true);case n._if:return this.parseIfStatement(s);case n._return:return this.parseReturnStatement(s);case n._switch:return this.parseSwitchStatement(s);case n._throw:return this.parseThrowStatement(s);case n._try:return this.parseTryStatement(s);case n._const:case n._var:return a=a||this.value,e&&a!=="var"&&this.unexpected(),this.parseVarStatement(s,a);case n._while:return this.parseWhileStatement(s);case n._with:return this.parseWithStatement(s);case n.braceL:return this.parseBlock(true,s);case n.semi:return this.parseEmptyStatement(s);case n._export:case n._import:if(this.options.ecmaVersion>10&&r===n._import){D.lastIndex=this.pos;var o=D.exec(this.input),u=this.pos+o[0].length,c=this.input.charCodeAt(u);if(c===40||c===46)return this.parseExpressionStatement(s,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),r===n._import?this.parseImport(s):this.parseExport(s,i);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(s,true,!e);var l=this.isAwaitUsing(false)?"await using":this.isUsing(false)?"using":null;if(l)return this.allowUsing||this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement"),l==="await using"&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.next(),this.parseVar(s,false,l),this.semicolon(),this.finishNode(s,"VariableDeclaration");var p=this.value,m=this.parseExpression();return r===n.name&&m.type==="Identifier"&&this.eat(n.colon)?this.parseLabeledStatement(s,p,m,e):this.parseExpressionStatement(s,m)}};d.parseBreakContinueStatement=function(e,t){var i=t==="break";this.next(),this.eat(n.semi)||this.insertSemicolon()?e.label=null:this.type!==n.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var r=0;r<this.labels.length;++r){var s=this.labels[r];if((e.label==null||s.name===e.label.name)&&(s.kind!=null&&(i||s.kind==="loop")||e.label&&i))break}return r===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,i?"BreakStatement":"ContinueStatement")};d.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")};d.parseDoStatement=function(e){return this.next(),this.labels.push(ut),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(n._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(n.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")};d.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(ut),this.enterScope(0),this.expect(n.parenL),this.type===n.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var i=this.isLet();if(this.type===n._var||this.type===n._const||i){var r=this.startNode(),s=i?"let":this.value;return this.next(),this.parseVar(r,true,s),this.finishNode(r,"VariableDeclaration"),this.parseForAfterInit(e,r,t)}var a=this.isContextual("let"),o=false,u=this.isUsing(true)?"using":this.isAwaitUsing(true)?"await using":null;if(u){var c=this.startNode();return this.next(),u==="await using"&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.parseVar(c,true,u),this.finishNode(c,"VariableDeclaration"),this.parseForAfterInit(e,c,t)}var l=this.containsEsc,p=new Fe,m=this.start,x=t>-1?this.parseExprSubscripts(p,"await"):this.parseExpression(true,p);return this.type===n._in||(o=this.options.ecmaVersion>=6&&this.isContextual("of"))?(t>-1?(this.type===n._in&&this.unexpected(t),e.await=true):o&&this.options.ecmaVersion>=8&&(x.start===m&&!l&&x.type==="Identifier"&&x.name==="async"?this.unexpected():this.options.ecmaVersion>=9&&(e.await=false)),a&&o&&this.raise(x.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(x,false,p),this.checkLValPattern(x),this.parseForIn(e,x)):(this.checkExpressionErrors(p,true),t>-1&&this.unexpected(t),this.parseFor(e,x))};d.parseForAfterInit=function(e,t,i){return (this.type===n._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&t.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===n._in?i>-1&&this.unexpected(i):e.await=i>-1),this.parseForIn(e,t)):(i>-1&&this.unexpected(i),this.parseFor(e,t))};d.parseFunctionStatement=function(e,t,i){return this.next(),this.parseFunction(e,ye|(i?0:tt),false,t)};d.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(n._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")};d.parseReturnStatement=function(e){return this.allowReturn||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(n.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")};d.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(n.braceL),this.labels.push(lr),this.enterScope(li);for(var t,i=false;this.type!==n.braceR;)if(this.type===n._case||this.type===n._default){var r=this.type===n._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r?t.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=true,t.test=null),this.expect(n.colon);}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")};d.parseThrowStatement=function(e){return this.next(),j.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var pr=[];d.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type==="Identifier";return this.enterScope(t?ui:0),this.checkLValPattern(e,t?hi:ie),this.expect(n.parenR),e};d.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===n._catch){var t=this.startNode();this.next(),this.eat(n.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(false),this.exitScope(),e.handler=this.finishNode(t,"CatchClause");}return e.finalizer=this.eat(n._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")};d.parseVarStatement=function(e,t,i){return this.next(),this.parseVar(e,false,t,i),this.semicolon(),this.finishNode(e,"VariableDeclaration")};d.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(ut),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")};d.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")};d.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")};d.parseLabeledStatement=function(e,t,i,r){for(var s=0,a=this.labels;s<a.length;s+=1){var o=a[s];o.name===t&&this.raise(i.start,"Label '"+t+"' is already declared");}for(var u=this.type.isLoop?"loop":this.type===n._switch?"switch":null,c=this.labels.length-1;c>=0;c--){var l=this.labels[c];if(l.statementStart===e.start)l.statementStart=this.start,l.kind=u;else break}return this.labels.push({name:t,kind:u,statementStart:this.start}),e.body=this.parseStatement(r?r.indexOf("label")===-1?r+"label":r:"label"),this.labels.pop(),e.label=i,this.finishNode(e,"LabeledStatement")};d.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")};d.parseBlock=function(e,t,i){for(e===void 0&&(e=true),t===void 0&&(t=this.startNode()),t.body=[],this.expect(n.braceL),e&&this.enterScope(0);this.type!==n.braceR;){var r=this.parseStatement(null);t.body.push(r);}return i&&(this.strict=false),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")};d.parseFor=function(e,t){return e.init=t,this.expect(n.semi),e.test=this.type===n.semi?null:this.parseExpression(),this.expect(n.semi),e.update=this.type===n.parenR?null:this.parseExpression(),this.expect(n.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")};d.parseForIn=function(e,t){var i=this.type===n._in;return this.next(),t.type==="VariableDeclaration"&&t.declarations[0].init!=null&&(!i||this.options.ecmaVersion<8||this.strict||t.kind!=="var"||t.declarations[0].id.type!=="Identifier")&&this.raise(t.start,(i?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=t,e.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(n.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,i?"ForInStatement":"ForOfStatement")};d.parseVar=function(e,t,i,r){for(e.declarations=[],e.kind=i;;){var s=this.startNode();if(this.parseVarId(s,i),this.eat(n.eq)?s.init=this.parseMaybeAssign(t):!r&&i==="const"&&!(this.type===n._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!r&&(i==="using"||i==="await using")&&this.options.ecmaVersion>=17&&this.type!==n._in&&!this.isContextual("of")?this.raise(this.lastTokEnd,"Missing initializer in "+i+" declaration"):!r&&s.id.type!=="Identifier"&&!(t&&(this.type===n._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):s.init=null,e.declarations.push(this.finishNode(s,"VariableDeclarator")),!this.eat(n.comma))break}return e};d.parseVarId=function(e,t){e.id=t==="using"||t==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,t==="var"?ot:ie,false);};var ye=1,tt=2,di=4;d.parseFunction=function(e,t,i,r,s){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===n.star&&t&tt&&this.unexpected(),e.generator=this.eat(n.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&ye&&(e.id=t&di&&this.type!==n.name?null:this.parseIdent(),e.id&&!(t&tt)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?ot:ie:pi));var a=this.yieldPos,o=this.awaitPos,u=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(nt(e.async,e.generator)),t&ye||(e.id=this.type===n.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,i,false,s),this.yieldPos=a,this.awaitPos=o,this.awaitIdentPos=u,this.finishNode(e,t&ye?"FunctionDeclaration":"FunctionExpression")};d.parseFunctionParams=function(e){this.expect(n.parenL),e.params=this.parseBindingList(n.parenR,false,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams();};d.parseClass=function(e,t){this.next();var i=this.strict;this.strict=true,this.parseClassId(e,t),this.parseClassSuper(e);var r=this.enterClassBody(),s=this.startNode(),a=false;for(s.body=[],this.expect(n.braceL);this.type!==n.braceR;){var o=this.parseClassElement(e.superClass!==null);o&&(s.body.push(o),o.type==="MethodDefinition"&&o.kind==="constructor"?(a&&this.raiseRecoverable(o.start,"Duplicate constructor in the same class"),a=true):o.key&&o.key.type==="PrivateIdentifier"&&hr(r,o)&&this.raiseRecoverable(o.key.start,"Identifier '#"+o.key.name+"' has already been declared"));}return this.strict=i,this.next(),e.body=this.finishNode(s,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")};d.parseClassElement=function(e){if(this.eat(n.semi))return null;var t=this.options.ecmaVersion,i=this.startNode(),r="",s=false,a=false,o="method",u=false;if(this.eatContextual("static")){if(t>=13&&this.eat(n.braceL))return this.parseClassStaticBlock(i),i;this.isClassElementNameStart()||this.type===n.star?u=true:r="static";}if(i.static=u,!r&&t>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===n.star)&&!this.canInsertSemicolon()?a=true:r="async"),!r&&(t>=9||!a)&&this.eat(n.star)&&(s=true),!r&&!a&&!s){var c=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?o=c:r=c);}if(r?(i.computed=false,i.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),i.key.name=r,this.finishNode(i.key,"Identifier")):this.parseClassElementName(i),t<13||this.type===n.parenL||o!=="method"||s||a){var l=!i.static&&Re(i,"constructor"),p=l&&e;l&&o!=="method"&&this.raise(i.key.start,"Constructor can't have get/set modifier"),i.kind=l?"constructor":o,this.parseClassMethod(i,s,a,p);}else this.parseClassField(i);return i};d.isClassElementNameStart=function(){return this.type===n.name||this.type===n.privateId||this.type===n.num||this.type===n.string||this.type===n.bracketL||this.type.keyword};d.parseClassElementName=function(e){this.type===n.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=false,e.key=this.parsePrivateIdent()):this.parsePropertyName(e);};d.parseClassMethod=function(e,t,i,r){var s=e.key;e.kind==="constructor"?(t&&this.raise(s.start,"Constructor can't be a generator"),i&&this.raise(s.start,"Constructor can't be an async method")):e.static&&Re(e,"prototype")&&this.raise(s.start,"Classes may not have a static property named prototype");var a=e.value=this.parseMethod(t,i,r);return e.kind==="get"&&a.params.length!==0&&this.raiseRecoverable(a.start,"getter should have no params"),e.kind==="set"&&a.params.length!==1&&this.raiseRecoverable(a.start,"setter should have exactly one param"),e.kind==="set"&&a.params[0].type==="RestElement"&&this.raiseRecoverable(a.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")};d.parseClassField=function(e){return Re(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&Re(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(n.eq)?(this.enterScope(be|Me),e.value=this.parseMaybeAssign(),this.exitScope()):e.value=null,this.semicolon(),this.finishNode(e,"PropertyDefinition")};d.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(le|Me);this.type!==n.braceR;){var i=this.parseStatement(null);e.body.push(i);}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")};d.parseClassId=function(e,t){this.type===n.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,ie,false)):(t===true&&this.unexpected(),e.id=null);};d.parseClassSuper=function(e){e.superClass=this.eat(n._extends)?this.parseExprSubscripts(null,false):null;};d.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared};d.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,i=e.used;if(this.options.checkPrivateFields)for(var r=this.privateNameStack.length,s=r===0?null:this.privateNameStack[r-1],a=0;a<i.length;++a){var o=i[a];de(t,o.name)||(s?s.used.push(o):this.raiseRecoverable(o.start,"Private field '#"+o.name+"' must be declared in an enclosing class"));}};function hr(e,t){var i=t.key.name,r=e[i],s="true";return t.type==="MethodDefinition"&&(t.kind==="get"||t.kind==="set")&&(s=(t.static?"s":"i")+t.kind),r==="iget"&&s==="iset"||r==="iset"&&s==="iget"||r==="sget"&&s==="sset"||r==="sset"&&s==="sget"?(e[i]="true",false):r?true:(e[i]=s,false)}function Re(e,t){var i=e.computed,r=e.key;return !i&&(r.type==="Identifier"&&r.name===t||r.type==="Literal"&&r.value===t)}d.parseExportAllDeclaration=function(e,t){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==n.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")};d.parseExport=function(e,t){if(this.next(),this.eat(n.star))return this.parseExportAllDeclaration(e,t);if(this.eat(n._default))return this.checkExport(t,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type==="VariableDeclaration"?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[]);else {if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==n.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else {for(var i=0,r=e.specifiers;i<r.length;i+=1){var s=r[i];this.checkUnreserved(s.local),this.checkLocalExport(s.local),s.local.type==="Literal"&&this.raise(s.local.start,"A string literal cannot be used as an exported binding without `from`.");}e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[]);}this.semicolon();}return this.finishNode(e,"ExportNamedDeclaration")};d.parseExportDeclaration=function(e){return this.parseStatement(null)};d.parseExportDefaultDeclaration=function(){var e;if(this.type===n._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,ye|di,false,e)}else if(this.type===n._class){var i=this.startNode();return this.parseClass(i,"nullableID")}else {var r=this.parseMaybeAssign();return this.semicolon(),r}};d.checkExport=function(e,t,i){e&&(typeof t!="string"&&(t=t.type==="Identifier"?t.name:t.value),de(e,t)&&this.raiseRecoverable(i,"Duplicate export '"+t+"'"),e[t]=true);};d.checkPatternExport=function(e,t){var i=t.type;if(i==="Identifier")this.checkExport(e,t,t.start);else if(i==="ObjectPattern")for(var r=0,s=t.properties;r<s.length;r+=1){var a=s[r];this.checkPatternExport(e,a);}else if(i==="ArrayPattern")for(var o=0,u=t.elements;o<u.length;o+=1){var c=u[o];c&&this.checkPatternExport(e,c);}else i==="Property"?this.checkPatternExport(e,t.value):i==="AssignmentPattern"?this.checkPatternExport(e,t.left):i==="RestElement"&&this.checkPatternExport(e,t.argument);};d.checkVariableExport=function(e,t){if(e)for(var i=0,r=t;i<r.length;i+=1){var s=r[i];this.checkPatternExport(e,s.id);}};d.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};d.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual("as")?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,"ExportSpecifier")};d.parseExportSpecifiers=function(e){var t=[],i=true;for(this.expect(n.braceL);!this.eat(n.braceR);){if(i)i=false;else if(this.expect(n.comma),this.afterTrailingComma(n.braceR))break;t.push(this.parseExportSpecifier(e));}return t};d.parseImport=function(e){return this.next(),this.type===n.string?(e.specifiers=pr,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===n.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ImportDeclaration")};d.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual("as")?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,ie),this.finishNode(e,"ImportSpecifier")};d.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,ie),this.finishNode(e,"ImportDefaultSpecifier")};d.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual("as"),e.local=this.parseIdent(),this.checkLValSimple(e.local,ie),this.finishNode(e,"ImportNamespaceSpecifier")};d.parseImportSpecifiers=function(){var e=[],t=true;if(this.type===n.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(n.comma)))return e;if(this.type===n.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(n.braceL);!this.eat(n.braceR);){if(t)t=false;else if(this.expect(n.comma),this.afterTrailingComma(n.braceR))break;e.push(this.parseImportSpecifier());}return e};d.parseWithClause=function(){var e=[];if(!this.eat(n._with))return e;this.expect(n.braceL);for(var t={},i=true;!this.eat(n.braceR);){if(i)i=false;else if(this.expect(n.comma),this.afterTrailingComma(n.braceR))break;var r=this.parseImportAttribute(),s=r.key.type==="Identifier"?r.key.name:r.key.value;de(t,s)&&this.raiseRecoverable(r.key.start,"Duplicate attribute key '"+s+"'"),t[s]=true,e.push(r);}return e};d.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===n.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(n.colon),this.type!==n.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,"ImportAttribute")};d.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===n.string){var e=this.parseLiteral(this.value);return nr.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(true)};d.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1);};d.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var $=R.prototype;$.toAssignable=function(e,t,i){if(this.options.ecmaVersion>=6&&e)switch(e.type){case "Identifier":this.inAsync&&e.name==="await"&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case "ObjectPattern":case "ArrayPattern":case "AssignmentPattern":case "RestElement":break;case "ObjectExpression":e.type="ObjectPattern",i&&this.checkPatternErrors(i,true);for(var r=0,s=e.properties;r<s.length;r+=1){var a=s[r];this.toAssignable(a,t),a.type==="RestElement"&&(a.argument.type==="ArrayPattern"||a.argument.type==="ObjectPattern")&&this.raise(a.argument.start,"Unexpected token");}break;case "Property":e.kind!=="init"&&this.raise(e.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(e.value,t);break;case "ArrayExpression":e.type="ArrayPattern",i&&this.checkPatternErrors(i,true),this.toAssignableList(e.elements,t);break;case "SpreadElement":e.type="RestElement",this.toAssignable(e.argument,t),e.argument.type==="AssignmentPattern"&&this.raise(e.argument.start,"Rest elements cannot have a default value");break;case "AssignmentExpression":e.operator!=="="&&this.raise(e.left.end,"Only '=' operator can be used for specifying default value."),e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,t);break;case "ParenthesizedExpression":this.toAssignable(e.expression,t,i);break;case "ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case "MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue");}else i&&this.checkPatternErrors(i,true);return e};$.toAssignableList=function(e,t){for(var i=e.length,r=0;r<i;r++){var s=e[r];s&&this.toAssignable(s,t);}if(i){var a=e[i-1];this.options.ecmaVersion===6&&t&&a&&a.type==="RestElement"&&a.argument.type!=="Identifier"&&this.unexpected(a.argument.start);}return e};$.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(false,e),this.finishNode(t,"SpreadElement")};$.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==n.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")};$.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case n.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(n.bracketR,true,true),this.finishNode(e,"ArrayPattern");case n.braceL:return this.parseObj(true)}return this.parseIdent()};$.parseBindingList=function(e,t,i,r){for(var s=[],a=true;!this.eat(e);)if(a?a=false:this.expect(n.comma),t&&this.type===n.comma)s.push(null);else {if(i&&this.afterTrailingComma(e))break;if(this.type===n.ellipsis){var o=this.parseRestBinding();this.parseBindingListItem(o),s.push(o),this.type===n.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(e);break}else s.push(this.parseAssignableListItem(r));}return s};$.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t};$.parseBindingListItem=function(e){return e};$.parseMaybeDefault=function(e,t,i){if(i=i||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(n.eq))return i;var r=this.startNodeAt(e,t);return r.left=i,r.right=this.parseMaybeAssign(),this.finishNode(r,"AssignmentPattern")};$.checkLValSimple=function(e,t,i){t===void 0&&(t=Ne);var r=t!==Ne;switch(e.type){case "Identifier":this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(r?"Binding ":"Assigning to ")+e.name+" in strict mode"),r&&(t===ie&&e.name==="let"&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),i&&(de(i,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),i[e.name]=true),t!==fi&&this.declareName(e.name,t,e.start));break;case "ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case "MemberExpression":r&&this.raiseRecoverable(e.start,"Binding member expression");break;case "ParenthesizedExpression":return r&&this.raiseRecoverable(e.start,"Binding parenthesized expression"),this.checkLValSimple(e.expression,t,i);default:this.raise(e.start,(r?"Binding":"Assigning to")+" rvalue");}};$.checkLValPattern=function(e,t,i){switch(t===void 0&&(t=Ne),e.type){case "ObjectPattern":for(var r=0,s=e.properties;r<s.length;r+=1){var a=s[r];this.checkLValInnerPattern(a,t,i);}break;case "ArrayPattern":for(var o=0,u=e.elements;o<u.length;o+=1){var c=u[o];c&&this.checkLValInnerPattern(c,t,i);}break;default:this.checkLValSimple(e,t,i);}};$.checkLValInnerPattern=function(e,t,i){switch(t===void 0&&(t=Ne),e.type){case "Property":this.checkLValInnerPattern(e.value,t,i);break;case "AssignmentPattern":this.checkLValPattern(e.left,t,i);break;case "RestElement":this.checkLValPattern(e.argument,t,i);break;default:this.checkLValPattern(e,t,i);}};var K=function(t,i,r,s,a){this.token=t,this.isExpr=!!i,this.preserveSpace=!!r,this.override=s,this.generator=!!a;},I={b_stat:new K("{",false),b_expr:new K("{",true),b_tmpl:new K("${",false),p_stat:new K("(",false),p_expr:new K("(",true),q_tmpl:new K("`",true,true,function(e){return e.tryReadTemplateToken()}),f_stat:new K("function",false),f_expr:new K("function",true),f_expr_gen:new K("function",true,false,null,true),f_gen:new K("function",false,false,null,true)},me=R.prototype;me.initialContext=function(){return [I.b_stat]};me.curContext=function(){return this.context[this.context.length-1]};me.braceIsBlock=function(e){var t=this.curContext();return t===I.f_expr||t===I.f_stat?true:e===n.colon&&(t===I.b_stat||t===I.b_expr)?!t.isExpr:e===n._return||e===n.name&&this.exprAllowed?j.test(this.input.slice(this.lastTokEnd,this.start)):e===n._else||e===n.semi||e===n.eof||e===n.parenR||e===n.arrow?true:e===n.braceL?t===I.b_stat:e===n._var||e===n._const||e===n.name?false:!this.exprAllowed};me.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token==="function")return t.generator}return false};me.updateContext=function(e){var t,i=this.type;i.keyword&&e===n.dot?this.exprAllowed=false:(t=i.updateContext)?t.call(this,e):this.exprAllowed=i.beforeExpr;};me.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e);};n.parenR.updateContext=n.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=true;return}var e=this.context.pop();e===I.b_stat&&this.curContext().token==="function"&&(e=this.context.pop()),this.exprAllowed=!e.isExpr;};n.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?I.b_stat:I.b_expr),this.exprAllowed=true;};n.dollarBraceL.updateContext=function(){this.context.push(I.b_tmpl),this.exprAllowed=true;};n.parenL.updateContext=function(e){var t=e===n._if||e===n._for||e===n._with||e===n._while;this.context.push(t?I.p_stat:I.p_expr),this.exprAllowed=true;};n.incDec.updateContext=function(){};n._function.updateContext=n._class.updateContext=function(e){e.beforeExpr&&e!==n._else&&!(e===n.semi&&this.curContext()!==I.p_stat)&&!(e===n._return&&j.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===n.colon||e===n.braceL)&&this.curContext()===I.b_stat)?this.context.push(I.f_expr):this.context.push(I.f_stat),this.exprAllowed=false;};n.colon.updateContext=function(){this.curContext().token==="function"&&this.context.pop(),this.exprAllowed=true;};n.backQuote.updateContext=function(){this.curContext()===I.q_tmpl?this.context.pop():this.context.push(I.q_tmpl),this.exprAllowed=false;};n.star.updateContext=function(e){if(e===n._function){var t=this.context.length-1;this.context[t]===I.f_expr?this.context[t]=I.f_expr_gen:this.context[t]=I.f_gen;}this.exprAllowed=true;};n.name.updateContext=function(e){var t=false;this.options.ecmaVersion>=6&&e!==n.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(t=true),this.exprAllowed=t;};var y=R.prototype;y.checkPropClash=function(e,t,i){if(!(this.options.ecmaVersion>=9&&e.type==="SpreadElement")&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var r=e.key,s;switch(r.type){case "Identifier":s=r.name;break;case "Literal":s=String(r.value);break;default:return}var a=e.kind;if(this.options.ecmaVersion>=6){s==="__proto__"&&a==="init"&&(t.proto&&(i?i.doubleProto<0&&(i.doubleProto=r.start):this.raiseRecoverable(r.start,"Redefinition of __proto__ property")),t.proto=true);return}s="$"+s;var o=t[s];if(o){var u;a==="init"?u=this.strict&&o.init||o.get||o.set:u=o.init||o[a],u&&this.raiseRecoverable(r.start,"Redefinition of property");}else o=t[s]={init:false,get:false,set:false};o[a]=true;}};y.parseExpression=function(e,t){var i=this.start,r=this.startLoc,s=this.parseMaybeAssign(e,t);if(this.type===n.comma){var a=this.startNodeAt(i,r);for(a.expressions=[s];this.eat(n.comma);)a.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(a,"SequenceExpression")}return s};y.parseMaybeAssign=function(e,t,i){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=false;}var r=false,s=-1,a=-1,o=-1;t?(s=t.parenthesizedAssign,a=t.trailingComma,o=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new Fe,r=true);var u=this.start,c=this.startLoc;(this.type===n.parenL||this.type===n.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e==="await");var l=this.parseMaybeConditional(e,t);if(i&&(l=i.call(this,l,u,c)),this.type.isAssign){var p=this.startNodeAt(u,c);return p.operator=this.value,this.type===n.eq&&(l=this.toAssignable(l,false,t)),r||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=l.start&&(t.shorthandAssign=-1),this.type===n.eq?this.checkLValPattern(l):this.checkLValSimple(l),p.left=l,this.next(),p.right=this.parseMaybeAssign(e),o>-1&&(t.doubleProto=o),this.finishNode(p,"AssignmentExpression")}else r&&this.checkExpressionErrors(t,true);return s>-1&&(t.parenthesizedAssign=s),a>-1&&(t.trailingComma=a),l};y.parseMaybeConditional=function(e,t){var i=this.start,r=this.startLoc,s=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return s;if(this.eat(n.question)){var a=this.startNodeAt(i,r);return a.test=s,a.consequent=this.parseMaybeAssign(),this.expect(n.colon),a.alternate=this.parseMaybeAssign(e),this.finishNode(a,"ConditionalExpression")}return s};y.parseExprOps=function(e,t){var i=this.start,r=this.startLoc,s=this.parseMaybeUnary(t,false,false,e);return this.checkExpressionErrors(t)||s.start===i&&s.type==="ArrowFunctionExpression"?s:this.parseExprOp(s,i,r,-1,e)};y.parseExprOp=function(e,t,i,r,s){var a=this.type.binop;if(a!=null&&(!s||this.type!==n._in)&&a>r){var o=this.type===n.logicalOR||this.type===n.logicalAND,u=this.type===n.coalesce;u&&(a=n.logicalAND.binop);var c=this.value;this.next();var l=this.start,p=this.startLoc,m=this.parseExprOp(this.parseMaybeUnary(null,false,false,s),l,p,a,s),x=this.buildBinary(t,i,e,m,c,o||u);return (o&&this.type===n.coalesce||u&&(this.type===n.logicalOR||this.type===n.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(x,t,i,r,s)}return e};y.buildBinary=function(e,t,i,r,s,a){r.type==="PrivateIdentifier"&&this.raise(r.start,"Private identifier can only be left side of binary expression");var o=this.startNodeAt(e,t);return o.left=i,o.operator=s,o.right=r,this.finishNode(o,a?"LogicalExpression":"BinaryExpression")};y.parseMaybeUnary=function(e,t,i,r){var s=this.start,a=this.startLoc,o;if(this.isContextual("await")&&this.canAwait)o=this.parseAwait(r),t=true;else if(this.type.prefix){var u=this.startNode(),c=this.type===n.incDec;u.operator=this.value,u.prefix=true,this.next(),u.argument=this.parseMaybeUnary(null,true,c,r),this.checkExpressionErrors(e,true),c?this.checkLValSimple(u.argument):this.strict&&u.operator==="delete"&&mi(u.argument)?this.raiseRecoverable(u.start,"Deleting local variable in strict mode"):u.operator==="delete"&&it(u.argument)?this.raiseRecoverable(u.start,"Private fields can not be deleted"):t=true,o=this.finishNode(u,c?"UpdateExpression":"UnaryExpression");}else if(!t&&this.type===n.privateId)(r||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),o=this.parsePrivateIdent(),this.type!==n._in&&this.unexpected();else {if(o=this.parseExprSubscripts(e,r),this.checkExpressionErrors(e))return o;for(;this.type.postfix&&!this.canInsertSemicolon();){var l=this.startNodeAt(s,a);l.operator=this.value,l.prefix=false,l.argument=o,this.checkLValSimple(o),this.next(),o=this.finishNode(l,"UpdateExpression");}}if(!i&&this.eat(n.starstar))if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(s,a,o,this.parseMaybeUnary(null,false,false,r),"**",false);else return o};function mi(e){return e.type==="Identifier"||e.type==="ParenthesizedExpression"&&mi(e.expression)}function it(e){return e.type==="MemberExpression"&&e.property.type==="PrivateIdentifier"||e.type==="ChainExpression"&&it(e.expression)||e.type==="ParenthesizedExpression"&&it(e.expression)}y.parseExprSubscripts=function(e,t){var i=this.start,r=this.startLoc,s=this.parseExprAtom(e,t);if(s.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return s;var a=this.parseSubscripts(s,i,r,false,t);return e&&a.type==="MemberExpression"&&(e.parenthesizedAssign>=a.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=a.start&&(e.parenthesizedBind=-1),e.trailingComma>=a.start&&(e.trailingComma=-1)),a};y.parseSubscripts=function(e,t,i,r,s){for(var a=this.options.ecmaVersion>=8&&e.type==="Identifier"&&e.name==="async"&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,o=false;;){var u=this.parseSubscript(e,t,i,r,a,o,s);if(u.optional&&(o=true),u===e||u.type==="ArrowFunctionExpression"){if(o){var c=this.startNodeAt(t,i);c.expression=u,u=this.finishNode(c,"ChainExpression");}return u}e=u;}};y.shouldParseAsyncArrow=function(){return !this.canInsertSemicolon()&&this.eat(n.arrow)};y.parseSubscriptAsyncArrow=function(e,t,i,r){return this.parseArrowExpression(this.startNodeAt(e,t),i,true,r)};y.parseSubscript=function(e,t,i,r,s,a,o){var u=this.options.ecmaVersion>=11,c=u&&this.eat(n.questionDot);r&&c&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var l=this.eat(n.bracketL);if(l||c&&this.type!==n.parenL&&this.type!==n.backQuote||this.eat(n.dot)){var p=this.startNodeAt(t,i);p.object=e,l?(p.property=this.parseExpression(),this.expect(n.bracketR)):this.type===n.privateId&&e.type!=="Super"?p.property=this.parsePrivateIdent():p.property=this.parseIdent(this.options.allowReserved!=="never"),p.computed=!!l,u&&(p.optional=c),e=this.finishNode(p,"MemberExpression");}else if(!r&&this.eat(n.parenL)){var m=new Fe,x=this.yieldPos,T=this.awaitPos,k=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var N=this.parseExprList(n.parenR,this.options.ecmaVersion>=8,false,m);if(s&&!c&&this.shouldParseAsyncArrow())return this.checkPatternErrors(m,false),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=x,this.awaitPos=T,this.awaitIdentPos=k,this.parseSubscriptAsyncArrow(t,i,N,o);this.checkExpressionErrors(m,true),this.yieldPos=x||this.yieldPos,this.awaitPos=T||this.awaitPos,this.awaitIdentPos=k||this.awaitIdentPos;var A=this.startNodeAt(t,i);A.callee=e,A.arguments=N,u&&(A.optional=c),e=this.finishNode(A,"CallExpression");}else if(this.type===n.backQuote){(c||a)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var q=this.startNodeAt(t,i);q.tag=e,q.quasi=this.parseTemplate({isTagged:true}),e=this.finishNode(q,"TaggedTemplateExpression");}return e};y.parseExprAtom=function(e,t,i){this.type===n.slash&&this.readRegexp();var r,s=this.potentialArrowAt===this.start;switch(this.type){case n._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),r=this.startNode(),this.next(),this.type===n.parenL&&!this.allowDirectSuper&&this.raise(r.start,"super() call outside constructor of a subclass"),this.type!==n.dot&&this.type!==n.bracketL&&this.type!==n.parenL&&this.unexpected(),this.finishNode(r,"Super");case n._this:return r=this.startNode(),this.next(),this.finishNode(r,"ThisExpression");case n.name:var a=this.start,o=this.startLoc,u=this.containsEsc,c=this.parseIdent(false);if(this.options.ecmaVersion>=8&&!u&&c.name==="async"&&!this.canInsertSemicolon()&&this.eat(n._function))return this.overrideContext(I.f_expr),this.parseFunction(this.startNodeAt(a,o),0,false,true,t);if(s&&!this.canInsertSemicolon()){if(this.eat(n.arrow))return this.parseArrowExpression(this.startNodeAt(a,o),[c],false,t);if(this.options.ecmaVersion>=8&&c.name==="async"&&this.type===n.name&&!u&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return c=this.parseIdent(false),(this.canInsertSemicolon()||!this.eat(n.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(a,o),[c],true,t)}return c;case n.regexp:var l=this.value;return r=this.parseLiteral(l.value),r.regex={pattern:l.pattern,flags:l.flags},r;case n.num:case n.string:return this.parseLiteral(this.value);case n._null:case n._true:case n._false:return r=this.startNode(),r.value=this.type===n._null?null:this.type===n._true,r.raw=this.type.keyword,this.next(),this.finishNode(r,"Literal");case n.parenL:var p=this.start,m=this.parseParenAndDistinguishExpression(s,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(m)&&(e.parenthesizedAssign=p),e.parenthesizedBind<0&&(e.parenthesizedBind=p)),m;case n.bracketL:return r=this.startNode(),this.next(),r.elements=this.parseExprList(n.bracketR,true,true,e),this.finishNode(r,"ArrayExpression");case n.braceL:return this.overrideContext(I.b_expr),this.parseObj(false,e);case n._function:return r=this.startNode(),this.next(),this.parseFunction(r,0);case n._class:return this.parseClass(this.startNode(),false);case n._new:return this.parseNew();case n.backQuote:return this.parseTemplate();case n._import:return this.options.ecmaVersion>=11?this.parseExprImport(i):this.unexpected();default:return this.parseExprAtomDefault()}};y.parseExprAtomDefault=function(){this.unexpected();};y.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===n.parenL&&!e)return this.parseDynamicImport(t);if(this.type===n.dot){var i=this.startNodeAt(t.start,t.loc&&t.loc.start);return i.name="import",t.meta=this.finishNode(i,"Identifier"),this.parseImportMeta(t)}else this.unexpected();};y.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(n.parenR)?e.options=null:(this.expect(n.comma),this.afterTrailingComma(n.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(n.parenR)||(this.expect(n.comma),this.afterTrailingComma(n.parenR)||this.unexpected())));else if(!this.eat(n.parenR)){var t=this.start;this.eat(n.comma)&&this.eat(n.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t);}return this.finishNode(e,"ImportExpression")};y.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(true),e.property.name!=="meta"&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")};y.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.value!=null?t.value.toString():t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")};y.parseParenExpression=function(){this.expect(n.parenL);var e=this.parseExpression();return this.expect(n.parenR),e};y.shouldParseArrow=function(e){return !this.canInsertSemicolon()};y.parseParenAndDistinguishExpression=function(e,t){var i=this.start,r=this.startLoc,s,a=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var o=this.start,u=this.startLoc,c=[],l=true,p=false,m=new Fe,x=this.yieldPos,T=this.awaitPos,k;for(this.yieldPos=0,this.awaitPos=0;this.type!==n.parenR;)if(l?l=false:this.expect(n.comma),a&&this.afterTrailingComma(n.parenR,true)){p=true;break}else if(this.type===n.ellipsis){k=this.start,c.push(this.parseParenItem(this.parseRestBinding())),this.type===n.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else c.push(this.parseMaybeAssign(false,m,this.parseParenItem));var N=this.lastTokEnd,A=this.lastTokEndLoc;if(this.expect(n.parenR),e&&this.shouldParseArrow(c)&&this.eat(n.arrow))return this.checkPatternErrors(m,false),this.checkYieldAwaitInDefaultParams(),this.yieldPos=x,this.awaitPos=T,this.parseParenArrowList(i,r,c,t);(!c.length||p)&&this.unexpected(this.lastTokStart),k&&this.unexpected(k),this.checkExpressionErrors(m,true),this.yieldPos=x||this.yieldPos,this.awaitPos=T||this.awaitPos,c.length>1?(s=this.startNodeAt(o,u),s.expressions=c,this.finishNodeAt(s,"SequenceExpression",N,A)):s=c[0];}else s=this.parseParenExpression();if(this.options.preserveParens){var q=this.startNodeAt(i,r);return q.expression=s,this.finishNode(q,"ParenthesizedExpression")}else return s};y.parseParenItem=function(e){return e};y.parseParenArrowList=function(e,t,i,r){return this.parseArrowExpression(this.startNodeAt(e,t),i,false,r)};var fr=[];y.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===n.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name="new",e.meta=this.finishNode(t,"Identifier"),this.next();var i=this.containsEsc;return e.property=this.parseIdent(true),e.property.name!=="target"&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),i&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var r=this.start,s=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,false,true),r,s,true,false),this.eat(n.parenL)?e.arguments=this.parseExprList(n.parenR,this.options.ecmaVersion>=8,false):e.arguments=fr,this.finishNode(e,"NewExpression")};y.parseTemplateElement=function(e){var t=e.isTagged,i=this.startNode();return this.type===n.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),i.value={raw:this.value.replace(/\r\n?/g,`
|
|
8
8
|
`),cooked:null}):i.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
|
|
9
|
-
`),cooked:this.value},this.next(),i.tail=this.type===n.backQuote,this.finishNode(i,"TemplateElement")};x.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=false);var i=this.startNode();this.next(),i.expressions=[];var r=this.parseTemplateElement({isTagged:t});for(i.quasis=[r];!r.tail;)this.type===n.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(n.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(n.braceR),i.quasis.push(r=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(i,"TemplateLiteral")};x.isAsyncProp=function(e){return !e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===n.name||this.type===n.num||this.type===n.string||this.type===n.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===n.star)&&!j.test(this.input.slice(this.lastTokEnd,this.start))};x.parseObj=function(e,t){var i=this.startNode(),r=true,s={};for(i.properties=[],this.next();!this.eat(n.braceR);){if(r)r=false;else if(this.expect(n.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(n.braceR))break;var a=this.parseProperty(e,t);e||this.checkPropClash(a,s,t),i.properties.push(a);}return this.finishNode(i,e?"ObjectPattern":"ObjectExpression")};x.parseProperty=function(e,t){var i=this.startNode(),r,s,a,o;if(this.options.ecmaVersion>=9&&this.eat(n.ellipsis))return e?(i.argument=this.parseIdent(false),this.type===n.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(i,"RestElement")):(i.argument=this.parseMaybeAssign(false,t),this.type===n.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(i,"SpreadElement"));this.options.ecmaVersion>=6&&(i.method=false,i.shorthand=false,(e||t)&&(a=this.start,o=this.startLoc),e||(r=this.eat(n.star)));var u=this.containsEsc;return this.parsePropertyName(i),!e&&!u&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(i)?(s=true,r=this.options.ecmaVersion>=9&&this.eat(n.star),this.parsePropertyName(i)):s=false,this.parsePropertyValue(i,e,r,s,a,o,t,u),this.finishNode(i,"Property")};x.parseGetterSetter=function(e){var t=e.key.name;this.parsePropertyName(e),e.value=this.parseMethod(false),e.kind=t;var i=e.kind==="get"?0:1;if(e.value.params.length!==i){var r=e.value.start;e.kind==="get"?this.raiseRecoverable(r,"getter should have no params"):this.raiseRecoverable(r,"setter should have exactly one param");}else e.kind==="set"&&e.value.params[0].type==="RestElement"&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params");};x.parsePropertyValue=function(e,t,i,r,s,a,o,u){(i||r)&&this.type===n.colon&&this.unexpected(),this.eat(n.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(false,o),e.kind="init"):this.options.ecmaVersion>=6&&this.type===n.parenL?(t&&this.unexpected(),e.method=true,e.value=this.parseMethod(i,r),e.kind="init"):!t&&!u&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.type!==n.comma&&this.type!==n.braceR&&this.type!==n.eq?((i||r)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"?((i||r)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=s),t?e.value=this.parseMaybeDefault(s,a,this.copyNode(e.key)):this.type===n.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(s,a,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.kind="init",e.shorthand=true):this.unexpected();};x.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(n.bracketL))return e.computed=true,e.key=this.parseMaybeAssign(),this.expect(n.bracketR),e.key;e.computed=false;}return e.key=this.type===n.num||this.type===n.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};x.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=false),this.options.ecmaVersion>=8&&(e.async=false);};x.parseMethod=function(e,t,i){var r=this.startNode(),s=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=e),this.options.ecmaVersion>=8&&(r.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(st(t,r.generator)|Le|(i?ui:0)),this.expect(n.parenL),r.params=this.parseBindingList(n.parenR,false,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,false,true,false),this.yieldPos=s,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(r,"FunctionExpression")};x.parseArrowExpression=function(e,t,i,r){var s=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.enterScope(st(i,false)|rt),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!i),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,true),this.parseFunctionBody(e,true,false,r),this.yieldPos=s,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(e,"ArrowFunctionExpression")};x.parseFunctionBody=function(e,t,i,r){var s=t&&this.type!==n.braceL,a=this.strict,o=false;if(s)e.body=this.parseMaybeAssign(r),e.expression=true,this.checkParams(e,false);else {var u=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!a||u)&&(o=this.strictDirective(this.end),o&&u&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var c=this.labels;this.labels=[],o&&(this.strict=true),this.checkParams(e,!a&&!o&&!t&&!i&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,hi),e.body=this.parseBlock(false,void 0,o&&!a),e.expression=false,this.adaptDirectivePrologue(e.body.body),this.labels=c;}this.exitScope();};x.isSimpleParamList=function(e){for(var t=0,i=e;t<i.length;t+=1){var r=i[t];if(r.type!=="Identifier")return false}return true};x.checkParams=function(e,t){for(var i=Object.create(null),r=0,s=e.params;r<s.length;r+=1){var a=s[r];this.checkLValInnerPattern(a,at,t?null:i);}};x.parseExprList=function(e,t,i,r){for(var s=[],a=true;!this.eat(e);){if(a)a=false;else if(this.expect(n.comma),t&&this.afterTrailingComma(e))break;var o=void 0;i&&this.type===n.comma?o=null:this.type===n.ellipsis?(o=this.parseSpread(r),r&&this.type===n.comma&&r.trailingComma<0&&(r.trailingComma=this.start)):o=this.parseMaybeAssign(false,r),s.push(o);}return s};x.checkUnreserved=function(e){var t=e.start,i=e.end,r=e.name;if(this.inGenerator&&r==="yield"&&this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&r==="await"&&this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function"),!(this.currentThisScope().flags&Oe)&&r==="arguments"&&this.raiseRecoverable(t,"Cannot use 'arguments' in class field initializer"),this.inClassStaticBlock&&(r==="arguments"||r==="await")&&this.raise(t,"Cannot use "+r+" in class static initialization block"),this.keywords.test(r)&&this.raise(t,"Unexpected keyword '"+r+"'"),!(this.options.ecmaVersion<6&&this.input.slice(t,i).indexOf("\\")!==-1)){var s=this.strict?this.reservedWordsStrict:this.reservedWords;s.test(r)&&(!this.inAsync&&r==="await"&&this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(t,"The keyword '"+r+"' is reserved"));}};x.parseIdent=function(e){var t=this.parseIdentNode();return this.next(!!e),this.finishNode(t,"Identifier"),e||(this.checkUnreserved(t),t.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=t.start)),t};x.parseIdentNode=function(){var e=this.startNode();return this.type===n.name?e.name=this.value:this.type.keyword?(e.name=this.type.keyword,(e.name==="class"||e.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop(),this.type=n.name):this.unexpected(),e};x.parsePrivateIdent=function(){var e=this.startNode();return this.type===n.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,"PrivateIdentifier"),this.options.checkPrivateFields&&(this.privateNameStack.length===0?this.raise(e.start,"Private field '#"+e.name+"' must be declared in an enclosing class"):this.privateNameStack[this.privateNameStack.length-1].used.push(e)),e};x.parseYield=function(e){this.yieldPos||(this.yieldPos=this.start);var t=this.startNode();return this.next(),this.type===n.semi||this.canInsertSemicolon()||this.type!==n.star&&!this.type.startsExpr?(t.delegate=false,t.argument=null):(t.delegate=this.eat(n.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,"YieldExpression")};x.parseAwait=function(e){this.awaitPos||(this.awaitPos=this.start);var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,true,false,e),this.finishNode(t,"AwaitExpression")};var Te=N.prototype;Te.raise=function(e,t){var i=ai(this.input,e);t+=" ("+i.line+":"+i.column+")",this.sourceFile&&(t+=" in "+this.sourceFile);var r=new SyntaxError(t);throw r.pos=e,r.loc=i,r.raisedAt=this.pos,r};Te.raiseRecoverable=Te.raise;Te.curPosition=function(){if(this.options.locations)return new xe(this.curLine,this.pos-this.lineStart)};var se=N.prototype,dr=function(t){this.flags=t,this.var=[],this.lexical=[],this.functions=[];};se.enterScope=function(e){this.scopeStack.push(new dr(e));};se.exitScope=function(){this.scopeStack.pop();};se.treatFunctionsAsVarInScope=function(e){return e.flags&oe||!this.inModule&&e.flags&ne};se.declareName=function(e,t,i){var r=false;if(t===ee){var s=this.currentScope();r=s.lexical.indexOf(e)>-1||s.functions.indexOf(e)>-1||s.var.indexOf(e)>-1,s.lexical.push(e),this.inModule&&s.flags&ne&&delete this.undefinedExports[e];}else if(t===pi){var a=this.currentScope();a.lexical.push(e);}else if(t===li){var o=this.currentScope();this.treatFunctionsAsVar?r=o.lexical.indexOf(e)>-1:r=o.lexical.indexOf(e)>-1||o.var.indexOf(e)>-1,o.functions.push(e);}else for(var u=this.scopeStack.length-1;u>=0;--u){var c=this.scopeStack[u];if(c.lexical.indexOf(e)>-1&&!(c.flags&oi&&c.lexical[0]===e)||!this.treatFunctionsAsVarInScope(c)&&c.functions.indexOf(e)>-1){r=true;break}if(c.var.push(e),this.inModule&&c.flags&ne&&delete this.undefinedExports[e],c.flags&Oe)break}r&&this.raiseRecoverable(i,"Identifier '"+e+"' has already been declared");};se.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e);};se.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};se.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(Oe|ye|ue))return t}};se.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(Oe|ye|ue)&&!(t.flags&rt))return t}};var Me=function(t,i,r){this.type="",this.start=i,this.end=0,t.options.locations&&(this.loc=new Re(t,r)),t.options.directSourceFile&&(this.sourceFile=t.options.directSourceFile),t.options.ranges&&(this.range=[i,0]);},ve=N.prototype;ve.startNode=function(){return new Me(this,this.start,this.startLoc)};ve.startNodeAt=function(e,t){return new Me(this,e,t)};function mi(e,t,i,r){return e.type=t,e.end=i,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=i),e}ve.finishNode=function(e,t){return mi.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)};ve.finishNodeAt=function(e,t,i,r){return mi.call(this,e,t,i,r)};ve.copyNode=function(e){var t=new Me(this,e.start,this.startLoc);for(var i in e)t[i]=e[i];return t};var mr="Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz",gi="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",xi=gi+" Extended_Pictographic",yi=xi,vi=yi+" EBase EComp EMod EPres ExtPict",bi=vi,gr=bi,xr={9:gi,10:xi,11:yi,12:vi,13:bi,14:gr},yr="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",vr={9:"",10:"",11:"",12:"",13:"",14:yr},Yt="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",Si="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Ei=Si+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",_i=Ei+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",wi=_i+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",Pi=wi+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",br=Pi+" "+mr,Sr={9:Si,10:Ei,11:_i,12:wi,13:Pi,14:br},ki={};function Er(e){var t=ki[e]={binary:ie(xr[e]+" "+Yt),binaryOfStrings:ie(vr[e]),nonBinary:{General_Category:ie(Yt),Script:ie(Sr[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions;}for(Ae=0,Qe=[9,10,11,12,13,14];Ae<Qe.length;Ae+=1)Jt=Qe[Ae],Er(Jt);var Jt,Ae,Qe,f=N.prototype,Ne=function(t,i){this.parent=t,this.base=i||this;};Ne.prototype.separatedFrom=function(t){for(var i=this;i;i=i.parent)for(var r=t;r;r=r.parent)if(i.base===r.base&&i!==r)return true;return false};Ne.prototype.sibling=function(){return new Ne(this.parent,this.base)};var K=function(t){this.parser=t,this.validFlags="gim"+(t.options.ecmaVersion>=6?"uy":"")+(t.options.ecmaVersion>=9?"s":"")+(t.options.ecmaVersion>=13?"d":"")+(t.options.ecmaVersion>=15?"v":""),this.unicodeProperties=ki[t.options.ecmaVersion>=14?14:t.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=false,this.switchV=false,this.switchN=false,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=false,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null;};K.prototype.reset=function(t,i,r){var s=r.indexOf("v")!==-1,a=r.indexOf("u")!==-1;this.start=t|0,this.source=i+"",this.flags=r,s&&this.parser.options.ecmaVersion>=15?(this.switchU=true,this.switchV=true,this.switchN=true):(this.switchU=a&&this.parser.options.ecmaVersion>=6,this.switchV=false,this.switchN=a&&this.parser.options.ecmaVersion>=9);};K.prototype.raise=function(t){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+t);};K.prototype.at=function(t,i){i===void 0&&(i=false);var r=this.source,s=r.length;if(t>=s)return -1;var a=r.charCodeAt(t);if(!(i||this.switchU)||a<=55295||a>=57344||t+1>=s)return a;var o=r.charCodeAt(t+1);return o>=56320&&o<=57343?(a<<10)+o-56613888:a};K.prototype.nextIndex=function(t,i){i===void 0&&(i=false);var r=this.source,s=r.length;if(t>=s)return s;var a=r.charCodeAt(t),o;return !(i||this.switchU)||a<=55295||a>=57344||t+1>=s||(o=r.charCodeAt(t+1))<56320||o>57343?t+1:t+2};K.prototype.current=function(t){return t===void 0&&(t=false),this.at(this.pos,t)};K.prototype.lookahead=function(t){return t===void 0&&(t=false),this.at(this.nextIndex(this.pos,t),t)};K.prototype.advance=function(t){t===void 0&&(t=false),this.pos=this.nextIndex(this.pos,t);};K.prototype.eat=function(t,i){return i===void 0&&(i=false),this.current(i)===t?(this.advance(i),true):false};K.prototype.eatChars=function(t,i){i===void 0&&(i=false);for(var r=this.pos,s=0,a=t;s<a.length;s+=1){var o=a[s],u=this.at(r,i);if(u===-1||u!==o)return false;r=this.nextIndex(r,i);}return this.pos=r,true};f.validateRegExpFlags=function(e){for(var t=e.validFlags,i=e.flags,r=false,s=false,a=0;a<i.length;a++){var o=i.charAt(a);t.indexOf(o)===-1&&this.raise(e.start,"Invalid regular expression flag"),i.indexOf(o,a+1)>-1&&this.raise(e.start,"Duplicate regular expression flag"),o==="u"&&(r=true),o==="v"&&(s=true);}this.options.ecmaVersion>=15&&r&&s&&this.raise(e.start,"Invalid regular expression flag");};function _r(e){for(var t in e)return true;return false}f.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&_r(e.groupNames)&&(e.switchN=true,this.regexp_pattern(e));};f.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=false,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,i=e.backReferenceNames;t<i.length;t+=1){var r=i[t];e.groupNames[r]||e.raise("Invalid named capture referenced");}};f.regexp_disjunction=function(e){var t=this.options.ecmaVersion>=16;for(t&&(e.branchID=new Ne(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,true)&&e.raise("Nothing to repeat"),e.eat(123)&&e.raise("Lone quantifier brackets");};f.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););};f.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise("Invalid quantifier"),true):(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))?(this.regexp_eatQuantifier(e),true):false};f.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=false,e.eat(94)||e.eat(36))return true;if(e.eat(92)){if(e.eat(66)||e.eat(98))return true;e.pos=t;}if(e.eat(40)&&e.eat(63)){var i=false;if(this.options.ecmaVersion>=9&&(i=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!i,true}return e.pos=t,false};f.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=false),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),true):false};f.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)};f.regexp_eatBracedQuantifier=function(e,t){var i=e.pos;if(e.eat(123)){var r=0,s=-1;if(this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(s=e.lastIntValue),e.eat(125)))return s!==-1&&s<r&&!t&&e.raise("numbers out of order in {} quantifier"),true;e.switchU&&!t&&e.raise("Incomplete quantifier"),e.pos=i;}return false};f.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)};f.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return true;e.pos=t;}return false};f.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)){if(this.options.ecmaVersion>=16){var i=this.regexp_eatModifiers(e),r=e.eat(45);if(i||r){for(var s=0;s<i.length;s++){var a=i.charAt(s);i.indexOf(a,s+1)>-1&&e.raise("Duplicate regular expression modifiers");}if(r){var o=this.regexp_eatModifiers(e);!i&&!o&&e.current()===58&&e.raise("Invalid regular expression modifiers");for(var u=0;u<o.length;u++){var c=o.charAt(u);(o.indexOf(c,u+1)>-1||i.indexOf(c)>-1)&&e.raise("Duplicate regular expression modifiers");}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return true;e.raise("Unterminated group");}}e.pos=t;}return false};f.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,true;e.raise("Unterminated group");}return false};f.regexp_eatModifiers=function(e){for(var t="",i=0;(i=e.current())!==-1&&wr(i);)t+=J(i),e.advance();return t};function wr(e){return e===105||e===109||e===115}f.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)};f.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,true)&&e.raise("Nothing to repeat"),false};f.regexp_eatSyntaxCharacter=function(e){var t=e.current();return Ai(t)?(e.lastIntValue=t,e.advance(),true):false};function Ai(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}f.regexp_eatPatternCharacters=function(e){for(var t=e.pos,i=0;(i=e.current())!==-1&&!Ai(i);)e.advance();return e.pos!==t};f.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124?(e.advance(),true):false};f.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise("Invalid group");var t=this.options.ecmaVersion>=16,i=e.groupNames[e.lastStringValue];if(i)if(t)for(var r=0,s=i;r<s.length;r+=1){var a=s[r];a.separatedFrom(e.branchID)||e.raise("Duplicate capture group name");}else e.raise("Duplicate capture group name");t?(i||(e.groupNames[e.lastStringValue]=[])).push(e.branchID):e.groupNames[e.lastStringValue]=true;}};f.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return true;e.raise("Invalid capture group name");}return false};f.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=J(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=J(e.lastIntValue);return true}return false};f.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,r=e.current(i);return e.advance(i),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(r=e.lastIntValue),Pr(r)?(e.lastIntValue=r,true):(e.pos=t,false)};function Pr(e){return H(e,true)||e===36||e===95}f.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,r=e.current(i);return e.advance(i),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(r=e.lastIntValue),kr(r)?(e.lastIntValue=r,true):(e.pos=t,false)};function kr(e){return re(e,true)||e===36||e===95||e===8204||e===8205}f.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?true:(e.switchU&&(e.current()===99&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),false)};f.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var i=e.lastIntValue;if(e.switchU)return i>e.maxBackReference&&(e.maxBackReference=i),true;if(i<=e.numCapturingParens)return true;e.pos=t;}return false};f.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),true;e.raise("Invalid named reference");}return false};f.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,false)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)};f.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return true;e.pos=t;}return false};f.regexp_eatZero=function(e){return e.current()===48&&!Ve(e.lookahead())?(e.lastIntValue=0,e.advance(),true):false};f.regexp_eatControlEscape=function(e){var t=e.current();return t===116?(e.lastIntValue=9,e.advance(),true):t===110?(e.lastIntValue=10,e.advance(),true):t===118?(e.lastIntValue=11,e.advance(),true):t===102?(e.lastIntValue=12,e.advance(),true):t===114?(e.lastIntValue=13,e.advance(),true):false};f.regexp_eatControlLetter=function(e){var t=e.current();return Ci(t)?(e.lastIntValue=t%32,e.advance(),true):false};function Ci(e){return e>=65&&e<=90||e>=97&&e<=122}f.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){t===void 0&&(t=false);var i=e.pos,r=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var s=e.lastIntValue;if(r&&s>=55296&&s<=56319){var a=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var o=e.lastIntValue;if(o>=56320&&o<=57343)return e.lastIntValue=(s-55296)*1024+(o-56320)+65536,true}e.pos=a,e.lastIntValue=s;}return true}if(r&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&Ar(e.lastIntValue))return true;r&&e.raise("Invalid unicode escape"),e.pos=i;}return false};function Ar(e){return e>=0&&e<=1114111}f.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?true:e.eat(47)?(e.lastIntValue=47,true):false;var t=e.current();return t!==99&&(!e.switchN||t!==107)?(e.lastIntValue=t,e.advance(),true):false};f.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();while((t=e.current())>=48&&t<=57);return true}return false};var Ii=0,X=1,z=2;f.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(Cr(t))return e.lastIntValue=-1,e.advance(),X;var i=false;if(e.switchU&&this.options.ecmaVersion>=9&&((i=t===80)||t===112)){e.lastIntValue=-1,e.advance();var r;if(e.eat(123)&&(r=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return i&&r===z&&e.raise("Invalid property name"),r;e.raise("Invalid property name");}return Ii};function Cr(e){return e===100||e===68||e===115||e===83||e===119||e===87}f.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var i=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,i,r),X}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var s=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,s)}return Ii};f.regexp_validateUnicodePropertyNameAndValue=function(e,t,i){pe(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(i)||e.raise("Invalid property value");};f.regexp_validateUnicodePropertyNameOrValue=function(e,t){if(e.unicodeProperties.binary.test(t))return X;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(t))return z;e.raise("Invalid property name");};f.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";Ti(t=e.current());)e.lastStringValue+=J(t),e.advance();return e.lastStringValue!==""};function Ti(e){return Ci(e)||e===95}f.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";Ir(t=e.current());)e.lastStringValue+=J(t),e.advance();return e.lastStringValue!==""};function Ir(e){return Ti(e)||Ve(e)}f.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)};f.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),i=this.regexp_classContents(e);return e.eat(93)||e.raise("Unterminated character class"),t&&i===z&&e.raise("Negated character class may contain strings"),true}return false};f.regexp_classContents=function(e){return e.current()===93?X:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),X)};f.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var i=e.lastIntValue;e.switchU&&(t===-1||i===-1)&&e.raise("Invalid character class"),t!==-1&&i!==-1&&t>i&&e.raise("Range out of order in character class");}}};f.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return true;if(e.switchU){var i=e.current();(i===99||Li(i))&&e.raise("Invalid class escape"),e.raise("Invalid escape");}e.pos=t;}var r=e.current();return r!==93?(e.lastIntValue=r,e.advance(),true):false};f.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,true;if(e.switchU&&e.eat(45))return e.lastIntValue=45,true;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return true;e.pos=t;}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)};f.regexp_classSetExpression=function(e){var t=X,i;if(!this.regexp_eatClassSetRange(e))if(i=this.regexp_eatClassSetOperand(e)){i===z&&(t=z);for(var r=e.pos;e.eatChars([38,38]);){if(e.current()!==38&&(i=this.regexp_eatClassSetOperand(e))){i!==z&&(t=X);continue}e.raise("Invalid character in character class");}if(r!==e.pos)return t;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise("Invalid character in character class");if(r!==e.pos)return t}else e.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(e)){if(i=this.regexp_eatClassSetOperand(e),!i)return t;i===z&&(t=z);}};f.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var i=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var r=e.lastIntValue;return i!==-1&&r!==-1&&i>r&&e.raise("Range out of order in character class"),true}e.pos=t;}return false};f.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?X:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)};f.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var i=e.eat(94),r=this.regexp_classContents(e);if(e.eat(93))return i&&r===z&&e.raise("Negated character class may contain strings"),r;e.pos=t;}if(e.eat(92)){var s=this.regexp_eatCharacterClassEscape(e);if(s)return s;e.pos=t;}return null};f.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var i=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return i}else e.raise("Invalid escape");e.pos=t;}return null};f.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===z&&(t=z);return t};f.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return t===1?X:z};f.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?true:e.eat(98)?(e.lastIntValue=8,true):(e.pos=t,false);var i=e.current();return i<0||i===e.lookahead()&&Tr(i)||Nr(i)?false:(e.advance(),e.lastIntValue=i,true)};function Tr(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function Nr(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}f.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return Rr(t)?(e.lastIntValue=t,e.advance(),true):false};function Rr(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}f.regexp_eatClassControlLetter=function(e){var t=e.current();return Ve(t)||t===95?(e.lastIntValue=t%32,e.advance(),true):false};f.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return true;e.switchU&&e.raise("Invalid escape"),e.pos=t;}return false};f.regexp_eatDecimalDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;Ve(i=e.current());)e.lastIntValue=10*e.lastIntValue+(i-48),e.advance();return e.pos!==t};function Ve(e){return e>=48&&e<=57}f.regexp_eatHexDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;Ni(i=e.current());)e.lastIntValue=16*e.lastIntValue+Ri(i),e.advance();return e.pos!==t};function Ni(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Ri(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}f.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var i=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=t*64+i*8+e.lastIntValue:e.lastIntValue=t*8+i;}else e.lastIntValue=t;return true}return false};f.regexp_eatOctalDigit=function(e){var t=e.current();return Li(t)?(e.lastIntValue=t-48,e.advance(),true):(e.lastIntValue=0,false)};function Li(e){return e>=48&&e<=55}f.regexp_eatFixedHexDigits=function(e,t){var i=e.pos;e.lastIntValue=0;for(var r=0;r<t;++r){var s=e.current();if(!Ni(s))return e.pos=i,false;e.lastIntValue=16*e.lastIntValue+Ri(s),e.advance();}return true};var ot=function(t){this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,t.options.locations&&(this.loc=new Re(t,t.startLoc,t.endLoc)),t.options.ranges&&(this.range=[t.start,t.end]);},E=N.prototype;E.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new ot(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken();};E.getToken=function(){return this.next(),new ot(this)};typeof Symbol<"u"&&(E[Symbol.iterator]=function(){var e=this;return {next:function(){var t=e.getToken();return {done:t.type===n.eof,value:t}}}});E.nextToken=function(){var e=this.curContext();if((!e||!e.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(n.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos());};E.readToken=function(e){return H(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)};E.fullCharCodeAt=function(e){var t=this.input.charCodeAt(e);if(t<=55295||t>=56320)return t;var i=this.input.charCodeAt(e+1);return i<=56319||i>=57344?t:(t<<10)+i-56613888};E.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)};E.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(i===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=i+2,this.options.locations)for(var r=void 0,s=t;(r=ii(this.input,s,this.pos))>-1;)++this.curLine,s=this.lineStart=r;this.options.onComment&&this.options.onComment(true,this.input.slice(t+2,i),t,this.pos,e,this.curPosition());};E.skipLineComment=function(e){for(var t=this.pos,i=this.options.onComment&&this.curPosition(),r=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!le(r);)r=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(false,this.input.slice(t+e,this.pos),t,this.pos,i,this.curPosition());};E.skipSpace=function(){e:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(e>8&&e<14||e>=5760&&ri.test(String.fromCharCode(e)))++this.pos;else break e}}};E.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var i=this.type;this.type=e,this.value=t,this.updateContext(i);};E.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(true);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&t===46?(this.pos+=3,this.finishToken(n.ellipsis)):(++this.pos,this.finishToken(n.dot))};E.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(n.assign,2):this.finishOp(n.slash,1)};E.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),i=1,r=e===42?n.star:n.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++i,r=n.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(n.assign,i+1):this.finishOp(r,i)};E.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(this.options.ecmaVersion>=12){var i=this.input.charCodeAt(this.pos+2);if(i===61)return this.finishOp(n.assign,3)}return this.finishOp(e===124?n.logicalOR:n.logicalAND,2)}return t===61?this.finishOp(n.assign,2):this.finishOp(e===124?n.bitwiseOR:n.bitwiseAND,1)};E.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(n.assign,2):this.finishOp(n.bitwiseXOR,1)};E.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||j.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(n.incDec,2):t===61?this.finishOp(n.assign,2):this.finishOp(n.plusMin,1)};E.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),i=1;return t===e?(i=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+i)===61?this.finishOp(n.assign,i+1):this.finishOp(n.bitShift,i)):t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(t===61&&(i=2),this.finishOp(n.relational,i))};E.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(n.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(n.arrow)):this.finishOp(e===61?n.eq:n.prefix,1)};E.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var i=this.input.charCodeAt(this.pos+2);if(i<48||i>57)return this.finishOp(n.questionDot,2)}if(t===63){if(e>=12){var r=this.input.charCodeAt(this.pos+2);if(r===61)return this.finishOp(n.assign,3)}return this.finishOp(n.coalesce,2)}}return this.finishOp(n.question,1)};E.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),H(t,true)||t===92))return this.finishToken(n.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+J(t)+"'");};E.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return ++this.pos,this.finishToken(n.parenL);case 41:return ++this.pos,this.finishToken(n.parenR);case 59:return ++this.pos,this.finishToken(n.semi);case 44:return ++this.pos,this.finishToken(n.comma);case 91:return ++this.pos,this.finishToken(n.bracketL);case 93:return ++this.pos,this.finishToken(n.bracketR);case 123:return ++this.pos,this.finishToken(n.braceL);case 125:return ++this.pos,this.finishToken(n.braceR);case 58:return ++this.pos,this.finishToken(n.colon);case 96:if(this.options.ecmaVersion<6)break;return ++this.pos,this.finishToken(n.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(false);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(n.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+J(e)+"'");};E.finishOp=function(e,t){var i=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,i)};E.readRegexp=function(){for(var e,t,i=this.pos;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");var r=this.input.charAt(this.pos);if(j.test(r)&&this.raise(i,"Unterminated regular expression"),e)e=false;else {if(r==="[")t=true;else if(r==="]"&&t)t=false;else if(r==="/"&&!t)break;e=r==="\\";}++this.pos;}var s=this.input.slice(i,this.pos);++this.pos;var a=this.pos,o=this.readWord1();this.containsEsc&&this.unexpected(a);var u=this.regexpState||(this.regexpState=new K(this));u.reset(i,s,o),this.validateRegExpFlags(u),this.validateRegExpPattern(u);var c=null;try{c=new RegExp(s,o);}catch{}return this.finishToken(n.regexp,{pattern:s,flags:o,value:c})};E.readInt=function(e,t,i){for(var r=this.options.ecmaVersion>=12&&t===void 0,s=i&&this.input.charCodeAt(this.pos)===48,a=this.pos,o=0,u=0,c=0,l=t??1/0;c<l;++c,++this.pos){var p=this.input.charCodeAt(this.pos),m=void 0;if(r&&p===95){s&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),u===95&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),c===0&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),u=p;continue}if(p>=97?m=p-97+10:p>=65?m=p-65+10:p>=48&&p<=57?m=p-48:m=1/0,m>=e)break;u=p,o=o*e+m;}return r&&u===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===a||t!=null&&this.pos-a!==t?null:o};function Lr(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,""))}function Oi(e){return typeof BigInt!="function"?null:BigInt(e.replace(/_/g,""))}E.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var i=this.readInt(e);return i==null&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(i=Oi(this.input.slice(t,this.pos)),++this.pos):H(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(n.num,i)};E.readNumber=function(e){var t=this.pos;!e&&this.readInt(10,void 0,true)===null&&this.raise(t,"Invalid number");var i=this.pos-t>=2&&this.input.charCodeAt(t)===48;i&&this.strict&&this.raise(t,"Invalid number");var r=this.input.charCodeAt(this.pos);if(!i&&!e&&this.options.ecmaVersion>=11&&r===110){var s=Oi(this.input.slice(t,this.pos));return ++this.pos,H(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(n.num,s)}i&&/[89]/.test(this.input.slice(t,this.pos))&&(i=false),r===46&&!i&&(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),(r===69||r===101)&&!i&&(r=this.input.charCodeAt(++this.pos),(r===43||r===45)&&++this.pos,this.readInt(10)===null&&this.raise(t,"Invalid number")),H(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var a=Lr(this.input.slice(t,this.pos),i);return this.finishToken(n.num,a)};E.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var i=++this.pos;t=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(i,"Code point out of bounds");}else t=this.readHexChar(4);return t};E.readString=function(e){for(var t="",i=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var r=this.input.charCodeAt(this.pos);if(r===e)break;r===92?(t+=this.input.slice(i,this.pos),t+=this.readEscapedChar(false),i=this.pos):r===8232||r===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(le(r)&&this.raise(this.start,"Unterminated string constant"),++this.pos);}return t+=this.input.slice(i,this.pos++),this.finishToken(n.string,t)};var Di={};E.tryReadTemplateToken=function(){this.inTemplateElement=true;try{this.readTmplToken();}catch(e){if(e===Di)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=false;};E.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Di;this.raise(e,t);};E.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var i=this.input.charCodeAt(this.pos);if(i===96||i===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===n.template||this.type===n.invalidTemplate)?i===36?(this.pos+=2,this.finishToken(n.dollarBraceL)):(++this.pos,this.finishToken(n.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(n.template,e));if(i===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(true),t=this.pos;else if(le(i)){switch(e+=this.input.slice(t,this.pos),++this.pos,i){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=`
|
|
9
|
+
`),cooked:this.value},this.next(),i.tail=this.type===n.backQuote,this.finishNode(i,"TemplateElement")};y.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=false);var i=this.startNode();this.next(),i.expressions=[];var r=this.parseTemplateElement({isTagged:t});for(i.quasis=[r];!r.tail;)this.type===n.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(n.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(n.braceR),i.quasis.push(r=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(i,"TemplateLiteral")};y.isAsyncProp=function(e){return !e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===n.name||this.type===n.num||this.type===n.string||this.type===n.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===n.star)&&!j.test(this.input.slice(this.lastTokEnd,this.start))};y.parseObj=function(e,t){var i=this.startNode(),r=true,s={};for(i.properties=[],this.next();!this.eat(n.braceR);){if(r)r=false;else if(this.expect(n.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(n.braceR))break;var a=this.parseProperty(e,t);e||this.checkPropClash(a,s,t),i.properties.push(a);}return this.finishNode(i,e?"ObjectPattern":"ObjectExpression")};y.parseProperty=function(e,t){var i=this.startNode(),r,s,a,o;if(this.options.ecmaVersion>=9&&this.eat(n.ellipsis))return e?(i.argument=this.parseIdent(false),this.type===n.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(i,"RestElement")):(i.argument=this.parseMaybeAssign(false,t),this.type===n.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(i,"SpreadElement"));this.options.ecmaVersion>=6&&(i.method=false,i.shorthand=false,(e||t)&&(a=this.start,o=this.startLoc),e||(r=this.eat(n.star)));var u=this.containsEsc;return this.parsePropertyName(i),!e&&!u&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(i)?(s=true,r=this.options.ecmaVersion>=9&&this.eat(n.star),this.parsePropertyName(i)):s=false,this.parsePropertyValue(i,e,r,s,a,o,t,u),this.finishNode(i,"Property")};y.parseGetterSetter=function(e){var t=e.key.name;this.parsePropertyName(e),e.value=this.parseMethod(false),e.kind=t;var i=e.kind==="get"?0:1;if(e.value.params.length!==i){var r=e.value.start;e.kind==="get"?this.raiseRecoverable(r,"getter should have no params"):this.raiseRecoverable(r,"setter should have exactly one param");}else e.kind==="set"&&e.value.params[0].type==="RestElement"&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params");};y.parsePropertyValue=function(e,t,i,r,s,a,o,u){(i||r)&&this.type===n.colon&&this.unexpected(),this.eat(n.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(false,o),e.kind="init"):this.options.ecmaVersion>=6&&this.type===n.parenL?(t&&this.unexpected(),e.method=true,e.value=this.parseMethod(i,r),e.kind="init"):!t&&!u&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.type!==n.comma&&this.type!==n.braceR&&this.type!==n.eq?((i||r)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"?((i||r)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=s),t?e.value=this.parseMaybeDefault(s,a,this.copyNode(e.key)):this.type===n.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(s,a,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.kind="init",e.shorthand=true):this.unexpected();};y.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(n.bracketL))return e.computed=true,e.key=this.parseMaybeAssign(),this.expect(n.bracketR),e.key;e.computed=false;}return e.key=this.type===n.num||this.type===n.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};y.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=false),this.options.ecmaVersion>=8&&(e.async=false);};y.parseMethod=function(e,t,i){var r=this.startNode(),s=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=e),this.options.ecmaVersion>=8&&(r.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(nt(t,r.generator)|Me|(i?ci:0)),this.expect(n.parenL),r.params=this.parseBindingList(n.parenR,false,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,false,true,false),this.yieldPos=s,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(r,"FunctionExpression")};y.parseArrowExpression=function(e,t,i,r){var s=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.enterScope(nt(i,false)|at),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!i),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,true),this.parseFunctionBody(e,true,false,r),this.yieldPos=s,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(e,"ArrowFunctionExpression")};y.parseFunctionBody=function(e,t,i,r){var s=t&&this.type!==n.braceL,a=this.strict,o=false;if(s)e.body=this.parseMaybeAssign(r),e.expression=true,this.checkParams(e,false);else {var u=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!a||u)&&(o=this.strictDirective(this.end),o&&u&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var c=this.labels;this.labels=[],o&&(this.strict=true),this.checkParams(e,!a&&!o&&!t&&!i&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,fi),e.body=this.parseBlock(false,void 0,o&&!a),e.expression=false,this.adaptDirectivePrologue(e.body.body),this.labels=c;}this.exitScope();};y.isSimpleParamList=function(e){for(var t=0,i=e;t<i.length;t+=1){var r=i[t];if(r.type!=="Identifier")return false}return true};y.checkParams=function(e,t){for(var i=Object.create(null),r=0,s=e.params;r<s.length;r+=1){var a=s[r];this.checkLValInnerPattern(a,ot,t?null:i);}};y.parseExprList=function(e,t,i,r){for(var s=[],a=true;!this.eat(e);){if(a)a=false;else if(this.expect(n.comma),t&&this.afterTrailingComma(e))break;var o=void 0;i&&this.type===n.comma?o=null:this.type===n.ellipsis?(o=this.parseSpread(r),r&&this.type===n.comma&&r.trailingComma<0&&(r.trailingComma=this.start)):o=this.parseMaybeAssign(false,r),s.push(o);}return s};y.checkUnreserved=function(e){var t=e.start,i=e.end,r=e.name;if(this.inGenerator&&r==="yield"&&this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&r==="await"&&this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function"),!(this.currentThisScope().flags&Ve)&&r==="arguments"&&this.raiseRecoverable(t,"Cannot use 'arguments' in class field initializer"),this.inClassStaticBlock&&(r==="arguments"||r==="await")&&this.raise(t,"Cannot use "+r+" in class static initialization block"),this.keywords.test(r)&&this.raise(t,"Unexpected keyword '"+r+"'"),!(this.options.ecmaVersion<6&&this.input.slice(t,i).indexOf("\\")!==-1)){var s=this.strict?this.reservedWordsStrict:this.reservedWords;s.test(r)&&(!this.inAsync&&r==="await"&&this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(t,"The keyword '"+r+"' is reserved"));}};y.parseIdent=function(e){var t=this.parseIdentNode();return this.next(!!e),this.finishNode(t,"Identifier"),e||(this.checkUnreserved(t),t.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=t.start)),t};y.parseIdentNode=function(){var e=this.startNode();return this.type===n.name?e.name=this.value:this.type.keyword?(e.name=this.type.keyword,(e.name==="class"||e.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop(),this.type=n.name):this.unexpected(),e};y.parsePrivateIdent=function(){var e=this.startNode();return this.type===n.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,"PrivateIdentifier"),this.options.checkPrivateFields&&(this.privateNameStack.length===0?this.raise(e.start,"Private field '#"+e.name+"' must be declared in an enclosing class"):this.privateNameStack[this.privateNameStack.length-1].used.push(e)),e};y.parseYield=function(e){this.yieldPos||(this.yieldPos=this.start);var t=this.startNode();return this.next(),this.type===n.semi||this.canInsertSemicolon()||this.type!==n.star&&!this.type.startsExpr?(t.delegate=false,t.argument=null):(t.delegate=this.eat(n.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,"YieldExpression")};y.parseAwait=function(e){this.awaitPos||(this.awaitPos=this.start);var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,true,false,e),this.finishNode(t,"AwaitExpression")};var Le=R.prototype;Le.raise=function(e,t){var i=ni(this.input,e);t+=" ("+i.line+":"+i.column+")",this.sourceFile&&(t+=" in "+this.sourceFile);var r=new SyntaxError(t);throw r.pos=e,r.loc=i,r.raisedAt=this.pos,r};Le.raiseRecoverable=Le.raise;Le.curPosition=function(){if(this.options.locations)return new ve(this.curLine,this.pos-this.lineStart)};var ae=R.prototype,dr=function(t){this.flags=t,this.var=[],this.lexical=[],this.functions=[];};ae.enterScope=function(e){this.scopeStack.push(new dr(e));};ae.exitScope=function(){this.scopeStack.pop();};ae.treatFunctionsAsVarInScope=function(e){return e.flags&ce||!this.inModule&&e.flags&ue};ae.declareName=function(e,t,i){var r=false;if(t===ie){var s=this.currentScope();r=s.lexical.indexOf(e)>-1||s.functions.indexOf(e)>-1||s.var.indexOf(e)>-1,s.lexical.push(e),this.inModule&&s.flags&ue&&delete this.undefinedExports[e];}else if(t===hi){var a=this.currentScope();a.lexical.push(e);}else if(t===pi){var o=this.currentScope();this.treatFunctionsAsVar?r=o.lexical.indexOf(e)>-1:r=o.lexical.indexOf(e)>-1||o.var.indexOf(e)>-1,o.functions.push(e);}else for(var u=this.scopeStack.length-1;u>=0;--u){var c=this.scopeStack[u];if(c.lexical.indexOf(e)>-1&&!(c.flags&ui&&c.lexical[0]===e)||!this.treatFunctionsAsVarInScope(c)&&c.functions.indexOf(e)>-1){r=true;break}if(c.var.push(e),this.inModule&&c.flags&ue&&delete this.undefinedExports[e],c.flags&Ve)break}r&&this.raiseRecoverable(i,"Identifier '"+e+"' has already been declared");};ae.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e);};ae.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};ae.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(Ve|be|le))return t}};ae.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&(Ve|be|le)&&!(t.flags&at))return t}};var je=function(t,i,r){this.type="",this.start=i,this.end=0,t.options.locations&&(this.loc=new De(t,r)),t.options.directSourceFile&&(this.sourceFile=t.options.directSourceFile),t.options.ranges&&(this.range=[i,0]);},Se=R.prototype;Se.startNode=function(){return new je(this,this.start,this.startLoc)};Se.startNodeAt=function(e,t){return new je(this,e,t)};function gi(e,t,i,r){return e.type=t,e.end=i,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=i),e}Se.finishNode=function(e,t){return gi.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)};Se.finishNodeAt=function(e,t,i,r){return gi.call(this,e,t,i,r)};Se.copyNode=function(e){var t=new je(this,e.start,this.startLoc);for(var i in e)t[i]=e[i];return t};var mr="Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz",xi="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",yi=xi+" Extended_Pictographic",vi=yi,bi=vi+" EBase EComp EMod EPres ExtPict",Si=bi,gr=Si,xr={9:xi,10:yi,11:vi,12:bi,13:Si,14:gr},yr="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",vr={9:"",10:"",11:"",12:"",13:"",14:yr},Jt="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",Ei="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",_i=Ei+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",wi=_i+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Pi=wi+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",ki=Pi+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",br=ki+" "+mr,Sr={9:Ei,10:_i,11:wi,12:Pi,13:ki,14:br},Ai={};function Er(e){var t=Ai[e]={binary:re(xr[e]+" "+Jt),binaryOfStrings:re(vr[e]),nonBinary:{General_Category:re(Jt),Script:re(Sr[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions;}for(Te=0,Je=[9,10,11,12,13,14];Te<Je.length;Te+=1)Xt=Je[Te],Er(Xt);var Xt,Te,Je,f=R.prototype,Oe=function(t,i){this.parent=t,this.base=i||this;};Oe.prototype.separatedFrom=function(t){for(var i=this;i;i=i.parent)for(var r=t;r;r=r.parent)if(i.base===r.base&&i!==r)return true;return false};Oe.prototype.sibling=function(){return new Oe(this.parent,this.base)};var J=function(t){this.parser=t,this.validFlags="gim"+(t.options.ecmaVersion>=6?"uy":"")+(t.options.ecmaVersion>=9?"s":"")+(t.options.ecmaVersion>=13?"d":"")+(t.options.ecmaVersion>=15?"v":""),this.unicodeProperties=Ai[t.options.ecmaVersion>=14?14:t.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=false,this.switchV=false,this.switchN=false,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=false,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null;};J.prototype.reset=function(t,i,r){var s=r.indexOf("v")!==-1,a=r.indexOf("u")!==-1;this.start=t|0,this.source=i+"",this.flags=r,s&&this.parser.options.ecmaVersion>=15?(this.switchU=true,this.switchV=true,this.switchN=true):(this.switchU=a&&this.parser.options.ecmaVersion>=6,this.switchV=false,this.switchN=a&&this.parser.options.ecmaVersion>=9);};J.prototype.raise=function(t){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+t);};J.prototype.at=function(t,i){i===void 0&&(i=false);var r=this.source,s=r.length;if(t>=s)return -1;var a=r.charCodeAt(t);if(!(i||this.switchU)||a<=55295||a>=57344||t+1>=s)return a;var o=r.charCodeAt(t+1);return o>=56320&&o<=57343?(a<<10)+o-56613888:a};J.prototype.nextIndex=function(t,i){i===void 0&&(i=false);var r=this.source,s=r.length;if(t>=s)return s;var a=r.charCodeAt(t),o;return !(i||this.switchU)||a<=55295||a>=57344||t+1>=s||(o=r.charCodeAt(t+1))<56320||o>57343?t+1:t+2};J.prototype.current=function(t){return t===void 0&&(t=false),this.at(this.pos,t)};J.prototype.lookahead=function(t){return t===void 0&&(t=false),this.at(this.nextIndex(this.pos,t),t)};J.prototype.advance=function(t){t===void 0&&(t=false),this.pos=this.nextIndex(this.pos,t);};J.prototype.eat=function(t,i){return i===void 0&&(i=false),this.current(i)===t?(this.advance(i),true):false};J.prototype.eatChars=function(t,i){i===void 0&&(i=false);for(var r=this.pos,s=0,a=t;s<a.length;s+=1){var o=a[s],u=this.at(r,i);if(u===-1||u!==o)return false;r=this.nextIndex(r,i);}return this.pos=r,true};f.validateRegExpFlags=function(e){for(var t=e.validFlags,i=e.flags,r=false,s=false,a=0;a<i.length;a++){var o=i.charAt(a);t.indexOf(o)===-1&&this.raise(e.start,"Invalid regular expression flag"),i.indexOf(o,a+1)>-1&&this.raise(e.start,"Duplicate regular expression flag"),o==="u"&&(r=true),o==="v"&&(s=true);}this.options.ecmaVersion>=15&&r&&s&&this.raise(e.start,"Invalid regular expression flag");};function _r(e){for(var t in e)return true;return false}f.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&_r(e.groupNames)&&(e.switchN=true,this.regexp_pattern(e));};f.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=false,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,i=e.backReferenceNames;t<i.length;t+=1){var r=i[t];e.groupNames[r]||e.raise("Invalid named capture referenced");}};f.regexp_disjunction=function(e){var t=this.options.ecmaVersion>=16;for(t&&(e.branchID=new Oe(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,true)&&e.raise("Nothing to repeat"),e.eat(123)&&e.raise("Lone quantifier brackets");};f.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););};f.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise("Invalid quantifier"),true):(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))?(this.regexp_eatQuantifier(e),true):false};f.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=false,e.eat(94)||e.eat(36))return true;if(e.eat(92)){if(e.eat(66)||e.eat(98))return true;e.pos=t;}if(e.eat(40)&&e.eat(63)){var i=false;if(this.options.ecmaVersion>=9&&(i=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!i,true}return e.pos=t,false};f.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=false),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),true):false};f.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)};f.regexp_eatBracedQuantifier=function(e,t){var i=e.pos;if(e.eat(123)){var r=0,s=-1;if(this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(s=e.lastIntValue),e.eat(125)))return s!==-1&&s<r&&!t&&e.raise("numbers out of order in {} quantifier"),true;e.switchU&&!t&&e.raise("Incomplete quantifier"),e.pos=i;}return false};f.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)};f.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return true;e.pos=t;}return false};f.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)){if(this.options.ecmaVersion>=16){var i=this.regexp_eatModifiers(e),r=e.eat(45);if(i||r){for(var s=0;s<i.length;s++){var a=i.charAt(s);i.indexOf(a,s+1)>-1&&e.raise("Duplicate regular expression modifiers");}if(r){var o=this.regexp_eatModifiers(e);!i&&!o&&e.current()===58&&e.raise("Invalid regular expression modifiers");for(var u=0;u<o.length;u++){var c=o.charAt(u);(o.indexOf(c,u+1)>-1||i.indexOf(c)>-1)&&e.raise("Duplicate regular expression modifiers");}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return true;e.raise("Unterminated group");}}e.pos=t;}return false};f.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,true;e.raise("Unterminated group");}return false};f.regexp_eatModifiers=function(e){for(var t="",i=0;(i=e.current())!==-1&&wr(i);)t+=ee(i),e.advance();return t};function wr(e){return e===105||e===109||e===115}f.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)};f.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,true)&&e.raise("Nothing to repeat"),false};f.regexp_eatSyntaxCharacter=function(e){var t=e.current();return Ci(t)?(e.lastIntValue=t,e.advance(),true):false};function Ci(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}f.regexp_eatPatternCharacters=function(e){for(var t=e.pos,i=0;(i=e.current())!==-1&&!Ci(i);)e.advance();return e.pos!==t};f.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124?(e.advance(),true):false};f.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise("Invalid group");var t=this.options.ecmaVersion>=16,i=e.groupNames[e.lastStringValue];if(i)if(t)for(var r=0,s=i;r<s.length;r+=1){var a=s[r];a.separatedFrom(e.branchID)||e.raise("Duplicate capture group name");}else e.raise("Duplicate capture group name");t?(i||(e.groupNames[e.lastStringValue]=[])).push(e.branchID):e.groupNames[e.lastStringValue]=true;}};f.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return true;e.raise("Invalid capture group name");}return false};f.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=ee(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=ee(e.lastIntValue);return true}return false};f.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,r=e.current(i);return e.advance(i),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(r=e.lastIntValue),Pr(r)?(e.lastIntValue=r,true):(e.pos=t,false)};function Pr(e){return Y(e,true)||e===36||e===95}f.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,r=e.current(i);return e.advance(i),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(r=e.lastIntValue),kr(r)?(e.lastIntValue=r,true):(e.pos=t,false)};function kr(e){return se(e,true)||e===36||e===95||e===8204||e===8205}f.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?true:(e.switchU&&(e.current()===99&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),false)};f.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var i=e.lastIntValue;if(e.switchU)return i>e.maxBackReference&&(e.maxBackReference=i),true;if(i<=e.numCapturingParens)return true;e.pos=t;}return false};f.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),true;e.raise("Invalid named reference");}return false};f.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,false)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)};f.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return true;e.pos=t;}return false};f.regexp_eatZero=function(e){return e.current()===48&&!Be(e.lookahead())?(e.lastIntValue=0,e.advance(),true):false};f.regexp_eatControlEscape=function(e){var t=e.current();return t===116?(e.lastIntValue=9,e.advance(),true):t===110?(e.lastIntValue=10,e.advance(),true):t===118?(e.lastIntValue=11,e.advance(),true):t===102?(e.lastIntValue=12,e.advance(),true):t===114?(e.lastIntValue=13,e.advance(),true):false};f.regexp_eatControlLetter=function(e){var t=e.current();return Ii(t)?(e.lastIntValue=t%32,e.advance(),true):false};function Ii(e){return e>=65&&e<=90||e>=97&&e<=122}f.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){t===void 0&&(t=false);var i=e.pos,r=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var s=e.lastIntValue;if(r&&s>=55296&&s<=56319){var a=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var o=e.lastIntValue;if(o>=56320&&o<=57343)return e.lastIntValue=(s-55296)*1024+(o-56320)+65536,true}e.pos=a,e.lastIntValue=s;}return true}if(r&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&Ar(e.lastIntValue))return true;r&&e.raise("Invalid unicode escape"),e.pos=i;}return false};function Ar(e){return e>=0&&e<=1114111}f.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?true:e.eat(47)?(e.lastIntValue=47,true):false;var t=e.current();return t!==99&&(!e.switchN||t!==107)?(e.lastIntValue=t,e.advance(),true):false};f.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();while((t=e.current())>=48&&t<=57);return true}return false};var Ti=0,te=1,W=2;f.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(Cr(t))return e.lastIntValue=-1,e.advance(),te;var i=false;if(e.switchU&&this.options.ecmaVersion>=9&&((i=t===80)||t===112)){e.lastIntValue=-1,e.advance();var r;if(e.eat(123)&&(r=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return i&&r===W&&e.raise("Invalid property name"),r;e.raise("Invalid property name");}return Ti};function Cr(e){return e===100||e===68||e===115||e===83||e===119||e===87}f.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var i=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,i,r),te}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var s=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,s)}return Ti};f.regexp_validateUnicodePropertyNameAndValue=function(e,t,i){de(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(i)||e.raise("Invalid property value");};f.regexp_validateUnicodePropertyNameOrValue=function(e,t){if(e.unicodeProperties.binary.test(t))return te;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(t))return W;e.raise("Invalid property name");};f.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";Ni(t=e.current());)e.lastStringValue+=ee(t),e.advance();return e.lastStringValue!==""};function Ni(e){return Ii(e)||e===95}f.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";Ir(t=e.current());)e.lastStringValue+=ee(t),e.advance();return e.lastStringValue!==""};function Ir(e){return Ni(e)||Be(e)}f.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)};f.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),i=this.regexp_classContents(e);return e.eat(93)||e.raise("Unterminated character class"),t&&i===W&&e.raise("Negated character class may contain strings"),true}return false};f.regexp_classContents=function(e){return e.current()===93?te:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),te)};f.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var i=e.lastIntValue;e.switchU&&(t===-1||i===-1)&&e.raise("Invalid character class"),t!==-1&&i!==-1&&t>i&&e.raise("Range out of order in character class");}}};f.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return true;if(e.switchU){var i=e.current();(i===99||Oi(i))&&e.raise("Invalid class escape"),e.raise("Invalid escape");}e.pos=t;}var r=e.current();return r!==93?(e.lastIntValue=r,e.advance(),true):false};f.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,true;if(e.switchU&&e.eat(45))return e.lastIntValue=45,true;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return true;e.pos=t;}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)};f.regexp_classSetExpression=function(e){var t=te,i;if(!this.regexp_eatClassSetRange(e))if(i=this.regexp_eatClassSetOperand(e)){i===W&&(t=W);for(var r=e.pos;e.eatChars([38,38]);){if(e.current()!==38&&(i=this.regexp_eatClassSetOperand(e))){i!==W&&(t=te);continue}e.raise("Invalid character in character class");}if(r!==e.pos)return t;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise("Invalid character in character class");if(r!==e.pos)return t}else e.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(e)){if(i=this.regexp_eatClassSetOperand(e),!i)return t;i===W&&(t=W);}};f.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var i=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var r=e.lastIntValue;return i!==-1&&r!==-1&&i>r&&e.raise("Range out of order in character class"),true}e.pos=t;}return false};f.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?te:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)};f.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var i=e.eat(94),r=this.regexp_classContents(e);if(e.eat(93))return i&&r===W&&e.raise("Negated character class may contain strings"),r;e.pos=t;}if(e.eat(92)){var s=this.regexp_eatCharacterClassEscape(e);if(s)return s;e.pos=t;}return null};f.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var i=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return i}else e.raise("Invalid escape");e.pos=t;}return null};f.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===W&&(t=W);return t};f.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return t===1?te:W};f.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?true:e.eat(98)?(e.lastIntValue=8,true):(e.pos=t,false);var i=e.current();return i<0||i===e.lookahead()&&Tr(i)||Nr(i)?false:(e.advance(),e.lastIntValue=i,true)};function Tr(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function Nr(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}f.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return Rr(t)?(e.lastIntValue=t,e.advance(),true):false};function Rr(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}f.regexp_eatClassControlLetter=function(e){var t=e.current();return Be(t)||t===95?(e.lastIntValue=t%32,e.advance(),true):false};f.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return true;e.switchU&&e.raise("Invalid escape"),e.pos=t;}return false};f.regexp_eatDecimalDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;Be(i=e.current());)e.lastIntValue=10*e.lastIntValue+(i-48),e.advance();return e.pos!==t};function Be(e){return e>=48&&e<=57}f.regexp_eatHexDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;Ri(i=e.current());)e.lastIntValue=16*e.lastIntValue+Li(i),e.advance();return e.pos!==t};function Ri(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Li(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}f.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var i=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=t*64+i*8+e.lastIntValue:e.lastIntValue=t*8+i;}else e.lastIntValue=t;return true}return false};f.regexp_eatOctalDigit=function(e){var t=e.current();return Oi(t)?(e.lastIntValue=t-48,e.advance(),true):(e.lastIntValue=0,false)};function Oi(e){return e>=48&&e<=55}f.regexp_eatFixedHexDigits=function(e,t){var i=e.pos;e.lastIntValue=0;for(var r=0;r<t;++r){var s=e.current();if(!Ri(s))return e.pos=i,false;e.lastIntValue=16*e.lastIntValue+Li(s),e.advance();}return true};var ct=function(t){this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,t.options.locations&&(this.loc=new De(t,t.startLoc,t.endLoc)),t.options.ranges&&(this.range=[t.start,t.end]);},E=R.prototype;E.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new ct(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken();};E.getToken=function(){return this.next(),new ct(this)};typeof Symbol<"u"&&(E[Symbol.iterator]=function(){var e=this;return {next:function(){var t=e.getToken();return {done:t.type===n.eof,value:t}}}});E.nextToken=function(){var e=this.curContext();if((!e||!e.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(n.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos());};E.readToken=function(e){return Y(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)};E.fullCharCodeAt=function(e){var t=this.input.charCodeAt(e);if(t<=55295||t>=56320)return t;var i=this.input.charCodeAt(e+1);return i<=56319||i>=57344?t:(t<<10)+i-56613888};E.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)};E.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(i===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=i+2,this.options.locations)for(var r=void 0,s=t;(r=ri(this.input,s,this.pos))>-1;)++this.curLine,s=this.lineStart=r;this.options.onComment&&this.options.onComment(true,this.input.slice(t+2,i),t,this.pos,e,this.curPosition());};E.skipLineComment=function(e){for(var t=this.pos,i=this.options.onComment&&this.curPosition(),r=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!fe(r);)r=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(false,this.input.slice(t+e,this.pos),t,this.pos,i,this.curPosition());};E.skipSpace=function(){e:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(e>8&&e<14||e>=5760&&si.test(String.fromCharCode(e)))++this.pos;else break e}}};E.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var i=this.type;this.type=e,this.value=t,this.updateContext(i);};E.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(true);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&t===46?(this.pos+=3,this.finishToken(n.ellipsis)):(++this.pos,this.finishToken(n.dot))};E.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(n.assign,2):this.finishOp(n.slash,1)};E.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),i=1,r=e===42?n.star:n.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++i,r=n.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(n.assign,i+1):this.finishOp(r,i)};E.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(this.options.ecmaVersion>=12){var i=this.input.charCodeAt(this.pos+2);if(i===61)return this.finishOp(n.assign,3)}return this.finishOp(e===124?n.logicalOR:n.logicalAND,2)}return t===61?this.finishOp(n.assign,2):this.finishOp(e===124?n.bitwiseOR:n.bitwiseAND,1)};E.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(n.assign,2):this.finishOp(n.bitwiseXOR,1)};E.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||j.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(n.incDec,2):t===61?this.finishOp(n.assign,2):this.finishOp(n.plusMin,1)};E.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),i=1;return t===e?(i=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+i)===61?this.finishOp(n.assign,i+1):this.finishOp(n.bitShift,i)):t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(t===61&&(i=2),this.finishOp(n.relational,i))};E.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(n.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(n.arrow)):this.finishOp(e===61?n.eq:n.prefix,1)};E.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var i=this.input.charCodeAt(this.pos+2);if(i<48||i>57)return this.finishOp(n.questionDot,2)}if(t===63){if(e>=12){var r=this.input.charCodeAt(this.pos+2);if(r===61)return this.finishOp(n.assign,3)}return this.finishOp(n.coalesce,2)}}return this.finishOp(n.question,1)};E.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),Y(t,true)||t===92))return this.finishToken(n.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+ee(t)+"'");};E.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return ++this.pos,this.finishToken(n.parenL);case 41:return ++this.pos,this.finishToken(n.parenR);case 59:return ++this.pos,this.finishToken(n.semi);case 44:return ++this.pos,this.finishToken(n.comma);case 91:return ++this.pos,this.finishToken(n.bracketL);case 93:return ++this.pos,this.finishToken(n.bracketR);case 123:return ++this.pos,this.finishToken(n.braceL);case 125:return ++this.pos,this.finishToken(n.braceR);case 58:return ++this.pos,this.finishToken(n.colon);case 96:if(this.options.ecmaVersion<6)break;return ++this.pos,this.finishToken(n.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(false);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(n.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+ee(e)+"'");};E.finishOp=function(e,t){var i=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,i)};E.readRegexp=function(){for(var e,t,i=this.pos;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");var r=this.input.charAt(this.pos);if(j.test(r)&&this.raise(i,"Unterminated regular expression"),e)e=false;else {if(r==="[")t=true;else if(r==="]"&&t)t=false;else if(r==="/"&&!t)break;e=r==="\\";}++this.pos;}var s=this.input.slice(i,this.pos);++this.pos;var a=this.pos,o=this.readWord1();this.containsEsc&&this.unexpected(a);var u=this.regexpState||(this.regexpState=new J(this));u.reset(i,s,o),this.validateRegExpFlags(u),this.validateRegExpPattern(u);var c=null;try{c=new RegExp(s,o);}catch{}return this.finishToken(n.regexp,{pattern:s,flags:o,value:c})};E.readInt=function(e,t,i){for(var r=this.options.ecmaVersion>=12&&t===void 0,s=i&&this.input.charCodeAt(this.pos)===48,a=this.pos,o=0,u=0,c=0,l=t??1/0;c<l;++c,++this.pos){var p=this.input.charCodeAt(this.pos),m=void 0;if(r&&p===95){s&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),u===95&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),c===0&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),u=p;continue}if(p>=97?m=p-97+10:p>=65?m=p-65+10:p>=48&&p<=57?m=p-48:m=1/0,m>=e)break;u=p,o=o*e+m;}return r&&u===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===a||t!=null&&this.pos-a!==t?null:o};function Lr(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,""))}function Di(e){return typeof BigInt!="function"?null:BigInt(e.replace(/_/g,""))}E.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var i=this.readInt(e);return i==null&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(i=Di(this.input.slice(t,this.pos)),++this.pos):Y(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(n.num,i)};E.readNumber=function(e){var t=this.pos;!e&&this.readInt(10,void 0,true)===null&&this.raise(t,"Invalid number");var i=this.pos-t>=2&&this.input.charCodeAt(t)===48;i&&this.strict&&this.raise(t,"Invalid number");var r=this.input.charCodeAt(this.pos);if(!i&&!e&&this.options.ecmaVersion>=11&&r===110){var s=Di(this.input.slice(t,this.pos));return ++this.pos,Y(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(n.num,s)}i&&/[89]/.test(this.input.slice(t,this.pos))&&(i=false),r===46&&!i&&(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),(r===69||r===101)&&!i&&(r=this.input.charCodeAt(++this.pos),(r===43||r===45)&&++this.pos,this.readInt(10)===null&&this.raise(t,"Invalid number")),Y(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var a=Lr(this.input.slice(t,this.pos),i);return this.finishToken(n.num,a)};E.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var i=++this.pos;t=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(i,"Code point out of bounds");}else t=this.readHexChar(4);return t};E.readString=function(e){for(var t="",i=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var r=this.input.charCodeAt(this.pos);if(r===e)break;r===92?(t+=this.input.slice(i,this.pos),t+=this.readEscapedChar(false),i=this.pos):r===8232||r===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(fe(r)&&this.raise(this.start,"Unterminated string constant"),++this.pos);}return t+=this.input.slice(i,this.pos++),this.finishToken(n.string,t)};var Mi={};E.tryReadTemplateToken=function(){this.inTemplateElement=true;try{this.readTmplToken();}catch(e){if(e===Mi)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=false;};E.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Mi;this.raise(e,t);};E.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var i=this.input.charCodeAt(this.pos);if(i===96||i===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===n.template||this.type===n.invalidTemplate)?i===36?(this.pos+=2,this.finishToken(n.dollarBraceL)):(++this.pos,this.finishToken(n.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(n.template,e));if(i===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(true),t=this.pos;else if(fe(i)){switch(e+=this.input.slice(t,this.pos),++this.pos,i){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=`
|
|
10
10
|
`;break;default:e+=String.fromCharCode(i);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos;}else ++this.pos;}};E.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case "\\":++this.pos;break;case "$":if(this.input[this.pos+1]!=="{")break;case "`":return this.finishToken(n.invalidTemplate,this.input.slice(this.start,this.pos));case "\r":this.input[this.pos+1]===`
|
|
11
11
|
`&&++this.pos;case `
|
|
12
12
|
`:case "\u2028":case "\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template");};E.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return `
|
|
13
|
-
`;case 114:return "\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return
|
|
13
|
+
`;case 114:return "\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return ee(this.readCodePoint());case 116:return " ";case 98:return "\b";case 118:return "\v";case 102:return "\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),e){var i=this.pos-1;this.invalidStringToken(i,"Invalid escape sequence in template string");}default:if(t>=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],s=parseInt(r,8);return s>255&&(r=r.slice(0,-1),s=parseInt(r,8)),this.pos+=r.length-1,t=this.input.charCodeAt(this.pos),(r!=="0"||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-r.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(s)}return fe(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(t)}};E.readHexChar=function(e){var t=this.pos,i=this.readInt(16,e);return i===null&&this.invalidStringToken(t,"Bad character escape sequence"),i};E.readWord1=function(){this.containsEsc=false;for(var e="",t=true,i=this.pos,r=this.options.ecmaVersion>=6;this.pos<this.input.length;){var s=this.fullCharCodeAtPos();if(se(s,r))this.pos+=s<=65535?1:2;else if(s===92){this.containsEsc=true,e+=this.input.slice(i,this.pos);var a=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var o=this.readCodePoint();(t?Y:se)(o,r)||this.invalidStringToken(a,"Invalid Unicode escape"),e+=ee(o),i=this.pos;}else break;t=false;}return e+this.input.slice(i,this.pos)};E.readWord=function(){var e=this.readWord1(),t=n.name;return this.keywords.test(e)&&(t=rt[e]),this.finishToken(t,e)};var Or="8.16.0";R.acorn={Parser:R,version:Or,defaultOptions:et,Position:ve,SourceLocation:De,getLineInfo:ni,Node:je,TokenType:P,tokTypes:n,keywordTypes:rt,TokContext:K,tokContexts:I,isIdentifierChar:se,isIdentifierStart:Y,Token:ct,isNewLine:fe,lineBreak:j,lineBreakG:rr,nonASCIIwhitespace:si};function lt(e,t){return R.parse(e,t)}function X(e,t,i,r,s){i||(i=h),(function a(o,u,c){var l=c||o.type;Mr(i,l,o,u,a),t[l]&&t[l](o,u);})(e,r,s);}function pt(e,t,i){i(e,t);}function pe(e,t,i){}function Mr(e,t,i,r,s){if(e[t]==null)throw new Error("No walker function defined for node type "+t);e[t](i,r,s);}var h={};h.Program=h.BlockStatement=h.StaticBlock=function(e,t,i){for(var r=0,s=e.body;r<s.length;r+=1){var a=s[r];i(a,t,"Statement");}};h.Statement=pt;h.EmptyStatement=pe;h.ExpressionStatement=h.ParenthesizedExpression=h.ChainExpression=function(e,t,i){return i(e.expression,t,"Expression")};h.IfStatement=function(e,t,i){i(e.test,t,"Expression"),i(e.consequent,t,"Statement"),e.alternate&&i(e.alternate,t,"Statement");};h.LabeledStatement=function(e,t,i){return i(e.body,t,"Statement")};h.BreakStatement=h.ContinueStatement=pe;h.WithStatement=function(e,t,i){i(e.object,t,"Expression"),i(e.body,t,"Statement");};h.SwitchStatement=function(e,t,i){i(e.discriminant,t,"Expression");for(var r=0,s=e.cases;r<s.length;r+=1){var a=s[r];i(a,t);}};h.SwitchCase=function(e,t,i){e.test&&i(e.test,t,"Expression");for(var r=0,s=e.consequent;r<s.length;r+=1){var a=s[r];i(a,t,"Statement");}};h.ReturnStatement=h.YieldExpression=h.AwaitExpression=function(e,t,i){e.argument&&i(e.argument,t,"Expression");};h.ThrowStatement=h.SpreadElement=function(e,t,i){return i(e.argument,t,"Expression")};h.TryStatement=function(e,t,i){i(e.block,t,"Statement"),e.handler&&i(e.handler,t),e.finalizer&&i(e.finalizer,t,"Statement");};h.CatchClause=function(e,t,i){e.param&&i(e.param,t,"Pattern"),i(e.body,t,"Statement");};h.WhileStatement=h.DoWhileStatement=function(e,t,i){i(e.test,t,"Expression"),i(e.body,t,"Statement");};h.ForStatement=function(e,t,i){e.init&&i(e.init,t,"ForInit"),e.test&&i(e.test,t,"Expression"),e.update&&i(e.update,t,"Expression"),i(e.body,t,"Statement");};h.ForInStatement=h.ForOfStatement=function(e,t,i){i(e.left,t,"ForInit"),i(e.right,t,"Expression"),i(e.body,t,"Statement");};h.ForInit=function(e,t,i){e.type==="VariableDeclaration"?i(e,t):i(e,t,"Expression");};h.DebuggerStatement=pe;h.FunctionDeclaration=function(e,t,i){return i(e,t,"Function")};h.VariableDeclaration=function(e,t,i){for(var r=0,s=e.declarations;r<s.length;r+=1){var a=s[r];i(a,t);}};h.VariableDeclarator=function(e,t,i){i(e.id,t,"Pattern"),e.init&&i(e.init,t,"Expression");};h.Function=function(e,t,i){e.id&&i(e.id,t,"Pattern");for(var r=0,s=e.params;r<s.length;r+=1){var a=s[r];i(a,t,"Pattern");}i(e.body,t,e.expression?"Expression":"Statement");};h.Pattern=function(e,t,i){e.type==="Identifier"?i(e,t,"VariablePattern"):e.type==="MemberExpression"?i(e,t,"MemberPattern"):i(e,t);};h.VariablePattern=pe;h.MemberPattern=pt;h.RestElement=function(e,t,i){return i(e.argument,t,"Pattern")};h.ArrayPattern=function(e,t,i){for(var r=0,s=e.elements;r<s.length;r+=1){var a=s[r];a&&i(a,t,"Pattern");}};h.ObjectPattern=function(e,t,i){for(var r=0,s=e.properties;r<s.length;r+=1){var a=s[r];a.type==="Property"?(a.computed&&i(a.key,t,"Expression"),i(a.value,t,"Pattern")):a.type==="RestElement"&&i(a.argument,t,"Pattern");}};h.Expression=pt;h.ThisExpression=h.Super=h.MetaProperty=pe;h.ArrayExpression=function(e,t,i){for(var r=0,s=e.elements;r<s.length;r+=1){var a=s[r];a&&i(a,t,"Expression");}};h.ObjectExpression=function(e,t,i){for(var r=0,s=e.properties;r<s.length;r+=1){var a=s[r];i(a,t);}};h.FunctionExpression=h.ArrowFunctionExpression=h.FunctionDeclaration;h.SequenceExpression=function(e,t,i){for(var r=0,s=e.expressions;r<s.length;r+=1){var a=s[r];i(a,t,"Expression");}};h.TemplateLiteral=function(e,t,i){for(var r=0,s=e.quasis;r<s.length;r+=1){var a=s[r];i(a,t);}for(var o=0,u=e.expressions;o<u.length;o+=1){var c=u[o];i(c,t,"Expression");}};h.TemplateElement=pe;h.UnaryExpression=h.UpdateExpression=function(e,t,i){i(e.argument,t,"Expression");};h.BinaryExpression=h.LogicalExpression=function(e,t,i){i(e.left,t,"Expression"),i(e.right,t,"Expression");};h.AssignmentExpression=h.AssignmentPattern=function(e,t,i){i(e.left,t,"Pattern"),i(e.right,t,"Expression");};h.ConditionalExpression=function(e,t,i){i(e.test,t,"Expression"),i(e.consequent,t,"Expression"),i(e.alternate,t,"Expression");};h.NewExpression=h.CallExpression=function(e,t,i){if(i(e.callee,t,"Expression"),e.arguments)for(var r=0,s=e.arguments;r<s.length;r+=1){var a=s[r];i(a,t,"Expression");}};h.MemberExpression=function(e,t,i){i(e.object,t,"Expression"),e.computed&&i(e.property,t,"Expression");};h.ExportNamedDeclaration=h.ExportDefaultDeclaration=function(e,t,i){if(e.declaration&&i(e.declaration,t,e.type==="ExportNamedDeclaration"||e.declaration.id?"Statement":"Expression"),e.source&&i(e.source,t,"Expression"),e.attributes)for(var r=0,s=e.attributes;r<s.length;r+=1){var a=s[r];i(a,t);}};h.ExportAllDeclaration=function(e,t,i){if(e.exported&&i(e.exported,t),i(e.source,t,"Expression"),e.attributes)for(var r=0,s=e.attributes;r<s.length;r+=1){var a=s[r];i(a,t);}};h.ImportAttribute=function(e,t,i){i(e.value,t,"Expression");};h.ImportDeclaration=function(e,t,i){for(var r=0,s=e.specifiers;r<s.length;r+=1){var a=s[r];i(a,t);}if(i(e.source,t,"Expression"),e.attributes)for(var o=0,u=e.attributes;o<u.length;o+=1){var c=u[o];i(c,t);}};h.ImportExpression=function(e,t,i){i(e.source,t,"Expression"),e.options&&i(e.options,t,"Expression");};h.ImportSpecifier=h.ImportDefaultSpecifier=h.ImportNamespaceSpecifier=h.Identifier=h.PrivateIdentifier=h.Literal=pe;h.TaggedTemplateExpression=function(e,t,i){i(e.tag,t,"Expression"),i(e.quasi,t,"Expression");};h.ClassDeclaration=h.ClassExpression=function(e,t,i){return i(e,t,"Class")};h.Class=function(e,t,i){e.id&&i(e.id,t,"Pattern"),e.superClass&&i(e.superClass,t,"Expression"),i(e.body,t);};h.ClassBody=function(e,t,i){for(var r=0,s=e.body;r<s.length;r+=1){var a=s[r];i(a,t);}};h.MethodDefinition=h.PropertyDefinition=h.Property=function(e,t,i){e.computed&&i(e.key,t,"Expression"),e.value&&i(e.value,t,"Expression");};var Ue=class e{piiFields;static TAINT_PROPAGATING_METHODS=new Set(["charCodeAt","codePointAt","charAt","at","indexOf","lastIndexOf","search","localeCompare","startsWith","endsWith","includes","substring","slice","substr","split","match","matchAll","replace","replaceAll","normalize","toLowerCase","toUpperCase","trim","trimStart","trimEnd","padStart","padEnd","repeat"]);static ARRAY_CALLBACK_METHODS=new Set(["map","forEach","filter","find","some","every","flatMap","findIndex"]);static REDUCE_METHODS=new Set(["reduce","reduceRight"]);constructor(t){this.piiFields=new Set(t.map(i=>i.toLowerCase()));}analyze(t,i,r=50){let s;try{let c=`function liop_analysis_wrapper(env) {
|
|
14
14
|
${t}
|
|
15
|
-
}`;s=
|
|
15
|
+
}`;s=lt(c,{ecmaVersion:2022,sourceType:"script",locations:!0});}catch{return null}let a=new Set,o=new Set;this.identifyRecordBoundVars(s,a),this.propagateTaint(s,a,o);let u=this.checkReturnStatements(s,a,o);if(u)return u;if(i!==void 0&&i>0&&i<r){let c=this.detectCorrelatedAggregations(s);if(c)return c.reason=c.reason.replace("50 records",`${r} records`),c}if(i!==void 0&&i>0&&i<r){let c=this.detectMinMaxExtraction(s);if(c)return c.reason=c.reason.replace("50 records",`${r} records`),c}return null}extractQueriedFields(t){let i;try{i=lt(`function w(env) {
|
|
16
16
|
${t}
|
|
17
|
-
}`,{ecmaVersion:2022,sourceType:"script"});}catch{return []}let r=new Set;return Q(i,{CallExpression:a=>{if(a.callee.type!=="MemberExpression")return;let o=a.callee,u=this.getPropertyName(o);if(!u||!this.isEnvRecordsChain(o.object))return;let c=a.arguments[0];if(!c||c.type!=="ArrowFunctionExpression"&&c.type!=="FunctionExpression")return;let l=c,p=0;if(e.REDUCE_METHODS.has(u)&&(p=1),l.params.length>p){let m=l.params[p];if(m.type==="Identifier"){let S=m.name,C=this.extractFieldsFromBody(l.body,S);for(let I of C)r.add(I);}}}}),Array.from(r)}detectCorrelatedAggregations(t){let i=new Map;Q(t,{CallExpression:s=>{if(s.callee.type!=="MemberExpression")return;let a=s.callee,o=this.getPropertyName(a);if(!o||!e.REDUCE_METHODS.has(o)||!this.isEnvRecordsChain(a.object))return;let u=s.arguments[0];if(!u||u.type!=="ArrowFunctionExpression"&&u.type!=="FunctionExpression")return;let c=u,l=c.params.length>1?c.params[1]:c.params[0];if(!l||l.type!=="Identifier")return;let p=l.name,m=this.extractFieldsFromBody(c.body,p);for(let S of m){let C=i.get(S)??0;i.set(S,C+1);}}});for(let[s,a]of i)if(a>=2)return {reason:`Correlation guard: ${a} aggregations detected on field '${s}'. Multiple correlated aggregations on the same field can enable differencing attacks. Use a single aggregation per numeric field, or increase dataset size above 50 records.`};return null}isEnvRecordsChain(t){if(this.isEnvRecordsAccess(t))return true;if(t.type==="CallExpression"){let i=t;if(i.callee.type==="MemberExpression"){let r=i.callee,s=this.getPropertyName(r);if(s&&(s==="slice"||s==="filter"||s==="toSorted"))return this.isEnvRecordsChain(r.object)}}return false}extractFieldsFromBody(t,i){let r=[];return Q(t,{MemberExpression:a=>{if(a.object.type==="Identifier"&&a.object.name===i){let o=this.getPropertyName(a);o&&o!=="length"&&r.push(o);}}}),r}detectMinMaxExtraction(t){let i=null;return Q(t,{CallExpression:s=>{if(!i&&s.callee.type==="MemberExpression"){let a=s.callee;if(a.object.type==="Identifier"&&a.object.name==="Math"){let o=this.getPropertyName(a);(o==="min"||o==="max")&&s.arguments.some(u=>u.type==="SpreadElement"&&this.isRecordsMapCall(u.argument))&&(i={reason:`Min/Max gate: Math.${o}() on individual records blocked for small datasets (n < 50). Use avg/stddev/count for privacy-safe aggregations.`});}}},MemberExpression:s=>{if(!i&&s.computed&&s.object.type==="CallExpression"){let a=s.object;if(a.callee.type==="MemberExpression"){let o=this.getPropertyName(a.callee);if(o==="sort"||o==="toSorted"){let u=a.callee.object;this.isEnvRecordsChain(u)&&(i={reason:"Min/Max gate: .sort()[index] on individual records blocked for small datasets (n < 50). Use avg/stddev/count for privacy-safe aggregations."});}}}}}),i}isRecordsMapCall(t){if(t.type!=="CallExpression")return false;let i=t;if(i.callee.type!=="MemberExpression")return false;let r=i.callee;return this.getPropertyName(r)==="map"&&this.isEnvRecordsChain(r.object)}identifyRecordBoundVars(t,i){Q(t,{CallExpression:a=>{if(a.callee.type!=="MemberExpression")return;let o=a.callee,u=this.getPropertyName(o);if(!u||!this.isEnvRecordsAccess(o.object))return;let c=a.arguments[0];if(c&&(c.type==="ArrowFunctionExpression"||c.type==="FunctionExpression")){let l=c;if(e.ARRAY_CALLBACK_METHODS.has(u)&&l.params.length>0){let p=l.params[0];p.type==="Identifier"&&i.add(p.name);}if(e.REDUCE_METHODS.has(u)&&l.params.length>1){let p=l.params[1];p.type==="Identifier"&&i.add(p.name);}}},ForOfStatement:a=>{if(this.isEnvRecordsAccess(a.right)&&a.left.type==="VariableDeclaration")for(let o of a.left.declarations)o.id.type==="Identifier"&&i.add(o.id.name);}}),Q(t,{VariableDeclarator:a=>{if(!(!a.init||a.id.type!=="Identifier")&&a.init.type==="MemberExpression"&&a.init.computed){let o=a.init;this.isEnvRecordsAccess(o.object)&&i.add(a.id.name);}}});}propagateTaint(t,i,r){for(let s=0;s<3;s++){let a=r.size;if(Q(t,{VariableDeclarator:u=>{!u.init||u.id.type!=="Identifier"||this.isExpressionTainted(u.init,i,r)&&r.add(u.id.name);},AssignmentExpression:u=>{u.left.type==="Identifier"&&this.isExpressionTainted(u.right,i,r)&&r.add(u.left.name);},CallExpression:u=>{if(u.callee.type!=="MemberExpression")return;let c=u.callee;this.getPropertyName(c)==="push"&&c.object.type==="Identifier"&&u.arguments.some(p=>this.isExpressionTainted(p,i,r))&&r.add(c.object.name);}}),r.size===a)break}}checkReturnStatements(t,i,r){let s=null;return Q(t,{ReturnStatement:o=>{if(!s&&o.argument&&this.isExpressionTainted(o.argument,i,r)){let u=o.loc?.start.line?o.loc.start.line-1:void 0,c=this.describeTaintSource(o.argument,i,r);s={reason:`PII side-channel detected: output contains values derived from restricted fields. ${c?`Operation: ${c}. `:""}Use only non-PII fields (e.g., numeric/date columns) for aggregations.`,line:u,operation:c};}}}),s}isExpressionTainted(t,i,r){switch(t.type){case "Identifier":return r.has(t.name);case "MemberExpression":return this.isMemberExprTainted(t,i,r);case "CallExpression":return this.isCallExprTainted(t,i,r);case "BinaryExpression":case "LogicalExpression":{let s=t;return this.isExpressionTainted(s.left,i,r)||this.isExpressionTainted(s.right,i,r)}case "UnaryExpression":{let s=t;return this.isExpressionTainted(s.argument,i,r)}case "ConditionalExpression":{let s=t;return this.isExpressionTainted(s.test,i,r)||this.isExpressionTainted(s.consequent,i,r)||this.isExpressionTainted(s.alternate,i,r)}case "ObjectExpression":return t.properties.some(a=>a.type==="Property"&&this.isExpressionTainted(a.value,i,r));case "ArrayExpression":return t.elements.some(a=>a!==null&&this.isExpressionTainted(a,i,r));case "TemplateLiteral":return t.expressions.some(a=>this.isExpressionTainted(a,i,r));case "SpreadElement":{let s=t;return this.isExpressionTainted(s.argument,i,r)}default:return false}}isMemberExprTainted(t,i,r){let s=this.getPropertyName(t);if(t.object.type==="Identifier"&&i.has(t.object.name)&&s&&this.piiFields.has(s.toLowerCase()))return true;if(t.object.type==="MemberExpression"&&s&&this.piiFields.has(s.toLowerCase())){let a=t.object;if(a.computed&&this.isEnvRecordsAccess(a.object))return true}if(this.isExpressionTainted(t.object,i,r))return true;if(t.computed&&t.object.type==="Identifier"&&i.has(t.object.name)&&t.property.type==="Literal"){let a=t.property.value;if(typeof a=="string"&&this.piiFields.has(a.toLowerCase()))return true}return false}isCallExprTainted(t,i,r){if(t.callee.type==="MemberExpression"){let s=t.callee,a=this.getPropertyName(s);if(a&&e.TAINT_PROPAGATING_METHODS.has(a)&&this.isExpressionTainted(s.object,i,r))return true;if(this.isEnvRecordsAccess(s.object)&&t.arguments[0]){let o=t.arguments[0];if(o.type==="ArrowFunctionExpression"||o.type==="FunctionExpression")return this.doesCallbackProduceTaint(o,a,i,r)}if(this.isExpressionTainted(s.object,i,r)||t.arguments.some(o=>this.isExpressionTainted(o,i,r)))return true}if(t.callee.type==="MemberExpression"){let s=t.callee;this.getPropertyName(s)==="push"&&s.object.type==="Identifier"&&t.arguments.some(o=>this.isExpressionTainted(o,i,r))&&r.add(s.object.name);}if(t.callee.type==="Identifier"){let s=t.callee.name;if(!new Set(["Math","Number","parseInt","parseFloat","isNaN","isFinite"]).has(s))return t.arguments.some(o=>this.isExpressionTainted(o,i,r))}return false}doesCallbackProduceTaint(t,i,r,s){let a=new Set(r),o=new Set(s);if(t.params.length>0){let p=i!==null&&e.REDUCE_METHODS.has(i)?1:0;t.params.length>p&&t.params[p].type==="Identifier"&&a.add(t.params[p].name);}if(t.type==="ArrowFunctionExpression"&&t.body.type!=="BlockStatement")return this.isExpressionTainted(t.body,a,o);let u=false,c={ReturnStatement:l=>{l.argument&&this.isExpressionTainted(l.argument,a,o)&&(u=true);}};return Q(t.body,c),u}getPropertyName(t){if(!t.computed&&t.property.type==="Identifier")return t.property.name;if(t.computed&&t.property.type==="Literal"){let i=t.property.value;if(typeof i=="string")return i}return null}isEnvRecordsAccess(t){if(t.type==="MemberExpression"){let i=t;if(this.getPropertyName(i)==="records"&&i.object.type==="Identifier"&&i.object.name==="env")return true}return t.type==="Identifier"&&t.name==="records"}describeTaintSource(t,i,r){if(t.type==="Identifier"){let s=t.name;if(r.has(s))return `variable '${s}' is PII-derived`}if(t.type==="ObjectExpression"){let s=t;for(let a of s.properties)if(a.type==="Property"&&this.isExpressionTainted(a.value,i,r))return `property '${a.key.type==="Identifier"?a.key.name:"unknown"}' contains PII-derived value`}if(t.type==="CallExpression"){let s=t;if(s.callee.type==="MemberExpression"){let a=this.getPropertyName(s.callee);if(a)return `result of .${a}() on PII data`}}}};var Vr={aspirin:"Medication",lisinopril:"Medication",metformin:"Medication",amlodipine:"Medication",atorvastatin:"Medication",omeprazole:"Medication",losartan:"Medication",simvastatin:"Medication",levothyroxine:"Medication",ibuprofen:"Medication",acetaminophen:"Medication",amoxicillin:"Medication",ciprofloxacin:"Medication",prednisone:"Medication",warfarin:"Medication",insulin:"Medication",hydrochlorothiazide:"Medication",gabapentin:"Medication",albuterol:"Medication",pantoprazole:"Medication",hypertension:"Condition",diabetes:"Condition",bronchitis:"Condition",pneumonia:"Condition",asthma:"Condition"},je=4,Fr=/^[\d\s.,:;!?()[\]{}<>@#$%^&*+=|\\/"'`~_-]+$/,Be=class e{static nlp=null;async getNlp(){if(!e.nlp){let t=await import('compromise/three');e.nlp=t.default||t,e.nlp.addWords(Vr);}return e.nlp}async scan(t){if(t.length<je||Fr.test(t))return {detected:false,entities:[]};let r=(await this.getNlp())(t),s=[],a=r.people().out("array");for(let c of a){let l=c.trim();l.length>=je&&s.push({type:"person",text:l});}let o=r.places().out("array");for(let c of o){let l=c.trim();l.length>=je&&s.push({type:"place",text:l});}let u=r.organizations().out("array");for(let c of u){let l=c.trim();l.length>=je&&s.push({type:"organization",text:l});}return {detected:s.length>0,entities:s}}async scanDeep(t,i=new WeakSet){if(t==null)return {detected:false,entities:[]};if(typeof t=="string")return this.scan(t);if(typeof t=="object"){if(i.has(t))return {detected:false,entities:[]};i.add(t);let r=Array.isArray(t)?t:Object.values(t),s=[];for(let a of r){let o=await this.scanDeep(a,i);if(o.detected&&(s.push(...o.entities),o.entities.some(u=>u.type==="person")))return {detected:true,entities:s}}return {detected:s.length>0,entities:s}}return {detected:false,entities:[]}}};function jr(e){let t=e.replace(/\D/g,"");if(t.length<13||t.length>19)return false;let i=0,r=false;for(let s=t.length-1;s>=0;s--){let a=parseInt(t.charAt(s),10);r&&(a*=2,a>9&&(a-=9)),i+=a,r=!r;}return i%10===0}function Br(e){let t=e.replace(/\s+/g,"").toUpperCase();if(!/^[A-Z]{2}[0-9]{2}[A-Z0-9]{1,30}$/.test(t))return false;let i=t.substring(4)+t.substring(0,4),r="";for(let s=0;s<i.length;s++){let a=i.charCodeAt(s);if(a>=65&&a<=90)r+=(a-55).toString();else if(a>=48&&a<=57)r+=i.charAt(s);else return false}try{return BigInt(r)%97n===1n}catch{return false}}var R={EMAIL:{name:"EMAIL",pattern:/\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}\b/gi,validator:e=>!e.endsWith("@example.com")&&!e.endsWith("@test.com")},CREDIT_CARD:{name:"CREDIT_CARD",pattern:/\b(?:\d[ -]*?){13,16}\b/g,validator:jr},IP_ADDRESS:{name:"IP_ADDRESS",pattern:/\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/g,validator:e=>["127.0.0.1","0.0.0.0","255.255.255.255"].includes(e)?false:e.split(".").map(Number).every(r=>r>=0&&r<=255)},PHONE:{name:"PHONE",pattern:/(?:(?:\+?\d{1,3}[-. ]?)?\(?\d{3}\)?[-. ]?\d{3}[-. ]?\d{4})\b/g,validator:e=>{let t=e.replace(/\D/g,"");return !(t.length<7||t.length>15||/^(\d)\1+$/.test(t)||t==="1234567890")}},SSN:{name:"SSN",pattern:/\b\d{3}[- ]?\d{2}[- ]?\d{4}\b/g,validator:e=>{let t=e.replace(/\D/g,"");if(t.length!==9)return false;let i=parseInt(t.substring(0,3),10);return !(i===0||i===666||i>=900||parseInt(t.substring(3,5),10)===0||parseInt(t.substring(5,9),10)===0||/^(\d)\1+$/.test(t)||t==="123456789")}},IBAN:{name:"IBAN",pattern:/\b[A-Z]{2}[0-9]{2}[A-Z0-9]{1,30}\b/gi,validator:Br},PASSPORT_MRZ:{name:"PASSPORT_MRZ",pattern:/\bP[A-Z<][A-Z<]{3}[A-Z0-9<]{39}(?:\b|\s|$)/g}},Mi={GLOBAL_STRICT:[R.EMAIL,R.CREDIT_CARD,R.IP_ADDRESS,R.PHONE,R.PASSPORT_MRZ,R.IBAN],US_COMPLIANT:[R.EMAIL,R.CREDIT_CARD,R.IP_ADDRESS,R.PHONE,R.SSN,R.PASSPORT_MRZ],EU_GDPR:[R.EMAIL,R.CREDIT_CARD,R.IP_ADDRESS,R.PHONE,R.IBAN,R.PASSPORT_MRZ]},Ue=class e{patterns;forbiddenKeysSet;nerScanner;static KEY_SAFELIST=new Set(["grid","video","android","identity","provide","override","validate","hidden","widget","guidelines","beside","guideline","outside","inside","collide","decide","divide","aside","ride","side","wide","hide","tide","pride","bride","slide","guide","stride","oxide","dioxide","suicide","homicide","pesticide","valid","invalid","void","avoid","diagnosis","medication","namespace","namesake","rename","filename","hostname","typename","unnamed","renamed","phonetic","phoneme","microphone","headphone","telephone","saxophone","smartphone","streetview","addressable","addressing","cityscape","electricity","capacity","velocity","opacity","timestamp","timezone","image_id","computation_result","zk_receipt","testid","toolid","sessionid","peerid","nodeid","requestid","correlationid","traceid","spanid"]);shortTokenBoundaryPatterns;longForbiddenTokens;constructor(t=[],i=[],r){this.patterns=t,this.forbiddenKeysSet=new Set(i.map(s=>s.toLowerCase())),this.nerScanner=r??null,this.shortTokenBoundaryPatterns=new Map,this.longForbiddenTokens=[];for(let s of this.forbiddenKeysSet)s.length<4?this.shortTokenBoundaryPatterns.set(s,new RegExp(`(?:^|[_-])${s}(?:$|[_-])|(?:^|[a-z])${s.charAt(0).toUpperCase()}${s.slice(1)}|^${s}$`,"i")):this.longForbiddenTokens.push(s);}async scan(t,i=new WeakSet){if(t==null)return null;if(typeof t=="string"){let r=t.trim();if(r.startsWith("{")&&r.endsWith("}")||r.startsWith("[")&&r.endsWith("]"))try{let a=JSON.parse(r),o=await this.scan(a,i);if(o)return o}catch{}let s=this.checkString(t);if(s)return s;if(this.nerScanner){let a=await this.nerScanner.scan(t);if(a.detected){let o=a.entities.find(u=>u.type==="person");if(o)return `PII Entity Detected: person name "${o.text}"`}}return null}if(typeof t=="object"){if(i.has(t))return null;if(i.add(t),Array.isArray(t))for(let r of t){let s=await this.scan(r,i);if(s)return s}else for(let[r,s]of Object.entries(t)){if(this.forbiddenKeysSet.has(r.toLowerCase()))return `Forbidden Key: ${r}`;let a=this.checkKeyFuzzy(r);if(a)return a;let o=await this.scan(s,i);if(o)return o}}return null}checkKeyFuzzy(t){let i=t.toLowerCase();if(e.KEY_SAFELIST.has(i))return null;for(let[r,s]of this.shortTokenBoundaryPatterns)if(s.test(t))return `Forbidden Key (fuzzy): ${t} matches boundary pattern "${r}"`;for(let r of this.longForbiddenTokens)if(i.includes(r))return `Forbidden Key (fuzzy): ${t} contains restricted token "${r}"`;return null}checkString(t){for(let i of this.patterns)if(typeof i=="string"){if(t.toLowerCase().includes(i.toLowerCase()))return i}else if(i instanceof RegExp){if(i.global&&(i.lastIndex=0),i.test(t))return i.source}else if(typeof i=="object"&&i!==null){let r=i;if(typeof r.pattern=="string"){if(t.toLowerCase().includes(r.pattern.toLowerCase())&&(!r.validator||r.validator(r.pattern)))return r.name}else if(r.pattern instanceof RegExp){r.pattern.global&&(r.pattern.lastIndex=0);let s=r.pattern.exec(t);for(;s!==null;){let a=s[0];if(!r.validator||r.validator(a))return r.name;if(!r.pattern.global)break;s=r.pattern.exec(t);}}}return null}};var Fi=be.dirname(fileURLToPath(import.meta.url)),ji=class e{constructor(t,i){this.serverInfo=t;this.config=i;let r=this.config?.security?.enableNerScanning?new Be:null;this.piiScanner=new Ue(this.config?.security?.piiPatterns??Mi.GLOBAL_STRICT,this.config?.security?.forbiddenKeys??["id","name","fullName","firstName","lastName","address","street","city","postalCode","zipCode","phone","email","ssn","accountHolder","accountNumber","account_number","password","token","secret","privateKey"],r);let s=this.config?.security?.rateLimit;this.toolCallWindowMs=s?.windowMs??Number.parseInt(process.env.LIOP_RATE_LIMIT_WINDOW_MS??"60000",10),this.toolCallMaxPerWindow=s?.maxPerWindow??Number.parseInt(process.env.LIOP_RATE_LIMIT_MAX??"15",10),this.globalCallMaxPerWindow=s?.globalMaxPerWindow??Number.parseInt(process.env.LIOP_RATE_LIMIT_GLOBAL_MAX??"40",10);let a=this.config?.security?.forbiddenKeys??["id","name","fullName","firstName","lastName","address","street","city","postalCode","zipCode","phone","email","ssn","accountHolder","accountNumber","account_number","password","token","secret","privateKey"];this.taintAnalyzer=new Fe(a);let o=import.meta.url.endsWith(".ts"),u=o?".ts":".js",c=[];if(o)try{let C=createRequire(import.meta.url).resolve("tsx/package.json");c=["--import",pathToFileURL(be.join(be.dirname(C),"dist","loader.mjs")).href];}catch{c=["--import","tsx"];}let l=process.env.NODE_ENV==="test"||process.env.VITEST;this.config?.capabilities&&!this.serverInfo.capabilities&&(this.serverInfo.capabilities=this.config.capabilities);let p=[be.resolve(Fi,`./workers/logic-execution${u}`),be.resolve(Fi,`../workers/logic-execution${u}`)],m=p.find(S=>Bi.existsSync(S))||p[1];this.workerPool=new Piscina({filename:m,minThreads:this.config?.workerPool?.minThreads??(l?0:2),maxThreads:this.config?.workerPool?.maxThreads??(l?1:8),idleTimeout:this.config?.workerPool?.idleTimeout??(l?500:5e3),maxQueue:"auto",taskQueue:new FixedQueue,execArgv:c,resourceLimits:{maxOldGenerationSizeMb:this.config?.workerPool?.maxHeapMb??Number.parseInt(process.env.LIOP_WORKER_MAX_HEAP_MB??"64",10)}}),this.resource("LIOP Envelope Specification","liop://protocol/envelope-spec","Complete Logic-on-Origin envelope format, execution rules, and security constraints","text/plain",()=>Promise.resolve(this.buildEnvelopeSpec()));}logicCache=new Map;connectionStats=new Map;CACHE_TTL_MS=1440*60*1e3;THROTTLE_THRESHOLD=5;THROTTLE_COOLDOWN_MS=60*1e3;toolCallWindows=new Map;toolCallMaxPerWindow;toolCallWindowMs;globalCallWindow=[];globalCallMaxPerWindow;fieldQueryBudget=new Map;taintAnalyzer;tools=new Map;resources=new Map;prompts=new Map;activeSchema=null;sandboxRecords=[];piiScanner;workerPool;meshNode=null;rpcServer=null;boundPort=null;sessions=new Map;static LIOP_COMPACT_REGEX=/@LIOP\{(?<target>[^,}]+)(?:,(?<name>[^}]*))?\}\n(?<logic>[\s\S]*?)\n@END/m;extractLogic(t){let i=t.match(e.LIOP_COMPACT_REGEX);return i?.groups?.logic?i.groups.logic.trim():null}parseUnknownJson(t){if(typeof t!="string")return t;let i=t.trim();if(i.startsWith("{")&&i.endsWith("}")||i.startsWith("[")&&i.endsWith("]"))try{return JSON.parse(i)}catch{return t}return t}runPreflightPolicy(t,i,r){if(r){let c=i.replace(/\s+/g," ");if(r.enforceAggregationFirst&&[/return\s+env\.records(?!\s*\.\s*(?:reduce|length|filter|every|some|find)\b)/i,/return\s*\{[\s\S]*\b(accounts|patients|rows|records)\s*:\s*env\.records(?!\s*\.\s*(?:reduce|length|filter)\b)/i].some(p=>p.test(c)))return "Preflight policy rejected: potential row-level export pattern detected.";if(r.preflightDenyPatterns?.some(l=>l.test(c)))return "Preflight policy rejected: custom deny pattern matched."}let s=50;typeof r?.enforceAggregationFirst=="object"&&(s=r.enforceAggregationFirst.minMaxBlockThreshold??50);let a=this.taintAnalyzer.analyze(i,this.sandboxRecords.length,s);if(a)return `Preflight policy rejected: ${a.reason}`;let o=r?.queryBudgetPerField??5,u=this.taintAnalyzer.extractQueriedFields(i);if(u.length>0){let c=this.fieldQueryBudget.get(t);c||(c=new Map,this.fieldQueryBudget.set(t,c));for(let l of u)if((c.get(l)??0)>=o)return `Preflight policy rejected: Query budget exceeded for field '${l}' (max ${o} per session). Rotate PQC session to reset budget.`;for(let l of u){let p=c.get(l)??0;c.set(l,p+1);}}return null}validateOutputPolicy(t,i,r){if(!r)return null;let s=this.parseUnknownJson(i);if(r.outputSchema){let o=(()=>{if(!(r.outputSchema instanceof b$1.ZodObject))return r.outputSchema;let u=r.outputSchema;return u._def.catchall instanceof b$1.ZodNever?u.strict():u})().safeParse(s);if(!o.success)return `[LIOP] Output schema violation for ${t}: ${o.error.issues.map(u=>`${u.path.join(".")||"<root>"} ${u.message}`).join("; ")}. HINT: Your output must conform to the declared schema. Use 'env.records' to access the dataset and return only allowed fields.`}return r.enforceAggregationFirst&&this.violatesAggregationFirstPolicy(this.unwrapForAggregationPolicyScan(s),r.enforceAggregationFirst,this.sandboxRecords.length)?process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test"||process.env.LIOP_SEC_VERBOSE==="1"?"Aggregation-First Policy Violation: row-level export or K-Anonymity violation blocked. HINT: Use .reduce() to produce a flat {key:value} object. Do NOT use .map() to create arrays of objects. Ensure dataset size > 10 for detailed results.":"Aggregation-First Policy Violation: Output blocked due to privacy constraints.":null}unwrapForAggregationPolicyScan(t){if(typeof t=="string"){let a=t.trim();if(a.startsWith("{")&&a.endsWith("}")||a.startsWith("[")&&a.endsWith("]"))try{return this.unwrapForAggregationPolicyScan(JSON.parse(a))}catch{return t}return t}if(!t||typeof t!="object")return t;let i=t;if(!Array.isArray(i.content)||i.content.length===0)return t;let r=[];for(let a of i.content)if(a&&typeof a=="object"&&"text"in a){let o=a.text;typeof o=="string"&&r.push(o);}if(r.length===0)return t;let s=r.length===1?r[0]:r.join(`
|
|
18
|
-
`);return this.unwrapForAggregationPolicyScan(s)}violatesAggregationFirstPolicy(t,i,r){let s=typeof i=="object"&&typeof i.maxOutputRows=="number"?i.maxOutputRows:10,a=typeof i=="object"&&typeof i.allowPrimitiveArrays=="boolean"?i.allowPrimitiveArrays:true;if(typeof t=="string"){let o=t.trim();if(o.startsWith("{")&&o.endsWith("}")||o.startsWith("[")&&o.endsWith("]"))try{return this.violatesAggregationFirstPolicy(JSON.parse(o),i,r)}catch{return false}return false}if(Array.isArray(t))return t.length>0&&t.every(o=>typeof o=="object"&&o!==null)?t.length>s?true:t.some(o=>this.violatesAggregationFirstPolicy(o,i,r)):t.length>0&&t.every(o=>typeof o!="object"||o===null)?!a:t.some(o=>this.violatesAggregationFirstPolicy(o,i,r));if(t&&typeof t=="object"){let o=Object.keys(t);return r!==void 0&&r>0&&r<10&&(o.length>3||Object.values(t).some(c=>Array.isArray(c)||typeof c=="object"&&c!==null))||o.length>s?true:Object.values(t).some(u=>this.violatesAggregationFirstPolicy(u,i,r))}return false}buildEnvelopeSpec(){let t=["LIOP v1 Envelope Specification","================================","","FORMAT:","","Compact Envelope:"," @LIOP{wasi_v1,TaskName}"," <JavaScript code>"," @END","","RUNTIME ENVIRONMENT:","- env.records: Array of data objects from the origin","- Must use 'return' to output results","- Zero-Trust WASI Sandbox (Node.js Worker Pool)","- Return aggregated objects, NOT raw row-level arrays","","SECURITY CONSTRAINTS:","- PII Egress Shield blocks raw identifiers in output","- Aggregation-First policy: prefer counts, averages, summaries","- AST Guardian: static analysis before execution"];return this.config?.security?.forbiddenKeys?.length&&t.push(`- Restricted fields: ${this.config.security.forbiddenKeys.join(", ")}`),t.push("","TAINT TRACKING (Phase 108):","- AST-level analysis blocks PII-derived scalars (charCodeAt, charAt, etc.)","- Operations on restricted fields are tracked through variable assignments","- Boolean inference (field.charCodeAt(0) < N ? 1 : 0) is blocked","- Allowed: aggregations on non-PII fields (balance, amount, date)","","K-ANONYMITY:","- Datasets < 10 records: max 3 scalar output fields, no nesting","- Datasets >= 10 records: max 10 output fields","","RATE LIMITS (OWASP A01):","- Per-tool: 15 calls/min (configurable via LIOP_RATE_LIMIT_MAX)","- Global: 40 calls/min across all tools (LIOP_RATE_LIMIT_GLOBAL_MAX)","","OPTIONAL PARAMETERS:","- __liop_bypass_ast_cache: boolean (force AST re-evaluation)"),t.join(`
|
|
19
|
-
`)}extractSchemaFieldSummary(t,i=0){if(i>3)return "{...}";let r=t.type,s=t.properties,a=t.items;return s?`{${Object.entries(s).map(([u,c])=>{let l=c.type;if(l==="array"&&c.items){let p=this.extractSchemaFieldSummary(c.items,i+1);return `${u}(array of ${p})`}if(l==="object"&&c.properties){let p=this.extractSchemaFieldSummary(c,i+1);return `${u}(${p})`}return `${u}(${l||"unknown"})`}).join(", ")}}`:r==="array"&&a?`Array of ${this.extractSchemaFieldSummary(a,i+1)}`:r||Object.keys(t).join(", ")}async connect(t={}){return this.connectToMesh(t)}tool(t,i,r,s,a){if(this.tools.has(t))throw new Error(`Tool already registered: ${t}`);let o=b$1.object(r),u=
|
|
17
|
+
}`,{ecmaVersion:2022,sourceType:"script"});}catch{return []}let r=new Set;return X(i,{CallExpression:a=>{if(a.callee.type!=="MemberExpression")return;let o=a.callee,u=this.getPropertyName(o);if(!u||!this.isEnvRecordsChain(o.object))return;let c=a.arguments[0];if(!c||c.type!=="ArrowFunctionExpression"&&c.type!=="FunctionExpression")return;let l=c,p=0;if(e.REDUCE_METHODS.has(u)&&(p=1),l.params.length>p){let m=l.params[p];if(m.type==="Identifier"){let x=m.name,T=this.extractFieldsFromBody(l.body,x);for(let k of T)r.add(k);}}}}),Array.from(r)}detectCorrelatedAggregations(t){let i=new Map;X(t,{CallExpression:s=>{if(s.callee.type!=="MemberExpression")return;let a=s.callee,o=this.getPropertyName(a);if(!o||!e.REDUCE_METHODS.has(o)||!this.isEnvRecordsChain(a.object))return;let u=s.arguments[0];if(!u||u.type!=="ArrowFunctionExpression"&&u.type!=="FunctionExpression")return;let c=u,l=c.params.length>1?c.params[1]:c.params[0];if(!l||l.type!=="Identifier")return;let p=l.name,m=this.extractFieldsFromBody(c.body,p);for(let x of m){let T=i.get(x)??0;i.set(x,T+1);}}});for(let[s,a]of i)if(a>=2)return {reason:`Correlation guard: ${a} aggregations detected on field '${s}'. Multiple correlated aggregations on the same field can enable differencing attacks. Use a single aggregation per numeric field, or increase dataset size above 50 records.`};return null}isEnvRecordsChain(t){if(this.isEnvRecordsAccess(t))return true;if(t.type==="CallExpression"){let i=t;if(i.callee.type==="MemberExpression"){let r=i.callee,s=this.getPropertyName(r);if(s&&(s==="slice"||s==="filter"||s==="toSorted"))return this.isEnvRecordsChain(r.object)}}return false}extractFieldsFromBody(t,i){let r=[];return X(t,{MemberExpression:a=>{if(a.object.type==="Identifier"&&a.object.name===i){let o=this.getPropertyName(a);o&&o!=="length"&&r.push(o);}}}),r}detectMinMaxExtraction(t){let i=null;return X(t,{CallExpression:s=>{if(!i&&s.callee.type==="MemberExpression"){let a=s.callee;if(a.object.type==="Identifier"&&a.object.name==="Math"){let o=this.getPropertyName(a);(o==="min"||o==="max")&&s.arguments.some(u=>u.type==="SpreadElement"&&this.isRecordsMapCall(u.argument))&&(i={reason:`Min/Max gate: Math.${o}() on individual records blocked for small datasets (n < 50). Use avg/stddev/count for privacy-safe aggregations.`});}}},MemberExpression:s=>{if(!i&&s.computed&&s.object.type==="CallExpression"){let a=s.object;if(a.callee.type==="MemberExpression"){let o=this.getPropertyName(a.callee);if(o==="sort"||o==="toSorted"){let u=a.callee.object;this.isEnvRecordsChain(u)&&(i={reason:"Min/Max gate: .sort()[index] on individual records blocked for small datasets (n < 50). Use avg/stddev/count for privacy-safe aggregations."});}}}}}),i}isRecordsMapCall(t){if(t.type!=="CallExpression")return false;let i=t;if(i.callee.type!=="MemberExpression")return false;let r=i.callee;return this.getPropertyName(r)==="map"&&this.isEnvRecordsChain(r.object)}identifyRecordBoundVars(t,i){X(t,{CallExpression:a=>{if(a.callee.type!=="MemberExpression")return;let o=a.callee,u=this.getPropertyName(o);if(!u||!this.isEnvRecordsAccess(o.object))return;let c=a.arguments[0];if(c&&(c.type==="ArrowFunctionExpression"||c.type==="FunctionExpression")){let l=c;if(e.ARRAY_CALLBACK_METHODS.has(u)&&l.params.length>0){let p=l.params[0];p.type==="Identifier"&&i.add(p.name);}if(e.REDUCE_METHODS.has(u)&&l.params.length>1){let p=l.params[1];p.type==="Identifier"&&i.add(p.name);}}},ForOfStatement:a=>{if(this.isEnvRecordsAccess(a.right)&&a.left.type==="VariableDeclaration")for(let o of a.left.declarations)o.id.type==="Identifier"&&i.add(o.id.name);}}),X(t,{VariableDeclarator:a=>{if(!(!a.init||a.id.type!=="Identifier")&&a.init.type==="MemberExpression"&&a.init.computed){let o=a.init;this.isEnvRecordsAccess(o.object)&&i.add(a.id.name);}}});}propagateTaint(t,i,r){for(let s=0;s<3;s++){let a=r.size;if(X(t,{VariableDeclarator:u=>{!u.init||u.id.type!=="Identifier"||this.isExpressionTainted(u.init,i,r)&&r.add(u.id.name);},AssignmentExpression:u=>{u.left.type==="Identifier"&&this.isExpressionTainted(u.right,i,r)&&r.add(u.left.name);},CallExpression:u=>{if(u.callee.type!=="MemberExpression")return;let c=u.callee;this.getPropertyName(c)==="push"&&c.object.type==="Identifier"&&u.arguments.some(p=>this.isExpressionTainted(p,i,r))&&r.add(c.object.name);}}),r.size===a)break}}checkReturnStatements(t,i,r){let s=null;return X(t,{ReturnStatement:o=>{if(!s&&o.argument&&this.isExpressionTainted(o.argument,i,r)){let u=o.loc?.start.line?o.loc.start.line-1:void 0,c=this.describeTaintSource(o.argument,i,r);s={reason:`PII side-channel detected: output contains values derived from restricted fields. ${c?`Operation: ${c}. `:""}Use only non-PII fields (e.g., numeric/date columns) for aggregations.`,line:u,operation:c};}}}),s}isExpressionTainted(t,i,r){switch(t.type){case "Identifier":return r.has(t.name);case "MemberExpression":return this.isMemberExprTainted(t,i,r);case "CallExpression":return this.isCallExprTainted(t,i,r);case "BinaryExpression":case "LogicalExpression":{let s=t;return this.isExpressionTainted(s.left,i,r)||this.isExpressionTainted(s.right,i,r)}case "UnaryExpression":{let s=t;return this.isExpressionTainted(s.argument,i,r)}case "ConditionalExpression":{let s=t;return this.isExpressionTainted(s.test,i,r)||this.isExpressionTainted(s.consequent,i,r)||this.isExpressionTainted(s.alternate,i,r)}case "ObjectExpression":return t.properties.some(a=>a.type==="Property"&&this.isExpressionTainted(a.value,i,r));case "ArrayExpression":return t.elements.some(a=>a!==null&&this.isExpressionTainted(a,i,r));case "TemplateLiteral":return t.expressions.some(a=>this.isExpressionTainted(a,i,r));case "SpreadElement":{let s=t;return this.isExpressionTainted(s.argument,i,r)}default:return false}}isMemberExprTainted(t,i,r){let s=this.getPropertyName(t);if(t.object.type==="Identifier"&&i.has(t.object.name)&&s&&this.piiFields.has(s.toLowerCase()))return true;if(t.object.type==="MemberExpression"&&s&&this.piiFields.has(s.toLowerCase())){let a=t.object;if(a.computed&&this.isEnvRecordsAccess(a.object))return true}if(this.isExpressionTainted(t.object,i,r))return true;if(t.computed&&t.object.type==="Identifier"&&i.has(t.object.name)&&t.property.type==="Literal"){let a=t.property.value;if(typeof a=="string"&&this.piiFields.has(a.toLowerCase()))return true}return false}isCallExprTainted(t,i,r){if(t.callee.type==="MemberExpression"){let s=t.callee,a=this.getPropertyName(s);if(a&&e.TAINT_PROPAGATING_METHODS.has(a)&&this.isExpressionTainted(s.object,i,r))return true;if(this.isEnvRecordsAccess(s.object)&&t.arguments[0]){let o=t.arguments[0];if(o.type==="ArrowFunctionExpression"||o.type==="FunctionExpression")return this.doesCallbackProduceTaint(o,a,i,r)}if(this.isExpressionTainted(s.object,i,r)||t.arguments.some(o=>this.isExpressionTainted(o,i,r)))return true}if(t.callee.type==="MemberExpression"){let s=t.callee;this.getPropertyName(s)==="push"&&s.object.type==="Identifier"&&t.arguments.some(o=>this.isExpressionTainted(o,i,r))&&r.add(s.object.name);}if(t.callee.type==="Identifier"){let s=t.callee.name;if(!new Set(["Math","Number","parseInt","parseFloat","isNaN","isFinite"]).has(s))return t.arguments.some(o=>this.isExpressionTainted(o,i,r))}return false}doesCallbackProduceTaint(t,i,r,s){let a=new Set(r),o=new Set(s);if(t.params.length>0){let p=i!==null&&e.REDUCE_METHODS.has(i)?1:0;t.params.length>p&&t.params[p].type==="Identifier"&&a.add(t.params[p].name);}if(t.type==="ArrowFunctionExpression"&&t.body.type!=="BlockStatement")return this.isExpressionTainted(t.body,a,o);let u=false,c={ReturnStatement:l=>{l.argument&&this.isExpressionTainted(l.argument,a,o)&&(u=true);}};return X(t.body,c),u}getPropertyName(t){if(!t.computed&&t.property.type==="Identifier")return t.property.name;if(t.computed&&t.property.type==="Literal"){let i=t.property.value;if(typeof i=="string")return i}return null}isEnvRecordsAccess(t){if(t.type==="MemberExpression"){let i=t;if(this.getPropertyName(i)==="records"&&i.object.type==="Identifier"&&i.object.name==="env")return true}return t.type==="Identifier"&&t.name==="records"}describeTaintSource(t,i,r){if(t.type==="Identifier"){let s=t.name;if(r.has(s))return `variable '${s}' is PII-derived`}if(t.type==="ObjectExpression"){let s=t;for(let a of s.properties)if(a.type==="Property"&&this.isExpressionTainted(a.value,i,r))return `property '${a.key.type==="Identifier"?a.key.name:"unknown"}' contains PII-derived value`}if(t.type==="CallExpression"){let s=t;if(s.callee.type==="MemberExpression"){let a=this.getPropertyName(s.callee);if(a)return `result of .${a}() on PII data`}}}};var Vr={aspirin:"Medication",lisinopril:"Medication",metformin:"Medication",amlodipine:"Medication",atorvastatin:"Medication",omeprazole:"Medication",losartan:"Medication",simvastatin:"Medication",levothyroxine:"Medication",ibuprofen:"Medication",acetaminophen:"Medication",amoxicillin:"Medication",ciprofloxacin:"Medication",prednisone:"Medication",warfarin:"Medication",insulin:"Medication",hydrochlorothiazide:"Medication",gabapentin:"Medication",albuterol:"Medication",pantoprazole:"Medication",hypertension:"Condition",diabetes:"Condition",bronchitis:"Condition",pneumonia:"Condition",asthma:"Condition"},ze=4,Fr=/^[\d\s.,:;!?()[\]{}<>@#$%^&*+=|\\/"'`~_-]+$/,We=class e{static nlp=null;async getNlp(){if(!e.nlp){let t=await import('compromise/three');e.nlp=t.default||t,e.nlp.addWords(Vr);}return e.nlp}async scan(t){if(t.length<ze||Fr.test(t))return {detected:false,entities:[]};let r=(await this.getNlp())(t),s=[],a=r.people().out("array");for(let c of a){let l=c.trim();l.length>=ze&&s.push({type:"person",text:l});}let o=r.places().out("array");for(let c of o){let l=c.trim();l.length>=ze&&s.push({type:"place",text:l});}let u=r.organizations().out("array");for(let c of u){let l=c.trim();l.length>=ze&&s.push({type:"organization",text:l});}return {detected:s.length>0,entities:s}}async scanDeep(t,i=new WeakSet){if(t==null)return {detected:false,entities:[]};if(typeof t=="string")return this.scan(t);if(typeof t=="object"){if(i.has(t))return {detected:false,entities:[]};i.add(t);let r=Array.isArray(t)?t:Object.values(t),s=[];for(let a of r){let o=await this.scanDeep(a,i);if(o.detected&&(s.push(...o.entities),o.entities.some(u=>u.type==="person")))return {detected:true,entities:s}}return {detected:s.length>0,entities:s}}return {detected:false,entities:[]}}};function jr(e){let t=e.replace(/\D/g,"");if(t.length<13||t.length>19)return false;let i=0,r=false;for(let s=t.length-1;s>=0;s--){let a=parseInt(t.charAt(s),10);r&&(a*=2,a>9&&(a-=9)),i+=a,r=!r;}return i%10===0}function Br(e){let t=e.replace(/\s+/g,"").toUpperCase();if(!/^[A-Z]{2}[0-9]{2}[A-Z0-9]{1,30}$/.test(t))return false;let i=t.substring(4)+t.substring(0,4),r="";for(let s=0;s<i.length;s++){let a=i.charCodeAt(s);if(a>=65&&a<=90)r+=(a-55).toString();else if(a>=48&&a<=57)r+=i.charAt(s);else return false}try{return BigInt(r)%97n===1n}catch{return false}}var L={EMAIL:{name:"EMAIL",pattern:/\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}\b/gi,validator:e=>!e.endsWith("@example.com")&&!e.endsWith("@test.com")},CREDIT_CARD:{name:"CREDIT_CARD",pattern:/\b(?:\d[ -]*?){13,16}\b/g,validator:jr},IP_ADDRESS:{name:"IP_ADDRESS",pattern:/\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/g,validator:e=>["127.0.0.1","0.0.0.0","255.255.255.255"].includes(e)?false:e.split(".").map(Number).every(r=>r>=0&&r<=255)},PHONE:{name:"PHONE",pattern:/(?:(?:\+?\d{1,3}[-. ]?)?\(?\d{3}\)?[-. ]?\d{3}[-. ]?\d{4})\b/g,validator:e=>{let t=e.replace(/\D/g,"");return !(t.length<7||t.length>15||/^(\d)\1+$/.test(t)||t==="1234567890")}},SSN:{name:"SSN",pattern:/\b\d{3}[- ]?\d{2}[- ]?\d{4}\b/g,validator:e=>{let t=e.replace(/\D/g,"");if(t.length!==9)return false;let i=parseInt(t.substring(0,3),10);return !(i===0||i===666||i>=900||parseInt(t.substring(3,5),10)===0||parseInt(t.substring(5,9),10)===0||/^(\d)\1+$/.test(t)||t==="123456789")}},IBAN:{name:"IBAN",pattern:/\b[A-Z]{2}[0-9]{2}[A-Z0-9]{1,30}\b/gi,validator:Br},PASSPORT_MRZ:{name:"PASSPORT_MRZ",pattern:/\bP[A-Z<][A-Z<]{3}[A-Z0-9<]{39}(?:\b|\s|$)/g}},Vi={GLOBAL_STRICT:[L.EMAIL,L.CREDIT_CARD,L.IP_ADDRESS,L.PHONE,L.PASSPORT_MRZ,L.IBAN],US_COMPLIANT:[L.EMAIL,L.CREDIT_CARD,L.IP_ADDRESS,L.PHONE,L.SSN,L.PASSPORT_MRZ],EU_GDPR:[L.EMAIL,L.CREDIT_CARD,L.IP_ADDRESS,L.PHONE,L.IBAN,L.PASSPORT_MRZ]},Ze=class e{patterns;forbiddenKeysSet;nerScanner;static KEY_SAFELIST=new Set(["grid","video","android","identity","provide","override","validate","hidden","widget","guidelines","beside","guideline","outside","inside","collide","decide","divide","aside","ride","side","wide","hide","tide","pride","bride","slide","guide","stride","oxide","dioxide","suicide","homicide","pesticide","valid","invalid","void","avoid","diagnosis","medication","namespace","namesake","rename","filename","hostname","typename","unnamed","renamed","phonetic","phoneme","microphone","headphone","telephone","saxophone","smartphone","streetview","addressable","addressing","cityscape","electricity","capacity","velocity","opacity","timestamp","timezone","image_id","computation_result","zk_receipt","testid","toolid","sessionid","peerid","nodeid","requestid","correlationid","traceid","spanid"]);shortTokenBoundaryPatterns;longForbiddenTokens;constructor(t=[],i=[],r){this.patterns=t,this.forbiddenKeysSet=new Set(i.map(s=>s.toLowerCase())),this.nerScanner=r??null,this.shortTokenBoundaryPatterns=new Map,this.longForbiddenTokens=[];for(let s of this.forbiddenKeysSet)s.length<4?this.shortTokenBoundaryPatterns.set(s,new RegExp((()=>{let a=s.split("").map(u=>`[${u.toLowerCase()}${u.toUpperCase()}]`).join(""),o=`[a-z]${s.charAt(0).toUpperCase()}${s.slice(1)}`;return `(?:^|[_-])${a}(?:$|[_-])|${o}(?:$|[A-Z_-])|^${a}$`})())):this.longForbiddenTokens.push(s);}async scan(t,i=new WeakSet){if(t==null)return null;if(typeof t=="string"){let r=t.trim();if(r.startsWith("{")&&r.endsWith("}")||r.startsWith("[")&&r.endsWith("]"))try{let a=JSON.parse(r),o=await this.scan(a,i);if(o)return o}catch{}let s=this.checkString(t);if(s)return s;if(this.nerScanner){let a=await this.nerScanner.scan(t);if(a.detected){let o=a.entities.find(u=>u.type==="person");if(o)return `PII Entity Detected: person name "${o.text}"`}}return null}if(typeof t=="object"){if(i.has(t))return null;if(i.add(t),Array.isArray(t))for(let r of t){let s=await this.scan(r,i);if(s)return s}else for(let[r,s]of Object.entries(t)){if(this.forbiddenKeysSet.has(r.toLowerCase()))return `Forbidden Key: ${r}`;let a=this.checkKeyFuzzy(r);if(a)return a;let o=await this.scan(s,i);if(o)return o}}return null}checkKeyFuzzy(t){let i=t.toLowerCase();if(e.KEY_SAFELIST.has(i))return null;for(let[r,s]of this.shortTokenBoundaryPatterns)if(s.test(t))return `Forbidden Key (fuzzy): ${t} matches boundary pattern "${r}"`;for(let r of this.longForbiddenTokens)if(i.includes(r))return `Forbidden Key (fuzzy): ${t} contains restricted token "${r}"`;return null}checkString(t){for(let i of this.patterns)if(typeof i=="string"){if(t.toLowerCase().includes(i.toLowerCase()))return i}else if(i instanceof RegExp){if(i.global&&(i.lastIndex=0),i.test(t))return i.source}else if(typeof i=="object"&&i!==null){let r=i;if(typeof r.pattern=="string"){if(t.toLowerCase().includes(r.pattern.toLowerCase())&&(!r.validator||r.validator(r.pattern)))return r.name}else if(r.pattern instanceof RegExp){r.pattern.global&&(r.pattern.lastIndex=0);let s=r.pattern.exec(t);for(;s!==null;){let a=s[0];if(!r.validator||r.validator(a))return r.name;if(!r.pattern.global)break;s=r.pattern.exec(t);}}}return null}};var ji=Ee.dirname(fileURLToPath(import.meta.url)),Bi=class e{constructor(t,i){this.serverInfo=t;this.config=i;let r=this.config?.security?.enableNerScanning?new We:null;this.piiScanner=new Ze(this.config?.security?.piiPatterns??Vi.GLOBAL_STRICT,this.config?.security?.forbiddenKeys??["id","name","fullName","firstName","lastName","address","street","city","postalCode","zipCode","phone","email","ssn","accountHolder","accountNumber","account_number","password","token","secret","privateKey"],r);let s=this.config?.security?.rateLimit;this.toolCallWindowMs=s?.windowMs??Number.parseInt(process.env.LIOP_RATE_LIMIT_WINDOW_MS??"60000",10),this.toolCallMaxPerWindow=s?.maxPerWindow??Number.parseInt(process.env.LIOP_RATE_LIMIT_MAX??"15",10),this.globalCallMaxPerWindow=s?.globalMaxPerWindow??Number.parseInt(process.env.LIOP_RATE_LIMIT_GLOBAL_MAX??"40",10);let a=this.config?.security?.forbiddenKeys??["id","name","fullName","firstName","lastName","address","street","city","postalCode","zipCode","phone","email","ssn","accountHolder","accountNumber","account_number","password","token","secret","privateKey"];this.taintAnalyzer=new Ue(a);let o=import.meta.url.endsWith(".ts"),u=o?".ts":".js",c=[];if(o)try{let T=createRequire(import.meta.url).resolve("tsx/package.json");c=["--import",pathToFileURL(Ee.join(Ee.dirname(T),"dist","loader.mjs")).href];}catch{c=["--import","tsx"];}let l=process.env.NODE_ENV==="test"||process.env.VITEST;this.config?.capabilities&&!this.serverInfo.capabilities&&(this.serverInfo.capabilities=this.config.capabilities);let p=[Ee.resolve(ji,`./workers/logic-execution${u}`),Ee.resolve(ji,`../workers/logic-execution${u}`)],m=p.find(x=>Ui.existsSync(x))||p[1];this.workerPool=new Piscina({filename:m,minThreads:this.config?.workerPool?.minThreads??(l?0:2),maxThreads:this.config?.workerPool?.maxThreads??(l?1:8),idleTimeout:this.config?.workerPool?.idleTimeout??(l?500:5e3),maxQueue:"auto",taskQueue:new FixedQueue,execArgv:c,resourceLimits:{maxOldGenerationSizeMb:this.config?.workerPool?.maxHeapMb??Number.parseInt(process.env.LIOP_WORKER_MAX_HEAP_MB??"64",10)}}),this.resource("LIOP Envelope Specification","liop://protocol/envelope-spec","Complete Logic-on-Origin envelope format, execution rules, and security constraints","text/plain",()=>Promise.resolve(this.buildEnvelopeSpec()));}logicCache=new Map;connectionStats=new Map;CACHE_TTL_MS=1440*60*1e3;THROTTLE_THRESHOLD=5;THROTTLE_COOLDOWN_MS=60*1e3;toolCallWindows=new Map;toolCallMaxPerWindow;toolCallWindowMs;globalCallWindow=[];globalCallMaxPerWindow;fieldQueryBudget=new Map;taintAnalyzer;tools=new Map;resources=new Map;prompts=new Map;activeSchema=null;sandboxRecords=[];piiScanner;workerPool;meshNode=null;rpcServer=null;boundPort=null;sessions=new Map;static LIOP_COMPACT_REGEX=/@LIOP\{(?<target>[^,}]+)(?:,(?<name>[^}]*))?\}\n(?<logic>[\s\S]*?)\n@END/m;extractLogic(t){let i=t.match(e.LIOP_COMPACT_REGEX);return i?.groups?.logic?i.groups.logic.trim():null}parseUnknownJson(t){if(typeof t!="string")return t;let i=t.trim();if(i.startsWith("{")&&i.endsWith("}")||i.startsWith("[")&&i.endsWith("]"))try{return JSON.parse(i)}catch{return t}return t}runPreflightPolicy(t,i,r){if(r){let c=i.replace(/\s+/g," ");if(r.enforceAggregationFirst&&[/return\s+env\.records(?!\s*\.\s*(?:reduce|length|filter|every|some|find)\b)/i,/return\s*\{[\s\S]*\b(accounts|patients|rows|records)\s*:\s*env\.records(?!\s*\.\s*(?:reduce|length|filter)\b)/i].some(p=>p.test(c)))return "Preflight policy rejected: potential row-level export pattern detected.";if(r.preflightDenyPatterns?.some(l=>l.test(c)))return "Preflight policy rejected: custom deny pattern matched."}let s=50;typeof r?.enforceAggregationFirst=="object"&&(s=r.enforceAggregationFirst.minMaxBlockThreshold??50);let a=this.taintAnalyzer.analyze(i,this.sandboxRecords.length,s);if(a)return `Preflight policy rejected: ${a.reason}`;let o=r?.queryBudgetPerField??5,u=this.taintAnalyzer.extractQueriedFields(i);if(u.length>0){let c=this.fieldQueryBudget.get(t);c||(c=new Map,this.fieldQueryBudget.set(t,c));for(let l of u)if((c.get(l)??0)>=o)return `Preflight policy rejected: Query budget exceeded for field '${l}' (max ${o} per session). Rotate PQC session to reset budget.`;for(let l of u){let p=c.get(l)??0;c.set(l,p+1);}}return null}validateOutputPolicy(t,i,r){if(!r)return null;let s=this.parseUnknownJson(i);if(r.outputSchema){let o=(()=>{if(!(r.outputSchema instanceof b$1.ZodObject))return r.outputSchema;let u=r.outputSchema;return u._def.catchall instanceof b$1.ZodNever?u.strict():u})().safeParse(s);if(!o.success)return `[LIOP] Output schema violation for ${t}: ${o.error.issues.map(u=>`${u.path.join(".")||"<root>"} ${u.message}`).join("; ")}. HINT: Your output must conform to the declared schema. Use 'env.records' to access the dataset and return only allowed fields.`}return r.enforceAggregationFirst&&this.violatesAggregationFirstPolicy(this.unwrapForAggregationPolicyScan(s),r.enforceAggregationFirst,this.sandboxRecords.length)?process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test"||process.env.LIOP_SEC_VERBOSE==="1"?"Aggregation-First Policy Violation: row-level export or K-Anonymity violation blocked. HINT: Use .reduce() to produce a flat {key:value} object. Do NOT use .map() to create arrays of objects. Ensure dataset size > 10 for detailed results.":"Aggregation-First Policy Violation: Output blocked due to privacy constraints.":null}unwrapForAggregationPolicyScan(t){if(typeof t=="string"){let a=t.trim();if(a.startsWith("{")&&a.endsWith("}")||a.startsWith("[")&&a.endsWith("]"))try{return this.unwrapForAggregationPolicyScan(JSON.parse(a))}catch{return t}return t}if(!t||typeof t!="object")return t;let i=t;if(i.computation_result!==void 0)return this.unwrapForAggregationPolicyScan(i.computation_result);if(!Array.isArray(i.content)||i.content.length===0)return t;let r=[];for(let a of i.content)if(a&&typeof a=="object"&&"text"in a){let o=a.text;typeof o=="string"&&r.push(o);}if(r.length===0)return t;let s=r.length===1?r[0]:r.join(`
|
|
18
|
+
`);return this.unwrapForAggregationPolicyScan(s)}violatesAggregationFirstPolicy(t,i,r){if(!i)return false;let s=typeof i=="object"&&typeof i.maxOutputRows=="number"?i.maxOutputRows:10,a=typeof i=="object"&&typeof i.allowPrimitiveArrays=="boolean"?i.allowPrimitiveArrays:true;if(typeof t=="string"){let o=t.trim();if(o.startsWith("{")&&o.endsWith("}")||o.startsWith("[")&&o.endsWith("]"))try{return this.violatesAggregationFirstPolicy(JSON.parse(o),i,r)}catch{return false}return false}if(Array.isArray(t))return t.length>0&&t.every(o=>typeof o=="object"&&o!==null)?t.length>s?true:t.some(o=>this.violatesAggregationFirstPolicy(o,i,r)):t.length>0&&t.every(o=>typeof o!="object"||o===null)?!a:t.some(o=>this.violatesAggregationFirstPolicy(o,i,r));if(t&&typeof t=="object"){let o=Object.keys(t);return r!==void 0&&r>0&&r<10&&(o.length>3||Object.values(t).some(c=>Array.isArray(c)||typeof c=="object"&&c!==null))||o.length>s?true:Object.values(t).some(u=>this.violatesAggregationFirstPolicy(u,i,r))}return false}buildEnvelopeSpec(){let t=["LIOP v1 Envelope Specification","================================","","FORMAT:","","Compact Envelope:"," @LIOP{wasi_v1,TaskName}"," <JavaScript code>"," @END","","RUNTIME ENVIRONMENT:","- env.records: Array of data objects from the origin","- Must use 'return' to output results","- Zero-Trust WASI Sandbox (Node.js Worker Pool)","- Return aggregated objects, NOT raw row-level arrays","","SECURITY CONSTRAINTS:","- PII Egress Shield blocks raw identifiers in output","- Aggregation-First policy: prefer counts, averages, summaries","- AST Guardian: static analysis before execution"];return this.config?.security?.forbiddenKeys?.length&&t.push(`- Restricted fields: ${this.config.security.forbiddenKeys.join(", ")}`),t.push("","TAINT TRACKING (Phase 108):","- AST-level analysis blocks PII-derived scalars (charCodeAt, charAt, etc.)","- Operations on restricted fields are tracked through variable assignments","- Boolean inference (field.charCodeAt(0) < N ? 1 : 0) is blocked","- Allowed: aggregations on non-PII fields (balance, amount, date)","","K-ANONYMITY:","- Datasets < 10 records: max 3 scalar output fields, no nesting","- Datasets >= 10 records: max 10 output fields","","RATE LIMITS (OWASP A01):","- Per-tool: 15 calls/min (configurable via LIOP_RATE_LIMIT_MAX)","- Global: 40 calls/min across all tools (LIOP_RATE_LIMIT_GLOBAL_MAX)","","OPTIONAL PARAMETERS:","- __liop_bypass_ast_cache: boolean (force AST re-evaluation)"),t.join(`
|
|
19
|
+
`)}extractSchemaFieldSummary(t,i=0){if(i>3)return "{...}";let r=t.type,s=t.properties,a=t.items;return s?`{${Object.entries(s).map(([u,c])=>{let l=c.type;if(l==="array"&&c.items){let p=this.extractSchemaFieldSummary(c.items,i+1);return `${u}(array of ${p})`}if(l==="object"&&c.properties){let p=this.extractSchemaFieldSummary(c,i+1);return `${u}(${p})`}return `${u}(${l||"unknown"})`}).join(", ")}}`:r==="array"&&a?`Array of ${this.extractSchemaFieldSummary(a,i+1)}`:r||Object.keys(t).join(", ")}async connect(t={}){return this.connectToMesh(t)}tool(t,i,r,s,a){if(this.tools.has(t))throw new Error(`Tool already registered: ${t}`);let o=b$1.object(r),u=Ke(o),c=i,l=s;if(r.payload&&r.payload instanceof b$1.ZodString){let m=this.config?.security?.forbiddenKeys||[];if(c+=`
|
|
20
20
|
|
|
21
21
|
Payload: LIOP v1 envelope (WASI sandbox). Format: @LIOP{wasi_v1,TaskName}\\n<JS code>\\n@END | Access data: env.records. Return aggregated object. | Full spec: resource liop://protocol/envelope-spec`,m.length>0&&(c+=`
|
|
22
|
-
Restricted fields: ${m.join(", ")}.`),this.activeSchema){let
|
|
23
|
-
Data structure: ${
|
|
22
|
+
Restricted fields: ${m.join(", ")}.`),this.activeSchema){let x=this.extractSchemaFieldSummary(this.activeSchema);c+=`
|
|
23
|
+
Data structure: ${x}. Full schema: resource liop://schema/global`;}l=async(x,T)=>{let k="global_connection",N=Date.now(),A=this.connectionStats.get(k)||{failures:0,lastAttempt:0};if(A.failures>=this.THROTTLE_THRESHOLD&&N-A.lastAttempt<this.THROTTLE_COOLDOWN_MS)return {content:[{type:"text",text:"LIOP_THROTTLED: Too many violations. Cooling down for 60 seconds."}],isError:true};let q=x.payload,_e=x.__liop_bypass_ast_cache===true,ge=Fi.createHash("sha256").update(q).digest("hex"),B=this.extractLogic(q),he=this.logicCache.get(ge);if(!_e&&he&&N-he.timestamp<this.CACHE_TTL_MS&&B){x.payload=B;let Q=this.runPreflightPolicy(t,B,a);return Q?{content:[{type:"text",text:Q}],isError:true}:await this.executeInWorkerPool(x,B,t)}if(!B)return A.failures++,A.lastAttempt=N,this.connectionStats.set(k,A),{content:[{type:"text",text:"Error: Malformed payload. Missing @LIOP boundary.\\nYou MUST wrap your logic exactly like this:\\n\\n@LIOP{wasi_v1,DynamicAudit}\\n// Your JS code here\\n@END"}],isError:true};try{let Q=this.extractLogic(x.payload);x.payload=Q;let we=this.runPreflightPolicy(t,Q,a);if(we)return A.failures++,A.lastAttempt=N,this.connectionStats.set(k,A),{content:[{type:"text",text:we}],isError:!0};let ht=await this.executeInWorkerPool(x,Q,t);return ht.isError?(A.failures++,A.lastAttempt=N,this.connectionStats.set(k,A)):(this.connectionStats.set(k,{failures:0,lastAttempt:N}),this.logicCache.set(ge,{hash:ge,timestamp:N})),ht}catch(Q){let we=Q;return A.failures++,A.lastAttempt=N,this.connectionStats.set(k,A),{content:[{type:"text",text:`ExecutionRuntimeException: ${we.message}`}],isError:true}}};}let p={type:"object",properties:u.properties||{},required:u.required};this.tools.set(t,{tool:{name:t,description:c,inputSchema:p},handler:l,schema:o,policy:a}),this.meshNode&&this.meshNode.announceCapability(t).catch(m=>{a$1.info(`[LIOP-Mesh] Failed to auto-announce tool ${t}: ${m.message}`);});}prompt(t,i,r,s){if(this.prompts.has(t))throw new Error(`Prompt already registered: ${t}`);this.prompts.set(t,{prompt:{name:t,description:i,arguments:r},handler:s});}enableZeroShotAutonomy(){this.prompt("liop_blind_analyst","The official Logic-Injection-on-Origin Protocol system prompt. Instructs the LLM on how to securely inject Logic-on-Origin without violating PII or safety constraints.",[],t=>({description:"LIOP Blind Analyst Instructions",messages:[{role:"user",content:{type:"text",text:`You are the "Blind Analyst" operating within the Logic-Injection-on-Origin Protocol (LIOP) ecosystem.
|
|
24
24
|
Your objective is to perform secure Logic-on-Origin injections. You must process remote data without ever requesting its extraction.
|
|
25
25
|
|
|
26
26
|
INDUSTRIAL CONSTRAINTS & PROTOCOL RULES:
|
|
@@ -39,5 +39,5 @@ CURRENT DATA DICTIONARY (STRICT):
|
|
|
39
39
|
${JSON.stringify(this.activeSchema,null,2)}`:""}
|
|
40
40
|
|
|
41
41
|
Protocol Adherence is mandatory for successful execution.`}}]}));}resource(t,i,r,s,a){if(this.resources.has(i))throw new Error(`Resource URI already registered: ${i}`);this.resources.set(i,{name:t,uri:i,description:r,mimeType:s,content:a});}dataDictionary(t,i="Global Medical Data Dictionary",r="liop://schema/global",s="Exposes the internal database schema for Zero-Shot Autonomy planning"){this.activeSchema=t;let a=this.extractSchemaFieldSummary(t);for(let[o,u]of this.tools.entries())u.schema.shape.payload&&u.schema.shape.payload instanceof b$1.ZodString&&u.tool.description&&!u.tool.description.includes("Data structure:")&&(u.tool.description+=`
|
|
42
|
-
Data structure: ${a}. Full schema: resource ${r}`,this.tools.set(o,u));this.resource(i,r,s,"application/json",JSON.stringify(t,null,2));}clearAstCache(){this.logicCache.clear(),a$1.info("[LIOP-SDK] AST Security Cache cleared by Admin.");}checkToolCallRateLimit(t){let i=Date.now(),r=this.toolCallWindowMs,s=this.toolCallMaxPerWindow,o=(this.toolCallWindows.get(t)||[]).filter(u=>i-u<r);if(o.length>=s){let u=Math.ceil((o[0]+r-i)/1e3);return {content:[{type:"text",text:`LIOP_RATE_LIMITED: Too many calls to ${t}. Max ${s} per ${r/1e3}s window. Retry after ${u}s.`}],isError:true}}return o.push(i),this.toolCallWindows.set(t,o),null}checkGlobalRateLimit(){let t=Date.now(),i=this.toolCallWindowMs,r=this.globalCallMaxPerWindow;if(this.globalCallWindow=this.globalCallWindow.filter(s=>t-s<i),this.globalCallWindow.length>=r){let s=Math.ceil((this.globalCallWindow[0]+i-t)/1e3);return {content:[{type:"text",text:`LIOP_RATE_LIMITED: Global call limit exceeded. Max ${r} total calls per ${i/1e3}s window. Retry after ${s}s.`}],isError:true}}return this.globalCallWindow.push(t),null}async callTool(t){let i=this.tools.get(t.name);if(!i)throw new Error(`Tool not found: ${t.name}`);let r=this.checkGlobalRateLimit();if(r)return r;let s=this.checkToolCallRateLimit(t.name);if(s)return s;try{let a=i.schema.parse(t.arguments||{});if(t.arguments?.__liop_bypass_ast_cache===!0&&(a.__liop_bypass_ast_cache=!0),a&&typeof a.payload=="string"){let u=a.payload,c=this.extractLogic(u);if(c){let l=this.runPreflightPolicy(t.name,c,i.policy);return l?{content:[{type:"text",text:l}],isError:!0}:(a.payload=c,await this.executeInWorkerPool(a,c,t.name))}}return await i.handler(a,{})}catch(a){let o=a;return o instanceof b$1.ZodError?{content:[{type:"text",text:`Validation Error: ${o.message}`}],isError:true}:{content:[{type:"text",text:`Internal Execution Error: ${o.message}`}],isError:true}}}listTools(){return Array.from(this.tools.values()).map(t=>t.tool)}listPrompts(){return Array.from(this.prompts.values()).map(t=>t.prompt)}async getPrompt(t){let i=this.prompts.get(t.name);if(!i)throw new Error(`Prompt not found: ${t.name}`);return await i.handler(t)}listResources(){return Array.from(this.resources.values())}async readResource(t){let i=this.resources.get(t);if(!i)throw new Error(`Resource not found: ${t}`);let r="No description provided";return typeof i.content=="function"?r=await i.content():typeof i.content=="string"?r=i.content:i.description&&(r=i.description),{contents:[{uri:i.uri,mimeType:i.mimeType||"text/plain",text:r}]}}getServerInfo(){return this.serverInfo}getMeshNode(){return this.meshNode}setSandboxData(t){this.sandboxRecords=t;}getBoundPort(){return this.boundPort}async connectToMesh(t={}){let i=process.env.LIOP_GRPC_PORT?Number.parseInt(process.env.LIOP_GRPC_PORT,10):void 0,r=t.port??i??50051;this.meshNode=new a$2(t.meshConfig),await this.meshNode.start();let s=this.meshNode;this.meshNode.registerManifestHandler(()=>{let a=this.listTools().map(u=>({name:u.name,description:u.description,inputSchema:u.inputSchema})),o=Array.from(this.resources.values()).map(u=>({name:u.name,uri:u.uri,description:u.description,mimeType:u.mimeType,text:typeof u.content=="string"?u.content:u.description}));return {peerId:s.getPeerId(),grpcPort:r,tools:a,resources:o,serverInfo:this.serverInfo}});for(let a of this.listTools())await this.meshNode.announceCapability(a.name).catch(a$1.info);await this.meshNode.announceManifest().catch(a$1.info),this.rpcServer=new
|
|
43
|
-
//# sourceMappingURL=chunk-
|
|
42
|
+
Data structure: ${a}. Full schema: resource ${r}`,this.tools.set(o,u));this.resource(i,r,s,"application/json",JSON.stringify(t,null,2));}clearAstCache(){this.logicCache.clear(),a$1.info("[LIOP-SDK] AST Security Cache cleared by Admin.");}checkToolCallRateLimit(t){let i=Date.now(),r=this.toolCallWindowMs,s=this.toolCallMaxPerWindow,o=(this.toolCallWindows.get(t)||[]).filter(u=>i-u<r);if(o.length>=s){let u=Math.ceil((o[0]+r-i)/1e3);return {content:[{type:"text",text:`LIOP_RATE_LIMITED: Too many calls to ${t}. Max ${s} per ${r/1e3}s window. Retry after ${u}s.`}],isError:true}}return o.push(i),this.toolCallWindows.set(t,o),null}checkGlobalRateLimit(){let t=Date.now(),i=this.toolCallWindowMs,r=this.globalCallMaxPerWindow;if(this.globalCallWindow=this.globalCallWindow.filter(s=>t-s<i),this.globalCallWindow.length>=r){let s=Math.ceil((this.globalCallWindow[0]+i-t)/1e3);return {content:[{type:"text",text:`LIOP_RATE_LIMITED: Global call limit exceeded. Max ${r} total calls per ${i/1e3}s window. Retry after ${s}s.`}],isError:true}}return this.globalCallWindow.push(t),null}async callTool(t){let i=this.tools.get(t.name);if(!i)throw new Error(`Tool not found: ${t.name}`);let r=this.checkGlobalRateLimit();if(r)return r;let s=this.checkToolCallRateLimit(t.name);if(s)return s;try{let a=i.schema.parse(t.arguments||{});if(t.arguments?.__liop_bypass_ast_cache===!0&&(a.__liop_bypass_ast_cache=!0),a&&typeof a.payload=="string"){let u=a.payload,c=this.extractLogic(u);if(c){let l=this.runPreflightPolicy(t.name,c,i.policy);return l?{content:[{type:"text",text:l}],isError:!0}:(a.payload=c,await this.executeInWorkerPool(a,c,t.name))}}return await i.handler(a,{})}catch(a){let o=a;return o instanceof b$1.ZodError?{content:[{type:"text",text:`Validation Error: ${o.message}`}],isError:true}:{content:[{type:"text",text:`Internal Execution Error: ${o.message}`}],isError:true}}}listTools(){return Array.from(this.tools.values()).map(t=>t.tool)}listPrompts(){return Array.from(this.prompts.values()).map(t=>t.prompt)}async getPrompt(t){let i=this.prompts.get(t.name);if(!i)throw new Error(`Prompt not found: ${t.name}`);return await i.handler(t)}listResources(){return Array.from(this.resources.values())}async readResource(t){let i=this.resources.get(t);if(!i)throw new Error(`Resource not found: ${t}`);let r="No description provided";return typeof i.content=="function"?r=await i.content():typeof i.content=="string"?r=i.content:i.description&&(r=i.description),{contents:[{uri:i.uri,mimeType:i.mimeType||"text/plain",text:r}]}}getServerInfo(){return this.serverInfo}getMeshNode(){return this.meshNode}setSandboxData(t){this.sandboxRecords=t;}getBoundPort(){return this.boundPort}async connectToMesh(t={}){let i=process.env.LIOP_GRPC_PORT?Number.parseInt(process.env.LIOP_GRPC_PORT,10):void 0,r=t.port??i??50051;this.meshNode=new a$2(t.meshConfig),await this.meshNode.start();let s=this.meshNode;this.meshNode.registerManifestHandler(()=>{let a=this.listTools().map(u=>({name:u.name,description:u.description,inputSchema:u.inputSchema})),o=Array.from(this.resources.values()).map(u=>({name:u.name,uri:u.uri,description:u.description,mimeType:u.mimeType,text:typeof u.content=="string"?u.content:u.description}));return {peerId:s.getPeerId(),grpcPort:r,tools:a,resources:o,serverInfo:this.serverInfo}});for(let a of this.listTools())await this.meshNode.announceCapability(a.name).catch(a$1.info);await this.meshNode.announceManifest().catch(a$1.info),this.rpcServer=new Ie,this.rpcServer.addService({negotiateIntent:(a,o)=>{let u=a.request;a$1.info(`[LIOP-RPC] Negotiating intent for capability: ${u.capability_hash}`),import('./kyber-NONMBQNH.js').then(async({Kyber768Wrapper:c})=>{let{publicKey:l,secretKey:p}=await c.generateKeyPair(),m=Fi.randomUUID();this.fieldQueryBudget.clear(),this.sessions.set(m,{capability_hash:u.capability_hash,kyber_sk:p}),o(null,{accepted:true,session_token:m,error_message:"",kyber_public_key:l});});},executeLogic:async a=>{let o=a.request;a$1.info(`[LIOP-RPC] Executing Logic-on-Origin for session: ${o.session_token}`);let u=this.sessions.get(o.session_token);if(!u){a.emit("error",{code:Ht.status.UNAUTHENTICATED,details:"Invalid session token"});return}try{let c=u.capability_hash,p=(c?this.tools.get(c):void 0)?.policy,m=p?{epsilon:p.dpEpsilon??1,sensitivity:p.dpSensitivity??1,smallDatasetThreshold:50}:void 0,x=await this.workerPool.run({ciphertext:o.pqc_ciphertext,secretKeyObj:Array.from(u.kyber_sk),wasmBinary:o.wasm_binary,inputs:o.inputs,aesNonce:o.aes_nonce,records:this.sandboxRecords,sessionToken:o.session_token,isEncrypted:!0,dpConfig:m}),T,k=x.output;try{T=typeof x.output=="string"?x.output:JSON.stringify(x.output);let B=JSON.parse(T);if(B.__liop_proxy_tool){a$1.info(`[LIOP-RPC] Executing Proxied Tool: ${B.__liop_proxy_tool}`);let he=await this.callTool({name:B.__liop_proxy_tool,arguments:B.__liop_proxy_args||{}});T=JSON.stringify(he),k=this.unwrapForAggregationPolicyScan(he);}}catch{T=String(x.output);}let N=this.validateOutputPolicy(c||"unknown_tool",k,p);if(N){a$1.info(`[LIOP-RPC] Output policy blocked for ${c||"unknown_tool"}: ${N}`);let Q={semantic_evidence:process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test"||process.env.LIOP_SEC_VERBOSE==="1"?N:"[LIOP] Egress Security Violation. Output blocked due to policy enforcement.",cryptographic_proof:Buffer.from(""),zk_receipt:Buffer.from(""),is_error:!0};a.write(Q,()=>{a.end();});return}let A={semantic_evidence:T,cryptographic_proof:Buffer.from(x.image_id||"","hex"),zk_receipt:x.zk_receipt?Buffer.from(x.zk_receipt,"base64"):Buffer.from(""),is_error:!1},q=typeof k=="string"?k:JSON.stringify(k??""),_e=await this.piiScanner.scan([{type:"text",text:q}]),ge=this.violatesAggregationFirstPolicy(this.unwrapForAggregationPolicyScan(k),p?.enforceAggregationFirst,this.sandboxRecords?.length);if(_e||ge){let B=_e||"Aggregation-First Policy Violation";a$1.info(`[LIOP-RPC] Secure egress blocked in gRPC stream: ${B}`),A.semantic_evidence="[LIOP] Egress Security Violation. Output blocked due to policy enforcement.",A.is_error=!0;}a.write(A,()=>{a.end();});}catch(c){let l=c,p=process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test",m=l.message||String(c);a$1.error(`[LIOP-RPC] Execution Error: ${m}`);let T={semantic_evidence:p?`Execution Error: ${m}`:"[LIOP] Execution Failed. The injected logic violated runtime constraints or encountered a fatal error.",cryptographic_proof:Buffer.from(""),zk_receipt:Buffer.from(""),is_error:true};try{a.write(T,()=>{a.end();});}catch{a.end();}}}}),this.boundPort=await this.rpcServer.listen(r),a$1.info(`[LIOP-SDK] Node successfully announced to Mesh. PeerID: ${this.meshNode.getPeerId()}`);}async executeInWorkerPool(t,i,r){try{let s=r?this.tools.get(r)?.policy:void 0,a=s?{epsilon:s.dpEpsilon??1,sensitivity:s.dpSensitivity??1,smallDatasetThreshold:50}:void 0,o=await this.workerPool.run({ciphertext:new Uint8Array(0),secretKeyObj:Array.from(new Uint8Array(0)),kyberPublicKey:new Uint8Array(0),wasmBinary:Buffer.from(i),inputs:{},records:this.sandboxRecords,sessionToken:"local-dev-token",isEncrypted:!1,dpConfig:a}),u=o.output,l=[{type:"text",text:JSON.stringify({computation_result:u,image_id:o.image_id,zk_receipt:o.zk_receipt,status:"Worker Pool Execution Success"})}],p=r?this.tools.get(r)?.policy:void 0,m=this.validateOutputPolicy(r||"unknown_tool",u,p);if(m)return a$1.info(`[LIOP-SDK] Output policy blocked for ${r||"unknown_tool"}: ${m}`),{content:[{type:"text",text:process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test"||process.env.LIOP_SEC_VERBOSE==="1"?m:"[LIOP] Egress Security Violation. Output blocked due to policy enforcement. Ensure your logic uses strictly aggregated, non-PII patterns."}],isError:!0};let x=await this.piiScanner.scan([{type:"text",text:typeof u=="string"?u:JSON.stringify(u)}]),T=this.violatesAggregationFirstPolicy(u,p?.enforceAggregationFirst,this.sandboxRecords?.length);if(x||T){let k=x||"Aggregation-First Policy Violation: Output blocked due to dynamic flat-key policy enforcement.";return a$1.info(`[LIOP-SDK] Secure egress blocked in local execution: ${k}`),{content:[{type:"text",text:process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test"||process.env.LIOP_SEC_VERBOSE==="1"?`[LIOP] Egress Security Violation: ${k}`:"[LIOP] Egress Security Violation. Output blocked due to policy enforcement. Ensure your logic uses strictly aggregated, non-PII patterns."}],isError:!0}}return {content:l}}catch(s){let a=s,o=process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test"||process.env.LIOP_SEC_VERBOSE==="1",u=a.message||String(s);return a$1.error(`[LIOP-SDK] WorkerPool Execution Fault: ${u}`),{content:[{type:"text",text:u.includes("worker_thread_exited")||u.includes("ERR_WORKER_OUT_OF_MEMORY")||u.includes("terminated")||u.includes("heap limit")?"[LIOP] Execution terminated: memory limit exceeded (64MB heap). Reduce data processing volume.":o?`WorkerPoolError: ${u}`:"[LIOP] Execution Failed. The injected logic violated runtime constraints or encountered a fatal error."}],isError:true}}}async close(){this.workerPool&&await this.workerPool.close({force:true}),this.rpcServer&&await this.rpcServer.stop(),this.meshNode&&await this.meshNode.stop();}};export{Ie as a,We as b,L as c,Vi as d,Ze as e,Bi as f};//# sourceMappingURL=chunk-3642NPOH.js.map
|
|
43
|
+
//# sourceMappingURL=chunk-3642NPOH.js.map
|