json-variables 11.0.15 → 11.0.16

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/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 11.0.16 (2022-04-18)
7
+
8
+ ### Bug Fixes
9
+
10
+ - tweak types ([5da8102](https://github.com/codsen/codsen/commit/5da8102fa04b52c63b5a7a32733aaf8eace13569))
11
+
6
12
  ## 11.0.0 (2021-09-09)
7
13
 
8
14
  ### Features
@@ -1,16 +1,16 @@
1
1
  /**
2
2
  * @name json-variables
3
3
  * @fileoverview Resolves custom-marked, cross-referenced paths in parsed JSON
4
- * @version 11.0.15
4
+ * @version 11.0.16
5
5
  * @author Roy Revelt, Codsen Ltd
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/json-variables/}
8
8
  */
9
9
 
10
- import{traverse as k}from"ast-monkey-traverse";import{isMatch as x}from"matcher";import d from"object-path";import{arrayiffy as F}from"arrayiffy-if-string";import{strFindHeadsTails as I}from"string-find-heads-tails";import{getByKey as _}from"ast-get-values-by-key";import{Ranges as B}from"ranges-push";import{rApply as S}from"ranges-apply";import{remDup as L}from"string-remove-duplicate-heads-tails";import{matchLeftIncl as U,matchRightIncl as M}from"string-match-left-right";var j="11.0.15";var de=j,q=Object.prototype.hasOwnProperty,K={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 u(e){return typeof e=="string"}function G(e){return typeof e=="number"}function A(e){return typeof e=="boolean"}function D(e){return e===null}function w(e){return e&&typeof e=="object"&&!Array.isArray(e)}function z(e){return e!=null}function g(e){return u(e)?e.trim():e}function Y(e){if(typeof e=="string"&&e.length&&e.indexOf(".")!==-1){for(let r=0,t=e.length;r<t;r++)if(e[r]===".")return e.slice(0,r)}return e}function Q(e){if(typeof e=="string"&&e.length&&e.indexOf(".")!==-1){for(let r=0,t=e.length;r<t;r++)if(e[r]===".")return e.slice(r+1)}return e}function J(e){if(typeof e=="string"&&e.length&&e.indexOf(".")!==-1){for(let r=e.length;r--;)if(e[r]===".")return e.slice(0,r)}return e}function P(e){if(typeof e=="string"&&e.length&&e.indexOf(".")!==-1){for(let r=e.length;r--;)if(e[r]===".")return e.slice(r+1)}return e}function T(e,r){return typeof e!="string"||!e.trim()?!1:!!(e.includes(r.heads)||e.includes(r.tails)||u(r.headsNoWrap)&&r.headsNoWrap.length&&e.includes(r.headsNoWrap)||u(r.tailsNoWrap)&&r.tailsNoWrap.length&&e.includes(r.tailsNoWrap))}function X(e,r,t){let l,i;return typeof e=="string"&&e.length&&M(e,0,r,{trimBeforeMatching:!0,cb:(n,a,o)=>(l=o,!0)})&&U(e,e.length-1,t,{trimBeforeMatching:!0,cb:(n,a,o)=>(i=+o+1,!0)})?e.slice(l,i):e}function H(e,r,t=!1,l,i,n){if(r.wrapHeadsWith||(r.wrapHeadsWith=""),r.wrapTailsWith||(r.wrapTailsWith=""),u(e)&&!t&&r.wrapGlobalFlipSwitch&&!r.dontWrapVars.some(a=>x(n,a))&&(!r.preventDoubleWrapping||r.preventDoubleWrapping&&u(e)&&!e.includes(r.wrapHeadsWith)&&!e.includes(r.wrapTailsWith)))return`${r.wrapHeadsWith}${e}${r.wrapTailsWith}`;if(t){if(!u(e))return e;let a=L(e,{heads:r.wrapHeadsWith,tails:r.wrapTailsWith});return u(a)?X(a,r.wrapHeadsWith,r.wrapTailsWith):a}return e}function Z(e,r,t,l){let i;if(t.indexOf(".")!==-1){let n=t,a=!0;if(l.lookForDataContainers&&typeof l.dataContainerIdentifierTails=="string"&&l.dataContainerIdentifierTails.length&&!n.endsWith(l.dataContainerIdentifierTails)){let o=d.get(e,n+l.dataContainerIdentifierTails);w(o)&&d.get(o,r)&&(i=d.get(o,r),a=!1)}for(;a&&n.indexOf(".")!==-1;){if(n=J(n),P(n)===r)throw new Error(`json-variables/findValues(): [THROW_ID_20] While trying to resolve: "${r}" at path "${t}", we encountered a closed loop. The parent key "${P(n)}" is called the same as the variable "${r}" we're looking for.`);if(l.lookForDataContainers&&typeof l.dataContainerIdentifierTails=="string"&&l.dataContainerIdentifierTails.length&&!n.endsWith(l.dataContainerIdentifierTails)){let o=d.get(e,n+l.dataContainerIdentifierTails);w(o)&&d.get(o,r)&&(i=d.get(o,r),a=!1)}if(i===void 0){let o=d.get(e,n);w(o)&&d.get(o,r)&&(i=d.get(o,r),a=!1)}}}if(i===void 0){let n=d.get(e,r);n!==void 0&&(i=n)}if(i===void 0)if(r.indexOf(".")===-1){let n=_(e,r);if(n.length){for(let a=0,o=n.length;a<o;a++)if(u(n[a].val)||A(n[a].val)||D(n[a].val)){i=n[a].val;break}else if(G(n[a].val)){i=String(n[a].val);break}else if(Array.isArray(n[a].val)){i=n[a].val.join("");break}}}else{let n=_(e,Y(r));if(n.length)for(let a=0,o=n.length;a<o;a++){let y=d.get(n[a].val,Q(r));y&&u(y)&&(i=y)}}return i}function R(e,r,t,l,i=[]){if(i.includes(t)){let c="";if(i.length>1){let m=` \u2192
11
- `;c=i.reduce((E,b,O)=>E+(O===0?"":m)+(b===t?"\u{1F4A5} ":" ")+b,` Here's the path we travelled up until we hit the recursion:
10
+ import{traverse as k}from"ast-monkey-traverse";import{isMatch as x}from"matcher";import h from"object-path";import{arrayiffy as F}from"arrayiffy-if-string";import{strFindHeadsTails as I}from"string-find-heads-tails";import{getByKey as _}from"ast-get-values-by-key";import{Ranges as B}from"ranges-push";import{rApply as A}from"ranges-apply";import{remDup as L}from"string-remove-duplicate-heads-tails";import{matchLeftIncl as U,matchRightIncl as M}from"string-match-left-right";var j="11.0.16";var he=j,q=Object.prototype.hasOwnProperty,K={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 u(e){return typeof e=="string"}function G(e){return typeof e=="number"}function O(e){return typeof e=="boolean"}function N(e){return e===null}function w(e){return e&&typeof e=="object"&&!Array.isArray(e)}function z(e){return e!=null}function g(e){return u(e)?e.trim():e}function Y(e){if(typeof e=="string"&&e.length&&e.indexOf(".")!==-1){for(let r=0,t=e.length;r<t;r++)if(e[r]===".")return e.slice(0,r)}return e}function Q(e){if(typeof e=="string"&&e.length&&e.indexOf(".")!==-1){for(let r=0,t=e.length;r<t;r++)if(e[r]===".")return e.slice(r+1)}return e}function J(e){if(typeof e=="string"&&e.length&&e.indexOf(".")!==-1){for(let r=e.length;r--;)if(e[r]===".")return e.slice(0,r)}return e}function P(e){if(typeof e=="string"&&e.length&&e.indexOf(".")!==-1){for(let r=e.length;r--;)if(e[r]===".")return e.slice(r+1)}return e}function T(e,r){return typeof e!="string"||!e.trim()?!1:!!(e.includes(r.heads)||e.includes(r.tails)||u(r.headsNoWrap)&&r.headsNoWrap.length&&e.includes(r.headsNoWrap)||u(r.tailsNoWrap)&&r.tailsNoWrap.length&&e.includes(r.tailsNoWrap))}function X(e,r,t){let o,i;return typeof e=="string"&&e.length&&M(e,0,r,{trimBeforeMatching:!0,cb:(n,a,l)=>(o=l,!0)})&&U(e,e.length-1,t,{trimBeforeMatching:!0,cb:(n,a,l)=>(i=+l+1,!0)})?e.slice(o,i):e}function H(e,r,t=!1,o,i,n){if(r.wrapHeadsWith||(r.wrapHeadsWith=""),r.wrapTailsWith||(r.wrapTailsWith=""),u(e)&&!t&&r.wrapGlobalFlipSwitch&&!r.dontWrapVars.some(a=>x(n,a))&&(!r.preventDoubleWrapping||r.preventDoubleWrapping&&u(e)&&!e.includes(r.wrapHeadsWith)&&!e.includes(r.wrapTailsWith)))return`${r.wrapHeadsWith}${e}${r.wrapTailsWith}`;if(t){if(!u(e))return e;let a=L(e,{heads:r.wrapHeadsWith,tails:r.wrapTailsWith});return u(a)?X(a,r.wrapHeadsWith,r.wrapTailsWith):a}return e}function Z(e,r,t,o){let i;if(t.indexOf(".")!==-1){let n=t,a=!0;if(o.lookForDataContainers&&typeof o.dataContainerIdentifierTails=="string"&&o.dataContainerIdentifierTails.length&&!n.endsWith(o.dataContainerIdentifierTails)){let l=h.get(e,n+o.dataContainerIdentifierTails);w(l)&&h.get(l,r)&&(i=h.get(l,r),a=!1)}for(;a&&n.indexOf(".")!==-1;){if(n=J(n),P(n)===r)throw new Error(`json-variables/findValues(): [THROW_ID_20] While trying to resolve: "${r}" at path "${t}", we encountered a closed loop. The parent key "${P(n)}" is called the same as the variable "${r}" we're looking for.`);if(o.lookForDataContainers&&typeof o.dataContainerIdentifierTails=="string"&&o.dataContainerIdentifierTails.length&&!n.endsWith(o.dataContainerIdentifierTails)){let l=h.get(e,n+o.dataContainerIdentifierTails);w(l)&&h.get(l,r)&&(i=h.get(l,r),a=!1)}if(i===void 0){let l=h.get(e,n);w(l)&&h.get(l,r)&&(i=h.get(l,r),a=!1)}}}if(i===void 0){let n=h.get(e,r);n!==void 0&&(i=n)}if(i===void 0)if(r.indexOf(".")===-1){let n=_(e,r);if(n.length){for(let a=0,l=n.length;a<l;a++)if(u(n[a].val)||O(n[a].val)||N(n[a].val)){i=n[a].val;break}else if(G(n[a].val)){i=String(n[a].val);break}else if(Array.isArray(n[a].val)){i=n[a].val.join("");break}}}else{let n=_(e,Y(r));if(n.length)for(let a=0,l=n.length;a<l;a++){let y=h.get(n[a].val,Q(r));y&&u(y)&&(i=y)}}return i}function R(e,r,t,o,i=[]){if(i.includes(t)){let c="";if(i.length>1){let m=` \u2192
11
+ `;c=i.reduce((D,b,S)=>D+(S===0?"":m)+(b===t?"\u{1F4A5} ":" ")+b,` Here's the path we travelled up until we hit the recursion:
12
12
 
13
- `),c+=`${m}\u{1F4A5} ${t}`}throw new Error(`json-variables/resolveString(): [THROW_ID_19] While trying to resolve: "${r}" at path "${t}", we encountered a closed loop, the key is referencing itself."${c}`)}let n={},a=Array.from(i);a.push(t);let o=new B;function y(c,m,E){for(let b=0,O=c.length;b<O;b++){let f=c[b],p=r.slice(f.headsEndAt,f.tailsStartAt);if(p.length===0)o.push(f.headsStartAt,f.tailsEndAt);else if(q.call(n,p)&&u(n[p]))o.push(f.headsStartAt,f.tailsEndAt,n[p]);else{let s=Z(e,p.trim(),t,l);if(s===void 0)if(l.allowUnresolved===!0)s="";else if(typeof l.allowUnresolved=="string")s=l.allowUnresolved;else throw new Error(`json-variables/processHeadsAndTails(): [THROW_ID_18] We couldn't find the value to resolve the variable ${r.slice(f.headsEndAt,f.tailsStartAt)}. We're at path: "${t}".`);if(!E&&l.throwWhenNonStringInsertedInString&&!u(s))throw new Error(`json-variables/processHeadsAndTails(): [THROW_ID_23] While resolving the variable ${r.slice(f.headsEndAt,f.tailsStartAt)} at path ${t}, it resolved into a non-string value, ${JSON.stringify(s,null,4)}. This is happening because options setting "throwWhenNonStringInsertedInString" is active (set to "true").`);if(A(s)){if(l.resolveToBoolIfAnyValuesContainBool)return o.wipe(),l.resolveToFalseIfAnyValuesContainBool?!1:s;s=""}else{if(D(s)&&E)return o.wipe(),s;Array.isArray(s)?s=String(s.join("")):D(s)?s="":s=String(s)}let N=t.includes(".")?`${J(t)}.${p}`:p;if(T(s,l)){let V=H(R(e,s,N,l,a),l,m,a,N,p.trim());typeof V=="string"&&o.push(f.headsStartAt,f.tailsEndAt,V)}else{n[p]=s;let V=H(s,l,m,a,N,p.trim());typeof V=="string"&&o.push(f.headsStartAt,f.tailsEndAt,V)}}}}let h;try{h=I(r,l.heads,l.tails,{source:"",throwWhenSomethingWrongIsDetected:!1})}catch(c){throw new Error(`json-variables/resolveString(): [THROW_ID_17] While trying to resolve string: "${r}" at path ${t}, something wrong with heads and tails was detected! Here's the internal error message:
14
- ${c}`)}let W=!1;h.length===1&&S(r,[[h[0].headsStartAt,h[0].tailsEndAt]]).trim()===""&&(W=!0);let $=y(h,!1,W);if(typeof $=="boolean"||$===null)return $;try{h=I(r,l.headsNoWrap,l.tailsNoWrap,{source:"",throwWhenSomethingWrongIsDetected:!1})}catch(c){throw new Error(`json-variables/resolveString(): [THROW_ID_22] While trying to resolve string: "${r}" at path ${t}, something wrong with no-wrap heads and no-wrap tails was detected! Here's the internal error message:
15
- ${c}`)}h.length===1&&S(r,[[h[0].headsStartAt,h[0].tailsEndAt]]).trim()===""&&(W=!0);let v=y(h,!0,W);return A(v)||D(v)?v:o?.current()?S(r,o.current()):r}function he(e,r){if(!arguments.length)throw new Error("json-variables/jVar(): [THROW_ID_01] Alas! Inputs are missing!");if(!w(e))throw new TypeError(`json-variables/jVar(): [THROW_ID_02] Alas! The input must be a plain object! Currently it's: ${Array.isArray(e)?"array":typeof e}`);if(r&&!w(r))throw new TypeError(`json-variables/jVar(): [THROW_ID_03] Alas! An Optional Options Object must be a plain object! Currently it's: ${Array.isArray(r)?"array":typeof r}`);let t={...K,...r};t.dontWrapVars?Array.isArray(t.dontWrapVars)||(t.dontWrapVars=F(t.dontWrapVars)):t.dontWrapVars=[];let l,i;if(t.dontWrapVars.length&&!t.dontWrapVars.every((a,o)=>u(a)?!0:(l=a,i=o,!1)))throw new Error(`json-variables/jVar(): [THROW_ID_05] Alas! All variable names set in opts.dontWrapVars should be of a string type. Computer detected a value "${l}" at index ${i}, which is not string but ${Array.isArray(l)?"array":typeof l}!`);if(t.heads==="")throw new Error("json-variables/jVar(): [THROW_ID_06] Alas! opts.heads are empty!");if(t.tails==="")throw new Error("json-variables/jVar(): [THROW_ID_07] Alas! opts.tails are empty!");if(t.lookForDataContainers&&t.dataContainerIdentifierTails==="")throw new Error("json-variables/jVar(): [THROW_ID_08] Alas! opts.dataContainerIdentifierTails is empty!");if(t.heads===t.tails)throw new Error("json-variables/jVar(): [THROW_ID_09] Alas! opts.heads and opts.tails can't be equal!");if(t.heads===t.headsNoWrap)throw new Error("json-variables/jVar(): [THROW_ID_10] Alas! opts.heads and opts.headsNoWrap can't be equal!");if(t.tails===t.tailsNoWrap)throw new Error("json-variables/jVar(): [THROW_ID_11] Alas! opts.tails and opts.tailsNoWrap can't be equal!");if(t.headsNoWrap==="")throw new Error("json-variables/jVar(): [THROW_ID_12] Alas! opts.headsNoWrap is an empty string!");if(t.tailsNoWrap==="")throw new Error("json-variables/jVar(): [THROW_ID_13] Alas! opts.tailsNoWrap is an empty string!");if(t.headsNoWrap===t.tailsNoWrap)throw new Error("json-variables/jVar(): [THROW_ID_14] Alas! opts.headsNoWrap and opts.tailsNoWrap can't be equal!");let n;return k(e,(a,o,y)=>{if(z(o)&&T(a,t))throw new Error(`json-variables/jVar(): [THROW_ID_15] Alas! Object keys can't contain variables!
16
- Please check the following key: ${a}`);if(o!==void 0?n=o:n=a,n==="")return n;if(t.heads.length!==0&&g(n)===g(t.heads)||t.tails.length!==0&&g(n)===g(t.tails)||t.headsNoWrap.length!==0&&g(n)===g(t.headsNoWrap)||t.tailsNoWrap.length!==0&&g(n)===g(t.tailsNoWrap)){if(!t.noSingleMarkers)return n;throw new Error(`json-variables/jVar(): [THROW_ID_16] Alas! While processing the input, we stumbled upon ${g(n)} which is equal to ${g(n)===g(t.heads)?"heads":""}${g(n)===g(t.tails)?"tails":""}${u(t.headsNoWrap)&&g(n)===g(t.headsNoWrap)?"headsNoWrap":""}${u(t.tailsNoWrap)&&g(n)===g(t.tailsNoWrap)?"tailsNoWrap":""}. If you wouldn't have set opts.noSingleMarkers to "true" this error would not happen and computer would have left the current element (${g(n)}) alone`)}return u(n)&&T(n,t)?R(e,n,y.path,t):n})}export{K as defaults,he as jVar,de as version};
13
+ `),c+=`${m}\u{1F4A5} ${t}`}throw new Error(`json-variables/resolveString(): [THROW_ID_19] While trying to resolve: "${r}" at path "${t}", we encountered a closed loop, the key is referencing itself."${c}`)}let n={},a=Array.from(i);a.push(t);let l=new B;function y(c,m,D){for(let b=0,S=c.length;b<S;b++){let f=c[b],p=r.slice(f.headsEndAt,f.tailsStartAt);if(p.length===0)l.push(f.headsStartAt,f.tailsEndAt);else if(q.call(n,p)&&u(n[p]))l.push(f.headsStartAt,f.tailsEndAt,n[p]);else{let s=Z(e,p.trim(),t,o);if(s===void 0)if(o.allowUnresolved===!0)s="";else if(typeof o.allowUnresolved=="string")s=o.allowUnresolved;else throw new Error(`json-variables/processHeadsAndTails(): [THROW_ID_18] We couldn't find the value to resolve the variable ${r.slice(f.headsEndAt,f.tailsStartAt)}. We're at path: "${t}".`);if(!D&&o.throwWhenNonStringInsertedInString&&!u(s))throw new Error(`json-variables/processHeadsAndTails(): [THROW_ID_23] While resolving the variable ${r.slice(f.headsEndAt,f.tailsStartAt)} at path ${t}, it resolved into a non-string value, ${JSON.stringify(s,null,4)}. This is happening because options setting "throwWhenNonStringInsertedInString" is active (set to "true").`);if(O(s)){if(o.resolveToBoolIfAnyValuesContainBool)return l.wipe(),o.resolveToFalseIfAnyValuesContainBool?!1:s;s=""}else{if(N(s)&&D)return l.wipe(),s;Array.isArray(s)?s=String(s.join("")):N(s)?s="":s=String(s)}let v=t.includes(".")?`${J(t)}.${p}`:p;if(T(s,o)){let V=H(R(e,s,v,o,a),o,m,a,v,p.trim());typeof V=="string"&&l.push(f.headsStartAt,f.tailsEndAt,V)}else{n[p]=s;let V=H(s,o,m,a,v,p.trim());typeof V=="string"&&l.push(f.headsStartAt,f.tailsEndAt,V)}}}}let d;try{d=I(r,o.heads,o.tails,{source:"",throwWhenSomethingWrongIsDetected:!1})}catch(c){throw new Error(`json-variables/resolveString(): [THROW_ID_17] While trying to resolve string: "${r}" at path ${t}, something wrong with heads and tails was detected! Here's the internal error message:
14
+ ${c}`)}let W=!1;d.length===1&&A(r,[[d[0].headsStartAt,d[0].tailsEndAt]]).trim()===""&&(W=!0);let $=y(d,!1,W);if(typeof $=="boolean"||$===null)return $;try{d=I(r,o.headsNoWrap,o.tailsNoWrap,{source:"",throwWhenSomethingWrongIsDetected:!1})}catch(c){throw new Error(`json-variables/resolveString(): [THROW_ID_22] While trying to resolve string: "${r}" at path ${t}, something wrong with no-wrap heads and no-wrap tails was detected! Here's the internal error message:
15
+ ${c}`)}d.length===1&&A(r,[[d[0].headsStartAt,d[0].tailsEndAt]]).trim()===""&&(W=!0);let E=y(d,!0,W);return O(E)||N(E)?E:l?.current()?A(r,l.current()):r}function de(e,r){if(!arguments.length)throw new Error("json-variables/jVar(): [THROW_ID_01] Alas! Inputs are missing!");if(!w(e))throw new TypeError(`json-variables/jVar(): [THROW_ID_02] Alas! The input must be a plain object! Currently it's: ${Array.isArray(e)?"array":typeof e}`);if(r&&!w(r))throw new TypeError(`json-variables/jVar(): [THROW_ID_03] Alas! An Optional Options Object must be a plain object! Currently it's: ${Array.isArray(r)?"array":typeof r}`);let t={...K,...r};t.dontWrapVars?Array.isArray(t.dontWrapVars)||(t.dontWrapVars=F(t.dontWrapVars)):t.dontWrapVars=[];let o,i;if(t.dontWrapVars.length&&!t.dontWrapVars.every((a,l)=>u(a)?!0:(o=a,i=l,!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 "${o}" at index ${i}, which is not string but ${Array.isArray(o)?"array":typeof o}!`);if(t.heads==="")throw new Error("json-variables/jVar(): [THROW_ID_06] Alas! resolvedOpts.heads are empty!");if(t.tails==="")throw new Error("json-variables/jVar(): [THROW_ID_07] Alas! resolvedOpts.tails are empty!");if(t.lookForDataContainers&&t.dataContainerIdentifierTails==="")throw new Error("json-variables/jVar(): [THROW_ID_08] Alas! resolvedOpts.dataContainerIdentifierTails is empty!");if(t.heads===t.tails)throw new Error("json-variables/jVar(): [THROW_ID_09] Alas! resolvedOpts.heads and resolvedOpts.tails can't be equal!");if(t.heads===t.headsNoWrap)throw new Error("json-variables/jVar(): [THROW_ID_10] Alas! resolvedOpts.heads and resolvedOpts.headsNoWrap can't be equal!");if(t.tails===t.tailsNoWrap)throw new Error("json-variables/jVar(): [THROW_ID_11] Alas! resolvedOpts.tails and resolvedOpts.tailsNoWrap can't be equal!");if(t.headsNoWrap==="")throw new Error("json-variables/jVar(): [THROW_ID_12] Alas! resolvedOpts.headsNoWrap is an empty string!");if(t.tailsNoWrap==="")throw new Error("json-variables/jVar(): [THROW_ID_13] Alas! resolvedOpts.tailsNoWrap is an empty string!");if(t.headsNoWrap===t.tailsNoWrap)throw new Error("json-variables/jVar(): [THROW_ID_14] Alas! resolvedOpts.headsNoWrap and resolvedOpts.tailsNoWrap can't be equal!");let n;return k(e,(a,l,y)=>{if(z(l)&&T(a,t))throw new Error(`json-variables/jVar(): [THROW_ID_15] Alas! Object keys can't contain variables!
16
+ Please check the following key: ${a}`);if(l!==void 0?n=l:n=a,n==="")return n;if(t.heads.length&&g(n)===g(t.heads)||t.tails.length&&g(n)===g(t.tails)||t.headsNoWrap.length&&g(n)===g(t.headsNoWrap)||t.tailsNoWrap.length&&g(n)===g(t.tailsNoWrap)){if(!t.noSingleMarkers)return n;throw new Error(`json-variables/jVar(): [THROW_ID_16] Alas! While processing the input, we stumbled upon ${g(n)} which is equal to ${g(n)===g(t.heads)?"heads":""}${g(n)===g(t.tails)?"tails":""}${u(t.headsNoWrap)&&g(n)===g(t.headsNoWrap)?"headsNoWrap":""}${u(t.tailsNoWrap)&&g(n)===g(t.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 (${g(n)}) alone`)}return u(n)&&T(n,t)?R(e,n,y.path,t):n})}export{K as defaults,de as jVar,he as version};
@@ -1,16 +1,16 @@
1
1
  /**
2
2
  * @name json-variables
3
3
  * @fileoverview Resolves custom-marked, cross-referenced paths in parsed JSON
4
- * @version 11.0.15
4
+ * @version 11.0.16
5
5
  * @author Roy Revelt, Codsen Ltd
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/json-variables/}
8
8
  */
9
9
 
10
- var jsonVariables=(()=>{var ar=Object.create;var q=Object.defineProperty,or=Object.defineProperties,lr=Object.getOwnPropertyDescriptor,fr=Object.getOwnPropertyDescriptors,ur=Object.getOwnPropertyNames,Ke=Object.getOwnPropertySymbols,gr=Object.getPrototypeOf,Ue=Object.prototype.hasOwnProperty,cr=Object.prototype.propertyIsEnumerable;var me=(e,t,r)=>t in e?q(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$=(e,t)=>{for(var r in t||(t={}))Ue.call(t,r)&&me(e,r,t[r]);if(Ke)for(var r of Ke(t))cr.call(t,r)&&me(e,r,t[r]);return e},K=(e,t)=>or(e,fr(t));var we=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),hr=(e,t)=>{for(var r in t)q(e,r,{get:t[r],enumerable:!0})},Ge=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ur(t))!Ue.call(e,o)&&o!==r&&q(e,o,{get:()=>t[o],enumerable:!(i=lr(t,o))||i.enumerable});return e};var U=(e,t,r)=>(r=e!=null?ar(gr(e)):{},Ge(t||!e||!e.__esModule?q(r,"default",{value:e,enumerable:!0}):r,e)),pr=e=>Ge(q({},"__esModule",{value:!0}),e);var be=(e,t,r)=>(me(e,typeof t!="symbol"?t+"":t,r),r);var Ce=we((G,P)=>{var dr=200,at="__lodash_hash_undefined__",ot=9007199254740991,Ee="[object Arguments]",yr="[object Array]",lt="[object Boolean]",ft="[object Date]",mr="[object Error]",Se="[object Function]",ut="[object GeneratorFunction]",te="[object Map]",gt="[object Number]",We="[object Object]",ze="[object Promise]",ct="[object RegExp]",re="[object Set]",ht="[object String]",pt="[object Symbol]",$e="[object WeakMap]",dt="[object ArrayBuffer]",ne="[object DataView]",yt="[object Float32Array]",mt="[object Float64Array]",wt="[object Int8Array]",bt="[object Int16Array]",Tt="[object Int32Array]",$t="[object Uint8Array]",vt="[object Uint8ClampedArray]",Ot="[object Uint16Array]",_t="[object Uint32Array]",wr=/[\\^$.*+?()[\]{}|]/g,br=/\w*$/,Tr=/^\[object .+?Constructor\]$/,$r=/^(?:0|[1-9]\d*)$/,v={};v[Ee]=v[yr]=v[dt]=v[ne]=v[lt]=v[ft]=v[yt]=v[mt]=v[wt]=v[bt]=v[Tt]=v[te]=v[gt]=v[We]=v[ct]=v[re]=v[ht]=v[pt]=v[$t]=v[vt]=v[Ot]=v[_t]=!0;v[mr]=v[Se]=v[$e]=!1;var vr=typeof global=="object"&&global&&global.Object===Object&&global,Or=typeof self=="object"&&self&&self.Object===Object&&self,N=vr||Or||Function("return this")(),At=typeof G=="object"&&G&&!G.nodeType&&G,Ye=At&&typeof P=="object"&&P&&!P.nodeType&&P,_r=Ye&&Ye.exports===At;function Ar(e,t){return e.set(t[0],t[1]),e}function Ir(e,t){return e.add(t),e}function Er(e,t){for(var r=-1,i=e?e.length:0;++r<i&&t(e[r],r,e)!==!1;);return e}function Sr(e,t){for(var r=-1,i=t.length,o=e.length;++r<i;)e[o+r]=t[r];return e}function It(e,t,r,i){var o=-1,n=e?e.length:0;for(i&&n&&(r=e[++o]);++o<n;)r=t(r,e[o],o,e);return r}function Wr(e,t){for(var r=-1,i=Array(e);++r<e;)i[r]=t(r);return i}function Dr(e,t){return e==null?void 0:e[t]}function Et(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(r){}return t}function Xe(e){var t=-1,r=Array(e.size);return e.forEach(function(i,o){r[++t]=[o,i]}),r}function De(e,t){return function(r){return e(t(r))}}function Ze(e){var t=-1,r=Array(e.size);return e.forEach(function(i){r[++t]=i}),r}var Nr=Array.prototype,xr=Function.prototype,ie=Object.prototype,Te=N["__core-js_shared__"],Qe=function(){var e=/[^.]+$/.exec(Te&&Te.keys&&Te.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),St=xr.toString,R=ie.hasOwnProperty,se=ie.toString,Rr=RegExp("^"+St.call(R).replace(wr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),et=_r?N.Buffer:void 0,tt=N.Symbol,rt=N.Uint8Array,Cr=De(Object.getPrototypeOf,Object),Vr=Object.create,jr=ie.propertyIsEnumerable,Hr=Nr.splice,nt=Object.getOwnPropertySymbols,Mr=et?et.isBuffer:void 0,Pr=De(Object.keys,Object),ve=F(N,"DataView"),z=F(N,"Map"),Oe=F(N,"Promise"),_e=F(N,"Set"),Ae=F(N,"WeakMap"),Y=F(Object,"create"),Jr=M(ve),Br=M(z),Fr=M(Oe),kr=M(_e),Lr=M(Ae),it=tt?tt.prototype:void 0,st=it?it.valueOf:void 0;function H(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function qr(){this.__data__=Y?Y(null):{}}function Kr(e){return this.has(e)&&delete this.__data__[e]}function Ur(e){var t=this.__data__;if(Y){var r=t[e];return r===at?void 0:r}return R.call(t,e)?t[e]:void 0}function Gr(e){var t=this.__data__;return Y?t[e]!==void 0:R.call(t,e)}function zr(e,t){var r=this.__data__;return r[e]=Y&&t===void 0?at:t,this}H.prototype.clear=qr;H.prototype.delete=Kr;H.prototype.get=Ur;H.prototype.has=Gr;H.prototype.set=zr;function x(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function Yr(){this.__data__=[]}function Xr(e){var t=this.__data__,r=ae(t,e);if(r<0)return!1;var i=t.length-1;return r==i?t.pop():Hr.call(t,r,1),!0}function Zr(e){var t=this.__data__,r=ae(t,e);return r<0?void 0:t[r][1]}function Qr(e){return ae(this.__data__,e)>-1}function en(e,t){var r=this.__data__,i=ae(r,e);return i<0?r.push([e,t]):r[i][1]=t,this}x.prototype.clear=Yr;x.prototype.delete=Xr;x.prototype.get=Zr;x.prototype.has=Qr;x.prototype.set=en;function J(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function tn(){this.__data__={hash:new H,map:new(z||x),string:new H}}function rn(e){return oe(this,e).delete(e)}function nn(e){return oe(this,e).get(e)}function sn(e){return oe(this,e).has(e)}function an(e,t){return oe(this,e).set(e,t),this}J.prototype.clear=tn;J.prototype.delete=rn;J.prototype.get=nn;J.prototype.has=sn;J.prototype.set=an;function B(e){this.__data__=new x(e)}function on(){this.__data__=new x}function ln(e){return this.__data__.delete(e)}function fn(e){return this.__data__.get(e)}function un(e){return this.__data__.has(e)}function gn(e,t){var r=this.__data__;if(r instanceof x){var i=r.__data__;if(!z||i.length<dr-1)return i.push([e,t]),this;r=this.__data__=new J(i)}return r.set(e,t),this}B.prototype.clear=on;B.prototype.delete=ln;B.prototype.get=fn;B.prototype.has=un;B.prototype.set=gn;function cn(e,t){var r=xe(e)||jn(e)?Wr(e.length,String):[],i=r.length,o=!!i;for(var n in e)(t||R.call(e,n))&&!(o&&(n=="length"||xn(n,i)))&&r.push(n);return r}function Wt(e,t,r){var i=e[t];(!(R.call(e,t)&&Rt(i,r))||r===void 0&&!(t in e))&&(e[t]=r)}function ae(e,t){for(var r=e.length;r--;)if(Rt(e[r][0],t))return r;return-1}function hn(e,t){return e&&Dt(t,Re(t),e)}function Ie(e,t,r,i,o,n,l){var s;if(i&&(s=n?i(e,o,n,l):i(e)),s!==void 0)return s;if(!le(e))return e;var h=xe(e);if(h){if(s=Wn(e),!t)return In(e,s)}else{var a=j(e),g=a==Se||a==ut;if(Mn(e))return bn(e,t);if(a==We||a==Ee||g&&!n){if(Et(e))return n?e:{};if(s=Dn(g?{}:e),!t)return En(e,hn(s,e))}else{if(!v[a])return n?e:{};s=Nn(e,a,Ie,t)}}l||(l=new B);var c=l.get(e);if(c)return c;if(l.set(e,s),!h)var T=r?Sn(e):Re(e);return Er(T||e,function(m,u){T&&(u=m,m=e[u]),Wt(s,u,Ie(m,t,r,i,u,e,l))}),s}function pn(e){return le(e)?Vr(e):{}}function dn(e,t,r){var i=t(e);return xe(e)?i:Sr(i,r(e))}function yn(e){return se.call(e)}function mn(e){if(!le(e)||Cn(e))return!1;var t=Vt(e)||Et(e)?Rr:Tr;return t.test(M(e))}function wn(e){if(!xt(e))return Pr(e);var t=[];for(var r in Object(e))R.call(e,r)&&r!="constructor"&&t.push(r);return t}function bn(e,t){if(t)return e.slice();var r=new e.constructor(e.length);return e.copy(r),r}function Ne(e){var t=new e.constructor(e.byteLength);return new rt(t).set(new rt(e)),t}function Tn(e,t){var r=t?Ne(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}function $n(e,t,r){var i=t?r(Xe(e),!0):Xe(e);return It(i,Ar,new e.constructor)}function vn(e){var t=new e.constructor(e.source,br.exec(e));return t.lastIndex=e.lastIndex,t}function On(e,t,r){var i=t?r(Ze(e),!0):Ze(e);return It(i,Ir,new e.constructor)}function _n(e){return st?Object(st.call(e)):{}}function An(e,t){var r=t?Ne(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function In(e,t){var r=-1,i=e.length;for(t||(t=Array(i));++r<i;)t[r]=e[r];return t}function Dt(e,t,r,i){r||(r={});for(var o=-1,n=t.length;++o<n;){var l=t[o],s=i?i(r[l],e[l],l,r,e):void 0;Wt(r,l,s===void 0?e[l]:s)}return r}function En(e,t){return Dt(e,Nt(e),t)}function Sn(e){return dn(e,Re,Nt)}function oe(e,t){var r=e.__data__;return Rn(t)?r[typeof t=="string"?"string":"hash"]:r.map}function F(e,t){var r=Dr(e,t);return mn(r)?r:void 0}var Nt=nt?De(nt,Object):Bn,j=yn;(ve&&j(new ve(new ArrayBuffer(1)))!=ne||z&&j(new z)!=te||Oe&&j(Oe.resolve())!=ze||_e&&j(new _e)!=re||Ae&&j(new Ae)!=$e)&&(j=function(e){var t=se.call(e),r=t==We?e.constructor:void 0,i=r?M(r):void 0;if(i)switch(i){case Jr:return ne;case Br:return te;case Fr:return ze;case kr:return re;case Lr:return $e}return t});function Wn(e){var t=e.length,r=e.constructor(t);return t&&typeof e[0]=="string"&&R.call(e,"index")&&(r.index=e.index,r.input=e.input),r}function Dn(e){return typeof e.constructor=="function"&&!xt(e)?pn(Cr(e)):{}}function Nn(e,t,r,i){var o=e.constructor;switch(t){case dt:return Ne(e);case lt:case ft:return new o(+e);case ne:return Tn(e,i);case yt:case mt:case wt:case bt:case Tt:case $t:case vt:case Ot:case _t:return An(e,i);case te:return $n(e,i,r);case gt:case ht:return new o(e);case ct:return vn(e);case re:return On(e,i,r);case pt:return _n(e)}}function xn(e,t){return t=t==null?ot:t,!!t&&(typeof e=="number"||$r.test(e))&&e>-1&&e%1==0&&e<t}function Rn(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Cn(e){return!!Qe&&Qe in e}function xt(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||ie;return e===r}function M(e){if(e!=null){try{return St.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function Vn(e){return Ie(e,!0,!0)}function Rt(e,t){return e===t||e!==e&&t!==t}function jn(e){return Hn(e)&&R.call(e,"callee")&&(!jr.call(e,"callee")||se.call(e)==Ee)}var xe=Array.isArray;function Ct(e){return e!=null&&Pn(e.length)&&!Vt(e)}function Hn(e){return Jn(e)&&Ct(e)}var Mn=Mr||Fn;function Vt(e){var t=le(e)?se.call(e):"";return t==Se||t==ut}function Pn(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ot}function le(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Jn(e){return!!e&&typeof e=="object"}function Re(e){return Ct(e)?cn(e):wn(e)}function Bn(){return[]}function Fn(){return!1}P.exports=Vn});var Ve=we((_i,Mt)=>{var kn="[object Object]";function Ln(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(r){}return t}function qn(e,t){return function(r){return e(t(r))}}var Kn=Function.prototype,jt=Object.prototype,Ht=Kn.toString,Un=jt.hasOwnProperty,Gn=Ht.call(Object),zn=jt.toString,Yn=qn(Object.getPrototypeOf,Object);function Xn(e){return!!e&&typeof e=="object"}function Zn(e){if(!Xn(e)||zn.call(e)!=kn||Ln(e))return!1;var t=Yn(e);if(t===null)return!0;var r=Un.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Ht.call(r)==Gn}Mt.exports=Zn});var Ft=we((Bt,ce)=>{(function(e,t){"use strict";typeof ce=="object"&&typeof ce.exports=="object"?ce.exports=t():typeof define=="function"&&define.amd?define([],t):e.objectPath=t()})(Bt,function(){"use strict";var e=Object.prototype.toString;function t(g,c){return g==null?!1:Object.prototype.hasOwnProperty.call(g,c)}function r(g){if(!g||n(g)&&g.length===0)return!0;if(typeof g!="string"){for(var c in g)if(t(g,c))return!1;return!0}return!1}function i(g){return e.call(g)}function o(g){return typeof g=="object"&&i(g)==="[object Object]"}var n=Array.isArray||function(g){return e.call(g)==="[object Array]"};function l(g){return typeof g=="boolean"||i(g)==="[object Boolean]"}function s(g){var c=parseInt(g);return c.toString()===g?c:g}function h(g){g=g||{};var c=function(d){return Object.keys(c).reduce(function(f,p){return p==="create"||typeof c[p]=="function"&&(f[p]=c[p].bind(c,d)),f},{})},T;g.includeInheritedProps?T=function(){return!0}:T=function(d,f){return typeof f=="number"&&Array.isArray(d)||t(d,f)};function m(d,f){if(T(d,f))return d[f]}var u;g.includeInheritedProps?u=function(d,f){typeof f!="string"&&typeof f!="number"&&(f=String(f));var p=m(d,f);if(f==="__proto__"||f==="prototype"||f==="constructor"&&typeof p=="function")throw new Error("For security reasons, object's magic properties cannot be set");return p}:u=function(d,f){return m(d,f)};function y(d,f,p,w){if(typeof f=="number"&&(f=[f]),!f||f.length===0)return d;if(typeof f=="string")return y(d,f.split(".").map(s),p,w);var b=f[0],O=u(d,b);return f.length===1?((O===void 0||!w)&&(d[b]=p),O):(O===void 0&&(typeof f[1]=="number"?d[b]=[]:d[b]={}),y(d[b],f.slice(1),p,w))}return c.has=function(d,f){if(typeof f=="number"?f=[f]:typeof f=="string"&&(f=f.split(".")),!f||f.length===0)return!!d;for(var p=0;p<f.length;p++){var w=s(f[p]);if(typeof w=="number"&&n(d)&&w<d.length||(g.includeInheritedProps?w in Object(d):t(d,w)))d=d[w];else return!1}return!0},c.ensureExists=function(d,f,p){return y(d,f,p,!0)},c.set=function(d,f,p,w){return y(d,f,p,w)},c.insert=function(d,f,p,w){var b=c.get(d,f);w=~~w,n(b)||(b=[],c.set(d,f,b)),b.splice(w,0,p)},c.empty=function(d,f){if(!r(f)&&d!=null){var p,w;if(!!(p=c.get(d,f))){if(typeof p=="string")return c.set(d,f,"");if(l(p))return c.set(d,f,!1);if(typeof p=="number")return c.set(d,f,0);if(n(p))p.length=0;else if(o(p))for(w in p)T(p,w)&&delete p[w];else return c.set(d,f,null)}}},c.push=function(d,f){var p=c.get(d,f);n(p)||(p=[],c.set(d,f,p)),p.push.apply(p,Array.prototype.slice.call(arguments,2))},c.coalesce=function(d,f,p){for(var w,b=0,O=f.length;b<O;b++)if((w=c.get(d,f[b]))!==void 0)return w;return p},c.get=function(d,f,p){if(typeof f=="number"&&(f=[f]),!f||f.length===0)return d;if(d==null)return p;if(typeof f=="string")return c.get(d,f.split("."),p);var w=s(f[0]),b=u(d,w);return b===void 0?p:f.length===1?b:c.get(d[w],f.slice(1),p)},c.del=function(f,p){if(typeof p=="number"&&(p=[p]),f==null||r(p))return f;if(typeof p=="string")return c.del(f,p.split("."));var w=s(p[0]);if(u(f,w),!T(f,w))return f;if(p.length===1)n(f)?f.splice(w,1):delete f[w];else return c.del(f[w],p.slice(1));return f},c}var a=h();return a.create=h,a.withInheritedProps=h({includeInheritedProps:!0}),a})});var vi={};hr(vi,{defaults:()=>nr,jVar:()=>$i,version:()=>hi});var fe=U(Ce(),1),Pt=U(Ve(),1);function Qn(e){if(e.includes(".")){let t=e.lastIndexOf(".");if(!e.slice(0,t).includes("."))return e.slice(0,t);for(let r=t-1;r--;)if(e[r]===".")return e.slice(r+1,t)}return null}var je=Qn;function ue(e,t){let r={now:!1};function i(o,n,l,s){let h=(0,fe.default)(o),a,g=$({depth:-1,path:""},l);if(g.depth+=1,Array.isArray(h))for(let c=0,T=h.length;c<T&&!s.now;c++){let m=g.path?`${g.path}.${c}`:`${c}`;h[c]!==void 0?(g.parent=(0,fe.default)(h),g.parentType="array",g.parentKey=je(m),a=i(n(h[c],void 0,K($({},g),{path:m}),s),n,K($({},g),{path:m}),s),Number.isNaN(a)&&c<h.length?(h.splice(c,1),c-=1):h[c]=a):h.splice(c,1)}else if((0,Pt.default)(h))for(let c in h){if(s.now&&c!=null)break;let T=g.path?`${g.path}.${c}`:c;g.depth===0&&c!=null&&(g.topmostKey=c),g.parent=(0,fe.default)(h),g.parentType="object",g.parentKey=je(T),a=i(n(c,h[c],K($({},g),{path:T}),s),n,K($({},g),{path:T}),s),Number.isNaN(a)?delete h[c]:h[c]=a}return h}return i(e,t,{},r)}function He(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var Me=new Map,Jt=(e,t)=>{if(!Array.isArray(e))switch(typeof e){case"string":e=[e];break;case"undefined":e=[];break;default:throw new TypeError(`Expected '${t}' to be a string or an array, but got a type of '${typeof e}'`)}return e.filter(r=>{if(typeof r!="string"){if(typeof r>"u")return!1;throw new TypeError(`Expected '${t}' to be an array of strings, but found a type of '${typeof r}' in the array`)}return!0})},ei=(e,t)=>{t=$({caseSensitive:!1},t);let r=e+JSON.stringify(t);if(Me.has(r))return Me.get(r);let i=e[0]==="!";i&&(e=e.slice(1)),e=He(e).replace(/\\\*/g,"[\\s\\S]*");let o=new RegExp(`^${e}$`,t.caseSensitive?"":"i");return o.negated=i,Me.set(r,o),o},ti=(e,t,r,i)=>{if(e=Jt(e,"inputs"),t=Jt(t,"patterns"),t.length===0)return[];t=t.map(l=>ei(l,r));let{allPatterns:o}=r||{},n=[];for(let l of e){let s,h=[...t].fill(!1);for(let[a,g]of t.entries())if(g.test(l)&&(h[a]=!0,s=!g.negated,!s))break;if(!(s===!1||s===void 0&&t.some(a=>!a.negated)||o&&h.some((a,g)=>!a&&!t[g].negated))&&(n.push(l),i))break}return n};function ge(e,t,r){return ti(e,t,r,!0).length>0}var D=U(Ft(),1);function I(e){return typeof e=="string"?e.length?[e]:[]:e}function kt(e){return e&&typeof e=="object"&&!Array.isArray(e)}function he(e){return typeof e=="string"}var Lt={cb:void 0,i:!1,trimBeforeMatching:!1,trimCharsBeforeMatching:[],maxMismatches:0,firstMustMatch:!1,lastMustMatch:!1,hungry:!1},ri=e=>e+1;function ni(e,t,r,i,o=!1,n=ri){let l=typeof r=="function"?r():r;if(+t<0&&o&&l==="EOL")return l;let s=$($({},Lt),i);if(t>=e.length&&!o)return!1;let h=o?1:r.length,a=0,g=!1,c=!1,T=!1,m=s.maxMismatches,u=t,y=!1,d=!1,f=!1;function p(){return a===1&&m<s.maxMismatches-1}for(;e[u];){let w=n(u);if(s.trimBeforeMatching&&e[u].trim()===""){if(!e[w]&&o&&r==="EOL")return!0;u=n(u);continue}if(s&&!s.i&&s.trimCharsBeforeMatching&&s.trimCharsBeforeMatching.includes(e[u])||(s==null?void 0:s.i)&&s.trimCharsBeforeMatching&&s.trimCharsBeforeMatching.map(O=>O.toLowerCase()).includes(e[u].toLowerCase())){if(o&&r==="EOL"&&!e[w])return!0;u=n(u);continue}let b=w>u?r[r.length-h]:r[h-1];if(!s.i&&e[u]===b||s.i&&e[u].toLowerCase()===b.toLowerCase()){if(y||(y=!0),T||(T=!0),h===r.length){if(d=!0,m!==s.maxMismatches)return!1}else h===1&&(f=!0);if(h-=1,a++,p())return!1;if(!h)return a!==r.length||m===s.maxMismatches||!g?u:!1}else if(!g&&!a&&(g=!0),s.maxMismatches&&m&&u){m-=1;for(let O=0;O<=m;O++){let E=w>u?r[r.length-h+1+O]:r[h-2-O],ye=e[n(u)];if(E&&(!s.i&&e[u]===E||s.i&&e[u].toLowerCase()===E.toLowerCase())&&(!s.firstMustMatch||h!==r.length)){if(a++,p())return!1;h-=2,y=!0;break}else if(ye&&E&&(!s.i&&ye===E||s.i&&ye.toLowerCase()===E.toLowerCase())&&(!s.firstMustMatch||h!==r.length)){if(!a&&!s.hungry)return!1;h-=1,y=!0;break}else if(E===void 0&&m>=0&&y&&(!s.firstMustMatch||d)&&(!s.lastMustMatch||f))return u}y||(c=u)}else return u===0&&h===1&&!s.lastMustMatch&&T?0:!1;if(c!==!1&&c!==u&&(c=!1),h<1)return u;u=n(u)}if(h>0)return o&&l==="EOL"?!0:s&&s.maxMismatches>=h&&T?c||0:!1}function qt(e,t,r,i,o){if(kt(o)&&Object.prototype.hasOwnProperty.call(o,"trimBeforeMatching")&&typeof o.trimBeforeMatching!="boolean")throw new Error(`string-match-left-right/${e}(): [THROW_ID_09] opts.trimBeforeMatching should be boolean!${Array.isArray(o.trimBeforeMatching)?" Did you mean to use opts.trimCharsBeforeMatching?":""}`);let n=$($({},Lt),o);if(typeof n.trimCharsBeforeMatching=="string"&&(n.trimCharsBeforeMatching=I(n.trimCharsBeforeMatching)),n.trimCharsBeforeMatching=n.trimCharsBeforeMatching.map(g=>he(g)?g:String(g)),!he(t)||!t.length)return!1;if(!Number.isInteger(r)||r<0)throw new Error(`string-match-left-right/${e}(): [THROW_ID_03] the second argument should be a natural number. Currently it's of a type: ${typeof r}, equal to:
11
- ${JSON.stringify(r,null,4)}`);let l,s;if(he(i))l=[i];else if(Array.isArray(i))l=i;else if(!i)l=i;else if(typeof i=="function")l=[],l.push(i);else throw new Error(`string-match-left-right/${e}(): [THROW_ID_05] the third argument, whatToMatch, is neither string nor array of strings! It's ${typeof i}, equal to:
10
+ var jsonVariables=(()=>{var sr=Object.create;var q=Object.defineProperty,or=Object.defineProperties,lr=Object.getOwnPropertyDescriptor,fr=Object.getOwnPropertyDescriptors,ur=Object.getOwnPropertyNames,Ke=Object.getOwnPropertySymbols,gr=Object.getPrototypeOf,Ue=Object.prototype.hasOwnProperty,cr=Object.prototype.propertyIsEnumerable;var me=(e,t,r)=>t in e?q(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$=(e,t)=>{for(var r in t||(t={}))Ue.call(t,r)&&me(e,r,t[r]);if(Ke)for(var r of Ke(t))cr.call(t,r)&&me(e,r,t[r]);return e},K=(e,t)=>or(e,fr(t));var we=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),hr=(e,t)=>{for(var r in t)q(e,r,{get:t[r],enumerable:!0})},Ge=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ur(t))!Ue.call(e,o)&&o!==r&&q(e,o,{get:()=>t[o],enumerable:!(i=lr(t,o))||i.enumerable});return e};var U=(e,t,r)=>(r=e!=null?sr(gr(e)):{},Ge(t||!e||!e.__esModule?q(r,"default",{value:e,enumerable:!0}):r,e)),pr=e=>Ge(q({},"__esModule",{value:!0}),e);var be=(e,t,r)=>(me(e,typeof t!="symbol"?t+"":t,r),r);var Ce=we((G,P)=>{var dr=200,st="__lodash_hash_undefined__",ot=9007199254740991,Ee="[object Arguments]",yr="[object Array]",lt="[object Boolean]",ft="[object Date]",mr="[object Error]",Se="[object Function]",ut="[object GeneratorFunction]",te="[object Map]",gt="[object Number]",We="[object Object]",ze="[object Promise]",ct="[object RegExp]",re="[object Set]",ht="[object String]",pt="[object Symbol]",$e="[object WeakMap]",dt="[object ArrayBuffer]",ne="[object DataView]",yt="[object Float32Array]",mt="[object Float64Array]",wt="[object Int8Array]",bt="[object Int16Array]",Tt="[object Int32Array]",$t="[object Uint8Array]",vt="[object Uint8ClampedArray]",Ot="[object Uint16Array]",_t="[object Uint32Array]",wr=/[\\^$.*+?()[\]{}|]/g,br=/\w*$/,Tr=/^\[object .+?Constructor\]$/,$r=/^(?:0|[1-9]\d*)$/,v={};v[Ee]=v[yr]=v[dt]=v[ne]=v[lt]=v[ft]=v[yt]=v[mt]=v[wt]=v[bt]=v[Tt]=v[te]=v[gt]=v[We]=v[ct]=v[re]=v[ht]=v[pt]=v[$t]=v[vt]=v[Ot]=v[_t]=!0;v[mr]=v[Se]=v[$e]=!1;var vr=typeof global=="object"&&global&&global.Object===Object&&global,Or=typeof self=="object"&&self&&self.Object===Object&&self,N=vr||Or||Function("return this")(),At=typeof G=="object"&&G&&!G.nodeType&&G,Ye=At&&typeof P=="object"&&P&&!P.nodeType&&P,_r=Ye&&Ye.exports===At;function Ar(e,t){return e.set(t[0],t[1]),e}function Ir(e,t){return e.add(t),e}function Er(e,t){for(var r=-1,i=e?e.length:0;++r<i&&t(e[r],r,e)!==!1;);return e}function Sr(e,t){for(var r=-1,i=t.length,o=e.length;++r<i;)e[o+r]=t[r];return e}function It(e,t,r,i){var o=-1,n=e?e.length:0;for(i&&n&&(r=e[++o]);++o<n;)r=t(r,e[o],o,e);return r}function Wr(e,t){for(var r=-1,i=Array(e);++r<e;)i[r]=t(r);return i}function Dr(e,t){return e==null?void 0:e[t]}function Et(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(r){}return t}function Xe(e){var t=-1,r=Array(e.size);return e.forEach(function(i,o){r[++t]=[o,i]}),r}function De(e,t){return function(r){return e(t(r))}}function Ze(e){var t=-1,r=Array(e.size);return e.forEach(function(i){r[++t]=i}),r}var Nr=Array.prototype,xr=Function.prototype,ie=Object.prototype,Te=N["__core-js_shared__"],Qe=function(){var e=/[^.]+$/.exec(Te&&Te.keys&&Te.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),St=xr.toString,R=ie.hasOwnProperty,ae=ie.toString,Rr=RegExp("^"+St.call(R).replace(wr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),et=_r?N.Buffer:void 0,tt=N.Symbol,rt=N.Uint8Array,Cr=De(Object.getPrototypeOf,Object),Vr=Object.create,jr=ie.propertyIsEnumerable,Hr=Nr.splice,nt=Object.getOwnPropertySymbols,Mr=et?et.isBuffer:void 0,Pr=De(Object.keys,Object),ve=F(N,"DataView"),z=F(N,"Map"),Oe=F(N,"Promise"),_e=F(N,"Set"),Ae=F(N,"WeakMap"),Y=F(Object,"create"),Jr=M(ve),Br=M(z),Fr=M(Oe),kr=M(_e),Lr=M(Ae),it=tt?tt.prototype:void 0,at=it?it.valueOf:void 0;function H(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function qr(){this.__data__=Y?Y(null):{}}function Kr(e){return this.has(e)&&delete this.__data__[e]}function Ur(e){var t=this.__data__;if(Y){var r=t[e];return r===st?void 0:r}return R.call(t,e)?t[e]:void 0}function Gr(e){var t=this.__data__;return Y?t[e]!==void 0:R.call(t,e)}function zr(e,t){var r=this.__data__;return r[e]=Y&&t===void 0?st:t,this}H.prototype.clear=qr;H.prototype.delete=Kr;H.prototype.get=Ur;H.prototype.has=Gr;H.prototype.set=zr;function x(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function Yr(){this.__data__=[]}function Xr(e){var t=this.__data__,r=se(t,e);if(r<0)return!1;var i=t.length-1;return r==i?t.pop():Hr.call(t,r,1),!0}function Zr(e){var t=this.__data__,r=se(t,e);return r<0?void 0:t[r][1]}function Qr(e){return se(this.__data__,e)>-1}function en(e,t){var r=this.__data__,i=se(r,e);return i<0?r.push([e,t]):r[i][1]=t,this}x.prototype.clear=Yr;x.prototype.delete=Xr;x.prototype.get=Zr;x.prototype.has=Qr;x.prototype.set=en;function J(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function tn(){this.__data__={hash:new H,map:new(z||x),string:new H}}function rn(e){return oe(this,e).delete(e)}function nn(e){return oe(this,e).get(e)}function an(e){return oe(this,e).has(e)}function sn(e,t){return oe(this,e).set(e,t),this}J.prototype.clear=tn;J.prototype.delete=rn;J.prototype.get=nn;J.prototype.has=an;J.prototype.set=sn;function B(e){this.__data__=new x(e)}function on(){this.__data__=new x}function ln(e){return this.__data__.delete(e)}function fn(e){return this.__data__.get(e)}function un(e){return this.__data__.has(e)}function gn(e,t){var r=this.__data__;if(r instanceof x){var i=r.__data__;if(!z||i.length<dr-1)return i.push([e,t]),this;r=this.__data__=new J(i)}return r.set(e,t),this}B.prototype.clear=on;B.prototype.delete=ln;B.prototype.get=fn;B.prototype.has=un;B.prototype.set=gn;function cn(e,t){var r=xe(e)||jn(e)?Wr(e.length,String):[],i=r.length,o=!!i;for(var n in e)(t||R.call(e,n))&&!(o&&(n=="length"||xn(n,i)))&&r.push(n);return r}function Wt(e,t,r){var i=e[t];(!(R.call(e,t)&&Rt(i,r))||r===void 0&&!(t in e))&&(e[t]=r)}function se(e,t){for(var r=e.length;r--;)if(Rt(e[r][0],t))return r;return-1}function hn(e,t){return e&&Dt(t,Re(t),e)}function Ie(e,t,r,i,o,n,l){var a;if(i&&(a=n?i(e,o,n,l):i(e)),a!==void 0)return a;if(!le(e))return e;var h=xe(e);if(h){if(a=Wn(e),!t)return In(e,a)}else{var s=j(e),g=s==Se||s==ut;if(Mn(e))return bn(e,t);if(s==We||s==Ee||g&&!n){if(Et(e))return n?e:{};if(a=Dn(g?{}:e),!t)return En(e,hn(a,e))}else{if(!v[s])return n?e:{};a=Nn(e,s,Ie,t)}}l||(l=new B);var c=l.get(e);if(c)return c;if(l.set(e,a),!h)var T=r?Sn(e):Re(e);return Er(T||e,function(m,u){T&&(u=m,m=e[u]),Wt(a,u,Ie(m,t,r,i,u,e,l))}),a}function pn(e){return le(e)?Vr(e):{}}function dn(e,t,r){var i=t(e);return xe(e)?i:Sr(i,r(e))}function yn(e){return ae.call(e)}function mn(e){if(!le(e)||Cn(e))return!1;var t=Vt(e)||Et(e)?Rr:Tr;return t.test(M(e))}function wn(e){if(!xt(e))return Pr(e);var t=[];for(var r in Object(e))R.call(e,r)&&r!="constructor"&&t.push(r);return t}function bn(e,t){if(t)return e.slice();var r=new e.constructor(e.length);return e.copy(r),r}function Ne(e){var t=new e.constructor(e.byteLength);return new rt(t).set(new rt(e)),t}function Tn(e,t){var r=t?Ne(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}function $n(e,t,r){var i=t?r(Xe(e),!0):Xe(e);return It(i,Ar,new e.constructor)}function vn(e){var t=new e.constructor(e.source,br.exec(e));return t.lastIndex=e.lastIndex,t}function On(e,t,r){var i=t?r(Ze(e),!0):Ze(e);return It(i,Ir,new e.constructor)}function _n(e){return at?Object(at.call(e)):{}}function An(e,t){var r=t?Ne(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function In(e,t){var r=-1,i=e.length;for(t||(t=Array(i));++r<i;)t[r]=e[r];return t}function Dt(e,t,r,i){r||(r={});for(var o=-1,n=t.length;++o<n;){var l=t[o],a=i?i(r[l],e[l],l,r,e):void 0;Wt(r,l,a===void 0?e[l]:a)}return r}function En(e,t){return Dt(e,Nt(e),t)}function Sn(e){return dn(e,Re,Nt)}function oe(e,t){var r=e.__data__;return Rn(t)?r[typeof t=="string"?"string":"hash"]:r.map}function F(e,t){var r=Dr(e,t);return mn(r)?r:void 0}var Nt=nt?De(nt,Object):Bn,j=yn;(ve&&j(new ve(new ArrayBuffer(1)))!=ne||z&&j(new z)!=te||Oe&&j(Oe.resolve())!=ze||_e&&j(new _e)!=re||Ae&&j(new Ae)!=$e)&&(j=function(e){var t=ae.call(e),r=t==We?e.constructor:void 0,i=r?M(r):void 0;if(i)switch(i){case Jr:return ne;case Br:return te;case Fr:return ze;case kr:return re;case Lr:return $e}return t});function Wn(e){var t=e.length,r=e.constructor(t);return t&&typeof e[0]=="string"&&R.call(e,"index")&&(r.index=e.index,r.input=e.input),r}function Dn(e){return typeof e.constructor=="function"&&!xt(e)?pn(Cr(e)):{}}function Nn(e,t,r,i){var o=e.constructor;switch(t){case dt:return Ne(e);case lt:case ft:return new o(+e);case ne:return Tn(e,i);case yt:case mt:case wt:case bt:case Tt:case $t:case vt:case Ot:case _t:return An(e,i);case te:return $n(e,i,r);case gt:case ht:return new o(e);case ct:return vn(e);case re:return On(e,i,r);case pt:return _n(e)}}function xn(e,t){return t=t==null?ot:t,!!t&&(typeof e=="number"||$r.test(e))&&e>-1&&e%1==0&&e<t}function Rn(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Cn(e){return!!Qe&&Qe in e}function xt(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||ie;return e===r}function M(e){if(e!=null){try{return St.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function Vn(e){return Ie(e,!0,!0)}function Rt(e,t){return e===t||e!==e&&t!==t}function jn(e){return Hn(e)&&R.call(e,"callee")&&(!jr.call(e,"callee")||ae.call(e)==Ee)}var xe=Array.isArray;function Ct(e){return e!=null&&Pn(e.length)&&!Vt(e)}function Hn(e){return Jn(e)&&Ct(e)}var Mn=Mr||Fn;function Vt(e){var t=le(e)?ae.call(e):"";return t==Se||t==ut}function Pn(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ot}function le(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function Jn(e){return!!e&&typeof e=="object"}function Re(e){return Ct(e)?cn(e):wn(e)}function Bn(){return[]}function Fn(){return!1}P.exports=Vn});var Ve=we((_i,Mt)=>{var kn="[object Object]";function Ln(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(r){}return t}function qn(e,t){return function(r){return e(t(r))}}var Kn=Function.prototype,jt=Object.prototype,Ht=Kn.toString,Un=jt.hasOwnProperty,Gn=Ht.call(Object),zn=jt.toString,Yn=qn(Object.getPrototypeOf,Object);function Xn(e){return!!e&&typeof e=="object"}function Zn(e){if(!Xn(e)||zn.call(e)!=kn||Ln(e))return!1;var t=Yn(e);if(t===null)return!0;var r=Un.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&Ht.call(r)==Gn}Mt.exports=Zn});var Ft=we((Bt,ce)=>{(function(e,t){"use strict";typeof ce=="object"&&typeof ce.exports=="object"?ce.exports=t():typeof define=="function"&&define.amd?define([],t):e.objectPath=t()})(Bt,function(){"use strict";var e=Object.prototype.toString;function t(g,c){return g==null?!1:Object.prototype.hasOwnProperty.call(g,c)}function r(g){if(!g||n(g)&&g.length===0)return!0;if(typeof g!="string"){for(var c in g)if(t(g,c))return!1;return!0}return!1}function i(g){return e.call(g)}function o(g){return typeof g=="object"&&i(g)==="[object Object]"}var n=Array.isArray||function(g){return e.call(g)==="[object Array]"};function l(g){return typeof g=="boolean"||i(g)==="[object Boolean]"}function a(g){var c=parseInt(g);return c.toString()===g?c:g}function h(g){g=g||{};var c=function(d){return Object.keys(c).reduce(function(f,p){return p==="create"||typeof c[p]=="function"&&(f[p]=c[p].bind(c,d)),f},{})},T;g.includeInheritedProps?T=function(){return!0}:T=function(d,f){return typeof f=="number"&&Array.isArray(d)||t(d,f)};function m(d,f){if(T(d,f))return d[f]}var u;g.includeInheritedProps?u=function(d,f){typeof f!="string"&&typeof f!="number"&&(f=String(f));var p=m(d,f);if(f==="__proto__"||f==="prototype"||f==="constructor"&&typeof p=="function")throw new Error("For security reasons, object's magic properties cannot be set");return p}:u=function(d,f){return m(d,f)};function y(d,f,p,w){if(typeof f=="number"&&(f=[f]),!f||f.length===0)return d;if(typeof f=="string")return y(d,f.split(".").map(a),p,w);var b=f[0],O=u(d,b);return f.length===1?((O===void 0||!w)&&(d[b]=p),O):(O===void 0&&(typeof f[1]=="number"?d[b]=[]:d[b]={}),y(d[b],f.slice(1),p,w))}return c.has=function(d,f){if(typeof f=="number"?f=[f]:typeof f=="string"&&(f=f.split(".")),!f||f.length===0)return!!d;for(var p=0;p<f.length;p++){var w=a(f[p]);if(typeof w=="number"&&n(d)&&w<d.length||(g.includeInheritedProps?w in Object(d):t(d,w)))d=d[w];else return!1}return!0},c.ensureExists=function(d,f,p){return y(d,f,p,!0)},c.set=function(d,f,p,w){return y(d,f,p,w)},c.insert=function(d,f,p,w){var b=c.get(d,f);w=~~w,n(b)||(b=[],c.set(d,f,b)),b.splice(w,0,p)},c.empty=function(d,f){if(!r(f)&&d!=null){var p,w;if(!!(p=c.get(d,f))){if(typeof p=="string")return c.set(d,f,"");if(l(p))return c.set(d,f,!1);if(typeof p=="number")return c.set(d,f,0);if(n(p))p.length=0;else if(o(p))for(w in p)T(p,w)&&delete p[w];else return c.set(d,f,null)}}},c.push=function(d,f){var p=c.get(d,f);n(p)||(p=[],c.set(d,f,p)),p.push.apply(p,Array.prototype.slice.call(arguments,2))},c.coalesce=function(d,f,p){for(var w,b=0,O=f.length;b<O;b++)if((w=c.get(d,f[b]))!==void 0)return w;return p},c.get=function(d,f,p){if(typeof f=="number"&&(f=[f]),!f||f.length===0)return d;if(d==null)return p;if(typeof f=="string")return c.get(d,f.split("."),p);var w=a(f[0]),b=u(d,w);return b===void 0?p:f.length===1?b:c.get(d[w],f.slice(1),p)},c.del=function(f,p){if(typeof p=="number"&&(p=[p]),f==null||r(p))return f;if(typeof p=="string")return c.del(f,p.split("."));var w=a(p[0]);if(u(f,w),!T(f,w))return f;if(p.length===1)n(f)?f.splice(w,1):delete f[w];else return c.del(f[w],p.slice(1));return f},c}var s=h();return s.create=h,s.withInheritedProps=h({includeInheritedProps:!0}),s})});var vi={};hr(vi,{defaults:()=>nr,jVar:()=>$i,version:()=>hi});var fe=U(Ce(),1),Pt=U(Ve(),1);function Qn(e){if(e.includes(".")){let t=e.lastIndexOf(".");if(!e.slice(0,t).includes("."))return e.slice(0,t);for(let r=t-1;r--;)if(e[r]===".")return e.slice(r+1,t)}return null}var je=Qn;function ue(e,t){let r={now:!1};function i(o,n,l,a){let h=(0,fe.default)(o),s,g=$({depth:-1,path:""},l);if(g.depth+=1,Array.isArray(h))for(let c=0,T=h.length;c<T&&!a.now;c++){let m=g.path?`${g.path}.${c}`:`${c}`;h[c]!==void 0?(g.parent=(0,fe.default)(h),g.parentType="array",g.parentKey=je(m),s=i(n(h[c],void 0,K($({},g),{path:m}),a),n,K($({},g),{path:m}),a),Number.isNaN(s)&&c<h.length?(h.splice(c,1),c-=1):h[c]=s):h.splice(c,1)}else if((0,Pt.default)(h))for(let c in h){if(a.now&&c!=null)break;let T=g.path?`${g.path}.${c}`:c;g.depth===0&&c!=null&&(g.topmostKey=c),g.parent=(0,fe.default)(h),g.parentType="object",g.parentKey=je(T),s=i(n(c,h[c],K($({},g),{path:T}),a),n,K($({},g),{path:T}),a),Number.isNaN(s)?delete h[c]:h[c]=s}return h}return i(e,t,{},r)}function He(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var Me=new Map,Jt=(e,t)=>{if(!Array.isArray(e))switch(typeof e){case"string":e=[e];break;case"undefined":e=[];break;default:throw new TypeError(`Expected '${t}' to be a string or an array, but got a type of '${typeof e}'`)}return e.filter(r=>{if(typeof r!="string"){if(typeof r>"u")return!1;throw new TypeError(`Expected '${t}' to be an array of strings, but found a type of '${typeof r}' in the array`)}return!0})},ei=(e,t)=>{t=$({caseSensitive:!1},t);let r=e+JSON.stringify(t);if(Me.has(r))return Me.get(r);let i=e[0]==="!";i&&(e=e.slice(1)),e=He(e).replace(/\\\*/g,"[\\s\\S]*");let o=new RegExp(`^${e}$`,t.caseSensitive?"":"i");return o.negated=i,Me.set(r,o),o},ti=(e,t,r,i)=>{if(e=Jt(e,"inputs"),t=Jt(t,"patterns"),t.length===0)return[];t=t.map(l=>ei(l,r));let{allPatterns:o}=r||{},n=[];for(let l of e){let a,h=[...t].fill(!1);for(let[s,g]of t.entries())if(g.test(l)&&(h[s]=!0,a=!g.negated,!a))break;if(!(a===!1||a===void 0&&t.some(s=>!s.negated)||o&&h.some((s,g)=>!s&&!t[g].negated))&&(n.push(l),i))break}return n};function ge(e,t,r){return ti(e,t,r,!0).length>0}var D=U(Ft(),1);function I(e){return typeof e=="string"?e.length?[e]:[]:e}function kt(e){return e&&typeof e=="object"&&!Array.isArray(e)}function he(e){return typeof e=="string"}var Lt={cb:void 0,i:!1,trimBeforeMatching:!1,trimCharsBeforeMatching:[],maxMismatches:0,firstMustMatch:!1,lastMustMatch:!1,hungry:!1},ri=e=>e+1;function ni(e,t,r,i,o=!1,n=ri){let l=typeof r=="function"?r():r;if(+t<0&&o&&l==="EOL")return l;let a=$($({},Lt),i);if(t>=e.length&&!o)return!1;let h=o?1:r.length,s=0,g=!1,c=!1,T=!1,m=a.maxMismatches,u=t,y=!1,d=!1,f=!1;function p(){return s===1&&m<a.maxMismatches-1}for(;e[u];){let w=n(u);if(a.trimBeforeMatching&&e[u].trim()===""){if(!e[w]&&o&&r==="EOL")return!0;u=n(u);continue}if(a&&!a.i&&a.trimCharsBeforeMatching&&a.trimCharsBeforeMatching.includes(e[u])||(a==null?void 0:a.i)&&a.trimCharsBeforeMatching&&a.trimCharsBeforeMatching.map(O=>O.toLowerCase()).includes(e[u].toLowerCase())){if(o&&r==="EOL"&&!e[w])return!0;u=n(u);continue}let b=w>u?r[r.length-h]:r[h-1];if(!a.i&&e[u]===b||a.i&&e[u].toLowerCase()===b.toLowerCase()){if(y||(y=!0),T||(T=!0),h===r.length){if(d=!0,m!==a.maxMismatches)return!1}else h===1&&(f=!0);if(h-=1,s++,p())return!1;if(!h)return s!==r.length||m===a.maxMismatches||!g?u:!1}else if(!g&&!s&&(g=!0),a.maxMismatches&&m&&u){m-=1;for(let O=0;O<=m;O++){let E=w>u?r[r.length-h+1+O]:r[h-2-O],ye=e[n(u)];if(E&&(!a.i&&e[u]===E||a.i&&e[u].toLowerCase()===E.toLowerCase())&&(!a.firstMustMatch||h!==r.length)){if(s++,p())return!1;h-=2,y=!0;break}else if(ye&&E&&(!a.i&&ye===E||a.i&&ye.toLowerCase()===E.toLowerCase())&&(!a.firstMustMatch||h!==r.length)){if(!s&&!a.hungry)return!1;h-=1,y=!0;break}else if(E===void 0&&m>=0&&y&&(!a.firstMustMatch||d)&&(!a.lastMustMatch||f))return u}y||(c=u)}else return u===0&&h===1&&!a.lastMustMatch&&T?0:!1;if(c!==!1&&c!==u&&(c=!1),h<1)return u;u=n(u)}if(h>0)return o&&l==="EOL"?!0:a&&a.maxMismatches>=h&&T?c||0:!1}function qt(e,t,r,i,o){if(kt(o)&&Object.prototype.hasOwnProperty.call(o,"trimBeforeMatching")&&typeof o.trimBeforeMatching!="boolean")throw new Error(`string-match-left-right/${e}(): [THROW_ID_09] opts.trimBeforeMatching should be boolean!${Array.isArray(o.trimBeforeMatching)?" Did you mean to use opts.trimCharsBeforeMatching?":""}`);let n=$($({},Lt),o);if(typeof n.trimCharsBeforeMatching=="string"&&(n.trimCharsBeforeMatching=I(n.trimCharsBeforeMatching)),n.trimCharsBeforeMatching=n.trimCharsBeforeMatching.map(g=>he(g)?g:String(g)),!he(t)||!t.length)return!1;if(!Number.isInteger(r)||r<0)throw new Error(`string-match-left-right/${e}(): [THROW_ID_03] the second argument should be a natural number. Currently it's of a type: ${typeof r}, equal to:
11
+ ${JSON.stringify(r,null,4)}`);let l,a;if(he(i))l=[i];else if(Array.isArray(i))l=i;else if(!i)l=i;else if(typeof i=="function")l=[],l.push(i);else throw new Error(`string-match-left-right/${e}(): [THROW_ID_05] the third argument, whatToMatch, is neither string nor array of strings! It's ${typeof i}, equal to:
12
12
  ${JSON.stringify(i,null,4)}`);if(o&&!kt(o))throw new Error(`string-match-left-right/${e}(): [THROW_ID_06] the fourth argument, options object, should be a plain object. Currently it's of a type "${typeof o}", and equal to:
13
- ${JSON.stringify(o,null,4)}`);let h=0,a="";if((n==null?void 0:n.trimCharsBeforeMatching)&&n.trimCharsBeforeMatching.some((g,c)=>g.length>1?(h=c,a=g,!0):!1))throw new Error(`string-match-left-right/${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 ${h} is longer than 1 character, ${a.length} (equals to ${a}). Please split it into separate characters and put into array as separate elements.`);if(!l||!Array.isArray(l)||Array.isArray(l)&&!l.length||Array.isArray(l)&&l.length===1&&he(l[0])&&!l[0].trim()){if(typeof n.cb=="function"){let c,T=r;if((e==="matchLeftIncl"||e==="matchRight")&&(T+=1),e[5]==="L")for(let d=T;d--;){let f=t[d];if((!n.trimBeforeMatching||n.trimBeforeMatching&&f!==void 0&&f.trim())&&(!n.trimCharsBeforeMatching||!n.trimCharsBeforeMatching.length||f!==void 0&&!n.trimCharsBeforeMatching.includes(f))){c=d;break}}else if(e.startsWith("matchRight"))for(let d=T;d<t.length;d++){let f=t[d];if((!n.trimBeforeMatching||n.trimBeforeMatching&&f.trim())&&(!n.trimCharsBeforeMatching||!n.trimCharsBeforeMatching.length||!n.trimCharsBeforeMatching.includes(f))){c=d;break}}if(c===void 0)return!1;let m=t[c],u=c+1,y="";return u&&u>0&&(y=t.slice(0,u)),e[5]==="L"||c&&c>0&&(y=t.slice(c)),n.cb(m,y,c)}let g="";throw o||(g=" More so, the whole options object, the fourth input argument, is missing!"),new Error(`string-match-left-right/${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!${g}`)}for(let g=0,c=l.length;g<c;g++){s=typeof l[g]=="function";let T=l[g],m,u,y="",d=r;e==="matchRight"?d+=1:e==="matchLeft"&&(d-=1);let f=ni(t,d,T,n,s,p=>e[5]==="L"?p-1:p+1);if(f&&s&&typeof T=="function"&&T()==="EOL")return T()&&(n.cb?n.cb(m,y,u):!0)?T():!1;if(Number.isInteger(f)&&(u=e.startsWith("matchLeft")?f-1:f+1,e[5]==="L"?y=t.slice(0,f):y=t.slice(u)),u<0&&(u=void 0),t[u]&&(m=t[u]),Number.isInteger(f)&&(n.cb?n.cb(m,y,u):!0))return T}return!1}function k(e,t,r,i){return qt("matchLeftIncl",e,t,r,i)}function W(e,t,r,i){return qt("matchRightIncl",e,t,r,i)}function ii(e){return e&&typeof e=="object"&&!Array.isArray(e)}function S(e){return typeof e=="string"}var Kt={fromIndex:0,throwWhenSomethingWrongIsDetected:!0,allowWholeValueToBeOnlyHeadsOrTails:!0,source:"string-find-heads-tails",matchHeadsAndTailsStrictlyInPairsByTheirOrder:!1,relaxedAPI:!1};function Pe(e,t,r,i){if(i&&!ii(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: ${i} (type: ${typeof i})`);let o=$($({},Kt),i);if(typeof o.fromIndex=="string"&&/^\d*$/.test(o.fromIndex))o.fromIndex=Number(o.fromIndex);else if(!Number.isInteger(o.fromIndex)||o.fromIndex<0)throw new TypeError(`${o.source} [THROW_ID_18] the fourth input argument must be a natural number or zero! Currently it's: ${o.fromIndex}`);if(!S(e)||e.length===0){if(o.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: ${typeof e}, equal to: ${e}`)}let n,l;if(typeof t!="string"&&!Array.isArray(t)){if(o.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: ${typeof t}, equal to:
13
+ ${JSON.stringify(o,null,4)}`);let h=0,s="";if((n==null?void 0:n.trimCharsBeforeMatching)&&n.trimCharsBeforeMatching.some((g,c)=>g.length>1?(h=c,s=g,!0):!1))throw new Error(`string-match-left-right/${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 ${h} is longer than 1 character, ${s.length} (equals to ${s}). Please split it into separate characters and put into array as separate elements.`);if(!l||!Array.isArray(l)||Array.isArray(l)&&!l.length||Array.isArray(l)&&l.length===1&&he(l[0])&&!l[0].trim()){if(typeof n.cb=="function"){let c,T=r;if((e==="matchLeftIncl"||e==="matchRight")&&(T+=1),e[5]==="L")for(let d=T;d--;){let f=t[d];if((!n.trimBeforeMatching||n.trimBeforeMatching&&f!==void 0&&f.trim())&&(!n.trimCharsBeforeMatching||!n.trimCharsBeforeMatching.length||f!==void 0&&!n.trimCharsBeforeMatching.includes(f))){c=d;break}}else if(e.startsWith("matchRight"))for(let d=T;d<t.length;d++){let f=t[d];if((!n.trimBeforeMatching||n.trimBeforeMatching&&f.trim())&&(!n.trimCharsBeforeMatching||!n.trimCharsBeforeMatching.length||!n.trimCharsBeforeMatching.includes(f))){c=d;break}}if(c===void 0)return!1;let m=t[c],u=c+1,y="";return u&&u>0&&(y=t.slice(0,u)),e[5]==="L"||c&&c>0&&(y=t.slice(c)),n.cb(m,y,c)}let g="";throw o||(g=" More so, the whole options object, the fourth input argument, is missing!"),new Error(`string-match-left-right/${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!${g}`)}for(let g=0,c=l.length;g<c;g++){a=typeof l[g]=="function";let T=l[g],m,u,y="",d=r;e==="matchRight"?d+=1:e==="matchLeft"&&(d-=1);let f=ni(t,d,T,n,a,p=>e[5]==="L"?p-1:p+1);if(f&&a&&typeof T=="function"&&T()==="EOL")return T()&&(n.cb?n.cb(m,y,u):!0)?T():!1;if(Number.isInteger(f)&&(u=e.startsWith("matchLeft")?f-1:f+1,e[5]==="L"?y=t.slice(0,f):y=t.slice(u)),u<0&&(u=void 0),t[u]&&(m=t[u]),Number.isInteger(f)&&(n.cb?n.cb(m,y,u):!0))return T}return!1}function k(e,t,r,i){return qt("matchLeftIncl",e,t,r,i)}function W(e,t,r,i){return qt("matchRightIncl",e,t,r,i)}function ii(e){return e&&typeof e=="object"&&!Array.isArray(e)}function S(e){return typeof e=="string"}var Kt={fromIndex:0,throwWhenSomethingWrongIsDetected:!0,allowWholeValueToBeOnlyHeadsOrTails:!0,source:"string-find-heads-tails",matchHeadsAndTailsStrictlyInPairsByTheirOrder:!1,relaxedAPI:!1};function Pe(e,t,r,i){if(i&&!ii(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: ${i} (type: ${typeof i})`);let o=$($({},Kt),i);if(typeof o.fromIndex=="string"&&/^\d*$/.test(o.fromIndex))o.fromIndex=Number(o.fromIndex);else if(!Number.isInteger(o.fromIndex)||o.fromIndex<0)throw new TypeError(`${o.source} [THROW_ID_18] the fourth input argument must be a natural number or zero! Currently it's: ${o.fromIndex}`);if(!S(e)||e.length===0){if(o.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: ${typeof e}, equal to: ${e}`)}let n,l;if(typeof t!="string"&&!Array.isArray(t)){if(o.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: ${typeof t}, equal to:
14
14
  ${JSON.stringify(t,null,4)}`)}else if(typeof t=="string")if(t.length===0){if(o.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 t=I(t);else if(Array.isArray(t))if(t.length===0){if(o.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(t.every((u,y)=>(n=u,l=y,S(u)))){if(!t.every((u,y)=>(l=y,S(u)&&u.length&&u.trim()!=="")))if(o.relaxedAPI){if(t=t.filter(u=>S(u)&&u.length),t.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 ${l} of heads array:
15
15
  ${JSON.stringify(t,null,4)}.`)}else if(o.relaxedAPI){if(t=t.filter(u=>S(u)&&u.length),t.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 ${l}th index is ${typeof n}, equal to:
16
16
  ${JSON.stringify(n,null,4)}. Whole heads array looks like:
@@ -18,7 +18,7 @@ ${JSON.stringify(t,null,4)}`);if(!S(r)&&!Array.isArray(r)){if(o.relaxedAPI)retur
18
18
  ${JSON.stringify(r,null,4)}`)}else if(S(r))if(r.length===0){if(o.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 r=I(r);else if(Array.isArray(r))if(r.length===0){if(o.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(r.every((u,y)=>(n=u,l=y,S(u)))){if(!r.every((u,y)=>(l=y,S(u)&&u.length&&u.trim()!=="")))if(o.relaxedAPI){if(r=r.filter(u=>S(u)&&u.length),r.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 ${l}. Whole tails array is equal to:
19
19
  ${JSON.stringify(r,null,4)}`)}else if(o.relaxedAPI){if(r=r.filter(u=>S(u)&&u.length),r.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 ${l}th index is ${typeof n}, equal to:
20
20
  ${JSON.stringify(n,null,4)}. Whole tails array is equal to:
21
- ${JSON.stringify(r,null,4)}`);let s=o.source===Kt.source;if(o.throwWhenSomethingWrongIsDetected&&!o.allowWholeValueToBeOnlyHeadsOrTails){if(I(t).includes(e))throw new Error(`${o.source}${s?": [THROW_ID_16]":""} the whole input string can't be equal to ${S(t)?"":"one of "}heads (${e})!`);if(I(r).includes(e))throw new Error(`${o.source}${s?": [THROW_ID_17]":""} the whole input string can't be equal to ${S(r)?"":"one of "}tails (${e})!`)}let h=t.concat(r).map(u=>u.charAt(0)).reduce((u,y)=>y.charCodeAt(0)>u[1]?[u[0],y.charCodeAt(0)]:y.charCodeAt(0)<u[0]?[y.charCodeAt(0),u[1]]:u,[t[0].charCodeAt(0),t[0].charCodeAt(0)]),a=[],g=!1,c={},T="",m;for(let u=o.fromIndex,y=e.length;u<y;u++){let d=e[u].charCodeAt(0);if(d<=h[1]&&d>=h[0]){let f=W(e,u,t);if(f&&o.matchHeadsAndTailsStrictlyInPairsByTheirOrder){for(let w=t.length;w--;)if(t[w]===f){m=w;break}}if(typeof f=="string")if(g){if(o.throwWhenSomethingWrongIsDetected)throw new TypeError(`${o.source}${s?": [THROW_ID_19]":""} When processing "${e}", we found heads (${e.slice(u,u+f.length)}) starting at character with index number "${u}" and there was another set of heads before it! Generally speaking, there should be "heads-tails-heads-tails", not "heads-heads-tails"!
21
+ ${JSON.stringify(r,null,4)}`);let a=o.source===Kt.source;if(o.throwWhenSomethingWrongIsDetected&&!o.allowWholeValueToBeOnlyHeadsOrTails){if(I(t).includes(e))throw new Error(`${o.source}${a?": [THROW_ID_16]":""} the whole input string can't be equal to ${S(t)?"":"one of "}heads (${e})!`);if(I(r).includes(e))throw new Error(`${o.source}${a?": [THROW_ID_17]":""} the whole input string can't be equal to ${S(r)?"":"one of "}tails (${e})!`)}let h=t.concat(r).map(u=>u.charAt(0)).reduce((u,y)=>y.charCodeAt(0)>u[1]?[u[0],y.charCodeAt(0)]:y.charCodeAt(0)<u[0]?[y.charCodeAt(0),u[1]]:u,[t[0].charCodeAt(0),t[0].charCodeAt(0)]),s=[],g=!1,c={},T="",m;for(let u=o.fromIndex,y=e.length;u<y;u++){let d=e[u].charCodeAt(0);if(d<=h[1]&&d>=h[0]){let f=W(e,u,t);if(f&&o.matchHeadsAndTailsStrictlyInPairsByTheirOrder){for(let w=t.length;w--;)if(t[w]===f){m=w;break}}if(typeof f=="string")if(g){if(o.throwWhenSomethingWrongIsDetected)throw new TypeError(`${o.source}${a?": [THROW_ID_19]":""} When processing "${e}", we found heads (${e.slice(u,u+f.length)}) starting at character with index number "${u}" and there was another set of heads before it! Generally speaking, there should be "heads-tails-heads-tails", not "heads-heads-tails"!
22
22
  We're talking about the area of the code:
23
23
 
24
24
 
@@ -29,25 +29,25 @@ ${e.slice(u+f.length,Math.min(y,u+200))}
29
29
  --------------------------------------ends
30
30
 
31
31
 
32
- To turn off this error being thrown, set resolvedOpts.throwWhenSomethingWrongIsDetected to Boolean false.`)}else{c={},c.headsStartAt=u,c.headsEndAt=u+f.length,g=!0,u+=f.length-1,T&&(T="");continue}let p=W(e,u,r);if(g&&p&&o.matchHeadsAndTailsStrictlyInPairsByTheirOrder&&m!==void 0&&r[m]!==void 0&&r[m]!==p){let w;for(let b=r.length;b--;)if(r[b]===p){w=b;break}throw new TypeError(`${o.source}${s?": [THROW_ID_20]":""} When processing "${e}", we had "resolvedOpts.matchHeadsAndTailsStrictlyInPairsByTheirOrder" on. We found heads (${t[m]}) but the tails the followed it were not of the same index, ${m} (${r[m]}) but ${w} (${p}).`)}if(typeof p=="string")if(g){c.tailsStartAt=u,c.tailsEndAt=u+p.length,a.push(c),c={},g=!1,u+=p.length-1;continue}else o.throwWhenSomethingWrongIsDetected&&(T=`${o.source}${s?": [THROW_ID_21]":""} When processing "${e}", we found tails (${e.slice(u,u+p.length)}) starting at character with index number "${u}" but there were no heads preceding it. That's very naughty!`)}if(o.throwWhenSomethingWrongIsDetected&&u===y-1){if(Object.keys(c).length!==0)throw new TypeError(`${o.source}${s?": [THROW_ID_22]":""} When processing "${e}", we reached the end of the string and yet didn't find any tails (${JSON.stringify(r,null,4)}) to match the last detected heads (${e.slice(c.headsStartAt,c.headsEndAt)})!`);if(T)throw new Error(T)}}return a}var Je=U(Ce(),1);function Be(e,t,r){let i;r!==void 0&&(i=Array.isArray(r)?(0,Je.default)(r):[(0,Je.default)(r)]);let o=[],n=ue(e,(l,s,h)=>{let a=s!==void 0?s:l;if(s!==void 0&&ge(l,t,{caseSensitive:!0})){if(i===void 0)o.push({val:s,path:h.path});else if(i.length)return i.shift()}return a});return i===void 0?o:n}function pe(e,t=1){let r="\xA0";function i(n){return Array.from(n).reverse().join("")}function o(n,l,s){let h=s?`
33
- `:"\r",a=s?"\r":`
34
- `;if(!n)return n;let g=0,c=0,T="";for(let m=0,u=n.length;m<u;m++)(n[m]===h||n[m]===a&&n[m-1]!==h)&&c++,`\r
35
- `.includes(n[m])||n[m]===r?(g=0,n[m]===r?T+=n[m]:n[m]===h?c<=l&&(T+=n[m],n[m+1]===a&&(T+=n[m+1],m++)):n[m]===a&&(!n[m-1]||n[m-1]!==h)&&c<=l&&(T+=n[m])):(g++,!n[m+1]&&!c&&(T+=" "));return T}if(typeof e=="string"&&e.length){let n=1;typeof+t=="number"&&Number.isInteger(+t)&&+t>=0&&(n=+t);let l="",s="";if(!e.trim())l=e;else if(!e[0].trim()){for(let h=0,a=e.length;h<a;h++)if(e[h].trim()){l=e.slice(0,h);break}}if(e.trim()&&(e.slice(-1).trim()===""||e.slice(-1)===r)){for(let h=e.length;h--;)if(e[h].trim()){s=e.slice(h+1);break}}return`${o(l,n,!1)}${e.trim()}${i(o(i(s),n,!0))}`}return e}var si={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function Ut(e,t){if(!Array.isArray(e)||!e.length)return e;let r=$($({},si),t),i,o;if(r.strictlyTwoElementsInRangeArrays&&!e.every((s,h)=>!Array.isArray(s)||s.length!==2?(i=h,o=s.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, ${i}th range (${JSON.stringify(e[i],null,4)}) has not two but ${o} elements!`);if(!e.every((s,h)=>!Array.isArray(s)||!Number.isInteger(s[0])||s[0]<0||!Number.isInteger(s[1])||s[1]<0?(i=h,!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, ${i}th range (${JSON.stringify(e[i],null,4)}) does not consist of only natural numbers!`);let n=e.length**2,l=0;return Array.from(e).sort((s,h)=>(r.progressFn&&(l+=1,r.progressFn(Math.floor(l*100/n))),s[0]===h[0]?s[1]<h[1]?-1:s[1]>h[1]?1:0:s[0]<h[0]?-1:1))}var Gt={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function ai(e,t){function r(a){return a&&typeof a=="object"&&!Array.isArray(a)}if(!Array.isArray(e)||!e.length)return null;let i;if(t)if(r(t)){if(i=$($({},Gt),t),i.progressFn&&r(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: "${typeof i.progressFn}", equal to ${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: "${typeof i.mergeType}", equal to ${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: "${typeof i.joinRangesThatTouchEdges}", equal to ${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:
36
- ${JSON.stringify(t,null,4)} (type ${typeof t})`);else i=$({},Gt);let o=e.filter(a=>Array.isArray(a)).map(a=>[...a]).filter(a=>a[2]!==void 0||a[0]!==a[1]),n,l,s;i.progressFn?n=Ut(o,{progressFn:a=>{s=Math.floor(a/5),s!==l&&(l=s,i.progressFn(s))}}):n=Ut(o);let h=n.length-1;for(let a=h;a>0;a--)i.progressFn&&(s=Math.floor((1-a/h)*78)+21,s!==l&&s>l&&(l=s,i.progressFn(s))),(n[a][0]<=n[a-1][0]||!i.joinRangesThatTouchEdges&&n[a][0]<n[a-1][1]||i.joinRangesThatTouchEdges&&n[a][0]<=n[a-1][1])&&(n[a-1][0]=Math.min(n[a][0],n[a-1][0]),n[a-1][1]=Math.max(n[a][1],n[a-1][1]),n[a][2]!==void 0&&(n[a-1][0]>=n[a][0]||n[a-1][1]<=n[a][1])&&n[a-1][2]!==null&&(n[a][2]===null&&n[a-1][2]!==null?n[a-1][2]=null:n[a-1][2]!=null?+i.mergeType==2&&n[a-1][0]===n[a][0]?n[a-1][2]=n[a][2]:n[a-1][2]+=n[a][2]:n[a-1][2]=n[a][2]),n.splice(a,1),a=n.length);return n.length?n:null}function C(e){return e!=null}function V(e){return Number.isInteger(e)&&e>=0}function X(e){return typeof e=="string"}var oi={limitToBeAddedWhitespace:!1,limitLinebreaksCount:1,mergeType:1},Z=class{constructor(e){be(this,"ranges");be(this,"opts");let t=$($({},oi),e);if(t.mergeType&&t.mergeType!==1&&t.mergeType!==2)if(X(t.mergeType)&&t.mergeType.trim()==="1")t.mergeType=1;else if(X(t.mergeType)&&t.mergeType.trim()==="2")t.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: "${typeof t.mergeType}", equal to ${JSON.stringify(t.mergeType,null,4)}`);this.opts=t,this.ranges=[]}add(e,t,r){if(e==null&&t==null)return;if(C(e)&&!C(t)){if(Array.isArray(e)){if(e.length){if(e.some(n=>Array.isArray(n))){e.forEach(n=>{Array.isArray(n)&&this.add(...n)});return}e.length&&V(+e[0])&&V(+e[1])&&this.add(...e)}return}throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_12] the first input argument, "from" is set (${JSON.stringify(e,null,0)}) but second-one, "to" is not (${JSON.stringify(t,null,0)})`)}else if(!C(e)&&C(t))throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_13] the second input argument, "to" is set (${JSON.stringify(t,null,0)}) but first-one, "from" is not (${JSON.stringify(e,null,0)})`);let i=+e,o=+t;if(V(r)&&(r=String(r)),V(i)&&V(o)){if(C(r)&&!X(r)&&!V(r))throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_08] The third argument, the value to add, was given not as string but ${typeof r}, equal to:
37
- ${JSON.stringify(r,null,4)}`);if(C(this.ranges)&&Array.isArray(this.last())&&i===this.last()[1]){if(this.last()[1]=o,this.last()[2],this.last()[2]!==null&&C(r)){let n=this.last()[2]&&this.last()[2].length&&(!this.opts||!this.opts.mergeType||this.opts.mergeType===1)?`${this.last()[2]}${r}`:r;this.opts.limitToBeAddedWhitespace&&(n=pe(n,this.opts.limitLinebreaksCount)),X(n)&&!n.length||(this.last()[2]=n)}}else{this.ranges||(this.ranges=[]);let n=r!==void 0&&!(X(r)&&!r.length)?[i,o,r&&this.opts.limitToBeAddedWhitespace?pe(r,this.opts.limitLinebreaksCount):r]:[i,o];this.ranges.push(n)}}else throw V(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 "${typeof o}" equal to: ${JSON.stringify(o,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 "${typeof i}" equal to: ${JSON.stringify(i,null,4)}`)}push(e,t,r){this.add(e,t,r)}current(){return Array.isArray(this.ranges)&&this.ranges.length?(this.ranges=ai(this.ranges,{mergeType:this.opts.mergeType}),this.ranges&&this.opts.limitToBeAddedWhitespace?this.ranges.map(e=>C(e[2])?[e[0],e[1],pe(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])&&V(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, ${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 li={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function Fe(e,t){if(!Array.isArray(e)||!e.length)return e;let r=$($({},li),t),i,o;if(r.strictlyTwoElementsInRangeArrays&&!e.every((s,h)=>!Array.isArray(s)||s.length!==2?(i=h,o=s.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, ${i}th range (${JSON.stringify(e[i],null,4)}) has not two but ${o} elements!`);if(!e.every((s,h)=>!Array.isArray(s)||!Number.isInteger(s[0])||s[0]<0||!Number.isInteger(s[1])||s[1]<0?(i=h,!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, ${i}th range (${JSON.stringify(e[i],null,4)}) does not consist of only natural numbers!`);let n=e.length**2,l=0;return Array.from(e).sort((s,h)=>(r.progressFn&&(l+=1,r.progressFn(Math.floor(l*100/n))),s[0]===h[0]?s[1]<h[1]?-1:s[1]>h[1]?1:0:s[0]<h[0]?-1:1))}var zt={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function Yt(e,t){function r(a){return a&&typeof a=="object"&&!Array.isArray(a)}if(!Array.isArray(e)||!e.length)return null;let i;if(t)if(r(t)){if(i=$($({},zt),t),i.progressFn&&r(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: "${typeof i.progressFn}", equal to ${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: "${typeof i.mergeType}", equal to ${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: "${typeof i.joinRangesThatTouchEdges}", equal to ${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:
38
- ${JSON.stringify(t,null,4)} (type ${typeof t})`);else i=$({},zt);let o=e.filter(a=>Array.isArray(a)).map(a=>[...a]).filter(a=>a[2]!==void 0||a[0]!==a[1]),n,l,s;i.progressFn?n=Fe(o,{progressFn:a=>{s=Math.floor(a/5),s!==l&&(l=s,i.progressFn(s))}}):n=Fe(o);let h=n.length-1;for(let a=h;a>0;a--)i.progressFn&&(s=Math.floor((1-a/h)*78)+21,s!==l&&s>l&&(l=s,i.progressFn(s))),(n[a][0]<=n[a-1][0]||!i.joinRangesThatTouchEdges&&n[a][0]<n[a-1][1]||i.joinRangesThatTouchEdges&&n[a][0]<=n[a-1][1])&&(n[a-1][0]=Math.min(n[a][0],n[a-1][0]),n[a-1][1]=Math.max(n[a][1],n[a-1][1]),n[a][2]!==void 0&&(n[a-1][0]>=n[a][0]||n[a-1][1]<=n[a][1])&&n[a-1][2]!==null&&(n[a][2]===null&&n[a-1][2]!==null?n[a-1][2]=null:n[a-1][2]!=null?+i.mergeType==2&&n[a-1][0]===n[a][0]?n[a-1][2]=n[a][2]:n[a-1][2]+=n[a][2]:n[a-1][2]=n[a][2]),n.splice(a,1),a=n.length);return n.length?n:null}var fi=!0,ke="Invariant failed";function Xt(e,t){if(!e){if(fi)throw new Error(ke);var r=typeof t=="function"?t():t,i=r?ke+": "+r:ke;throw new Error(i)}}function L(e,t,r){let i=0,o=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: ${typeof e}, equal to: ${JSON.stringify(e,null,4)}`);if(t&&!Array.isArray(t))throw new TypeError(`ranges-apply: [THROW_ID_03] second input argument must be an array (or null)! Currently it's: ${typeof t}, equal to: ${JSON.stringify(t,null,4)}`);if(r&&typeof r!="function")throw new TypeError(`ranges-apply: [THROW_ID_04] the third input argument must be a function (or falsey)! Currently it's: ${typeof r}, equal to: ${JSON.stringify(r,null,4)}`);if(!t||!t.filter(g=>g).length)return e;let n;Array.isArray(t)&&Number.isInteger(t[0])&&Number.isInteger(t[1])?n=[Array.from(t)]:n=Array.from(t);let l=n.length,s=0;n.filter(g=>g).forEach((g,c)=>{if(r&&(i=Math.floor(s/l*10),i!==o&&(o=i,r(i))),!Array.isArray(g))throw new TypeError(`ranges-apply: [THROW_ID_05] ranges array, second input arg., has ${c}th element not an array: ${JSON.stringify(g,null,4)}, which is ${typeof g}`);if(!Number.isInteger(g[0])){if(!Number.isInteger(+g[0])||+g[0]<0)throw new TypeError(`ranges-apply: [THROW_ID_06] ranges array, second input arg. has ${c}th element, array ${JSON.stringify(g,null,0)}. Its first element is not an integer, string index, but ${typeof g[0]}, equal to: ${JSON.stringify(g[0],null,4)}.`);n[c][0]=+n[c][0]}if(!Number.isInteger(g[1])){if(!Number.isInteger(+g[1])||+g[1]<0)throw new TypeError(`ranges-apply: [THROW_ID_07] ranges array, second input arg. has ${c}th element, array ${JSON.stringify(g,null,0)}. Its second element is not an integer, string index, but ${typeof g[1]}, equal to: ${JSON.stringify(g[1],null,4)}.`);n[c][1]=+n[c][1]}s+=1});let h=Yt(n,{progressFn:g=>{r&&(i=10+Math.floor(g/10),i!==o&&(o=i,r(i)))}});Xt(h);let a=h.length;if(a>0){let g=e.slice(h[a-1][1]);e=h.reduce((c,T,m,u)=>{r&&(i=20+Math.floor(m/a*80),i!==o&&(o=i,r(i)));let y=m===0?0:u[m-1][1],d=u[m][0];return`${c}${e.slice(y,d)}${u[m][2]||""}`},""),e+=g}return e}var Zt=U(Ve(),1);var ui={classicTrim:!1,cr:!1,lf:!1,tab:!1,space:!0,nbsp:!1};function Q(e,t){if(typeof e!="string")throw new Error(`string-trim-spaces-only: [THROW_ID_01] input must be string! It was given as ${typeof e}, equal to:
32
+ To turn off this error being thrown, set resolvedOpts.throwWhenSomethingWrongIsDetected to Boolean false.`)}else{c={},c.headsStartAt=u,c.headsEndAt=u+f.length,g=!0,u+=f.length-1,T&&(T="");continue}let p=W(e,u,r);if(g&&p&&o.matchHeadsAndTailsStrictlyInPairsByTheirOrder&&m!==void 0&&r[m]!==void 0&&r[m]!==p){let w;for(let b=r.length;b--;)if(r[b]===p){w=b;break}throw new TypeError(`${o.source}${a?": [THROW_ID_20]":""} When processing "${e}", we had "resolvedOpts.matchHeadsAndTailsStrictlyInPairsByTheirOrder" on. We found heads (${t[m]}) but the tails the followed it were not of the same index, ${m} (${r[m]}) but ${w} (${p}).`)}if(typeof p=="string")if(g){c.tailsStartAt=u,c.tailsEndAt=u+p.length,s.push(c),c={},g=!1,u+=p.length-1;continue}else o.throwWhenSomethingWrongIsDetected&&(T=`${o.source}${a?": [THROW_ID_21]":""} When processing "${e}", we found tails (${e.slice(u,u+p.length)}) starting at character with index number "${u}" but there were no heads preceding it. That's very naughty!`)}if(o.throwWhenSomethingWrongIsDetected&&u===y-1){if(Object.keys(c).length!==0)throw new TypeError(`${o.source}${a?": [THROW_ID_22]":""} When processing "${e}", we reached the end of the string and yet didn't find any tails (${JSON.stringify(r,null,4)}) to match the last detected heads (${e.slice(c.headsStartAt,c.headsEndAt)})!`);if(T)throw new Error(T)}}return s}var Je=U(Ce(),1);function Be(e,t,r){let i;r!==void 0&&(i=Array.isArray(r)?(0,Je.default)(r):[(0,Je.default)(r)]);let o=[],n=ue(e,(l,a,h)=>{let s=a!==void 0?a:l;if(a!==void 0&&ge(l,t,{caseSensitive:!0})){if(i===void 0)o.push({val:a,path:h.path});else if(i.length)return i.shift()}return s});return i===void 0?o:n}function pe(e,t=1){let r="\xA0";function i(n){return Array.from(n).reverse().join("")}function o(n,l,a){let h=a?`
33
+ `:"\r",s=a?"\r":`
34
+ `;if(!n)return n;let g=0,c=0,T="";for(let m=0,u=n.length;m<u;m++)(n[m]===h||n[m]===s&&n[m-1]!==h)&&c++,`\r
35
+ `.includes(n[m])||n[m]===r?(g=0,n[m]===r?T+=n[m]:n[m]===h?c<=l&&(T+=n[m],n[m+1]===s&&(T+=n[m+1],m++)):n[m]===s&&(!n[m-1]||n[m-1]!==h)&&c<=l&&(T+=n[m])):(g++,!n[m+1]&&!c&&(T+=" "));return T}if(typeof e=="string"&&e.length){let n=1;typeof+t=="number"&&Number.isInteger(+t)&&+t>=0&&(n=+t);let l="",a="";if(!e.trim())l=e;else if(!e[0].trim()){for(let h=0,s=e.length;h<s;h++)if(e[h].trim()){l=e.slice(0,h);break}}if(e.trim()&&(e.slice(-1).trim()===""||e.slice(-1)===r)){for(let h=e.length;h--;)if(e[h].trim()){a=e.slice(h+1);break}}return`${o(l,n,!1)}${e.trim()}${i(o(i(a),n,!0))}`}return e}var ai={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function Ut(e,t){if(!Array.isArray(e)||!e.length)return e;let r=$($({},ai),t),i,o;if(r.strictlyTwoElementsInRangeArrays&&!e.every((a,h)=>!Array.isArray(a)||a.length!==2?(i=h,o=a.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, ${i}th range (${JSON.stringify(e[i],null,4)}) has not two but ${o} elements!`);if(!e.every((a,h)=>!Array.isArray(a)||!Number.isInteger(a[0])||a[0]<0||!Number.isInteger(a[1])||a[1]<0?(i=h,!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, ${i}th range (${JSON.stringify(e[i],null,4)}) does not consist of only natural numbers!`);let n=e.length**2,l=0;return Array.from(e).sort((a,h)=>(r.progressFn&&(l+=1,r.progressFn(Math.floor(l*100/n))),a[0]===h[0]?a[1]<h[1]?-1:a[1]>h[1]?1:0:a[0]<h[0]?-1:1))}var Gt={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function si(e,t){function r(s){return s&&typeof s=="object"&&!Array.isArray(s)}if(!Array.isArray(e)||!e.length)return null;let i;if(t)if(r(t)){if(i=$($({},Gt),t),i.progressFn&&r(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: "${typeof i.progressFn}", equal to ${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: "${typeof i.mergeType}", equal to ${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: "${typeof i.joinRangesThatTouchEdges}", equal to ${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:
36
+ ${JSON.stringify(t,null,4)} (type ${typeof t})`);else i=$({},Gt);let o=e.filter(s=>Array.isArray(s)).map(s=>[...s]).filter(s=>s[2]!==void 0||s[0]!==s[1]),n,l,a;i.progressFn?n=Ut(o,{progressFn:s=>{a=Math.floor(s/5),a!==l&&(l=a,i.progressFn(a))}}):n=Ut(o);let h=n.length-1;for(let s=h;s>0;s--)i.progressFn&&(a=Math.floor((1-s/h)*78)+21,a!==l&&a>l&&(l=a,i.progressFn(a))),(n[s][0]<=n[s-1][0]||!i.joinRangesThatTouchEdges&&n[s][0]<n[s-1][1]||i.joinRangesThatTouchEdges&&n[s][0]<=n[s-1][1])&&(n[s-1][0]=Math.min(n[s][0],n[s-1][0]),n[s-1][1]=Math.max(n[s][1],n[s-1][1]),n[s][2]!==void 0&&(n[s-1][0]>=n[s][0]||n[s-1][1]<=n[s][1])&&n[s-1][2]!==null&&(n[s][2]===null&&n[s-1][2]!==null?n[s-1][2]=null:n[s-1][2]!=null?+i.mergeType==2&&n[s-1][0]===n[s][0]?n[s-1][2]=n[s][2]:n[s-1][2]+=n[s][2]:n[s-1][2]=n[s][2]),n.splice(s,1),s=n.length);return n.length?n:null}function C(e){return e!=null}function V(e){return Number.isInteger(e)&&e>=0}function X(e){return typeof e=="string"}var oi={limitToBeAddedWhitespace:!1,limitLinebreaksCount:1,mergeType:1},Z=class{constructor(e){be(this,"ranges");be(this,"opts");let t=$($({},oi),e);if(t.mergeType&&t.mergeType!==1&&t.mergeType!==2)if(X(t.mergeType)&&t.mergeType.trim()==="1")t.mergeType=1;else if(X(t.mergeType)&&t.mergeType.trim()==="2")t.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: "${typeof t.mergeType}", equal to ${JSON.stringify(t.mergeType,null,4)}`);this.opts=t,this.ranges=[]}add(e,t,r){if(e==null&&t==null)return;if(C(e)&&!C(t)){if(Array.isArray(e)){if(e.length){if(e.some(n=>Array.isArray(n))){e.forEach(n=>{Array.isArray(n)&&this.add(...n)});return}e.length&&V(+e[0])&&V(+e[1])&&this.add(...e)}return}throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_12] the first input argument, "from" is set (${JSON.stringify(e,null,0)}) but second-one, "to" is not (${JSON.stringify(t,null,0)})`)}else if(!C(e)&&C(t))throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_13] the second input argument, "to" is set (${JSON.stringify(t,null,0)}) but first-one, "from" is not (${JSON.stringify(e,null,0)})`);let i=+e,o=+t;if(V(r)&&(r=String(r)),V(i)&&V(o)){if(C(r)&&!X(r)&&!V(r))throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_08] The third argument, the value to add, was given not as string but ${typeof r}, equal to:
37
+ ${JSON.stringify(r,null,4)}`);if(C(this.ranges)&&Array.isArray(this.last())&&i===this.last()[1]){if(this.last()[1]=o,this.last()[2],this.last()[2]!==null&&C(r)){let n=this.last()[2]&&this.last()[2].length&&(!this.opts||!this.opts.mergeType||this.opts.mergeType===1)?`${this.last()[2]}${r}`:r;this.opts.limitToBeAddedWhitespace&&(n=pe(n,this.opts.limitLinebreaksCount)),X(n)&&!n.length||(this.last()[2]=n)}}else{this.ranges||(this.ranges=[]);let n=r!==void 0&&!(X(r)&&!r.length)?[i,o,r&&this.opts.limitToBeAddedWhitespace?pe(r,this.opts.limitLinebreaksCount):r]:[i,o];this.ranges.push(n)}}else throw V(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 "${typeof o}" equal to: ${JSON.stringify(o,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 "${typeof i}" equal to: ${JSON.stringify(i,null,4)}`)}push(e,t,r){this.add(e,t,r)}current(){return Array.isArray(this.ranges)&&this.ranges.length?(this.ranges=si(this.ranges,{mergeType:this.opts.mergeType}),this.ranges&&this.opts.limitToBeAddedWhitespace?this.ranges.map(e=>C(e[2])?[e[0],e[1],pe(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])&&V(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, ${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 li={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function Fe(e,t){if(!Array.isArray(e)||!e.length)return e;let r=$($({},li),t),i,o;if(r.strictlyTwoElementsInRangeArrays&&!e.every((a,h)=>!Array.isArray(a)||a.length!==2?(i=h,o=a.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, ${i}th range (${JSON.stringify(e[i],null,4)}) has not two but ${o} elements!`);if(!e.every((a,h)=>!Array.isArray(a)||!Number.isInteger(a[0])||a[0]<0||!Number.isInteger(a[1])||a[1]<0?(i=h,!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, ${i}th range (${JSON.stringify(e[i],null,4)}) does not consist of only natural numbers!`);let n=e.length**2,l=0;return Array.from(e).sort((a,h)=>(r.progressFn&&(l+=1,r.progressFn(Math.floor(l*100/n))),a[0]===h[0]?a[1]<h[1]?-1:a[1]>h[1]?1:0:a[0]<h[0]?-1:1))}var zt={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function Yt(e,t){function r(s){return s&&typeof s=="object"&&!Array.isArray(s)}if(!Array.isArray(e)||!e.length)return null;let i;if(t)if(r(t)){if(i=$($({},zt),t),i.progressFn&&r(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: "${typeof i.progressFn}", equal to ${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: "${typeof i.mergeType}", equal to ${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: "${typeof i.joinRangesThatTouchEdges}", equal to ${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:
38
+ ${JSON.stringify(t,null,4)} (type ${typeof t})`);else i=$({},zt);let o=e.filter(s=>Array.isArray(s)).map(s=>[...s]).filter(s=>s[2]!==void 0||s[0]!==s[1]),n,l,a;i.progressFn?n=Fe(o,{progressFn:s=>{a=Math.floor(s/5),a!==l&&(l=a,i.progressFn(a))}}):n=Fe(o);let h=n.length-1;for(let s=h;s>0;s--)i.progressFn&&(a=Math.floor((1-s/h)*78)+21,a!==l&&a>l&&(l=a,i.progressFn(a))),(n[s][0]<=n[s-1][0]||!i.joinRangesThatTouchEdges&&n[s][0]<n[s-1][1]||i.joinRangesThatTouchEdges&&n[s][0]<=n[s-1][1])&&(n[s-1][0]=Math.min(n[s][0],n[s-1][0]),n[s-1][1]=Math.max(n[s][1],n[s-1][1]),n[s][2]!==void 0&&(n[s-1][0]>=n[s][0]||n[s-1][1]<=n[s][1])&&n[s-1][2]!==null&&(n[s][2]===null&&n[s-1][2]!==null?n[s-1][2]=null:n[s-1][2]!=null?+i.mergeType==2&&n[s-1][0]===n[s][0]?n[s-1][2]=n[s][2]:n[s-1][2]+=n[s][2]:n[s-1][2]=n[s][2]),n.splice(s,1),s=n.length);return n.length?n:null}var fi=!0,ke="Invariant failed";function Xt(e,t){if(!e){if(fi)throw new Error(ke);var r=typeof t=="function"?t():t,i=r?ke+": "+r:ke;throw new Error(i)}}function L(e,t,r){let i=0,o=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: ${typeof e}, equal to: ${JSON.stringify(e,null,4)}`);if(t&&!Array.isArray(t))throw new TypeError(`ranges-apply: [THROW_ID_03] second input argument must be an array (or null)! Currently it's: ${typeof t}, equal to: ${JSON.stringify(t,null,4)}`);if(r&&typeof r!="function")throw new TypeError(`ranges-apply: [THROW_ID_04] the third input argument must be a function (or falsey)! Currently it's: ${typeof r}, equal to: ${JSON.stringify(r,null,4)}`);if(!t||!t.filter(g=>g).length)return e;let n;Array.isArray(t)&&Number.isInteger(t[0])&&Number.isInteger(t[1])?n=[Array.from(t)]:n=Array.from(t);let l=n.length,a=0;n.filter(g=>g).forEach((g,c)=>{if(r&&(i=Math.floor(a/l*10),i!==o&&(o=i,r(i))),!Array.isArray(g))throw new TypeError(`ranges-apply: [THROW_ID_05] ranges array, second input arg., has ${c}th element not an array: ${JSON.stringify(g,null,4)}, which is ${typeof g}`);if(!Number.isInteger(g[0])){if(!Number.isInteger(+g[0])||+g[0]<0)throw new TypeError(`ranges-apply: [THROW_ID_06] ranges array, second input arg. has ${c}th element, array ${JSON.stringify(g,null,0)}. Its first element is not an integer, string index, but ${typeof g[0]}, equal to: ${JSON.stringify(g[0],null,4)}.`);n[c][0]=+n[c][0]}if(!Number.isInteger(g[1])){if(!Number.isInteger(+g[1])||+g[1]<0)throw new TypeError(`ranges-apply: [THROW_ID_07] ranges array, second input arg. has ${c}th element, array ${JSON.stringify(g,null,0)}. Its second element is not an integer, string index, but ${typeof g[1]}, equal to: ${JSON.stringify(g[1],null,4)}.`);n[c][1]=+n[c][1]}a+=1});let h=Yt(n,{progressFn:g=>{r&&(i=10+Math.floor(g/10),i!==o&&(o=i,r(i)))}});Xt(h);let s=h.length;if(s>0){let g=e.slice(h[s-1][1]);e=h.reduce((c,T,m,u)=>{r&&(i=20+Math.floor(m/s*80),i!==o&&(o=i,r(i)));let y=m===0?0:u[m-1][1],d=u[m][0];return`${c}${e.slice(y,d)}${u[m][2]||""}`},""),e+=g}return e}var Zt=U(Ve(),1);var ui={classicTrim:!1,cr:!1,lf:!1,tab:!1,space:!0,nbsp:!1};function Q(e,t){if(typeof e!="string")throw new Error(`string-trim-spaces-only: [THROW_ID_01] input must be string! It was given as ${typeof e}, equal to:
39
39
  ${JSON.stringify(e,null,4)}`);let r=$($({},ui),t);function i(l){return r.classicTrim&&!l.trim()||!r.classicTrim&&(r.space&&l===" "||r.cr&&l==="\r"||r.lf&&l===`
40
- `||r.tab&&l===" "||r.nbsp&&l==="\xA0")}let o,n;if(e.length){if(i(e[0]))for(let l=0,s=e.length;l<s;l++){if(!i(e[l])){o=l;break}if(l===e.length-1)return{res:"",ranges:[[0,e.length]]}}if(i(e[e.length-1])){for(let l=e.length;l--;)if(!i(e[l])){n=l+1;break}}return o?n?{res:e.slice(o,n),ranges:[[0,o],[n,e.length]]}:{res:e.slice(o),ranges:[[0,o]]}:n?{res:e.slice(0,n),ranges:[[n,e.length]]}:{res:e,ranges:[]}}return{res:"",ranges:[]}}var gi={heads:["{{"],tails:["}}"]};function Qt(e,t){let r=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(t&&!(0,Zt.default)(t))throw new Error(`string-remove-duplicate-heads-tails: [THROW_ID_03] The given options are not a plain object but ${typeof t}!`);let i=$({},t);if(i&&r.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 opts.heads contains elements which are not string-type!");if(i&&r.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 opts.tails contains elements which are not string-type!");let o=Q(e).res;if(o.length===0)return e;e=o;let n=$($({},gi),i);n.heads=n.heads.map(y=>y.trim()),n.tails=n.tails.map(y=>y.trim());let l=!1,s=!1,h=new Z({limitToBeAddedWhitespace:!0}),a=new Z({limitToBeAddedWhitespace:!0}),g=!0,c=!0,T="";function m(y,d){let f;return W(y,0,d.heads,{trimBeforeMatching:!0,cb:(p,w,b)=>(f=b,!0)})&&W(y,f,d.tails,{trimBeforeMatching:!0,cb:(p,w,b)=>(f=b,!0)})?y.slice(f):y}for(;e!==m(e,n);)e=Q(m(e,n)).res;function u(y,d){let f;return!k(y,y.length-1,d.tails,{trimBeforeMatching:!0,cb:(p,w,b)=>(f=b,!0)})||!f?y:k(y,f,d.heads,{trimBeforeMatching:!0,cb:(p,w,b)=>(f=b,!0)})?y.slice(0,f+1):y}for(;e!==u(e,n);)e=Q(u(e,n)).res;if(!n.heads.length||!W(e,0,n.heads,{trimBeforeMatching:!0})||!n.tails.length||!k(e,e.length-1,n.tails,{trimBeforeMatching:!0}))return Q(e).res;for(let y=0,d=e.length;y<d;y++)if(e[y].trim()!==""){let f;if(W(e,y,n.heads,{trimBeforeMatching:!0,cb:(p,w,b)=>(f=b,!0)})&&f){c=!0,g&&(g=!0);let p;W(e,f,n.tails,{trimBeforeMatching:!0,cb:(w,b,O)=>(p=O,!0)})&&h.push(y,p),a.current()&&l&&T!=="tails"&&h.push(a.current()),l||a.current()&&(h.push(a.current()),a.wipe()),a.push(y,f),T="heads",y=f-1;continue}if(W(e,y,n.tails,{trimBeforeMatching:!0,cb:(p,w,b)=>(f=Number.isInteger(b)?b:e.length,!0)})&&f){c=!0,g?(T==="heads"&&a.wipe(),g=!1):a.push(y,f),T="tails",y=f-1;continue}g&&(g=!0),c&&!l?(l=!0,c=!1):c&&!s?(s=!0,g=!0,c=!1,T==="heads"&&a.wipe()):c&&s&&a.wipe()}return a.current()&&h.push(a.current()),h.current()?L(e,h.current()).trim():e.trim()}var er="11.0.15";var hi=er,pi=Object.prototype.hasOwnProperty,nr={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 A(e){return typeof e=="string"}function di(e){return typeof e=="number"}function Le(e){return typeof e=="boolean"}function de(e){return e===null}function ee(e){return e&&typeof e=="object"&&!Array.isArray(e)}function yi(e){return e!=null}function _(e){return A(e)?e.trim():e}function mi(e){if(typeof e=="string"&&e.length&&e.indexOf(".")!==-1){for(let t=0,r=e.length;t<r;t++)if(e[t]===".")return e.slice(0,t)}return e}function wi(e){if(typeof e=="string"&&e.length&&e.indexOf(".")!==-1){for(let t=0,r=e.length;t<r;t++)if(e[t]===".")return e.slice(t+1)}return e}function ir(e){if(typeof e=="string"&&e.length&&e.indexOf(".")!==-1){for(let t=e.length;t--;)if(e[t]===".")return e.slice(0,t)}return e}function tr(e){if(typeof e=="string"&&e.length&&e.indexOf(".")!==-1){for(let t=e.length;t--;)if(e[t]===".")return e.slice(t+1)}return e}function qe(e,t){return typeof e!="string"||!e.trim()?!1:!!(e.includes(t.heads)||e.includes(t.tails)||A(t.headsNoWrap)&&t.headsNoWrap.length&&e.includes(t.headsNoWrap)||A(t.tailsNoWrap)&&t.tailsNoWrap.length&&e.includes(t.tailsNoWrap))}function bi(e,t,r){let i,o;return typeof e=="string"&&e.length&&W(e,0,t,{trimBeforeMatching:!0,cb:(n,l,s)=>(i=s,!0)})&&k(e,e.length-1,r,{trimBeforeMatching:!0,cb:(n,l,s)=>(o=+s+1,!0)})?e.slice(i,o):e}function rr(e,t,r=!1,i,o,n){if(t.wrapHeadsWith||(t.wrapHeadsWith=""),t.wrapTailsWith||(t.wrapTailsWith=""),A(e)&&!r&&t.wrapGlobalFlipSwitch&&!t.dontWrapVars.some(l=>ge(n,l))&&(!t.preventDoubleWrapping||t.preventDoubleWrapping&&A(e)&&!e.includes(t.wrapHeadsWith)&&!e.includes(t.wrapTailsWith)))return`${t.wrapHeadsWith}${e}${t.wrapTailsWith}`;if(r){if(!A(e))return e;let l=Qt(e,{heads:t.wrapHeadsWith,tails:t.wrapTailsWith});return A(l)?bi(l,t.wrapHeadsWith,t.wrapTailsWith):l}return e}function Ti(e,t,r,i){let o;if(r.indexOf(".")!==-1){let n=r,l=!0;if(i.lookForDataContainers&&typeof i.dataContainerIdentifierTails=="string"&&i.dataContainerIdentifierTails.length&&!n.endsWith(i.dataContainerIdentifierTails)){let s=D.default.get(e,n+i.dataContainerIdentifierTails);ee(s)&&D.default.get(s,t)&&(o=D.default.get(s,t),l=!1)}for(;l&&n.indexOf(".")!==-1;){if(n=ir(n),tr(n)===t)throw new Error(`json-variables/findValues(): [THROW_ID_20] While trying to resolve: "${t}" at path "${r}", we encountered a closed loop. The parent key "${tr(n)}" is called the same as the variable "${t}" we're looking for.`);if(i.lookForDataContainers&&typeof i.dataContainerIdentifierTails=="string"&&i.dataContainerIdentifierTails.length&&!n.endsWith(i.dataContainerIdentifierTails)){let s=D.default.get(e,n+i.dataContainerIdentifierTails);ee(s)&&D.default.get(s,t)&&(o=D.default.get(s,t),l=!1)}if(o===void 0){let s=D.default.get(e,n);ee(s)&&D.default.get(s,t)&&(o=D.default.get(s,t),l=!1)}}}if(o===void 0){let n=D.default.get(e,t);n!==void 0&&(o=n)}if(o===void 0)if(t.indexOf(".")===-1){let n=Be(e,t);if(n.length){for(let l=0,s=n.length;l<s;l++)if(A(n[l].val)||Le(n[l].val)||de(n[l].val)){o=n[l].val;break}else if(di(n[l].val)){o=String(n[l].val);break}else if(Array.isArray(n[l].val)){o=n[l].val.join("");break}}}else{let n=Be(e,mi(t));if(n.length)for(let l=0,s=n.length;l<s;l++){let h=D.default.get(n[l].val,wi(t));h&&A(h)&&(o=h)}}return o}function sr(e,t,r,i,o=[]){if(o.includes(r)){let m="";if(o.length>1){let u=` \u2192
40
+ `||r.tab&&l===" "||r.nbsp&&l==="\xA0")}let o,n;if(e.length){if(i(e[0]))for(let l=0,a=e.length;l<a;l++){if(!i(e[l])){o=l;break}if(l===e.length-1)return{res:"",ranges:[[0,e.length]]}}if(i(e[e.length-1])){for(let l=e.length;l--;)if(!i(e[l])){n=l+1;break}}return o?n?{res:e.slice(o,n),ranges:[[0,o],[n,e.length]]}:{res:e.slice(o),ranges:[[0,o]]}:n?{res:e.slice(0,n),ranges:[[n,e.length]]}:{res:e,ranges:[]}}return{res:"",ranges:[]}}var gi={heads:["{{"],tails:["}}"]};function Qt(e,t){let r=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(t&&!(0,Zt.default)(t))throw new Error(`string-remove-duplicate-heads-tails: [THROW_ID_03] The given options are not a plain object but ${typeof t}!`);let i=$({},t);if(i&&r.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&&r.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 o=Q(e).res;if(o.length===0)return e;e=o;let n=$($({},gi),i);n.heads=n.heads.map(y=>y.trim()),n.tails=n.tails.map(y=>y.trim());let l=!1,a=!1,h=new Z({limitToBeAddedWhitespace:!0}),s=new Z({limitToBeAddedWhitespace:!0}),g=!0,c=!0,T="";function m(y,d){let f;return W(y,0,d.heads,{trimBeforeMatching:!0,cb:(p,w,b)=>(f=b,!0)})&&W(y,f,d.tails,{trimBeforeMatching:!0,cb:(p,w,b)=>(f=b,!0)})?y.slice(f):y}for(;e!==m(e,n);)e=Q(m(e,n)).res;function u(y,d){let f;return!k(y,y.length-1,d.tails,{trimBeforeMatching:!0,cb:(p,w,b)=>(f=b,!0)})||!f?y:k(y,f,d.heads,{trimBeforeMatching:!0,cb:(p,w,b)=>(f=b,!0)})?y.slice(0,f+1):y}for(;e!==u(e,n);)e=Q(u(e,n)).res;if(!n.heads.length||!W(e,0,n.heads,{trimBeforeMatching:!0})||!n.tails.length||!k(e,e.length-1,n.tails,{trimBeforeMatching:!0}))return Q(e).res;for(let y=0,d=e.length;y<d;y++)if(e[y].trim()!==""){let f;if(W(e,y,n.heads,{trimBeforeMatching:!0,cb:(p,w,b)=>(f=b,!0)})&&f){c=!0,g&&(g=!0);let p;W(e,f,n.tails,{trimBeforeMatching:!0,cb:(w,b,O)=>(p=O,!0)})&&h.push(y,p),s.current()&&l&&T!=="tails"&&h.push(s.current()),l||s.current()&&(h.push(s.current()),s.wipe()),s.push(y,f),T="heads",y=f-1;continue}if(W(e,y,n.tails,{trimBeforeMatching:!0,cb:(p,w,b)=>(f=Number.isInteger(b)?b:e.length,!0)})&&f){c=!0,g?(T==="heads"&&s.wipe(),g=!1):s.push(y,f),T="tails",y=f-1;continue}g&&(g=!0),c&&!l?(l=!0,c=!1):c&&!a?(a=!0,g=!0,c=!1,T==="heads"&&s.wipe()):c&&a&&s.wipe()}return s.current()&&h.push(s.current()),h.current()?L(e,h.current()).trim():e.trim()}var er="11.0.16";var hi=er,pi=Object.prototype.hasOwnProperty,nr={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 A(e){return typeof e=="string"}function di(e){return typeof e=="number"}function Le(e){return typeof e=="boolean"}function de(e){return e===null}function ee(e){return e&&typeof e=="object"&&!Array.isArray(e)}function yi(e){return e!=null}function _(e){return A(e)?e.trim():e}function mi(e){if(typeof e=="string"&&e.length&&e.indexOf(".")!==-1){for(let t=0,r=e.length;t<r;t++)if(e[t]===".")return e.slice(0,t)}return e}function wi(e){if(typeof e=="string"&&e.length&&e.indexOf(".")!==-1){for(let t=0,r=e.length;t<r;t++)if(e[t]===".")return e.slice(t+1)}return e}function ir(e){if(typeof e=="string"&&e.length&&e.indexOf(".")!==-1){for(let t=e.length;t--;)if(e[t]===".")return e.slice(0,t)}return e}function tr(e){if(typeof e=="string"&&e.length&&e.indexOf(".")!==-1){for(let t=e.length;t--;)if(e[t]===".")return e.slice(t+1)}return e}function qe(e,t){return typeof e!="string"||!e.trim()?!1:!!(e.includes(t.heads)||e.includes(t.tails)||A(t.headsNoWrap)&&t.headsNoWrap.length&&e.includes(t.headsNoWrap)||A(t.tailsNoWrap)&&t.tailsNoWrap.length&&e.includes(t.tailsNoWrap))}function bi(e,t,r){let i,o;return typeof e=="string"&&e.length&&W(e,0,t,{trimBeforeMatching:!0,cb:(n,l,a)=>(i=a,!0)})&&k(e,e.length-1,r,{trimBeforeMatching:!0,cb:(n,l,a)=>(o=+a+1,!0)})?e.slice(i,o):e}function rr(e,t,r=!1,i,o,n){if(t.wrapHeadsWith||(t.wrapHeadsWith=""),t.wrapTailsWith||(t.wrapTailsWith=""),A(e)&&!r&&t.wrapGlobalFlipSwitch&&!t.dontWrapVars.some(l=>ge(n,l))&&(!t.preventDoubleWrapping||t.preventDoubleWrapping&&A(e)&&!e.includes(t.wrapHeadsWith)&&!e.includes(t.wrapTailsWith)))return`${t.wrapHeadsWith}${e}${t.wrapTailsWith}`;if(r){if(!A(e))return e;let l=Qt(e,{heads:t.wrapHeadsWith,tails:t.wrapTailsWith});return A(l)?bi(l,t.wrapHeadsWith,t.wrapTailsWith):l}return e}function Ti(e,t,r,i){let o;if(r.indexOf(".")!==-1){let n=r,l=!0;if(i.lookForDataContainers&&typeof i.dataContainerIdentifierTails=="string"&&i.dataContainerIdentifierTails.length&&!n.endsWith(i.dataContainerIdentifierTails)){let a=D.default.get(e,n+i.dataContainerIdentifierTails);ee(a)&&D.default.get(a,t)&&(o=D.default.get(a,t),l=!1)}for(;l&&n.indexOf(".")!==-1;){if(n=ir(n),tr(n)===t)throw new Error(`json-variables/findValues(): [THROW_ID_20] While trying to resolve: "${t}" at path "${r}", we encountered a closed loop. The parent key "${tr(n)}" is called the same as the variable "${t}" we're looking for.`);if(i.lookForDataContainers&&typeof i.dataContainerIdentifierTails=="string"&&i.dataContainerIdentifierTails.length&&!n.endsWith(i.dataContainerIdentifierTails)){let a=D.default.get(e,n+i.dataContainerIdentifierTails);ee(a)&&D.default.get(a,t)&&(o=D.default.get(a,t),l=!1)}if(o===void 0){let a=D.default.get(e,n);ee(a)&&D.default.get(a,t)&&(o=D.default.get(a,t),l=!1)}}}if(o===void 0){let n=D.default.get(e,t);n!==void 0&&(o=n)}if(o===void 0)if(t.indexOf(".")===-1){let n=Be(e,t);if(n.length){for(let l=0,a=n.length;l<a;l++)if(A(n[l].val)||Le(n[l].val)||de(n[l].val)){o=n[l].val;break}else if(di(n[l].val)){o=String(n[l].val);break}else if(Array.isArray(n[l].val)){o=n[l].val.join("");break}}}else{let n=Be(e,mi(t));if(n.length)for(let l=0,a=n.length;l<a;l++){let h=D.default.get(n[l].val,wi(t));h&&A(h)&&(o=h)}}return o}function ar(e,t,r,i,o=[]){if(o.includes(r)){let m="";if(o.length>1){let u=` \u2192
41
41
  `;m=o.reduce((y,d,f)=>y+(f===0?"":u)+(d===r?"\u{1F4A5} ":" ")+d,` Here's the path we travelled up until we hit the recursion:
42
42
 
43
- `),m+=`${u}\u{1F4A5} ${r}`}throw new Error(`json-variables/resolveString(): [THROW_ID_19] While trying to resolve: "${t}" at path "${r}", we encountered a closed loop, the key is referencing itself."${m}`)}let n={},l=Array.from(o);l.push(r);let s=new Z;function h(m,u,y){for(let d=0,f=m.length;d<f;d++){let p=m[d],w=t.slice(p.headsEndAt,p.tailsStartAt);if(w.length===0)s.push(p.headsStartAt,p.tailsEndAt);else if(pi.call(n,w)&&A(n[w]))s.push(p.headsStartAt,p.tailsEndAt,n[w]);else{let b=Ti(e,w.trim(),r,i);if(b===void 0)if(i.allowUnresolved===!0)b="";else if(typeof i.allowUnresolved=="string")b=i.allowUnresolved;else throw new Error(`json-variables/processHeadsAndTails(): [THROW_ID_18] We couldn't find the value to resolve the variable ${t.slice(p.headsEndAt,p.tailsStartAt)}. We're at path: "${r}".`);if(!y&&i.throwWhenNonStringInsertedInString&&!A(b))throw new Error(`json-variables/processHeadsAndTails(): [THROW_ID_23] While resolving the variable ${t.slice(p.headsEndAt,p.tailsStartAt)} at path ${r}, it resolved into a non-string value, ${JSON.stringify(b,null,4)}. This is happening because options setting "throwWhenNonStringInsertedInString" is active (set to "true").`);if(Le(b)){if(i.resolveToBoolIfAnyValuesContainBool)return s.wipe(),i.resolveToFalseIfAnyValuesContainBool?!1:b;b=""}else{if(de(b)&&y)return s.wipe(),b;Array.isArray(b)?b=String(b.join("")):de(b)?b="":b=String(b)}let O=r.includes(".")?`${ir(r)}.${w}`:w;if(qe(b,i)){let E=rr(sr(e,b,O,i,l),i,u,l,O,w.trim());typeof E=="string"&&s.push(p.headsStartAt,p.tailsEndAt,E)}else{n[w]=b;let E=rr(b,i,u,l,O,w.trim());typeof E=="string"&&s.push(p.headsStartAt,p.tailsEndAt,E)}}}}let a;try{a=Pe(t,i.heads,i.tails,{source:"",throwWhenSomethingWrongIsDetected:!1})}catch(m){throw new Error(`json-variables/resolveString(): [THROW_ID_17] While trying to resolve string: "${t}" at path ${r}, something wrong with heads and tails was detected! Here's the internal error message:
44
- ${m}`)}let g=!1;a.length===1&&L(t,[[a[0].headsStartAt,a[0].tailsEndAt]]).trim()===""&&(g=!0);let c=h(a,!1,g);if(typeof c=="boolean"||c===null)return c;try{a=Pe(t,i.headsNoWrap,i.tailsNoWrap,{source:"",throwWhenSomethingWrongIsDetected:!1})}catch(m){throw new Error(`json-variables/resolveString(): [THROW_ID_22] While trying to resolve string: "${t}" at path ${r}, something wrong with no-wrap heads and no-wrap tails was detected! Here's the internal error message:
45
- ${m}`)}a.length===1&&L(t,[[a[0].headsStartAt,a[0].tailsEndAt]]).trim()===""&&(g=!0);let T=h(a,!0,g);return Le(T)||de(T)?T:s!=null&&s.current()?L(t,s.current()):t}function $i(e,t){if(!arguments.length)throw new Error("json-variables/jVar(): [THROW_ID_01] Alas! Inputs are missing!");if(!ee(e))throw new TypeError(`json-variables/jVar(): [THROW_ID_02] Alas! The input must be a plain object! Currently it's: ${Array.isArray(e)?"array":typeof e}`);if(t&&!ee(t))throw new TypeError(`json-variables/jVar(): [THROW_ID_03] Alas! An Optional Options Object must be a plain object! Currently it's: ${Array.isArray(t)?"array":typeof t}`);let r=$($({},nr),t);r.dontWrapVars?Array.isArray(r.dontWrapVars)||(r.dontWrapVars=I(r.dontWrapVars)):r.dontWrapVars=[];let i,o;if(r.dontWrapVars.length&&!r.dontWrapVars.every((l,s)=>A(l)?!0:(i=l,o=s,!1)))throw new Error(`json-variables/jVar(): [THROW_ID_05] Alas! All variable names set in opts.dontWrapVars should be of a string type. Computer detected a value "${i}" at index ${o}, which is not string but ${Array.isArray(i)?"array":typeof i}!`);if(r.heads==="")throw new Error("json-variables/jVar(): [THROW_ID_06] Alas! opts.heads are empty!");if(r.tails==="")throw new Error("json-variables/jVar(): [THROW_ID_07] Alas! opts.tails are empty!");if(r.lookForDataContainers&&r.dataContainerIdentifierTails==="")throw new Error("json-variables/jVar(): [THROW_ID_08] Alas! opts.dataContainerIdentifierTails is empty!");if(r.heads===r.tails)throw new Error("json-variables/jVar(): [THROW_ID_09] Alas! opts.heads and opts.tails can't be equal!");if(r.heads===r.headsNoWrap)throw new Error("json-variables/jVar(): [THROW_ID_10] Alas! opts.heads and opts.headsNoWrap can't be equal!");if(r.tails===r.tailsNoWrap)throw new Error("json-variables/jVar(): [THROW_ID_11] Alas! opts.tails and opts.tailsNoWrap can't be equal!");if(r.headsNoWrap==="")throw new Error("json-variables/jVar(): [THROW_ID_12] Alas! opts.headsNoWrap is an empty string!");if(r.tailsNoWrap==="")throw new Error("json-variables/jVar(): [THROW_ID_13] Alas! opts.tailsNoWrap is an empty string!");if(r.headsNoWrap===r.tailsNoWrap)throw new Error("json-variables/jVar(): [THROW_ID_14] Alas! opts.headsNoWrap and opts.tailsNoWrap can't be equal!");let n;return ue(e,(l,s,h)=>{if(yi(s)&&qe(l,r))throw new Error(`json-variables/jVar(): [THROW_ID_15] Alas! Object keys can't contain variables!
46
- Please check the following key: ${l}`);if(s!==void 0?n=s:n=l,n==="")return n;if(r.heads.length!==0&&_(n)===_(r.heads)||r.tails.length!==0&&_(n)===_(r.tails)||r.headsNoWrap.length!==0&&_(n)===_(r.headsNoWrap)||r.tailsNoWrap.length!==0&&_(n)===_(r.tailsNoWrap)){if(!r.noSingleMarkers)return n;throw new Error(`json-variables/jVar(): [THROW_ID_16] Alas! While processing the input, we stumbled upon ${_(n)} which is equal to ${_(n)===_(r.heads)?"heads":""}${_(n)===_(r.tails)?"tails":""}${A(r.headsNoWrap)&&_(n)===_(r.headsNoWrap)?"headsNoWrap":""}${A(r.tailsNoWrap)&&_(n)===_(r.tailsNoWrap)?"tailsNoWrap":""}. If you wouldn't have set opts.noSingleMarkers to "true" this error would not happen and computer would have left the current element (${_(n)}) alone`)}return A(n)&&qe(n,r)?sr(e,n,h.path,r):n})}return pr(vi);})();
43
+ `),m+=`${u}\u{1F4A5} ${r}`}throw new Error(`json-variables/resolveString(): [THROW_ID_19] While trying to resolve: "${t}" at path "${r}", we encountered a closed loop, the key is referencing itself."${m}`)}let n={},l=Array.from(o);l.push(r);let a=new Z;function h(m,u,y){for(let d=0,f=m.length;d<f;d++){let p=m[d],w=t.slice(p.headsEndAt,p.tailsStartAt);if(w.length===0)a.push(p.headsStartAt,p.tailsEndAt);else if(pi.call(n,w)&&A(n[w]))a.push(p.headsStartAt,p.tailsEndAt,n[w]);else{let b=Ti(e,w.trim(),r,i);if(b===void 0)if(i.allowUnresolved===!0)b="";else if(typeof i.allowUnresolved=="string")b=i.allowUnresolved;else throw new Error(`json-variables/processHeadsAndTails(): [THROW_ID_18] We couldn't find the value to resolve the variable ${t.slice(p.headsEndAt,p.tailsStartAt)}. We're at path: "${r}".`);if(!y&&i.throwWhenNonStringInsertedInString&&!A(b))throw new Error(`json-variables/processHeadsAndTails(): [THROW_ID_23] While resolving the variable ${t.slice(p.headsEndAt,p.tailsStartAt)} at path ${r}, it resolved into a non-string value, ${JSON.stringify(b,null,4)}. This is happening because options setting "throwWhenNonStringInsertedInString" is active (set to "true").`);if(Le(b)){if(i.resolveToBoolIfAnyValuesContainBool)return a.wipe(),i.resolveToFalseIfAnyValuesContainBool?!1:b;b=""}else{if(de(b)&&y)return a.wipe(),b;Array.isArray(b)?b=String(b.join("")):de(b)?b="":b=String(b)}let O=r.includes(".")?`${ir(r)}.${w}`:w;if(qe(b,i)){let E=rr(ar(e,b,O,i,l),i,u,l,O,w.trim());typeof E=="string"&&a.push(p.headsStartAt,p.tailsEndAt,E)}else{n[w]=b;let E=rr(b,i,u,l,O,w.trim());typeof E=="string"&&a.push(p.headsStartAt,p.tailsEndAt,E)}}}}let s;try{s=Pe(t,i.heads,i.tails,{source:"",throwWhenSomethingWrongIsDetected:!1})}catch(m){throw new Error(`json-variables/resolveString(): [THROW_ID_17] While trying to resolve string: "${t}" at path ${r}, something wrong with heads and tails was detected! Here's the internal error message:
44
+ ${m}`)}let g=!1;s.length===1&&L(t,[[s[0].headsStartAt,s[0].tailsEndAt]]).trim()===""&&(g=!0);let c=h(s,!1,g);if(typeof c=="boolean"||c===null)return c;try{s=Pe(t,i.headsNoWrap,i.tailsNoWrap,{source:"",throwWhenSomethingWrongIsDetected:!1})}catch(m){throw new Error(`json-variables/resolveString(): [THROW_ID_22] While trying to resolve string: "${t}" at path ${r}, something wrong with no-wrap heads and no-wrap tails was detected! Here's the internal error message:
45
+ ${m}`)}s.length===1&&L(t,[[s[0].headsStartAt,s[0].tailsEndAt]]).trim()===""&&(g=!0);let T=h(s,!0,g);return Le(T)||de(T)?T:a!=null&&a.current()?L(t,a.current()):t}function $i(e,t){if(!arguments.length)throw new Error("json-variables/jVar(): [THROW_ID_01] Alas! Inputs are missing!");if(!ee(e))throw new TypeError(`json-variables/jVar(): [THROW_ID_02] Alas! The input must be a plain object! Currently it's: ${Array.isArray(e)?"array":typeof e}`);if(t&&!ee(t))throw new TypeError(`json-variables/jVar(): [THROW_ID_03] Alas! An Optional Options Object must be a plain object! Currently it's: ${Array.isArray(t)?"array":typeof t}`);let r=$($({},nr),t);r.dontWrapVars?Array.isArray(r.dontWrapVars)||(r.dontWrapVars=I(r.dontWrapVars)):r.dontWrapVars=[];let i,o;if(r.dontWrapVars.length&&!r.dontWrapVars.every((l,a)=>A(l)?!0:(i=l,o=a,!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 "${i}" at index ${o}, which is not string but ${Array.isArray(i)?"array":typeof i}!`);if(r.heads==="")throw new Error("json-variables/jVar(): [THROW_ID_06] Alas! resolvedOpts.heads are empty!");if(r.tails==="")throw new Error("json-variables/jVar(): [THROW_ID_07] Alas! resolvedOpts.tails are empty!");if(r.lookForDataContainers&&r.dataContainerIdentifierTails==="")throw new Error("json-variables/jVar(): [THROW_ID_08] Alas! resolvedOpts.dataContainerIdentifierTails is empty!");if(r.heads===r.tails)throw new Error("json-variables/jVar(): [THROW_ID_09] Alas! resolvedOpts.heads and resolvedOpts.tails can't be equal!");if(r.heads===r.headsNoWrap)throw new Error("json-variables/jVar(): [THROW_ID_10] Alas! resolvedOpts.heads and resolvedOpts.headsNoWrap can't be equal!");if(r.tails===r.tailsNoWrap)throw new Error("json-variables/jVar(): [THROW_ID_11] Alas! resolvedOpts.tails and resolvedOpts.tailsNoWrap can't be equal!");if(r.headsNoWrap==="")throw new Error("json-variables/jVar(): [THROW_ID_12] Alas! resolvedOpts.headsNoWrap is an empty string!");if(r.tailsNoWrap==="")throw new Error("json-variables/jVar(): [THROW_ID_13] Alas! resolvedOpts.tailsNoWrap is an empty string!");if(r.headsNoWrap===r.tailsNoWrap)throw new Error("json-variables/jVar(): [THROW_ID_14] Alas! resolvedOpts.headsNoWrap and resolvedOpts.tailsNoWrap can't be equal!");let n;return ue(e,(l,a,h)=>{if(yi(a)&&qe(l,r))throw new Error(`json-variables/jVar(): [THROW_ID_15] Alas! Object keys can't contain variables!
46
+ Please check the following key: ${l}`);if(a!==void 0?n=a:n=l,n==="")return n;if(r.heads.length&&_(n)===_(r.heads)||r.tails.length&&_(n)===_(r.tails)||r.headsNoWrap.length&&_(n)===_(r.headsNoWrap)||r.tailsNoWrap.length&&_(n)===_(r.tailsNoWrap)){if(!r.noSingleMarkers)return n;throw new Error(`json-variables/jVar(): [THROW_ID_16] Alas! While processing the input, we stumbled upon ${_(n)} which is equal to ${_(n)===_(r.heads)?"heads":""}${_(n)===_(r.tails)?"tails":""}${A(r.headsNoWrap)&&_(n)===_(r.headsNoWrap)?"headsNoWrap":""}${A(r.tailsNoWrap)&&_(n)===_(r.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 (${_(n)}) alone`)}return A(n)&&qe(n,r)?ar(e,n,h.path,r):n})}return pr(vi);})();
47
47
  /**
48
48
  * @name arrayiffy-if-string
49
49
  * @fileoverview Put non-empty strings into arrays, turn empty-ones into empty arrays. Bypass everything else.
50
- * @version 4.0.12
50
+ * @version 4.0.13
51
51
  * @author Roy Revelt, Codsen Ltd
52
52
  * @license MIT
53
53
  * {@link https://codsen.com/os/arrayiffy-if-string/}
@@ -55,7 +55,7 @@ Please check the following key: ${l}`);if(s!==void 0?n=s:n=l,n==="")return n;if(
55
55
  /**
56
56
  * @name ast-get-values-by-key
57
57
  * @fileoverview Extract values and paths from AST by keys OR set them by keys
58
- * @version 4.0.12
58
+ * @version 4.0.13
59
59
  * @author Roy Revelt, Codsen Ltd
60
60
  * @license MIT
61
61
  * {@link https://codsen.com/os/ast-get-values-by-key/}
@@ -63,7 +63,7 @@ Please check the following key: ${l}`);if(s!==void 0?n=s:n=l,n==="")return n;if(
63
63
  /**
64
64
  * @name ast-monkey-traverse
65
65
  * @fileoverview Utility library to traverse AST
66
- * @version 3.0.12
66
+ * @version 3.0.13
67
67
  * @author Roy Revelt, Codsen Ltd
68
68
  * @license MIT
69
69
  * {@link https://codsen.com/os/ast-monkey-traverse/}
@@ -71,7 +71,7 @@ Please check the following key: ${l}`);if(s!==void 0?n=s:n=l,n==="")return n;if(
71
71
  /**
72
72
  * @name ast-monkey-util
73
73
  * @fileoverview Utility library of AST helper functions
74
- * @version 2.0.12
74
+ * @version 2.0.13
75
75
  * @author Roy Revelt, Codsen Ltd
76
76
  * @license MIT
77
77
  * {@link https://codsen.com/os/ast-monkey-util/}
@@ -79,7 +79,7 @@ Please check the following key: ${l}`);if(s!==void 0?n=s:n=l,n==="")return n;if(
79
79
  /**
80
80
  * @name ranges-apply
81
81
  * @fileoverview Take an array of string index ranges, delete/replace the string according to them
82
- * @version 6.1.1
82
+ * @version 6.1.2
83
83
  * @author Roy Revelt, Codsen Ltd
84
84
  * @license MIT
85
85
  * {@link https://codsen.com/os/ranges-apply/}
@@ -87,7 +87,7 @@ Please check the following key: ${l}`);if(s!==void 0?n=s:n=l,n==="")return n;if(
87
87
  /**
88
88
  * @name ranges-merge
89
89
  * @fileoverview Merge and sort string index ranges
90
- * @version 8.1.1
90
+ * @version 8.1.2
91
91
  * @author Roy Revelt, Codsen Ltd
92
92
  * @license MIT
93
93
  * {@link https://codsen.com/os/ranges-merge/}
@@ -95,7 +95,7 @@ Please check the following key: ${l}`);if(s!==void 0?n=s:n=l,n==="")return n;if(
95
95
  /**
96
96
  * @name ranges-push
97
97
  * @fileoverview Gather string index ranges
98
- * @version 6.1.1
98
+ * @version 6.1.2
99
99
  * @author Roy Revelt, Codsen Ltd
100
100
  * @license MIT
101
101
  * {@link https://codsen.com/os/ranges-push/}
@@ -103,7 +103,7 @@ Please check the following key: ${l}`);if(s!==void 0?n=s:n=l,n==="")return n;if(
103
103
  /**
104
104
  * @name ranges-sort
105
105
  * @fileoverview Sort string index ranges
106
- * @version 5.0.12
106
+ * @version 5.0.13
107
107
  * @author Roy Revelt, Codsen Ltd
108
108
  * @license MIT
109
109
  * {@link https://codsen.com/os/ranges-sort/}
@@ -111,7 +111,7 @@ Please check the following key: ${l}`);if(s!==void 0?n=s:n=l,n==="")return n;if(
111
111
  /**
112
112
  * @name string-collapse-leading-whitespace
113
113
  * @fileoverview Collapse the leading and trailing whitespace of a string
114
- * @version 6.0.13
114
+ * @version 6.0.14
115
115
  * @author Roy Revelt, Codsen Ltd
116
116
  * @license MIT
117
117
  * {@link https://codsen.com/os/string-collapse-leading-whitespace/}
@@ -119,7 +119,7 @@ Please check the following key: ${l}`);if(s!==void 0?n=s:n=l,n==="")return n;if(
119
119
  /**
120
120
  * @name string-find-heads-tails
121
121
  * @fileoverview Finds where are arbitrary templating marker heads and tails located
122
- * @version 5.0.15
122
+ * @version 5.0.16
123
123
  * @author Roy Revelt, Codsen Ltd
124
124
  * @license MIT
125
125
  * {@link https://codsen.com/os/string-find-heads-tails/}
@@ -127,7 +127,7 @@ Please check the following key: ${l}`);if(s!==void 0?n=s:n=l,n==="")return n;if(
127
127
  /**
128
128
  * @name string-match-left-right
129
129
  * @fileoverview Match substrings on the left or right of a given index, ignoring whitespace
130
- * @version 8.1.1
130
+ * @version 8.1.2
131
131
  * @author Roy Revelt, Codsen Ltd
132
132
  * @license MIT
133
133
  * {@link https://codsen.com/os/string-match-left-right/}
@@ -135,7 +135,7 @@ Please check the following key: ${l}`);if(s!==void 0?n=s:n=l,n==="")return n;if(
135
135
  /**
136
136
  * @name string-remove-duplicate-heads-tails
137
137
  * @fileoverview Detect and (recursively) remove head and tail wrappings around the input string
138
- * @version 6.0.15
138
+ * @version 6.0.16
139
139
  * @author Roy Revelt, Codsen Ltd
140
140
  * @license MIT
141
141
  * {@link https://codsen.com/os/string-remove-duplicate-heads-tails/}
@@ -143,7 +143,7 @@ Please check the following key: ${l}`);if(s!==void 0?n=s:n=l,n==="")return n;if(
143
143
  /**
144
144
  * @name string-trim-spaces-only
145
145
  * @fileoverview Like String.trim() but you can choose granularly what to trim
146
- * @version 4.0.12
146
+ * @version 4.0.13
147
147
  * @author Roy Revelt, Codsen Ltd
148
148
  * @license MIT
149
149
  * {@link https://codsen.com/os/string-trim-spaces-only/}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "json-variables",
3
- "version": "11.0.15",
3
+ "version": "11.0.16",
4
4
  "description": "Resolves custom-marked, cross-referenced paths in parsed JSON",
5
5
  "keywords": [
6
6
  "comb",
@@ -75,15 +75,15 @@
75
75
  "various": {}
76
76
  },
77
77
  "dependencies": {
78
- "arrayiffy-if-string": "^4.0.12",
79
- "ast-get-values-by-key": "^4.0.12",
80
- "ast-monkey-traverse": "^3.0.12",
78
+ "arrayiffy-if-string": "^4.0.13",
79
+ "ast-get-values-by-key": "^4.0.13",
80
+ "ast-monkey-traverse": "^3.0.13",
81
81
  "matcher": "^5.0.0",
82
82
  "object-path": "^0.11.8",
83
- "ranges-apply": "^6.1.1",
84
- "ranges-push": "^6.1.1",
85
- "string-find-heads-tails": "^5.0.15",
86
- "string-match-left-right": "^8.1.1",
87
- "string-remove-duplicate-heads-tails": "^6.0.15"
83
+ "ranges-apply": "^6.1.2",
84
+ "ranges-push": "^6.1.2",
85
+ "string-find-heads-tails": "^5.0.16",
86
+ "string-match-left-right": "^8.1.2",
87
+ "string-remove-duplicate-heads-tails": "^6.0.16"
88
88
  }
89
89
  }
package/types/index.d.ts CHANGED
@@ -24,6 +24,6 @@ declare const defaults: Opts;
24
24
  /**
25
25
  * Resolves custom-marked, cross-referenced paths in parsed JSON
26
26
  */
27
- declare function jVar(input: Obj, originalOpts?: Partial<Opts>): Obj;
27
+ declare function jVar(input: Obj, opts?: Partial<Opts>): Obj;
28
28
 
29
29
  export { defaults, jVar, version };