UNPKG

peggy

Version:

Parser generator for JavaScript

8 lines (7 loc) 118 kB
// peggy 5.0.6 // // https://peggyjs.org/ // // Copyright (c) 2025- the Peggy authors // Licensed under the MIT License. function _array_like_to_array(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _array_with_holes(e){if(Array.isArray(e))return e}function _array_without_holes(e){if(Array.isArray(e))return _array_like_to_array(e)}function _assert_this_initialized(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function _call_super(e,t,n){t=_get_prototype_of(t);return _possible_constructor_return(e,_is_native_reflect_construct()?Reflect.construct(t,n||[],_get_prototype_of(e).constructor):t.apply(e,n))}function _class_call_check(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function _construct(e,t,n){if(_is_native_reflect_construct()){_construct=Reflect.construct}else{_construct=function e(e,t,n){var r=[null];r.push.apply(r,t);var o=Function.bind.apply(e,r);var a=new o;if(n)_set_prototype_of(a,n.prototype);return a}}return _construct.apply(null,arguments)}function _defineProperties(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||false;r.configurable=true;if("value"in r)r.writable=true;Object.defineProperty(e,r.key,r)}}function _create_class(e,t,n){if(t)_defineProperties(e.prototype,t);if(n)_defineProperties(e,n);return e}function _define_property(e,t,n){if(t in e){Object.defineProperty(e,t,{value:n,enumerable:true,configurable:true,writable:true})}else{e[t]=n}return e}function _get(e,t,n){if(typeof Reflect!=="undefined"&&Reflect.get){_get=Reflect.get}else{_get=function e(e,t,n){var r=_super_prop_base(e,t);if(!r)return;var o=Object.getOwnPropertyDescriptor(r,t);if(o.get){return o.get.call(n||e)}return o.value}}return _get(e,t,n||e)}function _get_prototype_of(e){_get_prototype_of=Object.setPrototypeOf?Object.getPrototypeOf:function e(e){return e.__proto__||Object.getPrototypeOf(e)};return _get_prototype_of(e)}function _inherits(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:true,configurable:true}});if(t)_set_prototype_of(e,t)}function _instanceof(e,t){if(t!=null&&typeof Symbol!=="undefined"&&t[Symbol.hasInstance]){return!!t[Symbol.hasInstance](e)}else{return e instanceof t}}function _is_native_function(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function _iterable_to_array(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function _iterable_to_array_limit(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var o=true;var a=false;var i,u;try{for(n=n.call(e);!(o=(i=n.next()).done);o=true){r.push(i.value);if(t&&r.length===t)break}}catch(e){a=true;u=e}finally{try{if(!o&&n["return"]!=null)n["return"]()}finally{if(a)throw u}}return r}function _non_iterable_rest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _non_iterable_spread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _object_spread(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};var r=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))}r.forEach(function(t){_define_property(e,t,n[t])})}return e}function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);if(t){r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}n.push.apply(n,r)}return n}function _object_spread_props(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(t))}else{ownKeys(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function _possible_constructor_return(e,t){if(t&&(_type_of(t)==="object"||typeof t==="function")){return t}return _assert_this_initialized(e)}function _set_prototype_of(e,t){_set_prototype_of=Object.setPrototypeOf||function e(e,t){e.__proto__=t;return e};return _set_prototype_of(e,t)}function _sliced_to_array(e,t){return _array_with_holes(e)||_iterable_to_array_limit(e,t)||_unsupported_iterable_to_array(e,t)||_non_iterable_rest()}function _super_prop_base(e,t){while(!Object.prototype.hasOwnProperty.call(e,t)){e=_get_prototype_of(e);if(e===null)break}return e}function _to_consumable_array(e){return _array_without_holes(e)||_iterable_to_array(e)||_unsupported_iterable_to_array(e)||_non_iterable_spread()}function _type_of(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function _unsupported_iterable_to_array(e,t){if(!e)return;if(typeof e==="string")return _array_like_to_array(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor)n=e.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _array_like_to_array(e,t)}function _wrap_native_super(e){var t=typeof Map==="function"?new Map:undefined;_wrap_native_super=function e(e){if(e===null||!_is_native_function(e))return e;if(typeof e!=="function"){throw new TypeError("Super expression must either be null or a function")}if(typeof t!=="undefined"){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return _construct(e,arguments,_get_prototype_of(this).constructor)}n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:false,writable:true,configurable:true}});return _set_prototype_of(n,e)};return _wrap_native_super(e)}function _is_native_reflect_construct(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(_is_native_reflect_construct=function(){return!!e})()}(function(e,t){if((typeof exports==="undefined"?"undefined":_type_of(exports))=="object"&&(typeof module==="undefined"?"undefined":_type_of(module))<"u"){module.exports=t()}else if("function"==typeof define&&define.amd){define("peggy",t)}else{e["peggy"]=t()}})((typeof globalThis==="undefined"?"undefined":_type_of(globalThis))<"u"?globalThis:(typeof self==="undefined"?"undefined":_type_of(self))<"u"?self:this,function(){var exports={};var __exports=exports;var module={exports:exports};"use strict";var U=function(e,t){return function(){return t||e((t={exports:{}}).exports,t),t.exports}};var Ve=U(function(e,t){"use strict";var n=/*#__PURE__*/function(){function e(t,n){_class_call_check(this,e);this.source=t,this.start=n}_create_class(e,[{key:"toString",value:function e(){return String(this.source)}},{key:"offset",value:function e(e){return{line:e.line+this.start.line-1,column:e.line===1?e.column+this.start.column-1:e.column,offset:e.offset+this.start.offset}}}],[{key:"offsetStart",value:function e(e){return e.source&&typeof e.source.offset=="function"?e.source.offset(e.start):e.start}},{key:"offsetEnd",value:function e(e){return e.source&&typeof e.source.offset=="function"?e.source.offset(e.end):e.end}}]);return e}();t.exports=n});var ft=U(function(e,t){"use strict";var n=Ve(),r=/*#__PURE__*/function(e){_inherits(t,e);function t(e,n,r){_class_call_check(this,t);var o;o=_call_super(this,t,[e]),o.name="GrammarError",o.location=n,r===void 0&&(r=[]),o.diagnostics=r,o.stage=null,o.problems=[["error",e,n,r]];return o}_create_class(t,[{key:"toString",value:function e(){var e=_get(_get_prototype_of(t.prototype),"toString",this).call(this);this.location&&(e+="\n at ",this.location.source!==void 0&&this.location.source!==null&&(e+="".concat(this.location.source,":")),e+="".concat(this.location.start.line,":").concat(this.location.start.column));var n=true,r=false,o=undefined;try{for(var a=this.diagnostics[Symbol.iterator](),i;!(n=(i=a.next()).done);n=true){var u=i.value;e+="\n from ",u.location.source!==void 0&&u.location.source!==null&&(e+="".concat(u.location.source,":")),e+="".concat(u.location.start.line,":").concat(u.location.start.column,": ").concat(u.message)}}catch(e){r=true;o=e}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(r){throw o}}}return e}},{key:"format",value:function e(e){var t=e.map(function(e){var t=e.source,n=e.text;return{source:t,text:n!=null?String(n).split(/\r\n|\n|\r/g):[]}});function r(e,r){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";var a="",i=t.find(function(t){var n=t.source;return n===e.source}),u=e.start,c=n.offsetStart(e);if(i){var s=e.end,l=i.text[u.line-1],p=(u.line===s.line?s.column:l.length+1)-u.column||1;o&&(a+="\nnote: ".concat(o)),a+="\n --\x3e ".concat(e.source,":").concat(c.line,":").concat(c.column,"\n").concat("".padEnd(r)," |\n").concat(c.line.toString().padStart(r)," | ").concat(l,"\n").concat("".padEnd(r)," | ").concat("".padEnd(u.column-1)).concat("".padEnd(p,"^"))}else a+="\n at ".concat(e.source,":").concat(c.line,":").concat(c.column),o&&(a+=": ".concat(o));return a}function o(e,t,o){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[];var i=-1/0;o?i=a.reduce(function(e,t){var r=t.location;return Math.max(e,n.offsetStart(r).line)},o.start.line):i=Math.max.apply(null,a.map(function(e){return e.location.start.line})),i=i.toString().length;var u="".concat(e,": ").concat(t);o&&(u+=r(o,i));var c=true,s=false,l=undefined;try{for(var p=a[Symbol.iterator](),f;!(c=(f=p.next()).done);c=true){var h=f.value;u+=r(h.location,i,h.message)}}catch(e){s=true;l=e}finally{try{if(!c&&p.return!=null){p.return()}}finally{if(s){throw l}}}return u}return this.problems.filter(function(e){return e[0]!=="info"}).map(function(e){return o.apply(void 0,_to_consumable_array(e))}).join("\n\n")}}]);return t}(_wrap_native_super(SyntaxError));t.exports=r});var K=U(function(e,t){"use strict";var n={build:function e(e){function t(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++){r[o-1]=arguments[o]}var a;return(a=e)[t.type].apply(a,[t].concat(_to_consumable_array(r)))}function n(){}function r(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++){r[o-1]=arguments[o]}return t.apply(void 0,[e.expression].concat(_to_consumable_array(r)))}function o(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),a=1;a<r;a++){o[a-1]=arguments[a]}n[e].forEach(function(e){return t.apply(void 0,[e].concat(_to_consumable_array(o)))})}}var a={grammar:function e(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++){r[o-1]=arguments[o]}var a=true,i=false,u=undefined;try{for(var c=e.imports[Symbol.iterator](),s;!(a=(s=c.next()).done);a=true){var l=s.value;t.apply(void 0,[l].concat(_to_consumable_array(r)))}}catch(e){i=true;u=e}finally{try{if(!a&&c.return!=null){c.return()}}finally{if(i){throw u}}}var p=true,f=false,h=undefined;if(e.topLevelInitializer)if(Array.isArray(e.topLevelInitializer))try{for(var d=e.topLevelInitializer[Symbol.iterator](),v;!(p=(v=d.next()).done);p=true){var g=v.value;t.apply(void 0,[g].concat(_to_consumable_array(r)))}}catch(e){f=true;h=e}finally{try{if(!p&&d.return!=null){d.return()}}finally{if(f){throw h}}}else t.apply(void 0,[e.topLevelInitializer].concat(_to_consumable_array(r)));var m=true,y=false,_=undefined;if(e.initializer)if(Array.isArray(e.initializer))try{for(var b=e.initializer[Symbol.iterator](),x;!(m=(x=b.next()).done);m=true){var S=x.value;t.apply(void 0,[S].concat(_to_consumable_array(r)))}}catch(e){y=true;_=e}finally{try{if(!m&&b.return!=null){b.return()}}finally{if(y){throw _}}}else t.apply(void 0,[e.initializer].concat(_to_consumable_array(r)));e.rules.forEach(function(e){return t.apply(void 0,[e].concat(_to_consumable_array(r)))})},grammar_import:n,top_level_initializer:n,initializer:n,rule:r,named:r,choice:o("alternatives"),action:r,sequence:o("elements"),labeled:r,text:r,simple_and:r,simple_not:r,optional:r,zero_or_more:r,one_or_more:r,repeated:function e(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++){r[o-1]=arguments[o]}return e.delimiter&&t.apply(void 0,[e.delimiter].concat(_to_consumable_array(r))),t.apply(void 0,[e.expression].concat(_to_consumable_array(r)))},group:r,semantic_and:n,semantic_not:n,rule_ref:n,library_ref:n,literal:n,class:n,any:n};return Object.keys(a).forEach(function(t){Object.prototype.hasOwnProperty.call(e,t)||(e[t]=a[t])}),t}};t.exports=n});var he=U(function(e,t){"use strict";var n=function e(e,t){if(!(e&&t))return e||t;var n=Array.isArray(e)?e:[e];return n.push(t),n};var r=K();var o={findRule:function e(e,t){for(var n=0;n<e.rules.length;n++)if(e.rules[n].name===t)return e.rules[n]},indexOfRule:function e(e,t){for(var n=0;n<e.rules.length;n++)if(e.rules[n].name===t)return n;return-1},alwaysConsumesOnSuccess:function e(e,t){function n(){return!0}function a(){return!1}var i=r.build({choice:function e(e){return e.alternatives.every(i)},sequence:function e(e){return e.elements.some(i)},simple_and:a,simple_not:a,optional:a,zero_or_more:a,repeated:function e(e){var t=e.min?e.min:e.max;return t.type!=="constant"||t.value===0?!1:!!(i(e.expression)||t.value>1&&e.delimiter&&i(e.delimiter))},semantic_and:a,semantic_not:a,rule_ref:function t(t){var n=o.findRule(e,t.name);return n?i(n):void 0},library_ref:a,literal:function e(e){return e.value!==""},class:n,any:n});return i(t)},combine:function e(e){return e.reduce(function(e,t){return e.topLevelInitializer=n(e.topLevelInitializer,t.topLevelInitializer),e.initializer=n(e.initializer,t.initializer),e.rules=e.rules.concat(t.rules),e})}};t.exports=o});var Xs=U(function(e,t){"use strict";var n=function e(e){var t=0;var n=true,r=false,o=undefined;try{for(var a=e.imports[Symbol.iterator](),i;!(n=(i=a.next()).done);n=true){var u=i.value;var c=true,s=false,l=undefined;try{for(var p=u.what[Symbol.iterator](),f;!(c=(f=p.next()).done);c=true){var h=f.value;var d=void 0;switch(h.type){case"import_binding_all":continue;case"import_binding_default":break;case"import_binding":d=h.binding;break;case"import_binding_rename":d=h.rename;break;default:throw new TypeError("Unknown binding type")}e.rules.push({type:"rule",name:h.binding,nameLocation:h.location,expression:{type:"library_ref",name:d,library:u.from.module,libraryNumber:t,location:h.location},location:u.from.location})}}catch(e){s=true;l=e}finally{try{if(!c&&p.return!=null){p.return()}}finally{if(s){throw l}}}t++}}catch(e){r=true;o=e}finally{try{if(!n&&a.return!=null){a.return()}}finally{if(r){throw o}}}};t.exports=n});var Ks=U(function(e,t){"use strict";var n=function e(e,t){var n=0;var r=true,o=false,a=undefined;try{for(var i=e.imports[Symbol.iterator](),u;!(r=(u=i.next()).done);r=true){var c=u.value;var s=true,l=false,p=undefined;try{for(var f=c.what[Symbol.iterator](),h;!(s=(h=f.next()).done);s=true){var d=h.value;if(d.type==="import_binding_all"&&d.binding===t)return n}}catch(e){l=true;p=e}finally{try{if(!s&&f.return!=null){f.return()}}finally{if(l){throw p}}}n++}}catch(e){o=true;a=e}finally{try{if(!r&&i.return!=null){i.return()}}finally{if(o){throw a}}}return-1};var r=function e(e,t,r){o.build({library_ref:function t(t){t.libraryNumber===-1&&(t.libraryNumber=n(e,t.library),t.libraryNumber===-1&&r.error('Unknown module "'.concat(t.library,'"'),t.location))}})(e)};var o=K();t.exports=r});var Ht=U(function(e,t){"use strict";var n={PUSH:0,PUSH_EMPTY_STRING:35,PUSH_UNDEFINED:1,PUSH_NULL:2,PUSH_FAILED:3,PUSH_EMPTY_ARRAY:4,PUSH_CURR_POS:5,POP:6,POP_CURR_POS:7,POP_N:8,NIP:9,APPEND:10,WRAP:11,TEXT:12,PLUCK:36,IF:13,IF_ERROR:14,IF_NOT_ERROR:15,IF_LT:30,IF_GE:31,IF_LT_DYNAMIC:32,IF_GE_DYNAMIC:33,WHILE_NOT_ERROR:16,MATCH_ANY:17,MATCH_STRING:18,MATCH_STRING_IC:19,MATCH_CHAR_CLASS:20,MATCH_UNICODE_CLASS:42,MATCH_REGEXP:20,ACCEPT_N:21,ACCEPT_STRING:22,FAIL:23,LOAD_SAVED_POS:24,UPDATE_SAVED_POS:25,CALL:26,RULE:27,LIBRARY_RULE:41,SILENT_FAILS_ON:28,SILENT_FAILS_OFF:29,SOURCE_MAP_PUSH:37,SOURCE_MAP_POP:38,SOURCE_MAP_LABEL_PUSH:39,SOURCE_MAP_LABEL_POP:40};t.exports=n});var tr=U(function(e,t){"use strict";var n=/*#__PURE__*/function(){function e(t){_class_call_check(this,e);this.options=_object_spread({stringify:String,convert:function(e){return e}},t),this.items=[],this.offsets=Object.create(null)}_create_class(e,[{key:"add",value:function e(e){var t=this.options.convert(e);if(!t)return-1;var n=this.options.stringify(t),r=this.offsets[n];return r===void 0&&(r=this.items.push(t)-1,this.offsets[n]=r),r}},{key:"get",value:function e(e){return this.items[e]}},{key:"map",value:function e(e){return this.items.map(e)}}]);return e}();t.exports=n});var ht=U(function(e,t){"use strict";var n=function e(e){function t(e){return e.match=u}function n(e){return p(e.expression),e.match=i}function s(e){return e.match=p(e.expression)}function l(e,t){var n=e.length,r=0,o=0;for(var a=0;a<n;++a){var s=p(e[a]);s===i&&++r,s===c&&++o}return r===n?i:t?o===n?c:u:o>0?c:u}var p=r.build({rule:function e(e){var t,n=0;if(_type_of(e.match)>"u"){e.match=u;do if(t=e.match,e.match=p(e.expression),++n>6)throw new a("Infinity cycle detected when trying to evaluate node match result",e.location);while(t!==e.match)}return e.match},named:s,choice:function e(e){return e.match=l(e.alternatives,!0)},action:s,sequence:function e(e){return e.match=l(e.elements,!1)},labeled:s,text:s,simple_and:s,simple_not:function e(e){return e.match=-p(e.expression)},optional:n,zero_or_more:n,one_or_more:s,repeated:function e(e){var t=p(e.expression),n=e.delimiter?p(e.delimiter):c,r=e.min?e.min:e.max;return r.type!=="constant"||e.max.type!=="constant"?e.match=u:e.max.value===0||e.max.value!==null&&r.value>e.max.value?e.match=c:t===c?e.match=r.value===0?i:c:t===i?e.delimiter&&r.value>=2?e.match=n:e.match=i:e.delimiter&&r.value>=2?e.match=n===c?c:u:e.match=r.value===0?i:u},group:s,semantic_and:t,semantic_not:t,rule_ref:function t(t){var n=o.findRule(e,t.name);return n?t.match=p(n):u},library_ref:function e(){return 0},literal:function e(e){var t=e.value.length===0?i:u;return e.match=t},class:function e(e){var t=e.parts.length===0?c:u;return e.match=t},any:t});p(e)};var r=K(),o=he(),a=ft(),i=1,u=0,c=-1;n.ALWAYS_MATCH=i;n.SOMETIMES_MATCH=u;n.NEVER_MATCH=c;t.exports=n});var ir=U(function(e,t){"use strict";var n=function e(e,t){var n=new i,u=new i({stringify:JSON.stringify,convert:function(e){return{value:e.parts,inverted:e.inverted,ignoreCase:e.ignoreCase,unicode:e.unicode}}}),p=new i({stringify:JSON.stringify}),f=new i,h=[],d=[];function v(e,t,n){var r={predicate:e,params:t,body:n.code,location:n.codeLocation},o=JSON.stringify(r),a=h.findIndex(function(e){return JSON.stringify(e)===o});return a===-1?h.push(r)-1:a}function g(e){return d.push(e)-1}function m(e){var t={};return Object.keys(e).forEach(function(n){t[n]=e[n]}),t}function y(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++){n[r-1]=arguments[r]}var o;return(o=e).concat.apply(o,_to_consumable_array(n))}function _(e,t,n,r){return e===c?n:e===l?r:t.concat([n.length,r.length],n,r)}function b(e,t){return e.concat([t.length],t)}function x(e,t,n,r){var a=Object.keys(n).map(function(e){return r-n[e]});return[o.CALL,e,t,a.length].concat(a)}function S(e,t,n){var r=e.match||0;return y([o.PUSH_CURR_POS],[o.SILENT_FAILS_ON],F(e,{sp:n.sp+1,env:m(n.env),action:null}),[o.SILENT_FAILS_OFF],_(t?-r:r,[t?o.IF_ERROR:o.IF_NOT_ERROR],y([o.POP],[t?o.POP:o.POP_CURR_POS],[o.PUSH_UNDEFINED]),y([o.POP],[t?o.POP_CURR_POS:o.POP],[o.PUSH_FAILED])))}function P(e,t,n){var r=v(!0,Object.keys(n.env),e);return y([o.UPDATE_SAVED_POS],x(r,0,n.env,n.sp),_(e.match||0,[o.IF],y([o.POP],t?[o.PUSH_FAILED]:[o.PUSH_UNDEFINED]),y([o.POP],t?[o.PUSH_UNDEFINED]:[o.PUSH_FAILED])))}function A(e){return b([o.WHILE_NOT_ERROR],y([o.APPEND],e))}function E(e){var t=e;return new Error('Unknown boundary type "'.concat(t.type,'" for the "repeated" node'))}function w(e,t,n,r){switch(e.type){case"constant":return{pre:[],post:[],sp:n};case"variable":return e.sp=r+n-t[e.value],{pre:[],post:[],sp:n};case"function":{e.sp=r;var a=v(!0,Object.keys(t),{code:e.value,codeLocation:e.codeLocation});return{pre:x(a,0,t,n),post:[o.NIP],sp:n+1}}default:throw E(e)}}function C(e,t){if(t.value!==null){var n=t.type==="constant"?[o.IF_GE,t.value]:[o.IF_GE_DYNAMIC,t.sp||0];return _(s,n,[o.PUSH_FAILED],e)}return e}function R(e,t){var n=t.type==="constant"?[o.IF_LT,t.value]:[o.IF_LT_DYNAMIC,t.sp||0];return y(e,_(s,n,[o.POP,o.POP_CURR_POS,o.PUSH_FAILED],[o.NIP]))}function O(e,t,n,r,a){return e?y([o.PUSH_CURR_POS],F(e,{sp:r.sp+a+1,env:m(r.env),action:null}),_(e.match||0,[o.IF_NOT_ERROR],y([o.POP],n,_(-t,[o.IF_ERROR],[o.POP,o.POP_CURR_POS,o.PUSH_FAILED],[o.NIP])),[o.NIP])):n}function $(e){return t&&t.output==="source-and-map"&&Object.keys(e).forEach(function(t){var n=e[t];e[t]=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),a=1;a<t;a++){r[a-1]=arguments[a]}var i=n.apply(void 0,[e].concat(_to_consumable_array(r)));return i===void 0||!e.location?i:y([o.SOURCE_MAP_PUSH,g(e.location)],i,[o.SOURCE_MAP_POP])}}),a.build(e)}var F=$({grammar:function e(e){e.rules.forEach(F),e.literals=n.items,e.classes=u.items,e.expectations=p.items,e.importedNames=f.items,e.functions=h,e.locations=d},rule:function e(e){e.bytecode=F(e.expression,{sp:-1,env:{},pluck:[],action:null})},named:function e(e,t){var n=e.match||0,r=n===c?-1:p.add({type:"rule",value:e.name});return y([o.SILENT_FAILS_ON],F(e.expression,t),[o.SILENT_FAILS_OFF],_(-n,[o.IF_ERROR],[o.FAIL,r],[]))},choice:function e(e,t){function n(e,t){var r=e[0].match||0,a=F(e[0],{sp:t.sp,env:m(t.env),action:null});return r===c?a:y(a,e.length>1?_(s,[o.IF_ERROR],y([o.POP],n(e.slice(1),t)),[]):[])}return n(e.alternatives,t)},action:function e(e,t){var n=m(t.env),r=e.expression.type!=="sequence"||e.expression.elements.length===0,a=F(e.expression,{sp:t.sp+(r?1:0),env:n,action:e}),i=e.expression.match||0,u=r&&i!==l?v(!1,Object.keys(n),e):-1;return r?y([o.PUSH_CURR_POS],a,_(i,[o.IF_NOT_ERROR],y([o.LOAD_SAVED_POS,1],x(u,1,n,t.sp+2)),[]),[o.NIP]):a},sequence:function e(e,t){function n(t,r){if(t.length>0){var a=e.elements.length-t.length+1;return y(F(t[0],{sp:r.sp,env:r.env,pluck:r.pluck,action:null}),_(t[0].match||0,[o.IF_NOT_ERROR],n(t.slice(1),{sp:r.sp+1,env:r.env,pluck:r.pluck,action:r.action}),y(a>1?[o.POP_N,a]:[o.POP],[o.POP_CURR_POS],[o.PUSH_FAILED])))}else{if(r.pluck&&r.pluck.length>0)return y([o.PLUCK,e.elements.length+1,r.pluck.length],r.pluck.map(function(e){return r.sp-e}));if(r.action){var i=v(!1,Object.keys(r.env),r.action);return y([o.LOAD_SAVED_POS,e.elements.length],x(i,e.elements.length+1,r.env,r.sp))}else return y([o.WRAP,e.elements.length],[o.NIP])}}return y([o.PUSH_CURR_POS],n(e.elements,{sp:t.sp+1,env:t.env,pluck:[],action:t.action}))},labeled:function e(e,r){var a=r.env,i=e.label,u=r.sp+1;i&&(a=m(r.env),r.env[i]=u),e.pick&&r.pluck.push(u);var c=F(e.expression,{sp:r.sp,env:a,action:null});return i&&e.labelLocation&&t&&t.output==="source-and-map"?y([o.SOURCE_MAP_LABEL_PUSH,u,n.add(i),g(e.labelLocation)],c,[o.SOURCE_MAP_LABEL_POP,u]):c},text:function e(e,t){return y([o.PUSH_CURR_POS],F(e.expression,{sp:t.sp+1,env:m(t.env),action:null}),_(e.match||0,[o.IF_NOT_ERROR],y([o.POP],[o.TEXT]),[o.NIP]))},simple_and:function e(e,t){return S(e.expression,!1,t)},simple_not:function e(e,t){return S(e.expression,!0,t)},optional:function e(e,t){return y(F(e.expression,{sp:t.sp,env:m(t.env),action:null}),_(-(e.expression.match||0),[o.IF_ERROR],y([o.POP],[o.PUSH_NULL]),[]))},zero_or_more:function e(e,t){var n=F(e.expression,{sp:t.sp+1,env:m(t.env),action:null});return y([o.PUSH_EMPTY_ARRAY],n,A(n),[o.POP])},one_or_more:function e(e,t){var n=F(e.expression,{sp:t.sp+1,env:m(t.env),action:null});return y([o.PUSH_EMPTY_ARRAY],n,_(e.expression.match||0,[o.IF_NOT_ERROR],y(A(n),[o.POP]),y([o.POP],[o.POP],[o.PUSH_FAILED])))},repeated:function e(e,t){var n=e.min?e.min:e.max,r=n.type!=="constant"||n.value>0,a=e.max.type!=="constant"&&e.max.value!==null,i=r?2:1,u=e.min?w(e.min,t.env,t.sp,2+(e.max.type==="function"?1:0)):{pre:[],post:[],sp:t.sp},c=w(e.max,t.env,u.sp,i),s=F(e.expression,{sp:c.sp+i,env:m(t.env),action:null}),l=e.delimiter!==null?F(e.expression,{sp:c.sp+i+1,env:m(t.env),action:null}):s,p=O(e.delimiter,e.expression.match||0,l,t,i),f=C(p,e.max),h=a?C(s,e.max):s,d=y(r?[o.PUSH_CURR_POS]:[],[o.PUSH_EMPTY_ARRAY],h,A(f),[o.POP]);return y(u.pre,c.pre,r?R(d,n):d,c.post,u.post)},group:function e(e,t){return F(e.expression,{sp:t.sp,env:m(t.env),action:null})},semantic_and:function e(e,t){return P(e,!1,t)},semantic_not:function e(e,t){return P(e,!0,t)},rule_ref:function t(t){return[o.RULE,r.indexOfRule(e,t.name)]},library_ref:function e(e){return[o.LIBRARY_RULE,e.libraryNumber,f.add(e.name)]},literal:function e(e){if(e.value.length>0){var t=e.match||0,r=t===s||t===c&&!e.ignoreCase?n.add(e.ignoreCase?e.value.toLowerCase():e.value):-1,a=t!==c?p.add({type:"literal",value:e.value,ignoreCase:e.ignoreCase}):-1;return _(t,e.ignoreCase?[o.MATCH_STRING_IC,r]:[o.MATCH_STRING,r],e.ignoreCase?[o.ACCEPT_N,e.value.length]:[o.ACCEPT_STRING,r],[o.FAIL,a])}return[o.PUSH_EMPTY_STRING]},class:function e(e){var t=e.match||0,n=t===s?u.add(e):-1,r=t!==c?p.add({type:"class",value:e.parts,inverted:e.inverted,ignoreCase:e.ignoreCase,unicode:e.unicode}):-1;return _(t,[e.unicode?o.MATCH_UNICODE_CLASS:o.MATCH_CHAR_CLASS,n],[o.ACCEPT_N,e.unicode?-1:1],[o.FAIL,r])},any:function e(e){var t=e.match||0,n=t!==c?p.add({type:"any"}):-1;return _(t,[o.MATCH_ANY],[o.ACCEPT_N,1],[o.FAIL,n])}});F(e)};var r=he(),o=Ht(),a=K(),i=tr(),u=ht(),c=u.ALWAYS_MATCH,s=u.SOMETIMES_MATCH,l=u.NEVER_MATCH;t.exports=n});var lr=U(function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");e.encode=function(e){if(0<=e&&e<t.length)return t[e];throw new TypeError("Must be between 0 and 63: "+e)}});var pr=U(function(e){var t=function e(e){return e<0?(-e<<1)+1:(e<<1)+0};var n=lr(),r=5,o=1<<r,a=o-1,i=o;e.encode=function(e){var o="",u,c=t(e);do u=c&a,c>>>=r,c>0&&(u|=i),o+=n.encode(u);while(c>0);return o}});var mt=U(function(e){var t=function e(e,t,n){if(t in e)return e[t];if(arguments.length===3)return n;throw new Error('"'+t+'" is a required argument.')};var n=function e(e){return e};var r=function e(e){return a(e)?"$"+e:e};var o=function e(e){return a(e)?e.slice(1):e};var a=function e(e){if(!e)return!1;var t=e.length;if(t<9||e.charCodeAt(t-1)!==95||e.charCodeAt(t-2)!==95||e.charCodeAt(t-3)!==111||e.charCodeAt(t-4)!==116||e.charCodeAt(t-5)!==111||e.charCodeAt(t-6)!==114||e.charCodeAt(t-7)!==112||e.charCodeAt(t-8)!==95||e.charCodeAt(t-9)!==95)return!1;for(var n=t-10;n>=0;n--)if(e.charCodeAt(n)!==36)return!1;return!0};var i=function e(e,t){return e===t?0:e===null?1:t===null?-1:e>t?1:-1};var u=function e(e,t){var n=e.generatedLine-t.generatedLine;return n!==0||(n=e.generatedColumn-t.generatedColumn,n!==0)||(n=i(e.source,t.source),n!==0)||(n=e.originalLine-t.originalLine,n!==0)||(n=e.originalColumn-t.originalColumn,n!==0)?n:i(e.name,t.name)};var c=function e(e){return function(t){var n=f(t),r=p(t),o=new URL(t,r);e(o);var a=o.toString();return n==="absolute"?a:n==="scheme-relative"?a.slice(y.length):n==="path-absolute"?a.slice(_.length):h(r,a)}};var s=function e(e,t){return new URL(e,t).toString()};var l=function e(e,t){var n=0;do{var r=e+n++;if(t.indexOf(r)===-1)return r}while(!0)};var p=function e(e){var t=e.split("..").length-1,n=l("p",e),r="".concat(_,"/");for(var o=0;o<t;o++)r+="".concat(n,"/");return r};var f=function e(e){return e[0]==="/"?e[1]==="/"?"scheme-relative":"path-absolute":b.test(e)?"absolute":"path-relative"};var h=function e(e,t){typeof e=="string"&&(e=new URL(e)),typeof t=="string"&&(t=new URL(t));var n=t.pathname.split("/"),r=e.pathname.split("/");for(r.length>0&&!r[r.length-1]&&r.pop();n.length>0&&r.length>0&&n[0]===r[0];)n.shift(),r.shift();return r.map(function(){return".."}).concat(n).join("/")+t.search+t.hash};var d=function e(e,t){var n=f(t),r=f(e);if(e=x(e),n==="absolute")return s(t,void 0);if(r==="absolute")return s(t,e);if(n==="scheme-relative")return S(t);if(r==="scheme-relative")return s(t,s(e,_)).slice(y.length);if(n==="path-absolute")return S(t);if(r==="path-absolute")return s(t,s(e,_)).slice(_.length);var o=p(t+e),a=s(t,s(e,o));return h(o,a)};var v=function e(e,t){var n=g(e,t);return typeof n=="string"?n:S(t)};var g=function e(e,t){if(f(e)!==f(t))return null;var n=p(e+t),r=new URL(e,n),o=new URL(t,n);try{new URL("",o.toString())}catch(e){return null}return o.protocol!==r.protocol||o.user!==r.user||o.password!==r.password||o.hostname!==r.hostname||o.port!==r.port?null:h(r,o)};e.getArg=t;var m=function(){return!("__proto__"in Object.create(null))}();e.toSetString=m?n:r;e.fromSetString=m?n:o;e.compareByGeneratedPositionsInflated=u;var y="http:",_="".concat(y,"//host");var b=/^[A-Za-z0-9\+\-\.]+:/;var x=c(function(e){e.pathname=e.pathname.replace(/\/?$/,"/")}),S=c(function(e){});e.normalize=S;e.join=d;e.relative=v});var yr=U(function(e){var t=/*#__PURE__*/function(){"use strict";function e(){_class_call_check(this,e);this._array=[],this._set=new Map}_create_class(e,[{key:"size",value:function e(){return this._set.size}},{key:"add",value:function e(e,t){var n=this.has(e),r=this._array.length;(!n||t)&&this._array.push(e),n||this._set.set(e,r)}},{key:"has",value:function e(e){return this._set.has(e)}},{key:"indexOf",value:function e(e){var t=this._set.get(e);if(t>=0)return t;throw new Error('"'+e+'" is not in the set.')}},{key:"at",value:function e(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)}},{key:"toArray",value:function e(){return this._array.slice()}}],[{key:"fromArray",value:function t(t,n){var r=new e;for(var o=0,a=t.length;o<a;o++)r.add(t[o],n);return r}}]);return e}();e.ArraySet=t});var xr=U(function(e){var t=function e(e,t){var r=e.generatedLine,o=t.generatedLine,a=e.generatedColumn,i=t.generatedColumn;return o>r||o==r&&i>=a||n.compareByGeneratedPositionsInflated(e,t)<=0};var n=mt();var r=/*#__PURE__*/function(){"use strict";function e(){_class_call_check(this,e);this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}_create_class(e,[{key:"unsortedForEach",value:function e(e,t){this._array.forEach(e,t)}},{key:"add",value:function e(e){t(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))}},{key:"toArray",value:function e(){return this._sorted||(this._array.sort(n.compareByGeneratedPositionsInflated),this._sorted=!0),this._array}}]);return e}();e.MappingList=r});var Jt=U(function(e){var t=pr(),n=mt(),r=yr().ArraySet,o=xr().MappingList,a=/*#__PURE__*/function(){"use strict";function e(t){_class_call_check(this,e);t||(t={}),this._file=n.getArg(t,"file",null),this._sourceRoot=n.getArg(t,"sourceRoot",null),this._skipValidation=n.getArg(t,"skipValidation",!1),this._sources=new r,this._names=new r,this._mappings=new o,this._sourcesContents=null}_create_class(e,[{key:"addMapping",value:function e(e){var t=n.getArg(e,"generated"),r=n.getArg(e,"original",null),o=n.getArg(e,"source",null),a=n.getArg(e,"name",null);this._skipValidation||this._validateMapping(t,r,o,a),o!=null&&(o=String(o),this._sources.has(o)||this._sources.add(o)),a!=null&&(a=String(a),this._names.has(a)||this._names.add(a)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:r&&r.line,originalColumn:r&&r.column,source:o,name:a})}},{key:"setSourceContent",value:function e(e,t){var r=e;this._sourceRoot!=null&&(r=n.relative(this._sourceRoot,r)),t!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[n.toSetString(r)]=t):this._sourcesContents&&(delete this._sourcesContents[n.toSetString(r)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))}},{key:"applySourceMap",value:function e(e,t,o){var a=t;if(t==null){if(e.file==null)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');a=e.file}var i=this._sourceRoot;i!=null&&(a=n.relative(i,a));var u=this._mappings.toArray().length>0?new r:this._sources,c=new r;this._mappings.unsortedForEach(function(t){if(t.source===a&&t.originalLine!=null){var r=e.originalPositionFor({line:t.originalLine,column:t.originalColumn});r.source!=null&&(t.source=r.source,o!=null&&(t.source=n.join(o,t.source)),i!=null&&(t.source=n.relative(i,t.source)),t.originalLine=r.line,t.originalColumn=r.column,r.name!=null&&(t.name=r.name))}var s=t.source;s!=null&&!u.has(s)&&u.add(s);var l=t.name;l!=null&&!c.has(l)&&c.add(l)},this),this._sources=u,this._names=c,e.sources.forEach(function(t){var r=e.sourceContentFor(t);r!=null&&(o!=null&&(t=n.join(o,t)),i!=null&&(t=n.relative(i,t)),this.setSourceContent(t,r))},this)}},{key:"_validateMapping",value:function e(e,t,n,r){if(t&&typeof t.line!="number"&&typeof t.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0&&!t&&!n&&!r)){if(!(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&n))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:t,name:r}))}}},{key:"_serializeMappings",value:function e(){var e=0,r=1,o=0,a=0,i=0,u=0,c="",s,l,p,f,h=this._mappings.toArray();for(var d=0,v=h.length;d<v;d++){if(l=h[d],s="",l.generatedLine!==r)for(e=0;l.generatedLine!==r;)s+=";",r++;else if(d>0){if(!n.compareByGeneratedPositionsInflated(l,h[d-1]))continue;s+=","}s+=t.encode(l.generatedColumn-e),e=l.generatedColumn,l.source!=null&&(f=this._sources.indexOf(l.source),s+=t.encode(f-u),u=f,s+=t.encode(l.originalLine-1-a),a=l.originalLine-1,s+=t.encode(l.originalColumn-o),o=l.originalColumn,l.name!=null&&(p=this._names.indexOf(l.name),s+=t.encode(p-i),i=p)),c+=s}return c}},{key:"_generateSourcesContent",value:function e(e,t){return e.map(function(e){if(!this._sourcesContents)return null;t!=null&&(e=n.relative(t,e));var r=n.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,r)?this._sourcesContents[r]:null},this)}},{key:"toJSON",value:function e(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(e.file=this._file),this._sourceRoot!=null&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e}},{key:"toString",value:function e(){return JSON.stringify(this.toJSON())}}],[{key:"fromSourceMap",value:function t(t){var r=t.sourceRoot,o=new e({file:t.file,sourceRoot:r});return t.eachMapping(function(e){var t={generated:{line:e.generatedLine,column:e.generatedColumn}};e.source!=null&&(t.source=e.source,r!=null&&(t.source=n.relative(r,t.source)),t.original={line:e.originalLine,column:e.originalColumn},e.name!=null&&(t.name=e.name)),o.addMapping(t)}),t.sources.forEach(function(e){var a=e;r!=null&&(a=n.relative(r,e)),o._sources.has(a)||o._sources.add(a);var i=t.sourceContentFor(e);i!=null&&o.setSourceContent(e,i)}),o}}]);return e}();a.prototype._version=3;e.SourceMapGenerator=a});var Ar=U(function(e){var t=Jt().SourceMapGenerator,n=mt(),r=/(\r?\n)/,o=10,a="$$$isSourceNode$$$",i=/*#__PURE__*/function(){"use strict";function e(t,n,r,o,i){_class_call_check(this,e);this.children=[],this.sourceContents={},this.line=t!==null&&t!==void 0?t:null,this.column=n!==null&&n!==void 0?n:null,this.source=r!==null&&r!==void 0?r:null,this.name=i!==null&&i!==void 0?i:null,this[a]=!0,o!=null&&this.add(o)}_create_class(e,[{key:"add",value:function e(e){if(Array.isArray(e))e.forEach(function(e){this.add(e)},this);else if(e[a]||typeof e=="string")e&&this.children.push(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this}},{key:"prepend",value:function e(e){if(Array.isArray(e))for(var t=e.length-1;t>=0;t--)this.prepend(e[t]);else if(e[a]||typeof e=="string")this.children.unshift(e);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);return this}},{key:"walk",value:function e(e){var t;for(var n=0,r=this.children.length;n<r;n++)t=this.children[n],t[a]?t.walk(e):t!==""&&e(t,{source:this.source,line:this.line,column:this.column,name:this.name})}},{key:"join",value:function e(e){var t,n,r=this.children.length;if(r>0){for(t=[],n=0;n<r-1;n++)t.push(this.children[n]),t.push(e);t.push(this.children[n]),this.children=t}return this}},{key:"replaceRight",value:function e(e,t){var n=this.children[this.children.length-1];return n[a]?n.replaceRight(e,t):typeof n=="string"?this.children[this.children.length-1]=n.replace(e,t):this.children.push("".replace(e,t)),this}},{key:"setSourceContent",value:function e(e,t){this.sourceContents[n.toSetString(e)]=t}},{key:"walkSourceContents",value:function e(e){for(var t=0,r=this.children.length;t<r;t++)this.children[t][a]&&this.children[t].walkSourceContents(e);var o=Object.keys(this.sourceContents);for(var i=0,u=o.length;i<u;i++)e(n.fromSetString(o[i]),this.sourceContents[o[i]])}},{key:"toString",value:function e(){var e="";return this.walk(function(t){e+=t}),e}},{key:"toStringWithSourceMap",value:function e(e){var n={code:"",line:1,column:0},r=new t(e),a=!1,i=null,u=null,c=null,s=null;return this.walk(function(e,t){n.code+=e,t.source!==null&&t.line!==null&&t.column!==null?((i!==t.source||u!==t.line||c!==t.column||s!==t.name)&&r.addMapping({source:t.source,original:{line:t.line,column:t.column},generated:{line:n.line,column:n.column},name:t.name}),i=t.source,u=t.line,c=t.column,s=t.name,a=!0):a&&(r.addMapping({generated:{line:n.line,column:n.column}}),i=null,a=!1);for(var l=0,p=e.length;l<p;l++)e.charCodeAt(l)===o?(n.line++,n.column=0,l+1===p?(i=null,a=!1):a&&r.addMapping({source:t.source,original:{line:t.line,column:t.column},generated:{line:n.line,column:n.column},name:t.name})):n.column++}),this.walkSourceContents(function(e,t){r.setSourceContent(e,t)}),{code:n.code,map:r}}}],[{key:"fromStringWithSourceMap",value:function t(t,o,a){var i=new e,u=t.split(r),c=0,s=function e(){var e=n(),t=n()||"";return e+t;function n(){return c<u.length?u[c++]:void 0}},l=1,p=0,f=null,h;return o.eachMapping(function(e){if(f!==null)if(l<e.generatedLine)d(f,s()),l++,p=0;else{h=u[c]||"";var t=h.substr(0,e.generatedColumn-p);u[c]=h.substr(e.generatedColumn-p),p=e.generatedColumn,d(f,t),f=e;return}for(;l<e.generatedLine;)i.add(s()),l++;p<e.generatedColumn&&(h=u[c]||"",i.add(h.substr(0,e.generatedColumn)),u[c]=h.substr(e.generatedColumn),p=e.generatedColumn),f=e},this),c<u.length&&(f&&d(f,s()),i.add(u.splice(c).join(""))),o.sources.forEach(function(e){var t=o.sourceContentFor(e);t!=null&&(a!=null&&(e=n.join(a,e)),i.setSourceContent(e,t))}),i;function d(t,r){if(t===null||t.source===void 0)i.add(r);else{var o=a?n.join(a,t.source):t.source;i.add(new e(t.originalLine,t.originalColumn,o,r,t.name))}}}}]);return e}();e.SourceNode=i});var Kt=U(function(e){e.SourceMapGenerator=Jt().SourceMapGenerator;e.SourceNode=Ar().SourceNode});var Rr=U(function(e,t){"use strict";var n=Kt(),r=n.SourceNode,o=Ve(),a=/*#__PURE__*/function(){function e(t,n,r,o){_class_call_check(this,e);this.sp=-1,this.maxSp=-1,this.varName=n,this.ruleName=t,this.type=r,this.bytecode=o,this.labels={},this.sourceMapStack=[]}_create_class(e,[{key:"name",value:function e(e){if(e<0)throw new RangeError("Rule '".concat(this.ruleName,"': The variable stack underflow: attempt to use a variable '").concat(this.varName,"<x>' at an index ").concat(e,".\nBytecode: ").concat(this.bytecode));return this.varName+e}},{key:"push",value:function t(t){++this.sp>this.maxSp&&(this.maxSp=this.sp);var n=this.labels[this.sp],o=[this.name(this.sp)," = ",t,";"];if(n)if(this.sourceMapStack.length){var a=e.sourceNode(n.location,o.splice(0,2),n.label),i=this.sourceMapPopInternal(),u=i.parts,c=i.location,s=c.start.offset<n.location.end.offset?{start:n.location.end,end:c.end,source:c.source}:c,l=e.sourceNode(s,o.concat("\n"));return this.sourceMapStack.push([u,u.length+1,c]),new r(null,null,n.location.source,[a,l])}else return e.sourceNode(n.location,o.concat("\n"));return o.join("")}},{key:"pop",value:function e(e){var t=this;return e!==void 0?(this.sp-=e,Array.from({length:e},function(e,n){return t.name(t.sp+1+n)})):this.name(this.sp--)}},{key:"top",value:function e(){return this.name(this.sp)}},{key:"index",value:function e(e){if(e<0)throw new RangeError("Rule '".concat(this.ruleName,"': The variable stack overflow: attempt to get a variable at a negative index ").concat(e,".\nBytecode: ").concat(this.bytecode));return this.name(this.sp-e)}},{key:"result",value:function e(){if(this.maxSp<0)throw new RangeError("Rule '".concat(this.ruleName,"': The variable stack is empty, can't get the result.\nBytecode: ").concat(this.bytecode));return this.name(0)}},{key:"defines",value:function e(){var e=this;return this.maxSp<0?"":this.type+" "+Array.from({length:this.maxSp+1},function(t,n){return e.name(n)}).join(", ")+";"}},{key:"checkedIf",value:function e(e,t,n){var r=this.sp,o=t();if(!n)return[o];var a=this.sp;this.sp=r;var i=n();if(a!==this.sp)throw new Error("Rule '"+this.ruleName+"', position "+e+": Branches of a condition can't move the stack pointer differently (before: "+r+", after then: "+a+", after else: "+this.sp+"). Bytecode: "+this.bytecode);return[o,i]}},{key:"checkedLoop",value:function e(e,t){var n=this.sp,r=t();if(n!==this.sp)throw new Error("Rule '"+this.ruleName+"', position "+e+": Body of a loop can't move the stack pointer (before: "+n+", after: "+this.sp+"). Bytecode: "+this.bytecode);return r}},{key:"sourceMapPush",value:function e(e,t){if(this.sourceMapStack.length){var n=this.sourceMapStack[this.sourceMapStack.length-1];n[2].start.offset===t.start.offset&&n[2].end.offset>t.end.offset&&(n[2]={start:t.end,end:n[2].end,source:n[2].source})}this.sourceMapStack.push([e,e.length,t])}},{key:"sourceMapPopInternal",value:function e(){var e=this.sourceMapStack.pop();if(!e)throw new RangeError("Rule '".concat(this.ruleName,"': Attempting to pop an empty source map stack.\nBytecode: ").concat(this.bytecode));var t=_sliced_to_array(e,3),n=t[0],a=t[1],i=t[2],u=n.splice(a).map(function(e){return _instanceof(e,r)?e:e+"\n"});if(u.length){var c=o.offsetStart(i);n.push(new r(c.line,c.column-1,String(i.source),u))}return{parts:n,location:i}}},{key:"sourceMapPop",value:function e(e){var t=this.sourceMapPopInternal(),n=t.location;if(this.sourceMapStack.length&&n.end.offset<this.sourceMapStack[this.sourceMapStack.length-1][2].end.offset){var r=this.sourceMapPopInternal(),o=r.parts,a=r.location,i=a.start.offset<n.end.offset?{start:n.end,end:a.end,source:a.source}:a;this.sourceMapStack.push([o,o.length+(e||0),i])}}}],[{key:"sourceNode",value:function e(e,t,n){var a=o.offsetStart(e);return new r(a.line,a.column?a.column-1:null,String(e.source),t,n)}}]);return e}();t.exports=a});var es=U(function(e){"use strict";e.version="5.0.6"});var Qe=U(function(e){"use strict";var t=function e(e){return e.codePointAt(0).toString(16).toUpperCase()};var n=function e(e){return(typeof e==="undefined"?"undefined":_type_of(e))=="object"?"\\\\".concat(e.value):e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\v/g,"\\v").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(RegExp("[\\u{10000}-\\u{10FFFF}]","gu"),function(e){return"\\u{".concat(t(e),"}")}).replace(/[\x00-\x0F]/g,function(e){return"\\x0"+t(e)}).replace(/[\x10-\x1F\x7F-\xFF]/g,function(e){return"\\x"+t(e)}).replace(/[\u0100-\u0FFF]/g,function(e){return"\\u0"+t(e)}).replace(/[\u1000-\uFFFF]/g,function(e){return"\\u"+t(e)})};var r=function e(e){return(typeof e==="undefined"?"undefined":_type_of(e))=="object"?"\\".concat(e.value):e.replace(/\\/g,"\\\\").replace(/\//g,"\\/").replace(/]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\x08/g,"\\b").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\v/g,"\\v").replace(/\f/g,"\\f").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(e){return"\\x0"+t(e)}).replace(/[\x10-\x1F\x7F-\xFF]/g,function(e){return"\\x"+t(e)}).replace(RegExp("[\\u{10000}-\\u{10FFFF}]","gu"),function(e){return"\\u{"+t(e)+"}"}).replace(/[\u0100-\u0FFF]/g,function(e){return"\\u0"+t(e)}).replace(/[\u1000-\uFFFF]/g,function(e){return"\\u"+t(e)})};var o=function e(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=e.length%3,r=e.length-n,o="";for(var a=0;a<r;a+=3)o+=t[e[a]>>2],o+=t[(e[a]&3)<<4|e[a+1]>>4],o+=t[(e[a+1]&15)<<2|e[a+2]>>6],o+=t[e[a+2]&63];return n===1?(o+=t[e[r]>>2],o+=t[(e[r]&3)<<4],o+="=="):n===2&&(o+=t[e[r]>>2],o+=t[(e[r]&3)<<4|e[r+1]>>4],o+=t[(e[r+1]&15)<<2],o+="="),o};var a=function e(e){var t=e[Symbol.iterator](),n=t.next();return n.done||!t.next().done?-1:n.value.codePointAt(0)};e.hex=t;e.stringEscape=n;e.regexpClassEscape=r;e.base64=o;e.codePointLen1=a});var ts=U(function(e,t){"use strict";var n=function e(e,t){t=t!==void 0?t:{};var n={},u=t.grammarSource,c={Grammar:nW,ImportsAndSource:nq},s=nW,l="import",p=";",f=",",h="*",d="as",v="{",g="}",m="from",y="=",_="/",b="@",x=":",S="|",P="..",A="(",E=")",w=".",C="\n",R="\r\n",O="/*",$="*/",F="//",k="\\",L="i",I='"',N="'",U="[",T="^",j="]",M="p",D="_",H="u",z="-",G="0",B="b",Y="f",V="n",W="r",q="t",J="v",X="x",K=/^[!$&]/,Z=/^[*-+?]/,Q=/^[!&]/,ee=/^[\0-\uD7FF\uE000-\uFFFF]/,et=/^[\uD800-\uDBFF]/,en=/^[\uDC00-\uDFFF]/,er=/^[\uD800-\uDFFF]/,eo=RegExp("^[\\t\\v-\\f \\p{Zs}\\xA0\\uFEFF]","u"),ea=/^[\n\r\u2028\u2029]/,ei=/^[\r\u2028-\u2029]/,eu=RegExp("^[\\p{ID_Start}_]","u"),ec=RegExp("^[$\\p{ID_Continue}]","u"),es=/^[\n\r"\\\u2028-\u2029]/,el=/^[\n\r'\\\u2028-\u2029]/,ep=/^[a-z]/i,ef=/^[\n\r\\-\]\u2028-\u2029]/,eh=/^["'\\]/,ed=/^[0-9pux]/,ev=/^[0-9]/,eg=/^[0-9a-f]/i,em=/^[{}]/,ey=nM(),e_=nT("import",!1),eb=nT(";",!1),ex=nT(",",!1),eS=nT("*",!1),eP=nT("as",!1),eA=nT("{",!1),eE=nT("}",!1),ew=nT("from",!1),eC=nT("=",!1),eR=nT("/",!1),eO=nT("@",!1),e$=nT(":",!1),eF=nj(["!","$","&"],!1,!1,!1),ek=nj([["*","+"],"?"],!1,!1,!1),eL=nT("|",!1),eI=nT("..",!1),eN=nT("(",!1),eU=nT(")",!1),eT=nT(".",!1),ej=nj(["!","&"],!1,!1,!1),eM=nj([["\0","퟿"],["","￿"]],!1,!1,!1),eD=nj([["\uD800","\uDBFF"]],!1,!1,!1),eH=nj([["\uDC00","\uDFFF"]],!1,!1,!1),ez=nj([["\uD800","\uDFFF"]],!1,!1,!1),eG=nH("whitespace"),eB=nj([" ",["\v","\f"]," ","\\p{Zs}","\xa0","\uFEFF"],!1,!1,!0),eY=nj(["\n","\r","\u2028","\u2029"],!1,!1,!1),eV=nH("end of line"),eW=nT("\n",!1),eq=nT("\r\n",!1),eJ=nj(["\r",["\u2028","\u2029"]],!1,!1,!1),eX=nH("comment"),eK=nT("/*",!1),eZ=nT("*/",!1),eQ=nT("//",!1),e0=nH("identifier"),e1=nj(["\\p{ID_Start}","_"],!1,!1,!0),e2=nT("\\",!1),e3=nj(["$","\\p{ID_Continue}"],!1,!1,!0),e9=nH("literal"),e4=nT("i",!1),e5=nH("string"),e6=nT('"',!1),e8=nT("'",!1),e7=nj(["\n","\r",'"',"\\",["\u2028","\u2029"]],!1,!1,!1),te=nj(["\n","\r","'","\\",["\u2028","\u2029"]],!1,!1,!1),tt=nH("character class"),tn=nT("[",!1),tr=nT("^",!1),to=nT("]",!1),ta=nT("p",!0),ti=nT("_",!1),tu=nj([["a","z"]],!1,!0,!1),tc=nT("u",!1),ts=nT("-",!1),tl=nj(["\n","\r",["\\","]"],["\u2028","\u2029"]],!1,!1,!1),tp=nT("0",!1),tf=nj(['"',"'","\\"],!1,!1,!1),th=nT("b",!1),td=nT("f",!1),tv=nT("n",!1),tg=nT("r",!1),tm=nT("t",!1),ty=nT("v",!1),t_=nj([["0","9"],"p","u","x"],!1,!1,!1),tb=nT("x",!1),tx=nj([["0","9"]],!1,!1,!1),tS=nj([["0","9"],["a","f"]],!1,!0,!1),tP=nH("code block"),tA=nj(["{","}"],!1,!1,!1);function tE(e,t,n,r){return{type:"grammar",imports:e,topLevelInitializer:t,initializer:n,rules:r,location:nL()}}function tw(e,t){return[e,t]}function tC(e){return{type:"top_level_initializer",code:e,codeLocation:nL()}}function tR(e){return{type:"top_level_initializer",code:e,codeLocation:nL()}}function tO(e,t){return{type:"grammar_import",what:e,from:t,location:nL()}}function t$(e){return{type:"grammar_import",what:[],from:e,location:nL()}}function tF(e,t){return t?(t.unshift(e),t):[e]}function tk(e){return{type:"import_binding_default",binding:e[0],location:e[1]}}function tL(e){return[{type:"import_binding_all",binding:e[0],location:e[1]}]}function tI(){return[]}function tN(e,t){return{type:"import_binding_rename",rename:e[0],renameLocation:e[1],binding:t[0],location:t[1]}}function tU(e){return{type:"import_binding",binding:e[0],location:e[1]}}function tT(e){return{type:"import_module_specifier",module:e,location:nL()}}function tj(e){return[e,nL()]}function tM(e){return[e,nL()]}function tD(e){return oi.has(e[0])&&nN("Binding identifier can't be a reserved word \"".concat(e[0],'"'),e[1]),e[0]}function tH(e){return{type:"top_level_initializer",code:e[0],codeLocation:e[1],location:nL()}}function tz(e){return{type:"initializer",code:e[0],codeLocation:e[1],location:nL()}}function tG(e,t,n){return{type:"rule",name:e[0],nameLocation:e[1],expression:t!==null?{type:"named",name:t,expression:n,location:nL()}:n,location:nL()}}function tB(e,t){return t.length>0?{type:"choice",alternatives:[e].concat(t),location:nL()}:e}function tY(e,t){return t!==null?{type:"action",expression:e,code:t[0],codeLocation:t[1],location:nL()}:e}function tV(e,t){return t.length>0||e.type==="labeled"&&e.pick?{type:"sequence",elements:[e].concat(t),location:nL()}:e}function tW(e,t,n){return n.type.startsWith("semantic_")&&nN('"@" cannot be used on a semantic predicate',e),{type:"labeled",label:t!==null?t[0]:null,labelLocation:t!==null?t[1]:e,pick:!0,expression:n,location:nL()}}function tq(e,t){return{type:"labeled",label:e[0],labelLocation:e[1],expression:t,location:nL()}}function tJ(){return nL()}function tX(e){return oi.has(e[0])&&nN("Label can't be a reserved word \"".concat(e[0],'"'),e[1]),e}function tK(e,t){retu