@meoslabs/save-in-meos 0.0.1
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/LICENSE +26 -0
- package/README.md +171 -0
- package/assets/fonts/inconsolata/Inconsolata-Medium.woff2 +0 -0
- package/assets/fonts/inconsolata/Inconsolata-Regular.woff2 +0 -0
- package/assets/fonts/inconsolata/OFL.txt +93 -0
- package/dist/import-intent-v1.d.ts +88 -0
- package/dist/import-intent-v1.js +399 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +8 -0
- package/dist/save-in-meos.min.js +127 -0
- package/dist/widget/chip-theme.d.ts +39 -0
- package/dist/widget/chip-theme.d.ts.map +1 -0
- package/dist/widget/chip-theme.js +67 -0
- package/dist/widget/chip-theme.js.map +1 -0
- package/dist/widget/chip-theme.test.d.ts +2 -0
- package/dist/widget/chip-theme.test.d.ts.map +1 -0
- package/dist/widget/chip-theme.test.js +43 -0
- package/dist/widget/chip-theme.test.js.map +1 -0
- package/dist/widget/icon.d.ts +10 -0
- package/dist/widget/icon.d.ts.map +1 -0
- package/dist/widget/icon.js +15 -0
- package/dist/widget/icon.js.map +1 -0
- package/dist/widget/index.d.ts +52 -0
- package/dist/widget/index.d.ts.map +1 -0
- package/dist/widget/index.js +156 -0
- package/dist/widget/index.js.map +1 -0
- package/dist/widget/styles.d.ts +13 -0
- package/dist/widget/styles.d.ts.map +1 -0
- package/dist/widget/styles.js +136 -0
- package/dist/widget/styles.js.map +1 -0
- package/dist/widget.iife.css +101 -0
- package/dist/widget.iife.js +127 -0
- package/dist/widget.iife.js.map +7 -0
- package/package.json +102 -0
- package/src/widget/fonts.css +27 -0
- package/src/widget/widget.css +101 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";var MeosSave=(()=>{var Qe=Object.defineProperty;var Ti=Object.getOwnPropertyDescriptor;var Ri=Object.getOwnPropertyNames;var Li=Object.prototype.hasOwnProperty;var zi=(e,n)=>{for(var t in n)Qe(e,t,{get:n[t],enumerable:!0})},Ci=(e,n,t,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of Ri(n))!Li.call(e,a)&&a!==t&&Qe(e,a,{get:()=>n[a],enumerable:!(i=Ti(n,a))||i.enumerable});return e};var Oi=e=>Ci(Qe({},"__esModule",{value:!0}),e);var sl={};zi(sl,{SAVE_CHIP_HOST_VARS:()=>Ct,buildImportIntentV1:()=>Xe,buildMeosLink:()=>je,buildSaveChipMarkup:()=>Bt,decodeMeosLink:()=>pi,initSaveButton:()=>Ai,parseWidgetAttribution:()=>gi,version:()=>ll});function de(e){let n=e.length;for(;--n>=0;)e[n]=0}var Di=0,Tn=1,Mi=2,Ui=3,Ni=258,Et=29,Le=256,ke=Le+1+Et,ce=30,St=19,Rn=2*ke+1,ee=15,et=16,Zi=7,yt=256,Ln=16,zn=17,Cn=18,ut=new Uint8Array([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]),Be=new Uint8Array([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]),$i=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),On=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Hi=512,K=new Array((ke+2)*2);de(K);var me=new Array(ce*2);de(me);var Ee=new Array(Hi);de(Ee);var Se=new Array(Ni-Ui+1);de(Se);var It=new Array(Et);de(It);var Fe=new Array(ce);de(Fe);function tt(e,n,t,i,a){this.static_tree=e,this.extra_bits=n,this.extra_base=t,this.elems=i,this.max_length=a,this.has_stree=e&&e.length}var Dn,Mn,Un;function nt(e,n){this.dyn_tree=e,this.max_code=0,this.stat_desc=n}var Nn=e=>e<256?Ee[e]:Ee[256+(e>>>7)],ye=(e,n)=>{e.pending_buf[e.pending++]=n&255,e.pending_buf[e.pending++]=n>>>8&255},U=(e,n,t)=>{e.bi_valid>et-t?(e.bi_buf|=n<<e.bi_valid&65535,ye(e,e.bi_buf),e.bi_buf=n>>et-e.bi_valid,e.bi_valid+=t-et):(e.bi_buf|=n<<e.bi_valid&65535,e.bi_valid+=t)},F=(e,n,t)=>{U(e,t[n*2],t[n*2+1])},Zn=(e,n)=>{let t=0;do t|=e&1,e>>>=1,t<<=1;while(--n>0);return t>>>1},Bi=e=>{e.bi_valid===16?(ye(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},Fi=(e,n)=>{let t=n.dyn_tree,i=n.max_code,a=n.stat_desc.static_tree,r=n.stat_desc.has_stree,s=n.stat_desc.extra_bits,l=n.stat_desc.extra_base,d=n.stat_desc.max_length,o,f,E,_,c,u,R=0;for(_=0;_<=ee;_++)e.bl_count[_]=0;for(t[e.heap[e.heap_max]*2+1]=0,o=e.heap_max+1;o<Rn;o++)f=e.heap[o],_=t[t[f*2+1]*2+1]+1,_>d&&(_=d,R++),t[f*2+1]=_,!(f>i)&&(e.bl_count[_]++,c=0,f>=l&&(c=s[f-l]),u=t[f*2],e.opt_len+=u*(_+c),r&&(e.static_len+=u*(a[f*2+1]+c)));if(R!==0){do{for(_=d-1;e.bl_count[_]===0;)_--;e.bl_count[_]--,e.bl_count[_+1]+=2,e.bl_count[d]--,R-=2}while(R>0);for(_=d;_!==0;_--)for(f=e.bl_count[_];f!==0;)E=e.heap[--o],!(E>i)&&(t[E*2+1]!==_&&(e.opt_len+=(_-t[E*2+1])*t[E*2],t[E*2+1]=_),f--)}},$n=(e,n,t)=>{let i=new Array(ee+1),a=0,r,s;for(r=1;r<=ee;r++)a=a+t[r-1]<<1,i[r]=a;for(s=0;s<=n;s++){let l=e[s*2+1];l!==0&&(e[s*2]=Zn(i[l]++,l))}},Vi=()=>{let e,n,t,i,a,r=new Array(ee+1);for(t=0,i=0;i<Et-1;i++)for(It[i]=t,e=0;e<1<<ut[i];e++)Se[t++]=i;for(Se[t-1]=i,a=0,i=0;i<16;i++)for(Fe[i]=a,e=0;e<1<<Be[i];e++)Ee[a++]=i;for(a>>=7;i<ce;i++)for(Fe[i]=a<<7,e=0;e<1<<Be[i]-7;e++)Ee[256+a++]=i;for(n=0;n<=ee;n++)r[n]=0;for(e=0;e<=143;)K[e*2+1]=8,e++,r[8]++;for(;e<=255;)K[e*2+1]=9,e++,r[9]++;for(;e<=279;)K[e*2+1]=7,e++,r[7]++;for(;e<=287;)K[e*2+1]=8,e++,r[8]++;for($n(K,ke+1,r),e=0;e<ce;e++)me[e*2+1]=5,me[e*2]=Zn(e,5);Dn=new tt(K,ut,Le+1,ke,ee),Mn=new tt(me,Be,0,ce,ee),Un=new tt(new Array(0),$i,0,St,Zi)},Hn=e=>{let n;for(n=0;n<ke;n++)e.dyn_ltree[n*2]=0;for(n=0;n<ce;n++)e.dyn_dtree[n*2]=0;for(n=0;n<St;n++)e.bl_tree[n*2]=0;e.dyn_ltree[yt*2]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},Bn=e=>{e.bi_valid>8?ye(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},Vt=(e,n,t,i)=>{let a=n*2,r=t*2;return e[a]<e[r]||e[a]===e[r]&&i[n]<=i[t]},it=(e,n,t)=>{let i=e.heap[t],a=t<<1;for(;a<=e.heap_len&&(a<e.heap_len&&Vt(n,e.heap[a+1],e.heap[a],e.depth)&&a++,!Vt(n,i,e.heap[a],e.depth));)e.heap[t]=e.heap[a],t=a,a<<=1;e.heap[t]=i},Pt=(e,n,t)=>{let i,a,r=0,s,l;if(e.sym_next!==0)do i=e.pending_buf[e.sym_buf+r++]&255,i+=(e.pending_buf[e.sym_buf+r++]&255)<<8,a=e.pending_buf[e.sym_buf+r++],i===0?F(e,a,n):(s=Se[a],F(e,s+Le+1,n),l=ut[s],l!==0&&(a-=It[s],U(e,a,l)),i--,s=Nn(i),F(e,s,t),l=Be[s],l!==0&&(i-=Fe[s],U(e,i,l)));while(r<e.sym_next);F(e,yt,n)},pt=(e,n)=>{let t=n.dyn_tree,i=n.stat_desc.static_tree,a=n.stat_desc.has_stree,r=n.stat_desc.elems,s,l,d=-1,o;for(e.heap_len=0,e.heap_max=Rn,s=0;s<r;s++)t[s*2]!==0?(e.heap[++e.heap_len]=d=s,e.depth[s]=0):t[s*2+1]=0;for(;e.heap_len<2;)o=e.heap[++e.heap_len]=d<2?++d:0,t[o*2]=1,e.depth[o]=0,e.opt_len--,a&&(e.static_len-=i[o*2+1]);for(n.max_code=d,s=e.heap_len>>1;s>=1;s--)it(e,t,s);o=r;do s=e.heap[1],e.heap[1]=e.heap[e.heap_len--],it(e,t,1),l=e.heap[1],e.heap[--e.heap_max]=s,e.heap[--e.heap_max]=l,t[o*2]=t[s*2]+t[l*2],e.depth[o]=(e.depth[s]>=e.depth[l]?e.depth[s]:e.depth[l])+1,t[s*2+1]=t[l*2+1]=o,e.heap[1]=o++,it(e,t,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],Fi(e,n),$n(t,d,e.bl_count)},Gt=(e,n,t)=>{let i,a=-1,r,s=n[1],l=0,d=7,o=4;for(s===0&&(d=138,o=3),n[(t+1)*2+1]=65535,i=0;i<=t;i++)r=s,s=n[(i+1)*2+1],!(++l<d&&r===s)&&(l<o?e.bl_tree[r*2]+=l:r!==0?(r!==a&&e.bl_tree[r*2]++,e.bl_tree[Ln*2]++):l<=10?e.bl_tree[zn*2]++:e.bl_tree[Cn*2]++,l=0,a=r,s===0?(d=138,o=3):r===s?(d=6,o=3):(d=7,o=4))},Kt=(e,n,t)=>{let i,a=-1,r,s=n[1],l=0,d=7,o=4;for(s===0&&(d=138,o=3),i=0;i<=t;i++)if(r=s,s=n[(i+1)*2+1],!(++l<d&&r===s)){if(l<o)do F(e,r,e.bl_tree);while(--l!==0);else r!==0?(r!==a&&(F(e,r,e.bl_tree),l--),F(e,Ln,e.bl_tree),U(e,l-3,2)):l<=10?(F(e,zn,e.bl_tree),U(e,l-3,3)):(F(e,Cn,e.bl_tree),U(e,l-11,7));l=0,a=r,s===0?(d=138,o=3):r===s?(d=6,o=3):(d=7,o=4)}},Pi=e=>{let n;for(Gt(e,e.dyn_ltree,e.l_desc.max_code),Gt(e,e.dyn_dtree,e.d_desc.max_code),pt(e,e.bl_desc),n=St-1;n>=3&&e.bl_tree[On[n]*2+1]===0;n--);return e.opt_len+=3*(n+1)+5+5+4,n},Gi=(e,n,t,i)=>{let a;for(U(e,n-257,5),U(e,t-1,5),U(e,i-4,4),a=0;a<i;a++)U(e,e.bl_tree[On[a]*2+1],3);Kt(e,e.dyn_ltree,n-1),Kt(e,e.dyn_dtree,t-1)},Ki=e=>{let n=4093624447,t;for(t=0;t<=31;t++,n>>>=1)if(n&1&&e.dyn_ltree[t*2]!==0)return 0;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return 1;for(t=32;t<Le;t++)if(e.dyn_ltree[t*2]!==0)return 1;return 0},Wt=!1,Wi=e=>{Wt||(Vi(),Wt=!0),e.l_desc=new nt(e.dyn_ltree,Dn),e.d_desc=new nt(e.dyn_dtree,Mn),e.bl_desc=new nt(e.bl_tree,Un),e.bi_buf=0,e.bi_valid=0,Hn(e)},Fn=(e,n,t,i)=>{U(e,(Di<<1)+(i?1:0),3),Bn(e),ye(e,t),ye(e,~t),t&&e.pending_buf.set(e.window.subarray(n,n+t),e.pending),e.pending+=t},Xi=e=>{U(e,Tn<<1,3),F(e,yt,K),Bi(e)},ji=(e,n,t,i)=>{let a,r,s=0;e.level>0?(e.strm.data_type===2&&(e.strm.data_type=Ki(e)),pt(e,e.l_desc),pt(e,e.d_desc),s=Pi(e),a=e.opt_len+3+7>>>3,r=e.static_len+3+7>>>3,r<=a&&(a=r)):a=r=t+5,t+4<=a&&n!==-1?Fn(e,n,t,i):e.strategy===4||r===a?(U(e,(Tn<<1)+(i?1:0),3),Pt(e,K,me)):(U(e,(Mi<<1)+(i?1:0),3),Gi(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),Pt(e,e.dyn_ltree,e.dyn_dtree)),Hn(e),i&&Bn(e)},Yi=(e,n,t)=>(e.pending_buf[e.sym_buf+e.sym_next++]=n,e.pending_buf[e.sym_buf+e.sym_next++]=n>>8,e.pending_buf[e.sym_buf+e.sym_next++]=t,n===0?e.dyn_ltree[t*2]++:(e.matches++,n--,e.dyn_ltree[(Se[t]+Le+1)*2]++,e.dyn_dtree[Nn(n)*2]++),e.sym_next===e.sym_end),qi=Wi,Ji=Fn,Qi=ji,ea=Yi,ta=Xi,na={_tr_init:qi,_tr_stored_block:Ji,_tr_flush_block:Qi,_tr_tally:ea,_tr_align:ta},ia=(e,n,t,i)=>{let a=e&65535|0,r=e>>>16&65535|0,s=0;for(;t!==0;){s=t>2e3?2e3:t,t-=s;do a=a+n[i++]|0,r=r+a|0;while(--s);a%=65521,r%=65521}return a|r<<16|0},Ie=ia,aa=()=>{let e,n=[];for(var t=0;t<256;t++){e=t;for(var i=0;i<8;i++)e=e&1?3988292384^e>>>1:e>>>1;n[t]=e}return n},ra=new Uint32Array(aa()),oa=(e,n,t,i)=>{let a=ra,r=i+t;e^=-1;for(let s=i;s<r;s++)e=e>>>8^a[(e^n[s])&255];return e^-1},C=oa,ie={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"},oe={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_MEM_ERROR:-4,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},{_tr_init:la,_tr_stored_block:gt,_tr_flush_block:sa,_tr_tally:Y,_tr_align:fa}=na,{Z_NO_FLUSH:q,Z_PARTIAL_FLUSH:ca,Z_FULL_FLUSH:ha,Z_FINISH:$,Z_BLOCK:Xt,Z_OK:O,Z_STREAM_END:jt,Z_STREAM_ERROR:V,Z_DATA_ERROR:_a,Z_BUF_ERROR:at,Z_DEFAULT_COMPRESSION:da,Z_FILTERED:ua,Z_HUFFMAN_ONLY:Ue,Z_RLE:pa,Z_FIXED:ga,Z_DEFAULT_STRATEGY:ba,Z_UNKNOWN:wa,Z_DEFLATED:Ge}=oe,ma=9,va=15,xa=8,ka=29,Ea=256,bt=Ea+1+ka,Sa=30,ya=19,Ia=2*bt+1,Aa=15,v=3,j=258,P=j+v+1,Ta=32,he=42,At=57,wt=69,mt=73,vt=91,xt=103,te=113,be=666,M=1,ue=2,ae=3,pe=4,Ra=3,ne=(e,n)=>(e.msg=ie[n],n),Yt=e=>e*2-(e>4?9:0),X=e=>{let n=e.length;for(;--n>=0;)e[n]=0},La=e=>{let n,t,i,a=e.w_size;n=e.hash_size,i=n;do t=e.head[--i],e.head[i]=t>=a?t-a:0;while(--n);n=a,i=n;do t=e.prev[--i],e.prev[i]=t>=a?t-a:0;while(--n)},za=(e,n,t)=>(n<<e.hash_shift^t)&e.hash_mask,J=za,N=e=>{let n=e.state,t=n.pending;t>e.avail_out&&(t=e.avail_out),t!==0&&(e.output.set(n.pending_buf.subarray(n.pending_out,n.pending_out+t),e.next_out),e.next_out+=t,n.pending_out+=t,e.total_out+=t,e.avail_out-=t,n.pending-=t,n.pending===0&&(n.pending_out=0))},Z=(e,n)=>{sa(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,n),e.block_start=e.strstart,N(e.strm)},y=(e,n)=>{e.pending_buf[e.pending++]=n},ge=(e,n)=>{e.pending_buf[e.pending++]=n>>>8&255,e.pending_buf[e.pending++]=n&255},kt=(e,n,t,i)=>{let a=e.avail_in;return a>i&&(a=i),a===0?0:(e.avail_in-=a,n.set(e.input.subarray(e.next_in,e.next_in+a),t),e.state.wrap===1?e.adler=Ie(e.adler,n,a,t):e.state.wrap===2&&(e.adler=C(e.adler,n,a,t)),e.next_in+=a,e.total_in+=a,a)},Vn=(e,n)=>{let t=e.max_chain_length,i=e.strstart,a,r,s=e.prev_length,l=e.nice_match,d=e.strstart>e.w_size-P?e.strstart-(e.w_size-P):0,o=e.window,f=e.w_mask,E=e.prev,_=e.strstart+j,c=o[i+s-1],u=o[i+s];e.prev_length>=e.good_match&&(t>>=2),l>e.lookahead&&(l=e.lookahead);do if(a=n,!(o[a+s]!==u||o[a+s-1]!==c||o[a]!==o[i]||o[++a]!==o[i+1])){i+=2,a++;do;while(o[++i]===o[++a]&&o[++i]===o[++a]&&o[++i]===o[++a]&&o[++i]===o[++a]&&o[++i]===o[++a]&&o[++i]===o[++a]&&o[++i]===o[++a]&&o[++i]===o[++a]&&i<_);if(r=j-(_-i),i=_-j,r>s){if(e.match_start=n,s=r,r>=l)break;c=o[i+s-1],u=o[i+s]}}while((n=E[n&f])>d&&--t!==0);return s<=e.lookahead?s:e.lookahead},_e=e=>{let n=e.w_size,t,i,a;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=n+(n-P)&&(e.window.set(e.window.subarray(n,n+n-i),0),e.match_start-=n,e.strstart-=n,e.block_start-=n,e.insert>e.strstart&&(e.insert=e.strstart),La(e),i+=n),e.strm.avail_in===0)break;if(t=kt(e.strm,e.window,e.strstart+e.lookahead,i),e.lookahead+=t,e.lookahead+e.insert>=v)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=J(e,e.ins_h,e.window[a+1]);e.insert&&(e.ins_h=J(e,e.ins_h,e.window[a+v-1]),e.prev[a&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=a,a++,e.insert--,!(e.lookahead+e.insert<v)););}while(e.lookahead<P&&e.strm.avail_in!==0)},Pn=(e,n)=>{let t=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,i,a,r,s=0,l=e.strm.avail_in;do{if(i=65535,r=e.bi_valid+42>>3,e.strm.avail_out<r||(r=e.strm.avail_out-r,a=e.strstart-e.block_start,i>a+e.strm.avail_in&&(i=a+e.strm.avail_in),i>r&&(i=r),i<t&&(i===0&&n!==$||n===q||i!==a+e.strm.avail_in)))break;s=n===$&&i===a+e.strm.avail_in?1:0,gt(e,0,0,s),e.pending_buf[e.pending-4]=i,e.pending_buf[e.pending-3]=i>>8,e.pending_buf[e.pending-2]=~i,e.pending_buf[e.pending-1]=~i>>8,N(e.strm),a&&(a>i&&(a=i),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+a),e.strm.next_out),e.strm.next_out+=a,e.strm.avail_out-=a,e.strm.total_out+=a,e.block_start+=a,i-=a),i&&(kt(e.strm,e.strm.output,e.strm.next_out,i),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i)}while(s===0);return l-=e.strm.avail_in,l&&(l>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=l&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-l,e.strm.next_in),e.strstart),e.strstart+=l,e.insert+=l>e.w_size-e.insert?e.w_size-e.insert:l),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),s?pe:n!==q&&n!==$&&e.strm.avail_in===0&&e.strstart===e.block_start?ue:(r=e.window_size-e.strstart,e.strm.avail_in>r&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,r+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),r>e.strm.avail_in&&(r=e.strm.avail_in),r&&(kt(e.strm,e.window,e.strstart,r),e.strstart+=r,e.insert+=r>e.w_size-e.insert?e.w_size-e.insert:r),e.high_water<e.strstart&&(e.high_water=e.strstart),r=e.bi_valid+42>>3,r=e.pending_buf_size-r>65535?65535:e.pending_buf_size-r,t=r>e.w_size?e.w_size:r,a=e.strstart-e.block_start,(a>=t||(a||n===$)&&n!==q&&e.strm.avail_in===0&&a<=r)&&(i=a>r?r:a,s=n===$&&e.strm.avail_in===0&&i===a?1:0,gt(e,e.block_start,i,s),e.block_start+=i,N(e.strm)),s?ae:M)},rt=(e,n)=>{let t,i;for(;;){if(e.lookahead<P){if(_e(e),e.lookahead<P&&n===q)return M;if(e.lookahead===0)break}if(t=0,e.lookahead>=v&&(e.ins_h=J(e,e.ins_h,e.window[e.strstart+v-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),t!==0&&e.strstart-t<=e.w_size-P&&(e.match_length=Vn(e,t)),e.match_length>=v)if(i=Y(e,e.strstart-e.match_start,e.match_length-v),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=v){e.match_length--;do e.strstart++,e.ins_h=J(e,e.ins_h,e.window[e.strstart+v-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=J(e,e.ins_h,e.window[e.strstart+1]);else i=Y(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(i&&(Z(e,!1),e.strm.avail_out===0))return M}return e.insert=e.strstart<v-1?e.strstart:v-1,n===$?(Z(e,!0),e.strm.avail_out===0?ae:pe):e.sym_next&&(Z(e,!1),e.strm.avail_out===0)?M:ue},se=(e,n)=>{let t,i,a;for(;;){if(e.lookahead<P){if(_e(e),e.lookahead<P&&n===q)return M;if(e.lookahead===0)break}if(t=0,e.lookahead>=v&&(e.ins_h=J(e,e.ins_h,e.window[e.strstart+v-1]),t=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=v-1,t!==0&&e.prev_length<e.max_lazy_match&&e.strstart-t<=e.w_size-P&&(e.match_length=Vn(e,t),e.match_length<=5&&(e.strategy===ua||e.match_length===v&&e.strstart-e.match_start>4096)&&(e.match_length=v-1)),e.prev_length>=v&&e.match_length<=e.prev_length){a=e.strstart+e.lookahead-v,i=Y(e,e.strstart-1-e.prev_match,e.prev_length-v),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=a&&(e.ins_h=J(e,e.ins_h,e.window[e.strstart+v-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=v-1,e.strstart++,i&&(Z(e,!1),e.strm.avail_out===0))return M}else if(e.match_available){if(i=Y(e,0,e.window[e.strstart-1]),i&&Z(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return M}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(i=Y(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<v-1?e.strstart:v-1,n===$?(Z(e,!0),e.strm.avail_out===0?ae:pe):e.sym_next&&(Z(e,!1),e.strm.avail_out===0)?M:ue},Ca=(e,n)=>{let t,i,a,r,s=e.window;for(;;){if(e.lookahead<=j){if(_e(e),e.lookahead<=j&&n===q)return M;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=v&&e.strstart>0&&(a=e.strstart-1,i=s[a],i===s[++a]&&i===s[++a]&&i===s[++a])){r=e.strstart+j;do;while(i===s[++a]&&i===s[++a]&&i===s[++a]&&i===s[++a]&&i===s[++a]&&i===s[++a]&&i===s[++a]&&i===s[++a]&&a<r);e.match_length=j-(r-a),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=v?(t=Y(e,1,e.match_length-v),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(t=Y(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),t&&(Z(e,!1),e.strm.avail_out===0))return M}return e.insert=0,n===$?(Z(e,!0),e.strm.avail_out===0?ae:pe):e.sym_next&&(Z(e,!1),e.strm.avail_out===0)?M:ue},Oa=(e,n)=>{let t;for(;;){if(e.lookahead===0&&(_e(e),e.lookahead===0)){if(n===q)return M;break}if(e.match_length=0,t=Y(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,t&&(Z(e,!1),e.strm.avail_out===0))return M}return e.insert=0,n===$?(Z(e,!0),e.strm.avail_out===0?ae:pe):e.sym_next&&(Z(e,!1),e.strm.avail_out===0)?M:ue};function B(e,n,t,i,a){this.good_length=e,this.max_lazy=n,this.nice_length=t,this.max_chain=i,this.func=a}var we=[new B(0,0,0,0,Pn),new B(4,4,8,4,rt),new B(4,5,16,8,rt),new B(4,6,32,32,rt),new B(4,4,16,16,se),new B(8,16,32,32,se),new B(8,16,128,128,se),new B(8,32,128,256,se),new B(32,128,258,1024,se),new B(32,258,258,4096,se)],Da=e=>{e.window_size=2*e.w_size,X(e.head),e.max_lazy_match=we[e.level].max_lazy,e.good_match=we[e.level].good_length,e.nice_match=we[e.level].nice_length,e.max_chain_length=we[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=v-1,e.match_available=0,e.ins_h=0};function Ma(){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=Ge,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 Uint16Array(Ia*2),this.dyn_dtree=new Uint16Array((2*Sa+1)*2),this.bl_tree=new Uint16Array((2*ya+1)*2),X(this.dyn_ltree),X(this.dyn_dtree),X(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(Aa+1),this.heap=new Uint16Array(2*bt+1),X(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*bt+1),X(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var ze=e=>{if(!e)return 1;let n=e.state;return!n||n.strm!==e||n.status!==he&&n.status!==At&&n.status!==wt&&n.status!==mt&&n.status!==vt&&n.status!==xt&&n.status!==te&&n.status!==be?1:0},Gn=e=>{if(ze(e))return ne(e,V);e.total_in=e.total_out=0,e.data_type=wa;let n=e.state;return n.pending=0,n.pending_out=0,n.wrap<0&&(n.wrap=-n.wrap),n.status=n.wrap===2?At:n.wrap?he:te,e.adler=n.wrap===2?0:1,n.last_flush=-2,la(n),O},Kn=e=>{let n=Gn(e);return n===O&&Da(e.state),n},Ua=(e,n)=>ze(e)||e.state.wrap!==2?V:(e.state.gzhead=n,O),Wn=(e,n,t,i,a,r)=>{if(!e)return V;let s=1;if(n===da&&(n=6),i<0?(s=0,i=-i):i>15&&(s=2,i-=16),a<1||a>ma||t!==Ge||i<8||i>15||n<0||n>9||r<0||r>ga||i===8&&s!==1)return ne(e,V);i===8&&(i=9);let l=new Ma;return e.state=l,l.strm=e,l.status=he,l.wrap=s,l.gzhead=null,l.w_bits=i,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=a+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+v-1)/v),l.window=new Uint8Array(l.w_size*2),l.head=new Uint16Array(l.hash_size),l.prev=new Uint16Array(l.w_size),l.lit_bufsize=1<<a+6,l.pending_buf_size=l.lit_bufsize*4,l.pending_buf=new Uint8Array(l.pending_buf_size),l.sym_buf=l.lit_bufsize,l.sym_end=(l.lit_bufsize-1)*3,l.level=n,l.strategy=r,l.method=t,Kn(e)},Na=(e,n)=>Wn(e,n,Ge,va,xa,ba),Za=(e,n)=>{if(ze(e)||n>Xt||n<0)return e?ne(e,V):V;let t=e.state;if(!e.output||e.avail_in!==0&&!e.input||t.status===be&&n!==$)return ne(e,e.avail_out===0?at:V);let i=t.last_flush;if(t.last_flush=n,t.pending!==0){if(N(e),e.avail_out===0)return t.last_flush=-1,O}else if(e.avail_in===0&&Yt(n)<=Yt(i)&&n!==$)return ne(e,at);if(t.status===be&&e.avail_in!==0)return ne(e,at);if(t.status===he&&t.wrap===0&&(t.status=te),t.status===he){let a=Ge+(t.w_bits-8<<4)<<8,r=-1;if(t.strategy>=Ue||t.level<2?r=0:t.level<6?r=1:t.level===6?r=2:r=3,a|=r<<6,t.strstart!==0&&(a|=Ta),a+=31-a%31,ge(t,a),t.strstart!==0&&(ge(t,e.adler>>>16),ge(t,e.adler&65535)),e.adler=1,t.status=te,N(e),t.pending!==0)return t.last_flush=-1,O}if(t.status===At){if(e.adler=0,y(t,31),y(t,139),y(t,8),t.gzhead)y(t,(t.gzhead.text?1:0)+(t.gzhead.hcrc?2:0)+(t.gzhead.extra?4:0)+(t.gzhead.name?8:0)+(t.gzhead.comment?16:0)),y(t,t.gzhead.time&255),y(t,t.gzhead.time>>8&255),y(t,t.gzhead.time>>16&255),y(t,t.gzhead.time>>24&255),y(t,t.level===9?2:t.strategy>=Ue||t.level<2?4:0),y(t,t.gzhead.os&255),t.gzhead.extra&&t.gzhead.extra.length&&(y(t,t.gzhead.extra.length&255),y(t,t.gzhead.extra.length>>8&255)),t.gzhead.hcrc&&(e.adler=C(e.adler,t.pending_buf,t.pending,0)),t.gzindex=0,t.status=wt;else if(y(t,0),y(t,0),y(t,0),y(t,0),y(t,0),y(t,t.level===9?2:t.strategy>=Ue||t.level<2?4:0),y(t,Ra),t.status=te,N(e),t.pending!==0)return t.last_flush=-1,O}if(t.status===wt){if(t.gzhead.extra){let a=t.pending,r=(t.gzhead.extra.length&65535)-t.gzindex;for(;t.pending+r>t.pending_buf_size;){let l=t.pending_buf_size-t.pending;if(t.pending_buf.set(t.gzhead.extra.subarray(t.gzindex,t.gzindex+l),t.pending),t.pending=t.pending_buf_size,t.gzhead.hcrc&&t.pending>a&&(e.adler=C(e.adler,t.pending_buf,t.pending-a,a)),t.gzindex+=l,N(e),t.pending!==0)return t.last_flush=-1,O;a=0,r-=l}let s=new Uint8Array(t.gzhead.extra);t.pending_buf.set(s.subarray(t.gzindex,t.gzindex+r),t.pending),t.pending+=r,t.gzhead.hcrc&&t.pending>a&&(e.adler=C(e.adler,t.pending_buf,t.pending-a,a)),t.gzindex=0}t.status=mt}if(t.status===mt){if(t.gzhead.name){let a=t.pending,r;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>a&&(e.adler=C(e.adler,t.pending_buf,t.pending-a,a)),N(e),t.pending!==0)return t.last_flush=-1,O;a=0}t.gzindex<t.gzhead.name.length?r=t.gzhead.name.charCodeAt(t.gzindex++)&255:r=0,y(t,r)}while(r!==0);t.gzhead.hcrc&&t.pending>a&&(e.adler=C(e.adler,t.pending_buf,t.pending-a,a)),t.gzindex=0}t.status=vt}if(t.status===vt){if(t.gzhead.comment){let a=t.pending,r;do{if(t.pending===t.pending_buf_size){if(t.gzhead.hcrc&&t.pending>a&&(e.adler=C(e.adler,t.pending_buf,t.pending-a,a)),N(e),t.pending!==0)return t.last_flush=-1,O;a=0}t.gzindex<t.gzhead.comment.length?r=t.gzhead.comment.charCodeAt(t.gzindex++)&255:r=0,y(t,r)}while(r!==0);t.gzhead.hcrc&&t.pending>a&&(e.adler=C(e.adler,t.pending_buf,t.pending-a,a))}t.status=xt}if(t.status===xt){if(t.gzhead.hcrc){if(t.pending+2>t.pending_buf_size&&(N(e),t.pending!==0))return t.last_flush=-1,O;y(t,e.adler&255),y(t,e.adler>>8&255),e.adler=0}if(t.status=te,N(e),t.pending!==0)return t.last_flush=-1,O}if(e.avail_in!==0||t.lookahead!==0||n!==q&&t.status!==be){let a=t.level===0?Pn(t,n):t.strategy===Ue?Oa(t,n):t.strategy===pa?Ca(t,n):we[t.level].func(t,n);if((a===ae||a===pe)&&(t.status=be),a===M||a===ae)return e.avail_out===0&&(t.last_flush=-1),O;if(a===ue&&(n===ca?fa(t):n!==Xt&&(gt(t,0,0,!1),n===ha&&(X(t.head),t.lookahead===0&&(t.strstart=0,t.block_start=0,t.insert=0))),N(e),e.avail_out===0))return t.last_flush=-1,O}return n!==$?O:t.wrap<=0?jt:(t.wrap===2?(y(t,e.adler&255),y(t,e.adler>>8&255),y(t,e.adler>>16&255),y(t,e.adler>>24&255),y(t,e.total_in&255),y(t,e.total_in>>8&255),y(t,e.total_in>>16&255),y(t,e.total_in>>24&255)):(ge(t,e.adler>>>16),ge(t,e.adler&65535)),N(e),t.wrap>0&&(t.wrap=-t.wrap),t.pending!==0?O:jt)},$a=e=>{if(ze(e))return V;let n=e.state.status;return e.state=null,n===te?ne(e,_a):O},Ha=(e,n)=>{let t=n.length;if(ze(e))return V;let i=e.state,a=i.wrap;if(a===2||a===1&&i.status!==he||i.lookahead)return V;if(a===1&&(e.adler=Ie(e.adler,n,t,0)),i.wrap=0,t>=i.w_size){a===0&&(X(i.head),i.strstart=0,i.block_start=0,i.insert=0);let d=new Uint8Array(i.w_size);d.set(n.subarray(t-i.w_size,t),0),n=d,t=i.w_size}let r=e.avail_in,s=e.next_in,l=e.input;for(e.avail_in=t,e.next_in=0,e.input=n,_e(i);i.lookahead>=v;){let d=i.strstart,o=i.lookahead-(v-1);do i.ins_h=J(i,i.ins_h,i.window[d+v-1]),i.prev[d&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=d,d++;while(--o);i.strstart=d,i.lookahead=v-1,_e(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=v-1,i.match_available=0,e.next_in=s,e.input=l,e.avail_in=r,i.wrap=a,O},Ba=Na,Fa=Wn,Va=Kn,Pa=Gn,Ga=Ua,Ka=Za,Wa=$a,Xa=Ha,ja="pako deflate (from Nodeca project)",ve={deflateInit:Ba,deflateInit2:Fa,deflateReset:Va,deflateResetKeep:Pa,deflateSetHeader:Ga,deflate:Ka,deflateEnd:Wa,deflateSetDictionary:Xa,deflateInfo:ja},Ya=(e,n)=>Object.prototype.hasOwnProperty.call(e,n),qa=function(e){let n=Array.prototype.slice.call(arguments,1);for(;n.length;){let t=n.shift();if(t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(let i in t)Ya(t,i)&&(e[i]=t[i])}}return e},Ja=e=>{let n=0;for(let i=0,a=e.length;i<a;i++)n+=e[i].length;let t=new Uint8Array(n);for(let i=0,a=0,r=e.length;i<r;i++){let s=e[i];t.set(s,a),a+=s.length}return t},Ke={assign:qa,flattenChunks:Ja},Xn=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Xn=!1}var Ae=new Uint8Array(256);for(let e=0;e<256;e++)Ae[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Ae[254]=Ae[254]=1;var Qa=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let n,t,i,a,r,s=e.length,l=0;for(a=0;a<s;a++)t=e.charCodeAt(a),(t&64512)===55296&&a+1<s&&(i=e.charCodeAt(a+1),(i&64512)===56320&&(t=65536+(t-55296<<10)+(i-56320),a++)),l+=t<128?1:t<2048?2:t<65536?3:4;for(n=new Uint8Array(l),r=0,a=0;r<l;a++)t=e.charCodeAt(a),(t&64512)===55296&&a+1<s&&(i=e.charCodeAt(a+1),(i&64512)===56320&&(t=65536+(t-55296<<10)+(i-56320),a++)),t<128?n[r++]=t:t<2048?(n[r++]=192|t>>>6,n[r++]=128|t&63):t<65536?(n[r++]=224|t>>>12,n[r++]=128|t>>>6&63,n[r++]=128|t&63):(n[r++]=240|t>>>18,n[r++]=128|t>>>12&63,n[r++]=128|t>>>6&63,n[r++]=128|t&63);return n},er=(e,n)=>{if(n<65534&&e.subarray&&Xn)return String.fromCharCode.apply(null,e.length===n?e:e.subarray(0,n));let t="";for(let i=0;i<n;i++)t+=String.fromCharCode(e[i]);return t},tr=(e,n)=>{let t=n||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,n));let i,a,r=new Array(t*2);for(a=0,i=0;i<t;){let s=e[i++];if(s<128){r[a++]=s;continue}let l=Ae[s];if(l>4){r[a++]=65533,i+=l-1;continue}for(s&=l===2?31:l===3?15:7;l>1&&i<t;)s=s<<6|e[i++]&63,l--;if(l>1){r[a++]=65533;continue}s<65536?r[a++]=s:(s-=65536,r[a++]=55296|s>>10&1023,r[a++]=56320|s&1023)}return er(r,a)},nr=(e,n)=>{n=n||e.length,n>e.length&&(n=e.length);let t=n-1;for(;t>=0&&(e[t]&192)===128;)t--;return t<0||t===0?n:t+Ae[e[t]]>n?t:n},Te={string2buf:Qa,buf2string:tr,utf8border:nr};function ir(){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}var jn=ir,Yn=Object.prototype.toString,{Z_NO_FLUSH:ar,Z_SYNC_FLUSH:rr,Z_FULL_FLUSH:or,Z_FINISH:lr,Z_OK:Ve,Z_STREAM_END:sr,Z_DEFAULT_COMPRESSION:fr,Z_DEFAULT_STRATEGY:cr,Z_DEFLATED:hr}=oe;function Ce(e){this.options=Ke.assign({level:fr,method:hr,chunkSize:16384,windowBits:15,memLevel:8,strategy:cr},e||{});let n=this.options;n.raw&&n.windowBits>0?n.windowBits=-n.windowBits:n.gzip&&n.windowBits>0&&n.windowBits<16&&(n.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new jn,this.strm.avail_out=0;let t=ve.deflateInit2(this.strm,n.level,n.method,n.windowBits,n.memLevel,n.strategy);if(t!==Ve)throw new Error(ie[t]);if(n.header&&ve.deflateSetHeader(this.strm,n.header),n.dictionary){let i;if(typeof n.dictionary=="string"?i=Te.string2buf(n.dictionary):Yn.call(n.dictionary)==="[object ArrayBuffer]"?i=new Uint8Array(n.dictionary):i=n.dictionary,t=ve.deflateSetDictionary(this.strm,i),t!==Ve)throw new Error(ie[t]);this._dict_set=!0}}Ce.prototype.push=function(e,n){let t=this.strm,i=this.options.chunkSize,a,r;if(this.ended)return!1;for(n===~~n?r=n:r=n===!0?lr:ar,typeof e=="string"?t.input=Te.string2buf(e):Yn.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;;){if(t.avail_out===0&&(t.output=new Uint8Array(i),t.next_out=0,t.avail_out=i),(r===rr||r===or)&&t.avail_out<=6){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(a=ve.deflate(t,r),a===sr)return t.next_out>0&&this.onData(t.output.subarray(0,t.next_out)),a=ve.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===Ve;if(t.avail_out===0){this.onData(t.output);continue}if(r>0&&t.next_out>0){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(t.avail_in===0)break}return!0};Ce.prototype.onData=function(e){this.chunks.push(e)};Ce.prototype.onEnd=function(e){e===Ve&&(this.result=Ke.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Tt(e,n){let t=new Ce(n);if(t.push(e,!0),t.err)throw t.msg||ie[t.err];return t.result}function _r(e,n){return n=n||{},n.raw=!0,Tt(e,n)}function dr(e,n){return n=n||{},n.gzip=!0,Tt(e,n)}var ur=Ce,pr=Tt,gr=_r,br=dr,wr=oe,mr={Deflate:ur,deflate:pr,deflateRaw:gr,gzip:br,constants:wr},Ne=16209,vr=16191,xr=function(n,t){let i,a,r,s,l,d,o,f,E,_,c,u,R,x,b,I,w,h,S,z,p,A,k,g,m=n.state;i=n.next_in,k=n.input,a=i+(n.avail_in-5),r=n.next_out,g=n.output,s=r-(t-n.avail_out),l=r+(n.avail_out-257),d=m.dmax,o=m.wsize,f=m.whave,E=m.wnext,_=m.window,c=m.hold,u=m.bits,R=m.lencode,x=m.distcode,b=(1<<m.lenbits)-1,I=(1<<m.distbits)-1;e:do{u<15&&(c+=k[i++]<<u,u+=8,c+=k[i++]<<u,u+=8),w=R[c&b];t:for(;;){if(h=w>>>24,c>>>=h,u-=h,h=w>>>16&255,h===0)g[r++]=w&65535;else if(h&16){S=w&65535,h&=15,h&&(u<h&&(c+=k[i++]<<u,u+=8),S+=c&(1<<h)-1,c>>>=h,u-=h),u<15&&(c+=k[i++]<<u,u+=8,c+=k[i++]<<u,u+=8),w=x[c&I];n:for(;;){if(h=w>>>24,c>>>=h,u-=h,h=w>>>16&255,h&16){if(z=w&65535,h&=15,u<h&&(c+=k[i++]<<u,u+=8,u<h&&(c+=k[i++]<<u,u+=8)),z+=c&(1<<h)-1,z>d){n.msg="invalid distance too far back",m.mode=Ne;break e}if(c>>>=h,u-=h,h=r-s,z>h){if(h=z-h,h>f&&m.sane){n.msg="invalid distance too far back",m.mode=Ne;break e}if(p=0,A=_,E===0){if(p+=o-h,h<S){S-=h;do g[r++]=_[p++];while(--h);p=r-z,A=g}}else if(E<h){if(p+=o+E-h,h-=E,h<S){S-=h;do g[r++]=_[p++];while(--h);if(p=0,E<S){h=E,S-=h;do g[r++]=_[p++];while(--h);p=r-z,A=g}}}else if(p+=E-h,h<S){S-=h;do g[r++]=_[p++];while(--h);p=r-z,A=g}for(;S>2;)g[r++]=A[p++],g[r++]=A[p++],g[r++]=A[p++],S-=3;S&&(g[r++]=A[p++],S>1&&(g[r++]=A[p++]))}else{p=r-z;do g[r++]=g[p++],g[r++]=g[p++],g[r++]=g[p++],S-=3;while(S>2);S&&(g[r++]=g[p++],S>1&&(g[r++]=g[p++]))}}else if((h&64)===0){w=x[(w&65535)+(c&(1<<h)-1)];continue n}else{n.msg="invalid distance code",m.mode=Ne;break e}break}}else if((h&64)===0){w=R[(w&65535)+(c&(1<<h)-1)];continue t}else if(h&32){m.mode=vr;break e}else{n.msg="invalid literal/length code",m.mode=Ne;break e}break}}while(i<a&&r<l);S=u>>3,i-=S,u-=S<<3,c&=(1<<u)-1,n.next_in=i,n.next_out=r,n.avail_in=i<a?5+(a-i):5-(i-a),n.avail_out=r<l?257+(l-r):257-(r-l),m.hold=c,m.bits=u},fe=15,qt=852,Jt=592,Qt=0,ot=1,en=2,kr=new Uint16Array([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]),Er=new Uint8Array([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]),Sr=new Uint16Array([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]),yr=new Uint8Array([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]),Ir=(e,n,t,i,a,r,s,l)=>{let d=l.bits,o=0,f=0,E=0,_=0,c=0,u=0,R=0,x=0,b=0,I=0,w,h,S,z,p,A=null,k,g=new Uint16Array(fe+1),m=new Uint16Array(fe+1),Q=null,Ft,De,Me;for(o=0;o<=fe;o++)g[o]=0;for(f=0;f<i;f++)g[n[t+f]]++;for(c=d,_=fe;_>=1&&g[_]===0;_--);if(c>_&&(c=_),_===0)return a[r++]=1<<24|64<<16|0,a[r++]=1<<24|64<<16|0,l.bits=1,0;for(E=1;E<_&&g[E]===0;E++);for(c<E&&(c=E),x=1,o=1;o<=fe;o++)if(x<<=1,x-=g[o],x<0)return-1;if(x>0&&(e===Qt||_!==1))return-1;for(m[1]=0,o=1;o<fe;o++)m[o+1]=m[o]+g[o];for(f=0;f<i;f++)n[t+f]!==0&&(s[m[n[t+f]]++]=f);if(e===Qt?(A=Q=s,k=20):e===ot?(A=kr,Q=Er,k=257):(A=Sr,Q=yr,k=0),I=0,f=0,o=E,p=r,u=c,R=0,S=-1,b=1<<c,z=b-1,e===ot&&b>qt||e===en&&b>Jt)return 1;for(;;){Ft=o-R,s[f]+1<k?(De=0,Me=s[f]):s[f]>=k?(De=Q[s[f]-k],Me=A[s[f]-k]):(De=96,Me=0),w=1<<o-R,h=1<<u,E=h;do h-=w,a[p+(I>>R)+h]=Ft<<24|De<<16|Me|0;while(h!==0);for(w=1<<o-1;I&w;)w>>=1;if(w!==0?(I&=w-1,I+=w):I=0,f++,--g[o]===0){if(o===_)break;o=n[t+s[f]]}if(o>c&&(I&z)!==S){for(R===0&&(R=c),p+=E,u=o-R,x=1<<u;u+R<_&&(x-=g[u+R],!(x<=0));)u++,x<<=1;if(b+=1<<u,e===ot&&b>qt||e===en&&b>Jt)return 1;S=I&z,a[S]=c<<24|u<<16|p-r|0}}return I!==0&&(a[p+I]=o-R<<24|64<<16|0),l.bits=c,0},xe=Ir,Ar=0,qn=1,Jn=2,{Z_FINISH:tn,Z_BLOCK:Tr,Z_TREES:Ze,Z_OK:re,Z_STREAM_END:Rr,Z_NEED_DICT:Lr,Z_STREAM_ERROR:H,Z_DATA_ERROR:Qn,Z_MEM_ERROR:ei,Z_BUF_ERROR:zr,Z_DEFLATED:nn}=oe,We=16180,an=16181,rn=16182,on=16183,ln=16184,sn=16185,fn=16186,cn=16187,hn=16188,_n=16189,Pe=16190,G=16191,lt=16192,dn=16193,st=16194,un=16195,pn=16196,gn=16197,bn=16198,$e=16199,He=16200,wn=16201,mn=16202,vn=16203,xn=16204,kn=16205,ft=16206,En=16207,Sn=16208,T=16209,ti=16210,ni=16211,Cr=852,Or=592,Dr=15,Mr=Dr,yn=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function Ur(){this.strm=null,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 Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var le=e=>{if(!e)return 1;let n=e.state;return!n||n.strm!==e||n.mode<We||n.mode>ni?1:0},ii=e=>{if(le(e))return H;let n=e.state;return e.total_in=e.total_out=n.total=0,e.msg="",n.wrap&&(e.adler=n.wrap&1),n.mode=We,n.last=0,n.havedict=0,n.flags=-1,n.dmax=32768,n.head=null,n.hold=0,n.bits=0,n.lencode=n.lendyn=new Int32Array(Cr),n.distcode=n.distdyn=new Int32Array(Or),n.sane=1,n.back=-1,re},ai=e=>{if(le(e))return H;let n=e.state;return n.wsize=0,n.whave=0,n.wnext=0,ii(e)},ri=(e,n)=>{let t;if(le(e))return H;let i=e.state;return n<0?(t=0,n=-n):(t=(n>>4)+5,n<48&&(n&=15)),n&&(n<8||n>15)?H:(i.window!==null&&i.wbits!==n&&(i.window=null),i.wrap=t,i.wbits=n,ai(e))},oi=(e,n)=>{if(!e)return H;let t=new Ur;e.state=t,t.strm=e,t.window=null,t.mode=We;let i=ri(e,n);return i!==re&&(e.state=null),i},Nr=e=>oi(e,Mr),In=!0,ct,ht,Zr=e=>{if(In){ct=new Int32Array(512),ht=new Int32Array(32);let n=0;for(;n<144;)e.lens[n++]=8;for(;n<256;)e.lens[n++]=9;for(;n<280;)e.lens[n++]=7;for(;n<288;)e.lens[n++]=8;for(xe(qn,e.lens,0,288,ct,0,e.work,{bits:9}),n=0;n<32;)e.lens[n++]=5;xe(Jn,e.lens,0,32,ht,0,e.work,{bits:5}),In=!1}e.lencode=ct,e.lenbits=9,e.distcode=ht,e.distbits=5},li=(e,n,t,i)=>{let a,r=e.state;return r.window===null&&(r.wsize=1<<r.wbits,r.wnext=0,r.whave=0,r.window=new Uint8Array(r.wsize)),i>=r.wsize?(r.window.set(n.subarray(t-r.wsize,t),0),r.wnext=0,r.whave=r.wsize):(a=r.wsize-r.wnext,a>i&&(a=i),r.window.set(n.subarray(t-i,t-i+a),r.wnext),i-=a,i?(r.window.set(n.subarray(t-i,t),0),r.wnext=i,r.whave=r.wsize):(r.wnext+=a,r.wnext===r.wsize&&(r.wnext=0),r.whave<r.wsize&&(r.whave+=a))),0},$r=(e,n)=>{let t,i,a,r,s,l,d,o,f,E,_,c,u,R,x=0,b,I,w,h,S,z,p,A,k=new Uint8Array(4),g,m,Q=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(le(e)||!e.output||!e.input&&e.avail_in!==0)return H;t=e.state,t.mode===G&&(t.mode=lt),s=e.next_out,a=e.output,d=e.avail_out,r=e.next_in,i=e.input,l=e.avail_in,o=t.hold,f=t.bits,E=l,_=d,A=re;e:for(;;)switch(t.mode){case We:if(t.wrap===0){t.mode=lt;break}for(;f<16;){if(l===0)break e;l--,o+=i[r++]<<f,f+=8}if(t.wrap&2&&o===35615){t.wbits===0&&(t.wbits=15),t.check=0,k[0]=o&255,k[1]=o>>>8&255,t.check=C(t.check,k,2,0),o=0,f=0,t.mode=an;break}if(t.head&&(t.head.done=!1),!(t.wrap&1)||(((o&255)<<8)+(o>>8))%31){e.msg="incorrect header check",t.mode=T;break}if((o&15)!==nn){e.msg="unknown compression method",t.mode=T;break}if(o>>>=4,f-=4,p=(o&15)+8,t.wbits===0&&(t.wbits=p),p>15||p>t.wbits){e.msg="invalid window size",t.mode=T;break}t.dmax=1<<t.wbits,t.flags=0,e.adler=t.check=1,t.mode=o&512?_n:G,o=0,f=0;break;case an:for(;f<16;){if(l===0)break e;l--,o+=i[r++]<<f,f+=8}if(t.flags=o,(t.flags&255)!==nn){e.msg="unknown compression method",t.mode=T;break}if(t.flags&57344){e.msg="unknown header flags set",t.mode=T;break}t.head&&(t.head.text=o>>8&1),t.flags&512&&t.wrap&4&&(k[0]=o&255,k[1]=o>>>8&255,t.check=C(t.check,k,2,0)),o=0,f=0,t.mode=rn;case rn:for(;f<32;){if(l===0)break e;l--,o+=i[r++]<<f,f+=8}t.head&&(t.head.time=o),t.flags&512&&t.wrap&4&&(k[0]=o&255,k[1]=o>>>8&255,k[2]=o>>>16&255,k[3]=o>>>24&255,t.check=C(t.check,k,4,0)),o=0,f=0,t.mode=on;case on:for(;f<16;){if(l===0)break e;l--,o+=i[r++]<<f,f+=8}t.head&&(t.head.xflags=o&255,t.head.os=o>>8),t.flags&512&&t.wrap&4&&(k[0]=o&255,k[1]=o>>>8&255,t.check=C(t.check,k,2,0)),o=0,f=0,t.mode=ln;case ln:if(t.flags&1024){for(;f<16;){if(l===0)break e;l--,o+=i[r++]<<f,f+=8}t.length=o,t.head&&(t.head.extra_len=o),t.flags&512&&t.wrap&4&&(k[0]=o&255,k[1]=o>>>8&255,t.check=C(t.check,k,2,0)),o=0,f=0}else t.head&&(t.head.extra=null);t.mode=sn;case sn:if(t.flags&1024&&(c=t.length,c>l&&(c=l),c&&(t.head&&(p=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(i.subarray(r,r+c),p)),t.flags&512&&t.wrap&4&&(t.check=C(t.check,i,c,r)),l-=c,r+=c,t.length-=c),t.length))break e;t.length=0,t.mode=fn;case fn:if(t.flags&2048){if(l===0)break e;c=0;do p=i[r+c++],t.head&&p&&t.length<65536&&(t.head.name+=String.fromCharCode(p));while(p&&c<l);if(t.flags&512&&t.wrap&4&&(t.check=C(t.check,i,c,r)),l-=c,r+=c,p)break e}else t.head&&(t.head.name=null);t.length=0,t.mode=cn;case cn:if(t.flags&4096){if(l===0)break e;c=0;do p=i[r+c++],t.head&&p&&t.length<65536&&(t.head.comment+=String.fromCharCode(p));while(p&&c<l);if(t.flags&512&&t.wrap&4&&(t.check=C(t.check,i,c,r)),l-=c,r+=c,p)break e}else t.head&&(t.head.comment=null);t.mode=hn;case hn:if(t.flags&512){for(;f<16;){if(l===0)break e;l--,o+=i[r++]<<f,f+=8}if(t.wrap&4&&o!==(t.check&65535)){e.msg="header crc mismatch",t.mode=T;break}o=0,f=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),e.adler=t.check=0,t.mode=G;break;case _n:for(;f<32;){if(l===0)break e;l--,o+=i[r++]<<f,f+=8}e.adler=t.check=yn(o),o=0,f=0,t.mode=Pe;case Pe:if(t.havedict===0)return e.next_out=s,e.avail_out=d,e.next_in=r,e.avail_in=l,t.hold=o,t.bits=f,Lr;e.adler=t.check=1,t.mode=G;case G:if(n===Tr||n===Ze)break e;case lt:if(t.last){o>>>=f&7,f-=f&7,t.mode=ft;break}for(;f<3;){if(l===0)break e;l--,o+=i[r++]<<f,f+=8}switch(t.last=o&1,o>>>=1,f-=1,o&3){case 0:t.mode=dn;break;case 1:if(Zr(t),t.mode=$e,n===Ze){o>>>=2,f-=2;break e}break;case 2:t.mode=pn;break;case 3:e.msg="invalid block type",t.mode=T}o>>>=2,f-=2;break;case dn:for(o>>>=f&7,f-=f&7;f<32;){if(l===0)break e;l--,o+=i[r++]<<f,f+=8}if((o&65535)!==(o>>>16^65535)){e.msg="invalid stored block lengths",t.mode=T;break}if(t.length=o&65535,o=0,f=0,t.mode=st,n===Ze)break e;case st:t.mode=un;case un:if(c=t.length,c){if(c>l&&(c=l),c>d&&(c=d),c===0)break e;a.set(i.subarray(r,r+c),s),l-=c,r+=c,d-=c,s+=c,t.length-=c;break}t.mode=G;break;case pn:for(;f<14;){if(l===0)break e;l--,o+=i[r++]<<f,f+=8}if(t.nlen=(o&31)+257,o>>>=5,f-=5,t.ndist=(o&31)+1,o>>>=5,f-=5,t.ncode=(o&15)+4,o>>>=4,f-=4,t.nlen>286||t.ndist>30){e.msg="too many length or distance symbols",t.mode=T;break}t.have=0,t.mode=gn;case gn:for(;t.have<t.ncode;){for(;f<3;){if(l===0)break e;l--,o+=i[r++]<<f,f+=8}t.lens[Q[t.have++]]=o&7,o>>>=3,f-=3}for(;t.have<19;)t.lens[Q[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,g={bits:t.lenbits},A=xe(Ar,t.lens,0,19,t.lencode,0,t.work,g),t.lenbits=g.bits,A){e.msg="invalid code lengths set",t.mode=T;break}t.have=0,t.mode=bn;case bn:for(;t.have<t.nlen+t.ndist;){for(;x=t.lencode[o&(1<<t.lenbits)-1],b=x>>>24,I=x>>>16&255,w=x&65535,!(b<=f);){if(l===0)break e;l--,o+=i[r++]<<f,f+=8}if(w<16)o>>>=b,f-=b,t.lens[t.have++]=w;else{if(w===16){for(m=b+2;f<m;){if(l===0)break e;l--,o+=i[r++]<<f,f+=8}if(o>>>=b,f-=b,t.have===0){e.msg="invalid bit length repeat",t.mode=T;break}p=t.lens[t.have-1],c=3+(o&3),o>>>=2,f-=2}else if(w===17){for(m=b+3;f<m;){if(l===0)break e;l--,o+=i[r++]<<f,f+=8}o>>>=b,f-=b,p=0,c=3+(o&7),o>>>=3,f-=3}else{for(m=b+7;f<m;){if(l===0)break e;l--,o+=i[r++]<<f,f+=8}o>>>=b,f-=b,p=0,c=11+(o&127),o>>>=7,f-=7}if(t.have+c>t.nlen+t.ndist){e.msg="invalid bit length repeat",t.mode=T;break}for(;c--;)t.lens[t.have++]=p}}if(t.mode===T)break;if(t.lens[256]===0){e.msg="invalid code -- missing end-of-block",t.mode=T;break}if(t.lenbits=9,g={bits:t.lenbits},A=xe(qn,t.lens,0,t.nlen,t.lencode,0,t.work,g),t.lenbits=g.bits,A){e.msg="invalid literal/lengths set",t.mode=T;break}if(t.distbits=6,t.distcode=t.distdyn,g={bits:t.distbits},A=xe(Jn,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,g),t.distbits=g.bits,A){e.msg="invalid distances set",t.mode=T;break}if(t.mode=$e,n===Ze)break e;case $e:t.mode=He;case He:if(l>=6&&d>=258){e.next_out=s,e.avail_out=d,e.next_in=r,e.avail_in=l,t.hold=o,t.bits=f,xr(e,_),s=e.next_out,a=e.output,d=e.avail_out,r=e.next_in,i=e.input,l=e.avail_in,o=t.hold,f=t.bits,t.mode===G&&(t.back=-1);break}for(t.back=0;x=t.lencode[o&(1<<t.lenbits)-1],b=x>>>24,I=x>>>16&255,w=x&65535,!(b<=f);){if(l===0)break e;l--,o+=i[r++]<<f,f+=8}if(I&&(I&240)===0){for(h=b,S=I,z=w;x=t.lencode[z+((o&(1<<h+S)-1)>>h)],b=x>>>24,I=x>>>16&255,w=x&65535,!(h+b<=f);){if(l===0)break e;l--,o+=i[r++]<<f,f+=8}o>>>=h,f-=h,t.back+=h}if(o>>>=b,f-=b,t.back+=b,t.length=w,I===0){t.mode=kn;break}if(I&32){t.back=-1,t.mode=G;break}if(I&64){e.msg="invalid literal/length code",t.mode=T;break}t.extra=I&15,t.mode=wn;case wn:if(t.extra){for(m=t.extra;f<m;){if(l===0)break e;l--,o+=i[r++]<<f,f+=8}t.length+=o&(1<<t.extra)-1,o>>>=t.extra,f-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=mn;case mn:for(;x=t.distcode[o&(1<<t.distbits)-1],b=x>>>24,I=x>>>16&255,w=x&65535,!(b<=f);){if(l===0)break e;l--,o+=i[r++]<<f,f+=8}if((I&240)===0){for(h=b,S=I,z=w;x=t.distcode[z+((o&(1<<h+S)-1)>>h)],b=x>>>24,I=x>>>16&255,w=x&65535,!(h+b<=f);){if(l===0)break e;l--,o+=i[r++]<<f,f+=8}o>>>=h,f-=h,t.back+=h}if(o>>>=b,f-=b,t.back+=b,I&64){e.msg="invalid distance code",t.mode=T;break}t.offset=w,t.extra=I&15,t.mode=vn;case vn:if(t.extra){for(m=t.extra;f<m;){if(l===0)break e;l--,o+=i[r++]<<f,f+=8}t.offset+=o&(1<<t.extra)-1,o>>>=t.extra,f-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){e.msg="invalid distance too far back",t.mode=T;break}t.mode=xn;case xn:if(d===0)break e;if(c=_-d,t.offset>c){if(c=t.offset-c,c>t.whave&&t.sane){e.msg="invalid distance too far back",t.mode=T;break}c>t.wnext?(c-=t.wnext,u=t.wsize-c):u=t.wnext-c,c>t.length&&(c=t.length),R=t.window}else R=a,u=s-t.offset,c=t.length;c>d&&(c=d),d-=c,t.length-=c;do a[s++]=R[u++];while(--c);t.length===0&&(t.mode=He);break;case kn:if(d===0)break e;a[s++]=t.length,d--,t.mode=He;break;case ft:if(t.wrap){for(;f<32;){if(l===0)break e;l--,o|=i[r++]<<f,f+=8}if(_-=d,e.total_out+=_,t.total+=_,t.wrap&4&&_&&(e.adler=t.check=t.flags?C(t.check,a,_,s-_):Ie(t.check,a,_,s-_)),_=d,t.wrap&4&&(t.flags?o:yn(o))!==t.check){e.msg="incorrect data check",t.mode=T;break}o=0,f=0}t.mode=En;case En:if(t.wrap&&t.flags){for(;f<32;){if(l===0)break e;l--,o+=i[r++]<<f,f+=8}if(t.wrap&4&&o!==(t.total&4294967295)){e.msg="incorrect length check",t.mode=T;break}o=0,f=0}t.mode=Sn;case Sn:A=Rr;break e;case T:A=Qn;break e;case ti:return ei;case ni:default:return H}return e.next_out=s,e.avail_out=d,e.next_in=r,e.avail_in=l,t.hold=o,t.bits=f,(t.wsize||_!==e.avail_out&&t.mode<T&&(t.mode<ft||n!==tn))&&li(e,e.output,e.next_out,_-e.avail_out),E-=e.avail_in,_-=e.avail_out,e.total_in+=E,e.total_out+=_,t.total+=_,t.wrap&4&&_&&(e.adler=t.check=t.flags?C(t.check,a,_,e.next_out-_):Ie(t.check,a,_,e.next_out-_)),e.data_type=t.bits+(t.last?64:0)+(t.mode===G?128:0)+(t.mode===$e||t.mode===st?256:0),(E===0&&_===0||n===tn)&&A===re&&(A=zr),A},Hr=e=>{if(le(e))return H;let n=e.state;return n.window&&(n.window=null),e.state=null,re},Br=(e,n)=>{if(le(e))return H;let t=e.state;return(t.wrap&2)===0?H:(t.head=n,n.done=!1,re)},Fr=(e,n)=>{let t=n.length,i,a,r;return le(e)||(i=e.state,i.wrap!==0&&i.mode!==Pe)?H:i.mode===Pe&&(a=1,a=Ie(a,n,t,0),a!==i.check)?Qn:(r=li(e,n,t,t),r?(i.mode=ti,ei):(i.havedict=1,re))},Vr=ai,Pr=ri,Gr=ii,Kr=Nr,Wr=oi,Xr=$r,jr=Hr,Yr=Br,qr=Fr,Jr="pako inflate (from Nodeca project)",W={inflateReset:Vr,inflateReset2:Pr,inflateResetKeep:Gr,inflateInit:Kr,inflateInit2:Wr,inflate:Xr,inflateEnd:jr,inflateGetHeader:Yr,inflateSetDictionary:qr,inflateInfo:Jr};function Qr(){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}var eo=Qr,si=Object.prototype.toString,{Z_NO_FLUSH:to,Z_FINISH:no,Z_OK:Re,Z_STREAM_END:_t,Z_NEED_DICT:dt,Z_STREAM_ERROR:io,Z_DATA_ERROR:An,Z_MEM_ERROR:ao}=oe;function Oe(e){this.options=Ke.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});let n=this.options;n.raw&&n.windowBits>=0&&n.windowBits<16&&(n.windowBits=-n.windowBits,n.windowBits===0&&(n.windowBits=-15)),n.windowBits>=0&&n.windowBits<16&&!(e&&e.windowBits)&&(n.windowBits+=32),n.windowBits>15&&n.windowBits<48&&(n.windowBits&15)===0&&(n.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new jn,this.strm.avail_out=0;let t=W.inflateInit2(this.strm,n.windowBits);if(t!==Re)throw new Error(ie[t]);if(this.header=new eo,W.inflateGetHeader(this.strm,this.header),n.dictionary&&(typeof n.dictionary=="string"?n.dictionary=Te.string2buf(n.dictionary):si.call(n.dictionary)==="[object ArrayBuffer]"&&(n.dictionary=new Uint8Array(n.dictionary)),n.raw&&(t=W.inflateSetDictionary(this.strm,n.dictionary),t!==Re)))throw new Error(ie[t])}Oe.prototype.push=function(e,n){let t=this.strm,i=this.options.chunkSize,a=this.options.dictionary,r,s,l;if(this.ended)return!1;for(n===~~n?s=n:s=n===!0?no:to,si.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;;){for(t.avail_out===0&&(t.output=new Uint8Array(i),t.next_out=0,t.avail_out=i),r=W.inflate(t,s),r===dt&&a&&(r=W.inflateSetDictionary(t,a),r===Re?r=W.inflate(t,s):r===An&&(r=dt));t.avail_in>0&&r===_t&&t.state.wrap>0&&e[t.next_in]!==0;)W.inflateReset(t),r=W.inflate(t,s);switch(r){case io:case An:case dt:case ao:return this.onEnd(r),this.ended=!0,!1}if(l=t.avail_out,t.next_out&&(t.avail_out===0||r===_t))if(this.options.to==="string"){let d=Te.utf8border(t.output,t.next_out),o=t.next_out-d,f=Te.buf2string(t.output,d);t.next_out=o,t.avail_out=i-o,o&&t.output.set(t.output.subarray(d,d+o),0),this.onData(f)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out));if(!(r===Re&&l===0)){if(r===_t)return r=W.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,!0;if(t.avail_in===0)break}}return!0};Oe.prototype.onData=function(e){this.chunks.push(e)};Oe.prototype.onEnd=function(e){e===Re&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Ke.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Rt(e,n){let t=new Oe(n);if(t.push(e),t.err)throw t.msg||ie[t.err];return t.result}function ro(e,n){return n=n||{},n.raw=!0,Rt(e,n)}var oo=Oe,lo=Rt,so=ro,fo=Rt,co=oe,ho={Inflate:oo,inflate:lo,inflateRaw:so,ungzip:fo,constants:co},{Deflate:_o,deflate:uo,deflateRaw:po,gzip:go}=mr,{Inflate:bo,inflate:wo,inflateRaw:mo,ungzip:vo}=ho,xo=_o,ko=uo,Eo=po,So=go,yo=bo,Io=wo,Ao=mo,To=vo,Ro=oe,Lt={Deflate:xo,deflate:ko,deflateRaw:Eo,gzip:So,Inflate:yo,inflate:Io,inflateRaw:Ao,ungzip:To,constants:Ro};var Lo="meos.do",zt="databox:import",zo=2048,D=class extends Error{constructor(t,i){super(`[MdpEncodeError] ${t}`);this.cause=i;this.name="MdpEncodeError"}cause},L=class extends Error{constructor(t,i){super(`[MdpDecodeError] ${t}`);this.cause=i;this.name="MdpDecodeError"}cause},Co={REF:"u",LITE:"ut",IMG:"i",FULL:"f"},fi={u:"REF",ut:"LITE",i:"IMG",f:"FULL"};function Oo(e){return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Do(e){let n=e.replace(/-/g,"+").replace(/_/g,"/");for(;n.length%4;)n+="=";return n}function Mo(e){if(typeof Buffer<"u")return Buffer.from(e).toString("base64");let n="",t=32768;for(let i=0;i<e.length;i+=t){let a=e.subarray(i,i+t),r="";for(let s=0;s<a.length;s++)r+=String.fromCharCode(a[s]);n+=r}return btoa(n)}function Uo(e){if(typeof Buffer<"u")return Uint8Array.from(Buffer.from(e,"base64"));let n=atob(e);return Uint8Array.from(n,t=>t.charCodeAt(0))}function No(e){try{return Lt.deflateRaw(e,{level:9})}catch(n){throw new D("Compression failed",n)}}function Zo(e){try{return Lt.inflateRaw(e,{to:"string"})}catch(n){throw new L("Decompression failed \u2014 invalid or corrupted data",n)}}function $o(e){try{return Oo(Mo(e))}catch(n){throw new D("Base64 encoding failed",n)}}function Ho(e){try{return Uo(Do(e))}catch(n){throw new L("Base64url decoding failed",n)}}function ci(e,n){try{let t=new URL(e);if(t.protocol!=="http:"&&t.protocol!=="https:")throw new D(`${n} must be an http(s) URL`)}catch(t){throw t instanceof D?t:new D(`${n} must be a valid URL`)}}function ui(e){if(e.v!==1)throw new D(`Unsupported schema version: ${e.v}`);if(!e.u||typeof e.u!="string")throw new D("Intent requires canonical URL (u)");switch(ci(e.u,"u"),e.tier){case"REF":break;case"LITE":if(!e.t||typeof e.t!="string"||e.t.trim().length===0)throw new D("LITE tier requires quoted text (t)");break;case"IMG":if(!e.images||e.images.length===0)throw new D("IMG tier requires at least one image URL");for(let n of e.images)ci(n,"images[]");break;case"FULL":if(!e.blocks||e.blocks.length===0)throw new D("FULL tier requires at least one block");break;default:throw new D(`Unknown tier: ${String(e.tier)}`)}}function Bo(e){let t={k:Co[e.tier],u:e.u};return e.tier==="LITE"&&e.t&&(t.t=e.t),e.tier==="IMG"&&(e.t&&(t.t=e.t),t.imgs=e.images),e.tier==="FULL"&&e.blocks&&(t.blocks=e.blocks),t}function Fo(e){if(!e||typeof e!="object")throw new L("Invalid schema: not an object");if(!e.k||!(e.k in fi))throw new L(`Invalid schema: unknown kind "${String(e.k)}"`);if(!e.u||typeof e.u!="string")throw new L("Invalid schema: missing canonical URL (u)");try{let i=new URL(e.u);if(i.protocol!=="http:"&&i.protocol!=="https:")throw new L("Invalid schema: u must be an http(s) URL")}catch(i){throw i instanceof L?i:new L("Invalid schema: u must be a valid URL")}let n=fi[e.k],t={v:1,tier:n,u:e.u};switch(n){case"LITE":if(!e.t||typeof e.t!="string"||e.t.trim().length===0)throw new L("LITE tier requires quoted text (t)");t.t=e.t;break;case"IMG":if(!e.imgs||e.imgs.length===0)throw new L("IMG tier requires image URLs (imgs)");for(let i of e.imgs)try{let a=new URL(i);if(a.protocol!=="http:"&&a.protocol!=="https:")throw new L("Invalid schema: imgs[] must be http(s) URLs")}catch(a){throw a instanceof L?a:new L("Invalid schema: imgs[] must be valid URLs")}e.t&&(t.t=e.t),t.images=e.imgs;break;case"FULL":if(!e.blocks||e.blocks.length===0)throw new L("FULL tier requires blocks");t.blocks=e.blocks;break;default:break}return t}function Vo(e){return e.blocks&&e.blocks.length>0?"FULL":e.images&&e.images.length>0?"IMG":e.t&&e.t.trim().length>0&&e.t!==e.u?"LITE":"REF"}function Xe(e){let n=Vo(e),t={v:1,tier:n,u:e.u};return n==="LITE"&&e.t&&(t.t=e.t),n==="IMG"&&(e.t&&(t.t=e.t),e.images&&(t.images=e.images)),n==="FULL"&&e.blocks&&(t.blocks=e.blocks),t}function hi(e){ui(e);let n=Bo(e),t=JSON.stringify(n);try{let i=No(t);return $o(i)}catch(i){throw i instanceof D?i:new D("Encoding failed",i)}}function Po(e){if(!e||typeof e!="string")throw new L("Encoded segment is empty or invalid");try{let n=Ho(e),t=Zo(n),i=JSON.parse(t);return Fo(i)}catch(n){throw n instanceof L?n:n instanceof SyntaxError?new L("JSON parsing failed \u2014 invalid schema",n):new L("Decoding failed",n)}}function _i(e,n){let t=`https://${Lo}/${zt}:${e}`;return n?`${t}?w=${encodeURIComponent(n)}`:t}function di(e){return{v:1,tier:"REF",u:e.u}}function Go(e){let n=e.t?.trim();if(!n)throw new D("LITE tier requires quoted text (t)");return{v:1,tier:"LITE",u:e.u,t:n}}function Ko(e){return e.tier==="LITE"?di(e):e.t?.trim()?Go(e):di(e)}function je(e,n,t){ui(e);let i=t?.maxUrlLength??zo,a=n??e.w,s={v:e.v,tier:e.tier,u:e.u,...e.t!==void 0?{t:e.t}:{},...e.images!==void 0?{images:e.images}:{},...e.blocks!==void 0?{blocks:e.blocks}:{}},l=_i(hi(s),a);for(;l.length>i&&s.tier!=="REF";)s=Ko(s),l=_i(hi(s),a);if(l.length>i)throw new D(`URL exceeds maxUrlLength (${i}) even at REF tier \u2014 shorten canonical URL (u)`);return l}function Wo(e){let n=e.trim(),t;n.startsWith("http://")||n.startsWith("https://")?t=`${new URL(n).pathname}${new URL(n).search}`:n.startsWith("/")?t=n:t=`/${n}`;let i=`${zt}:`,a=t.indexOf(i);if(a===-1)throw new L(`URL must contain resource "${zt}"`);let s=t.slice(a+i.length).split("?")[0];if(!s||s.length<4)throw new L("Encoded payload segment missing or too short");return s}function pi(e){let n=e.trim(),t=Wo(n);return Po(t)}function gi(e){let n=e.trim();if(!(!n.startsWith("http://")&&!n.startsWith("https://")))return new URL(n).searchParams.get("w")??void 0}var xi={default:{height:31,paddingX:10,radius:2,iconSize:16},compact:{height:28,paddingX:8,radius:2,iconSize:16}},Ct=["--meos-save-chip-height","--meos-save-chip-padding-x","--meos-save-chip-radius","--meos-save-icon-size","--meos-save-chip-gap"],bi={min:28,max:40,default:31},wi={min:8,max:16,default:10},mi={min:0,max:12,default:2},vi={min:11,max:16,default:16};function Ye(e,n,t){return Math.min(t,Math.max(n,e))}function Ot(e){return e==="compact"?"save":"save in meos"}function Xo(e,n){let i={...n?{...xi[n]}:{},...e};return Object.keys(i).length>0?i:void 0}function jo(e){let n={};return e?.height!==void 0&&(n["--meos-save-chip-height"]=`${Ye(e.height,bi.min,bi.max)}px`),e?.paddingX!==void 0&&(n["--meos-save-chip-padding-x"]=`${Ye(e.paddingX,wi.min,wi.max)}px`),e?.radius!==void 0&&(n["--meos-save-chip-radius"]=`${Ye(e.radius,mi.min,mi.max)}px`),e?.iconSize!==void 0&&(n["--meos-save-icon-size"]=`${Ye(e.iconSize,vi.min,vi.max)}px`),n}function Dt(e,n="auto",t,i){e.setAttribute("data-meos-theme",n);let a=Xo(t,i),r=jo(a);for(let[s,l]of Object.entries(r))e.style.setProperty(s,l)}var Yo="0 0 27.275015 30.362297",qo="m 392.92917,553.87771 v 12.58642 c 0,0.81325 -0.43385,1.5653 -1.13856,1.97265 l -7.84461,4.52907 c -2.06849,1.19415 -4.65283,-0.29916 -4.65415,-2.68721 v -0.66167 c 0,-7.00219 -5.8219,-10.18416 -9.06937,-11.41442 -1.02593,-0.38945 -2.12418,0.3626 -2.12418,1.45958 v 0.004 c 0.0556,4.33298 2.37151,8.34226 6.13053,10.54974 l 4.52634,2.65794 c 0.31136,0.18203 0.5074,0.51155 0.52136,0.87166 0,0.01 0,0.0195 0.001,0.0342 0.0342,0.82852 -0.86468,1.36652 -1.5834,0.95219 l -10.90009,-6.29314 c -0.70476,-0.4075 -1.13988,-1.1594 -1.13988,-1.97265 v -9.05809 c 0.001,-2.3883 2.58565,-3.87985 4.65415,-2.68717 l 0.58529,0.33772 c 6.05961,3.4906 11.72027,0.0439 14.4088,-2.15337 0.38945,-0.31819 0.57831,-0.76732 0.57831,-1.21498 0,-0.53244 -0.26695,-1.05931 -0.78401,-1.35676 -3.78117,-2.11857 -8.41039,-2.11721 -12.20269,0.0342 l -4.56528,2.59117 c -0.31282,0.17813 -0.69509,0.18203 -1.0148,0.0146 -0.01,-0.005 -0.0195,-0.01 -0.0293,-0.0146 -0.73399,-0.38652 -0.752,-1.43177 -0.0342,-1.84747 l 10.90019,-6.29319 c 0.70476,-0.4075 1.57359,-0.4075 2.27845,0 l 7.84461,4.52907 c 2.06713,1.19415 2.06713,4.17877 0,5.37429 l -0.57411,0.33088 c -0.01,0.005 -0.0244,0.0146 -0.0342,0.0195 -6.03043,3.50597 -5.87334,10.12028 -5.31733,13.54285 0.12933,0.79656 0.81608,1.31928 1.54865,1.31928 0.26109,0 0.52966,-0.0669 0.78128,-0.21278 3.72559,-2.21456 6.03883,-6.2251 6.07079,-10.58459 l 0.0391,-5.2492 c 0.003,-0.36016 0.19033,-0.69373 0.49489,-0.88694 0.01,-0.005 0.0195,-0.01 0.0244,-0.0146 0.70178,-0.44215 1.61654,0.0654 1.61654,0.89529 z",Jo="translate(-365.65417,-544.51253)";function ki(e){return`<svg class="${e}" viewBox="${Yo}" xmlns="http://www.w3.org/2000/svg" shape-rendering="geometricPrecision" aria-hidden="true" focusable="false"><g transform="${Jo}"><path d="${qo}" fill="currentColor"/></g></svg>`}var Ei=`
|
|
2
|
+
.meos-save-chip {
|
|
3
|
+
display: inline-flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
gap: var(--meos-save-chip-gap, 0.3125rem);
|
|
7
|
+
min-height: calc(var(--meos-save-chip-height, 31px) - 1px);
|
|
8
|
+
max-height: calc(var(--meos-save-chip-height, 31px) + 1px);
|
|
9
|
+
height: var(--meos-save-chip-height, 31px);
|
|
10
|
+
padding: 0 var(--meos-save-chip-padding-x, 0.625rem);
|
|
11
|
+
margin: 0;
|
|
12
|
+
font-family: var(--meos-font, "Inconsolata", ui-monospace, monospace);
|
|
13
|
+
font-size: 11px;
|
|
14
|
+
font-weight: 500;
|
|
15
|
+
line-height: 1;
|
|
16
|
+
letter-spacing: 0.02em;
|
|
17
|
+
text-transform: lowercase;
|
|
18
|
+
color: var(--meos-save-fg, #000000);
|
|
19
|
+
background: transparent;
|
|
20
|
+
border: 1px solid var(--meos-save-border, rgba(0, 0, 0, 0.24));
|
|
21
|
+
border-radius: var(--meos-save-chip-radius, var(--meos-radius, 2px));
|
|
22
|
+
cursor: pointer;
|
|
23
|
+
box-sizing: border-box;
|
|
24
|
+
-webkit-tap-highlight-color: transparent;
|
|
25
|
+
pointer-events: auto;
|
|
26
|
+
user-select: none;
|
|
27
|
+
transition:
|
|
28
|
+
background 0.12s ease,
|
|
29
|
+
border-color 0.12s ease,
|
|
30
|
+
opacity 0.12s ease,
|
|
31
|
+
transform 0.08s ease;
|
|
32
|
+
appearance: none;
|
|
33
|
+
vertical-align: middle;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.meos-save-chip:hover {
|
|
37
|
+
background: var(--meos-save-hover-bg, rgba(0, 0, 0, 0.06));
|
|
38
|
+
border-color: var(--meos-save-hover-border, rgba(0, 0, 0, 0.42));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.meos-save-chip:focus-visible {
|
|
42
|
+
outline: 2px solid currentColor;
|
|
43
|
+
outline-offset: 2px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.meos-save-chip:active {
|
|
47
|
+
opacity: 0.9;
|
|
48
|
+
transform: scale(0.98);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.meos-save-chip__icon {
|
|
52
|
+
width: calc(var(--meos-save-icon-size, 16px) * 27.275015 / 30.362297);
|
|
53
|
+
height: var(--meos-save-icon-size, 16px);
|
|
54
|
+
flex-shrink: 0;
|
|
55
|
+
display: block;
|
|
56
|
+
pointer-events: none;
|
|
57
|
+
shape-rendering: geometricPrecision;
|
|
58
|
+
overflow: visible;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.meos-save-chip__label {
|
|
62
|
+
white-space: nowrap;
|
|
63
|
+
pointer-events: none;
|
|
64
|
+
}
|
|
65
|
+
`,qe=`
|
|
66
|
+
--meos-save-fg: #000000;
|
|
67
|
+
--meos-save-border: rgba(0, 0, 0, 0.24);
|
|
68
|
+
--meos-save-hover-bg: rgba(0, 0, 0, 0.06);
|
|
69
|
+
--meos-save-hover-border: rgba(0, 0, 0, 0.42);
|
|
70
|
+
`,Je=`
|
|
71
|
+
--meos-save-fg: #ffffff;
|
|
72
|
+
--meos-save-border: rgba(255, 255, 255, 0.3);
|
|
73
|
+
--meos-save-hover-bg: rgba(255, 255, 255, 0.08);
|
|
74
|
+
--meos-save-hover-border: rgba(255, 255, 255, 0.46);
|
|
75
|
+
`,Mt=`
|
|
76
|
+
:host {
|
|
77
|
+
${qe}
|
|
78
|
+
color-scheme: light;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
:host([data-meos-theme="light"]) {
|
|
82
|
+
${qe}
|
|
83
|
+
color-scheme: light;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
:host([data-meos-theme="dark"]) {
|
|
87
|
+
${Je}
|
|
88
|
+
color-scheme: dark;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
@media (prefers-color-scheme: dark) {
|
|
92
|
+
:host([data-meos-theme="auto"]) {
|
|
93
|
+
${Je}
|
|
94
|
+
color-scheme: dark;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
${Ei}
|
|
99
|
+
`,Ut=`
|
|
100
|
+
.meos-save-chip,
|
|
101
|
+
.meos-save-chip[data-meos-theme="auto"] {
|
|
102
|
+
${qe}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.meos-save-chip[data-meos-theme="light"] {
|
|
106
|
+
${qe}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.meos-save-chip[data-meos-theme="dark"] {
|
|
110
|
+
${Je}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
@media (prefers-color-scheme: dark) {
|
|
114
|
+
.meos-save-chip[data-meos-theme="auto"] {
|
|
115
|
+
${Je}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
${Ei}
|
|
120
|
+
`,pl=`${Mt}
|
|
121
|
+
${Ut}`;var Qo="save in meos";var el="meos-save-chip",tl="meos-save-chip__icon",nl="meos-save-chip__label",Si="meos-save-widget-styles",Ii="data-meos-save-host",Nt=Symbol("meos-wire-click-abort"),Zt=!1;function Bt(e){let n=Ot(e);return`${ki(tl)}<span class="${nl}">${n}</span>`}function il(){if(Zt||typeof document>"u")return;if(document.getElementById(Si)){Zt=!0;return}let e=document.createElement("style");e.id=Si,e.setAttribute("data-meos-save",""),e.textContent=Ut,document.head.appendChild(e),Zt=!0}function al(e){return e.childNodes.length===0&&!e.textContent?.trim()}function $t(e,n){e.type="button",e.className=el,e.setAttribute("data-meos-save",""),e.setAttribute("aria-label",Qo),n==="compact"&&e.setAttribute("data-meos-chip-preset","compact"),e.innerHTML=Bt(n)}function rl(e){let n=e.shadowRoot?.querySelector("button");return n instanceof HTMLButtonElement?n:null}function ol(e,n){Dt(e,n.theme??"auto",n.chip,n.chipPreset),e.setAttribute(Ii,"");let t=rl(e);if(t)return $t(t,n.chipPreset),Ht(t,n,!0),t;let i=e.attachShadow({mode:"closed"}),a=document.createElement("style");a.textContent=Mt,i.appendChild(a);let r=document.createElement("button");return $t(r,n.chipPreset),i.appendChild(r),Ht(r,n),r}function Ht(e,n,t=!1){let i=e;t&&i[Nt]&&i[Nt].abort();let a=new AbortController;i[Nt]=a;let r;e.addEventListener("pointerdown",()=>{r=yi()},{signal:a.signal}),e.addEventListener("click",s=>{s.preventDefault();try{let l=typeof location<"u"?location.href:n.u??"",d=Xe({u:l,t:n.t??r??yi(),images:n.images,blocks:n.blocks}),o=je(d,n.widgetId);typeof location<"u"&&(location.href=o)}catch(l){console.error("[save-in-meos] failed to build import link",l)}},{signal:a.signal})}function Ai(e,n={u:typeof location<"u"?location.href:""}){let t=typeof e=="string"?document.querySelector(e):e;if(!t)return null;if(al(t)||t.hasAttribute(Ii))return ol(t,n);il();let i;return t instanceof HTMLButtonElement?i=t:t instanceof HTMLAnchorElement?(i=document.createElement("button"),i.type="button",t.replaceWith(i)):(i=document.createElement("button"),t.appendChild(i)),$t(i,n.chipPreset),Dt(i,n.theme??"auto",n.chip,n.chipPreset),Ht(i,n,!0),i}function yi(){if(typeof window>"u"||!window.getSelection)return;let e=window.getSelection()?.toString().trim();return e&&e.length>0?e:void 0}var ll="0.0.1";return Oi(sl);})();
|
|
122
|
+
/*! Bundled license information:
|
|
123
|
+
|
|
124
|
+
pako/dist/pako.esm.mjs:
|
|
125
|
+
(*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) *)
|
|
126
|
+
*/
|
|
127
|
+
//# sourceMappingURL=widget.iife.js.map
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WHY: Theme + bounded shape tokens must be applied consistently (shadow + document mounts).
|
|
3
|
+
* WHAT: Types, clamps, and host attribute/CSS-var application for the save chip.
|
|
4
|
+
* HOW: data-meos-theme on host/button; integrator vars inherit into closed shadow.
|
|
5
|
+
* GUARDED: Font + logo are not exposed — only size/shape tokens are clamped here.
|
|
6
|
+
*/
|
|
7
|
+
/** Logo is taller than wide — iconSize controls height; width follows SSOT aspect. */
|
|
8
|
+
export declare const MEOS_SAVE_ICON_ASPECT: number;
|
|
9
|
+
/** Follow OS preference, or pin light/dark regardless of prefers-color-scheme. */
|
|
10
|
+
export type SaveChipTheme = "auto" | "light" | "dark";
|
|
11
|
+
/** Named chip presets — `default` (full label) or `compact` (logo + save). */
|
|
12
|
+
export type SaveChipPreset = "default" | "compact";
|
|
13
|
+
/**
|
|
14
|
+
* Bounded shape/size tweaks. Font family and logo artwork stay fixed.
|
|
15
|
+
* Prefer `chipPreset` or CSS custom properties on the mount host.
|
|
16
|
+
*/
|
|
17
|
+
export interface SaveChipCustomisation {
|
|
18
|
+
/** Chip height in px (28–40). Default 31. */
|
|
19
|
+
height?: number;
|
|
20
|
+
/** Horizontal padding in px (8–16). Default 10. */
|
|
21
|
+
paddingX?: number;
|
|
22
|
+
/** Border radius in px (0–12). Default 2. */
|
|
23
|
+
radius?: number;
|
|
24
|
+
/** Logo mark height in px (11–16). Width follows brand aspect ratio. Default 16. */
|
|
25
|
+
iconSize?: number;
|
|
26
|
+
}
|
|
27
|
+
/** Canonical chip presets (integrator-facing — see README / INTEGRATOR.md). */
|
|
28
|
+
export declare const SAVE_CHIP_PRESETS: Readonly<Record<SaveChipPreset, Readonly<SaveChipCustomisation>>>;
|
|
29
|
+
/** Documented host CSS vars integrators may set before initSaveButton. */
|
|
30
|
+
export declare const SAVE_CHIP_HOST_VARS: readonly ["--meos-save-chip-height", "--meos-save-chip-padding-x", "--meos-save-chip-radius", "--meos-save-icon-size", "--meos-save-chip-gap"];
|
|
31
|
+
/** Visible chip copy for a preset (compact uses short label). */
|
|
32
|
+
export declare function resolveChipLabel(preset?: SaveChipPreset): "save in meos" | "save";
|
|
33
|
+
/** Merge preset + explicit chip overrides (explicit wins). */
|
|
34
|
+
export declare function resolveChipCustomisation(chip?: SaveChipCustomisation, preset?: SaveChipPreset): SaveChipCustomisation | undefined;
|
|
35
|
+
/** Pure resolver for chip option object → CSS custom property values (px strings). */
|
|
36
|
+
export declare function resolveChipCustomisationVars(chip?: SaveChipCustomisation): Record<string, string>;
|
|
37
|
+
/** Apply theme + optional chip object to a mount host or chip button. */
|
|
38
|
+
export declare function applyChipPresentation(el: HTMLElement, theme?: SaveChipTheme, chip?: SaveChipCustomisation, preset?: SaveChipPreset): void;
|
|
39
|
+
//# sourceMappingURL=chip-theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chip-theme.d.ts","sourceRoot":"","sources":["../../src/widget/chip-theme.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,sFAAsF;AACtF,eAAO,MAAM,qBAAqB,QAAwB,CAAA;AAE1D,kFAAkF;AAClF,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAA;AAErD,8EAA8E;AAC9E,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,SAAS,CAAA;AAElD;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,6CAA6C;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,mDAAmD;IACnD,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,6CAA6C;IAC7C,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,oFAAoF;IACpF,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,+EAA+E;AAC/E,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CACtC,MAAM,CAAC,cAAc,EAAE,QAAQ,CAAC,qBAAqB,CAAC,CAAC,CAM/C,CAAA;AAEV,0EAA0E;AAC1E,eAAO,MAAM,mBAAmB,gJAMtB,CAAA;AAWV,iEAAiE;AACjE,wBAAgB,gBAAgB,CAAC,MAAM,CAAC,EAAE,cAAc,GAAG,cAAc,GAAG,MAAM,CAEjF;AAED,8DAA8D;AAC9D,wBAAgB,wBAAwB,CACtC,IAAI,CAAC,EAAE,qBAAqB,EAC5B,MAAM,CAAC,EAAE,cAAc,GACtB,qBAAqB,GAAG,SAAS,CAInC;AAED,sFAAsF;AACtF,wBAAgB,4BAA4B,CAC1C,IAAI,CAAC,EAAE,qBAAqB,GAC3B,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAexB;AAED,yEAAyE;AACzE,wBAAgB,qBAAqB,CACnC,EAAE,EAAE,WAAW,EACf,KAAK,GAAE,aAAsB,EAC7B,IAAI,CAAC,EAAE,qBAAqB,EAC5B,MAAM,CAAC,EAAE,cAAc,GACtB,IAAI,CAQN"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WHY: Theme + bounded shape tokens must be applied consistently (shadow + document mounts).
|
|
3
|
+
* WHAT: Types, clamps, and host attribute/CSS-var application for the save chip.
|
|
4
|
+
* HOW: data-meos-theme on host/button; integrator vars inherit into closed shadow.
|
|
5
|
+
* GUARDED: Font + logo are not exposed — only size/shape tokens are clamped here.
|
|
6
|
+
*/
|
|
7
|
+
/** Logo is taller than wide — iconSize controls height; width follows SSOT aspect. */
|
|
8
|
+
export const MEOS_SAVE_ICON_ASPECT = 27.275015 / 30.362297;
|
|
9
|
+
/** Canonical chip presets (integrator-facing — see README / INTEGRATOR.md). */
|
|
10
|
+
export const SAVE_CHIP_PRESETS = {
|
|
11
|
+
/** Share-row default — meos logo + save in meos. */
|
|
12
|
+
default: { height: 31, paddingX: 10, radius: 2, iconSize: 16 },
|
|
13
|
+
/** Dense toolbar — meos logo + save (short label). */
|
|
14
|
+
compact: { height: 28, paddingX: 8, radius: 2, iconSize: 16 },
|
|
15
|
+
};
|
|
16
|
+
/** Documented host CSS vars integrators may set before initSaveButton. */
|
|
17
|
+
export const SAVE_CHIP_HOST_VARS = [
|
|
18
|
+
"--meos-save-chip-height",
|
|
19
|
+
"--meos-save-chip-padding-x",
|
|
20
|
+
"--meos-save-chip-radius",
|
|
21
|
+
"--meos-save-icon-size",
|
|
22
|
+
"--meos-save-chip-gap",
|
|
23
|
+
];
|
|
24
|
+
const HEIGHT = { min: 28, max: 40, default: 31 };
|
|
25
|
+
const PADDING_X = { min: 8, max: 16, default: 10 };
|
|
26
|
+
const RADIUS = { min: 0, max: 12, default: 2 };
|
|
27
|
+
const ICON = { min: 11, max: 16, default: 16 };
|
|
28
|
+
function clamp(n, min, max) {
|
|
29
|
+
return Math.min(max, Math.max(min, n));
|
|
30
|
+
}
|
|
31
|
+
/** Visible chip copy for a preset (compact uses short label). */
|
|
32
|
+
export function resolveChipLabel(preset) {
|
|
33
|
+
return preset === "compact" ? "save" : "save in meos";
|
|
34
|
+
}
|
|
35
|
+
/** Merge preset + explicit chip overrides (explicit wins). */
|
|
36
|
+
export function resolveChipCustomisation(chip, preset) {
|
|
37
|
+
const base = preset ? { ...SAVE_CHIP_PRESETS[preset] } : {};
|
|
38
|
+
const merged = { ...base, ...chip };
|
|
39
|
+
return Object.keys(merged).length > 0 ? merged : undefined;
|
|
40
|
+
}
|
|
41
|
+
/** Pure resolver for chip option object → CSS custom property values (px strings). */
|
|
42
|
+
export function resolveChipCustomisationVars(chip) {
|
|
43
|
+
const out = {};
|
|
44
|
+
if (chip?.height !== undefined) {
|
|
45
|
+
out["--meos-save-chip-height"] = `${clamp(chip.height, HEIGHT.min, HEIGHT.max)}px`;
|
|
46
|
+
}
|
|
47
|
+
if (chip?.paddingX !== undefined) {
|
|
48
|
+
out["--meos-save-chip-padding-x"] = `${clamp(chip.paddingX, PADDING_X.min, PADDING_X.max)}px`;
|
|
49
|
+
}
|
|
50
|
+
if (chip?.radius !== undefined) {
|
|
51
|
+
out["--meos-save-chip-radius"] = `${clamp(chip.radius, RADIUS.min, RADIUS.max)}px`;
|
|
52
|
+
}
|
|
53
|
+
if (chip?.iconSize !== undefined) {
|
|
54
|
+
out["--meos-save-icon-size"] = `${clamp(chip.iconSize, ICON.min, ICON.max)}px`;
|
|
55
|
+
}
|
|
56
|
+
return out;
|
|
57
|
+
}
|
|
58
|
+
/** Apply theme + optional chip object to a mount host or chip button. */
|
|
59
|
+
export function applyChipPresentation(el, theme = "auto", chip, preset) {
|
|
60
|
+
el.setAttribute("data-meos-theme", theme);
|
|
61
|
+
const resolved = resolveChipCustomisation(chip, preset);
|
|
62
|
+
const vars = resolveChipCustomisationVars(resolved);
|
|
63
|
+
for (const [name, value] of Object.entries(vars)) {
|
|
64
|
+
el.style.setProperty(name, value);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=chip-theme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chip-theme.js","sourceRoot":"","sources":["../../src/widget/chip-theme.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,sFAAsF;AACtF,MAAM,CAAC,MAAM,qBAAqB,GAAG,SAAS,GAAG,SAAS,CAAA;AAuB1D,+EAA+E;AAC/E,MAAM,CAAC,MAAM,iBAAiB,GAE1B;IACF,oDAAoD;IACpD,OAAO,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC9D,sDAAsD;IACtD,OAAO,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;CACrD,CAAA;AAEV,0EAA0E;AAC1E,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,yBAAyB;IACzB,4BAA4B;IAC5B,yBAAyB;IACzB,uBAAuB;IACvB,sBAAsB;CACd,CAAA;AAEV,MAAM,MAAM,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAW,CAAA;AACzD,MAAM,SAAS,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAW,CAAA;AAC3D,MAAM,MAAM,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAW,CAAA;AACvD,MAAM,IAAI,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAW,CAAA;AAEvD,SAAS,KAAK,CAAC,CAAS,EAAE,GAAW,EAAE,GAAW;IAChD,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAA;AACxC,CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,gBAAgB,CAAC,MAAuB;IACtD,OAAO,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,cAAc,CAAA;AACvD,CAAC;AAED,8DAA8D;AAC9D,MAAM,UAAU,wBAAwB,CACtC,IAA4B,EAC5B,MAAuB;IAEvB,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,iBAAiB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;IAC3D,MAAM,MAAM,GAAG,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,EAAE,CAAA;IACnC,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAA;AAC5D,CAAC;AAED,sFAAsF;AACtF,MAAM,UAAU,4BAA4B,CAC1C,IAA4B;IAE5B,MAAM,GAAG,GAA2B,EAAE,CAAA;IACtC,IAAI,IAAI,EAAE,MAAM,KAAK,SAAS,EAAE,CAAC;QAC/B,GAAG,CAAC,yBAAyB,CAAC,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,IAAI,CAAA;IACpF,CAAC;IACD,IAAI,IAAI,EAAE,QAAQ,KAAK,SAAS,EAAE,CAAC;QACjC,GAAG,CAAC,4BAA4B,CAAC,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC,GAAG,EAAE,SAAS,CAAC,GAAG,CAAC,IAAI,CAAA;IAC/F,CAAC;IACD,IAAI,IAAI,EAAE,MAAM,KAAK,SAAS,EAAE,CAAC;QAC/B,GAAG,CAAC,yBAAyB,CAAC,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,IAAI,CAAA;IACpF,CAAC;IACD,IAAI,IAAI,EAAE,QAAQ,KAAK,SAAS,EAAE,CAAC;QACjC,GAAG,CAAC,uBAAuB,CAAC,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAA;IAChF,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC;AAED,yEAAyE;AACzE,MAAM,UAAU,qBAAqB,CACnC,EAAe,EACf,QAAuB,MAAM,EAC7B,IAA4B,EAC5B,MAAuB;IAEvB,EAAE,CAAC,YAAY,CAAC,iBAAiB,EAAE,KAAK,CAAC,CAAA;IAEzC,MAAM,QAAQ,GAAG,wBAAwB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;IACvD,MAAM,IAAI,GAAG,4BAA4B,CAAC,QAAQ,CAAC,CAAA;IACnD,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QACjD,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;IACnC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chip-theme.test.d.ts","sourceRoot":"","sources":["../../src/widget/chip-theme.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { resolveChipCustomisation, resolveChipCustomisationVars, resolveChipLabel, SAVE_CHIP_PRESETS, } from "./chip-theme.js";
|
|
3
|
+
describe("resolveChipCustomisationVars", () => {
|
|
4
|
+
it("clamps height", () => {
|
|
5
|
+
expect(resolveChipCustomisationVars({ height: 99 })).toEqual({
|
|
6
|
+
"--meos-save-chip-height": "40px",
|
|
7
|
+
});
|
|
8
|
+
expect(resolveChipCustomisationVars({ height: 10 })).toEqual({
|
|
9
|
+
"--meos-save-chip-height": "28px",
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
it("applies radius, padding, and icon size", () => {
|
|
13
|
+
expect(resolveChipCustomisationVars({ radius: 8, paddingX: 12, iconSize: 14 })).toEqual({
|
|
14
|
+
"--meos-save-chip-radius": "8px",
|
|
15
|
+
"--meos-save-chip-padding-x": "12px",
|
|
16
|
+
"--meos-save-icon-size": "14px",
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
it("returns empty object when chip omitted", () => {
|
|
20
|
+
expect(resolveChipCustomisationVars()).toEqual({});
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
describe("resolveChipCustomisation", () => {
|
|
24
|
+
it("merges preset with overrides", () => {
|
|
25
|
+
expect(resolveChipCustomisation({ paddingX: 12 }, "compact")).toEqual({
|
|
26
|
+
...SAVE_CHIP_PRESETS.compact,
|
|
27
|
+
paddingX: 12,
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
it("returns preset alone", () => {
|
|
31
|
+
expect(resolveChipCustomisation(undefined, "default")).toEqual(SAVE_CHIP_PRESETS.default);
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
describe("resolveChipLabel", () => {
|
|
35
|
+
it("uses full label by default", () => {
|
|
36
|
+
expect(resolveChipLabel()).toBe("save in meos");
|
|
37
|
+
expect(resolveChipLabel("default")).toBe("save in meos");
|
|
38
|
+
});
|
|
39
|
+
it("uses short label for compact", () => {
|
|
40
|
+
expect(resolveChipLabel("compact")).toBe("save");
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
//# sourceMappingURL=chip-theme.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chip-theme.test.js","sourceRoot":"","sources":["../../src/widget/chip-theme.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAC7C,OAAO,EACL,wBAAwB,EACxB,4BAA4B,EAC5B,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,iBAAiB,CAAA;AAExB,QAAQ,CAAC,8BAA8B,EAAE,GAAG,EAAE;IAC5C,EAAE,CAAC,eAAe,EAAE,GAAG,EAAE;QACvB,MAAM,CAAC,4BAA4B,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;YAC3D,yBAAyB,EAAE,MAAM;SAClC,CAAC,CAAA;QACF,MAAM,CAAC,4BAA4B,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;YAC3D,yBAAyB,EAAE,MAAM;SAClC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;QAChD,MAAM,CAAC,4BAA4B,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;YACtF,yBAAyB,EAAE,KAAK;YAChC,4BAA4B,EAAE,MAAM;YACpC,uBAAuB,EAAE,MAAM;SAChC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;QAChD,MAAM,CAAC,4BAA4B,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;IACpD,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA;AAEF,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,EAAE,CAAC,8BAA8B,EAAE,GAAG,EAAE;QACtC,MAAM,CAAC,wBAAwB,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,EAAE,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC;YACpE,GAAG,iBAAiB,CAAC,OAAO;YAC5B,QAAQ,EAAE,EAAE;SACb,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,sBAAsB,EAAE,GAAG,EAAE;QAC9B,MAAM,CAAC,wBAAwB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,OAAO,CAC5D,iBAAiB,CAAC,OAAO,CAC1B,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA;AAEF,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,EAAE,CAAC,4BAA4B,EAAE,GAAG,EAAE;QACpC,MAAM,CAAC,gBAAgB,EAAE,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;QAC/C,MAAM,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;IAC1D,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,8BAA8B,EAAE,GAAG,EAAE;QACtC,MAAM,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAClD,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WHY: Branded meos mark for the save chip — monochrome, currentColor.
|
|
3
|
+
* WHAT: Inline SVG string for the bundled logo path (no external asset URL).
|
|
4
|
+
* WHERE: Composed inside initSaveButton / integrator markup via buildSaveChipMarkup.
|
|
5
|
+
* GUARDED: check-widget-branding verifies icon class + SVG presence in widget sources.
|
|
6
|
+
*/
|
|
7
|
+
/** Exact viewBox from assets/branding/meos-logo-charcoal-nostroke.svg (SSOT). */
|
|
8
|
+
export declare const MEOS_SAVE_ICON_VIEWBOX = "0 0 27.275015 30.362297";
|
|
9
|
+
export declare function buildSaveIconSvg(className: string): string;
|
|
10
|
+
//# sourceMappingURL=icon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../src/widget/icon.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,iFAAiF;AACjF,eAAO,MAAM,sBAAsB,4BAA4B,CAAA;AAQ/D,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAE1D"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WHY: Branded meos mark for the save chip — monochrome, currentColor.
|
|
3
|
+
* WHAT: Inline SVG string for the bundled logo path (no external asset URL).
|
|
4
|
+
* WHERE: Composed inside initSaveButton / integrator markup via buildSaveChipMarkup.
|
|
5
|
+
* GUARDED: check-widget-branding verifies icon class + SVG presence in widget sources.
|
|
6
|
+
*/
|
|
7
|
+
/** Exact viewBox from assets/branding/meos-logo-charcoal-nostroke.svg (SSOT). */
|
|
8
|
+
export const MEOS_SAVE_ICON_VIEWBOX = "0 0 27.275015 30.362297";
|
|
9
|
+
/** Logo path from assets/branding/meos-logo-charcoal-nostroke.svg */
|
|
10
|
+
const MEOS_LOGO_PATH = "m 392.92917,553.87771 v 12.58642 c 0,0.81325 -0.43385,1.5653 -1.13856,1.97265 l -7.84461,4.52907 c -2.06849,1.19415 -4.65283,-0.29916 -4.65415,-2.68721 v -0.66167 c 0,-7.00219 -5.8219,-10.18416 -9.06937,-11.41442 -1.02593,-0.38945 -2.12418,0.3626 -2.12418,1.45958 v 0.004 c 0.0556,4.33298 2.37151,8.34226 6.13053,10.54974 l 4.52634,2.65794 c 0.31136,0.18203 0.5074,0.51155 0.52136,0.87166 0,0.01 0,0.0195 0.001,0.0342 0.0342,0.82852 -0.86468,1.36652 -1.5834,0.95219 l -10.90009,-6.29314 c -0.70476,-0.4075 -1.13988,-1.1594 -1.13988,-1.97265 v -9.05809 c 0.001,-2.3883 2.58565,-3.87985 4.65415,-2.68717 l 0.58529,0.33772 c 6.05961,3.4906 11.72027,0.0439 14.4088,-2.15337 0.38945,-0.31819 0.57831,-0.76732 0.57831,-1.21498 0,-0.53244 -0.26695,-1.05931 -0.78401,-1.35676 -3.78117,-2.11857 -8.41039,-2.11721 -12.20269,0.0342 l -4.56528,2.59117 c -0.31282,0.17813 -0.69509,0.18203 -1.0148,0.0146 -0.01,-0.005 -0.0195,-0.01 -0.0293,-0.0146 -0.73399,-0.38652 -0.752,-1.43177 -0.0342,-1.84747 l 10.90019,-6.29319 c 0.70476,-0.4075 1.57359,-0.4075 2.27845,0 l 7.84461,4.52907 c 2.06713,1.19415 2.06713,4.17877 0,5.37429 l -0.57411,0.33088 c -0.01,0.005 -0.0244,0.0146 -0.0342,0.0195 -6.03043,3.50597 -5.87334,10.12028 -5.31733,13.54285 0.12933,0.79656 0.81608,1.31928 1.54865,1.31928 0.26109,0 0.52966,-0.0669 0.78128,-0.21278 3.72559,-2.21456 6.03883,-6.2251 6.07079,-10.58459 l 0.0391,-5.2492 c 0.003,-0.36016 0.19033,-0.69373 0.49489,-0.88694 0.01,-0.005 0.0195,-0.01 0.0244,-0.0146 0.70178,-0.44215 1.61654,0.0654 1.61654,0.89529 z";
|
|
11
|
+
const LOGO_TRANSFORM = "translate(-365.65417,-544.51253)";
|
|
12
|
+
export function buildSaveIconSvg(className) {
|
|
13
|
+
return `<svg class="${className}" viewBox="${MEOS_SAVE_ICON_VIEWBOX}" xmlns="http://www.w3.org/2000/svg" shape-rendering="geometricPrecision" aria-hidden="true" focusable="false"><g transform="${LOGO_TRANSFORM}"><path d="${MEOS_LOGO_PATH}" fill="currentColor"/></g></svg>`;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=icon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon.js","sourceRoot":"","sources":["../../src/widget/icon.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,iFAAiF;AACjF,MAAM,CAAC,MAAM,sBAAsB,GAAG,yBAAyB,CAAA;AAE/D,qEAAqE;AACrE,MAAM,cAAc,GAClB,w/CAAw/C,CAAA;AAE1/C,MAAM,cAAc,GAAG,kCAAkC,CAAA;AAEzD,MAAM,UAAU,gBAAgB,CAAC,SAAiB;IAChD,OAAO,eAAe,SAAS,cAAc,sBAAsB,gIAAgI,cAAc,cAAc,cAAc,mCAAmC,CAAA;AAClR,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WHY: Embeddable save-in-meos widget — builds MDP import URLs on user gesture.
|
|
3
|
+
* WHAT: initSaveButton mounts a branded chip (shadow DOM or fixed classes) + navigates.
|
|
4
|
+
* WHERE: Bundled as dist/widget.iife.js for script-tag consumers.
|
|
5
|
+
* GUARDED: No label/style overrides — branding enforced by implementation + checker.
|
|
6
|
+
*/
|
|
7
|
+
import { type ImportIntentInput } from "../import-intent-v1.js";
|
|
8
|
+
import { type SaveChipCustomisation, type SaveChipPreset, type SaveChipTheme } from "./chip-theme.js";
|
|
9
|
+
export interface SaveButtonOptions extends ImportIntentInput {
|
|
10
|
+
widgetId?: string;
|
|
11
|
+
/**
|
|
12
|
+
* `auto` follows OS dark mode; `light` / `dark` pin the chip palette.
|
|
13
|
+
* Does not change font or logo — only foreground, border, and hover colours.
|
|
14
|
+
*/
|
|
15
|
+
theme?: SaveChipTheme;
|
|
16
|
+
/**
|
|
17
|
+
* `default` — logo + save in meos. `compact` — logo + save (short label).
|
|
18
|
+
* Explicit `chip` fields override preset dimensions.
|
|
19
|
+
*/
|
|
20
|
+
chipPreset?: SaveChipPreset;
|
|
21
|
+
/**
|
|
22
|
+
* Bounded shape/size tweaks (height, padding, radius, icon box).
|
|
23
|
+
* Font and logo artwork are not customisable — use CSS host vars instead:
|
|
24
|
+
* `--meos-save-chip-height`, `--meos-save-chip-padding-x`, `--meos-save-chip-radius`,
|
|
25
|
+
* `--meos-save-icon-size`.
|
|
26
|
+
*/
|
|
27
|
+
chip?: SaveChipCustomisation;
|
|
28
|
+
}
|
|
29
|
+
/** Fixed user-facing copy — not customisable (meos brand). */
|
|
30
|
+
export type { SaveChipCustomisation, SaveChipPreset, SaveChipTheme, } from "./chip-theme.js";
|
|
31
|
+
export { SAVE_CHIP_HOST_VARS, SAVE_CHIP_PRESETS, resolveChipLabel, } from "./chip-theme.js";
|
|
32
|
+
export declare const MEOS_SAVE_LABEL: "save in meos";
|
|
33
|
+
/** Visible label when `chipPreset: "compact"` — aria-label stays MEOS_SAVE_LABEL. */
|
|
34
|
+
export declare const MEOS_SAVE_COMPACT_LABEL: "save";
|
|
35
|
+
export declare const MEOS_SAVE_CHIP_CLASS: "meos-save-chip";
|
|
36
|
+
export declare const MEOS_SAVE_ICON_CLASS: "meos-save-chip__icon";
|
|
37
|
+
export declare const MEOS_SAVE_LABEL_CLASS: "meos-save-chip__label";
|
|
38
|
+
/**
|
|
39
|
+
* Build inner HTML for the branded chip (icon + label).
|
|
40
|
+
* Pass `chipPreset: "compact"` for the short **save** label.
|
|
41
|
+
*/
|
|
42
|
+
export declare function buildSaveChipMarkup(preset?: SaveChipPreset): string;
|
|
43
|
+
/** Inject widget styles once at document level (npm hosts that import widget.css may skip). */
|
|
44
|
+
export declare function ensureWidgetStyles(): void;
|
|
45
|
+
/**
|
|
46
|
+
* Wire a mount point (or existing button) to build and navigate to a meos import deeplink.
|
|
47
|
+
*
|
|
48
|
+
* - Empty container → closed shadow root with branded chip (integrators cannot restyle).
|
|
49
|
+
* - Existing button/anchor → branded markup + document-level styles (classes are fixed).
|
|
50
|
+
*/
|
|
51
|
+
export declare function initSaveButton(target: string | HTMLElement, options?: SaveButtonOptions): HTMLButtonElement | null;
|
|
52
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/widget/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAGL,KAAK,iBAAiB,EACvB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAGL,KAAK,qBAAqB,EAC1B,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,iBAAiB,CAAA;AAIxB,MAAM,WAAW,iBAAkB,SAAQ,iBAAiB;IAC1D,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;;OAGG;IACH,KAAK,CAAC,EAAE,aAAa,CAAA;IACrB;;;OAGG;IACH,UAAU,CAAC,EAAE,cAAc,CAAA;IAC3B;;;;;OAKG;IACH,IAAI,CAAC,EAAE,qBAAqB,CAAA;CAC7B;AAED,8DAA8D;AAC9D,YAAY,EACV,qBAAqB,EACrB,cAAc,EACd,aAAa,GACd,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,iBAAiB,CAAA;AACxB,eAAO,MAAM,eAAe,EAAG,cAAuB,CAAA;AACtD,qFAAqF;AACrF,eAAO,MAAM,uBAAuB,EAAG,MAAe,CAAA;AAEtD,eAAO,MAAM,oBAAoB,EAAG,gBAAyB,CAAA;AAC7D,eAAO,MAAM,oBAAoB,EAAG,sBAA+B,CAAA;AACnE,eAAO,MAAM,qBAAqB,EAAG,uBAAgC,CAAA;AAQrE;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,CAAC,EAAE,cAAc,GAAG,MAAM,CAGnE;AAED,+FAA+F;AAC/F,wBAAgB,kBAAkB,IAAI,IAAI,CAYzC;AAiGD;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,GAAG,WAAW,EAC5B,OAAO,GAAE,iBAER,GACA,iBAAiB,GAAG,IAAI,CA8B1B"}
|