object-flatten-referencing 7.2.0 → 7.2.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.
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @name object-flatten-referencing
3
3
  * @fileoverview Flatten complex nested objects according to a reference objects
4
- * @version 7.2.0
4
+ * @version 7.2.1
5
5
  * @author Roy Revelt
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/object-flatten-referencing/}
8
8
  */
9
9
 
10
- import{arrayiffy as v}from"arrayiffy-if-string";import{deepClone as S,existy as w,formatDiagnosticValue as $,isPlainObject as b,isStr as m,match as A}from"codsen-utils";import{strIndexesOfPlus as C}from"str-indexes-of-plus";var T="7.2.0";import{deepClone as R,isPlainObject as x,isStr as O}from"codsen-utils";var W={wrapHeadsWith:"%%_",wrapTailsWith:"_%%",dontWrapKeys:[],dontWrapPaths:[],xhtml:!0,preventDoubleWrapping:!0,preventWrappingIfContains:[],objectKeyAndValueJoinChar:".",wrapGlobalFlipSwitch:!0,ignore:[],whatToDoWhenReferenceIsMissing:0,mergeArraysWithLineBreaks:!0,mergeWithoutTrailingBrIfLineContainsBr:!0,enforceStrictKeyset:!0};function j(p,d){let c={...W,...d};if(!p||Object.keys(p).length===0)return[];let i=R(p),r=[];return x(i)&&Object.keys(i).forEach(a=>{x(i[a])&&(i[a]=j(i[a],c)),Array.isArray(i[a])&&(r=r.concat(i[a].map(h=>`${a}${c.objectKeyAndValueJoinChar}${h}`))),O(i[a])&&r.push(`${a}${c.objectKeyAndValueJoinChar}${i[a]}`)}),r}function y(p,d,c=!1,i=!1){let r={...W,...d};if(!p||p.length===0)return"";let a=R(p),h="";if(a.length)if(i){for(let e=0,s=a.length;e<s;e++)if(O(a[e])){let l;l="",r.mergeArraysWithLineBreaks&&e>0&&(!r.mergeWithoutTrailingBrIfLineContainsBr||typeof a[e-1]!="string"||r.mergeWithoutTrailingBrIfLineContainsBr&&a[e-1]!==void 0&&!a[e-1].toLowerCase().includes("<br"))&&(l=`<br${r.xhtml?" /":""}>`),h+=`${l}${c?r.wrapHeadsWith:""}${a[e]}${c?r.wrapTailsWith:""}`}else if(Array.isArray(a[e])&&a[e].length&&a[e].every(O)){let l="";r.mergeArraysWithLineBreaks&&h.length&&(l=`<br${r.xhtml?" /":""}>`),h=a[e].reduce((u,t,o,n)=>{let f="";return o!==n.length-1&&(f=" "),u+(o===0?l:"")+(c?r.wrapHeadsWith:"")+t+(c?r.wrapTailsWith:"")+f},h)}}else h=a.reduce((e,s,l,u)=>{let t="";r.mergeArraysWithLineBreaks&&l>0&&(t=`<br${r.xhtml?" /":""}>`);let o="";return l!==u.length-1&&(o=" "),`${e}${l===0?t:""}${c?r.wrapHeadsWith:""}${s}${c?r.wrapTailsWith:""}${o}`},h);return h}var V=T;function B(p,d,c){if(!b(p))throw new Error(`object-flatten-referencing/flattenReferencing(): [THROW_ID_01] the first input argument must be a plain object! It was given as ${$(p,4)} (its typeof was ${typeof p}).`);if(!b(d))throw new Error(`object-flatten-referencing/flattenReferencing(): [THROW_ID_02] the second input argument must be a plain object! It was given as ${$(d,4)} (its typeof was ${typeof d}).`);if(c&&!b(c))throw new Error(`object-flatten-referencing/flattenReferencing(): [THROW_ID_03] the third input argument must be a plain object! It was given as ${$(c,4)} (its typeof was ${typeof c}).`);let i={...W,...c};i.dontWrapKeys=v(i.dontWrapKeys),i.preventWrappingIfContains=v(i.preventWrappingIfContains),i.dontWrapPaths=v(i.dontWrapPaths),i.ignore=v(i.ignore),typeof i.whatToDoWhenReferenceIsMissing!="number"&&(i.whatToDoWhenReferenceIsMissing=+i.whatToDoWhenReferenceIsMissing||0);function r(a,h,e,s=!0,l=!0,u=""){let t=a,o=h;return e.wrapGlobalFlipSwitch||(s=!1),b(t)?Object.keys(t).forEach(n=>{let f=u+(u.length===0?n:`.${n}`);if(e.ignore.length===0||!e.ignore.includes(n)){if(e.wrapGlobalFlipSwitch&&(s=!0,e.dontWrapKeys.length&&(s=s&&!e.dontWrapKeys.some(g=>A(n,g,{caseSensitiveMatch:!0}))),e.dontWrapPaths.length&&(s=s&&!e.dontWrapPaths.some(g=>g===f)),e.preventWrappingIfContains.length&&typeof t[n]=="string"&&(s=s&&!e.preventWrappingIfContains.some(g=>t[n].includes(g)))),w(o[n])||!w(o[n])&&e.whatToDoWhenReferenceIsMissing===2)if(Array.isArray(t[n]))if(e.whatToDoWhenReferenceIsMissing===2||m(o[n]))t[n]=y(t[n],e,s,l);else{if(t[n].every(g=>typeof g=="string"||Array.isArray(g))){let g=!0;t[n].forEach(I=>{Array.isArray(I)&&!I.every(m)&&(g=!1)}),g&&(l=!1)}t[n]=r(t[n],o[n],e,s,l,f)}else b(t[n])?e.whatToDoWhenReferenceIsMissing===2||m(o[n])?t[n]=y(j(t[n],e),e,s,l):s?t[n]=r(t[n],o[n],e,s,l,f):t[n]=r(t[n],o[n],{...e,wrapGlobalFlipSwitch:!1},s,l,f):m(t[n])&&(t[n]=r(t[n],o[n],e,s,l,f));else if(typeof t[n]!=typeof o[n]&&e.whatToDoWhenReferenceIsMissing===1)throw new Error(`object-flatten-referencing/flattenReferencing(): [THROW_ID_04] resolvedReference object does not have the key ${n} and we need it. TIP: Turn off throwing via opts2.whatToDoWhenReferenceIsMissing.`)}}):Array.isArray(t)?Array.isArray(o)?t.forEach((n,f)=>{w(t[f])&&w(o[f])?t[f]=r(t[f],o[f],e,s,l,`${u}[${f}]`):t[f]=r(t[f],o[0],e,s,l,`${u}[${f}]`)}):m(o)&&(t=y(t,e,s,l)):m(t)&&t.length&&(e.wrapHeadsWith||e.wrapTailsWith)&&(!e.preventDoubleWrapping||(e.wrapHeadsWith===""||!C(t,e.wrapHeadsWith.trim()).length)&&(e.wrapTailsWith===""||!C(t,e.wrapTailsWith.trim()).length))&&(t=`${s?e.wrapHeadsWith:""}${t}${s?e.wrapTailsWith:""}`),t}return r(S(p),d,i)}export{v as arrayiffy,W as defaults,y as flattenArr,j as flattenObject,B as flattenReferencing,V as version};
10
+ import{arrayiffy as v}from"arrayiffy-if-string";import{deepClone as S,existy as w,formatDiagnosticValue as $,isPlainObject as b,isStr as m,match as A}from"codsen-utils";import{strIndexesOfPlus as C}from"str-indexes-of-plus";var T="7.2.1";import{deepClone as R,isPlainObject as x,isStr as O}from"codsen-utils";var W={wrapHeadsWith:"%%_",wrapTailsWith:"_%%",dontWrapKeys:[],dontWrapPaths:[],xhtml:!0,preventDoubleWrapping:!0,preventWrappingIfContains:[],objectKeyAndValueJoinChar:".",wrapGlobalFlipSwitch:!0,ignore:[],whatToDoWhenReferenceIsMissing:0,mergeArraysWithLineBreaks:!0,mergeWithoutTrailingBrIfLineContainsBr:!0,enforceStrictKeyset:!0};function j(p,d){let c={...W,...d};if(!p||Object.keys(p).length===0)return[];let i=R(p),r=[];return x(i)&&Object.keys(i).forEach(a=>{x(i[a])&&(i[a]=j(i[a],c)),Array.isArray(i[a])&&(r=r.concat(i[a].map(h=>`${a}${c.objectKeyAndValueJoinChar}${h}`))),O(i[a])&&r.push(`${a}${c.objectKeyAndValueJoinChar}${i[a]}`)}),r}function y(p,d,c=!1,i=!1){let r={...W,...d};if(!p||p.length===0)return"";let a=R(p),h="";if(a.length)if(i){for(let e=0,s=a.length;e<s;e++)if(O(a[e])){let l;l="",r.mergeArraysWithLineBreaks&&e>0&&(!r.mergeWithoutTrailingBrIfLineContainsBr||typeof a[e-1]!="string"||r.mergeWithoutTrailingBrIfLineContainsBr&&a[e-1]!==void 0&&!a[e-1].toLowerCase().includes("<br"))&&(l=`<br${r.xhtml?" /":""}>`),h+=`${l}${c?r.wrapHeadsWith:""}${a[e]}${c?r.wrapTailsWith:""}`}else if(Array.isArray(a[e])&&a[e].length&&a[e].every(O)){let l="";r.mergeArraysWithLineBreaks&&h.length&&(l=`<br${r.xhtml?" /":""}>`),h=a[e].reduce((u,t,o,n)=>{let f="";return o!==n.length-1&&(f=" "),u+(o===0?l:"")+(c?r.wrapHeadsWith:"")+t+(c?r.wrapTailsWith:"")+f},h)}}else h=a.reduce((e,s,l,u)=>{let t="";r.mergeArraysWithLineBreaks&&l>0&&(t=`<br${r.xhtml?" /":""}>`);let o="";return l!==u.length-1&&(o=" "),`${e}${l===0?t:""}${c?r.wrapHeadsWith:""}${s}${c?r.wrapTailsWith:""}${o}`},h);return h}var V=T;function B(p,d,c){if(!b(p))throw new Error(`object-flatten-referencing/flattenReferencing(): [THROW_ID_01] the first input argument must be a plain object! It was given as ${$(p,4)} (its typeof was ${typeof p}).`);if(!b(d))throw new Error(`object-flatten-referencing/flattenReferencing(): [THROW_ID_02] the second input argument must be a plain object! It was given as ${$(d,4)} (its typeof was ${typeof d}).`);if(c&&!b(c))throw new Error(`object-flatten-referencing/flattenReferencing(): [THROW_ID_03] the third input argument must be a plain object! It was given as ${$(c,4)} (its typeof was ${typeof c}).`);let i={...W,...c};i.dontWrapKeys=v(i.dontWrapKeys),i.preventWrappingIfContains=v(i.preventWrappingIfContains),i.dontWrapPaths=v(i.dontWrapPaths),i.ignore=v(i.ignore),typeof i.whatToDoWhenReferenceIsMissing!="number"&&(i.whatToDoWhenReferenceIsMissing=+i.whatToDoWhenReferenceIsMissing||0);function r(a,h,e,s=!0,l=!0,u=""){let t=a,o=h;return e.wrapGlobalFlipSwitch||(s=!1),b(t)?Object.keys(t).forEach(n=>{let f=u+(u.length===0?n:`.${n}`);if(e.ignore.length===0||!e.ignore.includes(n)){if(e.wrapGlobalFlipSwitch&&(s=!0,e.dontWrapKeys.length&&(s=s&&!e.dontWrapKeys.some(g=>A(n,g,{caseSensitiveMatch:!0}))),e.dontWrapPaths.length&&(s=s&&!e.dontWrapPaths.some(g=>g===f)),e.preventWrappingIfContains.length&&typeof t[n]=="string"&&(s=s&&!e.preventWrappingIfContains.some(g=>t[n].includes(g)))),w(o[n])||!w(o[n])&&e.whatToDoWhenReferenceIsMissing===2)if(Array.isArray(t[n]))if(e.whatToDoWhenReferenceIsMissing===2||m(o[n]))t[n]=y(t[n],e,s,l);else{if(t[n].every(g=>typeof g=="string"||Array.isArray(g))){let g=!0;t[n].forEach(I=>{Array.isArray(I)&&!I.every(m)&&(g=!1)}),g&&(l=!1)}t[n]=r(t[n],o[n],e,s,l,f)}else b(t[n])?e.whatToDoWhenReferenceIsMissing===2||m(o[n])?t[n]=y(j(t[n],e),e,s,l):s?t[n]=r(t[n],o[n],e,s,l,f):t[n]=r(t[n],o[n],{...e,wrapGlobalFlipSwitch:!1},s,l,f):m(t[n])&&(t[n]=r(t[n],o[n],e,s,l,f));else if(typeof t[n]!=typeof o[n]&&e.whatToDoWhenReferenceIsMissing===1)throw new Error(`object-flatten-referencing/flattenReferencing(): [THROW_ID_04] resolvedReference object does not have the key ${n} and we need it. TIP: Turn off throwing via opts2.whatToDoWhenReferenceIsMissing.`)}}):Array.isArray(t)?Array.isArray(o)?t.forEach((n,f)=>{w(t[f])&&w(o[f])?t[f]=r(t[f],o[f],e,s,l,`${u}[${f}]`):t[f]=r(t[f],o[0],e,s,l,`${u}[${f}]`)}):m(o)&&(t=y(t,e,s,l)):m(t)&&t.length&&(e.wrapHeadsWith||e.wrapTailsWith)&&(!e.preventDoubleWrapping||(e.wrapHeadsWith===""||!C(t,e.wrapHeadsWith.trim()).length)&&(e.wrapTailsWith===""||!C(t,e.wrapTailsWith.trim()).length))&&(t=`${s?e.wrapHeadsWith:""}${t}${s?e.wrapTailsWith:""}`),t}return r(S(p),d,i)}export{v as arrayiffy,W as defaults,y as flattenArr,j as flattenObject,B as flattenReferencing,V as version};
@@ -1,17 +1,17 @@
1
1
  /**
2
2
  * @name object-flatten-referencing
3
3
  * @fileoverview Flatten complex nested objects according to a reference objects
4
- * @version 7.2.0
4
+ * @version 7.2.1
5
5
  * @author Roy Revelt
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/object-flatten-referencing/}
8
8
  */
9
9
 
10
- "use strict";var objectFlattenReferencing=(()=>{var T=Object.defineProperty,re=Object.defineProperties,ne=Object.getOwnPropertyDescriptor,ie=Object.getOwnPropertyDescriptors,se=Object.getOwnPropertyNames,k=Object.getOwnPropertySymbols;var K=Object.prototype.hasOwnProperty,le=Object.prototype.propertyIsEnumerable;var E=(e,r,t)=>r in e?T(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,W=(e,r)=>{for(var t in r||(r={}))K.call(r,t)&&E(e,t,r[t]);if(k)for(var t of k(r))le.call(r,t)&&E(e,t,r[t]);return e},V=(e,r)=>re(e,ie(r));var ae=(e,r)=>{for(var t in r)T(e,t,{get:r[t],enumerable:!0})},oe=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of se(r))!K.call(e,s)&&s!==t&&T(e,s,{get:()=>r[s],enumerable:!(n=ne(r,s))||n.enumerable});return e};var ue=e=>oe(T({},"__esModule",{value:!0}),e);var $=(e,r,t)=>E(e,typeof r!="symbol"?r+"":r,t);var Ie={};ae(Ie,{arrayiffy:()=>C,defaults:()=>j,flattenArr:()=>D,flattenObject:()=>L,flattenReferencing:()=>Se,version:()=>$e});function C(e){return typeof e!="string"?e:e.length?[e]:[]}function fe(){let e=[],r=0,t=!1;return{append(n){return t?!1:r+n.length>1999?(e.push("\u2026"),r+=1,t=!0,!1):(e.push(n),r+=n.length,!0)},result(){return e.join("")},stopped(){return t}}}function ce(e){return"\\u".concat(e.toString(16).padStart(4,"0"))}function P(e,r){if(e.append('"')){for(let t=0;t<r.length&&!e.stopped();t+=1){let n=r.charCodeAt(t);n===34?e.append('\\"'):n===92?e.append("\\\\"):n===8?e.append("\\b"):n===9?e.append("\\t"):n===10?e.append("\\n"):n===12?e.append("\\f"):n===13?e.append("\\r"):n<32||n===8232||n===8233||n>=55296&&n<=57343?e.append(ce(n)):e.append(r[t])}e.append('"')}}function pe(e){return e.get&&e.set?"[Getter/Setter]":e.get?"[Getter]":e.set?"[Setter]":"[Accessor]"}function U(e,r){e.append("Symbol(");let t=String(r);t.length>8&&P(e,t.slice(7,-1)),e.append(")")}function J(e,r){typeof r=="symbol"?U(e,r):P(e,String(r))}function B(e,r=0){let t=fe(),n=r===4?4:0,s=new WeakSet,i=0;function a(o){n&&t.append(" ".repeat(o*n))}function l(o,g){o&&t.append(","),n&&(t.append("\n"),a(g+1))}function u(o,g,m){n&&g&&(t.append("\n"),a(m)),t.append(o)}function f(o,g){Object.prototype.hasOwnProperty.call(o,"value")?p(o.value,g):t.append(pe(o))}function d(o,g){let m;try{m=Reflect.getOwnPropertyDescriptor(o,"length")}catch(b){t.append("[Uninspectable]");return}let y=m==null?void 0:m.value;if(!Number.isSafeInteger(y)||y<0){t.append("[Uninspectable]");return}t.append("[");let v=!1;for(let b=0;b<y&&!t.stopped();b+=1){if(l(v,g),v=!0,i>=50){t.append("[MaxEntries]");break}i+=1;let O;try{O=Reflect.getOwnPropertyDescriptor(o,String(b))}catch(je){t.append("[Uninspectable]");continue}O!=null&&O.enumerable?f(O,g+1):t.append("[Empty]")}u("]",v,g)}function c(o,g){let m;try{m=Reflect.ownKeys(o)}catch(v){t.append("[Uninspectable]");return}t.append("{");let y=!1;for(let v of m){if(t.stopped())break;if(i>=50){l(y,g),y=!0,P(t,"\u2026"),t.append(n?": ":":"),t.append("[MaxEntries]");break}i+=1;let b;try{b=Reflect.getOwnPropertyDescriptor(o,v)}catch(O){l(y,g),y=!0,J(t,v),t.append(n?": ":":"),t.append("[Uninspectable]");continue}b!=null&&b.enumerable&&(l(y,g),y=!0,J(t,v),t.append(n?": ":":"),f(b,g+1))}u("}",y,g)}function h(o,g){if(s.has(o)){t.append("[Circular]");return}if(g>=5){t.append("[MaxDepth]");return}let m;try{m=Array.isArray(o)}catch(y){t.append("[Uninspectable]");return}s.add(o);try{m?d(o,g):c(o,g)}finally{s.delete(o)}}function p(o,g){o===null?t.append("null"):typeof o=="string"?P(t,o):typeof o=="number"?t.append(Object.is(o,-0)?"-0":String(o)):typeof o=="boolean"?t.append(o?"true":"false"):typeof o>"u"?t.append("undefined"):typeof o=="bigint"?t.append("".concat(o,"n")):typeof o=="symbol"?U(t,o):typeof o=="function"?t.append("[Function]"):h(o,g)}try{return p(e,0),t.result()}catch(o){return"[Uninspectable]"}}var Re=new Set([..."\u060B$\u20BC\u17DB\xA5\u20A1\u20B1\xA3\u20AC\xA2\u20B9\uFDFC\u20AA\u20A9\u20AD\u20A8\u20AE\u20A6\u20BD\u20AB\u0E3F\u20A9\u20BA\u20B4","$U","$b","B/.","BZ$","Br","Bs","C$","CHF","Ft","Gs","J$","KM","K\u010D","L","MT","NT$","P","Q","R","R$","RD$","RM","Rp","S","S/.","TT$","Z$","kn","kr","lei","z\u0142","\u0192","\u0414\u0438\u043D.","\u0434\u0435\u043D","\u043B\u0432","\u062F.\u0625","Lek"]);var he=class{constructor(){$(this,"hasRepeatedReferences",!1);$(this,"clones",[]);$(this,"index");$(this,"sources",[])}get(e){if(this.index){let t=this.index.get(e);return t!==void 0&&(this.hasRepeatedReferences=!0),t}let r=this.sources.indexOf(e);if(r!==-1)return this.hasRepeatedReferences=!0,this.clones[r]}set(e,r){if(this.index){this.index.set(e,r);return}if(this.sources.push(e),this.clones.push(r),this.sources.length===32){this.index=new WeakMap;for(let t=0;t<this.sources.length;t++)this.index.set(this.sources[t],this.clones[t]);this.sources=[],this.clones=[]}}};function Q(e,r){let t=r.get(e);if(t!==void 0)return t;let n=e.slice(0);return r.set(e,n),n}function ge(e,r){if(typeof Buffer<"u"&&Buffer.isBuffer(e)){let i=Buffer.from(e);return r.set(e,i),i}let t=Q(e.buffer,r);if(e instanceof DataView){let i=new DataView(t,e.byteOffset,e.byteLength);return r.set(e,i),i}let n=e.constructor,s=new n(t,e.byteOffset,e.length);return r.set(e,s),s}function _(e,r,t,n){for(let s of t){let i=r[s];e[s]=typeof i!="object"||i===null?i:x(i,n)}}function x(e,r){if(typeof e!="object"||e===null)return e;let t=r.get(e);if(t!==void 0)return t;if(Array.isArray(e)){let i=e.length,a=new Array(i);r.set(e,a);let l=e,u=Object.keys(e);if(u.length===i&&(i===0||u[i-1]==="".concat(i-1)))for(let f=0;f<i;f++){let d=l[f];a[f]=typeof d!="object"||d===null?d:x(d,r)}else _(a,l,u,r);return a}let n=Object.getPrototypeOf(e);if(n===Object.prototype||n===null){let i={};return r.set(e,i),_(i,e,Object.keys(e),r),i}if(e instanceof Date){let i=new Date(e.getTime());return r.set(e,i),i}if(ArrayBuffer.isView(e))return ge(e,r);if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return Q(e,r);if(e instanceof Map){let i=new Map;r.set(e,i);for(let[a,l]of e)i.set(x(a,r),x(l,r));return i}if(e instanceof Set){let i=new Set;r.set(e,i);for(let a of e)i.add(x(a,r));return i}let s={};return r.set(e,s),_(s,e,Object.keys(e),r),s}function S(e){return x(e,new he)}function A(e){if(e==null||typeof e!="object")return!1;let r=Object.getPrototypeOf(e);return r!==null&&r!==Object.prototype&&Object.getPrototypeOf(r)!==null?!1:!(Symbol.iterator in e)&&!(Symbol.toStringTag in e)}function w(e){return typeof e=="string"}function I(e){return e!=null}var de=256,me=1024,be=1,ye=new Map,ve=new Map;function H(e){if(e>=97&&e<=122)return e-32;if(e>65535)return e;let r=String.fromCharCode(e).toUpperCase();if(r.length!==1)return e;let t=r.charCodeAt(0);return e>127&&t<128?e:t}function F(e,r,t,n,s,i){for(let a=0;a<s;a++){let l=e.charCodeAt(r+a),u=t.charCodeAt(n+a);if(i||(l>=97&&l<=122&&(l-=32),u>=97&&u<=122&&(u-=32)),l!==u)return!1}return!0}function z(e,r,t){let n=r.indexOf("\\");if(n===-1&&e===r)return!0;let s=r.indexOf("*");if(n===-1&&s===-1){if(t)return!1;for(let d=0;d<r.length;d++)if(r.charCodeAt(d)>127)return;return e.length===r.length&&F(e,0,r,0,r.length,!1)}if(n!==-1)return;let i=0,a=!1,l=-1;for(let d=0;d<r.length;d++){let c=r.charCodeAt(d);if(c>127)return;if(c===42){if(l=d,!a){if(i++,i>1)return;a=!0}}else a=!1}let u=l+1,f=r.length-u;return e.length<s+f?!1:F(e,0,r,0,s,t)&&F(e,e.length-f,r,u,f,t)}function we(e){let r=new Uint32Array(e.length),t=0;for(let n=1;n<e.length;n++){for(;t>0&&e[n]!==e[t];)t=r[t-1];e[n]===e[t]&&t++,r[n]=t}return r}function We(e,r){let t=[[]],n=!0,s=!1,i=!1,a=0;for(let h=0;h<e.length;){let p=e.codePointAt(h);if(p!==92){if(p===42)s=!0,i||(t.push([]),i=!0);else{let b=r?p:H(p);t[t.length-1].push(b),n&&(n=b<=127),a++,i=!1}h+=p>65535?2:1;continue}let o=h+1;for(;e.charCodeAt(o)===92;)o++;let g=o-h,m=e.codePointAt(o),y,v=!1;m===42?(v=g%2===0,y=v?g/2:(g-1)/2):m===void 0||m===10||m===13||m===8232||m===8233?y=Math.ceil(g/2):y=Math.floor(g/2);for(let b=0;b<y;b++)t[t.length-1].push(92),a++;if(v){i=!1,h=o;continue}if(m!==void 0){let b=r?m:H(m);t[t.length-1].push(b),n&&(n=b<=127),a++,o+=m>65535?2:1}i=!1,h=o}let l=s&&t[0].length===0,u=s&&t[t.length-1].length===0,f=[];for(let h of t)h.length&&f.push({values:h});let d=l?0:1,c=f.length-(u?0:1);for(let h=d;h<c;h++)f[h].values.length>be&&(f[h].failure=we(f[h].values));return{asciiOnly:n,endsWithWildcard:u,hasWildcard:s,minimumInputLength:a,segments:f,startsWithWildcard:l}}function Z(e,r){let t=r?ye:ve,n=e.length<=me;if(n){let i=t.get(e);if(i)return i}let s=We(e,r);if(n){if(t.size>=de){let i=t.keys().next().value;i!==void 0&&t.delete(i)}t.set(e,s)}return s}function q(e,r){if(r){let s=[];for(let i=0;i<e.length;){let a=e.codePointAt(i);s.push(a),i+=a>65535?2:1}return s}let t=new Uint32Array(e.length),n=0;for(let s=0;s<e.length;){let i=e.codePointAt(s);t[n]=H(i),n++,s+=i>65535?2:1}return n===t.length?t:t.subarray(0,n)}function R(e,r,t,n){for(let s=0;s<t.values.length;s++){let i=e.charCodeAt(r+s);if(!n&&i>=97&&i<=122&&(i-=32),i!==t.values[s])return!1}return!0}function Ae(e,r,t,n,s){let i=n-r.values.length;if(i<t)return-1;if(!r.failure){for(let l=t;l<=i;l++)if(R(e,l,r,s))return l;return-1}let a=0;for(let l=t;l<n;l++){let u=e.charCodeAt(l);for(!s&&u>=97&&u<=122&&(u-=32);a>0&&u!==r.values[a];)a=r.failure[a-1];if(u===r.values[a]&&(a++,a===r.values.length))return l-a+1}return-1}function Y(e,r,t){if(e.length<r.minimumInputLength)return!1;if(!r.hasWildcard)return e.length===r.minimumInputLength&&R(e,0,r.segments[0],t);let n=0,s=r.segments.length,i=0,a=e.length;if(!r.startsWithWildcard){let l=r.segments[0];if(!R(e,0,l,t))return!1;i=l.values.length,n++}if(!r.endsWithWildcard){s--;let l=r.segments[s];if(a-=l.values.length,!R(e,a,l,t))return!1}for(let l=n;l<s;l++){let u=r.segments[l],f=Ae(e,u,i,a,t);if(f===-1)return!1;i=f+u.values.length}return!0}function M(e,r,t){for(let n=0;n<t.values.length;n++)if(e[r+n]!==t.values[n])return!1;return!0}function Oe(e,r,t,n){let s=n-r.values.length;if(s<t)return-1;if(!r.failure){for(let a=t;a<=s;a++)if(M(e,a,r))return a;return-1}let i=0;for(let a=t;a<n;a++){for(;i>0&&e[a]!==r.values[i];)i=r.failure[i-1];if(e[a]===r.values[i]&&(i++,i===r.values.length))return a-i+1}return-1}function X(e,r){if(e.length<r.minimumInputLength)return!1;if(!r.hasWildcard)return e.length===r.minimumInputLength&&M(e,0,r.segments[0]);let t=0,n=r.segments.length,s=0,i=e.length;if(!r.startsWithWildcard){let a=r.segments[0];if(!M(e,0,a))return!1;s=a.values.length,t++}if(!r.endsWithWildcard){n--;let a=r.segments[n];if(i-=a.values.length,!M(e,i,a))return!1}for(let a=t;a<n;a++){let l=r.segments[a],u=Oe(e,l,s,i);if(u===-1)return!1;s=u+l.values.length}return!0}function Ce(e,r,t){let n=z(e,r,t);if(n!==void 0)return n;let s=Z(r,t);return s.asciiOnly?Y(e,s,t):X(q(e,t),s)}function G(e,r,t,n){var a;let s=z(e,r,t);if(s!==void 0)return s;let i=Z(r,t);return i.asciiOnly?Y(e,i,t):((a=n.tokens)!=null||(n.tokens=q(e,t)),X(n.tokens,i))}function ee(e,r,t){if(typeof r!="string"&&!r.length)return!1;let n=t===void 0?!1:t.caseSensitiveMatch===!0;if(typeof r=="string"){let l=r.charCodeAt(0)===33,u=l?r.slice(1):r,f=Ce(e,u,n);return l?!f:f}let s={},i=!1,a=!1;for(let l of r){let u=l.charCodeAt(0)===33,f=u?l.slice(1):l;if(u){if(G(e,f,n,s))return!1}else i=!0,!a&&G(e,f,n,s)&&(a=!0)}return i?a:!0}function N(e,r,t=0){if(typeof e!="string")throw new TypeError("str-indexes-of-plus/strIndexesOfPlus(): [THROW_ID_01] first input argument must be a string! Currently it's: ".concat(typeof e));if(typeof r!="string")throw new TypeError("str-indexes-of-plus/strIndexesOfPlus(): [THROW_ID_02] second input argument must be a string! Currently it's: ".concat(typeof r));let n=Number(t);if(!Number.isInteger(n)||n<0||typeof t=="string"&&!/^\d+$/.test(t))throw new TypeError("str-indexes-of-plus/strIndexesOfPlus(): [THROW_ID_03] third input argument must be a natural number! Currently it's: ".concat(t));let s=Array.from(e),i=Array.from(r);if(!s.length||!i.length||n>=s.length)return[];let a=[],l=s.length-i.length;e:for(let u=n;u<=l;u++){for(let f=0;f<i.length;f++)if(s[u+f]!==i[f])continue e;a.push(u)}return a}var te="7.2.0";var j={wrapHeadsWith:"%%_",wrapTailsWith:"_%%",dontWrapKeys:[],dontWrapPaths:[],xhtml:!0,preventDoubleWrapping:!0,preventWrappingIfContains:[],objectKeyAndValueJoinChar:".",wrapGlobalFlipSwitch:!0,ignore:[],whatToDoWhenReferenceIsMissing:0,mergeArraysWithLineBreaks:!0,mergeWithoutTrailingBrIfLineContainsBr:!0,enforceStrictKeyset:!0};function L(e,r){let t=W(W({},j),r);if(!e||Object.keys(e).length===0)return[];let n=S(e),s=[];return A(n)&&Object.keys(n).forEach(i=>{A(n[i])&&(n[i]=L(n[i],t)),Array.isArray(n[i])&&(s=s.concat(n[i].map(a=>"".concat(i).concat(t.objectKeyAndValueJoinChar).concat(a)))),w(n[i])&&s.push("".concat(i).concat(t.objectKeyAndValueJoinChar).concat(n[i]))}),s}function D(e,r,t=!1,n=!1){let s=W(W({},j),r);if(!e||e.length===0)return"";let i=S(e),a="";if(i.length)if(n){for(let l=0,u=i.length;l<u;l++)if(w(i[l])){let f;f="",s.mergeArraysWithLineBreaks&&l>0&&(!s.mergeWithoutTrailingBrIfLineContainsBr||typeof i[l-1]!="string"||s.mergeWithoutTrailingBrIfLineContainsBr&&i[l-1]!==void 0&&!i[l-1].toLowerCase().includes("<br"))&&(f="<br".concat(s.xhtml?" /":"",">")),a+="".concat(f).concat(t?s.wrapHeadsWith:"").concat(i[l]).concat(t?s.wrapTailsWith:"")}else if(Array.isArray(i[l])&&i[l].length&&i[l].every(w)){let f="";s.mergeArraysWithLineBreaks&&a.length&&(f="<br".concat(s.xhtml?" /":"",">")),a=i[l].reduce((d,c,h,p)=>{let o="";return h!==p.length-1&&(o=" "),d+(h===0?f:"")+(t?s.wrapHeadsWith:"")+c+(t?s.wrapTailsWith:"")+o},a)}}else a=i.reduce((l,u,f,d)=>{let c="";s.mergeArraysWithLineBreaks&&f>0&&(c="<br".concat(s.xhtml?" /":"",">"));let h="";return f!==d.length-1&&(h=" "),"".concat(l).concat(f===0?c:"").concat(t?s.wrapHeadsWith:"").concat(u).concat(t?s.wrapTailsWith:"").concat(h)},a);return a}var $e=te;function Se(e,r,t){if(!A(e))throw new Error("object-flatten-referencing/flattenReferencing(): [THROW_ID_01] the first input argument must be a plain object! It was given as ".concat(B(e,4)," (its typeof was ").concat(typeof e,")."));if(!A(r))throw new Error("object-flatten-referencing/flattenReferencing(): [THROW_ID_02] the second input argument must be a plain object! It was given as ".concat(B(r,4)," (its typeof was ").concat(typeof r,")."));if(t&&!A(t))throw new Error("object-flatten-referencing/flattenReferencing(): [THROW_ID_03] the third input argument must be a plain object! It was given as ".concat(B(t,4)," (its typeof was ").concat(typeof t,")."));let n=W(W({},j),t);n.dontWrapKeys=C(n.dontWrapKeys),n.preventWrappingIfContains=C(n.preventWrappingIfContains),n.dontWrapPaths=C(n.dontWrapPaths),n.ignore=C(n.ignore),typeof n.whatToDoWhenReferenceIsMissing!="number"&&(n.whatToDoWhenReferenceIsMissing=+n.whatToDoWhenReferenceIsMissing||0);function s(i,a,l,u=!0,f=!0,d=""){let c=i,h=a;return l.wrapGlobalFlipSwitch||(u=!1),A(c)?Object.keys(c).forEach(p=>{let o=d+(d.length===0?p:".".concat(p));if(l.ignore.length===0||!l.ignore.includes(p)){if(l.wrapGlobalFlipSwitch&&(u=!0,l.dontWrapKeys.length&&(u=u&&!l.dontWrapKeys.some(g=>ee(p,g,{caseSensitiveMatch:!0}))),l.dontWrapPaths.length&&(u=u&&!l.dontWrapPaths.some(g=>g===o)),l.preventWrappingIfContains.length&&typeof c[p]=="string"&&(u=u&&!l.preventWrappingIfContains.some(g=>c[p].includes(g)))),I(h[p])||!I(h[p])&&l.whatToDoWhenReferenceIsMissing===2)if(Array.isArray(c[p]))if(l.whatToDoWhenReferenceIsMissing===2||w(h[p]))c[p]=D(c[p],l,u,f);else{if(c[p].every(g=>typeof g=="string"||Array.isArray(g))){let g=!0;c[p].forEach(m=>{Array.isArray(m)&&!m.every(w)&&(g=!1)}),g&&(f=!1)}c[p]=s(c[p],h[p],l,u,f,o)}else A(c[p])?l.whatToDoWhenReferenceIsMissing===2||w(h[p])?c[p]=D(L(c[p],l),l,u,f):u?c[p]=s(c[p],h[p],l,u,f,o):c[p]=s(c[p],h[p],V(W({},l),{wrapGlobalFlipSwitch:!1}),u,f,o):w(c[p])&&(c[p]=s(c[p],h[p],l,u,f,o));else if(typeof c[p]!=typeof h[p]&&l.whatToDoWhenReferenceIsMissing===1)throw new Error("object-flatten-referencing/flattenReferencing(): [THROW_ID_04] resolvedReference object does not have the key ".concat(p," and we need it. TIP: Turn off throwing via opts2.whatToDoWhenReferenceIsMissing."))}}):Array.isArray(c)?Array.isArray(h)?c.forEach((p,o)=>{I(c[o])&&I(h[o])?c[o]=s(c[o],h[o],l,u,f,"".concat(d,"[").concat(o,"]")):c[o]=s(c[o],h[0],l,u,f,"".concat(d,"[").concat(o,"]"))}):w(h)&&(c=D(c,l,u,f)):w(c)&&c.length&&(l.wrapHeadsWith||l.wrapTailsWith)&&(!l.preventDoubleWrapping||(l.wrapHeadsWith===""||!N(c,l.wrapHeadsWith.trim()).length)&&(l.wrapTailsWith===""||!N(c,l.wrapTailsWith.trim()).length))&&(c="".concat(u?l.wrapHeadsWith:"").concat(c).concat(u?l.wrapTailsWith:"")),c}return s(S(e),r,n)}return ue(Ie);})();
10
+ "use strict";var objectFlattenReferencing=(()=>{var T=Object.defineProperty,re=Object.defineProperties,ne=Object.getOwnPropertyDescriptor,ie=Object.getOwnPropertyDescriptors,se=Object.getOwnPropertyNames,k=Object.getOwnPropertySymbols;var K=Object.prototype.hasOwnProperty,le=Object.prototype.propertyIsEnumerable;var E=(e,r,t)=>r in e?T(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,W=(e,r)=>{for(var t in r||(r={}))K.call(r,t)&&E(e,t,r[t]);if(k)for(var t of k(r))le.call(r,t)&&E(e,t,r[t]);return e},V=(e,r)=>re(e,ie(r));var ae=(e,r)=>{for(var t in r)T(e,t,{get:r[t],enumerable:!0})},oe=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of se(r))!K.call(e,s)&&s!==t&&T(e,s,{get:()=>r[s],enumerable:!(n=ne(r,s))||n.enumerable});return e};var ue=e=>oe(T({},"__esModule",{value:!0}),e);var $=(e,r,t)=>E(e,typeof r!="symbol"?r+"":r,t);var Ie={};ae(Ie,{arrayiffy:()=>C,defaults:()=>j,flattenArr:()=>D,flattenObject:()=>L,flattenReferencing:()=>Se,version:()=>$e});function C(e){return typeof e!="string"?e:e.length?[e]:[]}function fe(){let e=[],r=0,t=!1;return{append(n){return t?!1:r+n.length>1999?(e.push("\u2026"),r+=1,t=!0,!1):(e.push(n),r+=n.length,!0)},result(){return e.join("")},stopped(){return t}}}function ce(e){return"\\u".concat(e.toString(16).padStart(4,"0"))}function P(e,r){if(e.append('"')){for(let t=0;t<r.length&&!e.stopped();t+=1){let n=r.charCodeAt(t);n===34?e.append('\\"'):n===92?e.append("\\\\"):n===8?e.append("\\b"):n===9?e.append("\\t"):n===10?e.append("\\n"):n===12?e.append("\\f"):n===13?e.append("\\r"):n<32||n===8232||n===8233||n>=55296&&n<=57343?e.append(ce(n)):e.append(r[t])}e.append('"')}}function pe(e){return e.get&&e.set?"[Getter/Setter]":e.get?"[Getter]":e.set?"[Setter]":"[Accessor]"}function U(e,r){e.append("Symbol(");let t=String(r);t.length>8&&P(e,t.slice(7,-1)),e.append(")")}function J(e,r){typeof r=="symbol"?U(e,r):P(e,String(r))}function B(e,r=0){let t=fe(),n=r===4?4:0,s=new WeakSet,i=0;function a(o){n&&t.append(" ".repeat(o*n))}function l(o,g){o&&t.append(","),n&&(t.append("\n"),a(g+1))}function u(o,g,m){n&&g&&(t.append("\n"),a(m)),t.append(o)}function f(o,g){Object.prototype.hasOwnProperty.call(o,"value")?p(o.value,g):t.append(pe(o))}function d(o,g){let m;try{m=Reflect.getOwnPropertyDescriptor(o,"length")}catch(b){t.append("[Uninspectable]");return}let y=m==null?void 0:m.value;if(!Number.isSafeInteger(y)||y<0){t.append("[Uninspectable]");return}t.append("[");let v=!1;for(let b=0;b<y&&!t.stopped();b+=1){if(l(v,g),v=!0,i>=50){t.append("[MaxEntries]");break}i+=1;let O;try{O=Reflect.getOwnPropertyDescriptor(o,String(b))}catch(je){t.append("[Uninspectable]");continue}O!=null&&O.enumerable?f(O,g+1):t.append("[Empty]")}u("]",v,g)}function c(o,g){let m;try{m=Reflect.ownKeys(o)}catch(v){t.append("[Uninspectable]");return}t.append("{");let y=!1;for(let v of m){if(t.stopped())break;if(i>=50){l(y,g),y=!0,P(t,"\u2026"),t.append(n?": ":":"),t.append("[MaxEntries]");break}i+=1;let b;try{b=Reflect.getOwnPropertyDescriptor(o,v)}catch(O){l(y,g),y=!0,J(t,v),t.append(n?": ":":"),t.append("[Uninspectable]");continue}b!=null&&b.enumerable&&(l(y,g),y=!0,J(t,v),t.append(n?": ":":"),f(b,g+1))}u("}",y,g)}function h(o,g){if(s.has(o)){t.append("[Circular]");return}if(g>=5){t.append("[MaxDepth]");return}let m;try{m=Array.isArray(o)}catch(y){t.append("[Uninspectable]");return}s.add(o);try{m?d(o,g):c(o,g)}finally{s.delete(o)}}function p(o,g){o===null?t.append("null"):typeof o=="string"?P(t,o):typeof o=="number"?t.append(Object.is(o,-0)?"-0":String(o)):typeof o=="boolean"?t.append(o?"true":"false"):typeof o>"u"?t.append("undefined"):typeof o=="bigint"?t.append("".concat(o,"n")):typeof o=="symbol"?U(t,o):typeof o=="function"?t.append("[Function]"):h(o,g)}try{return p(e,0),t.result()}catch(o){return"[Uninspectable]"}}var Re=new Set([..."\u060B$\u20BC\u17DB\xA5\u20A1\u20B1\xA3\u20AC\xA2\u20B9\uFDFC\u20AA\u20A9\u20AD\u20A8\u20AE\u20A6\u20BD\u20AB\u0E3F\u20A9\u20BA\u20B4","$U","$b","B/.","BZ$","Br","Bs","C$","CHF","Ft","Gs","J$","KM","K\u010D","L","MT","NT$","P","Q","R","R$","RD$","RM","Rp","S","S/.","TT$","Z$","kn","kr","lei","z\u0142","\u0192","\u0414\u0438\u043D.","\u0434\u0435\u043D","\u043B\u0432","\u062F.\u0625","Lek"]);var he=class{constructor(){$(this,"hasRepeatedReferences",!1);$(this,"clones",[]);$(this,"index");$(this,"sources",[])}get(e){if(this.index){let t=this.index.get(e);return t!==void 0&&(this.hasRepeatedReferences=!0),t}let r=this.sources.indexOf(e);if(r!==-1)return this.hasRepeatedReferences=!0,this.clones[r]}set(e,r){if(this.index){this.index.set(e,r);return}if(this.sources.push(e),this.clones.push(r),this.sources.length===32){this.index=new WeakMap;for(let t=0;t<this.sources.length;t++)this.index.set(this.sources[t],this.clones[t]);this.sources=[],this.clones=[]}}};function Q(e,r){let t=r.get(e);if(t!==void 0)return t;let n=e.slice(0);return r.set(e,n),n}function ge(e,r){if(typeof Buffer<"u"&&Buffer.isBuffer(e)){let i=Buffer.from(e);return r.set(e,i),i}let t=Q(e.buffer,r);if(e instanceof DataView){let i=new DataView(t,e.byteOffset,e.byteLength);return r.set(e,i),i}let n=e.constructor,s=new n(t,e.byteOffset,e.length);return r.set(e,s),s}function _(e,r,t,n){for(let s of t){let i=r[s];e[s]=typeof i!="object"||i===null?i:x(i,n)}}function x(e,r){if(typeof e!="object"||e===null)return e;let t=r.get(e);if(t!==void 0)return t;if(Array.isArray(e)){let i=e.length,a=new Array(i);r.set(e,a);let l=e,u=Object.keys(e);if(u.length===i&&(i===0||u[i-1]==="".concat(i-1)))for(let f=0;f<i;f++){let d=l[f];a[f]=typeof d!="object"||d===null?d:x(d,r)}else _(a,l,u,r);return a}let n=Object.getPrototypeOf(e);if(n===Object.prototype||n===null){let i={};return r.set(e,i),_(i,e,Object.keys(e),r),i}if(e instanceof Date){let i=new Date(e.getTime());return r.set(e,i),i}if(ArrayBuffer.isView(e))return ge(e,r);if(e instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer)return Q(e,r);if(e instanceof Map){let i=new Map;r.set(e,i);for(let[a,l]of e)i.set(x(a,r),x(l,r));return i}if(e instanceof Set){let i=new Set;r.set(e,i);for(let a of e)i.add(x(a,r));return i}let s={};return r.set(e,s),_(s,e,Object.keys(e),r),s}function S(e){return x(e,new he)}function A(e){if(e==null||typeof e!="object")return!1;let r=Object.getPrototypeOf(e);return r!==null&&r!==Object.prototype&&Object.getPrototypeOf(r)!==null?!1:!(Symbol.iterator in e)&&!(Symbol.toStringTag in e)}function w(e){return typeof e=="string"}function I(e){return e!=null}var de=256,me=1024,be=1,ye=new Map,ve=new Map;function H(e){if(e>=97&&e<=122)return e-32;if(e>65535)return e;let r=String.fromCharCode(e).toUpperCase();if(r.length!==1)return e;let t=r.charCodeAt(0);return e>127&&t<128?e:t}function F(e,r,t,n,s,i){for(let a=0;a<s;a++){let l=e.charCodeAt(r+a),u=t.charCodeAt(n+a);if(i||(l>=97&&l<=122&&(l-=32),u>=97&&u<=122&&(u-=32)),l!==u)return!1}return!0}function z(e,r,t){let n=r.indexOf("\\");if(n===-1&&e===r)return!0;let s=r.indexOf("*");if(n===-1&&s===-1){if(t)return!1;for(let d=0;d<r.length;d++)if(r.charCodeAt(d)>127)return;return e.length===r.length&&F(e,0,r,0,r.length,!1)}if(n!==-1)return;let i=0,a=!1,l=-1;for(let d=0;d<r.length;d++){let c=r.charCodeAt(d);if(c>127)return;if(c===42){if(l=d,!a){if(i++,i>1)return;a=!0}}else a=!1}let u=l+1,f=r.length-u;return e.length<s+f?!1:F(e,0,r,0,s,t)&&F(e,e.length-f,r,u,f,t)}function we(e){let r=new Uint32Array(e.length),t=0;for(let n=1;n<e.length;n++){for(;t>0&&e[n]!==e[t];)t=r[t-1];e[n]===e[t]&&t++,r[n]=t}return r}function We(e,r){let t=[[]],n=!0,s=!1,i=!1,a=0;for(let h=0;h<e.length;){let p=e.codePointAt(h);if(p!==92){if(p===42)s=!0,i||(t.push([]),i=!0);else{let b=r?p:H(p);t[t.length-1].push(b),n&&(n=b<=127),a++,i=!1}h+=p>65535?2:1;continue}let o=h+1;for(;e.charCodeAt(o)===92;)o++;let g=o-h,m=e.codePointAt(o),y,v=!1;m===42?(v=g%2===0,y=v?g/2:(g-1)/2):m===void 0||m===10||m===13||m===8232||m===8233?y=Math.ceil(g/2):y=Math.floor(g/2);for(let b=0;b<y;b++)t[t.length-1].push(92),a++;if(v){i=!1,h=o;continue}if(m!==void 0){let b=r?m:H(m);t[t.length-1].push(b),n&&(n=b<=127),a++,o+=m>65535?2:1}i=!1,h=o}let l=s&&t[0].length===0,u=s&&t[t.length-1].length===0,f=[];for(let h of t)h.length&&f.push({values:h});let d=l?0:1,c=f.length-(u?0:1);for(let h=d;h<c;h++)f[h].values.length>be&&(f[h].failure=we(f[h].values));return{asciiOnly:n,endsWithWildcard:u,hasWildcard:s,minimumInputLength:a,segments:f,startsWithWildcard:l}}function Z(e,r){let t=r?ye:ve,n=e.length<=me;if(n){let i=t.get(e);if(i)return i}let s=We(e,r);if(n){if(t.size>=de){let i=t.keys().next().value;i!==void 0&&t.delete(i)}t.set(e,s)}return s}function q(e,r){if(r){let s=[];for(let i=0;i<e.length;){let a=e.codePointAt(i);s.push(a),i+=a>65535?2:1}return s}let t=new Uint32Array(e.length),n=0;for(let s=0;s<e.length;){let i=e.codePointAt(s);t[n]=H(i),n++,s+=i>65535?2:1}return n===t.length?t:t.subarray(0,n)}function R(e,r,t,n){for(let s=0;s<t.values.length;s++){let i=e.charCodeAt(r+s);if(!n&&i>=97&&i<=122&&(i-=32),i!==t.values[s])return!1}return!0}function Ae(e,r,t,n,s){let i=n-r.values.length;if(i<t)return-1;if(!r.failure){for(let l=t;l<=i;l++)if(R(e,l,r,s))return l;return-1}let a=0;for(let l=t;l<n;l++){let u=e.charCodeAt(l);for(!s&&u>=97&&u<=122&&(u-=32);a>0&&u!==r.values[a];)a=r.failure[a-1];if(u===r.values[a]&&(a++,a===r.values.length))return l-a+1}return-1}function Y(e,r,t){if(e.length<r.minimumInputLength)return!1;if(!r.hasWildcard)return e.length===r.minimumInputLength&&R(e,0,r.segments[0],t);let n=0,s=r.segments.length,i=0,a=e.length;if(!r.startsWithWildcard){let l=r.segments[0];if(!R(e,0,l,t))return!1;i=l.values.length,n++}if(!r.endsWithWildcard){s--;let l=r.segments[s];if(a-=l.values.length,!R(e,a,l,t))return!1}for(let l=n;l<s;l++){let u=r.segments[l],f=Ae(e,u,i,a,t);if(f===-1)return!1;i=f+u.values.length}return!0}function M(e,r,t){for(let n=0;n<t.values.length;n++)if(e[r+n]!==t.values[n])return!1;return!0}function Oe(e,r,t,n){let s=n-r.values.length;if(s<t)return-1;if(!r.failure){for(let a=t;a<=s;a++)if(M(e,a,r))return a;return-1}let i=0;for(let a=t;a<n;a++){for(;i>0&&e[a]!==r.values[i];)i=r.failure[i-1];if(e[a]===r.values[i]&&(i++,i===r.values.length))return a-i+1}return-1}function X(e,r){if(e.length<r.minimumInputLength)return!1;if(!r.hasWildcard)return e.length===r.minimumInputLength&&M(e,0,r.segments[0]);let t=0,n=r.segments.length,s=0,i=e.length;if(!r.startsWithWildcard){let a=r.segments[0];if(!M(e,0,a))return!1;s=a.values.length,t++}if(!r.endsWithWildcard){n--;let a=r.segments[n];if(i-=a.values.length,!M(e,i,a))return!1}for(let a=t;a<n;a++){let l=r.segments[a],u=Oe(e,l,s,i);if(u===-1)return!1;s=u+l.values.length}return!0}function Ce(e,r,t){let n=z(e,r,t);if(n!==void 0)return n;let s=Z(r,t);return s.asciiOnly?Y(e,s,t):X(q(e,t),s)}function G(e,r,t,n){var a;let s=z(e,r,t);if(s!==void 0)return s;let i=Z(r,t);return i.asciiOnly?Y(e,i,t):((a=n.tokens)!=null||(n.tokens=q(e,t)),X(n.tokens,i))}function ee(e,r,t){if(typeof r!="string"&&!r.length)return!1;let n=t===void 0?!1:t.caseSensitiveMatch===!0;if(typeof r=="string"){let l=r.charCodeAt(0)===33,u=l?r.slice(1):r,f=Ce(e,u,n);return l?!f:f}let s={},i=!1,a=!1;for(let l of r){let u=l.charCodeAt(0)===33,f=u?l.slice(1):l;if(u){if(G(e,f,n,s))return!1}else i=!0,!a&&G(e,f,n,s)&&(a=!0)}return i?a:!0}function N(e,r,t=0){if(typeof e!="string")throw new TypeError("str-indexes-of-plus/strIndexesOfPlus(): [THROW_ID_01] first input argument must be a string! Currently it's: ".concat(typeof e));if(typeof r!="string")throw new TypeError("str-indexes-of-plus/strIndexesOfPlus(): [THROW_ID_02] second input argument must be a string! Currently it's: ".concat(typeof r));let n=Number(t);if(!Number.isInteger(n)||n<0||typeof t=="string"&&!/^\d+$/.test(t))throw new TypeError("str-indexes-of-plus/strIndexesOfPlus(): [THROW_ID_03] third input argument must be a natural number! Currently it's: ".concat(t));let s=Array.from(e),i=Array.from(r);if(!s.length||!i.length||n>=s.length)return[];let a=[],l=s.length-i.length;e:for(let u=n;u<=l;u++){for(let f=0;f<i.length;f++)if(s[u+f]!==i[f])continue e;a.push(u)}return a}var te="7.2.1";var j={wrapHeadsWith:"%%_",wrapTailsWith:"_%%",dontWrapKeys:[],dontWrapPaths:[],xhtml:!0,preventDoubleWrapping:!0,preventWrappingIfContains:[],objectKeyAndValueJoinChar:".",wrapGlobalFlipSwitch:!0,ignore:[],whatToDoWhenReferenceIsMissing:0,mergeArraysWithLineBreaks:!0,mergeWithoutTrailingBrIfLineContainsBr:!0,enforceStrictKeyset:!0};function L(e,r){let t=W(W({},j),r);if(!e||Object.keys(e).length===0)return[];let n=S(e),s=[];return A(n)&&Object.keys(n).forEach(i=>{A(n[i])&&(n[i]=L(n[i],t)),Array.isArray(n[i])&&(s=s.concat(n[i].map(a=>"".concat(i).concat(t.objectKeyAndValueJoinChar).concat(a)))),w(n[i])&&s.push("".concat(i).concat(t.objectKeyAndValueJoinChar).concat(n[i]))}),s}function D(e,r,t=!1,n=!1){let s=W(W({},j),r);if(!e||e.length===0)return"";let i=S(e),a="";if(i.length)if(n){for(let l=0,u=i.length;l<u;l++)if(w(i[l])){let f;f="",s.mergeArraysWithLineBreaks&&l>0&&(!s.mergeWithoutTrailingBrIfLineContainsBr||typeof i[l-1]!="string"||s.mergeWithoutTrailingBrIfLineContainsBr&&i[l-1]!==void 0&&!i[l-1].toLowerCase().includes("<br"))&&(f="<br".concat(s.xhtml?" /":"",">")),a+="".concat(f).concat(t?s.wrapHeadsWith:"").concat(i[l]).concat(t?s.wrapTailsWith:"")}else if(Array.isArray(i[l])&&i[l].length&&i[l].every(w)){let f="";s.mergeArraysWithLineBreaks&&a.length&&(f="<br".concat(s.xhtml?" /":"",">")),a=i[l].reduce((d,c,h,p)=>{let o="";return h!==p.length-1&&(o=" "),d+(h===0?f:"")+(t?s.wrapHeadsWith:"")+c+(t?s.wrapTailsWith:"")+o},a)}}else a=i.reduce((l,u,f,d)=>{let c="";s.mergeArraysWithLineBreaks&&f>0&&(c="<br".concat(s.xhtml?" /":"",">"));let h="";return f!==d.length-1&&(h=" "),"".concat(l).concat(f===0?c:"").concat(t?s.wrapHeadsWith:"").concat(u).concat(t?s.wrapTailsWith:"").concat(h)},a);return a}var $e=te;function Se(e,r,t){if(!A(e))throw new Error("object-flatten-referencing/flattenReferencing(): [THROW_ID_01] the first input argument must be a plain object! It was given as ".concat(B(e,4)," (its typeof was ").concat(typeof e,")."));if(!A(r))throw new Error("object-flatten-referencing/flattenReferencing(): [THROW_ID_02] the second input argument must be a plain object! It was given as ".concat(B(r,4)," (its typeof was ").concat(typeof r,")."));if(t&&!A(t))throw new Error("object-flatten-referencing/flattenReferencing(): [THROW_ID_03] the third input argument must be a plain object! It was given as ".concat(B(t,4)," (its typeof was ").concat(typeof t,")."));let n=W(W({},j),t);n.dontWrapKeys=C(n.dontWrapKeys),n.preventWrappingIfContains=C(n.preventWrappingIfContains),n.dontWrapPaths=C(n.dontWrapPaths),n.ignore=C(n.ignore),typeof n.whatToDoWhenReferenceIsMissing!="number"&&(n.whatToDoWhenReferenceIsMissing=+n.whatToDoWhenReferenceIsMissing||0);function s(i,a,l,u=!0,f=!0,d=""){let c=i,h=a;return l.wrapGlobalFlipSwitch||(u=!1),A(c)?Object.keys(c).forEach(p=>{let o=d+(d.length===0?p:".".concat(p));if(l.ignore.length===0||!l.ignore.includes(p)){if(l.wrapGlobalFlipSwitch&&(u=!0,l.dontWrapKeys.length&&(u=u&&!l.dontWrapKeys.some(g=>ee(p,g,{caseSensitiveMatch:!0}))),l.dontWrapPaths.length&&(u=u&&!l.dontWrapPaths.some(g=>g===o)),l.preventWrappingIfContains.length&&typeof c[p]=="string"&&(u=u&&!l.preventWrappingIfContains.some(g=>c[p].includes(g)))),I(h[p])||!I(h[p])&&l.whatToDoWhenReferenceIsMissing===2)if(Array.isArray(c[p]))if(l.whatToDoWhenReferenceIsMissing===2||w(h[p]))c[p]=D(c[p],l,u,f);else{if(c[p].every(g=>typeof g=="string"||Array.isArray(g))){let g=!0;c[p].forEach(m=>{Array.isArray(m)&&!m.every(w)&&(g=!1)}),g&&(f=!1)}c[p]=s(c[p],h[p],l,u,f,o)}else A(c[p])?l.whatToDoWhenReferenceIsMissing===2||w(h[p])?c[p]=D(L(c[p],l),l,u,f):u?c[p]=s(c[p],h[p],l,u,f,o):c[p]=s(c[p],h[p],V(W({},l),{wrapGlobalFlipSwitch:!1}),u,f,o):w(c[p])&&(c[p]=s(c[p],h[p],l,u,f,o));else if(typeof c[p]!=typeof h[p]&&l.whatToDoWhenReferenceIsMissing===1)throw new Error("object-flatten-referencing/flattenReferencing(): [THROW_ID_04] resolvedReference object does not have the key ".concat(p," and we need it. TIP: Turn off throwing via opts2.whatToDoWhenReferenceIsMissing."))}}):Array.isArray(c)?Array.isArray(h)?c.forEach((p,o)=>{I(c[o])&&I(h[o])?c[o]=s(c[o],h[o],l,u,f,"".concat(d,"[").concat(o,"]")):c[o]=s(c[o],h[0],l,u,f,"".concat(d,"[").concat(o,"]"))}):w(h)&&(c=D(c,l,u,f)):w(c)&&c.length&&(l.wrapHeadsWith||l.wrapTailsWith)&&(!l.preventDoubleWrapping||(l.wrapHeadsWith===""||!N(c,l.wrapHeadsWith.trim()).length)&&(l.wrapTailsWith===""||!N(c,l.wrapTailsWith.trim()).length))&&(c="".concat(u?l.wrapHeadsWith:"").concat(c).concat(u?l.wrapTailsWith:"")),c}return s(S(e),r,n)}return ue(Ie);})();
11
11
  /**
12
12
  * @name arrayiffy-if-string
13
13
  * @fileoverview Put non-empty strings into arrays, turn empty-ones into empty arrays. Bypass everything else.
14
- * @version 5.2.0
14
+ * @version 5.2.1
15
15
  * @author Roy Revelt
16
16
  * @license MIT
17
17
  * {@link https://codsen.com/os/arrayiffy-if-string/}
@@ -27,7 +27,7 @@
27
27
  /**
28
28
  * @name str-indexes-of-plus
29
29
  * @fileoverview Like indexOf but returns array and counts per-grapheme
30
- * @version 5.2.0
30
+ * @version 5.2.1
31
31
  * @author Roy Revelt
32
32
  * @license MIT
33
33
  * {@link https://codsen.com/os/str-indexes-of-plus/}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "object-flatten-referencing",
3
- "version": "7.2.0",
3
+ "version": "7.2.1",
4
4
  "description": "Flatten complex nested objects according to a reference objects",
5
5
  "keywords": [
6
6
  "advanced",
@@ -66,9 +66,9 @@
66
66
  }
67
67
  },
68
68
  "dependencies": {
69
- "arrayiffy-if-string": "^5.2.0",
69
+ "arrayiffy-if-string": "^5.2.1",
70
70
  "codsen-utils": "^1.8.0",
71
- "str-indexes-of-plus": "^5.2.0"
71
+ "str-indexes-of-plus": "^5.2.1"
72
72
  },
73
73
  "engines": {
74
74
  "node": ">=18.20.8"