@telia-ace/alliance-internal-node-utilities 1.1.0 → 1.1.1-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,13 @@
1
- import{e as ne}from"./chunk-26VIM55J.js";import{a as Pe,b as Le}from"./chunk-JG7V63GM.js";var Te=Pe((ve,ge)=>{"use strict";(function(r,e,t){typeof ve=="object"?(ge.exports=t(),ge.exports.default=t()):typeof define=="function"&&define.amd?define(t):e[r]=t()})("slugify",ve,function(){var r=JSON.parse(`{"$":"dollar","%":"percent","&":"and","<":"less",">":"greater","|":"or","\xA2":"cent","\xA3":"pound","\xA4":"currency","\xA5":"yen","\xA9":"(c)","\xAA":"a","\xAE":"(r)","\xBA":"o","\xC0":"A","\xC1":"A","\xC2":"A","\xC3":"A","\xC4":"A","\xC5":"A","\xC6":"AE","\xC7":"C","\xC8":"E","\xC9":"E","\xCA":"E","\xCB":"E","\xCC":"I","\xCD":"I","\xCE":"I","\xCF":"I","\xD0":"D","\xD1":"N","\xD2":"O","\xD3":"O","\xD4":"O","\xD5":"O","\xD6":"O","\xD8":"O","\xD9":"U","\xDA":"U","\xDB":"U","\xDC":"U","\xDD":"Y","\xDE":"TH","\xDF":"ss","\xE0":"a","\xE1":"a","\xE2":"a","\xE3":"a","\xE4":"a","\xE5":"a","\xE6":"ae","\xE7":"c","\xE8":"e","\xE9":"e","\xEA":"e","\xEB":"e","\xEC":"i","\xED":"i","\xEE":"i","\xEF":"i","\xF0":"d","\xF1":"n","\xF2":"o","\xF3":"o","\xF4":"o","\xF5":"o","\xF6":"o","\xF8":"o","\xF9":"u","\xFA":"u","\xFB":"u","\xFC":"u","\xFD":"y","\xFE":"th","\xFF":"y","\u0100":"A","\u0101":"a","\u0102":"A","\u0103":"a","\u0104":"A","\u0105":"a","\u0106":"C","\u0107":"c","\u010C":"C","\u010D":"c","\u010E":"D","\u010F":"d","\u0110":"DJ","\u0111":"dj","\u0112":"E","\u0113":"e","\u0116":"E","\u0117":"e","\u0118":"e","\u0119":"e","\u011A":"E","\u011B":"e","\u011E":"G","\u011F":"g","\u0122":"G","\u0123":"g","\u0128":"I","\u0129":"i","\u012A":"i","\u012B":"i","\u012E":"I","\u012F":"i","\u0130":"I","\u0131":"i","\u0136":"k","\u0137":"k","\u013B":"L","\u013C":"l","\u013D":"L","\u013E":"l","\u0141":"L","\u0142":"l","\u0143":"N","\u0144":"n","\u0145":"N","\u0146":"n","\u0147":"N","\u0148":"n","\u014C":"O","\u014D":"o","\u0150":"O","\u0151":"o","\u0152":"OE","\u0153":"oe","\u0154":"R","\u0155":"r","\u0158":"R","\u0159":"r","\u015A":"S","\u015B":"s","\u015E":"S","\u015F":"s","\u0160":"S","\u0161":"s","\u0162":"T","\u0163":"t","\u0164":"T","\u0165":"t","\u0168":"U","\u0169":"u","\u016A":"u","\u016B":"u","\u016E":"U","\u016F":"u","\u0170":"U","\u0171":"u","\u0172":"U","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017A":"z","\u017B":"Z","\u017C":"z","\u017D":"Z","\u017E":"z","\u018F":"E","\u0192":"f","\u01A0":"O","\u01A1":"o","\u01AF":"U","\u01B0":"u","\u01C8":"LJ","\u01C9":"lj","\u01CB":"NJ","\u01CC":"nj","\u0218":"S","\u0219":"s","\u021A":"T","\u021B":"t","\u0259":"e","\u02DA":"o","\u0386":"A","\u0388":"E","\u0389":"H","\u038A":"I","\u038C":"O","\u038E":"Y","\u038F":"W","\u0390":"i","\u0391":"A","\u0392":"B","\u0393":"G","\u0394":"D","\u0395":"E","\u0396":"Z","\u0397":"H","\u0398":"8","\u0399":"I","\u039A":"K","\u039B":"L","\u039C":"M","\u039D":"N","\u039E":"3","\u039F":"O","\u03A0":"P","\u03A1":"R","\u03A3":"S","\u03A4":"T","\u03A5":"Y","\u03A6":"F","\u03A7":"X","\u03A8":"PS","\u03A9":"W","\u03AA":"I","\u03AB":"Y","\u03AC":"a","\u03AD":"e","\u03AE":"h","\u03AF":"i","\u03B0":"y","\u03B1":"a","\u03B2":"b","\u03B3":"g","\u03B4":"d","\u03B5":"e","\u03B6":"z","\u03B7":"h","\u03B8":"8","\u03B9":"i","\u03BA":"k","\u03BB":"l","\u03BC":"m","\u03BD":"n","\u03BE":"3","\u03BF":"o","\u03C0":"p","\u03C1":"r","\u03C2":"s","\u03C3":"s","\u03C4":"t","\u03C5":"y","\u03C6":"f","\u03C7":"x","\u03C8":"ps","\u03C9":"w","\u03CA":"i","\u03CB":"y","\u03CC":"o","\u03CD":"y","\u03CE":"w","\u0401":"Yo","\u0402":"DJ","\u0404":"Ye","\u0406":"I","\u0407":"Yi","\u0408":"J","\u0409":"LJ","\u040A":"NJ","\u040B":"C","\u040F":"DZ","\u0410":"A","\u0411":"B","\u0412":"V","\u0413":"G","\u0414":"D","\u0415":"E","\u0416":"Zh","\u0417":"Z","\u0418":"I","\u0419":"J","\u041A":"K","\u041B":"L","\u041C":"M","\u041D":"N","\u041E":"O","\u041F":"P","\u0420":"R","\u0421":"S","\u0422":"T","\u0423":"U","\u0424":"F","\u0425":"H","\u0426":"C","\u0427":"Ch","\u0428":"Sh","\u0429":"Sh","\u042A":"U","\u042B":"Y","\u042C":"","\u042D":"E","\u042E":"Yu","\u042F":"Ya","\u0430":"a","\u0431":"b","\u0432":"v","\u0433":"g","\u0434":"d","\u0435":"e","\u0436":"zh","\u0437":"z","\u0438":"i","\u0439":"j","\u043A":"k","\u043B":"l","\u043C":"m","\u043D":"n","\u043E":"o","\u043F":"p","\u0440":"r","\u0441":"s","\u0442":"t","\u0443":"u","\u0444":"f","\u0445":"h","\u0446":"c","\u0447":"ch","\u0448":"sh","\u0449":"sh","\u044A":"u","\u044B":"y","\u044C":"","\u044D":"e","\u044E":"yu","\u044F":"ya","\u0451":"yo","\u0452":"dj","\u0454":"ye","\u0456":"i","\u0457":"yi","\u0458":"j","\u0459":"lj","\u045A":"nj","\u045B":"c","\u045D":"u","\u045F":"dz","\u0490":"G","\u0491":"g","\u0492":"GH","\u0493":"gh","\u049A":"KH","\u049B":"kh","\u04A2":"NG","\u04A3":"ng","\u04AE":"UE","\u04AF":"ue","\u04B0":"U","\u04B1":"u","\u04BA":"H","\u04BB":"h","\u04D8":"AE","\u04D9":"ae","\u04E8":"OE","\u04E9":"oe","\u0531":"A","\u0532":"B","\u0533":"G","\u0534":"D","\u0535":"E","\u0536":"Z","\u0537":"E'","\u0538":"Y'","\u0539":"T'","\u053A":"JH","\u053B":"I","\u053C":"L","\u053D":"X","\u053E":"C'","\u053F":"K","\u0540":"H","\u0541":"D'","\u0542":"GH","\u0543":"TW","\u0544":"M","\u0545":"Y","\u0546":"N","\u0547":"SH","\u0549":"CH","\u054A":"P","\u054B":"J","\u054C":"R'","\u054D":"S","\u054E":"V","\u054F":"T","\u0550":"R","\u0551":"C","\u0553":"P'","\u0554":"Q'","\u0555":"O''","\u0556":"F","\u0587":"EV","\u0621":"a","\u0622":"aa","\u0623":"a","\u0624":"u","\u0625":"i","\u0626":"e","\u0627":"a","\u0628":"b","\u0629":"h","\u062A":"t","\u062B":"th","\u062C":"j","\u062D":"h","\u062E":"kh","\u062F":"d","\u0630":"th","\u0631":"r","\u0632":"z","\u0633":"s","\u0634":"sh","\u0635":"s","\u0636":"dh","\u0637":"t","\u0638":"z","\u0639":"a","\u063A":"gh","\u0641":"f","\u0642":"q","\u0643":"k","\u0644":"l","\u0645":"m","\u0646":"n","\u0647":"h","\u0648":"w","\u0649":"a","\u064A":"y","\u064B":"an","\u064C":"on","\u064D":"en","\u064E":"a","\u064F":"u","\u0650":"e","\u0652":"","\u0660":"0","\u0661":"1","\u0662":"2","\u0663":"3","\u0664":"4","\u0665":"5","\u0666":"6","\u0667":"7","\u0668":"8","\u0669":"9","\u067E":"p","\u0686":"ch","\u0698":"zh","\u06A9":"k","\u06AF":"g","\u06CC":"y","\u06F0":"0","\u06F1":"1","\u06F2":"2","\u06F3":"3","\u06F4":"4","\u06F5":"5","\u06F6":"6","\u06F7":"7","\u06F8":"8","\u06F9":"9","\u0E3F":"baht","\u10D0":"a","\u10D1":"b","\u10D2":"g","\u10D3":"d","\u10D4":"e","\u10D5":"v","\u10D6":"z","\u10D7":"t","\u10D8":"i","\u10D9":"k","\u10DA":"l","\u10DB":"m","\u10DC":"n","\u10DD":"o","\u10DE":"p","\u10DF":"zh","\u10E0":"r","\u10E1":"s","\u10E2":"t","\u10E3":"u","\u10E4":"f","\u10E5":"k","\u10E6":"gh","\u10E7":"q","\u10E8":"sh","\u10E9":"ch","\u10EA":"ts","\u10EB":"dz","\u10EC":"ts","\u10ED":"ch","\u10EE":"kh","\u10EF":"j","\u10F0":"h","\u1E62":"S","\u1E63":"s","\u1E80":"W","\u1E81":"w","\u1E82":"W","\u1E83":"w","\u1E84":"W","\u1E85":"w","\u1E9E":"SS","\u1EA0":"A","\u1EA1":"a","\u1EA2":"A","\u1EA3":"a","\u1EA4":"A","\u1EA5":"a","\u1EA6":"A","\u1EA7":"a","\u1EA8":"A","\u1EA9":"a","\u1EAA":"A","\u1EAB":"a","\u1EAC":"A","\u1EAD":"a","\u1EAE":"A","\u1EAF":"a","\u1EB0":"A","\u1EB1":"a","\u1EB2":"A","\u1EB3":"a","\u1EB4":"A","\u1EB5":"a","\u1EB6":"A","\u1EB7":"a","\u1EB8":"E","\u1EB9":"e","\u1EBA":"E","\u1EBB":"e","\u1EBC":"E","\u1EBD":"e","\u1EBE":"E","\u1EBF":"e","\u1EC0":"E","\u1EC1":"e","\u1EC2":"E","\u1EC3":"e","\u1EC4":"E","\u1EC5":"e","\u1EC6":"E","\u1EC7":"e","\u1EC8":"I","\u1EC9":"i","\u1ECA":"I","\u1ECB":"i","\u1ECC":"O","\u1ECD":"o","\u1ECE":"O","\u1ECF":"o","\u1ED0":"O","\u1ED1":"o","\u1ED2":"O","\u1ED3":"o","\u1ED4":"O","\u1ED5":"o","\u1ED6":"O","\u1ED7":"o","\u1ED8":"O","\u1ED9":"o","\u1EDA":"O","\u1EDB":"o","\u1EDC":"O","\u1EDD":"o","\u1EDE":"O","\u1EDF":"o","\u1EE0":"O","\u1EE1":"o","\u1EE2":"O","\u1EE3":"o","\u1EE4":"U","\u1EE5":"u","\u1EE6":"U","\u1EE7":"u","\u1EE8":"U","\u1EE9":"u","\u1EEA":"U","\u1EEB":"u","\u1EEC":"U","\u1EED":"u","\u1EEE":"U","\u1EEF":"u","\u1EF0":"U","\u1EF1":"u","\u1EF2":"Y","\u1EF3":"y","\u1EF4":"Y","\u1EF5":"y","\u1EF6":"Y","\u1EF7":"y","\u1EF8":"Y","\u1EF9":"y","\u2013":"-","\u2018":"'","\u2019":"'","\u201C":"\\"","\u201D":"\\"","\u201E":"\\"","\u2020":"+","\u2022":"*","\u2026":"...","\u20A0":"ecu","\u20A2":"cruzeiro","\u20A3":"french franc","\u20A4":"lira","\u20A5":"mill","\u20A6":"naira","\u20A7":"peseta","\u20A8":"rupee","\u20A9":"won","\u20AA":"new shequel","\u20AB":"dong","\u20AC":"euro","\u20AD":"kip","\u20AE":"tugrik","\u20AF":"drachma","\u20B0":"penny","\u20B1":"peso","\u20B2":"guarani","\u20B3":"austral","\u20B4":"hryvnia","\u20B5":"cedi","\u20B8":"kazakhstani tenge","\u20B9":"indian rupee","\u20BA":"turkish lira","\u20BD":"russian ruble","\u20BF":"bitcoin","\u2120":"sm","\u2122":"tm","\u2202":"d","\u2206":"delta","\u2211":"sum","\u221E":"infinity","\u2665":"love","\u5143":"yuan","\u5186":"yen","\uFDFC":"rial","\uFEF5":"laa","\uFEF7":"laa","\uFEF9":"lai","\uFEFB":"la"}`),e=JSON.parse('{"bg":{"\u0419":"Y","\u0426":"Ts","\u0429":"Sht","\u042A":"A","\u042C":"Y","\u0439":"y","\u0446":"ts","\u0449":"sht","\u044A":"a","\u044C":"y"},"de":{"\xC4":"AE","\xE4":"ae","\xD6":"OE","\xF6":"oe","\xDC":"UE","\xFC":"ue","\xDF":"ss","%":"prozent","&":"und","|":"oder","\u2211":"summe","\u221E":"unendlich","\u2665":"liebe"},"es":{"%":"por ciento","&":"y","<":"menor que",">":"mayor que","|":"o","\xA2":"centavos","\xA3":"libras","\xA4":"moneda","\u20A3":"francos","\u2211":"suma","\u221E":"infinito","\u2665":"amor"},"fr":{"%":"pourcent","&":"et","<":"plus petit",">":"plus grand","|":"ou","\xA2":"centime","\xA3":"livre","\xA4":"devise","\u20A3":"franc","\u2211":"somme","\u221E":"infini","\u2665":"amour"},"pt":{"%":"porcento","&":"e","<":"menor",">":"maior","|":"ou","\xA2":"centavo","\u2211":"soma","\xA3":"libra","\u221E":"infinito","\u2665":"amor"},"uk":{"\u0418":"Y","\u0438":"y","\u0419":"Y","\u0439":"y","\u0426":"Ts","\u0446":"ts","\u0425":"Kh","\u0445":"kh","\u0429":"Shch","\u0449":"shch","\u0413":"H","\u0433":"h"},"vi":{"\u0110":"D","\u0111":"d"},"da":{"\xD8":"OE","\xF8":"oe","\xC5":"AA","\xE5":"aa","%":"procent","&":"og","|":"eller","$":"dollar","<":"mindre end",">":"st\xF8rre end"},"nb":{"&":"og","\xC5":"AA","\xC6":"AE","\xD8":"OE","\xE5":"aa","\xE6":"ae","\xF8":"oe"},"it":{"&":"e"},"nl":{"&":"en"},"sv":{"&":"och","\xC5":"AA","\xC4":"AE","\xD6":"OE","\xE5":"aa","\xE4":"ae","\xF6":"oe"}}');function t(s,n){if(typeof s!="string")throw new Error("slugify: string argument expected");n=typeof n=="string"?{replacement:n}:n||{};var a=e[n.locale]||{},i=n.replacement===void 0?"-":n.replacement,o=n.trim===void 0?!0:n.trim,u=s.normalize().split("").reduce(function(d,g){var x=a[g];return x===void 0&&(x=r[g]),x===void 0&&(x=g),x===i&&(x=" "),d+x.replace(n.remove||/[^\w\s$*_+~.()'"!\-:@]+/g,"")},"");return n.strict&&(u=u.replace(/[^A-Za-z0-9\s]/g,"")),o&&(u=u.trim()),u=u.replace(/\s+/g,i),n.lower&&(u=u.toLowerCase()),u}return t.extend=function(s){Object.assign(r,s)},t})});var Oe=Le(Te(),1);function Se(r,e="-"){return(0,Oe.default)(r,{strict:!0,replacement:e,lower:!0})}import{existsSync as ze,rmSync as Ue,writeFileSync as De}from"node:fs";import{resolve as Be}from"node:path";function er(r){let e=Be(process.cwd(),"index.html");ze(e)&&Ue(e,{force:!0});let t=qe(r);return De(e,t),e}function Ye(r){return r.reduce((e,{appImport:t,manifestImport:s},n)=>{let a=t+`
1
+ import{e as ne}from"./chunk-26VIM55J.js";import{a as ze,b as De}from"./chunk-JG7V63GM.js";var Te=ze((ve,ge)=>{"use strict";(function(r,e,t){typeof ve=="object"?(ge.exports=t(),ge.exports.default=t()):typeof define=="function"&&define.amd?define(t):e[r]=t()})("slugify",ve,function(){var r=JSON.parse(`{"$":"dollar","%":"percent","&":"and","<":"less",">":"greater","|":"or","\xA2":"cent","\xA3":"pound","\xA4":"currency","\xA5":"yen","\xA9":"(c)","\xAA":"a","\xAE":"(r)","\xBA":"o","\xC0":"A","\xC1":"A","\xC2":"A","\xC3":"A","\xC4":"A","\xC5":"A","\xC6":"AE","\xC7":"C","\xC8":"E","\xC9":"E","\xCA":"E","\xCB":"E","\xCC":"I","\xCD":"I","\xCE":"I","\xCF":"I","\xD0":"D","\xD1":"N","\xD2":"O","\xD3":"O","\xD4":"O","\xD5":"O","\xD6":"O","\xD8":"O","\xD9":"U","\xDA":"U","\xDB":"U","\xDC":"U","\xDD":"Y","\xDE":"TH","\xDF":"ss","\xE0":"a","\xE1":"a","\xE2":"a","\xE3":"a","\xE4":"a","\xE5":"a","\xE6":"ae","\xE7":"c","\xE8":"e","\xE9":"e","\xEA":"e","\xEB":"e","\xEC":"i","\xED":"i","\xEE":"i","\xEF":"i","\xF0":"d","\xF1":"n","\xF2":"o","\xF3":"o","\xF4":"o","\xF5":"o","\xF6":"o","\xF8":"o","\xF9":"u","\xFA":"u","\xFB":"u","\xFC":"u","\xFD":"y","\xFE":"th","\xFF":"y","\u0100":"A","\u0101":"a","\u0102":"A","\u0103":"a","\u0104":"A","\u0105":"a","\u0106":"C","\u0107":"c","\u010C":"C","\u010D":"c","\u010E":"D","\u010F":"d","\u0110":"DJ","\u0111":"dj","\u0112":"E","\u0113":"e","\u0116":"E","\u0117":"e","\u0118":"e","\u0119":"e","\u011A":"E","\u011B":"e","\u011E":"G","\u011F":"g","\u0122":"G","\u0123":"g","\u0128":"I","\u0129":"i","\u012A":"i","\u012B":"i","\u012E":"I","\u012F":"i","\u0130":"I","\u0131":"i","\u0136":"k","\u0137":"k","\u013B":"L","\u013C":"l","\u013D":"L","\u013E":"l","\u0141":"L","\u0142":"l","\u0143":"N","\u0144":"n","\u0145":"N","\u0146":"n","\u0147":"N","\u0148":"n","\u014C":"O","\u014D":"o","\u0150":"O","\u0151":"o","\u0152":"OE","\u0153":"oe","\u0154":"R","\u0155":"r","\u0158":"R","\u0159":"r","\u015A":"S","\u015B":"s","\u015E":"S","\u015F":"s","\u0160":"S","\u0161":"s","\u0162":"T","\u0163":"t","\u0164":"T","\u0165":"t","\u0168":"U","\u0169":"u","\u016A":"u","\u016B":"u","\u016E":"U","\u016F":"u","\u0170":"U","\u0171":"u","\u0172":"U","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017A":"z","\u017B":"Z","\u017C":"z","\u017D":"Z","\u017E":"z","\u018F":"E","\u0192":"f","\u01A0":"O","\u01A1":"o","\u01AF":"U","\u01B0":"u","\u01C8":"LJ","\u01C9":"lj","\u01CB":"NJ","\u01CC":"nj","\u0218":"S","\u0219":"s","\u021A":"T","\u021B":"t","\u0259":"e","\u02DA":"o","\u0386":"A","\u0388":"E","\u0389":"H","\u038A":"I","\u038C":"O","\u038E":"Y","\u038F":"W","\u0390":"i","\u0391":"A","\u0392":"B","\u0393":"G","\u0394":"D","\u0395":"E","\u0396":"Z","\u0397":"H","\u0398":"8","\u0399":"I","\u039A":"K","\u039B":"L","\u039C":"M","\u039D":"N","\u039E":"3","\u039F":"O","\u03A0":"P","\u03A1":"R","\u03A3":"S","\u03A4":"T","\u03A5":"Y","\u03A6":"F","\u03A7":"X","\u03A8":"PS","\u03A9":"W","\u03AA":"I","\u03AB":"Y","\u03AC":"a","\u03AD":"e","\u03AE":"h","\u03AF":"i","\u03B0":"y","\u03B1":"a","\u03B2":"b","\u03B3":"g","\u03B4":"d","\u03B5":"e","\u03B6":"z","\u03B7":"h","\u03B8":"8","\u03B9":"i","\u03BA":"k","\u03BB":"l","\u03BC":"m","\u03BD":"n","\u03BE":"3","\u03BF":"o","\u03C0":"p","\u03C1":"r","\u03C2":"s","\u03C3":"s","\u03C4":"t","\u03C5":"y","\u03C6":"f","\u03C7":"x","\u03C8":"ps","\u03C9":"w","\u03CA":"i","\u03CB":"y","\u03CC":"o","\u03CD":"y","\u03CE":"w","\u0401":"Yo","\u0402":"DJ","\u0404":"Ye","\u0406":"I","\u0407":"Yi","\u0408":"J","\u0409":"LJ","\u040A":"NJ","\u040B":"C","\u040F":"DZ","\u0410":"A","\u0411":"B","\u0412":"V","\u0413":"G","\u0414":"D","\u0415":"E","\u0416":"Zh","\u0417":"Z","\u0418":"I","\u0419":"J","\u041A":"K","\u041B":"L","\u041C":"M","\u041D":"N","\u041E":"O","\u041F":"P","\u0420":"R","\u0421":"S","\u0422":"T","\u0423":"U","\u0424":"F","\u0425":"H","\u0426":"C","\u0427":"Ch","\u0428":"Sh","\u0429":"Sh","\u042A":"U","\u042B":"Y","\u042C":"","\u042D":"E","\u042E":"Yu","\u042F":"Ya","\u0430":"a","\u0431":"b","\u0432":"v","\u0433":"g","\u0434":"d","\u0435":"e","\u0436":"zh","\u0437":"z","\u0438":"i","\u0439":"j","\u043A":"k","\u043B":"l","\u043C":"m","\u043D":"n","\u043E":"o","\u043F":"p","\u0440":"r","\u0441":"s","\u0442":"t","\u0443":"u","\u0444":"f","\u0445":"h","\u0446":"c","\u0447":"ch","\u0448":"sh","\u0449":"sh","\u044A":"u","\u044B":"y","\u044C":"","\u044D":"e","\u044E":"yu","\u044F":"ya","\u0451":"yo","\u0452":"dj","\u0454":"ye","\u0456":"i","\u0457":"yi","\u0458":"j","\u0459":"lj","\u045A":"nj","\u045B":"c","\u045D":"u","\u045F":"dz","\u0490":"G","\u0491":"g","\u0492":"GH","\u0493":"gh","\u049A":"KH","\u049B":"kh","\u04A2":"NG","\u04A3":"ng","\u04AE":"UE","\u04AF":"ue","\u04B0":"U","\u04B1":"u","\u04BA":"H","\u04BB":"h","\u04D8":"AE","\u04D9":"ae","\u04E8":"OE","\u04E9":"oe","\u0531":"A","\u0532":"B","\u0533":"G","\u0534":"D","\u0535":"E","\u0536":"Z","\u0537":"E'","\u0538":"Y'","\u0539":"T'","\u053A":"JH","\u053B":"I","\u053C":"L","\u053D":"X","\u053E":"C'","\u053F":"K","\u0540":"H","\u0541":"D'","\u0542":"GH","\u0543":"TW","\u0544":"M","\u0545":"Y","\u0546":"N","\u0547":"SH","\u0549":"CH","\u054A":"P","\u054B":"J","\u054C":"R'","\u054D":"S","\u054E":"V","\u054F":"T","\u0550":"R","\u0551":"C","\u0553":"P'","\u0554":"Q'","\u0555":"O''","\u0556":"F","\u0587":"EV","\u0621":"a","\u0622":"aa","\u0623":"a","\u0624":"u","\u0625":"i","\u0626":"e","\u0627":"a","\u0628":"b","\u0629":"h","\u062A":"t","\u062B":"th","\u062C":"j","\u062D":"h","\u062E":"kh","\u062F":"d","\u0630":"th","\u0631":"r","\u0632":"z","\u0633":"s","\u0634":"sh","\u0635":"s","\u0636":"dh","\u0637":"t","\u0638":"z","\u0639":"a","\u063A":"gh","\u0641":"f","\u0642":"q","\u0643":"k","\u0644":"l","\u0645":"m","\u0646":"n","\u0647":"h","\u0648":"w","\u0649":"a","\u064A":"y","\u064B":"an","\u064C":"on","\u064D":"en","\u064E":"a","\u064F":"u","\u0650":"e","\u0652":"","\u0660":"0","\u0661":"1","\u0662":"2","\u0663":"3","\u0664":"4","\u0665":"5","\u0666":"6","\u0667":"7","\u0668":"8","\u0669":"9","\u067E":"p","\u0686":"ch","\u0698":"zh","\u06A9":"k","\u06AF":"g","\u06CC":"y","\u06F0":"0","\u06F1":"1","\u06F2":"2","\u06F3":"3","\u06F4":"4","\u06F5":"5","\u06F6":"6","\u06F7":"7","\u06F8":"8","\u06F9":"9","\u0E3F":"baht","\u10D0":"a","\u10D1":"b","\u10D2":"g","\u10D3":"d","\u10D4":"e","\u10D5":"v","\u10D6":"z","\u10D7":"t","\u10D8":"i","\u10D9":"k","\u10DA":"l","\u10DB":"m","\u10DC":"n","\u10DD":"o","\u10DE":"p","\u10DF":"zh","\u10E0":"r","\u10E1":"s","\u10E2":"t","\u10E3":"u","\u10E4":"f","\u10E5":"k","\u10E6":"gh","\u10E7":"q","\u10E8":"sh","\u10E9":"ch","\u10EA":"ts","\u10EB":"dz","\u10EC":"ts","\u10ED":"ch","\u10EE":"kh","\u10EF":"j","\u10F0":"h","\u1E62":"S","\u1E63":"s","\u1E80":"W","\u1E81":"w","\u1E82":"W","\u1E83":"w","\u1E84":"W","\u1E85":"w","\u1E9E":"SS","\u1EA0":"A","\u1EA1":"a","\u1EA2":"A","\u1EA3":"a","\u1EA4":"A","\u1EA5":"a","\u1EA6":"A","\u1EA7":"a","\u1EA8":"A","\u1EA9":"a","\u1EAA":"A","\u1EAB":"a","\u1EAC":"A","\u1EAD":"a","\u1EAE":"A","\u1EAF":"a","\u1EB0":"A","\u1EB1":"a","\u1EB2":"A","\u1EB3":"a","\u1EB4":"A","\u1EB5":"a","\u1EB6":"A","\u1EB7":"a","\u1EB8":"E","\u1EB9":"e","\u1EBA":"E","\u1EBB":"e","\u1EBC":"E","\u1EBD":"e","\u1EBE":"E","\u1EBF":"e","\u1EC0":"E","\u1EC1":"e","\u1EC2":"E","\u1EC3":"e","\u1EC4":"E","\u1EC5":"e","\u1EC6":"E","\u1EC7":"e","\u1EC8":"I","\u1EC9":"i","\u1ECA":"I","\u1ECB":"i","\u1ECC":"O","\u1ECD":"o","\u1ECE":"O","\u1ECF":"o","\u1ED0":"O","\u1ED1":"o","\u1ED2":"O","\u1ED3":"o","\u1ED4":"O","\u1ED5":"o","\u1ED6":"O","\u1ED7":"o","\u1ED8":"O","\u1ED9":"o","\u1EDA":"O","\u1EDB":"o","\u1EDC":"O","\u1EDD":"o","\u1EDE":"O","\u1EDF":"o","\u1EE0":"O","\u1EE1":"o","\u1EE2":"O","\u1EE3":"o","\u1EE4":"U","\u1EE5":"u","\u1EE6":"U","\u1EE7":"u","\u1EE8":"U","\u1EE9":"u","\u1EEA":"U","\u1EEB":"u","\u1EEC":"U","\u1EED":"u","\u1EEE":"U","\u1EEF":"u","\u1EF0":"U","\u1EF1":"u","\u1EF2":"Y","\u1EF3":"y","\u1EF4":"Y","\u1EF5":"y","\u1EF6":"Y","\u1EF7":"y","\u1EF8":"Y","\u1EF9":"y","\u2013":"-","\u2018":"'","\u2019":"'","\u201C":"\\"","\u201D":"\\"","\u201E":"\\"","\u2020":"+","\u2022":"*","\u2026":"...","\u20A0":"ecu","\u20A2":"cruzeiro","\u20A3":"french franc","\u20A4":"lira","\u20A5":"mill","\u20A6":"naira","\u20A7":"peseta","\u20A8":"rupee","\u20A9":"won","\u20AA":"new shequel","\u20AB":"dong","\u20AC":"euro","\u20AD":"kip","\u20AE":"tugrik","\u20AF":"drachma","\u20B0":"penny","\u20B1":"peso","\u20B2":"guarani","\u20B3":"austral","\u20B4":"hryvnia","\u20B5":"cedi","\u20B8":"kazakhstani tenge","\u20B9":"indian rupee","\u20BA":"turkish lira","\u20BD":"russian ruble","\u20BF":"bitcoin","\u2120":"sm","\u2122":"tm","\u2202":"d","\u2206":"delta","\u2211":"sum","\u221E":"infinity","\u2665":"love","\u5143":"yuan","\u5186":"yen","\uFDFC":"rial","\uFEF5":"laa","\uFEF7":"laa","\uFEF9":"lai","\uFEFB":"la"}`),e=JSON.parse('{"bg":{"\u0419":"Y","\u0426":"Ts","\u0429":"Sht","\u042A":"A","\u042C":"Y","\u0439":"y","\u0446":"ts","\u0449":"sht","\u044A":"a","\u044C":"y"},"de":{"\xC4":"AE","\xE4":"ae","\xD6":"OE","\xF6":"oe","\xDC":"UE","\xFC":"ue","\xDF":"ss","%":"prozent","&":"und","|":"oder","\u2211":"summe","\u221E":"unendlich","\u2665":"liebe"},"es":{"%":"por ciento","&":"y","<":"menor que",">":"mayor que","|":"o","\xA2":"centavos","\xA3":"libras","\xA4":"moneda","\u20A3":"francos","\u2211":"suma","\u221E":"infinito","\u2665":"amor"},"fr":{"%":"pourcent","&":"et","<":"plus petit",">":"plus grand","|":"ou","\xA2":"centime","\xA3":"livre","\xA4":"devise","\u20A3":"franc","\u2211":"somme","\u221E":"infini","\u2665":"amour"},"pt":{"%":"porcento","&":"e","<":"menor",">":"maior","|":"ou","\xA2":"centavo","\u2211":"soma","\xA3":"libra","\u221E":"infinito","\u2665":"amor"},"uk":{"\u0418":"Y","\u0438":"y","\u0419":"Y","\u0439":"y","\u0426":"Ts","\u0446":"ts","\u0425":"Kh","\u0445":"kh","\u0429":"Shch","\u0449":"shch","\u0413":"H","\u0433":"h"},"vi":{"\u0110":"D","\u0111":"d"},"da":{"\xD8":"OE","\xF8":"oe","\xC5":"AA","\xE5":"aa","%":"procent","&":"og","|":"eller","$":"dollar","<":"mindre end",">":"st\xF8rre end"},"nb":{"&":"og","\xC5":"AA","\xC6":"AE","\xD8":"OE","\xE5":"aa","\xE6":"ae","\xF8":"oe"},"it":{"&":"e"},"nl":{"&":"en"},"sv":{"&":"och","\xC5":"AA","\xC4":"AE","\xD6":"OE","\xE5":"aa","\xE4":"ae","\xF6":"oe"}}');function t(s,n){if(typeof s!="string")throw new Error("slugify: string argument expected");n=typeof n=="string"?{replacement:n}:n||{};var a=e[n.locale]||{},i=n.replacement===void 0?"-":n.replacement,o=n.trim===void 0?!0:n.trim,u=s.normalize().split("").reduce(function(d,g){var x=a[g];return x===void 0&&(x=r[g]),x===void 0&&(x=g),x===i&&(x=" "),d+x.replace(n.remove||/[^\w\s$*_+~.()'"!\-:@]+/g,"")},"");return n.strict&&(u=u.replace(/[^A-Za-z0-9\s]/g,"")),o&&(u=u.trim()),u=u.replace(/\s+/g,i),n.lower&&(u=u.toLowerCase()),u}return t.extend=function(s){Object.assign(r,s)},t})});var Ae=De(Te(),1);function Ee(r,e="-"){return(0,Ae.default)(r,{strict:!0,replacement:e,lower:!0})}import{existsSync as Ue,rmSync as $e,writeFileSync as Le}from"node:fs";import{resolve as Be}from"node:path";function er(r){let e=Be(process.cwd(),"index.html");Ue(e)&&$e(e,{force:!0});let t=He(r);return Le(e,t),e}function qe(r){return r.reduce((e,{appImport:t,manifestImport:s},n)=>{let a=t+`
2
2
  `+s;return n===0?a:e+`
3
- `+a},"")}function We(r){return"const apps = ["+r.reduce((t,{appVariableName:s,manifestVariableName:n})=>{let a=`{ app: ${s}, manifest: ${n} },`;return t+`
3
+ `+a},"")}function Ye(r){return"const apps = ["+r.reduce((t,{appVariableName:s,manifestVariableName:n})=>{let a=`{ app: ${s}, manifest: ${n} },`;return t+`
4
4
  `+a},"")+`
5
- ];`}function qe(r){let e=r.map(({packageName:n,appImportPath:a,manifestImportPath:i})=>{let o=Se(n,""),u=`${o}App`,d=`${o}Manifest`;return{packageName:n,appVariableName:u,manifestVariableName:d,appImport:`import ${u} from '${Ee(a)}';`,manifestImport:`import ${d} from '${Ee(i)}';`}}),t=Ye(e),s=We(e);return Je.replaceAll("$imports;",t).replaceAll("$apps;",s)}var Je=`
5
+ ];`}function He(r){let e=r.map(({packageName:n,appImportPath:a,manifestImportPath:i})=>{let o=Ee(n,""),u=`${o}App`,d=`${o}Manifest`;return{packageName:n,appVariableName:u,manifestVariableName:d,appImport:`import ${u} from '${Se(a)}';`,manifestImport:`import ${d} from '${Se(i)}';`}}),t=qe(e),s=Ye(e);return Je.replaceAll("$imports;",t).replaceAll("$apps;",s)}var Je=`
6
6
  <!doctype html>
7
7
  <html lang="en">
8
8
  <head>
9
9
  <meta charset="UTF-8" />
10
- <link rel="icon" type="image/svg+xml" href="favicon.svg" />
10
+ <link rel="icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAGcElEQVRYha2Xe4xUVx3HP7/fPTOzDLO7sw8RlzWlZEtp2dCy0qIVWltKU/UPDZH6ijXWEK2odPcPa2qbhpi2kSa7blSStsFUjNq0lWCMaVMx8rAm22IJMJRHCqFC6BJ22eEx+5p7z88/7sywC7uwgCe5mXsz5/y+j/M753eOcJ2tK5sDyBrME2gBmkBq43/tnMERgXdAjrbn518yXq4RNA3cB/J54HNiMhfEicm4oAYghmHexN4Dew5k01giUybQlc1h0CbI9zC+Imi9mCAIYhoHsnI4KcNjYoDhxWPxsxFY1Z5vHQVwVwSu3Qdid4E8rSb3i6mqKYwBjpWX1V/QZBiYYWIIiifCw8Mm/vS7L/W237FqJno58M5srgmxP4npjsAHDwTeaeAdagGBdwQWoBYgFqCmqGlMqvTE3+U+ipbeE+ngB42Lde6kDnRmcwisAHlBfdBYCYxStp3y7xjTJ51RA0XxgGCkasQFSfkW8NQlBDqzORVYK6ZPqAU6ThUyqd0TN7mQDRZ/CULzvVVeRO68xIGubE6BbjH9oVqA+thaQccpvjLwRDTit2RG/fxVGR3sLc4ELuRAV90+gJ/G4K4EHpRs1wr7qwW/uH36uaxPzwz0xNZhHUfAzJZgsjZWrqXEiTP9WlRP1Bb+pCacs2KaCwvmD/5+cLhCoCubU0G61QJXyWYkVv9/Av/UEzVh2+PVDmDPr875ob4oD6UcMLhfTdqU8dket+sDD6rwS7vrfMs30i4qRhzfMhwe3FhwQG+FgMDKytIyKe1o1zffZlB3swvve7mehgVJZ95zatdouG31gHpvoHYUwHVmc4AsqoCXYK9HtzhYsDoTLnqyRl1a1QxOvjMavrmyT4sFr6hhsA/AZUbqKKTy9ZfCXhuFpntS4WfWZWloTcTTa8bh14fCrY/2a3E4UlOLt2jYCeCGE+cBBuPhdk2gZjDjjmS46KkampelnEhMPhwy3/PkGb/vhXPO4zGJ60KyTo5nPpk8wg5wPz57M13Z3PuGzRtTxEovV3BBoXlZKrytvZqmpSknKhVCJ3tGwu2rBxjYHzrEymUZw9Py0LQtD6yb7aG8CoR/mNgKs1LHEomJ4M2M9McDf9PX0n7eI9OpbXEVxQCFE5F/d+0Zf+iPgy7e/GPDjVj9rGXJcO7D6b+yLu7vABavrd10/O8jz5/cFqXNFBGr1HYzQ0SoviEIm5dXceOXpvGJpSkNEjJuGy+ciPzu7nN+/4aCRkM2vsaUrM/coH7ed9Ond3WffbPyF8CxQ/1Y5F8b/C9fHthlFPvFB05JNzqtvSnBxxYmmN4UVCwe60b/7mK4d/15Dr82qH50fHkva/fiSc00v/SlGr97fX79ytdb1owjAHDwX71tVbWuJ9OQdMl0gmTKESQUVWGsxQDD/ZE/snnIH/xdgVP/KU5yqCnBi2f6bPF3b6jxe17Mhx9sKizsyLceKPeqDP7bF/rfa2xLvHrLN6sfmr08o0GDqAaCIYRD3g/sD/1Hb49w7K1hev89otEoTi6To+V5n3l3Mryru1r3vpjn8KbCZjU5MLbfuBCd2VyzIHsTgauZ3pAkkXIanScc6Tf1RfRiJyYHN4Iq/O2PZ/zc71Rpz89P+30bz4QmdltHvvXQpARKJB5R0w0XSvL4cjwV+FnLU+HiZ2tUpxtbf9Tnj20vOJPo2fZ8688u7n3pmdB42Yt/xUuESVQ+yVJexZNtVmbQ2JYIH9zcGC5/pd71Hxjxm5f1cnzboDPx7xs8M9G4CSV1ZnOZICE7GNXbKweTMU7EA6USoemeVLhgTYame1Nu4MBI2PN0ng+3DDovIZFG5w37bEe+dc+UCQC8/ZtjzX07i/88saU4J8yLXiAhaCC+fn7Sz/7iNFq+mqZ6TuD6do+Gu7vPcuQvBRf62LlIQ2/Y1zvyra9OhnPZSf1g58k5I6ftDSnqnNFTaOACqmclfP0tSa3KBjrc5/2Hbwz7Q38ocHLniDM8XjxeIrxG3rA16vXXj529dVKMK2bVL2fkmhrmJ/9cPy91Z2ZGwhMqQx95TudC8gdCZx4obbMVAhqNGvaoCr99bKD1svGntK4647vg84J8X021PBXlK5gJGJWr11GDb3fkW7dPJfaUi3539iARxSUCz4AsERMVpHwDxMTyhq0HftGRbz071bhXfeooXVJvBR4EbgSGgR6Bt9qvArjc/gfZzPoCTDB+AgAAAABJRU5ErkJggg=="/>
11
11
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
12
12
  <title>Alliance Portal</title>
13
13
  </head>
@@ -28,5 +28,5 @@ import{e as ne}from"./chunk-26VIM55J.js";import{a as Pe,b as Le}from"./chunk-JG7
28
28
  </script>
29
29
  </body>
30
30
  </html>
31
- `.trim();function Ee(r){return r.replaceAll("\\","\\\\")}import{rmSync as Ae,writeFileSync as He}from"node:fs";import{resolve as Ge}from"node:path";async function Ke(r,e){let t=Ge(process.cwd(),`${e}.mjs`);try{He(t,r);let s=await import(`file:///${t}`);return Ae(t,{force:!0}),s}catch(s){try{Ae(t,{force:!0})}catch{}ne.error("something went wrong when creating temp module for app manifest import"),ne.error(s),process.exit(1)}}async function pr(r){let e=[],t=[];for(let s of r){let n=`app${r.indexOf(s)}`;t.push(n),e.push(`import ${n} from '${s}/manifest';`)}return e.push(`export default [${t.join(", ")}];`),Ke(e.join(`
32
- `),"app-manifests").then(s=>s.default)}var _;(function(r){r.assertEqual=n=>n;function e(n){}r.assertIs=e;function t(n){throw new Error}r.assertNever=t,r.arrayToEnum=n=>{let a={};for(let i of n)a[i]=i;return a},r.getValidEnumValues=n=>{let a=r.objectKeys(n).filter(o=>typeof n[n[o]]!="number"),i={};for(let o of a)i[o]=n[o];return r.objectValues(i)},r.objectValues=n=>r.objectKeys(n).map(function(a){return n[a]}),r.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let a=[];for(let i in n)Object.prototype.hasOwnProperty.call(n,i)&&a.push(i);return a},r.find=(n,a)=>{for(let i of n)if(a(i))return i},r.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&isFinite(n)&&Math.floor(n)===n;function s(n,a=" | "){return n.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}r.joinValues=s,r.jsonStringifyReplacer=(n,a)=>typeof a=="bigint"?a.toString():a})(_||(_={}));var xe;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(xe||(xe={}));var l=_.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Z=r=>{switch(typeof r){case"undefined":return l.undefined;case"string":return l.string;case"number":return isNaN(r)?l.nan:l.number;case"boolean":return l.boolean;case"function":return l.function;case"bigint":return l.bigint;case"symbol":return l.symbol;case"object":return Array.isArray(r)?l.array:r===null?l.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?l.promise:typeof Map<"u"&&r instanceof Map?l.map:typeof Set<"u"&&r instanceof Set?l.set:typeof Date<"u"&&r instanceof Date?l.date:l.object;default:return l.unknown}},c=_.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Xe=r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:"),T=class extends Error{constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let t=e||function(a){return a.message},s={_errors:[]},n=a=>{for(let i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(n);else if(i.code==="invalid_return_type")n(i.returnTypeError);else if(i.code==="invalid_arguments")n(i.argumentsError);else if(i.path.length===0)s._errors.push(t(i));else{let o=s,u=0;for(;u<i.path.length;){let d=i.path[u];u===i.path.length-1?(o[d]=o[d]||{_errors:[]},o[d]._errors.push(t(i))):o[d]=o[d]||{_errors:[]},o=o[d],u++}}};return n(this),s}toString(){return this.message}get message(){return JSON.stringify(this.issues,_.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){let t={},s=[];for(let n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):s.push(e(n));return{formErrors:s,fieldErrors:t}}get formErrors(){return this.flatten()}};T.create=r=>new T(r);var ae=(r,e)=>{let t;switch(r.code){case c.invalid_type:r.received===l.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case c.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,_.jsonStringifyReplacer)}`;break;case c.unrecognized_keys:t=`Unrecognized key(s) in object: ${_.joinValues(r.keys,", ")}`;break;case c.invalid_union:t="Invalid input";break;case c.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${_.joinValues(r.options)}`;break;case c.invalid_enum_value:t=`Invalid enum value. Expected ${_.joinValues(r.options)}, received '${r.received}'`;break;case c.invalid_arguments:t="Invalid function arguments";break;case c.invalid_return_type:t="Invalid function return type";break;case c.invalid_date:t="Invalid date";break;case c.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:_.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case c.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case c.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case c.custom:t="Invalid input";break;case c.invalid_intersection_types:t="Intersection results could not be merged";break;case c.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case c.not_finite:t="Number must be finite";break;default:t=e.defaultError,_.assertNever(r)}return{message:t}},Ne=ae;function Fe(r){Ne=r}function de(){return Ne}var ue=r=>{let{data:e,path:t,errorMaps:s,issueData:n}=r,a=[...t,...n.path||[]],i={...n,path:a},o="",u=s.filter(d=>!!d).slice().reverse();for(let d of u)o=d(i,{data:e,defaultError:o}).message;return{...n,path:a,message:n.message||o}},Qe=[];function f(r,e){let t=ue({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,de(),ae].filter(s=>!!s)});r.common.issues.push(t)}var k=class r{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){let s=[];for(let n of t){if(n.status==="aborted")return m;n.status==="dirty"&&e.dirty(),s.push(n.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,t){let s=[];for(let n of t)s.push({key:await n.key,value:await n.value});return r.mergeObjectSync(e,s)}static mergeObjectSync(e,t){let s={};for(let n of t){let{key:a,value:i}=n;if(a.status==="aborted"||i.status==="aborted")return m;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||n.alwaysSet)&&(s[a.value]=i.value)}return{status:e.value,value:s}}},m=Object.freeze({status:"aborted"}),je=r=>({status:"dirty",value:r}),b=r=>({status:"valid",value:r}),ke=r=>r.status==="aborted",be=r=>r.status==="dirty",ie=r=>r.status==="valid",le=r=>typeof Promise<"u"&&r instanceof Promise,h;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e?.message})(h||(h={}));var S=class{constructor(e,t,s,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Ie=(r,e)=>{if(ie(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new T(r.common.issues);return this._error=t,this._error}}};function y(r){if(!r)return{};let{errorMap:e,invalid_type_error:t,required_error:s,description:n}=r;if(e&&(t||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(i,o)=>i.code!=="invalid_type"?{message:o.defaultError}:typeof o.data>"u"?{message:s??o.defaultError}:{message:t??o.defaultError},description:n}}var v=class{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return Z(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Z(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new k,ctx:{common:e.parent.common,data:e.data,parsedType:Z(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(le(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){var s;let n={common:{issues:[],async:(s=t?.async)!==null&&s!==void 0?s:!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Z(e)},a=this._parseSync({data:e,path:n.path,parent:n});return Ie(n,a)}async parseAsync(e,t){let s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){let s={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Z(e)},n=this._parse({data:e,path:s.path,parent:s}),a=await(le(n)?n:Promise.resolve(n));return Ie(s,a)}refine(e,t){let s=n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t;return this._refinement((n,a)=>{let i=e(n),o=()=>a.addIssue({code:c.custom,...s(n)});return typeof Promise<"u"&&i instanceof Promise?i.then(u=>u?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((s,n)=>e(s)?!0:(n.addIssue(typeof t=="function"?t(s,n):t),!1))}_refinement(e){return new O({schema:this,typeName:p.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return E.create(this,this._def)}nullable(){return j.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return N.create(this,this._def)}promise(){return $.create(this,this._def)}or(e){return B.create([this,e],this._def)}and(e){return Y.create(this,e,this._def)}transform(e){return new O({...y(this._def),schema:this,typeName:p.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new G({...y(this._def),innerType:this,defaultValue:t,typeName:p.ZodDefault})}brand(){return new me({typeName:p.ZodBranded,type:this,...y(this._def)})}catch(e){let t=typeof e=="function"?e:()=>e;return new te({...y(this._def),innerType:this,catchValue:t,typeName:p.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return oe.create(this,e)}readonly(){return se.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},et=/^c[^\s-]{8,}$/i,tt=/^[a-z][a-z0-9]*$/,rt=/^[0-9A-HJKMNP-TV-Z]{26}$/,st=/^[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}$/i,nt=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,at="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",_e,it=/^(((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}))$/,ot=/^(([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})))$/,ct=r=>r.precision?r.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${r.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${r.precision}}Z$`):r.precision===0?r.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):r.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function dt(r,e){return!!((e==="v4"||!e)&&it.test(r)||(e==="v6"||!e)&&ot.test(r))}var R=class r extends v{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==l.string){let a=this._getOrReturnCtx(e);return f(a,{code:c.invalid_type,expected:l.string,received:a.parsedType}),m}let s=new k,n;for(let a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(n=this._getOrReturnCtx(e,n),f(n,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="max")e.data.length>a.value&&(n=this._getOrReturnCtx(e,n),f(n,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="length"){let i=e.data.length>a.value,o=e.data.length<a.value;(i||o)&&(n=this._getOrReturnCtx(e,n),i?f(n,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&f(n,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),s.dirty())}else if(a.kind==="email")nt.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"email",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="emoji")_e||(_e=new RegExp(at,"u")),_e.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"emoji",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="uuid")st.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"uuid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid")et.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"cuid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid2")tt.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"cuid2",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="ulid")rt.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"ulid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),f(n,{validation:"url",code:c.invalid_string,message:a.message}),s.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"regex",code:c.invalid_string,message:a.message}),s.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(n=this._getOrReturnCtx(e,n),f(n,{code:c.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),s.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(n=this._getOrReturnCtx(e,n),f(n,{code:c.invalid_string,validation:{startsWith:a.value},message:a.message}),s.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(n=this._getOrReturnCtx(e,n),f(n,{code:c.invalid_string,validation:{endsWith:a.value},message:a.message}),s.dirty()):a.kind==="datetime"?ct(a).test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{code:c.invalid_string,validation:"datetime",message:a.message}),s.dirty()):a.kind==="ip"?dt(e.data,a.version)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"ip",code:c.invalid_string,message:a.message}),s.dirty()):_.assertNever(a);return{status:s.value,value:e.data}}_regex(e,t,s){return this.refinement(n=>e.test(n),{validation:t,code:c.invalid_string,...h.errToObj(s)})}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...h.errToObj(e)})}url(e){return this._addCheck({kind:"url",...h.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...h.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...h.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...h.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...h.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...h.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...h.errToObj(e)})}datetime(e){var t;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(t=e?.offset)!==null&&t!==void 0?t:!1,...h.errToObj(e?.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...h.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...h.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...h.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...h.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...h.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...h.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...h.errToObj(t)})}nonempty(e){return this.min(1,h.errToObj(e))}trim(){return new r({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new r({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new r({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};R.create=r=>{var e;return new R({checks:[],typeName:p.ZodString,coerce:(e=r?.coerce)!==null&&e!==void 0?e:!1,...y(r)})};function ut(r,e){let t=(r.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,n=t>s?t:s,a=parseInt(r.toFixed(n).replace(".","")),i=parseInt(e.toFixed(n).replace(".",""));return a%i/Math.pow(10,n)}var V=class r extends v{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==l.number){let a=this._getOrReturnCtx(e);return f(a,{code:c.invalid_type,expected:l.number,received:a.parsedType}),m}let s,n=new k;for(let a of this._def.checks)a.kind==="int"?_.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),f(s,{code:c.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),f(s,{code:c.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),f(s,{code:c.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?ut(e.data,a.value)!==0&&(s=this._getOrReturnCtx(e,s),f(s,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),f(s,{code:c.not_finite,message:a.message}),n.dirty()):_.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,s,n){return new r({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:h.toString(n)}]})}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:h.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:h.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:h.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:h.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&_.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(t===null||s.value>t)&&(t=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(t)&&Number.isFinite(e)}};V.create=r=>new V({checks:[],typeName:p.ZodNumber,coerce:r?.coerce||!1,...y(r)});var P=class r extends v{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==l.bigint){let a=this._getOrReturnCtx(e);return f(a,{code:c.invalid_type,expected:l.bigint,received:a.parsedType}),m}let s,n=new k;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),f(s,{code:c.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),f(s,{code:c.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),f(s,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):_.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,s,n){return new r({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:h.toString(n)}]})}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};P.create=r=>{var e;return new P({checks:[],typeName:p.ZodBigInt,coerce:(e=r?.coerce)!==null&&e!==void 0?e:!1,...y(r)})};var L=class extends v{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==l.boolean){let s=this._getOrReturnCtx(e);return f(s,{code:c.invalid_type,expected:l.boolean,received:s.parsedType}),m}return b(e.data)}};L.create=r=>new L({typeName:p.ZodBoolean,coerce:r?.coerce||!1,...y(r)});var z=class r extends v{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==l.date){let a=this._getOrReturnCtx(e);return f(a,{code:c.invalid_type,expected:l.date,received:a.parsedType}),m}if(isNaN(e.data.getTime())){let a=this._getOrReturnCtx(e);return f(a,{code:c.invalid_date}),m}let s=new k,n;for(let a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(n=this._getOrReturnCtx(e,n),f(n,{code:c.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),s.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(n=this._getOrReturnCtx(e,n),f(n,{code:c.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),s.dirty()):_.assertNever(a);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:h.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:h.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}};z.create=r=>new z({checks:[],coerce:r?.coerce||!1,typeName:p.ZodDate,...y(r)});var X=class extends v{_parse(e){if(this._getType(e)!==l.symbol){let s=this._getOrReturnCtx(e);return f(s,{code:c.invalid_type,expected:l.symbol,received:s.parsedType}),m}return b(e.data)}};X.create=r=>new X({typeName:p.ZodSymbol,...y(r)});var U=class extends v{_parse(e){if(this._getType(e)!==l.undefined){let s=this._getOrReturnCtx(e);return f(s,{code:c.invalid_type,expected:l.undefined,received:s.parsedType}),m}return b(e.data)}};U.create=r=>new U({typeName:p.ZodUndefined,...y(r)});var D=class extends v{_parse(e){if(this._getType(e)!==l.null){let s=this._getOrReturnCtx(e);return f(s,{code:c.invalid_type,expected:l.null,received:s.parsedType}),m}return b(e.data)}};D.create=r=>new D({typeName:p.ZodNull,...y(r)});var M=class extends v{constructor(){super(...arguments),this._any=!0}_parse(e){return b(e.data)}};M.create=r=>new M({typeName:p.ZodAny,...y(r)});var C=class extends v{constructor(){super(...arguments),this._unknown=!0}_parse(e){return b(e.data)}};C.create=r=>new C({typeName:p.ZodUnknown,...y(r)});var A=class extends v{_parse(e){let t=this._getOrReturnCtx(e);return f(t,{code:c.invalid_type,expected:l.never,received:t.parsedType}),m}};A.create=r=>new A({typeName:p.ZodNever,...y(r)});var F=class extends v{_parse(e){if(this._getType(e)!==l.undefined){let s=this._getOrReturnCtx(e);return f(s,{code:c.invalid_type,expected:l.void,received:s.parsedType}),m}return b(e.data)}};F.create=r=>new F({typeName:p.ZodVoid,...y(r)});var N=class r extends v{_parse(e){let{ctx:t,status:s}=this._processInputParams(e),n=this._def;if(t.parsedType!==l.array)return f(t,{code:c.invalid_type,expected:l.array,received:t.parsedType}),m;if(n.exactLength!==null){let i=t.data.length>n.exactLength.value,o=t.data.length<n.exactLength.value;(i||o)&&(f(t,{code:i?c.too_big:c.too_small,minimum:o?n.exactLength.value:void 0,maximum:i?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),s.dirty())}if(n.minLength!==null&&t.data.length<n.minLength.value&&(f(t,{code:c.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),s.dirty()),n.maxLength!==null&&t.data.length>n.maxLength.value&&(f(t,{code:c.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>n.type._parseAsync(new S(t,i,t.path,o)))).then(i=>k.mergeArray(s,i));let a=[...t.data].map((i,o)=>n.type._parseSync(new S(t,i,t.path,o)));return k.mergeArray(s,a)}get element(){return this._def.type}min(e,t){return new r({...this._def,minLength:{value:e,message:h.toString(t)}})}max(e,t){return new r({...this._def,maxLength:{value:e,message:h.toString(t)}})}length(e,t){return new r({...this._def,exactLength:{value:e,message:h.toString(t)}})}nonempty(e){return this.min(1,e)}};N.create=(r,e)=>new N({type:r,minLength:null,maxLength:null,exactLength:null,typeName:p.ZodArray,...y(e)});function K(r){if(r instanceof w){let e={};for(let t in r.shape){let s=r.shape[t];e[t]=E.create(K(s))}return new w({...r._def,shape:()=>e})}else return r instanceof N?new N({...r._def,type:K(r.element)}):r instanceof E?E.create(K(r.unwrap())):r instanceof j?j.create(K(r.unwrap())):r instanceof I?I.create(r.items.map(e=>K(e))):r}var w=class r extends v{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=_.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==l.object){let d=this._getOrReturnCtx(e);return f(d,{code:c.invalid_type,expected:l.object,received:d.parsedType}),m}let{status:s,ctx:n}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof A&&this._def.unknownKeys==="strip"))for(let d in n.data)i.includes(d)||o.push(d);let u=[];for(let d of i){let g=a[d],x=n.data[d];u.push({key:{status:"valid",value:d},value:g._parse(new S(n,x,n.path,d)),alwaysSet:d in n.data})}if(this._def.catchall instanceof A){let d=this._def.unknownKeys;if(d==="passthrough")for(let g of o)u.push({key:{status:"valid",value:g},value:{status:"valid",value:n.data[g]}});else if(d==="strict")o.length>0&&(f(n,{code:c.unrecognized_keys,keys:o}),s.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let d=this._def.catchall;for(let g of o){let x=n.data[g];u.push({key:{status:"valid",value:g},value:d._parse(new S(n,x,n.path,g)),alwaysSet:g in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let d=[];for(let g of u){let x=await g.key;d.push({key:x,value:await g.value,alwaysSet:g.alwaysSet})}return d}).then(d=>k.mergeObjectSync(s,d)):k.mergeObjectSync(s,u)}get shape(){return this._def.shape()}strict(e){return h.errToObj,new r({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,s)=>{var n,a,i,o;let u=(i=(a=(n=this._def).errorMap)===null||a===void 0?void 0:a.call(n,t,s).message)!==null&&i!==void 0?i:s.defaultError;return t.code==="unrecognized_keys"?{message:(o=h.errToObj(e).message)!==null&&o!==void 0?o:u}:{message:u}}}:{}})}strip(){return new r({...this._def,unknownKeys:"strip"})}passthrough(){return new r({...this._def,unknownKeys:"passthrough"})}extend(e){return new r({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new r({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:p.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new r({...this._def,catchall:e})}pick(e){let t={};return _.objectKeys(e).forEach(s=>{e[s]&&this.shape[s]&&(t[s]=this.shape[s])}),new r({...this._def,shape:()=>t})}omit(e){let t={};return _.objectKeys(this.shape).forEach(s=>{e[s]||(t[s]=this.shape[s])}),new r({...this._def,shape:()=>t})}deepPartial(){return K(this)}partial(e){let t={};return _.objectKeys(this.shape).forEach(s=>{let n=this.shape[s];e&&!e[s]?t[s]=n:t[s]=n.optional()}),new r({...this._def,shape:()=>t})}required(e){let t={};return _.objectKeys(this.shape).forEach(s=>{if(e&&!e[s])t[s]=this.shape[s];else{let a=this.shape[s];for(;a instanceof E;)a=a._def.innerType;t[s]=a}}),new r({...this._def,shape:()=>t})}keyof(){return Ze(_.objectKeys(this.shape))}};w.create=(r,e)=>new w({shape:()=>r,unknownKeys:"strip",catchall:A.create(),typeName:p.ZodObject,...y(e)});w.strictCreate=(r,e)=>new w({shape:()=>r,unknownKeys:"strict",catchall:A.create(),typeName:p.ZodObject,...y(e)});w.lazycreate=(r,e)=>new w({shape:r,unknownKeys:"strip",catchall:A.create(),typeName:p.ZodObject,...y(e)});var B=class extends v{_parse(e){let{ctx:t}=this._processInputParams(e),s=this._def.options;function n(a){for(let o of a)if(o.result.status==="valid")return o.result;for(let o of a)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;let i=a.map(o=>new T(o.ctx.common.issues));return f(t,{code:c.invalid_union,unionErrors:i}),m}if(t.common.async)return Promise.all(s.map(async a=>{let i={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(n);{let a,i=[];for(let u of s){let d={...t,common:{...t.common,issues:[]},parent:null},g=u._parseSync({data:t.data,path:t.path,parent:d});if(g.status==="valid")return g;g.status==="dirty"&&!a&&(a={result:g,ctx:d}),d.common.issues.length&&i.push(d.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;let o=i.map(u=>new T(u));return f(t,{code:c.invalid_union,unionErrors:o}),m}}get options(){return this._def.options}};B.create=(r,e)=>new B({options:r,typeName:p.ZodUnion,...y(e)});var ce=r=>r instanceof W?ce(r.schema):r instanceof O?ce(r.innerType()):r instanceof q?[r.value]:r instanceof J?r.options:r instanceof H?Object.keys(r.enum):r instanceof G?ce(r._def.innerType):r instanceof U?[void 0]:r instanceof D?[null]:null,fe=class r extends v{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==l.object)return f(t,{code:c.invalid_type,expected:l.object,received:t.parsedType}),m;let s=this.discriminator,n=t.data[s],a=this.optionsMap.get(n);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(f(t,{code:c.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),m)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,s){let n=new Map;for(let a of t){let i=ce(a.shape[e]);if(!i)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let o of i){if(n.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);n.set(o,a)}}return new r({typeName:p.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...y(s)})}};function we(r,e){let t=Z(r),s=Z(e);if(r===e)return{valid:!0,data:r};if(t===l.object&&s===l.object){let n=_.objectKeys(e),a=_.objectKeys(r).filter(o=>n.indexOf(o)!==-1),i={...r,...e};for(let o of a){let u=we(r[o],e[o]);if(!u.valid)return{valid:!1};i[o]=u.data}return{valid:!0,data:i}}else if(t===l.array&&s===l.array){if(r.length!==e.length)return{valid:!1};let n=[];for(let a=0;a<r.length;a++){let i=r[a],o=e[a],u=we(i,o);if(!u.valid)return{valid:!1};n.push(u.data)}return{valid:!0,data:n}}else return t===l.date&&s===l.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}var Y=class extends v{_parse(e){let{status:t,ctx:s}=this._processInputParams(e),n=(a,i)=>{if(ke(a)||ke(i))return m;let o=we(a.value,i.value);return o.valid?((be(a)||be(i))&&t.dirty(),{status:t.value,value:o.data}):(f(s,{code:c.invalid_intersection_types}),m)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([a,i])=>n(a,i)):n(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}};Y.create=(r,e,t)=>new Y({left:r,right:e,typeName:p.ZodIntersection,...y(t)});var I=class r extends v{_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==l.array)return f(s,{code:c.invalid_type,expected:l.array,received:s.parsedType}),m;if(s.data.length<this._def.items.length)return f(s,{code:c.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),m;!this._def.rest&&s.data.length>this._def.items.length&&(f(s,{code:c.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let a=[...s.data].map((i,o)=>{let u=this._def.items[o]||this._def.rest;return u?u._parse(new S(s,i,s.path,o)):null}).filter(i=>!!i);return s.common.async?Promise.all(a).then(i=>k.mergeArray(t,i)):k.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new r({...this._def,rest:e})}};I.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new I({items:r,typeName:p.ZodTuple,rest:null,...y(e)})};var he=class r extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==l.object)return f(s,{code:c.invalid_type,expected:l.object,received:s.parsedType}),m;let n=[],a=this._def.keyType,i=this._def.valueType;for(let o in s.data)n.push({key:a._parse(new S(s,o,s.path,o)),value:i._parse(new S(s,s.data[o],s.path,o))});return s.common.async?k.mergeObjectAsync(t,n):k.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,s){return t instanceof v?new r({keyType:e,valueType:t,typeName:p.ZodRecord,...y(s)}):new r({keyType:R.create(),valueType:e,typeName:p.ZodRecord,...y(t)})}},Q=class extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==l.map)return f(s,{code:c.invalid_type,expected:l.map,received:s.parsedType}),m;let n=this._def.keyType,a=this._def.valueType,i=[...s.data.entries()].map(([o,u],d)=>({key:n._parse(new S(s,o,s.path,[d,"key"])),value:a._parse(new S(s,u,s.path,[d,"value"]))}));if(s.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let u of i){let d=await u.key,g=await u.value;if(d.status==="aborted"||g.status==="aborted")return m;(d.status==="dirty"||g.status==="dirty")&&t.dirty(),o.set(d.value,g.value)}return{status:t.value,value:o}})}else{let o=new Map;for(let u of i){let d=u.key,g=u.value;if(d.status==="aborted"||g.status==="aborted")return m;(d.status==="dirty"||g.status==="dirty")&&t.dirty(),o.set(d.value,g.value)}return{status:t.value,value:o}}}};Q.create=(r,e,t)=>new Q({valueType:e,keyType:r,typeName:p.ZodMap,...y(t)});var ee=class r extends v{_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==l.set)return f(s,{code:c.invalid_type,expected:l.set,received:s.parsedType}),m;let n=this._def;n.minSize!==null&&s.data.size<n.minSize.value&&(f(s,{code:c.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),n.maxSize!==null&&s.data.size>n.maxSize.value&&(f(s,{code:c.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());let a=this._def.valueType;function i(u){let d=new Set;for(let g of u){if(g.status==="aborted")return m;g.status==="dirty"&&t.dirty(),d.add(g.value)}return{status:t.value,value:d}}let o=[...s.data.values()].map((u,d)=>a._parse(new S(s,u,s.path,d)));return s.common.async?Promise.all(o).then(u=>i(u)):i(o)}min(e,t){return new r({...this._def,minSize:{value:e,message:h.toString(t)}})}max(e,t){return new r({...this._def,maxSize:{value:e,message:h.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};ee.create=(r,e)=>new ee({valueType:r,minSize:null,maxSize:null,typeName:p.ZodSet,...y(e)});var pe=class r extends v{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==l.function)return f(t,{code:c.invalid_type,expected:l.function,received:t.parsedType}),m;function s(o,u){return ue({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,de(),ae].filter(d=>!!d),issueData:{code:c.invalid_arguments,argumentsError:u}})}function n(o,u){return ue({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,de(),ae].filter(d=>!!d),issueData:{code:c.invalid_return_type,returnTypeError:u}})}let a={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof $){let o=this;return b(async function(...u){let d=new T([]),g=await o._def.args.parseAsync(u,a).catch(ye=>{throw d.addIssue(s(u,ye)),d}),x=await Reflect.apply(i,this,g);return await o._def.returns._def.type.parseAsync(x,a).catch(ye=>{throw d.addIssue(n(x,ye)),d})})}else{let o=this;return b(function(...u){let d=o._def.args.safeParse(u,a);if(!d.success)throw new T([s(u,d.error)]);let g=Reflect.apply(i,this,d.data),x=o._def.returns.safeParse(g,a);if(!x.success)throw new T([n(g,x.error)]);return x.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new r({...this._def,args:I.create(e).rest(C.create())})}returns(e){return new r({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,s){return new r({args:e||I.create([]).rest(C.create()),returns:t||C.create(),typeName:p.ZodFunction,...y(s)})}},W=class extends v{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};W.create=(r,e)=>new W({getter:r,typeName:p.ZodLazy,...y(e)});var q=class extends v{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return f(t,{received:t.data,code:c.invalid_literal,expected:this._def.value}),m}return{status:"valid",value:e.data}}get value(){return this._def.value}};q.create=(r,e)=>new q({value:r,typeName:p.ZodLiteral,...y(e)});function Ze(r,e){return new J({values:r,typeName:p.ZodEnum,...y(e)})}var J=class r extends v{_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),s=this._def.values;return f(t,{expected:_.joinValues(s),received:t.parsedType,code:c.invalid_type}),m}if(this._def.values.indexOf(e.data)===-1){let t=this._getOrReturnCtx(e),s=this._def.values;return f(t,{received:t.data,code:c.invalid_enum_value,options:s}),m}return b(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e){return r.create(e)}exclude(e){return r.create(this.options.filter(t=>!e.includes(t)))}};J.create=Ze;var H=class extends v{_parse(e){let t=_.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==l.string&&s.parsedType!==l.number){let n=_.objectValues(t);return f(s,{expected:_.joinValues(n),received:s.parsedType,code:c.invalid_type}),m}if(t.indexOf(e.data)===-1){let n=_.objectValues(t);return f(s,{received:s.data,code:c.invalid_enum_value,options:n}),m}return b(e.data)}get enum(){return this._def.values}};H.create=(r,e)=>new H({values:r,typeName:p.ZodNativeEnum,...y(e)});var $=class extends v{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==l.promise&&t.common.async===!1)return f(t,{code:c.invalid_type,expected:l.promise,received:t.parsedType}),m;let s=t.parsedType===l.promise?t.data:Promise.resolve(t.data);return b(s.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}};$.create=(r,e)=>new $({type:r,typeName:p.ZodPromise,...y(e)});var O=class extends v{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===p.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:s}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:i=>{f(s,i),i.fatal?t.abort():t.dirty()},get path(){return s.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="preprocess"){let i=n.transform(s.data,a);return s.common.issues.length?{status:"dirty",value:s.data}:s.common.async?Promise.resolve(i).then(o=>this._def.schema._parseAsync({data:o,path:s.path,parent:s})):this._def.schema._parseSync({data:i,path:s.path,parent:s})}if(n.type==="refinement"){let i=o=>{let u=n.refinement(o,a);if(s.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(s.common.async===!1){let o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return o.status==="aborted"?m:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>o.status==="aborted"?m:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(n.type==="transform")if(s.common.async===!1){let i=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!ie(i))return i;let o=n.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(i=>ie(i)?Promise.resolve(n.transform(i.value,a)).then(o=>({status:t.value,value:o})):i);_.assertNever(n)}};O.create=(r,e,t)=>new O({schema:r,typeName:p.ZodEffects,effect:e,...y(t)});O.createWithPreprocess=(r,e,t)=>new O({schema:e,effect:{type:"preprocess",transform:r},typeName:p.ZodEffects,...y(t)});var E=class extends v{_parse(e){return this._getType(e)===l.undefined?b(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};E.create=(r,e)=>new E({innerType:r,typeName:p.ZodOptional,...y(e)});var j=class extends v{_parse(e){return this._getType(e)===l.null?b(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};j.create=(r,e)=>new j({innerType:r,typeName:p.ZodNullable,...y(e)});var G=class extends v{_parse(e){let{ctx:t}=this._processInputParams(e),s=t.data;return t.parsedType===l.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};G.create=(r,e)=>new G({innerType:r,typeName:p.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...y(e)});var te=class extends v{_parse(e){let{ctx:t}=this._processInputParams(e),s={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return le(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new T(s.common.issues)},input:s.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new T(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}};te.create=(r,e)=>new te({innerType:r,typeName:p.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...y(e)});var re=class extends v{_parse(e){if(this._getType(e)!==l.nan){let s=this._getOrReturnCtx(e);return f(s,{code:c.invalid_type,expected:l.nan,received:s.parsedType}),m}return{status:"valid",value:e.data}}};re.create=r=>new re({typeName:p.ZodNaN,...y(r)});var lt=Symbol("zod_brand"),me=class extends v{_parse(e){let{ctx:t}=this._processInputParams(e),s=t.data;return this._def.type._parse({data:s,path:t.path,parent:t})}unwrap(){return this._def.type}},oe=class r extends v{_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{let a=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?m:a.status==="dirty"?(t.dirty(),je(a.value)):this._def.out._parseAsync({data:a.value,path:s.path,parent:s})})();{let n=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?m:n.status==="dirty"?(t.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:s.path,parent:s})}}static create(e,t){return new r({in:e,out:t,typeName:p.ZodPipeline})}},se=class extends v{_parse(e){let t=this._def.innerType._parse(e);return ie(t)&&(t.value=Object.freeze(t.value)),t}};se.create=(r,e)=>new se({innerType:r,typeName:p.ZodReadonly,...y(e)});var Re=(r,e={},t)=>r?M.create().superRefine((s,n)=>{var a,i;if(!r(s)){let o=typeof e=="function"?e(s):typeof e=="string"?{message:e}:e,u=(i=(a=o.fatal)!==null&&a!==void 0?a:t)!==null&&i!==void 0?i:!0,d=typeof o=="string"?{message:o}:o;n.addIssue({code:"custom",...d,fatal:u})}}):M.create(),ft={object:w.lazycreate},p;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(p||(p={}));var ht=(r,e={message:`Input not instance of ${r.name}`})=>Re(t=>t instanceof r,e),Me=R.create,$e=V.create,pt=re.create,mt=P.create,Ve=L.create,yt=z.create,vt=X.create,gt=U.create,_t=D.create,xt=M.create,kt=C.create,bt=A.create,wt=F.create,Tt=N.create,Ot=w.create,St=w.strictCreate,Et=B.create,At=fe.create,It=Y.create,Ct=I.create,Nt=he.create,jt=Q.create,Zt=ee.create,Rt=pe.create,Mt=W.create,$t=q.create,Vt=J.create,Pt=H.create,Lt=$.create,Ce=O.create,zt=E.create,Ut=j.create,Dt=O.createWithPreprocess,Bt=oe.create,Yt=()=>Me().optional(),Wt=()=>$e().optional(),qt=()=>Ve().optional(),Jt={string:r=>R.create({...r,coerce:!0}),number:r=>V.create({...r,coerce:!0}),boolean:r=>L.create({...r,coerce:!0}),bigint:r=>P.create({...r,coerce:!0}),date:r=>z.create({...r,coerce:!0})},Ht=m,yr=Object.freeze({__proto__:null,defaultErrorMap:ae,setErrorMap:Fe,getErrorMap:de,makeIssue:ue,EMPTY_PATH:Qe,addIssueToContext:f,ParseStatus:k,INVALID:m,DIRTY:je,OK:b,isAborted:ke,isDirty:be,isValid:ie,isAsync:le,get util(){return _},get objectUtil(){return xe},ZodParsedType:l,getParsedType:Z,ZodType:v,ZodString:R,ZodNumber:V,ZodBigInt:P,ZodBoolean:L,ZodDate:z,ZodSymbol:X,ZodUndefined:U,ZodNull:D,ZodAny:M,ZodUnknown:C,ZodNever:A,ZodVoid:F,ZodArray:N,ZodObject:w,ZodUnion:B,ZodDiscriminatedUnion:fe,ZodIntersection:Y,ZodTuple:I,ZodRecord:he,ZodMap:Q,ZodSet:ee,ZodFunction:pe,ZodLazy:W,ZodLiteral:q,ZodEnum:J,ZodNativeEnum:H,ZodPromise:$,ZodEffects:O,ZodTransformer:O,ZodOptional:E,ZodNullable:j,ZodDefault:G,ZodCatch:te,ZodNaN:re,BRAND:lt,ZodBranded:me,ZodPipeline:oe,ZodReadonly:se,custom:Re,Schema:v,ZodSchema:v,late:ft,get ZodFirstPartyTypeKind(){return p},coerce:Jt,any:xt,array:Tt,bigint:mt,boolean:Ve,date:yt,discriminatedUnion:At,effect:Ce,enum:Vt,function:Rt,instanceof:ht,intersection:It,lazy:Mt,literal:$t,map:jt,nan:pt,nativeEnum:Pt,never:bt,null:_t,nullable:Ut,number:$e,object:Ot,oboolean:qt,onumber:Wt,optional:zt,ostring:Yt,pipeline:Bt,preprocess:Dt,promise:Lt,record:Nt,set:Zt,strictObject:St,string:Me,symbol:vt,transformer:Ce,tuple:Ct,undefined:gt,union:Et,unknown:kt,void:wt,NEVER:Ht,ZodIssueCode:c,quotelessJson:Xe,ZodError:T});export{yr as a,Se as b,er as c,pr as d};
31
+ `.trim();function Se(r){return r.replaceAll("\\","\\\\")}import{rmSync as Ce,writeFileSync as Ge}from"node:fs";import{resolve as We}from"node:path";async function Ke(r,e){let t=We(process.cwd(),`${e}.mjs`);try{Ge(t,r);let s=await import(`file:///${t}`);return Ce(t,{force:!0}),s}catch(s){try{Ce(t,{force:!0})}catch{}ne.error("something went wrong when creating temp module for app manifest import"),ne.error(s),process.exit(1)}}async function pr(r){let e=[],t=[];for(let s of r){let n=`manifest${r.indexOf(s)}`,a=`pkgjson${r.indexOf(s)}`,i=`export${r.indexOf(s)}`;e.push(`import ${n} from '${s}/manifest';`),e.push(`delete ${n}['$schema'];`),e.push(`import ${a} from './node_modules/${s}/package.json' assert { type: "json" };`),e.push(`const ${i} = { ...${n}, version: ${a}.version };`),t.push(i)}return e.push(`export default [${t.join(", ")}];`),Ke(e.join(`
32
+ `),"app-manifests").then(s=>s.default)}var _;(function(r){r.assertEqual=n=>n;function e(n){}r.assertIs=e;function t(n){throw new Error}r.assertNever=t,r.arrayToEnum=n=>{let a={};for(let i of n)a[i]=i;return a},r.getValidEnumValues=n=>{let a=r.objectKeys(n).filter(o=>typeof n[n[o]]!="number"),i={};for(let o of a)i[o]=n[o];return r.objectValues(i)},r.objectValues=n=>r.objectKeys(n).map(function(a){return n[a]}),r.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let a=[];for(let i in n)Object.prototype.hasOwnProperty.call(n,i)&&a.push(i);return a},r.find=(n,a)=>{for(let i of n)if(a(i))return i},r.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&isFinite(n)&&Math.floor(n)===n;function s(n,a=" | "){return n.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}r.joinValues=s,r.jsonStringifyReplacer=(n,a)=>typeof a=="bigint"?a.toString():a})(_||(_={}));var xe;(function(r){r.mergeShapes=(e,t)=>({...e,...t})})(xe||(xe={}));var l=_.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),N=r=>{switch(typeof r){case"undefined":return l.undefined;case"string":return l.string;case"number":return isNaN(r)?l.nan:l.number;case"boolean":return l.boolean;case"function":return l.function;case"bigint":return l.bigint;case"symbol":return l.symbol;case"object":return Array.isArray(r)?l.array:r===null?l.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?l.promise:typeof Map<"u"&&r instanceof Map?l.map:typeof Set<"u"&&r instanceof Set?l.set:typeof Date<"u"&&r instanceof Date?l.date:l.object;default:return l.unknown}},c=_.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Xe=r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:"),T=class extends Error{constructor(e){super(),this.issues=[],this.addIssue=s=>{this.issues=[...this.issues,s]},this.addIssues=(s=[])=>{this.issues=[...this.issues,...s]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let t=e||function(a){return a.message},s={_errors:[]},n=a=>{for(let i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(n);else if(i.code==="invalid_return_type")n(i.returnTypeError);else if(i.code==="invalid_arguments")n(i.argumentsError);else if(i.path.length===0)s._errors.push(t(i));else{let o=s,u=0;for(;u<i.path.length;){let d=i.path[u];u===i.path.length-1?(o[d]=o[d]||{_errors:[]},o[d]._errors.push(t(i))):o[d]=o[d]||{_errors:[]},o=o[d],u++}}};return n(this),s}toString(){return this.message}get message(){return JSON.stringify(this.issues,_.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){let t={},s=[];for(let n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):s.push(e(n));return{formErrors:s,fieldErrors:t}}get formErrors(){return this.flatten()}};T.create=r=>new T(r);var ae=(r,e)=>{let t;switch(r.code){case c.invalid_type:r.received===l.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case c.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,_.jsonStringifyReplacer)}`;break;case c.unrecognized_keys:t=`Unrecognized key(s) in object: ${_.joinValues(r.keys,", ")}`;break;case c.invalid_union:t="Invalid input";break;case c.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${_.joinValues(r.options)}`;break;case c.invalid_enum_value:t=`Invalid enum value. Expected ${_.joinValues(r.options)}, received '${r.received}'`;break;case c.invalid_arguments:t="Invalid function arguments";break;case c.invalid_return_type:t="Invalid function return type";break;case c.invalid_date:t="Invalid date";break;case c.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:_.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case c.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case c.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case c.custom:t="Invalid input";break;case c.invalid_intersection_types:t="Intersection results could not be merged";break;case c.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case c.not_finite:t="Number must be finite";break;default:t=e.defaultError,_.assertNever(r)}return{message:t}},je=ae;function Qe(r){je=r}function de(){return je}var ue=r=>{let{data:e,path:t,errorMaps:s,issueData:n}=r,a=[...t,...n.path||[]],i={...n,path:a},o="",u=s.filter(d=>!!d).slice().reverse();for(let d of u)o=d(i,{data:e,defaultError:o}).message;return{...n,path:a,message:n.message||o}},Fe=[];function f(r,e){let t=ue({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,de(),ae].filter(s=>!!s)});r.common.issues.push(t)}var b=class r{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){let s=[];for(let n of t){if(n.status==="aborted")return m;n.status==="dirty"&&e.dirty(),s.push(n.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,t){let s=[];for(let n of t)s.push({key:await n.key,value:await n.value});return r.mergeObjectSync(e,s)}static mergeObjectSync(e,t){let s={};for(let n of t){let{key:a,value:i}=n;if(a.status==="aborted"||i.status==="aborted")return m;a.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||n.alwaysSet)&&(s[a.value]=i.value)}return{status:e.value,value:s}}},m=Object.freeze({status:"aborted"}),Ze=r=>({status:"dirty",value:r}),k=r=>({status:"valid",value:r}),be=r=>r.status==="aborted",ke=r=>r.status==="dirty",ie=r=>r.status==="valid",le=r=>typeof Promise<"u"&&r instanceof Promise,h;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e?.message})(h||(h={}));var E=class{constructor(e,t,s,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Oe=(r,e)=>{if(ie(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new T(r.common.issues);return this._error=t,this._error}}};function y(r){if(!r)return{};let{errorMap:e,invalid_type_error:t,required_error:s,description:n}=r;if(e&&(t||s))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:n}:{errorMap:(i,o)=>i.code!=="invalid_type"?{message:o.defaultError}:typeof o.data>"u"?{message:s??o.defaultError}:{message:t??o.defaultError},description:n}}var v=class{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return N(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:N(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new b,ctx:{common:e.parent.common,data:e.data,parsedType:N(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(le(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){var s;let n={common:{issues:[],async:(s=t?.async)!==null&&s!==void 0?s:!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:N(e)},a=this._parseSync({data:e,path:n.path,parent:n});return Oe(n,a)}async parseAsync(e,t){let s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){let s={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:N(e)},n=this._parse({data:e,path:s.path,parent:s}),a=await(le(n)?n:Promise.resolve(n));return Oe(s,a)}refine(e,t){let s=n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t;return this._refinement((n,a)=>{let i=e(n),o=()=>a.addIssue({code:c.custom,...s(n)});return typeof Promise<"u"&&i instanceof Promise?i.then(u=>u?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,t){return this._refinement((s,n)=>e(s)?!0:(n.addIssue(typeof t=="function"?t(s,n):t),!1))}_refinement(e){return new A({schema:this,typeName:p.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return S.create(this,this._def)}nullable(){return Z.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return j.create(this,this._def)}promise(){return V.create(this,this._def)}or(e){return B.create([this,e],this._def)}and(e){return q.create(this,e,this._def)}transform(e){return new A({...y(this._def),schema:this,typeName:p.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new W({...y(this._def),innerType:this,defaultValue:t,typeName:p.ZodDefault})}brand(){return new me({typeName:p.ZodBranded,type:this,...y(this._def)})}catch(e){let t=typeof e=="function"?e:()=>e;return new te({...y(this._def),innerType:this,catchValue:t,typeName:p.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return oe.create(this,e)}readonly(){return se.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},et=/^c[^\s-]{8,}$/i,tt=/^[a-z][a-z0-9]*$/,rt=/^[0-9A-HJKMNP-TV-Z]{26}$/,st=/^[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}$/i,nt=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,at="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",_e,it=/^(((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}))$/,ot=/^(([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})))$/,ct=r=>r.precision?r.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${r.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${r.precision}}Z$`):r.precision===0?r.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):r.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function dt(r,e){return!!((e==="v4"||!e)&&it.test(r)||(e==="v6"||!e)&&ot.test(r))}var R=class r extends v{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==l.string){let a=this._getOrReturnCtx(e);return f(a,{code:c.invalid_type,expected:l.string,received:a.parsedType}),m}let s=new b,n;for(let a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(n=this._getOrReturnCtx(e,n),f(n,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="max")e.data.length>a.value&&(n=this._getOrReturnCtx(e,n),f(n,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if(a.kind==="length"){let i=e.data.length>a.value,o=e.data.length<a.value;(i||o)&&(n=this._getOrReturnCtx(e,n),i?f(n,{code:c.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):o&&f(n,{code:c.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),s.dirty())}else if(a.kind==="email")nt.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"email",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="emoji")_e||(_e=new RegExp(at,"u")),_e.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"emoji",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="uuid")st.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"uuid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid")et.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"cuid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="cuid2")tt.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"cuid2",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="ulid")rt.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"ulid",code:c.invalid_string,message:a.message}),s.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),f(n,{validation:"url",code:c.invalid_string,message:a.message}),s.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"regex",code:c.invalid_string,message:a.message}),s.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(n=this._getOrReturnCtx(e,n),f(n,{code:c.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),s.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(n=this._getOrReturnCtx(e,n),f(n,{code:c.invalid_string,validation:{startsWith:a.value},message:a.message}),s.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(n=this._getOrReturnCtx(e,n),f(n,{code:c.invalid_string,validation:{endsWith:a.value},message:a.message}),s.dirty()):a.kind==="datetime"?ct(a).test(e.data)||(n=this._getOrReturnCtx(e,n),f(n,{code:c.invalid_string,validation:"datetime",message:a.message}),s.dirty()):a.kind==="ip"?dt(e.data,a.version)||(n=this._getOrReturnCtx(e,n),f(n,{validation:"ip",code:c.invalid_string,message:a.message}),s.dirty()):_.assertNever(a);return{status:s.value,value:e.data}}_regex(e,t,s){return this.refinement(n=>e.test(n),{validation:t,code:c.invalid_string,...h.errToObj(s)})}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...h.errToObj(e)})}url(e){return this._addCheck({kind:"url",...h.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...h.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...h.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...h.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...h.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...h.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...h.errToObj(e)})}datetime(e){var t;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(t=e?.offset)!==null&&t!==void 0?t:!1,...h.errToObj(e?.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...h.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...h.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...h.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...h.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...h.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...h.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...h.errToObj(t)})}nonempty(e){return this.min(1,h.errToObj(e))}trim(){return new r({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new r({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new r({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get minLength(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};R.create=r=>{var e;return new R({checks:[],typeName:p.ZodString,coerce:(e=r?.coerce)!==null&&e!==void 0?e:!1,...y(r)})};function ut(r,e){let t=(r.toString().split(".")[1]||"").length,s=(e.toString().split(".")[1]||"").length,n=t>s?t:s,a=parseInt(r.toFixed(n).replace(".","")),i=parseInt(e.toFixed(n).replace(".",""));return a%i/Math.pow(10,n)}var P=class r extends v{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==l.number){let a=this._getOrReturnCtx(e);return f(a,{code:c.invalid_type,expected:l.number,received:a.parsedType}),m}let s,n=new b;for(let a of this._def.checks)a.kind==="int"?_.isInteger(e.data)||(s=this._getOrReturnCtx(e,s),f(s,{code:c.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),f(s,{code:c.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),f(s,{code:c.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?ut(e.data,a.value)!==0&&(s=this._getOrReturnCtx(e,s),f(s,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(s=this._getOrReturnCtx(e,s),f(s,{code:c.not_finite,message:a.message}),n.dirty()):_.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,s,n){return new r({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:h.toString(n)}]})}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:h.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:h.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:h.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:h.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&_.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let s of this._def.checks){if(s.kind==="finite"||s.kind==="int"||s.kind==="multipleOf")return!0;s.kind==="min"?(t===null||s.value>t)&&(t=s.value):s.kind==="max"&&(e===null||s.value<e)&&(e=s.value)}return Number.isFinite(t)&&Number.isFinite(e)}};P.create=r=>new P({checks:[],typeName:p.ZodNumber,coerce:r?.coerce||!1,...y(r)});var z=class r extends v{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==l.bigint){let a=this._getOrReturnCtx(e);return f(a,{code:c.invalid_type,expected:l.bigint,received:a.parsedType}),m}let s,n=new b;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(s=this._getOrReturnCtx(e,s),f(s,{code:c.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(s=this._getOrReturnCtx(e,s),f(s,{code:c.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(s=this._getOrReturnCtx(e,s),f(s,{code:c.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):_.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,h.toString(t))}gt(e,t){return this.setLimit("min",e,!1,h.toString(t))}lte(e,t){return this.setLimit("max",e,!0,h.toString(t))}lt(e,t){return this.setLimit("max",e,!1,h.toString(t))}setLimit(e,t,s,n){return new r({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:h.toString(n)}]})}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:h.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};z.create=r=>{var e;return new z({checks:[],typeName:p.ZodBigInt,coerce:(e=r?.coerce)!==null&&e!==void 0?e:!1,...y(r)})};var D=class extends v{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==l.boolean){let s=this._getOrReturnCtx(e);return f(s,{code:c.invalid_type,expected:l.boolean,received:s.parsedType}),m}return k(e.data)}};D.create=r=>new D({typeName:p.ZodBoolean,coerce:r?.coerce||!1,...y(r)});var U=class r extends v{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==l.date){let a=this._getOrReturnCtx(e);return f(a,{code:c.invalid_type,expected:l.date,received:a.parsedType}),m}if(isNaN(e.data.getTime())){let a=this._getOrReturnCtx(e);return f(a,{code:c.invalid_date}),m}let s=new b,n;for(let a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(n=this._getOrReturnCtx(e,n),f(n,{code:c.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),s.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(n=this._getOrReturnCtx(e,n),f(n,{code:c.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),s.dirty()):_.assertNever(a);return{status:s.value,value:new Date(e.data.getTime())}}_addCheck(e){return new r({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:h.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:h.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}};U.create=r=>new U({checks:[],coerce:r?.coerce||!1,typeName:p.ZodDate,...y(r)});var X=class extends v{_parse(e){if(this._getType(e)!==l.symbol){let s=this._getOrReturnCtx(e);return f(s,{code:c.invalid_type,expected:l.symbol,received:s.parsedType}),m}return k(e.data)}};X.create=r=>new X({typeName:p.ZodSymbol,...y(r)});var $=class extends v{_parse(e){if(this._getType(e)!==l.undefined){let s=this._getOrReturnCtx(e);return f(s,{code:c.invalid_type,expected:l.undefined,received:s.parsedType}),m}return k(e.data)}};$.create=r=>new $({typeName:p.ZodUndefined,...y(r)});var L=class extends v{_parse(e){if(this._getType(e)!==l.null){let s=this._getOrReturnCtx(e);return f(s,{code:c.invalid_type,expected:l.null,received:s.parsedType}),m}return k(e.data)}};L.create=r=>new L({typeName:p.ZodNull,...y(r)});var M=class extends v{constructor(){super(...arguments),this._any=!0}_parse(e){return k(e.data)}};M.create=r=>new M({typeName:p.ZodAny,...y(r)});var I=class extends v{constructor(){super(...arguments),this._unknown=!0}_parse(e){return k(e.data)}};I.create=r=>new I({typeName:p.ZodUnknown,...y(r)});var C=class extends v{_parse(e){let t=this._getOrReturnCtx(e);return f(t,{code:c.invalid_type,expected:l.never,received:t.parsedType}),m}};C.create=r=>new C({typeName:p.ZodNever,...y(r)});var Q=class extends v{_parse(e){if(this._getType(e)!==l.undefined){let s=this._getOrReturnCtx(e);return f(s,{code:c.invalid_type,expected:l.void,received:s.parsedType}),m}return k(e.data)}};Q.create=r=>new Q({typeName:p.ZodVoid,...y(r)});var j=class r extends v{_parse(e){let{ctx:t,status:s}=this._processInputParams(e),n=this._def;if(t.parsedType!==l.array)return f(t,{code:c.invalid_type,expected:l.array,received:t.parsedType}),m;if(n.exactLength!==null){let i=t.data.length>n.exactLength.value,o=t.data.length<n.exactLength.value;(i||o)&&(f(t,{code:i?c.too_big:c.too_small,minimum:o?n.exactLength.value:void 0,maximum:i?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),s.dirty())}if(n.minLength!==null&&t.data.length<n.minLength.value&&(f(t,{code:c.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),s.dirty()),n.maxLength!==null&&t.data.length>n.maxLength.value&&(f(t,{code:c.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map((i,o)=>n.type._parseAsync(new E(t,i,t.path,o)))).then(i=>b.mergeArray(s,i));let a=[...t.data].map((i,o)=>n.type._parseSync(new E(t,i,t.path,o)));return b.mergeArray(s,a)}get element(){return this._def.type}min(e,t){return new r({...this._def,minLength:{value:e,message:h.toString(t)}})}max(e,t){return new r({...this._def,maxLength:{value:e,message:h.toString(t)}})}length(e,t){return new r({...this._def,exactLength:{value:e,message:h.toString(t)}})}nonempty(e){return this.min(1,e)}};j.create=(r,e)=>new j({type:r,minLength:null,maxLength:null,exactLength:null,typeName:p.ZodArray,...y(e)});function K(r){if(r instanceof w){let e={};for(let t in r.shape){let s=r.shape[t];e[t]=S.create(K(s))}return new w({...r._def,shape:()=>e})}else return r instanceof j?new j({...r._def,type:K(r.element)}):r instanceof S?S.create(K(r.unwrap())):r instanceof Z?Z.create(K(r.unwrap())):r instanceof O?O.create(r.items.map(e=>K(e))):r}var w=class r extends v{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=_.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==l.object){let d=this._getOrReturnCtx(e);return f(d,{code:c.invalid_type,expected:l.object,received:d.parsedType}),m}let{status:s,ctx:n}=this._processInputParams(e),{shape:a,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof C&&this._def.unknownKeys==="strip"))for(let d in n.data)i.includes(d)||o.push(d);let u=[];for(let d of i){let g=a[d],x=n.data[d];u.push({key:{status:"valid",value:d},value:g._parse(new E(n,x,n.path,d)),alwaysSet:d in n.data})}if(this._def.catchall instanceof C){let d=this._def.unknownKeys;if(d==="passthrough")for(let g of o)u.push({key:{status:"valid",value:g},value:{status:"valid",value:n.data[g]}});else if(d==="strict")o.length>0&&(f(n,{code:c.unrecognized_keys,keys:o}),s.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let d=this._def.catchall;for(let g of o){let x=n.data[g];u.push({key:{status:"valid",value:g},value:d._parse(new E(n,x,n.path,g)),alwaysSet:g in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let d=[];for(let g of u){let x=await g.key;d.push({key:x,value:await g.value,alwaysSet:g.alwaysSet})}return d}).then(d=>b.mergeObjectSync(s,d)):b.mergeObjectSync(s,u)}get shape(){return this._def.shape()}strict(e){return h.errToObj,new r({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,s)=>{var n,a,i,o;let u=(i=(a=(n=this._def).errorMap)===null||a===void 0?void 0:a.call(n,t,s).message)!==null&&i!==void 0?i:s.defaultError;return t.code==="unrecognized_keys"?{message:(o=h.errToObj(e).message)!==null&&o!==void 0?o:u}:{message:u}}}:{}})}strip(){return new r({...this._def,unknownKeys:"strip"})}passthrough(){return new r({...this._def,unknownKeys:"passthrough"})}extend(e){return new r({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new r({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:p.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new r({...this._def,catchall:e})}pick(e){let t={};return _.objectKeys(e).forEach(s=>{e[s]&&this.shape[s]&&(t[s]=this.shape[s])}),new r({...this._def,shape:()=>t})}omit(e){let t={};return _.objectKeys(this.shape).forEach(s=>{e[s]||(t[s]=this.shape[s])}),new r({...this._def,shape:()=>t})}deepPartial(){return K(this)}partial(e){let t={};return _.objectKeys(this.shape).forEach(s=>{let n=this.shape[s];e&&!e[s]?t[s]=n:t[s]=n.optional()}),new r({...this._def,shape:()=>t})}required(e){let t={};return _.objectKeys(this.shape).forEach(s=>{if(e&&!e[s])t[s]=this.shape[s];else{let a=this.shape[s];for(;a instanceof S;)a=a._def.innerType;t[s]=a}}),new r({...this._def,shape:()=>t})}keyof(){return Ne(_.objectKeys(this.shape))}};w.create=(r,e)=>new w({shape:()=>r,unknownKeys:"strip",catchall:C.create(),typeName:p.ZodObject,...y(e)});w.strictCreate=(r,e)=>new w({shape:()=>r,unknownKeys:"strict",catchall:C.create(),typeName:p.ZodObject,...y(e)});w.lazycreate=(r,e)=>new w({shape:r,unknownKeys:"strip",catchall:C.create(),typeName:p.ZodObject,...y(e)});var B=class extends v{_parse(e){let{ctx:t}=this._processInputParams(e),s=this._def.options;function n(a){for(let o of a)if(o.result.status==="valid")return o.result;for(let o of a)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;let i=a.map(o=>new T(o.ctx.common.issues));return f(t,{code:c.invalid_union,unionErrors:i}),m}if(t.common.async)return Promise.all(s.map(async a=>{let i={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:i}),ctx:i}})).then(n);{let a,i=[];for(let u of s){let d={...t,common:{...t.common,issues:[]},parent:null},g=u._parseSync({data:t.data,path:t.path,parent:d});if(g.status==="valid")return g;g.status==="dirty"&&!a&&(a={result:g,ctx:d}),d.common.issues.length&&i.push(d.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;let o=i.map(u=>new T(u));return f(t,{code:c.invalid_union,unionErrors:o}),m}}get options(){return this._def.options}};B.create=(r,e)=>new B({options:r,typeName:p.ZodUnion,...y(e)});var ce=r=>r instanceof Y?ce(r.schema):r instanceof A?ce(r.innerType()):r instanceof H?[r.value]:r instanceof J?r.options:r instanceof G?Object.keys(r.enum):r instanceof W?ce(r._def.innerType):r instanceof $?[void 0]:r instanceof L?[null]:null,fe=class r extends v{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==l.object)return f(t,{code:c.invalid_type,expected:l.object,received:t.parsedType}),m;let s=this.discriminator,n=t.data[s],a=this.optionsMap.get(n);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(f(t,{code:c.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),m)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,s){let n=new Map;for(let a of t){let i=ce(a.shape[e]);if(!i)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let o of i){if(n.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);n.set(o,a)}}return new r({typeName:p.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...y(s)})}};function we(r,e){let t=N(r),s=N(e);if(r===e)return{valid:!0,data:r};if(t===l.object&&s===l.object){let n=_.objectKeys(e),a=_.objectKeys(r).filter(o=>n.indexOf(o)!==-1),i={...r,...e};for(let o of a){let u=we(r[o],e[o]);if(!u.valid)return{valid:!1};i[o]=u.data}return{valid:!0,data:i}}else if(t===l.array&&s===l.array){if(r.length!==e.length)return{valid:!1};let n=[];for(let a=0;a<r.length;a++){let i=r[a],o=e[a],u=we(i,o);if(!u.valid)return{valid:!1};n.push(u.data)}return{valid:!0,data:n}}else return t===l.date&&s===l.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}var q=class extends v{_parse(e){let{status:t,ctx:s}=this._processInputParams(e),n=(a,i)=>{if(be(a)||be(i))return m;let o=we(a.value,i.value);return o.valid?((ke(a)||ke(i))&&t.dirty(),{status:t.value,value:o.data}):(f(s,{code:c.invalid_intersection_types}),m)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([a,i])=>n(a,i)):n(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}};q.create=(r,e,t)=>new q({left:r,right:e,typeName:p.ZodIntersection,...y(t)});var O=class r extends v{_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==l.array)return f(s,{code:c.invalid_type,expected:l.array,received:s.parsedType}),m;if(s.data.length<this._def.items.length)return f(s,{code:c.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),m;!this._def.rest&&s.data.length>this._def.items.length&&(f(s,{code:c.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let a=[...s.data].map((i,o)=>{let u=this._def.items[o]||this._def.rest;return u?u._parse(new E(s,i,s.path,o)):null}).filter(i=>!!i);return s.common.async?Promise.all(a).then(i=>b.mergeArray(t,i)):b.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new r({...this._def,rest:e})}};O.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new O({items:r,typeName:p.ZodTuple,rest:null,...y(e)})};var he=class r extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==l.object)return f(s,{code:c.invalid_type,expected:l.object,received:s.parsedType}),m;let n=[],a=this._def.keyType,i=this._def.valueType;for(let o in s.data)n.push({key:a._parse(new E(s,o,s.path,o)),value:i._parse(new E(s,s.data[o],s.path,o))});return s.common.async?b.mergeObjectAsync(t,n):b.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,s){return t instanceof v?new r({keyType:e,valueType:t,typeName:p.ZodRecord,...y(s)}):new r({keyType:R.create(),valueType:e,typeName:p.ZodRecord,...y(t)})}},F=class extends v{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==l.map)return f(s,{code:c.invalid_type,expected:l.map,received:s.parsedType}),m;let n=this._def.keyType,a=this._def.valueType,i=[...s.data.entries()].map(([o,u],d)=>({key:n._parse(new E(s,o,s.path,[d,"key"])),value:a._parse(new E(s,u,s.path,[d,"value"]))}));if(s.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let u of i){let d=await u.key,g=await u.value;if(d.status==="aborted"||g.status==="aborted")return m;(d.status==="dirty"||g.status==="dirty")&&t.dirty(),o.set(d.value,g.value)}return{status:t.value,value:o}})}else{let o=new Map;for(let u of i){let d=u.key,g=u.value;if(d.status==="aborted"||g.status==="aborted")return m;(d.status==="dirty"||g.status==="dirty")&&t.dirty(),o.set(d.value,g.value)}return{status:t.value,value:o}}}};F.create=(r,e,t)=>new F({valueType:e,keyType:r,typeName:p.ZodMap,...y(t)});var ee=class r extends v{_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==l.set)return f(s,{code:c.invalid_type,expected:l.set,received:s.parsedType}),m;let n=this._def;n.minSize!==null&&s.data.size<n.minSize.value&&(f(s,{code:c.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),n.maxSize!==null&&s.data.size>n.maxSize.value&&(f(s,{code:c.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());let a=this._def.valueType;function i(u){let d=new Set;for(let g of u){if(g.status==="aborted")return m;g.status==="dirty"&&t.dirty(),d.add(g.value)}return{status:t.value,value:d}}let o=[...s.data.values()].map((u,d)=>a._parse(new E(s,u,s.path,d)));return s.common.async?Promise.all(o).then(u=>i(u)):i(o)}min(e,t){return new r({...this._def,minSize:{value:e,message:h.toString(t)}})}max(e,t){return new r({...this._def,maxSize:{value:e,message:h.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};ee.create=(r,e)=>new ee({valueType:r,minSize:null,maxSize:null,typeName:p.ZodSet,...y(e)});var pe=class r extends v{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==l.function)return f(t,{code:c.invalid_type,expected:l.function,received:t.parsedType}),m;function s(o,u){return ue({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,de(),ae].filter(d=>!!d),issueData:{code:c.invalid_arguments,argumentsError:u}})}function n(o,u){return ue({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,de(),ae].filter(d=>!!d),issueData:{code:c.invalid_return_type,returnTypeError:u}})}let a={errorMap:t.common.contextualErrorMap},i=t.data;if(this._def.returns instanceof V){let o=this;return k(async function(...u){let d=new T([]),g=await o._def.args.parseAsync(u,a).catch(ye=>{throw d.addIssue(s(u,ye)),d}),x=await Reflect.apply(i,this,g);return await o._def.returns._def.type.parseAsync(x,a).catch(ye=>{throw d.addIssue(n(x,ye)),d})})}else{let o=this;return k(function(...u){let d=o._def.args.safeParse(u,a);if(!d.success)throw new T([s(u,d.error)]);let g=Reflect.apply(i,this,d.data),x=o._def.returns.safeParse(g,a);if(!x.success)throw new T([n(g,x.error)]);return x.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new r({...this._def,args:O.create(e).rest(I.create())})}returns(e){return new r({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,s){return new r({args:e||O.create([]).rest(I.create()),returns:t||I.create(),typeName:p.ZodFunction,...y(s)})}},Y=class extends v{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};Y.create=(r,e)=>new Y({getter:r,typeName:p.ZodLazy,...y(e)});var H=class extends v{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return f(t,{received:t.data,code:c.invalid_literal,expected:this._def.value}),m}return{status:"valid",value:e.data}}get value(){return this._def.value}};H.create=(r,e)=>new H({value:r,typeName:p.ZodLiteral,...y(e)});function Ne(r,e){return new J({values:r,typeName:p.ZodEnum,...y(e)})}var J=class r extends v{_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),s=this._def.values;return f(t,{expected:_.joinValues(s),received:t.parsedType,code:c.invalid_type}),m}if(this._def.values.indexOf(e.data)===-1){let t=this._getOrReturnCtx(e),s=this._def.values;return f(t,{received:t.data,code:c.invalid_enum_value,options:s}),m}return k(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e){return r.create(e)}exclude(e){return r.create(this.options.filter(t=>!e.includes(t)))}};J.create=Ne;var G=class extends v{_parse(e){let t=_.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==l.string&&s.parsedType!==l.number){let n=_.objectValues(t);return f(s,{expected:_.joinValues(n),received:s.parsedType,code:c.invalid_type}),m}if(t.indexOf(e.data)===-1){let n=_.objectValues(t);return f(s,{received:s.data,code:c.invalid_enum_value,options:n}),m}return k(e.data)}get enum(){return this._def.values}};G.create=(r,e)=>new G({values:r,typeName:p.ZodNativeEnum,...y(e)});var V=class extends v{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==l.promise&&t.common.async===!1)return f(t,{code:c.invalid_type,expected:l.promise,received:t.parsedType}),m;let s=t.parsedType===l.promise?t.data:Promise.resolve(t.data);return k(s.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}};V.create=(r,e)=>new V({type:r,typeName:p.ZodPromise,...y(e)});var A=class extends v{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===p.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:s}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:i=>{f(s,i),i.fatal?t.abort():t.dirty()},get path(){return s.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="preprocess"){let i=n.transform(s.data,a);return s.common.issues.length?{status:"dirty",value:s.data}:s.common.async?Promise.resolve(i).then(o=>this._def.schema._parseAsync({data:o,path:s.path,parent:s})):this._def.schema._parseSync({data:i,path:s.path,parent:s})}if(n.type==="refinement"){let i=o=>{let u=n.refinement(o,a);if(s.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(s.common.async===!1){let o=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return o.status==="aborted"?m:(o.status==="dirty"&&t.dirty(),i(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(o=>o.status==="aborted"?m:(o.status==="dirty"&&t.dirty(),i(o.value).then(()=>({status:t.value,value:o.value}))))}if(n.type==="transform")if(s.common.async===!1){let i=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!ie(i))return i;let o=n.transform(i.value,a);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(i=>ie(i)?Promise.resolve(n.transform(i.value,a)).then(o=>({status:t.value,value:o})):i);_.assertNever(n)}};A.create=(r,e,t)=>new A({schema:r,typeName:p.ZodEffects,effect:e,...y(t)});A.createWithPreprocess=(r,e,t)=>new A({schema:e,effect:{type:"preprocess",transform:r},typeName:p.ZodEffects,...y(t)});var S=class extends v{_parse(e){return this._getType(e)===l.undefined?k(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};S.create=(r,e)=>new S({innerType:r,typeName:p.ZodOptional,...y(e)});var Z=class extends v{_parse(e){return this._getType(e)===l.null?k(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Z.create=(r,e)=>new Z({innerType:r,typeName:p.ZodNullable,...y(e)});var W=class extends v{_parse(e){let{ctx:t}=this._processInputParams(e),s=t.data;return t.parsedType===l.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};W.create=(r,e)=>new W({innerType:r,typeName:p.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...y(e)});var te=class extends v{_parse(e){let{ctx:t}=this._processInputParams(e),s={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return le(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new T(s.common.issues)},input:s.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new T(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}};te.create=(r,e)=>new te({innerType:r,typeName:p.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...y(e)});var re=class extends v{_parse(e){if(this._getType(e)!==l.nan){let s=this._getOrReturnCtx(e);return f(s,{code:c.invalid_type,expected:l.nan,received:s.parsedType}),m}return{status:"valid",value:e.data}}};re.create=r=>new re({typeName:p.ZodNaN,...y(r)});var lt=Symbol("zod_brand"),me=class extends v{_parse(e){let{ctx:t}=this._processInputParams(e),s=t.data;return this._def.type._parse({data:s,path:t.path,parent:t})}unwrap(){return this._def.type}},oe=class r extends v{_parse(e){let{status:t,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{let a=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return a.status==="aborted"?m:a.status==="dirty"?(t.dirty(),Ze(a.value)):this._def.out._parseAsync({data:a.value,path:s.path,parent:s})})();{let n=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return n.status==="aborted"?m:n.status==="dirty"?(t.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:s.path,parent:s})}}static create(e,t){return new r({in:e,out:t,typeName:p.ZodPipeline})}},se=class extends v{_parse(e){let t=this._def.innerType._parse(e);return ie(t)&&(t.value=Object.freeze(t.value)),t}};se.create=(r,e)=>new se({innerType:r,typeName:p.ZodReadonly,...y(e)});var Re=(r,e={},t)=>r?M.create().superRefine((s,n)=>{var a,i;if(!r(s)){let o=typeof e=="function"?e(s):typeof e=="string"?{message:e}:e,u=(i=(a=o.fatal)!==null&&a!==void 0?a:t)!==null&&i!==void 0?i:!0,d=typeof o=="string"?{message:o}:o;n.addIssue({code:"custom",...d,fatal:u})}}):M.create(),ft={object:w.lazycreate},p;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(p||(p={}));var ht=(r,e={message:`Input not instance of ${r.name}`})=>Re(t=>t instanceof r,e),Me=R.create,Ve=P.create,pt=re.create,mt=z.create,Pe=D.create,yt=U.create,vt=X.create,gt=$.create,_t=L.create,xt=M.create,bt=I.create,kt=C.create,wt=Q.create,Tt=j.create,At=w.create,Et=w.strictCreate,St=B.create,Ct=fe.create,Ot=q.create,It=O.create,jt=he.create,Zt=F.create,Nt=ee.create,Rt=pe.create,Mt=Y.create,Vt=H.create,Pt=J.create,zt=G.create,Dt=V.create,Ie=A.create,Ut=S.create,$t=Z.create,Lt=A.createWithPreprocess,Bt=oe.create,qt=()=>Me().optional(),Yt=()=>Ve().optional(),Ht=()=>Pe().optional(),Jt={string:r=>R.create({...r,coerce:!0}),number:r=>P.create({...r,coerce:!0}),boolean:r=>D.create({...r,coerce:!0}),bigint:r=>z.create({...r,coerce:!0}),date:r=>U.create({...r,coerce:!0})},Gt=m,yr=Object.freeze({__proto__:null,defaultErrorMap:ae,setErrorMap:Qe,getErrorMap:de,makeIssue:ue,EMPTY_PATH:Fe,addIssueToContext:f,ParseStatus:b,INVALID:m,DIRTY:Ze,OK:k,isAborted:be,isDirty:ke,isValid:ie,isAsync:le,get util(){return _},get objectUtil(){return xe},ZodParsedType:l,getParsedType:N,ZodType:v,ZodString:R,ZodNumber:P,ZodBigInt:z,ZodBoolean:D,ZodDate:U,ZodSymbol:X,ZodUndefined:$,ZodNull:L,ZodAny:M,ZodUnknown:I,ZodNever:C,ZodVoid:Q,ZodArray:j,ZodObject:w,ZodUnion:B,ZodDiscriminatedUnion:fe,ZodIntersection:q,ZodTuple:O,ZodRecord:he,ZodMap:F,ZodSet:ee,ZodFunction:pe,ZodLazy:Y,ZodLiteral:H,ZodEnum:J,ZodNativeEnum:G,ZodPromise:V,ZodEffects:A,ZodTransformer:A,ZodOptional:S,ZodNullable:Z,ZodDefault:W,ZodCatch:te,ZodNaN:re,BRAND:lt,ZodBranded:me,ZodPipeline:oe,ZodReadonly:se,custom:Re,Schema:v,ZodSchema:v,late:ft,get ZodFirstPartyTypeKind(){return p},coerce:Jt,any:xt,array:Tt,bigint:mt,boolean:Pe,date:yt,discriminatedUnion:Ct,effect:Ie,enum:Pt,function:Rt,instanceof:ht,intersection:Ot,lazy:Mt,literal:Vt,map:Zt,nan:pt,nativeEnum:zt,never:kt,null:_t,nullable:$t,number:Ve,object:At,oboolean:Ht,onumber:Yt,optional:Ut,ostring:qt,pipeline:Bt,preprocess:Lt,promise:Dt,record:jt,set:Nt,strictObject:Et,string:Me,symbol:vt,transformer:Ie,tuple:It,undefined:gt,union:St,unknown:bt,void:wt,NEVER:Gt,ZodIssueCode:c,quotelessJson:Xe,ZodError:T});export{yr as a,Ee as b,er as c,pr as d};
@@ -1,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- import{a as A,c as ct,d as ht}from"./chunk-UNKGNXJ3.js";import{a as U,b as Le,e as X}from"./chunk-26VIM55J.js";import"./chunk-JG7V63GM.js";var Ti=A.enum(["necessary","functional","analytics","marketing"]),Li=A.object({purpose:A.string().describe("Purpose of the storing the value."),category:Ti.describe("Category of the storage value - necessary, functional, analytics or marketing."),lifespan:A.string().describe("Basic description of how long the value will be stored.")}),Oi=A.record(Li.describe("Key used when writing to the storage.")),Vi=A.object({value:A.string().describe("The localization token default value."),description:A.string().describe("The localization token description.")}),Di=A.object({localization:A.record(Vi.describe("Key used when getting the localized text.")).default({}).describe("Translateable texts used in the app")}),Fi=A.object({name:A.string().describe("URL friendly name of the app."),endpoints:A.string().array().default([]).describe("Endpoints that should be communicated with using the API gateway."),permissions:A.string().array().default([]).describe("Permissions that can be added to user roles."),resources:Di.default({}).describe("Resources used by the app."),storage:Oi.default({}).describe("Cookies, session storage, and local storage values that are used by the app.")}).passthrough();function lt(e,t){let i=Fi.safeParse(e);return i.success?i.data:ft(i.error.format(),t?[t]:[]).join(`
2
+ import{a as A,c as ct,d as ht}from"./chunk-EBHULZEM.js";import{a as U,b as Le,e as X}from"./chunk-26VIM55J.js";import"./chunk-JG7V63GM.js";import{existsSync as Jr,mkdirSync as en,readFileSync as Ri,writeFileSync as Te}from"node:fs";import{relative as tn,resolve as te}from"node:path";var Ti=A.enum(["necessary","functional","analytics","marketing"]),Li=A.object({purpose:A.string().describe("Purpose of the storing the value."),category:Ti.describe("Category of the storage value - necessary, functional, analytics or marketing."),lifespan:A.string().describe("Basic description of how long the value will be stored.")}),Oi=A.record(Li.describe("Key used when writing to the storage.")),Vi=A.object({value:A.string().describe("The localization token default value."),description:A.string().describe("The localization token description.")}),Di=A.object({localization:A.record(Vi.describe("Key used when getting the localized text.")).default({}).describe("Translateable texts used in the app")}),Fi=A.object({name:A.string().describe("URL friendly name of the app."),endpoints:A.string().array().default([]).describe("Endpoints that should be communicated with using the API gateway."),permissions:A.string().array().default([]).describe("Permissions that can be added to user roles."),resources:Di.default({}).describe("Resources used by the app."),storage:Oi.default({}).describe("Cookies, session storage, and local storage values that are used by the app.")}).passthrough();function lt(e,t){let i=Fi.safeParse(e);return i.success?i.data:ft(i.error.format(),t?[t]:[]).join(`
3
3
  `)}function ft(e,t=[],i=""){e._errors?.length&&t.push(`${i} - ${e._errors.join(" + ")}`);for(let[s,r]of Object.entries(e))s==="_errors"||!r||typeof r!="object"||Array.isArray(r)||ft(r,t,i?`${i}.${s}`:s);return t}function Mi(e){return Array.isArray(e)?e:e===void 0?[]:[e]}function Oe(e,t=""){let i=[];for(let s of e)for(let[r,a]of s.entries())i[r]=Math.max(i[r]||0,a.length);return e.map(s=>s.map((r,a)=>t+r[a===0?"padStart":"padEnd"](i[a])).join(" ")).join(`
4
4
  `)}function B(e){return typeof e=="function"?e():e}var Q=class extends Error{constructor(t,i){super(t),this.code=i,this.name="CLIError"}},Bi=/\d/,ji=["-","_","/","."];function Ui(e=""){if(!Bi.test(e))return e.toUpperCase()===e}function pt(e,t){let i=t??ji,s=[];if(!e||typeof e!="string")return s;let r="",a,o;for(let u of e){let c=i.includes(u);if(c===!0){s.push(r),r="",a=void 0;continue}let h=Ui(u);if(o===!1){if(a===!1&&h===!0){s.push(r),r=u,a=h;continue}if(a===!0&&h===!1&&r.length>1){let l=r[r.length-1];s.push(r.slice(0,Math.max(0,r.length-1))),r=l+u,a=h;continue}}r+=u,a=h,o=c}return s.push(r),s}function $i(e){return e?e[0].toUpperCase()+e.slice(1):""}function Gi(e){return e?e[0].toLowerCase()+e.slice(1):""}function qi(e){return e?(Array.isArray(e)?e:pt(e)).map(t=>$i(t)).join(""):""}function Wi(e){return Gi(qi(e))}function Hi(e,t){return e?(Array.isArray(e)?e:pt(e)).map(i=>i.toLowerCase()).join(t??"-"):""}function Ve(e){return e==null?[]:Array.isArray(e)?e:[e]}function zi(e,t,i,s){let r,a=e[t],o=~s.string.indexOf(t)?i==null||i===!0?"":String(i):typeof i=="boolean"?i:~s.boolean.indexOf(t)?i==="false"?!1:i==="true"||(e._.push((r=+i,r*0===0?r:i)),!!i):(r=+i,r*0===0?r:i);e[t]=a==null?o:Array.isArray(a)?a.concat(o):[a,o]}function Ki(e=[],t={}){let i,s,r,a,o,u={_:[]},c=0,h=0,l=0,f=e.length,y=t.alias!==void 0,m=t.unknown!==void 0,E=t.default!==void 0;if(t.alias=t.alias||{},t.string=Ve(t.string),t.boolean=Ve(t.boolean),y)for(i in t.alias)for(s=t.alias[i]=Ve(t.alias[i]),c=0;c<s.length;c++)(t.alias[s[c]]=s.concat(i)).splice(c,1);for(c=t.boolean.length;c-- >0;)for(s=t.alias[t.boolean[c]]||[],h=s.length;h-- >0;)t.boolean.push(s[h]);for(c=t.string.length;c-- >0;)for(s=t.alias[t.string[c]]||[],h=s.length;h-- >0;)t.string.push(s[h]);if(E){for(i in t.default)if(a=typeof t.default[i],s=t.alias[i]=t.alias[i]||[],t[a]!==void 0)for(t[a].push(i),c=0;c<s.length;c++)t[a].push(s[c])}let S=m?Object.keys(t.alias):[];for(c=0;c<f;c++){if(r=e[c],r==="--"){u._=u._.concat(e.slice(++c));break}for(h=0;h<r.length&&r.charCodeAt(h)===45;h++);if(h===0)u._.push(r);else if(r.substring(h,h+3)==="no-"){if(a=r.slice(Math.max(0,h+3)),m&&!~S.indexOf(a))return t.unknown(r);u[a]=!1}else{for(l=h+1;l<r.length&&r.charCodeAt(l)!==61;l++);for(a=r.substring(h,l),o=r.slice(Math.max(0,++l))||c+1===f||(""+e[c+1]).charCodeAt(0)===45||e[++c],s=h===2?[a]:a,l=0;l<s.length;l++){if(a=s[l],m&&!~S.indexOf(a))return t.unknown("-".repeat(h)+a);zi(u,a,l+1<s.length||o,t)}}}if(E)for(i in t.default)u[i]===void 0&&(u[i]=t.default[i]);if(y)for(i in u)for(s=t.alias[i]||[];s.length>0;)u[s.shift()]=u[i];return u}function Xi(e,t){let i={boolean:[],string:[],mixed:[],alias:{},default:{}},s=dt(t);for(let u of s)u.type!=="positional"&&(u.type==="string"?i.string.push(u.name):u.type==="boolean"&&i.boolean.push(u.name),u.default!==void 0&&(i.default[u.name]=u.default),u.alias&&(i.alias[u.name]=u.alias));let r=Ki(e,i),[...a]=r._,o=new Proxy(r,{get(u,c){return u[c]??u[Wi(c)]??u[Hi(c)]}});for(let[,u]of s.entries())if(u.type==="positional"){let c=a.shift();if(c!==void 0)o[u.name]=c;else{if(u.default===void 0&&u.required!==!1)throw new Q(`Missing required positional argument: ${u.name.toUpperCase()}`,"EARG");o[u.name]=u.default}}else if(u.required&&o[u.name]===void 0)throw new Q(`Missing required argument: --${u.name}`,"EARG");return o}function dt(e){let t=[];for(let[i,s]of Object.entries(e||{}))t.push({...s,name:i,alias:Mi(s.alias)});return t}async function mt(e,t){let i=await B(e.args||{}),s=Xi(t.rawArgs,i),r={rawArgs:t.rawArgs,args:s,data:t.data,cmd:e};typeof e.setup=="function"&&await e.setup(r);let a;try{let o=await B(e.subCommands);if(o&&Object.keys(o).length>0){let u=t.rawArgs.findIndex(h=>!h.startsWith("-")),c=t.rawArgs[u];if(c){if(!o[c])throw new Q(`Unknown command \`${c}\``,"E_UNKNOWN_COMMAND");let h=await B(o[c]);h&&await mt(h,{rawArgs:t.rawArgs.slice(u+1)})}else if(!e.run)throw new Q("No command specified.","E_NO_COMMAND")}typeof e.run=="function"&&(a=await e.run(r))}finally{typeof e.cleanup=="function"&&await e.cleanup(r)}return{result:a}}async function De(e,t,i){let s=await B(e.subCommands);if(s&&Object.keys(s).length>0){let r=t.findIndex(u=>!u.startsWith("-")),a=t[r],o=await B(s[a]);if(o)return De(o,t.slice(r+1),e)}return[e,i]}async function Qi(e,t){try{X.log(await Yi(e,t)+`
5
5
  `)}catch(i){X.error(i)}}async function Yi(e,t){let i=await B(e.meta||{}),s=dt(await B(e.args||{})),r=await B(t?.meta||{}),a=`${r.name?`${r.name} `:""}`+(i.name||process.argv[1]),o=[],u=[],c=[],h=[];for(let m of s)if(m.type==="positional"){let E=m.name.toUpperCase(),S=m.required!==!1&&m.default===void 0,R=m.default?`="${m.default}"`:"";u.push(["`"+E+R+"`",m.description||""]),h.push(S?`<${E}>`:`[${E}]`)}else{let E=m.required===!0&&m.default===void 0,S=(m.type==="boolean"&&m.default===!0?[...(m.alias||[]).map(R=>`--no-${R}`),`--no-${m.name}`].join(", "):[...(m.alias||[]).map(R=>`-${R}`),`--${m.name}`].join(", "))+(m.type==="string"&&(m.valueHint||m.default)?`=${m.valueHint?`<${m.valueHint}>`:`"${m.default||""}"`}`:"");o.push(["`"+S+(E?" (required)":"")+"`",m.description||""]),E&&h.push(S)}if(e.subCommands){let m=[],E=await B(e.subCommands);for(let[S,R]of Object.entries(E)){let K=await B(R),Ni=await B(K?.meta);c.push([`\`${S}\``,Ni?.description||""]),m.push(S)}h.push(m.join("|"))}let l=[],f=i.version||r.version;l.push(U.gray(`${i.description} (${a+(f?` v${f}`:"")})`),"");let y=o.length>0||u.length>0;return l.push(`${U.underline(U.bold("USAGE"))} \`${a}${y?" [OPTIONS]":""} ${h.join(" ")}\``,""),u.length>0&&(l.push(U.underline(U.bold("ARGUMENTS")),""),l.push(Oe(u," ")),l.push("")),o.length>0&&(l.push(U.underline(U.bold("OPTIONS")),""),l.push(Oe(o," ")),l.push("")),c.length>0&&(l.push(U.underline(U.bold("COMMANDS")),""),l.push(Oe(c," ")),l.push("",`Use \`${a} <command> --help\` for more information about a command.`)),l.filter(m=>typeof m=="string").join(`
6
6
  `)}async function gt(e,t={}){let i=t.rawArgs||process.argv.slice(2),s=t.showUsage||Qi;try{if(i.includes("--help")||i.includes("-h"))await s(...await De(e,i)),process.exit(0);else if(i.length===1&&i[0]==="--version"){let r=typeof e.meta=="function"?await e.meta():await e.meta;if(!r?.version)throw new Q("No version specified","E_NO_VERSION");X.log(r.version)}else await mt(e,{rawArgs:i})}catch(r){let a=r instanceof Q;a||X.error(r,`
7
- `),a&&await s(...await De(e,i)),X.error(r.message),process.exit(1)}}import{existsSync as Jr,mkdirSync as en,readFileSync as Ri,writeFileSync as Te}from"node:fs";import{relative as tn,resolve as te}from"node:path";import{statSync as Hr,promises as zr}from"node:fs";function xt(e=""){return!e||!e.includes("\\")?e:e.replace(/\\/g,"/")}var Zi=/^[/\\]{2}/,Ji=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,es=/^[A-Za-z]:$/;var Fe=function(e){if(e.length===0)return".";e=xt(e);let t=e.match(Zi),i=q(e),s=e[e.length-1]==="/";return e=Be(e,!i),e.length===0?i?"/":s?"./":".":(s&&(e+="/"),es.test(e)&&(e+="/"),t?i?`//${e}`:`//./${e}`:i&&!q(e)?`/${e}`:e)},xe=function(...e){if(e.length===0)return".";let t;for(let i of e)i&&i.length>0&&(t===void 0?t=i:t+=`/${i}`);return t===void 0?".":Fe(t.replace(/\/\/+/g,"/"))};function ts(){return typeof process<"u"?process.cwd().replace(/\\/g,"/"):"/"}var Me=function(...e){e=e.map(s=>xt(s));let t="",i=!1;for(let s=e.length-1;s>=-1&&!i;s--){let r=s>=0?e[s]:ts();!r||r.length===0||(t=`${r}/${t}`,i=q(r))}return t=Be(t,!i),i&&!q(t)?`/${t}`:t.length>0?t:"."};function Be(e,t){let i="",s=0,r=-1,a=0,o=null;for(let u=0;u<=e.length;++u){if(u<e.length)o=e[u];else{if(o==="/")break;o="/"}if(o==="/"){if(!(r===u-1||a===1))if(a===2){if(i.length<2||s!==2||i[i.length-1]!=="."||i[i.length-2]!=="."){if(i.length>2){let c=i.lastIndexOf("/");c===-1?(i="",s=0):(i=i.slice(0,c),s=i.length-1-i.lastIndexOf("/")),r=u,a=0;continue}else if(i.length>0){i="",s=0,r=u,a=0;continue}}t&&(i+=i.length>0?"/..":"..",s=2)}else i.length>0?i+=`/${e.slice(r+1,u)}`:i=e.slice(r+1,u),s=u-r-1;r=u,a=0}else o==="."&&a!==-1?++a:a=-1}return i}var q=function(e){return Ji.test(e)};var rs=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,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,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,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,406,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,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,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,983,6,110,6,6,9,4759,9,787719,239],Et=[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,68,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,71,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,349,41,7,1,79,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,159,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,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,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,757,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,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],ns="\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\u0898-\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-\u1ACE\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",Ct="\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-\u088E\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\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\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-\u1C88\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-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\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",je={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"},Ue="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",as={5:Ue,"5module":Ue+" export import",6:Ue+" const class extends export import super"},os=/^in(stanceof)?$/,us=new RegExp("["+Ct+"]"),cs=new RegExp("["+Ct+ns+"]");function Ge(e,t){for(var i=65536,s=0;s<t.length;s+=2){if(i+=t[s],i>e)return!1;if(i+=t[s+1],i>=e)return!0}return!1}function W(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&us.test(String.fromCharCode(e)):t===!1?!1:Ge(e,Et)}function ie(e,t){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&cs.test(String.fromCharCode(e)):t===!1?!1:Ge(e,Et)||Ge(e,rs)}var b=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 T(e,t){return new b(e,{beforeExpr:!0,binop:t})}var L={beforeExpr:!0},N={startsExpr:!0},He={};function v(e,t){return t===void 0&&(t={}),t.keyword=e,He[e]=new b(e,t)}var n={num:new b("num",N),regexp:new b("regexp",N),string:new b("string",N),name:new b("name",N),privateId:new b("privateId",N),eof:new b("eof"),bracketL:new b("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new b("]"),braceL:new b("{",{beforeExpr:!0,startsExpr:!0}),braceR:new b("}"),parenL:new b("(",{beforeExpr:!0,startsExpr:!0}),parenR:new b(")"),comma:new b(",",L),semi:new b(";",L),colon:new b(":",L),dot:new b("."),question:new b("?",L),questionDot:new b("?."),arrow:new b("=>",L),template:new b("template"),invalidTemplate:new b("invalidTemplate"),ellipsis:new b("...",L),backQuote:new b("`",N),dollarBraceL:new b("${",{beforeExpr:!0,startsExpr:!0}),eq:new b("=",{beforeExpr:!0,isAssign:!0}),assign:new b("_=",{beforeExpr:!0,isAssign:!0}),incDec:new b("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new b("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:T("||",1),logicalAND:T("&&",2),bitwiseOR:T("|",3),bitwiseXOR:T("^",4),bitwiseAND:T("&",5),equality:T("==/!=/===/!==",6),relational:T("</>/<=/>=",7),bitShift:T("<</>>/>>>",8),plusMin:new b("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:T("%",10),star:T("*",10),slash:T("/",10),starstar:new b("**",{beforeExpr:!0}),coalesce:T("??",1),_break:v("break"),_case:v("case",L),_catch:v("catch"),_continue:v("continue"),_debugger:v("debugger"),_default:v("default",L),_do:v("do",{isLoop:!0,beforeExpr:!0}),_else:v("else",L),_finally:v("finally"),_for:v("for",{isLoop:!0}),_function:v("function",N),_if:v("if"),_return:v("return",L),_switch:v("switch"),_throw:v("throw",L),_try:v("try"),_var:v("var"),_const:v("const"),_while:v("while",{isLoop:!0}),_with:v("with"),_new:v("new",{beforeExpr:!0,startsExpr:!0}),_this:v("this",N),_super:v("super",N),_class:v("class",N),_extends:v("extends",L),_export:v("export"),_import:v("import",N),_null:v("null",N),_true:v("true",N),_false:v("false",N),_in:v("in",{beforeExpr:!0,binop:7}),_instanceof:v("instanceof",{beforeExpr:!0,binop:7}),_typeof:v("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:v("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:v("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},D=/\r\n?|\n|\u2028|\u2029/,hs=new RegExp(D.source,"g");function se(e){return e===10||e===13||e===8232||e===8233}function St(e,t,i){i===void 0&&(i=e.length);for(var s=t;s<i;s++){var r=e.charCodeAt(s);if(se(r))return s<i-1&&r===13&&e.charCodeAt(s+1)===10?s+2:s+1}return-1}var kt=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,O=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,At=Object.prototype,ls=At.hasOwnProperty,fs=At.toString,fe=Object.hasOwn||function(e,t){return ls.call(e,t)},yt=Array.isArray||function(e){return fs.call(e)==="[object Array]"},vt=Object.create(null);function Y(e){return vt[e]||(vt[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function Z(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var ps=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,he=function(t,i){this.line=t,this.column=i};he.prototype.offset=function(t){return new he(this.line,this.column+t)};var _e=function(t,i,s){this.start=i,this.end=s,t.sourceFile!==null&&(this.source=t.sourceFile)};function Pt(e,t){for(var i=1,s=0;;){var r=St(e,s,t);if(r<0)return new he(i,t-s);++i,s=r}}var qe={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},bt=!1;function ds(e){var t={};for(var i in qe)t[i]=e&&fe(e,i)?e[i]:qe[i];if(t.ecmaVersion==="latest"?t.ecmaVersion=1e8:t.ecmaVersion==null?(!bt&&typeof console=="object"&&console.warn&&(bt=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
7
+ `),a&&await s(...await De(e,i)),X.error(r.message),process.exit(1)}}import{statSync as Hr,promises as zr}from"node:fs";function xt(e=""){return!e||!e.includes("\\")?e:e.replace(/\\/g,"/")}var Zi=/^[/\\]{2}/,Ji=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/,es=/^[A-Za-z]:$/;var Fe=function(e){if(e.length===0)return".";e=xt(e);let t=e.match(Zi),i=q(e),s=e[e.length-1]==="/";return e=Be(e,!i),e.length===0?i?"/":s?"./":".":(s&&(e+="/"),es.test(e)&&(e+="/"),t?i?`//${e}`:`//./${e}`:i&&!q(e)?`/${e}`:e)},xe=function(...e){if(e.length===0)return".";let t;for(let i of e)i&&i.length>0&&(t===void 0?t=i:t+=`/${i}`);return t===void 0?".":Fe(t.replace(/\/\/+/g,"/"))};function ts(){return typeof process<"u"?process.cwd().replace(/\\/g,"/"):"/"}var Me=function(...e){e=e.map(s=>xt(s));let t="",i=!1;for(let s=e.length-1;s>=-1&&!i;s--){let r=s>=0?e[s]:ts();!r||r.length===0||(t=`${r}/${t}`,i=q(r))}return t=Be(t,!i),i&&!q(t)?`/${t}`:t.length>0?t:"."};function Be(e,t){let i="",s=0,r=-1,a=0,o=null;for(let u=0;u<=e.length;++u){if(u<e.length)o=e[u];else{if(o==="/")break;o="/"}if(o==="/"){if(!(r===u-1||a===1))if(a===2){if(i.length<2||s!==2||i[i.length-1]!=="."||i[i.length-2]!=="."){if(i.length>2){let c=i.lastIndexOf("/");c===-1?(i="",s=0):(i=i.slice(0,c),s=i.length-1-i.lastIndexOf("/")),r=u,a=0;continue}else if(i.length>0){i="",s=0,r=u,a=0;continue}}t&&(i+=i.length>0?"/..":"..",s=2)}else i.length>0?i+=`/${e.slice(r+1,u)}`:i=e.slice(r+1,u),s=u-r-1;r=u,a=0}else o==="."&&a!==-1?++a:a=-1}return i}var q=function(e){return Ji.test(e)};var rs=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,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,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,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,406,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,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,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,983,6,110,6,6,9,4759,9,787719,239],Et=[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,68,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,71,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,349,41,7,1,79,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,159,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,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,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,757,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,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],ns="\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\u0898-\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-\u1ACE\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",Ct="\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-\u088E\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\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\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-\u1C88\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-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\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",je={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"},Ue="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",as={5:Ue,"5module":Ue+" export import",6:Ue+" const class extends export import super"},os=/^in(stanceof)?$/,us=new RegExp("["+Ct+"]"),cs=new RegExp("["+Ct+ns+"]");function Ge(e,t){for(var i=65536,s=0;s<t.length;s+=2){if(i+=t[s],i>e)return!1;if(i+=t[s+1],i>=e)return!0}return!1}function W(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&us.test(String.fromCharCode(e)):t===!1?!1:Ge(e,Et)}function ie(e,t){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&cs.test(String.fromCharCode(e)):t===!1?!1:Ge(e,Et)||Ge(e,rs)}var b=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 T(e,t){return new b(e,{beforeExpr:!0,binop:t})}var L={beforeExpr:!0},N={startsExpr:!0},He={};function v(e,t){return t===void 0&&(t={}),t.keyword=e,He[e]=new b(e,t)}var n={num:new b("num",N),regexp:new b("regexp",N),string:new b("string",N),name:new b("name",N),privateId:new b("privateId",N),eof:new b("eof"),bracketL:new b("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new b("]"),braceL:new b("{",{beforeExpr:!0,startsExpr:!0}),braceR:new b("}"),parenL:new b("(",{beforeExpr:!0,startsExpr:!0}),parenR:new b(")"),comma:new b(",",L),semi:new b(";",L),colon:new b(":",L),dot:new b("."),question:new b("?",L),questionDot:new b("?."),arrow:new b("=>",L),template:new b("template"),invalidTemplate:new b("invalidTemplate"),ellipsis:new b("...",L),backQuote:new b("`",N),dollarBraceL:new b("${",{beforeExpr:!0,startsExpr:!0}),eq:new b("=",{beforeExpr:!0,isAssign:!0}),assign:new b("_=",{beforeExpr:!0,isAssign:!0}),incDec:new b("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new b("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:T("||",1),logicalAND:T("&&",2),bitwiseOR:T("|",3),bitwiseXOR:T("^",4),bitwiseAND:T("&",5),equality:T("==/!=/===/!==",6),relational:T("</>/<=/>=",7),bitShift:T("<</>>/>>>",8),plusMin:new b("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:T("%",10),star:T("*",10),slash:T("/",10),starstar:new b("**",{beforeExpr:!0}),coalesce:T("??",1),_break:v("break"),_case:v("case",L),_catch:v("catch"),_continue:v("continue"),_debugger:v("debugger"),_default:v("default",L),_do:v("do",{isLoop:!0,beforeExpr:!0}),_else:v("else",L),_finally:v("finally"),_for:v("for",{isLoop:!0}),_function:v("function",N),_if:v("if"),_return:v("return",L),_switch:v("switch"),_throw:v("throw",L),_try:v("try"),_var:v("var"),_const:v("const"),_while:v("while",{isLoop:!0}),_with:v("with"),_new:v("new",{beforeExpr:!0,startsExpr:!0}),_this:v("this",N),_super:v("super",N),_class:v("class",N),_extends:v("extends",L),_export:v("export"),_import:v("import",N),_null:v("null",N),_true:v("true",N),_false:v("false",N),_in:v("in",{beforeExpr:!0,binop:7}),_instanceof:v("instanceof",{beforeExpr:!0,binop:7}),_typeof:v("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:v("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:v("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},D=/\r\n?|\n|\u2028|\u2029/,hs=new RegExp(D.source,"g");function se(e){return e===10||e===13||e===8232||e===8233}function St(e,t,i){i===void 0&&(i=e.length);for(var s=t;s<i;s++){var r=e.charCodeAt(s);if(se(r))return s<i-1&&r===13&&e.charCodeAt(s+1)===10?s+2:s+1}return-1}var kt=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,O=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,At=Object.prototype,ls=At.hasOwnProperty,fs=At.toString,fe=Object.hasOwn||function(e,t){return ls.call(e,t)},yt=Array.isArray||function(e){return fs.call(e)==="[object Array]"},vt=Object.create(null);function Y(e){return vt[e]||(vt[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function Z(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var ps=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,he=function(t,i){this.line=t,this.column=i};he.prototype.offset=function(t){return new he(this.line,this.column+t)};var _e=function(t,i,s){this.start=i,this.end=s,t.sourceFile!==null&&(this.source=t.sourceFile)};function Pt(e,t){for(var i=1,s=0;;){var r=St(e,s,t);if(r<0)return new he(i,t-s);++i,s=r}}var qe={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},bt=!1;function ds(e){var t={};for(var i in qe)t[i]=e&&fe(e,i)?e[i]:qe[i];if(t.ecmaVersion==="latest"?t.ecmaVersion=1e8:t.ecmaVersion==null?(!bt&&typeof console=="object"&&console.warn&&(bt=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
8
8
  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),yt(t.onToken)){var s=t.onToken;t.onToken=function(r){return s.push(r)}}return yt(t.onComment)&&(t.onComment=ms(t,t.onComment)),t}function ms(e,t){return function(i,s,r,a,o,u){var c={type:i?"Block":"Line",value:s,start:r,end:a};e.locations&&(c.loc=new _e(this,o,u)),e.ranges&&(c.range=[r,a]),t.push(c)}}var le=1,re=2,ze=4,It=8,Rt=16,Nt=32,Ke=64,Tt=128,pe=256,Xe=le|re|pe;function Qe(e,t){return re|(e?ze:0)|(t?It:0)}var ve=0,Ye=1,z=2,Lt=3,Ot=4,Vt=5,k=function(t,i,s){this.options=t=ds(t),this.sourceFile=t.sourceFile,this.keywords=Y(as[t.ecmaVersion>=6?6:t.sourceType==="module"?"5module":5]);var r="";t.allowReserved!==!0&&(r=je[t.ecmaVersion>=6?6:t.ecmaVersion===5?5:3],t.sourceType==="module"&&(r+=" await")),this.reservedWords=Y(r);var a=(r?r+" ":"")+je.strict;this.reservedWordsStrict=Y(a),this.reservedWordsStrictBind=Y(a+" "+je.strictBind),this.input=String(i),this.containsEsc=!1,s?(this.pos=s,this.lineStart=this.input.lastIndexOf(`
9
9
  `,s-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(D).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=!0,this.inModule=t.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,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(le),this.regexpState=null,this.privateNameStack=[]},$={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};k.prototype.parse=function(){var t=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(t)};$.inFunction.get=function(){return(this.currentVarScope().flags&re)>0};$.inGenerator.get=function(){return(this.currentVarScope().flags&It)>0&&!this.currentVarScope().inClassFieldInit};$.inAsync.get=function(){return(this.currentVarScope().flags&ze)>0&&!this.currentVarScope().inClassFieldInit};$.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e];if(t.inClassFieldInit||t.flags&pe)return!1;if(t.flags&re)return(t.flags&ze)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};$.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags,i=e.inClassFieldInit;return(t&Ke)>0||i||this.options.allowSuperOutsideMethod};$.allowDirectSuper.get=function(){return(this.currentThisScope().flags&Tt)>0};$.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};$.allowNewDotTarget.get=function(){var e=this.currentThisScope(),t=e.flags,i=e.inClassFieldInit;return(t&(re|pe))>0||i};$.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&pe)>0};k.extend=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];for(var s=this,r=0;r<t.length;r++)s=t[r](s);return s};k.parse=function(t,i){return new this(i,t).parse()};k.parseExpressionAt=function(t,i,s){var r=new this(s,t,i);return r.nextToken(),r.parseExpression()};k.tokenizer=function(t,i){return new this(i,t)};Object.defineProperties(k.prototype,$);var P=k.prototype,gs=/^(?:'((?:\\.|[^'\\])*?)'|"((?:\\.|[^"\\])*?)")/;P.strictDirective=function(e){if(this.options.ecmaVersion<5)return!1;for(;;){O.lastIndex=e,e+=O.exec(this.input)[0].length;var t=gs.exec(this.input.slice(e));if(!t)return!1;if((t[1]||t[2])==="use strict"){O.lastIndex=e+t[0].length;var i=O.exec(this.input),s=i.index+i[0].length,r=this.input.charAt(s);return r===";"||r==="}"||D.test(i[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(r)||r==="!"&&this.input.charAt(s+1)==="=")}e+=t[0].length,O.lastIndex=e,e+=O.exec(this.input)[0].length,this.input[e]===";"&&e++}};P.eat=function(e){return this.type===e?(this.next(),!0):!1};P.isContextual=function(e){return this.type===n.name&&this.value===e&&!this.containsEsc};P.eatContextual=function(e){return this.isContextual(e)?(this.next(),!0):!1};P.expectContextual=function(e){this.eatContextual(e)||this.unexpected()};P.canInsertSemicolon=function(){return this.type===n.eof||this.type===n.braceR||D.test(this.input.slice(this.lastTokEnd,this.start))};P.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0};P.semicolon=function(){!this.eat(n.semi)&&!this.insertSemicolon()&&this.unexpected()};P.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),!0};P.expect=function(e){this.eat(e)||this.unexpected()};P.unexpected=function(e){this.raise(e??this.start,"Unexpected token")};var Ee=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};P.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")}};P.checkExpressionErrors=function(e,t){if(!e)return!1;var i=e.shorthandAssign,s=e.doubleProto;if(!t)return i>=0||s>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),s>=0&&this.raiseRecoverable(s,"Redefinition of __proto__ property")};P.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")};P.isSimpleAssignTarget=function(e){return e.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(e.expression):e.type==="Identifier"||e.type==="MemberExpression"};var d=k.prototype;d.parseTopLevel=function(e){var t=Object.create(null);for(e.body||(e.body=[]);this.type!==n.eof;){var i=this.parseStatement(null,!0,t);e.body.push(i)}if(this.inModule)for(var s=0,r=Object.keys(this.undefinedExports);s<r.length;s+=1){var a=r[s];this.raiseRecoverable(this.undefinedExports[a].start,"Export '"+a+"' is not defined")}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType,this.finishNode(e,"Program")};var Ze={kind:"loop"},xs={kind:"switch"};d.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;O.lastIndex=this.pos;var t=O.exec(this.input),i=this.pos+t[0].length,s=this.input.charCodeAt(i);if(s===91||s===92)return!0;if(e)return!1;if(s===123||s>55295&&s<56320)return!0;if(W(s,!0)){for(var r=i+1;ie(s=this.input.charCodeAt(r),!0);)++r;if(s===92||s>55295&&s<56320)return!0;var a=this.input.slice(i,r);if(!os.test(a))return!0}return!1};d.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;O.lastIndex=this.pos;var e=O.exec(this.input),t=this.pos+e[0].length,i;return!D.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)==="function"&&(t+8===this.input.length||!(ie(i=this.input.charCodeAt(t+8))||i>55295&&i<56320))};d.parseStatement=function(e,t,i){var s=this.type,r=this.startNode(),a;switch(this.isLet(e)&&(s=n._var,a="let"),s){case n._break:case n._continue:return this.parseBreakContinueStatement(r,s.keyword);case n._debugger:return this.parseDebuggerStatement(r);case n._do:return this.parseDoStatement(r);case n._for:return this.parseForStatement(r);case n._function:return e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(r,!1,!e);case n._class:return e&&this.unexpected(),this.parseClass(r,!0);case n._if:return this.parseIfStatement(r);case n._return:return this.parseReturnStatement(r);case n._switch:return this.parseSwitchStatement(r);case n._throw:return this.parseThrowStatement(r);case n._try:return this.parseTryStatement(r);case n._const:case n._var:return a=a||this.value,e&&a!=="var"&&this.unexpected(),this.parseVarStatement(r,a);case n._while:return this.parseWhileStatement(r);case n._with:return this.parseWithStatement(r);case n.braceL:return this.parseBlock(!0,r);case n.semi:return this.parseEmptyStatement(r);case n._export:case n._import:if(this.options.ecmaVersion>10&&s===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(r,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'")),s===n._import?this.parseImport(r):this.parseExport(r,i);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(r,!0,!e);var h=this.value,l=this.parseExpression();return s===n.name&&l.type==="Identifier"&&this.eat(n.colon)?this.parseLabeledStatement(r,h,l,e):this.parseExpressionStatement(r,l)}};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 s=0;s<this.labels.length;++s){var r=this.labels[s];if((e.label==null||r.name===e.label.name)&&(r.kind!=null&&(i||r.kind==="loop")||e.label&&i))break}return s===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(Ze),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(Ze),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 s=this.startNode(),r=i?"let":this.value;return this.next(),this.parseVar(s,!0,r),this.finishNode(s,"VariableDeclaration"),(this.type===n._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&s.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===n._in?t>-1&&this.unexpected(t):e.await=t>-1),this.parseForIn(e,s)):(t>-1&&this.unexpected(t),this.parseFor(e,s))}var a=this.isContextual("let"),o=!1,u=new Ee,c=this.parseExpression(t>-1?"await":!0,u);return this.type===n._in||(o=this.options.ecmaVersion>=6&&this.isContextual("of"))?(this.options.ecmaVersion>=9&&(this.type===n._in?t>-1&&this.unexpected(t):e.await=t>-1),a&&o&&this.raise(c.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(c,!1,u),this.checkLValPattern(c),this.parseForIn(e,c)):(this.checkExpressionErrors(u,!0),t>-1&&this.unexpected(t),this.parseFor(e,c))};d.parseFunctionStatement=function(e,t,i){return this.next(),this.parseFunction(e,ce|(i?0:We),!1,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.inFunction&&!this.options.allowReturnOutsideFunction&&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(xs),this.enterScope(0);for(var t,i=!1;this.type!==n.braceR;)if(this.type===n._case||this.type===n._default){var s=this.type===n._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),s?t.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=!0,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(),D.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 ys=[];d.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type==="Identifier";return this.enterScope(t?Nt:0),this.checkLValPattern(e,t?Ot:z),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(!1),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,!1,t,i),this.semicolon(),this.finishNode(e,"VariableDeclaration")};d.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(Ze),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,s){for(var r=0,a=this.labels;r<a.length;r+=1){var o=a[r];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 h=this.labels[c];if(h.statementStart===e.start)h.statementStart=this.start,h.kind=u;else break}return this.labels.push({name:t,kind:u,statementStart:this.start}),e.body=this.parseStatement(s?s.indexOf("label")===-1?s+"label":s:"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=!0),t===void 0&&(t=this.startNode()),t.body=[],this.expect(n.braceL),e&&this.enterScope(0);this.type!==n.braceR;){var s=this.parseStatement(null);t.body.push(s)}return i&&(this.strict=!1),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,s){for(e.declarations=[],e.kind=i;;){var r=this.startNode();if(this.parseVarId(r,i),this.eat(n.eq)?r.init=this.parseMaybeAssign(t):!s&&i==="const"&&!(this.type===n._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!s&&r.id.type!=="Identifier"&&!(t&&(this.type===n._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):r.init=null,e.declarations.push(this.finishNode(r,"VariableDeclarator")),!this.eat(n.comma))break}return e};d.parseVarId=function(e,t){e.id=this.parseBindingAtom(),this.checkLValPattern(e.id,t==="var"?Ye:z,!1)};var ce=1,We=2,Dt=4;d.parseFunction=function(e,t,i,s,r){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!s)&&(this.type===n.star&&t&We&&this.unexpected(),e.generator=this.eat(n.star)),this.options.ecmaVersion>=8&&(e.async=!!s),t&ce&&(e.id=t&Dt&&this.type!==n.name?null:this.parseIdent(),e.id&&!(t&We)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?Ye:z:Lt));var a=this.yieldPos,o=this.awaitPos,u=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Qe(e.async,e.generator)),t&ce||(e.id=this.type===n.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,i,!1,r),this.yieldPos=a,this.awaitPos=o,this.awaitIdentPos=u,this.finishNode(e,t&ce?"FunctionDeclaration":"FunctionExpression")};d.parseFunctionParams=function(e){this.expect(n.parenL),e.params=this.parseBindingList(n.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()};d.parseClass=function(e,t){this.next();var i=this.strict;this.strict=!0,this.parseClassId(e,t),this.parseClassSuper(e);var s=this.enterClassBody(),r=this.startNode(),a=!1;for(r.body=[],this.expect(n.braceL);this.type!==n.braceR;){var o=this.parseClassElement(e.superClass!==null);o&&(r.body.push(o),o.type==="MethodDefinition"&&o.kind==="constructor"?(a&&this.raiseRecoverable(o.start,"Duplicate constructor in the same class"),a=!0):o.key&&o.key.type==="PrivateIdentifier"&&vs(s,o)&&this.raiseRecoverable(o.key.start,"Identifier '#"+o.key.name+"' has already been declared"))}return this.strict=i,this.next(),e.body=this.finishNode(r,"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(),s="",r=!1,a=!1,o="method",u=!1;if(this.eatContextual("static")){if(t>=13&&this.eat(n.braceL))return this.parseClassStaticBlock(i),i;this.isClassElementNameStart()||this.type===n.star?u=!0:s="static"}if(i.static=u,!s&&t>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===n.star)&&!this.canInsertSemicolon()?a=!0:s="async"),!s&&(t>=9||!a)&&this.eat(n.star)&&(r=!0),!s&&!a&&!r){var c=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?o=c:s=c)}if(s?(i.computed=!1,i.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),i.key.name=s,this.finishNode(i.key,"Identifier")):this.parseClassElementName(i),t<13||this.type===n.parenL||o!=="method"||r||a){var h=!i.static&&be(i,"constructor"),l=h&&e;h&&o!=="method"&&this.raise(i.key.start,"Constructor can't have get/set modifier"),i.kind=h?"constructor":o,this.parseClassMethod(i,r,a,l)}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=!1,e.key=this.parsePrivateIdent()):this.parsePropertyName(e)};d.parseClassMethod=function(e,t,i,s){var r=e.key;e.kind==="constructor"?(t&&this.raise(r.start,"Constructor can't be a generator"),i&&this.raise(r.start,"Constructor can't be an async method")):e.static&&be(e,"prototype")&&this.raise(r.start,"Classes may not have a static property named prototype");var a=e.value=this.parseMethod(t,i,s);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){if(be(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&be(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(n.eq)){var t=this.currentThisScope(),i=t.inClassFieldInit;t.inClassFieldInit=!0,e.value=this.parseMaybeAssign(),t.inClassFieldInit=i}else e.value=null;return this.semicolon(),this.finishNode(e,"PropertyDefinition")};d.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(pe|Ke);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,z,!1)):(t===!0&&this.unexpected(),e.id=null)};d.parseClassSuper=function(e){e.superClass=this.eat(n._extends)?this.parseExprSubscripts(null,!1):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 s=this.privateNameStack.length,r=s===0?null:this.privateNameStack[s-1],a=0;a<i.length;++a){var o=i[a];fe(t,o.name)||(r?r.used.push(o):this.raiseRecoverable(o.start,"Private field '#"+o.name+"' must be declared in an enclosing class"))}};function vs(e,t){var i=t.key.name,s=e[i],r="true";return t.type==="MethodDefinition"&&(t.kind==="get"||t.kind==="set")&&(r=(t.static?"s":"i")+t.kind),s==="iget"&&r==="iset"||s==="iset"&&r==="iget"||s==="sget"&&r==="sset"||s==="sset"&&r==="sget"?(e[i]="true",!1):s?!0:(e[i]=r,!1)}function be(e,t){var i=e.computed,s=e.key;return!i&&(s.type==="Identifier"&&s.name===t||s.type==="Literal"&&s.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.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;else{if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==n.string&&this.unexpected(),e.source=this.parseExprAtom();else{for(var i=0,s=e.specifiers;i<s.length;i+=1){var r=s[i];this.checkUnreserved(r.local),this.checkLocalExport(r.local),r.local.type==="Literal"&&this.raise(r.local.start,"A string literal cannot be used as an exported binding without `from`.")}e.source=null}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,ce|Dt,!1,e)}else if(this.type===n._class){var i=this.startNode();return this.parseClass(i,"nullableID")}else{var s=this.parseMaybeAssign();return this.semicolon(),s}};d.checkExport=function(e,t,i){e&&(typeof t!="string"&&(t=t.type==="Identifier"?t.name:t.value),fe(e,t)&&this.raiseRecoverable(i,"Duplicate export '"+t+"'"),e[t]=!0)};d.checkPatternExport=function(e,t){var i=t.type;if(i==="Identifier")this.checkExport(e,t,t.start);else if(i==="ObjectPattern")for(var s=0,r=t.properties;s<r.length;s+=1){var a=r[s];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,s=t;i<s.length;i+=1){var r=s[i];this.checkPatternExport(e,r.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=!0;for(this.expect(n.braceL);!this.eat(n.braceR);){if(i)i=!1;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=ys,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===n.string?this.parseExprAtom():this.unexpected()),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,z),this.finishNode(e,"ImportSpecifier")};d.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,z),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,z),this.finishNode(e,"ImportNamespaceSpecifier")};d.parseImportSpecifiers=function(){var e=[],t=!0;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=!1;else if(this.expect(n.comma),this.afterTrailingComma(n.braceR))break;e.push(this.parseImportSpecifier())}return e};d.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===n.string){var e=this.parseLiteral(this.value);return ps.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(!0)};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 F=k.prototype;F.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,!0);for(var s=0,r=e.properties;s<r.length;s+=1){var a=r[s];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,!0),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,!0);return e};F.toAssignableList=function(e,t){for(var i=e.length,s=0;s<i;s++){var r=e[s];r&&this.toAssignable(r,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};F.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(!1,e),this.finishNode(t,"SpreadElement")};F.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")};F.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,!0,!0),this.finishNode(e,"ArrayPattern");case n.braceL:return this.parseObj(!0)}return this.parseIdent()};F.parseBindingList=function(e,t,i,s){for(var r=[],a=!0;!this.eat(e);)if(a?a=!1:this.expect(n.comma),t&&this.type===n.comma)r.push(null);else{if(i&&this.afterTrailingComma(e))break;if(this.type===n.ellipsis){var o=this.parseRestBinding();this.parseBindingListItem(o),r.push(o),this.type===n.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(e);break}else r.push(this.parseAssignableListItem(s))}return r};F.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t};F.parseBindingListItem=function(e){return e};F.parseMaybeDefault=function(e,t,i){if(i=i||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(n.eq))return i;var s=this.startNodeAt(e,t);return s.left=i,s.right=this.parseMaybeAssign(),this.finishNode(s,"AssignmentPattern")};F.checkLValSimple=function(e,t,i){t===void 0&&(t=ve);var s=t!==ve;switch(e.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(s?"Binding ":"Assigning to ")+e.name+" in strict mode"),s&&(t===z&&e.name==="let"&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),i&&(fe(i,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),i[e.name]=!0),t!==Vt&&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":s&&this.raiseRecoverable(e.start,"Binding member expression");break;case"ParenthesizedExpression":return s&&this.raiseRecoverable(e.start,"Binding parenthesized expression"),this.checkLValSimple(e.expression,t,i);default:this.raise(e.start,(s?"Binding":"Assigning to")+" rvalue")}};F.checkLValPattern=function(e,t,i){switch(t===void 0&&(t=ve),e.type){case"ObjectPattern":for(var s=0,r=e.properties;s<r.length;s+=1){var a=r[s];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)}};F.checkLValInnerPattern=function(e,t,i){switch(t===void 0&&(t=ve),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 j=function(t,i,s,r,a){this.token=t,this.isExpr=!!i,this.preserveSpace=!!s,this.override=r,this.generator=!!a},_={b_stat:new j("{",!1),b_expr:new j("{",!0),b_tmpl:new j("${",!1),p_stat:new j("(",!1),p_expr:new j("(",!0),q_tmpl:new j("`",!0,!0,function(e){return e.tryReadTemplateToken()}),f_stat:new j("function",!1),f_expr:new j("function",!0),f_expr_gen:new j("function",!0,!1,null,!0),f_gen:new j("function",!1,!1,null,!0)},ne=k.prototype;ne.initialContext=function(){return[_.b_stat]};ne.curContext=function(){return this.context[this.context.length-1]};ne.braceIsBlock=function(e){var t=this.curContext();return t===_.f_expr||t===_.f_stat?!0:e===n.colon&&(t===_.b_stat||t===_.b_expr)?!t.isExpr:e===n._return||e===n.name&&this.exprAllowed?D.test(this.input.slice(this.lastTokEnd,this.start)):e===n._else||e===n.semi||e===n.eof||e===n.parenR||e===n.arrow?!0:e===n.braceL?t===_.b_stat:e===n._var||e===n._const||e===n.name?!1:!this.exprAllowed};ne.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!1};ne.updateContext=function(e){var t,i=this.type;i.keyword&&e===n.dot?this.exprAllowed=!1:(t=i.updateContext)?t.call(this,e):this.exprAllowed=i.beforeExpr};ne.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=!0;return}var e=this.context.pop();e===_.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)?_.b_stat:_.b_expr),this.exprAllowed=!0};n.dollarBraceL.updateContext=function(){this.context.push(_.b_tmpl),this.exprAllowed=!0};n.parenL.updateContext=function(e){var t=e===n._if||e===n._for||e===n._with||e===n._while;this.context.push(t?_.p_stat:_.p_expr),this.exprAllowed=!0};n.incDec.updateContext=function(){};n._function.updateContext=n._class.updateContext=function(e){e.beforeExpr&&e!==n._else&&!(e===n.semi&&this.curContext()!==_.p_stat)&&!(e===n._return&&D.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===n.colon||e===n.braceL)&&this.curContext()===_.b_stat)?this.context.push(_.f_expr):this.context.push(_.f_stat),this.exprAllowed=!1};n.colon.updateContext=function(){this.curContext().token==="function"&&this.context.pop(),this.exprAllowed=!0};n.backQuote.updateContext=function(){this.curContext()===_.q_tmpl?this.context.pop():this.context.push(_.q_tmpl),this.exprAllowed=!1};n.star.updateContext=function(e){if(e===n._function){var t=this.context.length-1;this.context[t]===_.f_expr?this.context[t]=_.f_expr_gen:this.context[t]=_.f_gen}this.exprAllowed=!0};n.name.updateContext=function(e){var t=!1;this.options.ecmaVersion>=6&&e!==n.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(t=!0),this.exprAllowed=t};var g=k.prototype;g.checkPropClash=function(e,t,i){if(!(this.options.ecmaVersion>=9&&e.type==="SpreadElement")&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var s=e.key,r;switch(s.type){case"Identifier":r=s.name;break;case"Literal":r=String(s.value);break;default:return}var a=e.kind;if(this.options.ecmaVersion>=6){r==="__proto__"&&a==="init"&&(t.proto&&(i?i.doubleProto<0&&(i.doubleProto=s.start):this.raiseRecoverable(s.start,"Redefinition of __proto__ property")),t.proto=!0);return}r="$"+r;var o=t[r];if(o){var u;a==="init"?u=this.strict&&o.init||o.get||o.set:u=o.init||o[a],u&&this.raiseRecoverable(s.start,"Redefinition of property")}else o=t[r]={init:!1,get:!1,set:!1};o[a]=!0}};g.parseExpression=function(e,t){var i=this.start,s=this.startLoc,r=this.parseMaybeAssign(e,t);if(this.type===n.comma){var a=this.startNodeAt(i,s);for(a.expressions=[r];this.eat(n.comma);)a.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(a,"SequenceExpression")}return r};g.parseMaybeAssign=function(e,t,i){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=!1}var s=!1,r=-1,a=-1,o=-1;t?(r=t.parenthesizedAssign,a=t.trailingComma,o=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new Ee,s=!0);var u=this.start,c=this.startLoc;(this.type===n.parenL||this.type===n.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e==="await");var h=this.parseMaybeConditional(e,t);if(i&&(h=i.call(this,h,u,c)),this.type.isAssign){var l=this.startNodeAt(u,c);return l.operator=this.value,this.type===n.eq&&(h=this.toAssignable(h,!1,t)),s||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=h.start&&(t.shorthandAssign=-1),this.type===n.eq?this.checkLValPattern(h):this.checkLValSimple(h),l.left=h,this.next(),l.right=this.parseMaybeAssign(e),o>-1&&(t.doubleProto=o),this.finishNode(l,"AssignmentExpression")}else s&&this.checkExpressionErrors(t,!0);return r>-1&&(t.parenthesizedAssign=r),a>-1&&(t.trailingComma=a),h};g.parseMaybeConditional=function(e,t){var i=this.start,s=this.startLoc,r=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return r;if(this.eat(n.question)){var a=this.startNodeAt(i,s);return a.test=r,a.consequent=this.parseMaybeAssign(),this.expect(n.colon),a.alternate=this.parseMaybeAssign(e),this.finishNode(a,"ConditionalExpression")}return r};g.parseExprOps=function(e,t){var i=this.start,s=this.startLoc,r=this.parseMaybeUnary(t,!1,!1,e);return this.checkExpressionErrors(t)||r.start===i&&r.type==="ArrowFunctionExpression"?r:this.parseExprOp(r,i,s,-1,e)};g.parseExprOp=function(e,t,i,s,r){var a=this.type.binop;if(a!=null&&(!r||this.type!==n._in)&&a>s){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 h=this.start,l=this.startLoc,f=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,r),h,l,a,r),y=this.buildBinary(t,i,e,f,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(y,t,i,s,r)}return e};g.buildBinary=function(e,t,i,s,r,a){s.type==="PrivateIdentifier"&&this.raise(s.start,"Private identifier can only be left side of binary expression");var o=this.startNodeAt(e,t);return o.left=i,o.operator=r,o.right=s,this.finishNode(o,a?"LogicalExpression":"BinaryExpression")};g.parseMaybeUnary=function(e,t,i,s){var r=this.start,a=this.startLoc,o;if(this.isContextual("await")&&this.canAwait)o=this.parseAwait(s),t=!0;else if(this.type.prefix){var u=this.startNode(),c=this.type===n.incDec;u.operator=this.value,u.prefix=!0,this.next(),u.argument=this.parseMaybeUnary(null,!0,c,s),this.checkExpressionErrors(e,!0),c?this.checkLValSimple(u.argument):this.strict&&u.operator==="delete"&&u.argument.type==="Identifier"?this.raiseRecoverable(u.start,"Deleting local variable in strict mode"):u.operator==="delete"&&Ft(u.argument)?this.raiseRecoverable(u.start,"Private fields can not be deleted"):t=!0,o=this.finishNode(u,c?"UpdateExpression":"UnaryExpression")}else if(!t&&this.type===n.privateId)(s||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),o=this.parsePrivateIdent(),this.type!==n._in&&this.unexpected();else{if(o=this.parseExprSubscripts(e,s),this.checkExpressionErrors(e))return o;for(;this.type.postfix&&!this.canInsertSemicolon();){var h=this.startNodeAt(r,a);h.operator=this.value,h.prefix=!1,h.argument=o,this.checkLValSimple(o),this.next(),o=this.finishNode(h,"UpdateExpression")}}if(!i&&this.eat(n.starstar))if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(r,a,o,this.parseMaybeUnary(null,!1,!1,s),"**",!1);else return o};function Ft(e){return e.type==="MemberExpression"&&e.property.type==="PrivateIdentifier"||e.type==="ChainExpression"&&Ft(e.expression)}g.parseExprSubscripts=function(e,t){var i=this.start,s=this.startLoc,r=this.parseExprAtom(e,t);if(r.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return r;var a=this.parseSubscripts(r,i,s,!1,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};g.parseSubscripts=function(e,t,i,s,r){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=!1;;){var u=this.parseSubscript(e,t,i,s,a,o,r);if(u.optional&&(o=!0),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}};g.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(n.arrow)};g.parseSubscriptAsyncArrow=function(e,t,i,s){return this.parseArrowExpression(this.startNodeAt(e,t),i,!0,s)};g.parseSubscript=function(e,t,i,s,r,a,o){var u=this.options.ecmaVersion>=11,c=u&&this.eat(n.questionDot);s&&c&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var h=this.eat(n.bracketL);if(h||c&&this.type!==n.parenL&&this.type!==n.backQuote||this.eat(n.dot)){var l=this.startNodeAt(t,i);l.object=e,h?(l.property=this.parseExpression(),this.expect(n.bracketR)):this.type===n.privateId&&e.type!=="Super"?l.property=this.parsePrivateIdent():l.property=this.parseIdent(this.options.allowReserved!=="never"),l.computed=!!h,u&&(l.optional=c),e=this.finishNode(l,"MemberExpression")}else if(!s&&this.eat(n.parenL)){var f=new Ee,y=this.yieldPos,m=this.awaitPos,E=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var S=this.parseExprList(n.parenR,this.options.ecmaVersion>=8,!1,f);if(r&&!c&&this.shouldParseAsyncArrow())return this.checkPatternErrors(f,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=y,this.awaitPos=m,this.awaitIdentPos=E,this.parseSubscriptAsyncArrow(t,i,S,o);this.checkExpressionErrors(f,!0),this.yieldPos=y||this.yieldPos,this.awaitPos=m||this.awaitPos,this.awaitIdentPos=E||this.awaitIdentPos;var R=this.startNodeAt(t,i);R.callee=e,R.arguments=S,u&&(R.optional=c),e=this.finishNode(R,"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 K=this.startNodeAt(t,i);K.tag=e,K.quasi=this.parseTemplate({isTagged:!0}),e=this.finishNode(K,"TaggedTemplateExpression")}return e};g.parseExprAtom=function(e,t,i){this.type===n.slash&&this.readRegexp();var s,r=this.potentialArrowAt===this.start;switch(this.type){case n._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),s=this.startNode(),this.next(),this.type===n.parenL&&!this.allowDirectSuper&&this.raise(s.start,"super() call outside constructor of a subclass"),this.type!==n.dot&&this.type!==n.bracketL&&this.type!==n.parenL&&this.unexpected(),this.finishNode(s,"Super");case n._this:return s=this.startNode(),this.next(),this.finishNode(s,"ThisExpression");case n.name:var a=this.start,o=this.startLoc,u=this.containsEsc,c=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!u&&c.name==="async"&&!this.canInsertSemicolon()&&this.eat(n._function))return this.overrideContext(_.f_expr),this.parseFunction(this.startNodeAt(a,o),0,!1,!0,t);if(r&&!this.canInsertSemicolon()){if(this.eat(n.arrow))return this.parseArrowExpression(this.startNodeAt(a,o),[c],!1,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(!1),(this.canInsertSemicolon()||!this.eat(n.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(a,o),[c],!0,t)}return c;case n.regexp:var h=this.value;return s=this.parseLiteral(h.value),s.regex={pattern:h.pattern,flags:h.flags},s;case n.num:case n.string:return this.parseLiteral(this.value);case n._null:case n._true:case n._false:return s=this.startNode(),s.value=this.type===n._null?null:this.type===n._true,s.raw=this.type.keyword,this.next(),this.finishNode(s,"Literal");case n.parenL:var l=this.start,f=this.parseParenAndDistinguishExpression(r,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(f)&&(e.parenthesizedAssign=l),e.parenthesizedBind<0&&(e.parenthesizedBind=l)),f;case n.bracketL:return s=this.startNode(),this.next(),s.elements=this.parseExprList(n.bracketR,!0,!0,e),this.finishNode(s,"ArrayExpression");case n.braceL:return this.overrideContext(_.b_expr),this.parseObj(!1,e);case n._function:return s=this.startNode(),this.next(),this.parseFunction(s,0);case n._class:return this.parseClass(this.startNode(),!1);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()}};g.parseExprAtomDefault=function(){this.unexpected()};g.parseExprImport=function(e){var t=this.startNode();this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import");var i=this.parseIdent(!0);if(this.type===n.parenL&&!e)return this.parseDynamicImport(t);if(this.type===n.dot)return t.meta=i,this.parseImportMeta(t);this.unexpected()};g.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),!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")};g.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(!0),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")};g.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.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")};g.parseParenExpression=function(){this.expect(n.parenL);var e=this.parseExpression();return this.expect(n.parenR),e};g.shouldParseArrow=function(e){return!this.canInsertSemicolon()};g.parseParenAndDistinguishExpression=function(e,t){var i=this.start,s=this.startLoc,r,a=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var o=this.start,u=this.startLoc,c=[],h=!0,l=!1,f=new Ee,y=this.yieldPos,m=this.awaitPos,E;for(this.yieldPos=0,this.awaitPos=0;this.type!==n.parenR;)if(h?h=!1:this.expect(n.comma),a&&this.afterTrailingComma(n.parenR,!0)){l=!0;break}else if(this.type===n.ellipsis){E=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(!1,f,this.parseParenItem));var S=this.lastTokEnd,R=this.lastTokEndLoc;if(this.expect(n.parenR),e&&this.shouldParseArrow(c)&&this.eat(n.arrow))return this.checkPatternErrors(f,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=y,this.awaitPos=m,this.parseParenArrowList(i,s,c,t);(!c.length||l)&&this.unexpected(this.lastTokStart),E&&this.unexpected(E),this.checkExpressionErrors(f,!0),this.yieldPos=y||this.yieldPos,this.awaitPos=m||this.awaitPos,c.length>1?(r=this.startNodeAt(o,u),r.expressions=c,this.finishNodeAt(r,"SequenceExpression",S,R)):r=c[0]}else r=this.parseParenExpression();if(this.options.preserveParens){var K=this.startNodeAt(i,s);return K.expression=r,this.finishNode(K,"ParenthesizedExpression")}else return r};g.parseParenItem=function(e){return e};g.parseParenArrowList=function(e,t,i,s){return this.parseArrowExpression(this.startNodeAt(e,t),i,!1,s)};var bs=[];g.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.startLoc);t.name="new",e.meta=this.finishNode(t,"Identifier"),this.next();var i=this.containsEsc;return e.property=this.parseIdent(!0),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 s=this.start,r=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),s,r,!0,!1),this.eat(n.parenL)?e.arguments=this.parseExprList(n.parenR,this.options.ecmaVersion>=8,!1):e.arguments=bs,this.finishNode(e,"NewExpression")};g.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,cooked:null}):i.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
10
10
  `),cooked:this.value},this.next(),i.tail=this.type===n.backQuote,this.finishNode(i,"TemplateElement")};g.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=!1);var i=this.startNode();this.next(),i.expressions=[];var s=this.parseTemplateElement({isTagged:t});for(i.quasis=[s];!s.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(s=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(i,"TemplateLiteral")};g.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)&&!D.test(this.input.slice(this.lastTokEnd,this.start))};g.parseObj=function(e,t){var i=this.startNode(),s=!0,r={};for(i.properties=[],this.next();!this.eat(n.braceR);){if(s)s=!1;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,r,t),i.properties.push(a)}return this.finishNode(i,e?"ObjectPattern":"ObjectExpression")};g.parseProperty=function(e,t){var i=this.startNode(),s,r,a,o;if(this.options.ecmaVersion>=9&&this.eat(n.ellipsis))return e?(i.argument=this.parseIdent(!1),this.type===n.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(i,"RestElement")):(i.argument=this.parseMaybeAssign(!1,t),this.type===n.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(i,"SpreadElement"));this.options.ecmaVersion>=6&&(i.method=!1,i.shorthand=!1,(e||t)&&(a=this.start,o=this.startLoc),e||(s=this.eat(n.star)));var u=this.containsEsc;return this.parsePropertyName(i),!e&&!u&&this.options.ecmaVersion>=8&&!s&&this.isAsyncProp(i)?(r=!0,s=this.options.ecmaVersion>=9&&this.eat(n.star),this.parsePropertyName(i)):r=!1,this.parsePropertyValue(i,e,s,r,a,o,t,u),this.finishNode(i,"Property")};g.parseGetterSetter=function(e){e.kind=e.key.name,this.parsePropertyName(e),e.value=this.parseMethod(!1);var t=e.kind==="get"?0:1;if(e.value.params.length!==t){var i=e.value.start;e.kind==="get"?this.raiseRecoverable(i,"getter should have no params"):this.raiseRecoverable(i,"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")};g.parsePropertyValue=function(e,t,i,s,r,a,o,u){(i||s)&&this.type===n.colon&&this.unexpected(),this.eat(n.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,o),e.kind="init"):this.options.ecmaVersion>=6&&this.type===n.parenL?(t&&this.unexpected(),e.kind="init",e.method=!0,e.value=this.parseMethod(i,s)):!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||s)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"?((i||s)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=r),e.kind="init",t?e.value=this.parseMaybeDefault(r,a,this.copyNode(e.key)):this.type===n.eq&&o?(o.shorthandAssign<0&&(o.shorthandAssign=this.start),e.value=this.parseMaybeDefault(r,a,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.shorthand=!0):this.unexpected()};g.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(n.bracketL))return e.computed=!0,e.key=this.parseMaybeAssign(),this.expect(n.bracketR),e.key;e.computed=!1}return e.key=this.type===n.num||this.type===n.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};g.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=!1),this.options.ecmaVersion>=8&&(e.async=!1)};g.parseMethod=function(e,t,i){var s=this.startNode(),r=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.initFunction(s),this.options.ecmaVersion>=6&&(s.generator=e),this.options.ecmaVersion>=8&&(s.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Qe(t,s.generator)|Ke|(i?Tt:0)),this.expect(n.parenL),s.params=this.parseBindingList(n.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(s,!1,!0,!1),this.yieldPos=r,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(s,"FunctionExpression")};g.parseArrowExpression=function(e,t,i,s){var r=this.yieldPos,a=this.awaitPos,o=this.awaitIdentPos;return this.enterScope(Qe(i,!1)|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,!0),this.parseFunctionBody(e,!0,!1,s),this.yieldPos=r,this.awaitPos=a,this.awaitIdentPos=o,this.finishNode(e,"ArrowFunctionExpression")};g.parseFunctionBody=function(e,t,i,s){var r=t&&this.type!==n.braceL,a=this.strict,o=!1;if(r)e.body=this.parseMaybeAssign(s),e.expression=!0,this.checkParams(e,!1);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=!0),this.checkParams(e,!a&&!o&&!t&&!i&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,Vt),e.body=this.parseBlock(!1,void 0,o&&!a),e.expression=!1,this.adaptDirectivePrologue(e.body.body),this.labels=c}this.exitScope()};g.isSimpleParamList=function(e){for(var t=0,i=e;t<i.length;t+=1){var s=i[t];if(s.type!=="Identifier")return!1}return!0};g.checkParams=function(e,t){for(var i=Object.create(null),s=0,r=e.params;s<r.length;s+=1){var a=r[s];this.checkLValInnerPattern(a,Ye,t?null:i)}};g.parseExprList=function(e,t,i,s){for(var r=[],a=!0;!this.eat(e);){if(a)a=!1;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(s),s&&this.type===n.comma&&s.trailingComma<0&&(s.trailingComma=this.start)):o=this.parseMaybeAssign(!1,s),r.push(o)}return r};g.checkUnreserved=function(e){var t=e.start,i=e.end,s=e.name;if(this.inGenerator&&s==="yield"&&this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&s==="await"&&this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function"),this.currentThisScope().inClassFieldInit&&s==="arguments"&&this.raiseRecoverable(t,"Cannot use 'arguments' in class field initializer"),this.inClassStaticBlock&&(s==="arguments"||s==="await")&&this.raise(t,"Cannot use "+s+" in class static initialization block"),this.keywords.test(s)&&this.raise(t,"Unexpected keyword '"+s+"'"),!(this.options.ecmaVersion<6&&this.input.slice(t,i).indexOf("\\")!==-1)){var r=this.strict?this.reservedWordsStrict:this.reservedWords;r.test(s)&&(!this.inAsync&&s==="await"&&this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(t,"The keyword '"+s+"' is reserved"))}};g.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};g.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};g.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};g.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=!1,t.argument=null):(t.delegate=this.eat(n.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,"YieldExpression")};g.parseAwait=function(e){this.awaitPos||(this.awaitPos=this.start);var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,!0,!1,e),this.finishNode(t,"AwaitExpression")};var we=k.prototype;we.raise=function(e,t){var i=Pt(this.input,e);t+=" ("+i.line+":"+i.column+")";var s=new SyntaxError(t);throw s.pos=e,s.loc=i,s.raisedAt=this.pos,s};we.raiseRecoverable=we.raise;we.curPosition=function(){if(this.options.locations)return new he(this.curLine,this.pos-this.lineStart)};var J=k.prototype,ws=function(t){this.flags=t,this.var=[],this.lexical=[],this.functions=[],this.inClassFieldInit=!1};J.enterScope=function(e){this.scopeStack.push(new ws(e))};J.exitScope=function(){this.scopeStack.pop()};J.treatFunctionsAsVarInScope=function(e){return e.flags&re||!this.inModule&&e.flags&le};J.declareName=function(e,t,i){var s=!1;if(t===z){var r=this.currentScope();s=r.lexical.indexOf(e)>-1||r.functions.indexOf(e)>-1||r.var.indexOf(e)>-1,r.lexical.push(e),this.inModule&&r.flags&le&&delete this.undefinedExports[e]}else if(t===Ot){var a=this.currentScope();a.lexical.push(e)}else if(t===Lt){var o=this.currentScope();this.treatFunctionsAsVar?s=o.lexical.indexOf(e)>-1:s=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&Nt&&c.lexical[0]===e)||!this.treatFunctionsAsVarInScope(c)&&c.functions.indexOf(e)>-1){s=!0;break}if(c.var.push(e),this.inModule&&c.flags&le&&delete this.undefinedExports[e],c.flags&Xe)break}s&&this.raiseRecoverable(i,"Identifier '"+e+"' has already been declared")};J.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e)};J.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};J.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&Xe)return t}};J.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&Xe&&!(t.flags&Rt))return t}};var Ce=function(t,i,s){this.type="",this.start=i,this.end=0,t.options.locations&&(this.loc=new _e(t,s)),t.options.directSourceFile&&(this.sourceFile=t.options.directSourceFile),t.options.ranges&&(this.range=[i,0])},de=k.prototype;de.startNode=function(){return new Ce(this,this.start,this.startLoc)};de.startNodeAt=function(e,t){return new Ce(this,e,t)};function Mt(e,t,i,s){return e.type=t,e.end=i,this.options.locations&&(e.loc.end=s),this.options.ranges&&(e.range[1]=i),e}de.finishNode=function(e,t){return Mt.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)};de.finishNodeAt=function(e,t,i,s){return Mt.call(this,e,t,i,s)};de.copyNode=function(e){var t=new Ce(this,e.start,this.startLoc);for(var i in e)t[i]=e[i];return t};var Bt="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",jt=Bt+" Extended_Pictographic",Ut=jt,$t=Ut+" EBase EComp EMod EPres ExtPict",Gt=$t,_s=Gt,Es={9:Bt,10:jt,11:Ut,12:$t,13:Gt,14:_s},Cs="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",Ss={9:"",10:"",11:"",12:"",13:"",14:Cs},wt="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",qt="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",Wt=qt+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Ht=Wt+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",zt=Ht+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",Kt=zt+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",ks=Kt+" Hrkt Katakana_Or_Hiragana Kawi Nag_Mundari Nagm Unknown Zzzz",As={9:qt,10:Wt,11:Ht,12:zt,13:Kt,14:ks},Xt={};function Ps(e){var t=Xt[e]={binary:Y(Es[e]+" "+wt),binaryOfStrings:Y(Ss[e]),nonBinary:{General_Category:Y(wt),Script:Y(As[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(ye=0,$e=[9,10,11,12,13,14];ye<$e.length;ye+=1)_t=$e[ye],Ps(_t);var _t,ye,$e,p=k.prototype,G=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=Xt[t.options.ecmaVersion>=14?14:t.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=[],this.backReferenceNames=[]};G.prototype.reset=function(t,i,s){var r=s.indexOf("v")!==-1,a=s.indexOf("u")!==-1;this.start=t|0,this.source=i+"",this.flags=s,r&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=a&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=a&&this.parser.options.ecmaVersion>=9)};G.prototype.raise=function(t){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+t)};G.prototype.at=function(t,i){i===void 0&&(i=!1);var s=this.source,r=s.length;if(t>=r)return-1;var a=s.charCodeAt(t);if(!(i||this.switchU)||a<=55295||a>=57344||t+1>=r)return a;var o=s.charCodeAt(t+1);return o>=56320&&o<=57343?(a<<10)+o-56613888:a};G.prototype.nextIndex=function(t,i){i===void 0&&(i=!1);var s=this.source,r=s.length;if(t>=r)return r;var a=s.charCodeAt(t),o;return!(i||this.switchU)||a<=55295||a>=57344||t+1>=r||(o=s.charCodeAt(t+1))<56320||o>57343?t+1:t+2};G.prototype.current=function(t){return t===void 0&&(t=!1),this.at(this.pos,t)};G.prototype.lookahead=function(t){return t===void 0&&(t=!1),this.at(this.nextIndex(this.pos,t),t)};G.prototype.advance=function(t){t===void 0&&(t=!1),this.pos=this.nextIndex(this.pos,t)};G.prototype.eat=function(t,i){return i===void 0&&(i=!1),this.current(i)===t?(this.advance(i),!0):!1};G.prototype.eatChars=function(t,i){i===void 0&&(i=!1);for(var s=this.pos,r=0,a=t;r<a.length;r+=1){var o=a[r],u=this.at(s,i);if(u===-1||u!==o)return!1;s=this.nextIndex(s,i)}return this.pos=s,!0};p.validateRegExpFlags=function(e){for(var t=e.validFlags,i=e.flags,s=!1,r=!1,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"&&(s=!0),o==="v"&&(r=!0)}this.options.ecmaVersion>=15&&s&&r&&this.raise(e.start,"Invalid regular expression flag")};p.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&e.groupNames.length>0&&(e.switchN=!0,this.regexp_pattern(e))};p.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=!1,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames.length=0,e.backReferenceNames.length=0,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 s=i[t];e.groupNames.indexOf(s)===-1&&e.raise("Invalid named capture referenced")}};p.regexp_disjunction=function(e){for(this.regexp_alternative(e);e.eat(124);)this.regexp_alternative(e);this.regexp_eatQuantifier(e,!0)&&e.raise("Nothing to repeat"),e.eat(123)&&e.raise("Lone quantifier brackets")};p.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););};p.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise("Invalid quantifier"),!0):(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))?(this.regexp_eatQuantifier(e),!0):!1};p.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=!1,e.eat(94)||e.eat(36))return!0;if(e.eat(92)){if(e.eat(66)||e.eat(98))return!0;e.pos=t}if(e.eat(40)&&e.eat(63)){var i=!1;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,!0}return e.pos=t,!1};p.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=!1),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),!0):!1};p.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)};p.regexp_eatBracedQuantifier=function(e,t){var i=e.pos;if(e.eat(123)){var s=0,r=-1;if(this.regexp_eatDecimalDigits(e)&&(s=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue),e.eat(125)))return r!==-1&&r<s&&!t&&e.raise("numbers out of order in {} quantifier"),!0;e.switchU&&!t&&e.raise("Incomplete quantifier"),e.pos=i}return!1};p.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)};p.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return!0;e.pos=t}return!1};p.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)&&e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return!0;e.raise("Unterminated group")}e.pos=t}return!1};p.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,!0;e.raise("Unterminated group")}return!1};p.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)};p.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,!0)&&e.raise("Nothing to repeat"),!1};p.regexp_eatSyntaxCharacter=function(e){var t=e.current();return Qt(t)?(e.lastIntValue=t,e.advance(),!0):!1};function Qt(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}p.regexp_eatPatternCharacters=function(e){for(var t=e.pos,i=0;(i=e.current())!==-1&&!Qt(i);)e.advance();return e.pos!==t};p.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(),!0):!1};p.regexp_groupSpecifier=function(e){if(e.eat(63)){if(this.regexp_eatGroupName(e)){e.groupNames.indexOf(e.lastStringValue)!==-1&&e.raise("Duplicate capture group name"),e.groupNames.push(e.lastStringValue);return}e.raise("Invalid group")}};p.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return!0;e.raise("Invalid capture group name")}return!1};p.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=Z(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=Z(e.lastIntValue);return!0}return!1};p.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,s=e.current(i);return e.advance(i),s===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(s=e.lastIntValue),Is(s)?(e.lastIntValue=s,!0):(e.pos=t,!1)};function Is(e){return W(e,!0)||e===36||e===95}p.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,s=e.current(i);return e.advance(i),s===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(s=e.lastIntValue),Rs(s)?(e.lastIntValue=s,!0):(e.pos=t,!1)};function Rs(e){return ie(e,!0)||e===36||e===95||e===8204||e===8205}p.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?!0:(e.switchU&&(e.current()===99&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),!1)};p.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),!0;if(i<=e.numCapturingParens)return!0;e.pos=t}return!1};p.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),!0;e.raise("Invalid named reference")}return!1};p.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,!1)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)};p.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return!0;e.pos=t}return!1};p.regexp_eatZero=function(e){return e.current()===48&&!Se(e.lookahead())?(e.lastIntValue=0,e.advance(),!0):!1};p.regexp_eatControlEscape=function(e){var t=e.current();return t===116?(e.lastIntValue=9,e.advance(),!0):t===110?(e.lastIntValue=10,e.advance(),!0):t===118?(e.lastIntValue=11,e.advance(),!0):t===102?(e.lastIntValue=12,e.advance(),!0):t===114?(e.lastIntValue=13,e.advance(),!0):!1};p.regexp_eatControlLetter=function(e){var t=e.current();return Yt(t)?(e.lastIntValue=t%32,e.advance(),!0):!1};function Yt(e){return e>=65&&e<=90||e>=97&&e<=122}p.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){t===void 0&&(t=!1);var i=e.pos,s=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var r=e.lastIntValue;if(s&&r>=55296&&r<=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=(r-55296)*1024+(o-56320)+65536,!0}e.pos=a,e.lastIntValue=r}return!0}if(s&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&Ns(e.lastIntValue))return!0;s&&e.raise("Invalid unicode escape"),e.pos=i}return!1};function Ns(e){return e>=0&&e<=1114111}p.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?!0:e.eat(47)?(e.lastIntValue=47,!0):!1;var t=e.current();return t!==99&&(!e.switchN||t!==107)?(e.lastIntValue=t,e.advance(),!0):!1};p.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!0}return!1};var Zt=0,H=1,V=2;p.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(Ts(t))return e.lastIntValue=-1,e.advance(),H;var i=!1;if(e.switchU&&this.options.ecmaVersion>=9&&((i=t===80)||t===112)){e.lastIntValue=-1,e.advance();var s;if(e.eat(123)&&(s=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return i&&s===V&&e.raise("Invalid property name"),s;e.raise("Invalid property name")}return Zt};function Ts(e){return e===100||e===68||e===115||e===83||e===119||e===87}p.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 s=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,i,s),H}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,r)}return Zt};p.regexp_validateUnicodePropertyNameAndValue=function(e,t,i){fe(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(i)||e.raise("Invalid property value")};p.regexp_validateUnicodePropertyNameOrValue=function(e,t){if(e.unicodeProperties.binary.test(t))return H;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(t))return V;e.raise("Invalid property name")};p.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";Jt(t=e.current());)e.lastStringValue+=Z(t),e.advance();return e.lastStringValue!==""};function Jt(e){return Yt(e)||e===95}p.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";Ls(t=e.current());)e.lastStringValue+=Z(t),e.advance();return e.lastStringValue!==""};function Ls(e){return Jt(e)||Se(e)}p.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)};p.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===V&&e.raise("Negated character class may contain strings"),!0}return!1};p.regexp_classContents=function(e){return e.current()===93?H:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),H)};p.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")}}};p.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return!0;if(e.switchU){var i=e.current();(i===99||ii(i))&&e.raise("Invalid class escape"),e.raise("Invalid escape")}e.pos=t}var s=e.current();return s!==93?(e.lastIntValue=s,e.advance(),!0):!1};p.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,!0;if(e.switchU&&e.eat(45))return e.lastIntValue=45,!0;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return!0;e.pos=t}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)};p.regexp_classSetExpression=function(e){var t=H,i;if(!this.regexp_eatClassSetRange(e))if(i=this.regexp_eatClassSetOperand(e)){i===V&&(t=V);for(var s=e.pos;e.eatChars([38,38]);){if(e.current()!==38&&(i=this.regexp_eatClassSetOperand(e))){i!==V&&(t=H);continue}e.raise("Invalid character in character class")}if(s!==e.pos)return t;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise("Invalid character in character class");if(s!==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===V&&(t=V)}};p.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 s=e.lastIntValue;return i!==-1&&s!==-1&&i>s&&e.raise("Range out of order in character class"),!0}e.pos=t}return!1};p.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?H:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)};p.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var i=e.eat(94),s=this.regexp_classContents(e);if(e.eat(93))return i&&s===V&&e.raise("Negated character class may contain strings"),s;e.pos=t}if(e.eat(92)){var r=this.regexp_eatCharacterClassEscape(e);if(r)return r;e.pos=t}return null};p.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};p.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===V&&(t=V);return t};p.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return t===1?H:V};p.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?!0:e.eat(98)?(e.lastIntValue=8,!0):(e.pos=t,!1);var i=e.current();return i<0||i===e.lookahead()&&Os(i)||Vs(i)?!1:(e.advance(),e.lastIntValue=i,!0)};function Os(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 Vs(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}p.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return Ds(t)?(e.lastIntValue=t,e.advance(),!0):!1};function Ds(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}p.regexp_eatClassControlLetter=function(e){var t=e.current();return Se(t)||t===95?(e.lastIntValue=t%32,e.advance(),!0):!1};p.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return!0;e.switchU&&e.raise("Invalid escape"),e.pos=t}return!1};p.regexp_eatDecimalDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;Se(i=e.current());)e.lastIntValue=10*e.lastIntValue+(i-48),e.advance();return e.pos!==t};function Se(e){return e>=48&&e<=57}p.regexp_eatHexDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;ei(i=e.current());)e.lastIntValue=16*e.lastIntValue+ti(i),e.advance();return e.pos!==t};function ei(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function ti(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}p.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!0}return!1};p.regexp_eatOctalDigit=function(e){var t=e.current();return ii(t)?(e.lastIntValue=t-48,e.advance(),!0):(e.lastIntValue=0,!1)};function ii(e){return e>=48&&e<=55}p.regexp_eatFixedHexDigits=function(e,t){var i=e.pos;e.lastIntValue=0;for(var s=0;s<t;++s){var r=e.current();if(!ei(r))return e.pos=i,!1;e.lastIntValue=16*e.lastIntValue+ti(r),e.advance()}return!0};var Je=function(t){this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,t.options.locations&&(this.loc=new _e(t,t.startLoc,t.endLoc)),t.options.ranges&&(this.range=[t.start,t.end])},x=k.prototype;x.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 Je(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()};x.getToken=function(){return this.next(),new Je(this)};typeof Symbol<"u"&&(x[Symbol.iterator]=function(){var e=this;return{next:function(){var t=e.getToken();return{done:t.type===n.eof,value:t}}}});x.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())};x.readToken=function(e){return W(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)};x.fullCharCodeAtPos=function(){var e=this.input.charCodeAt(this.pos);if(e<=55295||e>=56320)return e;var t=this.input.charCodeAt(this.pos+1);return t<=56319||t>=57344?e:(e<<10)+t-56613888};x.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 s=void 0,r=t;(s=St(this.input,r,this.pos))>-1;)++this.curLine,r=this.lineStart=s;this.options.onComment&&this.options.onComment(!0,this.input.slice(t+2,i),t,this.pos,e,this.curPosition())};x.skipLineComment=function(e){for(var t=this.pos,i=this.options.onComment&&this.curPosition(),s=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!se(s);)s=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(t+e,this.pos),t,this.pos,i,this.curPosition())};x.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&&kt.test(String.fromCharCode(e)))++this.pos;else break e}}};x.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)};x.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(!0);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))};x.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)};x.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),i=1,s=e===42?n.star:n.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++i,s=n.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(n.assign,i+1):this.finishOp(s,i)};x.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)};x.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(n.assign,2):this.finishOp(n.bitwiseXOR,1)};x.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||D.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)};x.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))};x.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)};x.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 s=this.input.charCodeAt(this.pos+2);if(s===61)return this.finishOp(n.assign,3)}return this.finishOp(n.coalesce,2)}}return this.finishOp(n.question,1)};x.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),W(t,!0)||t===92))return this.finishToken(n.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+Z(t)+"'")};x.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(!1);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 '"+Z(e)+"'")};x.finishOp=function(e,t){var i=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,i)};x.readRegexp=function(){for(var e,t,i=this.pos;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");var s=this.input.charAt(this.pos);if(D.test(s)&&this.raise(i,"Unterminated regular expression"),e)e=!1;else{if(s==="[")t=!0;else if(s==="]"&&t)t=!1;else if(s==="/"&&!t)break;e=s==="\\"}++this.pos}var r=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 G(this));u.reset(i,r,o),this.validateRegExpFlags(u),this.validateRegExpPattern(u);var c=null;try{c=new RegExp(r,o)}catch{}return this.finishToken(n.regexp,{pattern:r,flags:o,value:c})};x.readInt=function(e,t,i){for(var s=this.options.ecmaVersion>=12&&t===void 0,r=i&&this.input.charCodeAt(this.pos)===48,a=this.pos,o=0,u=0,c=0,h=t??1/0;c<h;++c,++this.pos){var l=this.input.charCodeAt(this.pos),f=void 0;if(s&&l===95){r&&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=l;continue}if(l>=97?f=l-97+10:l>=65?f=l-65+10:l>=48&&l<=57?f=l-48:f=1/0,f>=e)break;u=l,o=o*e+f}return s&&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 Fs(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,""))}function si(e){return typeof BigInt!="function"?null:BigInt(e.replace(/_/g,""))}x.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=si(this.input.slice(t,this.pos)),++this.pos):W(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(n.num,i)};x.readNumber=function(e){var t=this.pos;!e&&this.readInt(10,void 0,!0)===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 s=this.input.charCodeAt(this.pos);if(!i&&!e&&this.options.ecmaVersion>=11&&s===110){var r=si(this.input.slice(t,this.pos));return++this.pos,W(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(n.num,r)}i&&/[89]/.test(this.input.slice(t,this.pos))&&(i=!1),s===46&&!i&&(++this.pos,this.readInt(10),s=this.input.charCodeAt(this.pos)),(s===69||s===101)&&!i&&(s=this.input.charCodeAt(++this.pos),(s===43||s===45)&&++this.pos,this.readInt(10)===null&&this.raise(t,"Invalid number")),W(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var a=Fs(this.input.slice(t,this.pos),i);return this.finishToken(n.num,a)};x.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};x.readString=function(e){for(var t="",i=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var s=this.input.charCodeAt(this.pos);if(s===e)break;s===92?(t+=this.input.slice(i,this.pos),t+=this.readEscapedChar(!1),i=this.pos):s===8232||s===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(se(s)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return t+=this.input.slice(i,this.pos++),this.finishToken(n.string,t)};var ri={};x.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(e){if(e===ri)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=!1};x.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw ri;this.raise(e,t)};x.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(!0),t=this.pos;else if(se(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+=`
package/dist/index.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  import { z } from 'zod';
2
- import { AppManifest } from '@telia-ace/alliance-framework/manifest';
3
- import { StorageValue, Storage } from 'unstorage';
4
2
  import { RequestHandler, ErrorRequestHandler } from 'express';
3
+ import { TransportTargetOptions } from 'pino';
4
+ import { StorageValue, Storage } from 'unstorage';
5
+ import { AppManifest } from '@telia-ace/alliance-framework/manifest';
5
6
 
6
7
  type BearerTokenSettings = {
7
8
  privateKey: string;
@@ -17,6 +18,10 @@ type BearerTokenSettings = {
17
18
  name: string;
18
19
  slug: string;
19
20
  };
21
+ organization: {
22
+ name: string;
23
+ slug: string;
24
+ };
20
25
  expiration?: string;
21
26
  };
22
27
  declare const zKeyConfig: z.ZodObject<Pick<{
@@ -29,6 +34,7 @@ declare const zKeyConfig: z.ZodObject<Pick<{
29
34
  SERVICE_PORT: z.ZodDefault<z.ZodEffects<z.ZodString, number, string>>;
30
35
  REDIS_HOST: z.ZodString;
31
36
  REDIS_PASSWORD: z.ZodOptional<z.ZodString>;
37
+ COMMON_DOMAIN: z.ZodDefault<z.ZodEffects<z.ZodEnum<["true", "false"]>, boolean, "true" | "false">>;
32
38
  }, "JWT_PRIVATE_KEY" | "JWT_PUBLIC_CSP_KEY">, "strip", z.ZodTypeAny, {
33
39
  JWT_PRIVATE_KEY: string;
34
40
  JWT_PUBLIC_CSP_KEY: string;
@@ -36,7 +42,7 @@ declare const zKeyConfig: z.ZodObject<Pick<{
36
42
  JWT_PRIVATE_KEY?: string | undefined;
37
43
  JWT_PUBLIC_CSP_KEY?: string | undefined;
38
44
  }>;
39
- declare function createBearerToken({ privateKey, aud, sub, name, user, workspace, expiration, }: BearerTokenSettings): string;
45
+ declare function createBearerToken({ privateKey, aud, sub, name, user, workspace, organization, expiration, }: BearerTokenSettings): string;
40
46
  type BearerTokenContent = {
41
47
  iss: 'Alliance';
42
48
  aud: string;
@@ -47,6 +53,7 @@ type BearerTokenContent = {
47
53
  'https://alliance.teliacompany.net/user_privileges': string[];
48
54
  'https://alliance.teliacompany.net/workspace': string;
49
55
  'https://alliance.teliacompany.net/workspace_name': string;
56
+ 'https://alliance.teliacompany.net/organization': string;
50
57
  };
51
58
  declare function getPrivateKey(config: Pick<z.infer<typeof zKeyConfig>, 'JWT_PRIVATE_KEY'>): string;
52
59
  declare function createSystemUserToken(config: Pick<z.infer<typeof zKeyConfig>, 'JWT_PRIVATE_KEY'>): string;
@@ -113,6 +120,12 @@ declare const zSharedConfig: z.ZodObject<{
113
120
  * Optional
114
121
  */
115
122
  REDIS_PASSWORD: z.ZodOptional<z.ZodString>;
123
+ /**
124
+ * Whether the service should use common domain as workspace and user handling instead of legacy
125
+ *
126
+ * Optional, defaults to "false"
127
+ */
128
+ COMMON_DOMAIN: z.ZodDefault<z.ZodEffects<z.ZodEnum<["true", "false"]>, boolean, "true" | "false">>;
116
129
  }, "strip", z.ZodTypeAny, {
117
130
  AUTH_COOKIE_NAME: string;
118
131
  AUTH_COOKIE_SECRET: string;
@@ -122,6 +135,7 @@ declare const zSharedConfig: z.ZodObject<{
122
135
  SERVICE_LOG_LEVEL: "silent" | "fatal" | "error" | "warn" | "info" | "debug" | "trace";
123
136
  SERVICE_PORT: number;
124
137
  REDIS_HOST: string;
138
+ COMMON_DOMAIN: boolean;
125
139
  REDIS_PASSWORD?: string | undefined;
126
140
  }, {
127
141
  DB_ENDPOINT: string;
@@ -133,12 +147,14 @@ declare const zSharedConfig: z.ZodObject<{
133
147
  SERVICE_LOG_LEVEL?: "silent" | "fatal" | "error" | "warn" | "info" | "debug" | "trace" | undefined;
134
148
  SERVICE_PORT?: string | undefined;
135
149
  REDIS_PASSWORD?: string | undefined;
150
+ COMMON_DOMAIN?: "true" | "false" | undefined;
136
151
  }>;
137
152
 
138
153
  declare enum AllianceHeaders {
139
154
  TargetUrl = "alliance-target-url",
140
155
  TargetApp = "alliance-target-app",
141
- TargetWorkspace = "alliance-target-workspace"
156
+ TargetWorkspace = "alliance-target-workspace",
157
+ TargetOrganization = "alliance-target-organization"
142
158
  }
143
159
 
144
160
  declare function createIndexHtml(apps: AppImportInfo[]): string;
@@ -148,9 +164,29 @@ type AppImportInfo = {
148
164
  manifestImportPath: string;
149
165
  };
150
166
 
151
- declare function getAppManifests(apps: string[]): Promise<AppManifest[]>;
152
-
153
- declare function slugify(value: string, replacement?: string): string;
167
+ declare enum GatewayErrorCode {
168
+ NoObjectId = 10001,
169
+ NoTargetAppHeader = 10002,
170
+ NoTargetWorkspaceHeader = 10003,
171
+ NoManifest = 10006,
172
+ NoRequestContext = 10007,
173
+ NoUserInRequestContext = 10008,
174
+ NoAppInRequestContext = 10009,
175
+ NoWorkspaceInRequestContext = 10010,
176
+ NoUserPermissionsInRequestContext = 10012,
177
+ WorkspacePermissionDenied = 10013,
178
+ NoTargetUrlHeader = 10014,
179
+ NoSessionInRedisCache = 10015,
180
+ ProhibitedTargetDomain = 10016
181
+ }
182
+ declare enum DataErrorCode {
183
+ NoPublicKey = 11000,
184
+ NoAuthHeader = 11001
185
+ }
186
+ declare enum PortalErrorCode {
187
+ NoObjectId = 12000
188
+ }
189
+ type ErrorCode = GatewayErrorCode | DataErrorCode | PortalErrorCode;
154
190
 
155
191
  type LogFn = (msg: string, obj?: any) => void;
156
192
  type PartialConfig = Pick<z.infer<typeof zSharedConfig>, 'SERVICE_LOG_LEVEL'>;
@@ -165,7 +201,18 @@ type Logger = {
165
201
  child(): Logger;
166
202
  level: PartialConfig['SERVICE_LOG_LEVEL'];
167
203
  };
168
- declare function createLogger(config: PartialConfig): {
204
+ declare function createPrettyLogger(config: PartialConfig): {
205
+ fatal: LogFn;
206
+ error: LogFn;
207
+ warn: LogFn;
208
+ info: LogFn;
209
+ debug: LogFn;
210
+ trace: LogFn;
211
+ silent: LogFn;
212
+ child: () => any;
213
+ level: "silent" | "fatal" | "error" | "warn" | "info" | "debug" | "trace";
214
+ };
215
+ declare function createLogger(config: PartialConfig, transport?: TransportTargetOptions): {
169
216
  fatal: LogFn;
170
217
  error: LogFn;
171
218
  warn: LogFn;
@@ -178,37 +225,6 @@ declare function createLogger(config: PartialConfig): {
178
225
  };
179
226
  declare function requestLoggerHandler(logger: Logger): RequestHandler;
180
227
 
181
- declare function createFileStorage<T extends StorageValue = StorageValue>({ prefix, logger, }: {
182
- prefix: string;
183
- logger: Logger;
184
- }): Storage<T>;
185
-
186
- declare enum GatewayErrorCode {
187
- NoObjectId = 10001,
188
- NoTargetAppHeader = 10002,
189
- NoTargetWorkspaceHeader = 10003,
190
- NoManifest = 10006,
191
- NoRequestContext = 10007,
192
- NoUserInRequestContext = 10008,
193
- NoAppInRequestContext = 10009,
194
- NoWorkspaceInRequestContext = 10010,
195
- NoUserPermissionsInRequestContext = 10012,
196
- WorkspacePermissionDenied = 10013,
197
- NoTargetUrlHeader = 10014,
198
- NoSessionInRedisCache = 10015,
199
- ProhibitedTargetDomain = 10016
200
- }
201
- declare enum DataErrorCode {
202
- NoPublicKey = 11000,
203
- NoAuthHeader = 11001,
204
- FailedFileUpload = 11002,
205
- FailedFileDownload = 11003
206
- }
207
- declare enum PortalErrorCode {
208
- NoObjectId = 12000
209
- }
210
- type ErrorCode = GatewayErrorCode | DataErrorCode | PortalErrorCode;
211
-
212
228
  declare class AllianceError extends Error {
213
229
  errorCode: ErrorCode;
214
230
  info: string;
@@ -217,4 +233,13 @@ declare class AllianceError extends Error {
217
233
  }
218
234
  declare function requestErrorHandler(logger: Logger): ErrorRequestHandler;
219
235
 
220
- export { AllianceError, AllianceHeaders, type AppImportInfo, type BearerTokenContent, DataErrorCode, GatewayErrorCode, type Logger, type PublicKeys, createBearerToken, createFileStorage, createIndexHtml, createLogger, createPublicKeys, createSystemUserToken, getAppManifests, getCleanPublicKey, getPrivateKey, requestErrorHandler, requestLoggerHandler, slugify, zBooleanEnum, zNonEmptyString, zSharedConfig };
236
+ declare function createFileStorage<T extends StorageValue = StorageValue>({ prefix, logger, }: {
237
+ prefix: string;
238
+ logger: Logger;
239
+ }): Storage<T>;
240
+
241
+ declare function getAppManifests(apps: string[]): Promise<AppManifest[]>;
242
+
243
+ declare function slugify(value: string, replacement?: string): string;
244
+
245
+ export { AllianceError, AllianceHeaders, type AppImportInfo, type BearerTokenContent, DataErrorCode, GatewayErrorCode, type Logger, type PublicKeys, createBearerToken, createFileStorage, createIndexHtml, createLogger, createPrettyLogger, createPublicKeys, createSystemUserToken, getAppManifests, getCleanPublicKey, getPrivateKey, requestErrorHandler, requestLoggerHandler, slugify, zBooleanEnum, zNonEmptyString, zSharedConfig };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import{a as E,b as ue,c as ce,d as le}from"./chunk-UNKGNXJ3.js";import"./chunk-26VIM55J.js";import"./chunk-JG7V63GM.js";import pe from"jsonwebtoken";import{createPublicKey as fe}from"node:crypto";var me=E.enum(["true","false"]).transform(e=>e==="true"),y=E.string().min(1),T=E.object({AUTH_COOKIE_NAME:y.default("alliance-auth"),AUTH_COOKIE_SECRET:y.default("zlLZBlk7wt8lypP5lA4D"),DB_ENDPOINT:y,JWT_PRIVATE_KEY:y.default("MIIEogIBAAKCAQEAsGqOzjnfQtCYlDqhgGAnKuJOCiPt2WpCmL1Cs+SLBQlyoNn6LT8BJ6ZRj8t/vK8Sw0p51Uq/3k0tazh7bLGkWNMBLY3BqFiNRMMnCqHJfvGIUi/itNXNe2kbP7H3rbyQTu4O7yH/ZAMitdpF2KLucVRlFxrQ/ggZjxwEGso4JUnCwmAnoKct/uupKz9Y2PMTr00WWN79aPfD4LcKi570VJqBT3ISSucdwFLYNqnOkQnEa8O8xbthQhiI0k1GGJT+GCQcATUPeEbaCFXonOrJm+CyuMmQWYLFF3NbE5NllU1jz9PYHzp2hAgAx8WGeretTvpEA1dE2gvXNESGbQ8FxQIDAQABAoIBAAjTJmud1348eGAfLV8CRaij2MAxxenJ9/ozVXfcPIa2+fCelsuBSv8pwbYODvNoVT7xpcs2nwccGI6JgnBl09EhqlMWCT7w7GLT2aBy3A/T6JF76xJICQGzDfWPYygMtlyhv0YqZDUjjFlJHun+/ysqIUMY81AR0FLUAEc6yw41ChcdSvTgIqBM9f5PsBRK7zOgdW1vcVQiZbf2Vqr+7wTJ+6b9A4rWnnAqesGDXqYupx3UJEu3x0wRNQB8FeiG9iJrw4cyD9SmM95doTyKosQ2PWWnUO1NMgmWCR/mWcKZAUcfZUpnQ8rz75WAWept8ZIOOdha8UZ1B/kw3EsVdEECgYEA3iN0BRUqMN0J69bazvlNOWtI+Chc1lYMt/tZ4p78pIJpAZvc3rQ9lAp6JvOEno2IglULA4I+ZLUmpz+lfu7XxKMNOI3cnG7WdiGbiIlwOSwuxzeO1FJqhtnc0U6mNkIjptV8b2etj8U2/SXAC3CC8XgsawAj9A/I7awlCL3NXdECgYEAy07gun3rcd3Y0ISmd3+SbAn/MbGf8uRLcfSc2ls9B6m3pXj25prXJWIrB6DyGuL/HQmHzffQkOeXmwFGHFXyiIFOIITX4z8b9lMnavgUZoPDY+ZFsxp6I7vMn75AetB8wYXpOFFeCG/Ck/VSIYP7oAN8kLw8EHdOuNbZYbu34bUCgYBYd14ZOBiZZS4yUlrJ2tc6atOgoNJ4OcTO8LcXXaHYEmenUF9iAf4UGygSoyDJ1CvtW9kLCK+4g7xlFx/dsVkU4qq9PyIA2tNmMHQ0qCedXU8z35huTnRGSDV81gmzyhtQsezgoTWp8Cy6HHKjG6fKasWlx2SKKk8m+Eu3c396QQKBgBMY2asq4M7VU+RiUXCwHwTe+4Wjda7PGvcdTw6Du3vYyVNVxXtr2AG+8uPIjnVQFT6ZApSqToEOAAOjXv6SZDHGU5xiXhUOfIXq0a0OmHv4rIXZv3pPZmGs5k+rA0uGAfH7riiIHBkWxmQ3ivty9lPVgAHobIvvaQmbxNeVVnRxAoGAUzUmcBiUAiODfjulrpYvWG0tCn5B//yk7g1Tm3Chrh9huA1qGEN3jDoqSsTd5k4Yi5foyAZt5ORgoiUVm4IsfS56aoxIco1CtFG3zeMQRy4uKzTsvUTOdsJ4RlQdjNwpngXR44VL0WelgCDqTqJwn5ubzPvuIHuTj3cBpmJCjOo="),JWT_PUBLIC_CSP_KEY:E.string().min(1).default("BgIAAACkAABSU0ExAAgAAAEAAQDFBQ9thkQ01wvaRFcDRPpOrbd6hsXHAAiEdjof2NPPY02VZZMTW3MXxYJZkMm4suCbyeqc6FUI2kZ4DzUBHCQY/pQYRk3SiBhCYbvFvMNrxAmRzqk22FLAHedKEnJPgZpU9J6LCrfgw/do/d5YFk2vE/PYWD8rqev+LaegJ2DCwkklOMoaBByPGQj+0BoXZVRx7qLYRdq1IgNk/yHvDu5OkLyt97E/G2l7zdW04i9SiPF+yaEKJ8NEjViowY0tAdNYpLFsezhrLU3ev0rVeUrDEq+8f8uPUaYnAT8t+tmgcgkFi+SzQr2YQmrZ7SMKTuIqJ2CAoTqUmNBC3znOjmqw"),SERVICE_LOG_LEVEL:E.enum(["silent","fatal","error","warn","info","debug","trace"]).default("trace"),SERVICE_PORT:y.transform(Number).default("3000"),REDIS_HOST:y,REDIS_PASSWORD:y.optional()});var K=(u=>(u.TargetUrl="alliance-target-url",u.TargetApp="alliance-target-app",u.TargetWorkspace="alliance-target-workspace",u))(K||{});var Xe=T.pick({JWT_PRIVATE_KEY:!0,JWT_PUBLIC_CSP_KEY:!0});function j({privateKey:e,aud:t,sub:n,name:u,user:c,workspace:m,expiration:g="1h"}){return`Bearer ${pe.sign({iss:"Alliance",aud:t,sub:n,name:u,"https://alliance.teliacompany.net/user_type":c.type,"https://alliance.teliacompany.net/user_email":c.email,"https://alliance.teliacompany.net/user_privileges":c.permissions,"https://alliance.teliacompany.net/workspace":m.slug,"https://alliance.teliacompany.net/workspace_name":m.name,"https://alliance.teliacompany.net/tenant":m.slug,"https://alliance.teliacompany.net/tenant_name":m.name},e,{expiresIn:g,algorithm:"RS256"})}`}function L(e){return`-----BEGIN RSA PRIVATE KEY-----
1
+ import{a as E,b as ce,c as me,d as le}from"./chunk-EBHULZEM.js";import"./chunk-26VIM55J.js";import"./chunk-JG7V63GM.js";import{createPublicKey as pe}from"node:crypto";import ge from"jsonwebtoken";var j=E.enum(["true","false"]).transform(e=>e==="true"),h=E.string().min(1),S=E.object({AUTH_COOKIE_NAME:h.default("alliance-auth"),AUTH_COOKIE_SECRET:h.default("zlLZBlk7wt8lypP5lA4D"),DB_ENDPOINT:h,JWT_PRIVATE_KEY:h.default("MIIEogIBAAKCAQEAsGqOzjnfQtCYlDqhgGAnKuJOCiPt2WpCmL1Cs+SLBQlyoNn6LT8BJ6ZRj8t/vK8Sw0p51Uq/3k0tazh7bLGkWNMBLY3BqFiNRMMnCqHJfvGIUi/itNXNe2kbP7H3rbyQTu4O7yH/ZAMitdpF2KLucVRlFxrQ/ggZjxwEGso4JUnCwmAnoKct/uupKz9Y2PMTr00WWN79aPfD4LcKi570VJqBT3ISSucdwFLYNqnOkQnEa8O8xbthQhiI0k1GGJT+GCQcATUPeEbaCFXonOrJm+CyuMmQWYLFF3NbE5NllU1jz9PYHzp2hAgAx8WGeretTvpEA1dE2gvXNESGbQ8FxQIDAQABAoIBAAjTJmud1348eGAfLV8CRaij2MAxxenJ9/ozVXfcPIa2+fCelsuBSv8pwbYODvNoVT7xpcs2nwccGI6JgnBl09EhqlMWCT7w7GLT2aBy3A/T6JF76xJICQGzDfWPYygMtlyhv0YqZDUjjFlJHun+/ysqIUMY81AR0FLUAEc6yw41ChcdSvTgIqBM9f5PsBRK7zOgdW1vcVQiZbf2Vqr+7wTJ+6b9A4rWnnAqesGDXqYupx3UJEu3x0wRNQB8FeiG9iJrw4cyD9SmM95doTyKosQ2PWWnUO1NMgmWCR/mWcKZAUcfZUpnQ8rz75WAWept8ZIOOdha8UZ1B/kw3EsVdEECgYEA3iN0BRUqMN0J69bazvlNOWtI+Chc1lYMt/tZ4p78pIJpAZvc3rQ9lAp6JvOEno2IglULA4I+ZLUmpz+lfu7XxKMNOI3cnG7WdiGbiIlwOSwuxzeO1FJqhtnc0U6mNkIjptV8b2etj8U2/SXAC3CC8XgsawAj9A/I7awlCL3NXdECgYEAy07gun3rcd3Y0ISmd3+SbAn/MbGf8uRLcfSc2ls9B6m3pXj25prXJWIrB6DyGuL/HQmHzffQkOeXmwFGHFXyiIFOIITX4z8b9lMnavgUZoPDY+ZFsxp6I7vMn75AetB8wYXpOFFeCG/Ck/VSIYP7oAN8kLw8EHdOuNbZYbu34bUCgYBYd14ZOBiZZS4yUlrJ2tc6atOgoNJ4OcTO8LcXXaHYEmenUF9iAf4UGygSoyDJ1CvtW9kLCK+4g7xlFx/dsVkU4qq9PyIA2tNmMHQ0qCedXU8z35huTnRGSDV81gmzyhtQsezgoTWp8Cy6HHKjG6fKasWlx2SKKk8m+Eu3c396QQKBgBMY2asq4M7VU+RiUXCwHwTe+4Wjda7PGvcdTw6Du3vYyVNVxXtr2AG+8uPIjnVQFT6ZApSqToEOAAOjXv6SZDHGU5xiXhUOfIXq0a0OmHv4rIXZv3pPZmGs5k+rA0uGAfH7riiIHBkWxmQ3ivty9lPVgAHobIvvaQmbxNeVVnRxAoGAUzUmcBiUAiODfjulrpYvWG0tCn5B//yk7g1Tm3Chrh9huA1qGEN3jDoqSsTd5k4Yi5foyAZt5ORgoiUVm4IsfS56aoxIco1CtFG3zeMQRy4uKzTsvUTOdsJ4RlQdjNwpngXR44VL0WelgCDqTqJwn5ubzPvuIHuTj3cBpmJCjOo="),JWT_PUBLIC_CSP_KEY:E.string().min(1).default("BgIAAACkAABSU0ExAAgAAAEAAQDFBQ9thkQ01wvaRFcDRPpOrbd6hsXHAAiEdjof2NPPY02VZZMTW3MXxYJZkMm4suCbyeqc6FUI2kZ4DzUBHCQY/pQYRk3SiBhCYbvFvMNrxAmRzqk22FLAHedKEnJPgZpU9J6LCrfgw/do/d5YFk2vE/PYWD8rqev+LaegJ2DCwkklOMoaBByPGQj+0BoXZVRx7qLYRdq1IgNk/yHvDu5OkLyt97E/G2l7zdW04i9SiPF+yaEKJ8NEjViowY0tAdNYpLFsezhrLU3ev0rVeUrDEq+8f8uPUaYnAT8t+tmgcgkFi+SzQr2YQmrZ7SMKTuIqJ2CAoTqUmNBC3znOjmqw"),SERVICE_LOG_LEVEL:E.enum(["silent","fatal","error","warn","info","debug","trace"]).default("trace"),SERVICE_PORT:h.transform(Number).default("3000"),REDIS_HOST:h,REDIS_PASSWORD:h.optional(),COMMON_DOMAIN:j.default("false")});var K=(m=>(m.TargetUrl="alliance-target-url",m.TargetApp="alliance-target-app",m.TargetWorkspace="alliance-target-workspace",m.TargetOrganization="alliance-target-organization",m))(K||{});var $e=S.pick({JWT_PRIVATE_KEY:!0,JWT_PUBLIC_CSP_KEY:!0});function V({privateKey:e,aud:t,sub:n,name:u,user:m,workspace:l,organization:f,expiration:y="1h"}){return`Bearer ${ge.sign({iss:"Alliance",aud:t,sub:n,name:u,"https://alliance.teliacompany.net/user_type":m.type,"https://alliance.teliacompany.net/user_email":m.email,"https://alliance.teliacompany.net/user_privileges":m.permissions,"https://alliance.teliacompany.net/workspace":l.slug,"https://alliance.teliacompany.net/workspace_name":l.name,"https://alliance.teliacompany.net/tenant":l.slug,"https://alliance.teliacompany.net/tenant_name":l.name,"https://alliance.teliacompany.net/organization":f.slug},e,{expiresIn:y,algorithm:"RS256"})}`}function L(e){return`-----BEGIN RSA PRIVATE KEY-----
2
2
  `+e.JWT_PRIVATE_KEY+`
3
- -----END RSA PRIVATE KEY-----`}function ge(e){return j({aud:"system",sub:"system",name:"system",workspace:{slug:"system",name:"system"},user:{type:"system",permissions:[],email:"system"},privateKey:L(e)})}function de(e){let t=L(e),n=fe(t);return{pkcs:n.export({type:"pkcs1",format:"pem"}).toString().trim(),spki:n.export({type:"spki",format:"pem"}).toString().trim(),csp:e.JWT_PUBLIC_CSP_KEY}}function ye(e,t){return t[e].replace("-----BEGIN RSA PUBLIC KEY-----","").replace("-----END RSA PUBLIC KEY-----","").replace("-----BEGIN PUBLIC KEY-----","").replace("-----END PUBLIC KEY-----","").trim().replaceAll(`
4
- `,"")}import{homedir as Oe,tmpdir as ze}from"node:os";import{resolve as Fe}from"node:path";var he=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,Ie=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,ve=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function we(e,t){if(e==="__proto__"||e==="constructor"&&t&&typeof t=="object"&&"prototype"in t){Ee(e);return}return t}function Ee(e){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`)}function C(e,t={}){if(typeof e!="string")return e;let n=e.trim();if(e[0]==='"'&&e.at(-1)==='"'&&!e.includes("\\"))return n.slice(1,-1);if(n.length<=9){let u=n.toLowerCase();if(u==="true")return!0;if(u==="false")return!1;if(u==="undefined")return;if(u==="null")return null;if(u==="nan")return Number.NaN;if(u==="infinity")return Number.POSITIVE_INFINITY;if(u==="-infinity")return Number.NEGATIVE_INFINITY}if(!ve.test(e)){if(t.strict)throw new SyntaxError("[destr] Invalid JSON");return e}try{if(he.test(e)||Ie.test(e)){if(t.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(e,we)}return JSON.parse(e)}catch(u){if(t.strict)throw u;return e}}function xe(e){return!e||typeof e.then!="function"?Promise.resolve(e):e}function p(e,...t){try{return xe(e(...t))}catch(n){return Promise.reject(n)}}function Ce(e){let t=typeof e;return e===null||t!=="object"&&t!=="function"}function Ae(e){let t=Object.getPrototypeOf(e);return!t||t.isPrototypeOf(Object)}function A(e){if(Ce(e))return String(e);if(Ae(e)||Array.isArray(e))return JSON.stringify(e);if(typeof e.toJSON=="function")return A(e.toJSON());throw new Error("[unstorage] Cannot stringify value!")}function M(){if(typeof Buffer===void 0)throw new TypeError("[unstorage] Buffer is not supported!")}var b="base64:";function V(e){if(typeof e=="string")return e;M();let t=Buffer.from(e).toString("base64");return b+t}function Y(e){return typeof e!="string"||!e.startsWith(b)?e:(M(),Buffer.from(e.slice(b.length),"base64"))}var Se=["hasItem","getItem","getItemRaw","setItem","setItemRaw","removeItem","getMeta","setMeta","removeMeta","getKeys","clear","mount","unmount"];function B(e,t){if(t=x(t),!t)return e;let n={...e};for(let u of Se)n[u]=(c="",...m)=>e[u](t+c,...m);return n.getKeys=(u="",...c)=>e.getKeys(t+u,...c).then(m=>m.map(g=>g.slice(t.length))),n}function f(e){return e?e.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function D(...e){return f(e.join(":"))}function x(e){return e=f(e),e?e+":":""}var Re="memory",Ne=()=>{let e=new Map;return{name:Re,options:{},hasItem(t){return e.has(t)},getItem(t){return e.get(t)??null},getItemRaw(t){return e.get(t)??null},setItem(t,n){e.set(t,n)},setItemRaw(t,n){e.set(t,n)},removeItem(t){e.delete(t)},getKeys(){return Array.from(e.keys())},clear(){e.clear()},dispose(){e.clear()}}};function Q(e={}){let t={mounts:{"":e.driver||Ne()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},n=r=>{for(let o of t.mountpoints)if(r.startsWith(o))return{base:o,relativeKey:r.slice(o.length),driver:t.mounts[o]};return{base:"",relativeKey:r,driver:t.mounts[""]}},u=(r,o)=>t.mountpoints.filter(s=>s.startsWith(r)||o&&r.startsWith(s)).map(s=>({relativeBase:r.length>s.length?r.slice(s.length):void 0,mountpoint:s,driver:t.mounts[s]})),c=(r,o)=>{if(t.watching){o=f(o);for(let s of t.watchListeners)s(r,o)}},m=async()=>{if(!t.watching){t.watching=!0;for(let r in t.mounts)t.unwatch[r]=await J(t.mounts[r],c,r)}},g=async()=>{if(t.watching){for(let r in t.unwatch)await t.unwatch[r]();t.unwatch={},t.watching=!1}},h=(r,o,s)=>{let a=new Map,i=l=>{let d=a.get(l.base);return d||(d={driver:l.driver,base:l.base,items:[]},a.set(l.base,d)),d};for(let l of r){let d=typeof l=="string",R=f(d?l:l.key),I=d?void 0:l.value,P=d||!l.options?o:{...o,...l.options},W=n(R);i(W).items.push({key:R,value:I,relativeKey:W.relativeKey,options:P})}return Promise.all([...a.values()].map(l=>s(l))).then(l=>l.flat())},S={hasItem(r,o={}){r=f(r);let{relativeKey:s,driver:a}=n(r);return p(a.hasItem,s,o)},getItem(r,o={}){r=f(r);let{relativeKey:s,driver:a}=n(r);return p(a.getItem,s,o).then(i=>C(i))},getItems(r,o){return h(r,o,s=>s.driver.getItems?p(s.driver.getItems,s.items.map(a=>({key:a.relativeKey,options:a.options})),o).then(a=>a.map(i=>({key:D(s.base,i.key),value:C(i.value)}))):Promise.all(s.items.map(a=>p(s.driver.getItem,a.relativeKey,a.options).then(i=>({key:a.key,value:C(i)})))))},getItemRaw(r,o={}){r=f(r);let{relativeKey:s,driver:a}=n(r);return a.getItemRaw?p(a.getItemRaw,s,o):p(a.getItem,s,o).then(i=>Y(i))},async setItem(r,o,s={}){if(o===void 0)return S.removeItem(r);r=f(r);let{relativeKey:a,driver:i}=n(r);i.setItem&&(await p(i.setItem,a,A(o),s),i.watch||c("update",r))},async setItems(r,o){await h(r,o,async s=>{s.driver.setItems&&await p(s.driver.setItems,s.items.map(a=>({key:a.relativeKey,value:A(a.value),options:a.options})),o),s.driver.setItem&&await Promise.all(s.items.map(a=>p(s.driver.setItem,a.relativeKey,A(a.value),a.options)))})},async setItemRaw(r,o,s={}){if(o===void 0)return S.removeItem(r,s);r=f(r);let{relativeKey:a,driver:i}=n(r);if(i.setItemRaw)await p(i.setItemRaw,a,o,s);else if(i.setItem)await p(i.setItem,a,V(o),s);else return;i.watch||c("update",r)},async removeItem(r,o={}){typeof o=="boolean"&&(o={removeMeta:o}),r=f(r);let{relativeKey:s,driver:a}=n(r);a.removeItem&&(await p(a.removeItem,s,o),(o.removeMeta||o.removeMata)&&await p(a.removeItem,s+"$",o),a.watch||c("remove",r))},async getMeta(r,o={}){typeof o=="boolean"&&(o={nativeOnly:o}),r=f(r);let{relativeKey:s,driver:a}=n(r),i=Object.create(null);if(a.getMeta&&Object.assign(i,await p(a.getMeta,s,o)),!o.nativeOnly){let l=await p(a.getItem,s+"$",o).then(d=>C(d));l&&typeof l=="object"&&(typeof l.atime=="string"&&(l.atime=new Date(l.atime)),typeof l.mtime=="string"&&(l.mtime=new Date(l.mtime)),Object.assign(i,l))}return i},setMeta(r,o,s={}){return this.setItem(r+"$",o,s)},removeMeta(r,o={}){return this.removeItem(r+"$",o)},async getKeys(r,o={}){r=x(r);let s=u(r,!0),a=[],i=[];for(let l of s){let R=(await p(l.driver.getKeys,l.relativeBase,o)).map(I=>l.mountpoint+f(I)).filter(I=>!a.some(P=>I.startsWith(P)));i.push(...R),a=[l.mountpoint,...a.filter(I=>!I.startsWith(l.mountpoint))]}return r?i.filter(l=>l.startsWith(r)&&!l.endsWith("$")):i.filter(l=>!l.endsWith("$"))},async clear(r,o={}){r=x(r),await Promise.all(u(r,!1).map(async s=>{if(s.driver.clear)return p(s.driver.clear,s.relativeBase,o);if(s.driver.removeItem){let a=await s.driver.getKeys(s.relativeBase||"",o);return Promise.all(a.map(i=>s.driver.removeItem(i,o)))}}))},async dispose(){await Promise.all(Object.values(t.mounts).map(r=>H(r)))},async watch(r){return await m(),t.watchListeners.push(r),async()=>{t.watchListeners=t.watchListeners.filter(o=>o!==r),t.watchListeners.length===0&&await g()}},async unwatch(){t.watchListeners=[],await g()},mount(r,o){if(r=x(r),r&&t.mounts[r])throw new Error(`already mounted at ${r}`);return r&&(t.mountpoints.push(r),t.mountpoints.sort((s,a)=>a.length-s.length)),t.mounts[r]=o,t.watching&&Promise.resolve(J(o,c,r)).then(s=>{t.unwatch[r]=s}).catch(console.error),S},async unmount(r,o=!0){r=x(r),!(!r||!t.mounts[r])&&(t.watching&&r in t.unwatch&&(t.unwatch[r](),delete t.unwatch[r]),o&&await H(t.mounts[r]),t.mountpoints=t.mountpoints.filter(s=>s!==r),delete t.mounts[r])},getMount(r=""){r=f(r)+":";let o=n(r);return{driver:o.driver,base:o.base}},getMounts(r="",o={}){return r=f(r),u(r,o.parents).map(a=>({driver:a.driver,base:a.mountpoint}))}};return S}function J(e,t,n){return e.watch?e.watch((u,c)=>t(u,n+c)):()=>{}}async function H(e){typeof e.dispose=="function"&&await p(e.dispose)}import{existsSync as Te,promises as Ke}from"fs";import{resolve as Le,join as be}from"path";function N(e,t,n){return new Error(`[unstorage] [${e}] ${t}`,n)}function G(e,t){return Array.isArray(t)?N(e,`Missing some of the required options ${t.map(n=>"`"+n+"`").join(", ")}`):N(e,`Missing required option \`${t}\`.`)}import{existsSync as Pe,promises as v}from"fs";import{resolve as X,dirname as $}from"path";function O(e){return e.code==="ENOENT"||e.code==="EISDIR"?null:e}function Z(e){return e.code==="EEXIST"?null:e}async function z(e,t,n){return await re($(e)),v.writeFile(e,t,n)}function F(e,t){return v.readFile(e,t).catch(O)}function ee(e){return v.unlink(e).catch(O)}function te(e){return v.readdir(e,{withFileTypes:!0}).catch(O).then(t=>t||[])}async function re(e){Pe(e)||(await re($(e)).catch(Z),await v.mkdir(e).catch(Z))}async function q(e,t){if(t&&t(e))return[];let n=await te(e),u=[];return await Promise.all(n.map(async c=>{let m=X(e,c.name);if(c.isDirectory()){let g=await q(m,t);u.push(...g.map(h=>c.name+"/"+h))}else t&&t(c.name)||u.push(c.name)})),u}async function _(e){let t=await te(e);await Promise.all(t.map(n=>{let u=X(e,n.name);return n.isDirectory()?_(u).then(()=>v.rmdir(u)):v.unlink(u)}))}var Be=/\.\.\:|\.\.$/,k="fs-lite",ne=(e={})=>{if(!e.base)throw G(k,"base");e.base=Le(e.base);let t=n=>{if(Be.test(n))throw N(k,`Invalid key: ${JSON.stringify(n)}. It should not contain .. segments`);return be(e.base,n.replace(/:/g,"/"))};return{name:k,options:e,hasItem(n){return Te(t(n))},getItem(n){return F(t(n),"utf8")},getItemRaw(n){return F(t(n))},async getMeta(n){let{atime:u,mtime:c,size:m,birthtime:g,ctime:h}=await Ke.stat(t(n)).catch(()=>({}));return{atime:u,mtime:c,size:m,birthtime:g,ctime:h}},setItem(n,u){if(!e.readOnly)return z(t(n),u,"utf8")},setItemRaw(n,u){if(!e.readOnly)return z(t(n),u)},removeItem(n){if(!e.readOnly)return ee(t(n))},getKeys(){return q(t("."),e.ignore)},async clear(){e.readOnly||e.noClear||await _(t("."))}}};function qe({prefix:e,logger:t}){return B(Q({driver:ne({base:_e({logger:t})})}),e)}function _e({logger:e}){let t="";try{t=Oe()}catch(n){e.error("could not use homedir, trying tmpdir",{error:n?.message})}if(!t)try{t=ze()}catch(n){e.error("could not use tmpdir, trying process.cwd",{error:n?.message})}if(!t)try{t=process.cwd()}catch(n){e.error("could not use process.cwd, exiting",{error:n?.message}),process.exit(1)}return Fe(t,".alliance")}import ke from"pino";function w(e){return t=>(n,u)=>e[t]({...u,msg:n})}function oe(e){let t=ke({level:e.SERVICE_LOG_LEVEL,redact:["authorization","headers.authorization","req.headers.authorization","res.headers.authorization","req.headers.cookie",'res.headers["set-cookie"]']});return{fatal:w(t)("fatal"),error:w(t)("error"),warn:w(t)("warn"),info:w(t)("info"),debug:w(t)("debug"),trace:w(t)("trace"),silent:w(t)("silent"),child:()=>oe(e),level:e.SERVICE_LOG_LEVEL}}function Ue(e){return(t,n,u)=>(e.trace("received request",{url:t.url,params:t.params,query:t.query,body:t.body}),u())}var se=(i=>(i[i.NoObjectId=10001]="NoObjectId",i[i.NoTargetAppHeader=10002]="NoTargetAppHeader",i[i.NoTargetWorkspaceHeader=10003]="NoTargetWorkspaceHeader",i[i.NoManifest=10006]="NoManifest",i[i.NoRequestContext=10007]="NoRequestContext",i[i.NoUserInRequestContext=10008]="NoUserInRequestContext",i[i.NoAppInRequestContext=10009]="NoAppInRequestContext",i[i.NoWorkspaceInRequestContext=10010]="NoWorkspaceInRequestContext",i[i.NoUserPermissionsInRequestContext=10012]="NoUserPermissionsInRequestContext",i[i.WorkspacePermissionDenied=10013]="WorkspacePermissionDenied",i[i.NoTargetUrlHeader=10014]="NoTargetUrlHeader",i[i.NoSessionInRedisCache=10015]="NoSessionInRedisCache",i[i.ProhibitedTargetDomain=10016]="ProhibitedTargetDomain",i))(se||{}),ie=(c=>(c[c.NoPublicKey=11e3]="NoPublicKey",c[c.NoAuthHeader=11001]="NoAuthHeader",c[c.FailedFileUpload=11002]="FailedFileUpload",c[c.FailedFileDownload=11003]="FailedFileDownload",c))(ie||{});var ae={10001:{statusCode:401,msg:"No object id available on authenticated user."},10002:{statusCode:400,msg:"Request missing header 'alliance-target-app'."},10003:{statusCode:400,msg:"Request missing header 'alliance-target-workspace'."},10014:{statusCode:400,msg:"Request missing header 'alliance-target-url'."},10015:{statusCode:401,msg:"Could not find user session in Redis server."},10006:{statusCode:500,msg:"Could not find manifest for app '{{appSlug}}'."},10007:{statusCode:500,msg:"No request context."},10008:{statusCode:500,msg:"No user in request context."},10009:{statusCode:500,msg:"No app in request context."},10010:{statusCode:500,msg:"No workspace in request context."},10012:{statusCode:500,msg:"No user permissions in request context."},10013:{statusCode:403,msg:"User does not have access to the current workspace."},10016:{statusCode:403,msg:"Request prohibited - REQUEST_DOMAIN_WHITE_LIST does not contain '{{domain}}'."},11e3:{statusCode:401,msg:"No public key available to decode JWT."},11001:{statusCode:401,msg:"No authorization header found."},11002:{statusCode:500,msg:"Something went wrong when trying to upload a file to the S3 storage."},11003:{statusCode:500,msg:"Something went wrong when trying to download a file to the S3 storage."},12e3:{statusCode:401,msg:"No object id found in user claims."}};var U=class extends Error{constructor(n,u={}){let{msg:c,statusCode:m}=ae[n],g=We(c,u);super(g);this.errorCode=n;this.message=g,this.statusCode=m,this.info=`https://github.com/telia-company/ace-alliance-sdk/wiki/error-codes#${this.errorCode}`}info;statusCode};function We(e,t){return Object.entries(t).reduce((n,[u,c])=>n.replaceAll(`{{${u}}}`,c),e)}function je(e){return(t,n,u,c)=>{let m={cause:t.cause,message:t.message,status:t.status||t.statusCode||t.code,info:t.info};return e.error("error when processing request",{url:n.url,body:n.body,error:m}),u.status(m.status).json(m)}}export{U as AllianceError,K as AllianceHeaders,ie as DataErrorCode,se as GatewayErrorCode,j as createBearerToken,qe as createFileStorage,ce as createIndexHtml,oe as createLogger,de as createPublicKeys,ge as createSystemUserToken,le as getAppManifests,ye as getCleanPublicKey,L as getPrivateKey,je as requestErrorHandler,Ue as requestLoggerHandler,ue as slugify,me as zBooleanEnum,y as zNonEmptyString,T as zSharedConfig};
3
+ -----END RSA PRIVATE KEY-----`}function fe(e){return V({aud:"system",sub:"system",name:"system",workspace:{slug:"system",name:"system"},organization:{slug:"system",name:"system"},user:{type:"system",permissions:[],email:"system"},privateKey:L(e)})}function de(e){let t=L(e),n=pe(t);return{pkcs:n.export({type:"pkcs1",format:"pem"}).toString().trim(),spki:n.export({type:"spki",format:"pem"}).toString().trim(),csp:e.JWT_PUBLIC_CSP_KEY}}function ye(e,t){return t[e].replace("-----BEGIN RSA PUBLIC KEY-----","").replace("-----END RSA PUBLIC KEY-----","").replace("-----BEGIN PUBLIC KEY-----","").replace("-----END PUBLIC KEY-----","").trim().replaceAll(`
4
+ `,"")}var Y=(i=>(i[i.NoObjectId=10001]="NoObjectId",i[i.NoTargetAppHeader=10002]="NoTargetAppHeader",i[i.NoTargetWorkspaceHeader=10003]="NoTargetWorkspaceHeader",i[i.NoManifest=10006]="NoManifest",i[i.NoRequestContext=10007]="NoRequestContext",i[i.NoUserInRequestContext=10008]="NoUserInRequestContext",i[i.NoAppInRequestContext=10009]="NoAppInRequestContext",i[i.NoWorkspaceInRequestContext=10010]="NoWorkspaceInRequestContext",i[i.NoUserPermissionsInRequestContext=10012]="NoUserPermissionsInRequestContext",i[i.WorkspacePermissionDenied=10013]="WorkspacePermissionDenied",i[i.NoTargetUrlHeader=10014]="NoTargetUrlHeader",i[i.NoSessionInRedisCache=10015]="NoSessionInRedisCache",i[i.ProhibitedTargetDomain=10016]="ProhibitedTargetDomain",i))(Y||{}),D=(n=>(n[n.NoPublicKey=11e3]="NoPublicKey",n[n.NoAuthHeader=11001]="NoAuthHeader",n))(D||{});var J={10001:{statusCode:401,msg:"No object id available on authenticated user."},10002:{statusCode:400,msg:"Request missing header 'alliance-target-app'."},10003:{statusCode:400,msg:"Request missing header 'alliance-target-workspace'."},10014:{statusCode:400,msg:"Request missing header 'alliance-target-url'."},10015:{statusCode:401,msg:"Could not find user session in Redis server."},10006:{statusCode:500,msg:"Could not find manifest for app '{{appSlug}}'."},10007:{statusCode:500,msg:"No request context."},10008:{statusCode:500,msg:"No user in request context."},10009:{statusCode:500,msg:"No app in request context."},10010:{statusCode:500,msg:"No workspace in request context."},10012:{statusCode:500,msg:"No user permissions in request context."},10013:{statusCode:403,msg:"User does not have access to the current workspace."},10016:{statusCode:403,msg:"Request prohibited - REQUEST_DOMAIN_WHITE_LIST does not contain '{{domain}}'."},11e3:{statusCode:401,msg:"No public key available to decode JWT."},11001:{statusCode:401,msg:"No authorization header found."},12e3:{statusCode:401,msg:"No object id found in user claims."}};var O=class extends Error{constructor(n,u={}){let{msg:m,statusCode:l}=J[n],f=he(m,u);super(f);this.errorCode=n;this.message=f,this.statusCode=l,this.info=`https://github.com/telia-company/ace-alliance-sdk/wiki/error-codes#${this.errorCode}`}info;statusCode};function he(e,t){return Object.entries(t).reduce((n,[u,m])=>n.replaceAll(`{{${u}}}`,m),e)}function Ie(e){return(t,n,u,m)=>{let l={cause:t.cause,message:t.message,status:t.status||t.statusCode||t.code,info:t.info};return e.error("error when processing request",{url:n.url,body:n.body,error:l}),u.status(l.status).json(l)}}import{homedir as _e,tmpdir as qe}from"node:os";import{resolve as ke}from"node:path";var ve=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,we=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,Ee=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function Ce(e,t){if(e==="__proto__"||e==="constructor"&&t&&typeof t=="object"&&"prototype"in t){xe(e);return}return t}function xe(e){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`)}function A(e,t={}){if(typeof e!="string")return e;let n=e.trim();if(e[0]==='"'&&e.at(-1)==='"'&&!e.includes("\\"))return n.slice(1,-1);if(n.length<=9){let u=n.toLowerCase();if(u==="true")return!0;if(u==="false")return!1;if(u==="undefined")return;if(u==="null")return null;if(u==="nan")return Number.NaN;if(u==="infinity")return Number.POSITIVE_INFINITY;if(u==="-infinity")return Number.NEGATIVE_INFINITY}if(!Ee.test(e)){if(t.strict)throw new SyntaxError("[destr] Invalid JSON");return e}try{if(ve.test(e)||we.test(e)){if(t.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(e,Ce)}return JSON.parse(e)}catch(u){if(t.strict)throw u;return e}}function Ae(e){return!e||typeof e.then!="function"?Promise.resolve(e):e}function p(e,...t){try{return Ae(e(...t))}catch(n){return Promise.reject(n)}}function Pe(e){let t=typeof e;return e===null||t!=="object"&&t!=="function"}function Ne(e){let t=Object.getPrototypeOf(e);return!t||t.isPrototypeOf(Object)}function P(e){if(Pe(e))return String(e);if(Ne(e)||Array.isArray(e))return JSON.stringify(e);if(typeof e.toJSON=="function")return P(e.toJSON());throw new Error("[unstorage] Cannot stringify value!")}function H(){if(typeof Buffer===void 0)throw new TypeError("[unstorage] Buffer is not supported!")}var z="base64:";function Q(e){if(typeof e=="string")return e;H();let t=Buffer.from(e).toString("base64");return z+t}function G(e){return typeof e!="string"||!e.startsWith(z)?e:(H(),Buffer.from(e.slice(z.length),"base64"))}var Re=["hasItem","getItem","getItemRaw","setItem","setItemRaw","removeItem","getMeta","setMeta","removeMeta","getKeys","clear","mount","unmount"];function b(e,t){if(t=C(t),!t)return e;let n={...e};for(let u of Re)n[u]=(m="",...l)=>e[u](t+m,...l);return n.getKeys=(u="",...m)=>e.getKeys(t+u,...m).then(l=>l.map(f=>f.slice(t.length))),n}function g(e){return e?e.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function Z(...e){return g(e.join(":"))}function C(e){return e=g(e),e?e+":":""}var Te="memory",Se=()=>{let e=new Map;return{name:Te,options:{},hasItem(t){return e.has(t)},getItem(t){return e.get(t)??null},getItemRaw(t){return e.get(t)??null},setItem(t,n){e.set(t,n)},setItemRaw(t,n){e.set(t,n)},removeItem(t){e.delete(t)},getKeys(){return Array.from(e.keys())},clear(){e.clear()},dispose(){e.clear()}}};function ee(e={}){let t={mounts:{"":e.driver||Se()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},n=r=>{for(let o of t.mountpoints)if(r.startsWith(o))return{base:o,relativeKey:r.slice(o.length),driver:t.mounts[o]};return{base:"",relativeKey:r,driver:t.mounts[""]}},u=(r,o)=>t.mountpoints.filter(s=>s.startsWith(r)||o&&r.startsWith(s)).map(s=>({relativeBase:r.length>s.length?r.slice(s.length):void 0,mountpoint:s,driver:t.mounts[s]})),m=(r,o)=>{if(t.watching){o=g(o);for(let s of t.watchListeners)s(r,o)}},l=async()=>{if(!t.watching){t.watching=!0;for(let r in t.mounts)t.unwatch[r]=await X(t.mounts[r],m,r)}},f=async()=>{if(t.watching){for(let r in t.unwatch)await t.unwatch[r]();t.unwatch={},t.watching=!1}},y=(r,o,s)=>{let a=new Map,i=c=>{let d=a.get(c.base);return d||(d={driver:c.driver,base:c.base,items:[]},a.set(c.base,d)),d};for(let c of r){let d=typeof c=="string",N=g(d?c:c.key),I=d?void 0:c.value,T=d||!c.options?o:{...o,...c.options},W=n(N);i(W).items.push({key:N,value:I,relativeKey:W.relativeKey,options:T})}return Promise.all([...a.values()].map(c=>s(c))).then(c=>c.flat())},x={hasItem(r,o={}){r=g(r);let{relativeKey:s,driver:a}=n(r);return p(a.hasItem,s,o)},getItem(r,o={}){r=g(r);let{relativeKey:s,driver:a}=n(r);return p(a.getItem,s,o).then(i=>A(i))},getItems(r,o){return y(r,o,s=>s.driver.getItems?p(s.driver.getItems,s.items.map(a=>({key:a.relativeKey,options:a.options})),o).then(a=>a.map(i=>({key:Z(s.base,i.key),value:A(i.value)}))):Promise.all(s.items.map(a=>p(s.driver.getItem,a.relativeKey,a.options).then(i=>({key:a.key,value:A(i)})))))},getItemRaw(r,o={}){r=g(r);let{relativeKey:s,driver:a}=n(r);return a.getItemRaw?p(a.getItemRaw,s,o):p(a.getItem,s,o).then(i=>G(i))},async setItem(r,o,s={}){if(o===void 0)return x.removeItem(r);r=g(r);let{relativeKey:a,driver:i}=n(r);i.setItem&&(await p(i.setItem,a,P(o),s),i.watch||m("update",r))},async setItems(r,o){await y(r,o,async s=>{s.driver.setItems&&await p(s.driver.setItems,s.items.map(a=>({key:a.relativeKey,value:P(a.value),options:a.options})),o),s.driver.setItem&&await Promise.all(s.items.map(a=>p(s.driver.setItem,a.relativeKey,P(a.value),a.options)))})},async setItemRaw(r,o,s={}){if(o===void 0)return x.removeItem(r,s);r=g(r);let{relativeKey:a,driver:i}=n(r);if(i.setItemRaw)await p(i.setItemRaw,a,o,s);else if(i.setItem)await p(i.setItem,a,Q(o),s);else return;i.watch||m("update",r)},async removeItem(r,o={}){typeof o=="boolean"&&(o={removeMeta:o}),r=g(r);let{relativeKey:s,driver:a}=n(r);a.removeItem&&(await p(a.removeItem,s,o),(o.removeMeta||o.removeMata)&&await p(a.removeItem,s+"$",o),a.watch||m("remove",r))},async getMeta(r,o={}){typeof o=="boolean"&&(o={nativeOnly:o}),r=g(r);let{relativeKey:s,driver:a}=n(r),i=Object.create(null);if(a.getMeta&&Object.assign(i,await p(a.getMeta,s,o)),!o.nativeOnly){let c=await p(a.getItem,s+"$",o).then(d=>A(d));c&&typeof c=="object"&&(typeof c.atime=="string"&&(c.atime=new Date(c.atime)),typeof c.mtime=="string"&&(c.mtime=new Date(c.mtime)),Object.assign(i,c))}return i},setMeta(r,o,s={}){return this.setItem(r+"$",o,s)},removeMeta(r,o={}){return this.removeItem(r+"$",o)},async getKeys(r,o={}){r=C(r);let s=u(r,!0),a=[],i=[];for(let c of s){let N=(await p(c.driver.getKeys,c.relativeBase,o)).map(I=>c.mountpoint+g(I)).filter(I=>!a.some(T=>I.startsWith(T)));i.push(...N),a=[c.mountpoint,...a.filter(I=>!I.startsWith(c.mountpoint))]}return r?i.filter(c=>c.startsWith(r)&&!c.endsWith("$")):i.filter(c=>!c.endsWith("$"))},async clear(r,o={}){r=C(r),await Promise.all(u(r,!1).map(async s=>{if(s.driver.clear)return p(s.driver.clear,s.relativeBase,o);if(s.driver.removeItem){let a=await s.driver.getKeys(s.relativeBase||"",o);return Promise.all(a.map(i=>s.driver.removeItem(i,o)))}}))},async dispose(){await Promise.all(Object.values(t.mounts).map(r=>$(r)))},async watch(r){return await l(),t.watchListeners.push(r),async()=>{t.watchListeners=t.watchListeners.filter(o=>o!==r),t.watchListeners.length===0&&await f()}},async unwatch(){t.watchListeners=[],await f()},mount(r,o){if(r=C(r),r&&t.mounts[r])throw new Error(`already mounted at ${r}`);return r&&(t.mountpoints.push(r),t.mountpoints.sort((s,a)=>a.length-s.length)),t.mounts[r]=o,t.watching&&Promise.resolve(X(o,m,r)).then(s=>{t.unwatch[r]=s}).catch(console.error),x},async unmount(r,o=!0){r=C(r),!(!r||!t.mounts[r])&&(t.watching&&r in t.unwatch&&(t.unwatch[r](),delete t.unwatch[r]),o&&await $(t.mounts[r]),t.mountpoints=t.mountpoints.filter(s=>s!==r),delete t.mounts[r])},getMount(r=""){r=g(r)+":";let o=n(r);return{driver:o.driver,base:o.base}},getMounts(r="",o={}){return r=g(r),u(r,o.parents).map(a=>({driver:a.driver,base:a.mountpoint}))}};return x}function X(e,t,n){return e.watch?e.watch((u,m)=>t(u,n+m)):()=>{}}async function $(e){typeof e.dispose=="function"&&await p(e.dispose)}import{existsSync as Le,promises as Oe}from"fs";import{resolve as ze,join as be}from"path";function R(e,t,n){return new Error(`[unstorage] [${e}] ${t}`,n)}function te(e,t){return Array.isArray(t)?R(e,`Missing some of the required options ${t.map(n=>"`"+n+"`").join(", ")}`):R(e,`Missing required option \`${t}\`.`)}import{existsSync as Ke,promises as v}from"fs";import{resolve as ne,dirname as oe}from"path";function B(e){return e.code==="ENOENT"||e.code==="EISDIR"?null:e}function re(e){return e.code==="EEXIST"?null:e}async function _(e,t,n){return await ae(oe(e)),v.writeFile(e,t,n)}function q(e,t){return v.readFile(e,t).catch(B)}function se(e){return v.unlink(e).catch(B)}function ie(e){return v.readdir(e,{withFileTypes:!0}).catch(B).then(t=>t||[])}async function ae(e){Ke(e)||(await ae(oe(e)).catch(re),await v.mkdir(e).catch(re))}async function k(e,t){if(t&&t(e))return[];let n=await ie(e),u=[];return await Promise.all(n.map(async m=>{let l=ne(e,m.name);if(m.isDirectory()){let f=await k(l,t);u.push(...f.map(y=>m.name+"/"+y))}else t&&t(m.name)||u.push(m.name)})),u}async function U(e){let t=await ie(e);await Promise.all(t.map(n=>{let u=ne(e,n.name);return n.isDirectory()?U(u).then(()=>v.rmdir(u)):v.unlink(u)}))}var Be=/\.\.\:|\.\.$/,F="fs-lite",ue=(e={})=>{if(!e.base)throw te(F,"base");e.base=ze(e.base);let t=n=>{if(Be.test(n))throw R(F,`Invalid key: ${JSON.stringify(n)}. It should not contain .. segments`);return be(e.base,n.replace(/:/g,"/"))};return{name:F,options:e,hasItem(n){return Le(t(n))},getItem(n){return q(t(n),"utf8")},getItemRaw(n){return q(t(n))},async getMeta(n){let{atime:u,mtime:m,size:l,birthtime:f,ctime:y}=await Oe.stat(t(n)).catch(()=>({}));return{atime:u,mtime:m,size:l,birthtime:f,ctime:y}},setItem(n,u){if(!e.readOnly)return _(t(n),u,"utf8")},setItemRaw(n,u){if(!e.readOnly)return _(t(n),u)},removeItem(n){if(!e.readOnly)return se(t(n))},getKeys(){return k(t("."),e.ignore)},async clear(){e.readOnly||e.noClear||await U(t("."))}}};function Ue({prefix:e,logger:t}){return b(ee({driver:ue({base:Fe({logger:t})})}),e)}function Fe({logger:e}){let t="";try{t=_e()}catch(n){e.error("could not use homedir, trying tmpdir",{error:n?.message})}if(!t)try{t=qe()}catch(n){e.error("could not use tmpdir, trying process.cwd",{error:n?.message})}if(!t)try{t=process.cwd()}catch(n){e.error("could not use process.cwd, exiting",{error:n?.message}),process.exit(1)}return ke(t,".alliance")}import Me from"pino";function w(e){return t=>(n,u)=>e[t]({...u,msg:n})}function We(e){return M(e,{target:"pino-pretty",options:{colorize:!0,ignore:"time,pid,hostname",messageFormat:"{msg}"}})}function M(e,t){let n=Me({level:e.SERVICE_LOG_LEVEL,redact:["authorization","headers.authorization","req.headers.authorization","res.headers.authorization","req.headers.cookie",'res.headers["set-cookie"]'],transport:t});return{fatal:w(n)("fatal"),error:w(n)("error"),warn:w(n)("warn"),info:w(n)("info"),debug:w(n)("debug"),trace:w(n)("trace"),silent:w(n)("silent"),child:()=>M(e),level:e.SERVICE_LOG_LEVEL}}function je(e){return(t,n,u)=>(e.trace("received request",{url:t.url,params:t.params,query:t.query,body:t.body}),u())}export{O as AllianceError,K as AllianceHeaders,D as DataErrorCode,Y as GatewayErrorCode,V as createBearerToken,Ue as createFileStorage,me as createIndexHtml,M as createLogger,We as createPrettyLogger,de as createPublicKeys,fe as createSystemUserToken,le as getAppManifests,ye as getCleanPublicKey,L as getPrivateKey,Ie as requestErrorHandler,je as requestLoggerHandler,ce as slugify,j as zBooleanEnum,h as zNonEmptyString,S as zSharedConfig};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telia-ace/alliance-internal-node-utilities",
3
- "version": "1.1.0",
3
+ "version": "1.1.1-next.0",
4
4
  "description": "Utilities used internally by packages developed by team Alliance.",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "author": "Telia Company AB",
@@ -24,7 +24,8 @@
24
24
  "pino": "^8.16.2"
25
25
  },
26
26
  "devDependencies": {
27
- "@telia-ace/alliance-framework": "^1.1.0"
27
+ "pino-pretty": "^10.3.1",
28
+ "@telia-ace/alliance-framework": "^1.1.1"
28
29
  },
29
30
  "publishConfig": {
30
31
  "access": "public"