@sheetxl/studio-vanilla
Version:
SheetXL Studio - Vanilla entry point for integrating SheetXL UI.
24 lines • 165 kB
JavaScript
"use strict";/**
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.7.27
*
* (C) 2025-present SheetXL Inc. & Michael T. Ford
* License: The license can be found at https://www.sheetxl.com/license.
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./Bc1oKNEzl3Kcj4g5.cjs");var xo=typeof global=="object"&&global&&global.Object===Object&&global,Ms=typeof self=="object"&&self&&self.Object===Object&&self,Pt=xo||Ms||Function("return this")(),At=Pt.Symbol,Co=Object.prototype,Us=Co.hasOwnProperty,Fs=Co.toString,Ae=At?At.toStringTag:void 0,Ds=Object.prototype.toString,zr=At?At.toStringTag:void 0;function Zt(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":zr&&zr in Object(t)?(function(n){var r=Us.call(n,Ae),i=n[Ae];try{n[Ae]=void 0;var o=!0}catch{}var s=Fs.call(n);return o&&(r?n[Ae]=i:delete n[Ae]),s})(t):(e=t,Ds.call(e));var e}function vt(t){return t!=null&&typeof t=="object"}function Tn(t){return typeof t=="symbol"||vt(t)&&Zt(t)=="[object Symbol]"}function An(t,e){for(var n=-1,r=t==null?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}var B=Array.isArray,Vr=At?At.prototype:void 0,Hr=Vr?Vr.toString:void 0;function ko(t){if(typeof t=="string")return t;if(B(t))return An(t,ko)+"";if(Tn(t))return Hr?Hr.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}var js=/\s/,Bs=/^\s+/;function It(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var $s=/^[-+]0x[0-9a-f]+$/i,Ws=/^0b[01]+$/i,Gs=/^0o[0-7]+$/i,Ks=parseInt,zs=1/0;function Vs(t){return t?(t=(function(e){if(typeof e=="number")return e;if(Tn(e))return NaN;if(It(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=It(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=(function(i){return i&&i.slice(0,(function(o){for(var s=o.length;s--&&js.test(o.charAt(s)););return s})(i)+1).replace(Bs,"")})(e);var r=Ws.test(e);return r||Gs.test(e)?Ks(e.slice(2),r?2:8):$s.test(e)?NaN:+e})(t))===zs||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:t===0?t:0}function In(t){var e=Vs(t),n=e%1;return e==e?n?e-n:e:0}function de(t){return t}function Ht(t){if(!It(t))return!1;var e=Zt(t);return e=="[object Function]"||e=="[object GeneratorFunction]"||e=="[object AsyncFunction]"||e=="[object Proxy]"}var Yr,bn=Pt["__core-js_shared__"],Xr=(Yr=/[^.]+$/.exec(bn&&bn.keys&&bn.keys.IE_PROTO||""))?"Symbol(src)_1."+Yr:"",Hs=Function.prototype.toString;function ie(t){if(t!=null){try{return Hs.call(t)}catch{}try{return t+""}catch{}}return""}var Ys=/^\[object .+?Constructor\]$/,Xs=Function.prototype,qs=Object.prototype,Zs=Xs.toString,Qs=qs.hasOwnProperty,Js=RegExp("^"+Zs.call(Qs).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function oe(t,e){var n,r,i=(n=t,r=e,n?.[r]);return(function(o){return!(!It(o)||(s=o,Xr&&Xr in s))&&(Ht(o)?Js:Ys).test(ie(o));var s})(i)?i:void 0}var ar=oe(Pt,"WeakMap"),qr=Object.create,ta=(function(){function t(){}return function(e){if(!It(e))return{};if(qr)return qr(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}})();function Z(){}var Zr,Pn,wn,ea=Date.now,an=(function(){try{var t=oe(Object,"defineProperty");return t({},"",{}),t}catch{}})(),na=an?function(t,e){return an(t,"toString",{configurable:!0,enumerable:!1,value:(n=e,function(){return n}),writable:!0});var n}:de,ra=(Zr=na,Pn=0,wn=0,function(){var t=ea(),e=16-(t-wn);if(wn=t,e>0){if(++Pn>=800)return arguments[0]}else Pn=0;return Zr.apply(void 0,arguments)});function bo(t,e){for(var n=-1,r=t==null?0:t.length;++n<r&&e(t[n],n,t)!==!1;);return t}function Po(t,e,n,r){for(var i=t.length,o=n+-1;++o<i;)if(e(t[o],o,t))return o;return-1}function ia(t){return t!=t}function Cr(t,e,n){return e==e?(function(r,i,o){for(var s=o-1,a=r.length;++s<a;)if(r[s]===i)return s;return-1})(t,e,n):Po(t,ia,n)}function wo(t,e){return!(t==null||!t.length)&&Cr(t,e,0)>-1}var oa=/^(?:0|[1-9]\d*)$/;function Nn(t,e){var n=typeof t;return!!(e=e??9007199254740991)&&(n=="number"||n!="symbol"&&oa.test(t))&&t>-1&&t%1==0&&t<e}function kr(t,e,n){e=="__proto__"&&an?an(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function Be(t,e){return t===e||t!=t&&e!=e}var sa=Object.prototype.hasOwnProperty;function yn(t,e,n){var r=t[e];sa.call(t,e)&&Be(r,n)&&(n!==void 0||e in t)||kr(t,e,n)}function cr(t,e,n,r){var i=!n;n||(n={});for(var o=-1,s=e.length;++o<s;){var a=e[o],c=void 0;c===void 0&&(c=t[a]),i?kr(n,a,c):yn(n,a,c)}return n}var Qr=Math.max;function br(t,e){return ra((n=t,i=de,r=Qr((r=e)===void 0?n.length-1:r,0),function(){for(var o=arguments,s=-1,a=Qr(o.length-r,0),c=Array(a);++s<a;)c[s]=o[r+s];s=-1;for(var u=Array(r+1);++s<r;)u[s]=o[s];return u[r]=i(c),(function(l,h,N){switch(N.length){case 0:return l.call(h);case 1:return l.call(h,N[0]);case 2:return l.call(h,N[0],N[1]);case 3:return l.call(h,N[0],N[1],N[2])}return l.apply(h,N)})(n,this,u)}),t+"");var n,r,i}function Pr(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=9007199254740991}function wt(t){return t!=null&&Pr(t.length)&&!Ht(t)}function Mo(t,e,n){if(!It(n))return!1;var r=typeof e;return!!(r=="number"?wt(n)&&Nn(e,n.length):r=="string"&&e in n)&&Be(n[e],t)}var aa=Object.prototype;function $e(t){var e=t&&t.constructor;return t===(typeof e=="function"&&e.prototype||aa)}function Jr(t){return vt(t)&&Zt(t)=="[object Arguments]"}var Uo=Object.prototype,ca=Uo.hasOwnProperty,ua=Uo.propertyIsEnumerable,Rn=Jr((function(){return arguments})())?Jr:function(t){return vt(t)&&ca.call(t,"callee")&&!ua.call(t,"callee")},Fo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ti=Fo&&typeof module=="object"&&module&&!module.nodeType&&module,ei=ti&&ti.exports===Fo?Pt.Buffer:void 0,Pe=(ei?ei.isBuffer:void 0)||function(){return!1},z={};function vn(t){return function(e){return t(e)}}z["[object Float32Array]"]=z["[object Float64Array]"]=z["[object Int8Array]"]=z["[object Int16Array]"]=z["[object Int32Array]"]=z["[object Uint8Array]"]=z["[object Uint8ClampedArray]"]=z["[object Uint16Array]"]=z["[object Uint32Array]"]=!0,z["[object Arguments]"]=z["[object Array]"]=z["[object ArrayBuffer]"]=z["[object Boolean]"]=z["[object DataView]"]=z["[object Date]"]=z["[object Error]"]=z["[object Function]"]=z["[object Map]"]=z["[object Number]"]=z["[object Object]"]=z["[object RegExp]"]=z["[object Set]"]=z["[object String]"]=z["[object WeakMap]"]=!1;var Do=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Le=Do&&typeof module=="object"&&module&&!module.nodeType&&module,Mn=Le&&Le.exports===Do&&xo.process,Xt=(function(){try{return Le&&Le.require&&Le.require("util").types||Mn&&Mn.binding&&Mn.binding("util")}catch{}})(),ni=Xt&&Xt.isTypedArray,wr=ni?vn(ni):function(t){return vt(t)&&Pr(t.length)&&!!z[Zt(t)]},la=Object.prototype.hasOwnProperty;function jo(t,e){var n=B(t),r=!n&&Rn(t),i=!n&&!r&&Pe(t),o=!n&&!r&&!i&&wr(t),s=n||r||i||o,a=s?(function(l,h){for(var N=-1,S=Array(l);++N<l;)S[N]=h(N);return S})(t.length,String):[],c=a.length;for(var u in t)!e&&!la.call(t,u)||s&&(u=="length"||i&&(u=="offset"||u=="parent")||o&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Nn(u,c))||a.push(u);return a}function Bo(t,e){return function(n){return t(e(n))}}var ha=Bo(Object.keys,Object),fa=Object.prototype.hasOwnProperty;function $o(t){if(!$e(t))return ha(t);var e=[];for(var n in Object(t))fa.call(t,n)&&n!="constructor"&&e.push(n);return e}function Nt(t){return wt(t)?jo(t):$o(t)}var Un,da=Object.prototype.hasOwnProperty,dt=(Un=function(t,e){if($e(e)||wt(e))cr(e,Nt(e),t);else for(var n in e)da.call(e,n)&&yn(t,n,e[n])},br(function(t,e){var n=-1,r=e.length,i=r>1?e[r-1]:void 0,o=r>2?e[2]:void 0;for(i=Un.length>3&&typeof i=="function"?(r--,i):void 0,o&&Mo(e[0],e[1],o)&&(i=r<3?void 0:i,r=1),t=Object(t);++n<r;){var s=e[n];s&&Un(t,s)}return t})),pa=Object.prototype.hasOwnProperty;function Wo(t){return wt(t)?jo(t,!0):(function(e){if(!It(e))return(function(o){var s=[];if(o!=null)for(var a in Object(o))s.push(a);return s})(e);var n=$e(e),r=[];for(var i in e)(i!="constructor"||!n&&pa.call(e,i))&&r.push(i);return r})(t)}var ma=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ea=/^\w*$/;function ur(t,e){if(B(t))return!1;var n=typeof t;return!(n!="number"&&n!="symbol"&&n!="boolean"&&t!=null&&!Tn(t))||Ea.test(t)||!ma.test(t)||e!=null&&t in Object(e)}var Ie=oe(Object,"create"),ga=Object.prototype.hasOwnProperty,Ta=Object.prototype.hasOwnProperty;function ee(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Ge(t,e){for(var n=t.length;n--;)if(Be(t[n][0],e))return n;return-1}ee.prototype.clear=function(){this.__data__=Ie?Ie(null):{},this.size=0},ee.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},ee.prototype.get=function(t){var e=this.__data__;if(Ie){var n=e[t];return n==="__lodash_hash_undefined__"?void 0:n}return ga.call(e,t)?e[t]:void 0},ee.prototype.has=function(t){var e=this.__data__;return Ie?e[t]!==void 0:Ta.call(e,t)},ee.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Ie&&e===void 0?"__lodash_hash_undefined__":e,this};var Aa=Array.prototype.splice;function zt(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}zt.prototype.clear=function(){this.__data__=[],this.size=0},zt.prototype.delete=function(t){var e=this.__data__,n=Ge(e,t);return!(n<0||(n==e.length-1?e.pop():Aa.call(e,n,1),--this.size,0))},zt.prototype.get=function(t){var e=this.__data__,n=Ge(e,t);return n<0?void 0:e[n][1]},zt.prototype.has=function(t){return Ge(this.__data__,t)>-1},zt.prototype.set=function(t,e){var n=this.__data__,r=Ge(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this};var we=oe(Pt,"Map");function Ke(t,e){var n,r,i=t.__data__;return((r=typeof(n=e))=="string"||r=="number"||r=="symbol"||r=="boolean"?n!=="__proto__":n===null)?i[typeof e=="string"?"string":"hash"]:i.map}function Wt(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Mr(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError("Expected a function");var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=t.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(Mr.Cache||Wt),n}Wt.prototype.clear=function(){this.size=0,this.__data__={hash:new ee,map:new(we||zt),string:new ee}},Wt.prototype.delete=function(t){var e=Ke(this,t).delete(t);return this.size-=e?1:0,e},Wt.prototype.get=function(t){return Ke(this,t).get(t)},Wt.prototype.has=function(t){return Ke(this,t).has(t)},Wt.prototype.set=function(t,e){var n=Ke(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Mr.Cache=Wt;var Fn,Dn,Ia=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Na=/\\(\\)?/g,ya=(Fn=Mr(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(Ia,function(n,r,i,o){e.push(i?o.replace(Na,"$1"):r||n)}),e},function(t){return Dn.size===500&&Dn.clear(),t}),Dn=Fn.cache,Fn);function On(t,e){return B(t)?t:ur(t,e)?[t]:ya((function(n){return n==null?"":ko(n)})(t))}function Me(t){if(typeof t=="string"||Tn(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function lr(t,e){for(var n=0,r=(e=On(e,t)).length;t!=null&&n<r;)t=t[Me(e[n++])];return n&&n==r?t:void 0}function Ur(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var ri=At?At.isConcatSpreadable:void 0;function Ra(t){return B(t)||Rn(t)||!!(ri&&t&&t[ri])}function Fr(t,e,n,r,i){var o=-1,s=t.length;for(n||(n=Ra),i||(i=[]);++o<s;){var a=t[o];n(a)?Ur(i,a):r||(i[i.length]=a)}return i}function yt(t){return t!=null&&t.length?Fr(t):[]}var Go=Bo(Object.getPrototypeOf,Object);function Ko(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),(n=n>i?i:n)<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var o=Array(i);++r<i;)o[r]=t[r+e];return o}function va(t,e,n,r){var i=-1,o=t==null?0:t.length;for(r&&o&&(n=t[++i]);++i<o;)n=e(n,t[i],i,t);return n}function kt(t){var e=this.__data__=new zt(t);this.size=e.size}kt.prototype.clear=function(){this.__data__=new zt,this.size=0},kt.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},kt.prototype.get=function(t){return this.__data__.get(t)},kt.prototype.has=function(t){return this.__data__.has(t)},kt.prototype.set=function(t,e){var n=this.__data__;if(n instanceof zt){var r=n.__data__;if(!we||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Wt(r)}return n.set(t,e),this.size=n.size,this};var zo=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ii=zo&&typeof module=="object"&&module&&!module.nodeType&&module,oi=ii&&ii.exports===zo?Pt.Buffer:void 0,si=oi?oi.allocUnsafe:void 0;function Dr(t,e){for(var n=-1,r=t==null?0:t.length,i=0,o=[];++n<r;){var s=t[n];e(s,n,t)&&(o[i++]=s)}return o}function Vo(){return[]}var Oa=Object.prototype.propertyIsEnumerable,ai=Object.getOwnPropertySymbols,jr=ai?function(t){return t==null?[]:(t=Object(t),Dr(ai(t),function(e){return Oa.call(t,e)}))}:Vo,Sa=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)Ur(e,jr(t)),t=Go(t);return e}:Vo;function Ho(t,e,n){var r=e(t);return B(t)?r:Ur(r,n(t))}function hr(t){return Ho(t,Nt,jr)}var fr=oe(Pt,"DataView"),dr=oe(Pt,"Promise"),he=oe(Pt,"Set"),ci="[object Map]",ui="[object Promise]",li="[object Set]",hi="[object WeakMap]",fi="[object DataView]",_a=ie(fr),La=ie(we),xa=ie(dr),Ca=ie(he),ka=ie(ar),Tt=Zt;(fr&&Tt(new fr(new ArrayBuffer(1)))!=fi||we&&Tt(new we)!=ci||dr&&Tt(dr.resolve())!=ui||he&&Tt(new he)!=li||ar&&Tt(new ar)!=hi)&&(Tt=function(t){var e=Zt(t),n=e=="[object Object]"?t.constructor:void 0,r=n?ie(n):"";if(r)switch(r){case _a:return fi;case La:return ci;case xa:return ui;case Ca:return li;case ka:return hi}return e});var ba=Object.prototype.hasOwnProperty,cn=Pt.Uint8Array,Pa=/\w*$/,di=At?At.prototype:void 0,pi=di?di.valueOf:void 0,mi=Xt&&Xt.isMap,wa=mi?vn(mi):function(t){return vt(t)&&Tt(t)=="[object Map]"},Ei=Xt&&Xt.isSet,Ma=Ei?vn(Ei):function(t){return vt(t)&&Tt(t)=="[object Set]"},Yo="[object Arguments]",Xo="[object Function]",qo="[object Object]",G={};function Qe(t,e,n,r,i,o){var s;if(s!==void 0)return s;if(!It(t))return t;var a,c,u,l=B(t);if(l)return c=(a=t).length,u=new a.constructor(c),c&&typeof a[0]=="string"&&ba.call(a,"index")&&(u.index=a.index,u.input=a.input),(function(m,y){var p=-1,T=m.length;for(y||(y=Array(T));++p<T;)y[p]=m[p];return y})(t,s=u);var h=Tt(t),N=h==Xo||h=="[object GeneratorFunction]";if(Pe(t))return(function(m){var y=m.length,p=si?si(y):new m.constructor(y);return m.copy(p),p})(t);if(h==qo||h==Yo||N&&!i)return s=N?{}:(function(m){return typeof m.constructor!="function"||$e(m)?{}:ta(Go(m))})(t),(function(m,y){return cr(m,jr(m),y)})(t,(function(m,y){return m&&cr(y,Nt(y),m)})(s,t));if(!G[h])return i?t:{};s=(function(m,y){var p,T,g,A,v,f,d,I=m.constructor;switch(y){case"[object ArrayBuffer]":return v=new(A=m).constructor(A.byteLength),new cn(v).set(new cn(A)),v;case"[object Boolean]":case"[object Date]":return new I(+m);case"[object DataView]":return g=(T=m).buffer,new T.constructor(g,T.byteOffset,T.byteLength);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return d=(f=m).buffer,new f.constructor(d,f.byteOffset,f.length);case"[object Map]":case"[object Set]":return new I;case"[object Number]":case"[object String]":return new I(m);case"[object RegExp]":return(function(E){var R=new E.constructor(E.source,Pa.exec(E));return R.lastIndex=E.lastIndex,R})(m);case"[object Symbol]":return p=m,pi?Object(pi.call(p)):{}}})(t,h),o||(o=new kt);var S=o.get(t);if(S)return S;o.set(t,s),Ma(t)?t.forEach(function(m){s.add(Qe(m,e,n,m,t,o))}):wa(t)&&t.forEach(function(m,y){s.set(y,Qe(m,e,n,y,t,o))});var L=l?void 0:hr(t);return bo(L||t,function(m,y){L&&(m=t[y=m]),yn(s,y,Qe(m,e,n,y,t,o))}),s}function et(t){return Qe(t,4)}function Ue(t){for(var e=-1,n=t==null?0:t.length,r=0,i=[];++e<n;){var o=t[e];o&&(i[r++]=o)}return i}function fe(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new Wt;++e<n;)this.add(t[e])}function Zo(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function Br(t,e){return t.has(e)}function gi(t,e,n,r,i,o){var s=1&n,a=t.length,c=e.length;if(a!=c&&!(s&&c>a))return!1;var u=o.get(t),l=o.get(e);if(u&&l)return u==e&&l==t;var h=-1,N=!0,S=2&n?new fe:void 0;for(o.set(t,e),o.set(e,t);++h<a;){var L=t[h],m=e[h];if(r)var y=s?r(m,L,h,e,t,o):r(L,m,h,t,e,o);if(y!==void 0){if(y)continue;N=!1;break}if(S){if(!Zo(e,function(p,T){if(!Br(S,T)&&(L===p||i(L,p,n,r,o)))return S.push(T)})){N=!1;break}}else if(L!==m&&!i(L,m,n,r,o)){N=!1;break}}return o.delete(t),o.delete(e),N}function Ua(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}function $r(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}G[Yo]=G["[object Array]"]=G["[object ArrayBuffer]"]=G["[object DataView]"]=G["[object Boolean]"]=G["[object Date]"]=G["[object Float32Array]"]=G["[object Float64Array]"]=G["[object Int8Array]"]=G["[object Int16Array]"]=G["[object Int32Array]"]=G["[object Map]"]=G["[object Number]"]=G[qo]=G["[object RegExp]"]=G["[object Set]"]=G["[object String]"]=G["[object Symbol]"]=G["[object Uint8Array]"]=G["[object Uint8ClampedArray]"]=G["[object Uint16Array]"]=G["[object Uint32Array]"]=!0,G["[object Error]"]=G[Xo]=G["[object WeakMap]"]=!1,fe.prototype.add=fe.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},fe.prototype.has=function(t){return this.__data__.has(t)};var Ti=At?At.prototype:void 0,jn=Ti?Ti.valueOf:void 0,Fa=Object.prototype.hasOwnProperty,Ai="[object Arguments]",Ii="[object Array]",ze="[object Object]",Ni=Object.prototype.hasOwnProperty;function pr(t,e,n,r,i){return t===e||(t==null||e==null||!vt(t)&&!vt(e)?t!=t&&e!=e:(function(o,s,a,c,u,l){var h=B(o),N=B(s),S=h?Ii:Tt(o),L=N?Ii:Tt(s),m=(S=S==Ai?ze:S)==ze,y=(L=L==Ai?ze:L)==ze,p=S==L;if(p&&Pe(o)){if(!Pe(s))return!1;h=!0,m=!1}if(p&&!m)return l||(l=new kt),h||wr(o)?gi(o,s,a,c,u,l):(function(f,d,I,E,R,U,x){switch(I){case"[object DataView]":if(f.byteLength!=d.byteLength||f.byteOffset!=d.byteOffset)return!1;f=f.buffer,d=d.buffer;case"[object ArrayBuffer]":return!(f.byteLength!=d.byteLength||!U(new cn(f),new cn(d)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Be(+f,+d);case"[object Error]":return f.name==d.name&&f.message==d.message;case"[object RegExp]":case"[object String]":return f==d+"";case"[object Map]":var O=Ua;case"[object Set]":var w=1&E;if(O||(O=$r),f.size!=d.size&&!w)return!1;var C=x.get(f);if(C)return C==d;E|=2,x.set(f,d);var k=gi(O(f),O(d),E,R,U,x);return x.delete(f),k;case"[object Symbol]":if(jn)return jn.call(f)==jn.call(d)}return!1})(o,s,S,a,c,u,l);if(!(1&a)){var T=m&&Ni.call(o,"__wrapped__"),g=y&&Ni.call(s,"__wrapped__");if(T||g){var A=T?o.value():o,v=g?s.value():s;return l||(l=new kt),u(A,v,a,c,l)}}return!!p&&(l||(l=new kt),(function(f,d,I,E,R,U){var x=1&I,O=hr(f),w=O.length;if(w!=hr(d).length&&!x)return!1;for(var C=w;C--;){var k=O[C];if(!(x?k in d:Fa.call(d,k)))return!1}var $=U.get(f),X=U.get(d);if($&&X)return $==d&&X==f;var W=!0;U.set(f,d),U.set(d,f);for(var rt=x;++C<w;){var mt=f[k=O[C]],xt=d[k];if(E)var Te=x?E(xt,mt,k,d,f,U):E(mt,xt,k,f,d,U);if(!(Te===void 0?mt===xt||R(mt,xt,I,E,U):Te)){W=!1;break}rt||(rt=k=="constructor")}if(W&&!rt){var nt=f.constructor,Qt=d.constructor;nt==Qt||!("constructor"in f)||!("constructor"in d)||typeof nt=="function"&&nt instanceof nt&&typeof Qt=="function"&&Qt instanceof Qt||(W=!1)}return U.delete(f),U.delete(d),W})(o,s,a,c,u,l))})(t,e,n,r,pr,i))}function yi(t){return t==t&&!It(t)}function Ri(t,e){return function(n){return n!=null&&n[t]===e&&(e!==void 0||t in Object(n))}}function Da(t,e){return t!=null&&e in Object(t)}function Qo(t,e,n){for(var r=-1,i=(e=On(e,t)).length,o=!1;++r<i;){var s=Me(e[r]);if(!(o=t!=null&&n(t,s)))break;t=t[s]}return o||++r!=i?o:!!(i=t==null?0:t.length)&&Pr(i)&&Nn(s,i)&&(B(t)||Rn(t))}function bt(t){return typeof t=="function"?t:t==null?de:typeof t=="object"?B(t)?(function(e,n){return ur(e)&&yi(n)?Ri(Me(e),n):function(r){var i,o,s=(o=(i=r)==null?void 0:lr(i,e))===void 0?void 0:o;return s===void 0&&s===n?(function(a,c){return a!=null&&Qo(a,c,Da)})(r,e):pr(n,s,3)}})(t[0],t[1]):(function(e){var n=(function(r){for(var i=Nt(r),o=i.length;o--;){var s=i[o],a=r[s];i[o]=[s,a,yi(a)]}return i})(e);return n.length==1&&n[0][2]?Ri(n[0][0],n[0][1]):function(r){return r===e||(function(i,o,s){var a=s.length,c=a;if(i==null)return!c;for(i=Object(i);a--;){var u=s[a];if(u[2]?u[1]!==i[u[0]]:!(u[0]in i))return!1}for(;++a<c;){var l=(u=s[a])[0],h=i[l],N=u[1];if(u[2]){if(h===void 0&&!(l in i))return!1}else if(!pr(N,h,3,void 0,new kt))return!1}return!0})(r,0,n)}})(t):(function(e){return ur(e)?(n=Me(e),function(r){return r?.[n]}):(function(r){return function(i){return lr(i,r)}})(e);var n})(t)}function ja(t,e,n,r){for(var i=-1,o=t==null?0:t.length;++i<o;){var s=t[i];e(r,s,n(s),t)}return r}var vi,se=(vi=function(t,e){return t&&(function(n,r,i){for(var o=-1,s=Object(n),a=i(n),c=a.length;c--;){var u=a[++o];if(r(s[u],u,s)===!1)break}return n})(t,e,Nt)},function(t,e){if(t==null)return t;if(!wt(t))return vi(t,e);for(var n=t.length,r=-1,i=Object(t);++r<n&&e(i[r],r,i)!==!1;);return t});function Ba(t,e,n,r){return se(t,function(i,o,s){e(r,i,n(i),s)}),r}var Jo=Object.prototype,$a=Jo.hasOwnProperty,mr=br(function(t,e){t=Object(t);var n=-1,r=e.length,i=r>2?e[2]:void 0;for(i&&Mo(e[0],e[1],i)&&(r=1);++n<r;)for(var o=e[n],s=Wo(o),a=-1,c=s.length;++a<c;){var u=s[a],l=t[u];(l===void 0||Be(l,Jo[u])&&!$a.call(t,u))&&(t[u]=o[u])}return t});function Oi(t){return vt(t)&&wt(t)}var un=br(function(t,e){return Oi(t)?(function(n,r){var i=-1,o=wo,s=!0,a=n.length,c=[],u=r.length;if(!a)return c;r.length>=200&&(o=Br,s=!1,r=new fe(r));t:for(;++i<a;){var l=n[i],h=l;if(l=l!==0?l:0,s&&h==h){for(var N=u;N--;)if(r[N]===h)continue t;c.push(l)}else o(r,h,void 0)||c.push(l)}return c})(t,Fr(e,0,Oi,!0)):[]});function pe(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}function tt(t,e,n){var r=t==null?0:t.length;return r?Ko(t,(e=e===void 0?1:In(e))<0?0:e,r):[]}function Fe(t,e,n){var r=t==null?0:t.length;return r?Ko(t,0,(e=r-(e=e===void 0?1:In(e)))<0?0:e):[]}function M(t,e){var n;return(B(t)?bo:se)(t,typeof(n=e)=="function"?n:de)}function Wa(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function Ga(t,e){var n=!0;return se(t,function(r,i,o){return n=!!e(r,i,o)}),n}function Rt(t,e,n){return(B(t)?Wa:Ga)(t,bt(e))}function ts(t,e){var n=[];return se(t,function(r,i,o){e(r,i,o)&&n.push(r)}),n}function Et(t,e){return(B(t)?Dr:ts)(t,bt(e))}var Si,Ka=Math.max,me=(Si=function(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=n==null?0:In(n);return i<0&&(i=Ka(r+i,0)),Po(t,bt(e),i)},function(t,e,n){var r=Object(t);if(!wt(t)){var i=bt(e);t=Nt(t),e=function(s){return i(r[s],s,r)}}var o=Si(t,e,n);return o>-1?r[i?t[o]:o]:void 0});function Ot(t){return t&&t.length?t[0]:void 0}function za(t,e){var n=-1,r=wt(t)?Array(t.length):[];return se(t,function(i,o,s){r[++n]=e(i,o,s)}),r}function b(t,e){return(B(t)?An:za)(t,bt(e))}function gt(t,e){return Fr(b(t,e))}var _i,Va=Object.prototype.hasOwnProperty,Ha=(_i=function(t,e,n){Va.call(t,n)?t[n].push(e):kr(t,n,[e])},function(t,e){return(B(t)?ja:Ba)(t,_i,bt(e),{})}),Ya=Object.prototype.hasOwnProperty;function Xa(t,e){return t!=null&&Ya.call(t,e)}function P(t,e){return t!=null&&Qo(t,e,Xa)}function ut(t){return typeof t=="string"||!B(t)&&vt(t)&&Zt(t)=="[object String]"}function Q(t){return t==null?[]:(function(e,n){return An(n,function(r){return e[r]})})(t,Nt(t))}var qa=Math.max;function at(t,e,n,r){t=wt(t)?t:Q(t),n=n?In(n):0;var i=t.length;return n<0&&(n=qa(i+n,0)),ut(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&Cr(t,e,n)>-1}function Li(t,e,n){return t!=null&&t.length?Cr(t,e,0):-1}var Za=Object.prototype.hasOwnProperty;function K(t){if(t==null)return!0;if(wt(t)&&(B(t)||typeof t=="string"||typeof t.splice=="function"||Pe(t)||wr(t)||Rn(t)))return!t.length;var e=Tt(t);if(e=="[object Map]"||e=="[object Set]")return!t.size;if($e(t))return!$o(t).length;for(var n in t)if(Za.call(t,n))return!1;return!0}var xi=Xt&&Xt.isRegExp,Gt=xi?vn(xi):function(t){return vt(t)&&Zt(t)=="[object RegExp]"};function Vt(t){return t===void 0}function Qa(t,e,n,r){if(!It(t))return t;for(var i=-1,o=(e=On(e,t)).length,s=o-1,a=t;a!=null&&++i<o;){var c=Me(e[i]),u=n;if(c==="__proto__"||c==="constructor"||c==="prototype")return t;if(i!=s){var l=a[c];(u=void 0)==null&&(u=It(l)?l:Nn(e[i+1])?[]:{})}yn(a,c,u),a=a[c]}return t}function St(t,e){if(t==null)return{};var n=An(Ho(t,Wo,Sa),function(r){return[r]});return e=bt(e),(function(r,i,o){for(var s=-1,a=i.length,c={};++s<a;){var u=i[s],l=lr(r,u);o(l,u)&&Qa(c,On(u,r),l)}return c})(t,n,function(r,i){return e(r,i[0])})}function Ja(t,e,n,r,i){return i(t,function(o,s,a){n=r?(r=!1,o):e(n,o,s,a)}),n}function ft(t,e,n){var r=B(t)?va:Ja,i=arguments.length<3;return r(t,bt(e),n,i,se)}function Je(t,e){return(B(t)?Dr:ts)(t,(function(n){if(typeof n!="function")throw new TypeError("Expected a function");return function(){var r=arguments;switch(r.length){case 0:return!n.call(this);case 1:return!n.call(this,r[0]);case 2:return!n.call(this,r[0],r[1]);case 3:return!n.call(this,r[0],r[1],r[2])}return!n.apply(this,r)}})(bt(e)))}function tc(t,e){var n;return se(t,function(r,i,o){return!(n=e(r,i,o))}),!!n}function es(t,e,n){return(B(t)?Zo:tc)(t,bt(e))}var ec=he&&1/$r(new he([,-0]))[1]==1/0?function(t){return new he(t)}:Z;function Er(t){return t&&t.length?(function(e){var n=-1,r=wo,i=e.length,o=!0,s=[],a=s;if(i>=200){var c=ec(e);if(c)return $r(c);o=!1,r=Br,a=new fe}else a=s;t:for(;++n<i;){var u=e[n],l=u;if(u=u!==0?u:0,o&&l==l){for(var h=a.length;h--;)if(a[h]===l)continue t;s.push(u)}else r(a,l,void 0)||(a!==s&&a.push(l),s.push(u))}return s})(t):[]}function gr(t){console&&console.error&&console.error(`Error: ${t}`)}function ns(t){console&&console.warn&&console.warn(`Warning: ${t}`)}function rs(t){const e=new Date().getTime(),n=t();return{time:new Date().getTime()-e,value:n}}function is(t){function e(){}e.prototype=t;const n=new e;function r(){return typeof n.bar}return r(),r(),t}function nc(t){return ut((e=t).LABEL)&&e.LABEL!==""?t.LABEL:t.name;var e}class Mt{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),M(this.definition,n=>{n.accept(e)})}}class pt extends Mt{constructor(e){super([]),this.idx=1,dt(this,St(e,n=>n!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class Ee extends Mt{constructor(e){super(e.definition),this.orgText="",dt(this,St(e,n=>n!==void 0))}}class ht extends Mt{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,dt(this,St(e,n=>n!==void 0))}}class lt extends Mt{constructor(e){super(e.definition),this.idx=1,dt(this,St(e,n=>n!==void 0))}}class Ut extends Mt{constructor(e){super(e.definition),this.idx=1,dt(this,St(e,n=>n!==void 0))}}class Ft extends Mt{constructor(e){super(e.definition),this.idx=1,dt(this,St(e,n=>n!==void 0))}}class J extends Mt{constructor(e){super(e.definition),this.idx=1,dt(this,St(e,n=>n!==void 0))}}class _t extends Mt{constructor(e){super(e.definition),this.idx=1,dt(this,St(e,n=>n!==void 0))}}class Lt extends Mt{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,dt(this,St(e,n=>n!==void 0))}}class V{constructor(e){this.idx=1,dt(this,St(e,n=>n!==void 0))}accept(e){e.visit(this)}}function tn(t){function e(n){return b(n,tn)}if(t instanceof pt){const n={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return ut(t.label)&&(n.label=t.label),n}if(t instanceof ht)return{type:"Alternative",definition:e(t.definition)};if(t instanceof lt)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof Ut)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof Ft)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:tn(new V({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof _t)return{type:"RepetitionWithSeparator",idx:t.idx,separator:tn(new V({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof J)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof Lt)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof V){const n={type:"Terminal",name:t.terminalType.name,label:nc(t.terminalType),idx:t.idx};ut(t.label)&&(n.terminalLabel=t.label);const r=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(n.pattern=Gt(r)?r.source:r),n}if(t instanceof Ee)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}class ge{visit(e){const n=e;switch(n.constructor){case pt:return this.visitNonTerminal(n);case ht:return this.visitAlternative(n);case lt:return this.visitOption(n);case Ut:return this.visitRepetitionMandatory(n);case Ft:return this.visitRepetitionMandatoryWithSeparator(n);case _t:return this.visitRepetitionWithSeparator(n);case J:return this.visitRepetition(n);case Lt:return this.visitAlternation(n);case V:return this.visitTerminal(n);case Ee:return this.visitRule(n);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}}function ln(t,e=[]){return t instanceof lt||t instanceof J||t instanceof _t||(t instanceof Lt?es(t.definition,n=>ln(n,e)):!(t instanceof pt&&at(e,t))&&t instanceof Mt&&(t instanceof pt&&e.push(t),Rt(t.definition,n=>ln(n,e))))}function Ct(t){if(t instanceof pt)return"SUBRULE";if(t instanceof lt)return"OPTION";if(t instanceof Lt)return"OR";if(t instanceof Ut)return"AT_LEAST_ONE";if(t instanceof Ft)return"AT_LEAST_ONE_SEP";if(t instanceof _t)return"MANY_SEP";if(t instanceof J)return"MANY";if(t instanceof V)return"CONSUME";throw Error("non exhaustive match")}class Sn{walk(e,n=[]){M(e.definition,(r,i)=>{const o=tt(e.definition,i+1);if(r instanceof pt)this.walkProdRef(r,o,n);else if(r instanceof V)this.walkTerminal(r,o,n);else if(r instanceof ht)this.walkFlat(r,o,n);else if(r instanceof lt)this.walkOption(r,o,n);else if(r instanceof Ut)this.walkAtLeastOne(r,o,n);else if(r instanceof Ft)this.walkAtLeastOneSep(r,o,n);else if(r instanceof _t)this.walkManySep(r,o,n);else if(r instanceof J)this.walkMany(r,o,n);else{if(!(r instanceof Lt))throw Error("non exhaustive match");this.walkOr(r,o,n)}})}walkTerminal(e,n,r){}walkProdRef(e,n,r){}walkFlat(e,n,r){const i=n.concat(r);this.walk(e,i)}walkOption(e,n,r){const i=n.concat(r);this.walk(e,i)}walkAtLeastOne(e,n,r){const i=[new lt({definition:e.definition})].concat(n,r);this.walk(e,i)}walkAtLeastOneSep(e,n,r){const i=Ci(e,n,r);this.walk(e,i)}walkMany(e,n,r){const i=[new lt({definition:e.definition})].concat(n,r);this.walk(e,i)}walkManySep(e,n,r){const i=Ci(e,n,r);this.walk(e,i)}walkOr(e,n,r){const i=n.concat(r);M(e.definition,o=>{const s=new ht({definition:[o]});this.walk(s,i)})}}function Ci(t,e,n){return[new lt({definition:[new V({terminalType:t.separator})].concat(t.definition)})].concat(e,n)}function xe(t){if(t instanceof pt)return xe(t.referencedRule);if(t instanceof V)return[t.terminalType];if((function(e){return e instanceof ht||e instanceof lt||e instanceof J||e instanceof Ut||e instanceof Ft||e instanceof _t||e instanceof V||e instanceof Ee})(t))return(function(e){let n=[];const r=e.definition;let i,o=0,s=r.length>o,a=!0;for(;s&&a;)i=r[o],a=ln(i),n=n.concat(xe(i)),o+=1,s=r.length>o;return Er(n)})(t);if((function(e){return e instanceof Lt})(t))return(function(e){return Er(yt(b(e.definition,n=>xe(n))))})(t);throw Error("non exhaustive match")}const os="_~IN~_";class rc extends Sn{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,n,r){}walkProdRef(e,n,r){const i=(o=e.referencedRule,s=e.idx,o.name+s+os+this.topProd.name);var o,s;const a=n.concat(r),c=xe(new ht({definition:a}));this.follows[i]=c}}function F(t){return t.charCodeAt(0)}function Bn(t,e){Array.isArray(t)?t.forEach(function(n){e.push(n)}):e.push(t)}function Ne(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}function ae(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function ki(t){return t.type==="Character"}const hn=[];for(let t=F("0");t<=F("9");t++)hn.push(t);const fn=[F("_")].concat(hn);for(let t=F("a");t<=F("z");t++)fn.push(t);for(let t=F("A");t<=F("Z");t++)fn.push(t);const bi=[F(" "),F("\f"),F(`
`),F("\r"),F(" "),F("\v"),F(" "),F(" "),F(" "),F(" "),F(" "),F(" "),F(" "),F(" "),F(" "),F(" "),F(" "),F(" "),F(" "),F(" "),F("\u2028"),F("\u2029"),F(" "),F(" "),F(" "),F("\uFEFF")],ic=/[0-9a-fA-F]/,Ve=/[0-9]/,oc=/[1-9]/;class Tr{visitChildren(e){for(const n in e){const r=e[n];e.hasOwnProperty(n)&&(r.type!==void 0?this.visit(r):Array.isArray(r)&&r.forEach(i=>{this.visit(i)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e)}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}}let en={};const sc=new class{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(t){this.idx=t.idx,this.input=t.input,this.groupIdx=t.groupIdx}pattern(t){this.idx=0,this.input=t,this.groupIdx=0,this.consumeChar("/");const e=this.disjunction();this.consumeChar("/");const n={type:"Flags",loc:{begin:this.idx,end:t.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":Ne(n,"global");break;case"i":Ne(n,"ignoreCase");break;case"m":Ne(n,"multiLine");break;case"u":Ne(n,"unicode");break;case"y":Ne(n,"sticky")}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:e,loc:this.loc(0)}}disjunction(){const t=[],e=this.idx;for(t.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),t.push(this.alternative());return{type:"Disjunction",value:t,loc:this.loc(e)}}alternative(){const t=[],e=this.idx;for(;this.isTerm();)t.push(this.term());return{type:"Alternative",value:t,loc:this.loc(e)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const t=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(t)};case"$":return{type:"EndAnchor",loc:this.loc(t)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(t)};case"B":return{type:"NonWordBoundary",loc:this.loc(t)}}throw Error("Invalid Assertion Escape");case"(":let e;switch(this.consumeChar("?"),this.popChar()){case"=":e="Lookahead";break;case"!":e="NegativeLookahead"}ae(e);const n=this.disjunction();return this.consumeChar(")"),{type:e,value:n,loc:this.loc(t)}}return(function(){throw Error("Internal Error - Should never get here!")})()}quantifier(t=!1){let e;const n=this.idx;switch(this.popChar()){case"*":e={atLeast:0,atMost:1/0};break;case"+":e={atLeast:1,atMost:1/0};break;case"?":e={atLeast:0,atMost:1};break;case"{":const r=this.integerIncludingZero();switch(this.popChar()){case"}":e={atLeast:r,atMost:r};break;case",":let i;this.isDigit()?(i=this.integerIncludingZero(),e={atLeast:r,atMost:i}):e={atLeast:r,atMost:1/0},this.consumeChar("}")}if(t===!0&&e===void 0)return;ae(e)}if(t!==!0||e!==void 0)return ae(e)?(this.peekChar(0)==="?"?(this.consumeChar("?"),e.greedy=!1):e.greedy=!0,e.type="Quantifier",e.loc=this.loc(n),e):void 0}atom(){let t;const e=this.idx;switch(this.peekChar()){case".":t=this.dotAll();break;case"\\":t=this.atomEscape();break;case"[":t=this.characterClass();break;case"(":t=this.group()}if(t===void 0&&this.isPatternCharacter()&&(t=this.patternCharacter()),ae(t))return t.loc=this.loc(e),this.isQuantifier()&&(t.quantifier=this.quantifier()),t}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[F(`
`),F("\r"),F("\u2028"),F("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let t,e=!1;switch(this.popChar()){case"d":t=hn;break;case"D":t=hn,e=!0;break;case"s":t=bi;break;case"S":t=bi,e=!0;break;case"w":t=fn;break;case"W":t=fn,e=!0}if(ae(t))return{type:"Set",value:t,complement:e}}controlEscapeAtom(){let t;switch(this.popChar()){case"f":t=F("\f");break;case"n":t=F(`
`);break;case"r":t=F("\r");break;case"t":t=F(" ");break;case"v":t=F("\v")}if(ae(t))return{type:"Character",value:t}}controlLetterEscapeAtom(){this.consumeChar("c");const t=this.popChar();if(/[a-zA-Z]/.test(t)===!1)throw Error("Invalid ");return{type:"Character",value:t.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:F("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){return{type:"Character",value:F(this.popChar())}}classPatternCharacterAtom(){switch(this.peekChar()){case`
`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:return{type:"Character",value:F(this.popChar())}}}characterClass(){const t=[];let e=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),e=!0);this.isClassAtom();){const n=this.classAtom();if(n.type,ki(n)&&this.isRangeDash()){this.consumeChar("-");const r=this.classAtom();if(r.type,ki(r)){if(r.value<n.value)throw Error("Range out of order in character class");t.push({from:n.value,to:r.value})}else Bn(n.value,t),t.push(F("-")),Bn(r.value,t)}else Bn(n.value,t)}return this.consumeChar("]"),{type:"Set",complement:e,value:t}}classAtom(){switch(this.peekChar()){case"]":case`
`:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:F("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}group(){let t=!0;this.consumeChar("("),this.peekChar(0)==="?"?(this.consumeChar("?"),this.consumeChar(":"),t=!1):this.groupIdx++;const e=this.disjunction();this.consumeChar(")");const n={type:"Group",capturing:t,value:e};return t&&(n.idx=this.groupIdx),n}positiveInteger(){let t=this.popChar();if(oc.test(t)===!1)throw Error("Expecting a positive integer");for(;Ve.test(this.peekChar(0));)t+=this.popChar();return parseInt(t,10)}integerIncludingZero(){let t=this.popChar();if(Ve.test(t)===!1)throw Error("Expecting an integer");for(;Ve.test(this.peekChar(0));)t+=this.popChar();return parseInt(t,10)}patternCharacter(){const t=this.popChar();switch(t){case`
`:case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:F(t)}}}isRegExpFlag(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}}isRangeDash(){return this.peekChar()==="-"&&this.isClassAtom(1)}isDigit(){return Ve.test(this.peekChar(0))}isClassAtom(t=0){switch(this.peekChar(t)){case"]":case`
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}isTerm(){return this.isAtom()||this.isAssertion()}isAtom(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}}isAssertion(){switch(this.peekChar(0)){case"^":case"$":return!0;case"\\":switch(this.peekChar(1)){case"b":case"B":return!0;default:return!1}case"(":return this.peekChar(1)==="?"&&(this.peekChar(2)==="="||this.peekChar(2)==="!");default:return!1}}isQuantifier(){const t=this.saveState();try{return this.quantifier(!0)!==void 0}catch{return!1}finally{this.restoreState(t)}}isPatternCharacter(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case`
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(t){let e="";for(let n=0;n<t;n++){const r=this.popChar();if(ic.test(r)===!1)throw Error("Expecting a HexDecimal digits");e+=r}return{type:"Character",value:parseInt(e,16)}}peekChar(t=0){return this.input[this.idx+t]}popChar(){const t=this.peekChar(0);return this.consumeChar(void 0),t}consumeChar(t){if(t!==void 0&&this.input[this.idx]!==t)throw Error("Expected: '"+t+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(t){return{begin:t,end:this.idx}}};function dn(t){const e=t.toString();if(en.hasOwnProperty(e))return en[e];{const n=sc.pattern(e);return en[e]=n,n}}const ss="Complement Sets are not supported for first char optimization",pn=`Unable to use "first char" lexer optimizations:
`;function ac(t,e=!1){try{const n=dn(t);return Ar(n.value,{},n.flags.ignoreCase)}catch(n){if(n.message===ss)e&&ns(`${pn} Unable to optimize: < ${t.toString()} >
Complement Sets cannot be automatically optimized.
This will disable the lexer's first char optimizations.
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let r="";e&&(r=`
This will disable the lexer's first char optimizations.
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),gr(`${pn}
Failed parsing: < ${t.toString()} >
Using the @chevrotain/regexp-to-ast library
Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+r)}}return[]}function Ar(t,e,n){switch(t.type){case"Disjunction":for(let i=0;i<t.value.length;i++)Ar(t.value[i],e,n);break;case"Alternative":const r=t.value;for(let i=0;i<r.length;i++){const o=r[i];switch(o.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}const s=o;switch(s.type){case"Character":He(s.value,e,n);break;case"Set":if(s.complement===!0)throw Error(ss);M(s.value,c=>{if(typeof c=="number")He(c,e,n);else{const u=c;if(n===!0)for(let l=u.from;l<=u.to;l++)He(l,e,n);else{for(let l=u.from;l<=u.to&&l<Oe;l++)He(l,e,n);if(u.to>=Oe){const l=u.from>=Oe?u.from:Oe,h=u.to,N=Yt(l),S=Yt(h);for(let L=N;L<=S;L++)e[L]=L}}}});break;case"Group":Ar(s.value,e,n);break;default:throw Error("Non Exhaustive Match")}const a=s.quantifier!==void 0&&s.quantifier.atLeast===0;if(s.type==="Group"&&Ir(s)===!1||s.type!=="Group"&&a===!1)break}break;default:throw Error("non exhaustive match!")}return Q(e)}function He(t,e,n){const r=Yt(t);e[r]=r,n===!0&&(function(i,o){const s=String.fromCharCode(i),a=s.toUpperCase();if(a!==s){const c=Yt(a.charCodeAt(0));o[c]=c}else{const c=s.toLowerCase();if(c!==s){const u=Yt(c.charCodeAt(0));o[u]=u}}})(t,e)}function Pi(t,e){return me(t.value,n=>{if(typeof n=="number")return at(e,n);{const r=n;return me(e,i=>r.from<=i&&i<=r.to)!==void 0}})}function Ir(t){const e=t.quantifier;return!(!e||e.atLeast!==0)||!!t.value&&(B(t.value)?Rt(t.value,Ir):Ir(t.value))}class cc extends Tr{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case"Lookahead":return void this.visitLookahead(e);case"NegativeLookahead":return void this.visitNegativeLookahead(e)}super.visitChildren(e)}}visitCharacter(e){at(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?Pi(e,this.targetCharCodes)===void 0&&(this.found=!0):Pi(e,this.targetCharCodes)!==void 0&&(this.found=!0)}}function Nr(t,e){if(e instanceof RegExp){const n=dn(e),r=new cc(t);return r.visit(n),r.found}return me(e,n=>at(t,n.charCodeAt(0)))!==void 0}const te="PATTERN",ye="defaultMode",$n="modes";let wi=typeof new RegExp("(?:)").sticky=="boolean";const uc=/[^\\][$]/,lc=/[^\\[][\^]|^\^/;function Mi(t){const e=t.ignoreCase?"i":"";return new RegExp(`^(?:${t.source})`,e)}function Ui(t){const e=t.ignoreCase?"iy":"y";return new RegExp(`${t.source}`,e)}function as(t){const e=t.PATTERN;if(Gt(e))return!1;if(Ht(e)||P(e,"exec"))return!0;if(ut(e))return!1;throw Error("non exhaustive match")}function hc(t){return!(!ut(t)||t.length!==1)&&t.charCodeAt(0)}const fc={test:function(t){const e=t.length;for(let n=this.lastIndex;n<e;n++){const r=t.charCodeAt(n);if(r===10)return this.lastIndex=n+1,!0;if(r===13)return t.charCodeAt(n+1)===10?this.lastIndex=n+2:this.lastIndex=n+1,!0}return!1},lastIndex:0};function Fi(t,e){if(P(t,"LINE_BREAKS"))return!1;if(Gt(t.PATTERN)){try{Nr(e,t.PATTERN)}catch(n){return{issue:H.IDENTIFY_TERMINATOR,errMsg:n.message}}return!1}if(ut(t.PATTERN))return!1;if(as(t))return{issue:H.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}function Di(t){return b(t,e=>ut(e)?e.charCodeAt(0):e)}function Wn(t,e,n){t[e]===void 0?t[e]=[n]:t[e].push(n)}const Oe=256;let nn=[];function Yt(t){return t<Oe?t:nn[t]}function Ce(t,e){const n=t.tokenTypeIdx;return n===e.tokenTypeIdx||e.isParent===!0&&e.categoryMatchesMap[n]===!0}function mn(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}let ji=1;const Bi={};function We(t){const e=(function(n){let r=et(n),i=n,o=!0;for(;o;){i=Ue(yt(b(i,a=>a.CATEGORIES)));const s=un(i,r);r=r.concat(s),K(s)?o=!1:i=s}return r})(t);(function(n){M(n,r=>{us(r)||(Bi[ji]=r,r.tokenTypeIdx=ji++),$i(r)&&!B(r.CATEGORIES)&&(r.CATEGORIES=[r.CATEGORIES]),$i(r)||(r.CATEGORIES=[]),P(r,"categoryMatches")||(r.categoryMatches=[]),P(r,"categoryMatchesMap")||(r.categoryMatchesMap={})})})(e),(function(n){M(n,r=>{cs([],r)})})(e),(function(n){M(n,r=>{r.categoryMatches=[],M(r.categoryMatchesMap,(i,o)=>{r.categoryMatches.push(Bi[o].tokenTypeIdx)})})})(e),M(e,n=>{n.isParent=n.categoryMatches.length>0})}function cs(t,e){M(t,n=>{e.categoryMatchesMap[n.tokenTypeIdx]=!0}),M(e.CATEGORIES,n=>{const r=t.concat(e);at(r,n)||cs(r,n)})}function us(t){return P(t,"tokenTypeIdx")}function $i(t){return P(t,"CATEGORIES")}function dc(t){return P(t,"tokenTypeIdx")}var H,j;(j=H||(H={}))[j.MISSING_PATTERN=0]="MISSING_PATTERN",j[j.INVALID_PATTERN=1]="INVALID_PATTERN",j[j.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",j[j.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",j[j.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",j[j.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",j[j.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",j[j.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",j[j.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",j[j.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",j[j.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",j[j.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",j[j.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",j[j.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",j[j.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",j[j.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",j[j.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",j[j.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE";const Se={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:{buildUnableToPopLexerModeMessage:t=>`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`,buildUnexpectedCharactersMessage:(t,e,n,r,i)=>`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${n} characters.`},traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(Se);class ot{constructor(e,n=Se){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(i,o)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;const s=new Array(this.trac