html-crush 5.0.7 → 5.0.10

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,86 +1,113 @@
1
1
  /**
2
2
  * @name html-crush
3
3
  * @fileoverview Minifies HTML/CSS: valid or broken, pure or mixed with other languages
4
- * @version 5.0.7
4
+ * @version 5.0.10
5
5
  * @author Roy Revelt, Codsen Ltd
6
6
  * @license MIT
7
7
  * {@link https://codsen.com/os/html-crush/}
8
8
  */
9
9
 
10
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).htmlCrush={})}(this,(function(e){"use strict";
10
+ var htmlCrush=(()=>{var ln=Object.create;var ee=Object.defineProperty;var sn=Object.getOwnPropertyDescriptor;var an=Object.getOwnPropertyNames,ke=Object.getOwnPropertySymbols,un=Object.getPrototypeOf,Be=Object.prototype.hasOwnProperty,gn=Object.prototype.propertyIsEnumerable;var ye=(e,t,r)=>t in e?ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,S=(e,t)=>{for(var r in t||(t={}))Be.call(t,r)&&ye(e,r,t[r]);if(ke)for(var r of ke(t))gn.call(t,r)&&ye(e,r,t[r]);return e};var Ue=e=>ee(e,"__esModule",{value:!0});var Ge=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),cn=(e,t)=>{for(var r in t)ee(e,r,{get:t[r],enumerable:!0})},qe=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of an(t))!Be.call(e,a)&&(r||a!=="default")&&ee(e,a,{get:()=>t[a],enumerable:!(n=sn(t,a))||n.enumerable});return e},Ke=(e,t)=>qe(Ue(ee(e!=null?ln(un(e)):{},"default",!t&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),fn=(e=>(t,r)=>e&&e.get(t)||(r=qe(Ue({}),t,1),e&&e.set(t,r),r))(typeof WeakMap!="undefined"?new WeakMap:0);var Ee=(e,t,r)=>(ye(e,typeof t!="symbol"?t+"":t,r),r);var ut=Ge((Ci,at)=>{var En="[object Object]";function Sn(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(r){}return t}function wn(e,t){return function(r){return e(t(r))}}var On=Function.prototype,lt=Object.prototype,st=On.toString,Ln=lt.hasOwnProperty,Dn=st.call(Object),An=lt.toString,Cn=wn(Object.getPrototypeOf,Object);function In(e){return!!e&&typeof e=="object"}function _n(e){if(!In(e)||An.call(e)!=En||Sn(e))return!1;var t=Cn(e);if(t===null)return!0;var r=Ln.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&st.call(r)==Dn}at.exports=_n});var zt=Ge((ie,q)=>{var Nn=200,gt="__lodash_hash_undefined__",ct=9007199254740991,De="[object Arguments]",vn="[object Array]",ft="[object Boolean]",mt="[object Date]",Vn="[object Error]",Ae="[object Function]",ht="[object GeneratorFunction]",ue="[object Map]",$t="[object Number]",Ce="[object Object]",pt="[object Promise]",bt="[object RegExp]",ge="[object Set]",dt="[object String]",Tt="[object Symbol]",Ie="[object WeakMap]",yt="[object ArrayBuffer]",ce="[object DataView]",Et="[object Float32Array]",St="[object Float64Array]",wt="[object Int8Array]",Ot="[object Int16Array]",Lt="[object Int32Array]",Dt="[object Uint8Array]",At="[object Uint8ClampedArray]",Ct="[object Uint16Array]",It="[object Uint32Array]",Rn=/[\\^$.*+?()[\]{}|]/g,Mn=/\w*$/,Pn=/^\[object .+?Constructor\]$/,Hn=/^(?:0|[1-9]\d*)$/,w={};w[De]=w[vn]=w[yt]=w[ce]=w[ft]=w[mt]=w[Et]=w[St]=w[wt]=w[Ot]=w[Lt]=w[ue]=w[$t]=w[Ce]=w[bt]=w[ge]=w[dt]=w[Tt]=w[Dt]=w[At]=w[Ct]=w[It]=!0;w[Vn]=w[Ae]=w[Ie]=!1;var Fn=typeof global=="object"&&global&&global.Object===Object&&global,xn=typeof self=="object"&&self&&self.Object===Object&&self,N=Fn||xn||Function("return this")(),_t=typeof ie=="object"&&ie&&!ie.nodeType&&ie,Nt=_t&&typeof q=="object"&&q&&!q.nodeType&&q,Wn=Nt&&Nt.exports===_t;function Jn(e,t){return e.set(t[0],t[1]),e}function jn(e,t){return e.add(t),e}function kn(e,t){for(var r=-1,n=e?e.length:0;++r<n&&t(e[r],r,e)!==!1;);return e}function Bn(e,t){for(var r=-1,n=t.length,a=e.length;++r<n;)e[a+r]=t[r];return e}function vt(e,t,r,n){var a=-1,o=e?e.length:0;for(n&&o&&(r=e[++a]);++a<o;)r=t(r,e[a],a,e);return r}function Un(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function Gn(e,t){return e==null?void 0:e[t]}function Vt(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(r){}return t}function Rt(e){var t=-1,r=Array(e.size);return e.forEach(function(n,a){r[++t]=[a,n]}),r}function _e(e,t){return function(r){return e(t(r))}}function Mt(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var qn=Array.prototype,Kn=Function.prototype,fe=Object.prototype,Ne=N["__core-js_shared__"],Pt=function(){var e=/[^.]+$/.exec(Ne&&Ne.keys&&Ne.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Ht=Kn.toString,H=fe.hasOwnProperty,me=fe.toString,Yn=RegExp("^"+Ht.call(H).replace(Rn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ft=Wn?N.Buffer:void 0,xt=N.Symbol,Wt=N.Uint8Array,Xn=_e(Object.getPrototypeOf,Object),zn=Object.create,Zn=fe.propertyIsEnumerable,Qn=qn.splice,Jt=Object.getOwnPropertySymbols,er=Ft?Ft.isBuffer:void 0,tr=_e(Object.keys,Object),ve=G(N,"DataView"),ne=G(N,"Map"),Ve=G(N,"Promise"),Re=G(N,"Set"),Me=G(N,"WeakMap"),re=G(Object,"create"),nr=W(ve),rr=W(ne),ir=W(Ve),or=W(Re),lr=W(Me),jt=xt?xt.prototype:void 0,kt=jt?jt.valueOf:void 0;function F(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function sr(){this.__data__=re?re(null):{}}function ar(e){return this.has(e)&&delete this.__data__[e]}function ur(e){var t=this.__data__;if(re){var r=t[e];return r===gt?void 0:r}return H.call(t,e)?t[e]:void 0}function gr(e){var t=this.__data__;return re?t[e]!==void 0:H.call(t,e)}function cr(e,t){var r=this.__data__;return r[e]=re&&t===void 0?gt:t,this}F.prototype.clear=sr;F.prototype.delete=ar;F.prototype.get=ur;F.prototype.has=gr;F.prototype.set=cr;function v(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function fr(){this.__data__=[]}function mr(e){var t=this.__data__,r=he(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():Qn.call(t,r,1),!0}function hr(e){var t=this.__data__,r=he(t,e);return r<0?void 0:t[r][1]}function $r(e){return he(this.__data__,e)>-1}function pr(e,t){var r=this.__data__,n=he(r,e);return n<0?r.push([e,t]):r[n][1]=t,this}v.prototype.clear=fr;v.prototype.delete=mr;v.prototype.get=hr;v.prototype.has=$r;v.prototype.set=pr;function B(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function br(){this.__data__={hash:new F,map:new(ne||v),string:new F}}function dr(e){return $e(this,e).delete(e)}function Tr(e){return $e(this,e).get(e)}function yr(e){return $e(this,e).has(e)}function Er(e,t){return $e(this,e).set(e,t),this}B.prototype.clear=br;B.prototype.delete=dr;B.prototype.get=Tr;B.prototype.has=yr;B.prototype.set=Er;function U(e){this.__data__=new v(e)}function Sr(){this.__data__=new v}function wr(e){return this.__data__.delete(e)}function Or(e){return this.__data__.get(e)}function Lr(e){return this.__data__.has(e)}function Dr(e,t){var r=this.__data__;if(r instanceof v){var n=r.__data__;if(!ne||n.length<Nn-1)return n.push([e,t]),this;r=this.__data__=new B(n)}return r.set(e,t),this}U.prototype.clear=Sr;U.prototype.delete=wr;U.prototype.get=Or;U.prototype.has=Lr;U.prototype.set=Dr;function Ar(e,t){var r=Fe(e)||zr(e)?Un(e.length,String):[],n=r.length,a=!!n;for(var o in e)(t||H.call(e,o))&&!(a&&(o=="length"||qr(o,n)))&&r.push(o);return r}function Bt(e,t,r){var n=e[t];(!(H.call(e,t)&&Kt(n,r))||r===void 0&&!(t in e))&&(e[t]=r)}function he(e,t){for(var r=e.length;r--;)if(Kt(e[r][0],t))return r;return-1}function Cr(e,t){return e&&Ut(t,xe(t),e)}function Pe(e,t,r,n,a,o,u){var s;if(n&&(s=o?n(e,a,o,u):n(e)),s!==void 0)return s;if(!pe(e))return e;var c=Fe(e);if(c){if(s=Br(e),!t)return Jr(e,s)}else{var l=x(e),$=l==Ae||l==ht;if(Qr(e))return Rr(e,t);if(l==Ce||l==De||$&&!o){if(Vt(e))return o?e:{};if(s=Ur($?{}:e),!t)return jr(e,Cr(s,e))}else{if(!w[l])return o?e:{};s=Gr(e,l,Pe,t)}}u||(u=new U);var h=u.get(e);if(h)return h;if(u.set(e,s),!c)var T=r?kr(e):xe(e);return kn(T||e,function(m,f){T&&(f=m,m=e[f]),Bt(s,f,Pe(m,t,r,n,f,e,u))}),s}function Ir(e){return pe(e)?zn(e):{}}function _r(e,t,r){var n=t(e);return Fe(e)?n:Bn(n,r(e))}function Nr(e){return me.call(e)}function vr(e){if(!pe(e)||Yr(e))return!1;var t=Xt(e)||Vt(e)?Yn:Pn;return t.test(W(e))}function Vr(e){if(!qt(e))return tr(e);var t=[];for(var r in Object(e))H.call(e,r)&&r!="constructor"&&t.push(r);return t}function Rr(e,t){if(t)return e.slice();var r=new e.constructor(e.length);return e.copy(r),r}function He(e){var t=new e.constructor(e.byteLength);return new Wt(t).set(new Wt(e)),t}function Mr(e,t){var r=t?He(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}function Pr(e,t,r){var n=t?r(Rt(e),!0):Rt(e);return vt(n,Jn,new e.constructor)}function Hr(e){var t=new e.constructor(e.source,Mn.exec(e));return t.lastIndex=e.lastIndex,t}function Fr(e,t,r){var n=t?r(Mt(e),!0):Mt(e);return vt(n,jn,new e.constructor)}function xr(e){return kt?Object(kt.call(e)):{}}function Wr(e,t){var r=t?He(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Jr(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}function Ut(e,t,r,n){r||(r={});for(var a=-1,o=t.length;++a<o;){var u=t[a],s=n?n(r[u],e[u],u,r,e):void 0;Bt(r,u,s===void 0?e[u]:s)}return r}function jr(e,t){return Ut(e,Gt(e),t)}function kr(e){return _r(e,xe,Gt)}function $e(e,t){var r=e.__data__;return Kr(t)?r[typeof t=="string"?"string":"hash"]:r.map}function G(e,t){var r=Gn(e,t);return vr(r)?r:void 0}var Gt=Jt?_e(Jt,Object):ni,x=Nr;(ve&&x(new ve(new ArrayBuffer(1)))!=ce||ne&&x(new ne)!=ue||Ve&&x(Ve.resolve())!=pt||Re&&x(new Re)!=ge||Me&&x(new Me)!=Ie)&&(x=function(e){var t=me.call(e),r=t==Ce?e.constructor:void 0,n=r?W(r):void 0;if(n)switch(n){case nr:return ce;case rr:return ue;case ir:return pt;case or:return ge;case lr:return Ie}return t});function Br(e){var t=e.length,r=e.constructor(t);return t&&typeof e[0]=="string"&&H.call(e,"index")&&(r.index=e.index,r.input=e.input),r}function Ur(e){return typeof e.constructor=="function"&&!qt(e)?Ir(Xn(e)):{}}function Gr(e,t,r,n){var a=e.constructor;switch(t){case yt:return He(e);case ft:case mt:return new a(+e);case ce:return Mr(e,n);case Et:case St:case wt:case Ot:case Lt:case Dt:case At:case Ct:case It:return Wr(e,n);case ue:return Pr(e,n,r);case $t:case dt:return new a(e);case bt:return Hr(e);case ge:return Fr(e,n,r);case Tt:return xr(e)}}function qr(e,t){return t=t==null?ct:t,!!t&&(typeof e=="number"||Hn.test(e))&&e>-1&&e%1==0&&e<t}function Kr(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Yr(e){return!!Pt&&Pt in e}function qt(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||fe;return e===r}function W(e){if(e!=null){try{return Ht.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function Xr(e){return Pe(e,!0,!0)}function Kt(e,t){return e===t||e!==e&&t!==t}function zr(e){return Zr(e)&&H.call(e,"callee")&&(!Zn.call(e,"callee")||me.call(e)==De)}var Fe=Array.isArray;function Yt(e){return e!=null&&ei(e.length)&&!Xt(e)}function Zr(e){return ti(e)&&Yt(e)}var Qr=er||ri;function Xt(e){var t=pe(e)?me.call(e):"";return t==Ae||t==ht}function ei(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ct}function pe(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function ti(e){return!!e&&typeof e=="object"}function xe(e){return Yt(e)?Ar(e):Vr(e)}function ni(){return[]}function ri(){return!1}q.exports=Xr});var ci={};cn(ci,{crush:()=>gi,defaults:()=>Qt,version:()=>ui});var mn={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function Se(e,t){if(!Array.isArray(e)||!e.length)return e;let r=S(S({},mn),t),n,a;if(r.strictlyTwoElementsInRangeArrays&&!e.every((s,c)=>!Array.isArray(s)||s.length!==2?(n=c,a=s.length,!1):!0))throw new TypeError(`ranges-sort: [THROW_ID_03] The first argument should be an array and must consist of arrays which are natural number indexes representing TWO string index ranges. However, ${n}th range (${JSON.stringify(e[n],null,4)}) has not two but ${a} elements!`);if(!e.every((s,c)=>!Array.isArray(s)||!Number.isInteger(s[0])||s[0]<0||!Number.isInteger(s[1])||s[1]<0?(n=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, ${n}th range (${JSON.stringify(e[n],null,4)}) does not consist of only natural numbers!`);let o=e.length**2,u=0;return Array.from(e).sort((s,c)=>(r.progressFn&&(u+=1,r.progressFn(Math.floor(u*100/o))),s[0]===c[0]?s[1]<c[1]?-1:s[1]>c[1]?1:0:s[0]<c[0]?-1:1))}var Ye={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function Xe(e,t){function r(l){return l&&typeof l=="object"&&!Array.isArray(l)}if(!Array.isArray(e)||!e.length)return null;let n;if(t)if(r(t)){if(n=S(S({},Ye),t),n.progressFn&&r(n.progressFn)&&!Object.keys(n.progressFn).length)n.progressFn=null;else if(n.progressFn&&typeof n.progressFn!="function")throw new Error(`ranges-merge: [THROW_ID_01] opts.progressFn must be a function! It was given of a type: "${typeof n.progressFn}", equal to ${JSON.stringify(n.progressFn,null,4)}`);if(![1,2,"1","2"].includes(n.mergeType))throw new Error(`ranges-merge: [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "${typeof n.mergeType}", equal to ${JSON.stringify(n.mergeType,null,4)}`);if(typeof n.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 n.joinRangesThatTouchEdges}", equal to ${JSON.stringify(n.joinRangesThatTouchEdges,null,4)}`)}else throw new Error(`emlint: [THROW_ID_03] the second input argument must be a plain object. It was given as:
11
+ ${JSON.stringify(t,null,4)} (type ${typeof t})`);else n=S({},Ye);let a=e.filter(l=>Array.isArray(l)).map(l=>[...l]).filter(l=>l[2]!==void 0||l[0]!==l[1]),o,u,s;n.progressFn?o=Se(a,{progressFn:l=>{s=Math.floor(l/5),s!==u&&(u=s,n.progressFn(s))}}):o=Se(a);let c=o.length-1;for(let l=c;l>0;l--)n.progressFn&&(s=Math.floor((1-l/c)*78)+21,s!==u&&s>u&&(u=s,n.progressFn(s))),(o[l][0]<=o[l-1][0]||!n.joinRangesThatTouchEdges&&o[l][0]<o[l-1][1]||n.joinRangesThatTouchEdges&&o[l][0]<=o[l-1][1])&&(o[l-1][0]=Math.min(o[l][0],o[l-1][0]),o[l-1][1]=Math.max(o[l][1],o[l-1][1]),o[l][2]!==void 0&&(o[l-1][0]>=o[l][0]||o[l-1][1]<=o[l][1])&&o[l-1][2]!==null&&(o[l][2]===null&&o[l-1][2]!==null?o[l-1][2]=null:o[l-1][2]!=null?+n.mergeType==2&&o[l-1][0]===o[l][0]?o[l-1][2]=o[l][2]:o[l-1][2]+=o[l][2]:o[l-1][2]=o[l][2]),o.splice(l,1),l=o.length);return o.length?o:null}var hn=!0,we="Invariant failed";function ze(e,t){if(!e){if(hn)throw new Error(we);var r=typeof t=="function"?t():t,n=r?we+": "+r:we;throw new Error(n)}}function Ze(e,t,r){let n=0,a=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($=>$).length)return e;let o;Array.isArray(t)&&Number.isInteger(t[0])&&Number.isInteger(t[1])?o=[Array.from(t)]:o=Array.from(t);let u=o.length,s=0;o.filter($=>$).forEach(($,h)=>{if(r&&(n=Math.floor(s/u*10),n!==a&&(a=n,r(n))),!Array.isArray($))throw new TypeError(`ranges-apply: [THROW_ID_05] ranges array, second input arg., has ${h}th element not an array: ${JSON.stringify($,null,4)}, which is ${typeof $}`);if(!Number.isInteger($[0])){if(!Number.isInteger(+$[0])||+$[0]<0)throw new TypeError(`ranges-apply: [THROW_ID_06] ranges array, second input arg. has ${h}th element, array ${JSON.stringify($,null,0)}. Its first element is not an integer, string index, but ${typeof $[0]}, equal to: ${JSON.stringify($[0],null,4)}.`);o[h][0]=+o[h][0]}if(!Number.isInteger($[1])){if(!Number.isInteger(+$[1])||+$[1]<0)throw new TypeError(`ranges-apply: [THROW_ID_07] ranges array, second input arg. has ${h}th element, array ${JSON.stringify($,null,0)}. Its second element is not an integer, string index, but ${typeof $[1]}, equal to: ${JSON.stringify($[1],null,4)}.`);o[h][1]=+o[h][1]}s+=1});let c=Xe(o,{progressFn:$=>{r&&(n=10+Math.floor($/10),n!==a&&(a=n,r(n)))}});ze(c);let l=c.length;if(l>0){let $=e.slice(c[l-1][1]);e=c.reduce((h,T,m,f)=>{r&&(n=20+Math.floor(m/l*80),n!==a&&(a=n,r(n)));let O=m===0?0:f[m-1][1],L=f[m][0];return`${h}${e.slice(O,L)}${f[m][2]||""}`},""),e+=$}return e}function le(e,t=1){let r="\xA0";function n(o){return Array.from(o).reverse().join("")}function a(o,u,s){let c=s?`
12
+ `:"\r",l=s?"\r":`
13
+ `;if(!o)return o;let $=0,h=0,T="";for(let m=0,f=o.length;m<f;m++)(o[m]===c||o[m]===l&&o[m-1]!==c)&&h++,`\r
14
+ `.includes(o[m])||o[m]===r?($=0,o[m]===r?T+=o[m]:o[m]===c?h<=u&&(T+=o[m],o[m+1]===l&&(T+=o[m+1],m++)):o[m]===l&&(!o[m-1]||o[m-1]!==c)&&h<=u&&(T+=o[m])):($++,!o[m+1]&&!h&&(T+=" "));return T}if(typeof e=="string"&&e.length){let o=1;typeof+t=="number"&&Number.isInteger(+t)&&+t>=0&&(o=+t);let u="",s="";if(!e.trim())u=e;else if(!e[0].trim()){for(let c=0,l=e.length;c<l;c++)if(e[c].trim()){u=e.slice(0,c);break}}if(e.trim()&&(e.slice(-1).trim()===""||e.slice(-1)===r)){for(let c=e.length;c--;)if(e[c].trim()){s=e.slice(c+1);break}}return`${a(u,o,!1)}${e.trim()}${n(a(n(s),o,!0))}`}return e}var $n={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function Qe(e,t){if(!Array.isArray(e)||!e.length)return e;let r=S(S({},$n),t),n,a;if(r.strictlyTwoElementsInRangeArrays&&!e.every((s,c)=>!Array.isArray(s)||s.length!==2?(n=c,a=s.length,!1):!0))throw new TypeError(`ranges-sort: [THROW_ID_03] The first argument should be an array and must consist of arrays which are natural number indexes representing TWO string index ranges. However, ${n}th range (${JSON.stringify(e[n],null,4)}) has not two but ${a} elements!`);if(!e.every((s,c)=>!Array.isArray(s)||!Number.isInteger(s[0])||s[0]<0||!Number.isInteger(s[1])||s[1]<0?(n=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, ${n}th range (${JSON.stringify(e[n],null,4)}) does not consist of only natural numbers!`);let o=e.length**2,u=0;return Array.from(e).sort((s,c)=>(r.progressFn&&(u+=1,r.progressFn(Math.floor(u*100/o))),s[0]===c[0]?s[1]<c[1]?-1:s[1]>c[1]?1:0:s[0]<c[0]?-1:1))}var et={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function pn(e,t){function r(l){return l&&typeof l=="object"&&!Array.isArray(l)}if(!Array.isArray(e)||!e.length)return null;let n;if(t)if(r(t)){if(n=S(S({},et),t),n.progressFn&&r(n.progressFn)&&!Object.keys(n.progressFn).length)n.progressFn=null;else if(n.progressFn&&typeof n.progressFn!="function")throw new Error(`ranges-merge: [THROW_ID_01] opts.progressFn must be a function! It was given of a type: "${typeof n.progressFn}", equal to ${JSON.stringify(n.progressFn,null,4)}`);if(![1,2,"1","2"].includes(n.mergeType))throw new Error(`ranges-merge: [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "${typeof n.mergeType}", equal to ${JSON.stringify(n.mergeType,null,4)}`);if(typeof n.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 n.joinRangesThatTouchEdges}", equal to ${JSON.stringify(n.joinRangesThatTouchEdges,null,4)}`)}else throw new Error(`emlint: [THROW_ID_03] the second input argument must be a plain object. It was given as:
15
+ ${JSON.stringify(t,null,4)} (type ${typeof t})`);else n=S({},et);let a=e.filter(l=>Array.isArray(l)).map(l=>[...l]).filter(l=>l[2]!==void 0||l[0]!==l[1]),o,u,s;n.progressFn?o=Qe(a,{progressFn:l=>{s=Math.floor(l/5),s!==u&&(u=s,n.progressFn(s))}}):o=Qe(a);let c=o.length-1;for(let l=c;l>0;l--)n.progressFn&&(s=Math.floor((1-l/c)*78)+21,s!==u&&s>u&&(u=s,n.progressFn(s))),(o[l][0]<=o[l-1][0]||!n.joinRangesThatTouchEdges&&o[l][0]<o[l-1][1]||n.joinRangesThatTouchEdges&&o[l][0]<=o[l-1][1])&&(o[l-1][0]=Math.min(o[l][0],o[l-1][0]),o[l-1][1]=Math.max(o[l][1],o[l-1][1]),o[l][2]!==void 0&&(o[l-1][0]>=o[l][0]||o[l-1][1]<=o[l][1])&&o[l-1][2]!==null&&(o[l][2]===null&&o[l-1][2]!==null?o[l-1][2]=null:o[l-1][2]!=null?+n.mergeType==2&&o[l-1][0]===o[l][0]?o[l-1][2]=o[l][2]:o[l-1][2]+=o[l][2]:o[l-1][2]=o[l][2]),o.splice(l,1),l=o.length);return o.length?o:null}function M(e){return e!=null}function P(e){return Number.isInteger(e)&&e>=0}function te(e){return typeof e=="string"}var bn={limitToBeAddedWhitespace:!1,limitLinebreaksCount:1,mergeType:1},tt=class{constructor(e){Ee(this,"ranges");Ee(this,"opts");let t=S(S({},bn),e);if(t.mergeType&&t.mergeType!==1&&t.mergeType!==2)if(te(t.mergeType)&&t.mergeType.trim()==="1")t.mergeType=1;else if(te(t.mergeType)&&t.mergeType.trim()==="2")t.mergeType=2;else throw new Error(`ranges-push: [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "${typeof t.mergeType}", equal to ${JSON.stringify(t.mergeType,null,4)}`);this.opts=t,this.ranges=[]}add(e,t,r){if(e==null&&t==null)return;if(M(e)&&!M(t)){if(Array.isArray(e)){if(e.length){if(e.some(o=>Array.isArray(o))){e.forEach(o=>{Array.isArray(o)&&this.add(...o)});return}e.length&&P(+e[0])&&P(+e[1])&&this.add(...e)}return}throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_12] the first input argument, "from" is set (${JSON.stringify(e,null,0)}) but second-one, "to" is not (${JSON.stringify(t,null,0)})`)}else if(!M(e)&&M(t))throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_13] the second input argument, "to" is set (${JSON.stringify(t,null,0)}) but first-one, "from" is not (${JSON.stringify(e,null,0)})`);let n=+e,a=+t;if(P(r)&&(r=String(r)),P(n)&&P(a)){if(M(r)&&!te(r)&&!P(r))throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_08] The third argument, the value to add, was given not as string but ${typeof r}, equal to:
16
+ ${JSON.stringify(r,null,4)}`);if(M(this.ranges)&&Array.isArray(this.last())&&n===this.last()[1]){if(this.last()[1]=a,this.last()[2],this.last()[2]!==null&&M(r)){let o=this.last()[2]&&this.last()[2].length>0&&(!this.opts||!this.opts.mergeType||this.opts.mergeType===1)?`${this.last()[2]}${r}`:r;this.opts.limitToBeAddedWhitespace&&(o=le(o,this.opts.limitLinebreaksCount)),te(o)&&!o.length||(this.last()[2]=o)}}else{this.ranges||(this.ranges=[]);let o=r!==void 0&&!(te(r)&&!r.length)?[n,a,r&&this.opts.limitToBeAddedWhitespace?le(r,this.opts.limitLinebreaksCount):r]:[n,a];this.ranges.push(o)}}else throw P(n)&&n>=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 a}" equal to: ${JSON.stringify(a,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 n}" equal to: ${JSON.stringify(n,null,4)}`)}push(e,t,r){this.add(e,t,r)}current(){return Array.isArray(this.ranges)&&this.ranges.length?(this.ranges=pn(this.ranges,{mergeType:this.opts.mergeType}),this.ranges&&this.opts.limitToBeAddedWhitespace?this.ranges.map(e=>M(e[2])?[e[0],e[1],le(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])&&P(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}};function nt(e){return typeof e=="string"?e.length?[e]:[]:e}function rt(e){return e&&typeof e=="object"&&!Array.isArray(e)}function se(e){return typeof e=="string"}var it={cb:void 0,i:!1,trimBeforeMatching:!1,trimCharsBeforeMatching:[],maxMismatches:0,firstMustMatch:!1,lastMustMatch:!1,hungry:!1},dn=e=>e+1;function Tn(e,t,r,n,a=!1,o=dn){let u=typeof r=="function"?r():r;if(+t<0&&a&&u==="EOL")return u;let s=S(S({},it),n);if(t>=e.length&&!a)return!1;let c=a?1:r.length,l=0,$=!1,h=!1,T=!1,m=s.maxMismatches,f=t,O=!1,L=!1,p=!1;function b(){return l===1&&m<s.maxMismatches-1}for(;e[f];){let d=o(f);if(s.trimBeforeMatching&&e[f].trim()===""){if(!e[d]&&a&&r==="EOL")return!0;f=o(f);continue}if(s&&!s.i&&s.trimCharsBeforeMatching&&s.trimCharsBeforeMatching.includes(e[f])||(s==null?void 0:s.i)&&s.trimCharsBeforeMatching&&s.trimCharsBeforeMatching.map(A=>A.toLowerCase()).includes(e[f].toLowerCase())){if(a&&r==="EOL"&&!e[d])return!0;f=o(f);continue}let E=d>f?r[r.length-c]:r[c-1];if(!s.i&&e[f]===E||s.i&&e[f].toLowerCase()===E.toLowerCase()){if(O||(O=!0),T||(T=!0),c===r.length){if(L=!0,m!==s.maxMismatches)return!1}else c===1&&(p=!0);if(c-=1,l++,b())return!1;if(!c)return l!==r.length||m===s.maxMismatches||!$?f:!1}else if(!$&&!l&&($=!0),s.maxMismatches&&m&&f){m-=1;for(let A=0;A<=m;A++){let I=d>f?r[r.length-c+1+A]:r[c-2-A],V=e[o(f)];if(I&&(!s.i&&e[f]===I||s.i&&e[f].toLowerCase()===I.toLowerCase())&&(!s.firstMustMatch||c!==r.length)){if(l++,b())return!1;c-=2,O=!0;break}else if(V&&I&&(!s.i&&V===I||s.i&&V.toLowerCase()===I.toLowerCase())&&(!s.firstMustMatch||c!==r.length)){if(!l&&!s.hungry)return!1;c-=1,O=!0;break}else if(I===void 0&&m>=0&&O&&(!s.firstMustMatch||L)&&(!s.lastMustMatch||p))return f}O||(h=f)}else return f===0&&c===1&&!s.lastMustMatch&&T?0:!1;if(h!==!1&&h!==f&&(h=!1),c<1)return f;f=o(f)}if(c>0)return a&&u==="EOL"?!0:s&&s.maxMismatches>=c&&T?h||0:!1}function Oe(e,t,r,n,a){if(rt(a)&&Object.prototype.hasOwnProperty.call(a,"trimBeforeMatching")&&typeof a.trimBeforeMatching!="boolean")throw new Error(`string-match-left-right/${e}(): [THROW_ID_09] opts.trimBeforeMatching should be boolean!${Array.isArray(a.trimBeforeMatching)?" Did you mean to use opts.trimCharsBeforeMatching?":""}`);let o=S(S({},it),a);if(typeof o.trimCharsBeforeMatching=="string"&&(o.trimCharsBeforeMatching=nt(o.trimCharsBeforeMatching)),o.trimCharsBeforeMatching=o.trimCharsBeforeMatching.map($=>se($)?$:String($)),!se(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:
17
+ ${JSON.stringify(r,null,4)}`);let u,s;if(se(n))u=[n];else if(Array.isArray(n))u=n;else if(!n)u=n;else if(typeof n=="function")u=[],u.push(n);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 n}, equal to:
18
+ ${JSON.stringify(n,null,4)}`);if(a&&!rt(a))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 a}", and equal to:
19
+ ${JSON.stringify(a,null,4)}`);let c=0,l="";if((o==null?void 0:o.trimCharsBeforeMatching)&&o.trimCharsBeforeMatching.some(($,h)=>$.length>1?(c=h,l=$,!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, ${l.length} (equals to ${l}). Please split it into separate characters and put into array as separate elements.`);if(!u||!Array.isArray(u)||Array.isArray(u)&&!u.length||Array.isArray(u)&&u.length===1&&se(u[0])&&!u[0].trim()){if(typeof o.cb=="function"){let h,T=r;if((e==="matchLeftIncl"||e==="matchRight")&&(T+=1),e[5]==="L")for(let L=T;L--;){let p=t[L];if((!o.trimBeforeMatching||o.trimBeforeMatching&&p!==void 0&&p.trim())&&(!o.trimCharsBeforeMatching||!o.trimCharsBeforeMatching.length||p!==void 0&&!o.trimCharsBeforeMatching.includes(p))){h=L;break}}else if(e.startsWith("matchRight"))for(let L=T;L<t.length;L++){let p=t[L];if((!o.trimBeforeMatching||o.trimBeforeMatching&&p.trim())&&(!o.trimCharsBeforeMatching||!o.trimCharsBeforeMatching.length||!o.trimCharsBeforeMatching.includes(p))){h=L;break}}if(h===void 0)return!1;let m=t[h],f=h+1,O="";return f&&f>0&&(O=t.slice(0,f)),e[5]==="L"||h&&h>0&&(O=t.slice(h)),o.cb(m,O,h)}let $="";throw a||($=" 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!${$}`)}for(let $=0,h=u.length;$<h;$++){s=typeof u[$]=="function";let T=u[$],m,f,O="",L=r;e==="matchRight"?L+=1:e==="matchLeft"&&(L-=1);let p=Tn(t,L,T,o,s,b=>e[5]==="L"?b-1:b+1);if(p&&s&&typeof T=="function"&&T()==="EOL")return T()&&(o.cb?o.cb(m,O,f):!0)?T():!1;if(Number.isInteger(p)&&(f=e.startsWith("matchLeft")?p-1:p+1,e[5]==="L"?O=t.slice(0,p):O=t.slice(f)),f<0&&(f=void 0),t[f]&&(m=t[f]),Number.isInteger(p)&&(o.cb?o.cb(m,O,f):!0))return T}return!1}function ot(e,t,r,n){return Oe("matchLeft",e,t,r,n)}function Le(e,t,r,n){return Oe("matchRightIncl",e,t,r,n)}function k(e,t,r,n){return Oe("matchRight",e,t,r,n)}var yn={str:"",from:0,to:0,ifLeftSideIncludesThisThenCropTightly:"",ifLeftSideIncludesThisCropItToo:"",ifRightSideIncludesThisThenCropTightly:"",ifRightSideIncludesThisCropItToo:"",extendToOneSide:!1,wipeAllWhitespaceOnLeft:!1,wipeAllWhitespaceOnRight:!1,addSingleSpaceToPreventAccidentalConcatenation:!1};function ae(e){var c;let t=/^[0-9a-zA-Z]+$/;function r(l){return!l||typeof l!="string"?!1:!l.trim()}function n(l){return typeof l=="string"}if(!e||typeof e!="object"||Array.isArray(e)){let l;throw e===void 0?l="but it is missing completely.":e===null?l="but it was given as null.":l=`but it was given as ${typeof e}, equal to:
20
+ ${JSON.stringify(e,null,4)}.`,new Error(`string-range-expander: [THROW_ID_01] Input must be a plain object ${l}`)}else if(typeof e=="object"&&e!==null&&!Array.isArray(e)&&!Object.keys(e).length)throw new Error("string-range-expander: [THROW_ID_02] Input must be a plain object but it was given as a plain object without any keys.");if(typeof e.from!="number")throw new Error(`string-range-expander: [THROW_ID_03] The input's "from" value opts.from, is not a number! Currently it's given as ${typeof e.from}, equal to ${JSON.stringify(e.from,null,0)}`);if(typeof e.to!="number")throw new Error(`string-range-expander: [THROW_ID_04] The input's "to" value opts.to, is not a number! Currently it's given as ${typeof e.to}, equal to ${JSON.stringify(e.to,null,0)}`);if((e==null?void 0:e.str)&&!e.str[e.from]&&e.from!==e.to)throw new Error(`string-range-expander: [THROW_ID_05] The given input string opts.str ("${e.str}") must contain the character at index "from" ("${e.from}")`);if((e==null?void 0:e.str)&&!e.str[e.to-1])throw new Error(`string-range-expander: [THROW_ID_06] The given input string, opts.str ("${e.str}") must contain the character at index before "to" ("${e.to-1}")`);if(e.from>e.to)throw new Error(`string-range-expander: [THROW_ID_07] The given "from" index, "${e.from}" is greater than "to" index, "${e.to}". That's wrong!`);if(n(e.extendToOneSide)&&e.extendToOneSide!=="left"&&e.extendToOneSide!=="right"||!n(e.extendToOneSide)&&e.extendToOneSide!==void 0&&e.extendToOneSide!==!1)throw new Error(`string-range-expander: [THROW_ID_08] The opts.extendToOneSide value is not recogniseable! It's set to: "${e.extendToOneSide}" (${typeof e.extendToOneSide}). It has to be either Boolean "false" or strings "left" or "right"`);let a=S(S({},yn),e);if(Array.isArray(a.ifLeftSideIncludesThisThenCropTightly)){let l,$;if(a.ifLeftSideIncludesThisThenCropTightly.every((h,T)=>n(h)?!0:(l=T,$=h,!1)))a.ifLeftSideIncludesThisThenCropTightly=a.ifLeftSideIncludesThisThenCropTightly.join("");else throw new Error(`string-range-expander: [THROW_ID_09] The opts.ifLeftSideIncludesThisThenCropTightly was set to an array:
21
+ ${JSON.stringify(a.ifLeftSideIncludesThisThenCropTightly,null,4)}. Now, that array contains not only string elements. For example, an element at index ${l} is of a type ${typeof $} (equal to ${JSON.stringify($,null,0)}).`)}let o=a.str,u=a.from,s=a.to;if(a.extendToOneSide!=="right"&&(r(o[u-1])&&(r(o[u-2])||a.ifLeftSideIncludesThisCropItToo.includes(o[u-2]))||o[u-1]&&a.ifLeftSideIncludesThisCropItToo.includes(o[u-1])||a.wipeAllWhitespaceOnLeft&&r(o[u-1]))){for(let l=u;l--;)if(!a.ifLeftSideIncludesThisCropItToo.includes(o[l])){if(o[l].trim()){a.wipeAllWhitespaceOnLeft||a.ifLeftSideIncludesThisCropItToo.includes(o[l+1])?u=l+1:u=l+2;break}else if(l===0){a.wipeAllWhitespaceOnLeft?u=0:u=1;break}}}if(a.extendToOneSide!=="left"&&(r(o[s])&&(a.wipeAllWhitespaceOnRight||r(o[s+1]))||a.ifRightSideIncludesThisCropItToo.includes(o[s]))){for(let l=s,$=o.length;l<$;l++)if(!a.ifRightSideIncludesThisCropItToo.includes(o[l])&&((c=o[l])==null?void 0:c.trim())){a.wipeAllWhitespaceOnRight||a.ifRightSideIncludesThisCropItToo.includes(o[l-1])?s=l:s=l-1;break}}return(a.extendToOneSide!=="right"&&n(a.ifLeftSideIncludesThisThenCropTightly)&&a.ifLeftSideIncludesThisThenCropTightly&&(o[u-2]&&a.ifLeftSideIncludesThisThenCropTightly.includes(o[u-2])||o[u-1]&&a.ifLeftSideIncludesThisThenCropTightly.includes(o[u-1]))||a.extendToOneSide!=="left"&&n(a.ifRightSideIncludesThisThenCropTightly)&&a.ifRightSideIncludesThisThenCropTightly&&(o[s+1]&&a.ifRightSideIncludesThisThenCropTightly.includes(o[s+1])||o[s]&&a.ifRightSideIncludesThisThenCropTightly.includes(o[s])))&&(a.extendToOneSide!=="right"&&r(o[u-1])&&!a.wipeAllWhitespaceOnLeft&&(u-=1),a.extendToOneSide!=="left"&&r(o[s])&&!a.wipeAllWhitespaceOnRight&&(s+=1)),a.addSingleSpaceToPreventAccidentalConcatenation&&o[u-1]&&o[u-1].trim()&&o[s]&&o[s].trim()&&(!a.ifLeftSideIncludesThisThenCropTightly&&!a.ifRightSideIncludesThisThenCropTightly||!((!a.ifLeftSideIncludesThisThenCropTightly||a.ifLeftSideIncludesThisThenCropTightly.includes(o[u-1]))&&(!a.ifRightSideIncludesThisThenCropTightly||o[s]&&a.ifRightSideIncludesThisThenCropTightly.includes(o[s]))))&&(t.test(o[u-1])||t.test(o[s]))?[u,s," "]:[u,s]}var ii=Ke(ut(),1),oi=Ke(zt(),1);var K="\xA0";function li({str:e,idx:t=0,stopAtNewlines:r=!1,stopAtRawNbsp:n=!1}){if(typeof e!="string"||!e.length||((!t||typeof t!="number")&&(t=0),!e[t+1]))return null;if(e[t+1]&&(e[t+1].trim()||r&&`
22
+ \r`.includes(e[t+1])||n&&e[t+1]===K))return t+1;if(e[t+2]&&(e[t+2].trim()||r&&`
23
+ \r`.includes(e[t+2])||n&&e[t+2]===K))return t+2;for(let a=t+1,o=e.length;a<o;a++)if(e[a].trim()||r&&`
24
+ \r`.includes(e[a])||n&&e[a]===K)return a;return null}function D(e,t=0){return li({str:e,idx:t,stopAtNewlines:!1,stopAtRawNbsp:!1})}function si({str:e,idx:t,stopAtNewlines:r,stopAtRawNbsp:n}){if(typeof e!="string"||!e.length||((!t||typeof t!="number")&&(t=0),t<1))return null;if(e[~-t]&&(e[~-t].trim()||r&&`
25
+ \r`.includes(e[~-t])||n&&e[~-t]===K))return~-t;if(e[t-2]&&(e[t-2].trim()||r&&`
26
+ \r`.includes(e[t-2])||n&&e[t-2]===K))return t-2;for(let a=t;a--;)if(e[a]&&(e[a].trim()||r&&`
27
+ \r`.includes(e[a])||n&&e[a]===K))return a;return null}function be(e,t=0){return si({str:e,idx:t,stopAtNewlines:!1,stopAtRawNbsp:!1})}var Zt="5.0.10";var ui=Zt,y=new tt({limitToBeAddedWhitespace:!0}),Qt={lineLengthLimit:500,removeIndentations:!0,removeLineBreaks:!1,removeHTMLComments:!1,removeCSSComments:!0,reportProgressFunc:null,reportProgressFuncFrom:0,reportProgressFuncTo:100,breakToTheLeftOf:["</td","<html","</html","<head","</head","<meta","<link","<table","<script","<\/script","<!DOCTYPE","<style","</style","<title","<body","@media","</body","<!--[if","<!--<![endif","<![endif]"],mindTheInlineTags:["a","abbr","acronym","audio","b","bdi","bdo","big","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","label","map","mark","meter","noscript","object","output","picture","progress","q","ruby","s","samp","script","select","slot","small","span","strong","sub","sup","svg","template","textarea","time","u","tt","var","video","wbr"]};function Y(e){return typeof e=="string"}function X(e){return typeof e=="string"&&e.toUpperCase()!==e.toLowerCase()}function gi(e,t){var fi;let r=Date.now();if(!Y(e))throw e===void 0?new Error("html-crush: [THROW_ID_01] the first input argument is completely missing! It should be given as string."):new Error(`html-crush: [THROW_ID_02] the first input argument must be string! It was given as "${typeof e}", equal to:
28
+ ${JSON.stringify(e,null,4)}`);if(t&&typeof t!="object")throw new Error(`html-crush: [THROW_ID_03] the second input argument, options object, should be a plain object but it was given as type ${typeof t}, equal to ${JSON.stringify(t,null,4)}`);if(t&&Array.isArray(t.breakToTheLeftOf)&&t.breakToTheLeftOf.length){for(let i=0,Q=t.breakToTheLeftOf.length;i<Q;i++)if(!Y(t.breakToTheLeftOf[i]))throw new TypeError(`html-crush: [THROW_ID_05] the opts.breakToTheLeftOf array contains non-string elements! For example, element at index ${i} is of a type "${typeof t.breakToTheLeftOf[i]}" and is equal to:
29
+ ${JSON.stringify(t.breakToTheLeftOf[i],null,4)}`)}let n=S(S({},Qt),t);typeof n.removeHTMLComments=="boolean"&&(n.removeHTMLComments=n.removeHTMLComments?1:0);let a="";Array.isArray(n.breakToTheLeftOf)&&n.breakToTheLeftOf.length&&(a=[...new Set(n.breakToTheLeftOf.map(i=>i[0]))].join(""));let o={removeHTMLComments:!1,removeCSSComments:!1},u=null,s=null,c=!1,l=0,$=0,h=!1,T=!1,m=null,f=null,O=null,L=null,p,b=null,d=null,E=null,A=null,I=null,V=null,z=">};",Z="<",en="!",tn=">",nn="<",We="{},:;<>~+",de=We,Te=We,J=!0,_=e.length,rn=Math.floor(_/2),Je=.01,je;n.reportProgressFunc&&(je=Math.floor(n.reportProgressFuncTo-(n.reportProgressFuncTo-n.reportProgressFuncFrom)*Je-n.reportProgressFuncFrom));let R,oe=0,C=`
30
+ `;if(e.includes(`\r
31
+ `)?C=`\r
32
+ `:e.includes("\r")&&(C="\r"),_){for(let i=0;i<_;i++){if(n.reportProgressFunc&&(_>1e3&&_<2e3?i===rn&&n.reportProgressFunc(Math.floor((n.reportProgressFuncTo-n.reportProgressFuncFrom)/2)):_>=2e3&&(R=n.reportProgressFuncFrom+Math.floor(i/_*(je||1)),R!==oe&&(oe=R,n.reportProgressFunc(R)))),$++,!p&&h&&e[i]==="}"&&e[i-1]==="}"&&(l+1>=n.lineLengthLimit?(y.push(i,i,C),l=0):(b=i,d=i,E=" ")),p&&typeof p=="number"&&i>=p&&(p=void 0),L!==null&&e.startsWith("<\/script",i)&&!X(e[i+8])){if((n.removeIndentations||n.removeLineBreaks)&&i>0&&e[~-i]&&!e[~-i].trim()){for(let g=i;g--;)if(e[g]===`
33
+ `||e[g]==="\r"||e[g].trim()){g+1<i&&y.push(g+1,i);break}}L=null,p=!1,i+=8;continue}if(!p&&!h&&e.startsWith("<script",i)&&!X(e[i+7])){L=i,p=!0;let g="";(n.removeLineBreaks||n.removeIndentations)&&s!==null&&(s>0&&(g=C),y.push(s,i,g)),s=null,u=null}if(I!==null&&A===null&&!/\w/.test(e[i])){A=e.slice(I,i);let g=D(e,~-i);typeof g=="number"&&e[g]===">"&&!e[i].trim()&&D(e,i)?y.push(i,D(e,i)):g&&e[g]==="/"&&e[D(e,g)]===">"&&(!e[i].trim()&&D(e,i)&&y.push(i,D(e,i)),e[g+1]!==">"&&D(e,g+1)&&y.push(g+1,D(e,g+1)))}if(!p&&!h&&!m&&e[~-i]==="<"&&I===null&&(/\w/.test(e[i])?I=i:e[D(e,~-i)]==="/"&&/\w/.test(e[D(e,D(e,~-i))]||"")&&(I=D(e,D(e,~-i)))),!p&&(h||m)&&f!==null&&e[i]==="*"&&e[i+1]==="/"&&([b,d]=ae({str:e,from:f,to:i+2,ifLeftSideIncludesThisThenCropTightly:de||"",ifRightSideIncludesThisThenCropTightly:Te||""}),f=null,b!=null?y.push(b,d):(l+=1,i+=1),p=i+2),!p&&(h||m)&&f===null&&e[i]==="/"&&e[i+1]==="*"&&(o.removeCSSComments||(o.removeCSSComments=!0),n.removeCSSComments&&(f=i)),T&&e.startsWith("![endif",i+1)&&(T=!1),!p&&!h&&!m&&O!==null){let g;e.startsWith("-->",i)?g=3:e[i]===">"&&e[i-1]==="]"&&(g=1),g&&([b,d]=ae({str:e,from:O,to:i+g}),O=null,b!=null?n.lineLengthLimit&&$-(d-b)>=n.lineLengthLimit?(y.push(b,d,C),$=-g):(y.push(b,d),$-=d-b):(l+=g-1,i+=g-1),p=i+g)}if(!p&&!h&&!m&&(e.startsWith("<!--",i)||n.removeHTMLComments===2&&e.startsWith("<![endif",i))&&O===null&&(e.startsWith("[if",i+4)?(T||(T=!0),n.removeHTMLComments===2&&(O=i)):n.removeHTMLComments&&(!T||n.removeHTMLComments===2)&&(O=i),o.removeHTMLComments||(o.removeHTMLComments=!0)),!p&&h&&f===null&&e.startsWith("</style",i)&&!X(e[i+7])?h=!1:!p&&!h&&f===null&&e.startsWith("<style",i)&&!X(e[i+6])&&(h=!0,(n.removeLineBreaks||n.removeIndentations)&&n.breakToTheLeftOf.includes("<style")&&e.startsWith(' type="text/css">',i+6)&&e[i+24]&&y.push(i+23,i+23,C)),!p&&!m&&`"'`.includes(e[i])&&e.endsWith("style=",i)&&(m=i),!p&&!e[i].trim())s===null&&(s=i);else if(!p&&!((h||m)&&f!==null)){if(s!==null){if(n.removeLineBreaks&&(l+=1),J)J=!1,(n.removeIndentations||n.removeLineBreaks)&&y.push(0,i);else if(n.removeIndentations&&!n.removeLineBreaks&&(!c&&u!==null&&i>u?y.push(u+1,i):s+1<i&&(e.endsWith("]>",s)||e.endsWith("-->",s)||e.startsWith("<![",i)||e.startsWith("<!--<![",i)?y.push(s,i):e[s]===" "?y.push(s+1,i):e[~-i]===" "?y.push(s,~-i):y.push(s,i," "))),n.removeLineBreaks||m){if(a.includes(e[i])&&Le(e,i,n.breakToTheLeftOf)){!(`\r
34
+ `.includes(e[~-i])&&s===~-i)&&!(e[~-i]===`
35
+ `&&e[i-2]==="\r"&&s===i-2)&&y.push(s,i,C),b=null,d=null,E=null,s=null,l=1;continue}let g=" ";e[i]==="<"&&k(e,i,n.mindTheInlineTags,{cb:j=>!j||!/\w/.test(j)})||(e[~-s]&&tn.includes(e[~-s])&&nn.includes(e[i])||(h||m)&&f===null&&(de.includes(e[~-s])||Te.includes(e[i]))||e.startsWith("!important",i)&&!T||m&&(e[~-s]==="'"||e[~-s]==='"')||e[~-s]==="}"&&e.startsWith("</style",i)||e[i]===">"&&(`'"`.includes(e[be(e,i)])||e[D(e,i)]==="<")||e[i]==="/"&&e[D(e,i)]===">")&&(g="",e[i]==="/"&&e[i+1]===">"&&D(e,i)&&D(e,i)>i+1&&(y.push(i+1,D(e,i)),l-=D(e,i)-i+1)),h&&e[i]==="}"&&s&&e[s-1]==="}"&&(g=" "),(g==null?void 0:g.length)&&(l+=1),n.lineLengthLimit?l>=n.lineLengthLimit||!e[i+1]||e[i]===">"||e[i]==="/"&&e[i+1]===">"?((l>n.lineLengthLimit||l===n.lineLengthLimit&&e[i+1]&&e[i+1].trim()&&!z.includes(e[i])&&!Z.includes(e[i+1]))&&(g=C,l=1),(l>n.lineLengthLimit||!(g===" "&&i===s+1))&&(y.push(s,i,g),u=null),b=null,d=null,E=null):(b===null||s<b)&&(b=s,d=i,E=g):i===s+1&&g===" "||y.push(s,i,g)}s=null,c||(c=!0)}else J&&(J=!1),n.removeLineBreaks&&(l+=1);c||(c=!0)}if(!p&&!J&&i!==0&&n.removeLineBreaks&&(n.lineLengthLimit||a)&&!e.startsWith("</a",i)){if(a&&Le(e,i,n.breakToTheLeftOf)&&e.slice(0,i).trim()&&(!e.startsWith("<![endif]",i)||!ot(e,i,"<!--"))){y.push(i,i,C),b=null,d=null,E=null,l=1;continue}else if(n.lineLengthLimit&&l<=n.lineLengthLimit){if(!e[i+1]||Z.includes(e[i])&&!en.includes(e[i])||z.includes(e[i])||!e[i].trim()){if(b!==null&&d!==null&&(b!==d||(E==null?void 0:E.length))){let g=E;e[i].trim()&&e[i+1]&&e[i+1].trim()&&l+(E?E.length:0)>n.lineLengthLimit&&(g=C),(l+(g?g.length:0)>n.lineLengthLimit||!(g===" "&&d===b+1&&e[b]===" "))&&(e[~-b]==="}"&&e[d]==="{"||(y.push(b,d,g),u=null))}e[i].trim()&&(Z.includes(e[i])||e[~-i]&&z.includes(e[~-i]))&&Y(V)&&(!A||!n.mindTheInlineTags.includes(A))&&!(e[i]==="<"&&k(e,i,n.mindTheInlineTags,{cb:g=>!g||!/\w/.test(g)}))&&!(e[i]==="<"&&k(e,i,n.mindTheInlineTags,{trimCharsBeforeMatching:"/",cb:g=>!g||!/\w/.test(g)}))?(b=i,d=i,E=null):f===null&&b!==null&&(m||!n.mindTheInlineTags||!Array.isArray(n.mindTheInlineTags)||Array.isArray(n.mindTheInlineTags.length)&&!n.mindTheInlineTags.length||!Y(A)||Array.isArray(n.mindTheInlineTags)&&n.mindTheInlineTags.length&&Y(A)&&!n.mindTheInlineTags.includes(A))&&!(e[i]==="<"&&k(e,i,n.mindTheInlineTags,{trimCharsBeforeMatching:"/",cb:g=>!g||!/\w/.test(g)}))&&(b=null,d=null,E=null)}}else if(n.lineLengthLimit)if(Z.includes(e[i])&&!(e[i]==="<"&&k(e,i,n.mindTheInlineTags,{trimCharsBeforeMatching:"/",cb:g=>!g||!/\w/.test(g)})))if(b!==null&&d!==null&&(b!==d||(E==null?void 0:E.length))){let g=(E==null?void 0:E.length)?E.length:0;l-(d-b-g)-1>n.lineLengthLimit||(y.push(b,d,E),l-(d-b-g)-1===n.lineLengthLimit&&(y.push(i,i,C),l=0),b=null,d=null,E=null)}else y.push(i,i,C),l=0;else e[i+1]&&z.includes(e[i])&&Y(A)&&Array.isArray(n.mindTheInlineTags)&&n.mindTheInlineTags.length&&!n.mindTheInlineTags.includes(A)?b!==null&&d!==null&&(b!==d||(E==null?void 0:E.length))||(y.push(i+1,i+1,C),l=0):e[i].trim()&&(e[i+1]||b!==null&&d!==null&&(b!==d||(E==null?void 0:E.length))&&y.push(b,d,C))}if(!p&&!J&&n.removeLineBreaks&&n.lineLengthLimit&&l>=n.lineLengthLimit&&b!==null&&d!==null&&!z.includes(e[i])&&!Z.includes(e[i])&&!"/".includes(e[i])&&!(l===n.lineLengthLimit&&e[i+1]&&!e[i+1].trim())){let g=C;e[i+1]&&!e[i+1].trim()&&l===n.lineLengthLimit&&(g=E),g===C&&!e[~-b].trim()&&be(e,b)&&(b=be(e,b)+1),y.push(b,d,g),l=i-d,e[i].length&&(l+=1),b=null,d=null,E=null}if((!p&&e[i]===`
36
+ `||e[i]==="\r"&&(!e[i+1]||e[i+1]&&e[i+1]!==`
37
+ `))&&(u=i,c&&(c=!1),!n.removeLineBreaks&&s!==null&&s<i&&e[i+1]&&e[i+1]!=="\r"&&e[i+1]!==`
38
+ `&&y.push(s,i)),e[i+1]||(h&&f!==null?y.push(...ae({str:e,from:f,to:i,ifLeftSideIncludesThisThenCropTightly:de||"",ifRightSideIncludesThisThenCropTightly:Te||""})):s&&e[i]!==`
39
+ `&&e[i]!=="\r"?y.push(s,i+1):s&&(e[i]==="\r"&&e[i+1]===`
40
+ `||e[i]===`
41
+ `&&e[i-1]!=="\r")&&y.push(s,i)),!p&&m&&m<i&&e[m]===e[i]&&(m=null),!p&&!h&&e.startsWith("<pre",i)&&!X(e[i+4])){let g=e.indexOf("</pre",i+5);g>0&&(p=g)}if(!p&&!h&&e.startsWith("<code",i)&&!X(e[i+5])){let g=e.indexOf("</code",i+5);g>0&&(p=g)}if(!p&&e.startsWith("<![CDATA[",i)){let g=e.indexOf("]]>",i+9);g>0&&(p=g)}!p&&!h&&!m&&I!==null&&e[i]===">"&&(e[D(e,i)]==="<"&&(V=A),I=null,A=null),e[i]==="<"&&V!==null&&(V=null),h&&e[i]==="{"&&e[i+1]==="{"&&e.indexOf("}}")!==-1&&(p=e.indexOf("}}")+2);let Q=!0}if(y.current()){let i=y.current();y.wipe();let Q=n.reportProgressFuncTo-(n.reportProgressFuncTo-n.reportProgressFuncFrom)*Je,g=Ze(e,i,on=>{n.reportProgressFunc&&_>=2e3&&(R=Math.floor(Q+(n.reportProgressFuncTo-Q)*(on/100)),R!==oe&&(oe=R,n.reportProgressFunc(R)))}),j=g.length;return{log:{timeTakenInMilliseconds:Date.now()-r,originalLength:_,cleanedLength:j,bytesSaved:Math.max(_-j,0),percentageReducedOfOriginal:_?Math.round(Math.max(_-j,0)*100/_):0},ranges:i,applicableOpts:o,result:g}}}return{log:{timeTakenInMilliseconds:Date.now()-r,originalLength:_,cleanedLength:_,bytesSaved:0,percentageReducedOfOriginal:0},applicableOpts:o,ranges:null,result:e}}return fn(ci);})();
11
42
  /**
12
- * @name ranges-sort
13
- * @fileoverview Sort string index ranges
14
- * @version 5.0.7
43
+ * @name arrayiffy-if-string
44
+ * @fileoverview Put non-empty strings into arrays, turn empty-ones into empty arrays. Bypass everything else.
45
+ * @version 4.0.10
15
46
  * @author Roy Revelt, Codsen Ltd
16
47
  * @license MIT
17
- * {@link https://codsen.com/os/ranges-sort/}
18
- */const t={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function r(e,r){if(!Array.isArray(e)||!e.length)return e;const n={...t,...r};let i,s;if(n.strictlyTwoElementsInRangeArrays&&!e.filter((e=>e)).every(((e,t)=>2===e.length||(i=t,s=e.length,!1))))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 ${s} elements!`);if(!e.filter((e=>e)).every(((e,t)=>!(!Number.isInteger(e[0])||e[0]<0||!Number.isInteger(e[1])||e[1]<0)||(i=t,!1))))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!`);const o=e.filter((e=>e)).length**2;let a=0;return Array.from(e).filter((e=>e)).sort(((e,t)=>(n.progressFn&&(a+=1,n.progressFn(Math.floor(100*a/o))),e[0]===t[0]?e[1]<t[1]?-1:e[1]>t[1]?1:0:e[0]<t[0]?-1:1)))}
48
+ * {@link https://codsen.com/os/arrayiffy-if-string/}
49
+ */
50
+ /**
51
+ * @name ranges-apply
52
+ * @fileoverview Take an array of string index ranges, delete/replace the string according to them
53
+ * @version 6.0.10
54
+ * @author Roy Revelt, Codsen Ltd
55
+ * @license MIT
56
+ * {@link https://codsen.com/os/ranges-apply/}
57
+ */
19
58
  /**
20
59
  * @name ranges-merge
21
60
  * @fileoverview Merge and sort string index ranges
22
- * @version 8.0.7
61
+ * @version 8.0.10
23
62
  * @author Roy Revelt, Codsen Ltd
24
63
  * @license MIT
25
64
  * {@link https://codsen.com/os/ranges-merge/}
26
- */const n={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function i(e,t){function i(e){return e&&"object"==typeof e&&!Array.isArray(e)}if(!Array.isArray(e)||!e.length)return null;let s;if(t){if(!i(t))throw new Error(`emlint: [THROW_ID_03] the second input argument must be a plain object. It was given as:\n${JSON.stringify(t,null,4)} (type ${typeof t})`);if(s={...n,...t},s.progressFn&&i(s.progressFn)&&!Object.keys(s.progressFn).length)s.progressFn=null;else if(s.progressFn&&"function"!=typeof s.progressFn)throw new Error(`ranges-merge: [THROW_ID_01] opts.progressFn must be a function! It was given of a type: "${typeof s.progressFn}", equal to ${JSON.stringify(s.progressFn,null,4)}`);if(s.mergeType&&1!=+s.mergeType&&2!=+s.mergeType)throw new Error(`ranges-merge: [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "${typeof s.mergeType}", equal to ${JSON.stringify(s.mergeType,null,4)}`);if("boolean"!=typeof s.joinRangesThatTouchEdges)throw new Error(`ranges-merge: [THROW_ID_04] opts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "${typeof s.joinRangesThatTouchEdges}", equal to ${JSON.stringify(s.joinRangesThatTouchEdges,null,4)}`)}else s={...n};const o=e.filter((e=>e)).map((e=>[...e])).filter((e=>void 0!==e[2]||e[0]!==e[1]));let a,l,u;if(a=s.progressFn?r(o,{progressFn:e=>{u=Math.floor(e/5),u!==l&&(l=u,s.progressFn(u))}}):r(o),!a)return null;const h=a.length-1;for(let e=h;e>0;e--)s.progressFn&&(u=Math.floor(78*(1-e/h))+21,u!==l&&u>l&&(l=u,s.progressFn(u))),(a[e][0]<=a[e-1][0]||!s.joinRangesThatTouchEdges&&a[e][0]<a[e-1][1]||s.joinRangesThatTouchEdges&&a[e][0]<=a[e-1][1])&&(a[e-1][0]=Math.min(a[e][0],a[e-1][0]),a[e-1][1]=Math.max(a[e][1],a[e-1][1]),void 0!==a[e][2]&&(a[e-1][0]>=a[e][0]||a[e-1][1]<=a[e][1])&&null!==a[e-1][2]&&(null===a[e][2]&&null!==a[e-1][2]?a[e-1][2]=null:null!=a[e-1][2]?2==+s.mergeType&&a[e-1][0]===a[e][0]?a[e-1][2]=a[e][2]:a[e-1][2]+=a[e][2]:a[e-1][2]=a[e][2]),a.splice(e,1),e=a.length);return a.length?a:null}
65
+ */
27
66
  /**
28
- * @name ranges-apply
29
- * @fileoverview Take an array of string index ranges, delete/replace the string according to them
30
- * @version 6.0.7
67
+ * @name ranges-push
68
+ * @fileoverview Gather string index ranges
69
+ * @version 6.0.10
31
70
  * @author Roy Revelt, Codsen Ltd
32
71
  * @license MIT
33
- * {@link https://codsen.com/os/ranges-apply/}
72
+ * {@link https://codsen.com/os/ranges-push/}
73
+ */
74
+ /**
75
+ * @name ranges-sort
76
+ * @fileoverview Sort string index ranges
77
+ * @version 5.0.10
78
+ * @author Roy Revelt, Codsen Ltd
79
+ * @license MIT
80
+ * {@link https://codsen.com/os/ranges-sort/}
34
81
  */
35
82
  /**
36
83
  * @name string-collapse-leading-whitespace
37
84
  * @fileoverview Collapse the leading and trailing whitespace of a string
38
- * @version 6.0.7
85
+ * @version 6.0.10
39
86
  * @author Roy Revelt, Codsen Ltd
40
87
  * @license MIT
41
88
  * {@link https://codsen.com/os/string-collapse-leading-whitespace/}
42
89
  */
43
- function s(e,t=1){function r(e){return Array.from(e).reverse().join("")}function n(e,t,r){const n=r?"\n":"\r",i=r?"\r":"\n";if(!e)return e;let s=0,o="";for(let r=0,a=e.length;r<a;r++)(e[r]===n||e[r]===i&&e[r-1]!==n)&&s++,"\r\n".includes(e[r])||" "===e[r]?" "===e[r]?o+=e[r]:e[r]===n?s<=t&&(o+=e[r],e[r+1]===i&&(o+=e[r+1],r++)):e[r]===i&&(!e[r-1]||e[r-1]!==n)&&s<=t&&(o+=e[r]):e[r+1]||s||(o+=" ");return o}if("string"==typeof e&&e.length){let i=1;"number"==typeof+t&&Number.isInteger(+t)&&+t>=0&&(i=+t);let s="",o="";if(e.trim()){if(!e[0].trim())for(let t=0,r=e.length;t<r;t++)if(e[t].trim()){s=e.slice(0,t);break}}else s=e;if(e.trim()&&(""===e.slice(-1).trim()||" "===e.slice(-1)))for(let t=e.length;t--;)if(e[t].trim()){o=e.slice(t+1);break}return`${n(s,i,!1)}${e.trim()}${r(n(r(o),i,!0))}`}return e}
44
90
  /**
45
- * @name ranges-push
46
- * @fileoverview Gather string index ranges
47
- * @version 6.0.7
91
+ * @name string-left-right
92
+ * @fileoverview Looks up the first non-whitespace character to the left/right of a given index
93
+ * @version 5.0.10
48
94
  * @author Roy Revelt, Codsen Ltd
49
95
  * @license MIT
50
- * {@link https://codsen.com/os/ranges-push/}
51
- */const o={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function a(e,t){if(!Array.isArray(e)||!e.length)return e;const r={...o,...t};let n,i;if(r.strictlyTwoElementsInRangeArrays&&!e.filter((e=>e)).every(((e,t)=>2===e.length||(n=t,i=e.length,!1))))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, ${n}th range (${JSON.stringify(e[n],null,4)}) has not two but ${i} elements!`);if(!e.filter((e=>e)).every(((e,t)=>!(!Number.isInteger(e[0])||e[0]<0||!Number.isInteger(e[1])||e[1]<0)||(n=t,!1))))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, ${n}th range (${JSON.stringify(e[n],null,4)}) does not consist of only natural numbers!`);const s=e.filter((e=>e)).length**2;let a=0;return Array.from(e).filter((e=>e)).sort(((e,t)=>(r.progressFn&&(a+=1,r.progressFn(Math.floor(100*a/s))),e[0]===t[0]?e[1]<t[1]?-1:e[1]>t[1]?1:0:e[0]<t[0]?-1:1)))}const l={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function u(e){return null!=e}function h(e){return Number.isInteger(e)&&e>=0}function f(e){return"string"==typeof e}const c={limitToBeAddedWhitespace:!1,limitLinebreaksCount:1,mergeType:1};
96
+ * {@link https://codsen.com/os/string-left-right/}
97
+ */
52
98
  /**
53
99
  * @name string-match-left-right
54
100
  * @fileoverview Match substrings on the left or right of a given index, ignoring whitespace
55
- * @version 8.0.7
101
+ * @version 8.0.10
56
102
  * @author Roy Revelt, Codsen Ltd
57
103
  * @license MIT
58
104
  * {@link https://codsen.com/os/string-match-left-right/}
59
105
  */
60
- function g(e){return e&&"object"==typeof e&&!Array.isArray(e)}function p(e){return"string"==typeof e}const m={cb:void 0,i:!1,trimBeforeMatching:!1,trimCharsBeforeMatching:[],maxMismatches:0,firstMustMatch:!1,lastMustMatch:!1,hungry:!1},d=e=>e+1;function y(e,t,r,n,i=!1,s=d){const o="function"==typeof r?r():r;if(+t<0&&i&&"EOL"===o)return o;const a={...m,...n};if(t>=e.length&&!i)return!1;let l=i?1:r.length,u=0,h=!1,f=!1,c=!1,g=a.maxMismatches,p=t,y=!1,T=!1,b=!1;function w(){return 1===u&&g<a.maxMismatches-1}for(;e[p];){const t=s(p);if(a.trimBeforeMatching&&""===e[p].trim()){if(!e[t]&&i&&"EOL"===r)return!0;p=s(p);continue}if(a&&!a.i&&a.trimCharsBeforeMatching&&a.trimCharsBeforeMatching.includes(e[p])||a&&a.i&&a.trimCharsBeforeMatching&&a.trimCharsBeforeMatching.map((e=>e.toLowerCase())).includes(e[p].toLowerCase())){if(i&&"EOL"===r&&!e[t])return!0;p=s(p);continue}const n=t>p?r[r.length-l]:r[l-1];if(!a.i&&e[p]===n||a.i&&e[p].toLowerCase()===n.toLowerCase()){if(y||(y=!0),c||(c=!0),l===r.length){if(T=!0,g!==a.maxMismatches)return!1}else 1===l&&(b=!0);if(l-=1,u++,w())return!1;if(!l)return(u!==r.length||g===a.maxMismatches||!h)&&p}else{if(h||u||(h=!0),!(a.maxMismatches&&g&&p))return!(0!==p||1!==l||a.lastMustMatch||!c)&&0;g-=1;for(let n=0;n<=g;n++){const i=t>p?r[r.length-l+1+n]:r[l-2-n],o=e[s(p)];if(i&&(!a.i&&e[p]===i||a.i&&e[p].toLowerCase()===i.toLowerCase())&&(!a.firstMustMatch||l!==r.length)){if(u++,w())return!1;l-=2,y=!0;break}if(o&&i&&(!a.i&&o===i||a.i&&o.toLowerCase()===i.toLowerCase())&&(!a.firstMustMatch||l!==r.length)){if(!u&&!a.hungry)return!1;l-=1,y=!0;break}if(void 0===i&&g>=0&&y&&(!a.firstMustMatch||T)&&(!a.lastMustMatch||b))return p}y||(f=p)}if(!1!==f&&f!==p&&(f=!1),l<1)return p;p=s(p)}return l>0?!(!i||"EOL"!==o)||!!(a&&a.maxMismatches>=l&&c)&&(f||0):void 0}function T(e,t,r,n,i){if(g(i)&&Object.prototype.hasOwnProperty.call(i,"trimBeforeMatching")&&"boolean"!=typeof i.trimBeforeMatching)throw new Error(`string-match-left-right/${e}(): [THROW_ID_09] opts.trimBeforeMatching should be boolean!${Array.isArray(i.trimBeforeMatching)?" Did you mean to use opts.trimCharsBeforeMatching?":""}`);const s={...m,...i};
61
- /**
62
- * @name arrayiffy-if-string
63
- * @fileoverview Put non-empty strings into arrays, turn empty-ones into empty arrays. Bypass everything else.
64
- * @version 4.0.7
65
- * @author Roy Revelt, Codsen Ltd
66
- * @license MIT
67
- * {@link https://codsen.com/os/arrayiffy-if-string/}
68
- */
69
- var o;if("string"==typeof s.trimCharsBeforeMatching&&(s.trimCharsBeforeMatching="string"==typeof(o=s.trimCharsBeforeMatching)?o.length?[o]:[]:o),s.trimCharsBeforeMatching=s.trimCharsBeforeMatching.map((e=>p(e)?e:String(e))),!p(t))return!1;if(!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:\n${JSON.stringify(r,null,4)}`);let a,l;if(p(n))a=[n];else if(Array.isArray(n))a=n;else if(n){if("function"!=typeof n)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 n}, equal to:\n${JSON.stringify(n,null,4)}`);a=[],a.push(n)}else a=n;if(i&&!g(i))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 i}", and equal to:\n${JSON.stringify(i,null,4)}`);let u=0,h="";if(s&&s.trimCharsBeforeMatching&&s.trimCharsBeforeMatching.some(((e,t)=>e.length>1&&(u=t,h=e,!0))))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 ${u} is longer than 1 character, ${h.length} (equals to ${h}). Please split it into separate characters and put into array as separate elements.`);if(!a||!Array.isArray(a)||Array.isArray(a)&&!a.length||Array.isArray(a)&&1===a.length&&p(a[0])&&!a[0].trim()){if("function"==typeof s.cb){let n,i=r;if("matchLeftIncl"!==e&&"matchRight"!==e||(i+=1),"L"===e[5])for(let e=i;e--;){const r=t[e];if((!s.trimBeforeMatching||s.trimBeforeMatching&&void 0!==r&&r.trim())&&(!s.trimCharsBeforeMatching||!s.trimCharsBeforeMatching.length||void 0!==r&&!s.trimCharsBeforeMatching.includes(r))){n=e;break}}else if(e.startsWith("matchRight"))for(let e=i;e<t.length;e++){const r=t[e];if((!s.trimBeforeMatching||s.trimBeforeMatching&&r.trim())&&(!s.trimCharsBeforeMatching||!s.trimCharsBeforeMatching.length||!s.trimCharsBeforeMatching.includes(r))){n=e;break}}if(void 0===n)return!1;const o=t[n],a=n+1;let l="";return a&&a>0&&(l=t.slice(0,a)),"L"===e[5]?s.cb(o,l,n):(n&&n>0&&(l=t.slice(n)),s.cb(o,l,n))}let n="";throw i||(n=" 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!${n}`)}for(let n=0,i=a.length;n<i;n++){l="function"==typeof a[n];const i=a[n];let o,u,h="",f=r;"matchRight"===e?f+=1:"matchLeft"===e&&(f-=1);const c=y(t,f,i,s,l,(t=>"L"===e[5]?t-1:t+1));if(c&&l&&"function"==typeof i&&"EOL"===i())return!(!i()||s.cb&&!s.cb(o,h,u))&&i();if(Number.isInteger(c)&&(u=e.startsWith("matchLeft")?c-1:c+1,h="L"===e[5]?t.slice(0,c):t.slice(u)),u<0&&(u=void 0),t[u]&&(o=t[u]),Number.isInteger(c)&&(!s.cb||s.cb(o,h,u)))return i}return!1}function b(e,t,r,n){return T("matchLeft",e,t,r,n)}function w(e,t,r,n){return T("matchRightIncl",e,t,r,n)}function _(e,t,r,n){return T("matchRight",e,t,r,n)}
70
106
  /**
71
107
  * @name string-range-expander
72
108
  * @fileoverview Expands string index ranges within whitespace boundaries until letters are met
73
- * @version 3.0.7
109
+ * @version 3.0.10
74
110
  * @author Roy Revelt, Codsen Ltd
75
111
  * @license MIT
76
112
  * {@link https://codsen.com/os/string-range-expander/}
77
- */const v={str:"",from:0,to:0,ifLeftSideIncludesThisThenCropTightly:"",ifLeftSideIncludesThisCropItToo:"",ifRightSideIncludesThisThenCropTightly:"",ifRightSideIncludesThisCropItToo:"",extendToOneSide:!1,wipeAllWhitespaceOnLeft:!1,wipeAllWhitespaceOnRight:!1,addSingleSpaceToPreventAccidentalConcatenation:!1};function O(e){const t=/^[0-9a-zA-Z]+$/;function r(e){return!(!e||"string"!=typeof e)&&!e.trim()}function n(e){return"string"==typeof e}if(!e||"object"!=typeof e||Array.isArray(e)){let t;throw t=void 0===e?"but it is missing completely.":null===e?"but it was given as null.":`but it was given as ${typeof e}, equal to:\n${JSON.stringify(e,null,4)}.`,new Error(`string-range-expander: [THROW_ID_01] Input must be a plain object ${t}`)}if("object"==typeof e&&null!==e&&!Array.isArray(e)&&!Object.keys(e).length)throw new Error("string-range-expander: [THROW_ID_02] Input must be a plain object but it was given as a plain object without any keys.");if("number"!=typeof e.from)throw new Error(`string-range-expander: [THROW_ID_03] The input's "from" value opts.from, is not a number! Currently it's given as ${typeof e.from}, equal to ${JSON.stringify(e.from,null,0)}`);if("number"!=typeof e.to)throw new Error(`string-range-expander: [THROW_ID_04] The input's "to" value opts.to, is not a number! Currently it's given as ${typeof e.to}, equal to ${JSON.stringify(e.to,null,0)}`);if(e&&e.str&&!e.str[e.from]&&e.from!==e.to)throw new Error(`string-range-expander: [THROW_ID_05] The given input string opts.str ("${e.str}") must contain the character at index "from" ("${e.from}")`);if(e&&e.str&&!e.str[e.to-1])throw new Error(`string-range-expander: [THROW_ID_06] The given input string, opts.str ("${e.str}") must contain the character at index before "to" ("${e.to-1}")`);if(e.from>e.to)throw new Error(`string-range-expander: [THROW_ID_07] The given "from" index, "${e.from}" is greater than "to" index, "${e.to}". That's wrong!`);if(n(e.extendToOneSide)&&"left"!==e.extendToOneSide&&"right"!==e.extendToOneSide||!n(e.extendToOneSide)&&void 0!==e.extendToOneSide&&!1!==e.extendToOneSide)throw new Error(`string-range-expander: [THROW_ID_08] The opts.extendToOneSide value is not recogniseable! It's set to: "${e.extendToOneSide}" (${typeof e.extendToOneSide}). It has to be either Boolean "false" or strings "left" or "right"`);const i={...v,...e};if(Array.isArray(i.ifLeftSideIncludesThisThenCropTightly)){let e,t;if(!i.ifLeftSideIncludesThisThenCropTightly.every(((r,i)=>!!n(r)||(e=i,t=r,!1))))throw new Error(`string-range-expander: [THROW_ID_09] The opts.ifLeftSideIncludesThisThenCropTightly was set to an array:\n${JSON.stringify(i.ifLeftSideIncludesThisThenCropTightly,null,4)}. Now, that array contains not only string elements. For example, an element at index ${e} is of a type ${typeof t} (equal to ${JSON.stringify(t,null,0)}).`);i.ifLeftSideIncludesThisThenCropTightly=i.ifLeftSideIncludesThisThenCropTightly.join("")}const s=i.str;let o=i.from,a=i.to;if("right"!==i.extendToOneSide&&(r(s[o-1])&&(r(s[o-2])||i.ifLeftSideIncludesThisCropItToo.includes(s[o-2]))||s[o-1]&&i.ifLeftSideIncludesThisCropItToo.includes(s[o-1])||i.wipeAllWhitespaceOnLeft&&r(s[o-1])))for(let e=o;e--;)if(!i.ifLeftSideIncludesThisCropItToo.includes(s[e])){if(s[e].trim()){o=i.wipeAllWhitespaceOnLeft||i.ifLeftSideIncludesThisCropItToo.includes(s[e+1])?e+1:e+2;break}if(0===e){o=i.wipeAllWhitespaceOnLeft?0:1;break}}if("left"!==i.extendToOneSide&&(r(s[a])&&(i.wipeAllWhitespaceOnRight||r(s[a+1]))||i.ifRightSideIncludesThisCropItToo.includes(s[a])))for(let e=a,t=s.length;e<t;e++)if(!i.ifRightSideIncludesThisCropItToo.includes(s[e])&&(s[e]&&s[e].trim()||void 0===s[e])){a=i.wipeAllWhitespaceOnRight||i.ifRightSideIncludesThisCropItToo.includes(s[e-1])?e:e-1;break}return("right"!==i.extendToOneSide&&n(i.ifLeftSideIncludesThisThenCropTightly)&&i.ifLeftSideIncludesThisThenCropTightly&&(s[o-2]&&i.ifLeftSideIncludesThisThenCropTightly.includes(s[o-2])||s[o-1]&&i.ifLeftSideIncludesThisThenCropTightly.includes(s[o-1]))||"left"!==i.extendToOneSide&&n(i.ifRightSideIncludesThisThenCropTightly)&&i.ifRightSideIncludesThisThenCropTightly&&(s[a+1]&&i.ifRightSideIncludesThisThenCropTightly.includes(s[a+1])||s[a]&&i.ifRightSideIncludesThisThenCropTightly.includes(s[a])))&&("right"!==i.extendToOneSide&&r(s[o-1])&&!i.wipeAllWhitespaceOnLeft&&(o-=1),"left"!==i.extendToOneSide&&r(s[a])&&!i.wipeAllWhitespaceOnRight&&(a+=1)),i.addSingleSpaceToPreventAccidentalConcatenation&&s[o-1]&&s[o-1].trim()&&s[a]&&s[a].trim()&&(!i.ifLeftSideIncludesThisThenCropTightly&&!i.ifRightSideIncludesThisThenCropTightly||i.ifLeftSideIncludesThisThenCropTightly&&!i.ifLeftSideIncludesThisThenCropTightly.includes(s[o-1])||!(!i.ifRightSideIncludesThisThenCropTightly||s[a]&&i.ifRightSideIncludesThisThenCropTightly.includes(s[a])))&&(t.test(s[o-1])||t.test(s[a]))?[o,a," "]:[o,a]}var I="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};Function.prototype.toString.call(Object);var L={exports:{}};!function(e,t){var r="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",s="[object Boolean]",o="[object Date]",a="[object Function]",l="[object GeneratorFunction]",u="[object Map]",h="[object Number]",f="[object Object]",c="[object Promise]",g="[object RegExp]",p="[object Set]",m="[object String]",d="[object Symbol]",y="[object WeakMap]",T="[object ArrayBuffer]",b="[object DataView]",w="[object Float32Array]",_="[object Float64Array]",v="[object Int8Array]",O="[object Int16Array]",L="[object Int32Array]",A="[object Uint8Array]",S="[object Uint8ClampedArray]",$="[object Uint16Array]",C="[object Uint32Array]",R=/\w*$/,M=/^\[object .+?Constructor\]$/,j=/^(?:0|[1-9]\d*)$/,x={};x[i]=x["[object Array]"]=x[T]=x[b]=x[s]=x[o]=x[w]=x[_]=x[v]=x[O]=x[L]=x[u]=x[h]=x[f]=x[g]=x[p]=x[m]=x[d]=x[A]=x[S]=x[$]=x[C]=!0,x["[object Error]"]=x[a]=x[y]=!1;var W="object"==typeof self&&self&&self.Object===Object&&self,E="object"==typeof I&&I&&I.Object===Object&&I||W||Function("return this")(),F=t&&!t.nodeType&&t,N=F&&e&&!e.nodeType&&e,H=N&&N.exports===F;function k(e,t){return e.set(t[0],t[1]),e}function B(e,t){return e.add(t),e}function D(e,t,r,n){var i=-1,s=e?e.length:0;for(n&&s&&(r=e[++i]);++i<s;)r=t(r,e[i],i,e);return r}function J(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function P(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function q(e,t){return function(r){return e(t(r))}}function U(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}var z,V=Array.prototype,G=Function.prototype,Y=Object.prototype,Z=E["__core-js_shared__"],K=(z=/[^.]+$/.exec(Z&&Z.keys&&Z.keys.IE_PROTO||""))?"Symbol(src)_1."+z:"",Q=G.toString,X=Y.hasOwnProperty,ee=Y.toString,te=RegExp("^"+Q.call(X).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),re=H?E.Buffer:void 0,ne=E.Symbol,ie=E.Uint8Array,se=q(Object.getPrototypeOf,Object),oe=Object.create,ae=Y.propertyIsEnumerable,le=V.splice,ue=Object.getOwnPropertySymbols,he=re?re.isBuffer:void 0,fe=q(Object.keys,Object),ce=Ne(E,"DataView"),ge=Ne(E,"Map"),pe=Ne(E,"Promise"),me=Ne(E,"Set"),de=Ne(E,"WeakMap"),ye=Ne(Object,"create"),Te=Je(ce),be=Je(ge),we=Je(pe),_e=Je(me),ve=Je(de),Oe=ne?ne.prototype:void 0,Ie=Oe?Oe.valueOf:void 0;function Le(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Ae(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Se(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function $e(e){this.__data__=new Ae(e)}function Ce(e,t){var r=qe(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Ue(e)}(e)&&X.call(e,"callee")&&(!ae.call(e,"callee")||ee.call(e)==i)}(e)?function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}(e.length,String):[],n=r.length,s=!!n;for(var o in e)!t&&!X.call(e,o)||s&&("length"==o||Be(o,n))||r.push(o);return r}function Re(e,t,r){var n=e[t];X.call(e,t)&&Pe(n,r)&&(void 0!==r||t in e)||(e[t]=r)}function Me(e,t){for(var r=e.length;r--;)if(Pe(e[r][0],t))return r;return-1}function je(e,t,r,n,c,y,I){var M;if(n&&(M=y?n(e,c,y,I):n(e)),void 0!==M)return M;if(!Ge(e))return e;var j=qe(e);if(j){if(M=function(e){var t=e.length,r=e.constructor(t);t&&"string"==typeof e[0]&&X.call(e,"index")&&(r.index=e.index,r.input=e.input);return r}(e),!t)return function(e,t){var r=-1,n=e.length;t||(t=Array(n));for(;++r<n;)t[r]=e[r];return t}(e,M)}else{var W=ke(e),E=W==a||W==l;if(ze(e))return function(e,t){if(t)return e.slice();var r=new e.constructor(e.length);return e.copy(r),r}(e,t);if(W==f||W==i||E&&!y){if(J(e))return y?e:{};if(M=function(e){return"function"!=typeof e.constructor||De(e)?{}:(t=se(e),Ge(t)?oe(t):{});var t}(E?{}:e),!t)return function(e,t){return Ee(e,He(e),t)}(e,function(e,t){return e&&Ee(t,Ye(t),e)}(M,e))}else{if(!x[W])return y?e:{};M=function(e,t,r,n){var i=e.constructor;switch(t){case T:return We(e);case s:case o:return new i(+e);case b:return function(e,t){var r=t?We(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,n);case w:case _:case v:case O:case L:case A:case S:case $:case C:return function(e,t){var r=t?We(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}(e,n);case u:return function(e,t,r){return D(t?r(P(e),!0):P(e),k,new e.constructor)}(e,n,r);case h:case m:return new i(e);case g:return function(e){var t=new e.constructor(e.source,R.exec(e));return t.lastIndex=e.lastIndex,t}(e);case p:return function(e,t,r){return D(t?r(U(e),!0):U(e),B,new e.constructor)}(e,n,r);case d:return a=e,Ie?Object(Ie.call(a)):{}}var a}(e,W,je,t)}}I||(I=new $e);var F=I.get(e);if(F)return F;if(I.set(e,M),!j)var N=r?function(e){return function(e,t,r){var n=t(e);return qe(e)?n:function(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}(n,r(e))}(e,Ye,He)}(e):Ye(e);return function(e,t){for(var r=-1,n=e?e.length:0;++r<n&&!1!==t(e[r],r,e););}(N||e,(function(i,s){N&&(i=e[s=i]),Re(M,s,je(i,t,r,n,s,e,I))})),M}function xe(e){return!(!Ge(e)||(t=e,K&&K in t))&&(Ve(e)||J(e)?te:M).test(Je(e));var t}function We(e){var t=new e.constructor(e.byteLength);return new ie(t).set(new ie(e)),t}function Ee(e,t,r,n){r||(r={});for(var i=-1,s=t.length;++i<s;){var o=t[i],a=n?n(r[o],e[o],o,r,e):void 0;Re(r,o,void 0===a?e[o]:a)}return r}function Fe(e,t){var r,n,i=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof t?"string":"hash"]:i.map}function Ne(e,t){var r=function(e,t){return null==e?void 0:e[t]}(e,t);return xe(r)?r:void 0}Le.prototype.clear=function(){this.__data__=ye?ye(null):{}},Le.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},Le.prototype.get=function(e){var t=this.__data__;if(ye){var n=t[e];return n===r?void 0:n}return X.call(t,e)?t[e]:void 0},Le.prototype.has=function(e){var t=this.__data__;return ye?void 0!==t[e]:X.call(t,e)},Le.prototype.set=function(e,t){return this.__data__[e]=ye&&void 0===t?r:t,this},Ae.prototype.clear=function(){this.__data__=[]},Ae.prototype.delete=function(e){var t=this.__data__,r=Me(t,e);return!(r<0)&&(r==t.length-1?t.pop():le.call(t,r,1),!0)},Ae.prototype.get=function(e){var t=this.__data__,r=Me(t,e);return r<0?void 0:t[r][1]},Ae.prototype.has=function(e){return Me(this.__data__,e)>-1},Ae.prototype.set=function(e,t){var r=this.__data__,n=Me(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},Se.prototype.clear=function(){this.__data__={hash:new Le,map:new(ge||Ae),string:new Le}},Se.prototype.delete=function(e){return Fe(this,e).delete(e)},Se.prototype.get=function(e){return Fe(this,e).get(e)},Se.prototype.has=function(e){return Fe(this,e).has(e)},Se.prototype.set=function(e,t){return Fe(this,e).set(e,t),this},$e.prototype.clear=function(){this.__data__=new Ae},$e.prototype.delete=function(e){return this.__data__.delete(e)},$e.prototype.get=function(e){return this.__data__.get(e)},$e.prototype.has=function(e){return this.__data__.has(e)},$e.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Ae){var n=r.__data__;if(!ge||n.length<199)return n.push([e,t]),this;r=this.__data__=new Se(n)}return r.set(e,t),this};var He=ue?q(ue,Object):function(){return[]},ke=function(e){return ee.call(e)};function Be(e,t){return!!(t=null==t?n:t)&&("number"==typeof e||j.test(e))&&e>-1&&e%1==0&&e<t}function De(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Y)}function Je(e){if(null!=e){try{return Q.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Pe(e,t){return e===t||e!=e&&t!=t}(ce&&ke(new ce(new ArrayBuffer(1)))!=b||ge&&ke(new ge)!=u||pe&&ke(pe.resolve())!=c||me&&ke(new me)!=p||de&&ke(new de)!=y)&&(ke=function(e){var t=ee.call(e),r=t==f?e.constructor:void 0,n=r?Je(r):void 0;if(n)switch(n){case Te:return b;case be:return u;case we:return c;case _e:return p;case ve:return y}return t});var qe=Array.isArray;function Ue(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}(e.length)&&!Ve(e)}var ze=he||function(){return!1};function Ve(e){var t=Ge(e)?ee.call(e):"";return t==a||t==l}function Ge(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Ye(e){return Ue(e)?Ce(e):function(e){if(!De(e))return fe(e);var t=[];for(var r in Object(e))X.call(e,r)&&"constructor"!=r&&t.push(r);return t}(e)}e.exports=function(e){return je(e,!0,!0)}}(L,L.exports);
78
- /**
79
- * @name string-left-right
80
- * @fileoverview Looks up the first non-whitespace character to the left/right of a given index
81
- * @version 5.0.7
82
- * @author Roy Revelt, Codsen Ltd
83
- * @license MIT
84
- * {@link https://codsen.com/os/string-left-right/}
85
113
  */
86
- const A=" ";function S(e,t=0){return function({str:e,idx:t=0,stopAtNewlines:r=!1,stopAtRawNbsp:n=!1}){if("string"!=typeof e||!e.length)return null;if(t&&"number"==typeof t||(t=0),!e[t+1])return null;if(e[t+1]&&(e[t+1].trim()||r&&"\n\r".includes(e[t+1])||n&&e[t+1]===A))return t+1;if(e[t+2]&&(e[t+2].trim()||r&&"\n\r".includes(e[t+2])||n&&e[t+2]===A))return t+2;for(let i=t+1,s=e.length;i<s;i++)if(e[i].trim()||r&&"\n\r".includes(e[i])||n&&e[i]===A)return i;return null}({str:e,idx:t,stopAtNewlines:!1,stopAtRawNbsp:!1})}function $(e,t=0){return function({str:e,idx:t,stopAtNewlines:r,stopAtRawNbsp:n}){if("string"!=typeof e||!e.length)return null;if(t&&"number"==typeof t||(t=0),t<1)return null;if(e[~-t]&&(e[~-t].trim()||r&&"\n\r".includes(e[~-t])||n&&e[~-t]===A))return~-t;if(e[t-2]&&(e[t-2].trim()||r&&"\n\r".includes(e[t-2])||n&&e[t-2]===A))return t-2;for(let i=t;i--;)if(e[i]&&(e[i].trim()||r&&"\n\r".includes(e[i])||n&&e[i]===A))return i;return null}({str:e,idx:t,stopAtNewlines:!1,stopAtRawNbsp:!1})}const C=new class{constructor(e){const t={...c,...e};if(t.mergeType&&1!==t.mergeType&&2!==t.mergeType)if(f(t.mergeType)&&"1"===t.mergeType.trim())t.mergeType=1;else{if(!f(t.mergeType)||"2"!==t.mergeType.trim())throw new Error(`ranges-push: [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "${typeof t.mergeType}", equal to ${JSON.stringify(t.mergeType,null,4)}`);t.mergeType=2}this.opts=t,this.ranges=[]}ranges;opts;add(e,t,r){if(null==e&&null==t)return;if(u(e)&&!u(t)){if(Array.isArray(e)){if(e.length){if(e.some((e=>Array.isArray(e))))return void e.forEach((e=>{Array.isArray(e)&&this.add(...e)}));e.length&&h(+e[0])&&h(+e[1])&&this.add(...e)}return}throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_12] the first input argument, "from" is set (${JSON.stringify(e,null,0)}) but second-one, "to" is not (${JSON.stringify(t,null,0)})`)}if(!u(e)&&u(t))throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_13] the second input argument, "to" is set (${JSON.stringify(t,null,0)}) but first-one, "from" is not (${JSON.stringify(e,null,0)})`);const n=+e,i=+t;if(h(r)&&(r=String(r)),!h(n)||!h(i))throw h(n)&&n>=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 i}" equal to: ${JSON.stringify(i,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 n}" equal to: ${JSON.stringify(n,null,4)}`);if(u(r)&&!f(r)&&!h(r))throw new TypeError(`ranges-push/Ranges/add(): [THROW_ID_08] The third argument, the value to add, was given not as string but ${typeof r}, equal to:\n${JSON.stringify(r,null,4)}`);if(u(this.ranges)&&Array.isArray(this.last())&&n===this.last()[1]){if(this.last()[1]=i,this.last(),null!==this.last()[2]&&u(r)){let e=!(this.last()[2]&&this.last()[2].length>0)||this.opts&&this.opts.mergeType&&1!==this.opts.mergeType?r:this.last()[2]+r;this.opts.limitToBeAddedWhitespace&&(e=s(e,this.opts.limitLinebreaksCount)),f(e)&&!e.length||(this.last()[2]=e)}}else{this.ranges||(this.ranges=[]);const e=void 0===r||f(r)&&!r.length?[n,i]:[n,i,r&&this.opts.limitToBeAddedWhitespace?s(r,this.opts.limitLinebreaksCount):r];this.ranges.push(e)}}push(e,t,r){this.add(e,t,r)}current(){return Array.isArray(this.ranges)&&this.ranges.length?(this.ranges=function(e,t){function r(e){return e&&"object"==typeof e&&!Array.isArray(e)}if(!Array.isArray(e)||!e.length)return null;let n;if(t){if(!r(t))throw new Error(`emlint: [THROW_ID_03] the second input argument must be a plain object. It was given as:\n${JSON.stringify(t,null,4)} (type ${typeof t})`);if(n={...l,...t},n.progressFn&&r(n.progressFn)&&!Object.keys(n.progressFn).length)n.progressFn=null;else if(n.progressFn&&"function"!=typeof n.progressFn)throw new Error(`ranges-merge: [THROW_ID_01] opts.progressFn must be a function! It was given of a type: "${typeof n.progressFn}", equal to ${JSON.stringify(n.progressFn,null,4)}`);if(n.mergeType&&1!=+n.mergeType&&2!=+n.mergeType)throw new Error(`ranges-merge: [THROW_ID_02] opts.mergeType was customised to a wrong thing! It was given of a type: "${typeof n.mergeType}", equal to ${JSON.stringify(n.mergeType,null,4)}`);if("boolean"!=typeof n.joinRangesThatTouchEdges)throw new Error(`ranges-merge: [THROW_ID_04] opts.joinRangesThatTouchEdges was customised to a wrong thing! It was given of a type: "${typeof n.joinRangesThatTouchEdges}", equal to ${JSON.stringify(n.joinRangesThatTouchEdges,null,4)}`)}else n={...l};const i=e.filter((e=>e)).map((e=>[...e])).filter((e=>void 0!==e[2]||e[0]!==e[1]));let s,o,u;if(s=n.progressFn?a(i,{progressFn:e=>{u=Math.floor(e/5),u!==o&&(o=u,n.progressFn(u))}}):a(i),!s)return null;const h=s.length-1;for(let e=h;e>0;e--)n.progressFn&&(u=Math.floor(78*(1-e/h))+21,u!==o&&u>o&&(o=u,n.progressFn(u))),(s[e][0]<=s[e-1][0]||!n.joinRangesThatTouchEdges&&s[e][0]<s[e-1][1]||n.joinRangesThatTouchEdges&&s[e][0]<=s[e-1][1])&&(s[e-1][0]=Math.min(s[e][0],s[e-1][0]),s[e-1][1]=Math.max(s[e][1],s[e-1][1]),void 0!==s[e][2]&&(s[e-1][0]>=s[e][0]||s[e-1][1]<=s[e][1])&&null!==s[e-1][2]&&(null===s[e][2]&&null!==s[e-1][2]?s[e-1][2]=null:null!=s[e-1][2]?2==+n.mergeType&&s[e-1][0]===s[e][0]?s[e-1][2]=s[e][2]:s[e-1][2]+=s[e][2]:s[e-1][2]=s[e][2]),s.splice(e,1),e=s.length);return s.length?s:null}(this.ranges,{mergeType:this.opts.mergeType}),this.ranges&&this.opts.limitToBeAddedWhitespace?this.ranges.map((e=>u(e[2])?[e[0],e[1],s(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])||!h(e[0][0]))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.`);this.ranges=Array.from(e)}else this.ranges=[]}last(){return Array.isArray(this.ranges)&&this.ranges.length?this.ranges[this.ranges.length-1]:null}}({limitToBeAddedWhitespace:!0}),R={lineLengthLimit:500,removeIndentations:!0,removeLineBreaks:!1,removeHTMLComments:!1,removeCSSComments:!0,reportProgressFunc:null,reportProgressFuncFrom:0,reportProgressFuncTo:100,breakToTheLeftOf:["</td","<html","</html","<head","</head","<meta","<link","<table","<script","</script","<!DOCTYPE","<style","</style","<title","<body","@media","</body","\x3c!--[if","\x3c!--<![endif","<![endif]"],mindTheInlineTags:["a","abbr","acronym","audio","b","bdi","bdo","big","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","label","map","mark","meter","noscript","object","output","picture","progress","q","ruby","s","samp","script","select","slot","small","span","strong","sub","sup","svg","template","textarea","time","u","tt","var","video","wbr"]},M={removeHTMLComments:!1,removeCSSComments:!1};function j(e){return"string"==typeof e}function x(e){return"string"==typeof e&&e.toUpperCase()!==e.toLowerCase()}e.crush=function(e,t){const r=Date.now();if(!j(e))throw void 0===e?new Error("html-crush: [THROW_ID_01] the first input argument is completely missing! It should be given as string."):new Error(`html-crush: [THROW_ID_02] the first input argument must be string! It was given as "${typeof e}", equal to:\n${JSON.stringify(e,null,4)}`);if(t&&"object"!=typeof t)throw new Error(`html-crush: [THROW_ID_03] the second input argument, options object, should be a plain object but it was given as type ${typeof t}, equal to ${JSON.stringify(t,null,4)}`);if(t&&Array.isArray(t.breakToTheLeftOf)&&t.breakToTheLeftOf.length)for(let e=0,r=t.breakToTheLeftOf.length;e<r;e++)if(!j(t.breakToTheLeftOf[e]))throw new TypeError(`html-crush: [THROW_ID_05] the opts.breakToTheLeftOf array contains non-string elements! For example, element at index ${e} is of a type "${typeof t.breakToTheLeftOf[e]}" and is equal to:\n${JSON.stringify(t.breakToTheLeftOf[e],null,4)}`);const n={...R,...t};"boolean"==typeof n.removeHTMLComments&&(n.removeHTMLComments=n.removeHTMLComments?1:0);let s="";Array.isArray(n.breakToTheLeftOf)&&n.breakToTheLeftOf.length&&(s=[...new Set(n.breakToTheLeftOf.map((e=>e[0])))].join(""));let o,a=null,l=null,u=!1,h=0,f=0,c=!1,g=!1,p=null,m=null,d=null,y=null,T=null,v=null,I=null,L=null,A=null,W=null;const E=">};",F="<",N="!",H=">",k="<",B="{},:;<>~+",D=B,J=B;let P=!0;const q=e.length,U=Math.floor(q/2);let z,V;n.reportProgressFunc&&(z=Math.floor(n.reportProgressFuncTo-.01*(n.reportProgressFuncTo-n.reportProgressFuncFrom)-n.reportProgressFuncFrom));let G=0,Y="\n";if(e.includes("\r\n")?Y="\r\n":e.includes("\r")&&(Y="\r"),q){for(let t=0;t<q;t++)if(n.reportProgressFunc&&(q>1e3&&q<2e3?t===U&&n.reportProgressFunc(Math.floor((n.reportProgressFuncTo-n.reportProgressFuncFrom)/2)):q>=2e3&&(V=n.reportProgressFuncFrom+Math.floor(t/q*(z||1)),V!==G&&(G=V,n.reportProgressFunc(V)))),f++,!o&&c&&"}"===e[t]&&"}"===e[t-1]&&(h+1>=n.lineLengthLimit?(C.push(t,t,Y),h=0):(T=t,v=t,I=" ")),o&&"number"==typeof o&&t>=o&&(o=void 0),null===y||!e.startsWith("</script",t)||x(e[t+8])){if(!o&&!c&&e.startsWith("<script",t)&&!x(e[t+7])){y=t,o=!0;let e="";(n.removeLineBreaks||n.removeIndentations)&&null!==l&&(l>0&&(e=Y),C.push(l,t,e)),l=null,a=null}if(null!==A&&null===L&&!/\w/.test(e[t])){L=e.slice(A,t);const r=S(e,~-t);"number"==typeof r&&">"===e[r]&&!e[t].trim()&&S(e,t)?C.push(t,S(e,t)):r&&"/"===e[r]&&">"===e[S(e,r)]&&(!e[t].trim()&&S(e,t)&&C.push(t,S(e,t)),">"!==e[r+1]&&S(e,r+1)&&C.push(r+1,S(e,r+1)))}if(o||c||p||"<"!==e[~-t]||null!==A||(/\w/.test(e[t])?A=t:"/"===e[S(e,~-t)]&&/\w/.test(e[S(e,S(e,~-t))]||"")&&(A=S(e,S(e,~-t)))),o||!c&&!p||null===m||"*"!==e[t]||"/"!==e[t+1]||([T,v]=O({str:e,from:m,to:t+2,ifLeftSideIncludesThisThenCropTightly:D,ifRightSideIncludesThisThenCropTightly:J}),m=null,null!=T?C.push(T,v):(h+=1,t+=1),o=t+2),o||!c&&!p||null!==m||"/"!==e[t]||"*"!==e[t+1]||(M.removeCSSComments||(M.removeCSSComments=!0),n.removeCSSComments&&(m=t)),g&&e.startsWith("![endif",t+1)&&(g=!1),!o&&!c&&!p&&null!==d){let r;e.startsWith("--\x3e",t)?r=3:">"===e[t]&&"]"===e[t-1]&&(r=1),r&&([T,v]=O({str:e,from:d,to:t+r}),d=null,null!=T?n.lineLengthLimit&&f-(v-T)>=n.lineLengthLimit?(C.push(T,v,Y),f=-r):(C.push(T,v),f-=v-T):(h+=r-1,t+=r-1),o=t+r)}if(o||c||p||!e.startsWith("\x3c!--",t)||null!==d||(e.startsWith("[if",t+4)?(g||(g=!0),2===n.removeHTMLComments&&(d=t)):!n.removeHTMLComments||g&&2!==n.removeHTMLComments||(d=t),M.removeHTMLComments||(M.removeHTMLComments=!0)),!o&&c&&null===m&&e.startsWith("</style",t)&&!x(e[t+7])?c=!1:o||c||null!==m||!e.startsWith("<style",t)||x(e[t+6])||(c=!0,(n.removeLineBreaks||n.removeIndentations)&&n.breakToTheLeftOf.includes("<style")&&e.startsWith(' type="text/css">',t+6)&&e[t+24]&&C.push(t+23,t+23,Y)),!o&&!p&&"\"'".includes(e[t])&&e.endsWith("style=",t)&&(p=t),o||e[t].trim()){if(!o&&(!c&&!p||null===m)){if(null!==l){if(n.removeLineBreaks&&(h+=1),P)P=!1,(n.removeIndentations||n.removeLineBreaks)&&C.push(0,t);else if(n.removeIndentations&&!n.removeLineBreaks&&(!u&&null!==a&&t>a?C.push(a+1,t):l+1<t&&(e.endsWith("]>",l)||e.endsWith("--\x3e",l)||e.startsWith("<![",t)||e.startsWith("\x3c!--<![",t)?C.push(l,t):" "===e[l]?C.push(l+1,t):" "===e[~-t]?C.push(l,~-t):C.push(l,t," "))),n.removeLineBreaks||p){if(s.includes(e[t])&&w(e,t,n.breakToTheLeftOf)){"\r\n".includes(e[~-t])&&l===~-t||"\n"===e[~-t]&&"\r"===e[t-2]&&l===t-2||C.push(l,t,Y),T=null,v=null,I=null,l=null,h=1;continue}let r=" ";"<"===e[t]&&_(e,t,n.mindTheInlineTags,{cb:e=>!e||!/\w/.test(e)})||(e[~-l]&&H.includes(e[~-l])&&k.includes(e[t])||(c||p)&&null===m&&(D.includes(e[~-l])||J.includes(e[t]))||e.startsWith("!important",t)&&!g||p&&("'"===e[~-l]||'"'===e[~-l])||"}"===e[~-l]&&e.startsWith("</style",t)||">"===e[t]&&("'\"".includes(e[$(e,t)])||"<"===e[S(e,t)])||"/"===e[t]&&">"===e[S(e,t)])&&(r="","/"===e[t]&&">"===e[t+1]&&S(e,t)&&S(e,t)>t+1&&(C.push(t+1,S(e,t)),h-=S(e,t)-t+1)),c&&"}"===e[t]&&l&&"}"===e[l-1]&&(r=" "),r&&r.length&&(h+=1),n.lineLengthLimit?h>=n.lineLengthLimit||!e[t+1]||">"===e[t]||"/"===e[t]&&">"===e[t+1]?((h>n.lineLengthLimit||h===n.lineLengthLimit&&e[t+1]&&e[t+1].trim()&&!E.includes(e[t])&&!F.includes(e[t+1]))&&(r=Y,h=1),(h>n.lineLengthLimit||" "!==r||t!==l+1)&&(C.push(l,t,r),a=null),T=null,v=null,I=null):(null===T||l<T)&&(T=l,v=t,I=r):t===l+1&&" "===r||C.push(l,t,r)}l=null,u||(u=!0)}else P&&(P=!1),n.removeLineBreaks&&(h+=1);u||(u=!0)}}else null===l&&(l=t);if(!o&&!P&&0!==t&&n.removeLineBreaks&&(n.lineLengthLimit||s)&&!e.startsWith("</a",t)){if(s&&w(e,t,n.breakToTheLeftOf)&&e.slice(0,t).trim()&&(!e.startsWith("<![endif]",t)||!b(e,t,"\x3c!--"))){C.push(t,t,Y),T=null,v=null,I=null,h=1;continue}if(n.lineLengthLimit&&h<=n.lineLengthLimit){if(!e[t+1]||F.includes(e[t])&&!N.includes(e[t])||E.includes(e[t])||!e[t].trim()){if(null!==T&&null!==v&&(T!==v||I&&I.length)){let r=I;e[t].trim()&&e[t+1]&&e[t+1].trim()&&h+(I?I.length:0)>n.lineLengthLimit&&(r=Y),(h+(r?r.length:0)>n.lineLengthLimit||" "!==r||v!==T+1||" "!==e[T])&&("}"===e[~-T]&&"{"===e[v]||(C.push(T,v,r),a=null))}!(e[t].trim()&&(F.includes(e[t])||e[~-t]&&E.includes(e[~-t]))&&j(W))||L&&n.mindTheInlineTags.includes(L)||"<"===e[t]&&_(e,t,n.mindTheInlineTags,{cb:e=>!e||!/\w/.test(e)})||"<"===e[t]&&_(e,t,n.mindTheInlineTags,{trimCharsBeforeMatching:"/",cb:e=>!e||!/\w/.test(e)})?null!==m||null===T||!(p||!n.mindTheInlineTags||!Array.isArray(n.mindTheInlineTags)||Array.isArray(n.mindTheInlineTags.length)&&!n.mindTheInlineTags.length||!j(L)||Array.isArray(n.mindTheInlineTags)&&n.mindTheInlineTags.length&&j(L)&&!n.mindTheInlineTags.includes(L))||"<"===e[t]&&_(e,t,n.mindTheInlineTags,{trimCharsBeforeMatching:"/",cb:e=>!e||!/\w/.test(e)})||(T=null,v=null,I=null):(T=t,v=t,I=null)}}else if(n.lineLengthLimit)if(!F.includes(e[t])||"<"===e[t]&&_(e,t,n.mindTheInlineTags,{trimCharsBeforeMatching:"/",cb:e=>!e||!/\w/.test(e)}))e[t+1]&&E.includes(e[t])&&j(L)&&Array.isArray(n.mindTheInlineTags)&&n.mindTheInlineTags.length&&!n.mindTheInlineTags.includes(L)?null!==T&&null!==v&&(T!==v||I&&I.length)||(C.push(t+1,t+1,Y),h=0):e[t].trim()&&(e[t+1]||null!==T&&null!==v&&(T!==v||I&&I.length)&&C.push(T,v,Y));else if(null!==T&&null!==v&&(T!==v||I&&I.length)){const e=I&&I.length?I.length:0;h-(v-T-e)-1>n.lineLengthLimit||(C.push(T,v,I),h-(v-T-e)-1===n.lineLengthLimit&&(C.push(t,t,Y),h=0),T=null,v=null,I=null)}else C.push(t,t,Y),h=0}if(!o&&!P&&n.removeLineBreaks&&n.lineLengthLimit&&h>=n.lineLengthLimit&&null!==T&&null!==v&&!E.includes(e[t])&&!F.includes(e[t])&&!"/".includes(e[t])&&(h!==n.lineLengthLimit||!e[t+1]||e[t+1].trim())){let r=Y;e[t+1]&&!e[t+1].trim()&&h===n.lineLengthLimit&&(r=I),r===Y&&!e[~-T].trim()&&$(e,T)&&(T=$(e,T)+1),C.push(T,v,r),h=t-v,e[t].length&&(h+=1),T=null,v=null,I=null}if((!o&&"\n"===e[t]||"\r"===e[t]&&(!e[t+1]||e[t+1]&&"\n"!==e[t+1]))&&(a=t,u&&(u=!1),!n.removeLineBreaks&&null!==l&&l<t&&e[t+1]&&"\r"!==e[t+1]&&"\n"!==e[t+1]&&C.push(l,t)),e[t+1]||(c&&null!==m?C.push(...O({str:e,from:m,to:t,ifLeftSideIncludesThisThenCropTightly:D,ifRightSideIncludesThisThenCropTightly:J})):l&&"\n"!==e[t]&&"\r"!==e[t]?C.push(l,t+1):l&&("\r"===e[t]&&"\n"===e[t+1]||"\n"===e[t]&&"\r"!==e[t-1])&&C.push(l,t)),!o&&p&&p<t&&e[p]===e[t]&&(p=null),!o&&!c&&e.startsWith("<pre",t)&&!x(e[t+4])){const r=e.indexOf("</pre",t+5);r>0&&(o=r)}if(!o&&!c&&e.startsWith("<code",t)&&!x(e[t+5])){const r=e.indexOf("</code",t+5);r>0&&(o=r)}if(!o&&e.startsWith("<![CDATA[",t)){const r=e.indexOf("]]>",t+9);r>0&&(o=r)}o||c||p||null===A||">"!==e[t]||("<"===e[S(e,t)]&&(W=L),A=null,L=null),"<"===e[t]&&null!==W&&(W=null),c&&"{"===e[t]&&"{"===e[t+1]&&-1!==e.indexOf("}}")&&(o=e.indexOf("}}")+2)}else{if((n.removeIndentations||n.removeLineBreaks)&&t>0&&e[~-t]&&!e[~-t].trim())for(let r=t;r--;)if("\n"===e[r]||"\r"===e[r]||e[r].trim()){r+1<t&&C.push(r+1,t);break}y=null,o=!1,t+=8}if(C.current()){const t=C.current();C.wipe();const s=n.reportProgressFuncTo-.01*(n.reportProgressFuncTo-n.reportProgressFuncFrom),o=function(e,t,r){let n,s=0,o=0;if(0===arguments.length)throw new Error("ranges-apply: [THROW_ID_01] inputs missing!");if("string"!=typeof e)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&&"function"!=typeof r)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((e=>e)).length)return e;n=Array.isArray(t)&&Number.isInteger(t[0])&&Number.isInteger(t[1])?[Array.from(t)]:Array.from(t);const a=n.length;let l=0;n.filter((e=>e)).forEach(((e,t)=>{if(r&&(s=Math.floor(l/a*10),s!==o&&(o=s,r(s))),!Array.isArray(e))throw new TypeError(`ranges-apply: [THROW_ID_05] ranges array, second input arg., has ${t}th element not an array: ${JSON.stringify(e,null,4)}, which is ${typeof e}`);if(!Number.isInteger(e[0])){if(!Number.isInteger(+e[0])||+e[0]<0)throw new TypeError(`ranges-apply: [THROW_ID_06] ranges array, second input arg. has ${t}th element, array ${JSON.stringify(e,null,0)}. Its first element is not an integer, string index, but ${typeof e[0]}, equal to: ${JSON.stringify(e[0],null,4)}.`);n[t][0]=+n[t][0]}if(!Number.isInteger(e[1])){if(!Number.isInteger(+e[1])||+e[1]<0)throw new TypeError(`ranges-apply: [THROW_ID_07] ranges array, second input arg. has ${t}th element, array ${JSON.stringify(e,null,0)}. Its second element is not an integer, string index, but ${typeof e[1]}, equal to: ${JSON.stringify(e[1],null,4)}.`);n[t][1]=+n[t][1]}l+=1}));const u=i(n,{progressFn:e=>{r&&(s=10+Math.floor(e/10),s!==o&&(o=s,r(s)))}}),h=Array.isArray(u)?u.length:0;if(h>0){const t=e.slice(u[h-1][1]);e=u.reduce(((t,n,i,a)=>(r&&(s=20+Math.floor(i/h*80),s!==o&&(o=s,r(s))),t+e.slice(0===i?0:a[i-1][1],a[i][0])+(a[i][2]||""))),""),e+=t}return e}(e,t,(e=>{n.reportProgressFunc&&q>=2e3&&(V=Math.floor(s+e/100*(n.reportProgressFuncTo-s)),V!==G&&(G=V,n.reportProgressFunc(V)))})),a=o.length;return{log:{timeTakenInMilliseconds:Date.now()-r,originalLength:q,cleanedLength:a,bytesSaved:Math.max(q-a,0),percentageReducedOfOriginal:q?Math.round(100*Math.max(q-a,0)/q):0},ranges:t,applicableOpts:M,result:o}}}return{log:{timeTakenInMilliseconds:Date.now()-r,originalLength:q,cleanedLength:q,bytesSaved:0,percentageReducedOfOriginal:0},applicableOpts:M,ranges:null,result:e}},e.defaults=R,e.version="5.0.7",Object.defineProperty(e,"__esModule",{value:!0})}));
@@ -1,6 +1,8 @@
1
+ /* eslint-disable no-unused-vars */
1
2
  // Quick Take
2
3
 
3
4
  import { strict as assert } from "assert";
5
+
4
6
  import { crush, defaults, version } from "../dist/html-crush.esm.js";
5
7
 
6
8
  assert.equal(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "html-crush",
3
- "version": "5.0.7",
3
+ "version": "5.0.10",
4
4
  "description": "Minifies HTML/CSS: valid or broken, pure or mixed with other languages",
5
5
  "keywords": [
6
6
  "breaks",
@@ -43,103 +43,42 @@
43
43
  },
44
44
  "types": "types/index.d.ts",
45
45
  "scripts": {
46
- "build": "rollup -c",
47
- "build:esbuild": "node '../../scripts/esbuild.js'",
48
- "build:esbuild:dev": "cross-env MODE=dev node '../../scripts/esbuild.js'",
49
- "ci_test": "npm run build && npm run format && tap --no-only --reporter=silent",
50
- "clean_types": "../../scripts/cleanTypes.js",
51
- "dev": "rollup -c --dev",
52
- "devunittest": "npm run dev && tap --only -R 'base'",
53
- "format": "npm run lect && npm run prettier && npm run lint",
54
- "lect": "lect",
55
- "lint": "../../node_modules/eslint/bin/eslint.js . --ext .js --ext .ts --fix --config \"../../.eslintrc.json\" --quiet",
56
- "perf": "node perf/check",
57
- "prettier": "../../node_modules/prettier/bin-prettier.js '*.{js,css,scss,vue,md,ts}' --write --loglevel silent",
58
- "republish": "npm publish || :",
59
- "tap": "tap",
60
- "pretest": "npm run build",
61
- "test": "npm run test:ci && npm run perf",
62
- "test:ci": "npm run unittest && npm run test:examples && npm run format",
63
- "test:examples": "../../scripts/test-examples.js && npm run lect && npm run prettier",
64
- "tsc": "tsc",
65
- "unittest": "tap --no-only --reporter=terse && tsc -p tsconfig.json --noEmit"
46
+ "build": "node '../../ops/scripts/esbuild.js' && yarn run dts",
47
+ "dev": "DEV=true node '../../ops/scripts/esbuild.js' && yarn run dts",
48
+ "dts": "rollup -c",
49
+ "examples": "node '../../ops/scripts/run-examples.js'",
50
+ "lect": "node '../../ops/lect/lect.js'",
51
+ "letspublish": "yarn publish || :",
52
+ "lint": "eslint . --fix",
53
+ "perf": "node perf/check.js",
54
+ "prepare": "echo 'ready'",
55
+ "pretest": "yarn run lect && yarn run build",
56
+ "test": "c8 yarn run unit && yarn run examples && yarn run lint",
57
+ "unit": "uvu test"
66
58
  },
67
- "tap": {
68
- "check-coverage": false,
69
- "node-arg": [
70
- "--no-warnings",
71
- "--experimental-loader",
72
- "@istanbuljs/esm-loader-hook"
59
+ "engines": {
60
+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
61
+ },
62
+ "c8": {
63
+ "check-coverage": true,
64
+ "exclude": [
65
+ "**/test/**/*.*"
73
66
  ],
74
- "timeout": 0
67
+ "lines": 100
75
68
  },
76
69
  "lect": {
77
70
  "licence": {
78
71
  "extras": [
79
72
  ""
80
73
  ]
81
- },
82
- "req": "{ crush, defaults, version }",
83
- "various": {
84
- "devDependencies": [
85
- "@babel/polyfill",
86
- "node-fetch",
87
- "p-map"
88
- ]
89
74
  }
90
75
  },
91
76
  "dependencies": {
92
- "@babel/runtime": "^7.16.3",
93
- "ranges-apply": "^6.0.7",
94
- "ranges-push": "^6.0.7",
95
- "string-left-right": "^5.0.7",
96
- "string-match-left-right": "^8.0.7",
97
- "string-range-expander": "^3.0.7",
98
- "test-mixer": "^3.0.7"
99
- },
100
- "devDependencies": {
101
- "@babel/cli": "^7.16.0",
102
- "@babel/core": "^7.16.0",
103
- "@babel/node": "^7.16.0",
104
- "@babel/plugin-external-helpers": "^7.16.0",
105
- "@babel/plugin-proposal-class-properties": "^7.16.0",
106
- "@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.0",
107
- "@babel/plugin-proposal-object-rest-spread": "^7.16.0",
108
- "@babel/plugin-proposal-optional-chaining": "^7.16.0",
109
- "@babel/plugin-transform-runtime": "^7.16.4",
110
- "@babel/polyfill": "^7.12.1",
111
- "@babel/preset-env": "^7.16.4",
112
- "@babel/preset-typescript": "^7.16.0",
113
- "@babel/register": "^7.16.0",
114
- "@istanbuljs/esm-loader-hook": "^0.1.2",
115
- "@rollup/plugin-babel": "^5.3.0",
116
- "@rollup/plugin-commonjs": "^21.0.1",
117
- "@rollup/plugin-json": "^4.1.0",
118
- "@rollup/plugin-node-resolve": "^13.0.6",
119
- "@rollup/plugin-strip": "^2.1.0",
120
- "@rollup/plugin-typescript": "^8.3.0",
121
- "@types/node": "^16.11.10",
122
- "@types/tap": "^15.0.5",
123
- "@typescript-eslint/eslint-plugin": "^5.5.0",
124
- "@typescript-eslint/parser": "^5.5.0",
125
- "core-js": "^3.19.2",
126
- "cross-env": "^7.0.3",
127
- "eslint": "^8.3.0",
128
- "lect": "^0.18.7",
129
- "node-fetch": "^3.1.0",
130
- "p-map": "^5.3.0",
131
- "rollup": "^2.60.1",
132
- "rollup-plugin-ascii": "^0.0.3",
133
- "rollup-plugin-banner": "^0.2.1",
134
- "rollup-plugin-cleanup": "^3.2.1",
135
- "rollup-plugin-dts": "^4.0.1",
136
- "rollup-plugin-node-builtins": "^2.1.2",
137
- "rollup-plugin-terser": "^7.0.2",
138
- "tap": "^15.1.5",
139
- "tslib": "^2.3.1",
140
- "typescript": "^4.5.2"
141
- },
142
- "engines": {
143
- "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
77
+ "ranges-apply": "^6.0.10",
78
+ "ranges-push": "^6.0.10",
79
+ "string-left-right": "^5.0.10",
80
+ "string-match-left-right": "^8.0.10",
81
+ "string-range-expander": "^3.0.10",
82
+ "test-mixer": "^3.0.10"
144
83
  }
145
84
  }
package/types/index.d.ts CHANGED
@@ -2,7 +2,6 @@ declare type Range = [from: number, to: number] | [from: number, to: number, wha
2
2
  declare type Ranges = Range[] | null;
3
3
 
4
4
  declare const version: string;
5
-
6
5
  interface Opts {
7
6
  lineLengthLimit: number;
8
7
  removeIndentations: boolean;
package/examples/api.json DELETED
@@ -1 +0,0 @@
1
- {"_quickTake.js":{"title":"Quick Take","content":"import &#x7B; strict as assert &#x7D; from \"assert\";\nimport &#x7B; crush, defaults, version &#x7D; from \"html-crush\";\n\nassert.equal(\n crush(\n `<table width=\"100\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n <tr>\n <td>\n hi\n </td>\n </tr>\n</table>`,\n &#x7B; removeLineBreaks: true &#x7D;\n ).result,\n `<table width=\"100\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td> hi\n</td></tr></table>`\n);"}}