aontu 0.5.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/aontu.ts +3 -2
- package/dist/aontu.d.ts +2 -2
- package/dist/aontu.js +3 -4
- package/dist/aontu.js.map +1 -1
- package/dist/aontu.min.js +1 -63
- package/dist/lib/lang.d.ts +1 -3
- package/dist/lib/lang.js +33 -24
- package/dist/lib/lang.js.map +1 -1
- package/dist/lib/op/disjunct.js +10 -10
- package/dist/lib/op/disjunct.js.map +1 -1
- package/dist/lib/op/op.d.ts +1 -1
- package/dist/lib/op/op.js.map +1 -1
- package/dist/lib/op/unite.js +19 -14
- package/dist/lib/op/unite.js.map +1 -1
- package/dist/lib/type.d.ts +33 -22
- package/dist/lib/type.js +22 -76
- package/dist/lib/type.js.map +1 -1
- package/dist/lib/unify.d.ts +4 -1
- package/dist/lib/unify.js +7 -5
- package/dist/lib/unify.js.map +1 -1
- package/dist/lib/val/ConjunctVal.d.ts +12 -0
- package/dist/lib/val/ConjunctVal.js +191 -0
- package/dist/lib/val/ConjunctVal.js.map +1 -0
- package/dist/lib/val/DisjunctVal.d.ts +12 -0
- package/dist/lib/val/DisjunctVal.js +85 -0
- package/dist/lib/val/DisjunctVal.js.map +1 -0
- package/dist/lib/val/ListVal.d.ts +14 -0
- package/dist/lib/val/ListVal.js +91 -0
- package/dist/lib/val/ListVal.js.map +1 -0
- package/dist/lib/val/MapVal.d.ts +14 -0
- package/dist/lib/val/MapVal.js +141 -0
- package/dist/lib/val/MapVal.js.map +1 -0
- package/dist/lib/val/Nil.d.ts +15 -0
- package/dist/lib/val/Nil.js +54 -0
- package/dist/lib/val/Nil.js.map +1 -0
- package/dist/lib/val/PrefVal.d.ts +12 -0
- package/dist/lib/val/PrefVal.js +60 -0
- package/dist/lib/val/PrefVal.js.map +1 -0
- package/dist/lib/val/RefVal.d.ts +15 -0
- package/dist/lib/val/RefVal.js +73 -0
- package/dist/lib/val/RefVal.js.map +1 -0
- package/dist/lib/val/ValBase.d.ts +22 -0
- package/dist/lib/val/ValBase.js +25 -0
- package/dist/lib/val/ValBase.js.map +1 -0
- package/dist/lib/val.d.ts +5 -92
- package/dist/lib/val.js +13 -609
- package/dist/lib/val.js.map +1 -1
- package/lib/lang.ts +55 -48
- package/lib/op/disjunct.ts +14 -8
- package/lib/op/op.ts +2 -1
- package/lib/op/unite.ts +14 -12
- package/lib/type.ts +104 -0
- package/lib/unify.ts +10 -8
- package/lib/val/ConjunctVal.ts +284 -0
- package/lib/val/DisjunctVal.ts +145 -0
- package/lib/val/ListVal.ts +154 -0
- package/lib/val/MapVal.ts +226 -0
- package/lib/val/Nil.ts +94 -0
- package/lib/val/PrefVal.ts +113 -0
- package/lib/val/RefVal.ts +126 -0
- package/lib/val/RefVal.ts~ +319 -0
- package/lib/val/ValBase.ts +76 -0
- package/lib/val.ts +15 -825
- package/package.json +21 -17
- package/lib/common.ts +0 -19
package/aontu.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/* Copyright (c) 2021-2022 Richard Rodger, MIT License */
|
|
2
2
|
|
|
3
|
-
import { Options } from './lib/
|
|
3
|
+
import type { Val, Options } from './lib/type'
|
|
4
|
+
|
|
4
5
|
import { Lang, includeFileResolver } from './lib/lang'
|
|
5
6
|
import { Unify } from './lib/unify'
|
|
6
|
-
import {
|
|
7
|
+
import { Nil } from './lib/val/Nil'
|
|
7
8
|
|
|
8
9
|
// FIX: multisource file loading within Conjuct fails
|
|
9
10
|
|
package/dist/aontu.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Options } from './lib/
|
|
1
|
+
import type { Val, Options } from './lib/type';
|
|
2
2
|
import { Lang } from './lib/lang';
|
|
3
|
-
import {
|
|
3
|
+
import { Nil } from './lib/val/Nil';
|
|
4
4
|
declare function Aontu(src: string | Partial<Options>, popts?: Partial<Options>): Val;
|
|
5
5
|
declare const util: {
|
|
6
6
|
options: (src: string | Partial<Options>, popts?: Partial<Options>) => Options;
|
package/dist/aontu.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Copyright (c) 2021-2022 Richard Rodger, MIT License */
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.util = exports.Lang = exports.Nil = exports.
|
|
4
|
+
exports.util = exports.Lang = exports.Nil = exports.Aontu = void 0;
|
|
5
5
|
const lang_1 = require("./lib/lang");
|
|
6
6
|
Object.defineProperty(exports, "Lang", { enumerable: true, get: function () { return lang_1.Lang; } });
|
|
7
7
|
const unify_1 = require("./lib/unify");
|
|
8
|
-
const
|
|
9
|
-
Object.defineProperty(exports, "
|
|
10
|
-
Object.defineProperty(exports, "Nil", { enumerable: true, get: function () { return val_1.Nil; } });
|
|
8
|
+
const Nil_1 = require("./lib/val/Nil");
|
|
9
|
+
Object.defineProperty(exports, "Nil", { enumerable: true, get: function () { return Nil_1.Nil; } });
|
|
11
10
|
// FIX: multisource file loading within Conjuct fails
|
|
12
11
|
// TODO: propogate property path and url properly over unification, and multisource
|
|
13
12
|
/*
|
package/dist/aontu.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aontu.js","sourceRoot":"","sources":["../aontu.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;
|
|
1
|
+
{"version":3,"file":"aontu.js","sourceRoot":"","sources":["../aontu.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAIzD,qCAAsD;AAsE5B,qFAtEjB,WAAI,OAsEiB;AArE9B,uCAAmC;AACnC,uCAAmC;AAoEd,oFApEZ,SAAG,OAoEY;AAlExB,qDAAqD;AAErD,mFAAmF;AAEnF;;;;;EAKE;AAEF,wBAAwB;AAExB,sBAAsB;AACtB,gDAAgD;AAEhD,wCAAwC;AACxC,uBAAuB;AACvB,uBAAuB;AACvB,uBAAuB;AACvB,uBAAuB;AACvB,eAAe;AACf,kBAAkB;AAClB,KAAK;AAEL;;;GAGG;AACH,SAAS,KAAK,CAAC,GAA8B,EAAE,KAAwB;IACrE,IAAI,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;IAEnC,IAAI,IAAI,GAAG,IAAI,WAAI,CAAC,IAAI,CAAC,CAAA;IACzB,IAAI,IAAI,GAAG,EAAE,CAAA;IACb,IAAI,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAA;IAC9C,IAAI,GAAG,GAAG,IAAI,aAAK,CAAC,GAAqB,CAAC,CAAA;IAC1C,IAAI,GAAG,GAAG,GAAG,CAAC,GAAG,CAAA;IACjB,IAAI,GAAG,GAAG,GAAG,CAAC,GAAG,CAAA;IAEjB,GAAG,CAAC,IAAI,GAAG,IAAI,CAAA;IACf,GAAG,CAAC,GAAG,GAAG,GAAG,CAAA;IAEb,OAAO,GAAG,CAAA;AACZ,CAAC;AAuBQ,sBAAK;AArBd,MAAM,IAAI,GAAG;IACX,OAAO,EAAE,CACP,GAA8B,EAC9B,KAAwB,EACf,EAAE;QACX,mDAAmD;QACnD,IAAI,OAAO,GAAqB,QAAQ,KAAK,OAAO,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAA;QAEvE,IAAI,IAAI,GAAY;YAClB,GAAG;gBACD,GAAG,EAAE,EAAE;gBACP,KAAK,EAAE,CAAC;gBACR,QAAQ,EAAE,0BAAmB;aAC9B;YACD,GAAG,OAAO;YACV,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;SACjB,CAAA;QACD,OAAO,IAAI,CAAA;IACb,CAAC;CACF,CAAA;AAE+B,oBAAI;AACpC,kBAAe,KAAK,CAAA"}
|
package/dist/aontu.min.js
CHANGED
|
@@ -1,63 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/* Copyright (c) 2021 Richard Rodger, MIT License */
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.util = exports.Lang = exports.Nil = exports.Val = exports.Aontu = void 0;
|
|
5
|
-
const lang_1 = require("./lib/lang");
|
|
6
|
-
Object.defineProperty(exports, "Lang", { enumerable: true, get: function () { return lang_1.Lang; } });
|
|
7
|
-
const unify_1 = require("./lib/unify");
|
|
8
|
-
const val_1 = require("./lib/val");
|
|
9
|
-
Object.defineProperty(exports, "Val", { enumerable: true, get: function () { return val_1.Val; } });
|
|
10
|
-
Object.defineProperty(exports, "Nil", { enumerable: true, get: function () { return val_1.Nil; } });
|
|
11
|
-
/*
|
|
12
|
-
NEXT:
|
|
13
|
-
inject path from multisource into Vals when created
|
|
14
|
-
report via nil error
|
|
15
|
-
also trace deps into top val and watch via model
|
|
16
|
-
*/
|
|
17
|
-
// TODO: error reporting
|
|
18
|
-
// TODO: debug tracing
|
|
19
|
-
// TODO: providers - e.g source files from paths
|
|
20
|
-
// const NoResolver: Resolver = () => ({
|
|
21
|
-
// kind: '<no-kind>',
|
|
22
|
-
// path: '<no-path>',
|
|
23
|
-
// full: '<no-full>',
|
|
24
|
-
// base: '<no-base>',
|
|
25
|
-
// abs: true,
|
|
26
|
-
// found: false,
|
|
27
|
-
// })
|
|
28
|
-
/* `Aontu('a:1') => opts={src:'a:1',print:0,...}`
|
|
29
|
-
* `Aontu('a:1',{print:1}) => opts={src:'a:1',print:1,...}`
|
|
30
|
-
* `Aontu({src:'a:1'},{src:'a:2'}) => opts={src:'a:2',print:0,...}`
|
|
31
|
-
*/
|
|
32
|
-
function Aontu(src, popts) {
|
|
33
|
-
let opts = util.options(src, popts);
|
|
34
|
-
let lang = new lang_1.Lang(opts);
|
|
35
|
-
let deps = {};
|
|
36
|
-
let val = lang.parse(opts.src, { deps: deps });
|
|
37
|
-
let uni = new unify_1.Unify(val);
|
|
38
|
-
let res = uni.res;
|
|
39
|
-
let err = uni.err;
|
|
40
|
-
res.deps = deps;
|
|
41
|
-
res.err = err;
|
|
42
|
-
return res;
|
|
43
|
-
}
|
|
44
|
-
exports.Aontu = Aontu;
|
|
45
|
-
const util = {
|
|
46
|
-
options: (src, popts) => {
|
|
47
|
-
// Convert convenience first param into Options.src
|
|
48
|
-
let srcopts = 'string' === typeof src ? { src } : src;
|
|
49
|
-
let opts = {
|
|
50
|
-
...{
|
|
51
|
-
src: '',
|
|
52
|
-
print: 0,
|
|
53
|
-
resolver: lang_1.includeFileResolver,
|
|
54
|
-
},
|
|
55
|
-
...srcopts,
|
|
56
|
-
...(popts || {}),
|
|
57
|
-
};
|
|
58
|
-
return opts;
|
|
59
|
-
},
|
|
60
|
-
};
|
|
61
|
-
exports.util = util;
|
|
62
|
-
exports.default = Aontu;
|
|
63
|
-
//# sourceMappingURL=aontu.js.map
|
|
1
|
+
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Aontu=e()}}((function(){var define,module,exports,createModuleFactory=function(e){var t;return function(n){return t||e(t={exports:{},parent:n},t.exports),t.exports}},_$lang_2=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.includeFileResolver=t.Site=t.Lang=void 0;const n=_$multisource_20({}),r=_$type_6({}),i=_$ConjunctVal_9({}),o=_$DisjunctVal_10({}),l=_$MapVal_12({}),s=_$ListVal_11({}),a=_$PrefVal_14({}),c=_$RefVal_15({}),u=_$Nil_13({}),p=_$val_8({});t.Site=class{constructor(e){this.row=-1,this.col=-1,this.url="",this.row=e.row,this.col=e.col,this.url=e.url}};let d=function(e){e.use(_$pathMin_25.Path);let t=(e,t)=>(e.path=[...t||[]],e);e.options({value:{map:{string:{val:e=>t(new p.ScalarTypeVal(String),e.keep.path)},number:{val:e=>t(new p.ScalarTypeVal(Number),e.keep.path)},integer:{val:e=>t(new p.ScalarTypeVal(p.Integer),e.keep.path)},boolean:{val:e=>t(new p.ScalarTypeVal(Boolean),e.keep.path)},nil:{val:e=>t(new u.Nil("literal"),e.keep.path)},top:{val:()=>r.TOP}}},map:{merge:(e,n)=>{let r=e,o=n;return t(new i.ConjunctVal([r,o]),e.path)}}});let n={"conjunct-infix":(e,n,r)=>t(new i.ConjunctVal(r),e.keep.path),"disjunct-infix":(e,n,r)=>t(new o.DisjunctVal(r),e.keep.path),"dot-prefix":(e,n,r)=>t(new c.RefVal(r,!0),e.keep.path),"dot-infix":(e,n,r)=>t(new c.RefVal(r),e.keep.path),"star-prefix":(e,n,r)=>t(new a.PrefVal(r[0]),e.keep.path)};e.use(_$exprMin_18.Expr,{op:{conjunct:{infix:!0,src:"&",left:14e3,right:15e3},disjunct:{infix:!0,src:"|",left:16e3,right:17e3},"dot-infix":{src:".",infix:!0,left:15e6,right:14e6},"dot-prefix":{src:".",prefix:!0,right:14e6},star:{src:"*",prefix:!0,right:14e6}},evaluate:(e,t,r)=>n[t.name](e,t,r)});let d=e.token["#E&"],f=e.token.CL;e.rule("val",e=>(e.open([{s:[d,f],p:"map",b:2,g:"spread"}]).bc((e,n)=>{let r=e.node,i=typeof r;"string"===i?r=t(new p.StringVal(e.node),e.keep.path):"number"===i?r=Number.isInteger(e.node)?t(new p.IntegerVal(e.node),e.keep.path):t(new p.NumberVal(e.node),e.keep.path):"boolean"===i&&(r=t(new p.BooleanVal(e.node),e.keep.path));let o=e.o0;r.row=o.rI,r.col=o.cI,r.url=n.meta.multisource&&n.meta.multisource.path,e.node=r}),e)),e.rule("map",e=>(e.open([{s:[d,f],p:"pair",b:2,g:"spread"}]).bc(e=>{e.node=t(new l.MapVal(e.node),e.keep.path)}),e)),e.rule("list",e=>(e.bc(e=>{e.node=t(new s.ListVal(e.node),e.keep.path)}),e)),e.rule("pair",e=>(e.open([{s:[d,f],p:"val",u:{spread:!0},g:"spread"}]).bc(e=>{e.use.spread&&(e.node[l.MapVal.SPREAD]=e.node[l.MapVal.SPREAD]||{o:e.o0.src,v:[]},e.node[l.MapVal.SPREAD].v.push(e.child.node))}),e)),e.rule("elem",e=>(e.open([{s:[d,f],p:"val",u:{spread:!0},g:"spread"}]).bc(e=>{e.use.spread&&(e.node[s.ListVal.SPREAD]=e.node[s.ListVal.SPREAD]||{o:e.o0.src,v:[]},e.node[s.ListVal.SPREAD].v.push(e.child.node))}),e))};const f=(0,_$file_23.makeFileResolver)(e=>"string"==typeof e?e:null==e?void 0:e.peg);t.includeFileResolver=f,t.Lang=class{constructor(e){this.options={src:"",print:-1},this.options=Object.assign({},this.options,e),this.jsonic=_$jsonicMin_19.Jsonic.make().use(d).use(n.MultiSource,{resolver:(null==e?void 0:e.resolver)||f})}parse(e,t){let n={multisource:{path:this.options.base,deps:t&&t.deps||void 0}};return t&&null!=t.log&&Number.isInteger(t.log)&&(n.log=t.log),this.jsonic(e,n)}}})),_$ListVal_11=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ListVal=void 0;const n=_$type_6({}),r=_$op_4({}),i=_$Nil_13({}),o=_$ValBase_16({}),l=_$ConjunctVal_9({});class s extends o.ValBase{constructor(e,t){super(e,t),this.spread={cj:void 0};let n=this.peg[s.SPREAD];delete this.peg[s.SPREAD],n&&"&"===n.o&&(this.spread.cj=new l.ConjunctVal(Array.isArray(n.v)?n.v:[n.v],t))}unify(e,t){let o=!0,a=n.TOP===e?this:new s([],t);a.spread.cj=this.spread.cj,e instanceof s&&(a.spread.cj=null==a.spread.cj?e.spread.cj:null==e.spread.cj?a.spread.cj:a.spread.cj=new l.ConjunctVal([a.spread.cj,e.spread.cj],t)),a.done=this.done+1,this.spread.cj&&(a.spread.cj=n.DONE!==this.spread.cj.done?(0,r.unite)(t,this.spread.cj):this.spread.cj);let c=a.spread.cj||n.TOP;for(let i in this.peg)a.peg[i]=(0,r.unite)(t.descend(i),this.peg[i],c),o=o&&n.DONE===a.peg[i].done;if(e instanceof s){let l=(0,r.unite)(t,e);for(let e in l.peg){let s=l.peg[e],u=a.peg[e],p=a.peg[e]=void 0===u?s:u instanceof i.Nil?u:s instanceof i.Nil?s:(0,r.unite)(t.descend(e),u,s);this.spread.cj&&(a.peg[e]=(0,r.unite)(t,a.peg[e],c)),o=o&&n.DONE===p.done}}else if(n.TOP!==e)return i.Nil.make(t,"map",this,e);return a.done=o?n.DONE:a.done,a}get canon(){let e=Object.keys(this.peg);return"["+(this.spread.cj?"&:"+this.spread.cj.canon+(0<e.length?",":""):"")+e.map(e=>[this.peg[e].canon]).join(",")+"]"}gen(e){return this.peg.map(t=>t.gen(e))}}t.ListVal=s,s.SPREAD=Symbol("spread")})),_$ConjunctVal_9=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConjunctVal=t.norm=void 0;const n=_$type_6({}),r=_$ValBase_16({}),i=_$Nil_13({}),o=_$MapVal_12({}),l=_$op_4({});class s extends r.ValBase{constructor(e,t){super(e,t)}append(e){return this.peg.push(e),this}unify(e,t){let r=!0,c=[];for(let o=0;o<this.peg.length;o++)if(c[o]=(0,l.unite)(t,this.peg[o],e),r=r&&n.DONE===c[o].done,c[o]instanceof i.Nil)return i.Nil.make(t,"&peer["+c[o].canon+","+e.canon+"]",this.peg[o],e);c=a(c);let u,p,d=[];e:for(let a=0;a<c.length;a++){let e=c[a];if(n.DONE!==e.done){let r=(0,l.unite)(t,e,n.TOP);if(!(n.DONE===r.done||r instanceof o.MapVal)){d.push(r);continue e}e=r}let p=c[a+1];if(null==p)d.push(e);else{if(u=(0,l.unite)(t,e,p),r=r&&n.DONE===u.done,u instanceof s)e.id===u.peg[0].id&&(u=e);else if(u instanceof i.Nil)return u;d.push(u),a++}}return(p=0===d.length?n.TOP:1===d.length?d[0]:new s(d,t)).done=r?n.DONE:this.done+1,p}get canon(){return this.peg.map(e=>e.canon).join("&")}gen(e){if(0<this.peg.length){let t=this.peg[0],n=void 0;return void 0===t||t instanceof i.Nil||(n=t.gen(e)),n}}}function a(e){let t=[];for(let n=0,r=0;n<e.length;n++,r++)e[n]instanceof s?(t.push(...e[n].peg),r+=e[n].peg.length-1):t[r]=e[n];return t}t.ConjunctVal=s,t.norm=a})),_$MapVal_12=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MapVal=void 0;const n=_$type_6({}),r=_$op_4({}),i=_$ValBase_16({}),o=_$Nil_13({}),l=_$ConjunctVal_9({});class s extends i.ValBase{constructor(e,t){super(e,t),this.spread={cj:void 0};let n=this.peg[s.SPREAD];delete this.peg[s.SPREAD],n&&"&"===n.o&&(this.spread.cj=new l.ConjunctVal(Array.isArray(n.v)?n.v:[n.v],t))}unify(e,t){null==t&&console.trace();let i=!0,a=n.TOP===e?this:new s({},t);a.spread.cj=this.spread.cj,e instanceof s&&(a.spread.cj=null==a.spread.cj?e.spread.cj:null==e.spread.cj?a.spread.cj:a.spread.cj=new l.ConjunctVal([a.spread.cj,e.spread.cj],t)),a.done=this.done+1,this.spread.cj&&(a.spread.cj=n.DONE!==this.spread.cj.done?(0,r.unite)(t,this.spread.cj):this.spread.cj);let c=a.spread.cj||n.TOP;for(let o in this.peg)a.peg[o]=(0,r.unite)(t.descend(o),this.peg[o],c),i=i&&n.DONE===a.peg[o].done;if(e instanceof s){let l=(0,r.unite)(t,e);for(let e in l.peg){let s=l.peg[e],u=a.peg[e],p=a.peg[e]=void 0===u?s:u instanceof o.Nil?u:s instanceof o.Nil?s:(0,r.unite)(t.descend(e),u,s);this.spread.cj&&(a.peg[e]=(0,r.unite)(t,a.peg[e],c)),i=i&&n.DONE===p.done,o.Nil}}else if(n.TOP!==e)return o.Nil.make(t,"map",this,e);return a.done=i?n.DONE:a.done,a}get canon(){let e=Object.keys(this.peg);return"{"+(this.spread.cj?"&:"+this.spread.cj.canon+(0<e.length?",":""):"")+e.map(e=>[JSON.stringify(e)+":"+this.peg[e].canon]).join(",")+"}"}gen(e){let t={};for(let n in this.peg)t[n]=this.peg[n].gen(e);return t}}t.MapVal=s,s.SPREAD=Symbol("spread")})),_$op_4=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unite=t.disjunct=void 0;const n=_$disjunct_3({});Object.defineProperty(t,"disjunct",{enumerable:!0,get:function(){return n.disjunct}});const r=_$unite_5({});Object.defineProperty(t,"unite",{enumerable:!0,get:function(){return r.unite}})})),_$unite_5=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unite=void 0;const n=_$type_6({}),r=_$ConjunctVal_9({}),i=_$DisjunctVal_10({}),o=_$PrefVal_14({}),l=_$RefVal_15({}),s=_$Nil_13({});function a(e,t){return e}t.unite=(e,t,c,u)=>{let p=t;if(!c||n.TOP!==t&&t)if(!t||n.TOP!==c&&c){if(t&&c&&n.TOP!==c)if(t instanceof s.Nil)p=a(t);else if(c instanceof s.Nil)p=a(c);else{if(c instanceof r.ConjunctVal||c instanceof i.DisjunctVal||c instanceof l.RefVal||c instanceof o.PrefVal)return c.unify(t,e);p=t.constructor===c.constructor&&t.peg===c.peg?a(t):t.unify(c,e)}}else p=t;else p=c;return p&&p.unify||(p=s.Nil.make(e,"unite",t,c)),n.DONE!==p.done&&(p=p.unify(n.TOP,e)),p}})),_$RefVal_15=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RefVal=void 0;const n=_$type_6({}),r=_$op_4({}),i=_$Nil_13({}),o=_$ValBase_16({}),l=_$ConjunctVal_9({}),s=_$val_8({});class a extends o.ValBase{constructor(e,t){super(""),this.sep=".",this.absolute=!0===t,this.parts=[];for(let n of e)this.append(n)}append(e){"string"==typeof e?this.parts.push(e):e instanceof s.StringVal?this.parts.push(e.peg):e instanceof a&&(this.parts.push(...e.parts),e.absolute&&(this.absolute=!0)),this.peg=(this.absolute?this.sep:"")+this.parts.join(this.sep)}unify(e,t){let o,s=null==t?this:t.find(this);return(s=null==s&&999<this.done?i.Nil.make(t,"no-path",this,e):s||this)instanceof a?n.TOP===e?o=this:e instanceof i.Nil?o=i.Nil.make(t,"ref["+this.peg+"]",this,e):(this.done=n.DONE===this.done?n.DONE:this.done+1,o=new l.ConjunctVal([this,e],t)):o=(0,r.unite)(t,s,e),o.done=n.DONE===o.done?n.DONE:this.done+1,o}same(e){return null!=e&&this.peg===e.peg}get canon(){return this.peg}gen(e){}}t.RefVal=a})),_$val_8=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IntegerVal=t.BooleanVal=t.StringVal=t.NumberVal=t.ScalarTypeVal=t.Integer=void 0;const n=_$type_6({}),r=_$unify_7({}),i=_$Nil_13({}),o=_$ValBase_16({});class l{}t.Integer=l;class s extends o.ValBase{constructor(e,t){super(e,t),this.done=n.DONE}unify(e,t){if(e instanceof a)return e.type===this.peg||Number===this.peg&&l===e.type?e:i.Nil.make(t,"no-scalar-unify",this,e);if(e instanceof s){if(Number===this.peg&&l===e.peg)return e;if(Number===e.peg&&l===this.peg)return this}return i.Nil.make(t,"scalar-type",this,e)}get canon(){return this.peg.name.toLowerCase()}same(e){return e instanceof s?this.peg===e.peg:super.same(e)}gen(e){}}t.ScalarTypeVal=s;class a extends o.ValBase{constructor(e,t,r){super(e,r),this.type=t,this.done=n.DONE}unify(e,t){return e instanceof s?e.unify(this,t):i.Nil.make(t,"scalar",this,e)}get canon(){return this.peg.toString()}same(e){return e instanceof a?e.peg===this.peg:super.same(e)}gen(e){return this.peg}}t.NumberVal=class extends a{constructor(e,t){super(e,Number,t)}unify(e,t){return e instanceof a&&e.type===l?e:super.unify(e,t)}},t.IntegerVal=class extends a{constructor(e,t){if(!Number.isInteger(e))throw new Error("not-integer");super(e,l,t)}unify(e,t){return e instanceof s&&e.peg===Number||e instanceof a&&e.type===Number&&this.peg===e.peg?this:super.unify(e,t)}},t.StringVal=class extends a{constructor(e,t){super(e,String,t)}unify(e,t){return super.unify(e,t)}get canon(){return JSON.stringify(this.peg)}};class c extends a{constructor(e,t){super(e,Boolean,t)}unify(e,t){return super.unify(e,t)}}t.BooleanVal=c,c.TRUE=new c(!0,new r.Context({vc:1,root:n.TOP})),c.FALSE=new c(!1,new r.Context({vc:2,root:n.TOP}))})),_$unify_7=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Unify=t.Context=void 0;const n=_$type_6({}),r=_$lang_2({}),i=_$op_4({}),o=_$MapVal_12({});class l{constructor(e){this.root=e.root,this.path=[],this.err=e.err||[],this.vc=null==e.vc?1e9:e.vc}clone(e){return new l({root:e.root||this.root,err:e.err||this.err,vc:this.vc})}descend(e){return this.clone({root:this.root,path:this.path.concat(e)})}find(e){if(this.root instanceof o.MapVal&&e.absolute){let t=this.root,n=0;for(;n<e.parts.length&&t instanceof o.MapVal;n++){let r=e.parts[n];t=t.peg[r]}if(n===e.parts.length)return t}}}t.Context=l,t.Unify=class{constructor(e,t){this.lang=t||new r.Lang,"string"==typeof e&&(e=this.lang.parse(e)),this.root=e,this.res=e,this.err=[];let o=e,s=new l({root:o,err:this.err});for(this.dc=0;this.dc<999&&n.DONE!==o.done;this.dc++)o=(0,i.unite)(s,o,n.TOP),s=s.clone({root:o});this.res=o}}})),_$disjunct_3=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.disjunct=void 0;const n=_$DisjunctVal_10({});_$ValBase_16({}),t.disjunct=(e,t,r)=>new n.DisjunctVal([],e,[])})),_$DisjunctVal_10=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DisjunctVal=void 0;const n=_$type_6({}),r=_$op_4({}),i=_$ValBase_16({}),o=_$Nil_13({}),l=_$PrefVal_14({});class s extends i.ValBase{constructor(e,t,n){super(e,t)}append(e){return this.peg.push(e),this}unify(e,t){let i,l=!0,a=[];for(let o=0;o<this.peg.length;o++)a[o]=(0,r.unite)(t,this.peg[o],e),l=l&&n.DONE===a[o].done;if(1<a.length){for(let t=0;t<a.length;t++)a[t]instanceof s&&a.splice(t,1,...a[t].peg);let e=new o.Nil;for(let t=0;t<a.length;t++)for(let n=t+1;n<a.length;n++)a[n].same(a[t])&&(a[n]=e);a=a.filter(e=>!(e instanceof o.Nil))}if(1==a.length)i=a[0];else{if(0==a.length)return o.Nil.make(t,"|:empty",this);i=new s(a,t)}return i.done=l?n.DONE:this.done+1,i}get canon(){return this.peg.map(e=>e.canon).join("|")}gen(e){if(0<this.peg.length){let t=this.peg.filter(e=>e instanceof l.PrefVal),n=(t=0===t.length?this.peg:t)[0];for(let r=1;r<this.peg.length;r++)n=n.unify(this.peg[r],e);return n.gen(e)}}}t.DisjunctVal=s})),_$PrefVal_14=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PrefVal=void 0;const n=_$type_6({}),r=_$op_4({}),i=_$Nil_13({}),o=_$ValBase_16({});class l extends o.ValBase{constructor(e,t,n){super(e,n),this.pref=t||e}unify(e,t){let o,s=!0;return o=e instanceof l?new l((0,r.unite)(t,this.peg,e.peg,"Pref000"),(0,r.unite)(t,this.pref,e.pref,"Pref010"),t):new l((0,r.unite)(null==t?void 0:t.clone({err:[]}),this.peg,e,"Pref020"),(0,r.unite)(null==t?void 0:t.clone({err:[]}),this.pref,e,"Pref030"),t),s=s&&n.DONE===o.peg.done&&(null==o.pref||n.DONE===o.pref.done),o.peg instanceof i.Nil?o=o.pref:o.pref instanceof i.Nil&&(o=o.peg),o.done=s?n.DONE:this.done+1,o}same(e){if(null==e)return!1;let t=this.peg===e.peg||this.peg instanceof o.ValBase&&this.peg.same(e.peg),n=e instanceof l&&(this.pref===e.pref||this.pref instanceof o.ValBase&&this.pref.same(e.pref));return t&&n}get canon(){return this.pref instanceof i.Nil?this.peg.canon:"*"+this.pref.canon}gen(e){let t=this.pref instanceof i.Nil?this.peg instanceof i.Nil?void 0:this.peg:this.pref;return void 0===t?void 0:t.gen(e)}}t.PrefVal=l})),_$Nil_13=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Nil=void 0;const n=_$type_6({}),r=_$ValBase_16({});class i extends r.ValBase{constructor(e,t){super(null,t),this.nil=!0,this.why=e,this.done=n.DONE}unify(e,t){return this}get canon(){return"nil"}gen(e){}}t.Nil=i,i.make=(e,t,n,r)=>{let o=new i(t,e);return null!=n&&(o.row=n.row,o.col=n.col,o.url=n.url,o.primary=n,null!=r)&&(o.secondary=r,o.url===r.url&&(o.row<r.row||o.row===r.row&&o.col<r.col)&&(o.row=r.row,o.col=r.col,o.url=r.url,o.primary=r,o.secondary=n)),e&&e.err.push(o),o}})),_$ValBase_16=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValBase=void 0;const n=_$lang_2({});t.ValBase=class{constructor(e,t){this.done=0,this.row=-1,this.col=-1,this.url="",this.peg=e,this.path=t&&t.path||[],this.id=t&&t.vc++||9e9+Math.floor(1e9*Math.random())}same(e){return null!=e&&this.id===e.id}get site(){return new n.Site(this)}}})),_$type_6=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TOP=t.DONE=void 0;const n=_$lang_2({});t.DONE=-1;const r={id:0,top:!0,peg:void 0,done:-1,path:[],row:-1,col:-1,url:"",unify:(e,t)=>e,get canon(){return"top"},get site(){return new n.Site(this)},same:e=>r===e,gen:e=>{}};t.TOP=r})),_$multisource_20=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TOP=t.NONE=t.resolvePathSpec=t.MultiSource=void 0;const n=_$jsonic_22({});t.NONE="";const r=Symbol("TOP");t.TOP=r;const i=(e,t)=>{const n=t.markchar,r=t.resolver,i=t.processor,o=t.implictExt||[];for(let s=0;s<o.length;s++){let e=o[s];o[s]=e.startsWith(".")?e:"."+e}e.options({error:{multisource_not_found:"source not found: $path"},hint:{multisource_not_found:"The source path $path was not found."}});let l={name:"multisource",open:n,action:function(n,o){var l;let s=n.child.node,a=r(s,t,n,o,e);if(!a.found)return null===(l=n.parent)||void 0===l?void 0:l.o0.bad("multisource_not_found",{...a});a.kind=null==a.kind?"":a.kind,(i[a.kind]||i[""])(a,t,n,o,e),n.node=a.val}};e.use(_$directiveMin_17.Directive,l)};function o(e){return t=>t.val=e(t.src,t)}t.MultiSource=i;const l=o(e=>e),s=o(e=>null==e?void 0:JSON.parse(e)),a=(0,n.makeJsonicProcessor)(),c=(0,_$js_21.makeJavaScriptProcessor)();i.defaults={markchar:"@",processor:{"":l,jsonic:a,jsc:a,json:s,js:c},implictExt:["jsonic","jsc","json","js"]},t.resolvePathSpec=function(e,t,n,r){var i;let o=null===(i=t.meta)||void 0===i?void 0:i.multisource,l=r(null==o||null==o.path?e.path:o.path),s="string"==typeof n?n:null!=n.path?""+n.path:void 0,a=!(!(null==s?void 0:s.startsWith("/"))&&!(null==s?void 0:s.startsWith("\\"))),c=a?s:null!=s&&""!=s?null!=l&&""!=l?l+"/"+s:s:void 0;return{kind:null==c?"":(c.match(/\.([^.]*)$/)||["",""])[1],path:s,full:c,base:l,abs:a,found:!1}}})),_$jsonic_22=createModuleFactory((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeJsonicProcessor=void 0;const n=_$multisource_20({});t.makeJsonicProcessor=function(){return function(e,t,r,i,o){var l;if(null!=e.src&&null!=e.full){let t=(null===(l=i.meta)||void 0===l?void 0:l.multisource)||{},r={...i.meta||{},multisource:{...t,path:e.full}};if(e.val=o(e.src,r),t.deps){let r=t.deps,i=t.path||n.TOP;if(null!=i){let t={tar:i,src:e.full,wen:Date.now()};r[i]=r[i]||{},r[i][e.full]=t}}}}}})),_$jsonicMin_19={exports:{}};(function(e){(function(){!function(t){"object"==typeof _$jsonicMin_19.exports?_$jsonicMin_19.exports=t():"function"==typeof define&&define.amd?define([],t):("undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:this).Jsonic=t()}((function(){var e=function(e){var t;return function(n){return t||e(t={exports:{},parent:n},t.exports),t.exports}},t=e((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.values=t.keys=t.omap=t.str=t.prop=t.normalt=t.parserwrap=t.trimstk=t.tokenize=t.srcfmt=t.snip=t.regexp=t.mesc=t.makelog=t.isarr=t.filterRules=t.extract=t.escre=t.errinject=t.errdesc=t.entries=t.defprop=t.deep=t.configure=t.clone=t.clean=t.charset=t.badlex=t.assign=t.S=t.JsonicError=void 0;const i=n({}),o=e=>null==e?[]:Object.keys(e);t.keys=o,t.values=e=>null==e?[]:Object.values(e),t.entries=e=>null==e?[]:Object.entries(e);const l=(e,...t)=>Object.assign(null==e?{}:e,...t);t.assign=l,t.isarr=e=>Array.isArray(e);const s=Object.defineProperty;t.defprop=s;const a=(e,t)=>Object.entries(e||{}).reduce((e,n)=>{let r=t?t(n):n;void 0===r[0]?delete e[n[0]]:e[r[0]]=r[1];let i=2;for(;void 0!==r[i];)e[r[i]]=r[i+1],i+=2;return e},{});t.omap=a;const c={indent:" ",space:" ",Object:"Object",Array:"Array",object:"object",string:"string",function:"function",unexpected:"unexpected",map:"map",list:"list",elem:"elem",pair:"pair",val:"val",node:"node",no_re_flags:r.EMPTY,unprintable:"unprintable",invalid_ascii:"invalid_ascii",invalid_unicode:"invalid_unicode",invalid_lex_state:"invalid_lex_state",unterminated_string:"unterminated_string",unterminated_comment:"unterminated_comment",lex:"lex",parse:"parse",error:"error",none:"none",imp_map:"imp,map",imp_list:"imp,list",imp_null:"imp,null",end:"end",open:"open",close:"close",rule:"rule",stack:"stack",nUll:"null",name:"name",make:"make"};t.S=c;class u extends SyntaxError{constructor(e,t,n,r,i){let o=x(e,t=h({},t),n,r,i);super(o.message),l(this,o),g(this)}toJSON(){return{...this,__error:!0,name:this.name,message:this.message,stack:this.stack}}}function p(e,t,n){let i=t.t,o=i[e];return null==o&&r.STRING===typeof e&&(i[o=t.tI++]=e,i[e]=o,i[e.substring(1)]=o,null!=n&&l(n.token,t.t)),o}function d(e,...t){return new RegExp(t.map(e=>e.esc?f(e.toString()):e).join(r.EMPTY),null==e?"":e)}function f(e){return null==e?"":e.replace(/[-\\|\]{}()[^$+*?.!=]/g,"\\$&").replace(/\t/g,"\\t").replace(/\r/g,"\\r").replace(/\n/g,"\\n")}function h(e,...t){let n=c.function===typeof e,r=null!=e&&(c.object===typeof e||n);for(let i of t){let t,o=c.function===typeof i,l=null!=i&&(c.object===typeof i||o);if(r&&l&&!o&&Array.isArray(e)===Array.isArray(i))for(let n in i)e[n]=h(e[n],i[n]);else e=void 0===i?e:o?i:l?c.function===typeof(t=i.constructor)&&c.Object!==t.name&&c.Array!==t.name?i:h(Array.isArray(i)?[]:{},i):i,n=c.function===typeof e,r=null!=e&&(c.object===typeof e||n)}return e}function m(e,t,n,r,i,o){let l={code:t,details:n,token:r,rule:i,ctx:o};return null==e?"":e.replace(/\$([\w_]+)/g,(e,t)=>{let s=JSON.stringify(null!=l[t]?l[t]:null!=n[t]?n[t]:o.meta&&null!=o.meta[t]?o.meta[t]:null!=r[t]?r[t]:null!=i[t]?i[t]:null!=o.opts[t]?o.opts[t]:null!=o.cfg[t]?o.cfg[t]:null!=o[t]?o[t]:"$"+t);return null==s?"":s})}function g(e){e.stack&&(e.stack=e.stack.split("\n").filter(e=>!e.includes("jsonic/jsonic")).map(e=>e.replace(/ at /,"at ")).join("\n"))}function v(e,t,n){let i=0<n.sI?n.sI:0,o=0<n.rI?n.rI:1,l=0<n.cI?n.cI:1,s=null==n.src?r.EMPTY:n.src,a=e.substring(Math.max(0,i-333),i).split("\n"),c=e.substring(i,i+333).split("\n"),u=2+(r.EMPTY+(o+2)).length,p=o<3?1:o-2,d=e=>"\x1b[34m"+(r.EMPTY+p++).padStart(u," ")+" | \x1b[0m"+(null==e?r.EMPTY:e),f=a.length;return[2<f?d(a[f-3]):null,1<f?d(a[f-2]):null,d(a[f-1]+c[0])," ".repeat(u)+" "+" ".repeat(l-1)+"\x1b[31m"+"^".repeat(s.length||1)+" "+t+"\x1b[0m",d(c[1]),d(c[2])].filter(e=>null!=e).join("\n")}function x(e,t,n,r,i){try{let o=i.cfg,l=i.meta,s=m(o.error[e]||o.error.unknown,e,t,n,r,i);c.function===typeof o.hint&&(o.hint={...o.hint(),...o.hint});let a=["\x1b[31m[jsonic/"+e+"]:\x1b[0m "+s," \x1b[34m--\x3e\x1b[0m "+(l&&l.fileName||"<no-file>")+":"+n.rI+":"+n.cI,v(i.src(),s,n),"",m((o.hint[e]||o.hint.unknown||"").trim().split("\n").map(e=>" "+e).join("\n"),e,t,n,r,i),""," \x1b[2mhttps://jsonic.senecajs.org\x1b[0m"," \x1b[2m--internal: rule="+r.name+"~"+r.state+"; token="+p(n.tin,i.cfg)+(null==n.why?"":"~"+n.why)+"; plugins="+i.plgn().map(e=>e.name).join(",")+"--\x1b[0m\n"].join("\n"),u={internal:{token:n,ctx:i}};return u={...Object.create(u),message:a,code:e,details:t,meta:l,fileName:l?l.fileName:void 0,lineNumber:n.rI,columnNumber:n.cI}}catch(o){return console.log(o),{}}}function k(e){return"function"==typeof e.debug.print.src?e.debug.print.src:(t,n)=>null==t?r.EMPTY:(n=JSON.stringify(t)).substring(0,e.debug.maxlen)+(e.debug.maxlen<n.length?"...":r.EMPTY)}function _(e,t=44){let n;try{n="object"==typeof e?JSON.stringify(e):""+e}catch(r){n=""+e}return b(t<n.length?n.substring(0,t-3)+"...":n,t)}function b(e,t=5){return void 0===e?"":(""+e).substring(0,t).replace(/[\r\n\t]/g,".")}function y(...e){return null==e?{}:e.filter(e=>!1!==e).map(e=>"object"==typeof e?o(e).join(r.EMPTY):e).join(r.EMPTY).split(r.EMPTY).reduce((e,t)=>(e[t]=t.charCodeAt(0),e),{})}function j(e){for(let t in e)null==e[t]&&delete e[t];return e}t.JsonicError=u,t.configure=function(e,t,n){var r,i,s,c,u,h,m,g,v,x,k,_,b,O,E,S,M,N,T,P,I,w,C,$,A,R,V,L,F,D,Y,B,U,J,z,Z,q,K,W;const G=t||{};G.t=G.t||{},G.tI=G.tI||1;const H=e=>p(e,G);!1!==n.standard$&&(H("#BD"),H("#ZZ"),H("#UK"),H("#AA"),H("#SP"),H("#LN"),H("#CM"),H("#NR"),H("#ST"),H("#TX"),H("#VL")),G.fixed={lex:!!(null===(r=n.fixed)||void 0===r?void 0:r.lex),token:n.fixed?a(j(n.fixed.token),([e,t])=>[t,p(e,G)]):{},ref:void 0},G.fixed.ref=a(G.fixed.token,([e,t])=>[e,t]),G.fixed.ref=Object.assign(G.fixed.ref,a(G.fixed.ref,([e,t])=>[t,e])),G.tokenSet=n.tokenSet?Object.keys(n.tokenSet).reduce((e,t)=>(e[t]=n.tokenSet[t].filter(e=>null!=e).map(e=>H(e)),e),{...G.tokenSet}):{},G.tokenSetDerived={ignore:Object.fromEntries(((null===(i=n.tokenSet)||void 0===i?void 0:i.ignore)||[]).map(e=>[H(e),!0]))},G.space={lex:!!(null===(s=n.space)||void 0===s?void 0:s.lex),chars:y(null===(c=n.space)||void 0===c?void 0:c.chars)},G.line={lex:!!(null===(u=n.line)||void 0===u?void 0:u.lex),chars:y(null===(h=n.line)||void 0===h?void 0:h.chars),rowChars:y(null===(m=n.line)||void 0===m?void 0:m.rowChars)},G.text={lex:!!(null===(g=n.text)||void 0===g?void 0:g.lex),modify:((null===(v=G.text)||void 0===v?void 0:v.modify)||[]).concat(([null===(x=n.text)||void 0===x?void 0:x.modify]||[]).flat()).filter(e=>null!=e)},G.number={lex:!!(null===(k=n.number)||void 0===k?void 0:k.lex),hex:!!(null===(_=n.number)||void 0===_?void 0:_.hex),oct:!!(null===(b=n.number)||void 0===b?void 0:b.oct),bin:!!(null===(O=n.number)||void 0===O?void 0:O.bin),sep:null!=(null===(E=n.number)||void 0===E?void 0:E.sep)&&""!==n.number.sep,exclude:null===(S=n.number)||void 0===S?void 0:S.exclude,sepChar:null===(M=n.number)||void 0===M?void 0:M.sep},G.value={lex:!!(null===(N=n.value)||void 0===N?void 0:N.lex),map:(null===(T=n.value)||void 0===T?void 0:T.map)||{}},G.rule={start:null==(null===(P=n.rule)||void 0===P?void 0:P.start)?"val":n.rule.start,maxmul:null==(null===(I=n.rule)||void 0===I?void 0:I.maxmul)?3:n.rule.maxmul,finish:!!(null===(w=n.rule)||void 0===w?void 0:w.finish),include:(null===(C=n.rule)||void 0===C?void 0:C.include)?n.rule.include.split(/\s*,+\s*/).filter(e=>""!==e):[],exclude:(null===($=n.rule)||void 0===$?void 0:$.exclude)?n.rule.exclude.split(/\s*,+\s*/).filter(e=>""!==e):[]},G.map={extend:!!(null===(A=n.map)||void 0===A?void 0:A.extend),merge:null===(R=n.map)||void 0===R?void 0:R.merge},G.list={property:!!(null===(V=n.list)||void 0===V?void 0:V.property)};let Q=Object.keys(G.fixed.token).sort((e,t)=>t.length-e.length).map(e=>f(e)).join("|"),X=(null===(L=n.comment)||void 0===L?void 0:L.lex)?(n.comment.marker||[]).filter(e=>e.lex).map(e=>f(e.start)).join("|"):"",ee=["([",f(o(y(G.space.lex&&G.space.chars,G.line.lex&&G.line.chars)).join("")),"]",("string"==typeof n.ender?n.ender.split(""):Array.isArray(n.ender)?n.ender:[]).map(e=>"|"+f(e)).join(""),""===Q?"":"|",Q,""===X?"":"|",X,"|$)"];return G.rePart={fixed:Q,ender:ee,commentStart:X},G.re={ender:d(null,...ee),rowChars:d(null,f(null===(F=n.line)||void 0===F?void 0:F.rowChars)),columns:d(null,"["+f(null===(D=n.line)||void 0===D?void 0:D.chars)+"]","(.*)$")},G.lex={empty:!!(null===(Y=n.lex)||void 0===Y?void 0:Y.empty),match:(null===(B=n.lex)||void 0===B?void 0:B.match)?n.lex.match.map(e=>e(G,n)):[]},G.debug={get_console:(null===(U=n.debug)||void 0===U?void 0:U.get_console)||(()=>console),maxlen:null==(null===(J=n.debug)||void 0===J?void 0:J.maxlen)?99:n.debug.maxlen,print:{config:!!(null===(Z=null===(z=n.debug)||void 0===z?void 0:z.print)||void 0===Z?void 0:Z.config),src:null===(K=null===(q=n.debug)||void 0===q?void 0:q.print)||void 0===K?void 0:K.src}},G.error=n.error||{},G.hint=n.hint||{},(null===(W=n.config)||void 0===W?void 0:W.modify)&&o(n.config.modify).forEach(e=>n.config.modify[e](G,n)),G.debug.print.config&&G.debug.get_console().dir(G,{depth:null}),G.result={fail:[]},n.result&&(G.result.fail=[...n.result.fail]),l(e.options,n),l(e.token,G.t),l(e.fixed,G.fixed.ref),G},t.tokenize=p,t.mesc=function(e,t){return(t=new String(e)).esc=!0,t},t.regexp=d,t.escre=f,t.deep=h,t.errinject=m,t.trimstk=g,t.extract=v,t.errdesc=x,t.badlex=function(e,t,n){let r=r=>{let i=e.next(r);if(t===i.tin){let e={};throw null!=i.use&&(e.use=i.use),new u(i.why||c.unexpected,e,i,r,n)}return i};return r.src=e.src,r},t.makelog=function(e,t){if(t)if("number"==typeof t.log){let n=!1,r=t.log;-1===r&&(r=1,n=!0),e.log=(...t)=>{if(n){let n=t.filter(e=>c.object!=typeof e).map(e=>c.function==typeof e?e.name:e).join(c.indent);e.cfg.debug.get_console().log(n)}else e.cfg.debug.get_console().dir(t,{depth:r})}}else"function"==typeof t.log&&(e.log=t.log);return e.log},t.srcfmt=k,t.str=_,t.snip=b,t.clone=function(e){return h(Object.create(Object.getPrototypeOf(e)),e)},t.charset=y,t.clean=j,t.filterRules=function(e,t){let n=["open","close"];for(let r of n)e.def[r]=e.def[r].map(e=>(e.g="string"==typeof e.g?(e.g||"").split(/\s*,+\s*/):e.g||[],e)).filter(e=>t.rule.include.reduce((t,n)=>t||null!=e.g&&-1!==e.g.indexOf(n),0===t.rule.include.length)).filter(e=>t.rule.exclude.reduce((t,n)=>t&&(null==e.g||-1===e.g.indexOf(n)),!0));return e},t.normalt=function(e){if(null!=e.c){let t=e.c.n,n=e.c.d;null==t&&null==n||(e.c=function(e){let r=!0;if(null!=t)for(let n in t)r=r&&(null==e.n[n]||e.n[n]<=(null==t[n]?0:t[n]));return null!=n&&(r=r&&e.d<=n),r},null!=t&&(e.c.n=t),null!=n&&(e.c.d=n))}if(r.STRING===typeof e.g&&(e.g=e.g.split(/\s*,\s*/)),e.s&&0!==e.s.length){const t=e=>e.flat().filter(e=>"number"==typeof e),n=(e,t)=>e.filter(e=>31*t<=e&&e<31*(t+1)),r=(e,t)=>e.reduce((e,n)=>1<<n-(31*t+1)|e,0),i=t([e.s[0]]),o=t([e.s[1]]),l=e;l.S0=0<i.length?new Array(Math.max(...i.map(e=>1+e/31|0))).fill(null).map((e,t)=>t).map(e=>r(n(i,e),e)):null,l.S1=0<o.length?new Array(Math.max(...o.map(e=>1+e/31|0))).fill(null).map((e,t)=>t).map(e=>r(n(o,e),e)):null}else e.s=null;return e},t.prop=function(e,t,n){try{let r,i=t.split(".");for(let t=0;t<i.length;t++)r=i[t],t<i.length-1&&(e=e[r]=e[r]||{});return void 0!==n&&(e[r]=n),e[r]}catch(i){throw new Error("Cannot "+(void 0===n?"get":"set")+" path "+t+" on object: "+_(r)+(void 0===n?"":" to value: "+_(n,22)))}},t.parserwrap=function(e){return{start:function(t,n,o,l){try{return e.start(t,n,o,l)}catch(s){if("SyntaxError"===s.name){let l=0,a=0,c=0,d=r.EMPTY,f=s.message.match(/^Unexpected token (.) .*position\s+(\d+)/i);if(f){d=f[1],l=parseInt(f[2]),a=t.substring(0,l).replace(/[^\n]/g,r.EMPTY).length;let e=l-1;for(;-1<e&&"\n"!==t.charAt(e);)e--;c=Math.max(t.substring(e,l).length,0)}let h=s.token||(0,i.makeToken)("#UK",p("#UK",n.internal().config),void 0,d,(0,i.makePoint)(d.length,l,s.lineNumber||a,s.columnNumber||c));throw new u(s.code||"json",s.details||{msg:s.message},h,{},s.ctx||{uI:-1,opts:n.options,cfg:n.internal().config,token:h,meta:o,src:()=>t,root:()=>{},plgn:()=>n.internal().plugins,rule:{name:"no-rule"},xs:-1,v2:h,v1:h,t0:h,t1:h,tC:-1,rs:[],rsI:0,next:()=>h,rsm:{},n:{},log:o?o.log:void 0,F:k(n.internal().config),use:{},NORULE:{name:"no-rule"},NOTOKEN:{name:"no-token"}})}throw s}}}}})),n=e((function(e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.makeTextMatcher=n.makeNumberMatcher=n.makeCommentMatcher=n.makeStringMatcher=n.makeLineMatcher=n.makeSpaceMatcher=n.makeFixedMatcher=n.makeToken=n.makePoint=n.makeLex=n.makeNoToken=void 0;const i=t({});class o{constructor(e,t,n,r){this.len=-1,this.sI=0,this.rI=1,this.cI=1,this.token=[],this.len=e,null!=t&&(this.sI=t),null!=n&&(this.rI=n),null!=r&&(this.cI=r)}toString(){return"Point["+[this.sI+"/"+this.len,this.rI,this.cI]+(0<this.token.length?" "+this.token:"")+"]"}[r.INSPECT](){return this.toString()}}const l=(...e)=>new o(...e);n.makePoint=l;class s{constructor(e,t,n,i,o,l,s){this.isToken=!0,this.name=r.EMPTY,this.tin=-1,this.val=void 0,this.src=r.EMPTY,this.sI=-1,this.rI=-1,this.cI=-1,this.len=-1,this.name=e,this.tin=t,this.src=i,this.val=n,this.sI=o.sI,this.rI=o.rI,this.cI=o.cI,this.use=l,this.why=s,this.len=null==i?0:i.length}resolveVal(e,t){return"function"==typeof this.val?this.val(e,t):this.val}bad(e,t){return this.err=e,null!=t&&(this.use=(0,i.deep)(this.use||{},t)),this}toString(){return"Token["+this.name+"="+this.tin+" "+(0,i.snip)(this.src)+(void 0===this.val||"#ST"===this.name||"#TX"===this.name?"":"="+(0,i.snip)(this.val))+" "+[this.sI,this.rI,this.cI]+(null==this.use?"":" "+(0,i.snip)(""+JSON.stringify(this.use).replace(/"/g,""),22))+(null==this.err?"":" "+this.err)+(null==this.why?"":" "+(0,i.snip)(""+this.why,22))+"]"}[r.INSPECT](){return this.toString()}}const a=(...e)=>new s(...e);function c(e,t,n){let r=e.pnt,i=t;if(e.cfg.fixed.lex&&null!=n&&0<n.length){let o=void 0,l=e.cfg.fixed.token[n];null!=l&&(o=e.token(l,void 0,n,r)),null!=o&&(r.sI+=o.src.length,r.cI+=o.src.length,null==t?i=o:r.token.push(o))}return i}n.makeToken=a,n.makeNoToken=()=>a("",-1,void 0,r.EMPTY,l(-1)),n.makeFixedMatcher=(e,t)=>{let n=(0,i.regexp)(null,"^(",e.rePart.fixed,")");return function(t){let r=e.fixed;if(!r.lex)return;let i=t.pnt,o=t.src.substring(i.sI).match(n);if(o){let e=o[1],n=e.length;if(0<n){let o=void 0,l=r.token[e];return null!=l&&(o=t.token(l,void 0,e,i),i.sI+=n,i.cI+=n),o}}}},n.makeCommentMatcher=(e,t)=>{let n=t.comment;e.comment={lex:!!n&&!!n.lex,marker:((null==n?void 0:n.marker)||[]).map(e=>({start:e.start,end:e.end,line:!!e.line,lex:!!e.lex}))};let r=e.comment.lex?e.comment.marker.filter(e=>e.lex&&e.line):[],o=e.comment.lex?e.comment.marker.filter(e=>e.lex&&!e.line):[];return function(t){if(!e.comment.lex)return;let n=t.pnt,l=t.src.substring(n.sI),s=n.rI,a=n.cI;for(let i of r)if(l.startsWith(i.start)){let r=l.length,o=i.start.length;for(a+=i.start.length;o<r&&!e.line.chars[l[o]];)a++,o++;let s=l.substring(0,o),c=t.token("#CM",void 0,s,n);return n.sI+=s.length,n.cI=a,c}for(let r of o)if(l.startsWith(r.start)){let o=l.length,c=r.start.length,u=r.end;for(a+=r.start.length;c<o&&!l.substring(c).startsWith(u);)e.line.rowChars[l[c]]&&(s++,a=0),a++,c++;if(l.substring(c).startsWith(u)){a+=u.length;let e=l.substring(0,c+u.length),r=t.token("#CM",void 0,e,n);return n.sI+=e.length,n.rI=s,n.cI=a,r}return t.bad(i.S.unterminated_comment,n.sI,n.sI+9*r.start.length)}}},n.makeTextMatcher=(e,t)=>{let n=(0,i.regexp)(e.line.lex?null:"s","^(.*?)",...e.rePart.ender);return function(r){let i=e.text,o=r.pnt,l=r.src.substring(o.sI),s=e.value.map,a=l.match(n);if(a){let n=a[1],l=a[2],u=void 0;if(null!=n){let t=n.length;if(0<t){let l=void 0;e.value.lex&&void 0!==(l=s[n])?(u=r.token("#VL",l.val,n,o),o.sI+=t,o.cI+=t):i.lex&&(u=r.token("#TX",n,n,o),o.sI+=t,o.cI+=t)}}if(u&&(u=c(r,u,l)),u&&0<e.text.modify.length){const n=e.text.modify;for(let i=0;i<n.length;i++)u.val=n[i](u.val,r,e,t)}return u}}},n.makeNumberMatcher=(e,t)=>{let n=e.number,r=(0,i.regexp)(null,["^([-+]?(0(",[n.hex?"x[0-9a-fA-F_]+":null,n.oct?"o[0-7_]+":null,n.bin?"b[01_]+":null].filter(e=>null!=e).join("|"),")|[.0-9]+([0-9_]*[0-9])?)","(\\.[0-9]?([0-9_]*[0-9])?)?","([eE][-+]?[0-9]+([0-9_]*[0-9])?)?"].join("").replace(/_/g,n.sep?(0,i.escre)(n.sepChar):""),")",...e.rePart.ender),o=n.sep?(0,i.regexp)("g",(0,i.escre)(n.sepChar)):void 0;return function(t){if(!(n=e.number).lex)return;let i=t.pnt,l=t.src.substring(i.sI),s=e.value.map,a=l.match(r);if(a){let n=a[1],r=a[9],l=void 0,u=!0;if(null!=n&&(u=!e.number.exclude||!n.match(e.number.exclude))){let r=n.length;if(0<r){let a=void 0;if(e.value.lex&&void 0!==(a=s[n]))l=t.token("#VL",a.val,n,i);else{let e=o?n.replace(o,""):n,s=+e;if(isNaN(s)){let t=e[0];"-"!==t&&"+"!==t||(s=("-"===t?-1:1)*+e.substring(1))}isNaN(s)||(l=t.token("#NR",s,n,i),i.sI+=r,i.cI+=r)}}}return u&&(l=c(t,l,r)),l}}},n.makeStringMatcher=(e,t)=>{let n=t.string||{};return e.string=e.string||{},e.string=(0,i.deep)(e.string,{lex:!!(null==n?void 0:n.lex),quoteMap:(0,i.charset)(n.chars),multiChars:(0,i.charset)(n.multiChars),escMap:(0,i.clean)({...n.escape}),escChar:n.escapeChar,escCharCode:null==n.escapeChar?void 0:n.escapeChar.charCodeAt(0),allowUnknown:!!n.allowUnknown,replaceCodeMap:(0,i.omap)((0,i.clean)({...n.replace}),([e,t])=>[e.charCodeAt(0),t]),hasReplace:!1}),e.string.hasReplace=0<(0,i.keys)(e.string.replaceCodeMap).length,function(t){let n=e.string;if(!n.lex)return;let{quoteMap:o,escMap:l,escChar:s,escCharCode:a,multiChars:c,allowUnknown:u,replaceCodeMap:p,hasReplace:d}=n,{pnt:f,src:h}=t,{sI:m,rI:g,cI:v}=f,x=h.length;if(o[h[m]]){const n=h[m],o=m,k=g,_=c[n];++m,++v;let b,y=[];for(;m<x;m++){v++;let r=h[m];if(b=void 0,n===r){m++;break}if(s===r){v++;let e=l[h[++m]];if(null!=e)y.push(e);else if("x"===h[m]){m++;let e=parseInt(h.substring(m,m+2),16);if(isNaN(e))return m-=2,v-=2,f.sI=m,f.cI=v,t.bad(i.S.invalid_ascii,m,m+4);let n=String.fromCharCode(e);y.push(n),m+=1,v+=2}else if("u"===h[m]){let e="{"===h[++m]?(m++,1):0,n=e?6:4,r=parseInt(h.substring(m,m+n),16);if(isNaN(r))return m=m-2-e,v-=2,f.sI=m,f.cI=v,t.bad(i.S.invalid_unicode,m,m+n+2+2*e);let o=String.fromCodePoint(r);y.push(o),m+=n-1+e,v+=n+e}else{if(!u)return f.sI=m,f.cI=v-1,t.bad(i.S.unexpected,m,m+1);y.push(h[m])}}else if(d&&void 0!==(b=p[h.charCodeAt(m)]))y.push(b),v++;else{let r=m,o=n.charCodeAt(0),l=h.charCodeAt(m);for(;(!d||void 0===(b=p[l]))&&m<x&&32<=l&&o!==l&&a!==l;)l=h.charCodeAt(++m),v++;if(v--,void 0===b&&l<32){if(!_||!e.line.chars[h[m]])return f.sI=m,f.cI=v,t.bad(i.S.unprintable,m,m+1);e.line.rowChars[h[m]]&&(f.rI=++g),v=1,y.push(h.substring(r,m+1))}else y.push(h.substring(r,m)),m--}}if(h[m-1]!==n||f.sI===m-1)return f.rI=k,t.bad(i.S.unterminated_string,o,m);const j=t.token("#ST",y.join(r.EMPTY),h.substring(f.sI,m),f);return f.sI=m,f.rI=g,f.cI=v,j}}},n.makeLineMatcher=(e,t)=>function(t){if(!e.line.lex)return;let{chars:n,rowChars:r}=e.line,{pnt:i,src:o}=t,{sI:l,rI:s}=i;for(;n[o[l]];)s+=r[o[l]]?1:0,l++;if(i.sI<l){let e=o.substring(i.sI,l);const n=t.token("#LN",void 0,e,i);return i.sI+=e.length,i.rI=s,i.cI=1,n}},n.makeSpaceMatcher=(e,t)=>function(t){if(!e.space.lex)return;let{chars:n}=e.space,{pnt:r,src:i}=t,{sI:o,cI:l}=r;for(;n[i[o]];)o++,l++;if(r.sI<o){let e=i.substring(r.sI,o);const n=t.token("#SP",void 0,e,r);return r.sI+=e.length,r.cI=l,n}};class u{constructor(e){this.src=r.EMPTY,this.ctx={},this.cfg={},this.pnt=l(-1),this.ctx=e,this.src=e.src(),this.cfg=e.cfg,this.pnt=l(this.src.length)}token(e,t,n,r,o,l){let s,c;return"string"==typeof e?(c=e,s=(0,i.tokenize)(c,this.cfg)):(s=e,c=(0,i.tokenize)(e,this.cfg)),a(c,s,t,n,r||this.pnt,o,l)}next(e){let t,n,r=this.pnt,o=r.sI;if(r.end)t=r.end;else if(0<r.token.length)t=r.token.shift();else if(r.len<=r.sI)r.end=this.token("#ZZ",void 0,"",r),t=r.end;else{for(let r of this.cfg.lex.match)if(t=r(this,e)){n=r;break}t=t||this.token("#BD",void 0,this.src[r.sI],r,void 0,"unexpected")}return this.ctx.log&&this.ctx.log(i.S.indent.repeat(e.d)+i.S.lex,(0,i.tokenize)(t.tin,this.cfg),this.ctx.F(t.src),r.sI,r.rI+":"+r.cI,(null==n?void 0:n.name)||"none",this.ctx.F(this.src.substring(o,o+16))),t}tokenize(e){return(0,i.tokenize)(e,this.cfg)}bad(e,t,n){return this.token("#BD",void 0,0<=t&&t<=n?this.src.substring(t,n):this.src[this.pnt.sI],void 0,void 0,e)}}n.makeLex=(...e)=>new u(...e)})),r={};Object.defineProperty(r,"__esModule",{value:!0}),r.STRING=r.INSPECT=r.EMPTY=r.AFTER=r.BEFORE=r.CLOSE=r.OPEN=void 0,r.OPEN="o",r.CLOSE="c",r.BEFORE="b",r.AFTER="a",r.EMPTY="",r.INSPECT=Symbol.for("nodejs.util.inspect.custom"),r.STRING="string";var i={};Object.defineProperty(i,"__esModule",{value:!0}),i.defaults=void 0;const o=n({}),l={tag:"-",fixed:{lex:!0,token:{"#OB":"{","#CB":"}","#OS":"[","#CS":"]","#CL":":","#CA":","}},tokenSet:{ignore:["#SP","#LN","#CM"],val:["#TX","#NR","#ST","#VL"],key:["#TX","#NR","#ST","#VL"]},space:{lex:!0,chars:" \t"},line:{lex:!0,chars:"\r\n",rowChars:"\n"},text:{lex:!0},number:{lex:!0,hex:!0,oct:!0,bin:!0,sep:"_",exclude:void 0},comment:{lex:!0,marker:[{line:!0,start:"#",lex:!0},{line:!0,start:"//",lex:!0},{line:!1,start:"/*",end:"*/",lex:!0}]},string:{lex:!0,chars:"'\"`",multiChars:"`",escapeChar:"\\",escape:{b:"\b",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v",'"':'"',"'":"'","`":"`","\\":"\\","/":"/"},allowUnknown:!0},map:{extend:!0,merge:void 0},list:{property:!0},value:{lex:!0,map:{true:{val:!0},false:{val:!1},null:{val:null}}},ender:[],plugin:{},debug:{get_console:()=>console,maxlen:99,print:{config:!1,src:void 0}},error:{unknown:"unknown error: $code",unexpected:"unexpected character(s): $src",invalid_unicode:"invalid unicode escape: $src",invalid_ascii:"invalid ascii escape: $src",unprintable:"unprintable character: $src",unterminated_string:"unterminated string: $src",unterminated_comment:"unterminated comment: $src",unknown_rule:"unknown rule: $rulename"},hint:function(e=((e,t="replace")=>e[t](/[A-Z]/g,e=>" "+e.toLowerCase())[t](/[~%][a-z]/g,e=>("~"==e[0]?" ":"")+e[1].toUpperCase())),t="~sinceTheErrorIsUnknown,ThisIsProbablyABugInsideJsonic\nitself,OrAPlugin.~pleaseConsiderPostingAGithubIssue -Thanks!\n\n~code: $code,~details: \n$details|~theCharacter(s) $srcWereNotExpectedAtThisPointAsTheyDoNot\nmatchTheExpectedSyntax,EvenUnderTheRelaxedJsonicRules.~ifIt\nisNotObviouslyWrong,TheActualSyntaxErrorMayBeElsewhere.~try\ncommentingOutLargerAreasAroundThisPointUntilYouGetNoErrors,\nthenRemoveTheCommentsInSmallSectionsUntilYouFindThe\noffendingSyntax.~n%o%t%e:~alsoCheckIfAnyPluginsYouAreUsing\nexpectDifferentSyntaxInThisCase.|~theEscapeSequence $srcDoesNotEncodeAValidUnicodeCodePoint\nnumber.~youMayNeedToValidateYourStringDataManuallyUsingTest\ncodeToSeeHow~javaScriptWillInterpretIt.~alsoConsiderThatYour\ndataMayHaveBecomeCorrupted,OrTheEscapeSequenceHasNotBeen\ngeneratedCorrectly.|~theEscapeSequence $srcDoesNotEncodeAValid~a%s%c%i%iCharacter.~you\nmayNeedToValidateYourStringDataManuallyUsingTestCodeToSee\nhow~javaScriptWillInterpretIt.~alsoConsiderThatYourDataMay\nhaveBecomeCorrupted,OrTheEscapeSequenceHasNotBeenGenerated\ncorrectly.|~stringValuesCannotContainUnprintableCharacters (characterCodes\nbelow 32).~theCharacter $srcIsUnprintable.~youMayNeedToRemove\ntheseCharactersFromYourSourceData.~alsoCheckThatItHasNot\nbecomeCorrupted.|~thisStringHasNoEndQuote.|~thisCommentIsNeverClosed.|~noRuleNamed $rulenameIsDefined.~thisIsProbablyAnErrorInThe\ngrammarOfAPlugin.".split("|")){return"unknown|unexpected|invalid_unicode|invalid_ascii|unprintable|unterminated_string|unterminated_comment|unknown_rule".split("|").reduce((n,r,i)=>(n[r]=e(t[i]),n),{})},lex:{match:[o.makeFixedMatcher,o.makeSpaceMatcher,o.makeLineMatcher,o.makeStringMatcher,o.makeCommentMatcher,o.makeNumberMatcher,o.makeTextMatcher],empty:!0},rule:{start:"val",finish:!0,maxmul:3,include:"",exclude:""},result:{fail:[]},config:{modify:{}},parser:{start:void 0}};i.defaults=l;var s={};Object.defineProperty(s,"__esModule",{value:!0}),s.Parser=s.makeRuleSpec=s.makeRule=void 0;const a=t({}),c=n({});class u{constructor(e,t,n){this.id=-1,this.name=r.EMPTY,this.node=null,this.state=r.OPEN,this.n=Object.create(null),this.d=-1,this.use=Object.create(null),this.keep=Object.create(null),this.bo=!1,this.ao=!1,this.bc=!1,this.ac=!1,this.os=0,this.cs=0,this.id=t.uI++,this.name=e.name,this.spec=e,this.child=t.NORULE,this.parent=t.NORULE,this.prev=t.NORULE,this.o0=t.NOTOKEN,this.o1=t.NOTOKEN,this.c0=t.NOTOKEN,this.c1=t.NOTOKEN,this.node=n,this.d=t.rsI,this.bo=null!=e.def.bo,this.ao=null!=e.def.ao,this.bc=null!=e.def.bc,this.ac=null!=e.def.ac}process(e){return this.spec.process(this,e,this.state)}}const p=(...e)=>new u(...e);s.makeRule=p;class d{constructor(){this.p=r.EMPTY,this.r=r.EMPTY,this.b=0}}const f=(...e)=>new d(...e),h=f(),m=f();class g{constructor(e,t){this.name=r.EMPTY,this.def={open:[],close:[],bo:[],bc:[],ao:[],ac:[]},this.cfg=e,this.def=Object.assign(this.def,t),this.def.open=(this.def.open||[]).filter(e=>null!=e),this.def.close=(this.def.close||[]).filter(e=>null!=e);for(let n of[...this.def.open,...this.def.close])(0,a.normalt)(n)}tin(e){return(0,a.tokenize)(e,this.cfg)}add(e,t,n){let r=(null==n?void 0:n.append)?"push":"unshift",i=((0,a.isarr)(t)?t:[t]).filter(e=>null!=e&&"object"==typeof e).map(e=>(0,a.normalt)(e)),o="o"===e?"open":"close",l=this.def[o];if(l[r](...i),n){if(n.delete)for(let e=0;e<n.delete.length;e++)l[(l.length+n.delete[e])%l.length]=null;if(n.move)for(let e=0;e<n.move.length;e+=2){let t=(l.length+n.move[e])%l.length,r=(l.length+n.move[e+1])%l.length,i=l[t];l.splice(t,1),l.splice(r,0,i)}this.def[o]=l.filter(e=>null!=e)}return(0,a.filterRules)(this,this.cfg),this}open(e,t){return this.add("o",e,t)}close(e,t){return this.add("c",e,t)}action(e,t,n,r){let i=this.def[t+n];return e?i.push(r):i.unshift(r),this}bo(e,t){return this.action(!t||!!e,r.BEFORE,r.OPEN,t||e)}ao(e,t){return this.action(!t||!!e,r.AFTER,r.OPEN,t||e)}bc(e,t){return this.action(!t||!!e,r.BEFORE,r.CLOSE,t||e)}ac(e,t){return this.action(!t||!!e,r.AFTER,r.CLOSE,t||e)}clear(){return this.def.open.length=0,this.def.close.length=0,this.def.bo.length=0,this.def.ao.length=0,this.def.bc.length=0,this.def.ac.length=0,this}process(e,t,n){let i=r.EMPTY,o=t.F,l="o"===n,s=l?e:t.NORULE,c=this.def,u=l?c.open:c.close,d=l?e.bo?c.bo:null:e.bc?c.bc:null;if(d){let n=void 0;for(let r=0;r<d.length;r++)if((null==(n=d[r].call(this,e,t,s,n))?void 0:n.isToken)&&(null==n?void 0:n.err))return this.bad(n,e,t,{is_open:l})}let f=0<u.length?this.parse_alts(l,u,e,t):m;if(f.h&&(f=f.h(e,t,f,s)||f,i+="H"),f.e)return this.bad(f.e,e,t,{is_open:l});if(f.n)for(let r in f.n)e.n[r]=0===f.n[r]?0:(null==e.n[r]?0:e.n[r])+f.n[r];if(f.u&&(e.use=Object.assign(e.use,f.u)),f.k&&(e.keep=Object.assign(e.keep,f.k)),f.a){i+="A";let n=f.a.call(this,e,t,f);if(n&&n.isToken&&n.err)return this.bad(n,e,t,{is_open:l})}if(f.p){t.rs[t.rsI++]=e;let n=t.rsm[f.p];if(!n)return this.bad(this.unknownRule(t.t0,f.p),e,t,{is_open:l});(s=e.child=p(n,t,e.node)).parent=e,s.n={...e.n},0<Object.keys(e.keep).length&&(s.keep={...e.keep}),i+="@p:"+f.p}else if(f.r){let n=t.rsm[f.r];if(!n)return this.bad(this.unknownRule(t.t0,f.r),e,t,{is_open:l});(s=p(n,t,e.node)).parent=e.parent,s.prev=e,s.n={...e.n},0<Object.keys(e.keep).length&&(s.keep={...e.keep}),i+="@r:"+f.r}else l||(s=t.rs[--t.rsI]||t.NORULE),i+="Z";let h=l?e.ao?c.ao:null:e.ac?c.ac:null;if(h){let n=void 0;for(let r=0;r<h.length;r++)if((null==(n=h[r].call(this,e,t,s,n))?void 0:n.isToken)&&(null==n?void 0:n.err))return this.bad(n,e,t,{is_open:l})}s.why=i,t.log&&t.log(a.S.indent.repeat(e.d)+a.S.node+a.S.space,e.state.toUpperCase(),(e.prev.id+"/"+e.parent.id+"/"+e.child.id).padEnd(12),e.name+"~"+e.id,"w="+i,"n:"+(0,a.entries)(e.n).filter(e=>e[1]).map(e=>e[0]+"="+e[1]).join(";"),"u:"+(0,a.entries)(e.use).map(e=>e[0]+"="+e[1]).join(";"),"k:"+(0,a.entries)(e.keep).map(e=>e[0]+"="+e[1]).join(";"),"<"+o(e.node)+">");let g=0,v=e[l?"os":"cs"]-(f.b||0);for(;g++<v;)t.next();return r.OPEN===e.state&&(e.state=r.CLOSE),s}parse_alts(e,t,n,i){let o=h;o.b=0,o.p=r.EMPTY,o.r=r.EMPTY,o.n=void 0,o.h=void 0,o.a=void 0,o.u=void 0,o.k=void 0,o.e=void 0;let l,s=null,c=0,u=i.cfg.t,p=1<<u.AA-1,d=t.length;for(c=0;c<d;c++){s=t[c];let r=i.t0.tin,a=!1,u=!1;if(l=!0,s.S0&&(a=!0,(l=s.S0[r/31|0]&(1<<r%31-1|p))&&(u=null!=s.S1,s.S1))){u=!0;let e=i.t1.tin;l=s.S1[e/31|0]&(1<<e%31-1|p)}if(e?(n.o0=a?i.t0:i.NOTOKEN,n.o1=u?i.t1:i.NOTOKEN,n.os=(a?1:0)+(u?1:0)):(n.c0=a?i.t0:i.NOTOKEN,n.c1=u?i.t1:i.NOTOKEN,n.cs=(a?1:0)+(u?1:0)),l&&s.c&&(l=l&&s.c(n,i,o)),l)break;s=null}l||u.ZZ===i.t0.tin||(o.e=i.t0),s&&(o.n=null!=s.n?s.n:o.n,o.h=null!=s.h?s.h:o.h,o.a=null!=s.a?s.a:o.a,o.u=null!=s.u?s.u:o.u,o.k=null!=s.k?s.k:o.k,o.g=null!=s.g?s.g:o.g,o.e=s.e&&s.e(n,i,o)||void 0,o.p=null!=s.p?"string"==typeof s.p?s.p:s.p(n,i,o):o.p,o.r=null!=s.r?"string"==typeof s.r?s.r:s.r(n,i,o):o.r,o.b=null!=s.b?"number"==typeof s.b?s.b:s.b(n,i,o):o.b);let f=c<t.length;return i.log&&i.log(a.S.indent.repeat(n.d)+a.S.parse,n.state.toUpperCase(),(n.prev.id+"/"+n.parent.id+"/"+n.child.id).padEnd(12),n.name+"~"+n.id,f?"alt="+c:"no-alt",f&&o.g?"g:"+o.g+" ":"",(f&&o.p?"p:"+o.p+" ":"")+(f&&o.r?"r:"+o.r+" ":"")+(f&&o.b?"b:"+o.b+" ":""),(r.OPEN===n.state?[n.o0,n.o1].slice(0,n.os):[n.c0,n.c1].slice(0,n.cs)).map(e=>e.name+"="+i.F(e.src)).join(" "),"c:"+(s&&s.c?l:r.EMPTY),"n:"+(0,a.entries)(o.n).map(e=>e[0]+"="+e[1]).join(";"),"u:"+(0,a.entries)(o.u).map(e=>e[0]+"="+e[1]).join(";"),"k:"+(0,a.entries)(o.k).map(e=>e[0]+"="+e[1]).join(";"),c<t.length&&s.s?"["+s.s.map(e=>Array.isArray(e)?e.map(e=>u[e]).join("|"):u[e]).join(" ")+"]":"[]",o),o}bad(e,t,n,r){throw new a.JsonicError(e.err||a.S.unexpected,{...e.use,state:r.is_open?a.S.open:a.S.close},e,t,n)}unknownRule(e,t){return e.err="unknown_rule",e.use=e.use||{},e.use.rulename=t,e}}const v=(...e)=>new g(...e);s.makeRuleSpec=v;class x{constructor(e,t){this.rsm={},this.options=e,this.cfg=t}rule(e,t){if(null==e)return this.rsm;let n=this.rsm[e];if(null===t)delete this.rsm[e];else if(void 0!==t){n=this.rsm[e]=this.rsm[e]||v(this.cfg,{}),(n=this.rsm[e]=t(this.rsm[e],this.rsm)||this.rsm[e]).name=e;for(let e of[...n.def.open,...n.def.close])(0,a.normalt)(e);return}return n}start(e,t,n,i){let o,l=(0,c.makeToken)("#ZZ",(0,a.tokenize)("#ZZ",this.cfg),void 0,r.EMPTY,(0,c.makePoint)(-1)),s=(0,c.makeNoToken)(),u={uI:0,opts:this.options,cfg:this.cfg,meta:n||{},src:()=>e,root:()=>o.node,plgn:()=>t.internal().plugins,rule:{},xs:-1,v2:l,v1:l,t0:l,t1:l,tC:-2,next:_,rs:[],rsI:0,rsm:this.rsm,log:void 0,F:(0,a.srcfmt)(this.cfg),use:{},NOTOKEN:s,NORULE:{}},d=(e=>p(v(e.cfg,{}),e))(u=(0,a.deep)(u,i));if(u.NORULE=d,u.rule=d,(0,a.makelog)(u,n),""===e){if(this.cfg.lex.empty)return;throw new a.JsonicError(a.S.unexpected,{src:e},u.t0,d,u)}let f=e=>(0,a.tokenize)(e,this.cfg),h=(0,a.badlex)((0,c.makeLex)(u),(0,a.tokenize)("#BD",this.cfg),u),m=this.rsm[this.cfg.rule.start];if(null==m)return;let g=p(m,u);o=g;let x=2*(0,a.keys)(this.rsm).length*h.src.length*2*u.cfg.rule.maxmul,k=u.cfg.tokenSetDerived.ignore;function _(){let e;u.v2=u.v1,u.v1=u.t0,u.t0=u.t1;do{e=h(g),u.tC++}while(k[e.tin]);return u.t1=e,u.t0}_(),_();let b=0;for(;d!==g&&b<x;)u.log&&u.log("\n"+a.S.indent.repeat(g.d)+a.S.stack,u.rs.slice(0,u.rsI).map(e=>e.name+"~"+e.id).join("/"),"<<"+u.F(o.node)+">>",u.rs.slice(0,u.rsI).map(e=>"<"+u.F(e.node)+">").join(" "),g,u),u.log&&u.log(a.S.indent.repeat(g.d)+a.S.rule+a.S.space,g.state.toUpperCase(),(g.prev.id+"/"+g.parent.id+"/"+g.child.id).padEnd(12),g.name+"~"+g.id,"["+u.F(u.t0.src)+" "+u.F(u.t1.src)+"]","n:"+(0,a.entries)(g.n).filter(e=>e[1]).map(e=>e[0]+"="+e[1]).join(";"),"u:"+(0,a.entries)(g.use).map(e=>e[0]+"="+e[1]).join(";"),"k:"+(0,a.entries)(g.keep).map(e=>e[0]+"="+e[1]).join(";"),"["+f(u.t0.tin)+" "+f(u.t1.tin)+"]",g,u),u.rule=g,g=g.process(u),b++;if((0,a.tokenize)("#ZZ",this.cfg)!==u.t0.tin)throw new a.JsonicError(a.S.unexpected,{},u.t0,d,u);const y=u.root();if(this.cfg.result.fail.includes(y))throw new a.JsonicError(a.S.unexpected,{},u.t0,d,u);return y}clone(e,t){let n=new x(e,t);return n.rsm=Object.keys(this.rsm).reduce((e,t)=>(e[t]=(0,a.filterRules)(this.rsm[t],this.cfg),e),{}),n}}s.Parser=x;var k={};function _(e){const t=e.token.OB,n=e.token.CB,r=e.token.OS,i=e.token.CS,o=e.token.CL,l=e.token.CA,s=e.token.TX,a=e.token.ST,c=e.token.ZZ,u=e.config(),p=u.tokenSet.val,d=u.tokenSet.key,f=e.util.deep,h=(e,t)=>{if(!t.cfg.rule.finish)return t.t0.src="END_OF_SOURCE",t.t0},m=e=>{const t=e.o0,n=a===t.tin||s===t.tin?t.val:t.src;e.use.key=n};e.rule("val",e=>{e.bo(e=>e.node=void 0).open([{s:[t],p:"map",b:1,g:"map,json"},{s:[r],p:"list",b:1,g:"list,json"},{s:[p],g:"val,json"}]).close([{s:[c],g:"end,json"},{b:1,g:"more,json"}]).bc((e,t)=>{e.node=void 0===e.node?void 0===e.child.node?0===e.os?void 0:e.o0.resolveVal(e,t):e.child.node:e.node})}),e.rule("map",e=>{e.bo(e=>{e.node={}}).open([{s:[t,n],g:"map,json"},{s:[t],p:"pair",n:{pk:0},g:"map,json,pair"}])}),e.rule("list",e=>{e.bo(e=>{e.node=[]}).open([{s:[r,i],g:"list,json"},{s:[r],p:"elem",g:"list,elem,json"}])}),e.rule("pair",e=>{e.open([{s:[d,o],p:"val",u:{pair:!0},a:m,g:"map,pair,key,json"}]).bc((e,t)=>{e.use.pair&&(e.use.prev=e.node[e.use.key],e.node[e.use.key]=e.child.node)}).close([{s:[n],g:"map,pair,json"},{s:[l],r:"pair",g:"map,pair,json"},{s:[c],e:h,g:"map,pair,json"}])}),e.rule("elem",e=>{e.open([{p:"val",u:{elem:!0},g:"list,elem,val,json"}]).bc(e=>{e.use.elem&&e.node.push(e.child.node)}).close([{s:[l],r:"elem",g:"list,elem,json"},{s:[i],g:"list,elem,json"},{s:[c],e:h,g:"list,elem,json"}])});const g=(e,t)=>{let n=e.use.key,r=e.child.node;const i=e.use.prev;r=void 0===r?null:r,e.node[n]=null==i?r:t.cfg.map.merge?t.cfg.map.merge(i,r):t.cfg.map.extend?f(i,r):r};e.rule("val",e=>{e.open([{s:[d,o],p:"map",b:2,n:{pk:1},g:"pair,jsonic"},{s:[p],g:"val,json"},{s:[[n,i]],b:1,g:"val,imp,null,jsonic"},{s:[l],c:{n:{il:0}},p:"list",b:1,g:"list,imp,jsonic"},{s:[l],b:1,g:"list,val,imp,null,jsonic"}],{append:!0,delete:[2]}).close([{s:[[n,i]],b:1,g:"val,json,close"},{s:[l],c:{n:{il:0,pk:0}},n:{il:1},r:"elem",a:e=>e.node=[e.node],g:"list,val,imp,comma,jsonic"},{c:{n:{il:0,pk:0}},n:{il:1},r:"elem",a:e=>e.node=[e.node],g:"list,val,imp,space,jsonic",b:1}],{append:!0,move:[1,-1]})}),e.rule("map",e=>{e.bo(e=>{e.n.il=1+(e.n.il?e.n.il:0),e.n.im=1+(e.n.im?e.n.im:0)}).open([{s:[d,o],p:"pair",b:2,g:"pair,list,val,imp"}],{append:!0})}),e.rule("list",e=>{e.bo(e=>{e.n.il=1+(e.n.il?e.n.il:0),e.n.pk=1+(e.n.pk?e.n.pk:0),e.n.im=1+(e.n.im?e.n.im:0)}).open([{s:[l],p:"elem",b:1,g:"list,elem,val,imp"},{p:"elem",g:"list,elem"}],{append:!0})}),e.rule("pair",e=>{e.open([{s:[l],g:"map,pair,comma"}],{append:!0}).bc((e,t)=>{e.use.pair&&g(e,t)}).close([{s:[n],c:{n:{pk:0}},g:"map,pair,json"},{s:[l,n],c:{n:{pk:0}},g:"map,pair,comma,jsonic"},{s:[l],c:{n:{pk:0}},r:"pair",g:"map,pair,json"},{s:[l],c:{n:{im:1}},r:"pair",g:"map,pair,jsonic"},{s:[p],c:{n:{pk:0}},r:"pair",b:1,g:"map,pair,imp,jsonic"},{s:[p],c:{n:{im:1}},r:"pair",b:1,g:"map,pair,imp,jsonic"},{s:[[n,l,...p]],b:1,g:"map,pair,imp,path,jsonic"},{s:[i],b:1,g:"list,pair,imp,jsonic"},{s:[c],e:h,g:"map,pair,json"}],{append:!0,delete:[0,1,2]})}),e.rule("elem",e=>{e.open([{s:[l,l],b:2,a:e=>e.node.push(null),g:"list,elem,imp,null,jsonic"},{s:[l],a:e=>e.node.push(null),g:"list,elem,imp,null,jsonic"},u.list.property&&{s:[d,o],p:"val",n:{pk:1},u:{elem:!1},a:m,g:"elem,pair,jsonic"}]).bc((e,t)=>{!1===e.use.elem&&(e.use.prev=e.node[e.use.key],g(e,t))}).close([{s:[l,i],g:"list,elem,comma.jsonic"},{s:[l],r:"elem",g:"list,elem,json"},{s:[[...p,t,r]],r:"elem",b:1,g:"list,elem,imp,jsonic"},{s:[i],g:"list,elem,json"},{s:[c],e:h,g:"list,elem,json"}],{delete:[-1,-2,-3]})})}Object.defineProperty(k,"__esModule",{value:!0}),k.makeJSON=k.grammar=void 0,k.grammar=_,k.makeJSON=function(e){let t=e.make({grammar$:!1,text:{lex:!1},number:{hex:!1,oct:!1,bin:!1,sep:null,exclude:/^00+/},string:{chars:'"',multiChars:"",allowUnknown:!1,escape:{v:null}},comment:{lex:!1},map:{extend:!1},lex:{empty:!1},rule:{finish:!1,include:"json"},result:{fail:[void 0,NaN]},tokenSet:{key:["#ST",null,null,null]}});return _(t),t};var b={exports:{}};Object.defineProperty(b.exports,"__esModule",{value:!0}),b.exports.AFTER=b.exports.BEFORE=b.exports.CLOSE=b.exports.OPEN=b.exports.makeTextMatcher=b.exports.makeNumberMatcher=b.exports.makeCommentMatcher=b.exports.makeStringMatcher=b.exports.makeLineMatcher=b.exports.makeSpaceMatcher=b.exports.makeFixedMatcher=b.exports.makeLex=b.exports.makeRuleSpec=b.exports.makeRule=b.exports.makePoint=b.exports.makeToken=b.exports.make=b.exports.util=b.exports.Parser=b.exports.JsonicError=b.exports.Jsonic=void 0,Object.defineProperty(b.exports,"OPEN",{enumerable:!0,get:function(){return r.OPEN}}),Object.defineProperty(b.exports,"CLOSE",{enumerable:!0,get:function(){return r.CLOSE}}),Object.defineProperty(b.exports,"BEFORE",{enumerable:!0,get:function(){return r.BEFORE}}),Object.defineProperty(b.exports,"AFTER",{enumerable:!0,get:function(){return r.AFTER}});const y=t({});Object.defineProperty(b.exports,"JsonicError",{enumerable:!0,get:function(){return y.JsonicError}});const j=n({});Object.defineProperty(b.exports,"makePoint",{enumerable:!0,get:function(){return j.makePoint}}),Object.defineProperty(b.exports,"makeToken",{enumerable:!0,get:function(){return j.makeToken}}),Object.defineProperty(b.exports,"makeLex",{enumerable:!0,get:function(){return j.makeLex}}),Object.defineProperty(b.exports,"makeFixedMatcher",{enumerable:!0,get:function(){return j.makeFixedMatcher}}),Object.defineProperty(b.exports,"makeSpaceMatcher",{enumerable:!0,get:function(){return j.makeSpaceMatcher}}),Object.defineProperty(b.exports,"makeLineMatcher",{enumerable:!0,get:function(){return j.makeLineMatcher}}),Object.defineProperty(b.exports,"makeStringMatcher",{enumerable:!0,get:function(){return j.makeStringMatcher}}),Object.defineProperty(b.exports,"makeCommentMatcher",{enumerable:!0,get:function(){return j.makeCommentMatcher}}),Object.defineProperty(b.exports,"makeNumberMatcher",{enumerable:!0,get:function(){return j.makeNumberMatcher}}),Object.defineProperty(b.exports,"makeTextMatcher",{enumerable:!0,get:function(){return j.makeTextMatcher}}),Object.defineProperty(b.exports,"makeRule",{enumerable:!0,get:function(){return s.makeRule}}),Object.defineProperty(b.exports,"makeRuleSpec",{enumerable:!0,get:function(){return s.makeRuleSpec}}),Object.defineProperty(b.exports,"Parser",{enumerable:!0,get:function(){return s.Parser}});const O={tokenize:y.tokenize,srcfmt:y.srcfmt,deep:y.deep,clone:y.clone,charset:y.charset,trimstk:y.trimstk,makelog:y.makelog,badlex:y.badlex,extract:y.extract,errinject:y.errinject,errdesc:y.errdesc,configure:y.configure,parserwrap:y.parserwrap,mesc:y.mesc,escre:y.escre,regexp:y.regexp,prop:y.prop,str:y.str,omap:y.omap,keys:y.keys,values:y.values,entries:y.entries};function E(e,t){if("json"===e)return(0,k.makeJSON)(S);let n={parser:{},config:{},plugins:[],mark:Math.random()},r=(0,y.deep)({},t?{...t.options}:!1===(null==e?void 0:e.defaults$)?{}:i.defaults,e||{}),o=function(e,t,n){var r;if(y.S.string===typeof e){let i=o.internal();return((null===(r=l.parser)||void 0===r?void 0:r.start)?(0,y.parserwrap)(l.parser):i.parser).start(e,o,t,n)}return e},l=e=>{if(null!=e&&y.S.object===typeof e){(0,y.deep)(r,e),(0,y.configure)(o,n.config,r);let t=o.internal().parser;n.parser=t.clone(r,n.config)}return{...o.options}},a={token:e=>(0,y.tokenize)(e,n.config,o),fixed:e=>n.config.fixed.ref[e],options:(0,y.deep)(l,r),config:()=>(0,y.deep)(n.config),parse:o,use:function(e,t){const n=e.name.toLowerCase(),r=(0,y.deep)({},e.defaults||{},t||{});o.options({plugin:{[n]:r}});let i=o.options.plugin[n];return o.internal().plugins.push(e),e(o,i)||o},rule:(e,t)=>o.internal().parser.rule(e,t)||o,lex:e=>{let t=r.lex.match;t.unshift(e),o.options({lex:{match:t}})},make:e=>E(e,o),empty:e=>E({defaults$:!1,standard$:!1,grammar$:!1,...e||{}}),id:"Jsonic/"+Date.now()+"/"+(""+Math.random()).substring(2,8).padEnd(6,"0")+(null==l.tag?"":"/"+l.tag),toString:()=>a.id,util:O};if((0,y.defprop)(a.make,y.S.name,{value:y.S.make}),(0,y.assign)(o,a),(0,y.defprop)(o,"internal",{value:()=>n}),t){for(let n in t)void 0===o[n]&&(o[n]=t[n]);o.parent=t;let e=t.internal();n.config=(0,y.deep)({},e.config),(0,y.configure)(o,n.config,r),(0,y.assign)(o.token,n.config.t),n.plugins=[...e.plugins],n.parser=e.parser.clone(r,n.config)}else n.config=(0,y.configure)(o,void 0,r),n.plugins=[],n.parser=new s.Parser(r,n.config),!1!==r.grammar$&&(0,k.grammar)(o);return o}b.exports.util=O,b.exports.make=E;let S=void 0,M=S=E();return b.exports.Jsonic=M,delete S.options,delete S.use,delete S.rule,delete S.lex,delete S.token,delete S.fixed,S.Jsonic=S,S.JsonicError=y.JsonicError,S.Parser=s.Parser,S.makeLex=j.makeLex,S.makeToken=j.makeToken,S.makePoint=j.makePoint,S.makeRule=s.makeRule,S.makeRuleSpec=s.makeRuleSpec,S.makeFixedMatcher=j.makeFixedMatcher,S.makeSpaceMatcher=j.makeSpaceMatcher,S.makeLineMatcher=j.makeLineMatcher,S.makeStringMatcher=j.makeStringMatcher,S.makeCommentMatcher=j.makeCommentMatcher,S.makeNumberMatcher=j.makeNumberMatcher,S.makeTextMatcher=j.makeTextMatcher,S.util=O,S.make=E,b.exports.default=M,b.exports=b.exports.Jsonic,b.exports}))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),_$jsonicMin_19=_$jsonicMin_19.exports;var _$directiveMin_17={exports:{}};(function(e){(function(){!function(t){"object"==typeof _$directiveMin_17.exports?_$directiveMin_17.exports=t():"function"==typeof define&&define.amd?define([],t):("undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:this).JsonicDirective=t()}((function(){var e={};Object.defineProperty(e,"__esModule",{value:!0}),e.Directive=void 0;const t=(e,t)=>{let n,r=("string"==typeof t.rules?t.rules.split(/\s*,\s*/):t.rules||[]).filter(e=>""!==e),i=t.name,o=t.open,l=t.close;if("string"==typeof t.action){let r=t.action;n=t=>t.node=e.util.prop(e.options,r)}else n=t.action;let s={},a="#D_open_"+i,c="#D_close_"+i,u=e.fixed(o),p=null==l?null:e.fixed(l);if(null!=u)throw new Error("Directive open token already in use: "+o);s[a]=o,null==p&&null!=l&&(s[c]=l),e.options({fixed:{token:s},error:{[i+"_close"]:null==l?null:"directive "+i+' close "'+l+'" without open "'+o+'"'},hint:{[i+"_close"]:null==l?null:`\nThe ${i} directive must start with the characters "${o}" and end\nwith the characters "${l}". The end characters "${l}" may not\nappear without the start characters "${o}" appearing first:\n"${o}...${l}".\n`}});let d=e.token.CA;u=e.fixed(o),p=null==l?null:e.fixed(l),r.forEach(t=>{e.rule(t,e=>(e.open({s:[u],p:i,n:{dr:1}}),null!=l&&(e.open([{s:[p],c:{n:{dr:0}},e:(e,t)=>t.t0.bad(i+"_close")},{s:[p],b:1}]),e.close({s:[p],b:1})),e))}),e.rule(i,e=>e.clear().bo(e=>{e.node={}}).open([{p:"val",n:null==l?{}:{pk:-1,il:0}}]).bc((function(e,t,r,i){let o=n.call(this,e,t,r,i);if(null==o?void 0:o.isToken)return o})).close(null!=l?[{s:[p]},{s:[d,p]}]:[]))};return e.Directive=t,t.defaults={rules:"val,pair,elem"},e}))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),_$directiveMin_17=_$directiveMin_17.exports;var _$js_21={};function makeJavaScriptProcessor(e){const t=t=>{t.val=evaluate(t,e)};return t.opts=e,t}function evaluate(res,opts){let out=void 0;if(!0!==(null==opts?void 0:opts.evalOnly))out=require(res.full);else{let exports=null,module={exports:exports};eval(res.src),out=module.exports}return out}Object.defineProperty(_$js_21,"__esModule",{value:!0}),_$js_21.makeJavaScriptProcessor=void 0,_$js_21.makeJavaScriptProcessor=makeJavaScriptProcessor;var _$_empty_26={},_$browser_28={},cachedSetTimeout,cachedClearTimeout,process=_$browser_28={};function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}function runTimeout(e){if(cachedSetTimeout===setTimeout)return setTimeout(e,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(e,0);try{return cachedSetTimeout(e,0)}catch(t){try{return cachedSetTimeout.call(null,e,0)}catch(t){return cachedSetTimeout.call(this,e,0)}}}!function(){try{cachedSetTimeout="function"==typeof setTimeout?setTimeout:defaultSetTimout}catch(e){cachedSetTimeout=defaultSetTimout}try{cachedClearTimeout="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e){cachedClearTimeout=defaultClearTimeout}}();var currentQueue,queue=[],draining=!1,queueIndex=-1;function cleanUpNextTick(){draining&¤tQueue&&(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var e=runTimeout(cleanUpNextTick);draining=!0;for(var t=queue.length;t;){for(currentQueue=queue,queue=[];++queueIndex<t;)currentQueue&¤tQueue[queueIndex].run();queueIndex=-1,t=queue.length}currentQueue=null,draining=!1,function(e){if(cachedClearTimeout===clearTimeout)return clearTimeout(e);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(e);try{cachedClearTimeout(e)}catch(t){try{return cachedClearTimeout.call(null,e)}catch(t){return cachedClearTimeout.call(this,e)}}}(e)}}function Item(e,t){this.fun=e,this.array=t}function noop(){}process.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];queue.push(new Item(e,t)),1!==queue.length||draining||runTimeout(drainQueue)},Item.prototype.run=function(){this.fun.apply(null,this.array)},process.title="browser",process.browser=!0,process.env={},process.argv=[],process.version="",process.versions={},process.on=noop,process.addListener=noop,process.once=noop,process.off=noop,process.removeListener=noop,process.removeAllListeners=noop,process.emit=noop,process.prependListener=noop,process.prependOnceListener=noop,process.listeners=function(e){return[]},process.binding=function(e){throw new Error("process.binding is not supported")},process.cwd=function(){return"/"},process.chdir=function(e){throw new Error("process.chdir is not supported")},process.umask=function(){return 0};var _$pathBrowserify_27={};(function(e){(function(){"use strict";function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function n(e,t){for(var n,r="",i=0,o=-1,l=0,s=0;s<=e.length;++s){if(s<e.length)n=e.charCodeAt(s);else{if(47===n)break;n=47}if(47===n){if(o===s-1||1===l);else if(o!==s-1&&2===l){if(r.length<2||2!==i||46!==r.charCodeAt(r.length-1)||46!==r.charCodeAt(r.length-2))if(r.length>2){var a=r.lastIndexOf("/");if(a!==r.length-1){-1===a?(r="",i=0):i=(r=r.slice(0,a)).length-1-r.lastIndexOf("/"),o=s,l=0;continue}}else if(2===r.length||1===r.length){r="",i=0,o=s,l=0;continue}t&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+e.slice(o+1,s):r=e.slice(o+1,s),i=s-o-1;o=s,l=0}else 46===n&&-1!==l?++l:l=-1}return r}var r={resolve:function(){for(var r,i="",o=!1,l=arguments.length-1;l>=-1&&!o;l--){var s;l>=0?s=arguments[l]:(void 0===r&&(r=e.cwd()),s=r),t(s),0!==s.length&&(i=s+"/"+i,o=47===s.charCodeAt(0))}return i=n(i,!o),o?i.length>0?"/"+i:"/":i.length>0?i:"."},normalize:function(e){if(t(e),0===e.length)return".";var r=47===e.charCodeAt(0),i=47===e.charCodeAt(e.length-1);return 0!==(e=n(e,!r)).length||r||(e="."),e.length>0&&i&&(e+="/"),r?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,n=0;n<arguments.length;++n){var i=arguments[n];t(i),i.length>0&&(void 0===e?e=i:e+="/"+i)}return void 0===e?".":r.normalize(e)},relative:function(e,n){if(t(e),t(n),e===n)return"";if((e=r.resolve(e))===(n=r.resolve(n)))return"";for(var i=1;i<e.length&&47===e.charCodeAt(i);++i);for(var o=e.length,l=o-i,s=1;s<n.length&&47===n.charCodeAt(s);++s);for(var a=n.length-s,c=l<a?l:a,u=-1,p=0;p<=c;++p){if(p===c){if(a>c){if(47===n.charCodeAt(s+p))return n.slice(s+p+1);if(0===p)return n.slice(s+p)}else l>c&&(47===e.charCodeAt(i+p)?u=p:0===p&&(u=0));break}var d=e.charCodeAt(i+p);if(d!==n.charCodeAt(s+p))break;47===d&&(u=p)}var f="";for(p=i+u+1;p<=o;++p)p!==o&&47!==e.charCodeAt(p)||(0===f.length?f+="..":f+="/..");return f.length>0?f+n.slice(s+u):(s+=u,47===n.charCodeAt(s)&&++s,n.slice(s))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var n=e.charCodeAt(0),r=47===n,i=-1,o=!0,l=e.length-1;l>=1;--l)if(47===(n=e.charCodeAt(l))){if(!o){i=l;break}}else o=!1;return-1===i?r?"/":".":r&&1===i?"//":e.slice(0,i)},basename:function(e,n){if(void 0!==n&&"string"!=typeof n)throw new TypeError('"ext" argument must be a string');t(e);var r,i=0,o=-1,l=!0;if(void 0!==n&&n.length>0&&n.length<=e.length){if(n.length===e.length&&n===e)return"";var s=n.length-1,a=-1;for(r=e.length-1;r>=0;--r){var c=e.charCodeAt(r);if(47===c){if(!l){i=r+1;break}}else-1===a&&(l=!1,a=r+1),s>=0&&(c===n.charCodeAt(s)?-1==--s&&(o=r):(s=-1,o=a))}return i===o?o=a:-1===o&&(o=e.length),e.slice(i,o)}for(r=e.length-1;r>=0;--r)if(47===e.charCodeAt(r)){if(!l){i=r+1;break}}else-1===o&&(l=!1,o=r+1);return-1===o?"":e.slice(i,o)},extname:function(e){t(e);for(var n=-1,r=0,i=-1,o=!0,l=0,s=e.length-1;s>=0;--s){var a=e.charCodeAt(s);if(47!==a)-1===i&&(o=!1,i=s+1),46===a?-1===n?n=s:1!==l&&(l=1):-1!==n&&(l=-1);else if(!o){r=s+1;break}}return-1===n||-1===i||0===l||1===l&&n===i-1&&n===r+1?"":e.slice(n,i)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var n=t.dir||t.root,r=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+r:n+"/"+r:r}(0,e)},parse:function(e){t(e);var n={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return n;var r,i=e.charCodeAt(0),o=47===i;o?(n.root="/",r=1):r=0;for(var l=-1,s=0,a=-1,c=!0,u=e.length-1,p=0;u>=r;--u)if(47!==(i=e.charCodeAt(u)))-1===a&&(c=!1,a=u+1),46===i?-1===l?l=u:1!==p&&(p=1):-1!==l&&(p=-1);else if(!c){s=u+1;break}return-1===l||-1===a||0===p||1===p&&l===a-1&&l===s+1?-1!==a&&(n.base=n.name=0===s&&o?e.slice(1,a):e.slice(s,a)):(0===s&&o?(n.name=e.slice(1,l),n.base=e.slice(1,a)):(n.name=e.slice(s,l),n.base=e.slice(s,a)),n.ext=e.slice(l,a)),s>0?n.dir=e.slice(0,s-1):o&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null};r.posix=r,_$pathBrowserify_27=r}).call(this)}).call(this,_$browser_28);var _$mem_24={};Object.defineProperty(_$mem_24,"__esModule",{value:!0}),_$mem_24.makeMemResolver=_$mem_24.buildPotentials=void 0;const __multisource_1_24=_$multisource_20({});function buildPotentials(e,t,n){let r=e.full,i=[],o=t.implictExt||[];for(let l of o)i.push(r+l);for(let l of o)i.push(n(r,"index"+l));if(null!=e.path){let t=(e.path.replace(/[\\\/]+$/,"").match(/[^\\\/]+$/)||[])[0];if(null!=t)for(let e of o)i.push(n(r,"index."+t+e))}return i}_$mem_24.makeMemResolver=function(e){return function(t,n,r,i){let o=(0,__multisource_1_24.resolvePathSpec)(n,i,t,function(e){return function(t){let n=t;return e[t]&&(n=(t.replace(/[\\\/]+$/,"").match(/[\\\/]+([^\\\/]+)$/)||["",""])[1]),n}}(e)),l=void 0;if(null!=o.full&&null==(l=e[o.full])&&__multisource_1_24.NONE===o.kind){let t=buildPotentials(o,n,(...e)=>e.reduce((e,t)=>e+"/"+t));for(let n of t)if(null!=(l=e[n])){o.full=n,o.kind=(n.match(/\.([^.]*)$/)||[__multisource_1_24.NONE,__multisource_1_24.NONE])[1];break}}return{...o,src:l,found:null!=l}}},_$mem_24.buildPotentials=buildPotentials;var _$file_23={},__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(_$file_23,"__esModule",{value:!0}),_$file_23.makeFileResolver=void 0;const fs_1=__importDefault(_$_empty_26),path_1=__importDefault(_$pathBrowserify_27),__multisource_1_23=_$multisource_20({});function resolvefolder(e){if("string"!=typeof e)return e;let t=e;return fs_1.default.statSync(e).isFile()&&(t=path_1.default.parse(e).dir),t}function load(e){try{return fs_1.default.readFileSync(e).toString()}catch(t){}}_$file_23.makeFileResolver=function(e){return function(t,n,r,i){let o=e?e(t):t,l=(0,__multisource_1_23.resolvePathSpec)(n,i,o,resolvefolder),s=void 0;if(null!=l.full&&(l.full=path_1.default.resolve(l.full),null==(s=load(l.full))&&__multisource_1_23.NONE===l.kind)){let e=(0,_$mem_24.buildPotentials)(l,n,(...e)=>path_1.default.resolve(e.reduce((e,t)=>path_1.default.join(e,t))));for(let t of e)if(null!=(s=load(t))){l.full=t,l.kind=(t.match(/\.([^.]*)$/)||[__multisource_1_23.NONE,__multisource_1_23.NONE])[1];break}}return{...l,src:s,found:null!=s}}};var _$exprMin_18={exports:{}};(function(e){(function(){!function(t){"object"==typeof _$exprMin_18.exports?_$exprMin_18.exports=t():"function"==typeof define&&define.amd?define([],t):("undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:this).JsonicExpr=t()}((function(){var t={exports:{}};(function(e){(function(){!function(n){"object"==typeof t.exports?t.exports=n():("undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:this).Jsonic=n()}((function(){var e=function(e){var t;return function(n){return t||e(t={exports:{},parent:n},t.exports),t.exports}},t=e((function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.values=t.keys=t.omap=t.str=t.prop=t.normalt=t.parserwrap=t.trimstk=t.tokenize=t.srcfmt=t.snip=t.regexp=t.mesc=t.makelog=t.isarr=t.filterRules=t.extract=t.escre=t.errinject=t.errdesc=t.entries=t.defprop=t.deep=t.configure=t.clone=t.clean=t.charset=t.badlex=t.assign=t.S=t.JsonicError=void 0;const i=n({}),o=e=>null==e?[]:Object.keys(e);t.keys=o,t.values=e=>null==e?[]:Object.values(e),t.entries=e=>null==e?[]:Object.entries(e);const l=(e,...t)=>Object.assign(null==e?{}:e,...t);t.assign=l,t.isarr=e=>Array.isArray(e);const s=Object.defineProperty;t.defprop=s;const a=(e,t)=>Object.entries(e||{}).reduce((e,n)=>{let r=t?t(n):n;void 0===r[0]?delete e[n[0]]:e[r[0]]=r[1];let i=2;for(;void 0!==r[i];)e[r[i]]=r[i+1],i+=2;return e},{});t.omap=a;const c={object:"object",string:"string",function:"function",unexpected:"unexpected",map:"map",list:"list",elem:"elem",pair:"pair",val:"val",node:"node",no_re_flags:r.EMPTY,unprintable:"unprintable",invalid_ascii:"invalid_ascii",invalid_unicode:"invalid_unicode",invalid_lex_state:"invalid_lex_state",unterminated_string:"unterminated_string",unterminated_comment:"unterminated_comment",lex:"lex",parse:"parse",error:"error",none:"none",imp_map:"imp,map",imp_list:"imp,list",imp_null:"imp,null",end:"end",open:"open",close:"close",rule:"rule",stack:"stack",nUll:"null",name:"name",make:"make"};t.S=c;class u extends SyntaxError{constructor(e,t,n,r,i){let o=x(e,t=h({},t),n,r,i);super(o.message),l(this,o),g(this)}toJSON(){return{...this,__error:!0,name:this.name,message:this.message,stack:this.stack}}}function p(e,t,n){let i=t.t,o=i[e];return null==o&&r.STRING===typeof e&&(i[o=t.tI++]=e,i[e]=o,i[e.substring(1)]=o,null!=n&&l(n.token,t.t)),o}function d(e,...t){return new RegExp(t.map(e=>e.esc?f(e.toString()):e).join(r.EMPTY),null==e?"":e)}function f(e){return null==e?"":e.replace(/[-\\|\]{}()[^$+*?.!=]/g,"\\$&").replace(/\t/g,"\\t").replace(/\r/g,"\\r").replace(/\n/g,"\\n")}function h(e,...t){let n=c.function===typeof e,r=null!=e&&(c.object===typeof e||n);for(let i of t){let t=c.function===typeof i,o=null!=i&&(c.object===typeof i||t);if(r&&o&&!t&&Array.isArray(e)===Array.isArray(i))for(let n in i)e[n]=h(e[n],i[n]);else e=void 0===i?e:t?i:o?h(Array.isArray(i)?[]:{},i):i,n=c.function===typeof e,r=null!=e&&(c.object===typeof e||n)}return e}function m(e,t,n,r,i,o){let l={code:t,details:n,token:r,rule:i,ctx:o};return null==e?"":e.replace(/\$([\w_]+)/g,(e,t)=>{let s=JSON.stringify(null!=l[t]?l[t]:null!=n[t]?n[t]:o.meta&&null!=o.meta[t]?o.meta[t]:null!=r[t]?r[t]:null!=i[t]?i[t]:null!=o.opts[t]?o.opts[t]:null!=o.cfg[t]?o.cfg[t]:null!=o[t]?o[t]:"$"+t);return null==s?"":s})}function g(e){e.stack&&(e.stack=e.stack.split("\n").filter(e=>!e.includes("jsonic/jsonic")).map(e=>e.replace(/ at /,"at ")).join("\n"))}function v(e,t,n){let i=0<n.sI?n.sI:0,o=0<n.rI?n.rI:1,l=0<n.cI?n.cI:1,s=null==n.src?r.EMPTY:n.src,a=e.substring(Math.max(0,i-333),i).split("\n"),c=e.substring(i,i+333).split("\n"),u=2+(r.EMPTY+(o+2)).length,p=o<3?1:o-2,d=e=>"\x1b[34m"+(r.EMPTY+p++).padStart(u," ")+" | \x1b[0m"+(null==e?r.EMPTY:e),f=a.length;return[2<f?d(a[f-3]):null,1<f?d(a[f-2]):null,d(a[f-1]+c[0])," ".repeat(u)+" "+" ".repeat(l-1)+"\x1b[31m"+"^".repeat(s.length||1)+" "+t+"\x1b[0m",d(c[1]),d(c[2])].filter(e=>null!=e).join("\n")}function x(e,t,n,r,i){try{let o=i.cfg,l=i.meta,s=m(o.error[e]||o.error.unknown,e,t,n,r,i);c.function===typeof o.hint&&(o.hint={...o.hint(),...o.hint});let a=["\x1b[31m[jsonic/"+e+"]:\x1b[0m "+s," \x1b[34m--\x3e\x1b[0m "+(l&&l.fileName||"<no-file>")+":"+n.rI+":"+n.cI,v(i.src(),s,n),"",m((o.hint[e]||o.hint.unknown||"").trim().split("\n").map(e=>" "+e).join("\n"),e,t,n,r,i),""," \x1b[2mhttps://jsonic.senecajs.org\x1b[0m"," \x1b[2m--internal: rule="+r.name+"~"+r.state+"; token="+p(n.tin,i.cfg)+(null==n.why?"":"~"+n.why)+"; plugins="+i.plgn().map(e=>e.name).join(",")+"--\x1b[0m\n"].join("\n"),u={internal:{token:n,ctx:i}};return u={...Object.create(u),message:a,code:e,details:t,meta:l,fileName:l?l.fileName:void 0,lineNumber:n.rI,columnNumber:n.cI}}catch(o){return console.log(o),{}}}function k(e){return"function"==typeof e.debug.print.src?e.debug.print.src:(t,n)=>null==t?r.EMPTY:(n=JSON.stringify(t)).substring(0,e.debug.maxlen)+(e.debug.maxlen<n.length?"...":r.EMPTY)}function _(e,t=44){let n;try{n="object"==typeof e?JSON.stringify(e):""+e}catch(r){n=""+e}return b(t<n.length?n.substring(0,t-3)+"...":n,t)}function b(e,t=5){return void 0===e?"":(""+e).substring(0,t).replace(/[\r\n\t]/g,".")}function y(...e){return null==e?{}:e.filter(e=>!1!==e).map(e=>"object"==typeof e?o(e).join(r.EMPTY):e).join(r.EMPTY).split(r.EMPTY).reduce((e,t)=>(e[t]=t.charCodeAt(0),e),{})}function j(e){for(let t in e)null==e[t]&&delete e[t];return e}t.JsonicError=u,t.configure=function(e,t,n){var r,i,s,c,u,h,m,g,v,x,k,_,b,O,E,S,M,N,T,P,I,w,C,$,A,R,V,L,F,D,Y,B,U,J,z,Z,q;const K=t||{};K.t=K.t||{},K.tI=K.tI||1;const W=e=>p(e,K);!1!==n.grammar$&&(W("#BD"),W("#ZZ"),W("#UK"),W("#AA"),W("#SP"),W("#LN"),W("#CM"),W("#NR"),W("#ST"),W("#TX"),W("#VL")),K.fixed={lex:!!(null===(r=n.fixed)||void 0===r?void 0:r.lex),token:n.fixed?a(j(n.fixed.token),([e,t])=>[t,p(e,K)]):{},ref:void 0},K.fixed.ref=a(K.fixed.token,([e,t])=>[e,t]),K.fixed.ref=Object.assign(K.fixed.ref,a(K.fixed.ref,([e,t])=>[t,e])),K.tokenSet={ignore:Object.fromEntries(((null===(i=n.tokenSet)||void 0===i?void 0:i.ignore)||[]).map(e=>[W(e),!0]))},K.space={lex:!!(null===(s=n.space)||void 0===s?void 0:s.lex),chars:y(null===(c=n.space)||void 0===c?void 0:c.chars)},K.line={lex:!!(null===(u=n.line)||void 0===u?void 0:u.lex),chars:y(null===(h=n.line)||void 0===h?void 0:h.chars),rowChars:y(null===(m=n.line)||void 0===m?void 0:m.rowChars)},K.text={lex:!!(null===(g=n.text)||void 0===g?void 0:g.lex),modify:((null===(v=K.text)||void 0===v?void 0:v.modify)||[]).concat(([null===(x=n.text)||void 0===x?void 0:x.modify]||[]).flat()).filter(e=>null!=e)},K.number={lex:!!(null===(k=n.number)||void 0===k?void 0:k.lex),hex:!!(null===(_=n.number)||void 0===_?void 0:_.hex),oct:!!(null===(b=n.number)||void 0===b?void 0:b.oct),bin:!!(null===(O=n.number)||void 0===O?void 0:O.bin),sep:null!=(null===(E=n.number)||void 0===E?void 0:E.sep)&&""!==n.number.sep,sepChar:null===(S=n.number)||void 0===S?void 0:S.sep},K.value={lex:!!(null===(M=n.value)||void 0===M?void 0:M.lex),map:(null===(N=n.value)||void 0===N?void 0:N.map)||{}},K.rule={start:null==(null===(T=n.rule)||void 0===T?void 0:T.start)?"val":n.rule.start,maxmul:null==(null===(P=n.rule)||void 0===P?void 0:P.maxmul)?3:n.rule.maxmul,finish:!!(null===(I=n.rule)||void 0===I?void 0:I.finish),include:(null===(w=n.rule)||void 0===w?void 0:w.include)?n.rule.include.split(/\s*,+\s*/).filter(e=>""!==e):[],exclude:(null===(C=n.rule)||void 0===C?void 0:C.exclude)?n.rule.exclude.split(/\s*,+\s*/).filter(e=>""!==e):[]},K.map={extend:!!(null===($=n.map)||void 0===$?void 0:$.extend),merge:null===(A=n.map)||void 0===A?void 0:A.merge};let G=Object.keys(K.fixed.token).sort((e,t)=>t.length-e.length).map(e=>f(e)).join("|"),H=(null===(R=n.comment)||void 0===R?void 0:R.lex)?(n.comment.marker||[]).filter(e=>e.lex).map(e=>f(e.start)).join("|"):"",Q=["([",f(o(y(K.space.lex&&K.space.chars,K.line.lex&&K.line.chars)).join("")),"]",("string"==typeof n.ender?n.ender.split(""):Array.isArray(n.ender)?n.ender:[]).map(e=>"|"+f(e)).join(""),""===G?"":"|",G,""===H?"":"|",H,"|$)"];return K.rePart={fixed:G,ender:Q,commentStart:H},K.re={ender:d(null,...Q),rowChars:d(null,f(null===(V=n.line)||void 0===V?void 0:V.rowChars)),columns:d(null,"["+f(null===(L=n.line)||void 0===L?void 0:L.chars)+"]","(.*)$")},K.lex={empty:!!(null===(F=n.lex)||void 0===F?void 0:F.empty),match:(null===(D=n.lex)||void 0===D?void 0:D.match)?n.lex.match.map(e=>e(K,n)):[]},K.debug={get_console:(null===(Y=n.debug)||void 0===Y?void 0:Y.get_console)||(()=>console),maxlen:null==(null===(B=n.debug)||void 0===B?void 0:B.maxlen)?99:n.debug.maxlen,print:{config:!!(null===(J=null===(U=n.debug)||void 0===U?void 0:U.print)||void 0===J?void 0:J.config),src:null===(Z=null===(z=n.debug)||void 0===z?void 0:z.print)||void 0===Z?void 0:Z.src}},K.error=n.error||{},K.hint=n.hint||{},(null===(q=n.config)||void 0===q?void 0:q.modify)&&o(n.config.modify).forEach(e=>n.config.modify[e](K,n)),K.debug.print.config&&K.debug.get_console().dir(K,{depth:null}),l(e.options,n),l(e.token,K.t),l(e.fixed,K.fixed.ref),K},t.tokenize=p,t.mesc=function(e,t){return(t=new String(e)).esc=!0,t},t.regexp=d,t.escre=f,t.deep=h,t.errinject=m,t.trimstk=g,t.extract=v,t.errdesc=x,t.badlex=function(e,t,n){let r=r=>{let i=e.next(r);if(t===i.tin){let e={};throw null!=i.use&&(e.use=i.use),new u(i.why||c.unexpected,e,i,r,n)}return i};return r.src=e.src,r},t.makelog=function(e,t){if(t)if("number"==typeof t.log){let n=!1,r=t.log;-1===r&&(r=1,n=!0),e.log=(...t)=>{if(n){let n=t.filter(e=>c.object!=typeof e).map(e=>c.function==typeof e?e.name:e).join("\t");e.cfg.debug.get_console().log(n)}else e.cfg.debug.get_console().dir(t,{depth:r})}}else"function"==typeof t.log&&(e.log=t.log);return e.log},t.srcfmt=k,t.str=_,t.snip=b,t.clone=function(e){return h(Object.create(Object.getPrototypeOf(e)),e)},t.charset=y,t.clean=j,t.filterRules=function(e,t){let n=["open","close"];for(let r of n)e.def[r]=e.def[r].map(e=>(e.g="string"==typeof e.g?(e.g||"").split(/\s*,+\s*/):e.g||[],e)).filter(e=>t.rule.include.reduce((t,n)=>t||null!=e.g&&-1!==e.g.indexOf(n),0===t.rule.include.length)).filter(e=>t.rule.exclude.reduce((t,n)=>t&&(null==e.g||-1===e.g.indexOf(n)),!0));return e},t.normalt=function(e){if(null!=e.c){let t=e.c.n,n=e.c.d;null==t&&null==n||(e.c=function(e){let r=!0;if(null!=t)for(let n in t)r=r&&(null==e.n[n]||e.n[n]<=(null==t[n]?0:t[n]));return null!=n&&(r=r&&e.d<=n),r},null!=t&&(e.c.n=t),null!=n&&(e.c.d=n))}if(r.STRING===typeof e.g&&(e.g=e.g.split(/\s*,\s*/)),e.s&&0!==e.s.length){const t=e=>e.flat().filter(e=>"number"==typeof e),n=(e,t)=>e.filter(e=>31*t<=e&&e<31*(t+1)),r=(e,t)=>e.reduce((e,n)=>1<<n-(31*t+1)|e,0),i=t([e.s[0]]),o=t([e.s[1]]),l=e;l.S0=0<i.length?new Array(Math.max(...i.map(e=>1+e/31|0))).fill(null).map((e,t)=>t).map(e=>r(n(i,e),e)):null,l.S1=0<o.length?new Array(Math.max(...o.map(e=>1+e/31|0))).fill(null).map((e,t)=>t).map(e=>r(n(o,e),e)):null}else e.s=null;return e},t.prop=function(e,t,n){try{let r,i=t.split(".");for(let t=0;t<i.length;t++)r=i[t],t<i.length-1&&(e=e[r]=e[r]||{});return void 0!==n&&(e[r]=n),e[r]}catch(i){throw new Error("Cannot "+(void 0===n?"get":"set")+" path "+t+" on object: "+_(r)+(void 0===n?"":" to value: "+_(n,22)))}},t.parserwrap=function(e){return{start:function(t,n,o,l){try{return e.start(t,n,o,l)}catch(s){if("SyntaxError"===s.name){let l=0,a=0,c=0,d=r.EMPTY,f=s.message.match(/^Unexpected token (.) .*position\s+(\d+)/i);if(f){d=f[1],l=parseInt(f[2]),a=t.substring(0,l).replace(/[^\n]/g,r.EMPTY).length;let e=l-1;for(;-1<e&&"\n"!==t.charAt(e);)e--;c=Math.max(t.substring(e,l).length,0)}let h=s.token||(0,i.makeToken)("#UK",p("#UK",n.internal().config),void 0,d,(0,i.makePoint)(d.length,l,s.lineNumber||a,s.columnNumber||c));throw new u(s.code||"json",s.details||{msg:s.message},h,{},s.ctx||{uI:-1,opts:n.options,cfg:n.internal().config,token:h,meta:o,src:()=>t,root:()=>{},plgn:()=>n.internal().plugins,rule:{name:"no-rule"},xs:-1,v2:h,v1:h,t0:h,t1:h,tC:-1,rs:[],rsI:0,next:()=>h,rsm:{},n:{},log:o?o.log:void 0,F:k(n.internal().config),use:{},NORULE:{name:"no-rule"},NOTOKEN:{name:"no-token"}})}throw s}}}}})),n=e((function(e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.makeTextMatcher=n.makeNumberMatcher=n.makeCommentMatcher=n.makeStringMatcher=n.makeLineMatcher=n.makeSpaceMatcher=n.makeFixedMatcher=n.makeToken=n.makePoint=n.makeLex=n.makeNoToken=void 0;const i=t({});class o{constructor(e,t,n,r){this.len=-1,this.sI=0,this.rI=1,this.cI=1,this.token=[],this.len=e,null!=t&&(this.sI=t),null!=n&&(this.rI=n),null!=r&&(this.cI=r)}toString(){return"Point["+[this.sI+"/"+this.len,this.rI,this.cI]+(0<this.token.length?" "+this.token:"")+"]"}[r.INSPECT](){return this.toString()}}const l=(...e)=>new o(...e);n.makePoint=l;class s{constructor(e,t,n,i,o,l,s){this.isToken=!0,this.name=r.EMPTY,this.tin=-1,this.val=void 0,this.src=r.EMPTY,this.sI=-1,this.rI=-1,this.cI=-1,this.len=-1,this.name=e,this.tin=t,this.src=i,this.val=n,this.sI=o.sI,this.rI=o.rI,this.cI=o.cI,this.use=l,this.why=s,this.len=null==i?0:i.length}resolveVal(e,t){return"function"==typeof this.val?this.val(e,t):this.val}bad(e,t){return this.err=e,null!=t&&(this.use=(0,i.deep)(this.use||{},t)),this}toString(){return"Token["+this.name+"="+this.tin+" "+(0,i.snip)(this.src)+(void 0===this.val||"#ST"===this.name||"#TX"===this.name?"":"="+(0,i.snip)(this.val))+" "+[this.sI,this.rI,this.cI]+(null==this.use?"":" "+(0,i.snip)(""+JSON.stringify(this.use).replace(/"/g,""),22))+(null==this.err?"":" "+this.err)+(null==this.why?"":" "+(0,i.snip)(""+this.why,22))+"]"}[r.INSPECT](){return this.toString()}}const a=(...e)=>new s(...e);function c(e,t,n){let r=e.pnt,i=t;if(e.cfg.fixed.lex&&null!=n&&0<n.length){let o=void 0,l=e.cfg.fixed.token[n];null!=l&&(o=e.token(l,void 0,n,r)),null!=o&&(r.sI+=o.src.length,r.cI+=o.src.length,null==t?i=o:r.token.push(o))}return i}n.makeToken=a,n.makeNoToken=()=>a("",-1,void 0,r.EMPTY,l(-1)),n.makeFixedMatcher=(e,t)=>{let n=(0,i.regexp)(null,"^(",e.rePart.fixed,")");return function(t){let r=e.fixed;if(!r.lex)return;let i=t.pnt,o=t.src.substring(i.sI).match(n);if(o){let e=o[1],n=e.length;if(0<n){let o=void 0,l=r.token[e];return null!=l&&(o=t.token(l,void 0,e,i),i.sI+=n,i.cI+=n),o}}}},n.makeCommentMatcher=(e,t)=>{let n=t.comment;e.comment={lex:!!n&&!!n.lex,marker:((null==n?void 0:n.marker)||[]).map(e=>({start:e.start,end:e.end,line:!!e.line,lex:!!e.lex}))};let r=e.comment.lex?e.comment.marker.filter(e=>e.lex&&e.line):[],o=e.comment.lex?e.comment.marker.filter(e=>e.lex&&!e.line):[];return function(t){if(!e.comment.lex)return;let n=t.pnt,l=t.src.substring(n.sI),s=n.rI,a=n.cI;for(let i of r)if(l.startsWith(i.start)){let r=l.length,o=i.start.length;for(a+=i.start.length;o<r&&!e.line.chars[l[o]];)a++,o++;let s=l.substring(0,o),c=t.token("#CM",void 0,s,n);return n.sI+=s.length,n.cI=a,c}for(let r of o)if(l.startsWith(r.start)){let o=l.length,c=r.start.length,u=r.end;for(a+=r.start.length;c<o&&!l.substring(c).startsWith(u);)e.line.rowChars[l[c]]&&(s++,a=0),a++,c++;if(l.substring(c).startsWith(u)){a+=u.length;let e=l.substring(0,c+u.length),r=t.token("#CM",void 0,e,n);return n.sI+=e.length,n.rI=s,n.cI=a,r}return t.bad(i.S.unterminated_comment,n.sI,n.sI+9*r.start.length)}}},n.makeTextMatcher=(e,t)=>{let n=(0,i.regexp)(e.line.lex?null:"s","^(.*?)",...e.rePart.ender);return function(r){let i=e.text,o=r.pnt,l=r.src.substring(o.sI),s=e.value.map,a=l.match(n);if(a){let n=a[1],l=a[2],u=void 0;if(null!=n){let t=n.length;if(0<t){let l=void 0;e.value.lex&&void 0!==(l=s[n])?(u=r.token("#VL",l.val,n,o),o.sI+=t,o.cI+=t):i.lex&&(u=r.token("#TX",n,n,o),o.sI+=t,o.cI+=t)}}if(u&&(u=c(r,u,l)),u&&0<e.text.modify.length){const n=e.text.modify;for(let i=0;i<n.length;i++)u.val=n[i](u.val,r,e,t)}return u}}},n.makeNumberMatcher=(e,t)=>{let n=e.number,r=(0,i.regexp)(null,["^([-+]?(0(",[n.hex?"x[0-9a-fA-F_]+":null,n.oct?"o[0-7_]+":null,n.bin?"b[01_]+":null].filter(e=>null!=e).join("|"),")|[.0-9]+([0-9_]*[0-9])?)","(\\.[0-9]?([0-9_]*[0-9])?)?","([eE][-+]?[0-9]+([0-9_]*[0-9])?)?"].join("").replace(/_/g,n.sep?(0,i.escre)(n.sepChar):""),")",...e.rePart.ender),o=n.sep?(0,i.regexp)("g",(0,i.escre)(n.sepChar)):void 0;return function(t){if(!(n=e.number).lex)return;let i=t.pnt,l=t.src.substring(i.sI),s=e.value.map,a=l.match(r);if(a){let n=a[1],r=a[9],l=void 0;if(null!=n){let r=n.length;if(0<r){let a=void 0;if(e.value.lex&&void 0!==(a=s[n]))l=t.token("#VL",a.val,n,i);else{let e=o?n.replace(o,""):n,s=+e;if(isNaN(s)){let t=e[0];"-"!==t&&"+"!==t||(s=("-"===t?-1:1)*+e.substring(1))}isNaN(s)||(l=t.token("#NR",s,n,i),i.sI+=r,i.cI+=r)}}}return l=c(t,l,r)}}},n.makeStringMatcher=(e,t)=>{let n=t.string||{};return e.string=e.string||{},e.string=(0,i.deep)(e.string,{lex:!!(null==n?void 0:n.lex),quoteMap:(0,i.charset)(n.chars),multiChars:(0,i.charset)(n.multiChars),escMap:(0,i.clean)({...n.escape}),escChar:n.escapeChar,escCharCode:null==n.escapeChar?void 0:n.escapeChar.charCodeAt(0),allowUnknown:!!n.allowUnknown,replaceCodeMap:(0,i.omap)((0,i.clean)({...n.replace}),([e,t])=>[e.charCodeAt(0),t]),hasReplace:!1}),e.string.hasReplace=0<(0,i.keys)(e.string.replaceCodeMap).length,function(t){let n=e.string;if(!n.lex)return;let{quoteMap:o,escMap:l,escChar:s,escCharCode:a,multiChars:c,allowUnknown:u,replaceCodeMap:p,hasReplace:d}=n,{pnt:f,src:h}=t,{sI:m,rI:g,cI:v}=f,x=h.length;if(o[h[m]]){const n=h[m],o=m,k=g,_=c[n];++m,++v;let b,y=[];for(;m<x;m++){v++;let r=h[m];if(b=void 0,n===r){m++;break}if(s===r){v++;let e=l[h[++m]];if(null!=e)y.push(e);else if("x"===h[m]){m++;let e=parseInt(h.substring(m,m+2),16);if(isNaN(e))return m-=2,v-=2,f.sI=m,f.cI=v,t.bad(i.S.invalid_ascii,m,m+4);let n=String.fromCharCode(e);y.push(n),m+=1,v+=2}else if("u"===h[m]){let e="{"===h[++m]?(m++,1):0,n=e?6:4,r=parseInt(h.substring(m,m+n),16);if(isNaN(r))return m=m-2-e,v-=2,f.sI=m,f.cI=v,t.bad(i.S.invalid_unicode,m,m+n+2+2*e);let o=String.fromCodePoint(r);y.push(o),m+=n-1+e,v+=n+e}else{if(!u)return f.sI=m,f.cI=v-1,t.bad(i.S.unexpected,m,m+1);y.push(h[m])}}else if(d&&void 0!==(b=p[h.charCodeAt(m)]))y.push(b),v++;else{let r=m,o=n.charCodeAt(0),l=h.charCodeAt(m);for(;(!d||void 0===(b=p[l]))&&m<x&&32<=l&&o!==l&&a!==l;)l=h.charCodeAt(++m),v++;if(v--,void 0===b&&l<32){if(!_||!e.line.chars[h[m]])return f.sI=m,f.cI=v,t.bad(i.S.unprintable,m,m+1);e.line.rowChars[h[m]]&&(f.rI=++g),v=1,y.push(h.substring(r,m+1))}else y.push(h.substring(r,m)),m--}}if(h[m-1]!==n||f.sI===m-1)return f.rI=k,t.bad(i.S.unterminated_string,o,m);const j=t.token("#ST",y.join(r.EMPTY),h.substring(f.sI,m),f);return f.sI=m,f.rI=g,f.cI=v,j}}},n.makeLineMatcher=(e,t)=>function(t){if(!e.line.lex)return;let{chars:n,rowChars:r}=e.line,{pnt:i,src:o}=t,{sI:l,rI:s}=i;for(;n[o[l]];)s+=r[o[l]]?1:0,l++;if(i.sI<l){let e=o.substring(i.sI,l);const n=t.token("#LN",void 0,e,i);return i.sI+=e.length,i.rI=s,i.cI=1,n}},n.makeSpaceMatcher=(e,t)=>function(t){if(!e.space.lex)return;let{chars:n}=e.space,{pnt:r,src:i}=t,{sI:o,cI:l}=r;for(;n[i[o]];)o++,l++;if(r.sI<o){let e=i.substring(r.sI,o);const n=t.token("#SP",void 0,e,r);return r.sI+=e.length,r.cI=l,n}};class u{constructor(e){this.src=r.EMPTY,this.ctx={},this.cfg={},this.pnt=l(-1),this.ctx=e,this.src=e.src(),this.cfg=e.cfg,this.pnt=l(this.src.length)}token(e,t,n,r,o,l){let s,c;return"string"==typeof e?(c=e,s=(0,i.tokenize)(c,this.cfg)):(s=e,c=(0,i.tokenize)(e,this.cfg)),a(c,s,t,n,r||this.pnt,o,l)}next(e){let t,n=this.pnt;if(n.end)t=n.end;else if(0<n.token.length)t=n.token.shift();else if(n.len<=n.sI)n.end=this.token("#ZZ",void 0,"",n),t=n.end;else{for(let n of this.cfg.lex.match)if(t=n(this,e))break;t=t||this.token("#BD",void 0,this.src[n.sI],n,void 0,"unexpected")}return this.ctx.log&&this.ctx.log(i.S.lex,(0,i.tokenize)(t.tin,this.cfg),this.ctx.F(t.src),n.sI,n.rI+":"+n.cI),t}tokenize(e){return(0,i.tokenize)(e,this.cfg)}bad(e,t,n){return this.token("#BD",void 0,0<=t&&t<=n?this.src.substring(t,n):this.src[this.pnt.sI],void 0,void 0,e)}}n.makeLex=(...e)=>new u(...e)})),r={};Object.defineProperty(r,"__esModule",{value:!0}),r.STRING=r.INSPECT=r.EMPTY=r.AFTER=r.BEFORE=r.CLOSE=r.OPEN=void 0,r.OPEN="o",r.CLOSE="c",r.BEFORE="b",r.AFTER="a",r.EMPTY="",r.INSPECT=Symbol.for("nodejs.util.inspect.custom"),r.STRING="string";var i={};Object.defineProperty(i,"__esModule",{value:!0}),i.defaults=void 0;const o=n({}),l={tag:"-",fixed:{lex:!0,token:{"#OB":"{","#CB":"}","#OS":"[","#CS":"]","#CL":":","#CA":","}},tokenSet:{ignore:["#SP","#LN","#CM"]},space:{lex:!0,chars:" \t"},line:{lex:!0,chars:"\r\n",rowChars:"\n"},text:{lex:!0},number:{lex:!0,hex:!0,oct:!0,bin:!0,sep:"_"},comment:{lex:!0,marker:[{line:!0,start:"#",lex:!0},{line:!0,start:"//",lex:!0},{line:!1,start:"/*",end:"*/",lex:!0}]},string:{lex:!0,chars:"'\"`",multiChars:"`",escapeChar:"\\",escape:{b:"\b",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v",'"':'"',"'":"'","`":"`","\\":"\\","/":"/"},allowUnknown:!0},map:{extend:!0,merge:void 0},value:{lex:!0,map:{true:{val:!0},false:{val:!1},null:{val:null}}},ender:[],plugin:{},debug:{get_console:()=>console,maxlen:99,print:{config:!1,src:void 0}},error:{unknown:"unknown error: $code",unexpected:"unexpected character(s): $src",invalid_unicode:"invalid unicode escape: $src",invalid_ascii:"invalid ascii escape: $src",unprintable:"unprintable character: $src",unterminated_string:"unterminated string: $src",unterminated_comment:"unterminated comment: $src",unknown_rule:"unknown rule: $rulename"},hint:function(e=((e,t="replace")=>e[t](/[A-Z]/g,e=>" "+e.toLowerCase())[t](/[~%][a-z]/g,e=>("~"==e[0]?" ":"")+e[1].toUpperCase())),t="~sinceTheErrorIsUnknown,ThisIsProbablyABugInsideJsonic\nitself,OrAPlugin.~pleaseConsiderPostingAGithubIssue -Thanks!\n\n~code: $code,~details: \n$details|~theCharacter(s) $srcWereNotExpectedAtThisPointAsTheyDoNot\nmatchTheExpectedSyntax,EvenUnderTheRelaxedJsonicRules.~ifIt\nisNotObviouslyWrong,TheActualSyntaxErrorMayBeElsewhere.~try\ncommentingOutLargerAreasAroundThisPointUntilYouGetNoErrors,\nthenRemoveTheCommentsInSmallSectionsUntilYouFindThe\noffendingSyntax.~n%o%t%e:~alsoCheckIfAnyPluginsYouAreUsing\nexpectDifferentSyntaxInThisCase.|~theEscapeSequence $srcDoesNotEncodeAValidUnicodeCodePoint\nnumber.~youMayNeedToValidateYourStringDataManuallyUsingTest\ncodeToSeeHow~javaScriptWillInterpretIt.~alsoConsiderThatYour\ndataMayHaveBecomeCorrupted,OrTheEscapeSequenceHasNotBeen\ngeneratedCorrectly.|~theEscapeSequence $srcDoesNotEncodeAValid~a%s%c%i%iCharacter.~you\nmayNeedToValidateYourStringDataManuallyUsingTestCodeToSee\nhow~javaScriptWillInterpretIt.~alsoConsiderThatYourDataMay\nhaveBecomeCorrupted,OrTheEscapeSequenceHasNotBeenGenerated\ncorrectly.|~stringValuesCannotContainUnprintableCharacters (characterCodes\nbelow 32).~theCharacter $srcIsUnprintable.~youMayNeedToRemove\ntheseCharactersFromYourSourceData.~alsoCheckThatItHasNot\nbecomeCorrupted.|~thisStringHasNoEndQuote.|~thisCommentIsNeverClosed.|~noRuleNamed $rulenameIsDefined.~thisIsProbablyAnErrorInThe\ngrammarOfAPlugin.".split("|")){return"unknown|unexpected|invalid_unicode|invalid_ascii|unprintable|unterminated_string|unterminated_comment|unknown_rule".split("|").reduce((n,r,i)=>(n[r]=e(t[i]),n),{})},lex:{match:[o.makeFixedMatcher,o.makeSpaceMatcher,o.makeLineMatcher,o.makeStringMatcher,o.makeCommentMatcher,o.makeNumberMatcher,o.makeTextMatcher],empty:!0},rule:{start:"val",finish:!0,maxmul:3,include:"",exclude:""},config:{modify:{}},parser:{start:void 0}};i.defaults=l;var s={};Object.defineProperty(s,"__esModule",{value:!0}),s.Parser=s.makeRuleSpec=s.makeRule=void 0;const a=t({}),c=n({});class u{constructor(e,t,n){this.id=-1,this.name=r.EMPTY,this.node=null,this.state=r.OPEN,this.n=Object.create(null),this.d=-1,this.use=Object.create(null),this.keep=Object.create(null),this.bo=!1,this.ao=!1,this.bc=!1,this.ac=!1,this.os=0,this.cs=0,this.id=t.uI++,this.name=e.name,this.spec=e,this.child=t.NORULE,this.parent=t.NORULE,this.prev=t.NORULE,this.o0=t.NOTOKEN,this.o1=t.NOTOKEN,this.c0=t.NOTOKEN,this.c1=t.NOTOKEN,this.node=n,this.d=t.rsI,this.bo=null!=e.def.bo,this.ao=null!=e.def.ao,this.bc=null!=e.def.bc,this.ac=null!=e.def.ac}process(e){return this.spec.process(this,e,this.state)}}const p=(...e)=>new u(...e);s.makeRule=p;class d{constructor(){this.p=r.EMPTY,this.r=r.EMPTY,this.b=0}}const f=(...e)=>new d(...e),h=f(),m=f();class g{constructor(e,t){this.name=r.EMPTY,this.def={open:[],close:[],bo:[],bc:[],ao:[],ac:[]},this.cfg=e,this.def=Object.assign(this.def,t),this.def.open=(this.def.open||[]).filter(e=>null!=e),this.def.close=(this.def.close||[]).filter(e=>null!=e);for(let n of[...this.def.open,...this.def.close])(0,a.normalt)(n)}tin(e){return(0,a.tokenize)(e,this.cfg)}add(e,t,n){let r=(null==n?void 0:n.append)?"push":"unshift",i=((0,a.isarr)(t)?t:[t]).filter(e=>null!=e).map(e=>(0,a.normalt)(e)),o="o"===e?"open":"close",l=this.def[o];if(l[r](...i),n){if(n.delete)for(let e=0;e<n.delete.length;e++)l[(l.length+n.delete[e])%l.length]=null;if(n.move)for(let e=0;e<n.move.length;e+=2){let t=(l.length+n.move[e])%l.length,r=(l.length+n.move[e+1])%l.length,i=l[t];l.splice(t,1),l.splice(r,0,i)}this.def[o]=l.filter(e=>null!=e)}return(0,a.filterRules)(this,this.cfg),this}open(e,t){return this.add("o",e,t)}close(e,t){return this.add("c",e,t)}action(e,t,n,r){let i=this.def[t+n];return e?i.push(r):i.unshift(r),this}bo(e,t){return this.action(!t||!!e,r.BEFORE,r.OPEN,t||e)}ao(e,t){return this.action(!t||!!e,r.AFTER,r.OPEN,t||e)}bc(e,t){return this.action(!t||!!e,r.BEFORE,r.CLOSE,t||e)}ac(e,t){return this.action(!t||!!e,r.AFTER,r.CLOSE,t||e)}clear(){return this.def.open.length=0,this.def.close.length=0,this.def.bo.length=0,this.def.ao.length=0,this.def.bc.length=0,this.def.ac.length=0,this}process(e,t,n){let i=r.EMPTY,o=t.F,l="o"===n,s=l?e:t.NORULE,c=this.def,u=l?c.open:c.close,d=l?e.bo?c.bo:null:e.bc?c.bc:null;if(d){let n=void 0;for(let r=0;r<d.length;r++)if((null==(n=d[r].call(this,e,t,s,n))?void 0:n.isToken)&&(null==n?void 0:n.err))return this.bad(n,e,t,{is_open:l})}let f=0<u.length?this.parse_alts(l,u,e,t):m;if(f.h&&(f=f.h(e,t,f,s)||f,i+="H"),f.e)return this.bad(f.e,e,t,{is_open:l});if(f.n)for(let r in f.n)e.n[r]=0===f.n[r]?0:(null==e.n[r]?0:e.n[r])+f.n[r];if(f.u&&(e.use=Object.assign(e.use,f.u)),f.k&&(e.keep=Object.assign(e.keep,f.k)),f.a){i+="A";let n=f.a.call(this,e,t,f);if(n&&n.isToken&&n.err)return this.bad(n,e,t,{is_open:l})}if(f.p){t.rs[t.rsI++]=e;let n=t.rsm[f.p];if(!n)return this.bad(this.unknownRule(t.t0,f.p),e,t,{is_open:l});(s=e.child=p(n,t,e.node)).parent=e,s.n={...e.n},0<Object.keys(e.keep).length&&(s.keep={...e.keep}),i+="@p:"+f.p}else if(f.r){let n=t.rsm[f.r];if(!n)return this.bad(this.unknownRule(t.t0,f.r),e,t,{is_open:l});(s=p(n,t,e.node)).parent=e.parent,s.prev=e,s.n={...e.n},0<Object.keys(e.keep).length&&(s.keep={...e.keep}),i+="@r:"+f.r}else l||(s=t.rs[--t.rsI]||t.NORULE),i+="Z";let h=l?e.ao?c.ao:null:e.ac?c.ac:null;if(h){let n=void 0;for(let r=0;r<h.length;r++)if((null==(n=h[r].call(this,e,t,s,n))?void 0:n.isToken)&&(null==n?void 0:n.err))return this.bad(n,e,t,{is_open:l})}s.why=i,t.log&&t.log("node "+e.state.toUpperCase(),e.prev.id+"/"+e.parent.id+"/"+e.child.id,e.name+"~"+e.id,"w="+i,"n:"+(0,a.entries)(e.n).filter(e=>e[1]).map(e=>e[0]+"="+e[1]).join(";"),"u:"+(0,a.entries)(e.use).map(e=>e[0]+"="+e[1]).join(";"),"k:"+(0,a.entries)(e.keep).map(e=>e[0]+"="+e[1]).join(";"),"<"+o(e.node)+">");let g=0,v=e[l?"os":"cs"]-(f.b||0);for(;g++<v;)t.next();return r.OPEN===e.state&&(e.state=r.CLOSE),s}parse_alts(e,t,n,i){let o=h;o.b=0,o.p=r.EMPTY,o.r=r.EMPTY,o.n=void 0,o.h=void 0,o.a=void 0,o.u=void 0,o.k=void 0,o.e=void 0;let l,s=null,c=0,u=i.cfg.t,p=1<<u.AA-1,d=t.length;for(c=0;c<d;c++){s=t[c];let r=i.t0.tin,a=!1,u=!1;if(l=!0,s.S0&&(a=!0,(l=s.S0[r/31|0]&(1<<r%31-1|p))&&(u=null!=s.S1,s.S1))){u=!0;let e=i.t1.tin;l=s.S1[e/31|0]&(1<<e%31-1|p)}if(e?(n.o0=a?i.t0:i.NOTOKEN,n.o1=u?i.t1:i.NOTOKEN,n.os=(a?1:0)+(u?1:0)):(n.c0=a?i.t0:i.NOTOKEN,n.c1=u?i.t1:i.NOTOKEN,n.cs=(a?1:0)+(u?1:0)),l&&s.c&&(l=l&&s.c(n,i,o)),l)break;s=null}l||u.ZZ===i.t0.tin||(o.e=i.t0),s&&(o.n=null!=s.n?s.n:o.n,o.h=null!=s.h?s.h:o.h,o.a=null!=s.a?s.a:o.a,o.u=null!=s.u?s.u:o.u,o.k=null!=s.k?s.k:o.k,o.g=null!=s.g?s.g:o.g,o.e=s.e&&s.e(n,i,o)||void 0,o.p=null!=s.p?"string"==typeof s.p?s.p:s.p(n,i,o):o.p,o.r=null!=s.r?"string"==typeof s.r?s.r:s.r(n,i,o):o.r,o.b=null!=s.b?"number"==typeof s.b?s.b:s.b(n,i,o):o.b);let f=c<t.length;return i.log&&i.log("parse "+n.state.toUpperCase(),n.prev.id+"/"+n.parent.id+"/"+n.child.id,n.name+"~"+n.id,f?"alt="+c:"no-alt",f&&o.g?"g:"+o.g+" ":"",(f&&o.p?"p:"+o.p+" ":"")+(f&&o.r?"r:"+o.r+" ":"")+(f&&o.b?"b:"+o.b+" ":""),(r.OPEN===n.state?[n.o0,n.o1].slice(0,n.os):[n.c0,n.c1].slice(0,n.cs)).map(e=>e.name+"="+i.F(e.src)).join(" "),"c:"+(s&&s.c?l:r.EMPTY),"n:"+(0,a.entries)(o.n).map(e=>e[0]+"="+e[1]).join(";"),"u:"+(0,a.entries)(o.u).map(e=>e[0]+"="+e[1]).join(";"),"k:"+(0,a.entries)(o.k).map(e=>e[0]+"="+e[1]).join(";"),c<t.length&&s.s?"["+s.s.map(e=>Array.isArray(e)?e.map(e=>u[e]).join("|"):u[e]).join(" ")+"]":"[]",o),o}bad(e,t,n,r){throw new a.JsonicError(e.err||a.S.unexpected,{...e.use,state:r.is_open?a.S.open:a.S.close},e,t,n)}unknownRule(e,t){return e.err="unknown_rule",e.use=e.use||{},e.use.rulename=t,e}}const v=(...e)=>new g(...e);s.makeRuleSpec=v;class x{constructor(e,t){this.rsm={},this.options=e,this.cfg=t}rule(e,t){if(null==e)return this.rsm;let n=this.rsm[e];if(null===t)delete this.rsm[e];else if(void 0!==t){n=this.rsm[e]=this.rsm[e]||v(this.cfg,{}),(n=this.rsm[e]=t(this.rsm[e],this.rsm)||this.rsm[e]).name=e;for(let e of[...n.def.open,...n.def.close])(0,a.normalt)(e);return}return n}start(e,t,n,i){let o,l=(0,c.makeToken)("#ZZ",(0,a.tokenize)("#ZZ",this.cfg),void 0,r.EMPTY,(0,c.makePoint)(-1)),s=(0,c.makeNoToken)(),u={uI:0,opts:this.options,cfg:this.cfg,meta:n||{},src:()=>e,root:()=>o.node,plgn:()=>t.internal().plugins,rule:{},xs:-1,v2:l,v1:l,t0:l,t1:l,tC:-2,next:_,rs:[],rsI:0,rsm:this.rsm,log:void 0,F:(0,a.srcfmt)(this.cfg),use:{},NOTOKEN:s,NORULE:{}},d=(e=>p(v(e.cfg,{}),e))(u=(0,a.deep)(u,i));if(u.NORULE=d,u.rule=d,(0,a.makelog)(u,n),""===e){if(this.cfg.lex.empty)return;throw new a.JsonicError(a.S.unexpected,{src:e},u.t0,d,u)}let f=e=>(0,a.tokenize)(e,this.cfg),h=(0,a.badlex)((0,c.makeLex)(u),(0,a.tokenize)("#BD",this.cfg),u),m=this.rsm[this.cfg.rule.start];if(null==m)return;let g=p(m,u);o=g;let x=2*(0,a.keys)(this.rsm).length*h.src.length*2*u.cfg.rule.maxmul,k=u.cfg.tokenSet.ignore;function _(){let e;u.v2=u.v1,u.v1=u.t0,u.t0=u.t1;do{e=h(g),u.tC++}while(k[e.tin]);return u.t1=e,u.t0}_(),_();let b=0;for(;d!==g&&b<x;)u.log&&u.log("\nstack","<<"+u.F(o.node)+">>",u.rs.slice(0,u.rsI).map(e=>e.name+"~"+e.id).join("/"),u.rs.slice(0,u.rsI).map(e=>"<"+u.F(e.node)+">").join(" "),g,u,"\n"),u.log&&u.log("rule "+g.state.toUpperCase(),g.prev.id+"/"+g.parent.id+"/"+g.child.id,g.name+"~"+g.id,"["+u.F(u.t0.src)+" "+u.F(u.t1.src)+"]","n:"+(0,a.entries)(g.n).filter(e=>e[1]).map(e=>e[0]+"="+e[1]).join(";"),"u:"+(0,a.entries)(g.use).map(e=>e[0]+"="+e[1]).join(";"),"k:"+(0,a.entries)(g.keep).map(e=>e[0]+"="+e[1]).join(";"),"["+f(u.t0.tin)+" "+f(u.t1.tin)+"]",g,u),u.rule=g,g=g.process(u),b++;if((0,a.tokenize)("#ZZ",this.cfg)!==u.t0.tin)throw new a.JsonicError(a.S.unexpected,{},u.t0,d,u);return u.root()}clone(e,t){let n=new x(e,t);return n.rsm=Object.keys(this.rsm).reduce((e,t)=>(e[t]=(0,a.filterRules)(this.rsm[t],this.cfg),e),{}),n}}s.Parser=x;var k={};Object.defineProperty(k,"__esModule",{value:!0}),k.grammar=void 0,k.grammar=function(e){const t=e.token.OB,n=e.token.CB,r=e.token.OS,i=e.token.CS,o=e.token.CL,l=e.token.CA,s=e.token.TX,a=e.token.NR,c=e.token.ST,u=e.token.VL,p=e.token.ZZ,d=[s,a,c,u],f=e.util.deep,h=(e,t)=>{if(!t.cfg.rule.finish)return t.t0.src="END_OF_SOURCE",t.t0};e.rule("val",e=>{e.bo(e=>e.node=void 0).open([{s:[t],p:"map",b:1,g:"map,json"},{s:[r],p:"list",b:1,g:"list,json"},{s:[d,o],p:"map",b:2,n:{pk:1},g:"pair,json"},{s:[d],g:"val,json"}]).close([{s:[p],g:"end,json"},{b:1,g:"more,json"}]).bc((e,t)=>{e.node=void 0===e.node?void 0===e.child.node?0===e.os?void 0:e.o0.resolveVal(e,t):e.child.node:e.node})}),e.rule("map",e=>{e.bo(e=>{e.node={}}).open([{s:[t,n],g:"map,json"},{s:[t],p:"pair",n:{pk:0},g:"map,json,pair"}])}),e.rule("list",e=>{e.bo(e=>{e.node=[]}).open([{s:[r,i],g:"list,json"},{s:[r],p:"elem",g:"list,elem,json"}])}),e.rule("pair",e=>{e.open([{s:[d,o],p:"val",u:{pair:!0},g:"map,pair,key,json"}]).ao((e,t)=>{if(e.use.pair){const t=e.o0,n=c===t.tin||s===t.tin?t.val:t.src;e.use.key=n}}).bc((e,t)=>{e.use.pair&&(e.use.prev=e.node[e.use.key],e.node[e.use.key]=e.child.node)}).close([{s:[n],g:"map,pair,json"},{s:[l],r:"pair",g:"map,pair,json"},{s:[p],e:h,g:"map,pair,json"}])}),e.rule("elem",e=>{e.open([{p:"val",g:"list,elem,val,json"}]).bc(e=>{void 0!==e.child.node&&e.node.push(e.child.node)}).close([{s:[l],r:"elem",g:"list,elem,json"},{s:[i],g:"list,elem,json"},{s:[p],e:h,g:"list,elem,json"}])}),e.rule("val",e=>{e.open([{s:[[n,i]],b:1,g:"val,imp,null,jsonic"},{s:[l],c:{n:{il:0}},p:"list",b:1,g:"list,imp,jsonic"},{s:[l],b:1,g:"list,val,imp,null,jsonic"}],{append:!0}).close([{s:[[n,i]],b:1,g:"val,json,close"},{s:[l],c:{n:{il:0,pk:0}},n:{il:1},r:"elem",a:e=>e.node=[e.node],g:"list,val,imp,comma,jsonic"},{c:{n:{il:0,pk:0}},n:{il:1},r:"elem",a:e=>e.node=[e.node],g:"list,val,imp,space,jsonic",b:1}],{append:!0,move:[1,-1]})}),e.rule("map",e=>{e.bo(e=>{e.n.il=1+(e.n.il?e.n.il:0),e.n.im=1+(e.n.im?e.n.im:0)}).open([{s:[d,o],p:"pair",b:2,g:"pair,list,val,imp"}],{append:!0})}),e.rule("list",e=>{e.bo(e=>{e.n.il=1+(e.n.il?e.n.il:0),e.n.pk=1+(e.n.pk?e.n.pk:0),e.n.im=1+(e.n.im?e.n.im:0)}).open([{s:[l],p:"elem",b:1,g:"list,elem,val,imp"},{p:"elem",g:"list,elem"}],{append:!0})}),e.rule("pair",e=>{e.open([{s:[l],g:"map,pair,comma"}],{append:!0}).bc((e,t)=>{if(e.use.pair){let n=e.use.key,r=e.child.node;const i=e.use.prev;r=void 0===r?null:r,e.node[n]=null==i?r:t.cfg.map.merge?t.cfg.map.merge(i,r):t.cfg.map.extend?f(i,r):r}}).close([{s:[n],c:{n:{pk:0}},g:"map,pair,json"},{s:[l,n],c:{n:{pk:0}},g:"map,pair,comma,jsonic"},{s:[l],c:{n:{pk:0}},r:"pair",g:"map,pair,json"},{s:[l],c:{n:{im:1}},r:"pair",g:"map,pair,jsonic"},{s:[d],c:{n:{pk:0}},r:"pair",b:1,g:"map,pair,imp,jsonic"},{s:[d],c:{n:{im:1}},r:"pair",b:1,g:"map,pair,imp,jsonic"},{s:[[n,l,...d]],b:1,g:"map,pair,imp,path,jsonic"},{s:[i],b:1,g:"list,pair,imp,jsonic"},{s:[p],e:h,g:"map,pair,json"}],{append:!0,delete:[0,1,2]})}),e.rule("elem",e=>{e.open([{s:[l,l],b:2,a:e=>e.node.push(null),g:"list,elem,imp,null,jsonic"},{s:[l],a:e=>e.node.push(null),g:"list,elem,imp,null,jsonic"}]).close([{s:[l,i],g:"list,elem,comma.jsonic"},{s:[l],r:"elem",g:"list,elem,json"},{s:[[...d,t,r]],r:"elem",b:1,g:"list,elem,imp,jsonic"},{s:[i],g:"list,elem,json"},{s:[p],e:h,g:"list,elem,json"}],{delete:[-1,-2,-3]})})};var _={exports:{}};Object.defineProperty(_.exports,"__esModule",{value:!0}),_.exports.AFTER=_.exports.BEFORE=_.exports.CLOSE=_.exports.OPEN=_.exports.makeTextMatcher=_.exports.makeNumberMatcher=_.exports.makeCommentMatcher=_.exports.makeStringMatcher=_.exports.makeLineMatcher=_.exports.makeSpaceMatcher=_.exports.makeFixedMatcher=_.exports.makeLex=_.exports.makeRuleSpec=_.exports.makeRule=_.exports.makePoint=_.exports.makeToken=_.exports.make=_.exports.util=_.exports.Parser=_.exports.JsonicError=_.exports.Jsonic=void 0,Object.defineProperty(_.exports,"OPEN",{enumerable:!0,get:function(){return r.OPEN}}),Object.defineProperty(_.exports,"CLOSE",{enumerable:!0,get:function(){return r.CLOSE}}),Object.defineProperty(_.exports,"BEFORE",{enumerable:!0,get:function(){return r.BEFORE}}),Object.defineProperty(_.exports,"AFTER",{enumerable:!0,get:function(){return r.AFTER}});const b=t({});Object.defineProperty(_.exports,"JsonicError",{enumerable:!0,get:function(){return b.JsonicError}});const y=n({});Object.defineProperty(_.exports,"makePoint",{enumerable:!0,get:function(){return y.makePoint}}),Object.defineProperty(_.exports,"makeToken",{enumerable:!0,get:function(){return y.makeToken}}),Object.defineProperty(_.exports,"makeLex",{enumerable:!0,get:function(){return y.makeLex}}),Object.defineProperty(_.exports,"makeFixedMatcher",{enumerable:!0,get:function(){return y.makeFixedMatcher}}),Object.defineProperty(_.exports,"makeSpaceMatcher",{enumerable:!0,get:function(){return y.makeSpaceMatcher}}),Object.defineProperty(_.exports,"makeLineMatcher",{enumerable:!0,get:function(){return y.makeLineMatcher}}),Object.defineProperty(_.exports,"makeStringMatcher",{enumerable:!0,get:function(){return y.makeStringMatcher}}),Object.defineProperty(_.exports,"makeCommentMatcher",{enumerable:!0,get:function(){return y.makeCommentMatcher}}),Object.defineProperty(_.exports,"makeNumberMatcher",{enumerable:!0,get:function(){return y.makeNumberMatcher}}),Object.defineProperty(_.exports,"makeTextMatcher",{enumerable:!0,get:function(){return y.makeTextMatcher}}),Object.defineProperty(_.exports,"makeRule",{enumerable:!0,get:function(){return s.makeRule}}),Object.defineProperty(_.exports,"makeRuleSpec",{enumerable:!0,get:function(){return s.makeRuleSpec}}),Object.defineProperty(_.exports,"Parser",{enumerable:!0,get:function(){return s.Parser}});const j={tokenize:b.tokenize,srcfmt:b.srcfmt,deep:b.deep,clone:b.clone,charset:b.charset,trimstk:b.trimstk,makelog:b.makelog,badlex:b.badlex,extract:b.extract,errinject:b.errinject,errdesc:b.errdesc,configure:b.configure,parserwrap:b.parserwrap,mesc:b.mesc,escre:b.escre,regexp:b.regexp,prop:b.prop,str:b.str,omap:b.omap,keys:b.keys,values:b.values,entries:b.entries};function O(e,t){let n={parser:{},config:{},plugins:[],mark:Math.random()},r=(0,b.deep)({},t?{...t.options}:!1===(null==e?void 0:e.defaults$)?{}:i.defaults,e||{}),o=function(e,t,n){var r;if(b.S.string===typeof e){let i=o.internal();return((null===(r=l.parser)||void 0===r?void 0:r.start)?(0,b.parserwrap)(l.parser):i.parser).start(e,o,t,n)}return e},l=e=>{if(null!=e&&b.S.object===typeof e){(0,b.deep)(r,e),(0,b.configure)(o,n.config,r);let t=o.internal().parser;n.parser=t.clone(r,n.config)}return{...o.options}},a={token:e=>(0,b.tokenize)(e,n.config,o),fixed:e=>n.config.fixed.ref[e],options:(0,b.deep)(l,r),parse:o,use:function(e,t){const n=e.name.toLowerCase(),r=(0,b.deep)({},e.defaults||{},t||{});o.options({plugin:{[n]:r}});let i=o.options.plugin[n];return o.internal().plugins.push(e),e(o,i)||o},rule:(e,t)=>o.internal().parser.rule(e,t)||o,lex:e=>{let t=r.lex.match;t.unshift(e),o.options({lex:{match:t}})},make:e=>O(e,o),empty:e=>O({defaults$:!1,grammar$:!1,...e||{}}),id:"Jsonic/"+Date.now()+"/"+(""+Math.random()).substring(2,8).padEnd(6,"0")+(null==l.tag?"":"/"+l.tag),toString:()=>a.id,util:j};if((0,b.defprop)(a.make,b.S.name,{value:b.S.make}),(0,b.assign)(o,a),(0,b.defprop)(o,"internal",{value:()=>n}),t){for(let n in t)void 0===o[n]&&(o[n]=t[n]);o.parent=t;let e=t.internal();n.config=(0,b.deep)({},e.config),(0,b.configure)(o,n.config,r),(0,b.assign)(o.token,n.config.t),n.plugins=[...e.plugins],n.parser=e.parser.clone(r,n.config)}else n.config=(0,b.configure)(o,void 0,r),n.plugins=[],n.parser=new s.Parser(r,n.config),!1!==r.grammar$&&(0,k.grammar)(o);return o}_.exports.util=j,_.exports.make=O;let E=void 0,S=E=O();return _.exports.Jsonic=S,delete E.options,delete E.use,delete E.rule,delete E.lex,delete E.token,delete E.fixed,E.Jsonic=E,E.JsonicError=b.JsonicError,E.Parser=s.Parser,E.makeLex=y.makeLex,E.makeToken=y.makeToken,E.makePoint=y.makePoint,E.makeRule=s.makeRule,E.makeRuleSpec=s.makeRuleSpec,E.makeFixedMatcher=y.makeFixedMatcher,E.makeSpaceMatcher=y.makeSpaceMatcher,E.makeLineMatcher=y.makeLineMatcher,E.makeStringMatcher=y.makeStringMatcher,E.makeCommentMatcher=y.makeCommentMatcher,E.makeNumberMatcher=y.makeNumberMatcher,E.makeTextMatcher=y.makeTextMatcher,E.util=j,E.make=O,_.exports.default=S,_.exports=_.exports.Jsonic,_.exports}))}).call(this)}).call(this,void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),t=t.exports;var n={};Object.defineProperty(n,"__esModule",{value:!0}),n.testing=n.evaluate=n.Expr=void 0;const{omap:r,entries:i,values:o}=t.util,l={};let s=function(e,t){var n;let s=(null===(n=e.options.lex)||void 0===n?void 0:n.match)||[],y=s.map(e=>e.name).indexOf("makeCommentMatcher");0<y&&e.options({lex:{match:[s[y],...s.slice(0,y),...s.slice(y+1)]}});let j=e.token.bind(e),O=e.fixed.bind(e),E=t.op||{};const S=k(j,O,E,"prefix"),M=k(j,O,E,"suffix"),N=k(j,O,E,"infix"),T=k(j,O,E,"ternary"),P=function(e,t,n){return i(E).reduce((n,[r,i])=>{if(i.paren){let o=t(i.osrc)||e("#E"+i.osrc),s=e(o),a=t(i.csrc)||e("#E"+i.csrc),c=e(a);n[o]={name:r+"-paren",osrc:i.osrc,csrc:i.csrc,otkn:s,otin:o,ctkn:c,ctin:a,preval:{active:null!=i.preval&&(null==i.preval.active||i.preval.active),required:null!=i.preval&&null!=i.preval.required&&i.preval.required},use:{},paren:!0,src:i.osrc,left:Number.MIN_SAFE_INTEGER,right:Number.MAX_SAFE_INTEGER,infix:!1,prefix:!1,suffix:!1,ternary:!1,tkn:"",tin:-1,terms:1,token:{},OP_MARK:l}}return n},{})}(j,O),I=r(P,([e,t])=>[void 0,void 0,t.ctin,t]);let w=Object.values({...P,...I}).reduce((e,t)=>(e[t.otkn]=t.osrc,e[t.ctkn]=t.csrc,e),{}),C=Object.values({...S,...M,...N,...T}).reduce((e,t)=>(e[t.tkn]=t.src,e),{});e.options({fixed:{token:{...C,...w}}});const $=o(S).map(e=>e.tin),A=o(N).map(e=>e.tin),R=o(M).map(e=>e.tin),V=o(T).filter(e=>0===e.use.ternary.opI).map(e=>e.tin),L=o(T).filter(e=>1===e.use.ternary.opI).map(e=>e.tin),F=o(P).map(e=>e.otin),D=o(I).map(e=>e.ctin),Y=0<$.length,B=0<A.length,U=0<R.length,J=0<V.length&&0<L.length,z=0<F.length&&0<D.length,Z=e.token.CA,q=e.token.TX,K=e.token.NR,W=e.token.ST,G=e.token.VL,H=e.token.ZZ,Q=[q,K,W,G];e.rule("val",t=>{J&&L.includes(e.token.CL)&&(t.def.open.find(e=>e.g.includes("pair")).c=e=>!e.n.expr_ternary),t.open([Y?{s:[$],b:1,n:{expr_prefix:1,expr_suffix:0},p:"expr",g:"expr,expr-prefix"}:null,z?{s:[F],b:1,p:"paren",c:(e,t)=>{let n=!0;return P[e.o0.tin].preval.required&&(n="val"===e.prev.name&&e.prev.use.paren_preval),n&&1===e.prev.id&&(t.root=()=>e.node),n},g:"expr,expr-paren"}:null]).close([J?{s:[V],c:e=>!e.n.expr,b:1,r:"ternary",g:"expr,expr-ternary"}:null,B?{s:[A],b:1,n:{expr_prefix:0,expr_suffix:0},r:e=>e.n.expr?"":"expr",g:"expr,expr-infix"}:null,U?{s:[R],b:1,n:{expr_prefix:0,expr_suffix:1},r:e=>e.n.expr?"":"expr",g:"expr,expr-suffix"}:null,z?{s:[D],c:e=>!!e.n.expr_paren,b:1,g:"expr,expr-paren"}:null,z?{s:[F],b:1,r:"val",c:e=>P[e.c0.tin].preval.active,u:{paren_preval:!0},g:"expr,expr-paren,expr-paren-preval"}:null,J?{s:[L],c:e=>!!e.n.expr_ternary,b:1,g:"expr,expr-ternary"}:null,{s:[Z],c:e=>1===e.d&&(1<=e.n.expr||1<=e.n.expr_ternary)||1<=e.n.expr_ternary&&1<=e.n.expr_paren,b:1,g:"expr,list,val,imp,comma,top"},{s:[Q],c:e=>1===e.d&&(1<=e.n.expr||1<=e.n.expr_ternary)||1<=e.n.expr_ternary&&1<=e.n.expr_paren,b:1,g:"expr,list,val,imp,space,top"}])}),e.rule("list",e=>{e.bo(!1,(...e)=>{e[0].n.expr=0,e[0].n.expr_prefix=0,e[0].n.expr_suffix=0,e[0].n.expr_paren=0,e[0].n.expr_ternary=0})}),e.rule("map",e=>{e.bo(!1,(...e)=>{e[0].n.expr=0,e[0].n.expr_prefix=0,e[0].n.expr_suffix=0,e[0].n.expr_paren=0,e[0].n.expr_ternary=0})}),e.rule("elem",e=>{e.close([z?{s:[D],b:1,c:e=>!!e.n.expr_paren,g:"expr,expr-paren,imp,close,list"}:null,z?{s:[F],b:1,r:"elem",g:"expr,expr-paren,imp,open,list"}:null])}),e.rule("pair",e=>{e.close([z?{s:[D],b:1,c:e=>!!e.n.expr_paren||0<e.n.pk,g:"expr,expr-paren,imp,map"}:null])}),e.rule("expr",e=>{e.open([Y?{s:[$],c:e=>!!e.n.expr_prefix,n:{expr:1,il:1,im:1},p:"val",g:"expr,expr-prefix",a:e=>{const t=c(e.o0,S);e.node=x(e.parent.node)?_(e.parent.node,t):a(e,e.parent,t)}}:null,B?{s:[A],p:"val",n:{expr:1,expr_prefix:0,il:1,im:1},a:e=>{const t=e.prev,n=e.parent,r=c(e.o0,N);x(n.node)&&!v("ternary",n.node)?e.node=_(n.node,r):x(t.node)?(e.node=_(t.node,r),e.parent=t):e.node=a(e,t,r)},g:"expr,expr-infix"}:null,U?{s:[R],n:{expr:1,expr_prefix:0,il:1,im:1},a:e=>{const t=e.prev,n=c(e.o0,M);e.node=x(t.node)?_(t.node,n):a(e,t,n)},g:"expr,expr-suffix"}:null]).bc(e=>{var t;x(e.node)&&(null===(t=e.node)||void 0===t?void 0:t.length)-1<e.node[0].terms&&e.node.push(e.child.node)}).close([B?{s:[A],c:e=>!e.n.expr_prefix,b:1,r:"expr",g:"expr,expr-infix"}:null,U?{s:[R],c:e=>!e.n.expr_prefix,b:1,r:"expr",g:"expr,expr-suffix"}:null,z?{s:[D],c:e=>!!e.n.expr_paren,b:1}:null,J?{s:[V],c:e=>!e.n.expr_prefix,b:1,r:"ternary",g:"expr,expr-ternary"}:null,{s:[Z],c:{d:0},n:{expr:0},r:"elem",a:e=>e.parent.node=e.node=[e.node],g:"expr,comma,list,top"},{s:[Q],c:{d:0},n:{expr:0},b:1,r:"elem",a:e=>e.parent.node=e.node=[e.node],g:"expr,space,list,top"},{s:[Z],c:{n:{pk:0}},n:{expr:0},b:1,h:h,g:"expr,list,val,imp,comma"},{c:{n:{pk:0,expr_suffix:0}},n:{expr:0},h:h,g:"expr,list,val,imp,space"},{n:{expr:0},g:"expr,expr-end"}]).ac(e=>{t.evaluate&&0===e.n.expr&&(e.parent.node=b(e.parent,e.parent.node,t.evaluate))})}),e.rule("paren",e=>{e.bo(e=>{e.n.im=0,e.n.il=0,e.n.pk=0}).open([z?{s:[F,D],b:1,g:"expr,expr-paren,empty",c:e=>P[e.o0.tin].name===I[e.o1.tin].name,a:d(P)}:null,z?{s:[F],p:"val",n:{expr_paren:1,expr:0,expr_prefix:0,expr_suffix:0},g:"expr,expr-paren,open",a:d(P)}:null]).close([z?{s:[D],c:e=>{let t="expr_paren_depth_"+I[e.c0.tin].name;return!!e.n[t]},a:f(I),g:"expr,expr-paren,close"}:null])}),J&&e.rule("ternary",e=>{e.open([{s:[V],p:"val",n:{expr_ternary:1,expr:0,expr_prefix:0,expr_suffix:0},u:{expr_ternary_step:1},g:"expr,expr-ternary,open",a:e=>{let t=c(e.o0,T);e.use.expr_ternary_name=t.name,x(e.prev.node)?e.node=u(e.prev.node,t,p(e.prev.node)):e.node=e.prev.node=u([],t,e.prev.node),e.use.expr_ternary_paren=e.n.expr_paren||e.prev.use.expr_ternary_paren||0,e.n.expr_paren=0}},{p:"val",c:e=>2===e.prev.use.expr_ternary_step,a:e=>{e.use.expr_ternary_step=e.prev.use.expr_ternary_step,e.n.expr_paren=e.use.expr_ternary_paren=e.prev.use.expr_ternary_paren},g:"expr,expr-ternary,step"}]).close([{s:[L],c:e=>1===e.use.expr_ternary_step&&e.use.expr_ternary_name===T[e.c0.tin].name,r:"ternary",a:e=>{e.use.expr_ternary_step++,e.node.push(e.child.node)},g:"expr,expr-ternary,step"},{s:[[Z,...D]],c:m,b:(e,t)=>D.includes(t.t0.tin)?1:0,r:(e,t)=>{var n;return D.includes(t.t0.tin)||0!==e.d&&(!e.prev.use.expr_ternary_paren||(null===(n=e.parent.node)||void 0===n?void 0:n.length))?"":"elem"},a:g,g:"expr,expr-ternary,list,val,imp,comma"},{c:m,r:(e,t)=>{var n;return 0!==e.d&&D.includes(t.t0.tin)&&!e.prev.use.expr_ternary_paren||(null===(n=e.parent.node)||void 0===n?void 0:n.length)||H===t.t0.tin?"":"elem"},a:g,g:"expr,expr-ternary,list,val,imp,space"},{c:e=>0<e.d&&2===e.use.expr_ternary_step,a:e=>{e.node.push(e.child.node)},g:"expr,expr-ternary,close"}])})};function a(e,t,n){let r=t.node;return x(t.node)?r=p(t.node):t.node=[],u(t.node,n),n.prefix||(t.node[1]=r),e.parent=t,t.node}function c(e,t){return{...t[e.tin],token:e,OP_MARK:l}}function u(e,t,...n){let r=e;r[0]=t;let i=0;for(;i<n.length;i++)r[i+1]=n[i];return r.length=i+1,r}function p(e){return[...e]}function d(e){return function(t){let n="expr_paren_depth_"+c(t.o0,e).name;t.use[n]=t.n[n]=1,t.node=void 0}}function f(e){return function(t){(x(t.child.node)||void 0===t.node)&&(t.node=t.child.node);const n=c(t.c0,e);let r="expr_paren_depth_"+n.name;if(t.use[r]===t.n[r]){const e=t.node;t.node=[n],void 0!==e&&(t.node[1]=e),t.parent.prev.use.paren_preval&&(v("paren",t.parent.prev.node)?t.node=u(t.parent.prev.node,t.node[0],p(t.parent.prev.node),t.node[1]):(t.node.splice(1,0,t.parent.prev.node),t.parent.prev.node=t.node))}}}function h(e,t,n){let r=null;for(let i=t.rsI-1;-1<i;i--)if("paren"===t.rs[i].name){r=t.rs[i];break}return r&&(null==r.child.node?(r.child.node=[e.node],n.r="elem",n.b=0):x(r.child.node)&&(r.child.node=[r.child.node],n.r="elem",n.b=0),e.node=r.child.node),n}function m(e){return(0===e.d||1<=e.n.expr_paren)&&!e.n.pk&&2===e.use.expr_ternary_step}function g(e,t,n){e.n.expr_paren=e.prev.use.expr_ternary_paren,e.node.push(e.child.node),"elem"===n.r&&(e.node[0]=p(e.node),e.node.length=1)}function v(e,t){return null!=t&&x(t)&&!0===t[0][e]}function x(e){return null!=e&&e[0]&&e[0].OP_MARK===l}function k(e,t,n,r){return Object.entries(n).filter(([e,t])=>t[r]).reduce((n,[i,o])=>{let s="",a=-1,c="";c="string"==typeof o.src?o.src:o.src[0],a=t(c)||e("#E"+c),s=e(a);let u=n[a]={src:c,left:o.left||Number.MIN_SAFE_INTEGER,right:o.right||Number.MAX_SAFE_INTEGER,name:i+(i.endsWith("-"+r)?"":"-"+r),infix:"infix"===r,prefix:"prefix"===r,suffix:"suffix"===r,ternary:"ternary"===r,tkn:s,tin:a,terms:"ternary"===r?3:"infix"===r?2:1,use:{},paren:!1,osrc:"",csrc:"",otkn:"",ctkn:"",otin:-1,ctin:-1,preval:{active:!1,required:!1},token:{},OP_MARK:l};if(u.ternary){let r=o.src;u.src=r[0],u.use.ternary={opI:0};let i={...u};c=o.src[1],a=t(c)||e("#E"+c),s=e(a),i.src=c,i.use={ternary:{opI:1}},i.tkn=s,i.tin=a,n[a]=i}return n},{})}function _(e,t){let n=e,r=e[0];if(t)if(t.infix)if(r.suffix||t.left<=r.right)u(e,t,p(e));else{const i=r.terms;n=x(e[i])&&e[i][0].right<t.left?_(e[i],t):e[i]=u([],t,e[i])}else if(t.prefix)n=e[r.terms]=u([],t);else if(t.suffix)if(!r.suffix&&r.right<=t.left){const n=r.terms;x(e[n])&&e[n][0].prefix&&e[n][0].right<t.left?_(e[n],t):e[n]=u([],t,e[n])}else u(e,t,p(e));return n}function b(e,t,n){return null==t?t:x(t)?n(e,t[0],t.slice(1).map(t=>b(e,t,n))):t}n.Expr=s,s.defaults={op:{positive:{prefix:!0,right:14e3,src:"+"},negative:{prefix:!0,right:14e3,src:"-"},addition:{infix:!0,left:140,right:150,src:"+"},subtraction:{infix:!0,left:140,right:150,src:"-"},multiplication:{infix:!0,left:160,right:170,src:"*"},division:{infix:!0,left:160,right:170,src:"/"},remainder:{infix:!0,left:160,right:170,src:"%"},plain:{paren:!0,osrc:"(",csrc:")"}}},n.evaluate=b;const y={prattify:_,opify:e=>(e.OP_MARK=l,e)};return n.testing=y,n}))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),_$exprMin_18=_$exprMin_18.exports;var _$pathMin_25={exports:{}};(function(e){(function(){!function(t){"object"==typeof _$pathMin_25.exports?_$pathMin_25.exports=t():"function"==typeof define&&define.amd?define([],t):("undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:this).JsonicPath=t()}((function(){var e={};Object.defineProperty(e,"__esModule",{value:!0}),e.Path=void 0;const t=(e,t)=>{e.rule("val",e=>{e.bo(e=>{0===e.d&&(e.keep.path=[])})}),e.rule("map",e=>{e.bo(e=>{delete e.keep.index})}),e.rule("pair",e=>{e.ao(e=>{0<e.d&&e.use.pair&&(e.child.keep.path=[...e.keep.path,e.use.key],e.child.keep.key=e.use.key)})}),e.rule("list",e=>{e.bo(e=>{e.keep.index=-1})}),e.rule("elem",e=>{e.ao(e=>{0<e.d&&(e.keep.index=1+e.keep.index,e.child.keep.path=[...e.keep.path,e.keep.index],e.child.keep.key=e.keep.index,e.child.keep.index=e.keep.index)})})};return e.Path=t,t.defaults={},e}))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),_$pathMin_25=_$pathMin_25.exports;var _$aontu_1={};Object.defineProperty(_$aontu_1,"__esModule",{value:!0}),_$aontu_1.util=_$aontu_1.Lang=_$aontu_1.Nil=_$aontu_1.Aontu=void 0;const __lang_1_1=_$lang_2({});Object.defineProperty(_$aontu_1,"Lang",{enumerable:!0,get:function(){return __lang_1_1.Lang}});const __unify_1_1=_$unify_7({}),__Nil_1_1=_$Nil_13({});function Aontu(e,t){let n=util.options(e,t),r={},i=new __lang_1_1.Lang(n).parse(n.src,{deps:r}),o=new __unify_1_1.Unify(i),l=o.res,s=o.err;return l.deps=r,l.err=s,l}Object.defineProperty(_$aontu_1,"Nil",{enumerable:!0,get:function(){return __Nil_1_1.Nil}}),_$aontu_1.Aontu=Aontu;const util={options:(e,t)=>{let n="string"==typeof e?{src:e}:e;return{src:"",print:0,resolver:__lang_1_1.includeFileResolver,...n,...t||{}}}};return _$aontu_1.util=util,_$aontu_1.default=Aontu,_$aontu_1}));
|
package/dist/lib/lang.d.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { Jsonic } from '@jsonic/jsonic-next';
|
|
2
|
-
import { Options } from './
|
|
3
|
-
import { Val } from './val';
|
|
2
|
+
import type { Val, Options } from './type';
|
|
4
3
|
declare class Site {
|
|
5
4
|
row: number;
|
|
6
5
|
col: number;
|
|
7
6
|
url: string;
|
|
8
|
-
static NONE: Site;
|
|
9
7
|
constructor(val: Val);
|
|
10
8
|
}
|
|
11
9
|
declare const includeFileResolver: import("@jsonic/multisource").Resolver;
|
package/dist/lib/lang.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
/* Copyright (c) 2021 Richard Rodger, MIT License */
|
|
2
|
+
/* Copyright (c) 2021-2022 Richard Rodger, MIT License */
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.includeFileResolver = exports.Site = exports.Lang = void 0;
|
|
5
5
|
const jsonic_next_1 = require("@jsonic/jsonic-next");
|
|
@@ -7,8 +7,18 @@ const multisource_1 = require("@jsonic/multisource");
|
|
|
7
7
|
const file_1 = require("@jsonic/multisource/dist/resolver/file");
|
|
8
8
|
const expr_1 = require("@jsonic/expr");
|
|
9
9
|
const path_1 = require("@jsonic/path");
|
|
10
|
+
const type_1 = require("./type");
|
|
11
|
+
const ConjunctVal_1 = require("./val/ConjunctVal");
|
|
12
|
+
const DisjunctVal_1 = require("./val/DisjunctVal");
|
|
13
|
+
const MapVal_1 = require("./val/MapVal");
|
|
14
|
+
const ListVal_1 = require("./val/ListVal");
|
|
15
|
+
const PrefVal_1 = require("./val/PrefVal");
|
|
16
|
+
const RefVal_1 = require("./val/RefVal");
|
|
17
|
+
const Nil_1 = require("./val/Nil");
|
|
10
18
|
const val_1 = require("./val");
|
|
19
|
+
// console.log('TOP', TOP)
|
|
11
20
|
class Site {
|
|
21
|
+
// static NONE = new Site(TOP)
|
|
12
22
|
constructor(val) {
|
|
13
23
|
this.row = -1;
|
|
14
24
|
this.col = -1;
|
|
@@ -21,7 +31,6 @@ class Site {
|
|
|
21
31
|
}
|
|
22
32
|
}
|
|
23
33
|
exports.Site = Site;
|
|
24
|
-
Site.NONE = new Site(val_1.TOP);
|
|
25
34
|
let AontuJsonic = function aontu(jsonic) {
|
|
26
35
|
jsonic.use(path_1.Path);
|
|
27
36
|
// TODO: refactor Val constructor
|
|
@@ -46,26 +55,26 @@ let AontuJsonic = function aontu(jsonic) {
|
|
|
46
55
|
val: (r) => addpath(new val_1.ScalarTypeVal(Boolean), r.keep.path)
|
|
47
56
|
},
|
|
48
57
|
'nil': {
|
|
49
|
-
val: (r) => addpath(new
|
|
58
|
+
val: (r) => addpath(new Nil_1.Nil('literal'), r.keep.path)
|
|
50
59
|
},
|
|
51
60
|
// TODO: FIX: need a TOP instance to hold path
|
|
52
|
-
'top': { val: () =>
|
|
61
|
+
'top': { val: () => type_1.TOP },
|
|
53
62
|
}
|
|
54
63
|
},
|
|
55
64
|
map: {
|
|
56
65
|
merge: (prev, curr) => {
|
|
57
66
|
let pval = prev;
|
|
58
67
|
let cval = curr;
|
|
59
|
-
return addpath(new
|
|
68
|
+
return addpath(new ConjunctVal_1.ConjunctVal([pval, cval]), prev.path);
|
|
60
69
|
}
|
|
61
70
|
}
|
|
62
71
|
});
|
|
63
72
|
let opmap = {
|
|
64
|
-
'conjunct-infix': (r, _op, terms) => addpath(new
|
|
65
|
-
'disjunct-infix': (r, _op, terms) => addpath(new
|
|
66
|
-
'dot-prefix': (r, _op, terms) => addpath(new
|
|
67
|
-
'dot-infix': (r, _op, terms) => addpath(new
|
|
68
|
-
'star-prefix': (r, _op, terms) => addpath(new
|
|
73
|
+
'conjunct-infix': (r, _op, terms) => addpath(new ConjunctVal_1.ConjunctVal(terms), r.keep.path),
|
|
74
|
+
'disjunct-infix': (r, _op, terms) => addpath(new DisjunctVal_1.DisjunctVal(terms), r.keep.path),
|
|
75
|
+
'dot-prefix': (r, _op, terms) => addpath(new RefVal_1.RefVal(terms, true), r.keep.path),
|
|
76
|
+
'dot-infix': (r, _op, terms) => addpath(new RefVal_1.RefVal(terms), r.keep.path),
|
|
77
|
+
'star-prefix': (r, _op, terms) => addpath(new PrefVal_1.PrefVal(terms[0]), r.keep.path),
|
|
69
78
|
};
|
|
70
79
|
jsonic
|
|
71
80
|
.use(expr_1.Expr, {
|
|
@@ -105,11 +114,9 @@ let AontuJsonic = function aontu(jsonic) {
|
|
|
105
114
|
let CJ = jsonic.token['#E&'];
|
|
106
115
|
let CL = jsonic.token.CL;
|
|
107
116
|
jsonic.rule('val', (rs) => {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
// let out = orig_bc.call(this, rule, ctx)
|
|
112
|
-
rs.bc((r, ctx) => {
|
|
117
|
+
rs
|
|
118
|
+
.open([{ s: [CJ, CL], p: 'map', b: 2, g: 'spread' }])
|
|
119
|
+
.bc((r, ctx) => {
|
|
113
120
|
let valnode = r.node;
|
|
114
121
|
let valtype = typeof valnode;
|
|
115
122
|
// console.log('VAL RULE', valtype, r.use, r.node)
|
|
@@ -142,9 +149,11 @@ let AontuJsonic = function aontu(jsonic) {
|
|
|
142
149
|
// let orig_bc = rs.def.bc
|
|
143
150
|
// rs.def.bc = function(rule: Rule, ctx: Context) {
|
|
144
151
|
// let out = orig_bc ? orig_bc.call(this, rule, ctx) : undefined
|
|
145
|
-
rs
|
|
152
|
+
rs
|
|
153
|
+
.open([{ s: [CJ, CL], p: 'pair', b: 2, g: 'spread' }])
|
|
154
|
+
.bc((r) => {
|
|
146
155
|
// console.log('MAP RULE', rule.use, rule.node)
|
|
147
|
-
r.node = addpath(new
|
|
156
|
+
r.node = addpath(new MapVal_1.MapVal(r.node), r.keep.path);
|
|
148
157
|
// return out
|
|
149
158
|
return undefined;
|
|
150
159
|
});
|
|
@@ -155,7 +164,7 @@ let AontuJsonic = function aontu(jsonic) {
|
|
|
155
164
|
// rs.def.bc = function(rule: Rule, ctx: Context) {
|
|
156
165
|
// let out = orig_bc ? orig_bc.call(this, rule, ctx) : undefined
|
|
157
166
|
rs.bc((r) => {
|
|
158
|
-
r.node = addpath(new
|
|
167
|
+
r.node = addpath(new ListVal_1.ListVal(r.node), r.keep.path);
|
|
159
168
|
// return out
|
|
160
169
|
return undefined;
|
|
161
170
|
});
|
|
@@ -167,9 +176,9 @@ let AontuJsonic = function aontu(jsonic) {
|
|
|
167
176
|
.bc((rule) => {
|
|
168
177
|
// TRAVERSE PARENTS TO GET PATH
|
|
169
178
|
if (rule.use.spread) {
|
|
170
|
-
rule.node[
|
|
171
|
-
(rule.node[
|
|
172
|
-
rule.node[
|
|
179
|
+
rule.node[MapVal_1.MapVal.SPREAD] =
|
|
180
|
+
(rule.node[MapVal_1.MapVal.SPREAD] || { o: rule.o0.src, v: [] });
|
|
181
|
+
rule.node[MapVal_1.MapVal.SPREAD].v.push(rule.child.node);
|
|
173
182
|
}
|
|
174
183
|
return undefined;
|
|
175
184
|
});
|
|
@@ -181,9 +190,9 @@ let AontuJsonic = function aontu(jsonic) {
|
|
|
181
190
|
.bc((rule) => {
|
|
182
191
|
// TRAVERSE PARENTS TO GET PATH
|
|
183
192
|
if (rule.use.spread) {
|
|
184
|
-
rule.node[
|
|
185
|
-
(rule.node[
|
|
186
|
-
rule.node[
|
|
193
|
+
rule.node[ListVal_1.ListVal.SPREAD] =
|
|
194
|
+
(rule.node[ListVal_1.ListVal.SPREAD] || { o: rule.o0.src, v: [] });
|
|
195
|
+
rule.node[ListVal_1.ListVal.SPREAD].v.push(rule.child.node);
|
|
187
196
|
}
|
|
188
197
|
return undefined;
|
|
189
198
|
});
|