markuno_lib 1.2.132 → 1.2.134
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/bin/bus_utils.js +1 -1
- package/package.json +1 -1
- package/types/bus_utils.d.ts +11 -11
package/bin/bus_utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e={};!function(e){var t="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;e.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var a=t.shift();if(a){if("object"!=typeof a)throw new TypeError(a+"must be non-object");for(var n in a)a.hasOwnProperty(n)&&(e[n]=a[n])}}return e},e.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var a={arraySet:function(e,t,a,n,i){if(t.subarray&&e.subarray)e.set(t.subarray(a,a+n),i);else for(var r=0;r<n;r++)e[i+r]=t[a+r]},flattenChunks:function(e){var t,a,n,i,r,s;for(n=0,t=0,a=e.length;t<a;t++)n+=e[t].length;for(s=new Uint8Array(n),i=0,t=0,a=e.length;t<a;t++)r=e[t],s.set(r,i),i+=r.length;return s}},n={arraySet:function(e,t,a,n,i){for(var r=0;r<n;r++)e[i+r]=t[a+r]},flattenChunks:function(e){return[].concat.apply([],e)}};e.setTyped=function(t){t?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,a)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,n))},e.setTyped(t)}(e);var t={},a={},n={},i=e;function zero$1(e){for(var t=e.length;--t>=0;)e[t]=0}var r=256,s=286,o=30,l=15,h=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],d=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],_=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],f=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],u=new Array(576);zero$1(u);var c=new Array(60);zero$1(c);var g=new Array(512);zero$1(g);var m=new Array(256);zero$1(m);var b=new Array(29);zero$1(b);var w,p,k,v=new Array(o);function StaticTreeDesc(e,t,a,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=a,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function TreeDesc(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function d_code(e){return e<256?g[e]:g[256+(e>>>7)]}function put_short(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function send_bits(e,t,a){e.bi_valid>16-a?(e.bi_buf|=t<<e.bi_valid&65535,put_short(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=a-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=a)}function send_code(e,t,a){send_bits(e,a[2*t],a[2*t+1])}function bi_reverse(e,t){var a=0;do{a|=1&e,e>>>=1,a<<=1}while(--t>0);return a>>>1}function gen_codes(e,t,a){var n,i,r=new Array(16),s=0;for(n=1;n<=l;n++)r[n]=s=s+a[n-1]<<1;for(i=0;i<=t;i++){var o=e[2*i+1];0!==o&&(e[2*i]=bi_reverse(r[o]++,o))}}function init_block(e){var t;for(t=0;t<s;t++)e.dyn_ltree[2*t]=0;for(t=0;t<o;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function bi_windup(e){e.bi_valid>8?put_short(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function smaller(e,t,a,n){var i=2*t,r=2*a;return e[i]<e[r]||e[i]===e[r]&&n[t]<=n[a]}function pqdownheap(e,t,a){for(var n=e.heap[a],i=a<<1;i<=e.heap_len&&(i<e.heap_len&&smaller(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!smaller(t,n,e.heap[i],e.depth));)e.heap[a]=e.heap[i],a=i,i<<=1;e.heap[a]=n}function compress_block(e,t,a){var n,i,s,o,l=0;if(0!==e.last_lit)do{n=e.pending_buf[e.d_buf+2*l]<<8|e.pending_buf[e.d_buf+2*l+1],i=e.pending_buf[e.l_buf+l],l++,0===n?send_code(e,i,t):(send_code(e,(s=m[i])+r+1,t),0!==(o=h[s])&&send_bits(e,i-=b[s],o),send_code(e,s=d_code(--n),a),0!==(o=d[s])&&send_bits(e,n-=v[s],o))}while(l<e.last_lit);send_code(e,256,t)}function build_tree(e,t){var a,n,i,r=t.dyn_tree,s=t.stat_desc.static_tree,o=t.stat_desc.has_stree,h=t.stat_desc.elems,d=-1;for(e.heap_len=0,e.heap_max=573,a=0;a<h;a++)0!==r[2*a]?(e.heap[++e.heap_len]=d=a,e.depth[a]=0):r[2*a+1]=0;for(;e.heap_len<2;)r[2*(i=e.heap[++e.heap_len]=d<2?++d:0)]=1,e.depth[i]=0,e.opt_len--,o&&(e.static_len-=s[2*i+1]);for(t.max_code=d,a=e.heap_len>>1;a>=1;a--)pqdownheap(e,r,a);i=h;do{a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],pqdownheap(e,r,1),n=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=n,r[2*i]=r[2*a]+r[2*n],e.depth[i]=(e.depth[a]>=e.depth[n]?e.depth[a]:e.depth[n])+1,r[2*a+1]=r[2*n+1]=i,e.heap[1]=i++,pqdownheap(e,r,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function gen_bitlen(e,t){var a,n,i,r,s,o,h=t.dyn_tree,d=t.max_code,_=t.stat_desc.static_tree,f=t.stat_desc.has_stree,u=t.stat_desc.extra_bits,c=t.stat_desc.extra_base,g=t.stat_desc.max_length,m=0;for(r=0;r<=l;r++)e.bl_count[r]=0;for(h[2*e.heap[e.heap_max]+1]=0,a=e.heap_max+1;a<573;a++)(r=h[2*h[2*(n=e.heap[a])+1]+1]+1)>g&&(r=g,m++),h[2*n+1]=r,n>d||(e.bl_count[r]++,s=0,n>=c&&(s=u[n-c]),o=h[2*n],e.opt_len+=o*(r+s),f&&(e.static_len+=o*(_[2*n+1]+s)));if(0!==m){do{for(r=g-1;0===e.bl_count[r];)r--;e.bl_count[r]--,e.bl_count[r+1]+=2,e.bl_count[g]--,m-=2}while(m>0);for(r=g;0!==r;r--)for(n=e.bl_count[r];0!==n;)(i=e.heap[--a])>d||(h[2*i+1]!==r&&(e.opt_len+=(r-h[2*i+1])*h[2*i],h[2*i+1]=r),n--)}}(e,t),gen_codes(r,d,e.bl_count)}function scan_tree(e,t,a){var n,i,r=-1,s=t[1],o=0,l=7,h=4;for(0===s&&(l=138,h=3),t[2*(a+1)+1]=65535,n=0;n<=a;n++)i=s,s=t[2*(n+1)+1],++o<l&&i===s||(o<h?e.bl_tree[2*i]+=o:0!==i?(i!==r&&e.bl_tree[2*i]++,e.bl_tree[32]++):o<=10?e.bl_tree[34]++:e.bl_tree[36]++,o=0,r=i,0===s?(l=138,h=3):i===s?(l=6,h=3):(l=7,h=4))}function send_tree(e,t,a){var n,i,r=-1,s=t[1],o=0,l=7,h=4;for(0===s&&(l=138,h=3),n=0;n<=a;n++)if(i=s,s=t[2*(n+1)+1],!(++o<l&&i===s)){if(o<h)do{send_code(e,i,e.bl_tree)}while(0!=--o);else 0!==i?(i!==r&&(send_code(e,i,e.bl_tree),o--),send_code(e,16,e.bl_tree),send_bits(e,o-3,2)):o<=10?(send_code(e,17,e.bl_tree),send_bits(e,o-3,3)):(send_code(e,18,e.bl_tree),send_bits(e,o-11,7));o=0,r=i,0===s?(l=138,h=3):i===s?(l=6,h=3):(l=7,h=4)}}zero$1(v);var y=!1;function _tr_stored_block(e,t,a,n){send_bits(e,0+(n?1:0),3),function copy_block(e,t,a,n){bi_windup(e),put_short(e,a),put_short(e,~a),i.arraySet(e.pending_buf,e.window,t,a,e.pending),e.pending+=a}(e,t,a)}n._tr_init=function _tr_init(e){y||(!function tr_static_init(){var e,t,a,n,i,r=new Array(16);for(a=0,n=0;n<28;n++)for(b[n]=a,e=0;e<1<<h[n];e++)m[a++]=n;for(m[a-1]=n,i=0,n=0;n<16;n++)for(v[n]=i,e=0;e<1<<d[n];e++)g[i++]=n;for(i>>=7;n<o;n++)for(v[n]=i<<7,e=0;e<1<<d[n]-7;e++)g[256+i++]=n;for(t=0;t<=l;t++)r[t]=0;for(e=0;e<=143;)u[2*e+1]=8,e++,r[8]++;for(;e<=255;)u[2*e+1]=9,e++,r[9]++;for(;e<=279;)u[2*e+1]=7,e++,r[7]++;for(;e<=287;)u[2*e+1]=8,e++,r[8]++;for(gen_codes(u,287,r),e=0;e<o;e++)c[2*e+1]=5,c[2*e]=bi_reverse(e,5);w=new StaticTreeDesc(u,h,257,s,l),p=new StaticTreeDesc(c,d,0,o,l),k=new StaticTreeDesc(new Array(0),_,0,19,7)}(),y=!0),e.l_desc=new TreeDesc(e.dyn_ltree,w),e.d_desc=new TreeDesc(e.dyn_dtree,p),e.bl_desc=new TreeDesc(e.bl_tree,k),e.bi_buf=0,e.bi_valid=0,init_block(e)},n._tr_stored_block=_tr_stored_block,n._tr_flush_block=function _tr_flush_block(e,t,a,n){var i,s,o=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=function detect_data_type(e){var t,a=4093624447;for(t=0;t<=31;t++,a>>>=1)if(1&a&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<r;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),build_tree(e,e.l_desc),build_tree(e,e.d_desc),o=function build_bl_tree(e){var t;for(scan_tree(e,e.dyn_ltree,e.l_desc.max_code),scan_tree(e,e.dyn_dtree,e.d_desc.max_code),build_tree(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*f[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(s=e.static_len+3+7>>>3)<=i&&(i=s)):i=s=a+5,a+4<=i&&-1!==t?_tr_stored_block(e,t,a,n):4===e.strategy||s===i?(send_bits(e,2+(n?1:0),3),compress_block(e,u,c)):(send_bits(e,4+(n?1:0),3),function send_all_trees(e,t,a,n){var i;for(send_bits(e,t-257,5),send_bits(e,a-1,5),send_bits(e,n-4,4),i=0;i<n;i++)send_bits(e,e.bl_tree[2*f[i]+1],3);send_tree(e,e.dyn_ltree,t-1),send_tree(e,e.dyn_dtree,a-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,o+1),compress_block(e,e.dyn_ltree,e.dyn_dtree)),init_block(e),n&&bi_windup(e)},n._tr_tally=function _tr_tally(e,t,a){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&a,e.last_lit++,0===t?e.dyn_ltree[2*a]++:(e.matches++,t--,e.dyn_ltree[2*(m[a]+r+1)]++,e.dyn_dtree[2*d_code(t)]++),e.last_lit===e.lit_bufsize-1},n._tr_align=function _tr_align(e){send_bits(e,2,3),send_code(e,256,u),function bi_flush(e){16===e.bi_valid?(put_short(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)};var z=function adler32$2(e,t,a,n){for(var i=65535&e,r=e>>>16&65535,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{r=r+(i=i+t[n++]|0)|0}while(--s);i%=65521,r%=65521}return i|r<<16};var x=function makeTable(){for(var e,t=[],a=0;a<256;a++){e=a;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[a]=e}return t}();var S,D=function crc32$2(e,t,a,n){var i=x,r=n+a;e^=-1;for(var s=n;s<r;s++)e=e>>>8^i[255&(e^t[s])];return~e},B={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},I=e,A=n,E=z,R=D,T=B,C=-2,F=258,Z=262,$=103,N=113,O=666;function err(e,t){return e.msg=T[t],t}function rank(e){return(e<<1)-(e>4?9:0)}function zero(e){for(var t=e.length;--t>=0;)e[t]=0}function flush_pending(e){var t=e.state,a=t.pending;a>e.avail_out&&(a=e.avail_out),0!==a&&(I.arraySet(e.output,t.pending_buf,t.pending_out,a,e.next_out),e.next_out+=a,t.pending_out+=a,e.total_out+=a,e.avail_out-=a,t.pending-=a,0===t.pending&&(t.pending_out=0))}function flush_block_only(e,t){A._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,flush_pending(e.strm)}function put_byte(e,t){e.pending_buf[e.pending++]=t}function putShortMSB(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function longest_match(e,t){var a,n,i=e.max_chain_length,r=e.strstart,s=e.prev_length,o=e.nice_match,l=e.strstart>e.w_size-Z?e.strstart-(e.w_size-Z):0,h=e.window,d=e.w_mask,_=e.prev,f=e.strstart+F,u=h[r+s-1],c=h[r+s];e.prev_length>=e.good_match&&(i>>=2),o>e.lookahead&&(o=e.lookahead);do{if(h[(a=t)+s]===c&&h[a+s-1]===u&&h[a]===h[r]&&h[++a]===h[r+1]){r+=2,a++;do{}while(h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&h[++r]===h[++a]&&r<f);if(n=F-(f-r),r=f-F,n>s){if(e.match_start=t,s=n,n>=o)break;u=h[r+s-1],c=h[r+s]}}}while((t=_[t&d])>l&&0!=--i);return s<=e.lookahead?s:e.lookahead}function fill_window(e){var t,a,n,i,r,s,o,l,h,d,_=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=_+(_-Z)){I.arraySet(e.window,e.window,_,_,0),e.match_start-=_,e.strstart-=_,e.block_start-=_,t=a=e.hash_size;do{n=e.head[--t],e.head[t]=n>=_?n-_:0}while(--a);t=a=_;do{n=e.prev[--t],e.prev[t]=n>=_?n-_:0}while(--a);i+=_}if(0===e.strm.avail_in)break;if(s=e.strm,o=e.window,l=e.strstart+e.lookahead,h=i,d=void 0,(d=s.avail_in)>h&&(d=h),a=0===d?0:(s.avail_in-=d,I.arraySet(o,s.input,s.next_in,d,l),1===s.state.wrap?s.adler=E(s.adler,o,d,l):2===s.state.wrap&&(s.adler=R(s.adler,o,d,l)),s.next_in+=d,s.total_in+=d,d),e.lookahead+=a,e.lookahead+e.insert>=3)for(r=e.strstart-e.insert,e.ins_h=e.window[r],e.ins_h=(e.ins_h<<e.hash_shift^e.window[r+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[r+3-1])&e.hash_mask,e.prev[r&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=r,r++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<Z&&0!==e.strm.avail_in)}function deflate_fast(e,t){for(var a,n;;){if(e.lookahead<Z){if(fill_window(e),e.lookahead<Z&&0===t)return 1;if(0===e.lookahead)break}if(a=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,a=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==a&&e.strstart-a<=e.w_size-Z&&(e.match_length=longest_match(e,a)),e.match_length>=3)if(n=A._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,a=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=A._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(flush_block_only(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,4===t?(flush_block_only(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(flush_block_only(e,!1),0===e.strm.avail_out)?1:2}function deflate_slow(e,t){for(var a,n,i;;){if(e.lookahead<Z){if(fill_window(e),e.lookahead<Z&&0===t)return 1;if(0===e.lookahead)break}if(a=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,a=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==a&&e.prev_length<e.max_lazy_match&&e.strstart-a<=e.w_size-Z&&(e.match_length=longest_match(e,a),e.match_length<=5&&(1===e.strategy||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,n=A._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,a=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,n&&(flush_block_only(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((n=A._tr_tally(e,0,e.window[e.strstart-1]))&&flush_block_only(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=A._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,4===t?(flush_block_only(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(flush_block_only(e,!1),0===e.strm.avail_out)?1:2}function Config(e,t,a,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=a,this.max_chain=n,this.func=i}function DeflateState(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new I.Buf16(1146),this.dyn_dtree=new I.Buf16(122),this.bl_tree=new I.Buf16(78),zero(this.dyn_ltree),zero(this.dyn_dtree),zero(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new I.Buf16(16),this.heap=new I.Buf16(573),zero(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new I.Buf16(573),zero(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function deflateResetKeep(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=2,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?42:N,e.adler=2===t.wrap?0:1,t.last_flush=0,A._tr_init(t),0):err(e,C)}function deflateReset(e){var t=deflateResetKeep(e);return 0===t&&function lm_init(e){e.window_size=2*e.w_size,zero(e.head),e.max_lazy_match=S[e.level].max_lazy,e.good_match=S[e.level].good_length,e.nice_match=S[e.level].nice_length,e.max_chain_length=S[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0}(e.state),t}function deflateInit2(e,t,a,n,i,r){if(!e)return C;var s=1;if(-1===t&&(t=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),i<1||i>9||8!==a||n<8||n>15||t<0||t>9||r<0||r>4)return err(e,C);8===n&&(n=9);var o=new DeflateState;return e.state=o,o.strm=e,o.wrap=s,o.gzhead=null,o.w_bits=n,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=i+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+3-1)/3),o.window=new I.Buf8(2*o.w_size),o.head=new I.Buf16(o.hash_size),o.prev=new I.Buf16(o.w_size),o.lit_bufsize=1<<i+6,o.pending_buf_size=4*o.lit_bufsize,o.pending_buf=new I.Buf8(o.pending_buf_size),o.d_buf=1*o.lit_bufsize,o.l_buf=3*o.lit_bufsize,o.level=t,o.strategy=r,o.method=a,deflateReset(e)}S=[new Config(0,0,0,0,(function deflate_stored(e,t){var a=65535;for(a>e.pending_buf_size-5&&(a=e.pending_buf_size-5);;){if(e.lookahead<=1){if(fill_window(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+a;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,flush_block_only(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-Z&&(flush_block_only(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(flush_block_only(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(flush_block_only(e,!1),e.strm.avail_out),1)})),new Config(4,4,8,4,deflate_fast),new Config(4,5,16,8,deflate_fast),new Config(4,6,32,32,deflate_fast),new Config(4,4,16,16,deflate_slow),new Config(8,16,32,32,deflate_slow),new Config(8,16,128,128,deflate_slow),new Config(8,32,128,256,deflate_slow),new Config(32,128,258,1024,deflate_slow),new Config(32,258,258,4096,deflate_slow)],a.deflateInit=function deflateInit(e,t){return deflateInit2(e,t,8,15,8,0)},a.deflateInit2=deflateInit2,a.deflateReset=deflateReset,a.deflateResetKeep=deflateResetKeep,a.deflateSetHeader=function deflateSetHeader(e,t){return e&&e.state?2!==e.state.wrap?C:(e.state.gzhead=t,0):C},a.deflate=function deflate$2(e,t){var a,n,i,r;if(!e||!e.state||t>5||t<0)return e?err(e,C):C;if(n=e.state,!e.output||!e.input&&0!==e.avail_in||n.status===O&&4!==t)return err(e,0===e.avail_out?-5:C);if(n.strm=e,a=n.last_flush,n.last_flush=t,42===n.status)if(2===n.wrap)e.adler=0,put_byte(n,31),put_byte(n,139),put_byte(n,8),n.gzhead?(put_byte(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),put_byte(n,255&n.gzhead.time),put_byte(n,n.gzhead.time>>8&255),put_byte(n,n.gzhead.time>>16&255),put_byte(n,n.gzhead.time>>24&255),put_byte(n,9===n.level?2:n.strategy>=2||n.level<2?4:0),put_byte(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(put_byte(n,255&n.gzhead.extra.length),put_byte(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=R(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(put_byte(n,0),put_byte(n,0),put_byte(n,0),put_byte(n,0),put_byte(n,0),put_byte(n,9===n.level?2:n.strategy>=2||n.level<2?4:0),put_byte(n,3),n.status=N);else{var s=8+(n.w_bits-8<<4)<<8;s|=(n.strategy>=2||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(s|=32),s+=31-s%31,n.status=N,putShortMSB(n,s),0!==n.strstart&&(putShortMSB(n,e.adler>>>16),putShortMSB(n,65535&e.adler)),e.adler=1}if(69===n.status)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>i&&(e.adler=R(e.adler,n.pending_buf,n.pending-i,i)),flush_pending(e),i=n.pending,n.pending!==n.pending_buf_size));)put_byte(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(e.adler=R(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=R(e.adler,n.pending_buf,n.pending-i,i)),flush_pending(e),i=n.pending,n.pending===n.pending_buf_size)){r=1;break}r=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,put_byte(n,r)}while(0!==r);n.gzhead.hcrc&&n.pending>i&&(e.adler=R(e.adler,n.pending_buf,n.pending-i,i)),0===r&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=R(e.adler,n.pending_buf,n.pending-i,i)),flush_pending(e),i=n.pending,n.pending===n.pending_buf_size)){r=1;break}r=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,put_byte(n,r)}while(0!==r);n.gzhead.hcrc&&n.pending>i&&(e.adler=R(e.adler,n.pending_buf,n.pending-i,i)),0===r&&(n.status=$)}else n.status=$;if(n.status===$&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&flush_pending(e),n.pending+2<=n.pending_buf_size&&(put_byte(n,255&e.adler),put_byte(n,e.adler>>8&255),e.adler=0,n.status=N)):n.status=N),0!==n.pending){if(flush_pending(e),0===e.avail_out)return n.last_flush=-1,0}else if(0===e.avail_in&&rank(t)<=rank(a)&&4!==t)return err(e,-5);if(n.status===O&&0!==e.avail_in)return err(e,-5);if(0!==e.avail_in||0!==n.lookahead||0!==t&&n.status!==O){var o=2===n.strategy?function deflate_huff(e,t){for(var a;;){if(0===e.lookahead&&(fill_window(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,a=A._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,a&&(flush_block_only(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(flush_block_only(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(flush_block_only(e,!1),0===e.strm.avail_out)?1:2}(n,t):3===n.strategy?function deflate_rle(e,t){for(var a,n,i,r,s=e.window;;){if(e.lookahead<=F){if(fill_window(e),e.lookahead<=F&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(n=s[i=e.strstart-1])===s[++i]&&n===s[++i]&&n===s[++i]){r=e.strstart+F;do{}while(n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&n===s[++i]&&i<r);e.match_length=F-(r-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(a=A._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(a=A._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),a&&(flush_block_only(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(flush_block_only(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(flush_block_only(e,!1),0===e.strm.avail_out)?1:2}(n,t):S[n.level].func(n,t);if(3!==o&&4!==o||(n.status=O),1===o||3===o)return 0===e.avail_out&&(n.last_flush=-1),0;if(2===o&&(1===t?A._tr_align(n):5!==t&&(A._tr_stored_block(n,0,0,!1),3===t&&(zero(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),flush_pending(e),0===e.avail_out))return n.last_flush=-1,0}return 4!==t?0:n.wrap<=0?1:(2===n.wrap?(put_byte(n,255&e.adler),put_byte(n,e.adler>>8&255),put_byte(n,e.adler>>16&255),put_byte(n,e.adler>>24&255),put_byte(n,255&e.total_in),put_byte(n,e.total_in>>8&255),put_byte(n,e.total_in>>16&255),put_byte(n,e.total_in>>24&255)):(putShortMSB(n,e.adler>>>16),putShortMSB(n,65535&e.adler)),flush_pending(e),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?0:1)},a.deflateEnd=function deflateEnd(e){var t;return e&&e.state?42!==(t=e.state.status)&&69!==t&&73!==t&&91!==t&&t!==$&&t!==N&&t!==O?err(e,C):(e.state=null,t===N?err(e,-3):0):C},a.deflateSetDictionary=function deflateSetDictionary(e,t){var a,n,i,r,s,o,l,h,d=t.length;if(!e||!e.state)return C;if(2===(r=(a=e.state).wrap)||1===r&&42!==a.status||a.lookahead)return C;for(1===r&&(e.adler=E(e.adler,t,d,0)),a.wrap=0,d>=a.w_size&&(0===r&&(zero(a.head),a.strstart=0,a.block_start=0,a.insert=0),h=new I.Buf8(a.w_size),I.arraySet(h,t,d-a.w_size,a.w_size,0),t=h,d=a.w_size),s=e.avail_in,o=e.next_in,l=e.input,e.avail_in=d,e.next_in=0,e.input=t,fill_window(a);a.lookahead>=3;){n=a.strstart,i=a.lookahead-2;do{a.ins_h=(a.ins_h<<a.hash_shift^a.window[n+3-1])&a.hash_mask,a.prev[n&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=n,n++}while(--i);a.strstart=n,a.lookahead=2,fill_window(a)}return a.strstart+=a.lookahead,a.block_start=a.strstart,a.insert=a.lookahead,a.lookahead=0,a.match_length=a.prev_length=2,a.match_available=0,e.next_in=o,e.input=l,e.avail_in=s,a.wrap=r,0},a.deflateInfo="pako deflate (from Nodeca project)";var U={},M=e,L=!0,j=!0;try{String.fromCharCode.apply(null,[0])}catch(e){L=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){j=!1}for(var H=new M.Buf8(256),K=0;K<256;K++)H[K]=K>=252?6:K>=248?5:K>=240?4:K>=224?3:K>=192?2:1;function buf2binstring(e,t){if(t<65537&&(e.subarray&&j||!e.subarray&&L))return String.fromCharCode.apply(null,M.shrinkBuf(e,t));for(var a="",n=0;n<t;n++)a+=String.fromCharCode(e[n]);return a}H[254]=H[254]=1,U.string2buf=function(e){var t,a,n,i,r,s=e.length,o=0;for(i=0;i<s;i++)55296==(64512&(a=e.charCodeAt(i)))&&i+1<s&&56320==(64512&(n=e.charCodeAt(i+1)))&&(a=65536+(a-55296<<10)+(n-56320),i++),o+=a<128?1:a<2048?2:a<65536?3:4;for(t=new M.Buf8(o),r=0,i=0;r<o;i++)55296==(64512&(a=e.charCodeAt(i)))&&i+1<s&&56320==(64512&(n=e.charCodeAt(i+1)))&&(a=65536+(a-55296<<10)+(n-56320),i++),a<128?t[r++]=a:a<2048?(t[r++]=192|a>>>6,t[r++]=128|63&a):a<65536?(t[r++]=224|a>>>12,t[r++]=128|a>>>6&63,t[r++]=128|63&a):(t[r++]=240|a>>>18,t[r++]=128|a>>>12&63,t[r++]=128|a>>>6&63,t[r++]=128|63&a);return t},U.buf2binstring=function(e){return buf2binstring(e,e.length)},U.binstring2buf=function(e){for(var t=new M.Buf8(e.length),a=0,n=t.length;a<n;a++)t[a]=e.charCodeAt(a);return t},U.buf2string=function(e,t){var a,n,i,r,s=t||e.length,o=new Array(2*s);for(n=0,a=0;a<s;)if((i=e[a++])<128)o[n++]=i;else if((r=H[i])>4)o[n++]=65533,a+=r-1;else{for(i&=2===r?31:3===r?15:7;r>1&&a<s;)i=i<<6|63&e[a++],r--;r>1?o[n++]=65533:i<65536?o[n++]=i:(i-=65536,o[n++]=55296|i>>10&1023,o[n++]=56320|1023&i)}return buf2binstring(o,n)},U.utf8border=function(e,t){var a;for((t=t||e.length)>e.length&&(t=e.length),a=t-1;a>=0&&128==(192&e[a]);)a--;return a<0||0===a?t:a+H[e[a]]>t?a:t};var P=function ZStream$2(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},Y=a,G=e,q=U,W=B,X=P,J=Object.prototype.toString;function Deflate(e){if(!(this instanceof Deflate))return new Deflate(e);this.options=G.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new X,this.strm.avail_out=0;var a=Y.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==a)throw new Error(W[a]);if(t.header&&Y.deflateSetHeader(this.strm,t.header),t.dictionary){var n;if(n="string"==typeof t.dictionary?q.string2buf(t.dictionary):"[object ArrayBuffer]"===J.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(a=Y.deflateSetDictionary(this.strm,n)))throw new Error(W[a]);this._dict_set=!0}}function deflate$1(e,t){var a=new Deflate(t);if(a.push(e,!0),a.err)throw a.msg;return a.result}Deflate.prototype.push=function(e,t){var a,n,i=this.strm,r=this.options.chunkSize;if(this.ended)return!1;n=t===~~t?t:!0===t?4:0,"string"==typeof e?i.input=q.string2buf(e):"[object ArrayBuffer]"===J.call(e)?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;do{if(0===i.avail_out&&(i.output=new G.Buf8(r),i.next_out=0,i.avail_out=r),1!==(a=Y.deflate(i,n))&&0!==a)return this.onEnd(a),this.ended=!0,!1;0!==i.avail_out&&(0!==i.avail_in||4!==n&&2!==n)||("string"===this.options.to?this.onData(q.buf2binstring(G.shrinkBuf(i.output,i.next_out))):this.onData(G.shrinkBuf(i.output,i.next_out)))}while((i.avail_in>0||0===i.avail_out)&&1!==a);return 4===n?(a=Y.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,0===a):2!==n||(this.onEnd(0),i.avail_out=0,!0)},Deflate.prototype.onData=function(e){this.chunks.push(e)},Deflate.prototype.onEnd=function(e){0===e&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=G.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Deflate=Deflate,t.deflate=deflate$1,t.deflateRaw=function deflateRaw(e,t){return(t=t||{}).raw=!0,deflate$1(e,t)},t.gzip=function gzip(e,t){return(t=t||{}).gzip=!0,deflate$1(e,t)};var Q={},V={},ee=e,te=15,ae=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],ne=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],ie=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],re=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64],se=e,oe=z,le=D,he=function inflate_fast(e,t){var a,n,i,r,s,o,l,h,d,_,f,u,c,g,m,b,w,p,k,v,y,z,x,S,D;a=e.state,n=e.next_in,S=e.input,i=n+(e.avail_in-5),r=e.next_out,D=e.output,s=r-(t-e.avail_out),o=r+(e.avail_out-257),l=a.dmax,h=a.wsize,d=a.whave,_=a.wnext,f=a.window,u=a.hold,c=a.bits,g=a.lencode,m=a.distcode,b=(1<<a.lenbits)-1,w=(1<<a.distbits)-1;e:do{c<15&&(u+=S[n++]<<c,c+=8,u+=S[n++]<<c,c+=8),p=g[u&b];t:for(;;){if(u>>>=k=p>>>24,c-=k,0===(k=p>>>16&255))D[r++]=65535&p;else{if(!(16&k)){if(64&k){if(32&k){a.mode=12;break e}e.msg="invalid literal/length code",a.mode=30;break e}p=g[(65535&p)+(u&(1<<k)-1)];continue t}for(v=65535&p,(k&=15)&&(c<k&&(u+=S[n++]<<c,c+=8),v+=u&(1<<k)-1,u>>>=k,c-=k),c<15&&(u+=S[n++]<<c,c+=8,u+=S[n++]<<c,c+=8),p=m[u&w];;){if(u>>>=k=p>>>24,c-=k,16&(k=p>>>16&255)){if(y=65535&p,c<(k&=15)&&(u+=S[n++]<<c,(c+=8)<k&&(u+=S[n++]<<c,c+=8)),(y+=u&(1<<k)-1)>l){e.msg="invalid distance too far back",a.mode=30;break e}if(u>>>=k,c-=k,y>(k=r-s)){if((k=y-k)>d&&a.sane){e.msg="invalid distance too far back",a.mode=30;break e}if(z=0,x=f,0===_){if(z+=h-k,k<v){v-=k;do{D[r++]=f[z++]}while(--k);z=r-y,x=D}}else if(_<k){if(z+=h+_-k,(k-=_)<v){v-=k;do{D[r++]=f[z++]}while(--k);if(z=0,_<v){v-=k=_;do{D[r++]=f[z++]}while(--k);z=r-y,x=D}}}else if(z+=_-k,k<v){v-=k;do{D[r++]=f[z++]}while(--k);z=r-y,x=D}for(;v>2;)D[r++]=x[z++],D[r++]=x[z++],D[r++]=x[z++],v-=3;v&&(D[r++]=x[z++],v>1&&(D[r++]=x[z++]))}else{z=r-y;do{D[r++]=D[z++],D[r++]=D[z++],D[r++]=D[z++],v-=3}while(v>2);v&&(D[r++]=D[z++],v>1&&(D[r++]=D[z++]))}break}if(64&k){e.msg="invalid distance code",a.mode=30;break e}p=m[(65535&p)+(u&(1<<k)-1)]}}break}}while(n<i&&r<o);n-=v=c>>3,u&=(1<<(c-=v<<3))-1,e.next_in=n,e.next_out=r,e.avail_in=n<i?i-n+5:5-(n-i),e.avail_out=r<o?o-r+257:257-(r-o),a.hold=u,a.bits=c},de=function inflate_table(e,t,a,n,i,r,s,o){var l,h,d,_,f,u,c,g,m,b=o.bits,w=0,p=0,k=0,v=0,y=0,z=0,x=0,S=0,D=0,B=0,I=null,A=0,E=new ee.Buf16(16),R=new ee.Buf16(16),T=null,C=0;for(w=0;w<=te;w++)E[w]=0;for(p=0;p<n;p++)E[t[a+p]]++;for(y=b,v=te;v>=1&&0===E[v];v--);if(y>v&&(y=v),0===v)return i[r++]=20971520,i[r++]=20971520,o.bits=1,0;for(k=1;k<v&&0===E[k];k++);for(y<k&&(y=k),S=1,w=1;w<=te;w++)if(S<<=1,(S-=E[w])<0)return-1;if(S>0&&(0===e||1!==v))return-1;for(R[1]=0,w=1;w<te;w++)R[w+1]=R[w]+E[w];for(p=0;p<n;p++)0!==t[a+p]&&(s[R[t[a+p]]++]=p);if(0===e?(I=T=s,u=19):1===e?(I=ae,A-=257,T=ne,C-=257,u=256):(I=ie,T=re,u=-1),B=0,p=0,w=k,f=r,z=y,x=0,d=-1,_=(D=1<<y)-1,1===e&&D>852||2===e&&D>592)return 1;for(;;){c=w-x,s[p]<u?(g=0,m=s[p]):s[p]>u?(g=T[C+s[p]],m=I[A+s[p]]):(g=96,m=0),l=1<<w-x,k=h=1<<z;do{i[f+(B>>x)+(h-=l)]=c<<24|g<<16|m}while(0!==h);for(l=1<<w-1;B&l;)l>>=1;if(0!==l?(B&=l-1,B+=l):B=0,p++,0==--E[w]){if(w===v)break;w=t[a+s[p]]}if(w>y&&(B&_)!==d){for(0===x&&(x=y),f+=k,S=1<<(z=w-x);z+x<v&&!((S-=E[z+x])<=0);)z++,S<<=1;if(D+=1<<z,1===e&&D>852||2===e&&D>592)return 1;i[d=B&_]=y<<24|z<<16|f-r}}return 0!==B&&(i[f+B]=w-x<<24|64<<16),o.bits=y,0},_e=-2,fe=12,ue=30;function zswap32(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function InflateState(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new se.Buf16(320),this.work=new se.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function inflateResetKeep(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new se.Buf32(852),t.distcode=t.distdyn=new se.Buf32(592),t.sane=1,t.back=-1,0):_e}function inflateReset(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,inflateResetKeep(e)):_e}function inflateReset2(e,t){var a,n;return e&&e.state?(n=e.state,t<0?(a=0,t=-t):(a=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?_e:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=a,n.wbits=t,inflateReset(e))):_e}function inflateInit2(e,t){var a,n;return e?(n=new InflateState,e.state=n,n.window=null,0!==(a=inflateReset2(e,t))&&(e.state=null),a):_e}var ce,ge,me=!0;function fixedtables(e){if(me){var t;for(ce=new se.Buf32(512),ge=new se.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(de(1,e.lens,0,288,ce,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;de(2,e.lens,0,32,ge,0,e.work,{bits:5}),me=!1}e.lencode=ce,e.lenbits=9,e.distcode=ge,e.distbits=5}function updatewindow(e,t,a,n){var i,r=e.state;return null===r.window&&(r.wsize=1<<r.wbits,r.wnext=0,r.whave=0,r.window=new se.Buf8(r.wsize)),n>=r.wsize?(se.arraySet(r.window,t,a-r.wsize,r.wsize,0),r.wnext=0,r.whave=r.wsize):((i=r.wsize-r.wnext)>n&&(i=n),se.arraySet(r.window,t,a-n,i,r.wnext),(n-=i)?(se.arraySet(r.window,t,a-n,n,0),r.wnext=n,r.whave=r.wsize):(r.wnext+=i,r.wnext===r.wsize&&(r.wnext=0),r.whave<r.wsize&&(r.whave+=i))),0}V.inflateReset=inflateReset,V.inflateReset2=inflateReset2,V.inflateResetKeep=inflateResetKeep,V.inflateInit=function inflateInit(e){return inflateInit2(e,15)},V.inflateInit2=inflateInit2,V.inflate=function inflate$2(e,t){var a,n,i,r,s,o,l,h,d,_,f,u,c,g,m,b,w,p,k,v,y,z,x,S,D=0,B=new se.Buf8(4),I=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return _e;(a=e.state).mode===fe&&(a.mode=13),s=e.next_out,i=e.output,l=e.avail_out,r=e.next_in,n=e.input,o=e.avail_in,h=a.hold,d=a.bits,_=o,f=l,z=0;e:for(;;)switch(a.mode){case 1:if(0===a.wrap){a.mode=13;break}for(;d<16;){if(0===o)break e;o--,h+=n[r++]<<d,d+=8}if(2&a.wrap&&35615===h){a.check=0,B[0]=255&h,B[1]=h>>>8&255,a.check=le(a.check,B,2,0),h=0,d=0,a.mode=2;break}if(a.flags=0,a.head&&(a.head.done=!1),!(1&a.wrap)||(((255&h)<<8)+(h>>8))%31){e.msg="incorrect header check",a.mode=ue;break}if(8!=(15&h)){e.msg="unknown compression method",a.mode=ue;break}if(d-=4,y=8+(15&(h>>>=4)),0===a.wbits)a.wbits=y;else if(y>a.wbits){e.msg="invalid window size",a.mode=ue;break}a.dmax=1<<y,e.adler=a.check=1,a.mode=512&h?10:fe,h=0,d=0;break;case 2:for(;d<16;){if(0===o)break e;o--,h+=n[r++]<<d,d+=8}if(a.flags=h,8!=(255&a.flags)){e.msg="unknown compression method",a.mode=ue;break}if(57344&a.flags){e.msg="unknown header flags set",a.mode=ue;break}a.head&&(a.head.text=h>>8&1),512&a.flags&&(B[0]=255&h,B[1]=h>>>8&255,a.check=le(a.check,B,2,0)),h=0,d=0,a.mode=3;case 3:for(;d<32;){if(0===o)break e;o--,h+=n[r++]<<d,d+=8}a.head&&(a.head.time=h),512&a.flags&&(B[0]=255&h,B[1]=h>>>8&255,B[2]=h>>>16&255,B[3]=h>>>24&255,a.check=le(a.check,B,4,0)),h=0,d=0,a.mode=4;case 4:for(;d<16;){if(0===o)break e;o--,h+=n[r++]<<d,d+=8}a.head&&(a.head.xflags=255&h,a.head.os=h>>8),512&a.flags&&(B[0]=255&h,B[1]=h>>>8&255,a.check=le(a.check,B,2,0)),h=0,d=0,a.mode=5;case 5:if(1024&a.flags){for(;d<16;){if(0===o)break e;o--,h+=n[r++]<<d,d+=8}a.length=h,a.head&&(a.head.extra_len=h),512&a.flags&&(B[0]=255&h,B[1]=h>>>8&255,a.check=le(a.check,B,2,0)),h=0,d=0}else a.head&&(a.head.extra=null);a.mode=6;case 6:if(1024&a.flags&&((u=a.length)>o&&(u=o),u&&(a.head&&(y=a.head.extra_len-a.length,a.head.extra||(a.head.extra=new Array(a.head.extra_len)),se.arraySet(a.head.extra,n,r,u,y)),512&a.flags&&(a.check=le(a.check,n,u,r)),o-=u,r+=u,a.length-=u),a.length))break e;a.length=0,a.mode=7;case 7:if(2048&a.flags){if(0===o)break e;u=0;do{y=n[r+u++],a.head&&y&&a.length<65536&&(a.head.name+=String.fromCharCode(y))}while(y&&u<o);if(512&a.flags&&(a.check=le(a.check,n,u,r)),o-=u,r+=u,y)break e}else a.head&&(a.head.name=null);a.length=0,a.mode=8;case 8:if(4096&a.flags){if(0===o)break e;u=0;do{y=n[r+u++],a.head&&y&&a.length<65536&&(a.head.comment+=String.fromCharCode(y))}while(y&&u<o);if(512&a.flags&&(a.check=le(a.check,n,u,r)),o-=u,r+=u,y)break e}else a.head&&(a.head.comment=null);a.mode=9;case 9:if(512&a.flags){for(;d<16;){if(0===o)break e;o--,h+=n[r++]<<d,d+=8}if(h!==(65535&a.check)){e.msg="header crc mismatch",a.mode=ue;break}h=0,d=0}a.head&&(a.head.hcrc=a.flags>>9&1,a.head.done=!0),e.adler=a.check=0,a.mode=fe;break;case 10:for(;d<32;){if(0===o)break e;o--,h+=n[r++]<<d,d+=8}e.adler=a.check=zswap32(h),h=0,d=0,a.mode=11;case 11:if(0===a.havedict)return e.next_out=s,e.avail_out=l,e.next_in=r,e.avail_in=o,a.hold=h,a.bits=d,2;e.adler=a.check=1,a.mode=fe;case fe:if(5===t||6===t)break e;case 13:if(a.last){h>>>=7&d,d-=7&d,a.mode=27;break}for(;d<3;){if(0===o)break e;o--,h+=n[r++]<<d,d+=8}switch(a.last=1&h,d-=1,3&(h>>>=1)){case 0:a.mode=14;break;case 1:if(fixedtables(a),a.mode=20,6===t){h>>>=2,d-=2;break e}break;case 2:a.mode=17;break;case 3:e.msg="invalid block type",a.mode=ue}h>>>=2,d-=2;break;case 14:for(h>>>=7&d,d-=7&d;d<32;){if(0===o)break e;o--,h+=n[r++]<<d,d+=8}if((65535&h)!=(h>>>16^65535)){e.msg="invalid stored block lengths",a.mode=ue;break}if(a.length=65535&h,h=0,d=0,a.mode=15,6===t)break e;case 15:a.mode=16;case 16:if(u=a.length){if(u>o&&(u=o),u>l&&(u=l),0===u)break e;se.arraySet(i,n,r,u,s),o-=u,r+=u,l-=u,s+=u,a.length-=u;break}a.mode=fe;break;case 17:for(;d<14;){if(0===o)break e;o--,h+=n[r++]<<d,d+=8}if(a.nlen=257+(31&h),h>>>=5,d-=5,a.ndist=1+(31&h),h>>>=5,d-=5,a.ncode=4+(15&h),h>>>=4,d-=4,a.nlen>286||a.ndist>30){e.msg="too many length or distance symbols",a.mode=ue;break}a.have=0,a.mode=18;case 18:for(;a.have<a.ncode;){for(;d<3;){if(0===o)break e;o--,h+=n[r++]<<d,d+=8}a.lens[I[a.have++]]=7&h,h>>>=3,d-=3}for(;a.have<19;)a.lens[I[a.have++]]=0;if(a.lencode=a.lendyn,a.lenbits=7,x={bits:a.lenbits},z=de(0,a.lens,0,19,a.lencode,0,a.work,x),a.lenbits=x.bits,z){e.msg="invalid code lengths set",a.mode=ue;break}a.have=0,a.mode=19;case 19:for(;a.have<a.nlen+a.ndist;){for(;b=(D=a.lencode[h&(1<<a.lenbits)-1])>>>16&255,w=65535&D,!((m=D>>>24)<=d);){if(0===o)break e;o--,h+=n[r++]<<d,d+=8}if(w<16)h>>>=m,d-=m,a.lens[a.have++]=w;else{if(16===w){for(S=m+2;d<S;){if(0===o)break e;o--,h+=n[r++]<<d,d+=8}if(h>>>=m,d-=m,0===a.have){e.msg="invalid bit length repeat",a.mode=ue;break}y=a.lens[a.have-1],u=3+(3&h),h>>>=2,d-=2}else if(17===w){for(S=m+3;d<S;){if(0===o)break e;o--,h+=n[r++]<<d,d+=8}d-=m,y=0,u=3+(7&(h>>>=m)),h>>>=3,d-=3}else{for(S=m+7;d<S;){if(0===o)break e;o--,h+=n[r++]<<d,d+=8}d-=m,y=0,u=11+(127&(h>>>=m)),h>>>=7,d-=7}if(a.have+u>a.nlen+a.ndist){e.msg="invalid bit length repeat",a.mode=ue;break}for(;u--;)a.lens[a.have++]=y}}if(a.mode===ue)break;if(0===a.lens[256]){e.msg="invalid code -- missing end-of-block",a.mode=ue;break}if(a.lenbits=9,x={bits:a.lenbits},z=de(1,a.lens,0,a.nlen,a.lencode,0,a.work,x),a.lenbits=x.bits,z){e.msg="invalid literal/lengths set",a.mode=ue;break}if(a.distbits=6,a.distcode=a.distdyn,x={bits:a.distbits},z=de(2,a.lens,a.nlen,a.ndist,a.distcode,0,a.work,x),a.distbits=x.bits,z){e.msg="invalid distances set",a.mode=ue;break}if(a.mode=20,6===t)break e;case 20:a.mode=21;case 21:if(o>=6&&l>=258){e.next_out=s,e.avail_out=l,e.next_in=r,e.avail_in=o,a.hold=h,a.bits=d,he(e,f),s=e.next_out,i=e.output,l=e.avail_out,r=e.next_in,n=e.input,o=e.avail_in,h=a.hold,d=a.bits,a.mode===fe&&(a.back=-1);break}for(a.back=0;b=(D=a.lencode[h&(1<<a.lenbits)-1])>>>16&255,w=65535&D,!((m=D>>>24)<=d);){if(0===o)break e;o--,h+=n[r++]<<d,d+=8}if(b&&!(240&b)){for(p=m,k=b,v=w;b=(D=a.lencode[v+((h&(1<<p+k)-1)>>p)])>>>16&255,w=65535&D,!(p+(m=D>>>24)<=d);){if(0===o)break e;o--,h+=n[r++]<<d,d+=8}h>>>=p,d-=p,a.back+=p}if(h>>>=m,d-=m,a.back+=m,a.length=w,0===b){a.mode=26;break}if(32&b){a.back=-1,a.mode=fe;break}if(64&b){e.msg="invalid literal/length code",a.mode=ue;break}a.extra=15&b,a.mode=22;case 22:if(a.extra){for(S=a.extra;d<S;){if(0===o)break e;o--,h+=n[r++]<<d,d+=8}a.length+=h&(1<<a.extra)-1,h>>>=a.extra,d-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=23;case 23:for(;b=(D=a.distcode[h&(1<<a.distbits)-1])>>>16&255,w=65535&D,!((m=D>>>24)<=d);){if(0===o)break e;o--,h+=n[r++]<<d,d+=8}if(!(240&b)){for(p=m,k=b,v=w;b=(D=a.distcode[v+((h&(1<<p+k)-1)>>p)])>>>16&255,w=65535&D,!(p+(m=D>>>24)<=d);){if(0===o)break e;o--,h+=n[r++]<<d,d+=8}h>>>=p,d-=p,a.back+=p}if(h>>>=m,d-=m,a.back+=m,64&b){e.msg="invalid distance code",a.mode=ue;break}a.offset=w,a.extra=15&b,a.mode=24;case 24:if(a.extra){for(S=a.extra;d<S;){if(0===o)break e;o--,h+=n[r++]<<d,d+=8}a.offset+=h&(1<<a.extra)-1,h>>>=a.extra,d-=a.extra,a.back+=a.extra}if(a.offset>a.dmax){e.msg="invalid distance too far back",a.mode=ue;break}a.mode=25;case 25:if(0===l)break e;if(u=f-l,a.offset>u){if((u=a.offset-u)>a.whave&&a.sane){e.msg="invalid distance too far back",a.mode=ue;break}u>a.wnext?(u-=a.wnext,c=a.wsize-u):c=a.wnext-u,u>a.length&&(u=a.length),g=a.window}else g=i,c=s-a.offset,u=a.length;u>l&&(u=l),l-=u,a.length-=u;do{i[s++]=g[c++]}while(--u);0===a.length&&(a.mode=21);break;case 26:if(0===l)break e;i[s++]=a.length,l--,a.mode=21;break;case 27:if(a.wrap){for(;d<32;){if(0===o)break e;o--,h|=n[r++]<<d,d+=8}if(f-=l,e.total_out+=f,a.total+=f,f&&(e.adler=a.check=a.flags?le(a.check,i,f,s-f):oe(a.check,i,f,s-f)),f=l,(a.flags?h:zswap32(h))!==a.check){e.msg="incorrect data check",a.mode=ue;break}h=0,d=0}a.mode=28;case 28:if(a.wrap&&a.flags){for(;d<32;){if(0===o)break e;o--,h+=n[r++]<<d,d+=8}if(h!==(4294967295&a.total)){e.msg="incorrect length check",a.mode=ue;break}h=0,d=0}a.mode=29;case 29:z=1;break e;case ue:z=-3;break e;case 31:return-4;default:return _e}return e.next_out=s,e.avail_out=l,e.next_in=r,e.avail_in=o,a.hold=h,a.bits=d,(a.wsize||f!==e.avail_out&&a.mode<ue&&(a.mode<27||4!==t))&&updatewindow(e,e.output,e.next_out,f-e.avail_out),_-=e.avail_in,f-=e.avail_out,e.total_in+=_,e.total_out+=f,a.total+=f,a.wrap&&f&&(e.adler=a.check=a.flags?le(a.check,i,f,e.next_out-f):oe(a.check,i,f,e.next_out-f)),e.data_type=a.bits+(a.last?64:0)+(a.mode===fe?128:0)+(20===a.mode||15===a.mode?256:0),(0===_&&0===f||4===t)&&0===z&&(z=-5),z},V.inflateEnd=function inflateEnd(e){if(!e||!e.state)return _e;var t=e.state;return t.window&&(t.window=null),e.state=null,0},V.inflateGetHeader=function inflateGetHeader(e,t){var a;return e&&e.state&&2&(a=e.state).wrap?(a.head=t,t.done=!1,0):_e},V.inflateSetDictionary=function inflateSetDictionary(e,t){var a,n=t.length;return e&&e.state?0!==(a=e.state).wrap&&11!==a.mode?_e:11===a.mode&&oe(1,t,n,0)!==a.check?-3:updatewindow(e,t,n,n)?(a.mode=31,-4):(a.havedict=1,0):_e},V.inflateInfo="pako inflate (from Nodeca project)";var be={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};var we=V,pe=e,ke=U,ve=be,ye=B,ze=P,xe=function GZheader$1(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1},Se=Object.prototype.toString;function Inflate(e){if(!(this instanceof Inflate))return new Inflate(e);this.options=pe.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(15&t.windowBits||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ze,this.strm.avail_out=0;var a=we.inflateInit2(this.strm,t.windowBits);if(a!==ve.Z_OK)throw new Error(ye[a]);this.header=new xe,we.inflateGetHeader(this.strm,this.header)}function inflate$1(e,t){var a=new Inflate(t);if(a.push(e,!0),a.err)throw a.msg;return a.result}Inflate.prototype.push=function(e,t){var a,n,i,r,s,o,l=this.strm,h=this.options.chunkSize,d=this.options.dictionary,_=!1;if(this.ended)return!1;n=t===~~t?t:!0===t?ve.Z_FINISH:ve.Z_NO_FLUSH,"string"==typeof e?l.input=ke.binstring2buf(e):"[object ArrayBuffer]"===Se.call(e)?l.input=new Uint8Array(e):l.input=e,l.next_in=0,l.avail_in=l.input.length;do{if(0===l.avail_out&&(l.output=new pe.Buf8(h),l.next_out=0,l.avail_out=h),(a=we.inflate(l,ve.Z_NO_FLUSH))===ve.Z_NEED_DICT&&d&&(o="string"==typeof d?ke.string2buf(d):"[object ArrayBuffer]"===Se.call(d)?new Uint8Array(d):d,a=we.inflateSetDictionary(this.strm,o)),a===ve.Z_BUF_ERROR&&!0===_&&(a=ve.Z_OK,_=!1),a!==ve.Z_STREAM_END&&a!==ve.Z_OK)return this.onEnd(a),this.ended=!0,!1;l.next_out&&(0!==l.avail_out&&a!==ve.Z_STREAM_END&&(0!==l.avail_in||n!==ve.Z_FINISH&&n!==ve.Z_SYNC_FLUSH)||("string"===this.options.to?(i=ke.utf8border(l.output,l.next_out),r=l.next_out-i,s=ke.buf2string(l.output,i),l.next_out=r,l.avail_out=h-r,r&&pe.arraySet(l.output,l.output,i,r,0),this.onData(s)):this.onData(pe.shrinkBuf(l.output,l.next_out)))),0===l.avail_in&&0===l.avail_out&&(_=!0)}while((l.avail_in>0||0===l.avail_out)&&a!==ve.Z_STREAM_END);return a===ve.Z_STREAM_END&&(n=ve.Z_FINISH),n===ve.Z_FINISH?(a=we.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===ve.Z_OK):n!==ve.Z_SYNC_FLUSH||(this.onEnd(ve.Z_OK),l.avail_out=0,!0)},Inflate.prototype.onData=function(e){this.chunks.push(e)},Inflate.prototype.onEnd=function(e){e===ve.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=pe.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},Q.Inflate=Inflate,Q.inflate=inflate$1,Q.inflateRaw=function inflateRaw(e,t){return(t=t||{}).raw=!0,inflate$1(e,t)},Q.ungzip=inflate$1;var De={};(0,e.assign)(De,t,Q,be);var Be=De;function post_utils(e={}){let{user:t,hash:a,bus:n,goto:i}=e;function getStorage(e,t){let a;return window?.localStorage&&(a=window.localStorage.getItem(e)),a?JSON.parse(a):t}function setStorage(e,t){window?.localStorage&&(null==t||""===t?window.localStorage.removeItem(e):window.localStorage.setItem(e,JSON.stringify(t)))}const r=new class Post{constructor(){this.baseurl="/",this.user={},this._fingerprint=""}get oggi(){return(new Date).toInt()}get oggif(){return(new Date).toFloat()}get fingerprint(){return this._fingerprint||(this._fingerprint=getStorage("__fingerprint",a(`${(new Date).toString()}-${Math.random()}`)),setStorage("__fingerprint",this._fingerprint)),this._fingerprint}isauth(e){if(null==e||""===e)return!0;if("string"!=typeof e)return!!e;let a=!1;return t.subscribe((t=>{t.level>=8?a=!0:t.abruoli&&(a=t.abruoli.split(";").includes(e.trim().toLowerCase()))})),a}fullurl(e){return e&&!/http[s]*:\/\//.test(e)&&this.baseurl?this.baseurl+e:e}fullget(e,a,n){e=this.fullurl(e),a||(a={}),n||t.subscribe((e=>{e?.token&&(a._uid=e.token)}));let i=[];for(let e in a)i.push(`${e}=${encodeURIComponent(a[e])}`);return i.length&&(e=`${e}?${i.join("&")}`),e}fetch(e,a,n,i=!1){a||(a={}),!/http[s]*:\/\//.test(e)&&this.baseurl&&(e=this.baseurl+e);let r,s={};return new Promise(((i,o)=>{if(t.subscribe((e=>{e?.token&&(s.Authorization=`Bearer ${e?.token}`)})),s["cp-fp"]=this.fingerprint,n&&n.length>0){r=new FormData;for(const[e,t]of Object.entries(a))r.append(e,t);n&&n.length&&Array.from(Array(n.length).keys()).map((e=>{r.append(n[e].name,n[e],n[e].name)}))}else{const e=JSON.stringify(a);if(e.length>1e3&&this.canzip){s["Content-Type"]="application/json",s["Content-Encoding"]="gzip";const t=Be.gzip(e);r=new Blob([t],{type:"application/gzip"})}else s["Content-Type"]="application/json; charset=utf-8",r=e}fetch(e,{method:"POST",headers:s,mode:"cors",cache:"no-cache",credentials:"omit",redirect:"follow",referrer:"no-referrer",body:r}).then((e=>e.json())).then((e=>{e.err&&o(e.err),i(e.data?e.data:e)})).catch((e=>{o(e.message)}))}))}post(e,t,a,n=!1){return new Promise(((i,s)=>{r.fetch(e,t,a,n).then((e=>{i(e)})).catch((e=>{s(e)}))}))}},s=r,o=r.isauth;return{post:s,PP:async(e,a,s,o)=>{try{return await r.fetch(e,a,s,o)}catch(l){if("api/token"==e)return t.set({}),void i("/");if("string"!=typeof l||!l.includes("01-"))return void n.errore(l?.message?l.message:l);try{let e;t.subscribe((t=>{t?.rtk&&(e=t.rtk)}));const a=await r.fetch("api/token",{rtk:e},null,!0);a.user?t.set(a.user):(t.set({}),i("/"))}catch(e){t.set({}),i("/")}try{return await r.fetch(e,a,s,o)}catch(e){return void n.errore(l?.message?l.message:l)}}},P:r,isauth:o,userguest:{id:99999,name:"guest",email:"guest@croswil.com",level:0,ruoli:"",mod:"",extra:"",annulla:0,token:"guest",rtk:"guest"},round2:function round2(e){return Math.round(100*(e||0))/100},parsetree:function parsetree(e,t){if(e)for(let a of e)t&&t(a),a.data&&parsetree(a.data,t)},getStorage:getStorage,setStorage:setStorage,readfile:function readfile(e){return new Promise(((t,a)=>{let n=new FileReader;n.readAsArrayBuffer(e),n.onerror=e=>{a(e)},n.onload=e=>{let a=e.target.result;t(a)}}))},downloadfile:function downloadfile(e){try{const t=URL.createObjectURL(e),a=document.createElement("a");a.href=t,a.download=e.name,a.click(),URL.revokeObjectURL(t)}catch(t){console.log(`errore: ${t.message}=>${e?.name}`)}}}}let Ie=1e3;function myuuid(){return Ie++,Ie}function getdim(e,t,a,n,i,r,s,o,l){let h,d=[];function getsingledim(e,t,a){return e||(e=t),e=Math.round(10*(e||0))/10,t?"X"==(a=(a||"_").trim().toLowerCase())&&e!=t?e+"*":"M"==a?e+"M":e:e}return h=getsingledim(e,n,s),h&&d.push(h),h=getsingledim(t,i,o),h&&d.push(h),h=getsingledim(a,r,l),h&&d.push(h),(""+s+o+l).replace(/[_XM]/gi,""),d.join("x")}function formatDate(e){const t=new Date(e),a=t.getDate().toString().padStart(2,"0"),n=(t.getMonth()+1).toString().padStart(2,"0");return`${t.getFullYear()}-${n}-${a}`}function toDateStr(e){if(!e)return"";"number"==typeof e&&(e=e.toDate());let t=e.getDate(),a=e.getMonth()+1,n=e.getFullYear(),i=e.getHours(),r=e.getMinutes();return t=t<10?"0"+t:t,a=a<10?"0"+a:a,i=i<10?"0"+i:i,r=r<10?"0"+r:r,`${t}/${a}/${n} ${i}:${r}`}const Ae=new class Bus{constructor(){this.buslist={}}on(e,t){return this.buslist[e]||(this.buslist[e]=[]),this.buslist[e].push(t),this.buslist[e].length-1}emit(e,...t){this.buslist[e]&&this.buslist[e].forEach((e=>e(...t)))}off(e,t){this.buslist[e]&&("number"==typeof t?t>=0&&t<this.buslist[e].length&&this.buslist[e].splice(t,1):this.buslist[e]=this.buslist[e].filter((e=>e!==t)))}$on(e,t){this.on(e,t)}$off(e,t){this.off(e,t)}$emit(e,...t){this.emit(e,...t)}};function listfromstring(e){if(Array.isArray(e))return e;let t=[],a={};if(e){let n=e.split(/[\n;,]/);for(let e of n){let n,i,r=e.search(/[:=#]/);r<0?n=i=e.trim():(n=e.slice(0,r),i=e.slice(r+1)),n=n.toLowerCase(),n&&!a[n]&&(a[n]=1,t.push({cod:n,des:i}))}}return t}Ae.messaggio=e=>Ae.emit("messaggio",e),Ae.warning=e=>Ae.emit("warning",e),Ae.errore=e=>Ae.emit("error",e),Ae.salvato=e=>Ae.emit("messaggio","dati memorizzati!"),Ae.wait=e=>Ae.emit("wait",e);const tonum=(e,t=-1)=>{if(!e)return 0;if("number"==typeof e)return e||0;let a=0;if("string"==typeof e){let t=(e=e.replaceAll(",",".")).match(/^-?[0-9.]+$/g);t&&t.length>0?a=Number(t[0]):/^\s*-?\s*[0-9]+(\.[0-9]+)?\s*$/gi.test(e)?a=parseFloat(e):/[\s\d()-+/*^.]+/gi.test(e)&&(a=0)}if(t>=0){const e=Math.pow(10,t);a=Math.round(a*e)/e}return a||0},toEuro=(e,t,a="")=>0==e?t||"":new Intl.NumberFormat("it-IT",{style:"currency",currency:"EUR"}).format(tonum(e))+a;let Ee={};const strDate=(e,t)=>{Date.prototype.getWeek||(Date.prototype.getWeek=function(){let e=new Date(this.getFullYear(),0,1);return Math.ceil(((this-e)/864e5+e.getDay()+1)/7)});let a="it";if("object"!=typeof e){if(!(e=parseFloat(e||0)))return"";e=e.toDate()}if("week"==t)return"w"+e.getWeek();if(!Ee[t])switch(t){case"giorni":{let t=e.toInt(),n=t.diffgiorni((new Date).toInt());if(0==n)return"Oggi";if(-1==n)return"Domani";if(1==n)return"Ieri";if(Math.abs(n)<6){return new Intl.DateTimeFormat(a,{weekday:"long"}).format(e).trim()}return strDate(t,"ggmmm")}case"date":case"shortdate":Ee[t]=new Intl.DateTimeFormat(a,{weekday:"short",day:"numeric",month:"short",year:"numeric"});break;case"ggmmaa":case"ggmmyy":Ee[t]=new Intl.DateTimeFormat(a,{day:"2-digit",month:"2-digit",year:"2-digit"});break;case"datetime":Ee[t]=new Intl.DateTimeFormat(a,{day:"2-digit",month:"2-digit",year:"numeric",hour12:!1,hour:"numeric",minute:"2-digit"});break;case"yyyy":case"anno":Ee[t]=new Intl.DateTimeFormat(a,{year:"numeric"});break;case"ggmmaaaa":case"ggmmyyyy":Ee[t]=new Intl.DateTimeFormat(a,{day:"2-digit",month:"2-digit",year:"numeric"});break;case"ggmm":Ee[t]=new Intl.DateTimeFormat(a,{day:"2-digit",month:"2-digit"});break;case"giorno":case"gg":Ee[t]=new Intl.DateTimeFormat(a,{day:"2-digit"});break;case"ggmmmaaaa":case"ggmmmyyyy":Ee[t]=new Intl.DateTimeFormat(a,{day:"2-digit",month:"short",year:"numeric"});break;case"ggmmmaa":case"ggmmmyy":Ee[t]=new Intl.DateTimeFormat(a,{day:"2-digit",month:"short",year:"2-digit"});break;case"ggmmm":Ee[t]=new Intl.DateTimeFormat(a,{day:"2-digit",month:"short"});break;case"ggmmmm":Ee[t]=new Intl.DateTimeFormat(a,{day:"2-digit",month:"long"});break;case"mmmyy":case"mmmaa":case"mmmyyyy":case"mmmaaaa":Ee[t]=new Intl.DateTimeFormat(a,{month:"short",year:"numeric"});break;case"weekday":Ee[t]=new Intl.DateTimeFormat(a,{weekday:"long"});break;case"hhmm":Ee[t]=new Intl.DateTimeFormat(a,{hour12:!1,hour:"numeric",minute:"2-digit"});break;case"hhmmss":Ee[t]=new Intl.DateTimeFormat(a,{hour12:!1,hour:"numeric",minute:"2-digit",second:"2-digit"});break;case"mese":Ee[t]=new Intl.DateTimeFormat(a,{month:"long"});break;default:Ee[t="."]||(Ee[t]=new Intl.DateTimeFormat(a,{weekday:"long",day:"numeric",month:"long",year:"numeric",hour12:!1,hour:"numeric",minute:"2-digit"}))}return Ee[t].format(e).trim()};export{Ae as bus,formatDate,getdim,listfromstring,myuuid,post_utils,strDate,toDateStr,toEuro,tonum};
|
|
1
|
+
function post_utils(e={}){let{pako:t,user:r,hash:i,bus:n,goto:a}=e;function getStorage(e,t){let r;return window?.localStorage&&(r=window.localStorage.getItem(e)),r?JSON.parse(r):t}function setStorage(e,t){window?.localStorage&&(null==t||""===t?window.localStorage.removeItem(e):window.localStorage.setItem(e,JSON.stringify(t)))}const o=new class Post{constructor(){this.baseurl="/",this.user={},this._fingerprint=""}get oggi(){return(new Date).toInt()}get oggif(){return(new Date).toFloat()}get fingerprint(){return this._fingerprint||(this._fingerprint=getStorage("__fingerprint",i(`${(new Date).toString()}-${Math.random()}`)),setStorage("__fingerprint",this._fingerprint)),this._fingerprint}isauth(e){if(null==e||""===e)return!0;if("string"!=typeof e)return!!e;let t=!1;return r.subscribe((r=>{r.level>=8?t=!0:r.abruoli&&(t=r.abruoli.split(";").includes(e.trim().toLowerCase()))})),t}fullurl(e){return e&&!/http[s]*:\/\//.test(e)&&this.baseurl?this.baseurl+e:e}fullget(e,t,i){e=this.fullurl(e),t||(t={}),i||r.subscribe((e=>{e?.token&&(t._uid=e.token)}));let n=[];for(let e in t)n.push(`${e}=${encodeURIComponent(t[e])}`);return n.length&&(e=`${e}?${n.join("&")}`),e}fetch(e,i,n,a=!1){i||(i={}),!/http[s]*:\/\//.test(e)&&this.baseurl&&(e=this.baseurl+e);let o,s={};return new Promise(((a,m)=>{if(r.subscribe((e=>{e?.token&&(s.Authorization=`Bearer ${e?.token}`)})),s["cp-fp"]=this.fingerprint,n&&n.length>0){o=new FormData;for(const[e,t]of Object.entries(i))o.append(e,t);n&&n.length&&Array.from(Array(n.length).keys()).map((e=>{o.append(n[e].name,n[e],n[e].name)}))}else{const e=JSON.stringify(i);if(e.length>1e3&&this.canzip&&t){s["Content-Type"]="application/json",s["Content-Encoding"]="gzip";const r=t.gzip(e);o=new Blob([r],{type:"application/gzip"})}else s["Content-Type"]="application/json; charset=utf-8",o=e}fetch(e,{method:"POST",headers:s,mode:"cors",cache:"no-cache",credentials:"omit",redirect:"follow",referrer:"no-referrer",body:o}).then((e=>e.json())).then((e=>{e.err&&m(e.err),a(e.data?e.data:e)})).catch((e=>{m(e.message)}))}))}post(e,t,r,i=!1){return new Promise(((n,a)=>{o.fetch(e,t,r,i).then((e=>{n(e)})).catch((e=>{a(e)}))}))}},s=o,m=o.isauth;return{post:s,PP:async(e,t,i,s)=>{try{return await o.fetch(e,t,i,s)}catch(m){if("api/token"==e)return r.set({}),void a("/");if("string"!=typeof m||!m.includes("01-"))return void n.errore(m?.message?m.message:m);try{let e;r.subscribe((t=>{t?.rtk&&(e=t.rtk)}));const t=await o.fetch("api/token",{rtk:e},null,!0);t.user?r.set(t.user):(r.set({}),a("/"))}catch(e){r.set({}),a("/")}try{return await o.fetch(e,t,i,s)}catch(e){return void n.errore(m?.message?m.message:m)}}},P:o,isauth:m,userguest:{id:99999,name:"guest",email:"guest@croswil.com",level:0,ruoli:"",mod:"",extra:"",annulla:0,token:"guest",rtk:"guest"},round2:function round2(e){return Math.round(100*(e||0))/100},parsetree:function parsetree(e,t){if(e)for(let r of e)t&&t(r),r.data&&parsetree(r.data,t)},getStorage:getStorage,setStorage:setStorage,readfile:function readfile(e){return new Promise(((t,r)=>{let i=new FileReader;i.readAsArrayBuffer(e),i.onerror=e=>{r(e)},i.onload=e=>{let r=e.target.result;t(r)}}))},downloadfile:function downloadfile(e){try{const t=URL.createObjectURL(e),r=document.createElement("a");r.href=t,r.download=e.name,r.click(),URL.revokeObjectURL(t)}catch(t){console.log(`errore: ${t.message}=>${e?.name}`)}}}}let e=1e3;function myuuid(){return e++,e}function getdim(e,t,r,i,n,a,o,s,m){let u,l=[];function getsingledim(e,t,r){return e||(e=t),e=Math.round(10*(e||0))/10,t?"X"==(r=(r||"_").trim().toLowerCase())&&e!=t?e+"*":"M"==r?e+"M":e:e}return u=getsingledim(e,i,o),u&&l.push(u),u=getsingledim(t,n,s),u&&l.push(u),u=getsingledim(r,a,m),u&&l.push(u),(""+o+s+m).replace(/[_XM]/gi,""),l.join("x")}function formatDate(e){const t=new Date(e),r=t.getDate().toString().padStart(2,"0"),i=(t.getMonth()+1).toString().padStart(2,"0");return`${t.getFullYear()}-${i}-${r}`}function toDateStr(e){if(!e)return"";"number"==typeof e&&(e=e.toDate());let t=e.getDate(),r=e.getMonth()+1,i=e.getFullYear(),n=e.getHours(),a=e.getMinutes();return t=t<10?"0"+t:t,r=r<10?"0"+r:r,n=n<10?"0"+n:n,a=a<10?"0"+a:a,`${t}/${r}/${i} ${n}:${a}`}const t=new class Bus{constructor(){this.buslist={}}on(e,t){return this.buslist[e]||(this.buslist[e]=[]),this.buslist[e].push(t),this.buslist[e].length-1}emit(e,...t){this.buslist[e]&&this.buslist[e].forEach((e=>e(...t)))}off(e,t){this.buslist[e]&&("number"==typeof t?t>=0&&t<this.buslist[e].length&&this.buslist[e].splice(t,1):this.buslist[e]=this.buslist[e].filter((e=>e!==t)))}$on(e,t){this.on(e,t)}$off(e,t){this.off(e,t)}$emit(e,...t){this.emit(e,...t)}};function listfromstring(e){if(Array.isArray(e))return e;let t=[],r={};if(e){let i=e.split(/[\n;,]/);for(let e of i){let i,n,a=e.search(/[:=#]/);a<0?i=n=e.trim():(i=e.slice(0,a),n=e.slice(a+1)),i=i.toLowerCase(),i&&!r[i]&&(r[i]=1,t.push({cod:i,des:n}))}}return t}t.messaggio=e=>t.emit("messaggio",e),t.warning=e=>t.emit("warning",e),t.errore=e=>t.emit("error",e),t.salvato=e=>t.emit("messaggio","dati memorizzati!"),t.wait=e=>t.emit("wait",e);const tonum=(e,t=-1)=>{if(!e)return 0;if("number"==typeof e)return e||0;let r=0;if("string"==typeof e){let t=(e=e.replaceAll(",",".")).match(/^-?[0-9.]+$/g);t&&t.length>0?r=Number(t[0]):/^\s*-?\s*[0-9]+(\.[0-9]+)?\s*$/gi.test(e)?r=parseFloat(e):/[\s\d()-+/*^.]+/gi.test(e)&&(r=0)}if(t>=0){const e=Math.pow(10,t);r=Math.round(r*e)/e}return r||0},toEuro=(e,t,r="")=>0==e?t||"":new Intl.NumberFormat("it-IT",{style:"currency",currency:"EUR"}).format(tonum(e))+r;let r={};const strDate=(e,t)=>{Date.prototype.getWeek||(Date.prototype.getWeek=function(){let e=new Date(this.getFullYear(),0,1);return Math.ceil(((this-e)/864e5+e.getDay()+1)/7)});let i="it";if("object"!=typeof e){if(!(e=parseFloat(e||0)))return"";e=e.toDate()}if("week"==t)return"w"+e.getWeek();if(!r[t])switch(t){case"giorni":{let t=e.toInt(),r=t.diffgiorni((new Date).toInt());if(0==r)return"Oggi";if(-1==r)return"Domani";if(1==r)return"Ieri";if(Math.abs(r)<6){return new Intl.DateTimeFormat(i,{weekday:"long"}).format(e).trim()}return strDate(t,"ggmmm")}case"date":case"shortdate":r[t]=new Intl.DateTimeFormat(i,{weekday:"short",day:"numeric",month:"short",year:"numeric"});break;case"ggmmaa":case"ggmmyy":r[t]=new Intl.DateTimeFormat(i,{day:"2-digit",month:"2-digit",year:"2-digit"});break;case"datetime":r[t]=new Intl.DateTimeFormat(i,{day:"2-digit",month:"2-digit",year:"numeric",hour12:!1,hour:"numeric",minute:"2-digit"});break;case"yyyy":case"anno":r[t]=new Intl.DateTimeFormat(i,{year:"numeric"});break;case"ggmmaaaa":case"ggmmyyyy":r[t]=new Intl.DateTimeFormat(i,{day:"2-digit",month:"2-digit",year:"numeric"});break;case"ggmm":r[t]=new Intl.DateTimeFormat(i,{day:"2-digit",month:"2-digit"});break;case"giorno":case"gg":r[t]=new Intl.DateTimeFormat(i,{day:"2-digit"});break;case"ggmmmaaaa":case"ggmmmyyyy":r[t]=new Intl.DateTimeFormat(i,{day:"2-digit",month:"short",year:"numeric"});break;case"ggmmmaa":case"ggmmmyy":r[t]=new Intl.DateTimeFormat(i,{day:"2-digit",month:"short",year:"2-digit"});break;case"ggmmm":r[t]=new Intl.DateTimeFormat(i,{day:"2-digit",month:"short"});break;case"ggmmmm":r[t]=new Intl.DateTimeFormat(i,{day:"2-digit",month:"long"});break;case"mmmyy":case"mmmaa":case"mmmyyyy":case"mmmaaaa":r[t]=new Intl.DateTimeFormat(i,{month:"short",year:"numeric"});break;case"weekday":r[t]=new Intl.DateTimeFormat(i,{weekday:"long"});break;case"hhmm":r[t]=new Intl.DateTimeFormat(i,{hour12:!1,hour:"numeric",minute:"2-digit"});break;case"hhmmss":r[t]=new Intl.DateTimeFormat(i,{hour12:!1,hour:"numeric",minute:"2-digit",second:"2-digit"});break;case"mese":r[t]=new Intl.DateTimeFormat(i,{month:"long"});break;default:r[t="."]||(r[t]=new Intl.DateTimeFormat(i,{weekday:"long",day:"numeric",month:"long",year:"numeric",hour12:!1,hour:"numeric",minute:"2-digit"}))}return r[t].format(e).trim()};export{t as bus,formatDate,getdim,listfromstring,myuuid,post_utils,strDate,toDateStr,toEuro,tonum};
|
package/package.json
CHANGED
package/types/bus_utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const
|
|
1
|
+
declare const t: {
|
|
2
2
|
buslist: {};
|
|
3
3
|
on(e: any, t: any): number;
|
|
4
4
|
emit(e: any, ...t: any[]): void;
|
|
@@ -8,7 +8,7 @@ declare const Ae: {
|
|
|
8
8
|
$emit(e: any, ...t: any[]): void;
|
|
9
9
|
};
|
|
10
10
|
export function formatDate(e: any): string;
|
|
11
|
-
export function getdim(e: any, t: any,
|
|
11
|
+
export function getdim(e: any, t: any, r: any, i: any, n: any, a: any, o: any, s: any, m: any): string;
|
|
12
12
|
export function listfromstring(e: any): any[];
|
|
13
13
|
export function myuuid(): number;
|
|
14
14
|
export function post_utils(e?: {}): {
|
|
@@ -21,11 +21,11 @@ export function post_utils(e?: {}): {
|
|
|
21
21
|
readonly fingerprint: string;
|
|
22
22
|
isauth(e: any): boolean;
|
|
23
23
|
fullurl(e: any): any;
|
|
24
|
-
fullget(e: any,
|
|
25
|
-
fetch(e: any,
|
|
26
|
-
post(e: any, t: any,
|
|
24
|
+
fullget(e: any, t: any, i: any): any;
|
|
25
|
+
fetch(e: any, i: any, n: any, a?: boolean): Promise<any>;
|
|
26
|
+
post(e: any, t: any, r: any, i?: boolean): Promise<any>;
|
|
27
27
|
};
|
|
28
|
-
PP: (e: any,
|
|
28
|
+
PP: (e: any, t: any, i: any, s: any) => Promise<any>;
|
|
29
29
|
P: {
|
|
30
30
|
baseurl: string;
|
|
31
31
|
user: {};
|
|
@@ -35,9 +35,9 @@ export function post_utils(e?: {}): {
|
|
|
35
35
|
readonly fingerprint: string;
|
|
36
36
|
isauth(e: any): boolean;
|
|
37
37
|
fullurl(e: any): any;
|
|
38
|
-
fullget(e: any,
|
|
39
|
-
fetch(e: any,
|
|
40
|
-
post(e: any, t: any,
|
|
38
|
+
fullget(e: any, t: any, i: any): any;
|
|
39
|
+
fetch(e: any, i: any, n: any, a?: boolean): Promise<any>;
|
|
40
|
+
post(e: any, t: any, r: any, i?: boolean): Promise<any>;
|
|
41
41
|
};
|
|
42
42
|
isauth: (e: any) => boolean;
|
|
43
43
|
userguest: {
|
|
@@ -61,6 +61,6 @@ export function post_utils(e?: {}): {
|
|
|
61
61
|
};
|
|
62
62
|
export function strDate(e: any, t: any): any;
|
|
63
63
|
export function toDateStr(e: any): string;
|
|
64
|
-
export function toEuro(e: any, t: any,
|
|
64
|
+
export function toEuro(e: any, t: any, r?: string): any;
|
|
65
65
|
export function tonum(e: any, t?: number): number;
|
|
66
|
-
export {
|
|
66
|
+
export { t as bus };
|