json-variables 11.0.18 → 11.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/json-variables.esm.js +7 -7
- package/dist/json-variables.umd.js +17 -17
- package/package.json +10 -10
- package/types/index.d.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,13 @@
|
|
|
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.1.0 (2022-08-12)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- export types ([29de20c](https://github.com/codsen/codsen/commit/29de20cec94673562d76ee6a92e12243588b7376))
|
|
11
|
+
- export types ([11b5fb9](https://github.com/codsen/codsen/commit/11b5fb936ce20e0a77c3a09806773e1cd7695c50))
|
|
12
|
+
|
|
6
13
|
## 11.0.16 (2022-04-18)
|
|
7
14
|
|
|
8
15
|
### Bug Fixes
|
|
@@ -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.
|
|
4
|
+
* @version 11.1.1
|
|
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 C}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.
|
|
11
|
-
`;c=i.reduce((D,b,S)=>D+(S===0?"":w)+(b===
|
|
10
|
+
import{traverse as C}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.1.1";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 g(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 V(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function z(e){return e!=null}function u(e){return g(e)?e.trim():e}function Y(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 Q(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 J(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 P(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 T(e,t){return typeof e!="string"||!e.trim()?!1:!!(e.includes(t.heads)||e.includes(t.tails)||g(t.headsNoWrap)&&t.headsNoWrap.length&&e.includes(t.headsNoWrap)||g(t.tailsNoWrap)&&t.tailsNoWrap.length&&e.includes(t.tailsNoWrap))}function X(e,t,r){let o,i;return typeof e=="string"&&e.length&&M(e,0,t,{trimBeforeMatching:!0,cb:(n,a,l)=>(o=l,!0)})&&U(e,e.length-1,r,{trimBeforeMatching:!0,cb:(n,a,l)=>(i=(l||0)+1,!0)})?e.slice(o,i):e}function H(e,t,r=!1,o,i,n){if(t.wrapHeadsWith||(t.wrapHeadsWith=""),t.wrapTailsWith||(t.wrapTailsWith=""),g(e)&&!r&&t.wrapGlobalFlipSwitch&&!t.dontWrapVars.some(a=>x(n,a))&&(!t.preventDoubleWrapping||t.preventDoubleWrapping&&g(e)&&!e.includes(t.wrapHeadsWith)&&!e.includes(t.wrapTailsWith)))return`${t.wrapHeadsWith}${e}${t.wrapTailsWith}`;if(r){if(!g(e))return e;let a=L(e,{heads:t.wrapHeadsWith,tails:t.wrapTailsWith});return g(a)?X(a,t.wrapHeadsWith,t.wrapTailsWith):a}return e}function Z(e,t,r,o){let i;if(r.indexOf(".")!==-1){let n=r,a=!0;if(o.lookForDataContainers&&typeof o.dataContainerIdentifierTails=="string"&&o.dataContainerIdentifierTails.length&&!n.endsWith(o.dataContainerIdentifierTails)){let l=h.get(e,n+o.dataContainerIdentifierTails);V(l)&&h.get(l,t)&&(i=h.get(l,t),a=!1)}for(;a&&n.indexOf(".")!==-1;){if(n=J(n),P(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 "${P(n)}" is called the same as the variable "${t}" 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);V(l)&&h.get(l,t)&&(i=h.get(l,t),a=!1)}if(i===void 0){let l=h.get(e,n);V(l)&&h.get(l,t)&&(i=h.get(l,t),a=!1)}}}if(i===void 0){let n=h.get(e,t);n!==void 0&&(i=n)}if(i===void 0)if(t.indexOf(".")===-1){let n=_(e,t);if(n.length){for(let a=0,l=n.length;a<l;a++)if(g(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(t));if(n.length)for(let a=0,l=n.length;a<l;a++){let y=h.get(n[a].val,Q(t));y&&g(y)&&(i=y)}}return i}function R(e,t,r,o,i=[]){if(i.includes(r)){let c="";if(i.length>1){let w=` \u2192
|
|
11
|
+
`;c=i.reduce((D,b,S)=>D+(S===0?"":w)+(b===r?"\u{1F4A5} ":" ")+b,` Here's the path we travelled up until we hit the recursion:
|
|
12
12
|
|
|
13
|
-
`),c+=`${w}\u{1F4A5} ${
|
|
14
|
-
${c}`)}let W=!1;d.length===1&&A(t,[[d[0].headsStartAt,d[0].tailsEndAt]]).trim()===""&&(W=!0);let $=y(d,!1,W);if(typeof $=="boolean"||$===null)return $;try{d=I(t,o.headsNoWrap,o.tailsNoWrap,{source:"",throwWhenSomethingWrongIsDetected:!1})}catch(c){throw new Error(`json-variables/resolveString(): [THROW_ID_22] While trying to resolve string: "${t}" at path ${
|
|
15
|
-
${c}`)}d.length===1&&A(t,[[d[0].headsStartAt,d[0].tailsEndAt]]).trim()===""&&(W=!0);let E=y(d,!0,W);return O(E)||N(E)?E:l?.current()?A(t,l.current()):t}function de(e,t){if(!arguments.length)throw new Error("json-variables/jVar(): [THROW_ID_01] Alas! Inputs are missing!");if(!V(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&&!V(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
|
|
16
|
-
Please check the following key: ${a}`);if(l!==void 0?
|
|
13
|
+
`),c+=`${w}\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."${c}`)}let n={},a=Array.from(i);a.push(r);let l=new B;function y(c,w,D){for(let b=0,S=c.length;b<S;b++){let f=c[b],p=t.slice(f.headsEndAt,f.tailsStartAt);if(p.length===0)l.push(f.headsStartAt,f.tailsEndAt);else if(q.call(n,p)&&g(n[p]))l.push(f.headsStartAt,f.tailsEndAt,n[p]);else{let s=Z(e,p.trim(),r,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 ${t.slice(f.headsEndAt,f.tailsStartAt)}. We're at path: "${r}".`);if(!D&&o.throwWhenNonStringInsertedInString&&!g(s))throw new Error(`json-variables/processHeadsAndTails(): [THROW_ID_23] While resolving the variable ${t.slice(f.headsEndAt,f.tailsStartAt)} at path ${r}, 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=r.includes(".")?`${J(r)}.${p}`:p;if(T(s,o)){let m=H(R(e,s,v,o,a),o,w,a,v,p.trim());typeof m=="string"&&l.push(f.headsStartAt,f.tailsEndAt,m)}else{n[p]=s;let m=H(s,o,w,a,v,p.trim());typeof m=="string"&&l.push(f.headsStartAt,f.tailsEndAt,m)}}}}let d;try{d=I(t,o.heads,o.tails,{source:"",throwWhenSomethingWrongIsDetected:!1})}catch(c){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:
|
|
14
|
+
${c}`)}let W=!1;d.length===1&&A(t,[[d[0].headsStartAt,d[0].tailsEndAt]]).trim()===""&&(W=!0);let $=y(d,!1,W);if(typeof $=="boolean"||$===null)return $;try{d=I(t,o.headsNoWrap,o.tailsNoWrap,{source:"",throwWhenSomethingWrongIsDetected:!1})}catch(c){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:
|
|
15
|
+
${c}`)}d.length===1&&A(t,[[d[0].headsStartAt,d[0].tailsEndAt]]).trim()===""&&(W=!0);let E=y(d,!0,W);return O(E)||N(E)?E:l?.current()?A(t,l.current()):t}function de(e,t){if(!arguments.length)throw new Error("json-variables/jVar(): [THROW_ID_01] Alas! Inputs are missing!");if(!V(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&&!V(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={...K,...t};r.dontWrapVars?Array.isArray(r.dontWrapVars)||(r.dontWrapVars=F(r.dontWrapVars)):r.dontWrapVars=[];let o,i;if(r.dontWrapVars.length&&!r.dontWrapVars.every((a,l)=>g(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(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 C(e,(a,l,y)=>{if(z(l)&&T(a,r))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(r.heads.length&&u(n)===u(r.heads)||r.tails.length&&u(n)===u(r.tails)||r.headsNoWrap.length&&u(n)===u(r.headsNoWrap)||r.tailsNoWrap.length&&u(n)===u(r.tailsNoWrap)){if(!r.noSingleMarkers)return n;throw new Error(`json-variables/jVar(): [THROW_ID_16] Alas! While processing the input, we stumbled upon ${u(n)} which is equal to ${u(n)===u(r.heads)?"heads":""}${u(n)===u(r.tails)?"tails":""}${g(r.headsNoWrap)&&u(n)===u(r.headsNoWrap)?"headsNoWrap":""}${g(r.tailsNoWrap)&&u(n)===u(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 (${u(n)}) alone`)}return g(n)&&T(n,r)?R(e,n,y.path,r):n})}export{K as defaults,de as jVar,he as version};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
2
|
* @name json-variables
|
|
3
3
|
* @fileoverview Resolves custom-marked, cross-referenced paths in parsed JSON
|
|
4
|
-
* @version 11.
|
|
4
|
+
* @version 11.1.1
|
|
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 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,hr=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))hr.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),cr=(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]",ht="[object RegExp]",re="[object Set]",ct="[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]",Ot="[object Uint8ClampedArray]",vt="[object Uint16Array]",_t="[object Uint32Array]",wr=/[\\^$.*+?()[\]{}|]/g,br=/\w*$/,Tr=/^\[object .+?Constructor\]$/,$r=/^(?:0|[1-9]\d*)$/,O={};O[Ee]=O[yr]=O[dt]=O[ne]=O[lt]=O[ft]=O[yt]=O[mt]=O[wt]=O[bt]=O[Tt]=O[te]=O[gt]=O[We]=O[ht]=O[re]=O[ct]=O[pt]=O[$t]=O[Ot]=O[vt]=O[_t]=!0;O[mr]=O[Se]=O[$e]=!1;var Or=typeof global=="object"&&global&&global.Object===Object&&global,vr=typeof self=="object"&&self&&self.Object===Object&&self,N=Or||vr||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),jr=Object.create,Vr=ie.propertyIsEnumerable,Hr=Nr.splice,nt=Object.getOwnPropertySymbols,Mr=et?et.isBuffer:void 0,Pr=De(Object.keys,Object),Oe=F(N,"DataView"),z=F(N,"Map"),ve=F(N,"Promise"),_e=F(N,"Set"),Ae=F(N,"WeakMap"),Y=F(Object,"create"),Jr=M(Oe),Br=M(z),Fr=M(ve),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 hn(e,t){var r=xe(e)||Vn(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 cn(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 c=xe(e);if(c){if(a=Wn(e),!t)return In(e,a)}else{var s=V(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,cn(a,e))}else{if(!O[s])return n?e:{};a=Nn(e,s,Ie,t)}}l||(l=new B);var h=l.get(e);if(h)return h;if(l.set(e,a),!c)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)?jr(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=jt(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 On(e){var t=new e.constructor(e.source,br.exec(e));return t.lastIndex=e.lastIndex,t}function vn(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,V=yn;(Oe&&V(new Oe(new ArrayBuffer(1)))!=ne||z&&V(new z)!=te||ve&&V(ve.resolve())!=ze||_e&&V(new _e)!=re||Ae&&V(new Ae)!=$e)&&(V=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 Ot:case vt:case _t:return An(e,i);case te:return $n(e,i,r);case gt:case ct:return new o(e);case ht:return On(e);case re:return vn(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 jn(e){return Ie(e,!0,!0)}function Rt(e,t){return e===t||e!==e&&t!==t}function Vn(e){return Hn(e)&&R.call(e,"callee")&&(!Vr.call(e,"callee")||ae.call(e)==Ee)}var xe=Array.isArray;function Ct(e){return e!=null&&Pn(e.length)&&!jt(e)}function Hn(e){return Jn(e)&&Ct(e)}var Mn=Mr||Fn;function jt(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)?hn(e):wn(e)}function Bn(){return[]}function Fn(){return!1}P.exports=jn});var je=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,Vt=Object.prototype,Ht=Kn.toString,Un=Vt.hasOwnProperty,Gn=Ht.call(Object),zn=Vt.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,he)=>{(function(e,t){"use strict";typeof he=="object"&&typeof he.exports=="object"?he.exports=t():typeof define=="function"&&define.amd?define([],t):e.objectPath=t()})(Bt,function(){"use strict";var e=Object.prototype.toString;function t(g,h){return g==null?!1:Object.prototype.hasOwnProperty.call(g,h)}function r(g){if(!g||n(g)&&g.length===0)return!0;if(typeof g!="string"){for(var h in g)if(t(g,h))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 h=parseInt(g);return h.toString()===g?h:g}function c(g){g=g||{};var h=function(d){return Object.keys(h).reduce(function(f,p){return p==="create"||typeof h[p]=="function"&&(f[p]=h[p].bind(h,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],v=u(d,b);return f.length===1?((v===void 0||!w)&&(d[b]=p),v):(v===void 0&&(typeof f[1]=="number"?d[b]=[]:d[b]={}),y(d[b],f.slice(1),p,w))}return h.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},h.ensureExists=function(d,f,p){return y(d,f,p,!0)},h.set=function(d,f,p,w){return y(d,f,p,w)},h.insert=function(d,f,p,w){var b=h.get(d,f);w=~~w,n(b)||(b=[],h.set(d,f,b)),b.splice(w,0,p)},h.empty=function(d,f){if(!r(f)&&d!=null){var p,w;if(!!(p=h.get(d,f))){if(typeof p=="string")return h.set(d,f,"");if(l(p))return h.set(d,f,!1);if(typeof p=="number")return h.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 h.set(d,f,null)}}},h.push=function(d,f){var p=h.get(d,f);n(p)||(p=[],h.set(d,f,p)),p.push.apply(p,Array.prototype.slice.call(arguments,2))},h.coalesce=function(d,f,p){for(var w,b=0,v=f.length;b<v;b++)if((w=h.get(d,f[b]))!==void 0)return w;return p},h.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 h.get(d,f.split("."),p);var w=a(f[0]),b=u(d,w);return b===void 0?p:f.length===1?b:h.get(d[w],f.slice(1),p)},h.del=function(f,p){if(typeof p=="number"&&(p=[p]),f==null||r(p))return f;if(typeof p=="string")return h.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 h.del(f[w],p.slice(1));return f},h}var s=c();return s.create=c,s.withInheritedProps=c({includeInheritedProps:!0}),s})});var Oi={};cr(Oi,{defaults:()=>nr,jVar:()=>$i,version:()=>ci});var fe=U(Ce(),1),Pt=U(je(),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 Ve=Qn;function ue(e,t){let r={now:!1};function i(o,n,l,a){let c=(0,fe.default)(o),s,g=$({depth:-1,path:""},l);if(g.depth+=1,Array.isArray(c))for(let h=0,T=c.length;h<T&&!a.now;h++){let m=g.path?`${g.path}.${h}`:`${h}`;c[h]!==void 0?(g.parent=(0,fe.default)(c),g.parentType="array",g.parentKey=Ve(m),s=i(n(c[h],void 0,K($({},g),{path:m}),a),n,K($({},g),{path:m}),a),Number.isNaN(s)&&h<c.length?(c.splice(h,1),h-=1):c[h]=s):c.splice(h,1)}else if((0,Pt.default)(c))for(let h in c){if(a.now&&h!=null)break;let T=g.path?`${g.path}.${h}`:h;g.depth===0&&h!=null&&(g.topmostKey=h),g.parent=(0,fe.default)(c),g.parentType="object",g.parentKey=Ve(T),s=i(n(h,c[h],K($({},g),{path:T}),a),n,K($({},g),{path:T}),a),Number.isNaN(s)?delete c[h]:c[h]=s}return c}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,c=[...t].fill(!1);for(let[s,g]of t.entries())if(g.test(l)&&(c[s]=!0,a=!g.negated,!a))break;if(!(a===!1||a===void 0&&t.some(s=>!s.negated)||o&&c.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 W=U(Ft(),1);function I(e){return typeof e!="string"?e:e.length?[e]:[]}function kt(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function ce(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 c=o?1:r.length,s=0,g=!1,h=!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(v=>v.toLowerCase()).includes(e[u].toLowerCase())){if(o&&r==="EOL"&&!e[w])return!0;u=n(u);continue}let b=w>u?r[r.length-c]:r[c-1];if(!a.i&&e[u]===b||a.i&&e[u].toLowerCase()===b.toLowerCase()){if(y||(y=!0),T||(T=!0),c===r.length){if(d=!0,m!==a.maxMismatches)return!1}else c===1&&(f=!0);if(c-=1,s++,p())return!1;if(!c)return s!==r.length||m===a.maxMismatches||!g?u:!1}else if(!g&&!s&&(g=!0),a.maxMismatches&&m&&u){m-=1;for(let v=0;v<=m;v++){let E=w>u?r[r.length-c+1+v]:r[c-2-v],ye=e[n(u)];if(E&&(!a.i&&e[u]===E||a.i&&e[u].toLowerCase()===E.toLowerCase())&&(!a.firstMustMatch||c!==r.length)){if(s++,p())return!1;c-=2,y=!0;break}else if(ye&&E&&(!a.i&&ye===E||a.i&&ye.toLowerCase()===E.toLowerCase())&&(!a.firstMustMatch||c!==r.length)){if(!s&&!a.hungry)return!1;c-=1,y=!0;break}else if(E===void 0&&m>=0&&y&&(!a.firstMustMatch||d)&&(!a.lastMustMatch||f))return u}y||(h=u)}else return u===0&&c===1&&!a.lastMustMatch&&T?0:!1;if(h!==!1&&h!==u&&(h=!1),c<1)return u;u=n(u)}if(c>0)return o&&l==="EOL"?!0:a&&a.maxMismatches>=c&&T?h||0:!1}function qt(e,t,r,i,o){if(kt(o)&&Object.prototype.hasOwnProperty.call(o,"trimBeforeMatching")&&o&&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=>ce(g)?g:String(g)),!ce(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:
|
|
10
|
+
"use strict";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,hr=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))hr.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),cr=(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]",ht="[object RegExp]",re="[object Set]",ct="[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]",Ot="[object Uint8ClampedArray]",vt="[object Uint16Array]",_t="[object Uint32Array]",wr=/[\\^$.*+?()[\]{}|]/g,br=/\w*$/,Tr=/^\[object .+?Constructor\]$/,$r=/^(?:0|[1-9]\d*)$/,O={};O[Ee]=O[yr]=O[dt]=O[ne]=O[lt]=O[ft]=O[yt]=O[mt]=O[wt]=O[bt]=O[Tt]=O[te]=O[gt]=O[We]=O[ht]=O[re]=O[ct]=O[pt]=O[$t]=O[Ot]=O[vt]=O[_t]=!0;O[mr]=O[Se]=O[$e]=!1;var Or=typeof global=="object"&&global&&global.Object===Object&&global,vr=typeof self=="object"&&self&&self.Object===Object&&self,N=Or||vr||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),jr=Object.create,Vr=ie.propertyIsEnumerable,Hr=Nr.splice,nt=Object.getOwnPropertySymbols,Mr=et?et.isBuffer:void 0,Pr=De(Object.keys,Object),Oe=F(N,"DataView"),z=F(N,"Map"),ve=F(N,"Promise"),_e=F(N,"Set"),Ae=F(N,"WeakMap"),Y=F(Object,"create"),Jr=M(Oe),Br=M(z),Fr=M(ve),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 hn(e,t){var r=xe(e)||Vn(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 cn(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 c=xe(e);if(c){if(a=Wn(e),!t)return In(e,a)}else{var s=V(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,cn(a,e))}else{if(!O[s])return n?e:{};a=Nn(e,s,Ie,t)}}l||(l=new B);var h=l.get(e);if(h)return h;if(l.set(e,a),!c)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)?jr(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=jt(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 On(e){var t=new e.constructor(e.source,br.exec(e));return t.lastIndex=e.lastIndex,t}function vn(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,V=yn;(Oe&&V(new Oe(new ArrayBuffer(1)))!=ne||z&&V(new z)!=te||ve&&V(ve.resolve())!=ze||_e&&V(new _e)!=re||Ae&&V(new Ae)!=$e)&&(V=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 Ot:case vt:case _t:return An(e,i);case te:return $n(e,i,r);case gt:case ct:return new o(e);case ht:return On(e);case re:return vn(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 jn(e){return Ie(e,!0,!0)}function Rt(e,t){return e===t||e!==e&&t!==t}function Vn(e){return Hn(e)&&R.call(e,"callee")&&(!Vr.call(e,"callee")||ae.call(e)==Ee)}var xe=Array.isArray;function Ct(e){return e!=null&&Pn(e.length)&&!jt(e)}function Hn(e){return Jn(e)&&Ct(e)}var Mn=Mr||Fn;function jt(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)?hn(e):wn(e)}function Bn(){return[]}function Fn(){return!1}P.exports=jn});var je=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,Vt=Object.prototype,Ht=Kn.toString,Un=Vt.hasOwnProperty,Gn=Ht.call(Object),zn=Vt.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,he)=>{(function(e,t){"use strict";typeof he=="object"&&typeof he.exports=="object"?he.exports=t():typeof define=="function"&&define.amd?define([],t):e.objectPath=t()})(Bt,function(){"use strict";var e=Object.prototype.toString;function t(g,h){return g==null?!1:Object.prototype.hasOwnProperty.call(g,h)}function r(g){if(!g||n(g)&&g.length===0)return!0;if(typeof g!="string"){for(var h in g)if(t(g,h))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 h=parseInt(g);return h.toString()===g?h:g}function c(g){g=g||{};var h=function(d){return Object.keys(h).reduce(function(f,p){return p==="create"||typeof h[p]=="function"&&(f[p]=h[p].bind(h,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],v=u(d,b);return f.length===1?((v===void 0||!w)&&(d[b]=p),v):(v===void 0&&(typeof f[1]=="number"?d[b]=[]:d[b]={}),y(d[b],f.slice(1),p,w))}return h.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},h.ensureExists=function(d,f,p){return y(d,f,p,!0)},h.set=function(d,f,p,w){return y(d,f,p,w)},h.insert=function(d,f,p,w){var b=h.get(d,f);w=~~w,n(b)||(b=[],h.set(d,f,b)),b.splice(w,0,p)},h.empty=function(d,f){if(!r(f)&&d!=null){var p,w;if(!!(p=h.get(d,f))){if(typeof p=="string")return h.set(d,f,"");if(l(p))return h.set(d,f,!1);if(typeof p=="number")return h.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 h.set(d,f,null)}}},h.push=function(d,f){var p=h.get(d,f);n(p)||(p=[],h.set(d,f,p)),p.push.apply(p,Array.prototype.slice.call(arguments,2))},h.coalesce=function(d,f,p){for(var w,b=0,v=f.length;b<v;b++)if((w=h.get(d,f[b]))!==void 0)return w;return p},h.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 h.get(d,f.split("."),p);var w=a(f[0]),b=u(d,w);return b===void 0?p:f.length===1?b:h.get(d[w],f.slice(1),p)},h.del=function(f,p){if(typeof p=="number"&&(p=[p]),f==null||r(p))return f;if(typeof p=="string")return h.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 h.del(f[w],p.slice(1));return f},h}var s=c();return s.create=c,s.withInheritedProps=c({includeInheritedProps:!0}),s})});var Oi={};cr(Oi,{defaults:()=>nr,jVar:()=>$i,version:()=>ci});var fe=U(Ce(),1),Pt=U(je(),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 Ve=Qn;function ue(e,t){let r={now:!1};function i(o,n,l,a){let c=(0,fe.default)(o),s,g=$({depth:-1,path:""},l);if(g.depth+=1,Array.isArray(c))for(let h=0,T=c.length;h<T&&!a.now;h++){let m=g.path?`${g.path}.${h}`:`${h}`;c[h]!==void 0?(g.parent=(0,fe.default)(c),g.parentType="array",g.parentKey=Ve(m),s=i(n(c[h],void 0,K($({},g),{path:m}),a),n,K($({},g),{path:m}),a),Number.isNaN(s)&&h<c.length?(c.splice(h,1),h-=1):c[h]=s):c.splice(h,1)}else if((0,Pt.default)(c))for(let h in c){if(a.now&&h!=null)break;let T=g.path?`${g.path}.${h}`:h;g.depth===0&&h!=null&&(g.topmostKey=h),g.parent=(0,fe.default)(c),g.parentType="object",g.parentKey=Ve(T),s=i(n(h,c[h],K($({},g),{path:T}),a),n,K($({},g),{path:T}),a),Number.isNaN(s)?delete c[h]:c[h]=s}return c}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,c=[...t].fill(!1);for(let[s,g]of t.entries())if(g.test(l)&&(c[s]=!0,a=!g.negated,!a))break;if(!(a===!1||a===void 0&&t.some(s=>!s.negated)||o&&c.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 W=U(Ft(),1);function I(e){return typeof e!="string"?e:e.length?[e]:[]}function kt(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function ce(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 c=o?1:r.length,s=0,g=!1,h=!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(v=>v.toLowerCase()).includes(e[u].toLowerCase())){if(o&&r==="EOL"&&!e[w])return!0;u=n(u);continue}let b=w>u?r[r.length-c]:r[c-1];if(!a.i&&e[u]===b||a.i&&e[u].toLowerCase()===b.toLowerCase()){if(y||(y=!0),T||(T=!0),c===r.length){if(d=!0,m!==a.maxMismatches)return!1}else c===1&&(f=!0);if(c-=1,s++,p())return!1;if(!c)return s!==r.length||m===a.maxMismatches||!g?u:!1}else if(!g&&!s&&(g=!0),a.maxMismatches&&m&&u){m-=1;for(let v=0;v<=m;v++){let E=w>u?r[r.length-c+1+v]:r[c-2-v],ye=e[n(u)];if(E&&(!a.i&&e[u]===E||a.i&&e[u].toLowerCase()===E.toLowerCase())&&(!a.firstMustMatch||c!==r.length)){if(s++,p())return!1;c-=2,y=!0;break}else if(ye&&E&&(!a.i&&ye===E||a.i&&ye.toLowerCase()===E.toLowerCase())&&(!a.firstMustMatch||c!==r.length)){if(!s&&!a.hungry)return!1;c-=1,y=!0;break}else if(E===void 0&&m>=0&&y&&(!a.firstMustMatch||d)&&(!a.lastMustMatch||f))return u}y||(h=u)}else return u===0&&c===1&&!a.lastMustMatch&&T?0:!1;if(h!==!1&&h!==u&&(h=!1),c<1)return u;u=n(u)}if(c>0)return o&&l==="EOL"?!0:a&&a.maxMismatches>=c&&T?h||0:!1}function qt(e,t,r,i,o){if(kt(o)&&Object.prototype.hasOwnProperty.call(o,"trimBeforeMatching")&&o&&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=>ce(g)?g:String(g)),!ce(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
11
|
${JSON.stringify(r,null,4)}`);let l,a;if(ce(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
13
|
${JSON.stringify(o,null,4)}`);let c=0,s="";if((n==null?void 0:n.trimCharsBeforeMatching)&&n.trimCharsBeforeMatching.some((g,h)=>g.length>1?(c=h,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 ${c} 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&&ce(l[0])&&!l[0].trim()){if(typeof n.cb=="function"){let h,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))){h=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))){h=d;break}}if(h===void 0)return!1;let m=t[h],u=h+1,y="";return u&&u>0&&(y=t.slice(0,u)),e[5]==="L"||h&&h>0&&(y=t.slice(h)),n.cb(m,y,h)}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,h=l.length;g<h;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 S(e,t,r,i){return qt("matchRightIncl",e,t,r,i)}function ii(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function D(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(!D(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:
|
|
@@ -37,7 +37,7 @@ ${JSON.stringify(t,null,4)} (type ${typeof t})`);else i=$({},Gt);let o=e.filter(
|
|
|
37
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 j(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])&&j(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,c)=>!Array.isArray(a)||a.length!==2?(i=c,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,c)=>!Array.isArray(a)||!Number.isInteger(a[0])||a[0]<0||!Number.isInteger(a[1])||a[1]<0?(i=c,!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,c)=>(r.progressFn&&(l+=1,r.progressFn(Math.floor(l*100/n))),a[0]===c[0]?a[1]<c[1]?-1:a[1]>c[1]?1:0:a[0]<c[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
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 c=n.length-1;for(let s=c;s>0;s--)i.progressFn&&(a=Math.floor((1-s/c)*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,h)=>{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 ${h}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 ${h}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[h][0]=+n[h][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 ${h}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[h][1]=+n[h][1]}a+=1});let c=Yt(n,{progressFn:g=>{r&&(i=10+Math.floor(g/10),i!==o&&(o=i,r(i)))}});Xt(c);let s=c.length;if(s>0){let g=e.slice(c[s-1][1]);e=c.reduce((h,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`${h}${e.slice(y,d)}${u[m][2]||""}`},""),e+=g}return e}var Zt=U(je(),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,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,c=new Z({limitToBeAddedWhitespace:!0}),s=new Z({limitToBeAddedWhitespace:!0}),g=!0,h=!0,T="";function m(y,d){let f;return S(y,0,d.heads,{trimBeforeMatching:!0,cb:(p,w,b)=>(f=b,!0)})&&S(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||!S(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(S(e,y,n.heads,{trimBeforeMatching:!0,cb:(p,w,b)=>(f=b,!0)})&&f){h=!0,g&&(g=!0);let p;S(e,f,n.tails,{trimBeforeMatching:!0,cb:(w,b,v)=>(p=v,!0)})&&c.push(y,p),s.current()&&l&&T!=="tails"&&c.push(s.current()),l||s.current()&&(c.push(s.current()),s.wipe()),s.push(y,f),T="heads",y=f-1;continue}if(S(e,y,n.tails,{trimBeforeMatching:!0,cb:(p,w,b)=>(f=Number.isInteger(b)?b:e.length,!0)})&&f){h=!0,g?(T==="heads"&&s.wipe(),g=!1):s.push(y,f),T="tails",y=f-1;continue}g&&(g=!0),h&&!l?(l=!0,h=!1):h&&!a?(a=!0,g=!0,h=!1,T==="heads"&&s.wipe()):h&&a&&s.wipe()}return s.current()&&c.push(s.current()),c.current()?L(e,c.current()).trim():e.trim()}var er="11.
|
|
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,c=new Z({limitToBeAddedWhitespace:!0}),s=new Z({limitToBeAddedWhitespace:!0}),g=!0,h=!0,T="";function m(y,d){let f;return S(y,0,d.heads,{trimBeforeMatching:!0,cb:(p,w,b)=>(f=b,!0)})&&S(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||!S(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(S(e,y,n.heads,{trimBeforeMatching:!0,cb:(p,w,b)=>(f=b,!0)})&&f){h=!0,g&&(g=!0);let p;S(e,f,n.tails,{trimBeforeMatching:!0,cb:(w,b,v)=>(p=v,!0)})&&c.push(y,p),s.current()&&l&&T!=="tails"&&c.push(s.current()),l||s.current()&&(c.push(s.current()),s.wipe()),s.push(y,f),T="heads",y=f-1;continue}if(S(e,y,n.tails,{trimBeforeMatching:!0,cb:(p,w,b)=>(f=Number.isInteger(b)?b:e.length,!0)})&&f){h=!0,g?(T==="heads"&&s.wipe(),g=!1):s.push(y,f),T="tails",y=f-1;continue}g&&(g=!0),h&&!l?(l=!0,h=!1):h&&!a?(a=!0,g=!0,h=!1,T==="heads"&&s.wipe()):h&&a&&s.wipe()}return s.current()&&c.push(s.current()),c.current()?L(e,c.current()).trim():e.trim()}var er="11.1.1";var ci=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&&S(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||0)+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=W.default.get(e,n+i.dataContainerIdentifierTails);ee(a)&&W.default.get(a,t)&&(o=W.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=W.default.get(e,n+i.dataContainerIdentifierTails);ee(a)&&W.default.get(a,t)&&(o=W.default.get(a,t),l=!1)}if(o===void 0){let a=W.default.get(e,n);ee(a)&&W.default.get(a,t)&&(o=W.default.get(a,t),l=!1)}}}if(o===void 0){let n=W.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 c=W.default.get(n[l].val,wi(t));c&&A(c)&&(o=c)}}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
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 c(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 v=r.includes(".")?`${ir(r)}.${w}`:w;if(qe(b,i)){let E=rr(ar(e,b,v,i,l),i,u,l,v,w.trim());typeof E=="string"&&a.push(p.headsStartAt,p.tailsEndAt,E)}else{n[w]=b;let E=rr(b,i,u,l,v,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:
|
|
@@ -47,7 +47,7 @@ Please check the following key: ${l}`);if(a!==void 0?n=a:n=l,n==="")return n;if(
|
|
|
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.
|
|
50
|
+
* @version 4.1.1
|
|
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(a!==void 0?n=a: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.
|
|
58
|
+
* @version 4.1.1
|
|
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(a!==void 0?n=a: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.
|
|
66
|
+
* @version 3.1.1
|
|
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(a!==void 0?n=a: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.
|
|
74
|
+
* @version 2.1.1
|
|
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(a!==void 0?n=a: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
|
|
82
|
+
* @version 6.2.1
|
|
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(a!==void 0?n=a: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
|
|
90
|
+
* @version 8.2.1
|
|
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(a!==void 0?n=a:n=l,n==="")return n;if(
|
|
|
95
95
|
/**
|
|
96
96
|
* @name ranges-push
|
|
97
97
|
* @fileoverview Gather string index ranges
|
|
98
|
-
* @version 6.1
|
|
98
|
+
* @version 6.2.1
|
|
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(a!==void 0?n=a:n=l,n==="")return n;if(
|
|
|
103
103
|
/**
|
|
104
104
|
* @name ranges-sort
|
|
105
105
|
* @fileoverview Sort string index ranges
|
|
106
|
-
* @version 5.
|
|
106
|
+
* @version 5.1.1
|
|
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(a!==void 0?n=a: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.
|
|
114
|
+
* @version 6.1.1
|
|
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(a!==void 0?n=a: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.
|
|
122
|
+
* @version 5.1.1
|
|
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(a!==void 0?n=a: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
|
|
130
|
+
* @version 8.2.1
|
|
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(a!==void 0?n=a: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.
|
|
138
|
+
* @version 6.1.1
|
|
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(a!==void 0?n=a: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.
|
|
146
|
+
* @version 4.1.1
|
|
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.
|
|
3
|
+
"version": "11.1.1",
|
|
4
4
|
"description": "Resolves custom-marked, cross-referenced paths in parsed JSON",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"comb",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"variable",
|
|
22
22
|
"variables"
|
|
23
23
|
],
|
|
24
|
-
"homepage": "https://codsen.com/os/json-variables
|
|
24
|
+
"homepage": "https://codsen.com/os/json-variables",
|
|
25
25
|
"repository": {
|
|
26
26
|
"type": "git",
|
|
27
27
|
"url": "https://github.com/codsen/codsen.git",
|
|
@@ -76,15 +76,15 @@
|
|
|
76
76
|
"various": {}
|
|
77
77
|
},
|
|
78
78
|
"dependencies": {
|
|
79
|
-
"arrayiffy-if-string": "^4.
|
|
80
|
-
"ast-get-values-by-key": "^4.
|
|
81
|
-
"ast-monkey-traverse": "^3.
|
|
79
|
+
"arrayiffy-if-string": "^4.1.1",
|
|
80
|
+
"ast-get-values-by-key": "^4.1.1",
|
|
81
|
+
"ast-monkey-traverse": "^3.1.1",
|
|
82
82
|
"matcher": "^5.0.0",
|
|
83
83
|
"object-path": "^0.11.8",
|
|
84
|
-
"ranges-apply": "^6.1
|
|
85
|
-
"ranges-push": "^6.1
|
|
86
|
-
"string-find-heads-tails": "^5.
|
|
87
|
-
"string-match-left-right": "^8.1
|
|
88
|
-
"string-remove-duplicate-heads-tails": "^6.
|
|
84
|
+
"ranges-apply": "^6.2.1",
|
|
85
|
+
"ranges-push": "^6.2.1",
|
|
86
|
+
"string-find-heads-tails": "^5.1.1",
|
|
87
|
+
"string-match-left-right": "^8.2.1",
|
|
88
|
+
"string-remove-duplicate-heads-tails": "^6.1.1"
|
|
89
89
|
}
|
|
90
90
|
}
|
package/types/index.d.ts
CHANGED