html-crush 5.0.13 → 5.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 5.0.16 (2022-04-18)
7
+
8
+ ### Bug Fixes
9
+
10
+ - tweak types ([104a64a](https://github.com/codsen/codsen/commit/104a64ab783c05af4ae8bd3eb653742eb95d0cd2))
11
+
6
12
  ## 5.0.10 (2021-12-24)
7
13
 
8
14
  ### Bug Fixes
package/README.md CHANGED
@@ -26,7 +26,7 @@
26
26
 
27
27
  ## Install
28
28
 
29
- The latest version is **ESM only**: Node 12+ is needed to use it and it must be `import`ed instead of `require`d. If your project is not on ESM yet and you want to use `require`, use an older version of this program, `4.2.0`.
29
+ This package is [pure ESM](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c). If you're not ready yet, install an older version of this program, 4.2.0 (`npm i html-crush@4.2.0`).
30
30
 
31
31
  ```bash
32
32
  npm i html-crush
@@ -1,24 +1,24 @@
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.13
4
+ * @version 5.0.16
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
- import{rApply as ne}from"ranges-apply";import{Ranges as le}from"ranges-push";import{matchLeft as oe,matchRight as F,matchRightIncl as X}from"string-match-left-right";import{expander as _}from"string-range-expander";import{left as G,right as a}from"string-left-right";var Y="5.0.13";var ge=Y,$=new le({limitToBeAddedWhitespace:!0}),te={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 N(n){return typeof n=="string"}function A(n){return typeof n=="string"&&n.toUpperCase()!==n.toLowerCase()}function ce(n,E){let W=Date.now();if(!N(n))throw n===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 n}", equal to:
11
- ${JSON.stringify(n,null,4)}`);if(E&&typeof E!="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 E}, equal to ${JSON.stringify(E,null,4)}`);if(E&&Array.isArray(E.breakToTheLeftOf)&&E.breakToTheLeftOf.length){for(let e=0,w=E.breakToTheLeftOf.length;e<w;e++)if(!N(E.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 E.breakToTheLeftOf[e]}" and is equal to:
12
- ${JSON.stringify(E.breakToTheLeftOf[e],null,4)}`)}let l={...te,...E};typeof l.removeHTMLComments=="boolean"&&(l.removeHTMLComments=l.removeHTMLComments?1:0);let H="";Array.isArray(l.breakToTheLeftOf)&&l.breakToTheLeftOf.length&&(H=[...new Set(l.breakToTheLeftOf.map(e=>e[0]))].join(""));let L={removeHTMLComments:!1,removeCSSComments:!1},p=null,i=null,S=!1,m=0,M=0,g=!1,V=!1,c=null,f=null,C=null,U=null,s,t=null,u=null,r=null,T=null,D=null,v=null,P=">};",I="<",K="!",q=">",z="<",B="{},:;<>~+",k=B,J=B,O=!0,h=n.length,Q=Math.floor(h/2),x=.01,j;l.reportProgressFunc&&(j=Math.floor(l.reportProgressFuncTo-(l.reportProgressFuncTo-l.reportProgressFuncFrom)*x-l.reportProgressFuncFrom));let d,R=0,b=`
10
+ import{rApply as ne}from"ranges-apply";import{Ranges as le}from"ranges-push";import{matchLeft as oe,matchRight as F,matchRightIncl as X}from"string-match-left-right";import{expander as _}from"string-range-expander";import{left as G,right as a}from"string-left-right";var Y="5.0.16";var ge=Y,$=new le({limitToBeAddedWhitespace:!0}),te={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 N(n){return typeof n=="string"}function A(n){return typeof n=="string"&&n.toUpperCase()!==n.toLowerCase()}function ce(n,E){let W=Date.now();if(!N(n))throw n===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 n}", equal to:
11
+ ${JSON.stringify(n,null,4)}`);if(E&&typeof E!="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 E}, equal to ${JSON.stringify(E,null,4)}`);if(E&&Array.isArray(E.breakToTheLeftOf)&&E.breakToTheLeftOf.length){for(let e=0,w=E.breakToTheLeftOf.length;e<w;e++)if(!N(E.breakToTheLeftOf[e]))throw new TypeError(`html-crush: [THROW_ID_05] the resolvedOpts.breakToTheLeftOf array contains non-string elements! For example, element at index ${e} is of a type "${typeof E.breakToTheLeftOf[e]}" and is equal to:
12
+ ${JSON.stringify(E.breakToTheLeftOf[e],null,4)}`)}let l={...te,...E};typeof l.removeHTMLComments=="boolean"&&(l.removeHTMLComments=l.removeHTMLComments?1:0);let v="";Array.isArray(l.breakToTheLeftOf)&&l.breakToTheLeftOf.length&&(v=[...new Set(l.breakToTheLeftOf.map(e=>e[0]))].join(""));let L={removeHTMLComments:!1,removeCSSComments:!1},p=null,i=null,S=!1,m=0,H=0,g=!1,O=!1,c=null,f=null,V=null,U=null,u,t=null,s=null,r=null,T=null,D=null,M=null,P=">};",I="<",K="!",q=">",z="<",B="{},:;<>~+",k=B,J=B,C=!0,h=n.length,Q=Math.floor(h/2),x=.01,j;l.reportProgressFunc&&(j=Math.floor(l.reportProgressFuncTo-(l.reportProgressFuncTo-l.reportProgressFuncFrom)*x-l.reportProgressFuncFrom));let d,R=0,b=`
13
13
  `;if(n.includes(`\r
14
14
  `)?b=`\r
15
- `:n.includes("\r")&&(b="\r"),h){for(let e=0;e<h;e++){if(l.reportProgressFunc&&(h>1e3&&h<2e3?e===Q&&l.reportProgressFunc(Math.floor((l.reportProgressFuncTo-l.reportProgressFuncFrom)/2)):h>=2e3&&(d=l.reportProgressFuncFrom+Math.floor(e/h*(j||1)),d!==R&&(R=d,l.reportProgressFunc(d)))),M++,!s&&g&&n[e]==="}"&&n[e-1]==="}"&&(m+1>=l.lineLengthLimit?($.push(e,e,b),m=0):(t=e,u=e,r=" ")),s&&typeof s=="number"&&e>=s&&(s=void 0),U!==null&&n.startsWith("<\/script",e)&&!A(n[e+8])){if((l.removeIndentations||l.removeLineBreaks)&&e>0&&n[~-e]&&!n[~-e].trim()){for(let o=e;o--;)if(n[o]===`
16
- `||n[o]==="\r"||n[o].trim()){o+1<e&&$.push(o+1,e);break}}U=null,s=!1,e+=8;continue}if(!s&&!g&&n.startsWith("<script",e)&&!A(n[e+7])){U=e,s=!0;let o="";(l.removeLineBreaks||l.removeIndentations)&&i!==null&&(i>0&&(o=b),$.push(i,e,o)),i=null,p=null}if(D!==null&&T===null&&!/\w/.test(n[e])){T=n.slice(D,e);let o=a(n,~-e);typeof o=="number"&&n[o]===">"&&!n[e].trim()&&a(n,e)?$.push(e,a(n,e)):o&&n[o]==="/"&&n[a(n,o)]===">"&&(!n[e].trim()&&a(n,e)&&$.push(e,a(n,e)),n[o+1]!==">"&&a(n,o+1)&&$.push(o+1,a(n,o+1)))}if(!s&&!g&&!c&&n[~-e]==="<"&&D===null&&(/\w/.test(n[e])?D=e:n[a(n,~-e)]==="/"&&/\w/.test(n[a(n,a(n,~-e))]||"")&&(D=a(n,a(n,~-e)))),!s&&(g||c)&&f!==null&&n[e]==="*"&&n[e+1]==="/"&&([t,u]=_({str:n,from:f,to:e+2,ifLeftSideIncludesThisThenCropTightly:k||"",ifRightSideIncludesThisThenCropTightly:J||""}),f=null,t!=null?$.push(t,u):(m+=1,e+=1),s=e+2),!s&&(g||c)&&f===null&&n[e]==="/"&&n[e+1]==="*"&&(L.removeCSSComments||(L.removeCSSComments=!0),l.removeCSSComments&&(f=e)),V&&n.startsWith("![endif",e+1)&&(V=!1),!s&&!g&&!c&&C!==null){let o;n.startsWith("-->",e)?o=3:n[e]===">"&&n[e-1]==="]"&&(o=1),o&&([t,u]=_({str:n,from:C,to:e+o}),C=null,t!=null?l.lineLengthLimit&&M-(u-t)>=l.lineLengthLimit?($.push(t,u,b),M=-o):($.push(t,u),M-=u-t):(m+=o-1,e+=o-1),s=e+o)}if(!s&&!g&&!c&&(n.startsWith("<!--",e)||l.removeHTMLComments===2&&n.startsWith("<![endif",e))&&C===null&&(n.startsWith("[if",e+4)?(V||(V=!0),l.removeHTMLComments===2&&(C=e)):l.removeHTMLComments&&(!V||l.removeHTMLComments===2)&&(C=e),L.removeHTMLComments||(L.removeHTMLComments=!0)),!s&&g&&f===null&&n.startsWith("</style",e)&&!A(n[e+7])?g=!1:!s&&!g&&f===null&&n.startsWith("<style",e)&&!A(n[e+6])&&(g=!0,(l.removeLineBreaks||l.removeIndentations)&&l.breakToTheLeftOf.includes("<style")&&n.startsWith(' type="text/css">',e+6)&&n[e+24]&&$.push(e+23,e+23,b)),!s&&!c&&`"'`.includes(n[e])&&n.endsWith("style=",e)&&(c=e),!s&&!n[e].trim())i===null&&(i=e);else if(!s&&!((g||c)&&f!==null)){if(i!==null){if(l.removeLineBreaks&&(m+=1),O)O=!1,(l.removeIndentations||l.removeLineBreaks)&&$.push(0,e);else if(l.removeIndentations&&!l.removeLineBreaks&&(!S&&p!==null&&e>p?$.push(p+1,e):i+1<e&&(n.endsWith("]>",i)||n.endsWith("-->",i)||n.startsWith("<![",e)||n.startsWith("<!--<![",e)?$.push(i,e):n[i]===" "?$.push(i+1,e):n[~-e]===" "?$.push(i,~-e):$.push(i,e," "))),l.removeLineBreaks||c){if(H.includes(n[e])&&X(n,e,l.breakToTheLeftOf)){!(`\r
15
+ `:n.includes("\r")&&(b="\r"),h){for(let e=0;e<h;e++){if(l.reportProgressFunc&&(h>1e3&&h<2e3?e===Q&&l.reportProgressFunc(Math.floor((l.reportProgressFuncTo-l.reportProgressFuncFrom)/2)):h>=2e3&&(d=l.reportProgressFuncFrom+Math.floor(e/h*(j||1)),d!==R&&(R=d,l.reportProgressFunc(d)))),H++,!u&&g&&n[e]==="}"&&n[e-1]==="}"&&(m+1>=l.lineLengthLimit?($.push(e,e,b),m=0):(t=e,s=e,r=" ")),u&&typeof u=="number"&&e>=u&&(u=void 0),U!==null&&n.startsWith("<\/script",e)&&!A(n[e+8])){if((l.removeIndentations||l.removeLineBreaks)&&e>0&&n[~-e]&&!n[~-e].trim()){for(let o=e;o--;)if(n[o]===`
16
+ `||n[o]==="\r"||n[o].trim()){o+1<e&&$.push(o+1,e);break}}U=null,u=!1,e+=8;continue}if(!u&&!g&&n.startsWith("<script",e)&&!A(n[e+7])){U=e,u=!0;let o="";(l.removeLineBreaks||l.removeIndentations)&&i!==null&&(i>0&&(o=b),$.push(i,e,o)),i=null,p=null}if(D!==null&&T===null&&!/\w/.test(n[e])){T=n.slice(D,e);let o=a(n,~-e);typeof o=="number"&&n[o]===">"&&!n[e].trim()&&a(n,e)?$.push(e,a(n,e)):o&&n[o]==="/"&&n[a(n,o)]===">"&&(!n[e].trim()&&a(n,e)&&$.push(e,a(n,e)),n[o+1]!==">"&&a(n,o+1)&&$.push(o+1,a(n,o+1)))}if(!u&&!g&&!c&&n[~-e]==="<"&&D===null&&(/\w/.test(n[e])?D=e:n[a(n,~-e)]==="/"&&/\w/.test(n[a(n,a(n,~-e))]||"")&&(D=a(n,a(n,~-e)))),!u&&(g||c)&&f!==null&&n[e]==="*"&&n[e+1]==="/"&&([t,s]=_({str:n,from:f,to:e+2,ifLeftSideIncludesThisThenCropTightly:k||"",ifRightSideIncludesThisThenCropTightly:J||""}),f=null,t!=null?$.push(t,s):(m+=1,e+=1),u=e+2),!u&&(g||c)&&f===null&&n[e]==="/"&&n[e+1]==="*"&&(L.removeCSSComments||(L.removeCSSComments=!0),l.removeCSSComments&&(f=e)),O&&n.startsWith("![endif",e+1)&&(O=!1),!u&&!g&&!c&&V!==null){let o;n.startsWith("-->",e)?o=3:n[e]===">"&&n[e-1]==="]"&&(o=1),o&&([t,s]=_({str:n,from:V,to:e+o}),V=null,t!=null?l.lineLengthLimit&&H-(s-t)>=l.lineLengthLimit?($.push(t,s,b),H=-o):($.push(t,s),H-=s-t):(m+=o-1,e+=o-1),u=e+o)}if(!u&&!g&&!c&&(n.startsWith("<!--",e)||l.removeHTMLComments===2&&n.startsWith("<![endif",e))&&V===null&&(n.startsWith("[if",e+4)?(O||(O=!0),l.removeHTMLComments===2&&(V=e)):l.removeHTMLComments&&(!O||l.removeHTMLComments===2)&&(V=e),L.removeHTMLComments||(L.removeHTMLComments=!0)),!u&&g&&f===null&&n.startsWith("</style",e)&&!A(n[e+7])?g=!1:!u&&!g&&f===null&&n.startsWith("<style",e)&&!A(n[e+6])&&(g=!0,(l.removeLineBreaks||l.removeIndentations)&&l.breakToTheLeftOf.includes("<style")&&n.startsWith(' type="text/css">',e+6)&&n[e+24]&&$.push(e+23,e+23,b)),!u&&!c&&`"'`.includes(n[e])&&n.endsWith("style=",e)&&(c=e),!u&&!n[e].trim())i===null&&(i=e);else if(!u&&!((g||c)&&f!==null)){if(i!==null){if(l.removeLineBreaks&&(m+=1),C)C=!1,(l.removeIndentations||l.removeLineBreaks)&&$.push(0,e);else if(l.removeIndentations&&!l.removeLineBreaks&&(!S&&p!==null&&e>p?$.push(p+1,e):i+1<e&&(n.endsWith("]>",i)||n.endsWith("-->",i)||n.startsWith("<![",e)||n.startsWith("<!--<![",e)?$.push(i,e):n[i]===" "?$.push(i+1,e):n[~-e]===" "?$.push(i,~-e):$.push(i,e," "))),l.removeLineBreaks||c){if(v.includes(n[e])&&X(n,e,l.breakToTheLeftOf)){!(`\r
17
17
  `.includes(n[~-e])&&i===~-e)&&!(n[~-e]===`
18
- `&&n[e-2]==="\r"&&i===e-2)&&$.push(i,e,b),t=null,u=null,r=null,i=null,m=1;continue}let o=" ";n[e]==="<"&&F(n,e,l.mindTheInlineTags,{cb:y=>!y||!/\w/.test(y)})||(n[~-i]&&q.includes(n[~-i])&&z.includes(n[e])||(g||c)&&f===null&&(k.includes(n[~-i])||J.includes(n[e]))||n.startsWith("!important",e)&&!V||c&&(n[~-i]==="'"||n[~-i]==='"')||n[~-i]==="}"&&n.startsWith("</style",e)||n[e]===">"&&(`'"`.includes(n[G(n,e)])||n[a(n,e)]==="<")||n[e]==="/"&&n[a(n,e)]===">")&&(o="",n[e]==="/"&&n[e+1]===">"&&a(n,e)&&a(n,e)>e+1&&($.push(e+1,a(n,e)),m-=a(n,e)-e+1)),g&&n[e]==="}"&&i&&n[i-1]==="}"&&(o=" "),o?.length&&(m+=1),l.lineLengthLimit?m>=l.lineLengthLimit||!n[e+1]||n[e]===">"||n[e]==="/"&&n[e+1]===">"?((m>l.lineLengthLimit||m===l.lineLengthLimit&&n[e+1]&&n[e+1].trim()&&!P.includes(n[e])&&!I.includes(n[e+1]))&&(o=b,m=1),(m>l.lineLengthLimit||!(o===" "&&e===i+1))&&($.push(i,e,o),p=null),t=null,u=null,r=null):(t===null||i<t)&&(t=i,u=e,r=o):e===i+1&&o===" "||$.push(i,e,o)}i=null,S||(S=!0)}else O&&(O=!1),l.removeLineBreaks&&(m+=1);S||(S=!0)}if(!s&&!O&&e!==0&&l.removeLineBreaks&&(l.lineLengthLimit||H)&&!n.startsWith("</a",e)){if(H&&X(n,e,l.breakToTheLeftOf)&&n.slice(0,e).trim()&&(!n.startsWith("<![endif]",e)||!oe(n,e,"<!--"))){$.push(e,e,b),t=null,u=null,r=null,m=1;continue}else if(l.lineLengthLimit&&m<=l.lineLengthLimit){if(!n[e+1]||I.includes(n[e])&&!K.includes(n[e])||P.includes(n[e])||!n[e].trim()){if(t!==null&&u!==null&&(t!==u||r?.length)){let o=r;n[e].trim()&&n[e+1]&&n[e+1].trim()&&m+(r?r.length:0)>l.lineLengthLimit&&(o=b),(m+(o?o.length:0)>l.lineLengthLimit||!(o===" "&&u===t+1&&n[t]===" "))&&(n[~-t]==="}"&&n[u]==="{"||($.push(t,u,o),p=null))}n[e].trim()&&(I.includes(n[e])||n[~-e]&&P.includes(n[~-e]))&&N(v)&&(!T||!l.mindTheInlineTags.includes(T))&&!(n[e]==="<"&&F(n,e,l.mindTheInlineTags,{cb:o=>!o||!/\w/.test(o)}))&&!(n[e]==="<"&&F(n,e,l.mindTheInlineTags,{trimCharsBeforeMatching:"/",cb:o=>!o||!/\w/.test(o)}))?(t=e,u=e,r=null):f===null&&t!==null&&(c||!l.mindTheInlineTags||!Array.isArray(l.mindTheInlineTags)||Array.isArray(l.mindTheInlineTags.length)&&!l.mindTheInlineTags.length||!N(T)||Array.isArray(l.mindTheInlineTags)&&l.mindTheInlineTags.length&&N(T)&&!l.mindTheInlineTags.includes(T))&&!(n[e]==="<"&&F(n,e,l.mindTheInlineTags,{trimCharsBeforeMatching:"/",cb:o=>!o||!/\w/.test(o)}))&&(t=null,u=null,r=null)}}else if(l.lineLengthLimit)if(I.includes(n[e])&&!(n[e]==="<"&&F(n,e,l.mindTheInlineTags,{trimCharsBeforeMatching:"/",cb:o=>!o||!/\w/.test(o)})))if(t!==null&&u!==null&&(t!==u||r?.length)){let o=r?.length?r.length:0;m-(u-t-o)-1>l.lineLengthLimit||($.push(t,u,r),m-(u-t-o)-1===l.lineLengthLimit&&($.push(e,e,b),m=0),t=null,u=null,r=null)}else $.push(e,e,b),m=0;else n[e+1]&&P.includes(n[e])&&N(T)&&Array.isArray(l.mindTheInlineTags)&&l.mindTheInlineTags.length&&!l.mindTheInlineTags.includes(T)?t!==null&&u!==null&&(t!==u||r?.length)||($.push(e+1,e+1,b),m=0):n[e].trim()&&(n[e+1]||t!==null&&u!==null&&(t!==u||r?.length)&&$.push(t,u,b))}if(!s&&!O&&l.removeLineBreaks&&l.lineLengthLimit&&m>=l.lineLengthLimit&&t!==null&&u!==null&&!P.includes(n[e])&&!I.includes(n[e])&&!"/".includes(n[e])&&!(m===l.lineLengthLimit&&n[e+1]&&!n[e+1].trim())){let o=b;n[e+1]&&!n[e+1].trim()&&m===l.lineLengthLimit&&(o=r),o===b&&!n[~-t].trim()&&G(n,t)&&(t=G(n,t)+1),$.push(t,u,o),m=e-u,n[e].length&&(m+=1),t=null,u=null,r=null}if((!s&&n[e]===`
18
+ `&&n[e-2]==="\r"&&i===e-2)&&$.push(i,e,b),t=null,s=null,r=null,i=null,m=1;continue}let o=" ";n[e]==="<"&&F(n,e,l.mindTheInlineTags,{cb:y=>!y||!/\w/.test(y)})||(n[~-i]&&q.includes(n[~-i])&&z.includes(n[e])||(g||c)&&f===null&&(k.includes(n[~-i])||J.includes(n[e]))||n.startsWith("!important",e)&&!O||c&&(n[~-i]==="'"||n[~-i]==='"')||n[~-i]==="}"&&n.startsWith("</style",e)||n[e]===">"&&(`'"`.includes(n[G(n,e)])||n[a(n,e)]==="<")||n[e]==="/"&&n[a(n,e)]===">")&&(o="",n[e]==="/"&&n[e+1]===">"&&a(n,e)&&a(n,e)>e+1&&($.push(e+1,a(n,e)),m-=a(n,e)-e+1)),g&&n[e]==="}"&&i&&n[i-1]==="}"&&(o=" "),o?.length&&(m+=1),l.lineLengthLimit?m>=l.lineLengthLimit||!n[e+1]||n[e]===">"||n[e]==="/"&&n[e+1]===">"?((m>l.lineLengthLimit||m===l.lineLengthLimit&&n[e+1]&&n[e+1].trim()&&!P.includes(n[e])&&!I.includes(n[e+1]))&&(o=b,m=1),(m>l.lineLengthLimit||!(o===" "&&e===i+1))&&($.push(i,e,o),p=null),t=null,s=null,r=null):(t===null||i<t)&&(t=i,s=e,r=o):e===i+1&&o===" "||$.push(i,e,o)}i=null,S||(S=!0)}else C&&(C=!1),l.removeLineBreaks&&(m+=1);S||(S=!0)}if(!u&&!C&&e!==0&&l.removeLineBreaks&&(l.lineLengthLimit||v)&&!n.startsWith("</a",e)){if(v&&X(n,e,l.breakToTheLeftOf)&&n.slice(0,e).trim()&&(!n.startsWith("<![endif]",e)||!oe(n,e,"<!--"))){$.push(e,e,b),t=null,s=null,r=null,m=1;continue}else if(l.lineLengthLimit&&m<=l.lineLengthLimit){if(!n[e+1]||I.includes(n[e])&&!K.includes(n[e])||P.includes(n[e])||!n[e].trim()){if(t!==null&&s!==null&&(t!==s||r?.length)){let o=r;n[e].trim()&&n[e+1]&&n[e+1].trim()&&m+(r?r.length:0)>l.lineLengthLimit&&(o=b),(m+(o?o.length:0)>l.lineLengthLimit||!(o===" "&&s===t+1&&n[t]===" "))&&(n[~-t]==="}"&&n[s]==="{"||($.push(t,s,o),p=null))}n[e].trim()&&(I.includes(n[e])||n[~-e]&&P.includes(n[~-e]))&&N(M)&&(!T||!l.mindTheInlineTags.includes(T))&&!(n[e]==="<"&&F(n,e,l.mindTheInlineTags,{cb:o=>!o||!/\w/.test(o)}))&&!(n[e]==="<"&&F(n,e,l.mindTheInlineTags,{trimCharsBeforeMatching:"/",cb:o=>!o||!/\w/.test(o)}))?(t=e,s=e,r=null):f===null&&t!==null&&(c||!l.mindTheInlineTags||!Array.isArray(l.mindTheInlineTags)||Array.isArray(l.mindTheInlineTags.length)&&!l.mindTheInlineTags.length||!N(T)||Array.isArray(l.mindTheInlineTags)&&l.mindTheInlineTags.length&&N(T)&&!l.mindTheInlineTags.includes(T))&&!(n[e]==="<"&&F(n,e,l.mindTheInlineTags,{trimCharsBeforeMatching:"/",cb:o=>!o||!/\w/.test(o)}))&&(t=null,s=null,r=null)}}else if(l.lineLengthLimit)if(I.includes(n[e])&&!(n[e]==="<"&&F(n,e,l.mindTheInlineTags,{trimCharsBeforeMatching:"/",cb:o=>!o||!/\w/.test(o)})))if(t!==null&&s!==null&&(t!==s||r?.length)){let o=r?.length?r.length:0;m-(s-t-o)-1>l.lineLengthLimit||($.push(t,s,r),m-(s-t-o)-1===l.lineLengthLimit&&($.push(e,e,b),m=0),t=null,s=null,r=null)}else $.push(e,e,b),m=0;else n[e+1]&&P.includes(n[e])&&N(T)&&Array.isArray(l.mindTheInlineTags)&&l.mindTheInlineTags.length&&!l.mindTheInlineTags.includes(T)?t!==null&&s!==null&&(t!==s||r?.length)||($.push(e+1,e+1,b),m=0):n[e].trim()&&(n[e+1]||t!==null&&s!==null&&(t!==s||r?.length)&&$.push(t,s,b))}if(!u&&!C&&l.removeLineBreaks&&l.lineLengthLimit&&m>=l.lineLengthLimit&&t!==null&&s!==null&&!P.includes(n[e])&&!I.includes(n[e])&&!"/".includes(n[e])&&!(m===l.lineLengthLimit&&n[e+1]&&!n[e+1].trim())){let o=b;n[e+1]&&!n[e+1].trim()&&m===l.lineLengthLimit&&(o=r),o===b&&!n[~-t].trim()&&G(n,t)&&(t=G(n,t)+1),$.push(t,s,o),m=e-s,n[e].length&&(m+=1),t=null,s=null,r=null}if((!u&&n[e]===`
19
19
  `||n[e]==="\r"&&(!n[e+1]||n[e+1]&&n[e+1]!==`
20
20
  `))&&(p=e,S&&(S=!1),!l.removeLineBreaks&&i!==null&&i<e&&n[e+1]&&n[e+1]!=="\r"&&n[e+1]!==`
21
21
  `&&$.push(i,e)),n[e+1]||(g&&f!==null?$.push(..._({str:n,from:f,to:e,ifLeftSideIncludesThisThenCropTightly:k||"",ifRightSideIncludesThisThenCropTightly:J||""})):i&&n[e]!==`
22
22
  `&&n[e]!=="\r"?$.push(i,e+1):i&&(n[e]==="\r"&&n[e+1]===`
23
23
  `||n[e]===`
24
- `&&n[e-1]!=="\r")&&$.push(i,e)),!s&&c&&c<e&&n[c]===n[e]&&(c=null),!s&&!g&&n.startsWith("<pre",e)&&!A(n[e+4])){let o=n.indexOf("</pre",e+5);o>0&&(s=o)}if(!s&&!g&&n.startsWith("<code",e)&&!A(n[e+5])){let o=n.indexOf("</code",e+5);o>0&&(s=o)}if(!s&&n.startsWith("<![CDATA[",e)){let o=n.indexOf("]]>",e+9);o>0&&(s=o)}!s&&!g&&!c&&D!==null&&n[e]===">"&&(n[a(n,e)]==="<"&&(v=T),D=null,T=null),n[e]==="<"&&v!==null&&(v=null),g&&n[e]==="{"&&n[e+1]==="{"&&n.indexOf("}}")!==-1&&(s=n.indexOf("}}")+2);let w=!0}if($.current()){let e=$.current();$.wipe();let w=l.reportProgressFuncTo-(l.reportProgressFuncTo-l.reportProgressFuncFrom)*x,o=ne(n,e,Z=>{l.reportProgressFunc&&h>=2e3&&(d=Math.floor(w+(l.reportProgressFuncTo-w)*(Z/100)),d!==R&&(R=d,l.reportProgressFunc(d)))}),y=o.length;return{log:{timeTakenInMilliseconds:Date.now()-W,originalLength:h,cleanedLength:y,bytesSaved:Math.max(h-y,0),percentageReducedOfOriginal:h?Math.round(Math.max(h-y,0)*100/h):0},ranges:e,applicableOpts:L,result:o}}}return{log:{timeTakenInMilliseconds:Date.now()-W,originalLength:h,cleanedLength:h,bytesSaved:0,percentageReducedOfOriginal:0},applicableOpts:L,ranges:null,result:n}}export{ce as crush,te as defaults,ge as version};
24
+ `&&n[e-1]!=="\r")&&$.push(i,e)),!u&&c&&c<e&&n[c]===n[e]&&(c=null),!u&&!g&&n.startsWith("<pre",e)&&!A(n[e+4])){let o=n.indexOf("</pre",e+5);o>0&&(u=o)}if(!u&&!g&&n.startsWith("<code",e)&&!A(n[e+5])){let o=n.indexOf("</code",e+5);o>0&&(u=o)}if(!u&&n.startsWith("<![CDATA[",e)){let o=n.indexOf("]]>",e+9);o>0&&(u=o)}!u&&!g&&!c&&D!==null&&n[e]===">"&&(n[a(n,e)]==="<"&&(M=T),D=null,T=null),n[e]==="<"&&M!==null&&(M=null),g&&n[e]==="{"&&n[e+1]==="{"&&n.indexOf("}}")!==-1&&(u=n.indexOf("}}")+2);let w=!0}if($.current()){let e=$.current();$.wipe();let w=l.reportProgressFuncTo-(l.reportProgressFuncTo-l.reportProgressFuncFrom)*x,o=ne(n,e,Z=>{l.reportProgressFunc&&h>=2e3&&(d=Math.floor(w+(l.reportProgressFuncTo-w)*(Z/100)),d!==R&&(R=d,l.reportProgressFunc(d)))}),y=o.length;return{log:{timeTakenInMilliseconds:Date.now()-W,originalLength:h,cleanedLength:y,bytesSaved:Math.max(h-y,0),percentageReducedOfOriginal:h?Math.round(Math.max(h-y,0)*100/h):0},ranges:e,applicableOpts:L,result:o}}}return{log:{timeTakenInMilliseconds:Date.now()-W,originalLength:h,cleanedLength:h,bytesSaved:0,percentageReducedOfOriginal:0},applicableOpts:L,ranges:null,result:n}}export{ce as crush,te as defaults,ge as version};
@@ -1,48 +1,48 @@
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.13
4
+ * @version 5.0.16
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
- var htmlCrush=(()=>{var on=Object.create;var ee=Object.defineProperty;var sn=Object.getOwnPropertyDescriptor;var ln=Object.getOwnPropertyNames,ke=Object.getOwnPropertySymbols,an=Object.getPrototypeOf,Be=Object.prototype.hasOwnProperty,un=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))un.call(t,r)&&ye(e,r,t[r]);return e};var Ue=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),gn=(e,t)=>{for(var r in t)ee(e,r,{get:t[r],enumerable:!0})},Ge=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of ln(t))!Be.call(e,a)&&a!==r&&ee(e,a,{get:()=>t[a],enumerable:!(n=sn(t,a))||n.enumerable});return e};var qe=(e,t,r)=>(r=e!=null?on(an(e)):{},Ge(t||!e||!e.__esModule?ee(r,"default",{value:e,enumerable:!0}):r,e)),cn=e=>Ge(ee({},"__esModule",{value:!0}),e);var Ee=(e,t,r)=>(ye(e,typeof t!="symbol"?t+"":t,r),r);var at=Ue((Ai,lt)=>{var yn="[object Object]";function En(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(r){}return t}function Sn(e,t){return function(r){return e(t(r))}}var wn=Function.prototype,ot=Object.prototype,st=wn.toString,On=ot.hasOwnProperty,Ln=st.call(Object),Dn=ot.toString,An=Sn(Object.getPrototypeOf,Object);function Cn(e){return!!e&&typeof e=="object"}function In(e){if(!Cn(e)||Dn.call(e)!=yn||En(e))return!1;var t=An(e);if(t===null)return!0;var r=On.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&st.call(r)==Ln}lt.exports=In});var Xt=Ue((ne,B)=>{var _n=200,yt="__lodash_hash_undefined__",Et=9007199254740991,Ve="[object Arguments]",Nn="[object Array]",St="[object Boolean]",wt="[object Date]",vn="[object Error]",Re="[object Function]",Ot="[object GeneratorFunction]",ue="[object Map]",Lt="[object Number]",Me="[object Object]",ut="[object Promise]",Dt="[object RegExp]",ge="[object Set]",At="[object String]",Ct="[object Symbol]",Ae="[object WeakMap]",It="[object ArrayBuffer]",ce="[object DataView]",_t="[object Float32Array]",Nt="[object Float64Array]",vt="[object Int8Array]",Vt="[object Int16Array]",Rt="[object Int32Array]",Mt="[object Uint8Array]",Pt="[object Uint8ClampedArray]",Ht="[object Uint16Array]",Ft="[object Uint32Array]",Vn=/[\\^$.*+?()[\]{}|]/g,Rn=/\w*$/,Mn=/^\[object .+?Constructor\]$/,Pn=/^(?:0|[1-9]\d*)$/,w={};w[Ve]=w[Nn]=w[It]=w[ce]=w[St]=w[wt]=w[_t]=w[Nt]=w[vt]=w[Vt]=w[Rt]=w[ue]=w[Lt]=w[Me]=w[Dt]=w[ge]=w[At]=w[Ct]=w[Mt]=w[Pt]=w[Ht]=w[Ft]=!0;w[vn]=w[Re]=w[Ae]=!1;var Hn=typeof global=="object"&&global&&global.Object===Object&&global,Fn=typeof self=="object"&&self&&self.Object===Object&&self,N=Hn||Fn||Function("return this")(),xt=typeof ne=="object"&&ne&&!ne.nodeType&&ne,gt=xt&&typeof B=="object"&&B&&!B.nodeType&&B,xn=gt&&gt.exports===xt;function Wn(e,t){return e.set(t[0],t[1]),e}function jn(e,t){return e.add(t),e}function Jn(e,t){for(var r=-1,n=e?e.length:0;++r<n&&t(e[r],r,e)!==!1;);return e}function kn(e,t){for(var r=-1,n=t.length,a=e.length;++r<n;)e[a+r]=t[r];return e}function Wt(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 Bn(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function Un(e,t){return e==null?void 0:e[t]}function jt(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(r){}return t}function ct(e){var t=-1,r=Array(e.size);return e.forEach(function(n,a){r[++t]=[a,n]}),r}function Pe(e,t){return function(r){return e(t(r))}}function ft(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var Gn=Array.prototype,qn=Function.prototype,fe=Object.prototype,De=N["__core-js_shared__"],mt=function(){var e=/[^.]+$/.exec(De&&De.keys&&De.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Jt=qn.toString,H=fe.hasOwnProperty,me=fe.toString,Kn=RegExp("^"+Jt.call(H).replace(Vn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ht=xn?N.Buffer:void 0,$t=N.Symbol,pt=N.Uint8Array,Yn=Pe(Object.getPrototypeOf,Object),Xn=Object.create,zn=fe.propertyIsEnumerable,Zn=Gn.splice,bt=Object.getOwnPropertySymbols,Qn=ht?ht.isBuffer:void 0,er=Pe(Object.keys,Object),Ce=q(N,"DataView"),re=q(N,"Map"),Ie=q(N,"Promise"),_e=q(N,"Set"),Ne=q(N,"WeakMap"),ie=q(Object,"create"),tr=W(Ce),nr=W(re),rr=W(Ie),ir=W(_e),or=W(Ne),dt=$t?$t.prototype:void 0,Tt=dt?dt.valueOf:void 0;function x(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__=ie?ie(null):{}}function lr(e){return this.has(e)&&delete this.__data__[e]}function ar(e){var t=this.__data__;if(ie){var r=t[e];return r===yt?void 0:r}return H.call(t,e)?t[e]:void 0}function ur(e){var t=this.__data__;return ie?t[e]!==void 0:H.call(t,e)}function gr(e,t){var r=this.__data__;return r[e]=ie&&t===void 0?yt:t,this}x.prototype.clear=sr;x.prototype.delete=lr;x.prototype.get=ar;x.prototype.has=ur;x.prototype.set=gr;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 cr(){this.__data__=[]}function fr(e){var t=this.__data__,r=he(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():Zn.call(t,r,1),!0}function mr(e){var t=this.__data__,r=he(t,e);return r<0?void 0:t[r][1]}function hr(e){return he(this.__data__,e)>-1}function $r(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=cr;v.prototype.delete=fr;v.prototype.get=mr;v.prototype.has=hr;v.prototype.set=$r;function U(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 pr(){this.__data__={hash:new x,map:new(re||v),string:new x}}function br(e){return $e(this,e).delete(e)}function dr(e){return $e(this,e).get(e)}function Tr(e){return $e(this,e).has(e)}function yr(e,t){return $e(this,e).set(e,t),this}U.prototype.clear=pr;U.prototype.delete=br;U.prototype.get=dr;U.prototype.has=Tr;U.prototype.set=yr;function G(e){this.__data__=new v(e)}function Er(){this.__data__=new v}function Sr(e){return this.__data__.delete(e)}function wr(e){return this.__data__.get(e)}function Or(e){return this.__data__.has(e)}function Lr(e,t){var r=this.__data__;if(r instanceof v){var n=r.__data__;if(!re||n.length<_n-1)return n.push([e,t]),this;r=this.__data__=new U(n)}return r.set(e,t),this}G.prototype.clear=Er;G.prototype.delete=Sr;G.prototype.get=wr;G.prototype.has=Or;G.prototype.set=Lr;function Dr(e,t){var r=Fe(e)||Xr(e)?Bn(e.length,String):[],n=r.length,a=!!n;for(var o in e)(t||H.call(e,o))&&!(a&&(o=="length"||Gr(o,n)))&&r.push(o);return r}function kt(e,t,r){var n=e[t];(!(H.call(e,t)&&qt(n,r))||r===void 0&&!(t in e))&&(e[t]=r)}function he(e,t){for(var r=e.length;r--;)if(qt(e[r][0],t))return r;return-1}function Ar(e,t){return e&&Bt(t,xe(t),e)}function ve(e,t,r,n,a,o,u){var l;if(n&&(l=o?n(e,a,o,u):n(e)),l!==void 0)return l;if(!pe(e))return e;var c=Fe(e);if(c){if(l=kr(e),!t)return Wr(e,l)}else{var s=F(e),$=s==Re||s==Ot;if(Zr(e))return Vr(e,t);if(s==Me||s==Ve||$&&!o){if(jt(e))return o?e:{};if(l=Br($?{}:e),!t)return jr(e,Ar(l,e))}else{if(!w[s])return o?e:{};l=Ur(e,s,ve,t)}}u||(u=new G);var h=u.get(e);if(h)return h;if(u.set(e,l),!c)var T=r?Jr(e):xe(e);return Jn(T||e,function(m,f){T&&(f=m,m=e[f]),kt(l,f,ve(m,t,r,n,f,e,u))}),l}function Cr(e){return pe(e)?Xn(e):{}}function Ir(e,t,r){var n=t(e);return Fe(e)?n:kn(n,r(e))}function _r(e){return me.call(e)}function Nr(e){if(!pe(e)||Kr(e))return!1;var t=Yt(e)||jt(e)?Kn:Mn;return t.test(W(e))}function vr(e){if(!Gt(e))return er(e);var t=[];for(var r in Object(e))H.call(e,r)&&r!="constructor"&&t.push(r);return t}function Vr(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 pt(t).set(new pt(e)),t}function Rr(e,t){var r=t?He(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}function Mr(e,t,r){var n=t?r(ct(e),!0):ct(e);return Wt(n,Wn,new e.constructor)}function Pr(e){var t=new e.constructor(e.source,Rn.exec(e));return t.lastIndex=e.lastIndex,t}function Hr(e,t,r){var n=t?r(ft(e),!0):ft(e);return Wt(n,jn,new e.constructor)}function Fr(e){return Tt?Object(Tt.call(e)):{}}function xr(e,t){var r=t?He(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Wr(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}function Bt(e,t,r,n){r||(r={});for(var a=-1,o=t.length;++a<o;){var u=t[a],l=n?n(r[u],e[u],u,r,e):void 0;kt(r,u,l===void 0?e[u]:l)}return r}function jr(e,t){return Bt(e,Ut(e),t)}function Jr(e){return Ir(e,xe,Ut)}function $e(e,t){var r=e.__data__;return qr(t)?r[typeof t=="string"?"string":"hash"]:r.map}function q(e,t){var r=Un(e,t);return Nr(r)?r:void 0}var Ut=bt?Pe(bt,Object):ti,F=_r;(Ce&&F(new Ce(new ArrayBuffer(1)))!=ce||re&&F(new re)!=ue||Ie&&F(Ie.resolve())!=ut||_e&&F(new _e)!=ge||Ne&&F(new Ne)!=Ae)&&(F=function(e){var t=me.call(e),r=t==Me?e.constructor:void 0,n=r?W(r):void 0;if(n)switch(n){case tr:return ce;case nr:return ue;case rr:return ut;case ir:return ge;case or:return Ae}return t});function kr(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 Br(e){return typeof e.constructor=="function"&&!Gt(e)?Cr(Yn(e)):{}}function Ur(e,t,r,n){var a=e.constructor;switch(t){case It:return He(e);case St:case wt:return new a(+e);case ce:return Rr(e,n);case _t:case Nt:case vt:case Vt:case Rt:case Mt:case Pt:case Ht:case Ft:return xr(e,n);case ue:return Mr(e,n,r);case Lt:case At:return new a(e);case Dt:return Pr(e);case ge:return Hr(e,n,r);case Ct:return Fr(e)}}function Gr(e,t){return t=t==null?Et:t,!!t&&(typeof e=="number"||Pn.test(e))&&e>-1&&e%1==0&&e<t}function qr(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Kr(e){return!!mt&&mt in e}function Gt(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||fe;return e===r}function W(e){if(e!=null){try{return Jt.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function Yr(e){return ve(e,!0,!0)}function qt(e,t){return e===t||e!==e&&t!==t}function Xr(e){return zr(e)&&H.call(e,"callee")&&(!zn.call(e,"callee")||me.call(e)==Ve)}var Fe=Array.isArray;function Kt(e){return e!=null&&Qr(e.length)&&!Yt(e)}function zr(e){return ei(e)&&Kt(e)}var Zr=Qn||ni;function Yt(e){var t=pe(e)?me.call(e):"";return t==Re||t==Ot}function Qr(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Et}function pe(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function ei(e){return!!e&&typeof e=="object"}function xe(e){return Kt(e)?Dr(e):vr(e)}function ti(){return[]}function ni(){return!1}B.exports=Yr});var gi={};gn(gi,{crush:()=>ui,defaults:()=>Zt,version:()=>ai});var fn={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function Se(e,t){if(!Array.isArray(e)||!e.length)return e;let r=S(S({},fn),t),n,a;if(r.strictlyTwoElementsInRangeArrays&&!e.every((l,c)=>!Array.isArray(l)||l.length!==2?(n=c,a=l.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((l,c)=>!Array.isArray(l)||!Number.isInteger(l[0])||l[0]<0||!Number.isInteger(l[1])||l[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((l,c)=>(r.progressFn&&(u+=1,r.progressFn(Math.floor(u*100/o))),l[0]===c[0]?l[1]<c[1]?-1:l[1]>c[1]?1:0:l[0]<c[0]?-1:1))}var Ke={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function Ye(e,t){function r(s){return s&&typeof s=="object"&&!Array.isArray(s)}if(!Array.isArray(e)||!e.length)return null;let n;if(t)if(r(t)){if(n=S(S({},Ke),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({},Ke);let a=e.filter(s=>Array.isArray(s)).map(s=>[...s]).filter(s=>s[2]!==void 0||s[0]!==s[1]),o,u,l;n.progressFn?o=Se(a,{progressFn:s=>{l=Math.floor(s/5),l!==u&&(u=l,n.progressFn(l))}}):o=Se(a);let c=o.length-1;for(let s=c;s>0;s--)n.progressFn&&(l=Math.floor((1-s/c)*78)+21,l!==u&&l>u&&(u=l,n.progressFn(l))),(o[s][0]<=o[s-1][0]||!n.joinRangesThatTouchEdges&&o[s][0]<o[s-1][1]||n.joinRangesThatTouchEdges&&o[s][0]<=o[s-1][1])&&(o[s-1][0]=Math.min(o[s][0],o[s-1][0]),o[s-1][1]=Math.max(o[s][1],o[s-1][1]),o[s][2]!==void 0&&(o[s-1][0]>=o[s][0]||o[s-1][1]<=o[s][1])&&o[s-1][2]!==null&&(o[s][2]===null&&o[s-1][2]!==null?o[s-1][2]=null:o[s-1][2]!=null?+n.mergeType==2&&o[s-1][0]===o[s][0]?o[s-1][2]=o[s][2]:o[s-1][2]+=o[s][2]:o[s-1][2]=o[s][2]),o.splice(s,1),s=o.length);return o.length?o:null}var mn=!0,we="Invariant failed";function Xe(e,t){if(!e){if(mn)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,l=0;o.filter($=>$).forEach(($,h)=>{if(r&&(n=Math.floor(l/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]}l+=1});let c=Ye(o,{progressFn:$=>{r&&(n=10+Math.floor($/10),n!==a&&(a=n,r(n)))}});Xe(c);let s=c.length;if(s>0){let $=e.slice(c[s-1][1]);e=c.reduce((h,T,m,f)=>{r&&(n=20+Math.floor(m/s*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 se(e,t=1){let r="\xA0";function n(o){return Array.from(o).reverse().join("")}function a(o,u,l){let c=l?`
12
- `:"\r",s=l?"\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]===s&&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]===s&&(T+=o[m+1],m++)):o[m]===s&&(!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="",l="";if(!e.trim())u=e;else if(!e[0].trim()){for(let c=0,s=e.length;c<s;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()){l=e.slice(c+1);break}}return`${a(u,o,!1)}${e.trim()}${n(a(n(l),o,!0))}`}return e}var hn={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function Ze(e,t){if(!Array.isArray(e)||!e.length)return e;let r=S(S({},hn),t),n,a;if(r.strictlyTwoElementsInRangeArrays&&!e.every((l,c)=>!Array.isArray(l)||l.length!==2?(n=c,a=l.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((l,c)=>!Array.isArray(l)||!Number.isInteger(l[0])||l[0]<0||!Number.isInteger(l[1])||l[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((l,c)=>(r.progressFn&&(u+=1,r.progressFn(Math.floor(u*100/o))),l[0]===c[0]?l[1]<c[1]?-1:l[1]>c[1]?1:0:l[0]<c[0]?-1:1))}var Qe={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function $n(e,t){function r(s){return s&&typeof s=="object"&&!Array.isArray(s)}if(!Array.isArray(e)||!e.length)return null;let n;if(t)if(r(t)){if(n=S(S({},Qe),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({},Qe);let a=e.filter(s=>Array.isArray(s)).map(s=>[...s]).filter(s=>s[2]!==void 0||s[0]!==s[1]),o,u,l;n.progressFn?o=Ze(a,{progressFn:s=>{l=Math.floor(s/5),l!==u&&(u=l,n.progressFn(l))}}):o=Ze(a);let c=o.length-1;for(let s=c;s>0;s--)n.progressFn&&(l=Math.floor((1-s/c)*78)+21,l!==u&&l>u&&(u=l,n.progressFn(l))),(o[s][0]<=o[s-1][0]||!n.joinRangesThatTouchEdges&&o[s][0]<o[s-1][1]||n.joinRangesThatTouchEdges&&o[s][0]<=o[s-1][1])&&(o[s-1][0]=Math.min(o[s][0],o[s-1][0]),o[s-1][1]=Math.max(o[s][1],o[s-1][1]),o[s][2]!==void 0&&(o[s-1][0]>=o[s][0]||o[s-1][1]<=o[s][1])&&o[s-1][2]!==null&&(o[s][2]===null&&o[s-1][2]!==null?o[s-1][2]=null:o[s-1][2]!=null?+n.mergeType==2&&o[s-1][0]===o[s][0]?o[s-1][2]=o[s][2]:o[s-1][2]+=o[s][2]:o[s-1][2]=o[s][2]),o.splice(s,1),s=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 pn={limitToBeAddedWhitespace:!1,limitLinebreaksCount:1,mergeType:1},et=class{constructor(e){Ee(this,"ranges");Ee(this,"opts");let t=S(S({},pn),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=se(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?se(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=$n(this.ranges,{mergeType:this.opts.mergeType}),this.ranges&&this.opts.limitToBeAddedWhitespace?this.ranges.map(e=>M(e[2])?[e[0],e[1],se(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 tt(e){return typeof e=="string"?e.length?[e]:[]:e}function nt(e){return e&&typeof e=="object"&&!Array.isArray(e)}function le(e){return typeof e=="string"}var rt={cb:void 0,i:!1,trimBeforeMatching:!1,trimCharsBeforeMatching:[],maxMismatches:0,firstMustMatch:!1,lastMustMatch:!1,hungry:!1},bn=e=>e+1;function dn(e,t,r,n,a=!1,o=bn){let u=typeof r=="function"?r():r;if(+t<0&&a&&u==="EOL")return u;let l=S(S({},rt),n);if(t>=e.length&&!a)return!1;let c=a?1:r.length,s=0,$=!1,h=!1,T=!1,m=l.maxMismatches,f=t,O=!1,L=!1,p=!1;function b(){return s===1&&m<l.maxMismatches-1}for(;e[f];){let d=o(f);if(l.trimBeforeMatching&&e[f].trim()===""){if(!e[d]&&a&&r==="EOL")return!0;f=o(f);continue}if(l&&!l.i&&l.trimCharsBeforeMatching&&l.trimCharsBeforeMatching.includes(e[f])||(l==null?void 0:l.i)&&l.trimCharsBeforeMatching&&l.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(!l.i&&e[f]===E||l.i&&e[f].toLowerCase()===E.toLowerCase()){if(O||(O=!0),T||(T=!0),c===r.length){if(L=!0,m!==l.maxMismatches)return!1}else c===1&&(p=!0);if(c-=1,s++,b())return!1;if(!c)return s!==r.length||m===l.maxMismatches||!$?f:!1}else if(!$&&!s&&($=!0),l.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&&(!l.i&&e[f]===I||l.i&&e[f].toLowerCase()===I.toLowerCase())&&(!l.firstMustMatch||c!==r.length)){if(s++,b())return!1;c-=2,O=!0;break}else if(V&&I&&(!l.i&&V===I||l.i&&V.toLowerCase()===I.toLowerCase())&&(!l.firstMustMatch||c!==r.length)){if(!s&&!l.hungry)return!1;c-=1,O=!0;break}else if(I===void 0&&m>=0&&O&&(!l.firstMustMatch||L)&&(!l.lastMustMatch||p))return f}O||(h=f)}else return f===0&&c===1&&!l.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:l&&l.maxMismatches>=c&&T?h||0:!1}function Oe(e,t,r,n,a){if(nt(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({},rt),a);if(typeof o.trimCharsBeforeMatching=="string"&&(o.trimCharsBeforeMatching=tt(o.trimCharsBeforeMatching)),o.trimCharsBeforeMatching=o.trimCharsBeforeMatching.map($=>le($)?$:String($)),!le(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,l;if(le(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:
10
+ var htmlCrush=(()=>{var on=Object.create;var ee=Object.defineProperty;var ln=Object.getOwnPropertyDescriptor;var sn=Object.getOwnPropertyNames,ke=Object.getOwnPropertySymbols,an=Object.getPrototypeOf,Be=Object.prototype.hasOwnProperty,un=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))un.call(t,r)&&ye(e,r,t[r]);return e};var Ue=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),gn=(e,t)=>{for(var r in t)ee(e,r,{get:t[r],enumerable:!0})},Ge=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of sn(t))!Be.call(e,a)&&a!==r&&ee(e,a,{get:()=>t[a],enumerable:!(n=ln(t,a))||n.enumerable});return e};var qe=(e,t,r)=>(r=e!=null?on(an(e)):{},Ge(t||!e||!e.__esModule?ee(r,"default",{value:e,enumerable:!0}):r,e)),cn=e=>Ge(ee({},"__esModule",{value:!0}),e);var Ee=(e,t,r)=>(ye(e,typeof t!="symbol"?t+"":t,r),r);var at=Ue((Ai,st)=>{var yn="[object Object]";function En(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(r){}return t}function Sn(e,t){return function(r){return e(t(r))}}var On=Function.prototype,ot=Object.prototype,lt=On.toString,wn=ot.hasOwnProperty,Ln=lt.call(Object),Dn=ot.toString,An=Sn(Object.getPrototypeOf,Object);function Cn(e){return!!e&&typeof e=="object"}function In(e){if(!Cn(e)||Dn.call(e)!=yn||En(e))return!1;var t=An(e);if(t===null)return!0;var r=wn.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&lt.call(r)==Ln}st.exports=In});var Xt=Ue((ne,B)=>{var vn=200,yt="__lodash_hash_undefined__",Et=9007199254740991,Ve="[object Arguments]",_n="[object Array]",St="[object Boolean]",Ot="[object Date]",Nn="[object Error]",Re="[object Function]",wt="[object GeneratorFunction]",ue="[object Map]",Lt="[object Number]",Me="[object Object]",ut="[object Promise]",Dt="[object RegExp]",ge="[object Set]",At="[object String]",Ct="[object Symbol]",Ae="[object WeakMap]",It="[object ArrayBuffer]",ce="[object DataView]",vt="[object Float32Array]",_t="[object Float64Array]",Nt="[object Int8Array]",Vt="[object Int16Array]",Rt="[object Int32Array]",Mt="[object Uint8Array]",Pt="[object Uint8ClampedArray]",Ht="[object Uint16Array]",Ft="[object Uint32Array]",Vn=/[\\^$.*+?()[\]{}|]/g,Rn=/\w*$/,Mn=/^\[object .+?Constructor\]$/,Pn=/^(?:0|[1-9]\d*)$/,O={};O[Ve]=O[_n]=O[It]=O[ce]=O[St]=O[Ot]=O[vt]=O[_t]=O[Nt]=O[Vt]=O[Rt]=O[ue]=O[Lt]=O[Me]=O[Dt]=O[ge]=O[At]=O[Ct]=O[Mt]=O[Pt]=O[Ht]=O[Ft]=!0;O[Nn]=O[Re]=O[Ae]=!1;var Hn=typeof global=="object"&&global&&global.Object===Object&&global,Fn=typeof self=="object"&&self&&self.Object===Object&&self,_=Hn||Fn||Function("return this")(),xt=typeof ne=="object"&&ne&&!ne.nodeType&&ne,gt=xt&&typeof B=="object"&&B&&!B.nodeType&&B,xn=gt&&gt.exports===xt;function Wn(e,t){return e.set(t[0],t[1]),e}function jn(e,t){return e.add(t),e}function Jn(e,t){for(var r=-1,n=e?e.length:0;++r<n&&t(e[r],r,e)!==!1;);return e}function kn(e,t){for(var r=-1,n=t.length,a=e.length;++r<n;)e[a+r]=t[r];return e}function Wt(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 Bn(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function Un(e,t){return e==null?void 0:e[t]}function jt(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch(r){}return t}function ct(e){var t=-1,r=Array(e.size);return e.forEach(function(n,a){r[++t]=[a,n]}),r}function Pe(e,t){return function(r){return e(t(r))}}function ft(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var Gn=Array.prototype,qn=Function.prototype,fe=Object.prototype,De=_["__core-js_shared__"],mt=function(){var e=/[^.]+$/.exec(De&&De.keys&&De.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Jt=qn.toString,H=fe.hasOwnProperty,me=fe.toString,Kn=RegExp("^"+Jt.call(H).replace(Vn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ht=xn?_.Buffer:void 0,$t=_.Symbol,pt=_.Uint8Array,Yn=Pe(Object.getPrototypeOf,Object),Xn=Object.create,zn=fe.propertyIsEnumerable,Zn=Gn.splice,dt=Object.getOwnPropertySymbols,Qn=ht?ht.isBuffer:void 0,er=Pe(Object.keys,Object),Ce=q(_,"DataView"),re=q(_,"Map"),Ie=q(_,"Promise"),ve=q(_,"Set"),_e=q(_,"WeakMap"),ie=q(Object,"create"),tr=W(Ce),nr=W(re),rr=W(Ie),ir=W(ve),or=W(_e),bt=$t?$t.prototype:void 0,Tt=bt?bt.valueOf:void 0;function x(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 lr(){this.__data__=ie?ie(null):{}}function sr(e){return this.has(e)&&delete this.__data__[e]}function ar(e){var t=this.__data__;if(ie){var r=t[e];return r===yt?void 0:r}return H.call(t,e)?t[e]:void 0}function ur(e){var t=this.__data__;return ie?t[e]!==void 0:H.call(t,e)}function gr(e,t){var r=this.__data__;return r[e]=ie&&t===void 0?yt:t,this}x.prototype.clear=lr;x.prototype.delete=sr;x.prototype.get=ar;x.prototype.has=ur;x.prototype.set=gr;function N(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 cr(){this.__data__=[]}function fr(e){var t=this.__data__,r=he(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():Zn.call(t,r,1),!0}function mr(e){var t=this.__data__,r=he(t,e);return r<0?void 0:t[r][1]}function hr(e){return he(this.__data__,e)>-1}function $r(e,t){var r=this.__data__,n=he(r,e);return n<0?r.push([e,t]):r[n][1]=t,this}N.prototype.clear=cr;N.prototype.delete=fr;N.prototype.get=mr;N.prototype.has=hr;N.prototype.set=$r;function U(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 pr(){this.__data__={hash:new x,map:new(re||N),string:new x}}function dr(e){return $e(this,e).delete(e)}function br(e){return $e(this,e).get(e)}function Tr(e){return $e(this,e).has(e)}function yr(e,t){return $e(this,e).set(e,t),this}U.prototype.clear=pr;U.prototype.delete=dr;U.prototype.get=br;U.prototype.has=Tr;U.prototype.set=yr;function G(e){this.__data__=new N(e)}function Er(){this.__data__=new N}function Sr(e){return this.__data__.delete(e)}function Or(e){return this.__data__.get(e)}function wr(e){return this.__data__.has(e)}function Lr(e,t){var r=this.__data__;if(r instanceof N){var n=r.__data__;if(!re||n.length<vn-1)return n.push([e,t]),this;r=this.__data__=new U(n)}return r.set(e,t),this}G.prototype.clear=Er;G.prototype.delete=Sr;G.prototype.get=Or;G.prototype.has=wr;G.prototype.set=Lr;function Dr(e,t){var r=Fe(e)||Xr(e)?Bn(e.length,String):[],n=r.length,a=!!n;for(var o in e)(t||H.call(e,o))&&!(a&&(o=="length"||Gr(o,n)))&&r.push(o);return r}function kt(e,t,r){var n=e[t];(!(H.call(e,t)&&qt(n,r))||r===void 0&&!(t in e))&&(e[t]=r)}function he(e,t){for(var r=e.length;r--;)if(qt(e[r][0],t))return r;return-1}function Ar(e,t){return e&&Bt(t,xe(t),e)}function Ne(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=kr(e),!t)return Wr(e,s)}else{var l=F(e),$=l==Re||l==wt;if(Zr(e))return Vr(e,t);if(l==Me||l==Ve||$&&!o){if(jt(e))return o?e:{};if(s=Br($?{}:e),!t)return jr(e,Ar(s,e))}else{if(!O[l])return o?e:{};s=Ur(e,l,Ne,t)}}u||(u=new G);var h=u.get(e);if(h)return h;if(u.set(e,s),!c)var T=r?Jr(e):xe(e);return Jn(T||e,function(m,f){T&&(f=m,m=e[f]),kt(s,f,Ne(m,t,r,n,f,e,u))}),s}function Cr(e){return pe(e)?Xn(e):{}}function Ir(e,t,r){var n=t(e);return Fe(e)?n:kn(n,r(e))}function vr(e){return me.call(e)}function _r(e){if(!pe(e)||Kr(e))return!1;var t=Yt(e)||jt(e)?Kn:Mn;return t.test(W(e))}function Nr(e){if(!Gt(e))return er(e);var t=[];for(var r in Object(e))H.call(e,r)&&r!="constructor"&&t.push(r);return t}function Vr(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 pt(t).set(new pt(e)),t}function Rr(e,t){var r=t?He(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}function Mr(e,t,r){var n=t?r(ct(e),!0):ct(e);return Wt(n,Wn,new e.constructor)}function Pr(e){var t=new e.constructor(e.source,Rn.exec(e));return t.lastIndex=e.lastIndex,t}function Hr(e,t,r){var n=t?r(ft(e),!0):ft(e);return Wt(n,jn,new e.constructor)}function Fr(e){return Tt?Object(Tt.call(e)):{}}function xr(e,t){var r=t?He(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Wr(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}function Bt(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;kt(r,u,s===void 0?e[u]:s)}return r}function jr(e,t){return Bt(e,Ut(e),t)}function Jr(e){return Ir(e,xe,Ut)}function $e(e,t){var r=e.__data__;return qr(t)?r[typeof t=="string"?"string":"hash"]:r.map}function q(e,t){var r=Un(e,t);return _r(r)?r:void 0}var Ut=dt?Pe(dt,Object):ti,F=vr;(Ce&&F(new Ce(new ArrayBuffer(1)))!=ce||re&&F(new re)!=ue||Ie&&F(Ie.resolve())!=ut||ve&&F(new ve)!=ge||_e&&F(new _e)!=Ae)&&(F=function(e){var t=me.call(e),r=t==Me?e.constructor:void 0,n=r?W(r):void 0;if(n)switch(n){case tr:return ce;case nr:return ue;case rr:return ut;case ir:return ge;case or:return Ae}return t});function kr(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 Br(e){return typeof e.constructor=="function"&&!Gt(e)?Cr(Yn(e)):{}}function Ur(e,t,r,n){var a=e.constructor;switch(t){case It:return He(e);case St:case Ot:return new a(+e);case ce:return Rr(e,n);case vt:case _t:case Nt:case Vt:case Rt:case Mt:case Pt:case Ht:case Ft:return xr(e,n);case ue:return Mr(e,n,r);case Lt:case At:return new a(e);case Dt:return Pr(e);case ge:return Hr(e,n,r);case Ct:return Fr(e)}}function Gr(e,t){return t=t==null?Et:t,!!t&&(typeof e=="number"||Pn.test(e))&&e>-1&&e%1==0&&e<t}function qr(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Kr(e){return!!mt&&mt in e}function Gt(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||fe;return e===r}function W(e){if(e!=null){try{return Jt.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function Yr(e){return Ne(e,!0,!0)}function qt(e,t){return e===t||e!==e&&t!==t}function Xr(e){return zr(e)&&H.call(e,"callee")&&(!zn.call(e,"callee")||me.call(e)==Ve)}var Fe=Array.isArray;function Kt(e){return e!=null&&Qr(e.length)&&!Yt(e)}function zr(e){return ei(e)&&Kt(e)}var Zr=Qn||ni;function Yt(e){var t=pe(e)?me.call(e):"";return t==Re||t==wt}function Qr(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Et}function pe(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function ei(e){return!!e&&typeof e=="object"}function xe(e){return Kt(e)?Dr(e):Nr(e)}function ti(){return[]}function ni(){return!1}B.exports=Yr});var gi={};gn(gi,{crush:()=>ui,defaults:()=>Zt,version:()=>ai});var fn={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function Se(e,t){if(!Array.isArray(e)||!e.length)return e;let r=S(S({},fn),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 Ke={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function Ye(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({},Ke),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({},Ke);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 mn=!0,Oe="Invariant failed";function Xe(e,t){if(!e){if(mn)throw new Error(Oe);var r=typeof t=="function"?t():t,n=r?Oe+": "+r:Oe;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=Ye(o,{progressFn:$=>{r&&(n=10+Math.floor($/10),n!==a&&(a=n,r(n)))}});Xe(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 w=m===0?0:f[m-1][1],L=f[m][0];return`${h}${e.slice(w,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 hn={strictlyTwoElementsInRangeArrays:!1,progressFn:null};function Ze(e,t){if(!Array.isArray(e)||!e.length)return e;let r=S(S({},hn),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 Qe={mergeType:1,progressFn:null,joinRangesThatTouchEdges:!0};function $n(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({},Qe),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] resolvedOpts.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] resolvedOpts.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] resolvedOpts.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({},Qe);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=Ze(a,{progressFn:l=>{s=Math.floor(l/5),s!==u&&(u=s,n.progressFn(s))}}):o=Ze(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 pn={limitToBeAddedWhitespace:!1,limitLinebreaksCount:1,mergeType:1},et=class{constructor(e){Ee(this,"ranges");Ee(this,"opts");let t=S(S({},pn),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&&(!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=$n(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 tt(e){return typeof e=="string"?e.length?[e]:[]:e}function nt(e){return e&&typeof e=="object"&&!Array.isArray(e)}function se(e){return typeof e=="string"}var rt={cb:void 0,i:!1,trimBeforeMatching:!1,trimCharsBeforeMatching:[],maxMismatches:0,firstMustMatch:!1,lastMustMatch:!1,hungry:!1},dn=e=>e+1;function bn(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({},rt),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,w=!1,L=!1,p=!1;function d(){return l===1&&m<s.maxMismatches-1}for(;e[f];){let b=o(f);if(s.trimBeforeMatching&&e[f].trim()===""){if(!e[b]&&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[b])return!0;f=o(f);continue}let E=b>f?r[r.length-c]:r[c-1];if(!s.i&&e[f]===E||s.i&&e[f].toLowerCase()===E.toLowerCase()){if(w||(w=!0),T||(T=!0),c===r.length){if(L=!0,m!==s.maxMismatches)return!1}else c===1&&(p=!0);if(c-=1,l++,d())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=b>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++,d())return!1;c-=2,w=!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,w=!0;break}else if(I===void 0&&m>=0&&w&&(!s.firstMustMatch||L)&&(!s.lastMustMatch||p))return f}w||(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 we(e,t,r,n,a){if(nt(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({},rt),a);if(typeof o.trimCharsBeforeMatching=="string"&&(o.trimCharsBeforeMatching=tt(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
18
  ${JSON.stringify(n,null,4)}`);if(a&&!nt(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,s="";if((o==null?void 0:o.trimCharsBeforeMatching)&&o.trimCharsBeforeMatching.some(($,h)=>$.length>1?(c=h,s=$,!0):!1))throw new Error(`string-match-left-right/${e}(): [THROW_ID_07] the fourth argument, options object contains trimCharsBeforeMatching. It was meant to list the single characters but one of the entries at index ${c} is longer than 1 character, ${s.length} (equals to ${s}). Please split it into separate characters and put into array as separate elements.`);if(!u||!Array.isArray(u)||Array.isArray(u)&&!u.length||Array.isArray(u)&&u.length===1&&le(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;$++){l=typeof u[$]=="function";let T=u[$],m,f,O="",L=r;e==="matchRight"?L+=1:e==="matchLeft"&&(L-=1);let p=dn(t,L,T,o,l,b=>e[5]==="L"?b-1:b+1);if(p&&l&&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 it(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 Tn={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(s){return!s||typeof s!="string"?!1:!s.trim()}function n(s){return typeof s=="string"}if(!e||typeof e!="object"||Array.isArray(e)){let s;throw e===void 0?s="but it is missing completely.":e===null?s="but it was given as null.":s=`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 ${s}`)}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({},Tn),e);if(Array.isArray(a.ifLeftSideIncludesThisThenCropTightly)){let s,$;if(a.ifLeftSideIncludesThisThenCropTightly.every((h,T)=>n(h)?!0:(s=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 ${s} is of a type ${typeof $} (equal to ${JSON.stringify($,null,0)}).`)}let o=a.str,u=a.from,l=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 s=u;s--;)if(!a.ifLeftSideIncludesThisCropItToo.includes(o[s])){if(o[s].trim()){a.wipeAllWhitespaceOnLeft||a.ifLeftSideIncludesThisCropItToo.includes(o[s+1])?u=s+1:u=s+2;break}else if(s===0){a.wipeAllWhitespaceOnLeft?u=0:u=1;break}}}if(a.extendToOneSide!=="left"&&(r(o[l])&&(a.wipeAllWhitespaceOnRight||r(o[l+1]))||a.ifRightSideIncludesThisCropItToo.includes(o[l]))){for(let s=l,$=o.length;s<$;s++)if(!a.ifRightSideIncludesThisCropItToo.includes(o[s])&&((c=o[s])==null?void 0:c.trim())){a.wipeAllWhitespaceOnRight||a.ifRightSideIncludesThisCropItToo.includes(o[s-1])?l=s:l=s-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[l+1]&&a.ifRightSideIncludesThisThenCropTightly.includes(o[l+1])||o[l]&&a.ifRightSideIncludesThisThenCropTightly.includes(o[l])))&&(a.extendToOneSide!=="right"&&r(o[u-1])&&!a.wipeAllWhitespaceOnLeft&&(u-=1),a.extendToOneSide!=="left"&&r(o[l])&&!a.wipeAllWhitespaceOnRight&&(l+=1)),a.addSingleSpaceToPreventAccidentalConcatenation&&o[u-1]&&o[u-1].trim()&&o[l]&&o[l].trim()&&(!a.ifLeftSideIncludesThisThenCropTightly&&!a.ifRightSideIncludesThisThenCropTightly||!((!a.ifLeftSideIncludesThisThenCropTightly||a.ifLeftSideIncludesThisThenCropTightly.includes(o[u-1]))&&(!a.ifRightSideIncludesThisThenCropTightly||o[l]&&a.ifRightSideIncludesThisThenCropTightly.includes(o[l]))))&&(t.test(o[u-1])||t.test(o[l]))?[u,l," "]:[u,l]}var ri=qe(at(),1),ii=qe(Xt(),1);var K="\xA0";function oi({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&&`
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,w="";return f&&f>0&&(w=t.slice(0,f)),e[5]==="L"||h&&h>0&&(w=t.slice(h)),o.cb(m,w,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,w="",L=r;e==="matchRight"?L+=1:e==="matchLeft"&&(L-=1);let p=bn(t,L,T,o,s,d=>e[5]==="L"?d-1:d+1);if(p&&s&&typeof T=="function"&&T()==="EOL")return T()&&(o.cb?o.cb(m,w,f):!0)?T():!1;if(Number.isInteger(p)&&(f=e.startsWith("matchLeft")?p-1:p+1,e[5]==="L"?w=t.slice(0,p):w=t.slice(f)),f<0&&(f=void 0),t[f]&&(m=t[f]),Number.isInteger(p)&&(o.cb?o.cb(m,w,f):!0))return T}return!1}function it(e,t,r,n){return we("matchLeft",e,t,r,n)}function Le(e,t,r,n){return we("matchRightIncl",e,t,r,n)}function k(e,t,r,n){return we("matchRight",e,t,r,n)}var Tn={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 resolvedOpts.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 resolvedOpts.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 resolvedOpts.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, resolvedOpts.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 resolvedOpts.extendToOneSide value is not recognisable! 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({},Tn),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 resolvedOpts.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 ri=qe(at(),1),ii=qe(Xt(),1);var K="\xA0";function oi({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
22
  \r`.includes(e[t+1])||n&&e[t+1]===K))return t+1;if(e[t+2]&&(e[t+2].trim()||r&&`
23
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 oi({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&&`
24
+ \r`.includes(e[a])||n&&e[a]===K)return a;return null}function D(e,t=0){return oi({str:e,idx:t,stopAtNewlines:!1,stopAtRawNbsp:!1})}function li({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
25
  \r`.includes(e[~-t])||n&&e[~-t]===K))return~-t;if(e[t-2]&&(e[t-2].trim()||r&&`
26
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.13";var ai=zt,y=new et({limitToBeAddedWhitespace:!0}),Zt={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 ui(e,t){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({},Zt),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,l=null,c=!1,s=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="<",Qt="!",en=">",tn="<",We="{},:;<>~+",de=We,Te=We,j=!0,_=e.length,nn=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=`
27
+ \r`.includes(e[a])||n&&e[a]===K))return a;return null}function de(e,t=0){return li({str:e,idx:t,stopAtNewlines:!1,stopAtRawNbsp:!1})}var zt="5.0.16";var ai=zt,y=new et({limitToBeAddedWhitespace:!0}),Zt={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 ui(e,t){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 resolvedOpts.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({},Zt),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,w=null,L=null,p,d=null,b=null,E=null,A=null,I=null,V=null,z=">};",Z="<",Qt="!",en=">",tn="<",We="{},:;<>~+",be=We,Te=We,j=!0,v=e.length,nn=Math.floor(v/2),je=.01,Je;n.reportProgressFunc&&(Je=Math.floor(n.reportProgressFuncTo-(n.reportProgressFuncTo-n.reportProgressFuncFrom)*je-n.reportProgressFuncFrom));let R,oe=0,C=`
30
30
  `;if(e.includes(`\r
31
31
  `)?C=`\r
32
- `:e.includes("\r")&&(C="\r"),_){for(let i=0;i<_;i++){if(n.reportProgressFunc&&(_>1e3&&_<2e3?i===nn&&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]==="}"&&(s+1>=n.lineLengthLimit?(y.push(i,i,C),s=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)&&l!==null&&(l>0&&(g=C),y.push(l,i,g)),l=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):(s+=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):(s+=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())l===null&&(l=i);else if(!p&&!((h||m)&&f!==null)){if(l!==null){if(n.removeLineBreaks&&(s+=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):l+1<i&&(e.endsWith("]>",l)||e.endsWith("-->",l)||e.startsWith("<![",i)||e.startsWith("<!--<![",i)?y.push(l,i):e[l]===" "?y.push(l+1,i):e[~-i]===" "?y.push(l,~-i):y.push(l,i," "))),n.removeLineBreaks||m){if(a.includes(e[i])&&Le(e,i,n.breakToTheLeftOf)){!(`\r
34
- `.includes(e[~-i])&&l===~-i)&&!(e[~-i]===`
35
- `&&e[i-2]==="\r"&&l===i-2)&&y.push(l,i,C),b=null,d=null,E=null,l=null,s=1;continue}let g=" ";e[i]==="<"&&k(e,i,n.mindTheInlineTags,{cb:J=>!J||!/\w/.test(J)})||(e[~-l]&&en.includes(e[~-l])&&tn.includes(e[i])||(h||m)&&f===null&&(de.includes(e[~-l])||Te.includes(e[i]))||e.startsWith("!important",i)&&!T||m&&(e[~-l]==="'"||e[~-l]==='"')||e[~-l]==="}"&&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)),s-=D(e,i)-i+1)),h&&e[i]==="}"&&l&&e[l-1]==="}"&&(g=" "),g!=null&&g.length&&(s+=1),n.lineLengthLimit?s>=n.lineLengthLimit||!e[i+1]||e[i]===">"||e[i]==="/"&&e[i+1]===">"?((s>n.lineLengthLimit||s===n.lineLengthLimit&&e[i+1]&&e[i+1].trim()&&!z.includes(e[i])&&!Z.includes(e[i+1]))&&(g=C,s=1),(s>n.lineLengthLimit||!(g===" "&&i===l+1))&&(y.push(l,i,g),u=null),b=null,d=null,E=null):(b===null||l<b)&&(b=l,d=i,E=g):i===l+1&&g===" "||y.push(l,i,g)}l=null,c||(c=!0)}else j&&(j=!1),n.removeLineBreaks&&(s+=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)||!it(e,i,"<!--"))){y.push(i,i,C),b=null,d=null,E=null,s=1;continue}else if(n.lineLengthLimit&&s<=n.lineLengthLimit){if(!e[i+1]||Z.includes(e[i])&&!Qt.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()&&s+(E?E.length:0)>n.lineLengthLimit&&(g=C),(s+(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&&E.length?E.length:0;s-(d-b-g)-1>n.lineLengthLimit||(y.push(b,d,E),s-(d-b-g)-1===n.lineLengthLimit&&(y.push(i,i,C),s=0),b=null,d=null,E=null)}else y.push(i,i,C),s=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),s=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&&s>=n.lineLengthLimit&&b!==null&&d!==null&&!z.includes(e[i])&&!Z.includes(e[i])&&!"/".includes(e[i])&&!(s===n.lineLengthLimit&&e[i+1]&&!e[i+1].trim())){let g=C;e[i+1]&&!e[i+1].trim()&&s===n.lineLengthLimit&&(g=E),g===C&&!e[~-b].trim()&&be(e,b)&&(b=be(e,b)+1),y.push(b,d,g),s=i-d,e[i].length&&(s+=1),b=null,d=null,E=null}if((!p&&e[i]===`
32
+ `:e.includes("\r")&&(C="\r"),v){for(let i=0;i<v;i++){if(n.reportProgressFunc&&(v>1e3&&v<2e3?i===nn&&n.reportProgressFunc(Math.floor((n.reportProgressFuncTo-n.reportProgressFuncFrom)/2)):v>=2e3&&(R=n.reportProgressFuncFrom+Math.floor(i/v*(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):(d=i,b=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]==="/"&&([d,b]=ae({str:e,from:f,to:i+2,ifLeftSideIncludesThisThenCropTightly:be||"",ifRightSideIncludesThisThenCropTightly:Te||""}),f=null,d!=null?y.push(d,b):(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&&w!==null){let g;e.startsWith("-->",i)?g=3:e[i]===">"&&e[i-1]==="]"&&(g=1),g&&([d,b]=ae({str:e,from:w,to:i+g}),w=null,d!=null?n.lineLengthLimit&&$-(b-d)>=n.lineLengthLimit?(y.push(d,b,C),$=-g):(y.push(d,b),$-=b-d):(l+=g-1,i+=g-1),p=i+g)}if(!p&&!h&&!m&&(e.startsWith("<!--",i)||n.removeHTMLComments===2&&e.startsWith("<![endif",i))&&w===null&&(e.startsWith("[if",i+4)?(T||(T=!0),n.removeHTMLComments===2&&(w=i)):n.removeHTMLComments&&(!T||n.removeHTMLComments===2)&&(w=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),d=null,b=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]&&en.includes(e[~-s])&&tn.includes(e[i])||(h||m)&&f===null&&(be.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[de(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&&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),d=null,b=null,E=null):(d===null||s<d)&&(d=s,b=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)||!it(e,i,"<!--"))){y.push(i,i,C),d=null,b=null,E=null,l=1;continue}else if(n.lineLengthLimit&&l<=n.lineLengthLimit){if(!e[i+1]||Z.includes(e[i])&&!Qt.includes(e[i])||z.includes(e[i])||!e[i].trim()){if(d!==null&&b!==null&&(d!==b||(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===" "&&b===d+1&&e[d]===" "))&&(e[~-d]==="}"&&e[b]==="{"||(y.push(d,b,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)}))?(d=i,b=i,E=null):f===null&&d!==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)}))&&(d=null,b=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(d!==null&&b!==null&&(d!==b||(E==null?void 0:E.length))){let g=E!=null&&E.length?E.length:0;l-(b-d-g)-1>n.lineLengthLimit||(y.push(d,b,E),l-(b-d-g)-1===n.lineLengthLimit&&(y.push(i,i,C),l=0),d=null,b=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)?d!==null&&b!==null&&(d!==b||(E==null?void 0:E.length))||(y.push(i+1,i+1,C),l=0):e[i].trim()&&(e[i+1]||d!==null&&b!==null&&(d!==b||(E==null?void 0:E.length))&&y.push(d,b,C))}if(!p&&!j&&n.removeLineBreaks&&n.lineLengthLimit&&l>=n.lineLengthLimit&&d!==null&&b!==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[~-d].trim()&&de(e,d)&&(d=de(e,d)+1),y.push(d,b,g),l=i-b,e[i].length&&(l+=1),d=null,b=null,E=null}if((!p&&e[i]===`
36
36
  `||e[i]==="\r"&&(!e[i+1]||e[i+1]&&e[i+1]!==`
37
- `))&&(u=i,c&&(c=!1),!n.removeLineBreaks&&l!==null&&l<i&&e[i+1]&&e[i+1]!=="\r"&&e[i+1]!==`
38
- `&&y.push(l,i)),e[i+1]||(h&&f!==null?y.push(...ae({str:e,from:f,to:i,ifLeftSideIncludesThisThenCropTightly:de||"",ifRightSideIncludesThisThenCropTightly:Te||""})):l&&e[i]!==`
39
- `&&e[i]!=="\r"?y.push(l,i+1):l&&(e[i]==="\r"&&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:be||"",ifRightSideIncludesThisThenCropTightly:Te||""})):s&&e[i]!==`
39
+ `&&e[i]!=="\r"?y.push(s,i+1):s&&(e[i]==="\r"&&e[i+1]===`
40
40
  `||e[i]===`
41
- `&&e[i-1]!=="\r")&&y.push(l,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,rn=>{n.reportProgressFunc&&_>=2e3&&(R=Math.floor(Q+(n.reportProgressFuncTo-Q)*(rn/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 cn(gi);})();
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,rn=>{n.reportProgressFunc&&v>=2e3&&(R=Math.floor(Q+(n.reportProgressFuncTo-Q)*(rn/100)),R!==oe&&(oe=R,n.reportProgressFunc(R)))}),J=g.length;return{log:{timeTakenInMilliseconds:Date.now()-r,originalLength:v,cleanedLength:J,bytesSaved:Math.max(v-J,0),percentageReducedOfOriginal:v?Math.round(Math.max(v-J,0)*100/v):0},ranges:i,applicableOpts:o,result:g}}}return{log:{timeTakenInMilliseconds:Date.now()-r,originalLength:v,cleanedLength:v,bytesSaved:0,percentageReducedOfOriginal:0},applicableOpts:o,ranges:null,result:e}}return cn(gi);})();
42
42
  /**
43
43
  * @name arrayiffy-if-string
44
44
  * @fileoverview Put non-empty strings into arrays, turn empty-ones into empty arrays. Bypass everything else.
45
- * @version 4.0.12
45
+ * @version 4.0.13
46
46
  * @author Roy Revelt, Codsen Ltd
47
47
  * @license MIT
48
48
  * {@link https://codsen.com/os/arrayiffy-if-string/}
@@ -50,7 +50,7 @@ ${JSON.stringify(t.breakToTheLeftOf[i],null,4)}`)}let n=S(S({},Zt),t);typeof n.r
50
50
  /**
51
51
  * @name ranges-apply
52
52
  * @fileoverview Take an array of string index ranges, delete/replace the string according to them
53
- * @version 6.0.12
53
+ * @version 6.1.2
54
54
  * @author Roy Revelt, Codsen Ltd
55
55
  * @license MIT
56
56
  * {@link https://codsen.com/os/ranges-apply/}
@@ -58,7 +58,7 @@ ${JSON.stringify(t.breakToTheLeftOf[i],null,4)}`)}let n=S(S({},Zt),t);typeof n.r
58
58
  /**
59
59
  * @name ranges-merge
60
60
  * @fileoverview Merge and sort string index ranges
61
- * @version 8.0.12
61
+ * @version 8.1.2
62
62
  * @author Roy Revelt, Codsen Ltd
63
63
  * @license MIT
64
64
  * {@link https://codsen.com/os/ranges-merge/}
@@ -66,7 +66,7 @@ ${JSON.stringify(t.breakToTheLeftOf[i],null,4)}`)}let n=S(S({},Zt),t);typeof n.r
66
66
  /**
67
67
  * @name ranges-push
68
68
  * @fileoverview Gather string index ranges
69
- * @version 6.0.12
69
+ * @version 6.1.2
70
70
  * @author Roy Revelt, Codsen Ltd
71
71
  * @license MIT
72
72
  * {@link https://codsen.com/os/ranges-push/}
@@ -74,7 +74,7 @@ ${JSON.stringify(t.breakToTheLeftOf[i],null,4)}`)}let n=S(S({},Zt),t);typeof n.r
74
74
  /**
75
75
  * @name ranges-sort
76
76
  * @fileoverview Sort string index ranges
77
- * @version 5.0.12
77
+ * @version 5.0.13
78
78
  * @author Roy Revelt, Codsen Ltd
79
79
  * @license MIT
80
80
  * {@link https://codsen.com/os/ranges-sort/}
@@ -82,7 +82,7 @@ ${JSON.stringify(t.breakToTheLeftOf[i],null,4)}`)}let n=S(S({},Zt),t);typeof n.r
82
82
  /**
83
83
  * @name string-collapse-leading-whitespace
84
84
  * @fileoverview Collapse the leading and trailing whitespace of a string
85
- * @version 6.0.12
85
+ * @version 6.0.14
86
86
  * @author Roy Revelt, Codsen Ltd
87
87
  * @license MIT
88
88
  * {@link https://codsen.com/os/string-collapse-leading-whitespace/}
@@ -90,7 +90,7 @@ ${JSON.stringify(t.breakToTheLeftOf[i],null,4)}`)}let n=S(S({},Zt),t);typeof n.r
90
90
  /**
91
91
  * @name string-left-right
92
92
  * @fileoverview Looks up the first non-whitespace character to the left/right of a given index
93
- * @version 5.0.12
93
+ * @version 5.0.13
94
94
  * @author Roy Revelt, Codsen Ltd
95
95
  * @license MIT
96
96
  * {@link https://codsen.com/os/string-left-right/}
@@ -98,7 +98,7 @@ ${JSON.stringify(t.breakToTheLeftOf[i],null,4)}`)}let n=S(S({},Zt),t);typeof n.r
98
98
  /**
99
99
  * @name string-match-left-right
100
100
  * @fileoverview Match substrings on the left or right of a given index, ignoring whitespace
101
- * @version 8.1.0
101
+ * @version 8.1.2
102
102
  * @author Roy Revelt, Codsen Ltd
103
103
  * @license MIT
104
104
  * {@link https://codsen.com/os/string-match-left-right/}
@@ -106,7 +106,7 @@ ${JSON.stringify(t.breakToTheLeftOf[i],null,4)}`)}let n=S(S({},Zt),t);typeof n.r
106
106
  /**
107
107
  * @name string-range-expander
108
108
  * @fileoverview Expands string index ranges within whitespace boundaries until letters are met
109
- * @version 3.0.12
109
+ * @version 3.0.13
110
110
  * @author Roy Revelt, Codsen Ltd
111
111
  * @license MIT
112
112
  * {@link https://codsen.com/os/string-range-expander/}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "html-crush",
3
- "version": "5.0.13",
3
+ "version": "5.0.16",
4
4
  "description": "Minifies HTML/CSS: valid or broken, pure or mixed with other languages",
5
5
  "keywords": [
6
6
  "breaks",
@@ -77,11 +77,11 @@
77
77
  }
78
78
  },
79
79
  "dependencies": {
80
- "ranges-apply": "^6.0.12",
81
- "ranges-push": "^6.0.12",
82
- "string-left-right": "^5.0.12",
83
- "string-match-left-right": "^8.1.0",
84
- "string-range-expander": "^3.0.12",
85
- "test-mixer": "^3.0.12"
80
+ "ranges-apply": "^6.1.2",
81
+ "ranges-push": "^6.1.2",
82
+ "string-left-right": "^5.0.13",
83
+ "string-match-left-right": "^8.1.2",
84
+ "string-range-expander": "^3.0.13",
85
+ "test-mixer": "^3.0.13"
86
86
  }
87
87
  }
package/types/index.d.ts CHANGED
@@ -35,6 +35,6 @@ interface Res {
35
35
  /**
36
36
  * Minifies HTML/CSS: valid or broken, pure or mixed with other languages
37
37
  */
38
- declare function crush(str: string, originalOpts?: Partial<Opts>): Res;
38
+ declare function crush(str: string, opts?: Partial<Opts>): Res;
39
39
 
40
40
  export { crush, defaults, version };