/**
 * Minified by jsDelivr using Terser v5.37.0.
 * Original file: /npm/chunk-handler@1.6.0/src/chunkhandler.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
"use strict";class ChunkHandler{constructor(){this.body={}}isString(t){return"string"==typeof t||t instanceof String}isArray(t){return void 0!==t&&""!==t&&(t&&"object"==typeof t&&t.constructor===Array)}isObject(t){return void 0!==t&&""!==t&&(t&&"object"==typeof t&&t.constructor===Object)}isEmpty(t){return null==t||""===t}isEmptyArray(t){return null==t||0===t.length}isEmptyObject(t){return null==t||0===Object.keys(t).length&&t.constructor===Object}blockingTest(t=1e3){const e=Date.now(),r=e+t;for(;Date.now()<r;);return e}getBestSize(t,e=5){if(t=parseInt(t),(e=parseInt(e))<1||e>10)throw new Error("Split value must be between 1-10");t<=1e5&&e>1&&(e=1),t>1e5&&t<=1e6&&1===e&&(e=5);const r=10*e,s=r-(r-Math.ceil(r/10));switch(!0){case t<=5e6&&t>4e6:return Math.ceil(t/(r-1*s));case t<=4e6&&t>35e5:return Math.ceil(t/(r-2*s));case t<=35e5&&t>3e6:return Math.ceil(t/(r-3*s));case t<=3e6&&t>25e5:return Math.ceil(t/(r-4*s));case t<=25e5&&t>2e6:return Math.ceil(t/(r-5*s));case t<=2e6&&t>15e5:return Math.ceil(t/(r-6*s));case t<=15e5&&t>1e6:return Math.ceil(t/(r-7*s));case t<=1e6&&t>5e5:return Math.ceil(t/(r-8*s));case t<=5e5&&t>1e5:return Math.ceil(t/(r-9*s));case t<=1e5&&t>5e4:return Math.ceil(t/3);case t<=5e4&&t>1e4:return Math.ceil(t/2);case t<=1e4&&t>1:return Math.ceil(t/1);default:return Math.ceil(t/r)}}getRandomInt(t,e){return Math.floor(Math.random()*(e-t+1))+t}make(t,e=100){if(e=parseInt(e),!this.isString(t)&&!this.isArray(t))throw new Error("Value must be string or array");if(this.isString(t)){let r=0,s=0;const a=Math.ceil(t.length/e),i=new Array(a);for(;r<a;++r,s+=e)i[r]=t.substr(s,e);return i}{const r=[];let s=0;const a=Math.ceil(t.length/e);for(;s<a;s++){const a=s*e,i=a+e;r.push(t.slice(a,i))}return r}}makeAleatory(t,e){const r=t,s=new Array([]),a=parseInt(t.length/e,10);let i=0;for(i=0;i<e;i++){s[parseInt(i,10)]=[];for(let t=0;t<a;t++){const t=this.getRandomInt(0,r.length-1);s[parseInt(i,10)].push(r.splice(t,1)[0])}}return r.length>0&&s[parseInt(i-1,10)].push(...r),s}merge(t){if(!this.isArray(t)&&this.isEmptyArray(t))return"";let e="",r=0;const s=t.length;if(this.isEmpty(t[0].data))for(this.isArray(t[0])&&(e=[]);r<s;r++)this.isArray(t[r])?e=e.concat(t[r]):e+=t[r];else for(this.isEmpty(t[0].part)||t.sort((function(t,e){return parseFloat(t.part)-parseFloat(e.part)})),this.isArray(t[0].data)&&(e=[]);r<s;r++)this.isArray(t[r].data)?e=e.concat(t[r].data):e+=t[r].data;return e}add(t,e,r=""){return this.isString(t)&&(t=t.replace(/[^A-Z0-9]/gi,"_"),e&&(this.isEmpty(r)?this.isEmpty(this.body[t])?(this.body[t]=[],this.body[t].push({data:e})):this.body[t].push({data:e}):(r=parseInt(r),this.isEmpty(this.body[t])?(this.body[t]=[],this.body[t].push({part:r,data:e})):this.body[t].push({part:r,data:e})))),this}remove(t){return this.isString(t)&&(t=t.replace(/[^A-Z0-9]/gi,"_"),delete this.body[t]),this}clean(){return this.body={},this}get(t){return t=t.replace(/[^A-Z0-9]/gi,"_"),this.body[t]}getBody(){return this.body}promisify(t){const e=this;return new Promise((function(r,s){try{r(t.call(e,e))}catch(t){s(t)}}))}}module.exports=ChunkHandler;
//# sourceMappingURL=/sm/9a6aa4b2b1fc5f2b8831a380d8ab47876eb4130a8183e84920a891296bebb9b0.map