chunk-6MIPKMCQ.js 1.3 KB

1
  1. import{a as t}from"./chunk-6S43R6PL.js";import{a as v}from"./chunk-4D2ERGZX.js";import{a as f}from"./chunk-PJGSCWXZ.js";import{a as m}from"./chunk-NUC3LT2W.js";function a(r,o,e,i){if(!m(r))throw new f("uint8Array is required.");if(o<0)throw new f("byteOffset cannot be negative.");if(e<0)throw new f("byteLength cannot be negative.");if(o+e>r.byteLength)throw new f("sub-region exceeds array bounds.");return o=v(o,0),e=v(e,r.byteLength-o),i=v(i,"utf-8"),r=r.subarray(o,o+e),a.decode(r,i)}a.decodeWithTextDecoder=function(r,o){var e=new TextDecoder(o);return e.decode(r)};a.decodeWithFromCharCode=function(r){for(var o="",e=g(r),i=e.length,x=0;x<i;++x){var n=e[x];n<=65535?o+=String.fromCharCode(n):(n-=65536,o+=String.fromCharCode((n>>10)+55296,(n&1023)+56320))}return o};function F(r,o,e){return o<=r&&r<=e}function g(r){for(var o=0,e=0,i=0,x=128,n=191,l=[],u=r.length,h=0;h<u;++h){var d=r[h];if(i===0){if(F(d,0,127)){l.push(d);continue}if(F(d,194,223)){i=1,o=d&31;continue}if(F(d,224,239)){d===224&&(x=160),d===237&&(n=159),i=2,o=d&15;continue}if(F(d,240,244)){d===240&&(x=144),d===244&&(n=143),i=3,o=d&7;continue}throw new t("String decoding failed.")}if(!F(d,x,n)){o=i=e=0,x=128,n=191,--h;continue}x=128,n=191,o=o<<6|d&63,++e,e===i&&(l.push(o),o=i=e=0)}return l}typeof TextDecoder<"u"?a.decode=a.decodeWithTextDecoder:a.decode=a.decodeWithFromCharCode;var s=a;export{s as a};