croswil_comp_adm 2.0.20 β 2.0.22
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/dist/index.js +1 -1
- package/package.json +5 -3
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SvelteComponent as t,init as e,safe_not_equal as n,assign as i,exclude_internal_props as r,noop as o,detach as l,run_all as s,attr as c,set_input_value as a,insert as u,listen as f,element as d,binding_callbacks as h,create_slot as p,transition_out as m,transition_in as w,set_data as b,update_slot_base as g,get_all_dirty_from_scope as v,get_slot_changes as x,toggle_class as y,append as k,text as $,space as _,set_style as D,empty as S,group_outros as z,check_outros as M,create_out_transition as E,add_render_callback as j,create_in_transition as A,HtmlTag as C,destroy_component as T,mount_component as N,stop_propagation as O,create_component as F,component_subscribe as I,prevent_default as R,create_bidirectional_transition as L,ensure_array_like as B,destroy_each as H,src_url_equal as P,globals as U,bubble as V,bind as Z,add_flush_callback as Y,svg_element as q}from"svelte/internal";import{onMount as G,tick as X,createEventDispatcher as W,onDestroy as K,getContext as J,setContext as Q}from"svelte";import{fade as tt,scale as et,fly as nt}from"svelte/transition";import{goto as it}from"$app/navigation";if(Date.prototype.getWeek||(Date.prototype.getWeek=function(){let t=new Date(this.getFullYear(),0,1);return Math.ceil(((this-t)/864e5+t.getDay()-1)/7)},Date.prototype.getYWeek=function(){let t=new Date(this.getFullYear(),0,1);return 100*this.getFullYear()+Math.ceil(((this-t)/864e5+t.getDay()-1)/7)}),!Number.prototype.toDate){const t=t=>{let e,n,i,r,o,l,s,c,a;return e=t,n=Math.floor(e),i=Math.floor(1e6*(e-n)+.8),r=n%100,r<1&&(r=1),n=Math.floor(n/100),o=n%100,o<1&&(o=1),l=Math.floor(n/100),l<1900&&(l=1900),a=i%100,i=Math.floor(i/100),c=i%100,s=Math.floor(i/100),new Date(l,o-1,r,s,c,a)};Number.prototype.toDate=function(){return t(this.valueOf()+0)},Date.prototype.toInt||(Date.prototype.toInt=function(){const t=this;return t.getDate()+100*(t.getMonth()+1)+1e4*t.getFullYear()}),Date.prototype.toFloat||(Date.prototype.toFloat=function(){return Math.floor(1e4*this.getDate()+1e6*(this.getMonth()+1)+1e8*this.getFullYear()+100*this.getHours()+this.getMinutes()+.5)/1e4}),Number.prototype.addmesi=function(e){const n=t(this.valueOf()+0),i=n.getDate();return n.setMonth(n.getMonth()+e),i>20&&n.getDate()<10&&n.setDate(0),Math.floor(this)===this?n.toInt():n.toFloat()},Number.prototype.addgiorni=function(t=0,e=0,n=0){const i=new Date(this.toDate().valueOf()+6e4*t*24*60+6e4*e*60+n);return Math.floor(this)===this?i.toInt():i.toFloat()},Number.prototype.diffgiorni=function(e){const n=t(this.valueOf()+0),i=t(e);return Math.ceil((i-n)/864e5)},Number.prototype.diffore=function(e){const n=t(this.valueOf()+0),i=t(e);return Math.ceil((i-n)/36e5)},Number.prototype.diffminuti=function(e){const n=t(this.valueOf()+0),i=t(e);return Math.ceil((i-n)/6e4)},Number.prototype.finemese=function(){return new Date(new Date(new Date(this.toDate().setDate(1)).setDate(32)).setDate(0)).toInt()},Number.prototype.iniziomese=function(){return new Date(this.toDate().setDate(1)).toInt()},Number.prototype.fineanno=function(){return 1e4*Math.floor(this/1e4)+1231},Number.prototype.inizioanno=function(){return 1e4*Math.floor(this/1e4)+101},Number.prototype.clamp=function(t,e){return this<t?t:this>e?e:this},Number.prototype.dgiorno=function(){return Math.floor(this)%100},Number.prototype.dmese=function(){return Math.floor(this/100)%100},Number.prototype.danno=function(){return Math.floor(this/1e4)},Number.prototype.weekday=function(){return t(this).getDay()},Number.prototype.giornimese=function(){return this.finemese()%100},Number.prototype.week=function(){return t(this).getWeek()},Number.prototype.yweek=function(){return t(this).getYWeek()},Array.prototype.random=function(){return this[Math.floor(Math.random()*this.length)]},Array.prototype.shuffle=function(){let t=this,e=t.length;for(;e>0;){let n=Math.floor(Math.random()*e);e--;let i=t[e];t[e]=t[n],t[n]=i}return t},Number.random=function(t,e){if(void 0===t)return Math.random();if(void 0===e)return Math.random()*t;if(t>e){let n=t;t=e,e=n}return Math.random()*(e-t)+t},Number.prototype.int=Number.prototype.floor=function(){return isNaN(this)||!isFinite(this)?0:Math.floor(this)},Number.prototype.round=function(){return isNaN(this)||!isFinite(this)?0:Math.floor(this+.5)},Number.prototype.ceil=function(){return isNaN(this)||!isFinite(this)?0:Math.ceil(this)}}String.prototype.splitComma||(String.prototype.splitComma=function(){return(this||"").split(/[;,]+/)}),String.prototype.lines||(String.prototype.lines=function(){return(this||"").split(/[\r\n]+/)}),String.prototype.var||(String.prototype.var=function(t,e){if(e||(e=";"),t){t=t.toLowerCase();const n=this.split(e);for(let e=0;e<n.length;e++){const i=n[e].indexOf("=");if(i>0&&n[e].substr(0,i).toLowerCase()===t)return n[e].substr(i+1,9999)}}return""}),String.prototype.setvar||(String.prototype.setvar=function(t,e,n){if(n||(n=";"),t){t=t.toUpperCase();const i=this.split(n);for(let r=0;r<i.length;r++){const o=i[r].indexOf("=");if(o>0&&i[r].substr(0,o).toUpperCase()===t)return e?i[r]=t+"="+e:i.splice(r,1),i.join(n)}}return e?this+n+t+"="+e:this});var rt={};!function(t){var e="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;t.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var n=e.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var i in n)n.hasOwnProperty(i)&&(t[i]=n[i])}}return t},t.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var n={arraySet:function(t,e,n,i,r){if(e.subarray&&t.subarray)t.set(e.subarray(n,n+i),r);else for(var o=0;o<i;o++)t[r+o]=e[n+o]},flattenChunks:function(t){var e,n,i,r,o,l;for(i=0,e=0,n=t.length;e<n;e++)i+=t[e].length;for(l=new Uint8Array(i),r=0,e=0,n=t.length;e<n;e++)o=t[e],l.set(o,r),r+=o.length;return l}},i={arraySet:function(t,e,n,i,r){for(var o=0;o<i;o++)t[r+o]=e[n+o]},flattenChunks:function(t){return[].concat.apply([],t)}};t.setTyped=function(e){e?(t.Buf8=Uint8Array,t.Buf16=Uint16Array,t.Buf32=Int32Array,t.assign(t,n)):(t.Buf8=Array,t.Buf16=Array,t.Buf32=Array,t.assign(t,i))},t.setTyped(e)}(rt);var ot={},lt={},st={},ct=rt;function at(t){for(var e=t.length;--e>=0;)t[e]=0}var ut=[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],ft=[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],dt=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],ht=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],pt=new Array(576);at(pt);var mt=new Array(60);at(mt);var wt=new Array(512);at(wt);var bt=new Array(256);at(bt);var gt=new Array(29);at(gt);var vt,xt,yt,kt=new Array(30);function $t(t,e,n,i,r){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=i,this.max_length=r,this.has_stree=t&&t.length}function _t(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function Dt(t){return t<256?wt[t]:wt[256+(t>>>7)]}function St(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function zt(t,e,n){t.bi_valid>16-n?(t.bi_buf|=e<<t.bi_valid&65535,St(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=n-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=n)}function Mt(t,e,n){zt(t,n[2*e],n[2*e+1])}function Et(t,e){var n=0;do{n|=1&t,t>>>=1,n<<=1}while(--e>0);return n>>>1}function jt(t,e,n){var i,r,o=new Array(16),l=0;for(i=1;i<=15;i++)o[i]=l=l+n[i-1]<<1;for(r=0;r<=e;r++){var s=t[2*r+1];0!==s&&(t[2*r]=Et(o[s]++,s))}}function At(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function Ct(t){t.bi_valid>8?St(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function Tt(t,e,n,i){var r=2*e,o=2*n;return t[r]<t[o]||t[r]===t[o]&&i[e]<=i[n]}function Nt(t,e,n){for(var i=t.heap[n],r=n<<1;r<=t.heap_len&&(r<t.heap_len&&Tt(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!Tt(e,i,t.heap[r],t.depth));)t.heap[n]=t.heap[r],n=r,r<<=1;t.heap[n]=i}function Ot(t,e,n){var i,r,o,l,s=0;if(0!==t.last_lit)do{i=t.pending_buf[t.d_buf+2*s]<<8|t.pending_buf[t.d_buf+2*s+1],r=t.pending_buf[t.l_buf+s],s++,0===i?Mt(t,r,e):(Mt(t,(o=bt[r])+256+1,e),0!==(l=ut[o])&&zt(t,r-=gt[o],l),Mt(t,o=Dt(--i),n),0!==(l=ft[o])&&zt(t,i-=kt[o],l))}while(s<t.last_lit);Mt(t,256,e)}function Ft(t,e){var n,i,r,o=e.dyn_tree,l=e.stat_desc.static_tree,s=e.stat_desc.has_stree,c=e.stat_desc.elems,a=-1;for(t.heap_len=0,t.heap_max=573,n=0;n<c;n++)0!==o[2*n]?(t.heap[++t.heap_len]=a=n,t.depth[n]=0):o[2*n+1]=0;for(;t.heap_len<2;)o[2*(r=t.heap[++t.heap_len]=a<2?++a:0)]=1,t.depth[r]=0,t.opt_len--,s&&(t.static_len-=l[2*r+1]);for(e.max_code=a,n=t.heap_len>>1;n>=1;n--)Nt(t,o,n);r=c;do{n=t.heap[1],t.heap[1]=t.heap[t.heap_len--],Nt(t,o,1),i=t.heap[1],t.heap[--t.heap_max]=n,t.heap[--t.heap_max]=i,o[2*r]=o[2*n]+o[2*i],t.depth[r]=(t.depth[n]>=t.depth[i]?t.depth[n]:t.depth[i])+1,o[2*n+1]=o[2*i+1]=r,t.heap[1]=r++,Nt(t,o,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var n,i,r,o,l,s,c=e.dyn_tree,a=e.max_code,u=e.stat_desc.static_tree,f=e.stat_desc.has_stree,d=e.stat_desc.extra_bits,h=e.stat_desc.extra_base,p=e.stat_desc.max_length,m=0;for(o=0;o<=15;o++)t.bl_count[o]=0;for(c[2*t.heap[t.heap_max]+1]=0,n=t.heap_max+1;n<573;n++)(o=c[2*c[2*(i=t.heap[n])+1]+1]+1)>p&&(o=p,m++),c[2*i+1]=o,i>a||(t.bl_count[o]++,l=0,i>=h&&(l=d[i-h]),s=c[2*i],t.opt_len+=s*(o+l),f&&(t.static_len+=s*(u[2*i+1]+l)));if(0!==m){do{for(o=p-1;0===t.bl_count[o];)o--;t.bl_count[o]--,t.bl_count[o+1]+=2,t.bl_count[p]--,m-=2}while(m>0);for(o=p;0!==o;o--)for(i=t.bl_count[o];0!==i;)(r=t.heap[--n])>a||(c[2*r+1]!==o&&(t.opt_len+=(o-c[2*r+1])*c[2*r],c[2*r+1]=o),i--)}}(t,e),jt(o,a,t.bl_count)}function It(t,e,n){var i,r,o=-1,l=e[1],s=0,c=7,a=4;for(0===l&&(c=138,a=3),e[2*(n+1)+1]=65535,i=0;i<=n;i++)r=l,l=e[2*(i+1)+1],++s<c&&r===l||(s<a?t.bl_tree[2*r]+=s:0!==r?(r!==o&&t.bl_tree[2*r]++,t.bl_tree[32]++):s<=10?t.bl_tree[34]++:t.bl_tree[36]++,s=0,o=r,0===l?(c=138,a=3):r===l?(c=6,a=3):(c=7,a=4))}function Rt(t,e,n){var i,r,o=-1,l=e[1],s=0,c=7,a=4;for(0===l&&(c=138,a=3),i=0;i<=n;i++)if(r=l,l=e[2*(i+1)+1],!(++s<c&&r===l)){if(s<a)do{Mt(t,r,t.bl_tree)}while(0!=--s);else 0!==r?(r!==o&&(Mt(t,r,t.bl_tree),s--),Mt(t,16,t.bl_tree),zt(t,s-3,2)):s<=10?(Mt(t,17,t.bl_tree),zt(t,s-3,3)):(Mt(t,18,t.bl_tree),zt(t,s-11,7));s=0,o=r,0===l?(c=138,a=3):r===l?(c=6,a=3):(c=7,a=4)}}at(kt);var Lt=!1;function Bt(t,e,n,i){zt(t,0+(i?1:0),3),function(t,e,n){Ct(t),St(t,n),St(t,~n),ct.arraySet(t.pending_buf,t.window,e,n,t.pending),t.pending+=n}(t,e,n)}st._tr_init=function(t){Lt||(function(){var t,e,n,i,r,o=new Array(16);for(n=0,i=0;i<28;i++)for(gt[i]=n,t=0;t<1<<ut[i];t++)bt[n++]=i;for(bt[n-1]=i,r=0,i=0;i<16;i++)for(kt[i]=r,t=0;t<1<<ft[i];t++)wt[r++]=i;for(r>>=7;i<30;i++)for(kt[i]=r<<7,t=0;t<1<<ft[i]-7;t++)wt[256+r++]=i;for(e=0;e<=15;e++)o[e]=0;for(t=0;t<=143;)pt[2*t+1]=8,t++,o[8]++;for(;t<=255;)pt[2*t+1]=9,t++,o[9]++;for(;t<=279;)pt[2*t+1]=7,t++,o[7]++;for(;t<=287;)pt[2*t+1]=8,t++,o[8]++;for(jt(pt,287,o),t=0;t<30;t++)mt[2*t+1]=5,mt[2*t]=Et(t,5);vt=new $t(pt,ut,257,286,15),xt=new $t(mt,ft,0,30,15),yt=new $t(new Array(0),dt,0,19,7)}(),Lt=!0),t.l_desc=new _t(t.dyn_ltree,vt),t.d_desc=new _t(t.dyn_dtree,xt),t.bl_desc=new _t(t.bl_tree,yt),t.bi_buf=0,t.bi_valid=0,At(t)},st._tr_stored_block=Bt,st._tr_flush_block=function(t,e,n,i){var r,o,l=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,n=4093624447;for(e=0;e<=31;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),Ft(t,t.l_desc),Ft(t,t.d_desc),l=function(t){var e;for(It(t,t.dyn_ltree,t.l_desc.max_code),It(t,t.dyn_dtree,t.d_desc.max_code),Ft(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*ht[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),r=t.opt_len+3+7>>>3,(o=t.static_len+3+7>>>3)<=r&&(r=o)):r=o=n+5,n+4<=r&&-1!==e?Bt(t,e,n,i):4===t.strategy||o===r?(zt(t,2+(i?1:0),3),Ot(t,pt,mt)):(zt(t,4+(i?1:0),3),function(t,e,n,i){var r;for(zt(t,e-257,5),zt(t,n-1,5),zt(t,i-4,4),r=0;r<i;r++)zt(t,t.bl_tree[2*ht[r]+1],3);Rt(t,t.dyn_ltree,e-1),Rt(t,t.dyn_dtree,n-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,l+1),Ot(t,t.dyn_ltree,t.dyn_dtree)),At(t),i&&Ct(t)},st._tr_tally=function(t,e,n){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&n,t.last_lit++,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(bt[n]+256+1)]++,t.dyn_dtree[2*Dt(e)]++),t.last_lit===t.lit_bufsize-1},st._tr_align=function(t){zt(t,2,3),Mt(t,256,pt),function(t){16===t.bi_valid?(St(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)};var Ht,Pt=function(t,e,n,i){for(var r=65535&t,o=t>>>16&65535,l=0;0!==n;){n-=l=n>2e3?2e3:n;do{o=o+(r=r+e[i++]|0)|0}while(--l);r%=65521,o%=65521}return r|o<<16},Ut=function(){for(var t,e=[],n=0;n<256;n++){t=n;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e}(),Vt=function(t,e,n,i){var r=Ut,o=i+n;t^=-1;for(var l=i;l<o;l++)t=t>>>8^r[255&(t^e[l])];return~t},Zt={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"},Yt=rt,qt=st,Gt=Pt,Xt=Vt,Wt=Zt,Kt=-2,Jt=258,Qt=262,te=103,ee=113,ne=666;function ie(t,e){return t.msg=Wt[e],e}function re(t){return(t<<1)-(t>4?9:0)}function oe(t){for(var e=t.length;--e>=0;)t[e]=0}function le(t){var e=t.state,n=e.pending;n>t.avail_out&&(n=t.avail_out),0!==n&&(Yt.arraySet(t.output,e.pending_buf,e.pending_out,n,t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,0===e.pending&&(e.pending_out=0))}function se(t,e){qt._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,le(t.strm)}function ce(t,e){t.pending_buf[t.pending++]=e}function ae(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function ue(t,e){var n,i,r=t.max_chain_length,o=t.strstart,l=t.prev_length,s=t.nice_match,c=t.strstart>t.w_size-Qt?t.strstart-(t.w_size-Qt):0,a=t.window,u=t.w_mask,f=t.prev,d=t.strstart+Jt,h=a[o+l-1],p=a[o+l];t.prev_length>=t.good_match&&(r>>=2),s>t.lookahead&&(s=t.lookahead);do{if(a[(n=e)+l]===p&&a[n+l-1]===h&&a[n]===a[o]&&a[++n]===a[o+1]){o+=2,n++;do{}while(a[++o]===a[++n]&&a[++o]===a[++n]&&a[++o]===a[++n]&&a[++o]===a[++n]&&a[++o]===a[++n]&&a[++o]===a[++n]&&a[++o]===a[++n]&&a[++o]===a[++n]&&o<d);if(i=Jt-(d-o),o=d-Jt,i>l){if(t.match_start=e,l=i,i>=s)break;h=a[o+l-1],p=a[o+l]}}}while((e=f[e&u])>c&&0!=--r);return l<=t.lookahead?l:t.lookahead}function fe(t){var e,n,i,r,o,l,s,c,a,u,f=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=f+(f-Qt)){Yt.arraySet(t.window,t.window,f,f,0),t.match_start-=f,t.strstart-=f,t.block_start-=f,e=n=t.hash_size;do{i=t.head[--e],t.head[e]=i>=f?i-f:0}while(--n);e=n=f;do{i=t.prev[--e],t.prev[e]=i>=f?i-f:0}while(--n);r+=f}if(0===t.strm.avail_in)break;if(l=t.strm,s=t.window,c=t.strstart+t.lookahead,a=r,u=void 0,(u=l.avail_in)>a&&(u=a),n=0===u?0:(l.avail_in-=u,Yt.arraySet(s,l.input,l.next_in,u,c),1===l.state.wrap?l.adler=Gt(l.adler,s,u,c):2===l.state.wrap&&(l.adler=Xt(l.adler,s,u,c)),l.next_in+=u,l.total_in+=u,u),t.lookahead+=n,t.lookahead+t.insert>=3)for(o=t.strstart-t.insert,t.ins_h=t.window[o],t.ins_h=(t.ins_h<<t.hash_shift^t.window[o+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[o+3-1])&t.hash_mask,t.prev[o&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=o,o++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<Qt&&0!==t.strm.avail_in)}function de(t,e){for(var n,i;;){if(t.lookahead<Qt){if(fe(t),t.lookahead<Qt&&0===e)return 1;if(0===t.lookahead)break}if(n=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==n&&t.strstart-n<=t.w_size-Qt&&(t.match_length=ue(t,n)),t.match_length>=3)if(i=qt._tr_tally(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else i=qt._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(se(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(se(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(se(t,!1),0===t.strm.avail_out)?1:2}function he(t,e){for(var n,i,r;;){if(t.lookahead<Qt){if(fe(t),t.lookahead<Qt&&0===e)return 1;if(0===t.lookahead)break}if(n=0,t.lookahead>=3&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==n&&t.prev_length<t.max_lazy_match&&t.strstart-n<=t.w_size-Qt&&(t.match_length=ue(t,n),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,i=qt._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+3-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,i&&(se(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((i=qt._tr_tally(t,0,t.window[t.strstart-1]))&&se(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=qt._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(se(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(se(t,!1),0===t.strm.avail_out)?1:2}function pe(t,e,n,i,r){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=i,this.func=r}function me(){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 Yt.Buf16(1146),this.dyn_dtree=new Yt.Buf16(122),this.bl_tree=new Yt.Buf16(78),oe(this.dyn_ltree),oe(this.dyn_dtree),oe(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Yt.Buf16(16),this.heap=new Yt.Buf16(573),oe(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Yt.Buf16(573),oe(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 we(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=2,(e=t.state).pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:ee,t.adler=2===e.wrap?0:1,e.last_flush=0,qt._tr_init(e),0):ie(t,Kt)}function be(t){var e=we(t);return 0===e&&function(t){t.window_size=2*t.w_size,oe(t.head),t.max_lazy_match=Ht[t.level].max_lazy,t.good_match=Ht[t.level].good_length,t.nice_match=Ht[t.level].nice_length,t.max_chain_length=Ht[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=2,t.match_available=0,t.ins_h=0}(t.state),e}function ge(t,e,n,i,r,o){if(!t)return Kt;var l=1;if(-1===e&&(e=6),i<0?(l=0,i=-i):i>15&&(l=2,i-=16),r<1||r>9||8!==n||i<8||i>15||e<0||e>9||o<0||o>4)return ie(t,Kt);8===i&&(i=9);var s=new me;return t.state=s,s.strm=t,s.wrap=l,s.gzhead=null,s.w_bits=i,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=r+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+3-1)/3),s.window=new Yt.Buf8(2*s.w_size),s.head=new Yt.Buf16(s.hash_size),s.prev=new Yt.Buf16(s.w_size),s.lit_bufsize=1<<r+6,s.pending_buf_size=4*s.lit_bufsize,s.pending_buf=new Yt.Buf8(s.pending_buf_size),s.d_buf=1*s.lit_bufsize,s.l_buf=3*s.lit_bufsize,s.level=e,s.strategy=o,s.method=n,be(t)}Ht=[new pe(0,0,0,0,function(t,e){var n=65535;for(n>t.pending_buf_size-5&&(n=t.pending_buf_size-5);;){if(t.lookahead<=1){if(fe(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+n;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,se(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-Qt&&(se(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(se(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(se(t,!1),t.strm.avail_out),1)}),new pe(4,4,8,4,de),new pe(4,5,16,8,de),new pe(4,6,32,32,de),new pe(4,4,16,16,he),new pe(8,16,32,32,he),new pe(8,16,128,128,he),new pe(8,32,128,256,he),new pe(32,128,258,1024,he),new pe(32,258,258,4096,he)],lt.deflateInit=function(t,e){return ge(t,e,8,15,8,0)},lt.deflateInit2=ge,lt.deflateReset=be,lt.deflateResetKeep=we,lt.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?Kt:(t.state.gzhead=e,0):Kt},lt.deflate=function(t,e){var n,i,r,o;if(!t||!t.state||e>5||e<0)return t?ie(t,Kt):Kt;if(i=t.state,!t.output||!t.input&&0!==t.avail_in||i.status===ne&&4!==e)return ie(t,0===t.avail_out?-5:Kt);if(i.strm=t,n=i.last_flush,i.last_flush=e,42===i.status)if(2===i.wrap)t.adler=0,ce(i,31),ce(i,139),ce(i,8),i.gzhead?(ce(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),ce(i,255&i.gzhead.time),ce(i,i.gzhead.time>>8&255),ce(i,i.gzhead.time>>16&255),ce(i,i.gzhead.time>>24&255),ce(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),ce(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(ce(i,255&i.gzhead.extra.length),ce(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=Xt(t.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(ce(i,0),ce(i,0),ce(i,0),ce(i,0),ce(i,0),ce(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),ce(i,3),i.status=ee);else{var l=8+(i.w_bits-8<<4)<<8;l|=(i.strategy>=2||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(l|=32),l+=31-l%31,i.status=ee,ae(i,l),0!==i.strstart&&(ae(i,t.adler>>>16),ae(i,65535&t.adler)),t.adler=1}if(69===i.status)if(i.gzhead.extra){for(r=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>r&&(t.adler=Xt(t.adler,i.pending_buf,i.pending-r,r)),le(t),r=i.pending,i.pending!==i.pending_buf_size));)ce(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>r&&(t.adler=Xt(t.adler,i.pending_buf,i.pending-r,r)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){r=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>r&&(t.adler=Xt(t.adler,i.pending_buf,i.pending-r,r)),le(t),r=i.pending,i.pending===i.pending_buf_size)){o=1;break}o=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,ce(i,o)}while(0!==o);i.gzhead.hcrc&&i.pending>r&&(t.adler=Xt(t.adler,i.pending_buf,i.pending-r,r)),0===o&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){r=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>r&&(t.adler=Xt(t.adler,i.pending_buf,i.pending-r,r)),le(t),r=i.pending,i.pending===i.pending_buf_size)){o=1;break}o=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,ce(i,o)}while(0!==o);i.gzhead.hcrc&&i.pending>r&&(t.adler=Xt(t.adler,i.pending_buf,i.pending-r,r)),0===o&&(i.status=te)}else i.status=te;if(i.status===te&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&le(t),i.pending+2<=i.pending_buf_size&&(ce(i,255&t.adler),ce(i,t.adler>>8&255),t.adler=0,i.status=ee)):i.status=ee),0!==i.pending){if(le(t),0===t.avail_out)return i.last_flush=-1,0}else if(0===t.avail_in&&re(e)<=re(n)&&4!==e)return ie(t,-5);if(i.status===ne&&0!==t.avail_in)return ie(t,-5);if(0!==t.avail_in||0!==i.lookahead||0!==e&&i.status!==ne){var s=2===i.strategy?function(t,e){for(var n;;){if(0===t.lookahead&&(fe(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,n=qt._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(se(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(se(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(se(t,!1),0===t.strm.avail_out)?1:2}(i,e):3===i.strategy?function(t,e){for(var n,i,r,o,l=t.window;;){if(t.lookahead<=Jt){if(fe(t),t.lookahead<=Jt&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(i=l[r=t.strstart-1])===l[++r]&&i===l[++r]&&i===l[++r]){o=t.strstart+Jt;do{}while(i===l[++r]&&i===l[++r]&&i===l[++r]&&i===l[++r]&&i===l[++r]&&i===l[++r]&&i===l[++r]&&i===l[++r]&&r<o);t.match_length=Jt-(o-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(n=qt._tr_tally(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=qt._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(se(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(se(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(se(t,!1),0===t.strm.avail_out)?1:2}(i,e):Ht[i.level].func(i,e);if(3!==s&&4!==s||(i.status=ne),1===s||3===s)return 0===t.avail_out&&(i.last_flush=-1),0;if(2===s&&(1===e?qt._tr_align(i):5!==e&&(qt._tr_stored_block(i,0,0,!1),3===e&&(oe(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),le(t),0===t.avail_out))return i.last_flush=-1,0}return 4!==e?0:i.wrap<=0?1:(2===i.wrap?(ce(i,255&t.adler),ce(i,t.adler>>8&255),ce(i,t.adler>>16&255),ce(i,t.adler>>24&255),ce(i,255&t.total_in),ce(i,t.total_in>>8&255),ce(i,t.total_in>>16&255),ce(i,t.total_in>>24&255)):(ae(i,t.adler>>>16),ae(i,65535&t.adler)),le(t),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?0:1)},lt.deflateEnd=function(t){var e;return t&&t.state?42!==(e=t.state.status)&&69!==e&&73!==e&&91!==e&&e!==te&&e!==ee&&e!==ne?ie(t,Kt):(t.state=null,e===ee?ie(t,-3):0):Kt},lt.deflateSetDictionary=function(t,e){var n,i,r,o,l,s,c,a,u=e.length;if(!t||!t.state)return Kt;if(2===(o=(n=t.state).wrap)||1===o&&42!==n.status||n.lookahead)return Kt;for(1===o&&(t.adler=Gt(t.adler,e,u,0)),n.wrap=0,u>=n.w_size&&(0===o&&(oe(n.head),n.strstart=0,n.block_start=0,n.insert=0),a=new Yt.Buf8(n.w_size),Yt.arraySet(a,e,u-n.w_size,n.w_size,0),e=a,u=n.w_size),l=t.avail_in,s=t.next_in,c=t.input,t.avail_in=u,t.next_in=0,t.input=e,fe(n);n.lookahead>=3;){i=n.strstart,r=n.lookahead-2;do{n.ins_h=(n.ins_h<<n.hash_shift^n.window[i+3-1])&n.hash_mask,n.prev[i&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=i,i++}while(--r);n.strstart=i,n.lookahead=2,fe(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=s,t.input=c,t.avail_in=l,n.wrap=o,0},lt.deflateInfo="pako deflate (from Nodeca project)";var ve={},xe=rt,ye=!0,ke=!0;try{String.fromCharCode.apply(null,[0])}catch(wd){ye=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(wd){ke=!1}for(var $e=new xe.Buf8(256),_e=0;_e<256;_e++)$e[_e]=_e>=252?6:_e>=248?5:_e>=240?4:_e>=224?3:_e>=192?2:1;function De(t,e){if(e<65537&&(t.subarray&&ke||!t.subarray&&ye))return String.fromCharCode.apply(null,xe.shrinkBuf(t,e));for(var n="",i=0;i<e;i++)n+=String.fromCharCode(t[i]);return n}$e[254]=$e[254]=1,ve.string2buf=function(t){var e,n,i,r,o,l=t.length,s=0;for(r=0;r<l;r++)55296==(64512&(n=t.charCodeAt(r)))&&r+1<l&&56320==(64512&(i=t.charCodeAt(r+1)))&&(n=65536+(n-55296<<10)+(i-56320),r++),s+=n<128?1:n<2048?2:n<65536?3:4;for(e=new xe.Buf8(s),o=0,r=0;o<s;r++)55296==(64512&(n=t.charCodeAt(r)))&&r+1<l&&56320==(64512&(i=t.charCodeAt(r+1)))&&(n=65536+(n-55296<<10)+(i-56320),r++),n<128?e[o++]=n:n<2048?(e[o++]=192|n>>>6,e[o++]=128|63&n):n<65536?(e[o++]=224|n>>>12,e[o++]=128|n>>>6&63,e[o++]=128|63&n):(e[o++]=240|n>>>18,e[o++]=128|n>>>12&63,e[o++]=128|n>>>6&63,e[o++]=128|63&n);return e},ve.buf2binstring=function(t){return De(t,t.length)},ve.binstring2buf=function(t){for(var e=new xe.Buf8(t.length),n=0,i=e.length;n<i;n++)e[n]=t.charCodeAt(n);return e},ve.buf2string=function(t,e){var n,i,r,o,l=e||t.length,s=new Array(2*l);for(i=0,n=0;n<l;)if((r=t[n++])<128)s[i++]=r;else if((o=$e[r])>4)s[i++]=65533,n+=o-1;else{for(r&=2===o?31:3===o?15:7;o>1&&n<l;)r=r<<6|63&t[n++],o--;o>1?s[i++]=65533:r<65536?s[i++]=r:(r-=65536,s[i++]=55296|r>>10&1023,s[i++]=56320|1023&r)}return De(s,i)},ve.utf8border=function(t,e){var n;for((e=e||t.length)>t.length&&(e=t.length),n=e-1;n>=0&&128==(192&t[n]);)n--;return n<0||0===n?e:n+$e[t[n]]>e?n:e};var Se=function(){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},ze=lt,Me=rt,Ee=ve,je=Zt,Ae=Se,Ce=Object.prototype.toString;function Te(t){if(!(this instanceof Te))return new Te(t);this.options=Me.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ae,this.strm.avail_out=0;var n=ze.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(0!==n)throw new Error(je[n]);if(e.header&&ze.deflateSetHeader(this.strm,e.header),e.dictionary){var i;if(i="string"==typeof e.dictionary?Ee.string2buf(e.dictionary):"[object ArrayBuffer]"===Ce.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,0!==(n=ze.deflateSetDictionary(this.strm,i)))throw new Error(je[n]);this._dict_set=!0}}function Ne(t,e){var n=new Te(e);if(n.push(t,!0),n.err)throw n.msg;return n.result}Te.prototype.push=function(t,e){var n,i,r=this.strm,o=this.options.chunkSize;if(this.ended)return!1;i=e===~~e?e:!0===e?4:0,"string"==typeof t?r.input=Ee.string2buf(t):"[object ArrayBuffer]"===Ce.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;do{if(0===r.avail_out&&(r.output=new Me.Buf8(o),r.next_out=0,r.avail_out=o),1!==(n=ze.deflate(r,i))&&0!==n)return this.onEnd(n),this.ended=!0,!1;0!==r.avail_out&&(0!==r.avail_in||4!==i&&2!==i)||("string"===this.options.to?this.onData(Ee.buf2binstring(Me.shrinkBuf(r.output,r.next_out))):this.onData(Me.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||0===r.avail_out)&&1!==n);return 4===i?(n=ze.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,0===n):2!==i||(this.onEnd(0),r.avail_out=0,!0)},Te.prototype.onData=function(t){this.chunks.push(t)},Te.prototype.onEnd=function(t){0===t&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Me.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},ot.Deflate=Te,ot.deflate=Ne,ot.deflateRaw=function(t,e){return(e=e||{}).raw=!0,Ne(t,e)},ot.gzip=function(t,e){return(e=e||{}).gzip=!0,Ne(t,e)};var Oe={},Fe={},Ie=rt,Re=[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],Le=[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],Be=[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],He=[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],Pe=rt,Ue=Pt,Ve=Vt,Ze=function(t,e){var n,i,r,o,l,s,c,a,u,f,d,h,p,m,w,b,g,v,x,y,k,$,_,D,S;n=t.state,i=t.next_in,D=t.input,r=i+(t.avail_in-5),o=t.next_out,S=t.output,l=o-(e-t.avail_out),s=o+(t.avail_out-257),c=n.dmax,a=n.wsize,u=n.whave,f=n.wnext,d=n.window,h=n.hold,p=n.bits,m=n.lencode,w=n.distcode,b=(1<<n.lenbits)-1,g=(1<<n.distbits)-1;t:do{p<15&&(h+=D[i++]<<p,p+=8,h+=D[i++]<<p,p+=8),v=m[h&b];e:for(;;){if(h>>>=x=v>>>24,p-=x,0==(x=v>>>16&255))S[o++]=65535&v;else{if(!(16&x)){if(64&x){if(32&x){n.mode=12;break t}t.msg="invalid literal/length code",n.mode=30;break t}v=m[(65535&v)+(h&(1<<x)-1)];continue e}for(y=65535&v,(x&=15)&&(p<x&&(h+=D[i++]<<p,p+=8),y+=h&(1<<x)-1,h>>>=x,p-=x),p<15&&(h+=D[i++]<<p,p+=8,h+=D[i++]<<p,p+=8),v=w[h&g];;){if(h>>>=x=v>>>24,p-=x,16&(x=v>>>16&255)){if(k=65535&v,p<(x&=15)&&(h+=D[i++]<<p,(p+=8)<x&&(h+=D[i++]<<p,p+=8)),(k+=h&(1<<x)-1)>c){t.msg="invalid distance too far back",n.mode=30;break t}if(h>>>=x,p-=x,k>(x=o-l)){if((x=k-x)>u&&n.sane){t.msg="invalid distance too far back",n.mode=30;break t}if($=0,_=d,0===f){if($+=a-x,x<y){y-=x;do{S[o++]=d[$++]}while(--x);$=o-k,_=S}}else if(f<x){if($+=a+f-x,(x-=f)<y){y-=x;do{S[o++]=d[$++]}while(--x);if($=0,f<y){y-=x=f;do{S[o++]=d[$++]}while(--x);$=o-k,_=S}}}else if($+=f-x,x<y){y-=x;do{S[o++]=d[$++]}while(--x);$=o-k,_=S}for(;y>2;)S[o++]=_[$++],S[o++]=_[$++],S[o++]=_[$++],y-=3;y&&(S[o++]=_[$++],y>1&&(S[o++]=_[$++]))}else{$=o-k;do{S[o++]=S[$++],S[o++]=S[$++],S[o++]=S[$++],y-=3}while(y>2);y&&(S[o++]=S[$++],y>1&&(S[o++]=S[$++]))}break}if(64&x){t.msg="invalid distance code",n.mode=30;break t}v=w[(65535&v)+(h&(1<<x)-1)]}}break}}while(i<r&&o<s);i-=y=p>>3,h&=(1<<(p-=y<<3))-1,t.next_in=i,t.next_out=o,t.avail_in=i<r?r-i+5:5-(i-r),t.avail_out=o<s?s-o+257:257-(o-s),n.hold=h,n.bits=p},Ye=function(t,e,n,i,r,o,l,s){var c,a,u,f,d,h,p,m,w,b=s.bits,g=0,v=0,x=0,y=0,k=0,$=0,_=0,D=0,S=0,z=0,M=null,E=0,j=new Ie.Buf16(16),A=new Ie.Buf16(16),C=null,T=0;for(g=0;g<=15;g++)j[g]=0;for(v=0;v<i;v++)j[e[n+v]]++;for(k=b,y=15;y>=1&&0===j[y];y--);if(k>y&&(k=y),0===y)return r[o++]=20971520,r[o++]=20971520,s.bits=1,0;for(x=1;x<y&&0===j[x];x++);for(k<x&&(k=x),D=1,g=1;g<=15;g++)if(D<<=1,(D-=j[g])<0)return-1;if(D>0&&(0===t||1!==y))return-1;for(A[1]=0,g=1;g<15;g++)A[g+1]=A[g]+j[g];for(v=0;v<i;v++)0!==e[n+v]&&(l[A[e[n+v]]++]=v);if(0===t?(M=C=l,h=19):1===t?(M=Re,E-=257,C=Le,T-=257,h=256):(M=Be,C=He,h=-1),z=0,v=0,g=x,d=o,$=k,_=0,u=-1,f=(S=1<<k)-1,1===t&&S>852||2===t&&S>592)return 1;for(;;){p=g-_,l[v]<h?(m=0,w=l[v]):l[v]>h?(m=C[T+l[v]],w=M[E+l[v]]):(m=96,w=0),c=1<<g-_,x=a=1<<$;do{r[d+(z>>_)+(a-=c)]=p<<24|m<<16|w}while(0!==a);for(c=1<<g-1;z&c;)c>>=1;if(0!==c?(z&=c-1,z+=c):z=0,v++,0==--j[g]){if(g===y)break;g=e[n+l[v]]}if(g>k&&(z&f)!==u){for(0===_&&(_=k),d+=x,D=1<<($=g-_);$+_<y&&!((D-=j[$+_])<=0);)$++,D<<=1;if(S+=1<<$,1===t&&S>852||2===t&&S>592)return 1;r[u=z&f]=k<<24|$<<16|d-o}}return 0!==z&&(r[d+z]=g-_<<24|64<<16),s.bits=k,0},qe=-2,Ge=12,Xe=30;function We(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function Ke(){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 Pe.Buf16(320),this.work=new Pe.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Je(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Pe.Buf32(852),e.distcode=e.distdyn=new Pe.Buf32(592),e.sane=1,e.back=-1,0):qe}function Qe(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,Je(t)):qe}function tn(t,e){var n,i;return t&&t.state?(i=t.state,e<0?(n=0,e=-e):(n=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?qe:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=n,i.wbits=e,Qe(t))):qe}function en(t,e){var n,i;return t?(i=new Ke,t.state=i,i.window=null,0!==(n=tn(t,e))&&(t.state=null),n):qe}var nn,rn,on=!0;function ln(t){if(on){var e;for(nn=new Pe.Buf32(512),rn=new Pe.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(Ye(1,t.lens,0,288,nn,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;Ye(2,t.lens,0,32,rn,0,t.work,{bits:5}),on=!1}t.lencode=nn,t.lenbits=9,t.distcode=rn,t.distbits=5}function sn(t,e,n,i){var r,o=t.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Pe.Buf8(o.wsize)),i>=o.wsize?(Pe.arraySet(o.window,e,n-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((r=o.wsize-o.wnext)>i&&(r=i),Pe.arraySet(o.window,e,n-i,r,o.wnext),(i-=r)?(Pe.arraySet(o.window,e,n-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=r,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=r))),0}Fe.inflateReset=Qe,Fe.inflateReset2=tn,Fe.inflateResetKeep=Je,Fe.inflateInit=function(t){return en(t,15)},Fe.inflateInit2=en,Fe.inflate=function(t,e){var n,i,r,o,l,s,c,a,u,f,d,h,p,m,w,b,g,v,x,y,k,$,_,D,S=0,z=new Pe.Buf8(4),M=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return qe;(n=t.state).mode===Ge&&(n.mode=13),l=t.next_out,r=t.output,c=t.avail_out,o=t.next_in,i=t.input,s=t.avail_in,a=n.hold,u=n.bits,f=s,d=c,$=0;t:for(;;)switch(n.mode){case 1:if(0===n.wrap){n.mode=13;break}for(;u<16;){if(0===s)break t;s--,a+=i[o++]<<u,u+=8}if(2&n.wrap&&35615===a){n.check=0,z[0]=255&a,z[1]=a>>>8&255,n.check=Ve(n.check,z,2,0),a=0,u=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&a)<<8)+(a>>8))%31){t.msg="incorrect header check",n.mode=Xe;break}if(8!=(15&a)){t.msg="unknown compression method",n.mode=Xe;break}if(u-=4,k=8+(15&(a>>>=4)),0===n.wbits)n.wbits=k;else if(k>n.wbits){t.msg="invalid window size",n.mode=Xe;break}n.dmax=1<<k,t.adler=n.check=1,n.mode=512&a?10:Ge,a=0,u=0;break;case 2:for(;u<16;){if(0===s)break t;s--,a+=i[o++]<<u,u+=8}if(n.flags=a,8!=(255&n.flags)){t.msg="unknown compression method",n.mode=Xe;break}if(57344&n.flags){t.msg="unknown header flags set",n.mode=Xe;break}n.head&&(n.head.text=a>>8&1),512&n.flags&&(z[0]=255&a,z[1]=a>>>8&255,n.check=Ve(n.check,z,2,0)),a=0,u=0,n.mode=3;case 3:for(;u<32;){if(0===s)break t;s--,a+=i[o++]<<u,u+=8}n.head&&(n.head.time=a),512&n.flags&&(z[0]=255&a,z[1]=a>>>8&255,z[2]=a>>>16&255,z[3]=a>>>24&255,n.check=Ve(n.check,z,4,0)),a=0,u=0,n.mode=4;case 4:for(;u<16;){if(0===s)break t;s--,a+=i[o++]<<u,u+=8}n.head&&(n.head.xflags=255&a,n.head.os=a>>8),512&n.flags&&(z[0]=255&a,z[1]=a>>>8&255,n.check=Ve(n.check,z,2,0)),a=0,u=0,n.mode=5;case 5:if(1024&n.flags){for(;u<16;){if(0===s)break t;s--,a+=i[o++]<<u,u+=8}n.length=a,n.head&&(n.head.extra_len=a),512&n.flags&&(z[0]=255&a,z[1]=a>>>8&255,n.check=Ve(n.check,z,2,0)),a=0,u=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&((h=n.length)>s&&(h=s),h&&(n.head&&(k=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),Pe.arraySet(n.head.extra,i,o,h,k)),512&n.flags&&(n.check=Ve(n.check,i,h,o)),s-=h,o+=h,n.length-=h),n.length))break t;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===s)break t;h=0;do{k=i[o+h++],n.head&&k&&n.length<65536&&(n.head.name+=String.fromCharCode(k))}while(k&&h<s);if(512&n.flags&&(n.check=Ve(n.check,i,h,o)),s-=h,o+=h,k)break t}else n.head&&(n.head.name=null);n.length=0,n.mode=8;case 8:if(4096&n.flags){if(0===s)break t;h=0;do{k=i[o+h++],n.head&&k&&n.length<65536&&(n.head.comment+=String.fromCharCode(k))}while(k&&h<s);if(512&n.flags&&(n.check=Ve(n.check,i,h,o)),s-=h,o+=h,k)break t}else n.head&&(n.head.comment=null);n.mode=9;case 9:if(512&n.flags){for(;u<16;){if(0===s)break t;s--,a+=i[o++]<<u,u+=8}if(a!==(65535&n.check)){t.msg="header crc mismatch",n.mode=Xe;break}a=0,u=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=Ge;break;case 10:for(;u<32;){if(0===s)break t;s--,a+=i[o++]<<u,u+=8}t.adler=n.check=We(a),a=0,u=0,n.mode=11;case 11:if(0===n.havedict)return t.next_out=l,t.avail_out=c,t.next_in=o,t.avail_in=s,n.hold=a,n.bits=u,2;t.adler=n.check=1,n.mode=Ge;case Ge:if(5===e||6===e)break t;case 13:if(n.last){a>>>=7&u,u-=7&u,n.mode=27;break}for(;u<3;){if(0===s)break t;s--,a+=i[o++]<<u,u+=8}switch(n.last=1&a,u-=1,3&(a>>>=1)){case 0:n.mode=14;break;case 1:if(ln(n),n.mode=20,6===e){a>>>=2,u-=2;break t}break;case 2:n.mode=17;break;case 3:t.msg="invalid block type",n.mode=Xe}a>>>=2,u-=2;break;case 14:for(a>>>=7&u,u-=7&u;u<32;){if(0===s)break t;s--,a+=i[o++]<<u,u+=8}if((65535&a)!=(a>>>16^65535)){t.msg="invalid stored block lengths",n.mode=Xe;break}if(n.length=65535&a,a=0,u=0,n.mode=15,6===e)break t;case 15:n.mode=16;case 16:if(h=n.length){if(h>s&&(h=s),h>c&&(h=c),0===h)break t;Pe.arraySet(r,i,o,h,l),s-=h,o+=h,c-=h,l+=h,n.length-=h;break}n.mode=Ge;break;case 17:for(;u<14;){if(0===s)break t;s--,a+=i[o++]<<u,u+=8}if(n.nlen=257+(31&a),a>>>=5,u-=5,n.ndist=1+(31&a),a>>>=5,u-=5,n.ncode=4+(15&a),a>>>=4,u-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=Xe;break}n.have=0,n.mode=18;case 18:for(;n.have<n.ncode;){for(;u<3;){if(0===s)break t;s--,a+=i[o++]<<u,u+=8}n.lens[M[n.have++]]=7&a,a>>>=3,u-=3}for(;n.have<19;)n.lens[M[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,_={bits:n.lenbits},$=Ye(0,n.lens,0,19,n.lencode,0,n.work,_),n.lenbits=_.bits,$){t.msg="invalid code lengths set",n.mode=Xe;break}n.have=0,n.mode=19;case 19:for(;n.have<n.nlen+n.ndist;){for(;b=(S=n.lencode[a&(1<<n.lenbits)-1])>>>16&255,g=65535&S,!((w=S>>>24)<=u);){if(0===s)break t;s--,a+=i[o++]<<u,u+=8}if(g<16)a>>>=w,u-=w,n.lens[n.have++]=g;else{if(16===g){for(D=w+2;u<D;){if(0===s)break t;s--,a+=i[o++]<<u,u+=8}if(a>>>=w,u-=w,0===n.have){t.msg="invalid bit length repeat",n.mode=Xe;break}k=n.lens[n.have-1],h=3+(3&a),a>>>=2,u-=2}else if(17===g){for(D=w+3;u<D;){if(0===s)break t;s--,a+=i[o++]<<u,u+=8}u-=w,k=0,h=3+(7&(a>>>=w)),a>>>=3,u-=3}else{for(D=w+7;u<D;){if(0===s)break t;s--,a+=i[o++]<<u,u+=8}u-=w,k=0,h=11+(127&(a>>>=w)),a>>>=7,u-=7}if(n.have+h>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=Xe;break}for(;h--;)n.lens[n.have++]=k}}if(n.mode===Xe)break;if(0===n.lens[256]){t.msg="invalid code -- missing end-of-block",n.mode=Xe;break}if(n.lenbits=9,_={bits:n.lenbits},$=Ye(1,n.lens,0,n.nlen,n.lencode,0,n.work,_),n.lenbits=_.bits,$){t.msg="invalid literal/lengths set",n.mode=Xe;break}if(n.distbits=6,n.distcode=n.distdyn,_={bits:n.distbits},$=Ye(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,_),n.distbits=_.bits,$){t.msg="invalid distances set",n.mode=Xe;break}if(n.mode=20,6===e)break t;case 20:n.mode=21;case 21:if(s>=6&&c>=258){t.next_out=l,t.avail_out=c,t.next_in=o,t.avail_in=s,n.hold=a,n.bits=u,Ze(t,d),l=t.next_out,r=t.output,c=t.avail_out,o=t.next_in,i=t.input,s=t.avail_in,a=n.hold,u=n.bits,n.mode===Ge&&(n.back=-1);break}for(n.back=0;b=(S=n.lencode[a&(1<<n.lenbits)-1])>>>16&255,g=65535&S,!((w=S>>>24)<=u);){if(0===s)break t;s--,a+=i[o++]<<u,u+=8}if(b&&!(240&b)){for(v=w,x=b,y=g;b=(S=n.lencode[y+((a&(1<<v+x)-1)>>v)])>>>16&255,g=65535&S,!(v+(w=S>>>24)<=u);){if(0===s)break t;s--,a+=i[o++]<<u,u+=8}a>>>=v,u-=v,n.back+=v}if(a>>>=w,u-=w,n.back+=w,n.length=g,0===b){n.mode=26;break}if(32&b){n.back=-1,n.mode=Ge;break}if(64&b){t.msg="invalid literal/length code",n.mode=Xe;break}n.extra=15&b,n.mode=22;case 22:if(n.extra){for(D=n.extra;u<D;){if(0===s)break t;s--,a+=i[o++]<<u,u+=8}n.length+=a&(1<<n.extra)-1,a>>>=n.extra,u-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;b=(S=n.distcode[a&(1<<n.distbits)-1])>>>16&255,g=65535&S,!((w=S>>>24)<=u);){if(0===s)break t;s--,a+=i[o++]<<u,u+=8}if(!(240&b)){for(v=w,x=b,y=g;b=(S=n.distcode[y+((a&(1<<v+x)-1)>>v)])>>>16&255,g=65535&S,!(v+(w=S>>>24)<=u);){if(0===s)break t;s--,a+=i[o++]<<u,u+=8}a>>>=v,u-=v,n.back+=v}if(a>>>=w,u-=w,n.back+=w,64&b){t.msg="invalid distance code",n.mode=Xe;break}n.offset=g,n.extra=15&b,n.mode=24;case 24:if(n.extra){for(D=n.extra;u<D;){if(0===s)break t;s--,a+=i[o++]<<u,u+=8}n.offset+=a&(1<<n.extra)-1,a>>>=n.extra,u-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=Xe;break}n.mode=25;case 25:if(0===c)break t;if(h=d-c,n.offset>h){if((h=n.offset-h)>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=Xe;break}h>n.wnext?(h-=n.wnext,p=n.wsize-h):p=n.wnext-h,h>n.length&&(h=n.length),m=n.window}else m=r,p=l-n.offset,h=n.length;h>c&&(h=c),c-=h,n.length-=h;do{r[l++]=m[p++]}while(--h);0===n.length&&(n.mode=21);break;case 26:if(0===c)break t;r[l++]=n.length,c--,n.mode=21;break;case 27:if(n.wrap){for(;u<32;){if(0===s)break t;s--,a|=i[o++]<<u,u+=8}if(d-=c,t.total_out+=d,n.total+=d,d&&(t.adler=n.check=n.flags?Ve(n.check,r,d,l-d):Ue(n.check,r,d,l-d)),d=c,(n.flags?a:We(a))!==n.check){t.msg="incorrect data check",n.mode=Xe;break}a=0,u=0}n.mode=28;case 28:if(n.wrap&&n.flags){for(;u<32;){if(0===s)break t;s--,a+=i[o++]<<u,u+=8}if(a!==(4294967295&n.total)){t.msg="incorrect length check",n.mode=Xe;break}a=0,u=0}n.mode=29;case 29:$=1;break t;case Xe:$=-3;break t;case 31:return-4;default:return qe}return t.next_out=l,t.avail_out=c,t.next_in=o,t.avail_in=s,n.hold=a,n.bits=u,(n.wsize||d!==t.avail_out&&n.mode<Xe&&(n.mode<27||4!==e))&&sn(t,t.output,t.next_out,d-t.avail_out),f-=t.avail_in,d-=t.avail_out,t.total_in+=f,t.total_out+=d,n.total+=d,n.wrap&&d&&(t.adler=n.check=n.flags?Ve(n.check,r,d,t.next_out-d):Ue(n.check,r,d,t.next_out-d)),t.data_type=n.bits+(n.last?64:0)+(n.mode===Ge?128:0)+(20===n.mode||15===n.mode?256:0),(0===f&&0===d||4===e)&&0===$&&($=-5),$},Fe.inflateEnd=function(t){if(!t||!t.state)return qe;var e=t.state;return e.window&&(e.window=null),t.state=null,0},Fe.inflateGetHeader=function(t,e){var n;return t&&t.state&&2&(n=t.state).wrap?(n.head=e,e.done=!1,0):qe},Fe.inflateSetDictionary=function(t,e){var n,i=e.length;return t&&t.state?0!==(n=t.state).wrap&&11!==n.mode?qe:11===n.mode&&Ue(1,e,i,0)!==n.check?-3:sn(t,e,i,i)?(n.mode=31,-4):(n.havedict=1,0):qe},Fe.inflateInfo="pako inflate (from Nodeca project)";var cn={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},an=Fe,un=rt,fn=ve,dn=cn,hn=Zt,pn=Se,mn=function(){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},wn=Object.prototype.toString;function bn(t){if(!(this instanceof bn))return new bn(t);this.options=un.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(15&e.windowBits||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new pn,this.strm.avail_out=0;var n=an.inflateInit2(this.strm,e.windowBits);if(n!==dn.Z_OK)throw new Error(hn[n]);this.header=new mn,an.inflateGetHeader(this.strm,this.header)}function gn(t,e){var n=new bn(e);if(n.push(t,!0),n.err)throw n.msg;return n.result}bn.prototype.push=function(t,e){var n,i,r,o,l,s,c=this.strm,a=this.options.chunkSize,u=this.options.dictionary,f=!1;if(this.ended)return!1;i=e===~~e?e:!0===e?dn.Z_FINISH:dn.Z_NO_FLUSH,"string"==typeof t?c.input=fn.binstring2buf(t):"[object ArrayBuffer]"===wn.call(t)?c.input=new Uint8Array(t):c.input=t,c.next_in=0,c.avail_in=c.input.length;do{if(0===c.avail_out&&(c.output=new un.Buf8(a),c.next_out=0,c.avail_out=a),(n=an.inflate(c,dn.Z_NO_FLUSH))===dn.Z_NEED_DICT&&u&&(s="string"==typeof u?fn.string2buf(u):"[object ArrayBuffer]"===wn.call(u)?new Uint8Array(u):u,n=an.inflateSetDictionary(this.strm,s)),n===dn.Z_BUF_ERROR&&!0===f&&(n=dn.Z_OK,f=!1),n!==dn.Z_STREAM_END&&n!==dn.Z_OK)return this.onEnd(n),this.ended=!0,!1;c.next_out&&(0!==c.avail_out&&n!==dn.Z_STREAM_END&&(0!==c.avail_in||i!==dn.Z_FINISH&&i!==dn.Z_SYNC_FLUSH)||("string"===this.options.to?(r=fn.utf8border(c.output,c.next_out),o=c.next_out-r,l=fn.buf2string(c.output,r),c.next_out=o,c.avail_out=a-o,o&&un.arraySet(c.output,c.output,r,o,0),this.onData(l)):this.onData(un.shrinkBuf(c.output,c.next_out)))),0===c.avail_in&&0===c.avail_out&&(f=!0)}while((c.avail_in>0||0===c.avail_out)&&n!==dn.Z_STREAM_END);return n===dn.Z_STREAM_END&&(i=dn.Z_FINISH),i===dn.Z_FINISH?(n=an.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===dn.Z_OK):i!==dn.Z_SYNC_FLUSH||(this.onEnd(dn.Z_OK),c.avail_out=0,!0)},bn.prototype.onData=function(t){this.chunks.push(t)},bn.prototype.onEnd=function(t){t===dn.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=un.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},Oe.Inflate=bn,Oe.inflate=gn,Oe.inflateRaw=function(t,e){return(e=e||{}).raw=!0,gn(t,e)},Oe.ungzip=gn;(0,rt.assign)({},ot,Oe,cn);let vn=1e3;function xn(){return vn++,vn}function yn(t,e,n,i,r,o,l,s,c){let a,u=[];function f(t,e,n){return t||(t=e),t=Math.round(10*(t||0))/10,e?"X"==(n=(n||"_").trim().toLowerCase())&&t!=e?t+"*":"M"==n?t+"M":t:t}return a=f(t,i,l),a&&u.push(a),a=f(e,r,s),a&&u.push(a),a=f(n,o,c),a&&u.push(a),(""+l+s+c).replace(/[_XM]/gi,""),u.join("x")}function kn(t){const e=new Date(t),n=e.getDate().toString().padStart(2,"0"),i=(e.getMonth()+1).toString().padStart(2,"0");return`${e.getFullYear()}-${i}-${n}`}function $n(t){if(!t)return"";"number"==typeof t&&(t=t.toDate());let e=t.getDate(),n=t.getMonth()+1,i=t.getFullYear(),r=t.getHours(),o=t.getMinutes();return e=e<10?"0"+e:e,n=n<10?"0"+n:n,r=r<10?"0"+r:r,o=o<10?"0"+o:o,`${e}/${n}/${i} ${r}:${o}`}const _n=new class{constructor(){this.buslist={}}on(t,e){return this.buslist[t]||(this.buslist[t]=[]),this.buslist[t].push(e),this.buslist[t].length-1}emit(t,...e){this.buslist[t]&&this.buslist[t].forEach(t=>t(...e))}off(t,e){this.buslist[t]&&("number"==typeof e?e>=0&&e<this.buslist[t].length&&this.buslist[t].splice(e,1):this.buslist[t]=this.buslist[t].filter(t=>t!==e))}$on(t,e){this.on(t,e)}$off(t,e){this.off(t,e)}$emit(t,...e){this.emit(t,...e)}};function Dn(t){if(Array.isArray(t))return t;let e=[],n={};if(t){let i=t.split(/[\n;,]/);for(let t of i){let i,r,o=t.search(/[:=#]/);o<0?i=r=t.trim():(i=t.slice(0,o),r=t.slice(o+1)),i=i.toLowerCase(),i&&!n[i]&&(n[i]=1,e.push({cod:i,des:r}))}}return e}_n.messaggio=t=>_n.emit("messaggio",t),_n.warning=t=>_n.emit("warning",t),_n.errore=t=>_n.emit("error",t),_n.salvato=t=>_n.emit("messaggio","dati memorizzati!"),_n.wait=t=>_n.emit("wait",t);const Sn=(t,e=-1)=>{if(!t)return 0;if("number"==typeof t)return t||0;let n=0;if("string"==typeof t){let e=(t=t.replaceAll(",",".")).match(/^-?[0-9.]+$/g);e&&e.length>0?n=Number(e[0]):/^\s*-?\s*[0-9]+(\.[0-9]+)?\s*$/gi.test(t)?n=parseFloat(t):/[\s\d()-+/*^.]+/gi.test(t)&&(n=0)}if(e>=0){const t=Math.pow(10,e);n=Math.round(n*t)/t}return n||0},zn=(t,e,n="")=>0==t?e||"":new Intl.NumberFormat("it-IT",{style:"currency",currency:"EUR"}).format(Sn(t))+n;let Mn={};const En=(t,e)=>{Date.prototype.getWeek||(Date.prototype.getWeek=function(){let t=new Date(this.getFullYear(),0,1);return Math.ceil(((this-t)/864e5+t.getDay()+1)/7)});let n="it";if("object"!=typeof t){if(!(t=parseFloat(t||0)))return"";t=t.toDate()}if("week"==e)return"w"+t.getWeek();if(!Mn[e])switch(e){case"giorni":{let e=t.toInt(),i=e.diffgiorni((new Date).toInt());return 0==i?"Oggi":-1==i?"Domani":1==i?"Ieri":Math.abs(i)<6?new Intl.DateTimeFormat(n,{weekday:"long"}).format(t).trim():En(e,"ggmmm")}case"date":case"shortdate":Mn[e]=new Intl.DateTimeFormat(n,{weekday:"short",day:"numeric",month:"short",year:"numeric"});break;case"ggmmaa":case"ggmmyy":Mn[e]=new Intl.DateTimeFormat(n,{day:"2-digit",month:"2-digit",year:"2-digit"});break;case"datetime":Mn[e]=new Intl.DateTimeFormat(n,{day:"2-digit",month:"2-digit",year:"numeric",hour12:!1,hour:"numeric",minute:"2-digit"});break;case"yyyy":case"anno":Mn[e]=new Intl.DateTimeFormat(n,{year:"numeric"});break;case"ggmmaaaa":case"ggmmyyyy":Mn[e]=new Intl.DateTimeFormat(n,{day:"2-digit",month:"2-digit",year:"numeric"});break;case"ggmm":Mn[e]=new Intl.DateTimeFormat(n,{day:"2-digit",month:"2-digit"});break;case"giorno":case"gg":Mn[e]=new Intl.DateTimeFormat(n,{day:"2-digit"});break;case"ggmmmaaaa":case"ggmmmyyyy":Mn[e]=new Intl.DateTimeFormat(n,{day:"2-digit",month:"short",year:"numeric"});break;case"ggmmmaa":case"ggmmmyy":Mn[e]=new Intl.DateTimeFormat(n,{day:"2-digit",month:"short",year:"2-digit"});break;case"ggmmm":Mn[e]=new Intl.DateTimeFormat(n,{day:"2-digit",month:"short"});break;case"ggmmmm":Mn[e]=new Intl.DateTimeFormat(n,{day:"2-digit",month:"long"});break;case"mmmyy":case"mmmaa":case"mmmyyyy":case"mmmaaaa":Mn[e]=new Intl.DateTimeFormat(n,{month:"short",year:"numeric"});break;case"weekday":Mn[e]=new Intl.DateTimeFormat(n,{weekday:"long"});break;case"hhmm":Mn[e]=new Intl.DateTimeFormat(n,{hour12:!1,hour:"numeric",minute:"2-digit"});break;case"hhmmss":Mn[e]=new Intl.DateTimeFormat(n,{hour12:!1,hour:"numeric",minute:"2-digit",second:"2-digit"});break;case"mese":Mn[e]=new Intl.DateTimeFormat(n,{month:"long"});break;default:Mn[e="."]||(Mn[e]=new Intl.DateTimeFormat(n,{weekday:"long",day:"numeric",month:"long",year:"numeric",hour12:!1,hour:"numeric",minute:"2-digit"}))}return Mn[e].format(t).trim()};function jn(t){let e,n,i,r;return{c(){e=d("textarea"),c(e,"class",n="area_textarea "+t[4].class||""),e.readOnly=t[1]},m(n,o){u(n,e,o),t[5](e),a(e,t[0]),i||(r=[f(e,"input",t[6]),f(e,"input",t[3])],i=!0)},p(t,[i]){16&i&&n!==(n="area_textarea "+t[4].class||"")&&c(e,"class",n),2&i&&(e.readOnly=t[1]),1&i&&a(e,t[0])},i:o,o:o,d(n){n&&l(e),t[5](null),i=!1,s(r)}}}function An(t,e,n){let o,{value:l="",readonly:s=!1}=e;function c(){o&&(n(2,o.style.height="auto",o),n(2,o.style.height=o.scrollHeight+"px",o))}return G(()=>{c()}),t.$$set=t=>{n(4,e=i(i({},e),r(t))),"value"in t&&n(0,l=t.value),"readonly"in t&&n(1,s=t.readonly)},c(),e=r(e),[l,s,o,c,e,function(t){h[t?"unshift":"push"](()=>{o=t,n(2,o)})},function(){l=this.value,n(0,l)}]}"undefined"!=typeof window&&(window.__svelte||(window.__svelte={v:new Set})).v.add("4");class Cn extends t{constructor(t){super(),e(this,t,An,jn,n,{value:0,readonly:1})}}function Tn(t){let e,n,i,r,o,s,a=(t[0]||"")+"";const f=t[26].default,h=p(f,t,t[25],null);return{c(){e=d("div"),n=d("div"),i=$(a),r=_(),h&&h.c(),D(e,"width","fit-content"),c(e,"class",o=(t[9].class||"")+" px-2 py-0.5 rounded flex flex-col items-center "+t[8]+" "+(t[5]?"":"whitespace-nowrap")),y(e,"font-bold",t[6]),y(e,"text-sm",t[1]),y(e,"text-xs",t[2]),y(e,"text-lg",t[3]),y(e,"text-xl",t[4]),y(e,"uppercase",t[7])},m(t,o){u(t,e,o),k(e,n),k(n,i),k(e,r),h&&h.m(e,null),s=!0},p(t,[n]){(!s||1&n)&&a!==(a=(t[0]||"")+"")&&b(i,a),h&&h.p&&(!s||33554432&n)&&g(h,f,t,t[25],s?x(f,t[25],n,null):v(t[25]),null),(!s||800&n&&o!==(o=(t[9].class||"")+" px-2 py-0.5 rounded flex flex-col items-center "+t[8]+" "+(t[5]?"":"whitespace-nowrap")))&&c(e,"class",o),(!s||864&n)&&y(e,"font-bold",t[6]),(!s||802&n)&&y(e,"text-sm",t[1]),(!s||804&n)&&y(e,"text-xs",t[2]),(!s||808&n)&&y(e,"text-lg",t[3]),(!s||816&n)&&y(e,"text-xl",t[4]),(!s||928&n)&&y(e,"uppercase",t[7])},i(t){s||(w(h,t),s=!0)},o(t){m(h,t),s=!1},d(t){t&&l(e),h&&h.d(t)}}}function Nn(t,e,n){let o,{$$slots:l={},$$scope:s}=e,{value:c,tipo:a="",warning:u=!1,alt:f=!1,ialt:d=!1,iwarning:h=!1,success:p=!1,isuccess:m=!1,danger:w=!1,idanger:b=!1,base:g=!1,ibase:v=!1,gray:x=!1,igray:y=!1,partial:k=!1,sm:$=!1,xs:_=!1,lg:D=!1,xl:S=!1,wrap:z=!1,bold:M=!1,black:E=!1,uppercase:j=!1}=e;return t.$$set=t=>{n(9,e=i(i({},e),r(t))),"value"in t&&n(0,c=t.value),"tipo"in t&&n(10,a=t.tipo),"warning"in t&&n(11,u=t.warning),"alt"in t&&n(12,f=t.alt),"ialt"in t&&n(13,d=t.ialt),"iwarning"in t&&n(14,h=t.iwarning),"success"in t&&n(15,p=t.success),"isuccess"in t&&n(16,m=t.isuccess),"danger"in t&&n(17,w=t.danger),"idanger"in t&&n(18,b=t.idanger),"base"in t&&n(19,g=t.base),"ibase"in t&&n(20,v=t.ibase),"gray"in t&&n(21,x=t.gray),"igray"in t&&n(22,y=t.igray),"partial"in t&&n(23,k=t.partial),"sm"in t&&n(1,$=t.sm),"xs"in t&&n(2,_=t.xs),"lg"in t&&n(3,D=t.lg),"xl"in t&&n(4,S=t.xl),"wrap"in t&&n(5,z=t.wrap),"bold"in t&&n(6,M=t.bold),"black"in t&&n(24,E=t.black),"uppercase"in t&&n(7,j=t.uppercase),"$$scope"in t&&n(25,s=t.$$scope)},t.$$.update=()=>{4180993&t.$$.dirty&&n(8,o=u||"warning"==a?"bg-b-warning text-c-warning":h||"iwarning"==a?"bg-c-warning text-b-warning":p||"success"==a?"bg-b-success text-c-success":m||"isuccess"==a?"bg-c-success text-b-success":w||"danger"==a?"bg-c-danger text-b-danger":b||"idanger"==a?"bg-b-danger text-c-danger":g||"base"==a?"bg-b-base text-c-base":v||"ibase"==a?"bg-c-base text-b-base":f||"alt"==a?"bg-pink-100 text-pink-700":d||"ialt"==a?"bg-pink-700 text-pink-100":x||"gray"==a?"bg-c-100 text-c-500":y||"igray"==a?"bg-c-800 text-c-100":E||"black"==a?"bg-black text-white":k||"partial"==a?"bg-[#bdb76b] text-black":"text-sm bg-white border border-c-200")},e=r(e),[c,$,_,D,S,z,M,j,o,e,a,u,f,d,h,p,m,w,b,g,v,x,y,k,E,s,l]}class On extends t{constructor(t){super(),e(this,t,Nn,Tn,n,{value:0,tipo:10,warning:11,alt:12,ialt:13,iwarning:14,success:15,isuccess:16,danger:17,idanger:18,base:19,ibase:20,gray:21,igray:22,partial:23,sm:1,xs:2,lg:3,xl:4,wrap:5,bold:6,black:24,uppercase:7})}}const Fn=Math.min,In=Math.max,Rn=Math.round,Ln=t=>({x:t,y:t}),Bn={left:"right",right:"left",bottom:"top",top:"bottom"},Hn={start:"end",end:"start"};function Pn(t,e,n){return In(t,Fn(e,n))}function Un(t,e){return"function"==typeof t?t(e):t}function Vn(t){return t.split("-")[0]}function Zn(t){return t.split("-")[1]}function Yn(t){return"x"===t?"y":"x"}function qn(t){return"y"===t?"height":"width"}const Gn=new Set(["top","bottom"]);function Xn(t){return Gn.has(Vn(t))?"y":"x"}function Wn(t){return Yn(Xn(t))}function Kn(t){return t.replace(/start|end/g,t=>Hn[t])}const Jn=["left","right"],Qn=["right","left"],ti=["top","bottom"],ei=["bottom","top"];function ni(t,e,n,i){const r=Zn(t);let o=function(t,e,n){switch(t){case"top":case"bottom":return n?e?Qn:Jn:e?Jn:Qn;case"left":case"right":return e?ti:ei;default:return[]}}(Vn(t),"start"===n,i);return r&&(o=o.map(t=>t+"-"+r),e&&(o=o.concat(o.map(Kn)))),o}function ii(t){return t.replace(/left|right|bottom|top/g,t=>Bn[t])}function ri(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function oi(t){const{x:e,y:n,width:i,height:r}=t;return{width:i,height:r,top:n,left:e,right:e+i,bottom:n+r,x:e,y:n}}function li(t,e,n){let{reference:i,floating:r}=t;const o=Xn(e),l=Wn(e),s=qn(l),c=Vn(e),a="y"===o,u=i.x+i.width/2-r.width/2,f=i.y+i.height/2-r.height/2,d=i[s]/2-r[s]/2;let h;switch(c){case"top":h={x:u,y:i.y-r.height};break;case"bottom":h={x:u,y:i.y+i.height};break;case"right":h={x:i.x+i.width,y:f};break;case"left":h={x:i.x-r.width,y:f};break;default:h={x:i.x,y:i.y}}switch(Zn(e)){case"start":h[l]-=d*(n&&a?-1:1);break;case"end":h[l]+=d*(n&&a?-1:1)}return h}async function si(t,e){var n;void 0===e&&(e={});const{x:i,y:r,platform:o,rects:l,elements:s,strategy:c}=t,{boundary:a="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:h=0}=Un(e,t),p=ri(h),m=s[d?"floating"===f?"reference":"floating":f],w=oi(await o.getClippingRect({element:null==(n=await(null==o.isElement?void 0:o.isElement(m)))||n?m:m.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(s.floating)),boundary:a,rootBoundary:u,strategy:c})),b="floating"===f?{x:i,y:r,width:l.floating.width,height:l.floating.height}:l.reference,g=await(null==o.getOffsetParent?void 0:o.getOffsetParent(s.floating)),v=await(null==o.isElement?void 0:o.isElement(g))&&await(null==o.getScale?void 0:o.getScale(g))||{x:1,y:1},x=oi(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:b,offsetParent:g,strategy:c}):b);return{top:(w.top-x.top+p.top)/v.y,bottom:(x.bottom-w.bottom+p.bottom)/v.y,left:(w.left-x.left+p.left)/v.x,right:(x.right-w.right+p.right)/v.x}}const ci=new Set(["left","top"]);function ai(){return"undefined"!=typeof window}function ui(t){return hi(t)?(t.nodeName||"").toLowerCase():"#document"}function fi(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function di(t){var e;return null==(e=(hi(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function hi(t){return!!ai()&&(t instanceof Node||t instanceof fi(t).Node)}function pi(t){return!!ai()&&(t instanceof Element||t instanceof fi(t).Element)}function mi(t){return!!ai()&&(t instanceof HTMLElement||t instanceof fi(t).HTMLElement)}function wi(t){return!(!ai()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof fi(t).ShadowRoot)}const bi=new Set(["inline","contents"]);function gi(t){const{overflow:e,overflowX:n,overflowY:i,display:r}=ji(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!bi.has(r)}const vi=new Set(["table","td","th"]);function xi(t){return vi.has(ui(t))}const yi=[":popover-open",":modal"];function ki(t){return yi.some(e=>{try{return t.matches(e)}catch(t){return!1}})}const $i=["transform","translate","scale","rotate","perspective"],_i=["transform","translate","scale","rotate","perspective","filter"],Di=["paint","layout","strict","content"];function Si(t){const e=zi(),n=pi(t)?ji(t):t;return $i.some(t=>!!n[t]&&"none"!==n[t])||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||_i.some(t=>(n.willChange||"").includes(t))||Di.some(t=>(n.contain||"").includes(t))}function zi(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Mi=new Set(["html","body","#document"]);function Ei(t){return Mi.has(ui(t))}function ji(t){return fi(t).getComputedStyle(t)}function Ai(t){return pi(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Ci(t){if("html"===ui(t))return t;const e=t.assignedSlot||t.parentNode||wi(t)&&t.host||di(t);return wi(e)?e.host:e}function Ti(t){const e=Ci(t);return Ei(e)?t.ownerDocument?t.ownerDocument.body:t.body:mi(e)&&gi(e)?e:Ti(e)}function Ni(t,e,n){var i;void 0===e&&(e=[]);const r=Ti(t),o=r===(null==(i=t.ownerDocument)?void 0:i.body),l=fi(r);return o?(Oi(l),e.concat(l,l.visualViewport||[],gi(r)?r:[],[])):e.concat(r,Ni(r,[]))}function Oi(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Fi(t){const e=ji(t);let n=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=mi(t),o=r?t.offsetWidth:n,l=r?t.offsetHeight:i,s=Rn(n)!==o||Rn(i)!==l;return s&&(n=o,i=l),{width:n,height:i,$:s}}function Ii(t){return pi(t)?t:t.contextElement}function Ri(t){const e=Ii(t);if(!mi(e))return Ln(1);const n=e.getBoundingClientRect(),{width:i,height:r,$:o}=Fi(e);let l=(o?Rn(n.width):n.width)/i,s=(o?Rn(n.height):n.height)/r;return l&&Number.isFinite(l)||(l=1),s&&Number.isFinite(s)||(s=1),{x:l,y:s}}const Li=Ln(0);function Bi(t){const e=fi(t);return zi()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:Li}function Hi(t,e,n,i){void 0===e&&(e=!1),void 0===n&&(n=!1);const r=t.getBoundingClientRect(),o=Ii(t);let l=Ln(1);e&&(i?pi(i)&&(l=Ri(i)):l=Ri(t));const s=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==fi(t))&&e}(o,n,i)?Bi(o):Ln(0);let c=(r.left+s.x)/l.x,a=(r.top+s.y)/l.y,u=r.width/l.x,f=r.height/l.y;if(o){const t=fi(o),e=i&&pi(i)?fi(i):i;let n=t,r=Oi(n);for(;r&&i&&e!==n;){const t=Ri(r),e=r.getBoundingClientRect(),i=ji(r),o=e.left+(r.clientLeft+parseFloat(i.paddingLeft))*t.x,l=e.top+(r.clientTop+parseFloat(i.paddingTop))*t.y;c*=t.x,a*=t.y,u*=t.x,f*=t.y,c+=o,a+=l,n=fi(r),r=Oi(n)}}return oi({width:u,height:f,x:c,y:a})}function Pi(t,e){const n=Ai(t).scrollLeft;return e?e.left+n:Hi(di(t)).left+n}function Ui(t,e,n){void 0===n&&(n=!1);const i=t.getBoundingClientRect();return{x:i.left+e.scrollLeft-(n?0:Pi(t,i)),y:i.top+e.scrollTop}}const Vi=new Set(["absolute","fixed"]);function Zi(t,e,n){let i;if("viewport"===e)i=function(t,e){const n=fi(t),i=di(t),r=n.visualViewport;let o=i.clientWidth,l=i.clientHeight,s=0,c=0;if(r){o=r.width,l=r.height;const t=zi();(!t||t&&"fixed"===e)&&(s=r.offsetLeft,c=r.offsetTop)}return{width:o,height:l,x:s,y:c}}(t,n);else if("document"===e)i=function(t){const e=di(t),n=Ai(t),i=t.ownerDocument.body,r=In(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),o=In(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let l=-n.scrollLeft+Pi(t);const s=-n.scrollTop;return"rtl"===ji(i).direction&&(l+=In(e.clientWidth,i.clientWidth)-r),{width:r,height:o,x:l,y:s}}(di(t));else if(pi(e))i=function(t,e){const n=Hi(t,!0,"fixed"===e),i=n.top+t.clientTop,r=n.left+t.clientLeft,o=mi(t)?Ri(t):Ln(1);return{width:t.clientWidth*o.x,height:t.clientHeight*o.y,x:r*o.x,y:i*o.y}}(e,n);else{const n=Bi(t);i={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return oi(i)}function Yi(t,e){const n=Ci(t);return!(n===e||!pi(n)||Ei(n))&&("fixed"===ji(n).position||Yi(n,e))}function qi(t,e,n){const i=mi(e),r=di(e),o="fixed"===n,l=Hi(t,!0,o,e);let s={scrollLeft:0,scrollTop:0};const c=Ln(0);function a(){c.x=Pi(r)}if(i||!i&&!o)if(("body"!==ui(e)||gi(r))&&(s=Ai(e)),i){const t=Hi(e,!0,o,e);c.x=t.x+e.clientLeft,c.y=t.y+e.clientTop}else r&&a();o&&!i&&r&&a();const u=!r||i||o?Ln(0):Ui(r,s);return{x:l.left+s.scrollLeft-c.x-u.x,y:l.top+s.scrollTop-c.y-u.y,width:l.width,height:l.height}}function Gi(t){return"static"===ji(t).position}function Xi(t,e){if(!mi(t)||"fixed"===ji(t).position)return null;if(e)return e(t);let n=t.offsetParent;return di(t)===n&&(n=n.ownerDocument.body),n}function Wi(t,e){const n=fi(t);if(ki(t))return n;if(!mi(t)){let e=Ci(t);for(;e&&!Ei(e);){if(pi(e)&&!Gi(e))return e;e=Ci(e)}return n}let i=Xi(t,e);for(;i&&xi(i)&&Gi(i);)i=Xi(i,e);return i&&Ei(i)&&Gi(i)&&!Si(i)?n:i||function(t){let e=Ci(t);for(;mi(e)&&!Ei(e);){if(Si(e))return e;if(ki(e))return null;e=Ci(e)}return null}(t)||n}const Ki={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:i,strategy:r}=t;const o="fixed"===r,l=di(i),s=!!e&&ki(e.floating);if(i===l||s&&o)return n;let c={scrollLeft:0,scrollTop:0},a=Ln(1);const u=Ln(0),f=mi(i);if((f||!f&&!o)&&(("body"!==ui(i)||gi(l))&&(c=Ai(i)),mi(i))){const t=Hi(i);a=Ri(i),u.x=t.x+i.clientLeft,u.y=t.y+i.clientTop}const d=!l||f||o?Ln(0):Ui(l,c,!0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-c.scrollLeft*a.x+u.x+d.x,y:n.y*a.y-c.scrollTop*a.y+u.y+d.y}},getDocumentElement:di,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:i,strategy:r}=t;const o="clippingAncestors"===n?ki(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let i=Ni(t,[]).filter(t=>pi(t)&&"body"!==ui(t)),r=null;const o="fixed"===ji(t).position;let l=o?Ci(t):t;for(;pi(l)&&!Ei(l);){const e=ji(l),n=Si(l);n||"fixed"!==e.position||(r=null),(o?!n&&!r:!n&&"static"===e.position&&r&&Vi.has(r.position)||gi(l)&&!n&&Yi(t,l))?i=i.filter(t=>t!==l):r=e,l=Ci(l)}return e.set(t,i),i}(e,this._c):[].concat(n),l=[...o,i],s=l[0],c=l.reduce((t,n)=>{const i=Zi(e,n,r);return t.top=In(i.top,t.top),t.right=Fn(i.right,t.right),t.bottom=Fn(i.bottom,t.bottom),t.left=In(i.left,t.left),t},Zi(e,s,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},getOffsetParent:Wi,getElementRects:async function(t){const e=this.getOffsetParent||Wi,n=this.getDimensions,i=await n(t.floating);return{reference:qi(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=Fi(t);return{width:e,height:n}},getScale:Ri,isElement:pi,isRTL:function(t){return"rtl"===ji(t).direction}},Ji=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,i;const{x:r,y:o,placement:l,middlewareData:s}=e,c=await async function(t,e){const{placement:n,platform:i,elements:r}=t,o=await(null==i.isRTL?void 0:i.isRTL(r.floating)),l=Vn(n),s=Zn(n),c="y"===Xn(n),a=ci.has(l)?-1:1,u=o&&c?-1:1,f=Un(e,t);let{mainAxis:d,crossAxis:h,alignmentAxis:p}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return s&&"number"==typeof p&&(h="end"===s?-1*p:p),c?{x:h*u,y:d*a}:{x:d*a,y:h*u}}(e,t);return l===(null==(n=s.offset)?void 0:n.placement)&&null!=(i=s.arrow)&&i.alignmentOffset?{}:{x:r+c.x,y:o+c.y,data:{...c,placement:l}}}}},Qi=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:i,placement:r}=e,{mainAxis:o=!0,crossAxis:l=!1,limiter:s={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...c}=Un(t,e),a={x:n,y:i},u=await si(e,c),f=Xn(Vn(r)),d=Yn(f);let h=a[d],p=a[f];if(o){const t="y"===d?"bottom":"right";h=Pn(h+u["y"===d?"top":"left"],h,h-u[t])}if(l){const t="y"===f?"bottom":"right";p=Pn(p+u["y"===f?"top":"left"],p,p-u[t])}const m=s.fn({...e,[d]:h,[f]:p});return{...m,data:{x:m.x-n,y:m.y-i,enabled:{[d]:o,[f]:l}}}}}},tr=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,i;const{placement:r,middlewareData:o,rects:l,initialPlacement:s,platform:c,elements:a}=e,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...w}=Un(t,e);if(null!=(n=o.arrow)&&n.alignmentOffset)return{};const b=Vn(r),g=Xn(s),v=Vn(s)===s,x=await(null==c.isRTL?void 0:c.isRTL(a.floating)),y=d||(v||!m?[ii(s)]:function(t){const e=ii(t);return[Kn(t),e,Kn(e)]}(s)),k="none"!==p;!d&&k&&y.push(...ni(s,m,p,x));const $=[s,...y],_=await si(e,w),D=[];let S=(null==(i=o.flip)?void 0:i.overflows)||[];if(u&&D.push(_[b]),f){const t=function(t,e,n){void 0===n&&(n=!1);const i=Zn(t),r=Wn(t),o=qn(r);let l="x"===r?i===(n?"end":"start")?"right":"left":"start"===i?"bottom":"top";return e.reference[o]>e.floating[o]&&(l=ii(l)),[l,ii(l)]}(r,l,x);D.push(_[t[0]],_[t[1]])}if(S=[...S,{placement:r,overflows:D}],!D.every(t=>t<=0)){var z,M;const t=((null==(z=o.flip)?void 0:z.index)||0)+1,e=$[t];if(e){if(!("alignment"===f&&g!==Xn(e))||S.every(t=>t.overflows[0]>0&&Xn(t.placement)===g))return{data:{index:t,overflows:S},reset:{placement:e}}}let n=null==(M=S.filter(t=>t.overflows[0]<=0).sort((t,e)=>t.overflows[1]-e.overflows[1])[0])?void 0:M.placement;if(!n)switch(h){case"bestFit":{var E;const t=null==(E=S.filter(t=>{if(k){const e=Xn(t.placement);return e===g||"y"===e}return!0}).map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,e)=>t+e,0)]).sort((t,e)=>t[1]-e[1])[0])?void 0:E[0];t&&(n=t);break}case"initialPlacement":n=s}if(r!==n)return{reset:{placement:n}}}return{}}}},er=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:i,placement:r,rects:o,platform:l,elements:s,middlewareData:c}=e,{element:a,padding:u=0}=Un(t,e)||{};if(null==a)return{};const f=ri(u),d={x:n,y:i},h=Wn(r),p=qn(h),m=await l.getDimensions(a),w="y"===h,b=w?"top":"left",g=w?"bottom":"right",v=w?"clientHeight":"clientWidth",x=o.reference[p]+o.reference[h]-d[h]-o.floating[p],y=d[h]-o.reference[h],k=await(null==l.getOffsetParent?void 0:l.getOffsetParent(a));let $=k?k[v]:0;$&&await(null==l.isElement?void 0:l.isElement(k))||($=s.floating[v]||o.floating[p]);const _=x/2-y/2,D=$/2-m[p]/2-1,S=Fn(f[b],D),z=Fn(f[g],D),M=S,E=$-m[p]-z,j=$/2-m[p]/2+_,A=Pn(M,j,E),C=!c.arrow&&null!=Zn(r)&&j!==A&&o.reference[p]/2-(j<M?S:z)-m[p]/2<0,T=C?j<M?j-M:j-E:0;return{[h]:d[h]+T,data:{[h]:A,centerOffset:j-A-T,...C&&{alignmentOffset:T}},reset:C}}}),nr=(t,e,n)=>{const i=new Map,r={platform:Ki,...n},o={...r.platform,_c:i};return(async(t,e,n)=>{const{placement:i="bottom",strategy:r="absolute",middleware:o=[],platform:l}=n,s=o.filter(Boolean),c=await(null==l.isRTL?void 0:l.isRTL(e));let a=await l.getElementRects({reference:t,floating:e,strategy:r}),{x:u,y:f}=li(a,i,c),d=i,h={},p=0;for(let n=0;n<s.length;n++){const{name:o,fn:m}=s[n],{x:w,y:b,data:g,reset:v}=await m({x:u,y:f,initialPlacement:i,placement:d,strategy:r,middlewareData:h,rects:a,platform:l,elements:{reference:t,floating:e}});u=null!=w?w:u,f=null!=b?b:f,h={...h,[o]:{...h[o],...g}},v&&p<=50&&(p++,"object"==typeof v&&(v.placement&&(d=v.placement),v.rects&&(a=!0===v.rects?await l.getElementRects({reference:t,floating:e,strategy:r}):v.rects),({x:u,y:f}=li(a,d,c))),n=-1)}return{x:u,y:f,placement:d,strategy:r,middlewareData:h}})(t,e,{...r,platform:o})};function ir(t){let e;function n(t,e){return t[4]?lr:t[1]?rr:or}let i=n(t),r=i(t);return{c(){r.c(),e=S()},m(t,n){r.m(t,n),u(t,e,n)},p(t,o){i===(i=n(t))&&r?r.p(t,o):(r.d(1),r=i(t),r&&(r.c(),r.m(e.parentNode,e)))},d(t){t&&l(e),r.d(t)}}}function rr(t){let e,n,i,r,o;return{c(){e=d("figure"),n=d("canvas"),c(n,"class",i=`w-full h-full ${t[5]()}`),c(n,"style",r=`-webkit-mask: url(${t[9]}) 50% 50% no-repeat;\n mask: url(${t[9]}) 50% 50% no-repeat;\n -webkit-mask-size:contain;\n mask-size:contain;\n aspect-ratio: 1 / 1;`),c(e,"class",o=t[11].class||""),c(e,"style",t[8])},m(t,i){u(t,e,i),k(e,n)},p(t,l){32&l&&i!==(i=`w-full h-full ${t[5]()}`)&&c(n,"class",i),512&l&&r!==(r=`-webkit-mask: url(${t[9]}) 50% 50% no-repeat;\n mask: url(${t[9]}) 50% 50% no-repeat;\n -webkit-mask-size:contain;\n mask-size:contain;\n aspect-ratio: 1 / 1;`)&&c(n,"style",r),2048&l&&o!==(o=t[11].class||"")&&c(e,"class",o),256&l&&c(e,"style",t[8])},d(t){t&&l(e)}}}function or(t){let e,n,i=(t[10][t[0]]?t[10][t[0]]:t[0])+"";return{c(){e=d("div"),c(e,"class",n=`select-none bg-transparent block material-symbols-rounded leading-none notranslate ${t[11].class||""} ${t[2]}`),c(e,"style",t[7])},m(t,n){u(t,e,n),e.innerHTML=i},p(t,r){1&r&&i!==(i=(t[10][t[0]]?t[10][t[0]]:t[0])+"")&&(e.innerHTML=i),2052&r&&n!==(n=`select-none bg-transparent block material-symbols-rounded leading-none notranslate ${t[11].class||""} ${t[2]}`)&&c(e,"class",n),128&r&&c(e,"style",t[7])},d(t){t&&l(e)}}}function lr(t){let e,n,i,r;return{c(){e=d("div"),n=$(t[0]),c(e,"class",i=t[2]+" "+(t[11].class||"")+" w-full h-full text-center flex items-center justify-center"),c(e,"style",r=t[6]+" "+t[8])},m(t,i){u(t,e,i),k(e,n)},p(t,o){1&o&&b(n,t[0]),2052&o&&i!==(i=t[2]+" "+(t[11].class||"")+" w-full h-full text-center flex items-center justify-center")&&c(e,"class",i),320&o&&r!==(r=t[6]+" "+t[8])&&c(e,"style",r)},d(t){t&&l(e)}}}function sr(t){let e,n=t[3]&&ir(t);return{c(){n&&n.c(),e=S()},m(t,i){n&&n.m(t,i),u(t,e,i)},p(t,[i]){t[3]?n?n.p(t,i):(n=ir(t),n.c(),n.m(e.parentNode,e)):n&&(n.d(1),n=null)},i:o,o:o,d(t){t&&l(e),n&&n.d(t)}}}function cr(t,e,n){let o,l,s,c,a,u,f,{img:d="close"}=e,{size:h=8}=e,{color:p="text-c-800 hover:text-black"}=e,{pixel:m=!1}=e,{local:w=!1}=e,{black:b=!1,alt:g=!1,readonly:v=!1}=e;let x=!1;return G(async()=>{await document.fonts.ready,n(3,x=!0)}),t.$$set=t=>{n(11,e=i(i({},e),r(t))),"img"in t&&n(0,d=t.img),"size"in t&&n(12,h=t.size),"color"in t&&n(13,p=t.color),"pixel"in t&&n(14,m=t.pixel),"local"in t&&n(1,w=t.local),"black"in t&&n(15,b=t.black),"alt"in t&&n(16,g=t.alt),"readonly"in t&&n(17,v=t.readonly)},t.$$.update=()=>{237568&t.$$.dirty&&n(2,o=v?"text-c-200":g?"text-c-base hover:text-black":b?"text-c-100 hover:text-white":p),20480&t.$$.dirty&&n(8,s=m?`width: ${h}px; height: ${h}px;`:`width: ${(h||12)/4}rem; height: ${(h||12)/4}rem;`),20480&t.$$.dirty&&n(7,c=m?`font-size: ${h}px;`:`font-size: ${(h||12)/4}rem;`),20480&t.$$.dirty&&n(6,a=m?`font-size: ${.8*h}px;`:`font-size: ${.8*(h||12)/4}rem;`),8196&t.$$.dirty&&n(5,u=()=>o.replaceAll("text-","bg-"))},n(9,l=`/svg/${d}.svg`),n(4,f=d?.length>0&&(38==d.charCodeAt(0)||d.charCodeAt(0)>1e3)),e=r(e),[d,w,o,x,f,u,a,c,s,l,{dashboard:"",people_alt:"",local_offer:"",local_shipping:"",view_list:"",calendar_month:"",auto_mode:"",store:"",paid:"",account_balance:"",tips_and_updates:"",bug_report:""},e,h,p,m,b,g,v]}class ar extends t{constructor(t){super(),e(this,t,cr,sr,n,{img:0,size:12,color:13,pixel:14,local:1,black:15,alt:16,readonly:17})}}let ur={bus:_n,myuuid:xn,formatDate:kn,toDateStr:$n,listfromstring:Dn,toEuro:zn,tonum:Sn,strDate:En,getdim:yn,autofocus:function(t,e,n=100){if(!t)return;e&&e.querySelectorAll&&setTimeout(()=>{var t=e.querySelectorAll("input,select,area");(t&&t[0]||(t=e.querySelectorAll("button"))&&t[0])&&t[0].focus()},n)},setStorage:function(t,e){window?.localStorage&&(null==e||""===e?window.localStorage.removeItem(t):window.localStorage.setItem(t,JSON.stringify(e)))},getStorage:function(t,e){var n;window?.localStorage&&(n=window.localStorage.getItem(t));return n?JSON.parse(n):e}};function fr(){return ur}function dr(t){t||(t={});for(let e in t)ur[e]=t[e];return ur}const hr=t=>({}),pr=t=>({});function mr(t){let e;const n=t[14].default,i=p(n,t,t[13],null);return{c(){i&&i.c()},m(t,n){i&&i.m(t,n),e=!0},p(t,r){i&&i.p&&(!e||8192&r)&&g(i,n,t,t[13],e?x(n,t[13],r,null):v(t[13]),null)},i(t){e||(w(i,t),e=!0)},o(t){m(i,t),e=!1},d(t){i&&i.d(t)}}}function wr(t){let e,n,i,r,o,a;const h=t[14].default,b=p(h,t,t[13],null);let y=t[2]&&br(t);return{c(){e=d("span"),b&&b.c(),n=_(),y&&y.c(),i=S(),c(e,"class","relative"),D(e,"line-height","0 ")},m(l,s){u(l,e,s),b&&b.m(e,null),u(l,n,s),y&&y.m(l,s),u(l,i,s),r=!0,o||(a=[f(e,"focus",t[5]),f(e,"blur",t[6]),f(e,"mouseenter",t[5]),f(e,"mouseleave",t[6])],o=!0)},p(t,e){b&&b.p&&(!r||8192&e)&&g(b,h,t,t[13],r?x(h,t[13],e,null):v(t[13]),null),t[2]?y?(y.p(t,e),4&e&&w(y,1)):(y=br(t),y.c(),w(y,1),y.m(i.parentNode,i)):y&&(z(),m(y,1,1,()=>{y=null}),M())},i(t){r||(w(b,t),w(y),r=!0)},o(t){m(b,t),m(y),r=!1},d(t){t&&(l(e),l(n),l(i)),b&&b.d(t),y&&y.d(t),o=!1,s(a)}}}function br(t){let e,n,i,r,o,s,a,h,b,y;const $=t[14].tooltip,z=p($,t,t[13],pr),M=z||function(t){let e,n;return{c(){e=new C(!1),n=S(),e.a=n},m(i,r){e.m(t[0],i,r),u(i,n,r)},p(t,n){1&n&&e.p(t[0])},d(t){t&&(l(n),e.d())}}}(t);return{c(){e=d("button"),n=d("div"),r=_(),M&&M.c(),c(n,"class",i="absolute "+(t[1]?"bg-c-200":"bg-c-800")+" -z-1 w-2 h-2"),D(n,"transform","rotate(45deg)"),c(e,"class",o="fixed top-0 left-0 max-w-max min-w-max text-xs "+(t[1]?"text-black bg-white border border-c-200":"text-white bg-c-800")+" z-[5000] rounded-md p-2 "+(t[7].class||""))},m(i,o){u(i,e,o),k(e,n),t[15](n),k(e,r),M&&M.m(e,null),t[16](e),h=!0,b||(y=f(e,"click",t[6]),b=!0)},p(t,r){(!h||2&r&&i!==(i="absolute "+(t[1]?"bg-c-200":"bg-c-800")+" -z-1 w-2 h-2"))&&c(n,"class",i),z?z.p&&(!h||8192&r)&&g(z,$,t,t[13],h?x($,t[13],r,hr):v(t[13]),pr):M&&M.p&&(!h||1&r)&&M.p(t,h?r:-1),(!h||130&r&&o!==(o="fixed top-0 left-0 max-w-max min-w-max text-xs "+(t[1]?"text-black bg-white border border-c-200":"text-white bg-c-800")+" z-[5000] rounded-md p-2 "+(t[7].class||"")))&&c(e,"class",o)},i(t){h||(w(M,t),t&&j(()=>{h&&(a&&a.end(1),s=A(e,tt,{duration:300}),s.start())}),h=!0)},o(t){m(M,t),s&&s.invalidate(),t&&(a=E(e,tt,{duration:300})),h=!1},d(n){n&&l(e),t[15](null),M&&M.d(n),t[16](null),n&&a&&a.end(),b=!1,y()}}}function gr(t){let e,n,i,r;const o=[wr,mr],s=[];function c(t,e){return t[0]?0:1}return e=c(t),n=s[e]=o[e](t),{c(){n.c(),i=S()},m(t,n){s[e].m(t,n),u(t,i,n),r=!0},p(t,[r]){let l=e;e=c(t),e===l?s[e].p(t,r):(z(),m(s[l],1,1,()=>{s[l]=null}),M(),n=s[e],n?n.p(t,r):(n=s[e]=o[e](t),n.c()),w(n,1),n.m(i.parentNode,i))},i(t){r||(w(n),r=!0)},o(t){m(n),r=!1},d(t){t&&l(i),s[e].d(t)}}}function vr(t,e,n){let o,l,s,{$$slots:c={},$$scope:a}=e,{tooltip:u}=e,{bottom:f,white:d=!1,callback:p,left:m,right:w,maxtime:b=2e3}=e,g=!1;function v(){o&&clearTimeout(o),o=0,n(2,g=!1)}return t.$$set=t=>{n(7,e=i(i({},e),r(t))),"tooltip"in t&&n(0,u=t.tooltip),"bottom"in t&&n(8,f=t.bottom),"white"in t&&n(1,d=t.white),"callback"in t&&n(9,p=t.callback),"left"in t&&n(10,m=t.left),"right"in t&&n(11,w=t.right),"maxtime"in t&&n(12,b=t.maxtime),"$$scope"in t&&n(13,a=t.$$scope)},e=r(e),[u,d,g,l,s,async function(t){p&&"function"==typeof p&&await p(),n(2,g=!0),await X(),function(t){t.target&&l&&s&&nr(t.target,l,{placement:f?"bottom":m?"left":w?"right":"top",middleware:[Ji(6),tr(),Qi({padding:5}),er({element:s})]}).then(({x:t,y:e,placement:n,middlewareData:i})=>{Object.assign(l.style,{left:`${t}px`,top:`${e}px`,zIndex:1e3});const{x:r,y:o}=i.arrow,c={top:"bottom",right:"left",bottom:"top",left:"right"}[n.split("-")[0]];s&&Object.assign(s.style,{left:null!=r?`${r}px`:"",top:null!=o?`${o}px`:"",right:"",bottom:"",[c]:"-4px"})})}(t),b&&(o=setTimeout(()=>{v()},b))},v,e,f,p,m,w,b,a,c,function(t){h[t?"unshift":"push"](()=>{s=t,n(4,s)})},function(t){h[t?"unshift":"push"](()=>{l=t,n(3,l)})}]}class xr extends t{constructor(t){super(),e(this,t,vr,gr,n,{tooltip:0,bottom:8,white:1,callback:9,left:10,right:11,maxtime:12})}}function yr(t){let e,n,i,r,o,s,a,h;return n=new xr({props:{tooltip:t[19],$$slots:{default:[kr]},$$scope:{ctx:t}}}),{c(){e=d("button"),F(n.$$.fragment),c(e,"aria-label",i=`btnico_${t[0]}`),c(e,"style",t[21]),c(e,"tabindex",r=t[14]?"0":"-1"),c(e,"class",o=t[23](t[1],t[6],t[13],t[8],t[12],t[3],t[2],t[5],t[9],t[4],t[10],t[7])),y(e,"invisible",t[15]),y(e,"noprint",!0),y(e,"cursor-pointer",!t[13])},m(i,r){u(i,e,r),N(n,e,null),t[33](e),s=!0,a||(h=f(e,"click",O(t[22])),a=!0)},p(t,l){const a={};524288&l[0]&&(a.tooltip=t[19]),207777&l[0]|8&l[1]&&(a.$$scope={dirty:l,ctx:t}),n.$set(a),(!s||1&l[0]&&i!==(i=`btnico_${t[0]}`))&&c(e,"aria-label",i),(!s||2097152&l[0])&&c(e,"style",t[21]),(!s||16384&l[0]&&r!==(r=t[14]?"0":"-1"))&&c(e,"tabindex",r),(!s||14334&l[0]&&o!==(o=t[23](t[1],t[6],t[13],t[8],t[12],t[3],t[2],t[5],t[9],t[4],t[10],t[7])))&&c(e,"class",o),(!s||47102&l[0])&&y(e,"invisible",t[15]),(!s||14334&l[0])&&y(e,"noprint",!0),(!s||14334&l[0])&&y(e,"cursor-pointer",!t[13])},i(t){s||(w(n.$$.fragment,t),s=!0)},o(t){m(n.$$.fragment,t),s=!1},d(i){i&&l(e),T(n),t[33](null),a=!1,h()}}}function kr(t){let e,n,i;e=new ar({props:{img:t[0],size:t[7]?t[17]:t[17]>4?t[17]-2:3,black:!(t[5]||t[9]||t[8]||t[11]),readonly:t[13],local:t[16],alt:t[8],color:t[11]?"text-header hover:text-white":t[5]||t[9]?"text-c-800 hover:text-black":""}});const r=t[32].default,o=p(r,t,t[34],null);return{c(){F(e.$$.fragment),n=_(),o&&o.c()},m(t,r){N(e,t,r),u(t,n,r),o&&o.m(t,r),i=!0},p(t,n){const l={};1&n[0]&&(l.img=t[0]),131200&n[0]&&(l.size=t[7]?t[17]:t[17]>4?t[17]-2:3),2848&n[0]&&(l.black=!(t[5]||t[9]||t[8]||t[11])),8192&n[0]&&(l.readonly=t[13]),65536&n[0]&&(l.local=t[16]),256&n[0]&&(l.alt=t[8]),2592&n[0]&&(l.color=t[11]?"text-header hover:text-white":t[5]||t[9]?"text-c-800 hover:text-black":""),e.$set(l),o&&o.p&&(!i||8&n[1])&&g(o,r,t,t[34],i?x(r,t[34],n,null):v(t[34]),null)},i(t){i||(w(e.$$.fragment,t),w(o,t),i=!0)},o(t){m(e.$$.fragment,t),m(o,t),i=!1},d(t){t&&l(n),T(e,t),o&&o.d(t)}}}function $r(t){let e,n,i=t[20]&&yr(t);return{c(){i&&i.c(),e=S()},m(t,r){i&&i.m(t,r),u(t,e,r),n=!0},p(t,n){t[20]?i?(i.p(t,n),1048576&n[0]&&w(i,1)):(i=yr(t),i.c(),w(i,1),i.m(e.parentNode,e)):i&&(z(),m(i,1,1,()=>{i=null}),M())},i(t){n||(w(i),n=!0)},o(t){m(i),n=!1},d(t){t&&l(e),i&&i.d(t)}}}function _r(t,e,n){let o,l,s,c,{$$slots:a={},$$scope:u}=e;const{user:f,post:d}=fr(),p=W();let m,{img:w="yoga"}=e,{black:b=!1}=e,{right:g=!1}=e,{left:v=!1}=e,{center:x=!1}=e,{white:y=!1}=e,{whiteicon:k=!1}=e,{danger:$=!1}=e,{noborder:_=!1}=e,{alt:D=!1}=e,{gray:S=!1}=e,{nobtn:z=!1}=e,{header:M=!1}=e,{tooltip:E}=e,{warning:j=!1}=e,{success:A=!1}=e,{readonly:C=!1}=e,{auth:T=""}=e,{size:N=8}=e,{sm:O=!1}=e,{lg:F=!1}=e,{focus:I=!1}=e,{invisible:R=!1}=e,{local:L=!1}=e;const B={file_download:"Esporta i dati in formato XLSX",filter_alt:"Seleziona e filtra le colonne","β":"Aggiunge","β":"Modifica"};return t.$$set=t=>{n(39,e=i(i({},e),r(t))),"img"in t&&n(0,w=t.img),"black"in t&&n(1,b=t.black),"right"in t&&n(2,g=t.right),"left"in t&&n(3,v=t.left),"center"in t&&n(4,x=t.center),"white"in t&&n(5,y=t.white),"whiteicon"in t&&n(24,k=t.whiteicon),"danger"in t&&n(6,$=t.danger),"noborder"in t&&n(7,_=t.noborder),"alt"in t&&n(8,D=t.alt),"gray"in t&&n(9,S=t.gray),"nobtn"in t&&n(10,z=t.nobtn),"header"in t&&n(11,M=t.header),"tooltip"in t&&n(25,E=t.tooltip),"warning"in t&&n(12,j=t.warning),"success"in t&&n(26,A=t.success),"readonly"in t&&n(13,C=t.readonly),"auth"in t&&n(27,T=t.auth),"size"in t&&n(28,N=t.size),"sm"in t&&n(29,O=t.sm),"lg"in t&&n(30,F=t.lg),"focus"in t&&n(14,I=t.focus),"invisible"in t&&n(15,R=t.invisible),"local"in t&&n(16,L=t.local),"$$scope"in t&&n(34,u=t.$$scope)},t.$$.update=()=>{1879048192&t.$$.dirty[0]&&n(17,o=F?10:O?6:N||8),131072&t.$$.dirty[0]&&n(21,l=`width: ${(o||12)/4}rem; height: ${(o||12)/4}rem; `),134217728&t.$$.dirty[0]&&n(20,s=!T||d.isauth(T)),33554433&t.$$.dirty[0]&&n(19,c=E||B[w])},e=r(e),[w,b,g,v,x,y,$,_,D,S,z,M,j,C,I,R,L,o,m,c,s,l,function(t){C||p("click",t.target)},function(){var t=[e.class||""];return t.push("relative"),z||(v?t.push("rounded-l outline-c-200"):g?t.push("rounded-r !ml-0 outline-c-200"):x?t.push("!mr-0 !ml-0 border-r border-c-100"):t.push("rounded"),e.class&&t.push(e.class),C?y||D?t.push("bg-transparent"):t.push("bg-c-150"):b?t.push("bg-c-800 hover:bg-black"):k?t.push("bg-transparent text-white "):S?t.push("bg-c-150 border border-c-150 hover:bg-white"):y?(t.push("bg-transparent"),_||t.push("border border-c-200 hover:border-black")):D?t.push("bg-transparent "):(t.push("hover:bg-black"),$?t.push("bg-c-danger"):j?t.push("bg-c-warning"):A?t.push("bg-c-success"):t.push("bg-c-base"))),t.join(" ")},k,E,A,T,N,O,F,function(){return m},a,function(t){h[t?"unshift":"push"](()=>{m=t,n(18,m)})},u]}class Dr extends t{constructor(t){super(),e(this,t,_r,$r,n,{img:0,black:1,right:2,left:3,center:4,white:5,whiteicon:24,danger:6,noborder:7,alt:8,gray:9,nobtn:10,header:11,tooltip:25,warning:12,success:26,readonly:13,auth:27,size:28,sm:29,lg:30,focus:14,invisible:15,local:16,getel:31},null,[-1,-1])}get getel(){return this.$$.ctx[31]}}function Sr(t){let e;return{c(){e=$(t[2])},m(t,n){u(t,e,n)},p(t,n){4&n&&b(e,t[2])},d(t){t&&l(e)}}}function zr(t){let e,n,i=(t[2]||"").replaceAll("\n","<br/>")+"";return{c(){e=new C(!1),n=S(),e.a=n},m(t,r){e.m(i,t,r),u(t,n,r)},p(t,n){4&n&&i!==(i=(t[2]||"").replaceAll("\n","<br/>")+"")&&e.p(i)},d(t){t&&(l(n),e.d())}}}function Mr(t){let e,n,i;return{c(){e=d("button"),c(e,"aria-label","btntrad"),c(e,"class","bg-c-200 absolute top-0 -right-2 rounded-full w-2 h-2")},m(r,o){u(r,e,o),n||(i=f(e,"click",O(R(t[8]))),n=!0)},p:o,d(t){t&&l(e),n=!1,i()}}}function Er(t){let e,n,i;function r(t,e){return t[1]?zr:Sr}let s=r(t),a=s(t),f=t[3]&&9==t[4].level&&!t[0]&&Mr(t);return{c(){e=d("span"),a.c(),n=_(),f&&f.c(),c(e,"class",i=`relative ${t[9].class||""}`)},m(t,i){u(t,e,i),a.m(e,null),k(e,n),f&&f.m(e,null)},p(t,[o]){s===(s=r(t))&&a?a.p(t,o):(a.d(1),a=s(t),a&&(a.c(),a.m(e,n))),t[3]&&9==t[4].level&&!t[0]?f?f.p(t,o):(f=Mr(t),f.c(),f.m(e,null)):f&&(f.d(1),f=null),512&o&&i!==(i=`relative ${t[9].class||""}`)&&c(e,"class",i)},i:o,o:o,d(t){t&&l(e),a.d(),f&&f.d()}}}function jr(t,e,n){let o,l,s,c;const{bus:a,langedit:u,_:f,user:d,lang:h}=fr();I(t,u,t=>n(3,s=t)),I(t,d,t=>n(4,c=t)),I(t,h,t=>n(11,l=t));let{id:p}=e,{noadd:m=!1}=e,{html:w=!1}=e;return t.$$set=t=>{n(9,e=i(i({},e),r(t))),"id"in t&&n(10,p=t.id),"noadd"in t&&n(0,m=t.noadd),"html"in t&&n(1,w=t.html)},t.$$.update=()=>{3073&t.$$.dirty&&n(2,o=f(p,l,m))},e=r(e),[m,w,o,s,c,u,d,h,function(){var t=(p||"").split("::")[0].trim().toLowerCase();"+"==t[0]&&(t=t.split(":")[0]),a.emit("asktrad",{id:t})},e,p,l]}class Ar extends t{constructor(t){super(),e(this,t,jr,Er,n,{id:10,noadd:0,html:1})}}function Cr(t,e,n){const i=t.slice();return i[27]=e[n],i}function Tr(t){let e,n,i,r,o,s,a;const h=t[18].default,b=p(h,t,t[17],null),y=b||function(t){let e,n,i,r=t[0]&&Nr(t),o=B(t[10]),s=[];for(let e=0;e<o.length;e+=1)s[e]=Fr(Cr(t,o,e));const a=t=>m(s[t],1,1,()=>{s[t]=null});return{c(){e=d("div"),r&&r.c(),n=_();for(let t=0;t<s.length;t+=1)s[t].c();c(e,"class","grid grid-cols-[auto_1fr] gap-2 w-fill pb-2")},m(t,o){u(t,e,o),r&&r.m(e,null),k(e,n);for(let t=0;t<s.length;t+=1)s[t]&&s[t].m(e,null);i=!0},p(t,i){if(t[0]?r?(r.p(t,i),1&i&&w(r,1)):(r=Nr(t),r.c(),w(r,1),r.m(e,n)):r&&(z(),m(r,1,1,()=>{r=null}),M()),3584&i){let n;for(o=B(t[10]),n=0;n<o.length;n+=1){const r=Cr(t,o,n);s[n]?(s[n].p(r,i),w(s[n],1)):(s[n]=Fr(r),s[n].c(),w(s[n],1),s[n].m(e,null))}for(z(),n=o.length;n<s.length;n+=1)a(n);M()}},i(t){if(!i){w(r);for(let t=0;t<o.length;t+=1)w(s[t]);i=!0}},o(t){m(r),s=s.filter(Boolean);for(let t=0;t<s.length;t+=1)m(s[t]);i=!1},d(t){t&&l(e),r&&r.d(),H(s,t)}}}(t);return{c(){e=d("button"),n=_(),i=d("nav"),y&&y.c(),c(e,"class","fixed inset-0 bg-black opacity-0 z-10"),c(i,"class","fixed z-20 bg-white border border-c-border rounded-md shadow-md rounded-t-2xl")},m(r,l){u(r,e,l),u(r,n,l),u(r,i,l),y&&y.m(i,null),t[23](i),o=!0,s||(a=f(e,"click",t[20]),s=!0)},p(t,e){b?b.p&&(!o||131072&e)&&g(b,h,t,t[17],o?x(h,t[17],e,null):v(t[17]),null):y&&y.p&&(!o||1537&e)&&y.p(t,o?e:-1)},i(t){o||(w(y,t),t&&j(()=>{o&&(r||(r=L(i,tt,{duration:400},!0)),r.run(1))}),o=!0)},o(t){m(y,t),t&&(r||(r=L(i,tt,{duration:400},!1)),r.run(0)),o=!1},d(o){o&&(l(e),l(n),l(i)),y&&y.d(o),t[23](null),o&&r&&r.end(),s=!1,a()}}}function Nr(t){let e,n,i;return n=new Ar({props:{id:t[0]}}),{c(){e=d("div"),F(n.$$.fragment),c(e,"class","titolo col-span-2 overflow-hidden")},m(t,r){u(t,e,r),N(n,e,null),i=!0},p(t,e){const i={};1&e&&(i.id=t[0]),n.$set(i)},i(t){i||(w(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&l(e),T(n)}}}function Or(t){let e,n;return e=new ar({props:{img:t[27].icon,size:6}}),{c(){F(e.$$.fragment)},m(t,i){N(e,t,i),n=!0},p(t,n){const i={};1024&n&&(i.img=t[27].icon),e.$set(i)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){T(e,t)}}}function Fr(t){let e,n,i,r,o,a,h,p,g,v,x=t[27].des+"",y=t[27].icon&&Or(t);function D(){return t[21](t[27])}function S(){return t[22](t[27])}return{c(){e=d("button"),n=d("div"),y&&y.c(),i=_(),r=d("button"),o=d("div"),a=$(x),h=_(),c(n,"class","w-6 h-6"),c(e,"class","pl-2"),c(o,"class","pr-2 hover:text-c-base text-black whitespace-nowrap text-left")},m(t,l){u(t,e,l),k(e,n),y&&y.m(n,null),u(t,i,l),u(t,r,l),k(r,o),k(o,a),k(r,h),p=!0,g||(v=[f(e,"click",D),f(r,"click",O(S))],g=!0)},p(e,i){(t=e)[27].icon?y?(y.p(t,i),1024&i&&w(y,1)):(y=Or(t),y.c(),w(y,1),y.m(n,null)):y&&(z(),m(y,1,1,()=>{y=null}),M()),(!p||1024&i)&&x!==(x=t[27].des+"")&&b(a,x)},i(t){p||(w(y),p=!0)},o(t){m(y),p=!1},d(t){t&&(l(e),l(i),l(r)),y&&y.d(),g=!1,s(v)}}}function Ir(t){let e,n,i,r,o;n=new Dr({props:{img:t[5],white:t[1],size:t[6],black:t[2],right:t[3],left:t[4],tooltip:t[9]?"":t[0]}}),n.$on("click",t[12]);let s=t[9]&&Tr(t);return{c(){e=d("div"),F(n.$$.fragment),i=_(),s&&s.c(),r=S(),c(e,"class","flex")},m(l,c){u(l,e,c),N(n,e,null),t[19](e),u(l,i,c),s&&s.m(l,c),u(l,r,c),o=!0},p(t,[e]){const i={};32&e&&(i.img=t[5]),2&e&&(i.white=t[1]),64&e&&(i.size=t[6]),4&e&&(i.black=t[2]),8&e&&(i.right=t[3]),16&e&&(i.left=t[4]),513&e&&(i.tooltip=t[9]?"":t[0]),n.$set(i),t[9]?s?(s.p(t,e),512&e&&w(s,1)):(s=Tr(t),s.c(),w(s,1),s.m(r.parentNode,r)):s&&(z(),m(s,1,1,()=>{s=null}),M())},i(t){o||(w(n.$$.fragment,t),w(s),o=!0)},o(t){m(n.$$.fragment,t),m(s),o=!1},d(o){o&&(l(e),l(i),l(r)),T(n),t[19](null),s&&s.d(o)}}}function Rr(t,e,n){let i,{$$slots:r={},$$scope:o}=e;const{_:l,user:s,post:c}=fr(),a=W();let u,f,{title:d="titolo"}=e,{white:p=!1}=e,{black:m=!1}=e,{placement:w="bottom"}=e,{right:b=!1,left:g=!1}=e,{img:v="menu"}=e,{size:x=6}=e,{menu:y}=e,{voci:k=[]}=e,$=!1;return t.$$set=t=>{"title"in t&&n(0,d=t.title),"white"in t&&n(1,p=t.white),"black"in t&&n(2,m=t.black),"placement"in t&&n(13,w=t.placement),"right"in t&&n(3,b=t.right),"left"in t&&n(4,g=t.left),"img"in t&&n(5,v=t.img),"size"in t&&n(6,x=t.size),"menu"in t&&n(14,y=t.menu),"voci"in t&&n(15,k=t.voci),"$$scope"in t&&n(17,o=t.$$scope)},t.$$.update=()=>{49152&t.$$.dirty&&n(10,i=("function"==typeof y?y():k||[]).filter(t=>!t.hidden))},[d,p,m,b,g,v,x,u,f,$,i,a,async function(){$?n(9,$=!1):(n(9,$=!0),await X(),nr(u,f,{placement:w,middleware:[Ji(20),tr(),Qi({padding:12})]}).then(({x:t,y:e,placement:n,middlewareData:i})=>{Object.assign(f.style,{left:`${t}px`,top:`${e}px`,zIndex:1e3})}))},w,y,k,function(){n(9,$=!1)},o,r,function(t){h[t?"unshift":"push"](()=>{u=t,n(7,u)})},()=>n(9,$=!1),t=>{n(9,$=!1),a("click",t)},t=>{n(9,$=!1),a("click",t)},function(t){h[t?"unshift":"push"](()=>{f=t,n(8,f)})}]}class Lr extends t{constructor(t){super(),e(this,t,Rr,Ir,n,{title:0,white:1,black:2,placement:13,right:3,left:4,img:5,size:6,menu:14,voci:15,close:16})}get close(){return this.$$.ctx[16]}}function Br(t){let e,n;return e=new Dr({props:{class:"z-[8]",tooltip:t[0],size:t[1],right:t[3],white:t[4],alt:t[6],whiteicon:t[7],black:t[5],readonly:t[9],img:"β"}}),e.$on("click",t[11]),{c(){F(e.$$.fragment)},m(t,i){N(e,t,i),n=!0},p(t,[n]){const i={};1&n&&(i.tooltip=t[0]),2&n&&(i.size=t[1]),8&n&&(i.right=t[3]),16&n&&(i.white=t[4]),64&n&&(i.alt=t[6]),128&n&&(i.whiteicon=t[7]),32&n&&(i.black=t[5]),512&n&&(i.readonly=t[9]),e.$set(i)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){T(e,t)}}}function Hr(t,e,n){const i=W();let{tooltip:r="Apri una nuova scheda",size:o=8,nuovo:l=!1,right:s=!1,white:c=!1,black:a=!1,alt:u=!1,whiteicon:f=!1,value:d="",readonly:h=!1}=e;return t.$$set=t=>{"tooltip"in t&&n(0,r=t.tooltip),"size"in t&&n(1,o=t.size),"nuovo"in t&&n(2,l=t.nuovo),"right"in t&&n(3,s=t.right),"white"in t&&n(4,c=t.white),"black"in t&&n(5,a=t.black),"alt"in t&&n(6,u=t.alt),"whiteicon"in t&&n(7,f=t.whiteicon),"value"in t&&n(8,d=t.value),"readonly"in t&&n(9,h=t.readonly)},[r,o,l,s,c,a,u,f,d,h,i,()=>{d?l?window.open(d,"_blank"):it(d):i("click")}]}class Pr extends t{constructor(t){super(),e(this,t,Hr,Br,n,{tooltip:0,size:1,nuovo:2,right:3,white:4,black:5,alt:6,whiteicon:7,value:8,readonly:9})}}function Ur(t){let e,n,i,r,o,s,a,h,b,y,$;const D=t[14].default,S=p(D,t,t[13],null);let E=t[2]&&Vr(t);return{c(){e=d("button"),r=_(),o=d("nav"),s=d("div"),S&&S.c(),a=_(),E&&E.c(),c(e,"aria-label","bpop"),c(e,"class",n="fixed inset-0 "+(t[3]?"bg-transparent":"bg-c-800 opacity-20")+" z-50"),c(s,"class","relative h-full"),c(o,"class","fixed bg-white border border-c-border rounded shadow-md")},m(n,i){u(n,e,i),u(n,r,i),u(n,o,i),k(o,s),S&&S.m(s,null),k(s,a),E&&E.m(s,null),t[18](o),b=!0,y||($=f(e,"click",t[15]),y=!0)},p(t,i){(!b||8&i&&n!==(n="fixed inset-0 "+(t[3]?"bg-transparent":"bg-c-800 opacity-20")+" z-50"))&&c(e,"class",n),S&&S.p&&(!b||8192&i)&&g(S,D,t,t[13],b?x(D,t[13],i,null):v(t[13]),null),t[2]?E?(E.p(t,i),4&i&&w(E,1)):(E=Vr(t),E.c(),w(E,1),E.m(s,null)):E&&(z(),m(E,1,1,()=>{E=null}),M())},i(t){b||(t&&j(()=>{b&&(i||(i=L(e,tt,{duration:400},!0)),i.run(1))}),w(S,t),w(E),t&&j(()=>{b&&(h||(h=L(o,tt,{duration:400},!0)),h.run(1))}),b=!0)},o(t){t&&(i||(i=L(e,tt,{duration:400},!1)),i.run(0)),m(S,t),m(E),t&&(h||(h=L(o,tt,{duration:400},!1)),h.run(0)),b=!1},d(n){n&&(l(e),l(r),l(o)),n&&i&&i.end(),S&&S.d(n),E&&E.d(),t[18](null),n&&h&&h.end(),y=!1,$()}}}function Vr(t){let e,n,i,r,o;return n=new Dr({props:{img:"close",alt:!0,size:6}}),n.$on("click",t[16]),r=new Dr({props:{alt:!0,img:t[1]?"fullscreen_exit":"fullscreen",size:6,tooltip:t[1]?"riduci finestra":"espandi finestra",color:"text-c-400"}}),r.$on("click",t[17]),{c(){e=d("div"),F(n.$$.fragment),i=_(),F(r.$$.fragment),c(e,"class","absolute top-1 right-2 flex flex-row space-x-1 z-50")},m(t,l){u(t,e,l),N(n,e,null),k(e,i),N(r,e,null),o=!0},p(t,e){const n={};2&e&&(n.img=t[1]?"fullscreen_exit":"fullscreen"),2&e&&(n.tooltip=t[1]?"riduci finestra":"espandi finestra"),r.$set(n)},i(t){o||(w(n.$$.fragment,t),w(r.$$.fragment,t),o=!0)},o(t){m(n.$$.fragment,t),m(r.$$.fragment,t),o=!1},d(t){t&&l(e),T(n),T(r)}}}function Zr(t){let e,n,i=t[0]&&Ur(t);return{c(){i&&i.c(),e=S()},m(t,r){i&&i.m(t,r),u(t,e,r),n=!0},p(t,[n]){t[0]?i?(i.p(t,n),1&n&&w(i,1)):(i=Ur(t),i.c(),w(i,1),i.m(e.parentNode,e)):i&&(z(),m(i,1,1,()=>{i=null}),M())},i(t){n||(w(i),n=!0)},o(t){m(i),n=!1},d(t){t&&l(e),i&&i.d(t)}}}function Yr(t,e,n){let{$$slots:i={},$$scope:r}=e;const o=W();let l,{placement:s="bottom"}=e,{full:c=!1}=e,{canexpand:a=!1}=e,{isexpand:u=!1}=e,f=null,{show:d,element:p,elexpand:m=!1,transparent:w=!1,padding:b=2}=e;function g(){d&&(n(1,u=!u),u?(l&&(f={top:l.style.top,left:l.style.left,width:l.style.width,height:l.style.height,zIndex:l.style.zIndex,position:l.style.position}),v()):function(){l&&f&&Object.assign(l.style,f);x()}())}function v(){if(!l)return;let t=m&&m.getBoundingClientRect?m.getBoundingClientRect():null;Object.assign(l.style,{position:"fixed",top:t?t.top+"px":"0px",left:t?t.left+"px":"0px",width:t?t.width+"px":"100vw",height:t?t.height+"px":"100vh",zIndex:1e3})}async function x(){if(d&&p){if(await X(),u)return void v();nr(p,l,{placement:s,middleware:[Ji(4*b),tr(),Qi({padding:4*b})]}).then(({x:t,y:e,placement:n,middlewareData:i})=>{let r={top:`${e}px`,zIndex:1e3};c||(r.left=`${t}px`),Object.assign(l.style,r)})}else n(0,d=!1)}return t.$$set=t=>{"placement"in t&&n(7,s=t.placement),"full"in t&&n(8,c=t.full),"canexpand"in t&&n(2,a=t.canexpand),"isexpand"in t&&n(1,u=t.isexpand),"show"in t&&n(0,d=t.show),"element"in t&&n(9,p=t.element),"elexpand"in t&&n(10,m=t.elexpand),"transparent"in t&&n(3,w=t.transparent),"padding"in t&&n(11,b=t.padding),"$$scope"in t&&n(13,r=t.$$scope)},t.$$.update=()=>{641&t.$$.dirty&&x()},[d,u,a,w,l,o,g,s,c,p,m,b,function(){n(0,d=!1)},r,i,()=>{n(0,d=!1),o("close")},()=>{n(0,d=!1),o("close")},()=>{g(),o("expand",u)},function(t){h[t?"unshift":"push"](()=>{l=t,n(4,l)})}]}class qr extends t{constructor(t){super(),e(this,t,Yr,Zr,n,{placement:7,full:8,canexpand:2,isexpand:1,show:0,element:9,elexpand:10,transparent:3,padding:11,close:12})}get close(){return this.$$.ctx[12]}}function Gr(t){let e,n;return e=new xr({props:{tooltip:t[1],$$slots:{default:[Wr]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(t,i){N(e,t,i),n=!0},p(t,n){const i={};2&n&&(i.tooltip=t[1]),273416188&n&&(i.$$scope={dirty:n,ctx:t}),e.$set(i)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){T(e,t)}}}function Xr(t){let e,n;return{c(){e=d("div"),c(e,"class","btneffect")},m(t,n){u(t,e,n)},p(e,n){t=e},i(i){i&&(n||j(()=>{n=A(e,et,{duration:t[0]}),n.start()}))},o:o,d(t){t&&l(e)}}}function Wr(t){let e,n,i,r,o,s,a,h,D=t[17]&&Xr(t);const S=t[27].default,z=p(S,t,t[28],null),M=z||function(t){let e,n,i,r=t[20](t[19])+"";return{c(){e=d("div"),n=d("div"),i=$(r),c(e,"class","flex flex-row space-x-2")},m(t,r){u(t,e,r),k(e,n),k(n,i)},p(t,e){524288&e&&r!==(r=t[20](t[19])+"")&&b(i,r)},d(t){t&&l(e)}}}(t);return{c(){e=d("button"),D&&D.c(),n=_(),M&&M.c(),c(e,"aria-label",i=t[19]||"btn"),c(e,"class",r=(t[22].class||"")+" btn overflow-hidden "+(t[2]?"text-left-px-2":"")),c(e,"style",o=t[2]?"justify-ontent: left; width:fit-content;height:fit-content;":""),y(e,"fix",t[11]),y(e,"fixl",t[12]),y(e,"alt",t[3]),y(e,"warning",t[8]),y(e,"black",t[5]),y(e,"gray",t[7]),y(e,"danger",t[9]),y(e,"link",t[4]),y(e,"full",t[13]),y(e,"xs",t[15]),y(e,"sm",t[14]),y(e,"lg",t[16]),y(e,"white",t[6]),y(e,"readonly",t[10])},m(i,r){u(i,e,r),D&&D.m(e,null),k(e,n),M&&M.m(e,null),s=!0,a||(h=f(e,"click",O(t[21])),a=!0)},p(t,l){t[17]?D?131072&l&&w(D,1):(D=Xr(t),D.c(),w(D,1),D.m(e,n)):D&&(D.d(1),D=null),z?z.p&&(!s||268435456&l)&&g(z,S,t,t[28],s?x(S,t[28],l,null):v(t[28]),null):M&&M.p&&(!s||524288&l)&&M.p(t,s?l:-1),(!s||524288&l&&i!==(i=t[19]||"btn"))&&c(e,"aria-label",i),(!s||4194308&l&&r!==(r=(t[22].class||"")+" btn overflow-hidden "+(t[2]?"text-left-px-2":"")))&&c(e,"class",r),(!s||4&l&&o!==(o=t[2]?"justify-ontent: left; width:fit-content;height:fit-content;":""))&&c(e,"style",o),(!s||4196356&l)&&y(e,"fix",t[11]),(!s||4198404&l)&&y(e,"fixl",t[12]),(!s||4194316&l)&&y(e,"alt",t[3]),(!s||4194564&l)&&y(e,"warning",t[8]),(!s||4194340&l)&&y(e,"black",t[5]),(!s||4194436&l)&&y(e,"gray",t[7]),(!s||4194820&l)&&y(e,"danger",t[9]),(!s||4194324&l)&&y(e,"link",t[4]),(!s||4202500&l)&&y(e,"full",t[13]),(!s||4227076&l)&&y(e,"xs",t[15]),(!s||4210692&l)&&y(e,"sm",t[14]),(!s||4259844&l)&&y(e,"lg",t[16]),(!s||4194372&l)&&y(e,"white",t[6]),(!s||4195332&l)&&y(e,"readonly",t[10])},i(t){s||(w(D),w(M,t),s=!0)},o(t){m(M,t),s=!1},d(t){t&&l(e),D&&D.d(),M&&M.d(t),a=!1,h()}}}function Kr(t){let e,n,i=t[18]&&Gr(t);return{c(){i&&i.c(),e=S()},m(t,r){i&&i.m(t,r),u(t,e,r),n=!0},p(t,[n]){t[18]?i?(i.p(t,n),262144&n&&w(i,1)):(i=Gr(t),i.c(),w(i,1),i.m(e.parentNode,e)):i&&(z(),m(i,1,1,()=>{i=null}),M())},i(t){n||(w(i),n=!0)},o(t){m(i),n=!1},d(t){t&&l(e),i&&i.d(t)}}}function Jr(t,e,n){let o,l,{$$slots:s={},$$scope:c}=e;const{_:a,P:u}=fr(),f=W();let{duration:d=300}=e,{text:h="",title:p="",value:m="",auth:w="",tooltip:b="",left:g=!1,alt:v=!1,link:x=!1,black:y=!1,white:k=!1,gray:$=!1,warning:_=!1,danger:D=!1,readonly:S=!1,fix:z=!1,fixl:M=!1,full:E=!1,sm:j=!1,xs:A=!1,lg:C=!1}=e,T=!1;return t.$$set=t=>{n(22,e=i(i({},e),r(t))),"duration"in t&&n(0,d=t.duration),"text"in t&&n(23,h=t.text),"title"in t&&n(24,p=t.title),"value"in t&&n(25,m=t.value),"auth"in t&&n(26,w=t.auth),"tooltip"in t&&n(1,b=t.tooltip),"left"in t&&n(2,g=t.left),"alt"in t&&n(3,v=t.alt),"link"in t&&n(4,x=t.link),"black"in t&&n(5,y=t.black),"white"in t&&n(6,k=t.white),"gray"in t&&n(7,$=t.gray),"warning"in t&&n(8,_=t.warning),"danger"in t&&n(9,D=t.danger),"readonly"in t&&n(10,S=t.readonly),"fix"in t&&n(11,z=t.fix),"fixl"in t&&n(12,M=t.fixl),"full"in t&&n(13,E=t.full),"sm"in t&&n(14,j=t.sm),"xs"in t&&n(15,A=t.xs),"lg"in t&&n(16,C=t.lg),"$$scope"in t&&n(28,c=t.$$scope)},t.$$.update=()=>{58720256&t.$$.dirty&&n(19,o=h||p||m||".."),67108864&t.$$.dirty&&n(18,l=!w||u.isauth(w))},e=r(e),[d,b,g,v,x,y,k,$,_,D,S,z,M,E,j,A,C,T,l,o,a,async function(t){S||(n(17,T=!0),await X(),f("click",t.target),setTimeout(()=>{n(17,T=!1)},d))},e,h,p,m,w,s,c]}class Qr extends t{constructor(t){super(),e(this,t,Jr,Kr,n,{duration:0,text:23,title:24,value:25,auth:26,tooltip:1,left:2,alt:3,link:4,black:5,white:6,gray:7,warning:8,danger:9,readonly:10,fix:11,fixl:12,full:13,sm:14,xs:15,lg:16})}}function to(t){let e,n,i,r,o,h;return{c(){e=d("div"),n=d("input"),n.readOnly=t[2],c(n,"type","text"),c(n,"ref","input"),c(n,"class",i="w-full outline-none "+(t[4]?"pl-1 group-hover:bg-white bg-c-50":"bg-white")),c(n,"placeholder",t[5]),c(e,"class",r="text-black border border-c-border rounded-md px-2 md:px-10 flex "+(t[4]?"border-1.5 bg-c-50 hover:bg-white group":"bg-white")),y(e,"py-1",!t[3]),y(e,"text-sm",t[3]),y(e,"py-0.5",t[3]),y(e,"py-3",t[4]),y(e,"rounded-3xl",t[4])},m(i,r){u(i,e,r),k(e,n),a(n,t[0]),o||(h=[f(n,"input",t[12]),f(n,"keyup",t[8])],o=!0)},p(t,o){4&o&&(n.readOnly=t[2]),16&o&&i!==(i="w-full outline-none "+(t[4]?"pl-1 group-hover:bg-white bg-c-50":"bg-white"))&&c(n,"class",i),32&o&&c(n,"placeholder",t[5]),1&o&&n.value!==t[0]&&a(n,t[0]),16&o&&r!==(r="text-black border border-c-border rounded-md px-2 md:px-10 flex "+(t[4]?"border-1.5 bg-c-50 hover:bg-white group":"bg-white"))&&c(e,"class",r),24&o&&y(e,"py-1",!t[3]),24&o&&y(e,"text-sm",t[3]),24&o&&y(e,"py-0.5",t[3]),16&o&&y(e,"py-3",t[4]),16&o&&y(e,"rounded-3xl",t[4])},d(t){t&&l(e),o=!1,s(h)}}}function eo(t){let e,n,i,r;return{c(){e=d("div"),n=d("input"),n.readOnly=t[2],c(n,"type","text"),c(n,"ref","input"),c(n,"class","w-full outline-none bg-transparent"),c(n,"placeholder",t[5]),c(e,"class","text-black border border-c-border rounded-md px-2 md:px-10 flex hover:bg-white focus-within:bg-white"),y(e,"py-1",!t[3]),y(e,"text-sm",t[3]),y(e,"py-0.5",t[3]),y(e,"py-3",t[4]),y(e,"rounded-3xl",t[4])},m(o,l){u(o,e,l),k(e,n),a(n,t[0]),i||(r=[f(n,"input",t[11]),f(n,"keyup",t[8])],i=!0)},p(t,i){4&i&&(n.readOnly=t[2]),32&i&&c(n,"placeholder",t[5]),1&i&&n.value!==t[0]&&a(n,t[0]),8&i&&y(e,"py-1",!t[3]),8&i&&y(e,"text-sm",t[3]),8&i&&y(e,"py-0.5",t[3]),16&i&&y(e,"py-3",t[4]),16&i&&y(e,"rounded-3xl",t[4])},d(t){t&&l(e),i=!1,s(r)}}}function no(t){let e,n,i,r,s;return n=new ar({props:{img:"close",size:6,color:"text-c-200"}}),{c(){e=d("button"),F(n.$$.fragment),c(e,"class","hidden md:block md:absolute vcenter right-2 cursor-pointer")},m(o,l){u(o,e,l),N(n,e,null),i=!0,r||(s=f(e,"click",t[13]),r=!0)},p:o,i(t){i||(w(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&l(e),T(n),r=!1,s()}}}function io(t){let e,n,i,r,o,a,h,p,b,g;function v(t,e){return t[6]?eo:to}let x=v(t),$=x(t);r=new ar({props:{img:"search",size:t[3]?6:8,color:t[0]&&t[1]?"text-black":"text-c-200"}});let D=t[0]&&no(t);return{c(){e=d("div"),$.c(),n=_(),i=d("button"),F(r.$$.fragment),a=_(),D&&D.c(),c(i,"class",o="hidden md:block md:absolute vcenter "+(t[4]?"left-3":"left-1")),y(i,"cursor-pointer",t[0]&&t[1]),c(e,"class",h="relative "+(t[10].class||""))},m(o,l){u(o,e,l),$.m(e,null),k(e,n),k(e,i),N(r,i,null),k(e,a),D&&D.m(e,null),p=!0,b||(g=[f(i,"click",t[9]),f(i,"keypress",ro)],b=!0)},p(t,[l]){x===(x=v(t))&&$?$.p(t,l):($.d(1),$=x(t),$&&($.c(),$.m(e,n)));const s={};8&l&&(s.size=t[3]?6:8),3&l&&(s.color=t[0]&&t[1]?"text-black":"text-c-200"),r.$set(s),(!p||16&l&&o!==(o="hidden md:block md:absolute vcenter "+(t[4]?"left-3":"left-1")))&&c(i,"class",o),(!p||19&l)&&y(i,"cursor-pointer",t[0]&&t[1]),t[0]?D?(D.p(t,l),1&l&&w(D,1)):(D=no(t),D.c(),w(D,1),D.m(e,null)):D&&(z(),m(D,1,1,()=>{D=null}),M()),(!p||1024&l&&h!==(h="relative "+(t[10].class||"")))&&c(e,"class",h)},i(t){p||(w(r.$$.fragment,t),w(D),p=!0)},o(t){m(r.$$.fragment,t),m(D),p=!1},d(t){t&&l(e),$.d(),T(r),D&&D.d(),b=!1,s(g)}}}const ro=()=>{};function oo(t,e,n){const o=W();let{evidenzia:l=!1,readonly:s=!1,sm:c=!1,lg:a=!1,value:u="",placeholder:f="Cerca",dtable:d=!1}=e;function h(){s||(o("click",u),o("cerca",u))}return t.$$set=t=>{n(10,e=i(i({},e),r(t))),"evidenzia"in t&&n(1,l=t.evidenzia),"readonly"in t&&n(2,s=t.readonly),"sm"in t&&n(3,c=t.sm),"lg"in t&&n(4,a=t.lg),"value"in t&&n(0,u=t.value),"placeholder"in t&&n(5,f=t.placeholder),"dtable"in t&&n(6,d=t.dtable)},e=r(e),[u,l,s,c,a,f,d,o,function(t){s||("Escape"==t.key&&n(0,u=""),o("input",t.target,u),"Enter"!=t.key&&"Escape"!=t.key||h())},h,e,function(){u=this.value,n(0,u)},function(){u=this.value,n(0,u)},()=>{n(0,u=""),o("input",""),o("click")}]}class lo extends t{constructor(t){super(),e(this,t,oo,io,n,{evidenzia:1,readonly:2,sm:3,lg:4,value:0,placeholder:5,dtable:6})}}function so(t){let e,n,i,r,o,a,h,b,y,$,D;const S=t[7].default,z=p(S,t,t[6],null),M=z||function(t){let e,n,i;return n=new Ar({props:{id:t[0]}}),{c(){e=d("span"),F(n.$$.fragment),c(e,"class","btn primary cursor-pointer")},m(t,r){u(t,e,r),N(n,e,null),i=!0},p(t,e){const i={};1&e&&(i.id=t[0]),n.$set(i)},i(t){i||(w(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&l(e),T(n)}}}(t);return{c(){e=d("button"),M&&M.c(),n=_(),i=d("label"),r=d("input"),c(r,"type","file"),r.multiple=t[2],c(r,"accept",t[1]),c(r,"class","absolute inset-0 opacity-0 cursor-pointer"),c(r,"webkitdirectory",o=t[3]?"":void 0),c(r,"directory",a=t[3]?"":void 0),c(i,"name",h="file"+t[0]),c(e,"class",b=`relative cursor-pointer ${t[5].class||""}`)},m(o,l){u(o,e,l),M&&M.m(e,null),k(e,n),k(e,i),k(i,r),y=!0,$||(D=[f(r,"click",O(co)),f(r,"change",O(t[8]))],$=!0)},p(t,[n]){z?z.p&&(!y||64&n)&&g(z,S,t,t[6],y?x(S,t[6],n,null):v(t[6]),null):M&&M.p&&(!y||1&n)&&M.p(t,y?n:-1),(!y||4&n)&&(r.multiple=t[2]),(!y||2&n)&&c(r,"accept",t[1]),(!y||8&n&&o!==(o=t[3]?"":void 0))&&c(r,"webkitdirectory",o),(!y||8&n&&a!==(a=t[3]?"":void 0))&&c(r,"directory",a),(!y||1&n&&h!==(h="file"+t[0]))&&c(i,"name",h),(!y||32&n&&b!==(b=`relative cursor-pointer ${t[5].class||""}`))&&c(e,"class",b)},i(t){y||(w(M,t),y=!0)},o(t){m(M,t),y=!1},d(t){t&&l(e),M&&M.d(t),$=!1,s(D)}}}const co=()=>{};function ao(t,e,n){let{$$slots:o={},$$scope:l}=e,{value:s="file",accept:c="image/*,.pdf,.xlsx,.txt,.xls,.md,.log,.json,.yaml,.glb,.gltf,.3ds,.stl,.obj",multiple:a=!1,directory:u=!1}=e;const f=W();return t.$$set=t=>{n(5,e=i(i({},e),r(t))),"value"in t&&n(0,s=t.value),"accept"in t&&n(1,c=t.accept),"multiple"in t&&n(2,a=t.multiple),"directory"in t&&n(3,u=t.directory),"$$scope"in t&&n(6,l=t.$$scope)},e=r(e),[s,c,a,u,f,e,l,o,t=>{f("click",t.target.files)}]}class uo extends t{constructor(t){super(),e(this,t,ao,so,n,{value:0,accept:1,multiple:2,directory:3})}}function fo(t){let e,n;return{c(){e=d("span"),n=$(t[2]),c(e,"class","lowercase pl-2 text-c-200"),y(e,"text-c-base",t[7])},m(t,i){u(t,e,i),k(e,n)},p(t,i){4&i&&b(n,t[2]),128&i&&y(e,"text-c-base",t[7])},d(t){t&&l(e)}}}function ho(t){let e,n,i,r,s,a,h,p,m,w,g,v=t[2]&&fo(t);return{c(){e=d("div"),n=d("input"),r=_(),s=d("label"),v&&v.c(),a=_(),h=d("span"),p=$(t[1]),c(n,"tabindex","-1"),c(n,"type","checkbox"),n.disabled=t[6],c(n,"id",t[9]),n.checked=t[7],c(n,"class",i=t[5]?"checkbox":"toggle"),y(n,"sm",t[3]),y(n,"xs",t[4]),c(h,"class","pl-1"),c(s,"class","text-sm font-base"),c(s,"for",t[9]),y(s,"font-bold",t[0]),c(e,"class",m=t[10].class||"")},m(i,o){u(i,e,o),k(e,n),k(e,r),k(e,s),v&&v.m(s,null),k(s,a),k(s,h),k(h,p),w||(g=f(n,"click",O(t[8])),w=!0)},p(t,[r]){64&r&&(n.disabled=t[6]),128&r&&(n.checked=t[7]),32&r&&i!==(i=t[5]?"checkbox":"toggle")&&c(n,"class",i),40&r&&y(n,"sm",t[3]),48&r&&y(n,"xs",t[4]),t[2]?v?v.p(t,r):(v=fo(t),v.c(),v.m(s,a)):v&&(v.d(1),v=null),2&r&&b(p,t[1]),1&r&&y(s,"font-bold",t[0]),1024&r&&m!==(m=t[10].class||"")&&c(e,"class",m)},i:o,o:o,d(t){t&&l(e),v&&v.d(),w=!1,g()}}}function po(t,e,n){let o;const l=W();let{value:s=0}=e,{truevalue:c=1}=e,{falsevalue:a=0}=e,{bold:u=!1}=e,{label:f=""}=e,{labcod:d=""}=e,{sm:h=!1}=e,{xs:p=!1}=e,{checkbox:m=!1}=e,{readonly:w=!1}=e;G(()=>{s!=c&&s!=a&&(n(11,s=a),l("click",{value:s}))});const b=Math.random().toString(36).substring(2,15);return t.$$set=t=>{n(10,e=i(i({},e),r(t))),"value"in t&&n(11,s=t.value),"truevalue"in t&&n(12,c=t.truevalue),"falsevalue"in t&&n(13,a=t.falsevalue),"bold"in t&&n(0,u=t.bold),"label"in t&&n(1,f=t.label),"labcod"in t&&n(2,d=t.labcod),"sm"in t&&n(3,h=t.sm),"xs"in t&&n(4,p=t.xs),"checkbox"in t&&n(5,m=t.checkbox),"readonly"in t&&n(6,w=t.readonly)},t.$$.update=()=>{6144&t.$$.dirty&&n(7,o=s==c)},e=r(e),[u,f,d,h,p,m,w,o,async function(t){t.stopPropagation(),t.target.checked?n(11,s=c):n(11,s=a),await X(),l("click",{value:s})},b,e,s,c,a]}class mo extends t{constructor(t){super(),e(this,t,po,ho,n,{value:11,truevalue:12,falsevalue:13,bold:0,label:1,labcod:2,sm:3,xs:4,checkbox:5,readonly:6})}}const wo=t=>({}),bo=t=>({});function go(t){let e,n;const i=t[11].popup,r=p(i,t,t[10],bo);return{c(){e=d("div"),r&&r.c(),c(e,"class","fixed"),c(e,"tabindex","-1")},m(i,o){u(i,e,o),r&&r.m(e,null),t[12](e),n=!0},p(t,e){r&&r.p&&(!n||1024&e)&&g(r,i,t,t[10],n?x(i,t[10],e,wo):v(t[10]),bo)},i(t){n||(w(r,t),n=!0)},o(t){m(r,t),n=!1},d(n){n&&l(e),r&&r.d(n),t[12](null)}}}function vo(t){let e,n,i,r,o;const s=t[11].default,a=p(s,t,t[10],null);let f=t[2]&&go(t);return{c(){e=d("div"),n=d("div"),a&&a.c(),i=_(),f&&f.c(),c(n,"class","z-10"),c(e,"class",r=t[3].class)},m(r,l){u(r,e,l),k(e,n),a&&a.m(n,null),k(e,i),f&&f.m(e,null),t[13](e),o=!0},p(t,[n]){a&&a.p&&(!o||1024&n)&&g(a,s,t,t[10],o?x(s,t[10],n,null):v(t[10]),null),t[2]?f?(f.p(t,n),4&n&&w(f,1)):(f=go(t),f.c(),w(f,1),f.m(e,null)):f&&(z(),m(f,1,1,()=>{f=null}),M()),(!o||8&n&&r!==(r=t[3].class))&&c(e,"class",r)},i(t){o||(w(a,t),w(f),o=!0)},o(t){m(a,t),m(f),o=!1},d(n){n&&l(e),a&&a.d(n),f&&f.d(),t[13](null)}}}function xo(t){return!0}function yo(t,e,n){let o,l,{$$slots:s={},$$scope:c}=e,{theme:a}=e,u=!1,{fix:f}=e,{size:d}=e,{closeOnClickOutside:p=!0}=e;async function m(t){if(2==t&&(t=!u),t!==u&&(n(2,u=t),u)){await X();const t=a?180:l.offsetWidth;nr(l,o,{placement:"bottom-start",middleware:[tr(),Qi({padding:0})]}).then(({x:e,y:n,placement:i,middlewareData:r})=>{Object.assign(o.style,{left:`${e}px`,top:`${n}px`,width:`${t}px`,zIndex:1e3}),f?Object.assign(o.style,{width:`${t}px`}):d&&Object.assign(o.style,{width:`${d}`})})}}const w=W();function b(t){l.contains(t.target)&&w("gotfocus")}function g(t){setTimeout(()=>{l&&l.contains(document.activeElement)||(m(!1),w("lostfocus"))},0)}function v(t){p&&u&&l&&o&&!l.contains(t.target)&&!o.contains(t.target)&&m(!1)}return G(()=>{l.addEventListener("focusin",b),l.addEventListener("focusout",g),p&&document.addEventListener("click",v)}),K(()=>{l&&(l.removeEventListener("focusin",b),l.removeEventListener("focusout",g)),document.removeEventListener("click",v)}),t.$$set=t=>{n(3,e=i(i({},e),r(t))),"theme"in t&&n(4,a=t.theme),"fix"in t&&n(5,f=t.fix),"size"in t&&n(6,d=t.size),"closeOnClickOutside"in t&&n(7,p=t.closeOnClickOutside),"$$scope"in t&&n(10,c=t.$$scope)},e=r(e),[o,l,u,e,a,f,d,p,m,xo,c,s,function(t){h[t?"unshift":"push"](()=>{o=t,n(0,o)})},function(t){h[t?"unshift":"push"](()=>{l=t,n(1,l)})}]}class ko extends t{constructor(t){super(),e(this,t,yo,vo,n,{theme:4,fix:5,size:6,closeOnClickOutside:7,openmenu:8,checkvisibility:9})}get openmenu(){return this.$$.ctx[8]}get checkvisibility(){return xo}}function $o(t){let e,n,i,r,o,a;const h=t[7].default,b=p(h,t,t[6],null);return{c(){e=d("button"),n=_(),i=d("button"),b&&b.c(),c(e,"aria-label","full"),c(e,"class","z-10 fixed inset-0 opacity-0"),c(i,"class","fixed"),c(i,"tabindex","-1")},m(l,s){u(l,e,s),u(l,n,s),u(l,i,s),b&&b.m(i,null),t[10](i),r=!0,o||(a=[f(e,"click",R(t[8])),f(e,"contextmenu",R(t[9])),f(i,"contextmenu",R(t[11]))],o=!0)},p(t,e){b&&b.p&&(!r||64&e)&&g(b,h,t,t[6],r?x(h,t[6],e,null):v(t[6]),null)},i(t){r||(w(b,t),r=!0)},o(t){m(b,t),r=!1},d(r){r&&(l(e),l(n),l(i)),b&&b.d(r),t[10](null),o=!1,s(a)}}}function _o(t){let e,n,i=t[0]&&$o(t);return{c(){i&&i.c(),e=S()},m(t,r){i&&i.m(t,r),u(t,e,r),n=!0},p(t,[n]){t[0]?i?(i.p(t,n),1&n&&w(i,1)):(i=$o(t),i.c(),w(i,1),i.m(e.parentNode,e)):i&&(z(),m(i,1,1,()=>{i=null}),M())},i(t){n||(w(i),n=!0)},o(t){m(i),n=!1},d(t){t&&l(e),i&&i.d(t)}}}function Do(t,e,n){let{$$slots:i={},$$scope:r}=e;const o=W();let l,{show:s=!1,mouseX:c=0,mouseY:a=0}=e;async function u(){if(!s)return;if(await X(),!l)return;await X();nr({getBoundingClientRect:()=>({x:c,y:a,width:0,height:0,top:a,left:c,right:c,bottom:a})},l,{placement:"bottom-start",middleware:[Ji(10),tr(),Qi()]}).then(({x:t,y:e,placement:n})=>{Object.assign(l.style,{left:`${t}px`,top:`${e}px`,zIndex:1e3})})}return t.$$set=t=>{"show"in t&&n(0,s=t.show),"mouseX"in t&&n(3,c=t.mouseX),"mouseY"in t&&n(4,a=t.mouseY),"$$scope"in t&&n(6,r=t.$$scope)},t.$$.update=()=>{25&t.$$.dirty&&u()},[s,l,o,c,a,u,r,i,()=>{n(0,s=!1),o("close")},()=>{n(0,s=!1),o("close")},function(t){h[t?"unshift":"push"](()=>{l=t,n(1,l)})},()=>{n(0,s=!1),o("close")}]}class So extends t{constructor(t){super(),e(this,t,Do,_o,n,{show:0,mouseX:3,mouseY:4,openmenu:5})}get openmenu(){return this.$$.ctx[5]}}function zo(t){return t&&t.D&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Mo,Eo={exports:{}};var jo=(Mo||(Mo=1,Eo.exports=function(){function t(t,e,n,i,r,o){if(!/^[1-8]$/.test(e))throw new Error("orientation should be [1-8]");null==n&&(n=0),null==i&&(i=0),null==r&&(r=t.width),null==o&&(o=t.height);var l=document.createElement("canvas"),s=l.getContext("2d");switch(l.width=r,l.height=o,s.save(),+e){case 1:break;case 2:s.translate(r,0),s.scale(-1,1);break;case 3:s.translate(r,o),s.rotate(1*Math.PI);break;case 4:s.translate(0,o),s.scale(1,-1);break;case 5:l.width=o,l.height=r,s.rotate(.5*Math.PI),s.scale(1,-1);break;case 6:l.width=o,l.height=r,s.rotate(.5*Math.PI),s.translate(0,-o);break;case 7:l.width=o,l.height=r,s.rotate(1.5*Math.PI),s.translate(-r,o),s.scale(1,-1);break;case 8:l.width=o,l.height=r,s.translate(0,r),s.rotate(1.5*Math.PI)}return s.drawImage(t,n,i,r,o),s.restore(),l}return{drawImage:t}}()),Eo.exports),Ao=zo(jo);function Co(t,e,n,i){return{x:To(t.x,e.width,n.width,i),y:To(t.y,e.height,n.height,i)}}function To(t,e,n,i){const r=e*i/2-n/2;return Math.min(r,Math.max(t,-r))}function No(t,e){return Math.sqrt(Math.pow(t.y-e.y,2)+Math.pow(t.x-e.x,2))}function Oo(t,e){return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}const{window:Fo}=U;function Io(t){let e;return{c(){e=d("div"),c(e,"class","cropper_area"),D(e,"width",t[7].width+"px"),D(e,"height",t[7].height+"px"),c(e,"data-testid","cropper"),y(e,"round","round"===t[4])},m(t,n){u(t,e,n)},p(t,n){128&n[0]&&D(e,"width",t[7].width+"px"),128&n[0]&&D(e,"height",t[7].height+"px"),16&n[0]&&y(e,"round","round"===t[4])},d(t){t&&l(e)}}}function Ro(t){let e,n,i,r,o,a,h,p,b,g,v,x,y=t[7]&&Io(t);return p=new ar({props:{img:"rotate_right",mat:!0,size:8}}),{c(){e=d("div"),n=d("div"),i=d("img"),o=_(),y&&y.c(),a=_(),h=d("button"),F(p.$$.fragment),c(i,"class","cropper_image"),P(i.src,r=t[1])||c(i,"src",r),c(i,"alt",""),D(i,"transform","translate("+t[2].x+"px, "+t[2].y+"px) scale("+t[0]+")"),c(i,"crossorigin",t[5]),c(n,"class","cropper_container"),c(n,"data-testid","container"),c(h,"class","absolute top-0 right-0 p-1 text-black hover:text-white z-10 cursor-pointer"),c(e,"style",b=`position: relative; width: ${t[3]}px; height: ${t[3]}px;`)},m(r,l){u(r,e,l),k(e,n),k(n,i),t[24](i),k(n,o),y&&y.m(n,null),t[25](n),k(e,a),k(e,h),N(p,h,null),g=!0,v||(x=[f(Fo,"resize",t[11]),f(i,"load",t[10]),f(n,"mousedown",R(t[12])),f(n,"touchstart",R(t[13])),f(n,"wheel",R(t[14])),f(n,"gesturestart",R(t[22])),f(n,"gesturechange",R(t[23])),f(h,"click",O(t[9]))],v=!0)},p(t,o){(!g||2&o[0]&&!P(i.src,r=t[1]))&&c(i,"src",r),(!g||5&o[0])&&D(i,"transform","translate("+t[2].x+"px, "+t[2].y+"px) scale("+t[0]+")"),(!g||32&o[0])&&c(i,"crossorigin",t[5]),t[7]?y?y.p(t,o):(y=Io(t),y.c(),y.m(n,null)):y&&(y.d(1),y=null),(!g||8&o[0]&&b!==(b=`position: relative; width: ${t[3]}px; height: ${t[3]}px;`))&&c(e,"style",b)},i(t){g||(w(p.$$.fragment,t),g=!0)},o(t){m(p.$$.fragment,t),g=!1},d(n){n&&l(e),t[24](null),y&&y.d(),t[25](null),T(p),v=!1,s(x)}}}function Lo(t,e,n){let i,r,o,l,s,c,a,{size:u=200}=e,{cropScale:f=1}=e,{image:d}=e,{crop:p={x:0,y:0}}=e,{zoom:m=1}=e,{aspect:w=1}=e,{minZoom:b=1}=e,{maxZoom:g=4}=e,{cropShape:v="round"}=e,{zoomSpeed:x=1}=e,{crossOrigin:y}=e,{restrictPosition:k=!0}=e,$={width:0,height:0,naturalWidth:0,naturalHeight:0},_={x:0,y:0},D={x:0,y:0},S=0;function z(){var t=$.width,e=$.height;return t&&e&&w?(t/e>w?e=t/w:t=e*w,{width:t,height:e}):$}const M=W();G(()=>{s&&s.complete&&j()}),K(()=>{E()});const E=()=>{document.removeEventListener("mousemove",N),document.removeEventListener("mouseup",R),document.removeEventListener("touchmove",O),document.removeEventListener("touchend",R)},j=()=>{A(),P()},A=()=>{s&&($={width:s.width,height:s.height,naturalWidth:s.naturalWidth,naturalHeight:s.naturalHeight},n(7,r=i)),o&&(l=o.getBoundingClientRect())},C=t=>({x:Number(t.clientX),y:Number(t.clientY)}),T=t=>({x:Number(t.clientX),y:Number(t.clientY)}),N=t=>I(C(t)),O=t=>{t.preventDefault(),2===t.touches.length?B(t):1===t.touches.length&&I(T(t.touches[0]))},F=({x:t,y:e})=>{_={x:t,y:e},D={x:p.x,y:p.y}},I=({x:t,y:e})=>{c&&window.cancelAnimationFrame(c),c=window.requestAnimationFrame(()=>{if(void 0===t||void 0===e)return;const i=t-_.x,o=e-_.y,l={x:D.x+i,y:D.y+o};n(2,p=k?Co(l,z(),r,m):l)})},R=()=>{E(),P()},L=t=>{const e=T(t.touches[0]),n=T(t.touches[1]);S=No(e,n),F(Oo(e,n))},B=t=>{const e=T(t.touches[0]),n=T(t.touches[1]),i=Oo(e,n);I(i),a&&window.cancelAnimationFrame(a),a=window.requestAnimationFrame(()=>{const t=No(e,n);H(m*(t/S),i),S=t})},H=(t,e)=>{const i=(({x:t,y:e})=>{if(!l)throw new Error("The Cropper is not mounted");return{x:l.width/2-(t-l.left),y:l.height/2-(e-l.top)}})(e),o=(({x:t,y:e})=>({x:(t+p.x)/m,y:(e+p.y)/m}))(i);n(0,m=Math.min(g,Math.max(t,b)));const s={x:o.x*m-i.x,y:o.y*m-i.y};n(2,p=k?Co(s,z(),r,m):s)},P=()=>{r&&0!==r.width&&M("cropcomplete",{size:u,zoom:m,aspect:w,crop:p,image:d,imageSize:$,cropScale:f})};return t.$$set=t=>{"size"in t&&n(3,u=t.size),"cropScale"in t&&n(15,f=t.cropScale),"image"in t&&n(1,d=t.image),"crop"in t&&n(2,p=t.crop),"zoom"in t&&n(0,m=t.zoom),"aspect"in t&&n(16,w=t.aspect),"minZoom"in t&&n(17,b=t.minZoom),"maxZoom"in t&&n(18,g=t.maxZoom),"cropShape"in t&&n(4,v=t.cropShape),"zoomSpeed"in t&&n(19,x=t.zoomSpeed),"crossOrigin"in t&&n(5,y=t.crossOrigin),"restrictPosition"in t&&n(20,k=t.restrictPosition)},t.$$.update=()=>{98312&t.$$.dirty[0]&&n(21,i={width:u*f,height:u*f/w}),2162752&t.$$.dirty[0]&&s&&n(7,r=i||function(t,e,n){return t>=e*n?{width:e*n,height:e}:{width:t,height:t/n}}(s.width,s.height,w)),1&t.$$.dirty[0]&&m&&P()},[m,d,p,u,v,y,s,r,o,async()=>{if(d){var t=new Image($.naturalWidth,$.naturalHeight);t.src=d;var e=Ao.drawImage(t,6);n(1,d=e.toDataURL()),await X(),A(),P()}},j,A,t=>{document.addEventListener("mousemove",N),document.addEventListener("mouseup",R),F(C(t))},t=>{document.addEventListener("touchmove",O,{passive:!1}),document.addEventListener("touchend",R),2===t.touches.length?L(t):1===t.touches.length&&F(T(t.touches[0]))},t=>{const e=C(t),n=m-t.deltaY*x/200;H(n,e)},f,w,b,g,x,k,i,function(e){V.call(this,t,e)},function(e){V.call(this,t,e)},function(t){h[t?"unshift":"push"](()=>{s=t,n(6,s)})},function(t){h[t?"unshift":"push"](()=>{o=t,n(8,o)})}]}class Bo extends t{constructor(t){super(),e(this,t,Lo,Ro,n,{size:3,cropScale:15,image:1,crop:2,zoom:0,aspect:16,minZoom:17,maxZoom:18,cropShape:4,zoomSpeed:19,crossOrigin:5,restrictPosition:20},null,[-1,-1])}}var Ho,Po={exports:{}};var Uo,Vo=(Ho||(Ho=1,Po.exports=function(){var t={d:function(e,n){for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}},e={};t.d(e,{default:function(){return P}});var n={days:"days",months:"months",years:"years",day:"day",month:"month",year:"year",eventChangeViewDate:"changeViewDate",eventChangeCurrentView:"changeCurrentView",eventChangeFocusDate:"changeFocusDate",eventChangeSelectedDate:"changeSelectedDate",eventChangeTime:"changeTime",eventChangeLastSelectedDate:"changeLastSelectedDate",actionSelectDate:"selectDate",actionUnselectDate:"unselectDate",cssClassWeekend:"-weekend-"},i={classes:"",inline:!1,locale:{days:["ΠΠΎΡΠΊΡΠ΅ΡΠ΅Π½ΡΠ΅","ΠΠΎΠ½Π΅Π΄Π΅Π»ΡΠ½ΠΈΠΊ","ΠΡΠΎΡΠ½ΠΈΠΊ","Π‘ΡΠ΅Π΄Π°","Π§Π΅ΡΠ²Π΅ΡΠ³","ΠΡΡΠ½ΠΈΡΠ°","Π‘ΡΠ±Π±ΠΎΡΠ°"],daysShort:["ΠΠΎΡ","ΠΠΎΠ½","ΠΡΠΎ","Π‘ΡΠ΅","Π§Π΅Ρ","ΠΡΡ","Π‘ΡΠ±"],daysMin:["ΠΡ","ΠΠ½","ΠΡ","Π‘Ρ","Π§Ρ","ΠΡ","Π‘Π±"],months:["Π―Π½Π²Π°ΡΡ","Π€Π΅Π²ΡΠ°Π»Ρ","ΠΠ°ΡΡ","ΠΠΏΡΠ΅Π»Ρ","ΠΠ°ΠΉ","ΠΡΠ½Ρ","ΠΡΠ»Ρ","ΠΠ²Π³ΡΡΡ","Π‘Π΅Π½ΡΡΠ±ΡΡ","ΠΠΊΡΡΠ±ΡΡ","ΠΠΎΡΠ±ΡΡ","ΠΠ΅ΠΊΠ°Π±ΡΡ"],monthsShort:["Π―Π½Π²","Π€Π΅Π²","ΠΠ°Ρ","ΠΠΏΡ","ΠΠ°ΠΉ","ΠΡΠ½","ΠΡΠ»","ΠΠ²Π³","Π‘Π΅Π½","ΠΠΊΡ","ΠΠΎΡ","ΠΠ΅ΠΊ"],today:"Π‘Π΅Π³ΠΎΠ΄Π½Ρ",clear:"ΠΡΠΈΡΡΠΈΡΡ",dateFormat:"dd.MM.yyyy",timeFormat:"HH:mm",firstDay:1},startDate:new Date,firstDay:"",weekends:[6,0],dateFormat:"",altField:"",altFieldDateFormat:"T",toggleSelected:!0,keyboardNav:!0,selectedDates:!1,container:"",isMobile:!1,visible:!1,position:"bottom left",offset:12,view:n.days,minView:n.days,showOtherMonths:!0,selectOtherMonths:!0,moveToOtherMonthsOnSelect:!0,showOtherYears:!0,selectOtherYears:!0,moveToOtherYearsOnSelect:!0,minDate:"",maxDate:"",disableNavWhenOutOfRange:!0,multipleDates:!1,multipleDatesSeparator:", ",range:!1,dynamicRange:!0,buttons:!1,monthsField:"monthsShort",showEvent:"focus",autoClose:!1,fixedHeight:!1,prevHtml:'<svg><path d="M 17,12 l -5,5 l 5,5"></path></svg>',nextHtml:'<svg><path d="M 14,12 l 5,5 l -5,5"></path></svg>',navTitles:{days:"MMMM, <i>yyyy</i>",months:"yyyy",years:"yyyy1 - yyyy2"},timepicker:!1,onlyTimepicker:!1,dateTimeSeparator:" ",timeFormat:"",minHours:0,maxHours:24,minMinutes:0,maxMinutes:59,hoursStep:1,minutesStep:1,onSelect:!1,onChangeViewDate:!1,onChangeView:!1,onRenderCell:!1,onShow:!1,onHide:!1,onClickDayName:!1};function r(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return"string"==typeof t?e.querySelector(t):t}function o(){let{tagName:t="div",className:e="",innerHtml:n="",id:i="",attrs:r={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=document.createElement(t);return e&&o.classList.add(...e.split(" ")),i&&(o.id=i),n&&(o.innerHTML=n),r&&l(o,r),o}function l(t,e){for(let[n,i]of Object.entries(e))void 0!==i&&t.setAttribute(n,i);return t}function s(t){return new Date(t.getFullYear(),t.getMonth()+1,0).getDate()}function c(t){let e=t.getHours(),{hours:n,dayPeriod:i}=a(e);return{year:t.getFullYear(),month:t.getMonth(),fullMonth:t.getMonth()+1<10?"0"+(t.getMonth()+1):t.getMonth()+1,date:t.getDate(),fullDate:t.getDate()<10?"0"+t.getDate():t.getDate(),day:t.getDay(),hours:e,fullHours:u(e),hours12:n,dayPeriod:i,fullHours12:u(n),minutes:t.getMinutes(),fullMinutes:t.getMinutes()<10?"0"+t.getMinutes():t.getMinutes()}}function a(t){return{dayPeriod:t>11?"pm":"am",hours:t%12==0?12:t%12}}function u(t){return t<10?"0"+t:t}function f(t){let e=10*Math.floor(t.getFullYear()/10);return[e,e+9]}function d(){let t=[];for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return n.forEach(e=>{if("object"==typeof e)for(let n in e)e[n]&&t.push(n);else e&&t.push(e)}),t.join(" ")}function h(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.days;if(!t||!e)return!1;let r=c(t),o=c(e);return{[n.days]:r.date===o.date&&r.month===o.month&&r.year===o.year,[n.months]:r.month===o.month&&r.year===o.year,[n.years]:r.year===o.year}[i]}function p(t,e,n){let i=w(t,!1).getTime(),r=w(e,!1).getTime();return n?i>=r:i>r}function m(t,e){return!p(t,e,!0)}function w(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=new Date(t.getTime());return"boolean"!=typeof e||e||function(t){t.setHours(0,0,0,0)}(n),n}function b(t,e,n){t.length?t.forEach(t=>{t.addEventListener(e,n)}):t.addEventListener(e,n)}function g(t,e){return!(!t||t===document||t instanceof DocumentFragment)&&(t.matches(e)?t:g(t.parentNode,e))}function v(t,e,n){return t>n?n:t<e?e:t}function x(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return n.filter(t=>t).forEach(e=>{for(let[n,i]of Object.entries(e))if(void 0!==i&&"[object Object]"===i.toString()){let e=void 0!==t[n]?t[n].toString():void 0,r=i.toString(),o=Array.isArray(i)?[]:{};t[n]=t[n]?e!==r?o:t[n]:o,x(t[n],i)}else t[n]=i}),t}function y(t){let e=t;return t instanceof Date||("string"==typeof t&&/^\d{4}-\d{2}-\d{2}$/.test(t)&&(t+="T00:00:00"),e=new Date(t)),isNaN(e.getTime())&&(e=!1),e}function k(t){let e="\\s|\\.|-|/|\\\\|,|\\$|\\!|\\?|:|;";return new RegExp("(^|>|"+e+")("+t+")($|<|"+e+")","g")}function $(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class _{constructor(){let{type:t,date:e,dp:n,opts:i,body:r}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};$(this,"focus",()=>{this.$cell.classList.add("-focus-"),this.focused=!0}),$(this,"removeFocus",()=>{this.$cell.classList.remove("-focus-"),this.focused=!1}),$(this,"select",()=>{this.$cell.classList.add("-selected-"),this.selected=!0}),$(this,"removeSelect",()=>{this.$cell.classList.remove("-selected-","-range-from-","-range-to-"),this.selected=!1}),$(this,"onChangeSelectedDate",()=>{this.isDisabled||(this._handleSelectedStatus(),this.opts.range&&this._handleRangeStatus())}),$(this,"onChangeFocusDate",t=>{if(!t)return void(this.focused&&this.removeFocus());let e=h(t,this.date,this.type);e?this.focus():!e&&this.focused&&this.removeFocus(),this.opts.range&&this._handleRangeStatus()}),$(this,"render",()=>(this.$cell.innerHTML=this._getHtml(),this._handleClasses(),this.$cell)),this.type=t,this.singleType=this.type.slice(0,-1),this.date=e,this.dp=n,this.opts=i,this.body=r,this.customData=!1,this.init()}init(){var t,e;let{onRenderCell:n}=this.opts;n&&(this.customData=n({date:this.date,cellType:this.singleType,datepicker:this.dp})),this._createElement(),this._bindDatepickerEvents(),null!==(t=this.customData)&&void 0!==t&&t.disabled?this.dp.disableDate(this.date):!1===(null===(e=this.customData)||void 0===e?void 0:e.disabled)&&this.dp.enableDate(this.date)}_bindDatepickerEvents(){this.dp.on(n.eventChangeSelectedDate,this.onChangeSelectedDate),this.dp.on(n.eventChangeFocusDate,this.onChangeFocusDate)}unbindDatepickerEvents(){this.dp.off(n.eventChangeSelectedDate,this.onChangeSelectedDate),this.dp.off(n.eventChangeFocusDate,this.onChangeFocusDate)}_createElement(){var t;let{year:e,month:n,fullMonth:i,date:r,fullDate:l}=c(this.date),s=(null===(t=this.customData)||void 0===t?void 0:t.attrs)||{};this.$cell=o({attrs:{"data-year":e,"data-month":n,"data-date":r,"data-iso-date":`${e}-${i}-${l}`,...s}}),this.$cell.adpCell=this}_getClassName(){var t;let e=new Date,{selectOtherMonths:i,selectOtherYears:r}=this.opts,{minDate:o,maxDate:l,isDateDisabled:s}=this.dp,{day:a}=c(this.date),u=this._isOutOfMinMaxRange(),f=s(this.date),p=d("air-datepicker-cell",`-${this.singleType}-`,{"-current-":h(e,this.date,this.type),"-min-date-":o&&h(o,this.date,this.type),"-max-date-":l&&h(l,this.date,this.type)}),m="";switch(this.type){case n.days:m=d({"-weekend-":this.dp.isWeekend(a),"-other-month-":this.isOtherMonth,"-disabled-":this.isOtherMonth&&!i||u||f});break;case n.months:m=d({"-disabled-":u});break;case n.years:m=d({"-other-decade-":this.isOtherDecade,"-disabled-":u||this.isOtherDecade&&!r})}return d(p,m,null===(t=this.customData)||void 0===t?void 0:t.classes).split(" ")}_getHtml(){var t;let{year:e,month:i,date:r}=c(this.date),{showOtherMonths:o,showOtherYears:l}=this.opts;if(null!==(t=this.customData)&&void 0!==t&&t.html)return this.customData.html;switch(this.type){case n.days:return!o&&this.isOtherMonth?"":r;case n.months:return this.dp.locale[this.opts.monthsField][i];case n.years:return!l&&this.isOtherDecade?"":e}}_isOutOfMinMaxRange(){let{minDate:t,maxDate:e}=this.dp,{type:i,date:r}=this,{month:o,year:l,date:s}=c(r),a=i===n.days,u=i===n.years,f=!!t&&new Date(l,u?t.getMonth():o,a?s:t.getDate()),d=!!e&&new Date(l,u?e.getMonth():o,a?s:e.getDate());return t&&e?m(f,t)||p(d,e):t?m(f,t):e?p(d,e):void 0}destroy(){this.unbindDatepickerEvents()}_handleRangeStatus(){const{selectedDates:t,focusDate:e,rangeDateTo:n,rangeDateFrom:i}=this.dp,r=t.length;if(this.$cell.classList.remove("-range-from-","-range-to-","-in-range-"),!r)return;let o=i,l=n;if(1===r&&e){const n=p(e,t[0]);o=n?t[0]:e,l=n?e:t[0]}let s=d({"-in-range-":o&&l&&(c=this.date,a=o,u=l,p(c,a)&&m(c,u)),"-range-from-":o&&h(this.date,o,this.type),"-range-to-":l&&h(this.date,l,this.type)});var c,a,u;s&&this.$cell.classList.add(...s.split(" "))}_handleSelectedStatus(){let t=this.dp._checkIfDateIsSelected(this.date,this.type);t?this.select():!t&&this.selected&&this.removeSelect()}_handleInitialFocusStatus(){h(this.dp.focusDate,this.date,this.type)&&this.focus()}_handleClasses(){this.$cell.setAttribute("class",""),this._handleInitialFocusStatus(),this.dp.hasSelectedDates&&(this._handleSelectedStatus(),this.dp.opts.range&&this._handleRangeStatus()),this.$cell.classList.add(...this._getClassName())}get isDisabled(){return this.$cell.matches(".-disabled-")}get isOtherMonth(){return this.dp.isOtherMonth(this.date)}get isOtherDecade(){return this.dp.isOtherDecade(this.date)}}function D(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}let S={[n.days]:`<div class="air-datepicker-body--day-names"></div><div class="air-datepicker-body--cells -${n.days}-"></div>`,[n.months]:`<div class="air-datepicker-body--cells -${n.months}-"></div>`,[n.years]:`<div class="air-datepicker-body--cells -${n.years}-"></div>`};const z=".air-datepicker-cell";class M{constructor(t){let{dp:e,type:i,opts:r}=t;D(this,"handleClick",t=>{let e=t.target.closest(z).adpCell;if(e.isDisabled)return;if(!this.dp.isMinViewReached)return void this.dp.down();let n=this.dp._checkIfDateIsSelected(e.date,e.type);n?this.dp._handleAlreadySelectedDates(n,e.date):this.dp.selectDate(e.date)}),D(this,"handleDayNameClick",t=>{let e=t.target.getAttribute("data-day-index");this.opts.onClickDayName({dayIndex:Number(e),datepicker:this.dp})}),D(this,"onChangeCurrentView",t=>{t!==this.type?this.hide():(this.show(),this.render())}),D(this,"onMouseOverCell",t=>{let e=g(t.target,z);this.dp.setFocusDate(!!e&&e.adpCell.date)}),D(this,"onMouseOutCell",()=>{this.dp.setFocusDate(!1)}),D(this,"onClickBody",t=>{let{onClickDayName:e}=this.opts,n=t.target;n.closest(z)&&this.handleClick(t),e&&n.closest(".air-datepicker-body--day-name")&&this.handleDayNameClick(t)}),D(this,"onMouseDown",t=>{this.pressed=!0;let e=g(t.target,z),n=e&&e.adpCell;h(n.date,this.dp.rangeDateFrom)&&(this.rangeFromFocused=!0),h(n.date,this.dp.rangeDateTo)&&(this.rangeToFocused=!0)}),D(this,"onMouseMove",t=>{if(!this.pressed||!this.dp.isMinViewReached)return;t.preventDefault();let e=g(t.target,z),n=e&&e.adpCell,{selectedDates:i,rangeDateTo:r,rangeDateFrom:o}=this.dp;if(!n||n.isDisabled)return;let{date:l}=n;if(2===i.length){if(this.rangeFromFocused&&!p(l,r)){let{hours:t,minutes:e}=c(o);l.setHours(t),l.setMinutes(e),this.dp.rangeDateFrom=l,this.dp.replaceDate(o,l)}if(this.rangeToFocused&&!m(l,o)){let{hours:t,minutes:e}=c(r);l.setHours(t),l.setMinutes(e),this.dp.rangeDateTo=l,this.dp.replaceDate(r,l)}}}),D(this,"onMouseUp",()=>{this.pressed=!1,this.rangeFromFocused=!1,this.rangeToFocused=!1}),D(this,"onChangeViewDate",(t,e)=>{if(!this.isVisible)return;let i=f(t),r=f(e);switch(this.dp.currentView){case n.days:if(h(t,e,n.months))return;break;case n.months:if(h(t,e,n.years))return;break;case n.years:if(i[0]===r[0]&&i[1]===r[1])return}this.render()}),D(this,"render",()=>{this.destroyCells(),this._generateCells(),this.cells.forEach(t=>{this.$cells.appendChild(t.render())})}),this.dp=e,this.type=i,this.opts=r,this.cells=[],this.$el="",this.pressed=!1,this.isVisible=!0,this.init()}init(){this._buildBaseHtml(),this.type===n.days&&this.renderDayNames(),this.render(),this._bindEvents(),this._bindDatepickerEvents()}_bindEvents(){let{range:t,dynamicRange:e}=this.opts;b(this.$el,"mouseover",this.onMouseOverCell),b(this.$el,"mouseout",this.onMouseOutCell),b(this.$el,"click",this.onClickBody),t&&e&&(b(this.$el,"mousedown",this.onMouseDown),b(this.$el,"mousemove",this.onMouseMove),b(window.document,"mouseup",this.onMouseUp))}_bindDatepickerEvents(){this.dp.on(n.eventChangeViewDate,this.onChangeViewDate),this.dp.on(n.eventChangeCurrentView,this.onChangeCurrentView)}_buildBaseHtml(){this.$el=o({className:`air-datepicker-body -${this.type}-`,innerHtml:S[this.type]}),this.$names=r(".air-datepicker-body--day-names",this.$el),this.$cells=r(".air-datepicker-body--cells",this.$el)}_getDayNamesHtml(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.dp.locale.firstDay,e="",i=this.dp.isWeekend,{onClickDayName:r}=this.opts,o=t,l=0;for(;l<7;){let t=o%7;e+=`<div class="${d("air-datepicker-body--day-name",{[n.cssClassWeekend]:i(t),"-clickable-":!!r})}" data-day-index='${t}'>${this.dp.locale.daysMin[t]}</div>`,l++,o++}return e}renderDayNames(){this.$names.innerHTML=this._getDayNamesHtml()}_generateCell(t){let{type:e,dp:n,opts:i}=this;return new _({type:e,dp:n,opts:i,date:t,body:this})}_generateCells(){M.getDatesFunction(this.type)(this.dp,t=>{this.cells.push(this._generateCell(t))})}show(){this.isVisible=!0,this.$el.classList.remove("-hidden-")}hide(){this.isVisible=!1,this.$el.classList.add("-hidden-")}destroyCells(){this.cells.forEach(t=>t.destroy()),this.cells=[],this.$cells.innerHTML=""}destroy(){this.destroyCells(),this.dp.off(n.eventChangeViewDate,this.onChangeViewDate),this.dp.off(n.eventChangeCurrentView,this.onChangeCurrentView)}static getDaysDates(t,e){let{viewDate:n,opts:{fixedHeight:i},locale:{firstDay:r}}=t,o=s(n),{year:l,month:a}=c(n),u=new Date(l,a,1),f=new Date(l,a,o),d=u.getDay()-r,h=6-f.getDay()+r;d=d<0?d+7:d,h=h>6?h-7:h;let p=function(t,e){let{year:n,month:i,date:r}=c(t);return new Date(n,i,r-e)}(u,d),m=o+d+h,w=p.getDate(),{year:b,month:g}=c(p),v=0;i&&(m=42);const x=[];for(;v<m;){let t=new Date(b,g,w+v);e&&e(t),x.push(t),v++}return x}static getMonthsDates(t,e){let{year:n}=t.parsedViewDate,i=0,r=[];for(;i<12;){const t=new Date(n,i);r.push(t),e&&e(t),i++}return r}static getYearsDates(t,e){let n=f(t.viewDate),i=n[0]-1,r=n[1]+1,o=i,l=[];for(;o<=r;){const t=new Date(o,0);l.push(t),e&&e(t),o++}return l}static getDatesFunction(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n.days;return{[n.days]:M.getDaysDates,[n.months]:M.getMonthsDates,[n.years]:M.getYearsDates}[t]}}function E(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class j{constructor(t){let{dp:e,opts:n}=t;E(this,"onClickNav",t=>{let e=g(t.target,".air-datepicker-nav--action");if(!e)return;let n=e.dataset.action;this.dp[n]()}),E(this,"onChangeViewDate",()=>{this.render(),this._resetNavStatus(),this.handleNavStatus()}),E(this,"onChangeCurrentView",()=>{this.render(),this._resetNavStatus(),this.handleNavStatus()}),E(this,"onClickNavTitle",()=>{this.dp.isFinalView||this.dp.up()}),E(this,"update",()=>{let{prevHtml:t,nextHtml:e}=this.opts;this.$prev.innerHTML=t,this.$next.innerHTML=e,this._resetNavStatus(),this.render(),this.handleNavStatus()}),E(this,"renderDelay",()=>{setTimeout(this.render)}),E(this,"render",()=>{this.$title.innerHTML=this._getTitle(),function(t,e){for(let n in e)e[n]?t.classList.add(n):t.classList.remove(n)}(this.$title,{"-disabled-":this.dp.isFinalView})}),this.dp=e,this.opts=n,this.init()}init(){this._createElement(),this._buildBaseHtml(),this._defineDOM(),this.render(),this.handleNavStatus(),this._bindEvents(),this._bindDatepickerEvents()}_defineDOM(){this.$title=r(".air-datepicker-nav--title",this.$el),this.$prev=r('[data-action="prev"]',this.$el),this.$next=r('[data-action="next"]',this.$el)}_bindEvents(){this.$el.addEventListener("click",this.onClickNav),this.$title.addEventListener("click",this.onClickNavTitle)}_bindDatepickerEvents(){this.dp.on(n.eventChangeViewDate,this.onChangeViewDate),this.dp.on(n.eventChangeCurrentView,this.onChangeCurrentView),this.isNavIsFunction&&(this.dp.on(n.eventChangeSelectedDate,this.renderDelay),this.dp.opts.timepicker&&this.dp.on(n.eventChangeTime,this.render))}destroy(){this.dp.off(n.eventChangeViewDate,this.onChangeViewDate),this.dp.off(n.eventChangeCurrentView,this.onChangeCurrentView),this.isNavIsFunction&&(this.dp.off(n.eventChangeSelectedDate,this.renderDelay),this.dp.opts.timepicker&&this.dp.off(n.eventChangeTime,this.render))}_createElement(){this.$el=o({tagName:"nav",className:"air-datepicker-nav"})}_getTitle(){let{dp:t,opts:e}=this,n=e.navTitles[t.currentView];return"function"==typeof n?n(t):t.formatDate(t.viewDate,n)}handleNavStatus(){let{disableNavWhenOutOfRange:t}=this.opts,{minDate:e,maxDate:i}=this.dp;if(!e&&!i||!t)return;let{year:r,month:o}=this.dp.parsedViewDate,l=!!e&&c(e),s=!!i&&c(i);switch(this.dp.currentView){case n.days:e&&l.month>=o&&l.year>=r&&this._disableNav("prev"),i&&s.month<=o&&s.year<=r&&this._disableNav("next");break;case n.months:e&&l.year>=r&&this._disableNav("prev"),i&&s.year<=r&&this._disableNav("next");break;case n.years:{let t=f(this.dp.viewDate);e&&l.year>=t[0]&&this._disableNav("prev"),i&&s.year<=t[1]&&this._disableNav("next");break}}}_disableNav(t){r('[data-action="'+t+'"]',this.$el).classList.add("-disabled-")}_resetNavStatus(){!function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];t.length?t.forEach(t=>{t.classList.remove(...n)}):t.classList.remove(...n)}(this.$el.querySelectorAll(".air-datepicker-nav--action"),"-disabled-")}_buildBaseHtml(){let{prevHtml:t,nextHtml:e}=this.opts;this.$el.innerHTML=`<div class="air-datepicker-nav--action" data-action="prev">${t}</div><div class="air-datepicker-nav--title"></div><div class="air-datepicker-nav--action" data-action="next">${e}</div>`}get isNavIsFunction(){let{navTitles:t}=this.opts;return Object.keys(t).find(e=>"function"==typeof t[e])}}var A={today:{content:t=>t.locale.today,onClick:t=>t.setViewDate(new Date)},clear:{content:t=>t.locale.clear,onClick:t=>t.clear()}};class C{constructor(t){let{dp:e,opts:n}=t;this.dp=e,this.opts=n,this.init()}init(){this.createElement(),this.render()}createElement(){this.$el=o({className:"air-datepicker-buttons"})}destroy(){this.$el.parentNode.removeChild(this.$el)}clearHtml(){return this.$el.innerHTML="",this}generateButtons(){let{buttons:t}=this.opts;Array.isArray(t)||(t=[t]),t.forEach(t=>{let e=t;"string"==typeof t&&A[t]&&(e=A[t]);let n=this.createButton(e);e.onClick&&this.attachEventToButton(n,e.onClick),this.$el.appendChild(n)})}attachEventToButton(t,e){t.addEventListener("click",()=>{e(this.dp)})}createButton(t){let{content:e,className:n,tagName:i="button",attrs:r={}}=t;return o({tagName:i,innerHtml:`<span tabindex='-1'>${"function"==typeof e?e(this.dp):e}</span>`,className:d("air-datepicker-button",n),attrs:r})}render(){this.generateButtons()}}function T(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class N{constructor(){let{opts:t,dp:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};T(this,"toggleTimepickerIsActive",t=>{this.dp.timepickerIsActive=t}),T(this,"onChangeSelectedDate",t=>{let{date:e,updateTime:n=!1}=t;e&&(this.setMinMaxTime(e),this.setCurrentTime(!!n&&e),this.addTimeToDate(e))}),T(this,"onChangeLastSelectedDate",t=>{t&&(this.setTime(t),this.render())}),T(this,"onChangeInputRange",t=>{let e=t.target;this[e.getAttribute("name")]=e.value,this.updateText(),this.dp.trigger(n.eventChangeTime,{hours:this.hours,minutes:this.minutes})}),T(this,"onMouseEnterLeave",t=>{let e=t.target.getAttribute("name"),n=this.$minutesText;"hours"===e&&(n=this.$hoursText),n.classList.toggle("-focus-")}),T(this,"onFocus",()=>{this.toggleTimepickerIsActive(!0)}),T(this,"onBlur",()=>{this.toggleTimepickerIsActive(!1)}),this.opts=t,this.dp=e;let{timeFormat:i}=this.dp.locale;i&&(i.match(k("h"))||i.match(k("hh")))&&(this.ampm=!0),this.init()}init(){this.setTime(this.dp.lastSelectedDate||this.dp.viewDate),this.createElement(),this.buildHtml(),this.defineDOM(),this.render(),this.bindDatepickerEvents(),this.bindDOMEvents()}bindDatepickerEvents(){this.dp.on(n.eventChangeSelectedDate,this.onChangeSelectedDate),this.dp.on(n.eventChangeLastSelectedDate,this.onChangeLastSelectedDate)}bindDOMEvents(){let t="input";navigator.userAgent.match(/trident/gi)&&(t="change"),b(this.$ranges,t,this.onChangeInputRange),b(this.$ranges,"mouseenter",this.onMouseEnterLeave),b(this.$ranges,"mouseleave",this.onMouseEnterLeave),b(this.$ranges,"focus",this.onFocus),b(this.$ranges,"mousedown",this.onFocus),b(this.$ranges,"blur",this.onBlur)}createElement(){this.$el=o({className:d("air-datepicker-time",{"-am-pm-":this.dp.ampm})})}destroy(){this.dp.off(n.eventChangeSelectedDate,this.onChangeSelectedDate),this.dp.off(n.eventChangeLastSelectedDate,this.onChangeLastSelectedDate),this.$el.parentNode.removeChild(this.$el)}buildHtml(){let{ampm:t,hours:e,displayHours:n,minutes:i,minHours:r,minMinutes:o,maxHours:l,maxMinutes:s,dayPeriod:c,opts:{hoursStep:a,minutesStep:f}}=this;this.$el.innerHTML=`<div class="air-datepicker-time--current"> <span class="air-datepicker-time--current-hours">${u(n)}</span> <span class="air-datepicker-time--current-colon">:</span> <span class="air-datepicker-time--current-minutes">${u(i)}</span> `+(t?`<span class='air-datepicker-time--current-ampm'>${c}</span>`:"")+'</div><div class="air-datepicker-time--sliders"> <div class="air-datepicker-time--row">'+` <input type="range" name="hours" value="${e}" min="${r}" max="${l}" step="${a}"/> </div> <div class="air-datepicker-time--row">`+` <input type="range" name="minutes" value="${i}" min="${o}" max="${s}" step="${f}"/> </div></div>`}defineDOM(){let t=t=>r(t,this.$el);this.$ranges=this.$el.querySelectorAll('[type="range"]'),this.$hours=t('[name="hours"]'),this.$minutes=t('[name="minutes"]'),this.$hoursText=t(".air-datepicker-time--current-hours"),this.$minutesText=t(".air-datepicker-time--current-minutes"),this.$ampm=t(".air-datepicker-time--current-ampm")}setTime(t){this.setMinMaxTime(t),this.setCurrentTime(t)}addTimeToDate(t){t&&(t.setHours(this.hours),t.setMinutes(this.minutes))}setMinMaxTime(t){if(this.setMinMaxTimeFromOptions(),t){let{minDate:e,maxDate:n}=this.dp;e&&h(t,e)&&this.setMinTimeFromMinDate(e),n&&h(t,n)&&this.setMaxTimeFromMaxDate(n)}}setCurrentTime(t){let{hours:e,minutes:n}=t?c(t):this;this.hours=v(e,this.minHours,this.maxHours),this.minutes=v(n,this.minMinutes,this.maxMinutes)}setMinMaxTimeFromOptions(){let{minHours:t,minMinutes:e,maxHours:n,maxMinutes:i}=this.opts;this.minHours=v(t,0,23),this.minMinutes=v(e,0,59),this.maxHours=v(n,0,23),this.maxMinutes=v(i,0,59)}setMinTimeFromMinDate(t){let{lastSelectedDate:e}=this.dp;this.minHours=t.getHours(),e&&e.getHours()>t.getHours()?this.minMinutes=this.opts.minMinutes:this.minMinutes=t.getMinutes()}setMaxTimeFromMaxDate(t){let{lastSelectedDate:e}=this.dp;this.maxHours=t.getHours(),e&&e.getHours()<t.getHours()?this.maxMinutes=this.opts.maxMinutes:this.maxMinutes=t.getMinutes()}updateSliders(){l(this.$hours,{min:this.minHours,max:this.maxHours}).value=this.hours,l(this.$minutes,{min:this.minMinutes,max:this.maxMinutes}).value=this.minutes}updateText(){this.$hoursText.innerHTML=u(this.displayHours),this.$minutesText.innerHTML=u(this.minutes),this.ampm&&(this.$ampm.innerHTML=this.dayPeriod)}set hours(t){this._hours=t;let{hours:e,dayPeriod:n}=a(t);this.displayHours=this.ampm?e:t,this.dayPeriod=n}get hours(){return this._hours}render(){this.updateSliders(),this.updateText()}}function O(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class F{constructor(t){let{dp:e,opts:n}=t;O(this,"pressedKeys",new Set),O(this,"hotKeys",new Map([[[["Control","ArrowRight"],["Control","ArrowUp"]],t=>t.month++],[[["Control","ArrowLeft"],["Control","ArrowDown"]],t=>t.month--],[[["Shift","ArrowRight"],["Shift","ArrowUp"]],t=>t.year++],[[["Shift","ArrowLeft"],["Shift","ArrowDown"]],t=>t.year--],[[["Alt","ArrowRight"],["Alt","ArrowUp"]],t=>t.year+=10],[[["Alt","ArrowLeft"],["Alt","ArrowDown"]],t=>t.year-=10],[["Control","Shift","ArrowUp"],(t,e)=>e.up()]])),O(this,"handleHotKey",t=>{let e=this.hotKeys.get(t),n=c(this.getInitialFocusDate());e(n,this.dp);let{year:i,month:r,date:o}=n,l=s(new Date(i,r));l<o&&(o=l);let a=this.dp.getClampedDate(new Date(i,r,o));this.dp.setFocusDate(a,{viewDateTransition:!0})}),O(this,"isHotKeyPressed",()=>{let t=!1,e=this.pressedKeys.size,n=t=>this.pressedKeys.has(t);for(let[i]of this.hotKeys){if(t)break;if(Array.isArray(i[0]))i.forEach(r=>{t||e!==r.length||(t=r.every(n)&&i)});else{if(e!==i.length)continue;t=i.every(n)&&i}}return t}),O(this,"isArrow",t=>t>=37&&t<=40),O(this,"onKeyDown",t=>{if(!this.dp.visible&&!this.dp.treatAsInline)return;let{key:e,which:n}=t,{dp:i,dp:{focusDate:r},opts:o}=this;this.registerKey(e);let l=this.isHotKeyPressed();if(l)return t.preventDefault(),void this.handleHotKey(l);if(this.isArrow(n))return t.preventDefault(),void this.focusNextCell(e);if("Enter"===e){if(i.currentView!==o.minView)return void i.down();if(r){let t=i._checkIfDateIsSelected(r);return void(t?i._handleAlreadySelectedDates(t,r):i.selectDate(r))}}"Escape"===e&&this.dp.hide()}),O(this,"onKeyUp",t=>{this.removeKey(t.key)}),this.dp=e,this.opts=n,this.init()}init(){this.bindKeyboardEvents()}bindKeyboardEvents(){let{$el:t}=this.dp;t.addEventListener("keydown",this.onKeyDown),t.addEventListener("keyup",this.onKeyUp)}destroy(){let{$el:t}=this.dp;t.removeEventListener("keydown",this.onKeyDown),t.removeEventListener("keyup",this.onKeyUp),this.hotKeys=null,this.pressedKeys=null}getInitialFocusDate(){let{focusDate:t,currentView:e,selectedDates:i,parsedViewDate:{year:r,month:o}}=this.dp,l=t||i[i.length-1];if(!l)switch(e){case n.days:l=new Date(r,o,(new Date).getDate());break;case n.months:l=new Date(r,o,1);break;case n.years:l=new Date(r,0,1)}return l}focusNextCell(t){let e=this.getInitialFocusDate(),{currentView:i}=this.dp,{days:r,months:o,years:l}=n,s=c(e),a=s.year,u=s.month,f=s.date;switch(t){case"ArrowLeft":i===r&&(f-=1),i===o&&(u-=1),i===l&&(a-=1);break;case"ArrowUp":i===r&&(f-=7),i===o&&(u-=3),i===l&&(a-=4);break;case"ArrowRight":i===r&&(f+=1),i===o&&(u+=1),i===l&&(a+=1);break;case"ArrowDown":i===r&&(f+=7),i===o&&(u+=3),i===l&&(a+=4)}let d=this.dp.getClampedDate(new Date(a,u,f));this.dp.setFocusDate(d,{viewDateTransition:!0})}registerKey(t){this.pressedKeys.add(t)}removeKey(t){this.pressedKeys.delete(t)}}let I={on(t,e){this.S||(this.S={}),this.S[t]?this.S[t].push(e):this.S[t]=[e]},off(t,e){this.S&&this.S[t]&&(this.S[t]=this.S[t].filter(t=>t!==e))},removeAllEvents(){this.S={}},trigger(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];this.S&&this.S[t]&&this.S[t].forEach(t=>{t(...n)})}};function R(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}let L="",B="",H=!1;class P{static buildGlobalContainer(t){H=!0,L=o({className:t,id:t}),r("body").appendChild(L)}constructor(t,e){var l=this;if(R(this,"viewIndexes",[n.days,n.months,n.years]),R(this,"next",()=>{let{year:t,month:e}=this.parsedViewDate;switch(this.currentView){case n.days:this.setViewDate(new Date(t,e+1,1));break;case n.months:this.setViewDate(new Date(t+1,e,1));break;case n.years:this.setViewDate(new Date(t+10,0,1))}}),R(this,"prev",()=>{let{year:t,month:e}=this.parsedViewDate;switch(this.currentView){case n.days:this.setViewDate(new Date(t,e-1,1));break;case n.months:this.setViewDate(new Date(t-1,e,1));break;case n.years:this.setViewDate(new Date(t-10,0,1))}}),R(this,"_finishHide",()=>{this.hideAnimation=!1,this._destroyComponents(),this.$container.removeChild(this.$datepicker)}),R(this,"setPosition",function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("function"==typeof(t=t||l.opts.position))return void(l.customHide=t({$datepicker:l.$datepicker,$target:l.$el,$pointer:l.$pointer,isViewChange:e,done:l._finishHide}));let n,i,{isMobile:r}=l.opts,o=l.$el.getBoundingClientRect(),s=l.$el.getBoundingClientRect(),c=l.$datepicker.offsetParent,a=l.$el.offsetParent,u=l.$datepicker.getBoundingClientRect(),f=t.split(" "),d=window.scrollY,h=window.scrollX,p=l.opts.offset,m=f[0],w=f[1];if(r)l.$datepicker.style.cssText="left: 50%; top: 50%";else{if(c===a&&c!==document.body&&(s={top:l.$el.offsetTop,left:l.$el.offsetLeft,width:o.width,height:l.$el.offsetHeight},d=0,h=0),c!==a&&c!==document.body){let t=c.getBoundingClientRect();s={top:o.top-t.top,left:o.left-t.left,width:o.width,height:o.height},d=0,h=0}switch(m){case"top":n=s.top-u.height-p;break;case"right":i=s.left+s.width+p;break;case"bottom":n=s.top+s.height+p;break;case"left":i=s.left-u.width-p}switch(w){case"top":n=s.top;break;case"right":i=s.left+s.width-u.width;break;case"bottom":n=s.top+s.height-u.height;break;case"left":i=s.left;break;case"center":/left|right/.test(m)?n=s.top+s.height/2-u.height/2:i=s.left+s.width/2-u.width/2}l.$datepicker.style.cssText=`left: ${i+h}px; top: ${n+d}px`}}),R(this,"_setInputValue",()=>{let{opts:t,$altField:e,locale:{dateFormat:n}}=this,{altFieldDateFormat:i,altField:r}=t;r&&e&&(e.value=this._getInputValue(i)),this.$el.value=this._getInputValue(n),this.$el.dispatchEvent(new Event("change"))}),R(this,"_getInputValue",t=>{let{selectedDates:e,opts:n}=this,{multipleDates:i,multipleDatesSeparator:r}=n;if(!e.length)return"";let o="function"==typeof t,l=o?t(i?e:e[0]):e.map(e=>this.formatDate(e,t));return l=o?l:l.join(r),l}),R(this,"_checkIfDateIsSelected",function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.days,i=!1;return l.selectedDates.some(n=>{let r=h(t,n,e);return i=r&&n,r}),i}),R(this,"_scheduleCallAfterTransition",t=>{this._cancelScheduledCall(),t&&t(!1),this._onTransitionEnd=()=>{t&&t(!0)},this.$datepicker.addEventListener("transitionend",this._onTransitionEnd,{once:!0})}),R(this,"_cancelScheduledCall",()=>{this.$datepicker.removeEventListener("transitionend",this._onTransitionEnd)}),R(this,"setViewDate",t=>{if(!((t=y(t))instanceof Date))return;if(h(t,this.viewDate))return;let e=this.viewDate;this.viewDate=t;let{onChangeViewDate:i}=this.opts;if(i){let{month:t,year:e}=this.parsedViewDate;i({month:t,year:e,decade:this.curDecade})}this.trigger(n.eventChangeViewDate,t,e)}),R(this,"setFocusDate",function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(!t||(t=y(t))instanceof Date)&&(l.focusDate=t,l.trigger(n.eventChangeFocusDate,t,e))}),R(this,"setCurrentView",function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(l.viewIndexes.includes(t)){if(l.currentView=t,l.elIsInput&&l.visible&&l.setPosition(void 0,!0),l.trigger(n.eventChangeCurrentView,t),!l.views[t]){let e=l.views[t]=new M({dp:l,opts:l.opts,type:t});l.shouldUpdateDOM&&l.$content.appendChild(e.$el)}l.opts.onChangeView&&!e.silent&&l.opts.onChangeView(t)}}),R(this,"_updateLastSelectedDate",t=>{this.lastSelectedDate=t,this.trigger(n.eventChangeLastSelectedDate,t)}),R(this,"destroy",()=>{if(this.isDestroyed)return;let{showEvent:t,isMobile:e}=this.opts,n=this.$datepicker.parentNode;n&&n.removeChild(this.$datepicker),this.$el.removeEventListener(t,this._onFocus),this.$el.removeEventListener("blur",this._onBlur),window.removeEventListener("resize",this._onResize),e&&this._removeMobileAttributes(),this.keyboardNav&&this.keyboardNav.destroy(),this.views=null,this.nav=null,this.$datepicker=null,this.opts={},this.$customContainer=null,this.viewDate=null,this.focusDate=null,this.selectedDates=[],this.rangeDateFrom=null,this.rangeDateTo=null,this.isDestroyed=!0}),R(this,"update",function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=x({},l.opts),{silent:r}=e;x(l.opts,t);let{timepicker:o,buttons:s,range:c,selectedDates:a,isMobile:u}=l.opts,f=l.visible||l.treatAsInline;l._createMinMaxDates(),l._limitViewDateByMaxMinDates(),l._handleLocale(),a&&(l.selectedDates=[],l.selectDate(a,{silent:r})),t.view&&l.setCurrentView(t.view,{silent:r}),l._setInputValue(),i.range&&!c?(l.rangeDateTo=!1,l.rangeDateFrom=!1):!i.range&&c&&l.selectedDates.length&&(l.rangeDateFrom=l.selectedDates[0],l.rangeDateTo=l.selectedDates[1]),i.timepicker&&!o?(f&&l.timepicker.destroy(),l.timepicker=!1,l.$timepicker.parentNode.removeChild(l.$timepicker)):!i.timepicker&&o&&l._addTimepicker(),!i.buttons&&s?l._addButtons():i.buttons&&!s?(l.buttons.destroy(),l.$buttons.parentNode.removeChild(l.$buttons)):f&&i.buttons&&s&&l.buttons.clearHtml().render(),!i.isMobile&&u?(l.treatAsInline||B||l._createMobileOverlay(),l._addMobileAttributes(),l.visible&&l._showMobileOverlay()):i.isMobile&&!u&&(l._removeMobileAttributes(),l.visible&&(B.classList.remove("-active-"),"function"!=typeof l.opts.position&&l.setPosition())),f&&(l.nav.update(),l.views[l.currentView].render(),l.currentView===n.days&&l.views[l.currentView].renderDayNames())}),R(this,"disableDate",(t,e)=>{(Array.isArray(t)?t:[t]).forEach(t=>{let n=y(t);if(!n)return;let i=e?"delete":"add";this.disabledDates[i](this.formatDate(n,"yyyy-MM-dd"));let r=this.getCell(n,this.currentViewSingular);r&&r.adpCell.render()},[])}),R(this,"enableDate",t=>{this.disableDate(t,!0)}),R(this,"isDateDisabled",t=>{let e=y(t);return this.disabledDates.has(this.formatDate(e,"yyyy-MM-dd"))}),R(this,"isOtherMonth",t=>{let{month:e}=c(t);return e!==this.parsedViewDate.month}),R(this,"isOtherYear",t=>{let{year:e}=c(t);return e!==this.parsedViewDate.year}),R(this,"isOtherDecade",t=>{let{year:e}=c(t),[n,i]=f(this.viewDate);return e<n||e>i}),R(this,"_onChangeSelectedDate",t=>{let{silent:e}=t;setTimeout(()=>{this._setInputValue(),this.opts.onSelect&&!e&&this._triggerOnSelect()})}),R(this,"_onChangeFocusedDate",function(t){let{viewDateTransition:e}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t)return;let n=!1;e&&(n=l.isOtherMonth(t)||l.isOtherYear(t)||l.isOtherDecade(t)),n&&l.setViewDate(t),l.opts.onFocus&&l.opts.onFocus({datepicker:l,date:t})}),R(this,"_onChangeTime",t=>{let{hours:e,minutes:n}=t,i=new Date,{lastSelectedDate:r,opts:{onSelect:o}}=this,l=r;r||(l=i);let s=this.getCell(l,this.currentViewSingular),c=s&&s.adpCell;c&&c.isDisabled||(l.setHours(e),l.setMinutes(n),r?(this._setInputValue(),o&&this._triggerOnSelect()):this.selectDate(l))}),R(this,"_onFocus",t=>{this.visible||this.show()}),R(this,"_onBlur",t=>{this.inFocus||!this.visible||this.opts.isMobile||this.hide()}),R(this,"_onMouseDown",t=>{this.inFocus=!0}),R(this,"_onMouseUp",t=>{this.inFocus=!1,this.$el.focus()}),R(this,"_onResize",()=>{this.visible&&"function"!=typeof this.opts.position&&this.setPosition()}),R(this,"_onClickOverlay",()=>{this.visible&&this.hide()}),R(this,"getViewDates",function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n.days;return M.getDatesFunction(t)(l)}),R(this,"isWeekend",t=>this.opts.weekends.includes(t)),R(this,"getClampedDate",t=>{let{minDate:e,maxDate:n}=this,i=t;return n&&p(t,n)?i=n:e&&m(t,e)&&(i=e),i}),this.$el=r(t),!this.$el)return;this.$datepicker=o({className:"air-datepicker"}),this.opts=x({},i,e),this.$customContainer=!!this.opts.container&&r(this.opts.container),this.$altField=r(this.opts.altField||!1);let{view:s,startDate:a}=this.opts;a||(this.opts.startDate=new Date),"INPUT"===this.$el.nodeName&&(this.elIsInput=!0),this.inited=!1,this.visible=!1,this.viewDate=y(this.opts.startDate),this.focusDate=!1,this.initialReadonly=this.$el.getAttribute("readonly"),this.customHide=!1,this.currentView=s,this.selectedDates=[],this.disabledDates=new Set,this.isDestroyed=!1,this.views={},this.keys=[],this.rangeDateFrom="",this.rangeDateTo="",this.timepickerIsActive=!1,this.treatAsInline=this.opts.inline||!this.elIsInput,this.init()}init(){let{opts:t,treatAsInline:e,opts:{inline:n,isMobile:i,selectedDates:o,keyboardNav:l,onlyTimepicker:s}}=this,c=r("body");(!H||H&&L&&!c.contains(L))&&!n&&this.elIsInput&&!this.$customContainer&&P.buildGlobalContainer(P.defaultGlobalContainerId),!i||B||e||this._createMobileOverlay(),this._handleLocale(),this._bindSubEvents(),this._createMinMaxDates(),this._limitViewDateByMaxMinDates(),this.elIsInput&&(n||this._bindEvents(),l&&!s&&(this.keyboardNav=new F({dp:this,opts:t}))),o&&this.selectDate(o,{silent:!0}),this.opts.visible&&!e&&this.show(),i&&!e&&this.$el.setAttribute("readonly",!0),e&&this._createComponents()}_createMobileOverlay(){B=o({className:"air-datepicker-overlay"}),L.appendChild(B)}_createComponents(){let{opts:t,treatAsInline:e,opts:{inline:n,buttons:i,timepicker:r,position:o,classes:l,onlyTimepicker:s,isMobile:c}}=this;this._buildBaseHtml(),this.elIsInput&&(n||this._setPositionClasses(o)),!n&&this.elIsInput||this.$datepicker.classList.add("-inline-"),l&&this.$datepicker.classList.add(...l.split(" ")),s&&this.$datepicker.classList.add("-only-timepicker-"),c&&!e&&this._addMobileAttributes(),this.views[this.currentView]=new M({dp:this,type:this.currentView,opts:t}),this.nav=new j({dp:this,opts:t}),r&&this._addTimepicker(),i&&this._addButtons(),this.$content.appendChild(this.views[this.currentView].$el),this.$nav.appendChild(this.nav.$el)}_destroyComponents(){for(let t in this.views)this.views[t].destroy();this.views={},this.nav.destroy(),this.timepicker&&this.timepicker.destroy()}_addMobileAttributes(){B.addEventListener("click",this._onClickOverlay),this.$datepicker.classList.add("-is-mobile-"),this.$el.setAttribute("readonly",!0)}_removeMobileAttributes(){B.removeEventListener("click",this._onClickOverlay),this.$datepicker.classList.remove("-is-mobile-"),this.initialReadonly||""===this.initialReadonly||this.$el.removeAttribute("readonly")}_createMinMaxDates(){let{minDate:t,maxDate:e}=this.opts;this.minDate=!!t&&y(t),this.maxDate=!!e&&y(e)}_addTimepicker(){this.$timepicker=o({className:"air-datepicker--time"}),this.$datepicker.appendChild(this.$timepicker),this.timepicker=new N({dp:this,opts:this.opts}),this.$timepicker.appendChild(this.timepicker.$el)}_addButtons(){this.$buttons=o({className:"air-datepicker--buttons"}),this.$datepicker.appendChild(this.$buttons),this.buttons=new C({dp:this,opts:this.opts}),this.$buttons.appendChild(this.buttons.$el)}_bindSubEvents(){this.on(n.eventChangeSelectedDate,this._onChangeSelectedDate),this.on(n.eventChangeFocusDate,this._onChangeFocusedDate),this.on(n.eventChangeTime,this._onChangeTime)}_buildBaseHtml(){let{inline:t}=this.opts;var e,n;this.elIsInput?t?(e=this.$datepicker,(n=this.$el).parentNode.insertBefore(e,n.nextSibling)):this.$container.appendChild(this.$datepicker):this.$el.appendChild(this.$datepicker),this.$datepicker.innerHTML='<i class="air-datepicker--pointer"></i><div class="air-datepicker--navigation"></div><div class="air-datepicker--content"></div>',this.$content=r(".air-datepicker--content",this.$datepicker),this.$pointer=r(".air-datepicker--pointer",this.$datepicker),this.$nav=r(".air-datepicker--navigation",this.$datepicker)}_handleLocale(){let{locale:t,dateFormat:e,firstDay:n,timepicker:i,onlyTimepicker:r,timeFormat:o,dateTimeSeparator:l}=this.opts;var s;this.locale=(s=t,JSON.parse(JSON.stringify(s))),e&&(this.locale.dateFormat=e),void 0!==o&&""!==o&&(this.locale.timeFormat=o);let{timeFormat:c}=this.locale;if(""!==n&&(this.locale.firstDay=n),i&&"function"!=typeof e){let t=c?l:"";this.locale.dateFormat=[this.locale.dateFormat,c||""].join(t)}r&&"function"!=typeof e&&(this.locale.dateFormat=this.locale.timeFormat)}_setPositionClasses(t){if("function"==typeof t)return void this.$datepicker.classList.add("-custom-position-");let e=(t=t.split(" "))[0],n=`air-datepicker -${e}-${t[1]}- -from-${e}-`;this.$datepicker.classList.add(...n.split(" "))}_bindEvents(){this.$el.addEventListener(this.opts.showEvent,this._onFocus),this.$el.addEventListener("blur",this._onBlur),this.$datepicker.addEventListener("mousedown",this._onMouseDown),this.$datepicker.addEventListener("mouseup",this._onMouseUp),window.addEventListener("resize",this._onResize)}_limitViewDateByMaxMinDates(){let{viewDate:t,minDate:e,maxDate:n}=this;n&&p(t,n)&&this.setViewDate(n),e&&m(t,e)&&this.setViewDate(e)}formatDate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.viewDate,e=arguments.length>1?arguments[1]:void 0;if(t=y(t),!(t instanceof Date))return;let n=e,i=this.locale,r=c(t),o=r.dayPeriod,l=f(t),s=P.replacer,a={T:t.getTime(),m:r.minutes,mm:r.fullMinutes,h:r.hours12,hh:r.fullHours12,H:r.hours,HH:r.fullHours,aa:o,AA:o.toUpperCase(),E:i.daysShort[r.day],EEEE:i.days[r.day],d:r.date,dd:r.fullDate,M:r.month+1,MM:r.fullMonth,MMM:i.monthsShort[r.month],MMMM:i.months[r.month],yy:r.year.toString().slice(-2),yyyy:r.year,yyyy1:l[0],yyyy2:l[1]};for(let[t,e]of Object.entries(a))n=s(n,k(t),e);return n}down(t){this._handleUpDownActions(t,"down")}up(t){this._handleUpDownActions(t,"up")}selectDate(t){let e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{currentView:r,parsedViewDate:o,selectedDates:l}=this,{updateTime:s,silent:c}=i,{moveToOtherMonthsOnSelect:a,moveToOtherYearsOnSelect:u,multipleDates:f,range:d,autoClose:h,onBeforeSelect:m}=this.opts,w=l.length;if(Array.isArray(t))return t.forEach(t=>{this.selectDate(t,i)}),new Promise(t=>{setTimeout(t)});if((t=y(t))instanceof Date){if(m&&!c&&!m({date:t,datepicker:this}))return Promise.resolve();if(r===n.days&&t.getMonth()!==o.month&&a&&(e=new Date(t.getFullYear(),t.getMonth(),1)),r===n.years&&t.getFullYear()!==o.year&&u&&(e=new Date(t.getFullYear(),0,1)),e&&this.setViewDate(e),f&&!d){if(w===f)return;this._checkIfDateIsSelected(t)||l.push(t)}else if(d)switch(w){case 1:l.push(t),this.rangeDateTo||(this.rangeDateTo=t),p(this.rangeDateFrom,this.rangeDateTo)&&(this.rangeDateTo=this.rangeDateFrom,this.rangeDateFrom=t),this.selectedDates=[this.rangeDateFrom,this.rangeDateTo];break;case 2:this.selectedDates=[t],this.rangeDateFrom=t,this.rangeDateTo="";break;default:this.selectedDates=[t],this.rangeDateFrom=t}else this.selectedDates=[t];return this.trigger(n.eventChangeSelectedDate,{action:n.actionSelectDate,silent:null==i?void 0:i.silent,date:t,updateTime:s}),this._updateLastSelectedDate(t),h&&!this.timepickerIsActive&&this.visible&&(f||d?d&&1===w&&this.hide():this.hide()),new Promise(t=>{setTimeout(t)})}}unselectDate(t){let e=this.selectedDates,i=this;if((t=y(t))instanceof Date)return e.some((r,o)=>{if(h(r,t))return e.splice(o,1),i.selectedDates.length?(i.rangeDateTo="",i.rangeDateFrom=e[0],i._updateLastSelectedDate(i.selectedDates[i.selectedDates.length-1])):(i.rangeDateFrom="",i.rangeDateTo="",i._updateLastSelectedDate(!1)),this.trigger(n.eventChangeSelectedDate,{action:n.actionUnselectDate,date:t}),!0})}replaceDate(t,e){let i=this.selectedDates.find(e=>h(e,t,this.currentView)),r=this.selectedDates.indexOf(i);r<0||h(this.selectedDates[r],e,this.currentView)||(this.selectedDates[r]=e,this.trigger(n.eventChangeSelectedDate,{action:n.actionSelectDate,date:e,updateTime:!0}),this._updateLastSelectedDate(e))}clear(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.selectedDates=[],this.rangeDateFrom=!1,this.rangeDateTo=!1,this.lastSelectedDate=!1,this.trigger(n.eventChangeSelectedDate,{action:n.actionUnselectDate,silent:t.silent}),new Promise(t=>{setTimeout(t)})}show(){let{onShow:t,isMobile:e}=this.opts;this._cancelScheduledCall(),this.visible||this.hideAnimation||this._createComponents(),this.setPosition(this.opts.position),this.$datepicker.classList.add("-active-"),this.visible=!0,t&&this._scheduleCallAfterTransition(t),e&&this._showMobileOverlay()}hide(){let{onHide:t,isMobile:e}=this.opts,n=this._hasTransition();this.visible=!1,this.hideAnimation=!0,this.$datepicker.classList.remove("-active-"),this.customHide&&this.customHide(),this.elIsInput&&this.$el.blur(),this._scheduleCallAfterTransition(e=>{!this.customHide&&(e&&n||!e&&!n)&&this._finishHide(),t&&t(e)}),e&&B.classList.remove("-active-")}_triggerOnSelect(){let t=[],e=[],{selectedDates:n,locale:i,opts:{onSelect:r,multipleDates:o,range:l}}=this,s=o||l,c="function"==typeof i.dateFormat;n.length&&(t=n.map(w),e=c?o?i.dateFormat(t):t.map(t=>i.dateFormat(t)):t.map(t=>this.formatDate(t,i.dateFormat))),r({date:s?t:t[0],formattedDate:s?e:e[0],datepicker:this})}_handleAlreadySelectedDates(t,e){let{selectedDates:n,rangeDateFrom:i,rangeDateTo:r}=this,{range:o,toggleSelected:l}=this.opts,s=n.length,c="function"==typeof l?l({datepicker:this,date:e}):l,a=Boolean(o&&1===s&&t),u=a?w(e):e;o&&!c&&(2!==s&&this.selectDate(u),2===s&&h(i,r))||(c?this.unselectDate(u):this._updateLastSelectedDate(a?u:t))}_handleUpDownActions(t,e){if(!((t=y(t||this.focusDate||this.viewDate))instanceof Date))return;let n="up"===e?this.viewIndex+1:this.viewIndex-1;n>2&&(n=2),n<0&&(n=0),this.setViewDate(new Date(t.getFullYear(),t.getMonth(),1)),this.setCurrentView(this.viewIndexes[n])}getCell(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.day;if(!((t=y(t))instanceof Date))return;let{year:i,month:r,date:o}=c(t),l=`[data-year="${i}"]`,s=`[data-month="${r}"]`,a={[n.day]:`${l}${s}[data-date="${o}"]`,[n.month]:`${l}${s}`,[n.year]:`${l}`};return this.views[this.currentView]?this.views[this.currentView].$el.querySelector(a[e]):void 0}_showMobileOverlay(){B.classList.add("-active-")}_hasTransition(){return window.getComputedStyle(this.$datepicker).getPropertyValue("transition-duration").split(", ").reduce((t,e)=>parseFloat(e)+t,0)>0}get shouldUpdateDOM(){return this.visible||this.treatAsInline}get parsedViewDate(){return c(this.viewDate)}get currentViewSingular(){return this.currentView.slice(0,-1)}get curDecade(){return f(this.viewDate)}get viewIndex(){return this.viewIndexes.indexOf(this.currentView)}get isFinalView(){return this.currentView===n.years}get hasSelectedDates(){return this.selectedDates.length>0}get isMinViewReached(){return this.currentView===this.opts.minView||this.currentView===n.days}get $container(){return this.$customContainer||L}static replacer(t,e,n){return t.replace(e,function(t,e,i,r){return e+n+r})}}var U;return R(P,"defaults",i),R(P,"version","3.6.0"),R(P,"defaultGlobalContainerId","air-datepicker-global-container"),U=P.prototype,Object.assign(U,I),e.default}()),Po.exports),Zo=zo(Vo),Yo={};var qo=zo((Uo||(Uo=1,Object.defineProperty(Yo,"D",{value:!0}),Yo.default=void 0,Yo.default={days:["Domenica","LunedΓ¬","MartedΓ¬","MercoledΓ¬","GiovedΓ¬","VenerdΓ¬","Sabato"],daysShort:["Dom","Lun","Mar","Mer","Gio","Ven","Sab"],daysMin:["Do","Lu","Ma","Me","Gi","Ve","Sa"],months:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"],monthsShort:["Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic"],today:"Oggi",clear:"Cancella",dateFormat:"dd/MM/yyyy",timeFormat:"HH:mm",firstDay:1}),Yo));function Go(t){let e,n,i,r;return{c(){e=d("input"),c(e,"type","text"),e.readOnly=t[1],c(e,"placeholder",t[4]),e.value=t[9],c(e,"maxlength","10"),c(e,"class",n="px-2 text-center "+(t[0]?"h-6 text-xs":"text-sm h-8 ")+" "+(t[1]?"bg-c-100 !text-c-200 ":"bg-white cursor-pointer ")+" text-c-800 border border-c-border min-w-32 "+(t[12].class||""))},m(n,o){u(n,e,o),i||(r=f(e,"input",t[11]),i=!0)},p(t,i){2&i&&(e.readOnly=t[1]),16&i&&c(e,"placeholder",t[4]),512&i&&e.value!==t[9]&&(e.value=t[9]),4099&i&&n!==(n="px-2 text-center "+(t[0]?"h-6 text-xs":"text-sm h-8 ")+" "+(t[1]?"bg-c-100 !text-c-200 ":"bg-white cursor-pointer ")+" text-c-800 border border-c-border min-w-32 "+(t[12].class||""))&&c(e,"class",n)},d(t){t&&l(e),i=!1,r()}}}function Xo(t){let e,n,i;return{c(){e=d("div"),n=$(t[9]),c(e,"class",i="pt-1 px-2 "+(t[0]?"h-6 text-xs":"text-sm h-8 ")+" "+(t[1]?"bg-c-100 !text-c-200 ":"bg-white cursor-pointer ")+" text-c-800 border border-c-border min-w-32 "+(t[12].class||""))},m(t,i){u(t,e,i),k(e,n)},p(t,r){512&r&&b(n,t[9]),4099&r&&i!==(i="pt-1 px-2 "+(t[0]?"h-6 text-xs":"text-sm h-8 ")+" "+(t[1]?"bg-c-100 !text-c-200 ":"bg-white cursor-pointer ")+" text-c-800 border border-c-border min-w-32 "+(t[12].class||""))&&c(e,"class",i)},d(t){t&&l(e)}}}function Wo(t){let e,n,i,r,s,a;return{c(){e=d("button"),n=_(),i=d("div"),r=d("div"),c(e,"class","fixed z-40 inset-0 bg-transparent"),c(e,"aria-label","input-data"),c(i,"class","fixed z-50 flex flex-col")},m(o,l){u(o,e,l),u(o,n,l),u(o,i,l),k(i,r),t[22](r),t[23](i),s||(a=f(e,"click",t[21]),s=!0)},p:o,d(r){r&&(l(e),l(n),l(i)),t[22](null),t[23](null),s=!1,a()}}}function Ko(t){let e,n,i,r,o,s;const c=t[18].default,a=p(c,t,t[17],null),h=a||function(t){let e;function n(t,e){return t[3]||t[2]?Xo:Go}let i=n(t),r=i(t);return{c(){r.c(),e=S()},m(t,n){r.m(t,n),u(t,e,n)},p(t,o){i===(i=n(t))&&r?r.p(t,o):(r.d(1),r=i(t),r&&(r.c(),r.m(e.parentNode,e)))},d(t){t&&l(e),r.d(t)}}}(t);let b=t[6]&&Wo(t);return{c(){e=d("button"),h&&h.c(),n=_(),b&&b.c(),i=S(),e.disabled=t[1]},m(l,c){u(l,e,c),h&&h.m(e,null),t[19](e),u(l,n,c),b&&b.m(l,c),u(l,i,c),r=!0,o||(s=f(e,"click",t[20]),o=!0)},p(t,[n]){a?a.p&&(!r||131072&n)&&g(a,c,t,t[17],r?x(c,t[17],n,null):v(t[17]),null):h&&h.p&&(!r||4639&n)&&h.p(t,r?n:-1),(!r||2&n)&&(e.disabled=t[1]),t[6]?b?b.p(t,n):(b=Wo(t),b.c(),b.m(i.parentNode,i)):b&&(b.d(1),b=null)},i(t){r||(w(h,t),r=!0)},o(t){m(h,t),r=!1},d(r){r&&(l(e),l(n),l(i)),h&&h.d(r),t[19](null),b&&b.d(r),o=!1,s()}}}function Jo(t,e,n){let o,{$$slots:l={},$$scope:s}=e;const{post:c,strDate:a}=fr();let{value:u=0,sm:f=!1,readonly:d=!1,value2:p=0,mindata:m=0,maxdata:w=0,time:b=!1,range:g=!1,placeholder:v=""}=e;const x=W();let y,k,$,_,D;async function S(t){if(n(6,k=t),k&&y){await X();let t=[];u&&(t.push(u.toDate()),g&&p&&t.push(p.toDate()));let e={};b&&(e={inline:!0,timepicker:!0,minHours:9,maxHours:18,minutesStep:5}),D=new Zo($,{locale:qo,minDate:m?m.toDate():void 0,maxDate:w?w.toDate():void 0,selectedDates:t,multipleDatesSeparator:";",range:g,buttons:[{content:"oggi",onClick:()=>{const t=new Date;D.selectDate(t),n(13,u=c.oggi),g&&n(14,p=b?t.toFloat():t.toInt()),x("change",{value:u,value2:p})}},{content:"cancella",onClick:()=>{D.clear(),n(13,u=0),n(14,p=0),x("change",{value:u,value2:p})}},{content:"conferma",onClick:()=>{S(!1)}}],...e,onSelect(t){let{date:e}=t;Array.isArray(e)?(n(13,u=b?e[0]?.toFloat()||0:e[0]?.toInt()||0),n(14,p=b?e[1]?.toFloat()||0:e[1]?.toInt()||0)):(n(13,u=b?e?.toFloat()||0:e?.toInt()||0),n(14,p=0)),x("change",{value:u,value2:p})}}),nr(y,$,{placement:"bottom",middleware:[Ji(6),tr(),Qi({padding:2})]}).then(({x:t,y:e,placement:n,middlewareData:i})=>{let r={top:`${e}px`,left:`${t}px`,zIndex:1e3};Object.assign($.style,r)})}else D&&(D.destroy(),D=null,x("click"))}K(()=>{D&&D.destroy()});return t.$$set=t=>{n(12,e=i(i({},e),r(t))),"value"in t&&n(13,u=t.value),"sm"in t&&n(0,f=t.sm),"readonly"in t&&n(1,d=t.readonly),"value2"in t&&n(14,p=t.value2),"mindata"in t&&n(15,m=t.mindata),"maxdata"in t&&n(16,w=t.maxdata),"time"in t&&n(2,b=t.time),"range"in t&&n(3,g=t.range),"placeholder"in t&&n(4,v=t.placeholder),"$$scope"in t&&n(17,s=t.$$scope)},t.$$.update=()=>{24588&t.$$.dirty&&n(9,o=function(){const t=d?v||" n.d. ":"gg/mm/aaaa",e=d?"":"ora";let n=u;return"object"==typeof n&&null!==n&&(n=n instanceof Date?b?n.toFloat():n.toInt():0),b?n?a(n,"datetime"):t+" "+e:g?(n?a(n,"ggmmyyyy"):t)+" - "+(p?a(p,"ggmmyyyy"):n?t:"gg/mm/aaaa"):n?a(n,"ggmmyyyy"):t}())},e=r(e),[f,d,b,g,v,y,k,$,_,o,S,function(t){const e=t.target,i=e.selectionStart,r=e.value.length,o=function(t){const e=t.replace(/\D/g,"");let n="";for(let t=0;t<e.length&&t<8;t++)2!==t&&4!==t||(n+="/"),n+=e[t];return n}(e.value);e.value=o;const l=i+(o.length-r);if(e.setSelectionRange(l,l),10===o.length){const[t,e,i]=o.split("/"),r=2===i.length?"20"+i:i,l=new Date(r,e-1,t);isNaN(l.getTime())||(D&&D.selectDate(l),n(13,u=b?l.toFloat():l.toInt()),x("change",{value:u,value2:p}))}},e,u,p,m,w,s,l,function(t){h[t?"unshift":"push"](()=>{y=t,n(5,y)})},async()=>await S(!k),()=>S(!1),function(t){h[t?"unshift":"push"](()=>{_=t,n(8,_)})},function(t){h[t?"unshift":"push"](()=>{$=t,n(7,$)})}]}class Qo extends t{constructor(t){super(),e(this,t,Jo,Ko,n,{value:13,sm:0,readonly:1,value2:14,mindata:15,maxdata:16,time:2,range:3,placeholder:4})}}function tl(t,e,n){const i=t.slice();return i[70]=e[n],i}function el(t,e,n){const i=t.slice();return i[73]=e[n],i}function nl(t,e,n){const i=t.slice();return i[70]=e[n],i}function il(t){let e,n,i,r,a;return{c(){e=d("input"),c(e,"type",t[12]),c(e,"maxlength",t[4]),e.value=n=t[0]||"",e.disabled=t[14],c(e,"placeholder",i=t[25](t[3],t[24])),c(e,"autocorrect","off"),c(e,"autocomplete","off"),y(e,"sm",t[11]),y(e,"valid",t[7]),y(e,"error",t[8]),y(e,"readonly",t[14])},m(n,i){u(n,e,i),r||(a=[f(e,"input",t[64]),f(e,"blur",t[65]),f(e,"keypress",t[40])],r=!0)},p(t,r){4096&r[0]&&c(e,"type",t[12]),16&r[0]&&c(e,"maxlength",t[4]),1&r[0]&&n!==(n=t[0]||"")&&e.value!==n&&(e.value=n),16384&r[0]&&(e.disabled=t[14]),16777224&r[0]&&i!==(i=t[25](t[3],t[24]))&&c(e,"placeholder",i),2048&r[0]&&y(e,"sm",t[11]),128&r[0]&&y(e,"valid",t[7]),256&r[0]&&y(e,"error",t[8]),16384&r[0]&&y(e,"readonly",t[14])},i:o,o:o,d(t){t&&l(e),r=!1,s(a)}}}function rl(t){let e,n,i;function r(e){t[63](e)}let o={sm:t[11],readonly:t[14],placeholder:t[3],time:!0,class:"",type:"text"};return void 0!==t[0]&&(o.value=t[0]),e=new Qo({props:o}),h.push(()=>Z(e,"value",r)),e.$on("click",t[33]),{c(){F(e.$$.fragment)},m(t,n){N(e,t,n),i=!0},p(t,i){const r={};2048&i[0]&&(r.sm=t[11]),16384&i[0]&&(r.readonly=t[14]),8&i[0]&&(r.placeholder=t[3]),!n&&1&i[0]&&(n=!0,r.value=t[0],Y(()=>n=!1)),e.$set(r)},i(t){i||(w(e.$$.fragment,t),i=!0)},o(t){m(e.$$.fragment,t),i=!1},d(t){T(e,t)}}}function ol(t){let e,n,i;function r(e){t[62](e)}let o={sm:t[11],readonly:t[14],placeholder:t[3],class:"",type:"text"};return void 0!==t[0]&&(o.value=t[0]),e=new Qo({props:o}),h.push(()=>Z(e,"value",r)),e.$on("click",t[33]),{c(){F(e.$$.fragment)},m(t,n){N(e,t,n),i=!0},p(t,i){const r={};2048&i[0]&&(r.sm=t[11]),16384&i[0]&&(r.readonly=t[14]),8&i[0]&&(r.placeholder=t[3]),!n&&1&i[0]&&(n=!0,r.value=t[0],Y(()=>n=!1)),e.$set(r)},i(t){i||(w(e.$$.fragment,t),i=!0)},o(t){m(e.$$.fragment,t),i=!1},d(t){T(e,t)}}}function ll(t){let e,n,i,r,a;return{c(){e=d("input"),c(e,"type","time"),e.value=n=Dl(t[0]),e.disabled=t[14],c(e,"placeholder",i=t[25](t[3],t[24])),c(e,"autocorrect","off"),c(e,"autocomplete","off"),y(e,"sm",t[11]),y(e,"valid",t[7]),y(e,"error",t[8]),y(e,"readonly",t[14])},m(n,i){u(n,e,i),r||(a=[f(e,"keypress",t[60]),f(e,"blur",t[61])],r=!0)},p(t,r){1&r[0]&&n!==(n=Dl(t[0]))&&e.value!==n&&(e.value=n),16384&r[0]&&(e.disabled=t[14]),16777224&r[0]&&i!==(i=t[25](t[3],t[24]))&&c(e,"placeholder",i),2048&r[0]&&y(e,"sm",t[11]),128&r[0]&&y(e,"valid",t[7]),256&r[0]&&y(e,"error",t[8]),16384&r[0]&&y(e,"readonly",t[14])},i:o,o:o,d(t){t&&l(e),r=!1,s(a)}}}function sl(t){let e,n,i,r,a;return{c(){e=d("input"),c(e,"type","text"),e.value=n=t[18]?t[19]||"":t[35](t[0])||0,e.disabled=t[14],c(e,"placeholder",i=t[25](t[3],t[24])),c(e,"autocorrect","off"),c(e,"autocomplete","off"),y(e,"sm",t[11]),y(e,"valid",t[7]),y(e,"error",t[8]),y(e,"readonly",t[14])},m(n,i){u(n,e,i),r||(a=[f(e,"focus",t[57]),f(e,"keypress",t[58]),f(e,"blur",t[59])],r=!0)},p(t,r){786433&r[0]&&n!==(n=t[18]?t[19]||"":t[35](t[0])||0)&&e.value!==n&&(e.value=n),16384&r[0]&&(e.disabled=t[14]),16777224&r[0]&&i!==(i=t[25](t[3],t[24]))&&c(e,"placeholder",i),2048&r[0]&&y(e,"sm",t[11]),128&r[0]&&y(e,"valid",t[7]),256&r[0]&&y(e,"error",t[8]),16384&r[0]&&y(e,"readonly",t[14])},i:o,o:o,d(t){t&&l(e),r=!1,s(a)}}}function cl(t){let e,n,i,r=t[22]&&hl(t);return{c(){e=d("select"),r&&r.c(),e.disabled=t[14],y(e,"sm",t[11]),y(e,"border-none",t[10])},m(o,l){u(o,e,l),r&&r.m(e,null),n||(i=[f(e,"change",t[31]),f(e,"click",O(Sl))],n=!0)},p(t,n){t[22]?r?r.p(t,n):(r=hl(t),r.c(),r.m(e,null)):r&&(r.d(1),r=null),16384&n[0]&&(e.disabled=t[14]),2048&n[0]&&y(e,"sm",t[11]),1024&n[0]&&y(e,"border-none",t[10])},i:o,o:o,d(t){t&&l(e),r&&r.d(),n=!1,s(i)}}}function al(t){let e,n,i,r,s,a;return{c(){e=d("div"),n=d("input"),i=_(),r=d("label"),c(n,"class","checkbox"),c(n,"type","checkbox"),c(n,"id",t[41]),n.checked=t[20],n.disabled=t[14],y(n,"sm",t[11]),c(r,"for",t[41]),c(e,"class","text-4xl ml-2")},m(o,l){u(o,e,l),k(e,n),k(e,i),k(e,r),s||(a=f(n,"click",t[39]),s=!0)},p(t,e){1048576&e[0]&&(n.checked=t[20]),16384&e[0]&&(n.disabled=t[14]),2048&e[0]&&y(n,"sm",t[11])},i:o,o:o,d(t){t&&l(e),s=!1,a()}}}function ul(t){let e;const n=t[48].default,i=p(n,t,t[66],null),r=i||function(){let t;return{c(){t=d("div"),t.textContent="slot",c(t,"class","bg-c-100")},m(e,n){u(e,t,n)},p:o,d(e){e&&l(t)}}}();return{c(){r&&r.c()},m(t,n){r&&r.m(t,n),e=!0},p(t,r){i&&i.p&&(!e||16&r[2])&&g(i,n,t,t[66],e?x(n,t[66],r,null):v(t[66]),null)},i(t){e||(w(r,t),e=!0)},o(t){m(r,t),e=!1},d(t){r&&r.d(t)}}}function fl(t){let e,n;return e=new ko({props:{$$slots:{popup:[$l],default:[yl]},$$scope:{ctx:t}}}),t[55](e),e.$on("lostfocus",t[56]),{c(){F(e.$$.fragment)},m(t,i){N(e,t,i),n=!0},p(t,n){const i={};4440067&n[0]|16&n[2]&&(i.$$scope={dirty:n,ctx:t}),e.$set(i)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(n){t[55](null),T(e,n)}}}function dl(t){let e,n,i,r;return{c(){e=d("textarea"),c(e,"rows",t[13]),e.value=t[23],c(e,"maxlength",t[4]),e.disabled=t[14],c(e,"placeholder",n=t[25](t[3],t[24])),y(e,"sm",t[11]),y(e,"valid",t[7]),y(e,"error",t[8]),y(e,"readonly",t[14])},m(n,o){u(n,e,o),i||(r=[f(e,"keypress",t[49]),f(e,"blur",t[50])],i=!0)},p(t,i){8192&i[0]&&c(e,"rows",t[13]),8388608&i[0]&&(e.value=t[23]),16&i[0]&&c(e,"maxlength",t[4]),16384&i[0]&&(e.disabled=t[14]),16777224&i[0]&&n!==(n=t[25](t[3],t[24]))&&c(e,"placeholder",n),2048&i[0]&&y(e,"sm",t[11]),128&i[0]&&y(e,"valid",t[7]),256&i[0]&&y(e,"error",t[8]),16384&i[0]&&y(e,"readonly",t[14])},i:o,o:o,d(t){t&&l(e),i=!1,s(r)}}}function hl(t){let e,n=B(t[22]),i=[];for(let e=0;e<n.length;e+=1)i[e]=gl(tl(t,n,e));return{c(){for(let t=0;t<i.length;t+=1)i[t].c();e=S()},m(t,n){for(let e=0;e<i.length;e+=1)i[e]&&i[e].m(t,n);u(t,e,n)},p(t,r){if(6292032&r[0]){let o;for(n=B(t[22]),o=0;o<n.length;o+=1){const l=tl(t,n,o);i[o]?i[o].p(l,r):(i[o]=gl(l),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=n.length}},d(t){t&&l(e),H(i,t)}}}function pl(t){let e,n=(t[70].des??t[70])+"";return{c(){e=$(n)},m(t,n){u(t,e,n)},p(t,i){4194304&i[0]&&n!==(n=(t[70].des??t[70])+"")&&b(e,n)},d(t){t&&l(e)}}}function ml(t){let e,n,i,r=(t[70].cod??t[70].id)+"",o=t[70].des+"";return{c(){e=$(r),n=$(" - "),i=$(o)},m(t,r){u(t,e,r),u(t,n,r),u(t,i,r)},p(t,n){4194304&n[0]&&r!==(r=(t[70].cod??t[70].id)+"")&&b(e,r),4194304&n[0]&&o!==(o=t[70].des+"")&&b(i,o)},d(t){t&&(l(e),l(n),l(i))}}}function wl(t){let e,n=(t[70].cod??t[70].id??t[70])+"";return{c(){e=$(n)},m(t,n){u(t,e,n)},p(t,i){4194304&i[0]&&n!==(n=(t[70].cod??t[70].id??t[70])+"")&&b(e,n)},d(t){t&&l(e)}}}function bl(t){let e,n,i,r;function o(t,e){return t[6]?wl:t[9]&&(t[70].cod||t[70].id)&&t[70].des?ml:pl}let s=o(t),c=s(t);return{c(){e=d("option"),c.c(),n=_(),e.j=i=t[70].cod??t[70].id??t[70],a(e,e.j),e.selected=r=""+t[21]==""+(t[70].cod??t[70].id??t[70])},m(t,i){u(t,e,i),c.m(e,null),k(e,n)},p(t,l){s===(s=o(t))&&c?c.p(t,l):(c.d(1),c=s(t),c&&(c.c(),c.m(e,n))),4194304&l[0]&&i!==(i=t[70].cod??t[70].id??t[70])&&(e.j=i,a(e,e.j)),6291456&l[0]&&r!==(r=""+t[21]==""+(t[70].cod??t[70].id??t[70]))&&(e.selected=r)},d(t){t&&l(e),c.d()}}}function gl(t){let e,i=t[70].cod??t[70].id??t[70],r=bl(t);return{c(){r.c(),e=S()},m(t,n){r.m(t,n),u(t,e,n)},p(t,o){4194304&o[0]&&n(i,i=t[70].cod??t[70].id??t[70])?(r.d(1),r=bl(t),r.c(),r.m(e.parentNode,e)):r.p(t,o)},d(t){t&&l(e),r.d(t)}}}function vl(t){let e,n,i,r,o=t[73]+"";return{c(){e=d("div"),n=d("div"),i=$(o),r=_(),c(n,"class","bg-c-base px-2 text-sm text-white rounded"),c(e,"class","pr-2")},m(t,o){u(t,e,o),k(e,n),k(n,i),k(e,r)},p(t,e){1&e[0]&&o!==(o=t[73]+"")&&b(i,o)},d(t){t&&l(e)}}}function xl(t){let e,n;return e=new ar({props:{img:"more_horiz",size:6}}),{c(){F(e.$$.fragment)},m(t,i){N(e,t,i),n=!0},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){T(e,t)}}}function yl(t){let e,n,i,r,o,s,a,h,p,b,g,v=t[30](t[0],t[15]),x=B((t[0]||"").split(";")),y=[];for(let e=0;e<x.length;e+=1)y[e]=vl(el(t,x,e));let $=v&&xl();return h=new ar({props:{size:6,img:t[17]?"expand_less":"expand_more"}}),{c(){e=d("button"),n=d("div"),i=d("div"),r=d("div"),o=d("div");for(let t=0;t<y.length;t+=1)y[t].c();s=_(),$&&$.c(),a=_(),F(h.$$.fragment),c(o,"class","flex flex-auto"),c(r,"class","px-2 pt-1.5 overflow-hidden w-full h-full"),c(i,"class","absolute inset-0"),c(n,"class","flex-1 relative h-8"),c(e,"class","w-full flexrow border border-c-border bg-white h-8 items-center cursor-pointer")},m(l,c){u(l,e,c),k(e,n),k(n,i),k(i,r),k(r,o);for(let t=0;t<y.length;t+=1)y[t]&&y[t].m(o,null);t[53](o),k(e,s),$&&$.m(e,null),k(e,a),N(h,e,null),p=!0,b||(g=f(e,"click",t[54]),b=!0)},p(t,n){if(1&n[0]){let e;for(x=B((t[0]||"").split(";")),e=0;e<x.length;e+=1){const i=el(t,x,e);y[e]?y[e].p(i,n):(y[e]=vl(i),y[e].c(),y[e].m(o,null))}for(;e<y.length;e+=1)y[e].d(1);y.length=x.length}32769&n[0]&&(v=t[30](t[0],t[15])),v?$?32769&n[0]&&w($,1):($=xl(),$.c(),w($,1),$.m(e,a)):$&&(z(),m($,1,1,()=>{$=null}),M());const i={};131072&n[0]&&(i.img=t[17]?"expand_less":"expand_more"),h.$set(i)},i(t){p||(w($),w(h.$$.fragment,t),p=!0)},o(t){m($),m(h.$$.fragment,t),p=!1},d(n){n&&l(e),H(y,n),t[53](null),$&&$.d(),T(h),b=!1,g()}}}function kl(t){let e,n,i,r;return n=new mo({props:{checkbox:!0,xs:!0,labcod:(t[70].cod||t[70].id+"").toUpperCase(),label:(t[70].des||"").toLowerCase(),value:t[38](t[70])}}),n.$on("click",function(...e){return t[52](t[70],...e)}),{c(){e=d("div"),F(n.$$.fragment),i=_(),c(e,"class","w-full px-2 overflow-hidden")},m(t,o){u(t,e,o),N(n,e,null),k(e,i),r=!0},p(e,i){t=e;const r={};4194304&i[0]&&(r.labcod=(t[70].cod||t[70].id+"").toUpperCase()),4194304&i[0]&&(r.label=(t[70].des||"").toLowerCase()),4194304&i[0]&&(r.value=t[38](t[70])),n.$set(r)},i(t){r||(w(n.$$.fragment,t),r=!0)},o(t){m(n.$$.fragment,t),r=!1},d(t){t&&l(e),T(n)}}}function $l(t){let e,n,i,r,o,s;r=new mo({props:{class:"font-bold",checkbox:!0,xs:!0,label:"seleziona/deseleziona tutto",value:t[28]}}),r.$on("click",t[51]);let a=B(t[22]),f=[];for(let e=0;e<a.length;e+=1)f[e]=kl(nl(t,a,e));const h=t=>m(f[t],1,1,()=>{f[t]=null});return{c(){e=d("div"),n=d("div"),i=d("div"),F(r.$$.fragment),o=_();for(let t=0;t<f.length;t+=1)f[t].c();c(i,"class","w-full px-2 overflow-hidden"),c(n,"class","w-full flex flex-col space-y-1"),c(e,"slot","popup"),c(e,"class","max-h-[16rem] overflow-x-hidden overflow-y-auto bg-white border border-c-100 shadow p-1")},m(t,l){u(t,e,l),k(e,n),k(n,i),N(r,i,null),k(n,o);for(let t=0;t<f.length;t+=1)f[t]&&f[t].m(n,null);s=!0},p(t,e){if(4259840&e[0]|192&e[1]){let i;for(a=B(t[22]),i=0;i<a.length;i+=1){const r=nl(t,a,i);f[i]?(f[i].p(r,e),w(f[i],1)):(f[i]=kl(r),f[i].c(),w(f[i],1),f[i].m(n,null))}for(z(),i=a.length;i<f.length;i+=1)h(i);M()}},i(t){if(!s){w(r.$$.fragment,t);for(let t=0;t<a.length;t+=1)w(f[t]);s=!0}},o(t){m(r.$$.fragment,t),f=f.filter(Boolean);for(let t=0;t<f.length;t+=1)m(f[t]);s=!1},d(t){t&&l(e),T(r),H(f,t)}}}function _l(t){let e,n,i,r,o;const s=[dl,fl,ul,al,cl,sl,ll,ol,rl,il],a=[];function f(t,e){return"area"===t[12]?0:"multiple"==t[12]?1:"slot"==t[12]?2:"check"===t[12]||"checkbox"==t[12]?3:"select"===t[12]?4:"number"===t[12]||"integer"===t[12]?5:"time"===t[12]?6:"date"===t[12]?7:"datetime"===t[12]?8:9}return n=f(t),i=a[n]=s[n](t),{c(){e=d("div"),i.c(),c(e,"class",r=`relative ${t[42].class||""}`)},m(t,i){u(t,e,i),a[n].m(e,null),o=!0},p(t,l){let u=n;n=f(t),n===u?a[n].p(t,l):(z(),m(a[u],1,1,()=>{a[u]=null}),M(),i=a[n],i?i.p(t,l):(i=a[n]=s[n](t),i.c()),w(i,1),i.m(e,null)),(!o||2048&l[1]&&r!==(r=`relative ${t[42].class||""}`))&&c(e,"class",r)},i(t){o||(w(i),o=!0)},o(t){m(i),o=!1},d(t){t&&l(e),a[n].d()}}}function Dl(t){return t>0?("00"+t.toFixed(2)).slice(-5).replace(".",":"):"00:00"}const Sl=()=>{};function zl(t,e,n){let o,l,s,c,a,{$$slots:u={},$$scope:f}=e;const{_:d,lang:p,tonum:m,listfromstring:w}=fr();let b,g;I(t,p,t=>n(24,a=t));const v=W();let{value:x="",placeholder:y="",options:k,maxlength:$,forcestring:_=!1,uppercase:D=!1,onlycod:S=!1,valid:z=!1,error:M=!1,showcod:E=!1,noborder:j=!1,sm:A=!1,autosize:C,truevalue:T=1,falsevalue:N=0,type:O="text",decimali:F=2,coeff:R=1,rows:L=5,readonly:B=!1}=e,H=!1;function P(t){if(!C||"string"!=typeof C)return;let e=C.split(","),n=4*parseInt(e[0]||20),i=4*parseInt(e[1]||40),r=t.target;if(r){const t=r.scrollWidth+2;r.style.width=`${Math.max(n,Math.min(t,i))}px`}}function U(){return!!b&&b.scrollWidth>b.clientWidth}function V(t){t&&(n(0,x=parseFloat(t.replace(":","."))),v("change",x))}async function Z(){v("change",x)}function Y(t){Array.isArray(x)?n(0,x=t.split("\n")):n(0,x=t)}let q,G=!1;function X(t){if(t)return t=parseFloat(t)||0,R&&(t*=R),parseFloat((t||0).toFixed("integer"==O?0:F))}function K(t){var e=m(t,"integer"==O?0:F);n(0,x=e.isNaN?0:e/(R||1)),n(19,q=X(x)),Z()}function J(t,e){var i=(e.cod||e.id+"").toLowerCase(),r=(x||"").toLowerCase().split(";");t&&!r.includes(i)?x?r.push(i):r=[i]:r.includes(i)&&(r=r.filter(t=>t!=i)),r.sort(),n(0,x=r.join(";"))}const Q=`c_${Math.floor(1e10*Math.random())}`;return t.$$set=t=>{n(42,e=i(i({},e),r(t))),"value"in t&&n(0,x=t.value),"placeholder"in t&&n(3,y=t.placeholder),"options"in t&&n(1,k=t.options),"maxlength"in t&&n(4,$=t.maxlength),"forcestring"in t&&n(43,_=t.forcestring),"uppercase"in t&&n(5,D=t.uppercase),"onlycod"in t&&n(6,S=t.onlycod),"valid"in t&&n(7,z=t.valid),"error"in t&&n(8,M=t.error),"showcod"in t&&n(9,E=t.showcod),"noborder"in t&&n(10,j=t.noborder),"sm"in t&&n(11,A=t.sm),"autosize"in t&&n(44,C=t.autosize),"truevalue"in t&&n(45,T=t.truevalue),"falsevalue"in t&&n(46,N=t.falsevalue),"type"in t&&n(12,O=t.type),"decimali"in t&&n(47,F=t.decimali),"coeff"in t&&n(2,R=t.coeff),"rows"in t&&n(13,L=t.rows),"readonly"in t&&n(14,B=t.readonly),"$$scope"in t&&n(66,f=t.$$scope)},t.$$.update=()=>{1&t.$$.dirty[0]&&n(23,o=Array.isArray(x)?x.join("\n"):x||""),2&t.$$.dirty[0]&&n(22,l=k?w(k):[]),1&t.$$.dirty[0]&&n(21,s="object"==typeof x?x?.cod||x?.id:x),1&t.$$.dirty[0]|16384&t.$$.dirty[1]&&n(20,c=x==T),32768&t.$$.dirty[0]&&U()},e=r(e),[x,k,R,y,$,D,S,z,M,E,j,A,O,L,B,b,g,H,G,q,c,s,l,o,a,d,p,v,undefined,P,U,async function(t){var e=t.target.value;if("string"==typeof x||_)n(0,x=e);else if("number"==typeof x)n(0,x=parseInt(e));else{var i=l?.filter(t=>t.id==e||t.cod==e);n(0,x=i[0]||{cod:e})}v("click"),v("change",x)},V,Z,Y,X,K,J,function(t){var e=(t.cod||t.id+"").toLowerCase();return(x||"").toLowerCase().split(";").includes(e)?1:0},function(t){t.stopPropagation(),t.target.checked?n(0,x=T):n(0,x=N),v("click",x)},function(t){"Enter"==t.key&&v("click",x)},Q,e,_,C,T,N,F,u,t=>{Y(t.target.value),Z()},t=>{Y(t.target.value)},t=>{for(var e of l)J(t.detail.value,e);t.detail.value||n(0,x=""),n(1,k=[...k])},(t,e)=>{g.checkvisibility(e)&&J(e.detail.value,t)},function(t){h[t?"unshift":"push"](()=>{b=t,n(15,b)})},()=>{B||(n(17,H=!H),g.openmenu(H))},function(t){h[t?"unshift":"push"](()=>{g=t,n(16,g)})},()=>n(17,H=!1),()=>{n(2,R=parseFloat(R)||1),n(19,q=X(x)),n(18,G=!0)},t=>{if("Escape"===t.key)n(19,q=X(x)),t.target.value=q;else if("Enter"===t.key){const e=x;K(t.target.value),e!=x&&v("click",x)}else n(19,q=t.target.value)},t=>{n(18,G=!1);const e=x;K(t.target.value),x!==e&&v("click",x)},t=>{n(18,G=!1),V(t.target.value)},t=>{n(18,G=!1),V(t.target.value)},function(t){x=t,n(0,x)},function(t){x=t,n(0,x)},t=>{n(0,x=D?(t.target.value||"").toUpperCase():t.target.value),Z(),P(t)},t=>{x!=t.target.value&&(n(0,x=t.target.value),Z())},f]}class Ml extends t{constructor(t){super(),e(this,t,zl,_l,n,{value:0,placeholder:3,options:1,maxlength:4,forcestring:43,uppercase:5,onlycod:6,valid:7,error:8,showcod:9,noborder:10,sm:11,autosize:44,truevalue:45,falsevalue:46,type:12,decimali:47,coeff:2,rows:13,readonly:14},null,[-1,-1,-1])}}function El(t){let e,n,i;return n=new Ar({props:{id:t[1]}}),{c(){e=d("div"),F(n.$$.fragment),c(e,"class","label pt-1 h-6")},m(t,r){u(t,e,r),N(n,e,null),i=!0},p(t,e){const i={};2&e[0]&&(i.id=t[1]),n.$set(i)},i(t){i||(w(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&l(e),T(n)}}}function jl(t){let e,n,i;return n=new Ar({props:{id:t[1]}}),{c(){e=d("div"),F(n.$$.fragment),c(e,"class","label leading-none pr-2"),c(e,"style","wlabel?'width: '+wlabel+'%;':''"),y(e,"text-right",!t[2]),y(e,"text-sm",t[15])},m(t,r){u(t,e,r),N(n,e,null),i=!0},p(t,r){const o={};2&r[0]&&(o.id=t[1]),n.$set(o),(!i||4&r[0])&&y(e,"text-right",!t[2]),(!i||32768&r[0])&&y(e,"text-sm",t[15])},i(t){i||(w(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&l(e),T(n)}}}function Al(t){let e;const n=t[26].default,i=p(n,t,t[31],null);return{c(){i&&i.c()},m(t,n){i&&i.m(t,n),e=!0},p(t,r){i&&i.p&&(!e||1&r[1])&&g(i,n,t,t[31],e?x(n,t[31],r,null):v(t[31]),null)},i(t){e||(w(i,t),e=!0)},o(t){m(i,t),e=!1},d(t){i&&i.d(t)}}}function Cl(t){let e,n,i="slot"==t[19]&&Al(t);return{c(){i&&i.c(),e=S()},m(t,r){i&&i.m(t,r),u(t,e,r),n=!0},p(t,n){"slot"==t[19]?i?(i.p(t,n),524288&n[0]&&w(i,1)):(i=Al(t),i.c(),w(i,1),i.m(e.parentNode,e)):i&&(z(),m(i,1,1,()=>{i=null}),M())},i(t){n||(w(i),n=!0)},o(t){m(i),n=!1},d(t){t&&l(e),i&&i.d(t)}}}function Tl(t){let e,n,i;function r(e){t[27](e)}let o={placeholder:t[3],options:t[10],onlycod:t[5],uppercase:t[7],forcestring:t[9],tooltip:t[12],valid:t[13],autosize:t[8],error:t[14],sm:t[15],showcod:t[6],noborder:t[11],truevalue:t[16],falsevalue:t[18],type:t[19],decimali:t[20],maxlength:t[17],rows:t[21],coeff:t[22],disabled:t[23],readonly:t[24],$$slots:{default:[Cl]},$$scope:{ctx:t}};return void 0!==t[0]&&(o.value=t[0]),e=new Ml({props:o}),h.push(()=>Z(e,"value",r)),e.$on("input",t[28]),e.$on("change",t[29]),e.$on("click",t[30]),{c(){F(e.$$.fragment)},m(t,n){N(e,t,n),i=!0},p(t,i){const r={};8&i[0]&&(r.placeholder=t[3]),1024&i[0]&&(r.options=t[10]),32&i[0]&&(r.onlycod=t[5]),128&i[0]&&(r.uppercase=t[7]),512&i[0]&&(r.forcestring=t[9]),4096&i[0]&&(r.tooltip=t[12]),8192&i[0]&&(r.valid=t[13]),256&i[0]&&(r.autosize=t[8]),16384&i[0]&&(r.error=t[14]),32768&i[0]&&(r.sm=t[15]),64&i[0]&&(r.showcod=t[6]),2048&i[0]&&(r.noborder=t[11]),65536&i[0]&&(r.truevalue=t[16]),262144&i[0]&&(r.falsevalue=t[18]),524288&i[0]&&(r.type=t[19]),1048576&i[0]&&(r.decimali=t[20]),131072&i[0]&&(r.maxlength=t[17]),2097152&i[0]&&(r.rows=t[21]),4194304&i[0]&&(r.coeff=t[22]),8388608&i[0]&&(r.disabled=t[23]),16777216&i[0]&&(r.readonly=t[24]),524288&i[0]|1&i[1]&&(r.$$scope={dirty:i,ctx:t}),!n&&1&i[0]&&(n=!0,r.value=t[0],Y(()=>n=!1)),e.$set(r)},i(t){i||(w(e.$$.fragment,t),i=!0)},o(t){m(e.$$.fragment,t),i=!1},d(t){T(e,t)}}}function Nl(t){let e;const n=t[26].default,i=p(n,t,t[31],null);return{c(){i&&i.c()},m(t,n){i&&i.m(t,n),e=!0},p(t,r){i&&i.p&&(!e||1&r[1])&&g(i,n,t,t[31],e?x(n,t[31],r,null):v(t[31]),null)},i(t){e||(w(i,t),e=!0)},o(t){m(i,t),e=!1},d(t){i&&i.d(t)}}}function Ol(t){let e,n,i,r,o,s,a,f,h,p=t[1]&&!t[4]&&El(t),b=t[1]&&t[4]&&jl(t);s=new xr({props:{tooltip:t[12],$$slots:{default:[Tl]},$$scope:{ctx:t}}});let g="slot"!=t[19]&&Nl(t);return{c(){e=d("div"),p&&p.c(),n=_(),i=d("div"),b&&b.c(),r=_(),o=d("div"),F(s.$$.fragment),a=_(),g&&g.c(),c(o,"class","flex-1"),c(i,"class","flexrow w-full space-x-1 items-center"),c(e,"class",f=`labinput ${t[25].class||""}`)},m(t,l){u(t,e,l),p&&p.m(e,null),k(e,n),k(e,i),b&&b.m(i,null),k(i,r),k(i,o),N(s,o,null),k(i,a),g&&g.m(i,null),h=!0},p(t,o){t[1]&&!t[4]?p?(p.p(t,o),18&o[0]&&w(p,1)):(p=El(t),p.c(),w(p,1),p.m(e,n)):p&&(z(),m(p,1,1,()=>{p=null}),M()),t[1]&&t[4]?b?(b.p(t,o),18&o[0]&&w(b,1)):(b=jl(t),b.c(),w(b,1),b.m(i,r)):b&&(z(),m(b,1,1,()=>{b=null}),M());const l={};4096&o[0]&&(l.tooltip=t[12]),33554409&o[0]|1&o[1]&&(l.$$scope={dirty:o,ctx:t}),s.$set(l),"slot"!=t[19]?g?(g.p(t,o),524288&o[0]&&w(g,1)):(g=Nl(t),g.c(),w(g,1),g.m(i,null)):g&&(z(),m(g,1,1,()=>{g=null}),M()),(!h||33554432&o[0]&&f!==(f=`labinput ${t[25].class||""}`))&&c(e,"class",f)},i(t){h||(w(p),w(b),w(s.$$.fragment,t),w(g),h=!0)},o(t){m(p),m(b),m(s.$$.fragment,t),m(g),h=!1},d(t){t&&l(e),p&&p.d(),b&&b.d(),T(s),g&&g.d()}}}function Fl(t,e,n){let{$$slots:o={},$$scope:l}=e;const{_:s}=fr();let{value:c="",label:a="",labelleft:u=!1,placeholder:f="",oriz:d=!1,onlycod:h=!1,showcod:p=!1,uppercase:m=!1,autosize:w,forcestring:b=!1,options:g,noborder:v=!1,tooltip:x="",valid:y=!1,error:k=!1,sm:$=!1,truevalue:_=1,maxlength:D,falsevalue:S=0,type:z="text",decimali:M=2,rows:E=5,coeff:j=1,disabled:A=!1,readonly:C=!1}=e;return t.$$set=t=>{n(25,e=i(i({},e),r(t))),"value"in t&&n(0,c=t.value),"label"in t&&n(1,a=t.label),"labelleft"in t&&n(2,u=t.labelleft),"placeholder"in t&&n(3,f=t.placeholder),"oriz"in t&&n(4,d=t.oriz),"onlycod"in t&&n(5,h=t.onlycod),"showcod"in t&&n(6,p=t.showcod),"uppercase"in t&&n(7,m=t.uppercase),"autosize"in t&&n(8,w=t.autosize),"forcestring"in t&&n(9,b=t.forcestring),"options"in t&&n(10,g=t.options),"noborder"in t&&n(11,v=t.noborder),"tooltip"in t&&n(12,x=t.tooltip),"valid"in t&&n(13,y=t.valid),"error"in t&&n(14,k=t.error),"sm"in t&&n(15,$=t.sm),"truevalue"in t&&n(16,_=t.truevalue),"maxlength"in t&&n(17,D=t.maxlength),"falsevalue"in t&&n(18,S=t.falsevalue),"type"in t&&n(19,z=t.type),"decimali"in t&&n(20,M=t.decimali),"rows"in t&&n(21,E=t.rows),"coeff"in t&&n(22,j=t.coeff),"disabled"in t&&n(23,A=t.disabled),"readonly"in t&&n(24,C=t.readonly),"$$scope"in t&&n(31,l=t.$$scope)},t.$$.update=()=>{t.$$.dirty[0]},e=r(e),[c,a,u,f,d,h,p,m,w,b,g,v,x,y,k,$,_,D,S,z,M,E,j,A,C,e,o,function(t){c=t,n(0,c)},function(e){V.call(this,t,e)},function(e){V.call(this,t,e)},function(e){V.call(this,t,e)},l]}class Il extends t{constructor(t){super(),e(this,t,Fl,Ol,n,{value:0,label:1,labelleft:2,placeholder:3,oriz:4,onlycod:5,showcod:6,uppercase:7,autosize:8,forcestring:9,options:10,noborder:11,tooltip:12,valid:13,error:14,sm:15,truevalue:16,maxlength:17,falsevalue:18,type:19,decimali:20,rows:21,coeff:22,disabled:23,readonly:24},null,[-1,-1])}}const Rl=t=>({}),Ll=t=>({});function Bl(t){let e,n,i,r,o,a,h,p,b,g,v,x,y=t[5]&&Hl(t),$=(t[1]||t[7]||t[8])&&Pl(t);const D=[Vl,Ul],S=[];function E(t,e){return t[8]||t[7]?0:1}return h=E(t),p=S[h]=D[h](t),{c(){e=d("div"),n=d("button"),i=_(),r=d("button"),y&&y.c(),o=_(),$&&$.c(),a=_(),p.c(),c(n,"aria-label","msg_bg"),c(n,"class","msg_bg"),c(r,"class",t[15]),c(r,"style",t[14]),c(e,"class","msg_contenitore")},m(l,s){u(l,e,s),k(e,n),k(e,i),k(e,r),y&&y.m(r,null),k(r,o),$&&$.m(r,null),k(r,a),S[h].m(r,null),t[38](r),g=!0,v||(x=[f(n,"click",t[21]),f(r,"introend",t[39]),f(r,"click",t[40])],v=!0)},p(e,n){(t=e)[5]?y?(y.p(t,n),32&n[0]&&w(y,1)):(y=Hl(t),y.c(),w(y,1),y.m(r,o)):y&&(z(),m(y,1,1,()=>{y=null}),M()),t[1]||t[7]||t[8]?$?($.p(t,n),386&n[0]&&w($,1)):($=Pl(t),$.c(),w($,1),$.m(r,a)):$&&(z(),m($,1,1,()=>{$=null}),M());let i=h;h=E(t),h===i?S[h].p(t,n):(z(),m(S[i],1,1,()=>{S[i]=null}),M(),p=S[h],p?p.p(t,n):(p=S[h]=D[h](t),p.c()),w(p,1),p.m(r,null)),(!g||32768&n[0])&&c(r,"class",t[15]),(!g||16384&n[0])&&c(r,"style",t[14])},i(e){g||(w(y),w($),w(p),e&&j(()=>{g&&(b||(b=L(r,nt,t[9]?{x:-300,duration:400}:t[10]?{x:300,duration:400}:{y:200,duration:400},!0)),b.run(1))}),g=!0)},o(e){m(y),m($),m(p),e&&(b||(b=L(r,nt,t[9]?{x:-300,duration:400}:t[10]?{x:300,duration:400}:{y:200,duration:400},!1)),b.run(0)),g=!1},d(n){n&&l(e),y&&y.d(),$&&$.d(),S[h].d(),t[38](null),n&&b&&b.end(),v=!1,s(x)}}}function Hl(t){let e,n,i;return n=new Dr({props:{img:"close",gray:!0,size:6}}),n.$on("click",t[21]),{c(){e=d("div"),F(n.$$.fragment),c(e,"class","absolute top-2 right-1")},m(t,r){u(t,e,r),N(n,e,null),i=!0},p:o,i(t){i||(w(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&l(e),T(n)}}}function Pl(t){let e,n,i,r,o,a;return n=new Ar({props:{id:t[1]||""}}),{c(){e=d("button"),F(n.$$.fragment),c(e,"class",i="w-full py-2 px-4 text-left "+t[13]+" text-xl text-header")},m(i,l){u(i,e,l),N(n,e,null),r=!0,o||(a=[f(e,"mousedown",t[18]),f(e,"mousemove",t[19]),f(e,"mouseleave",t[20]),f(e,"mouseup",t[20])],o=!0)},p(t,o){const l={};2&o[0]&&(l.id=t[1]||""),n.$set(l),(!r||8192&o[0]&&i!==(i="w-full py-2 px-4 text-left "+t[13]+" text-xl text-header"))&&c(e,"class",i)},i(t){r||(w(n.$$.fragment,t),r=!0)},o(t){m(n.$$.fragment,t),r=!1},d(t){t&&l(e),T(n),o=!1,s(a)}}}function Ul(t){let e,n,i;const r=t[33].default,o=p(r,t,t[41],null),s=o||function(t){let e,n,i;return n=new Ar({props:{id:t[2],html:!0}}),{c(){e=d("div"),F(n.$$.fragment),c(e,"class","p-2 flex flex-col space-y-2")},m(t,r){u(t,e,r),N(n,e,null),i=!0},p(t,e){const i={};4&e[0]&&(i.id=t[2]),n.$set(i)},i(t){i||(w(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&l(e),T(n)}}}(t);let a=t[16]&&Zl(t);return{c(){s&&s.c(),e=_(),a&&a.c(),n=S()},m(t,r){s&&s.m(t,r),u(t,e,r),a&&a.m(t,r),u(t,n,r),i=!0},p(t,e){o?o.p&&(!i||1024&e[1])&&g(o,r,t,t[41],i?x(r,t[41],e,null):v(t[41]),null):s&&s.p&&(!i||4&e[0])&&s.p(t,i?e:[-1,-1]),t[16]?a?(a.p(t,e),65536&e[0]&&w(a,1)):(a=Zl(t),a.c(),w(a,1),a.m(n.parentNode,n)):a&&(z(),m(a,1,1,()=>{a=null}),M())},i(t){i||(w(s,t),w(a),i=!0)},o(t){m(s,t),m(a),i=!1},d(t){t&&(l(e),l(n)),s&&s.d(t),a&&a.d(t)}}}function Vl(t){let e,n,i,r,o=!t[6]&&Ql(t);const s=t[33].default,a=p(s,t,t[41],null);return{c(){o&&o.c(),e=_(),n=d("div"),a&&a.c(),c(n,"class",i="h-full bg-white overflow-y-auto "+(t[22].class||""))},m(t,i){o&&o.m(t,i),u(t,e,i),u(t,n,i),a&&a.m(n,null),r=!0},p(t,l){t[6]?o&&(z(),m(o,1,1,()=>{o=null}),M()):o?(o.p(t,l),64&l[0]&&w(o,1)):(o=Ql(t),o.c(),w(o,1),o.m(e.parentNode,e)),a&&a.p&&(!r||1024&l[1])&&g(a,s,t,t[41],r?x(s,t[41],l,null):v(t[41]),null),(!r||4194304&l[0]&&i!==(i="h-full bg-white overflow-y-auto "+(t[22].class||"")))&&c(n,"class",i)},i(t){r||(w(o),w(a,t),r=!0)},o(t){m(o),m(a,t),r=!1},d(t){t&&(l(e),l(n)),o&&o.d(t),a&&a.d(t)}}}function Zl(t){let e,n,i,r;const o=[ql,Yl],s=[];function a(t,e){return t[3]||t[4]?0:1}return n=a(t),i=s[n]=o[n](t),{c(){e=d("div"),i.c(),c(e,"class","flexrow w-full space-x-2 p-4")},m(t,i){u(t,e,i),s[n].m(e,null),r=!0},p(t,r){let l=n;n=a(t),n===l?s[n].p(t,r):(z(),m(s[l],1,1,()=>{s[l]=null}),M(),i=s[n],i?i.p(t,r):(i=s[n]=o[n](t),i.c()),w(i,1),i.m(e,null))},i(t){r||(w(i),r=!0)},o(t){m(i),r=!1},d(t){t&&l(e),s[n].d()}}}function Yl(t){let e,n,i,r,o,s;return o=new Qr({props:{danger:t[11],$$slots:{default:[Gl]},$$scope:{ctx:t}}}),o.$on("click",t[37]),{c(){e=d("div"),n=_(),i=d("div"),r=_(),F(o.$$.fragment),c(e,"class","flex-1"),c(i,"class","flex-1")},m(t,l){u(t,e,l),u(t,n,l),u(t,i,l),u(t,r,l),N(o,t,l),s=!0},p(t,e){const n={};2048&e[0]&&(n.danger=t[11]),1024&e[1]&&(n.$$scope={dirty:e,ctx:t}),o.$set(n)},i(t){s||(w(o.$$.fragment,t),s=!0)},o(t){m(o.$$.fragment,t),s=!1},d(t){t&&(l(e),l(n),l(i),l(r)),T(o,t)}}}function ql(t){let e,n,i,r,o,s,a;e=new Qr({props:{alt:!0,$$slots:{default:[Xl]},$$scope:{ctx:t}}}),e.$on("click",t[34]);let f=t[4]&&Wl(t);return s=new Qr({props:{danger:t[11],$$slots:{default:[Jl]},$$scope:{ctx:t}}}),s.$on("click",t[36]),{c(){F(e.$$.fragment),n=_(),i=d("div"),r=_(),f&&f.c(),o=_(),F(s.$$.fragment),c(i,"class","flex-1")},m(t,l){N(e,t,l),u(t,n,l),u(t,i,l),u(t,r,l),f&&f.m(t,l),u(t,o,l),N(s,t,l),a=!0},p(t,n){const i={};1024&n[1]&&(i.$$scope={dirty:n,ctx:t}),e.$set(i),t[4]?f?(f.p(t,n),16&n[0]&&w(f,1)):(f=Wl(t),f.c(),w(f,1),f.m(o.parentNode,o)):f&&(z(),m(f,1,1,()=>{f=null}),M());const r={};2048&n[0]&&(r.danger=t[11]),1024&n[1]&&(r.$$scope={dirty:n,ctx:t}),s.$set(r)},i(t){a||(w(e.$$.fragment,t),w(f),w(s.$$.fragment,t),a=!0)},o(t){m(e.$$.fragment,t),m(f),m(s.$$.fragment,t),a=!1},d(t){t&&(l(n),l(i),l(r),l(o)),T(e,t),f&&f.d(t),T(s,t)}}}function Gl(t){let e,n;return e=new Ar({props:{id:"ok"}}),{c(){F(e.$$.fragment)},m(t,i){N(e,t,i),n=!0},p:o,i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){T(e,t)}}}function Xl(t){let e,n;return e=new Ar({props:{id:"no"}}),{c(){F(e.$$.fragment)},m(t,i){N(e,t,i),n=!0},p:o,i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){T(e,t)}}}function Wl(t){let e,n;return e=new Qr({props:{alt:!0,$$slots:{default:[Kl]},$$scope:{ctx:t}}}),e.$on("click",t[35]),{c(){F(e.$$.fragment)},m(t,i){N(e,t,i),n=!0},p(t,n){const i={};1024&n[1]&&(i.$$scope={dirty:n,ctx:t}),e.$set(i)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){T(e,t)}}}function Kl(t){let e,n;return e=new Ar({props:{id:"cancella"}}),{c(){F(e.$$.fragment)},m(t,i){N(e,t,i),n=!0},p:o,i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){T(e,t)}}}function Jl(t){let e,n;return e=new Ar({props:{id:"si"}}),{c(){F(e.$$.fragment)},m(t,i){N(e,t,i),n=!0},p:o,i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){T(e,t)}}}function Ql(t){let e,n;const i=t[33].Footer,r=p(i,t,t[41],Ll),o=r||function(){let t;return{c(){t=$("footer")},m(e,n){u(e,t,n)},d(e){e&&l(t)}}}();return{c(){e=d("div"),o&&o.c(),c(e,"class","outline-c-100 bg-c-group border-t p-2")},m(t,i){u(t,e,i),o&&o.m(e,null),n=!0},p(t,e){r&&r.p&&(!n||1024&e[1])&&g(r,i,t,t[41],n?x(i,t[41],e,Rl):v(t[41]),Ll)},i(t){n||(w(o,t),n=!0)},o(t){m(o,t),n=!1},d(t){t&&l(e),o&&o.d(t)}}}function ts(t){let e,n,i=t[0]&&Bl(t);return{c(){i&&i.c(),e=S()},m(t,r){i&&i.m(t,r),u(t,e,r),n=!0},p(t,n){t[0]?i?(i.p(t,n),1&n[0]&&w(i,1)):(i=Bl(t),i.c(),w(i,1),i.m(e.parentNode,e)):i&&(z(),m(i,1,1,()=>{i=null}),M())},i(t){n||(w(i),n=!0)},o(t){m(i),n=!1},d(t){t&&l(e),i&&i.d(t)}}}function es(t,e,n){let o,l,s,c,{$$slots:a={},$$scope:u}=e;const{autofocus:f}=fr();let{show:d=!1,title:p="",text:m="",yesno:w=!1,yesnocancel:b=!1,noscroll:g=!1,close:v=!1,ok:x=!1,nofooter:y=!1,xl:k,screen:$,wfull:_,hfull:D,left:S,right:z,warning:M=!1,danger:E=!1,elexpand:j}=e;const A=W();var C,T,N=0,O=0,F=0,I=0,R=!1;function L(t){R&&(n(31,F=t.x-C),n(32,I=t.y-T))}function B(t){R&&(R=!1,n(29,N+=F),n(30,O+=I),n(31,F=0),n(32,I=0),window.removeEventListener("mousemove",L),window.removeEventListener("mouseup",B))}function H(t){A("close",t),A("click",t)}let P;return t.$$set=t=>{n(22,e=i(i({},e),r(t))),"show"in t&&n(0,d=t.show),"title"in t&&n(1,p=t.title),"text"in t&&n(2,m=t.text),"yesno"in t&&n(3,w=t.yesno),"yesnocancel"in t&&n(4,b=t.yesnocancel),"noscroll"in t&&n(23,g=t.noscroll),"close"in t&&n(5,v=t.close),"ok"in t&&n(24,x=t.ok),"nofooter"in t&&n(6,y=t.nofooter),"xl"in t&&n(25,k=t.xl),"screen"in t&&n(7,$=t.screen),"wfull"in t&&n(26,_=t.wfull),"hfull"in t&&n(8,D=t.hfull),"left"in t&&n(9,S=t.left),"right"in t&&n(10,z=t.right),"warning"in t&&n(27,M=t.warning),"danger"in t&&n(11,E=t.danger),"elexpand"in t&&n(28,j=t.elexpand),"$$scope"in t&&n(41,u=t.$$scope)},t.$$.update=()=>{4097&t.$$.dirty[0]&&(n(29,N=0),n(30,O=0),n(31,F=0),n(32,I=0),R=!1,f(d,P),n(29,N=0),n(30,O=0),n(31,F=0),n(32,I=0),R=!1),16777240&t.$$.dirty[0]&&n(16,o=x||w||b),100663680&t.$$.dirty[0]&&n(15,l=function(){if(!j||!j.getBoundingClientRect){var t="max-w-lg";if(k){var e=parseInt(k);t=e>1&&e<9?`max-w-${e}xl`:"max-w-xl"}return(_||$)&&(t="w-screen"),`relative overflow-x-hidden msg_msg ${t} ${S?"mr-auto":z?"ml-auto":"mx-auto"} \n ${_||D||$?"":"rounded-md"} \n ${D||$?y?"h-screen grid grid-rows-[auto_1fr]":"h-screen grid grid-rows-[auto_auto_1fr]":""} \n ${g||$||D?"overflow-y-hidden":"overflow-y-auto"}`}}()),1610613120&t.$$.dirty[0]|3&t.$$.dirty[1]&&n(14,s=function(){let t;if(j&&j.getBoundingClientRect){let e=j.getBoundingClientRect();return t=`position: fixed; top: ${e.top}px; left:${e.left}px; width: ${e.width}px; height: ${e.height}px;zIndex: 1000`,t}return t=N+F||O+I?`transform: translate(${N+F}px , ${O+I}px); `:"",($||D)&&(t=`${t} height: ${D&&D>=20&&D<100?D+"vh":"100vh"};`),t}()),134219776&t.$$.dirty[0]&&n(13,c=E?"bg-c-danger":M?"bg-c-warning":"bg-headerbg")},e=r(e),[d,p,m,w,b,v,y,$,D,S,z,E,P,c,s,l,o,A,function(t){$||_||D||(C=t.x,T=t.y,R=!0,window.addEventListener("mousemove",L),window.addEventListener("mouseup",B))},L,B,H,e,g,x,k,_,M,j,N,O,F,I,a,()=>H("no"),()=>H("cancel"),()=>H("yes"),()=>H("yes"),function(t){h[t?"unshift":"push"](()=>{P=t,n(12,P)})},()=>A("loaded"),t=>{o&&(t.preventDefault(),t.stopPropagation())},u]}class ns extends t{constructor(t){super(),e(this,t,es,ts,n,{show:0,title:1,text:2,yesno:3,yesnocancel:4,noscroll:23,close:5,ok:24,nofooter:6,xl:25,screen:7,wfull:26,hfull:8,left:9,right:10,warning:27,danger:11,elexpand:28},null,[-1,-1])}}function is(t,e,n){const i=t.slice();return i[101]=e[n],i}function rs(t,e,n){const i=t.slice();return i[104]=e[n],i[105]=e,i[106]=n,i}function os(t,e,n){const i=t.slice();return i[107]=e[n],i[108]=e,i[106]=n,i}function ls(t,e,n){const i=t.slice();return i[109]=e[n],i}const ss=t=>({bt:1048576&t[0],x:4&t[0]}),cs=t=>({bt:t[109],x:t[107],row:t[106]});function as(t,e,n){const i=t.slice();return i[104]=e[n],i}const us=t=>({f:64&t[1],x:4&t[0]}),fs=t=>({f:t[104],x:t[107],row:t[106]});function ds(t,e,n){const i=t.slice();return i[104]=e[n],i[114]=e,i[115]=n,i}function hs(t,e,n){const i=t.slice();return i[104]=e[n],i}const ps=t=>({}),ms=t=>({}),ws=t=>({}),bs=t=>({}),gs=t=>({}),vs=t=>({}),xs=t=>({}),ys=t=>({});function ks(t){let e,n,i,r,o,s,a,f,p,b,g;const v=[_s,$s],x=[];function y(t,e){return t[8]?0:1}n=y(t),i=x[n]=v[n](t);let $=open&&function(t){let e,n,i,r;const o=[Ns,Ts],s=[];function c(t,e){return 2==t[1]?0:1}return e=c(t),n=s[e]=o[e](t),{c(){n.c(),i=S()},m(t,n){s[e].m(t,n),u(t,i,n),r=!0},p(t,r){let l=e;e=c(t),e===l?s[e].p(t,r):(z(),m(s[l],1,1,()=>{s[l]=null}),M(),n=s[e],n?n.p(t,r):(n=s[e]=o[e](t),n.c()),w(n,1),n.m(i.parentNode,i))},i(t){r||(w(n),r=!0)},o(t){m(n),r=!1},d(t){t&&l(i),s[e].d(t)}}}(t);function D(e){t[88](e)}a=new ns({props:{show:t[32],xl:2,title:"Dettaglio",close:!0,$$slots:{default:[wc]},$$scope:{ctx:t}}}),a.$on("close",t[47]);let E={element:t[29],$$slots:{default:[yc]},$$scope:{ctx:t}};return void 0!==t[30]&&(E.show=t[30]),p=new qr({props:E}),h.push(()=>Z(p,"show",D)),{c(){e=d("div"),i.c(),r=_(),$&&$.c(),s=_(),F(a.$$.fragment),f=_(),F(p.$$.fragment),c(e,"class",o=t[53].class||"")},m(t,i){u(t,e,i),x[n].m(e,null),k(e,r),$&&$.m(e,null),u(t,s,i),N(a,t,i),u(t,f,i),N(p,t,i),g=!0},p(t,l){let s=n;n=y(t),n===s?x[n].p(t,l):(z(),m(x[s],1,1,()=>{x[s]=null}),M(),i=x[n],i?i.p(t,l):(i=x[n]=v[n](t),i.c()),w(i,1),i.m(e,r)),open&&$.p(t,l),(!g||4194304&l[1]&&o!==(o=t[53].class||""))&&c(e,"class",o);const u={};2&l[1]&&(u.show=t[32]),10485761&l[0]|514&l[1]|134217728&l[2]&&(u.$$scope={dirty:l,ctx:t}),a.$set(u);const f={};536870912&l[0]&&(f.element=t[29]),1610612736&l[0]|1&l[1]|134217728&l[2]&&(f.$$scope={dirty:l,ctx:t}),!b&&1073741824&l[0]&&(b=!0,f.show=t[30],Y(()=>b=!1)),p.$set(f)},i(t){g||(w(i),w($),w(a.$$.fragment,t),w(p.$$.fragment,t),g=!0)},o(t){m(i),m($),m(a.$$.fragment,t),m(p.$$.fragment,t),g=!1},d(t){t&&(l(e),l(s),l(f)),x[n].d(),$&&$.d(),T(a,t),T(p,t)}}}function $s(t){let e,n;return e=new xr({props:{tooltip:t[10],left:!0,bottom:!0,$$slots:{default:[Cs]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(t,i){N(e,t,i),n=!0},p(t,n){const i={};1024&n[0]&&(i.tooltip=t[10]),407773315&n[0]|128&n[1]|134217728&n[2]&&(i.$$scope={dirty:n,ctx:t}),e.$set(i)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){T(e,t)}}}function _s(t){let e;const n=t[59].default,i=p(n,t,t[89],null);return{c(){i&&i.c()},m(t,n){i&&i.m(t,n),e=!0},p(t,r){i&&i.p&&(!e||134217728&r[2])&&g(i,n,t,t[89],e?x(n,t[89],r,null):v(t[89]),null)},i(t){e||(w(i,t),e=!0)},o(t){m(i,t),e=!1},d(t){i&&i.d(t)}}}function Ds(t){let e,n,i;return n=new Dr({props:{white:!0,img:1==t[1]?"grid_view":"list",mat:!0,size:6}}),n.$on("click",t[60]),{c(){e=d("div"),F(n.$$.fragment)},m(t,r){u(t,e,r),N(n,e,null),i=!0},p(t,e){const i={};2&e[0]&&(i.img=1==t[1]?"grid_view":"list"),n.$set(i)},i(t){i||(w(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&l(e),T(n)}}}function Ss(t){let e,n,i,r;function o(e){t[61](e)}let s={sm:!0};return void 0!==t[27]&&(s.value=t[27]),n=new lo({props:s}),h.push(()=>Z(n,"value",o)),n.$on("input",t[62]),n.$on("click",t[63]),{c(){e=d("div"),F(n.$$.fragment),c(e,"class","px-2 flex-1 md:w-64")},m(t,i){u(t,e,i),N(n,e,null),r=!0},p(t,e){const r={};!i&&134217728&e[0]&&(i=!0,r.value=t[27],Y(()=>i=!1)),n.$set(r)},i(t){r||(w(n.$$.fragment,t),r=!0)},o(t){m(n.$$.fragment,t),r=!1},d(t){t&&l(e),T(n)}}}function zs(t){let e,n,i;return n=new Dr({props:{alt:!0,img:"content_copy",mat:!0,size:6,tooltip:"Copia dati su clipboard (CSV)"}}),n.$on("click",t[64]),{c(){e=d("div"),F(n.$$.fragment),c(e,"class","h-6 w-6")},m(t,r){u(t,e,r),N(n,e,null),i=!0},p:o,i(t){i||(w(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&l(e),T(n)}}}function Ms(t){let e,n,i;return n=new Dr({props:{alt:!0,img:"file_download",mat:!0,size:6,tooltip:"string"==typeof t[18]?t[18]:"export tabella"}}),n.$on("click",t[65]),{c(){e=d("div"),F(n.$$.fragment),c(e,"class","h-6 w-6")},m(t,r){u(t,e,r),N(n,e,null),i=!0},p(t,e){const i={};262144&e[0]&&(i.tooltip="string"==typeof t[18]?t[18]:"export tabella"),n.$set(i)},i(t){i||(w(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&l(e),T(n)}}}function Es(t){let e,n,i;return n=new Dr({props:{alt:!0,img:"file_upload",mat:!0,size:6,tooltip:"string"==typeof t[19]?t[19]:"import tabella"}}),n.$on("click",t[66]),{c(){e=d("div"),F(n.$$.fragment),c(e,"class","h-6 w-6")},m(t,r){u(t,e,r),N(n,e,null),i=!0},p(t,e){const i={};524288&e[0]&&(i.tooltip="string"==typeof t[19]?t[19]:"import tabella"),n.$set(i)},i(t){i||(w(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&l(e),T(n)}}}function js(t){let e,n,i;return n=new Dr({props:{size:6,img:t[28]?"filter_alt_off":"filter_alt"}}),n.$on("click",t[67]),{c(){e=d("div"),F(n.$$.fragment),c(e,"class","h-6")},m(t,r){u(t,e,r),N(n,e,null),i=!0},p(t,e){const i={};268435456&e[0]&&(i.img=t[28]?"filter_alt_off":"filter_alt"),n.$set(i)},i(t){i||(w(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&l(e),T(n)}}}function As(t){let e,n;const i=t[59].btnadd,r=p(i,t,t[89],bs),s=r||function(t){let e,n;return e=new Dr({props:{size:6,img:"add"}}),e.$on("click",t[68]),{c(){F(e.$$.fragment)},m(t,i){N(e,t,i),n=!0},p:o,i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){T(e,t)}}}(t);return{c(){e=d("div"),s&&s.c(),c(e,"class","w-6 h-6")},m(t,i){u(t,e,i),s&&s.m(e,null),n=!0},p(t,e){r&&r.p&&(!n||134217728&e[2])&&g(r,i,t,t[89],n?x(i,t[89],e,ws):v(t[89]),bs)},i(t){n||(w(s,t),n=!0)},o(t){m(s,t),n=!1},d(t){t&&l(e),s&&s.d(t)}}}function Cs(t){let e,n,i,r,o,s,a,f,h,b,y,$=t[1]&&Ds(t);const D=t[59].title,S=p(D,t,t[89],ys),E=S||function(t){let e,n,i;return n=new Ar({props:{id:t[22]}}),{c(){e=d("div"),F(n.$$.fragment),c(e,"class","hidden px-2 md:block flex-1 text-xs md:text-sm text-left font-bold uppercase")},m(t,r){u(t,e,r),N(n,e,null),i=!0},p(t,e){const i={};4194304&e[0]&&(i.id=t[22]),n.$set(i)},i(t){i||(w(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&l(e),T(n)}}}(t),j=t[59].default,A=p(j,t,t[89],null);let C=!t[7]&&Ss(t),O=t[17]&&zs(t),I=t[18]&&Ms(t),R=t[19]&&Es(t),L=!t[13]&&js(t);const B=t[59].btntitle,H=p(B,t,t[89],vs);let P=t[38]&&As(t);return{c(){e=d("button"),$&&$.c(),n=_(),E&&E.c(),i=_(),A&&A.c(),r=_(),C&&C.c(),o=_(),O&&O.c(),s=_(),I&&I.c(),a=_(),R&&R.c(),f=_(),L&&L.c(),h=_(),H&&H.c(),b=_(),P&&P.c(),c(e,"class","titolo items-center")},m(t,l){u(t,e,l),$&&$.m(e,null),k(e,n),E&&E.m(e,null),k(e,i),A&&A.m(e,null),k(e,r),C&&C.m(e,null),k(e,o),O&&O.m(e,null),k(e,s),I&&I.m(e,null),k(e,a),R&&R.m(e,null),k(e,f),L&&L.m(e,null),k(e,h),H&&H.m(e,null),k(e,b),P&&P.m(e,null),y=!0},p(t,i){t[1]?$?($.p(t,i),2&i[0]&&w($,1)):($=Ds(t),$.c(),w($,1),$.m(e,n)):$&&(z(),m($,1,1,()=>{$=null}),M()),S?S.p&&(!y||134217728&i[2])&&g(S,D,t,t[89],y?x(D,t[89],i,xs):v(t[89]),ys):E&&E.p&&(!y||4194304&i[0])&&E.p(t,y?i:[-1,-1,-1,-1]),A&&A.p&&(!y||134217728&i[2])&&g(A,j,t,t[89],y?x(j,t[89],i,null):v(t[89]),null),t[7]?C&&(z(),m(C,1,1,()=>{C=null}),M()):C?(C.p(t,i),128&i[0]&&w(C,1)):(C=Ss(t),C.c(),w(C,1),C.m(e,o)),t[17]?O?(O.p(t,i),131072&i[0]&&w(O,1)):(O=zs(t),O.c(),w(O,1),O.m(e,s)):O&&(z(),m(O,1,1,()=>{O=null}),M()),t[18]?I?(I.p(t,i),262144&i[0]&&w(I,1)):(I=Ms(t),I.c(),w(I,1),I.m(e,a)):I&&(z(),m(I,1,1,()=>{I=null}),M()),t[19]?R?(R.p(t,i),524288&i[0]&&w(R,1)):(R=Es(t),R.c(),w(R,1),R.m(e,f)):R&&(z(),m(R,1,1,()=>{R=null}),M()),t[13]?L&&(z(),m(L,1,1,()=>{L=null}),M()):L?(L.p(t,i),8192&i[0]&&w(L,1)):(L=js(t),L.c(),w(L,1),L.m(e,h)),H&&H.p&&(!y||134217728&i[2])&&g(H,B,t,t[89],y?x(B,t[89],i,gs):v(t[89]),vs),t[38]?P?(P.p(t,i),128&i[1]&&w(P,1)):(P=As(t),P.c(),w(P,1),P.m(e,null)):P&&(z(),m(P,1,1,()=>{P=null}),M())},i(t){y||(w($),w(E,t),w(A,t),w(C),w(O),w(I),w(R),w(L),w(H,t),w(P),y=!0)},o(t){m($),m(E,t),m(A,t),m(C),m(O),m(I),m(R),m(L),m(H,t),m(P),y=!1},d(t){t&&l(e),$&&$.d(),E&&E.d(t),A&&A.d(t),C&&C.d(),O&&O.d(),I&&I.d(),R&&R.d(),L&&L.d(),H&&H.d(t),P&&P.d()}}}function Ts(t){let e,n,i,r,o,s,a,h,p,b,g,v,x,y=t[15]&&Os(),$=t[16]&&Fs(t),D=B(t[37]),S=[];for(let e=0;e<D.length;e+=1)S[e]=Bs(hs(t,D,e));const E=t=>m(S[t],1,1,()=>{S[t]=null});let j=t[36]&&Hs(t),A=!t[13]&&t[28]&&t[0]&&Ps(t),C=B(t[2]),T=[];for(let e=0;e<C.length;e+=1)T[e]=fc(os(t,C,e));const N=t=>m(T[t],1,1,()=>{T[t]=null});return{c(){e=d("div"),n=d("table"),i=d("thead"),r=d("tr"),y&&y.c(),o=_(),$&&$.c(),s=_();for(let t=0;t<S.length;t+=1)S[t].c();a=_(),j&&j.c(),h=_(),A&&A.c(),p=_(),b=d("tbody");for(let t=0;t<T.length;t+=1)T[t].c();c(n,"class","table text-sm sm"),c(e,"class","relative w-full overflow-auto")},m(l,c){u(l,e,c),k(e,n),k(n,i),k(i,r),y&&y.m(r,null),k(r,o),$&&$.m(r,null),k(r,s);for(let t=0;t<S.length;t+=1)S[t]&&S[t].m(r,null);k(r,a),j&&j.m(r,null),k(i,h),A&&A.m(i,null),k(n,p),k(n,b);for(let t=0;t<T.length;t+=1)T[t]&&T[t].m(b,null);g=!0,v||(x=f(n,"mouseleave",t[83]),v=!0)},p(t,e){if(t[15]?y||(y=Os(),y.c(),y.m(r,o)):y&&(y.d(1),y=null),t[16]?$?($.p(t,e),65536&e[0]&&w($,1)):($=Fs(t),$.c(),w($,1),$.m(r,s)):$&&(z(),m($,1,1,()=>{$=null}),M()),24&e[0]|4160&e[1]){let n;for(D=B(t[37]),n=0;n<D.length;n+=1){const i=hs(t,D,n);S[n]?(S[n].p(i,e),w(S[n],1)):(S[n]=Bs(i),S[n].c(),w(S[n],1),S[n].m(r,a))}for(z(),n=D.length;n<S.length;n+=1)E(n);M()}if(t[36]?j?(j.p(t,e),32&e[1]&&w(j,1)):(j=Hs(t),j.c(),w(j,1),j.m(r,null)):j&&(z(),m(j,1,1,()=>{j=null}),M()),!t[13]&&t[28]&&t[0]?A?(A.p(t,e),268443649&e[0]&&w(A,1)):(A=Ps(t),A.c(),w(A,1),A.m(i,null)):A&&(z(),m(A,1,1,()=>{A=null}),M()),1729223268&e[0]|4075645&e[1]|134217728&e[2]){let n;for(C=B(t[2]),n=0;n<C.length;n+=1){const i=os(t,C,n);T[n]?(T[n].p(i,e),w(T[n],1)):(T[n]=fc(i),T[n].c(),w(T[n],1),T[n].m(b,null))}for(z(),n=C.length;n<T.length;n+=1)N(n);M()}},i(t){if(!g){w($);for(let t=0;t<D.length;t+=1)w(S[t]);w(j),w(A);for(let t=0;t<C.length;t+=1)w(T[t]);g=!0}},o(t){m($),S=S.filter(Boolean);for(let t=0;t<S.length;t+=1)m(S[t]);m(j),m(A),T=T.filter(Boolean);for(let t=0;t<T.length;t+=1)m(T[t]);g=!1},d(t){t&&l(e),y&&y.d(),$&&$.d(),H(S,t),j&&j.d(),A&&A.d(),H(T,t),v=!1,x()}}}function Ns(t){let e;const n=t[59].grid,i=p(n,t,t[89],ms),r=i||function(){let t;return{c(){t=d("div"),t.textContent="mostra la griglia"},m(e,n){u(e,t,n)},p:o,d(e){e&&l(t)}}}();return{c(){r&&r.c()},m(t,n){r&&r.m(t,n),e=!0},p(t,r){i&&i.p&&(!e||134217728&r[2])&&g(i,n,t,t[89],e?x(n,t[89],r,ps):v(t[89]),ms)},i(t){e||(w(r,t),e=!0)},o(t){m(r,t),e=!1},d(t){r&&r.d(t)}}}function Os(t){let e;return{c(){e=d("th"),c(e,"class","w-5")},m(t,n){u(t,e,n)},d(t){t&&l(e)}}}function Fs(t){let e,n,i;return n=new xr({props:{tooltip:"seleziona righe",$$slots:{default:[Is]},$$scope:{ctx:t}}}),{c(){e=d("th"),F(n.$$.fragment),c(e,"class","w-6")},m(t,r){u(t,e,r),N(n,e,null),i=!0},p(t,e){const i={};134217728&e[2]&&(i.$$scope={dirty:e,ctx:t}),n.$set(i)},i(t){i||(w(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&l(e),T(n)}}}function Is(t){let e,n;return e=new mo({props:{checkbox:!0,xs:!0}}),e.$on("click",t[69]),{c(){F(e.$$.fragment)},m(t,i){N(e,t,i),n=!0},p:o,i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){T(e,t)}}}function Rs(t){let e,n=("."==t[104]?.des?"":t[104]?.des||t[104]?.cod||"")+"";return{c(){e=$(n)},m(t,n){u(t,e,n)},p(t,i){64&i[1]&&n!==(n=("."==t[104]?.des?"":t[104]?.des||t[104]?.cod||"")+"")&&b(e,n)},d(t){t&&l(e)}}}function Ls(t){let e;return{c(){e=d("div"),e.textContent="β³",c(e,"class","absolute left-0 inset-y-0 text-sm text-c-200")},m(t,n){u(t,e,n)},d(t){t&&l(e)}}}function Bs(t){let e,n,i,r,o,s,a;i=new xr({props:{tooltip:t[104].tooltip,$$slots:{default:[Rs]},$$scope:{ctx:t}}});let h=t[104].sort&&Ls();function p(){return t[70](t[104])}return{c(){e=d("th"),n=d("div"),F(i.$$.fragment),r=_(),h&&h.c(),c(n,"class","relative"),y(n,"pl-2",t[104].sort),y(e,"selected",t[104].cod==t[3])},m(t,l){u(t,e,l),k(e,n),N(i,n,null),k(n,r),h&&h.m(n,null),o=!0,s||(a=f(e,"click",p),s=!0)},p(r,l){t=r;const s={};64&l[1]&&(s.tooltip=t[104].tooltip),64&l[1]|134217728&l[2]&&(s.$$scope={dirty:l,ctx:t}),i.$set(s),t[104].sort?h||(h=Ls(),h.c(),h.m(n,null)):h&&(h.d(1),h=null),(!o||64&l[1])&&y(n,"pl-2",t[104].sort),(!o||8&l[0]|64&l[1])&&y(e,"selected",t[104].cod==t[3])},i(t){o||(w(i.$$.fragment,t),o=!0)},o(t){m(i.$$.fragment,t),o=!1},d(t){t&&l(e),T(i),h&&h.d(),s=!1,a()}}}function Hs(t){let e,n,i,r;return n=new Ar({props:{id:"azioni"}}),{c(){e=d("th"),F(n.$$.fragment),c(e,"style",i=`width: ${1.75*t[35]+.5}rem;`)},m(t,i){u(t,e,i),N(n,e,null),r=!0},p(t,n){(!r||16&n[1]&&i!==(i=`width: ${1.75*t[35]+.5}rem;`))&&c(e,"style",i)},i(t){r||(w(n.$$.fragment,t),r=!0)},o(t){m(n.$$.fragment,t),r=!1},d(t){t&&l(e),T(n)}}}function Ps(t){let e,n,i,r,o,s,a,f,h=t[15]&&Us(),p=t[16]&&Vs(),b=B(t[37]),g=[];for(let e=0;e<b.length;e+=1)g[e]=Ys(ds(t,b,e));const v=t=>m(g[t],1,1,()=>{g[t]=null});return a=new Dr({props:{size:6,tooltip:"Filtra",img:"view_column"}}),a.$on("click",t[73]),{c(){e=d("tr"),h&&h.c(),n=_(),p&&p.c(),i=_();for(let t=0;t<g.length;t+=1)g[t].c();r=_(),o=d("td"),s=d("div"),F(a.$$.fragment),c(s,"class","flex flex-row w-full mt-1 px-2 space-x-1 justify-end")},m(t,l){u(t,e,l),h&&h.m(e,null),k(e,n),p&&p.m(e,null),k(e,i);for(let t=0;t<g.length;t+=1)g[t]&&g[t].m(e,null);k(e,r),k(e,o),k(o,s),N(a,s,null),f=!0},p(t,o){if(t[15]?h||(h=Us(),h.c(),h.m(e,n)):h&&(h.d(1),h=null),t[16]?p||(p=Vs(),p.c(),p.m(e,i)):p&&(p.d(1),p=null),1&o[0]|4160&o[1]){let n;for(b=B(t[37]),n=0;n<b.length;n+=1){const i=ds(t,b,n);g[n]?(g[n].p(i,o),w(g[n],1)):(g[n]=Ys(i),g[n].c(),w(g[n],1),g[n].m(e,r))}for(z(),n=b.length;n<g.length;n+=1)v(n);M()}},i(t){if(!f){for(let t=0;t<b.length;t+=1)w(g[t]);w(a.$$.fragment,t),f=!0}},o(t){g=g.filter(Boolean);for(let t=0;t<g.length;t+=1)m(g[t]);m(a.$$.fragment,t),f=!1},d(t){t&&l(e),h&&h.d(),p&&p.d(),H(g,t),T(a)}}}function Us(t){let e;return{c(){e=d("th"),c(e,"class","w-5")},m(t,n){u(t,e,n)},d(t){t&&l(e)}}}function Vs(t){let e;return{c(){e=d("th"),c(e,"class","w-6")},m(t,n){u(t,e,n)},d(t){t&&l(e)}}}function Zs(t){let e,n,i;function r(e){t[71](e,t[104])}let o={class:"w-10",autosize:"10-80",sm:!0,readonly:!t[104].visible,type:"text"};return void 0!==t[0][t[104]?.cod]&&(o.value=t[0][t[104]?.cod]),e=new Il({props:o}),h.push(()=>Z(e,"value",r)),e.$on("click",t[72]),{c(){F(e.$$.fragment)},m(t,n){N(e,t,n),i=!0},p(i,r){t=i;const o={};64&r[1]&&(o.readonly=!t[104].visible),!n&&1&r[0]|64&r[1]&&(n=!0,o.value=t[0][t[104]?.cod],Y(()=>n=!1)),e.$set(o)},i(t){i||(w(e.$$.fragment,t),i=!0)},o(t){m(e.$$.fragment,t),i=!1},d(t){T(e,t)}}}function Ys(t){let e,n,i=t[104].sort&&!["date","datetime","time","perc","euro","int","float"].includes((t[104].type||"").split("|")[0]),r=i&&Zs(t);return{c(){e=d("td"),r&&r.c()},m(t,i){u(t,e,i),r&&r.m(e,null),n=!0},p(t,n){64&n[1]&&(i=t[104].sort&&!["date","datetime","time","perc","euro","int","float"].includes((t[104].type||"").split("|")[0])),i?r?(r.p(t,n),64&n[1]&&w(r,1)):(r=Zs(t),r.c(),w(r,1),r.m(e,null)):r&&(z(),m(r,1,1,()=>{r=null}),M())},i(t){n||(w(r),n=!0)},o(t){m(r),n=!1},d(t){t&&l(e),r&&r.d()}}}function qs(t){let e,n,i,r,o,s;function a(...e){return t[74](t[106],...e)}return i=new ar({props:{size:6,img:"drag_indicator"}}),{c(){e=d("td"),n=d("button"),F(i.$$.fragment),c(n,"class","cursor-pointer"),c(e,"class","w-5 h-8 relative")},m(t,l){u(t,e,l),k(e,n),N(i,n,null),r=!0,o||(s=f(n,"mousedown",a),o=!0)},p(e,n){t=e},i(t){r||(w(i.$$.fragment,t),r=!0)},o(t){m(i.$$.fragment,t),r=!1},d(t){t&&l(e),T(i),o=!1,s()}}}function Gs(t){let e,n,i,r;function o(e){t[75](e,t[107])}let s={checkbox:!0,xs:!0};return void 0!==t[107]._sel&&(s.value=t[107]._sel),n=new mo({props:s}),h.push(()=>Z(n,"value",o)),{c(){e=d("td"),F(n.$$.fragment),c(e,"class","w-5")},m(t,i){u(t,e,i),N(n,e,null),r=!0},p(e,r){t=e;const o={};!i&&4&r[0]&&(i=!0,o.value=t[107]._sel,Y(()=>i=!1)),n.$set(o)},i(t){r||(w(n.$$.fragment,t),r=!0)},o(t){m(n.$$.fragment,t),r=!1},d(t){t&&l(e),T(n)}}}function Xs(t){let e,n,i=t[48](t[104],t[107])+"";return{c(){e=d("div"),n=$(i),c(e,"class","px-1")},m(t,i){u(t,e,i),k(e,n)},p(t,e){4&e[0]|64&e[1]&&i!==(i=t[48](t[104],t[107])+"")&&b(n,i)},i:o,o:o,d(t){t&&l(e)}}}function Ws(t){let e,n,i,r,o;const s=[tc,Qs],c=[];function a(t,n){return 4&n[0]|64&n[1]&&(e=null),null==e&&(e=!!t[48](t[104],t[107])),e?0:1}return n=a(t,[-1,-1,-1,-1]),i=c[n]=s[n](t),{c(){i.c(),r=S()},m(t,e){c[n].m(t,e),u(t,r,e),o=!0},p(t,e){let o=n;n=a(t,e),n!==o&&(z(),m(c[o],1,1,()=>{c[o]=null}),M(),i=c[n],i||(i=c[n]=s[n](t),i.c()),w(i,1),i.m(r.parentNode,r))},i(t){o||(w(i),o=!0)},o(t){m(i),o=!1},d(t){t&&l(r),c[n].d(t)}}}function Ks(t){let e,n=t[48](t[104],t[107])+"";return{c(){e=d("div"),c(e,"class","px-1")},m(t,i){u(t,e,i),e.innerHTML=n},p(t,i){4&i[0]|64&i[1]&&n!==(n=t[48](t[104],t[107])+"")&&(e.innerHTML=n)},i:o,o:o,d(t){t&&l(e)}}}function Js(t){let e;const n=t[59].row,i=p(n,t,t[89],fs),r=i||function(t){let e,n,i=t[104].type+"";return{c(){e=d("div"),n=$(i),c(e,"class","bg-c-warning px-1")},m(t,i){u(t,e,i),k(e,n)},p(t,e){64&e[1]&&i!==(i=t[104].type+"")&&b(n,i)},d(t){t&&l(e)}}}(t);return{c(){r&&r.c()},m(t,n){r&&r.m(t,n),e=!0},p(t,o){i?i.p&&(!e||4&o[0]|64&o[1]|134217728&o[2])&&g(i,n,t,t[89],e?x(n,t[89],o,us):v(t[89]),fs):r&&r.p&&(!e||64&o[1])&&r.p(t,e?o:[-1,-1,-1,-1])},i(t){e||(w(r,t),e=!0)},o(t){m(r,t),e=!1},d(t){r&&r.d(t)}}}function Qs(t){let e,n;return e=new ar({props:{img:"do_not_disturb_on",color:"text-c-danger",size:6}}),{c(){F(e.$$.fragment)},m(t,i){N(e,t,i),n=!0},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){T(e,t)}}}function tc(t){let e,n;return e=new ar({props:{img:"check_circle",color:"text-c-success",size:6}}),{c(){F(e.$$.fragment)},m(t,i){N(e,t,i),n=!0},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){T(e,t)}}}function ec(t){let e,n,i,r,o,s,a,f,h;const p=[Js,Ks,Ws,Xs],b=[];function g(t,e){return 64&e[1]&&(i=null),64&e[1]&&(r=null),"."==(t[104].type||"")[0]?0:(null==i&&(i=!("html"!=(t[104].type||"").split("|")[0])),i?1:(null==r&&(r=!("check"!=(t[104].type||"").split("|")[0])),r?2:3))}return o=g(t,[-1,-1,-1,-1]),s=b[o]=p[o](t),{c(){e=d("td"),n=d("div"),s.c(),c(n,"class","flex flex-col"),c(e,"class",a=$c(t[104])),c(e,"data-name",f=t[104]?.des||t[104]?.cod||"")},m(t,i){u(t,e,i),k(e,n),b[o].m(n,null),h=!0},p(t,i){let r=o;o=g(t,i),o===r?b[o].p(t,i):(z(),m(b[r],1,1,()=>{b[r]=null}),M(),s=b[o],s?s.p(t,i):(s=b[o]=p[o](t),s.c()),w(s,1),s.m(n,null)),(!h||64&i[1]&&a!==(a=$c(t[104])))&&c(e,"class",a),(!h||64&i[1]&&f!==(f=t[104]?.des||t[104]?.cod||""))&&c(e,"data-name",f)},i(t){h||(w(s),h=!0)},o(t){m(s),h=!1},d(t){t&&l(e),b[o].d()}}}function nc(t){let e,n,i,r,o,s,a,f=(t[25]||"function"==typeof t[6]&&t[6](t[107],t[106]))&&(!t[12]||!t[107].annulla),h=t[52](t[107]).length,p=B(t[20]),b=[];for(let e=0;e<p.length;e+=1)b[e]=oc(ls(t,p,e));const g=t=>m(b[t],1,1,()=>{b[t]=null});let v=(t[24]||"function"==typeof t[5])&&(!t[12]||!t[107].annulla)&&lc(t),x=f&&ac(t),y=h&&uc(t);return{c(){e=d("td"),n=d("div");for(let t=0;t<b.length;t+=1)b[t].c();i=_(),v&&v.c(),r=_(),x&&x.c(),o=_(),y&&y.c(),c(n,"class","flex flex-wrap items-center justify-start space-x-1 p-1"),c(n,"style",s=`width: ${1.75*t[35]+.5}rem;`),c(e,"data-name","azioni")},m(t,l){u(t,e,l),k(e,n);for(let t=0;t<b.length;t+=1)b[t]&&b[t].m(n,null);k(n,i),v&&v.m(n,null),k(n,r),x&&x.m(n,null),k(n,o),y&&y.m(n,null),a=!0},p(t,e){if(1048580&e[0]|4096&e[1]|134217728&e[2]){let r;for(p=B(t[20]),r=0;r<p.length;r+=1){const o=ls(t,p,r);b[r]?(b[r].p(o,e),w(b[r],1)):(b[r]=oc(o),b[r].c(),w(b[r],1),b[r].m(n,i))}for(z(),r=p.length;r<b.length;r+=1)g(r);M()}!t[24]&&"function"!=typeof t[5]||t[12]&&t[107].annulla?v&&(z(),m(v,1,1,()=>{v=null}),M()):v?(v.p(t,e),16781348&e[0]&&w(v,1)):(v=lc(t),v.c(),w(v,1),v.m(n,r)),33558596&e[0]&&(f=(t[25]||"function"==typeof t[6]&&t[6](t[107],t[106]))&&(!t[12]||!t[107].annulla)),f?x?(x.p(t,e),33558596&e[0]&&w(x,1)):(x=ac(t),x.c(),w(x,1),x.m(n,o)):x&&(z(),m(x,1,1,()=>{x=null}),M()),4&e[0]&&(h=t[52](t[107]).length),h?y?(y.p(t,e),4&e[0]&&w(y,1)):(y=uc(t),y.c(),w(y,1),y.m(n,null)):y&&(z(),m(y,1,1,()=>{y=null}),M()),(!a||16&e[1]&&s!==(s=`width: ${1.75*t[35]+.5}rem;`))&&c(n,"style",s)},i(t){if(!a){for(let t=0;t<p.length;t+=1)w(b[t]);w(v),w(x),w(y),a=!0}},o(t){b=b.filter(Boolean);for(let t=0;t<b.length;t+=1)m(b[t]);m(v),m(x),m(y),a=!1},d(t){t&&l(e),H(b,t),v&&v.d(),x&&x.d(),y&&y.d()}}}function ic(t){let e,n;return e=new Dr({props:{size:6,tooltip:t[109].tooltip||"",img:t[109].icon,gray:"gray"==t[109].decor,danger:"danger"==t[109].decor,warning:"warning"==t[109].decor,white:"white"==t[109].decor,black:"black"==t[109].decor}}),e.$on("click",function(){return t[76](t[107],t[106],t[108],t[109])}),{c(){F(e.$$.fragment)},m(t,i){N(e,t,i),n=!0},p(n,i){t=n;const r={};1048576&i[0]&&(r.tooltip=t[109].tooltip||""),1048576&i[0]&&(r.img=t[109].icon),1048576&i[0]&&(r.gray="gray"==t[109].decor),1048576&i[0]&&(r.danger="danger"==t[109].decor),1048576&i[0]&&(r.warning="warning"==t[109].decor),1048576&i[0]&&(r.white="white"==t[109].decor),1048576&i[0]&&(r.black="black"==t[109].decor),e.$set(r)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){T(e,t)}}}function rc(t){let e;const n=t[59].extra,i=p(n,t,t[89],cs);return{c(){i&&i.c()},m(t,n){i&&i.m(t,n),e=!0},p(t,r){i&&i.p&&(!e||1048580&r[0]|134217728&r[2])&&g(i,n,t,t[89],e?x(n,t[89],r,ss):v(t[89]),cs)},i(t){e||(w(i,t),e=!0)},o(t){m(i,t),e=!1},d(t){i&&i.d(t)}}}function oc(t){let e,n,i,r;const o=[rc,ic],s=[];function c(t,e){return t[109].slot?0:1}return e=c(t),n=s[e]=o[e](t),{c(){n.c(),i=S()},m(t,n){s[e].m(t,n),u(t,i,n),r=!0},p(t,r){let l=e;e=c(t),e===l?s[e].p(t,r):(z(),m(s[l],1,1,()=>{s[l]=null}),M(),n=s[e],n?n.p(t,r):(n=s[e]=o[e](t),n.c()),w(n,1),n.m(i.parentNode,i))},i(t){r||(w(n),r=!0)},o(t){m(n),r=!1},d(t){t&&l(i),s[e].d(t)}}}function lc(t){let e,n,i,r,o;const s=[cc,sc],c=[];function a(t,n){return 16777252&n[0]&&(e=null),null==e&&(e=!!(t[24]||"function"==typeof t[5]&&t[5](t[107],t[106]))),e?0:1}return n=a(t,[-1,-1,-1,-1]),i=c[n]=s[n](t),{c(){i.c(),r=S()},m(t,e){c[n].m(t,e),u(t,r,e),o=!0},p(t,e){let o=n;n=a(t,e),n===o?c[n].p(t,e):(z(),m(c[o],1,1,()=>{c[o]=null}),M(),i=c[n],i?i.p(t,e):(i=c[n]=s[n](t),i.c()),w(i,1),i.m(r.parentNode,r))},i(t){o||(w(i),o=!0)},o(t){m(i),o=!1},d(t){t&&l(r),c[n].d(t)}}}function sc(t){let e;return{c(){e=d("div"),c(e,"class","w-6 h-6")},m(t,n){u(t,e,n)},p:o,i:o,o:o,d(t){t&&l(e)}}}function cc(t){let e,n;return e=new Dr({props:{size:6,img:t[107].annulla?"restore_from_trash":"delete",white:!t[107].annulla,black:t[107].annulla}}),e.$on("click",function(...e){return t[77](t[107],t[106],t[108],...e)}),{c(){F(e.$$.fragment)},m(t,i){N(e,t,i),n=!0},p(n,i){t=n;const r={};4&i[0]&&(r.img=t[107].annulla?"restore_from_trash":"delete"),4&i[0]&&(r.white=!t[107].annulla),4&i[0]&&(r.black=t[107].annulla),e.$set(r)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){T(e,t)}}}function ac(t){let e,n;return e=new Dr({props:{size:6,img:"edit",base:!0,black:!0}}),e.$on("click",function(...e){return t[78](t[107],t[106],t[108],...e)}),{c(){F(e.$$.fragment)},m(t,i){N(e,t,i),n=!0},p(e,n){t=e},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){T(e,t)}}}function uc(t){let e,n;return e=new Dr({props:{size:8,white:!0,noborder:!0,img:"more_vert"}}),e.$on("click",function(...e){return t[79](t[107],...e)}),{c(){F(e.$$.fragment)},m(t,i){N(e,t,i),n=!0},p(e,n){t=e},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){T(e,t)}}}function fc(t){let e,n,i,r,o,a,h,p,b,g=t[15]&&qs(t),v=t[16]&&Gs(t),x=B(t[37]),$=[];for(let e=0;e<x.length;e+=1)$[e]=ec(as(t,x,e));const D=t=>m($[t],1,1,()=>{$[t]=null});let S=t[36]&&nc(t);function E(...e){return t[80](t[106],...e)}function j(...e){return t[81](t[106],...e)}function A(...e){return t[82](t[106],t[107],t[108],...e)}return{c(){e=d("tr"),g&&g.c(),n=_(),v&&v.c(),i=_();for(let t=0;t<$.length;t+=1)$[t].c();r=_(),S&&S.c(),o=_(),c(e,"class",a="cursor-pointer text-c-800 hover:text-black hover:bg-c-50 "+("function"==typeof t[14]&&t[14](t[107],t[106])||"")),y(e,"bg-c-100",t[9]&&t[107].annulla),y(e,"text-c-400",t[9]&&t[107].annulla)},m(t,l){u(t,e,l),g&&g.m(e,null),k(e,n),v&&v.m(e,null),k(e,i);for(let t=0;t<$.length;t+=1)$[t]&&$[t].m(e,null);k(e,r),S&&S.m(e,null),k(e,o),h=!0,p||(b=[f(e,"mousemove",E),f(e,"mouseup",j),f(e,"click",A)],p=!0)},p(l,s){if((t=l)[15]?g?(g.p(t,s),32768&s[0]&&w(g,1)):(g=qs(t),g.c(),w(g,1),g.m(e,n)):g&&(z(),m(g,1,1,()=>{g=null}),M()),t[16]?v?(v.p(t,s),65536&s[0]&&w(v,1)):(v=Gs(t),v.c(),w(v,1),v.m(e,i)):v&&(z(),m(v,1,1,()=>{v=null}),M()),4&s[0]|131136&s[1]|134217728&s[2]){let n;for(x=B(t[37]),n=0;n<x.length;n+=1){const i=as(t,x,n);$[n]?($[n].p(i,s),w($[n],1)):($[n]=ec(i),$[n].c(),w($[n],1),$[n].m(e,r))}for(z(),n=x.length;n<$.length;n+=1)D(n);M()}t[36]?S?(S.p(t,s),32&s[1]&&w(S,1)):(S=nc(t),S.c(),w(S,1),S.m(e,o)):S&&(z(),m(S,1,1,()=>{S=null}),M()),(!h||16388&s[0]&&a!==(a="cursor-pointer text-c-800 hover:text-black hover:bg-c-50 "+("function"==typeof t[14]&&t[14](t[107],t[106])||"")))&&c(e,"class",a),(!h||16900&s[0])&&y(e,"bg-c-100",t[9]&&t[107].annulla),(!h||16900&s[0])&&y(e,"text-c-400",t[9]&&t[107].annulla)},i(t){if(!h){w(g),w(v);for(let t=0;t<x.length;t+=1)w($[t]);w(S),h=!0}},o(t){m(g),m(v),$=$.filter(Boolean);for(let t=0;t<$.length;t+=1)m($[t]);m(S),h=!1},d(t){t&&l(e),g&&g.d(),v&&v.d(),H($,t),S&&S.d(),p=!1,s(b)}}}function dc(t){let e,n,i,r,o;function s(e){t[84](e,t[104])}let a={class:"flex-1",trueval:!0,falseval:!1,label:t[104]?.des||t[104]?.cod||""};return void 0!==t[104].visible&&(a.value=t[104].visible),n=new mo({props:a}),h.push(()=>Z(n,"value",s)),{c(){e=d("div"),F(n.$$.fragment),r=_(),c(e,"class","flex flex-wrap items-center space-x-2 h-10")},m(t,i){u(t,e,i),N(n,e,null),k(e,r),o=!0},p(e,r){t=e;const o={};8388608&r[0]&&(o.label=t[104]?.des||t[104]?.cod||""),!i&&8388608&r[0]&&(i=!0,o.value=t[104].visible,Y(()=>i=!1)),n.$set(o)},i(t){o||(w(n.$$.fragment,t),o=!0)},o(t){m(n.$$.fragment,t),o=!1},d(t){t&&l(e),T(n)}}}function hc(t){let e,n;return e=new Qr({props:{alt:!0,$$slots:{default:[pc]},$$scope:{ctx:t}}}),e.$on("click",t[85]),{c(){F(e.$$.fragment)},m(t,i){N(e,t,i),n=!0},p(t,n){const i={};134217728&n[2]&&(i.$$scope={dirty:n,ctx:t}),e.$set(i)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){T(e,t)}}}function pc(t){let e;return{c(){e=$("Reset filtri")},m(t,n){u(t,e,n)},d(t){t&&l(e)}}}function mc(t){let e,n;return e=new Ar({props:{id:"Salva e chiudi"}}),{c(){F(e.$$.fragment)},m(t,i){N(e,t,i),n=!0},p:o,i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){T(e,t)}}}function wc(t){let e,n,i,r,o,s,a,f,h=B(t[23]),p=[];for(let e=0;e<h.length;e+=1)p[e]=dc(rs(t,h,e));const b=t=>m(p[t],1,1,()=>{p[t]=null});let g=t[0]&&hc(t);return a=new Qr({props:{primary:!0,$$slots:{default:[mc]},$$scope:{ctx:t}}}),a.$on("click",t[47]),{c(){e=d("div");for(let t=0;t<p.length;t+=1)p[t].c();n=_(),i=d("div"),g&&g.c(),r=_(),o=d("div"),s=_(),F(a.$$.fragment),c(e,"class","grid grid-cols-2 p-4 gap-x-2"),c(o,"class","flex-1"),c(i,"class","flex flex-wrap space-x-2 p-3")},m(t,l){u(t,e,l);for(let t=0;t<p.length;t+=1)p[t]&&p[t].m(e,null);u(t,n,l),u(t,i,l),g&&g.m(i,null),k(i,r),k(i,o),k(i,s),N(a,i,null),f=!0},p(t,n){if(8388608&n[0]){let i;for(h=B(t[23]),i=0;i<h.length;i+=1){const r=rs(t,h,i);p[i]?(p[i].p(r,n),w(p[i],1)):(p[i]=dc(r),p[i].c(),w(p[i],1),p[i].m(e,null))}for(z(),i=h.length;i<p.length;i+=1)b(i);M()}t[0]?g?(g.p(t,n),1&n[0]&&w(g,1)):(g=hc(t),g.c(),w(g,1),g.m(i,r)):g&&(z(),m(g,1,1,()=>{g=null}),M());const o={};134217728&n[2]&&(o.$$scope={dirty:n,ctx:t}),a.$set(o)},i(t){if(!f){for(let t=0;t<h.length;t+=1)w(p[t]);w(g),w(a.$$.fragment,t),f=!0}},o(t){p=p.filter(Boolean);for(let t=0;t<p.length;t+=1)m(p[t]);m(g),m(a.$$.fragment,t),f=!1},d(t){t&&(l(e),l(n),l(i)),H(p,t),g&&g.d(),T(a)}}}function bc(t){let e,n,i,r,o,s,a,h,p,g=(t[101].des||"")+"",v=t[101].icon&&vc(t);function x(){return t[87](t[101])}return{c(){e=d("button"),n=d("div"),v&&v.c(),i=_(),r=d("div"),o=$(g),s=_(),c(n,"class","w-8"),c(r,"class","flex-1 text-left"),c(e,"class","flex flex-row space-x-2 items-center border border-c-100 rounded hover:bg-white hover:border-c-border px-1 py-0.5")},m(t,l){u(t,e,l),k(e,n),v&&v.m(n,null),k(e,i),k(e,r),k(r,o),k(e,s),a=!0,h||(p=f(e,"click",x),h=!0)},p(e,i){(t=e)[101].icon?v?(v.p(t,i),1&i[1]&&w(v,1)):(v=vc(t),v.c(),w(v,1),v.m(n,null)):v&&(z(),m(v,1,1,()=>{v=null}),M()),(!a||1&i[1])&&g!==(g=(t[101].des||"")+"")&&b(o,g)},i(t){a||(w(v),a=!0)},o(t){m(v),a=!1},d(t){t&&l(e),v&&v.d(),h=!1,p()}}}function gc(t){let e;return{c(){e=d("div"),c(e,"class","w-full py-1 border-b")},m(t,n){u(t,e,n)},p:o,i:o,o:o,d(t){t&&l(e)}}}function vc(t){let e,n;return e=new ar({props:{size:6,img:t[101].icon}}),{c(){F(e.$$.fragment)},m(t,i){N(e,t,i),n=!0},p(t,n){const i={};1&n[1]&&(i.img=t[101].icon),e.$set(i)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){T(e,t)}}}function xc(t){let e,n,i,r;const o=[gc,bc],s=[];function c(t,e){return"-"==t[101].cod?0:1}return e=c(t),n=s[e]=o[e](t),{c(){n.c(),i=S()},m(t,n){s[e].m(t,n),u(t,i,n),r=!0},p(t,r){let l=e;e=c(t),e===l?s[e].p(t,r):(z(),m(s[l],1,1,()=>{s[l]=null}),M(),n=s[e],n?n.p(t,r):(n=s[e]=o[e](t),n.c()),w(n,1),n.m(i.parentNode,i))},i(t){r||(w(n),r=!0)},o(t){m(n),r=!1},d(t){t&&l(i),s[e].d(t)}}}function yc(t){let e,n,i,r,o;i=new Dr({props:{img:"close",mat:!0,size:4}}),i.$on("click",t[86]);let s=B(t[52](t[31])),a=[];for(let e=0;e<s.length;e+=1)a[e]=xc(is(t,s,e));const f=t=>m(a[t],1,1,()=>{a[t]=null});return{c(){e=d("div"),n=d("div"),F(i.$$.fragment),r=_();for(let t=0;t<a.length;t+=1)a[t].c();c(n,"class","absolute top-1 right-1"),c(e,"class","z-100 text-sm min-w-64 border rounded shadow border-c-border bg-c-100 p-2 flex flex-col space-y-1 py-2")},m(t,l){u(t,e,l),k(e,n),N(i,n,null),k(e,r);for(let t=0;t<a.length;t+=1)a[t]&&a[t].m(e,null);o=!0},p(t,n){if(1610612736&n[0]|2101249&n[1]){let i;for(s=B(t[52](t[31])),i=0;i<s.length;i+=1){const r=is(t,s,i);a[i]?(a[i].p(r,n),w(a[i],1)):(a[i]=xc(r),a[i].c(),w(a[i],1),a[i].m(e,null))}for(z(),i=s.length;i<a.length;i+=1)f(i);M()}},i(t){if(!o){w(i.$$.fragment,t);for(let t=0;t<s.length;t+=1)w(a[t]);o=!0}},o(t){m(i.$$.fragment,t),a=a.filter(Boolean);for(let t=0;t<a.length;t+=1)m(a[t]);o=!1},d(t){t&&l(e),T(i),H(a,t)}}}function kc(t){let e,n,i,r,o=t[39]&&ks(t);return{c(){o&&o.c(),e=S()},m(l,s){o&&o.m(l,s),u(l,e,s),n=!0,i||(r=f(window,"keydown",t[45]),i=!0)},p(t,n){t[39]?o?(o.p(t,n),256&n[1]&&w(o,1)):(o=ks(t),o.c(),w(o,1),o.m(e.parentNode,e)):o&&(z(),m(o,1,1,()=>{o=null}),M())},i(t){n||(w(o),n=!0)},o(t){m(o),n=!1},d(t){t&&l(e),o&&o.d(t),i=!1,r()}}}function $c(t){let[e,n]=(t.type||"").split("|");switch(n=n||"",e){case"date":case"datetime":case"time":return`text-center ${n}`;case"check":return`text-left text-xl ${n}`;case"number":case"float":case"float1":case"float2":case"float3":case"float4":case"real":case"int":case"euro":return"text-center ";case"perc":return`text-right mr-1 ${n}`;default:return`text-left ${n}`}}function _c(t,e,n){let o,l,s,c,a,u,f,d,{$$slots:h={},$$scope:p}=e;const{bus:m,user:w,post:b,_:g,setStorage:v,getStorage:x,strDate:y,toEuro:k}=fr();I(t,w,t=>n(40,d=t));const $=W();let _,D,S,z,M,E,j,A,{authdel:C,auth:T,authedit:N,authadd:O,menu:F,nosearch:R=!1,noheader:L=!1,annullati:B=!1,tooltip:H="",lockrows:P=!1,cannotrestore:U=!1,nofilter:V=!1,checkcampi:Z,classrow:Y,ismove:q=!1,isselect:J=!1,filtri:Q,isclipboard:tt=!1,isexport:et=!1,isimport:nt=!1,isgrid:it=!1,extrabtn:rt=[],value:ot=[]}=e,{campi:lt,name:st,ordina:ct=!1,desc:at=!1,title:ut="tabella"}=e,ft=[],dt=-1,ht="",pt=!1,mt=!1;function wt(t,e){if(t>=0&&t<ot.length&&t!=e&&e>=0&&e<ot.length){var i=ot.splice(t,1)[0];ot.splice(e,0,i),n(2,ot=[...ot]),$("move",ot),n(26,dt=e)}}function bt(t){Array.isArray(ot)&&(ot.forEach(e=>e._sel=t.value),n(2,ot=[...ot]))}async function gt(){$("more")}function vt(t,e){t.stopPropagation(),n(33,z=!0),M=t.x,E=t.y,n(34,A=e),j=t.target}function xt(){j&&(j.style="transform : translate(0px, 0px);\n z-index:0 ; background-color: transparent"),n(33,z=!1),M=0,E=0,j=void 0}function yt(t,e){j&&z&&(j.style=`transform : translate(${t.x-M+20}px, ${t.y-E}px);\n z-index:-10 ; background-color: aliceblue`)}G(async()=>{m.on("scrollbottom",gt)}),K(()=>{m.off("scrollbottom",gt)});return t.$$set=t=>{n(53,e=i(i({},e),r(t))),"authdel"in t&&n(5,C=t.authdel),"auth"in t&&n(54,T=t.auth),"authedit"in t&&n(6,N=t.authedit),"authadd"in t&&n(55,O=t.authadd),"menu"in t&&n(56,F=t.menu),"nosearch"in t&&n(7,R=t.nosearch),"noheader"in t&&n(8,L=t.noheader),"annullati"in t&&n(9,B=t.annullati),"tooltip"in t&&n(10,H=t.tooltip),"lockrows"in t&&n(11,P=t.lockrows),"cannotrestore"in t&&n(12,U=t.cannotrestore),"nofilter"in t&&n(13,V=t.nofilter),"checkcampi"in t&&n(57,Z=t.checkcampi),"classrow"in t&&n(14,Y=t.classrow),"ismove"in t&&n(15,q=t.ismove),"isselect"in t&&n(16,J=t.isselect),"filtri"in t&&n(0,Q=t.filtri),"isclipboard"in t&&n(17,tt=t.isclipboard),"isexport"in t&&n(18,et=t.isexport),"isimport"in t&&n(19,nt=t.isimport),"isgrid"in t&&n(1,it=t.isgrid),"extrabtn"in t&&n(20,rt=t.extrabtn),"value"in t&&n(2,ot=t.value),"campi"in t&&n(58,lt=t.campi),"name"in t&&n(21,st=t.name),"ordina"in t&&n(3,ct=t.ordina),"desc"in t&&n(4,at=t.desc),"title"in t&&n(22,ut=t.title),"$$scope"in t&&n(89,p=t.$$scope)},t.$$.update=()=>{8388608&t.$$.dirty[1]&&n(39,o=b.isauth(T)),32&t.$$.dirty[0]&&n(24,l="function"!=typeof C&&b.isauth(C)),16777216&t.$$.dirty[1]&&n(38,s=b.isauth(O)),64&t.$$.dirty[0]&&n(25,c="function"!=typeof N&&b.isauth(N)),201326592&t.$$.dirty[1]&&function(t){let e;if(n(23,ft=t),st){var i=x(`fields_${st}_${d.id}`);if(i&&i.length>0)for(e of ft)e.visible=i.includes(e.cod)}if(ft&&ft.length>0)for(e of ft)Z&&Z(e)}(lt),8388608&t.$$.dirty[0]&&n(37,a=(ft||[]).filter(t=>t.visible)),51380320&t.$$.dirty[0]|33554432&t.$$.dirty[1]&&n(36,u=F||l||"function"==typeof C||c||"function"==typeof N||rt.length),51380320&t.$$.dirty[0]|33554432&t.$$.dirty[1]&&n(35,f=(F?1.5:0)+rt.length+(c||"function"==typeof N?1:0)+(l||"function"==typeof C?1:0))},e=r(e),[Q,it,ot,ct,at,C,N,R,L,B,H,P,U,V,Y,q,J,tt,et,nt,rt,st,ut,ft,l,c,dt,ht,pt,_,D,S,mt,z,A,f,u,a,s,o,d,w,v,$,wt,function(t){if("Escape"==t.key&&xt(),q&&t.metaKey&&("ArrowDown"===t.key||"ArrowUp"==t.key)&&dt>=0&&dt<ot.length){let e;t.stopPropagation(),t.preventDefault(),"ArrowDown"==t.key?dt<ot.length-1&&(e=ot[dt],n(2,ot[dt]=ot[dt+1],ot),n(2,ot[dt+1]=e,ot),n(26,dt++,dt),n(2,ot=[...ot]),$("move")):dt>0&&(e=ot[dt],n(2,ot[dt]=ot[dt-1],ot),n(2,ot[dt-1]=e,ot),n(26,dt--,dt),n(2,ot=[...ot]),$("move"))}},bt,function(){if(n(32,mt=!1),st){var t=[];for(var e of ft)e.visible&&t.push(e.cod);Q&&$("filtra"),v(`fields_${st}_${d.id}`,t)}},function(t,e){var n=e[t.cod];if(n){"object"==typeof n&&(n=n.cod||n.des||"");let e=(t.type||"").split("|")[0];if("date"==e)n=y(n,"ggmmaaaa");else if("datetime"==e)n=y(n,"datetime");else if("time"==e)n=y(n,"hhmm");else if("perc"==e){var i=parseFloat(n);i<1&&(i*=100),n=i?i.toFixed(2)+"%":""}else"euro"==e?n=k(n):"int"==e?n=parseInt(n)||"":"float"==e||"float2"==e?n=(parseFloat(n)||0).toFixed(2):"float1"==e?n=(parseFloat(n)||0).toFixed(1):"float3"==e?n=(parseFloat(n)||0).toFixed(3):"float4"==e&&(n=(parseFloat(n)||0).toFixed(4))}return n||""},vt,xt,yt,function(t){return F?(F(t)||[]).filter(t=>b.isauth(t.auth)):[]},e,T,O,F,Z,lt,h,()=>n(1,it=1==it?2:1),function(t){ht=t,n(27,ht)},()=>{$("cercai",ht)},()=>{$("cerca",ht)},()=>$("clipboard"),()=>$("export"),()=>$("import"),()=>{pt&&Q&&Object.keys(Q).length&&(n(0,Q={}),$("filtra")),n(28,pt=!pt)},t=>{$("add",t.detail)},t=>bt(t.detail),t=>{t.sort&&(n(4,at=ct==t.cod&&!at),n(3,ct=t.cod),$("ordina",{ordina:ct,desc:at}))},function(e,i){t.$$.not_equal(Q[i?.cod],e)&&(Q[i?.cod]=e,n(0,Q))},()=>{$("filtra")},()=>{n(32,mt=!0)},(t,e)=>vt(e,t),function(e,i){t.$$.not_equal(i._sel,e)&&(i._sel=e,n(2,ot))},(t,e,i,r)=>{n(2,i[e].A=e,ot),$(r.cod,t)},(t,e,i,r)=>{n(2,i[e].A=e,ot),$("xdelete",{x:t,e:r.detail,row:e}),$("delete",t)},(t,e,i,r)=>{n(2,i[e].A=e,ot),$("xedit",{x:t,row:e,e:r.detail}),$("edit",t)},(t,e)=>{n(29,_=e.detail),n(31,S=t),n(30,D=!0)},(t,e)=>yt(e),(t,e)=>{z&&wt(A,t),xt()},(t,e,i,r)=>{dt!=t||q?n(26,dt=t):P||("function"==typeof N?N(e,t)&&(n(2,i[t].A=t,ot),$("xedit",{x:e,row:t,e:r.target}),$("edit",e)):c&&(n(2,i[t].A=t,ot),$("xedit",{x:e,row:t,e:r.target}),$("edit",e)))},()=>{xt()},function(e,i){t.$$.not_equal(i.visible,e)&&(i.visible=e,n(23,ft))},()=>{n(0,Q={}),v(`fields_${st}_${d.id}`),n(32,mt=!1)},()=>n(30,D=!1),async t=>{n(30,D=!1),await X(),$(t.cod||t.des,{x:S,e:_})},function(t){D=t,n(30,D)},p]}class Dc extends t{constructor(t){super(),e(this,t,_c,kc,n,{authdel:5,auth:54,authedit:6,authadd:55,menu:56,nosearch:7,noheader:8,annullati:9,tooltip:10,lockrows:11,cannotrestore:12,nofilter:13,checkcampi:57,classrow:14,ismove:15,isselect:16,filtri:0,isclipboard:17,isexport:18,isimport:19,isgrid:1,extrabtn:20,value:2,campi:58,name:21,ordina:3,desc:4,title:22},null,[-1,-1,-1,-1])}}function Sc(t){let e,n,i,r,s;return{c(){e=d("button"),c(e,"aria-label","dragbar"),c(e,"id",n="splitter_"+(t[4]||t[5]?"horiz":"vert")),c(e,"class",i=(t[12].class||"")+" "+(t[4]||t[5]?"h-1.5 w-full":"h-full w-1.5")+" "+(t[3]?"bg-c-150":"hover:bg-c-500")),c(e,"style",t[11])},m(n,i){u(n,e,i),r||(s=f(e,"mousedown",t[14]),r=!0)},p(t,[r]){48&r&&n!==(n="splitter_"+(t[4]||t[5]?"horiz":"vert"))&&c(e,"id",n),4152&r&&i!==(i=(t[12].class||"")+" "+(t[4]||t[5]?"h-1.5 w-full":"h-full w-1.5")+" "+(t[3]?"bg-c-150":"hover:bg-c-500"))&&c(e,"class",i),2048&r&&c(e,"style",t[11])},i:o,o:o,d(t){t&&l(e),r=!1,s()}}}function zc(t,e,n){let o;const l=W();let s,c,a,u,{value:f=0,min:d=-1,max:h=-1,readonly:p=!1,top:m=!1,bottom:w=!1,right:b=!1}=e,g=!1;function v(){let t;return t=m?(u-c)/4:w?(c-u)/4:b?(s-a)/4:(a-s)/4,t+=f,t<d&&(t=d),t>h&&(t=h),t}function x(t){g&&(n(8,a=t.clientX),n(9,u=t.clientY))}function y(){if(g){let t=Math.floor(v()+.5);t!==f&&l("change",t),n(10,g=!1)}}G(()=>(window.addEventListener("mousemove",x),window.addEventListener("mouseup",y),()=>{window.removeEventListener("mousemove",x),window.removeEventListener("mouseup",y)}));return t.$$set=t=>{n(12,e=i(i({},e),r(t))),"value"in t&&n(0,f=t.value),"min"in t&&n(1,d=t.min),"max"in t&&n(2,h=t.max),"readonly"in t&&n(3,p=t.readonly),"top"in t&&n(4,m=t.top),"bottom"in t&&n(5,w=t.bottom),"right"in t&&n(13,b=t.right)},t.$$.update=()=>{1992&t.$$.dirty&&n(11,o=function(){if(p)return;let t=`cursor: ${m||w?"row-resize":"col-resize"};`;if(g){let e=v()-f;return(w||b)&&(e=-e),`${t} transform: translate${m||w?"Y":"X"}(${4*e}px); z-index:10;`}return t}())},e=r(e),[f,d,h,p,m,w,s,c,a,u,g,o,e,b,t=>{p||d>=0&&h>d&&f>=d&&f<=h&&(n(6,s=t.clientX),n(7,c=t.clientY),n(8,a=s),n(9,u=c),n(10,g=!0))}]}class Mc extends t{constructor(t){super(),e(this,t,zc,Sc,n,{value:0,min:1,max:2,readonly:3,top:4,bottom:5,right:13})}}const Ec=t=>({}),jc=t=>({}),Ac=t=>({}),Cc=t=>({});function Tc(t){let e,n,i,r,o,s;n=new xr({props:{tooltip:t[5],$$slots:{default:[Fc]},$$scope:{ctx:t}}});let a=t[9]&&Ic(t);return{c(){e=d("div"),F(n.$$.fragment),i=_(),r=d("div"),a&&a.c(),c(e,"class",o="w-full relative "+(t[12].class||""))},m(o,l){u(o,e,l),N(n,e,null),k(e,i),k(e,r),a&&a.m(r,null),t[16](r),s=!0},p(t,i){const l={};32&i&&(l.tooltip=t[5]),131807&i&&(l.$$scope={dirty:i,ctx:t}),n.$set(l),t[9]?a?(a.p(t,i),512&i&&w(a,1)):(a=Ic(t),a.c(),w(a,1),a.m(r,null)):a&&(z(),m(a,1,1,()=>{a=null}),M()),(!s||4096&i&&o!==(o="w-full relative "+(t[12].class||"")))&&c(e,"class",o)},i(t){s||(w(n.$$.fragment,t),w(a),s=!0)},o(t){m(n.$$.fragment,t),m(a),s=!1},d(i){i&&l(e),T(n),a&&a.d(),t[16](null)}}}function Nc(t){let e;const n=t[14].btn,i=p(n,t,t[17],jc);return{c(){i&&i.c()},m(t,n){i&&i.m(t,n),e=!0},p(t,r){i&&i.p&&(!e||131072&r)&&g(i,n,t,t[17],e?x(n,t[17],r,Ec):v(t[17]),jc)},i(t){e||(w(i,t),e=!0)},o(t){m(i,t),e=!1},d(t){i&&i.d(t)}}}function Oc(t){let e,n;return e=new ar({props:{img:t[9]?"expand_less":"expand_more",size:6}}),{c(){F(e.$$.fragment)},m(t,i){N(e,t,i),n=!0},p(t,n){const i={};512&n&&(i.img=t[9]?"expand_less":"expand_more"),e.$set(i)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){T(e,t)}}}function Fc(t){let e,n,i,r,o,s,a;const h=t[14].title,b=p(h,t,t[17],Cc),y=b||function(t){let e,n,i;return n=new Ar({props:{id:t[1]}}),{c(){e=d("div"),F(n.$$.fragment),c(e,"class","flex-1 pl-2 font-bold")},m(t,r){u(t,e,r),N(n,e,null),i=!0},p(t,e){const i={};2&e&&(i.id=t[1]),n.$set(i)},i(t){i||(w(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&l(e),T(n)}}}(t);let $=(!t[3]&&!t[4]||t[9])&&Nc(t),D=(t[3]||t[4])&&Oc(t);return{c(){e=d("button"),y&&y.c(),n=_(),$&&$.c(),i=_(),D&&D.c(),c(e,"class",r=(t[2]?"titolot":"titolo")+" text-left w-full mb-1")},m(r,l){u(r,e,l),y&&y.m(e,null),k(e,n),$&&$.m(e,null),k(e,i),D&&D.m(e,null),o=!0,s||(a=f(e,"click",t[15]),s=!0)},p(t,n){b?b.p&&(!o||131072&n)&&g(b,h,t,t[17],o?x(h,t[17],n,Ac):v(t[17]),Cc):y&&y.p&&(!o||2&n)&&y.p(t,o?n:-1),!t[3]&&!t[4]||t[9]?$?($.p(t,n),536&n&&w($,1)):($=Nc(t),$.c(),w($,1),$.m(e,i)):$&&(z(),m($,1,1,()=>{$=null}),M()),t[3]||t[4]?D?(D.p(t,n),24&n&&w(D,1)):(D=Oc(t),D.c(),w(D,1),D.m(e,null)):D&&(z(),m(D,1,1,()=>{D=null}),M()),(!o||4&n&&r!==(r=(t[2]?"titolot":"titolo")+" text-left w-full mb-1"))&&c(e,"class",r)},i(t){o||(w(y,t),w($),w(D),o=!0)},o(t){m(y,t),m($),m(D),o=!1},d(t){t&&l(e),y&&y.d(t),$&&$.d(),D&&D.d(),s=!1,a()}}}function Ic(t){let e,n;const i=t[14].default,r=p(i,t,t[17],null),o=r||function(){let t;return{c(){t=$("Impostare il contenuto qui")},m(e,n){u(e,t,n)},d(e){e&&l(t)}}}();return{c(){e=d("div"),o&&o.c()},m(t,i){u(t,e,i),o&&o.m(e,null),n=!0},p(t,e){r&&r.p&&(!n||131072&e)&&g(r,i,t,t[17],n?x(i,t[17],e,null):v(t[17]),null)},i(t){n||(w(o,t),n=!0)},o(t){m(o,t),n=!1},d(t){t&&l(e),o&&o.d(t)}}}function Rc(t){let e,n,i=t[8]&&Tc(t);return{c(){i&&i.c(),e=S()},m(t,r){i&&i.m(t,r),u(t,e,r),n=!0},p(t,[n]){t[8]?i?(i.p(t,n),256&n&&w(i,1)):(i=Tc(t),i.c(),w(i,1),i.m(e.parentNode,e)):i&&(z(),m(i,1,1,()=>{i=null}),M())},i(t){n||(w(i),n=!0)},o(t){m(i),n=!1},d(t){t&&l(e),i&&i.d(t)}}}function Lc(t,e,n){let o,l,{$$slots:s={},$$scope:c}=e;const{_:a,P:u,autofocus:f}=fr(),d=W();let p,m=!0,{auth:w="",title:b="",transparent:g=!1,canclose:v=!1,click:x=!1,tooltip:y=!1,closed:k=!1}=e;return t.$$set=t=>{n(12,e=i(i({},e),r(t))),"auth"in t&&n(13,w=t.auth),"title"in t&&n(1,b=t.title),"transparent"in t&&n(2,g=t.transparent),"canclose"in t&&n(3,v=t.canclose),"click"in t&&n(4,x=t.click),"tooltip"in t&&n(5,y=t.tooltip),"closed"in t&&n(0,k=t.closed),"$$scope"in t&&n(17,c=t.$$scope)},t.$$.update=()=>{81&t.$$.dirty&&n(9,o=x?!k:k?!m:m),8192&t.$$.dirty&&n(8,l=!w||u.isauth(w))},e=r(e),[k,b,g,v,x,y,m,p,l,o,f,d,e,w,s,()=>{(v||x)&&(o||f(!0,p,200),x?d("click"):v?n(6,m=!m):(n(0,k=!k),d("click",k)))},function(t){h[t?"unshift":"push"](()=>{p=t,n(7,p)})},c]}class Bc extends t{constructor(t){super(),e(this,t,Lc,Rc,n,{auth:13,title:1,transparent:2,canclose:3,click:4,tooltip:5,closed:0})}}function Hc(t){let e,n,i,r;return{c(){e=d("div"),n=$(t[2]),i=$("x"),r=$(t[3]),c(e,"class","absolute left-1 top-1 bg-c-100 z-10 rounded-md p-0.5 text-xxs")},m(t,o){u(t,e,o),k(e,n),k(e,i),k(e,r)},p(t,e){4&e&&b(n,t[2]),8&e&&b(r,t[3])},d(t){t&&l(e)}}}function Pc(t){let e,n;return e=new Dr({props:{black:!0,size:t[4],img:"zoom_in"}}),e.$on("click",t[11]),{c(){F(e.$$.fragment)},m(t,i){N(e,t,i),n=!0},p(t,n){const i={};16&n&&(i.size=t[4]),e.$set(i)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){T(e,t)}}}function Uc(t){let e,n,i;return{c(){e=d("div"),n=d("img"),P(n.src,i=t[0])||c(n,"src",i),c(n,"alt",t[1]),c(n,"class","w-full h-auto"),c(e,"class","h-full w-full overflow-auto relative")},m(t,i){u(t,e,i),k(e,n)},p(t,e){1&e&&!P(n.src,i=t[0])&&c(n,"src",i),2&e&&c(n,"alt",t[1])},d(t){t&&l(e)}}}function Vc(t){let e,n;return{c(){e=d("div"),c(e,"class",n="bg-center bg-no-repeat "+(t[5]?"bg-contain":t[6]?"bg-cover":"")+" h-full w-full"),D(e,"background-image","url("+t[0]+")")},m(t,n){u(t,e,n)},p(t,i){96&i&&n!==(n="bg-center bg-no-repeat "+(t[5]?"bg-contain":t[6]?"bg-cover":"")+" h-full w-full")&&c(e,"class",n),1&i&&D(e,"background-image","url("+t[0]+")")},d(t){t&&l(e)}}}function Zc(t){let e,n,i;return{c(){e=d("div"),n=d("img"),P(n.src,i=t[0])||c(n,"src",i),c(n,"alt",t[1]),c(n,"class","w-full h-auto"),c(e,"class","h-full w-full overflow-auto relative")},m(t,i){u(t,e,i),k(e,n)},p(t,e){1&e&&!P(n.src,i=t[0])&&c(n,"src",i),2&e&&c(n,"alt",t[1])},d(t){t&&l(e)}}}function Yc(t){let e,n,i,r,o,s,a,h,b,y,$=t[2]&&t[3]&&Hc(t),D=t[4]&&Pc(t);const S=t[9].default,E=p(S,t,t[13],null);function j(t,e){return t[5]||t[6]||t[7]?Vc:Uc}let A=j(t),C=A(t);return a=new ns({props:{close:!0,screen:!0,show:t[8],title:t[1]||"fullscreen",nofooter:!0,$$slots:{default:[Zc]},$$scope:{ctx:t}}}),a.$on("close",t[12]),{c(){e=d("button"),$&&$.c(),n=_(),i=d("div"),D&&D.c(),r=_(),E&&E.c(),o=_(),C.c(),s=_(),F(a.$$.fragment),c(i,"class","absolute right-2 top-2 z-10 flex flex-row space-x-2"),c(e,"class","w-full h-full relative")},m(l,c){u(l,e,c),$&&$.m(e,null),k(e,n),k(e,i),D&&D.m(i,null),k(i,r),E&&E.m(i,null),k(e,o),C.m(e,null),u(l,s,c),N(a,l,c),h=!0,b||(y=f(e,"click",t[10]),b=!0)},p(t,[o]){t[2]&&t[3]?$?$.p(t,o):($=Hc(t),$.c(),$.m(e,n)):$&&($.d(1),$=null),t[4]?D?(D.p(t,o),16&o&&w(D,1)):(D=Pc(t),D.c(),w(D,1),D.m(i,r)):D&&(z(),m(D,1,1,()=>{D=null}),M()),E&&E.p&&(!h||8192&o)&&g(E,S,t,t[13],h?x(S,t[13],o,null):v(t[13]),null),A===(A=j(t))&&C?C.p(t,o):(C.d(1),C=A(t),C&&(C.c(),C.m(e,null)));const l={};256&o&&(l.show=t[8]),2&o&&(l.title=t[1]||"fullscreen"),8195&o&&(l.$$scope={dirty:o,ctx:t}),a.$set(l)},i(t){h||(w(D),w(E,t),w(a.$$.fragment,t),h=!0)},o(t){m(D),m(E,t),m(a.$$.fragment,t),h=!1},d(t){t&&(l(e),l(s)),$&&$.d(),D&&D.d(),E&&E.d(t),C.d(),T(a,t),b=!1,y()}}}function qc(t,e,n){let i,{$$slots:r={},$$scope:o}=e,{value:l,alt:s,w:c=0,h:a=0,zoom:u=!1,contain:f=!1,cover:d=!1,center:h=!1}=e;return t.$$set=t=>{"value"in t&&n(0,l=t.value),"alt"in t&&n(1,s=t.alt),"w"in t&&n(2,c=t.w),"h"in t&&n(3,a=t.h),"zoom"in t&&n(4,u=t.zoom),"contain"in t&&n(5,f=t.contain),"cover"in t&&n(6,d=t.cover),"center"in t&&n(7,h=t.center),"$$scope"in t&&n(13,o=t.$$scope)},[l,s,c,a,u,f,d,h,i,r,function(e){V.call(this,t,e)},()=>{n(8,i=!0)},()=>{n(8,i=!1)},o]}class Gc extends t{constructor(t){super(),e(this,t,qc,Yc,n,{value:0,alt:1,w:2,h:3,zoom:4,contain:5,cover:6,center:7})}}function Xc(t,e,n){const i=t.slice();return i[23]=e[n],i[25]=n,i}function Wc(t,e,n){const i=t.slice();return i[23]=e[n],i[25]=n,i}function Kc(t){let e,n,i;return n=new Ar({props:{id:t[1]}}),{c(){e=d("div"),F(n.$$.fragment),c(e,"class","label pt-1 h-6")},m(t,r){u(t,e,r),N(n,e,null),i=!0},p(t,e){const i={};2&e&&(i.id=t[1]),n.$set(i)},i(t){i||(w(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&l(e),T(n)}}}function Jc(t){let e,n,i,r,o=t[1]&&(t[2]||t[5])&&ta(t),s=B(t[7]),a=[];for(let e=0;e<s.length;e+=1)a[e]=ia(Xc(t,s,e));const f=t=>m(a[t],1,1,()=>{a[t]=null});return{c(){e=d("div"),o&&o.c(),n=_(),i=d("div");for(let t=0;t<a.length;t+=1)a[t].c();c(i,"class","flexrow items-center cursor-pointer text-sm"),c(e,"class","flexrow space-x-1 items-center overflow-x-hidden"),y(e,"mt-2",t[2])},m(t,l){u(t,e,l),o&&o.m(e,null),k(e,n),k(e,i);for(let t=0;t<a.length;t+=1)a[t]&&a[t].m(i,null);r=!0},p(t,l){if(t[1]&&(t[2]||t[5])?o?(o.p(t,l),38&l&&w(o,1)):(o=ta(t),o.c(),w(o,1),o.m(e,n)):o&&(z(),m(o,1,1,()=>{o=null}),M()),3777&l){let e;for(s=B(t[7]),e=0;e<s.length;e+=1){const n=Xc(t,s,e);a[e]?(a[e].p(n,l),w(a[e],1)):(a[e]=ia(n),a[e].c(),w(a[e],1),a[e].m(i,null))}for(z(),e=s.length;e<a.length;e+=1)f(e);M()}(!r||4&l)&&y(e,"mt-2",t[2])},i(t){if(!r){w(o);for(let t=0;t<s.length;t+=1)w(a[t]);r=!0}},o(t){m(o),a=a.filter(Boolean);for(let t=0;t<a.length;t+=1)m(a[t]);r=!1},d(t){t&&l(e),o&&o.d(),H(a,t)}}}function Qc(t){let e,n,i=B(t[7]),r=[];for(let e=0;e<i.length;e+=1)r[e]=la(Wc(t,i,e));const o=t=>m(r[t],1,1,()=>{r[t]=null});return{c(){e=d("div");for(let t=0;t<r.length;t+=1)r[t].c();c(e,"class","flex flex-col w-full items-center cursor-pointer text-sm")},m(t,i){u(t,e,i);for(let t=0;t<r.length;t+=1)r[t]&&r[t].m(e,null);n=!0},p(t,n){if(3777&n){let l;for(i=B(t[7]),l=0;l<i.length;l+=1){const o=Wc(t,i,l);r[l]?(r[l].p(o,n),w(r[l],1)):(r[l]=la(o),r[l].c(),w(r[l],1),r[l].m(e,null))}for(z(),l=i.length;l<r.length;l+=1)o(l);M()}},i(t){if(!n){for(let t=0;t<i.length;t+=1)w(r[t]);n=!0}},o(t){r=r.filter(Boolean);for(let t=0;t<r.length;t+=1)m(r[t]);n=!1},d(t){t&&l(e),H(r,t)}}}function ta(t){let e,n,i,r;return n=new Ar({props:{id:t[1]}}),{c(){e=d("div"),F(n.$$.fragment),c(e,"class","label leading-none text-right pr-2"),c(e,"style",i=`width: ${t[8]}%;`)},m(t,i){u(t,e,i),N(n,e,null),r=!0},p(t,o){const l={};2&o&&(l.id=t[1]),n.$set(l),(!r||256&o&&i!==(i=`width: ${t[8]}%;`))&&c(e,"style",i)},i(t){r||(w(n.$$.fragment,t),r=!0)},o(t){m(n.$$.fragment,t),r=!1},d(t){t&&l(e),T(n)}}}function ea(t){let e,n=t[10](t[25],t[7],t[0])+"";return{c(){e=$(n)},m(t,n){u(t,e,n)},p(t,i){129&i&&n!==(n=t[10](t[25],t[7],t[0])+"")&&b(e,n)},i:o,o:o,d(t){t&&l(e)}}}function na(t){let e,n;return e=new ar({props:{size:6,img:t[23].img}}),{c(){F(e.$$.fragment)},m(t,i){N(e,t,i),n=!0},p(t,n){const i={};128&n&&(i.img=t[23].img),e.$set(i)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){T(e,t)}}}function ia(t){let e,n,i,r,o,s,a,h;const p=[na,ea],b=[];function g(t,e){return t[23].img?0:1}function v(){return t[18](t[23])}return n=g(t),i=b[n]=p[n](t),{c(){e=d("button"),i.c(),r=_(),c(e,"name",`imulti${t[25]}`),c(e,"class",o=t[11](t[25],t[7],t[0]))},m(t,i){u(t,e,i),b[n].m(e,null),k(e,r),s=!0,a||(h=f(e,"click",O(v)),a=!0)},p(l,a){let u=n;n=g(t=l),n===u?b[n].p(t,a):(z(),m(b[u],1,1,()=>{b[u]=null}),M(),i=b[n],i?i.p(t,a):(i=b[n]=p[n](t),i.c()),w(i,1),i.m(e,r)),(!s||129&a&&o!==(o=t[11](t[25],t[7],t[0])))&&c(e,"class",o)},i(t){s||(w(i),s=!0)},o(t){m(i),s=!1},d(t){t&&l(e),b[n].d(),a=!1,h()}}}function ra(t){let e,n=t[10](t[25],t[7],t[0])+"";return{c(){e=$(n)},m(t,n){u(t,e,n)},p(t,i){129&i&&n!==(n=t[10](t[25],t[7],t[0])+"")&&b(e,n)},i:o,o:o,d(t){t&&l(e)}}}function oa(t){let e,n;return e=new ar({props:{size:6,img:t[23].img}}),{c(){F(e.$$.fragment)},m(t,i){N(e,t,i),n=!0},p(t,n){const i={};128&n&&(i.img=t[23].img),e.$set(i)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){T(e,t)}}}function la(t){let e,n,i,r,o,s,a,h;const p=[oa,ra],b=[];function g(t,e){return t[23].img?0:1}function v(){return t[17](t[23])}return n=g(t),i=b[n]=p[n](t),{c(){e=d("button"),i.c(),r=_(),c(e,"name",`imulti${t[25]}`),c(e,"class",o=t[11](t[25],t[7],t[0]))},m(t,i){u(t,e,i),b[n].m(e,null),k(e,r),s=!0,a||(h=f(e,"click",v),a=!0)},p(l,a){let u=n;n=g(t=l),n===u?b[n].p(t,a):(z(),m(b[u],1,1,()=>{b[u]=null}),M(),i=b[n],i?i.p(t,a):(i=b[n]=p[n](t),i.c()),w(i,1),i.m(e,r)),(!s||129&a&&o!==(o=t[11](t[25],t[7],t[0])))&&c(e,"class",o)},i(t){s||(w(i),s=!0)},o(t){m(i),s=!1},d(t){t&&l(e),b[n].d(),a=!1,h()}}}function sa(t){let e,n,i,r;const o=[Qc,Jc],s=[];function c(t,e){return t[3]?0:1}return e=c(t),n=s[e]=o[e](t),{c(){n.c(),i=S()},m(t,n){s[e].m(t,n),u(t,i,n),r=!0},p(t,r){let l=e;e=c(t),e===l?s[e].p(t,r):(z(),m(s[l],1,1,()=>{s[l]=null}),M(),n=s[e],n?n.p(t,r):(n=s[e]=o[e](t),n.c()),w(n,1),n.m(i.parentNode,i))},i(t){r||(w(n),r=!0)},o(t){m(n),r=!1},d(t){t&&l(i),s[e].d(t)}}}function ca(t){let e,n,i,r,o,s=t[1]&&(!t[2]&&!t[5]||t[3])&&Kc(t);return i=new xr({props:{tooltip:t[4],$$slots:{default:[sa]},$$scope:{ctx:t}}}),{c(){e=d("label"),s&&s.c(),n=_(),F(i.$$.fragment),c(e,"class",r=`labinput ${t[12].class||""}`)},m(t,r){u(t,e,r),s&&s.m(e,null),k(e,n),N(i,e,null),o=!0},p(t,[l]){t[1]&&(!t[2]&&!t[5]||t[3])?s?(s.p(t,l),46&l&&w(s,1)):(s=Kc(t),s.c(),w(s,1),s.m(e,n)):s&&(z(),m(s,1,1,()=>{s=null}),M());const a={};16&l&&(a.tooltip=t[4]),134218223&l&&(a.$$scope={dirty:l,ctx:t}),i.$set(a),(!o||4096&l&&r!==(r=`labinput ${t[12].class||""}`))&&c(e,"class",r)},i(t){o||(w(s),w(i.$$.fragment,t),o=!0)},o(t){m(s),m(i.$$.fragment,t),o=!1},d(t){t&&l(e),s&&s.d(),T(i)}}}function aa(t,e,n){let o,l;const{_:s,listfromstring:c}=fr(),a=W();let{value:u="",label:f="",black:d=!1,oriz:h=!1,vert:p=!1,tooltip:m="",options:w=[],info:b="",sm:g=!1,xs:v=!1,readonly:x=!1}=e;function y(t){if(t>=0&&t<l.length){var e=l[t];if("string"==typeof e){if(e==u)return!0}else if(e.id==u||e.cod==u)return!0}return!1}return t.$$set=t=>{n(12,e=i(i({},e),r(t))),"value"in t&&n(0,u=t.value),"label"in t&&n(1,f=t.label),"black"in t&&n(13,d=t.black),"oriz"in t&&n(2,h=t.oriz),"vert"in t&&n(3,p=t.vert),"tooltip"in t&&n(4,m=t.tooltip),"options"in t&&n(14,w=t.options),"info"in t&&n(15,b=t.info),"sm"in t&&n(5,g=t.sm),"xs"in t&&n(16,v=t.xs),"readonly"in t&&n(6,x=t.readonly)},t.$$.update=()=>{4&t.$$.dirty&&n(8,o=h&&parseInt(h)>10?parseInt(h):40),49152&t.$$.dirty&&n(7,l=w?c(w).filter(t=>!t.valid||t.valid()):[])},e=r(e),[u,f,h,p,m,g,x,l,o,a,function(t){var e="";if(t>=0&&t<l.length){var n=l[t];e="string"==typeof n?n:n.des||n.id||n.cod||""}return e},function(t){var e=[];return e.push("border-c-border px-2 hover:border-c-base"),e.push(g?"h-6 text-xs":v?"h-4 text-xxs":"h-8 text-sm "),p&&e.push("w-full"),d?e.push(y(t)?"bg-c-base text-white rounded":""):(0==t?e.push(p?"rounded-t-md border":"rounded-l-md border"):(e.push(p?"border-x border-b":"border-r border-y"),t==l.length-1&&e.push(p?"rounded-b-md":"rounded-r-md")),x?e.push(y(t)?"bg-c-200 text-white":"bg-white text-c-200"):e.push(y(t)?"bg-c-base text-white":"bg-white")),e.join(" ")},e,d,w,b,v,t=>{x||(n(0,u="string"==typeof t?t:t.cod?t.cod:t.id),a("click",t))},t=>{x||(n(0,u="string"==typeof t?t:t.cod?t.cod:t.id),a("click",t))}]}class ua extends t{constructor(t){super(),e(this,t,aa,ca,n,{value:0,label:1,black:13,oriz:2,vert:3,tooltip:4,options:14,info:15,sm:5,xs:16,readonly:6})}}function fa(t,e,n){const i=t.slice();return i[9]=e[n],i}function da(t,e,n){const i=t.slice();return i[8]=e[n],i}function ha(t,e,n){const i=t.slice();return i[9]=e[n],i[13]=n,i}function pa(t,e,n){const i=t.slice();return i[8]=e[n][0],i[9]=e[n][1],i}function ma(t){let e,n,i,r,s,a,f=t[2]&&ba(t);return{c(){e=d("p"),f&&f.c(),n=_(),i=d("span"),r=$(t[3]),D(i,"white-space","pre"),c(i,"class",s=`json_${t[6]}`),c(e,"style",a=`margin-left: ${.8*t[1]}em`)},m(t,o){u(t,e,o),f&&f.m(e,null),k(e,n),k(e,i),k(i,r)},p(t,o){t[2]?f?f.p(t,o):(f=ba(t),f.c(),f.m(e,n)):f&&(f.d(1),f=null),8&o&&b(r,t[3]),64&o&&s!==(s=`json_${t[6]}`)&&c(i,"class",s),2&o&&a!==(a=`margin-left: ${.8*t[1]}em`)&&c(e,"style",a)},i:o,o:o,d(t){t&&l(e),f&&f.d()}}}function wa(t){let e,n,i,r;const o=[va,ga],s=[];function c(t,e){return t[5]?0:1}return e=c(t),n=s[e]=o[e](t),{c(){n.c(),i=S()},m(t,n){s[e].m(t,n),u(t,i,n),r=!0},p(t,r){let l=e;e=c(t),e===l?s[e].p(t,r):(z(),m(s[l],1,1,()=>{s[l]=null}),M(),n=s[e],n?n.p(t,r):(n=s[e]=o[e](t),n.c()),w(n,1),n.m(i.parentNode,i))},i(t){r||(w(n),r=!0)},o(t){m(n),r=!1},d(t){t&&l(i),s[e].d(t)}}}function ba(t){let e,n,i,r;return{c(){e=d("span"),n=$(t[2]),i=_(),r=d("span"),D(e,"white-space","pre"),c(e,"class","json_key"),c(r,"class","json_dot")},m(t,o){u(t,e,o),k(e,n),u(t,i,o),u(t,r,o)},p(t,e){4&e&&b(n,t[2])},d(t){t&&(l(e),l(i),l(r))}}}function ga(t){let e,n,i,r,o,s,a,h,p=t[2]&&xa(t),b=t[0]&&ya(t);return{c(){e=d("details"),n=d("summary"),p&&p.c(),i=_(),b&&b.c(),c(e,"style",r=`margin-left: ${.8*t[1]}em`),c(e,"class",o=`json_${t[6]}`)},m(r,o){u(r,e,o),k(e,n),p&&p.m(n,null),k(e,i),b&&b.m(e,null),e.open=t[0],s=!0,a||(h=f(e,"toggle",t[7]),a=!0)},p(t,i){t[2]?p?p.p(t,i):(p=xa(t),p.c(),p.m(n,null)):p&&(p.d(1),p=null),t[0]?b?(b.p(t,i),1&i&&w(b,1)):(b=ya(t),b.c(),w(b,1),b.m(e,null)):b&&(z(),m(b,1,1,()=>{b=null}),M()),(!s||2&i&&r!==(r=`margin-left: ${.8*t[1]}em`))&&c(e,"style",r),(!s||64&i&&o!==(o=`json_${t[6]}`))&&c(e,"class",o),1&i&&(e.open=t[0])},i(t){s||(w(b),s=!0)},o(t){m(b),s=!1},d(t){t&&l(e),p&&p.d(),b&&b.d(),a=!1,h()}}}function va(t){let e,n,i,r,o,s,a=t[2]&&Sa(t);const f=[Ma,za],h=[];function p(t,e){return"object"==t[6]?0:"array"==t[6]?1:-1}return~(r=p(t))&&(o=h[r]=f[r](t)),{c(){e=d("div"),a&&a.c(),n=_(),i=d("table"),o&&o.c(),c(i,"class","json-table"),c(e,"class","json-table-container")},m(t,o){u(t,e,o),a&&a.m(e,null),k(e,n),k(e,i),~r&&h[r].m(i,null),s=!0},p(t,l){t[2]?a?a.p(t,l):(a=Sa(t),a.c(),a.m(e,n)):a&&(a.d(1),a=null);let s=r;r=p(t),r===s?~r&&h[r].p(t,l):(o&&(z(),m(h[s],1,1,()=>{h[s]=null}),M()),~r?(o=h[r],o?o.p(t,l):(o=h[r]=f[r](t),o.c()),w(o,1),o.m(i,null)):o=null)},i(t){s||(w(o),s=!0)},o(t){m(o),s=!1},d(t){t&&l(e),a&&a.d(),~r&&h[r].d()}}}function xa(t){let e,n,i,r;return{c(){e=d("span"),n=$(t[2]),i=_(),r=d("span"),c(e,"class","json_key"),c(r,"class","json_dot")},m(t,o){u(t,e,o),k(e,n),u(t,i,o),u(t,r,o)},p(t,e){4&e&&b(n,t[2])},d(t){t&&(l(e),l(i),l(r))}}}function ya(t){let e,n,i,r;const o=[$a,ka],s=[];function c(t,e){return"object"==t[6]?0:1}return e=c(t),n=s[e]=o[e](t),{c(){n.c(),i=S()},m(t,n){s[e].m(t,n),u(t,i,n),r=!0},p(t,r){let l=e;e=c(t),e===l?s[e].p(t,r):(z(),m(s[l],1,1,()=>{s[l]=null}),M(),n=s[e],n?n.p(t,r):(n=s[e]=o[e](t),n.c()),w(n,1),n.m(i.parentNode,i))},i(t){r||(w(n),r=!0)},o(t){m(n),r=!1},d(t){t&&l(i),s[e].d(t)}}}function ka(t){let e,n,i=B(t[3]),r=[];for(let e=0;e<i.length;e+=1)r[e]=_a(fa(t,i,e));const o=t=>m(r[t],1,1,()=>{r[t]=null});return{c(){for(let t=0;t<r.length;t+=1)r[t].c();e=S()},m(t,i){for(let e=0;e<r.length;e+=1)r[e]&&r[e].m(t,i);u(t,e,i),n=!0},p(t,n){if(24&n){let l;for(i=B(t[3]),l=0;l<i.length;l+=1){const o=fa(t,i,l);r[l]?(r[l].p(o,n),w(r[l],1)):(r[l]=_a(o),r[l].c(),w(r[l],1),r[l].m(e.parentNode,e))}for(z(),l=i.length;l<r.length;l+=1)o(l);M()}},i(t){if(!n){for(let t=0;t<i.length;t+=1)w(r[t]);n=!0}},o(t){r=r.filter(Boolean);for(let t=0;t<r.length;t+=1)m(r[t]);n=!1},d(t){t&&l(e),H(r,t)}}}function $a(t){let e,n,i=B(Object.keys(t[3])),r=[];for(let e=0;e<i.length;e+=1)r[e]=Da(da(t,i,e));const o=t=>m(r[t],1,1,()=>{r[t]=null});return{c(){for(let t=0;t<r.length;t+=1)r[t].c();e=S()},m(t,i){for(let e=0;e<r.length;e+=1)r[e]&&r[e].m(t,i);u(t,e,i),n=!0},p(t,n){if(24&n){let l;for(i=B(Object.keys(t[3])),l=0;l<i.length;l+=1){const o=da(t,i,l);r[l]?(r[l].p(o,n),w(r[l],1)):(r[l]=Da(o),r[l].c(),w(r[l],1),r[l].m(e.parentNode,e))}for(z(),l=i.length;l<r.length;l+=1)o(l);M()}},i(t){if(!n){for(let t=0;t<i.length;t+=1)w(r[t]);n=!0}},o(t){r=r.filter(Boolean);for(let t=0;t<r.length;t+=1)m(r[t]);n=!1},d(t){t&&l(e),H(r,t)}}}function _a(t){let e,n;return e=new Ia({props:{space:2,name:"",value:t[9],fullopen:t[4],open:t[4]}}),{c(){F(e.$$.fragment)},m(t,i){N(e,t,i),n=!0},p(t,n){const i={};8&n&&(i.value=t[9]),16&n&&(i.fullopen=t[4]),16&n&&(i.open=t[4]),e.$set(i)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){T(e,t)}}}function Da(t){let e,n;return e=new Ia({props:{space:1,name:t[8],value:t[3][t[8]],fullopen:t[4],open:t[4]}}),{c(){F(e.$$.fragment)},m(t,i){N(e,t,i),n=!0},p(t,n){const i={};8&n&&(i.name=t[8]),8&n&&(i.value=t[3][t[8]]),16&n&&(i.fullopen=t[4]),16&n&&(i.open=t[4]),e.$set(i)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){T(e,t)}}}function Sa(t){let e,n;return{c(){e=d("div"),n=$(t[2]),c(e,"class","json-table-title")},m(t,i){u(t,e,i),k(e,n)},p(t,e){4&e&&b(n,t[2])},d(t){t&&l(e)}}}function za(t){let e,n,i,r,o=B(t[3]),s=[];for(let e=0;e<o.length;e+=1)s[e]=Aa(ha(t,o,e));const c=t=>m(s[t],1,1,()=>{s[t]=null});return{c(){e=d("thead"),e.innerHTML="<tr><th>Indice</th> <th>Valore</th></tr>",n=_(),i=d("tbody");for(let t=0;t<s.length;t+=1)s[t].c()},m(t,o){u(t,e,o),u(t,n,o),u(t,i,o);for(let t=0;t<s.length;t+=1)s[t]&&s[t].m(i,null);r=!0},p(t,e){if(24&e){let n;for(o=B(t[3]),n=0;n<o.length;n+=1){const r=ha(t,o,n);s[n]?(s[n].p(r,e),w(s[n],1)):(s[n]=Aa(r),s[n].c(),w(s[n],1),s[n].m(i,null))}for(z(),n=o.length;n<s.length;n+=1)c(n);M()}},i(t){if(!r){for(let t=0;t<o.length;t+=1)w(s[t]);r=!0}},o(t){s=s.filter(Boolean);for(let t=0;t<s.length;t+=1)m(s[t]);r=!1},d(t){t&&(l(e),l(n),l(i)),H(s,t)}}}function Ma(t){let e,n,i,r,o=B(Object.entries(t[3])),s=[];for(let e=0;e<o.length;e+=1)s[e]=Na(pa(t,o,e));const c=t=>m(s[t],1,1,()=>{s[t]=null});return{c(){e=d("thead"),e.innerHTML="<tr><th>Chiave</th> <th>Valore</th></tr>",n=_(),i=d("tbody");for(let t=0;t<s.length;t+=1)s[t].c()},m(t,o){u(t,e,o),u(t,n,o),u(t,i,o);for(let t=0;t<s.length;t+=1)s[t]&&s[t].m(i,null);r=!0},p(t,e){if(24&e){let n;for(o=B(Object.entries(t[3])),n=0;n<o.length;n+=1){const r=pa(t,o,n);s[n]?(s[n].p(r,e),w(s[n],1)):(s[n]=Na(r),s[n].c(),w(s[n],1),s[n].m(i,null))}for(z(),n=o.length;n<s.length;n+=1)c(n);M()}},i(t){if(!r){for(let t=0;t<o.length;t+=1)w(s[t]);r=!0}},o(t){s=s.filter(Boolean);for(let t=0;t<s.length;t+=1)m(s[t]);r=!1},d(t){t&&(l(e),l(n),l(i)),H(s,t)}}}function Ea(t){let e,n,i,r=t[9]+"";return{c(){e=d("span"),n=$(r),c(e,"class",i="json_"+typeof t[9])},m(t,i){u(t,e,i),k(e,n)},p(t,o){8&o&&r!==(r=t[9]+"")&&b(n,r),8&o&&i!==(i="json_"+typeof t[9])&&c(e,"class",i)},i:o,o:o,d(t){t&&l(e)}}}function ja(t){let e,n;return e=new Ia({props:{name:"",value:t[9],fullopen:t[4],open:t[4],tabular:!0}}),{c(){F(e.$$.fragment)},m(t,i){N(e,t,i),n=!0},p(t,n){const i={};8&n&&(i.value=t[9]),16&n&&(i.fullopen=t[4]),16&n&&(i.open=t[4]),e.$set(i)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){T(e,t)}}}function Aa(t){let e,n,i,r,o,s,a,f;const h=[ja,Ea],p=[];function b(t,e){return"object"==typeof t[9]&&null!==t[9]?0:1}return o=b(t),s=p[o]=h[o](t),{c(){e=d("tr"),n=d("td"),n.textContent=`${t[13]}`,i=_(),r=d("td"),s.c(),a=_(),c(n,"class","json-table-key")},m(t,l){u(t,e,l),k(e,n),k(e,i),k(e,r),p[o].m(r,null),k(e,a),f=!0},p(t,e){let n=o;o=b(t),o===n?p[o].p(t,e):(z(),m(p[n],1,1,()=>{p[n]=null}),M(),s=p[o],s?s.p(t,e):(s=p[o]=h[o](t),s.c()),w(s,1),s.m(r,null))},i(t){f||(w(s),f=!0)},o(t){m(s),f=!1},d(t){t&&l(e),p[o].d()}}}function Ca(t){let e,n,i,r=t[9]+"";return{c(){e=d("span"),n=$(r),c(e,"class",i="json_"+typeof t[9])},m(t,i){u(t,e,i),k(e,n)},p(t,o){8&o&&r!==(r=t[9]+"")&&b(n,r),8&o&&i!==(i="json_"+typeof t[9])&&c(e,"class",i)},i:o,o:o,d(t){t&&l(e)}}}function Ta(t){let e,n;return e=new Ia({props:{name:"",value:t[9],fullopen:t[4],open:t[4],tabular:!0}}),{c(){F(e.$$.fragment)},m(t,i){N(e,t,i),n=!0},p(t,n){const i={};8&n&&(i.value=t[9]),16&n&&(i.fullopen=t[4]),16&n&&(i.open=t[4]),e.$set(i)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){T(e,t)}}}function Na(t){let e,n,i,r,o,s,a,f,h,p=t[8]+"";const g=[Ta,Ca],v=[];function x(t,e){return"object"==typeof t[9]&&null!==t[9]?0:1}return s=x(t),a=v[s]=g[s](t),{c(){e=d("tr"),n=d("td"),i=$(p),r=_(),o=d("td"),a.c(),f=_(),c(n,"class","json-table-key")},m(t,l){u(t,e,l),k(e,n),k(n,i),k(e,r),k(e,o),v[s].m(o,null),k(e,f),h=!0},p(t,e){(!h||8&e)&&p!==(p=t[8]+"")&&b(i,p);let n=s;s=x(t),s===n?v[s].p(t,e):(z(),m(v[n],1,1,()=>{v[n]=null}),M(),a=v[s],a?a.p(t,e):(a=v[s]=g[s](t),a.c()),w(a,1),a.m(o,null))},i(t){h||(w(a),h=!0)},o(t){m(a),h=!1},d(t){t&&l(e),v[s].d()}}}function Oa(t){let e,n,i,r;const o=[wa,ma],s=[];function c(t,e){return"object"==t[6]||"array"==t[6]?0:1}return e=c(t),n=s[e]=o[e](t),{c(){n.c(),i=S()},m(t,n){s[e].m(t,n),u(t,i,n),r=!0},p(t,[r]){let l=e;e=c(t),e===l?s[e].p(t,r):(z(),m(s[l],1,1,()=>{s[l]=null}),M(),n=s[e],n?n.p(t,r):(n=s[e]=o[e](t),n.c()),w(n,1),n.m(i.parentNode,i))},i(t){r||(w(n),r=!0)},o(t){m(n),r=!1},d(t){t&&l(i),s[e].d(t)}}}function Fa(t,e,n){let i,{space:r=0}=e,{name:o=""}=e,{value:l}=e,{fullopen:s=!1}=e,{open:c=!1}=e,{tabular:a=!1}=e;return t.$$set=t=>{"space"in t&&n(1,r=t.space),"name"in t&&n(2,o=t.name),"value"in t&&n(3,l=t.value),"fullopen"in t&&n(4,s=t.fullopen),"open"in t&&n(0,c=t.open),"tabular"in t&&n(5,a=t.tabular)},t.$$.update=()=>{8&t.$$.dirty&&(Array.isArray(l)?n(6,i="array"):n(6,i=null===l?"null":typeof l))},[c,r,o,l,s,a,i,function(){c=this.open,n(0,c)}]}class Ia extends t{constructor(t){super(),e(this,t,Fa,Oa,n,{space:1,name:2,value:3,fullopen:4,open:0,tabular:5})}}function Ra(t){let e,n,i,r,o,l,s,c;function a(e){t[15](e)}function u(e){t[16](e)}function f(e){t[17](e)}function d(e){t[18](e)}function p(e){t[19](e)}function b(e){t[20](e)}let g={};return void 0!==t[0]&&(g.space=t[0]),void 0!==t[1]&&(g.name=t[1]),void 0!==t[2]&&(g.value=t[2]),void 0!==t[3]&&(g.fullopen=t[3]),void 0!==t[4]&&(g.open=t[4]),void 0!==t[5]&&(g.tabular=t[5]),e=new Ia({props:g}),h.push(()=>Z(e,"space",a)),h.push(()=>Z(e,"name",u)),h.push(()=>Z(e,"value",f)),h.push(()=>Z(e,"fullopen",d)),h.push(()=>Z(e,"open",p)),h.push(()=>Z(e,"tabular",b)),{c(){F(e.$$.fragment)},m(t,n){N(e,t,n),c=!0},p(t,c){const a={};!n&&1&c&&(n=!0,a.space=t[0],Y(()=>n=!1)),!i&&2&c&&(i=!0,a.name=t[1],Y(()=>i=!1)),!r&&4&c&&(r=!0,a.value=t[2],Y(()=>r=!1)),!o&&8&c&&(o=!0,a.fullopen=t[3],Y(()=>o=!1)),!l&&16&c&&(l=!0,a.open=t[4],Y(()=>l=!1)),!s&&32&c&&(s=!0,a.tabular=t[5],Y(()=>s=!1)),e.$set(a)},i(t){c||(w(e.$$.fragment,t),c=!0)},o(t){m(e.$$.fragment,t),c=!1},d(t){T(e,t)}}}function La(t){let e,n,i,r,o,s,a,p,b,g,v,x,y,$;function D(e){t[9](e)}function S(e){t[10](e)}function z(e){t[11](e)}function M(e){t[12](e)}function E(e){t[13](e)}function j(e){t[14](e)}i=new xr({props:{tooltip:"copia clipboard",$$slots:{default:[Ba]},$$scope:{ctx:t}}});let A={};return void 0!==t[0]&&(A.space=t[0]),void 0!==t[1]&&(A.name=t[1]),void 0!==t[2]&&(A.value=t[2]),void 0!==t[3]&&(A.fullopen=t[3]),void 0!==t[4]&&(A.open=t[4]),void 0!==t[5]&&(A.tabular=t[5]),o=new Ia({props:A}),h.push(()=>Z(o,"space",D)),h.push(()=>Z(o,"name",S)),h.push(()=>Z(o,"value",z)),h.push(()=>Z(o,"fullopen",M)),h.push(()=>Z(o,"open",E)),h.push(()=>Z(o,"tabular",j)),{c(){e=d("div"),n=d("button"),F(i.$$.fragment),r=_(),F(o.$$.fragment),c(n,"class","absolute top-0 right-4"),c(e,"class","relative")},m(l,s){u(l,e,s),k(e,n),N(i,n,null),k(e,r),N(o,e,null),x=!0,y||($=f(n,"click",t[8]),y=!0)},p(t,e){const n={};2097152&e&&(n.$$scope={dirty:e,ctx:t}),i.$set(n);const r={};!s&&1&e&&(s=!0,r.space=t[0],Y(()=>s=!1)),!a&&2&e&&(a=!0,r.name=t[1],Y(()=>a=!1)),!p&&4&e&&(p=!0,r.value=t[2],Y(()=>p=!1)),!b&&8&e&&(b=!0,r.fullopen=t[3],Y(()=>b=!1)),!g&&16&e&&(g=!0,r.open=t[4],Y(()=>g=!1)),!v&&32&e&&(v=!0,r.tabular=t[5],Y(()=>v=!1)),o.$set(r)},i(t){x||(w(i.$$.fragment,t),w(o.$$.fragment,t),x=!0)},o(t){m(i.$$.fragment,t),m(o.$$.fragment,t),x=!1},d(t){t&&l(e),T(i),T(o),y=!1,$()}}}function Ba(t){let e;return{c(){e=$("π")},m(t,n){u(t,e,n)},d(t){t&&l(e)}}}function Ha(t){let e,n,i,r;const o=[La,Ra],s=[];function c(t,e){return t[2]&&navigator&&!t[6]?0:1}return e=c(t),n=s[e]=o[e](t),{c(){n.c(),i=S()},m(t,n){s[e].m(t,n),u(t,i,n),r=!0},p(t,[r]){let l=e;e=c(t),e===l?s[e].p(t,r):(z(),m(s[l],1,1,()=>{s[l]=null}),M(),n=s[e],n?n.p(t,r):(n=s[e]=o[e](t),n.c()),w(n,1),n.m(i.parentNode,i))},i(t){r||(w(n),r=!0)},o(t){m(n),r=!1},d(t){t&&l(i),s[e].d(t)}}}function Pa(t,e,n){const{bus:i}=fr();let{noclip:r=!1}=e,{space:o=0}=e,{name:l=""}=e,{value:s}=e,{fullopen:c=!1}=e,{open:a=!1}=e,{tabular:u=!1}=e;return t.$$set=t=>{"noclip"in t&&n(6,r=t.noclip),"space"in t&&n(0,o=t.space),"name"in t&&n(1,l=t.name),"value"in t&&n(2,s=t.value),"fullopen"in t&&n(3,c=t.fullopen),"open"in t&&n(4,a=t.open),"tabular"in t&&n(5,u=t.tabular)},[o,l,s,c,a,u,r,i,t=>{navigator.clipboard.writeText(JSON.stringify(s,null,2)),i.messaggio("copiato")},function(t){o=t,n(0,o)},function(t){l=t,n(1,l)},function(t){s=t,n(2,s)},function(t){c=t,n(3,c)},function(t){a=t,n(4,a)},function(t){u=t,n(5,u)},function(t){o=t,n(0,o)},function(t){l=t,n(1,l)},function(t){s=t,n(2,s)},function(t){c=t,n(3,c)},function(t){a=t,n(4,a)},function(t){u=t,n(5,u)}]}class Ua extends t{constructor(t){super(),e(this,t,Pa,Ha,n,{noclip:6,space:0,name:1,value:2,fullopen:3,open:4,tabular:5})}}function Va(t){let e;return{c(){e=d("link"),c(e,"rel","stylesheet"),c(e,"href",t[2]),c(e,"integrity",t[3]),c(e,"crossorigin","")},m(t,n){u(t,e,n)},p(t,n){4&n&&c(e,"href",t[2]),8&n&&c(e,"integrity",t[3])},d(t){t&&l(e)}}}function Za(t){let e,n,i=t[2]&&Va(t);return{c(){i&&i.c(),e=d("script"),P(e.src,n=t[0])||c(e,"src",n),c(e,"integrity",t[1]),c(e,"crossorigin","")},m(n,r){i&&i.m(document.head,null),k(document.head,e),t[5](e)},p(t,[r]){t[2]?i?i.p(t,r):(i=Va(t),i.c(),i.m(e.parentNode,e)):i&&(i.d(1),i=null),1&r&&!P(e.src,n=t[0])&&c(e,"src",n),2&r&&c(e,"integrity",t[1])},i:o,o:o,d(n){i&&i.d(n),l(e),t[5](null)}}}function Ya(t,e,n){const i=W();let r,{url:o="",integrity:l="",css:s="",cssintegrity:c=""}=e;function a(t){i("error",t)}function u(t){i("loaded",t)}return G(async()=>{r.addEventListener("load",u),r.addEventListener("error",a)}),t.$$set=t=>{"url"in t&&n(0,o=t.url),"integrity"in t&&n(1,l=t.integrity),"css"in t&&n(2,s=t.css),"cssintegrity"in t&&n(3,c=t.cssintegrity)},[o,l,s,c,r,function(t){h[t?"unshift":"push"](()=>{r=t,n(4,r)})}]}class qa extends t{constructor(t){super(),e(this,t,Ya,Za,n,{url:0,integrity:1,css:2,cssintegrity:3})}}function Ga(t,e,n){const i=t.slice();return i[2]=e[n],i}function Xa(t){let e,n,i,r,o=t[2]+"";return{c(){e=d("p"),n=d("span"),i=$(o),r=$("\n Lorem ipsum dolor sit, amet consectetur adipisicing elit. Quam ea quibusdam possimus vero quas rem. Maiores ab cumque asperiores fugiat quidem commodi. Ut exercitationem perferendis sunt dolore mollitia iusto, recusandae rem dolor. Maiores expedita temporibus impedit eligendi ea tempore aspernatur esse voluptas. Aspernatur esse, numquam, est quaerat, deserunt repellat qui dolores voluptatibus voluptates neque iste tempore totam. Laboriosam, neque tempore?\n "),c(n,"class","text-3xl pr-2"),c(e,"class","my-2")},m(t,o){u(t,e,o),k(e,n),k(n,i),k(e,r)},p(t,e){1&e&&o!==(o=t[2]+"")&&b(i,o)},d(t){t&&l(e)}}}function Wa(t){let e,n=B(t[0]),i=[];for(let e=0;e<n.length;e+=1)i[e]=Xa(Ga(t,n,e));return{c(){for(let t=0;t<i.length;t+=1)i[t].c();e=S()},m(t,n){for(let e=0;e<i.length;e+=1)i[e]&&i[e].m(t,n);u(t,e,n)},p(t,[r]){if(1&r){let o;for(n=B(t[0]),o=0;o<n.length;o+=1){const l=Ga(t,n,o);i[o]?i[o].p(l,r):(i[o]=Xa(l),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=n.length}},i:o,o:o,d(t){t&&l(e),H(i,t)}}}function Ka(t,e,n){let i,{n:r=10}=e;return t.$$set=t=>{"n"in t&&n(1,r=t.n)},t.$$.update=()=>{2&t.$$.dirty&&n(0,i=(t=>{for(var e=[],n=1;n<=t;n++)e.push(n);return e})(r))},[i,r]}class Ja extends t{constructor(t){super(),e(this,t,Ka,Wa,n,{n:1})}}const Qa=t=>t;function tu(t){return Math.sin(-13*(t+1)*Math.PI/2)*Math.pow(2,-10*t)+1}function eu(t){let e,n,i,r,o,s,a,f,h,p,b,g,v,x,y;r=new ar({props:{img:t[4],size:10,black:!0}});let $=t[0]&&nu(t);p=new Qr({props:{sm:!0,black:!0,value:"chiudi"}}),p.$on("click",t[6]);let S=t[2]&&iu(t);return{c(){e=d("div"),n=d("div"),i=d("div"),F(r.$$.fragment),o=_(),s=d("div"),$&&$.c(),a=_(),f=d("div"),h=_(),F(p.$$.fragment),b=_(),S&&S.c(),c(f,"class","text-sm font-ligth"),c(s,"class","flex-1 overflow-hidden flex flex-col"),c(i,"class","flexrow space-x-2 items-center"),c(n,"class",g=(2==t[5]?"bg-c-danger text-white":1==t[5]?"shadow-lg bg-c-warning text-white":"bg-c-success text-white")+" p-4 w-full text-left rounded-md shadow-lg z-50 border border-c-border"),c(e,"class","max-w-md mx-auto fixed bottom-[10%] inset-x-0 noprint"),D(e,"z-index","1000")},m(l,c){u(l,e,c),k(e,n),k(n,i),N(r,i,null),k(i,o),k(i,s),$&&$.m(s,null),k(s,a),k(s,f),f.innerHTML=t[1],k(i,h),N(p,i,null),k(n,b),S&&S.m(n,null),y=!0},p(t,e){const i={};16&e&&(i.img=t[4]),r.$set(i),t[0]?$?($.p(t,e),1&e&&w($,1)):($=nu(t),$.c(),w($,1),$.m(s,a)):$&&(z(),m($,1,1,()=>{$=null}),M()),(!y||2&e)&&(f.innerHTML=t[1]),t[2]?S?S.p(t,e):(S=iu(t),S.c(),S.m(n,null)):S&&(S.d(1),S=null),(!y||32&e&&g!==(g=(2==t[5]?"bg-c-danger text-white":1==t[5]?"shadow-lg bg-c-warning text-white":"bg-c-success text-white")+" p-4 w-full text-left rounded-md shadow-lg z-50 border border-c-border"))&&c(n,"class",g)},i(t){y||(w(r.$$.fragment,t),w($),w(p.$$.fragment,t),t&&j(()=>{y&&(x&&x.end(1),v=A(e,et,{duration:500,easing:tu}),v.start())}),y=!0)},o(t){m(r.$$.fragment,t),m($),m(p.$$.fragment,t),v&&v.invalidate(),t&&(x=E(e,tt,{duration:300})),y=!1},d(t){t&&l(e),T(r),$&&$.d(),T(p),S&&S.d(),t&&x&&x.end()}}}function nu(t){let e,n,i;return n=new Ar({props:{id:t[0]}}),{c(){e=d("div"),F(n.$$.fragment),c(e,"class","font-bold text-xl")},m(t,r){u(t,e,r),N(n,e,null),i=!0},p(t,e){const i={};1&e&&(i.id=t[0]),n.$set(i)},i(t){i||(w(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&l(e),T(n)}}}function iu(t){let e,n,i,r;return{c(){e=d("div"),e.textContent="Details:",n=_(),i=d("pre"),r=$(t[2]),c(e,"class","text-xs pt-4 mb-2 w-full border-b border-c-100 font-ligth"),c(i,"class","text-c-200 font-mono text-xs p-1 rounded bg-white max-h-48 overflow-y-auto")},m(t,o){u(t,e,o),u(t,n,o),u(t,i,o),k(i,r)},p(t,e){4&e&&b(r,t[2])},d(t){t&&(l(e),l(n),l(i))}}}function ru(t){let e,n,i=t[3]&&eu(t);return{c(){i&&i.c(),e=S()},m(t,r){i&&i.m(t,r),u(t,e,r),n=!0},p(t,[n]){t[3]?i?(i.p(t,n),8&n&&w(i,1)):(i=eu(t),i.c(),w(i,1),i.m(e.parentNode,e)):i&&(z(),m(i,1,1,()=>{i=null}),M())},i(t){n||(w(i),n=!0)},o(t){m(i),n=!1},d(t){t&&l(e),i&&i.d(t)}}}function ou(t,e,n){const{bus:i}=fr();let r,o,l,s,c,a=!1;function u(t){p(t,0,"check_circle")}function f(t){p(t,1,"warning")}function d(t){n(5,c=2),p(t,2,"error")}G(()=>{i.on("message",u),i.on("messaggio",u),i.on("warning",f),i.on("error",d)}),K(()=>{i.off("message",u),i.off("messaggio",u),i.off("warning",f),i.off("error",d)});var h=0;function p(t,e,i){if(n(0,r=n(2,l="")),n(5,c=e),n(4,s=i),"string"==typeof t){let e=t.split("\n"),i=e[0].indexOf(":");i>0?(n(0,r=e[0].slice(0,i)),n(1,o=e[0].slice(i+1))):(n(0,r=e[0]),n(1,o="")),e.splice(0,1),n(2,l=e.join("\n"))}else t?(n(1,o=t?.value||t?.des||t?.text||t?.msg),n(0,r=t?.title),n(2,l=t?.extra)):n(1,o="undefined message");h&&clearInterval(h),n(3,a=!0),h=setTimeout(()=>{n(3,a=!1)},0==e?2e3:1==e?4e3:1e4)}return[r,o,l,a,s,c,()=>n(3,a=!1)]}class lu extends t{constructor(t){super(),e(this,t,ou,ru,n,{})}}const su=t=>({}),cu=t=>({});function au(t){let e,n,i;const r=t[4].logo,o=p(r,t,t[3],cu),s=o||function(){let t;return{c(){t=$("Inserisci lo slot su logo")},m(e,n){u(e,t,n)},d(e){e&&l(t)}}}();return{c(){e=d("div"),n=d("div"),s&&s.c(),c(n,"class","p-8 bg-c-50 rounded-xl shadow"),c(e,"class","grid items-center h-full justify-center overflow-hidden")},m(t,r){u(t,e,r),k(e,n),s&&s.m(n,null),i=!0},p(t,e){o&&o.p&&(!i||8&e)&&g(o,r,t,t[3],i?x(r,t[3],e,su):v(t[3]),cu)},i(t){i||(w(s,t),i=!0)},o(t){m(s,t),i=!1},d(t){t&&l(e),s&&s.d(t)}}}function uu(t){let e,n,i,r,o,a;const h=t[4].default,b=p(h,t,t[3],null);return{c(){e=d("iframe"),i=_(),b&&b.c(),c(e,"title","PDF"),P(e.src,n=`${t[0]}${t[1]?"#view=FitH&zoom=page-width&navpanes=0&toolbar=0":""}`)||c(e,"src",n),c(e,"class","w-full h-full border-none")},m(n,l){u(n,e,l),u(n,i,l),b&&b.m(n,l),r=!0,o||(a=[f(e,"load",t[2]),f(e,"error",t[2])],o=!0)},p(t,i){(!r||3&i&&!P(e.src,n=`${t[0]}${t[1]?"#view=FitH&zoom=page-width&navpanes=0&toolbar=0":""}`))&&c(e,"src",n),b&&b.p&&(!r||8&i)&&g(b,h,t,t[3],r?x(h,t[3],i,null):v(t[3]),null)},i(t){r||(w(b,t),r=!0)},o(t){m(b,t),r=!1},d(t){t&&(l(e),l(i)),b&&b.d(t),o=!1,s(a)}}}function fu(t){let e,n,i,r;const o=[uu,au],s=[];function a(t,e){return t[0]?0:1}return n=a(t),i=s[n]=o[n](t),{c(){e=d("div"),i.c(),c(e,"class","w-full h-full overflow-auto relative")},m(t,i){u(t,e,i),s[n].m(e,null),r=!0},p(t,[r]){let l=n;n=a(t),n===l?s[n].p(t,r):(z(),m(s[l],1,1,()=>{s[l]=null}),M(),i=s[n],i?i.p(t,r):(i=s[n]=o[n](t),i.c()),w(i,1),i.m(e,null))},i(t){r||(w(i),r=!0)},o(t){m(i),r=!1},d(t){t&&l(e),s[n].d()}}}function du(t,e,n){let{$$slots:i={},$$scope:r}=e;const{bus:o}=fr();W();let{value:l=""}=e,{fullsize:s=!1}=e;return t.$$set=t=>{"value"in t&&n(0,l=t.value),"fullsize"in t&&n(1,s=t.fullsize),"$$scope"in t&&n(3,r=t.$$scope)},t.$$.update=()=>{1&t.$$.dirty&&async function(){l&&(o.wait(!0),await X())}()},[l,s,async function(){o.wait(!1)},r,i]}class hu extends t{constructor(t){super(),e(this,t,du,fu,n,{value:0,fullsize:1})}}function pu(t){let e,n,i,r,o;const s=t[4].default,a=p(s,t,t[3],null);return{c(){e=d("div"),a&&a.c(),c(e,"class",n=(t[2].class||"")+" h-full relative overflow-y-auto")},m(n,l){u(n,e,l),a&&a.m(e,null),t[5](e),i=!0,r||(o=f(e,"scroll",t[1]),r=!0)},p(t,[r]){a&&a.p&&(!i||8&r)&&g(a,s,t,t[3],i?x(s,t[3],r,null):v(t[3]),null),(!i||4&r&&n!==(n=(t[2].class||"")+" h-full relative overflow-y-auto"))&&c(e,"class",n)},i(t){i||(w(a,t),i=!0)},o(t){m(a,t),i=!1},d(n){n&&l(e),a&&a.d(n),t[5](null),r=!1,o()}}}function mu(t,e,n){let{$$slots:o={},$$scope:l}=e;const{bus:s}=fr();let c;return t.$$set=t=>{n(2,e=i(i({},e),r(t))),"$$scope"in t&&n(3,l=t.$$scope)},e=r(e),[c,function(t){var e=t.target;e.scrollTop,this.smallmenu=!(e.scrollTop<50),e.scrollTop+1.3*e.getClientRects()[0].height>e.scrollHeight&&s.emit("scrollbottom")},e,l,o,function(t){h[t?"unshift":"push"](()=>{c=t,n(0,c)})}]}class wu extends t{constructor(t){super(),e(this,t,mu,pu,n,{})}}function bu(t,e,n){const i=t.slice();return i[5]=e[n],i}function gu(t){let e,n,i,r,o,s,a,h,p,m=t[5]<=t[0]?"β
":"β";function w(){return t[3](t[5])}return{c(){e=d("span"),n=$(m),i=_(),c(e,"class",r=t[1]?"cursor-pointer":""),c(e,"role",o=t[1]?"button":"presentation"),c(e,"tabindex",s=t[1]?0:void 0),c(e,"aria-label",a=t[1]?`Valuta ${t[5]} stelle`:void 0)},m(t,r){u(t,e,r),k(e,n),k(e,i),h||(p=f(e,"click",w),h=!0)},p(i,l){t=i,1&l&&m!==(m=t[5]<=t[0]?"β
":"β")&&b(n,m),2&l&&r!==(r=t[1]?"cursor-pointer":"")&&c(e,"class",r),2&l&&o!==(o=t[1]?"button":"presentation")&&c(e,"role",o),2&l&&s!==(s=t[1]?0:void 0)&&c(e,"tabindex",s),2&l&&a!==(a=t[1]?`Valuta ${t[5]} stelle`:void 0)&&c(e,"aria-label",a)},d(t){t&&l(e),h=!1,p()}}}function vu(t){let e,n=B([1,2,3,4,5]),i=[];for(let e=0;e<5;e+=1)i[e]=gu(bu(t,n,e));return{c(){e=d("span");for(let t=0;t<5;t+=1)i[t].c();c(e,"class","flex flex-wrap space-x-2 text-base text-yellow-500")},m(t,n){u(t,e,n);for(let t=0;t<5;t+=1)i[t]&&i[t].m(e,null)},p(t,[r]){if(7&r){let o;for(n=B([1,2,3,4,5]),o=0;o<5;o+=1){const l=bu(t,n,o);i[o]?i[o].p(l,r):(i[o]=gu(l),i[o].c(),i[o].m(e,null))}for(;o<5;o+=1)i[o].d(1)}},i:o,o:o,d(t){t&&l(e),H(i,t)}}}function xu(t,e,n){let{value:i=0}=e,{editable:r=!1}=e;const o=W();function l(t){r&&o("input",t)}return t.$$set=t=>{"value"in t&&n(0,i=t.value),"editable"in t&&n(1,r=t.editable)},[i,r,l,t=>l(t)]}class yu extends t{constructor(t){super(),e(this,t,xu,vu,n,{value:0,editable:1})}}function ku(t){let e,n,i,r,o,a,h,p,m,w,b,g,v,x,y,D;return{c(){e=d("div"),n=d("button"),i=$("-"),o=_(),a=d("input"),h=_(),p=d("button"),m=$("+"),b=_(),g=d("input"),n.disabled=r=0==t[5],c(n,"class","cursor-pointer pr-1"),a.disabled=t[1],c(a,"type","range"),c(a,"min",t[4]),c(a,"max",t[6]),c(a,"step","1"),a.value=t[5],c(a,"class","w-28 modern-slider"),p.disabled=w=t[5]>=t[3]?.length-1,c(p,"class","cursor-pointer pl-1 pr-2"),g.disabled=v=!t[2]||t[1],c(g,"type","text"),g.value=t[0],c(g,"class",x="w-14 text-xs py-1 px-2 text-right rounded-lg focus:outline-none focus:ring-1 focus:ring-c-base "+(t[2]?"bg-white":"bg-c-100")),c(e,"class","flex items-center rounded-lg")},m(r,l){u(r,e,l),k(e,n),k(n,i),k(e,o),k(e,a),k(e,h),k(e,p),k(p,m),k(e,b),k(e,g),y||(D=[f(n,"click",t[15]),f(a,"input",t[9]),f(p,"click",t[16]),f(g,"change",t[10]),f(g,"blur",t[10])],y=!0)},p(t,e){32&e&&r!==(r=0==t[5])&&(n.disabled=r),2&e&&(a.disabled=t[1]),16&e&&c(a,"min",t[4]),64&e&&c(a,"max",t[6]),32&e&&(a.value=t[5]),40&e&&w!==(w=t[5]>=t[3]?.length-1)&&(p.disabled=w),6&e&&v!==(v=!t[2]||t[1])&&(g.disabled=v),1&e&&g.value!==t[0]&&(g.value=t[0]),4&e&&x!==(x="w-14 text-xs py-1 px-2 text-right rounded-lg focus:outline-none focus:ring-1 focus:ring-c-base "+(t[2]?"bg-white":"bg-c-100"))&&c(g,"class",x)},d(t){t&&l(e),y=!1,s(D)}}}function $u(t){let e,n=t[7]&&ku(t);return{c(){n&&n.c(),e=S()},m(t,i){n&&n.m(t,i),u(t,e,i)},p(t,[i]){t[7]?n?n.p(t,i):(n=ku(t),n.c(),n.m(e.parentNode,e)):n&&(n.d(1),n=null)},i:o,o:o,d(t){t&&l(e),n&&n.d(t)}}}function _u(t,e=-1/0,n=1/0){return(t=Number(t)||0)<e&&(t=e),t>n&&(t=n),t}function Du(t,e,n){const i=W();let r,o,l,s,{min:c=0,max:a=100,value:u=50,readonly:f,step:d=1,range:h,fm:p=!1}=e,m=[],w=!1;function b(t){let e,s=function(t){let e=0,n=1/0;for(let i=0;i<m.length;i++){let r=Math.abs(m[i]-t);r<n&&(n=r,e=i)}return{id:e,v:m[e]}}(t);return n(5,o=s.id),e=p?_u(t,m[r],m[l]):s.v,e!=u&&(n(0,u=e),i("change",e)),u}return t.$$set=t=>{"min"in t&&n(11,c=t.min),"max"in t&&n(12,a=t.max),"value"in t&&n(0,u=t.value),"readonly"in t&&n(1,f=t.readonly),"step"in t&&n(13,d=t.step),"range"in t&&n(14,h=t.range),"fm"in t&&n(2,p=t.fm)},t.$$.update=()=>{30724&t.$$.dirty&&function(){if(h&&Array.isArray(h)&&h.length)n(3,m=h.map(t=>parseFloat(t)??0).sort((t,e)=>t-e));else{n(4,r=Number(c)??0),n(6,l=Number(a)??100),s=d??1,l<r&&n(6,l=r),n(3,m=[]);let t=r,e=s>0?s:1;for(;;)if(m.push(t),t+=e,t=Math.round(100*t)/100,t>=a){m.push(a);break}}n(4,r=0),n(6,l=m.length-1),s=1,b(u),n(7,w=!0)}()},[u,f,p,m,r,o,l,w,b,function(t){let e=parseInt(t.target.value);if(e>=0&&e<m.length){n(5,o=e);let t=m[e];t!=u&&(n(0,u=t),i("change",t))}},function(t){let e=parseFloat(t.target.value)??0;e=Math.round(100*e)/100,b(_u(e,m[r],m[l]))},c,a,d,h,()=>{n(5,o--,o),b(m[o])},()=>{n(5,o++,o),b(m[o])}]}class Su extends t{constructor(t){super(),e(this,t,Du,$u,n,{min:11,max:12,value:0,readonly:1,step:13,range:14,fm:2})}}function zu(t,e,n){const i=t.slice();return i[21]=e[n],i[23]=n,i}function Mu(t,e,n){const i=t.slice();return i[24]=e[n],i[26]=n,i}function Eu(t,e,n){const i=t.slice();return i[27]=e[n],i[29]=n,i}function ju(t,e,n){const i=t.slice();return i[30]=e[n],i[32]=n,i}function Au(t){let e,n;return e=new ar({props:{img:"expand_more",size:6}}),{c(){F(e.$$.fragment)},m(t,i){N(e,t,i),n=!0},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){T(e,t)}}}function Cu(t){let e,n,i,r=B(t[21].data),o=[];for(let e=0;e<r.length;e+=1)o[e]=Gu(Mu(t,r,e));const s=t=>m(o[t],1,1,()=>{o[t]=null});return{c(){e=d("div");for(let t=0;t<o.length;t+=1)o[t].c();c(e,"class","absolute z-10 top-6 -left-10 py-2 bg-white flex flex-col space-y-2 border shadow-sm"),c(e,"style",n=`width: ${t[0]/4}rem`)},m(t,n){u(t,e,n);for(let t=0;t<o.length;t+=1)o[t]&&o[t].m(e,null);i=!0},p(t,l){if(187&l[0]){let n;for(r=B(t[21].data),n=0;n<r.length;n+=1){const i=Mu(t,r,n);o[n]?(o[n].p(i,l),w(o[n],1)):(o[n]=Gu(i),o[n].c(),w(o[n],1),o[n].m(e,null))}for(z(),n=r.length;n<o.length;n+=1)s(n);M()}(!i||1&l[0]&&n!==(n=`width: ${t[0]/4}rem`))&&c(e,"style",n)},i(t){if(!i){for(let t=0;t<r.length;t+=1)w(o[t]);i=!0}},o(t){o=o.filter(Boolean);for(let t=0;t<o.length;t+=1)m(o[t]);i=!1},d(t){t&&l(e),H(o,t)}}}function Tu(t){let e,n,i,r,o,a,h,p,b,g,v,x=t[24].icon&&Ou(t);o=new Ar({props:{id:t[24].name}});let $=t[24].data&&t[24].data.length>0&&Fu(),D=t[3][1]==t[26]&&t[24].data&&t[24].data.length>0&&Iu(t);function S(){return t[14](t[26],t[21])}function E(){return t[15](t[24],t[26],t[21])}return{c(){e=d("div"),n=d("div"),x&&x.c(),i=_(),r=d("div"),F(o.$$.fragment),a=_(),$&&$.c(),h=_(),D&&D.c(),p=_(),c(n,"class","mx-2 w-8 h-8 p-1"),c(r,"class","flex-1"),c(e,"class","flex flex-wrap items-center cursor-pointer relative"),y(e,"selected",t[3][1]==t[26])},m(t,l){u(t,e,l),k(e,n),x&&x.m(n,null),k(e,i),k(e,r),N(o,r,null),k(e,a),$&&$.m(e,null),k(e,h),D&&D.m(e,null),k(e,p),b=!0,g||(v=[f(e,"mouseover",S),f(e,"click",E)],g=!0)},p(i,r){(t=i)[24].icon?x?(x.p(t,r),2&r[0]&&w(x,1)):(x=Ou(t),x.c(),w(x,1),x.m(n,null)):x&&(z(),m(x,1,1,()=>{x=null}),M());const l={};2&r[0]&&(l.id=t[24].name),o.$set(l),t[24].data&&t[24].data.length>0?$?2&r[0]&&w($,1):($=Fu(),$.c(),w($,1),$.m(e,h)):$&&(z(),m($,1,1,()=>{$=null}),M()),t[3][1]==t[26]&&t[24].data&&t[24].data.length>0?D?(D.p(t,r),10&r[0]&&w(D,1)):(D=Iu(t),D.c(),w(D,1),D.m(e,p)):D&&(z(),m(D,1,1,()=>{D=null}),M()),(!b||8&r[0])&&y(e,"selected",t[3][1]==t[26])},i(t){b||(w(x),w(o.$$.fragment,t),w($),w(D),b=!0)},o(t){m(x),m(o.$$.fragment,t),m($),m(D),b=!1},d(t){t&&l(e),x&&x.d(),T(o),$&&$.d(),D&&D.d(),g=!1,s(v)}}}function Nu(t){let e;return{c(){e=d("div"),c(e,"class","w-full border-b")},m(t,n){u(t,e,n)},p:o,i:o,o:o,d(t){t&&l(e)}}}function Ou(t){let e,n;return e=new ar({props:{img:t[24].icon,size:6}}),{c(){F(e.$$.fragment)},m(t,i){N(e,t,i),n=!0},p(t,n){const i={};2&n[0]&&(i.img=t[24].icon),e.$set(i)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){T(e,t)}}}function Fu(t){let e,n;return e=new ar({props:{img:"chevron_right",size:6}}),{c(){F(e.$$.fragment)},m(t,i){N(e,t,i),n=!0},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){T(e,t)}}}function Iu(t){let e,n,i,r=B(t[24].data),o=[];for(let e=0;e<r.length;e+=1)o[e]=qu(Eu(t,r,e));const s=t=>m(o[t],1,1,()=>{o[t]=null});return{c(){e=d("div");for(let t=0;t<o.length;t+=1)o[t].c();c(e,"class","absolute z-10 top-0 bg-white flex flex-col space-y-2 border shadow-sm"),c(e,"style",n=`left: ${(t[0]-1)/4}rem; width:${t[0]/4}rem`)},m(t,n){u(t,e,n);for(let t=0;t<o.length;t+=1)o[t]&&o[t].m(e,null);i=!0},p(t,l){if(187&l[0]){let n;for(r=B(t[24].data),n=0;n<r.length;n+=1){const i=Eu(t,r,n);o[n]?(o[n].p(i,l),w(o[n],1)):(o[n]=qu(i),o[n].c(),w(o[n],1),o[n].m(e,null))}for(z(),n=r.length;n<o.length;n+=1)s(n);M()}(!i||1&l[0]&&n!==(n=`left: ${(t[0]-1)/4}rem; width:${t[0]/4}rem`))&&c(e,"style",n)},i(t){if(!i){for(let t=0;t<r.length;t+=1)w(o[t]);i=!0}},o(t){o=o.filter(Boolean);for(let t=0;t<o.length;t+=1)m(o[t]);i=!1},d(t){t&&l(e),H(o,t)}}}function Ru(t){let e,n,i,r,o,a,h,p,b,g,v,x=t[27].icon&&Bu(t);o=new Ar({props:{id:t[27].name}});let $=t[27].data&&t[27].data.length>0&&Hu(),D=t[3][2]==t[29]&&t[27].data&&t[27].data.length>0&&Pu(t);function S(){return t[12](t[29],t[24])}function E(){return t[13](t[27],t[29],t[24])}return{c(){e=d("div"),n=d("div"),x&&x.c(),i=_(),r=d("div"),F(o.$$.fragment),a=_(),$&&$.c(),h=_(),D&&D.c(),p=_(),c(n,"class","mx-2 w-8 h-8 p-1"),c(r,"class","flex-1"),c(e,"class","flex flex-wrap items-center cursor-pointer relative"),y(e,"selected",t[3][2]==t[29])},m(t,l){u(t,e,l),k(e,n),x&&x.m(n,null),k(e,i),k(e,r),N(o,r,null),k(e,a),$&&$.m(e,null),k(e,h),D&&D.m(e,null),k(e,p),b=!0,g||(v=[f(e,"mouseover",S),f(e,"click",E)],g=!0)},p(i,r){(t=i)[27].icon?x?(x.p(t,r),2&r[0]&&w(x,1)):(x=Bu(t),x.c(),w(x,1),x.m(n,null)):x&&(z(),m(x,1,1,()=>{x=null}),M());const l={};2&r[0]&&(l.id=t[27].name),o.$set(l),t[27].data&&t[27].data.length>0?$?2&r[0]&&w($,1):($=Hu(),$.c(),w($,1),$.m(e,h)):$&&(z(),m($,1,1,()=>{$=null}),M()),t[3][2]==t[29]&&t[27].data&&t[27].data.length>0?D?(D.p(t,r),10&r[0]&&w(D,1)):(D=Pu(t),D.c(),w(D,1),D.m(e,p)):D&&(z(),m(D,1,1,()=>{D=null}),M()),(!b||8&r[0])&&y(e,"selected",t[3][2]==t[29])},i(t){b||(w(x),w(o.$$.fragment,t),w($),w(D),b=!0)},o(t){m(x),m(o.$$.fragment,t),m($),m(D),b=!1},d(t){t&&l(e),x&&x.d(),T(o),$&&$.d(),D&&D.d(),g=!1,s(v)}}}function Lu(t){let e;return{c(){e=d("div"),c(e,"class","w-full border-b")},m(t,n){u(t,e,n)},p:o,i:o,o:o,d(t){t&&l(e)}}}function Bu(t){let e,n;return e=new ar({props:{img:t[27].icon,size:6}}),{c(){F(e.$$.fragment)},m(t,i){N(e,t,i),n=!0},p(t,n){const i={};2&n[0]&&(i.img=t[27].icon),e.$set(i)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){T(e,t)}}}function Hu(t){let e,n;return e=new ar({props:{img:"chevron_right",size:6}}),{c(){F(e.$$.fragment)},m(t,i){N(e,t,i),n=!0},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){T(e,t)}}}function Pu(t){let e,n,i,r=B(t[27].data),o=[];for(let e=0;e<r.length;e+=1)o[e]=Yu(ju(t,r,e));const s=t=>m(o[t],1,1,()=>{o[t]=null});return{c(){e=d("div");for(let t=0;t<o.length;t+=1)o[t].c();c(e,"class","absolute z-10 top-0 bg-white flex flex-col space-y-2 border shadow-sm"),c(e,"style",n=`left: ${(t[0]-1)/4}rem; width:${t[0]/4}rem`)},m(t,n){u(t,e,n);for(let t=0;t<o.length;t+=1)o[t]&&o[t].m(e,null);i=!0},p(t,l){if(186&l[0]){let n;for(r=B(t[27].data),n=0;n<r.length;n+=1){const i=ju(t,r,n);o[n]?(o[n].p(i,l),w(o[n],1)):(o[n]=Yu(i),o[n].c(),w(o[n],1),o[n].m(e,null))}for(z(),n=r.length;n<o.length;n+=1)s(n);M()}(!i||1&l[0]&&n!==(n=`left: ${(t[0]-1)/4}rem; width:${t[0]/4}rem`))&&c(e,"style",n)},i(t){if(!i){for(let t=0;t<r.length;t+=1)w(o[t]);i=!0}},o(t){o=o.filter(Boolean);for(let t=0;t<o.length;t+=1)m(o[t]);i=!1},d(t){t&&l(e),H(o,t)}}}function Uu(t){let e,n,i,r,o,a,h,p,b,g=t[30].icon&&Zu(t);function v(){return t[10](t[32],t[27])}function x(){return t[11](t[30],t[32],t[27])}return o=new Ar({props:{id:t[30].name}}),{c(){e=d("div"),n=d("div"),g&&g.c(),i=_(),r=d("div"),F(o.$$.fragment),a=_(),c(n,"class","mx-2 w-8 h-8 p-1"),c(r,"class","flex-1"),c(e,"class","flex flex-wrap items-center cursor-pointer relative"),y(e,"selected",t[3][3]==t[32])},m(t,l){u(t,e,l),k(e,n),g&&g.m(n,null),k(e,i),k(e,r),N(o,r,null),k(e,a),h=!0,p||(b=[f(e,"mouseover",v),f(e,"click",x)],p=!0)},p(i,r){(t=i)[30].icon?g?(g.p(t,r),2&r[0]&&w(g,1)):(g=Zu(t),g.c(),w(g,1),g.m(n,null)):g&&(z(),m(g,1,1,()=>{g=null}),M());const l={};2&r[0]&&(l.id=t[30].name),o.$set(l),(!h||8&r[0])&&y(e,"selected",t[3][3]==t[32])},i(t){h||(w(g),w(o.$$.fragment,t),h=!0)},o(t){m(g),m(o.$$.fragment,t),h=!1},d(t){t&&l(e),g&&g.d(),T(o),p=!1,s(b)}}}function Vu(t){let e;return{c(){e=d("div"),c(e,"class","w-full border-b")},m(t,n){u(t,e,n)},p:o,i:o,o:o,d(t){t&&l(e)}}}function Zu(t){let e,n;return e=new ar({props:{img:t[30].icon,size:6}}),{c(){F(e.$$.fragment)},m(t,i){N(e,t,i),n=!0},p(t,n){const i={};2&n[0]&&(i.img=t[30].icon),e.$set(i)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){T(e,t)}}}function Yu(t){let e,n,i,r;const o=[Vu,Uu],s=[];function c(t,e){return t[30].sep?0:1}return e=c(t),n=s[e]=o[e](t),{c(){n.c(),i=S()},m(t,n){s[e].m(t,n),u(t,i,n),r=!0},p(t,r){let l=e;e=c(t),e===l?s[e].p(t,r):(z(),m(s[l],1,1,()=>{s[l]=null}),M(),n=s[e],n?n.p(t,r):(n=s[e]=o[e](t),n.c()),w(n,1),n.m(i.parentNode,i))},i(t){r||(w(n),r=!0)},o(t){m(n),r=!1},d(t){t&&l(i),s[e].d(t)}}}function qu(t){let e,n,i,r;const o=[Lu,Ru],s=[];function c(t,e){return t[27].sep?0:1}return e=c(t),n=s[e]=o[e](t),{c(){n.c(),i=S()},m(t,n){s[e].m(t,n),u(t,i,n),r=!0},p(t,r){let l=e;e=c(t),e===l?s[e].p(t,r):(z(),m(s[l],1,1,()=>{s[l]=null}),M(),n=s[e],n?n.p(t,r):(n=s[e]=o[e](t),n.c()),w(n,1),n.m(i.parentNode,i))},i(t){r||(w(n),r=!0)},o(t){m(n),r=!1},d(t){t&&l(i),s[e].d(t)}}}function Gu(t){let e,n,i,r;const o=[Nu,Tu],s=[];function c(t,e){return t[24].sep?0:1}return e=c(t),n=s[e]=o[e](t),{c(){n.c(),i=S()},m(t,n){s[e].m(t,n),u(t,i,n),r=!0},p(t,r){let l=e;e=c(t),e===l?s[e].p(t,r):(z(),m(s[l],1,1,()=>{s[l]=null}),M(),n=s[e],n?n.p(t,r):(n=s[e]=o[e](t),n.c()),w(n,1),n.m(i.parentNode,i))},i(t){r||(w(n),r=!0)},o(t){m(n),r=!1},d(t){t&&l(i),s[e].d(t)}}}function Xu(t){let e,n,i,r,o,a,h,p,b,g;r=new Ar({props:{id:t[21].name}});let v=t[21].data&&t[21].data.length>0&&Au(),x=t[3][0]==t[23]&&t[21].data&&t[21].data.length>0&&Cu(t);function $(){return t[16](t[23])}function D(){return t[17](t[23])}function S(){return t[18](t[21],t[23])}return{c(){e=d("div"),n=d("div"),i=d("div"),F(r.$$.fragment),o=_(),v&&v.c(),a=_(),x&&x.c(),h=_(),c(i,"class","flex-1"),c(n,"class","flex flex-wrap"),c(e,"class","cursor-pointer px-2 relative"),y(e,"selected",t[3][0]==t[23])},m(t,l){u(t,e,l),k(e,n),k(n,i),N(r,i,null),k(n,o),v&&v.m(n,null),k(e,a),x&&x.m(e,null),k(e,h),p=!0,b||(g=[f(e,"mouseover",$),f(e,"mouseleave",D),f(e,"click",S)],b=!0)},p(i,o){t=i;const l={};2&o[0]&&(l.id=t[21].name),r.$set(l),t[21].data&&t[21].data.length>0?v?2&o[0]&&w(v,1):(v=Au(),v.c(),w(v,1),v.m(n,null)):v&&(z(),m(v,1,1,()=>{v=null}),M()),t[3][0]==t[23]&&t[21].data&&t[21].data.length>0?x?(x.p(t,o),10&o[0]&&w(x,1)):(x=Cu(t),x.c(),w(x,1),x.m(e,h)):x&&(z(),m(x,1,1,()=>{x=null}),M()),(!p||8&o[0])&&y(e,"selected",t[3][0]==t[23])},i(t){p||(w(r.$$.fragment,t),w(v),w(x),p=!0)},o(t){m(r.$$.fragment,t),m(v),m(x),p=!1},d(t){t&&l(e),T(r),v&&v.d(),x&&x.d(),b=!1,s(g)}}}function Wu(t){let e,n,i,r,o=B(t[1]),s=[];for(let e=0;e<o.length;e+=1)s[e]=Xu(zu(t,o,e));const a=t=>m(s[t],1,1,()=>{s[t]=null});return{c(){e=d("div");for(let t=0;t<s.length;t+=1)s[t].c();c(e,"class","flex flex-wrap items-center")},m(o,l){u(o,e,l);for(let t=0;t<s.length;t+=1)s[t]&&s[t].m(e,null);n=!0,i||(r=f(window,"keydown",t[6]),i=!0)},p(t,n){if(191&n[0]){let i;for(o=B(t[1]),i=0;i<o.length;i+=1){const r=zu(t,o,i);s[i]?(s[i].p(r,n),w(s[i],1)):(s[i]=Xu(r),s[i].c(),w(s[i],1),s[i].m(e,null))}for(z(),i=o.length;i<s.length;i+=1)a(i);M()}},i(t){if(!n){for(let t=0;t<o.length;t+=1)w(s[t]);n=!0}},o(t){s=s.filter(Boolean);for(let t=0;t<s.length;t+=1)m(s[t]);n=!1},d(t){t&&l(e),H(s,t),i=!1,r()}}}function Ku(t,e,n){let{naviga:i=!1}=e,{size:r=60}=e,{value:o=[]}=e,{escape:l=!1}=e;const s=W();function c(t){n(2,u=!1),n(3,f=[-1,-1,-1,-1]),n(4,d=[o]),n(5,h=0),i&&t.link?it(t.link):s("select",t)}function a(t){t.data&&t.data.length||c(t)}let u=!1,f=[-1,-1,-1,-1],d=[],h=0;return t.$$set=t=>{"naviga"in t&&n(8,i=t.naviga),"size"in t&&n(0,r=t.size),"value"in t&&n(1,o=t.value),"escape"in t&&n(9,l=t.escape)},[r,o,u,f,d,h,function(t){if(!(t.ctrlKey||t.shiftKey||t.altKey||t.metaKey))switch(t.key){case"F1":return void(l&&(u?(n(2,u=!1),n(3,f=[-1,-1,-1,-1]),n(5,h=0)):(n(2,u=!0),n(4,d[0]=o,d),n(5,h=0),n(3,f=[0,-1,-1,-1])),t.stopPropagation()));case"Enter":if(u)(e=d[h][f[h]]).data&&e.data.length>0&&h<3?(n(5,h++,h),n(3,f[h]=0,f),n(4,d[h]=e.data,d)):c(e);return void t.stopPropagation();case"ArrowLeft":return u&&(0==h?n(3,f[0]=f[0]>0?f[0]-1:d[0].length-1,f):(n(3,f[h]=-1,f),n(5,h--,h)),t.stopPropagation()),void t.stopPropagation();case"ArrowRight":if(u){if(0==h)n(3,f[0]=f[0]<o.length-1?f[0]+1:0,f);else if(h<3){var e;(e=d[h][f[h]]).data&&e.data.length&&(n(5,h++,h),n(4,d[h]=e.data,d),n(3,f[h]=0,f))}t.stopPropagation()}return;case"ArrowUp":if(u){if(0==h)return;1==h&&0==f[h]?(n(3,f[h]=-1,f),n(5,h--,h)):n(3,f[h]=f[h]>0?f[h]-1:d[h].length-1,f),t.stopPropagation()}return;case"ArrowDown":if(u){var i=d[h][f[h]];0==h?i.data&&i.data.length&&(n(5,h++,h),n(3,f[h]=0,f),n(4,d[h]=i.data,d)):n(3,f[h]=f[h]<d[h].length-1?f[h]+1:0,f),t.stopPropagation()}return}},a,i,l,(t,e)=>{f[3]!=t&&(n(5,h=3),n(4,d[h]=e.data,d),n(3,f[3]=t,f))},(t,e,n)=>a(t,n.data),(t,e)=>{f[2]!=t&&(n(5,h=2),n(4,d[h]=e.data,d),n(3,f[2]=t,f),n(3,f[3]=-1,f))},(t,e,n)=>a(t,n.data),(t,e)=>{f[1]!=t&&(n(5,h=1),n(4,d[h]=e.data,d),n(3,f[1]=t,f),n(3,f[2]=-1,f))},(t,e,n)=>a(t,n.data),t=>{f[0]!=t&&(n(5,h=0),n(3,f[0]=t,f),n(4,d[h]=o,d),n(2,u=!0),n(3,f[1]=-1,f))},t=>{f[0]==t&&n(3,f[0]=-1,f),n(2,u=!1)},(t,e)=>a(t)]}class Ju extends t{constructor(t){super(),e(this,t,Ku,Wu,n,{naviga:8,size:0,value:1,escape:9},null,[-1,-1])}}function Qu(t,e,n){const i=t.slice();return i[48]=e[n],i[50]=n,i}function tf(t,e,n){const i=t.slice();return i[51]=e[n],i}function ef(t){let e,n,i;return n=new Ar({props:{id:t[2]}}),{c(){e=d("div"),F(n.$$.fragment),c(e,"class","label pt-1 h-6")},m(t,r){u(t,e,r),N(n,e,null),i=!0},p(t,e){const i={};4&e[0]&&(i.id=t[2]),n.$set(i)},i(t){i||(w(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&l(e),T(n)}}}function nf(t){let e,n,i,r;return n=new Ar({props:{id:t[2]}}),{c(){e=d("div"),F(n.$$.fragment),c(e,"class","label leading-none text-right pr-2"),c(e,"style",i=`width: ${t[20]}%;`)},m(t,i){u(t,e,i),N(n,e,null),r=!0},p(t,o){const l={};4&o[0]&&(l.id=t[2]),n.$set(l),(!r||1048576&o[0]&&i!==(i=`width: ${t[20]}%;`))&&c(e,"style",i)},i(t){r||(w(n.$$.fragment,t),r=!0)},o(t){m(n.$$.fragment,t),r=!1},d(t){t&&l(e),T(n)}}}function rf(t){let e,n,i=(t[0].cod||t[0].id||"")+"";return{c(){e=d("div"),n=$(i),c(e,"class","rounded-l bg-c-base text-white px-2 text-xs flex flex-col justify-center"),y(e,"h-8",!t[7]),y(e,"h-6",t[7])},m(t,i){u(t,e,i),k(e,n)},p(t,r){1&r[0]&&i!==(i=(t[0].cod||t[0].id||"")+"")&&b(n,i),128&r[0]&&y(e,"h-8",!t[7]),128&r[0]&&y(e,"h-6",t[7])},d(t){t&&l(e)}}}function of(t){let e,n,i,r,o;return{c(){e=d("input"),c(e,"type","text"),c(e,"class","!rounded-none !pr-6"),e.value=n=t[10]?t[0]||"":t[9]?t[0]?.cod||"":t[0]?.des||"",c(e,"placeholder",i=t[22](t[4],t[21])),e.disabled=t[8],c(e,"autocorrect","off"),c(e,"autocomplete","off"),y(e,"sm",t[7])},m(n,i){u(n,e,i),t[37](e),r||(o=f(e,"keyup",t[38]),r=!0)},p(t,r){1537&r[0]&&n!==(n=t[10]?t[0]||"":t[9]?t[0]?.cod||"":t[0]?.des||"")&&e.value!==n&&(e.value=n),2097168&r[0]&&i!==(i=t[22](t[4],t[21]))&&c(e,"placeholder",i),256&r[0]&&(e.disabled=t[8]),128&r[0]&&y(e,"sm",t[7])},d(n){n&&l(e),t[37](null),r=!1,o()}}}function lf(t){let e,n,i,r,o;return n=new ar({props:{size:5,img:t[15].length?"expand_less":"expand_more"}}),{c(){e=d("button"),F(n.$$.fragment),c(e,"tabindex","-1"),c(e,"class","absolute right-1 vcenter cursor-pointer")},m(l,s){u(l,e,s),N(n,e,null),i=!0,r||(o=f(e,"click",O(t[39])),r=!0)},p(t,e){const i={};32768&e[0]&&(i.img=t[15].length?"expand_less":"expand_more"),n.$set(i)},i(t){i||(w(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&l(e),T(n),r=!1,o()}}}function sf(t){let e,n,i,r;n=new xr({props:{tooltip:t[12],$$slots:{default:[of]},$$scope:{ctx:t}}});let o=!t[8]&&lf(t);return{c(){e=d("div"),F(n.$$.fragment),i=_(),o&&o.c()},m(t,l){u(t,e,l),N(n,e,null),k(e,i),o&&o.m(e,null),r=!0},p(t,i){const r={};4096&i[0]&&(r.tooltip=t[12]),2107281&i[0]|4096&i[1]&&(r.$$scope={dirty:i,ctx:t}),n.$set(r),t[8]?o&&(z(),m(o,1,1,()=>{o=null}),M()):o?(o.p(t,i),256&i[0]&&w(o,1)):(o=lf(t),o.c(),w(o,1),o.m(e,null))},i(t){r||(w(n.$$.fragment,t),w(o),r=!0)},o(t){m(n.$$.fragment,t),m(o),r=!1},d(t){t&&l(e),T(n),o&&o.d()}}}function cf(t){let e,n,i,r,o,s,a=B(t[15]),f=[];for(let e=0;e<a.length;e+=1)f[e]=df(Qu(t,a,e));let h=t[1]&&t[17]>0&&hf(t),p=t[1]&&pf(t);return{c(){e=d("div"),n=d("table"),i=d("tbody");for(let t=0;t<f.length;t+=1)f[t].c();r=_(),h&&h.c(),o=_(),p&&p.c(),c(n,"class","w-full"),c(e,"class","relative w-full bg-white border p-1")},m(t,l){u(t,e,l),k(e,n),k(n,i);for(let t=0;t<f.length;t+=1)f[t]&&f[t].m(i,null);k(e,r),h&&h.m(e,null),k(e,o),p&&p.m(e,null),s=!0},p(t,n){if(118072841&n[0]){let e;for(a=B(t[15]),e=0;e<a.length;e+=1){const r=Qu(t,a,e);f[e]?f[e].p(r,n):(f[e]=df(r),f[e].c(),f[e].m(i,null))}for(;e<f.length;e+=1)f[e].d(1);f.length=a.length}t[1]&&t[17]>0?h?(h.p(t,n),131074&n[0]&&w(h,1)):(h=hf(t),h.c(),w(h,1),h.m(e,o)):h&&(z(),m(h,1,1,()=>{h=null}),M()),t[1]?p?(p.p(t,n),2&n[0]&&w(p,1)):(p=pf(t),p.c(),w(p,1),p.m(e,null)):p&&(z(),m(p,1,1,()=>{p=null}),M())},i(t){s||(w(h),w(p),s=!0)},o(t){m(h),m(p),s=!1},d(t){t&&l(e),H(f,t),h&&h.d(),p&&p.d()}}}function af(t){let e,n,i,r,o,s,a=t[48].des+"",f=t[3]&&uf(t);return{c(){e=d("td"),n=d("div"),i=d("div"),r=$(a),o=_(),f&&f.c(),s=S(),c(i,"class","w-full whitespace-pre-line line-clamp-2"),c(n,"class","text-xs pl-2 pr-4")},m(t,l){u(t,e,l),k(e,n),k(n,i),k(i,r),u(t,o,l),f&&f.m(t,l),u(t,s,l)},p(t,e){32768&e[0]&&a!==(a=t[48].des+"")&&b(r,a),t[3]?f?f.p(t,e):(f=uf(t),f.c(),f.m(s.parentNode,s)):f&&(f.d(1),f=null)},d(t){t&&(l(e),l(o),l(s)),f&&f.d(t)}}}function uf(t){let e,n=B(t[3]),i=[];for(let e=0;e<n.length;e+=1)i[e]=ff(tf(t,n,e));return{c(){for(let t=0;t<i.length;t+=1)i[t].c();e=S()},m(t,n){for(let e=0;e<i.length;e+=1)i[e]&&i[e].m(t,n);u(t,e,n)},p(t,r){if(32776&r[0]){let o;for(n=B(t[3]),o=0;o<n.length;o+=1){const l=tf(t,n,o);i[o]?i[o].p(l,r):(i[o]=ff(l),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=n.length}},d(t){t&&l(e),H(i,t)}}}function ff(t){let e,n,i,r,o,s=t[48][t[51]]+"";return{c(){e=d("td"),n=d("div"),i=d("div"),r=$(s),o=_(),c(i,"class","w-full whitespace-pre-line line-clamp-2"),c(n,"class","text-xs pl-2 pr-4")},m(t,l){u(t,e,l),k(e,n),k(n,i),k(i,r),k(e,o)},p(t,e){32776&e[0]&&s!==(s=t[48][t[51]]+"")&&b(r,s)},d(t){t&&l(e)}}}function df(t){let e,n,i,r,o,s,a,h,p=(t[48].cod||t[48].id||"")+"",m=!t[9]&&af(t);function w(){return t[34](t[48])}return{c(){e=d("tr"),n=d("td"),i=d("div"),r=$(p),o=_(),m&&m.c(),s=_(),D(i,"max-width","calc(100% - 20px)"),D(i,"min-width","fit-content"),c(i,"class","rounded bg-c-base text-white px-2 my-1 text-xs text-center"),c(e,"tabindex","-1"),c(e,"class","cursor-pointer"),y(e,"bg-c-150",t[50]==t[16]),y(e,"text-black",t[50]==t[16])},m(t,l){u(t,e,l),k(e,n),k(n,i),k(i,r),k(e,o),m&&m.m(e,null),k(e,s),a||(h=f(e,"mousedown",w),a=!0)},p(n,i){t=n,32768&i[0]&&p!==(p=(t[48].cod||t[48].id||"")+"")&&b(r,p),t[9]?m&&(m.d(1),m=null):m?m.p(t,i):(m=af(t),m.c(),m.m(e,s)),65536&i[0]&&y(e,"bg-c-150",t[50]==t[16]),65536&i[0]&&y(e,"text-black",t[50]==t[16])},d(t){t&&l(e),m&&m.d(),a=!1,h()}}}function hf(t){let e,n,i,r,s;return n=new ar({props:{size:6,img:"keyboard_arrow_up",color:"text-c-base hover:text-black"}}),{c(){e=d("button"),F(n.$$.fragment),c(e,"tabindex","-1"),c(e,"class","absolute top-0 right-0 cursor-pointer")},m(o,l){u(o,e,l),N(n,e,null),i=!0,r||(s=f(e,"click",t[35]),r=!0)},p:o,i(t){i||(w(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&l(e),T(n),r=!1,s()}}}function pf(t){let e,n,i,r,o=t[18]&&mf();return{c(){e=d("button"),o&&o.c(),c(e,"tabindex","-1"),c(e,"class","absolute bottom-0 right-0 cursor-pointer")},m(l,s){u(l,e,s),o&&o.m(e,null),n=!0,i||(r=f(e,"click",t[36]),i=!0)},p(t,n){t[18]?o?262144&n[0]&&w(o,1):(o=mf(),o.c(),w(o,1),o.m(e,null)):o&&(z(),m(o,1,1,()=>{o=null}),M())},i(t){n||(w(o),n=!0)},o(t){m(o),n=!1},d(t){t&&l(e),o&&o.d(),i=!1,r()}}}function mf(t){let e,n;return e=new ar({props:{size:6,img:"keyboard_arrow_down",color:"text-c-base hover:text-black"}}),{c(){F(e.$$.fragment)},m(t,i){N(e,t,i),n=!0},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){T(e,t)}}}function wf(t){let e,n,i=t[15].length&&cf(t);return{c(){e=d("div"),i&&i.c(),c(e,"slot","popup")},m(t,r){u(t,e,r),i&&i.m(e,null),n=!0},p(t,n){t[15].length?i?(i.p(t,n),32768&n[0]&&w(i,1)):(i=cf(t),i.c(),w(i,1),i.m(e,null)):i&&(z(),m(i,1,1,()=>{i=null}),M())},i(t){n||(w(i),n=!0)},o(t){m(i),n=!1},d(t){t&&l(e),i&&i.d()}}}function bf(t){let e,n;return e=new Pr({props:{tooltip:t[6],size:t[7]?6:8,right:!0}}),e.$on("click",t[42]),{c(){F(e.$$.fragment)},m(t,i){N(e,t,i),n=!0},p(t,n){const i={};64&n[0]&&(i.tooltip=t[6]),128&n[0]&&(i.size=t[7]?6:8),e.$set(i)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){T(e,t)}}}function gf(t){let e,n,i,r,o,s,a,f,h,b,y=t[2]&&!t[11]&&ef(t),$=t[2]&&t[11]&&nf(t),D=!t[9]&&(t[0]?.cod||"number"==typeof t[0]?.id)&&rf(t),S={class:"flex-1 relative apptema-base",popup:t[15]?.length,$$slots:{popup:[wf],default:[sf]},$$scope:{ctx:t}};s=new ko({props:S}),t[40](s),s.$on("lostfocus",t[41]);let E=t[5]&&bf(t);const j=t[33].default,A=p(j,t,t[43],null);return{c(){e=d("label"),y&&y.c(),n=_(),i=d("div"),$&&$.c(),r=_(),D&&D.c(),o=_(),F(s.$$.fragment),a=_(),E&&E.c(),f=_(),A&&A.c(),c(i,"class","flexrow"),c(e,"class",h=`labinput ${t[29].class||""}`)},m(t,l){u(t,e,l),y&&y.m(e,null),k(e,n),k(e,i),$&&$.m(i,null),k(i,r),D&&D.m(i,null),k(i,o),N(s,i,null),k(i,a),E&&E.m(i,null),k(i,f),A&&A.m(i,null),b=!0},p(t,l){t[2]&&!t[11]?y?(y.p(t,l),2052&l[0]&&w(y,1)):(y=ef(t),y.c(),w(y,1),y.m(e,n)):y&&(z(),m(y,1,1,()=>{y=null}),M()),t[2]&&t[11]?$?($.p(t,l),2052&l[0]&&w($,1)):($=nf(t),$.c(),w($,1),$.m(i,r)):$&&(z(),m($,1,1,()=>{$=null}),M()),t[9]||!t[0]?.cod&&"number"!=typeof t[0]?.id?D&&(D.d(1),D=null):D?D.p(t,l):(D=rf(t),D.c(),D.m(i,o));const a={};32768&l[0]&&(a.popup=t[15]?.length),3127195&l[0]|4096&l[1]&&(a.$$scope={dirty:l,ctx:t}),s.$set(a),t[5]?E?(E.p(t,l),32&l[0]&&w(E,1)):(E=bf(t),E.c(),w(E,1),E.m(i,f)):E&&(z(),m(E,1,1,()=>{E=null}),M()),A&&A.p&&(!b||4096&l[1])&&g(A,j,t,t[43],b?x(j,t[43],l,null):v(t[43]),null),(!b||536870912&l[0]&&h!==(h=`labinput ${t[29].class||""}`))&&c(e,"class",h)},i(t){b||(w(y),w($),w(s.$$.fragment,t),w(E),w(A,t),b=!0)},o(t){m(y),m($),m(s.$$.fragment,t),m(E),m(A,t),b=!1},d(n){n&&l(e),y&&y.d(),$&&$.d(),D&&D.d(),t[40](null),T(s),E&&E.d(),A&&A.d(n)}}}function vf(t,e,n){let o,l,{$$slots:s={},$$scope:c}=e;const{PP:a,bus:u,_:f,lang:d}=fr();I(t,d,t=>n(21,l=t));const p=W();let m,w,b,g=[],v=0,x=0,y=!1,k={},$="",{label:_="",cat:D="",extracols:S,placeholder:z="scrivi per cercare",value:M={},service:E="",edit:j=!1,edittooltip:A=!1,sm:C=!1,readonly:T=!1,onlycod:N=!1,stringa:O=!1,oriz:F,tooltip:R,pages:L=!1,max:B=6}=e;async function H(){n(15,g=[]),n(16,v=0),$="",w.openmenu(!1)}function P(t){t!=b&&(b=t,p("select",t),$&&p("des",$),$="")}async function U(){var t=O?M:N?M?.cod||"":M?.des||"";if(E){var e=E.split(":"),i=e[0];e.splice(0,1),t="?"==t||" "==t?"":t.trim();var r=await a(i,{id:D,extra:e.join(":"),input:t,max:B,page:x});0==x&&n(1,L=!!r.rows),L?(r?(n(15,g=r.rows||[]),n(18,y=r.hasmore)):(r=[],n(18,y=!1)),n(16,v=0)):(n(15,g=r?.rows||r||[]),n(18,y=!1),n(16,v=0)),await w.openmenu(!!g?.length)}else H()}async function V(t){if(!T&&"Tab"!=t.key&&"Shift"!=t.key&&"Alt"!=t.key){var e=t.target.value;if(O?n(0,M=t.target.value):("object"!=typeof M&&n(0,M={}),n(0,N?M.cod=t.target.value:M.des=t.target.value,M)),t.key&&!t.metaKey){if(T)return;var i=[];t.ctrlKey&&i.push("Ctrl"),t.altKey&&i.push("Alt"),t.shiftKey&&i.push("Shift"),i.push(t.key);let r=i.join("+");switch("Backspace"!=r||e||(r="Escape"),r){case"Escape":n(0,M=O?"":{}),n(17,x=0),await H(),t.preventDefault(),n(19,k=O?"":{}),P(k),p("click"),p("input",k);break;case"ArrowDown":t.preventDefault(),g.length>0?(v<g.length-1?n(16,v++,v):L&&y&&(n(17,x++,x),await U(),n(16,v=0)),n(19,k=O?g[v].cod:g[v]),$=g[v]?.des||"",P(k)):(n(17,x=0),await U());break;case"ArrowUp":t.preventDefault(),g.length>0?(v>0?n(16,v--,v):L&&x>0&&(n(17,x--,x),await U(),n(16,v=g.length-1)),n(19,k=O?g[v].cod:g[v]),$=g[v]?.des||"",P(k)):($="",n(16,v=0));break;case"ArrowLeft":break;case"ArrowRight":case"Tab":case"Enter":if(t.preventDefault(),v<g.length){n(19,k=O?g[v].cod:g[v]),n(0,M=O?g[v].cod:g[v]);let t=g[v].des||"";H(),$=t}"Enter"==r&&(p("input",k),p("click")),P(k);break;default:t.ctrlKey||t.altKey||(n(17,x=0),await U())}}}}return t.$$set=t=>{n(29,e=i(i({},e),r(t))),"label"in t&&n(2,_=t.label),"cat"in t&&n(30,D=t.cat),"extracols"in t&&n(3,S=t.extracols),"placeholder"in t&&n(4,z=t.placeholder),"value"in t&&n(0,M=t.value),"service"in t&&n(31,E=t.service),"edit"in t&&n(5,j=t.edit),"edittooltip"in t&&n(6,A=t.edittooltip),"sm"in t&&n(7,C=t.sm),"readonly"in t&&n(8,T=t.readonly),"onlycod"in t&&n(9,N=t.onlycod),"stringa"in t&&n(10,O=t.stringa),"oriz"in t&&n(11,F=t.oriz),"tooltip"in t&&n(12,R=t.tooltip),"pages"in t&&n(1,L=t.pages),"max"in t&&n(32,B=t.max),"$$scope"in t&&n(43,c=t.$$scope)},t.$$.update=()=>{2048&t.$$.dirty[0]&&n(20,o=F&&parseInt(F)>10?parseInt(F):40)},e=r(e),[M,L,_,S,z,j,A,C,T,N,O,F,R,m,w,g,v,x,y,k,o,l,f,d,p,H,P,U,V,e,D,E,B,s,t=>{n(19,k=O?t.cod:t),n(0,M=O?t.cod:t),m.focus(),P(k),p("input",k),p("click"),t?.des&&p("des",t.des),H()},async()=>{n(17,x--,x),await U(),n(16,v=g.length-1)},()=>{n(17,x++,x),U()},function(t){h[t?"unshift":"push"](()=>{m=t,n(13,m)})},t=>{V(t)},async()=>{g.length?await H():(n(0,M=O?"":{}),n(17,x=0),await U(),m.focus())},function(t){h[t?"unshift":"push"](()=>{w=t,n(14,w)})},async()=>{p("input",k),P(k),p("click"),await H()},()=>p("edit"),c]}class xf extends t{constructor(t){super(),e(this,t,vf,gf,n,{label:2,cat:30,extracols:3,placeholder:4,value:0,service:31,edit:5,edittooltip:6,sm:7,readonly:8,onlycod:9,stringa:10,oriz:11,tooltip:12,pages:1,max:32},null,[-1,-1])}}function yf(t){let e,n,i,r;const o=[$f,kf],s=[];function c(t,e){return t[2]?0:1}return e=c(t),n=s[e]=o[e](t),{c(){n.c(),i=S()},m(t,n){s[e].m(t,n),u(t,i,n),r=!0},p(t,r){let l=e;e=c(t),e===l?s[e].p(t,r):(z(),m(s[l],1,1,()=>{s[l]=null}),M(),n=s[e],n?n.p(t,r):(n=s[e]=o[e](t),n.c()),w(n,1),n.m(i.parentNode,i))},i(t){r||(w(n),r=!0)},o(t){m(n),r=!1},d(t){t&&l(i),s[e].d(t)}}}function kf(t){let e,n,i;const r=t[10].default,o=p(r,t,t[9],null);return{c(){e=d("div"),o&&o.c(),c(e,"class",n=(t[4].class||"")+" h-reset w-full"),c(e,"aria-label",t[1])},m(t,n){u(t,e,n),o&&o.m(e,null),i=!0},p(t,l){o&&o.p&&(!i||512&l)&&g(o,r,t,t[9],i?x(r,t[9],l,null):v(t[9]),null),(!i||16&l&&n!==(n=(t[4].class||"")+" h-reset w-full"))&&c(e,"class",n),(!i||2&l)&&c(e,"aria-label",t[1])},i(t){i||(w(o,t),i=!0)},o(t){m(o,t),i=!1},d(t){t&&l(e),o&&o.d(t)}}}function $f(t){let e;const n=t[10].default,i=p(n,t,t[9],null);return{c(){i&&i.c()},m(t,n){i&&i.m(t,n),e=!0},p(t,r){i&&i.p&&(!e||512&r)&&g(i,n,t,t[9],e?x(n,t[9],r,null):v(t[9]),null)},i(t){e||(w(i,t),e=!0)},o(t){m(i,t),e=!1},d(t){i&&i.d(t)}}}function _f(t){let e,n,i=t[3]&&t[0]&&yf(t);return{c(){i&&i.c(),e=S()},m(t,r){i&&i.m(t,r),u(t,e,r),n=!0},p(t,[n]){t[3]&&t[0]?i?(i.p(t,n),1&n&&w(i,1)):(i=yf(t),i.c(),w(i,1),i.m(e.parentNode,e)):i&&(z(),m(i,1,1,()=>{i=null}),M())},i(t){n||(w(i),n=!0)},o(t){m(i),n=!1},d(t){t&&l(e),i&&i.d(t)}}}function Df(t,e,n){let{$$slots:o={},$$scope:l}=e;const{myuuid:s}=fr();let c,{title:a="tab",auth:u,icon:f,active:d,noauto:h=!1,valid:p,tooltip:m}=e,{getdata:w,setdata:b}=J("TABS")||{};function g(t){n(0,d=t)}return K(()=>{if(w){var{tabs:t,curtab:e}=w();t=t.filter(t=>t.id!==c),e===c&&(e=t.length?t[0].id:void 0),b(t,e)}}),t.$$set=t=>{n(4,e=i(i({},e),r(t))),"title"in t&&n(1,a=t.title),"auth"in t&&n(5,u=t.auth),"icon"in t&&n(6,f=t.icon),"active"in t&&n(0,d=t.active),"noauto"in t&&n(2,h=t.noauto),"valid"in t&&n(7,p=t.valid),"tooltip"in t&&n(8,m=t.tooltip),"$$scope"in t&&n(9,l=t.$$scope)},t.$$.update=()=>{483&t.$$.dirty&&function(){if(w){var{tabs:t,curtab:e}=w();if(c){var n=t.find(t=>t.id===c);n&&(n.title=a,n.auth=u,n.icon=f,n.valid=p,n.tooltip=m)}else c=s(),t=[...t,{id:c,title:a,auth:u,icon:f,valid:p,tooltip:m,setactive:g}],e=d?c:e||c;b(t,e)}}()},e=r(e),[d,a,h,w,e,u,f,p,m,l,o]}class Sf extends t{constructor(t){super(),e(this,t,Df,_f,n,{title:1,auth:5,icon:6,active:0,noauto:2,valid:7,tooltip:8})}}const zf=t=>({}),Mf=t=>({});function Ef(t,e,n){const i=t.slice();return i[17]=e[n],i[19]=n,i}function jf(t){let e,n;return e=new xr({props:{tooltip:t[17].tooltip,bottom:!0,$$slots:{default:[Cf]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(t,i){N(e,t,i),n=!0},p(t,n){const i={};4&n&&(i.tooltip=t[17].tooltip),4110&n&&(i.$$scope={dirty:n,ctx:t}),e.$set(i)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){T(e,t)}}}function Af(t){let e,n;return e=new ar({props:{gray:t[3]!=t[17].id,alt:t[3]==t[17].id,size:6,img:t[17].icon}}),{c(){F(e.$$.fragment)},m(t,i){N(e,t,i),n=!0},p(t,n){const i={};12&n&&(i.gray=t[3]!=t[17].id),12&n&&(i.alt=t[3]==t[17].id),4&n&&(i.img=t[17].icon),e.$set(i)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){T(e,t)}}}function Cf(t){let e,n,i,r,o,s,a,h,p,b=t[17].icon&&Af(t);function g(){return t[11](t[17],t[19])}return r=new Ar({props:{id:t[17].title}}),{c(){e=d("button"),b&&b.c(),n=_(),i=d("div"),F(r.$$.fragment),c(e,"aria-label",o=`tab_${t[17].title}/${t[17].auth}`),c(e,"class",s="text-sm "+(t[1]?"":"h-8")+" cursor-pointer z-10 flexrow items-center space-x-1 text-black mr-2 px-3 "+(t[1]?"text-xs py-0":"px-2")+" border rounded "+(t[3]==t[17].id?"bg-white border-c-base font-bold text-c-base hover:border-black":"bg-c-50 text-c-500 border-c-150 hover:border-c-200"))},m(t,o){u(t,e,o),b&&b.m(e,null),k(e,n),k(e,i),N(r,i,null),a=!0,h||(p=f(e,"click",g),h=!0)},p(i,l){(t=i)[17].icon?b?(b.p(t,l),4&l&&w(b,1)):(b=Af(t),b.c(),w(b,1),b.m(e,n)):b&&(z(),m(b,1,1,()=>{b=null}),M());const u={};4&l&&(u.id=t[17].title),r.$set(u),(!a||4&l&&o!==(o=`tab_${t[17].title}/${t[17].auth}`))&&c(e,"aria-label",o),(!a||14&l&&s!==(s="text-sm "+(t[1]?"":"h-8")+" cursor-pointer z-10 flexrow items-center space-x-1 text-black mr-2 px-3 "+(t[1]?"text-xs py-0":"px-2")+" border rounded "+(t[3]==t[17].id?"bg-white border-c-base font-bold text-c-base hover:border-black":"bg-c-50 text-c-500 border-c-150 hover:border-c-200")))&&c(e,"class",s)},i(t){a||(w(b),w(r.$$.fragment,t),a=!0)},o(t){m(b),m(r.$$.fragment,t),a=!1},d(t){t&&l(e),b&&b.d(),T(r),h=!1,p()}}}function Tf(t){let e,n,i=t[8](t[17]),r=i&&jf(t);return{c(){r&&r.c(),e=S()},m(t,i){r&&r.m(t,i),u(t,e,i),n=!0},p(t,n){4&n&&(i=t[8](t[17])),i?r?(r.p(t,n),4&n&&w(r,1)):(r=jf(t),r.c(),w(r,1),r.m(e.parentNode,e)):r&&(z(),m(r,1,1,()=>{r=null}),M())},i(t){n||(w(r),n=!0)},o(t){m(r),n=!1},d(t){t&&l(e),r&&r.d(t)}}}function Nf(t){let e,n,i,r,o,s,a,f,h,b,y=B(t[2]),$=[];for(let e=0;e<y.length;e+=1)$[e]=Tf(Ef(t,y,e));const D=t=>m($[t],1,1,()=>{$[t]=null}),S=t[10].head,E=p(S,t,t[12],Mf),j=t[10].default,A=p(j,t,t[12],null);return{c(){e=d("div"),n=d("div"),i=d("div");for(let t=0;t<$.length;t+=1)$[t].c();r=_(),o=d("div"),s=_(),E&&E.c(),a=_(),f=d("div"),A&&A.c(),c(o,"class","flex-1"),c(i,"class","flexrow w-full items-end pb-0.5 border-b"),c(f,"class","h-full overflow-y-auto"),c(n,"id",t[0]),c(n,"class",h=(t[9].class||"")+" w-full h-full grid grid-rows-[auto_1fr]"),c(e,"class","h-reset")},m(t,l){u(t,e,l),k(e,n),k(n,i);for(let t=0;t<$.length;t+=1)$[t]&&$[t].m(i,null);k(i,r),k(i,o),k(i,s),E&&E.m(i,null),k(n,a),k(n,f),A&&A.m(f,null),b=!0},p(t,[e]){if(510&e){let n;for(y=B(t[2]),n=0;n<y.length;n+=1){const o=Ef(t,y,n);$[n]?($[n].p(o,e),w($[n],1)):($[n]=Tf(o),$[n].c(),w($[n],1),$[n].m(i,r))}for(z(),n=y.length;n<$.length;n+=1)D(n);M()}E&&E.p&&(!b||4096&e)&&g(E,S,t,t[12],b?x(S,t[12],e,zf):v(t[12]),Mf),A&&A.p&&(!b||4096&e)&&g(A,j,t,t[12],b?x(j,t[12],e,null):v(t[12]),null),(!b||1&e)&&c(n,"id",t[0]),(!b||512&e&&h!==(h=(t[9].class||"")+" w-full h-full grid grid-rows-[auto_1fr]"))&&c(n,"class",h)},i(t){if(!b){for(let t=0;t<y.length;t+=1)w($[t]);w(E,t),w(A,t),b=!0}},o(t){$=$.filter(Boolean);for(let t=0;t<$.length;t+=1)m($[t]);m(E,t),m(A,t),b=!1},d(t){t&&l(e),H($,t),E&&E.d(t),A&&A.d(t)}}}function Of(t,e,n){let{$$slots:o={},$$scope:l}=e;const{autofocus:s,post:c}=fr();let{name:a,xs:u=!1}=e;const f=W();let d,h=[],p=null;function m(t){for(var e of(n(3,p=t),h))e.setactive(e.id===t);n(2,h=[...h])}Q("TABS",{getdata:function(){return{tabs:h,curtab:p}},setdata:function(t,e){n(2,h=t),m(e)},updatecurrent:m});return t.$$set=t=>{n(9,e=i(i({},e),r(t))),"name"in t&&n(0,a=t.name),"xs"in t&&n(1,u=t.xs),"$$scope"in t&&n(12,l=t.$$scope)},e=r(e),[a,u,h,p,s,f,d,m,function(t){var e=!0;return!(t.valid&&!(e=t.valid()))&&(t.auth&&(e=c.isauth(t.auth)),e)},e,o,async(t,e)=>{m(t.id),s(!0,d),f("click",{id:e,v:t})},l]}class Ff extends t{constructor(t){super(),e(this,t,Of,Nf,n,{name:0,xs:1})}}function If(t,e,n){const i=t.slice();return i[11]=e[n],i[12]=e,i[13]=n,i}const Rf=t=>({v:1&t}),Lf=t=>({v:t[11],i:t[13]});function Bf(t){let e,n,i=B(t[0]),r=[];for(let e=0;e<i.length;e+=1)r[e]=Vf(If(t,i,e));const o=t=>m(r[t],1,1,()=>{r[t]=null});return{c(){for(let t=0;t<r.length;t+=1)r[t].c();e=S()},m(t,i){for(let e=0;e<r.length;e+=1)r[e]&&r[e].m(t,i);u(t,e,i),n=!0},p(t,n){if(31&n){let l;for(i=B(t[0]),l=0;l<i.length;l+=1){const o=If(t,i,l);r[l]?(r[l].p(o,n),w(r[l],1)):(r[l]=Vf(o),r[l].c(),w(r[l],1),r[l].m(e.parentNode,e))}for(z(),l=i.length;l<r.length;l+=1)o(l);M()}},i(t){if(!n){for(let t=0;t<i.length;t+=1)w(r[t]);n=!0}},o(t){r=r.filter(Boolean);for(let t=0;t<r.length;t+=1)m(r[t]);n=!1},d(t){t&&l(e),H(r,t)}}}function Hf(t){let e,n,i,r,o;function s(){return t[6](t[11],t[12],t[13])}return n=new ar({props:{img:t[11].open?"expand_more":"chevron_right",size:t[2]?4:6,readonly:qf(t[11])}}),{c(){e=d("button"),F(n.$$.fragment),c(e,"name","expand"),c(e,"class","cursor-pointer")},m(t,l){u(t,e,l),N(n,e,null),i=!0,r||(o=f(e,"click",s),r=!0)},p(e,i){t=e;const r={};1&i&&(r.img=t[11].open?"expand_more":"chevron_right"),4&i&&(r.size=t[2]?4:6),1&i&&(r.readonly=qf(t[11])),n.$set(r)},i(t){i||(w(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&l(e),T(n),r=!1,o()}}}function Pf(t){let e,n,i,r,o,s;return n=new Qr({props:{link:!0,sm:!0,value:"clear"}}),n.$on("click",function(){return t[7](t[11],t[12],t[13])}),o=new Qr({props:{link:!0,sm:!0,value:"all"}}),o.$on("click",function(){return t[8](t[11],t[12],t[13])}),{c(){e=d("div"),F(n.$$.fragment),i=_(),r=d("div"),F(o.$$.fragment),c(e,"class","w-auto"),c(r,"class","w-auto")},m(t,l){u(t,e,l),N(n,e,null),u(t,i,l),u(t,r,l),N(o,r,null),s=!0},p(e,n){t=e},i(t){s||(w(n.$$.fragment,t),w(o.$$.fragment,t),s=!0)},o(t){m(n.$$.fragment,t),m(o.$$.fragment,t),s=!1},d(t){t&&(l(e),l(i),l(r)),T(n),T(o)}}}function Uf(t){let e,n,i;return n=new Wf({props:{readonly:t[1],value:t[11].data,xs:t[2],level:t[3]+1}}),n.$on("change",t[10]),{c(){e=d("div"),F(n.$$.fragment),c(e,"class","pl-4")},m(t,r){u(t,e,r),N(n,e,null),i=!0},p(t,e){const i={};2&e&&(i.readonly=t[1]),1&e&&(i.value=t[11].data),4&e&&(i.xs=t[2]),8&e&&(i.level=t[3]+1),n.$set(i)},i(t){i||(w(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&l(e),T(n)}}}function Vf(t){let e,n,i,r,o,s,a,f,y,D,S,E,j,A,C,O=!qf(t[11]),I=O&&Hf(t);const R=t[5].default,L=p(R,t,t[4],Lf),B=L||function(t){let e,n,i,r,o,s=t[11].cod+"",a=t[11].des+"";return{c(){e=d("div"),n=$(s),i=_(),r=d("div"),o=$(a),c(e,"class","font-bold"),c(r,"class","flex-1")},m(t,l){u(t,e,l),k(e,n),u(t,i,l),u(t,r,l),k(r,o)},p(t,e){1&e&&s!==(s=t[11].cod+"")&&b(n,s),1&e&&a!==(a=t[11].des+"")&&b(o,a)},d(t){t&&(l(e),l(i),l(r))}}}(t);let H=t[11].data&&!t[1]&&Pf(t);function P(e){t[9](e,t[11])}let U={checkbox:t[2],xs:t[2],readonly:t[1],truevalue:1,falsevalue:0};void 0!==t[11].value&&(U.value=t[11].value),y=new mo({props:U}),h.push(()=>Z(y,"value",P));let V=t[11].open&&t[11].data&&Uf(t);return{c(){e=d("div"),n=d("div"),i=d("div"),I&&I.c(),o=_(),B&&B.c(),s=_(),H&&H.c(),a=_(),f=d("div"),F(y.$$.fragment),E=_(),V&&V.c(),j=_(),c(i,"class",r=t[2]?"w-4 h-4":"w-6 h-6"),c(f,"class","w-auto"),c(n,"class",S="flex flex-wrap space-x-2 items-center "+(t[2]?"":"py-0.5")),c(e,"class",A="w-full "+(t[2]?"text-xs":""))},m(t,r){u(t,e,r),k(e,n),k(n,i),I&&I.m(i,null),k(n,o),B&&B.m(n,null),k(n,s),H&&H.m(n,null),k(n,a),k(n,f),N(y,f,null),k(e,E),V&&V.m(e,null),k(e,j),C=!0},p(o,l){t=o,1&l&&(O=!qf(t[11])),O?I?(I.p(t,l),1&l&&w(I,1)):(I=Hf(t),I.c(),w(I,1),I.m(i,null)):I&&(z(),m(I,1,1,()=>{I=null}),M()),(!C||4&l&&r!==(r=t[2]?"w-4 h-4":"w-6 h-6"))&&c(i,"class",r),L?L.p&&(!C||17&l)&&g(L,R,t,t[4],C?x(R,t[4],l,Rf):v(t[4]),Lf):B&&B.p&&(!C||1&l)&&B.p(t,C?l:-1),t[11].data&&!t[1]?H?(H.p(t,l),3&l&&w(H,1)):(H=Pf(t),H.c(),w(H,1),H.m(n,a)):H&&(z(),m(H,1,1,()=>{H=null}),M());const s={};4&l&&(s.checkbox=t[2]),4&l&&(s.xs=t[2]),2&l&&(s.readonly=t[1]),!D&&1&l&&(D=!0,s.value=t[11].value,Y(()=>D=!1)),y.$set(s),(!C||4&l&&S!==(S="flex flex-wrap space-x-2 items-center "+(t[2]?"":"py-0.5")))&&c(n,"class",S),t[11].open&&t[11].data?V?(V.p(t,l),1&l&&w(V,1)):(V=Uf(t),V.c(),w(V,1),V.m(e,j)):V&&(z(),m(V,1,1,()=>{V=null}),M()),(!C||4&l&&A!==(A="w-full "+(t[2]?"text-xs":"")))&&c(e,"class",A)},i(t){C||(w(I),w(B,t),w(H),w(y.$$.fragment,t),w(V),C=!0)},o(t){m(I),m(B,t),m(H),m(y.$$.fragment,t),m(V),C=!1},d(t){t&&l(e),I&&I.d(),B&&B.d(t),H&&H.d(),T(y),V&&V.d()}}}function Zf(t){let e,n,i=t[0]&&Bf(t);return{c(){i&&i.c(),e=S()},m(t,r){i&&i.m(t,r),u(t,e,r),n=!0},p(t,[n]){t[0]?i?(i.p(t,n),1&n&&w(i,1)):(i=Bf(t),i.c(),w(i,1),i.m(e.parentNode,e)):i&&(z(),m(i,1,1,()=>{i=null}),M())},i(t){n||(w(i),n=!0)},o(t){m(i),n=!1},d(t){t&&l(e),i&&i.d(t)}}}function Yf(t,e){if(t)for(let n of t)e&&e(n),n.data&&Yf(n.data,e)}function qf(t){return!t.data||0==t.data.length}function Gf(t,e){Yf(t.data,t=>t.value=e)}function Xf(t,e,n){let{$$slots:i={},$$scope:r}=e,{value:o,readonly:l=!1,xs:s=!1}=e,{level:c=0}=e;return t.$$set=t=>{"value"in t&&n(0,o=t.value),"readonly"in t&&n(1,l=t.readonly),"xs"in t&&n(2,s=t.xs),"level"in t&&n(3,c=t.level),"$$scope"in t&&n(4,r=t.$$scope)},[o,l,s,c,r,i,(t,e,i)=>n(0,e[i].open=!t.open,o),(t,e,i)=>{n(0,e[i].value=0,o),Gf(t,0)},(t,e,i)=>{n(0,e[i].value=1,o),Gf(t,1)},function(e,i){t.$$.not_equal(i.value,e)&&(i.value=e,n(0,o))},function(e){V.call(this,t,e)}]}class Wf extends t{constructor(t){super(),e(this,t,Xf,Zf,n,{value:0,readonly:1,xs:2,level:3})}}function Kf(t){let e,n,i,r,s=(t[0]?.name||"").slice(0,1)+"";return{c(){e=d("div"),n=d("div"),i=$(s),c(e,"class","w-full h-full rounded-full overflow-hidden text-white flex flex-col items-center justify-center uppercase select-none"),c(e,"style",r=`background-color: ${t[9]}; font-size: ${t[1]<20?3.5*t[1]:t[1]}px;`)},m(t,r){u(t,e,r),k(e,n),k(n,i)},p(t,n){1&n&&s!==(s=(t[0]?.name||"").slice(0,1)+"")&&b(i,s),514&n&&r!==(r=`background-color: ${t[9]}; font-size: ${t[1]<20?3.5*t[1]:t[1]}px;`)&&c(e,"style",r)},i:o,o:o,d(t){t&&l(e)}}}function Jf(t){let e,n;return e=new ar({props:{img:"person",size:t[1],pixel:t[2],color:t[4]?"text-c-800":"text-c-150"}}),{c(){F(e.$$.fragment)},m(t,i){N(e,t,i),n=!0},p(t,n){const i={};2&n&&(i.size=t[1]),4&n&&(i.pixel=t[2]),16&n&&(i.color=t[4]?"text-c-800":"text-c-150"),e.$set(i)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){T(e,t)}}}function Qf(t){let e,n,i,r;return{c(){e=d("div"),n=d("img"),P(n.src,i=t[0]?.img)||c(n,"src",i),c(n,"alt",r="avatar_"+t[0]?.name),c(n,"class","w-full h-full object-contain object-center"),c(e,"class","overflow-hidden border border-c-border rounded-full"),c(e,"style",t[7])},m(t,i){u(t,e,i),k(e,n)},p(t,o){1&o&&!P(n.src,i=t[0]?.img)&&c(n,"src",i),1&o&&r!==(r="avatar_"+t[0]?.name)&&c(n,"alt",r),128&o&&c(e,"style",t[7])},i:o,o:o,d(t){t&&l(e)}}}function td(t){let e,n;return{c(){e=d("div"),c(e,"class","absolute bottom-0 right-0 rounded-full"),c(e,"style",n=t[2]?`width: ${t[1]/5}px; height: ${t[1]/5}px ; background-color: ${t[8]}`:`width: ${(t[1]||12)/16}rem; height: ${(t[1]||12)/16}rem ; background-color: ${t[8]}`)},m(t,n){u(t,e,n)},p(t,i){262&i&&n!==(n=t[2]?`width: ${t[1]/5}px; height: ${t[1]/5}px ; background-color: ${t[8]}`:`width: ${(t[1]||12)/16}rem; height: ${(t[1]||12)/16}rem ; background-color: ${t[8]}`)&&c(e,"style",n)},d(t){t&&l(e)}}}function ed(t){let e,n,i,r,o;function s(t,e){return 1&e&&(n=null),null==n&&(n=!!(t[0]?.name||"").startsWith("@")),n?id:nd}let a=s(t,-1),f=a(t),h=(t[0]?.nome||t[0]?.cognome)&&rd(t);const b=t[13].default,y=p(b,t,t[12],null);return{c(){e=d("div"),f.c(),i=_(),h&&h.c(),r=_(),y&&y.c(),c(e,"class","flex flex-col text-left space-y-0.5")},m(t,n){u(t,e,n),f.m(e,null),k(e,i),h&&h.m(e,null),k(e,r),y&&y.m(e,null),o=!0},p(t,n){a===(a=s(t,n))&&f?f.p(t,n):(f.d(1),f=a(t),f&&(f.c(),f.m(e,i))),t[0]?.nome||t[0]?.cognome?h?h.p(t,n):(h=rd(t),h.c(),h.m(e,r)):h&&(h.d(1),h=null),y&&y.p&&(!o||4096&n)&&g(y,b,t,t[12],o?x(b,t[12],n,null):v(t[12]),null)},i(t){o||(w(y,t),o=!0)},o(t){m(y,t),o=!1},d(t){t&&l(e),f.d(),h&&h.d(),y&&y.d(t)}}}function nd(t){let e,n,i,r=t[0]?.name+"";return{c(){e=d("div"),n=$("@"),i=$(r),c(e,"class","text-xs font-bold")},m(t,r){u(t,e,r),k(e,n),k(e,i)},p(t,e){1&e&&r!==(r=t[0]?.name+"")&&b(i,r)},d(t){t&&l(e)}}}function id(t){let e,n,i=t[0]?.name+"";return{c(){e=d("div"),n=$(i),c(e,"class","text-xs font-bold uppercase text-c-danger")},m(t,i){u(t,e,i),k(e,n)},p(t,e){1&e&&i!==(i=t[0]?.name+"")&&b(n,i)},d(t){t&&l(e)}}}function rd(t){let e,n,i,r,o=(t[0]?.nome||"")+"",s=(t[0]?.cognome||"")+"";return{c(){e=d("div"),n=$(o),i=_(),r=$(s),c(e,"class","text-xxs")},m(t,o){u(t,e,o),k(e,n),k(e,i),k(e,r)},p(t,e){1&e&&o!==(o=(t[0]?.nome||"")+"")&&b(n,o),1&e&&s!==(s=(t[0]?.cognome||"")+"")&&b(r,s)},d(t){t&&l(e)}}}function od(t){let e,n,i,r,o,s,a,h,p,b;const g=[Qf,Jf,Kf],v=[];function x(t,e){return t[0]?.img?0:t[0]?.id?2:1}i=x(t),r=v[i]=g[i](t);let y=t[3]&&td(t),$=t[5]&&t[0]?.name&&ed(t);return{c(){e=d("button"),n=d("div"),r.c(),o=_(),y&&y.c(),s=_(),$&&$.c(),c(n,"class","relative"),c(n,"style",t[7]),c(e,"class",a=`flex ${t[6]?"flex-row space-x-2 items-center":"flex-col space-y-1.5 items-start"} ${t[11].class||""}`)},m(r,l){u(r,e,l),k(e,n),v[i].m(n,null),k(n,o),y&&y.m(n,null),k(e,s),$&&$.m(e,null),h=!0,p||(b=f(e,"click",t[10]),p=!0)},p(t,[l]){let s=i;i=x(t),i===s?v[i].p(t,l):(z(),m(v[s],1,1,()=>{v[s]=null}),M(),r=v[i],r?r.p(t,l):(r=v[i]=g[i](t),r.c()),w(r,1),r.m(n,o)),t[3]?y?y.p(t,l):(y=td(t),y.c(),y.m(n,null)):y&&(y.d(1),y=null),(!h||128&l)&&c(n,"style",t[7]),t[5]&&t[0]?.name?$?($.p(t,l),33&l&&w($,1)):($=ed(t),$.c(),w($,1),$.m(e,null)):$&&(z(),m($,1,1,()=>{$=null}),M()),(!h||2112&l&&a!==(a=`flex ${t[6]?"flex-row space-x-2 items-center":"flex-col space-y-1.5 items-start"} ${t[11].class||""}`))&&c(e,"class",a)},i(t){h||(w(r),w($),h=!0)},o(t){m(r),m($),h=!1},d(t){t&&l(e),v[i].d(),y&&y.d(),$&&$.d(),p=!1,b()}}}function ld(t,e,n){let o,l,s,{$$slots:c={},$$scope:a}=e,{value:u={}}=e,{size:f=10}=e,{pixel:d=!1}=e,{level:h=!1}=e,{selected:p=!1}=e,{extended:m=!1}=e,{row:w=!1}=e;const b=W();return t.$$set=t=>{n(11,e=i(i({},e),r(t))),"value"in t&&n(0,u=t.value),"size"in t&&n(1,f=t.size),"pixel"in t&&n(2,d=t.pixel),"level"in t&&n(3,h=t.level),"selected"in t&&n(4,p=t.selected),"extended"in t&&n(5,m=t.extended),"row"in t&&n(6,w=t.row),"$$scope"in t&&n(12,a=t.$$scope)},t.$$.update=()=>{1&t.$$.dirty&&n(9,o=["#f5bfd2","#a1cdce","#e5db9c","#beb4c5","#e6a57e","#218b82","#eb96aa","#2cced2","#4382bb","#9c9359","#8c7386","#40393e","#000"][(u?.id||0)%13]),1&t.$$.dirty&&n(8,l=function(t){if(t){if(9==t.level)return t.name.startsWith("@")?"red":"blue";if(3==t.level)return"green";if(2==t.level)return"yellow";if(1==t.level)return"orange"}return"whitesmoke"}(u)),6&t.$$.dirty&&n(7,s=d?`width: ${f}px; height: ${f}px;`:`width: ${(f||12)/4}rem; height: ${(f||12)/4}rem;`)},e=r(e),[u,f,d,h,p,m,w,s,l,o,function(){b("click")},e,a,c]}class sd extends t{constructor(t){super(),e(this,t,ld,od,n,{value:0,size:1,pixel:2,level:3,selected:4,extended:5,row:6})}}function cd(t){let e;return{c(){e=d("div"),e.innerHTML='<div class="ader"></div>',D(e,"z-index","20000"),c(e,"class","fixed cursor-wait top-[50%] left-[50%] -translate-x-[50%] -translate-y-[50%]")},m(t,n){u(t,e,n)},d(t){t&&l(e)}}}function ad(t){let e,n=t[0]&&cd();return{c(){n&&n.c(),e=S()},m(t,i){n&&n.m(t,i),u(t,e,i)},p(t,[i]){t[0]?n||(n=cd(),n.c(),n.m(e.parentNode,e)):n&&(n.d(1),n=null)},i:o,o:o,d(t){t&&l(e),n&&n.d(t)}}}function ud(t,e,n){const{bus:i}=fr();let r,o=!1,l=0;const s=t=>{t?(l||(clearTimeout(r),r=setTimeout(async()=>{n(0,o=!0),await X()},200)),l++):(l--,l<=0&&(l=0,clearTimeout(r),n(0,o=!1)))};return G(()=>{i.on("wait",s)}),K(()=>{i.off("wait",s)}),[o]}class fd extends t{constructor(t){super(),e(this,t,ud,ad,n,{})}}function dd(t,e){return t.replace(e?/&/g:/&(?!#?\w+;)/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function hd(t,e){return t=t.source,e=e||"",function n(i,r){return i?(r=(r=r.source||r).replace(/(^|[^[])\^/g,"$1"),t=t.replace(i,r),n):new RegExp(t,e)}}function pd(){}function md(t){let e,n,i=1;for(;i<arguments.length;i++)for(n in e=arguments[i],e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}pd.exec=pd;const wd={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:pd,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:pd,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:pd,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/,bullet:/(?:[*+-])/,item:/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/};wd.item=hd(wd.item,"gm")(/bull/g,wd.bullet)(),wd.list=hd(wd.list)(/bull/g,wd.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+wd.def.source+")")(),wd.blockquote=hd(wd.blockquote)("def",wd.def)(),wd._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b",wd.html=hd(wd.html)("comment",/<!--[\s\S]*?-->/)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)(/tag/g,wd._tag)(),wd.paragraph=hd(wd.paragraph)("hr",wd.hr)("heading",wd.heading)("lheading",wd.lheading)("blockquote",wd.blockquote)("tag","<"+wd._tag)("def",wd.def)(),wd.normal=md({},wd),wd.gfm=md({},wd.normal,{fences:/^ *(`{3,}|~{3,})[ .]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/,formula:/^ *(\${2,})([\s\S]*?)\s*\1 *(?:\n+|$)/}),wd.gfm.paragraph=hd(wd.paragraph)("(?!","(?!"+wd.gfm.fences.source.replace("\\1","\\2")+"|"+wd.list.source.replace("\\1","\\3")+"|")(),wd.tables=md({},wd.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :0123456789]*)\n((?: *\|.*(?:\n|$))*)\n*/});const bd={escape:/^\\([\\`*{}[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:pd,tag:/^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,ico:/^::([\s\S]+?)::/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:pd,colorbase:pd,coloralt:pd,text:/^[\s\S]+?(?=[\\<![_*:`]| {2,}\n|$)/,_inside:/(?:\[[^\]]*\]|[^[\]]|\](?=[^[]*\]))*/,_href:/\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/};bd.link=hd(bd.link)("inside",bd._inside)("href",bd._href)(),bd.reflink=hd(bd.reflink)("inside",bd._inside)(),bd.normal=md({},bd),bd.pedantic=md({},bd.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),bd.gfm=md({},bd.normal,{escape:hd(bd.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~~(?=\S)([\s\S]*?\S)~~~/,colorbase:/^~(?=\S)([\s\S]*?\S)~/,coloralt:/^~~(?=\S)([\s\S]*?\S)~~/,formula:/^\$(?=\S)([\s\S]*?\S)\$/,text:hd(bd.text)("]|","~$]|")("|","|https?://|")()}),bd.breaks=md({},bd.gfm,{br:hd(bd.br)("{2,}","*")(),text:hd(bd.gfm.text)("{2,}","*")()});const gd={s:"subtitle",k:"keywords",g:"gruppo",e:"editore",y:"datapub",d:"datapub",p:"priority",a:"autore",u:"base",t:"title",l:"link",i:"img","#":"title"},vd=new class{constructor(){this.alias=JSON.parse(JSON.stringify(gd)),this.check()}check(){let t=new Set,e=e=>{e&&e.length>2&&!t.has(e)&&t.add(e)};for(let t in this.alias)this.alias[t]?(e(t),e(this.alias[t])):delete this.alias[t];this.retoalias=function(t){let e={};for(let n in t)t[n]&&(e[t[n]]=n);return e}(this.alias),t=[...t],t=`^\\s*\\:(${t.join("|")}|\\w{1,2})\\:(.*)$`,this.regex=t}add(t,e){return t&&(this.alias[t]=e,this.check()),this}removeAll(){return this.alias={},this.check(),this}setmappa(t){this.alias={};for(let e in t)this.alias[e]=t[e];this.alias["#"]||(this.alias["#"]="title"),this.check()}parse(t,e,n){n&&this.setmappa();let i=t,r={};e&&(r=Object.assign(r,e),r.info=!0);let o=/^\s*#\s+(.*?)\s*$/im.exec(i);o&&(r[this.alias["#"]]=o[1].toLowerCase());for(let t=0;t<20;t++){let e=/:::(.*)([^]+?):::/im.exec(i);if(!e)break;{let n=e[1];n||(n=t+""),r.comments||(r.comments=[]),r.comments.push({k:n,v:e[2]}),i=i.substr(e.index+e[0].length)}}i=t;let l=new RegExp(this.regex,"im");for(let t=0;t<50;t++){let t=l.exec(i);if(!(t&&t.length>=2))break;{i=i.substr(t.index+t[0].length),r.info=!0;let e=(t[2]||"").trim(),n=this.alias[t[1].toLowerCase()];n||(n=t[1].toLowerCase()),"l"==n||"link"==n?(r[n]||(r[n]=[]),r[n].push(e)):r[n]=e}}return r}};var xd=(t,e,n=!1)=>{function i(t,e){let n,i={type:"table",headers:[],align:[],cells:[],cols:0},r=e.split("\n"),o=!1;function s(t){if(i.cols<t){for(let e=i.cols;e<t;e++){i.align[e]="left",i.headers[e]=[];for(let t of i.cells)t[e]=[]}i.cols=t}}for(let t of r)if(t=t.trim(),t.length)if(t.length>2&&t.startsWith("|")&&t.endsWith("|")&&(t=t.slice(1,-1)),n=t.split("|"),s(n.length),0==o&&/^[- :]+\|[- :|]*$/im.test(t)){for(let t=0;t<n.length;t++){let e=n[t],r=e.slice(0,1),o=e.slice(-1);i.align[t]=":"==r&&":"==o?"center":":"==o?"right":"left"}o=!0}else{let t=[];for(let e=0;e<n.length;e++){let r=n[e];if(o){let e=[];l(e,r,!1),t.push(e)}else l(i.headers[e],r,!1)}o&&i.cells.push(t)}t.push(i)}function r(t,e){let n=/^([\d.]+)\s*/.exec(e),i="",r="";n&&(i=n[1],e=e.substring(n.index+n[0].length)),n=/^([\w\s]*?):.*$/gim.exec(e),n&&(r=n[1],e=e.substring(n.index+n[1].length)),t.push({type:"list_item_start",num:i}),r&&(t.push({type:"list_title_start"}),l(t,r,!1),t.push({type:"list_title_end"})),e=e.replace(/\n +/gim,"<br>"),l(t,e,!1),t.push({type:"list_item_end"})}function o(t,e,n,i){let o=[n];for(t.push({type:"list_start",ordered:e});;){let n=/^( *)([*\-+])[\s$]/im.exec(i);if(!n){r(t,i);break}{n.index&&r(t,i.substring(0,n.index));let l=n[1].length;if(l>o[o.length-1])t.push({type:"list_start",ordered:e}),o.push(l);else for(;;){let e=o[o.length-1];if(1==o.length||e<=l)break;t.push({type:"list_end"}),o.pop()}i=i.substring(n.index+n[0].length)}}for(let e of o)t.push({type:"list_end"})}const l=(t,e,n,r)=>{let c;for(e=e.replace(/^ +$/gm,"");e;)if((c=s.newline.exec(e))&&(e=e.substring(c[0].length),c[0].length>1&&t.push({type:"space"})),c=s.formula.exec(e))e=e.substring(c[0].length),t.push({type:"code",lang:"math",text:c[2]||""});else if(c=/^(\s*`{3})(.*)([^]+?)(`{3})/gim.exec(e)){c.index>0&&l(t,e.substring(0,c.index),n);let i=(c[3]||"").replace(/^\n/,"").replace(/\n+$/,"");t.push({type:"code",lang:c[2],text:i}),e=e.substring(c.index+c[0].length)}else if(c=s.heading.exec(e))e=e.substring(c[0].length),t.push({type:"heading",depth:c[1].length,text:c[2]});else if(n&&(c=/^(.*?\|.*\n[-: ]+\|[-| :]*\n.*?\|[^]*?)\n\n/gim.exec(e)))c.index>0&&l(t,e.substring(0,c.index),n),i(t,c[1]),e=e.substring(c.index+c[0].length);else if(n&&(c=/^\|.*\|\s*(?:\n\|.*\|)+/gim.exec(e)))c.index>0&&l(t,e.substring(0,c.index),n),i(t,c[0]),e=e.substring(c.index+c[0].length);else if(c=s.lheading.exec(e))e=e.substring(c[0].length),t.push({type:"heading",depth:"="===c[2]?1:2,text:c[1]});else if(c=s.hr.exec(e))e=e.substring(c[0].length),t.push({type:"hr"});else if(c=s.blockquote.exec(e))e=e.substring(c[0].length),t.push({type:"blockquote_start"}),l(t,c[0].replace(/^ *> ?/gm,""),n,!0),t.push({type:"blockquote_end"});else if(c=/^[\s-:]*?\|[\s-:|]*/im.exec(e),c||!(c=/^( *)([*\-+])[\s$]/im.exec(e))){if(c=s.html.exec(e))e=e.substring(c[0].length),t.push({type:"html",pre:"pre"===c[1]||"script"===c[1]||"style"===c[1],text:c[0]});else if(!r&&n&&(c=s.def.exec(e)))e=e.substring(c[0].length),t.push({type:"code",text:`??${c[0]}??${s.def}??`});else if(n&&(c=s.paragraph.exec(e)))e=e.substring(c[0].length),t.push({type:"paragraph",text:"\n"===c[1].charAt(c[1].length-1)?c[1].slice(0,-1):c[1]});else if(c=s.text.exec(e))e=e.substring(c[0].length),t.push({type:"text",text:c[0]});else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else{c.index>0&&l(t,e.substring(0,c.index)),e=e.substring(c.index+c[0].length);let n=/([^]*?)(\n\n|\n\s*[#>])/im.exec(e+"\n\n");n?(o(t,"*"==c[2],c[1].length,n[1]),e=e.substring(n[1].length)):t.push({type:"text??",text:c[0]})}return t};let s=wd.tables;return t=function(t,e=!1){let n=t.replace(/:::([^]+?):::/gim,"").replace(new RegExp(vd.regex,"gim"),"").replace(/^\s*#\s+/im,"# ").replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n");if(e){const t=/(^\s*#\s+(.*)?\s*)$/im;let e=t.exec(n);e&&0==e.index&&(n=n.replace(t,""))}return n}(t,n),l([],t,!0)};const yd={string:/(".*?[^\\]"|'.*?[^\\]'|`[^]*?[^\\]`|""|''|``)/m,puntuaction:/(-[-=]?|,|;|\+[+=]?|!=?=?|<<?=?|>>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3})/g,parentesis:/(\(|\)|\[|\]|\{|\})/g,ingraffe:/([^$])(\{)(.*?)(\})/g,regex:/\/.*?[^\\]\/[gimu]*/m,numbers:/\b((?:(?:0[xX][\dA-Fa-f]+|0[bB][01]+|0[oO][0-7]+)n?|\d+n|NaN|Infinity)\b|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee][+-]?\d+)?)/gi,js:{comments:/(?:(?:^|[^\\:])(\/\/.*)|(?:^|[^\\])(\/\*[\s\S]*?(?:\*\/)))/m,keyword:/(\b)(import|require|endif|include|define|float|int|real|char|bool|as|true|false|async|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)(\b)/g,keyword2:/(\.\w+|\w+:)/g},json:{string:/(".*?[^\\]")/m,string1:/(".*?[^\\]"\s*:)/m},html:{script:/(<script[\s\S]*?>)([^]*?)(<\/script>)/im,tag:/<(!DOCTYPE|\/?\w+)([^]*?)(\/?>)/im,intag:/(\b)([\w-]+)(=)/g,comments:/<!--[^]*?-->/im},bash:{comments:/# .*/,keyword1:/(^ *|; *)(\w+)(\b)/g,keyword:/(\b)(sudo *[\w-]+)(\b)/g},mu:{comments:/(?:(?:^|[^\\:])(\/\/.*)|(?:^|[^\\])(\/\*[\s\S]*?(?:\*\/)))/m,keyword1:/(#)(\w+)(\b)/g,keyword2:/(\$\(?(\w+|\.|:|\)))/g},sql:{keyword:".",keyword2:/(\b)(FROM|USING|FTS5|NVARCHAR|INTEGER|REAL|BLOB|DELETE|UPDATE|BEGIN|END|ADD|CREATE|CONSTRAINT|ALTER|COLUMN|TABLE|ALL|ASC|BETWEEN|CASE|CHECK|COLUMN|INDEX|VIEW|PROCEDURE|DESC|DISTINTC|DROP|OUTER|INNER|LEFT|JOIN|INSERT|INTO|[NOT ]*NULL|LIMIT|SELECT|ORDER BY|UNION|WHERE)(\b)/gi,keyword1:/(\b)(COLLATE|NOCASE|DEFAULT|IF [NOT ]*EXISTS|PRIMARY KEY|VALUES|AS)(\b)/gi,comments:/(?:(?:^|[^\\:])(\/\/.*)|(?:^|[^\\])(\/\*[\s\S]*?(?:\*\/))|(--\s.*))/m}};const kd=t=>t.replace(/[<>]/g,t=>({"<":"<",">":">"}[t]));function $d(t,e,n){let i=(t,e)=>(e&&(e=e.replace(/(\b)(\w+)(\b)/g,"$1_$2$3")),`ββ${e||""}ββ${(t=kd(t))||""}ββ`),r=t=>{if(yd[e]){let n=yd[e][t];if("."==n)return;if(n)return n}let n=yd[t];return"."==n?void 0:n},o=[],l=0,s=[];if(e){yd[e]||(e="js");let l=r("script");if(l){let n=[];for(;;){let i=l.exec(t);if(!i)break;i.index>0&&n.push(t.substr(0,i.index)),n.push(`β
β
K${s.length}β
β
`),s.push($d(i[1],e)+$d(i[2],"js")+$d(i[3],e)),t=t.substr(i.index+i[0].length)}t.length&&n.push(t),t=n.join("")}for(let n of[{r:"comments",s:"C"}]){let i=r(n.r);if(i){let r=[];for(;;){let o=i.exec(t);if(!o)break;if(o.index>0&&r.push(t.substr(0,o.index)),r.push(`β
β
${n.s}${s.length}β
β
`),"html"==e){let t=o[0].replace(/</g,"<").replace(/>/g,">");s.push(t)}else s.push(o[0]);t=t.substr(o.index+o[0].length)}t.length&&r.push(t),t=r.join("")}}for(let e of[{r:"string2",s:"A"},{r:"string1",s:"B"},{r:"string",s:"S"},{r:"tag",s:"T"},{r:"regex",s:"R"}]){let n=r(e.r);if(n){let o=[];for(;;){let l=n.exec(t);if(!l)break;if(l.index>0&&o.push(t.substr(0,l.index)),o.push(`β
β
${e.s}${s.length}β
β
`),"T"==e.s){let t=l[2].replace(r("intag"),(t,e,n,r)=>e+i(n,"intag")+i(r,"punc"));s.push(i("<","punc")+l[1]+t+i(l[3],"punc"))}else if("`"==l[0][0]){let t=l[0].replace(/(\${)(.*?)(})/gm,(t,e,n,r)=>i(e,"punc")+i(n,"word")+i(r,"punc"));s.push(t)}else s.push(l[0]);t=t.substr(l.index+l[0].length)}t.length&&o.push(t),t=o.join("")}}let c=t.split("\n"),a=0;for(let t of c)a++,t=t.replace(r("keyword"),(t,e,n,r)=>i(e,"tag")+i(n,"keys")+r).replace(r("keyword1"),(t,e,n,r)=>e+i(n,"keys1 keys")+r).replace(r("keyword2"),t=>i(t,"keys2 keys")).replace(r("numbers"),t=>i(t,"number")).replace(r("ingraffe"),(t,e,n,r,o)=>e+i(n,"punc")+i(r,"word")+i(o,"punc")).replace(r("puntuaction"),t=>i(t,"punc")).replace(/β
β
T(\d+)β
β
/gu,(t,e)=>i(s[Number(e)],"tag")).replace(/β
β
S(\d+)β
β
/gu,(t,e)=>i(s[Number(e)],"string")).replace(/β
β
B(\d+)β
β
/gu,(t,e)=>i(s[Number(e)],"string string1")).replace(/β
β
A(\d+)β
β
/gu,(t,e)=>i(s[Number(e)],"string string2")).replace(/β
β
R(\d+)β
β
/gu,(t,e)=>i(s[Number(e)],"regex")).replace(/β
β
C(\d+)β
β
/gu,(t,e)=>i(s[Number(e)],"comment")).replace(/β
β
K(\d+)β
β
/gu,(t,e)=>s[Number(e)]),n?o.push(i((" "+a).substr(-4),"rowid")+i(t)):o.push(i(t))}else{let e=t.split("\n");for(let t of e)l++,n?o.push(`${i((" "+l).substr(-4),"rowid")}${i(t)}`):o.push(i(t))}let c=o.join("\n");return c=c.replace(/ββ/gmu,"</span>").replace(/ββ([^]*?)ββ/gmu,(t,n)=>{if(n){let t=n.split(" "),i=[];for(let n of t)i.push(`elang_${e}${n}`),i.push(`elang${n}`);return`<span class="${i.join(" ")}">`}return"<span>"}),c}class _d{constructor(t,e,n){this.baseurl=t,this.easy=e,this.callback=n}code(t,e,n){if(this.easy)return"";e||(e="js");let i=e==e.toUpperCase();return function(t,e,n,i){let r;return i&&(r=i.length,i.push(t)),`<pre class="elang relative">${$d(t,e,n)}<div class="absolute top-1 right-1"><button class="mu-internal-copy" data-copy="${r}">π</button></div></pre>`}(t,e=e.toLowerCase(),i,n)}blockquote(t){return this.easy?t:`<blockquote>\n${t}</blockquote>\n`}html(t){return t}heading(t,e,n){return"."==t||"*"==t?"":this.easy?`${t} `:`<h${e}>${t}</h${e}>`}hr(){return this.easy?"":'<div class="my-4"><hr/></div>'}list(t,e){let n=e?"ol":"ul";return`<${n}>\n${t}</${n}>\n`}listtitle(t){return`<span class="listtitle">${t}</span>`}listitem(t,e){return e?`<li attr-num="${e||""}">${t}</li>\n`:`<li>${t}</li>\n`}paragraph(t){return this.easy?t:`<p>${t}</p>\n`}table(t,e){return this.easy?"":`<table>\n<thead>\n${t}\n</thead>\n<tbody>\n${e}\n</tbody>\n</table>\n\n`}tablerow(t){return`<tr>\n${t}</tr>\n`}tablecell(t,e,n){return e?`<th style="text-align:center;">${t}</th>\n`:`<td style="${n?"text-align:"+n+";":""}">${t}</td>`}colorbase(t){return`<span class='tilde'>${t}</span>`}formula(t,e=!1){if(this.easy)return"";let n=`<img class='inline px-2' src='https://math.croswil.com/f?${t=t.replace(/<\/?em>/g," ").replace(/\r/g,"").replace("/\n/g"," ")}' alt='${t}'/>`;return e?`<div class='flex justify-center'><div>${n}</div></div>`:n}coloralt(t){return`<span class='tilde2'>${t}</span>`}strong(t){return"<strong>"+t+"</strong>"}ico(t){return`<span class="font-ico">${t}</span>`}em(t){return"<em>"+t+"</em>"}codespan(t){return"<code>"+t+"</code>"}br(){return"<br>"}del(t){return`<del>${t}</del>`}link(t,e,n){if(this.easy)return"("+n+")";let i;if("/"==t.substr(0,1)&&this.baseurl&&(t=this.baseurl+t.substr(1)),t.startsWith("!"))i=`<button class="mu-internal-link" data-href="${t=t.slice(1)}">${n}</button>`;else{let r="";t.startsWith(".")?t=t.slice(1):r='target="_blank"',i=`<a ${r} href='${t}' title='${e||""}'>${n}</a>`}return i}image(t,e,n){if(this.easy)return"";let i=n.split("|"),r="",o=!1,l=!1,s=!1;if((t=(t=t.replace("https://www.youtube.com/watch?v=","https://youtu.be/")).replace("https://youtu.be","https://www.youtube.com/embed")).endsWith(".mp3")?(t=t.slice(0,-4),s=!0):t.endsWith(".mp4")?(t=t.slice(0,-4),l=!0):t.endsWith(".webm")?(t=t.slice(0,-5),o=!0):t.endsWith(".video")&&(t=t.slice(0,-6),o=!0,l=!0),s)r=`\n <audio controls ${i.length>=1?' width="'+i[1]+'"':""}\n class="mx-auto my-2 ${i.length>=2?i[2]:""}" \n >\n <source src="${t}.mp3" type="audio/mpeg">\n Il tuo browser non supporta l'elemento audio.\n </audio>\n `;else if(l||o)r=`\n<video ${i.length>=1?' width="'+i[1]+'"':""}\nclass="border rounded-lg shadow-xl ${i.length>=2?i[2]:""}" \ncontrols controlsList="nodownload" >\n ${o?'<source src="'+t+'.webm" type="video/webm" >':""}\n ${l?'<source src="'+t+'.mp4" type="video/mp4" >':""}\n \n Your browser does not support the video tag.\n</video>`;else{if(t.indexOf("https://www.youtu")>=0){let n=t.split("/embed/")[1]?.split("?")[0];return r=`\n\n<div style="width: 94%; box-shadow: 6px 6px 10px hsl(206.5, 0%, 75%); margin: 3%;">\n <div style="position: relative; padding-bottom: 56.15%; height: 0; overflow: hidden;">\n <iframe \n style="position: absolute; top: 0; left:0; width: 100%; height: 100%; border: 0;"\n loading="lazy";\n srcdoc="<style>\n * {\n padding: 0;\n margin: 0;\n overflow: hidden;\n }\n \n body, html {\n height: 100%;\n }\n \n img, svg {\n position: absolute;\n width: 100%;\n top: 0;\n bottom: 0;\n margin: auto;\n }\n \n svg {\n filter: drop-shadow(1px 1px 10px hsl(206.5, 70.7%, 8%));\n transition: all 250ms ease-in-out;\n }\n \n body:hover svg {\n filter: drop-shadow(1px 1px 10px hsl(206.5, 0%, 10%));\n transform: scale(2);\n }\n </style>\n <a href='https://www.youtube.com/embed/${n}?autoplay=1'>\n <img src='https://img.youtube.com/vi/${n}/hqdefault.jpg' alt='${e||"video"}'>\n <svg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 24 24' fill='none' stroke='#ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-play-circle'><circle cx='12' cy='12' r='10'></circle><polygon points='10 8 16 12 10 16 10 8'></polygon></svg>\n </a>\n "\n src="https://www.youtube.com/embed/${n}" \n title="${e||"video"}"\n frameborder="0"\n allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" \n allowfullscreen>\n </iframe>\n </div>\n </div> \n \n`,r}this.callback&&"function"==typeof this.callback&&(t=this.callback({type:"img",href:t})),"/"==t.substr(0,1)&&this.baseurl&&(t=this.baseurl+t.substr(1)),r='<img src="'+t+'" alt="'+i[0]+'"',i.length>1&&(i[1].length&&(r+=' width="'+i[1]+'"'),i.length>2&&(r+=' class="'+i[2]+'"')),i[0]&&(r+=' title="'+i[0]+'"'),r+="/>"}return r}text(t){return t}}const Dd=bd.gfm;let Sd=(t,e,n=0)=>{let i=0,r=t=>{if(n>0&&t.length>n-i){let e=(t=t.substring(0,n-i)).lastIndexOf(" ");e>0&&(t=t.substring(0,e))}return t},o=()=>a=f.pop(),l=()=>{let t=a.text;for(;"text"===(f[f.length-1]||0).type;)t+="\n"+o().text;return c(r(t))},s=(t,n)=>{let i=dd(n.href),r=n.title?dd(n.title):null;return"!"!==t[0].charAt(0)?e.link(i,r,c(t[1])):e.image(i,r,dd(t[1]))};const c=t=>{let n,i,r,o,l="";for(;t;)if(o=Dd.escape.exec(t))t=t.substring(o[0].length),l+=o[1];else if(o=Dd.autolink.exec(t))t=t.substring(o[0].length),"@"===o[2]?(i=":"===o[1].charAt(6)?o[1].substring(7):o[1],r=`mailto:${i}`):(i=dd(o[1]),r=i),l+=e.link(r,null,i);else if(d||!(o=Dd.url.exec(t))){if(o=Dd.tag.exec(t))!d&&/^<a /i.test(o[0])?d=!0:d&&/^<\/a>/i.test(o[0])&&(d=!1),t=t.substring(o[0].length),l+=o[0];else if(o=Dd.link.exec(t))t=t.substring(o[0].length),d=!0,l+=s(o,{href:o[2],title:o[3]}),d=!1;else if((o=Dd.reflink.exec(t))||(o=Dd.nolink.exec(t))){if(t=t.substring(o[0].length),n=(o[2]||o[1]).replace(/\s+/g," "),n=h[n.toLowerCase()],!n||!n.href){l+=o[0].charAt(0),t=o[0].substring(1)+t;continue}d=!0,l+=s(o,n),d=!1}else if(o=Dd.formula.exec(t))t=t.substring(o[0].length),l+=e.formula(c(o[1]));else if(o=Dd.ico.exec(t))t=t.substring(o[0].length),l+=e.ico(c(o[2]||o[1]));else if(o=Dd.strong.exec(t))t=t.substring(o[0].length),l+=e.strong(c(o[2]||o[1]));else if(o=Dd.em.exec(t))t=t.substring(o[0].length),l+=e.em(c(o[2]||o[1]));else if(o=Dd.code.exec(t))t=t.substring(o[0].length),l+=e.codespan(dd(o[2],!0));else if(o=Dd.br.exec(t))t=t.substring(o[0].length),l+=e.br();else if(o=Dd.del.exec(t))t=t.substring(o[0].length),l+=e.del(c(o[1]));else if(o=Dd.coloralt.exec(t))t=t.substring(o[0].length),l+=e.coloralt(c(o[1]));else if(o=Dd.colorbase.exec(t))t=t.substring(o[0].length),l+=e.colorbase(c(o[1]));else if(o=Dd.text.exec(t))t=t.substring(o[0].length),l+=e.text(o[0]);else if(t)throw new Error("Infinite loop on byte: "+t.charCodeAt(0))}else t=t.substring(o[0].length),i=dd(o[1]),r=i,l+=e.link(r,null,i);return l};let a,u=()=>{switch(a.type){case"space":return"";case"hr":return e.hr();case"heading":return e.heading(c(r(a.text)),a.depth,a.text);case"code":return"math"==a.lang?e.formula(a.text,!0):e.code(a.text,a.lang,p);case"table":{let t,n,i,r="",o=[];n=[];for(let t=0;t<a.headers.length;t++)n.push(e.tablecell(Sd(a.headers[t],e,0).out,!0,a.align[t]));r=e.tablerow(n.join(""));for(let r=0;r<a.cells.length;r++){for(t=a.cells[r],n=[],i=0;i<t.length;i++)n.push(e.tablecell(Sd(t[i],e,0).out,!1,a.align[i]));o.push(e.tablerow(n.join("")))}return e.table(r,o.join(""))}case"blockquote_start":{let t="";for(;"blockquote_end"!==o().type;)t+=u();return e.blockquote(t)}case"list_start":{let t="",n=a.ordered;for(;"list_end"!==o().type;)t+=u();return e.list(t,n)}case"list_title_start":{let t="";for(;"list_title_end"!==o().type;)t+=u();return e.listtitle(t)}case"list_item_start":{let t="",n=a.num;for(;"list_item_end"!==o().type;)t+="text"===a.type?l():u();return e.listitem(t,n)}case"html":return e.html(a.text);case"paragraph":return e.paragraph(c(r(a.text)));case"text":return e.paragraph(l())}},f=t.reverse(),d=!1,h={},p=[],m=[];for(;o();){let t=u();if(i+=t.length,t&&m.push(t),n>0&&i>n)break}return{out:m.join(""),codes:p}};function zd(t,e){let n;function i(i,r,o){if(n=i.exec(t),n){zd(t.slice(0,n.index),e);let i=n[1];return i.startsWith("\n")&&(e.push({class:"",text:"\n"}),i=i.slice(1)),e.push({class:r,text:o?o(i):i}),zd(t.slice(n.index+n[1].length),e),!0}return!1}t&&"string"==typeof t&&(i(/^(:{3}\s*$[^]+?:{3}\s*$)/gim,"comment")||i(/^(\s*`{3}[^]+?`{3}\s*$)/gim,"code")||i(/^(\s*:\w+:.*)$/gim,"comment")||(t=t.replace(/ {2,}\n/gim," "),i(/^(\s*#{1,6}\s+.*)/gim,"title")||i(/(\n\s*\n)/gim,"break")||i(/^(\s*>\s+[^]*?\n\n)/gim,"cite")||i(/^(\s*>\s+.*)/gim,"cite")||i(/^(.*?\|[^]*?\n\n)/gim,"table")||i(/^( *\*| *-|-{1,8})[ $]/gim,"list")||i(/^( ([\d]+[.]*)+)[ $]/gim,"list",t=>{let e=t.split(".");e.shift();let n=[];for(let t of e)t.length&&n.push(" ");return n.push("-"),n.join("")})||e.push({class:"",text:t})))}function Md(t,e=""){let n=[];zd(t,n);let i=[],r=0;for(let t=0;t<n.length;t++){let o=n[t];if("list"==o.class){let l=o.text.replace("\n","").length;if(l>r)i.push({space:l,id:1}),r=l;else for(;;){let t=i[i.length-1];if(1==i.length||t.space<=l){r=t.space,t.id++;break}i.pop()}let s=[],c=[];for(let t of i)c.push(" "),s.push(t.id);c.pop(),o.old=o.text,o.text.indexOf("-")>=0?o.text=c.join("")+"- "+s.join(".")+".":o.text=c.join("")+"* ",s=[];for(let e=t+1;e<n.length&&""==n[e].class;e++)s.push(n[e].text);o.title=e,o.data=o.text+s.join("")}else""!=o.class&&("title"==o.class&&(e=o.text),i=[],r=0)}let o=[],l=[];for(let t of n)"list"==t.class&&l.push({title:t.title,lev:t.text,data:t.data}),o.push(t.text);return{txt:o.join(""),cards:l,tm:n}}function Ed(t,e,n=""){let i;function r(r,o){return i=r.exec(t),!!i&&(Ed(t.slice(0,i.index),e,n),e.push({class:`${n} ${o}`,text:i[1]}),Ed(i[2],e,`${n} ${o}`),e.push({class:`${n} ${o}`,text:i[3]}),Ed(t.slice(i.index+i[1].length+i[2].length+i[3].length),e,n),!0)}(function(r,o){return i=r.exec(t),!!i&&(Ed(t.slice(0,i.index),e,n),e.push({class:`${n} ${o}`,text:i[1]}),Ed(t.slice(i.index+i[1].length),e,n),!0)})(/(`.*?`)/gim,"code2")||r(/(\*{3})([^]+?)(\*{3})/gim,"grassetto italico")||r(/(\*{2})([^]+?)(\*{2})/gim,"grassetto")||r(/(\*{1})([^]+?)(\*{1})/gim,"italico")||r(/(_{3})([^]+?)(_{3})/gim,"grassetto italico")||r(/(_{2})([^]+?)(_{2})/gim,"grassetto")||r(/(_{1})([^]+?)(_{1})/gim,"italico")||r(/(~{3})([^]+?)(~{3})/gim,"barrato")||r(/(~{2})([^]+?)(~{2})/gim,"tilde2")||r(/(~{1})([^]+?)(~{1})/gim,"tilde")||e.push({class:n,text:t})}function jd(t,e){let n;function i(i,r,o=!1){return n=i.exec(t),!!n&&(jd(t.slice(0,n.index),e),o?Ed(n[1],e,r):e.push({class:r,text:n[1]}),jd(t.slice(n.index+n[1].length),e),!0)}if(!(i(/^(:{3}[^]+?:{3})/gim,"comment")||i(/^(\s*`{3}[^]+?`{3})/gim,"code")||i(/^(\s*:\w+:.*)$/gim,"comment")||i(/^(\s*#{1,6} +.*)$/gim,"title",!0)||i(/^(\s*>\s+[^]*?\n\n)/gim,"cite",!0)||i(/^(\s*>\s+.*)/gim,"cite",!0)||i(/^(.*?\|.*\n[-: ]+\|[-| :]*\n.*?\|[^]*?\n\n)/gim,"tabella",!0)||i(/^(\n{2,})/gim,"break",!0)||i(/^( *\*| *-|-{1,8})[ $]/gim,"list",!0)||i(/(^\s*[\d.]+)[\s$]/gim,"list",!0))){if(n=/(!*\[)(.*?)(\]\s*\()(.*?)(\))/.exec(t),n)return Ed(t.slice(0,n.index),e,""),e.push({class:"grassetto",text:n[1]}),e.push({class:"linkdes",text:n[2]}),e.push({class:"grassetto",text:n[3]}),e.push({class:"linkval",text:n[4]}),e.push({class:"grassetto",text:n[5]}),void Ed(t.slice(n.index+n[1].length+n[2].length+n[3].length+n[4].length+n[5].length),e,"");Ed(t,e,"")}}function Ad(t){"number"==typeof t&&(t=String(t)),t&&"string"==typeof t||(t=" "),t.endsWith("\n")&&(t+=" ");let e=[];return jd(t,e),e}function Cd(t,e,n=""){let i;function r(r,o){return i=r.exec(t),!!i&&(Cd(t.slice(0,i.index),e,n),e.push({class:`${n} ${o}`,text:i[1]}),Cd(t.slice(i.index+i[1].length),e,n),!0)}r(/(\/\/.*)$/gim,"commento2")||function(r,o){if(i=r.exec(t),i){let r=i.index+i[1].length;return Cd(t.slice(0,r),e,n),e.push({class:`${n} ${o}`,text:i[2]}),Cd(t.slice(r+i[2].length),e,n),!0}return!1}(/(#let.? +)([\w_.]+)/gi,"variabile")||r(/(#(select|setdef|ret|cases|endselect|ifdef|log|msg|endif|cvar|cache|look|lookb|elseifdef|variante|forvar|for|endfor|continue|break|inc|macro|default|lets|letv|lett|cat|func))/gim,"comando")||r(/(#(if\s*|elseif\s*))/gim,"comando")||r(/(#(else|let|i |m |f |j |case|def ))/gim,"comando")||r(/(\$[{(]?[\w_.]+)/gim,"variabile")||r(/({.+?\})/gim,"formula")||r(/([})(])/gim,"variabile")||r(/([\d.:,;\\,]+)/gim,"digit")||e.push({class:n,text:t})}function Td(t,e){let n;(function(i,r,o=!1){return n=i.exec(t),!!n&&(Td(t.slice(0,n.index),e),o?Cd(n[1],e,r):e.push({class:r,text:n[1]}),Td(t.slice(n.index+n[1].length),e),!0)})(/(\/\*[^]+?\*\/)/gim,"comment")||Cd(t,e,"")}function Nd(t){t||(t=" "),t.endsWith("\n")&&(t+=" ");let e=[];return Td(t,e),e}function Od(t){let e=t.split("\n"),n=[],i=0,r=0;const o=" ";for(let t=0;t<e.length;t++){let l=e[t].trim(),s=o.repeat(i>=0?i+r:r);r=0;let c="";l.split("//")[0].trim().endsWith("\\")&&(r=1),(l.startsWith("#")||l.startsWith("!"))&&(c=l.substring(1).split(" ")[0].toUpperCase(),l=l.substring(0,1)+c+l.substring(c.length+1)),"IF"==c||"IFDEF"==c||"IFNDEF"==c?l.indexOf("#",2)<0?i++:l=l.replace(/#([\w]+)/g,(t,e)=>"#"+e.toUpperCase()):["FOR","FORVAR","DO","SELECT"].includes(c)?i++:["ENDIF","LOOP","ENDFOR","ENDSELECT"].includes(c)&&(i--,s=o.repeat(i>=0?i:0)),["ELSEIF","ELSE","ELSEIFDEF","ELSEIFNDEF","CASE","CASES","DEFAULT"].includes(c)&&i>0?n.push(o.repeat(i-1)+l):n.push(s+l)}return n.join("\n")}function Fd(t){return(t=t+""||"").includes('"')?t.split(/[,;](?=(?:(?:[^"]*["]){2})*[^"]*$)/).map(t=>t.trim().replace(/(^["'])|(["']$)/g,"").replace(/=\s*["']/g,"=")):t.split(/[,;]/).map(t=>t.trim())}const{window:Id}=U;function Rd(t){let e,n,i,r;return{c(){e=d("div"),c(e,"class",n="markprint "+(t[1]?"text-xs":t[0]?"text-sm":"text-base")+" "+(t[6].class||""))},m(n,o){u(n,e,o),e.innerHTML=t[2],i||(r=f(Id,"click",t[5]),i=!0)},p(t,[i]){4&i&&(e.innerHTML=t[2]),67&i&&n!==(n="markprint "+(t[1]?"text-xs":t[0]?"text-sm":"text-base")+" "+(t[6].class||""))&&c(e,"class",n)},i:o,o:o,d(t){t&&l(e),i=!1,r()}}}function Ld(t,e,n){let o,l,s;const{lang:c,P:a,PP:u,post:f,bus:d,theme:h}=fr();I(t,c,t=>n(14,l=t)),I(t,h,t=>n(15,s=t));let{value:p=""}=e,{file:m}=e,{notitle:w=!1}=e,{cat:b=""}=e,{info:g={}}=e,{vars:v={}}=e,{bkcall:x="mucalls/md"}=e;const y=W();let{sm:k=!1}=e,{xs:$=!1}=e;function _(t){let e=t.target.closest(".mu-internal-link");if(e){const t=e.getAttribute("data-href");y("link",t)}if(e=t.target.closest(".mu-internal-copy"),e){let t=e.parentNode.parentNode.textContent.replace("π","");navigator.clipboard.writeText(t),d.messaggio("copiato")}}function D(t){if("img"==t.type){if(b){let e=/^(\w)\s+(.*)$/.exec(t.href);e&&(e[1]=e[1].toLowerCase(),"t"!=e[1]&&(t=f.fullget("mufiles/getimage",{id:b,tipo:e[1],name:e[2]})))}return t}}function S(t){if(t){var e=function(t,e){let n=t;if(e)for(let t in e){let i=e[t]||`..${t}..`;n=n.replace(new RegExp(`\\[${t}\\]`,"gim"),i)}return n}(t,v);n(8,g=((t,e,n)=>vd.parse(t,e,n))(e));var i=((t,e,n=!1,i=!1,r)=>{let o;if(i)o=xd(t,0,n);else{let{txt:e}=Md(t);o=xd(e,0,n)}return Sd(o,new _d(e,!1,r))})(e,a.baseurl,w,!1,D);return i.codes,i.out}return n(8,g={}),""}return G(()=>(window.addEventListener("click",_),()=>{window.removeEventListener("click",_)})),t.$$set=t=>{n(6,e=i(i({},e),r(t))),"value"in t&&n(7,p=t.value),"file"in t&&n(9,m=t.file),"notitle"in t&&n(10,w=t.notitle),"cat"in t&&n(11,b=t.cat),"info"in t&&n(8,g=t.info),"vars"in t&&n(12,v=t.vars),"bkcall"in t&&n(13,x=t.bkcall),"sm"in t&&n(0,k=t.sm),"xs"in t&&n(1,$=t.xs)},t.$$.update=()=>{32768&t.$$.dirty&&(s.includes("-dark")||s.includes("-sand")),128&t.$$.dirty&&n(2,o=S(p)),16896&t.$$.dirty&&async function(t){t&&n(7,p=await u(x,{file:t,lang:l}))}(m)},e=r(e),[k,$,o,c,h,_,e,p,g,m,w,b,v,x,l,s]}class Bd extends t{constructor(t){super(),e(this,t,Ld,Rd,n,{value:7,file:9,notitle:10,cat:11,info:8,vars:12,bkcall:13,sm:0,xs:1})}}function Hd(t,e,n){const i=t.slice();return i[24]=e[n],i}function Pd(t){let e,n=B(t[7]),i=[];for(let e=0;e<n.length;e+=1)i[e]=Ud(Hd(t,n,e));return{c(){for(let t=0;t<i.length;t+=1)i[t].c();e=S()},m(t,n){for(let e=0;e<i.length;e+=1)i[e]&&i[e].m(t,n);u(t,e,n)},p(t,r){if(128&r){let o;for(n=B(t[7]),o=0;o<n.length;o+=1){const l=Hd(t,n,o);i[o]?i[o].p(l,r):(i[o]=Ud(l),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=n.length}},d(t){t&&l(e),H(i,t)}}}function Ud(t){let e,n,i,r=t[24].text+"";return{c(){e=d("span"),n=$(r),c(e,"class",i=t[24].class||"")},m(t,i){u(t,e,i),k(e,n)},p(t,o){128&o&&r!==(r=t[24].text+"")&&b(n,r),128&o&&i!==(i=t[24].class||"")&&c(e,"class",i)},d(t){t&&l(e)}}}function Vd(t){let e,n,i,r,o,a,h,b,y;const $=t[16].default,D=p($,t,t[15],null);let S=!t[2]&&Pd(t);return{c(){e=d("div"),D&&D.c(),n=_(),i=d("pre"),S&&S.c(),r=_(),o=d("textarea"),c(i,"aria-hidden","true"),c(i,"class","h-fit"),c(o,"class","h-fit"),c(o,"autocomplete","off"),c(o,"autocorrect","off"),o.value=t[0],o.readOnly=t[1],c(e,"class",a="w-full relative editmd "+(t[12].class||""))},m(l,s){u(l,e,s),D&&D.m(e,null),k(e,n),k(e,i),S&&S.m(i,null),t[17](i),k(e,r),k(e,o),t[18](o),h=!0,b||(y=[f(o,"contextmenu",t[9]),f(o,"keydown",t[10]),f(o,"input",t[8]),f(o,"mousemove",t[19]),f(o,"scroll",t[11])],b=!0)},p(t,[n]){D&&D.p&&(!h||32768&n)&&g(D,$,t,t[15],h?x($,t[15],n,null):v(t[15]),null),t[2]?S&&(S.d(1),S=null):S?S.p(t,n):(S=Pd(t),S.c(),S.m(i,null)),(!h||1&n)&&(o.value=t[0]),(!h||2&n)&&(o.readOnly=t[1]),(!h||4096&n&&a!==(a="w-full relative editmd "+(t[12].class||"")))&&c(e,"class",a)},i(t){h||(w(D,t),h=!0)},o(t){m(D,t),h=!1},d(n){n&&l(e),D&&D.d(n),S&&S.d(),t[17](null),t[18](null),b=!1,s(y)}}}function Zd(t,e,n){let o,{$$slots:l={},$$scope:s}=e;const c=W();let a,u,f,d,{value:p=""}=e,{rule:m=!1}=e,{readonly:w=!1}=e,{noformat:b=!1}=e;function g(t,e){let n=t;const i=n.selectionStart,r=n.value.substring(0,i).lastIndexOf("\n")+1;let o=n.value.indexOf("\n",i);o=-1===o?n.value.length:o;const l=n.value.substring(r,o);c("help",{row:l,key:e,p1:r,p2:o,p3:i-r,mouseX:f,mouseY:d})}return t.$$set=t=>{n(12,e=i(i({},e),r(t))),"value"in t&&n(0,p=t.value),"rule"in t&&n(13,m=t.rule),"readonly"in t&&n(1,w=t.readonly),"noformat"in t&&n(2,b=t.noformat),"$$scope"in t&&n(15,s=t.$$scope)},t.$$.update=()=>{8193&t.$$.dirty&&n(7,o=m?Nd(p):Ad(p))},e=r(e),[p,w,b,a,u,f,d,o,function(t){w||(n(0,p=t.target.value),c("change"))},function(t){t.preventDefault(),g(t.target,"h")},async function(t){if(!w){if(t.ctrlKey){let e,i=t.target;switch(t.key){case"s":t.preventDefault(),c("save");break;case"l":t.preventDefault(),c("reload");break;case"r":t.preventDefault(),c("run");break;case"h":case"m":t.preventDefault(),g(i,t.key);break;case"f":t.preventDefault(),e=i.selectionStart+1,n(0,p=Od(p)),i.value=p,i.selectionStart=e,i.selectionEnd=e}}if("Tab"==t.key){t.preventDefault();var e=t.target;pos=e.selectionStart+1,n(0,p=p.slice(0,e.selectionStart)+"\t"+p.slice(e.selectionEnd)),e.value=p,e.selectionStart=pos,e.selectionEnd=pos}}},function(){n(4,u.scrollTop=a.scrollTop,u),n(4,u.scrollLeft=a.scrollLeft,u)},e,m,function(t){n(0,p=a.value);var e=a.selectionStart;e<0&&(e=p.length),n(0,p=p.slice(0,e)+t+p.slice(e))},s,l,function(t){h[t?"unshift":"push"](()=>{u=t,n(4,u)})},function(t){h[t?"unshift":"push"](()=>{a=t,n(3,a)})},t=>{n(5,f=t.clientX),n(6,d=t.clientY)}]}class Yd extends t{constructor(t){super(),e(this,t,Zd,Vd,n,{value:0,rule:13,readonly:1,noformat:2,inserisci:14})}get inserisci(){return this.$$.ctx[14]}}const qd="monokai",Gd="default";async function Xd(t){function e(e){return new Promise((n,i)=>{const r=t.createElement("script");r.src=e,r.onload=n,r.onerror=i,t.head.appendChild(r)})}function n(e){return new Promise((n,i)=>{const r=t.createElement("link");r.rel="stylesheet",r.href=e,r.onload=n,r.onerror=i,t.head.appendChild(r)})}await Promise.all([e("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/codemirror.min.js"),n("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/codemirror.min.css"),n(`https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/theme/${qd}.min.css`),n("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/addon/hint/show-hint.min.css"),n("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/addon/fold/foldgutter.min.css"),n("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/addon/lint/lint.min.css")]),await Promise.all([e("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/mode/javascript/javascript.min.js"),e("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/mode/yaml/yaml.min.js"),e("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/addon/hint/show-hint.min.js"),e("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/addon/fold/foldcode.min.js"),e("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/addon/fold/foldgutter.min.js"),e("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/addon/fold/brace-fold.min.js"),e("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/addon/fold/comment-fold.min.js"),e("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/addon/selection/selection-pointer.min.js"),e("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/addon/lint/lint.min.js"),e("https://unpkg.com/jsonlint-mod/web/jsonlint.js"),e("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/addon/lint/json-lint.min.js"),e("https://cdnjs.cloudflare.com/ajax/libs/js-yaml/4.1.0/js-yaml.min.js"),e("https://cdnjs.cloudflare.com/ajax/libs/prettier/2.7.1/standalone.min.js"),e("https://cdnjs.cloudflare.com/ajax/libs/prettier/2.7.1/parser-babel.min.js"),e("https://cdnjs.cloudflare.com/ajax/libs/prettier/2.7.1/parser-yaml.min.js")]);const i=t.createElement("style");i.textContent="\n .cm-s-default .cm-comment {\n color: #008000 !important; /* Verde */\n font-style: italic; // opzionale */\n }\n /*\n .cm-s-default .cm-string {\n color:#560b85 ;\n }\n .cm-s-default .cm-string-2 {\n color: #470470 ;\n }\n */\n \n .cm-s-default .cm-property {\n color:#7114ab ;\n }\n \n ",t.head.appendChild(i)}function Wd(t){let e;return{c(){e=d("div"),c(e,"class","w-full h-full relative")},m(n,i){u(n,e,i),t[10](e)},p:o,i:o,o:o,d(n){n&&l(e),t[10](null)}}}function Kd(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Jd(t,e,n){let i;const{bus:r,theme:o}=fr();let l,s;I(t,o,t=>n(14,i=t));let c,{value:a=""}=e,{yaml:u=!1}=e,{json:f=!1}=e,d=null,p=-1,m=[];const w=W();function b(){if(!s)return{};const t=s.getCursor(),e=s.getScrollInfo();let n=[];return s.getAllMarks().forEach(t=>{if(t.C){let e=t.find();e&&n.push(e)}}),{cursor:t,scrollInfo:e,folds:n}}function g(t){let e,n,i;Array.isArray(t)?i=t:({cursor:e,scrollInfo:n,folds:i}=t),s&&(e&&s.setCursor(e),n&&s.scrollTo(n.left,n.top),i&&i.forEach(({from:t})=>{t.line<s.lineCount()&&s.foldCode(t)}))}function v(t){const e=b(),n=t.getValue(),i=prettier.format(n,{parser:u?"yaml":"babel",plugins:prettierPlugins,printWidth:500,singleQuote:!0,semi:!0,trailingComma:"all",tabWidth:4,useTabs:!1,proseWrap:"preserve",htmlWhitespaceSensitivity:"ignore"});t.setValue(i),g(e)}async function x(){window.CodeMirror||await Xd(document);const t=window.CodeMirror;function e(t){w("run")}function r(t){let e;if(t.getSelection())e=t.getSelection();else{const n=t.findWordAt(t.getCursor());e=t.getRange(n.anchor,n.head),t.setSelection(n.anchor,n.head)}e&&function(t){if(!t)return;if(d)p=(p+1)%d.matches.length;else{d={query:new RegExp(Kd(t),"g"),matches:[]},m=[];const e=s.getValue();let n;for(;null!==(n=d.query.exec(e));)d.matches.push({from:s.posFromIndex(n.index),to:s.posFromIndex(n.index+n[0].length)});p=0}if(d.matches.length>0){const t=d.matches[p];m.push({anchor:t.from,head:t.to}),s.setSelections(m),s.scrollIntoView(t.from)}}(e)}function o(t){}function c(t){v(t),w("save")}function h(t){event?.preventDefault(),w("load")}n(8,s=t(l,{value:a,mode:u?"yaml":f?"json":"javascript",theme:i.includes("-dark")||i.includes("-sand")?qd:Gd,lineNumbers:!0,foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter",...f||u?["CodeMirror-lint-markers"]:[]],lint:f||u,viewportMargin:1/0,foldOptions:{widget:"πΈπΈπΈ"}})),s.setOption("mode",u?"yaml":f?{name:"javascript",json:!0}:"javascript"),s.getWrapperElement().style.height="100%",s.on("change",()=>{n(2,a=s.getValue()),w("input",a)}),s.setOption("extraKeys",{"Cmd-S":c,"Ctrl-S":c,"Ctrl-F":function(t){v(t),w("formatted")},F1:o,"Cmd-H":o,"Ctrl-H":o,"Ctrl-R":e,"Cmd-R":e,"Cmd-O":h,"Ctrl-O":h,"Cmd-D":r,"Ctrl-D":r,Esc:y})}function y(){d=null,p=-1,m=[],s&&s.setSelection(s.getCursor(),s.getCursor())}function k(){if(s){const t=i.includes("-dark")?qd:Gd;s.setOption("theme",t)}}return G(async()=>{await x(),r.on("cambiotema",k),await X(),w("init")}),K(()=>{r.off("cambiotema",k)}),t.$$set=t=>{"value"in t&&n(2,a=t.value),"yaml"in t&&n(3,u=t.yaml),"json"in t&&n(4,f=t.json)},t.$$.update=()=>{772&t.$$.dirty&&!c&&s&&s.getValue()!==a&&(s.setValue(a),w("init"))},[l,o,a,u,f,function(){s&&!c&&(n(9,c=!0),v(s),n(9,c=!1))},b,g,s,c,function(t){h[t?"unshift":"push"](()=>{l=t,n(0,l)})}]}class Qd extends t{constructor(t){super(),e(this,t,Jd,Wd,n,{value:2,yaml:3,json:4,formatta:5,getcmfold:6,setcmfold:7})}get formatta(){return this.$$.ctx[5]}get getcmfold(){return this.$$.ctx[6]}get setcmfold(){return this.$$.ctx[7]}}function th(t){let e;return{c(){e=d("div"),c(e,"class","w-full h-full")},m(n,i){u(n,e,i),t[10](e)},p:o,i:o,o:o,d(n){n&&l(e),t[10](null)}}}function eh(t,e,n){let i;const{post:r,bus:o,theme:l}=fr();let s,c;I(t,l,t=>n(16,i=t));let{value:a=""}=e,{noformat:u=!1}=e,{variante:f=!1}=e,d=null,p=-1,m=[];const w=W();let b=null,g=null;const v=t=>{b=t.clientX,g=t.clientY};function x(){if(!c)return{};const t=c.getCursor(),e=c.getScrollInfo();let n=[];return c.getAllMarks().forEach(t=>{if(t.C){let e=t.find();e&&n.push(e)}}),{cursor:t,scrollInfo:e,folds:n}}function y(t){let e,n,i;Array.isArray(t)?i=t:({cursor:e,scrollInfo:n,folds:i}=t),c&&(e&&c.setCursor(e),n&&c.scrollTo(n.left,n.top),i&&i.forEach(({from:t})=>{t.line<c.lineCount()&&c.foldCode(t)}))}const k=t=>f?u?t:function(t){let e=[],n=[];for(let i of t.split("\n")){let t=Fd(i);for(let e=0;e<t.length;e++){let i=t[e]||"";(i.includes(",")||i.includes(";"))&&(i=`"${i}"`,t[e]=i);let r=i.length;(!n[e]||n[e]<r)&&(n[e]=r)}e.push(Fd(i))}let i=[];for(let t of e){let e=[];for(let i=0;i<n.length;i++)e[i]=(t[i]||"").padEnd(n[i]);i.push(e.join(" , "))}return i.join("\n")}(t):Od(t);function $(t){const e=x(),n=t.getValue(),i=k(n);t.setValue(i),y(e)}function _(){d=null,p=-1,m=[],c&&c.setSelection(c.getCursor(),c.getCursor())}async function D(){window.CodeMirror||await Xd(document);const t=window.CodeMirror;t.N||(t.N=!0,function(t){t.defineMode("markuno",function(){return{startState:function(){return{inComment:!1}},token:function(t,e){return e.inComment?(t.skipTo("*/")?(t.next(),t.next(),e.inComment=!1):t.skipToEnd(),"comment"):t.match(/\/\/.*/)?"comment":t.sol()&&t.match(/^\s*\.[a-zA-Z0-9_]+(?=\s|$)/)?"def":e.expectMacroArg?t.eatSpace()?null:t.match(/^[^\s#,(){}]+/)?(e.expectMacroArg=!1,"builtin"):(t.next(),e.expectMacroArg=!1,null):t.sol()&&t.match(/^\s*#([mif])\b/i)?(e.expectMacroArg=!0,"def"):t.match("/*")?(t.skipTo("*/")?(t.next(),t.next()):e.inComment=!0,"comment"):t.match(/^\s*#(select|ret|cache|cvar|lookb|look|cases|endselect|log|msg|ifdef|ifndef|elseif|elseifndef|endif|elseifdef|variante|forvar|for|endfor|continue|break|inc|macro|default|lets|lett|cat|func|push|pop|letv|let|letm|lett|else)/i)||t.match(/^\s*#(if\s*|elseif\s*|j |case|def )/i)||t.match(/#(else|let|letv|lett|letm|cvar|cache|lookb|look)/i)?"keyword":!e.inCommand&&t.match(/^\s*#[\w_.]+/i)?"string":t.match(/^\s*![\w_.]+/i)?"builtin":t.match(/[<>!=+\-*/\\%]+/)?"operator":t.match(/\$\[[\w_.]+/)||t.match(/\$\{[\w_.]+/)||t.match(/\$\([\w_.]+/)||t.match(/\$[\w_.]+/)||t.match(/[}\])]/)?"string":t.match(/\{.+?\}/)?"variable-3":t.match(/[\d.:,;\\]+/)?"number":(t.next(),null)}}})}(t),t.registerHelper("fold","markuno",function(e,n){const i=n.line,r=e.getLine(i).trim();function o(t){return t.startsWith("#")||t.startsWith("!")?t.substring(1).split(/\s+/)[0].toUpperCase():null}const l=["IF","IFDEF","IFNDEF","FOR","FORVAR","DO","SELECT"],s={IF:"ENDIF",IFDEF:"ENDIF",IFNDEF:"ENDIF",FOR:"ENDFOR",FORVAR:"ENDFOR",DO:"LOOP",SELECT:"ENDSELECT"},c=o(r);if(!c||!l.includes(c))return null;if(r.indexOf("#",2)>-1)return null;let a=0;for(let n=i+1;n<e.lineCount();n++){const u=o(e.getLine(n).trim());if(u&&l.includes(u))a++;else if(u&&u===s[c]){if(0===a)return{from:t.Pos(i,r.length),to:t.Pos(n,e.getLine(n).length)};a--}}return null}),t.registerHelper("hint","markuno",async function(e){const n=e.getCursor(),i=e.getTokenAt(n);e.getLine(n.line);const r=i.start,o=i.end,l=i.string,s=await async function(t){return[{text:"#if",displayText:"#if",help:'Condizione "if" per verificare una condizione'},{text:"#select",displayText:"#select",help:"Seleziona un caso tra diverse opzioni"},{text:"#cases",displayText:"#cases",help:"Definisce i casi per #select"},{text:"#endif",displayText:"#endif",help:"Termina una struttura condizionale"},{text:"#for",displayText:"#for",help:'Inizia un ciclo "for"'},{text:"#endfor",displayText:"#endfor",help:'Termina un ciclo "for"'},{text:"#else",displayText:"#else",help:"Blocco alternativo per #if"},{text:"#continue",displayText:"#continue",help:"Salta all'iterazione successiva di un ciclo"},{text:"#break",displayText:"#break",help:"Interrompe un ciclo"}].filter(e=>e.text.startsWith(t))}(l);return{list:s.map(t=>({text:t.text,displayText:t.text,render(e,n,i){const r=document.createElement("div");r.innerHTML=`<strong>${i.text}</strong> - <em>${t.help}</em>`,e.appendChild(r)}})),from:t.Pos(n.line,r),to:t.Pos(n.line,o)}})),document.addEventListener("mousemove",v),n(2,a=k(a)),n(9,c=window.CodeMirror(s,{value:a,mode:"markuno",theme:i.includes("-dark")||i.includes("-sand")?qd:Gd,lineNumbers:!0,viewportMargin:1/0,lineWrapping:!1,foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],foldOptions:{widget:" β₯ πππ"}})),c.getWrapperElement().style.height="100%",c.on("paste",(t,e)=>{if(f){e.preventDefault();let n=(e.clipboardData||window.clipboardData).getData("text");n=n.replace(/\t/g,",");const i=t.getDoc(),r=i.getCursor();i.replaceRange(n,r)}});const e=e=>{e.showHint({hint:t.hint.markuno})};let r=(t,e)=>{if(!f){const n=t.getCursor(),i=t.getLine(n.line),r={line:n.line,ch:0},o=t.indexFromPos(r),l=o+i.length,s=n.ch;w("help",{row:i,key:e,p1:o,p2:l,p3:s,mouseX:b,mouseY:g})}};function o(t){w("reload")}function l(t){$(t),w("save")}function u(t){w("run")}function h(t){let e;if(t.getSelection())e=t.getSelection();else{const n=t.findWordAt(t.getCursor());e=t.getRange(n.anchor,n.head),t.setSelection(n.anchor,n.head)}e&&function(t){if(t){if(d)p=(p+1)%d.matches.length;else{d={query:new RegExp((e=t,e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),"g"),matches:[]},m=[];const n=c.getValue();let i;for(;null!==(i=d.query.exec(n));)d.matches.push({from:c.posFromIndex(i.index),to:c.posFromIndex(i.index+i[0].length)});p=0}var e;if(d.matches.length>0){const t=d.matches[p];m.push({anchor:t.from,head:t.to}),c.setSelections(m),c.scrollIntoView(t.from)}}}(e)}c.setOption("extraKeys",{"Cmd-S":l,"Ctrl-S":l,"Ctrl-F":function(t){const e=t.getCursor(),n=t.getScrollInfo();let i=[];t.getAllMarks().forEach(t=>{if(t.C){let e=t.find();e&&i.push(e)}});let r=t.getValue();r=k(r),t.setValue(r),t.setCursor(e),t.scrollTo(n.left,n.top),i.forEach(({from:e})=>{e.line<t.lineCount()&&t.foldCode(e)})},"Cmd-O":o,"Ctrl-O":o,"Cmd-D":h,"Ctrl-D":h,"Ctrl-R":u,"Cmd-R":u,"Ctrl-H":t=>r(t,"h"),"Ctrl-M":t=>r(t,"m"),"Cmd-Enter":e,"Ctrl-Enter":e,Esc:_}),c.on("change",()=>{n(2,a=c.getValue()),w("input",a)})}function S(){if(c){const t=i.includes("-dark")?qd:Gd;c.setOption("theme",t)}}return G(async()=>{await D(),o.on("cambiotema",S),await X(),w("init")}),K(()=>{o.off("cambiotema",S),document.removeEventListener("mousemove",v)}),t.$$set=t=>{"value"in t&&n(2,a=t.value),"noformat"in t&&n(3,u=t.noformat),"variante"in t&&n(4,f=t.variante)},t.$$.update=()=>{if(516&t.$$.dirty&&c){const t=c.getValue();a!==t&&(c.setValue(a),w("init"))}},[s,l,a,u,f,function(){c&&setTimeout(()=>c.focus(),50)},function(){c&&$(c)},x,y,c,function(t){h[t?"unshift":"push"](()=>{s=t,n(0,s)})}]}class nh extends t{constructor(t){super(),e(this,t,eh,th,n,{value:2,noformat:3,variante:4,focus:5,formatta:6,getcmfold:7,setcmfold:8})}get focus(){return this.$$.ctx[5]}get formatta(){return this.$$.ctx[6]}get getcmfold(){return this.$$.ctx[7]}get setcmfold(){return this.$$.ctx[8]}}function ih(t){let e,n,i,r,o,a,h,p,b,g,v,x,y,$,D,S,C,O=t[1]&&rh(t),I=t[3]&&oh(t),R=t[7]&&sh(t),L=function(t){let e,n,i;return n=new Qr({props:{class:t[0].buttonClasses+" hover:!bg-muted/20",icon:"close",variant:"ghost"}}),n.$on("click",t[10]),{c(){e=d("div"),F(n.$$.fragment),c(e,"class","h-full flex items-center")},m(t,r){u(t,e,r),N(n,e,null),i=!0},p(t,e){const i={};1&e&&(i.class=t[0].buttonClasses+" hover:!bg-muted/20"),n.$set(i)},i(t){i||(w(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&l(e),T(n)}}}(t),B=t[5]&&ah(t);return{c(){e=d("div"),n=d("div"),i=d("div"),r=d("div"),O&&O.c(),o=_(),a=d("div"),h=_(),I&&I.c(),p=_(),b=d("div"),g=d("div"),R&&R.c(),v=_(),L&&L.c(),x=_(),B&&B.c(),c(a,"class",t[9].content.message),c(r,"class",t[9].content.textContainer),c(g,"class",t[9].content.buttonContainer),c(b,"class","flex flex-row items-center"),c(i,"class",t[9].content.row),c(n,"class",t[8]),c(e,"class",t[9].wrapper)},m(l,s){u(l,e,s),k(e,n),k(n,i),k(i,r),O&&O.m(r,null),k(r,o),k(r,a),a.innerHTML=t[2],k(r,h),I&&I.m(r,null),k(i,p),k(i,b),k(b,g),R&&R.m(g,null),k(b,v),L&&L.m(b,null),k(n,x),B&&B.m(n,null),D=!0,S||(C=[f(e,"mouseenter",t[14]),f(e,"mouseleave",t[15])],S=!0)},p(t,e){t[1]?O?(O.p(t,e),2&e&&w(O,1)):(O=rh(t),O.c(),w(O,1),O.m(r,o)):O&&(z(),m(O,1,1,()=>{O=null}),M()),(!D||4&e)&&(a.innerHTML=t[2]),t[3]?I?(I.p(t,e),8&e&&w(I,1)):(I=oh(t),I.c(),w(I,1),I.m(r,null)):I&&(z(),m(I,1,1,()=>{I=null}),M()),t[7]?R?(R.p(t,e),128&e&&w(R,1)):(R=sh(t),R.c(),w(R,1),R.m(g,null)):R&&(z(),m(R,1,1,()=>{R=null}),M()),L.p(t,e),t[5]?B?B.p(t,e):(B=ah(t),B.c(),B.m(n,null)):B&&(B.d(1),B=null),(!D||256&e)&&c(n,"class",t[8])},i(t){D||(w(O),w(I),w(R),w(L),t&&j(()=>{D&&($&&$.end(1),y=A(e,nt,{y:50,duration:100,easing:Qa}),y.start())}),D=!0)},o(t){m(O),m(I),m(R),m(L),y&&y.invalidate(),t&&($=E(e,nt,{y:50,duration:300})),D=!1},d(t){t&&l(e),O&&O.d(),I&&I.d(),R&&R.d(),L&&L.d(),B&&B.d(),t&&$&&$.end(),S=!1,s(C)}}}function rh(t){let e,n,i;return n=new Ar({props:{id:t[1]}}),{c(){e=d("div"),F(n.$$.fragment),c(e,"class",t[9].content.title)},m(t,r){u(t,e,r),N(n,e,null),i=!0},p(t,e){const i={};2&e&&(i.id=t[1]),n.$set(i)},i(t){i||(w(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&l(e),T(n)}}}function oh(t){let e,n,i;return n=new Qr({props:{variant:"outline",size:"xs",class:"!py-0 !px-0 !pl-0 !pr-0 !font-regular "+t[0].buttonClasses,$$slots:{default:[lh]},$$scope:{ctx:t}}}),n.$on("click",t[13]),{c(){e=d("div"),F(n.$$.fragment),c(e,"class","flex items-center gap-0 mt-2")},m(t,r){u(t,e,r),N(n,e,null),i=!0},p(t,e){const i={};1&e&&(i.class="!py-0 !px-0 !pl-0 !pr-0 !font-regular "+t[0].buttonClasses),134217760&e&&(i.$$scope={dirty:e,ctx:t}),n.$set(i)},i(t){i||(w(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&l(e),T(n)}}}function lh(t){let e,n=t[5]?"Nascondi dettagli":"Mostra dettagli";return{c(){e=$(n)},m(t,n){u(t,e,n)},p(t,i){32&i&&n!==(n=t[5]?"Nascondi dettagli":"Mostra dettagli")&&b(e,n)},d(t){t&&l(e)}}}function sh(t){let e,n;return e=new Qr({props:{variant:"outline",size:"sm",tooltip:"Manda una segnalazione",class:t[0].buttonClasses+" ml-1 mr-1 !text-danger-foreground hover:!bg-muted/20",$$slots:{default:[ch]},$$scope:{ctx:t}}}),e.$on("click",t[11]),{c(){F(e.$$.fragment)},m(t,i){N(e,t,i),n=!0},p(t,n){const i={};1&n&&(i.class=t[0].buttonClasses+" ml-1 mr-1 !text-danger-foreground hover:!bg-muted/20"),134217728&n&&(i.$$scope={dirty:n,ctx:t}),e.$set(i)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){T(e,t)}}}function ch(t){let e;return{c(){e=$("Segnala")},m(t,n){u(t,e,n)},d(t){t&&l(e)}}}function ah(t){let e,n,i,r,o;return{c(){e=d("div"),n=$("Details:"),i=_(),r=d("div"),o=$(t[3]),c(e,"class",t[9].details.header),c(r,"class",t[9].details.content)},m(t,l){u(t,e,l),k(e,n),u(t,i,l),u(t,r,l),k(r,o)},p(t,e){8&e&&b(o,t[3])},d(t){t&&(l(e),l(i),l(r))}}}function uh(t){let e,n,i=t[4]&&ih(t);return{c(){i&&i.c(),e=S()},m(t,r){i&&i.m(t,r),u(t,e,r),n=!0},p(t,[n]){t[4]?i?(i.p(t,n),16&n&&w(i,1)):(i=ih(t),i.c(),w(i,1),i.m(e.parentNode,e)):i&&(z(),m(i,1,1,()=>{i=null}),M())},i(t){n||(w(i),n=!0)},o(t){m(i),n=!1},d(t){t&&l(e),i&&i.d(t)}}}function fh(t,e,n){let i,r,o;const{bus:l}=fr();let s="",c="",a="",u=!1,f=0,d=!1,h=0,p=!1;const m=0,w=1,b=2,g={[m]:{icon:"check_circle",timeout:3e3,classes:"bg-success text-success-foreground",buttonClasses:"text-success-foreground font-medium border-success-foreground/50"},[w]:{icon:"warning",timeout:4e3,classes:" bg-warning text-warning-foreground",buttonClasses:"text-warning-foreground font-medium border-warning-foreground/50"},[b]:{icon:"error",timeout:null,classes:"bg-danger text-danger-foreground",buttonClasses:"!text-danger-foreground font-medium border-danger-foreground/50"}},v={wrapper:"w-full max-w-md md:min-w-[350px] fixed bottom-0 right-0 z-50 noprint p-4",container:"p-4 max-w-screen pr-2 w-full text-left rounded-md z-50 relative ",content:{row:"flex flex-row space-x-2 items-center",textContainer:"flex-1 overflow-hidden flex flex-col",title:" text-sm font-medium",message:"text-sm font-light",buttonContainer:"flex flex-col space-y-2"},details:{header:"text-xs pt-4 mb-2 w-full border-b border-border font-ligth",content:"text-muted-foreground font-mono text-xs p-2 rounded-md bg-white font-ligth"}};function x(t){$(t,m)}function y(t){$(t,w)}function k(t){$(t,b)}function $(t,e){n(4,u=!1),function(){h&&(clearTimeout(h),h=0);n(1,s=""),n(3,a=""),n(5,d=!1)}(),n(12,f=e),function(t){"string"==typeof t?n(2,c=t):t?(n(2,c=t?.value||t?.des||t?.text||t?.msg),n(1,s=t?.title||""),n(3,a=t?.extra||"")):n(2,c="undefined message")}(t),n(4,u=!0),function(){const t=i.timeout;t&&(h=setTimeout(()=>{n(4,u=!1)},t))}()}function _(){n(4,u=!1)}G(()=>{l.on("message",x),l.on("messaggio",x),l.on("warning",y),l.on("error",k)}),K(()=>{l.off("message",x),l.off("messaggio",x),l.off("warning",y),l.off("error",k),h&&clearTimeout(h)});return t.$$.update=()=>{4096&t.$$.dirty&&n(0,i=g[f]||g[m]),1&t.$$.dirty&&n(8,r=`${i.classes} ${v.container}`),4096&t.$$.dirty&&n(7,o=f===b)},[i,s,c,a,u,d,p,o,r,v,_,function(){l.emit("showhelp",{v:!0}),_()},f,()=>n(5,d=!d),()=>n(6,p=!0),()=>n(6,p=!1)]}class dh extends t{constructor(t){super(),e(this,t,fh,uh,n,{})}}function hh(t){let e,n,i,r,s,a;return{c(){e=d("div"),n=q("svg"),i=q("rect"),r=q("rect"),s=q("rect"),c(i,"x","70.7104"),c(i,"y","141.421"),c(i,"width","100"),c(i,"height","300"),c(i,"transform","rotate(-45 70.7104 141.421)"),c(i,"fill","currentColor"),c(r,"x","141.421"),c(r,"y","353.553"),c(r,"width","100"),c(r,"height","300"),c(r,"transform","rotate(-135 141.421 353.553)"),c(r,"fill","currentColor"),c(s,"x","316.474"),c(s,"y","249.213"),c(s,"width","52.4405"),c(s,"height","50"),c(s,"transform","rotate(-45 316.474 249.213)"),c(s,"fill","currentColor"),c(n,"xmlns","http://www.w3.org/2000/svg"),c(n,"viewBox","40 40 360 360"),c(n,"width","100%"),c(n,"height","100%"),c(e,"class",a="text-foreground "+t[1].class),c(e,"style",t[0])},m(t,o){u(t,e,o),k(e,n),k(n,i),k(n,r),k(n,s)},p(t,[n]){2&n&&a!==(a="text-foreground "+t[1].class)&&c(e,"class",a),1&n&&c(e,"style",t[0])},i:o,o:o,d(t){t&&l(e)}}}function ph(t,e,n){let o,{size:l=8}=e;return t.$$set=t=>{n(1,e=i(i({},e),r(t))),"size"in t&&n(2,l=t.size)},t.$$.update=()=>{4&t.$$.dirty&&n(0,o=`width: ${l/4}rem; height: ${l/4}rem;`)},e=r(e),[o,e,l]}class mh extends t{constructor(t){super(),e(this,t,ph,hh,n,{size:2})}}const wh=t=>({}),bh=t=>({});function gh(t,e,n){const i=t.slice();return i[105]=e[n],i}function vh(t){let e,n;return e=new Dr({props:{gray:!0,img:"restore",tooltip:"Ripristina stato iniziale",size:8}}),e.$on("click",t[31]),{c(){F(e.$$.fragment)},m(t,i){N(e,t,i),n=!0},p:o,i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){T(e,t)}}}function xh(t){let e,n;return e=new Dr({props:{readonly:!t[7],gray:!0,img:"delete",tooltip:"Cancella",mat:!0,size:8}}),e.$on("click",t[32]),{c(){F(e.$$.fragment)},m(t,i){N(e,t,i),n=!0},p(t,n){const i={};128&n[0]&&(i.readonly=!t[7]),e.$set(i)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){T(e,t)}}}function yh(t){let e,n;return e=new Dr({props:{gray:!0,img:"add",tooltip:"Add New",mat:!0,size:8}}),e.$on("click",t[33]),{c(){F(e.$$.fragment)},m(t,i){N(e,t,i),n=!0},p:o,i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){T(e,t)}}}function kh(t){let e,n;return e=new Qr({props:{xs:!0,full:!0,value:t[105],alt:t[105]!=t[6]}}),e.$on("click",function(){return t[36](t[105])}),{c(){F(e.$$.fragment)},m(t,i){N(e,t,i),n=!0},p(n,i){t=n;const r={};512&i[0]&&(r.value=t[105]),576&i[0]&&(r.alt=t[105]!=t[6]),e.$set(r)},i(t){n||(w(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){T(e,t)}}}function $h(t){let e,n,i,r,o;function s(e){t[41](e)}let c={sm:!0,type:"select",options:t[14].listx,tooltip:"Dimensione Elemento X"};return void 0!==t[14].w&&(c.value=t[14].w),i=new Il({props:c}),h.push(()=>Z(i,"value",s)),{c(){e=d("div"),e.textContent="Dim X",n=_(),F(i.$$.fragment)},m(t,r){u(t,e,r),u(t,n,r),N(i,t,r),o=!0},p(t,e){const n={};16384&e[0]&&(n.options=t[14].listx),!r&&16384&e[0]&&(r=!0,n.value=t[14].w,Y(()=>r=!1)),i.$set(n)},i(t){o||(w(i.$$.fragment,t),o=!0)},o(t){m(i.$$.fragment,t),o=!1},d(t){t&&(l(e),l(n)),T(i,t)}}}function _h(t){let e,n,i,r,o;function s(e){t[42](e)}let c={sm:!0,type:"select",options:t[14].listy,tooltip:"Dimensione Elemento Y"};return void 0!==t[14].h&&(c.value=t[14].h),i=new Il({props:c}),h.push(()=>Z(i,"value",s)),{c(){e=d("div"),e.textContent="Dim Y",n=_(),F(i.$$.fragment)},m(t,r){u(t,e,r),u(t,n,r),N(i,t,r),o=!0},p(t,e){const n={};16384&e[0]&&(n.options=t[14].listy),!r&&16384&e[0]&&(r=!0,n.value=t[14].h,Y(()=>r=!1)),i.$set(n)},i(t){o||(w(i.$$.fragment,t),o=!0)},o(t){m(i.$$.fragment,t),o=!1},d(t){t&&(l(e),l(n)),T(i,t)}}}function Dh(t){let e,n,i,r,o,s,a,f,p,b,g,v,x,y,$,D,S,E,j,A,C,O;function I(e){t[38](e)}let R={sm:!0,type:"number",tooltip:"Posizione X"};function L(e){t[39](e)}void 0!==t[14].x&&(R.value=t[14].x),r=new Il({props:R}),t[37](r),h.push(()=>Z(r,"value",I));let B={sm:!0,type:"number",tooltip:"Posizione Y"};function H(e){t[40](e)}void 0!==t[14].y&&(B.value=t[14].y),p=new Il({props:B}),h.push(()=>Z(p,"value",L));let P={sm:!0,type:"number",tooltip:"Rotazione Gradi"};void 0!==t[14].rot&&(P.value=t[14].rot),y=new Il({props:P}),h.push(()=>Z(y,"value",H));let U=t[14].listx&&$h(t),V=t[14].listy&&_h(t);return C=new Qr({props:{value:"Ok",full:!0,sm:!0}}),C.$on("click",t[43]),{c(){e=d("div"),n=d("div"),n.textContent="X",i=_(),F(r.$$.fragment),s=_(),a=d("div"),a.textContent="Y",f=_(),F(p.$$.fragment),g=_(),v=d("div"),v.textContent="Angolo",x=_(),F(y.$$.fragment),D=_(),U&&U.c(),S=_(),V&&V.c(),E=_(),j=d("div"),A=_(),F(C.$$.fragment),c(e,"class","bg-white border rounded-sm p-2 border-c-200 w-64 shadow-lg grid grid-cols-[auto_1fr] items-center gap-1")},m(t,o){u(t,e,o),k(e,n),k(e,i),N(r,e,null),k(e,s),k(e,a),k(e,f),N(p,e,null),k(e,g),k(e,v),k(e,x),N(y,e,null),k(e,D),U&&U.m(e,null),k(e,S),V&&V.m(e,null),k(e,E),k(e,j),k(e,A),N(C,e,null),O=!0},p(t,n){const i={};!o&&16384&n[0]&&(o=!0,i.value=t[14].x,Y(()=>o=!1)),r.$set(i);const l={};!b&&16384&n[0]&&(b=!0,l.value=t[14].y,Y(()=>b=!1)),p.$set(l);const s={};!$&&16384&n[0]&&($=!0,s.value=t[14].rot,Y(()=>$=!1)),y.$set(s),t[14].listx?U?(U.p(t,n),16384&n[0]&&w(U,1)):(U=$h(t),U.c(),w(U,1),U.m(e,S)):U&&(z(),m(U,1,1,()=>{U=null}),M()),t[14].listy?V?(V.p(t,n),16384&n[0]&&w(V,1)):(V=_h(t),V.c(),w(V,1),V.m(e,E)):V&&(z(),m(V,1,1,()=>{V=null}),M())},i(t){O||(w(r.$$.fragment,t),w(p.$$.fragment,t),w(y.$$.fragment,t),w(U),w(V),w(C.$$.fragment,t),O=!0)},o(t){m(r.$$.fragment,t),m(p.$$.fragment,t),m(y.$$.fragment,t),m(U),m(V),m(C.$$.fragment,t),O=!1},d(n){n&&l(e),t[37](null),T(r),T(p),T(y),U&&U.d(),V&&V.d(),T(C)}}}function Sh(t){let e,n,i,r,o,s,a,f,y,D,S,E,j,A,C,O,I,R,L,P,U,V,q,G,X,W=(t[7]||"")+"",K=t[1]&&vh(t),J=t[0]&&xh(t),Q=t[2]&&yh(t);D=new Dr({props:{size:8,gray:!0,tooltip:"Zoom All",img:"zoom_out_map"}}),D.$on("click",t[34]),E=new Dr({props:{img:"save",tooltip:"Salva Tutto",size:8}}),E.$on("click",t[35]);let tt=B(t[9]),et=[];for(let e=0;e<tt.length;e+=1)et[e]=kh(gh(t,tt,e));const nt=t=>m(et[t],1,1,()=>{et[t]=null}),it=t[29].menu,rt=p(it,t,t[46],bh),ot=t[29].default,lt=p(ot,t,t[46],null);function st(e){t[44](e)}let ct={mouseX:t[10],mouseY:t[11],$$slots:{default:[Dh]},$$scope:{ctx:t}};return void 0!==t[12]&&(ct.show=t[12]),q=new So({props:ct}),h.push(()=>Z(q,"show",st)),q.$on("close",t[45]),{c(){e=d("div"),n=d("div"),i=_(),r=d("div"),K&&K.c(),o=_(),J&&J.c(),s=_(),Q&&Q.c(),a=_(),f=d("div"),y=_(),F(D.$$.fragment),S=_(),F(E.$$.fragment),j=_(),A=d("div"),C=d("div"),C.textContent="Layers:",O=_();for(let t=0;t<et.length;t+=1)et[t].c();I=_(),rt&&rt.c(),R=_(),lt&<.c(),L=_(),P=d("div"),U=$(W),V=_(),F(q.$$.fragment),c(n,"class","w-full h-full bg-gray-100"),c(f,"class","w-6"),c(r,"class","absolute top-1 right-1 flex flex-row space-x-1"),c(C,"class","bold mt-2"),c(A,"class","absolute top-12 right-1 flex flex-col space-y-1 max-w-24"),c(e,"class","w-full h-full relative relative"),c(P,"class","absolute bottom-1 left-[50%] translate-x-[-50%] text-c-200 text-xs")},m(l,c){u(l,e,c),k(e,n),t[30](n),k(e,i),k(e,r),K&&K.m(r,null),k(r,o),J&&J.m(r,null),k(r,s),Q&&Q.m(r,null),k(r,a),k(r,f),k(r,y),N(D,r,null),k(r,S),N(E,r,null),k(e,j),k(e,A),k(A,C),k(A,O);for(let t=0;t<et.length;t+=1)et[t]&&et[t].m(A,null);k(A,I),rt&&rt.m(A,null),k(e,R),lt&<.m(e,null),u(l,L,c),u(l,P,c),k(P,U),u(l,V,c),N(q,l,c),X=!0},p(t,e){if(t[1]?K?(K.p(t,e),2&e[0]&&w(K,1)):(K=vh(t),K.c(),w(K,1),K.m(r,o)):K&&(z(),m(K,1,1,()=>{K=null}),M()),t[0]?J?(J.p(t,e),1&e[0]&&w(J,1)):(J=xh(t),J.c(),w(J,1),J.m(r,s)):J&&(z(),m(J,1,1,()=>{J=null}),M()),t[2]?Q?(Q.p(t,e),4&e[0]&&w(Q,1)):(Q=yh(t),Q.c(),w(Q,1),Q.m(r,a)):Q&&(z(),m(Q,1,1,()=>{Q=null}),M()),3408464&e[0]){let n;for(tt=B(t[9]),n=0;n<tt.length;n+=1){const i=gh(t,tt,n);et[n]?(et[n].p(i,e),w(et[n],1)):(et[n]=kh(i),et[n].c(),w(et[n],1),et[n].m(A,I))}for(z(),n=tt.length;n<et.length;n+=1)nt(n);M()}rt&&rt.p&&(!X||32768&e[1])&&g(rt,it,t,t[46],X?x(it,t[46],e,wh):v(t[46]),bh),lt&<.p&&(!X||32768&e[1])&&g(lt,ot,t,t[46],X?x(ot,t[46],e,null):v(t[46]),null),(!X||128&e[0])&&W!==(W=(t[7]||"")+"")&&b(U,W);const n={};1024&e[0]&&(n.mouseX=t[10]),2048&e[0]&&(n.mouseY=t[11]),28960&e[0]|32768&e[1]&&(n.$$scope={dirty:e,ctx:t}),!G&&4096&e[0]&&(G=!0,n.show=t[12],Y(()=>G=!1)),q.$set(n)},i(t){if(!X){w(K),w(J),w(Q),w(D.$$.fragment,t),w(E.$$.fragment,t);for(let t=0;t<tt.length;t+=1)w(et[t]);w(rt,t),w(lt,t),w(q.$$.fragment,t),X=!0}},o(t){m(K),m(J),m(Q),m(D.$$.fragment,t),m(E.$$.fragment,t),et=et.filter(Boolean);for(let t=0;t<et.length;t+=1)m(et[t]);m(rt,t),m(lt,t),m(q.$$.fragment,t),X=!1},d(n){n&&(l(e),l(L),l(P),l(V)),t[30](null),K&&K.d(),J&&J.d(),Q&&Q.d(),T(D),T(E),H(et,n),rt&&rt.d(n),lt&<.d(n),T(q,n)}}}function zh(t,e,n){let{$$slots:i={},$$scope:r}=e;const{THREE:o,OrbitControls:l,Line2:s,LineGeometry:c,LineMaterial:a}=fr();let u,f,d,p,m,w,b,g=new o.Raycaster,v=new o.Vector2;const x=W(),{addline:y,createBox:k,dopickbox:$,collegapicker:_,clearchildren:D,picker:S,pickerel:z,hitter:M,linesglobal:E,setZ:j,redrawgroup:A,faceMatE:C,getlayers:T,hitMatE:N,getfacelinegeom:O,pickerresetcolor:F,getptrif:I,getallptrif:R,drawLinerif:L,getalllinerif:B,rotatenode:H,lineMat:P,lineMatH:U,linerifMat:V,linerifMatE:Z}=function(t={}){const{THREE:e,Line2:n,LineGeometry:i,LineMaterial:r}=t;let o=1,l=[];const s=new r({color:6728447,linewidth:.7,dashed:!0,dashSize:20,gapSize:20,depthTest:!1,transparent:!0,opacity:.6}),c=new r({color:16711680,linewidth:1.5,dashed:!0,dashSize:20,gapSize:20,depthTest:!1,transparent:!0,opacity:.8}),a=new r({color:6710886,linewidth:1,worldUnits:!1,transparent:!0}),u=new r({color:10066329,linewidth:.5,worldUnits:!1,transparent:!0}),f=new r({color:16711680,linewidth:2,worldUnits:!1,transparent:!0}),d=new e.MeshBasicMaterial({transparent:!0,opacity:0,depthTest:!1,depthWrite:!1}),h=new e.MeshBasicMaterial({transparent:!0,opacity:0,depthTest:!1,depthWrite:!1}),p=new r({color:2718207,linewidth:3,worldUnits:!1,transparent:!0,depthTest:!1,depthWrite:!1}),m=new e.MeshBasicMaterial({color:2718207,side:e.DoubleSide,transparent:!0,opacity:1,depthTest:!1,depthWrite:!1}),w=new e.MeshBasicMaterial({color:16711680,side:e.DoubleSide,transparent:!0,opacity:1,depthTest:!1,depthWrite:!1});function b(){for(let t in S){const e=S[t];e.name?.startsWith("pick_")&&(e.material="pick_face"===e.name?d:m)}}function g(t,n=!1){if(D.visible=!1,!t?.userData?.isBox)return void D.position.set(-1e4,-1e4,0);const{ori:i,dim:r,rot:l,listx:s,listy:c}=t.userData;D.position.set(i.x,i.y,o),D.rotation.z=e.MathUtils.degToRad(l);const a=r.x||500,u=r.y||500;if(n||D.userData.dim?.x!==r.x||D.userData.dim?.y!==r.y){const{faceGeo:t,borderGeo:e}=v(a,u);S.face.geometry.dispose(),S.border.geometry.dispose(),S.face.geometry=t,S.border.geometry=e}Array.isArray(s)&&s.length?(S.l.position.set(0,u/2,0),S.r.position.set(a,u/2,0),S.l.visible=S.r.visible=!0):S.l.visible=S.r.visible=!1,Array.isArray(c)&&c.length?(S.b.position.set(a/2,0,0),S.t.position.set(a/2,u,0),S.b.visible=S.t.visible=!0):S.b.visible=S.t.visible=!1;let f=t.userData?.pivot.x||0,d=t.userData?.pivot.y||0;S.rotline.position.set(f,d,0),S.rotcircle.position.set(f,d,0),S.rot.position.set(f-100,d-100,0),D.userData={node:t,ori:{...t.userData.ori},dim:{...t.userData.dim},listx:t.userData.listx?[...t.userData.listx]:void 0,listy:t.userData.listy?[...t.userData.listy]:void 0};for(let e in t.userData)["boxId","node","ori","dim","listx","listy"].includes(e)||(D.userData[e]=t.userData[e]);D.visible=!0}function v(t,n){const r=[0,0,0,t,0,0,t,n,0,0,n,0,0,0,0],o=new i;o.setPositions(r);const l=new e.PlaneGeometry(t,n);return l.translate(t/2,n/2,0),{borderGeo:o,faceGeo:l}}async function x(t={}){const{w:n,h:i,color:r}=t,o=new e.PlaneGeometry(n,i);o.translate(n/2,i/2,0);const l=new e.MeshBasicMaterial({color:r,side:e.DoubleSide,depthTest:!0});return new e.Mesh(o,l)}async function y(t,r,o,l,s,c,u){t.clear();let f=new e.Group;if(f.add(await x({w:o,h:l,color:s})),t.add(f),r){let t=r.toUpperCase();(c||u)&&(t=c&&u?`${t}\n${o}x${l}`:c?`${t}\nx=${o}`:`${t}\ny=${l}`),function(t,e="",n=0,i=0,r="label2d"){t.userData.labels||(t.userData.labels=[]);const o={text:e,dx:n,dy:i,visible:!0,className:r,el:null};t.userData.labels.push(o)}(f,t,o/2,l/2,"text-c-base text-xs")}const d=[0,0,0,o,0,0,o,l,0,0,l,0,0,0,0],h=new i;h.setPositions(d);const p=new n(h,a);p.computeLineDistances(),p.renderOrder=10,p.userData.isBorder=!0,t.add(p),t.add(new e.Group)}function k(t){const n=t.userData?.dim?.x,i=t.userData?.dim?.y;if(null==n||null==i)return[];const r=[];let o=!0;if(t.userData.snappts){o=!!t.userData.snapptsadd;for(let n of t.userData.snappts)r.push(new e.Vector3(n.x||0,n.y||0,0))}return o&&r.push(new e.Vector3(0,0,0),new e.Vector3(n,0,0),new e.Vector3(n,i,0),new e.Vector3(0,i,0)),t.updateWorldMatrix(!0,!1),r.map(e=>e.applyMatrix4(t.matrixWorld))}function $(t){const n=t.userData?.dim?.x,i=t.userData?.dim?.y;if(null==n||null==i)return[];const r=[new e.Vector3(0,0,0),new e.Vector3(n,0,0),new e.Vector3(n,i,0),new e.Vector3(0,i,0)];t.updateWorldMatrix(!0,!1);const o=r.map(e=>e.clone().applyMatrix4(t.matrixWorld));return[[o[0],o[1]],[o[1],o[2]],[o[2],o[3]],[o[3],o[0]]].map(([t,e])=>{const n=e.clone().sub(t);if(0===n.length())return null;n.normalize();const i=-n.y,r=n.x;let o=-(i*t.x+r*t.y);const l=Math.hypot(i,r);let s=i/l,c=r/l,a=o/l;return(s<0||0===s&&c<0)&&(s=-s,c=-c,a=-a),{a:s,b:c,c:a,dir:n,p:t.clone()}}).filter(Boolean)}function _(t,n=0,i=0,r=0,o=0){const s=r-n,c=o-i,a=Math.hypot(s,c);if(!a)return null;const u=new e.Vector3(s/a,c/a,0);let f=-u.y,d=u.x,h=-(f*n+d*i);const p=Math.hypot(f,d);let m=f/p,w=d/p,b=h/p;(m<0||0===m&&w<0)&&(m=-m,w=-w,b=-b);const g={id:t,a:m,b:w,c:b,dir:u,p:new e.Vector3(n,i,0),p2:new e.Vector3(r,o,0)};return l.push(g),g}const{picker:D,pick:S,hitter:z}=function(){const t={},r=new e.Group;r.name="picker",r.visible=!1;const o=500,l=500,{faceGeo:s,borderGeo:c}=v(o,l);t.face=new e.Mesh(s,d),t.face.name="pick_face",t.face.renderOrder=100,t.border=new n(c,p),t.border.computeLineDistances(),t.border.renderOrder=101;const a=new e.PlaneGeometry(50,50);t.l=new e.Mesh(a,m),t.l.position.set(0,250,0),t.l.name="pick_l",t.l.renderOrder=102,t.r=new e.Mesh(a,m),t.r.position.set(o,250,0),t.r.name="pick_r",t.r.renderOrder=102,t.b=new e.Mesh(a,m),t.b.position.set(250,0,0),t.b.name="pick_b",t.b.renderOrder=102,t.t=new e.Mesh(a,m),t.t.position.set(250,l,0),t.t.name="pick_t",t.t.renderOrder=102;const u=new i;u.setPositions([0,0,0,-100,-100,0]),t.rotline=new n(u,p),t.rotline.computeLineDistances(),t.rotline.renderOrder=103,t.rot=new e.Mesh(a,m),t.rot.position.set(-100,-100,0),t.rot.name="pick_rot",t.rot.renderOrder=104,t.rotg=new e.Group,t.rotg.name="pick_rotg",t.rotcircle=new e.Mesh(new e.CircleGeometry(20,16),w),t.rotcircle.renderOrder=104,r.add(t.border,t.face,t.l,t.r,t.t,t.b,t.rot,t.rotline,t.rotcircle);const f=new e.PlaneGeometry(50,50),h=new e.Mesh(f,w);return h.name="hitter",h.renderOrder=200,h.visible=!1,{picker:r,pick:t,hitter:h}}();return{setZ(t){o=t},get linesglobal(){return l},clearlines(){l=[]},addline:_,addlinev:function(t,e,n){return _(t,e,n,e,n+100)},addlineo:function(t,e,n){return _(t,e,n,e+100,n)},picker:D,clearchildren:function(t){for(;t.children.length>0;)t.remove(t.children[0])},pickerel:S,hitter:z,drawLinerif:function({p:t,dir:e},r=1e3,o=2e4){const l=t.clone().addScaledVector(e,-o),c=t.clone().addScaledVector(e,+o),a=new i;a.setPositions([l.x,l.y,0,c.x,c.y,0]);const u=new n(a,s);return u.computeLineDistances(),u.renderOrder=r,u},getfacelinegeom:v,pickerresetcolor:b,redrawgroup:y,linerifMat:s,collegapicker:g,linerifMatE:c,getlayers:function(t){let e=new Set;for(let n of t.children)n.userData.layer&&e.add(n.userData.layer);return[...e]},dopickbox:function(t,e){b();for(let n of t.children)if(n.userData.isBox&&n.userData.id===e)return void g(n);g(void 0)},createBox:async function({x:t,y:n,w:i,h:r,ox:l,oy:s,minx:c,maxx:a,stepx:u,listx:f,miny:d,maxy:h,stepy:p,listy:m,extra:w,rot:b=0,snappts:g,snapptsadd:v=!1,snaplines:x,snaplinesadd:k=!1,color:$=16777215,layer:_="base",id:D,name:S="no"}){function z(t,e,n,i){if(Array.isArray(i))return i.sort((t,e)=>t-e),i;if(n||(n=100),null!=t&&null!=e&&t<e){let i=[t];for(let r=t+n;r<e;r+=n)i.push(r);return i.push(e),i}}f=z(c,a,u,f),m=z(d,h,p,m);const M=new e.Group;return M.position.set(t,n,o),M.rotation.z=e.MathUtils.degToRad(b),M.userData={ori:{x:t,y:n},pivot:{x:l||0,y:s||0},dim:{x:i,y:r},listx:f,listy:m,rot:b,isBox:!0,layer:_,id:D,name:S,extra:w},g&&(M.userData.snappts=g,M.userData.snapptsadd=v),x&&(M.userData.snaplines=x,M.userData.snaplinesadd=k),await y(M,S,i,r,$,!!f,!!m),M},getface:x,lineMat:a,lineMatE:f,lineMatH:u,getptrif:k,rotatenode:function(t,n=void 0,i,r=!1){if(!t?.userData)return;const o=t.userData,l=o.rot||0,s=r?i:l+i;n||(n=o.pivot);const c=n?.x||0,a=n?.y||0,u=new e.Vector3(c,a,0).applyMatrix4(t.matrixWorld),f=t.position.clone(),d=e.MathUtils.degToRad(s-l);f.sub(u).applyAxisAngle(new e.Vector3(0,0,1),d).add(u),t.position.copy(f),t.rotation.z=e.MathUtils.degToRad(s),o.rot=s},getallptrif:function(t,e=.01){const n=[],i=new Set;if(t?.children?.length)for(const r of t.children)if(r.userData?.isBox)for(const t of k(r)){const r=`${Math.round(t.x/e)}|${Math.round(t.y/e)}`;i.has(r)||(i.add(r),n.push(t))}return n},getlinerif:$,getalllinerif:function(t,e=.01,n=.1){const i=[],r=new Set;function o(t){const o=`${Math.round(t.a/e)}|${Math.round(t.b/e)}|${Math.round(t.c/n)}`;r.has(o)||(r.add(o),i.push(t))}if(t?.children?.length)for(const e of t.children)if(e.userData?.isBox)for(const t of $(e))o(t);if(Array.isArray(l))for(const t of l)o(t);return i},lineMatE:f,hitMat:m,hitMatE:w,faceMat:d,faceMatE:h}}({THREE:o,Line2:s,LineGeometry:c,LineMaterial:a}),{dozoomall:Y,doresize:q}={dozoomall:function(t={}){const{maxw:e,maxh:n,container:i,camera:r,controls:o,invertY:l=!1}=t,s=e,c=n,a=i.clientWidth/i.clientHeight;let u=s/2,f=c/2;a>=s/c?u=f*a:f=u/a,r.left=-u,r.right=u,l?(r.top=-f,r.bottom=f):(r.top=f,r.bottom=-f),r.zoom=1,r.updateProjectionMatrix(),o.target.set(s/2,c/2,0),r.position.set(s/2,c/2,10),r.lookAt(o.target),o.update()},doresize:function(t={}){const{container:e,renderer:n,camera:i,maxw:r,maxh:o,scene:l,invertY:s=!1}=t;if(!e||!n||!i)return;const c=e.clientWidth,a=e.clientHeight;if(!c||!a)return;n.setSize(c,a);const u=c/a;let f=r/2,d=o/2;u>=r/o?f=d*u:d=f/u,i.left=-f,i.right=f,s?(i.top=-d,i.bottom=d):(i.top=d,i.bottom=-d),i.updateProjectionMatrix(),l.traverse(t=>{t.material&&t.material.isLineMaterial&&t.material.resolution.set(c,a)})}};let K,J,{maxw:Q=6e3}=e,{maxh:tt=4e3}=e,{invertY:et=!0}=e,nt="base",{candelete:it=!1}=e,{canrestore:rt=!1}=e,{canadd:ot=!1}=e;function lt(t=void 0){if(!t&&S&&S?.node&&S.visible){let{name:t,id:e}=S.node.userDatal;n(7,K=`${e} - ${t}`)}else n(7,K=t)}function st(t,e){$(t,e),S.visible?(J||window.addEventListener("keydown",Ct),J=!0):(n(7,K=void 0),J=!1,window.removeEventListener("keydown",Ct)),lt()}function ct(){let t={maxw:Q,maxh:tt,curlayer:nt,rows:[],construction:[]};for(let e of w.children)e.userData.isBox&&t.rows.push({...e.userData});for(let e of E)t.construction.push({x1:e.p.x,y1:e.p.y,x2:e.p2.x,y2:e.p2.y});return t}async function at(t){for(t.maxw&&n(25,Q=t.maxw),t.maxh&&n(26,tt=t.maxh),n(6,nt=t.curlayer),vt=0;w.children.length>0;)w.remove(w.children[0]);if(t?.rows?.length)for(let e of t.rows){let t={...e};t.x=e.ori.x,t.y=e.ori.y,t.w=e.dim.x,t.h=e.dim.y,t.ox=e.pivot.x,t.oy=e.pivot.y,delete t.ori,delete t.dim,delete t.pivot,t.id=++vt,w.add(await k(t))}E.length=0;for(let e of t.construction||[])y(1,e.x1,e.y1,e.x2,e.y2);n(9,xt=T(w)),xt.includes(nt)||n(6,nt=xt[0]),St(nt),ft()}async function ut(t={x:void 0,y:void 0,w:100,h:100,ox:0,oy:0,minx:void 0,maxx:void 0,stepx:void 0,listx:void 0,miny:void 0,maxy:void 0,stepy:void 0,listy:void 0,extra:void 0,rot:0,snappts:void 0,snapptsadd:!1,snaplines:void 0,snaplinesadd:!1,color:16777215,layer:"base",name:"no"}){if(t.id=++vt,void 0===t.x||void 0===t.y)if(S?.visible&&S?.userData?.node){const e=S.userData.dim?.x||0,n=new o.Vector3(1,0,0).applyQuaternion(S.quaternion),i=S.position.clone().add(n.multiplyScalar(e));t.x=i.x,t.y=i.y,t.rot=o.MathUtils.radToDeg(S.rotation.z)}else t.x=0,t.y=0,t.rot=0;w.add(await k(t)),n(9,xt=T(w)),xt.includes(nt)||n(6,nt=xt[0]),St(nt),st(w,t.id)}function ft(){return Y({maxw:Q,maxh:tt,container:u,camera:d,controls:m,invertY:et})}let dt,ht,pt,mt,wt,bt=!1,gt=null,vt=0,xt=[],yt={};function kt(t){t.preventDefault(),x("contextMenu",{x:t.clientX,y:t.clientY})}function $t(t){return t?.userData?.isBox&&t.userData.layer===nt}function _t(t){if(!bt){if(n(8,bt=!0),gt={mode:wt,startMouse:{x:t.clientX,y:t.clientY},startPickerPos:S.position.clone(),startBoxOri:S.userData?.ori?{...S.userData.ori}:null,startBoxDim:S.userData?.dim?{...S.userData.dim}:null,checkptrif:!0,ptrif:R(w),checklinerif:!0,linerif:B(w)},gt.checklinerif){b.clear();for(let t of gt.linerif){const e=L(t);b.add(e)}}m.enabled=!1,window.addEventListener("pointermove",At),window.addEventListener("pointerup",Et)}}function Dt(){bt&&(gt?.startPickerPos&&S.position.copy(gt.startPickerPos),jt())}function St(t){if(xt.includes(t)){n(6,nt=t);for(let t of w.children){let e=t.userData.layer==nt,n=t.children.find(t=>t.userData.isBorder);n&&(n.material=e?P:U)}x("changelayer",nt)}}function zt(){if(!S?.userData?.node)return;const t=S.userData.node,e=t.parent;e&&e.remove(t),st(w,-1),n(9,xt=T(w)),xt.includes(nt)||St(xt[0]),x("change")}function Mt(){if(!S?.userData?.node)return;const t=S.userData.node;t.position.copy(S.position);const e=o.MathUtils.radToDeg(S.rotation.z);if(t.rotation.z=S.rotation.z,t.userData.rot=e,t.userData.ori.x=t.position.x,t.userData.ori.y=t.position.y,S.userData?.dim){const e=S.userData.dim.x,n=S.userData.dim.y;e===t.userData.dim.x&&n===t.userData.dim.y||(t.userData.dim.x=e,t.userData.dim.y=n,A(t,t.userData.name,e,n,16777215,!!t.userData.listx,!!t.userData.listy))}lt(),x("change")}function Et(){bt&&(Mt(),jt())}function jt(){n(8,bt=!1),gt=null,D(b),M.visible=!1,window.removeEventListener("pointermove",At),window.removeEventListener("pointerup",Et),m.enabled=!0}function At(t){if(!bt||!gt)return;M.visible=!1;const e=u.getBoundingClientRect();n(10,dt=t.clientX),n(11,ht=t.clientY);const i=(t.clientX-e.left)/e.width*2-1,r=-(t.clientY-e.top)/e.height*2+1,l=(gt.startMouse.x-e.left)/e.width*2-1,s=-(gt.startMouse.y-e.top)/e.height*2+1,c=new o.Vector3(l,s,0).unproject(d),a=new o.Vector3(i,r,0).unproject(d);let f=a.x-c.x,h=a.y-c.y;if("move"===gt.mode){if(S.position.set(gt.startPickerPos.x+f,gt.startPickerPos.y+h,gt.startPickerPos.z),gt.checkptrif){const t=20,e=I(S);for(const i of e)for(const e of gt.ptrif){if(i.distanceTo(e)<t){const t=e.x-i.x,r=e.y-i.y;return n(5,S.position.x+=t,S),n(5,S.position.y+=r,S),M.position.set(e.x,e.y,0),void(M.visible=!0)}}}if(gt.checklinerif){const t=20,e=I(S);for(let t of b.children)t.material=V;for(const i of e)for(let e=0;e<gt.linerif.length;e++){let r=gt.linerif[e];const o=r.a*i.x+r.b*i.y+r.c;if(Math.abs(o)<t){const t=-o*r.a,i=-o*r.b;return n(5,S.position.x+=t,S),n(5,S.position.y+=i,S),void(b.children[e].material=Z)}}}return}const p=(t,e)=>{if(!Array.isArray(e)||!e.length)return t;let n=e[0],i=Math.abs(t-n);for(let r=1;r<e.length;r++){const o=Math.abs(t-e[r]);o<i&&(i=o,n=e[r])}return n},m=new o.Vector3(1,0,0).applyQuaternion(S.quaternion),w=new o.Vector3(0,1,0).applyQuaternion(S.quaternion),g=f*m.x+h*m.y,v=f*w.x+h*w.y,x=gt.startBoxDim?.x||0,y=gt.startBoxDim?.y||0;let k=x,$=y;"resize-r"===gt.mode&&(k=x+g),"resize-l"===gt.mode&&(k=x-g),"resize-t"===gt.mode&&($=y+v),"resize-b"===gt.mode&&($=y-v),k=Math.max(10,k),$=Math.max(10,$);if(k=p(k,S.userData?.listx),$=p($,S.userData?.listy),"resize-l"===gt.mode){const t=m.clone().multiplyScalar(x-k);S.position.copy(gt.startPickerPos.clone().add(t))}if("resize-b"===gt.mode){const t=w.clone().multiplyScalar(y-$);S.position.copy(gt.startPickerPos.clone().add(t))}n(5,S.userData.dim.x=k,S),n(5,S.userData.dim.y=$,S),gt.mode.startsWith("resize")&<(`x=${k} y=${$}`);const{faceGeo:_,borderGeo:D}=O(k,$);z.face.geometry.dispose(),z.border.geometry.dispose(),z.face.geometry=_,z.border.geometry=D,z.l.position.set(0,$/2,0),z.r.position.set(k,$/2,0),z.b.position.set(k/2,0,0),z.t.position.set(k/2,$,0)}async function Ct(t){if(!pt)if(" "!==t.key){if("Delete"===t.key||"Backspace"==t.key)return zt(),void jt();if("Escape"!==t.key){if("r"===t.key||"R"==t.key||"s"==t.key||"S"==t.key){if(t.repeat)return;return H(S,void 0,"r"==t.key?90:"R"==t.key?-90:"s"==t.key?15:-15,!1),void(bt?(gt.startPickerPos=S.position.clone(),gt.startMouse={x:dt,y:ht},gt.startBoxOri=S.userData?.ori?{...S.userData.ori}:null,gt.startBoxDim=S.userData?.dim?{...S.userData.dim}:null):(Mt(),jt()))}}else bt?Dt():$(w,-1)}else await async function(){if(!S.visible||!S?.userData?.node)return;const t=S.userData.node;n(14,yt={}),gt&&bt?(n(14,yt.startPos=gt.startPickerPos.clone(),yt),n(14,yt.startRot=gt.startBoxOri?gt.startBoxOri.rot||t.userData.rot||0:t.userData.rot||0,yt)):(n(14,yt.startPos=S.position.clone(),yt),n(14,yt.startRot=0,yt));const e=o.MathUtils.radToDeg(S.rotation.z)-yt.startRot,i=S.position.clone().sub(yt.startPos),r=new o.Vector3(i.x,i.y,0).applyAxisAngle(new o.Vector3(0,0,1),-o.MathUtils.degToRad(yt.startRot));n(14,yt.x=r.x,yt),n(14,yt.y=r.y,yt),n(14,yt.rot=e,yt),n(14,yt.w=t.userData.dim.x,yt),n(14,yt.h=t.userData.dim.y,yt),n(14,yt.listx=t.userData.listx,yt),n(14,yt.listy=t.userData.listy,yt),n(8,bt=!1),n(12,pt=!0),await X(),x("change")}()}let Tt=0;function Nt(t){const e=u.getBoundingClientRect();v.x=(t.clientX-e.left)/e.width*2-1,v.y=-(t.clientY-e.top)/e.height*2+1,g.setFromCamera(v,d),n(10,dt=t.clientX),n(11,ht=t.clientY),F();const i=g.intersectObjects(f.children,!0);wt="move";for(const e of i){const n=e.object;if(n.name?.startsWith("pick_")&&"pick_face"!==n.name)return"pick_r"===n.name?wt="resize-r":"pick_l"===n.name?wt="resize-l":"pick_t"===n.name?wt="resize-t":"pick_b"===n.name&&(wt="resize-b"),n.material=N,void _t(t)}for(const e of i){const n=e.object;if("pick_face"===n.name)return n.material=C,void _t(t)}let r=[];for(const t of i){let e=t.object;for(;e&&!e.userData?.isBox;)e=e.parent;if(e){if(!$t(e))continue;r.push(e)}}if(r.length){Tt=(Tt+1)%r.length;let t=r[Tt];return void st(w,t.userData.id)}st(w,-1)}function Ot(){return q({container:u,renderer:p,camera:d,maxw:Q,maxh:tt,scene:f,invertY:et})}G(async()=>{f=new o.Scene,j(et?-1:1),p=new o.WebGLRenderer({antialias:!0,alpha:!0}),p.setClearColor(0,0),p.setSize(u.clientWidth,u.clientHeight),u.appendChild(p.domElement),d=new o.OrthographicCamera(0,1,1,0,-100,100),m=new l(d,p.domElement),m.enableRotate=!1,m.enablePan=!0,m.enableZoom=!0;const t=new o.Mesh(new o.PlaneGeometry(Q,tt),new o.MeshBasicMaterial({color:15790320}));t.position.set(Q/2,tt/2,0),f.add(t),f.add(S),n(4,w=new o.Group),n(4,w.name="boxes",w),f.add(w),f.add(M),b=new o.Group,b.name="lines",f.add(b),p.domElement.addEventListener("pointerdown",Nt),p.domElement.addEventListener("contextmenu",kt);let e=new Set;const i=()=>{p.render(f,d);const t=p.domElement.getBoundingClientRect();let n=new Set;f.traverse(e=>{const i=e.userData?.labels;if(i)for(let r of i){if(!r.visible)continue;r.el||(r.el=document.createElement("div"),r.el.className=r.className,u.appendChild(r.el)),n.add(r.el);const i=new o.Vector3(r.dx||0,r.dy||0,0),l=e.localToWorld(i.clone()).project(d),s=(.5*l.x+.5)*t.width,c=(.5*-l.y+.5)*t.height;r.el.style.position="absolute",r.el.style.whiteSpace="pre-line",r.el.style.pointerEvents="none",r.el.style.left=`${s}px`,r.el.style.top=`${c}px`;const a=new o.Quaternion;e.getWorldQuaternion(a);const f=(new o.Euler).setFromQuaternion(a,"XYZ").z;r.el.style.transform=`translate(-50%, -50%) rotate(${f}rad)`,r.el.textContent=r.text}});for(let t of e)n.has(t)||t.remove();e=n,requestAnimationFrame(i)};i();const r=new ResizeObserver(Ot);return r.observe(u),x("init"),()=>{J&&window.removeEventListener("keydown",Ct),p?.dispose();for(let t of e)t.remove();r?.disconnect()}});return t.$$set=t=>{"maxw"in t&&n(25,Q=t.maxw),"maxh"in t&&n(26,tt=t.maxh),"invertY"in t&&n(27,et=t.invertY),"candelete"in t&&n(0,it=t.candelete),"canrestore"in t&&n(1,rt=t.canrestore),"canadd"in t&&n(2,ot=t.canadd),"$$scope"in t&&n(46,r=t.$$scope)},[it,rt,ot,u,w,S,nt,K,bt,xt,dt,ht,pt,mt,yt,o,x,_,st,ft,Dt,St,zt,Mt,jt,Q,tt,et,function(){return{setcurrentlayer:St,getambiente:ct,setambiente:at,addbox:ut,zoomall:ft}},i,function(t){h[t?"unshift":"push"](()=>{u=t,n(3,u)})},async()=>{st(w,-1),jt(),x("restore")},()=>{zt(),jt()},()=>{x("add")},()=>{ft()},()=>{x("save")},t=>{Dt(),st(w,-1),St(t)},function(t){h[t?"unshift":"push"](()=>{mt=t,n(13,mt)})},function(e){t.$$.not_equal(yt.x,e)&&(yt.x=e,n(14,yt))},function(e){t.$$.not_equal(yt.y,e)&&(yt.y=e,n(14,yt))},function(e){t.$$.not_equal(yt.rot,e)&&(yt.rot=e,n(14,yt))},function(e){t.$$.not_equal(yt.w,e)&&(yt.w=e,n(14,yt))},function(e){t.$$.not_equal(yt.h,e)&&(yt.h=e,n(14,yt))},t=>{const e=yt.x||0,i=yt.y||0,r=yt.rot||0,l=new o.Vector3(e,i,0).applyAxisAngle(new o.Vector3(0,0,1),o.MathUtils.degToRad(yt.startRot));S.position.copy(yt.startPos.clone().add(l)),n(5,S.rotation.z=o.MathUtils.degToRad(yt.startRot+r),S),yt.listx&&n(5,S.userData.dim.x=yt.w,S),yt.listy&&n(5,S.userData.dim.y=yt.h,S),n(8,bt=!0),Mt(),jt(),_(S.userData.node,!0),n(12,pt=!1)},function(t){pt=t,n(12,pt)},t=>{n(8,bt=!0),Dt(),n(12,pt=!1)},r]}class Mh extends t{constructor(t){super(),e(this,t,zh,Sh,n,{maxw:25,maxh:26,invertY:27,candelete:0,canrestore:1,canadd:2,getdati:28},null,[-1,-1,-1,-1])}get getdati(){return this.$$.ctx[28]}}function Eh(t,e,n=100){t&&e&&e.querySelectorAll&&setTimeout(()=>{var t=e.querySelectorAll("input,select,area");(t&&t[0]||(t=e.querySelectorAll("button"))&&t[0])&&t[0].focus()},n)}export{Cn as Area,On as Badge,Pr as Bfollow,Dr as Bicon,Lr as Bmenu,qr as Bpop,Qr as Btn,lo as BtnCerca,uo as BtnFile,Mh as Cad2d,mo as Check,ko as Contenitore,So as ContenitoreXY,Bo as Cropper,Mc as Dragbar,Dc as Dtable,Yd as Editmd,Bc as Group,ar as Icon,Gc as Img,ua as Imulti,Il as Input,Qo as Inputdata,Qd as JsEdit,Ua as Json,qa as Libloader,mh as LogoCroswil,Ja as Lorem,Bd as Md,Ju as Menu,lu as Messaggio,ns as Msg,hu as Pdf,Su as Range,nh as RuleEdit,wu as Scroller,xf as Sinput,yu as Stars,Ar as T,Sf as Tab,Ff as Tabs,dh as Toast,xr as Tooltip,Wf as TreeCheck,sd as User,fd as Wait,Eh as autofocus,dr as extendcommons,kn as formatDate,yn as getdim,Dn as listfromstring,xn as myuuid,En as strDate,$n as toDateStr,zn as toEuro,Sn as tonum};
|
|
1
|
+
import{SvelteComponent as t,init as e,safe_not_equal as n,assign as i,exclude_internal_props as o,noop as l,detach as r,run_all as s,attr as c,set_input_value as a,insert as u,listen as d,element as f,binding_callbacks as p,create_slot as h,transition_out as m,transition_in as g,set_data as w,update_slot_base as b,get_all_dirty_from_scope as x,get_slot_changes as v,toggle_class as y,append as $,text as k,space as D,set_style as _,empty as S,group_outros as z,check_outros as M,create_out_transition as j,add_render_callback as E,create_in_transition as C,HtmlTag as T,destroy_component as N,mount_component as O,stop_propagation as A,create_component as F,component_subscribe as I,prevent_default as R,create_bidirectional_transition as L,ensure_array_like as B,destroy_each as H,src_url_equal as P,globals as V,bubble as Y,bind as U,add_flush_callback as q,svg_element as G}from"svelte/internal";import"svelte/internal/disclose-version";import{onMount as W,tick as X,createEventDispatcher as K,onDestroy as Z,getContext as J,setContext as Q}from"svelte";import{fade as tt,scale as et,fly as nt}from"svelte/transition";import{goto as it}from"$app/navigation";import{elasticOut as ot,linear as lt}from"svelte/easing";import*as rt from"three";import{OrbitControls as st}from"three/addons/controls/OrbitControls.js";import{Line2 as ct}from"three/addons/lines/Line2.js";import{LineGeometry as at}from"three/addons/lines/LineGeometry.js";import{LineMaterial as ut}from"three/addons/lines/LineMaterial.js";if(Date.prototype.getWeek||(Date.prototype.getWeek=function(){let t=new Date(this.getFullYear(),0,1);return Math.ceil(((this-t)/864e5+t.getDay()-1)/7)},Date.prototype.getYWeek=function(){let t=new Date(this.getFullYear(),0,1);return 100*this.getFullYear()+Math.ceil(((this-t)/864e5+t.getDay()-1)/7)}),!Number.prototype.toDate){const t=t=>{let e,n,i,o,l,r,s,c,a;return e=t,n=Math.floor(e),i=Math.floor(1e6*(e-n)+.8),o=n%100,o<1&&(o=1),n=Math.floor(n/100),l=n%100,l<1&&(l=1),r=Math.floor(n/100),r<1900&&(r=1900),a=i%100,i=Math.floor(i/100),c=i%100,s=Math.floor(i/100),new Date(r,l-1,o,s,c,a)};Number.prototype.toDate=function(){return t(this.valueOf()+0)},Date.prototype.toInt||(Date.prototype.toInt=function(){const t=this;return t.getDate()+100*(t.getMonth()+1)+1e4*t.getFullYear()}),Date.prototype.toFloat||(Date.prototype.toFloat=function(){return Math.floor(1e4*this.getDate()+1e6*(this.getMonth()+1)+1e8*this.getFullYear()+100*this.getHours()+this.getMinutes()+.5)/1e4}),Number.prototype.addmesi=function(e){const n=t(this.valueOf()+0),i=n.getDate();return n.setMonth(n.getMonth()+e),i>20&&n.getDate()<10&&n.setDate(0),Math.floor(this)===this?n.toInt():n.toFloat()},Number.prototype.addgiorni=function(t=0,e=0,n=0){const i=new Date(this.toDate().valueOf()+6e4*t*24*60+6e4*e*60+n);return Math.floor(this)===this?i.toInt():i.toFloat()},Number.prototype.diffgiorni=function(e){const n=t(this.valueOf()+0),i=t(e);return Math.ceil((i-n)/864e5)},Number.prototype.diffore=function(e){const n=t(this.valueOf()+0),i=t(e);return Math.ceil((i-n)/36e5)},Number.prototype.diffminuti=function(e){const n=t(this.valueOf()+0),i=t(e);return Math.ceil((i-n)/6e4)},Number.prototype.finemese=function(){return new Date(new Date(new Date(this.toDate().setDate(1)).setDate(32)).setDate(0)).toInt()},Number.prototype.iniziomese=function(){return new Date(this.toDate().setDate(1)).toInt()},Number.prototype.fineanno=function(){return 1e4*Math.floor(this/1e4)+1231},Number.prototype.inizioanno=function(){return 1e4*Math.floor(this/1e4)+101},Number.prototype.clamp=function(t,e){return this<t?t:this>e?e:this},Number.prototype.dgiorno=function(){return Math.floor(this)%100},Number.prototype.dmese=function(){return Math.floor(this/100)%100},Number.prototype.danno=function(){return Math.floor(this/1e4)},Number.prototype.weekday=function(){return t(this).getDay()},Number.prototype.giornimese=function(){return this.finemese()%100},Number.prototype.week=function(){return t(this).getWeek()},Number.prototype.yweek=function(){return t(this).getYWeek()},Array.prototype.random=function(){return this[Math.floor(Math.random()*this.length)]},Array.prototype.shuffle=function(){let t=this,e=t.length;for(;e>0;){let n=Math.floor(Math.random()*e);e--;let i=t[e];t[e]=t[n],t[n]=i}return t},Number.random=function(t,e){if(void 0===t)return Math.random();if(void 0===e)return Math.random()*t;if(t>e){let n=t;t=e,e=n}return Math.random()*(e-t)+t},Number.prototype.int=Number.prototype.floor=function(){return isNaN(this)||!isFinite(this)?0:Math.floor(this)},Number.prototype.round=function(){return isNaN(this)||!isFinite(this)?0:Math.floor(this+.5)},Number.prototype.ceil=function(){return isNaN(this)||!isFinite(this)?0:Math.ceil(this)}}String.prototype.splitComma||(String.prototype.splitComma=function(){return(this||"").split(/[;,]+/)}),String.prototype.lines||(String.prototype.lines=function(){return(this||"").split(/[\r\n]+/)}),String.prototype.var||(String.prototype.var=function(t,e){if(e||(e=";"),t){t=t.toLowerCase();const n=this.split(e);for(let e=0;e<n.length;e++){const i=n[e].indexOf("=");if(i>0&&n[e].substr(0,i).toLowerCase()===t)return n[e].substr(i+1,9999)}}return""}),String.prototype.setvar||(String.prototype.setvar=function(t,e,n){if(n||(n=";"),t){t=t.toUpperCase();const i=this.split(n);for(let o=0;o<i.length;o++){const l=i[o].indexOf("=");if(l>0&&i[o].substr(0,l).toUpperCase()===t)return e?i[o]=t+"="+e:i.splice(o,1),i.join(n)}}return e?this+n+t+"="+e:this});let dt=1e3;function ft(){return dt++,dt}function pt(t,e,n,i,o,l,r,s,c){let a,u=[];function d(t,e,n){return t||(t=e),t=Math.round(10*(t||0))/10,e?"X"==(n=(n||"_").trim().toLowerCase())&&t!=e?t+"*":"M"==n?t+"M":t:t}return a=d(t,i,r),a&&u.push(a),a=d(e,o,s),a&&u.push(a),a=d(n,l,c),a&&u.push(a),(""+r+s+c).replace(/[_XM]/gi,""),u.join("x")}function ht(t){const e=new Date(t),n=e.getDate().toString().padStart(2,"0"),i=(e.getMonth()+1).toString().padStart(2,"0");return`${e.getFullYear()}-${i}-${n}`}function mt(t){if(!t)return"";"number"==typeof t&&(t=t.toDate());let e=t.getDate(),n=t.getMonth()+1,i=t.getFullYear(),o=t.getHours(),l=t.getMinutes();return e=e<10?"0"+e:e,n=n<10?"0"+n:n,o=o<10?"0"+o:o,l=l<10?"0"+l:l,`${e}/${n}/${i} ${o}:${l}`}const gt=new class{constructor(){this.buslist={}}on(t,e){return this.buslist[t]||(this.buslist[t]=[]),this.buslist[t].push(e),this.buslist[t].length-1}emit(t,...e){this.buslist[t]&&this.buslist[t].forEach(t=>t(...e))}off(t,e){this.buslist[t]&&("number"==typeof e?e>=0&&e<this.buslist[t].length&&this.buslist[t].splice(e,1):this.buslist[t]=this.buslist[t].filter(t=>t!==e))}$on(t,e){this.on(t,e)}$off(t,e){this.off(t,e)}$emit(t,...e){this.emit(t,...e)}};function wt(t){if(Array.isArray(t))return t;let e=[],n={};if(t){let i=t.split(/[\n;,]/);for(let t of i){let i,o,l=t.search(/[:=#]/);l<0?i=o=t.trim():(i=t.slice(0,l),o=t.slice(l+1)),i=i.toLowerCase(),i&&!n[i]&&(n[i]=1,e.push({cod:i,des:o}))}}return e}gt.messaggio=t=>gt.emit("messaggio",t),gt.warning=t=>gt.emit("warning",t),gt.errore=t=>gt.emit("error",t),gt.salvato=t=>gt.emit("messaggio","dati memorizzati!"),gt.wait=t=>gt.emit("wait",t);const bt=(t,e=-1)=>{if(!t)return 0;if("number"==typeof t)return t||0;let n=0;if("string"==typeof t){let e=(t=t.replaceAll(",",".")).match(/^-?[0-9.]+$/g);e&&e.length>0?n=Number(e[0]):/^\s*-?\s*[0-9]+(\.[0-9]+)?\s*$/gi.test(t)?n=parseFloat(t):/[\s\d()-+/*^.]+/gi.test(t)&&(n=0)}if(e>=0){const t=Math.pow(10,e);n=Math.round(n*t)/t}return n||0},xt=(t,e,n="")=>0==t?e||"":new Intl.NumberFormat("it-IT",{style:"currency",currency:"EUR"}).format(bt(t))+n;let vt={};const yt=(t,e)=>{Date.prototype.getWeek||(Date.prototype.getWeek=function(){let t=new Date(this.getFullYear(),0,1);return Math.ceil(((this-t)/864e5+t.getDay()+1)/7)});let n="it";if("object"!=typeof t){if(!(t=parseFloat(t||0)))return"";t=t.toDate()}if("week"==e)return"w"+t.getWeek();if(!vt[e])switch(e){case"giorni":{let e=t.toInt(),i=e.diffgiorni((new Date).toInt());return 0==i?"Oggi":-1==i?"Domani":1==i?"Ieri":Math.abs(i)<6?new Intl.DateTimeFormat(n,{weekday:"long"}).format(t).trim():yt(e,"ggmmm")}case"date":case"shortdate":vt[e]=new Intl.DateTimeFormat(n,{weekday:"short",day:"numeric",month:"short",year:"numeric"});break;case"ggmmaa":case"ggmmyy":vt[e]=new Intl.DateTimeFormat(n,{day:"2-digit",month:"2-digit",year:"2-digit"});break;case"datetime":vt[e]=new Intl.DateTimeFormat(n,{day:"2-digit",month:"2-digit",year:"numeric",hour12:!1,hour:"numeric",minute:"2-digit"});break;case"yyyy":case"anno":vt[e]=new Intl.DateTimeFormat(n,{year:"numeric"});break;case"ggmmaaaa":case"ggmmyyyy":vt[e]=new Intl.DateTimeFormat(n,{day:"2-digit",month:"2-digit",year:"numeric"});break;case"ggmm":vt[e]=new Intl.DateTimeFormat(n,{day:"2-digit",month:"2-digit"});break;case"giorno":case"gg":vt[e]=new Intl.DateTimeFormat(n,{day:"2-digit"});break;case"ggmmmaaaa":case"ggmmmyyyy":vt[e]=new Intl.DateTimeFormat(n,{day:"2-digit",month:"short",year:"numeric"});break;case"ggmmmaa":case"ggmmmyy":vt[e]=new Intl.DateTimeFormat(n,{day:"2-digit",month:"short",year:"2-digit"});break;case"ggmmm":vt[e]=new Intl.DateTimeFormat(n,{day:"2-digit",month:"short"});break;case"ggmmmm":vt[e]=new Intl.DateTimeFormat(n,{day:"2-digit",month:"long"});break;case"mmmyy":case"mmmaa":case"mmmyyyy":case"mmmaaaa":vt[e]=new Intl.DateTimeFormat(n,{month:"short",year:"numeric"});break;case"weekday":vt[e]=new Intl.DateTimeFormat(n,{weekday:"long"});break;case"hhmm":vt[e]=new Intl.DateTimeFormat(n,{hour12:!1,hour:"numeric",minute:"2-digit"});break;case"hhmmss":vt[e]=new Intl.DateTimeFormat(n,{hour12:!1,hour:"numeric",minute:"2-digit",second:"2-digit"});break;case"mese":vt[e]=new Intl.DateTimeFormat(n,{month:"long"});break;default:vt[e="."]||(vt[e]=new Intl.DateTimeFormat(n,{weekday:"long",day:"numeric",month:"long",year:"numeric",hour12:!1,hour:"numeric",minute:"2-digit"}))}return vt[e].format(t).trim()};function $t(t){let e,n,i,o;return{c(){e=f("textarea"),c(e,"class",n="area_textarea "+t[4].class||""),e.readOnly=t[1]},m(n,l){u(n,e,l),t[5](e),a(e,t[0]),i||(o=[d(e,"input",t[6]),d(e,"input",t[3])],i=!0)},p(t,[i]){16&i&&n!==(n="area_textarea "+t[4].class||"")&&c(e,"class",n),2&i&&(e.readOnly=t[1]),1&i&&a(e,t[0])},i:l,o:l,d(n){n&&r(e),t[5](null),i=!1,s(o)}}}function kt(t,e,n){let l,{value:r="",readonly:s=!1}=e;function c(){l&&(n(2,l.style.height="auto",l),n(2,l.style.height=l.scrollHeight+"px",l))}return W(()=>{c()}),t.$$set=t=>{n(4,e=i(i({},e),o(t))),"value"in t&&n(0,r=t.value),"readonly"in t&&n(1,s=t.readonly)},c(),e=o(e),[r,s,l,c,e,function(t){p[t?"unshift":"push"](()=>{l=t,n(2,l)})},function(){r=this.value,n(0,r)}]}class Dt extends t{constructor(t){super(),e(this,t,kt,$t,n,{value:0,readonly:1})}}function _t(t){let e,n,i,o,l,s,a=(t[0]||"")+"";const d=t[26].default,p=h(d,t,t[25],null);return{c(){e=f("div"),n=f("div"),i=k(a),o=D(),p&&p.c(),_(e,"width","fit-content"),c(e,"class",l=(t[9].class||"")+" px-2 py-0.5 rounded flex flex-col items-center "+t[8]+" "+(t[5]?"":"whitespace-nowrap")),y(e,"font-bold",t[6]),y(e,"text-sm",t[1]),y(e,"text-xs",t[2]),y(e,"text-lg",t[3]),y(e,"text-xl",t[4]),y(e,"uppercase",t[7])},m(t,l){u(t,e,l),$(e,n),$(n,i),$(e,o),p&&p.m(e,null),s=!0},p(t,[n]){(!s||1&n)&&a!==(a=(t[0]||"")+"")&&w(i,a),p&&p.p&&(!s||33554432&n)&&b(p,d,t,t[25],s?v(d,t[25],n,null):x(t[25]),null),(!s||800&n&&l!==(l=(t[9].class||"")+" px-2 py-0.5 rounded flex flex-col items-center "+t[8]+" "+(t[5]?"":"whitespace-nowrap")))&&c(e,"class",l),(!s||864&n)&&y(e,"font-bold",t[6]),(!s||802&n)&&y(e,"text-sm",t[1]),(!s||804&n)&&y(e,"text-xs",t[2]),(!s||808&n)&&y(e,"text-lg",t[3]),(!s||816&n)&&y(e,"text-xl",t[4]),(!s||928&n)&&y(e,"uppercase",t[7])},i(t){s||(g(p,t),s=!0)},o(t){m(p,t),s=!1},d(t){t&&r(e),p&&p.d(t)}}}function St(t,e,n){let l,{$$slots:r={},$$scope:s}=e,{value:c,tipo:a="",warning:u=!1,alt:d=!1,ialt:f=!1,iwarning:p=!1,success:h=!1,isuccess:m=!1,danger:g=!1,idanger:w=!1,base:b=!1,ibase:x=!1,gray:v=!1,igray:y=!1,partial:$=!1,sm:k=!1,xs:D=!1,lg:_=!1,xl:S=!1,wrap:z=!1,bold:M=!1,black:j=!1,uppercase:E=!1}=e;return t.$$set=t=>{n(9,e=i(i({},e),o(t))),"value"in t&&n(0,c=t.value),"tipo"in t&&n(10,a=t.tipo),"warning"in t&&n(11,u=t.warning),"alt"in t&&n(12,d=t.alt),"ialt"in t&&n(13,f=t.ialt),"iwarning"in t&&n(14,p=t.iwarning),"success"in t&&n(15,h=t.success),"isuccess"in t&&n(16,m=t.isuccess),"danger"in t&&n(17,g=t.danger),"idanger"in t&&n(18,w=t.idanger),"base"in t&&n(19,b=t.base),"ibase"in t&&n(20,x=t.ibase),"gray"in t&&n(21,v=t.gray),"igray"in t&&n(22,y=t.igray),"partial"in t&&n(23,$=t.partial),"sm"in t&&n(1,k=t.sm),"xs"in t&&n(2,D=t.xs),"lg"in t&&n(3,_=t.lg),"xl"in t&&n(4,S=t.xl),"wrap"in t&&n(5,z=t.wrap),"bold"in t&&n(6,M=t.bold),"black"in t&&n(24,j=t.black),"uppercase"in t&&n(7,E=t.uppercase),"$$scope"in t&&n(25,s=t.$$scope)},t.$$.update=()=>{4180993&t.$$.dirty&&n(8,l=u||"warning"==a?"bg-b-warning text-c-warning":p||"iwarning"==a?"bg-c-warning text-b-warning":h||"success"==a?"bg-b-success text-c-success":m||"isuccess"==a?"bg-c-success text-b-success":g||"danger"==a?"bg-c-danger text-b-danger":w||"idanger"==a?"bg-b-danger text-c-danger":b||"base"==a?"bg-b-base text-c-base":x||"ibase"==a?"bg-c-base text-b-base":d||"alt"==a?"bg-pink-100 text-pink-700":f||"ialt"==a?"bg-pink-700 text-pink-100":v||"gray"==a?"bg-c-100 text-c-500":y||"igray"==a?"bg-c-800 text-c-100":j||"black"==a?"bg-black text-white":$||"partial"==a?"bg-[#bdb76b] text-black":"text-sm bg-white border border-c-200")},e=o(e),[c,k,D,_,S,z,M,E,l,e,a,u,d,f,p,h,m,g,w,b,x,v,y,$,j,s,r]}class zt extends t{constructor(t){super(),e(this,t,St,_t,n,{value:0,tipo:10,warning:11,alt:12,ialt:13,iwarning:14,success:15,isuccess:16,danger:17,idanger:18,base:19,ibase:20,gray:21,igray:22,partial:23,sm:1,xs:2,lg:3,xl:4,wrap:5,bold:6,black:24,uppercase:7})}}const Mt=Math.min,jt=Math.max,Et=Math.round,Ct=t=>({x:t,y:t}),Tt={left:"right",right:"left",bottom:"top",top:"bottom"},Nt={start:"end",end:"start"};function Ot(t,e,n){return jt(t,Mt(e,n))}function At(t,e){return"function"==typeof t?t(e):t}function Ft(t){return t.split("-")[0]}function It(t){return t.split("-")[1]}function Rt(t){return"x"===t?"y":"x"}function Lt(t){return"y"===t?"height":"width"}const Bt=new Set(["top","bottom"]);function Ht(t){return Bt.has(Ft(t))?"y":"x"}function Pt(t){return Rt(Ht(t))}function Vt(t){return t.replace(/start|end/g,t=>Nt[t])}const Yt=["left","right"],Ut=["right","left"],qt=["top","bottom"],Gt=["bottom","top"];function Wt(t,e,n,i){const o=It(t);let l=function(t,e,n){switch(t){case"top":case"bottom":return n?e?Ut:Yt:e?Yt:Ut;case"left":case"right":return e?qt:Gt;default:return[]}}(Ft(t),"start"===n,i);return o&&(l=l.map(t=>t+"-"+o),e&&(l=l.concat(l.map(Vt)))),l}function Xt(t){return t.replace(/left|right|bottom|top/g,t=>Tt[t])}function Kt(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function Zt(t){const{x:e,y:n,width:i,height:o}=t;return{width:i,height:o,top:n,left:e,right:e+i,bottom:n+o,x:e,y:n}}function Jt(t,e,n){let{reference:i,floating:o}=t;const l=Ht(e),r=Pt(e),s=Lt(r),c=Ft(e),a="y"===l,u=i.x+i.width/2-o.width/2,d=i.y+i.height/2-o.height/2,f=i[s]/2-o[s]/2;let p;switch(c){case"top":p={x:u,y:i.y-o.height};break;case"bottom":p={x:u,y:i.y+i.height};break;case"right":p={x:i.x+i.width,y:d};break;case"left":p={x:i.x-o.width,y:d};break;default:p={x:i.x,y:i.y}}switch(It(e)){case"start":p[r]-=f*(n&&a?-1:1);break;case"end":p[r]+=f*(n&&a?-1:1)}return p}async function Qt(t,e){var n;void 0===e&&(e={});const{x:i,y:o,platform:l,rects:r,elements:s,strategy:c}=t,{boundary:a="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=At(e,t),h=Kt(p),m=s[f?"floating"===d?"reference":"floating":d],g=Zt(await l.getClippingRect({element:null==(n=await(null==l.isElement?void 0:l.isElement(m)))||n?m:m.contextElement||await(null==l.getDocumentElement?void 0:l.getDocumentElement(s.floating)),boundary:a,rootBoundary:u,strategy:c})),w="floating"===d?{x:i,y:o,width:r.floating.width,height:r.floating.height}:r.reference,b=await(null==l.getOffsetParent?void 0:l.getOffsetParent(s.floating)),x=await(null==l.isElement?void 0:l.isElement(b))&&await(null==l.getScale?void 0:l.getScale(b))||{x:1,y:1},v=Zt(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:w,offsetParent:b,strategy:c}):w);return{top:(g.top-v.top+h.top)/x.y,bottom:(v.bottom-g.bottom+h.bottom)/x.y,left:(g.left-v.left+h.left)/x.x,right:(v.right-g.right+h.right)/x.x}}const te=new Set(["left","top"]);function ee(){return"undefined"!=typeof window}function ne(t){return le(t)?(t.nodeName||"").toLowerCase():"#document"}function ie(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function oe(t){var e;return null==(e=(le(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function le(t){return!!ee()&&(t instanceof Node||t instanceof ie(t).Node)}function re(t){return!!ee()&&(t instanceof Element||t instanceof ie(t).Element)}function se(t){return!!ee()&&(t instanceof HTMLElement||t instanceof ie(t).HTMLElement)}function ce(t){return!(!ee()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof ie(t).ShadowRoot)}const ae=new Set(["inline","contents"]);function ue(t){const{overflow:e,overflowX:n,overflowY:i,display:o}=$e(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!ae.has(o)}const de=new Set(["table","td","th"]);function fe(t){return de.has(ne(t))}const pe=[":popover-open",":modal"];function he(t){return pe.some(e=>{try{return t.matches(e)}catch(t){return!1}})}const me=["transform","translate","scale","rotate","perspective"],ge=["transform","translate","scale","rotate","perspective","filter"],we=["paint","layout","strict","content"];function be(t){const e=xe(),n=re(t)?$e(t):t;return me.some(t=>!!n[t]&&"none"!==n[t])||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||ge.some(t=>(n.willChange||"").includes(t))||we.some(t=>(n.contain||"").includes(t))}function xe(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const ve=new Set(["html","body","#document"]);function ye(t){return ve.has(ne(t))}function $e(t){return ie(t).getComputedStyle(t)}function ke(t){return re(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function De(t){if("html"===ne(t))return t;const e=t.assignedSlot||t.parentNode||ce(t)&&t.host||oe(t);return ce(e)?e.host:e}function _e(t){const e=De(t);return ye(e)?t.ownerDocument?t.ownerDocument.body:t.body:se(e)&&ue(e)?e:_e(e)}function Se(t,e,n){var i;void 0===e&&(e=[]);const o=_e(t),l=o===(null==(i=t.ownerDocument)?void 0:i.body),r=ie(o);return l?(ze(r),e.concat(r,r.visualViewport||[],ue(o)?o:[],[])):e.concat(o,Se(o,[]))}function ze(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Me(t){const e=$e(t);let n=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const o=se(t),l=o?t.offsetWidth:n,r=o?t.offsetHeight:i,s=Et(n)!==l||Et(i)!==r;return s&&(n=l,i=r),{width:n,height:i,$:s}}function je(t){return re(t)?t:t.contextElement}function Ee(t){const e=je(t);if(!se(e))return Ct(1);const n=e.getBoundingClientRect(),{width:i,height:o,$:l}=Me(e);let r=(l?Et(n.width):n.width)/i,s=(l?Et(n.height):n.height)/o;return r&&Number.isFinite(r)||(r=1),s&&Number.isFinite(s)||(s=1),{x:r,y:s}}const Ce=Ct(0);function Te(t){const e=ie(t);return xe()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:Ce}function Ne(t,e,n,i){void 0===e&&(e=!1),void 0===n&&(n=!1);const o=t.getBoundingClientRect(),l=je(t);let r=Ct(1);e&&(i?re(i)&&(r=Ee(i)):r=Ee(t));const s=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==ie(t))&&e}(l,n,i)?Te(l):Ct(0);let c=(o.left+s.x)/r.x,a=(o.top+s.y)/r.y,u=o.width/r.x,d=o.height/r.y;if(l){const t=ie(l),e=i&&re(i)?ie(i):i;let n=t,o=ze(n);for(;o&&i&&e!==n;){const t=Ee(o),e=o.getBoundingClientRect(),i=$e(o),l=e.left+(o.clientLeft+parseFloat(i.paddingLeft))*t.x,r=e.top+(o.clientTop+parseFloat(i.paddingTop))*t.y;c*=t.x,a*=t.y,u*=t.x,d*=t.y,c+=l,a+=r,n=ie(o),o=ze(n)}}return Zt({width:u,height:d,x:c,y:a})}function Oe(t,e){const n=ke(t).scrollLeft;return e?e.left+n:Ne(oe(t)).left+n}function Ae(t,e,n){void 0===n&&(n=!1);const i=t.getBoundingClientRect();return{x:i.left+e.scrollLeft-(n?0:Oe(t,i)),y:i.top+e.scrollTop}}const Fe=new Set(["absolute","fixed"]);function Ie(t,e,n){let i;if("viewport"===e)i=function(t,e){const n=ie(t),i=oe(t),o=n.visualViewport;let l=i.clientWidth,r=i.clientHeight,s=0,c=0;if(o){l=o.width,r=o.height;const t=xe();(!t||t&&"fixed"===e)&&(s=o.offsetLeft,c=o.offsetTop)}return{width:l,height:r,x:s,y:c}}(t,n);else if("document"===e)i=function(t){const e=oe(t),n=ke(t),i=t.ownerDocument.body,o=jt(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),l=jt(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let r=-n.scrollLeft+Oe(t);const s=-n.scrollTop;return"rtl"===$e(i).direction&&(r+=jt(e.clientWidth,i.clientWidth)-o),{width:o,height:l,x:r,y:s}}(oe(t));else if(re(e))i=function(t,e){const n=Ne(t,!0,"fixed"===e),i=n.top+t.clientTop,o=n.left+t.clientLeft,l=se(t)?Ee(t):Ct(1);return{width:t.clientWidth*l.x,height:t.clientHeight*l.y,x:o*l.x,y:i*l.y}}(e,n);else{const n=Te(t);i={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return Zt(i)}function Re(t,e){const n=De(t);return!(n===e||!re(n)||ye(n))&&("fixed"===$e(n).position||Re(n,e))}function Le(t,e,n){const i=se(e),o=oe(e),l="fixed"===n,r=Ne(t,!0,l,e);let s={scrollLeft:0,scrollTop:0};const c=Ct(0);function a(){c.x=Oe(o)}if(i||!i&&!l)if(("body"!==ne(e)||ue(o))&&(s=ke(e)),i){const t=Ne(e,!0,l,e);c.x=t.x+e.clientLeft,c.y=t.y+e.clientTop}else o&&a();l&&!i&&o&&a();const u=!o||i||l?Ct(0):Ae(o,s);return{x:r.left+s.scrollLeft-c.x-u.x,y:r.top+s.scrollTop-c.y-u.y,width:r.width,height:r.height}}function Be(t){return"static"===$e(t).position}function He(t,e){if(!se(t)||"fixed"===$e(t).position)return null;if(e)return e(t);let n=t.offsetParent;return oe(t)===n&&(n=n.ownerDocument.body),n}function Pe(t,e){const n=ie(t);if(he(t))return n;if(!se(t)){let e=De(t);for(;e&&!ye(e);){if(re(e)&&!Be(e))return e;e=De(e)}return n}let i=He(t,e);for(;i&&fe(i)&&Be(i);)i=He(i,e);return i&&ye(i)&&Be(i)&&!be(i)?n:i||function(t){let e=De(t);for(;se(e)&&!ye(e);){if(be(e))return e;if(he(e))return null;e=De(e)}return null}(t)||n}const Ve={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:i,strategy:o}=t;const l="fixed"===o,r=oe(i),s=!!e&&he(e.floating);if(i===r||s&&l)return n;let c={scrollLeft:0,scrollTop:0},a=Ct(1);const u=Ct(0),d=se(i);if((d||!d&&!l)&&(("body"!==ne(i)||ue(r))&&(c=ke(i)),se(i))){const t=Ne(i);a=Ee(i),u.x=t.x+i.clientLeft,u.y=t.y+i.clientTop}const f=!r||d||l?Ct(0):Ae(r,c,!0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-c.scrollLeft*a.x+u.x+f.x,y:n.y*a.y-c.scrollTop*a.y+u.y+f.y}},getDocumentElement:oe,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:i,strategy:o}=t;const l="clippingAncestors"===n?he(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let i=Se(t,[]).filter(t=>re(t)&&"body"!==ne(t)),o=null;const l="fixed"===$e(t).position;let r=l?De(t):t;for(;re(r)&&!ye(r);){const e=$e(r),n=be(r);n||"fixed"!==e.position||(o=null),(l?!n&&!o:!n&&"static"===e.position&&o&&Fe.has(o.position)||ue(r)&&!n&&Re(t,r))?i=i.filter(t=>t!==r):o=e,r=De(r)}return e.set(t,i),i}(e,this._c):[].concat(n),r=[...l,i],s=r[0],c=r.reduce((t,n)=>{const i=Ie(e,n,o);return t.top=jt(i.top,t.top),t.right=Mt(i.right,t.right),t.bottom=Mt(i.bottom,t.bottom),t.left=jt(i.left,t.left),t},Ie(e,s,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},getOffsetParent:Pe,getElementRects:async function(t){const e=this.getOffsetParent||Pe,n=this.getDimensions,i=await n(t.floating);return{reference:Le(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=Me(t);return{width:e,height:n}},getScale:Ee,isElement:re,isRTL:function(t){return"rtl"===$e(t).direction}},Ye=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,i;const{x:o,y:l,placement:r,middlewareData:s}=e,c=await async function(t,e){const{placement:n,platform:i,elements:o}=t,l=await(null==i.isRTL?void 0:i.isRTL(o.floating)),r=Ft(n),s=It(n),c="y"===Ht(n),a=te.has(r)?-1:1,u=l&&c?-1:1,d=At(e,t);let{mainAxis:f,crossAxis:p,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof h&&(p="end"===s?-1*h:h),c?{x:p*u,y:f*a}:{x:f*a,y:p*u}}(e,t);return r===(null==(n=s.offset)?void 0:n.placement)&&null!=(i=s.arrow)&&i.alignmentOffset?{}:{x:o+c.x,y:l+c.y,data:{...c,placement:r}}}}},Ue=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:i,placement:o}=e,{mainAxis:l=!0,crossAxis:r=!1,limiter:s={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...c}=At(t,e),a={x:n,y:i},u=await Qt(e,c),d=Ht(Ft(o)),f=Rt(d);let p=a[f],h=a[d];if(l){const t="y"===f?"bottom":"right";p=Ot(p+u["y"===f?"top":"left"],p,p-u[t])}if(r){const t="y"===d?"bottom":"right";h=Ot(h+u["y"===d?"top":"left"],h,h-u[t])}const m=s.fn({...e,[f]:p,[d]:h});return{...m,data:{x:m.x-n,y:m.y-i,enabled:{[f]:l,[d]:r}}}}}},qe=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,i;const{placement:o,middlewareData:l,rects:r,initialPlacement:s,platform:c,elements:a}=e,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...g}=At(t,e);if(null!=(n=l.arrow)&&n.alignmentOffset)return{};const w=Ft(o),b=Ht(s),x=Ft(s)===s,v=await(null==c.isRTL?void 0:c.isRTL(a.floating)),y=f||(x||!m?[Xt(s)]:function(t){const e=Xt(t);return[Vt(t),e,Vt(e)]}(s)),$="none"!==h;!f&&$&&y.push(...Wt(s,m,h,v));const k=[s,...y],D=await Qt(e,g),_=[];let S=(null==(i=l.flip)?void 0:i.overflows)||[];if(u&&_.push(D[w]),d){const t=function(t,e,n){void 0===n&&(n=!1);const i=It(t),o=Pt(t),l=Lt(o);let r="x"===o?i===(n?"end":"start")?"right":"left":"start"===i?"bottom":"top";return e.reference[l]>e.floating[l]&&(r=Xt(r)),[r,Xt(r)]}(o,r,v);_.push(D[t[0]],D[t[1]])}if(S=[...S,{placement:o,overflows:_}],!_.every(t=>t<=0)){var z,M;const t=((null==(z=l.flip)?void 0:z.index)||0)+1,e=k[t];if(e){if(!("alignment"===d&&b!==Ht(e))||S.every(t=>t.overflows[0]>0&&Ht(t.placement)===b))return{data:{index:t,overflows:S},reset:{placement:e}}}let n=null==(M=S.filter(t=>t.overflows[0]<=0).sort((t,e)=>t.overflows[1]-e.overflows[1])[0])?void 0:M.placement;if(!n)switch(p){case"bestFit":{var j;const t=null==(j=S.filter(t=>{if($){const e=Ht(t.placement);return e===b||"y"===e}return!0}).map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,e)=>t+e,0)]).sort((t,e)=>t[1]-e[1])[0])?void 0:j[0];t&&(n=t);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},Ge=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:i,placement:o,rects:l,platform:r,elements:s,middlewareData:c}=e,{element:a,padding:u=0}=At(t,e)||{};if(null==a)return{};const d=Kt(u),f={x:n,y:i},p=Pt(o),h=Lt(p),m=await r.getDimensions(a),g="y"===p,w=g?"top":"left",b=g?"bottom":"right",x=g?"clientHeight":"clientWidth",v=l.reference[h]+l.reference[p]-f[p]-l.floating[h],y=f[p]-l.reference[p],$=await(null==r.getOffsetParent?void 0:r.getOffsetParent(a));let k=$?$[x]:0;k&&await(null==r.isElement?void 0:r.isElement($))||(k=s.floating[x]||l.floating[h]);const D=v/2-y/2,_=k/2-m[h]/2-1,S=Mt(d[w],_),z=Mt(d[b],_),M=S,j=k-m[h]-z,E=k/2-m[h]/2+D,C=Ot(M,E,j),T=!c.arrow&&null!=It(o)&&E!==C&&l.reference[h]/2-(E<M?S:z)-m[h]/2<0,N=T?E<M?E-M:E-j:0;return{[p]:f[p]+N,data:{[p]:C,centerOffset:E-C-N,...T&&{alignmentOffset:N}},reset:T}}}),We=(t,e,n)=>{const i=new Map,o={platform:Ve,...n},l={...o.platform,_c:i};return(async(t,e,n)=>{const{placement:i="bottom",strategy:o="absolute",middleware:l=[],platform:r}=n,s=l.filter(Boolean),c=await(null==r.isRTL?void 0:r.isRTL(e));let a=await r.getElementRects({reference:t,floating:e,strategy:o}),{x:u,y:d}=Jt(a,i,c),f=i,p={},h=0;for(let n=0;n<s.length;n++){const{name:l,fn:m}=s[n],{x:g,y:w,data:b,reset:x}=await m({x:u,y:d,initialPlacement:i,placement:f,strategy:o,middlewareData:p,rects:a,platform:r,elements:{reference:t,floating:e}});u=null!=g?g:u,d=null!=w?w:d,p={...p,[l]:{...p[l],...b}},x&&h<=50&&(h++,"object"==typeof x&&(x.placement&&(f=x.placement),x.rects&&(a=!0===x.rects?await r.getElementRects({reference:t,floating:e,strategy:o}):x.rects),({x:u,y:d}=Jt(a,f,c))),n=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:p}})(t,e,{...o,platform:l})};function Xe(t){let e;function n(t,e){return t[4]?Je:t[1]?Ke:Ze}let i=n(t),o=i(t);return{c(){o.c(),e=S()},m(t,n){o.m(t,n),u(t,e,n)},p(t,l){i===(i=n(t))&&o?o.p(t,l):(o.d(1),o=i(t),o&&(o.c(),o.m(e.parentNode,e)))},d(t){t&&r(e),o.d(t)}}}function Ke(t){let e,n,i,o,l;return{c(){e=f("figure"),n=f("canvas"),c(n,"class",i=`w-full h-full ${t[5]()}`),c(n,"style",o=`-webkit-mask: url(${t[9]}) 50% 50% no-repeat;\n mask: url(${t[9]}) 50% 50% no-repeat;\n -webkit-mask-size:contain;\n mask-size:contain;\n aspect-ratio: 1 / 1;`),c(e,"class",l=t[11].class||""),c(e,"style",t[8])},m(t,i){u(t,e,i),$(e,n)},p(t,r){32&r&&i!==(i=`w-full h-full ${t[5]()}`)&&c(n,"class",i),512&r&&o!==(o=`-webkit-mask: url(${t[9]}) 50% 50% no-repeat;\n mask: url(${t[9]}) 50% 50% no-repeat;\n -webkit-mask-size:contain;\n mask-size:contain;\n aspect-ratio: 1 / 1;`)&&c(n,"style",o),2048&r&&l!==(l=t[11].class||"")&&c(e,"class",l),256&r&&c(e,"style",t[8])},d(t){t&&r(e)}}}function Ze(t){let e,n,i=(t[10][t[0]]?t[10][t[0]]:t[0])+"";return{c(){e=f("div"),c(e,"class",n=`select-none bg-transparent block material-symbols-rounded leading-none notranslate ${t[11].class||""} ${t[2]}`),c(e,"style",t[7])},m(t,n){u(t,e,n),e.innerHTML=i},p(t,o){1&o&&i!==(i=(t[10][t[0]]?t[10][t[0]]:t[0])+"")&&(e.innerHTML=i),2052&o&&n!==(n=`select-none bg-transparent block material-symbols-rounded leading-none notranslate ${t[11].class||""} ${t[2]}`)&&c(e,"class",n),128&o&&c(e,"style",t[7])},d(t){t&&r(e)}}}function Je(t){let e,n,i,o;return{c(){e=f("div"),n=k(t[0]),c(e,"class",i=t[2]+" "+(t[11].class||"")+" w-full h-full text-center flex items-center justify-center"),c(e,"style",o=t[6]+" "+t[8])},m(t,i){u(t,e,i),$(e,n)},p(t,l){1&l&&w(n,t[0]),2052&l&&i!==(i=t[2]+" "+(t[11].class||"")+" w-full h-full text-center flex items-center justify-center")&&c(e,"class",i),320&l&&o!==(o=t[6]+" "+t[8])&&c(e,"style",o)},d(t){t&&r(e)}}}function Qe(t){let e,n=t[3]&&Xe(t);return{c(){n&&n.c(),e=S()},m(t,i){n&&n.m(t,i),u(t,e,i)},p(t,[i]){t[3]?n?n.p(t,i):(n=Xe(t),n.c(),n.m(e.parentNode,e)):n&&(n.d(1),n=null)},i:l,o:l,d(t){t&&r(e),n&&n.d(t)}}}function tn(t,e,n){let l,r,s,c,a,u,d,{img:f="close"}=e,{size:p=8}=e,{color:h="text-c-800 hover:text-black"}=e,{pixel:m=!1}=e,{local:g=!1}=e,{black:w=!1,alt:b=!1,readonly:x=!1}=e;let v=!1;return W(async()=>{await document.fonts.ready,n(3,v=!0)}),t.$$set=t=>{n(11,e=i(i({},e),o(t))),"img"in t&&n(0,f=t.img),"size"in t&&n(12,p=t.size),"color"in t&&n(13,h=t.color),"pixel"in t&&n(14,m=t.pixel),"local"in t&&n(1,g=t.local),"black"in t&&n(15,w=t.black),"alt"in t&&n(16,b=t.alt),"readonly"in t&&n(17,x=t.readonly)},t.$$.update=()=>{237568&t.$$.dirty&&n(2,l=x?"text-c-200":b?"text-c-base hover:text-black":w?"text-c-100 hover:text-white":h),20480&t.$$.dirty&&n(8,s=m?`width: ${p}px; height: ${p}px;`:`width: ${(p||12)/4}rem; height: ${(p||12)/4}rem;`),20480&t.$$.dirty&&n(7,c=m?`font-size: ${p}px;`:`font-size: ${(p||12)/4}rem;`),20480&t.$$.dirty&&n(6,a=m?`font-size: ${.8*p}px;`:`font-size: ${.8*(p||12)/4}rem;`),8196&t.$$.dirty&&n(5,u=()=>l.replaceAll("text-","bg-"))},n(9,r=`/svg/${f}.svg`),n(4,d=f?.length>0&&(38==f.charCodeAt(0)||f.charCodeAt(0)>1e3)),e=o(e),[f,g,l,v,d,u,a,c,s,r,{dashboard:"",people_alt:"",local_offer:"",local_shipping:"",view_list:"",calendar_month:"",auto_mode:"",store:"",paid:"",account_balance:"",tips_and_updates:"",bug_report:""},e,p,h,m,w,b,x]}class en extends t{constructor(t){super(),e(this,t,tn,Qe,n,{img:0,size:12,color:13,pixel:14,local:1,black:15,alt:16,readonly:17})}}let nn={bus:gt,myuuid:ft,formatDate:ht,toDateStr:mt,listfromstring:wt,toEuro:xt,tonum:bt,strDate:yt,getdim:pt,autofocus:function(t,e,n=100){if(!t)return;e&&e.querySelectorAll&&setTimeout(()=>{var t=e.querySelectorAll("input,select,area");(t&&t[0]||(t=e.querySelectorAll("button"))&&t[0])&&t[0].focus()},n)},setStorage:function(t,e){window?.localStorage&&(null==e||""===e?window.localStorage.removeItem(t):window.localStorage.setItem(t,JSON.stringify(e)))},getStorage:function(t,e){var n;window?.localStorage&&(n=window.localStorage.getItem(t));return n?JSON.parse(n):e}};function on(){return nn}function ln(t){t||(t={});for(let e in t)nn[e]=t[e];return nn}const rn=t=>({}),sn=t=>({});function cn(t){let e;const n=t[14].default,i=h(n,t,t[13],null);return{c(){i&&i.c()},m(t,n){i&&i.m(t,n),e=!0},p(t,o){i&&i.p&&(!e||8192&o)&&b(i,n,t,t[13],e?v(n,t[13],o,null):x(t[13]),null)},i(t){e||(g(i,t),e=!0)},o(t){m(i,t),e=!1},d(t){i&&i.d(t)}}}function an(t){let e,n,i,o,l,a;const p=t[14].default,w=h(p,t,t[13],null);let y=t[2]&&un(t);return{c(){e=f("span"),w&&w.c(),n=D(),y&&y.c(),i=S(),c(e,"class","relative"),_(e,"line-height","0 ")},m(r,s){u(r,e,s),w&&w.m(e,null),u(r,n,s),y&&y.m(r,s),u(r,i,s),o=!0,l||(a=[d(e,"focus",t[5]),d(e,"blur",t[6]),d(e,"mouseenter",t[5]),d(e,"mouseleave",t[6])],l=!0)},p(t,e){w&&w.p&&(!o||8192&e)&&b(w,p,t,t[13],o?v(p,t[13],e,null):x(t[13]),null),t[2]?y?(y.p(t,e),4&e&&g(y,1)):(y=un(t),y.c(),g(y,1),y.m(i.parentNode,i)):y&&(z(),m(y,1,1,()=>{y=null}),M())},i(t){o||(g(w,t),g(y),o=!0)},o(t){m(w,t),m(y),o=!1},d(t){t&&(r(e),r(n),r(i)),w&&w.d(t),y&&y.d(t),l=!1,s(a)}}}function un(t){let e,n,i,o,l,s,a,p,w,y;const k=t[14].tooltip,z=h(k,t,t[13],sn),M=z||function(t){let e,n;return{c(){e=new T(!1),n=S(),e.a=n},m(i,o){e.m(t[0],i,o),u(i,n,o)},p(t,n){1&n&&e.p(t[0])},d(t){t&&(r(n),e.d())}}}(t);return{c(){e=f("button"),n=f("div"),o=D(),M&&M.c(),c(n,"class",i="absolute "+(t[1]?"bg-c-200":"bg-c-800")+" -z-1 w-2 h-2"),_(n,"transform","rotate(45deg)"),c(e,"class",l="fixed top-0 left-0 max-w-max min-w-max text-xs "+(t[1]?"text-black bg-white border border-c-200":"text-white bg-c-800")+" z-[5000] rounded-md p-2 "+(t[7].class||""))},m(i,l){u(i,e,l),$(e,n),t[15](n),$(e,o),M&&M.m(e,null),t[16](e),p=!0,w||(y=d(e,"click",t[6]),w=!0)},p(t,o){(!p||2&o&&i!==(i="absolute "+(t[1]?"bg-c-200":"bg-c-800")+" -z-1 w-2 h-2"))&&c(n,"class",i),z?z.p&&(!p||8192&o)&&b(z,k,t,t[13],p?v(k,t[13],o,rn):x(t[13]),sn):M&&M.p&&(!p||1&o)&&M.p(t,p?o:-1),(!p||130&o&&l!==(l="fixed top-0 left-0 max-w-max min-w-max text-xs "+(t[1]?"text-black bg-white border border-c-200":"text-white bg-c-800")+" z-[5000] rounded-md p-2 "+(t[7].class||"")))&&c(e,"class",l)},i(t){p||(g(M,t),t&&E(()=>{p&&(a&&a.end(1),s=C(e,tt,{duration:300}),s.start())}),p=!0)},o(t){m(M,t),s&&s.invalidate(),t&&(a=j(e,tt,{duration:300})),p=!1},d(n){n&&r(e),t[15](null),M&&M.d(n),t[16](null),n&&a&&a.end(),w=!1,y()}}}function dn(t){let e,n,i,o;const l=[an,cn],s=[];function c(t,e){return t[0]?0:1}return e=c(t),n=s[e]=l[e](t),{c(){n.c(),i=S()},m(t,n){s[e].m(t,n),u(t,i,n),o=!0},p(t,[o]){let r=e;e=c(t),e===r?s[e].p(t,o):(z(),m(s[r],1,1,()=>{s[r]=null}),M(),n=s[e],n?n.p(t,o):(n=s[e]=l[e](t),n.c()),g(n,1),n.m(i.parentNode,i))},i(t){o||(g(n),o=!0)},o(t){m(n),o=!1},d(t){t&&r(i),s[e].d(t)}}}function fn(t,e,n){let l,r,s,{$$slots:c={},$$scope:a}=e,{tooltip:u}=e,{bottom:d,white:f=!1,callback:h,left:m,right:g,maxtime:w=2e3}=e,b=!1;function x(){l&&clearTimeout(l),l=0,n(2,b=!1)}return t.$$set=t=>{n(7,e=i(i({},e),o(t))),"tooltip"in t&&n(0,u=t.tooltip),"bottom"in t&&n(8,d=t.bottom),"white"in t&&n(1,f=t.white),"callback"in t&&n(9,h=t.callback),"left"in t&&n(10,m=t.left),"right"in t&&n(11,g=t.right),"maxtime"in t&&n(12,w=t.maxtime),"$$scope"in t&&n(13,a=t.$$scope)},e=o(e),[u,f,b,r,s,async function(t){h&&"function"==typeof h&&await h(),n(2,b=!0),await X(),function(t){t.target&&r&&s&&We(t.target,r,{placement:d?"bottom":m?"left":g?"right":"top",middleware:[Ye(6),qe(),Ue({padding:5}),Ge({element:s})]}).then(({x:t,y:e,placement:n,middlewareData:i})=>{Object.assign(r.style,{left:`${t}px`,top:`${e}px`,zIndex:1e3});const{x:o,y:l}=i.arrow,c={top:"bottom",right:"left",bottom:"top",left:"right"}[n.split("-")[0]];s&&Object.assign(s.style,{left:null!=o?`${o}px`:"",top:null!=l?`${l}px`:"",right:"",bottom:"",[c]:"-4px"})})}(t),w&&(l=setTimeout(()=>{x()},w))},x,e,d,h,m,g,w,a,c,function(t){p[t?"unshift":"push"](()=>{s=t,n(4,s)})},function(t){p[t?"unshift":"push"](()=>{r=t,n(3,r)})}]}class pn extends t{constructor(t){super(),e(this,t,fn,dn,n,{tooltip:0,bottom:8,white:1,callback:9,left:10,right:11,maxtime:12})}}function hn(t){let e,n,i,o,l,s,a,p;return n=new pn({props:{tooltip:t[19],$$slots:{default:[mn]},$$scope:{ctx:t}}}),{c(){e=f("button"),F(n.$$.fragment),c(e,"aria-label",i=`btnico_${t[0]}`),c(e,"style",t[21]),c(e,"tabindex",o=t[14]?"0":"-1"),c(e,"class",l=t[23](t[1],t[6],t[13],t[8],t[12],t[3],t[2],t[5],t[9],t[4],t[10],t[7])),y(e,"invisible",t[15]),y(e,"noprint",!0),y(e,"cursor-pointer",!t[13])},m(i,o){u(i,e,o),O(n,e,null),t[33](e),s=!0,a||(p=d(e,"click",A(t[22])),a=!0)},p(t,r){const a={};524288&r[0]&&(a.tooltip=t[19]),207777&r[0]|8&r[1]&&(a.$$scope={dirty:r,ctx:t}),n.$set(a),(!s||1&r[0]&&i!==(i=`btnico_${t[0]}`))&&c(e,"aria-label",i),(!s||2097152&r[0])&&c(e,"style",t[21]),(!s||16384&r[0]&&o!==(o=t[14]?"0":"-1"))&&c(e,"tabindex",o),(!s||14334&r[0]&&l!==(l=t[23](t[1],t[6],t[13],t[8],t[12],t[3],t[2],t[5],t[9],t[4],t[10],t[7])))&&c(e,"class",l),(!s||47102&r[0])&&y(e,"invisible",t[15]),(!s||14334&r[0])&&y(e,"noprint",!0),(!s||14334&r[0])&&y(e,"cursor-pointer",!t[13])},i(t){s||(g(n.$$.fragment,t),s=!0)},o(t){m(n.$$.fragment,t),s=!1},d(i){i&&r(e),N(n),t[33](null),a=!1,p()}}}function mn(t){let e,n,i;e=new en({props:{img:t[0],size:t[7]?t[17]:t[17]>4?t[17]-2:3,black:!(t[5]||t[9]||t[8]||t[11]),readonly:t[13],local:t[16],alt:t[8],color:t[11]?"text-header hover:text-white":t[5]||t[9]?"text-c-800 hover:text-black":""}});const o=t[32].default,l=h(o,t,t[34],null);return{c(){F(e.$$.fragment),n=D(),l&&l.c()},m(t,o){O(e,t,o),u(t,n,o),l&&l.m(t,o),i=!0},p(t,n){const r={};1&n[0]&&(r.img=t[0]),131200&n[0]&&(r.size=t[7]?t[17]:t[17]>4?t[17]-2:3),2848&n[0]&&(r.black=!(t[5]||t[9]||t[8]||t[11])),8192&n[0]&&(r.readonly=t[13]),65536&n[0]&&(r.local=t[16]),256&n[0]&&(r.alt=t[8]),2592&n[0]&&(r.color=t[11]?"text-header hover:text-white":t[5]||t[9]?"text-c-800 hover:text-black":""),e.$set(r),l&&l.p&&(!i||8&n[1])&&b(l,o,t,t[34],i?v(o,t[34],n,null):x(t[34]),null)},i(t){i||(g(e.$$.fragment,t),g(l,t),i=!0)},o(t){m(e.$$.fragment,t),m(l,t),i=!1},d(t){t&&r(n),N(e,t),l&&l.d(t)}}}function gn(t){let e,n,i=t[20]&&hn(t);return{c(){i&&i.c(),e=S()},m(t,o){i&&i.m(t,o),u(t,e,o),n=!0},p(t,n){t[20]?i?(i.p(t,n),1048576&n[0]&&g(i,1)):(i=hn(t),i.c(),g(i,1),i.m(e.parentNode,e)):i&&(z(),m(i,1,1,()=>{i=null}),M())},i(t){n||(g(i),n=!0)},o(t){m(i),n=!1},d(t){t&&r(e),i&&i.d(t)}}}function wn(t,e,n){let l,r,s,c,{$$slots:a={},$$scope:u}=e;const{user:d,post:f}=on(),h=K();let m,{img:g="yoga"}=e,{black:w=!1}=e,{right:b=!1}=e,{left:x=!1}=e,{center:v=!1}=e,{white:y=!1}=e,{whiteicon:$=!1}=e,{danger:k=!1}=e,{noborder:D=!1}=e,{alt:_=!1}=e,{gray:S=!1}=e,{nobtn:z=!1}=e,{header:M=!1}=e,{tooltip:j}=e,{warning:E=!1}=e,{success:C=!1}=e,{readonly:T=!1}=e,{auth:N=""}=e,{size:O=8}=e,{sm:A=!1}=e,{lg:F=!1}=e,{focus:I=!1}=e,{invisible:R=!1}=e,{local:L=!1}=e;const B={file_download:"Esporta i dati in formato XLSX",filter_alt:"Seleziona e filtra le colonne","β":"Aggiunge","β":"Modifica"};return t.$$set=t=>{n(39,e=i(i({},e),o(t))),"img"in t&&n(0,g=t.img),"black"in t&&n(1,w=t.black),"right"in t&&n(2,b=t.right),"left"in t&&n(3,x=t.left),"center"in t&&n(4,v=t.center),"white"in t&&n(5,y=t.white),"whiteicon"in t&&n(24,$=t.whiteicon),"danger"in t&&n(6,k=t.danger),"noborder"in t&&n(7,D=t.noborder),"alt"in t&&n(8,_=t.alt),"gray"in t&&n(9,S=t.gray),"nobtn"in t&&n(10,z=t.nobtn),"header"in t&&n(11,M=t.header),"tooltip"in t&&n(25,j=t.tooltip),"warning"in t&&n(12,E=t.warning),"success"in t&&n(26,C=t.success),"readonly"in t&&n(13,T=t.readonly),"auth"in t&&n(27,N=t.auth),"size"in t&&n(28,O=t.size),"sm"in t&&n(29,A=t.sm),"lg"in t&&n(30,F=t.lg),"focus"in t&&n(14,I=t.focus),"invisible"in t&&n(15,R=t.invisible),"local"in t&&n(16,L=t.local),"$$scope"in t&&n(34,u=t.$$scope)},t.$$.update=()=>{1879048192&t.$$.dirty[0]&&n(17,l=F?10:A?6:O||8),131072&t.$$.dirty[0]&&n(21,r=`width: ${(l||12)/4}rem; height: ${(l||12)/4}rem; `),134217728&t.$$.dirty[0]&&n(20,s=!N||f.isauth(N)),33554433&t.$$.dirty[0]&&n(19,c=j||B[g])},e=o(e),[g,w,b,x,v,y,k,D,_,S,z,M,E,T,I,R,L,l,m,c,s,r,function(t){T||h("click",t.target)},function(){var t=[e.class||""];return t.push("relative"),z||(x?t.push("rounded-l outline-c-200"):b?t.push("rounded-r !ml-0 outline-c-200"):v?t.push("!mr-0 !ml-0 border-r border-c-100"):t.push("rounded"),e.class&&t.push(e.class),T?y||_?t.push("bg-transparent"):t.push("bg-c-150"):w?t.push("bg-c-800 hover:bg-black"):$?t.push("bg-transparent text-white "):S?t.push("bg-c-150 border border-c-150 hover:bg-white"):y?(t.push("bg-transparent"),D||t.push("border border-c-200 hover:border-black")):_?t.push("bg-transparent "):(t.push("hover:bg-black"),k?t.push("bg-c-danger"):E?t.push("bg-c-warning"):C?t.push("bg-c-success"):t.push("bg-c-base"))),t.join(" ")},$,j,C,N,O,A,F,function(){return m},a,function(t){p[t?"unshift":"push"](()=>{m=t,n(18,m)})},u]}class bn extends t{constructor(t){super(),e(this,t,wn,gn,n,{img:0,black:1,right:2,left:3,center:4,white:5,whiteicon:24,danger:6,noborder:7,alt:8,gray:9,nobtn:10,header:11,tooltip:25,warning:12,success:26,readonly:13,auth:27,size:28,sm:29,lg:30,focus:14,invisible:15,local:16,getel:31},null,[-1,-1])}get getel(){return this.$$.ctx[31]}}function xn(t){let e;return{c(){e=k(t[2])},m(t,n){u(t,e,n)},p(t,n){4&n&&w(e,t[2])},d(t){t&&r(e)}}}function vn(t){let e,n,i=(t[2]||"").replaceAll("\n","<br/>")+"";return{c(){e=new T(!1),n=S(),e.a=n},m(t,o){e.m(i,t,o),u(t,n,o)},p(t,n){4&n&&i!==(i=(t[2]||"").replaceAll("\n","<br/>")+"")&&e.p(i)},d(t){t&&(r(n),e.d())}}}function yn(t){let e,n,i;return{c(){e=f("button"),c(e,"aria-label","btntrad"),c(e,"class","bg-c-200 absolute top-0 -right-2 rounded-full w-2 h-2")},m(o,l){u(o,e,l),n||(i=d(e,"click",A(R(t[8]))),n=!0)},p:l,d(t){t&&r(e),n=!1,i()}}}function $n(t){let e,n,i;function o(t,e){return t[1]?vn:xn}let s=o(t),a=s(t),d=t[3]&&9==t[4].level&&!t[0]&&yn(t);return{c(){e=f("span"),a.c(),n=D(),d&&d.c(),c(e,"class",i=`relative ${t[9].class||""}`)},m(t,i){u(t,e,i),a.m(e,null),$(e,n),d&&d.m(e,null)},p(t,[l]){s===(s=o(t))&&a?a.p(t,l):(a.d(1),a=s(t),a&&(a.c(),a.m(e,n))),t[3]&&9==t[4].level&&!t[0]?d?d.p(t,l):(d=yn(t),d.c(),d.m(e,null)):d&&(d.d(1),d=null),512&l&&i!==(i=`relative ${t[9].class||""}`)&&c(e,"class",i)},i:l,o:l,d(t){t&&r(e),a.d(),d&&d.d()}}}function kn(t,e,n){let l,r,s,c;const{bus:a,langedit:u,_:d,user:f,lang:p}=on();I(t,u,t=>n(3,s=t)),I(t,f,t=>n(4,c=t)),I(t,p,t=>n(11,r=t));let{id:h}=e,{noadd:m=!1}=e,{html:g=!1}=e;return t.$$set=t=>{n(9,e=i(i({},e),o(t))),"id"in t&&n(10,h=t.id),"noadd"in t&&n(0,m=t.noadd),"html"in t&&n(1,g=t.html)},t.$$.update=()=>{3073&t.$$.dirty&&n(2,l=d(h,r,m))},e=o(e),[m,g,l,s,c,u,f,p,function(){var t=(h||"").split("::")[0].trim().toLowerCase();"+"==t[0]&&(t=t.split(":")[0]),a.emit("asktrad",{id:t})},e,h,r]}class Dn extends t{constructor(t){super(),e(this,t,kn,$n,n,{id:10,noadd:0,html:1})}}function _n(t,e,n){const i=t.slice();return i[27]=e[n],i}function Sn(t){let e,n,i,o,l,s,a;const p=t[18].default,w=h(p,t,t[17],null),y=w||function(t){let e,n,i,o=t[0]&&zn(t),l=B(t[10]),s=[];for(let e=0;e<l.length;e+=1)s[e]=jn(_n(t,l,e));const a=t=>m(s[t],1,1,()=>{s[t]=null});return{c(){e=f("div"),o&&o.c(),n=D();for(let t=0;t<s.length;t+=1)s[t].c();c(e,"class","grid grid-cols-[auto_1fr] gap-2 w-fill pb-2")},m(t,l){u(t,e,l),o&&o.m(e,null),$(e,n);for(let t=0;t<s.length;t+=1)s[t]&&s[t].m(e,null);i=!0},p(t,i){if(t[0]?o?(o.p(t,i),1&i&&g(o,1)):(o=zn(t),o.c(),g(o,1),o.m(e,n)):o&&(z(),m(o,1,1,()=>{o=null}),M()),3584&i){let n;for(l=B(t[10]),n=0;n<l.length;n+=1){const o=_n(t,l,n);s[n]?(s[n].p(o,i),g(s[n],1)):(s[n]=jn(o),s[n].c(),g(s[n],1),s[n].m(e,null))}for(z(),n=l.length;n<s.length;n+=1)a(n);M()}},i(t){if(!i){g(o);for(let t=0;t<l.length;t+=1)g(s[t]);i=!0}},o(t){m(o),s=s.filter(Boolean);for(let t=0;t<s.length;t+=1)m(s[t]);i=!1},d(t){t&&r(e),o&&o.d(),H(s,t)}}}(t);return{c(){e=f("button"),n=D(),i=f("nav"),y&&y.c(),c(e,"class","fixed inset-0 bg-black opacity-0 z-10"),c(i,"class","fixed z-20 bg-white border border-c-border rounded-md shadow-md rounded-t-2xl")},m(o,r){u(o,e,r),u(o,n,r),u(o,i,r),y&&y.m(i,null),t[23](i),l=!0,s||(a=d(e,"click",t[20]),s=!0)},p(t,e){w?w.p&&(!l||131072&e)&&b(w,p,t,t[17],l?v(p,t[17],e,null):x(t[17]),null):y&&y.p&&(!l||1537&e)&&y.p(t,l?e:-1)},i(t){l||(g(y,t),t&&E(()=>{l&&(o||(o=L(i,tt,{duration:400},!0)),o.run(1))}),l=!0)},o(t){m(y,t),t&&(o||(o=L(i,tt,{duration:400},!1)),o.run(0)),l=!1},d(l){l&&(r(e),r(n),r(i)),y&&y.d(l),t[23](null),l&&o&&o.end(),s=!1,a()}}}function zn(t){let e,n,i;return n=new Dn({props:{id:t[0]}}),{c(){e=f("div"),F(n.$$.fragment),c(e,"class","titolo col-span-2 overflow-hidden")},m(t,o){u(t,e,o),O(n,e,null),i=!0},p(t,e){const i={};1&e&&(i.id=t[0]),n.$set(i)},i(t){i||(g(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&r(e),N(n)}}}function Mn(t){let e,n;return e=new en({props:{img:t[27].icon,size:6}}),{c(){F(e.$$.fragment)},m(t,i){O(e,t,i),n=!0},p(t,n){const i={};1024&n&&(i.img=t[27].icon),e.$set(i)},i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){N(e,t)}}}function jn(t){let e,n,i,o,l,a,p,h,b,x,v=t[27].des+"",y=t[27].icon&&Mn(t);function _(){return t[21](t[27])}function S(){return t[22](t[27])}return{c(){e=f("button"),n=f("div"),y&&y.c(),i=D(),o=f("button"),l=f("div"),a=k(v),p=D(),c(n,"class","w-6 h-6"),c(e,"class","pl-2"),c(l,"class","pr-2 hover:text-c-base text-black whitespace-nowrap text-left")},m(t,r){u(t,e,r),$(e,n),y&&y.m(n,null),u(t,i,r),u(t,o,r),$(o,l),$(l,a),$(o,p),h=!0,b||(x=[d(e,"click",_),d(o,"click",A(S))],b=!0)},p(e,i){(t=e)[27].icon?y?(y.p(t,i),1024&i&&g(y,1)):(y=Mn(t),y.c(),g(y,1),y.m(n,null)):y&&(z(),m(y,1,1,()=>{y=null}),M()),(!h||1024&i)&&v!==(v=t[27].des+"")&&w(a,v)},i(t){h||(g(y),h=!0)},o(t){m(y),h=!1},d(t){t&&(r(e),r(i),r(o)),y&&y.d(),b=!1,s(x)}}}function En(t){let e,n,i,o,l;n=new bn({props:{img:t[5],white:t[1],size:t[6],black:t[2],right:t[3],left:t[4],tooltip:t[9]?"":t[0]}}),n.$on("click",t[12]);let s=t[9]&&Sn(t);return{c(){e=f("div"),F(n.$$.fragment),i=D(),s&&s.c(),o=S(),c(e,"class","flex")},m(r,c){u(r,e,c),O(n,e,null),t[19](e),u(r,i,c),s&&s.m(r,c),u(r,o,c),l=!0},p(t,[e]){const i={};32&e&&(i.img=t[5]),2&e&&(i.white=t[1]),64&e&&(i.size=t[6]),4&e&&(i.black=t[2]),8&e&&(i.right=t[3]),16&e&&(i.left=t[4]),513&e&&(i.tooltip=t[9]?"":t[0]),n.$set(i),t[9]?s?(s.p(t,e),512&e&&g(s,1)):(s=Sn(t),s.c(),g(s,1),s.m(o.parentNode,o)):s&&(z(),m(s,1,1,()=>{s=null}),M())},i(t){l||(g(n.$$.fragment,t),g(s),l=!0)},o(t){m(n.$$.fragment,t),m(s),l=!1},d(l){l&&(r(e),r(i),r(o)),N(n),t[19](null),s&&s.d(l)}}}function Cn(t,e,n){let i,{$$slots:o={},$$scope:l}=e;const{_:r,user:s,post:c}=on(),a=K();let u,d,{title:f="titolo"}=e,{white:h=!1}=e,{black:m=!1}=e,{placement:g="bottom"}=e,{right:w=!1,left:b=!1}=e,{img:x="menu"}=e,{size:v=6}=e,{menu:y}=e,{voci:$=[]}=e,k=!1;return t.$$set=t=>{"title"in t&&n(0,f=t.title),"white"in t&&n(1,h=t.white),"black"in t&&n(2,m=t.black),"placement"in t&&n(13,g=t.placement),"right"in t&&n(3,w=t.right),"left"in t&&n(4,b=t.left),"img"in t&&n(5,x=t.img),"size"in t&&n(6,v=t.size),"menu"in t&&n(14,y=t.menu),"voci"in t&&n(15,$=t.voci),"$$scope"in t&&n(17,l=t.$$scope)},t.$$.update=()=>{49152&t.$$.dirty&&n(10,i=("function"==typeof y?y():$||[]).filter(t=>!t.hidden))},[f,h,m,w,b,x,v,u,d,k,i,a,async function(){k?n(9,k=!1):(n(9,k=!0),await X(),We(u,d,{placement:g,middleware:[Ye(20),qe(),Ue({padding:12})]}).then(({x:t,y:e,placement:n,middlewareData:i})=>{Object.assign(d.style,{left:`${t}px`,top:`${e}px`,zIndex:1e3})}))},g,y,$,function(){n(9,k=!1)},l,o,function(t){p[t?"unshift":"push"](()=>{u=t,n(7,u)})},()=>n(9,k=!1),t=>{n(9,k=!1),a("click",t)},t=>{n(9,k=!1),a("click",t)},function(t){p[t?"unshift":"push"](()=>{d=t,n(8,d)})}]}class Tn extends t{constructor(t){super(),e(this,t,Cn,En,n,{title:0,white:1,black:2,placement:13,right:3,left:4,img:5,size:6,menu:14,voci:15,close:16})}get close(){return this.$$.ctx[16]}}function Nn(t){let e,n;return e=new bn({props:{class:"z-[8]",tooltip:t[0],size:t[1],right:t[3],white:t[4],alt:t[6],whiteicon:t[7],black:t[5],readonly:t[9],img:"β"}}),e.$on("click",t[11]),{c(){F(e.$$.fragment)},m(t,i){O(e,t,i),n=!0},p(t,[n]){const i={};1&n&&(i.tooltip=t[0]),2&n&&(i.size=t[1]),8&n&&(i.right=t[3]),16&n&&(i.white=t[4]),64&n&&(i.alt=t[6]),128&n&&(i.whiteicon=t[7]),32&n&&(i.black=t[5]),512&n&&(i.readonly=t[9]),e.$set(i)},i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){N(e,t)}}}function On(t,e,n){const i=K();let{tooltip:o="Apri una nuova scheda",size:l=8,nuovo:r=!1,right:s=!1,white:c=!1,black:a=!1,alt:u=!1,whiteicon:d=!1,value:f="",readonly:p=!1}=e;return t.$$set=t=>{"tooltip"in t&&n(0,o=t.tooltip),"size"in t&&n(1,l=t.size),"nuovo"in t&&n(2,r=t.nuovo),"right"in t&&n(3,s=t.right),"white"in t&&n(4,c=t.white),"black"in t&&n(5,a=t.black),"alt"in t&&n(6,u=t.alt),"whiteicon"in t&&n(7,d=t.whiteicon),"value"in t&&n(8,f=t.value),"readonly"in t&&n(9,p=t.readonly)},[o,l,r,s,c,a,u,d,f,p,i,()=>{f?r?window.open(f,"_blank"):it(f):i("click")}]}class An extends t{constructor(t){super(),e(this,t,On,Nn,n,{tooltip:0,size:1,nuovo:2,right:3,white:4,black:5,alt:6,whiteicon:7,value:8,readonly:9})}}function Fn(t){let e,n,i,o,l,s,a,p,w,y,k;const _=t[14].default,S=h(_,t,t[13],null);let j=t[2]&&In(t);return{c(){e=f("button"),o=D(),l=f("nav"),s=f("div"),S&&S.c(),a=D(),j&&j.c(),c(e,"aria-label","bpop"),c(e,"class",n="fixed inset-0 "+(t[3]?"bg-transparent":"bg-c-800 opacity-20")+" z-50"),c(s,"class","relative h-full"),c(l,"class","fixed bg-white border border-c-border rounded shadow-md")},m(n,i){u(n,e,i),u(n,o,i),u(n,l,i),$(l,s),S&&S.m(s,null),$(s,a),j&&j.m(s,null),t[18](l),w=!0,y||(k=d(e,"click",t[15]),y=!0)},p(t,i){(!w||8&i&&n!==(n="fixed inset-0 "+(t[3]?"bg-transparent":"bg-c-800 opacity-20")+" z-50"))&&c(e,"class",n),S&&S.p&&(!w||8192&i)&&b(S,_,t,t[13],w?v(_,t[13],i,null):x(t[13]),null),t[2]?j?(j.p(t,i),4&i&&g(j,1)):(j=In(t),j.c(),g(j,1),j.m(s,null)):j&&(z(),m(j,1,1,()=>{j=null}),M())},i(t){w||(t&&E(()=>{w&&(i||(i=L(e,tt,{duration:400},!0)),i.run(1))}),g(S,t),g(j),t&&E(()=>{w&&(p||(p=L(l,tt,{duration:400},!0)),p.run(1))}),w=!0)},o(t){t&&(i||(i=L(e,tt,{duration:400},!1)),i.run(0)),m(S,t),m(j),t&&(p||(p=L(l,tt,{duration:400},!1)),p.run(0)),w=!1},d(n){n&&(r(e),r(o),r(l)),n&&i&&i.end(),S&&S.d(n),j&&j.d(),t[18](null),n&&p&&p.end(),y=!1,k()}}}function In(t){let e,n,i,o,l;return n=new bn({props:{img:"close",alt:!0,size:6}}),n.$on("click",t[16]),o=new bn({props:{alt:!0,img:t[1]?"fullscreen_exit":"fullscreen",size:6,tooltip:t[1]?"riduci finestra":"espandi finestra",color:"text-c-400"}}),o.$on("click",t[17]),{c(){e=f("div"),F(n.$$.fragment),i=D(),F(o.$$.fragment),c(e,"class","absolute top-1 right-2 flex flex-row space-x-1 z-50")},m(t,r){u(t,e,r),O(n,e,null),$(e,i),O(o,e,null),l=!0},p(t,e){const n={};2&e&&(n.img=t[1]?"fullscreen_exit":"fullscreen"),2&e&&(n.tooltip=t[1]?"riduci finestra":"espandi finestra"),o.$set(n)},i(t){l||(g(n.$$.fragment,t),g(o.$$.fragment,t),l=!0)},o(t){m(n.$$.fragment,t),m(o.$$.fragment,t),l=!1},d(t){t&&r(e),N(n),N(o)}}}function Rn(t){let e,n,i=t[0]&&Fn(t);return{c(){i&&i.c(),e=S()},m(t,o){i&&i.m(t,o),u(t,e,o),n=!0},p(t,[n]){t[0]?i?(i.p(t,n),1&n&&g(i,1)):(i=Fn(t),i.c(),g(i,1),i.m(e.parentNode,e)):i&&(z(),m(i,1,1,()=>{i=null}),M())},i(t){n||(g(i),n=!0)},o(t){m(i),n=!1},d(t){t&&r(e),i&&i.d(t)}}}function Ln(t,e,n){let{$$slots:i={},$$scope:o}=e;const l=K();let r,{placement:s="bottom"}=e,{full:c=!1}=e,{canexpand:a=!1}=e,{isexpand:u=!1}=e,d=null,{show:f,element:h,elexpand:m=!1,transparent:g=!1,padding:w=2}=e;function b(){f&&(n(1,u=!u),u?(r&&(d={top:r.style.top,left:r.style.left,width:r.style.width,height:r.style.height,zIndex:r.style.zIndex,position:r.style.position}),x()):function(){r&&d&&Object.assign(r.style,d);v()}())}function x(){if(!r)return;let t=m&&m.getBoundingClientRect?m.getBoundingClientRect():null;Object.assign(r.style,{position:"fixed",top:t?t.top+"px":"0px",left:t?t.left+"px":"0px",width:t?t.width+"px":"100vw",height:t?t.height+"px":"100vh",zIndex:1e3})}async function v(){if(f&&h){if(await X(),u)return void x();We(h,r,{placement:s,middleware:[Ye(4*w),qe(),Ue({padding:4*w})]}).then(({x:t,y:e,placement:n,middlewareData:i})=>{let o={top:`${e}px`,zIndex:1e3};c||(o.left=`${t}px`),Object.assign(r.style,o)})}else n(0,f=!1)}return t.$$set=t=>{"placement"in t&&n(7,s=t.placement),"full"in t&&n(8,c=t.full),"canexpand"in t&&n(2,a=t.canexpand),"isexpand"in t&&n(1,u=t.isexpand),"show"in t&&n(0,f=t.show),"element"in t&&n(9,h=t.element),"elexpand"in t&&n(10,m=t.elexpand),"transparent"in t&&n(3,g=t.transparent),"padding"in t&&n(11,w=t.padding),"$$scope"in t&&n(13,o=t.$$scope)},t.$$.update=()=>{641&t.$$.dirty&&v()},[f,u,a,g,r,l,b,s,c,h,m,w,function(){n(0,f=!1)},o,i,()=>{n(0,f=!1),l("close")},()=>{n(0,f=!1),l("close")},()=>{b(),l("expand",u)},function(t){p[t?"unshift":"push"](()=>{r=t,n(4,r)})}]}class Bn extends t{constructor(t){super(),e(this,t,Ln,Rn,n,{placement:7,full:8,canexpand:2,isexpand:1,show:0,element:9,elexpand:10,transparent:3,padding:11,close:12})}get close(){return this.$$.ctx[12]}}function Hn(t){let e,n;return e=new pn({props:{tooltip:t[1],$$slots:{default:[Vn]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(t,i){O(e,t,i),n=!0},p(t,n){const i={};2&n&&(i.tooltip=t[1]),273416188&n&&(i.$$scope={dirty:n,ctx:t}),e.$set(i)},i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){N(e,t)}}}function Pn(t){let e,n;return{c(){e=f("div"),c(e,"class","btneffect")},m(t,n){u(t,e,n)},p(e,n){t=e},i(i){i&&(n||E(()=>{n=C(e,et,{duration:t[0]}),n.start()}))},o:l,d(t){t&&r(e)}}}function Vn(t){let e,n,i,o,l,s,a,p,_=t[17]&&Pn(t);const S=t[27].default,z=h(S,t,t[28],null),M=z||function(t){let e,n,i,o=t[20](t[19])+"";return{c(){e=f("div"),n=f("div"),i=k(o),c(e,"class","flex flex-row space-x-2")},m(t,o){u(t,e,o),$(e,n),$(n,i)},p(t,e){524288&e&&o!==(o=t[20](t[19])+"")&&w(i,o)},d(t){t&&r(e)}}}(t);return{c(){e=f("button"),_&&_.c(),n=D(),M&&M.c(),c(e,"aria-label",i=t[19]||"btn"),c(e,"class",o=(t[22].class||"")+" btn overflow-hidden "+(t[2]?"text-left-px-2":"")),c(e,"style",l=t[2]?"justify-ontent: left; width:fit-content;height:fit-content;":""),y(e,"fix",t[11]),y(e,"fixl",t[12]),y(e,"alt",t[3]),y(e,"warning",t[8]),y(e,"black",t[5]),y(e,"gray",t[7]),y(e,"danger",t[9]),y(e,"link",t[4]),y(e,"full",t[13]),y(e,"xs",t[15]),y(e,"sm",t[14]),y(e,"lg",t[16]),y(e,"white",t[6]),y(e,"readonly",t[10])},m(i,o){u(i,e,o),_&&_.m(e,null),$(e,n),M&&M.m(e,null),s=!0,a||(p=d(e,"click",A(t[21])),a=!0)},p(t,r){t[17]?_?131072&r&&g(_,1):(_=Pn(t),_.c(),g(_,1),_.m(e,n)):_&&(_.d(1),_=null),z?z.p&&(!s||268435456&r)&&b(z,S,t,t[28],s?v(S,t[28],r,null):x(t[28]),null):M&&M.p&&(!s||524288&r)&&M.p(t,s?r:-1),(!s||524288&r&&i!==(i=t[19]||"btn"))&&c(e,"aria-label",i),(!s||4194308&r&&o!==(o=(t[22].class||"")+" btn overflow-hidden "+(t[2]?"text-left-px-2":"")))&&c(e,"class",o),(!s||4&r&&l!==(l=t[2]?"justify-ontent: left; width:fit-content;height:fit-content;":""))&&c(e,"style",l),(!s||4196356&r)&&y(e,"fix",t[11]),(!s||4198404&r)&&y(e,"fixl",t[12]),(!s||4194316&r)&&y(e,"alt",t[3]),(!s||4194564&r)&&y(e,"warning",t[8]),(!s||4194340&r)&&y(e,"black",t[5]),(!s||4194436&r)&&y(e,"gray",t[7]),(!s||4194820&r)&&y(e,"danger",t[9]),(!s||4194324&r)&&y(e,"link",t[4]),(!s||4202500&r)&&y(e,"full",t[13]),(!s||4227076&r)&&y(e,"xs",t[15]),(!s||4210692&r)&&y(e,"sm",t[14]),(!s||4259844&r)&&y(e,"lg",t[16]),(!s||4194372&r)&&y(e,"white",t[6]),(!s||4195332&r)&&y(e,"readonly",t[10])},i(t){s||(g(_),g(M,t),s=!0)},o(t){m(M,t),s=!1},d(t){t&&r(e),_&&_.d(),M&&M.d(t),a=!1,p()}}}function Yn(t){let e,n,i=t[18]&&Hn(t);return{c(){i&&i.c(),e=S()},m(t,o){i&&i.m(t,o),u(t,e,o),n=!0},p(t,[n]){t[18]?i?(i.p(t,n),262144&n&&g(i,1)):(i=Hn(t),i.c(),g(i,1),i.m(e.parentNode,e)):i&&(z(),m(i,1,1,()=>{i=null}),M())},i(t){n||(g(i),n=!0)},o(t){m(i),n=!1},d(t){t&&r(e),i&&i.d(t)}}}function Un(t,e,n){let l,r,{$$slots:s={},$$scope:c}=e;const{_:a,P:u}=on(),d=K();let{duration:f=300}=e,{text:p="",title:h="",value:m="",auth:g="",tooltip:w="",left:b=!1,alt:x=!1,link:v=!1,black:y=!1,white:$=!1,gray:k=!1,warning:D=!1,danger:_=!1,readonly:S=!1,fix:z=!1,fixl:M=!1,full:j=!1,sm:E=!1,xs:C=!1,lg:T=!1}=e,N=!1;return t.$$set=t=>{n(22,e=i(i({},e),o(t))),"duration"in t&&n(0,f=t.duration),"text"in t&&n(23,p=t.text),"title"in t&&n(24,h=t.title),"value"in t&&n(25,m=t.value),"auth"in t&&n(26,g=t.auth),"tooltip"in t&&n(1,w=t.tooltip),"left"in t&&n(2,b=t.left),"alt"in t&&n(3,x=t.alt),"link"in t&&n(4,v=t.link),"black"in t&&n(5,y=t.black),"white"in t&&n(6,$=t.white),"gray"in t&&n(7,k=t.gray),"warning"in t&&n(8,D=t.warning),"danger"in t&&n(9,_=t.danger),"readonly"in t&&n(10,S=t.readonly),"fix"in t&&n(11,z=t.fix),"fixl"in t&&n(12,M=t.fixl),"full"in t&&n(13,j=t.full),"sm"in t&&n(14,E=t.sm),"xs"in t&&n(15,C=t.xs),"lg"in t&&n(16,T=t.lg),"$$scope"in t&&n(28,c=t.$$scope)},t.$$.update=()=>{58720256&t.$$.dirty&&n(19,l=p||h||m||".."),67108864&t.$$.dirty&&n(18,r=!g||u.isauth(g))},e=o(e),[f,w,b,x,v,y,$,k,D,_,S,z,M,j,E,C,T,N,r,l,a,async function(t){S||(n(17,N=!0),await X(),d("click",t.target),setTimeout(()=>{n(17,N=!1)},f))},e,p,h,m,g,s,c]}class qn extends t{constructor(t){super(),e(this,t,Un,Yn,n,{duration:0,text:23,title:24,value:25,auth:26,tooltip:1,left:2,alt:3,link:4,black:5,white:6,gray:7,warning:8,danger:9,readonly:10,fix:11,fixl:12,full:13,sm:14,xs:15,lg:16})}}function Gn(t){let e,n,i,o,l,p;return{c(){e=f("div"),n=f("input"),n.readOnly=t[2],c(n,"type","text"),c(n,"ref","input"),c(n,"class",i="w-full outline-none "+(t[4]?"pl-1 group-hover:bg-white bg-c-50":"bg-white")),c(n,"placeholder",t[5]),c(e,"class",o="text-black border border-c-border rounded-md px-2 md:px-10 flex "+(t[4]?"border-1.5 bg-c-50 hover:bg-white group":"bg-white")),y(e,"py-1",!t[3]),y(e,"text-sm",t[3]),y(e,"py-0.5",t[3]),y(e,"py-3",t[4]),y(e,"rounded-3xl",t[4])},m(i,o){u(i,e,o),$(e,n),a(n,t[0]),l||(p=[d(n,"input",t[12]),d(n,"keyup",t[8])],l=!0)},p(t,l){4&l&&(n.readOnly=t[2]),16&l&&i!==(i="w-full outline-none "+(t[4]?"pl-1 group-hover:bg-white bg-c-50":"bg-white"))&&c(n,"class",i),32&l&&c(n,"placeholder",t[5]),1&l&&n.value!==t[0]&&a(n,t[0]),16&l&&o!==(o="text-black border border-c-border rounded-md px-2 md:px-10 flex "+(t[4]?"border-1.5 bg-c-50 hover:bg-white group":"bg-white"))&&c(e,"class",o),24&l&&y(e,"py-1",!t[3]),24&l&&y(e,"text-sm",t[3]),24&l&&y(e,"py-0.5",t[3]),16&l&&y(e,"py-3",t[4]),16&l&&y(e,"rounded-3xl",t[4])},d(t){t&&r(e),l=!1,s(p)}}}function Wn(t){let e,n,i,o;return{c(){e=f("div"),n=f("input"),n.readOnly=t[2],c(n,"type","text"),c(n,"ref","input"),c(n,"class","w-full outline-none bg-transparent"),c(n,"placeholder",t[5]),c(e,"class","text-black border border-c-border rounded-md px-2 md:px-10 flex hover:bg-white focus-within:bg-white"),y(e,"py-1",!t[3]),y(e,"text-sm",t[3]),y(e,"py-0.5",t[3]),y(e,"py-3",t[4]),y(e,"rounded-3xl",t[4])},m(l,r){u(l,e,r),$(e,n),a(n,t[0]),i||(o=[d(n,"input",t[11]),d(n,"keyup",t[8])],i=!0)},p(t,i){4&i&&(n.readOnly=t[2]),32&i&&c(n,"placeholder",t[5]),1&i&&n.value!==t[0]&&a(n,t[0]),8&i&&y(e,"py-1",!t[3]),8&i&&y(e,"text-sm",t[3]),8&i&&y(e,"py-0.5",t[3]),16&i&&y(e,"py-3",t[4]),16&i&&y(e,"rounded-3xl",t[4])},d(t){t&&r(e),i=!1,s(o)}}}function Xn(t){let e,n,i,o,s;return n=new en({props:{img:"close",size:6,color:"text-c-200"}}),{c(){e=f("button"),F(n.$$.fragment),c(e,"class","hidden md:block md:absolute vcenter right-2 cursor-pointer")},m(l,r){u(l,e,r),O(n,e,null),i=!0,o||(s=d(e,"click",t[13]),o=!0)},p:l,i(t){i||(g(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&r(e),N(n),o=!1,s()}}}function Kn(t){let e,n,i,o,l,a,p,h,w,b;function x(t,e){return t[6]?Wn:Gn}let v=x(t),k=v(t);o=new en({props:{img:"search",size:t[3]?6:8,color:t[0]&&t[1]?"text-black":"text-c-200"}});let _=t[0]&&Xn(t);return{c(){e=f("div"),k.c(),n=D(),i=f("button"),F(o.$$.fragment),a=D(),_&&_.c(),c(i,"class",l="hidden md:block md:absolute vcenter "+(t[4]?"left-3":"left-1")),y(i,"cursor-pointer",t[0]&&t[1]),c(e,"class",p="relative "+(t[10].class||""))},m(l,r){u(l,e,r),k.m(e,null),$(e,n),$(e,i),O(o,i,null),$(e,a),_&&_.m(e,null),h=!0,w||(b=[d(i,"click",t[9]),d(i,"keypress",Zn)],w=!0)},p(t,[r]){v===(v=x(t))&&k?k.p(t,r):(k.d(1),k=v(t),k&&(k.c(),k.m(e,n)));const s={};8&r&&(s.size=t[3]?6:8),3&r&&(s.color=t[0]&&t[1]?"text-black":"text-c-200"),o.$set(s),(!h||16&r&&l!==(l="hidden md:block md:absolute vcenter "+(t[4]?"left-3":"left-1")))&&c(i,"class",l),(!h||19&r)&&y(i,"cursor-pointer",t[0]&&t[1]),t[0]?_?(_.p(t,r),1&r&&g(_,1)):(_=Xn(t),_.c(),g(_,1),_.m(e,null)):_&&(z(),m(_,1,1,()=>{_=null}),M()),(!h||1024&r&&p!==(p="relative "+(t[10].class||"")))&&c(e,"class",p)},i(t){h||(g(o.$$.fragment,t),g(_),h=!0)},o(t){m(o.$$.fragment,t),m(_),h=!1},d(t){t&&r(e),k.d(),N(o),_&&_.d(),w=!1,s(b)}}}const Zn=()=>{};function Jn(t,e,n){const l=K();let{evidenzia:r=!1,readonly:s=!1,sm:c=!1,lg:a=!1,value:u="",placeholder:d="Cerca",dtable:f=!1}=e;function p(){s||(l("click",u),l("cerca",u))}return t.$$set=t=>{n(10,e=i(i({},e),o(t))),"evidenzia"in t&&n(1,r=t.evidenzia),"readonly"in t&&n(2,s=t.readonly),"sm"in t&&n(3,c=t.sm),"lg"in t&&n(4,a=t.lg),"value"in t&&n(0,u=t.value),"placeholder"in t&&n(5,d=t.placeholder),"dtable"in t&&n(6,f=t.dtable)},e=o(e),[u,r,s,c,a,d,f,l,function(t){s||("Escape"==t.key&&n(0,u=""),l("input",t.target,u),"Enter"!=t.key&&"Escape"!=t.key||p())},p,e,function(){u=this.value,n(0,u)},function(){u=this.value,n(0,u)},()=>{n(0,u=""),l("input",""),l("click")}]}class Qn extends t{constructor(t){super(),e(this,t,Jn,Kn,n,{evidenzia:1,readonly:2,sm:3,lg:4,value:0,placeholder:5,dtable:6})}}function ti(t){let e,n,i,o,l,a,p,w,y,k,_;const S=t[7].default,z=h(S,t,t[6],null),M=z||function(t){let e,n,i;return n=new Dn({props:{id:t[0]}}),{c(){e=f("span"),F(n.$$.fragment),c(e,"class","btn primary cursor-pointer")},m(t,o){u(t,e,o),O(n,e,null),i=!0},p(t,e){const i={};1&e&&(i.id=t[0]),n.$set(i)},i(t){i||(g(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&r(e),N(n)}}}(t);return{c(){e=f("button"),M&&M.c(),n=D(),i=f("label"),o=f("input"),c(o,"type","file"),o.multiple=t[2],c(o,"accept",t[1]),c(o,"class","absolute inset-0 opacity-0 cursor-pointer"),c(o,"webkitdirectory",l=t[3]?"":void 0),c(o,"directory",a=t[3]?"":void 0),c(i,"name",p="file"+t[0]),c(e,"class",w=`relative cursor-pointer ${t[5].class||""}`)},m(l,r){u(l,e,r),M&&M.m(e,null),$(e,n),$(e,i),$(i,o),y=!0,k||(_=[d(o,"click",A(ei)),d(o,"change",A(t[8]))],k=!0)},p(t,[n]){z?z.p&&(!y||64&n)&&b(z,S,t,t[6],y?v(S,t[6],n,null):x(t[6]),null):M&&M.p&&(!y||1&n)&&M.p(t,y?n:-1),(!y||4&n)&&(o.multiple=t[2]),(!y||2&n)&&c(o,"accept",t[1]),(!y||8&n&&l!==(l=t[3]?"":void 0))&&c(o,"webkitdirectory",l),(!y||8&n&&a!==(a=t[3]?"":void 0))&&c(o,"directory",a),(!y||1&n&&p!==(p="file"+t[0]))&&c(i,"name",p),(!y||32&n&&w!==(w=`relative cursor-pointer ${t[5].class||""}`))&&c(e,"class",w)},i(t){y||(g(M,t),y=!0)},o(t){m(M,t),y=!1},d(t){t&&r(e),M&&M.d(t),k=!1,s(_)}}}const ei=()=>{};function ni(t,e,n){let{$$slots:l={},$$scope:r}=e,{value:s="file",accept:c="image/*,.pdf,.xlsx,.txt,.xls,.md,.log,.json,.yaml,.glb,.gltf,.3ds,.stl,.obj",multiple:a=!1,directory:u=!1}=e;const d=K();return t.$$set=t=>{n(5,e=i(i({},e),o(t))),"value"in t&&n(0,s=t.value),"accept"in t&&n(1,c=t.accept),"multiple"in t&&n(2,a=t.multiple),"directory"in t&&n(3,u=t.directory),"$$scope"in t&&n(6,r=t.$$scope)},e=o(e),[s,c,a,u,d,e,r,l,t=>{d("click",t.target.files)}]}class ii extends t{constructor(t){super(),e(this,t,ni,ti,n,{value:0,accept:1,multiple:2,directory:3})}}function oi(t){let e,n;return{c(){e=f("span"),n=k(t[2]),c(e,"class","lowercase pl-2 text-c-200"),y(e,"text-c-base",t[7])},m(t,i){u(t,e,i),$(e,n)},p(t,i){4&i&&w(n,t[2]),128&i&&y(e,"text-c-base",t[7])},d(t){t&&r(e)}}}function li(t){let e,n,i,o,s,a,p,h,m,g,b,x=t[2]&&oi(t);return{c(){e=f("div"),n=f("input"),o=D(),s=f("label"),x&&x.c(),a=D(),p=f("span"),h=k(t[1]),c(n,"tabindex","-1"),c(n,"type","checkbox"),n.disabled=t[6],c(n,"id",t[9]),n.checked=t[7],c(n,"class",i=t[5]?"checkbox":"toggle"),y(n,"sm",t[3]),y(n,"xs",t[4]),c(p,"class","pl-1"),c(s,"class","text-sm font-base"),c(s,"for",t[9]),y(s,"font-bold",t[0]),c(e,"class",m=t[10].class||"")},m(i,l){u(i,e,l),$(e,n),$(e,o),$(e,s),x&&x.m(s,null),$(s,a),$(s,p),$(p,h),g||(b=d(n,"click",A(t[8])),g=!0)},p(t,[o]){64&o&&(n.disabled=t[6]),128&o&&(n.checked=t[7]),32&o&&i!==(i=t[5]?"checkbox":"toggle")&&c(n,"class",i),40&o&&y(n,"sm",t[3]),48&o&&y(n,"xs",t[4]),t[2]?x?x.p(t,o):(x=oi(t),x.c(),x.m(s,a)):x&&(x.d(1),x=null),2&o&&w(h,t[1]),1&o&&y(s,"font-bold",t[0]),1024&o&&m!==(m=t[10].class||"")&&c(e,"class",m)},i:l,o:l,d(t){t&&r(e),x&&x.d(),g=!1,b()}}}function ri(t,e,n){let l;const r=K();let{value:s=0}=e,{truevalue:c=1}=e,{falsevalue:a=0}=e,{bold:u=!1}=e,{label:d=""}=e,{labcod:f=""}=e,{sm:p=!1}=e,{xs:h=!1}=e,{checkbox:m=!1}=e,{readonly:g=!1}=e;W(()=>{s!=c&&s!=a&&(n(11,s=a),r("click",{value:s}))});const w=Math.random().toString(36).substring(2,15);return t.$$set=t=>{n(10,e=i(i({},e),o(t))),"value"in t&&n(11,s=t.value),"truevalue"in t&&n(12,c=t.truevalue),"falsevalue"in t&&n(13,a=t.falsevalue),"bold"in t&&n(0,u=t.bold),"label"in t&&n(1,d=t.label),"labcod"in t&&n(2,f=t.labcod),"sm"in t&&n(3,p=t.sm),"xs"in t&&n(4,h=t.xs),"checkbox"in t&&n(5,m=t.checkbox),"readonly"in t&&n(6,g=t.readonly)},t.$$.update=()=>{6144&t.$$.dirty&&n(7,l=s==c)},e=o(e),[u,d,f,p,h,m,g,l,async function(t){t.stopPropagation(),t.target.checked?n(11,s=c):n(11,s=a),await X(),r("click",{value:s})},w,e,s,c,a]}class si extends t{constructor(t){super(),e(this,t,ri,li,n,{value:11,truevalue:12,falsevalue:13,bold:0,label:1,labcod:2,sm:3,xs:4,checkbox:5,readonly:6})}}const ci=t=>({}),ai=t=>({});function ui(t){let e,n;const i=t[11].popup,o=h(i,t,t[10],ai);return{c(){e=f("div"),o&&o.c(),c(e,"class","fixed"),c(e,"tabindex","-1")},m(i,l){u(i,e,l),o&&o.m(e,null),t[12](e),n=!0},p(t,e){o&&o.p&&(!n||1024&e)&&b(o,i,t,t[10],n?v(i,t[10],e,ci):x(t[10]),ai)},i(t){n||(g(o,t),n=!0)},o(t){m(o,t),n=!1},d(n){n&&r(e),o&&o.d(n),t[12](null)}}}function di(t){let e,n,i,o,l;const s=t[11].default,a=h(s,t,t[10],null);let d=t[2]&&ui(t);return{c(){e=f("div"),n=f("div"),a&&a.c(),i=D(),d&&d.c(),c(n,"class","z-10"),c(e,"class",o=t[3].class)},m(o,r){u(o,e,r),$(e,n),a&&a.m(n,null),$(e,i),d&&d.m(e,null),t[13](e),l=!0},p(t,[n]){a&&a.p&&(!l||1024&n)&&b(a,s,t,t[10],l?v(s,t[10],n,null):x(t[10]),null),t[2]?d?(d.p(t,n),4&n&&g(d,1)):(d=ui(t),d.c(),g(d,1),d.m(e,null)):d&&(z(),m(d,1,1,()=>{d=null}),M()),(!l||8&n&&o!==(o=t[3].class))&&c(e,"class",o)},i(t){l||(g(a,t),g(d),l=!0)},o(t){m(a,t),m(d),l=!1},d(n){n&&r(e),a&&a.d(n),d&&d.d(),t[13](null)}}}function fi(t){return!0}function pi(t,e,n){let l,r,{$$slots:s={},$$scope:c}=e,{theme:a}=e,u=!1,{fix:d}=e,{size:f}=e,{closeOnClickOutside:h=!0}=e;async function m(t){if(2==t&&(t=!u),t!==u&&(n(2,u=t),u)){await X();const t=a?180:r.offsetWidth;We(r,l,{placement:"bottom-start",middleware:[qe(),Ue({padding:0})]}).then(({x:e,y:n,placement:i,middlewareData:o})=>{Object.assign(l.style,{left:`${e}px`,top:`${n}px`,width:`${t}px`,zIndex:1e3}),d?Object.assign(l.style,{width:`${t}px`}):f&&Object.assign(l.style,{width:`${f}`})})}}const g=K();function w(t){r.contains(t.target)&&g("gotfocus")}function b(t){setTimeout(()=>{r&&r.contains(document.activeElement)||(m(!1),g("lostfocus"))},0)}function x(t){h&&u&&r&&l&&!r.contains(t.target)&&!l.contains(t.target)&&m(!1)}return W(()=>{r.addEventListener("focusin",w),r.addEventListener("focusout",b),h&&document.addEventListener("click",x)}),Z(()=>{r&&(r.removeEventListener("focusin",w),r.removeEventListener("focusout",b)),document.removeEventListener("click",x)}),t.$$set=t=>{n(3,e=i(i({},e),o(t))),"theme"in t&&n(4,a=t.theme),"fix"in t&&n(5,d=t.fix),"size"in t&&n(6,f=t.size),"closeOnClickOutside"in t&&n(7,h=t.closeOnClickOutside),"$$scope"in t&&n(10,c=t.$$scope)},e=o(e),[l,r,u,e,a,d,f,h,m,fi,c,s,function(t){p[t?"unshift":"push"](()=>{l=t,n(0,l)})},function(t){p[t?"unshift":"push"](()=>{r=t,n(1,r)})}]}class hi extends t{constructor(t){super(),e(this,t,pi,di,n,{theme:4,fix:5,size:6,closeOnClickOutside:7,openmenu:8,checkvisibility:9})}get openmenu(){return this.$$.ctx[8]}get checkvisibility(){return fi}}function mi(t){let e,n,i,o,l,a;const p=t[7].default,w=h(p,t,t[6],null);return{c(){e=f("button"),n=D(),i=f("button"),w&&w.c(),c(e,"aria-label","full"),c(e,"class","z-10 fixed inset-0 opacity-0"),c(i,"class","fixed"),c(i,"tabindex","-1")},m(r,s){u(r,e,s),u(r,n,s),u(r,i,s),w&&w.m(i,null),t[10](i),o=!0,l||(a=[d(e,"click",R(t[8])),d(e,"contextmenu",R(t[9])),d(i,"contextmenu",R(t[11]))],l=!0)},p(t,e){w&&w.p&&(!o||64&e)&&b(w,p,t,t[6],o?v(p,t[6],e,null):x(t[6]),null)},i(t){o||(g(w,t),o=!0)},o(t){m(w,t),o=!1},d(o){o&&(r(e),r(n),r(i)),w&&w.d(o),t[10](null),l=!1,s(a)}}}function gi(t){let e,n,i=t[0]&&mi(t);return{c(){i&&i.c(),e=S()},m(t,o){i&&i.m(t,o),u(t,e,o),n=!0},p(t,[n]){t[0]?i?(i.p(t,n),1&n&&g(i,1)):(i=mi(t),i.c(),g(i,1),i.m(e.parentNode,e)):i&&(z(),m(i,1,1,()=>{i=null}),M())},i(t){n||(g(i),n=!0)},o(t){m(i),n=!1},d(t){t&&r(e),i&&i.d(t)}}}function wi(t,e,n){let{$$slots:i={},$$scope:o}=e;const l=K();let r,{show:s=!1,mouseX:c=0,mouseY:a=0}=e;async function u(){if(!s)return;if(await X(),!r)return;await X();We({getBoundingClientRect:()=>({x:c,y:a,width:0,height:0,top:a,left:c,right:c,bottom:a})},r,{placement:"bottom-start",middleware:[Ye(10),qe(),Ue()]}).then(({x:t,y:e,placement:n})=>{Object.assign(r.style,{left:`${t}px`,top:`${e}px`,zIndex:1e3})})}return t.$$set=t=>{"show"in t&&n(0,s=t.show),"mouseX"in t&&n(3,c=t.mouseX),"mouseY"in t&&n(4,a=t.mouseY),"$$scope"in t&&n(6,o=t.$$scope)},t.$$.update=()=>{25&t.$$.dirty&&u()},[s,r,l,c,a,u,o,i,()=>{n(0,s=!1),l("close")},()=>{n(0,s=!1),l("close")},function(t){p[t?"unshift":"push"](()=>{r=t,n(1,r)})},()=>{n(0,s=!1),l("close")}]}class bi extends t{constructor(t){super(),e(this,t,wi,gi,n,{show:0,mouseX:3,mouseY:4,openmenu:5})}get openmenu(){return this.$$.ctx[5]}}function xi(t){return t&&t.D&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var vi,yi={exports:{}};var $i=xi(vi?yi.exports:(vi=1,yi.exports=function(){function t(t,e,n,i,o,l){if(!/^[1-8]$/.test(e))throw new Error("orientation should be [1-8]");null==n&&(n=0),null==i&&(i=0),null==o&&(o=t.width),null==l&&(l=t.height);var r=document.createElement("canvas"),s=r.getContext("2d");switch(r.width=o,r.height=l,s.save(),+e){case 1:break;case 2:s.translate(o,0),s.scale(-1,1);break;case 3:s.translate(o,l),s.rotate(1*Math.PI);break;case 4:s.translate(0,l),s.scale(1,-1);break;case 5:r.width=l,r.height=o,s.rotate(.5*Math.PI),s.scale(1,-1);break;case 6:r.width=l,r.height=o,s.rotate(.5*Math.PI),s.translate(0,-l);break;case 7:r.width=l,r.height=o,s.rotate(1.5*Math.PI),s.translate(-o,l),s.scale(1,-1);break;case 8:r.width=l,r.height=o,s.translate(0,o),s.rotate(1.5*Math.PI)}return s.drawImage(t,n,i,o,l),s.restore(),r}return{drawImage:t}}()));function ki(t,e,n,i){return{x:Di(t.x,e.width,n.width,i),y:Di(t.y,e.height,n.height,i)}}function Di(t,e,n,i){const o=e*i/2-n/2;return Math.min(o,Math.max(t,-o))}function _i(t,e){return Math.sqrt(Math.pow(t.y-e.y,2)+Math.pow(t.x-e.x,2))}function Si(t,e){return{x:(e.x+t.x)/2,y:(e.y+t.y)/2}}const{window:zi}=V;function Mi(t){let e;return{c(){e=f("div"),c(e,"class","cropper_area"),_(e,"width",t[7].width+"px"),_(e,"height",t[7].height+"px"),c(e,"data-testid","cropper"),y(e,"round","round"===t[4])},m(t,n){u(t,e,n)},p(t,n){128&n[0]&&_(e,"width",t[7].width+"px"),128&n[0]&&_(e,"height",t[7].height+"px"),16&n[0]&&y(e,"round","round"===t[4])},d(t){t&&r(e)}}}function ji(t){let e,n,i,o,l,a,p,h,w,b,x,v,y=t[7]&&Mi(t);return h=new en({props:{img:"rotate_right",mat:!0,size:8}}),{c(){e=f("div"),n=f("div"),i=f("img"),l=D(),y&&y.c(),a=D(),p=f("button"),F(h.$$.fragment),c(i,"class","cropper_image"),P(i.src,o=t[1])||c(i,"src",o),c(i,"alt",""),_(i,"transform","translate("+t[2].x+"px, "+t[2].y+"px) scale("+t[0]+")"),c(i,"crossorigin",t[5]),c(n,"class","cropper_container"),c(n,"data-testid","container"),c(p,"class","absolute top-0 right-0 p-1 text-black hover:text-white z-10 cursor-pointer"),c(e,"style",w=`position: relative; width: ${t[3]}px; height: ${t[3]}px;`)},m(o,r){u(o,e,r),$(e,n),$(n,i),t[24](i),$(n,l),y&&y.m(n,null),t[25](n),$(e,a),$(e,p),O(h,p,null),b=!0,x||(v=[d(zi,"resize",t[11]),d(i,"load",t[10]),d(n,"mousedown",R(t[12])),d(n,"touchstart",R(t[13])),d(n,"wheel",R(t[14])),d(n,"gesturestart",R(t[22])),d(n,"gesturechange",R(t[23])),d(p,"click",A(t[9]))],x=!0)},p(t,l){(!b||2&l[0]&&!P(i.src,o=t[1]))&&c(i,"src",o),(!b||5&l[0])&&_(i,"transform","translate("+t[2].x+"px, "+t[2].y+"px) scale("+t[0]+")"),(!b||32&l[0])&&c(i,"crossorigin",t[5]),t[7]?y?y.p(t,l):(y=Mi(t),y.c(),y.m(n,null)):y&&(y.d(1),y=null),(!b||8&l[0]&&w!==(w=`position: relative; width: ${t[3]}px; height: ${t[3]}px;`))&&c(e,"style",w)},i(t){b||(g(h.$$.fragment,t),b=!0)},o(t){m(h.$$.fragment,t),b=!1},d(n){n&&r(e),t[24](null),y&&y.d(),t[25](null),N(h),x=!1,s(v)}}}function Ei(t,e,n){let i,o,l,r,s,c,a,{size:u=200}=e,{cropScale:d=1}=e,{image:f}=e,{crop:h={x:0,y:0}}=e,{zoom:m=1}=e,{aspect:g=1}=e,{minZoom:w=1}=e,{maxZoom:b=4}=e,{cropShape:x="round"}=e,{zoomSpeed:v=1}=e,{crossOrigin:y}=e,{restrictPosition:$=!0}=e,k={width:0,height:0,naturalWidth:0,naturalHeight:0},D={x:0,y:0},_={x:0,y:0},S=0;function z(){var t=k.width,e=k.height;return t&&e&&g?(t/e>g?e=t/g:t=e*g,{width:t,height:e}):k}const M=K();W(()=>{s&&s.complete&&E()}),Z(()=>{j()});const j=()=>{document.removeEventListener("mousemove",O),document.removeEventListener("mouseup",R),document.removeEventListener("touchmove",A),document.removeEventListener("touchend",R)},E=()=>{C(),P()},C=()=>{s&&(k={width:s.width,height:s.height,naturalWidth:s.naturalWidth,naturalHeight:s.naturalHeight},n(7,o=i)),l&&(r=l.getBoundingClientRect())},T=t=>({x:Number(t.clientX),y:Number(t.clientY)}),N=t=>({x:Number(t.clientX),y:Number(t.clientY)}),O=t=>I(T(t)),A=t=>{t.preventDefault(),2===t.touches.length?B(t):1===t.touches.length&&I(N(t.touches[0]))},F=({x:t,y:e})=>{D={x:t,y:e},_={x:h.x,y:h.y}},I=({x:t,y:e})=>{c&&window.cancelAnimationFrame(c),c=window.requestAnimationFrame(()=>{if(void 0===t||void 0===e)return;const i=t-D.x,l=e-D.y,r={x:_.x+i,y:_.y+l};n(2,h=$?ki(r,z(),o,m):r)})},R=()=>{j(),P()},L=t=>{const e=N(t.touches[0]),n=N(t.touches[1]);S=_i(e,n),F(Si(e,n))},B=t=>{const e=N(t.touches[0]),n=N(t.touches[1]),i=Si(e,n);I(i),a&&window.cancelAnimationFrame(a),a=window.requestAnimationFrame(()=>{const t=_i(e,n);H(m*(t/S),i),S=t})},H=(t,e)=>{const i=(({x:t,y:e})=>{if(!r)throw new Error("The Cropper is not mounted");return{x:r.width/2-(t-r.left),y:r.height/2-(e-r.top)}})(e),l=(({x:t,y:e})=>({x:(t+h.x)/m,y:(e+h.y)/m}))(i);n(0,m=Math.min(b,Math.max(t,w)));const s={x:l.x*m-i.x,y:l.y*m-i.y};n(2,h=$?ki(s,z(),o,m):s)},P=()=>{o&&0!==o.width&&M("cropcomplete",{size:u,zoom:m,aspect:g,crop:h,image:f,imageSize:k,cropScale:d})};return t.$$set=t=>{"size"in t&&n(3,u=t.size),"cropScale"in t&&n(15,d=t.cropScale),"image"in t&&n(1,f=t.image),"crop"in t&&n(2,h=t.crop),"zoom"in t&&n(0,m=t.zoom),"aspect"in t&&n(16,g=t.aspect),"minZoom"in t&&n(17,w=t.minZoom),"maxZoom"in t&&n(18,b=t.maxZoom),"cropShape"in t&&n(4,x=t.cropShape),"zoomSpeed"in t&&n(19,v=t.zoomSpeed),"crossOrigin"in t&&n(5,y=t.crossOrigin),"restrictPosition"in t&&n(20,$=t.restrictPosition)},t.$$.update=()=>{98312&t.$$.dirty[0]&&n(21,i={width:u*d,height:u*d/g}),2162752&t.$$.dirty[0]&&s&&n(7,o=i||function(t,e,n){return t>=e*n?{width:e*n,height:e}:{width:t,height:t/n}}(s.width,s.height,g)),1&t.$$.dirty[0]&&m&&P()},[m,f,h,u,x,y,s,o,l,async()=>{if(f){var t=new Image(k.naturalWidth,k.naturalHeight);t.src=f;var e=$i.drawImage(t,6);n(1,f=e.toDataURL()),await X(),C(),P()}},E,C,t=>{document.addEventListener("mousemove",O),document.addEventListener("mouseup",R),F(T(t))},t=>{document.addEventListener("touchmove",A,{passive:!1}),document.addEventListener("touchend",R),2===t.touches.length?L(t):1===t.touches.length&&F(N(t.touches[0]))},t=>{const e=T(t),n=m-t.deltaY*v/200;H(n,e)},d,g,w,b,v,$,i,function(e){Y.call(this,t,e)},function(e){Y.call(this,t,e)},function(t){p[t?"unshift":"push"](()=>{s=t,n(6,s)})},function(t){p[t?"unshift":"push"](()=>{l=t,n(8,l)})}]}class Ci extends t{constructor(t){super(),e(this,t,Ei,ji,n,{size:3,cropScale:15,image:1,crop:2,zoom:0,aspect:16,minZoom:17,maxZoom:18,cropShape:4,zoomSpeed:19,crossOrigin:5,restrictPosition:20},null,[-1,-1])}}var Ti,Ni={exports:{}};var Oi,Ai=(Ti||(Ti=1,Ni.exports=function(){var t={d:function(e,n){for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}},e={};t.d(e,{default:function(){return P}});var n={days:"days",months:"months",years:"years",day:"day",month:"month",year:"year",eventChangeViewDate:"changeViewDate",eventChangeCurrentView:"changeCurrentView",eventChangeFocusDate:"changeFocusDate",eventChangeSelectedDate:"changeSelectedDate",eventChangeTime:"changeTime",eventChangeLastSelectedDate:"changeLastSelectedDate",actionSelectDate:"selectDate",actionUnselectDate:"unselectDate",cssClassWeekend:"-weekend-"},i={classes:"",inline:!1,locale:{days:["ΠΠΎΡΠΊΡΠ΅ΡΠ΅Π½ΡΠ΅","ΠΠΎΠ½Π΅Π΄Π΅Π»ΡΠ½ΠΈΠΊ","ΠΡΠΎΡΠ½ΠΈΠΊ","Π‘ΡΠ΅Π΄Π°","Π§Π΅ΡΠ²Π΅ΡΠ³","ΠΡΡΠ½ΠΈΡΠ°","Π‘ΡΠ±Π±ΠΎΡΠ°"],daysShort:["ΠΠΎΡ","ΠΠΎΠ½","ΠΡΠΎ","Π‘ΡΠ΅","Π§Π΅Ρ","ΠΡΡ","Π‘ΡΠ±"],daysMin:["ΠΡ","ΠΠ½","ΠΡ","Π‘Ρ","Π§Ρ","ΠΡ","Π‘Π±"],months:["Π―Π½Π²Π°ΡΡ","Π€Π΅Π²ΡΠ°Π»Ρ","ΠΠ°ΡΡ","ΠΠΏΡΠ΅Π»Ρ","ΠΠ°ΠΉ","ΠΡΠ½Ρ","ΠΡΠ»Ρ","ΠΠ²Π³ΡΡΡ","Π‘Π΅Π½ΡΡΠ±ΡΡ","ΠΠΊΡΡΠ±ΡΡ","ΠΠΎΡΠ±ΡΡ","ΠΠ΅ΠΊΠ°Π±ΡΡ"],monthsShort:["Π―Π½Π²","Π€Π΅Π²","ΠΠ°Ρ","ΠΠΏΡ","ΠΠ°ΠΉ","ΠΡΠ½","ΠΡΠ»","ΠΠ²Π³","Π‘Π΅Π½","ΠΠΊΡ","ΠΠΎΡ","ΠΠ΅ΠΊ"],today:"Π‘Π΅Π³ΠΎΠ΄Π½Ρ",clear:"ΠΡΠΈΡΡΠΈΡΡ",dateFormat:"dd.MM.yyyy",timeFormat:"HH:mm",firstDay:1},startDate:new Date,firstDay:"",weekends:[6,0],dateFormat:"",altField:"",altFieldDateFormat:"T",toggleSelected:!0,keyboardNav:!0,selectedDates:!1,container:"",isMobile:!1,visible:!1,position:"bottom left",offset:12,view:n.days,minView:n.days,showOtherMonths:!0,selectOtherMonths:!0,moveToOtherMonthsOnSelect:!0,showOtherYears:!0,selectOtherYears:!0,moveToOtherYearsOnSelect:!0,minDate:"",maxDate:"",disableNavWhenOutOfRange:!0,multipleDates:!1,multipleDatesSeparator:", ",range:!1,dynamicRange:!0,buttons:!1,monthsField:"monthsShort",showEvent:"focus",autoClose:!1,fixedHeight:!1,prevHtml:'<svg><path d="M 17,12 l -5,5 l 5,5"></path></svg>',nextHtml:'<svg><path d="M 14,12 l 5,5 l -5,5"></path></svg>',navTitles:{days:"MMMM, <i>yyyy</i>",months:"yyyy",years:"yyyy1 - yyyy2"},timepicker:!1,onlyTimepicker:!1,dateTimeSeparator:" ",timeFormat:"",minHours:0,maxHours:24,minMinutes:0,maxMinutes:59,hoursStep:1,minutesStep:1,onSelect:!1,onChangeViewDate:!1,onChangeView:!1,onRenderCell:!1,onShow:!1,onHide:!1,onClickDayName:!1};function o(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return"string"==typeof t?e.querySelector(t):t}function l(){let{tagName:t="div",className:e="",innerHtml:n="",id:i="",attrs:o={}}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=document.createElement(t);return e&&l.classList.add(...e.split(" ")),i&&(l.id=i),n&&(l.innerHTML=n),o&&r(l,o),l}function r(t,e){for(let[n,i]of Object.entries(e))void 0!==i&&t.setAttribute(n,i);return t}function s(t){return new Date(t.getFullYear(),t.getMonth()+1,0).getDate()}function c(t){let e=t.getHours(),{hours:n,dayPeriod:i}=a(e);return{year:t.getFullYear(),month:t.getMonth(),fullMonth:t.getMonth()+1<10?"0"+(t.getMonth()+1):t.getMonth()+1,date:t.getDate(),fullDate:t.getDate()<10?"0"+t.getDate():t.getDate(),day:t.getDay(),hours:e,fullHours:u(e),hours12:n,dayPeriod:i,fullHours12:u(n),minutes:t.getMinutes(),fullMinutes:t.getMinutes()<10?"0"+t.getMinutes():t.getMinutes()}}function a(t){return{dayPeriod:t>11?"pm":"am",hours:t%12==0?12:t%12}}function u(t){return t<10?"0"+t:t}function d(t){let e=10*Math.floor(t.getFullYear()/10);return[e,e+9]}function f(){let t=[];for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return n.forEach(e=>{if("object"==typeof e)for(let n in e)e[n]&&t.push(n);else e&&t.push(e)}),t.join(" ")}function p(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.days;if(!t||!e)return!1;let o=c(t),l=c(e);return{[n.days]:o.date===l.date&&o.month===l.month&&o.year===l.year,[n.months]:o.month===l.month&&o.year===l.year,[n.years]:o.year===l.year}[i]}function h(t,e,n){let i=g(t,!1).getTime(),o=g(e,!1).getTime();return n?i>=o:i>o}function m(t,e){return!h(t,e,!0)}function g(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=new Date(t.getTime());return"boolean"!=typeof e||e||function(t){t.setHours(0,0,0,0)}(n),n}function w(t,e,n){t.length?t.forEach(t=>{t.addEventListener(e,n)}):t.addEventListener(e,n)}function b(t,e){return!(!t||t===document||t instanceof DocumentFragment)&&(t.matches(e)?t:b(t.parentNode,e))}function x(t,e,n){return t>n?n:t<e?e:t}function v(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];return n.filter(t=>t).forEach(e=>{for(let[n,i]of Object.entries(e))if(void 0!==i&&"[object Object]"===i.toString()){let e=void 0!==t[n]?t[n].toString():void 0,o=i.toString(),l=Array.isArray(i)?[]:{};t[n]=t[n]?e!==o?l:t[n]:l,v(t[n],i)}else t[n]=i}),t}function y(t){let e=t;return t instanceof Date||("string"==typeof t&&/^\d{4}-\d{2}-\d{2}$/.test(t)&&(t+="T00:00:00"),e=new Date(t)),isNaN(e.getTime())&&(e=!1),e}function $(t){let e="\\s|\\.|-|/|\\\\|,|\\$|\\!|\\?|:|;";return new RegExp("(^|>|"+e+")("+t+")($|<|"+e+")","g")}function k(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class D{constructor(){let{type:t,date:e,dp:n,opts:i,body:o}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};k(this,"focus",()=>{this.$cell.classList.add("-focus-"),this.focused=!0}),k(this,"removeFocus",()=>{this.$cell.classList.remove("-focus-"),this.focused=!1}),k(this,"select",()=>{this.$cell.classList.add("-selected-"),this.selected=!0}),k(this,"removeSelect",()=>{this.$cell.classList.remove("-selected-","-range-from-","-range-to-"),this.selected=!1}),k(this,"onChangeSelectedDate",()=>{this.isDisabled||(this._handleSelectedStatus(),this.opts.range&&this._handleRangeStatus())}),k(this,"onChangeFocusDate",t=>{if(!t)return void(this.focused&&this.removeFocus());let e=p(t,this.date,this.type);e?this.focus():!e&&this.focused&&this.removeFocus(),this.opts.range&&this._handleRangeStatus()}),k(this,"render",()=>(this.$cell.innerHTML=this._getHtml(),this._handleClasses(),this.$cell)),this.type=t,this.singleType=this.type.slice(0,-1),this.date=e,this.dp=n,this.opts=i,this.body=o,this.customData=!1,this.init()}init(){var t,e;let{onRenderCell:n}=this.opts;n&&(this.customData=n({date:this.date,cellType:this.singleType,datepicker:this.dp})),this._createElement(),this._bindDatepickerEvents(),null!==(t=this.customData)&&void 0!==t&&t.disabled?this.dp.disableDate(this.date):!1===(null===(e=this.customData)||void 0===e?void 0:e.disabled)&&this.dp.enableDate(this.date)}_bindDatepickerEvents(){this.dp.on(n.eventChangeSelectedDate,this.onChangeSelectedDate),this.dp.on(n.eventChangeFocusDate,this.onChangeFocusDate)}unbindDatepickerEvents(){this.dp.off(n.eventChangeSelectedDate,this.onChangeSelectedDate),this.dp.off(n.eventChangeFocusDate,this.onChangeFocusDate)}_createElement(){var t;let{year:e,month:n,fullMonth:i,date:o,fullDate:r}=c(this.date),s=(null===(t=this.customData)||void 0===t?void 0:t.attrs)||{};this.$cell=l({attrs:{"data-year":e,"data-month":n,"data-date":o,"data-iso-date":`${e}-${i}-${r}`,...s}}),this.$cell.adpCell=this}_getClassName(){var t;let e=new Date,{selectOtherMonths:i,selectOtherYears:o}=this.opts,{minDate:l,maxDate:r,isDateDisabled:s}=this.dp,{day:a}=c(this.date),u=this._isOutOfMinMaxRange(),d=s(this.date),h=f("air-datepicker-cell",`-${this.singleType}-`,{"-current-":p(e,this.date,this.type),"-min-date-":l&&p(l,this.date,this.type),"-max-date-":r&&p(r,this.date,this.type)}),m="";switch(this.type){case n.days:m=f({"-weekend-":this.dp.isWeekend(a),"-other-month-":this.isOtherMonth,"-disabled-":this.isOtherMonth&&!i||u||d});break;case n.months:m=f({"-disabled-":u});break;case n.years:m=f({"-other-decade-":this.isOtherDecade,"-disabled-":u||this.isOtherDecade&&!o})}return f(h,m,null===(t=this.customData)||void 0===t?void 0:t.classes).split(" ")}_getHtml(){var t;let{year:e,month:i,date:o}=c(this.date),{showOtherMonths:l,showOtherYears:r}=this.opts;if(null!==(t=this.customData)&&void 0!==t&&t.html)return this.customData.html;switch(this.type){case n.days:return!l&&this.isOtherMonth?"":o;case n.months:return this.dp.locale[this.opts.monthsField][i];case n.years:return!r&&this.isOtherDecade?"":e}}_isOutOfMinMaxRange(){let{minDate:t,maxDate:e}=this.dp,{type:i,date:o}=this,{month:l,year:r,date:s}=c(o),a=i===n.days,u=i===n.years,d=!!t&&new Date(r,u?t.getMonth():l,a?s:t.getDate()),f=!!e&&new Date(r,u?e.getMonth():l,a?s:e.getDate());return t&&e?m(d,t)||h(f,e):t?m(d,t):e?h(f,e):void 0}destroy(){this.unbindDatepickerEvents()}_handleRangeStatus(){const{selectedDates:t,focusDate:e,rangeDateTo:n,rangeDateFrom:i}=this.dp,o=t.length;if(this.$cell.classList.remove("-range-from-","-range-to-","-in-range-"),!o)return;let l=i,r=n;if(1===o&&e){const n=h(e,t[0]);l=n?t[0]:e,r=n?e:t[0]}let s=f({"-in-range-":l&&r&&(c=this.date,a=l,u=r,h(c,a)&&m(c,u)),"-range-from-":l&&p(this.date,l,this.type),"-range-to-":r&&p(this.date,r,this.type)});var c,a,u;s&&this.$cell.classList.add(...s.split(" "))}_handleSelectedStatus(){let t=this.dp._checkIfDateIsSelected(this.date,this.type);t?this.select():!t&&this.selected&&this.removeSelect()}_handleInitialFocusStatus(){p(this.dp.focusDate,this.date,this.type)&&this.focus()}_handleClasses(){this.$cell.setAttribute("class",""),this._handleInitialFocusStatus(),this.dp.hasSelectedDates&&(this._handleSelectedStatus(),this.dp.opts.range&&this._handleRangeStatus()),this.$cell.classList.add(...this._getClassName())}get isDisabled(){return this.$cell.matches(".-disabled-")}get isOtherMonth(){return this.dp.isOtherMonth(this.date)}get isOtherDecade(){return this.dp.isOtherDecade(this.date)}}function _(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}let S={[n.days]:`<div class="air-datepicker-body--day-names"></div><div class="air-datepicker-body--cells -${n.days}-"></div>`,[n.months]:`<div class="air-datepicker-body--cells -${n.months}-"></div>`,[n.years]:`<div class="air-datepicker-body--cells -${n.years}-"></div>`};const z=".air-datepicker-cell";class M{constructor(t){let{dp:e,type:i,opts:o}=t;_(this,"handleClick",t=>{let e=t.target.closest(z).adpCell;if(e.isDisabled)return;if(!this.dp.isMinViewReached)return void this.dp.down();let n=this.dp._checkIfDateIsSelected(e.date,e.type);n?this.dp._handleAlreadySelectedDates(n,e.date):this.dp.selectDate(e.date)}),_(this,"handleDayNameClick",t=>{let e=t.target.getAttribute("data-day-index");this.opts.onClickDayName({dayIndex:Number(e),datepicker:this.dp})}),_(this,"onChangeCurrentView",t=>{t!==this.type?this.hide():(this.show(),this.render())}),_(this,"onMouseOverCell",t=>{let e=b(t.target,z);this.dp.setFocusDate(!!e&&e.adpCell.date)}),_(this,"onMouseOutCell",()=>{this.dp.setFocusDate(!1)}),_(this,"onClickBody",t=>{let{onClickDayName:e}=this.opts,n=t.target;n.closest(z)&&this.handleClick(t),e&&n.closest(".air-datepicker-body--day-name")&&this.handleDayNameClick(t)}),_(this,"onMouseDown",t=>{this.pressed=!0;let e=b(t.target,z),n=e&&e.adpCell;p(n.date,this.dp.rangeDateFrom)&&(this.rangeFromFocused=!0),p(n.date,this.dp.rangeDateTo)&&(this.rangeToFocused=!0)}),_(this,"onMouseMove",t=>{if(!this.pressed||!this.dp.isMinViewReached)return;t.preventDefault();let e=b(t.target,z),n=e&&e.adpCell,{selectedDates:i,rangeDateTo:o,rangeDateFrom:l}=this.dp;if(!n||n.isDisabled)return;let{date:r}=n;if(2===i.length){if(this.rangeFromFocused&&!h(r,o)){let{hours:t,minutes:e}=c(l);r.setHours(t),r.setMinutes(e),this.dp.rangeDateFrom=r,this.dp.replaceDate(l,r)}if(this.rangeToFocused&&!m(r,l)){let{hours:t,minutes:e}=c(o);r.setHours(t),r.setMinutes(e),this.dp.rangeDateTo=r,this.dp.replaceDate(o,r)}}}),_(this,"onMouseUp",()=>{this.pressed=!1,this.rangeFromFocused=!1,this.rangeToFocused=!1}),_(this,"onChangeViewDate",(t,e)=>{if(!this.isVisible)return;let i=d(t),o=d(e);switch(this.dp.currentView){case n.days:if(p(t,e,n.months))return;break;case n.months:if(p(t,e,n.years))return;break;case n.years:if(i[0]===o[0]&&i[1]===o[1])return}this.render()}),_(this,"render",()=>{this.destroyCells(),this._generateCells(),this.cells.forEach(t=>{this.$cells.appendChild(t.render())})}),this.dp=e,this.type=i,this.opts=o,this.cells=[],this.$el="",this.pressed=!1,this.isVisible=!0,this.init()}init(){this._buildBaseHtml(),this.type===n.days&&this.renderDayNames(),this.render(),this._bindEvents(),this._bindDatepickerEvents()}_bindEvents(){let{range:t,dynamicRange:e}=this.opts;w(this.$el,"mouseover",this.onMouseOverCell),w(this.$el,"mouseout",this.onMouseOutCell),w(this.$el,"click",this.onClickBody),t&&e&&(w(this.$el,"mousedown",this.onMouseDown),w(this.$el,"mousemove",this.onMouseMove),w(window.document,"mouseup",this.onMouseUp))}_bindDatepickerEvents(){this.dp.on(n.eventChangeViewDate,this.onChangeViewDate),this.dp.on(n.eventChangeCurrentView,this.onChangeCurrentView)}_buildBaseHtml(){this.$el=l({className:`air-datepicker-body -${this.type}-`,innerHtml:S[this.type]}),this.$names=o(".air-datepicker-body--day-names",this.$el),this.$cells=o(".air-datepicker-body--cells",this.$el)}_getDayNamesHtml(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.dp.locale.firstDay,e="",i=this.dp.isWeekend,{onClickDayName:o}=this.opts,l=t,r=0;for(;r<7;){let t=l%7;e+=`<div class="${f("air-datepicker-body--day-name",{[n.cssClassWeekend]:i(t),"-clickable-":!!o})}" data-day-index='${t}'>${this.dp.locale.daysMin[t]}</div>`,r++,l++}return e}renderDayNames(){this.$names.innerHTML=this._getDayNamesHtml()}_generateCell(t){let{type:e,dp:n,opts:i}=this;return new D({type:e,dp:n,opts:i,date:t,body:this})}_generateCells(){M.getDatesFunction(this.type)(this.dp,t=>{this.cells.push(this._generateCell(t))})}show(){this.isVisible=!0,this.$el.classList.remove("-hidden-")}hide(){this.isVisible=!1,this.$el.classList.add("-hidden-")}destroyCells(){this.cells.forEach(t=>t.destroy()),this.cells=[],this.$cells.innerHTML=""}destroy(){this.destroyCells(),this.dp.off(n.eventChangeViewDate,this.onChangeViewDate),this.dp.off(n.eventChangeCurrentView,this.onChangeCurrentView)}static getDaysDates(t,e){let{viewDate:n,opts:{fixedHeight:i},locale:{firstDay:o}}=t,l=s(n),{year:r,month:a}=c(n),u=new Date(r,a,1),d=new Date(r,a,l),f=u.getDay()-o,p=6-d.getDay()+o;f=f<0?f+7:f,p=p>6?p-7:p;let h=function(t,e){let{year:n,month:i,date:o}=c(t);return new Date(n,i,o-e)}(u,f),m=l+f+p,g=h.getDate(),{year:w,month:b}=c(h),x=0;i&&(m=42);const v=[];for(;x<m;){let t=new Date(w,b,g+x);e&&e(t),v.push(t),x++}return v}static getMonthsDates(t,e){let{year:n}=t.parsedViewDate,i=0,o=[];for(;i<12;){const t=new Date(n,i);o.push(t),e&&e(t),i++}return o}static getYearsDates(t,e){let n=d(t.viewDate),i=n[0]-1,o=n[1]+1,l=i,r=[];for(;l<=o;){const t=new Date(l,0);r.push(t),e&&e(t),l++}return r}static getDatesFunction(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n.days;return{[n.days]:M.getDaysDates,[n.months]:M.getMonthsDates,[n.years]:M.getYearsDates}[t]}}function j(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class E{constructor(t){let{dp:e,opts:n}=t;j(this,"onClickNav",t=>{let e=b(t.target,".air-datepicker-nav--action");if(!e)return;let n=e.dataset.action;this.dp[n]()}),j(this,"onChangeViewDate",()=>{this.render(),this._resetNavStatus(),this.handleNavStatus()}),j(this,"onChangeCurrentView",()=>{this.render(),this._resetNavStatus(),this.handleNavStatus()}),j(this,"onClickNavTitle",()=>{this.dp.isFinalView||this.dp.up()}),j(this,"update",()=>{let{prevHtml:t,nextHtml:e}=this.opts;this.$prev.innerHTML=t,this.$next.innerHTML=e,this._resetNavStatus(),this.render(),this.handleNavStatus()}),j(this,"renderDelay",()=>{setTimeout(this.render)}),j(this,"render",()=>{this.$title.innerHTML=this._getTitle(),function(t,e){for(let n in e)e[n]?t.classList.add(n):t.classList.remove(n)}(this.$title,{"-disabled-":this.dp.isFinalView})}),this.dp=e,this.opts=n,this.init()}init(){this._createElement(),this._buildBaseHtml(),this._defineDOM(),this.render(),this.handleNavStatus(),this._bindEvents(),this._bindDatepickerEvents()}_defineDOM(){this.$title=o(".air-datepicker-nav--title",this.$el),this.$prev=o('[data-action="prev"]',this.$el),this.$next=o('[data-action="next"]',this.$el)}_bindEvents(){this.$el.addEventListener("click",this.onClickNav),this.$title.addEventListener("click",this.onClickNavTitle)}_bindDatepickerEvents(){this.dp.on(n.eventChangeViewDate,this.onChangeViewDate),this.dp.on(n.eventChangeCurrentView,this.onChangeCurrentView),this.isNavIsFunction&&(this.dp.on(n.eventChangeSelectedDate,this.renderDelay),this.dp.opts.timepicker&&this.dp.on(n.eventChangeTime,this.render))}destroy(){this.dp.off(n.eventChangeViewDate,this.onChangeViewDate),this.dp.off(n.eventChangeCurrentView,this.onChangeCurrentView),this.isNavIsFunction&&(this.dp.off(n.eventChangeSelectedDate,this.renderDelay),this.dp.opts.timepicker&&this.dp.off(n.eventChangeTime,this.render))}_createElement(){this.$el=l({tagName:"nav",className:"air-datepicker-nav"})}_getTitle(){let{dp:t,opts:e}=this,n=e.navTitles[t.currentView];return"function"==typeof n?n(t):t.formatDate(t.viewDate,n)}handleNavStatus(){let{disableNavWhenOutOfRange:t}=this.opts,{minDate:e,maxDate:i}=this.dp;if(!e&&!i||!t)return;let{year:o,month:l}=this.dp.parsedViewDate,r=!!e&&c(e),s=!!i&&c(i);switch(this.dp.currentView){case n.days:e&&r.month>=l&&r.year>=o&&this._disableNav("prev"),i&&s.month<=l&&s.year<=o&&this._disableNav("next");break;case n.months:e&&r.year>=o&&this._disableNav("prev"),i&&s.year<=o&&this._disableNav("next");break;case n.years:{let t=d(this.dp.viewDate);e&&r.year>=t[0]&&this._disableNav("prev"),i&&s.year<=t[1]&&this._disableNav("next");break}}}_disableNav(t){o('[data-action="'+t+'"]',this.$el).classList.add("-disabled-")}_resetNavStatus(){!function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];t.length?t.forEach(t=>{t.classList.remove(...n)}):t.classList.remove(...n)}(this.$el.querySelectorAll(".air-datepicker-nav--action"),"-disabled-")}_buildBaseHtml(){let{prevHtml:t,nextHtml:e}=this.opts;this.$el.innerHTML=`<div class="air-datepicker-nav--action" data-action="prev">${t}</div><div class="air-datepicker-nav--title"></div><div class="air-datepicker-nav--action" data-action="next">${e}</div>`}get isNavIsFunction(){let{navTitles:t}=this.opts;return Object.keys(t).find(e=>"function"==typeof t[e])}}var C={today:{content:t=>t.locale.today,onClick:t=>t.setViewDate(new Date)},clear:{content:t=>t.locale.clear,onClick:t=>t.clear()}};class T{constructor(t){let{dp:e,opts:n}=t;this.dp=e,this.opts=n,this.init()}init(){this.createElement(),this.render()}createElement(){this.$el=l({className:"air-datepicker-buttons"})}destroy(){this.$el.parentNode.removeChild(this.$el)}clearHtml(){return this.$el.innerHTML="",this}generateButtons(){let{buttons:t}=this.opts;Array.isArray(t)||(t=[t]),t.forEach(t=>{let e=t;"string"==typeof t&&C[t]&&(e=C[t]);let n=this.createButton(e);e.onClick&&this.attachEventToButton(n,e.onClick),this.$el.appendChild(n)})}attachEventToButton(t,e){t.addEventListener("click",()=>{e(this.dp)})}createButton(t){let{content:e,className:n,tagName:i="button",attrs:o={}}=t;return l({tagName:i,innerHtml:`<span tabindex='-1'>${"function"==typeof e?e(this.dp):e}</span>`,className:f("air-datepicker-button",n),attrs:o})}render(){this.generateButtons()}}function N(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class O{constructor(){let{opts:t,dp:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};N(this,"toggleTimepickerIsActive",t=>{this.dp.timepickerIsActive=t}),N(this,"onChangeSelectedDate",t=>{let{date:e,updateTime:n=!1}=t;e&&(this.setMinMaxTime(e),this.setCurrentTime(!!n&&e),this.addTimeToDate(e))}),N(this,"onChangeLastSelectedDate",t=>{t&&(this.setTime(t),this.render())}),N(this,"onChangeInputRange",t=>{let e=t.target;this[e.getAttribute("name")]=e.value,this.updateText(),this.dp.trigger(n.eventChangeTime,{hours:this.hours,minutes:this.minutes})}),N(this,"onMouseEnterLeave",t=>{let e=t.target.getAttribute("name"),n=this.$minutesText;"hours"===e&&(n=this.$hoursText),n.classList.toggle("-focus-")}),N(this,"onFocus",()=>{this.toggleTimepickerIsActive(!0)}),N(this,"onBlur",()=>{this.toggleTimepickerIsActive(!1)}),this.opts=t,this.dp=e;let{timeFormat:i}=this.dp.locale;i&&(i.match($("h"))||i.match($("hh")))&&(this.ampm=!0),this.init()}init(){this.setTime(this.dp.lastSelectedDate||this.dp.viewDate),this.createElement(),this.buildHtml(),this.defineDOM(),this.render(),this.bindDatepickerEvents(),this.bindDOMEvents()}bindDatepickerEvents(){this.dp.on(n.eventChangeSelectedDate,this.onChangeSelectedDate),this.dp.on(n.eventChangeLastSelectedDate,this.onChangeLastSelectedDate)}bindDOMEvents(){let t="input";navigator.userAgent.match(/trident/gi)&&(t="change"),w(this.$ranges,t,this.onChangeInputRange),w(this.$ranges,"mouseenter",this.onMouseEnterLeave),w(this.$ranges,"mouseleave",this.onMouseEnterLeave),w(this.$ranges,"focus",this.onFocus),w(this.$ranges,"mousedown",this.onFocus),w(this.$ranges,"blur",this.onBlur)}createElement(){this.$el=l({className:f("air-datepicker-time",{"-am-pm-":this.dp.ampm})})}destroy(){this.dp.off(n.eventChangeSelectedDate,this.onChangeSelectedDate),this.dp.off(n.eventChangeLastSelectedDate,this.onChangeLastSelectedDate),this.$el.parentNode.removeChild(this.$el)}buildHtml(){let{ampm:t,hours:e,displayHours:n,minutes:i,minHours:o,minMinutes:l,maxHours:r,maxMinutes:s,dayPeriod:c,opts:{hoursStep:a,minutesStep:d}}=this;this.$el.innerHTML=`<div class="air-datepicker-time--current"> <span class="air-datepicker-time--current-hours">${u(n)}</span> <span class="air-datepicker-time--current-colon">:</span> <span class="air-datepicker-time--current-minutes">${u(i)}</span> `+(t?`<span class='air-datepicker-time--current-ampm'>${c}</span>`:"")+'</div><div class="air-datepicker-time--sliders"> <div class="air-datepicker-time--row">'+` <input type="range" name="hours" value="${e}" min="${o}" max="${r}" step="${a}"/> </div> <div class="air-datepicker-time--row">`+` <input type="range" name="minutes" value="${i}" min="${l}" max="${s}" step="${d}"/> </div></div>`}defineDOM(){let t=t=>o(t,this.$el);this.$ranges=this.$el.querySelectorAll('[type="range"]'),this.$hours=t('[name="hours"]'),this.$minutes=t('[name="minutes"]'),this.$hoursText=t(".air-datepicker-time--current-hours"),this.$minutesText=t(".air-datepicker-time--current-minutes"),this.$ampm=t(".air-datepicker-time--current-ampm")}setTime(t){this.setMinMaxTime(t),this.setCurrentTime(t)}addTimeToDate(t){t&&(t.setHours(this.hours),t.setMinutes(this.minutes))}setMinMaxTime(t){if(this.setMinMaxTimeFromOptions(),t){let{minDate:e,maxDate:n}=this.dp;e&&p(t,e)&&this.setMinTimeFromMinDate(e),n&&p(t,n)&&this.setMaxTimeFromMaxDate(n)}}setCurrentTime(t){let{hours:e,minutes:n}=t?c(t):this;this.hours=x(e,this.minHours,this.maxHours),this.minutes=x(n,this.minMinutes,this.maxMinutes)}setMinMaxTimeFromOptions(){let{minHours:t,minMinutes:e,maxHours:n,maxMinutes:i}=this.opts;this.minHours=x(t,0,23),this.minMinutes=x(e,0,59),this.maxHours=x(n,0,23),this.maxMinutes=x(i,0,59)}setMinTimeFromMinDate(t){let{lastSelectedDate:e}=this.dp;this.minHours=t.getHours(),e&&e.getHours()>t.getHours()?this.minMinutes=this.opts.minMinutes:this.minMinutes=t.getMinutes()}setMaxTimeFromMaxDate(t){let{lastSelectedDate:e}=this.dp;this.maxHours=t.getHours(),e&&e.getHours()<t.getHours()?this.maxMinutes=this.opts.maxMinutes:this.maxMinutes=t.getMinutes()}updateSliders(){r(this.$hours,{min:this.minHours,max:this.maxHours}).value=this.hours,r(this.$minutes,{min:this.minMinutes,max:this.maxMinutes}).value=this.minutes}updateText(){this.$hoursText.innerHTML=u(this.displayHours),this.$minutesText.innerHTML=u(this.minutes),this.ampm&&(this.$ampm.innerHTML=this.dayPeriod)}set hours(t){this._hours=t;let{hours:e,dayPeriod:n}=a(t);this.displayHours=this.ampm?e:t,this.dayPeriod=n}get hours(){return this._hours}render(){this.updateSliders(),this.updateText()}}function A(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class F{constructor(t){let{dp:e,opts:n}=t;A(this,"pressedKeys",new Set),A(this,"hotKeys",new Map([[[["Control","ArrowRight"],["Control","ArrowUp"]],t=>t.month++],[[["Control","ArrowLeft"],["Control","ArrowDown"]],t=>t.month--],[[["Shift","ArrowRight"],["Shift","ArrowUp"]],t=>t.year++],[[["Shift","ArrowLeft"],["Shift","ArrowDown"]],t=>t.year--],[[["Alt","ArrowRight"],["Alt","ArrowUp"]],t=>t.year+=10],[[["Alt","ArrowLeft"],["Alt","ArrowDown"]],t=>t.year-=10],[["Control","Shift","ArrowUp"],(t,e)=>e.up()]])),A(this,"handleHotKey",t=>{let e=this.hotKeys.get(t),n=c(this.getInitialFocusDate());e(n,this.dp);let{year:i,month:o,date:l}=n,r=s(new Date(i,o));r<l&&(l=r);let a=this.dp.getClampedDate(new Date(i,o,l));this.dp.setFocusDate(a,{viewDateTransition:!0})}),A(this,"isHotKeyPressed",()=>{let t=!1,e=this.pressedKeys.size,n=t=>this.pressedKeys.has(t);for(let[i]of this.hotKeys){if(t)break;if(Array.isArray(i[0]))i.forEach(o=>{t||e!==o.length||(t=o.every(n)&&i)});else{if(e!==i.length)continue;t=i.every(n)&&i}}return t}),A(this,"isArrow",t=>t>=37&&t<=40),A(this,"onKeyDown",t=>{if(!this.dp.visible&&!this.dp.treatAsInline)return;let{key:e,which:n}=t,{dp:i,dp:{focusDate:o},opts:l}=this;this.registerKey(e);let r=this.isHotKeyPressed();if(r)return t.preventDefault(),void this.handleHotKey(r);if(this.isArrow(n))return t.preventDefault(),void this.focusNextCell(e);if("Enter"===e){if(i.currentView!==l.minView)return void i.down();if(o){let t=i._checkIfDateIsSelected(o);return void(t?i._handleAlreadySelectedDates(t,o):i.selectDate(o))}}"Escape"===e&&this.dp.hide()}),A(this,"onKeyUp",t=>{this.removeKey(t.key)}),this.dp=e,this.opts=n,this.init()}init(){this.bindKeyboardEvents()}bindKeyboardEvents(){let{$el:t}=this.dp;t.addEventListener("keydown",this.onKeyDown),t.addEventListener("keyup",this.onKeyUp)}destroy(){let{$el:t}=this.dp;t.removeEventListener("keydown",this.onKeyDown),t.removeEventListener("keyup",this.onKeyUp),this.hotKeys=null,this.pressedKeys=null}getInitialFocusDate(){let{focusDate:t,currentView:e,selectedDates:i,parsedViewDate:{year:o,month:l}}=this.dp,r=t||i[i.length-1];if(!r)switch(e){case n.days:r=new Date(o,l,(new Date).getDate());break;case n.months:r=new Date(o,l,1);break;case n.years:r=new Date(o,0,1)}return r}focusNextCell(t){let e=this.getInitialFocusDate(),{currentView:i}=this.dp,{days:o,months:l,years:r}=n,s=c(e),a=s.year,u=s.month,d=s.date;switch(t){case"ArrowLeft":i===o&&(d-=1),i===l&&(u-=1),i===r&&(a-=1);break;case"ArrowUp":i===o&&(d-=7),i===l&&(u-=3),i===r&&(a-=4);break;case"ArrowRight":i===o&&(d+=1),i===l&&(u+=1),i===r&&(a+=1);break;case"ArrowDown":i===o&&(d+=7),i===l&&(u+=3),i===r&&(a+=4)}let f=this.dp.getClampedDate(new Date(a,u,d));this.dp.setFocusDate(f,{viewDateTransition:!0})}registerKey(t){this.pressedKeys.add(t)}removeKey(t){this.pressedKeys.delete(t)}}let I={on(t,e){this.S||(this.S={}),this.S[t]?this.S[t].push(e):this.S[t]=[e]},off(t,e){this.S&&this.S[t]&&(this.S[t]=this.S[t].filter(t=>t!==e))},removeAllEvents(){this.S={}},trigger(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i<e;i++)n[i-1]=arguments[i];this.S&&this.S[t]&&this.S[t].forEach(t=>{t(...n)})}};function R(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||null===t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}let L="",B="",H=!1;class P{static buildGlobalContainer(t){H=!0,L=l({className:t,id:t}),o("body").appendChild(L)}constructor(t,e){var r=this;if(R(this,"viewIndexes",[n.days,n.months,n.years]),R(this,"next",()=>{let{year:t,month:e}=this.parsedViewDate;switch(this.currentView){case n.days:this.setViewDate(new Date(t,e+1,1));break;case n.months:this.setViewDate(new Date(t+1,e,1));break;case n.years:this.setViewDate(new Date(t+10,0,1))}}),R(this,"prev",()=>{let{year:t,month:e}=this.parsedViewDate;switch(this.currentView){case n.days:this.setViewDate(new Date(t,e-1,1));break;case n.months:this.setViewDate(new Date(t-1,e,1));break;case n.years:this.setViewDate(new Date(t-10,0,1))}}),R(this,"_finishHide",()=>{this.hideAnimation=!1,this._destroyComponents(),this.$container.removeChild(this.$datepicker)}),R(this,"setPosition",function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("function"==typeof(t=t||r.opts.position))return void(r.customHide=t({$datepicker:r.$datepicker,$target:r.$el,$pointer:r.$pointer,isViewChange:e,done:r._finishHide}));let n,i,{isMobile:o}=r.opts,l=r.$el.getBoundingClientRect(),s=r.$el.getBoundingClientRect(),c=r.$datepicker.offsetParent,a=r.$el.offsetParent,u=r.$datepicker.getBoundingClientRect(),d=t.split(" "),f=window.scrollY,p=window.scrollX,h=r.opts.offset,m=d[0],g=d[1];if(o)r.$datepicker.style.cssText="left: 50%; top: 50%";else{if(c===a&&c!==document.body&&(s={top:r.$el.offsetTop,left:r.$el.offsetLeft,width:l.width,height:r.$el.offsetHeight},f=0,p=0),c!==a&&c!==document.body){let t=c.getBoundingClientRect();s={top:l.top-t.top,left:l.left-t.left,width:l.width,height:l.height},f=0,p=0}switch(m){case"top":n=s.top-u.height-h;break;case"right":i=s.left+s.width+h;break;case"bottom":n=s.top+s.height+h;break;case"left":i=s.left-u.width-h}switch(g){case"top":n=s.top;break;case"right":i=s.left+s.width-u.width;break;case"bottom":n=s.top+s.height-u.height;break;case"left":i=s.left;break;case"center":/left|right/.test(m)?n=s.top+s.height/2-u.height/2:i=s.left+s.width/2-u.width/2}r.$datepicker.style.cssText=`left: ${i+p}px; top: ${n+f}px`}}),R(this,"_setInputValue",()=>{let{opts:t,$altField:e,locale:{dateFormat:n}}=this,{altFieldDateFormat:i,altField:o}=t;o&&e&&(e.value=this._getInputValue(i)),this.$el.value=this._getInputValue(n),this.$el.dispatchEvent(new Event("change"))}),R(this,"_getInputValue",t=>{let{selectedDates:e,opts:n}=this,{multipleDates:i,multipleDatesSeparator:o}=n;if(!e.length)return"";let l="function"==typeof t,r=l?t(i?e:e[0]):e.map(e=>this.formatDate(e,t));return r=l?r:r.join(o),r}),R(this,"_checkIfDateIsSelected",function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.days,i=!1;return r.selectedDates.some(n=>{let o=p(t,n,e);return i=o&&n,o}),i}),R(this,"_scheduleCallAfterTransition",t=>{this._cancelScheduledCall(),t&&t(!1),this._onTransitionEnd=()=>{t&&t(!0)},this.$datepicker.addEventListener("transitionend",this._onTransitionEnd,{once:!0})}),R(this,"_cancelScheduledCall",()=>{this.$datepicker.removeEventListener("transitionend",this._onTransitionEnd)}),R(this,"setViewDate",t=>{if(!((t=y(t))instanceof Date))return;if(p(t,this.viewDate))return;let e=this.viewDate;this.viewDate=t;let{onChangeViewDate:i}=this.opts;if(i){let{month:t,year:e}=this.parsedViewDate;i({month:t,year:e,decade:this.curDecade})}this.trigger(n.eventChangeViewDate,t,e)}),R(this,"setFocusDate",function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(!t||(t=y(t))instanceof Date)&&(r.focusDate=t,r.trigger(n.eventChangeFocusDate,t,e))}),R(this,"setCurrentView",function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(r.viewIndexes.includes(t)){if(r.currentView=t,r.elIsInput&&r.visible&&r.setPosition(void 0,!0),r.trigger(n.eventChangeCurrentView,t),!r.views[t]){let e=r.views[t]=new M({dp:r,opts:r.opts,type:t});r.shouldUpdateDOM&&r.$content.appendChild(e.$el)}r.opts.onChangeView&&!e.silent&&r.opts.onChangeView(t)}}),R(this,"_updateLastSelectedDate",t=>{this.lastSelectedDate=t,this.trigger(n.eventChangeLastSelectedDate,t)}),R(this,"destroy",()=>{if(this.isDestroyed)return;let{showEvent:t,isMobile:e}=this.opts,n=this.$datepicker.parentNode;n&&n.removeChild(this.$datepicker),this.$el.removeEventListener(t,this._onFocus),this.$el.removeEventListener("blur",this._onBlur),window.removeEventListener("resize",this._onResize),e&&this._removeMobileAttributes(),this.keyboardNav&&this.keyboardNav.destroy(),this.views=null,this.nav=null,this.$datepicker=null,this.opts={},this.$customContainer=null,this.viewDate=null,this.focusDate=null,this.selectedDates=[],this.rangeDateFrom=null,this.rangeDateTo=null,this.isDestroyed=!0}),R(this,"update",function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=v({},r.opts),{silent:o}=e;v(r.opts,t);let{timepicker:l,buttons:s,range:c,selectedDates:a,isMobile:u}=r.opts,d=r.visible||r.treatAsInline;r._createMinMaxDates(),r._limitViewDateByMaxMinDates(),r._handleLocale(),a&&(r.selectedDates=[],r.selectDate(a,{silent:o})),t.view&&r.setCurrentView(t.view,{silent:o}),r._setInputValue(),i.range&&!c?(r.rangeDateTo=!1,r.rangeDateFrom=!1):!i.range&&c&&r.selectedDates.length&&(r.rangeDateFrom=r.selectedDates[0],r.rangeDateTo=r.selectedDates[1]),i.timepicker&&!l?(d&&r.timepicker.destroy(),r.timepicker=!1,r.$timepicker.parentNode.removeChild(r.$timepicker)):!i.timepicker&&l&&r._addTimepicker(),!i.buttons&&s?r._addButtons():i.buttons&&!s?(r.buttons.destroy(),r.$buttons.parentNode.removeChild(r.$buttons)):d&&i.buttons&&s&&r.buttons.clearHtml().render(),!i.isMobile&&u?(r.treatAsInline||B||r._createMobileOverlay(),r._addMobileAttributes(),r.visible&&r._showMobileOverlay()):i.isMobile&&!u&&(r._removeMobileAttributes(),r.visible&&(B.classList.remove("-active-"),"function"!=typeof r.opts.position&&r.setPosition())),d&&(r.nav.update(),r.views[r.currentView].render(),r.currentView===n.days&&r.views[r.currentView].renderDayNames())}),R(this,"disableDate",(t,e)=>{(Array.isArray(t)?t:[t]).forEach(t=>{let n=y(t);if(!n)return;let i=e?"delete":"add";this.disabledDates[i](this.formatDate(n,"yyyy-MM-dd"));let o=this.getCell(n,this.currentViewSingular);o&&o.adpCell.render()},[])}),R(this,"enableDate",t=>{this.disableDate(t,!0)}),R(this,"isDateDisabled",t=>{let e=y(t);return this.disabledDates.has(this.formatDate(e,"yyyy-MM-dd"))}),R(this,"isOtherMonth",t=>{let{month:e}=c(t);return e!==this.parsedViewDate.month}),R(this,"isOtherYear",t=>{let{year:e}=c(t);return e!==this.parsedViewDate.year}),R(this,"isOtherDecade",t=>{let{year:e}=c(t),[n,i]=d(this.viewDate);return e<n||e>i}),R(this,"_onChangeSelectedDate",t=>{let{silent:e}=t;setTimeout(()=>{this._setInputValue(),this.opts.onSelect&&!e&&this._triggerOnSelect()})}),R(this,"_onChangeFocusedDate",function(t){let{viewDateTransition:e}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t)return;let n=!1;e&&(n=r.isOtherMonth(t)||r.isOtherYear(t)||r.isOtherDecade(t)),n&&r.setViewDate(t),r.opts.onFocus&&r.opts.onFocus({datepicker:r,date:t})}),R(this,"_onChangeTime",t=>{let{hours:e,minutes:n}=t,i=new Date,{lastSelectedDate:o,opts:{onSelect:l}}=this,r=o;o||(r=i);let s=this.getCell(r,this.currentViewSingular),c=s&&s.adpCell;c&&c.isDisabled||(r.setHours(e),r.setMinutes(n),o?(this._setInputValue(),l&&this._triggerOnSelect()):this.selectDate(r))}),R(this,"_onFocus",t=>{this.visible||this.show()}),R(this,"_onBlur",t=>{this.inFocus||!this.visible||this.opts.isMobile||this.hide()}),R(this,"_onMouseDown",t=>{this.inFocus=!0}),R(this,"_onMouseUp",t=>{this.inFocus=!1,this.$el.focus()}),R(this,"_onResize",()=>{this.visible&&"function"!=typeof this.opts.position&&this.setPosition()}),R(this,"_onClickOverlay",()=>{this.visible&&this.hide()}),R(this,"getViewDates",function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n.days;return M.getDatesFunction(t)(r)}),R(this,"isWeekend",t=>this.opts.weekends.includes(t)),R(this,"getClampedDate",t=>{let{minDate:e,maxDate:n}=this,i=t;return n&&h(t,n)?i=n:e&&m(t,e)&&(i=e),i}),this.$el=o(t),!this.$el)return;this.$datepicker=l({className:"air-datepicker"}),this.opts=v({},i,e),this.$customContainer=!!this.opts.container&&o(this.opts.container),this.$altField=o(this.opts.altField||!1);let{view:s,startDate:a}=this.opts;a||(this.opts.startDate=new Date),"INPUT"===this.$el.nodeName&&(this.elIsInput=!0),this.inited=!1,this.visible=!1,this.viewDate=y(this.opts.startDate),this.focusDate=!1,this.initialReadonly=this.$el.getAttribute("readonly"),this.customHide=!1,this.currentView=s,this.selectedDates=[],this.disabledDates=new Set,this.isDestroyed=!1,this.views={},this.keys=[],this.rangeDateFrom="",this.rangeDateTo="",this.timepickerIsActive=!1,this.treatAsInline=this.opts.inline||!this.elIsInput,this.init()}init(){let{opts:t,treatAsInline:e,opts:{inline:n,isMobile:i,selectedDates:l,keyboardNav:r,onlyTimepicker:s}}=this,c=o("body");(!H||H&&L&&!c.contains(L))&&!n&&this.elIsInput&&!this.$customContainer&&P.buildGlobalContainer(P.defaultGlobalContainerId),!i||B||e||this._createMobileOverlay(),this._handleLocale(),this._bindSubEvents(),this._createMinMaxDates(),this._limitViewDateByMaxMinDates(),this.elIsInput&&(n||this._bindEvents(),r&&!s&&(this.keyboardNav=new F({dp:this,opts:t}))),l&&this.selectDate(l,{silent:!0}),this.opts.visible&&!e&&this.show(),i&&!e&&this.$el.setAttribute("readonly",!0),e&&this._createComponents()}_createMobileOverlay(){B=l({className:"air-datepicker-overlay"}),L.appendChild(B)}_createComponents(){let{opts:t,treatAsInline:e,opts:{inline:n,buttons:i,timepicker:o,position:l,classes:r,onlyTimepicker:s,isMobile:c}}=this;this._buildBaseHtml(),this.elIsInput&&(n||this._setPositionClasses(l)),!n&&this.elIsInput||this.$datepicker.classList.add("-inline-"),r&&this.$datepicker.classList.add(...r.split(" ")),s&&this.$datepicker.classList.add("-only-timepicker-"),c&&!e&&this._addMobileAttributes(),this.views[this.currentView]=new M({dp:this,type:this.currentView,opts:t}),this.nav=new E({dp:this,opts:t}),o&&this._addTimepicker(),i&&this._addButtons(),this.$content.appendChild(this.views[this.currentView].$el),this.$nav.appendChild(this.nav.$el)}_destroyComponents(){for(let t in this.views)this.views[t].destroy();this.views={},this.nav.destroy(),this.timepicker&&this.timepicker.destroy()}_addMobileAttributes(){B.addEventListener("click",this._onClickOverlay),this.$datepicker.classList.add("-is-mobile-"),this.$el.setAttribute("readonly",!0)}_removeMobileAttributes(){B.removeEventListener("click",this._onClickOverlay),this.$datepicker.classList.remove("-is-mobile-"),this.initialReadonly||""===this.initialReadonly||this.$el.removeAttribute("readonly")}_createMinMaxDates(){let{minDate:t,maxDate:e}=this.opts;this.minDate=!!t&&y(t),this.maxDate=!!e&&y(e)}_addTimepicker(){this.$timepicker=l({className:"air-datepicker--time"}),this.$datepicker.appendChild(this.$timepicker),this.timepicker=new O({dp:this,opts:this.opts}),this.$timepicker.appendChild(this.timepicker.$el)}_addButtons(){this.$buttons=l({className:"air-datepicker--buttons"}),this.$datepicker.appendChild(this.$buttons),this.buttons=new T({dp:this,opts:this.opts}),this.$buttons.appendChild(this.buttons.$el)}_bindSubEvents(){this.on(n.eventChangeSelectedDate,this._onChangeSelectedDate),this.on(n.eventChangeFocusDate,this._onChangeFocusedDate),this.on(n.eventChangeTime,this._onChangeTime)}_buildBaseHtml(){let{inline:t}=this.opts;var e,n;this.elIsInput?t?(e=this.$datepicker,(n=this.$el).parentNode.insertBefore(e,n.nextSibling)):this.$container.appendChild(this.$datepicker):this.$el.appendChild(this.$datepicker),this.$datepicker.innerHTML='<i class="air-datepicker--pointer"></i><div class="air-datepicker--navigation"></div><div class="air-datepicker--content"></div>',this.$content=o(".air-datepicker--content",this.$datepicker),this.$pointer=o(".air-datepicker--pointer",this.$datepicker),this.$nav=o(".air-datepicker--navigation",this.$datepicker)}_handleLocale(){let{locale:t,dateFormat:e,firstDay:n,timepicker:i,onlyTimepicker:o,timeFormat:l,dateTimeSeparator:r}=this.opts;var s;this.locale=(s=t,JSON.parse(JSON.stringify(s))),e&&(this.locale.dateFormat=e),void 0!==l&&""!==l&&(this.locale.timeFormat=l);let{timeFormat:c}=this.locale;if(""!==n&&(this.locale.firstDay=n),i&&"function"!=typeof e){let t=c?r:"";this.locale.dateFormat=[this.locale.dateFormat,c||""].join(t)}o&&"function"!=typeof e&&(this.locale.dateFormat=this.locale.timeFormat)}_setPositionClasses(t){if("function"==typeof t)return void this.$datepicker.classList.add("-custom-position-");let e=(t=t.split(" "))[0],n=`air-datepicker -${e}-${t[1]}- -from-${e}-`;this.$datepicker.classList.add(...n.split(" "))}_bindEvents(){this.$el.addEventListener(this.opts.showEvent,this._onFocus),this.$el.addEventListener("blur",this._onBlur),this.$datepicker.addEventListener("mousedown",this._onMouseDown),this.$datepicker.addEventListener("mouseup",this._onMouseUp),window.addEventListener("resize",this._onResize)}_limitViewDateByMaxMinDates(){let{viewDate:t,minDate:e,maxDate:n}=this;n&&h(t,n)&&this.setViewDate(n),e&&m(t,e)&&this.setViewDate(e)}formatDate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.viewDate,e=arguments.length>1?arguments[1]:void 0;if(t=y(t),!(t instanceof Date))return;let n=e,i=this.locale,o=c(t),l=o.dayPeriod,r=d(t),s=P.replacer,a={T:t.getTime(),m:o.minutes,mm:o.fullMinutes,h:o.hours12,hh:o.fullHours12,H:o.hours,HH:o.fullHours,aa:l,AA:l.toUpperCase(),E:i.daysShort[o.day],EEEE:i.days[o.day],d:o.date,dd:o.fullDate,M:o.month+1,MM:o.fullMonth,MMM:i.monthsShort[o.month],MMMM:i.months[o.month],yy:o.year.toString().slice(-2),yyyy:o.year,yyyy1:r[0],yyyy2:r[1]};for(let[t,e]of Object.entries(a))n=s(n,$(t),e);return n}down(t){this._handleUpDownActions(t,"down")}up(t){this._handleUpDownActions(t,"up")}selectDate(t){let e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{currentView:o,parsedViewDate:l,selectedDates:r}=this,{updateTime:s,silent:c}=i,{moveToOtherMonthsOnSelect:a,moveToOtherYearsOnSelect:u,multipleDates:d,range:f,autoClose:p,onBeforeSelect:m}=this.opts,g=r.length;if(Array.isArray(t))return t.forEach(t=>{this.selectDate(t,i)}),new Promise(t=>{setTimeout(t)});if((t=y(t))instanceof Date){if(m&&!c&&!m({date:t,datepicker:this}))return Promise.resolve();if(o===n.days&&t.getMonth()!==l.month&&a&&(e=new Date(t.getFullYear(),t.getMonth(),1)),o===n.years&&t.getFullYear()!==l.year&&u&&(e=new Date(t.getFullYear(),0,1)),e&&this.setViewDate(e),d&&!f){if(g===d)return;this._checkIfDateIsSelected(t)||r.push(t)}else if(f)switch(g){case 1:r.push(t),this.rangeDateTo||(this.rangeDateTo=t),h(this.rangeDateFrom,this.rangeDateTo)&&(this.rangeDateTo=this.rangeDateFrom,this.rangeDateFrom=t),this.selectedDates=[this.rangeDateFrom,this.rangeDateTo];break;case 2:this.selectedDates=[t],this.rangeDateFrom=t,this.rangeDateTo="";break;default:this.selectedDates=[t],this.rangeDateFrom=t}else this.selectedDates=[t];return this.trigger(n.eventChangeSelectedDate,{action:n.actionSelectDate,silent:null==i?void 0:i.silent,date:t,updateTime:s}),this._updateLastSelectedDate(t),p&&!this.timepickerIsActive&&this.visible&&(d||f?f&&1===g&&this.hide():this.hide()),new Promise(t=>{setTimeout(t)})}}unselectDate(t){let e=this.selectedDates,i=this;if((t=y(t))instanceof Date)return e.some((o,l)=>{if(p(o,t))return e.splice(l,1),i.selectedDates.length?(i.rangeDateTo="",i.rangeDateFrom=e[0],i._updateLastSelectedDate(i.selectedDates[i.selectedDates.length-1])):(i.rangeDateFrom="",i.rangeDateTo="",i._updateLastSelectedDate(!1)),this.trigger(n.eventChangeSelectedDate,{action:n.actionUnselectDate,date:t}),!0})}replaceDate(t,e){let i=this.selectedDates.find(e=>p(e,t,this.currentView)),o=this.selectedDates.indexOf(i);o<0||p(this.selectedDates[o],e,this.currentView)||(this.selectedDates[o]=e,this.trigger(n.eventChangeSelectedDate,{action:n.actionSelectDate,date:e,updateTime:!0}),this._updateLastSelectedDate(e))}clear(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.selectedDates=[],this.rangeDateFrom=!1,this.rangeDateTo=!1,this.lastSelectedDate=!1,this.trigger(n.eventChangeSelectedDate,{action:n.actionUnselectDate,silent:t.silent}),new Promise(t=>{setTimeout(t)})}show(){let{onShow:t,isMobile:e}=this.opts;this._cancelScheduledCall(),this.visible||this.hideAnimation||this._createComponents(),this.setPosition(this.opts.position),this.$datepicker.classList.add("-active-"),this.visible=!0,t&&this._scheduleCallAfterTransition(t),e&&this._showMobileOverlay()}hide(){let{onHide:t,isMobile:e}=this.opts,n=this._hasTransition();this.visible=!1,this.hideAnimation=!0,this.$datepicker.classList.remove("-active-"),this.customHide&&this.customHide(),this.elIsInput&&this.$el.blur(),this._scheduleCallAfterTransition(e=>{!this.customHide&&(e&&n||!e&&!n)&&this._finishHide(),t&&t(e)}),e&&B.classList.remove("-active-")}_triggerOnSelect(){let t=[],e=[],{selectedDates:n,locale:i,opts:{onSelect:o,multipleDates:l,range:r}}=this,s=l||r,c="function"==typeof i.dateFormat;n.length&&(t=n.map(g),e=c?l?i.dateFormat(t):t.map(t=>i.dateFormat(t)):t.map(t=>this.formatDate(t,i.dateFormat))),o({date:s?t:t[0],formattedDate:s?e:e[0],datepicker:this})}_handleAlreadySelectedDates(t,e){let{selectedDates:n,rangeDateFrom:i,rangeDateTo:o}=this,{range:l,toggleSelected:r}=this.opts,s=n.length,c="function"==typeof r?r({datepicker:this,date:e}):r,a=Boolean(l&&1===s&&t),u=a?g(e):e;l&&!c&&(2!==s&&this.selectDate(u),2===s&&p(i,o))||(c?this.unselectDate(u):this._updateLastSelectedDate(a?u:t))}_handleUpDownActions(t,e){if(!((t=y(t||this.focusDate||this.viewDate))instanceof Date))return;let n="up"===e?this.viewIndex+1:this.viewIndex-1;n>2&&(n=2),n<0&&(n=0),this.setViewDate(new Date(t.getFullYear(),t.getMonth(),1)),this.setCurrentView(this.viewIndexes[n])}getCell(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:n.day;if(!((t=y(t))instanceof Date))return;let{year:i,month:o,date:l}=c(t),r=`[data-year="${i}"]`,s=`[data-month="${o}"]`,a={[n.day]:`${r}${s}[data-date="${l}"]`,[n.month]:`${r}${s}`,[n.year]:`${r}`};return this.views[this.currentView]?this.views[this.currentView].$el.querySelector(a[e]):void 0}_showMobileOverlay(){B.classList.add("-active-")}_hasTransition(){return window.getComputedStyle(this.$datepicker).getPropertyValue("transition-duration").split(", ").reduce((t,e)=>parseFloat(e)+t,0)>0}get shouldUpdateDOM(){return this.visible||this.treatAsInline}get parsedViewDate(){return c(this.viewDate)}get currentViewSingular(){return this.currentView.slice(0,-1)}get curDecade(){return d(this.viewDate)}get viewIndex(){return this.viewIndexes.indexOf(this.currentView)}get isFinalView(){return this.currentView===n.years}get hasSelectedDates(){return this.selectedDates.length>0}get isMinViewReached(){return this.currentView===this.opts.minView||this.currentView===n.days}get $container(){return this.$customContainer||L}static replacer(t,e,n){return t.replace(e,function(t,e,i,o){return e+n+o})}}var V;return R(P,"defaults",i),R(P,"version","3.6.0"),R(P,"defaultGlobalContainerId","air-datepicker-global-container"),V=P.prototype,Object.assign(V,I),e.default}()),Ni.exports),Fi=xi(Ai),Ii={};var Ri=xi((Oi||(Oi=1,Object.defineProperty(Ii,"D",{value:!0}),Ii.default=void 0,Ii.default={days:["Domenica","LunedΓ¬","MartedΓ¬","MercoledΓ¬","GiovedΓ¬","VenerdΓ¬","Sabato"],daysShort:["Dom","Lun","Mar","Mer","Gio","Ven","Sab"],daysMin:["Do","Lu","Ma","Me","Gi","Ve","Sa"],months:["Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto","Settembre","Ottobre","Novembre","Dicembre"],monthsShort:["Gen","Feb","Mar","Apr","Mag","Giu","Lug","Ago","Set","Ott","Nov","Dic"],today:"Oggi",clear:"Cancella",dateFormat:"dd/MM/yyyy",timeFormat:"HH:mm",firstDay:1}),Ii));function Li(t){let e,n,i,o;return{c(){e=f("input"),c(e,"type","text"),e.readOnly=t[1],c(e,"placeholder",t[4]),e.value=t[9],c(e,"maxlength","10"),c(e,"class",n="px-2 text-center "+(t[0]?"h-6 text-xs":"text-sm h-8 ")+" "+(t[1]?"bg-c-100 !text-c-200 ":"bg-white cursor-pointer ")+" text-c-800 border border-c-border min-w-32 "+(t[12].class||""))},m(n,l){u(n,e,l),i||(o=d(e,"input",t[11]),i=!0)},p(t,i){2&i&&(e.readOnly=t[1]),16&i&&c(e,"placeholder",t[4]),512&i&&e.value!==t[9]&&(e.value=t[9]),4099&i&&n!==(n="px-2 text-center "+(t[0]?"h-6 text-xs":"text-sm h-8 ")+" "+(t[1]?"bg-c-100 !text-c-200 ":"bg-white cursor-pointer ")+" text-c-800 border border-c-border min-w-32 "+(t[12].class||""))&&c(e,"class",n)},d(t){t&&r(e),i=!1,o()}}}function Bi(t){let e,n,i;return{c(){e=f("div"),n=k(t[9]),c(e,"class",i="pt-1 px-2 "+(t[0]?"h-6 text-xs":"text-sm h-8 ")+" "+(t[1]?"bg-c-100 !text-c-200 ":"bg-white cursor-pointer ")+" text-c-800 border border-c-border min-w-32 "+(t[12].class||""))},m(t,i){u(t,e,i),$(e,n)},p(t,o){512&o&&w(n,t[9]),4099&o&&i!==(i="pt-1 px-2 "+(t[0]?"h-6 text-xs":"text-sm h-8 ")+" "+(t[1]?"bg-c-100 !text-c-200 ":"bg-white cursor-pointer ")+" text-c-800 border border-c-border min-w-32 "+(t[12].class||""))&&c(e,"class",i)},d(t){t&&r(e)}}}function Hi(t){let e,n,i,o,s,a;return{c(){e=f("button"),n=D(),i=f("div"),o=f("div"),c(e,"class","fixed z-40 inset-0 bg-transparent"),c(e,"aria-label","input-data"),c(i,"class","fixed z-50 flex flex-col")},m(l,r){u(l,e,r),u(l,n,r),u(l,i,r),$(i,o),t[22](o),t[23](i),s||(a=d(e,"click",t[21]),s=!0)},p:l,d(o){o&&(r(e),r(n),r(i)),t[22](null),t[23](null),s=!1,a()}}}function Pi(t){let e,n,i,o,l,s;const c=t[18].default,a=h(c,t,t[17],null),p=a||function(t){let e;function n(t,e){return t[3]||t[2]?Bi:Li}let i=n(t),o=i(t);return{c(){o.c(),e=S()},m(t,n){o.m(t,n),u(t,e,n)},p(t,l){i===(i=n(t))&&o?o.p(t,l):(o.d(1),o=i(t),o&&(o.c(),o.m(e.parentNode,e)))},d(t){t&&r(e),o.d(t)}}}(t);let w=t[6]&&Hi(t);return{c(){e=f("button"),p&&p.c(),n=D(),w&&w.c(),i=S(),e.disabled=t[1]},m(r,c){u(r,e,c),p&&p.m(e,null),t[19](e),u(r,n,c),w&&w.m(r,c),u(r,i,c),o=!0,l||(s=d(e,"click",t[20]),l=!0)},p(t,[n]){a?a.p&&(!o||131072&n)&&b(a,c,t,t[17],o?v(c,t[17],n,null):x(t[17]),null):p&&p.p&&(!o||4639&n)&&p.p(t,o?n:-1),(!o||2&n)&&(e.disabled=t[1]),t[6]?w?w.p(t,n):(w=Hi(t),w.c(),w.m(i.parentNode,i)):w&&(w.d(1),w=null)},i(t){o||(g(p,t),o=!0)},o(t){m(p,t),o=!1},d(o){o&&(r(e),r(n),r(i)),p&&p.d(o),t[19](null),w&&w.d(o),l=!1,s()}}}function Vi(t,e,n){let l,{$$slots:r={},$$scope:s}=e;const{post:c,strDate:a}=on();let{value:u=0,sm:d=!1,readonly:f=!1,value2:h=0,mindata:m=0,maxdata:g=0,time:w=!1,range:b=!1,placeholder:x=""}=e;const v=K();let y,$,k,D,_;async function S(t){if(n(6,$=t),$&&y){await X();let t=[];u&&(t.push(u.toDate()),b&&h&&t.push(h.toDate()));let e={};w&&(e={inline:!0,timepicker:!0,minHours:9,maxHours:18,minutesStep:5}),_=new Fi(k,{locale:Ri,minDate:m?m.toDate():void 0,maxDate:g?g.toDate():void 0,selectedDates:t,multipleDatesSeparator:";",range:b,buttons:[{content:"oggi",onClick:()=>{const t=new Date;_.selectDate(t),n(13,u=c.oggi),b&&n(14,h=w?t.toFloat():t.toInt()),v("change",{value:u,value2:h})}},{content:"cancella",onClick:()=>{_.clear(),n(13,u=0),n(14,h=0),v("change",{value:u,value2:h})}},{content:"conferma",onClick:()=>{S(!1)}}],...e,onSelect(t){let{date:e}=t;Array.isArray(e)?(n(13,u=w?e[0]?.toFloat()||0:e[0]?.toInt()||0),n(14,h=w?e[1]?.toFloat()||0:e[1]?.toInt()||0)):(n(13,u=w?e?.toFloat()||0:e?.toInt()||0),n(14,h=0)),v("change",{value:u,value2:h})}}),We(y,k,{placement:"bottom",middleware:[Ye(6),qe(),Ue({padding:2})]}).then(({x:t,y:e,placement:n,middlewareData:i})=>{let o={top:`${e}px`,left:`${t}px`,zIndex:1e3};Object.assign(k.style,o)})}else _&&(_.destroy(),_=null,v("click"))}Z(()=>{_&&_.destroy()});return t.$$set=t=>{n(12,e=i(i({},e),o(t))),"value"in t&&n(13,u=t.value),"sm"in t&&n(0,d=t.sm),"readonly"in t&&n(1,f=t.readonly),"value2"in t&&n(14,h=t.value2),"mindata"in t&&n(15,m=t.mindata),"maxdata"in t&&n(16,g=t.maxdata),"time"in t&&n(2,w=t.time),"range"in t&&n(3,b=t.range),"placeholder"in t&&n(4,x=t.placeholder),"$$scope"in t&&n(17,s=t.$$scope)},t.$$.update=()=>{24588&t.$$.dirty&&n(9,l=function(){const t=f?x||" n.d. ":"gg/mm/aaaa",e=f?"":"ora";let n=u;return"object"==typeof n&&null!==n&&(n=n instanceof Date?w?n.toFloat():n.toInt():0),w?n?a(n,"datetime"):t+" "+e:b?(n?a(n,"ggmmyyyy"):t)+" - "+(h?a(h,"ggmmyyyy"):n?t:"gg/mm/aaaa"):n?a(n,"ggmmyyyy"):t}())},e=o(e),[d,f,w,b,x,y,$,k,D,l,S,function(t){const e=t.target,i=e.selectionStart,o=e.value.length,l=function(t){const e=t.replace(/\D/g,"");let n="";for(let t=0;t<e.length&&t<8;t++)2!==t&&4!==t||(n+="/"),n+=e[t];return n}(e.value);e.value=l;const r=i+(l.length-o);if(e.setSelectionRange(r,r),10===l.length){const[t,e,i]=l.split("/"),o=2===i.length?"20"+i:i,r=new Date(o,e-1,t);isNaN(r.getTime())||(_&&_.selectDate(r),n(13,u=w?r.toFloat():r.toInt()),v("change",{value:u,value2:h}))}},e,u,h,m,g,s,r,function(t){p[t?"unshift":"push"](()=>{y=t,n(5,y)})},async()=>await S(!$),()=>S(!1),function(t){p[t?"unshift":"push"](()=>{D=t,n(8,D)})},function(t){p[t?"unshift":"push"](()=>{k=t,n(7,k)})}]}class Yi extends t{constructor(t){super(),e(this,t,Vi,Pi,n,{value:13,sm:0,readonly:1,value2:14,mindata:15,maxdata:16,time:2,range:3,placeholder:4})}}function Ui(t,e,n){const i=t.slice();return i[70]=e[n],i}function qi(t,e,n){const i=t.slice();return i[73]=e[n],i}function Gi(t,e,n){const i=t.slice();return i[70]=e[n],i}function Wi(t){let e,n,i,o,a;return{c(){e=f("input"),c(e,"type",t[12]),c(e,"maxlength",t[4]),e.value=n=t[0]||"",e.disabled=t[14],c(e,"placeholder",i=t[25](t[3],t[24])),c(e,"autocorrect","off"),c(e,"autocomplete","off"),y(e,"sm",t[11]),y(e,"valid",t[7]),y(e,"error",t[8]),y(e,"readonly",t[14])},m(n,i){u(n,e,i),o||(a=[d(e,"input",t[64]),d(e,"blur",t[65]),d(e,"keypress",t[40])],o=!0)},p(t,o){4096&o[0]&&c(e,"type",t[12]),16&o[0]&&c(e,"maxlength",t[4]),1&o[0]&&n!==(n=t[0]||"")&&e.value!==n&&(e.value=n),16384&o[0]&&(e.disabled=t[14]),16777224&o[0]&&i!==(i=t[25](t[3],t[24]))&&c(e,"placeholder",i),2048&o[0]&&y(e,"sm",t[11]),128&o[0]&&y(e,"valid",t[7]),256&o[0]&&y(e,"error",t[8]),16384&o[0]&&y(e,"readonly",t[14])},i:l,o:l,d(t){t&&r(e),o=!1,s(a)}}}function Xi(t){let e,n,i;function o(e){t[63](e)}let l={sm:t[11],readonly:t[14],placeholder:t[3],time:!0,class:"",type:"text"};return void 0!==t[0]&&(l.value=t[0]),e=new Yi({props:l}),p.push(()=>U(e,"value",o)),e.$on("click",t[33]),{c(){F(e.$$.fragment)},m(t,n){O(e,t,n),i=!0},p(t,i){const o={};2048&i[0]&&(o.sm=t[11]),16384&i[0]&&(o.readonly=t[14]),8&i[0]&&(o.placeholder=t[3]),!n&&1&i[0]&&(n=!0,o.value=t[0],q(()=>n=!1)),e.$set(o)},i(t){i||(g(e.$$.fragment,t),i=!0)},o(t){m(e.$$.fragment,t),i=!1},d(t){N(e,t)}}}function Ki(t){let e,n,i;function o(e){t[62](e)}let l={sm:t[11],readonly:t[14],placeholder:t[3],class:"",type:"text"};return void 0!==t[0]&&(l.value=t[0]),e=new Yi({props:l}),p.push(()=>U(e,"value",o)),e.$on("click",t[33]),{c(){F(e.$$.fragment)},m(t,n){O(e,t,n),i=!0},p(t,i){const o={};2048&i[0]&&(o.sm=t[11]),16384&i[0]&&(o.readonly=t[14]),8&i[0]&&(o.placeholder=t[3]),!n&&1&i[0]&&(n=!0,o.value=t[0],q(()=>n=!1)),e.$set(o)},i(t){i||(g(e.$$.fragment,t),i=!0)},o(t){m(e.$$.fragment,t),i=!1},d(t){N(e,t)}}}function Zi(t){let e,n,i,o,a;return{c(){e=f("input"),c(e,"type","time"),e.value=n=wo(t[0]),e.disabled=t[14],c(e,"placeholder",i=t[25](t[3],t[24])),c(e,"autocorrect","off"),c(e,"autocomplete","off"),y(e,"sm",t[11]),y(e,"valid",t[7]),y(e,"error",t[8]),y(e,"readonly",t[14])},m(n,i){u(n,e,i),o||(a=[d(e,"keypress",t[60]),d(e,"blur",t[61])],o=!0)},p(t,o){1&o[0]&&n!==(n=wo(t[0]))&&e.value!==n&&(e.value=n),16384&o[0]&&(e.disabled=t[14]),16777224&o[0]&&i!==(i=t[25](t[3],t[24]))&&c(e,"placeholder",i),2048&o[0]&&y(e,"sm",t[11]),128&o[0]&&y(e,"valid",t[7]),256&o[0]&&y(e,"error",t[8]),16384&o[0]&&y(e,"readonly",t[14])},i:l,o:l,d(t){t&&r(e),o=!1,s(a)}}}function Ji(t){let e,n,i,o,a;return{c(){e=f("input"),c(e,"type","text"),e.value=n=t[18]?t[19]||"":t[35](t[0])||0,e.disabled=t[14],c(e,"placeholder",i=t[25](t[3],t[24])),c(e,"autocorrect","off"),c(e,"autocomplete","off"),y(e,"sm",t[11]),y(e,"valid",t[7]),y(e,"error",t[8]),y(e,"readonly",t[14])},m(n,i){u(n,e,i),o||(a=[d(e,"focus",t[57]),d(e,"keypress",t[58]),d(e,"blur",t[59])],o=!0)},p(t,o){786433&o[0]&&n!==(n=t[18]?t[19]||"":t[35](t[0])||0)&&e.value!==n&&(e.value=n),16384&o[0]&&(e.disabled=t[14]),16777224&o[0]&&i!==(i=t[25](t[3],t[24]))&&c(e,"placeholder",i),2048&o[0]&&y(e,"sm",t[11]),128&o[0]&&y(e,"valid",t[7]),256&o[0]&&y(e,"error",t[8]),16384&o[0]&&y(e,"readonly",t[14])},i:l,o:l,d(t){t&&r(e),o=!1,s(a)}}}function Qi(t){let e,n,i,o=t[22]&&oo(t);return{c(){e=f("select"),o&&o.c(),e.disabled=t[14],y(e,"sm",t[11]),y(e,"border-none",t[10])},m(l,r){u(l,e,r),o&&o.m(e,null),n||(i=[d(e,"change",t[31]),d(e,"click",A(bo))],n=!0)},p(t,n){t[22]?o?o.p(t,n):(o=oo(t),o.c(),o.m(e,null)):o&&(o.d(1),o=null),16384&n[0]&&(e.disabled=t[14]),2048&n[0]&&y(e,"sm",t[11]),1024&n[0]&&y(e,"border-none",t[10])},i:l,o:l,d(t){t&&r(e),o&&o.d(),n=!1,s(i)}}}function to(t){let e,n,i,o,s,a;return{c(){e=f("div"),n=f("input"),i=D(),o=f("label"),c(n,"class","checkbox"),c(n,"type","checkbox"),c(n,"id",t[41]),n.checked=t[20],n.disabled=t[14],y(n,"sm",t[11]),c(o,"for",t[41]),c(e,"class","text-4xl ml-2")},m(l,r){u(l,e,r),$(e,n),$(e,i),$(e,o),s||(a=d(n,"click",t[39]),s=!0)},p(t,e){1048576&e[0]&&(n.checked=t[20]),16384&e[0]&&(n.disabled=t[14]),2048&e[0]&&y(n,"sm",t[11])},i:l,o:l,d(t){t&&r(e),s=!1,a()}}}function eo(t){let e;const n=t[48].default,i=h(n,t,t[66],null),o=i||function(){let t;return{c(){t=f("div"),t.textContent="slot",c(t,"class","bg-c-100")},m(e,n){u(e,t,n)},p:l,d(e){e&&r(t)}}}();return{c(){o&&o.c()},m(t,n){o&&o.m(t,n),e=!0},p(t,o){i&&i.p&&(!e||16&o[2])&&b(i,n,t,t[66],e?v(n,t[66],o,null):x(t[66]),null)},i(t){e||(g(o,t),e=!0)},o(t){m(o,t),e=!1},d(t){o&&o.d(t)}}}function no(t){let e,n;return e=new hi({props:{$$slots:{popup:[mo],default:[po]},$$scope:{ctx:t}}}),t[55](e),e.$on("lostfocus",t[56]),{c(){F(e.$$.fragment)},m(t,i){O(e,t,i),n=!0},p(t,n){const i={};4440067&n[0]|16&n[2]&&(i.$$scope={dirty:n,ctx:t}),e.$set(i)},i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(n){t[55](null),N(e,n)}}}function io(t){let e,n,i,o;return{c(){e=f("textarea"),c(e,"rows",t[13]),e.value=t[23],c(e,"maxlength",t[4]),e.disabled=t[14],c(e,"placeholder",n=t[25](t[3],t[24])),y(e,"sm",t[11]),y(e,"valid",t[7]),y(e,"error",t[8]),y(e,"readonly",t[14])},m(n,l){u(n,e,l),i||(o=[d(e,"keypress",t[49]),d(e,"blur",t[50])],i=!0)},p(t,i){8192&i[0]&&c(e,"rows",t[13]),8388608&i[0]&&(e.value=t[23]),16&i[0]&&c(e,"maxlength",t[4]),16384&i[0]&&(e.disabled=t[14]),16777224&i[0]&&n!==(n=t[25](t[3],t[24]))&&c(e,"placeholder",n),2048&i[0]&&y(e,"sm",t[11]),128&i[0]&&y(e,"valid",t[7]),256&i[0]&&y(e,"error",t[8]),16384&i[0]&&y(e,"readonly",t[14])},i:l,o:l,d(t){t&&r(e),i=!1,s(o)}}}function oo(t){let e,n=B(t[22]),i=[];for(let e=0;e<n.length;e+=1)i[e]=ao(Ui(t,n,e));return{c(){for(let t=0;t<i.length;t+=1)i[t].c();e=S()},m(t,n){for(let e=0;e<i.length;e+=1)i[e]&&i[e].m(t,n);u(t,e,n)},p(t,o){if(6292032&o[0]){let l;for(n=B(t[22]),l=0;l<n.length;l+=1){const r=Ui(t,n,l);i[l]?i[l].p(r,o):(i[l]=ao(r),i[l].c(),i[l].m(e.parentNode,e))}for(;l<i.length;l+=1)i[l].d(1);i.length=n.length}},d(t){t&&r(e),H(i,t)}}}function lo(t){let e,n=(t[70].des??t[70])+"";return{c(){e=k(n)},m(t,n){u(t,e,n)},p(t,i){4194304&i[0]&&n!==(n=(t[70].des??t[70])+"")&&w(e,n)},d(t){t&&r(e)}}}function ro(t){let e,n,i,o=(t[70].cod??t[70].id)+"",l=t[70].des+"";return{c(){e=k(o),n=k(" - "),i=k(l)},m(t,o){u(t,e,o),u(t,n,o),u(t,i,o)},p(t,n){4194304&n[0]&&o!==(o=(t[70].cod??t[70].id)+"")&&w(e,o),4194304&n[0]&&l!==(l=t[70].des+"")&&w(i,l)},d(t){t&&(r(e),r(n),r(i))}}}function so(t){let e,n=(t[70].cod??t[70].id??t[70])+"";return{c(){e=k(n)},m(t,n){u(t,e,n)},p(t,i){4194304&i[0]&&n!==(n=(t[70].cod??t[70].id??t[70])+"")&&w(e,n)},d(t){t&&r(e)}}}function co(t){let e,n,i,o;function l(t,e){return t[6]?so:t[9]&&(t[70].cod||t[70].id)&&t[70].des?ro:lo}let s=l(t),c=s(t);return{c(){e=f("option"),c.c(),n=D(),e.j=i=t[70].cod??t[70].id??t[70],a(e,e.j),e.selected=o=""+t[21]==""+(t[70].cod??t[70].id??t[70])},m(t,i){u(t,e,i),c.m(e,null),$(e,n)},p(t,r){s===(s=l(t))&&c?c.p(t,r):(c.d(1),c=s(t),c&&(c.c(),c.m(e,n))),4194304&r[0]&&i!==(i=t[70].cod??t[70].id??t[70])&&(e.j=i,a(e,e.j)),6291456&r[0]&&o!==(o=""+t[21]==""+(t[70].cod??t[70].id??t[70]))&&(e.selected=o)},d(t){t&&r(e),c.d()}}}function ao(t){let e,i=t[70].cod??t[70].id??t[70],o=co(t);return{c(){o.c(),e=S()},m(t,n){o.m(t,n),u(t,e,n)},p(t,l){4194304&l[0]&&n(i,i=t[70].cod??t[70].id??t[70])?(o.d(1),o=co(t),o.c(),o.m(e.parentNode,e)):o.p(t,l)},d(t){t&&r(e),o.d(t)}}}function uo(t){let e,n,i,o,l=t[73]+"";return{c(){e=f("div"),n=f("div"),i=k(l),o=D(),c(n,"class","bg-c-base px-2 text-sm text-white rounded"),c(e,"class","pr-2")},m(t,l){u(t,e,l),$(e,n),$(n,i),$(e,o)},p(t,e){1&e[0]&&l!==(l=t[73]+"")&&w(i,l)},d(t){t&&r(e)}}}function fo(t){let e,n;return e=new en({props:{img:"more_horiz",size:6}}),{c(){F(e.$$.fragment)},m(t,i){O(e,t,i),n=!0},i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){N(e,t)}}}function po(t){let e,n,i,o,l,s,a,p,h,w,b,x=t[30](t[0],t[15]),v=B((t[0]||"").split(";")),y=[];for(let e=0;e<v.length;e+=1)y[e]=uo(qi(t,v,e));let k=x&&fo();return p=new en({props:{size:6,img:t[17]?"expand_less":"expand_more"}}),{c(){e=f("button"),n=f("div"),i=f("div"),o=f("div"),l=f("div");for(let t=0;t<y.length;t+=1)y[t].c();s=D(),k&&k.c(),a=D(),F(p.$$.fragment),c(l,"class","flex flex-auto"),c(o,"class","px-2 pt-1.5 overflow-hidden w-full h-full"),c(i,"class","absolute inset-0"),c(n,"class","flex-1 relative h-8"),c(e,"class","w-full flexrow border border-c-border bg-white h-8 items-center cursor-pointer")},m(r,c){u(r,e,c),$(e,n),$(n,i),$(i,o),$(o,l);for(let t=0;t<y.length;t+=1)y[t]&&y[t].m(l,null);t[53](l),$(e,s),k&&k.m(e,null),$(e,a),O(p,e,null),h=!0,w||(b=d(e,"click",t[54]),w=!0)},p(t,n){if(1&n[0]){let e;for(v=B((t[0]||"").split(";")),e=0;e<v.length;e+=1){const i=qi(t,v,e);y[e]?y[e].p(i,n):(y[e]=uo(i),y[e].c(),y[e].m(l,null))}for(;e<y.length;e+=1)y[e].d(1);y.length=v.length}32769&n[0]&&(x=t[30](t[0],t[15])),x?k?32769&n[0]&&g(k,1):(k=fo(),k.c(),g(k,1),k.m(e,a)):k&&(z(),m(k,1,1,()=>{k=null}),M());const i={};131072&n[0]&&(i.img=t[17]?"expand_less":"expand_more"),p.$set(i)},i(t){h||(g(k),g(p.$$.fragment,t),h=!0)},o(t){m(k),m(p.$$.fragment,t),h=!1},d(n){n&&r(e),H(y,n),t[53](null),k&&k.d(),N(p),w=!1,b()}}}function ho(t){let e,n,i,o;return n=new si({props:{checkbox:!0,xs:!0,labcod:(t[70].cod||t[70].id+"").toUpperCase(),label:(t[70].des||"").toLowerCase(),value:t[38](t[70])}}),n.$on("click",function(...e){return t[52](t[70],...e)}),{c(){e=f("div"),F(n.$$.fragment),i=D(),c(e,"class","w-full px-2 overflow-hidden")},m(t,l){u(t,e,l),O(n,e,null),$(e,i),o=!0},p(e,i){t=e;const o={};4194304&i[0]&&(o.labcod=(t[70].cod||t[70].id+"").toUpperCase()),4194304&i[0]&&(o.label=(t[70].des||"").toLowerCase()),4194304&i[0]&&(o.value=t[38](t[70])),n.$set(o)},i(t){o||(g(n.$$.fragment,t),o=!0)},o(t){m(n.$$.fragment,t),o=!1},d(t){t&&r(e),N(n)}}}function mo(t){let e,n,i,o,l,s;o=new si({props:{class:"font-bold",checkbox:!0,xs:!0,label:"seleziona/deseleziona tutto",value:t[28]}}),o.$on("click",t[51]);let a=B(t[22]),d=[];for(let e=0;e<a.length;e+=1)d[e]=ho(Gi(t,a,e));const p=t=>m(d[t],1,1,()=>{d[t]=null});return{c(){e=f("div"),n=f("div"),i=f("div"),F(o.$$.fragment),l=D();for(let t=0;t<d.length;t+=1)d[t].c();c(i,"class","w-full px-2 overflow-hidden"),c(n,"class","w-full flex flex-col space-y-1"),c(e,"slot","popup"),c(e,"class","max-h-[16rem] overflow-x-hidden overflow-y-auto bg-white border border-c-100 shadow p-1")},m(t,r){u(t,e,r),$(e,n),$(n,i),O(o,i,null),$(n,l);for(let t=0;t<d.length;t+=1)d[t]&&d[t].m(n,null);s=!0},p(t,e){if(4259840&e[0]|192&e[1]){let i;for(a=B(t[22]),i=0;i<a.length;i+=1){const o=Gi(t,a,i);d[i]?(d[i].p(o,e),g(d[i],1)):(d[i]=ho(o),d[i].c(),g(d[i],1),d[i].m(n,null))}for(z(),i=a.length;i<d.length;i+=1)p(i);M()}},i(t){if(!s){g(o.$$.fragment,t);for(let t=0;t<a.length;t+=1)g(d[t]);s=!0}},o(t){m(o.$$.fragment,t),d=d.filter(Boolean);for(let t=0;t<d.length;t+=1)m(d[t]);s=!1},d(t){t&&r(e),N(o),H(d,t)}}}function go(t){let e,n,i,o,l;const s=[io,no,eo,to,Qi,Ji,Zi,Ki,Xi,Wi],a=[];function d(t,e){return"area"===t[12]?0:"multiple"==t[12]?1:"slot"==t[12]?2:"check"===t[12]||"checkbox"==t[12]?3:"select"===t[12]?4:"number"===t[12]||"integer"===t[12]?5:"time"===t[12]?6:"date"===t[12]?7:"datetime"===t[12]?8:9}return n=d(t),i=a[n]=s[n](t),{c(){e=f("div"),i.c(),c(e,"class",o=`relative ${t[42].class||""}`)},m(t,i){u(t,e,i),a[n].m(e,null),l=!0},p(t,r){let u=n;n=d(t),n===u?a[n].p(t,r):(z(),m(a[u],1,1,()=>{a[u]=null}),M(),i=a[n],i?i.p(t,r):(i=a[n]=s[n](t),i.c()),g(i,1),i.m(e,null)),(!l||2048&r[1]&&o!==(o=`relative ${t[42].class||""}`))&&c(e,"class",o)},i(t){l||(g(i),l=!0)},o(t){m(i),l=!1},d(t){t&&r(e),a[n].d()}}}function wo(t){return t>0?("00"+t.toFixed(2)).slice(-5).replace(".",":"):"00:00"}const bo=()=>{};function xo(t,e,n){let l,r,s,c,a,{$$slots:u={},$$scope:d}=e;const{_:f,lang:h,tonum:m,listfromstring:g}=on();let w,b;I(t,h,t=>n(24,a=t));const x=K();let{value:v="",placeholder:y="",options:$,maxlength:k,forcestring:D=!1,uppercase:_=!1,onlycod:S=!1,valid:z=!1,error:M=!1,showcod:j=!1,noborder:E=!1,sm:C=!1,autosize:T,truevalue:N=1,falsevalue:O=0,type:A="text",decimali:F=2,coeff:R=1,rows:L=5,readonly:B=!1}=e,H=!1;function P(t){if(!T||"string"!=typeof T)return;let e=T.split(","),n=4*parseInt(e[0]||20),i=4*parseInt(e[1]||40),o=t.target;if(o){const t=o.scrollWidth+2;o.style.width=`${Math.max(n,Math.min(t,i))}px`}}function V(){return!!w&&w.scrollWidth>w.clientWidth}function Y(t){t&&(n(0,v=parseFloat(t.replace(":","."))),x("change",v))}async function U(){x("change",v)}function q(t){Array.isArray(v)?n(0,v=t.split("\n")):n(0,v=t)}let G,W=!1;function X(t){if(t)return t=parseFloat(t)||0,R&&(t*=R),parseFloat((t||0).toFixed("integer"==A?0:F))}function Z(t){var e=m(t,"integer"==A?0:F);n(0,v=e.isNaN?0:e/(R||1)),n(19,G=X(v)),U()}function J(t,e){var i=(e.cod||e.id+"").toLowerCase(),o=(v||"").toLowerCase().split(";");t&&!o.includes(i)?v?o.push(i):o=[i]:o.includes(i)&&(o=o.filter(t=>t!=i)),o.sort(),n(0,v=o.join(";"))}const Q=`c_${Math.floor(1e10*Math.random())}`;return t.$$set=t=>{n(42,e=i(i({},e),o(t))),"value"in t&&n(0,v=t.value),"placeholder"in t&&n(3,y=t.placeholder),"options"in t&&n(1,$=t.options),"maxlength"in t&&n(4,k=t.maxlength),"forcestring"in t&&n(43,D=t.forcestring),"uppercase"in t&&n(5,_=t.uppercase),"onlycod"in t&&n(6,S=t.onlycod),"valid"in t&&n(7,z=t.valid),"error"in t&&n(8,M=t.error),"showcod"in t&&n(9,j=t.showcod),"noborder"in t&&n(10,E=t.noborder),"sm"in t&&n(11,C=t.sm),"autosize"in t&&n(44,T=t.autosize),"truevalue"in t&&n(45,N=t.truevalue),"falsevalue"in t&&n(46,O=t.falsevalue),"type"in t&&n(12,A=t.type),"decimali"in t&&n(47,F=t.decimali),"coeff"in t&&n(2,R=t.coeff),"rows"in t&&n(13,L=t.rows),"readonly"in t&&n(14,B=t.readonly),"$$scope"in t&&n(66,d=t.$$scope)},t.$$.update=()=>{1&t.$$.dirty[0]&&n(23,l=Array.isArray(v)?v.join("\n"):v||""),2&t.$$.dirty[0]&&n(22,r=$?g($):[]),1&t.$$.dirty[0]&&n(21,s="object"==typeof v?v?.cod||v?.id:v),1&t.$$.dirty[0]|16384&t.$$.dirty[1]&&n(20,c=v==N),32768&t.$$.dirty[0]&&V()},e=o(e),[v,$,R,y,k,_,S,z,M,j,E,C,A,L,B,w,b,H,W,G,c,s,r,l,a,f,h,x,undefined,P,V,async function(t){var e=t.target.value;if("string"==typeof v||D)n(0,v=e);else if("number"==typeof v)n(0,v=parseInt(e));else{var i=r?.filter(t=>t.id==e||t.cod==e);n(0,v=i[0]||{cod:e})}x("click"),x("change",v)},Y,U,q,X,Z,J,function(t){var e=(t.cod||t.id+"").toLowerCase();return(v||"").toLowerCase().split(";").includes(e)?1:0},function(t){t.stopPropagation(),t.target.checked?n(0,v=N):n(0,v=O),x("click",v)},function(t){"Enter"==t.key&&x("click",v)},Q,e,D,T,N,O,F,u,t=>{q(t.target.value),U()},t=>{q(t.target.value)},t=>{for(var e of r)J(t.detail.value,e);t.detail.value||n(0,v=""),n(1,$=[...$])},(t,e)=>{b.checkvisibility(e)&&J(e.detail.value,t)},function(t){p[t?"unshift":"push"](()=>{w=t,n(15,w)})},()=>{B||(n(17,H=!H),b.openmenu(H))},function(t){p[t?"unshift":"push"](()=>{b=t,n(16,b)})},()=>n(17,H=!1),()=>{n(2,R=parseFloat(R)||1),n(19,G=X(v)),n(18,W=!0)},t=>{if("Escape"===t.key)n(19,G=X(v)),t.target.value=G;else if("Enter"===t.key){const e=v;Z(t.target.value),e!=v&&x("click",v)}else n(19,G=t.target.value)},t=>{n(18,W=!1);const e=v;Z(t.target.value),v!==e&&x("click",v)},t=>{n(18,W=!1),Y(t.target.value)},t=>{n(18,W=!1),Y(t.target.value)},function(t){v=t,n(0,v)},function(t){v=t,n(0,v)},t=>{n(0,v=_?(t.target.value||"").toUpperCase():t.target.value),U(),P(t)},t=>{v!=t.target.value&&(n(0,v=t.target.value),U())},d]}class vo extends t{constructor(t){super(),e(this,t,xo,go,n,{value:0,placeholder:3,options:1,maxlength:4,forcestring:43,uppercase:5,onlycod:6,valid:7,error:8,showcod:9,noborder:10,sm:11,autosize:44,truevalue:45,falsevalue:46,type:12,decimali:47,coeff:2,rows:13,readonly:14},null,[-1,-1,-1])}}function yo(t){let e,n,i;return n=new Dn({props:{id:t[1]}}),{c(){e=f("div"),F(n.$$.fragment),c(e,"class","label pt-1 h-6")},m(t,o){u(t,e,o),O(n,e,null),i=!0},p(t,e){const i={};2&e[0]&&(i.id=t[1]),n.$set(i)},i(t){i||(g(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&r(e),N(n)}}}function $o(t){let e,n,i;return n=new Dn({props:{id:t[1]}}),{c(){e=f("div"),F(n.$$.fragment),c(e,"class","label leading-none pr-2"),c(e,"style","wlabel?'width: '+wlabel+'%;':''"),y(e,"text-right",!t[2]),y(e,"text-sm",t[15])},m(t,o){u(t,e,o),O(n,e,null),i=!0},p(t,o){const l={};2&o[0]&&(l.id=t[1]),n.$set(l),(!i||4&o[0])&&y(e,"text-right",!t[2]),(!i||32768&o[0])&&y(e,"text-sm",t[15])},i(t){i||(g(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&r(e),N(n)}}}function ko(t){let e;const n=t[26].default,i=h(n,t,t[31],null);return{c(){i&&i.c()},m(t,n){i&&i.m(t,n),e=!0},p(t,o){i&&i.p&&(!e||1&o[1])&&b(i,n,t,t[31],e?v(n,t[31],o,null):x(t[31]),null)},i(t){e||(g(i,t),e=!0)},o(t){m(i,t),e=!1},d(t){i&&i.d(t)}}}function Do(t){let e,n,i="slot"==t[19]&&ko(t);return{c(){i&&i.c(),e=S()},m(t,o){i&&i.m(t,o),u(t,e,o),n=!0},p(t,n){"slot"==t[19]?i?(i.p(t,n),524288&n[0]&&g(i,1)):(i=ko(t),i.c(),g(i,1),i.m(e.parentNode,e)):i&&(z(),m(i,1,1,()=>{i=null}),M())},i(t){n||(g(i),n=!0)},o(t){m(i),n=!1},d(t){t&&r(e),i&&i.d(t)}}}function _o(t){let e,n,i;function o(e){t[27](e)}let l={placeholder:t[3],options:t[10],onlycod:t[5],uppercase:t[7],forcestring:t[9],tooltip:t[12],valid:t[13],autosize:t[8],error:t[14],sm:t[15],showcod:t[6],noborder:t[11],truevalue:t[16],falsevalue:t[18],type:t[19],decimali:t[20],maxlength:t[17],rows:t[21],coeff:t[22],disabled:t[23],readonly:t[24],$$slots:{default:[Do]},$$scope:{ctx:t}};return void 0!==t[0]&&(l.value=t[0]),e=new vo({props:l}),p.push(()=>U(e,"value",o)),e.$on("input",t[28]),e.$on("change",t[29]),e.$on("click",t[30]),{c(){F(e.$$.fragment)},m(t,n){O(e,t,n),i=!0},p(t,i){const o={};8&i[0]&&(o.placeholder=t[3]),1024&i[0]&&(o.options=t[10]),32&i[0]&&(o.onlycod=t[5]),128&i[0]&&(o.uppercase=t[7]),512&i[0]&&(o.forcestring=t[9]),4096&i[0]&&(o.tooltip=t[12]),8192&i[0]&&(o.valid=t[13]),256&i[0]&&(o.autosize=t[8]),16384&i[0]&&(o.error=t[14]),32768&i[0]&&(o.sm=t[15]),64&i[0]&&(o.showcod=t[6]),2048&i[0]&&(o.noborder=t[11]),65536&i[0]&&(o.truevalue=t[16]),262144&i[0]&&(o.falsevalue=t[18]),524288&i[0]&&(o.type=t[19]),1048576&i[0]&&(o.decimali=t[20]),131072&i[0]&&(o.maxlength=t[17]),2097152&i[0]&&(o.rows=t[21]),4194304&i[0]&&(o.coeff=t[22]),8388608&i[0]&&(o.disabled=t[23]),16777216&i[0]&&(o.readonly=t[24]),524288&i[0]|1&i[1]&&(o.$$scope={dirty:i,ctx:t}),!n&&1&i[0]&&(n=!0,o.value=t[0],q(()=>n=!1)),e.$set(o)},i(t){i||(g(e.$$.fragment,t),i=!0)},o(t){m(e.$$.fragment,t),i=!1},d(t){N(e,t)}}}function So(t){let e;const n=t[26].default,i=h(n,t,t[31],null);return{c(){i&&i.c()},m(t,n){i&&i.m(t,n),e=!0},p(t,o){i&&i.p&&(!e||1&o[1])&&b(i,n,t,t[31],e?v(n,t[31],o,null):x(t[31]),null)},i(t){e||(g(i,t),e=!0)},o(t){m(i,t),e=!1},d(t){i&&i.d(t)}}}function zo(t){let e,n,i,o,l,s,a,d,p,h=t[1]&&!t[4]&&yo(t),w=t[1]&&t[4]&&$o(t);s=new pn({props:{tooltip:t[12],$$slots:{default:[_o]},$$scope:{ctx:t}}});let b="slot"!=t[19]&&So(t);return{c(){e=f("div"),h&&h.c(),n=D(),i=f("div"),w&&w.c(),o=D(),l=f("div"),F(s.$$.fragment),a=D(),b&&b.c(),c(l,"class","flex-1"),c(i,"class","flexrow w-full space-x-1 items-center"),c(e,"class",d=`labinput ${t[25].class||""}`)},m(t,r){u(t,e,r),h&&h.m(e,null),$(e,n),$(e,i),w&&w.m(i,null),$(i,o),$(i,l),O(s,l,null),$(i,a),b&&b.m(i,null),p=!0},p(t,l){t[1]&&!t[4]?h?(h.p(t,l),18&l[0]&&g(h,1)):(h=yo(t),h.c(),g(h,1),h.m(e,n)):h&&(z(),m(h,1,1,()=>{h=null}),M()),t[1]&&t[4]?w?(w.p(t,l),18&l[0]&&g(w,1)):(w=$o(t),w.c(),g(w,1),w.m(i,o)):w&&(z(),m(w,1,1,()=>{w=null}),M());const r={};4096&l[0]&&(r.tooltip=t[12]),33554409&l[0]|1&l[1]&&(r.$$scope={dirty:l,ctx:t}),s.$set(r),"slot"!=t[19]?b?(b.p(t,l),524288&l[0]&&g(b,1)):(b=So(t),b.c(),g(b,1),b.m(i,null)):b&&(z(),m(b,1,1,()=>{b=null}),M()),(!p||33554432&l[0]&&d!==(d=`labinput ${t[25].class||""}`))&&c(e,"class",d)},i(t){p||(g(h),g(w),g(s.$$.fragment,t),g(b),p=!0)},o(t){m(h),m(w),m(s.$$.fragment,t),m(b),p=!1},d(t){t&&r(e),h&&h.d(),w&&w.d(),N(s),b&&b.d()}}}function Mo(t,e,n){let{$$slots:l={},$$scope:r}=e;const{_:s}=on();let{value:c="",label:a="",labelleft:u=!1,placeholder:d="",oriz:f=!1,onlycod:p=!1,showcod:h=!1,uppercase:m=!1,autosize:g,forcestring:w=!1,options:b,noborder:x=!1,tooltip:v="",valid:y=!1,error:$=!1,sm:k=!1,truevalue:D=1,maxlength:_,falsevalue:S=0,type:z="text",decimali:M=2,rows:j=5,coeff:E=1,disabled:C=!1,readonly:T=!1}=e;return t.$$set=t=>{n(25,e=i(i({},e),o(t))),"value"in t&&n(0,c=t.value),"label"in t&&n(1,a=t.label),"labelleft"in t&&n(2,u=t.labelleft),"placeholder"in t&&n(3,d=t.placeholder),"oriz"in t&&n(4,f=t.oriz),"onlycod"in t&&n(5,p=t.onlycod),"showcod"in t&&n(6,h=t.showcod),"uppercase"in t&&n(7,m=t.uppercase),"autosize"in t&&n(8,g=t.autosize),"forcestring"in t&&n(9,w=t.forcestring),"options"in t&&n(10,b=t.options),"noborder"in t&&n(11,x=t.noborder),"tooltip"in t&&n(12,v=t.tooltip),"valid"in t&&n(13,y=t.valid),"error"in t&&n(14,$=t.error),"sm"in t&&n(15,k=t.sm),"truevalue"in t&&n(16,D=t.truevalue),"maxlength"in t&&n(17,_=t.maxlength),"falsevalue"in t&&n(18,S=t.falsevalue),"type"in t&&n(19,z=t.type),"decimali"in t&&n(20,M=t.decimali),"rows"in t&&n(21,j=t.rows),"coeff"in t&&n(22,E=t.coeff),"disabled"in t&&n(23,C=t.disabled),"readonly"in t&&n(24,T=t.readonly),"$$scope"in t&&n(31,r=t.$$scope)},t.$$.update=()=>{t.$$.dirty[0]},e=o(e),[c,a,u,d,f,p,h,m,g,w,b,x,v,y,$,k,D,_,S,z,M,j,E,C,T,e,l,function(t){c=t,n(0,c)},function(e){Y.call(this,t,e)},function(e){Y.call(this,t,e)},function(e){Y.call(this,t,e)},r]}class jo extends t{constructor(t){super(),e(this,t,Mo,zo,n,{value:0,label:1,labelleft:2,placeholder:3,oriz:4,onlycod:5,showcod:6,uppercase:7,autosize:8,forcestring:9,options:10,noborder:11,tooltip:12,valid:13,error:14,sm:15,truevalue:16,maxlength:17,falsevalue:18,type:19,decimali:20,rows:21,coeff:22,disabled:23,readonly:24},null,[-1,-1])}}const Eo=t=>({}),Co=t=>({});function To(t){let e,n,i,o,l,a,p,h,w,b,x,v,y=t[5]&&No(t),k=(t[1]||t[7]||t[8])&&Oo(t);const _=[Fo,Ao],S=[];function j(t,e){return t[8]||t[7]?0:1}return p=j(t),h=S[p]=_[p](t),{c(){e=f("div"),n=f("button"),i=D(),o=f("button"),y&&y.c(),l=D(),k&&k.c(),a=D(),h.c(),c(n,"aria-label","msg_bg"),c(n,"class","msg_bg"),c(o,"class",t[15]),c(o,"style",t[14]),c(e,"class","msg_contenitore")},m(r,s){u(r,e,s),$(e,n),$(e,i),$(e,o),y&&y.m(o,null),$(o,l),k&&k.m(o,null),$(o,a),S[p].m(o,null),t[38](o),b=!0,x||(v=[d(n,"click",t[21]),d(o,"introend",t[39]),d(o,"click",t[40])],x=!0)},p(e,n){(t=e)[5]?y?(y.p(t,n),32&n[0]&&g(y,1)):(y=No(t),y.c(),g(y,1),y.m(o,l)):y&&(z(),m(y,1,1,()=>{y=null}),M()),t[1]||t[7]||t[8]?k?(k.p(t,n),386&n[0]&&g(k,1)):(k=Oo(t),k.c(),g(k,1),k.m(o,a)):k&&(z(),m(k,1,1,()=>{k=null}),M());let i=p;p=j(t),p===i?S[p].p(t,n):(z(),m(S[i],1,1,()=>{S[i]=null}),M(),h=S[p],h?h.p(t,n):(h=S[p]=_[p](t),h.c()),g(h,1),h.m(o,null)),(!b||32768&n[0])&&c(o,"class",t[15]),(!b||16384&n[0])&&c(o,"style",t[14])},i(e){b||(g(y),g(k),g(h),e&&E(()=>{b&&(w||(w=L(o,nt,t[9]?{x:-300,duration:400}:t[10]?{x:300,duration:400}:{y:200,duration:400},!0)),w.run(1))}),b=!0)},o(e){m(y),m(k),m(h),e&&(w||(w=L(o,nt,t[9]?{x:-300,duration:400}:t[10]?{x:300,duration:400}:{y:200,duration:400},!1)),w.run(0)),b=!1},d(n){n&&r(e),y&&y.d(),k&&k.d(),S[p].d(),t[38](null),n&&w&&w.end(),x=!1,s(v)}}}function No(t){let e,n,i;return n=new bn({props:{img:"close",gray:!0,size:6}}),n.$on("click",t[21]),{c(){e=f("div"),F(n.$$.fragment),c(e,"class","absolute top-2 right-1")},m(t,o){u(t,e,o),O(n,e,null),i=!0},p:l,i(t){i||(g(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&r(e),N(n)}}}function Oo(t){let e,n,i,o,l,a;return n=new Dn({props:{id:t[1]||""}}),{c(){e=f("button"),F(n.$$.fragment),c(e,"class",i="w-full py-2 px-4 text-left "+t[13]+" text-xl text-header")},m(i,r){u(i,e,r),O(n,e,null),o=!0,l||(a=[d(e,"mousedown",t[18]),d(e,"mousemove",t[19]),d(e,"mouseleave",t[20]),d(e,"mouseup",t[20])],l=!0)},p(t,l){const r={};2&l[0]&&(r.id=t[1]||""),n.$set(r),(!o||8192&l[0]&&i!==(i="w-full py-2 px-4 text-left "+t[13]+" text-xl text-header"))&&c(e,"class",i)},i(t){o||(g(n.$$.fragment,t),o=!0)},o(t){m(n.$$.fragment,t),o=!1},d(t){t&&r(e),N(n),l=!1,s(a)}}}function Ao(t){let e,n,i;const o=t[33].default,l=h(o,t,t[41],null),s=l||function(t){let e,n,i;return n=new Dn({props:{id:t[2],html:!0}}),{c(){e=f("div"),F(n.$$.fragment),c(e,"class","p-2 flex flex-col space-y-2")},m(t,o){u(t,e,o),O(n,e,null),i=!0},p(t,e){const i={};4&e[0]&&(i.id=t[2]),n.$set(i)},i(t){i||(g(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&r(e),N(n)}}}(t);let a=t[16]&&Io(t);return{c(){s&&s.c(),e=D(),a&&a.c(),n=S()},m(t,o){s&&s.m(t,o),u(t,e,o),a&&a.m(t,o),u(t,n,o),i=!0},p(t,e){l?l.p&&(!i||1024&e[1])&&b(l,o,t,t[41],i?v(o,t[41],e,null):x(t[41]),null):s&&s.p&&(!i||4&e[0])&&s.p(t,i?e:[-1,-1]),t[16]?a?(a.p(t,e),65536&e[0]&&g(a,1)):(a=Io(t),a.c(),g(a,1),a.m(n.parentNode,n)):a&&(z(),m(a,1,1,()=>{a=null}),M())},i(t){i||(g(s,t),g(a),i=!0)},o(t){m(s,t),m(a),i=!1},d(t){t&&(r(e),r(n)),s&&s.d(t),a&&a.d(t)}}}function Fo(t){let e,n,i,o,l=!t[6]&&Uo(t);const s=t[33].default,a=h(s,t,t[41],null);return{c(){l&&l.c(),e=D(),n=f("div"),a&&a.c(),c(n,"class",i="h-full bg-white overflow-y-auto "+(t[22].class||""))},m(t,i){l&&l.m(t,i),u(t,e,i),u(t,n,i),a&&a.m(n,null),o=!0},p(t,r){t[6]?l&&(z(),m(l,1,1,()=>{l=null}),M()):l?(l.p(t,r),64&r[0]&&g(l,1)):(l=Uo(t),l.c(),g(l,1),l.m(e.parentNode,e)),a&&a.p&&(!o||1024&r[1])&&b(a,s,t,t[41],o?v(s,t[41],r,null):x(t[41]),null),(!o||4194304&r[0]&&i!==(i="h-full bg-white overflow-y-auto "+(t[22].class||"")))&&c(n,"class",i)},i(t){o||(g(l),g(a,t),o=!0)},o(t){m(l),m(a,t),o=!1},d(t){t&&(r(e),r(n)),l&&l.d(t),a&&a.d(t)}}}function Io(t){let e,n,i,o;const l=[Lo,Ro],s=[];function a(t,e){return t[3]||t[4]?0:1}return n=a(t),i=s[n]=l[n](t),{c(){e=f("div"),i.c(),c(e,"class","flexrow w-full space-x-2 p-4")},m(t,i){u(t,e,i),s[n].m(e,null),o=!0},p(t,o){let r=n;n=a(t),n===r?s[n].p(t,o):(z(),m(s[r],1,1,()=>{s[r]=null}),M(),i=s[n],i?i.p(t,o):(i=s[n]=l[n](t),i.c()),g(i,1),i.m(e,null))},i(t){o||(g(i),o=!0)},o(t){m(i),o=!1},d(t){t&&r(e),s[n].d()}}}function Ro(t){let e,n,i,o,l,s;return l=new qn({props:{danger:t[11],$$slots:{default:[Bo]},$$scope:{ctx:t}}}),l.$on("click",t[37]),{c(){e=f("div"),n=D(),i=f("div"),o=D(),F(l.$$.fragment),c(e,"class","flex-1"),c(i,"class","flex-1")},m(t,r){u(t,e,r),u(t,n,r),u(t,i,r),u(t,o,r),O(l,t,r),s=!0},p(t,e){const n={};2048&e[0]&&(n.danger=t[11]),1024&e[1]&&(n.$$scope={dirty:e,ctx:t}),l.$set(n)},i(t){s||(g(l.$$.fragment,t),s=!0)},o(t){m(l.$$.fragment,t),s=!1},d(t){t&&(r(e),r(n),r(i),r(o)),N(l,t)}}}function Lo(t){let e,n,i,o,l,s,a;e=new qn({props:{alt:!0,$$slots:{default:[Ho]},$$scope:{ctx:t}}}),e.$on("click",t[34]);let d=t[4]&&Po(t);return s=new qn({props:{danger:t[11],$$slots:{default:[Yo]},$$scope:{ctx:t}}}),s.$on("click",t[36]),{c(){F(e.$$.fragment),n=D(),i=f("div"),o=D(),d&&d.c(),l=D(),F(s.$$.fragment),c(i,"class","flex-1")},m(t,r){O(e,t,r),u(t,n,r),u(t,i,r),u(t,o,r),d&&d.m(t,r),u(t,l,r),O(s,t,r),a=!0},p(t,n){const i={};1024&n[1]&&(i.$$scope={dirty:n,ctx:t}),e.$set(i),t[4]?d?(d.p(t,n),16&n[0]&&g(d,1)):(d=Po(t),d.c(),g(d,1),d.m(l.parentNode,l)):d&&(z(),m(d,1,1,()=>{d=null}),M());const o={};2048&n[0]&&(o.danger=t[11]),1024&n[1]&&(o.$$scope={dirty:n,ctx:t}),s.$set(o)},i(t){a||(g(e.$$.fragment,t),g(d),g(s.$$.fragment,t),a=!0)},o(t){m(e.$$.fragment,t),m(d),m(s.$$.fragment,t),a=!1},d(t){t&&(r(n),r(i),r(o),r(l)),N(e,t),d&&d.d(t),N(s,t)}}}function Bo(t){let e,n;return e=new Dn({props:{id:"ok"}}),{c(){F(e.$$.fragment)},m(t,i){O(e,t,i),n=!0},p:l,i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){N(e,t)}}}function Ho(t){let e,n;return e=new Dn({props:{id:"no"}}),{c(){F(e.$$.fragment)},m(t,i){O(e,t,i),n=!0},p:l,i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){N(e,t)}}}function Po(t){let e,n;return e=new qn({props:{alt:!0,$$slots:{default:[Vo]},$$scope:{ctx:t}}}),e.$on("click",t[35]),{c(){F(e.$$.fragment)},m(t,i){O(e,t,i),n=!0},p(t,n){const i={};1024&n[1]&&(i.$$scope={dirty:n,ctx:t}),e.$set(i)},i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){N(e,t)}}}function Vo(t){let e,n;return e=new Dn({props:{id:"cancella"}}),{c(){F(e.$$.fragment)},m(t,i){O(e,t,i),n=!0},p:l,i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){N(e,t)}}}function Yo(t){let e,n;return e=new Dn({props:{id:"si"}}),{c(){F(e.$$.fragment)},m(t,i){O(e,t,i),n=!0},p:l,i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){N(e,t)}}}function Uo(t){let e,n;const i=t[33].Footer,o=h(i,t,t[41],Co),l=o||function(){let t;return{c(){t=k("footer")},m(e,n){u(e,t,n)},d(e){e&&r(t)}}}();return{c(){e=f("div"),l&&l.c(),c(e,"class","outline-c-100 bg-c-group border-t p-2")},m(t,i){u(t,e,i),l&&l.m(e,null),n=!0},p(t,e){o&&o.p&&(!n||1024&e[1])&&b(o,i,t,t[41],n?v(i,t[41],e,Eo):x(t[41]),Co)},i(t){n||(g(l,t),n=!0)},o(t){m(l,t),n=!1},d(t){t&&r(e),l&&l.d(t)}}}function qo(t){let e,n,i=t[0]&&To(t);return{c(){i&&i.c(),e=S()},m(t,o){i&&i.m(t,o),u(t,e,o),n=!0},p(t,n){t[0]?i?(i.p(t,n),1&n[0]&&g(i,1)):(i=To(t),i.c(),g(i,1),i.m(e.parentNode,e)):i&&(z(),m(i,1,1,()=>{i=null}),M())},i(t){n||(g(i),n=!0)},o(t){m(i),n=!1},d(t){t&&r(e),i&&i.d(t)}}}function Go(t,e,n){let l,r,s,c,{$$slots:a={},$$scope:u}=e;const{autofocus:d}=on();let{show:f=!1,title:h="",text:m="",yesno:g=!1,yesnocancel:w=!1,noscroll:b=!1,close:x=!1,ok:v=!1,nofooter:y=!1,xl:$,screen:k,wfull:D,hfull:_,left:S,right:z,warning:M=!1,danger:j=!1,elexpand:E}=e;const C=K();var T,N,O=0,A=0,F=0,I=0,R=!1;function L(t){R&&(n(31,F=t.x-T),n(32,I=t.y-N))}function B(t){R&&(R=!1,n(29,O+=F),n(30,A+=I),n(31,F=0),n(32,I=0),window.removeEventListener("mousemove",L),window.removeEventListener("mouseup",B))}function H(t){C("close",t),C("click",t)}let P;return t.$$set=t=>{n(22,e=i(i({},e),o(t))),"show"in t&&n(0,f=t.show),"title"in t&&n(1,h=t.title),"text"in t&&n(2,m=t.text),"yesno"in t&&n(3,g=t.yesno),"yesnocancel"in t&&n(4,w=t.yesnocancel),"noscroll"in t&&n(23,b=t.noscroll),"close"in t&&n(5,x=t.close),"ok"in t&&n(24,v=t.ok),"nofooter"in t&&n(6,y=t.nofooter),"xl"in t&&n(25,$=t.xl),"screen"in t&&n(7,k=t.screen),"wfull"in t&&n(26,D=t.wfull),"hfull"in t&&n(8,_=t.hfull),"left"in t&&n(9,S=t.left),"right"in t&&n(10,z=t.right),"warning"in t&&n(27,M=t.warning),"danger"in t&&n(11,j=t.danger),"elexpand"in t&&n(28,E=t.elexpand),"$$scope"in t&&n(41,u=t.$$scope)},t.$$.update=()=>{4097&t.$$.dirty[0]&&(n(29,O=0),n(30,A=0),n(31,F=0),n(32,I=0),R=!1,d(f,P),n(29,O=0),n(30,A=0),n(31,F=0),n(32,I=0),R=!1),16777240&t.$$.dirty[0]&&n(16,l=v||g||w),100663680&t.$$.dirty[0]&&n(15,r=function(){if(!E||!E.getBoundingClientRect){var t="max-w-lg";if($){var e=parseInt($);t=e>1&&e<9?`max-w-${e}xl`:"max-w-xl"}return(D||k)&&(t="w-screen"),`relative overflow-x-hidden msg_msg ${t} ${S?"mr-auto":z?"ml-auto":"mx-auto"} \n ${D||_||k?"":"rounded-md"} \n ${_||k?y?"h-screen grid grid-rows-[auto_1fr]":"h-screen grid grid-rows-[auto_auto_1fr]":""} \n ${b||k||_?"overflow-y-hidden":"overflow-y-auto"}`}}()),1610613120&t.$$.dirty[0]|3&t.$$.dirty[1]&&n(14,s=function(){let t;if(E&&E.getBoundingClientRect){let e=E.getBoundingClientRect();return t=`position: fixed; top: ${e.top}px; left:${e.left}px; width: ${e.width}px; height: ${e.height}px;zIndex: 1000`,t}return t=O+F||A+I?`transform: translate(${O+F}px , ${A+I}px); `:"",(k||_)&&(t=`${t} height: ${_&&_>=20&&_<100?_+"vh":"100vh"};`),t}()),134219776&t.$$.dirty[0]&&n(13,c=j?"bg-c-danger":M?"bg-c-warning":"bg-headerbg")},e=o(e),[f,h,m,g,w,x,y,k,_,S,z,j,P,c,s,r,l,C,function(t){k||D||_||(T=t.x,N=t.y,R=!0,window.addEventListener("mousemove",L),window.addEventListener("mouseup",B))},L,B,H,e,b,v,$,D,M,E,O,A,F,I,a,()=>H("no"),()=>H("cancel"),()=>H("yes"),()=>H("yes"),function(t){p[t?"unshift":"push"](()=>{P=t,n(12,P)})},()=>C("loaded"),t=>{l&&(t.preventDefault(),t.stopPropagation())},u]}class Wo extends t{constructor(t){super(),e(this,t,Go,qo,n,{show:0,title:1,text:2,yesno:3,yesnocancel:4,noscroll:23,close:5,ok:24,nofooter:6,xl:25,screen:7,wfull:26,hfull:8,left:9,right:10,warning:27,danger:11,elexpand:28},null,[-1,-1])}}function Xo(t,e,n){const i=t.slice();return i[101]=e[n],i}function Ko(t,e,n){const i=t.slice();return i[104]=e[n],i[105]=e,i[106]=n,i}function Zo(t,e,n){const i=t.slice();return i[107]=e[n],i[108]=e,i[106]=n,i}function Jo(t,e,n){const i=t.slice();return i[109]=e[n],i}const Qo=t=>({bt:1048576&t[0],x:4&t[0]}),tl=t=>({bt:t[109],x:t[107],row:t[106]});function el(t,e,n){const i=t.slice();return i[104]=e[n],i}const nl=t=>({f:64&t[1],x:4&t[0]}),il=t=>({f:t[104],x:t[107],row:t[106]});function ol(t,e,n){const i=t.slice();return i[104]=e[n],i[114]=e,i[115]=n,i}function ll(t,e,n){const i=t.slice();return i[104]=e[n],i}const rl=t=>({}),sl=t=>({}),cl=t=>({}),al=t=>({}),ul=t=>({}),dl=t=>({}),fl=t=>({}),pl=t=>({});function hl(t){let e,n,i,o,l,s,a,d,h,w,b;const x=[gl,ml],v=[];function y(t,e){return t[8]?0:1}n=y(t),i=v[n]=x[n](t);let k=open&&function(t){let e,n,i,o;const l=[Sl,_l],s=[];function c(t,e){return 2==t[1]?0:1}return e=c(t),n=s[e]=l[e](t),{c(){n.c(),i=S()},m(t,n){s[e].m(t,n),u(t,i,n),o=!0},p(t,o){let r=e;e=c(t),e===r?s[e].p(t,o):(z(),m(s[r],1,1,()=>{s[r]=null}),M(),n=s[e],n?n.p(t,o):(n=s[e]=l[e](t),n.c()),g(n,1),n.m(i.parentNode,i))},i(t){o||(g(n),o=!0)},o(t){m(n),o=!1},d(t){t&&r(i),s[e].d(t)}}}(t);function _(e){t[88](e)}a=new Wo({props:{show:t[32],xl:2,title:"Dettaglio",close:!0,$$slots:{default:[cr]},$$scope:{ctx:t}}}),a.$on("close",t[47]);let j={element:t[29],$$slots:{default:[pr]},$$scope:{ctx:t}};return void 0!==t[30]&&(j.show=t[30]),h=new Bn({props:j}),p.push(()=>U(h,"show",_)),{c(){e=f("div"),i.c(),o=D(),k&&k.c(),s=D(),F(a.$$.fragment),d=D(),F(h.$$.fragment),c(e,"class",l=t[53].class||"")},m(t,i){u(t,e,i),v[n].m(e,null),$(e,o),k&&k.m(e,null),u(t,s,i),O(a,t,i),u(t,d,i),O(h,t,i),b=!0},p(t,r){let s=n;n=y(t),n===s?v[n].p(t,r):(z(),m(v[s],1,1,()=>{v[s]=null}),M(),i=v[n],i?i.p(t,r):(i=v[n]=x[n](t),i.c()),g(i,1),i.m(e,o)),open&&k.p(t,r),(!b||4194304&r[1]&&l!==(l=t[53].class||""))&&c(e,"class",l);const u={};2&r[1]&&(u.show=t[32]),10485761&r[0]|514&r[1]|134217728&r[2]&&(u.$$scope={dirty:r,ctx:t}),a.$set(u);const d={};536870912&r[0]&&(d.element=t[29]),1610612736&r[0]|1&r[1]|134217728&r[2]&&(d.$$scope={dirty:r,ctx:t}),!w&&1073741824&r[0]&&(w=!0,d.show=t[30],q(()=>w=!1)),h.$set(d)},i(t){b||(g(i),g(k),g(a.$$.fragment,t),g(h.$$.fragment,t),b=!0)},o(t){m(i),m(k),m(a.$$.fragment,t),m(h.$$.fragment,t),b=!1},d(t){t&&(r(e),r(s),r(d)),v[n].d(),k&&k.d(),N(a,t),N(h,t)}}}function ml(t){let e,n;return e=new pn({props:{tooltip:t[10],left:!0,bottom:!0,$$slots:{default:[Dl]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(t,i){O(e,t,i),n=!0},p(t,n){const i={};1024&n[0]&&(i.tooltip=t[10]),407773315&n[0]|128&n[1]|134217728&n[2]&&(i.$$scope={dirty:n,ctx:t}),e.$set(i)},i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){N(e,t)}}}function gl(t){let e;const n=t[59].default,i=h(n,t,t[89],null);return{c(){i&&i.c()},m(t,n){i&&i.m(t,n),e=!0},p(t,o){i&&i.p&&(!e||134217728&o[2])&&b(i,n,t,t[89],e?v(n,t[89],o,null):x(t[89]),null)},i(t){e||(g(i,t),e=!0)},o(t){m(i,t),e=!1},d(t){i&&i.d(t)}}}function wl(t){let e,n,i;return n=new bn({props:{white:!0,img:1==t[1]?"grid_view":"list",mat:!0,size:6}}),n.$on("click",t[60]),{c(){e=f("div"),F(n.$$.fragment)},m(t,o){u(t,e,o),O(n,e,null),i=!0},p(t,e){const i={};2&e[0]&&(i.img=1==t[1]?"grid_view":"list"),n.$set(i)},i(t){i||(g(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&r(e),N(n)}}}function bl(t){let e,n,i,o;function l(e){t[61](e)}let s={sm:!0};return void 0!==t[27]&&(s.value=t[27]),n=new Qn({props:s}),p.push(()=>U(n,"value",l)),n.$on("input",t[62]),n.$on("click",t[63]),{c(){e=f("div"),F(n.$$.fragment),c(e,"class","px-2 flex-1 md:w-64")},m(t,i){u(t,e,i),O(n,e,null),o=!0},p(t,e){const o={};!i&&134217728&e[0]&&(i=!0,o.value=t[27],q(()=>i=!1)),n.$set(o)},i(t){o||(g(n.$$.fragment,t),o=!0)},o(t){m(n.$$.fragment,t),o=!1},d(t){t&&r(e),N(n)}}}function xl(t){let e,n,i;return n=new bn({props:{alt:!0,img:"content_copy",mat:!0,size:6,tooltip:"Copia dati su clipboard (CSV)"}}),n.$on("click",t[64]),{c(){e=f("div"),F(n.$$.fragment),c(e,"class","h-6 w-6")},m(t,o){u(t,e,o),O(n,e,null),i=!0},p:l,i(t){i||(g(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&r(e),N(n)}}}function vl(t){let e,n,i;return n=new bn({props:{alt:!0,img:"file_download",mat:!0,size:6,tooltip:"string"==typeof t[18]?t[18]:"export tabella"}}),n.$on("click",t[65]),{c(){e=f("div"),F(n.$$.fragment),c(e,"class","h-6 w-6")},m(t,o){u(t,e,o),O(n,e,null),i=!0},p(t,e){const i={};262144&e[0]&&(i.tooltip="string"==typeof t[18]?t[18]:"export tabella"),n.$set(i)},i(t){i||(g(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&r(e),N(n)}}}function yl(t){let e,n,i;return n=new bn({props:{alt:!0,img:"file_upload",mat:!0,size:6,tooltip:"string"==typeof t[19]?t[19]:"import tabella"}}),n.$on("click",t[66]),{c(){e=f("div"),F(n.$$.fragment),c(e,"class","h-6 w-6")},m(t,o){u(t,e,o),O(n,e,null),i=!0},p(t,e){const i={};524288&e[0]&&(i.tooltip="string"==typeof t[19]?t[19]:"import tabella"),n.$set(i)},i(t){i||(g(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&r(e),N(n)}}}function $l(t){let e,n,i;return n=new bn({props:{size:6,img:t[28]?"filter_alt_off":"filter_alt"}}),n.$on("click",t[67]),{c(){e=f("div"),F(n.$$.fragment),c(e,"class","h-6")},m(t,o){u(t,e,o),O(n,e,null),i=!0},p(t,e){const i={};268435456&e[0]&&(i.img=t[28]?"filter_alt_off":"filter_alt"),n.$set(i)},i(t){i||(g(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&r(e),N(n)}}}function kl(t){let e,n;const i=t[59].btnadd,o=h(i,t,t[89],al),s=o||function(t){let e,n;return e=new bn({props:{size:6,img:"add"}}),e.$on("click",t[68]),{c(){F(e.$$.fragment)},m(t,i){O(e,t,i),n=!0},p:l,i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){N(e,t)}}}(t);return{c(){e=f("div"),s&&s.c(),c(e,"class","w-6 h-6")},m(t,i){u(t,e,i),s&&s.m(e,null),n=!0},p(t,e){o&&o.p&&(!n||134217728&e[2])&&b(o,i,t,t[89],n?v(i,t[89],e,cl):x(t[89]),al)},i(t){n||(g(s,t),n=!0)},o(t){m(s,t),n=!1},d(t){t&&r(e),s&&s.d(t)}}}function Dl(t){let e,n,i,o,l,s,a,d,p,w,y,k=t[1]&&wl(t);const _=t[59].title,S=h(_,t,t[89],pl),j=S||function(t){let e,n,i;return n=new Dn({props:{id:t[22]}}),{c(){e=f("div"),F(n.$$.fragment),c(e,"class","hidden px-2 md:block flex-1 text-xs md:text-sm text-left font-bold uppercase")},m(t,o){u(t,e,o),O(n,e,null),i=!0},p(t,e){const i={};4194304&e[0]&&(i.id=t[22]),n.$set(i)},i(t){i||(g(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&r(e),N(n)}}}(t),E=t[59].default,C=h(E,t,t[89],null);let T=!t[7]&&bl(t),A=t[17]&&xl(t),I=t[18]&&vl(t),R=t[19]&&yl(t),L=!t[13]&&$l(t);const B=t[59].btntitle,H=h(B,t,t[89],dl);let P=t[38]&&kl(t);return{c(){e=f("button"),k&&k.c(),n=D(),j&&j.c(),i=D(),C&&C.c(),o=D(),T&&T.c(),l=D(),A&&A.c(),s=D(),I&&I.c(),a=D(),R&&R.c(),d=D(),L&&L.c(),p=D(),H&&H.c(),w=D(),P&&P.c(),c(e,"class","titolo items-center")},m(t,r){u(t,e,r),k&&k.m(e,null),$(e,n),j&&j.m(e,null),$(e,i),C&&C.m(e,null),$(e,o),T&&T.m(e,null),$(e,l),A&&A.m(e,null),$(e,s),I&&I.m(e,null),$(e,a),R&&R.m(e,null),$(e,d),L&&L.m(e,null),$(e,p),H&&H.m(e,null),$(e,w),P&&P.m(e,null),y=!0},p(t,i){t[1]?k?(k.p(t,i),2&i[0]&&g(k,1)):(k=wl(t),k.c(),g(k,1),k.m(e,n)):k&&(z(),m(k,1,1,()=>{k=null}),M()),S?S.p&&(!y||134217728&i[2])&&b(S,_,t,t[89],y?v(_,t[89],i,fl):x(t[89]),pl):j&&j.p&&(!y||4194304&i[0])&&j.p(t,y?i:[-1,-1,-1,-1]),C&&C.p&&(!y||134217728&i[2])&&b(C,E,t,t[89],y?v(E,t[89],i,null):x(t[89]),null),t[7]?T&&(z(),m(T,1,1,()=>{T=null}),M()):T?(T.p(t,i),128&i[0]&&g(T,1)):(T=bl(t),T.c(),g(T,1),T.m(e,l)),t[17]?A?(A.p(t,i),131072&i[0]&&g(A,1)):(A=xl(t),A.c(),g(A,1),A.m(e,s)):A&&(z(),m(A,1,1,()=>{A=null}),M()),t[18]?I?(I.p(t,i),262144&i[0]&&g(I,1)):(I=vl(t),I.c(),g(I,1),I.m(e,a)):I&&(z(),m(I,1,1,()=>{I=null}),M()),t[19]?R?(R.p(t,i),524288&i[0]&&g(R,1)):(R=yl(t),R.c(),g(R,1),R.m(e,d)):R&&(z(),m(R,1,1,()=>{R=null}),M()),t[13]?L&&(z(),m(L,1,1,()=>{L=null}),M()):L?(L.p(t,i),8192&i[0]&&g(L,1)):(L=$l(t),L.c(),g(L,1),L.m(e,p)),H&&H.p&&(!y||134217728&i[2])&&b(H,B,t,t[89],y?v(B,t[89],i,ul):x(t[89]),dl),t[38]?P?(P.p(t,i),128&i[1]&&g(P,1)):(P=kl(t),P.c(),g(P,1),P.m(e,null)):P&&(z(),m(P,1,1,()=>{P=null}),M())},i(t){y||(g(k),g(j,t),g(C,t),g(T),g(A),g(I),g(R),g(L),g(H,t),g(P),y=!0)},o(t){m(k),m(j,t),m(C,t),m(T),m(A),m(I),m(R),m(L),m(H,t),m(P),y=!1},d(t){t&&r(e),k&&k.d(),j&&j.d(t),C&&C.d(t),T&&T.d(),A&&A.d(),I&&I.d(),R&&R.d(),L&&L.d(),H&&H.d(t),P&&P.d()}}}function _l(t){let e,n,i,o,l,s,a,p,h,w,b,x,v,y=t[15]&&zl(),k=t[16]&&Ml(t),_=B(t[37]),S=[];for(let e=0;e<_.length;e+=1)S[e]=Tl(ll(t,_,e));const j=t=>m(S[t],1,1,()=>{S[t]=null});let E=t[36]&&Nl(t),C=!t[13]&&t[28]&&t[0]&&Ol(t),T=B(t[2]),N=[];for(let e=0;e<T.length;e+=1)N[e]=ir(Zo(t,T,e));const O=t=>m(N[t],1,1,()=>{N[t]=null});return{c(){e=f("div"),n=f("table"),i=f("thead"),o=f("tr"),y&&y.c(),l=D(),k&&k.c(),s=D();for(let t=0;t<S.length;t+=1)S[t].c();a=D(),E&&E.c(),p=D(),C&&C.c(),h=D(),w=f("tbody");for(let t=0;t<N.length;t+=1)N[t].c();c(n,"class","table text-sm sm"),c(e,"class","relative w-full overflow-auto")},m(r,c){u(r,e,c),$(e,n),$(n,i),$(i,o),y&&y.m(o,null),$(o,l),k&&k.m(o,null),$(o,s);for(let t=0;t<S.length;t+=1)S[t]&&S[t].m(o,null);$(o,a),E&&E.m(o,null),$(i,p),C&&C.m(i,null),$(n,h),$(n,w);for(let t=0;t<N.length;t+=1)N[t]&&N[t].m(w,null);b=!0,x||(v=d(n,"mouseleave",t[83]),x=!0)},p(t,e){if(t[15]?y||(y=zl(),y.c(),y.m(o,l)):y&&(y.d(1),y=null),t[16]?k?(k.p(t,e),65536&e[0]&&g(k,1)):(k=Ml(t),k.c(),g(k,1),k.m(o,s)):k&&(z(),m(k,1,1,()=>{k=null}),M()),24&e[0]|4160&e[1]){let n;for(_=B(t[37]),n=0;n<_.length;n+=1){const i=ll(t,_,n);S[n]?(S[n].p(i,e),g(S[n],1)):(S[n]=Tl(i),S[n].c(),g(S[n],1),S[n].m(o,a))}for(z(),n=_.length;n<S.length;n+=1)j(n);M()}if(t[36]?E?(E.p(t,e),32&e[1]&&g(E,1)):(E=Nl(t),E.c(),g(E,1),E.m(o,null)):E&&(z(),m(E,1,1,()=>{E=null}),M()),!t[13]&&t[28]&&t[0]?C?(C.p(t,e),268443649&e[0]&&g(C,1)):(C=Ol(t),C.c(),g(C,1),C.m(i,null)):C&&(z(),m(C,1,1,()=>{C=null}),M()),1729223268&e[0]|4075645&e[1]|134217728&e[2]){let n;for(T=B(t[2]),n=0;n<T.length;n+=1){const i=Zo(t,T,n);N[n]?(N[n].p(i,e),g(N[n],1)):(N[n]=ir(i),N[n].c(),g(N[n],1),N[n].m(w,null))}for(z(),n=T.length;n<N.length;n+=1)O(n);M()}},i(t){if(!b){g(k);for(let t=0;t<_.length;t+=1)g(S[t]);g(E),g(C);for(let t=0;t<T.length;t+=1)g(N[t]);b=!0}},o(t){m(k),S=S.filter(Boolean);for(let t=0;t<S.length;t+=1)m(S[t]);m(E),m(C),N=N.filter(Boolean);for(let t=0;t<N.length;t+=1)m(N[t]);b=!1},d(t){t&&r(e),y&&y.d(),k&&k.d(),H(S,t),E&&E.d(),C&&C.d(),H(N,t),x=!1,v()}}}function Sl(t){let e;const n=t[59].grid,i=h(n,t,t[89],sl),o=i||function(){let t;return{c(){t=f("div"),t.textContent="mostra la griglia"},m(e,n){u(e,t,n)},p:l,d(e){e&&r(t)}}}();return{c(){o&&o.c()},m(t,n){o&&o.m(t,n),e=!0},p(t,o){i&&i.p&&(!e||134217728&o[2])&&b(i,n,t,t[89],e?v(n,t[89],o,rl):x(t[89]),sl)},i(t){e||(g(o,t),e=!0)},o(t){m(o,t),e=!1},d(t){o&&o.d(t)}}}function zl(t){let e;return{c(){e=f("th"),c(e,"class","w-5")},m(t,n){u(t,e,n)},d(t){t&&r(e)}}}function Ml(t){let e,n,i;return n=new pn({props:{tooltip:"seleziona righe",$$slots:{default:[jl]},$$scope:{ctx:t}}}),{c(){e=f("th"),F(n.$$.fragment),c(e,"class","w-6")},m(t,o){u(t,e,o),O(n,e,null),i=!0},p(t,e){const i={};134217728&e[2]&&(i.$$scope={dirty:e,ctx:t}),n.$set(i)},i(t){i||(g(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&r(e),N(n)}}}function jl(t){let e,n;return e=new si({props:{checkbox:!0,xs:!0}}),e.$on("click",t[69]),{c(){F(e.$$.fragment)},m(t,i){O(e,t,i),n=!0},p:l,i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){N(e,t)}}}function El(t){let e,n=("."==t[104]?.des?"":t[104]?.des||t[104]?.cod||"")+"";return{c(){e=k(n)},m(t,n){u(t,e,n)},p(t,i){64&i[1]&&n!==(n=("."==t[104]?.des?"":t[104]?.des||t[104]?.cod||"")+"")&&w(e,n)},d(t){t&&r(e)}}}function Cl(t){let e;return{c(){e=f("div"),e.textContent="β³",c(e,"class","absolute left-0 inset-y-0 text-sm text-c-200")},m(t,n){u(t,e,n)},d(t){t&&r(e)}}}function Tl(t){let e,n,i,o,l,s,a;i=new pn({props:{tooltip:t[104].tooltip,$$slots:{default:[El]},$$scope:{ctx:t}}});let p=t[104].sort&&Cl();function h(){return t[70](t[104])}return{c(){e=f("th"),n=f("div"),F(i.$$.fragment),o=D(),p&&p.c(),c(n,"class","relative"),y(n,"pl-2",t[104].sort),y(e,"selected",t[104].cod==t[3])},m(t,r){u(t,e,r),$(e,n),O(i,n,null),$(n,o),p&&p.m(n,null),l=!0,s||(a=d(e,"click",h),s=!0)},p(o,r){t=o;const s={};64&r[1]&&(s.tooltip=t[104].tooltip),64&r[1]|134217728&r[2]&&(s.$$scope={dirty:r,ctx:t}),i.$set(s),t[104].sort?p||(p=Cl(),p.c(),p.m(n,null)):p&&(p.d(1),p=null),(!l||64&r[1])&&y(n,"pl-2",t[104].sort),(!l||8&r[0]|64&r[1])&&y(e,"selected",t[104].cod==t[3])},i(t){l||(g(i.$$.fragment,t),l=!0)},o(t){m(i.$$.fragment,t),l=!1},d(t){t&&r(e),N(i),p&&p.d(),s=!1,a()}}}function Nl(t){let e,n,i,o;return n=new Dn({props:{id:"azioni"}}),{c(){e=f("th"),F(n.$$.fragment),c(e,"style",i=`width: ${1.75*t[35]+.5}rem;`)},m(t,i){u(t,e,i),O(n,e,null),o=!0},p(t,n){(!o||16&n[1]&&i!==(i=`width: ${1.75*t[35]+.5}rem;`))&&c(e,"style",i)},i(t){o||(g(n.$$.fragment,t),o=!0)},o(t){m(n.$$.fragment,t),o=!1},d(t){t&&r(e),N(n)}}}function Ol(t){let e,n,i,o,l,s,a,d,p=t[15]&&Al(),h=t[16]&&Fl(),w=B(t[37]),b=[];for(let e=0;e<w.length;e+=1)b[e]=Rl(ol(t,w,e));const x=t=>m(b[t],1,1,()=>{b[t]=null});return a=new bn({props:{size:6,tooltip:"Filtra",img:"view_column"}}),a.$on("click",t[73]),{c(){e=f("tr"),p&&p.c(),n=D(),h&&h.c(),i=D();for(let t=0;t<b.length;t+=1)b[t].c();o=D(),l=f("td"),s=f("div"),F(a.$$.fragment),c(s,"class","flex flex-row w-full mt-1 px-2 space-x-1 justify-end")},m(t,r){u(t,e,r),p&&p.m(e,null),$(e,n),h&&h.m(e,null),$(e,i);for(let t=0;t<b.length;t+=1)b[t]&&b[t].m(e,null);$(e,o),$(e,l),$(l,s),O(a,s,null),d=!0},p(t,l){if(t[15]?p||(p=Al(),p.c(),p.m(e,n)):p&&(p.d(1),p=null),t[16]?h||(h=Fl(),h.c(),h.m(e,i)):h&&(h.d(1),h=null),1&l[0]|4160&l[1]){let n;for(w=B(t[37]),n=0;n<w.length;n+=1){const i=ol(t,w,n);b[n]?(b[n].p(i,l),g(b[n],1)):(b[n]=Rl(i),b[n].c(),g(b[n],1),b[n].m(e,o))}for(z(),n=w.length;n<b.length;n+=1)x(n);M()}},i(t){if(!d){for(let t=0;t<w.length;t+=1)g(b[t]);g(a.$$.fragment,t),d=!0}},o(t){b=b.filter(Boolean);for(let t=0;t<b.length;t+=1)m(b[t]);m(a.$$.fragment,t),d=!1},d(t){t&&r(e),p&&p.d(),h&&h.d(),H(b,t),N(a)}}}function Al(t){let e;return{c(){e=f("th"),c(e,"class","w-5")},m(t,n){u(t,e,n)},d(t){t&&r(e)}}}function Fl(t){let e;return{c(){e=f("th"),c(e,"class","w-6")},m(t,n){u(t,e,n)},d(t){t&&r(e)}}}function Il(t){let e,n,i;function o(e){t[71](e,t[104])}let l={class:"w-10",autosize:"10-80",sm:!0,readonly:!t[104].visible,type:"text"};return void 0!==t[0][t[104]?.cod]&&(l.value=t[0][t[104]?.cod]),e=new jo({props:l}),p.push(()=>U(e,"value",o)),e.$on("click",t[72]),{c(){F(e.$$.fragment)},m(t,n){O(e,t,n),i=!0},p(i,o){t=i;const l={};64&o[1]&&(l.readonly=!t[104].visible),!n&&1&o[0]|64&o[1]&&(n=!0,l.value=t[0][t[104]?.cod],q(()=>n=!1)),e.$set(l)},i(t){i||(g(e.$$.fragment,t),i=!0)},o(t){m(e.$$.fragment,t),i=!1},d(t){N(e,t)}}}function Rl(t){let e,n,i=t[104].sort&&!["date","datetime","time","perc","euro","int","float"].includes((t[104].type||"").split("|")[0]),o=i&&Il(t);return{c(){e=f("td"),o&&o.c()},m(t,i){u(t,e,i),o&&o.m(e,null),n=!0},p(t,n){64&n[1]&&(i=t[104].sort&&!["date","datetime","time","perc","euro","int","float"].includes((t[104].type||"").split("|")[0])),i?o?(o.p(t,n),64&n[1]&&g(o,1)):(o=Il(t),o.c(),g(o,1),o.m(e,null)):o&&(z(),m(o,1,1,()=>{o=null}),M())},i(t){n||(g(o),n=!0)},o(t){m(o),n=!1},d(t){t&&r(e),o&&o.d()}}}function Ll(t){let e,n,i,o,l,s;function a(...e){return t[74](t[106],...e)}return i=new en({props:{size:6,img:"drag_indicator"}}),{c(){e=f("td"),n=f("button"),F(i.$$.fragment),c(n,"class","cursor-pointer"),c(e,"class","w-5 h-8 relative")},m(t,r){u(t,e,r),$(e,n),O(i,n,null),o=!0,l||(s=d(n,"mousedown",a),l=!0)},p(e,n){t=e},i(t){o||(g(i.$$.fragment,t),o=!0)},o(t){m(i.$$.fragment,t),o=!1},d(t){t&&r(e),N(i),l=!1,s()}}}function Bl(t){let e,n,i,o;function l(e){t[75](e,t[107])}let s={checkbox:!0,xs:!0};return void 0!==t[107]._sel&&(s.value=t[107]._sel),n=new si({props:s}),p.push(()=>U(n,"value",l)),{c(){e=f("td"),F(n.$$.fragment),c(e,"class","w-5")},m(t,i){u(t,e,i),O(n,e,null),o=!0},p(e,o){t=e;const l={};!i&&4&o[0]&&(i=!0,l.value=t[107]._sel,q(()=>i=!1)),n.$set(l)},i(t){o||(g(n.$$.fragment,t),o=!0)},o(t){m(n.$$.fragment,t),o=!1},d(t){t&&r(e),N(n)}}}function Hl(t){let e,n,i=t[48](t[104],t[107])+"";return{c(){e=f("div"),n=k(i),c(e,"class","px-1")},m(t,i){u(t,e,i),$(e,n)},p(t,e){4&e[0]|64&e[1]&&i!==(i=t[48](t[104],t[107])+"")&&w(n,i)},i:l,o:l,d(t){t&&r(e)}}}function Pl(t){let e,n,i,o,l;const s=[ql,Ul],c=[];function a(t,n){return 4&n[0]|64&n[1]&&(e=null),null==e&&(e=!!t[48](t[104],t[107])),e?0:1}return n=a(t,[-1,-1,-1,-1]),i=c[n]=s[n](t),{c(){i.c(),o=S()},m(t,e){c[n].m(t,e),u(t,o,e),l=!0},p(t,e){let l=n;n=a(t,e),n!==l&&(z(),m(c[l],1,1,()=>{c[l]=null}),M(),i=c[n],i||(i=c[n]=s[n](t),i.c()),g(i,1),i.m(o.parentNode,o))},i(t){l||(g(i),l=!0)},o(t){m(i),l=!1},d(t){t&&r(o),c[n].d(t)}}}function Vl(t){let e,n=t[48](t[104],t[107])+"";return{c(){e=f("div"),c(e,"class","px-1")},m(t,i){u(t,e,i),e.innerHTML=n},p(t,i){4&i[0]|64&i[1]&&n!==(n=t[48](t[104],t[107])+"")&&(e.innerHTML=n)},i:l,o:l,d(t){t&&r(e)}}}function Yl(t){let e;const n=t[59].row,i=h(n,t,t[89],il),o=i||function(t){let e,n,i=t[104].type+"";return{c(){e=f("div"),n=k(i),c(e,"class","bg-c-warning px-1")},m(t,i){u(t,e,i),$(e,n)},p(t,e){64&e[1]&&i!==(i=t[104].type+"")&&w(n,i)},d(t){t&&r(e)}}}(t);return{c(){o&&o.c()},m(t,n){o&&o.m(t,n),e=!0},p(t,l){i?i.p&&(!e||4&l[0]|64&l[1]|134217728&l[2])&&b(i,n,t,t[89],e?v(n,t[89],l,nl):x(t[89]),il):o&&o.p&&(!e||64&l[1])&&o.p(t,e?l:[-1,-1,-1,-1])},i(t){e||(g(o,t),e=!0)},o(t){m(o,t),e=!1},d(t){o&&o.d(t)}}}function Ul(t){let e,n;return e=new en({props:{img:"do_not_disturb_on",color:"text-c-danger",size:6}}),{c(){F(e.$$.fragment)},m(t,i){O(e,t,i),n=!0},i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){N(e,t)}}}function ql(t){let e,n;return e=new en({props:{img:"check_circle",color:"text-c-success",size:6}}),{c(){F(e.$$.fragment)},m(t,i){O(e,t,i),n=!0},i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){N(e,t)}}}function Gl(t){let e,n,i,o,l,s,a,d,p;const h=[Yl,Vl,Pl,Hl],w=[];function b(t,e){return 64&e[1]&&(i=null),64&e[1]&&(o=null),"."==(t[104].type||"")[0]?0:(null==i&&(i=!("html"!=(t[104].type||"").split("|")[0])),i?1:(null==o&&(o=!("check"!=(t[104].type||"").split("|")[0])),o?2:3))}return l=b(t,[-1,-1,-1,-1]),s=w[l]=h[l](t),{c(){e=f("td"),n=f("div"),s.c(),c(n,"class","flex flex-col"),c(e,"class",a=mr(t[104])),c(e,"data-name",d=t[104]?.des||t[104]?.cod||"")},m(t,i){u(t,e,i),$(e,n),w[l].m(n,null),p=!0},p(t,i){let o=l;l=b(t,i),l===o?w[l].p(t,i):(z(),m(w[o],1,1,()=>{w[o]=null}),M(),s=w[l],s?s.p(t,i):(s=w[l]=h[l](t),s.c()),g(s,1),s.m(n,null)),(!p||64&i[1]&&a!==(a=mr(t[104])))&&c(e,"class",a),(!p||64&i[1]&&d!==(d=t[104]?.des||t[104]?.cod||""))&&c(e,"data-name",d)},i(t){p||(g(s),p=!0)},o(t){m(s),p=!1},d(t){t&&r(e),w[l].d()}}}function Wl(t){let e,n,i,o,l,s,a,d=(t[25]||"function"==typeof t[6]&&t[6](t[107],t[106]))&&(!t[12]||!t[107].annulla),p=t[52](t[107]).length,h=B(t[20]),w=[];for(let e=0;e<h.length;e+=1)w[e]=Zl(Jo(t,h,e));const b=t=>m(w[t],1,1,()=>{w[t]=null});let x=(t[24]||"function"==typeof t[5])&&(!t[12]||!t[107].annulla)&&Jl(t),v=d&&er(t),y=p&&nr(t);return{c(){e=f("td"),n=f("div");for(let t=0;t<w.length;t+=1)w[t].c();i=D(),x&&x.c(),o=D(),v&&v.c(),l=D(),y&&y.c(),c(n,"class","flex flex-wrap items-center justify-start space-x-1 p-1"),c(n,"style",s=`width: ${1.75*t[35]+.5}rem;`),c(e,"data-name","azioni")},m(t,r){u(t,e,r),$(e,n);for(let t=0;t<w.length;t+=1)w[t]&&w[t].m(n,null);$(n,i),x&&x.m(n,null),$(n,o),v&&v.m(n,null),$(n,l),y&&y.m(n,null),a=!0},p(t,e){if(1048580&e[0]|4096&e[1]|134217728&e[2]){let o;for(h=B(t[20]),o=0;o<h.length;o+=1){const l=Jo(t,h,o);w[o]?(w[o].p(l,e),g(w[o],1)):(w[o]=Zl(l),w[o].c(),g(w[o],1),w[o].m(n,i))}for(z(),o=h.length;o<w.length;o+=1)b(o);M()}!t[24]&&"function"!=typeof t[5]||t[12]&&t[107].annulla?x&&(z(),m(x,1,1,()=>{x=null}),M()):x?(x.p(t,e),16781348&e[0]&&g(x,1)):(x=Jl(t),x.c(),g(x,1),x.m(n,o)),33558596&e[0]&&(d=(t[25]||"function"==typeof t[6]&&t[6](t[107],t[106]))&&(!t[12]||!t[107].annulla)),d?v?(v.p(t,e),33558596&e[0]&&g(v,1)):(v=er(t),v.c(),g(v,1),v.m(n,l)):v&&(z(),m(v,1,1,()=>{v=null}),M()),4&e[0]&&(p=t[52](t[107]).length),p?y?(y.p(t,e),4&e[0]&&g(y,1)):(y=nr(t),y.c(),g(y,1),y.m(n,null)):y&&(z(),m(y,1,1,()=>{y=null}),M()),(!a||16&e[1]&&s!==(s=`width: ${1.75*t[35]+.5}rem;`))&&c(n,"style",s)},i(t){if(!a){for(let t=0;t<h.length;t+=1)g(w[t]);g(x),g(v),g(y),a=!0}},o(t){w=w.filter(Boolean);for(let t=0;t<w.length;t+=1)m(w[t]);m(x),m(v),m(y),a=!1},d(t){t&&r(e),H(w,t),x&&x.d(),v&&v.d(),y&&y.d()}}}function Xl(t){let e,n;return e=new bn({props:{size:6,tooltip:t[109].tooltip||"",img:t[109].icon,gray:"gray"==t[109].decor,danger:"danger"==t[109].decor,warning:"warning"==t[109].decor,white:"white"==t[109].decor,black:"black"==t[109].decor}}),e.$on("click",function(){return t[76](t[107],t[106],t[108],t[109])}),{c(){F(e.$$.fragment)},m(t,i){O(e,t,i),n=!0},p(n,i){t=n;const o={};1048576&i[0]&&(o.tooltip=t[109].tooltip||""),1048576&i[0]&&(o.img=t[109].icon),1048576&i[0]&&(o.gray="gray"==t[109].decor),1048576&i[0]&&(o.danger="danger"==t[109].decor),1048576&i[0]&&(o.warning="warning"==t[109].decor),1048576&i[0]&&(o.white="white"==t[109].decor),1048576&i[0]&&(o.black="black"==t[109].decor),e.$set(o)},i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){N(e,t)}}}function Kl(t){let e;const n=t[59].extra,i=h(n,t,t[89],tl);return{c(){i&&i.c()},m(t,n){i&&i.m(t,n),e=!0},p(t,o){i&&i.p&&(!e||1048580&o[0]|134217728&o[2])&&b(i,n,t,t[89],e?v(n,t[89],o,Qo):x(t[89]),tl)},i(t){e||(g(i,t),e=!0)},o(t){m(i,t),e=!1},d(t){i&&i.d(t)}}}function Zl(t){let e,n,i,o;const l=[Kl,Xl],s=[];function c(t,e){return t[109].slot?0:1}return e=c(t),n=s[e]=l[e](t),{c(){n.c(),i=S()},m(t,n){s[e].m(t,n),u(t,i,n),o=!0},p(t,o){let r=e;e=c(t),e===r?s[e].p(t,o):(z(),m(s[r],1,1,()=>{s[r]=null}),M(),n=s[e],n?n.p(t,o):(n=s[e]=l[e](t),n.c()),g(n,1),n.m(i.parentNode,i))},i(t){o||(g(n),o=!0)},o(t){m(n),o=!1},d(t){t&&r(i),s[e].d(t)}}}function Jl(t){let e,n,i,o,l;const s=[tr,Ql],c=[];function a(t,n){return 16777252&n[0]&&(e=null),null==e&&(e=!!(t[24]||"function"==typeof t[5]&&t[5](t[107],t[106]))),e?0:1}return n=a(t,[-1,-1,-1,-1]),i=c[n]=s[n](t),{c(){i.c(),o=S()},m(t,e){c[n].m(t,e),u(t,o,e),l=!0},p(t,e){let l=n;n=a(t,e),n===l?c[n].p(t,e):(z(),m(c[l],1,1,()=>{c[l]=null}),M(),i=c[n],i?i.p(t,e):(i=c[n]=s[n](t),i.c()),g(i,1),i.m(o.parentNode,o))},i(t){l||(g(i),l=!0)},o(t){m(i),l=!1},d(t){t&&r(o),c[n].d(t)}}}function Ql(t){let e;return{c(){e=f("div"),c(e,"class","w-6 h-6")},m(t,n){u(t,e,n)},p:l,i:l,o:l,d(t){t&&r(e)}}}function tr(t){let e,n;return e=new bn({props:{size:6,img:t[107].annulla?"restore_from_trash":"delete",white:!t[107].annulla,black:t[107].annulla}}),e.$on("click",function(...e){return t[77](t[107],t[106],t[108],...e)}),{c(){F(e.$$.fragment)},m(t,i){O(e,t,i),n=!0},p(n,i){t=n;const o={};4&i[0]&&(o.img=t[107].annulla?"restore_from_trash":"delete"),4&i[0]&&(o.white=!t[107].annulla),4&i[0]&&(o.black=t[107].annulla),e.$set(o)},i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){N(e,t)}}}function er(t){let e,n;return e=new bn({props:{size:6,img:"edit",base:!0,black:!0}}),e.$on("click",function(...e){return t[78](t[107],t[106],t[108],...e)}),{c(){F(e.$$.fragment)},m(t,i){O(e,t,i),n=!0},p(e,n){t=e},i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){N(e,t)}}}function nr(t){let e,n;return e=new bn({props:{size:8,white:!0,noborder:!0,img:"more_vert"}}),e.$on("click",function(...e){return t[79](t[107],...e)}),{c(){F(e.$$.fragment)},m(t,i){O(e,t,i),n=!0},p(e,n){t=e},i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){N(e,t)}}}function ir(t){let e,n,i,o,l,a,p,h,w,b=t[15]&&Ll(t),x=t[16]&&Bl(t),v=B(t[37]),k=[];for(let e=0;e<v.length;e+=1)k[e]=Gl(el(t,v,e));const _=t=>m(k[t],1,1,()=>{k[t]=null});let S=t[36]&&Wl(t);function j(...e){return t[80](t[106],...e)}function E(...e){return t[81](t[106],...e)}function C(...e){return t[82](t[106],t[107],t[108],...e)}return{c(){e=f("tr"),b&&b.c(),n=D(),x&&x.c(),i=D();for(let t=0;t<k.length;t+=1)k[t].c();o=D(),S&&S.c(),l=D(),c(e,"class",a="cursor-pointer text-c-800 hover:text-black hover:bg-c-50 "+("function"==typeof t[14]&&t[14](t[107],t[106])||"")),y(e,"bg-c-100",t[9]&&t[107].annulla),y(e,"text-c-400",t[9]&&t[107].annulla)},m(t,r){u(t,e,r),b&&b.m(e,null),$(e,n),x&&x.m(e,null),$(e,i);for(let t=0;t<k.length;t+=1)k[t]&&k[t].m(e,null);$(e,o),S&&S.m(e,null),$(e,l),p=!0,h||(w=[d(e,"mousemove",j),d(e,"mouseup",E),d(e,"click",C)],h=!0)},p(r,s){if((t=r)[15]?b?(b.p(t,s),32768&s[0]&&g(b,1)):(b=Ll(t),b.c(),g(b,1),b.m(e,n)):b&&(z(),m(b,1,1,()=>{b=null}),M()),t[16]?x?(x.p(t,s),65536&s[0]&&g(x,1)):(x=Bl(t),x.c(),g(x,1),x.m(e,i)):x&&(z(),m(x,1,1,()=>{x=null}),M()),4&s[0]|131136&s[1]|134217728&s[2]){let n;for(v=B(t[37]),n=0;n<v.length;n+=1){const i=el(t,v,n);k[n]?(k[n].p(i,s),g(k[n],1)):(k[n]=Gl(i),k[n].c(),g(k[n],1),k[n].m(e,o))}for(z(),n=v.length;n<k.length;n+=1)_(n);M()}t[36]?S?(S.p(t,s),32&s[1]&&g(S,1)):(S=Wl(t),S.c(),g(S,1),S.m(e,l)):S&&(z(),m(S,1,1,()=>{S=null}),M()),(!p||16388&s[0]&&a!==(a="cursor-pointer text-c-800 hover:text-black hover:bg-c-50 "+("function"==typeof t[14]&&t[14](t[107],t[106])||"")))&&c(e,"class",a),(!p||16900&s[0])&&y(e,"bg-c-100",t[9]&&t[107].annulla),(!p||16900&s[0])&&y(e,"text-c-400",t[9]&&t[107].annulla)},i(t){if(!p){g(b),g(x);for(let t=0;t<v.length;t+=1)g(k[t]);g(S),p=!0}},o(t){m(b),m(x),k=k.filter(Boolean);for(let t=0;t<k.length;t+=1)m(k[t]);m(S),p=!1},d(t){t&&r(e),b&&b.d(),x&&x.d(),H(k,t),S&&S.d(),h=!1,s(w)}}}function or(t){let e,n,i,o,l;function s(e){t[84](e,t[104])}let a={class:"flex-1",trueval:!0,falseval:!1,label:t[104]?.des||t[104]?.cod||""};return void 0!==t[104].visible&&(a.value=t[104].visible),n=new si({props:a}),p.push(()=>U(n,"value",s)),{c(){e=f("div"),F(n.$$.fragment),o=D(),c(e,"class","flex flex-wrap items-center space-x-2 h-10")},m(t,i){u(t,e,i),O(n,e,null),$(e,o),l=!0},p(e,o){t=e;const l={};8388608&o[0]&&(l.label=t[104]?.des||t[104]?.cod||""),!i&&8388608&o[0]&&(i=!0,l.value=t[104].visible,q(()=>i=!1)),n.$set(l)},i(t){l||(g(n.$$.fragment,t),l=!0)},o(t){m(n.$$.fragment,t),l=!1},d(t){t&&r(e),N(n)}}}function lr(t){let e,n;return e=new qn({props:{alt:!0,$$slots:{default:[rr]},$$scope:{ctx:t}}}),e.$on("click",t[85]),{c(){F(e.$$.fragment)},m(t,i){O(e,t,i),n=!0},p(t,n){const i={};134217728&n[2]&&(i.$$scope={dirty:n,ctx:t}),e.$set(i)},i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){N(e,t)}}}function rr(t){let e;return{c(){e=k("Reset filtri")},m(t,n){u(t,e,n)},d(t){t&&r(e)}}}function sr(t){let e,n;return e=new Dn({props:{id:"Salva e chiudi"}}),{c(){F(e.$$.fragment)},m(t,i){O(e,t,i),n=!0},p:l,i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){N(e,t)}}}function cr(t){let e,n,i,o,l,s,a,d,p=B(t[23]),h=[];for(let e=0;e<p.length;e+=1)h[e]=or(Ko(t,p,e));const w=t=>m(h[t],1,1,()=>{h[t]=null});let b=t[0]&&lr(t);return a=new qn({props:{primary:!0,$$slots:{default:[sr]},$$scope:{ctx:t}}}),a.$on("click",t[47]),{c(){e=f("div");for(let t=0;t<h.length;t+=1)h[t].c();n=D(),i=f("div"),b&&b.c(),o=D(),l=f("div"),s=D(),F(a.$$.fragment),c(e,"class","grid grid-cols-2 p-4 gap-x-2"),c(l,"class","flex-1"),c(i,"class","flex flex-wrap space-x-2 p-3")},m(t,r){u(t,e,r);for(let t=0;t<h.length;t+=1)h[t]&&h[t].m(e,null);u(t,n,r),u(t,i,r),b&&b.m(i,null),$(i,o),$(i,l),$(i,s),O(a,i,null),d=!0},p(t,n){if(8388608&n[0]){let i;for(p=B(t[23]),i=0;i<p.length;i+=1){const o=Ko(t,p,i);h[i]?(h[i].p(o,n),g(h[i],1)):(h[i]=or(o),h[i].c(),g(h[i],1),h[i].m(e,null))}for(z(),i=p.length;i<h.length;i+=1)w(i);M()}t[0]?b?(b.p(t,n),1&n[0]&&g(b,1)):(b=lr(t),b.c(),g(b,1),b.m(i,o)):b&&(z(),m(b,1,1,()=>{b=null}),M());const l={};134217728&n[2]&&(l.$$scope={dirty:n,ctx:t}),a.$set(l)},i(t){if(!d){for(let t=0;t<p.length;t+=1)g(h[t]);g(b),g(a.$$.fragment,t),d=!0}},o(t){h=h.filter(Boolean);for(let t=0;t<h.length;t+=1)m(h[t]);m(b),m(a.$$.fragment,t),d=!1},d(t){t&&(r(e),r(n),r(i)),H(h,t),b&&b.d(),N(a)}}}function ar(t){let e,n,i,o,l,s,a,p,h,b=(t[101].des||"")+"",x=t[101].icon&&dr(t);function v(){return t[87](t[101])}return{c(){e=f("button"),n=f("div"),x&&x.c(),i=D(),o=f("div"),l=k(b),s=D(),c(n,"class","w-8"),c(o,"class","flex-1 text-left"),c(e,"class","flex flex-row space-x-2 items-center border border-c-100 rounded hover:bg-white hover:border-c-border px-1 py-0.5")},m(t,r){u(t,e,r),$(e,n),x&&x.m(n,null),$(e,i),$(e,o),$(o,l),$(e,s),a=!0,p||(h=d(e,"click",v),p=!0)},p(e,i){(t=e)[101].icon?x?(x.p(t,i),1&i[1]&&g(x,1)):(x=dr(t),x.c(),g(x,1),x.m(n,null)):x&&(z(),m(x,1,1,()=>{x=null}),M()),(!a||1&i[1])&&b!==(b=(t[101].des||"")+"")&&w(l,b)},i(t){a||(g(x),a=!0)},o(t){m(x),a=!1},d(t){t&&r(e),x&&x.d(),p=!1,h()}}}function ur(t){let e;return{c(){e=f("div"),c(e,"class","w-full py-1 border-b")},m(t,n){u(t,e,n)},p:l,i:l,o:l,d(t){t&&r(e)}}}function dr(t){let e,n;return e=new en({props:{size:6,img:t[101].icon}}),{c(){F(e.$$.fragment)},m(t,i){O(e,t,i),n=!0},p(t,n){const i={};1&n[1]&&(i.img=t[101].icon),e.$set(i)},i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){N(e,t)}}}function fr(t){let e,n,i,o;const l=[ur,ar],s=[];function c(t,e){return"-"==t[101].cod?0:1}return e=c(t),n=s[e]=l[e](t),{c(){n.c(),i=S()},m(t,n){s[e].m(t,n),u(t,i,n),o=!0},p(t,o){let r=e;e=c(t),e===r?s[e].p(t,o):(z(),m(s[r],1,1,()=>{s[r]=null}),M(),n=s[e],n?n.p(t,o):(n=s[e]=l[e](t),n.c()),g(n,1),n.m(i.parentNode,i))},i(t){o||(g(n),o=!0)},o(t){m(n),o=!1},d(t){t&&r(i),s[e].d(t)}}}function pr(t){let e,n,i,o,l;i=new bn({props:{img:"close",mat:!0,size:4}}),i.$on("click",t[86]);let s=B(t[52](t[31])),a=[];for(let e=0;e<s.length;e+=1)a[e]=fr(Xo(t,s,e));const d=t=>m(a[t],1,1,()=>{a[t]=null});return{c(){e=f("div"),n=f("div"),F(i.$$.fragment),o=D();for(let t=0;t<a.length;t+=1)a[t].c();c(n,"class","absolute top-1 right-1"),c(e,"class","z-100 text-sm min-w-64 border rounded shadow border-c-border bg-c-100 p-2 flex flex-col space-y-1 py-2")},m(t,r){u(t,e,r),$(e,n),O(i,n,null),$(e,o);for(let t=0;t<a.length;t+=1)a[t]&&a[t].m(e,null);l=!0},p(t,n){if(1610612736&n[0]|2101249&n[1]){let i;for(s=B(t[52](t[31])),i=0;i<s.length;i+=1){const o=Xo(t,s,i);a[i]?(a[i].p(o,n),g(a[i],1)):(a[i]=fr(o),a[i].c(),g(a[i],1),a[i].m(e,null))}for(z(),i=s.length;i<a.length;i+=1)d(i);M()}},i(t){if(!l){g(i.$$.fragment,t);for(let t=0;t<s.length;t+=1)g(a[t]);l=!0}},o(t){m(i.$$.fragment,t),a=a.filter(Boolean);for(let t=0;t<a.length;t+=1)m(a[t]);l=!1},d(t){t&&r(e),N(i),H(a,t)}}}function hr(t){let e,n,i,o,l=t[39]&&hl(t);return{c(){l&&l.c(),e=S()},m(r,s){l&&l.m(r,s),u(r,e,s),n=!0,i||(o=d(window,"keydown",t[45]),i=!0)},p(t,n){t[39]?l?(l.p(t,n),256&n[1]&&g(l,1)):(l=hl(t),l.c(),g(l,1),l.m(e.parentNode,e)):l&&(z(),m(l,1,1,()=>{l=null}),M())},i(t){n||(g(l),n=!0)},o(t){m(l),n=!1},d(t){t&&r(e),l&&l.d(t),i=!1,o()}}}function mr(t){let[e,n]=(t.type||"").split("|");switch(n=n||"",e){case"date":case"datetime":case"time":return`text-center ${n}`;case"check":return`text-left text-xl ${n}`;case"number":case"float":case"float1":case"float2":case"float3":case"float4":case"real":case"int":case"euro":return"text-center ";case"perc":return`text-right mr-1 ${n}`;default:return`text-left ${n}`}}function gr(t,e,n){let l,r,s,c,a,u,d,f,{$$slots:p={},$$scope:h}=e;const{bus:m,user:g,post:w,_:b,setStorage:x,getStorage:v,strDate:y,toEuro:$}=on();I(t,g,t=>n(40,f=t));const k=K();let D,_,S,z,M,j,E,C,{authdel:T,auth:N,authedit:O,authadd:A,menu:F,nosearch:R=!1,noheader:L=!1,annullati:B=!1,tooltip:H="",lockrows:P=!1,cannotrestore:V=!1,nofilter:Y=!1,checkcampi:U,classrow:q,ismove:G=!1,isselect:J=!1,filtri:Q,isclipboard:tt=!1,isexport:et=!1,isimport:nt=!1,isgrid:it=!1,extrabtn:ot=[],value:lt=[]}=e,{campi:rt,name:st,ordina:ct=!1,desc:at=!1,title:ut="tabella"}=e,dt=[],ft=-1,pt="",ht=!1,mt=!1;function gt(t,e){if(t>=0&&t<lt.length&&t!=e&&e>=0&&e<lt.length){var i=lt.splice(t,1)[0];lt.splice(e,0,i),n(2,lt=[...lt]),k("move",lt),n(26,ft=e)}}function wt(t){Array.isArray(lt)&&(lt.forEach(e=>e._sel=t.value),n(2,lt=[...lt]))}async function bt(){k("more")}function xt(t,e){t.stopPropagation(),n(33,z=!0),M=t.x,j=t.y,n(34,C=e),E=t.target}function vt(){E&&(E.style="transform : translate(0px, 0px);\n z-index:0 ; background-color: transparent"),n(33,z=!1),M=0,j=0,E=void 0}function yt(t,e){E&&z&&(E.style=`transform : translate(${t.x-M+20}px, ${t.y-j}px);\n z-index:-10 ; background-color: aliceblue`)}W(async()=>{m.on("scrollbottom",bt)}),Z(()=>{m.off("scrollbottom",bt)});return t.$$set=t=>{n(53,e=i(i({},e),o(t))),"authdel"in t&&n(5,T=t.authdel),"auth"in t&&n(54,N=t.auth),"authedit"in t&&n(6,O=t.authedit),"authadd"in t&&n(55,A=t.authadd),"menu"in t&&n(56,F=t.menu),"nosearch"in t&&n(7,R=t.nosearch),"noheader"in t&&n(8,L=t.noheader),"annullati"in t&&n(9,B=t.annullati),"tooltip"in t&&n(10,H=t.tooltip),"lockrows"in t&&n(11,P=t.lockrows),"cannotrestore"in t&&n(12,V=t.cannotrestore),"nofilter"in t&&n(13,Y=t.nofilter),"checkcampi"in t&&n(57,U=t.checkcampi),"classrow"in t&&n(14,q=t.classrow),"ismove"in t&&n(15,G=t.ismove),"isselect"in t&&n(16,J=t.isselect),"filtri"in t&&n(0,Q=t.filtri),"isclipboard"in t&&n(17,tt=t.isclipboard),"isexport"in t&&n(18,et=t.isexport),"isimport"in t&&n(19,nt=t.isimport),"isgrid"in t&&n(1,it=t.isgrid),"extrabtn"in t&&n(20,ot=t.extrabtn),"value"in t&&n(2,lt=t.value),"campi"in t&&n(58,rt=t.campi),"name"in t&&n(21,st=t.name),"ordina"in t&&n(3,ct=t.ordina),"desc"in t&&n(4,at=t.desc),"title"in t&&n(22,ut=t.title),"$$scope"in t&&n(89,h=t.$$scope)},t.$$.update=()=>{8388608&t.$$.dirty[1]&&n(39,l=w.isauth(N)),32&t.$$.dirty[0]&&n(24,r="function"!=typeof T&&w.isauth(T)),16777216&t.$$.dirty[1]&&n(38,s=w.isauth(A)),64&t.$$.dirty[0]&&n(25,c="function"!=typeof O&&w.isauth(O)),201326592&t.$$.dirty[1]&&function(t){let e;if(n(23,dt=t),st){var i=v(`fields_${st}_${f.id}`);if(i&&i.length>0)for(e of dt)e.visible=i.includes(e.cod)}if(dt&&dt.length>0)for(e of dt)U&&U(e)}(rt),8388608&t.$$.dirty[0]&&n(37,a=(dt||[]).filter(t=>t.visible)),51380320&t.$$.dirty[0]|33554432&t.$$.dirty[1]&&n(36,u=F||r||"function"==typeof T||c||"function"==typeof O||ot.length),51380320&t.$$.dirty[0]|33554432&t.$$.dirty[1]&&n(35,d=(F?1.5:0)+ot.length+(c||"function"==typeof O?1:0)+(r||"function"==typeof T?1:0))},e=o(e),[Q,it,lt,ct,at,T,O,R,L,B,H,P,V,Y,q,G,J,tt,et,nt,ot,st,ut,dt,r,c,ft,pt,ht,D,_,S,mt,z,C,d,u,a,s,l,f,g,x,k,gt,function(t){if("Escape"==t.key&&vt(),G&&t.metaKey&&("ArrowDown"===t.key||"ArrowUp"==t.key)&&ft>=0&&ft<lt.length){let e;t.stopPropagation(),t.preventDefault(),"ArrowDown"==t.key?ft<lt.length-1&&(e=lt[ft],n(2,lt[ft]=lt[ft+1],lt),n(2,lt[ft+1]=e,lt),n(26,ft++,ft),n(2,lt=[...lt]),k("move")):ft>0&&(e=lt[ft],n(2,lt[ft]=lt[ft-1],lt),n(2,lt[ft-1]=e,lt),n(26,ft--,ft),n(2,lt=[...lt]),k("move"))}},wt,function(){if(n(32,mt=!1),st){var t=[];for(var e of dt)e.visible&&t.push(e.cod);Q&&k("filtra"),x(`fields_${st}_${f.id}`,t)}},function(t,e){var n=e[t.cod];if(n){"object"==typeof n&&(n=n.cod||n.des||"");let e=(t.type||"").split("|")[0];if("date"==e)n=y(n,"ggmmaaaa");else if("datetime"==e)n=y(n,"datetime");else if("time"==e)n=y(n,"hhmm");else if("perc"==e){var i=parseFloat(n);i<1&&(i*=100),n=i?i.toFixed(2)+"%":""}else"euro"==e?n=$(n):"int"==e?n=parseInt(n)||"":"float"==e||"float2"==e?n=(parseFloat(n)||0).toFixed(2):"float1"==e?n=(parseFloat(n)||0).toFixed(1):"float3"==e?n=(parseFloat(n)||0).toFixed(3):"float4"==e&&(n=(parseFloat(n)||0).toFixed(4))}return n||""},xt,vt,yt,function(t){return F?(F(t)||[]).filter(t=>w.isauth(t.auth)):[]},e,N,A,F,U,rt,p,()=>n(1,it=1==it?2:1),function(t){pt=t,n(27,pt)},()=>{k("cercai",pt)},()=>{k("cerca",pt)},()=>k("clipboard"),()=>k("export"),()=>k("import"),()=>{ht&&Q&&Object.keys(Q).length&&(n(0,Q={}),k("filtra")),n(28,ht=!ht)},t=>{k("add",t.detail)},t=>wt(t.detail),t=>{t.sort&&(n(4,at=ct==t.cod&&!at),n(3,ct=t.cod),k("ordina",{ordina:ct,desc:at}))},function(e,i){t.$$.not_equal(Q[i?.cod],e)&&(Q[i?.cod]=e,n(0,Q))},()=>{k("filtra")},()=>{n(32,mt=!0)},(t,e)=>xt(e,t),function(e,i){t.$$.not_equal(i._sel,e)&&(i._sel=e,n(2,lt))},(t,e,i,o)=>{n(2,i[e].C=e,lt),k(o.cod,t)},(t,e,i,o)=>{n(2,i[e].C=e,lt),k("xdelete",{x:t,e:o.detail,row:e}),k("delete",t)},(t,e,i,o)=>{n(2,i[e].C=e,lt),k("xedit",{x:t,row:e,e:o.detail}),k("edit",t)},(t,e)=>{n(29,D=e.detail),n(31,S=t),n(30,_=!0)},(t,e)=>yt(e),(t,e)=>{z&>(C,t),vt()},(t,e,i,o)=>{ft!=t||G?n(26,ft=t):P||("function"==typeof O?O(e,t)&&(n(2,i[t].C=t,lt),k("xedit",{x:e,row:t,e:o.target}),k("edit",e)):c&&(n(2,i[t].C=t,lt),k("xedit",{x:e,row:t,e:o.target}),k("edit",e)))},()=>{vt()},function(e,i){t.$$.not_equal(i.visible,e)&&(i.visible=e,n(23,dt))},()=>{n(0,Q={}),x(`fields_${st}_${f.id}`),n(32,mt=!1)},()=>n(30,_=!1),async t=>{n(30,_=!1),await X(),k(t.cod||t.des,{x:S,e:D})},function(t){_=t,n(30,_)},h]}class wr extends t{constructor(t){super(),e(this,t,gr,hr,n,{authdel:5,auth:54,authedit:6,authadd:55,menu:56,nosearch:7,noheader:8,annullati:9,tooltip:10,lockrows:11,cannotrestore:12,nofilter:13,checkcampi:57,classrow:14,ismove:15,isselect:16,filtri:0,isclipboard:17,isexport:18,isimport:19,isgrid:1,extrabtn:20,value:2,campi:58,name:21,ordina:3,desc:4,title:22},null,[-1,-1,-1,-1])}}function br(t){let e,n,i,o,s;return{c(){e=f("button"),c(e,"aria-label","dragbar"),c(e,"id",n="splitter_"+(t[4]||t[5]?"horiz":"vert")),c(e,"class",i=(t[12].class||"")+" "+(t[4]||t[5]?"h-1.5 w-full":"h-full w-1.5")+" "+(t[3]?"bg-c-150":"hover:bg-c-500")),c(e,"style",t[11])},m(n,i){u(n,e,i),o||(s=d(e,"mousedown",t[14]),o=!0)},p(t,[o]){48&o&&n!==(n="splitter_"+(t[4]||t[5]?"horiz":"vert"))&&c(e,"id",n),4152&o&&i!==(i=(t[12].class||"")+" "+(t[4]||t[5]?"h-1.5 w-full":"h-full w-1.5")+" "+(t[3]?"bg-c-150":"hover:bg-c-500"))&&c(e,"class",i),2048&o&&c(e,"style",t[11])},i:l,o:l,d(t){t&&r(e),o=!1,s()}}}function xr(t,e,n){let l;const r=K();let s,c,a,u,{value:d=0,min:f=-1,max:p=-1,readonly:h=!1,top:m=!1,bottom:g=!1,right:w=!1}=e,b=!1;function x(){let t;return t=m?(u-c)/4:g?(c-u)/4:w?(s-a)/4:(a-s)/4,t+=d,t<f&&(t=f),t>p&&(t=p),t}function v(t){b&&(n(8,a=t.clientX),n(9,u=t.clientY))}function y(){if(b){let t=Math.floor(x()+.5);t!==d&&r("change",t),n(10,b=!1)}}W(()=>(window.addEventListener("mousemove",v),window.addEventListener("mouseup",y),()=>{window.removeEventListener("mousemove",v),window.removeEventListener("mouseup",y)}));return t.$$set=t=>{n(12,e=i(i({},e),o(t))),"value"in t&&n(0,d=t.value),"min"in t&&n(1,f=t.min),"max"in t&&n(2,p=t.max),"readonly"in t&&n(3,h=t.readonly),"top"in t&&n(4,m=t.top),"bottom"in t&&n(5,g=t.bottom),"right"in t&&n(13,w=t.right)},t.$$.update=()=>{1992&t.$$.dirty&&n(11,l=function(){if(h)return;let t=`cursor: ${m||g?"row-resize":"col-resize"};`;if(b){let e=x()-d;return(g||w)&&(e=-e),`${t} transform: translate${m||g?"Y":"X"}(${4*e}px); z-index:10;`}return t}())},e=o(e),[d,f,p,h,m,g,s,c,a,u,b,l,e,w,t=>{h||f>=0&&p>f&&d>=f&&d<=p&&(n(6,s=t.clientX),n(7,c=t.clientY),n(8,a=s),n(9,u=c),n(10,b=!0))}]}class vr extends t{constructor(t){super(),e(this,t,xr,br,n,{value:0,min:1,max:2,readonly:3,top:4,bottom:5,right:13})}}const yr=t=>({}),$r=t=>({}),kr=t=>({}),Dr=t=>({});function _r(t){let e,n,i,o,l,s;n=new pn({props:{tooltip:t[5],$$slots:{default:[Mr]},$$scope:{ctx:t}}});let a=t[9]&&jr(t);return{c(){e=f("div"),F(n.$$.fragment),i=D(),o=f("div"),a&&a.c(),c(e,"class",l="w-full relative "+(t[12].class||""))},m(l,r){u(l,e,r),O(n,e,null),$(e,i),$(e,o),a&&a.m(o,null),t[16](o),s=!0},p(t,i){const r={};32&i&&(r.tooltip=t[5]),131807&i&&(r.$$scope={dirty:i,ctx:t}),n.$set(r),t[9]?a?(a.p(t,i),512&i&&g(a,1)):(a=jr(t),a.c(),g(a,1),a.m(o,null)):a&&(z(),m(a,1,1,()=>{a=null}),M()),(!s||4096&i&&l!==(l="w-full relative "+(t[12].class||"")))&&c(e,"class",l)},i(t){s||(g(n.$$.fragment,t),g(a),s=!0)},o(t){m(n.$$.fragment,t),m(a),s=!1},d(i){i&&r(e),N(n),a&&a.d(),t[16](null)}}}function Sr(t){let e;const n=t[14].btn,i=h(n,t,t[17],$r);return{c(){i&&i.c()},m(t,n){i&&i.m(t,n),e=!0},p(t,o){i&&i.p&&(!e||131072&o)&&b(i,n,t,t[17],e?v(n,t[17],o,yr):x(t[17]),$r)},i(t){e||(g(i,t),e=!0)},o(t){m(i,t),e=!1},d(t){i&&i.d(t)}}}function zr(t){let e,n;return e=new en({props:{img:t[9]?"expand_less":"expand_more",size:6}}),{c(){F(e.$$.fragment)},m(t,i){O(e,t,i),n=!0},p(t,n){const i={};512&n&&(i.img=t[9]?"expand_less":"expand_more"),e.$set(i)},i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){N(e,t)}}}function Mr(t){let e,n,i,o,l,s,a;const p=t[14].title,w=h(p,t,t[17],Dr),y=w||function(t){let e,n,i;return n=new Dn({props:{id:t[1]}}),{c(){e=f("div"),F(n.$$.fragment),c(e,"class","flex-1 pl-2 font-bold")},m(t,o){u(t,e,o),O(n,e,null),i=!0},p(t,e){const i={};2&e&&(i.id=t[1]),n.$set(i)},i(t){i||(g(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&r(e),N(n)}}}(t);let k=(!t[3]&&!t[4]||t[9])&&Sr(t),_=(t[3]||t[4])&&zr(t);return{c(){e=f("button"),y&&y.c(),n=D(),k&&k.c(),i=D(),_&&_.c(),c(e,"class",o=(t[2]?"titolot":"titolo")+" text-left w-full mb-1")},m(o,r){u(o,e,r),y&&y.m(e,null),$(e,n),k&&k.m(e,null),$(e,i),_&&_.m(e,null),l=!0,s||(a=d(e,"click",t[15]),s=!0)},p(t,n){w?w.p&&(!l||131072&n)&&b(w,p,t,t[17],l?v(p,t[17],n,kr):x(t[17]),Dr):y&&y.p&&(!l||2&n)&&y.p(t,l?n:-1),!t[3]&&!t[4]||t[9]?k?(k.p(t,n),536&n&&g(k,1)):(k=Sr(t),k.c(),g(k,1),k.m(e,i)):k&&(z(),m(k,1,1,()=>{k=null}),M()),t[3]||t[4]?_?(_.p(t,n),24&n&&g(_,1)):(_=zr(t),_.c(),g(_,1),_.m(e,null)):_&&(z(),m(_,1,1,()=>{_=null}),M()),(!l||4&n&&o!==(o=(t[2]?"titolot":"titolo")+" text-left w-full mb-1"))&&c(e,"class",o)},i(t){l||(g(y,t),g(k),g(_),l=!0)},o(t){m(y,t),m(k),m(_),l=!1},d(t){t&&r(e),y&&y.d(t),k&&k.d(),_&&_.d(),s=!1,a()}}}function jr(t){let e,n;const i=t[14].default,o=h(i,t,t[17],null),l=o||function(){let t;return{c(){t=k("Impostare il contenuto qui")},m(e,n){u(e,t,n)},d(e){e&&r(t)}}}();return{c(){e=f("div"),l&&l.c()},m(t,i){u(t,e,i),l&&l.m(e,null),n=!0},p(t,e){o&&o.p&&(!n||131072&e)&&b(o,i,t,t[17],n?v(i,t[17],e,null):x(t[17]),null)},i(t){n||(g(l,t),n=!0)},o(t){m(l,t),n=!1},d(t){t&&r(e),l&&l.d(t)}}}function Er(t){let e,n,i=t[8]&&_r(t);return{c(){i&&i.c(),e=S()},m(t,o){i&&i.m(t,o),u(t,e,o),n=!0},p(t,[n]){t[8]?i?(i.p(t,n),256&n&&g(i,1)):(i=_r(t),i.c(),g(i,1),i.m(e.parentNode,e)):i&&(z(),m(i,1,1,()=>{i=null}),M())},i(t){n||(g(i),n=!0)},o(t){m(i),n=!1},d(t){t&&r(e),i&&i.d(t)}}}function Cr(t,e,n){let l,r,{$$slots:s={},$$scope:c}=e;const{_:a,P:u,autofocus:d}=on(),f=K();let h,m=!0,{auth:g="",title:w="",transparent:b=!1,canclose:x=!1,click:v=!1,tooltip:y=!1,closed:$=!1}=e;return t.$$set=t=>{n(12,e=i(i({},e),o(t))),"auth"in t&&n(13,g=t.auth),"title"in t&&n(1,w=t.title),"transparent"in t&&n(2,b=t.transparent),"canclose"in t&&n(3,x=t.canclose),"click"in t&&n(4,v=t.click),"tooltip"in t&&n(5,y=t.tooltip),"closed"in t&&n(0,$=t.closed),"$$scope"in t&&n(17,c=t.$$scope)},t.$$.update=()=>{81&t.$$.dirty&&n(9,l=v?!$:$?!m:m),8192&t.$$.dirty&&n(8,r=!g||u.isauth(g))},e=o(e),[$,w,b,x,v,y,m,h,r,l,d,f,e,g,s,()=>{(x||v)&&(l||d(!0,h,200),v?f("click"):x?n(6,m=!m):(n(0,$=!$),f("click",$)))},function(t){p[t?"unshift":"push"](()=>{h=t,n(7,h)})},c]}class Tr extends t{constructor(t){super(),e(this,t,Cr,Er,n,{auth:13,title:1,transparent:2,canclose:3,click:4,tooltip:5,closed:0})}}function Nr(t){let e,n,i,o;return{c(){e=f("div"),n=k(t[2]),i=k("x"),o=k(t[3]),c(e,"class","absolute left-1 top-1 bg-c-100 z-10 rounded-md p-0.5 text-xxs")},m(t,l){u(t,e,l),$(e,n),$(e,i),$(e,o)},p(t,e){4&e&&w(n,t[2]),8&e&&w(o,t[3])},d(t){t&&r(e)}}}function Or(t){let e,n;return e=new bn({props:{black:!0,size:t[4],img:"zoom_in"}}),e.$on("click",t[11]),{c(){F(e.$$.fragment)},m(t,i){O(e,t,i),n=!0},p(t,n){const i={};16&n&&(i.size=t[4]),e.$set(i)},i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){N(e,t)}}}function Ar(t){let e,n,i;return{c(){e=f("div"),n=f("img"),P(n.src,i=t[0])||c(n,"src",i),c(n,"alt",t[1]),c(n,"class","w-full h-auto"),c(e,"class","h-full w-full overflow-auto relative")},m(t,i){u(t,e,i),$(e,n)},p(t,e){1&e&&!P(n.src,i=t[0])&&c(n,"src",i),2&e&&c(n,"alt",t[1])},d(t){t&&r(e)}}}function Fr(t){let e,n;return{c(){e=f("div"),c(e,"class",n="bg-center bg-no-repeat "+(t[5]?"bg-contain":t[6]?"bg-cover":"")+" h-full w-full"),_(e,"background-image","url("+t[0]+")")},m(t,n){u(t,e,n)},p(t,i){96&i&&n!==(n="bg-center bg-no-repeat "+(t[5]?"bg-contain":t[6]?"bg-cover":"")+" h-full w-full")&&c(e,"class",n),1&i&&_(e,"background-image","url("+t[0]+")")},d(t){t&&r(e)}}}function Ir(t){let e,n,i;return{c(){e=f("div"),n=f("img"),P(n.src,i=t[0])||c(n,"src",i),c(n,"alt",t[1]),c(n,"class","w-full h-auto"),c(e,"class","h-full w-full overflow-auto relative")},m(t,i){u(t,e,i),$(e,n)},p(t,e){1&e&&!P(n.src,i=t[0])&&c(n,"src",i),2&e&&c(n,"alt",t[1])},d(t){t&&r(e)}}}function Rr(t){let e,n,i,o,l,s,a,p,w,y,k=t[2]&&t[3]&&Nr(t),_=t[4]&&Or(t);const S=t[9].default,j=h(S,t,t[13],null);function E(t,e){return t[5]||t[6]||t[7]?Fr:Ar}let C=E(t),T=C(t);return a=new Wo({props:{close:!0,screen:!0,show:t[8],title:t[1]||"fullscreen",nofooter:!0,$$slots:{default:[Ir]},$$scope:{ctx:t}}}),a.$on("close",t[12]),{c(){e=f("button"),k&&k.c(),n=D(),i=f("div"),_&&_.c(),o=D(),j&&j.c(),l=D(),T.c(),s=D(),F(a.$$.fragment),c(i,"class","absolute right-2 top-2 z-10 flex flex-row space-x-2"),c(e,"class","w-full h-full relative")},m(r,c){u(r,e,c),k&&k.m(e,null),$(e,n),$(e,i),_&&_.m(i,null),$(i,o),j&&j.m(i,null),$(e,l),T.m(e,null),u(r,s,c),O(a,r,c),p=!0,w||(y=d(e,"click",t[10]),w=!0)},p(t,[l]){t[2]&&t[3]?k?k.p(t,l):(k=Nr(t),k.c(),k.m(e,n)):k&&(k.d(1),k=null),t[4]?_?(_.p(t,l),16&l&&g(_,1)):(_=Or(t),_.c(),g(_,1),_.m(i,o)):_&&(z(),m(_,1,1,()=>{_=null}),M()),j&&j.p&&(!p||8192&l)&&b(j,S,t,t[13],p?v(S,t[13],l,null):x(t[13]),null),C===(C=E(t))&&T?T.p(t,l):(T.d(1),T=C(t),T&&(T.c(),T.m(e,null)));const r={};256&l&&(r.show=t[8]),2&l&&(r.title=t[1]||"fullscreen"),8195&l&&(r.$$scope={dirty:l,ctx:t}),a.$set(r)},i(t){p||(g(_),g(j,t),g(a.$$.fragment,t),p=!0)},o(t){m(_),m(j,t),m(a.$$.fragment,t),p=!1},d(t){t&&(r(e),r(s)),k&&k.d(),_&&_.d(),j&&j.d(t),T.d(),N(a,t),w=!1,y()}}}function Lr(t,e,n){let i,{$$slots:o={},$$scope:l}=e,{value:r,alt:s,w:c=0,h:a=0,zoom:u=!1,contain:d=!1,cover:f=!1,center:p=!1}=e;return t.$$set=t=>{"value"in t&&n(0,r=t.value),"alt"in t&&n(1,s=t.alt),"w"in t&&n(2,c=t.w),"h"in t&&n(3,a=t.h),"zoom"in t&&n(4,u=t.zoom),"contain"in t&&n(5,d=t.contain),"cover"in t&&n(6,f=t.cover),"center"in t&&n(7,p=t.center),"$$scope"in t&&n(13,l=t.$$scope)},[r,s,c,a,u,d,f,p,i,o,function(e){Y.call(this,t,e)},()=>{n(8,i=!0)},()=>{n(8,i=!1)},l]}class Br extends t{constructor(t){super(),e(this,t,Lr,Rr,n,{value:0,alt:1,w:2,h:3,zoom:4,contain:5,cover:6,center:7})}}function Hr(t,e,n){const i=t.slice();return i[23]=e[n],i[25]=n,i}function Pr(t,e,n){const i=t.slice();return i[23]=e[n],i[25]=n,i}function Vr(t){let e,n,i;return n=new Dn({props:{id:t[1]}}),{c(){e=f("div"),F(n.$$.fragment),c(e,"class","label pt-1 h-6")},m(t,o){u(t,e,o),O(n,e,null),i=!0},p(t,e){const i={};2&e&&(i.id=t[1]),n.$set(i)},i(t){i||(g(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&r(e),N(n)}}}function Yr(t){let e,n,i,o,l=t[1]&&(t[2]||t[5])&&qr(t),s=B(t[7]),a=[];for(let e=0;e<s.length;e+=1)a[e]=Xr(Hr(t,s,e));const d=t=>m(a[t],1,1,()=>{a[t]=null});return{c(){e=f("div"),l&&l.c(),n=D(),i=f("div");for(let t=0;t<a.length;t+=1)a[t].c();c(i,"class","flexrow items-center cursor-pointer text-sm"),c(e,"class","flexrow space-x-1 items-center overflow-x-hidden"),y(e,"mt-2",t[2])},m(t,r){u(t,e,r),l&&l.m(e,null),$(e,n),$(e,i);for(let t=0;t<a.length;t+=1)a[t]&&a[t].m(i,null);o=!0},p(t,r){if(t[1]&&(t[2]||t[5])?l?(l.p(t,r),38&r&&g(l,1)):(l=qr(t),l.c(),g(l,1),l.m(e,n)):l&&(z(),m(l,1,1,()=>{l=null}),M()),3777&r){let e;for(s=B(t[7]),e=0;e<s.length;e+=1){const n=Hr(t,s,e);a[e]?(a[e].p(n,r),g(a[e],1)):(a[e]=Xr(n),a[e].c(),g(a[e],1),a[e].m(i,null))}for(z(),e=s.length;e<a.length;e+=1)d(e);M()}(!o||4&r)&&y(e,"mt-2",t[2])},i(t){if(!o){g(l);for(let t=0;t<s.length;t+=1)g(a[t]);o=!0}},o(t){m(l),a=a.filter(Boolean);for(let t=0;t<a.length;t+=1)m(a[t]);o=!1},d(t){t&&r(e),l&&l.d(),H(a,t)}}}function Ur(t){let e,n,i=B(t[7]),o=[];for(let e=0;e<i.length;e+=1)o[e]=Jr(Pr(t,i,e));const l=t=>m(o[t],1,1,()=>{o[t]=null});return{c(){e=f("div");for(let t=0;t<o.length;t+=1)o[t].c();c(e,"class","flex flex-col w-full items-center cursor-pointer text-sm")},m(t,i){u(t,e,i);for(let t=0;t<o.length;t+=1)o[t]&&o[t].m(e,null);n=!0},p(t,n){if(3777&n){let r;for(i=B(t[7]),r=0;r<i.length;r+=1){const l=Pr(t,i,r);o[r]?(o[r].p(l,n),g(o[r],1)):(o[r]=Jr(l),o[r].c(),g(o[r],1),o[r].m(e,null))}for(z(),r=i.length;r<o.length;r+=1)l(r);M()}},i(t){if(!n){for(let t=0;t<i.length;t+=1)g(o[t]);n=!0}},o(t){o=o.filter(Boolean);for(let t=0;t<o.length;t+=1)m(o[t]);n=!1},d(t){t&&r(e),H(o,t)}}}function qr(t){let e,n,i,o;return n=new Dn({props:{id:t[1]}}),{c(){e=f("div"),F(n.$$.fragment),c(e,"class","label leading-none text-right pr-2"),c(e,"style",i=`width: ${t[8]}%;`)},m(t,i){u(t,e,i),O(n,e,null),o=!0},p(t,l){const r={};2&l&&(r.id=t[1]),n.$set(r),(!o||256&l&&i!==(i=`width: ${t[8]}%;`))&&c(e,"style",i)},i(t){o||(g(n.$$.fragment,t),o=!0)},o(t){m(n.$$.fragment,t),o=!1},d(t){t&&r(e),N(n)}}}function Gr(t){let e,n=t[10](t[25],t[7],t[0])+"";return{c(){e=k(n)},m(t,n){u(t,e,n)},p(t,i){129&i&&n!==(n=t[10](t[25],t[7],t[0])+"")&&w(e,n)},i:l,o:l,d(t){t&&r(e)}}}function Wr(t){let e,n;return e=new en({props:{size:6,img:t[23].img}}),{c(){F(e.$$.fragment)},m(t,i){O(e,t,i),n=!0},p(t,n){const i={};128&n&&(i.img=t[23].img),e.$set(i)},i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){N(e,t)}}}function Xr(t){let e,n,i,o,l,s,a,p;const h=[Wr,Gr],w=[];function b(t,e){return t[23].img?0:1}function x(){return t[18](t[23])}return n=b(t),i=w[n]=h[n](t),{c(){e=f("button"),i.c(),o=D(),c(e,"name",`imulti${t[25]}`),c(e,"class",l=t[11](t[25],t[7],t[0]))},m(t,i){u(t,e,i),w[n].m(e,null),$(e,o),s=!0,a||(p=d(e,"click",A(x)),a=!0)},p(r,a){let u=n;n=b(t=r),n===u?w[n].p(t,a):(z(),m(w[u],1,1,()=>{w[u]=null}),M(),i=w[n],i?i.p(t,a):(i=w[n]=h[n](t),i.c()),g(i,1),i.m(e,o)),(!s||129&a&&l!==(l=t[11](t[25],t[7],t[0])))&&c(e,"class",l)},i(t){s||(g(i),s=!0)},o(t){m(i),s=!1},d(t){t&&r(e),w[n].d(),a=!1,p()}}}function Kr(t){let e,n=t[10](t[25],t[7],t[0])+"";return{c(){e=k(n)},m(t,n){u(t,e,n)},p(t,i){129&i&&n!==(n=t[10](t[25],t[7],t[0])+"")&&w(e,n)},i:l,o:l,d(t){t&&r(e)}}}function Zr(t){let e,n;return e=new en({props:{size:6,img:t[23].img}}),{c(){F(e.$$.fragment)},m(t,i){O(e,t,i),n=!0},p(t,n){const i={};128&n&&(i.img=t[23].img),e.$set(i)},i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){N(e,t)}}}function Jr(t){let e,n,i,o,l,s,a,p;const h=[Zr,Kr],w=[];function b(t,e){return t[23].img?0:1}function x(){return t[17](t[23])}return n=b(t),i=w[n]=h[n](t),{c(){e=f("button"),i.c(),o=D(),c(e,"name",`imulti${t[25]}`),c(e,"class",l=t[11](t[25],t[7],t[0]))},m(t,i){u(t,e,i),w[n].m(e,null),$(e,o),s=!0,a||(p=d(e,"click",x),a=!0)},p(r,a){let u=n;n=b(t=r),n===u?w[n].p(t,a):(z(),m(w[u],1,1,()=>{w[u]=null}),M(),i=w[n],i?i.p(t,a):(i=w[n]=h[n](t),i.c()),g(i,1),i.m(e,o)),(!s||129&a&&l!==(l=t[11](t[25],t[7],t[0])))&&c(e,"class",l)},i(t){s||(g(i),s=!0)},o(t){m(i),s=!1},d(t){t&&r(e),w[n].d(),a=!1,p()}}}function Qr(t){let e,n,i,o;const l=[Ur,Yr],s=[];function c(t,e){return t[3]?0:1}return e=c(t),n=s[e]=l[e](t),{c(){n.c(),i=S()},m(t,n){s[e].m(t,n),u(t,i,n),o=!0},p(t,o){let r=e;e=c(t),e===r?s[e].p(t,o):(z(),m(s[r],1,1,()=>{s[r]=null}),M(),n=s[e],n?n.p(t,o):(n=s[e]=l[e](t),n.c()),g(n,1),n.m(i.parentNode,i))},i(t){o||(g(n),o=!0)},o(t){m(n),o=!1},d(t){t&&r(i),s[e].d(t)}}}function ts(t){let e,n,i,o,l,s=t[1]&&(!t[2]&&!t[5]||t[3])&&Vr(t);return i=new pn({props:{tooltip:t[4],$$slots:{default:[Qr]},$$scope:{ctx:t}}}),{c(){e=f("label"),s&&s.c(),n=D(),F(i.$$.fragment),c(e,"class",o=`labinput ${t[12].class||""}`)},m(t,o){u(t,e,o),s&&s.m(e,null),$(e,n),O(i,e,null),l=!0},p(t,[r]){t[1]&&(!t[2]&&!t[5]||t[3])?s?(s.p(t,r),46&r&&g(s,1)):(s=Vr(t),s.c(),g(s,1),s.m(e,n)):s&&(z(),m(s,1,1,()=>{s=null}),M());const a={};16&r&&(a.tooltip=t[4]),134218223&r&&(a.$$scope={dirty:r,ctx:t}),i.$set(a),(!l||4096&r&&o!==(o=`labinput ${t[12].class||""}`))&&c(e,"class",o)},i(t){l||(g(s),g(i.$$.fragment,t),l=!0)},o(t){m(s),m(i.$$.fragment,t),l=!1},d(t){t&&r(e),s&&s.d(),N(i)}}}function es(t,e,n){let l,r;const{_:s,listfromstring:c}=on(),a=K();let{value:u="",label:d="",black:f=!1,oriz:p=!1,vert:h=!1,tooltip:m="",options:g=[],info:w="",sm:b=!1,xs:x=!1,readonly:v=!1}=e;function y(t){if(t>=0&&t<r.length){var e=r[t];if("string"==typeof e){if(e==u)return!0}else if(e.id==u||e.cod==u)return!0}return!1}return t.$$set=t=>{n(12,e=i(i({},e),o(t))),"value"in t&&n(0,u=t.value),"label"in t&&n(1,d=t.label),"black"in t&&n(13,f=t.black),"oriz"in t&&n(2,p=t.oriz),"vert"in t&&n(3,h=t.vert),"tooltip"in t&&n(4,m=t.tooltip),"options"in t&&n(14,g=t.options),"info"in t&&n(15,w=t.info),"sm"in t&&n(5,b=t.sm),"xs"in t&&n(16,x=t.xs),"readonly"in t&&n(6,v=t.readonly)},t.$$.update=()=>{4&t.$$.dirty&&n(8,l=p&&parseInt(p)>10?parseInt(p):40),49152&t.$$.dirty&&n(7,r=g?c(g).filter(t=>!t.valid||t.valid()):[])},e=o(e),[u,d,p,h,m,b,v,r,l,a,function(t){var e="";if(t>=0&&t<r.length){var n=r[t];e="string"==typeof n?n:n.des||n.id||n.cod||""}return e},function(t){var e=[];return e.push("border-c-border px-2 hover:border-c-base"),e.push(b?"h-6 text-xs":x?"h-4 text-xxs":"h-8 text-sm "),h&&e.push("w-full"),f?e.push(y(t)?"bg-c-base text-white rounded":""):(0==t?e.push(h?"rounded-t-md border":"rounded-l-md border"):(e.push(h?"border-x border-b":"border-r border-y"),t==r.length-1&&e.push(h?"rounded-b-md":"rounded-r-md")),v?e.push(y(t)?"bg-c-200 text-white":"bg-white text-c-200"):e.push(y(t)?"bg-c-base text-white":"bg-white")),e.join(" ")},e,f,g,w,x,t=>{v||(n(0,u="string"==typeof t?t:t.cod?t.cod:t.id),a("click",t))},t=>{v||(n(0,u="string"==typeof t?t:t.cod?t.cod:t.id),a("click",t))}]}class ns extends t{constructor(t){super(),e(this,t,es,ts,n,{value:0,label:1,black:13,oriz:2,vert:3,tooltip:4,options:14,info:15,sm:5,xs:16,readonly:6})}}function is(t,e,n){const i=t.slice();return i[9]=e[n],i}function os(t,e,n){const i=t.slice();return i[8]=e[n],i}function ls(t,e,n){const i=t.slice();return i[9]=e[n],i[13]=n,i}function rs(t,e,n){const i=t.slice();return i[8]=e[n][0],i[9]=e[n][1],i}function ss(t){let e,n,i,o,s,a,d=t[2]&&as(t);return{c(){e=f("p"),d&&d.c(),n=D(),i=f("span"),o=k(t[3]),_(i,"white-space","pre"),c(i,"class",s=`json_${t[6]}`),c(e,"style",a=`margin-left: ${.8*t[1]}em`)},m(t,l){u(t,e,l),d&&d.m(e,null),$(e,n),$(e,i),$(i,o)},p(t,l){t[2]?d?d.p(t,l):(d=as(t),d.c(),d.m(e,n)):d&&(d.d(1),d=null),8&l&&w(o,t[3]),64&l&&s!==(s=`json_${t[6]}`)&&c(i,"class",s),2&l&&a!==(a=`margin-left: ${.8*t[1]}em`)&&c(e,"style",a)},i:l,o:l,d(t){t&&r(e),d&&d.d()}}}function cs(t){let e,n,i,o;const l=[ds,us],s=[];function c(t,e){return t[5]?0:1}return e=c(t),n=s[e]=l[e](t),{c(){n.c(),i=S()},m(t,n){s[e].m(t,n),u(t,i,n),o=!0},p(t,o){let r=e;e=c(t),e===r?s[e].p(t,o):(z(),m(s[r],1,1,()=>{s[r]=null}),M(),n=s[e],n?n.p(t,o):(n=s[e]=l[e](t),n.c()),g(n,1),n.m(i.parentNode,i))},i(t){o||(g(n),o=!0)},o(t){m(n),o=!1},d(t){t&&r(i),s[e].d(t)}}}function as(t){let e,n,i,o;return{c(){e=f("span"),n=k(t[2]),i=D(),o=f("span"),_(e,"white-space","pre"),c(e,"class","json_key"),c(o,"class","json_dot")},m(t,l){u(t,e,l),$(e,n),u(t,i,l),u(t,o,l)},p(t,e){4&e&&w(n,t[2])},d(t){t&&(r(e),r(i),r(o))}}}function us(t){let e,n,i,o,l,s,a,p,h=t[2]&&fs(t),w=t[0]&&ps(t);return{c(){e=f("details"),n=f("summary"),h&&h.c(),i=D(),w&&w.c(),c(e,"style",o=`margin-left: ${.8*t[1]}em`),c(e,"class",l=`json_${t[6]}`)},m(o,l){u(o,e,l),$(e,n),h&&h.m(n,null),$(e,i),w&&w.m(e,null),e.open=t[0],s=!0,a||(p=d(e,"toggle",t[7]),a=!0)},p(t,i){t[2]?h?h.p(t,i):(h=fs(t),h.c(),h.m(n,null)):h&&(h.d(1),h=null),t[0]?w?(w.p(t,i),1&i&&g(w,1)):(w=ps(t),w.c(),g(w,1),w.m(e,null)):w&&(z(),m(w,1,1,()=>{w=null}),M()),(!s||2&i&&o!==(o=`margin-left: ${.8*t[1]}em`))&&c(e,"style",o),(!s||64&i&&l!==(l=`json_${t[6]}`))&&c(e,"class",l),1&i&&(e.open=t[0])},i(t){s||(g(w),s=!0)},o(t){m(w),s=!1},d(t){t&&r(e),h&&h.d(),w&&w.d(),a=!1,p()}}}function ds(t){let e,n,i,o,l,s,a=t[2]&&bs(t);const d=[vs,xs],p=[];function h(t,e){return"object"==t[6]?0:"array"==t[6]?1:-1}return~(o=h(t))&&(l=p[o]=d[o](t)),{c(){e=f("div"),a&&a.c(),n=D(),i=f("table"),l&&l.c(),c(i,"class","json-table"),c(e,"class","json-table-container")},m(t,l){u(t,e,l),a&&a.m(e,null),$(e,n),$(e,i),~o&&p[o].m(i,null),s=!0},p(t,r){t[2]?a?a.p(t,r):(a=bs(t),a.c(),a.m(e,n)):a&&(a.d(1),a=null);let s=o;o=h(t),o===s?~o&&p[o].p(t,r):(l&&(z(),m(p[s],1,1,()=>{p[s]=null}),M()),~o?(l=p[o],l?l.p(t,r):(l=p[o]=d[o](t),l.c()),g(l,1),l.m(i,null)):l=null)},i(t){s||(g(l),s=!0)},o(t){m(l),s=!1},d(t){t&&r(e),a&&a.d(),~o&&p[o].d()}}}function fs(t){let e,n,i,o;return{c(){e=f("span"),n=k(t[2]),i=D(),o=f("span"),c(e,"class","json_key"),c(o,"class","json_dot")},m(t,l){u(t,e,l),$(e,n),u(t,i,l),u(t,o,l)},p(t,e){4&e&&w(n,t[2])},d(t){t&&(r(e),r(i),r(o))}}}function ps(t){let e,n,i,o;const l=[ms,hs],s=[];function c(t,e){return"object"==t[6]?0:1}return e=c(t),n=s[e]=l[e](t),{c(){n.c(),i=S()},m(t,n){s[e].m(t,n),u(t,i,n),o=!0},p(t,o){let r=e;e=c(t),e===r?s[e].p(t,o):(z(),m(s[r],1,1,()=>{s[r]=null}),M(),n=s[e],n?n.p(t,o):(n=s[e]=l[e](t),n.c()),g(n,1),n.m(i.parentNode,i))},i(t){o||(g(n),o=!0)},o(t){m(n),o=!1},d(t){t&&r(i),s[e].d(t)}}}function hs(t){let e,n,i=B(t[3]),o=[];for(let e=0;e<i.length;e+=1)o[e]=gs(is(t,i,e));const l=t=>m(o[t],1,1,()=>{o[t]=null});return{c(){for(let t=0;t<o.length;t+=1)o[t].c();e=S()},m(t,i){for(let e=0;e<o.length;e+=1)o[e]&&o[e].m(t,i);u(t,e,i),n=!0},p(t,n){if(24&n){let r;for(i=B(t[3]),r=0;r<i.length;r+=1){const l=is(t,i,r);o[r]?(o[r].p(l,n),g(o[r],1)):(o[r]=gs(l),o[r].c(),g(o[r],1),o[r].m(e.parentNode,e))}for(z(),r=i.length;r<o.length;r+=1)l(r);M()}},i(t){if(!n){for(let t=0;t<i.length;t+=1)g(o[t]);n=!0}},o(t){o=o.filter(Boolean);for(let t=0;t<o.length;t+=1)m(o[t]);n=!1},d(t){t&&r(e),H(o,t)}}}function ms(t){let e,n,i=B(Object.keys(t[3])),o=[];for(let e=0;e<i.length;e+=1)o[e]=ws(os(t,i,e));const l=t=>m(o[t],1,1,()=>{o[t]=null});return{c(){for(let t=0;t<o.length;t+=1)o[t].c();e=S()},m(t,i){for(let e=0;e<o.length;e+=1)o[e]&&o[e].m(t,i);u(t,e,i),n=!0},p(t,n){if(24&n){let r;for(i=B(Object.keys(t[3])),r=0;r<i.length;r+=1){const l=os(t,i,r);o[r]?(o[r].p(l,n),g(o[r],1)):(o[r]=ws(l),o[r].c(),g(o[r],1),o[r].m(e.parentNode,e))}for(z(),r=i.length;r<o.length;r+=1)l(r);M()}},i(t){if(!n){for(let t=0;t<i.length;t+=1)g(o[t]);n=!0}},o(t){o=o.filter(Boolean);for(let t=0;t<o.length;t+=1)m(o[t]);n=!1},d(t){t&&r(e),H(o,t)}}}function gs(t){let e,n;return e=new js({props:{space:2,name:"",value:t[9],fullopen:t[4],open:t[4]}}),{c(){F(e.$$.fragment)},m(t,i){O(e,t,i),n=!0},p(t,n){const i={};8&n&&(i.value=t[9]),16&n&&(i.fullopen=t[4]),16&n&&(i.open=t[4]),e.$set(i)},i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){N(e,t)}}}function ws(t){let e,n;return e=new js({props:{space:1,name:t[8],value:t[3][t[8]],fullopen:t[4],open:t[4]}}),{c(){F(e.$$.fragment)},m(t,i){O(e,t,i),n=!0},p(t,n){const i={};8&n&&(i.name=t[8]),8&n&&(i.value=t[3][t[8]]),16&n&&(i.fullopen=t[4]),16&n&&(i.open=t[4]),e.$set(i)},i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){N(e,t)}}}function bs(t){let e,n;return{c(){e=f("div"),n=k(t[2]),c(e,"class","json-table-title")},m(t,i){u(t,e,i),$(e,n)},p(t,e){4&e&&w(n,t[2])},d(t){t&&r(e)}}}function xs(t){let e,n,i,o,l=B(t[3]),s=[];for(let e=0;e<l.length;e+=1)s[e]=ks(ls(t,l,e));const c=t=>m(s[t],1,1,()=>{s[t]=null});return{c(){e=f("thead"),e.innerHTML="<tr><th>Indice</th> <th>Valore</th></tr>",n=D(),i=f("tbody");for(let t=0;t<s.length;t+=1)s[t].c()},m(t,l){u(t,e,l),u(t,n,l),u(t,i,l);for(let t=0;t<s.length;t+=1)s[t]&&s[t].m(i,null);o=!0},p(t,e){if(24&e){let n;for(l=B(t[3]),n=0;n<l.length;n+=1){const o=ls(t,l,n);s[n]?(s[n].p(o,e),g(s[n],1)):(s[n]=ks(o),s[n].c(),g(s[n],1),s[n].m(i,null))}for(z(),n=l.length;n<s.length;n+=1)c(n);M()}},i(t){if(!o){for(let t=0;t<l.length;t+=1)g(s[t]);o=!0}},o(t){s=s.filter(Boolean);for(let t=0;t<s.length;t+=1)m(s[t]);o=!1},d(t){t&&(r(e),r(n),r(i)),H(s,t)}}}function vs(t){let e,n,i,o,l=B(Object.entries(t[3])),s=[];for(let e=0;e<l.length;e+=1)s[e]=Ss(rs(t,l,e));const c=t=>m(s[t],1,1,()=>{s[t]=null});return{c(){e=f("thead"),e.innerHTML="<tr><th>Chiave</th> <th>Valore</th></tr>",n=D(),i=f("tbody");for(let t=0;t<s.length;t+=1)s[t].c()},m(t,l){u(t,e,l),u(t,n,l),u(t,i,l);for(let t=0;t<s.length;t+=1)s[t]&&s[t].m(i,null);o=!0},p(t,e){if(24&e){let n;for(l=B(Object.entries(t[3])),n=0;n<l.length;n+=1){const o=rs(t,l,n);s[n]?(s[n].p(o,e),g(s[n],1)):(s[n]=Ss(o),s[n].c(),g(s[n],1),s[n].m(i,null))}for(z(),n=l.length;n<s.length;n+=1)c(n);M()}},i(t){if(!o){for(let t=0;t<l.length;t+=1)g(s[t]);o=!0}},o(t){s=s.filter(Boolean);for(let t=0;t<s.length;t+=1)m(s[t]);o=!1},d(t){t&&(r(e),r(n),r(i)),H(s,t)}}}function ys(t){let e,n,i,o=t[9]+"";return{c(){e=f("span"),n=k(o),c(e,"class",i="json_"+typeof t[9])},m(t,i){u(t,e,i),$(e,n)},p(t,l){8&l&&o!==(o=t[9]+"")&&w(n,o),8&l&&i!==(i="json_"+typeof t[9])&&c(e,"class",i)},i:l,o:l,d(t){t&&r(e)}}}function $s(t){let e,n;return e=new js({props:{name:"",value:t[9],fullopen:t[4],open:t[4],tabular:!0}}),{c(){F(e.$$.fragment)},m(t,i){O(e,t,i),n=!0},p(t,n){const i={};8&n&&(i.value=t[9]),16&n&&(i.fullopen=t[4]),16&n&&(i.open=t[4]),e.$set(i)},i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){N(e,t)}}}function ks(t){let e,n,i,o,l,s,a,d;const p=[$s,ys],h=[];function w(t,e){return"object"==typeof t[9]&&null!==t[9]?0:1}return l=w(t),s=h[l]=p[l](t),{c(){e=f("tr"),n=f("td"),n.textContent=`${t[13]}`,i=D(),o=f("td"),s.c(),a=D(),c(n,"class","json-table-key")},m(t,r){u(t,e,r),$(e,n),$(e,i),$(e,o),h[l].m(o,null),$(e,a),d=!0},p(t,e){let n=l;l=w(t),l===n?h[l].p(t,e):(z(),m(h[n],1,1,()=>{h[n]=null}),M(),s=h[l],s?s.p(t,e):(s=h[l]=p[l](t),s.c()),g(s,1),s.m(o,null))},i(t){d||(g(s),d=!0)},o(t){m(s),d=!1},d(t){t&&r(e),h[l].d()}}}function Ds(t){let e,n,i,o=t[9]+"";return{c(){e=f("span"),n=k(o),c(e,"class",i="json_"+typeof t[9])},m(t,i){u(t,e,i),$(e,n)},p(t,l){8&l&&o!==(o=t[9]+"")&&w(n,o),8&l&&i!==(i="json_"+typeof t[9])&&c(e,"class",i)},i:l,o:l,d(t){t&&r(e)}}}function _s(t){let e,n;return e=new js({props:{name:"",value:t[9],fullopen:t[4],open:t[4],tabular:!0}}),{c(){F(e.$$.fragment)},m(t,i){O(e,t,i),n=!0},p(t,n){const i={};8&n&&(i.value=t[9]),16&n&&(i.fullopen=t[4]),16&n&&(i.open=t[4]),e.$set(i)},i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){N(e,t)}}}function Ss(t){let e,n,i,o,l,s,a,d,p,h=t[8]+"";const b=[_s,Ds],x=[];function v(t,e){return"object"==typeof t[9]&&null!==t[9]?0:1}return s=v(t),a=x[s]=b[s](t),{c(){e=f("tr"),n=f("td"),i=k(h),o=D(),l=f("td"),a.c(),d=D(),c(n,"class","json-table-key")},m(t,r){u(t,e,r),$(e,n),$(n,i),$(e,o),$(e,l),x[s].m(l,null),$(e,d),p=!0},p(t,e){(!p||8&e)&&h!==(h=t[8]+"")&&w(i,h);let n=s;s=v(t),s===n?x[s].p(t,e):(z(),m(x[n],1,1,()=>{x[n]=null}),M(),a=x[s],a?a.p(t,e):(a=x[s]=b[s](t),a.c()),g(a,1),a.m(l,null))},i(t){p||(g(a),p=!0)},o(t){m(a),p=!1},d(t){t&&r(e),x[s].d()}}}function zs(t){let e,n,i,o;const l=[cs,ss],s=[];function c(t,e){return"object"==t[6]||"array"==t[6]?0:1}return e=c(t),n=s[e]=l[e](t),{c(){n.c(),i=S()},m(t,n){s[e].m(t,n),u(t,i,n),o=!0},p(t,[o]){let r=e;e=c(t),e===r?s[e].p(t,o):(z(),m(s[r],1,1,()=>{s[r]=null}),M(),n=s[e],n?n.p(t,o):(n=s[e]=l[e](t),n.c()),g(n,1),n.m(i.parentNode,i))},i(t){o||(g(n),o=!0)},o(t){m(n),o=!1},d(t){t&&r(i),s[e].d(t)}}}function Ms(t,e,n){let i,{space:o=0}=e,{name:l=""}=e,{value:r}=e,{fullopen:s=!1}=e,{open:c=!1}=e,{tabular:a=!1}=e;return t.$$set=t=>{"space"in t&&n(1,o=t.space),"name"in t&&n(2,l=t.name),"value"in t&&n(3,r=t.value),"fullopen"in t&&n(4,s=t.fullopen),"open"in t&&n(0,c=t.open),"tabular"in t&&n(5,a=t.tabular)},t.$$.update=()=>{8&t.$$.dirty&&(Array.isArray(r)?n(6,i="array"):n(6,i=null===r?"null":typeof r))},[c,o,l,r,s,a,i,function(){c=this.open,n(0,c)}]}class js extends t{constructor(t){super(),e(this,t,Ms,zs,n,{space:1,name:2,value:3,fullopen:4,open:0,tabular:5})}}function Es(t){let e,n,i,o,l,r,s,c;function a(e){t[15](e)}function u(e){t[16](e)}function d(e){t[17](e)}function f(e){t[18](e)}function h(e){t[19](e)}function w(e){t[20](e)}let b={};return void 0!==t[0]&&(b.space=t[0]),void 0!==t[1]&&(b.name=t[1]),void 0!==t[2]&&(b.value=t[2]),void 0!==t[3]&&(b.fullopen=t[3]),void 0!==t[4]&&(b.open=t[4]),void 0!==t[5]&&(b.tabular=t[5]),e=new js({props:b}),p.push(()=>U(e,"space",a)),p.push(()=>U(e,"name",u)),p.push(()=>U(e,"value",d)),p.push(()=>U(e,"fullopen",f)),p.push(()=>U(e,"open",h)),p.push(()=>U(e,"tabular",w)),{c(){F(e.$$.fragment)},m(t,n){O(e,t,n),c=!0},p(t,c){const a={};!n&&1&c&&(n=!0,a.space=t[0],q(()=>n=!1)),!i&&2&c&&(i=!0,a.name=t[1],q(()=>i=!1)),!o&&4&c&&(o=!0,a.value=t[2],q(()=>o=!1)),!l&&8&c&&(l=!0,a.fullopen=t[3],q(()=>l=!1)),!r&&16&c&&(r=!0,a.open=t[4],q(()=>r=!1)),!s&&32&c&&(s=!0,a.tabular=t[5],q(()=>s=!1)),e.$set(a)},i(t){c||(g(e.$$.fragment,t),c=!0)},o(t){m(e.$$.fragment,t),c=!1},d(t){N(e,t)}}}function Cs(t){let e,n,i,o,l,s,a,h,w,b,x,v,y,k;function _(e){t[9](e)}function S(e){t[10](e)}function z(e){t[11](e)}function M(e){t[12](e)}function j(e){t[13](e)}function E(e){t[14](e)}i=new pn({props:{tooltip:"copia clipboard",$$slots:{default:[Ts]},$$scope:{ctx:t}}});let C={};return void 0!==t[0]&&(C.space=t[0]),void 0!==t[1]&&(C.name=t[1]),void 0!==t[2]&&(C.value=t[2]),void 0!==t[3]&&(C.fullopen=t[3]),void 0!==t[4]&&(C.open=t[4]),void 0!==t[5]&&(C.tabular=t[5]),l=new js({props:C}),p.push(()=>U(l,"space",_)),p.push(()=>U(l,"name",S)),p.push(()=>U(l,"value",z)),p.push(()=>U(l,"fullopen",M)),p.push(()=>U(l,"open",j)),p.push(()=>U(l,"tabular",E)),{c(){e=f("div"),n=f("button"),F(i.$$.fragment),o=D(),F(l.$$.fragment),c(n,"class","absolute top-0 right-4"),c(e,"class","relative")},m(r,s){u(r,e,s),$(e,n),O(i,n,null),$(e,o),O(l,e,null),v=!0,y||(k=d(n,"click",t[8]),y=!0)},p(t,e){const n={};2097152&e&&(n.$$scope={dirty:e,ctx:t}),i.$set(n);const o={};!s&&1&e&&(s=!0,o.space=t[0],q(()=>s=!1)),!a&&2&e&&(a=!0,o.name=t[1],q(()=>a=!1)),!h&&4&e&&(h=!0,o.value=t[2],q(()=>h=!1)),!w&&8&e&&(w=!0,o.fullopen=t[3],q(()=>w=!1)),!b&&16&e&&(b=!0,o.open=t[4],q(()=>b=!1)),!x&&32&e&&(x=!0,o.tabular=t[5],q(()=>x=!1)),l.$set(o)},i(t){v||(g(i.$$.fragment,t),g(l.$$.fragment,t),v=!0)},o(t){m(i.$$.fragment,t),m(l.$$.fragment,t),v=!1},d(t){t&&r(e),N(i),N(l),y=!1,k()}}}function Ts(t){let e;return{c(){e=k("π")},m(t,n){u(t,e,n)},d(t){t&&r(e)}}}function Ns(t){let e,n,i,o;const l=[Cs,Es],s=[];function c(t,e){return t[2]&&navigator&&!t[6]?0:1}return e=c(t),n=s[e]=l[e](t),{c(){n.c(),i=S()},m(t,n){s[e].m(t,n),u(t,i,n),o=!0},p(t,[o]){let r=e;e=c(t),e===r?s[e].p(t,o):(z(),m(s[r],1,1,()=>{s[r]=null}),M(),n=s[e],n?n.p(t,o):(n=s[e]=l[e](t),n.c()),g(n,1),n.m(i.parentNode,i))},i(t){o||(g(n),o=!0)},o(t){m(n),o=!1},d(t){t&&r(i),s[e].d(t)}}}function Os(t,e,n){const{bus:i}=on();let{noclip:o=!1}=e,{space:l=0}=e,{name:r=""}=e,{value:s}=e,{fullopen:c=!1}=e,{open:a=!1}=e,{tabular:u=!1}=e;return t.$$set=t=>{"noclip"in t&&n(6,o=t.noclip),"space"in t&&n(0,l=t.space),"name"in t&&n(1,r=t.name),"value"in t&&n(2,s=t.value),"fullopen"in t&&n(3,c=t.fullopen),"open"in t&&n(4,a=t.open),"tabular"in t&&n(5,u=t.tabular)},[l,r,s,c,a,u,o,i,t=>{navigator.clipboard.writeText(JSON.stringify(s,null,2)),i.messaggio("copiato")},function(t){l=t,n(0,l)},function(t){r=t,n(1,r)},function(t){s=t,n(2,s)},function(t){c=t,n(3,c)},function(t){a=t,n(4,a)},function(t){u=t,n(5,u)},function(t){l=t,n(0,l)},function(t){r=t,n(1,r)},function(t){s=t,n(2,s)},function(t){c=t,n(3,c)},function(t){a=t,n(4,a)},function(t){u=t,n(5,u)}]}class As extends t{constructor(t){super(),e(this,t,Os,Ns,n,{noclip:6,space:0,name:1,value:2,fullopen:3,open:4,tabular:5})}}function Fs(t){let e;return{c(){e=f("link"),c(e,"rel","stylesheet"),c(e,"href",t[2]),c(e,"integrity",t[3]),c(e,"crossorigin","")},m(t,n){u(t,e,n)},p(t,n){4&n&&c(e,"href",t[2]),8&n&&c(e,"integrity",t[3])},d(t){t&&r(e)}}}function Is(t){let e,n,i=t[2]&&Fs(t);return{c(){i&&i.c(),e=f("script"),P(e.src,n=t[0])||c(e,"src",n),c(e,"integrity",t[1]),c(e,"crossorigin","")},m(n,o){i&&i.m(document.head,null),$(document.head,e),t[5](e)},p(t,[o]){t[2]?i?i.p(t,o):(i=Fs(t),i.c(),i.m(e.parentNode,e)):i&&(i.d(1),i=null),1&o&&!P(e.src,n=t[0])&&c(e,"src",n),2&o&&c(e,"integrity",t[1])},i:l,o:l,d(n){i&&i.d(n),r(e),t[5](null)}}}function Rs(t,e,n){const i=K();let o,{url:l="",integrity:r="",css:s="",cssintegrity:c=""}=e;function a(t){i("error",t)}function u(t){i("loaded",t)}return W(async()=>{o.addEventListener("load",u),o.addEventListener("error",a)}),t.$$set=t=>{"url"in t&&n(0,l=t.url),"integrity"in t&&n(1,r=t.integrity),"css"in t&&n(2,s=t.css),"cssintegrity"in t&&n(3,c=t.cssintegrity)},[l,r,s,c,o,function(t){p[t?"unshift":"push"](()=>{o=t,n(4,o)})}]}class Ls extends t{constructor(t){super(),e(this,t,Rs,Is,n,{url:0,integrity:1,css:2,cssintegrity:3})}}function Bs(t,e,n){const i=t.slice();return i[2]=e[n],i}function Hs(t){let e,n,i,o,l=t[2]+"";return{c(){e=f("p"),n=f("span"),i=k(l),o=k("\n Lorem ipsum dolor sit, amet consectetur adipisicing elit. Quam ea quibusdam possimus vero quas rem. Maiores ab cumque asperiores fugiat quidem commodi. Ut exercitationem perferendis sunt dolore mollitia iusto, recusandae rem dolor. Maiores expedita temporibus impedit eligendi ea tempore aspernatur esse voluptas. Aspernatur esse, numquam, est quaerat, deserunt repellat qui dolores voluptatibus voluptates neque iste tempore totam. Laboriosam, neque tempore?\n "),c(n,"class","text-3xl pr-2"),c(e,"class","my-2")},m(t,l){u(t,e,l),$(e,n),$(n,i),$(e,o)},p(t,e){1&e&&l!==(l=t[2]+"")&&w(i,l)},d(t){t&&r(e)}}}function Ps(t){let e,n=B(t[0]),i=[];for(let e=0;e<n.length;e+=1)i[e]=Hs(Bs(t,n,e));return{c(){for(let t=0;t<i.length;t+=1)i[t].c();e=S()},m(t,n){for(let e=0;e<i.length;e+=1)i[e]&&i[e].m(t,n);u(t,e,n)},p(t,[o]){if(1&o){let l;for(n=B(t[0]),l=0;l<n.length;l+=1){const r=Bs(t,n,l);i[l]?i[l].p(r,o):(i[l]=Hs(r),i[l].c(),i[l].m(e.parentNode,e))}for(;l<i.length;l+=1)i[l].d(1);i.length=n.length}},i:l,o:l,d(t){t&&r(e),H(i,t)}}}function Vs(t,e,n){let i,{n:o=10}=e;return t.$$set=t=>{"n"in t&&n(1,o=t.n)},t.$$.update=()=>{2&t.$$.dirty&&n(0,i=(t=>{for(var e=[],n=1;n<=t;n++)e.push(n);return e})(o))},[i,o]}class Ys extends t{constructor(t){super(),e(this,t,Vs,Ps,n,{n:1})}}function Us(t){let e,n,i,o,l,s,a,d,p,h,w,b,x,v,y;o=new en({props:{img:t[4],size:10,black:!0}});let k=t[0]&&qs(t);h=new qn({props:{sm:!0,black:!0,value:"chiudi"}}),h.$on("click",t[6]);let S=t[2]&&Gs(t);return{c(){e=f("div"),n=f("div"),i=f("div"),F(o.$$.fragment),l=D(),s=f("div"),k&&k.c(),a=D(),d=f("div"),p=D(),F(h.$$.fragment),w=D(),S&&S.c(),c(d,"class","text-sm font-ligth"),c(s,"class","flex-1 overflow-hidden flex flex-col"),c(i,"class","flexrow space-x-2 items-center"),c(n,"class",b=(2==t[5]?"bg-c-danger text-white":1==t[5]?"shadow-lg bg-c-warning text-white":"bg-c-success text-white")+" p-4 w-full text-left rounded-md shadow-lg z-50 border border-c-border"),c(e,"class","max-w-md mx-auto fixed bottom-[10%] inset-x-0 noprint"),_(e,"z-index","1000")},m(r,c){u(r,e,c),$(e,n),$(n,i),O(o,i,null),$(i,l),$(i,s),k&&k.m(s,null),$(s,a),$(s,d),d.innerHTML=t[1],$(i,p),O(h,i,null),$(n,w),S&&S.m(n,null),y=!0},p(t,e){const i={};16&e&&(i.img=t[4]),o.$set(i),t[0]?k?(k.p(t,e),1&e&&g(k,1)):(k=qs(t),k.c(),g(k,1),k.m(s,a)):k&&(z(),m(k,1,1,()=>{k=null}),M()),(!y||2&e)&&(d.innerHTML=t[1]),t[2]?S?S.p(t,e):(S=Gs(t),S.c(),S.m(n,null)):S&&(S.d(1),S=null),(!y||32&e&&b!==(b=(2==t[5]?"bg-c-danger text-white":1==t[5]?"shadow-lg bg-c-warning text-white":"bg-c-success text-white")+" p-4 w-full text-left rounded-md shadow-lg z-50 border border-c-border"))&&c(n,"class",b)},i(t){y||(g(o.$$.fragment,t),g(k),g(h.$$.fragment,t),t&&E(()=>{y&&(v&&v.end(1),x=C(e,et,{duration:500,easing:ot}),x.start())}),y=!0)},o(t){m(o.$$.fragment,t),m(k),m(h.$$.fragment,t),x&&x.invalidate(),t&&(v=j(e,tt,{duration:300})),y=!1},d(t){t&&r(e),N(o),k&&k.d(),N(h),S&&S.d(),t&&v&&v.end()}}}function qs(t){let e,n,i;return n=new Dn({props:{id:t[0]}}),{c(){e=f("div"),F(n.$$.fragment),c(e,"class","font-bold text-xl")},m(t,o){u(t,e,o),O(n,e,null),i=!0},p(t,e){const i={};1&e&&(i.id=t[0]),n.$set(i)},i(t){i||(g(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&r(e),N(n)}}}function Gs(t){let e,n,i,o;return{c(){e=f("div"),e.textContent="Details:",n=D(),i=f("pre"),o=k(t[2]),c(e,"class","text-xs pt-4 mb-2 w-full border-b border-c-100 font-ligth"),c(i,"class","text-c-200 font-mono text-xs p-1 rounded bg-white max-h-48 overflow-y-auto")},m(t,l){u(t,e,l),u(t,n,l),u(t,i,l),$(i,o)},p(t,e){4&e&&w(o,t[2])},d(t){t&&(r(e),r(n),r(i))}}}function Ws(t){let e,n,i=t[3]&&Us(t);return{c(){i&&i.c(),e=S()},m(t,o){i&&i.m(t,o),u(t,e,o),n=!0},p(t,[n]){t[3]?i?(i.p(t,n),8&n&&g(i,1)):(i=Us(t),i.c(),g(i,1),i.m(e.parentNode,e)):i&&(z(),m(i,1,1,()=>{i=null}),M())},i(t){n||(g(i),n=!0)},o(t){m(i),n=!1},d(t){t&&r(e),i&&i.d(t)}}}function Xs(t,e,n){const{bus:i}=on();let o,l,r,s,c,a=!1;function u(t){h(t,0,"check_circle")}function d(t){h(t,1,"warning")}function f(t){n(5,c=2),h(t,2,"error")}W(()=>{i.on("message",u),i.on("messaggio",u),i.on("warning",d),i.on("error",f)}),Z(()=>{i.off("message",u),i.off("messaggio",u),i.off("warning",d),i.off("error",f)});var p=0;function h(t,e,i){if(n(0,o=n(2,r="")),n(5,c=e),n(4,s=i),"string"==typeof t){let e=t.split("\n"),i=e[0].indexOf(":");i>0?(n(0,o=e[0].slice(0,i)),n(1,l=e[0].slice(i+1))):(n(0,o=e[0]),n(1,l="")),e.splice(0,1),n(2,r=e.join("\n"))}else t?(n(1,l=t?.value||t?.des||t?.text||t?.msg),n(0,o=t?.title),n(2,r=t?.extra)):n(1,l="undefined message");p&&clearInterval(p),n(3,a=!0),p=setTimeout(()=>{n(3,a=!1)},0==e?2e3:1==e?4e3:1e4)}return[o,l,r,a,s,c,()=>n(3,a=!1)]}class Ks extends t{constructor(t){super(),e(this,t,Xs,Ws,n,{})}}const Zs=t=>({}),Js=t=>({});function Qs(t){let e,n,i;const o=t[4].logo,l=h(o,t,t[3],Js),s=l||function(){let t;return{c(){t=k("Inserisci lo slot su logo")},m(e,n){u(e,t,n)},d(e){e&&r(t)}}}();return{c(){e=f("div"),n=f("div"),s&&s.c(),c(n,"class","p-8 bg-c-50 rounded-xl shadow"),c(e,"class","grid items-center h-full justify-center overflow-hidden")},m(t,o){u(t,e,o),$(e,n),s&&s.m(n,null),i=!0},p(t,e){l&&l.p&&(!i||8&e)&&b(l,o,t,t[3],i?v(o,t[3],e,Zs):x(t[3]),Js)},i(t){i||(g(s,t),i=!0)},o(t){m(s,t),i=!1},d(t){t&&r(e),s&&s.d(t)}}}function tc(t){let e,n,i,o,l,a;const p=t[4].default,w=h(p,t,t[3],null);return{c(){e=f("iframe"),i=D(),w&&w.c(),c(e,"title","PDF"),P(e.src,n=`${t[0]}${t[1]?"#view=FitH&zoom=page-width&navpanes=0&toolbar=0":""}`)||c(e,"src",n),c(e,"class","w-full h-full border-none")},m(n,r){u(n,e,r),u(n,i,r),w&&w.m(n,r),o=!0,l||(a=[d(e,"load",t[2]),d(e,"error",t[2])],l=!0)},p(t,i){(!o||3&i&&!P(e.src,n=`${t[0]}${t[1]?"#view=FitH&zoom=page-width&navpanes=0&toolbar=0":""}`))&&c(e,"src",n),w&&w.p&&(!o||8&i)&&b(w,p,t,t[3],o?v(p,t[3],i,null):x(t[3]),null)},i(t){o||(g(w,t),o=!0)},o(t){m(w,t),o=!1},d(t){t&&(r(e),r(i)),w&&w.d(t),l=!1,s(a)}}}function ec(t){let e,n,i,o;const l=[tc,Qs],s=[];function a(t,e){return t[0]?0:1}return n=a(t),i=s[n]=l[n](t),{c(){e=f("div"),i.c(),c(e,"class","w-full h-full overflow-auto relative")},m(t,i){u(t,e,i),s[n].m(e,null),o=!0},p(t,[o]){let r=n;n=a(t),n===r?s[n].p(t,o):(z(),m(s[r],1,1,()=>{s[r]=null}),M(),i=s[n],i?i.p(t,o):(i=s[n]=l[n](t),i.c()),g(i,1),i.m(e,null))},i(t){o||(g(i),o=!0)},o(t){m(i),o=!1},d(t){t&&r(e),s[n].d()}}}function nc(t,e,n){let{$$slots:i={},$$scope:o}=e;const{bus:l}=on();K();let{value:r=""}=e,{fullsize:s=!1}=e;return t.$$set=t=>{"value"in t&&n(0,r=t.value),"fullsize"in t&&n(1,s=t.fullsize),"$$scope"in t&&n(3,o=t.$$scope)},t.$$.update=()=>{1&t.$$.dirty&&async function(){r&&(l.wait(!0),await X())}()},[r,s,async function(){l.wait(!1)},o,i]}class ic extends t{constructor(t){super(),e(this,t,nc,ec,n,{value:0,fullsize:1})}}function oc(t){let e,n,i,o,l;const s=t[4].default,a=h(s,t,t[3],null);return{c(){e=f("div"),a&&a.c(),c(e,"class",n=(t[2].class||"")+" h-full relative overflow-y-auto")},m(n,r){u(n,e,r),a&&a.m(e,null),t[5](e),i=!0,o||(l=d(e,"scroll",t[1]),o=!0)},p(t,[o]){a&&a.p&&(!i||8&o)&&b(a,s,t,t[3],i?v(s,t[3],o,null):x(t[3]),null),(!i||4&o&&n!==(n=(t[2].class||"")+" h-full relative overflow-y-auto"))&&c(e,"class",n)},i(t){i||(g(a,t),i=!0)},o(t){m(a,t),i=!1},d(n){n&&r(e),a&&a.d(n),t[5](null),o=!1,l()}}}function lc(t,e,n){let{$$slots:l={},$$scope:r}=e;const{bus:s}=on();let c;return t.$$set=t=>{n(2,e=i(i({},e),o(t))),"$$scope"in t&&n(3,r=t.$$scope)},e=o(e),[c,function(t){var e=t.target;e.scrollTop,this.smallmenu=!(e.scrollTop<50),e.scrollTop+1.3*e.getClientRects()[0].height>e.scrollHeight&&s.emit("scrollbottom")},e,r,l,function(t){p[t?"unshift":"push"](()=>{c=t,n(0,c)})}]}class rc extends t{constructor(t){super(),e(this,t,lc,oc,n,{})}}function sc(t,e,n){const i=t.slice();return i[5]=e[n],i}function cc(t){let e,n,i,o,l,s,a,p,h,m=t[5]<=t[0]?"β
":"β";function g(){return t[3](t[5])}return{c(){e=f("span"),n=k(m),i=D(),c(e,"class",o=t[1]?"cursor-pointer":""),c(e,"role",l=t[1]?"button":"presentation"),c(e,"tabindex",s=t[1]?0:void 0),c(e,"aria-label",a=t[1]?`Valuta ${t[5]} stelle`:void 0)},m(t,o){u(t,e,o),$(e,n),$(e,i),p||(h=d(e,"click",g),p=!0)},p(i,r){t=i,1&r&&m!==(m=t[5]<=t[0]?"β
":"β")&&w(n,m),2&r&&o!==(o=t[1]?"cursor-pointer":"")&&c(e,"class",o),2&r&&l!==(l=t[1]?"button":"presentation")&&c(e,"role",l),2&r&&s!==(s=t[1]?0:void 0)&&c(e,"tabindex",s),2&r&&a!==(a=t[1]?`Valuta ${t[5]} stelle`:void 0)&&c(e,"aria-label",a)},d(t){t&&r(e),p=!1,h()}}}function ac(t){let e,n=B([1,2,3,4,5]),i=[];for(let e=0;e<5;e+=1)i[e]=cc(sc(t,n,e));return{c(){e=f("span");for(let t=0;t<5;t+=1)i[t].c();c(e,"class","flex flex-wrap space-x-2 text-base text-yellow-500")},m(t,n){u(t,e,n);for(let t=0;t<5;t+=1)i[t]&&i[t].m(e,null)},p(t,[o]){if(7&o){let l;for(n=B([1,2,3,4,5]),l=0;l<5;l+=1){const r=sc(t,n,l);i[l]?i[l].p(r,o):(i[l]=cc(r),i[l].c(),i[l].m(e,null))}for(;l<5;l+=1)i[l].d(1)}},i:l,o:l,d(t){t&&r(e),H(i,t)}}}function uc(t,e,n){let{value:i=0}=e,{editable:o=!1}=e;const l=K();function r(t){o&&l("input",t)}return t.$$set=t=>{"value"in t&&n(0,i=t.value),"editable"in t&&n(1,o=t.editable)},[i,o,r,t=>r(t)]}class dc extends t{constructor(t){super(),e(this,t,uc,ac,n,{value:0,editable:1})}}function fc(t){let e,n,i,o,l,a,p,h,m,g,w,b,x,v,y,_;return{c(){e=f("div"),n=f("button"),i=k("-"),l=D(),a=f("input"),p=D(),h=f("button"),m=k("+"),w=D(),b=f("input"),n.disabled=o=0==t[5],c(n,"class","cursor-pointer pr-1"),a.disabled=t[1],c(a,"type","range"),c(a,"min",t[4]),c(a,"max",t[6]),c(a,"step","1"),a.value=t[5],c(a,"class","w-28 modern-slider"),h.disabled=g=t[5]>=t[3]?.length-1,c(h,"class","cursor-pointer pl-1 pr-2"),b.disabled=x=!t[2]||t[1],c(b,"type","text"),b.value=t[0],c(b,"class",v="w-14 text-xs py-1 px-2 text-right rounded-lg focus:outline-none focus:ring-1 focus:ring-c-base "+(t[2]?"bg-white":"bg-c-100")),c(e,"class","flex items-center rounded-lg")},m(o,r){u(o,e,r),$(e,n),$(n,i),$(e,l),$(e,a),$(e,p),$(e,h),$(h,m),$(e,w),$(e,b),y||(_=[d(n,"click",t[15]),d(a,"input",t[9]),d(h,"click",t[16]),d(b,"change",t[10]),d(b,"blur",t[10])],y=!0)},p(t,e){32&e&&o!==(o=0==t[5])&&(n.disabled=o),2&e&&(a.disabled=t[1]),16&e&&c(a,"min",t[4]),64&e&&c(a,"max",t[6]),32&e&&(a.value=t[5]),40&e&&g!==(g=t[5]>=t[3]?.length-1)&&(h.disabled=g),6&e&&x!==(x=!t[2]||t[1])&&(b.disabled=x),1&e&&b.value!==t[0]&&(b.value=t[0]),4&e&&v!==(v="w-14 text-xs py-1 px-2 text-right rounded-lg focus:outline-none focus:ring-1 focus:ring-c-base "+(t[2]?"bg-white":"bg-c-100"))&&c(b,"class",v)},d(t){t&&r(e),y=!1,s(_)}}}function pc(t){let e,n=t[7]&&fc(t);return{c(){n&&n.c(),e=S()},m(t,i){n&&n.m(t,i),u(t,e,i)},p(t,[i]){t[7]?n?n.p(t,i):(n=fc(t),n.c(),n.m(e.parentNode,e)):n&&(n.d(1),n=null)},i:l,o:l,d(t){t&&r(e),n&&n.d(t)}}}function hc(t,e=-1/0,n=1/0){return(t=Number(t)||0)<e&&(t=e),t>n&&(t=n),t}function mc(t,e,n){const i=K();let o,l,r,s,{min:c=0,max:a=100,value:u=50,readonly:d,step:f=1,range:p,fm:h=!1}=e,m=[],g=!1;function w(t){let e,s=function(t){let e=0,n=1/0;for(let i=0;i<m.length;i++){let o=Math.abs(m[i]-t);o<n&&(n=o,e=i)}return{id:e,v:m[e]}}(t);return n(5,l=s.id),e=h?hc(t,m[o],m[r]):s.v,e!=u&&(n(0,u=e),i("change",e)),u}return t.$$set=t=>{"min"in t&&n(11,c=t.min),"max"in t&&n(12,a=t.max),"value"in t&&n(0,u=t.value),"readonly"in t&&n(1,d=t.readonly),"step"in t&&n(13,f=t.step),"range"in t&&n(14,p=t.range),"fm"in t&&n(2,h=t.fm)},t.$$.update=()=>{30724&t.$$.dirty&&function(){if(p&&Array.isArray(p)&&p.length)n(3,m=p.map(t=>parseFloat(t)??0).sort((t,e)=>t-e));else{n(4,o=Number(c)??0),n(6,r=Number(a)??100),s=f??1,r<o&&n(6,r=o),n(3,m=[]);let t=o,e=s>0?s:1;for(;;)if(m.push(t),t+=e,t=Math.round(100*t)/100,t>=a){m.push(a);break}}n(4,o=0),n(6,r=m.length-1),s=1,w(u),n(7,g=!0)}()},[u,d,h,m,o,l,r,g,w,function(t){let e=parseInt(t.target.value);if(e>=0&&e<m.length){n(5,l=e);let t=m[e];t!=u&&(n(0,u=t),i("change",t))}},function(t){let e=parseFloat(t.target.value)??0;e=Math.round(100*e)/100,w(hc(e,m[o],m[r]))},c,a,f,p,()=>{n(5,l--,l),w(m[l])},()=>{n(5,l++,l),w(m[l])}]}class gc extends t{constructor(t){super(),e(this,t,mc,pc,n,{min:11,max:12,value:0,readonly:1,step:13,range:14,fm:2})}}function wc(t,e,n){const i=t.slice();return i[21]=e[n],i[23]=n,i}function bc(t,e,n){const i=t.slice();return i[24]=e[n],i[26]=n,i}function xc(t,e,n){const i=t.slice();return i[27]=e[n],i[29]=n,i}function vc(t,e,n){const i=t.slice();return i[30]=e[n],i[32]=n,i}function yc(t){let e,n;return e=new en({props:{img:"expand_more",size:6}}),{c(){F(e.$$.fragment)},m(t,i){O(e,t,i),n=!0},i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){N(e,t)}}}function $c(t){let e,n,i,o=B(t[21].data),l=[];for(let e=0;e<o.length;e+=1)l[e]=Rc(bc(t,o,e));const s=t=>m(l[t],1,1,()=>{l[t]=null});return{c(){e=f("div");for(let t=0;t<l.length;t+=1)l[t].c();c(e,"class","absolute z-10 top-6 -left-10 py-2 bg-white flex flex-col space-y-2 border shadow-sm"),c(e,"style",n=`width: ${t[0]/4}rem`)},m(t,n){u(t,e,n);for(let t=0;t<l.length;t+=1)l[t]&&l[t].m(e,null);i=!0},p(t,r){if(187&r[0]){let n;for(o=B(t[21].data),n=0;n<o.length;n+=1){const i=bc(t,o,n);l[n]?(l[n].p(i,r),g(l[n],1)):(l[n]=Rc(i),l[n].c(),g(l[n],1),l[n].m(e,null))}for(z(),n=o.length;n<l.length;n+=1)s(n);M()}(!i||1&r[0]&&n!==(n=`width: ${t[0]/4}rem`))&&c(e,"style",n)},i(t){if(!i){for(let t=0;t<o.length;t+=1)g(l[t]);i=!0}},o(t){l=l.filter(Boolean);for(let t=0;t<l.length;t+=1)m(l[t]);i=!1},d(t){t&&r(e),H(l,t)}}}function kc(t){let e,n,i,o,l,a,p,h,w,b,x,v=t[24].icon&&_c(t);l=new Dn({props:{id:t[24].name}});let k=t[24].data&&t[24].data.length>0&&Sc(),_=t[3][1]==t[26]&&t[24].data&&t[24].data.length>0&&zc(t);function S(){return t[14](t[26],t[21])}function j(){return t[15](t[24],t[26],t[21])}return{c(){e=f("div"),n=f("div"),v&&v.c(),i=D(),o=f("div"),F(l.$$.fragment),a=D(),k&&k.c(),p=D(),_&&_.c(),h=D(),c(n,"class","mx-2 w-8 h-8 p-1"),c(o,"class","flex-1"),c(e,"class","flex flex-wrap items-center cursor-pointer relative"),y(e,"selected",t[3][1]==t[26])},m(t,r){u(t,e,r),$(e,n),v&&v.m(n,null),$(e,i),$(e,o),O(l,o,null),$(e,a),k&&k.m(e,null),$(e,p),_&&_.m(e,null),$(e,h),w=!0,b||(x=[d(e,"mouseover",S),d(e,"click",j)],b=!0)},p(i,o){(t=i)[24].icon?v?(v.p(t,o),2&o[0]&&g(v,1)):(v=_c(t),v.c(),g(v,1),v.m(n,null)):v&&(z(),m(v,1,1,()=>{v=null}),M());const r={};2&o[0]&&(r.id=t[24].name),l.$set(r),t[24].data&&t[24].data.length>0?k?2&o[0]&&g(k,1):(k=Sc(),k.c(),g(k,1),k.m(e,p)):k&&(z(),m(k,1,1,()=>{k=null}),M()),t[3][1]==t[26]&&t[24].data&&t[24].data.length>0?_?(_.p(t,o),10&o[0]&&g(_,1)):(_=zc(t),_.c(),g(_,1),_.m(e,h)):_&&(z(),m(_,1,1,()=>{_=null}),M()),(!w||8&o[0])&&y(e,"selected",t[3][1]==t[26])},i(t){w||(g(v),g(l.$$.fragment,t),g(k),g(_),w=!0)},o(t){m(v),m(l.$$.fragment,t),m(k),m(_),w=!1},d(t){t&&r(e),v&&v.d(),N(l),k&&k.d(),_&&_.d(),b=!1,s(x)}}}function Dc(t){let e;return{c(){e=f("div"),c(e,"class","w-full border-b")},m(t,n){u(t,e,n)},p:l,i:l,o:l,d(t){t&&r(e)}}}function _c(t){let e,n;return e=new en({props:{img:t[24].icon,size:6}}),{c(){F(e.$$.fragment)},m(t,i){O(e,t,i),n=!0},p(t,n){const i={};2&n[0]&&(i.img=t[24].icon),e.$set(i)},i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){N(e,t)}}}function Sc(t){let e,n;return e=new en({props:{img:"chevron_right",size:6}}),{c(){F(e.$$.fragment)},m(t,i){O(e,t,i),n=!0},i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){N(e,t)}}}function zc(t){let e,n,i,o=B(t[24].data),l=[];for(let e=0;e<o.length;e+=1)l[e]=Ic(xc(t,o,e));const s=t=>m(l[t],1,1,()=>{l[t]=null});return{c(){e=f("div");for(let t=0;t<l.length;t+=1)l[t].c();c(e,"class","absolute z-10 top-0 bg-white flex flex-col space-y-2 border shadow-sm"),c(e,"style",n=`left: ${(t[0]-1)/4}rem; width:${t[0]/4}rem`)},m(t,n){u(t,e,n);for(let t=0;t<l.length;t+=1)l[t]&&l[t].m(e,null);i=!0},p(t,r){if(187&r[0]){let n;for(o=B(t[24].data),n=0;n<o.length;n+=1){const i=xc(t,o,n);l[n]?(l[n].p(i,r),g(l[n],1)):(l[n]=Ic(i),l[n].c(),g(l[n],1),l[n].m(e,null))}for(z(),n=o.length;n<l.length;n+=1)s(n);M()}(!i||1&r[0]&&n!==(n=`left: ${(t[0]-1)/4}rem; width:${t[0]/4}rem`))&&c(e,"style",n)},i(t){if(!i){for(let t=0;t<o.length;t+=1)g(l[t]);i=!0}},o(t){l=l.filter(Boolean);for(let t=0;t<l.length;t+=1)m(l[t]);i=!1},d(t){t&&r(e),H(l,t)}}}function Mc(t){let e,n,i,o,l,a,p,h,w,b,x,v=t[27].icon&&Ec(t);l=new Dn({props:{id:t[27].name}});let k=t[27].data&&t[27].data.length>0&&Cc(),_=t[3][2]==t[29]&&t[27].data&&t[27].data.length>0&&Tc(t);function S(){return t[12](t[29],t[24])}function j(){return t[13](t[27],t[29],t[24])}return{c(){e=f("div"),n=f("div"),v&&v.c(),i=D(),o=f("div"),F(l.$$.fragment),a=D(),k&&k.c(),p=D(),_&&_.c(),h=D(),c(n,"class","mx-2 w-8 h-8 p-1"),c(o,"class","flex-1"),c(e,"class","flex flex-wrap items-center cursor-pointer relative"),y(e,"selected",t[3][2]==t[29])},m(t,r){u(t,e,r),$(e,n),v&&v.m(n,null),$(e,i),$(e,o),O(l,o,null),$(e,a),k&&k.m(e,null),$(e,p),_&&_.m(e,null),$(e,h),w=!0,b||(x=[d(e,"mouseover",S),d(e,"click",j)],b=!0)},p(i,o){(t=i)[27].icon?v?(v.p(t,o),2&o[0]&&g(v,1)):(v=Ec(t),v.c(),g(v,1),v.m(n,null)):v&&(z(),m(v,1,1,()=>{v=null}),M());const r={};2&o[0]&&(r.id=t[27].name),l.$set(r),t[27].data&&t[27].data.length>0?k?2&o[0]&&g(k,1):(k=Cc(),k.c(),g(k,1),k.m(e,p)):k&&(z(),m(k,1,1,()=>{k=null}),M()),t[3][2]==t[29]&&t[27].data&&t[27].data.length>0?_?(_.p(t,o),10&o[0]&&g(_,1)):(_=Tc(t),_.c(),g(_,1),_.m(e,h)):_&&(z(),m(_,1,1,()=>{_=null}),M()),(!w||8&o[0])&&y(e,"selected",t[3][2]==t[29])},i(t){w||(g(v),g(l.$$.fragment,t),g(k),g(_),w=!0)},o(t){m(v),m(l.$$.fragment,t),m(k),m(_),w=!1},d(t){t&&r(e),v&&v.d(),N(l),k&&k.d(),_&&_.d(),b=!1,s(x)}}}function jc(t){let e;return{c(){e=f("div"),c(e,"class","w-full border-b")},m(t,n){u(t,e,n)},p:l,i:l,o:l,d(t){t&&r(e)}}}function Ec(t){let e,n;return e=new en({props:{img:t[27].icon,size:6}}),{c(){F(e.$$.fragment)},m(t,i){O(e,t,i),n=!0},p(t,n){const i={};2&n[0]&&(i.img=t[27].icon),e.$set(i)},i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){N(e,t)}}}function Cc(t){let e,n;return e=new en({props:{img:"chevron_right",size:6}}),{c(){F(e.$$.fragment)},m(t,i){O(e,t,i),n=!0},i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){N(e,t)}}}function Tc(t){let e,n,i,o=B(t[27].data),l=[];for(let e=0;e<o.length;e+=1)l[e]=Fc(vc(t,o,e));const s=t=>m(l[t],1,1,()=>{l[t]=null});return{c(){e=f("div");for(let t=0;t<l.length;t+=1)l[t].c();c(e,"class","absolute z-10 top-0 bg-white flex flex-col space-y-2 border shadow-sm"),c(e,"style",n=`left: ${(t[0]-1)/4}rem; width:${t[0]/4}rem`)},m(t,n){u(t,e,n);for(let t=0;t<l.length;t+=1)l[t]&&l[t].m(e,null);i=!0},p(t,r){if(186&r[0]){let n;for(o=B(t[27].data),n=0;n<o.length;n+=1){const i=vc(t,o,n);l[n]?(l[n].p(i,r),g(l[n],1)):(l[n]=Fc(i),l[n].c(),g(l[n],1),l[n].m(e,null))}for(z(),n=o.length;n<l.length;n+=1)s(n);M()}(!i||1&r[0]&&n!==(n=`left: ${(t[0]-1)/4}rem; width:${t[0]/4}rem`))&&c(e,"style",n)},i(t){if(!i){for(let t=0;t<o.length;t+=1)g(l[t]);i=!0}},o(t){l=l.filter(Boolean);for(let t=0;t<l.length;t+=1)m(l[t]);i=!1},d(t){t&&r(e),H(l,t)}}}function Nc(t){let e,n,i,o,l,a,p,h,w,b=t[30].icon&&Ac(t);function x(){return t[10](t[32],t[27])}function v(){return t[11](t[30],t[32],t[27])}return l=new Dn({props:{id:t[30].name}}),{c(){e=f("div"),n=f("div"),b&&b.c(),i=D(),o=f("div"),F(l.$$.fragment),a=D(),c(n,"class","mx-2 w-8 h-8 p-1"),c(o,"class","flex-1"),c(e,"class","flex flex-wrap items-center cursor-pointer relative"),y(e,"selected",t[3][3]==t[32])},m(t,r){u(t,e,r),$(e,n),b&&b.m(n,null),$(e,i),$(e,o),O(l,o,null),$(e,a),p=!0,h||(w=[d(e,"mouseover",x),d(e,"click",v)],h=!0)},p(i,o){(t=i)[30].icon?b?(b.p(t,o),2&o[0]&&g(b,1)):(b=Ac(t),b.c(),g(b,1),b.m(n,null)):b&&(z(),m(b,1,1,()=>{b=null}),M());const r={};2&o[0]&&(r.id=t[30].name),l.$set(r),(!p||8&o[0])&&y(e,"selected",t[3][3]==t[32])},i(t){p||(g(b),g(l.$$.fragment,t),p=!0)},o(t){m(b),m(l.$$.fragment,t),p=!1},d(t){t&&r(e),b&&b.d(),N(l),h=!1,s(w)}}}function Oc(t){let e;return{c(){e=f("div"),c(e,"class","w-full border-b")},m(t,n){u(t,e,n)},p:l,i:l,o:l,d(t){t&&r(e)}}}function Ac(t){let e,n;return e=new en({props:{img:t[30].icon,size:6}}),{c(){F(e.$$.fragment)},m(t,i){O(e,t,i),n=!0},p(t,n){const i={};2&n[0]&&(i.img=t[30].icon),e.$set(i)},i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){N(e,t)}}}function Fc(t){let e,n,i,o;const l=[Oc,Nc],s=[];function c(t,e){return t[30].sep?0:1}return e=c(t),n=s[e]=l[e](t),{c(){n.c(),i=S()},m(t,n){s[e].m(t,n),u(t,i,n),o=!0},p(t,o){let r=e;e=c(t),e===r?s[e].p(t,o):(z(),m(s[r],1,1,()=>{s[r]=null}),M(),n=s[e],n?n.p(t,o):(n=s[e]=l[e](t),n.c()),g(n,1),n.m(i.parentNode,i))},i(t){o||(g(n),o=!0)},o(t){m(n),o=!1},d(t){t&&r(i),s[e].d(t)}}}function Ic(t){let e,n,i,o;const l=[jc,Mc],s=[];function c(t,e){return t[27].sep?0:1}return e=c(t),n=s[e]=l[e](t),{c(){n.c(),i=S()},m(t,n){s[e].m(t,n),u(t,i,n),o=!0},p(t,o){let r=e;e=c(t),e===r?s[e].p(t,o):(z(),m(s[r],1,1,()=>{s[r]=null}),M(),n=s[e],n?n.p(t,o):(n=s[e]=l[e](t),n.c()),g(n,1),n.m(i.parentNode,i))},i(t){o||(g(n),o=!0)},o(t){m(n),o=!1},d(t){t&&r(i),s[e].d(t)}}}function Rc(t){let e,n,i,o;const l=[Dc,kc],s=[];function c(t,e){return t[24].sep?0:1}return e=c(t),n=s[e]=l[e](t),{c(){n.c(),i=S()},m(t,n){s[e].m(t,n),u(t,i,n),o=!0},p(t,o){let r=e;e=c(t),e===r?s[e].p(t,o):(z(),m(s[r],1,1,()=>{s[r]=null}),M(),n=s[e],n?n.p(t,o):(n=s[e]=l[e](t),n.c()),g(n,1),n.m(i.parentNode,i))},i(t){o||(g(n),o=!0)},o(t){m(n),o=!1},d(t){t&&r(i),s[e].d(t)}}}function Lc(t){let e,n,i,o,l,a,p,h,w,b;o=new Dn({props:{id:t[21].name}});let x=t[21].data&&t[21].data.length>0&&yc(),v=t[3][0]==t[23]&&t[21].data&&t[21].data.length>0&&$c(t);function k(){return t[16](t[23])}function _(){return t[17](t[23])}function S(){return t[18](t[21],t[23])}return{c(){e=f("div"),n=f("div"),i=f("div"),F(o.$$.fragment),l=D(),x&&x.c(),a=D(),v&&v.c(),p=D(),c(i,"class","flex-1"),c(n,"class","flex flex-wrap"),c(e,"class","cursor-pointer px-2 relative"),y(e,"selected",t[3][0]==t[23])},m(t,r){u(t,e,r),$(e,n),$(n,i),O(o,i,null),$(n,l),x&&x.m(n,null),$(e,a),v&&v.m(e,null),$(e,p),h=!0,w||(b=[d(e,"mouseover",k),d(e,"mouseleave",_),d(e,"click",S)],w=!0)},p(i,l){t=i;const r={};2&l[0]&&(r.id=t[21].name),o.$set(r),t[21].data&&t[21].data.length>0?x?2&l[0]&&g(x,1):(x=yc(),x.c(),g(x,1),x.m(n,null)):x&&(z(),m(x,1,1,()=>{x=null}),M()),t[3][0]==t[23]&&t[21].data&&t[21].data.length>0?v?(v.p(t,l),10&l[0]&&g(v,1)):(v=$c(t),v.c(),g(v,1),v.m(e,p)):v&&(z(),m(v,1,1,()=>{v=null}),M()),(!h||8&l[0])&&y(e,"selected",t[3][0]==t[23])},i(t){h||(g(o.$$.fragment,t),g(x),g(v),h=!0)},o(t){m(o.$$.fragment,t),m(x),m(v),h=!1},d(t){t&&r(e),N(o),x&&x.d(),v&&v.d(),w=!1,s(b)}}}function Bc(t){let e,n,i,o,l=B(t[1]),s=[];for(let e=0;e<l.length;e+=1)s[e]=Lc(wc(t,l,e));const a=t=>m(s[t],1,1,()=>{s[t]=null});return{c(){e=f("div");for(let t=0;t<s.length;t+=1)s[t].c();c(e,"class","flex flex-wrap items-center")},m(l,r){u(l,e,r);for(let t=0;t<s.length;t+=1)s[t]&&s[t].m(e,null);n=!0,i||(o=d(window,"keydown",t[6]),i=!0)},p(t,n){if(191&n[0]){let i;for(l=B(t[1]),i=0;i<l.length;i+=1){const o=wc(t,l,i);s[i]?(s[i].p(o,n),g(s[i],1)):(s[i]=Lc(o),s[i].c(),g(s[i],1),s[i].m(e,null))}for(z(),i=l.length;i<s.length;i+=1)a(i);M()}},i(t){if(!n){for(let t=0;t<l.length;t+=1)g(s[t]);n=!0}},o(t){s=s.filter(Boolean);for(let t=0;t<s.length;t+=1)m(s[t]);n=!1},d(t){t&&r(e),H(s,t),i=!1,o()}}}function Hc(t,e,n){let{naviga:i=!1}=e,{size:o=60}=e,{value:l=[]}=e,{escape:r=!1}=e;const s=K();function c(t){n(2,u=!1),n(3,d=[-1,-1,-1,-1]),n(4,f=[l]),n(5,p=0),i&&t.link?it(t.link):s("select",t)}function a(t){t.data&&t.data.length||c(t)}let u=!1,d=[-1,-1,-1,-1],f=[],p=0;return t.$$set=t=>{"naviga"in t&&n(8,i=t.naviga),"size"in t&&n(0,o=t.size),"value"in t&&n(1,l=t.value),"escape"in t&&n(9,r=t.escape)},[o,l,u,d,f,p,function(t){if(!(t.ctrlKey||t.shiftKey||t.altKey||t.metaKey))switch(t.key){case"F1":return void(r&&(u?(n(2,u=!1),n(3,d=[-1,-1,-1,-1]),n(5,p=0)):(n(2,u=!0),n(4,f[0]=l,f),n(5,p=0),n(3,d=[0,-1,-1,-1])),t.stopPropagation()));case"Enter":if(u)(e=f[p][d[p]]).data&&e.data.length>0&&p<3?(n(5,p++,p),n(3,d[p]=0,d),n(4,f[p]=e.data,f)):c(e);return void t.stopPropagation();case"ArrowLeft":return u&&(0==p?n(3,d[0]=d[0]>0?d[0]-1:f[0].length-1,d):(n(3,d[p]=-1,d),n(5,p--,p)),t.stopPropagation()),void t.stopPropagation();case"ArrowRight":if(u){if(0==p)n(3,d[0]=d[0]<l.length-1?d[0]+1:0,d);else if(p<3){var e;(e=f[p][d[p]]).data&&e.data.length&&(n(5,p++,p),n(4,f[p]=e.data,f),n(3,d[p]=0,d))}t.stopPropagation()}return;case"ArrowUp":if(u){if(0==p)return;1==p&&0==d[p]?(n(3,d[p]=-1,d),n(5,p--,p)):n(3,d[p]=d[p]>0?d[p]-1:f[p].length-1,d),t.stopPropagation()}return;case"ArrowDown":if(u){var i=f[p][d[p]];0==p?i.data&&i.data.length&&(n(5,p++,p),n(3,d[p]=0,d),n(4,f[p]=i.data,f)):n(3,d[p]=d[p]<f[p].length-1?d[p]+1:0,d),t.stopPropagation()}return}},a,i,r,(t,e)=>{d[3]!=t&&(n(5,p=3),n(4,f[p]=e.data,f),n(3,d[3]=t,d))},(t,e,n)=>a(t,n.data),(t,e)=>{d[2]!=t&&(n(5,p=2),n(4,f[p]=e.data,f),n(3,d[2]=t,d),n(3,d[3]=-1,d))},(t,e,n)=>a(t,n.data),(t,e)=>{d[1]!=t&&(n(5,p=1),n(4,f[p]=e.data,f),n(3,d[1]=t,d),n(3,d[2]=-1,d))},(t,e,n)=>a(t,n.data),t=>{d[0]!=t&&(n(5,p=0),n(3,d[0]=t,d),n(4,f[p]=l,f),n(2,u=!0),n(3,d[1]=-1,d))},t=>{d[0]==t&&n(3,d[0]=-1,d),n(2,u=!1)},(t,e)=>a(t)]}class Pc extends t{constructor(t){super(),e(this,t,Hc,Bc,n,{naviga:8,size:0,value:1,escape:9},null,[-1,-1])}}function Vc(t,e,n){const i=t.slice();return i[48]=e[n],i[50]=n,i}function Yc(t,e,n){const i=t.slice();return i[51]=e[n],i}function Uc(t){let e,n,i;return n=new Dn({props:{id:t[2]}}),{c(){e=f("div"),F(n.$$.fragment),c(e,"class","label pt-1 h-6")},m(t,o){u(t,e,o),O(n,e,null),i=!0},p(t,e){const i={};4&e[0]&&(i.id=t[2]),n.$set(i)},i(t){i||(g(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&r(e),N(n)}}}function qc(t){let e,n,i,o;return n=new Dn({props:{id:t[2]}}),{c(){e=f("div"),F(n.$$.fragment),c(e,"class","label leading-none text-right pr-2"),c(e,"style",i=`width: ${t[20]}%;`)},m(t,i){u(t,e,i),O(n,e,null),o=!0},p(t,l){const r={};4&l[0]&&(r.id=t[2]),n.$set(r),(!o||1048576&l[0]&&i!==(i=`width: ${t[20]}%;`))&&c(e,"style",i)},i(t){o||(g(n.$$.fragment,t),o=!0)},o(t){m(n.$$.fragment,t),o=!1},d(t){t&&r(e),N(n)}}}function Gc(t){let e,n,i=(t[0].cod||t[0].id||"")+"";return{c(){e=f("div"),n=k(i),c(e,"class","rounded-l bg-c-base text-white px-2 text-xs flex flex-col justify-center"),y(e,"h-8",!t[7]),y(e,"h-6",t[7])},m(t,i){u(t,e,i),$(e,n)},p(t,o){1&o[0]&&i!==(i=(t[0].cod||t[0].id||"")+"")&&w(n,i),128&o[0]&&y(e,"h-8",!t[7]),128&o[0]&&y(e,"h-6",t[7])},d(t){t&&r(e)}}}function Wc(t){let e,n,i,o,l;return{c(){e=f("input"),c(e,"type","text"),c(e,"class","!rounded-none !pr-6"),e.value=n=t[10]?t[0]||"":t[9]?t[0]?.cod||"":t[0]?.des||"",c(e,"placeholder",i=t[22](t[4],t[21])),e.disabled=t[8],c(e,"autocorrect","off"),c(e,"autocomplete","off"),y(e,"sm",t[7])},m(n,i){u(n,e,i),t[37](e),o||(l=d(e,"keyup",t[38]),o=!0)},p(t,o){1537&o[0]&&n!==(n=t[10]?t[0]||"":t[9]?t[0]?.cod||"":t[0]?.des||"")&&e.value!==n&&(e.value=n),2097168&o[0]&&i!==(i=t[22](t[4],t[21]))&&c(e,"placeholder",i),256&o[0]&&(e.disabled=t[8]),128&o[0]&&y(e,"sm",t[7])},d(n){n&&r(e),t[37](null),o=!1,l()}}}function Xc(t){let e,n,i,o,l;return n=new en({props:{size:5,img:t[15].length?"expand_less":"expand_more"}}),{c(){e=f("button"),F(n.$$.fragment),c(e,"tabindex","-1"),c(e,"class","absolute right-1 vcenter cursor-pointer")},m(r,s){u(r,e,s),O(n,e,null),i=!0,o||(l=d(e,"click",A(t[39])),o=!0)},p(t,e){const i={};32768&e[0]&&(i.img=t[15].length?"expand_less":"expand_more"),n.$set(i)},i(t){i||(g(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&r(e),N(n),o=!1,l()}}}function Kc(t){let e,n,i,o;n=new pn({props:{tooltip:t[12],$$slots:{default:[Wc]},$$scope:{ctx:t}}});let l=!t[8]&&Xc(t);return{c(){e=f("div"),F(n.$$.fragment),i=D(),l&&l.c()},m(t,r){u(t,e,r),O(n,e,null),$(e,i),l&&l.m(e,null),o=!0},p(t,i){const o={};4096&i[0]&&(o.tooltip=t[12]),2107281&i[0]|4096&i[1]&&(o.$$scope={dirty:i,ctx:t}),n.$set(o),t[8]?l&&(z(),m(l,1,1,()=>{l=null}),M()):l?(l.p(t,i),256&i[0]&&g(l,1)):(l=Xc(t),l.c(),g(l,1),l.m(e,null))},i(t){o||(g(n.$$.fragment,t),g(l),o=!0)},o(t){m(n.$$.fragment,t),m(l),o=!1},d(t){t&&r(e),N(n),l&&l.d()}}}function Zc(t){let e,n,i,o,l,s,a=B(t[15]),d=[];for(let e=0;e<a.length;e+=1)d[e]=ea(Vc(t,a,e));let p=t[1]&&t[17]>0&&na(t),h=t[1]&&ia(t);return{c(){e=f("div"),n=f("table"),i=f("tbody");for(let t=0;t<d.length;t+=1)d[t].c();o=D(),p&&p.c(),l=D(),h&&h.c(),c(n,"class","w-full"),c(e,"class","relative w-full bg-white border p-1")},m(t,r){u(t,e,r),$(e,n),$(n,i);for(let t=0;t<d.length;t+=1)d[t]&&d[t].m(i,null);$(e,o),p&&p.m(e,null),$(e,l),h&&h.m(e,null),s=!0},p(t,n){if(118072841&n[0]){let e;for(a=B(t[15]),e=0;e<a.length;e+=1){const o=Vc(t,a,e);d[e]?d[e].p(o,n):(d[e]=ea(o),d[e].c(),d[e].m(i,null))}for(;e<d.length;e+=1)d[e].d(1);d.length=a.length}t[1]&&t[17]>0?p?(p.p(t,n),131074&n[0]&&g(p,1)):(p=na(t),p.c(),g(p,1),p.m(e,l)):p&&(z(),m(p,1,1,()=>{p=null}),M()),t[1]?h?(h.p(t,n),2&n[0]&&g(h,1)):(h=ia(t),h.c(),g(h,1),h.m(e,null)):h&&(z(),m(h,1,1,()=>{h=null}),M())},i(t){s||(g(p),g(h),s=!0)},o(t){m(p),m(h),s=!1},d(t){t&&r(e),H(d,t),p&&p.d(),h&&h.d()}}}function Jc(t){let e,n,i,o,l,s,a=t[48].des+"",d=t[3]&&Qc(t);return{c(){e=f("td"),n=f("div"),i=f("div"),o=k(a),l=D(),d&&d.c(),s=S(),c(i,"class","w-full whitespace-pre-line line-clamp-2"),c(n,"class","text-xs pl-2 pr-4")},m(t,r){u(t,e,r),$(e,n),$(n,i),$(i,o),u(t,l,r),d&&d.m(t,r),u(t,s,r)},p(t,e){32768&e[0]&&a!==(a=t[48].des+"")&&w(o,a),t[3]?d?d.p(t,e):(d=Qc(t),d.c(),d.m(s.parentNode,s)):d&&(d.d(1),d=null)},d(t){t&&(r(e),r(l),r(s)),d&&d.d(t)}}}function Qc(t){let e,n=B(t[3]),i=[];for(let e=0;e<n.length;e+=1)i[e]=ta(Yc(t,n,e));return{c(){for(let t=0;t<i.length;t+=1)i[t].c();e=S()},m(t,n){for(let e=0;e<i.length;e+=1)i[e]&&i[e].m(t,n);u(t,e,n)},p(t,o){if(32776&o[0]){let l;for(n=B(t[3]),l=0;l<n.length;l+=1){const r=Yc(t,n,l);i[l]?i[l].p(r,o):(i[l]=ta(r),i[l].c(),i[l].m(e.parentNode,e))}for(;l<i.length;l+=1)i[l].d(1);i.length=n.length}},d(t){t&&r(e),H(i,t)}}}function ta(t){let e,n,i,o,l,s=t[48][t[51]]+"";return{c(){e=f("td"),n=f("div"),i=f("div"),o=k(s),l=D(),c(i,"class","w-full whitespace-pre-line line-clamp-2"),c(n,"class","text-xs pl-2 pr-4")},m(t,r){u(t,e,r),$(e,n),$(n,i),$(i,o),$(e,l)},p(t,e){32776&e[0]&&s!==(s=t[48][t[51]]+"")&&w(o,s)},d(t){t&&r(e)}}}function ea(t){let e,n,i,o,l,s,a,p,h=(t[48].cod||t[48].id||"")+"",m=!t[9]&&Jc(t);function g(){return t[34](t[48])}return{c(){e=f("tr"),n=f("td"),i=f("div"),o=k(h),l=D(),m&&m.c(),s=D(),_(i,"max-width","calc(100% - 20px)"),_(i,"min-width","fit-content"),c(i,"class","rounded bg-c-base text-white px-2 my-1 text-xs text-center"),c(e,"tabindex","-1"),c(e,"class","cursor-pointer"),y(e,"bg-c-150",t[50]==t[16]),y(e,"text-black",t[50]==t[16])},m(t,r){u(t,e,r),$(e,n),$(n,i),$(i,o),$(e,l),m&&m.m(e,null),$(e,s),a||(p=d(e,"mousedown",g),a=!0)},p(n,i){t=n,32768&i[0]&&h!==(h=(t[48].cod||t[48].id||"")+"")&&w(o,h),t[9]?m&&(m.d(1),m=null):m?m.p(t,i):(m=Jc(t),m.c(),m.m(e,s)),65536&i[0]&&y(e,"bg-c-150",t[50]==t[16]),65536&i[0]&&y(e,"text-black",t[50]==t[16])},d(t){t&&r(e),m&&m.d(),a=!1,p()}}}function na(t){let e,n,i,o,s;return n=new en({props:{size:6,img:"keyboard_arrow_up",color:"text-c-base hover:text-black"}}),{c(){e=f("button"),F(n.$$.fragment),c(e,"tabindex","-1"),c(e,"class","absolute top-0 right-0 cursor-pointer")},m(l,r){u(l,e,r),O(n,e,null),i=!0,o||(s=d(e,"click",t[35]),o=!0)},p:l,i(t){i||(g(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&r(e),N(n),o=!1,s()}}}function ia(t){let e,n,i,o,l=t[18]&&oa();return{c(){e=f("button"),l&&l.c(),c(e,"tabindex","-1"),c(e,"class","absolute bottom-0 right-0 cursor-pointer")},m(r,s){u(r,e,s),l&&l.m(e,null),n=!0,i||(o=d(e,"click",t[36]),i=!0)},p(t,n){t[18]?l?262144&n[0]&&g(l,1):(l=oa(),l.c(),g(l,1),l.m(e,null)):l&&(z(),m(l,1,1,()=>{l=null}),M())},i(t){n||(g(l),n=!0)},o(t){m(l),n=!1},d(t){t&&r(e),l&&l.d(),i=!1,o()}}}function oa(t){let e,n;return e=new en({props:{size:6,img:"keyboard_arrow_down",color:"text-c-base hover:text-black"}}),{c(){F(e.$$.fragment)},m(t,i){O(e,t,i),n=!0},i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){N(e,t)}}}function la(t){let e,n,i=t[15].length&&Zc(t);return{c(){e=f("div"),i&&i.c(),c(e,"slot","popup")},m(t,o){u(t,e,o),i&&i.m(e,null),n=!0},p(t,n){t[15].length?i?(i.p(t,n),32768&n[0]&&g(i,1)):(i=Zc(t),i.c(),g(i,1),i.m(e,null)):i&&(z(),m(i,1,1,()=>{i=null}),M())},i(t){n||(g(i),n=!0)},o(t){m(i),n=!1},d(t){t&&r(e),i&&i.d()}}}function ra(t){let e,n;return e=new An({props:{tooltip:t[6],size:t[7]?6:8,right:!0}}),e.$on("click",t[42]),{c(){F(e.$$.fragment)},m(t,i){O(e,t,i),n=!0},p(t,n){const i={};64&n[0]&&(i.tooltip=t[6]),128&n[0]&&(i.size=t[7]?6:8),e.$set(i)},i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){N(e,t)}}}function sa(t){let e,n,i,o,l,s,a,d,p,w,y=t[2]&&!t[11]&&Uc(t),k=t[2]&&t[11]&&qc(t),_=!t[9]&&(t[0]?.cod||"number"==typeof t[0]?.id)&&Gc(t),S={class:"flex-1 relative apptema-base",popup:t[15]?.length,$$slots:{popup:[la],default:[Kc]},$$scope:{ctx:t}};s=new hi({props:S}),t[40](s),s.$on("lostfocus",t[41]);let j=t[5]&&ra(t);const E=t[33].default,C=h(E,t,t[43],null);return{c(){e=f("label"),y&&y.c(),n=D(),i=f("div"),k&&k.c(),o=D(),_&&_.c(),l=D(),F(s.$$.fragment),a=D(),j&&j.c(),d=D(),C&&C.c(),c(i,"class","flexrow"),c(e,"class",p=`labinput ${t[29].class||""}`)},m(t,r){u(t,e,r),y&&y.m(e,null),$(e,n),$(e,i),k&&k.m(i,null),$(i,o),_&&_.m(i,null),$(i,l),O(s,i,null),$(i,a),j&&j.m(i,null),$(i,d),C&&C.m(i,null),w=!0},p(t,r){t[2]&&!t[11]?y?(y.p(t,r),2052&r[0]&&g(y,1)):(y=Uc(t),y.c(),g(y,1),y.m(e,n)):y&&(z(),m(y,1,1,()=>{y=null}),M()),t[2]&&t[11]?k?(k.p(t,r),2052&r[0]&&g(k,1)):(k=qc(t),k.c(),g(k,1),k.m(i,o)):k&&(z(),m(k,1,1,()=>{k=null}),M()),t[9]||!t[0]?.cod&&"number"!=typeof t[0]?.id?_&&(_.d(1),_=null):_?_.p(t,r):(_=Gc(t),_.c(),_.m(i,l));const a={};32768&r[0]&&(a.popup=t[15]?.length),3127195&r[0]|4096&r[1]&&(a.$$scope={dirty:r,ctx:t}),s.$set(a),t[5]?j?(j.p(t,r),32&r[0]&&g(j,1)):(j=ra(t),j.c(),g(j,1),j.m(i,d)):j&&(z(),m(j,1,1,()=>{j=null}),M()),C&&C.p&&(!w||4096&r[1])&&b(C,E,t,t[43],w?v(E,t[43],r,null):x(t[43]),null),(!w||536870912&r[0]&&p!==(p=`labinput ${t[29].class||""}`))&&c(e,"class",p)},i(t){w||(g(y),g(k),g(s.$$.fragment,t),g(j),g(C,t),w=!0)},o(t){m(y),m(k),m(s.$$.fragment,t),m(j),m(C,t),w=!1},d(n){n&&r(e),y&&y.d(),k&&k.d(),_&&_.d(),t[40](null),N(s),j&&j.d(),C&&C.d(n)}}}function ca(t,e,n){let l,r,{$$slots:s={},$$scope:c}=e;const{PP:a,bus:u,_:d,lang:f}=on();I(t,f,t=>n(21,r=t));const h=K();let m,g,w,b=[],x=0,v=0,y=!1,$={},k="",{label:D="",cat:_="",extracols:S,placeholder:z="scrivi per cercare",value:M={},service:j="",edit:E=!1,edittooltip:C=!1,sm:T=!1,readonly:N=!1,onlycod:O=!1,stringa:A=!1,oriz:F,tooltip:R,pages:L=!1,max:B=6}=e;async function H(){n(15,b=[]),n(16,x=0),k="",g.openmenu(!1)}function P(t){t!=w&&(w=t,k&&h("des",k),k="")}async function V(){var t=A?M:O?M?.cod||"":M?.des||"";if(j){var e=j.split(":"),i=e[0];e.splice(0,1),t="?"==t||" "==t?"":t.trim();var o=await a(i,{id:_,extra:e.join(":"),input:t,max:B,page:v});0==v&&n(1,L=!!o.rows),L?(o?(n(15,b=o.rows||[]),n(18,y=o.hasmore)):(o=[],n(18,y=!1)),n(16,x=0)):(n(15,b=o?.rows||o||[]),n(18,y=!1),n(16,x=0)),await g.openmenu(!!b?.length)}else H()}async function Y(t){if(!N&&"Tab"!=t.key&&"Shift"!=t.key&&"Alt"!=t.key){var e=t.target.value;if(A?n(0,M=t.target.value):("object"!=typeof M&&n(0,M={}),n(0,O?M.cod=t.target.value:M.des=t.target.value,M)),t.key&&!t.metaKey){if(N)return;var i=[];t.ctrlKey&&i.push("Ctrl"),t.altKey&&i.push("Alt"),t.shiftKey&&i.push("Shift"),i.push(t.key);let o=i.join("+");switch("Backspace"!=o||e||(o="Escape"),o){case"Escape":n(0,M=A?"":{}),n(17,v=0),await H(),t.preventDefault(),n(19,$=A?"":{}),P($),h("click",$),h("input",$);break;case"ArrowDown":t.preventDefault(),b.length>0?(x<b.length-1?n(16,x++,x):L&&y&&(n(17,v++,v),await V(),n(16,x=0)),n(19,$=A?b[x].cod:b[x]),k=b[x]?.des||"",P($)):(n(17,v=0),await V());break;case"ArrowUp":t.preventDefault(),b.length>0?(x>0?n(16,x--,x):L&&v>0&&(n(17,v--,v),await V(),n(16,x=b.length-1)),n(19,$=A?b[x].cod:b[x]),k=b[x]?.des||"",P($)):(k="",n(16,x=0));break;case"ArrowLeft":break;case"ArrowRight":case"Tab":case"Enter":if(t.preventDefault(),x<b.length){n(19,$=A?b[x].cod:b[x]),n(0,M=A?b[x].cod:b[x]);let t=b[x].des||"";H(),k=t}"Enter"==o&&(h("input",$),h("click",$)),P($);break;default:t.ctrlKey||t.altKey||(n(17,v=0),await V())}}}}return t.$$set=t=>{n(29,e=i(i({},e),o(t))),"label"in t&&n(2,D=t.label),"cat"in t&&n(30,_=t.cat),"extracols"in t&&n(3,S=t.extracols),"placeholder"in t&&n(4,z=t.placeholder),"value"in t&&n(0,M=t.value),"service"in t&&n(31,j=t.service),"edit"in t&&n(5,E=t.edit),"edittooltip"in t&&n(6,C=t.edittooltip),"sm"in t&&n(7,T=t.sm),"readonly"in t&&n(8,N=t.readonly),"onlycod"in t&&n(9,O=t.onlycod),"stringa"in t&&n(10,A=t.stringa),"oriz"in t&&n(11,F=t.oriz),"tooltip"in t&&n(12,R=t.tooltip),"pages"in t&&n(1,L=t.pages),"max"in t&&n(32,B=t.max),"$$scope"in t&&n(43,c=t.$$scope)},t.$$.update=()=>{2048&t.$$.dirty[0]&&n(20,l=F&&parseInt(F)>10?parseInt(F):40)},e=o(e),[M,L,D,S,z,E,C,T,N,O,A,F,R,m,g,b,x,v,y,$,l,r,d,f,h,H,P,V,Y,e,_,j,B,s,t=>{n(19,$=A?t.cod:t),n(0,M=A?t.cod:t),m.focus(),P($),h("input",$),h("click",$),t?.des&&h("des",t.des),H()},async()=>{n(17,v--,v),await V(),n(16,x=b.length-1)},()=>{n(17,v++,v),V()},function(t){p[t?"unshift":"push"](()=>{m=t,n(13,m)})},t=>{Y(t)},async()=>{b.length?await H():(n(0,M=A?"":{}),n(17,v=0),await V(),m.focus())},function(t){p[t?"unshift":"push"](()=>{g=t,n(14,g)})},async()=>{h("input",$),P($),h("click",$),await H()},()=>h("edit"),c]}class aa extends t{constructor(t){super(),e(this,t,ca,sa,n,{label:2,cat:30,extracols:3,placeholder:4,value:0,service:31,edit:5,edittooltip:6,sm:7,readonly:8,onlycod:9,stringa:10,oriz:11,tooltip:12,pages:1,max:32},null,[-1,-1])}}function ua(t){let e,n,i,o;const l=[fa,da],s=[];function c(t,e){return t[2]?0:1}return e=c(t),n=s[e]=l[e](t),{c(){n.c(),i=S()},m(t,n){s[e].m(t,n),u(t,i,n),o=!0},p(t,o){let r=e;e=c(t),e===r?s[e].p(t,o):(z(),m(s[r],1,1,()=>{s[r]=null}),M(),n=s[e],n?n.p(t,o):(n=s[e]=l[e](t),n.c()),g(n,1),n.m(i.parentNode,i))},i(t){o||(g(n),o=!0)},o(t){m(n),o=!1},d(t){t&&r(i),s[e].d(t)}}}function da(t){let e,n,i;const o=t[10].default,l=h(o,t,t[9],null);return{c(){e=f("div"),l&&l.c(),c(e,"class",n=(t[4].class||"")+" h-reset w-full"),c(e,"aria-label",t[1])},m(t,n){u(t,e,n),l&&l.m(e,null),i=!0},p(t,r){l&&l.p&&(!i||512&r)&&b(l,o,t,t[9],i?v(o,t[9],r,null):x(t[9]),null),(!i||16&r&&n!==(n=(t[4].class||"")+" h-reset w-full"))&&c(e,"class",n),(!i||2&r)&&c(e,"aria-label",t[1])},i(t){i||(g(l,t),i=!0)},o(t){m(l,t),i=!1},d(t){t&&r(e),l&&l.d(t)}}}function fa(t){let e;const n=t[10].default,i=h(n,t,t[9],null);return{c(){i&&i.c()},m(t,n){i&&i.m(t,n),e=!0},p(t,o){i&&i.p&&(!e||512&o)&&b(i,n,t,t[9],e?v(n,t[9],o,null):x(t[9]),null)},i(t){e||(g(i,t),e=!0)},o(t){m(i,t),e=!1},d(t){i&&i.d(t)}}}function pa(t){let e,n,i=t[3]&&t[0]&&ua(t);return{c(){i&&i.c(),e=S()},m(t,o){i&&i.m(t,o),u(t,e,o),n=!0},p(t,[n]){t[3]&&t[0]?i?(i.p(t,n),1&n&&g(i,1)):(i=ua(t),i.c(),g(i,1),i.m(e.parentNode,e)):i&&(z(),m(i,1,1,()=>{i=null}),M())},i(t){n||(g(i),n=!0)},o(t){m(i),n=!1},d(t){t&&r(e),i&&i.d(t)}}}function ha(t,e,n){let{$$slots:l={},$$scope:r}=e;const{myuuid:s}=on();let c,{title:a="tab",auth:u,icon:d,active:f,noauto:p=!1,valid:h,tooltip:m}=e,{getdata:g,setdata:w}=J("TABS")||{};function b(t){n(0,f=t)}return Z(()=>{if(g){var{tabs:t,curtab:e}=g();t=t.filter(t=>t.id!==c),e===c&&(e=t.length?t[0].id:void 0),w(t,e)}}),t.$$set=t=>{n(4,e=i(i({},e),o(t))),"title"in t&&n(1,a=t.title),"auth"in t&&n(5,u=t.auth),"icon"in t&&n(6,d=t.icon),"active"in t&&n(0,f=t.active),"noauto"in t&&n(2,p=t.noauto),"valid"in t&&n(7,h=t.valid),"tooltip"in t&&n(8,m=t.tooltip),"$$scope"in t&&n(9,r=t.$$scope)},t.$$.update=()=>{483&t.$$.dirty&&function(){if(g){var{tabs:t,curtab:e}=g();if(c){var n=t.find(t=>t.id===c);n&&(n.title=a,n.auth=u,n.icon=d,n.valid=h,n.tooltip=m)}else c=s(),t=[...t,{id:c,title:a,auth:u,icon:d,valid:h,tooltip:m,setactive:b}],e=f?c:e||c;w(t,e)}}()},e=o(e),[f,a,p,g,e,u,d,h,m,r,l]}class ma extends t{constructor(t){super(),e(this,t,ha,pa,n,{title:1,auth:5,icon:6,active:0,noauto:2,valid:7,tooltip:8})}}const ga=t=>({}),wa=t=>({});function ba(t,e,n){const i=t.slice();return i[17]=e[n],i[19]=n,i}function xa(t){let e,n;return e=new pn({props:{tooltip:t[17].tooltip,bottom:!0,$$slots:{default:[ya]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(t,i){O(e,t,i),n=!0},p(t,n){const i={};4&n&&(i.tooltip=t[17].tooltip),4110&n&&(i.$$scope={dirty:n,ctx:t}),e.$set(i)},i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){N(e,t)}}}function va(t){let e,n;return e=new en({props:{gray:t[3]!=t[17].id,alt:t[3]==t[17].id,size:6,img:t[17].icon}}),{c(){F(e.$$.fragment)},m(t,i){O(e,t,i),n=!0},p(t,n){const i={};12&n&&(i.gray=t[3]!=t[17].id),12&n&&(i.alt=t[3]==t[17].id),4&n&&(i.img=t[17].icon),e.$set(i)},i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){N(e,t)}}}function ya(t){let e,n,i,o,l,s,a,p,h,w=t[17].icon&&va(t);function b(){return t[11](t[17],t[19])}return o=new Dn({props:{id:t[17].title}}),{c(){e=f("button"),w&&w.c(),n=D(),i=f("div"),F(o.$$.fragment),c(e,"aria-label",l=`tab_${t[17].title}/${t[17].auth}`),c(e,"class",s="text-sm "+(t[1]?"":"h-8")+" cursor-pointer z-10 flexrow items-center space-x-1 text-black mr-2 px-3 "+(t[1]?"text-xs py-0":"px-2")+" border rounded "+(t[3]==t[17].id?"bg-white border-c-base font-bold text-c-base hover:border-black":"bg-c-50 text-c-500 border-c-150 hover:border-c-200"))},m(t,l){u(t,e,l),w&&w.m(e,null),$(e,n),$(e,i),O(o,i,null),a=!0,p||(h=d(e,"click",b),p=!0)},p(i,r){(t=i)[17].icon?w?(w.p(t,r),4&r&&g(w,1)):(w=va(t),w.c(),g(w,1),w.m(e,n)):w&&(z(),m(w,1,1,()=>{w=null}),M());const u={};4&r&&(u.id=t[17].title),o.$set(u),(!a||4&r&&l!==(l=`tab_${t[17].title}/${t[17].auth}`))&&c(e,"aria-label",l),(!a||14&r&&s!==(s="text-sm "+(t[1]?"":"h-8")+" cursor-pointer z-10 flexrow items-center space-x-1 text-black mr-2 px-3 "+(t[1]?"text-xs py-0":"px-2")+" border rounded "+(t[3]==t[17].id?"bg-white border-c-base font-bold text-c-base hover:border-black":"bg-c-50 text-c-500 border-c-150 hover:border-c-200")))&&c(e,"class",s)},i(t){a||(g(w),g(o.$$.fragment,t),a=!0)},o(t){m(w),m(o.$$.fragment,t),a=!1},d(t){t&&r(e),w&&w.d(),N(o),p=!1,h()}}}function $a(t){let e,n,i=t[8](t[17]),o=i&&xa(t);return{c(){o&&o.c(),e=S()},m(t,i){o&&o.m(t,i),u(t,e,i),n=!0},p(t,n){4&n&&(i=t[8](t[17])),i?o?(o.p(t,n),4&n&&g(o,1)):(o=xa(t),o.c(),g(o,1),o.m(e.parentNode,e)):o&&(z(),m(o,1,1,()=>{o=null}),M())},i(t){n||(g(o),n=!0)},o(t){m(o),n=!1},d(t){t&&r(e),o&&o.d(t)}}}function ka(t){let e,n,i,o,l,s,a,d,p,w,y=B(t[2]),k=[];for(let e=0;e<y.length;e+=1)k[e]=$a(ba(t,y,e));const _=t=>m(k[t],1,1,()=>{k[t]=null}),S=t[10].head,j=h(S,t,t[12],wa),E=t[10].default,C=h(E,t,t[12],null);return{c(){e=f("div"),n=f("div"),i=f("div");for(let t=0;t<k.length;t+=1)k[t].c();o=D(),l=f("div"),s=D(),j&&j.c(),a=D(),d=f("div"),C&&C.c(),c(l,"class","flex-1"),c(i,"class","flexrow w-full items-end pb-0.5 border-b"),c(d,"class","h-full overflow-y-auto"),c(n,"id",t[0]),c(n,"class",p=(t[9].class||"")+" w-full h-full grid grid-rows-[auto_1fr]"),c(e,"class","h-reset")},m(t,r){u(t,e,r),$(e,n),$(n,i);for(let t=0;t<k.length;t+=1)k[t]&&k[t].m(i,null);$(i,o),$(i,l),$(i,s),j&&j.m(i,null),$(n,a),$(n,d),C&&C.m(d,null),w=!0},p(t,[e]){if(510&e){let n;for(y=B(t[2]),n=0;n<y.length;n+=1){const l=ba(t,y,n);k[n]?(k[n].p(l,e),g(k[n],1)):(k[n]=$a(l),k[n].c(),g(k[n],1),k[n].m(i,o))}for(z(),n=y.length;n<k.length;n+=1)_(n);M()}j&&j.p&&(!w||4096&e)&&b(j,S,t,t[12],w?v(S,t[12],e,ga):x(t[12]),wa),C&&C.p&&(!w||4096&e)&&b(C,E,t,t[12],w?v(E,t[12],e,null):x(t[12]),null),(!w||1&e)&&c(n,"id",t[0]),(!w||512&e&&p!==(p=(t[9].class||"")+" w-full h-full grid grid-rows-[auto_1fr]"))&&c(n,"class",p)},i(t){if(!w){for(let t=0;t<y.length;t+=1)g(k[t]);g(j,t),g(C,t),w=!0}},o(t){k=k.filter(Boolean);for(let t=0;t<k.length;t+=1)m(k[t]);m(j,t),m(C,t),w=!1},d(t){t&&r(e),H(k,t),j&&j.d(t),C&&C.d(t)}}}function Da(t,e,n){let{$$slots:l={},$$scope:r}=e;const{autofocus:s,post:c}=on();let{name:a,xs:u=!1}=e;const d=K();let f,p=[],h=null;function m(t){for(var e of(n(3,h=t),p))e.setactive(e.id===t);n(2,p=[...p])}Q("TABS",{getdata:function(){return{tabs:p,curtab:h}},setdata:function(t,e){n(2,p=t),m(e)},updatecurrent:m});return t.$$set=t=>{n(9,e=i(i({},e),o(t))),"name"in t&&n(0,a=t.name),"xs"in t&&n(1,u=t.xs),"$$scope"in t&&n(12,r=t.$$scope)},e=o(e),[a,u,p,h,s,d,f,m,function(t){var e=!0;return!(t.valid&&!(e=t.valid()))&&(t.auth&&(e=c.isauth(t.auth)),e)},e,l,async(t,e)=>{m(t.id),s(!0,f),d("click",{id:e,v:t})},r]}class _a extends t{constructor(t){super(),e(this,t,Da,ka,n,{name:0,xs:1})}}function Sa(t,e,n){const i=t.slice();return i[11]=e[n],i[12]=e,i[13]=n,i}const za=t=>({v:1&t}),Ma=t=>({v:t[11],i:t[13]});function ja(t){let e,n,i=B(t[0]),o=[];for(let e=0;e<i.length;e+=1)o[e]=Na(Sa(t,i,e));const l=t=>m(o[t],1,1,()=>{o[t]=null});return{c(){for(let t=0;t<o.length;t+=1)o[t].c();e=S()},m(t,i){for(let e=0;e<o.length;e+=1)o[e]&&o[e].m(t,i);u(t,e,i),n=!0},p(t,n){if(31&n){let r;for(i=B(t[0]),r=0;r<i.length;r+=1){const l=Sa(t,i,r);o[r]?(o[r].p(l,n),g(o[r],1)):(o[r]=Na(l),o[r].c(),g(o[r],1),o[r].m(e.parentNode,e))}for(z(),r=i.length;r<o.length;r+=1)l(r);M()}},i(t){if(!n){for(let t=0;t<i.length;t+=1)g(o[t]);n=!0}},o(t){o=o.filter(Boolean);for(let t=0;t<o.length;t+=1)m(o[t]);n=!1},d(t){t&&r(e),H(o,t)}}}function Ea(t){let e,n,i,o,l;function s(){return t[6](t[11],t[12],t[13])}return n=new en({props:{img:t[11].open?"expand_more":"chevron_right",size:t[2]?4:6,readonly:Fa(t[11])}}),{c(){e=f("button"),F(n.$$.fragment),c(e,"name","expand"),c(e,"class","cursor-pointer")},m(t,r){u(t,e,r),O(n,e,null),i=!0,o||(l=d(e,"click",s),o=!0)},p(e,i){t=e;const o={};1&i&&(o.img=t[11].open?"expand_more":"chevron_right"),4&i&&(o.size=t[2]?4:6),1&i&&(o.readonly=Fa(t[11])),n.$set(o)},i(t){i||(g(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&r(e),N(n),o=!1,l()}}}function Ca(t){let e,n,i,o,l,s;return n=new qn({props:{link:!0,sm:!0,value:"clear"}}),n.$on("click",function(){return t[7](t[11],t[12],t[13])}),l=new qn({props:{link:!0,sm:!0,value:"all"}}),l.$on("click",function(){return t[8](t[11],t[12],t[13])}),{c(){e=f("div"),F(n.$$.fragment),i=D(),o=f("div"),F(l.$$.fragment),c(e,"class","w-auto"),c(o,"class","w-auto")},m(t,r){u(t,e,r),O(n,e,null),u(t,i,r),u(t,o,r),O(l,o,null),s=!0},p(e,n){t=e},i(t){s||(g(n.$$.fragment,t),g(l.$$.fragment,t),s=!0)},o(t){m(n.$$.fragment,t),m(l.$$.fragment,t),s=!1},d(t){t&&(r(e),r(i),r(o)),N(n),N(l)}}}function Ta(t){let e,n,i;return n=new La({props:{readonly:t[1],value:t[11].data,xs:t[2],level:t[3]+1}}),n.$on("change",t[10]),{c(){e=f("div"),F(n.$$.fragment),c(e,"class","pl-4")},m(t,o){u(t,e,o),O(n,e,null),i=!0},p(t,e){const i={};2&e&&(i.readonly=t[1]),1&e&&(i.value=t[11].data),4&e&&(i.xs=t[2]),8&e&&(i.level=t[3]+1),n.$set(i)},i(t){i||(g(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&r(e),N(n)}}}function Na(t){let e,n,i,o,l,s,a,d,y,_,S,j,E,C,T,A=!Fa(t[11]),I=A&&Ea(t);const R=t[5].default,L=h(R,t,t[4],Ma),B=L||function(t){let e,n,i,o,l,s=t[11].cod+"",a=t[11].des+"";return{c(){e=f("div"),n=k(s),i=D(),o=f("div"),l=k(a),c(e,"class","font-bold"),c(o,"class","flex-1")},m(t,r){u(t,e,r),$(e,n),u(t,i,r),u(t,o,r),$(o,l)},p(t,e){1&e&&s!==(s=t[11].cod+"")&&w(n,s),1&e&&a!==(a=t[11].des+"")&&w(l,a)},d(t){t&&(r(e),r(i),r(o))}}}(t);let H=t[11].data&&!t[1]&&Ca(t);function P(e){t[9](e,t[11])}let V={checkbox:t[2],xs:t[2],readonly:t[1],truevalue:1,falsevalue:0};void 0!==t[11].value&&(V.value=t[11].value),y=new si({props:V}),p.push(()=>U(y,"value",P));let Y=t[11].open&&t[11].data&&Ta(t);return{c(){e=f("div"),n=f("div"),i=f("div"),I&&I.c(),l=D(),B&&B.c(),s=D(),H&&H.c(),a=D(),d=f("div"),F(y.$$.fragment),j=D(),Y&&Y.c(),E=D(),c(i,"class",o=t[2]?"w-4 h-4":"w-6 h-6"),c(d,"class","w-auto"),c(n,"class",S="flex flex-wrap space-x-2 items-center "+(t[2]?"":"py-0.5")),c(e,"class",C="w-full "+(t[2]?"text-xs":""))},m(t,o){u(t,e,o),$(e,n),$(n,i),I&&I.m(i,null),$(n,l),B&&B.m(n,null),$(n,s),H&&H.m(n,null),$(n,a),$(n,d),O(y,d,null),$(e,j),Y&&Y.m(e,null),$(e,E),T=!0},p(l,r){t=l,1&r&&(A=!Fa(t[11])),A?I?(I.p(t,r),1&r&&g(I,1)):(I=Ea(t),I.c(),g(I,1),I.m(i,null)):I&&(z(),m(I,1,1,()=>{I=null}),M()),(!T||4&r&&o!==(o=t[2]?"w-4 h-4":"w-6 h-6"))&&c(i,"class",o),L?L.p&&(!T||17&r)&&b(L,R,t,t[4],T?v(R,t[4],r,za):x(t[4]),Ma):B&&B.p&&(!T||1&r)&&B.p(t,T?r:-1),t[11].data&&!t[1]?H?(H.p(t,r),3&r&&g(H,1)):(H=Ca(t),H.c(),g(H,1),H.m(n,a)):H&&(z(),m(H,1,1,()=>{H=null}),M());const s={};4&r&&(s.checkbox=t[2]),4&r&&(s.xs=t[2]),2&r&&(s.readonly=t[1]),!_&&1&r&&(_=!0,s.value=t[11].value,q(()=>_=!1)),y.$set(s),(!T||4&r&&S!==(S="flex flex-wrap space-x-2 items-center "+(t[2]?"":"py-0.5")))&&c(n,"class",S),t[11].open&&t[11].data?Y?(Y.p(t,r),1&r&&g(Y,1)):(Y=Ta(t),Y.c(),g(Y,1),Y.m(e,E)):Y&&(z(),m(Y,1,1,()=>{Y=null}),M()),(!T||4&r&&C!==(C="w-full "+(t[2]?"text-xs":"")))&&c(e,"class",C)},i(t){T||(g(I),g(B,t),g(H),g(y.$$.fragment,t),g(Y),T=!0)},o(t){m(I),m(B,t),m(H),m(y.$$.fragment,t),m(Y),T=!1},d(t){t&&r(e),I&&I.d(),B&&B.d(t),H&&H.d(),N(y),Y&&Y.d()}}}function Oa(t){let e,n,i=t[0]&&ja(t);return{c(){i&&i.c(),e=S()},m(t,o){i&&i.m(t,o),u(t,e,o),n=!0},p(t,[n]){t[0]?i?(i.p(t,n),1&n&&g(i,1)):(i=ja(t),i.c(),g(i,1),i.m(e.parentNode,e)):i&&(z(),m(i,1,1,()=>{i=null}),M())},i(t){n||(g(i),n=!0)},o(t){m(i),n=!1},d(t){t&&r(e),i&&i.d(t)}}}function Aa(t,e){if(t)for(let n of t)e&&e(n),n.data&&Aa(n.data,e)}function Fa(t){return!t.data||0==t.data.length}function Ia(t,e){Aa(t.data,t=>t.value=e)}function Ra(t,e,n){let{$$slots:i={},$$scope:o}=e,{value:l,readonly:r=!1,xs:s=!1}=e,{level:c=0}=e;return t.$$set=t=>{"value"in t&&n(0,l=t.value),"readonly"in t&&n(1,r=t.readonly),"xs"in t&&n(2,s=t.xs),"level"in t&&n(3,c=t.level),"$$scope"in t&&n(4,o=t.$$scope)},[l,r,s,c,o,i,(t,e,i)=>n(0,e[i].open=!t.open,l),(t,e,i)=>{n(0,e[i].value=0,l),Ia(t,0)},(t,e,i)=>{n(0,e[i].value=1,l),Ia(t,1)},function(e,i){t.$$.not_equal(i.value,e)&&(i.value=e,n(0,l))},function(e){Y.call(this,t,e)}]}class La extends t{constructor(t){super(),e(this,t,Ra,Oa,n,{value:0,readonly:1,xs:2,level:3})}}function Ba(t){let e,n,i,o,s=(t[0]?.name||"").slice(0,1)+"";return{c(){e=f("div"),n=f("div"),i=k(s),c(e,"class","w-full h-full rounded-full overflow-hidden text-white flex flex-col items-center justify-center uppercase select-none"),c(e,"style",o=`background-color: ${t[9]}; font-size: ${t[1]<20?3.5*t[1]:t[1]}px;`)},m(t,o){u(t,e,o),$(e,n),$(n,i)},p(t,n){1&n&&s!==(s=(t[0]?.name||"").slice(0,1)+"")&&w(i,s),514&n&&o!==(o=`background-color: ${t[9]}; font-size: ${t[1]<20?3.5*t[1]:t[1]}px;`)&&c(e,"style",o)},i:l,o:l,d(t){t&&r(e)}}}function Ha(t){let e,n;return e=new en({props:{img:"person",size:t[1],pixel:t[2],color:t[4]?"text-c-800":"text-c-150"}}),{c(){F(e.$$.fragment)},m(t,i){O(e,t,i),n=!0},p(t,n){const i={};2&n&&(i.size=t[1]),4&n&&(i.pixel=t[2]),16&n&&(i.color=t[4]?"text-c-800":"text-c-150"),e.$set(i)},i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){N(e,t)}}}function Pa(t){let e,n,i,o;return{c(){e=f("div"),n=f("img"),P(n.src,i=t[0]?.img)||c(n,"src",i),c(n,"alt",o="avatar_"+t[0]?.name),c(n,"class","w-full h-full object-contain object-center"),c(e,"class","overflow-hidden border border-c-border rounded-full"),c(e,"style",t[7])},m(t,i){u(t,e,i),$(e,n)},p(t,l){1&l&&!P(n.src,i=t[0]?.img)&&c(n,"src",i),1&l&&o!==(o="avatar_"+t[0]?.name)&&c(n,"alt",o),128&l&&c(e,"style",t[7])},i:l,o:l,d(t){t&&r(e)}}}function Va(t){let e,n;return{c(){e=f("div"),c(e,"class","absolute bottom-0 right-0 rounded-full"),c(e,"style",n=t[2]?`width: ${t[1]/5}px; height: ${t[1]/5}px ; background-color: ${t[8]}`:`width: ${(t[1]||12)/16}rem; height: ${(t[1]||12)/16}rem ; background-color: ${t[8]}`)},m(t,n){u(t,e,n)},p(t,i){262&i&&n!==(n=t[2]?`width: ${t[1]/5}px; height: ${t[1]/5}px ; background-color: ${t[8]}`:`width: ${(t[1]||12)/16}rem; height: ${(t[1]||12)/16}rem ; background-color: ${t[8]}`)&&c(e,"style",n)},d(t){t&&r(e)}}}function Ya(t){let e,n,i,o,l;function s(t,e){return 1&e&&(n=null),null==n&&(n=!!(t[0]?.name||"").startsWith("@")),n?qa:Ua}let a=s(t,-1),d=a(t),p=(t[0]?.nome||t[0]?.cognome)&&Ga(t);const w=t[13].default,y=h(w,t,t[12],null);return{c(){e=f("div"),d.c(),i=D(),p&&p.c(),o=D(),y&&y.c(),c(e,"class","flex flex-col text-left space-y-0.5")},m(t,n){u(t,e,n),d.m(e,null),$(e,i),p&&p.m(e,null),$(e,o),y&&y.m(e,null),l=!0},p(t,n){a===(a=s(t,n))&&d?d.p(t,n):(d.d(1),d=a(t),d&&(d.c(),d.m(e,i))),t[0]?.nome||t[0]?.cognome?p?p.p(t,n):(p=Ga(t),p.c(),p.m(e,o)):p&&(p.d(1),p=null),y&&y.p&&(!l||4096&n)&&b(y,w,t,t[12],l?v(w,t[12],n,null):x(t[12]),null)},i(t){l||(g(y,t),l=!0)},o(t){m(y,t),l=!1},d(t){t&&r(e),d.d(),p&&p.d(),y&&y.d(t)}}}function Ua(t){let e,n,i,o=t[0]?.name+"";return{c(){e=f("div"),n=k("@"),i=k(o),c(e,"class","text-xs font-bold")},m(t,o){u(t,e,o),$(e,n),$(e,i)},p(t,e){1&e&&o!==(o=t[0]?.name+"")&&w(i,o)},d(t){t&&r(e)}}}function qa(t){let e,n,i=t[0]?.name+"";return{c(){e=f("div"),n=k(i),c(e,"class","text-xs font-bold uppercase text-c-danger")},m(t,i){u(t,e,i),$(e,n)},p(t,e){1&e&&i!==(i=t[0]?.name+"")&&w(n,i)},d(t){t&&r(e)}}}function Ga(t){let e,n,i,o,l=(t[0]?.nome||"")+"",s=(t[0]?.cognome||"")+"";return{c(){e=f("div"),n=k(l),i=D(),o=k(s),c(e,"class","text-xxs")},m(t,l){u(t,e,l),$(e,n),$(e,i),$(e,o)},p(t,e){1&e&&l!==(l=(t[0]?.nome||"")+"")&&w(n,l),1&e&&s!==(s=(t[0]?.cognome||"")+"")&&w(o,s)},d(t){t&&r(e)}}}function Wa(t){let e,n,i,o,l,s,a,p,h,w;const b=[Pa,Ha,Ba],x=[];function v(t,e){return t[0]?.img?0:t[0]?.id?2:1}i=v(t),o=x[i]=b[i](t);let y=t[3]&&Va(t),k=t[5]&&t[0]?.name&&Ya(t);return{c(){e=f("button"),n=f("div"),o.c(),l=D(),y&&y.c(),s=D(),k&&k.c(),c(n,"class","relative"),c(n,"style",t[7]),c(e,"class",a=`flex ${t[6]?"flex-row space-x-2 items-center":"flex-col space-y-1.5 items-start"} ${t[11].class||""}`)},m(o,r){u(o,e,r),$(e,n),x[i].m(n,null),$(n,l),y&&y.m(n,null),$(e,s),k&&k.m(e,null),p=!0,h||(w=d(e,"click",t[10]),h=!0)},p(t,[r]){let s=i;i=v(t),i===s?x[i].p(t,r):(z(),m(x[s],1,1,()=>{x[s]=null}),M(),o=x[i],o?o.p(t,r):(o=x[i]=b[i](t),o.c()),g(o,1),o.m(n,l)),t[3]?y?y.p(t,r):(y=Va(t),y.c(),y.m(n,null)):y&&(y.d(1),y=null),(!p||128&r)&&c(n,"style",t[7]),t[5]&&t[0]?.name?k?(k.p(t,r),33&r&&g(k,1)):(k=Ya(t),k.c(),g(k,1),k.m(e,null)):k&&(z(),m(k,1,1,()=>{k=null}),M()),(!p||2112&r&&a!==(a=`flex ${t[6]?"flex-row space-x-2 items-center":"flex-col space-y-1.5 items-start"} ${t[11].class||""}`))&&c(e,"class",a)},i(t){p||(g(o),g(k),p=!0)},o(t){m(o),m(k),p=!1},d(t){t&&r(e),x[i].d(),y&&y.d(),k&&k.d(),h=!1,w()}}}function Xa(t,e,n){let l,r,s,{$$slots:c={},$$scope:a}=e,{value:u={}}=e,{size:d=10}=e,{pixel:f=!1}=e,{level:p=!1}=e,{selected:h=!1}=e,{extended:m=!1}=e,{row:g=!1}=e;const w=K();return t.$$set=t=>{n(11,e=i(i({},e),o(t))),"value"in t&&n(0,u=t.value),"size"in t&&n(1,d=t.size),"pixel"in t&&n(2,f=t.pixel),"level"in t&&n(3,p=t.level),"selected"in t&&n(4,h=t.selected),"extended"in t&&n(5,m=t.extended),"row"in t&&n(6,g=t.row),"$$scope"in t&&n(12,a=t.$$scope)},t.$$.update=()=>{1&t.$$.dirty&&n(9,l=["#f5bfd2","#a1cdce","#e5db9c","#beb4c5","#e6a57e","#218b82","#eb96aa","#2cced2","#4382bb","#9c9359","#8c7386","#40393e","#000"][(u?.id||0)%13]),1&t.$$.dirty&&n(8,r=function(t){if(t){if(9==t.level)return t.name.startsWith("@")?"red":"blue";if(3==t.level)return"green";if(2==t.level)return"yellow";if(1==t.level)return"orange"}return"whitesmoke"}(u)),6&t.$$.dirty&&n(7,s=f?`width: ${d}px; height: ${d}px;`:`width: ${(d||12)/4}rem; height: ${(d||12)/4}rem;`)},e=o(e),[u,d,f,p,h,m,g,s,r,l,function(){w("click")},e,a,c]}class Ka extends t{constructor(t){super(),e(this,t,Xa,Wa,n,{value:0,size:1,pixel:2,level:3,selected:4,extended:5,row:6})}}function Za(t){let e;return{c(){e=f("div"),e.innerHTML='<div class="ader"></div>',_(e,"z-index","20000"),c(e,"class","fixed cursor-wait top-[50%] left-[50%] -translate-x-[50%] -translate-y-[50%]")},m(t,n){u(t,e,n)},d(t){t&&r(e)}}}function Ja(t){let e,n=t[0]&&Za();return{c(){n&&n.c(),e=S()},m(t,i){n&&n.m(t,i),u(t,e,i)},p(t,[i]){t[0]?n||(n=Za(),n.c(),n.m(e.parentNode,e)):n&&(n.d(1),n=null)},i:l,o:l,d(t){t&&r(e),n&&n.d(t)}}}function Qa(t,e,n){const{bus:i}=on();let o,l=!1,r=0;const s=t=>{t?(r||(clearTimeout(o),o=setTimeout(async()=>{n(0,l=!0),await X()},200)),r++):(r--,r<=0&&(r=0,clearTimeout(o),n(0,l=!1)))};return W(()=>{i.on("wait",s)}),Z(()=>{i.off("wait",s)}),[l]}class tu extends t{constructor(t){super(),e(this,t,Qa,Ja,n,{})}}function eu(t,e){return t.replace(e?/&/g:/&(?!#?\w+;)/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function nu(t,e){return t=t.source,e=e||"",function n(i,o){return i?(o=(o=o.source||o).replace(/(^|[^[])\^/g,"$1"),t=t.replace(i,o),n):new RegExp(t,e)}}function iu(){}function ou(t){let e,n,i=1;for(;i<arguments.length;i++)for(n in e=arguments[i],e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}iu.exec=iu;const lu={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:iu,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:iu,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:iu,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/,bullet:/(?:[*+-])/,item:/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/};lu.item=nu(lu.item,"gm")(/bull/g,lu.bullet)(),lu.list=nu(lu.list)(/bull/g,lu.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+lu.def.source+")")(),lu.blockquote=nu(lu.blockquote)("def",lu.def)(),lu._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b",lu.html=nu(lu.html)("comment",/<!--[\s\S]*?-->/)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)(/tag/g,lu._tag)(),lu.paragraph=nu(lu.paragraph)("hr",lu.hr)("heading",lu.heading)("lheading",lu.lheading)("blockquote",lu.blockquote)("tag","<"+lu._tag)("def",lu.def)(),lu.normal=ou({},lu),lu.gfm=ou({},lu.normal,{fences:/^ *(`{3,}|~{3,})[ .]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/,formula:/^ *(\${2,})([\s\S]*?)\s*\1 *(?:\n+|$)/}),lu.gfm.paragraph=nu(lu.paragraph)("(?!","(?!"+lu.gfm.fences.source.replace("\\1","\\2")+"|"+lu.list.source.replace("\\1","\\3")+"|")(),lu.tables=ou({},lu.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :0123456789]*)\n((?: *\|.*(?:\n|$))*)\n*/});const ru={escape:/^\\([\\`*{}[\]()#+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:iu,tag:/^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,ico:/^::([\s\S]+?)::/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:iu,colorbase:iu,coloralt:iu,text:/^[\s\S]+?(?=[\\<![_*:`]| {2,}\n|$)/,_inside:/(?:\[[^\]]*\]|[^[\]]|\](?=[^[]*\]))*/,_href:/\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/};ru.link=nu(ru.link)("inside",ru._inside)("href",ru._href)(),ru.reflink=nu(ru.reflink)("inside",ru._inside)(),ru.normal=ou({},ru),ru.pedantic=ou({},ru.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),ru.gfm=ou({},ru.normal,{escape:nu(ru.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~~(?=\S)([\s\S]*?\S)~~~/,colorbase:/^~(?=\S)([\s\S]*?\S)~/,coloralt:/^~~(?=\S)([\s\S]*?\S)~~/,formula:/^\$(?=\S)([\s\S]*?\S)\$/,text:nu(ru.text)("]|","~$]|")("|","|https?://|")()}),ru.breaks=ou({},ru.gfm,{br:nu(ru.br)("{2,}","*")(),text:nu(ru.gfm.text)("{2,}","*")()});const su={s:"subtitle",k:"keywords",g:"gruppo",e:"editore",y:"datapub",d:"datapub",p:"priority",a:"autore",u:"base",t:"title",l:"link",i:"img","#":"title"},cu=new class{constructor(){this.alias=JSON.parse(JSON.stringify(su)),this.check()}check(){let t=new Set,e=e=>{e&&e.length>2&&!t.has(e)&&t.add(e)};for(let t in this.alias)this.alias[t]?(e(t),e(this.alias[t])):delete this.alias[t];this.retoalias=function(t){let e={};for(let n in t)t[n]&&(e[t[n]]=n);return e}(this.alias),t=[...t],t=`^\\s*\\:(${t.join("|")}|\\w{1,2})\\:(.*)$`,this.regex=t}add(t,e){return t&&(this.alias[t]=e,this.check()),this}removeAll(){return this.alias={},this.check(),this}setmappa(t){this.alias={};for(let e in t)this.alias[e]=t[e];this.alias["#"]||(this.alias["#"]="title"),this.check()}parse(t,e,n){n&&this.setmappa();let i=t,o={};e&&(o=Object.assign(o,e),o.info=!0);let l=/^\s*#\s+(.*?)\s*$/im.exec(i);l&&(o[this.alias["#"]]=l[1].toLowerCase());for(let t=0;t<20;t++){let e=/:::(.*)([^]+?):::/im.exec(i);if(!e)break;{let n=e[1];n||(n=t+""),o.comments||(o.comments=[]),o.comments.push({k:n,v:e[2]}),i=i.substr(e.index+e[0].length)}}i=t;let r=new RegExp(this.regex,"im");for(let t=0;t<50;t++){let t=r.exec(i);if(!(t&&t.length>=2))break;{i=i.substr(t.index+t[0].length),o.info=!0;let e=(t[2]||"").trim(),n=this.alias[t[1].toLowerCase()];n||(n=t[1].toLowerCase()),"l"==n||"link"==n?(o[n]||(o[n]=[]),o[n].push(e)):o[n]=e}}return o}};var au=(t,e,n=!1)=>{function i(t,e){let n,i={type:"table",headers:[],align:[],cells:[],cols:0},o=e.split("\n"),l=!1;function s(t){if(i.cols<t){for(let e=i.cols;e<t;e++){i.align[e]="left",i.headers[e]=[];for(let t of i.cells)t[e]=[]}i.cols=t}}for(let t of o)if(t=t.trim(),t.length)if(t.length>2&&t.startsWith("|")&&t.endsWith("|")&&(t=t.slice(1,-1)),n=t.split("|"),s(n.length),0==l&&/^[- :]+\|[- :|]*$/im.test(t)){for(let t=0;t<n.length;t++){let e=n[t],o=e.slice(0,1),l=e.slice(-1);i.align[t]=":"==o&&":"==l?"center":":"==l?"right":"left"}l=!0}else{let t=[];for(let e=0;e<n.length;e++){let o=n[e];if(l){let e=[];r(e,o,!1),t.push(e)}else r(i.headers[e],o,!1)}l&&i.cells.push(t)}t.push(i)}function o(t,e){let n=/^([\d.]+)\s*/.exec(e),i="",o="";n&&(i=n[1],e=e.substring(n.index+n[0].length)),n=/^([\w\s]*?):.*$/gim.exec(e),n&&(o=n[1],e=e.substring(n.index+n[1].length)),t.push({type:"list_item_start",num:i}),o&&(t.push({type:"list_title_start"}),r(t,o,!1),t.push({type:"list_title_end"})),e=e.replace(/\n +/gim,"<br>"),r(t,e,!1),t.push({type:"list_item_end"})}function l(t,e,n,i){let l=[n];for(t.push({type:"list_start",ordered:e});;){let n=/^( *)([*\-+])[\s$]/im.exec(i);if(!n){o(t,i);break}{n.index&&o(t,i.substring(0,n.index));let r=n[1].length;if(r>l[l.length-1])t.push({type:"list_start",ordered:e}),l.push(r);else for(;;){let e=l[l.length-1];if(1==l.length||e<=r)break;t.push({type:"list_end"}),l.pop()}i=i.substring(n.index+n[0].length)}}for(let e of l)t.push({type:"list_end"})}const r=(t,e,n,o)=>{let c;for(e=e.replace(/^ +$/gm,"");e;)if((c=s.newline.exec(e))&&(e=e.substring(c[0].length),c[0].length>1&&t.push({type:"space"})),c=s.formula.exec(e))e=e.substring(c[0].length),t.push({type:"code",lang:"math",text:c[2]||""});else if(c=/^(\s*`{3})(.*)([^]+?)(`{3})/gim.exec(e)){c.index>0&&r(t,e.substring(0,c.index),n);let i=(c[3]||"").replace(/^\n/,"").replace(/\n+$/,"");t.push({type:"code",lang:c[2],text:i}),e=e.substring(c.index+c[0].length)}else if(c=s.heading.exec(e))e=e.substring(c[0].length),t.push({type:"heading",depth:c[1].length,text:c[2]});else if(n&&(c=/^(.*?\|.*\n[-: ]+\|[-| :]*\n.*?\|[^]*?)\n\n/gim.exec(e)))c.index>0&&r(t,e.substring(0,c.index),n),i(t,c[1]),e=e.substring(c.index+c[0].length);else if(n&&(c=/^\|.*\|\s*(?:\n\|.*\|)+/gim.exec(e)))c.index>0&&r(t,e.substring(0,c.index),n),i(t,c[0]),e=e.substring(c.index+c[0].length);else if(c=s.lheading.exec(e))e=e.substring(c[0].length),t.push({type:"heading",depth:"="===c[2]?1:2,text:c[1]});else if(c=s.hr.exec(e))e=e.substring(c[0].length),t.push({type:"hr"});else if(c=s.blockquote.exec(e))e=e.substring(c[0].length),t.push({type:"blockquote_start"}),r(t,c[0].replace(/^ *> ?/gm,""),n,!0),t.push({type:"blockquote_end"});else if(c=/^[\s-:]*?\|[\s-:|]*/im.exec(e),c||!(c=/^( *)([*\-+])[\s$]/im.exec(e))){if(c=s.html.exec(e))e=e.substring(c[0].length),t.push({type:"html",pre:"pre"===c[1]||"script"===c[1]||"style"===c[1],text:c[0]});else if(!o&&n&&(c=s.def.exec(e)))e=e.substring(c[0].length),t.push({type:"code",text:`??${c[0]}??${s.def}??`});else if(n&&(c=s.paragraph.exec(e)))e=e.substring(c[0].length),t.push({type:"paragraph",text:"\n"===c[1].charAt(c[1].length-1)?c[1].slice(0,-1):c[1]});else if(c=s.text.exec(e))e=e.substring(c[0].length),t.push({type:"text",text:c[0]});else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else{c.index>0&&r(t,e.substring(0,c.index)),e=e.substring(c.index+c[0].length);let n=/([^]*?)(\n\n|\n\s*[#>])/im.exec(e+"\n\n");n?(l(t,"*"==c[2],c[1].length,n[1]),e=e.substring(n[1].length)):t.push({type:"text??",text:c[0]})}return t};let s=lu.tables;return t=function(t,e=!1){let n=t.replace(/:::([^]+?):::/gim,"").replace(new RegExp(cu.regex,"gim"),"").replace(/^\s*#\s+/im,"# ").replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n");if(e){const t=/(^\s*#\s+(.*)?\s*)$/im;let e=t.exec(n);e&&0==e.index&&(n=n.replace(t,""))}return n}(t,n),r([],t,!0)};const uu={string:/(".*?[^\\]"|'.*?[^\\]'|`[^]*?[^\\]`|""|''|``)/m,puntuaction:/(-[-=]?|,|;|\+[+=]?|!=?=?|<<?=?|>>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3})/g,parentesis:/(\(|\)|\[|\]|\{|\})/g,ingraffe:/([^$])(\{)(.*?)(\})/g,regex:/\/.*?[^\\]\/[gimu]*/m,numbers:/\b((?:(?:0[xX][\dA-Fa-f]+|0[bB][01]+|0[oO][0-7]+)n?|\d+n|NaN|Infinity)\b|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee][+-]?\d+)?)/gi,js:{comments:/(?:(?:^|[^\\:])(\/\/.*)|(?:^|[^\\])(\/\*[\s\S]*?(?:\*\/)))/m,keyword:/(\b)(import|require|endif|include|define|float|int|real|char|bool|as|true|false|async|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)(\b)/g,keyword2:/(\.\w+|\w+:)/g},json:{string:/(".*?[^\\]")/m,string1:/(".*?[^\\]"\s*:)/m},html:{script:/(<script[\s\S]*?>)([^]*?)(<\/script>)/im,tag:/<(!DOCTYPE|\/?\w+)([^]*?)(\/?>)/im,intag:/(\b)([\w-]+)(=)/g,comments:/<!--[^]*?-->/im},bash:{comments:/# .*/,keyword1:/(^ *|; *)(\w+)(\b)/g,keyword:/(\b)(sudo *[\w-]+)(\b)/g},mu:{comments:/(?:(?:^|[^\\:])(\/\/.*)|(?:^|[^\\])(\/\*[\s\S]*?(?:\*\/)))/m,keyword1:/(#)(\w+)(\b)/g,keyword2:/(\$\(?(\w+|\.|:|\)))/g},sql:{keyword:".",keyword2:/(\b)(FROM|USING|FTS5|NVARCHAR|INTEGER|REAL|BLOB|DELETE|UPDATE|BEGIN|END|ADD|CREATE|CONSTRAINT|ALTER|COLUMN|TABLE|ALL|ASC|BETWEEN|CASE|CHECK|COLUMN|INDEX|VIEW|PROCEDURE|DESC|DISTINTC|DROP|OUTER|INNER|LEFT|JOIN|INSERT|INTO|[NOT ]*NULL|LIMIT|SELECT|ORDER BY|UNION|WHERE)(\b)/gi,keyword1:/(\b)(COLLATE|NOCASE|DEFAULT|IF [NOT ]*EXISTS|PRIMARY KEY|VALUES|AS)(\b)/gi,comments:/(?:(?:^|[^\\:])(\/\/.*)|(?:^|[^\\])(\/\*[\s\S]*?(?:\*\/))|(--\s.*))/m}};const du=t=>t.replace(/[<>]/g,t=>({"<":"<",">":">"}[t]));function fu(t,e,n){let i=(t,e)=>(e&&(e=e.replace(/(\b)(\w+)(\b)/g,"$1_$2$3")),`ββ${e||""}ββ${(t=du(t))||""}ββ`),o=t=>{if(uu[e]){let n=uu[e][t];if("."==n)return;if(n)return n}let n=uu[t];return"."==n?void 0:n},l=[],r=0,s=[];if(e){uu[e]||(e="js");let r=o("script");if(r){let n=[];for(;;){let i=r.exec(t);if(!i)break;i.index>0&&n.push(t.substr(0,i.index)),n.push(`β
β
K${s.length}β
β
`),s.push(fu(i[1],e)+fu(i[2],"js")+fu(i[3],e)),t=t.substr(i.index+i[0].length)}t.length&&n.push(t),t=n.join("")}for(let n of[{r:"comments",s:"C"}]){let i=o(n.r);if(i){let o=[];for(;;){let l=i.exec(t);if(!l)break;if(l.index>0&&o.push(t.substr(0,l.index)),o.push(`β
β
${n.s}${s.length}β
β
`),"html"==e){let t=l[0].replace(/</g,"<").replace(/>/g,">");s.push(t)}else s.push(l[0]);t=t.substr(l.index+l[0].length)}t.length&&o.push(t),t=o.join("")}}for(let e of[{r:"string2",s:"A"},{r:"string1",s:"B"},{r:"string",s:"S"},{r:"tag",s:"T"},{r:"regex",s:"R"}]){let n=o(e.r);if(n){let l=[];for(;;){let r=n.exec(t);if(!r)break;if(r.index>0&&l.push(t.substr(0,r.index)),l.push(`β
β
${e.s}${s.length}β
β
`),"T"==e.s){let t=r[2].replace(o("intag"),(t,e,n,o)=>e+i(n,"intag")+i(o,"punc"));s.push(i("<","punc")+r[1]+t+i(r[3],"punc"))}else if("`"==r[0][0]){let t=r[0].replace(/(\${)(.*?)(})/gm,(t,e,n,o)=>i(e,"punc")+i(n,"word")+i(o,"punc"));s.push(t)}else s.push(r[0]);t=t.substr(r.index+r[0].length)}t.length&&l.push(t),t=l.join("")}}let c=t.split("\n"),a=0;for(let t of c)a++,t=t.replace(o("keyword"),(t,e,n,o)=>i(e,"tag")+i(n,"keys")+o).replace(o("keyword1"),(t,e,n,o)=>e+i(n,"keys1 keys")+o).replace(o("keyword2"),t=>i(t,"keys2 keys")).replace(o("numbers"),t=>i(t,"number")).replace(o("ingraffe"),(t,e,n,o,l)=>e+i(n,"punc")+i(o,"word")+i(l,"punc")).replace(o("puntuaction"),t=>i(t,"punc")).replace(/β
β
T(\d+)β
β
/gu,(t,e)=>i(s[Number(e)],"tag")).replace(/β
β
S(\d+)β
β
/gu,(t,e)=>i(s[Number(e)],"string")).replace(/β
β
B(\d+)β
β
/gu,(t,e)=>i(s[Number(e)],"string string1")).replace(/β
β
A(\d+)β
β
/gu,(t,e)=>i(s[Number(e)],"string string2")).replace(/β
β
R(\d+)β
β
/gu,(t,e)=>i(s[Number(e)],"regex")).replace(/β
β
C(\d+)β
β
/gu,(t,e)=>i(s[Number(e)],"comment")).replace(/β
β
K(\d+)β
β
/gu,(t,e)=>s[Number(e)]),n?l.push(i((" "+a).substr(-4),"rowid")+i(t)):l.push(i(t))}else{let e=t.split("\n");for(let t of e)r++,n?l.push(`${i((" "+r).substr(-4),"rowid")}${i(t)}`):l.push(i(t))}let c=l.join("\n");return c=c.replace(/ββ/gmu,"</span>").replace(/ββ([^]*?)ββ/gmu,(t,n)=>{if(n){let t=n.split(" "),i=[];for(let n of t)i.push(`elang_${e}${n}`),i.push(`elang${n}`);return`<span class="${i.join(" ")}">`}return"<span>"}),c}class pu{constructor(t,e,n){this.baseurl=t,this.easy=e,this.callback=n}code(t,e,n){if(this.easy)return"";e||(e="js");let i=e==e.toUpperCase();return function(t,e,n,i){let o;return i&&(o=i.length,i.push(t)),`<pre class="elang relative">${fu(t,e,n)}<div class="absolute top-1 right-1"><button class="mu-internal-copy" data-copy="${o}">π</button></div></pre>`}(t,e=e.toLowerCase(),i,n)}blockquote(t){return this.easy?t:`<blockquote>\n${t}</blockquote>\n`}html(t){return t}heading(t,e,n){return"."==t||"*"==t?"":this.easy?`${t} `:`<h${e}>${t}</h${e}>`}hr(){return this.easy?"":'<div class="my-4"><hr/></div>'}list(t,e){let n=e?"ol":"ul";return`<${n}>\n${t}</${n}>\n`}listtitle(t){return`<span class="listtitle">${t}</span>`}listitem(t,e){return e?`<li attr-num="${e||""}">${t}</li>\n`:`<li>${t}</li>\n`}paragraph(t){return this.easy?t:`<p>${t}</p>\n`}table(t,e){return this.easy?"":`<table>\n<thead>\n${t}\n</thead>\n<tbody>\n${e}\n</tbody>\n</table>\n\n`}tablerow(t){return`<tr>\n${t}</tr>\n`}tablecell(t,e,n){return e?`<th style="text-align:center;">${t}</th>\n`:`<td style="${n?"text-align:"+n+";":""}">${t}</td>`}colorbase(t){return`<span class='tilde'>${t}</span>`}formula(t,e=!1){if(this.easy)return"";let n=`<img class='inline px-2' src='https://math.croswil.com/f?${t=t.replace(/<\/?em>/g," ").replace(/\r/g,"").replace("/\n/g"," ")}' alt='${t}'/>`;return e?`<div class='flex justify-center'><div>${n}</div></div>`:n}coloralt(t){return`<span class='tilde2'>${t}</span>`}strong(t){return"<strong>"+t+"</strong>"}ico(t){return`<span class="font-ico">${t}</span>`}em(t){return"<em>"+t+"</em>"}codespan(t){return"<code>"+t+"</code>"}br(){return"<br>"}del(t){return`<del>${t}</del>`}link(t,e,n){if(this.easy)return"("+n+")";let i;if("/"==t.substr(0,1)&&this.baseurl&&(t=this.baseurl+t.substr(1)),t.startsWith("!"))i=`<button class="mu-internal-link" data-href="${t=t.slice(1)}">${n}</button>`;else{let o="";t.startsWith(".")?t=t.slice(1):o='target="_blank"',i=`<a ${o} href='${t}' title='${e||""}'>${n}</a>`}return i}image(t,e,n){if(this.easy)return"";let i=n.split("|"),o="",l=!1,r=!1,s=!1;if((t=(t=t.replace("https://www.youtube.com/watch?v=","https://youtu.be/")).replace("https://youtu.be","https://www.youtube.com/embed")).endsWith(".mp3")?(t=t.slice(0,-4),s=!0):t.endsWith(".mp4")?(t=t.slice(0,-4),r=!0):t.endsWith(".webm")?(t=t.slice(0,-5),l=!0):t.endsWith(".video")&&(t=t.slice(0,-6),l=!0,r=!0),s)o=`\n <audio controls ${i.length>=1?' width="'+i[1]+'"':""}\n class="mx-auto my-2 ${i.length>=2?i[2]:""}" \n >\n <source src="${t}.mp3" type="audio/mpeg">\n Il tuo browser non supporta l'elemento audio.\n </audio>\n `;else if(r||l)o=`\n<video ${i.length>=1?' width="'+i[1]+'"':""}\nclass="border rounded-lg shadow-xl ${i.length>=2?i[2]:""}" \ncontrols controlsList="nodownload" >\n ${l?'<source src="'+t+'.webm" type="video/webm" >':""}\n ${r?'<source src="'+t+'.mp4" type="video/mp4" >':""}\n \n Your browser does not support the video tag.\n</video>`;else{if(t.indexOf("https://www.youtu")>=0){let n=t.split("/embed/")[1]?.split("?")[0];return o=`\n\n<div style="width: 94%; box-shadow: 6px 6px 10px hsl(206.5, 0%, 75%); margin: 3%;">\n <div style="position: relative; padding-bottom: 56.15%; height: 0; overflow: hidden;">\n <iframe \n style="position: absolute; top: 0; left:0; width: 100%; height: 100%; border: 0;"\n loading="lazy";\n srcdoc="<style>\n * {\n padding: 0;\n margin: 0;\n overflow: hidden;\n }\n \n body, html {\n height: 100%;\n }\n \n img, svg {\n position: absolute;\n width: 100%;\n top: 0;\n bottom: 0;\n margin: auto;\n }\n \n svg {\n filter: drop-shadow(1px 1px 10px hsl(206.5, 70.7%, 8%));\n transition: all 250ms ease-in-out;\n }\n \n body:hover svg {\n filter: drop-shadow(1px 1px 10px hsl(206.5, 0%, 10%));\n transform: scale(2);\n }\n </style>\n <a href='https://www.youtube.com/embed/${n}?autoplay=1'>\n <img src='https://img.youtube.com/vi/${n}/hqdefault.jpg' alt='${e||"video"}'>\n <svg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 24 24' fill='none' stroke='#ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-play-circle'><circle cx='12' cy='12' r='10'></circle><polygon points='10 8 16 12 10 16 10 8'></polygon></svg>\n </a>\n "\n src="https://www.youtube.com/embed/${n}" \n title="${e||"video"}"\n frameborder="0"\n allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" \n allowfullscreen>\n </iframe>\n </div>\n </div> \n \n`,o}this.callback&&"function"==typeof this.callback&&(t=this.callback({type:"img",href:t})),"/"==t.substr(0,1)&&this.baseurl&&(t=this.baseurl+t.substr(1)),o='<img src="'+t+'" alt="'+i[0]+'"',i.length>1&&(i[1].length&&(o+=' width="'+i[1]+'"'),i.length>2&&(o+=' class="'+i[2]+'"')),i[0]&&(o+=' title="'+i[0]+'"'),o+="/>"}return o}text(t){return t}}const hu=ru.gfm;let mu=(t,e,n=0)=>{let i=0,o=t=>{if(n>0&&t.length>n-i){let e=(t=t.substring(0,n-i)).lastIndexOf(" ");e>0&&(t=t.substring(0,e))}return t},l=()=>a=d.pop(),r=()=>{let t=a.text;for(;"text"===(d[d.length-1]||0).type;)t+="\n"+l().text;return c(o(t))},s=(t,n)=>{let i=eu(n.href),o=n.title?eu(n.title):null;return"!"!==t[0].charAt(0)?e.link(i,o,c(t[1])):e.image(i,o,eu(t[1]))};const c=t=>{let n,i,o,l,r="";for(;t;)if(l=hu.escape.exec(t))t=t.substring(l[0].length),r+=l[1];else if(l=hu.autolink.exec(t))t=t.substring(l[0].length),"@"===l[2]?(i=":"===l[1].charAt(6)?l[1].substring(7):l[1],o=`mailto:${i}`):(i=eu(l[1]),o=i),r+=e.link(o,null,i);else if(f||!(l=hu.url.exec(t))){if(l=hu.tag.exec(t))!f&&/^<a /i.test(l[0])?f=!0:f&&/^<\/a>/i.test(l[0])&&(f=!1),t=t.substring(l[0].length),r+=l[0];else if(l=hu.link.exec(t))t=t.substring(l[0].length),f=!0,r+=s(l,{href:l[2],title:l[3]}),f=!1;else if((l=hu.reflink.exec(t))||(l=hu.nolink.exec(t))){if(t=t.substring(l[0].length),n=(l[2]||l[1]).replace(/\s+/g," "),n=p[n.toLowerCase()],!n||!n.href){r+=l[0].charAt(0),t=l[0].substring(1)+t;continue}f=!0,r+=s(l,n),f=!1}else if(l=hu.formula.exec(t))t=t.substring(l[0].length),r+=e.formula(c(l[1]));else if(l=hu.ico.exec(t))t=t.substring(l[0].length),r+=e.ico(c(l[2]||l[1]));else if(l=hu.strong.exec(t))t=t.substring(l[0].length),r+=e.strong(c(l[2]||l[1]));else if(l=hu.em.exec(t))t=t.substring(l[0].length),r+=e.em(c(l[2]||l[1]));else if(l=hu.code.exec(t))t=t.substring(l[0].length),r+=e.codespan(eu(l[2],!0));else if(l=hu.br.exec(t))t=t.substring(l[0].length),r+=e.br();else if(l=hu.del.exec(t))t=t.substring(l[0].length),r+=e.del(c(l[1]));else if(l=hu.coloralt.exec(t))t=t.substring(l[0].length),r+=e.coloralt(c(l[1]));else if(l=hu.colorbase.exec(t))t=t.substring(l[0].length),r+=e.colorbase(c(l[1]));else if(l=hu.text.exec(t))t=t.substring(l[0].length),r+=e.text(l[0]);else if(t)throw new Error("Infinite loop on byte: "+t.charCodeAt(0))}else t=t.substring(l[0].length),i=eu(l[1]),o=i,r+=e.link(o,null,i);return r};let a,u=()=>{switch(a.type){case"space":return"";case"hr":return e.hr();case"heading":return e.heading(c(o(a.text)),a.depth,a.text);case"code":return"math"==a.lang?e.formula(a.text,!0):e.code(a.text,a.lang,h);case"table":{let t,n,i,o="",l=[];n=[];for(let t=0;t<a.headers.length;t++)n.push(e.tablecell(mu(a.headers[t],e,0).out,!0,a.align[t]));o=e.tablerow(n.join(""));for(let o=0;o<a.cells.length;o++){for(t=a.cells[o],n=[],i=0;i<t.length;i++)n.push(e.tablecell(mu(t[i],e,0).out,!1,a.align[i]));l.push(e.tablerow(n.join("")))}return e.table(o,l.join(""))}case"blockquote_start":{let t="";for(;"blockquote_end"!==l().type;)t+=u();return e.blockquote(t)}case"list_start":{let t="",n=a.ordered;for(;"list_end"!==l().type;)t+=u();return e.list(t,n)}case"list_title_start":{let t="";for(;"list_title_end"!==l().type;)t+=u();return e.listtitle(t)}case"list_item_start":{let t="",n=a.num;for(;"list_item_end"!==l().type;)t+="text"===a.type?r():u();return e.listitem(t,n)}case"html":return e.html(a.text);case"paragraph":return e.paragraph(c(o(a.text)));case"text":return e.paragraph(r())}},d=t.reverse(),f=!1,p={},h=[],m=[];for(;l();){let t=u();if(i+=t.length,t&&m.push(t),n>0&&i>n)break}return{out:m.join(""),codes:h}};function gu(t,e){let n;function i(i,o,l){if(n=i.exec(t),n){gu(t.slice(0,n.index),e);let i=n[1];return i.startsWith("\n")&&(e.push({class:"",text:"\n"}),i=i.slice(1)),e.push({class:o,text:l?l(i):i}),gu(t.slice(n.index+n[1].length),e),!0}return!1}t&&"string"==typeof t&&(i(/^(:{3}\s*$[^]+?:{3}\s*$)/gim,"comment")||i(/^(\s*`{3}[^]+?`{3}\s*$)/gim,"code")||i(/^(\s*:\w+:.*)$/gim,"comment")||(t=t.replace(/ {2,}\n/gim," "),i(/^(\s*#{1,6}\s+.*)/gim,"title")||i(/(\n\s*\n)/gim,"break")||i(/^(\s*>\s+[^]*?\n\n)/gim,"cite")||i(/^(\s*>\s+.*)/gim,"cite")||i(/^(.*?\|[^]*?\n\n)/gim,"table")||i(/^( *\*| *-|-{1,8})[ $]/gim,"list")||i(/^( ([\d]+[.]*)+)[ $]/gim,"list",t=>{let e=t.split(".");e.shift();let n=[];for(let t of e)t.length&&n.push(" ");return n.push("-"),n.join("")})||e.push({class:"",text:t})))}function wu(t,e=""){let n=[];gu(t,n);let i=[],o=0;for(let t=0;t<n.length;t++){let l=n[t];if("list"==l.class){let r=l.text.replace("\n","").length;if(r>o)i.push({space:r,id:1}),o=r;else for(;;){let t=i[i.length-1];if(1==i.length||t.space<=r){o=t.space,t.id++;break}i.pop()}let s=[],c=[];for(let t of i)c.push(" "),s.push(t.id);c.pop(),l.old=l.text,l.text.indexOf("-")>=0?l.text=c.join("")+"- "+s.join(".")+".":l.text=c.join("")+"* ",s=[];for(let e=t+1;e<n.length&&""==n[e].class;e++)s.push(n[e].text);l.title=e,l.data=l.text+s.join("")}else""!=l.class&&("title"==l.class&&(e=l.text),i=[],o=0)}let l=[],r=[];for(let t of n)"list"==t.class&&r.push({title:t.title,lev:t.text,data:t.data}),l.push(t.text);return{txt:l.join(""),cards:r,tm:n}}function bu(t,e,n=""){let i;function o(o,l){return i=o.exec(t),!!i&&(bu(t.slice(0,i.index),e,n),e.push({class:`${n} ${l}`,text:i[1]}),bu(i[2],e,`${n} ${l}`),e.push({class:`${n} ${l}`,text:i[3]}),bu(t.slice(i.index+i[1].length+i[2].length+i[3].length),e,n),!0)}(function(o,l){return i=o.exec(t),!!i&&(bu(t.slice(0,i.index),e,n),e.push({class:`${n} ${l}`,text:i[1]}),bu(t.slice(i.index+i[1].length),e,n),!0)})(/(`.*?`)/gim,"code2")||o(/(\*{3})([^]+?)(\*{3})/gim,"grassetto italico")||o(/(\*{2})([^]+?)(\*{2})/gim,"grassetto")||o(/(\*{1})([^]+?)(\*{1})/gim,"italico")||o(/(_{3})([^]+?)(_{3})/gim,"grassetto italico")||o(/(_{2})([^]+?)(_{2})/gim,"grassetto")||o(/(_{1})([^]+?)(_{1})/gim,"italico")||o(/(~{3})([^]+?)(~{3})/gim,"barrato")||o(/(~{2})([^]+?)(~{2})/gim,"tilde2")||o(/(~{1})([^]+?)(~{1})/gim,"tilde")||e.push({class:n,text:t})}function xu(t,e){let n;function i(i,o,l=!1){return n=i.exec(t),!!n&&(xu(t.slice(0,n.index),e),l?bu(n[1],e,o):e.push({class:o,text:n[1]}),xu(t.slice(n.index+n[1].length),e),!0)}if(!(i(/^(:{3}[^]+?:{3})/gim,"comment")||i(/^(\s*`{3}[^]+?`{3})/gim,"code")||i(/^(\s*:\w+:.*)$/gim,"comment")||i(/^(\s*#{1,6} +.*)$/gim,"title",!0)||i(/^(\s*>\s+[^]*?\n\n)/gim,"cite",!0)||i(/^(\s*>\s+.*)/gim,"cite",!0)||i(/^(.*?\|.*\n[-: ]+\|[-| :]*\n.*?\|[^]*?\n\n)/gim,"tabella",!0)||i(/^(\n{2,})/gim,"break",!0)||i(/^( *\*| *-|-{1,8})[ $]/gim,"list",!0)||i(/(^\s*[\d.]+)[\s$]/gim,"list",!0))){if(n=/(!*\[)(.*?)(\]\s*\()(.*?)(\))/.exec(t),n)return bu(t.slice(0,n.index),e,""),e.push({class:"grassetto",text:n[1]}),e.push({class:"linkdes",text:n[2]}),e.push({class:"grassetto",text:n[3]}),e.push({class:"linkval",text:n[4]}),e.push({class:"grassetto",text:n[5]}),void bu(t.slice(n.index+n[1].length+n[2].length+n[3].length+n[4].length+n[5].length),e,"");bu(t,e,"")}}function vu(t){"number"==typeof t&&(t=String(t)),t&&"string"==typeof t||(t=" "),t.endsWith("\n")&&(t+=" ");let e=[];return xu(t,e),e}function yu(t,e,n=""){let i;function o(o,l){return i=o.exec(t),!!i&&(yu(t.slice(0,i.index),e,n),e.push({class:`${n} ${l}`,text:i[1]}),yu(t.slice(i.index+i[1].length),e,n),!0)}o(/(\/\/.*)$/gim,"commento2")||function(o,l){if(i=o.exec(t),i){let o=i.index+i[1].length;return yu(t.slice(0,o),e,n),e.push({class:`${n} ${l}`,text:i[2]}),yu(t.slice(o+i[2].length),e,n),!0}return!1}(/(#let.? +)([\w_.]+)/gi,"variabile")||o(/(#(select|setdef|ret|cases|endselect|ifdef|log|msg|endif|cvar|cache|look|lookb|elseifdef|variante|forvar|for|endfor|continue|break|inc|macro|default|lets|letv|lett|cat|func))/gim,"comando")||o(/(#(if\s*|elseif\s*))/gim,"comando")||o(/(#(else|let|i |m |f |j |case|def ))/gim,"comando")||o(/(\$[{(]?[\w_.]+)/gim,"variabile")||o(/({.+?\})/gim,"formula")||o(/([})(])/gim,"variabile")||o(/([\d.:,;\\,]+)/gim,"digit")||e.push({class:n,text:t})}function $u(t,e){let n;(function(i,o,l=!1){return n=i.exec(t),!!n&&($u(t.slice(0,n.index),e),l?yu(n[1],e,o):e.push({class:o,text:n[1]}),$u(t.slice(n.index+n[1].length),e),!0)})(/(\/\*[^]+?\*\/)/gim,"comment")||yu(t,e,"")}function ku(t){t||(t=" "),t.endsWith("\n")&&(t+=" ");let e=[];return $u(t,e),e}function Du(t){let e=t.split("\n"),n=[],i=0,o=0;const l=" ";for(let t=0;t<e.length;t++){let r=e[t].trim(),s=l.repeat(i>=0?i+o:o);o=0;let c="";r.split("//")[0].trim().endsWith("\\")&&(o=1),(r.startsWith("#")||r.startsWith("!"))&&(c=r.substring(1).split(" ")[0].toUpperCase(),r=r.substring(0,1)+c+r.substring(c.length+1)),"IF"==c||"IFDEF"==c||"IFNDEF"==c?r.indexOf("#",2)<0?i++:r=r.replace(/#([\w]+)/g,(t,e)=>"#"+e.toUpperCase()):["FOR","FORVAR","DO","SELECT"].includes(c)?i++:["ENDIF","LOOP","ENDFOR","ENDSELECT"].includes(c)&&(i--,s=l.repeat(i>=0?i:0)),["ELSEIF","ELSE","ELSEIFDEF","ELSEIFNDEF","CASE","CASES","DEFAULT"].includes(c)&&i>0?n.push(l.repeat(i-1)+r):n.push(s+r)}return n.join("\n")}function _u(t){return(t=t+""||"").includes('"')?t.split(/[,;](?=(?:(?:[^"]*["]){2})*[^"]*$)/).map(t=>t.trim().replace(/(^["'])|(["']$)/g,"").replace(/=\s*["']/g,"=")):t.split(/[,;]/).map(t=>t.trim())}const{window:Su}=V;function zu(t){let e,n,i,o;return{c(){e=f("div"),c(e,"class",n="markprint "+(t[1]?"text-xs":t[0]?"text-sm":"text-base")+" "+(t[6].class||""))},m(n,l){u(n,e,l),e.innerHTML=t[2],i||(o=d(Su,"click",t[5]),i=!0)},p(t,[i]){4&i&&(e.innerHTML=t[2]),67&i&&n!==(n="markprint "+(t[1]?"text-xs":t[0]?"text-sm":"text-base")+" "+(t[6].class||""))&&c(e,"class",n)},i:l,o:l,d(t){t&&r(e),i=!1,o()}}}function Mu(t,e,n){let l,r,s;const{lang:c,P:a,PP:u,post:d,bus:f,theme:p}=on();I(t,c,t=>n(14,r=t)),I(t,p,t=>n(15,s=t));let{value:h=""}=e,{file:m}=e,{notitle:g=!1}=e,{cat:w=""}=e,{info:b={}}=e,{vars:x={}}=e,{bkcall:v="mucalls/md"}=e;const y=K();let{sm:$=!1}=e,{xs:k=!1}=e;function D(t){let e=t.target.closest(".mu-internal-link");if(e){const t=e.getAttribute("data-href");y("link",t)}if(e=t.target.closest(".mu-internal-copy"),e){let t=e.parentNode.parentNode.textContent.replace("π","");navigator.clipboard.writeText(t),f.messaggio("copiato")}}function _(t){if("img"==t.type){if(w){let e=/^(\w)\s+(.*)$/.exec(t.href);e&&(e[1]=e[1].toLowerCase(),"t"!=e[1]&&(t=d.fullget("mufiles/getimage",{id:w,tipo:e[1],name:e[2]})))}return t}}function S(t){if(t){var e=function(t,e){let n=t;if(e)for(let t in e){let i=e[t]||`..${t}..`;n=n.replace(new RegExp(`\\[${t}\\]`,"gim"),i)}return n}(t,x);n(8,b=((t,e,n)=>cu.parse(t,e,n))(e));var i=((t,e,n=!1,i=!1,o)=>{let l;if(i)l=au(t,0,n);else{let{txt:e}=wu(t);l=au(e,0,n)}return mu(l,new pu(e,!1,o))})(e,a.baseurl,g,!1,_);return i.codes,i.out}return n(8,b={}),""}return W(()=>(window.addEventListener("click",D),()=>{window.removeEventListener("click",D)})),t.$$set=t=>{n(6,e=i(i({},e),o(t))),"value"in t&&n(7,h=t.value),"file"in t&&n(9,m=t.file),"notitle"in t&&n(10,g=t.notitle),"cat"in t&&n(11,w=t.cat),"info"in t&&n(8,b=t.info),"vars"in t&&n(12,x=t.vars),"bkcall"in t&&n(13,v=t.bkcall),"sm"in t&&n(0,$=t.sm),"xs"in t&&n(1,k=t.xs)},t.$$.update=()=>{32768&t.$$.dirty&&(s.includes("-dark")||s.includes("-sand")),128&t.$$.dirty&&n(2,l=S(h)),16896&t.$$.dirty&&async function(t){t&&n(7,h=await u(v,{file:t,lang:r}))}(m)},e=o(e),[$,k,l,c,p,D,e,h,b,m,g,w,x,v,r,s]}class ju extends t{constructor(t){super(),e(this,t,Mu,zu,n,{value:7,file:9,notitle:10,cat:11,info:8,vars:12,bkcall:13,sm:0,xs:1})}}function Eu(t,e,n){const i=t.slice();return i[24]=e[n],i}function Cu(t){let e,n=B(t[7]),i=[];for(let e=0;e<n.length;e+=1)i[e]=Tu(Eu(t,n,e));return{c(){for(let t=0;t<i.length;t+=1)i[t].c();e=S()},m(t,n){for(let e=0;e<i.length;e+=1)i[e]&&i[e].m(t,n);u(t,e,n)},p(t,o){if(128&o){let l;for(n=B(t[7]),l=0;l<n.length;l+=1){const r=Eu(t,n,l);i[l]?i[l].p(r,o):(i[l]=Tu(r),i[l].c(),i[l].m(e.parentNode,e))}for(;l<i.length;l+=1)i[l].d(1);i.length=n.length}},d(t){t&&r(e),H(i,t)}}}function Tu(t){let e,n,i,o=t[24].text+"";return{c(){e=f("span"),n=k(o),c(e,"class",i=t[24].class||"")},m(t,i){u(t,e,i),$(e,n)},p(t,l){128&l&&o!==(o=t[24].text+"")&&w(n,o),128&l&&i!==(i=t[24].class||"")&&c(e,"class",i)},d(t){t&&r(e)}}}function Nu(t){let e,n,i,o,l,a,p,w,y;const k=t[16].default,_=h(k,t,t[15],null);let S=!t[2]&&Cu(t);return{c(){e=f("div"),_&&_.c(),n=D(),i=f("pre"),S&&S.c(),o=D(),l=f("textarea"),c(i,"aria-hidden","true"),c(i,"class","h-fit"),c(l,"class","h-fit"),c(l,"autocomplete","off"),c(l,"autocorrect","off"),l.value=t[0],l.readOnly=t[1],c(e,"class",a="w-full relative editmd "+(t[12].class||""))},m(r,s){u(r,e,s),_&&_.m(e,null),$(e,n),$(e,i),S&&S.m(i,null),t[17](i),$(e,o),$(e,l),t[18](l),p=!0,w||(y=[d(l,"contextmenu",t[9]),d(l,"keydown",t[10]),d(l,"input",t[8]),d(l,"mousemove",t[19]),d(l,"scroll",t[11])],w=!0)},p(t,[n]){_&&_.p&&(!p||32768&n)&&b(_,k,t,t[15],p?v(k,t[15],n,null):x(t[15]),null),t[2]?S&&(S.d(1),S=null):S?S.p(t,n):(S=Cu(t),S.c(),S.m(i,null)),(!p||1&n)&&(l.value=t[0]),(!p||2&n)&&(l.readOnly=t[1]),(!p||4096&n&&a!==(a="w-full relative editmd "+(t[12].class||"")))&&c(e,"class",a)},i(t){p||(g(_,t),p=!0)},o(t){m(_,t),p=!1},d(n){n&&r(e),_&&_.d(n),S&&S.d(),t[17](null),t[18](null),w=!1,s(y)}}}function Ou(t,e,n){let l,{$$slots:r={},$$scope:s}=e;const c=K();let a,u,d,f,{value:h=""}=e,{rule:m=!1}=e,{readonly:g=!1}=e,{noformat:w=!1}=e;function b(t,e){let n=t;const i=n.selectionStart,o=n.value.substring(0,i).lastIndexOf("\n")+1;let l=n.value.indexOf("\n",i);l=-1===l?n.value.length:l;const r=n.value.substring(o,l);c("help",{row:r,key:e,p1:o,p2:l,p3:i-o,mouseX:d,mouseY:f})}return t.$$set=t=>{n(12,e=i(i({},e),o(t))),"value"in t&&n(0,h=t.value),"rule"in t&&n(13,m=t.rule),"readonly"in t&&n(1,g=t.readonly),"noformat"in t&&n(2,w=t.noformat),"$$scope"in t&&n(15,s=t.$$scope)},t.$$.update=()=>{8193&t.$$.dirty&&n(7,l=m?ku(h):vu(h))},e=o(e),[h,g,w,a,u,d,f,l,function(t){g||(n(0,h=t.target.value),c("change"))},function(t){t.preventDefault(),b(t.target,"h")},async function(t){if(!g){if(t.ctrlKey){let e,i=t.target;switch(t.key){case"s":t.preventDefault(),c("save");break;case"l":t.preventDefault(),c("reload");break;case"r":t.preventDefault(),c("run");break;case"h":case"m":t.preventDefault(),b(i,t.key);break;case"f":t.preventDefault(),e=i.selectionStart+1,n(0,h=Du(h)),i.value=h,i.selectionStart=e,i.selectionEnd=e}}if("Tab"==t.key){t.preventDefault();var e=t.target;pos=e.selectionStart+1,n(0,h=h.slice(0,e.selectionStart)+"\t"+h.slice(e.selectionEnd)),e.value=h,e.selectionStart=pos,e.selectionEnd=pos}}},function(){n(4,u.scrollTop=a.scrollTop,u),n(4,u.scrollLeft=a.scrollLeft,u)},e,m,function(t){n(0,h=a.value);var e=a.selectionStart;e<0&&(e=h.length),n(0,h=h.slice(0,e)+t+h.slice(e))},s,r,function(t){p[t?"unshift":"push"](()=>{u=t,n(4,u)})},function(t){p[t?"unshift":"push"](()=>{a=t,n(3,a)})},t=>{n(5,d=t.clientX),n(6,f=t.clientY)}]}class Au extends t{constructor(t){super(),e(this,t,Ou,Nu,n,{value:0,rule:13,readonly:1,noformat:2,inserisci:14})}get inserisci(){return this.$$.ctx[14]}}const Fu="monokai",Iu="default";async function Ru(t){function e(e){return new Promise((n,i)=>{const o=t.createElement("script");o.src=e,o.onload=n,o.onerror=i,t.head.appendChild(o)})}function n(e){return new Promise((n,i)=>{const o=t.createElement("link");o.rel="stylesheet",o.href=e,o.onload=n,o.onerror=i,t.head.appendChild(o)})}await Promise.all([e("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/codemirror.min.js"),n("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/codemirror.min.css"),n(`https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/theme/${Fu}.min.css`),n("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/addon/hint/show-hint.min.css"),n("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/addon/fold/foldgutter.min.css"),n("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/addon/lint/lint.min.css")]),await Promise.all([e("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/mode/javascript/javascript.min.js"),e("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/mode/yaml/yaml.min.js"),e("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/addon/hint/show-hint.min.js"),e("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/addon/fold/foldcode.min.js"),e("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/addon/fold/foldgutter.min.js"),e("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/addon/fold/brace-fold.min.js"),e("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/addon/fold/comment-fold.min.js"),e("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/addon/selection/selection-pointer.min.js"),e("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/addon/lint/lint.min.js"),e("https://unpkg.com/jsonlint-mod/web/jsonlint.js"),e("https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.65.5/addon/lint/json-lint.min.js"),e("https://cdnjs.cloudflare.com/ajax/libs/js-yaml/4.1.0/js-yaml.min.js"),e("https://cdnjs.cloudflare.com/ajax/libs/prettier/2.7.1/standalone.min.js"),e("https://cdnjs.cloudflare.com/ajax/libs/prettier/2.7.1/parser-babel.min.js"),e("https://cdnjs.cloudflare.com/ajax/libs/prettier/2.7.1/parser-yaml.min.js")]);const i=t.createElement("style");i.textContent="\n .cm-s-default .cm-comment {\n color: #008000 !important; /* Verde */\n font-style: italic; // opzionale */\n }\n /*\n .cm-s-default .cm-string {\n color:#560b85 ;\n }\n .cm-s-default .cm-string-2 {\n color: #470470 ;\n }\n */\n \n .cm-s-default .cm-property {\n color:#7114ab ;\n }\n \n ",t.head.appendChild(i)}function Lu(t){let e;return{c(){e=f("div"),c(e,"class","w-full h-full relative")},m(n,i){u(n,e,i),t[10](e)},p:l,i:l,o:l,d(n){n&&r(e),t[10](null)}}}function Bu(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Hu(t,e,n){let i;const{bus:o,theme:l}=on();let r,s;I(t,l,t=>n(14,i=t));let c,{value:a=""}=e,{yaml:u=!1}=e,{json:d=!1}=e,f=null,h=-1,m=[];const g=K();function w(){if(!s)return{};const t=s.getCursor(),e=s.getScrollInfo();let n=[];return s.getAllMarks().forEach(t=>{if(t.N){let e=t.find();e&&n.push(e)}}),{cursor:t,scrollInfo:e,folds:n}}function b(t){let e,n,i;Array.isArray(t)?i=t:({cursor:e,scrollInfo:n,folds:i}=t),s&&(e&&s.setCursor(e),n&&s.scrollTo(n.left,n.top),i&&i.forEach(({from:t})=>{t.line<s.lineCount()&&s.foldCode(t)}))}function x(t){const e=w(),n=t.getValue(),i=prettier.format(n,{parser:u?"yaml":"babel",plugins:prettierPlugins,printWidth:500,singleQuote:!0,semi:!0,trailingComma:"all",tabWidth:4,useTabs:!1,proseWrap:"preserve",htmlWhitespaceSensitivity:"ignore"});t.setValue(i),b(e)}async function v(){window.CodeMirror||await Ru(document);const t=window.CodeMirror;function e(t){g("run")}function o(t){let e;if(t.getSelection())e=t.getSelection();else{const n=t.findWordAt(t.getCursor());e=t.getRange(n.anchor,n.head),t.setSelection(n.anchor,n.head)}e&&function(t){if(!t)return;if(f)h=(h+1)%f.matches.length;else{f={query:new RegExp(Bu(t),"g"),matches:[]},m=[];const e=s.getValue();let n;for(;null!==(n=f.query.exec(e));)f.matches.push({from:s.posFromIndex(n.index),to:s.posFromIndex(n.index+n[0].length)});h=0}if(f.matches.length>0){const t=f.matches[h];m.push({anchor:t.from,head:t.to}),s.setSelections(m),s.scrollIntoView(t.from)}}(e)}function l(t){}function c(t){x(t),g("save")}function p(t){event?.preventDefault(),g("load")}n(8,s=t(r,{value:a,mode:u?"yaml":d?"json":"javascript",theme:i.includes("-dark")||i.includes("-sand")?Fu:Iu,lineNumbers:!0,foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter",...d||u?["CodeMirror-lint-markers"]:[]],lint:d||u,viewportMargin:1/0,foldOptions:{widget:"πΈπΈπΈ"}})),s.setOption("mode",u?"yaml":d?{name:"javascript",json:!0}:"javascript"),s.getWrapperElement().style.height="100%",s.on("change",()=>{n(2,a=s.getValue()),g("input",a)}),s.setOption("extraKeys",{"Cmd-S":c,"Ctrl-S":c,"Ctrl-F":function(t){x(t),g("formatted")},F1:l,"Cmd-H":l,"Ctrl-H":l,"Ctrl-R":e,"Cmd-R":e,"Cmd-O":p,"Ctrl-O":p,"Cmd-D":o,"Ctrl-D":o,Esc:y})}function y(){f=null,h=-1,m=[],s&&s.setSelection(s.getCursor(),s.getCursor())}function $(){if(s){const t=i.includes("-dark")?Fu:Iu;s.setOption("theme",t)}}return W(async()=>{await v(),o.on("cambiotema",$),await X(),g("init")}),Z(()=>{o.off("cambiotema",$)}),t.$$set=t=>{"value"in t&&n(2,a=t.value),"yaml"in t&&n(3,u=t.yaml),"json"in t&&n(4,d=t.json)},t.$$.update=()=>{772&t.$$.dirty&&!c&&s&&s.getValue()!==a&&(s.setValue(a),g("init"))},[r,l,a,u,d,function(){s&&!c&&(n(9,c=!0),x(s),n(9,c=!1))},w,b,s,c,function(t){p[t?"unshift":"push"](()=>{r=t,n(0,r)})}]}class Pu extends t{constructor(t){super(),e(this,t,Hu,Lu,n,{value:2,yaml:3,json:4,formatta:5,getcmfold:6,setcmfold:7})}get formatta(){return this.$$.ctx[5]}get getcmfold(){return this.$$.ctx[6]}get setcmfold(){return this.$$.ctx[7]}}function Vu(t){let e;return{c(){e=f("div"),c(e,"class","w-full h-full")},m(n,i){u(n,e,i),t[10](e)},p:l,i:l,o:l,d(n){n&&r(e),t[10](null)}}}function Yu(t,e,n){let i;const{post:o,bus:l,theme:r}=on();let s,c;I(t,r,t=>n(16,i=t));let{value:a=""}=e,{noformat:u=!1}=e,{variante:d=!1}=e,f=null,h=-1,m=[];const g=K();let w=null,b=null;const x=t=>{w=t.clientX,b=t.clientY};function v(){if(!c)return{};const t=c.getCursor(),e=c.getScrollInfo();let n=[];return c.getAllMarks().forEach(t=>{if(t.N){let e=t.find();e&&n.push(e)}}),{cursor:t,scrollInfo:e,folds:n}}function y(t){let e,n,i;Array.isArray(t)?i=t:({cursor:e,scrollInfo:n,folds:i}=t),c&&(e&&c.setCursor(e),n&&c.scrollTo(n.left,n.top),i&&i.forEach(({from:t})=>{t.line<c.lineCount()&&c.foldCode(t)}))}const $=t=>d?u?t:function(t){let e=[],n=[];for(let i of t.split("\n")){let t=_u(i);for(let e=0;e<t.length;e++){let i=t[e]||"";(i.includes(",")||i.includes(";"))&&(i=`"${i}"`,t[e]=i);let o=i.length;(!n[e]||n[e]<o)&&(n[e]=o)}e.push(_u(i))}let i=[];for(let t of e){let e=[];for(let i=0;i<n.length;i++)e[i]=(t[i]||"").padEnd(n[i]);i.push(e.join(" , "))}return i.join("\n")}(t):Du(t);function k(t){const e=v(),n=t.getValue(),i=$(n);t.setValue(i),y(e)}function D(){f=null,h=-1,m=[],c&&c.setSelection(c.getCursor(),c.getCursor())}async function _(){window.CodeMirror||await Ru(document);const t=window.CodeMirror;t.O||(t.O=!0,function(t){t.defineMode("markuno",function(){return{startState:function(){return{inComment:!1}},token:function(t,e){return e.inComment?(t.skipTo("*/")?(t.next(),t.next(),e.inComment=!1):t.skipToEnd(),"comment"):t.match(/\/\/.*/)?"comment":t.sol()&&t.match(/^\s*\.[a-zA-Z0-9_]+(?=\s|$)/)?"def":e.expectMacroArg?t.eatSpace()?null:t.match(/^[^\s#,(){}]+/)?(e.expectMacroArg=!1,"builtin"):(t.next(),e.expectMacroArg=!1,null):t.sol()&&t.match(/^\s*#([mif])\b/i)?(e.expectMacroArg=!0,"def"):t.match("/*")?(t.skipTo("*/")?(t.next(),t.next()):e.inComment=!0,"comment"):t.match(/^\s*#(select|ret|cache|cvar|lookb|look|cases|endselect|log|msg|ifdef|ifndef|elseif|elseifndef|endif|elseifdef|variante|forvar|for|endfor|continue|break|inc|macro|default|lets|lett|cat|func|push|pop|letv|let|letm|lett|else)/i)||t.match(/^\s*#(if\s*|elseif\s*|j |case|def )/i)||t.match(/#(else|let|letv|lett|letm|cvar|cache|lookb|look)/i)?"keyword":!e.inCommand&&t.match(/^\s*#[\w_.]+/i)?"string":t.match(/^\s*![\w_.]+/i)?"builtin":t.match(/[<>!=+\-*/\\%]+/)?"operator":t.match(/\$\[[\w_.]+/)||t.match(/\$\{[\w_.]+/)||t.match(/\$\([\w_.]+/)||t.match(/\$[\w_.]+/)||t.match(/[}\])]/)?"string":t.match(/\{.+?\}/)?"variable-3":t.match(/[\d.:,;\\]+/)?"number":(t.next(),null)}}})}(t),t.registerHelper("fold","markuno",function(e,n){const i=n.line,o=e.getLine(i).trim();function l(t){return t.startsWith("#")||t.startsWith("!")?t.substring(1).split(/\s+/)[0].toUpperCase():null}const r=["IF","IFDEF","IFNDEF","FOR","FORVAR","DO","SELECT"],s={IF:"ENDIF",IFDEF:"ENDIF",IFNDEF:"ENDIF",FOR:"ENDFOR",FORVAR:"ENDFOR",DO:"LOOP",SELECT:"ENDSELECT"},c=l(o);if(!c||!r.includes(c))return null;if(o.indexOf("#",2)>-1)return null;let a=0;for(let n=i+1;n<e.lineCount();n++){const u=l(e.getLine(n).trim());if(u&&r.includes(u))a++;else if(u&&u===s[c]){if(0===a)return{from:t.Pos(i,o.length),to:t.Pos(n,e.getLine(n).length)};a--}}return null}),t.registerHelper("hint","markuno",async function(e){const n=e.getCursor(),i=e.getTokenAt(n);e.getLine(n.line);const o=i.start,l=i.end,r=i.string,s=await async function(t){return[{text:"#if",displayText:"#if",help:'Condizione "if" per verificare una condizione'},{text:"#select",displayText:"#select",help:"Seleziona un caso tra diverse opzioni"},{text:"#cases",displayText:"#cases",help:"Definisce i casi per #select"},{text:"#endif",displayText:"#endif",help:"Termina una struttura condizionale"},{text:"#for",displayText:"#for",help:'Inizia un ciclo "for"'},{text:"#endfor",displayText:"#endfor",help:'Termina un ciclo "for"'},{text:"#else",displayText:"#else",help:"Blocco alternativo per #if"},{text:"#continue",displayText:"#continue",help:"Salta all'iterazione successiva di un ciclo"},{text:"#break",displayText:"#break",help:"Interrompe un ciclo"}].filter(e=>e.text.startsWith(t))}(r);return{list:s.map(t=>({text:t.text,displayText:t.text,render(e,n,i){const o=document.createElement("div");o.innerHTML=`<strong>${i.text}</strong> - <em>${t.help}</em>`,e.appendChild(o)}})),from:t.Pos(n.line,o),to:t.Pos(n.line,l)}})),document.addEventListener("mousemove",x),n(2,a=$(a)),n(9,c=window.CodeMirror(s,{value:a,mode:"markuno",theme:i.includes("-dark")||i.includes("-sand")?Fu:Iu,lineNumbers:!0,viewportMargin:1/0,lineWrapping:!1,foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],foldOptions:{widget:" β₯ πππ"}})),c.getWrapperElement().style.height="100%",c.on("paste",(t,e)=>{if(d){e.preventDefault();let n=(e.clipboardData||window.clipboardData).getData("text");n=n.replace(/\t/g,",");const i=t.getDoc(),o=i.getCursor();i.replaceRange(n,o)}});const e=e=>{e.showHint({hint:t.hint.markuno})};let o=(t,e)=>{if(!d){const n=t.getCursor(),i=t.getLine(n.line),o={line:n.line,ch:0},l=t.indexFromPos(o),r=l+i.length,s=n.ch;g("help",{row:i,key:e,p1:l,p2:r,p3:s,mouseX:w,mouseY:b})}};function l(t){g("reload")}function r(t){k(t),g("save")}function u(t){g("run")}function p(t){let e;if(t.getSelection())e=t.getSelection();else{const n=t.findWordAt(t.getCursor());e=t.getRange(n.anchor,n.head),t.setSelection(n.anchor,n.head)}e&&function(t){if(t){if(f)h=(h+1)%f.matches.length;else{f={query:new RegExp((e=t,e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),"g"),matches:[]},m=[];const n=c.getValue();let i;for(;null!==(i=f.query.exec(n));)f.matches.push({from:c.posFromIndex(i.index),to:c.posFromIndex(i.index+i[0].length)});h=0}var e;if(f.matches.length>0){const t=f.matches[h];m.push({anchor:t.from,head:t.to}),c.setSelections(m),c.scrollIntoView(t.from)}}}(e)}c.setOption("extraKeys",{"Cmd-S":r,"Ctrl-S":r,"Ctrl-F":function(t){const e=t.getCursor(),n=t.getScrollInfo();let i=[];t.getAllMarks().forEach(t=>{if(t.N){let e=t.find();e&&i.push(e)}});let o=t.getValue();o=$(o),t.setValue(o),t.setCursor(e),t.scrollTo(n.left,n.top),i.forEach(({from:e})=>{e.line<t.lineCount()&&t.foldCode(e)})},"Cmd-O":l,"Ctrl-O":l,"Cmd-D":p,"Ctrl-D":p,"Ctrl-R":u,"Cmd-R":u,"Ctrl-H":t=>o(t,"h"),"Ctrl-M":t=>o(t,"m"),"Cmd-Enter":e,"Ctrl-Enter":e,Esc:D}),c.on("change",()=>{n(2,a=c.getValue()),g("input",a)})}function S(){if(c){const t=i.includes("-dark")?Fu:Iu;c.setOption("theme",t)}}return W(async()=>{await _(),l.on("cambiotema",S),await X(),g("init")}),Z(()=>{l.off("cambiotema",S),document.removeEventListener("mousemove",x)}),t.$$set=t=>{"value"in t&&n(2,a=t.value),"noformat"in t&&n(3,u=t.noformat),"variante"in t&&n(4,d=t.variante)},t.$$.update=()=>{if(516&t.$$.dirty&&c){const t=c.getValue();a!==t&&(c.setValue(a),g("init"))}},[s,r,a,u,d,function(){c&&setTimeout(()=>c.focus(),50)},function(){c&&k(c)},v,y,c,function(t){p[t?"unshift":"push"](()=>{s=t,n(0,s)})}]}class Uu extends t{constructor(t){super(),e(this,t,Yu,Vu,n,{value:2,noformat:3,variante:4,focus:5,formatta:6,getcmfold:7,setcmfold:8})}get focus(){return this.$$.ctx[5]}get formatta(){return this.$$.ctx[6]}get getcmfold(){return this.$$.ctx[7]}get setcmfold(){return this.$$.ctx[8]}}function qu(t){let e,n,i,o,l,a,p,h,w,b,x,v,y,k,_,S,T,A=t[1]&&Gu(t),I=t[3]&&Wu(t),R=t[7]&&Ku(t),L=function(t){let e,n,i;return n=new qn({props:{class:t[0].buttonClasses+" hover:!bg-muted/20",icon:"close",variant:"ghost"}}),n.$on("click",t[10]),{c(){e=f("div"),F(n.$$.fragment),c(e,"class","h-full flex items-center")},m(t,o){u(t,e,o),O(n,e,null),i=!0},p(t,e){const i={};1&e&&(i.class=t[0].buttonClasses+" hover:!bg-muted/20"),n.$set(i)},i(t){i||(g(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&r(e),N(n)}}}(t),B=t[5]&&Ju(t);return{c(){e=f("div"),n=f("div"),i=f("div"),o=f("div"),A&&A.c(),l=D(),a=f("div"),p=D(),I&&I.c(),h=D(),w=f("div"),b=f("div"),R&&R.c(),x=D(),L&&L.c(),v=D(),B&&B.c(),c(a,"class",t[9].content.message),c(o,"class",t[9].content.textContainer),c(b,"class",t[9].content.buttonContainer),c(w,"class","flex flex-row items-center"),c(i,"class",t[9].content.row),c(n,"class",t[8]),c(e,"class",t[9].wrapper)},m(r,s){u(r,e,s),$(e,n),$(n,i),$(i,o),A&&A.m(o,null),$(o,l),$(o,a),a.innerHTML=t[2],$(o,p),I&&I.m(o,null),$(i,h),$(i,w),$(w,b),R&&R.m(b,null),$(w,x),L&&L.m(w,null),$(n,v),B&&B.m(n,null),_=!0,S||(T=[d(e,"mouseenter",t[14]),d(e,"mouseleave",t[15])],S=!0)},p(t,e){t[1]?A?(A.p(t,e),2&e&&g(A,1)):(A=Gu(t),A.c(),g(A,1),A.m(o,l)):A&&(z(),m(A,1,1,()=>{A=null}),M()),(!_||4&e)&&(a.innerHTML=t[2]),t[3]?I?(I.p(t,e),8&e&&g(I,1)):(I=Wu(t),I.c(),g(I,1),I.m(o,null)):I&&(z(),m(I,1,1,()=>{I=null}),M()),t[7]?R?(R.p(t,e),128&e&&g(R,1)):(R=Ku(t),R.c(),g(R,1),R.m(b,null)):R&&(z(),m(R,1,1,()=>{R=null}),M()),L.p(t,e),t[5]?B?B.p(t,e):(B=Ju(t),B.c(),B.m(n,null)):B&&(B.d(1),B=null),(!_||256&e)&&c(n,"class",t[8])},i(t){_||(g(A),g(I),g(R),g(L),t&&E(()=>{_&&(k&&k.end(1),y=C(e,nt,{y:50,duration:100,easing:lt}),y.start())}),_=!0)},o(t){m(A),m(I),m(R),m(L),y&&y.invalidate(),t&&(k=j(e,nt,{y:50,duration:300})),_=!1},d(t){t&&r(e),A&&A.d(),I&&I.d(),R&&R.d(),L&&L.d(),B&&B.d(),t&&k&&k.end(),S=!1,s(T)}}}function Gu(t){let e,n,i;return n=new Dn({props:{id:t[1]}}),{c(){e=f("div"),F(n.$$.fragment),c(e,"class",t[9].content.title)},m(t,o){u(t,e,o),O(n,e,null),i=!0},p(t,e){const i={};2&e&&(i.id=t[1]),n.$set(i)},i(t){i||(g(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&r(e),N(n)}}}function Wu(t){let e,n,i;return n=new qn({props:{variant:"outline",size:"xs",class:"!py-0 !px-0 !pl-0 !pr-0 !font-regular "+t[0].buttonClasses,$$slots:{default:[Xu]},$$scope:{ctx:t}}}),n.$on("click",t[13]),{c(){e=f("div"),F(n.$$.fragment),c(e,"class","flex items-center gap-0 mt-2")},m(t,o){u(t,e,o),O(n,e,null),i=!0},p(t,e){const i={};1&e&&(i.class="!py-0 !px-0 !pl-0 !pr-0 !font-regular "+t[0].buttonClasses),134217760&e&&(i.$$scope={dirty:e,ctx:t}),n.$set(i)},i(t){i||(g(n.$$.fragment,t),i=!0)},o(t){m(n.$$.fragment,t),i=!1},d(t){t&&r(e),N(n)}}}function Xu(t){let e,n=t[5]?"Nascondi dettagli":"Mostra dettagli";return{c(){e=k(n)},m(t,n){u(t,e,n)},p(t,i){32&i&&n!==(n=t[5]?"Nascondi dettagli":"Mostra dettagli")&&w(e,n)},d(t){t&&r(e)}}}function Ku(t){let e,n;return e=new qn({props:{variant:"outline",size:"sm",tooltip:"Manda una segnalazione",class:t[0].buttonClasses+" ml-1 mr-1 !text-danger-foreground hover:!bg-muted/20",$$slots:{default:[Zu]},$$scope:{ctx:t}}}),e.$on("click",t[11]),{c(){F(e.$$.fragment)},m(t,i){O(e,t,i),n=!0},p(t,n){const i={};1&n&&(i.class=t[0].buttonClasses+" ml-1 mr-1 !text-danger-foreground hover:!bg-muted/20"),134217728&n&&(i.$$scope={dirty:n,ctx:t}),e.$set(i)},i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){N(e,t)}}}function Zu(t){let e;return{c(){e=k("Segnala")},m(t,n){u(t,e,n)},d(t){t&&r(e)}}}function Ju(t){let e,n,i,o,l;return{c(){e=f("div"),n=k("Details:"),i=D(),o=f("div"),l=k(t[3]),c(e,"class",t[9].details.header),c(o,"class",t[9].details.content)},m(t,r){u(t,e,r),$(e,n),u(t,i,r),u(t,o,r),$(o,l)},p(t,e){8&e&&w(l,t[3])},d(t){t&&(r(e),r(i),r(o))}}}function Qu(t){let e,n,i=t[4]&&qu(t);return{c(){i&&i.c(),e=S()},m(t,o){i&&i.m(t,o),u(t,e,o),n=!0},p(t,[n]){t[4]?i?(i.p(t,n),16&n&&g(i,1)):(i=qu(t),i.c(),g(i,1),i.m(e.parentNode,e)):i&&(z(),m(i,1,1,()=>{i=null}),M())},i(t){n||(g(i),n=!0)},o(t){m(i),n=!1},d(t){t&&r(e),i&&i.d(t)}}}function td(t,e,n){let i,o,l;const{bus:r}=on();let s="",c="",a="",u=!1,d=0,f=!1,p=0,h=!1;const m=0,g=1,w=2,b={[m]:{icon:"check_circle",timeout:3e3,classes:"bg-success text-success-foreground",buttonClasses:"text-success-foreground font-medium border-success-foreground/50"},[g]:{icon:"warning",timeout:4e3,classes:" bg-warning text-warning-foreground",buttonClasses:"text-warning-foreground font-medium border-warning-foreground/50"},[w]:{icon:"error",timeout:null,classes:"bg-danger text-danger-foreground",buttonClasses:"!text-danger-foreground font-medium border-danger-foreground/50"}},x={wrapper:"w-full max-w-md md:min-w-[350px] fixed bottom-0 right-0 z-50 noprint p-4",container:"p-4 max-w-screen pr-2 w-full text-left rounded-md z-50 relative ",content:{row:"flex flex-row space-x-2 items-center",textContainer:"flex-1 overflow-hidden flex flex-col",title:" text-sm font-medium",message:"text-sm font-light",buttonContainer:"flex flex-col space-y-2"},details:{header:"text-xs pt-4 mb-2 w-full border-b border-border font-ligth",content:"text-muted-foreground font-mono text-xs p-2 rounded-md bg-white font-ligth"}};function v(t){k(t,m)}function y(t){k(t,g)}function $(t){k(t,w)}function k(t,e){n(4,u=!1),function(){p&&(clearTimeout(p),p=0);n(1,s=""),n(3,a=""),n(5,f=!1)}(),n(12,d=e),function(t){"string"==typeof t?n(2,c=t):t?(n(2,c=t?.value||t?.des||t?.text||t?.msg),n(1,s=t?.title||""),n(3,a=t?.extra||"")):n(2,c="undefined message")}(t),n(4,u=!0),function(){const t=i.timeout;t&&(p=setTimeout(()=>{n(4,u=!1)},t))}()}function D(){n(4,u=!1)}W(()=>{r.on("message",v),r.on("messaggio",v),r.on("warning",y),r.on("error",$)}),Z(()=>{r.off("message",v),r.off("messaggio",v),r.off("warning",y),r.off("error",$),p&&clearTimeout(p)});return t.$$.update=()=>{4096&t.$$.dirty&&n(0,i=b[d]||b[m]),1&t.$$.dirty&&n(8,o=`${i.classes} ${x.container}`),4096&t.$$.dirty&&n(7,l=d===w)},[i,s,c,a,u,f,h,l,o,x,D,function(){r.emit("showhelp",{v:!0}),D()},d,()=>n(5,f=!f),()=>n(6,h=!0),()=>n(6,h=!1)]}class ed extends t{constructor(t){super(),e(this,t,td,Qu,n,{})}}function nd(t){let e,n,i,o,s,a;return{c(){e=f("div"),n=G("svg"),i=G("rect"),o=G("rect"),s=G("rect"),c(i,"x","70.7104"),c(i,"y","141.421"),c(i,"width","100"),c(i,"height","300"),c(i,"transform","rotate(-45 70.7104 141.421)"),c(i,"fill","currentColor"),c(o,"x","141.421"),c(o,"y","353.553"),c(o,"width","100"),c(o,"height","300"),c(o,"transform","rotate(-135 141.421 353.553)"),c(o,"fill","currentColor"),c(s,"x","316.474"),c(s,"y","249.213"),c(s,"width","52.4405"),c(s,"height","50"),c(s,"transform","rotate(-45 316.474 249.213)"),c(s,"fill","currentColor"),c(n,"xmlns","http://www.w3.org/2000/svg"),c(n,"viewBox","40 40 360 360"),c(n,"width","100%"),c(n,"height","100%"),c(e,"class",a="text-foreground "+t[1].class),c(e,"style",t[0])},m(t,l){u(t,e,l),$(e,n),$(n,i),$(n,o),$(n,s)},p(t,[n]){2&n&&a!==(a="text-foreground "+t[1].class)&&c(e,"class",a),1&n&&c(e,"style",t[0])},i:l,o:l,d(t){t&&r(e)}}}function id(t,e,n){let l,{size:r=8}=e;return t.$$set=t=>{n(1,e=i(i({},e),o(t))),"size"in t&&n(2,r=t.size)},t.$$.update=()=>{4&t.$$.dirty&&n(0,l=`width: ${r/4}rem; height: ${r/4}rem;`)},e=o(e),[l,e,r]}class od extends t{constructor(t){super(),e(this,t,id,nd,n,{size:2})}}const ld=t=>({}),rd=t=>({});function sd(t,e,n){const i=t.slice();return i[100]=e[n],i}function cd(t){let e,n;return e=new bn({props:{gray:!0,img:"restore",tooltip:"Ripristina stato iniziale",size:8}}),e.$on("click",t[30]),{c(){F(e.$$.fragment)},m(t,i){O(e,t,i),n=!0},p:l,i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){N(e,t)}}}function ad(t){let e,n;return e=new bn({props:{readonly:!t[7],gray:!0,img:"delete",tooltip:"Cancella",mat:!0,size:8}}),e.$on("click",t[31]),{c(){F(e.$$.fragment)},m(t,i){O(e,t,i),n=!0},p(t,n){const i={};128&n[0]&&(i.readonly=!t[7]),e.$set(i)},i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){N(e,t)}}}function ud(t){let e,n;return e=new bn({props:{gray:!0,img:"add",tooltip:"Add New",mat:!0,size:8}}),e.$on("click",t[32]),{c(){F(e.$$.fragment)},m(t,i){O(e,t,i),n=!0},p:l,i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){N(e,t)}}}function dd(t){let e,n;return e=new qn({props:{xs:!0,full:!0,value:t[100],alt:t[100]!=t[6]}}),e.$on("click",function(){return t[35](t[100])}),{c(){F(e.$$.fragment)},m(t,i){O(e,t,i),n=!0},p(n,i){t=n;const o={};512&i[0]&&(o.value=t[100]),576&i[0]&&(o.alt=t[100]!=t[6]),e.$set(o)},i(t){n||(g(e.$$.fragment,t),n=!0)},o(t){m(e.$$.fragment,t),n=!1},d(t){N(e,t)}}}function fd(t){let e,n,i,o,l;function s(e){t[40](e)}let c={sm:!0,type:"select",options:t[14].listx,tooltip:"Dimensione Elemento X"};return void 0!==t[14].w&&(c.value=t[14].w),i=new jo({props:c}),p.push(()=>U(i,"value",s)),{c(){e=f("div"),e.textContent="Dim X",n=D(),F(i.$$.fragment)},m(t,o){u(t,e,o),u(t,n,o),O(i,t,o),l=!0},p(t,e){const n={};16384&e[0]&&(n.options=t[14].listx),!o&&16384&e[0]&&(o=!0,n.value=t[14].w,q(()=>o=!1)),i.$set(n)},i(t){l||(g(i.$$.fragment,t),l=!0)},o(t){m(i.$$.fragment,t),l=!1},d(t){t&&(r(e),r(n)),N(i,t)}}}function pd(t){let e,n,i,o,l;function s(e){t[41](e)}let c={sm:!0,type:"select",options:t[14].listy,tooltip:"Dimensione Elemento Y"};return void 0!==t[14].h&&(c.value=t[14].h),i=new jo({props:c}),p.push(()=>U(i,"value",s)),{c(){e=f("div"),e.textContent="Dim Y",n=D(),F(i.$$.fragment)},m(t,o){u(t,e,o),u(t,n,o),O(i,t,o),l=!0},p(t,e){const n={};16384&e[0]&&(n.options=t[14].listy),!o&&16384&e[0]&&(o=!0,n.value=t[14].h,q(()=>o=!1)),i.$set(n)},i(t){l||(g(i.$$.fragment,t),l=!0)},o(t){m(i.$$.fragment,t),l=!1},d(t){t&&(r(e),r(n)),N(i,t)}}}function hd(t){let e,n,i,o,l,s,a,d,h,w,b,x,v,y,k,_,S,j,E,C,T,A;function I(e){t[37](e)}let R={sm:!0,type:"number",tooltip:"Posizione X"};function L(e){t[38](e)}void 0!==t[14].x&&(R.value=t[14].x),o=new jo({props:R}),t[36](o),p.push(()=>U(o,"value",I));let B={sm:!0,type:"number",tooltip:"Posizione Y"};function H(e){t[39](e)}void 0!==t[14].y&&(B.value=t[14].y),h=new jo({props:B}),p.push(()=>U(h,"value",L));let P={sm:!0,type:"number",tooltip:"Rotazione Gradi"};void 0!==t[14].rot&&(P.value=t[14].rot),y=new jo({props:P}),p.push(()=>U(y,"value",H));let V=t[14].listx&&fd(t),Y=t[14].listy&&pd(t);return T=new qn({props:{value:"Ok",full:!0,sm:!0}}),T.$on("click",t[42]),{c(){e=f("div"),n=f("div"),n.textContent="X",i=D(),F(o.$$.fragment),s=D(),a=f("div"),a.textContent="Y",d=D(),F(h.$$.fragment),b=D(),x=f("div"),x.textContent="Angolo",v=D(),F(y.$$.fragment),_=D(),V&&V.c(),S=D(),Y&&Y.c(),j=D(),E=f("div"),C=D(),F(T.$$.fragment),c(e,"class","bg-white border rounded-sm p-2 border-c-200 w-64 shadow-lg grid grid-cols-[auto_1fr] items-center gap-1")},m(t,l){u(t,e,l),$(e,n),$(e,i),O(o,e,null),$(e,s),$(e,a),$(e,d),O(h,e,null),$(e,b),$(e,x),$(e,v),O(y,e,null),$(e,_),V&&V.m(e,null),$(e,S),Y&&Y.m(e,null),$(e,j),$(e,E),$(e,C),O(T,e,null),A=!0},p(t,n){const i={};!l&&16384&n[0]&&(l=!0,i.value=t[14].x,q(()=>l=!1)),o.$set(i);const r={};!w&&16384&n[0]&&(w=!0,r.value=t[14].y,q(()=>w=!1)),h.$set(r);const s={};!k&&16384&n[0]&&(k=!0,s.value=t[14].rot,q(()=>k=!1)),y.$set(s),t[14].listx?V?(V.p(t,n),16384&n[0]&&g(V,1)):(V=fd(t),V.c(),g(V,1),V.m(e,S)):V&&(z(),m(V,1,1,()=>{V=null}),M()),t[14].listy?Y?(Y.p(t,n),16384&n[0]&&g(Y,1)):(Y=pd(t),Y.c(),g(Y,1),Y.m(e,j)):Y&&(z(),m(Y,1,1,()=>{Y=null}),M())},i(t){A||(g(o.$$.fragment,t),g(h.$$.fragment,t),g(y.$$.fragment,t),g(V),g(Y),g(T.$$.fragment,t),A=!0)},o(t){m(o.$$.fragment,t),m(h.$$.fragment,t),m(y.$$.fragment,t),m(V),m(Y),m(T.$$.fragment,t),A=!1},d(n){n&&r(e),t[36](null),N(o),N(h),N(y),V&&V.d(),Y&&Y.d(),N(T)}}}function md(t){let e,n,i,o,l,s,a,d,y,_,S,j,E,C,T,A,I,R,L,P,V,Y,G,W,X,K=(t[7]||"")+"",Z=t[1]&&cd(t),J=t[0]&&ad(t),Q=t[2]&&ud(t);_=new bn({props:{size:8,gray:!0,tooltip:"Zoom All",img:"zoom_out_map"}}),_.$on("click",t[33]),j=new bn({props:{img:"save",tooltip:"Salva Tutto",size:8}}),j.$on("click",t[34]);let tt=B(t[9]),et=[];for(let e=0;e<tt.length;e+=1)et[e]=dd(sd(t,tt,e));const nt=t=>m(et[t],1,1,()=>{et[t]=null}),it=t[28].menu,ot=h(it,t,t[45],rd),lt=t[28].default,rt=h(lt,t,t[45],null);function st(e){t[43](e)}let ct={mouseX:t[10],mouseY:t[11],$$slots:{default:[hd]},$$scope:{ctx:t}};return void 0!==t[12]&&(ct.show=t[12]),G=new bi({props:ct}),p.push(()=>U(G,"show",st)),G.$on("close",t[44]),{c(){e=f("div"),n=f("div"),i=D(),o=f("div"),Z&&Z.c(),l=D(),J&&J.c(),s=D(),Q&&Q.c(),a=D(),d=f("div"),y=D(),F(_.$$.fragment),S=D(),F(j.$$.fragment),E=D(),C=f("div"),T=f("div"),T.textContent="Layers:",A=D();for(let t=0;t<et.length;t+=1)et[t].c();I=D(),ot&&ot.c(),R=D(),rt&&rt.c(),L=D(),P=f("div"),V=k(K),Y=D(),F(G.$$.fragment),c(n,"class","w-full h-full bg-gray-100"),c(d,"class","w-6"),c(o,"class","absolute top-1 right-1 flex flex-row space-x-1"),c(T,"class","bold mt-2"),c(C,"class","absolute top-12 right-1 flex flex-col space-y-1 max-w-24"),c(e,"class","w-full h-full relative relative"),c(P,"class","absolute bottom-1 left-[50%] translate-x-[-50%] text-c-200 text-xs")},m(r,c){u(r,e,c),$(e,n),t[29](n),$(e,i),$(e,o),Z&&Z.m(o,null),$(o,l),J&&J.m(o,null),$(o,s),Q&&Q.m(o,null),$(o,a),$(o,d),$(o,y),O(_,o,null),$(o,S),O(j,o,null),$(e,E),$(e,C),$(C,T),$(C,A);for(let t=0;t<et.length;t+=1)et[t]&&et[t].m(C,null);$(C,I),ot&&ot.m(C,null),$(e,R),rt&&rt.m(e,null),u(r,L,c),u(r,P,c),$(P,V),u(r,Y,c),O(G,r,c),X=!0},p(t,e){if(t[1]?Z?(Z.p(t,e),2&e[0]&&g(Z,1)):(Z=cd(t),Z.c(),g(Z,1),Z.m(o,l)):Z&&(z(),m(Z,1,1,()=>{Z=null}),M()),t[0]?J?(J.p(t,e),1&e[0]&&g(J,1)):(J=ad(t),J.c(),g(J,1),J.m(o,s)):J&&(z(),m(J,1,1,()=>{J=null}),M()),t[2]?Q?(Q.p(t,e),4&e[0]&&g(Q,1)):(Q=ud(t),Q.c(),g(Q,1),Q.m(o,a)):Q&&(z(),m(Q,1,1,()=>{Q=null}),M()),1704528&e[0]){let n;for(tt=B(t[9]),n=0;n<tt.length;n+=1){const i=sd(t,tt,n);et[n]?(et[n].p(i,e),g(et[n],1)):(et[n]=dd(i),et[n].c(),g(et[n],1),et[n].m(C,I))}for(z(),n=tt.length;n<et.length;n+=1)nt(n);M()}ot&&ot.p&&(!X||16384&e[1])&&b(ot,it,t,t[45],X?v(it,t[45],e,ld):x(t[45]),rd),rt&&rt.p&&(!X||16384&e[1])&&b(rt,lt,t,t[45],X?v(lt,t[45],e,null):x(t[45]),null),(!X||128&e[0])&&K!==(K=(t[7]||"")+"")&&w(V,K);const n={};1024&e[0]&&(n.mouseX=t[10]),2048&e[0]&&(n.mouseY=t[11]),28960&e[0]|16384&e[1]&&(n.$$scope={dirty:e,ctx:t}),!W&&4096&e[0]&&(W=!0,n.show=t[12],q(()=>W=!1)),G.$set(n)},i(t){if(!X){g(Z),g(J),g(Q),g(_.$$.fragment,t),g(j.$$.fragment,t);for(let t=0;t<tt.length;t+=1)g(et[t]);g(ot,t),g(rt,t),g(G.$$.fragment,t),X=!0}},o(t){m(Z),m(J),m(Q),m(_.$$.fragment,t),m(j.$$.fragment,t),et=et.filter(Boolean);for(let t=0;t<et.length;t+=1)m(et[t]);m(ot,t),m(rt,t),m(G.$$.fragment,t),X=!1},d(n){n&&(r(e),r(L),r(P),r(Y)),t[29](null),Z&&Z.d(),J&&J.d(),Q&&Q.d(),N(_),N(j),H(et,n),ot&&ot.d(n),rt&&rt.d(n),N(G,n)}}}function gd(t,e,n){let i,o,l,r,s,c,a,{$$slots:u={},$$scope:d}=e,f=new rt.Raycaster,h=new rt.Vector2;const m=K(),{addline:g,createBox:w,dopickbox:b,collegapicker:x,clearchildren:v,picker:y,pickerel:$,hitter:k,linesglobal:D,setZ:_,redrawgroup:S,faceMatE:z,getlayers:M,hitMatE:j,getfacelinegeom:E,pickerresetcolor:C,getptrif:T,getallptrif:N,drawLinerif:O,getalllinerif:A,rotatenode:F,lineMat:I,lineMatH:R,linerifMat:L,linerifMatE:B}=function(t={}){const{THREE:e,Line2:n,LineGeometry:i,LineMaterial:o}=t;let l=1,r=[];const s=new o({color:6728447,linewidth:.7,dashed:!0,dashSize:20,gapSize:20,depthTest:!1,transparent:!0,opacity:.6}),c=new o({color:16711680,linewidth:1.5,dashed:!0,dashSize:20,gapSize:20,depthTest:!1,transparent:!0,opacity:.8}),a=new o({color:6710886,linewidth:1,worldUnits:!1,transparent:!0}),u=new o({color:10066329,linewidth:.5,worldUnits:!1,transparent:!0}),d=new o({color:16711680,linewidth:2,worldUnits:!1,transparent:!0}),f=new e.MeshBasicMaterial({transparent:!0,opacity:0,depthTest:!1,depthWrite:!1}),p=new e.MeshBasicMaterial({transparent:!0,opacity:0,depthTest:!1,depthWrite:!1}),h=new o({color:2718207,linewidth:3,worldUnits:!1,transparent:!0,depthTest:!1,depthWrite:!1}),m=new e.MeshBasicMaterial({color:2718207,side:e.DoubleSide,transparent:!0,opacity:1,depthTest:!1,depthWrite:!1}),g=new e.MeshBasicMaterial({color:16711680,side:e.DoubleSide,transparent:!0,opacity:1,depthTest:!1,depthWrite:!1});function w(){for(let t in S){const e=S[t];e.name?.startsWith("pick_")&&(e.material="pick_face"===e.name?f:m)}}function b(t,n=!1){if(_.visible=!1,!t?.userData?.isBox)return void _.position.set(-1e4,-1e4,0);const{ori:i,dim:o,rot:r,listx:s,listy:c}=t.userData;_.position.set(i.x,i.y,l),_.rotation.z=e.MathUtils.degToRad(r);const a=o.x||500,u=o.y||500;if(n||_.userData.dim?.x!==o.x||_.userData.dim?.y!==o.y){const{faceGeo:t,borderGeo:e}=x(a,u);S.face.geometry.dispose(),S.border.geometry.dispose(),S.face.geometry=t,S.border.geometry=e}Array.isArray(s)&&s.length?(S.l.position.set(0,u/2,0),S.r.position.set(a,u/2,0),S.l.visible=S.r.visible=!0):S.l.visible=S.r.visible=!1,Array.isArray(c)&&c.length?(S.b.position.set(a/2,0,0),S.t.position.set(a/2,u,0),S.b.visible=S.t.visible=!0):S.b.visible=S.t.visible=!1;let d=t.userData?.pivot.x||0,f=t.userData?.pivot.y||0;S.rotline.position.set(d,f,0),S.rotcircle.position.set(d,f,0),S.rot.position.set(d-100,f-100,0),_.userData={node:t,ori:{...t.userData.ori},dim:{...t.userData.dim},listx:t.userData.listx?[...t.userData.listx]:void 0,listy:t.userData.listy?[...t.userData.listy]:void 0};for(let e in t.userData)["boxId","node","ori","dim","listx","listy"].includes(e)||(_.userData[e]=t.userData[e]);_.visible=!0}function x(t,n){const o=[0,0,0,t,0,0,t,n,0,0,n,0,0,0,0],l=new i;l.setPositions(o);const r=new e.PlaneGeometry(t,n);return r.translate(t/2,n/2,0),{borderGeo:l,faceGeo:r}}async function v(t={}){const{w:n,h:i,color:o}=t,l=new e.PlaneGeometry(n,i);l.translate(n/2,i/2,0);const r=new e.MeshBasicMaterial({color:o,side:e.DoubleSide,depthTest:!0});return new e.Mesh(l,r)}async function y(t,o,l,r,s,c,u){t.clear();let d=new e.Group;if(d.add(await v({w:l,h:r,color:s})),t.add(d),o){let t=o.toUpperCase();(c||u)&&(t=c&&u?`${t}\n${l}x${r}`:c?`${t}\nx=${l}`:`${t}\ny=${r}`),function(t,e="",n=0,i=0,o="label2d"){t.userData.labels||(t.userData.labels=[]);const l={text:e,dx:n,dy:i,visible:!0,className:o,el:null};t.userData.labels.push(l)}(d,t,l/2,r/2,"text-c-base text-xs")}const f=[0,0,0,l,0,0,l,r,0,0,r,0,0,0,0],p=new i;p.setPositions(f);const h=new n(p,a);h.computeLineDistances(),h.renderOrder=10,h.userData.isBorder=!0,t.add(h),t.add(new e.Group)}function $(t){const n=t.userData?.dim?.x,i=t.userData?.dim?.y;if(null==n||null==i)return[];const o=[];let l=!0;if(t.userData.snappts){l=!!t.userData.snapptsadd;for(let n of t.userData.snappts)o.push(new e.Vector3(n.x||0,n.y||0,0))}return l&&o.push(new e.Vector3(0,0,0),new e.Vector3(n,0,0),new e.Vector3(n,i,0),new e.Vector3(0,i,0)),t.updateWorldMatrix(!0,!1),o.map(e=>e.applyMatrix4(t.matrixWorld))}function k(t){const n=t.userData?.dim?.x,i=t.userData?.dim?.y;if(null==n||null==i)return[];const o=[new e.Vector3(0,0,0),new e.Vector3(n,0,0),new e.Vector3(n,i,0),new e.Vector3(0,i,0)];t.updateWorldMatrix(!0,!1);const l=o.map(e=>e.clone().applyMatrix4(t.matrixWorld));return[[l[0],l[1]],[l[1],l[2]],[l[2],l[3]],[l[3],l[0]]].map(([t,e])=>{const n=e.clone().sub(t);if(0===n.length())return null;n.normalize();const i=-n.y,o=n.x;let l=-(i*t.x+o*t.y);const r=Math.hypot(i,o);let s=i/r,c=o/r,a=l/r;return(s<0||0===s&&c<0)&&(s=-s,c=-c,a=-a),{a:s,b:c,c:a,dir:n,p:t.clone()}}).filter(Boolean)}function D(t,n=0,i=0,o=0,l=0){const s=o-n,c=l-i,a=Math.hypot(s,c);if(!a)return null;const u=new e.Vector3(s/a,c/a,0);let d=-u.y,f=u.x,p=-(d*n+f*i);const h=Math.hypot(d,f);let m=d/h,g=f/h,w=p/h;(m<0||0===m&&g<0)&&(m=-m,g=-g,w=-w);const b={id:t,a:m,b:g,c:w,dir:u,p:new e.Vector3(n,i,0),p2:new e.Vector3(o,l,0)};return r.push(b),b}const{picker:_,pick:S,hitter:z}=function(){const t={},o=new e.Group;o.name="picker",o.visible=!1;const l=500,r=500,{faceGeo:s,borderGeo:c}=x(l,r);t.face=new e.Mesh(s,f),t.face.name="pick_face",t.face.renderOrder=100,t.border=new n(c,h),t.border.computeLineDistances(),t.border.renderOrder=101;const a=new e.PlaneGeometry(50,50);t.l=new e.Mesh(a,m),t.l.position.set(0,250,0),t.l.name="pick_l",t.l.renderOrder=102,t.r=new e.Mesh(a,m),t.r.position.set(l,250,0),t.r.name="pick_r",t.r.renderOrder=102,t.b=new e.Mesh(a,m),t.b.position.set(250,0,0),t.b.name="pick_b",t.b.renderOrder=102,t.t=new e.Mesh(a,m),t.t.position.set(250,r,0),t.t.name="pick_t",t.t.renderOrder=102;const u=new i;u.setPositions([0,0,0,-100,-100,0]),t.rotline=new n(u,h),t.rotline.computeLineDistances(),t.rotline.renderOrder=103,t.rot=new e.Mesh(a,m),t.rot.position.set(-100,-100,0),t.rot.name="pick_rot",t.rot.renderOrder=104,t.rotg=new e.Group,t.rotg.name="pick_rotg",t.rotcircle=new e.Mesh(new e.CircleGeometry(20,16),g),t.rotcircle.renderOrder=104,o.add(t.border,t.face,t.l,t.r,t.t,t.b,t.rot,t.rotline,t.rotcircle);const d=new e.PlaneGeometry(50,50),p=new e.Mesh(d,g);return p.name="hitter",p.renderOrder=200,p.visible=!1,{picker:o,pick:t,hitter:p}}();return{setZ(t){l=t},get linesglobal(){return r},clearlines(){r=[]},addline:D,addlinev:function(t,e,n){return D(t,e,n,e,n+100)},addlineo:function(t,e,n){return D(t,e,n,e+100,n)},picker:_,clearchildren:function(t){for(;t.children.length>0;)t.remove(t.children[0])},pickerel:S,hitter:z,drawLinerif:function({p:t,dir:e},o=1e3,l=2e4){const r=t.clone().addScaledVector(e,-l),c=t.clone().addScaledVector(e,+l),a=new i;a.setPositions([r.x,r.y,0,c.x,c.y,0]);const u=new n(a,s);return u.computeLineDistances(),u.renderOrder=o,u},getfacelinegeom:x,pickerresetcolor:w,redrawgroup:y,linerifMat:s,collegapicker:b,linerifMatE:c,getlayers:function(t){let e=new Set;for(let n of t.children)n.userData.layer&&e.add(n.userData.layer);return[...e]},dopickbox:function(t,e){w();for(let n of t.children)if(n.userData.isBox&&n.userData.id===e)return void b(n);b(void 0)},createBox:async function({x:t,y:n,w:i,h:o,ox:r,oy:s,minx:c,maxx:a,stepx:u,listx:d,miny:f,maxy:p,stepy:h,listy:m,extra:g,rot:w=0,snappts:b,snapptsadd:x=!1,snaplines:v,snaplinesadd:$=!1,color:k=16777215,layer:D="base",id:_,name:S="no"}){function z(t,e,n,i){if(Array.isArray(i))return i.sort((t,e)=>t-e),i;if(n||(n=100),null!=t&&null!=e&&t<e){let i=[t];for(let o=t+n;o<e;o+=n)i.push(o);return i.push(e),i}}d=z(c,a,u,d),m=z(f,p,h,m);const M=new e.Group;return M.position.set(t,n,l),M.rotation.z=e.MathUtils.degToRad(w),M.userData={ori:{x:t,y:n},pivot:{x:r||0,y:s||0},dim:{x:i,y:o},listx:d,listy:m,rot:w,isBox:!0,layer:D,id:_,name:S,extra:g},b&&(M.userData.snappts=b,M.userData.snapptsadd=x),v&&(M.userData.snaplines=v,M.userData.snaplinesadd=$),await y(M,S,i,o,k,!!d,!!m),M},getface:v,lineMat:a,lineMatE:d,lineMatH:u,getptrif:$,rotatenode:function(t,n=void 0,i,o=!1){if(!t?.userData)return;const l=t.userData,r=l.rot||0,s=o?i:r+i;n||(n=l.pivot);const c=n?.x||0,a=n?.y||0,u=new e.Vector3(c,a,0).applyMatrix4(t.matrixWorld),d=t.position.clone(),f=e.MathUtils.degToRad(s-r);d.sub(u).applyAxisAngle(new e.Vector3(0,0,1),f).add(u),t.position.copy(d),t.rotation.z=e.MathUtils.degToRad(s),l.rot=s},getallptrif:function(t,e=.01){const n=[],i=new Set;if(t?.children?.length)for(const o of t.children)if(o.userData?.isBox)for(const t of $(o)){const o=`${Math.round(t.x/e)}|${Math.round(t.y/e)}`;i.has(o)||(i.add(o),n.push(t))}return n},getlinerif:k,getalllinerif:function(t,e=.01,n=.1){const i=[],o=new Set;function l(t){const l=`${Math.round(t.a/e)}|${Math.round(t.b/e)}|${Math.round(t.c/n)}`;o.has(l)||(o.add(l),i.push(t))}if(t?.children?.length)for(const e of t.children)if(e.userData?.isBox)for(const t of k(e))l(t);if(Array.isArray(r))for(const t of r)l(t);return i},lineMatE:d,hitMat:m,hitMatE:g,faceMat:f,faceMatE:p}}({THREE:rt,Line2:ct,LineGeometry:at,LineMaterial:ut}),{dozoomall:H,doresize:P}={dozoomall:function(t={}){const{maxw:e,maxh:n,container:i,camera:o,controls:l,invertY:r=!1}=t,s=e,c=n,a=i.clientWidth/i.clientHeight;let u=s/2,d=c/2;a>=s/c?u=d*a:d=u/a,o.left=-u,o.right=u,r?(o.top=-d,o.bottom=d):(o.top=d,o.bottom=-d),o.zoom=1,o.updateProjectionMatrix(),l.target.set(s/2,c/2,0),o.position.set(s/2,c/2,10),o.lookAt(l.target),l.update()},doresize:function(t={}){const{container:e,renderer:n,camera:i,maxw:o,maxh:l,scene:r,invertY:s=!1}=t;if(!e||!n||!i)return;const c=e.clientWidth,a=e.clientHeight;if(!c||!a)return;n.setSize(c,a);const u=c/a;let d=o/2,f=l/2;u>=o/l?d=f*u:f=d/u,i.left=-d,i.right=d,s?(i.top=-f,i.bottom=f):(i.top=f,i.bottom=-f),i.updateProjectionMatrix(),r.traverse(t=>{t.material&&t.material.isLineMaterial&&t.material.resolution.set(c,a)})}};let V,Y,{maxw:U=6e3}=e,{maxh:q=4e3}=e,{invertY:G=!0}=e,Z="base",{candelete:J=!1}=e,{canrestore:Q=!1}=e,{canadd:tt=!1}=e;function et(t=void 0){if(!t&&y&&y?.node&&y.visible){let{name:t,id:e}=y.node.userDatal;n(7,V=`${e} - ${t}`)}else n(7,V=t)}function nt(t,e){b(t,e),y.visible?(Y||window.addEventListener("keydown",Tt),Y=!0):(n(7,V=void 0),Y=!1,window.removeEventListener("keydown",Tt)),et()}function it(){let t={maxw:U,maxh:q,curlayer:Z,rows:[],construction:[]};for(let e of c.children)e.userData.isBox&&t.rows.push({...e.userData});for(let e of D)t.construction.push({x1:e.p.x,y1:e.p.y,x2:e.p2.x,y2:e.p2.y});return t}async function ot(t){for(t.maxw&&n(24,U=t.maxw),t.maxh&&n(25,q=t.maxh),n(6,Z=t.curlayer),xt=0;c.children.length>0;)c.remove(c.children[0]);if(t?.rows?.length)for(let e of t.rows){let t={...e};t.x=e.ori.x,t.y=e.ori.y,t.w=e.dim.x,t.h=e.dim.y,t.ox=e.pivot.x,t.oy=e.pivot.y,delete t.ori,delete t.dim,delete t.pivot,t.id=++xt,c.add(await w(t))}D.length=0;for(let e of t.construction||[])g(1,e.x1,e.y1,e.x2,e.y2);n(9,vt=M(c)),vt.includes(Z)||n(6,Z=vt[0]),St(Z),dt()}async function lt(t={x:void 0,y:void 0,w:100,h:100,ox:0,oy:0,minx:void 0,maxx:void 0,stepx:void 0,listx:void 0,miny:void 0,maxy:void 0,stepy:void 0,listy:void 0,extra:void 0,rot:0,snappts:void 0,snapptsadd:!1,snaplines:void 0,snaplinesadd:!1,color:16777215,layer:"base",name:"no"}){if(t.id=++xt,void 0===t.x||void 0===t.y)if(y?.visible&&y?.userData?.node){const e=y.userData.dim?.x||0,n=new rt.Vector3(1,0,0).applyQuaternion(y.quaternion),i=y.position.clone().add(n.multiplyScalar(e));t.x=i.x,t.y=i.y,t.rot=rt.MathUtils.radToDeg(y.rotation.z)}else t.x=0,t.y=0,t.rot=0;c.add(await w(t)),n(9,vt=M(c)),vt.includes(Z)||n(6,Z=vt[0]),St(Z),nt(c,t.id)}function dt(){return H({maxw:U,maxh:q,container:i,camera:l,controls:s,invertY:G})}let ft,pt,ht,mt,gt,wt=!1,bt=null,xt=0,vt=[],yt={};function $t(t){t.preventDefault(),m("contextMenu",{x:t.clientX,y:t.clientY})}function kt(t){return t?.userData?.isBox&&t.userData.layer===Z}function Dt(t){if(!wt){if(n(8,wt=!0),bt={mode:gt,startMouse:{x:t.clientX,y:t.clientY},startPickerPos:y.position.clone(),startBoxOri:y.userData?.ori?{...y.userData.ori}:null,startBoxDim:y.userData?.dim?{...y.userData.dim}:null,checkptrif:!0,ptrif:N(c),checklinerif:!0,linerif:A(c)},bt.checklinerif){a.clear();for(let t of bt.linerif){const e=O(t);a.add(e)}}s.enabled=!1,window.addEventListener("pointermove",Ct),window.addEventListener("pointerup",jt)}}function _t(){wt&&(bt?.startPickerPos&&y.position.copy(bt.startPickerPos),Et())}function St(t){if(vt.includes(t)){n(6,Z=t);for(let t of c.children){let e=t.userData.layer==Z,n=t.children.find(t=>t.userData.isBorder);n&&(n.material=e?I:R)}m("changelayer",Z)}}function zt(){if(!y?.userData?.node)return;const t=y.userData.node,e=t.parent;e&&e.remove(t),nt(c,-1),n(9,vt=M(c)),vt.includes(Z)||St(vt[0]),m("change")}function Mt(){if(!y?.userData?.node)return;const t=y.userData.node;t.position.copy(y.position);const e=rt.MathUtils.radToDeg(y.rotation.z);if(t.rotation.z=y.rotation.z,t.userData.rot=e,t.userData.ori.x=t.position.x,t.userData.ori.y=t.position.y,y.userData?.dim){const e=y.userData.dim.x,n=y.userData.dim.y;e===t.userData.dim.x&&n===t.userData.dim.y||(t.userData.dim.x=e,t.userData.dim.y=n,S(t,t.userData.name,e,n,16777215,!!t.userData.listx,!!t.userData.listy))}et(),m("change")}function jt(){wt&&(Mt(),Et())}function Et(){n(8,wt=!1),bt=null,v(a),k.visible=!1,window.removeEventListener("pointermove",Ct),window.removeEventListener("pointerup",jt),s.enabled=!0}function Ct(t){if(!wt||!bt)return;k.visible=!1;const e=i.getBoundingClientRect();n(10,ft=t.clientX),n(11,pt=t.clientY);const o=(t.clientX-e.left)/e.width*2-1,r=-(t.clientY-e.top)/e.height*2+1,s=(bt.startMouse.x-e.left)/e.width*2-1,c=-(bt.startMouse.y-e.top)/e.height*2+1,u=new rt.Vector3(s,c,0).unproject(l),d=new rt.Vector3(o,r,0).unproject(l);let f=d.x-u.x,p=d.y-u.y;if("move"===bt.mode){if(y.position.set(bt.startPickerPos.x+f,bt.startPickerPos.y+p,bt.startPickerPos.z),bt.checkptrif){const t=20,e=T(y);for(const i of e)for(const e of bt.ptrif){if(i.distanceTo(e)<t){const t=e.x-i.x,o=e.y-i.y;return n(5,y.position.x+=t,y),n(5,y.position.y+=o,y),k.position.set(e.x,e.y,0),void(k.visible=!0)}}}if(bt.checklinerif){const t=20,e=T(y);for(let t of a.children)t.material=L;for(const i of e)for(let e=0;e<bt.linerif.length;e++){let o=bt.linerif[e];const l=o.a*i.x+o.b*i.y+o.c;if(Math.abs(l)<t){const t=-l*o.a,i=-l*o.b;return n(5,y.position.x+=t,y),n(5,y.position.y+=i,y),void(a.children[e].material=B)}}}return}const h=(t,e)=>{if(!Array.isArray(e)||!e.length)return t;let n=e[0],i=Math.abs(t-n);for(let o=1;o<e.length;o++){const l=Math.abs(t-e[o]);l<i&&(i=l,n=e[o])}return n},m=new rt.Vector3(1,0,0).applyQuaternion(y.quaternion),g=new rt.Vector3(0,1,0).applyQuaternion(y.quaternion),w=f*m.x+p*m.y,b=f*g.x+p*g.y,x=bt.startBoxDim?.x||0,v=bt.startBoxDim?.y||0;let D=x,_=v;"resize-r"===bt.mode&&(D=x+w),"resize-l"===bt.mode&&(D=x-w),"resize-t"===bt.mode&&(_=v+b),"resize-b"===bt.mode&&(_=v-b),D=Math.max(10,D),_=Math.max(10,_);if(D=h(D,y.userData?.listx),_=h(_,y.userData?.listy),"resize-l"===bt.mode){const t=m.clone().multiplyScalar(x-D);y.position.copy(bt.startPickerPos.clone().add(t))}if("resize-b"===bt.mode){const t=g.clone().multiplyScalar(v-_);y.position.copy(bt.startPickerPos.clone().add(t))}n(5,y.userData.dim.x=D,y),n(5,y.userData.dim.y=_,y),bt.mode.startsWith("resize")&&et(`x=${D} y=${_}`);const{faceGeo:S,borderGeo:z}=E(D,_);$.face.geometry.dispose(),$.border.geometry.dispose(),$.face.geometry=S,$.border.geometry=z,$.l.position.set(0,_/2,0),$.r.position.set(D,_/2,0),$.b.position.set(D/2,0,0),$.t.position.set(D/2,_,0)}async function Tt(t){if(!ht)if(" "!==t.key){if("Delete"===t.key||"Backspace"==t.key)return zt(),void Et();if("Escape"!==t.key){if("r"===t.key||"R"==t.key||"s"==t.key||"S"==t.key){if(t.repeat)return;return F(y,void 0,"r"==t.key?90:"R"==t.key?-90:"s"==t.key?15:-15,!1),void(wt?(bt.startPickerPos=y.position.clone(),bt.startMouse={x:ft,y:pt},bt.startBoxOri=y.userData?.ori?{...y.userData.ori}:null,bt.startBoxDim=y.userData?.dim?{...y.userData.dim}:null):(Mt(),Et()))}}else wt?_t():b(c,-1)}else await async function(){if(!y.visible||!y?.userData?.node)return;const t=y.userData.node;n(14,yt={}),bt&&wt?(n(14,yt.startPos=bt.startPickerPos.clone(),yt),n(14,yt.startRot=bt.startBoxOri?bt.startBoxOri.rot||t.userData.rot||0:t.userData.rot||0,yt)):(n(14,yt.startPos=y.position.clone(),yt),n(14,yt.startRot=0,yt));const e=rt.MathUtils.radToDeg(y.rotation.z)-yt.startRot,i=y.position.clone().sub(yt.startPos),o=new rt.Vector3(i.x,i.y,0).applyAxisAngle(new rt.Vector3(0,0,1),-rt.MathUtils.degToRad(yt.startRot));n(14,yt.x=o.x,yt),n(14,yt.y=o.y,yt),n(14,yt.rot=e,yt),n(14,yt.w=t.userData.dim.x,yt),n(14,yt.h=t.userData.dim.y,yt),n(14,yt.listx=t.userData.listx,yt),n(14,yt.listy=t.userData.listy,yt),n(8,wt=!1),n(12,ht=!0),await X(),m("change")}()}let Nt=0;function Ot(t){const e=i.getBoundingClientRect();h.x=(t.clientX-e.left)/e.width*2-1,h.y=-(t.clientY-e.top)/e.height*2+1,f.setFromCamera(h,l),n(10,ft=t.clientX),n(11,pt=t.clientY),C();const r=f.intersectObjects(o.children,!0);gt="move";for(const e of r){const n=e.object;if(n.name?.startsWith("pick_")&&"pick_face"!==n.name)return"pick_r"===n.name?gt="resize-r":"pick_l"===n.name?gt="resize-l":"pick_t"===n.name?gt="resize-t":"pick_b"===n.name&&(gt="resize-b"),n.material=j,void Dt(t)}for(const e of r){const n=e.object;if("pick_face"===n.name)return n.material=z,void Dt(t)}let s=[];for(const t of r){let e=t.object;for(;e&&!e.userData?.isBox;)e=e.parent;if(e){if(!kt(e))continue;s.push(e)}}if(s.length){Nt=(Nt+1)%s.length;let t=s[Nt];return void nt(c,t.userData.id)}nt(c,-1)}function At(){return P({container:i,renderer:r,camera:l,maxw:U,maxh:q,scene:o,invertY:G})}W(async()=>{o=new rt.Scene,_(G?-1:1),r=new rt.WebGLRenderer({antialias:!0,alpha:!0}),r.setClearColor(0,0),r.setSize(i.clientWidth,i.clientHeight),i.appendChild(r.domElement),l=new rt.OrthographicCamera(0,1,1,0,-100,100),s=new st(l,r.domElement),s.enableRotate=!1,s.enablePan=!0,s.enableZoom=!0;const t=new rt.Mesh(new rt.PlaneGeometry(U,q),new rt.MeshBasicMaterial({color:15790320}));t.position.set(U/2,q/2,0),o.add(t),o.add(y),n(4,c=new rt.Group),n(4,c.name="boxes",c),o.add(c),o.add(k),a=new rt.Group,a.name="lines",o.add(a),r.domElement.addEventListener("pointerdown",Ot),r.domElement.addEventListener("contextmenu",$t);let e=new Set;const u=()=>{r.render(o,l);const t=r.domElement.getBoundingClientRect();let n=new Set;o.traverse(e=>{const o=e.userData?.labels;if(o)for(let r of o){if(!r.visible)continue;r.el||(r.el=document.createElement("div"),r.el.className=r.className,i.appendChild(r.el)),n.add(r.el);const o=new rt.Vector3(r.dx||0,r.dy||0,0),s=e.localToWorld(o.clone()).project(l),c=(.5*s.x+.5)*t.width,a=(.5*-s.y+.5)*t.height;r.el.style.position="absolute",r.el.style.whiteSpace="pre-line",r.el.style.pointerEvents="none",r.el.style.left=`${c}px`,r.el.style.top=`${a}px`;const u=new rt.Quaternion;e.getWorldQuaternion(u);const d=(new rt.Euler).setFromQuaternion(u,"XYZ").z;r.el.style.transform=`translate(-50%, -50%) rotate(${d}rad)`,r.el.textContent=r.text}});for(let t of e)n.has(t)||t.remove();e=n,requestAnimationFrame(u)};u();const d=new ResizeObserver(At);return d.observe(i),m("init"),()=>{Y&&window.removeEventListener("keydown",Tt),r?.dispose();for(let t of e)t.remove();d?.disconnect()}});return t.$$set=t=>{"maxw"in t&&n(24,U=t.maxw),"maxh"in t&&n(25,q=t.maxh),"invertY"in t&&n(26,G=t.invertY),"candelete"in t&&n(0,J=t.candelete),"canrestore"in t&&n(1,Q=t.canrestore),"canadd"in t&&n(2,tt=t.canadd),"$$scope"in t&&n(45,d=t.$$scope)},[J,Q,tt,i,c,y,Z,V,wt,vt,ft,pt,ht,mt,yt,m,x,nt,dt,_t,St,zt,Mt,Et,U,q,G,function(){return{setcurrentlayer:St,getambiente:it,setambiente:ot,addbox:lt,zoomall:dt}},u,function(t){p[t?"unshift":"push"](()=>{i=t,n(3,i)})},async()=>{nt(c,-1),Et(),m("restore")},()=>{zt(),Et()},()=>{m("add")},()=>{dt()},()=>{m("save")},t=>{_t(),nt(c,-1),St(t)},function(t){p[t?"unshift":"push"](()=>{mt=t,n(13,mt)})},function(e){t.$$.not_equal(yt.x,e)&&(yt.x=e,n(14,yt))},function(e){t.$$.not_equal(yt.y,e)&&(yt.y=e,n(14,yt))},function(e){t.$$.not_equal(yt.rot,e)&&(yt.rot=e,n(14,yt))},function(e){t.$$.not_equal(yt.w,e)&&(yt.w=e,n(14,yt))},function(e){t.$$.not_equal(yt.h,e)&&(yt.h=e,n(14,yt))},t=>{const e=yt.x||0,i=yt.y||0,o=yt.rot||0,l=new rt.Vector3(e,i,0).applyAxisAngle(new rt.Vector3(0,0,1),rt.MathUtils.degToRad(yt.startRot));y.position.copy(yt.startPos.clone().add(l)),n(5,y.rotation.z=rt.MathUtils.degToRad(yt.startRot+o),y),yt.listx&&n(5,y.userData.dim.x=yt.w,y),yt.listy&&n(5,y.userData.dim.y=yt.h,y),n(8,wt=!0),Mt(),Et(),x(y.userData.node,!0),n(12,ht=!1)},function(t){ht=t,n(12,ht)},t=>{n(8,wt=!0),_t(),n(12,ht=!1)},d]}class wd extends t{constructor(t){super(),e(this,t,gd,md,n,{maxw:24,maxh:25,invertY:26,candelete:0,canrestore:1,canadd:2,getdati:27},null,[-1,-1,-1,-1])}get getdati(){return this.$$.ctx[27]}}function bd(t,e,n=100){t&&e&&e.querySelectorAll&&setTimeout(()=>{var t=e.querySelectorAll("input,select,area");(t&&t[0]||(t=e.querySelectorAll("button"))&&t[0])&&t[0].focus()},n)}export{Dt as Area,zt as Badge,An as Bfollow,bn as Bicon,Tn as Bmenu,Bn as Bpop,qn as Btn,Qn as BtnCerca,ii as BtnFile,wd as Cad2d,si as Check,hi as Contenitore,bi as ContenitoreXY,Ci as Cropper,vr as Dragbar,wr as Dtable,Au as Editmd,Tr as Group,en as Icon,Br as Img,ns as Imulti,jo as Input,Yi as Inputdata,Pu as JsEdit,As as Json,Ls as Libloader,od as LogoCroswil,Ys as Lorem,ju as Md,Pc as Menu,Ks as Messaggio,Wo as Msg,ic as Pdf,gc as Range,Uu as RuleEdit,rc as Scroller,aa as Sinput,dc as Stars,Dn as T,ma as Tab,_a as Tabs,ed as Toast,pn as Tooltip,La as TreeCheck,Ka as User,tu as Wait,bd as autofocus,ln as extendcommons,ht as formatDate,pt as getdim,wt as listfromstring,ft as myuuid,yt as strDate,mt as toDateStr,xt as toEuro,bt as tonum};
|