vbapm 0.6.15 → 0.7.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.
Files changed (53) hide show
  1. package/README.md +46 -0
  2. package/addins/build/vbapm.xlam +0 -0
  3. package/lib/actions/add-source.d.ts +11 -0
  4. package/lib/add-source-_Z4tr2ea.js +17 -0
  5. package/lib/bin/vbapm-add.d.ts +2 -0
  6. package/lib/build-project-CIZanDh1.js +3 -0
  7. package/lib/{build-target-D6L5nsgt.js → build-target-B03OPzeI.js} +1 -1
  8. package/lib/{create-project-CPIRr0DV.js → create-project-CTAlegO8.js} +1 -1
  9. package/lib/debug.js +1 -1
  10. package/lib/errors.d.ts +4 -0
  11. package/lib/export-project-DdTYRyAw.js +4 -0
  12. package/lib/export-target-CEupP86g.js +4 -0
  13. package/lib/{get-target-CH6IpAa1.js → get-target-Ba_ZoGUl.js} +1 -1
  14. package/lib/index-CB6KQLC7.js +13 -0
  15. package/lib/{index-D-khpcjL.js → index-Cwtynogk.js} +9 -9
  16. package/lib/index-_8uEunjn.js +6 -0
  17. package/lib/{index-Dg07BXJE.js → index-mBZsirl0.js} +1 -1
  18. package/lib/index.d.ts +1 -0
  19. package/lib/index.js +1 -1
  20. package/lib/init-project-BY-a8CIk.js +15 -0
  21. package/lib/installer-C0iBwEpK.js +9 -0
  22. package/lib/{load-from-project-Bpb6Ne_i.js → load-from-project-wNJg8fme.js} +1 -1
  23. package/lib/one_ini_bg.wasm +0 -0
  24. package/lib/project-DFh-2QTw.js +20 -0
  25. package/lib/{run-macro-D_9-BO3U.js → run-macro-Ck_8Iku3.js} +1 -1
  26. package/lib/sat-solver-CqS8Vf6C.js +1 -0
  27. package/lib/test-project-CM-XUOdH.js +1 -0
  28. package/lib/toml-patch-r8oqFm0h.js +3 -0
  29. package/lib/transform-target-DJmqMjY0.js +2 -0
  30. package/lib/vbapm-add-QPN5uEGK.js +16 -0
  31. package/lib/vbapm-build-BKtQ6OeP.js +9 -0
  32. package/lib/vbapm-export-4H_qDinP.js +7 -0
  33. package/lib/{vbapm-init-csKsZ87H.js → vbapm-init-BMY4x_xq.js} +1 -1
  34. package/lib/{vbapm-new-Dt0tX1xQ.js → vbapm-new-DLW9SdvJ.js} +1 -1
  35. package/lib/{vbapm-run-Ccciwg2y.js → vbapm-run-DzRxAhlD.js} +2 -2
  36. package/lib/{vbapm-test-u7AWC-AV.js → vbapm-test-DInh0MDC.js} +1 -1
  37. package/lib/vbapm-version-3Xv7JjGv.js +8 -0
  38. package/lib/vbapm.js +2 -1
  39. package/package.json +124 -137
  40. package/lib/build-project-BczswKQl.js +0 -3
  41. package/lib/export-project-DQ3bfvbV.js +0 -4
  42. package/lib/export-target-CN6RA_mA.js +0 -4
  43. package/lib/index-DXFu_Z-o.js +0 -6
  44. package/lib/init-project-dRuDA4YO.js +0 -15
  45. package/lib/installer-CJlDenLg.js +0 -9
  46. package/lib/project-C3bWzV0O.js +0 -29
  47. package/lib/sat-solver-5AniWyxz.js +0 -1
  48. package/lib/test-project-BTkTNZXs.js +0 -1
  49. package/lib/toml-patch.es-CxrbsPnB.js +0 -3
  50. package/lib/transform-target-Doak2S1q.js +0 -2
  51. package/lib/vbapm-build-B1OOy6VL.js +0 -9
  52. package/lib/vbapm-export-vvUDCDqi.js +0 -7
  53. package/lib/vbapm-version-Bsb-cWCD.js +0 -8
@@ -1 +0,0 @@
1
- "use strict";var r=require("./installer-CJlDenLg.js"),t=require("./run-macro-D_9-BO3U.js");exports.testProject=async function(s){const{target:e,args:a}=s,n=r.env.isWindows?"CON":"/dev/stdout";await t.runMacro({target:e,macro:"Tests.Run",args:[n,...a]})};
@@ -1,3 +0,0 @@
1
- "use strict";
2
- //! @decimalturn/toml-patch v0.7.0 - https://github.com/DecimalTurn/toml-patch - @license: MIT
3
- var e,t;function n(t){return t.type===e.Document}function r(t){return t.type===e.Table}function o(t){return t.type===e.TableArray}function l(t){return t.type===e.KeyValue}function a(t){return t.type===e.String}function i(t){return t.type===e.DateTime}function s(t){return t.type===e.InlineArray}function c(t){return t.type===e.InlineItem}function u(t){return t.type===e.InlineTable}function d(t){return t.type===e.Comment}function f(e){return n(e)||r(e)||o(e)||u(e)||s(e)}function m(t){return function(t){return t.type===e.TableKey}(t)||function(t){return t.type===e.TableArrayKey}(t)||c(t)}!function(e){e.Document="Document",e.Table="Table",e.TableKey="TableKey",e.TableArray="TableArray",e.TableArrayKey="TableArrayKey",e.KeyValue="KeyValue",e.Key="Key",e.String="String",e.Integer="Integer",e.Float="Float",e.Boolean="Boolean",e.DateTime="DateTime",e.InlineArray="InlineArray",e.InlineItem="InlineItem",e.InlineTable="InlineTable",e.Comment="Comment"}(e||(e={}));class p{constructor(e){this.iterator=e,this.index=-1,this.value=void 0,this.done=!1,this.peeked=null}next(){var e;if(this.done)return h();const t=this.peeked||this.iterator.next();return this.index+=1,this.value=t.value,this.done=null!==(e=t.done)&&void 0!==e&&e,this.peeked=null,t}peek(){return this.done?h():(this.peeked||(this.peeked=this.iterator.next()),this.peeked)}[Symbol.iterator](){return this}}function h(){return{value:void 0,done:!0}}function w(e){return{lines:e.end.line-e.start.line+1,columns:e.end.column-e.start.column}}function g(e,t){const n=Array.isArray(e)?e:y(e),r=n.findIndex(e=>e>=t)+1;return{line:r,column:t-(n[r-2]+1||0)}}function y(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];"\n"===r?t.push(n):"\r"===r&&("\n"===e[n+1]?(t.push(n+1),n++):t.push(n))}return t.push(e.length),t}function v(e){return{line:e.line,column:e.column}}function b(e){return{start:v(e.start),end:v(e.end)}}class $ extends Error{constructor(e,t,n){let r=`Error parsing TOML (${t.line}, ${t.column+1}):\n`;if(e){const n=function(e,t){const n=y(e),r=void 0!==n[t.line-2]?n[t.line-2]+1:0,o=n[t.line-1]||e.length;return e.substring(r,o)}(e,t),o=`${function(e,t=" "){return t.repeat(e)}(t.column)}^`;n&&(r+=`${n}\n${o}\n`)}r+=n,super(r),this.line=t.line,this.column=t.column}}!function(e){e.Bracket="Bracket",e.Curly="Curly",e.Equal="Equal",e.Comma="Comma",e.Dot="Dot",e.Comment="Comment",e.Literal="Literal"}(t||(t={}));const S=/\s/,T='"',I="'",k=/[\w,\d,\",\',\+,\-,\_]/;function*x(e){const n=new p("string"==typeof(r=e)?function*(e){for(let t=0;t<e.length;t++)yield e[t]}(r):r[Symbol.iterator]());var r;n.next();const o=function(e){const t=y(e);return(e,n)=>({start:g(t,e),end:g(t,n)})}(e);for(;!n.done;){const r=n.value.charCodeAt(0);if((r<=31||127===r)&&9!==r&&13!==r&&10!==r)throw new $(e,g(e,n.index),`Control character 0x${r.toString(16).toUpperCase().padStart(2,"0")} is not allowed in TOML`);if("\r"===n.value){const t=n.peek();if(t.done||"\n"!==t.value)throw new $(e,g(e,n.index),"Invalid standalone CR (\\r); CR must be part of a CRLF sequence")}if(S.test(n.value));else if("["===n.value||"]"===n.value)yield E(n,o,t.Bracket);else if("{"===n.value||"}"===n.value)yield E(n,o,t.Curly);else if("="===n.value)yield E(n,o,t.Equal);else if(","===n.value)yield E(n,o,t.Comma);else if("."===n.value)yield E(n,o,t.Dot);else if("#"===n.value)yield C(n,o,e);else{const t=O(e,n.index,I)||O(e,n.index,T);t?yield A(n,o,t,e):yield _(n,o,e)}n.next()}}function E(e,t,n){return{type:n,raw:e.value,loc:t(e.index,e.index+1)}}function C(e,n,r){const o=e.index;let l=e.value;for(;!e.peek().done&&"\n"!==e.peek().value&&"\r"!==e.peek().value;){e.next();const t=e.value.charCodeAt(0);if((t<=31||127===t)&&9!==t)throw new $(r,g(r,e.index),`Control character 0x${t.toString(16).toUpperCase().padStart(2,"0")} is not allowed in TOML`);l+=e.value}return{type:t.Comment,raw:l,loc:n(o,e.index+1)}}function A(e,n,r,o){const l=e.index,a=r+r+r;let i=a;for(e.next(),e.next(),e.next();!e.done;){if(O(o,e.index,r)){let t=3;for(;o[e.index+t]===r;)t++;if(t>=6)throw new $(o,g(o,e.index),`Invalid multiline string: ${t} consecutive ${r} characters`);if(3===t)break;i+=r.repeat(t-3);for(let n=0;n<t-3;n++)e.next();break}if("\r"===e.value){const t=e.peek();if(t.done||"\n"!==t.value)throw new $(o,g(o,e.index),"Invalid standalone CR (\\r) in multiline string (must be part of CRLF sequence)")}const t=e.value.charCodeAt(0);if((t<=31||127===t)&&9!==t&&10!==t&&13!==t){const n=r===T?"multiline basic strings":"multiline literal strings",l=`0x${t.toString(16).toUpperCase().padStart(2,"0")}`;let a="";0===t?a="Null":127===t&&(a="DEL");const i=a?`${a} (control character ${l}) is not allowed in ${n}`:`Control character ${l} is not allowed in ${n}`;throw new $(o,g(o,e.index),i)}i+=e.value,e.next()}if(e.done){if(r===T){const t=o.slice(0,e.index);if(/\\"+$/.test(t))throw new $(o,g(o,e.index),`Expected close of multiline string with ${a}, reached end of file. Check for escape sequences (\\) that may be preventing proper string closure`)}throw new $(o,g(o,e.index),`Expected close of multiline string with ${a}, reached end of file`)}return i+=a,e.next(),e.next(),{type:t.Literal,raw:i,loc:n(l,e.index+1)}}function _(e,n,r){if(!k.test(e.value))throw new $(r,g(r,e.index),`Unsupported character "${e.value}". Expected ALPHANUMERIC, ", ', +, -, or _`);const o=e.index;let l=e.value,a=e.value===T,i=e.value===I;const s=e=>{if(e.peek().done)return!0;const t=e.peek().value;return!(a||i)&&(S.test(t)||","===t||"."===t||"]"===t||"}"===t||"="===t||"#"===t)};for(;!e.done&&!s(e);){if(e.next(),a||i){const t=e.value.charCodeAt(0);if((t<=31||127===t)&&9!==t){const n=a?"basic strings":"literal strings",o=`0x${t.toString(16).toUpperCase().padStart(2,"0")}`;let l="";10===t?l="Newline":13===t?l="Carriage return":0===t?l="Null":127===t&&(l="DEL");const i=l?`${l} (control character ${o}) is not allowed in ${n}`:`Control character ${o} is not allowed in ${n}`;throw new $(r,g(r,e.index),i)}}if(e.value===T&&(a=!a),e.value!==I||a||(i=!i),l+=e.value,e.peek().done)break;let t=e.peek().value;a&&"\\"===e.value&&(t===T?(l+=T,e.next()):"\\"===t&&(l+="\\",e.next()))}if(a||i)throw new $(r,g(r,o),`Expected close of string with ${a?T:I}`);return{type:t.Literal,raw:l,loc:n(o,e.index+1)}}function O(e,t,n){if(!n)return!1;if(!(e[t]===n&&e[t+1]===n&&e[t+2]===n))return!1;if(n===I)return n;const r=e.slice(0,t).match(/\\+$/);if(!r)return n;return!(r[0].length%2!=0)&&n}function U(e){return e[e.length-1]}function D(){return Object.create(null)}function F(e){return"number"==typeof e&&e%1==0&&isFinite(e)&&!Object.is(e,-0)}function L(e){return"[object Date]"===Object.prototype.toString.call(e)}function M(e){return e&&"object"==typeof e&&!L(e)&&!Array.isArray(e)}function K(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function N(e,...t){return t.reduce((e,t)=>t(e),e)}function Z(e){if(M(e)){return`{${Object.keys(e).sort().map(t=>`${JSON.stringify(t)}:${Z(e[t])}`).join(",")}}`}return Array.isArray(e)?`[${e.map(Z).join(",")}]`:JSON.stringify(e)}function z(e,t){const n=e.length,r=t.length;e.length=n+r;for(let o=0;o<r;o++)e[n+o]=t[o]}function j(e){return e.startsWith('"""')||e.startsWith("'''")}const B=/\r\n/g,W=/\n/g,q=/^(\r\n|\n)/,V=/(?<!\\)(?:\\\\)*(\\\s*[\n\r\n]\s*)/g;function R(e){return e.startsWith("'''")?N(J(e,3),X):e.startsWith(I)?J(e,1):e.startsWith('"""')?N(J(e,3),X,Q,G,H,Y):e.startsWith(T)?N(J(e,1),Y):e}function H(e){let t="",n=0;for(let r=0;r<e.length;r++){const o=e[r];t+='"'===o&&n%2==0?'\\"':o,"\\"===o?n++:n=0}return t}function P(e,t){let n=0;for(let r=t-1;r>=0&&"\\"===e[r];r--)n++;return n%2!=0}function Y(e){const t=/\\(.)/g;let n;for(;null!==(n=t.exec(e));){if(P(e,n.index))continue;const t=n[1];if(!["b","t","n","f","r",'"',"\\","e","u","U","x"].includes(t))throw new Error(`Invalid escape sequence: \\${t}`)}const r=/\\u([a-fA-F0-9]{4})/g,o=e;for(;null!==(n=r.exec(o));){if(P(o,n.index))continue;const e=n[1],t=parseInt(e,16);if(t>=55296&&t<=57343)throw new Error(`Invalid Unicode escape: \\u${e} (surrogate codepoints are not allowed)`)}const l=e;let a=l.replace(/\\x([a-fA-F0-9]{2})/g,(e,t,n)=>{if(P(l,n))return e;const r=parseInt(t,16),o=String.fromCharCode(r);return r<32||34===r||92===r?J(JSON.stringify(o),1):o});const i=a;a=i.replace(/\\e/g,(e,t)=>P(i,t)?e:"\\u001b");const s=a.replace(/\\U[a-fA-F0-9]{8}/g,e=>{const t=parseInt(e.replace("\\U",""),16),n=String.fromCodePoint(t);return J(JSON.stringify(n),1)}),c=s.replace(/\t/g,"\\t");return JSON.parse(`"${c}"`)}function J(e,t){return e.slice(t,e.length-t)}function X(e){return e.replace(q,"")}function G(e){return e.replace(B,"\\r\\n").replace(W,"\\n")}function Q(e){return e.replace(V,(e,t)=>e.replace(t,""))}class ee{static createDateWithOriginalFormat(e,t){if(ee.IS_DATE_ONLY.test(t)){if(0!==e.getUTCHours()||0!==e.getUTCMinutes()||0!==e.getUTCSeconds()||0!==e.getUTCMilliseconds()){if(e instanceof oe)return e;let t=e.toISOString().replace("Z","");return t=t.replace(/\.000$/,""),new re(t,!1)}const t=e.toISOString().split("T")[0];return new te(t)}if(ee.IS_TIME_ONLY.test(t)){if(e instanceof ne)return e;{const n=t.match(/\.(\d+)\s*$/),r=e.toISOString();if(r&&r.includes("T")){let o=r.split("T")[1].split("Z")[0];if(n){const t=n[1].length,[r,l,a]=o.split(":"),[i]=a.split(".");o=`${r}:${l}:${i}.${String(e.getUTCMilliseconds()).padStart(3,"0").slice(0,t)}`}return new ne(o,t)}{const r=String(e.getUTCHours()).padStart(2,"0"),o=String(e.getUTCMinutes()).padStart(2,"0"),l=String(e.getUTCSeconds()).padStart(2,"0"),a=e.getUTCMilliseconds();let i;if(n){const e=n[1].length;i=`${r}:${o}:${l}.${String(a).padStart(3,"0").slice(0,e)}`}else if(a>0){i=`${r}:${o}:${l}.${String(a).padStart(3,"0").replace(/0+$/,"")}`}else i=`${r}:${o}:${l}`;return new ne(i,t)}}}if(ee.IS_LOCAL_DATETIME_T.test(t)){const n=t.match(/\.(\d+)\s*$/);let r=e.toISOString().replace("Z","");if(n){const t=n[1].length,[o,l]=r.split("T"),[a,i,s]=l.split(":"),[c]=s.split(".");r=`${o}T${a}:${i}:${c}.${String(e.getUTCMilliseconds()).padStart(3,"0").slice(0,t)}`}return new re(r,!1,t)}if(ee.IS_LOCAL_DATETIME_SPACE.test(t)){const n=t.match(/\.(\d+)\s*$/);let r=e.toISOString().replace("Z","").replace("T"," ");if(n){const t=n[1].length,[o,l]=r.split(" "),[a,i,s]=l.split(":"),[c]=s.split(".");r=`${o} ${a}:${i}:${c}.${String(e.getUTCMilliseconds()).padStart(3,"0").slice(0,t)}`}return new re(r,!0,t)}if(ee.IS_OFFSET_DATETIME_T.test(t)||ee.IS_OFFSET_DATETIME_SPACE.test(t)){const n=t.match(/([+-]\d{2}:\d{2}|[Zz])$/),r=n?"z"===n[1]?"Z":n[1]:"Z",o=ee.IS_OFFSET_DATETIME_SPACE.test(t),l=t.match(/\.(\d+)(?:[Zz]|[+-]\d{2}:\d{2})\s*$/),a=e.getTime();let i=0;if("Z"!==r){const e="+"===r[0]?1:-1,[t,n]=r.slice(1).split(":");i=e*(60*parseInt(t)+parseInt(n))}const s=new Date(a+6e4*i),c=s.getUTCFullYear(),u=String(s.getUTCMonth()+1).padStart(2,"0"),d=String(s.getUTCDate()).padStart(2,"0"),f=String(s.getUTCHours()).padStart(2,"0"),m=String(s.getUTCMinutes()).padStart(2,"0"),p=String(s.getUTCSeconds()).padStart(2,"0"),h=s.getUTCMilliseconds(),w=o?" ":"T";let g=`${f}:${m}:${p}`;if(l){const e=l[1].length;g+=`.${String(h).padStart(3,"0").slice(0,e)}`}else if(h>0){g+=`.${String(h).padStart(3,"0").replace(/0+$/,"")}`}return new oe(`${c}-${u}-${d}${w}${g}${r}`,o)}return e}}ee.IS_DATE_ONLY=/^\d{4}-\d{2}-\d{2}$/,ee.IS_TIME_ONLY=/^\d{2}:\d{2}(?::\d{2})?(?:\.\d+)?$/,ee.IS_LOCAL_DATETIME_T=/^\d{4}-\d{2}-\d{2}[Tt]\d{2}:\d{2}(?::\d{2})?(?:\.\d+)?$/,ee.IS_LOCAL_DATETIME_SPACE=/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}(?::\d{2})?(?:\.\d+)?$/,ee.IS_OFFSET_DATETIME_T=/^\d{4}-\d{2}-\d{2}[Tt]\d{2}:\d{2}(?::\d{2})?(?:\.\d+)?(?:[Zz]|[+-]\d{2}:\d{2})$/,ee.IS_OFFSET_DATETIME_SPACE=/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}(?::\d{2})?(?:\.\d+)?(?:[Zz]|[+-]\d{2}:\d{2})$/,ee.IS_FULL_DATE=/(\d{4})-(\d+)-(\d+)/,ee.IS_FULL_TIME=/(\d+):(\d+)(?::(\d+))?/;class te extends Date{constructor(e){super(e)}toISOString(){return`${this.getUTCFullYear()}-${String(this.getUTCMonth()+1).padStart(2,"0")}-${String(this.getUTCDate()).padStart(2,"0")}`}}class ne extends Date{constructor(e,t){let n=e;/:\d{2}:\d{2}/.test(e)||(n=e+":00"),super(`0000-01-01T${n}Z`),this.originalFormat=t}toISOString(){const e=String(this.getUTCHours()).padStart(2,"0"),t=String(this.getUTCMinutes()).padStart(2,"0"),n=String(this.getUTCSeconds()).padStart(2,"0"),r=this.getUTCMilliseconds();if(this.originalFormat&&this.originalFormat.includes(".")){const o=this.originalFormat.match(/\.(\d+)\s*$/),l=o?o[1].length:3;return`${e}:${t}:${n}.${String(r).padStart(3,"0").slice(0,l)}`}if(r>0){return`${e}:${t}:${n}.${String(r).padStart(3,"0").replace(/0+$/,"")}`}return`${e}:${t}:${n}`}}class re extends Date{constructor(e,t=!1,n){let r=e;/\d{2}:\d{2}:\d{2}/.test(e)||(r=e.replace(/(\d{2}:\d{2})([\s\-+TZ]|$)/,"$1:00$2")),super(r.replace(" ","T")+"Z"),this.useSpaceSeparator=!1,this.useSpaceSeparator=t,this.originalFormat=n||e}toISOString(){const e=this.getUTCFullYear(),t=String(this.getUTCMonth()+1).padStart(2,"0"),n=String(this.getUTCDate()).padStart(2,"0"),r=String(this.getUTCHours()).padStart(2,"0"),o=String(this.getUTCMinutes()).padStart(2,"0"),l=String(this.getUTCSeconds()).padStart(2,"0"),a=this.getUTCMilliseconds(),i=`${e}-${t}-${n}`,s=this.useSpaceSeparator?" ":"T";if(this.originalFormat&&this.originalFormat.includes(".")){const e=this.originalFormat.match(/\.(\d+)\s*$/),t=e?e[1].length:3;return`${i}${s}${r}:${o}:${l}.${String(a).padStart(3,"0").slice(0,t)}`}if(a>0){return`${i}${s}${r}:${o}:${l}.${String(a).padStart(3,"0").replace(/0+$/,"")}`}return`${i}${s}${r}:${o}:${l}`}}class oe extends Date{constructor(e,t=!1){let n=e;/\d{2}:\d{2}:\d{2}/.test(e)||(n=e.replace(/(\d{2}:\d{2})([\s\-+TZ]|$)/,"$1:00$2")),super(n.replace(" ","T")),this.useSpaceSeparator=!1,this.useSpaceSeparator=t,this.originalFormat=e;const r=e.match(/([+-]\d{2}:\d{2}|[Zz])$/);r&&(this.originalOffset="z"===r[1]?"Z":r[1])}toISOString(){if(this.originalOffset){const e=this.getTime();let t=0;if("Z"!==this.originalOffset){const e="+"===this.originalOffset[0]?1:-1,[n,r]=this.originalOffset.slice(1).split(":");t=e*(60*parseInt(n)+parseInt(r))}const n=new Date(e+6e4*t),r=n.getUTCFullYear(),o=String(n.getUTCMonth()+1).padStart(2,"0"),l=String(n.getUTCDate()).padStart(2,"0"),a=String(n.getUTCHours()).padStart(2,"0"),i=String(n.getUTCMinutes()).padStart(2,"0"),s=String(n.getUTCSeconds()).padStart(2,"0"),c=n.getUTCMilliseconds(),u=`${r}-${o}-${l}`,d=this.useSpaceSeparator?" ":"T";if(this.originalFormat&&this.originalFormat.includes(".")){const e=this.originalFormat.match(/\.(\d+)(?:[Zz]|[+-]\d{2}:\d{2})\s*$/),t=e?e[1].length:3;return`${u}${d}${a}:${i}:${s}.${String(c).padStart(3,"0").slice(0,t)}${this.originalOffset}`}if(c>0){return`${u}${d}${a}:${i}:${s}.${String(c).padStart(3,"0").replace(/0+$/,"")}${this.originalOffset}`}return`${u}${d}${a}:${i}:${s}${this.originalOffset}`}const e=super.toISOString();return this.useSpaceSeparator?e.replace("T"," "):e}}const le=ee,ae="true",ie=/e/i,se=/\_/g,ce=/^[+\-]?inf$/,ue=/^[+\-]?nan$/,de=/^[+\-]?0x/i,fe=/^[+\-]?0o/i,me=/^[+\-]?0b/i;function*pe(e){const t=new p(x(e));for(;!t.next().done;){const n=Se(t,e);for(const e of n)yield e}}function he(t){return{type:e.Comment,loc:t.value.loc,raw:t.value.raw}}function we(n,r){const o=n.peek().done||n.peek().value.type!==t.Bracket?e.Table:e.TableArray,l=o===e.Table;if(l&&"["!==n.value.raw)throw new $(r,n.value.loc.start,`Expected table opening "[", found ${n.value.raw}`);if(!l){const e=n.peek();if(e.done)throw new $(r,n.value.loc.start,'Expected second "[" for array of tables opening, found end of input');if("["!==n.value.raw||"["!==e.value.raw)throw new $(r,n.value.loc.start,`Expected array of tables opening "[[", found ${n.value.raw+e.value.raw}`);const t=n.value,o=e.value;if(t.loc.end.line!==o.loc.start.line||t.loc.end.column!==o.loc.start.column)throw new $(r,t.loc.start,"Array of tables opening brackets must be immediately adjacent with no whitespace: [[table]]")}const a=l?{type:e.TableKey,loc:n.value.loc}:{type:e.TableArrayKey,loc:n.value.loc};if(n.next(),o===e.TableArray&&n.next(),n.done)throw new $(r,a.loc.start,"Expected table key, reached end of file");if(n.value.type===t.Bracket&&"]"===n.value.raw)throw new $(r,n.value.loc.start,o===e.TableArray?"Array of tables header [[]] requires a table name":"Table header [] requires a table name");const i=n.value.raw;if(i.startsWith('"""')||i.startsWith("'''"))throw new $(r,n.value.loc.start,"Multiline strings (\"\"\" or ''') cannot be used as keys");if(!(i.startsWith('"')||i.startsWith("'")))for(let e=0;e<i.length;e++){const t=i[e];if(!/[A-Za-z0-9_-]/.test(t))throw new $(r,{line:n.value.loc.start.line,column:n.value.loc.start.column+e},`Invalid character '${t}' in bare key. Bare keys can only contain A-Z, a-z, 0-9, _, and -`)}let s;try{s=[R(n.value.raw)]}catch(e){const t=e;throw new $(r,n.value.loc.start,t.message)}for(a.item={type:e.Key,loc:b(n.value.loc),raw:n.value.raw,value:s};!n.peek().done&&n.peek().value.type===t.Dot;){n.next();const e=n.value;n.next();const t=n.value.raw;if(!(t.startsWith('"')||t.startsWith("'")))for(let e=0;e<t.length;e++){const o=t[e];if(!/[A-Za-z0-9_-]/.test(o))throw new $(r,{line:n.value.loc.start.line,column:n.value.loc.start.column+e},`Invalid character '${o}' in bare key. Bare keys can only contain A-Z, a-z, 0-9, _, and -`)}const o=" ".repeat(e.loc.start.column-a.item.loc.end.column),l=" ".repeat(n.value.loc.start.column-e.loc.end.column);a.item.loc.end=n.value.loc.end,a.item.raw+=`${o}.${l}${n.value.raw}`;try{a.item.value.push(R(n.value.raw))}catch(e){const t=e;throw new $(r,n.value.loc.start,t.message)}}if(n.next(),!n.done){const e=a.loc.start.line;if(n.value.loc.start.line!==e)throw new $(r,n.value.loc.start,l?`Table header must not contain newlines. Expected closing ']' on line ${e}, found on line ${n.value.loc.start.line}`:`Unclosed array of tables header: expected closing ']]' on line ${e}, found newline`)}if(l&&(n.done||"]"!==n.value.raw))throw new $(r,n.done?a.item.loc.end:n.value.loc.start,`Expected table closing "]", found ${n.done?"end of file":n.value.raw}`);if(!l&&(n.done||n.peek().done||"]"!==n.value.raw||"]"!==n.peek().value.raw))throw new $(r,n.done||n.peek().done?a.item.loc.end:n.value.loc.start,`Expected array of tables closing "]]", found ${n.done||n.peek().done?"end of file":n.value.raw+n.peek().value.raw}`);if(!l){const e=n.value,t=n.peek().value;if(e.loc.end.line!==t.loc.start.line||e.loc.end.column!==t.loc.start.column)throw new $(r,e.loc.start,"Array of tables closing brackets must be immediately adjacent with no whitespace: ]]")}if(l||n.next(),a.loc.end=n.value.loc.end,!n.peek().done){const e=n.peek().value;if(e.loc.start.line===a.loc.end.line&&e.type!==t.Comment)throw new $(r,e.loc.start,`Unexpected content after ${l?"table":"array of tables"} header`)}let c=[];for(;!n.peek().done&&n.peek().value.type!==t.Bracket;)n.next(),z(c,Se(n,r));return{type:l?e.Table:e.TableArray,loc:{start:v(a.loc.start),end:v(c.length?c[c.length-1].loc.end:a.loc.end)},key:a,items:c}}function ge(t,n){let r;try{r=R(t.value.raw)}catch(e){const r=e;throw new $(n,t.value.loc.start,r.message)}return{type:e.String,loc:t.value.loc,raw:t.value.raw,value:r}}function ye(t){return{type:e.Boolean,loc:t.value.loc,value:t.value.raw===ae}}function ve(n,r){let o,l=n.value.loc,a=n.value.raw;if(!n.peek().done&&n.peek().value.type===t.Literal&&le.IS_FULL_DATE.test(a)&&le.IS_FULL_TIME.test(n.peek().value.raw)){const e=l.start;n.next(),l={start:e,end:n.value.loc.end},a+=` ${n.value.raw}`}if(!n.peek().done&&n.peek().value.type===t.Dot){const e=l.start;if(n.next(),n.peek().done||n.peek().value.type!==t.Literal)throw new $(r,n.value.loc.end,"Expected fractional value for DateTime");n.next(),l={start:e,end:n.value.loc.end},a+=`.${n.value.raw}`}if(function(e,t,n){if(/\.([Zz]|[+-])/.test(e))throw new $(t,n,`Invalid datetime "${e}": fractional seconds must have at least one digit after decimal point`);if(/[+-]$/.test(e))throw new $(t,n,`Invalid datetime "${e}": timezone offset requires hour and minute components`);const r=/\d{2}:\d{2}/.test(e),o=r?e.match(/([+-])(\d+)(:?)(\d*)$/):null;if(o){const e=o[0],r=o[2],l=o[3],a=o[4];if(":"!==l)throw new $(t,n,`Invalid timezone offset "${e}": must use colon separator (e.g., +09:09)`);if(2!==r.length)throw new $(t,n,`Invalid timezone offset "${e}": hour must be exactly 2 digits`);if(!a||0===a.length)throw new $(t,n,`Invalid timezone offset "${e}": minute component is required`);if(2!==a.length)throw new $(t,n,`Invalid timezone offset "${e}": minute must be exactly 2 digits`);const i=parseInt(r,10);if(i<0||i>23)throw new $(t,n,`Invalid timezone offset "${e}": hour must be between 00 and 23, found ${r}`);const s=parseInt(a,10);if(s<0||s>59)throw new $(t,n,`Invalid timezone offset "${e}": minute must be between 00 and 59, found ${a}`)}const l=/^\d{2}:\d{2}(?::\d{2})?(?:\.\d+)?$/;if(!/^\d{4}-\d{2}-\d{2}(?:[Tt ]\d{2}:\d{2}(?::\d{2})?(?:\.\d+)?(?:[Zz]|[+-]\d{2}:\d{2})?)?$/.test(e)&&!l.test(e)){if(/^\d{4}-\d{2}-\d{2}T$/.test(e))throw new $(t,n,`Invalid date "${e}": date cannot end with 'T' without a time component`);if(/^\d{4}-\d{2}-\d{2}[a-su-zA-SU-Z]/.test(e))throw new $(t,n,`Invalid date "${e}": unexpected character after date`);if(/^\d{4}-\d{2}-\d{2}\d{2}:\d{2}/.test(e))throw new $(t,n,`Invalid datetime "${e}": missing separator 'T' or space between date and time`);throw new $(t,n,`Invalid datetime "${e}"`)}const a=e.match(/^(\d+)-/);if(a&&4!==a[1].length)throw new $(t,n,`Invalid date "${e}": year must be exactly 4 digits, found ${a[1].length}`);const i=/^(\d+)-(\d+)-(\d+)/,s=e.match(i);if(s){const[,,r,o]=s;if(2!==r.length)throw new $(t,n,`Invalid date "${e}": month must be exactly 2 digits, found ${r.length}`);if(2!==o.length)throw new $(t,n,`Invalid date "${e}": day must be exactly 2 digits, found ${o.length}`)}const c=/[T ](\d+):(\d+)(?::(\d+))?/,u=e.match(c);if(u){const[,r,o,l]=u;if(2!==r.length)throw new $(t,n,`Invalid time "${e}": hour must be exactly 2 digits, found ${r.length}`);if(2!==o.length)throw new $(t,n,`Invalid time "${e}": minute must be exactly 2 digits, found ${o.length}`);if(l&&2!==l.length)throw new $(t,n,`Invalid time "${e}": second must be exactly 2 digits, found ${l.length}`)}const d=/^(\d+):(\d+)(?::(\d+))?/,f=e.match(d);if(f&&!s){const[,r,o,l]=f;if(2!==r.length)throw new $(t,n,`Invalid time "${e}": hour must be exactly 2 digits, found ${r.length}`);if(2!==o.length)throw new $(t,n,`Invalid time "${e}": minute must be exactly 2 digits, found ${o.length}`);if(l&&2!==l.length)throw new $(t,n,`Invalid time "${e}": second must be exactly 2 digits, found ${l.length}`)}const m=e.match(/^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2}))?)?/),p=e.match(/^(\d{2}):(\d{2})(?::(\d{2}))?/);if(m){const[,r,o,l,a,i,s]=m,c=parseInt(o,10);if(c<1||c>12)throw new $(t,n,`Invalid date "${e}": month must be between 01 and 12`);const u=parseInt(l,10);if(u<1||u>31)throw new $(t,n,`Invalid date "${e}": day must be between 01 and 31`);const d=function(e,t){const n=[31,28,31,30,31,30,31,31,30,31,30,31];if(2===t){return e%4==0&&e%100!=0||e%400==0?29:28}return n[t-1]}(parseInt(r,10),c);if(u>d)throw new $(t,n,`Invalid date "${e}": day ${l} is invalid for month ${o} in year ${r}`);if(void 0!==a){const r=parseInt(a,10);if(r<0||r>23)throw new $(t,n,`Invalid time "${e}": hour must be between 00 and 23`)}if(void 0!==i){const r=parseInt(i,10);if(r<0||r>59)throw new $(t,n,`Invalid time "${e}": minute must be between 00 and 59`)}if(void 0!==s){const r=parseInt(s,10);if(r<0||r>60)throw new $(t,n,`Invalid time "${e}": second must be between 00 and 60`)}}else if(p){const[,r,o,l]=p,a=parseInt(r,10);if(a<0||a>23)throw new $(t,n,`Invalid time "${e}": hour must be between 00 and 23`);const i=parseInt(o,10);if(i<0||i>59)throw new $(t,n,`Invalid time "${e}": minute must be between 00 and 59`);if(void 0!==l){const r=parseInt(l,10);if(r<0||r>60)throw new $(t,n,`Invalid time "${e}": second must be between 00 and 60`)}}}(a,r,l.start),le.IS_FULL_DATE.test(a))o=le.IS_DATE_ONLY.test(a)?new te(a):le.IS_LOCAL_DATETIME_T.test(a)?new re(a,!1):le.IS_LOCAL_DATETIME_SPACE.test(a)?new re(a,!0):le.IS_OFFSET_DATETIME_T.test(a)?new oe(a,!1):le.IS_OFFSET_DATETIME_SPACE.test(a)?new oe(a,!0):new Date(a.replace(" ","T"));else if(le.IS_TIME_ONLY.test(a))o=new ne(a,a);else{const[e]=(new Date).toISOString().split("T");o=new Date(`${e}T${a}`)}return{type:e.DateTime,loc:l,raw:a,value:o}}function be(n,r){let o,l=n.value.loc,a=n.value.raw;if(ce.test(a))o=a.startsWith("-")?-1/0:1/0;else if(ue.test(a))o=NaN;else if(n.peek().done||n.peek().value.type!==t.Dot){if(/_$/.test(a))throw new $(r,l.start,"Underscore before decimal point is not allowed");if(/^[+\-]?_/.test(a))throw new $(r,l.start,"Leading underscore is not allowed");if(/__/.test(a))throw new $(r,l.start,"Consecutive underscores are not allowed");if(/[eE][+\-]?$/.test(a))throw new $(r,l.start,`Invalid float "${a}": incomplete exponent`);if(/[eE][+\-]?.*\./.test(a))throw new $(r,l.start,`Invalid float "${a}": decimal point not allowed in exponent`);if(/_[eE]/.test(a))throw new $(r,l.start,"Underscore before exponent is not allowed");if(/[eE][+\-]?_/.test(a))throw new $(r,l.start,"Underscore at start of exponent is not allowed");if(!n.peek().done&&n.peek().value.type===t.Dot)throw new $(r,n.peek().value.loc.start,`Invalid float "${a}.": cannot have decimal point after exponent`);const e=a.replace(se,"");if(/^[+\-]?0\d/.test(e)&&!de.test(a)&&!fe.test(a)&&!me.test(a))throw new $(r,l.start,"Leading zeros are not allowed in the integer part of a float");o=Number(a.replace(se,""))}else{const e=l.start;{if(ie.test(a)&&!de.test(a))throw new $(r,l.start,`Invalid float "${a}": cannot have decimal point after exponent`);const e=a,t=e.replace(se,"");if(/^[+\-]?0\d/.test(t)&&!de.test(e)&&!fe.test(e)&&!me.test(e))throw new $(r,l.start,"Leading zeros are not allowed in the integer part of a float");const n=e.replace(/^[+\-]/,"");if(""===n||"_"===n)throw new $(r,l.start,"Invalid float: decimal point must be preceded by at least one digit");if(/_$/.test(e))throw new $(r,l.start,"Underscore before decimal point is not allowed");if(/^[+\-]?_/.test(e))throw new $(r,l.start,"Leading underscore is not allowed");if(/__/.test(e))throw new $(r,l.start,"Consecutive underscores are not allowed")}if(n.next(),n.peek().done||n.peek().value.type!==t.Literal)throw new $(r,n.value.loc.end,"Expected fraction value for Float");n.next(),a+=`.${n.value.raw}`,l={start:e,end:n.value.loc.end};{const e=n.value.raw;if(!/^\d/.test(e))throw new $(r,n.value.loc.start,`Invalid float: fractional part must start with a digit, found "${e}"`);if(/^_/.test(e))throw new $(r,n.value.loc.start,"Underscore after decimal point is not allowed");if(/_$/.test(e))throw new $(r,n.value.loc.start,"Trailing underscore in fractional part is not allowed");if(/_[eE]/.test(e))throw new $(r,n.value.loc.start,"Underscore before exponent is not allowed");if(/[eE][+\-]?_/.test(e))throw new $(r,n.value.loc.start,"Underscore at start of exponent is not allowed");if(/[eE][+\-]?$/.test(e))throw new $(r,n.value.loc.start,`Invalid float "${a}": incomplete exponent`);if(/[eE][+\-]?.*\./.test(e))throw new $(r,n.value.loc.start,`Invalid float "${a}": decimal point not allowed in exponent`)}o=Number(a.replace(se,""))}if(Number.isNaN(o)&&!ue.test(a))throw new $(r,l.start,`Invalid float "${a}"`);return{type:e.Float,loc:l,raw:a,value:o}}function $e(t,n){const r=t.value.raw,o=t.value.loc;if(/^\d{1,}-\d{1,}/.test(r)||/^\d{1,}:\d{1,}/.test(r)||/^\d{6}-\d{2}$/.test(r))throw new $(n,o.start,`Invalid integer "${r}"`);{if("-0"===r||"+0"===r)return{type:e.Integer,loc:o,raw:r,value:0};if(/^[+\-]{2,}/.test(r))throw new $(n,o.start,"Double sign is not allowed in integers");const t=r.replace(/_/g,"");if(/^[+\-]?0\d/.test(t)&&!de.test(r)&&!fe.test(r)&&!me.test(r))throw new $(n,o.start,"Leading zeros are not allowed in decimal integers");if(/_$/.test(r))throw new $(n,o.start,"Underscores in numbers must be surrounded by digits");if(/^[+\-]?_/.test(r))throw new $(n,o.start,"Underscores in numbers must be surrounded by digits");if(/__/.test(r))throw new $(n,o.start,"Consecutive underscores in numbers are not allowed")}let l,a=10;if(de.test(r)){if(a=16,/^[+\-]?0X/.test(r))throw new $(n,o.start,'Hexadecimal prefix must be lowercase "0x"');if(/^[+\-]?0x_/.test(r))throw new $(n,o.start,"Underscores in numbers must be surrounded by digits");if(l=r.replace(/^[+\-]?0x/i,""),!l||"_"===l||/^_/.test(l))throw new $(n,o.start,"Incomplete hexadecimal number");const e=l.replace(/_/g,"");if(!/^[0-9a-fA-F]+$/.test(e))throw new $(n,o.start,"Invalid hexadecimal digits");if(/^[+\-]/.test(r))throw new $(n,o.start,"Hexadecimal numbers cannot have a sign prefix")}else if(fe.test(r)){if(a=8,/^[+\-]?0O/.test(r))throw new $(n,o.start,'Octal prefix must be lowercase "0o"');if(/^[+\-]?0o_/.test(r))throw new $(n,o.start,"Underscores in numbers must be surrounded by digits");if(l=r.replace(/^[+\-]?0o/i,""),!l||"_"===l||/^_/.test(l))throw new $(n,o.start,"Incomplete octal number");const e=l.replace(/_/g,"");if(!/^[0-7]+$/.test(e))throw new $(n,o.start,"Invalid octal digits (must be 0-7)");if(/^[+\-]/.test(r))throw new $(n,o.start,"Octal numbers cannot have a sign prefix")}else if(me.test(r)){if(a=2,/^[+\-]?0B/.test(r))throw new $(n,o.start,'Binary prefix must be lowercase "0b"');if(/^[+\-]?0b_/.test(r))throw new $(n,o.start,"Underscores in numbers must be surrounded by digits");if(l=r.replace(/^[+\-]?0b/i,""),!l||"_"===l||/^_/.test(l))throw new $(n,o.start,"Incomplete binary number");const e=l.replace(/_/g,"");if(!/^[01]+$/.test(e))throw new $(n,o.start,"Invalid binary digits (must be 0 or 1)");if(/^[+\-]/.test(r))throw new $(n,o.start,"Binary numbers cannot have a sign prefix")}const i=parseInt(r.replace(se,"").replace(fe,"").replace(me,""),a);if(Number.isNaN(i))throw new $(n,o.start,`Invalid integer "${r}"`);return{type:e.Integer,loc:o,raw:r,value:i}}function Se(n,r){if(n.value.type===t.Comment)return[he(n)];if(n.value.type===t.Bracket)return[we(n,r)];if(n.value.type===t.Literal)return function(n,r){const o=n.value.raw;if(o.endsWith(":"))throw new $(r,{line:n.value.loc.start.line,column:n.value.loc.start.column+[...o].length-1},"Use '=' to separate keys and values, not ':'");if(o.startsWith('"""')||o.startsWith("'''"))throw new $(r,n.value.loc.start,"Multiline strings (\"\"\" or ''') cannot be used as keys");if(!o.startsWith('"')&&!o.startsWith("'"))for(let e=0;e<o.length;e++){const t=o[e];if(!/[A-Za-z0-9_-]/.test(t))throw new $(r,{line:n.value.loc.start.line,column:n.value.loc.start.column+e},`Invalid character '${t}' in bare key. Bare keys can only contain A-Z, a-z, 0-9, _, and -`)}let l;try{l=[R(n.value.raw)]}catch(e){const t=e;throw new $(r,n.value.loc.start,t.message)}const a={type:e.Key,loc:b(n.value.loc),raw:n.value.raw,value:l};for(;!n.peek().done&&n.peek().value.type===t.Dot;){n.next(),n.next();const e=n.value.raw;if(e.startsWith('"""')||e.startsWith("'''"))throw new $(r,n.value.loc.start,"Multiline strings (\"\"\" or ''') cannot be used as keys");if(!(e.startsWith('"')||e.startsWith("'")))for(let t=0;t<e.length;t++){const o=e[t];if(!/[A-Za-z0-9_-]/.test(o))throw new $(r,{line:n.value.loc.start.line,column:n.value.loc.start.column+t},`Invalid character '${o}' in bare key. Bare keys can only contain A-Z, a-z, 0-9, _, and -`)}a.loc.end=n.value.loc.end,a.raw+=`.${n.value.raw}`;try{a.value.push(R(n.value.raw))}catch(e){const t=e;throw new $(r,n.value.loc.start,t.message)}}if(n.next(),!n.done&&n.value.loc.start.line!==a.loc.end.line)throw new $(r,n.value.loc.start,'Expected "=" for key-value on the same line as the key');if(n.done||n.value.type!==t.Equal){if(!n.done&&":"===n.value.raw)throw new $(r,n.value.loc.start,"Use '=' to separate keys and values, not ':'");throw new $(r,n.done?a.loc.end:n.value.loc.start,'Expected "=" for key-value')}const i=n.value.loc.start.column,s=n.value.loc.start.line;if(n.next(),n.done)throw new $(r,a.loc.start,"Expected value for key-value, reached end of file");if(n.value.loc.start.line!==s)throw new $(r,n.value.loc.start,"Expected value on the same line as the '=' sign");if(n.done)throw new $(r,a.loc.start,"Expected value for key-value");const c=Te(n,r),u=c[0],d=c.slice(1);if(!n.peek().done){const o=n.peek().value;if(o.type===t.Dot&&o.loc.start.line===u.loc.end.line&&(u.type===e.Float||u.type===e.Integer))throw new $(r,o.loc.start,"Invalid number: multiple decimal points not allowed");if((o.type===t.Literal||o.type===t.Bracket)&&o.loc.start.line===u.loc.end.line)throw new $(r,o.loc.start,"Key/value pairs must be separated by a newline")}return[{type:e.KeyValue,key:a,value:u,loc:{start:v(a.loc.start),end:v(u.loc.end)},equals:i},...d]}(n,r);throw n.value.type===t.Equal?new $(r,n.value.loc.start,"Missing key before '='"):new $(r,n.value.loc.start,`Unexpected token "${n.value.type}". Expected Comment, Bracket, or String`)}function Te(n,r){if(n.value.type===t.Literal){const e=n.value.raw;return e[0]===T||e[0]===I?[ge(n,r)]:e===ae||"false"===e?[ye(n)]:/^\d/.test(e)&&(/^\d{1,}-\d{1,}/.test(e)||/^\d{1,}:\d{1,}/.test(e))?[ve(n,r)]:!n.peek().done&&n.peek().value.type===t.Dot||ce.test(e)||ue.test(e)||ie.test(e)&&!de.test(e)?[be(n,r)]:[$e(n,r)]}if(n.value.type===t.Curly){const[o,l]=function(n,r){if("{"!==n.value.raw)throw new $(r,n.value.loc.start,'Expected "{" for inline table');const o={type:e.InlineTable,loc:b(n.value.loc),items:[]},l=[];n.next();for(;!n.done&&(n.value.type!==t.Curly||"}"!==n.value.raw);){if(n.value.type===t.Comment){l.push(he(n)),n.next();continue}if(n.value.type===t.Comma){const e=o.items[o.items.length-1];if(!e)throw new $(r,n.value.loc.start,'Found "," without previous value in inline table');if(e.comma)throw new $(r,n.value.loc.start,"Found consecutive commas in inline table (double comma is not allowed)");e.comma=!0,e.loc.end=n.value.loc.start,n.next();continue}const a=o.items[o.items.length-1];if(a&&!a.comma)throw new $(r,n.value.loc.start,"Missing comma between inline table items");const i=Se(n,r),s=i[0],c=i.slice(1);s.type===e.KeyValue&&(o.items.push({type:e.InlineItem,loc:b(s.loc),item:s,comma:!1}),z(l,c)),n.next()}if(n.done||n.value.type!==t.Curly||"}"!==n.value.raw)throw new $(r,n.done?o.loc.start:n.value.loc.start,'Expected "}"');return o.loc.end=n.value.loc.end,[o,l]}(n,r);return[o,...l]}if(n.value.type===t.Bracket){const[o,l]=function(n,r){if("["!==n.value.raw)throw new $(r,n.value.loc.start,'Expected "[" for inline array');const o={type:e.InlineArray,loc:b(n.value.loc),items:[]},l=[];n.next();for(;!n.done&&(n.value.type!==t.Bracket||"]"!==n.value.raw);){if(n.value.type===t.Comma){const e=o.items[o.items.length-1];if(!e)throw new $(r,n.value.loc.start,'Found "," without previous value for inline array');if(e.comma)throw new $(r,n.value.loc.start,"Found consecutive commas in array (double comma is not allowed)");e.comma=!0,e.loc.end=n.value.loc.start}else if(n.value.type===t.Comment)l.push(he(n));else{const t=o.items[o.items.length-1];if(t&&!t.comma)throw new $(r,n.value.loc.start,"Missing comma between array elements");const a=Te(n,r),i=a[0],s=a.slice(1);o.items.push({type:e.InlineItem,loc:b(i.loc),item:i,comma:!1}),z(l,s)}n.next()}if(n.done||n.value.type!==t.Bracket||"]"!==n.value.raw)throw new $(r,n.done?o.loc.start:n.value.loc.start,'Expected "]"');return o.loc.end=n.value.loc.end,[o,l]}(n,r);return[o,...l]}throw n.value.type===t.Dot?new $(r,n.value.loc.start,"Invalid number: cannot start with a dot. Numbers must start with a digit"):new $(r,n.value.loc.start,"Unrecognized token type")}function Ie(t,n){var r;function o(e,t){for(const n of e)l(n,t)}function l(t,r){const a=n[t.type];switch(a&&"function"==typeof a&&a(t,r),a&&a.enter&&a.enter(t,r),t.type){case e.Document:o(t.items,t);break;case e.Table:l(t.key,t),o(t.items,t);break;case e.TableKey:l(t.item,t);break;case e.TableArray:l(t.key,t),o(t.items,t);break;case e.TableArrayKey:l(t.item,t);break;case e.KeyValue:l(t.key,t),l(t.value,t);break;case e.InlineArray:o(t.items,t);break;case e.InlineItem:l(t.item,t);break;case e.InlineTable:o(t.items,t);break;case e.Key:case e.String:case e.Integer:case e.Float:case e.Boolean:case e.DateTime:case e.Comment:break;default:throw new Error(`Unrecognized node type "${t.type}"`)}a&&a.exit&&a.exit(t,r)}null!=(r=t)&&"function"==typeof r[Symbol.iterator]?o(t,null):l(t,null)}const ke=new WeakMap,xe=e=>(ke.has(e)||ke.set(e,new WeakMap),ke.get(e)),Ee=new WeakMap,Ce=e=>(Ee.has(e)||Ee.set(e,new WeakMap),Ee.get(e));function Ae(e,t,n,r){if(f(t)){const e=t.items.indexOf(n);if(e<0)throw new Error("Could not find existing item in parent node for replace");t.items.splice(e,1,r)}else if(l(t)&&u(t.value)&&!u(n)){const e=t.value.items.indexOf(n);if(e<0)throw new Error("Could not find existing item in parent node for replace");t.value.items.splice(e,1,r)}else if(m(t))t.item=r;else{if(!l(t))throw new Error(`Unsupported parent type "${t.type}" for replace`);t.key===n?t.key=r:t.value=r}Me(r,{lines:n.loc.start.line-r.loc.start.line,columns:n.loc.start.column-r.loc.start.column});const o=w(n.loc),a=w(r.loc);Ke({lines:a.lines-o.lines,columns:a.columns-o.columns},Ce(e),r,n)}function _e(e,t,a,i,m){if(!f(t))throw new Error(`Unsupported parent type "${t.type}" for insert`);let p,h;i=null!=i&&"number"==typeof i?i:t.items.length,s(t)||u(t)?({shift:p,offset:h}=function(e,t,n){if(!c(t))throw new Error(`Incompatible child type "${t.type}"`);const r=null!=n?e.items[n-1]:U(e.items),o=null==n||n===e.items.length;e.items.splice(n,0,t);const l=!!r,a=!o;l&&(r.comma=!0);a&&(t.comma=!0);const i=s(e)&&function(e){if(!e.items.length)return!1;return w(e.loc).lines>e.items.length}(e),u=o&&!0===t.comma;return Oe(e,t,n,{useNewLine:i,hasCommaHandling:!0,isLastElement:o,hasSeparatingCommaBefore:l,hasSeparatingCommaAfter:a,hasTrailingComma:u})}(t,a,i)):m&&n(t)?({shift:p,offset:h}=function(e,t,n){const r=Oe(e,t,n,{useNewLine:!1,hasCommaHandling:!1});return e.items.splice(n,0,t),r}(t,a,i)):({shift:p,offset:h}=function(e,t,a){if(i=t,!(l(i)||r(i)||o(i)||d(i)))throw new Error(`Incompatible child type "${t.type}"`);var i;const s=e.items[a-1],c=n(e)&&!e.items.length;e.items.splice(a,0,t);const u=s?{line:s.loc.end.line,column:d(s)?e.loc.start.column:s.loc.start.column}:v(e.loc.start),f=r(t)||o(t);let m=0;c||(m=f?2:1);u.line+=m;const p={lines:u.line-t.loc.start.line,columns:u.column-t.loc.start.column},h=w(t.loc),g={lines:h.lines+(m-1),columns:h.columns};return{shift:p,offset:g}}(t,a,i)),Me(a,p);const g=t.items[i-1],y=g&&Ce(e).get(g);y&&(h.lines+=y.lines,h.columns+=y.columns,Ce(e).delete(g));Ce(e).set(a,h)}function Oe(e,t,n,r={}){const{useNewLine:o=!1,skipCommaSpace:l=2,skipBracketSpace:a=1,hasCommaHandling:i=!1,isLastElement:s=!1,hasSeparatingCommaBefore:c=!1,hasSeparatingCommaAfter:u=!1,hasTrailingComma:f=!1}=r,m=n>0?e.items[n-1]:void 0,p=m?{line:m.loc.end.line,column:o?d(m)?e.loc.start.column:m.loc.start.column:m.loc.end.column}:v(e.loc.start);let h=0;if(o)h=1;else{const e=c||!i&&!!m;e&&i?p.column+=l:(e||i&&!m)&&(p.column+=a)}p.line+=h;const g={lines:p.line-t.loc.start.line,columns:p.column-t.loc.start.column},y=w(t.loc);if(!i){return{shift:g,offset:{lines:y.lines+(h-1),columns:y.columns}}}let b=0;c&&f&&!u&&s&&(b=-1);return{shift:g,offset:{lines:y.lines+(h-1),columns:y.columns+(c||u?l:0)+(f?1+b:0)}}}function Ue(e,t,n){if(!f(t))throw new Error(`Unsupported parent type "${t.type}" for remove`);let r=t.items.indexOf(n);if(r<0){if(r=t.items.findIndex(e=>m(e)&&e.item===n),r<0)throw new Error("Could not find node in parent for removal");n=t.items[r]}const o=t.items[r-1];let l=t.items[r+1];t.items.splice(r,1);let a=w(n.loc);l&&d(l)&&l.loc.start.line===n.loc.end.line&&(a=w({start:n.loc.start,end:l.loc.end}),l=t.items[r+1],t.items.splice(r,1));const i=o&&c(o)||l&&c(l),s=o&&o.loc.end.line===n.loc.start.line,u=l&&l.loc.start.line===n.loc.end.line,p=i&&(s||u),h={lines:-(a.lines-(p?1:0)),columns:-a.columns};if(void 0===o&&void 0===l&&(h.lines=0,h.columns=0),i&&s&&(h.columns-=2),i&&!o&&l&&(h.columns-=2),i&&o&&!l){const e=n.comma;o.comma=!!e}const g=o||t,y=o?Ce(e):xe(e),v=Ce(e),b=y.get(g);b&&(h.lines+=b.lines,h.columns+=b.columns);const $=v.get(n);$&&(h.lines+=$.lines,h.columns+=$.columns),y.set(g,h)}function De(e,t,n=!0){if(!n)return;if(!t.items.length)return;Ke({lines:0,columns:1},xe(e),t);const r=U(t.items);Ke({lines:0,columns:1},Ce(e),r)}function Fe(e,t,n=!1){if(!n)return;if(!t.items.length)return;const r=U(t.items);r.comma=!0,Ke({lines:0,columns:1},Ce(e),r)}function Le(t){const n=xe(t),r=Ce(t),o={lines:0,columns:{}};function l(e){const t=o.lines;e.loc.start.line+=t;const r=o.columns[e.loc.start.line]||0;e.loc.start.column+=r;const l=n.get(e);l&&(o.lines+=l.lines,o.columns[e.loc.start.line]=(o.columns[e.loc.start.line]||0)+l.columns)}function a(e){const t=o.lines;e.loc.end.line+=t;const n=o.columns[e.loc.end.line]||0;e.loc.end.column+=n;const l=r.get(e);l&&(o.lines+=l.lines,o.columns[e.loc.end.line]=(o.columns[e.loc.end.line]||0)+l.columns)}const i={enter:l,exit:a};Ie(t,{[e.Document]:i,[e.Table]:i,[e.TableArray]:i,[e.InlineTable]:i,[e.InlineArray]:i,[e.InlineItem]:i,[e.TableKey]:i,[e.TableArrayKey]:i,[e.KeyValue]:{enter(e){const t=e.loc.start.line+o.lines,n=r.get(e.key);e.equals+=(o.columns[t]||0)+(n?n.columns:0),l(e)},exit:a},[e.Key]:i,[e.String]:i,[e.Integer]:i,[e.Float]:i,[e.Boolean]:i,[e.DateTime]:i,[e.Comment]:i}),ke.delete(t),Ee.delete(t)}function Me(t,n,r={}){const{first_line_only:o=!1}=r,l=t.loc.start.line,{lines:a,columns:i}=n,s=e=>{o&&e.loc.start.line!==l||(e.loc.start.column+=i,e.loc.end.column+=i),e.loc.start.line+=a,e.loc.end.line+=a};return Ie(t,{[e.Table]:s,[e.TableKey]:s,[e.TableArray]:s,[e.TableArrayKey]:s,[e.KeyValue](e){s(e),e.equals+=i},[e.Key]:s,[e.String]:s,[e.Integer]:s,[e.Float]:s,[e.Boolean]:s,[e.DateTime]:s,[e.InlineArray]:s,[e.InlineItem]:s,[e.InlineTable]:s,[e.Comment]:s}),t}function Ke(e,t,n,r){const o=t.get(r||n);o&&(e.lines+=o.lines,e.columns+=o.columns),t.set(n,e)}function Ne(){return{type:e.Document,loc:{start:{line:1,column:0},end:{line:1,column:0}},items:[]}}function Ze(t){const n=function(t){const n=We(t);return{type:e.TableKey,loc:{start:{line:1,column:0},end:{line:1,column:n.length+2}},item:{type:e.Key,loc:{start:{line:1,column:1},end:{line:1,column:n.length+1}},value:t,raw:n}}}(t);return{type:e.Table,loc:b(n.loc),key:n,items:[]}}function ze(t){const n=function(t){const n=We(t);return{type:e.TableArrayKey,loc:{start:{line:1,column:0},end:{line:1,column:n.length+4}},item:{type:e.Key,loc:{start:{line:1,column:2},end:{line:1,column:n.length+2}},value:t,raw:n}}}(t);return{type:e.TableArray,loc:b(n.loc),key:n,items:[]}}function je(t,n){const r=function(t){const n=We(t);return{type:e.Key,loc:{start:{line:1,column:0},end:{line:1,column:n.length}},raw:n,value:t}}(t),{column:o}=r.loc.end,l=o+1;return Me(n,{lines:0,columns:o+3-n.loc.start.column},{first_line_only:!0}),{type:e.KeyValue,loc:{start:v(r.loc.start),end:v(n.loc.end)},key:r,equals:l,value:n}}const Be=/^[\w-]+$/;function We(e){return e.map(e=>Be.test(e)?e:JSON.stringify(e)).join(".")}function qe(t,n){let r,o;if(n&&j(n)){let e=n.startsWith("'''");e&&t.includes("'''")&&(e=!1);const o=e?"'''":'"""',l=n.includes("\r\n")?"\r\n":"\n",a=n.startsWith(`${o}${l}`)||(n.startsWith("'''\n")||n.startsWith("'''\r\n"))&&!e;let i;i=e?t:t.replace(/\\/g,"\\\\").replace(/\x08/g,"\\b").replace(/\f/g,"\\f").replace(/\t/g,"\\t").replace(/[\x00-\x07\x0B\x0E-\x1F\x7F]/g,e=>"\\u"+e.charCodeAt(0).toString(16).padStart(4,"0").toUpperCase()).replace(/"""/g,'""\\"'),r=a?`${o}${l}${i}${o}`:`${o}${i}${o}`}else r=JSON.stringify(t);if(r.includes("\r\n")||r.includes("\n")&&!r.includes("\r\n")){const e=r.includes("\r\n")?"\r\n":"\n",t=(r.match(new RegExp("\r\n"===e?"\\r\\n":"\\n","g"))||[]).length;o=t>0?{line:1+t,column:3}:{line:1,column:r.length}}else o={line:1,column:r.length};return{type:e.String,loc:{start:{line:1,column:0},end:o},raw:r,value:t}}function Ve(t){return{type:e.InlineItem,loc:b(t.loc),item:t,comma:!1}}const Re=!1,He=!0,Pe=!1,Ye=!1;function Je(e,t){if(!e||"object"!=typeof e)return null;if(("InlineArray"===e.type||"InlineTable"===e.type)&&e.loc){const n=function(e,t){var n;if(!e||!e.start||!e.end)return null;const r=t.split(/\r?\n/),o=e.start.line-1,l=e.end.line-1,a=e.start.column,i=e.end.column;let s="";if(o===l)s=(null===(n=r[o])||void 0===n?void 0:n.substring(a,i+1))||"";else{r[o]&&(s+=r[o].substring(a));for(let e=o+1;e<l;e++)s+="\n"+(r[e]||"");r[l]&&(s+="\n"+r[l].substring(0,i+1))}const c=s.match(/^\[(\s*)/),u=s.match(/^\{(\s*)/);if(c)return c[1].length>0;if(u)return u[1].length>0;return null}(e.loc,t);if(null!==n)return n}if(e.items&&Array.isArray(e.items))for(const n of e.items){const e=Je(n,t);if(null!==e)return e;if(n.item){const e=Je(n.item,t);if(null!==e)return e}}for(const n of["value","key","item"])if(e[n]){const r=Je(e[n],t);if(null!==r)return r}return null}function Xe(e){if(!e||"object"!=typeof e)return null;if("InlineArray"===e.type&&e.items&&Array.isArray(e.items))return Ge(e.items);if("InlineTable"===e.type&&e.items&&Array.isArray(e.items))return Ge(e.items);if("KeyValue"===e.type&&e.value)return Xe(e.value);if(e.items&&Array.isArray(e.items))for(const t of e.items){const e=Xe(t);if(null!==e)return e}return null}function Ge(e){if(0===e.length)return null;const t=e[e.length-1];return!(!t||"object"!=typeof t||!("comma"in t))&&!0===t.comma}function Qe(e){if(!s(e))return!1;if(0===e.items.length)return!1;return!0===e.items[e.items.length-1].comma}function et(e){if(!u(e))return!1;if(0===e.items.length)return!1;return!0===e.items[e.items.length-1].comma}function tt(e,t){var n,r,o,l,a,i;if(e){if(e instanceof nt)return e;{const s=function(e){if(!e||"object"!=typeof e)return{};const t=new Set(["newLine","trailingNewline","trailingComma","bracketSpacing","inlineTableStart","truncateZeroTimeInDates","useTabsForIndentation"]),n={},r=[],o=[];for(const l in e){const a=Object.prototype.hasOwnProperty.call(e,l);if(t.has(l)){const t=e[l];switch(l){case"newLine":"string"==typeof t?n.newLine=t:o.push(`${l} (expected string, got ${typeof t})`);break;case"trailingNewline":"boolean"==typeof t||"number"==typeof t?n.trailingNewline=t:o.push(`${l} (expected boolean or number, got ${typeof t})`);break;case"trailingComma":case"bracketSpacing":case"truncateZeroTimeInDates":case"useTabsForIndentation":"boolean"==typeof t?n[l]=t:o.push(`${l} (expected boolean, got ${typeof t})`);break;case"inlineTableStart":"number"==typeof t&&Number.isInteger(t)&&t>=0||null==t?n.inlineTableStart=t:o.push(`${l} (expected non-negative integer or undefined, got ${typeof t})`)}}else a&&r.push(l)}if(r.length>0&&console.warn(`toml-patch: Ignoring unsupported format properties: ${r.join(", ")}. Supported properties are: ${Array.from(t).join(", ")}`),o.length>0)throw new TypeError(`Invalid types for format properties: ${o.join(", ")}`);return n}(e);return new nt(null!==(n=s.newLine)&&void 0!==n?n:t.newLine,null!==(r=s.trailingNewline)&&void 0!==r?r:t.trailingNewline,null!==(o=s.trailingComma)&&void 0!==o?o:t.trailingComma,null!==(l=s.bracketSpacing)&&void 0!==l?l:t.bracketSpacing,void 0!==s.inlineTableStart?s.inlineTableStart:t.inlineTableStart,null!==(a=s.truncateZeroTimeInDates)&&void 0!==a?a:t.truncateZeroTimeInDates,null!==(i=s.useTabsForIndentation)&&void 0!==i?i:t.useTabsForIndentation)}}return t}class nt{constructor(e,t,n,r,o,l,a){this.newLine=null!=e?e:"\n",this.trailingNewline=null!=t?t:1,this.trailingComma=null!=n?n:Re,this.bracketSpacing=null!=r?r:He,this.inlineTableStart=null!=o?o:1,this.truncateZeroTimeInDates=null!=l?l:Pe,this.useTabsForIndentation=null!=a?a:Ye}static default(){return new nt("\n",1,Re,He,1,Pe,Ye)}static autoDetectFormat(e){const t=nt.default();t.newLine=function(e){const t=e.indexOf("\n");return t>0&&"\r"===e.substring(t-1,t)?"\r\n":"\n"}(e),t.trailingNewline=function(e,t){let n=0,r=e.length;for(;r>=t.length&&e.substring(r-t.length,r)===t;)n++,r-=t.length;return n}(e,t.newLine);try{const n=pe(e),r=Array.from(n);t.trailingComma=function(e){const t=Array.from(e);for(const e of t){const t=Xe(e);if(null!==t)return t}return Re}(r),t.bracketSpacing=function(e,t){const n=Array.from(t);for(const t of n){const n=Je(t,e);if(null!==n)return n}return He}(e,r)}catch(e){t.trailingComma=Re,t.bracketSpacing=He}return t.useTabsForIndentation=function(e){const t=e.split(/\r?\n/);let n=0,r=0;for(const e of t)if(0!==e.length&&("\t"===e[0]?n++:" "===e[0]&&r++,n+r>=5))break;return n>r}(e),t.inlineTableStart=1,t.truncateZeroTimeInDates=Pe,t}}function rt(e,t){if(0===t.inlineTableStart)return e;return e.items.filter(e=>{if(!l(e))return!1;const n=u(e.value),r=s(e.value)&&e.value.items.length&&u(e.value.items[0].item);if(n||r){const n=at(e.key.value);return void 0===t.inlineTableStart||n<t.inlineTableStart}return!1}).forEach(t=>{Ue(e,e,t),u(t.value)?_e(e,e,ot(t)):function(e){const t=Ne();for(const n of e.value.items){const r=ze(e.key.value);_e(t,t,r);for(const e of n.item.items)_e(t,r,e.item)}return Le(t),t.items}(t).forEach(t=>{_e(e,e,t)})}),Le(e),e}function ot(e){const t=Ze(e.key.value);for(const n of e.value.items)_e(t,t,n.item);return Le(t),t}function lt(e){if(e.items.length>0){const t=e.items[e.items.length-1];e.loc.end.line=t.loc.end.line,e.loc.end.column=t.loc.end.column}else e.loc.end.line=e.key.loc.end.line,e.loc.end.column=e.key.loc.end.column}function at(e){return Math.max(0,e.length-1)}function it(e,t,n){var r;for(let o=e.items.length-1;o>=0;o--){const a=e.items[o];if(l(a)&&u(a.value)){const o=[...e.key.item.value,...a.key.value];if(at(o)<(null!==(r=n.inlineTableStart)&&void 0!==r?r:1)){const r=Ze(o);for(const e of a.value.items)_e(r,r,e.item);Ue(e,e,a),lt(e),t.push(r),it(r,t,n)}}}}function st(e,t=nt.default()){e=function(e){const t=[],n=[];for(const r in e)M(e[r])||Array.isArray(e[r])?n.push(r):t.push(r);const r={};for(let n=0;n<t.length;n++){const o=t[n];r[o]=e[o]}for(let t=0;t<n.length;t++){const o=n[t];r[o]=e[o]}return r}(e=dt(e));const n=Ne();for(const r of ct(e,t))_e(n,n,r);Le(n);const r=N(n,e=>rt(e,t),e=>function(e,t){if(void 0===t.inlineTableStart||0===t.inlineTableStart)return e;const n=[];for(const r of e.items)if(l(r)&&u(r.value)){if(at(r.key.value)<t.inlineTableStart){const o=ot(r);Ue(e,e,r),_e(e,e,o),it(o,n,t)}}else"Table"===r.type&&it(r,n,t);for(const t of n)_e(e,e,t);return Le(e),e}(e,t),e=>function(e){return e}(e));return function(e){let t=0,n=0;for(const r of e.items)0===n&&r.loc.start.line>1?t=1-r.loc.start.line:r.loc.start.line+t>n+2&&(t+=n+2-(r.loc.start.line+t)),Me(r,{lines:t,columns:0}),n=r.loc.end.line;return e}(r)}function*ct(e,t){for(const n of Object.keys(e))yield je([n],ut(e[n],t))}function ut(t,n){if(null==t)throw new Error('"null" and "undefined" values are not supported');return function(e){return"string"==typeof e}(t)?qe(t):F(t)?function(t){const n=t.toString();return{type:e.Integer,loc:{start:{line:1,column:0},end:{line:1,column:n.length}},raw:n,value:t}}(t):function(e){return"number"==typeof e&&(!F(e)||!isFinite(e)||Object.is(e,-0))}(t)?function(t){let n;return n=t===1/0?"inf":t===-1/0?"-inf":Number.isNaN(t)?"nan":Object.is(t,-0)?"-0.0":t.toString(),{type:e.Float,loc:{start:{line:1,column:0},end:{line:1,column:n.length}},raw:n,value:t}}(t):function(e){return"boolean"==typeof e}(t)?function(t){return{type:e.Boolean,loc:{start:{line:1,column:0},end:{line:1,column:t?4:5}},value:t}}(t):L(t)?function(t,n){n.truncateZeroTimeInDates&&0===t.getUTCHours()&&0===t.getUTCMinutes()&&0===t.getUTCSeconds()&&0===t.getUTCMilliseconds()&&(t=new te(t.toISOString().split("T")[0]));const r=t.toISOString();return{type:e.DateTime,loc:{start:{line:1,column:0},end:{line:1,column:r.length}},raw:r,value:t}}(t,n):Array.isArray(t)?function(t,n){const r={type:e.InlineArray,loc:{start:{line:1,column:0},end:{line:1,column:2}},items:[]};for(const e of t){_e(r,r,Ve(ut(e,n)))}return De(r,r,n.bracketSpacing),Fe(r,r,n.trailingComma),Le(r),r}(t,n):function(t,n){if(t=dt(t),!M(t))return ut(t,n);const r={type:e.InlineTable,loc:{start:{line:1,column:0},end:{line:1,column:2}},items:[]},o=[...ct(t,n)];for(const e of o){_e(r,r,Ve(e))}return De(r,r,n.bracketSpacing),Fe(r,r,n.trailingComma),Le(r),r}(t,n)}function dt(e){return e?L(e)?e:"function"==typeof e.toJSON?e.toJSON():e:e}const ft=/(\r\n|\n)/g;function mt(t,n){const r=[],o=n.useTabsForIndentation?"\t":" ";if(Ie(t,{[e.TableKey](e){const{start:t,end:n}=e.loc;pt(r,{start:t,end:{line:t.line,column:t.column+1}},"[",o),pt(r,{start:{line:n.line,column:n.column-1},end:n},"]",o)},[e.TableArrayKey](e){const{start:t,end:n}=e.loc;pt(r,{start:t,end:{line:t.line,column:t.column+2}},"[[",o),pt(r,{start:{line:n.line,column:n.column-2},end:n},"]]",o)},[e.KeyValue](e){const{start:{line:t}}=e.loc;pt(r,{start:{line:t,column:e.equals},end:{line:t,column:e.equals+1}},"=",o)},[e.Key](e){pt(r,e.loc,e.raw,o)},[e.String](e){pt(r,e.loc,e.raw,o)},[e.Integer](e){pt(r,e.loc,e.raw,o)},[e.Float](e){pt(r,e.loc,e.raw,o)},[e.Boolean](e){pt(r,e.loc,e.value.toString(),o)},[e.DateTime](e){pt(r,e.loc,e.raw,o)},[e.InlineArray](e){const{start:t,end:n}=e.loc;pt(r,{start:t,end:{line:t.line,column:t.column+1}},"[",o),pt(r,{start:{line:n.line,column:n.column-1},end:n},"]",o)},[e.InlineTable](e){const{start:t,end:n}=e.loc;pt(r,{start:t,end:{line:t.line,column:t.column+1}},"{",o),pt(r,{start:{line:n.line,column:n.column-1},end:n},"}",o)},[e.InlineItem](e){if(!e.comma)return;const t=e.loc.end;pt(r,{start:t,end:{line:t.line,column:t.column+1}},",",o)},[e.Comment](e){pt(r,e.loc,e.raw,o)}}),n.useTabsForIndentation)for(let e=0;e<r.length;e++){const t=r[e],n=t.match(/^( +)/);if(n){const o=n[1],l="\t".repeat(o.length);r[e]=l+t.substring(o.length)}}return r.join(n.newLine)+n.newLine.repeat(n.trailingNewline)}function pt(e,t,n,r=" "){const o=n.split(ft).filter(e=>"\n"!==e&&"\r\n"!==e),l=t.end.line-t.start.line+1;if(o.length!==l)throw new Error(`Mismatch between location and raw string, expected ${l} lines for "${n}"`);for(let r=t.start.line;r<=t.end.line;r++){const l=ht(e,r);if(void 0===l)throw new Error(`Line ${r} is uninitialized when writing "${n}" at ${t.start.line}:${t.start.column} to ${t.end.line}:${t.end.column}`);const a=r===t.start.line,i=r===t.end.line;let s="";if(a){const e=l.substring(0,t.start.column);s=e.length<t.start.column?e.padEnd(t.start.column," "):e}const c=i?l.substring(t.end.column):"";e[r-1]=s+o[r-t.start.line]+c}}function ht(e,t){if(!e[t-1])for(let n=0;n<t;n++)e[n]||(e[n]="");return e[t-1]}function wt(t,n,r){for(const o of t.items){const t=o.item,l=n.concat(t.key.value);t.value.type===e.InlineTable&&(r.add(Tt(l)),wt(t.value,l,r))}}function gt(t,n=""){const r=D(),o=new Set,l=new Set,a=new Set,i=new Set,s=new Set;let c=r,u=0,d=[];return Ie(t,{[e.Table](e){const t=e.key.item.value;try{vt(r,[],t,e.type,{tables:o,table_arrays:l,defined:a,implicit_tables:i,inline_tables:s})}catch(t){const r=t;throw new $(n,e.key.loc.start,r.message)}const u=Tt(t);o.add(u),a.add(u),c=bt(r,t),d=t},[e.TableArray](e){const t=e.key.item.value;try{vt(r,[],t,e.type,{tables:o,table_arrays:l,defined:a,implicit_tables:i,inline_tables:s})}catch(t){const r=t;throw new $(n,e.key.loc.start,r.message)}const u=Tt(t);l.add(u),a.add(u),c=function(e,t){const n=$t(e,t.slice(0,-1)),r=U(t);n[r]||(n[r]=[]);const o=D();return n[U(t)].push(o),o}(r,t),d=t},[e.KeyValue]:{enter(t){if(u>0)return;const r=t.key.value;try{vt(c,d,r,t.type,{tables:o,table_arrays:l,defined:a,implicit_tables:i,inline_tables:s})}catch(e){const r=e;throw new $(n,t.key.loc.start,r.message)}if(r.length>1)for(let e=1;e<r.length;e++){const t=Tt(d.concat(r.slice(0,e)));i.add(t),a.add(t)}let f;try{f=yt(t.value)}catch(e){const r=e;throw new $(n,t.value.loc.start,r.message)}if(t.value.type===e.InlineTable){const e=d.concat(r);s.add(Tt(e)),wt(t.value,e,s)}(r.length>1?bt(c,r.slice(0,-1)):c)[U(r)]=f,a.add(Tt(d.concat(r)))}},[e.InlineTable]:{enter(){u++},exit(){u--}}}),r}function yt(t){switch(t.type){case e.InlineTable:const n=D(),r=new Set,o=new Map;return t.items.forEach(({item:e})=>{const t=e.key.value,l=yt(e.value),a=Tt(t);if(r.has(a))throw new Error(`Duplicate key "${a}" in inline table`);for(let e=1;e<t.length;e++){const n=Tt(t.slice(0,e));if(r.has(n))throw new Error(`Key "${a}" conflicts with already defined key "${n}" in inline table`)}if(o.has(a)){const e=o.get(a);throw new Error(`Key "${a}" conflicts with already defined key "${e}" in inline table`)}r.add(a);for(let e=1;e<t.length;e++){const n=Tt(t.slice(0,e));o.has(n)||o.set(n,a)}(t.length>1?bt(n,t.slice(0,-1)):n)[U(t)]=l}),n;case e.InlineArray:return t.items.map(e=>yt(e.item));case e.DateTime:case e.String:case e.Integer:case e.Float:case e.Boolean:return t.value;default:throw new Error(`Unrecognized value type "${t.type}"`)}}function vt(t,n,r,o,l){const a=Tt(n.concat(r));if(o===e.KeyValue&&r.length>1)for(let e=1;e<r.length;e++){const t=Tt(n.concat(r.slice(0,e)));if(l.inline_tables.has(t))throw new Error(`Invalid key, cannot extend an inline table at ${t}`)}if((o===e.Table||o===e.TableArray)&&l.inline_tables.has(a))throw new Error(`Invalid key, cannot extend an inline table at ${a}`);if(o===e.Table||o===e.TableArray)for(let e=1;e<r.length;e++){const t=Tt(n.concat(r.slice(0,e)));if(l.inline_tables.has(t))throw new Error(`Invalid key, cannot extend an inline table at ${t}`)}if(o===e.KeyValue&&r.length>1)for(let e=1;e<r.length;e++){const t=Tt(n.concat(r.slice(0,e)));if(l.table_arrays.has(t))throw new Error(`Invalid key, cannot traverse into an array of tables at ${t}`)}if((o===e.Table||o===e.TableArray)&&l.implicit_tables.has(a))throw new Error(`Invalid key, a table has already been defined implicitly named ${a}`);if(o===e.KeyValue&&l.implicit_tables.has(a))throw new Error(`Invalid key, a table has already been defined named ${a}`);if(o===e.KeyValue&&r.length>1)for(let e=1;e<=r.length;e++){const t=Tt(n.concat(r.slice(0,e)));if(l.tables.has(t))throw new Error(`Invalid key, cannot add to an explicitly defined table ${t} using dotted keys`)}let i=[],s=0;for(const e of r){if(i.push(e),!K(t,e))return;if(St(t[e])){const e=Tt(n.concat(i));throw new Error(`Invalid key, a value has already been defined for ${e}`)}const o=Tt(n.concat(i));if(Array.isArray(t[e])&&!l.table_arrays.has(o))throw new Error(`Invalid key, cannot add to a static array at ${o}`);const a=s++<r.length-1;t=Array.isArray(t[e])&&a?U(t[e]):t[e]}const c=a;if(t&&o===e.Table&&l.defined.has(c))throw new Error(`Invalid key, a table has already been defined named ${c}`);if(t&&o===e.KeyValue&&1===r.length&&l.defined.has(c)&&!St(t))throw new Error(`Invalid key, a table has already been defined named ${c}`);if(t&&o===e.TableArray&&!l.table_arrays.has(c))throw new Error(`Invalid key, cannot add an array of tables to a table at ${c}`)}function bt(e,t){const n=$t(e,t.slice(0,-1)),r=U(t);return n[r]||(n[r]=D()),n[r]}function $t(e,t){return t.reduce((e,t)=>(e[t]||(e[t]=D()),Array.isArray(e[t])?U(e[t]):e[t]),e)}function St(e){return"object"!=typeof e&&!L(e)}function Tt(e){return e.join(".")}var It;function kt(e){return e.type===It.Remove}function xt(e,t,n=[]){return e===t||(o=t,L(r=e)&&L(o)&&r.toISOString()===o.toISOString())?[]:Array.isArray(e)&&Array.isArray(t)?function(e,t,n=[]){let r=[];const o=e.map(Z),l=t.map(Z);l.forEach((a,i)=>{const s=i>=o.length;if(!s&&o[i]===a)return;const c=o.indexOf(a,i+1);if(!s&&c>-1){r.push({type:It.Move,path:n,from:c,to:i});const e=o.splice(c,1);return void o.splice(i,0,...e)}const u=!l.includes(o[i]);if(!s&&u)return z(r,xt(e[i],t[i],n.concat(i))),void(o[i]=a);r.push({type:It.Add,path:n.concat(i)}),o.splice(i,0,a)});for(let e=l.length;e<o.length;e++)r.push({type:It.Remove,path:n.concat(e)});return r}(e,t,n):M(e)&&M(t)?function(e,t,n=[]){let r=[];const o=Object.keys(e),l=o.map(t=>Z(e[t])),a=Object.keys(t),i=a.map(e=>Z(t[e])),s=(e,t)=>{if(t.indexOf(e)<0)return!1;const n=o[l.indexOf(e)];return!a.includes(n)};return o.forEach((o,c)=>{const u=n.concat(o);if(a.includes(o))z(r,xt(e[o],t[o],u));else if(s(l[c],i)){const e=a[i.indexOf(l[c])];r.push({type:It.Rename,path:n,from:o,to:e})}else r.push({type:It.Remove,path:u})}),a.forEach((e,t)=>{o.includes(e)||s(i[t],l)||r.push({type:It.Add,path:n.concat(e)})}),r}(e,t,n):[{type:It.Edit,path:n}];var r,o}function Et(e,t){if(!t.length)return c(e)&&l(e.item)?e.item:e;if(l(e))return Et(e.value,t);const n={};let a;if(f(e)&&e.items.some((e,i)=>{try{let s=[];if(l(e))s=e.key.value;else if(r(e))s=e.key.item.value;else if(o(e)){s=e.key.item.value;const t=Z(s);n[t]||(n[t]=0);const r=n[t]++;s=s.concat(r)}else c(e)&&l(e.item)?s=e.item.key.value:c(e)&&(s=[i]);return!(!s.length||!function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(s,t.slice(0,s.length)))&&(a=c(e)&&l(e.item)?t.length===s.length?e:Et(e.item.value,t.slice(s.length)):Et(e,t.slice(s.length)),!0)}catch(e){return!1}}),!a)throw new Error(`Could not find node at path ${t.join(".")}`);return a}function Ct(e,t){try{return Et(e,t)}catch(e){}}function At(e,t){let n,r=t;for(;r.length&&!n;)r=r.slice(0,-1),n=Ct(e,r);if(!n)throw new Error(`Count not find parent node for path ${t.join(".")}`);return n}function _t(e,t){if(a(e)&&a(t)&&j(e.raw)){const n=qe(t.value,e.raw);t.raw=n.raw,t.loc=n.loc}if(i(e)&&i(t)){const n=e.raw,r=t.value,o=ee.createDateWithOriginalFormat(r,n);t.value=o,t.raw=o.toISOString();0!==t.raw.length-n.length&&(t.loc.end.column=t.loc.start.column+t.raw.length)}if(s(e)&&s(t)){const n=Qe(e);if(t.items.length>0){t.items[t.items.length-1].comma=n}}if(u(e)&&u(t)){const n=et(e);if(t.items.length>0){t.items[t.items.length-1].comma=n}}}function Ot(e,t,n){const r=[],o=(e,r)=>{var a;for(let i=e.items.length-1;i>=0;i--){const s=e.items[i];if(l(s)&&u(s.value)){const u=[...e.key.item.value,...s.key.value];if(at(u)<(null!==(a=n.inlineTableStart)&&void 0!==a?a:1)&&0!==n.inlineTableStart){const n=Ze(u);for(const e of s.value.items)c(e)&&l(e.item)&&_e(t,n,e.item,void 0);e.items.splice(i,1),lt(e),r.push(n),o(n,r)}}}};return o(e,r),r}!function(e){e.Add="Add",e.Edit="Edit",e.Remove="Remove",e.Move="Move",e.Rename="Rename"}(It||(It={})),"function"==typeof SuppressedError&&SuppressedError,exports.TomlFormat=nt,exports.parse=function(e){return gt(pe(e),e)},exports.patch=function(t,a,i){return function(t,a,i){const d=[...t],f=gt(d),p={type:e.Document,loc:{start:{line:1,column:0},end:{line:1,column:0}},items:d},h=tt(Object.assign(Object.assign({},i),{inlineTableStart:void 0}),i),w=st(a,h),g=function(e){for(let t=0;t<e.length;t++){const n=e[t];if(kt(n)){let r=t+1;for(;r<e.length;){const o=e[r];if(kt(o)&&o.path[0]===n.path[0]&&o.path[1]>n.path[1]){e.splice(r,1),e.splice(t,0,o),t=0;break}r++}}}return e}(xt(f,a));if(0===g.length)return{tomlString:mt(d,i),document:p};const y=function(e,t,a,i){return a.forEach(a=>{if(function(e){return e.type===It.Add}(a)){const d=Et(t,a.path),f=a.path.slice(0,-1);let m,p=U(a.path),h=o(d);if(F(p)&&!f.some(F)){const t=Ct(e,f.concat(0));t&&o(t)&&(h=!0)}if(r(d))m=e;else if(h){m=e;const t=e,n=Ct(t,f.concat(p-1)),r=Ct(t,f.concat(p));p=r?t.items.indexOf(r):n?t.items.indexOf(n)+1:t.items.length}else m=At(e,a.path),l(m)&&(m=m.value);if(o(m)||s(m)||n(m)){if(s(m)){const e=Qe(m);c(d)&&(d.comma=e)}if(void 0!==i.inlineTableStart&&i.inlineTableStart>0&&n(m)&&r(d)){const t=Ot(d,e,i);_e(e,m,d,p);for(const n of t)_e(e,e,n,void 0)}else _e(e,m,d,p)}else if(u(m)){const t=et(m);if(l(d)){const n=Ve(d);n.comma=t,_e(e,m,n)}else _e(e,m,d)}else if(void 0!==i.inlineTableStart&&i.inlineTableStart>0&&l(d)&&u(d.value)&&r(m)){at([...m.key.item.value,...d.key.value])<i.inlineTableStart?function(e,t,n,r){const o=t.key.item.value,a=[...o,...e.key.value],i=Ze(a);if(u(e.value))for(const t of e.value.items)c(t)&&l(t.item)&&_e(n,i,t.item,void 0);_e(n,n,i,void 0),lt(t);const s=Ot(i,n,r);for(const e of s)_e(n,n,e,void 0)}(d,m,e,i):_e(e,m,d)}else if(0===i.inlineTableStart&&l(d)&&u(d.value)&&n(m))_e(e,m,d,void 0,!0);else{let t=d;c(d)&&(r(m)||n(m))&&(t=d.item),_e(e,m,t)}}else if(function(e){return e.type===It.Edit}(a)){let n,r=Et(e,a.path),o=Et(t,a.path);if(l(r)&&l(o))_t(r.value,o.value),n=r,r=r.value,o=o.value;else if(l(r)&&c(o)&&l(o.item))n=r,r=r.value,o=o.item.value;else if(c(r)&&l(o))n=r,r=r.item;else if(c(r)&&c(o)&&l(r.item)&&l(o.item))_t(r.item.value,o.item.value),n=r.item,r=r.item.value,o=o.item.value;else if(n=At(e,a.path),l(n)){const t=a.path.slice(0,-1),r=Et(e,t);l(r)&&s(r.value)&&(n=r.value)}Ae(e,n,r,o)}else if(kt(a)){let t=At(e,a.path);l(t)&&(t=t.value);const n=Et(e,a.path);Ue(e,t,n)}else if(function(e){return e.type===It.Move}(a)){let t=Et(e,a.path);m(t)&&(t=t.item),l(t)&&(t=t.value);const n=t.items[a.from];Ue(e,t,n),_e(e,t,n,a.to)}else if(function(e){return e.type===It.Rename}(a)){let n=Et(e,a.path.concat(a.from)),r=Et(t,a.path.concat(a.to));m(n)&&(n=n.item),m(r)&&(r=r.item),Ae(e,n,n.key,r.key)}}),Le(e),e}(p,w,g,i);return{tomlString:mt(y.items,i),document:y}}(pe(t),a,tt(i,nt.autoDetectFormat(t))).tomlString},exports.stringify=function(e,t){const n=tt(t,nt.default());return mt(st(e,n).items,n)};
@@ -1,2 +0,0 @@
1
- "use strict";var t=require("./installer-CJlDenLg.js"),e=require("path"),n=require("./_commonjsHelpers-Bjf42z7h.js"),r=require("fs"),i=require("util"),s=require("string_decoder");const a={excel:["xlsx","xlsm","xlam"]},o={excel:t.join(t.env.addins,"vbapm.xlam")},c={};for(const[t,e]of Object.entries(a))for(const n of e)c[n]=t;function u(e,n,r={}){const i=l(n.type);return{application:i,addin:o[i],file:t.join(r.staging?e.paths.staging:e.paths.build,n.filename)}}function l(e){e=e.replace(".","");const n=c[e];if(!n)throw new t.CliError(t.ErrorCode.AddinUnsupportedType,`The target type "${e} is not currently supported.`);return n}var p,h,f={},g={},m={};function d(){return h||(h=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.EXPANSION_MAX=void 0,t.expand=function(e,o={}){if(!e)return[];const{max:c=t.EXPANSION_MAX}=o;"{}"===e.slice(0,2)&&(e="\\{\\}"+e.slice(2));return N(function(t){return t.replace(f,n).replace(g,r).replace(d,i).replace(y,s).replace(b,a)}(e),c,!0).map(E)};const e=(p||(p=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.range=t.balanced=void 0,t.balanced=(n,r,i)=>{const s=n instanceof RegExp?e(n,i):n,a=r instanceof RegExp?e(r,i):r,o=null!==s&&null!=a&&(0,t.range)(s,a,i);return o&&{start:o[0],end:o[1],pre:i.slice(0,o[0]),body:i.slice(o[0]+s.length,o[1]),post:i.slice(o[1]+a.length)}};const e=(t,e)=>{const n=e.match(t);return n?n[0]:null};t.range=(t,e,n)=>{let r,i,s,a,o,c=n.indexOf(t),u=n.indexOf(e,c+1),l=c;if(c>=0&&u>0){if(t===e)return[c,u];for(r=[],s=n.length;l>=0&&!o;){if(l===c)r.push(l),c=n.indexOf(t,l+1);else if(1===r.length){const t=r.pop();void 0!==t&&(o=[t,u])}else i=r.pop(),void 0!==i&&i<s&&(s=i,a=u),u=n.indexOf(e,l+1);l=c<u&&c>=0?c:u}r.length&&void 0!==a&&(o=[s,a])}return o}}(m)),m),n="\0SLASH"+Math.random()+"\0",r="\0OPEN"+Math.random()+"\0",i="\0CLOSE"+Math.random()+"\0",s="\0COMMA"+Math.random()+"\0",a="\0PERIOD"+Math.random()+"\0",o=new RegExp(n,"g"),c=new RegExp(r,"g"),u=new RegExp(i,"g"),l=new RegExp(s,"g"),h=new RegExp(a,"g"),f=/\\\\/g,g=/\\{/g,d=/\\}/g,y=/\\,/g,b=/\\./g;function v(t){return isNaN(t)?t.charCodeAt(0):parseInt(t,10)}function E(t){return t.replace(o,"\\").replace(c,"{").replace(u,"}").replace(l,",").replace(h,".")}function T(t){if(!t)return[""];const n=[],r=(0,e.balanced)("{","}",t);if(!r)return t.split(",");const{pre:i,body:s,post:a}=r,o=i.split(",");o[o.length-1]+="{"+s+"}";const c=T(a);return a.length&&(o[o.length-1]+=c.shift(),o.push.apply(o,c)),n.push.apply(n,o),n}function x(t){return"{"+t+"}"}function w(t){return/^-?0\d/.test(t)}function A(t,e){return t<=e}function _(t,e){return t>=e}function N(t,n,r){const s=[],a=(0,e.balanced)("{","}",t);if(!a)return[t];const o=a.pre,c=a.post.length?N(a.post,n,!1):[""];if(/\$$/.test(a.pre))for(let t=0;t<c.length&&t<n;t++){const e=o+"{"+a.body+"}"+c[t];s.push(e)}else{const e=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(a.body),u=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(a.body),l=e||u,p=a.body.indexOf(",")>=0;if(!l&&!p)return a.post.match(/,(?!,).*\}/)?N(t=a.pre+"{"+a.body+i+a.post,n,!0):[t];let h,f;if(l)h=a.body.split(/\.\./);else if(h=T(a.body),1===h.length&&void 0!==h[0]&&(h=N(h[0],n,!1).map(x),1===h.length))return c.map(t=>a.pre+h[0]+t);if(l&&void 0!==h[0]&&void 0!==h[1]){const t=v(h[0]),e=v(h[1]),n=Math.max(h[0].length,h[1].length);let r=3===h.length&&void 0!==h[2]?Math.abs(v(h[2])):1,i=A;e<t&&(r*=-1,i=_);const s=h.some(w);f=[];for(let a=t;i(a,e);a+=r){let t;if(u)t=String.fromCharCode(a),"\\"===t&&(t="");else if(t=String(a),s){const e=n-t.length;if(e>0){const n=new Array(e+1).join("0");t=a<0?"-"+n+t.slice(1):n+t}}f.push(t)}}else{f=[];for(let t=0;t<h.length;t++)f.push.apply(f,N(h[t],n,!1))}for(let t=0;t<f.length;t++)for(let e=0;e<c.length&&s.length<n;e++){const n=o+f[t]+c[e];(!r||l||n)&&s.push(n)}}return s}t.EXPANSION_MAX=1e5}(g)),g}var y,b={};var v,E={},T={};var x,w,A={};function _(){if(x)return A;x=1,Object.defineProperty(A,"__esModule",{value:!0}),A.unescape=void 0;return A.unescape=(t,{windowsPathsNoEscape:e=!1,magicalBraces:n=!0}={})=>n?e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"):e?t.replace(/\[([^\/\\{}])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1"),A}function N(){if(w)return E;w=1,Object.defineProperty(E,"__esModule",{value:!0}),E.AST=void 0;const t=function(){if(v)return T;v=1,Object.defineProperty(T,"__esModule",{value:!0}),T.parseClass=void 0;const t={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},e=t=>t.replace(/[[\]\\-]/g,"\\$&"),n=t=>t.join("");return T.parseClass=(r,i)=>{const s=i;if("["!==r.charAt(s))throw new Error("not in a brace expression");const a=[],o=[];let c=s+1,u=!1,l=!1,p=!1,h=!1,f=s,g="";t:for(;c<r.length;){const n=r.charAt(c);if("!"!==n&&"^"!==n||c!==s+1){if("]"===n&&u&&!p){f=c+1;break}if(u=!0,"\\"!==n||p){if("["===n&&!p)for(const[e,[n,i,u]]of Object.entries(t))if(r.startsWith(e,c)){if(g)return["$.",!1,r.length-s,!0];c+=e.length,u?o.push(n):a.push(n),l=l||i;continue t}p=!1,g?(n>g?a.push(e(g)+"-"+e(n)):n===g&&a.push(e(n)),g="",c++):r.startsWith("-]",c+1)?(a.push(e(n+"-")),c+=2):r.startsWith("-",c+1)?(g=n,c+=2):(a.push(e(n)),c++)}else p=!0,c++}else h=!0,c++}if(f<c)return["",!1,0,!1];if(!a.length&&!o.length)return["$.",!1,r.length-s,!0];if(0===o.length&&1===a.length&&/^\\?.$/.test(a[0])&&!h){return[(m=2===a[0].length?a[0].slice(-1):a[0],m.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")),!1,f-s,!1]}var m;const d="["+(h?"^":"")+n(a)+"]",y="["+(h?"":"^")+n(o)+"]";return[a.length&&o.length?"("+d+"|"+y+")":a.length?d:y,l,f-s,!0]},T}(),e=_(),n=new Set(["!","?","+","*","@"]),r=t=>n.has(t),i="(?!\\.)",s=new Set(["[","."]),a=new Set(["..","."]),o=new Set("().*{}+?[]^$\\!"),c=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),u="[^/]",l=u+"*?",p=u+"+?";class h{type;#t;#e;#n=!1;#r=[];#i;#s;#a;#o=!1;#c;#u;#l=!1;constructor(t,e,n={}){this.type=t,t&&(this.#e=!0),this.#i=e,this.#t=this.#i?this.#i.#t:this,this.#c=this.#t===this?n:this.#t.#c,this.#a=this.#t===this?[]:this.#t.#a,"!"!==t||this.#t.#o||this.#a.push(this),this.#s=this.#i?this.#i.#r.length:0}get hasMagic(){if(void 0!==this.#e)return this.#e;for(const t of this.#r)if("string"!=typeof t&&(t.type||t.hasMagic))return this.#e=!0;return this.#e}toString(){return void 0!==this.#u?this.#u:this.type?this.#u=this.type+"("+this.#r.map(t=>String(t)).join("|")+")":this.#u=this.#r.map(t=>String(t)).join("")}#p(){if(this!==this.#t)throw new Error("should only call on root");if(this.#o)return this;let t;for(this.toString(),this.#o=!0;t=this.#a.pop();){if("!"!==t.type)continue;let e=t,n=e.#i;for(;n;){for(let r=e.#s+1;!n.type&&r<n.#r.length;r++)for(const e of t.#r){if("string"==typeof e)throw new Error("string part in extglob AST??");e.copyIn(n.#r[r])}e=n,n=e.#i}}return this}push(...t){for(const e of t)if(""!==e){if("string"!=typeof e&&!(e instanceof h&&e.#i===this))throw new Error("invalid part: "+e);this.#r.push(e)}}toJSON(){const t=null===this.type?this.#r.slice().map(t=>"string"==typeof t?t:t.toJSON()):[this.type,...this.#r.map(t=>t.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#t||this.#t.#o&&"!"===this.#i?.type)&&t.push({}),t}isStart(){if(this.#t===this)return!0;if(!this.#i?.isStart())return!1;if(0===this.#s)return!0;const t=this.#i;for(let e=0;e<this.#s;e++){const n=t.#r[e];if(!(n instanceof h&&"!"===n.type))return!1}return!0}isEnd(){if(this.#t===this)return!0;if("!"===this.#i?.type)return!0;if(!this.#i?.isEnd())return!1;if(!this.type)return this.#i?.isEnd();const t=this.#i?this.#i.#r.length:0;return this.#s===t-1}copyIn(t){"string"==typeof t?this.push(t):this.push(t.clone(this))}clone(t){const e=new h(this.type,t);for(const t of this.#r)e.copyIn(t);return e}static#h(t,e,n,i){let s=!1,a=!1,o=-1,c=!1;if(null===e.type){let u=n,l="";for(;u<t.length;){const n=t.charAt(u++);if(s||"\\"===n)s=!s,l+=n;else if(a)u===o+1?"^"!==n&&"!"!==n||(c=!0):"]"!==n||u===o+2&&c||(a=!1),l+=n;else if("["!==n){if(!i.noext&&r(n)&&"("===t.charAt(u)){e.push(l),l="";const r=new h(n,e);u=h.#h(t,r,u,i),e.push(r);continue}l+=n}else a=!0,o=u,c=!1,l+=n}return e.push(l),u}let u=n+1,l=new h(null,e);const p=[];let f="";for(;u<t.length;){const n=t.charAt(u++);if(s||"\\"===n)s=!s,f+=n;else if(a)u===o+1?"^"!==n&&"!"!==n||(c=!0):"]"!==n||u===o+2&&c||(a=!1),f+=n;else if("["!==n){if(r(n)&&"("===t.charAt(u)){l.push(f),f="";const e=new h(n,l);l.push(e),u=h.#h(t,e,u,i);continue}if("|"!==n){if(")"===n)return""===f&&0===e.#r.length&&(e.#l=!0),l.push(f),f="",e.push(...p,l),u;f+=n}else l.push(f),f="",p.push(l),l=new h(null,e)}else a=!0,o=u,c=!1,f+=n}return e.type=null,e.#e=void 0,e.#r=[t.substring(n-1)],u}static fromGlob(t,e={}){const n=new h(null,void 0,e);return h.#h(t,n,0,e),n}toMMPattern(){if(this!==this.#t)return this.#t.toMMPattern();const t=this.toString(),[e,n,r,i]=this.toRegExpSource();if(!(r||this.#e||this.#c.nocase&&!this.#c.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return n;const s=(this.#c.nocase?"i":"")+(i?"u":"");return Object.assign(new RegExp(`^${e}$`,s),{_src:e,_glob:t})}get options(){return this.#c}toRegExpSource(t){const n=t??!!this.#c.dot;if(this.#t===this&&this.#p(),!this.type){const r=this.isStart()&&this.isEnd()&&!this.#r.some(t=>"string"!=typeof t),o=this.#r.map(e=>{const[n,i,s,a]="string"==typeof e?h.#f(e,this.#e,r):e.toRegExpSource(t);return this.#e=this.#e||s,this.#n=this.#n||a,n}).join("");let c="";if(this.isStart()&&"string"==typeof this.#r[0]){if(!(1===this.#r.length&&a.has(this.#r[0]))){const e=s,r=n&&e.has(o.charAt(0))||o.startsWith("\\.")&&e.has(o.charAt(2))||o.startsWith("\\.\\.")&&e.has(o.charAt(4)),a=!n&&!t&&e.has(o.charAt(0));c=r?"(?!(?:^|/)\\.\\.?(?:$|/))":a?i:""}}let u="";this.isEnd()&&this.#t.#o&&"!"===this.#i?.type&&(u="(?:$|\\/)");return[c+o+u,(0,e.unescape)(o),this.#e=!!this.#e,this.#n]}const r="*"===this.type||"+"===this.type,o="!"===this.type?"(?:(?!(?:":"(?:";let c=this.#g(n);if(this.isStart()&&this.isEnd()&&!c&&"!"!==this.type){const t=this.toString();return this.#r=[t],this.type=null,this.#e=void 0,[t,(0,e.unescape)(this.toString()),!1,!1]}let u=!r||t||n?"":this.#g(!0);u===c&&(u=""),u&&(c=`(?:${c})(?:${u})*?`);let f="";if("!"===this.type&&this.#l)f=(this.isStart()&&!n?i:"")+p;else{f=o+c+("!"===this.type?"))"+(!this.isStart()||n||t?"":i)+l+")":"@"===this.type?")":"?"===this.type?")?":"+"===this.type&&u?")":"*"===this.type&&u?")?":`)${this.type}`)}return[f,(0,e.unescape)(c),this.#e=!!this.#e,this.#n]}#g(t){return this.#r.map(e=>{if("string"==typeof e)throw new Error("string type in extglob ast??");const[n,r,i,s]=e.toRegExpSource(t);return this.#n=this.#n||s,n}).filter(t=>!(this.isStart()&&this.isEnd()&&!t)).join("|")}static#f(n,r,i=!1){let s=!1,a="",h=!1,f=!1;for(let e=0;e<n.length;e++){const g=n.charAt(e);if(s)s=!1,a+=(o.has(g)?"\\":"")+g;else if("*"!==g)if(f=!1,"\\"!==g){if("["===g){const[i,s,o,c]=(0,t.parseClass)(n,e);if(o){a+=i,h=h||s,e+=o-1,r=r||c;continue}}"?"!==g?a+=c(g):(a+=u,r=!0)}else e===n.length-1?a+="\\\\":s=!0;else{if(f)continue;f=!0,a+=i&&/^[*]+$/.test(n)?p:l,r=!0}}return[a,(0,e.unescape)(n),!!r,h]}}return E.AST=h,E}var O,S,F,C,I,P,D,R,M={};function k(){if(O)return M;O=1,Object.defineProperty(M,"__esModule",{value:!0}),M.escape=void 0;return M.escape=(t,{windowsPathsNoEscape:e=!1,magicalBraces:n=!1}={})=>n?e?t.replace(/[?*()[\]{}]/g,"[$&]"):t.replace(/[?*()[\]\\{}]/g,"\\$&"):e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&"),M}function j(){return S||(S=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.unescape=t.escape=t.AST=t.Minimatch=t.match=t.makeRe=t.braceExpand=t.defaults=t.filter=t.GLOBSTAR=t.sep=t.minimatch=void 0;const e=d(),n=(y||(y=1,Object.defineProperty(b,"__esModule",{value:!0}),b.assertValidPattern=void 0,b.assertValidPattern=t=>{if("string"!=typeof t)throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")}),b),r=N(),i=k(),s=_();t.minimatch=(t,e,r={})=>((0,n.assertValidPattern)(e),!(!r.nocomment&&"#"===e.charAt(0))&&new j(e,r).match(t));const a=/^\*+([^+@!?\*\[\(]*)$/,o=t=>e=>!e.startsWith(".")&&e.endsWith(t),c=t=>e=>e.endsWith(t),u=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),l=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),p=/^\*+\.\*+$/,h=t=>!t.startsWith(".")&&t.includes("."),f=t=>"."!==t&&".."!==t&&t.includes("."),g=/^\.\*+$/,m=t=>"."!==t&&".."!==t&&t.startsWith("."),v=/^\*+$/,E=t=>0!==t.length&&!t.startsWith("."),T=t=>0!==t.length&&"."!==t&&".."!==t,x=/^\?+([^+@!?\*\[\(]*)?$/,w=([t,e=""])=>{const n=F([t]);return e?(e=e.toLowerCase(),t=>n(t)&&t.toLowerCase().endsWith(e)):n},A=([t,e=""])=>{const n=C([t]);return e?(e=e.toLowerCase(),t=>n(t)&&t.toLowerCase().endsWith(e)):n},O=([t,e=""])=>{const n=C([t]);return e?t=>n(t)&&t.endsWith(e):n},S=([t,e=""])=>{const n=F([t]);return e?t=>n(t)&&t.endsWith(e):n},F=([t])=>{const e=t.length;return t=>t.length===e&&!t.startsWith(".")},C=([t])=>{const e=t.length;return t=>t.length===e&&"."!==t&&".."!==t},I="object"==typeof process&&process?"object"==typeof process.env&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",P={sep:"\\"},D={sep:"/"};t.sep="win32"===I?P.sep:D.sep,t.minimatch.sep=t.sep,t.GLOBSTAR=Symbol("globstar **"),t.minimatch.GLOBSTAR=t.GLOBSTAR;t.filter=(e,n={})=>r=>(0,t.minimatch)(r,e,n),t.minimatch.filter=t.filter;const R=(t,e={})=>Object.assign({},t,e);t.defaults=e=>{if(!e||"object"!=typeof e||!Object.keys(e).length)return t.minimatch;const n=t.minimatch;return Object.assign((t,r,i={})=>n(t,r,R(e,i)),{Minimatch:class extends n.Minimatch{constructor(t,n={}){super(t,R(e,n))}static defaults(t){return n.defaults(R(e,t)).Minimatch}},AST:class extends n.AST{constructor(t,n,r={}){super(t,n,R(e,r))}static fromGlob(t,r={}){return n.AST.fromGlob(t,R(e,r))}},unescape:(t,r={})=>n.unescape(t,R(e,r)),escape:(t,r={})=>n.escape(t,R(e,r)),filter:(t,r={})=>n.filter(t,R(e,r)),defaults:t=>n.defaults(R(e,t)),makeRe:(t,r={})=>n.makeRe(t,R(e,r)),braceExpand:(t,r={})=>n.braceExpand(t,R(e,r)),match:(t,r,i={})=>n.match(t,r,R(e,i)),sep:n.sep,GLOBSTAR:t.GLOBSTAR})},t.minimatch.defaults=t.defaults;t.braceExpand=(t,r={})=>((0,n.assertValidPattern)(t),r.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:(0,e.expand)(t,{max:r.braceExpandMax})),t.minimatch.braceExpand=t.braceExpand;t.makeRe=(t,e={})=>new j(t,e).makeRe(),t.minimatch.makeRe=t.makeRe;t.match=(t,e,n={})=>{const r=new j(e,n);return t=t.filter(t=>r.match(t)),r.options.nonull&&!t.length&&t.push(e),t},t.minimatch.match=t.match;const M=/[?*]|[+@!]\(.*?\)|\[|\]/;class j{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t,e={}){(0,n.assertValidPattern)(t),e=e||{},this.options=e,this.pattern=t,this.platform=e.platform||I,this.isWindows="win32"===this.platform;this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||!1===e.allowWindowsEscape,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!e.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!e.nonegate,this.comment=!1,this.empty=!1,this.partial=!!e.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=void 0!==e.windowsNoMagicRoot?e.windowsNoMagicRoot:!(!this.isWindows||!this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(const t of this.set)for(const e of t)if("string"!=typeof e)return!0;return!1}debug(...t){}make(){const t=this.pattern,e=this.options;if(!e.nocomment&&"#"===t.charAt(0))return void(this.comment=!0);if(!t)return void(this.empty=!0);this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],e.debug&&(this.debug=(...t)=>console.error(...t)),this.debug(this.pattern,this.globSet);const n=this.globSet.map(t=>this.slashSplit(t));this.globParts=this.preprocess(n),this.debug(this.pattern,this.globParts);let r=this.globParts.map((t,e,n)=>{if(this.isWindows&&this.windowsNoMagicRoot){const e=!(""!==t[0]||""!==t[1]||"?"!==t[2]&&M.test(t[2])||M.test(t[3])),n=/^[a-z]:/i.test(t[0]);if(e)return[...t.slice(0,4),...t.slice(4).map(t=>this.parse(t))];if(n)return[t[0],...t.slice(1).map(t=>this.parse(t))]}return t.map(t=>this.parse(t))});if(this.debug(this.pattern,r),this.set=r.filter(t=>-1===t.indexOf(!1)),this.isWindows)for(let t=0;t<this.set.length;t++){const e=this.set[t];""===e[0]&&""===e[1]&&"?"===this.globParts[t][2]&&"string"==typeof e[3]&&/^[a-z]:$/i.test(e[3])&&(e[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let e=0;e<t.length;e++)for(let n=0;n<t[e].length;n++)"**"===t[e][n]&&(t[e][n]="*");const{optimizationLevel:e=1}=this.options;return e>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):t=e>=1?this.levelOneOptimize(t):this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(t=>{let e=-1;for(;-1!==(e=t.indexOf("**",e+1));){let n=e;for(;"**"===t[n+1];)n++;n!==e&&t.splice(e,n-e)}return t})}levelOneOptimize(t){return t.map(t=>0===(t=t.reduce((t,e)=>{const n=t[t.length-1];return"**"===e&&"**"===n?t:".."===e&&n&&".."!==n&&"."!==n&&"**"!==n?(t.pop(),t):(t.push(e),t)},[])).length?[""]:t)}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let e=!1;do{if(e=!1,!this.preserveMultipleSlashes){for(let n=1;n<t.length-1;n++){const r=t[n];1===n&&""===r&&""===t[0]||("."!==r&&""!==r||(e=!0,t.splice(n,1),n--))}"."!==t[0]||2!==t.length||"."!==t[1]&&""!==t[1]||(e=!0,t.pop())}let n=0;for(;-1!==(n=t.indexOf("..",n+1));){const r=t[n-1];r&&"."!==r&&".."!==r&&"**"!==r&&(e=!0,t.splice(n-1,2),n-=2)}}while(e);return 0===t.length?[""]:t}firstPhasePreProcess(t){let e=!1;do{e=!1;for(let n of t){let r=-1;for(;-1!==(r=n.indexOf("**",r+1));){let i=r;for(;"**"===n[i+1];)i++;i>r&&n.splice(r+1,i-r);let s=n[r+1];const a=n[r+2],o=n[r+3];if(".."!==s)continue;if(!a||"."===a||".."===a||!o||"."===o||".."===o)continue;e=!0,n.splice(r,1);const c=n.slice(0);c[r]="**",t.push(c),r--}if(!this.preserveMultipleSlashes){for(let t=1;t<n.length-1;t++){const r=n[t];1===t&&""===r&&""===n[0]||("."!==r&&""!==r||(e=!0,n.splice(t,1),t--))}"."!==n[0]||2!==n.length||"."!==n[1]&&""!==n[1]||(e=!0,n.pop())}let i=0;for(;-1!==(i=n.indexOf("..",i+1));){const t=n[i-1];if(t&&"."!==t&&".."!==t&&"**"!==t){e=!0;const t=1===i&&"**"===n[i+1]?["."]:[];n.splice(i-1,2,...t),0===n.length&&n.push(""),i-=2}}}}while(e);return t}secondPhasePreProcess(t){for(let e=0;e<t.length-1;e++)for(let n=e+1;n<t.length;n++){const r=this.partsMatch(t[e],t[n],!this.preserveMultipleSlashes);if(r){t[e]=[],t[n]=r;break}}return t.filter(t=>t.length)}partsMatch(t,e,n=!1){let r=0,i=0,s=[],a="";for(;r<t.length&&i<e.length;)if(t[r]===e[i])s.push("b"===a?e[i]:t[r]),r++,i++;else if(n&&"**"===t[r]&&e[i]===t[r+1])s.push(t[r]),r++;else if(n&&"**"===e[i]&&t[r]===e[i+1])s.push(e[i]),i++;else if("*"!==t[r]||!e[i]||!this.options.dot&&e[i].startsWith(".")||"**"===e[i]){if("*"!==e[i]||!t[r]||!this.options.dot&&t[r].startsWith(".")||"**"===t[r])return!1;if("a"===a)return!1;a="b",s.push(e[i]),r++,i++}else{if("b"===a)return!1;a="a",s.push(t[r]),r++,i++}return t.length===e.length&&s}parseNegate(){if(this.nonegate)return;const t=this.pattern;let e=!1,n=0;for(let r=0;r<t.length&&"!"===t.charAt(r);r++)e=!e,n++;n&&(this.pattern=t.slice(n)),this.negate=e}matchOne(e,n,r=!1){const i=this.options;if(this.isWindows){const t="string"==typeof e[0]&&/^[a-z]:$/i.test(e[0]),r=!t&&""===e[0]&&""===e[1]&&"?"===e[2]&&/^[a-z]:$/i.test(e[3]),i="string"==typeof n[0]&&/^[a-z]:$/i.test(n[0]),s=r?3:t?0:void 0,a=!i&&""===n[0]&&""===n[1]&&"?"===n[2]&&"string"==typeof n[3]&&/^[a-z]:$/i.test(n[3])?3:i?0:void 0;if("number"==typeof s&&"number"==typeof a){const[t,r]=[e[s],n[a]];t.toLowerCase()===r.toLowerCase()&&(n[a]=t,a>s?n=n.slice(a):s>a&&(e=e.slice(s)))}}const{optimizationLevel:s=1}=this.options;s>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:n}),this.debug("matchOne",e.length,n.length);for(var a=0,o=0,c=e.length,u=n.length;a<c&&o<u;a++,o++){this.debug("matchOne loop");var l=n[o],p=e[a];if(this.debug(n,l,p),!1===l)return!1;if(l===t.GLOBSTAR){this.debug("GLOBSTAR",[n,l,p]);var h=a,f=o+1;if(f===u){for(this.debug("** at the end");a<c;a++)if("."===e[a]||".."===e[a]||!i.dot&&"."===e[a].charAt(0))return!1;return!0}for(;h<c;){var g=e[h];if(this.debug("\nglobstar while",e,h,n,f,g),this.matchOne(e.slice(h),n.slice(f),r))return this.debug("globstar found match!",h,c,g),!0;if("."===g||".."===g||!i.dot&&"."===g.charAt(0)){this.debug("dot detected!",e,h,n,f);break}this.debug("globstar swallow a segment, and continue"),h++}return!(!r||(this.debug("\n>>> no match, partial?",e,h,n,f),h!==c))}let s;if("string"==typeof l?(s=p===l,this.debug("string match",l,p,s)):(s=l.test(p),this.debug("pattern match",l,p,s)),!s)return!1}if(a===c&&o===u)return!0;if(a===c)return r;if(o===u)return a===c-1&&""===e[a];throw new Error("wtf?")}braceExpand(){return(0,t.braceExpand)(this.pattern,this.options)}parse(e){(0,n.assertValidPattern)(e);const i=this.options;if("**"===e)return t.GLOBSTAR;if(""===e)return"";let s,d=null;(s=e.match(v))?d=i.dot?T:E:(s=e.match(a))?d=(i.nocase?i.dot?l:u:i.dot?c:o)(s[1]):(s=e.match(x))?d=(i.nocase?i.dot?A:w:i.dot?O:S)(s):(s=e.match(p))?d=i.dot?f:h:(s=e.match(g))&&(d=m);const y=r.AST.fromGlob(e,this.options).toMMPattern();return d&&"object"==typeof y&&Reflect.defineProperty(y,"test",{value:d}),y}makeRe(){if(this.regexp||!1===this.regexp)return this.regexp;const e=this.set;if(!e.length)return this.regexp=!1,this.regexp;const n=this.options,r=n.noglobstar?"[^/]*?":n.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",i=new Set(n.nocase?["i"]:[]);let s=e.map(e=>{const n=e.map(e=>{if(e instanceof RegExp)for(const t of e.flags.split(""))i.add(t);return"string"==typeof e?e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"):e===t.GLOBSTAR?t.GLOBSTAR:e._src});n.forEach((e,i)=>{const s=n[i+1],a=n[i-1];e===t.GLOBSTAR&&a!==t.GLOBSTAR&&(void 0===a?void 0!==s&&s!==t.GLOBSTAR?n[i+1]="(?:\\/|"+r+"\\/)?"+s:n[i]=r:void 0===s?n[i-1]=a+"(?:\\/|\\/"+r+")?":s!==t.GLOBSTAR&&(n[i-1]=a+"(?:\\/|\\/"+r+"\\/)"+s,n[i+1]=t.GLOBSTAR))});const s=n.filter(e=>e!==t.GLOBSTAR);if(this.partial&&s.length>=1){const t=[];for(let e=1;e<=s.length;e++)t.push(s.slice(0,e).join("/"));return"(?:"+t.join("|")+")"}return s.join("/")}).join("|");const[a,o]=e.length>1?["(?:",")"]:["",""];s="^"+a+s+o+"$",this.partial&&(s="^(?:\\/|"+a+s.slice(1,-1)+o+")$"),this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...i].join(""))}catch(t){this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,e=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return""===t;if("/"===t&&e)return!0;const n=this.options;this.isWindows&&(t=t.split("\\").join("/"));const r=this.slashSplit(t);this.debug(this.pattern,"split",r);const i=this.set;this.debug(this.pattern,"set",i);let s=r[r.length-1];if(!s)for(let t=r.length-2;!s&&t>=0;t--)s=r[t];for(let t=0;t<i.length;t++){const a=i[t];let o=r;n.matchBase&&1===a.length&&(o=[s]);if(this.matchOne(o,a,e))return!!n.flipNegate||!this.negate}return!n.flipNegate&&this.negate}static defaults(e){return t.minimatch.defaults(e).Minimatch}}t.Minimatch=j;var L=N();Object.defineProperty(t,"AST",{enumerable:!0,get:function(){return L.AST}});var K=k();Object.defineProperty(t,"escape",{enumerable:!0,get:function(){return K.escape}});var B=_();Object.defineProperty(t,"unescape",{enumerable:!0,get:function(){return B.unescape}}),t.minimatch.AST=r.AST,t.minimatch.Minimatch=j,t.minimatch.escape=i.escape,t.minimatch.unescape=s.unescape}(f)),f}var L=function(){if(R)return D;R=1;const t=r,n=function(){if(C)return F;C=1;var t=j();return F=function(){function e(e){this.matchers=e.map(function(e){return"string"==typeof e?new t.Minimatch(e):e})}return e.prototype.match=function(t){for(var e=0;e<this.matchers.length;e++)if(this.matchers[e].match(t))return!0;return!1},e.prototype.mayContain=function(t){for(var e=t.split(/\/|\\/g).filter(Boolean),n=0;n<this.matchers.length;n++)for(var r=this.matchers[n],i=0;i<r.set.length;i++)if(r.matchOne(e,r.set[i],!0))return!0;return!1},e}()}(),i=j(),s=function(){if(P)return I;P=1;var t=e;return I=function(e){return"/"!==t.sep?e.split(t.sep).join("/"):e}}(),a=e;function o(t,e){const n=u(e);let r;return r=n.includeBasePath?function(t){return t.basePath.split(a.sep).join("/").replace(/\/+$/,"")+"/"+t.relativePath}:function(t){return t.relativePath},h(t,n,null,[]).map(r)}function c(t){return void 0!==t}function u(t){let e={};return Array.isArray(t)?e.globs=t:t&&(e=t),e}function l(t,e){return null==t?void 0:t.map(t=>"string"==typeof t?new i.Minimatch(t,e):t)}function p(t,e){const n=t.relativePath,r=e.relativePath;return n===r?0:n<r?-1:1}function h(e,r,i,s){var a;const u=null!==(a=r.fs)&&void 0!==a?a:t,f=function(t){return null==t?"":"/"!==t.slice(-1)?t+"/":t}(i),g=u.realpathSync(e+"/"+f);if(s.indexOf(g)>=0)return[];s.push(g);try{const i=r.globOptions,a=c(i)?l(r.ignore,i):r.ignore,g=c(i)?l(r.globs,i):r.globs;let m,d,y=[];if(a&&(d=new n(a)),g&&(m=new n(g)),m&&!m.mayContain(f))return y;const b=u.readdirSync(e+"/"+f).map(n=>{let r=f+n;if(d&&d.match(r))return;let i=function(e,n=t){try{return n.statSync(e)}catch(t){if(null!==t&&"object"==typeof t&&["ENOENT","ENOTDIR","EPERM"].includes(t.code))return;throw t}}(e+"/"+r,u);return i&&i.isDirectory()?new o.Entry(r+"/",e,i.mode,i.size,i.mtime.getTime()):new o.Entry(r,e,i&&i.mode||0,i&&i.size||0,i&&i.mtime.getTime()||0)}).filter(c),v=b.sort(p);for(let t=0;t<v.length;++t){let n=v[t];n.isDirectory()?(!1===r.directories||m&&!m.match(n.relativePath)||y.push(n),y=y.concat(h(e,r,n.relativePath,s))):m&&!m.match(n.relativePath)||y.push(n)}return y}finally{s.pop()}}return function(e){e.entries=function(t,e){const n=u(e);return h(s(t),n,null,[])};e.Entry=class{constructor(t,e,n,r,i){this.relativePath=t,this.basePath=e,this.mode=n,this.size=r,this.mtime=i}get fullPath(){return`${this.basePath}/${this.relativePath}`}isDirectory(){return(this.mode&t.constants.S_IFMT)===t.constants.S_IFDIR}}}(o||(o={})),D=o}(),K=n.getDefaultExportFromCjs(L);function B(...t){return async e=>{let n=e;for(const e of t)n=await e(n);return n}}var G,U,$,V,W,z,q,X,Y,H,Q={},J={exports:{}},Z={exports:{}};function tt(){if(U)return G;U=1;var t=Object.prototype.hasOwnProperty;function e(t){if(!(this instanceof e))throw new TypeError("Constructor PseudoMap requires 'new'");if(this.clear(),t)if(t instanceof e||"function"==typeof Map&&t instanceof Map)t.forEach(function(t,e){this.set(e,t)},this);else{if(!Array.isArray(t))throw new TypeError("invalid argument");t.forEach(function(t){this.set(t[0],t[1])},this)}}function n(t,e){return t===e||t!=t&&e!=e}function r(t,e,n){this.key=t,this.value=e,this._index=n}function i(e,r){for(var i=0,s="_"+r,a=s;t.call(e,a);a=s+i++)if(n(e[a].key,r))return e[a]}return G=e,e.prototype.forEach=function(t,e){e=e||this,Object.keys(this._data).forEach(function(n){"size"!==n&&t.call(e,this._data[n].value,this._data[n].key)},this)},e.prototype.has=function(t){return!!i(this._data,t)},e.prototype.get=function(t){var e=i(this._data,t);return e&&e.value},e.prototype.set=function(e,i){!function(e,i,s){for(var a=0,o="_"+i,c=o;t.call(e,c);c=o+a++)if(n(e[c].key,i))return void(e[c].value=s);e.size++,e[c]=new r(i,s,c)}(this._data,e,i)},e.prototype.delete=function(t){var e=i(this._data,t);e&&(delete this._data[e._index],this._data.size--)},e.prototype.clear=function(){var t=Object.create(null);t.size=0,Object.defineProperty(this,"_data",{value:t,enumerable:!1,configurable:!0,writable:!1})},Object.defineProperty(e.prototype,"size",{get:function(){return this._data.size},set:function(t){},enumerable:!0,configurable:!0}),e.prototype.values=e.prototype.keys=e.prototype.entries=function(){throw new Error("iterators are not implemented in this version")},G}function et(){return $||($=1,"pseudomap"===process.env.npm_package_name&&"test"===process.env.npm_lifecycle_script&&(process.env.TEST_PSEUDOMAP="true"),"function"!=typeof Map||process.env.TEST_PSEUDOMAP?Z.exports=tt():Z.exports=Map),Z.exports}function nt(){if(q)return z;q=1,z=m;var t,e=et(),n=i,r=function(){if(W)return V;function t(e){var n=this;if(n instanceof t||(n=new t),n.tail=null,n.head=null,n.length=0,e&&"function"==typeof e.forEach)e.forEach(function(t){n.push(t)});else if(arguments.length>0)for(var r=0,i=arguments.length;r<i;r++)n.push(arguments[r]);return n}function e(t,e){t.tail=new r(e,t.tail,null,t),t.head||(t.head=t.tail),t.length++}function n(t,e){t.head=new r(e,null,t.head,t),t.tail||(t.tail=t.head),t.length++}function r(t,e,n,i){if(!(this instanceof r))return new r(t,e,n,i);this.list=i,this.value=t,e?(e.next=this,this.prev=e):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}return W=1,V=t,t.Node=r,t.create=t,t.prototype.removeNode=function(t){if(t.list!==this)throw new Error("removing node which does not belong to this list");var e=t.next,n=t.prev;e&&(e.prev=n),n&&(n.next=e),t===this.head&&(this.head=e),t===this.tail&&(this.tail=n),t.list.length--,t.next=null,t.prev=null,t.list=null},t.prototype.unshiftNode=function(t){if(t!==this.head){t.list&&t.list.removeNode(t);var e=this.head;t.list=this,t.next=e,e&&(e.prev=t),this.head=t,this.tail||(this.tail=t),this.length++}},t.prototype.pushNode=function(t){if(t!==this.tail){t.list&&t.list.removeNode(t);var e=this.tail;t.list=this,t.prev=e,e&&(e.next=t),this.tail=t,this.head||(this.head=t),this.length++}},t.prototype.push=function(){for(var t=0,n=arguments.length;t<n;t++)e(this,arguments[t]);return this.length},t.prototype.unshift=function(){for(var t=0,e=arguments.length;t<e;t++)n(this,arguments[t]);return this.length},t.prototype.pop=function(){if(this.tail){var t=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,t}},t.prototype.shift=function(){if(this.head){var t=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,t}},t.prototype.forEach=function(t,e){e=e||this;for(var n=this.head,r=0;null!==n;r++)t.call(e,n.value,r,this),n=n.next},t.prototype.forEachReverse=function(t,e){e=e||this;for(var n=this.tail,r=this.length-1;null!==n;r--)t.call(e,n.value,r,this),n=n.prev},t.prototype.get=function(t){for(var e=0,n=this.head;null!==n&&e<t;e++)n=n.next;if(e===t&&null!==n)return n.value},t.prototype.getReverse=function(t){for(var e=0,n=this.tail;null!==n&&e<t;e++)n=n.prev;if(e===t&&null!==n)return n.value},t.prototype.map=function(e,n){n=n||this;for(var r=new t,i=this.head;null!==i;)r.push(e.call(n,i.value,this)),i=i.next;return r},t.prototype.mapReverse=function(e,n){n=n||this;for(var r=new t,i=this.tail;null!==i;)r.push(e.call(n,i.value,this)),i=i.prev;return r},t.prototype.reduce=function(t,e){var n,r=this.head;if(arguments.length>1)n=e;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var i=0;null!==r;i++)n=t(n,r.value,i),r=r.next;return n},t.prototype.reduceReverse=function(t,e){var n,r=this.tail;if(arguments.length>1)n=e;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var i=this.length-1;null!==r;i--)n=t(n,r.value,i),r=r.prev;return n},t.prototype.toArray=function(){for(var t=new Array(this.length),e=0,n=this.head;null!==n;e++)t[e]=n.value,n=n.next;return t},t.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,n=this.tail;null!==n;e++)t[e]=n.value,n=n.prev;return t},t.prototype.slice=function(e,n){(n=n||this.length)<0&&(n+=this.length),(e=e||0)<0&&(e+=this.length);var r=new t;if(n<e||n<0)return r;e<0&&(e=0),n>this.length&&(n=this.length);for(var i=0,s=this.head;null!==s&&i<e;i++)s=s.next;for(;null!==s&&i<n;i++,s=s.next)r.push(s.value);return r},t.prototype.sliceReverse=function(e,n){(n=n||this.length)<0&&(n+=this.length),(e=e||0)<0&&(e+=this.length);var r=new t;if(n<e||n<0)return r;e<0&&(e=0),n>this.length&&(n=this.length);for(var i=this.length,s=this.tail;null!==s&&i>n;i--)s=s.prev;for(;null!==s&&i>e;i--,s=s.prev)r.push(s.value);return r},t.prototype.reverse=function(){for(var t=this.head,e=this.tail,n=t;null!==n;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=e,this.tail=t,this},V}(),s=(t="function"==typeof Symbol&&"1"!==process.env._nodeLRUCacheForceNoSymbol?function(t){return Symbol(t)}:function(t){return"_"+t})("max"),a=t("length"),o=t("lengthCalculator"),c=t("allowStale"),u=t("maxAge"),l=t("dispose"),p=t("noDisposeOnSet"),h=t("lruList"),f=t("cache");function g(){return 1}function m(t){if(!(this instanceof m))return new m(t);"number"==typeof t&&(t={max:t}),t||(t={});var e=this[s]=t.max;(!e||"number"!=typeof e||e<=0)&&(this[s]=1/0);var n=t.length||g;"function"!=typeof n&&(n=g),this[o]=n,this[c]=t.stale||!1,this[u]=t.maxAge||0,this[l]=t.dispose,this[p]=t.noDisposeOnSet||!1,this.reset()}function d(t,e,n,r){var i=n.value;b(t,i)&&(E(t,n),t[c]||(i=void 0)),i&&e.call(r,i.value,i.key,t)}function y(t,e,n){var r=t[f].get(e);if(r){var i=r.value;b(t,i)?(E(t,r),t[c]||(i=void 0)):n&&t[h].unshiftNode(r),i&&(i=i.value)}return i}function b(t,e){if(!e||!e.maxAge&&!t[u])return!1;var n=Date.now()-e.now;return e.maxAge?n>e.maxAge:t[u]&&n>t[u]}function v(t){if(t[a]>t[s])for(var e=t[h].tail;t[a]>t[s]&&null!==e;){var n=e.prev;E(t,e),e=n}}function E(t,e){if(e){var n=e.value;t[l]&&t[l](n.key,n.value),t[a]-=n.length,t[f].delete(n.key),t[h].removeNode(e)}}function T(t,e,n,r,i){this.key=t,this.value=e,this.length=n,this.now=r,this.maxAge=i||0}return Object.defineProperty(m.prototype,"max",{set:function(t){(!t||"number"!=typeof t||t<=0)&&(t=1/0),this[s]=t,v(this)},get:function(){return this[s]},enumerable:!0}),Object.defineProperty(m.prototype,"allowStale",{set:function(t){this[c]=!!t},get:function(){return this[c]},enumerable:!0}),Object.defineProperty(m.prototype,"maxAge",{set:function(t){(!t||"number"!=typeof t||t<0)&&(t=0),this[u]=t,v(this)},get:function(){return this[u]},enumerable:!0}),Object.defineProperty(m.prototype,"lengthCalculator",{set:function(t){"function"!=typeof t&&(t=g),t!==this[o]&&(this[o]=t,this[a]=0,this[h].forEach(function(t){t.length=this[o](t.value,t.key),this[a]+=t.length},this)),v(this)},get:function(){return this[o]},enumerable:!0}),Object.defineProperty(m.prototype,"length",{get:function(){return this[a]},enumerable:!0}),Object.defineProperty(m.prototype,"itemCount",{get:function(){return this[h].length},enumerable:!0}),m.prototype.rforEach=function(t,e){e=e||this;for(var n=this[h].tail;null!==n;){var r=n.prev;d(this,t,n,e),n=r}},m.prototype.forEach=function(t,e){e=e||this;for(var n=this[h].head;null!==n;){var r=n.next;d(this,t,n,e),n=r}},m.prototype.keys=function(){return this[h].toArray().map(function(t){return t.key},this)},m.prototype.values=function(){return this[h].toArray().map(function(t){return t.value},this)},m.prototype.reset=function(){this[l]&&this[h]&&this[h].length&&this[h].forEach(function(t){this[l](t.key,t.value)},this),this[f]=new e,this[h]=new r,this[a]=0},m.prototype.dump=function(){return this[h].map(function(t){if(!b(this,t))return{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}},this).toArray().filter(function(t){return t})},m.prototype.dumpLru=function(){return this[h]},m.prototype.inspect=function(t,e){var r="LRUCache {",i=!1;this[c]&&(r+="\n allowStale: true",i=!0);var l=this[s];l&&l!==1/0&&(i&&(r+=","),r+="\n max: "+n.inspect(l,e),i=!0);var p=this[u];p&&(i&&(r+=","),r+="\n maxAge: "+n.inspect(p,e),i=!0);var f=this[o];f&&f!==g&&(i&&(r+=","),r+="\n length: "+n.inspect(this[a],e),i=!0);var m=!1;return this[h].forEach(function(t){m?r+=",\n ":(i&&(r+=",\n"),m=!0,r+="\n ");var s=n.inspect(t.key).split("\n").join("\n "),a={value:t.value};t.maxAge!==p&&(a.maxAge=t.maxAge),f!==g&&(a.length=t.length),b(this,t)&&(a.stale=!0),a=n.inspect(a,e).split("\n").join("\n "),r+=s+" => "+a}),(m||i)&&(r+="\n"),r+="}"},m.prototype.set=function(t,e,n){var r=(n=n||this[u])?Date.now():0,i=this[o](e,t);if(this[f].has(t)){if(i>this[s])return E(this,this[f].get(t)),!1;var c=this[f].get(t).value;return this[l]&&(this[p]||this[l](t,c.value)),c.now=r,c.maxAge=n,c.value=e,this[a]+=i-c.length,c.length=i,this.get(t),v(this),!0}var g=new T(t,e,i,r,n);return g.length>this[s]?(this[l]&&this[l](t,e),!1):(this[a]+=g.length,this[h].unshift(g),this[f].set(t,this[h].head),v(this),!0)},m.prototype.has=function(t){return!!this[f].has(t)&&!b(this,this[f].get(t).value)},m.prototype.get=function(t){return y(this,t,!0)},m.prototype.peek=function(t){return y(this,t,!1)},m.prototype.pop=function(){var t=this[h].tail;return t?(E(this,t),t.value):null},m.prototype.del=function(t){E(this,this[f].get(t))},m.prototype.load=function(t){this.reset();for(var e=Date.now(),n=t.length-1;n>=0;n--){var r=t[n],i=r.e||0;if(0===i)this.set(r.k,r.v);else{var s=i-e;s>0&&this.set(r.k,r.v,s)}}},m.prototype.prune=function(){var t=this;this[f].forEach(function(e,n){y(t,n,!1)})},z}function rt(){return H||(H=1,function(t,n){var r="object"==typeof process?process.platform:"win32";t?t.exports=f:n.minimatch=f,f.Minimatch=g;var i=nt();f.cache=new i({max:100});var s=f.GLOBSTAR=g.GLOBSTAR={},a=Y?X:(Y=1,X=function(t,e){e=e||10;var n=[],r="",i=RegExp;return function t(s,a){a>e||"function"!=typeof s&&void 0!==s&&("object"!=typeof s||!s||s instanceof i?r+=s:-1===n.indexOf(s)&&a!==e&&(n.push(s),r+="{",Object.keys(s).forEach(function(e,n,i){if("_"!==e.charAt(0)){var o=typeof s[e];"function"!==o&&"undefined"!==o&&(r+=e,t(s[e],a+1))}})))}(t,0),r}),o=e,c="[^/]",u=c+"*?",l="().*{}+?[]^$\\!".split("").reduce(function(t,e){return t[e]=!0,t},{});var p=/\/+/;function h(t,e){t=t||{},e=e||{};var n={};return Object.keys(e).forEach(function(t){n[t]=e[t]}),Object.keys(t).forEach(function(e){n[e]=t[e]}),n}function f(t,e,n){if("string"!=typeof e)throw new TypeError("glob pattern string required");return n||(n={}),!(!n.nocomment&&"#"===e.charAt(0))&&(""===e.trim()?""===t:new g(e,n).match(t))}function g(t,e){if(!(this instanceof g))return new g(t,e);if("string"!=typeof t)throw new TypeError("glob pattern string required");e||(e={}),"win32"===r&&(t=t.split("\\").join("/"));var n=t+"\n"+a(e),i=f.cache.get(n);if(i)return i;f.cache.set(n,this),this.options=e,this.set=[],this.pattern=t,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.make()}f.monkeyPatch=function(){var t=Object.getOwnPropertyDescriptor(String.prototype,"match"),e=t.value;t.value=function(t){return t instanceof g?t.match(this):e.call(this,t)},Object.defineProperty(String.prototype,t)},f.filter=function(t,e){return e=e||{},function(n,r,i){return f(n,t,e)}},f.defaults=function(t){if(!t||!Object.keys(t).length)return f;var e=f,n=function(n,r,i){return e.minimatch(n,r,h(t,i))};return n.Minimatch=function(n,r){return new e.Minimatch(n,h(t,r))},n},g.defaults=function(t){return t&&Object.keys(t).length?f.defaults(t).Minimatch:g},g.prototype.make=function(){if(this._made)return;var t=this.pattern,e=this.options;if(!e.nocomment&&"#"===t.charAt(0))return void(this.comment=!0);if(!t)return void(this.empty=!0);this.parseNegate();var n=this.globSet=this.braceExpand();e.debug&&console.error(this.pattern,n);n=this.globParts=n.map(function(t){return t.split(p)}),e.debug&&console.error(this.pattern,n);n=n.map(function(t,e,n){return t.map(this.parse,this)},this),e.debug&&console.error(this.pattern,n);n=n.filter(function(t){return-1===t.indexOf(!1)}),e.debug&&console.error(this.pattern,n);this.set=n},g.prototype.parseNegate=function(){var t=this.pattern,e=!1,n=this.options,r=0;if(n.nonegate)return;for(var i=0,s=t.length;i<s&&"!"===t.charAt(i);i++)e=!e,r++;r&&(this.pattern=t.substr(r));this.negate=e},f.braceExpand=function(t,e){return new g(t,e).braceExpand()},g.prototype.braceExpand=function t(e,n){if(n=n||this.options,void 0===(e=void 0===e?this.pattern:e))throw new Error("undefined pattern");if(n.nobrace||!e.match(/\{.*\}/))return[e];var r=!1;if("{"!==e.charAt(0)){for(var i=null,s=0,a=e.length;s<a;s++){if("\\"===(b=e.charAt(s)))r=!r;else if("{"===b&&!r){i=e.substr(0,s);break}}return null===i?[e]:t(e.substr(s),n).map(function(t){return i+t})}var o=e.match(/^\{(-?[0-9]+)\.\.(-?[0-9]+)\}/);if(o){var c=t(e.substr(o[0].length),n),u=+o[1],l=+o[2],p=u>l?-1:1,h=[];for(s=u;s!=l+p;s+=p)for(var f=0,g=c.length;f<g;f++)h.push(s+c[f]);return h}s=1;var m=1,d=(h=[],"");r=!1;function y(){h.push(d),d=""}t:for(s=1,a=e.length;s<a;s++){var b=e.charAt(s);if(r)r=!1,d+="\\"+b;else switch(b){case"\\":r=!0;continue;case"{":m++,d+="{";continue;case"}":if(0===--m){y(),s++;break t}d+=b;continue;case",":1===m?y():d+=b;continue;default:d+=b;continue}}if(0!==m)return t("\\"+e,n);c=t(e.substr(s),n);var v=1===h.length;h=h.map(function(e){return t(e,n)}),h=h.reduce(function(t,e){return t.concat(e)}),v&&(h=h.map(function(t){return"{"+t+"}"}));var E=[];for(s=0,a=h.length;s<a;s++)for(f=0,g=c.length;f<g;f++)E.push(h[s]+c[f]);return E},g.prototype.parse=function(t,e){var n=this.options;if(!n.noglobstar&&"**"===t)return s;if(""===t)return"";var r,i,a,o="",p=!!n.nocase,h=!1,f=[],g=!1,d=-1,y=-1,b="."===t.charAt(0)?"":n.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)";function v(){if(i){switch(i){case"*":o+=u,p=!0;break;case"?":o+=c,p=!0;break;default:o+="\\"+i}i=!1}}for(var E,T=0,x=t.length;T<x&&(E=t.charAt(T));T++)if(n.debug&&console.error("%s\t%s %s %j",t,T,o,E),h&&l[E])o+="\\"+E,h=!1;else switch(E){case"/":return!1;case"\\":v(),h=!0;continue;case"?":case"*":case"+":case"@":case"!":if(n.debug&&console.error("%s\t%s %s %j <-- stateChar",t,T,o,E),g){"!"===E&&T===y+1&&(E="^"),o+=E;continue}v(),i=E,n.noext&&v();continue;case"(":if(g){o+="(";continue}if(!i){o+="\\(";continue}r=i,f.push({type:r,start:T-1,reStart:o.length}),o+="!"===i?"(?:(?!":"(?:",i=!1;continue;case")":if(g||!f.length){o+="\\)";continue}switch(p=!0,o+=")",r=f.pop().type){case"!":o+="[^/]*?)";break;case"?":case"+":case"*":o+=r}continue;case"|":if(g||!f.length||h){o+="\\|",h=!1;continue}o+="|";continue;case"[":if(v(),g){o+="\\"+E;continue}g=!0,y=T,d=o.length,o+=E;continue;case"]":if(T===y+1||!g){o+="\\"+E,h=!1;continue}p=!0,g=!1,o+=E;continue;default:v(),h?h=!1:!l[E]||"^"===E&&g||(o+="\\"),o+=E}if(g){var w=t.substr(y+1),A=this.parse(w,m);o=o.substr(0,d)+"\\["+A[0],p=p||A[1]}for(;a=f.pop();){var _=o.slice(a.reStart+3);_=_.replace(/((?:\\{2})*)(\\?)\|/g,function(t,e,n){return n||(n="\\"),e+e+n+"|"});var N="*"===a.type?u:"?"===a.type?c:"\\"+a.type;p=!0,o=o.slice(0,a.reStart)+N+"\\("+_}v(),h&&(o+="\\\\");var O=!1;switch(o.charAt(0)){case".":case"[":case"(":O=!0}""!==o&&p&&(o="(?=.)"+o);O&&(o=b+o);if(e===m)return[o,p];if(!p)return function(t){return t.replace(/\\(.)/g,"$1")}(t);var S=n.nocase?"i":"",F=new RegExp("^"+o+"$",S);return F._glob=t,F._src=o,F};var m={};f.makeRe=function(t,e){return new g(t,e||{}).makeRe()},g.prototype.makeRe=function(){if(this.regexp||!1===this.regexp)return this.regexp;var t=this.set;if(!t.length)return this.regexp=!1;var e=this.options,n=e.noglobstar?u:e.dot?"(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?":"(?:(?!(?:\\/|^)\\.).)*?",r=e.nocase?"i":"",i=t.map(function(t){return t.map(function(t){return t===s?n:"string"==typeof t?function(t){return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}(t):t._src}).join("\\/")}).join("|");i="^(?:"+i+")$",this.negate&&(i="^(?!"+i+").*$");try{return this.regexp=new RegExp(i,r)}catch(t){return this.regexp=!1}},f.match=function(t,e,n){var r=new g(e,n);return t=t.filter(function(t){return r.match(t)}),n.nonull&&!t.length&&t.push(e),t},g.prototype.match=function(t,e){if(this.comment)return!1;if(this.empty)return""===t;if("/"===t&&e)return!0;var n=this.options;"win32"===r&&(t=t.split("\\").join("/"));t=t.split(p),n.debug&&console.error(this.pattern,"split",t);for(var i=this.set,s=0,a=i.length;s<a;s++){var o=i[s];if(this.matchOne(t,o,e))return!!n.flipNegate||!this.negate}return!n.flipNegate&&this.negate},g.prototype.matchOne=function(t,e,n){var r=this.options;r.debug&&console.error("matchOne",{this:this,file:t,pattern:e}),r.matchBase&&1===e.length&&(t=o.basename(t.join("/")).split("/")),r.debug&&console.error("matchOne",t.length,e.length);for(var i=0,a=0,c=t.length,u=e.length;i<c&&a<u;i++,a++){r.debug&&console.error("matchOne loop");var l,p=e[a],h=t[i];if(r.debug&&console.error(e,p,h),!1===p)return!1;if(p===s){r.debug&&console.error("GLOBSTAR",[e,p,h]);var f=i,g=a+1;if(g===u){for(r.debug&&console.error("** at the end");i<c;i++)if("."===t[i]||".."===t[i]||!r.dot&&"."===t[i].charAt(0))return!1;return!0}t:for(;f<c;){var m=t[f];if(r.debug&&console.error("\nglobstar while",t,f,e,g,m),this.matchOne(t.slice(f),e.slice(g),n))return r.debug&&console.error("globstar found match!",f,c,m),!0;if("."===m||".."===m||!r.dot&&"."===m.charAt(0)){r.debug&&console.error("dot detected!",t,f,e,g);break t}r.debug&&console.error("globstar swallow a segment, and continue"),f++}return!(!n||f!==c)}if("string"==typeof p?(l=r.nocase?h.toLowerCase()===p.toLowerCase():h===p,r.debug&&console.error("string match",p,h,l)):(l=h.match(p),r.debug&&console.error("pattern match",p,h,l)),!l)return!1}if(i===c&&a===u)return!0;if(i===c)return n;if(a===u)return i===c-1&&""===t[i];throw new Error("wtf?")}}(J,J.exports)),J.exports}var it,st={};function at(){if(it)return st;it=1;var t=st&&st.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(i,s){function a(t){try{c(r.next(t))}catch(t){s(t)}}function o(t){try{c(r.throw(t))}catch(t){s(t)}}function c(t){t.done?i(t.value):new n(function(e){e(t.value)}).then(a,o)}c((r=r.apply(t,e||[])).next())})},e=st&&st.__generator||function(t,e){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}},n=st&&st.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e};Object.defineProperty(st,"__esModule",{value:!0});var i=n(r),s={section:/^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$/,param:/^\s*([\w\.\-\_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$/,comment:/^\s*[#;].*$/};function a(t){var e={},n=null,r=[[n,e]];return t.split(/\r\n|\r|\n/).forEach(function(t){var i;s.comment.test(t)||(s.param.test(t)?(i=t.match(s.param),e[i[1]]=i[2]):s.section.test(t)&&(i=t.match(s.section),n=i[1],e={},r.push([n,e])))}),r}return st.parse=function(n){return t(this,void 0,void 0,function(){return e(this,function(t){return[2,new Promise(function(t,e){i.readFile(n,"utf8",function(n,r){n?e(n):t(a(r))})})]})})},st.parseSync=function(t){return a(i.readFileSync(t,"utf8"))},st.parseString=a,st}var ot,ct={name:"editorconfig",version:"0.15.3",description:"EditorConfig File Locator and Interpreter for Node.js",keywords:["editorconfig","core"],main:"src/index.js",contributors:["Hong Xu (topbug.net)","Jed Mao (https://github.com/jedmao/)","Trey Hunner (http://treyhunner.com)"],directories:{bin:"./bin",lib:"./lib"},scripts:{clean:"rimraf dist",prebuild:"npm run clean",build:"tsc",pretest:"npm run lint && npm run build && npm run copy && cmake .",test:"ctest .","pretest:ci":"npm run pretest","test:ci":"ctest -VV --output-on-failure .",lint:"npm run eclint && npm run tslint",eclint:'eclint check --indent_size ignore "src/**"',tslint:"tslint --project tsconfig.json --exclude package.json",copy:"cpy .npmignore LICENSE README.md CHANGELOG.md dist && cpy bin/* dist/bin && cpy src/lib/fnmatch*.* dist/src/lib",prepub:"npm run lint && npm run build && npm run copy",pub:"npm publish ./dist"},repository:{type:"git",url:"git://github.com/editorconfig/editorconfig-core-js.git"},bugs:"https://github.com/editorconfig/editorconfig-core-js/issues",author:"EditorConfig Team",license:"MIT",dependencies:{commander:"^2.19.0","lru-cache":"^4.1.5",semver:"^5.6.0",sigmund:"^1.0.1"},devDependencies:{"@types/mocha":"^5.2.6","@types/node":"^10.12.29","@types/semver":"^5.5.0","cpy-cli":"^2.0.0",eclint:"^2.8.1",mocha:"^5.2.0",rimraf:"^2.6.3",should:"^13.2.3",tslint:"^5.13.1",typescript:"^3.3.3333"}};var ut=function(){if(ot)return Q;ot=1;var n=Q&&Q.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(i,s){function a(t){try{c(r.next(t))}catch(t){s(t)}}function o(t){try{c(r.throw(t))}catch(t){s(t)}}function c(t){t.done?i(t.value):new n(function(e){e(t.value)}).then(a,o)}c((r=r.apply(t,e||[])).next())})},i=Q&&Q.__generator||function(t,e){var n,r,i,s,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function o(s){return function(o){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,o])}}},s=Q&&Q.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e},a=Q&&Q.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Q,"__esModule",{value:!0});var o=s(r),c=s(e),u=s(t.requireSemver()),l=a(rt()),p=at();Q.parseString=p.parseString;var h=a(ct),f={end_of_line:!0,indent_style:!0,indent_size:!0,insert_final_newline:!0,trim_trailing_whitespace:!0,charset:!0};function g(t,e){var n=[];do{t=c.dirname(t),n.push(c.join(t,e.config))}while(t!==e.root);return n}function m(t,e){return void 0===t&&(t={}),{config:t.config||".editorconfig",version:t.version||h.default.version,root:c.resolve(t.root||c.parse(e).root)}}function d(t,e,n){return function(t,e){return"indent_style"in t&&"tab"===t.indent_style&&!("indent_size"in t)&&u.gte(e,"0.10.0")&&(t.indent_size="tab"),"indent_size"in t&&!("tab_width"in t)&&"tab"!==t.indent_size&&(t.tab_width=t.indent_size),"indent_size"in t&&"tab_width"in t&&"tab"===t.indent_size&&(t.indent_size=t.tab_width),t}(t.reverse().reduce(function(t,n){var r=c.dirname(n.name);return n.contents.forEach(function(n){var i=n[0],s=n[1];if(i){var a=function(t,e){switch(e.indexOf("/")){case-1:e="**/"+e;break;case 0:e=e.substring(1)}return c.join(t,e)}(r,i);(function(t,e){return e=e.replace(/\*\*/g,"{*,**/**/**}"),l.default(t,e,{matchBase:!0,dot:!0,noext:!0})})(e,a)&&(t=function(t,e){for(var n in void 0===t&&(t={}),void 0===e&&(e={}),e)if(e.hasOwnProperty(n)){var r=e[n],i=n.toLowerCase(),s=r;f[i]&&(s=r.toLowerCase());try{s=JSON.parse(r)}catch(t){}null==r&&(s=String(r)),t[i]=s}return t}(t,s))}}),t},{}),n.version)}function y(t){var e=[];for(var n in t)if(t.hasOwnProperty(n)){var r=t[n],i=p.parseString(r.contents);if(e.push({name:r.name,contents:i}),"true"===(i[0][1].root||"").toLowerCase())break}return e}function b(t){return n(this,void 0,void 0,function(){return i(this,function(e){return[2,Promise.all(t.map(function(t){return new Promise(function(e){o.readFile(t,"utf8",function(n,r){e({name:t,contents:n?"":r})})})}))]})})}function v(t,e){void 0===e&&(e={});var n=c.resolve(t);return[n,m(e,n)]}return Q.parseFromFiles=function(t,e,r){return void 0===r&&(r={}),n(this,void 0,void 0,function(){var n,s,a;return i(this,function(i){return n=v(t,r),s=n[0],a=n[1],[2,e.then(y).then(function(t){return d(t,s,a)})]})})},Q.parseFromFilesSync=function(t,e,n){void 0===n&&(n={});var r=v(t,n),i=r[0],s=r[1];return d(y(e),i,s)},Q.parse=function(t,e){return void 0===e&&(e={}),n(this,void 0,void 0,function(){var n,r,s;return i(this,function(i){return n=v(t,e),r=n[0],s=n[1],[2,b(g(r,s)).then(y).then(function(t){return d(t,r,s)})]})})},Q.parseSync=function(t,e){void 0===e&&(e={});var n=v(t,e),r=n[0],i=n[1];return d(y(function(t){var e,n=[];return t.forEach(function(t){try{e=o.readFileSync(t,"utf8")}catch(t){e=""}n.push({name:t,contents:e})}),n}(g(r,i))),r,i)},Q}();const lt=t.env.debug("vbapm:editor-config"),pt=new Map;async function ht(n){const{end_of_line:r,trim_trailing_whitespace:i,insert_final_newline:s}=await async function(t){const n=e.extname(t.filename);if(pt.has(n))return pt.get(n);const r=await ut.parse(t.filename);return pt.set(n,r),lt(`Formatting ${n} with`,r),r}(n),a="lf"===r?"\n":"\r\n",o=n.code.split(t.BY_LINE).map(i?ft:gt).join(a);return n.code=s?function(t){"\n"!==t[t.length-1]&&(t+="\n");return t}(o):o,n}function ft(t){return t.trimEnd()}function gt(t){return t}var mt=Object.freeze({__proto__:null,toCompiled:async function(t){return t},toSrc:async function(e){const{name:n,references:r,fromDependencies:i}=e;return{name:n,components:await t.parallel(e.components,ht),references:r,fromDependencies:i}}});const dt=[mt];B(...dt.map(t=>t.toCompiled).filter(Boolean));const yt=B(...dt.map(t=>t.toSrc).filter(Boolean));var bt,vt,Et,Tt,xt,wt,At,_t,Nt,Ot,St,Ft,Ct,It,Pt,Dt={};function Rt(){return bt||(bt=1,function(t){t.parser=function(t,e){return new r(t,e)},t.SAXParser=r,t.SAXStream=a,t.createStream=function(t,e){return new a(t,e)},t.MAX_BUFFER_LENGTH=65536;var e,n=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];function r(e,i){if(!(this instanceof r))return new r(e,i);var s=this;!function(t){for(var e=0,r=n.length;e<r;e++)t[n[e]]=""}(s),s.q=s.c="",s.bufferCheckPosition=t.MAX_BUFFER_LENGTH,s.opt=i||{},s.opt.lowercase=s.opt.lowercase||s.opt.lowercasetags,s.looseCase=s.opt.lowercase?"toLowerCase":"toUpperCase",s.tags=[],s.closed=s.closedRoot=s.sawRoot=!1,s.tag=s.error=null,s.strict=!!e,s.noscript=!(!e&&!s.opt.noscript),s.state=A.BEGIN,s.strictEntities=s.opt.strictEntities,s.ENTITIES=s.strictEntities?Object.create(t.XML_ENTITIES):Object.create(t.ENTITIES),s.attribList=[],s.opt.xmlns&&(s.ns=Object.create(p)),s.trackPosition=!1!==s.opt.position,s.trackPosition&&(s.position=s.line=s.column=0),N(s,"onready")}t.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],Object.create||(Object.create=function(t){function e(){}return e.prototype=t,new e}),Object.keys||(Object.keys=function(t){var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push(n);return e}),r.prototype={end:function(){I(this)},write:function(e){var r=this;if(this.error)throw this.error;if(r.closed)return C(r,"Cannot write after close. Assign an onready handler.");if(null===e)return I(r);"object"==typeof e&&(e=e.toString());for(var i=0,s="";s=B(e,i++),r.c=s,s;)switch(r.trackPosition&&(r.position++,"\n"===s?(r.line++,r.column=0):r.column++),r.state){case A.BEGIN:if(r.state=A.BEGIN_WHITESPACE,"\ufeff"===s)continue;K(r,s);continue;case A.BEGIN_WHITESPACE:K(r,s);continue;case A.TEXT:if(r.sawRoot&&!r.closedRoot){for(var a=i-1;s&&"<"!==s&&"&"!==s;)(s=B(e,i++))&&r.trackPosition&&(r.position++,"\n"===s?(r.line++,r.column=0):r.column++);r.textNode+=e.substring(a,i-1)}"<"!==s||r.sawRoot&&r.closedRoot&&!r.strict?(d(s)||r.sawRoot&&!r.closedRoot||P(r,"Text data outside of root node."),"&"===s?r.state=A.TEXT_ENTITY:r.textNode+=s):(r.state=A.OPEN_WAKA,r.startTagPosition=r.position);continue;case A.SCRIPT:"<"===s?r.state=A.SCRIPT_ENDING:r.script+=s;continue;case A.SCRIPT_ENDING:"/"===s?r.state=A.CLOSE_TAG:(r.script+="<"+s,r.state=A.SCRIPT);continue;case A.OPEN_WAKA:if("!"===s)r.state=A.SGML_DECL,r.sgmlDecl="";else if(d(s));else if(v(h,s))r.state=A.OPEN_TAG,r.tagName=s;else if("/"===s)r.state=A.CLOSE_TAG,r.tagName="";else if("?"===s)r.state=A.PROC_INST,r.procInstName=r.procInstBody="";else{if(P(r,"Unencoded <"),r.startTagPosition+1<r.position){var u=r.position-r.startTagPosition;s=new Array(u).join(" ")+s}r.textNode+="<"+s,r.state=A.TEXT}continue;case A.SGML_DECL:(r.sgmlDecl+s).toUpperCase()===o?(O(r,"onopencdata"),r.state=A.CDATA,r.sgmlDecl="",r.cdata=""):r.sgmlDecl+s==="--"?(r.state=A.COMMENT,r.comment="",r.sgmlDecl=""):(r.sgmlDecl+s).toUpperCase()===c?(r.state=A.DOCTYPE,(r.doctype||r.sawRoot)&&P(r,"Inappropriately located doctype declaration"),r.doctype="",r.sgmlDecl=""):">"===s?(O(r,"onsgmldeclaration",r.sgmlDecl),r.sgmlDecl="",r.state=A.TEXT):y(s)?(r.state=A.SGML_DECL_QUOTED,r.sgmlDecl+=s):r.sgmlDecl+=s;continue;case A.SGML_DECL_QUOTED:s===r.q&&(r.state=A.SGML_DECL,r.q=""),r.sgmlDecl+=s;continue;case A.DOCTYPE:">"===s?(r.state=A.TEXT,O(r,"ondoctype",r.doctype),r.doctype=!0):(r.doctype+=s,"["===s?r.state=A.DOCTYPE_DTD:y(s)&&(r.state=A.DOCTYPE_QUOTED,r.q=s));continue;case A.DOCTYPE_QUOTED:r.doctype+=s,s===r.q&&(r.q="",r.state=A.DOCTYPE);continue;case A.DOCTYPE_DTD:r.doctype+=s,"]"===s?r.state=A.DOCTYPE:y(s)&&(r.state=A.DOCTYPE_DTD_QUOTED,r.q=s);continue;case A.DOCTYPE_DTD_QUOTED:r.doctype+=s,s===r.q&&(r.state=A.DOCTYPE_DTD,r.q="");continue;case A.COMMENT:"-"===s?r.state=A.COMMENT_ENDING:r.comment+=s;continue;case A.COMMENT_ENDING:"-"===s?(r.state=A.COMMENT_ENDED,r.comment=F(r.opt,r.comment),r.comment&&O(r,"oncomment",r.comment),r.comment=""):(r.comment+="-"+s,r.state=A.COMMENT);continue;case A.COMMENT_ENDED:">"!==s?(P(r,"Malformed comment"),r.comment+="--"+s,r.state=A.COMMENT):r.state=A.TEXT;continue;case A.CDATA:"]"===s?r.state=A.CDATA_ENDING:r.cdata+=s;continue;case A.CDATA_ENDING:"]"===s?r.state=A.CDATA_ENDING_2:(r.cdata+="]"+s,r.state=A.CDATA);continue;case A.CDATA_ENDING_2:">"===s?(r.cdata&&O(r,"oncdata",r.cdata),O(r,"onclosecdata"),r.cdata="",r.state=A.TEXT):"]"===s?r.cdata+="]":(r.cdata+="]]"+s,r.state=A.CDATA);continue;case A.PROC_INST:"?"===s?r.state=A.PROC_INST_ENDING:d(s)?r.state=A.PROC_INST_BODY:r.procInstName+=s;continue;case A.PROC_INST_BODY:if(!r.procInstBody&&d(s))continue;"?"===s?r.state=A.PROC_INST_ENDING:r.procInstBody+=s;continue;case A.PROC_INST_ENDING:">"===s?(O(r,"onprocessinginstruction",{name:r.procInstName,body:r.procInstBody}),r.procInstName=r.procInstBody="",r.state=A.TEXT):(r.procInstBody+="?"+s,r.state=A.PROC_INST_BODY);continue;case A.OPEN_TAG:v(f,s)?r.tagName+=s:(D(r),">"===s?k(r):"/"===s?r.state=A.OPEN_TAG_SLASH:(d(s)||P(r,"Invalid character in tag name"),r.state=A.ATTRIB));continue;case A.OPEN_TAG_SLASH:">"===s?(k(r,!0),j(r)):(P(r,"Forward-slash in opening tag not followed by >"),r.state=A.ATTRIB);continue;case A.ATTRIB:if(d(s))continue;">"===s?k(r):"/"===s?r.state=A.OPEN_TAG_SLASH:v(h,s)?(r.attribName=s,r.attribValue="",r.state=A.ATTRIB_NAME):P(r,"Invalid attribute name");continue;case A.ATTRIB_NAME:"="===s?r.state=A.ATTRIB_VALUE:">"===s?(P(r,"Attribute without value"),r.attribValue=r.attribName,M(r),k(r)):d(s)?r.state=A.ATTRIB_NAME_SAW_WHITE:v(f,s)?r.attribName+=s:P(r,"Invalid attribute name");continue;case A.ATTRIB_NAME_SAW_WHITE:if("="===s)r.state=A.ATTRIB_VALUE;else{if(d(s))continue;P(r,"Attribute without value"),r.tag.attributes[r.attribName]="",r.attribValue="",O(r,"onattribute",{name:r.attribName,value:""}),r.attribName="",">"===s?k(r):v(h,s)?(r.attribName=s,r.state=A.ATTRIB_NAME):(P(r,"Invalid attribute name"),r.state=A.ATTRIB)}continue;case A.ATTRIB_VALUE:if(d(s))continue;y(s)?(r.q=s,r.state=A.ATTRIB_VALUE_QUOTED):(P(r,"Unquoted attribute value"),r.state=A.ATTRIB_VALUE_UNQUOTED,r.attribValue=s);continue;case A.ATTRIB_VALUE_QUOTED:if(s!==r.q){"&"===s?r.state=A.ATTRIB_VALUE_ENTITY_Q:r.attribValue+=s;continue}M(r),r.q="",r.state=A.ATTRIB_VALUE_CLOSED;continue;case A.ATTRIB_VALUE_CLOSED:d(s)?r.state=A.ATTRIB:">"===s?k(r):"/"===s?r.state=A.OPEN_TAG_SLASH:v(h,s)?(P(r,"No whitespace between attributes"),r.attribName=s,r.attribValue="",r.state=A.ATTRIB_NAME):P(r,"Invalid attribute name");continue;case A.ATTRIB_VALUE_UNQUOTED:if(!b(s)){"&"===s?r.state=A.ATTRIB_VALUE_ENTITY_U:r.attribValue+=s;continue}M(r),">"===s?k(r):r.state=A.ATTRIB;continue;case A.CLOSE_TAG:if(r.tagName)">"===s?j(r):v(f,s)?r.tagName+=s:r.script?(r.script+="</"+r.tagName,r.tagName="",r.state=A.SCRIPT):(d(s)||P(r,"Invalid tagname in closing tag"),r.state=A.CLOSE_TAG_SAW_WHITE);else{if(d(s))continue;E(h,s)?r.script?(r.script+="</"+s,r.state=A.SCRIPT):P(r,"Invalid tagname in closing tag."):r.tagName=s}continue;case A.CLOSE_TAG_SAW_WHITE:if(d(s))continue;">"===s?j(r):P(r,"Invalid characters in closing tag");continue;case A.TEXT_ENTITY:case A.ATTRIB_VALUE_ENTITY_Q:case A.ATTRIB_VALUE_ENTITY_U:var l,p;switch(r.state){case A.TEXT_ENTITY:l=A.TEXT,p="textNode";break;case A.ATTRIB_VALUE_ENTITY_Q:l=A.ATTRIB_VALUE_QUOTED,p="attribValue";break;case A.ATTRIB_VALUE_ENTITY_U:l=A.ATTRIB_VALUE_UNQUOTED,p="attribValue"}";"===s?(r[p]+=L(r),r.entity="",r.state=l):v(r.entity.length?m:g,s)?r.entity+=s:(P(r,"Invalid character in entity name"),r[p]+="&"+r.entity+s,r.entity="",r.state=l);continue;default:throw new Error(r,"Unknown state: "+r.state)}return r.position>=r.bufferCheckPosition&&function(e){for(var r=Math.max(t.MAX_BUFFER_LENGTH,10),i=0,s=0,a=n.length;s<a;s++){var o=e[n[s]].length;if(o>r)switch(n[s]){case"textNode":S(e);break;case"cdata":O(e,"oncdata",e.cdata),e.cdata="";break;case"script":O(e,"onscript",e.script),e.script="";break;default:C(e,"Max buffer length exceeded: "+n[s])}i=Math.max(i,o)}var c=t.MAX_BUFFER_LENGTH-i;e.bufferCheckPosition=c+e.position}(r),r}
2
- /*! http://mths.be/fromcodepoint v0.1.0 by @mathias */,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){var t;S(t=this),""!==t.cdata&&(O(t,"oncdata",t.cdata),t.cdata=""),""!==t.script&&(O(t,"onscript",t.script),t.script="")}};try{e=require("stream").Stream}catch(t){e=function(){}}var i=t.EVENTS.filter(function(t){return"error"!==t&&"end"!==t});function a(t,n){if(!(this instanceof a))return new a(t,n);e.apply(this),this._parser=new r(t,n),this.writable=!0,this.readable=!0;var s=this;this._parser.onend=function(){s.emit("end")},this._parser.onerror=function(t){s.emit("error",t),s._parser.error=null},this._decoder=null,i.forEach(function(t){Object.defineProperty(s,"on"+t,{get:function(){return s._parser["on"+t]},set:function(e){if(!e)return s.removeAllListeners(t),s._parser["on"+t]=e,e;s.on(t,e)},enumerable:!0,configurable:!1})})}a.prototype=Object.create(e.prototype,{constructor:{value:a}}),a.prototype.write=function(t){if("function"==typeof Buffer&&"function"==typeof Buffer.isBuffer&&Buffer.isBuffer(t)){if(!this._decoder){var e=s.StringDecoder;this._decoder=new e("utf8")}t=this._decoder.write(t)}return this._parser.write(t.toString()),this.emit("data",t),!0},a.prototype.end=function(t){return t&&t.length&&this.write(t),this._parser.end(),!0},a.prototype.on=function(t,n){var r=this;return r._parser["on"+t]||-1===i.indexOf(t)||(r._parser["on"+t]=function(){var e=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);e.splice(0,0,t),r.emit.apply(r,e)}),e.prototype.on.call(r,t,n)};var o="[CDATA[",c="DOCTYPE",u="http://www.w3.org/XML/1998/namespace",l="http://www.w3.org/2000/xmlns/",p={xml:u,xmlns:l},h=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,f=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,g=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,m=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function d(t){return" "===t||"\n"===t||"\r"===t||"\t"===t}function y(t){return'"'===t||"'"===t}function b(t){return">"===t||d(t)}function v(t,e){return t.test(e)}function E(t,e){return!v(t,e)}var T,x,w,A=0;for(var _ in t.STATE={BEGIN:A++,BEGIN_WHITESPACE:A++,TEXT:A++,TEXT_ENTITY:A++,OPEN_WAKA:A++,SGML_DECL:A++,SGML_DECL_QUOTED:A++,DOCTYPE:A++,DOCTYPE_QUOTED:A++,DOCTYPE_DTD:A++,DOCTYPE_DTD_QUOTED:A++,COMMENT_STARTING:A++,COMMENT:A++,COMMENT_ENDING:A++,COMMENT_ENDED:A++,CDATA:A++,CDATA_ENDING:A++,CDATA_ENDING_2:A++,PROC_INST:A++,PROC_INST_BODY:A++,PROC_INST_ENDING:A++,OPEN_TAG:A++,OPEN_TAG_SLASH:A++,ATTRIB:A++,ATTRIB_NAME:A++,ATTRIB_NAME_SAW_WHITE:A++,ATTRIB_VALUE:A++,ATTRIB_VALUE_QUOTED:A++,ATTRIB_VALUE_CLOSED:A++,ATTRIB_VALUE_UNQUOTED:A++,ATTRIB_VALUE_ENTITY_Q:A++,ATTRIB_VALUE_ENTITY_U:A++,CLOSE_TAG:A++,CLOSE_TAG_SAW_WHITE:A++,SCRIPT:A++,SCRIPT_ENDING:A++},t.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},t.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(t.ENTITIES).forEach(function(e){var n=t.ENTITIES[e],r="number"==typeof n?String.fromCharCode(n):n;t.ENTITIES[e]=r}),t.STATE)t.STATE[t.STATE[_]]=_;function N(t,e,n){t[e]&&t[e](n)}function O(t,e,n){t.textNode&&S(t),N(t,e,n)}function S(t){t.textNode=F(t.opt,t.textNode),t.textNode&&N(t,"ontext",t.textNode),t.textNode=""}function F(t,e){return t.trim&&(e=e.trim()),t.normalize&&(e=e.replace(/\s+/g," ")),e}function C(t,e){return S(t),t.trackPosition&&(e+="\nLine: "+t.line+"\nColumn: "+t.column+"\nChar: "+t.c),e=new Error(e),t.error=e,N(t,"onerror",e),t}function I(t){return t.sawRoot&&!t.closedRoot&&P(t,"Unclosed root tag"),t.state!==A.BEGIN&&t.state!==A.BEGIN_WHITESPACE&&t.state!==A.TEXT&&C(t,"Unexpected end"),S(t),t.c="",t.closed=!0,N(t,"onend"),r.call(t,t.strict,t.opt),t}function P(t,e){if("object"!=typeof t||!(t instanceof r))throw new Error("bad call to strictFail");t.strict&&C(t,e)}function D(t){t.strict||(t.tagName=t.tagName[t.looseCase]());var e=t.tags[t.tags.length-1]||t,n=t.tag={name:t.tagName,attributes:{}};t.opt.xmlns&&(n.ns=e.ns),t.attribList.length=0,O(t,"onopentagstart",n)}function R(t,e){var n=t.indexOf(":")<0?["",t]:t.split(":"),r=n[0],i=n[1];return e&&"xmlns"===t&&(r="xmlns",i=""),{prefix:r,local:i}}function M(t){if(t.strict||(t.attribName=t.attribName[t.looseCase]()),-1!==t.attribList.indexOf(t.attribName)||t.tag.attributes.hasOwnProperty(t.attribName))t.attribName=t.attribValue="";else{if(t.opt.xmlns){var e=R(t.attribName,!0),n=e.prefix,r=e.local;if("xmlns"===n)if("xml"===r&&t.attribValue!==u)P(t,"xml: prefix must be bound to "+u+"\nActual: "+t.attribValue);else if("xmlns"===r&&t.attribValue!==l)P(t,"xmlns: prefix must be bound to "+l+"\nActual: "+t.attribValue);else{var i=t.tag,s=t.tags[t.tags.length-1]||t;i.ns===s.ns&&(i.ns=Object.create(s.ns)),i.ns[r]=t.attribValue}t.attribList.push([t.attribName,t.attribValue])}else t.tag.attributes[t.attribName]=t.attribValue,O(t,"onattribute",{name:t.attribName,value:t.attribValue});t.attribName=t.attribValue=""}}function k(t,e){if(t.opt.xmlns){var n=t.tag,r=R(t.tagName);n.prefix=r.prefix,n.local=r.local,n.uri=n.ns[r.prefix]||"",n.prefix&&!n.uri&&(P(t,"Unbound namespace prefix: "+JSON.stringify(t.tagName)),n.uri=r.prefix);var i=t.tags[t.tags.length-1]||t;n.ns&&i.ns!==n.ns&&Object.keys(n.ns).forEach(function(e){O(t,"onopennamespace",{prefix:e,uri:n.ns[e]})});for(var s=0,a=t.attribList.length;s<a;s++){var o=t.attribList[s],c=o[0],u=o[1],l=R(c,!0),p=l.prefix,h=l.local,f=""===p?"":n.ns[p]||"",g={name:c,value:u,prefix:p,local:h,uri:f};p&&"xmlns"!==p&&!f&&(P(t,"Unbound namespace prefix: "+JSON.stringify(p)),g.uri=p),t.tag.attributes[c]=g,O(t,"onattribute",g)}t.attribList.length=0}t.tag.isSelfClosing=!!e,t.sawRoot=!0,t.tags.push(t.tag),O(t,"onopentag",t.tag),e||(t.noscript||"script"!==t.tagName.toLowerCase()?t.state=A.TEXT:t.state=A.SCRIPT,t.tag=null,t.tagName=""),t.attribName=t.attribValue="",t.attribList.length=0}function j(t){if(!t.tagName)return P(t,"Weird empty close tag."),t.textNode+="</>",void(t.state=A.TEXT);if(t.script){if("script"!==t.tagName)return t.script+="</"+t.tagName+">",t.tagName="",void(t.state=A.SCRIPT);O(t,"onscript",t.script),t.script=""}var e=t.tags.length,n=t.tagName;t.strict||(n=n[t.looseCase]());for(var r=n;e--&&t.tags[e].name!==r;)P(t,"Unexpected close tag");if(e<0)return P(t,"Unmatched closing tag: "+t.tagName),t.textNode+="</"+t.tagName+">",void(t.state=A.TEXT);t.tagName=n;for(var i=t.tags.length;i-- >e;){var s=t.tag=t.tags.pop();t.tagName=t.tag.name,O(t,"onclosetag",t.tagName);var a={};for(var o in s.ns)a[o]=s.ns[o];var c=t.tags[t.tags.length-1]||t;t.opt.xmlns&&s.ns!==c.ns&&Object.keys(s.ns).forEach(function(e){var n=s.ns[e];O(t,"onclosenamespace",{prefix:e,uri:n})})}0===e&&(t.closedRoot=!0),t.tagName=t.attribValue=t.attribName="",t.attribList.length=0,t.state=A.TEXT}function L(t){var e,n=t.entity,r=n.toLowerCase(),i="";return t.ENTITIES[n]?t.ENTITIES[n]:t.ENTITIES[r]?t.ENTITIES[r]:("#"===(n=r).charAt(0)&&("x"===n.charAt(1)?(n=n.slice(2),i=(e=parseInt(n,16)).toString(16)):(n=n.slice(1),i=(e=parseInt(n,10)).toString(10))),n=n.replace(/^0+/,""),isNaN(e)||i.toLowerCase()!==n?(P(t,"Invalid character entity"),"&"+t.entity+";"):String.fromCodePoint(e))}function K(t,e){"<"===e?(t.state=A.OPEN_WAKA,t.startTagPosition=t.position):d(e)||(P(t,"Non-whitespace before first tag."),t.textNode=e,t.state=A.TEXT)}function B(t,e){var n="";return e<t.length&&(n=t.charAt(e)),n}A=t.STATE,String.fromCodePoint||(T=String.fromCharCode,x=Math.floor,w=function(){var t,e,n=[],r=-1,i=arguments.length;if(!i)return"";for(var s="";++r<i;){var a=Number(arguments[r]);if(!isFinite(a)||a<0||a>1114111||x(a)!==a)throw RangeError("Invalid code point: "+a);a<=65535?n.push(a):(t=55296+((a-=65536)>>10),e=a%1024+56320,n.push(t,e)),(r+1===i||n.length>16384)&&(s+=T.apply(null,n),n.length=0)}return s},Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:w,configurable:!0,writable:!0}):String.fromCodePoint=w)}(Dt)),Dt}function Mt(){return Et?vt:(Et=1,vt={isArray:function(t){return Array.isArray?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(t)}})}function kt(){if(xt)return Tt;xt=1;var t=Mt().isArray;return Tt={copyOptions:function(t){var e,n={};for(e in t)t.hasOwnProperty(e)&&(n[e]=t[e]);return n},ensureFlagExists:function(t,e){t in e&&"boolean"==typeof e[t]||(e[t]=!1)},ensureSpacesExists:function(t){(!("spaces"in t)||"number"!=typeof t.spaces&&"string"!=typeof t.spaces)&&(t.spaces=0)},ensureAlwaysArrayExists:function(e){"alwaysArray"in e&&("boolean"==typeof e.alwaysArray||t(e.alwaysArray))||(e.alwaysArray=!1)},ensureKeyExists:function(t,e){t+"Key"in e&&"string"==typeof e[t+"Key"]||(e[t+"Key"]=e.compact?"_"+t:t)},checkFnExists:function(t,e){return t+"Fn"in e}}}function jt(){if(At)return wt;At=1;var t,e,n=Rt(),r=kt(),i=Mt().isArray;function s(t){var e=Number(t);if(!isNaN(e))return e;var n=t.toLowerCase();return"true"===n||"false"!==n&&t}function a(n,r){var s;if(t.compact){if(!e[t[n+"Key"]]&&(i(t.alwaysArray)?-1!==t.alwaysArray.indexOf(t[n+"Key"]):t.alwaysArray)&&(e[t[n+"Key"]]=[]),e[t[n+"Key"]]&&!i(e[t[n+"Key"]])&&(e[t[n+"Key"]]=[e[t[n+"Key"]]]),n+"Fn"in t&&"string"==typeof r&&(r=t[n+"Fn"](r,e)),"instruction"===n&&("instructionFn"in t||"instructionNameFn"in t))for(s in r)if(r.hasOwnProperty(s))if("instructionFn"in t)r[s]=t.instructionFn(r[s],s,e);else{var a=r[s];delete r[s],r[t.instructionNameFn(s,a,e)]=a}i(e[t[n+"Key"]])?e[t[n+"Key"]].push(r):e[t[n+"Key"]]=r}else{e[t.elementsKey]||(e[t.elementsKey]=[]);var o={};if(o[t.typeKey]=n,"instruction"===n){for(s in r)if(r.hasOwnProperty(s))break;o[t.nameKey]="instructionNameFn"in t?t.instructionNameFn(s,r,e):s,t.instructionHasAttributes?(o[t.attributesKey]=r[s][t.attributesKey],"instructionFn"in t&&(o[t.attributesKey]=t.instructionFn(o[t.attributesKey],s,e))):("instructionFn"in t&&(r[s]=t.instructionFn(r[s],s,e)),o[t.instructionKey]=r[s])}else n+"Fn"in t&&(r=t[n+"Fn"](r,e)),o[t[n+"Key"]]=r;t.addParent&&(o[t.parentKey]=e),e[t.elementsKey].push(o)}}function o(n){var r;if("attributesFn"in t&&n&&(n=t.attributesFn(n,e)),(t.trim||"attributeValueFn"in t||"attributeNameFn"in t||t.nativeTypeAttributes)&&n)for(r in n)if(n.hasOwnProperty(r)&&(t.trim&&(n[r]=n[r].trim()),t.nativeTypeAttributes&&(n[r]=s(n[r])),"attributeValueFn"in t&&(n[r]=t.attributeValueFn(n[r],r,e)),"attributeNameFn"in t)){var i=n[r];delete n[r],n[t.attributeNameFn(r,n[r],e)]=i}return n}function c(n){var r={};if(n.body&&("xml"===n.name.toLowerCase()||t.instructionHasAttributes)){for(var i,s=/([\w:-]+)\s*=\s*(?:"([^"]*)"|'([^']*)'|(\w+))\s*/g;null!==(i=s.exec(n.body));)r[i[1]]=i[2]||i[3]||i[4];r=o(r)}if("xml"===n.name.toLowerCase()){if(t.ignoreDeclaration)return;e[t.declarationKey]={},Object.keys(r).length&&(e[t.declarationKey][t.attributesKey]=r),t.addParent&&(e[t.declarationKey][t.parentKey]=e)}else{if(t.ignoreInstruction)return;t.trim&&(n.body=n.body.trim());var c={};t.instructionHasAttributes&&Object.keys(r).length?(c[n.name]={},c[n.name][t.attributesKey]=r):c[n.name]=n.body,a("instruction",c)}}function u(n,r){var s;if("object"==typeof n&&(r=n.attributes,n=n.name),r=o(r),"elementNameFn"in t&&(n=t.elementNameFn(n,e)),t.compact){var a;if(s={},!t.ignoreAttributes&&r&&Object.keys(r).length)for(a in s[t.attributesKey]={},r)r.hasOwnProperty(a)&&(s[t.attributesKey][a]=r[a]);!(n in e)&&(i(t.alwaysArray)?-1!==t.alwaysArray.indexOf(n):t.alwaysArray)&&(e[n]=[]),e[n]&&!i(e[n])&&(e[n]=[e[n]]),i(e[n])?e[n].push(s):e[n]=s}else e[t.elementsKey]||(e[t.elementsKey]=[]),(s={})[t.typeKey]="element",s[t.nameKey]=n,!t.ignoreAttributes&&r&&Object.keys(r).length&&(s[t.attributesKey]=r),t.alwaysChildren&&(s[t.elementsKey]=[]),e[t.elementsKey].push(s);s[t.parentKey]=e,e=s}function l(e){t.ignoreText||(e.trim()||t.captureSpacesBetweenElements)&&(t.trim&&(e=e.trim()),t.nativeType&&(e=s(e)),t.sanitize&&(e=e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")),a("text",e))}function p(e){t.ignoreComment||(t.trim&&(e=e.trim()),a("comment",e))}function h(n){var r=e[t.parentKey];t.addParent||delete e[t.parentKey],e=r}function f(e){t.ignoreCdata||(t.trim&&(e=e.trim()),a("cdata",e))}function g(e){t.ignoreDoctype||(e=e.replace(/^ /,""),t.trim&&(e=e.trim()),a("doctype",e))}function m(t){t.note=t}return wt=function(i,s){var a=n.parser(!0,{}),o={};if(e=o,t=function(e){return t=r.copyOptions(e),r.ensureFlagExists("ignoreDeclaration",t),r.ensureFlagExists("ignoreInstruction",t),r.ensureFlagExists("ignoreAttributes",t),r.ensureFlagExists("ignoreText",t),r.ensureFlagExists("ignoreComment",t),r.ensureFlagExists("ignoreCdata",t),r.ensureFlagExists("ignoreDoctype",t),r.ensureFlagExists("compact",t),r.ensureFlagExists("alwaysChildren",t),r.ensureFlagExists("addParent",t),r.ensureFlagExists("trim",t),r.ensureFlagExists("nativeType",t),r.ensureFlagExists("nativeTypeAttributes",t),r.ensureFlagExists("sanitize",t),r.ensureFlagExists("instructionHasAttributes",t),r.ensureFlagExists("captureSpacesBetweenElements",t),r.ensureAlwaysArrayExists(t),r.ensureKeyExists("declaration",t),r.ensureKeyExists("instruction",t),r.ensureKeyExists("attributes",t),r.ensureKeyExists("text",t),r.ensureKeyExists("comment",t),r.ensureKeyExists("cdata",t),r.ensureKeyExists("doctype",t),r.ensureKeyExists("type",t),r.ensureKeyExists("name",t),r.ensureKeyExists("elements",t),r.ensureKeyExists("parent",t),r.checkFnExists("doctype",t),r.checkFnExists("instruction",t),r.checkFnExists("cdata",t),r.checkFnExists("comment",t),r.checkFnExists("text",t),r.checkFnExists("instructionName",t),r.checkFnExists("elementName",t),r.checkFnExists("attributeName",t),r.checkFnExists("attributeValue",t),r.checkFnExists("attributes",t),t}(s),a.opt={strictEntities:!0},a.onopentag=u,a.ontext=l,a.oncomment=p,a.onclosetag=h,a.onerror=m,a.oncdata=f,a.ondoctype=g,a.onprocessinginstruction=c,a.write(i).close(),o[t.elementsKey]){var d=o[t.elementsKey];delete o[t.elementsKey],o[t.elementsKey]=d,delete o.text}return o}}function Lt(){if(Nt)return _t;Nt=1;var t=kt(),e=jt();return _t=function(n,r){var i,s,a;return i=function(e){var n=t.copyOptions(e);return t.ensureSpacesExists(n),n}(r),s=e(n,i),a="compact"in i&&i.compact?"_parent":"parent",("addParent"in i&&i.addParent?JSON.stringify(s,function(t,e){return t===a?"_":e},i.spaces):JSON.stringify(s,null,i.spaces)).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}}function Kt(){if(St)return Ot;St=1;var t,e,n=kt(),r=Mt().isArray;function i(t,e,n){return(!n&&t.spaces?"\n":"")+Array(e+1).join(t.spaces)}function s(n,r,s){if(r.ignoreAttributes)return"";"attributesFn"in r&&(n=r.attributesFn(n,e,t));var a,o,c,u,l=[];for(a in n)n.hasOwnProperty(a)&&null!==n[a]&&void 0!==n[a]&&(u=r.noQuotesForNativeAttributes&&"string"!=typeof n[a]?"":'"',o=(o=""+n[a]).replace(/"/g,"&quot;"),c="attributeNameFn"in r?r.attributeNameFn(a,o,e,t):a,l.push(r.spaces&&r.indentAttributes?i(r,s+1,!1):" "),l.push(c+"="+u+("attributeValueFn"in r?r.attributeValueFn(o,a,e,t):o)+u));return n&&Object.keys(n).length&&r.spaces&&r.indentAttributes&&l.push(i(r,s,!1)),l.join("")}function a(n,r,i){return t=n,e="xml",r.ignoreDeclaration?"":"<?xml"+s(n[r.attributesKey],r,i)+"?>"}function o(n,r,i){if(r.ignoreInstruction)return"";var a;for(a in n)if(n.hasOwnProperty(a))break;var o="instructionNameFn"in r?r.instructionNameFn(a,n[a],e,t):a;if("object"==typeof n[a])return t=n,e=o,"<?"+o+s(n[a][r.attributesKey],r,i)+"?>";var c=n[a]?n[a]:"";return"instructionFn"in r&&(c=r.instructionFn(c,a,e,t)),"<?"+o+(c?" "+c:"")+"?>"}function c(n,r){return r.ignoreComment?"":"\x3c!--"+("commentFn"in r?r.commentFn(n,e,t):n)+"--\x3e"}function u(n,r){return r.ignoreCdata?"":"<![CDATA["+("cdataFn"in r?r.cdataFn(n,e,t):n.replace("]]>","]]]]><![CDATA[>"))+"]]>"}function l(n,r){return r.ignoreDoctype?"":"<!DOCTYPE "+("doctypeFn"in r?r.doctypeFn(n,e,t):n)+">"}function p(n,r){return r.ignoreText?"":(n=(n=(n=""+n).replace(/&amp;/g,"&")).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),"textFn"in r?r.textFn(n,e,t):n)}function h(n,r,a,f){return n.reduce(function(n,g){var m=i(r,a,f&&!n);switch(g.type){case"element":return n+m+function(n,r,i){t=n,e=n.name;var a=[],o="elementNameFn"in r?r.elementNameFn(n.name,n):n.name;a.push("<"+o),n[r.attributesKey]&&a.push(s(n[r.attributesKey],r,i));var c=n[r.elementsKey]&&n[r.elementsKey].length||n[r.attributesKey]&&"preserve"===n[r.attributesKey]["xml:space"];return c||(c="fullTagEmptyElementFn"in r?r.fullTagEmptyElementFn(n.name,n):r.fullTagEmptyElement),c?(a.push(">"),n[r.elementsKey]&&n[r.elementsKey].length&&(a.push(h(n[r.elementsKey],r,i+1)),t=n,e=n.name),a.push(r.spaces&&function(t,e){var n;if(t.elements&&t.elements.length)for(n=0;n<t.elements.length;++n)switch(t.elements[n][e.typeKey]){case"text":if(e.indentText)return!0;break;case"cdata":if(e.indentCdata)return!0;break;case"instruction":if(e.indentInstruction)return!0;break;default:return!0}return!1}(n,r)?"\n"+Array(i+1).join(r.spaces):""),a.push("</"+o+">")):a.push("/>"),a.join("")}(g,r,a);case"comment":return n+m+c(g[r.commentKey],r);case"doctype":return n+m+l(g[r.doctypeKey],r);case"cdata":return n+(r.indentCdata?m:"")+u(g[r.cdataKey],r);case"text":return n+(r.indentText?m:"")+p(g[r.textKey],r);case"instruction":var d={};return d[g[r.nameKey]]=g[r.attributesKey]?g:g[r.instructionKey],n+(r.indentInstruction?m:"")+o(d,r,a)}},"")}function f(t,e,n){var r;for(r in t)if(t.hasOwnProperty(r))switch(r){case e.parentKey:case e.attributesKey:break;case e.textKey:if(e.indentText||n)return!0;break;case e.cdataKey:if(e.indentCdata||n)return!0;break;case e.instructionKey:if(e.indentInstruction||n)return!0;break;case e.doctypeKey:case e.commentKey:default:return!0}return!1}function g(n,r,a,o,c){t=n,e=r;var u="elementNameFn"in a?a.elementNameFn(r,n):r;if(null==n||""===n)return"fullTagEmptyElementFn"in a&&a.fullTagEmptyElementFn(r,n)||a.fullTagEmptyElement?"<"+u+"></"+u+">":"<"+u+"/>";var l=[];if(r){if(l.push("<"+u),"object"!=typeof n)return l.push(">"+p(n,a)+"</"+u+">"),l.join("");n[a.attributesKey]&&l.push(s(n[a.attributesKey],a,o));var h=f(n,a,!0)||n[a.attributesKey]&&"preserve"===n[a.attributesKey]["xml:space"];if(h||(h="fullTagEmptyElementFn"in a?a.fullTagEmptyElementFn(r,n):a.fullTagEmptyElement),!h)return l.push("/>"),l.join("");l.push(">")}return l.push(m(n,a,o+1,!1)),t=n,e=r,r&&l.push((c?i(a,o,!1):"")+"</"+u+">"),l.join("")}function m(t,e,n,s){var h,m,d,y=[];for(m in t)if(t.hasOwnProperty(m))for(d=r(t[m])?t[m]:[t[m]],h=0;h<d.length;++h){switch(m){case e.declarationKey:y.push(a(d[h],e,n));break;case e.instructionKey:y.push((e.indentInstruction?i(e,n,s):"")+o(d[h],e,n));break;case e.attributesKey:case e.parentKey:break;case e.textKey:y.push((e.indentText?i(e,n,s):"")+p(d[h],e));break;case e.cdataKey:y.push((e.indentCdata?i(e,n,s):"")+u(d[h],e));break;case e.doctypeKey:y.push(i(e,n,s)+l(d[h],e));break;case e.commentKey:y.push(i(e,n,s)+c(d[h],e));break;default:y.push(i(e,n,s)+g(d[h],m,e,n,f(d[h],e)))}s=s&&!y.length}return y.join("")}return Ot=function(r,i){i=function(t){var e=n.copyOptions(t);return n.ensureFlagExists("ignoreDeclaration",e),n.ensureFlagExists("ignoreInstruction",e),n.ensureFlagExists("ignoreAttributes",e),n.ensureFlagExists("ignoreText",e),n.ensureFlagExists("ignoreComment",e),n.ensureFlagExists("ignoreCdata",e),n.ensureFlagExists("ignoreDoctype",e),n.ensureFlagExists("compact",e),n.ensureFlagExists("indentText",e),n.ensureFlagExists("indentCdata",e),n.ensureFlagExists("indentAttributes",e),n.ensureFlagExists("indentInstruction",e),n.ensureFlagExists("fullTagEmptyElement",e),n.ensureFlagExists("noQuotesForNativeAttributes",e),n.ensureSpacesExists(e),"number"==typeof e.spaces&&(e.spaces=Array(e.spaces+1).join(" ")),n.ensureKeyExists("declaration",e),n.ensureKeyExists("instruction",e),n.ensureKeyExists("attributes",e),n.ensureKeyExists("text",e),n.ensureKeyExists("comment",e),n.ensureKeyExists("cdata",e),n.ensureKeyExists("doctype",e),n.ensureKeyExists("type",e),n.ensureKeyExists("name",e),n.ensureKeyExists("elements",e),n.checkFnExists("doctype",e),n.checkFnExists("instruction",e),n.checkFnExists("cdata",e),n.checkFnExists("comment",e),n.checkFnExists("text",e),n.checkFnExists("instructionName",e),n.checkFnExists("elementName",e),n.checkFnExists("attributeName",e),n.checkFnExists("attributeValue",e),n.checkFnExists("attributes",e),n.checkFnExists("fullTagEmptyElement",e),e}(i);var s=[];return t=r,e="_root_",i.compact?s.push(m(r,i,0,!0)):(r[i.declarationKey]&&s.push(a(r[i.declarationKey],i,0)),r[i.elementsKey]&&r[i.elementsKey].length&&s.push(h(r[i.elementsKey],i,0,!s.length))),s.join("")}}function Bt(){if(Ct)return Ft;Ct=1;var t=Kt();return Ft=function(e,n){e instanceof Buffer&&(e=e.toString());var r=null;if("string"==typeof e)try{r=JSON.parse(e)}catch(t){throw new Error("The JSON structure is invalid")}else r=e;return t(r,n)}}var Gt=function(){if(Pt)return It;Pt=1;var t=jt(),e=Lt(),n=Kt(),r=Bt();return It={xml2js:t,xml2json:e,js2xml:n,json2xml:r}}();function Ut(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),Gt.xml2js(t,{compact:!1})}function $t(t,e){return Gt.js2xml(t,e)}function Vt(t,e){return function(t,e){return t&&t.find(e)}(t,t=>t.name===e)}const Wt=t.env.debug("vbapm:target.transforms.core-xml"),zt=/docProps[\/,\\]core\.xml/i;function qt(t,...e){t=t.slice();for(const n of e){const e=t.indexOf(n);t.splice(e,1)}return t}const Xt=t.env.debug("vbapm:target.transforms.workbook-xml"),Yt=/xl[\/,\\]workbook\.xml/i;const Ht=/vba.*\.bin/i;const Qt=function(...t){return(e,n,r)=>t.reduce((t,i)=>t?i(e,n,r):t,!0)}(function(t){return!Ht.test(t.path)}),Jt=function(...t){return(e,n,r)=>t.reduce((t,e)=>e(t,n,r),e)}(function(t){if(!zt.test(t.path))return t;const e=Ut(t.data.toString("utf8")),n=Vt(e.elements,"cp:coreProperties");if(n){const t=Vt(n.elements,"cp:lastModifiedBy"),e=Vt(n.elements,"dc:creator");t&&e&&(t.elements[0].text=e.elements[0].text);const r=Vt(n.elements,"dcterms:modified"),i=Vt(n.elements,"dcterms:created");r&&i&&(r.elements[0].text=i.elements[0].text)}else Wt("Warning: cp:coreProperties not found, unable to transform core.xml");return t.data=Buffer.from($t(e)),t},function(t){if(!Yt.test(t.path))return t;const e=Ut(t.data.toString("utf8")),n=Vt(e.elements,"workbook");if(n){const t=Vt(n.elements,"mc:AlternateContent"),e=Vt(t&&t.elements,"mc:Choice"),r=Vt(e&&e.elements,"x15ac:absPath");r&&(r.attributes.url="");const i=Vt(n.elements,"bookViews");i&&(n.elements=qt(n.elements,i));const s=Vt(n.elements,"fileVersion");s&&(n.elements=qt(n.elements,s));const a=Vt(n.elements,"calcPr");a&&(a.attributes.calcId="0")}else Xt("Warning: workbook not found, unable to transform workbook.xml");return t.data=Buffer.from($t(e)),t});exports.addins=o,exports.createDocument=async function(n,r,i={}){const{application:s,addin:a,file:o}=u(n,r,i),c=!t.env.isWindows&&!i.staging;let l=c?t.join(n.paths.staging,r.filename):o;return await t.mkdirsExports.ensureDir(e.dirname(l)),await t.run(s,i.addin||a,"Build.CreateDocument",[JSON.stringify({path:l})]),c&&(await t.mkdirsExports.ensureDir(e.dirname(o)),await t.copyExports.copy(l,o)),o},exports.exportTo=async function(n,r,i,s={}){let{application:a,addin:o,file:c}=u(n,r);if(!t.env.isWindows){const n=t.join(i,"staged",r.filename);await t.pathExistsExports.pathExists(n)||(await t.mkdirsExports.ensureDir(e.dirname(n)),await t.copyExports.copy(c,n)),c=n}await t.run(a,s.addin||o,"Build.ExportTo",[JSON.stringify({file:c,staging:i})])},exports.extensionToApplication=l,exports.filterTarget=Qt,exports.importGraph=async function(e,n,r,i,s={}){const{application:a,addin:o}=u(e,n),{name:c,components:l,references:p}=r;await t.run(a,s.addin||o,"Build.ImportGraph",[JSON.stringify({file:i,name:c,src:l,references:p})])},exports.mapTarget=Jt,exports.requireCommonjs=j,exports.toSrc=yt,exports.walk=K;
@@ -1,9 +0,0 @@
1
- "use strict";var e=require("./installer-CJlDenLg.js"),r=require("./_commonjsHelpers-Bjf42z7h.js"),t=require("util"),s=require("path"),i=require("child_process"),o=require("fs"),n=require("os"),a=require("./build-project-BczswKQl.js");require("assert"),require("crypto"),require("events"),require("constants"),require("stream"),require("http"),require("url"),require("punycode"),require("https"),require("zlib"),require("./project-C3bWzV0O.js"),require("querystring"),require("./build-target-D6L5nsgt.js"),require("./transform-target-Doak2S1q.js"),require("string_decoder"),require("./load-from-project-Bpb6Ne_i.js"),require("./get-target-CH6IpAa1.js");var p,u,c,l={exports:{}};function d(){if(p)return l.exports;p=1;const e=n,r=o,t=()=>{if("linux"!==process.platform)return!1;if(e.release().includes("Microsoft"))return!0;try{return r.readFileSync("/proc/version","utf8").includes("Microsoft")}catch(e){return!1}};return process.env.__IS_WSL_TEST__?l.exports=t:l.exports=t(),l.exports}var f,g,m=function(){if(c)return u;c=1;const{promisify:e}=t,r=s,n=i,a=o,p=d(),l=e(a.access),f=e(n.execFile),g=r.join(__dirname,"xdg-open");return u=async(e,r)=>{if("string"!=typeof e)throw new TypeError("Expected a `target`");let t;r={wait:!1,background:!1,...r};let s=[];const i=[],o={};if(Array.isArray(r.app)&&(s=r.app.slice(1),r.app=r.app[0]),"darwin"===process.platform)t="open",r.wait&&i.push("--wait-apps"),r.background&&i.push("--background"),r.app&&i.push("-a",r.app);else if("win32"===process.platform||p){if(t="cmd"+(p?".exe":""),i.push("/c","start",'""',"/b"),e=e.replace(/&/g,"^&"),r.wait&&i.push("/wait"),r.app){if(p&&r.app.startsWith("/mnt/")){const e=await(async e=>{const{stdout:r}=await f("wslpath",["-w",e]);return r.trim()})(r.app);r.app=e}i.push(r.app)}s.length>0&&i.push(...s)}else{if(r.app)t=r.app;else{const e=!__dirname||"/"===__dirname;let r=!1;try{await l(g,a.constants.X_OK),r=!0}catch(e){}t=process.versions.electron||"android"===process.platform||e||!r?"xdg-open":g}s.length>0&&i.push(...s),r.wait||(o.stdio="ignore",o.detached=!0)}i.push(e),"darwin"===process.platform&&s.length>0&&i.push("--args",...s);const u=n.spawn(t,i,o);return r.wait?new Promise((e,r)=>{u.once("error",r),u.once("close",t=>{t>0?r(new Error(`Exited with code ${t}`)):e(u)})}):(u.unref(),u)},u}(),h=r.getDefaultExportFromCjs(m);var q=function(){if(g)return f;g=1;var e=["h","min","s","ms","μs","ns"],r=["hour","minute","second","millisecond","microsecond","nanosecond"],t=[3600,60,1,1e6,1e3,1];return f=function(s,i){var o,n,a,p,u,c,l,d,f;if(o=!1,n=!1,i&&(o=i.verbose||!1,n=i.precise||!1),!Array.isArray(s)||2!==s.length)return"";if("number"!=typeof s[0]||"number"!=typeof s[1])return"";for(s[1]<0&&(f=s[0]+s[1]/1e9,s[0]=parseInt(f),s[1]=1e9*parseFloat((f%1).toPrecision(9))),d="",a=0;a<6&&(p=s[a<3?0:1],3!==a&&0!==a&&(p%=t[a-1]),2===a&&(p+=s[1]/1e9),!((u=p/t[a])>=1)||(o&&(u=Math.floor(u)),n?l=u.toString():(c=u>=10?0:2,l=u.toFixed(c)),l.indexOf(".")>-1&&"0"===l[l.length-1]&&(l=l.replace(/\.?0+$/,"")),d&&(d+=" "),d+=l,o?(d+=" "+r[a],"1"!==l&&(d+="s")):d+=" "+e[a],o));a++);return d}}(),w=r.getDefaultExportFromCjs(q);const y=e.dedent`
2
- Build project from manifest (after backing up any existing built targets).
3
-
4
- Usage: vbapm build [options]
5
-
6
- Options:
7
- --target=TYPE Build target of type TYPE
8
- --release Exclude dev-* items from build
9
- --open Open built target`;exports.default=async function(e){if(e.help)return void console.log(y);const r=process.hrtime(),t=e.target,s=e.addin,i=!!e.release,o=await a.buildProject({target:t,addin:s,release:i});console.log(`Done. ${w(process.hrtime(r))}`),e.open&&await h(o)};
@@ -1,7 +0,0 @@
1
- "use strict";var e=require("./installer-CJlDenLg.js"),r=require("./export-project-DQ3bfvbV.js");require("child_process"),require("util"),require("assert"),require("path"),require("fs"),require("./_commonjsHelpers-Bjf42z7h.js"),require("crypto"),require("events"),require("os"),require("constants"),require("stream"),require("http"),require("url"),require("punycode"),require("https"),require("zlib"),require("./transform-target-Doak2S1q.js"),require("string_decoder"),require("./project-C3bWzV0O.js"),require("querystring"),require("./export-target-CN6RA_mA.js"),require("./load-from-project-Bpb6Ne_i.js");const t=e.dedent`
2
- Export built project, including src, references, and target.
3
-
4
- Usage: vbapm export
5
-
6
- Options:
7
- --target=TYPE Export target of type TYPE`;exports.default=async function(e){if(e.help)return void console.log(t);const i=e.target,s=e.completed,o=e.addin;await r.exportProject({target:i,completed:s,addin:o})};
@@ -1,8 +0,0 @@
1
- "use strict";var e=require("./installer-CJlDenLg.js"),r=require("./project-C3bWzV0O.js");require("child_process"),require("util"),require("assert"),require("path"),require("fs"),require("./_commonjsHelpers-Bjf42z7h.js"),require("crypto"),require("events"),require("os"),require("constants"),require("stream"),require("http"),require("url"),require("punycode"),require("https"),require("zlib"),require("querystring");const i=["patch","minor","major","prepatch","preminor","premajor","prerelease"];async function t(t,s={}){const n=await r.loadProject(),o=n.manifest.version,a=(p=t,i.includes(p));var p;let c;try{c=a?e.semverExports.inc(o,t,void 0,s.preid):e.semverExports.valid(t)}catch(e){}if(!c)throw new e.CliError(e.ErrorCode.InvalidVersion,`Invalid version increment "${t}"`);return n.manifest.version=c,await r.writeManifest(n.manifest,n.paths.dir),c}const s=e.dedent`
2
- Increment this project's version.
3
-
4
- Usage: vbapm version [<increment>] [options]
5
-
6
- Options:
7
- <increment> VERSION | patch | minor | major | prepatch | preminor | premajor
8
- --preid=TYPE Use TYPE for prerelease (e.g. "beta")`;exports.default=async function(e){if(e.help)return void console.log(s);const r=e._[0]||"patch",i=e.preid,n=await t(r,{preid:i});console.log(n)};