json-variables 12.0.32 → 12.0.34

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/.eslintcache ADDED
@@ -0,0 +1 @@
1
+ [{"/home/runner/work/codsen/codsen/packages/json-variables/examples/_quickTake.js":"1","/home/runner/work/codsen/codsen/packages/json-variables/perf/check.js":"2","/home/runner/work/codsen/codsen/packages/json-variables/rollup.config.js":"3","/home/runner/work/codsen/codsen/packages/json-variables/src/main.ts":"4","/home/runner/work/codsen/codsen/packages/json-variables/test/arrays.js":"5","/home/runner/work/codsen/codsen/packages/json-variables/test/basic.js":"6","/home/runner/work/codsen/codsen/packages/json-variables/test/clashing-combos.js":"7","/home/runner/work/codsen/codsen/packages/json-variables/test/deeper-levels.js":"8","/home/runner/work/codsen/codsen/packages/json-variables/test/headsNoWrap.js":"9","/home/runner/work/codsen/codsen/packages/json-variables/test/noSingleMarkers.js":"10","/home/runner/work/codsen/codsen/packages/json-variables/test/non-string.js":"11","/home/runner/work/codsen/codsen/packages/json-variables/test/resolveToBoolIfAnyValuesContainBool.js":"12","/home/runner/work/codsen/codsen/packages/json-variables/test/sneaky.js":"13","/home/runner/work/codsen/codsen/packages/json-variables/test/throws.js":"14","/home/runner/work/codsen/codsen/packages/json-variables/test/two-level-querying.js":"15","/home/runner/work/codsen/codsen/packages/json-variables/test/whitelisting.js":"16"},{"size":470,"mtime":1760280945933,"results":"17","hashOfConfig":"18"},{"size":778,"mtime":1760280945934,"results":"19","hashOfConfig":"20"},{"size":373,"mtime":1760280945934,"results":"21","hashOfConfig":"18"},{"size":34919,"mtime":1760280945934,"results":"22","hashOfConfig":"20"},{"size":9796,"mtime":1760280945934,"results":"23","hashOfConfig":"24"},{"size":16935,"mtime":1760280945934,"results":"25","hashOfConfig":"24"},{"size":2500,"mtime":1760280945934,"results":"26","hashOfConfig":"24"},{"size":4489,"mtime":1760280945934,"results":"27","hashOfConfig":"24"},{"size":11524,"mtime":1760280945934,"results":"28","hashOfConfig":"24"},{"size":1207,"mtime":1760280945934,"results":"29","hashOfConfig":"24"},{"size":3983,"mtime":1760280945934,"results":"30","hashOfConfig":"24"},{"size":1923,"mtime":1760280945934,"results":"31","hashOfConfig":"24"},{"size":5976,"mtime":1760280945934,"results":"32","hashOfConfig":"24"},{"size":19796,"mtime":1760280945934,"results":"33","hashOfConfig":"24"},{"size":8565,"mtime":1760280945934,"results":"34","hashOfConfig":"24"},{"size":7257,"mtime":1760280945934,"results":"35","hashOfConfig":"24"},{"filePath":"36","messages":"37","suppressedMessages":"38","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1f1u168",{"filePath":"39","messages":"40","suppressedMessages":"41","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"91l1rm",{"filePath":"42","messages":"43","suppressedMessages":"44","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"45","messages":"46","suppressedMessages":"47","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"48","messages":"49","suppressedMessages":"50","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"ns3qdb",{"filePath":"51","messages":"52","suppressedMessages":"53","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"54","messages":"55","suppressedMessages":"56","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"57","messages":"58","suppressedMessages":"59","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"60","messages":"61","suppressedMessages":"62","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"63","messages":"64","suppressedMessages":"65","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"66","messages":"67","suppressedMessages":"68","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"69","messages":"70","suppressedMessages":"71","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"72","messages":"73","suppressedMessages":"74","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"75","messages":"76","suppressedMessages":"77","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"78","messages":"79","suppressedMessages":"80","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"81","messages":"82","suppressedMessages":"83","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/home/runner/work/codsen/codsen/packages/json-variables/examples/_quickTake.js",[],[],"/home/runner/work/codsen/codsen/packages/json-variables/perf/check.js",[],[],"/home/runner/work/codsen/codsen/packages/json-variables/rollup.config.js",[],[],"/home/runner/work/codsen/codsen/packages/json-variables/src/main.ts",[],[],"/home/runner/work/codsen/codsen/packages/json-variables/test/arrays.js",[],["84","85","86","87","88"],"/home/runner/work/codsen/codsen/packages/json-variables/test/basic.js",[],["89","90","91","92","93"],"/home/runner/work/codsen/codsen/packages/json-variables/test/clashing-combos.js",[],["94","95","96","97","98","99"],"/home/runner/work/codsen/codsen/packages/json-variables/test/deeper-levels.js",[],["100","101","102","103","104","105"],"/home/runner/work/codsen/codsen/packages/json-variables/test/headsNoWrap.js",[],["106","107","108","109","110","111"],"/home/runner/work/codsen/codsen/packages/json-variables/test/noSingleMarkers.js",[],["112","113","114","115","116"],"/home/runner/work/codsen/codsen/packages/json-variables/test/non-string.js",[],["117","118","119","120","121","122"],"/home/runner/work/codsen/codsen/packages/json-variables/test/resolveToBoolIfAnyValuesContainBool.js",[],["123","124","125","126","127","128"],"/home/runner/work/codsen/codsen/packages/json-variables/test/sneaky.js",[],["129","130","131","132","133"],"/home/runner/work/codsen/codsen/packages/json-variables/test/throws.js",[],["134","135","136","137"],"/home/runner/work/codsen/codsen/packages/json-variables/test/two-level-querying.js",[],["138","139","140","141"],"/home/runner/work/codsen/codsen/packages/json-variables/test/whitelisting.js",[],["142","143","144","145","146"],{"ruleId":"147","severity":2,"message":"148","line":5,"column":17,"nodeType":null,"messageId":"149","endLine":5,"endColumn":19,"suppressions":"150"},{"ruleId":"147","severity":2,"message":"151","line":5,"column":21,"nodeType":null,"messageId":"149","endLine":5,"endColumn":23,"suppressions":"152"},{"ruleId":"147","severity":2,"message":"153","line":5,"column":33,"nodeType":null,"messageId":"149","endLine":5,"endColumn":37,"suppressions":"154"},{"ruleId":"147","severity":2,"message":"155","line":5,"column":39,"nodeType":null,"messageId":"149","endLine":5,"endColumn":42,"suppressions":"156"},{"ruleId":"147","severity":2,"message":"157","line":5,"column":44,"nodeType":null,"messageId":"149","endLine":5,"endColumn":49,"suppressions":"158"},{"ruleId":"147","severity":2,"message":"148","line":5,"column":17,"nodeType":null,"messageId":"149","endLine":5,"endColumn":19,"suppressions":"159"},{"ruleId":"147","severity":2,"message":"151","line":5,"column":21,"nodeType":null,"messageId":"149","endLine":5,"endColumn":23,"suppressions":"160"},{"ruleId":"147","severity":2,"message":"153","line":5,"column":33,"nodeType":null,"messageId":"149","endLine":5,"endColumn":37,"suppressions":"161"},{"ruleId":"147","severity":2,"message":"155","line":5,"column":39,"nodeType":null,"messageId":"149","endLine":5,"endColumn":42,"suppressions":"162"},{"ruleId":"147","severity":2,"message":"157","line":5,"column":44,"nodeType":null,"messageId":"149","endLine":5,"endColumn":49,"suppressions":"163"},{"ruleId":"147","severity":2,"message":"148","line":5,"column":17,"nodeType":null,"messageId":"149","endLine":5,"endColumn":19,"suppressions":"164"},{"ruleId":"147","severity":2,"message":"151","line":5,"column":21,"nodeType":null,"messageId":"149","endLine":5,"endColumn":23,"suppressions":"165"},{"ruleId":"147","severity":2,"message":"166","line":5,"column":25,"nodeType":null,"messageId":"149","endLine":5,"endColumn":31,"suppressions":"167"},{"ruleId":"147","severity":2,"message":"153","line":5,"column":33,"nodeType":null,"messageId":"149","endLine":5,"endColumn":37,"suppressions":"168"},{"ruleId":"147","severity":2,"message":"155","line":5,"column":39,"nodeType":null,"messageId":"149","endLine":5,"endColumn":42,"suppressions":"169"},{"ruleId":"147","severity":2,"message":"157","line":5,"column":44,"nodeType":null,"messageId":"149","endLine":5,"endColumn":49,"suppressions":"170"},{"ruleId":"147","severity":2,"message":"148","line":5,"column":17,"nodeType":null,"messageId":"149","endLine":5,"endColumn":19,"suppressions":"171"},{"ruleId":"147","severity":2,"message":"151","line":5,"column":21,"nodeType":null,"messageId":"149","endLine":5,"endColumn":23,"suppressions":"172"},{"ruleId":"147","severity":2,"message":"166","line":5,"column":25,"nodeType":null,"messageId":"149","endLine":5,"endColumn":31,"suppressions":"173"},{"ruleId":"147","severity":2,"message":"153","line":5,"column":33,"nodeType":null,"messageId":"149","endLine":5,"endColumn":37,"suppressions":"174"},{"ruleId":"147","severity":2,"message":"155","line":5,"column":39,"nodeType":null,"messageId":"149","endLine":5,"endColumn":42,"suppressions":"175"},{"ruleId":"147","severity":2,"message":"157","line":5,"column":44,"nodeType":null,"messageId":"149","endLine":5,"endColumn":49,"suppressions":"176"},{"ruleId":"147","severity":2,"message":"148","line":5,"column":17,"nodeType":null,"messageId":"149","endLine":5,"endColumn":19,"suppressions":"177"},{"ruleId":"147","severity":2,"message":"151","line":5,"column":21,"nodeType":null,"messageId":"149","endLine":5,"endColumn":23,"suppressions":"178"},{"ruleId":"147","severity":2,"message":"166","line":5,"column":25,"nodeType":null,"messageId":"149","endLine":5,"endColumn":31,"suppressions":"179"},{"ruleId":"147","severity":2,"message":"153","line":5,"column":33,"nodeType":null,"messageId":"149","endLine":5,"endColumn":37,"suppressions":"180"},{"ruleId":"147","severity":2,"message":"155","line":5,"column":39,"nodeType":null,"messageId":"149","endLine":5,"endColumn":42,"suppressions":"181"},{"ruleId":"147","severity":2,"message":"157","line":5,"column":44,"nodeType":null,"messageId":"149","endLine":5,"endColumn":49,"suppressions":"182"},{"ruleId":"147","severity":2,"message":"183","line":5,"column":10,"nodeType":null,"messageId":"149","endLine":5,"endColumn":15,"suppressions":"184"},{"ruleId":"147","severity":2,"message":"148","line":5,"column":17,"nodeType":null,"messageId":"149","endLine":5,"endColumn":19,"suppressions":"185"},{"ruleId":"147","severity":2,"message":"151","line":5,"column":21,"nodeType":null,"messageId":"149","endLine":5,"endColumn":23,"suppressions":"186"},{"ruleId":"147","severity":2,"message":"153","line":5,"column":33,"nodeType":null,"messageId":"149","endLine":5,"endColumn":37,"suppressions":"187"},{"ruleId":"147","severity":2,"message":"157","line":5,"column":44,"nodeType":null,"messageId":"149","endLine":5,"endColumn":49,"suppressions":"188"},{"ruleId":"147","severity":2,"message":"148","line":5,"column":17,"nodeType":null,"messageId":"149","endLine":5,"endColumn":19,"suppressions":"189"},{"ruleId":"147","severity":2,"message":"151","line":5,"column":21,"nodeType":null,"messageId":"149","endLine":5,"endColumn":23,"suppressions":"190"},{"ruleId":"147","severity":2,"message":"166","line":5,"column":25,"nodeType":null,"messageId":"149","endLine":5,"endColumn":31,"suppressions":"191"},{"ruleId":"147","severity":2,"message":"153","line":5,"column":33,"nodeType":null,"messageId":"149","endLine":5,"endColumn":37,"suppressions":"192"},{"ruleId":"147","severity":2,"message":"155","line":5,"column":39,"nodeType":null,"messageId":"149","endLine":5,"endColumn":42,"suppressions":"193"},{"ruleId":"147","severity":2,"message":"157","line":5,"column":44,"nodeType":null,"messageId":"149","endLine":5,"endColumn":49,"suppressions":"194"},{"ruleId":"147","severity":2,"message":"148","line":5,"column":17,"nodeType":null,"messageId":"149","endLine":5,"endColumn":19,"suppressions":"195"},{"ruleId":"147","severity":2,"message":"151","line":5,"column":21,"nodeType":null,"messageId":"149","endLine":5,"endColumn":23,"suppressions":"196"},{"ruleId":"147","severity":2,"message":"166","line":5,"column":25,"nodeType":null,"messageId":"149","endLine":5,"endColumn":31,"suppressions":"197"},{"ruleId":"147","severity":2,"message":"153","line":5,"column":33,"nodeType":null,"messageId":"149","endLine":5,"endColumn":37,"suppressions":"198"},{"ruleId":"147","severity":2,"message":"155","line":5,"column":39,"nodeType":null,"messageId":"149","endLine":5,"endColumn":42,"suppressions":"199"},{"ruleId":"147","severity":2,"message":"157","line":5,"column":44,"nodeType":null,"messageId":"149","endLine":5,"endColumn":49,"suppressions":"200"},{"ruleId":"147","severity":2,"message":"148","line":5,"column":17,"nodeType":null,"messageId":"149","endLine":5,"endColumn":19,"suppressions":"201"},{"ruleId":"147","severity":2,"message":"151","line":5,"column":21,"nodeType":null,"messageId":"149","endLine":5,"endColumn":23,"suppressions":"202"},{"ruleId":"147","severity":2,"message":"153","line":5,"column":33,"nodeType":null,"messageId":"149","endLine":5,"endColumn":37,"suppressions":"203"},{"ruleId":"147","severity":2,"message":"155","line":5,"column":39,"nodeType":null,"messageId":"149","endLine":5,"endColumn":42,"suppressions":"204"},{"ruleId":"147","severity":2,"message":"157","line":5,"column":44,"nodeType":null,"messageId":"149","endLine":5,"endColumn":49,"suppressions":"205"},{"ruleId":"147","severity":2,"message":"148","line":5,"column":17,"nodeType":null,"messageId":"149","endLine":5,"endColumn":19,"suppressions":"206"},{"ruleId":"147","severity":2,"message":"151","line":5,"column":21,"nodeType":null,"messageId":"149","endLine":5,"endColumn":23,"suppressions":"207"},{"ruleId":"147","severity":2,"message":"153","line":5,"column":33,"nodeType":null,"messageId":"149","endLine":5,"endColumn":37,"suppressions":"208"},{"ruleId":"147","severity":2,"message":"157","line":5,"column":44,"nodeType":null,"messageId":"149","endLine":5,"endColumn":49,"suppressions":"209"},{"ruleId":"147","severity":2,"message":"148","line":5,"column":17,"nodeType":null,"messageId":"149","endLine":5,"endColumn":19,"suppressions":"210"},{"ruleId":"147","severity":2,"message":"151","line":5,"column":21,"nodeType":null,"messageId":"149","endLine":5,"endColumn":23,"suppressions":"211"},{"ruleId":"147","severity":2,"message":"153","line":5,"column":33,"nodeType":null,"messageId":"149","endLine":5,"endColumn":37,"suppressions":"212"},{"ruleId":"147","severity":2,"message":"157","line":5,"column":44,"nodeType":null,"messageId":"149","endLine":5,"endColumn":49,"suppressions":"213"},{"ruleId":"147","severity":2,"message":"148","line":5,"column":17,"nodeType":null,"messageId":"149","endLine":5,"endColumn":19,"suppressions":"214"},{"ruleId":"147","severity":2,"message":"151","line":5,"column":21,"nodeType":null,"messageId":"149","endLine":5,"endColumn":23,"suppressions":"215"},{"ruleId":"147","severity":2,"message":"153","line":5,"column":33,"nodeType":null,"messageId":"149","endLine":5,"endColumn":37,"suppressions":"216"},{"ruleId":"147","severity":2,"message":"155","line":5,"column":39,"nodeType":null,"messageId":"149","endLine":5,"endColumn":42,"suppressions":"217"},{"ruleId":"147","severity":2,"message":"157","line":5,"column":44,"nodeType":null,"messageId":"149","endLine":5,"endColumn":49,"suppressions":"218"},"@typescript-eslint/no-unused-vars","'is' is defined but never used.","unusedVar",["219"],"'ok' is defined but never used.",["220"],"'type' is defined but never used.",["221"],"'not' is defined but never used.",["222"],"'match' is defined but never used.",["223"],["224"],["225"],["226"],["227"],["228"],["229"],["230"],"'throws' is defined but never used.",["231"],["232"],["233"],["234"],["235"],["236"],["237"],["238"],["239"],["240"],["241"],["242"],["243"],["244"],["245"],["246"],"'equal' is defined but never used.",["247"],["248"],["249"],["250"],["251"],["252"],["253"],["254"],["255"],["256"],["257"],["258"],["259"],["260"],["261"],["262"],["263"],["264"],["265"],["266"],["267"],["268"],["269"],["270"],["271"],["272"],["273"],["274"],["275"],["276"],["277"],["278"],["279"],["280"],["281"],{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},{"kind":"282","justification":"283"},"directive",""]
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2010-2025 Roy Revelt and other contributors
3
+ Copyright © 2010-2025 Roy Revelt and other contributors
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining
6
6
  a copy of this software and associated documentation files (the
@@ -19,4 +19,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
19
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
20
  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
21
  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -62,8 +62,8 @@ To report bugs or request features or assistance, [raise an issue](https://githu
62
62
 
63
63
  ## Licence
64
64
 
65
- MIT License.
65
+ MIT License
66
66
 
67
- Copyright © 2010-2025 Roy Revelt and other contributors.
67
+ Copyright © 2010-2025 Roy Revelt and other contributors
68
68
 
69
69
  <p align="center"><img src="https://codsen.com/images/png-codsen-ok.png" width="98" alt="ok" align="center"> <img src="https://codsen.com/images/png-codsen-1.png" width="148" alt="codsen" align="center"> <img src="https://codsen.com/images/png-codsen-star-small.png" width="32" alt="star" align="center"></p>
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  * @name json-variables
3
3
  * @fileoverview Resolves custom-marked, cross-referenced paths in parsed JSON
4
- * @version 12.0.32
5
- * @author Roy Revelt, Codsen Ltd
4
+ * @version 12.0.34
5
+ * @author Roy Revelt
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/json-variables/}
8
8
  */
9
9
 
10
- import{matchLeftIncl as k,matchRightIncl as x}from"string-match-left-right";import{remDup as F}from"string-remove-duplicate-heads-tails";import{strFindHeadsTails as I}from"string-find-heads-tails";import{getByKey as _}from"ast-get-values-by-key";import{arrayiffy as B}from"arrayiffy-if-string";import{traverse as L}from"ast-monkey-traverse";import{rApply as O}from"ranges-apply";import h from"object-path";import{Ranges as U}from"ranges-push";import{isMatch as M}from"matcher";import{isPlainObject as w,existy as q,isBool as A,isNull as N,isStr as o,isNum as K}from"codsen-utils";var j="12.0.32";var ce=j,G=Object.prototype.hasOwnProperty,z={heads:"%%_",tails:"_%%",headsNoWrap:"%%-",tailsNoWrap:"-%%",lookForDataContainers:!0,dataContainerIdentifierTails:"_data",wrapHeadsWith:"",wrapTailsWith:"",dontWrapVars:[],preventDoubleWrapping:!0,wrapGlobalFlipSwitch:!0,noSingleMarkers:!1,resolveToBoolIfAnyValuesContainBool:!0,resolveToFalseIfAnyValuesContainBool:!0,throwWhenNonStringInsertedInString:!1,allowUnresolved:!1};function g(r){return o(r)?r.trim():r}function Y(r){if(o(r)&&r.length&&r.indexOf(".")!==-1){for(let e=0,t=r.length;e<t;e++)if(r[e]===".")return r.slice(0,e)}return r}function Q(r){if(o(r)&&r.length&&r.indexOf(".")!==-1){for(let e=0,t=r.length;e<t;e++)if(r[e]===".")return r.slice(e+1)}return r}function J(r){if(o(r)&&r.length&&r.indexOf(".")!==-1){for(let e=r.length;e--;)if(r[e]===".")return r.slice(0,e)}return r}function P(r){if(o(r)&&r.length&&r.indexOf(".")!==-1){for(let e=r.length;e--;)if(r[e]===".")return r.slice(e+1)}return r}function T(r,e){return!o(r)||!r.trim()?!1:!!(r.includes(e.heads)||r.includes(e.tails)||o(e.headsNoWrap)&&e.headsNoWrap.length&&r.includes(e.headsNoWrap)||o(e.tailsNoWrap)&&e.tailsNoWrap.length&&r.includes(e.tailsNoWrap))}function X(r,e,t){let l,s;return o(r)&&r.length&&x(r,0,e,{trimBeforeMatching:!0,cb:(n,a,i)=>(l=i,!0)})&&k(r,r.length-1,t,{trimBeforeMatching:!0,cb:(n,a,i)=>(s=(i||0)+1,!0)})?r.slice(l,s):r}function H(r,e,t=!1,l,s,n){if(e.wrapHeadsWith||(e.wrapHeadsWith=""),e.wrapTailsWith||(e.wrapTailsWith=""),o(r)&&!t&&e.wrapGlobalFlipSwitch&&!e.dontWrapVars.some(a=>M(n,a))&&(!e.preventDoubleWrapping||e.preventDoubleWrapping&&o(r)&&!r.includes(e.wrapHeadsWith)&&!r.includes(e.wrapTailsWith)))return`${e.wrapHeadsWith}${r}${e.wrapTailsWith}`;if(t){if(!o(r))return r;let a=F(r,{heads:e.wrapHeadsWith,tails:e.wrapTailsWith});return o(a)?X(a,e.wrapHeadsWith,e.wrapTailsWith):a}return r}function Z(r,e,t,l){let s;if(t.indexOf(".")!==-1){let n=t,a=!0;if(l.lookForDataContainers&&o(l.dataContainerIdentifierTails)&&l.dataContainerIdentifierTails.length&&!n.endsWith(l.dataContainerIdentifierTails)){let i=h.get(r,n+l.dataContainerIdentifierTails);w(i)&&h.get(i,e)&&(s=h.get(i,e),a=!1)}for(;a&&n.indexOf(".")!==-1;){if(n=J(n),P(n)===e)throw new Error(`json-variables/findValues(): [THROW_ID_20] While trying to resolve: "${e}" at path "${t}", we encountered a closed loop. The parent key "${P(n)}" is called the same as the variable "${e}" we're looking for.`);if(l.lookForDataContainers&&o(l.dataContainerIdentifierTails)&&l.dataContainerIdentifierTails.length&&!n.endsWith(l.dataContainerIdentifierTails)){let i=h.get(r,n+l.dataContainerIdentifierTails);w(i)&&h.get(i,e)&&(s=h.get(i,e),a=!1)}if(s===void 0){let i=h.get(r,n);w(i)&&h.get(i,e)&&(s=h.get(i,e),a=!1)}}}if(s===void 0){let n=h.get(r,e);n!==void 0&&(s=n)}if(s===void 0)if(e.indexOf(".")===-1){let n=_(r,e);if(n.length){for(let a=0,i=n.length;a<i;a++)if(o(n[a].val)||A(n[a].val)||N(n[a].val)){s=n[a].val;break}else if(K(n[a].val)){s=String(n[a].val);break}else if(Array.isArray(n[a].val)){s=n[a].val.join("");break}}}else{let n=_(r,Y(e));if(n.length)for(let a=0,i=n.length;a<i;a++){let m=h.get(n[a].val,Q(e));m&&o(m)&&(s=m)}}return s}function R(r,e,t,l,s=[]){if(s.includes(t)){let c="";if(s.length>1){let y=` \u2192
10
+ import{matchLeftIncl as k,matchRightIncl as x}from"string-match-left-right";import{remDup as F}from"string-remove-duplicate-heads-tails";import{strFindHeadsTails as I}from"string-find-heads-tails";import{getByKey as _}from"ast-get-values-by-key";import{arrayiffy as B}from"arrayiffy-if-string";import{traverse as L}from"ast-monkey-traverse";import{rApply as O}from"ranges-apply";import h from"object-path";import{Ranges as U}from"ranges-push";import{isMatch as M}from"matcher";import{isPlainObject as w,existy as q,isBool as A,isNull as N,isStr as o,isNum as K}from"codsen-utils";var j="12.0.34";var ce=j,G=Object.prototype.hasOwnProperty,z={heads:"%%_",tails:"_%%",headsNoWrap:"%%-",tailsNoWrap:"-%%",lookForDataContainers:!0,dataContainerIdentifierTails:"_data",wrapHeadsWith:"",wrapTailsWith:"",dontWrapVars:[],preventDoubleWrapping:!0,wrapGlobalFlipSwitch:!0,noSingleMarkers:!1,resolveToBoolIfAnyValuesContainBool:!0,resolveToFalseIfAnyValuesContainBool:!0,throwWhenNonStringInsertedInString:!1,allowUnresolved:!1};function g(r){return o(r)?r.trim():r}function Y(r){if(o(r)&&r.length&&r.indexOf(".")!==-1){for(let e=0,t=r.length;e<t;e++)if(r[e]===".")return r.slice(0,e)}return r}function Q(r){if(o(r)&&r.length&&r.indexOf(".")!==-1){for(let e=0,t=r.length;e<t;e++)if(r[e]===".")return r.slice(e+1)}return r}function J(r){if(o(r)&&r.length&&r.indexOf(".")!==-1){for(let e=r.length;e--;)if(r[e]===".")return r.slice(0,e)}return r}function P(r){if(o(r)&&r.length&&r.indexOf(".")!==-1){for(let e=r.length;e--;)if(r[e]===".")return r.slice(e+1)}return r}function T(r,e){return!o(r)||!r.trim()?!1:!!(r.includes(e.heads)||r.includes(e.tails)||o(e.headsNoWrap)&&e.headsNoWrap.length&&r.includes(e.headsNoWrap)||o(e.tailsNoWrap)&&e.tailsNoWrap.length&&r.includes(e.tailsNoWrap))}function X(r,e,t){let l,s;return o(r)&&r.length&&x(r,0,e,{trimBeforeMatching:!0,cb:(n,a,i)=>(l=i,!0)})&&k(r,r.length-1,t,{trimBeforeMatching:!0,cb:(n,a,i)=>(s=(i||0)+1,!0)})?r.slice(l,s):r}function H(r,e,t=!1,l,s,n){if(e.wrapHeadsWith||(e.wrapHeadsWith=""),e.wrapTailsWith||(e.wrapTailsWith=""),o(r)&&!t&&e.wrapGlobalFlipSwitch&&!e.dontWrapVars.some(a=>M(n,a))&&(!e.preventDoubleWrapping||e.preventDoubleWrapping&&o(r)&&!r.includes(e.wrapHeadsWith)&&!r.includes(e.wrapTailsWith)))return`${e.wrapHeadsWith}${r}${e.wrapTailsWith}`;if(t){if(!o(r))return r;let a=F(r,{heads:e.wrapHeadsWith,tails:e.wrapTailsWith});return o(a)?X(a,e.wrapHeadsWith,e.wrapTailsWith):a}return r}function Z(r,e,t,l){let s;if(t.indexOf(".")!==-1){let n=t,a=!0;if(l.lookForDataContainers&&o(l.dataContainerIdentifierTails)&&l.dataContainerIdentifierTails.length&&!n.endsWith(l.dataContainerIdentifierTails)){let i=h.get(r,n+l.dataContainerIdentifierTails);w(i)&&h.get(i,e)&&(s=h.get(i,e),a=!1)}for(;a&&n.indexOf(".")!==-1;){if(n=J(n),P(n)===e)throw new Error(`json-variables/findValues(): [THROW_ID_20] While trying to resolve: "${e}" at path "${t}", we encountered a closed loop. The parent key "${P(n)}" is called the same as the variable "${e}" we're looking for.`);if(l.lookForDataContainers&&o(l.dataContainerIdentifierTails)&&l.dataContainerIdentifierTails.length&&!n.endsWith(l.dataContainerIdentifierTails)){let i=h.get(r,n+l.dataContainerIdentifierTails);w(i)&&h.get(i,e)&&(s=h.get(i,e),a=!1)}if(s===void 0){let i=h.get(r,n);w(i)&&h.get(i,e)&&(s=h.get(i,e),a=!1)}}}if(s===void 0){let n=h.get(r,e);n!==void 0&&(s=n)}if(s===void 0)if(e.indexOf(".")===-1){let n=_(r,e);if(n.length){for(let a=0,i=n.length;a<i;a++)if(o(n[a].val)||A(n[a].val)||N(n[a].val)){s=n[a].val;break}else if(K(n[a].val)){s=String(n[a].val);break}else if(Array.isArray(n[a].val)){s=n[a].val.join("");break}}}else{let n=_(r,Y(e));if(n.length)for(let a=0,i=n.length;a<i;a++){let m=h.get(n[a].val,Q(e));m&&o(m)&&(s=m)}}return s}function R(r,e,t,l,s=[]){if(s.includes(t)){let c="";if(s.length>1){let y=` \u2192
11
11
  `;c=s.reduce((D,b,S)=>D+(S===0?"":y)+(b===t?"\u{1F4A5} ":" ")+b,` Here's the path we travelled up until we hit the recursion:
12
12
 
13
13
  `),c+=`${y}\u{1F4A5} ${t}`}throw new Error(`json-variables/resolveString(): [THROW_ID_19] While trying to resolve: "${e}" at path "${t}", we encountered a closed loop, the key is referencing itself."${c}`)}let n={},a=Array.from(s);a.push(t);let i=new U;function m(c,y,D){for(let b=0,S=c.length;b<S;b++){let f=c[b],p=e.slice(f.headsEndAt,f.tailsStartAt);if(p.length===0)i.push(f.headsStartAt,f.tailsEndAt);else if(G.call(n,p)&&o(n[p]))i.push(f.headsStartAt,f.tailsEndAt,n[p]);else{let u=Z(r,p.trim(),t,l);if(u===void 0)if(l.allowUnresolved===!0)u="";else if(o(l.allowUnresolved))u=l.allowUnresolved;else throw new Error(`json-variables/processHeadsAndTails(): [THROW_ID_18] We couldn't find the value to resolve the variable ${e.slice(f.headsEndAt,f.tailsStartAt)}. We're at path: "${t}".`);if(!D&&l.throwWhenNonStringInsertedInString&&!o(u))throw new Error(`json-variables/processHeadsAndTails(): [THROW_ID_23] While resolving the variable ${e.slice(f.headsEndAt,f.tailsStartAt)} at path ${t}, it resolved into a non-string value, ${JSON.stringify(u,null,4)}. This is happening because options setting "throwWhenNonStringInsertedInString" is active (set to "true").`);if(A(u)){if(l.resolveToBoolIfAnyValuesContainBool)return i.wipe(),l.resolveToFalseIfAnyValuesContainBool?!1:u;u=""}else{if(N(u)&&D)return i.wipe(),u;Array.isArray(u)?u=String(u.join("")):N(u)?u="":u=String(u)}let v=t.includes(".")?`${J(t)}.${p}`:p;if(T(u,l)){let V=H(R(r,u,v,l,a),l,y,a,v,p.trim());o(V)&&i.push(f.headsStartAt,f.tailsEndAt,V)}else{n[p]=u;let V=H(u,l,y,a,v,p.trim());o(V)&&i.push(f.headsStartAt,f.tailsEndAt,V)}}}}let d;try{d=I(e,l.heads,l.tails,{source:"",throwWhenSomethingWrongIsDetected:!1})}catch(c){throw new Error(`json-variables/resolveString(): [THROW_ID_17] While trying to resolve string: "${e}" at path ${t}, something wrong with heads and tails was detected! Here's the internal error message:
@@ -1,122 +1,122 @@
1
1
  /**
2
2
  * @name json-variables
3
3
  * @fileoverview Resolves custom-marked, cross-referenced paths in parsed JSON
4
- * @version 12.0.32
5
- * @author Roy Revelt, Codsen Ltd
4
+ * @version 12.0.34
5
+ * @author Roy Revelt
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/json-variables/}
8
8
  */
9
9
 
10
- "use strict";var jsonVariables=(()=>{var Be=Object.create,oe=Object.freeze,R=Object.defineProperty,Me=Object.defineProperties,Je=Object.getOwnPropertyDescriptor,ke=Object.getOwnPropertyDescriptors,Fe=Object.getOwnPropertyNames,le=Object.getOwnPropertySymbols,Le=Object.getPrototypeOf,ue=Object.prototype.hasOwnProperty,qe=Object.prototype.propertyIsEnumerable;var Z=(e,r,n)=>r in e?R(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n,T=(e,r)=>{for(var n in r||(r={}))ue.call(r,n)&&Z(e,n,r[n]);if(le)for(var n of le(r))qe.call(r,n)&&Z(e,n,r[n]);return e},P=(e,r)=>Me(e,ke(r));var fe=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),Ue=(e,r)=>{for(var n in r)R(e,n,{get:r[n],enumerable:!0})},ce=(e,r,n,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let f of Fe(r))!ue.call(e,f)&&f!==n&&R(e,f,{get:()=>r[f],enumerable:!(i=Je(r,f))||i.enumerable});return e};var k=(e,r,n)=>(n=e!=null?Be(Le(e)):{},ce(r||!e||!e.__esModule?R(n,"default",{value:e,enumerable:!0}):n,e)),Ke=e=>ce(R({},"__esModule",{value:!0}),e);var Y=(e,r,n)=>Z(e,typeof r!="symbol"?r+"":r,n);var F=(e,r)=>oe(R(e,"raw",{value:oe(r||e.slice())}));var L=fe((mr,ge)=>{"use strict";ge.exports=ze;function V(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}function ze(e){if(e=e||{},e.circles)return Ge(e);let r=new Map;if(r.set(Date,a=>new Date(a)),r.set(Map,(a,o)=>new Map(i(Array.from(a),o))),r.set(Set,(a,o)=>new Set(i(Array.from(a),o))),e.constructorHandlers)for(let a of e.constructorHandlers)r.set(a[0],a[1]);let n=null;return e.proto?t:f;function i(a,o){let u=Object.keys(a),l=new Array(u.length);for(let s=0;s<u.length;s++){let c=u[s],$=a[c];typeof $!="object"||$===null?l[c]=$:$.constructor!==Object&&(n=r.get($.constructor))?l[c]=n($,o):ArrayBuffer.isView($)?l[c]=V($):l[c]=o($)}return l}function f(a){if(typeof a!="object"||a===null)return a;if(Array.isArray(a))return i(a,f);if(a.constructor!==Object&&(n=r.get(a.constructor)))return n(a,f);let o={};for(let u in a){if(Object.hasOwnProperty.call(a,u)===!1)continue;let l=a[u];typeof l!="object"||l===null?o[u]=l:l.constructor!==Object&&(n=r.get(l.constructor))?o[u]=n(l,f):ArrayBuffer.isView(l)?o[u]=V(l):o[u]=f(l)}return o}function t(a){if(typeof a!="object"||a===null)return a;if(Array.isArray(a))return i(a,t);if(a.constructor!==Object&&(n=r.get(a.constructor)))return n(a,t);let o={};for(let u in a){let l=a[u];typeof l!="object"||l===null?o[u]=l:l.constructor!==Object&&(n=r.get(l.constructor))?o[u]=n(l,t):ArrayBuffer.isView(l)?o[u]=V(l):o[u]=t(l)}return o}}function Ge(e){let r=[],n=[],i=new Map;if(i.set(Date,u=>new Date(u)),i.set(Map,(u,l)=>new Map(t(Array.from(u),l))),i.set(Set,(u,l)=>new Set(t(Array.from(u),l))),e.constructorHandlers)for(let u of e.constructorHandlers)i.set(u[0],u[1]);let f=null;return e.proto?o:a;function t(u,l){let s=Object.keys(u),c=new Array(s.length);for(let $=0;$<s.length;$++){let d=s[$],h=u[d];if(typeof h!="object"||h===null)c[d]=h;else if(h.constructor!==Object&&(f=i.get(h.constructor)))c[d]=f(h,l);else if(ArrayBuffer.isView(h))c[d]=V(h);else{let y=r.indexOf(h);y!==-1?c[d]=n[y]:c[d]=l(h)}}return c}function a(u){if(typeof u!="object"||u===null)return u;if(Array.isArray(u))return t(u,a);if(u.constructor!==Object&&(f=i.get(u.constructor)))return f(u,a);let l={};r.push(u),n.push(l);for(let s in u){if(Object.hasOwnProperty.call(u,s)===!1)continue;let c=u[s];if(typeof c!="object"||c===null)l[s]=c;else if(c.constructor!==Object&&(f=i.get(c.constructor)))l[s]=f(c,a);else if(ArrayBuffer.isView(c))l[s]=V(c);else{let $=r.indexOf(c);$!==-1?l[s]=n[$]:l[s]=a(c)}}return r.pop(),n.pop(),l}function o(u){if(typeof u!="object"||u===null)return u;if(Array.isArray(u))return t(u,o);if(u.constructor!==Object&&(f=i.get(u.constructor)))return f(u,o);let l={};r.push(u),n.push(l);for(let s in u){let c=u[s];if(typeof c!="object"||c===null)l[s]=c;else if(c.constructor!==Object&&(f=i.get(c.constructor)))l[s]=f(c,o);else if(ArrayBuffer.isView(c))l[s]=V(c);else{let $=r.indexOf(c);$!==-1?l[s]=n[$]:l[s]=o(c)}}return r.pop(),n.pop(),l}}});var xe=fe((Ne,G)=>{(function(e,r){"use strict";typeof G=="object"&&typeof G.exports=="object"?G.exports=r():typeof define=="function"&&define.amd?define([],r):e.objectPath=r()})(Ne,function(){"use strict";var e=Object.prototype.toString;function r(s,c){return s==null?!1:Object.prototype.hasOwnProperty.call(s,c)}function n(s){if(!s||t(s)&&s.length===0)return!0;if(typeof s!="string"){for(var c in s)if(r(s,c))return!1;return!0}return!1}function i(s){return e.call(s)}function f(s){return typeof s=="object"&&i(s)==="[object Object]"}var t=Array.isArray||function(s){return e.call(s)==="[object Array]"};function a(s){return typeof s=="boolean"||i(s)==="[object Boolean]"}function o(s){var c=parseInt(s);return c.toString()===s?c:s}function u(s){s=s||{};var c=function(m){return Object.keys(c).reduce(function(g,p){return p==="create"||typeof c[p]=="function"&&(g[p]=c[p].bind(c,m)),g},{})},$;s.includeInheritedProps?$=function(){return!0}:$=function(m,g){return typeof g=="number"&&Array.isArray(m)||r(m,g)};function d(m,g){if($(m,g))return m[g]}var h;s.includeInheritedProps?h=function(m,g){typeof g!="string"&&typeof g!="number"&&(g=String(g));var p=d(m,g);if(g==="__proto__"||g==="prototype"||g==="constructor"&&typeof p=="function")throw new Error("For security reasons, object's magic properties cannot be set");return p}:h=function(m,g){return d(m,g)};function y(m,g,p,b){if(typeof g=="number"&&(g=[g]),!g||g.length===0)return m;if(typeof g=="string")return y(m,g.split(".").map(o),p,b);var w=g[0],v=h(m,w);return g.length===1?((v===void 0||!b)&&(m[w]=p),v):(v===void 0&&(typeof g[1]=="number"?m[w]=[]:m[w]={}),y(m[w],g.slice(1),p,b))}return c.has=function(m,g){if(typeof g=="number"?g=[g]:typeof g=="string"&&(g=g.split(".")),!g||g.length===0)return!!m;for(var p=0;p<g.length;p++){var b=o(g[p]);if(typeof b=="number"&&t(m)&&b<m.length||(s.includeInheritedProps?b in Object(m):r(m,b)))m=m[b];else return!1}return!0},c.ensureExists=function(m,g,p){return y(m,g,p,!0)},c.set=function(m,g,p,b){return y(m,g,p,b)},c.insert=function(m,g,p,b){var w=c.get(m,g);b=~~b,t(w)||(w=[],c.set(m,g,w)),w.splice(b,0,p)},c.empty=function(m,g){if(!n(g)&&m!=null){var p,b;if(p=c.get(m,g)){if(typeof p=="string")return c.set(m,g,"");if(a(p))return c.set(m,g,!1);if(typeof p=="number")return c.set(m,g,0);if(t(p))p.length=0;else if(f(p))for(b in p)$(p,b)&&delete p[b];else return c.set(m,g,null)}}},c.push=function(m,g){var p=c.get(m,g);t(p)||(p=[],c.set(m,g,p)),p.push.apply(p,Array.prototype.slice.call(arguments,2))},c.coalesce=function(m,g,p){for(var b,w=0,v=g.length;w<v;w++)if((b=c.get(m,g[w]))!==void 0)return b;return p},c.get=function(m,g,p){if(typeof g=="number"&&(g=[g]),!g||g.length===0)return m;if(m==null)return p;if(typeof g=="string")return c.get(m,g.split("."),p);var b=o(g[0]),w=h(m,b);return w===void 0?p:g.length===1?w:c.get(m[b],g.slice(1),p)},c.del=function(g,p){if(typeof p=="number"&&(p=[p]),g==null||n(p))return g;if(typeof p=="string")return c.del(g,p.split("."));var b=o(p[0]);if(h(g,b),!$(g,b))return g;if(p.length===1)t(g)?g.splice(b,1):delete g[b];else return c.del(g[b],p.slice(1));return g},c}var l=u();return l.create=u,l.withInheritedProps=u({includeInheritedProps:!0}),l})});var pr={};Ue(pr,{defaults:()=>He,jVar:()=>hr,version:()=>or});function I(e){return typeof e!="string"?e:e.length?[e]:[]}var he=k(L(),1);var wr=(0,he.default)();function E(e){if(e==null||typeof e!="object")return!1;let r=Object.getPrototypeOf(e);return r!==null&&r!==Object.prototype&&Object.getPrototypeOf(r)!==null?!1:!(Symbol.iterator in e)&&!(Symbol.toStringTag in e)}function A(e){return typeof e=="string"}function pe(e){return Number.isFinite(e)}function N(e){return Number.isSafeInteger(e)&&e>=0}function q(e){return typeof e=="boolean"}function B(e){return e===null}function S(e){return e!=null}function de(e,r){return E(e)&&A(r)&&r in e}var ye={cb:void 0,i:!1,trimBeforeMatching:!1,trimCharsBeforeMatching:[],maxMismatches:0,firstMustMatch:!1,lastMustMatch:!1,hungry:!1},Qe=e=>e+1;function Ze(e,r,n,i,f=!1,t=Qe){var b;let a=typeof n=="function"?n():n;if(+r<0&&f&&a==="EOL")return a;let o=T(T({},ye),i);if(r>=e.length&&!f)return!1;let u=f?1:n.length,l=0,s=!1,c=!1,$=!1,d=o.maxMismatches,h=r,y=!1,m=!1,g=!1;function p(){return l===1&&d<o.maxMismatches-1}for(;e[h];){let w=t(h);if(o.trimBeforeMatching&&e[h].trim()===""){if(!e[w]&&f&&n==="EOL")return!0;h=t(h);continue}if(o&&!o.i&&((b=o==null?void 0:o.trimCharsBeforeMatching)!=null&&b.includes(e[h]))||o!=null&&o.i&&o.trimCharsBeforeMatching&&o.trimCharsBeforeMatching.map(W=>W.toLowerCase()).includes(e[h].toLowerCase())){if(f&&n==="EOL"&&!e[w])return!0;h=t(h);continue}let v=w>h?n[n.length-u]:n[u-1];if(!o.i&&e[h]===v||o.i&&e[h].toLowerCase()===v.toLowerCase()){if(y||(y=!0),$||($=!0),u===n.length){if(m=!0,d!==o.maxMismatches)return!1}else u===1&&(g=!0);if(u-=1,l++,p())return!1;if(!u)return l!==n.length||d===o.maxMismatches||!s?h:!1}else if(!s&&!l&&(s=!0),o.maxMismatches&&d&&h){d-=1;for(let W=0;W<=d;W++){let x=w>h?n[n.length-u+1+W]:n[u-2-W],Q=e[t(h)];if(x&&(!o.i&&e[h]===x||o.i&&e[h].toLowerCase()===x.toLowerCase())&&(!o.firstMustMatch||u!==n.length)){if(l++,p())return!1;u-=2,y=!0;break}else if(Q&&x&&(!o.i&&Q===x||o.i&&Q.toLowerCase()===x.toLowerCase())&&(!o.firstMustMatch||u!==n.length)){if(!l&&!o.hungry)return!1;u-=1,y=!0;break}else if(x===void 0&&d>=0&&y&&(!o.firstMustMatch||m)&&(!o.lastMustMatch||g))return h}y||(c=h)}else return h===0&&u===1&&!o.lastMustMatch&&$?0:!1;if(c!==!1&&c!==h&&(c=!1),u<1)return h;h=t(h)}if(u>0)return f&&a==="EOL"?!0:o&&o.maxMismatches>=u&&$?c||0:!1}function me(e,r,n,i,f){var s,c,$;if(E(f)&&de(f,"trimBeforeMatching")&&f&&typeof f.trimBeforeMatching!="boolean")throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_09] opts.trimBeforeMatching should be boolean!").concat(Array.isArray(f.trimBeforeMatching)?" Did you mean to use opts.trimCharsBeforeMatching?":""));let t=T(T({},ye),f);if(typeof t.trimCharsBeforeMatching=="string"&&(t.trimCharsBeforeMatching=I(t.trimCharsBeforeMatching)),t.trimCharsBeforeMatching=t.trimCharsBeforeMatching.map(d=>A(d)?d:String(d)),!A(r)||!r.length)return!1;if(!Number.isInteger(n)||n<0)throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_03] the second argument should be a natural number. Currently it's of a type: ").concat(typeof n,", equal to:\n").concat(JSON.stringify(n,null,4)));let a,o;if(A(i))a=[i];else if(Array.isArray(i))a=i;else if(!i)a=i;else if(typeof i=="function")a=[],a.push(i);else throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_05] the third argument, whatToMatch, is neither string nor array of strings! It's ").concat(typeof i,", equal to:\n").concat(JSON.stringify(i,null,4)));if(f&&!E(f))throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_06] the fourth argument, options object, should be a plain object. Currently it's of a type \"").concat(typeof f,'", and equal to:\n').concat(JSON.stringify(f,null,4)));let u=0,l="";if((s=t==null?void 0:t.trimCharsBeforeMatching)!=null&&s.some((d,h)=>d.length>1?(u=h,l=d,!0):!1))throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_07] the fourth argument, options object contains trimCharsBeforeMatching. It was meant to list the single characters but one of the entries at index ").concat(u," is longer than 1 character, ").concat(l.length," (equals to ").concat(l,"). Please split it into separate characters and put into array as separate elements."));if(!a||!Array.isArray(a)||Array.isArray(a)&&!a.length||Array.isArray(a)&&a.length===1&&A(a[0])&&!a[0].trim()){if(typeof t.cb=="function"){let h,y=n;if((e==="matchLeftIncl"||e==="matchRight")&&(y+=1),e[5]==="L")for(let b=y;b--;){let w=r[b];if((!t.trimBeforeMatching||t.trimBeforeMatching&&(w!=null&&w.trim()))&&(!((c=t.trimCharsBeforeMatching)!=null&&c.length)||w!==void 0&&!t.trimCharsBeforeMatching.includes(w))){h=b;break}}else if(e.startsWith("matchRight"))for(let b=y;b<r.length;b++){let w=r[b];if((!t.trimBeforeMatching||t.trimBeforeMatching&&w.trim())&&(!(($=t.trimCharsBeforeMatching)!=null&&$.length)||!t.trimCharsBeforeMatching.includes(w))){h=b;break}}if(h===void 0)return!1;let m=r[h],g=h+1,p="";return g&&g>0&&(p=r.slice(0,g)),e[5]==="L"||h&&h>0&&(p=r.slice(h)),t.cb(m,p,h)}let d="";throw f||(d=" More so, the whole options object, the fourth input argument, is missing!"),new Error("string-match-left-right/".concat(e,'(): [THROW_ID_08] the third argument, "whatToMatch", was given as an empty string. This means, you intend to match purely by a callback. The callback was not set though, the opts key "cb" is not set!').concat(d))}for(let d=0,h=a.length;d<h;d++){o=typeof a[d]=="function";let y=a[d],m,g,p="",b=n;e==="matchRight"?b+=1:e==="matchLeft"&&(b-=1);let w=Ze(r,b,y,t,o,v=>e[5]==="L"?v-1:v+1);if(w&&o&&typeof y=="function"&&y()==="EOL")return y()&&(!t.cb||t.cb(m,p,g))?y():!1;if(Number.isInteger(w)&&(g=e.startsWith("matchLeft")?w-1:w+1,e[5]==="L"?p=r.slice(0,w):p=r.slice(g)),g<0&&(g=void 0),r[g]&&(m=r[g]),Number.isInteger(w)&&(!t.cb||t.cb(m,p,g)))return y}return!1}function C(e,r,n,i){return me("matchLeftIncl",e,r,n,i)}function D(e,r,n,i){return me("matchRightIncl",e,r,n,i)}function U(e,r=1){let n="\xA0";function i(t){return Array.from(t).reverse().join("")}function f(t,a,o){let u=o?"\n":"\r",l=o?"\r":"\n";if(!t)return t;let s=0,c=0,$="";for(let d=0,h=t.length;d<h;d++)(t[d]===u||t[d]===l&&t[d-1]!==u)&&c++,"\r\n".includes(t[d])||t[d]===n?(s=0,t[d]===n?$+=t[d]:t[d]===u?c<=a&&($+=t[d],t[d+1]===l&&($+=t[d+1],d++)):t[d]===l&&(t==null?void 0:t[d-1])!==u&&c<=a&&($+=t[d])):(s++,!t[d+1]&&!c&&($+=" "));return $}if(typeof e=="string"&&e.length){let t=1;typeof+r=="number"&&Number.isInteger(+r)&&+r>=0&&(t=+r);let a="",o="";if(!e.trim())a=e;else if(!e[0].trim()){for(let u=0,l=e.length;u<l;u++)if(e[u].trim()){a=e.slice(0,u);break}}if(e.trim()&&(e.slice(-1).trim()===""||e.slice(-1)===n)){for(let u=e.length;u--;)if(e[u].trim()){o=e.slice(u+1);break}}return"".concat(f(a,t,!1)).concat(e.trim()).concat(i(f(i(o),t,!0)))}return e}var Ye={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function H(e,r){if(!Array.isArray(e)||!e.length)return e;let n=T(T({},Ye),r),i,f;if(n.strictlyTwoElementsInRangeArrays&&!e.every((o,u)=>!Array.isArray(o)||o.length!==2?(i=u,f=o.length,!1):!0))throw new TypeError("ranges-sort: [THROW_ID_03] The first argument should be an array and must consist of arrays which are natural number indexes representing TWO string index ranges. However, ".concat(i,"th range (").concat(JSON.stringify(e[i],null,4),") has not two but ").concat(f," elements!"));if(!e.every((o,u)=>!Array.isArray(o)||!Number.isInteger(o[0])||o[0]<0||!Number.isInteger(o[1])||o[1]<0?(i=u,!1):!0))throw new TypeError("ranges-sort: [THROW_ID_04] The first argument should be an array and must consist of arrays which are natural number indexes representing string index ranges. However, ".concat(i,"th range (").concat(JSON.stringify(e[i],null,4),") does not consist of only natural numbers!"));let t=e.length**2,a=0;return Array.from(e).sort((o,u)=>(n.progressFn&&(a+=1,n.progressFn(Math.floor(a*100/t))),o[0]===u[0]?o[1]<u[1]?-1:o[1]>u[1]?1:0:o[0]<u[0]?-1:1))}var we={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function Xe(e,r){var l;function n(s){return!!s&&typeof s=="object"&&!Array.isArray(s)}if(!Array.isArray(e)||!e.length)return null;let i;if(r)if(n(r)){if(i=T(T({},we),r),i.progressFn&&n(i.progressFn)&&!Object.keys(i.progressFn).length)i.progressFn=null;else if(i.progressFn&&typeof i.progressFn!="function")throw new Error('ranges-merge: [THROW_ID_01] resolvedOpts.progressFn must be a function! It was given of a type: "'.concat(typeof i.progressFn,'", equal to ').concat(JSON.stringify(i.progressFn,null,4)));if(![1,2,"1","2"].includes(i.mergeType))throw new Error('ranges-merge: [THROW_ID_02] resolvedOpts.mergeType was customised to a wrong thing! It was given of a type: "'.concat(typeof i.mergeType,'", equal to ').concat(JSON.stringify(i.mergeType,null,4)));if(typeof i.joinRangesThatTouchEdges!="boolean")throw new Error('ranges-merge: [THROW_ID_04] resolvedOpts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "'.concat(typeof i.joinRangesThatTouchEdges,'", equal to ').concat(JSON.stringify(i.joinRangesThatTouchEdges,null,4)))}else throw new Error("ranges-merge: [THROW_ID_03] the second input argument must be a plain object. It was given as:\n".concat(JSON.stringify(r,null,4)," (type ").concat(typeof r,")"));else i=T({},we);let f=e.filter(s=>Array.isArray(s)).map(s=>[...s]).filter(s=>s[2]!==void 0||s[0]!==s[1]),t,a,o;i.progressFn?t=H(f,{progressFn:s=>{o=Math.floor(s/5),o!==a&&(a=o,i.progressFn!=null&&i.progressFn(o))}}):t=H(f);let u=t.length-1;for(let s=u;s>0;s--)i.progressFn&&(o=Math.floor((1-s/u)*78)+21,o!==a&&o>a&&(a=o,i.progressFn(o))),(t[s][0]<=t[s-1][0]||!i.joinRangesThatTouchEdges&&t[s][0]<t[s-1][1]||i.joinRangesThatTouchEdges&&t[s][0]<=t[s-1][1])&&(t[s-1][0]=Math.min(t[s][0],t[s-1][0]),t[s-1][1]=Math.max(t[s][1],t[s-1][1]),t[s][2]!==void 0&&(t[s-1][0]>=t[s][0]||t[s-1][1]<=t[s][1])&&t[s-1][2]!==null&&(t[s][2]===null&&t[s-1][2]!==null?t[s-1][2]=null:t[s-1][2]!=null?+((l=i||{})==null?void 0:l.mergeType)==2&&t[s-1][0]===t[s][0]?t[s-1][2]=t[s][2]:t[s-1][2]+=t[s][2]:t[s-1][2]=t[s][2]),t.splice(s,1),s=t.length);return t.length?t:null}var er={limitToBeAddedWhitespace:!1,limitLinebreaksCount:1,mergeType:1},M=class{constructor(e){Y(this,"ranges");Y(this,"opts");let r=T(T({},er),e);if(r.mergeType&&r.mergeType!==1&&r.mergeType!==2)if(A(r.mergeType)&&r.mergeType.trim()==="1")r.mergeType=1;else if(A(r.mergeType)&&r.mergeType.trim()==="2")r.mergeType=2;else throw new Error('ranges-push: [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "'.concat(typeof r.mergeType,'", equal to ').concat(JSON.stringify(r.mergeType,null,4)));this.opts=r,this.ranges=[]}add(e,r,n){var t;if(e==null&&r==null)return;if(S(e)&&!S(r)){if(Array.isArray(e)){if(e.length){if(e.some(a=>Array.isArray(a))){e.forEach(a=>{Array.isArray(a)&&this.add(...a)});return}e.length&&N(+e[0])&&N(+e[1])&&this.add(...e)}return}throw new TypeError('ranges-push/Ranges/add(): [THROW_ID_12] the first input argument, "from" is set ('.concat(JSON.stringify(e,null,0),') but second-one, "to" is not (').concat(JSON.stringify(r,null,0),")"))}else if(!S(e)&&S(r))throw new TypeError('ranges-push/Ranges/add(): [THROW_ID_13] the second input argument, "to" is set ('.concat(JSON.stringify(r,null,0),') but first-one, "from" is not (').concat(JSON.stringify(e,null,0),")"));let i=+e,f=+r;if(N(n)&&(n=String(n)),N(i)&&N(f)){if(S(n)&&!A(n)&&!N(n))throw new TypeError("ranges-push/Ranges/add(): [THROW_ID_08] The third argument, the value to add, was given not as string but ".concat(typeof n,", equal to:\n").concat(JSON.stringify(n,null,4)));if(S(this.ranges)&&Array.isArray(this.last())&&i===this.last()[1]){if(this.last()[1]=f,this.last()[2],this.last()[2]!==null&&S(n)){let a=this.last()[2]&&this.last()[2].length&&(!((t=this.opts)!=null&&t.mergeType)||this.opts.mergeType===1)?"".concat(this.last()[2]).concat(n):n;this.opts.limitToBeAddedWhitespace&&(a=U(a,this.opts.limitLinebreaksCount)),A(a)&&!a.length||(this.last()[2]=a)}}else{this.ranges||(this.ranges=[]);let a=n!==void 0&&!(A(n)&&!n.length)?[i,f,n&&this.opts.limitToBeAddedWhitespace?U(n,this.opts.limitLinebreaksCount):n]:[i,f];this.ranges.push(a)}}else throw N(i)&&i>=0?new TypeError('ranges-push/Ranges/add(): [THROW_ID_10] "to" value, the second input argument, must be a natural number or zero! Currently it\'s of a type "'.concat(typeof f,'" equal to: ').concat(JSON.stringify(f,null,4))):new TypeError('ranges-push/Ranges/add(): [THROW_ID_09] "from" value, the first input argument, must be a natural number or zero! Currently it\'s of a type "'.concat(typeof i,'" equal to: ').concat(JSON.stringify(i,null,4)))}push(e,r,n){this.add(e,r,n)}current(){return Array.isArray(this.ranges)&&this.ranges.length?(this.ranges=Xe(this.ranges,{mergeType:this.opts.mergeType}),this.ranges&&this.opts.limitToBeAddedWhitespace?this.ranges.map(e=>S(e[2])?[e[0],e[1],U(e[2],this.opts.limitLinebreaksCount)]:e):this.ranges):null}wipe(){this.ranges=[]}replace(e){if(Array.isArray(e)&&e.length)if(Array.isArray(e[0])&&N(e[0][0]))this.ranges=Array.from(e);else throw new Error("ranges-push/Ranges/replace(): [THROW_ID_11] Single range was given but we expected array of arrays! The first element, ".concat(JSON.stringify(e[0],null,4)," should be an array and its first element should be an integer, a string index."));else this.ranges=[]}last(){return Array.isArray(this.ranges)&&this.ranges.length?this.ranges[this.ranges.length-1]:null}};var be={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function $e(e,r){function n(l){return!!l&&typeof l=="object"&&!Array.isArray(l)}if(!Array.isArray(e)||!e.length)return null;let i;if(r)if(n(r)){if(i=T(T({},be),r),i.progressFn&&n(i.progressFn)&&!Object.keys(i.progressFn).length)i.progressFn=null;else if(i.progressFn&&typeof i.progressFn!="function")throw new Error('ranges-merge: [THROW_ID_01] opts.progressFn must be a function! It was given of a type: "'.concat(typeof i.progressFn,'", equal to ').concat(JSON.stringify(i.progressFn,null,4)));if(![1,2,"1","2"].includes(i.mergeType))throw new Error('ranges-merge: [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "'.concat(typeof i.mergeType,'", equal to ').concat(JSON.stringify(i.mergeType,null,4)));if(typeof i.joinRangesThatTouchEdges!="boolean")throw new Error('ranges-merge: [THROW_ID_04] opts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "'.concat(typeof i.joinRangesThatTouchEdges,'", equal to ').concat(JSON.stringify(i.joinRangesThatTouchEdges,null,4)))}else throw new Error("emlint: [THROW_ID_03] the second input argument must be a plain object. It was given as:\n".concat(JSON.stringify(r,null,4)," (type ").concat(typeof r,")"));else i=T({},be);let f=e.filter(l=>Array.isArray(l)).map(l=>[...l]).filter(l=>l[2]!==void 0||l[0]!==l[1]),t,a,o;i.progressFn?t=H(f,{progressFn:l=>{o=Math.floor(l/5),o!==a&&(a=o,i.progressFn(o))}}):t=H(f);let u=t.length-1;for(let l=u;l>0;l--)i.progressFn&&(o=Math.floor((1-l/u)*78)+21,o!==a&&o>a&&(a=o,i.progressFn(o))),(t[l][0]<=t[l-1][0]||!i.joinRangesThatTouchEdges&&t[l][0]<t[l-1][1]||i.joinRangesThatTouchEdges&&t[l][0]<=t[l-1][1])&&(t[l-1][0]=Math.min(t[l][0],t[l-1][0]),t[l-1][1]=Math.max(t[l][1],t[l-1][1]),t[l][2]!==void 0&&(t[l-1][0]>=t[l][0]||t[l-1][1]<=t[l][1])&&t[l-1][2]!==null&&(t[l][2]===null&&t[l-1][2]!==null?t[l-1][2]=null:t[l-1][2]!=null?+i.mergeType==2&&t[l-1][0]===t[l][0]?t[l-1][2]=t[l][2]:t[l-1][2]+=t[l][2]:t[l-1][2]=t[l][2]),t.splice(l,1),l=t.length);return t.length?t:null}var rr=!0,X="Invariant failed";function Ae(e,r){if(!e){if(rr)throw new Error(X);var n=typeof r=="function"?r():r,i=n?"".concat(X,": ").concat(n):X;throw new Error(i)}}function j(e,r,n){let i=0,f=0;if(arguments.length===0)throw new Error("ranges-apply: [THROW_ID_01] inputs missing!");if(typeof e!="string")throw new TypeError("ranges-apply: [THROW_ID_02] first input argument must be a string! Currently it's: ".concat(typeof e,", equal to: ").concat(JSON.stringify(e,null,4)));if(r&&!Array.isArray(r))throw new TypeError("ranges-apply: [THROW_ID_03] second input argument must be an array (or null)! Currently it's: ".concat(typeof r,", equal to: ").concat(JSON.stringify(r,null,4)));if(n&&typeof n!="function")throw new TypeError("ranges-apply: [THROW_ID_04] the third input argument must be a function (or falsey)! Currently it's: ".concat(typeof n,", equal to: ").concat(JSON.stringify(n,null,4)));if(!(r!=null&&r.filter(s=>s).length))return e;let t;Array.isArray(r)&&Number.isInteger(r[0])&&Number.isInteger(r[1])?t=[Array.from(r)]:t=Array.from(r);let a=t.length,o=0;t.filter(s=>s).forEach((s,c)=>{if(n&&(i=Math.floor(o/a*10),i!==f&&(f=i,n(i))),!Array.isArray(s))throw new TypeError("ranges-apply: [THROW_ID_05] ranges array, second input arg., has ".concat(c,"th element not an array: ").concat(JSON.stringify(s,null,4),", which is ").concat(typeof s));if(!Number.isInteger(s[0])){if(!Number.isInteger(+s[0])||+s[0]<0)throw new TypeError("ranges-apply: [THROW_ID_06] ranges array, second input arg. has ".concat(c,"th element, array ").concat(JSON.stringify(s,null,0),". Its first element is not an integer, string index, but ").concat(typeof s[0],", equal to: ").concat(JSON.stringify(s[0],null,4),"."));t[c][0]=+t[c][0]}if(!Number.isInteger(s[1])){if(!Number.isInteger(+s[1])||+s[1]<0)throw new TypeError("ranges-apply: [THROW_ID_07] ranges array, second input arg. has ".concat(c,"th element, array ").concat(JSON.stringify(s,null,0),". Its second element is not an integer, string index, but ").concat(typeof s[1],", equal to: ").concat(JSON.stringify(s[1],null,4),"."));t[c][1]=+t[c][1]}o+=1});let u=$e(t,{progressFn:s=>{n&&(i=10+Math.floor(s/10),i!==f&&(f=i,n(i)))}});Ae(u);let l=u.length;if(l>0){let s=e.slice(u[l-1][1]);e=u.reduce((c,$,d,h)=>{n&&(i=20+Math.floor(d/l*80),i!==f&&(f=i,n(i)));let y=d===0?0:h[d-1][1],m=h[d][0];return"".concat(c).concat(e.slice(y,m)).concat(h[d][2]||"")},""),e+=s}return e}var tr={classicTrim:!1,cr:!1,lf:!1,tab:!1,space:!0,nbsp:!1};function J(e,r){if(typeof e!="string")throw new Error("string-trim-spaces-only: [THROW_ID_01] input must be string! It was given as ".concat(typeof e,", equal to:\n").concat(JSON.stringify(e,null,4)));let n=T(T({},tr),r);function i(a){return n.classicTrim&&!a.trim()||!n.classicTrim&&(n.space&&a===" "||n.cr&&a==="\r"||n.lf&&a==="\n"||n.tab&&a===" "||n.nbsp&&a==="\xA0")}let f,t;if(e.length){if(i(e[0]))for(let a=0,o=e.length;a<o;a++){if(!i(e[a])){f=a;break}if(a===e.length-1)return{res:"",ranges:[[0,e.length]]}}if(i(e[e.length-1])){for(let a=e.length;a--;)if(!i(e[a])){t=a+1;break}}return f?t?{res:e.slice(f,t),ranges:[[0,f],[t,e.length]]}:{res:e.slice(f),ranges:[[0,f]]}:t?{res:e.slice(0,t),ranges:[[t,e.length]]}:{res:e,ranges:[]}}return{res:"",ranges:[]}}var nr={heads:["{{"],tails:["}}"]};function Te(e,r){let n=Object.prototype.hasOwnProperty;if(e===void 0)throw new Error("string-remove-duplicate-heads-tails: [THROW_ID_01] The input is missing!");if(typeof e!="string")return e;if(r&&!E(r))throw new Error("string-remove-duplicate-heads-tails: [THROW_ID_03] The given options are not a plain object but ".concat(typeof r,"!"));let i=T({},r);if(i&&n.call(i,"heads"))if(I(i.heads).every(y=>typeof y=="string"||Array.isArray(y)))typeof i.heads=="string"&&(i.heads=I(i.heads));else throw new Error("string-remove-duplicate-heads-tails: [THROW_ID_04] The resolvedOpts.heads contains elements which are not string-type!");if(i&&n.call(i,"tails"))if(I(i.tails).every(y=>typeof y=="string"||Array.isArray(y)))typeof i.tails=="string"&&(i.tails=I(i.tails));else throw new Error("string-remove-duplicate-heads-tails: [THROW_ID_05] The resolvedOpts.tails contains elements which are not string-type!");let f=J(e).res;if(f.length===0)return e;e=f;let t=T(T({},nr),i);t.heads=t.heads.map(y=>y.trim()),t.tails=t.tails.map(y=>y.trim());let a=!1,o=!1,u=new M({limitToBeAddedWhitespace:!0}),l=new M({limitToBeAddedWhitespace:!0}),s=!0,c=!0,$="";function d(y,m){let g;return D(y,0,m.heads,{trimBeforeMatching:!0,cb:(p,b,w)=>(g=w,!0)})&&D(y,g,m.tails,{trimBeforeMatching:!0,cb:(p,b,w)=>(g=w,!0)})?y.slice(g):y}for(;e!==d(e,t);)e=J(d(e,t)).res;function h(y,m){let g;return!C(y,y.length-1,m.tails,{trimBeforeMatching:!0,cb:(p,b,w)=>(g=w,!0)})||!g?y:C(y,g,m.heads,{trimBeforeMatching:!0,cb:(p,b,w)=>(g=w,!0)})?y.slice(0,g+1):y}for(;e!==h(e,t);)e=J(h(e,t)).res;if(!t.heads.length||!D(e,0,t.heads,{trimBeforeMatching:!0})||!t.tails.length||!C(e,e.length-1,t.tails,{trimBeforeMatching:!0}))return J(e).res;for(let y=0,m=e.length;y<m;y++)if(e[y].trim()!==""){let g;if(D(e,y,t.heads,{trimBeforeMatching:!0,cb:(p,b,w)=>(g=w,!0)})&&g){c=!0,s&&(s=!0);let p;D(e,g,t.tails,{trimBeforeMatching:!0,cb:(b,w,v)=>(p=v,!0)})&&u.push(y,p),l.current()&&a&&$!=="tails"&&u.push(l.current()),a||l.current()&&(u.push(l.current()),l.wipe()),l.push(y,g),$="heads",y=g-1;continue}if(D(e,y,t.tails,{trimBeforeMatching:!0,cb:(p,b,w)=>(g=Number.isInteger(w)?w:e.length,!0)})&&g){c=!0,s?($==="heads"&&l.wipe(),s=!1):l.push(y,g),$="tails",y=g-1;continue}s&&(s=!0),c&&!a?(a=!0,c=!1):c&&!o?(o=!0,s=!0,c=!1,$==="heads"&&l.wipe()):c&&o&&l.wipe()}return l.current()&&u.push(l.current()),u.current()?j(e,u.current()).trim():e.trim()}var Oe={fromIndex:0,throwWhenSomethingWrongIsDetected:!0,allowWholeValueToBeOnlyHeadsOrTails:!0,source:"string-find-heads-tails",matchHeadsAndTailsStrictlyInPairsByTheirOrder:!1,relaxedAPI:!1};function ee(e,r,n,i){if(S(i)&&!E(i))throw new TypeError("string-find-heads-tails: [THROW_ID_01] the fourth input argument, an Optional Options Object, must be a plain object! Currently it's equal to: ".concat(i," (type: ").concat(typeof i,")"));let f=T(T({},Oe),i);if(A(f.fromIndex)&&/^\d*$/.test(f.fromIndex))f.fromIndex=Number(f.fromIndex);else if(!Number.isInteger(f.fromIndex)||f.fromIndex<0)throw new TypeError("".concat(f.source," [THROW_ID_18] the fourth input argument must be a natural number or zero! Currently it's: ").concat(f.fromIndex));if(!A(e)||e.length===0){if(f.relaxedAPI)return[];throw new TypeError("string-find-heads-tails: [THROW_ID_02] the first input argument, input string, must be a non-zero-length string! Currently it's: ".concat(typeof e,", equal to: ").concat(e))}let t,a;if(!A(r)&&!Array.isArray(r)){if(f.relaxedAPI)return[];throw new TypeError("string-find-heads-tails: [THROW_ID_03] the second input argument, heads, must be either a string or an array of strings! Currently it's: ".concat(typeof r,", equal to:\n").concat(JSON.stringify(r,null,4)))}else if(A(r))if(r.length===0){if(f.relaxedAPI)return[];throw new TypeError("string-find-heads-tails: [THROW_ID_04] the second input argument, heads, must be a non-empty string! Currently it's empty.")}else r=I(r);else if(Array.isArray(r))if(r.length===0){if(f.relaxedAPI)return[];throw new TypeError("string-find-heads-tails: [THROW_ID_05] the second input argument, heads, must be a non-empty array and contain at least one string! Currently it's empty.")}else if(r.every((h,y)=>(t=h,a=y,A(h)))){if(!r.every((h,y)=>(a=y,A(h)&&h.length&&h.trim()!=="")))if(f.relaxedAPI){if(r=r.filter(h=>A(h)&&h.length),r.length===0)return[]}else throw new TypeError("string-find-heads-tails: [THROW_ID_07] the second input argument, heads, should not contain empty strings! For example, there's one detected at index ".concat(a," of heads array:\n").concat(JSON.stringify(r,null,4),"."))}else if(f.relaxedAPI){if(r=r.filter(h=>A(h)&&h.length),r.length===0)return[]}else throw new TypeError("string-find-heads-tails: [THROW_ID_06] the second input argument, heads, contains non-string elements! For example, element at ".concat(a,"th index is ").concat(typeof t,", equal to:\n").concat(JSON.stringify(t,null,4),". Whole heads array looks like:\n").concat(JSON.stringify(r,null,4)));if(!A(n)&&!Array.isArray(n)){if(f.relaxedAPI)return[];throw new TypeError("string-find-heads-tails: [THROW_ID_08] the third input argument, tails, must be either a string or an array of strings! Currently it's: ".concat(typeof n,", equal to:\n").concat(JSON.stringify(n,null,4)))}else if(A(n))if(n.length===0){if(f.relaxedAPI)return[];throw new TypeError("string-find-heads-tails: [THROW_ID_09] the third input argument, tails, must be a non-empty string! Currently it's empty.")}else n=I(n);else if(Array.isArray(n))if(n.length===0){if(f.relaxedAPI)return[];throw new TypeError("string-find-heads-tails: [THROW_ID_10] the third input argument, tails, must be a non-empty array and contain at least one string! Currently it's empty.")}else if(n.every((h,y)=>(t=h,a=y,A(h)))){if(!n.every((h,y)=>(a=y,A(h)&&h.length&&h.trim()!=="")))if(f.relaxedAPI){if(n=n.filter(h=>A(h)&&h.length),n.length===0)return[]}else throw new TypeError("string-find-heads-tails: [THROW_ID_12] the third input argument, tails, should not contain empty strings! For example, there's one detected at index ".concat(a,". Whole tails array is equal to:\n").concat(JSON.stringify(n,null,4)))}else if(f.relaxedAPI){if(n=n.filter(h=>A(h)&&h.length),n.length===0)return[]}else throw new TypeError("string-find-heads-tails: [THROW_ID_11] the third input argument, tails, contains non-string elements! For example, element at ".concat(a,"th index is ").concat(typeof t,", equal to:\n").concat(JSON.stringify(t,null,4),". Whole tails array is equal to:\n").concat(JSON.stringify(n,null,4)));let o=f.source===Oe.source;if(f.throwWhenSomethingWrongIsDetected&&!f.allowWholeValueToBeOnlyHeadsOrTails){if(I(r).includes(e))throw new Error("".concat(f.source).concat(o?": [THROW_ID_16]":""," the whole input string can't be equal to ").concat(A(r)?"":"one of ","heads (").concat(e,")!"));if(I(n).includes(e))throw new Error("".concat(f.source).concat(o?": [THROW_ID_17]":""," the whole input string can't be equal to ").concat(A(n)?"":"one of ","tails (").concat(e,")!"))}let u=r.concat(n).map(h=>h.charAt(0)).reduce((h,y)=>y.charCodeAt(0)>h[1]?[h[0],y.charCodeAt(0)]:y.charCodeAt(0)<h[0]?[y.charCodeAt(0),h[1]]:h,[r[0].charCodeAt(0),r[0].charCodeAt(0)]),l=[],s=!1,c={},$="",d;for(let h=f.fromIndex,y=e.length;h<y;h++){let m=e[h].charCodeAt(0);if(m<=u[1]&&m>=u[0]){let g=D(e,h,r);if(g&&f.matchHeadsAndTailsStrictlyInPairsByTheirOrder){for(let b=r.length;b--;)if(r[b]===g){d=b;break}}if(A(g))if(s){if(f.throwWhenSomethingWrongIsDetected)throw new TypeError("".concat(f.source).concat(o?": [THROW_ID_19]":"",' When processing "').concat(e,'", we found heads (').concat(e.slice(h,h+g.length),') starting at character with index number "').concat(h,'" and there was another set of heads before it! Generally speaking, there should be "heads-tails-heads-tails", not "heads-heads-tails"!\nWe\'re talking about the area of the code:\n\n\n--------------------------------------starts\n').concat(e.slice(Math.max(h-200,0),h),"\n \x1B[33m------->\x1B[39m ").concat("\x1B[31m".concat(e.slice(h,h+g.length),"\x1B[39m")," \x1B[33m<-------\x1B[39m\n").concat(e.slice(h+g.length,Math.min(y,h+200)),"\n--------------------------------------ends\n\n\nTo turn off this error being thrown, set resolvedOpts.throwWhenSomethingWrongIsDetected to Boolean false."))}else{c={},c.headsStartAt=h,c.headsEndAt=h+g.length,s=!0,h+=g.length-1,$&&($="");continue}let p=D(e,h,n);if(s&&p&&f.matchHeadsAndTailsStrictlyInPairsByTheirOrder&&d!==void 0&&n[d]!==void 0&&n[d]!==p){let b;for(let w=n.length;w--;)if(n[w]===p){b=w;break}throw new TypeError("".concat(f.source).concat(o?": [THROW_ID_20]":"",' When processing "').concat(e,'", we had "resolvedOpts.matchHeadsAndTailsStrictlyInPairsByTheirOrder" on. We found heads (').concat(r[d],") but the tails the followed it were not of the same index, ").concat(d," (").concat(n[d],") but ").concat(b," (").concat(p,")."))}if(A(p))if(s){c.tailsStartAt=h,c.tailsEndAt=h+p.length,l.push(c),c={},s=!1,h+=p.length-1;continue}else f.throwWhenSomethingWrongIsDetected&&($="".concat(f.source).concat(o?": [THROW_ID_21]":"",' When processing "').concat(e,'", we found tails (').concat(e.slice(h,h+p.length),') starting at character with index number "').concat(h,"\" but there were no heads preceding it. That's very naughty!"))}if(f.throwWhenSomethingWrongIsDetected&&h===y-1){if(Object.keys(c).length!==0)throw new TypeError("".concat(f.source).concat(o?": [THROW_ID_22]":"",' When processing "').concat(e,"\", we reached the end of the string and yet didn't find any tails (").concat(JSON.stringify(n,null,4),") to match the last detected heads (").concat(e.slice(c.headsStartAt,c.headsEndAt),")!"));if($)throw new Error($)}}return l}var ve=k(L(),1);function re(e){if(e.includes(".")){let r=e.lastIndexOf(".");if(!e.slice(0,r).includes("."))return e.slice(0,r);for(let n=r-1;n--;)if(e[n]===".")return e.slice(n+1,r)}return null}var te=(0,ve.default)();function K(e,r){let n={now:!1};function i(f,t,a,o){let u=te(f),l,s=T({depth:-1,path:""},a);if(s.depth+=1,Array.isArray(u))for(let c=0,$=u.length;c<$&&!o.now;c++){let d=s.path?"".concat(s.path,".").concat(c):"".concat(c);u[c]!==void 0?(s.parent=te(u),s.parentType="array",s.parentKey=re(d),l=i(t(u[c],void 0,P(T({},s),{path:d}),o),t,P(T({},s),{path:d}),o),Number.isNaN(l)&&c<u.length?(u.splice(c,1),c-=1):u[c]=l):u.splice(c,1)}else if(E(u))for(let c in u){if(o.now&&c!=null)break;let $=s.path?"".concat(s.path,".").concat(c):c;s.depth===0&&c!=null&&(s.topmostKey=c),s.parent=te(u),s.parentType="object",s.parentKey=re($),l=i(t(c,u[c],P(T({},s),{path:$}),o),t,P(T({},s),{path:$}),o),Number.isNaN(l)?delete u[c]:u[c]=l}return u}return i(e,r,{},n)}function ne(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var ie=new Map,Ee=(e,r)=>{if(!Array.isArray(e))switch(typeof e){case"string":{e=[e];break}case"undefined":{e=[];break}default:throw new TypeError("Expected '".concat(r,"' to be a string or an array, but got a type of '").concat(typeof e,"'"))}return e.filter(n=>{if(typeof n!="string"){if(n===void 0)return!1;throw new TypeError("Expected '".concat(r,"' to be an array of strings, but found a type of '").concat(typeof n,"' in the array"))}return!0})},Ie,Se,We,ir=(e,r)=>{r=T({caseSensitive:!1},r);let n="s"+(r.caseSensitive?"":"i"),i=e+"|"+n;if(ie.has(i))return ie.get(i);let f=e[0]==="!";f&&(e=e.slice(1)),e=e.replaceAll(String.raw(Ie||(Ie=F(["*"],["\\*"]))),"__ESCAPED_STAR__").replaceAll("\\\\","__ESCAPED_BACKSLASH__").replaceAll(/\\(.)/g,"$1"),e=ne(e).replaceAll(String.raw(Se||(Se=F(["*"],["\\*"]))),".*"),e=e.replaceAll("__ESCAPED_STAR__",String.raw(We||(We=F(["*"],["\\*"])))).replaceAll("__ESCAPED_BACKSLASH__","\\\\");let t=new RegExp("^".concat(e,"$"),n);return t.negated=f,ie.set(i,t),t},sr=(e,r,n,i)=>{if(e=Ee(e,"inputs"),r=Ee(r,"patterns"),r.length===0)return[];r=r.map(u=>ir(u,n));let f=r.filter(u=>u.negated),t=r.filter(u=>!u.negated),{allPatterns:a}=n||{},o=[];if(a&&i&&f.length>1&&t.length===0){for(let u of e)for(let l of f)if(l.test(u))return[];return e.slice(0,1)}for(let u of e){let l=!1;for(let s of f)if(s.test(u)){l=!0;break}if(!l){if(t.length===0)o.push(u);else if(a){let s=Array.from({length:t.length},()=>!1);for(let[c,$]of t.entries())$.test(u)&&(s[c]=!0);s.every(Boolean)&&o.push(u)}else{let s=!1;for(let c of t)if(c.test(u)){s=!0;break}s&&o.push(u)}if(i&&o.length>0)break}}return o};function z(e,r,n){return sr(e,r,n,!0).length>0}var _e=k(L(),1);var De=(0,_e.default)();function se(e,r,n){let i;n!==void 0&&(i=Array.isArray(n)?De(n):[De(n)]);let f=[],t=K(e,(a,o,u)=>{let l=o!==void 0?o:a;if(o!==void 0&&z(a,r,{caseSensitive:!0})){if(i===void 0)f.push({val:o,path:u.path});else if(i.length)return i.shift()}return l});return i===void 0?f:t}var _=k(xe(),1);var Re="12.0.32";var or=Re,lr=Object.prototype.hasOwnProperty,He={heads:"%%_",tails:"_%%",headsNoWrap:"%%-",tailsNoWrap:"-%%",lookForDataContainers:!0,dataContainerIdentifierTails:"_data",wrapHeadsWith:"",wrapTailsWith:"",dontWrapVars:[],preventDoubleWrapping:!0,wrapGlobalFlipSwitch:!0,noSingleMarkers:!1,resolveToBoolIfAnyValuesContainBool:!0,resolveToFalseIfAnyValuesContainBool:!0,throwWhenNonStringInsertedInString:!1,allowUnresolved:!1};function O(e){return A(e)?e.trim():e}function ur(e){if(A(e)&&e.length&&e.indexOf(".")!==-1){for(let r=0,n=e.length;r<n;r++)if(e[r]===".")return e.slice(0,r)}return e}function fr(e){if(A(e)&&e.length&&e.indexOf(".")!==-1){for(let r=0,n=e.length;r<n;r++)if(e[r]===".")return e.slice(r+1)}return e}function je(e){if(A(e)&&e.length&&e.indexOf(".")!==-1){for(let r=e.length;r--;)if(e[r]===".")return e.slice(0,r)}return e}function Ve(e){if(A(e)&&e.length&&e.indexOf(".")!==-1){for(let r=e.length;r--;)if(e[r]===".")return e.slice(r+1)}return e}function ae(e,r){return!A(e)||!e.trim()?!1:!!(e.includes(r.heads)||e.includes(r.tails)||A(r.headsNoWrap)&&r.headsNoWrap.length&&e.includes(r.headsNoWrap)||A(r.tailsNoWrap)&&r.tailsNoWrap.length&&e.includes(r.tailsNoWrap))}function cr(e,r,n){let i,f;return A(e)&&e.length&&D(e,0,r,{trimBeforeMatching:!0,cb:(t,a,o)=>(i=o,!0)})&&C(e,e.length-1,n,{trimBeforeMatching:!0,cb:(t,a,o)=>(f=(o||0)+1,!0)})?e.slice(i,f):e}function Ce(e,r,n=!1,i,f,t){if(r.wrapHeadsWith||(r.wrapHeadsWith=""),r.wrapTailsWith||(r.wrapTailsWith=""),A(e)&&!n&&r.wrapGlobalFlipSwitch&&!r.dontWrapVars.some(a=>z(t,a))&&(!r.preventDoubleWrapping||r.preventDoubleWrapping&&A(e)&&!e.includes(r.wrapHeadsWith)&&!e.includes(r.wrapTailsWith)))return"".concat(r.wrapHeadsWith).concat(e).concat(r.wrapTailsWith);if(n){if(!A(e))return e;let a=Te(e,{heads:r.wrapHeadsWith,tails:r.wrapTailsWith});return A(a)?cr(a,r.wrapHeadsWith,r.wrapTailsWith):a}return e}function gr(e,r,n,i){let f;if(n.indexOf(".")!==-1){let t=n,a=!0;if(i.lookForDataContainers&&A(i.dataContainerIdentifierTails)&&i.dataContainerIdentifierTails.length&&!t.endsWith(i.dataContainerIdentifierTails)){let o=_.default.get(e,t+i.dataContainerIdentifierTails);E(o)&&_.default.get(o,r)&&(f=_.default.get(o,r),a=!1)}for(;a&&t.indexOf(".")!==-1;){if(t=je(t),Ve(t)===r)throw new Error('json-variables/findValues(): [THROW_ID_20] While trying to resolve: "'.concat(r,'" at path "').concat(n,'", we encountered a closed loop. The parent key "').concat(Ve(t),'" is called the same as the variable "').concat(r,"\" we're looking for."));if(i.lookForDataContainers&&A(i.dataContainerIdentifierTails)&&i.dataContainerIdentifierTails.length&&!t.endsWith(i.dataContainerIdentifierTails)){let o=_.default.get(e,t+i.dataContainerIdentifierTails);E(o)&&_.default.get(o,r)&&(f=_.default.get(o,r),a=!1)}if(f===void 0){let o=_.default.get(e,t);E(o)&&_.default.get(o,r)&&(f=_.default.get(o,r),a=!1)}}}if(f===void 0){let t=_.default.get(e,r);t!==void 0&&(f=t)}if(f===void 0)if(r.indexOf(".")===-1){let t=se(e,r);if(t.length){for(let a=0,o=t.length;a<o;a++)if(A(t[a].val)||q(t[a].val)||B(t[a].val)){f=t[a].val;break}else if(pe(t[a].val)){f=String(t[a].val);break}else if(Array.isArray(t[a].val)){f=t[a].val.join("");break}}}else{let t=se(e,ur(r));if(t.length)for(let a=0,o=t.length;a<o;a++){let u=_.default.get(t[a].val,fr(r));u&&A(u)&&(f=u)}}return f}function Pe(e,r,n,i,f=[]){if(f.includes(n)){let d="";if(f.length>1){let h=" \u2192\n";d=f.reduce((y,m,g)=>y+(g===0?"":h)+(m===n?"\u{1F4A5} ":" ")+m," Here's the path we travelled up until we hit the recursion:\n\n"),d+="".concat(h,"\u{1F4A5} ").concat(n)}throw new Error('json-variables/resolveString(): [THROW_ID_19] While trying to resolve: "'.concat(r,'" at path "').concat(n,'", we encountered a closed loop, the key is referencing itself."').concat(d))}let t={},a=Array.from(f);a.push(n);let o=new M;function u(d,h,y){for(let m=0,g=d.length;m<g;m++){let p=d[m],b=r.slice(p.headsEndAt,p.tailsStartAt);if(b.length===0)o.push(p.headsStartAt,p.tailsEndAt);else if(lr.call(t,b)&&A(t[b]))o.push(p.headsStartAt,p.tailsEndAt,t[b]);else{let w=gr(e,b.trim(),n,i);if(w===void 0)if(i.allowUnresolved===!0)w="";else if(A(i.allowUnresolved))w=i.allowUnresolved;else throw new Error("json-variables/processHeadsAndTails(): [THROW_ID_18] We couldn't find the value to resolve the variable ".concat(r.slice(p.headsEndAt,p.tailsStartAt),". We're at path: \"").concat(n,'".'));if(!y&&i.throwWhenNonStringInsertedInString&&!A(w))throw new Error("json-variables/processHeadsAndTails(): [THROW_ID_23] While resolving the variable ".concat(r.slice(p.headsEndAt,p.tailsStartAt)," at path ").concat(n,", it resolved into a non-string value, ").concat(JSON.stringify(w,null,4),'. This is happening because options setting "throwWhenNonStringInsertedInString" is active (set to "true").'));if(q(w)){if(i.resolveToBoolIfAnyValuesContainBool)return o.wipe(),i.resolveToFalseIfAnyValuesContainBool?!1:w;w=""}else{if(B(w)&&y)return o.wipe(),w;Array.isArray(w)?w=String(w.join("")):B(w)?w="":w=String(w)}let v=n.includes(".")?"".concat(je(n),".").concat(b):b;if(ae(w,i)){let W=Ce(Pe(e,w,v,i,a),i,h,a,v,b.trim());A(W)&&o.push(p.headsStartAt,p.tailsEndAt,W)}else{t[b]=w;let W=Ce(w,i,h,a,v,b.trim());A(W)&&o.push(p.headsStartAt,p.tailsEndAt,W)}}}}let l;try{l=ee(r,i.heads,i.tails,{source:"",throwWhenSomethingWrongIsDetected:!1})}catch(d){throw new Error('json-variables/resolveString(): [THROW_ID_17] While trying to resolve string: "'.concat(r,'" at path ').concat(n,", something wrong with heads and tails was detected! Here's the internal error message:\n").concat(d))}let s=!1;l.length===1&&j(r,[[l[0].headsStartAt,l[0].tailsEndAt]]).trim()===""&&(s=!0);let c=u(l,!1,s);if(typeof c=="boolean"||c===null)return c;try{l=ee(r,i.headsNoWrap,i.tailsNoWrap,{source:"",throwWhenSomethingWrongIsDetected:!1})}catch(d){throw new Error('json-variables/resolveString(): [THROW_ID_22] While trying to resolve string: "'.concat(r,'" at path ').concat(n,", something wrong with no-wrap heads and no-wrap tails was detected! Here's the internal error message:\n").concat(d))}l.length===1&&j(r,[[l[0].headsStartAt,l[0].tailsEndAt]]).trim()===""&&(s=!0);let $=u(l,!0,s);return q($)||B($)?$:o!=null&&o.current()?j(r,o.current()):r}function hr(e,r){if(!arguments.length)throw new Error("json-variables/jVar(): [THROW_ID_01] Alas! Inputs are missing!");if(!E(e))throw new TypeError("json-variables/jVar(): [THROW_ID_02] Alas! The input must be a plain object! Currently it's: ".concat(Array.isArray(e)?"array":typeof e));if(r&&!E(r))throw new TypeError("json-variables/jVar(): [THROW_ID_03] Alas! An Optional Options Object must be a plain object! Currently it's: ".concat(Array.isArray(r)?"array":typeof r));let n=T(T({},He),r);n.dontWrapVars?Array.isArray(n.dontWrapVars)||(n.dontWrapVars=I(n.dontWrapVars)):n.dontWrapVars=[];let i,f;if(n.dontWrapVars.length&&!n.dontWrapVars.every((a,o)=>A(a)?!0:(i=a,f=o,!1)))throw new Error('json-variables/jVar(): [THROW_ID_05] Alas! All variable names set in resolvedOpts.dontWrapVars should be of a string type. Computer detected a value "'.concat(i,'" at index ').concat(f,", which is not string but ").concat(Array.isArray(i)?"array":typeof i,"!"));if(n.heads==="")throw new Error("json-variables/jVar(): [THROW_ID_06] Alas! resolvedOpts.heads are empty!");if(n.tails==="")throw new Error("json-variables/jVar(): [THROW_ID_07] Alas! resolvedOpts.tails are empty!");if(n.lookForDataContainers&&n.dataContainerIdentifierTails==="")throw new Error("json-variables/jVar(): [THROW_ID_08] Alas! resolvedOpts.dataContainerIdentifierTails is empty!");if(n.heads===n.tails)throw new Error("json-variables/jVar(): [THROW_ID_09] Alas! resolvedOpts.heads and resolvedOpts.tails can't be equal!");if(n.heads===n.headsNoWrap)throw new Error("json-variables/jVar(): [THROW_ID_10] Alas! resolvedOpts.heads and resolvedOpts.headsNoWrap can't be equal!");if(n.tails===n.tailsNoWrap)throw new Error("json-variables/jVar(): [THROW_ID_11] Alas! resolvedOpts.tails and resolvedOpts.tailsNoWrap can't be equal!");if(n.headsNoWrap==="")throw new Error("json-variables/jVar(): [THROW_ID_12] Alas! resolvedOpts.headsNoWrap is an empty string!");if(n.tailsNoWrap==="")throw new Error("json-variables/jVar(): [THROW_ID_13] Alas! resolvedOpts.tailsNoWrap is an empty string!");if(n.headsNoWrap===n.tailsNoWrap)throw new Error("json-variables/jVar(): [THROW_ID_14] Alas! resolvedOpts.headsNoWrap and resolvedOpts.tailsNoWrap can't be equal!");let t;return K(e,(a,o,u)=>{if(S(o)&&ae(a,n))throw new Error("json-variables/jVar(): [THROW_ID_15] Alas! Object keys can't contain variables!\nPlease check the following key: ".concat(a));if(o!==void 0?t=o:t=a,t==="")return t;if(n.heads.length&&O(t)===O(n.heads)||n.tails.length&&O(t)===O(n.tails)||n.headsNoWrap.length&&O(t)===O(n.headsNoWrap)||n.tailsNoWrap.length&&O(t)===O(n.tailsNoWrap)){if(!n.noSingleMarkers)return t;throw new Error("json-variables/jVar(): [THROW_ID_16] Alas! While processing the input, we stumbled upon ".concat(O(t)," which is equal to ").concat(O(t)===O(n.heads)?"heads":"").concat(O(t)===O(n.tails)?"tails":"").concat(A(n.headsNoWrap)&&O(t)===O(n.headsNoWrap)?"headsNoWrap":"").concat(A(n.tailsNoWrap)&&O(t)===O(n.tailsNoWrap)?"tailsNoWrap":"",'. If you wouldn\'t have set resolvedOpts.noSingleMarkers to "true" this error would not happen and computer would have left the current element (').concat(O(t),") alone"))}return A(t)&&ae(t,n)?Pe(e,t,u.path,n):t})}return Ke(pr);})();
10
+ "use strict";var jsonVariables=(()=>{var Be=Object.create,oe=Object.freeze,R=Object.defineProperty,Me=Object.defineProperties,Je=Object.getOwnPropertyDescriptor,ke=Object.getOwnPropertyDescriptors,Fe=Object.getOwnPropertyNames,le=Object.getOwnPropertySymbols,Le=Object.getPrototypeOf,ue=Object.prototype.hasOwnProperty,qe=Object.prototype.propertyIsEnumerable;var Z=(e,r,n)=>r in e?R(e,r,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[r]=n,T=(e,r)=>{for(var n in r||(r={}))ue.call(r,n)&&Z(e,n,r[n]);if(le)for(var n of le(r))qe.call(r,n)&&Z(e,n,r[n]);return e},P=(e,r)=>Me(e,ke(r));var fe=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports),Ue=(e,r)=>{for(var n in r)R(e,n,{get:r[n],enumerable:!0})},ce=(e,r,n,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let f of Fe(r))!ue.call(e,f)&&f!==n&&R(e,f,{get:()=>r[f],enumerable:!(i=Je(r,f))||i.enumerable});return e};var k=(e,r,n)=>(n=e!=null?Be(Le(e)):{},ce(r||!e||!e.__esModule?R(n,"default",{value:e,enumerable:!0}):n,e)),Ke=e=>ce(R({},"__esModule",{value:!0}),e);var Y=(e,r,n)=>Z(e,typeof r!="symbol"?r+"":r,n);var F=(e,r)=>oe(R(e,"raw",{value:oe(r||e.slice())}));var L=fe((mr,ge)=>{"use strict";ge.exports=ze;function V(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}function ze(e){if(e=e||{},e.circles)return Ge(e);let r=new Map;if(r.set(Date,a=>new Date(a)),r.set(Map,(a,o)=>new Map(i(Array.from(a),o))),r.set(Set,(a,o)=>new Set(i(Array.from(a),o))),e.constructorHandlers)for(let a of e.constructorHandlers)r.set(a[0],a[1]);let n=null;return e.proto?t:f;function i(a,o){let u=Object.keys(a),l=new Array(u.length);for(let s=0;s<u.length;s++){let c=u[s],$=a[c];typeof $!="object"||$===null?l[c]=$:$.constructor!==Object&&(n=r.get($.constructor))?l[c]=n($,o):ArrayBuffer.isView($)?l[c]=V($):l[c]=o($)}return l}function f(a){if(typeof a!="object"||a===null)return a;if(Array.isArray(a))return i(a,f);if(a.constructor!==Object&&(n=r.get(a.constructor)))return n(a,f);let o={};for(let u in a){if(Object.hasOwnProperty.call(a,u)===!1)continue;let l=a[u];typeof l!="object"||l===null?o[u]=l:l.constructor!==Object&&(n=r.get(l.constructor))?o[u]=n(l,f):ArrayBuffer.isView(l)?o[u]=V(l):o[u]=f(l)}return o}function t(a){if(typeof a!="object"||a===null)return a;if(Array.isArray(a))return i(a,t);if(a.constructor!==Object&&(n=r.get(a.constructor)))return n(a,t);let o={};for(let u in a){let l=a[u];typeof l!="object"||l===null?o[u]=l:l.constructor!==Object&&(n=r.get(l.constructor))?o[u]=n(l,t):ArrayBuffer.isView(l)?o[u]=V(l):o[u]=t(l)}return o}}function Ge(e){let r=[],n=[],i=new Map;if(i.set(Date,u=>new Date(u)),i.set(Map,(u,l)=>new Map(t(Array.from(u),l))),i.set(Set,(u,l)=>new Set(t(Array.from(u),l))),e.constructorHandlers)for(let u of e.constructorHandlers)i.set(u[0],u[1]);let f=null;return e.proto?o:a;function t(u,l){let s=Object.keys(u),c=new Array(s.length);for(let $=0;$<s.length;$++){let d=s[$],h=u[d];if(typeof h!="object"||h===null)c[d]=h;else if(h.constructor!==Object&&(f=i.get(h.constructor)))c[d]=f(h,l);else if(ArrayBuffer.isView(h))c[d]=V(h);else{let y=r.indexOf(h);y!==-1?c[d]=n[y]:c[d]=l(h)}}return c}function a(u){if(typeof u!="object"||u===null)return u;if(Array.isArray(u))return t(u,a);if(u.constructor!==Object&&(f=i.get(u.constructor)))return f(u,a);let l={};r.push(u),n.push(l);for(let s in u){if(Object.hasOwnProperty.call(u,s)===!1)continue;let c=u[s];if(typeof c!="object"||c===null)l[s]=c;else if(c.constructor!==Object&&(f=i.get(c.constructor)))l[s]=f(c,a);else if(ArrayBuffer.isView(c))l[s]=V(c);else{let $=r.indexOf(c);$!==-1?l[s]=n[$]:l[s]=a(c)}}return r.pop(),n.pop(),l}function o(u){if(typeof u!="object"||u===null)return u;if(Array.isArray(u))return t(u,o);if(u.constructor!==Object&&(f=i.get(u.constructor)))return f(u,o);let l={};r.push(u),n.push(l);for(let s in u){let c=u[s];if(typeof c!="object"||c===null)l[s]=c;else if(c.constructor!==Object&&(f=i.get(c.constructor)))l[s]=f(c,o);else if(ArrayBuffer.isView(c))l[s]=V(c);else{let $=r.indexOf(c);$!==-1?l[s]=n[$]:l[s]=o(c)}}return r.pop(),n.pop(),l}}});var xe=fe((Ne,G)=>{(function(e,r){"use strict";typeof G=="object"&&typeof G.exports=="object"?G.exports=r():typeof define=="function"&&define.amd?define([],r):e.objectPath=r()})(Ne,function(){"use strict";var e=Object.prototype.toString;function r(s,c){return s==null?!1:Object.prototype.hasOwnProperty.call(s,c)}function n(s){if(!s||t(s)&&s.length===0)return!0;if(typeof s!="string"){for(var c in s)if(r(s,c))return!1;return!0}return!1}function i(s){return e.call(s)}function f(s){return typeof s=="object"&&i(s)==="[object Object]"}var t=Array.isArray||function(s){return e.call(s)==="[object Array]"};function a(s){return typeof s=="boolean"||i(s)==="[object Boolean]"}function o(s){var c=parseInt(s);return c.toString()===s?c:s}function u(s){s=s||{};var c=function(m){return Object.keys(c).reduce(function(g,p){return p==="create"||typeof c[p]=="function"&&(g[p]=c[p].bind(c,m)),g},{})},$;s.includeInheritedProps?$=function(){return!0}:$=function(m,g){return typeof g=="number"&&Array.isArray(m)||r(m,g)};function d(m,g){if($(m,g))return m[g]}var h;s.includeInheritedProps?h=function(m,g){typeof g!="string"&&typeof g!="number"&&(g=String(g));var p=d(m,g);if(g==="__proto__"||g==="prototype"||g==="constructor"&&typeof p=="function")throw new Error("For security reasons, object's magic properties cannot be set");return p}:h=function(m,g){return d(m,g)};function y(m,g,p,b){if(typeof g=="number"&&(g=[g]),!g||g.length===0)return m;if(typeof g=="string")return y(m,g.split(".").map(o),p,b);var w=g[0],v=h(m,w);return g.length===1?((v===void 0||!b)&&(m[w]=p),v):(v===void 0&&(typeof g[1]=="number"?m[w]=[]:m[w]={}),y(m[w],g.slice(1),p,b))}return c.has=function(m,g){if(typeof g=="number"?g=[g]:typeof g=="string"&&(g=g.split(".")),!g||g.length===0)return!!m;for(var p=0;p<g.length;p++){var b=o(g[p]);if(typeof b=="number"&&t(m)&&b<m.length||(s.includeInheritedProps?b in Object(m):r(m,b)))m=m[b];else return!1}return!0},c.ensureExists=function(m,g,p){return y(m,g,p,!0)},c.set=function(m,g,p,b){return y(m,g,p,b)},c.insert=function(m,g,p,b){var w=c.get(m,g);b=~~b,t(w)||(w=[],c.set(m,g,w)),w.splice(b,0,p)},c.empty=function(m,g){if(!n(g)&&m!=null){var p,b;if(p=c.get(m,g)){if(typeof p=="string")return c.set(m,g,"");if(a(p))return c.set(m,g,!1);if(typeof p=="number")return c.set(m,g,0);if(t(p))p.length=0;else if(f(p))for(b in p)$(p,b)&&delete p[b];else return c.set(m,g,null)}}},c.push=function(m,g){var p=c.get(m,g);t(p)||(p=[],c.set(m,g,p)),p.push.apply(p,Array.prototype.slice.call(arguments,2))},c.coalesce=function(m,g,p){for(var b,w=0,v=g.length;w<v;w++)if((b=c.get(m,g[w]))!==void 0)return b;return p},c.get=function(m,g,p){if(typeof g=="number"&&(g=[g]),!g||g.length===0)return m;if(m==null)return p;if(typeof g=="string")return c.get(m,g.split("."),p);var b=o(g[0]),w=h(m,b);return w===void 0?p:g.length===1?w:c.get(m[b],g.slice(1),p)},c.del=function(g,p){if(typeof p=="number"&&(p=[p]),g==null||n(p))return g;if(typeof p=="string")return c.del(g,p.split("."));var b=o(p[0]);if(h(g,b),!$(g,b))return g;if(p.length===1)t(g)?g.splice(b,1):delete g[b];else return c.del(g[b],p.slice(1));return g},c}var l=u();return l.create=u,l.withInheritedProps=u({includeInheritedProps:!0}),l})});var pr={};Ue(pr,{defaults:()=>He,jVar:()=>hr,version:()=>or});function I(e){return typeof e!="string"?e:e.length?[e]:[]}var he=k(L(),1);var wr=(0,he.default)();function E(e){if(e==null||typeof e!="object")return!1;let r=Object.getPrototypeOf(e);return r!==null&&r!==Object.prototype&&Object.getPrototypeOf(r)!==null?!1:!(Symbol.iterator in e)&&!(Symbol.toStringTag in e)}function A(e){return typeof e=="string"}function pe(e){return Number.isFinite(e)}function N(e){return Number.isSafeInteger(e)&&e>=0}function q(e){return typeof e=="boolean"}function B(e){return e===null}function S(e){return e!=null}function de(e,r){return E(e)&&A(r)&&r in e}var ye={cb:void 0,i:!1,trimBeforeMatching:!1,trimCharsBeforeMatching:[],maxMismatches:0,firstMustMatch:!1,lastMustMatch:!1,hungry:!1},Qe=e=>e+1;function Ze(e,r,n,i,f=!1,t=Qe){var b;let a=typeof n=="function"?n():n;if(+r<0&&f&&a==="EOL")return a;let o=T(T({},ye),i);if(r>=e.length&&!f)return!1;let u=f?1:n.length,l=0,s=!1,c=!1,$=!1,d=o.maxMismatches,h=r,y=!1,m=!1,g=!1;function p(){return l===1&&d<o.maxMismatches-1}for(;e[h];){let w=t(h);if(o.trimBeforeMatching&&e[h].trim()===""){if(!e[w]&&f&&n==="EOL")return!0;h=t(h);continue}if(o&&!o.i&&((b=o==null?void 0:o.trimCharsBeforeMatching)!=null&&b.includes(e[h]))||o!=null&&o.i&&o.trimCharsBeforeMatching&&o.trimCharsBeforeMatching.map(W=>W.toLowerCase()).includes(e[h].toLowerCase())){if(f&&n==="EOL"&&!e[w])return!0;h=t(h);continue}let v=w>h?n[n.length-u]:n[u-1];if(!o.i&&e[h]===v||o.i&&e[h].toLowerCase()===v.toLowerCase()){if(y||(y=!0),$||($=!0),u===n.length){if(m=!0,d!==o.maxMismatches)return!1}else u===1&&(g=!0);if(u-=1,l++,p())return!1;if(!u)return l!==n.length||d===o.maxMismatches||!s?h:!1}else if(!s&&!l&&(s=!0),o.maxMismatches&&d&&h){d-=1;for(let W=0;W<=d;W++){let x=w>h?n[n.length-u+1+W]:n[u-2-W],Q=e[t(h)];if(x&&(!o.i&&e[h]===x||o.i&&e[h].toLowerCase()===x.toLowerCase())&&(!o.firstMustMatch||u!==n.length)){if(l++,p())return!1;u-=2,y=!0;break}else if(Q&&x&&(!o.i&&Q===x||o.i&&Q.toLowerCase()===x.toLowerCase())&&(!o.firstMustMatch||u!==n.length)){if(!l&&!o.hungry)return!1;u-=1,y=!0;break}else if(x===void 0&&d>=0&&y&&(!o.firstMustMatch||m)&&(!o.lastMustMatch||g))return h}y||(c=h)}else return h===0&&u===1&&!o.lastMustMatch&&$?0:!1;if(c!==!1&&c!==h&&(c=!1),u<1)return h;h=t(h)}if(u>0)return f&&a==="EOL"?!0:o&&o.maxMismatches>=u&&$?c||0:!1}function me(e,r,n,i,f){var s,c,$;if(E(f)&&de(f,"trimBeforeMatching")&&f&&typeof f.trimBeforeMatching!="boolean")throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_09] opts.trimBeforeMatching should be boolean!").concat(Array.isArray(f.trimBeforeMatching)?" Did you mean to use opts.trimCharsBeforeMatching?":""));let t=T(T({},ye),f);if(typeof t.trimCharsBeforeMatching=="string"&&(t.trimCharsBeforeMatching=I(t.trimCharsBeforeMatching)),t.trimCharsBeforeMatching=t.trimCharsBeforeMatching.map(d=>A(d)?d:String(d)),!A(r)||!r.length)return!1;if(!Number.isInteger(n)||n<0)throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_03] the second argument should be a natural number. Currently it's of a type: ").concat(typeof n,", equal to:\n").concat(JSON.stringify(n,null,4)));let a,o;if(A(i))a=[i];else if(Array.isArray(i))a=i;else if(!i)a=i;else if(typeof i=="function")a=[],a.push(i);else throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_05] the third argument, whatToMatch, is neither string nor array of strings! It's ").concat(typeof i,", equal to:\n").concat(JSON.stringify(i,null,4)));if(f&&!E(f))throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_06] the fourth argument, options object, should be a plain object. Currently it's of a type \"").concat(typeof f,'", and equal to:\n').concat(JSON.stringify(f,null,4)));let u=0,l="";if((s=t==null?void 0:t.trimCharsBeforeMatching)!=null&&s.some((d,h)=>d.length>1?(u=h,l=d,!0):!1))throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_07] the fourth argument, options object contains trimCharsBeforeMatching. It was meant to list the single characters but one of the entries at index ").concat(u," is longer than 1 character, ").concat(l.length," (equals to ").concat(l,"). Please split it into separate characters and put into array as separate elements."));if(!a||!Array.isArray(a)||Array.isArray(a)&&!a.length||Array.isArray(a)&&a.length===1&&A(a[0])&&!a[0].trim()){if(typeof t.cb=="function"){let h,y=n;if((e==="matchLeftIncl"||e==="matchRight")&&(y+=1),e[5]==="L")for(let b=y;b--;){let w=r[b];if((!t.trimBeforeMatching||t.trimBeforeMatching&&(w!=null&&w.trim()))&&(!((c=t.trimCharsBeforeMatching)!=null&&c.length)||w!==void 0&&!t.trimCharsBeforeMatching.includes(w))){h=b;break}}else if(e.startsWith("matchRight"))for(let b=y;b<r.length;b++){let w=r[b];if((!t.trimBeforeMatching||t.trimBeforeMatching&&w.trim())&&(!(($=t.trimCharsBeforeMatching)!=null&&$.length)||!t.trimCharsBeforeMatching.includes(w))){h=b;break}}if(h===void 0)return!1;let m=r[h],g=h+1,p="";return g&&g>0&&(p=r.slice(0,g)),e[5]==="L"||h&&h>0&&(p=r.slice(h)),t.cb(m,p,h)}let d="";throw f||(d=" More so, the whole options object, the fourth input argument, is missing!"),new Error("string-match-left-right/".concat(e,'(): [THROW_ID_08] the third argument, "whatToMatch", was given as an empty string. This means, you intend to match purely by a callback. The callback was not set though, the opts key "cb" is not set!').concat(d))}for(let d=0,h=a.length;d<h;d++){o=typeof a[d]=="function";let y=a[d],m,g,p="",b=n;e==="matchRight"?b+=1:e==="matchLeft"&&(b-=1);let w=Ze(r,b,y,t,o,v=>e[5]==="L"?v-1:v+1);if(w&&o&&typeof y=="function"&&y()==="EOL")return y()&&(!t.cb||t.cb(m,p,g))?y():!1;if(Number.isInteger(w)&&(g=e.startsWith("matchLeft")?w-1:w+1,e[5]==="L"?p=r.slice(0,w):p=r.slice(g)),g<0&&(g=void 0),r[g]&&(m=r[g]),Number.isInteger(w)&&(!t.cb||t.cb(m,p,g)))return y}return!1}function C(e,r,n,i){return me("matchLeftIncl",e,r,n,i)}function D(e,r,n,i){return me("matchRightIncl",e,r,n,i)}function U(e,r=1){let n="\xA0";function i(t){return Array.from(t).reverse().join("")}function f(t,a,o){let u=o?"\n":"\r",l=o?"\r":"\n";if(!t)return t;let s=0,c=0,$="";for(let d=0,h=t.length;d<h;d++)(t[d]===u||t[d]===l&&t[d-1]!==u)&&c++,"\r\n".includes(t[d])||t[d]===n?(s=0,t[d]===n?$+=t[d]:t[d]===u?c<=a&&($+=t[d],t[d+1]===l&&($+=t[d+1],d++)):t[d]===l&&(t==null?void 0:t[d-1])!==u&&c<=a&&($+=t[d])):(s++,!t[d+1]&&!c&&($+=" "));return $}if(typeof e=="string"&&e.length){let t=1;typeof+r=="number"&&Number.isInteger(+r)&&+r>=0&&(t=+r);let a="",o="";if(!e.trim())a=e;else if(!e[0].trim()){for(let u=0,l=e.length;u<l;u++)if(e[u].trim()){a=e.slice(0,u);break}}if(e.trim()&&(e.slice(-1).trim()===""||e.slice(-1)===n)){for(let u=e.length;u--;)if(e[u].trim()){o=e.slice(u+1);break}}return"".concat(f(a,t,!1)).concat(e.trim()).concat(i(f(i(o),t,!0)))}return e}var Ye={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function H(e,r){if(!Array.isArray(e)||!e.length)return e;let n=T(T({},Ye),r),i,f;if(n.strictlyTwoElementsInRangeArrays&&!e.every((o,u)=>!Array.isArray(o)||o.length!==2?(i=u,f=o.length,!1):!0))throw new TypeError("ranges-sort: [THROW_ID_03] The first argument should be an array and must consist of arrays which are natural number indexes representing TWO string index ranges. However, ".concat(i,"th range (").concat(JSON.stringify(e[i],null,4),") has not two but ").concat(f," elements!"));if(!e.every((o,u)=>!Array.isArray(o)||!Number.isInteger(o[0])||o[0]<0||!Number.isInteger(o[1])||o[1]<0?(i=u,!1):!0))throw new TypeError("ranges-sort: [THROW_ID_04] The first argument should be an array and must consist of arrays which are natural number indexes representing string index ranges. However, ".concat(i,"th range (").concat(JSON.stringify(e[i],null,4),") does not consist of only natural numbers!"));let t=e.length**2,a=0;return Array.from(e).sort((o,u)=>(n.progressFn&&(a+=1,n.progressFn(Math.floor(a*100/t))),o[0]===u[0]?o[1]<u[1]?-1:o[1]>u[1]?1:0:o[0]<u[0]?-1:1))}var we={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function Xe(e,r){var l;function n(s){return!!s&&typeof s=="object"&&!Array.isArray(s)}if(!Array.isArray(e)||!e.length)return null;let i;if(r)if(n(r)){if(i=T(T({},we),r),i.progressFn&&n(i.progressFn)&&!Object.keys(i.progressFn).length)i.progressFn=null;else if(i.progressFn&&typeof i.progressFn!="function")throw new Error('ranges-merge: [THROW_ID_01] resolvedOpts.progressFn must be a function! It was given of a type: "'.concat(typeof i.progressFn,'", equal to ').concat(JSON.stringify(i.progressFn,null,4)));if(![1,2,"1","2"].includes(i.mergeType))throw new Error('ranges-merge: [THROW_ID_02] resolvedOpts.mergeType was customised to a wrong thing! It was given of a type: "'.concat(typeof i.mergeType,'", equal to ').concat(JSON.stringify(i.mergeType,null,4)));if(typeof i.joinRangesThatTouchEdges!="boolean")throw new Error('ranges-merge: [THROW_ID_04] resolvedOpts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "'.concat(typeof i.joinRangesThatTouchEdges,'", equal to ').concat(JSON.stringify(i.joinRangesThatTouchEdges,null,4)))}else throw new Error("ranges-merge: [THROW_ID_03] the second input argument must be a plain object. It was given as:\n".concat(JSON.stringify(r,null,4)," (type ").concat(typeof r,")"));else i=T({},we);let f=e.filter(s=>Array.isArray(s)).map(s=>[...s]).filter(s=>s[2]!==void 0||s[0]!==s[1]),t,a,o;i.progressFn?t=H(f,{progressFn:s=>{o=Math.floor(s/5),o!==a&&(a=o,i.progressFn!=null&&i.progressFn(o))}}):t=H(f);let u=t.length-1;for(let s=u;s>0;s--)i.progressFn&&(o=Math.floor((1-s/u)*78)+21,o!==a&&o>a&&(a=o,i.progressFn(o))),(t[s][0]<=t[s-1][0]||!i.joinRangesThatTouchEdges&&t[s][0]<t[s-1][1]||i.joinRangesThatTouchEdges&&t[s][0]<=t[s-1][1])&&(t[s-1][0]=Math.min(t[s][0],t[s-1][0]),t[s-1][1]=Math.max(t[s][1],t[s-1][1]),t[s][2]!==void 0&&(t[s-1][0]>=t[s][0]||t[s-1][1]<=t[s][1])&&t[s-1][2]!==null&&(t[s][2]===null&&t[s-1][2]!==null?t[s-1][2]=null:t[s-1][2]!=null?+((l=i||{})==null?void 0:l.mergeType)==2&&t[s-1][0]===t[s][0]?t[s-1][2]=t[s][2]:t[s-1][2]+=t[s][2]:t[s-1][2]=t[s][2]),t.splice(s,1),s=t.length);return t.length?t:null}var er={limitToBeAddedWhitespace:!1,limitLinebreaksCount:1,mergeType:1},M=class{constructor(e){Y(this,"ranges");Y(this,"opts");let r=T(T({},er),e);if(r.mergeType&&r.mergeType!==1&&r.mergeType!==2)if(A(r.mergeType)&&r.mergeType.trim()==="1")r.mergeType=1;else if(A(r.mergeType)&&r.mergeType.trim()==="2")r.mergeType=2;else throw new Error('ranges-push: [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "'.concat(typeof r.mergeType,'", equal to ').concat(JSON.stringify(r.mergeType,null,4)));this.opts=r,this.ranges=[]}add(e,r,n){var t;if(e==null&&r==null)return;if(S(e)&&!S(r)){if(Array.isArray(e)){if(e.length){if(e.some(a=>Array.isArray(a))){e.forEach(a=>{Array.isArray(a)&&this.add(...a)});return}e.length&&N(+e[0])&&N(+e[1])&&this.add(...e)}return}throw new TypeError('ranges-push/Ranges/add(): [THROW_ID_12] the first input argument, "from" is set ('.concat(JSON.stringify(e,null,0),') but second-one, "to" is not (').concat(JSON.stringify(r,null,0),")"))}else if(!S(e)&&S(r))throw new TypeError('ranges-push/Ranges/add(): [THROW_ID_13] the second input argument, "to" is set ('.concat(JSON.stringify(r,null,0),') but first-one, "from" is not (').concat(JSON.stringify(e,null,0),")"));let i=+e,f=+r;if(N(n)&&(n=String(n)),N(i)&&N(f)){if(S(n)&&!A(n)&&!N(n))throw new TypeError("ranges-push/Ranges/add(): [THROW_ID_08] The third argument, the value to add, was given not as string but ".concat(typeof n,", equal to:\n").concat(JSON.stringify(n,null,4)));if(S(this.ranges)&&Array.isArray(this.last())&&i===this.last()[1]){if(this.last()[1]=f,this.last()[2],this.last()[2]!==null&&S(n)){let a=this.last()[2]&&this.last()[2].length&&(!((t=this.opts)!=null&&t.mergeType)||this.opts.mergeType===1)?"".concat(this.last()[2]).concat(n):n;this.opts.limitToBeAddedWhitespace&&(a=U(a,this.opts.limitLinebreaksCount)),A(a)&&!a.length||(this.last()[2]=a)}}else{this.ranges||(this.ranges=[]);let a=n!==void 0&&!(A(n)&&!n.length)?[i,f,n&&this.opts.limitToBeAddedWhitespace?U(n,this.opts.limitLinebreaksCount):n]:[i,f];this.ranges.push(a)}}else throw N(i)&&i>=0?new TypeError('ranges-push/Ranges/add(): [THROW_ID_10] "to" value, the second input argument, must be a natural number or zero! Currently it\'s of a type "'.concat(typeof f,'" equal to: ').concat(JSON.stringify(f,null,4))):new TypeError('ranges-push/Ranges/add(): [THROW_ID_09] "from" value, the first input argument, must be a natural number or zero! Currently it\'s of a type "'.concat(typeof i,'" equal to: ').concat(JSON.stringify(i,null,4)))}push(e,r,n){this.add(e,r,n)}current(){return Array.isArray(this.ranges)&&this.ranges.length?(this.ranges=Xe(this.ranges,{mergeType:this.opts.mergeType}),this.ranges&&this.opts.limitToBeAddedWhitespace?this.ranges.map(e=>S(e[2])?[e[0],e[1],U(e[2],this.opts.limitLinebreaksCount)]:e):this.ranges):null}wipe(){this.ranges=[]}replace(e){if(Array.isArray(e)&&e.length)if(Array.isArray(e[0])&&N(e[0][0]))this.ranges=Array.from(e);else throw new Error("ranges-push/Ranges/replace(): [THROW_ID_11] Single range was given but we expected array of arrays! The first element, ".concat(JSON.stringify(e[0],null,4)," should be an array and its first element should be an integer, a string index."));else this.ranges=[]}last(){return Array.isArray(this.ranges)&&this.ranges.length?this.ranges[this.ranges.length-1]:null}};var be={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function $e(e,r){function n(l){return!!l&&typeof l=="object"&&!Array.isArray(l)}if(!Array.isArray(e)||!e.length)return null;let i;if(r)if(n(r)){if(i=T(T({},be),r),i.progressFn&&n(i.progressFn)&&!Object.keys(i.progressFn).length)i.progressFn=null;else if(i.progressFn&&typeof i.progressFn!="function")throw new Error('ranges-merge: [THROW_ID_01] opts.progressFn must be a function! It was given of a type: "'.concat(typeof i.progressFn,'", equal to ').concat(JSON.stringify(i.progressFn,null,4)));if(![1,2,"1","2"].includes(i.mergeType))throw new Error('ranges-merge: [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "'.concat(typeof i.mergeType,'", equal to ').concat(JSON.stringify(i.mergeType,null,4)));if(typeof i.joinRangesThatTouchEdges!="boolean")throw new Error('ranges-merge: [THROW_ID_04] opts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "'.concat(typeof i.joinRangesThatTouchEdges,'", equal to ').concat(JSON.stringify(i.joinRangesThatTouchEdges,null,4)))}else throw new Error("emlint: [THROW_ID_03] the second input argument must be a plain object. It was given as:\n".concat(JSON.stringify(r,null,4)," (type ").concat(typeof r,")"));else i=T({},be);let f=e.filter(l=>Array.isArray(l)).map(l=>[...l]).filter(l=>l[2]!==void 0||l[0]!==l[1]),t,a,o;i.progressFn?t=H(f,{progressFn:l=>{o=Math.floor(l/5),o!==a&&(a=o,i.progressFn(o))}}):t=H(f);let u=t.length-1;for(let l=u;l>0;l--)i.progressFn&&(o=Math.floor((1-l/u)*78)+21,o!==a&&o>a&&(a=o,i.progressFn(o))),(t[l][0]<=t[l-1][0]||!i.joinRangesThatTouchEdges&&t[l][0]<t[l-1][1]||i.joinRangesThatTouchEdges&&t[l][0]<=t[l-1][1])&&(t[l-1][0]=Math.min(t[l][0],t[l-1][0]),t[l-1][1]=Math.max(t[l][1],t[l-1][1]),t[l][2]!==void 0&&(t[l-1][0]>=t[l][0]||t[l-1][1]<=t[l][1])&&t[l-1][2]!==null&&(t[l][2]===null&&t[l-1][2]!==null?t[l-1][2]=null:t[l-1][2]!=null?+i.mergeType==2&&t[l-1][0]===t[l][0]?t[l-1][2]=t[l][2]:t[l-1][2]+=t[l][2]:t[l-1][2]=t[l][2]),t.splice(l,1),l=t.length);return t.length?t:null}var rr=!0,X="Invariant failed";function Ae(e,r){if(!e){if(rr)throw new Error(X);var n=typeof r=="function"?r():r,i=n?"".concat(X,": ").concat(n):X;throw new Error(i)}}function j(e,r,n){let i=0,f=0;if(arguments.length===0)throw new Error("ranges-apply: [THROW_ID_01] inputs missing!");if(typeof e!="string")throw new TypeError("ranges-apply: [THROW_ID_02] first input argument must be a string! Currently it's: ".concat(typeof e,", equal to: ").concat(JSON.stringify(e,null,4)));if(r&&!Array.isArray(r))throw new TypeError("ranges-apply: [THROW_ID_03] second input argument must be an array (or null)! Currently it's: ".concat(typeof r,", equal to: ").concat(JSON.stringify(r,null,4)));if(n&&typeof n!="function")throw new TypeError("ranges-apply: [THROW_ID_04] the third input argument must be a function (or falsey)! Currently it's: ".concat(typeof n,", equal to: ").concat(JSON.stringify(n,null,4)));if(!(r!=null&&r.filter(s=>s).length))return e;let t;Array.isArray(r)&&Number.isInteger(r[0])&&Number.isInteger(r[1])?t=[Array.from(r)]:t=Array.from(r);let a=t.length,o=0;t.filter(s=>s).forEach((s,c)=>{if(n&&(i=Math.floor(o/a*10),i!==f&&(f=i,n(i))),!Array.isArray(s))throw new TypeError("ranges-apply: [THROW_ID_05] ranges array, second input arg., has ".concat(c,"th element not an array: ").concat(JSON.stringify(s,null,4),", which is ").concat(typeof s));if(!Number.isInteger(s[0])){if(!Number.isInteger(+s[0])||+s[0]<0)throw new TypeError("ranges-apply: [THROW_ID_06] ranges array, second input arg. has ".concat(c,"th element, array ").concat(JSON.stringify(s,null,0),". Its first element is not an integer, string index, but ").concat(typeof s[0],", equal to: ").concat(JSON.stringify(s[0],null,4),"."));t[c][0]=+t[c][0]}if(!Number.isInteger(s[1])){if(!Number.isInteger(+s[1])||+s[1]<0)throw new TypeError("ranges-apply: [THROW_ID_07] ranges array, second input arg. has ".concat(c,"th element, array ").concat(JSON.stringify(s,null,0),". Its second element is not an integer, string index, but ").concat(typeof s[1],", equal to: ").concat(JSON.stringify(s[1],null,4),"."));t[c][1]=+t[c][1]}o+=1});let u=$e(t,{progressFn:s=>{n&&(i=10+Math.floor(s/10),i!==f&&(f=i,n(i)))}});Ae(u);let l=u.length;if(l>0){let s=e.slice(u[l-1][1]);e=u.reduce((c,$,d,h)=>{n&&(i=20+Math.floor(d/l*80),i!==f&&(f=i,n(i)));let y=d===0?0:h[d-1][1],m=h[d][0];return"".concat(c).concat(e.slice(y,m)).concat(h[d][2]||"")},""),e+=s}return e}var tr={classicTrim:!1,cr:!1,lf:!1,tab:!1,space:!0,nbsp:!1};function J(e,r){if(typeof e!="string")throw new Error("string-trim-spaces-only: [THROW_ID_01] input must be string! It was given as ".concat(typeof e,", equal to:\n").concat(JSON.stringify(e,null,4)));let n=T(T({},tr),r);function i(a){return n.classicTrim&&!a.trim()||!n.classicTrim&&(n.space&&a===" "||n.cr&&a==="\r"||n.lf&&a==="\n"||n.tab&&a===" "||n.nbsp&&a==="\xA0")}let f,t;if(e.length){if(i(e[0]))for(let a=0,o=e.length;a<o;a++){if(!i(e[a])){f=a;break}if(a===e.length-1)return{res:"",ranges:[[0,e.length]]}}if(i(e[e.length-1])){for(let a=e.length;a--;)if(!i(e[a])){t=a+1;break}}return f?t?{res:e.slice(f,t),ranges:[[0,f],[t,e.length]]}:{res:e.slice(f),ranges:[[0,f]]}:t?{res:e.slice(0,t),ranges:[[t,e.length]]}:{res:e,ranges:[]}}return{res:"",ranges:[]}}var nr={heads:["{{"],tails:["}}"]};function Te(e,r){let n=Object.prototype.hasOwnProperty;if(e===void 0)throw new Error("string-remove-duplicate-heads-tails: [THROW_ID_01] The input is missing!");if(typeof e!="string")return e;if(r&&!E(r))throw new Error("string-remove-duplicate-heads-tails: [THROW_ID_03] The given options are not a plain object but ".concat(typeof r,"!"));let i=T({},r);if(i&&n.call(i,"heads"))if(I(i.heads).every(y=>typeof y=="string"||Array.isArray(y)))typeof i.heads=="string"&&(i.heads=I(i.heads));else throw new Error("string-remove-duplicate-heads-tails: [THROW_ID_04] The resolvedOpts.heads contains elements which are not string-type!");if(i&&n.call(i,"tails"))if(I(i.tails).every(y=>typeof y=="string"||Array.isArray(y)))typeof i.tails=="string"&&(i.tails=I(i.tails));else throw new Error("string-remove-duplicate-heads-tails: [THROW_ID_05] The resolvedOpts.tails contains elements which are not string-type!");let f=J(e).res;if(f.length===0)return e;e=f;let t=T(T({},nr),i);t.heads=t.heads.map(y=>y.trim()),t.tails=t.tails.map(y=>y.trim());let a=!1,o=!1,u=new M({limitToBeAddedWhitespace:!0}),l=new M({limitToBeAddedWhitespace:!0}),s=!0,c=!0,$="";function d(y,m){let g;return D(y,0,m.heads,{trimBeforeMatching:!0,cb:(p,b,w)=>(g=w,!0)})&&D(y,g,m.tails,{trimBeforeMatching:!0,cb:(p,b,w)=>(g=w,!0)})?y.slice(g):y}for(;e!==d(e,t);)e=J(d(e,t)).res;function h(y,m){let g;return!C(y,y.length-1,m.tails,{trimBeforeMatching:!0,cb:(p,b,w)=>(g=w,!0)})||!g?y:C(y,g,m.heads,{trimBeforeMatching:!0,cb:(p,b,w)=>(g=w,!0)})?y.slice(0,g+1):y}for(;e!==h(e,t);)e=J(h(e,t)).res;if(!t.heads.length||!D(e,0,t.heads,{trimBeforeMatching:!0})||!t.tails.length||!C(e,e.length-1,t.tails,{trimBeforeMatching:!0}))return J(e).res;for(let y=0,m=e.length;y<m;y++)if(e[y].trim()!==""){let g;if(D(e,y,t.heads,{trimBeforeMatching:!0,cb:(p,b,w)=>(g=w,!0)})&&g){c=!0,s&&(s=!0);let p;D(e,g,t.tails,{trimBeforeMatching:!0,cb:(b,w,v)=>(p=v,!0)})&&u.push(y,p),l.current()&&a&&$!=="tails"&&u.push(l.current()),a||l.current()&&(u.push(l.current()),l.wipe()),l.push(y,g),$="heads",y=g-1;continue}if(D(e,y,t.tails,{trimBeforeMatching:!0,cb:(p,b,w)=>(g=Number.isInteger(w)?w:e.length,!0)})&&g){c=!0,s?($==="heads"&&l.wipe(),s=!1):l.push(y,g),$="tails",y=g-1;continue}s&&(s=!0),c&&!a?(a=!0,c=!1):c&&!o?(o=!0,s=!0,c=!1,$==="heads"&&l.wipe()):c&&o&&l.wipe()}return l.current()&&u.push(l.current()),u.current()?j(e,u.current()).trim():e.trim()}var Oe={fromIndex:0,throwWhenSomethingWrongIsDetected:!0,allowWholeValueToBeOnlyHeadsOrTails:!0,source:"string-find-heads-tails",matchHeadsAndTailsStrictlyInPairsByTheirOrder:!1,relaxedAPI:!1};function ee(e,r,n,i){if(S(i)&&!E(i))throw new TypeError("string-find-heads-tails: [THROW_ID_01] the fourth input argument, an Optional Options Object, must be a plain object! Currently it's equal to: ".concat(i," (type: ").concat(typeof i,")"));let f=T(T({},Oe),i);if(A(f.fromIndex)&&/^\d*$/.test(f.fromIndex))f.fromIndex=Number(f.fromIndex);else if(!Number.isInteger(f.fromIndex)||f.fromIndex<0)throw new TypeError("".concat(f.source," [THROW_ID_18] the fourth input argument must be a natural number or zero! Currently it's: ").concat(f.fromIndex));if(!A(e)||e.length===0){if(f.relaxedAPI)return[];throw new TypeError("string-find-heads-tails: [THROW_ID_02] the first input argument, input string, must be a non-zero-length string! Currently it's: ".concat(typeof e,", equal to: ").concat(e))}let t,a;if(!A(r)&&!Array.isArray(r)){if(f.relaxedAPI)return[];throw new TypeError("string-find-heads-tails: [THROW_ID_03] the second input argument, heads, must be either a string or an array of strings! Currently it's: ".concat(typeof r,", equal to:\n").concat(JSON.stringify(r,null,4)))}else if(A(r))if(r.length===0){if(f.relaxedAPI)return[];throw new TypeError("string-find-heads-tails: [THROW_ID_04] the second input argument, heads, must be a non-empty string! Currently it's empty.")}else r=I(r);else if(Array.isArray(r))if(r.length===0){if(f.relaxedAPI)return[];throw new TypeError("string-find-heads-tails: [THROW_ID_05] the second input argument, heads, must be a non-empty array and contain at least one string! Currently it's empty.")}else if(r.every((h,y)=>(t=h,a=y,A(h)))){if(!r.every((h,y)=>(a=y,A(h)&&h.length&&h.trim()!=="")))if(f.relaxedAPI){if(r=r.filter(h=>A(h)&&h.length),r.length===0)return[]}else throw new TypeError("string-find-heads-tails: [THROW_ID_07] the second input argument, heads, should not contain empty strings! For example, there's one detected at index ".concat(a," of heads array:\n").concat(JSON.stringify(r,null,4),"."))}else if(f.relaxedAPI){if(r=r.filter(h=>A(h)&&h.length),r.length===0)return[]}else throw new TypeError("string-find-heads-tails: [THROW_ID_06] the second input argument, heads, contains non-string elements! For example, element at ".concat(a,"th index is ").concat(typeof t,", equal to:\n").concat(JSON.stringify(t,null,4),". Whole heads array looks like:\n").concat(JSON.stringify(r,null,4)));if(!A(n)&&!Array.isArray(n)){if(f.relaxedAPI)return[];throw new TypeError("string-find-heads-tails: [THROW_ID_08] the third input argument, tails, must be either a string or an array of strings! Currently it's: ".concat(typeof n,", equal to:\n").concat(JSON.stringify(n,null,4)))}else if(A(n))if(n.length===0){if(f.relaxedAPI)return[];throw new TypeError("string-find-heads-tails: [THROW_ID_09] the third input argument, tails, must be a non-empty string! Currently it's empty.")}else n=I(n);else if(Array.isArray(n))if(n.length===0){if(f.relaxedAPI)return[];throw new TypeError("string-find-heads-tails: [THROW_ID_10] the third input argument, tails, must be a non-empty array and contain at least one string! Currently it's empty.")}else if(n.every((h,y)=>(t=h,a=y,A(h)))){if(!n.every((h,y)=>(a=y,A(h)&&h.length&&h.trim()!=="")))if(f.relaxedAPI){if(n=n.filter(h=>A(h)&&h.length),n.length===0)return[]}else throw new TypeError("string-find-heads-tails: [THROW_ID_12] the third input argument, tails, should not contain empty strings! For example, there's one detected at index ".concat(a,". Whole tails array is equal to:\n").concat(JSON.stringify(n,null,4)))}else if(f.relaxedAPI){if(n=n.filter(h=>A(h)&&h.length),n.length===0)return[]}else throw new TypeError("string-find-heads-tails: [THROW_ID_11] the third input argument, tails, contains non-string elements! For example, element at ".concat(a,"th index is ").concat(typeof t,", equal to:\n").concat(JSON.stringify(t,null,4),". Whole tails array is equal to:\n").concat(JSON.stringify(n,null,4)));let o=f.source===Oe.source;if(f.throwWhenSomethingWrongIsDetected&&!f.allowWholeValueToBeOnlyHeadsOrTails){if(I(r).includes(e))throw new Error("".concat(f.source).concat(o?": [THROW_ID_16]":""," the whole input string can't be equal to ").concat(A(r)?"":"one of ","heads (").concat(e,")!"));if(I(n).includes(e))throw new Error("".concat(f.source).concat(o?": [THROW_ID_17]":""," the whole input string can't be equal to ").concat(A(n)?"":"one of ","tails (").concat(e,")!"))}let u=r.concat(n).map(h=>h.charAt(0)).reduce((h,y)=>y.charCodeAt(0)>h[1]?[h[0],y.charCodeAt(0)]:y.charCodeAt(0)<h[0]?[y.charCodeAt(0),h[1]]:h,[r[0].charCodeAt(0),r[0].charCodeAt(0)]),l=[],s=!1,c={},$="",d;for(let h=f.fromIndex,y=e.length;h<y;h++){let m=e[h].charCodeAt(0);if(m<=u[1]&&m>=u[0]){let g=D(e,h,r);if(g&&f.matchHeadsAndTailsStrictlyInPairsByTheirOrder){for(let b=r.length;b--;)if(r[b]===g){d=b;break}}if(A(g))if(s){if(f.throwWhenSomethingWrongIsDetected)throw new TypeError("".concat(f.source).concat(o?": [THROW_ID_19]":"",' When processing "').concat(e,'", we found heads (').concat(e.slice(h,h+g.length),') starting at character with index number "').concat(h,'" and there was another set of heads before it! Generally speaking, there should be "heads-tails-heads-tails", not "heads-heads-tails"!\nWe\'re talking about the area of the code:\n\n\n--------------------------------------starts\n').concat(e.slice(Math.max(h-200,0),h),"\n \x1B[33m------->\x1B[39m ").concat("\x1B[31m".concat(e.slice(h,h+g.length),"\x1B[39m")," \x1B[33m<-------\x1B[39m\n").concat(e.slice(h+g.length,Math.min(y,h+200)),"\n--------------------------------------ends\n\n\nTo turn off this error being thrown, set resolvedOpts.throwWhenSomethingWrongIsDetected to Boolean false."))}else{c={},c.headsStartAt=h,c.headsEndAt=h+g.length,s=!0,h+=g.length-1,$&&($="");continue}let p=D(e,h,n);if(s&&p&&f.matchHeadsAndTailsStrictlyInPairsByTheirOrder&&d!==void 0&&n[d]!==void 0&&n[d]!==p){let b;for(let w=n.length;w--;)if(n[w]===p){b=w;break}throw new TypeError("".concat(f.source).concat(o?": [THROW_ID_20]":"",' When processing "').concat(e,'", we had "resolvedOpts.matchHeadsAndTailsStrictlyInPairsByTheirOrder" on. We found heads (').concat(r[d],") but the tails the followed it were not of the same index, ").concat(d," (").concat(n[d],") but ").concat(b," (").concat(p,")."))}if(A(p))if(s){c.tailsStartAt=h,c.tailsEndAt=h+p.length,l.push(c),c={},s=!1,h+=p.length-1;continue}else f.throwWhenSomethingWrongIsDetected&&($="".concat(f.source).concat(o?": [THROW_ID_21]":"",' When processing "').concat(e,'", we found tails (').concat(e.slice(h,h+p.length),') starting at character with index number "').concat(h,"\" but there were no heads preceding it. That's very naughty!"))}if(f.throwWhenSomethingWrongIsDetected&&h===y-1){if(Object.keys(c).length!==0)throw new TypeError("".concat(f.source).concat(o?": [THROW_ID_22]":"",' When processing "').concat(e,"\", we reached the end of the string and yet didn't find any tails (").concat(JSON.stringify(n,null,4),") to match the last detected heads (").concat(e.slice(c.headsStartAt,c.headsEndAt),")!"));if($)throw new Error($)}}return l}var ve=k(L(),1);function re(e){if(e.includes(".")){let r=e.lastIndexOf(".");if(!e.slice(0,r).includes("."))return e.slice(0,r);for(let n=r-1;n--;)if(e[n]===".")return e.slice(n+1,r)}return null}var te=(0,ve.default)();function K(e,r){let n={now:!1};function i(f,t,a,o){let u=te(f),l,s=T({depth:-1,path:""},a);if(s.depth+=1,Array.isArray(u))for(let c=0,$=u.length;c<$&&!o.now;c++){let d=s.path?"".concat(s.path,".").concat(c):"".concat(c);u[c]!==void 0?(s.parent=te(u),s.parentType="array",s.parentKey=re(d),l=i(t(u[c],void 0,P(T({},s),{path:d}),o),t,P(T({},s),{path:d}),o),Number.isNaN(l)&&c<u.length?(u.splice(c,1),c-=1):u[c]=l):u.splice(c,1)}else if(E(u))for(let c in u){if(o.now&&c!=null)break;let $=s.path?"".concat(s.path,".").concat(c):c;s.depth===0&&c!=null&&(s.topmostKey=c),s.parent=te(u),s.parentType="object",s.parentKey=re($),l=i(t(c,u[c],P(T({},s),{path:$}),o),t,P(T({},s),{path:$}),o),Number.isNaN(l)?delete u[c]:u[c]=l}return u}return i(e,r,{},n)}function ne(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var ie=new Map,Ee=(e,r)=>{if(!Array.isArray(e))switch(typeof e){case"string":{e=[e];break}case"undefined":{e=[];break}default:throw new TypeError("Expected '".concat(r,"' to be a string or an array, but got a type of '").concat(typeof e,"'"))}return e.filter(n=>{if(typeof n!="string"){if(n===void 0)return!1;throw new TypeError("Expected '".concat(r,"' to be an array of strings, but found a type of '").concat(typeof n,"' in the array"))}return!0})},Ie,Se,We,ir=(e,r)=>{r=T({caseSensitive:!1},r);let n="s"+(r.caseSensitive?"":"i"),i=e+"|"+n;if(ie.has(i))return ie.get(i);let f=e[0]==="!";f&&(e=e.slice(1)),e=e.replaceAll(String.raw(Ie||(Ie=F(["*"],["\\*"]))),"__ESCAPED_STAR__").replaceAll("\\\\","__ESCAPED_BACKSLASH__").replaceAll(/\\(.)/g,"$1"),e=ne(e).replaceAll(String.raw(Se||(Se=F(["*"],["\\*"]))),".*"),e=e.replaceAll("__ESCAPED_STAR__",String.raw(We||(We=F(["*"],["\\*"])))).replaceAll("__ESCAPED_BACKSLASH__","\\\\");let t=new RegExp("^".concat(e,"$"),n);return t.negated=f,ie.set(i,t),t},sr=(e,r,n,i)=>{if(e=Ee(e,"inputs"),r=Ee(r,"patterns"),r.length===0)return[];r=r.map(u=>ir(u,n));let f=r.filter(u=>u.negated),t=r.filter(u=>!u.negated),{allPatterns:a}=n||{},o=[];if(a&&i&&f.length>1&&t.length===0){for(let u of e)for(let l of f)if(l.test(u))return[];return e.slice(0,1)}for(let u of e){let l=!1;for(let s of f)if(s.test(u)){l=!0;break}if(!l){if(t.length===0)o.push(u);else if(a){let s=Array.from({length:t.length},()=>!1);for(let[c,$]of t.entries())$.test(u)&&(s[c]=!0);s.every(Boolean)&&o.push(u)}else{let s=!1;for(let c of t)if(c.test(u)){s=!0;break}s&&o.push(u)}if(i&&o.length>0)break}}return o};function z(e,r,n){return sr(e,r,n,!0).length>0}var _e=k(L(),1);var De=(0,_e.default)();function se(e,r,n){let i;n!==void 0&&(i=Array.isArray(n)?De(n):[De(n)]);let f=[],t=K(e,(a,o,u)=>{let l=o!==void 0?o:a;if(o!==void 0&&z(a,r,{caseSensitive:!0})){if(i===void 0)f.push({val:o,path:u.path});else if(i.length)return i.shift()}return l});return i===void 0?f:t}var _=k(xe(),1);var Re="12.0.34";var or=Re,lr=Object.prototype.hasOwnProperty,He={heads:"%%_",tails:"_%%",headsNoWrap:"%%-",tailsNoWrap:"-%%",lookForDataContainers:!0,dataContainerIdentifierTails:"_data",wrapHeadsWith:"",wrapTailsWith:"",dontWrapVars:[],preventDoubleWrapping:!0,wrapGlobalFlipSwitch:!0,noSingleMarkers:!1,resolveToBoolIfAnyValuesContainBool:!0,resolveToFalseIfAnyValuesContainBool:!0,throwWhenNonStringInsertedInString:!1,allowUnresolved:!1};function O(e){return A(e)?e.trim():e}function ur(e){if(A(e)&&e.length&&e.indexOf(".")!==-1){for(let r=0,n=e.length;r<n;r++)if(e[r]===".")return e.slice(0,r)}return e}function fr(e){if(A(e)&&e.length&&e.indexOf(".")!==-1){for(let r=0,n=e.length;r<n;r++)if(e[r]===".")return e.slice(r+1)}return e}function je(e){if(A(e)&&e.length&&e.indexOf(".")!==-1){for(let r=e.length;r--;)if(e[r]===".")return e.slice(0,r)}return e}function Ve(e){if(A(e)&&e.length&&e.indexOf(".")!==-1){for(let r=e.length;r--;)if(e[r]===".")return e.slice(r+1)}return e}function ae(e,r){return!A(e)||!e.trim()?!1:!!(e.includes(r.heads)||e.includes(r.tails)||A(r.headsNoWrap)&&r.headsNoWrap.length&&e.includes(r.headsNoWrap)||A(r.tailsNoWrap)&&r.tailsNoWrap.length&&e.includes(r.tailsNoWrap))}function cr(e,r,n){let i,f;return A(e)&&e.length&&D(e,0,r,{trimBeforeMatching:!0,cb:(t,a,o)=>(i=o,!0)})&&C(e,e.length-1,n,{trimBeforeMatching:!0,cb:(t,a,o)=>(f=(o||0)+1,!0)})?e.slice(i,f):e}function Ce(e,r,n=!1,i,f,t){if(r.wrapHeadsWith||(r.wrapHeadsWith=""),r.wrapTailsWith||(r.wrapTailsWith=""),A(e)&&!n&&r.wrapGlobalFlipSwitch&&!r.dontWrapVars.some(a=>z(t,a))&&(!r.preventDoubleWrapping||r.preventDoubleWrapping&&A(e)&&!e.includes(r.wrapHeadsWith)&&!e.includes(r.wrapTailsWith)))return"".concat(r.wrapHeadsWith).concat(e).concat(r.wrapTailsWith);if(n){if(!A(e))return e;let a=Te(e,{heads:r.wrapHeadsWith,tails:r.wrapTailsWith});return A(a)?cr(a,r.wrapHeadsWith,r.wrapTailsWith):a}return e}function gr(e,r,n,i){let f;if(n.indexOf(".")!==-1){let t=n,a=!0;if(i.lookForDataContainers&&A(i.dataContainerIdentifierTails)&&i.dataContainerIdentifierTails.length&&!t.endsWith(i.dataContainerIdentifierTails)){let o=_.default.get(e,t+i.dataContainerIdentifierTails);E(o)&&_.default.get(o,r)&&(f=_.default.get(o,r),a=!1)}for(;a&&t.indexOf(".")!==-1;){if(t=je(t),Ve(t)===r)throw new Error('json-variables/findValues(): [THROW_ID_20] While trying to resolve: "'.concat(r,'" at path "').concat(n,'", we encountered a closed loop. The parent key "').concat(Ve(t),'" is called the same as the variable "').concat(r,"\" we're looking for."));if(i.lookForDataContainers&&A(i.dataContainerIdentifierTails)&&i.dataContainerIdentifierTails.length&&!t.endsWith(i.dataContainerIdentifierTails)){let o=_.default.get(e,t+i.dataContainerIdentifierTails);E(o)&&_.default.get(o,r)&&(f=_.default.get(o,r),a=!1)}if(f===void 0){let o=_.default.get(e,t);E(o)&&_.default.get(o,r)&&(f=_.default.get(o,r),a=!1)}}}if(f===void 0){let t=_.default.get(e,r);t!==void 0&&(f=t)}if(f===void 0)if(r.indexOf(".")===-1){let t=se(e,r);if(t.length){for(let a=0,o=t.length;a<o;a++)if(A(t[a].val)||q(t[a].val)||B(t[a].val)){f=t[a].val;break}else if(pe(t[a].val)){f=String(t[a].val);break}else if(Array.isArray(t[a].val)){f=t[a].val.join("");break}}}else{let t=se(e,ur(r));if(t.length)for(let a=0,o=t.length;a<o;a++){let u=_.default.get(t[a].val,fr(r));u&&A(u)&&(f=u)}}return f}function Pe(e,r,n,i,f=[]){if(f.includes(n)){let d="";if(f.length>1){let h=" \u2192\n";d=f.reduce((y,m,g)=>y+(g===0?"":h)+(m===n?"\u{1F4A5} ":" ")+m," Here's the path we travelled up until we hit the recursion:\n\n"),d+="".concat(h,"\u{1F4A5} ").concat(n)}throw new Error('json-variables/resolveString(): [THROW_ID_19] While trying to resolve: "'.concat(r,'" at path "').concat(n,'", we encountered a closed loop, the key is referencing itself."').concat(d))}let t={},a=Array.from(f);a.push(n);let o=new M;function u(d,h,y){for(let m=0,g=d.length;m<g;m++){let p=d[m],b=r.slice(p.headsEndAt,p.tailsStartAt);if(b.length===0)o.push(p.headsStartAt,p.tailsEndAt);else if(lr.call(t,b)&&A(t[b]))o.push(p.headsStartAt,p.tailsEndAt,t[b]);else{let w=gr(e,b.trim(),n,i);if(w===void 0)if(i.allowUnresolved===!0)w="";else if(A(i.allowUnresolved))w=i.allowUnresolved;else throw new Error("json-variables/processHeadsAndTails(): [THROW_ID_18] We couldn't find the value to resolve the variable ".concat(r.slice(p.headsEndAt,p.tailsStartAt),". We're at path: \"").concat(n,'".'));if(!y&&i.throwWhenNonStringInsertedInString&&!A(w))throw new Error("json-variables/processHeadsAndTails(): [THROW_ID_23] While resolving the variable ".concat(r.slice(p.headsEndAt,p.tailsStartAt)," at path ").concat(n,", it resolved into a non-string value, ").concat(JSON.stringify(w,null,4),'. This is happening because options setting "throwWhenNonStringInsertedInString" is active (set to "true").'));if(q(w)){if(i.resolveToBoolIfAnyValuesContainBool)return o.wipe(),i.resolveToFalseIfAnyValuesContainBool?!1:w;w=""}else{if(B(w)&&y)return o.wipe(),w;Array.isArray(w)?w=String(w.join("")):B(w)?w="":w=String(w)}let v=n.includes(".")?"".concat(je(n),".").concat(b):b;if(ae(w,i)){let W=Ce(Pe(e,w,v,i,a),i,h,a,v,b.trim());A(W)&&o.push(p.headsStartAt,p.tailsEndAt,W)}else{t[b]=w;let W=Ce(w,i,h,a,v,b.trim());A(W)&&o.push(p.headsStartAt,p.tailsEndAt,W)}}}}let l;try{l=ee(r,i.heads,i.tails,{source:"",throwWhenSomethingWrongIsDetected:!1})}catch(d){throw new Error('json-variables/resolveString(): [THROW_ID_17] While trying to resolve string: "'.concat(r,'" at path ').concat(n,", something wrong with heads and tails was detected! Here's the internal error message:\n").concat(d))}let s=!1;l.length===1&&j(r,[[l[0].headsStartAt,l[0].tailsEndAt]]).trim()===""&&(s=!0);let c=u(l,!1,s);if(typeof c=="boolean"||c===null)return c;try{l=ee(r,i.headsNoWrap,i.tailsNoWrap,{source:"",throwWhenSomethingWrongIsDetected:!1})}catch(d){throw new Error('json-variables/resolveString(): [THROW_ID_22] While trying to resolve string: "'.concat(r,'" at path ').concat(n,", something wrong with no-wrap heads and no-wrap tails was detected! Here's the internal error message:\n").concat(d))}l.length===1&&j(r,[[l[0].headsStartAt,l[0].tailsEndAt]]).trim()===""&&(s=!0);let $=u(l,!0,s);return q($)||B($)?$:o!=null&&o.current()?j(r,o.current()):r}function hr(e,r){if(!arguments.length)throw new Error("json-variables/jVar(): [THROW_ID_01] Alas! Inputs are missing!");if(!E(e))throw new TypeError("json-variables/jVar(): [THROW_ID_02] Alas! The input must be a plain object! Currently it's: ".concat(Array.isArray(e)?"array":typeof e));if(r&&!E(r))throw new TypeError("json-variables/jVar(): [THROW_ID_03] Alas! An Optional Options Object must be a plain object! Currently it's: ".concat(Array.isArray(r)?"array":typeof r));let n=T(T({},He),r);n.dontWrapVars?Array.isArray(n.dontWrapVars)||(n.dontWrapVars=I(n.dontWrapVars)):n.dontWrapVars=[];let i,f;if(n.dontWrapVars.length&&!n.dontWrapVars.every((a,o)=>A(a)?!0:(i=a,f=o,!1)))throw new Error('json-variables/jVar(): [THROW_ID_05] Alas! All variable names set in resolvedOpts.dontWrapVars should be of a string type. Computer detected a value "'.concat(i,'" at index ').concat(f,", which is not string but ").concat(Array.isArray(i)?"array":typeof i,"!"));if(n.heads==="")throw new Error("json-variables/jVar(): [THROW_ID_06] Alas! resolvedOpts.heads are empty!");if(n.tails==="")throw new Error("json-variables/jVar(): [THROW_ID_07] Alas! resolvedOpts.tails are empty!");if(n.lookForDataContainers&&n.dataContainerIdentifierTails==="")throw new Error("json-variables/jVar(): [THROW_ID_08] Alas! resolvedOpts.dataContainerIdentifierTails is empty!");if(n.heads===n.tails)throw new Error("json-variables/jVar(): [THROW_ID_09] Alas! resolvedOpts.heads and resolvedOpts.tails can't be equal!");if(n.heads===n.headsNoWrap)throw new Error("json-variables/jVar(): [THROW_ID_10] Alas! resolvedOpts.heads and resolvedOpts.headsNoWrap can't be equal!");if(n.tails===n.tailsNoWrap)throw new Error("json-variables/jVar(): [THROW_ID_11] Alas! resolvedOpts.tails and resolvedOpts.tailsNoWrap can't be equal!");if(n.headsNoWrap==="")throw new Error("json-variables/jVar(): [THROW_ID_12] Alas! resolvedOpts.headsNoWrap is an empty string!");if(n.tailsNoWrap==="")throw new Error("json-variables/jVar(): [THROW_ID_13] Alas! resolvedOpts.tailsNoWrap is an empty string!");if(n.headsNoWrap===n.tailsNoWrap)throw new Error("json-variables/jVar(): [THROW_ID_14] Alas! resolvedOpts.headsNoWrap and resolvedOpts.tailsNoWrap can't be equal!");let t;return K(e,(a,o,u)=>{if(S(o)&&ae(a,n))throw new Error("json-variables/jVar(): [THROW_ID_15] Alas! Object keys can't contain variables!\nPlease check the following key: ".concat(a));if(o!==void 0?t=o:t=a,t==="")return t;if(n.heads.length&&O(t)===O(n.heads)||n.tails.length&&O(t)===O(n.tails)||n.headsNoWrap.length&&O(t)===O(n.headsNoWrap)||n.tailsNoWrap.length&&O(t)===O(n.tailsNoWrap)){if(!n.noSingleMarkers)return t;throw new Error("json-variables/jVar(): [THROW_ID_16] Alas! While processing the input, we stumbled upon ".concat(O(t)," which is equal to ").concat(O(t)===O(n.heads)?"heads":"").concat(O(t)===O(n.tails)?"tails":"").concat(A(n.headsNoWrap)&&O(t)===O(n.headsNoWrap)?"headsNoWrap":"").concat(A(n.tailsNoWrap)&&O(t)===O(n.tailsNoWrap)?"tailsNoWrap":"",'. If you wouldn\'t have set resolvedOpts.noSingleMarkers to "true" this error would not happen and computer would have left the current element (').concat(O(t),") alone"))}return A(t)&&ae(t,n)?Pe(e,t,u.path,n):t})}return Ke(pr);})();
11
11
  /**
12
12
  * @name arrayiffy-if-string
13
13
  * @fileoverview Put non-empty strings into arrays, turn empty-ones into empty arrays. Bypass everything else.
14
- * @version 5.0.19
15
- * @author Roy Revelt, Codsen Ltd
14
+ * @version 5.0.21
15
+ * @author Roy Revelt
16
16
  * @license MIT
17
17
  * {@link https://codsen.com/os/arrayiffy-if-string/}
18
18
  */
19
19
  /**
20
20
  * @name codsen-utils
21
21
  * @fileoverview Various utility functions
22
- * @version 1.6.17
23
- * @author Roy Revelt, Codsen Ltd
22
+ * @version 1.6.19
23
+ * @author Roy Revelt
24
24
  * @license MIT
25
25
  * {@link https://codsen.com/os/codsen-utils/}
26
26
  */
27
27
  /**
28
28
  * @name string-match-left-right
29
29
  * @fileoverview Match substrings on the left or right of a given index, ignoring whitespace
30
- * @version 9.0.32
31
- * @author Roy Revelt, Codsen Ltd
30
+ * @version 9.0.34
31
+ * @author Roy Revelt
32
32
  * @license MIT
33
33
  * {@link https://codsen.com/os/string-match-left-right/}
34
34
  */
35
35
  /**
36
36
  * @name string-collapse-leading-whitespace
37
37
  * @fileoverview Collapse the leading and trailing whitespace of a string
38
- * @version 7.0.18
39
- * @author Roy Revelt, Codsen Ltd
38
+ * @version 7.0.20
39
+ * @author Roy Revelt
40
40
  * @license MIT
41
41
  * {@link https://codsen.com/os/string-collapse-leading-whitespace/}
42
42
  */
43
43
  /**
44
44
  * @name ranges-sort
45
45
  * @fileoverview Sort string index ranges
46
- * @version 6.0.23
47
- * @author Roy Revelt, Codsen Ltd
46
+ * @version 6.0.25
47
+ * @author Roy Revelt
48
48
  * @license MIT
49
49
  * {@link https://codsen.com/os/ranges-sort/}
50
50
  */
51
51
  /**
52
52
  * @name ranges-push
53
53
  * @fileoverview Gather string index ranges
54
- * @version 7.0.28
55
- * @author Roy Revelt, Codsen Ltd
54
+ * @version 7.0.30
55
+ * @author Roy Revelt
56
56
  * @license MIT
57
57
  * {@link https://codsen.com/os/ranges-push/}
58
58
  */
59
59
  /**
60
60
  * @name ranges-merge
61
61
  * @fileoverview Merge and sort string index ranges
62
- * @version 9.0.28
63
- * @author Roy Revelt, Codsen Ltd
62
+ * @version 9.0.30
63
+ * @author Roy Revelt
64
64
  * @license MIT
65
65
  * {@link https://codsen.com/os/ranges-merge/}
66
66
  */
67
67
  /**
68
68
  * @name ranges-apply
69
69
  * @fileoverview Take an array of string index ranges, delete/replace the string according to them
70
- * @version 7.0.29
71
- * @author Roy Revelt, Codsen Ltd
70
+ * @version 7.0.31
71
+ * @author Roy Revelt
72
72
  * @license MIT
73
73
  * {@link https://codsen.com/os/ranges-apply/}
74
74
  */
75
75
  /**
76
76
  * @name string-trim-spaces-only
77
77
  * @fileoverview Like String.trim() but you can choose granularly what to trim
78
- * @version 5.0.22
79
- * @author Roy Revelt, Codsen Ltd
78
+ * @version 5.0.24
79
+ * @author Roy Revelt
80
80
  * @license MIT
81
81
  * {@link https://codsen.com/os/string-trim-spaces-only/}
82
82
  */
83
83
  /**
84
84
  * @name string-remove-duplicate-heads-tails
85
85
  * @fileoverview Detect and (recursively) remove head and tail wrappings around the input string
86
- * @version 7.0.32
87
- * @author Roy Revelt, Codsen Ltd
86
+ * @version 7.0.34
87
+ * @author Roy Revelt
88
88
  * @license MIT
89
89
  * {@link https://codsen.com/os/string-remove-duplicate-heads-tails/}
90
90
  */
91
91
  /**
92
92
  * @name string-find-heads-tails
93
93
  * @fileoverview Finds where are arbitrary templating marker heads and tails located
94
- * @version 6.0.32
95
- * @author Roy Revelt, Codsen Ltd
94
+ * @version 6.0.34
95
+ * @author Roy Revelt
96
96
  * @license MIT
97
97
  * {@link https://codsen.com/os/string-find-heads-tails/}
98
98
  */
99
99
  /**
100
100
  * @name ast-monkey-util
101
101
  * @fileoverview Utility library of AST helper functions
102
- * @version 3.0.19
103
- * @author Roy Revelt, Codsen Ltd
102
+ * @version 3.0.21
103
+ * @author Roy Revelt
104
104
  * @license MIT
105
105
  * {@link https://codsen.com/os/ast-monkey-util/}
106
106
  */
107
107
  /**
108
108
  * @name ast-monkey-traverse
109
109
  * @fileoverview Utility library to traverse AST
110
- * @version 4.0.29
111
- * @author Roy Revelt, Codsen Ltd
110
+ * @version 4.0.31
111
+ * @author Roy Revelt
112
112
  * @license MIT
113
113
  * {@link https://codsen.com/os/ast-monkey-traverse/}
114
114
  */
115
115
  /**
116
116
  * @name ast-get-values-by-key
117
117
  * @fileoverview Extract values and paths from AST by keys OR set them by keys
118
- * @version 5.0.31
119
- * @author Roy Revelt, Codsen Ltd
118
+ * @version 5.0.33
119
+ * @author Roy Revelt
120
120
  * @license MIT
121
121
  * {@link https://codsen.com/os/ast-get-values-by-key/}
122
122
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "json-variables",
3
- "version": "12.0.32",
3
+ "version": "12.0.34",
4
4
  "description": "Resolves custom-marked, cross-referenced paths in parsed JSON",
5
5
  "keywords": [
6
6
  "comb",
@@ -50,7 +50,7 @@
50
50
  "examples": "node '../../ops/scripts/run-examples.js'",
51
51
  "lect": "node '../../ops/lect/lect.js' && npm run prettier -- 'README.md' '.all-contributorsrc' 'rollup.config.js' --write",
52
52
  "letspublish": "npm publish --provenance || :",
53
- "lint": "eslint . --fix",
53
+ "lint": "eslint . --fix --concurrency=auto --cache",
54
54
  "perf": "node perf/check.js",
55
55
  "prep": "echo 'ready'",
56
56
  "prettier": "prettier",
@@ -78,17 +78,17 @@
78
78
  "various": {}
79
79
  },
80
80
  "dependencies": {
81
- "arrayiffy-if-string": "^5.0.19",
82
- "ast-get-values-by-key": "^5.0.31",
83
- "ast-monkey-traverse": "^4.0.29",
84
- "codsen-utils": "^1.6.17",
81
+ "arrayiffy-if-string": "^5.0.21",
82
+ "ast-get-values-by-key": "^5.0.33",
83
+ "ast-monkey-traverse": "^4.0.31",
84
+ "codsen-utils": "^1.6.19",
85
85
  "matcher": "^6.0.0",
86
86
  "object-path": "^0.11.8",
87
- "ranges-apply": "^7.0.29",
88
- "ranges-push": "^7.0.28",
89
- "string-find-heads-tails": "^6.0.32",
90
- "string-match-left-right": "^9.0.32",
91
- "string-remove-duplicate-heads-tails": "^7.0.32"
87
+ "ranges-apply": "^7.0.31",
88
+ "ranges-push": "^7.0.30",
89
+ "string-find-heads-tails": "^6.0.34",
90
+ "string-match-left-right": "^9.0.34",
91
+ "string-remove-duplicate-heads-tails": "^7.0.34"
92
92
  },
93
93
  "publishConfig": {
94
94
  "registry": "https://registry.npmjs.org/"