croswil_comp_adm 2.0.21 → 2.0.23
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 +2 -1
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 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,h("select",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};
|
|
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};
|