UNPKG

@equinor/fusion-framework-cli

Version:

[![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)](./LICENSE)

1 lines 240 kB
import{loadConfigFromFile as e,mergeConfig as t,build as n}from"vite";import r from"vite-tsconfig-paths";import{dirname as i,resolve as o,basename as s,extname as a,relative as c}from"node:path";import{readPackageUp as l}from"read-package-up";import u,{fileURLToPath as f}from"node:url";import p from"url";import d from"node:module";import h from"util";import{accessSync as m,constants as g,readFileSync as v,statSync as y,existsSync as E,mkdirSync as b,writeFileSync as w}from"node:fs";import{stat as L,mkdir as S}from"node:fs/promises";import{importConfig as C,FileNotFoundError as I}from"@equinor/fusion-imports";import _ from"deepmerge";import D from"node:assert";import{execSync as N}from"node:child_process";import{coerce as O,SemVer as A,satisfies as P}from"semver";import T,{z as R}from"zod";import x from"fs";import $ from"path";import k from"zlib";import F from"crypto";import U from"ora";import{createDevServer as B,processServices as M}from"@equinor/fusion-framework-dev-server";import{enableAuthModule as G}from"@equinor/fusion-framework-module-msal-node";const j=(e=0)=>t=>`[${t+e}m`,z=(e=0)=>t=>`[${38+e};5;${t}m`,H=(e=0)=>(t,n,r)=>`[${38+e};2;${t};${n};${r}m`,q={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(q.modifier);Object.keys(q.color),Object.keys(q.bgColor);const V=function(){const e=new Map;for(const[t,n]of Object.entries(q)){for(const[t,r]of Object.entries(n))q[t]={open:`[${r[0]}m`,close:`[${r[1]}m`},n[t]=q[t],e.set(r[0],r[1]);Object.defineProperty(q,t,{value:n,enumerable:!1})}return Object.defineProperty(q,"codes",{value:e,enumerable:!1}),q.color.close="",q.bgColor.close="",q.color.ansi=j(),q.color.ansi256=z(),q.color.ansi16m=H(),q.bgColor.ansi=j(10),q.bgColor.ansi256=z(10),q.bgColor.ansi16m=H(10),Object.defineProperties(q,{rgbToAnsi256:{value:(e,t,n)=>e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5),enumerable:!1},hexToRgb:{value(e){const t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[n]=t;3===n.length&&(n=[...n].map(e=>e+e).join(""));const r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},enumerable:!1},hexToAnsi256:{value:e=>q.rgbToAnsi256(...q.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return e-8+90;let t,n,r;if(e>=232)t=(10*(e-232)+8)/255,n=t,r=t;else{const i=(e-=16)%36;t=Math.floor(e/36)/5,n=Math.floor(i/6)/5,r=i%6/5}const i=2*Math.max(t,n,r);if(0===i)return 30;let o=30+(Math.round(r)<<2|Math.round(n)<<1|Math.round(t));return 2===i&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(e,t,n)=>q.ansi256ToAnsi(q.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>q.ansi256ToAnsi(q.hexToAnsi256(e)),enumerable:!1}}),q}(),W=(()=>{if(!("navigator"in globalThis))return 0;if(globalThis.navigator.userAgentData){const e=navigator.userAgentData.brands.find(({brand:e})=>"Chromium"===e);if(e&&e.version>93)return 3}return/\b(Chrome|Chromium)\//.test(globalThis.navigator.userAgent)?1:0})(),Y=0!==W&&{level:W},K={stdout:Y,stderr:Y};function Z(e,t,n){let r=e.indexOf(t);if(-1===r)return e;const i=t.length;let o=0,s="";do{s+=e.slice(o,r)+t+n,o=r+i,r=e.indexOf(t,o)}while(-1!==r);return s+=e.slice(o),s}const{stdout:X,stderr:J}=K,Q=Symbol("GENERATOR"),ee=Symbol("STYLER"),te=Symbol("IS_EMPTY"),ne=["ansi","ansi","ansi256","ansi16m"],re=Object.create(null),ie=e=>{const t=(...e)=>e.join(" ");return((e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");const n=X?X.level:0;e.level=void 0===t.level?n:t.level})(t,e),Object.setPrototypeOf(t,oe.prototype),t};function oe(e){return ie(e)}Object.setPrototypeOf(oe.prototype,Function.prototype);for(const[e,t]of Object.entries(V))re[e]={get(){const n=ue(this,le(t.open,t.close,this[ee]),this[te]);return Object.defineProperty(this,e,{value:n}),n}};re.visible={get(){const e=ue(this,this[ee],!0);return Object.defineProperty(this,"visible",{value:e}),e}};const se=(e,t,n,...r)=>"rgb"===e?"ansi16m"===t?V[n].ansi16m(...r):"ansi256"===t?V[n].ansi256(V.rgbToAnsi256(...r)):V[n].ansi(V.rgbToAnsi(...r)):"hex"===e?se("rgb",t,n,...V.hexToRgb(...r)):V[n][e](...r),ae=["rgb","hex","ansi256"];for(const e of ae){re[e]={get(){const{level:t}=this;return function(...n){const r=le(se(e,ne[t],"color",...n),V.color.close,this[ee]);return ue(this,r,this[te])}}};re["bg"+e[0].toUpperCase()+e.slice(1)]={get(){const{level:t}=this;return function(...n){const r=le(se(e,ne[t],"bgColor",...n),V.bgColor.close,this[ee]);return ue(this,r,this[te])}}}}const ce=Object.defineProperties(()=>{},{...re,level:{enumerable:!0,get(){return this[Q].level},set(e){this[Q].level=e}}}),le=(e,t,n)=>{let r,i;return void 0===n?(r=e,i=t):(r=n.openAll+e,i=t+n.closeAll),{open:e,close:t,openAll:r,closeAll:i,parent:n}},ue=(e,t,n)=>{const r=(...e)=>fe(r,1===e.length?""+e[0]:e.join(" "));return Object.setPrototypeOf(r,ce),r[Q]=e,r[ee]=t,r[te]=n,r},fe=(e,t)=>{if(e.level<=0||!t)return e[te]?"":t;let n=e[ee];if(void 0===n)return t;const{openAll:r,closeAll:i}=n;if(t.includes(""))for(;void 0!==n;)t=Z(t,n.close,n.open),n=n.parent;const o=t.indexOf("\n");return-1!==o&&(t=function(e,t,n,r){let i=0,o="";do{const s="\r"===e[r-1];o+=e.slice(i,s?r-1:r)+t+(s?"\r\n":"\n")+n,i=r+1,r=e.indexOf("\n",i)}while(-1!==r);return o+=e.slice(i),o}(t,i,r,o)),r+t+i};Object.defineProperties(oe.prototype,re);const pe=oe();function de(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var he,me,ge,ve;function ye(){if(me)return he;me=1;const e="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};return he=e}function Ee(){if(ve)return ge;ve=1;const e=Number.MAX_SAFE_INTEGER||9007199254740991;return ge={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:e,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}}oe({level:J?J.level:0});var be,we,Le,Se,Ce,Ie,_e,De,Ne,Oe,Ae,Pe,Te,Re={exports:{}};function xe(){return be||(be=1,function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:i}=Ee(),o=ye(),s=(t=e.exports={}).re=[],a=t.safeRe=[],c=t.src=[],l=t.safeSrc=[],u=t.t={};let f=0;const p="[a-zA-Z0-9-]",d=[["\\s",1],["\\d",i],[p,r]],h=(e,t,n)=>{const r=(e=>{for(const[t,n]of d)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e})(t),i=f++;o(e,i,t),u[e]=i,c[i]=t,l[i]=r,s[i]=new RegExp(t,n?"g":void 0),a[i]=new RegExp(r,n?"g":void 0)};h("NUMERICIDENTIFIER","0|[1-9]\\d*"),h("NUMERICIDENTIFIERLOOSE","\\d+"),h("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${p}*`),h("MAINVERSION",`(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})\\.(${c[u.NUMERICIDENTIFIER]})`),h("MAINVERSIONLOOSE",`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})\\.(${c[u.NUMERICIDENTIFIERLOOSE]})`),h("PRERELEASEIDENTIFIER",`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIER]})`),h("PRERELEASEIDENTIFIERLOOSE",`(?:${c[u.NONNUMERICIDENTIFIER]}|${c[u.NUMERICIDENTIFIERLOOSE]})`),h("PRERELEASE",`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`),h("PRERELEASELOOSE",`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`),h("BUILDIDENTIFIER",`${p}+`),h("BUILD",`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`),h("FULLPLAIN",`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`),h("FULL",`^${c[u.FULLPLAIN]}$`),h("LOOSEPLAIN",`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`),h("LOOSE",`^${c[u.LOOSEPLAIN]}$`),h("GTLT","((?:<|>)?=?)"),h("XRANGEIDENTIFIERLOOSE",`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),h("XRANGEIDENTIFIER",`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`),h("XRANGEPLAIN",`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:\\.(${c[u.XRANGEIDENTIFIER]})(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?)?)?`),h("XRANGEPLAINLOOSE",`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?)?)?`),h("XRANGE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`),h("XRANGELOOSE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`),h("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),h("COERCE",`${c[u.COERCEPLAIN]}(?:$|[^\\d])`),h("COERCEFULL",c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?`+`(?:${c[u.BUILD]})?(?:$|[^\\d])`),h("COERCERTL",c[u.COERCE],!0),h("COERCERTLFULL",c[u.COERCEFULL],!0),h("LONETILDE","(?:~>?)"),h("TILDETRIM",`(\\s*)${c[u.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",h("TILDE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`),h("TILDELOOSE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`),h("LONECARET","(?:\\^)"),h("CARETTRIM",`(\\s*)${c[u.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",h("CARET",`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`),h("CARETLOOSE",`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`),h("COMPARATORLOOSE",`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`),h("COMPARATOR",`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`),h("COMPARATORTRIM",`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",h("HYPHENRANGE",`^\\s*(${c[u.XRANGEPLAIN]})\\s+-\\s+(${c[u.XRANGEPLAIN]})\\s*$`),h("HYPHENRANGELOOSE",`^\\s*(${c[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[u.XRANGEPLAINLOOSE]})\\s*$`),h("STAR","(<|>)?=?\\s*\\*"),h("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),h("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(Re,Re.exports)),Re.exports}function $e(){if(_e)return Ie;_e=1;const e=ye(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:n}=Ee(),{safeRe:r,t:i}=xe(),o=function(){if(Le)return we;Le=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return we=n=>n?"object"!=typeof n?e:n:t}(),{compareIdentifiers:s}=function(){if(Ce)return Se;Ce=1;const e=/^[0-9]+$/,t=(t,n)=>{if("number"==typeof t&&"number"==typeof n)return t===n?0:t<n?-1:1;const r=e.test(t),i=e.test(n);return r&&i&&(t=+t,n=+n),t===n?0:r&&!i?-1:i&&!r?1:t<n?-1:1};return Se={compareIdentifiers:t,rcompareIdentifiers:(e,n)=>t(n,e)}}();class a{constructor(s,c){if(c=o(c),s instanceof a){if(s.loose===!!c.loose&&s.includePrerelease===!!c.includePrerelease)return s;s=s.version}else if("string"!=typeof s)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof s}".`);if(s.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",s,c),this.options=c,this.loose=!!c.loose,this.includePrerelease=!!c.includePrerelease;const l=s.trim().match(c.loose?r[i.LOOSE]:r[i.FULL]);if(!l)throw new TypeError(`Invalid Version: ${s}`);if(this.raw=s,this.major=+l[1],this.minor=+l[2],this.patch=+l[3],this.major>n||this.major<0)throw new TypeError("Invalid major version");if(this.minor>n||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>n||this.patch<0)throw new TypeError("Invalid patch version");l[4]?this.prerelease=l[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<n)return t}return e}):this.prerelease=[],this.build=l[5]?l[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(e("SemVer.compare",this.version,this.options,t),!(t instanceof a)){if("string"==typeof t&&t===this.version)return 0;t=new a(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(e){return e instanceof a||(e=new a(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(t){if(t instanceof a||(t=new a(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let n=0;do{const r=this.prerelease[n],i=t.prerelease[n];if(e("prerelease compare",n,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return-1;if(r!==i)return s(r,i)}while(++n)}compareBuild(t){t instanceof a||(t=new a(t,this.options));let n=0;do{const r=this.build[n],i=t.build[n];if(e("build compare",n,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return-1;if(r!==i)return s(r,i)}while(++n)}inc(e,t,n){if(e.startsWith("pre")){if(!t&&!1===n)throw new Error("invalid increment argument: identifier is empty");if(t){const e=`-${t}`.match(this.options.loose?r[i.PRERELEASELOOSE]:r[i.PRERELEASE]);if(!e||e[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,n),this.inc("pre",t,n);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,n),this.inc("pre",t,n);break;case"release":if(0===this.prerelease.length)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(n)?1:0;if(0===this.prerelease.length)this.prerelease=[e];else{let r=this.prerelease.length;for(;--r>=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);if(-1===r){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let r=[t,e];!1===n&&(r=[t]),0===s(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Ie=a}function ke(){if(Ne)return De;Ne=1;const e=$e();return De=(t,n,r=!1)=>{if(t instanceof e)return t;try{return new e(t,n)}catch(e){if(!r)return null;throw e}},De}var Fe,Ue,Be,Me,Ge,je,ze,He,qe,Ve,We=["0BSD","3D-Slicer-1.0","AAL","ADSL","AFL-1.1","AFL-1.2","AFL-2.0","AFL-2.1","AFL-3.0","AGPL-1.0-only","AGPL-1.0-or-later","AGPL-3.0-only","AGPL-3.0-or-later","AMD-newlib","AMDPLPA","AML","AML-glslang","AMPAS","ANTLR-PD","ANTLR-PD-fallback","APAFML","APL-1.0","APSL-1.0","APSL-1.1","APSL-1.2","APSL-2.0","ASWF-Digital-Assets-1.0","ASWF-Digital-Assets-1.1","Abstyles","AdaCore-doc","Adobe-2006","Adobe-Display-PostScript","Adobe-Glyph","Adobe-Utopia","Afmparse","Aladdin","Apache-1.0","Apache-1.1","Apache-2.0","App-s2p","Arphic-1999","Artistic-1.0","Artistic-1.0-Perl","Artistic-1.0-cl8","Artistic-2.0","Artistic-dist","Aspell-RU","BSD-1-Clause","BSD-2-Clause","BSD-2-Clause-Darwin","BSD-2-Clause-Patent","BSD-2-Clause-Views","BSD-2-Clause-first-lines","BSD-2-Clause-pkgconf-disclaimer","BSD-3-Clause","BSD-3-Clause-Attribution","BSD-3-Clause-Clear","BSD-3-Clause-HP","BSD-3-Clause-LBNL","BSD-3-Clause-Modification","BSD-3-Clause-No-Military-License","BSD-3-Clause-No-Nuclear-License","BSD-3-Clause-No-Nuclear-License-2014","BSD-3-Clause-No-Nuclear-Warranty","BSD-3-Clause-Open-MPI","BSD-3-Clause-Sun","BSD-3-Clause-acpica","BSD-3-Clause-flex","BSD-4-Clause","BSD-4-Clause-Shortened","BSD-4-Clause-UC","BSD-4.3RENO","BSD-4.3TAHOE","BSD-Advertising-Acknowledgement","BSD-Attribution-HPND-disclaimer","BSD-Inferno-Nettverk","BSD-Protection","BSD-Source-Code","BSD-Source-beginning-file","BSD-Systemics","BSD-Systemics-W3Works","BSL-1.0","BUSL-1.1","Baekmuk","Bahyph","Barr","Beerware","BitTorrent-1.0","BitTorrent-1.1","Bitstream-Charter","Bitstream-Vera","BlueOak-1.0.0","Boehm-GC","Boehm-GC-without-fee","Borceux","Brian-Gladman-2-Clause","Brian-Gladman-3-Clause","C-UDA-1.0","CAL-1.0","CAL-1.0-Combined-Work-Exception","CATOSL-1.1","CC-BY-1.0","CC-BY-2.0","CC-BY-2.5","CC-BY-2.5-AU","CC-BY-3.0","CC-BY-3.0-AT","CC-BY-3.0-AU","CC-BY-3.0-DE","CC-BY-3.0-IGO","CC-BY-3.0-NL","CC-BY-3.0-US","CC-BY-4.0","CC-BY-NC-1.0","CC-BY-NC-2.0","CC-BY-NC-2.5","CC-BY-NC-3.0","CC-BY-NC-3.0-DE","CC-BY-NC-4.0","CC-BY-NC-ND-1.0","CC-BY-NC-ND-2.0","CC-BY-NC-ND-2.5","CC-BY-NC-ND-3.0","CC-BY-NC-ND-3.0-DE","CC-BY-NC-ND-3.0-IGO","CC-BY-NC-ND-4.0","CC-BY-NC-SA-1.0","CC-BY-NC-SA-2.0","CC-BY-NC-SA-2.0-DE","CC-BY-NC-SA-2.0-FR","CC-BY-NC-SA-2.0-UK","CC-BY-NC-SA-2.5","CC-BY-NC-SA-3.0","CC-BY-NC-SA-3.0-DE","CC-BY-NC-SA-3.0-IGO","CC-BY-NC-SA-4.0","CC-BY-ND-1.0","CC-BY-ND-2.0","CC-BY-ND-2.5","CC-BY-ND-3.0","CC-BY-ND-3.0-DE","CC-BY-ND-4.0","CC-BY-SA-1.0","CC-BY-SA-2.0","CC-BY-SA-2.0-UK","CC-BY-SA-2.1-JP","CC-BY-SA-2.5","CC-BY-SA-3.0","CC-BY-SA-3.0-AT","CC-BY-SA-3.0-DE","CC-BY-SA-3.0-IGO","CC-BY-SA-4.0","CC-PDDC","CC-PDM-1.0","CC-SA-1.0","CC0-1.0","CDDL-1.0","CDDL-1.1","CDL-1.0","CDLA-Permissive-1.0","CDLA-Permissive-2.0","CDLA-Sharing-1.0","CECILL-1.0","CECILL-1.1","CECILL-2.0","CECILL-2.1","CECILL-B","CECILL-C","CERN-OHL-1.1","CERN-OHL-1.2","CERN-OHL-P-2.0","CERN-OHL-S-2.0","CERN-OHL-W-2.0","CFITSIO","CMU-Mach","CMU-Mach-nodoc","CNRI-Jython","CNRI-Python","CNRI-Python-GPL-Compatible","COIL-1.0","CPAL-1.0","CPL-1.0","CPOL-1.02","CUA-OPL-1.0","Caldera","Caldera-no-preamble","Catharon","ClArtistic","Clips","Community-Spec-1.0","Condor-1.1","Cornell-Lossless-JPEG","Cronyx","Crossword","CryptoSwift","CrystalStacker","Cube","D-FSL-1.0","DEC-3-Clause","DL-DE-BY-2.0","DL-DE-ZERO-2.0","DOC","DRL-1.0","DRL-1.1","DSDP","DocBook-DTD","DocBook-Schema","DocBook-Stylesheet","DocBook-XML","Dotseqn","ECL-1.0","ECL-2.0","EFL-1.0","EFL-2.0","EPICS","EPL-1.0","EPL-2.0","EUDatagrid","EUPL-1.0","EUPL-1.1","EUPL-1.2","Elastic-2.0","Entessa","ErlPL-1.1","Eurosym","FBM","FDK-AAC","FSFAP","FSFAP-no-warranty-disclaimer","FSFUL","FSFULLR","FSFULLRSD","FSFULLRWD","FSL-1.1-ALv2","FSL-1.1-MIT","FTL","Fair","Ferguson-Twofish","Frameworx-1.0","FreeBSD-DOC","FreeImage","Furuseth","GCR-docs","GD","GFDL-1.1-invariants-only","GFDL-1.1-invariants-or-later","GFDL-1.1-no-invariants-only","GFDL-1.1-no-invariants-or-later","GFDL-1.1-only","GFDL-1.1-or-later","GFDL-1.2-invariants-only","GFDL-1.2-invariants-or-later","GFDL-1.2-no-invariants-only","GFDL-1.2-no-invariants-or-later","GFDL-1.2-only","GFDL-1.2-or-later","GFDL-1.3-invariants-only","GFDL-1.3-invariants-or-later","GFDL-1.3-no-invariants-only","GFDL-1.3-no-invariants-or-later","GFDL-1.3-only","GFDL-1.3-or-later","GL2PS","GLWTPL","GPL-1.0-only","GPL-1.0-or-later","GPL-2.0-only","GPL-2.0-or-later","GPL-3.0-only","GPL-3.0-or-later","Game-Programming-Gems","Giftware","Glide","Glulxe","Graphics-Gems","Gutmann","HDF5","HIDAPI","HP-1986","HP-1989","HPND","HPND-DEC","HPND-Fenneberg-Livingston","HPND-INRIA-IMAG","HPND-Intel","HPND-Kevlin-Henney","HPND-MIT-disclaimer","HPND-Markus-Kuhn","HPND-Netrek","HPND-Pbmplus","HPND-UC","HPND-UC-export-US","HPND-doc","HPND-doc-sell","HPND-export-US","HPND-export-US-acknowledgement","HPND-export-US-modify","HPND-export2-US","HPND-merchantability-variant","HPND-sell-MIT-disclaimer-xserver","HPND-sell-regexpr","HPND-sell-variant","HPND-sell-variant-MIT-disclaimer","HPND-sell-variant-MIT-disclaimer-rev","HTMLTIDY","HaskellReport","Hippocratic-2.1","IBM-pibs","ICU","IEC-Code-Components-EULA","IJG","IJG-short","IPA","IPL-1.0","ISC","ISC-Veillard","ImageMagick","Imlib2","Info-ZIP","Inner-Net-2.0","InnoSetup","Intel","Intel-ACPI","Interbase-1.0","JPL-image","JPNIC","JSON","Jam","JasPer-2.0","Kastrup","Kazlib","Knuth-CTAN","LAL-1.2","LAL-1.3","LGPL-2.0-only","LGPL-2.0-or-later","LGPL-2.1-only","LGPL-2.1-or-later","LGPL-3.0-only","LGPL-3.0-or-later","LGPLLR","LOOP","LPD-document","LPL-1.0","LPL-1.02","LPPL-1.0","LPPL-1.1","LPPL-1.2","LPPL-1.3a","LPPL-1.3c","LZMA-SDK-9.11-to-9.20","LZMA-SDK-9.22","Latex2e","Latex2e-translated-notice","Leptonica","LiLiQ-P-1.1","LiLiQ-R-1.1","LiLiQ-Rplus-1.1","Libpng","Linux-OpenIB","Linux-man-pages-1-para","Linux-man-pages-copyleft","Linux-man-pages-copyleft-2-para","Linux-man-pages-copyleft-var","Lucida-Bitmap-Fonts","MIPS","MIT","MIT-0","MIT-CMU","MIT-Click","MIT-Festival","MIT-Khronos-old","MIT-Modern-Variant","MIT-Wu","MIT-advertising","MIT-enna","MIT-feh","MIT-open-group","MIT-testregex","MITNFA","MMIXware","MPEG-SSG","MPL-1.0","MPL-1.1","MPL-2.0","MPL-2.0-no-copyleft-exception","MS-LPL","MS-PL","MS-RL","MTLL","Mackerras-3-Clause","Mackerras-3-Clause-acknowledgment","MakeIndex","Martin-Birgmeier","McPhee-slideshow","Minpack","MirOS","Motosoto","MulanPSL-1.0","MulanPSL-2.0","Multics","Mup","NAIST-2003","NASA-1.3","NBPL-1.0","NCBI-PD","NCGL-UK-2.0","NCL","NCSA","NGPL","NICTA-1.0","NIST-PD","NIST-PD-fallback","NIST-Software","NLOD-1.0","NLOD-2.0","NLPL","NOSL","NPL-1.0","NPL-1.1","NPOSL-3.0","NRL","NTIA-PD","NTP","NTP-0","Naumen","NetCDF","Newsletr","Nokia","Noweb","O-UDA-1.0","OAR","OCCT-PL","OCLC-2.0","ODC-By-1.0","ODbL-1.0","OFFIS","OFL-1.0","OFL-1.0-RFN","OFL-1.0-no-RFN","OFL-1.1","OFL-1.1-RFN","OFL-1.1-no-RFN","OGC-1.0","OGDL-Taiwan-1.0","OGL-Canada-2.0","OGL-UK-1.0","OGL-UK-2.0","OGL-UK-3.0","OGTSL","OLDAP-1.1","OLDAP-1.2","OLDAP-1.3","OLDAP-1.4","OLDAP-2.0","OLDAP-2.0.1","OLDAP-2.1","OLDAP-2.2","OLDAP-2.2.1","OLDAP-2.2.2","OLDAP-2.3","OLDAP-2.4","OLDAP-2.5","OLDAP-2.6","OLDAP-2.7","OLDAP-2.8","OLFL-1.3","OML","OPL-1.0","OPL-UK-3.0","OPUBL-1.0","OSET-PL-2.1","OSL-1.0","OSL-1.1","OSL-2.0","OSL-2.1","OSL-3.0","OpenPBS-2.3","OpenSSL","OpenSSL-standalone","OpenVision","PADL","PDDL-1.0","PHP-3.0","PHP-3.01","PPL","PSF-2.0","Parity-6.0.0","Parity-7.0.0","Pixar","Plexus","PolyForm-Noncommercial-1.0.0","PolyForm-Small-Business-1.0.0","PostgreSQL","Python-2.0","Python-2.0.1","QPL-1.0","QPL-1.0-INRIA-2004","Qhull","RHeCos-1.1","RPL-1.1","RPL-1.5","RPSL-1.0","RSA-MD","RSCPL","Rdisc","Ruby","Ruby-pty","SAX-PD","SAX-PD-2.0","SCEA","SGI-B-1.0","SGI-B-1.1","SGI-B-2.0","SGI-OpenGL","SGP4","SHL-0.5","SHL-0.51","SISSL","SISSL-1.2","SL","SMAIL-GPL","SMLNJ","SMPPL","SNIA","SOFA","SPL-1.0","SSH-OpenSSH","SSH-short","SSLeay-standalone","SSPL-1.0","SUL-1.0","SWL","Saxpath","SchemeReport","Sendmail","Sendmail-8.23","Sendmail-Open-Source-1.1","SimPL-2.0","Sleepycat","Soundex","Spencer-86","Spencer-94","Spencer-99","SugarCRM-1.1.3","Sun-PPP","Sun-PPP-2000","SunPro","Symlinks","TAPR-OHL-1.0","TCL","TCP-wrappers","TGPPL-1.0","TMate","TORQUE-1.1","TOSL","TPDL","TPL-1.0","TTWL","TTYP0","TU-Berlin-1.0","TU-Berlin-2.0","TermReadKey","ThirdEye","TrustedQSL","UCAR","UCL-1.0","UMich-Merit","UPL-1.0","URT-RLE","Ubuntu-font-1.0","Unicode-3.0","Unicode-DFS-2015","Unicode-DFS-2016","Unicode-TOU","UnixCrypt","Unlicense","Unlicense-libtelnet","Unlicense-libwhirlpool","VOSTROM","VSL-1.0","Vim","W3C","W3C-19980720","W3C-20150513","WTFPL","Watcom-1.0","Widget-Workshop","Wsuipa","X11","X11-distribute-modifications-variant","X11-swapped","XFree86-1.1","XSkat","Xdebug-1.03","Xerox","Xfig","Xnet","YPL-1.0","YPL-1.1","ZPL-1.1","ZPL-2.0","ZPL-2.1","Zed","Zeeff","Zend-2.0","Zimbra-1.3","Zimbra-1.4","Zlib","any-OSI","any-OSI-perl-modules","bcrypt-Solar-Designer","blessing","bzip2-1.0.6","check-cvs","checkmk","copyleft-next-0.3.0","copyleft-next-0.3.1","curl","cve-tou","diffmark","dtoa","dvipdfm","eGenix","etalab-2.0","fwlw","gSOAP-1.3b","generic-xts","gnuplot","gtkbook","hdparm","iMatix","jove","libpng-1.6.35","libpng-2.0","libselinux-1.0","libtiff","libutil-David-Nugent","lsof","magaz","mailprio","man2html","metamail","mpi-permissive","mpich2","mplus","ngrep","pkgconf","pnmstitch","psfrag","psutils","python-ldap","radvd","snprintf","softSurfer","ssh-keyscan","swrule","threeparttable","ulem","w3m","wwl","xinetd","xkeyboard-config-Zinoviev","xlock","xpp","xzoom","zlib-acknowledgement"],Ye=["AGPL-1.0","AGPL-3.0","BSD-2-Clause-FreeBSD","BSD-2-Clause-NetBSD","GFDL-1.1","GFDL-1.2","GFDL-1.3","GPL-1.0","GPL-2.0","GPL-2.0-with-GCC-exception","GPL-2.0-with-autoconf-exception","GPL-2.0-with-bison-exception","GPL-2.0-with-classpath-exception","GPL-2.0-with-font-exception","GPL-3.0","GPL-3.0-with-GCC-exception","GPL-3.0-with-autoconf-exception","LGPL-2.0","LGPL-2.1","LGPL-3.0","Net-SNMP","Nunit","StandardML-NJ","bzip2-1.0.5","eCos-2.0","wxWindows"],Ke=["389-exception","Asterisk-exception","Autoconf-exception-2.0","Autoconf-exception-3.0","Autoconf-exception-generic","Autoconf-exception-generic-3.0","Autoconf-exception-macro","Bison-exception-1.24","Bison-exception-2.2","Bootloader-exception","Classpath-exception-2.0","CLISP-exception-2.0","cryptsetup-OpenSSL-exception","DigiRule-FOSS-exception","eCos-exception-2.0","Fawkes-Runtime-exception","FLTK-exception","fmt-exception","Font-exception-2.0","freertos-exception-2.0","GCC-exception-2.0","GCC-exception-2.0-note","GCC-exception-3.1","Gmsh-exception","GNAT-exception","GNOME-examples-exception","GNU-compiler-exception","gnu-javamail-exception","GPL-3.0-interface-exception","GPL-3.0-linking-exception","GPL-3.0-linking-source-exception","GPL-CC-1.0","GStreamer-exception-2005","GStreamer-exception-2008","i2p-gpl-java-exception","KiCad-libraries-exception","LGPL-3.0-linking-exception","libpri-OpenH323-exception","Libtool-exception","Linux-syscall-note","LLGPL","LLVM-exception","LZMA-exception","mif-exception","OCaml-LGPL-linking-exception","OCCT-exception-1.0","OpenJDK-assembly-exception-1.0","openvpn-openssl-exception","PS-or-PDF-font-exception-20170817","QPL-1.0-INRIA-2004-exception","Qt-GPL-exception-1.0","Qt-LGPL-exception-1.1","Qwt-exception-1.0","SANE-exception","SHL-2.0","SHL-2.1","stunnel-exception","SWI-exception","Swift-exception","Texinfo-exception","u-boot-exception-2.0","UBDL-exception","Universal-FOSS-exception-1.0","vsftpd-openssl-exception","WxWindows-exception-3.1","x11vnc-openssl-exception"];function Ze(){if(Ue)return Fe;Ue=1;var e=[].concat(We).concat(Ye),t=Ke;return Fe=function(n){var r=0;function i(){return r<n.length}function o(e){if(e instanceof RegExp){var t=n.slice(r).match(e);if(t)return r+=t[0].length,t[0]}else if(n.indexOf(e,r)===r)return r+=e.length,e}function s(){o(/[ ]*/)}function a(){return o(/[A-Za-z0-9-.]+/)}function c(){var e=a();if(!e)throw new Error("Expected idstring at offset "+r);return e}function l(){return function(){for(var e,t=["WITH","AND","OR","(",")",":","+"],i=0;i<t.length&&!(e=o(t[i]));i++);if("+"===e&&r>1&&" "===n[r-2])throw new Error("Space before `+`");return e&&{type:"OPERATOR",string:e}}()||function(){if(o("DocumentRef-"))return{type:"DOCUMENTREF",string:c()}}()||function(){if(o("LicenseRef-"))return{type:"LICENSEREF",string:c()}}()||(i=r,s=a(),-1!==e.indexOf(s)?{type:"LICENSE",string:s}:-1!==t.indexOf(s)?{type:"EXCEPTION",string:s}:void(r=i));var i,s}for(var u=[];i()&&(s(),i());){var f=l();if(!f)throw new Error("Unexpected `"+n[r]+"` at offset "+r);u.push(f)}return u}}function Xe(){return Me?Be:(Me=1,Be=function(e){var t=0;function n(){return t<e.length}function r(){return n()?e[t]:null}function i(){if(!n())throw new Error;t++}function o(e){var t=r();if(t&&"OPERATOR"===t.type&&e===t.string)return i(),t.string}function s(){var e=r();if(e&&"LICENSE"===e.type){i();var t={license:e.string};o("+")&&(t.plus=!0);var n=function(){if(o("WITH")){var e=r();if(e&&"EXCEPTION"===e.type)return i(),e.string;throw new Error("Expected exception after `WITH`")}}();return n&&(t.exception=n),t}}function a(e,t){return function n(){var r=t();if(r){if(!o(e))return r;var i=n();if(!i)throw new Error("Expected expression");return{left:r,conjunction:e.toLowerCase(),right:i}}}}var c=a("AND",function(){return function(){if(o("(")){var e=l();if(!o(")"))throw new Error("Expected `)`");return e}}()||function(){var e=t,n="",s=r();if("DOCUMENTREF"===s.type&&(i(),n+="DocumentRef-"+s.string+":",!o(":")))throw new Error("Expected `:` after `DocumentRef-...`");if("LICENSEREF"===(s=r()).type)return i(),{license:n+="LicenseRef-"+s.string};t=e}()||s()}),l=a("OR",c),u=l();if(!u||n())throw new Error("Syntax error");return u})}function Je(){if(je)return Ge;je=1;var e=Ze(),t=Xe();return Ge=function(n){return t(e(n))}}function Qe(){if(Ve)return qe;Ve=1;var e=Je(),t=function(){if(He)return ze;He=1;var e=Je(),t=We;function n(t){try{return e(t),!0}catch(e){return!1}}function r(e,t){var n=t[0].length-e[0].length;return 0!==n?n:e[0].toUpperCase().localeCompare(t[0].toUpperCase())}var i=[["APGL","AGPL"],["Gpl","GPL"],["GLP","GPL"],["APL","Apache"],["ISD","ISC"],["GLP","GPL"],["IST","ISC"],["Claude","Clause"],[" or later","+"],[" International",""],["GNU","GPL"],["GUN","GPL"],["+",""],["GNU GPL","GPL"],["GNU LGPL","LGPL"],["GNU/GPL","GPL"],["GNU GLP","GPL"],["GNU LESSER GENERAL PUBLIC LICENSE","LGPL"],["GNU Lesser General Public License","LGPL"],["GNU LESSER GENERAL PUBLIC LICENSE","LGPL-2.1"],["GNU Lesser General Public License","LGPL-2.1"],["LESSER GENERAL PUBLIC LICENSE","LGPL"],["Lesser General Public License","LGPL"],["LESSER GENERAL PUBLIC LICENSE","LGPL-2.1"],["Lesser General Public License","LGPL-2.1"],["GNU General Public License","GPL"],["Gnu public license","GPL"],["GNU Public License","GPL"],["GNU GENERAL PUBLIC LICENSE","GPL"],["MTI","MIT"],["Mozilla Public License","MPL"],["Universal Permissive License","UPL"],["WTH","WTF"],["WTFGPL","WTFPL"],["-License",""]].sort(r),o=[function(e){return e.toUpperCase()},function(e){return e.trim()},function(e){return e.replace(/\./g,"")},function(e){return e.replace(/\s+/g,"")},function(e){return e.replace(/\s+/g,"-")},function(e){return e.replace("v","-")},function(e){return e.replace(/,?\s*(\d)/,"-$1")},function(e){return e.replace(/,?\s*(\d)/,"-$1.0")},function(e){return e.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2")},function(e){return e.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2.0")},function(e){return e[0].toUpperCase()+e.slice(1)},function(e){return e.replace("/","-")},function(e){return e.replace(/\s*V\s*(\d)/,"-$1").replace(/(\d)$/,"$1.0")},function(e){return-1!==e.indexOf("3.0")?e+"-or-later":e+"-only"},function(e){return e+"only"},function(e){return e.replace(/(\d)$/,"-$1.0")},function(e){return e.replace(/(-| )?(\d)$/,"-$2-Clause")},function(e){return e.replace(/(-| )clause(-| )(\d)/,"-$3-Clause")},function(e){return e.replace(/\b(Modified|New|Revised)(-| )?BSD((-| )License)?/i,"BSD-3-Clause")},function(e){return e.replace(/\bSimplified(-| )?BSD((-| )License)?/i,"BSD-2-Clause")},function(e){return e.replace(/\b(Free|Net)(-| )?BSD((-| )License)?/i,"BSD-2-Clause-$1BSD")},function(e){return e.replace(/\bClear(-| )?BSD((-| )License)?/i,"BSD-3-Clause-Clear")},function(e){return e.replace(/\b(Old|Original)(-| )?BSD((-| )License)?/i,"BSD-4-Clause")},function(e){return"CC-"+e},function(e){return"CC-"+e+"-4.0"},function(e){return e.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")},function(e){return"CC-"+e.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")+"-4.0"}],s=t.map(function(e){var t=/^(.*)-\d+\.\d+$/.exec(e);return t?[t[0],t[1]]:[e,null]}).reduce(function(e,t){var n=t[1];return e[n]=e[n]||[],e[n].push(t[0]),e},{}),a=Object.keys(s).map(function(e){return[e,s[e]]}).filter(function(e){return 1===e[1].length&&null!==e[0]&&"APL"!==e[0]}).map(function(e){return[e[0],e[1][0]]});s=void 0;var c=[["UNLI","Unlicense"],["WTF","WTFPL"],["2 CLAUSE","BSD-2-Clause"],["2-CLAUSE","BSD-2-Clause"],["3 CLAUSE","BSD-3-Clause"],["3-CLAUSE","BSD-3-Clause"],["AFFERO","AGPL-3.0-or-later"],["AGPL","AGPL-3.0-or-later"],["APACHE","Apache-2.0"],["ARTISTIC","Artistic-2.0"],["Affero","AGPL-3.0-or-later"],["BEER","Beerware"],["BOOST","BSL-1.0"],["BSD","BSD-2-Clause"],["CDDL","CDDL-1.1"],["ECLIPSE","EPL-1.0"],["FUCK","WTFPL"],["GNU","GPL-3.0-or-later"],["LGPL","LGPL-3.0-or-later"],["GPLV1","GPL-1.0-only"],["GPL-1","GPL-1.0-only"],["GPLV2","GPL-2.0-only"],["GPL-2","GPL-2.0-only"],["GPL","GPL-3.0-or-later"],["MIT +NO-FALSE-ATTRIBS","MITNFA"],["MIT","MIT"],["MPL","MPL-2.0"],["X11","X11"],["ZLIB","Zlib"]].concat(a).sort(r),l=function(e){for(var t=0;t<o.length;t++){var r=o[t](e).trim();if(r!==e&&n(r))return r}return null},u=function(e){for(var t=e.toUpperCase(),n=0;n<c.length;n++){var r=c[n];if(t.indexOf(r[0])>-1)return r[1]}return null},f=function(e,t){for(var n=0;n<i.length;n++){var r=i[n],o=r[0];if(e.indexOf(o)>-1){var s=t(e.replace(o,r[1]));if(null!==s)return s}}return null};return ze=function(e,t){var r=void 0===(t=t||{}).upgrade||!!t.upgrade;function i(e){return r?function(e){return-1!==["GPL-1.0","LGPL-1.0","AGPL-1.0","GPL-2.0","LGPL-2.0","AGPL-2.0","LGPL-2.1"].indexOf(e)?e+"-only":-1!==["GPL-1.0+","GPL-2.0+","GPL-3.0+","LGPL-2.0+","LGPL-2.1+","LGPL-3.0+","AGPL-1.0+","AGPL-3.0+"].indexOf(e)?e.replace(/\+$/,"-or-later"):-1!==["GPL-3.0","LGPL-3.0","AGPL-3.0"].indexOf(e)?e+"-or-later":e}(e):e}if("string"!=typeof e||0===e.trim().length)throw Error("Invalid argument. Expected non-empty string.");if(n(e=e.trim()))return i(e);var o=e.replace(/\+$/,"").trim();if(n(o))return i(o);var s=l(e);return null!==s||null!==(s=f(e,function(e){return n(e)?e:l(e)}))||null!==(s=u(e))||null!==(s=f(e,u))?i(s):null}}(),n='license should be a valid SPDX license expression (without "LicenseRef"), "UNLICENSED", or "SEE LICENSE IN <filename>"',r=/^SEE LICEN[CS]E IN (.+)$/;function i(e,t){return t.slice(0,e.length)===e}function o(e){if(e.hasOwnProperty("license")){var t=e.license;return i("LicenseRef",t)||i("DocumentRef",t)}return o(e.left)||o(e.right)}return qe=function(i){var s;try{s=e(i)}catch(e){var a;if("UNLICENSED"===i||"UNLICENCED"===i)return{validForOldPackages:!0,validForNewPackages:!0,unlicensed:!0};if(a=r.exec(i))return{validForOldPackages:!0,validForNewPackages:!0,inFile:a[1]};var c={validForOldPackages:!1,validForNewPackages:!1,warnings:[n]};if(0!==i.trim().length){var l=t(i);l&&c.warnings.push('license is similar to the valid expression "'+l+'"')}return c}return o(s)?{validForNewPackages:!1,validForOldPackages:!1,spdx:!0,warnings:[n]}:{validForNewPackages:!0,validForOldPackages:!0,spdx:!0}}}var et,tt,nt,rt,it,ot,st,at,ct,lt,ut,ft={};function pt(){if(et)return ft;et=1,Object.defineProperty(ft,"__esModule",{value:!0}),ft.LRUCache=void 0;const e="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,t=new Set,n="object"==typeof process&&process?process:{},r=(e,t,r,i)=>{"function"==typeof n.emitWarning?n.emitWarning(e,t,r,i):console.error(`[${r}] ${t}: ${e}`)};let i=globalThis.AbortController,o=globalThis.AbortSignal;if(void 0===i){o=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(e,t){this._onabort.push(t)}},i=class{constructor(){t()}signal=new o;abort(e){if(!this.signal.aborted){this.signal.reason=e,this.signal.aborted=!0;for(const t of this.signal._onabort)t(e);this.signal.onabort?.(e)}}};let e="1"!==n.env?.LRU_CACHE_IGNORE_AC_WARNING;const t=()=>{e&&(e=!1,r("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}const s=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),a=e=>s(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?c:null:null;class c extends Array{constructor(e){super(e),this.fill(0)}}class l{heap;length;static#e=!1;static create(e){const t=a(e);if(!t)return[];l.#e=!0;const n=new l(e,t);return l.#e=!1,n}constructor(e,t){if(!l.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}}class u{#t;#n;#r;#i;#o;#s;#a;#c;get perf(){return this.#c}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#l;#u;#f;#p;#d;#h;#m;#g;#v;#y;#E;#b;#w;#L;#S;#C;#I;#_;#D;static unsafeExposeInternals(e){return{starts:e.#w,ttls:e.#L,autopurgeTimers:e.#S,sizes:e.#b,keyMap:e.#f,keyList:e.#p,valList:e.#d,next:e.#h,prev:e.#m,get head(){return e.#g},get tail(){return e.#v},free:e.#y,isBackgroundFetch:t=>e.#N(t),backgroundFetch:(t,n,r,i)=>e.#O(t,n,r,i),moveToTail:t=>e.#A(t),indexes:t=>e.#P(t),rindexes:t=>e.#T(t),isStale:t=>e.#R(t)}}get max(){return this.#t}get maxSize(){return this.#n}get calculatedSize(){return this.#u}get size(){return this.#l}get fetchMethod(){return this.#s}get memoMethod(){return this.#a}get dispose(){return this.#r}get onInsert(){return this.#i}get disposeAfter(){return this.#o}constructor(n){const{max:i=0,ttl:o,ttlResolution:c=1,ttlAutopurge:f,updateAgeOnGet:p,updateAgeOnHas:d,allowStale:h,dispose:m,onInsert:g,disposeAfter:v,noDisposeOnSet:y,noUpdateTTL:E,maxSize:b=0,maxEntrySize:w=0,sizeCalculation:L,fetchMethod:S,memoMethod:C,noDeleteOnFetchRejection:I,noDeleteOnStaleGet:_,allowStaleOnFetchRejection:D,allowStaleOnFetchAbort:N,ignoreFetchAbort:O,perf:A}=n;if(void 0!==A&&"function"!=typeof A?.now)throw new TypeError("perf option must have a now() method if specified");if(this.#c=A??e,0!==i&&!s(i))throw new TypeError("max option must be a nonnegative integer");const P=i?a(i):Array;if(!P)throw new Error("invalid max value: "+i);if(this.#t=i,this.#n=b,this.maxEntrySize=w||this.#n,this.sizeCalculation=L,this.sizeCalculation){if(!this.#n&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(void 0!==C&&"function"!=typeof C)throw new TypeError("memoMethod must be a function if defined");if(this.#a=C,void 0!==S&&"function"!=typeof S)throw new TypeError("fetchMethod must be a function if specified");if(this.#s=S,this.#I=!!S,this.#f=new Map,this.#p=new Array(i).fill(void 0),this.#d=new Array(i).fill(void 0),this.#h=new P(i),this.#m=new P(i),this.#g=0,this.#v=0,this.#y=l.create(i),this.#l=0,this.#u=0,"function"==typeof m&&(this.#r=m),"function"==typeof g&&(this.#i=g),"function"==typeof v?(this.#o=v,this.#E=[]):(this.#o=void 0,this.#E=void 0),this.#C=!!this.#r,this.#D=!!this.#i,this.#_=!!this.#o,this.noDisposeOnSet=!!y,this.noUpdateTTL=!!E,this.noDeleteOnFetchRejection=!!I,this.allowStaleOnFetchRejection=!!D,this.allowStaleOnFetchAbort=!!N,this.ignoreFetchAbort=!!O,0!==this.maxEntrySize){if(0!==this.#n&&!s(this.#n))throw new TypeError("maxSize must be a positive integer if specified");if(!s(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#x()}if(this.allowStale=!!h,this.noDeleteOnStaleGet=!!_,this.updateAgeOnGet=!!p,this.updateAgeOnHas=!!d,this.ttlResolution=s(c)||0===c?c:1,this.ttlAutopurge=!!f,this.ttl=o||0,this.ttl){if(!s(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#$()}if(0===this.#t&&0===this.ttl&&0===this.#n)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#n){const e="LRU_CACHE_UNBOUNDED";if((e=>!t.has(e))(e)){t.add(e);r("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",e,u)}}}getRemainingTTL(e){return this.#f.has(e)?1/0:0}#$(){const e=new c(this.#t),t=new c(this.#t);this.#L=e,this.#w=t;const n=this.ttlAutopurge?new Array(this.#t):void 0;this.#S=n,this.#k=(r,i,o=this.#c.now())=>{if(t[r]=0!==i?o:0,e[r]=i,n?.[r]&&(clearTimeout(n[r]),n[r]=void 0),0!==i&&n){const e=setTimeout(()=>{this.#R(r)&&this.#F(this.#p[r],"expire")},i+1);e.unref&&e.unref(),n[r]=e}},this.#U=n=>{t[n]=0!==e[n]?this.#c.now():0},this.#B=(n,o)=>{if(e[o]){const s=e[o],a=t[o];if(!s||!a)return;n.ttl=s,n.start=a,n.now=r||i();const c=n.now-a;n.remainingTTL=s-c}};let r=0;const i=()=>{const e=this.#c.now();if(this.ttlResolution>0){r=e;const t=setTimeout(()=>r=0,this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=n=>{const o=this.#f.get(n);if(void 0===o)return 0;const s=e[o],a=t[o];if(!s||!a)return 1/0;return s-((r||i())-a)},this.#R=n=>{const o=t[n],s=e[n];return!!s&&!!o&&(r||i())-o>s}}#U=()=>{};#B=()=>{};#k=()=>{};#R=()=>!1;#x(){const e=new c(this.#t);this.#u=0,this.#b=e,this.#M=t=>{this.#u-=e[t],e[t]=0},this.#G=(e,t,n,r)=>{if(this.#N(t))return 0;if(!s(n)){if(!r)throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");if("function"!=typeof r)throw new TypeError("sizeCalculation must be a function");if(n=r(t,e),!s(n))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return n},this.#j=(t,n,r)=>{if(e[t]=n,this.#n){const n=this.#n-e[t];for(;this.#u>n;)this.#z(!0)}this.#u+=e[t],r&&(r.entrySize=n,r.totalCalculatedSize=this.#u)}}#M=e=>{};#j=(e,t,n)=>{};#G=(e,t,n,r)=>{if(n||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#P({allowStale:e=this.allowStale}={}){if(this.#l)for(let t=this.#v;this.#H(t)&&(!e&&this.#R(t)||(yield t),t!==this.#g);)t=this.#m[t]}*#T({allowStale:e=this.allowStale}={}){if(this.#l)for(let t=this.#g;this.#H(t)&&(!e&&this.#R(t)||(yield t),t!==this.#v);)t=this.#h[t]}#H(e){return void 0!==e&&this.#f.get(this.#p[e])===e}*entries(){for(const e of this.#P())void 0===this.#d[e]||void 0===this.#p[e]||this.#N(this.#d[e])||(yield[this.#p[e],this.#d[e]])}*rentries(){for(const e of this.#T())void 0===this.#d[e]||void 0===this.#p[e]||this.#N(this.#d[e])||(yield[this.#p[e],this.#d[e]])}*keys(){for(const e of this.#P()){const t=this.#p[e];void 0===t||this.#N(this.#d[e])||(yield t)}}*rkeys(){for(const e of this.#T()){const t=this.#p[e];void 0===t||this.#N(this.#d[e])||(yield t)}}*values(){for(const e of this.#P()){void 0===this.#d[e]||this.#N(this.#d[e])||(yield this.#d[e])}}*rvalues(){for(const e of this.#T()){void 0===this.#d[e]||this.#N(this.#d[e])||(yield this.#d[e])}}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(const n of this.#P()){const r=this.#d[n],i=this.#N(r)?r.__staleWhileFetching:r;if(void 0!==i&&e(i,this.#p[n],this))return this.get(this.#p[n],t)}}forEach(e,t=this){for(const n of this.#P()){const r=this.#d[n],i=this.#N(r)?r.__staleWhileFetching:r;void 0!==i&&e.call(t,i,this.#p[n],this)}}rforEach(e,t=this){for(const n of this.#T()){const r=this.#d[n],i=this.#N(r)?r.__staleWhileFetching:r;void 0!==i&&e.call(t,i,this.#p[n],this)}}purgeStale(){let e=!1;for(const t of this.#T({allowStale:!0}))this.#R(t)&&(this.#F(this.#p[t],"expire"),e=!0);return e}info(e){const t=this.#f.get(e);if(void 0===t)return;const n=this.#d[t],r=this.#N(n)?n.__staleWhileFetching:n;if(void 0===r)return;const i={value:r};if(this.#L&&this.#w){const e=this.#L[t],n=this.#w[t];if(e&&n){const t=e-(this.#c.now()-n);i.ttl=t,i.start=Date.now()}}return this.#b&&(i.size=this.#b[t]),i}dump(){const e=[];for(const t of this.#P({allowStale:!0})){const n=this.#p[t],r=this.#d[t],i=this.#N(r)?r.__staleWhileFetching:r;if(void 0===i||void 0===n)continue;const o={value:i};if(this.#L&&this.#w){o.ttl=this.#L[t];const e=this.#c.now()-this.#w[t];o.start=Math.floor(Date.now()-e)}this.#b&&(o.size=this.#b[t]),e.unshift([n,o])}return e}load(e){this.clear();for(const[t,n]of e){if(n.start){const e=Date.now()-n.start;n.start=this.#c.now()-e}this.set(t,n.value,n)}}set(e,t,n={}){if(void 0===t)return this.delete(e),this;const{ttl:r=this.ttl,start:i,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:s=this.sizeCalculation,status:a}=n;let{noUpdateTTL:c=this.noUpdateTTL}=n;const l=this.#G(e,t,n.size||0,s);if(this.maxEntrySize&&l>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this.#F(e,"set"),this;let u=0===this.#l?void 0:this.#f.get(e);if(void 0===u)u=0===this.#l?this.#v:0!==this.#y.length?this.#y.pop():this.#l===this.#t?this.#z(!1):this.#l,this.#p[u]=e,this.#d[u]=t,this.#f.set(e,u),this.#h[this.#v]=u,this.#m[u]=this.#v,this.#v=u,this.#l++,this.#j(u,l,a),a&&(a.set="add"),c=!1,this.#D&&this.#i?.(t,e,"add");else{this.#A(u);const n=this.#d[u];if(t!==n){if(this.#I&&this.#N(n)){n.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:t}=n;void 0===t||o||(this.#C&&this.#r?.(t,e,"set"),this.#_&&this.#E?.push([t,e,"set"]))}else o||(this.#C&&this.#r?.(n,e,"set"),this.#_&&this.#E?.push([n,e,"set"]));if(this.#M(u),this.#j(u,l,a),this.#d[u]=t,a){a.set="replace";const e=n&&this.#N(n)?n.__staleWhileFetching:n;void 0!==e&&(a.oldValue=e)}}else a&&(a.set="update");this.#D&&this.onInsert?.(t,e,t===n?"update":"replace")}if(0===r||this.#L||this.#$(),this.#L&&(c||this.#k(u,r,i),a&&this.#B(a,u)),!o&&this.#_&&this.#E){const e=this.#E;let t;for(;t=e?.shift();)this.#o?.(...t)}return this}pop(){try{for(;this.#l;){const e=this.#d[this.#g];if(this.#z(!0),this.#N(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(void 0!==e)return e}}finally{if(this.#_&&this.#E){const e=this.#E;let t;for(;t=e?.shift();)this.#o?.(...t)}}}#z(e){const t=this.#g,n=this.#p[t],r=this.#d[t];return this.#I&&this.#N(r)?r.__abortController.abort(new Error("evicted")):(this.#C||this.#_)&&(this.#C&&this.#r?.(r,n,"evict"),this.#_&&this.#E?.push([r,n,"evict"])),this.#M(t),this.#S?.[t]&&(clearTimeout(this.#S[t]),this.#S[t]=void 0),e&&(this.#p[t]=void 0,this.#d[t]=void 0,this.#y.push(t)),1===this.#l?(this.#g=this.#v=0,this.#y.length=0):this.#g=this.#h[t],this.#f.delete(n),this.#l--,t}has(e,t={}){const{updateAgeOnHas:n=this.updateAgeOnHas,status:r}=t,i=this.#f.get(e);if(void 0!==i){const e=this.#d[i];if(this.#N(e)&&void 0===e.__staleWhileFetching)return!1;if(!this.#R(i))return n&&this.#U(i),r&&(r.has="hit",this.#B(r,i)),!0;r&&(r.has="stale",this.#B(r,i))}else r&&(r.has="miss");return!1}peek(e,t={}){const{allowStale:n=this.allowStale}=t,r=this.#f.get(e);if(void 0===r||!n&&this.#R(r))return;const i=this.#d[r];return this.#N(i)?i.__staleWhileFetching:i}#O(e,t,n,r){const o=void 0===t?void 0:this.#d[t];if(this.#N(o))return o;const s=new i,{signal:a}=n;a?.addEventListener("abort",()=>s.abort(a.reason),{signal:s.signal});const c={signal:s.signal,options:n,context:r},l=(r,i=!1)=>{const{aborted:o}=s.signal,a=n.ignoreFetchAbort&&void 0!==r;if(n.status&&(o&&!i?(n.status.fetchAborted=!0,n.status.fetchError=s.signal.reason,a&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),o&&!a&&!i)return u(s.signal.reason);const l=f,p=this.#d[t];return(p===f||a&&i&&void 0===p)&&(void 0===r?void 0!==l.__staleWhileFetching?this.#d[t]=l.__staleWhileFetching:this.#F(e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,r,c.options))),r},u=r=>{const{aborted:i}=s.signal,o=i&&n.allowStaleOnFetchAbort,a=o||n.allowStaleOnFetchRejection,c=a||n.noDeleteOnFetchRejection,l=f;if(this.#d[t]===f){!c||void 0===l.__staleWhileFetching?this.#F(e,"fetch"):o||(this.#d[t]=l.__staleWhileFetching)}if(a)return n.status&&void 0!==l.__staleWhileFetching&&(n.status.returnedStale=!0),l.__staleWhileFetching;if(l.__returned===l)throw r};n.status&&(n.status.fetchDispatched=!0);const f=new Promise((t,r)=>{const i=this.#s?.(e,o,c);i&&i instanceof Promise&&i.then(e=>t(void 0===e?void 0:e),r),s.signal.addEventListener("abort",()=>{n.ignoreFetchAbort&&!n.allowStaleOnFetchAbort||(t(void 0),n.allowStaleOnFetchAbort&&(t=e=>l(e,!0)))})}).then(l,e=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=e),u(e))),p=Object.assign(f,{__abortController:s,__staleWhileFetching:o,__returned:void 0});return void 0===t?(this.set(e,p,{...c.options,status:void 0}),t=this.#f.get(e)):this.#d[t]=p,p}#N(e){if(!this.#I)return!1;const t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof i}async fetch(e,t={}){const{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:s=this.noDisposeOnSet,size:a=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:u=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:f=this.allowStaleOnFetchRejection,ignoreFetchAbort:p=this.ignoreFetchAbort,allowStaleOnFetchAbort:d=this.allowStaleOnFetchAbort,context:h,forceRefresh:m=!1,status:g,signal:v}=t;if(!this.#I)return g&&(g.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,status:g});const y={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,ttl:o,noDisposeOnSet:s,size:a,sizeCalculation:c,noUpdateTTL:l,noDeleteOnFetchRejection:u,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:d,ignoreFetchAbort:p,status:g,signal:v};let E=this.#f.get(e);if(void 0===E){g&&(g.fetch="miss");const t=this.#O(e,E,y,h);return t.__returned=t}{const t=this.#d[E];if(this.#N(t)){const e=n&&void 0!==t.__staleWhileFetching;return g&&(g.fetch="inflight",e&&(g.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}const i=this.#R(E);if(!m&&!i)return g&&(g.fetch="hit"),this.#A(E),r&&this.#U(E),g&&this.#B(g,E),t;const o=this.#O(e,E,y,h),s=void 0!==o.__staleWhileFetching&&n;return g&&(g.fet